From a05e4a9eb01601bded9877a7d6a25f00059e3fe5 Mon Sep 17 00:00:00 2001 From: Shreyaschorge <37466979+Shreyaschorge@users.noreply.github.com> Date: Fri, 8 Nov 2024 11:53:04 +0530 Subject: [PATCH] Fix v1 breaking changes after operationId update (#234) * Generate code and fix breaking changes due to operationId update in OAS * Patch update: v1.69.1 * Update breaking changes for updated openapi-generator-config --- package.json | 2 +- src/neynar-api/common/version.ts | 2 +- src/neynar-api/neynar-api-client.ts | 115 +- src/neynar-api/v2/client.ts | 901 ++++--- .../.openapi-generator/FILES | 20 +- .../v2/openapi-farcaster/apis/action-api.ts | 84 +- .../v2/openapi-farcaster/apis/ban-api.ts | 283 ++- .../v2/openapi-farcaster/apis/block-api.ts | 279 +- .../v2/openapi-farcaster/apis/cast-api.ts | 1141 ++++++--- .../v2/openapi-farcaster/apis/channel-api.ts | 2240 ++++++++++++----- .../v2/openapi-farcaster/apis/feed-api.ts | 1954 +++++++++----- .../v2/openapi-farcaster/apis/fname-api.ts | 82 +- .../v2/openapi-farcaster/apis/follows-api.ts | 605 +++-- .../v2/openapi-farcaster/apis/frame-api.ts | 1130 ++++++--- .../v2/openapi-farcaster/apis/mute-api.ts | 350 ++- .../apis/notifications-api.ts | 569 +++-- .../v2/openapi-farcaster/apis/reaction-api.ts | 538 ++-- .../v2/openapi-farcaster/apis/signer-api.ts | 632 +++-- .../v2/openapi-farcaster/apis/storage-api.ts | 228 +- .../openapi-farcaster/apis/subscribers-api.ts | 333 ++- .../v2/openapi-farcaster/apis/user-api.ts | 1798 ++++++++----- .../v2/openapi-farcaster/apis/webhook-api.ts | 411 ++- .../models/bulk-users-by-address-response.ts | 29 + ...me-request.ts => delete-frame-req-body.ts} | 6 +- ...e.ts => fetch-feed-for-you400-response.ts} | 4 +- ...h-frame-meta-tags-from-url200-response.ts} | 6 +- ...webhook-put-req-body-all-of.ts => fids.ts} | 12 +- .../models/for-you-provider.ts | 1 - .../models/frame-button-action-type.ts | 6 +- .../v2/openapi-farcaster/models/index.ts | 20 +- ...t.ts => invite-channel-member-req-body.ts} | 12 +- ...t.ts => neynar-frame-creation-req-body.ts} | 8 +- ...est.ts => neynar-frame-update-req-body.ts} | 10 +- .../models/remove-channel-member-req-body.ts | 53 + ....ts => respond-channel-invite-req-body.ts} | 12 +- .../models/user-power-lite-response-result.ts | 9 +- ...t.ts => validate-frame-action-req-body.ts} | 14 +- .../models/webhook-put-req-body.ts | 37 +- .../v2/openapi-stp/.openapi-generator/FILES | 1 + src/neynar-api/v2/openapi-stp/apis/stpapi.ts | 130 +- src/neynar-api/v2/openapi-stp/models/index.ts | 1 + .../models/subscription-check-response.ts | 29 + src/oas | 2 +- templates/apiInner.mustache | 490 ++++ 44 files changed, 10398 insertions(+), 4191 deletions(-) create mode 100644 src/neynar-api/v2/openapi-farcaster/models/bulk-users-by-address-response.ts rename src/neynar-api/v2/openapi-farcaster/models/{delete-neynar-frame-request.ts => delete-frame-req-body.ts} (79%) rename src/neynar-api/v2/openapi-farcaster/models/{feed-for-you400-response.ts => fetch-feed-for-you400-response.ts} (88%) rename src/neynar-api/v2/openapi-farcaster/models/{frame-from-url200-response.ts => fetch-frame-meta-tags-from-url200-response.ts} (79%) rename src/neynar-api/v2/openapi-farcaster/models/{webhook-put-req-body-all-of.ts => fids.ts} (68%) rename src/neynar-api/v2/openapi-farcaster/models/{remove-channel-member-request.ts => invite-channel-member-req-body.ts} (78%) rename src/neynar-api/v2/openapi-farcaster/models/{neynar-frame-creation-request.ts => neynar-frame-creation-req-body.ts} (80%) rename src/neynar-api/v2/openapi-farcaster/models/{neynar-frame-update-request.ts => neynar-frame-update-req-body.ts} (79%) create mode 100644 src/neynar-api/v2/openapi-farcaster/models/remove-channel-member-req-body.ts rename src/neynar-api/v2/openapi-farcaster/models/{respond-channel-invite-request.ts => respond-channel-invite-req-body.ts} (77%) rename src/neynar-api/v2/openapi-farcaster/models/{validate-frame-request.ts => validate-frame-action-req-body.ts} (80%) create mode 100644 src/neynar-api/v2/openapi-stp/models/subscription-check-response.ts create mode 100644 templates/apiInner.mustache diff --git a/package.json b/package.json index fc62801e..91672f84 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@neynar/nodejs-sdk", - "version": "1.69.0", + "version": "1.69.1", "description": "SDK to interact with Neynar APIs (https://docs.neynar.com/)", "main": "./build/index.js", "types": "./build/index.d.ts", diff --git a/src/neynar-api/common/version.ts b/src/neynar-api/common/version.ts index 610aea1f..5c354ecb 100644 --- a/src/neynar-api/common/version.ts +++ b/src/neynar-api/common/version.ts @@ -1 +1 @@ -export const version = "1.69.0"; \ No newline at end of file +export const version = "1.69.1"; \ No newline at end of file diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index a2ceaea6..314ebfbf 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -37,8 +37,6 @@ import { UsersActiveChannelsResponse, NeynarFrame, DeleteFrameResponse, - NeynarFrameUpdateRequest, - NeynarFrameCreationRequest, UserFIDResponse, RegisterUserResponse, DeveloperManagedSigner, @@ -85,6 +83,8 @@ import { FarcasterActionReqBodyAction, UpdateUserReqBodyLocation, PostCastReqBodyEmbeds, + NeynarFrameUpdateReqBody, + NeynarFrameCreationReqBody, } from "./v2/openapi-farcaster"; import { @@ -773,7 +773,7 @@ export class NeynarAPIClient { } /** - * Retrieves information status of a signer by passing in a signer_uuid + * Retrieves information status of a signer by passing in a signerUuid * * @param {string} signerUuid - The unique identifier (UUID) of the signer to be fetched. * @@ -786,7 +786,7 @@ export class NeynarAPIClient { * console.log('Signer Details:', response); // Outputs the details of the signer * }); * - * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/signer). + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/lookup-signer). */ public async lookupSigner(signerUuid: string): Promise { return await this.clients.v2.lookupSigner(signerUuid); @@ -869,7 +869,7 @@ export class NeynarAPIClient { * console.log('Developer Managed Signer Status:', response); * }); * - * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/developer-managed-signer). + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/lookup-developer-managed-signer). */ public async lookupDeveloperManagedSigner( publicKey: string @@ -1064,37 +1064,6 @@ export class NeynarAPIClient { return await this.clients.v2.fetchPowerUsersLite(); } - /** - * Retrieves a list of active users, where "active" is determined by the Warpcast active algorithm. - * The information about active users is updated every 12 hours. This method is ideal for identifying - * users who are currently engaging with the platform. - * - * @param {Object} [options] - Optional parameters to customize the request. - * @param {number} [options.limit] - Number of results to retrieve, with a default of 25 and a maximum of 150. - * @param {string} [options.cursor] - Pagination cursor for fetching specific subsets of results. - * Omit this parameter for the initial request. - * - * @returns {Promise} A promise that resolves to a `UsersResponse` object, - * containing a list of active users and any relevant pagination information. - * - * @example - * // Example: Fetch a list of active users with a limit and pagination cursor - * client.fetchActiveUsers({ - * limit: 50, - * // cursor: "nextPageCursor" // Omit this parameter for the initial request - * }).then(response => { - * console.log('Active Users:', response); - * }); - * - * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/active-users). - */ - public async fetchActiveUsers(options?: { - limit?: number; - cursor?: string; - }): Promise { - return await this.clients.v2.fetchActiveUsers(options); - } - /** * Removes verification for an eth address for the user. * (In order to delete verification signer_uuid must be approved) @@ -1525,25 +1494,25 @@ export class NeynarAPIClient { return await this.clients.v2.lookupUserByUsernameV2(username, options); } - /** + /** * Retrieves users by their location, specified by latitude and longitude coordinates. - * + * * @param {number} latitude - The latitude coordinate of the location. * @param {number} longitude - The longitude coordinate of the location. * @param {Object} [options] - Optional parameters to tailor the request. * @param {number} [options.viewerFid] - The FID of the user viewing this information, used for providing contextual data specific to the viewer. * @param {number} [options.limit] - The number of users to fetch per request. Defaults to 25 with a maximum of 100. * @param {string} [options.cursor] - Pagination cursor for fetching specific subsets of results. - * - * @returns {Promise} A promise that resolves to a `UsersResponse` object, + * + * @returns {Promise} A promise that resolves to a `UsersResponse` object, * containing information about the users at the specified location. - * + * * @example * // Example: Fetch users by location with viewer fid * client.fetchUsersByLocation(37.7749, -122.4194, {viewerFid: 3}).then(response => { * console.log('Users by Location:', response); * }); - * + * * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/user-by-location). */ public async fetchUsersByLocation( @@ -1555,7 +1524,11 @@ export class NeynarAPIClient { cursor?: string; } ): Promise { - return await this.clients.v2.fetchUsersByLocation(latitude, longitude, options); + return await this.clients.v2.fetchUsersByLocation( + latitude, + longitude, + options + ); } // ------------ Cast ------------ @@ -2488,54 +2461,6 @@ export class NeynarAPIClient { return await this.clients.v2.fetchUsersActiveChannels(fid, options); } - /** - * Retrieves a list of users who are active in a given channel, ordered by ascending FIDs - * - * @param {string} id - Channel ID for the channel being queried - * @param {boolean} hasRootCastAuthors - Include users who posted the root cast in the channel - * @param {Object} [options] - Optional parameters for the request - * @param {boolean} [options.hasCastLikers] - Include users who liked a cast in the channel - * @param {boolean} [options.hasCastRecasters] - Include users who recasted a cast in the channel - * @param {boolean} [options.hasReplyAuthors] - Include users who replied to a cast in the channel - * @param {number} [options.limit] - Number of results to retrieve (default 25, max 100). - * @param {string} [options.cursor] - Pagination cursor for the next set of results, - * omit this parameter for the initial request. - * - * @returns {Promise} A promise that resolves to a `UsersResponse` object, - * containing the users active in the specified channel. - * - * @example - * // Example: Retrieve active users in a channel - * client.fetchActiveUsersInSingleChannel('neynar', true, { - * hasCastLikers: true, - * hasCastRecasters: true, - * hasReplyAuthors: true, - * limit: 10 - * // cursor: "nextPageCursor" // Omit this parameter for the initial request. - * }).then(response => { - * console.log('Active Users:', response); - * }); - * - * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/channel-users). - */ - public async fetchActiveUsersInSingleChannel( - id: string, - hasRootCastAuthors: boolean, - options?: { - hasCastLikers?: boolean; - hasCastRecasters?: boolean; - hasReplyAuthors?: boolean; - limit?: number; - cursor?: string; - } - ): Promise { - return await this.clients.v2.fetchActiveUsersInSingleChannel( - id, - hasRootCastAuthors, - options - ); - } - /** * Follow a channel. * @@ -3237,7 +3162,7 @@ export class NeynarAPIClient { * Creates a new frame with a list of pages. This method enables developers to add new frames * to their content offerings, identified by the provided API key. * - * @param {NeynarFrameCreationRequest} neynarFrameCreationRequest - The request object containing the details for the new frame. + * @param {NeynarFrameCreationReqBody} neynarFrameCreationRequest - The request object containing the details for the new frame. * * @returns {Promise} A promise that resolves to the newly created frame object. * @@ -3254,7 +3179,7 @@ export class NeynarAPIClient { * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/publish-neynar-frame). */ public async publishNeynarFrame( - neynarFrameCreationRequest: NeynarFrameCreationRequest + neynarFrameCreationRequest: NeynarFrameCreationReqBody ): Promise { return await this.clients.v2.publishNeynarFrame(neynarFrameCreationRequest); } @@ -3263,7 +3188,7 @@ export class NeynarAPIClient { * Updates an existing frame with new content or properties, assuming the frame was created by the developer, * as identified by the provided API key. This method allows for modifying frames post-creation. * - * @param {NeynarFrameUpdateRequest} neynarFrame - The new content or properties for the frame being updated. + * @param {NeynarFrameUpdateReqBody} neynarFrame - The new content or properties for the frame being updated. * * @returns {Promise} A promise that resolves to a `NeynarFrame` object, * reflecting the updated state of the frame. @@ -3281,7 +3206,7 @@ export class NeynarAPIClient { * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/update-neynar-frame). */ public async updateNeynarFrame( - neynarFrame: NeynarFrameUpdateRequest + neynarFrame: NeynarFrameUpdateReqBody ): Promise { return await this.clients.v2.updateNeynarFrame(neynarFrame); } diff --git a/src/neynar-api/v2/client.ts b/src/neynar-api/v2/client.ts index ae4c8e08..f47eedb1 100644 --- a/src/neynar-api/v2/client.ts +++ b/src/neynar-api/v2/client.ts @@ -44,12 +44,8 @@ import { FrameApi, FrameActionReqBody, FrameAction, - ValidateFrameRequest, ValidateFrameActionResponse, UsersResponse, - DeleteNeynarFrameRequest, - NeynarFrameUpdateRequest, - NeynarFrameCreationRequest, DeveloperManagedSigner, WebhookApi, WebhookResponse, @@ -98,9 +94,7 @@ import { NotificationType, EmbedType, ChannelMemberRole, - RespondChannelInviteRequest, CastConversationSortType, - RemoveChannelMemberRequest, ChannelMemberListResponse, ChannelFollowReqBody, FollowersResponse, @@ -110,6 +104,13 @@ import { UpdateUserReqBodyLocation, PostCastReqBodyEmbeds, PostCastReqBody, + ValidateFrameActionReqBody, + DeleteFrameReqBody, + NeynarFrameUpdateReqBody, + NeynarFrameCreationReqBody, + InviteChannelMemberReqBody, + RemoveChannelMemberReqBody, + RespondChannelInviteReqBody, } from "./openapi-farcaster"; import axios, { AxiosError, AxiosInstance } from "axios"; import { silentLogger, Logger } from "../common/logger"; @@ -289,9 +290,9 @@ export class NeynarV2APIClient { action: action, }; - const response = await this.apis.action.publishFarcasterAction( - farcasterActionReqBody - ); + const response = await this.apis.action.publishFarcasterAction({ + farcaster_action_req_body: farcasterActionReqBody, + }); return response.data; } @@ -319,10 +320,10 @@ export class NeynarV2APIClient { client_id: string, code: AuthorizationUrlResponseType ): Promise { - const response = await this.apis.signer.fetchAuthorizationUrl( + const response = await this.apis.signer.fetchAuthorizationUrl({ client_id, - code - ); + response_type: code, + }); return response.data; } @@ -360,10 +361,12 @@ export class NeynarV2APIClient { * console.log('Signer Details:', response); // Outputs the details of the signer * }); * - * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/signer). + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/lookup-signer). */ public async lookupSigner(signerUuid: string): Promise { - const response = await this.apis.signer.signer(signerUuid); + const response = await this.apis.signer.lookupSigner({ + signer_uuid: signerUuid, + }); return response.data; } @@ -429,9 +432,9 @@ export class NeynarV2APIClient { } : {}), }; - const response = await this.apis.signer.registerSignedKey( - registerSignerKeyReqBody - ); + const response = await this.apis.signer.registerSignedKey({ + register_signer_key_req_body: registerSignerKeyReqBody, + }); return response.data; } @@ -452,12 +455,14 @@ export class NeynarV2APIClient { * console.log('Developer Managed Signer Status:', response); * }); * - * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/developer-managed-signer). + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/lookup-developer-managed-signer). */ public async lookupDeveloperManagedSigner( publicKey: string ): Promise { - const response = await this.apis.signer.developerManagedSigner(publicKey); + const response = await this.apis.signer.lookupDeveloperManagedSigner({ + public_key: publicKey, + }); return response.data; } @@ -518,9 +523,10 @@ export class NeynarV2APIClient { : {}), }; const response = - await this.apis.signer.registerSignedKeyForDeveloperManagedSigner( - registerSignerKeyReqBody - ); + await this.apis.signer.registerSignedKeyForDeveloperManagedSigner({ + register_developer_managed_signed_key_req_body: + registerSignerKeyReqBody, + }); return response.data; } @@ -542,10 +548,12 @@ export class NeynarV2APIClient { * * Note: Ensure the message is properly signed using a developer-managed signer before publishing. * - * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/publish-message). + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/publish-message-to-farcaster). */ public async publishMessageToFarcaster(message: object) { - const response = await this.apis.signer.publishMessage(message); + const response = await this.apis.signer.publishMessageToFarcaster({ + body: message, + }); return response.data; } @@ -567,7 +575,7 @@ export class NeynarV2APIClient { * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/get-fresh-fid). */ public async getFreshAccountFID() { - const response = await this.apis.user.getFreshFid(); + const response = await this.apis.user.getFreshAccountFID(); return response.data; } @@ -609,7 +617,9 @@ export class NeynarV2APIClient { deadline, fname: options?.fname, }; - const response = await this.apis.user.registerUser(registerUserReqBody); + const response = await this.apis.user.registerAccount({ + register_user_req_body: registerUserReqBody, + }); return response.data; } @@ -639,11 +649,11 @@ export class NeynarV2APIClient { cursor?: string; viewerFid?: number; }): Promise { - const response = await this.apis.user.powerUsers( - options?.viewerFid, - options?.limit, - options?.cursor - ); + const response = await this.apis.user.fetchPowerUsers({ + cursor: options?.cursor, + limit: options?.limit, + viewer_fid: options?.viewerFid, + }); return response.data; } @@ -664,42 +674,7 @@ export class NeynarV2APIClient { * For more information, refer to the [Farcaster documentation](https://docs.neynar.com/reference/user-power-lite). */ public async fetchPowerUsersLite(): Promise { - const response = await this.apis.user.userPowerLite(); - return response.data; - } - - /** - * Retrieves a list of active users, where "active" is determined by the Warpcast active algorithm. - * The information about active users is updated every 12 hours. This method is ideal for identifying - * users who are currently engaging with the platform. - * - * @param {Object} [options] - Optional parameters to customize the request. - * @param {number} [options.limit] - Number of results to retrieve, with a default of 25 and a maximum of 150. - * @param {string} [options.cursor] - Pagination cursor for fetching specific subsets of results. - * Omit this parameter for the initial request. - * - * @returns {Promise} A promise that resolves to a `UsersResponse` object, - * containing a list of active users and any relevant pagination information. - * - * @example - * // Example: Fetch a list of active users with a limit and pagination cursor - * client.fetchActiveUsers({ - * limit: 50, - * // cursor: "nextPageCursor" // Omit this parameter for the initial request - * }).then(response => { - * console.log('Active Users:', response); - * }); - * - * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/active-users). - */ - public async fetchActiveUsers(options?: { - limit?: number; - cursor?: string; - }): Promise { - const response = await this.apis.user.activeUsers( - options?.limit, - options?.cursor - ); + const response = await this.apis.user.fetchPowerUsersLite(); return response.data; } @@ -730,9 +705,9 @@ export class NeynarV2APIClient { address, }; - const response = await this.apis.user.farcasterUserVerificationDelete( - removeVerificationReqBody - ); + const response = await this.apis.user.deleteVerification({ + remove_verification_req_body: removeVerificationReqBody, + }); return response.data; } @@ -769,9 +744,9 @@ export class NeynarV2APIClient { eth_signature: ethSignature, }; - const response = await this.apis.user.farcasterUserVerificationPost( - addVerificationReqBody - ); + const response = await this.apis.user.publishVerification({ + add_verification_req_body: addVerificationReqBody, + }); return response.data; } @@ -803,7 +778,9 @@ export class NeynarV2APIClient { target_fids: targetFids, }; - const response = await this.apis.user.followUser(followReqBody); + const response = await this.apis.user.followUser({ + follow_req_body: followReqBody, + }); return response.data; } @@ -834,7 +811,9 @@ export class NeynarV2APIClient { signer_uuid: signerUuid, target_fids: targetFids, }; - const response = await this.apis.user.unfollowUser(followReqBody); + const response = await this.apis.user.unfollowUser({ + follow_req_body: followReqBody, + }); return response.data; } @@ -887,7 +866,9 @@ export class NeynarV2APIClient { display_name: options?.displayName, location: options?.location, }; - const response = await this.apis.user.updateUser(updateUserReqBody); + const response = await this.apis.user.updateUser({ + update_user_req_body: updateUserReqBody, + }); return response.data; } @@ -919,7 +900,10 @@ export class NeynarV2APIClient { if (fids.length > 100) throw new Error("Maximum number of fids allowed is 100"); const _fids = fids.join(","); - const response = await this.apis.user.userBulk(_fids, options?.viewerFid); + const response = await this.apis.user.fetchBulkUsers({ + fids: _fids, + viewer_fid: options?.viewerFid, + }); return response.data; } @@ -966,11 +950,11 @@ export class NeynarV2APIClient { const _addresses = addresses.join(","); const _addressTypes = options?.addressTypes && options?.addressTypes.join(","); - const response = await this.apis.user.userBulkByAddress( - _addresses, - _addressTypes, - options?.viewerFid - ); + const response = await this.apis.user.fetchBulkUsersByEthereumAddress({ + addresses: _addresses, + address_types: _addressTypes, + viewer_fid: options?.viewerFid, + }); return response.data; } @@ -1000,12 +984,12 @@ export class NeynarV2APIClient { cursor?: string; } ): Promise { - const response = await this.apis.user.userSearch( + const response = await this.apis.user.searchUser({ q, - viewerFid, - options?.limit, - options?.cursor - ); + viewer_fid: viewerFid, + cursor: options?.cursor, + limit: options?.limit, + }); return response.data; } @@ -1028,9 +1012,9 @@ export class NeynarV2APIClient { public async lookupUserByCustodyAddress( custodyAddress: string ): Promise { - const response = await this.apis.user.lookupUserByCustodyAddress( - custodyAddress - ); + const response = await this.apis.user.lookupUserByCustodyAddress({ + custody_address: custodyAddress, + }); return response.data; } @@ -1058,32 +1042,32 @@ export class NeynarV2APIClient { viewerFid?: number; } ): Promise { - const response = await this.apis.user.userByUsernameV2( + const response = await this.apis.user.lookupUserByUsername({ username, - options?.viewerFid - ); + viewer_fid: options?.viewerFid, + }); return response.data; } /** * Retrieves users by their location, specified by latitude and longitude coordinates. - * + * * @param {number} latitude - The latitude coordinate of the location. * @param {number} longitude - The longitude coordinate of the location. * @param {Object} [options] - Optional parameters to tailor the request. * @param {number} [options.viewerFid] - The FID of the user viewing this information, used for providing contextual data specific to the viewer. * @param {number} [options.limit] - The number of users to fetch per request. Defaults to 25 with a maximum of 100. * @param {string} [options.cursor] - Pagination cursor for fetching specific subsets of results. - * - * @returns {Promise} A promise that resolves to a `UsersResponse` object, + * + * @returns {Promise} A promise that resolves to a `UsersResponse` object, * containing information about the users at the specified location. - * + * * @example * // Example: Fetch users by location with viewer fid * client.fetchUsersByLocation(37.7749, -122.4194, {viewerFid: 3}).then(response => { * console.log('Users by Location:', response); * }); - * + * * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/user-by-location). */ public async fetchUsersByLocation( @@ -1095,13 +1079,13 @@ export class NeynarV2APIClient { cursor?: string; } ): Promise { - const response = await this.apis.user.fetchUsersByLocation( + const response = await this.apis.user.fetchUsersByLocation({ latitude, longitude, - options?.viewerFid, - options?.limit, - options?.cursor - ); + viewer_fid: options?.viewerFid, + limit: options?.limit, + cursor: options?.cursor, + }); return response.data; } @@ -1140,11 +1124,11 @@ export class NeynarV2APIClient { viewerFid?: number; } ): Promise { - const response = await this.apis.cast.cast( - castHashOrUrl, + const response = await this.apis.cast.lookupCastByHashOrWarpcastUrl({ + identifier: castHashOrUrl, type, - options?.viewerFid - ); + viewer_fid: options?.viewerFid, + }); return response.data; } @@ -1185,11 +1169,11 @@ export class NeynarV2APIClient { } ): Promise { const _castsHashes = castsHashes.join(","); - const response = await this.apis.cast.casts( - _castsHashes, - options?.viewerFid, - options?.sortType - ); + const response = await this.apis.cast.fetchBulkCasts({ + casts: _castsHashes, + viewer_fid: options?.viewerFid, + sort_type: options?.sortType, + }); return response.data; } @@ -1282,17 +1266,18 @@ export class NeynarV2APIClient { cursor?: string; } ): Promise { - const response = await this.apis.cast.castConversation( - castHashOrUrl, + const response = await this.apis.cast.lookupCastConversation({ + identifier: castHashOrUrl, type, - options?.replyDepth, - options?.includeChronologicalParentCasts, - options?.viewerFid, - options?.sortType, - options?.fold, - options?.limit, - options?.cursor - ); + viewer_fid: options?.viewerFid, + reply_depth: options?.replyDepth, + include_chronological_parent_casts: + options?.includeChronologicalParentCasts, + sort_type: options?.sortType, + fold: options?.fold, + limit: options?.limit, + cursor: options?.cursor, + }); return response.data; } @@ -1333,16 +1318,16 @@ export class NeynarV2APIClient { cursor?: string; } ): Promise { - const response = await this.apis.cast.castSearch( + const response = await this.apis.cast.searchCasts({ q, - options?.authorFid, - options?.viewerFid, - options?.parentUrl, - options?.channelId, - options?.priorityMode, - options?.limit, - options?.cursor - ); + author_fid: options?.authorFid, + viewer_fid: options?.viewerFid, + parent_url: options?.parentUrl, + channel_id: options?.channelId, + priority_mode: options?.priorityMode, + limit: options?.limit, + cursor: options?.cursor, + }); return response.data; } @@ -1397,7 +1382,9 @@ export class NeynarV2APIClient { idem: options?.idem, parent_author_fid: options?.parent_author_fid, }; - const response = await this.apis.cast.postCast(postCastReqBody); + const response = await this.apis.cast.publishCast({ + post_cast_req_body: postCastReqBody, + }); return response.data.cast; } @@ -1434,7 +1421,9 @@ export class NeynarV2APIClient { signer_uuid: signerUuid, target_hash: castHash, }; - const response = await this.apis.cast.deleteCast(deleteCastReqBody); + const response = await this.apis.cast.deleteCast({ + delete_cast_req_body: deleteCastReqBody, + }); return response.data; } @@ -1462,11 +1451,11 @@ export class NeynarV2APIClient { cursor?: string; } ): Promise { - const response = await this.apis.cast.composerList( + const response = await this.apis.cast.fetchComposerActions({ list, - options?.limit, - options?.cursor - ); + limit: options?.limit, + cursor: options?.cursor, + }); return response.data; } @@ -1522,21 +1511,21 @@ export class NeynarV2APIClient { ): Promise { const _fids = options?.fids?.join(","); - const response = await this.apis.feed.feed( - feedType, - options?.filterType, - options?.fid, - _fids, - options?.parentUrl, - options?.channelId, - options?.membersOnly, - options?.embedUrl, - options?.embedTypes, - options?.withRecasts, - options?.limit, - options?.cursor, - options?.viewerFid - ); + const response = await this.apis.feed.fetchFeed({ + feed_type: feedType, + filter_type: options?.filterType, + fid: options?.fid, + fids: _fids, + parent_url: options?.parentUrl, + channel_id: options?.channelId, + members_only: options?.membersOnly, + embed_url: options?.embedUrl, + embed_types: options?.embedTypes, + with_recasts: options?.withRecasts, + limit: options?.limit, + cursor: options?.cursor, + viewer_fid: options?.viewerFid, + }); return response.data; } @@ -1578,16 +1567,16 @@ export class NeynarV2APIClient { } ): Promise { const _channelIds = channelIds.join(","); - const response = await this.apis.feed.feedChannels( - _channelIds, - options?.withRecasts, - options?.viewerFid, - options?.withReplies, - options?.membersOnly, - options?.limit, - options?.cursor, - options?.shouldModerate - ); + const response = await this.apis.feed.fetchFeedByChannelIds({ + channel_ids: _channelIds, + with_recasts: options?.withRecasts, + with_replies: options?.withReplies, + members_only: options?.membersOnly, + limit: options?.limit, + cursor: options?.cursor, + viewer_fid: options?.viewerFid, + should_moderate: options?.shouldModerate, + }); return response.data; } @@ -1624,14 +1613,14 @@ export class NeynarV2APIClient { } ): Promise { const _parentUrls = parentUrls.join(","); - const response = await this.apis.feed.feedParentUrls( - _parentUrls, - options?.withRecasts, - options?.viewerFid, - options?.withReplies, - options?.limit, - options?.cursor - ); + const response = await this.apis.feed.fetchFeedByParentUrls({ + parent_urls: _parentUrls, + with_recasts: options?.withRecasts, + with_replies: options?.withReplies, + limit: options?.limit, + cursor: options?.cursor, + viewer_fid: options?.viewerFid, + }); return response.data; } @@ -1670,13 +1659,13 @@ export class NeynarV2APIClient { viewerFid?: number; } ): Promise { - const response = await this.apis.feed.feedFollowing( + const response = await this.apis.feed.fetchUserFollowingFeed({ fid, - options?.viewerFid, - options?.withRecasts, - options?.limit, - options?.cursor - ); + with_recasts: options?.withRecasts, + limit: options?.limit, + cursor: options?.cursor, + viewer_fid: options?.viewerFid, + }); return response.data; } @@ -1728,14 +1717,14 @@ export class NeynarV2APIClient { providerMetadata?: string; } ): Promise { - const response = await this.apis.feed.feedForYou( + const response = await this.apis.feed.fetchFeedForYou({ fid, - options?.viewerFid, - options?.provider, - options?.limit, - options?.cursor, - options?.providerMetadata - ); + viewer_fid: options?.viewerFid, + limit: options?.limit, + cursor: options?.cursor, + provider: options?.provider, + provider_metadata: options?.providerMetadata, + }); return response.data; } @@ -1765,10 +1754,10 @@ export class NeynarV2APIClient { viewerFid?: number; } ): Promise { - const response = await this.apis.feed.feedUserPopular( + const response = await this.apis.feed.fetchPopularCastsByUser({ fid, - options?.viewerFid - ); + viewer_fid: options?.viewerFid, + }); return response.data; } @@ -1815,15 +1804,15 @@ export class NeynarV2APIClient { channelId?: string; } ): Promise { - const response = await this.apis.feed.feedUserCasts( + const response = await this.apis.feed.fetchCastsForUser({ fid, - options?.viewerFid, - options?.limit, - options?.cursor, - options?.includeReplies, - options?.parentUrl, - options?.channelId - ); + viewer_fid: options?.viewerFid, + limit: options?.limit, + cursor: options?.cursor, + include_replies: options?.includeReplies, + parent_url: options?.parentUrl, + channel_id: options?.channelId, + }); return response.data; } @@ -1858,13 +1847,13 @@ export class NeynarV2APIClient { viewerFid?: number; } ): Promise { - const response = await this.apis.feed.feedUserRepliesRecasts( + const response = await this.apis.feed.fetchRepliesAndRecastsForUser({ fid, - options?.filter, - options?.limit, - options?.cursor, - options?.viewerFid - ); + filter: options?.filter, + limit: options?.limit, + cursor: options?.cursor, + viewer_fid: options?.viewerFid, + }); return response.data; } @@ -1894,11 +1883,11 @@ export class NeynarV2APIClient { cursor?: string; viewerFid?: number; }) { - const response = await this.apis.feed.feedFrames( - options?.limit, - options?.viewerFid, - options?.cursor - ); + const response = await this.apis.feed.fetchFramesOnlyFeed({ + cursor: options?.cursor, + limit: options?.limit, + viewer_fid: options?.viewerFid, + }); return response.data; } @@ -1945,15 +1934,15 @@ export class NeynarV2APIClient { provider?: FeedTrendingProvider; providerMetadata?: string; }) { - const response = await this.apis.feed.feedTrending( - options?.limit, - options?.cursor, - options?.viewerFid, - options?.timeWindow, - options?.channelId, - options?.provider, - options?.providerMetadata - ); + const response = await this.apis.feed.fetchTrendingFeed({ + channel_id: options?.channelId, + cursor: options?.cursor, + limit: options?.limit, + time_window: options?.timeWindow, + viewer_fid: options?.viewerFid, + provider: options?.provider, + provider_metadata: options?.providerMetadata, + }); return response.data; } @@ -2001,7 +1990,9 @@ export class NeynarV2APIClient { target: castHash, idem: options?.idem, }; - const response = await this.apis.reaction.postReaction(body); + const response = await this.apis.reaction.publishReaction({ + reaction_req_body: body, + }); return response.data; } @@ -2044,7 +2035,9 @@ export class NeynarV2APIClient { reaction_type: reaction, target: castHash, }; - const response = await this.apis.reaction.deleteReaction(body); + const response = await this.apis.reaction.deleteReaction({ + reaction_req_body: body, + }); return response.data; } @@ -2082,13 +2075,13 @@ export class NeynarV2APIClient { type: ReactionsType, options?: { limit?: number; cursor?: string; viewerFid?: number } ): Promise { - const response = await this.apis.reaction.reactionsUser( + const response = await this.apis.reaction.fetchUserReactions({ fid, type, - options?.viewerFid, - options?.limit, - options?.cursor - ); + limit: options?.limit, + cursor: options?.cursor, + viewer_fid: options?.viewerFid, + }); return response.data; } @@ -2119,20 +2112,20 @@ export class NeynarV2APIClient { * console.log('Cast Reactions:', response); // Outputs the casts reactions * }); * - * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/reactions-cast). + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/fetch-cast-reactions). */ public async fetchReactionsForCast( hash: string, types: ReactionsType, options?: { limit?: number; cursor?: string; viewerFid?: number } ): Promise { - const response = await this.apis.reaction.reactionsCast( + const response = await this.apis.reaction.fetchCastReactions({ hash, types, - options?.viewerFid, - options?.limit, - options?.cursor - ); + limit: options?.limit, + cursor: options?.cursor, + viewer_fid: options?.viewerFid, + }); return response.data; } @@ -2170,12 +2163,12 @@ export class NeynarV2APIClient { cursor?: string; } ): Promise { - const response = await this.apis.notifications.notifications( + const response = await this.apis.notifications.fetchAllNotifications({ fid, - options?.type, - options?.priorityMode, - options?.cursor - ); + type: options?.type, + priority_mode: options?.priorityMode, + cursor: options?.cursor, + }); return response.data; } @@ -2212,12 +2205,13 @@ export class NeynarV2APIClient { options?: { priorityMode?: boolean; cursor?: string } ): Promise { const _channelIds = channelIds.join(","); - const response = await this.apis.notifications.notificationsChannel( - fid, - _channelIds, - options?.priorityMode, - options?.cursor - ); + const response = + await this.apis.notifications.fetchChannelNotificationsForUser({ + fid, + channel_ids: _channelIds, + priority_mode: options?.priorityMode, + cursor: options?.cursor, + }); return response.data; } @@ -2250,12 +2244,13 @@ export class NeynarV2APIClient { options?: { priorityMode?: boolean; cursor?: string } ) { const _parentUrls = parentUrls.join(","); - const response = await this.apis.notifications.notificationsParentUrl( - fid, - _parentUrls, - options?.priorityMode, - options?.cursor - ); + const response = + await this.apis.notifications.fetchNotificationsByParentUrlForUser({ + fid, + parent_urls: _parentUrls, + priority_mode: options?.priorityMode, + cursor: options?.cursor, + }); return response.data; } @@ -2286,9 +2281,9 @@ export class NeynarV2APIClient { signer_uuid: signerUuid, ...(options?.type && { type: options.type }), }; - const response = await this.apis.notifications.markNotificationsAsSeen( - reqBody - ); + const response = await this.apis.notifications.markNotificationsAsSeen({ + mark_notifications_as_seen_req_body: reqBody, + }); return response.data; } @@ -2321,11 +2316,11 @@ export class NeynarV2APIClient { cursor?: string; } ): Promise { - const response = await this.apis.channel.userChannels( + const response = await this.apis.channel.fetchUserChannels({ fid, - options?.limit, - options?.cursor - ); + limit: options?.limit, + cursor: options?.cursor, + }); return response.data; } @@ -2357,11 +2352,11 @@ export class NeynarV2APIClient { } ): Promise { const _ids = ids.join(","); - const response = await this.apis.channel.channelDetailsBulk( - _ids, - options?.type, - options?.viewerFid - ); + const response = await this.apis.channel.fetchBulkChannels({ + ids: _ids, + type: options?.type, + viewer_fid: options?.viewerFid, + }); return response.data; } @@ -2394,11 +2389,11 @@ export class NeynarV2APIClient { type?: ChannelType; } ): Promise { - const response = await this.apis.channel.channelDetails( + const response = await this.apis.channel.lookupChannel({ id, - options?.type, - options?.viewerFid - ); + type: options?.type, + viewer_fid: options?.viewerFid, + }); return response.data; } @@ -2428,64 +2423,11 @@ export class NeynarV2APIClient { cursor?: string; } ) { - const response = await this.apis.channel.activeChannels( + const response = await this.apis.channel.fetchUsersActiveChannels({ fid, - options?.limit, - options?.cursor - ); - return response.data; - } - - /** - * Retrieves a list of users who are active in a given channel, ordered by ascending FIDs - * - * @param {string} id - Channel ID for the channel being queried - * @param {boolean} hasRootCastAuthors - Include users who posted the root cast in the channel - * @param {Object} [options] - Optional parameters for the request - * @param {boolean} [options.hasCastLikers] - Include users who liked a cast in the channel - * @param {boolean} [options.hasCastRecasters] - Include users who recasted a cast in the channel - * @param {boolean} [options.hasReplyAuthors] - Include users who replied to a cast in the channel - * @param {number} [options.limit] - Number of results to retrieve (default 25, max 100). - * @param {string} [options.cursor] - Pagination cursor for the next set of results, - * omit this parameter for the initial request. - * - * @returns {Promise} A promise that resolves to a `UsersResponse` object, - * containing the users active in the specified channel. - * - * @example - * // Example: Retrieve active users in a channel - * client.fetchActiveUsersInSingleChannel('neynar', true, { - * hasCastLikers: true, - * hasCastRecasters: true, - * hasReplyAuthors: true, - * limit: 10 - * // cursor: "nextPageCursor" // Omit this parameter for the initial request. - * }).then(response => { - * console.log('Active Users:', response); - * }); - * - * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/channel-users). - */ - public async fetchActiveUsersInSingleChannel( - id: string, - hasRootCastAuthors: boolean, - options?: { - hasCastLikers?: boolean; - hasCastRecasters?: boolean; - hasReplyAuthors?: boolean; - cursor?: string; - limit?: number; - } - ): Promise { - const response = await this.apis.channel.channelUsers( - id, - hasRootCastAuthors, - options?.hasCastLikers, - options?.hasCastRecasters, - options?.hasReplyAuthors, - options?.cursor, - options?.limit - ); + limit: options?.limit, + cursor: options?.cursor, + }); return response.data; } @@ -2519,7 +2461,9 @@ export class NeynarV2APIClient { signer_uuid: signerUuid, channel_id: channelId, }; - const response = await this.apis.channel.followChannel(reqBody); + const response = await this.apis.channel.followChannel({ + channel_follow_req_body: reqBody, + }); return response.data; } @@ -2553,7 +2497,9 @@ export class NeynarV2APIClient { signer_uuid: signerUuid, channel_id: channelId, }; - const response = await this.apis.channel.unfollowChannel(reqBody); + const response = await this.apis.channel.unfollowChannel({ + channel_follow_req_body: reqBody, + }); return response.data; } @@ -2580,10 +2526,10 @@ export class NeynarV2APIClient { limit?: number; cursor?: string; }): Promise { - const response = await this.apis.channel.listAllChannels( - options?.limit, - options?.cursor - ); + const response = await this.apis.channel.fetchAllChannels({ + cursor: options?.cursor, + limit: options?.limit, + }); return response.data; } @@ -2616,12 +2562,12 @@ export class NeynarV2APIClient { limit?: number; cursor?: string; }) { - const response = await this.apis.channel.listChannelInvites( - options?.channelId, - options?.invitedFid, - options?.limit, - options?.cursor - ); + const response = await this.apis.channel.fetchChannelInvites({ + channel_id: options?.channelId, + invited_fid: options?.invitedFid, + limit: options?.limit, + cursor: options?.cursor, + }); return response.data; } @@ -2660,12 +2606,12 @@ export class NeynarV2APIClient { cursor?: string; } ): Promise { - const response = await this.apis.channel.listChannelMembers( - channelId, - options?.fid, - options?.limit, - options?.cursor - ); + const response = await this.apis.channel.fetchChannelMembers({ + channel_id: channelId, + fid: options?.fid, + limit: options?.limit, + cursor: options?.cursor, + }); return response.data; } @@ -2693,11 +2639,12 @@ export class NeynarV2APIClient { q: string, options?: { limit?: number; cursor?: string } ): Promise { - const response = await this.apis.channel.searchChannels( + const response = await this.apis.channel.searchChannels({ q, - options?.limit, - options?.cursor - ); + limit: options?.limit, + cursor: options?.cursor, + }); + return response.data; } @@ -2732,11 +2679,11 @@ export class NeynarV2APIClient { cursor?: string; } ): Promise { - const response = await this.apis.channel.trendingChannels( - timeWindow, - options?.limit, - options?.cursor - ); + const response = await this.apis.channel.fetchTrendingChannels({ + time_window: timeWindow, + limit: options?.limit, + cursor: options?.cursor, + }); return response.data; } @@ -2770,12 +2717,12 @@ export class NeynarV2APIClient { cursor?: string; } ): Promise { - const response = await this.apis.channel.channelFollowers( + const response = await this.apis.channel.fetchFollowersForAChannel({ id, - options?.viewerFid, - options?.cursor, - options?.limit - ); + viewer_fid: options?.viewerFid, + limit: options?.limit, + cursor: options?.cursor, + }); return response.data; } @@ -2802,10 +2749,10 @@ export class NeynarV2APIClient { id: string, viewerFid: number ): Promise { - const response = await this.apis.channel.relevantChannelFollowers( + const response = await this.apis.channel.fetchRelevantFollowersForAChannel({ id, - viewerFid - ); + viewer_fid: viewerFid, + }); return response.data; } @@ -2843,16 +2790,16 @@ export class NeynarV2APIClient { fid: number, role: ChannelMemberRole ): Promise { - const inviteChannelMemberRequest: RemoveChannelMemberRequest = { + const inviteChannelMemberRequest: InviteChannelMemberReqBody = { signer_uuid: signerUuid, channel_id: channelId, fid: fid, role: role, }; - const response = await this.apis.channel.inviteChannelMember( - inviteChannelMemberRequest - ); + const response = await this.apis.channel.inviteChannelMember({ + invite_channel_member_req_body: inviteChannelMemberRequest, + }); return response.data; } @@ -2888,16 +2835,16 @@ export class NeynarV2APIClient { fid: number, role: ChannelMemberRole ): Promise { - const inviteChannelMemberRequest: RemoveChannelMemberRequest = { + const inviteChannelMemberRequest: RemoveChannelMemberReqBody = { signer_uuid: signerUuid, channel_id: channelId, fid: fid, role: role, }; - const response = await this.apis.channel.removeChannelMember( - inviteChannelMemberRequest - ); + const response = await this.apis.channel.removeChannelMember({ + remove_channel_member_req_body: inviteChannelMemberRequest, + }); return response.data; } @@ -2934,16 +2881,16 @@ export class NeynarV2APIClient { role: ChannelMemberRole, accept: boolean ): Promise { - const respondChannelInviteRequest: RespondChannelInviteRequest = { + const respondChannelInviteRequest: RespondChannelInviteReqBody = { signer_uuid: signerUuid, channel_id: channelId, role: role, accept: accept, }; - const response = await this.apis.channel.respondChannelInvite( - respondChannelInviteRequest - ); + const response = await this.apis.channel.respondChannelInvite({ + respond_channel_invite_req_body: respondChannelInviteRequest, + }); return response.data; } @@ -2970,10 +2917,10 @@ export class NeynarV2APIClient { targetFid: number, viewerFid: number ): Promise { - const response = await this.apis.follows.relevantFollowers( - targetFid, - viewerFid - ); + const response = await this.apis.follows.fetchRelevantFollowers({ + target_fid: targetFid, + viewer_fid: viewerFid, + }); return response.data; } /** @@ -3007,13 +2954,13 @@ export class NeynarV2APIClient { sortType?: FollowSortType; } ): Promise { - const response = await this.apis.follows.followersV2( - fid, - options?.viewerFid, - options?.sortType, - options?.limit, - options?.cursor - ); + const response = await this.apis.follows.fetchUserFollowers({ + fid: fid, + cursor: options?.cursor, + limit: options?.limit, + sort_type: options?.sortType, + viewer_fid: options?.viewerFid, + }); return response.data; } @@ -3038,7 +2985,7 @@ export class NeynarV2APIClient { * console.log('User Follows:', response); * }); * - * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/following-v2). + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/fetch-user-following). */ public async fetchUserFollowingV2( fid: number, @@ -3049,13 +2996,13 @@ export class NeynarV2APIClient { sortType?: FollowSortType; } ): Promise { - const response = await this.apis.follows.followingV2( + const response = await this.apis.follows.fetchUserFollowing({ fid, - options?.viewerFid, - options?.sortType, - options?.limit, - options?.cursor - ); + cursor: options?.cursor, + limit: options?.limit, + sort_type: options?.sortType, + viewer_fid: options?.viewerFid, + }); return response.data; } @@ -3093,11 +3040,11 @@ export class NeynarV2APIClient { cursor?: string; } ): Promise { - const response = await this.apis.channel.userChannelMemberships( + const response = await this.apis.channel.fetchUserChannelMemberships({ fid, - options?.limit, - options?.cursor - ); + limit: options?.limit, + cursor: options?.cursor, + }); return response.data; } @@ -3122,7 +3069,9 @@ export class NeynarV2APIClient { public async lookupUserStorageAllocations( fid: number ): Promise { - const response = await this.apis.storage.storageAllocations(fid); + const response = await this.apis.storage.lookupUserStorageAllocations({ + fid, + }); return response.data; } @@ -3145,7 +3094,7 @@ export class NeynarV2APIClient { public async lookupUserStorageUsage( fid: number ): Promise { - const response = await this.apis.storage.storageUsage(fid); + const response = await this.apis.storage.lookupUserStorageUsage({ fid }); return response.data; } @@ -3183,7 +3132,9 @@ export class NeynarV2APIClient { ...(typeof options?.units !== "undefined" && { units: options.units }), ...(typeof options?.idem !== "undefined" && { idem: options.idem }), }; - const response = await this.apis.storage.buyStorage(buyStorageReqBody); + const response = await this.apis.storage.buyStorage({ + buy_storage_req_body: buyStorageReqBody, + }); return response.data; } @@ -3208,7 +3159,7 @@ export class NeynarV2APIClient { public async isFnameAvailable( fname: string ): Promise { - const response = await this.apis.fname.fnameAvailability(fname); + const response = await this.apis.fname.isFnameAvailable({ fname }); return response.data; } @@ -3238,11 +3189,11 @@ export class NeynarV2APIClient { options?: { type?: FrameType } ) { const type = options?.type || FrameType.Uuid; - const response = await this.apis.frame.lookupNeynarFrame( + const response = await this.apis.frame.lookupNeynarFrame({ type, - type === FrameType.Uuid ? identifier : undefined, - type === FrameType.Url ? identifier : undefined - ); + uuid: type === FrameType.Uuid ? identifier : undefined, + url: type === FrameType.Url ? identifier : undefined, + }); return response.data; } @@ -3250,7 +3201,7 @@ export class NeynarV2APIClient { * Creates a new frame with a list of pages. This method enables developers to add new frames * to their content offerings, identified by the provided API key. * - * @param {NeynarFrameCreationRequest} neynarFrameCreationRequest - The request object containing the details for the new frame. + * @param {NeynarFrameCreationReqBody} neynarFrameCreationRequest - The request object containing the details for the new frame. * * @returns {Promise} A promise that resolves to the newly created frame object. * @@ -3267,11 +3218,11 @@ export class NeynarV2APIClient { * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/publish-neynar-frame). */ public async publishNeynarFrame( - neynarFrameCreationRequest: NeynarFrameCreationRequest + neynarFrameCreationRequest: NeynarFrameCreationReqBody ) { - const response = await this.apis.frame.publishNeynarFrame( - neynarFrameCreationRequest - ); + const response = await this.apis.frame.publishNeynarFrame({ + neynar_frame_creation_req_body: neynarFrameCreationRequest, + }); return response.data; } @@ -3279,7 +3230,7 @@ export class NeynarV2APIClient { * Updates an existing frame with new content or properties, assuming the frame was created by the developer, * as identified by the provided API key. This method allows for modifying frames post-creation. * - * @param {NeynarFrameUpdateRequest} neynarFrame - The new content or properties for the frame being updated. + * @param {NeynarFrameUpdateReqBody} neynarFrame - The new content or properties for the frame being updated. * * @returns {Promise} A promise that resolves to a `NeynarFrame` object, * reflecting the updated state of the frame. @@ -3297,11 +3248,11 @@ export class NeynarV2APIClient { * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/update-neynar-frame). */ public async updateNeynarFrame( - neynarFrameUpdateRequest: NeynarFrameUpdateRequest + neynarFrameUpdateRequest: NeynarFrameUpdateReqBody ) { - const response = await this.apis.frame.updateNeynarFrame( - neynarFrameUpdateRequest - ); + const response = await this.apis.frame.updateNeynarFrame({ + neynar_frame_update_req_body: neynarFrameUpdateRequest, + }); return response.data; } @@ -3324,12 +3275,12 @@ export class NeynarV2APIClient { * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/delete-neynar-frame). */ public async deleteNeynarFrame(uuid: string) { - const deleteNeynarFrameRequest: DeleteNeynarFrameRequest = { + const deleteNeynarFrameRequest: DeleteFrameReqBody = { uuid, }; - const response = await this.apis.frame.deleteNeynarFrame( - deleteNeynarFrameRequest - ); + const response = await this.apis.frame.deleteNeynarFrame({ + delete_frame_req_body: deleteNeynarFrameRequest, + }); return response.data; } @@ -3393,7 +3344,9 @@ export class NeynarV2APIClient { action, ...(typeof castHash !== "undefined" && { cast_hash: castHash }), }; - const response = await this.apis.frame.postFrameAction(body); + const response = await this.apis.frame.postFrameAction({ + frame_action_req_body: body, + }); return response.data; } @@ -3436,9 +3389,9 @@ export class NeynarV2APIClient { }), }; - const response = await this.apis.frame.postFrameDeveloperManagedAction( - body - ); + const response = await this.apis.frame.postFrameActionDeveloperManaged({ + frame_developer_managed_action_req_body: body, + }); return response.data; } @@ -3475,7 +3428,7 @@ export class NeynarV2APIClient { channelFollowContext?: boolean; } ): Promise { - const reqBody: ValidateFrameRequest = { + const reqBody: ValidateFrameActionReqBody = { message_bytes_in_hex: messageBytesInHex, ...(typeof options?.castReactionContext !== "undefined" && { cast_reaction_context: options?.castReactionContext, @@ -3491,7 +3444,9 @@ export class NeynarV2APIClient { }), }; - const response = await this.apis.frame.validateFrame(reqBody); + const response = await this.apis.frame.validateFrameAction({ + validate_frame_action_req_body: reqBody, + }); return response.data; } @@ -3511,7 +3466,7 @@ export class NeynarV2APIClient { * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/validate-frame-list). */ public async fetchValidateFrameList(): Promise { - const response = await this.apis.frame.validateFrameList(); + const response = await this.apis.frame.fetchValidateFrameList(); return response.data; } @@ -3551,13 +3506,13 @@ export class NeynarV2APIClient { stop: string, options?: { aggregateWindow?: ValidateFrameAggregateWindow } ): Promise { - const response = await this.apis.frame.validateFrameAnalytics( - frameUrl, - analyticsType, + const response = await this.apis.frame.fetchValidateFrameAnalytics({ + analytics_type: analyticsType, + frame_url: frameUrl, start, stop, - options?.aggregateWindow - ); + aggregate_window: options?.aggregateWindow, + }); return response.data; } @@ -3581,7 +3536,9 @@ export class NeynarV2APIClient { * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/lookup-webhook). */ public async lookupWebhook(webhookId: string): Promise { - const response = await this.apis.webhook.lookupWebhook(webhookId); + const response = await this.apis.webhook.lookupWebhook({ + webhook_id: webhookId, + }); return response.data; } @@ -3634,7 +3591,9 @@ export class NeynarV2APIClient { }), }; - const response = await this.apis.webhook.publishWebhook(webhookPostReqBody); + const response = await this.apis.webhook.publishWebhook({ + webhook_post_req_body: webhookPostReqBody, + }); return response.data; } @@ -3669,9 +3628,9 @@ export class NeynarV2APIClient { active: active.toString() as WebhookPatchReqBodyActiveEnum, }; - const response = await this.apis.webhook.updateWebhookActiveStatus( - webhookPatchReqBody - ); + const response = await this.apis.webhook.updateWebhookActiveStatus({ + webhook_patch_req_body: webhookPatchReqBody, + }); return response.data; } @@ -3723,7 +3682,9 @@ export class NeynarV2APIClient { subscription: options?.subscription, }), }; - const response = await this.apis.webhook.updateWebhook(webhookPutReqBody); + const response = await this.apis.webhook.updateWebhook({ + webhook_put_req_body: webhookPutReqBody, + }); return response.data; } @@ -3745,7 +3706,9 @@ export class NeynarV2APIClient { */ public async deleteWebhook(webhookId: string): Promise { const response = await this.apis.webhook.deleteWebhook({ - webhook_id: webhookId, + webhook_delete_req_body: { + webhook_id: webhookId, + }, }); return response.data; } @@ -3792,11 +3755,11 @@ export class NeynarV2APIClient { fid: number, options?: { limit?: number; cursor: string } ): Promise { - const response = await this.apis.mute.muteList( + const response = await this.apis.mute.fetchMuteList({ fid, - options?.limit, - options?.cursor - ); + limit: options?.limit, + cursor: options?.cursor, + }); return response.data; } @@ -3825,7 +3788,9 @@ export class NeynarV2APIClient { fid, muted_fid: mutedFid, }; - const response = await this.apis.mute.addMute(addMuteBody); + const response = await this.apis.mute.publishMute({ + mute_req_body: addMuteBody, + }); return response.data; } @@ -3853,7 +3818,9 @@ export class NeynarV2APIClient { fid, muted_fid: mutedFid, }; - const response = await this.apis.mute.deleteMute(deleteMuteBody); + const response = await this.apis.mute.deleteMute({ + mute_req_body: deleteMuteBody, + }); return response.data; } @@ -3884,12 +3851,12 @@ export class NeynarV2APIClient { limit?: number; cursor: string; }): Promise { - const response = await this.apis.block.fetchBlockList( - options?.blockerFid, - options?.blockedFid, - options?.limit, - options?.cursor - ); + const response = await this.apis.block.fetchBlockList({ + blocked_fid: options?.blockedFid, + blocker_fid: options?.blockerFid, + limit: options?.limit, + cursor: options?.cursor, + }); return response.data; } @@ -3916,7 +3883,9 @@ export class NeynarV2APIClient { signer_uuid: signerUuid, blocked_fid: blockedFid, }; - const response = await this.apis.block.publishBlock(addBlockBody); + const response = await this.apis.block.publishBlock({ + block_req_body: addBlockBody, + }); return response.data; } @@ -3944,7 +3913,9 @@ export class NeynarV2APIClient { signer_uuid: signerUuid, blocked_fid: blockedFid, }; - const response = await this.apis.block.deleteBlock(deleteBlockBody); + const response = await this.apis.block.deleteBlock({ + block_req_body: deleteBlockBody, + }); return response.data; } @@ -3971,10 +3942,10 @@ export class NeynarV2APIClient { limit?: number; cursor: string; }): Promise { - const response = await this.apis.ban.banList( - options?.limit, - options?.cursor - ); + const response = await this.apis.ban.fetchBanList({ + cursor: options?.cursor, + limit: options?.limit, + }); return response.data; } @@ -3998,7 +3969,9 @@ export class NeynarV2APIClient { const addBanBody = { fids, }; - const response = await this.apis.ban.addBan(addBanBody); + const response = await this.apis.ban.publishBans({ + ban_req_body: addBanBody, + }); return response.data; } @@ -4021,7 +3994,9 @@ export class NeynarV2APIClient { const deleteBanBody = { fids, }; - const response = await this.apis.ban.deleteBan(deleteBanBody); + const response = await this.apis.ban.deleteBans({ + ban_req_body: deleteBanBody, + }); return response.data; } @@ -4052,11 +4027,11 @@ export class NeynarV2APIClient { viewerFid?: number; } ): Promise { - const response = await this.apis.subscribers.subscribers( + const response = await this.apis.subscribers.fetchSubscribersForFid({ fid, - subscriptionProvider, - options?.viewerFid - ); + subscription_provider: subscriptionProvider, + viewer_fid: options?.viewerFid, + }); return response.data; } @@ -4085,11 +4060,11 @@ export class NeynarV2APIClient { viewerFid?: number; } ): Promise { - const response = await this.apis.subscribers.subscribedTo( + const response = await this.apis.subscribers.fetchSubscribedToForFid({ fid, - subscriptionProvider, - options?.viewerFid - ); + subscription_provider: subscriptionProvider, + viewer_fid: options?.viewerFid, + }); return response.data; } @@ -4114,10 +4089,10 @@ export class NeynarV2APIClient { fid: number, subscriptionProvider: SubscriptionProvider ): Promise { - const response = await this.apis.subscribers.subscriptionsCreated( + const response = await this.apis.subscribers.fetchSubscriptionsForFid({ fid, - subscriptionProvider - ); + subscription_provider: subscriptionProvider, + }); return response.data; } @@ -4147,11 +4122,11 @@ export class NeynarV2APIClient { ): Promise<{ [key: string]: SubscriptionStatus }> { const finishedAddresses = addresses.join(","); - const response = await this.apis.stp.subscriptionCheck( - finishedAddresses, - contractAddress, - chainId - ); + const response = await this.apis.stp.fetchSubscriptionCheck({ + addresses: finishedAddresses, + contract_address: contractAddress, + chain_id: chainId, + }); return response.data; } } diff --git a/src/neynar-api/v2/openapi-farcaster/.openapi-generator/FILES b/src/neynar-api/v2/openapi-farcaster/.openapi-generator/FILES index 3eb5f0b5..2330c68d 100644 --- a/src/neynar-api/v2/openapi-farcaster/.openapi-generator/FILES +++ b/src/neynar-api/v2/openapi-farcaster/.openapi-generator/FILES @@ -36,6 +36,7 @@ models/block-record.ts models/block-req-body.ts models/bulk-casts-response.ts models/bulk-follow-response.ts +models/bulk-users-by-address-response.ts models/bulk-users-response.ts models/buy-storage-req-body.ts models/cast-composer-actions-list-response-actions-inner-action.ts @@ -89,8 +90,8 @@ models/conversation.ts models/dehydrated-channel.ts models/dehydrated-follower.ts models/delete-cast-req-body.ts +models/delete-frame-req-body.ts models/delete-frame-response.ts -models/delete-neynar-frame-request.ts models/developer-managed-signer.ts models/embed-cast-deep.ts models/embed-cast.ts @@ -108,10 +109,12 @@ models/embed.ts models/error-res.ts models/farcaster-action-req-body-action.ts models/farcaster-action-req-body.ts -models/feed-for-you400-response.ts models/feed-response.ts models/feed-trending-provider.ts models/feed-type.ts +models/fetch-feed-for-you400-response.ts +models/fetch-frame-meta-tags-from-url200-response.ts +models/fids.ts models/filter-type.ts models/fname-availability-response.ts models/follow-req-body.ts @@ -125,7 +128,6 @@ models/frame-action-req-body.ts models/frame-action.ts models/frame-button-action-type.ts models/frame-developer-managed-action-req-body.ts -models/frame-from-url200-response.ts models/frame-input.ts models/frame-signature-packet-trusted-data.ts models/frame-signature-packet-untrusted-data.ts @@ -147,6 +149,7 @@ models/hydrated-follower.ts models/image-object.ts models/index.ts models/individual-hash-obj.ts +models/invite-channel-member-req-body.ts models/location-address.ts models/location.ts models/mark-notifications-as-seen-req-body.ts @@ -155,9 +158,9 @@ models/mute-record.ts models/mute-req-body.ts models/mute-response.ts models/next-cursor.ts -models/neynar-frame-creation-request.ts +models/neynar-frame-creation-req-body.ts models/neynar-frame-page.ts -models/neynar-frame-update-request.ts +models/neynar-frame-update-req-body.ts models/neynar-frame.ts models/neynar-next-frame-page-mint-url.ts models/neynar-next-frame-page-redirect.ts @@ -203,9 +206,9 @@ models/register-signer-key-req-body.ts models/register-user-req-body.ts models/register-user-response.ts models/relevant-followers-response.ts -models/remove-channel-member-request.ts +models/remove-channel-member-req-body.ts models/remove-verification-req-body.ts -models/respond-channel-invite-request.ts +models/respond-channel-invite-req-body.ts models/searched-user.ts models/signed-key-request-sponsor.ts models/signer.ts @@ -248,9 +251,9 @@ models/user-viewer-context.ts models/user.ts models/users-active-channels-response.ts models/users-response.ts +models/validate-frame-action-req-body.ts models/validate-frame-action-response.ts models/validate-frame-analytics-type.ts -models/validate-frame-request.ts models/validated-frame-action-signer.ts models/validated-frame-action-tapped-button.ts models/validated-frame-action.ts @@ -261,7 +264,6 @@ models/webhook-delete-req-body.ts models/webhook-list-response.ts models/webhook-patch-req-body.ts models/webhook-post-req-body.ts -models/webhook-put-req-body-all-of.ts models/webhook-put-req-body.ts models/webhook-response.ts models/webhook-secret.ts diff --git a/src/neynar-api/v2/openapi-farcaster/apis/action-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/action-api.ts index 80e874d2..f7af0351 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/action-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/action-api.ts @@ -32,13 +32,17 @@ export const ActionApiAxiosParamCreator = function (configuration?: Configuratio /** * Securely communicate and perform actions on behalf of users across different apps. It enables an app to send data or trigger actions in another app on behalf of a mutual user by signing messages using the user\'s Farcaster signer. * @summary User actions across apps - * @param {FarcasterActionReqBody} farcasterActionReqBody + * @param {FarcasterActionReqBody} farcaster_action_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise<{ [key: string]: any; }>} A promise that resolves to a `{ [key: string]: any; }` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/docs/farcaster-actions-spec) + * */ - publishFarcasterAction: async (farcasterActionReqBody: FarcasterActionReqBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'farcasterActionReqBody' is not null or undefined - assertParamExists('publishFarcasterAction', 'farcasterActionReqBody', farcasterActionReqBody) + publishFarcasterAction: async (farcaster_action_req_body: FarcasterActionReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'farcaster_action_req_body' is not null or undefined + assertParamExists('publishFarcasterAction', 'farcaster_action_req_body', farcaster_action_req_body) const localVarPath = `/farcaster/action`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -61,7 +65,7 @@ export const ActionApiAxiosParamCreator = function (configuration?: Configuratio setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(farcasterActionReqBody, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(farcaster_action_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -81,12 +85,16 @@ export const ActionApiFp = function(configuration?: Configuration) { /** * Securely communicate and perform actions on behalf of users across different apps. It enables an app to send data or trigger actions in another app on behalf of a mutual user by signing messages using the user\'s Farcaster signer. * @summary User actions across apps - * @param {FarcasterActionReqBody} farcasterActionReqBody + * @param {FarcasterActionReqBody} farcaster_action_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise<{ [key: string]: any; }>} A promise that resolves to a `{ [key: string]: any; }` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/docs/farcaster-actions-spec) + * */ - async publishFarcasterAction(farcasterActionReqBody: FarcasterActionReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: any; }>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.publishFarcasterAction(farcasterActionReqBody, options); + async publishFarcasterAction(farcaster_action_req_body: FarcasterActionReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: any; }>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.publishFarcasterAction(farcaster_action_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['ActionApi.publishFarcasterAction']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); @@ -104,33 +112,79 @@ export const ActionApiFactory = function (configuration?: Configuration, basePat /** * Securely communicate and perform actions on behalf of users across different apps. It enables an app to send data or trigger actions in another app on behalf of a mutual user by signing messages using the user\'s Farcaster signer. * @summary User actions across apps - * @param {FarcasterActionReqBody} farcasterActionReqBody + * @param {ActionApiPublishFarcasterActionRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise<{ [key: string]: any; }>} A promise that resolves to a `{ [key: string]: any; }` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/docs/farcaster-actions-spec) + * */ - publishFarcasterAction(farcasterActionReqBody: FarcasterActionReqBody, options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: any; }> { - return localVarFp.publishFarcasterAction(farcasterActionReqBody, options).then((request) => request(axios, basePath)); + publishFarcasterAction(requestParameters: ActionApiPublishFarcasterActionRequest, options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: any; }> { + return localVarFp.publishFarcasterAction(requestParameters.farcaster_action_req_body, options).then((request) => request(axios, basePath)); }, }; }; +/** + * ActionApi - interface + * @export + * @interface ActionApi + */ +export interface ActionApiInterface { + /** + * Securely communicate and perform actions on behalf of users across different apps. It enables an app to send data or trigger actions in another app on behalf of a mutual user by signing messages using the user\'s Farcaster signer. + * @summary User actions across apps + * @param {ActionApiPublishFarcasterActionRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ActionApiInterface + * @returns {Promise<{ [key: string]: any; }>} A promise that resolves to a `{ [key: string]: any; }` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/docs/farcaster-actions-spec) + * + */ + publishFarcasterAction(requestParameters: ActionApiPublishFarcasterActionRequest, options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: any; }>; + +} + +/** + * Request parameters for publishFarcasterAction operation in ActionApi. + * @export + * @interface ActionApiPublishFarcasterActionRequest + */ +export interface ActionApiPublishFarcasterActionRequest { + /** + * + * + * + * @type {FarcasterActionReqBody} + * @memberof ActionApiPublishFarcasterAction + */ + readonly farcaster_action_req_body: FarcasterActionReqBody +} + /** * ActionApi - object-oriented interface * @export * @class ActionApi * @extends {BaseAPI} */ -export class ActionApi extends BaseAPI { +export class ActionApi extends BaseAPI implements ActionApiInterface { /** * Securely communicate and perform actions on behalf of users across different apps. It enables an app to send data or trigger actions in another app on behalf of a mutual user by signing messages using the user\'s Farcaster signer. * @summary User actions across apps - * @param {FarcasterActionReqBody} farcasterActionReqBody + * @param {ActionApiPublishFarcasterActionRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ActionApi + * @returns {Promise<{ [key: string]: any; }>} A promise that resolves to a `{ [key: string]: any; }` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/docs/farcaster-actions-spec) + * */ - public publishFarcasterAction(farcasterActionReqBody: FarcasterActionReqBody, options?: RawAxiosRequestConfig) { - return ActionApiFp(this.configuration).publishFarcasterAction(farcasterActionReqBody, options).then((request) => request(this.axios, this.basePath)); + public publishFarcasterAction(requestParameters: ActionApiPublishFarcasterActionRequest, options?: RawAxiosRequestConfig) { + return ActionApiFp(this.configuration).publishFarcasterAction(requestParameters.farcaster_action_req_body, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/src/neynar-api/v2/openapi-farcaster/apis/ban-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/ban-api.ts index d7d808be..1ee8ec40 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/ban-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/ban-api.ts @@ -36,15 +36,19 @@ import type { ErrorRes } from '../models'; export const BanApiAxiosParamCreator = function (configuration?: Configuration) { return { /** - * Bans a list of FIDs from the app associated with your API key. Banned users, their casts and reactions will not appear in feeds. - * @summary Ban FIDs from app - * @param {BanReqBody} banReqBody + * Deletes a list of FIDs from the app associated with your API key. + * @summary Unban FIDs from app + * @param {BanReqBody} ban_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `BanResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-bans) + * */ - addBan: async (banReqBody: BanReqBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'banReqBody' is not null or undefined - assertParamExists('addBan', 'banReqBody', banReqBody) + deleteBans: async (ban_req_body: BanReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'ban_req_body' is not null or undefined + assertParamExists('deleteBans', 'ban_req_body', ban_req_body) const localVarPath = `/farcaster/ban`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -53,7 +57,7 @@ export const BanApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -67,7 +71,7 @@ export const BanApiAxiosParamCreator = function (configuration?: Configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(banReqBody, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(ban_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -77,12 +81,16 @@ export const BanApiAxiosParamCreator = function (configuration?: Configuration) /** * Fetches all FIDs that your app has banned. * @summary Banned FIDs of app - * @param {number} [limit] Number of results to fetch (default 20, max 100). - * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to fetch (Default: 20, Maximum: 100) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `BanListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-ban-list) + * */ - banList: async (limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { + fetchBanList: async (limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/farcaster/ban/list`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -118,15 +126,19 @@ export const BanApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Deletes a list of FIDs from the app associated with your API key. - * @summary Unban FIDs from app - * @param {BanReqBody} banReqBody + * Bans a list of FIDs from the app associated with your API key. Banned users, their casts and reactions will not appear in feeds. + * @summary Ban FIDs from app + * @param {BanReqBody} ban_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `BanResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-bans) + * */ - deleteBan: async (banReqBody: BanReqBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'banReqBody' is not null or undefined - assertParamExists('deleteBan', 'banReqBody', banReqBody) + publishBans: async (ban_req_body: BanReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'ban_req_body' is not null or undefined + assertParamExists('publishBans', 'ban_req_body', ban_req_body) const localVarPath = `/farcaster/ban`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -135,7 +147,7 @@ export const BanApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -149,7 +161,7 @@ export const BanApiAxiosParamCreator = function (configuration?: Configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(banReqBody, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(ban_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -167,43 +179,55 @@ export const BanApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = BanApiAxiosParamCreator(configuration) return { /** - * Bans a list of FIDs from the app associated with your API key. Banned users, their casts and reactions will not appear in feeds. - * @summary Ban FIDs from app - * @param {BanReqBody} banReqBody + * Deletes a list of FIDs from the app associated with your API key. + * @summary Unban FIDs from app + * @param {BanReqBody} ban_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `BanResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-bans) + * */ - async addBan(banReqBody: BanReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.addBan(banReqBody, options); + async deleteBans(ban_req_body: BanReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteBans(ban_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['BanApi.addBan']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['BanApi.deleteBans']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Fetches all FIDs that your app has banned. * @summary Banned FIDs of app - * @param {number} [limit] Number of results to fetch (default 20, max 100). - * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to fetch (Default: 20, Maximum: 100) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `BanListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-ban-list) + * */ - async banList(limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.banList(limit, cursor, options); + async fetchBanList(limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchBanList(limit, cursor, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['BanApi.banList']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['BanApi.fetchBanList']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Deletes a list of FIDs from the app associated with your API key. - * @summary Unban FIDs from app - * @param {BanReqBody} banReqBody + * Bans a list of FIDs from the app associated with your API key. Banned users, their casts and reactions will not appear in feeds. + * @summary Ban FIDs from app + * @param {BanReqBody} ban_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `BanResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-bans) + * */ - async deleteBan(banReqBody: BanReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteBan(banReqBody, options); + async publishBans(ban_req_body: BanReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.publishBans(ban_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['BanApi.deleteBan']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['BanApi.publishBans']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } @@ -217,81 +241,210 @@ export const BanApiFactory = function (configuration?: Configuration, basePath?: const localVarFp = BanApiFp(configuration) return { /** - * Bans a list of FIDs from the app associated with your API key. Banned users, their casts and reactions will not appear in feeds. - * @summary Ban FIDs from app - * @param {BanReqBody} banReqBody + * Deletes a list of FIDs from the app associated with your API key. + * @summary Unban FIDs from app + * @param {BanApiDeleteBansRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `BanResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-bans) + * */ - addBan(banReqBody: BanReqBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.addBan(banReqBody, options).then((request) => request(axios, basePath)); + deleteBans(requestParameters: BanApiDeleteBansRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.deleteBans(requestParameters.ban_req_body, options).then((request) => request(axios, basePath)); }, /** * Fetches all FIDs that your app has banned. * @summary Banned FIDs of app - * @param {number} [limit] Number of results to fetch (default 20, max 100). - * @param {string} [cursor] Pagination cursor. + * @param {BanApiFetchBanListRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `BanListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-ban-list) + * */ - banList(limit?: number, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.banList(limit, cursor, options).then((request) => request(axios, basePath)); + fetchBanList(requestParameters: BanApiFetchBanListRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchBanList(requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath)); }, /** - * Deletes a list of FIDs from the app associated with your API key. - * @summary Unban FIDs from app - * @param {BanReqBody} banReqBody + * Bans a list of FIDs from the app associated with your API key. Banned users, their casts and reactions will not appear in feeds. + * @summary Ban FIDs from app + * @param {BanApiPublishBansRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `BanResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-bans) + * */ - deleteBan(banReqBody: BanReqBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.deleteBan(banReqBody, options).then((request) => request(axios, basePath)); + publishBans(requestParameters: BanApiPublishBansRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.publishBans(requestParameters.ban_req_body, options).then((request) => request(axios, basePath)); }, }; }; +/** + * BanApi - interface + * @export + * @interface BanApi + */ +export interface BanApiInterface { + /** + * Deletes a list of FIDs from the app associated with your API key. + * @summary Unban FIDs from app + * @param {BanApiDeleteBansRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof BanApiInterface + * @returns {Promise} A promise that resolves to a `BanResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-bans) + * + */ + deleteBans(requestParameters: BanApiDeleteBansRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Fetches all FIDs that your app has banned. + * @summary Banned FIDs of app + * @param {BanApiFetchBanListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof BanApiInterface + * @returns {Promise} A promise that resolves to a `BanListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-ban-list) + * + */ + fetchBanList(requestParameters?: BanApiFetchBanListRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Bans a list of FIDs from the app associated with your API key. Banned users, their casts and reactions will not appear in feeds. + * @summary Ban FIDs from app + * @param {BanApiPublishBansRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof BanApiInterface + * @returns {Promise} A promise that resolves to a `BanResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-bans) + * + */ + publishBans(requestParameters: BanApiPublishBansRequest, options?: RawAxiosRequestConfig): AxiosPromise; + +} + +/** + * Request parameters for deleteBans operation in BanApi. + * @export + * @interface BanApiDeleteBansRequest + */ +export interface BanApiDeleteBansRequest { + /** + * + * + * + * @type {BanReqBody} + * @memberof BanApiDeleteBans + */ + readonly ban_req_body: BanReqBody +} + +/** + * Request parameters for fetchBanList operation in BanApi. + * @export + * @interface BanApiFetchBanListRequest + */ +export interface BanApiFetchBanListRequest { + /** + * Number of results to fetch (Default: 20, Maximum: 100) + * + * + * @type {number} + * @memberof BanApiFetchBanList + */ + readonly limit?: number + + /** + * Pagination cursor. + * + * + * @type {string} + * @memberof BanApiFetchBanList + */ + readonly cursor?: string +} + +/** + * Request parameters for publishBans operation in BanApi. + * @export + * @interface BanApiPublishBansRequest + */ +export interface BanApiPublishBansRequest { + /** + * + * + * + * @type {BanReqBody} + * @memberof BanApiPublishBans + */ + readonly ban_req_body: BanReqBody +} + /** * BanApi - object-oriented interface * @export * @class BanApi * @extends {BaseAPI} */ -export class BanApi extends BaseAPI { +export class BanApi extends BaseAPI implements BanApiInterface { /** - * Bans a list of FIDs from the app associated with your API key. Banned users, their casts and reactions will not appear in feeds. - * @summary Ban FIDs from app - * @param {BanReqBody} banReqBody + * Deletes a list of FIDs from the app associated with your API key. + * @summary Unban FIDs from app + * @param {BanApiDeleteBansRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BanApi + * @returns {Promise} A promise that resolves to a `BanResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-bans) + * */ - public addBan(banReqBody: BanReqBody, options?: RawAxiosRequestConfig) { - return BanApiFp(this.configuration).addBan(banReqBody, options).then((request) => request(this.axios, this.basePath)); + public deleteBans(requestParameters: BanApiDeleteBansRequest, options?: RawAxiosRequestConfig) { + return BanApiFp(this.configuration).deleteBans(requestParameters.ban_req_body, options).then((request) => request(this.axios, this.basePath)); } /** * Fetches all FIDs that your app has banned. * @summary Banned FIDs of app - * @param {number} [limit] Number of results to fetch (default 20, max 100). - * @param {string} [cursor] Pagination cursor. + * @param {BanApiFetchBanListRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BanApi + * @returns {Promise} A promise that resolves to a `BanListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-ban-list) + * */ - public banList(limit?: number, cursor?: string, options?: RawAxiosRequestConfig) { - return BanApiFp(this.configuration).banList(limit, cursor, options).then((request) => request(this.axios, this.basePath)); + public fetchBanList(requestParameters: BanApiFetchBanListRequest = {}, options?: RawAxiosRequestConfig) { + return BanApiFp(this.configuration).fetchBanList(requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath)); } /** - * Deletes a list of FIDs from the app associated with your API key. - * @summary Unban FIDs from app - * @param {BanReqBody} banReqBody + * Bans a list of FIDs from the app associated with your API key. Banned users, their casts and reactions will not appear in feeds. + * @summary Ban FIDs from app + * @param {BanApiPublishBansRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BanApi + * @returns {Promise} A promise that resolves to a `BanResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-bans) + * */ - public deleteBan(banReqBody: BanReqBody, options?: RawAxiosRequestConfig) { - return BanApiFp(this.configuration).deleteBan(banReqBody, options).then((request) => request(this.axios, this.basePath)); + public publishBans(requestParameters: BanApiPublishBansRequest, options?: RawAxiosRequestConfig) { + return BanApiFp(this.configuration).publishBans(requestParameters.ban_req_body, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/src/neynar-api/v2/openapi-farcaster/apis/block-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/block-api.ts index e2fe3333..d9ed947a 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/block-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/block-api.ts @@ -38,13 +38,17 @@ export const BlockApiAxiosParamCreator = function (configuration?: Configuration /** * Deletes a block for a given FID. * @summary Unblock FID - * @param {BlockReqBody} blockReqBody + * @param {BlockReqBody} block_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-block) + * */ - deleteBlock: async (blockReqBody: BlockReqBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'blockReqBody' is not null or undefined - assertParamExists('deleteBlock', 'blockReqBody', blockReqBody) + deleteBlock: async (block_req_body: BlockReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'block_req_body' is not null or undefined + assertParamExists('deleteBlock', 'block_req_body', block_req_body) const localVarPath = `/farcaster/block`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -67,7 +71,7 @@ export const BlockApiAxiosParamCreator = function (configuration?: Configuration setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(blockReqBody, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(block_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -77,14 +81,18 @@ export const BlockApiAxiosParamCreator = function (configuration?: Configuration /** * Fetches all FIDs that a user has blocked or has been blocked by * @summary Blocked / Blocked by FIDs - * @param {number} [blockerFid] Providing this will return the users that this user has blocked - * @param {number} [blockedFid] Providing this will return the users that have blocked this user - * @param {number} [limit] Number of results to fetch - * @param {string} [cursor] Pagination cursor. + * @param {number} [blocker_fid] Providing this will return the users that this user has blocked + * @param {number} [blocked_fid] Providing this will return the users that have blocked this user + * @param {number} [limit] Number of results to fetch (Default: 20, Maximum: 100) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `BlockListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-block-list) + * */ - fetchBlockList: async (blockerFid?: number, blockedFid?: number, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { + fetchBlockList: async (blocker_fid?: number, blocked_fid?: number, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/farcaster/block/list`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -100,12 +108,12 @@ export const BlockApiAxiosParamCreator = function (configuration?: Configuration // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (blockerFid !== undefined) { - localVarQueryParameter['blocker_fid'] = blockerFid; + if (blocker_fid !== undefined) { + localVarQueryParameter['blocker_fid'] = blocker_fid; } - if (blockedFid !== undefined) { - localVarQueryParameter['blocked_fid'] = blockedFid; + if (blocked_fid !== undefined) { + localVarQueryParameter['blocked_fid'] = blocked_fid; } if (limit !== undefined) { @@ -130,13 +138,17 @@ export const BlockApiAxiosParamCreator = function (configuration?: Configuration /** * Adds a block for a given FID. * @summary Block FID - * @param {BlockReqBody} blockReqBody + * @param {BlockReqBody} block_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-block) + * */ - publishBlock: async (blockReqBody: BlockReqBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'blockReqBody' is not null or undefined - assertParamExists('publishBlock', 'blockReqBody', blockReqBody) + publishBlock: async (block_req_body: BlockReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'block_req_body' is not null or undefined + assertParamExists('publishBlock', 'block_req_body', block_req_body) const localVarPath = `/farcaster/block`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -159,7 +171,7 @@ export const BlockApiAxiosParamCreator = function (configuration?: Configuration setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(blockReqBody, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(block_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -179,12 +191,16 @@ export const BlockApiFp = function(configuration?: Configuration) { /** * Deletes a block for a given FID. * @summary Unblock FID - * @param {BlockReqBody} blockReqBody + * @param {BlockReqBody} block_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-block) + * */ - async deleteBlock(blockReqBody: BlockReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteBlock(blockReqBody, options); + async deleteBlock(block_req_body: BlockReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteBlock(block_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['BlockApi.deleteBlock']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); @@ -192,15 +208,19 @@ export const BlockApiFp = function(configuration?: Configuration) { /** * Fetches all FIDs that a user has blocked or has been blocked by * @summary Blocked / Blocked by FIDs - * @param {number} [blockerFid] Providing this will return the users that this user has blocked - * @param {number} [blockedFid] Providing this will return the users that have blocked this user - * @param {number} [limit] Number of results to fetch - * @param {string} [cursor] Pagination cursor. + * @param {number} [blocker_fid] Providing this will return the users that this user has blocked + * @param {number} [blocked_fid] Providing this will return the users that have blocked this user + * @param {number} [limit] Number of results to fetch (Default: 20, Maximum: 100) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `BlockListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-block-list) + * */ - async fetchBlockList(blockerFid?: number, blockedFid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.fetchBlockList(blockerFid, blockedFid, limit, cursor, options); + async fetchBlockList(blocker_fid?: number, blocked_fid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchBlockList(blocker_fid, blocked_fid, limit, cursor, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['BlockApi.fetchBlockList']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); @@ -208,12 +228,16 @@ export const BlockApiFp = function(configuration?: Configuration) { /** * Adds a block for a given FID. * @summary Block FID - * @param {BlockReqBody} blockReqBody + * @param {BlockReqBody} block_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-block) + * */ - async publishBlock(blockReqBody: BlockReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.publishBlock(blockReqBody, options); + async publishBlock(block_req_body: BlockReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.publishBlock(block_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['BlockApi.publishBlock']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); @@ -231,83 +255,226 @@ export const BlockApiFactory = function (configuration?: Configuration, basePath /** * Deletes a block for a given FID. * @summary Unblock FID - * @param {BlockReqBody} blockReqBody + * @param {BlockApiDeleteBlockRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-block) + * */ - deleteBlock(blockReqBody: BlockReqBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.deleteBlock(blockReqBody, options).then((request) => request(axios, basePath)); + deleteBlock(requestParameters: BlockApiDeleteBlockRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.deleteBlock(requestParameters.block_req_body, options).then((request) => request(axios, basePath)); }, /** * Fetches all FIDs that a user has blocked or has been blocked by * @summary Blocked / Blocked by FIDs - * @param {number} [blockerFid] Providing this will return the users that this user has blocked - * @param {number} [blockedFid] Providing this will return the users that have blocked this user - * @param {number} [limit] Number of results to fetch - * @param {string} [cursor] Pagination cursor. + * @param {BlockApiFetchBlockListRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `BlockListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-block-list) + * */ - fetchBlockList(blockerFid?: number, blockedFid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.fetchBlockList(blockerFid, blockedFid, limit, cursor, options).then((request) => request(axios, basePath)); + fetchBlockList(requestParameters: BlockApiFetchBlockListRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchBlockList(requestParameters.blocker_fid, requestParameters.blocked_fid, requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath)); }, /** * Adds a block for a given FID. * @summary Block FID - * @param {BlockReqBody} blockReqBody + * @param {BlockApiPublishBlockRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-block) + * */ - publishBlock(blockReqBody: BlockReqBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.publishBlock(blockReqBody, options).then((request) => request(axios, basePath)); + publishBlock(requestParameters: BlockApiPublishBlockRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.publishBlock(requestParameters.block_req_body, options).then((request) => request(axios, basePath)); }, }; }; +/** + * BlockApi - interface + * @export + * @interface BlockApi + */ +export interface BlockApiInterface { + /** + * Deletes a block for a given FID. + * @summary Unblock FID + * @param {BlockApiDeleteBlockRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof BlockApiInterface + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-block) + * + */ + deleteBlock(requestParameters: BlockApiDeleteBlockRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Fetches all FIDs that a user has blocked or has been blocked by + * @summary Blocked / Blocked by FIDs + * @param {BlockApiFetchBlockListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof BlockApiInterface + * @returns {Promise} A promise that resolves to a `BlockListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-block-list) + * + */ + fetchBlockList(requestParameters?: BlockApiFetchBlockListRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Adds a block for a given FID. + * @summary Block FID + * @param {BlockApiPublishBlockRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof BlockApiInterface + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-block) + * + */ + publishBlock(requestParameters: BlockApiPublishBlockRequest, options?: RawAxiosRequestConfig): AxiosPromise; + +} + +/** + * Request parameters for deleteBlock operation in BlockApi. + * @export + * @interface BlockApiDeleteBlockRequest + */ +export interface BlockApiDeleteBlockRequest { + /** + * + * + * + * @type {BlockReqBody} + * @memberof BlockApiDeleteBlock + */ + readonly block_req_body: BlockReqBody +} + +/** + * Request parameters for fetchBlockList operation in BlockApi. + * @export + * @interface BlockApiFetchBlockListRequest + */ +export interface BlockApiFetchBlockListRequest { + /** + * Providing this will return the users that this user has blocked + * + * + * @type {number} + * @memberof BlockApiFetchBlockList + */ + readonly blocker_fid?: number + + /** + * Providing this will return the users that have blocked this user + * + * + * @type {number} + * @memberof BlockApiFetchBlockList + */ + readonly blocked_fid?: number + + /** + * Number of results to fetch (Default: 20, Maximum: 100) + * + * + * @type {number} + * @memberof BlockApiFetchBlockList + */ + readonly limit?: number + + /** + * Pagination cursor. + * + * + * @type {string} + * @memberof BlockApiFetchBlockList + */ + readonly cursor?: string +} + +/** + * Request parameters for publishBlock operation in BlockApi. + * @export + * @interface BlockApiPublishBlockRequest + */ +export interface BlockApiPublishBlockRequest { + /** + * + * + * + * @type {BlockReqBody} + * @memberof BlockApiPublishBlock + */ + readonly block_req_body: BlockReqBody +} + /** * BlockApi - object-oriented interface * @export * @class BlockApi * @extends {BaseAPI} */ -export class BlockApi extends BaseAPI { +export class BlockApi extends BaseAPI implements BlockApiInterface { /** * Deletes a block for a given FID. * @summary Unblock FID - * @param {BlockReqBody} blockReqBody + * @param {BlockApiDeleteBlockRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BlockApi + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-block) + * */ - public deleteBlock(blockReqBody: BlockReqBody, options?: RawAxiosRequestConfig) { - return BlockApiFp(this.configuration).deleteBlock(blockReqBody, options).then((request) => request(this.axios, this.basePath)); + public deleteBlock(requestParameters: BlockApiDeleteBlockRequest, options?: RawAxiosRequestConfig) { + return BlockApiFp(this.configuration).deleteBlock(requestParameters.block_req_body, options).then((request) => request(this.axios, this.basePath)); } /** * Fetches all FIDs that a user has blocked or has been blocked by * @summary Blocked / Blocked by FIDs - * @param {number} [blockerFid] Providing this will return the users that this user has blocked - * @param {number} [blockedFid] Providing this will return the users that have blocked this user - * @param {number} [limit] Number of results to fetch - * @param {string} [cursor] Pagination cursor. + * @param {BlockApiFetchBlockListRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BlockApi + * @returns {Promise} A promise that resolves to a `BlockListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-block-list) + * */ - public fetchBlockList(blockerFid?: number, blockedFid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig) { - return BlockApiFp(this.configuration).fetchBlockList(blockerFid, blockedFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); + public fetchBlockList(requestParameters: BlockApiFetchBlockListRequest = {}, options?: RawAxiosRequestConfig) { + return BlockApiFp(this.configuration).fetchBlockList(requestParameters.blocker_fid, requestParameters.blocked_fid, requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath)); } /** * Adds a block for a given FID. * @summary Block FID - * @param {BlockReqBody} blockReqBody + * @param {BlockApiPublishBlockRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BlockApi + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-block) + * */ - public publishBlock(blockReqBody: BlockReqBody, options?: RawAxiosRequestConfig) { - return BlockApiFp(this.configuration).publishBlock(blockReqBody, options).then((request) => request(this.axios, this.basePath)); + public publishBlock(requestParameters: BlockApiPublishBlockRequest, options?: RawAxiosRequestConfig) { + return BlockApiFp(this.configuration).publishBlock(requestParameters.block_req_body, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/src/neynar-api/v2/openapi-farcaster/apis/cast-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/cast-api.ts index 7cc008dc..42d6b471 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/cast-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/cast-api.ts @@ -54,19 +54,19 @@ import type { PostCastResponse } from '../models'; export const CastApiAxiosParamCreator = function (configuration?: Configuration) { return { /** - * Gets information about an individual cast by passing in a Warpcast web URL or cast hash - * @summary By hash or URL - * @param {string} identifier Cast identifier (Its either a url or a hash) - * @param {CastParamType} type - * @param {number} [viewerFid] adds viewer_context to cast object to show whether viewer has liked or recasted the cast. + * Delete an existing cast. \\ (In order to delete a cast `signer_uuid` must be approved) + * @summary Delete a cast + * @param {DeleteCastReqBody} delete_cast_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-cast) + * */ - cast: async (identifier: string, type: CastParamType, viewerFid?: number, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'identifier' is not null or undefined - assertParamExists('cast', 'identifier', identifier) - // verify required parameter 'type' is not null or undefined - assertParamExists('cast', 'type', type) + deleteCast: async (delete_cast_req_body: DeleteCastReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'delete_cast_req_body' is not null or undefined + assertParamExists('deleteCast', 'delete_cast_req_body', delete_cast_req_body) const localVarPath = `/farcaster/cast`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -75,30 +75,21 @@ export const CastApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (identifier !== undefined) { - localVarQueryParameter['identifier'] = identifier; - } - - if (type !== undefined) { - localVarQueryParameter['type'] = type; - } - - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; - } - + localVarHeaderParameter['Content-Type'] = 'application/json'; + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(delete_cast_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -106,26 +97,22 @@ export const CastApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Gets all casts related to a conversation surrounding a cast by passing in a cast hash or Warpcast URL. Includes all the ancestors of a cast up to the root parent in a chronological order. Includes all direct_replies to the cast up to the reply_depth specified in the query parameter. - * @summary Conversation for a cast - * @param {string} identifier Cast identifier (Its either a url or a hash) - * @param {CastParamType} type - * @param {number} [replyDepth] The depth of replies in the conversation that will be returned (default 2) - * @param {boolean} [includeChronologicalParentCasts] Include all parent casts in chronological order - * @param {number} [viewerFid] Providing this will return a conversation that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {CastConversationSortType} [sortType] Sort type for the ordering of descendants. Default is `chron` - * @param {CastConversationFoldEnum} [fold] Show conversation above or below the fold. Lower quality responses are hidden below the fold. Not passing in a value shows the full conversation without any folding. - * @param {number} [limit] Number of results to fetch (default 20, max 50) - * @param {string} [cursor] Pagination cursor. + * Fetch multiple casts using their respective hashes. + * @summary Bulk fetch casts + * @param {string} casts Hashes of the cast to be retrived (Comma separated, no spaces) + * @param {number} [viewer_fid] adds viewer_context to cast object to show whether viewer has liked or recasted the cast. + * @param {FetchBulkCastsSortTypeEnum} [sort_type] Optional parameter to sort the casts based on different criteria * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `CastsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-bulk-casts) + * */ - castConversation: async (identifier: string, type: CastParamType, replyDepth?: number, includeChronologicalParentCasts?: boolean, viewerFid?: number, sortType?: CastConversationSortType, fold?: CastConversationFoldEnum, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'identifier' is not null or undefined - assertParamExists('castConversation', 'identifier', identifier) - // verify required parameter 'type' is not null or undefined - assertParamExists('castConversation', 'type', type) - const localVarPath = `/farcaster/cast/conversation`; + fetchBulkCasts: async (casts: string, viewer_fid?: number, sort_type?: FetchBulkCastsSortTypeEnum, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'casts' is not null or undefined + assertParamExists('fetchBulkCasts', 'casts', casts) + const localVarPath = `/farcaster/casts`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -140,40 +127,16 @@ export const CastApiAxiosParamCreator = function (configuration?: Configuration) // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (identifier !== undefined) { - localVarQueryParameter['identifier'] = identifier; - } - - if (type !== undefined) { - localVarQueryParameter['type'] = type; - } - - if (replyDepth !== undefined) { - localVarQueryParameter['reply_depth'] = replyDepth; - } - - if (includeChronologicalParentCasts !== undefined) { - localVarQueryParameter['include_chronological_parent_casts'] = includeChronologicalParentCasts; + if (casts !== undefined) { + localVarQueryParameter['casts'] = casts; } - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; } - if (sortType !== undefined) { - localVarQueryParameter['sort_type'] = sortType; - } - - if (fold !== undefined) { - localVarQueryParameter['fold'] = fold; - } - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; + if (sort_type !== undefined) { + localVarQueryParameter['sort_type'] = sort_type; } @@ -188,23 +151,22 @@ export const CastApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Search for casts based on a query string, with optional AND filters - * @summary Search for casts - * @param {string} q Query string to search for casts - * @param {number} [authorFid] Fid of the user whose casts you want to search - * @param {number} [viewerFid] Providing this will return search results that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {string} [parentUrl] Parent URL of the casts you want to search - * @param {string} [channelId] Channel ID of the casts you want to search - * @param {boolean} [priorityMode] When true, only returns search results from power badge users and users that the viewer follows (if viewer_fid is provided). - * @param {number} [limit] - * @param {string} [cursor] Pagination cursor + * Fetches all composer actions on Warpcast. You can filter by top or featured. + * @summary Fetch composer actions + * @param {CastComposerType} list Type of list to fetch. + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 25) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `CastComposerActionsListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-composer-actions) + * */ - castSearch: async (q: string, authorFid?: number, viewerFid?: number, parentUrl?: string, channelId?: string, priorityMode?: boolean, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'q' is not null or undefined - assertParamExists('castSearch', 'q', q) - const localVarPath = `/farcaster/cast/search`; + fetchComposerActions: async (list: CastComposerType, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'list' is not null or undefined + assertParamExists('fetchComposerActions', 'list', list) + const localVarPath = `/farcaster/cast/composer_actions/list`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -219,28 +181,8 @@ export const CastApiAxiosParamCreator = function (configuration?: Configuration) // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (q !== undefined) { - localVarQueryParameter['q'] = q; - } - - if (authorFid !== undefined) { - localVarQueryParameter['author_fid'] = authorFid; - } - - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; - } - - if (parentUrl !== undefined) { - localVarQueryParameter['parent_url'] = parentUrl; - } - - if (channelId !== undefined) { - localVarQueryParameter['channel_id'] = channelId; - } - - if (priorityMode !== undefined) { - localVarQueryParameter['priority_mode'] = priorityMode; + if (list !== undefined) { + localVarQueryParameter['list'] = list; } if (limit !== undefined) { @@ -263,18 +205,24 @@ export const CastApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Fetch multiple casts using their respective hashes. - * @summary Bulk fetch casts - * @param {string} casts Hashes of the cast to be retrived (Comma separated, no spaces) - * @param {number} [viewerFid] adds viewer_context to cast object to show whether viewer has liked or recasted the cast. - * @param {CastsSortTypeEnum} [sortType] Optional parameter to sort the casts based on different criteria + * Gets information about an individual cast by passing in a Warpcast web URL or cast hash + * @summary By hash or URL + * @param {string} identifier Cast identifier (Its either a url or a hash) + * @param {CastParamType} type + * @param {number} [viewer_fid] adds viewer_context to cast object to show whether viewer has liked or recasted the cast. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `CastResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-cast-by-hash-or-warpcast-url) + * */ - casts: async (casts: string, viewerFid?: number, sortType?: CastsSortTypeEnum, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'casts' is not null or undefined - assertParamExists('casts', 'casts', casts) - const localVarPath = `/farcaster/casts`; + lookupCastByHashOrWarpcastUrl: async (identifier: string, type: CastParamType, viewer_fid?: number, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'identifier' is not null or undefined + assertParamExists('lookupCastByHashOrWarpcastUrl', 'identifier', identifier) + // verify required parameter 'type' is not null or undefined + assertParamExists('lookupCastByHashOrWarpcastUrl', 'type', type) + const localVarPath = `/farcaster/cast`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -289,16 +237,16 @@ export const CastApiAxiosParamCreator = function (configuration?: Configuration) // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (casts !== undefined) { - localVarQueryParameter['casts'] = casts; + if (identifier !== undefined) { + localVarQueryParameter['identifier'] = identifier; } - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; + if (type !== undefined) { + localVarQueryParameter['type'] = type; } - if (sortType !== undefined) { - localVarQueryParameter['sort_type'] = sortType; + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; } @@ -313,18 +261,30 @@ export const CastApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Fetches all composer actions on Warpcast. You can filter by top or featured. - * @summary Fetch composer actions - * @param {CastComposerType} list Type of list to fetch. - * @param {number} [limit] Number of results to fetch (default 25, max 25). - * @param {string} [cursor] Pagination cursor. + * Gets all casts related to a conversation surrounding a cast by passing in a cast hash or Warpcast URL. Includes all the ancestors of a cast up to the root parent in a chronological order. Includes all direct_replies to the cast up to the reply_depth specified in the query parameter. + * @summary Conversation for a cast + * @param {string} identifier Cast identifier (Its either a url or a hash) + * @param {CastParamType} type + * @param {number} [reply_depth] The depth of replies in the conversation that will be returned (default 2) + * @param {boolean} [include_chronological_parent_casts] Include all parent casts in chronological order + * @param {number} [viewer_fid] Providing this will return a conversation that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {CastConversationSortType} [sort_type] Sort type for the ordering of descendants. Default is `chron` + * @param {LookupCastConversationFoldEnum} [fold] Show conversation above or below the fold. Lower quality responses are hidden below the fold. Not passing in a value shows the full conversation without any folding. + * @param {number} [limit] Number of results to fetch (Default: 20, Maximum: 50) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `Conversation` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-cast-conversation) + * */ - composerList: async (list: CastComposerType, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'list' is not null or undefined - assertParamExists('composerList', 'list', list) - const localVarPath = `/farcaster/cast/composer_actions/list`; + lookupCastConversation: async (identifier: string, type: CastParamType, reply_depth?: number, include_chronological_parent_casts?: boolean, viewer_fid?: number, sort_type?: CastConversationSortType, fold?: LookupCastConversationFoldEnum, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'identifier' is not null or undefined + assertParamExists('lookupCastConversation', 'identifier', identifier) + // verify required parameter 'type' is not null or undefined + assertParamExists('lookupCastConversation', 'type', type) + const localVarPath = `/farcaster/cast/conversation`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -339,8 +299,32 @@ export const CastApiAxiosParamCreator = function (configuration?: Configuration) // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (list !== undefined) { - localVarQueryParameter['list'] = list; + if (identifier !== undefined) { + localVarQueryParameter['identifier'] = identifier; + } + + if (type !== undefined) { + localVarQueryParameter['type'] = type; + } + + if (reply_depth !== undefined) { + localVarQueryParameter['reply_depth'] = reply_depth; + } + + if (include_chronological_parent_casts !== undefined) { + localVarQueryParameter['include_chronological_parent_casts'] = include_chronological_parent_casts; + } + + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; + } + + if (sort_type !== undefined) { + localVarQueryParameter['sort_type'] = sort_type; + } + + if (fold !== undefined) { + localVarQueryParameter['fold'] = fold; } if (limit !== undefined) { @@ -363,15 +347,19 @@ export const CastApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Delete an existing cast. \\ (In order to delete a cast `signer_uuid` must be approved) - * @summary Delete a cast - * @param {DeleteCastReqBody} deleteCastReqBody + * Posts a cast or cast reply. Works with mentions and embeds. (In order to post a cast `signer_uuid` must be approved) + * @summary Post a cast + * @param {PostCastReqBody} post_cast_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `PostCastResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-cast) + * */ - deleteCast: async (deleteCastReqBody: DeleteCastReqBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'deleteCastReqBody' is not null or undefined - assertParamExists('deleteCast', 'deleteCastReqBody', deleteCastReqBody) + publishCast: async (post_cast_req_body: PostCastReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'post_cast_req_body' is not null or undefined + assertParamExists('publishCast', 'post_cast_req_body', post_cast_req_body) const localVarPath = `/farcaster/cast`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -380,7 +368,7 @@ export const CastApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -394,7 +382,7 @@ export const CastApiAxiosParamCreator = function (configuration?: Configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(deleteCastReqBody, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(post_cast_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -402,16 +390,27 @@ export const CastApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Posts a cast or cast reply. Works with mentions and embeds. (In order to post a cast `signer_uuid` must be approved) - * @summary Post a cast - * @param {PostCastReqBody} postCastReqBody + * Search for casts based on a query string, with optional AND filters + * @summary Search for casts + * @param {string} q Query string to search for casts + * @param {number} [author_fid] Fid of the user whose casts you want to search + * @param {number} [viewer_fid] Providing this will return search results that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {string} [parent_url] Parent URL of the casts you want to search + * @param {string} [channel_id] Channel ID of the casts you want to search + * @param {boolean} [priority_mode] When true, only returns search results from power badge users and users that the viewer follows (if viewer_fid is provided). + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100) + * @param {string} [cursor] Pagination cursor * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `CastsSearchResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/search-casts) + * */ - postCast: async (postCastReqBody: PostCastReqBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'postCastReqBody' is not null or undefined - assertParamExists('postCast', 'postCastReqBody', postCastReqBody) - const localVarPath = `/farcaster/cast`; + searchCasts: async (q: string, author_fid?: number, viewer_fid?: number, parent_url?: string, channel_id?: string, priority_mode?: boolean, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'q' is not null or undefined + assertParamExists('searchCasts', 'q', q) + const localVarPath = `/farcaster/cast/search`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -419,21 +418,50 @@ export const CastApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) + if (q !== undefined) { + localVarQueryParameter['q'] = q; + } - - localVarHeaderParameter['Content-Type'] = 'application/json'; + if (author_fid !== undefined) { + localVarQueryParameter['author_fid'] = author_fid; + } + + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; + } + if (parent_url !== undefined) { + localVarQueryParameter['parent_url'] = parent_url; + } + + if (channel_id !== undefined) { + localVarQueryParameter['channel_id'] = channel_id; + } + + if (priority_mode !== undefined) { + localVarQueryParameter['priority_mode'] = priority_mode; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(postCastReqBody, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -451,115 +479,143 @@ export const CastApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = CastApiAxiosParamCreator(configuration) return { /** - * Gets information about an individual cast by passing in a Warpcast web URL or cast hash - * @summary By hash or URL - * @param {string} identifier Cast identifier (Its either a url or a hash) - * @param {CastParamType} type - * @param {number} [viewerFid] adds viewer_context to cast object to show whether viewer has liked or recasted the cast. + * Delete an existing cast. \\ (In order to delete a cast `signer_uuid` must be approved) + * @summary Delete a cast + * @param {DeleteCastReqBody} delete_cast_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-cast) + * */ - async cast(identifier: string, type: CastParamType, viewerFid?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.cast(identifier, type, viewerFid, options); + async deleteCast(delete_cast_req_body: DeleteCastReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteCast(delete_cast_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['CastApi.cast']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['CastApi.deleteCast']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Gets all casts related to a conversation surrounding a cast by passing in a cast hash or Warpcast URL. Includes all the ancestors of a cast up to the root parent in a chronological order. Includes all direct_replies to the cast up to the reply_depth specified in the query parameter. - * @summary Conversation for a cast - * @param {string} identifier Cast identifier (Its either a url or a hash) - * @param {CastParamType} type - * @param {number} [replyDepth] The depth of replies in the conversation that will be returned (default 2) - * @param {boolean} [includeChronologicalParentCasts] Include all parent casts in chronological order - * @param {number} [viewerFid] Providing this will return a conversation that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {CastConversationSortType} [sortType] Sort type for the ordering of descendants. Default is `chron` - * @param {CastConversationFoldEnum} [fold] Show conversation above or below the fold. Lower quality responses are hidden below the fold. Not passing in a value shows the full conversation without any folding. - * @param {number} [limit] Number of results to fetch (default 20, max 50) - * @param {string} [cursor] Pagination cursor. + * Fetch multiple casts using their respective hashes. + * @summary Bulk fetch casts + * @param {string} casts Hashes of the cast to be retrived (Comma separated, no spaces) + * @param {number} [viewer_fid] adds viewer_context to cast object to show whether viewer has liked or recasted the cast. + * @param {FetchBulkCastsSortTypeEnum} [sort_type] Optional parameter to sort the casts based on different criteria * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `CastsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-bulk-casts) + * */ - async castConversation(identifier: string, type: CastParamType, replyDepth?: number, includeChronologicalParentCasts?: boolean, viewerFid?: number, sortType?: CastConversationSortType, fold?: CastConversationFoldEnum, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.castConversation(identifier, type, replyDepth, includeChronologicalParentCasts, viewerFid, sortType, fold, limit, cursor, options); + async fetchBulkCasts(casts: string, viewer_fid?: number, sort_type?: FetchBulkCastsSortTypeEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchBulkCasts(casts, viewer_fid, sort_type, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['CastApi.castConversation']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['CastApi.fetchBulkCasts']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Search for casts based on a query string, with optional AND filters - * @summary Search for casts - * @param {string} q Query string to search for casts - * @param {number} [authorFid] Fid of the user whose casts you want to search - * @param {number} [viewerFid] Providing this will return search results that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {string} [parentUrl] Parent URL of the casts you want to search - * @param {string} [channelId] Channel ID of the casts you want to search - * @param {boolean} [priorityMode] When true, only returns search results from power badge users and users that the viewer follows (if viewer_fid is provided). - * @param {number} [limit] - * @param {string} [cursor] Pagination cursor + * Fetches all composer actions on Warpcast. You can filter by top or featured. + * @summary Fetch composer actions + * @param {CastComposerType} list Type of list to fetch. + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 25) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `CastComposerActionsListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-composer-actions) + * */ - async castSearch(q: string, authorFid?: number, viewerFid?: number, parentUrl?: string, channelId?: string, priorityMode?: boolean, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.castSearch(q, authorFid, viewerFid, parentUrl, channelId, priorityMode, limit, cursor, options); + async fetchComposerActions(list: CastComposerType, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchComposerActions(list, limit, cursor, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['CastApi.castSearch']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['CastApi.fetchComposerActions']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Fetch multiple casts using their respective hashes. - * @summary Bulk fetch casts - * @param {string} casts Hashes of the cast to be retrived (Comma separated, no spaces) - * @param {number} [viewerFid] adds viewer_context to cast object to show whether viewer has liked or recasted the cast. - * @param {CastsSortTypeEnum} [sortType] Optional parameter to sort the casts based on different criteria + * Gets information about an individual cast by passing in a Warpcast web URL or cast hash + * @summary By hash or URL + * @param {string} identifier Cast identifier (Its either a url or a hash) + * @param {CastParamType} type + * @param {number} [viewer_fid] adds viewer_context to cast object to show whether viewer has liked or recasted the cast. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `CastResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-cast-by-hash-or-warpcast-url) + * */ - async casts(casts: string, viewerFid?: number, sortType?: CastsSortTypeEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.casts(casts, viewerFid, sortType, options); + async lookupCastByHashOrWarpcastUrl(identifier: string, type: CastParamType, viewer_fid?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.lookupCastByHashOrWarpcastUrl(identifier, type, viewer_fid, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['CastApi.casts']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['CastApi.lookupCastByHashOrWarpcastUrl']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Fetches all composer actions on Warpcast. You can filter by top or featured. - * @summary Fetch composer actions - * @param {CastComposerType} list Type of list to fetch. - * @param {number} [limit] Number of results to fetch (default 25, max 25). - * @param {string} [cursor] Pagination cursor. + * Gets all casts related to a conversation surrounding a cast by passing in a cast hash or Warpcast URL. Includes all the ancestors of a cast up to the root parent in a chronological order. Includes all direct_replies to the cast up to the reply_depth specified in the query parameter. + * @summary Conversation for a cast + * @param {string} identifier Cast identifier (Its either a url or a hash) + * @param {CastParamType} type + * @param {number} [reply_depth] The depth of replies in the conversation that will be returned (default 2) + * @param {boolean} [include_chronological_parent_casts] Include all parent casts in chronological order + * @param {number} [viewer_fid] Providing this will return a conversation that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {CastConversationSortType} [sort_type] Sort type for the ordering of descendants. Default is `chron` + * @param {LookupCastConversationFoldEnum} [fold] Show conversation above or below the fold. Lower quality responses are hidden below the fold. Not passing in a value shows the full conversation without any folding. + * @param {number} [limit] Number of results to fetch (Default: 20, Maximum: 50) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `Conversation` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-cast-conversation) + * */ - async composerList(list: CastComposerType, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.composerList(list, limit, cursor, options); + async lookupCastConversation(identifier: string, type: CastParamType, reply_depth?: number, include_chronological_parent_casts?: boolean, viewer_fid?: number, sort_type?: CastConversationSortType, fold?: LookupCastConversationFoldEnum, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.lookupCastConversation(identifier, type, reply_depth, include_chronological_parent_casts, viewer_fid, sort_type, fold, limit, cursor, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['CastApi.composerList']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['CastApi.lookupCastConversation']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Delete an existing cast. \\ (In order to delete a cast `signer_uuid` must be approved) - * @summary Delete a cast - * @param {DeleteCastReqBody} deleteCastReqBody + * Posts a cast or cast reply. Works with mentions and embeds. (In order to post a cast `signer_uuid` must be approved) + * @summary Post a cast + * @param {PostCastReqBody} post_cast_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `PostCastResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-cast) + * */ - async deleteCast(deleteCastReqBody: DeleteCastReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteCast(deleteCastReqBody, options); + async publishCast(post_cast_req_body: PostCastReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.publishCast(post_cast_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['CastApi.deleteCast']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['CastApi.publishCast']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Posts a cast or cast reply. Works with mentions and embeds. (In order to post a cast `signer_uuid` must be approved) - * @summary Post a cast - * @param {PostCastReqBody} postCastReqBody + * Search for casts based on a query string, with optional AND filters + * @summary Search for casts + * @param {string} q Query string to search for casts + * @param {number} [author_fid] Fid of the user whose casts you want to search + * @param {number} [viewer_fid] Providing this will return search results that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {string} [parent_url] Parent URL of the casts you want to search + * @param {string} [channel_id] Channel ID of the casts you want to search + * @param {boolean} [priority_mode] When true, only returns search results from power badge users and users that the viewer follows (if viewer_fid is provided). + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100) + * @param {string} [cursor] Pagination cursor * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `CastsSearchResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/search-casts) + * */ - async postCast(postCastReqBody: PostCastReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.postCast(postCastReqBody, options); + async searchCasts(q: string, author_fid?: number, viewer_fid?: number, parent_url?: string, channel_id?: string, priority_mode?: boolean, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.searchCasts(q, author_fid, viewer_fid, parent_url, channel_id, priority_mode, limit, cursor, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['CastApi.postCast']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['CastApi.searchCasts']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } @@ -573,228 +629,649 @@ export const CastApiFactory = function (configuration?: Configuration, basePath? const localVarFp = CastApiFp(configuration) return { /** - * Gets information about an individual cast by passing in a Warpcast web URL or cast hash - * @summary By hash or URL - * @param {string} identifier Cast identifier (Its either a url or a hash) - * @param {CastParamType} type - * @param {number} [viewerFid] adds viewer_context to cast object to show whether viewer has liked or recasted the cast. + * Delete an existing cast. \\ (In order to delete a cast `signer_uuid` must be approved) + * @summary Delete a cast + * @param {CastApiDeleteCastRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-cast) + * */ - cast(identifier: string, type: CastParamType, viewerFid?: number, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.cast(identifier, type, viewerFid, options).then((request) => request(axios, basePath)); + deleteCast(requestParameters: CastApiDeleteCastRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.deleteCast(requestParameters.delete_cast_req_body, options).then((request) => request(axios, basePath)); }, /** - * Gets all casts related to a conversation surrounding a cast by passing in a cast hash or Warpcast URL. Includes all the ancestors of a cast up to the root parent in a chronological order. Includes all direct_replies to the cast up to the reply_depth specified in the query parameter. - * @summary Conversation for a cast - * @param {string} identifier Cast identifier (Its either a url or a hash) - * @param {CastParamType} type - * @param {number} [replyDepth] The depth of replies in the conversation that will be returned (default 2) - * @param {boolean} [includeChronologicalParentCasts] Include all parent casts in chronological order - * @param {number} [viewerFid] Providing this will return a conversation that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {CastConversationSortType} [sortType] Sort type for the ordering of descendants. Default is `chron` - * @param {CastConversationFoldEnum} [fold] Show conversation above or below the fold. Lower quality responses are hidden below the fold. Not passing in a value shows the full conversation without any folding. - * @param {number} [limit] Number of results to fetch (default 20, max 50) - * @param {string} [cursor] Pagination cursor. + * Fetch multiple casts using their respective hashes. + * @summary Bulk fetch casts + * @param {CastApiFetchBulkCastsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `CastsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-bulk-casts) + * */ - castConversation(identifier: string, type: CastParamType, replyDepth?: number, includeChronologicalParentCasts?: boolean, viewerFid?: number, sortType?: CastConversationSortType, fold?: CastConversationFoldEnum, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.castConversation(identifier, type, replyDepth, includeChronologicalParentCasts, viewerFid, sortType, fold, limit, cursor, options).then((request) => request(axios, basePath)); + fetchBulkCasts(requestParameters: CastApiFetchBulkCastsRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchBulkCasts(requestParameters.casts, requestParameters.viewer_fid, requestParameters.sort_type, options).then((request) => request(axios, basePath)); }, /** - * Search for casts based on a query string, with optional AND filters - * @summary Search for casts - * @param {string} q Query string to search for casts - * @param {number} [authorFid] Fid of the user whose casts you want to search - * @param {number} [viewerFid] Providing this will return search results that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {string} [parentUrl] Parent URL of the casts you want to search - * @param {string} [channelId] Channel ID of the casts you want to search - * @param {boolean} [priorityMode] When true, only returns search results from power badge users and users that the viewer follows (if viewer_fid is provided). - * @param {number} [limit] - * @param {string} [cursor] Pagination cursor + * Fetches all composer actions on Warpcast. You can filter by top or featured. + * @summary Fetch composer actions + * @param {CastApiFetchComposerActionsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `CastComposerActionsListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-composer-actions) + * */ - castSearch(q: string, authorFid?: number, viewerFid?: number, parentUrl?: string, channelId?: string, priorityMode?: boolean, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.castSearch(q, authorFid, viewerFid, parentUrl, channelId, priorityMode, limit, cursor, options).then((request) => request(axios, basePath)); + fetchComposerActions(requestParameters: CastApiFetchComposerActionsRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchComposerActions(requestParameters.list, requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath)); }, /** - * Fetch multiple casts using their respective hashes. - * @summary Bulk fetch casts - * @param {string} casts Hashes of the cast to be retrived (Comma separated, no spaces) - * @param {number} [viewerFid] adds viewer_context to cast object to show whether viewer has liked or recasted the cast. - * @param {CastsSortTypeEnum} [sortType] Optional parameter to sort the casts based on different criteria + * Gets information about an individual cast by passing in a Warpcast web URL or cast hash + * @summary By hash or URL + * @param {CastApiLookupCastByHashOrWarpcastUrlRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `CastResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-cast-by-hash-or-warpcast-url) + * */ - casts(casts: string, viewerFid?: number, sortType?: CastsSortTypeEnum, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.casts(casts, viewerFid, sortType, options).then((request) => request(axios, basePath)); + lookupCastByHashOrWarpcastUrl(requestParameters: CastApiLookupCastByHashOrWarpcastUrlRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.lookupCastByHashOrWarpcastUrl(requestParameters.identifier, requestParameters.type, requestParameters.viewer_fid, options).then((request) => request(axios, basePath)); }, /** - * Fetches all composer actions on Warpcast. You can filter by top or featured. - * @summary Fetch composer actions - * @param {CastComposerType} list Type of list to fetch. - * @param {number} [limit] Number of results to fetch (default 25, max 25). - * @param {string} [cursor] Pagination cursor. + * Gets all casts related to a conversation surrounding a cast by passing in a cast hash or Warpcast URL. Includes all the ancestors of a cast up to the root parent in a chronological order. Includes all direct_replies to the cast up to the reply_depth specified in the query parameter. + * @summary Conversation for a cast + * @param {CastApiLookupCastConversationRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `Conversation` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-cast-conversation) + * */ - composerList(list: CastComposerType, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.composerList(list, limit, cursor, options).then((request) => request(axios, basePath)); + lookupCastConversation(requestParameters: CastApiLookupCastConversationRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.lookupCastConversation(requestParameters.identifier, requestParameters.type, requestParameters.reply_depth, requestParameters.include_chronological_parent_casts, requestParameters.viewer_fid, requestParameters.sort_type, requestParameters.fold, requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath)); }, /** - * Delete an existing cast. \\ (In order to delete a cast `signer_uuid` must be approved) - * @summary Delete a cast - * @param {DeleteCastReqBody} deleteCastReqBody + * Posts a cast or cast reply. Works with mentions and embeds. (In order to post a cast `signer_uuid` must be approved) + * @summary Post a cast + * @param {CastApiPublishCastRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `PostCastResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-cast) + * */ - deleteCast(deleteCastReqBody: DeleteCastReqBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.deleteCast(deleteCastReqBody, options).then((request) => request(axios, basePath)); + publishCast(requestParameters: CastApiPublishCastRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.publishCast(requestParameters.post_cast_req_body, options).then((request) => request(axios, basePath)); }, /** - * Posts a cast or cast reply. Works with mentions and embeds. (In order to post a cast `signer_uuid` must be approved) - * @summary Post a cast - * @param {PostCastReqBody} postCastReqBody + * Search for casts based on a query string, with optional AND filters + * @summary Search for casts + * @param {CastApiSearchCastsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `CastsSearchResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/search-casts) + * */ - postCast(postCastReqBody: PostCastReqBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.postCast(postCastReqBody, options).then((request) => request(axios, basePath)); + searchCasts(requestParameters: CastApiSearchCastsRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.searchCasts(requestParameters.q, requestParameters.author_fid, requestParameters.viewer_fid, requestParameters.parent_url, requestParameters.channel_id, requestParameters.priority_mode, requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath)); }, }; }; /** - * CastApi - object-oriented interface + * CastApi - interface * @export - * @class CastApi - * @extends {BaseAPI} + * @interface CastApi */ -export class CastApi extends BaseAPI { +export interface CastApiInterface { + /** + * Delete an existing cast. \\ (In order to delete a cast `signer_uuid` must be approved) + * @summary Delete a cast + * @param {CastApiDeleteCastRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CastApiInterface + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-cast) + * + */ + deleteCast(requestParameters: CastApiDeleteCastRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Fetch multiple casts using their respective hashes. + * @summary Bulk fetch casts + * @param {CastApiFetchBulkCastsRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CastApiInterface + * @returns {Promise} A promise that resolves to a `CastsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-bulk-casts) + * + */ + fetchBulkCasts(requestParameters: CastApiFetchBulkCastsRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Fetches all composer actions on Warpcast. You can filter by top or featured. + * @summary Fetch composer actions + * @param {CastApiFetchComposerActionsRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CastApiInterface + * @returns {Promise} A promise that resolves to a `CastComposerActionsListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-composer-actions) + * + */ + fetchComposerActions(requestParameters: CastApiFetchComposerActionsRequest, options?: RawAxiosRequestConfig): AxiosPromise; + /** * Gets information about an individual cast by passing in a Warpcast web URL or cast hash * @summary By hash or URL - * @param {string} identifier Cast identifier (Its either a url or a hash) - * @param {CastParamType} type - * @param {number} [viewerFid] adds viewer_context to cast object to show whether viewer has liked or recasted the cast. + * @param {CastApiLookupCastByHashOrWarpcastUrlRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof CastApi + * @memberof CastApiInterface + * @returns {Promise} A promise that resolves to a `CastResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-cast-by-hash-or-warpcast-url) + * */ - public cast(identifier: string, type: CastParamType, viewerFid?: number, options?: RawAxiosRequestConfig) { - return CastApiFp(this.configuration).cast(identifier, type, viewerFid, options).then((request) => request(this.axios, this.basePath)); - } + lookupCastByHashOrWarpcastUrl(requestParameters: CastApiLookupCastByHashOrWarpcastUrlRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Gets all casts related to a conversation surrounding a cast by passing in a cast hash or Warpcast URL. Includes all the ancestors of a cast up to the root parent in a chronological order. Includes all direct_replies to the cast up to the reply_depth specified in the query parameter. * @summary Conversation for a cast - * @param {string} identifier Cast identifier (Its either a url or a hash) - * @param {CastParamType} type - * @param {number} [replyDepth] The depth of replies in the conversation that will be returned (default 2) - * @param {boolean} [includeChronologicalParentCasts] Include all parent casts in chronological order - * @param {number} [viewerFid] Providing this will return a conversation that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {CastConversationSortType} [sortType] Sort type for the ordering of descendants. Default is `chron` - * @param {CastConversationFoldEnum} [fold] Show conversation above or below the fold. Lower quality responses are hidden below the fold. Not passing in a value shows the full conversation without any folding. - * @param {number} [limit] Number of results to fetch (default 20, max 50) - * @param {string} [cursor] Pagination cursor. + * @param {CastApiLookupCastConversationRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof CastApi + * @memberof CastApiInterface + * @returns {Promise} A promise that resolves to a `Conversation` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-cast-conversation) + * */ - public castConversation(identifier: string, type: CastParamType, replyDepth?: number, includeChronologicalParentCasts?: boolean, viewerFid?: number, sortType?: CastConversationSortType, fold?: CastConversationFoldEnum, limit?: number, cursor?: string, options?: RawAxiosRequestConfig) { - return CastApiFp(this.configuration).castConversation(identifier, type, replyDepth, includeChronologicalParentCasts, viewerFid, sortType, fold, limit, cursor, options).then((request) => request(this.axios, this.basePath)); - } + lookupCastConversation(requestParameters: CastApiLookupCastConversationRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Posts a cast or cast reply. Works with mentions and embeds. (In order to post a cast `signer_uuid` must be approved) + * @summary Post a cast + * @param {CastApiPublishCastRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CastApiInterface + * @returns {Promise} A promise that resolves to a `PostCastResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-cast) + * + */ + publishCast(requestParameters: CastApiPublishCastRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Search for casts based on a query string, with optional AND filters * @summary Search for casts - * @param {string} q Query string to search for casts - * @param {number} [authorFid] Fid of the user whose casts you want to search - * @param {number} [viewerFid] Providing this will return search results that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {string} [parentUrl] Parent URL of the casts you want to search - * @param {string} [channelId] Channel ID of the casts you want to search - * @param {boolean} [priorityMode] When true, only returns search results from power badge users and users that the viewer follows (if viewer_fid is provided). - * @param {number} [limit] - * @param {string} [cursor] Pagination cursor + * @param {CastApiSearchCastsRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CastApiInterface + * @returns {Promise} A promise that resolves to a `CastsSearchResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/search-casts) + * + */ + searchCasts(requestParameters: CastApiSearchCastsRequest, options?: RawAxiosRequestConfig): AxiosPromise; + +} + +/** + * Request parameters for deleteCast operation in CastApi. + * @export + * @interface CastApiDeleteCastRequest + */ +export interface CastApiDeleteCastRequest { + /** + * + * + * + * @type {DeleteCastReqBody} + * @memberof CastApiDeleteCast + */ + readonly delete_cast_req_body: DeleteCastReqBody +} + +/** + * Request parameters for fetchBulkCasts operation in CastApi. + * @export + * @interface CastApiFetchBulkCastsRequest + */ +export interface CastApiFetchBulkCastsRequest { + /** + * Hashes of the cast to be retrived (Comma separated, no spaces) + * + * @commaSeparated + * @type {string} + * @memberof CastApiFetchBulkCasts + */ + readonly casts: string + + /** + * adds viewer_context to cast object to show whether viewer has liked or recasted the cast. + * + * + * @type {number} + * @memberof CastApiFetchBulkCasts + */ + readonly viewer_fid?: number + + /** + * Optional parameter to sort the casts based on different criteria + * + * + * @type {'trending' | 'likes' | 'recasts' | 'replies' | 'recent'} + * @memberof CastApiFetchBulkCasts + */ + readonly sort_type?: FetchBulkCastsSortTypeEnum +} + +/** + * Request parameters for fetchComposerActions operation in CastApi. + * @export + * @interface CastApiFetchComposerActionsRequest + */ +export interface CastApiFetchComposerActionsRequest { + /** + * Type of list to fetch. + * + * + * @type {CastComposerType} + * @memberof CastApiFetchComposerActions + */ + readonly list: CastComposerType + + /** + * Number of results to fetch (Default: 25, Maximum: 25) + * + * + * @type {number} + * @memberof CastApiFetchComposerActions + */ + readonly limit?: number + + /** + * Pagination cursor. + * + * + * @type {string} + * @memberof CastApiFetchComposerActions + */ + readonly cursor?: string +} + +/** + * Request parameters for lookupCastByHashOrWarpcastUrl operation in CastApi. + * @export + * @interface CastApiLookupCastByHashOrWarpcastUrlRequest + */ +export interface CastApiLookupCastByHashOrWarpcastUrlRequest { + /** + * Cast identifier (Its either a url or a hash) + * + * + * @type {string} + * @memberof CastApiLookupCastByHashOrWarpcastUrl + */ + readonly identifier: string + + /** + * + * + * + * @type {CastParamType} + * @memberof CastApiLookupCastByHashOrWarpcastUrl + */ + readonly type: CastParamType + + /** + * adds viewer_context to cast object to show whether viewer has liked or recasted the cast. + * + * + * @type {number} + * @memberof CastApiLookupCastByHashOrWarpcastUrl + */ + readonly viewer_fid?: number +} + +/** + * Request parameters for lookupCastConversation operation in CastApi. + * @export + * @interface CastApiLookupCastConversationRequest + */ +export interface CastApiLookupCastConversationRequest { + /** + * Cast identifier (Its either a url or a hash) + * + * + * @type {string} + * @memberof CastApiLookupCastConversation + */ + readonly identifier: string + + /** + * + * + * + * @type {CastParamType} + * @memberof CastApiLookupCastConversation + */ + readonly type: CastParamType + + /** + * The depth of replies in the conversation that will be returned (default 2) + * + * + * @type {number} + * @memberof CastApiLookupCastConversation + */ + readonly reply_depth?: number + + /** + * Include all parent casts in chronological order + * + * + * @type {boolean} + * @memberof CastApiLookupCastConversation + */ + readonly include_chronological_parent_casts?: boolean + + /** + * Providing this will return a conversation that respects this user\'s mutes and blocks and includes `viewer_context`. + * + * + * @type {number} + * @memberof CastApiLookupCastConversation + */ + readonly viewer_fid?: number + + /** + * Sort type for the ordering of descendants. Default is `chron` + * + * + * @type {CastConversationSortType} + * @memberof CastApiLookupCastConversation + */ + readonly sort_type?: CastConversationSortType + + /** + * Show conversation above or below the fold. Lower quality responses are hidden below the fold. Not passing in a value shows the full conversation without any folding. + * + * + * @type {'above' | 'below'} + * @memberof CastApiLookupCastConversation + */ + readonly fold?: LookupCastConversationFoldEnum + + /** + * Number of results to fetch (Default: 20, Maximum: 50) + * + * + * @type {number} + * @memberof CastApiLookupCastConversation + */ + readonly limit?: number + + /** + * Pagination cursor. + * + * + * @type {string} + * @memberof CastApiLookupCastConversation + */ + readonly cursor?: string +} + +/** + * Request parameters for publishCast operation in CastApi. + * @export + * @interface CastApiPublishCastRequest + */ +export interface CastApiPublishCastRequest { + /** + * + * + * + * @type {PostCastReqBody} + * @memberof CastApiPublishCast + */ + readonly post_cast_req_body: PostCastReqBody +} + +/** + * Request parameters for searchCasts operation in CastApi. + * @export + * @interface CastApiSearchCastsRequest + */ +export interface CastApiSearchCastsRequest { + /** + * Query string to search for casts + * + * + * @type {string} + * @memberof CastApiSearchCasts + */ + readonly q: string + + /** + * Fid of the user whose casts you want to search + * + * + * @type {number} + * @memberof CastApiSearchCasts + */ + readonly author_fid?: number + + /** + * Providing this will return search results that respects this user\'s mutes and blocks and includes `viewer_context`. + * + * + * @type {number} + * @memberof CastApiSearchCasts + */ + readonly viewer_fid?: number + + /** + * Parent URL of the casts you want to search + * + * + * @type {string} + * @memberof CastApiSearchCasts + */ + readonly parent_url?: string + + /** + * Channel ID of the casts you want to search + * + * + * @type {string} + * @memberof CastApiSearchCasts + */ + readonly channel_id?: string + + /** + * When true, only returns search results from power badge users and users that the viewer follows (if viewer_fid is provided). + * + * + * @type {boolean} + * @memberof CastApiSearchCasts + */ + readonly priority_mode?: boolean + + /** + * Number of results to fetch (Default: 25, Maximum: 100) + * + * + * @type {number} + * @memberof CastApiSearchCasts + */ + readonly limit?: number + + /** + * Pagination cursor + * + * + * @type {string} + * @memberof CastApiSearchCasts + */ + readonly cursor?: string +} + +/** + * CastApi - object-oriented interface + * @export + * @class CastApi + * @extends {BaseAPI} + */ +export class CastApi extends BaseAPI implements CastApiInterface { + /** + * Delete an existing cast. \\ (In order to delete a cast `signer_uuid` must be approved) + * @summary Delete a cast + * @param {CastApiDeleteCastRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CastApi + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-cast) + * */ - public castSearch(q: string, authorFid?: number, viewerFid?: number, parentUrl?: string, channelId?: string, priorityMode?: boolean, limit?: number, cursor?: string, options?: RawAxiosRequestConfig) { - return CastApiFp(this.configuration).castSearch(q, authorFid, viewerFid, parentUrl, channelId, priorityMode, limit, cursor, options).then((request) => request(this.axios, this.basePath)); + public deleteCast(requestParameters: CastApiDeleteCastRequest, options?: RawAxiosRequestConfig) { + return CastApiFp(this.configuration).deleteCast(requestParameters.delete_cast_req_body, options).then((request) => request(this.axios, this.basePath)); } /** * Fetch multiple casts using their respective hashes. * @summary Bulk fetch casts - * @param {string} casts Hashes of the cast to be retrived (Comma separated, no spaces) - * @param {number} [viewerFid] adds viewer_context to cast object to show whether viewer has liked or recasted the cast. - * @param {CastsSortTypeEnum} [sortType] Optional parameter to sort the casts based on different criteria + * @param {CastApiFetchBulkCastsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CastApi + * @returns {Promise} A promise that resolves to a `CastsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-bulk-casts) + * */ - public casts(casts: string, viewerFid?: number, sortType?: CastsSortTypeEnum, options?: RawAxiosRequestConfig) { - return CastApiFp(this.configuration).casts(casts, viewerFid, sortType, options).then((request) => request(this.axios, this.basePath)); + public fetchBulkCasts(requestParameters: CastApiFetchBulkCastsRequest, options?: RawAxiosRequestConfig) { + return CastApiFp(this.configuration).fetchBulkCasts(requestParameters.casts, requestParameters.viewer_fid, requestParameters.sort_type, options).then((request) => request(this.axios, this.basePath)); } /** * Fetches all composer actions on Warpcast. You can filter by top or featured. * @summary Fetch composer actions - * @param {CastComposerType} list Type of list to fetch. - * @param {number} [limit] Number of results to fetch (default 25, max 25). - * @param {string} [cursor] Pagination cursor. + * @param {CastApiFetchComposerActionsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CastApi + * @returns {Promise} A promise that resolves to a `CastComposerActionsListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-composer-actions) + * */ - public composerList(list: CastComposerType, limit?: number, cursor?: string, options?: RawAxiosRequestConfig) { - return CastApiFp(this.configuration).composerList(list, limit, cursor, options).then((request) => request(this.axios, this.basePath)); + public fetchComposerActions(requestParameters: CastApiFetchComposerActionsRequest, options?: RawAxiosRequestConfig) { + return CastApiFp(this.configuration).fetchComposerActions(requestParameters.list, requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath)); } /** - * Delete an existing cast. \\ (In order to delete a cast `signer_uuid` must be approved) - * @summary Delete a cast - * @param {DeleteCastReqBody} deleteCastReqBody + * Gets information about an individual cast by passing in a Warpcast web URL or cast hash + * @summary By hash or URL + * @param {CastApiLookupCastByHashOrWarpcastUrlRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CastApi + * @returns {Promise} A promise that resolves to a `CastResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-cast-by-hash-or-warpcast-url) + * */ - public deleteCast(deleteCastReqBody: DeleteCastReqBody, options?: RawAxiosRequestConfig) { - return CastApiFp(this.configuration).deleteCast(deleteCastReqBody, options).then((request) => request(this.axios, this.basePath)); + public lookupCastByHashOrWarpcastUrl(requestParameters: CastApiLookupCastByHashOrWarpcastUrlRequest, options?: RawAxiosRequestConfig) { + return CastApiFp(this.configuration).lookupCastByHashOrWarpcastUrl(requestParameters.identifier, requestParameters.type, requestParameters.viewer_fid, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Gets all casts related to a conversation surrounding a cast by passing in a cast hash or Warpcast URL. Includes all the ancestors of a cast up to the root parent in a chronological order. Includes all direct_replies to the cast up to the reply_depth specified in the query parameter. + * @summary Conversation for a cast + * @param {CastApiLookupCastConversationRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CastApi + * @returns {Promise} A promise that resolves to a `Conversation` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-cast-conversation) + * + */ + public lookupCastConversation(requestParameters: CastApiLookupCastConversationRequest, options?: RawAxiosRequestConfig) { + return CastApiFp(this.configuration).lookupCastConversation(requestParameters.identifier, requestParameters.type, requestParameters.reply_depth, requestParameters.include_chronological_parent_casts, requestParameters.viewer_fid, requestParameters.sort_type, requestParameters.fold, requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath)); } /** * Posts a cast or cast reply. Works with mentions and embeds. (In order to post a cast `signer_uuid` must be approved) * @summary Post a cast - * @param {PostCastReqBody} postCastReqBody + * @param {CastApiPublishCastRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CastApi + * @returns {Promise} A promise that resolves to a `PostCastResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-cast) + * + */ + public publishCast(requestParameters: CastApiPublishCastRequest, options?: RawAxiosRequestConfig) { + return CastApiFp(this.configuration).publishCast(requestParameters.post_cast_req_body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Search for casts based on a query string, with optional AND filters + * @summary Search for casts + * @param {CastApiSearchCastsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CastApi + * @returns {Promise} A promise that resolves to a `CastsSearchResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/search-casts) + * */ - public postCast(postCastReqBody: PostCastReqBody, options?: RawAxiosRequestConfig) { - return CastApiFp(this.configuration).postCast(postCastReqBody, options).then((request) => request(this.axios, this.basePath)); + public searchCasts(requestParameters: CastApiSearchCastsRequest, options?: RawAxiosRequestConfig) { + return CastApiFp(this.configuration).searchCasts(requestParameters.q, requestParameters.author_fid, requestParameters.viewer_fid, requestParameters.parent_url, requestParameters.channel_id, requestParameters.priority_mode, requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath)); } } /** * @export */ -export const CastConversationFoldEnum = { - Above: 'above', - Below: 'below' -} as const; -export type CastConversationFoldEnum = typeof CastConversationFoldEnum[keyof typeof CastConversationFoldEnum]; -/** - * @export - */ -export const CastsSortTypeEnum = { +export const FetchBulkCastsSortTypeEnum = { Trending: 'trending', Likes: 'likes', Recasts: 'recasts', Replies: 'replies', Recent: 'recent' } as const; -export type CastsSortTypeEnum = typeof CastsSortTypeEnum[keyof typeof CastsSortTypeEnum]; +export type FetchBulkCastsSortTypeEnum = typeof FetchBulkCastsSortTypeEnum[keyof typeof FetchBulkCastsSortTypeEnum]; +/** + * @export + */ +export const LookupCastConversationFoldEnum = { + Above: 'above', + Below: 'below' +} as const; +export type LookupCastConversationFoldEnum = typeof LookupCastConversationFoldEnum[keyof typeof LookupCastConversationFoldEnum]; diff --git a/src/neynar-api/v2/openapi-farcaster/apis/channel-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/channel-api.ts index 6d8e707d..61494657 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/channel-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/channel-api.ts @@ -40,13 +40,15 @@ import type { ChannelType } from '../models'; // @ts-ignore import type { ErrorRes } from '../models'; // @ts-ignore +import type { InviteChannelMemberReqBody } from '../models'; +// @ts-ignore import type { OperationResponse } from '../models'; // @ts-ignore import type { RelevantFollowersResponse } from '../models'; // @ts-ignore -import type { RemoveChannelMemberRequest } from '../models'; +import type { RemoveChannelMemberReqBody } from '../models'; // @ts-ignore -import type { RespondChannelInviteRequest } from '../models'; +import type { RespondChannelInviteReqBody } from '../models'; // @ts-ignore import type { TrendingChannelResponse } from '../models'; // @ts-ignore @@ -60,18 +62,19 @@ import type { UsersResponse } from '../models'; export const ChannelApiAxiosParamCreator = function (configuration?: Configuration) { return { /** - * Fetches all channels that a user has casted in, in reverse chronological order. - * @summary Fetch channels that user is active in - * @param {number} fid The user\'s FID (identifier) - * @param {number} [limit] Number of results to fetch (default 20, max 100). - * @param {string} [cursor] Pagination cursor. + * Returns a list of all channels with their details + * @summary Fetch all channels with their details + * @param {number} [limit] Number of results to fetch (Default: 20, Maximum: 200) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ChannelListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-all-channels) + * */ - activeChannels: async (fid: number, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'fid' is not null or undefined - assertParamExists('activeChannels', 'fid', fid) - const localVarPath = `/farcaster/channel/user`; + fetchAllChannels: async (limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/farcaster/channel/list`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -86,10 +89,6 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (fid !== undefined) { - localVarQueryParameter['fid'] = fid; - } - if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } @@ -110,18 +109,22 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati }; }, /** - * Returns details of a channel - * @summary By ID or parent_url - * @param {string} id Channel ID for the channel being queried - * @param {ChannelType} [type] Type of identifier being used to query the channel. Defaults to ID. - * @param {number} [viewerFid] FID of the user viewing the channel. + * Returns details of multiple channels + * @summary Bulk fetch + * @param {string} ids Comma separated list of channel IDs or parent_urls, up to 100 at a time + * @param {ChannelType} [type] Type of identifier being used to query the channels. Defaults to ID. + * @param {number} [viewer_fid] FID of the user viewing the channels. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ChannelResponseBulk` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-bulk-channels) + * */ - channelDetails: async (id: string, type?: ChannelType, viewerFid?: number, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('channelDetails', 'id', id) - const localVarPath = `/farcaster/channel`; + fetchBulkChannels: async (ids: string, type?: ChannelType, viewer_fid?: number, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'ids' is not null or undefined + assertParamExists('fetchBulkChannels', 'ids', ids) + const localVarPath = `/farcaster/channel/bulk`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -136,16 +139,16 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (id !== undefined) { - localVarQueryParameter['id'] = id; + if (ids !== undefined) { + localVarQueryParameter['ids'] = ids; } if (type !== undefined) { localVarQueryParameter['type'] = type; } - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; } @@ -160,18 +163,21 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati }; }, /** - * Returns details of multiple channels - * @summary Bulk fetch - * @param {string} ids Comma separated list of channel IDs or parent_urls, up to 100 at a time - * @param {ChannelType} [type] Type of identifier being used to query the channels. Defaults to ID. - * @param {number} [viewerFid] FID of the user viewing the channels. + * Fetch a list of invites, either in a channel or for a user. If both are provided, open channel invite for that user is returned. + * @summary Open invites + * @param {string} [channel_id] Channel ID for the channel being queried + * @param {number} [invited_fid] FID of the user being invited + * @param {number} [limit] Number of results to fetch (Default: 20, Maximum: 100) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ChannelMemberInviteListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-channel-invites) + * */ - channelDetailsBulk: async (ids: string, type?: ChannelType, viewerFid?: number, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'ids' is not null or undefined - assertParamExists('channelDetailsBulk', 'ids', ids) - const localVarPath = `/farcaster/channel/bulk`; + fetchChannelInvites: async (channel_id?: string, invited_fid?: number, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/farcaster/channel/member/invite/list`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -186,16 +192,20 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (ids !== undefined) { - localVarQueryParameter['ids'] = ids; + if (channel_id !== undefined) { + localVarQueryParameter['channel_id'] = channel_id; } - if (type !== undefined) { - localVarQueryParameter['type'] = type; + if (invited_fid !== undefined) { + localVarQueryParameter['invited_fid'] = invited_fid; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; } - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; } @@ -210,19 +220,23 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati }; }, /** - * Returns a list of followers for a specific channel. Max limit is 1000. Use cursor for pagination. - * @summary For channel - * @param {string} id Channel ID for the channel being queried - * @param {number} [viewerFid] Providing this will return a list of followers that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of followers to fetch (default 25, max 1000) + * Fetch a list of members in a channel + * @summary Fetch members + * @param {string} channel_id Channel ID for the channel being queried + * @param {number} [fid] FID of the user being queried. Specify this to check if a user is a member of the channel without paginating through all members. + * @param {number} [limit] Number of results to fetch (Default: 20, Maximum: 100) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ChannelMemberListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-channel-members) + * */ - channelFollowers: async (id: string, viewerFid?: number, cursor?: string, limit?: number, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('channelFollowers', 'id', id) - const localVarPath = `/farcaster/channel/followers`; + fetchChannelMembers: async (channel_id: string, fid?: number, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'channel_id' is not null or undefined + assertParamExists('fetchChannelMembers', 'channel_id', channel_id) + const localVarPath = `/farcaster/channel/member/list`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -237,22 +251,22 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (id !== undefined) { - localVarQueryParameter['id'] = id; - } - - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; + if (channel_id !== undefined) { + localVarQueryParameter['channel_id'] = channel_id; } - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); @@ -265,24 +279,23 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati }; }, /** - * Returns a list of users who are active in a given channel, ordered by ascending FIDs - * @summary Fetch users who are active in a channel - * @param {string} id Channel ID for the channel being queried - * @param {boolean} hasRootCastAuthors Include users who posted the root cast in the channel - * @param {boolean} [hasCastLikers] Include users who liked a cast in the channel - * @param {boolean} [hasCastRecasters] Include users who recasted a cast in the channel - * @param {boolean} [hasReplyAuthors] Include users who replied to a cast in the channel - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to fetch (default 25, max 100) + * Returns a list of followers for a specific channel. Max limit is 1000. Use cursor for pagination. + * @summary For channel + * @param {string} id Channel ID for the channel being queried + * @param {number} [viewer_fid] Providing this will return a list of followers that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of followers to fetch (Default: 25, Maximum: 1000) * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `UsersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-followers-for-a-channel) + * */ - channelUsers: async (id: string, hasRootCastAuthors: boolean, hasCastLikers?: boolean, hasCastRecasters?: boolean, hasReplyAuthors?: boolean, cursor?: string, limit?: number, options: RawAxiosRequestConfig = {}): Promise => { + fetchFollowersForAChannel: async (id: string, viewer_fid?: number, cursor?: string, limit?: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined - assertParamExists('channelUsers', 'id', id) - // verify required parameter 'hasRootCastAuthors' is not null or undefined - assertParamExists('channelUsers', 'hasRootCastAuthors', hasRootCastAuthors) - const localVarPath = `/farcaster/channel/users`; + assertParamExists('fetchFollowersForAChannel', 'id', id) + const localVarPath = `/farcaster/channel/followers`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -301,20 +314,8 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati localVarQueryParameter['id'] = id; } - if (hasRootCastAuthors !== undefined) { - localVarQueryParameter['has_root_cast_authors'] = hasRootCastAuthors; - } - - if (hasCastLikers !== undefined) { - localVarQueryParameter['has_cast_likers'] = hasCastLikers; - } - - if (hasCastRecasters !== undefined) { - localVarQueryParameter['has_cast_recasters'] = hasCastRecasters; - } - - if (hasReplyAuthors !== undefined) { - localVarQueryParameter['has_reply_authors'] = hasReplyAuthors; + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; } if (cursor !== undefined) { @@ -337,16 +338,23 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati }; }, /** - * Follow a channel - * @summary Follow a channel - * @param {ChannelFollowReqBody} channelFollowReqBody + * Returns a list of relevant channel followers for a specific FID. This usually shows on a channel as \"X, Y, Z follow this channel\". + * @summary Relevant followers + * @param {string} id Channel ID being queried + * @param {number} viewer_fid The FID of the user to customize this response for. Providing this will also return a list of followers that respects this user\'s mutes and blocks and includes `viewer_context`. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `RelevantFollowersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-relevant-followers-for-a-channel) + * */ - followChannel: async (channelFollowReqBody: ChannelFollowReqBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'channelFollowReqBody' is not null or undefined - assertParamExists('followChannel', 'channelFollowReqBody', channelFollowReqBody) - const localVarPath = `/farcaster/channel/follow`; + fetchRelevantFollowersForAChannel: async (id: string, viewer_fid: number, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('fetchRelevantFollowersForAChannel', 'id', id) + // verify required parameter 'viewer_fid' is not null or undefined + assertParamExists('fetchRelevantFollowersForAChannel', 'viewer_fid', viewer_fid) + const localVarPath = `/farcaster/channel/followers/relevant`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -354,60 +362,26 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(channelFollowReqBody, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Invite a user to a channel - * @summary Invite - * @param {RemoveChannelMemberRequest} removeChannelMemberRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - inviteChannelMember: async (removeChannelMemberRequest: RemoveChannelMemberRequest, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'removeChannelMemberRequest' is not null or undefined - assertParamExists('inviteChannelMember', 'removeChannelMemberRequest', removeChannelMemberRequest) - const localVarPath = `/farcaster/channel/member/invite`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; + if (id !== undefined) { + localVarQueryParameter['id'] = id; } - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication ApiKeyAuth required - await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; + } - localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(removeChannelMemberRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -415,15 +389,20 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati }; }, /** - * Returns a list of all channels with their details - * @summary Fetch all channels with their details - * @param {number} [limit] Number of results to fetch - * @param {string} [cursor] Pagination cursor. + * Returns a list of trending channels based on activity + * @summary Channels by activity + * @param {FetchTrendingChannelsTimeWindowEnum} [time_window] + * @param {number} [limit] Number of results to fetch (Default: 10, Maximum: 25) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `TrendingChannelResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-trending-channels) + * */ - listAllChannels: async (limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/farcaster/channel/list`; + fetchTrendingChannels: async (time_window?: FetchTrendingChannelsTimeWindowEnum, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/farcaster/channel/trending`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -438,6 +417,10 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) + if (time_window !== undefined) { + localVarQueryParameter['time_window'] = time_window; + } + if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } @@ -458,17 +441,22 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati }; }, /** - * Fetch a list of invites, either in a channel or for a user. If both are provided, open channel invite for that user is returned. - * @summary Open invites - * @param {string} [channelId] Channel ID for the channel being queried - * @param {number} [invitedFid] FID of the user being invited - * @param {number} [limit] Number of results to fetch - * @param {string} [cursor] Pagination cursor. + * Returns a list of all channels with their details that an FID is a member of. Data may have a delay of up to 1 hour. + * @summary Member of + * @param {number} fid The FID of the user. + * @param {number} [limit] Number of results to fetch (Default: 20, Maximum: 100) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ChannelMemberListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-channel-memberships) + * */ - listChannelInvites: async (channelId?: string, invitedFid?: number, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/farcaster/channel/member/invite/list`; + fetchUserChannelMemberships: async (fid: number, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'fid' is not null or undefined + assertParamExists('fetchUserChannelMemberships', 'fid', fid) + const localVarPath = `/farcaster/user/memberships/list`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -483,12 +471,8 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (channelId !== undefined) { - localVarQueryParameter['channel_id'] = channelId; - } - - if (invitedFid !== undefined) { - localVarQueryParameter['invited_fid'] = invitedFid; + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; } if (limit !== undefined) { @@ -511,19 +495,22 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati }; }, /** - * Fetch a list of members in a channel - * @summary Fetch members - * @param {string} channelId Channel ID for the channel being queried - * @param {number} [fid] FID of the user being queried. Specify this to check if a user is a member of the channel without paginating through all members. - * @param {number} [limit] Number of results to fetch - * @param {string} [cursor] Pagination cursor. + * Returns a list of all channels with their details that a FID follows. + * @summary Following + * @param {number} fid The FID of the user. + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ChannelListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-channels) + * */ - listChannelMembers: async (channelId: string, fid?: number, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'channelId' is not null or undefined - assertParamExists('listChannelMembers', 'channelId', channelId) - const localVarPath = `/farcaster/channel/member/list`; + fetchUserChannels: async (fid: number, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'fid' is not null or undefined + assertParamExists('fetchUserChannels', 'fid', fid) + const localVarPath = `/farcaster/user/channels`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -538,10 +525,6 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (channelId !== undefined) { - localVarQueryParameter['channel_id'] = channelId; - } - if (fid !== undefined) { localVarQueryParameter['fid'] = fid; } @@ -566,19 +549,22 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati }; }, /** - * Returns a list of relevant channel followers for a specific FID. This usually shows on a channel as \"X, Y, Z follow this channel\". - * @summary Relevant followers - * @param {string} id Channel ID being queried - * @param {number} viewerFid The FID of the user to customize this response for. Providing this will also return a list of followers that respects this user\'s mutes and blocks and includes `viewer_context`. + * Fetches all channels that a user has casted in, in reverse chronological order. + * @summary Fetch channels that user is active in + * @param {number} fid The user\'s FID (identifier) + * @param {number} [limit] Number of results to fetch (Default: 20, Maximum: 100) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `UsersActiveChannelsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-users-active-channels) + * */ - relevantChannelFollowers: async (id: string, viewerFid: number, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('relevantChannelFollowers', 'id', id) - // verify required parameter 'viewerFid' is not null or undefined - assertParamExists('relevantChannelFollowers', 'viewerFid', viewerFid) - const localVarPath = `/farcaster/channel/followers/relevant`; + fetchUsersActiveChannels: async (fid: number, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'fid' is not null or undefined + assertParamExists('fetchUsersActiveChannels', 'fid', fid) + const localVarPath = `/farcaster/channel/user`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -593,12 +579,16 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (id !== undefined) { - localVarQueryParameter['id'] = id; + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; } - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; } @@ -613,16 +603,20 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati }; }, /** - * Remove a user from a channel or a user\'s invite to a channel role - * @summary Remove user - * @param {RemoveChannelMemberRequest} removeChannelMemberRequest + * Follow a channel + * @summary Follow a channel + * @param {ChannelFollowReqBody} channel_follow_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/follow-channel) + * */ - removeChannelMember: async (removeChannelMemberRequest: RemoveChannelMemberRequest, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'removeChannelMemberRequest' is not null or undefined - assertParamExists('removeChannelMember', 'removeChannelMemberRequest', removeChannelMemberRequest) - const localVarPath = `/farcaster/channel/member`; + followChannel: async (channel_follow_req_body: ChannelFollowReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'channel_follow_req_body' is not null or undefined + assertParamExists('followChannel', 'channel_follow_req_body', channel_follow_req_body) + const localVarPath = `/farcaster/channel/follow`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -630,7 +624,7 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -644,7 +638,7 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(removeChannelMemberRequest, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(channel_follow_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -652,15 +646,19 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati }; }, /** - * Accept or reject a channel invite - * @summary Accept or reject an invite - * @param {RespondChannelInviteRequest} respondChannelInviteRequest + * Invite a user to a channel + * @summary Invite + * @param {InviteChannelMemberReqBody} invite_channel_member_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/invite-channel-member) + * */ - respondChannelInvite: async (respondChannelInviteRequest: RespondChannelInviteRequest, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'respondChannelInviteRequest' is not null or undefined - assertParamExists('respondChannelInvite', 'respondChannelInviteRequest', respondChannelInviteRequest) + inviteChannelMember: async (invite_channel_member_req_body: InviteChannelMemberReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'invite_channel_member_req_body' is not null or undefined + assertParamExists('inviteChannelMember', 'invite_channel_member_req_body', invite_channel_member_req_body) const localVarPath = `/farcaster/channel/member/invite`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -669,7 +667,7 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -683,7 +681,7 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(respondChannelInviteRequest, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(invite_channel_member_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -691,18 +689,22 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati }; }, /** - * Returns a list of channels based on ID or name - * @summary Search by ID or name - * @param {string} q Channel ID or name for the channel being queried - * @param {number} [limit] Number of results to fetch - * @param {string} [cursor] Pagination cursor. + * Returns details of a channel + * @summary By ID or parent_url + * @param {string} id Channel ID for the channel being queried + * @param {ChannelType} [type] Type of identifier being used to query the channel. Defaults to ID. + * @param {number} [viewer_fid] FID of the user viewing the channel. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ChannelResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-channel) + * */ - searchChannels: async (q: string, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'q' is not null or undefined - assertParamExists('searchChannels', 'q', q) - const localVarPath = `/farcaster/channel/search`; + lookupChannel: async (id: string, type?: ChannelType, viewer_fid?: number, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('lookupChannel', 'id', id) + const localVarPath = `/farcaster/channel`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -717,16 +719,16 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (q !== undefined) { - localVarQueryParameter['q'] = q; + if (id !== undefined) { + localVarQueryParameter['id'] = id; } - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; + if (type !== undefined) { + localVarQueryParameter['type'] = type; } - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; } @@ -741,16 +743,20 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati }; }, /** - * Returns a list of trending channels based on activity - * @summary Channels by activity - * @param {TrendingChannelsTimeWindowEnum} [timeWindow] - * @param {number} [limit] Number of results to fetch (default 10, max 25) - * @param {string} [cursor] Pagination cursor. + * Remove a user from a channel or a user\'s invite to a channel role + * @summary Remove user + * @param {RemoveChannelMemberReqBody} remove_channel_member_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/remove-channel-member) + * */ - trendingChannels: async (timeWindow?: TrendingChannelsTimeWindowEnum, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/farcaster/channel/trending`; + removeChannelMember: async (remove_channel_member_req_body: RemoveChannelMemberReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'remove_channel_member_req_body' is not null or undefined + assertParamExists('removeChannelMember', 'remove_channel_member_req_body', remove_channel_member_req_body) + const localVarPath = `/farcaster/channel/member`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -758,30 +764,21 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (timeWindow !== undefined) { - localVarQueryParameter['time_window'] = timeWindow; - } - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; - } - + localVarHeaderParameter['Content-Type'] = 'application/json'; + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(remove_channel_member_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -789,16 +786,20 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati }; }, /** - * Unfollow a channel - * @summary Unfollow a channel - * @param {ChannelFollowReqBody} channelFollowReqBody + * Accept or reject a channel invite + * @summary Accept or reject an invite + * @param {RespondChannelInviteReqBody} respond_channel_invite_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/respond-channel-invite) + * */ - unfollowChannel: async (channelFollowReqBody: ChannelFollowReqBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'channelFollowReqBody' is not null or undefined - assertParamExists('unfollowChannel', 'channelFollowReqBody', channelFollowReqBody) - const localVarPath = `/farcaster/channel/follow`; + respondChannelInvite: async (respond_channel_invite_req_body: RespondChannelInviteReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'respond_channel_invite_req_body' is not null or undefined + assertParamExists('respondChannelInvite', 'respond_channel_invite_req_body', respond_channel_invite_req_body) + const localVarPath = `/farcaster/channel/member/invite`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -806,7 +807,7 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -820,7 +821,7 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(channelFollowReqBody, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(respond_channel_invite_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -828,18 +829,22 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati }; }, /** - * Returns a list of all channels with their details that an FID is a member of. Data may have a delay of up to 1 hour. - * @summary Member of - * @param {number} fid The FID of the user. - * @param {number} [limit] Number of results to fetch (default 20, max 100) - * @param {string} [cursor] Pagination cursor. + * Returns a list of channels based on ID or name + * @summary Search by ID or name + * @param {string} q Channel ID or name for the channel being queried + * @param {number} [limit] Number of results to fetch (Default: 20, Maximum: 200) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ChannelSearchResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/search-channels) + * */ - userChannelMemberships: async (fid: number, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'fid' is not null or undefined - assertParamExists('userChannelMemberships', 'fid', fid) - const localVarPath = `/farcaster/user/memberships/list`; + searchChannels: async (q: string, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'q' is not null or undefined + assertParamExists('searchChannels', 'q', q) + const localVarPath = `/farcaster/channel/search`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -854,8 +859,8 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (fid !== undefined) { - localVarQueryParameter['fid'] = fid; + if (q !== undefined) { + localVarQueryParameter['q'] = q; } if (limit !== undefined) { @@ -878,18 +883,20 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati }; }, /** - * Returns a list of all channels with their details that a FID follows. - * @summary Following - * @param {number} fid The FID of the user. - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. + * Unfollow a channel + * @summary Unfollow a channel + * @param {ChannelFollowReqBody} channel_follow_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/unfollow-channel) + * */ - userChannels: async (fid: number, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'fid' is not null or undefined - assertParamExists('userChannels', 'fid', fid) - const localVarPath = `/farcaster/user/channels`; + unfollowChannel: async (channel_follow_req_body: ChannelFollowReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'channel_follow_req_body' is not null or undefined + assertParamExists('unfollowChannel', 'channel_follow_req_body', channel_follow_req_body) + const localVarPath = `/farcaster/channel/follow`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -897,30 +904,21 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (fid !== undefined) { - localVarQueryParameter['fid'] = fid; - } - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } + + localVarHeaderParameter['Content-Type'] = 'application/json'; - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; - } - - - setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(channel_follow_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -938,268 +936,317 @@ export const ChannelApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = ChannelApiAxiosParamCreator(configuration) return { /** - * Fetches all channels that a user has casted in, in reverse chronological order. - * @summary Fetch channels that user is active in - * @param {number} fid The user\'s FID (identifier) - * @param {number} [limit] Number of results to fetch (default 20, max 100). - * @param {string} [cursor] Pagination cursor. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async activeChannels(fid: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.activeChannels(fid, limit, cursor, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ChannelApi.activeChannels']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Returns details of a channel - * @summary By ID or parent_url - * @param {string} id Channel ID for the channel being queried - * @param {ChannelType} [type] Type of identifier being used to query the channel. Defaults to ID. - * @param {number} [viewerFid] FID of the user viewing the channel. + * Returns a list of all channels with their details + * @summary Fetch all channels with their details + * @param {number} [limit] Number of results to fetch (Default: 20, Maximum: 200) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ChannelListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-all-channels) + * */ - async channelDetails(id: string, type?: ChannelType, viewerFid?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.channelDetails(id, type, viewerFid, options); + async fetchAllChannels(limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchAllChannels(limit, cursor, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ChannelApi.channelDetails']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['ChannelApi.fetchAllChannels']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Returns details of multiple channels * @summary Bulk fetch - * @param {string} ids Comma separated list of channel IDs or parent_urls, up to 100 at a time - * @param {ChannelType} [type] Type of identifier being used to query the channels. Defaults to ID. - * @param {number} [viewerFid] FID of the user viewing the channels. + * @param {string} ids Comma separated list of channel IDs or parent_urls, up to 100 at a time + * @param {ChannelType} [type] Type of identifier being used to query the channels. Defaults to ID. + * @param {number} [viewer_fid] FID of the user viewing the channels. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ChannelResponseBulk` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-bulk-channels) + * */ - async channelDetailsBulk(ids: string, type?: ChannelType, viewerFid?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.channelDetailsBulk(ids, type, viewerFid, options); + async fetchBulkChannels(ids: string, type?: ChannelType, viewer_fid?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchBulkChannels(ids, type, viewer_fid, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ChannelApi.channelDetailsBulk']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['ChannelApi.fetchBulkChannels']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Returns a list of followers for a specific channel. Max limit is 1000. Use cursor for pagination. - * @summary For channel - * @param {string} id Channel ID for the channel being queried - * @param {number} [viewerFid] Providing this will return a list of followers that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of followers to fetch (default 25, max 1000) + * Fetch a list of invites, either in a channel or for a user. If both are provided, open channel invite for that user is returned. + * @summary Open invites + * @param {string} [channel_id] Channel ID for the channel being queried + * @param {number} [invited_fid] FID of the user being invited + * @param {number} [limit] Number of results to fetch (Default: 20, Maximum: 100) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ChannelMemberInviteListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-channel-invites) + * */ - async channelFollowers(id: string, viewerFid?: number, cursor?: string, limit?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.channelFollowers(id, viewerFid, cursor, limit, options); + async fetchChannelInvites(channel_id?: string, invited_fid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchChannelInvites(channel_id, invited_fid, limit, cursor, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ChannelApi.channelFollowers']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['ChannelApi.fetchChannelInvites']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Returns a list of users who are active in a given channel, ordered by ascending FIDs - * @summary Fetch users who are active in a channel - * @param {string} id Channel ID for the channel being queried - * @param {boolean} hasRootCastAuthors Include users who posted the root cast in the channel - * @param {boolean} [hasCastLikers] Include users who liked a cast in the channel - * @param {boolean} [hasCastRecasters] Include users who recasted a cast in the channel - * @param {boolean} [hasReplyAuthors] Include users who replied to a cast in the channel - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to fetch (default 25, max 100) + * Fetch a list of members in a channel + * @summary Fetch members + * @param {string} channel_id Channel ID for the channel being queried + * @param {number} [fid] FID of the user being queried. Specify this to check if a user is a member of the channel without paginating through all members. + * @param {number} [limit] Number of results to fetch (Default: 20, Maximum: 100) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ChannelMemberListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-channel-members) + * */ - async channelUsers(id: string, hasRootCastAuthors: boolean, hasCastLikers?: boolean, hasCastRecasters?: boolean, hasReplyAuthors?: boolean, cursor?: string, limit?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.channelUsers(id, hasRootCastAuthors, hasCastLikers, hasCastRecasters, hasReplyAuthors, cursor, limit, options); + async fetchChannelMembers(channel_id: string, fid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchChannelMembers(channel_id, fid, limit, cursor, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ChannelApi.channelUsers']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['ChannelApi.fetchChannelMembers']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Follow a channel - * @summary Follow a channel - * @param {ChannelFollowReqBody} channelFollowReqBody + * Returns a list of followers for a specific channel. Max limit is 1000. Use cursor for pagination. + * @summary For channel + * @param {string} id Channel ID for the channel being queried + * @param {number} [viewer_fid] Providing this will return a list of followers that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of followers to fetch (Default: 25, Maximum: 1000) * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `UsersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-followers-for-a-channel) + * */ - async followChannel(channelFollowReqBody: ChannelFollowReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.followChannel(channelFollowReqBody, options); + async fetchFollowersForAChannel(id: string, viewer_fid?: number, cursor?: string, limit?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchFollowersForAChannel(id, viewer_fid, cursor, limit, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ChannelApi.followChannel']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['ChannelApi.fetchFollowersForAChannel']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Invite a user to a channel - * @summary Invite - * @param {RemoveChannelMemberRequest} removeChannelMemberRequest + * Returns a list of relevant channel followers for a specific FID. This usually shows on a channel as \"X, Y, Z follow this channel\". + * @summary Relevant followers + * @param {string} id Channel ID being queried + * @param {number} viewer_fid The FID of the user to customize this response for. Providing this will also return a list of followers that respects this user\'s mutes and blocks and includes `viewer_context`. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `RelevantFollowersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-relevant-followers-for-a-channel) + * */ - async inviteChannelMember(removeChannelMemberRequest: RemoveChannelMemberRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.inviteChannelMember(removeChannelMemberRequest, options); + async fetchRelevantFollowersForAChannel(id: string, viewer_fid: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchRelevantFollowersForAChannel(id, viewer_fid, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ChannelApi.inviteChannelMember']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['ChannelApi.fetchRelevantFollowersForAChannel']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Returns a list of all channels with their details - * @summary Fetch all channels with their details - * @param {number} [limit] Number of results to fetch - * @param {string} [cursor] Pagination cursor. + * Returns a list of trending channels based on activity + * @summary Channels by activity + * @param {FetchTrendingChannelsTimeWindowEnum} [time_window] + * @param {number} [limit] Number of results to fetch (Default: 10, Maximum: 25) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `TrendingChannelResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-trending-channels) + * */ - async listAllChannels(limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listAllChannels(limit, cursor, options); + async fetchTrendingChannels(time_window?: FetchTrendingChannelsTimeWindowEnum, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchTrendingChannels(time_window, limit, cursor, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ChannelApi.listAllChannels']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['ChannelApi.fetchTrendingChannels']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Fetch a list of invites, either in a channel or for a user. If both are provided, open channel invite for that user is returned. - * @summary Open invites - * @param {string} [channelId] Channel ID for the channel being queried - * @param {number} [invitedFid] FID of the user being invited - * @param {number} [limit] Number of results to fetch - * @param {string} [cursor] Pagination cursor. + * Returns a list of all channels with their details that an FID is a member of. Data may have a delay of up to 1 hour. + * @summary Member of + * @param {number} fid The FID of the user. + * @param {number} [limit] Number of results to fetch (Default: 20, Maximum: 100) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ChannelMemberListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-channel-memberships) + * */ - async listChannelInvites(channelId?: string, invitedFid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listChannelInvites(channelId, invitedFid, limit, cursor, options); + async fetchUserChannelMemberships(fid: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchUserChannelMemberships(fid, limit, cursor, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ChannelApi.listChannelInvites']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['ChannelApi.fetchUserChannelMemberships']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Fetch a list of members in a channel - * @summary Fetch members - * @param {string} channelId Channel ID for the channel being queried - * @param {number} [fid] FID of the user being queried. Specify this to check if a user is a member of the channel without paginating through all members. - * @param {number} [limit] Number of results to fetch - * @param {string} [cursor] Pagination cursor. + * Returns a list of all channels with their details that a FID follows. + * @summary Following + * @param {number} fid The FID of the user. + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ChannelListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-channels) + * */ - async listChannelMembers(channelId: string, fid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listChannelMembers(channelId, fid, limit, cursor, options); + async fetchUserChannels(fid: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchUserChannels(fid, limit, cursor, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ChannelApi.listChannelMembers']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['ChannelApi.fetchUserChannels']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Returns a list of relevant channel followers for a specific FID. This usually shows on a channel as \"X, Y, Z follow this channel\". - * @summary Relevant followers - * @param {string} id Channel ID being queried - * @param {number} viewerFid The FID of the user to customize this response for. Providing this will also return a list of followers that respects this user\'s mutes and blocks and includes `viewer_context`. + * Fetches all channels that a user has casted in, in reverse chronological order. + * @summary Fetch channels that user is active in + * @param {number} fid The user\'s FID (identifier) + * @param {number} [limit] Number of results to fetch (Default: 20, Maximum: 100) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `UsersActiveChannelsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-users-active-channels) + * */ - async relevantChannelFollowers(id: string, viewerFid: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.relevantChannelFollowers(id, viewerFid, options); + async fetchUsersActiveChannels(fid: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchUsersActiveChannels(fid, limit, cursor, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ChannelApi.relevantChannelFollowers']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['ChannelApi.fetchUsersActiveChannels']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Remove a user from a channel or a user\'s invite to a channel role - * @summary Remove user - * @param {RemoveChannelMemberRequest} removeChannelMemberRequest + * Follow a channel + * @summary Follow a channel + * @param {ChannelFollowReqBody} channel_follow_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/follow-channel) + * */ - async removeChannelMember(removeChannelMemberRequest: RemoveChannelMemberRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.removeChannelMember(removeChannelMemberRequest, options); + async followChannel(channel_follow_req_body: ChannelFollowReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.followChannel(channel_follow_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ChannelApi.removeChannelMember']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['ChannelApi.followChannel']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Accept or reject a channel invite - * @summary Accept or reject an invite - * @param {RespondChannelInviteRequest} respondChannelInviteRequest + * Invite a user to a channel + * @summary Invite + * @param {InviteChannelMemberReqBody} invite_channel_member_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/invite-channel-member) + * */ - async respondChannelInvite(respondChannelInviteRequest: RespondChannelInviteRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.respondChannelInvite(respondChannelInviteRequest, options); + async inviteChannelMember(invite_channel_member_req_body: InviteChannelMemberReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.inviteChannelMember(invite_channel_member_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ChannelApi.respondChannelInvite']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['ChannelApi.inviteChannelMember']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Returns a list of channels based on ID or name - * @summary Search by ID or name - * @param {string} q Channel ID or name for the channel being queried - * @param {number} [limit] Number of results to fetch - * @param {string} [cursor] Pagination cursor. + * Returns details of a channel + * @summary By ID or parent_url + * @param {string} id Channel ID for the channel being queried + * @param {ChannelType} [type] Type of identifier being used to query the channel. Defaults to ID. + * @param {number} [viewer_fid] FID of the user viewing the channel. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ChannelResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-channel) + * */ - async searchChannels(q: string, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.searchChannels(q, limit, cursor, options); + async lookupChannel(id: string, type?: ChannelType, viewer_fid?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.lookupChannel(id, type, viewer_fid, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ChannelApi.searchChannels']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['ChannelApi.lookupChannel']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Returns a list of trending channels based on activity - * @summary Channels by activity - * @param {TrendingChannelsTimeWindowEnum} [timeWindow] - * @param {number} [limit] Number of results to fetch (default 10, max 25) - * @param {string} [cursor] Pagination cursor. + * Remove a user from a channel or a user\'s invite to a channel role + * @summary Remove user + * @param {RemoveChannelMemberReqBody} remove_channel_member_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/remove-channel-member) + * */ - async trendingChannels(timeWindow?: TrendingChannelsTimeWindowEnum, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.trendingChannels(timeWindow, limit, cursor, options); + async removeChannelMember(remove_channel_member_req_body: RemoveChannelMemberReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.removeChannelMember(remove_channel_member_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ChannelApi.trendingChannels']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['ChannelApi.removeChannelMember']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Unfollow a channel - * @summary Unfollow a channel - * @param {ChannelFollowReqBody} channelFollowReqBody + * Accept or reject a channel invite + * @summary Accept or reject an invite + * @param {RespondChannelInviteReqBody} respond_channel_invite_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/respond-channel-invite) + * */ - async unfollowChannel(channelFollowReqBody: ChannelFollowReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.unfollowChannel(channelFollowReqBody, options); + async respondChannelInvite(respond_channel_invite_req_body: RespondChannelInviteReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.respondChannelInvite(respond_channel_invite_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ChannelApi.unfollowChannel']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['ChannelApi.respondChannelInvite']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Returns a list of all channels with their details that an FID is a member of. Data may have a delay of up to 1 hour. - * @summary Member of - * @param {number} fid The FID of the user. - * @param {number} [limit] Number of results to fetch (default 20, max 100) - * @param {string} [cursor] Pagination cursor. + * Returns a list of channels based on ID or name + * @summary Search by ID or name + * @param {string} q Channel ID or name for the channel being queried + * @param {number} [limit] Number of results to fetch (Default: 20, Maximum: 200) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ChannelSearchResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/search-channels) + * */ - async userChannelMemberships(fid: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.userChannelMemberships(fid, limit, cursor, options); + async searchChannels(q: string, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.searchChannels(q, limit, cursor, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ChannelApi.userChannelMemberships']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['ChannelApi.searchChannels']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Returns a list of all channels with their details that a FID follows. - * @summary Following - * @param {number} fid The FID of the user. - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. + * Unfollow a channel + * @summary Unfollow a channel + * @param {ChannelFollowReqBody} channel_follow_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/unfollow-channel) + * */ - async userChannels(fid: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.userChannels(fid, limit, cursor, options); + async unfollowChannel(channel_follow_req_body: ChannelFollowReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.unfollowChannel(channel_follow_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ChannelApi.userChannels']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['ChannelApi.unfollowChannel']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } @@ -1213,480 +1260,1275 @@ export const ChannelApiFactory = function (configuration?: Configuration, basePa const localVarFp = ChannelApiFp(configuration) return { /** - * Fetches all channels that a user has casted in, in reverse chronological order. - * @summary Fetch channels that user is active in - * @param {number} fid The user\'s FID (identifier) - * @param {number} [limit] Number of results to fetch (default 20, max 100). - * @param {string} [cursor] Pagination cursor. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - activeChannels(fid: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.activeChannels(fid, limit, cursor, options).then((request) => request(axios, basePath)); - }, - /** - * Returns details of a channel - * @summary By ID or parent_url - * @param {string} id Channel ID for the channel being queried - * @param {ChannelType} [type] Type of identifier being used to query the channel. Defaults to ID. - * @param {number} [viewerFid] FID of the user viewing the channel. + * Returns a list of all channels with their details + * @summary Fetch all channels with their details + * @param {ChannelApiFetchAllChannelsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ChannelListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-all-channels) + * */ - channelDetails(id: string, type?: ChannelType, viewerFid?: number, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.channelDetails(id, type, viewerFid, options).then((request) => request(axios, basePath)); + fetchAllChannels(requestParameters: ChannelApiFetchAllChannelsRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchAllChannels(requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath)); }, /** * Returns details of multiple channels * @summary Bulk fetch - * @param {string} ids Comma separated list of channel IDs or parent_urls, up to 100 at a time - * @param {ChannelType} [type] Type of identifier being used to query the channels. Defaults to ID. - * @param {number} [viewerFid] FID of the user viewing the channels. + * @param {ChannelApiFetchBulkChannelsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ChannelResponseBulk` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-bulk-channels) + * */ - channelDetailsBulk(ids: string, type?: ChannelType, viewerFid?: number, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.channelDetailsBulk(ids, type, viewerFid, options).then((request) => request(axios, basePath)); + fetchBulkChannels(requestParameters: ChannelApiFetchBulkChannelsRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchBulkChannels(requestParameters.ids, requestParameters.type, requestParameters.viewer_fid, options).then((request) => request(axios, basePath)); }, /** - * Returns a list of followers for a specific channel. Max limit is 1000. Use cursor for pagination. - * @summary For channel - * @param {string} id Channel ID for the channel being queried - * @param {number} [viewerFid] Providing this will return a list of followers that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of followers to fetch (default 25, max 1000) + * Fetch a list of invites, either in a channel or for a user. If both are provided, open channel invite for that user is returned. + * @summary Open invites + * @param {ChannelApiFetchChannelInvitesRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ChannelMemberInviteListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-channel-invites) + * */ - channelFollowers(id: string, viewerFid?: number, cursor?: string, limit?: number, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.channelFollowers(id, viewerFid, cursor, limit, options).then((request) => request(axios, basePath)); + fetchChannelInvites(requestParameters: ChannelApiFetchChannelInvitesRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchChannelInvites(requestParameters.channel_id, requestParameters.invited_fid, requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath)); }, /** - * Returns a list of users who are active in a given channel, ordered by ascending FIDs - * @summary Fetch users who are active in a channel - * @param {string} id Channel ID for the channel being queried - * @param {boolean} hasRootCastAuthors Include users who posted the root cast in the channel - * @param {boolean} [hasCastLikers] Include users who liked a cast in the channel - * @param {boolean} [hasCastRecasters] Include users who recasted a cast in the channel - * @param {boolean} [hasReplyAuthors] Include users who replied to a cast in the channel - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to fetch (default 25, max 100) + * Fetch a list of members in a channel + * @summary Fetch members + * @param {ChannelApiFetchChannelMembersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ChannelMemberListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-channel-members) + * */ - channelUsers(id: string, hasRootCastAuthors: boolean, hasCastLikers?: boolean, hasCastRecasters?: boolean, hasReplyAuthors?: boolean, cursor?: string, limit?: number, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.channelUsers(id, hasRootCastAuthors, hasCastLikers, hasCastRecasters, hasReplyAuthors, cursor, limit, options).then((request) => request(axios, basePath)); + fetchChannelMembers(requestParameters: ChannelApiFetchChannelMembersRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchChannelMembers(requestParameters.channel_id, requestParameters.fid, requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath)); }, /** - * Follow a channel - * @summary Follow a channel - * @param {ChannelFollowReqBody} channelFollowReqBody + * Returns a list of followers for a specific channel. Max limit is 1000. Use cursor for pagination. + * @summary For channel + * @param {ChannelApiFetchFollowersForAChannelRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `UsersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-followers-for-a-channel) + * */ - followChannel(channelFollowReqBody: ChannelFollowReqBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.followChannel(channelFollowReqBody, options).then((request) => request(axios, basePath)); + fetchFollowersForAChannel(requestParameters: ChannelApiFetchFollowersForAChannelRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchFollowersForAChannel(requestParameters.id, requestParameters.viewer_fid, requestParameters.cursor, requestParameters.limit, options).then((request) => request(axios, basePath)); }, /** - * Invite a user to a channel - * @summary Invite - * @param {RemoveChannelMemberRequest} removeChannelMemberRequest + * Returns a list of relevant channel followers for a specific FID. This usually shows on a channel as \"X, Y, Z follow this channel\". + * @summary Relevant followers + * @param {ChannelApiFetchRelevantFollowersForAChannelRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `RelevantFollowersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-relevant-followers-for-a-channel) + * */ - inviteChannelMember(removeChannelMemberRequest: RemoveChannelMemberRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.inviteChannelMember(removeChannelMemberRequest, options).then((request) => request(axios, basePath)); + fetchRelevantFollowersForAChannel(requestParameters: ChannelApiFetchRelevantFollowersForAChannelRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchRelevantFollowersForAChannel(requestParameters.id, requestParameters.viewer_fid, options).then((request) => request(axios, basePath)); }, /** - * Returns a list of all channels with their details - * @summary Fetch all channels with their details - * @param {number} [limit] Number of results to fetch - * @param {string} [cursor] Pagination cursor. + * Returns a list of trending channels based on activity + * @summary Channels by activity + * @param {ChannelApiFetchTrendingChannelsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `TrendingChannelResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-trending-channels) + * */ - listAllChannels(limit?: number, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.listAllChannels(limit, cursor, options).then((request) => request(axios, basePath)); + fetchTrendingChannels(requestParameters: ChannelApiFetchTrendingChannelsRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchTrendingChannels(requestParameters.time_window, requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath)); }, /** - * Fetch a list of invites, either in a channel or for a user. If both are provided, open channel invite for that user is returned. - * @summary Open invites - * @param {string} [channelId] Channel ID for the channel being queried - * @param {number} [invitedFid] FID of the user being invited - * @param {number} [limit] Number of results to fetch - * @param {string} [cursor] Pagination cursor. + * Returns a list of all channels with their details that an FID is a member of. Data may have a delay of up to 1 hour. + * @summary Member of + * @param {ChannelApiFetchUserChannelMembershipsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ChannelMemberListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-channel-memberships) + * */ - listChannelInvites(channelId?: string, invitedFid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.listChannelInvites(channelId, invitedFid, limit, cursor, options).then((request) => request(axios, basePath)); + fetchUserChannelMemberships(requestParameters: ChannelApiFetchUserChannelMembershipsRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchUserChannelMemberships(requestParameters.fid, requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath)); }, /** - * Fetch a list of members in a channel - * @summary Fetch members - * @param {string} channelId Channel ID for the channel being queried - * @param {number} [fid] FID of the user being queried. Specify this to check if a user is a member of the channel without paginating through all members. - * @param {number} [limit] Number of results to fetch - * @param {string} [cursor] Pagination cursor. + * Returns a list of all channels with their details that a FID follows. + * @summary Following + * @param {ChannelApiFetchUserChannelsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ChannelListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-channels) + * */ - listChannelMembers(channelId: string, fid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.listChannelMembers(channelId, fid, limit, cursor, options).then((request) => request(axios, basePath)); + fetchUserChannels(requestParameters: ChannelApiFetchUserChannelsRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchUserChannels(requestParameters.fid, requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath)); }, /** - * Returns a list of relevant channel followers for a specific FID. This usually shows on a channel as \"X, Y, Z follow this channel\". - * @summary Relevant followers - * @param {string} id Channel ID being queried - * @param {number} viewerFid The FID of the user to customize this response for. Providing this will also return a list of followers that respects this user\'s mutes and blocks and includes `viewer_context`. + * Fetches all channels that a user has casted in, in reverse chronological order. + * @summary Fetch channels that user is active in + * @param {ChannelApiFetchUsersActiveChannelsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `UsersActiveChannelsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-users-active-channels) + * */ - relevantChannelFollowers(id: string, viewerFid: number, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.relevantChannelFollowers(id, viewerFid, options).then((request) => request(axios, basePath)); + fetchUsersActiveChannels(requestParameters: ChannelApiFetchUsersActiveChannelsRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchUsersActiveChannels(requestParameters.fid, requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath)); }, /** - * Remove a user from a channel or a user\'s invite to a channel role - * @summary Remove user - * @param {RemoveChannelMemberRequest} removeChannelMemberRequest + * Follow a channel + * @summary Follow a channel + * @param {ChannelApiFollowChannelRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/follow-channel) + * */ - removeChannelMember(removeChannelMemberRequest: RemoveChannelMemberRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.removeChannelMember(removeChannelMemberRequest, options).then((request) => request(axios, basePath)); + followChannel(requestParameters: ChannelApiFollowChannelRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.followChannel(requestParameters.channel_follow_req_body, options).then((request) => request(axios, basePath)); }, /** - * Accept or reject a channel invite - * @summary Accept or reject an invite - * @param {RespondChannelInviteRequest} respondChannelInviteRequest + * Invite a user to a channel + * @summary Invite + * @param {ChannelApiInviteChannelMemberRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/invite-channel-member) + * */ - respondChannelInvite(respondChannelInviteRequest: RespondChannelInviteRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.respondChannelInvite(respondChannelInviteRequest, options).then((request) => request(axios, basePath)); + inviteChannelMember(requestParameters: ChannelApiInviteChannelMemberRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.inviteChannelMember(requestParameters.invite_channel_member_req_body, options).then((request) => request(axios, basePath)); }, /** - * Returns a list of channels based on ID or name - * @summary Search by ID or name - * @param {string} q Channel ID or name for the channel being queried - * @param {number} [limit] Number of results to fetch - * @param {string} [cursor] Pagination cursor. + * Returns details of a channel + * @summary By ID or parent_url + * @param {ChannelApiLookupChannelRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ChannelResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-channel) + * */ - searchChannels(q: string, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.searchChannels(q, limit, cursor, options).then((request) => request(axios, basePath)); + lookupChannel(requestParameters: ChannelApiLookupChannelRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.lookupChannel(requestParameters.id, requestParameters.type, requestParameters.viewer_fid, options).then((request) => request(axios, basePath)); }, /** - * Returns a list of trending channels based on activity - * @summary Channels by activity - * @param {TrendingChannelsTimeWindowEnum} [timeWindow] - * @param {number} [limit] Number of results to fetch (default 10, max 25) - * @param {string} [cursor] Pagination cursor. + * Remove a user from a channel or a user\'s invite to a channel role + * @summary Remove user + * @param {ChannelApiRemoveChannelMemberRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/remove-channel-member) + * */ - trendingChannels(timeWindow?: TrendingChannelsTimeWindowEnum, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.trendingChannels(timeWindow, limit, cursor, options).then((request) => request(axios, basePath)); + removeChannelMember(requestParameters: ChannelApiRemoveChannelMemberRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.removeChannelMember(requestParameters.remove_channel_member_req_body, options).then((request) => request(axios, basePath)); }, /** - * Unfollow a channel - * @summary Unfollow a channel - * @param {ChannelFollowReqBody} channelFollowReqBody + * Accept or reject a channel invite + * @summary Accept or reject an invite + * @param {ChannelApiRespondChannelInviteRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/respond-channel-invite) + * */ - unfollowChannel(channelFollowReqBody: ChannelFollowReqBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.unfollowChannel(channelFollowReqBody, options).then((request) => request(axios, basePath)); + respondChannelInvite(requestParameters: ChannelApiRespondChannelInviteRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.respondChannelInvite(requestParameters.respond_channel_invite_req_body, options).then((request) => request(axios, basePath)); }, /** - * Returns a list of all channels with their details that an FID is a member of. Data may have a delay of up to 1 hour. - * @summary Member of - * @param {number} fid The FID of the user. - * @param {number} [limit] Number of results to fetch (default 20, max 100) - * @param {string} [cursor] Pagination cursor. + * Returns a list of channels based on ID or name + * @summary Search by ID or name + * @param {ChannelApiSearchChannelsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ChannelSearchResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/search-channels) + * */ - userChannelMemberships(fid: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.userChannelMemberships(fid, limit, cursor, options).then((request) => request(axios, basePath)); + searchChannels(requestParameters: ChannelApiSearchChannelsRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.searchChannels(requestParameters.q, requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath)); }, /** - * Returns a list of all channels with their details that a FID follows. - * @summary Following - * @param {number} fid The FID of the user. - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. + * Unfollow a channel + * @summary Unfollow a channel + * @param {ChannelApiUnfollowChannelRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/unfollow-channel) + * */ - userChannels(fid: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.userChannels(fid, limit, cursor, options).then((request) => request(axios, basePath)); + unfollowChannel(requestParameters: ChannelApiUnfollowChannelRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.unfollowChannel(requestParameters.channel_follow_req_body, options).then((request) => request(axios, basePath)); }, }; }; /** - * ChannelApi - object-oriented interface + * ChannelApi - interface * @export - * @class ChannelApi - * @extends {BaseAPI} + * @interface ChannelApi */ -export class ChannelApi extends BaseAPI { +export interface ChannelApiInterface { /** - * Fetches all channels that a user has casted in, in reverse chronological order. - * @summary Fetch channels that user is active in - * @param {number} fid The user\'s FID (identifier) - * @param {number} [limit] Number of results to fetch (default 20, max 100). - * @param {string} [cursor] Pagination cursor. + * Returns a list of all channels with their details + * @summary Fetch all channels with their details + * @param {ChannelApiFetchAllChannelsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof ChannelApi + * @memberof ChannelApiInterface + * @returns {Promise} A promise that resolves to a `ChannelListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-all-channels) + * */ - public activeChannels(fid: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig) { - return ChannelApiFp(this.configuration).activeChannels(fid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); - } + fetchAllChannels(requestParameters?: ChannelApiFetchAllChannelsRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** - * Returns details of a channel - * @summary By ID or parent_url - * @param {string} id Channel ID for the channel being queried - * @param {ChannelType} [type] Type of identifier being used to query the channel. Defaults to ID. - * @param {number} [viewerFid] FID of the user viewing the channel. + * Returns details of multiple channels + * @summary Bulk fetch + * @param {ChannelApiFetchBulkChannelsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof ChannelApi + * @memberof ChannelApiInterface + * @returns {Promise} A promise that resolves to a `ChannelResponseBulk` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-bulk-channels) + * */ - public channelDetails(id: string, type?: ChannelType, viewerFid?: number, options?: RawAxiosRequestConfig) { - return ChannelApiFp(this.configuration).channelDetails(id, type, viewerFid, options).then((request) => request(this.axios, this.basePath)); - } + fetchBulkChannels(requestParameters: ChannelApiFetchBulkChannelsRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** - * Returns details of multiple channels - * @summary Bulk fetch - * @param {string} ids Comma separated list of channel IDs or parent_urls, up to 100 at a time - * @param {ChannelType} [type] Type of identifier being used to query the channels. Defaults to ID. - * @param {number} [viewerFid] FID of the user viewing the channels. + * Fetch a list of invites, either in a channel or for a user. If both are provided, open channel invite for that user is returned. + * @summary Open invites + * @param {ChannelApiFetchChannelInvitesRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof ChannelApi + * @memberof ChannelApiInterface + * @returns {Promise} A promise that resolves to a `ChannelMemberInviteListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-channel-invites) + * */ - public channelDetailsBulk(ids: string, type?: ChannelType, viewerFid?: number, options?: RawAxiosRequestConfig) { - return ChannelApiFp(this.configuration).channelDetailsBulk(ids, type, viewerFid, options).then((request) => request(this.axios, this.basePath)); - } + fetchChannelInvites(requestParameters?: ChannelApiFetchChannelInvitesRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Fetch a list of members in a channel + * @summary Fetch members + * @param {ChannelApiFetchChannelMembersRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ChannelApiInterface + * @returns {Promise} A promise that resolves to a `ChannelMemberListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-channel-members) + * + */ + fetchChannelMembers(requestParameters: ChannelApiFetchChannelMembersRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Returns a list of followers for a specific channel. Max limit is 1000. Use cursor for pagination. * @summary For channel - * @param {string} id Channel ID for the channel being queried - * @param {number} [viewerFid] Providing this will return a list of followers that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of followers to fetch (default 25, max 1000) + * @param {ChannelApiFetchFollowersForAChannelRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof ChannelApi + * @memberof ChannelApiInterface + * @returns {Promise} A promise that resolves to a `UsersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-followers-for-a-channel) + * */ - public channelFollowers(id: string, viewerFid?: number, cursor?: string, limit?: number, options?: RawAxiosRequestConfig) { - return ChannelApiFp(this.configuration).channelFollowers(id, viewerFid, cursor, limit, options).then((request) => request(this.axios, this.basePath)); - } + fetchFollowersForAChannel(requestParameters: ChannelApiFetchFollowersForAChannelRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** - * Returns a list of users who are active in a given channel, ordered by ascending FIDs - * @summary Fetch users who are active in a channel - * @param {string} id Channel ID for the channel being queried - * @param {boolean} hasRootCastAuthors Include users who posted the root cast in the channel - * @param {boolean} [hasCastLikers] Include users who liked a cast in the channel - * @param {boolean} [hasCastRecasters] Include users who recasted a cast in the channel - * @param {boolean} [hasReplyAuthors] Include users who replied to a cast in the channel - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to fetch (default 25, max 100) + * Returns a list of relevant channel followers for a specific FID. This usually shows on a channel as \"X, Y, Z follow this channel\". + * @summary Relevant followers + * @param {ChannelApiFetchRelevantFollowersForAChannelRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof ChannelApi + * @memberof ChannelApiInterface + * @returns {Promise} A promise that resolves to a `RelevantFollowersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-relevant-followers-for-a-channel) + * */ - public channelUsers(id: string, hasRootCastAuthors: boolean, hasCastLikers?: boolean, hasCastRecasters?: boolean, hasReplyAuthors?: boolean, cursor?: string, limit?: number, options?: RawAxiosRequestConfig) { - return ChannelApiFp(this.configuration).channelUsers(id, hasRootCastAuthors, hasCastLikers, hasCastRecasters, hasReplyAuthors, cursor, limit, options).then((request) => request(this.axios, this.basePath)); - } + fetchRelevantFollowersForAChannel(requestParameters: ChannelApiFetchRelevantFollowersForAChannelRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** - * Follow a channel - * @summary Follow a channel - * @param {ChannelFollowReqBody} channelFollowReqBody + * Returns a list of trending channels based on activity + * @summary Channels by activity + * @param {ChannelApiFetchTrendingChannelsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof ChannelApi + * @memberof ChannelApiInterface + * @returns {Promise} A promise that resolves to a `TrendingChannelResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-trending-channels) + * */ - public followChannel(channelFollowReqBody: ChannelFollowReqBody, options?: RawAxiosRequestConfig) { - return ChannelApiFp(this.configuration).followChannel(channelFollowReqBody, options).then((request) => request(this.axios, this.basePath)); - } + fetchTrendingChannels(requestParameters?: ChannelApiFetchTrendingChannelsRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** - * Invite a user to a channel - * @summary Invite - * @param {RemoveChannelMemberRequest} removeChannelMemberRequest + * Returns a list of all channels with their details that an FID is a member of. Data may have a delay of up to 1 hour. + * @summary Member of + * @param {ChannelApiFetchUserChannelMembershipsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof ChannelApi + * @memberof ChannelApiInterface + * @returns {Promise} A promise that resolves to a `ChannelMemberListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-channel-memberships) + * */ - public inviteChannelMember(removeChannelMemberRequest: RemoveChannelMemberRequest, options?: RawAxiosRequestConfig) { - return ChannelApiFp(this.configuration).inviteChannelMember(removeChannelMemberRequest, options).then((request) => request(this.axios, this.basePath)); - } + fetchUserChannelMemberships(requestParameters: ChannelApiFetchUserChannelMembershipsRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** - * Returns a list of all channels with their details - * @summary Fetch all channels with their details - * @param {number} [limit] Number of results to fetch - * @param {string} [cursor] Pagination cursor. + * Returns a list of all channels with their details that a FID follows. + * @summary Following + * @param {ChannelApiFetchUserChannelsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof ChannelApi + * @memberof ChannelApiInterface + * @returns {Promise} A promise that resolves to a `ChannelListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-channels) + * */ - public listAllChannels(limit?: number, cursor?: string, options?: RawAxiosRequestConfig) { - return ChannelApiFp(this.configuration).listAllChannels(limit, cursor, options).then((request) => request(this.axios, this.basePath)); - } + fetchUserChannels(requestParameters: ChannelApiFetchUserChannelsRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** - * Fetch a list of invites, either in a channel or for a user. If both are provided, open channel invite for that user is returned. - * @summary Open invites - * @param {string} [channelId] Channel ID for the channel being queried - * @param {number} [invitedFid] FID of the user being invited - * @param {number} [limit] Number of results to fetch - * @param {string} [cursor] Pagination cursor. + * Fetches all channels that a user has casted in, in reverse chronological order. + * @summary Fetch channels that user is active in + * @param {ChannelApiFetchUsersActiveChannelsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof ChannelApi + * @memberof ChannelApiInterface + * @returns {Promise} A promise that resolves to a `UsersActiveChannelsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-users-active-channels) + * */ - public listChannelInvites(channelId?: string, invitedFid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig) { - return ChannelApiFp(this.configuration).listChannelInvites(channelId, invitedFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); - } + fetchUsersActiveChannels(requestParameters: ChannelApiFetchUsersActiveChannelsRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** - * Fetch a list of members in a channel - * @summary Fetch members - * @param {string} channelId Channel ID for the channel being queried - * @param {number} [fid] FID of the user being queried. Specify this to check if a user is a member of the channel without paginating through all members. - * @param {number} [limit] Number of results to fetch - * @param {string} [cursor] Pagination cursor. + * Follow a channel + * @summary Follow a channel + * @param {ChannelApiFollowChannelRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof ChannelApi + * @memberof ChannelApiInterface + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/follow-channel) + * */ - public listChannelMembers(channelId: string, fid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig) { - return ChannelApiFp(this.configuration).listChannelMembers(channelId, fid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); - } + followChannel(requestParameters: ChannelApiFollowChannelRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** - * Returns a list of relevant channel followers for a specific FID. This usually shows on a channel as \"X, Y, Z follow this channel\". - * @summary Relevant followers - * @param {string} id Channel ID being queried - * @param {number} viewerFid The FID of the user to customize this response for. Providing this will also return a list of followers that respects this user\'s mutes and blocks and includes `viewer_context`. + * Invite a user to a channel + * @summary Invite + * @param {ChannelApiInviteChannelMemberRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof ChannelApi + * @memberof ChannelApiInterface + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/invite-channel-member) + * */ - public relevantChannelFollowers(id: string, viewerFid: number, options?: RawAxiosRequestConfig) { - return ChannelApiFp(this.configuration).relevantChannelFollowers(id, viewerFid, options).then((request) => request(this.axios, this.basePath)); - } + inviteChannelMember(requestParameters: ChannelApiInviteChannelMemberRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Returns details of a channel + * @summary By ID or parent_url + * @param {ChannelApiLookupChannelRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ChannelApiInterface + * @returns {Promise} A promise that resolves to a `ChannelResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-channel) + * + */ + lookupChannel(requestParameters: ChannelApiLookupChannelRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Remove a user from a channel or a user\'s invite to a channel role * @summary Remove user - * @param {RemoveChannelMemberRequest} removeChannelMemberRequest + * @param {ChannelApiRemoveChannelMemberRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof ChannelApi + * @memberof ChannelApiInterface + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/remove-channel-member) + * */ - public removeChannelMember(removeChannelMemberRequest: RemoveChannelMemberRequest, options?: RawAxiosRequestConfig) { - return ChannelApiFp(this.configuration).removeChannelMember(removeChannelMemberRequest, options).then((request) => request(this.axios, this.basePath)); - } + removeChannelMember(requestParameters: ChannelApiRemoveChannelMemberRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Accept or reject a channel invite * @summary Accept or reject an invite - * @param {RespondChannelInviteRequest} respondChannelInviteRequest + * @param {ChannelApiRespondChannelInviteRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof ChannelApi + * @memberof ChannelApiInterface + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/respond-channel-invite) + * */ - public respondChannelInvite(respondChannelInviteRequest: RespondChannelInviteRequest, options?: RawAxiosRequestConfig) { - return ChannelApiFp(this.configuration).respondChannelInvite(respondChannelInviteRequest, options).then((request) => request(this.axios, this.basePath)); - } + respondChannelInvite(requestParameters: ChannelApiRespondChannelInviteRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Returns a list of channels based on ID or name * @summary Search by ID or name - * @param {string} q Channel ID or name for the channel being queried - * @param {number} [limit] Number of results to fetch - * @param {string} [cursor] Pagination cursor. + * @param {ChannelApiSearchChannelsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof ChannelApi - */ - public searchChannels(q: string, limit?: number, cursor?: string, options?: RawAxiosRequestConfig) { - return ChannelApiFp(this.configuration).searchChannels(q, limit, cursor, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Returns a list of trending channels based on activity - * @summary Channels by activity - * @param {TrendingChannelsTimeWindowEnum} [timeWindow] - * @param {number} [limit] Number of results to fetch (default 10, max 25) - * @param {string} [cursor] Pagination cursor. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ChannelApi + * @memberof ChannelApiInterface + * @returns {Promise} A promise that resolves to a `ChannelSearchResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/search-channels) + * */ - public trendingChannels(timeWindow?: TrendingChannelsTimeWindowEnum, limit?: number, cursor?: string, options?: RawAxiosRequestConfig) { - return ChannelApiFp(this.configuration).trendingChannels(timeWindow, limit, cursor, options).then((request) => request(this.axios, this.basePath)); - } + searchChannels(requestParameters: ChannelApiSearchChannelsRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Unfollow a channel * @summary Unfollow a channel - * @param {ChannelFollowReqBody} channelFollowReqBody + * @param {ChannelApiUnfollowChannelRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof ChannelApi + * @memberof ChannelApiInterface + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/unfollow-channel) + * */ - public unfollowChannel(channelFollowReqBody: ChannelFollowReqBody, options?: RawAxiosRequestConfig) { - return ChannelApiFp(this.configuration).unfollowChannel(channelFollowReqBody, options).then((request) => request(this.axios, this.basePath)); - } + unfollowChannel(requestParameters: ChannelApiUnfollowChannelRequest, options?: RawAxiosRequestConfig): AxiosPromise; - /** - * Returns a list of all channels with their details that an FID is a member of. Data may have a delay of up to 1 hour. - * @summary Member of - * @param {number} fid The FID of the user. - * @param {number} [limit] Number of results to fetch (default 20, max 100) - * @param {string} [cursor] Pagination cursor. +} + +/** + * Request parameters for fetchAllChannels operation in ChannelApi. + * @export + * @interface ChannelApiFetchAllChannelsRequest + */ +export interface ChannelApiFetchAllChannelsRequest { + /** + * Number of results to fetch (Default: 20, Maximum: 200) + * + * + * @type {number} + * @memberof ChannelApiFetchAllChannels + */ + readonly limit?: number + + /** + * Pagination cursor. + * + * + * @type {string} + * @memberof ChannelApiFetchAllChannels + */ + readonly cursor?: string +} + +/** + * Request parameters for fetchBulkChannels operation in ChannelApi. + * @export + * @interface ChannelApiFetchBulkChannelsRequest + */ +export interface ChannelApiFetchBulkChannelsRequest { + /** + * Comma separated list of channel IDs or parent_urls, up to 100 at a time + * + * @commaSeparated + * @type {string} + * @memberof ChannelApiFetchBulkChannels + */ + readonly ids: string + + /** + * Type of identifier being used to query the channels. Defaults to ID. + * + * + * @type {ChannelType} + * @memberof ChannelApiFetchBulkChannels + */ + readonly type?: ChannelType + + /** + * FID of the user viewing the channels. + * + * + * @type {number} + * @memberof ChannelApiFetchBulkChannels + */ + readonly viewer_fid?: number +} + +/** + * Request parameters for fetchChannelInvites operation in ChannelApi. + * @export + * @interface ChannelApiFetchChannelInvitesRequest + */ +export interface ChannelApiFetchChannelInvitesRequest { + /** + * Channel ID for the channel being queried + * + * + * @type {string} + * @memberof ChannelApiFetchChannelInvites + */ + readonly channel_id?: string + + /** + * FID of the user being invited + * + * + * @type {number} + * @memberof ChannelApiFetchChannelInvites + */ + readonly invited_fid?: number + + /** + * Number of results to fetch (Default: 20, Maximum: 100) + * + * + * @type {number} + * @memberof ChannelApiFetchChannelInvites + */ + readonly limit?: number + + /** + * Pagination cursor. + * + * + * @type {string} + * @memberof ChannelApiFetchChannelInvites + */ + readonly cursor?: string +} + +/** + * Request parameters for fetchChannelMembers operation in ChannelApi. + * @export + * @interface ChannelApiFetchChannelMembersRequest + */ +export interface ChannelApiFetchChannelMembersRequest { + /** + * Channel ID for the channel being queried + * + * + * @type {string} + * @memberof ChannelApiFetchChannelMembers + */ + readonly channel_id: string + + /** + * FID of the user being queried. Specify this to check if a user is a member of the channel without paginating through all members. + * + * + * @type {number} + * @memberof ChannelApiFetchChannelMembers + */ + readonly fid?: number + + /** + * Number of results to fetch (Default: 20, Maximum: 100) + * + * + * @type {number} + * @memberof ChannelApiFetchChannelMembers + */ + readonly limit?: number + + /** + * Pagination cursor. + * + * + * @type {string} + * @memberof ChannelApiFetchChannelMembers + */ + readonly cursor?: string +} + +/** + * Request parameters for fetchFollowersForAChannel operation in ChannelApi. + * @export + * @interface ChannelApiFetchFollowersForAChannelRequest + */ +export interface ChannelApiFetchFollowersForAChannelRequest { + /** + * Channel ID for the channel being queried + * + * + * @type {string} + * @memberof ChannelApiFetchFollowersForAChannel + */ + readonly id: string + + /** + * Providing this will return a list of followers that respects this user\'s mutes and blocks and includes `viewer_context`. + * + * + * @type {number} + * @memberof ChannelApiFetchFollowersForAChannel + */ + readonly viewer_fid?: number + + /** + * Pagination cursor. + * + * + * @type {string} + * @memberof ChannelApiFetchFollowersForAChannel + */ + readonly cursor?: string + + /** + * Number of followers to fetch (Default: 25, Maximum: 1000) + * + * + * @type {number} + * @memberof ChannelApiFetchFollowersForAChannel + */ + readonly limit?: number +} + +/** + * Request parameters for fetchRelevantFollowersForAChannel operation in ChannelApi. + * @export + * @interface ChannelApiFetchRelevantFollowersForAChannelRequest + */ +export interface ChannelApiFetchRelevantFollowersForAChannelRequest { + /** + * Channel ID being queried + * + * + * @type {string} + * @memberof ChannelApiFetchRelevantFollowersForAChannel + */ + readonly id: string + + /** + * The FID of the user to customize this response for. Providing this will also return a list of followers that respects this user\'s mutes and blocks and includes `viewer_context`. + * + * + * @type {number} + * @memberof ChannelApiFetchRelevantFollowersForAChannel + */ + readonly viewer_fid: number +} + +/** + * Request parameters for fetchTrendingChannels operation in ChannelApi. + * @export + * @interface ChannelApiFetchTrendingChannelsRequest + */ +export interface ChannelApiFetchTrendingChannelsRequest { + /** + * + * + * + * @type {'1d' | '7d' | '30d'} + * @memberof ChannelApiFetchTrendingChannels + */ + readonly time_window?: FetchTrendingChannelsTimeWindowEnum + + /** + * Number of results to fetch (Default: 10, Maximum: 25) + * + * + * @type {number} + * @memberof ChannelApiFetchTrendingChannels + */ + readonly limit?: number + + /** + * Pagination cursor. + * + * + * @type {string} + * @memberof ChannelApiFetchTrendingChannels + */ + readonly cursor?: string +} + +/** + * Request parameters for fetchUserChannelMemberships operation in ChannelApi. + * @export + * @interface ChannelApiFetchUserChannelMembershipsRequest + */ +export interface ChannelApiFetchUserChannelMembershipsRequest { + /** + * The FID of the user. + * + * + * @type {number} + * @memberof ChannelApiFetchUserChannelMemberships + */ + readonly fid: number + + /** + * Number of results to fetch (Default: 20, Maximum: 100) + * + * + * @type {number} + * @memberof ChannelApiFetchUserChannelMemberships + */ + readonly limit?: number + + /** + * Pagination cursor. + * + * + * @type {string} + * @memberof ChannelApiFetchUserChannelMemberships + */ + readonly cursor?: string +} + +/** + * Request parameters for fetchUserChannels operation in ChannelApi. + * @export + * @interface ChannelApiFetchUserChannelsRequest + */ +export interface ChannelApiFetchUserChannelsRequest { + /** + * The FID of the user. + * + * + * @type {number} + * @memberof ChannelApiFetchUserChannels + */ + readonly fid: number + + /** + * Number of results to fetch (Default: 25, Maximum: 100) + * + * + * @type {number} + * @memberof ChannelApiFetchUserChannels + */ + readonly limit?: number + + /** + * Pagination cursor. + * + * + * @type {string} + * @memberof ChannelApiFetchUserChannels + */ + readonly cursor?: string +} + +/** + * Request parameters for fetchUsersActiveChannels operation in ChannelApi. + * @export + * @interface ChannelApiFetchUsersActiveChannelsRequest + */ +export interface ChannelApiFetchUsersActiveChannelsRequest { + /** + * The user\'s FID (identifier) + * + * + * @type {number} + * @memberof ChannelApiFetchUsersActiveChannels + */ + readonly fid: number + + /** + * Number of results to fetch (Default: 20, Maximum: 100) + * + * + * @type {number} + * @memberof ChannelApiFetchUsersActiveChannels + */ + readonly limit?: number + + /** + * Pagination cursor. + * + * + * @type {string} + * @memberof ChannelApiFetchUsersActiveChannels + */ + readonly cursor?: string +} + +/** + * Request parameters for followChannel operation in ChannelApi. + * @export + * @interface ChannelApiFollowChannelRequest + */ +export interface ChannelApiFollowChannelRequest { + /** + * + * + * + * @type {ChannelFollowReqBody} + * @memberof ChannelApiFollowChannel + */ + readonly channel_follow_req_body: ChannelFollowReqBody +} + +/** + * Request parameters for inviteChannelMember operation in ChannelApi. + * @export + * @interface ChannelApiInviteChannelMemberRequest + */ +export interface ChannelApiInviteChannelMemberRequest { + /** + * + * + * + * @type {InviteChannelMemberReqBody} + * @memberof ChannelApiInviteChannelMember + */ + readonly invite_channel_member_req_body: InviteChannelMemberReqBody +} + +/** + * Request parameters for lookupChannel operation in ChannelApi. + * @export + * @interface ChannelApiLookupChannelRequest + */ +export interface ChannelApiLookupChannelRequest { + /** + * Channel ID for the channel being queried + * + * + * @type {string} + * @memberof ChannelApiLookupChannel + */ + readonly id: string + + /** + * Type of identifier being used to query the channel. Defaults to ID. + * + * + * @type {ChannelType} + * @memberof ChannelApiLookupChannel + */ + readonly type?: ChannelType + + /** + * FID of the user viewing the channel. + * + * + * @type {number} + * @memberof ChannelApiLookupChannel + */ + readonly viewer_fid?: number +} + +/** + * Request parameters for removeChannelMember operation in ChannelApi. + * @export + * @interface ChannelApiRemoveChannelMemberRequest + */ +export interface ChannelApiRemoveChannelMemberRequest { + /** + * + * + * + * @type {RemoveChannelMemberReqBody} + * @memberof ChannelApiRemoveChannelMember + */ + readonly remove_channel_member_req_body: RemoveChannelMemberReqBody +} + +/** + * Request parameters for respondChannelInvite operation in ChannelApi. + * @export + * @interface ChannelApiRespondChannelInviteRequest + */ +export interface ChannelApiRespondChannelInviteRequest { + /** + * + * + * + * @type {RespondChannelInviteReqBody} + * @memberof ChannelApiRespondChannelInvite + */ + readonly respond_channel_invite_req_body: RespondChannelInviteReqBody +} + +/** + * Request parameters for searchChannels operation in ChannelApi. + * @export + * @interface ChannelApiSearchChannelsRequest + */ +export interface ChannelApiSearchChannelsRequest { + /** + * Channel ID or name for the channel being queried + * + * + * @type {string} + * @memberof ChannelApiSearchChannels + */ + readonly q: string + + /** + * Number of results to fetch (Default: 20, Maximum: 200) + * + * + * @type {number} + * @memberof ChannelApiSearchChannels + */ + readonly limit?: number + + /** + * Pagination cursor. + * + * + * @type {string} + * @memberof ChannelApiSearchChannels + */ + readonly cursor?: string +} + +/** + * Request parameters for unfollowChannel operation in ChannelApi. + * @export + * @interface ChannelApiUnfollowChannelRequest + */ +export interface ChannelApiUnfollowChannelRequest { + /** + * + * + * + * @type {ChannelFollowReqBody} + * @memberof ChannelApiUnfollowChannel + */ + readonly channel_follow_req_body: ChannelFollowReqBody +} + +/** + * ChannelApi - object-oriented interface + * @export + * @class ChannelApi + * @extends {BaseAPI} + */ +export class ChannelApi extends BaseAPI implements ChannelApiInterface { + /** + * Returns a list of all channels with their details + * @summary Fetch all channels with their details + * @param {ChannelApiFetchAllChannelsRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ChannelApi + * @returns {Promise} A promise that resolves to a `ChannelListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-all-channels) + * + */ + public fetchAllChannels(requestParameters: ChannelApiFetchAllChannelsRequest = {}, options?: RawAxiosRequestConfig) { + return ChannelApiFp(this.configuration).fetchAllChannels(requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns details of multiple channels + * @summary Bulk fetch + * @param {ChannelApiFetchBulkChannelsRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ChannelApi + * @returns {Promise} A promise that resolves to a `ChannelResponseBulk` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-bulk-channels) + * + */ + public fetchBulkChannels(requestParameters: ChannelApiFetchBulkChannelsRequest, options?: RawAxiosRequestConfig) { + return ChannelApiFp(this.configuration).fetchBulkChannels(requestParameters.ids, requestParameters.type, requestParameters.viewer_fid, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Fetch a list of invites, either in a channel or for a user. If both are provided, open channel invite for that user is returned. + * @summary Open invites + * @param {ChannelApiFetchChannelInvitesRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ChannelApi + * @returns {Promise} A promise that resolves to a `ChannelMemberInviteListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-channel-invites) + * + */ + public fetchChannelInvites(requestParameters: ChannelApiFetchChannelInvitesRequest = {}, options?: RawAxiosRequestConfig) { + return ChannelApiFp(this.configuration).fetchChannelInvites(requestParameters.channel_id, requestParameters.invited_fid, requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Fetch a list of members in a channel + * @summary Fetch members + * @param {ChannelApiFetchChannelMembersRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ChannelApi + * @returns {Promise} A promise that resolves to a `ChannelMemberListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-channel-members) + * + */ + public fetchChannelMembers(requestParameters: ChannelApiFetchChannelMembersRequest, options?: RawAxiosRequestConfig) { + return ChannelApiFp(this.configuration).fetchChannelMembers(requestParameters.channel_id, requestParameters.fid, requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns a list of followers for a specific channel. Max limit is 1000. Use cursor for pagination. + * @summary For channel + * @param {ChannelApiFetchFollowersForAChannelRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ChannelApi + * @returns {Promise} A promise that resolves to a `UsersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-followers-for-a-channel) + * + */ + public fetchFollowersForAChannel(requestParameters: ChannelApiFetchFollowersForAChannelRequest, options?: RawAxiosRequestConfig) { + return ChannelApiFp(this.configuration).fetchFollowersForAChannel(requestParameters.id, requestParameters.viewer_fid, requestParameters.cursor, requestParameters.limit, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns a list of relevant channel followers for a specific FID. This usually shows on a channel as \"X, Y, Z follow this channel\". + * @summary Relevant followers + * @param {ChannelApiFetchRelevantFollowersForAChannelRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ChannelApi + * @returns {Promise} A promise that resolves to a `RelevantFollowersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-relevant-followers-for-a-channel) + * + */ + public fetchRelevantFollowersForAChannel(requestParameters: ChannelApiFetchRelevantFollowersForAChannelRequest, options?: RawAxiosRequestConfig) { + return ChannelApiFp(this.configuration).fetchRelevantFollowersForAChannel(requestParameters.id, requestParameters.viewer_fid, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns a list of trending channels based on activity + * @summary Channels by activity + * @param {ChannelApiFetchTrendingChannelsRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ChannelApi + * @returns {Promise} A promise that resolves to a `TrendingChannelResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-trending-channels) + * + */ + public fetchTrendingChannels(requestParameters: ChannelApiFetchTrendingChannelsRequest = {}, options?: RawAxiosRequestConfig) { + return ChannelApiFp(this.configuration).fetchTrendingChannels(requestParameters.time_window, requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns a list of all channels with their details that an FID is a member of. Data may have a delay of up to 1 hour. + * @summary Member of + * @param {ChannelApiFetchUserChannelMembershipsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ChannelApi + * @returns {Promise} A promise that resolves to a `ChannelMemberListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-channel-memberships) + * */ - public userChannelMemberships(fid: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig) { - return ChannelApiFp(this.configuration).userChannelMemberships(fid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); + public fetchUserChannelMemberships(requestParameters: ChannelApiFetchUserChannelMembershipsRequest, options?: RawAxiosRequestConfig) { + return ChannelApiFp(this.configuration).fetchUserChannelMemberships(requestParameters.fid, requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath)); } /** * Returns a list of all channels with their details that a FID follows. * @summary Following - * @param {number} fid The FID of the user. - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. + * @param {ChannelApiFetchUserChannelsRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ChannelApi + * @returns {Promise} A promise that resolves to a `ChannelListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-channels) + * + */ + public fetchUserChannels(requestParameters: ChannelApiFetchUserChannelsRequest, options?: RawAxiosRequestConfig) { + return ChannelApiFp(this.configuration).fetchUserChannels(requestParameters.fid, requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Fetches all channels that a user has casted in, in reverse chronological order. + * @summary Fetch channels that user is active in + * @param {ChannelApiFetchUsersActiveChannelsRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ChannelApi + * @returns {Promise} A promise that resolves to a `UsersActiveChannelsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-users-active-channels) + * + */ + public fetchUsersActiveChannels(requestParameters: ChannelApiFetchUsersActiveChannelsRequest, options?: RawAxiosRequestConfig) { + return ChannelApiFp(this.configuration).fetchUsersActiveChannels(requestParameters.fid, requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Follow a channel + * @summary Follow a channel + * @param {ChannelApiFollowChannelRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ChannelApi + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/follow-channel) + * + */ + public followChannel(requestParameters: ChannelApiFollowChannelRequest, options?: RawAxiosRequestConfig) { + return ChannelApiFp(this.configuration).followChannel(requestParameters.channel_follow_req_body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Invite a user to a channel + * @summary Invite + * @param {ChannelApiInviteChannelMemberRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ChannelApi + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/invite-channel-member) + * + */ + public inviteChannelMember(requestParameters: ChannelApiInviteChannelMemberRequest, options?: RawAxiosRequestConfig) { + return ChannelApiFp(this.configuration).inviteChannelMember(requestParameters.invite_channel_member_req_body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns details of a channel + * @summary By ID or parent_url + * @param {ChannelApiLookupChannelRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ChannelApi + * @returns {Promise} A promise that resolves to a `ChannelResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-channel) + * + */ + public lookupChannel(requestParameters: ChannelApiLookupChannelRequest, options?: RawAxiosRequestConfig) { + return ChannelApiFp(this.configuration).lookupChannel(requestParameters.id, requestParameters.type, requestParameters.viewer_fid, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Remove a user from a channel or a user\'s invite to a channel role + * @summary Remove user + * @param {ChannelApiRemoveChannelMemberRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ChannelApi + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/remove-channel-member) + * + */ + public removeChannelMember(requestParameters: ChannelApiRemoveChannelMemberRequest, options?: RawAxiosRequestConfig) { + return ChannelApiFp(this.configuration).removeChannelMember(requestParameters.remove_channel_member_req_body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Accept or reject a channel invite + * @summary Accept or reject an invite + * @param {ChannelApiRespondChannelInviteRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ChannelApi + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/respond-channel-invite) + * + */ + public respondChannelInvite(requestParameters: ChannelApiRespondChannelInviteRequest, options?: RawAxiosRequestConfig) { + return ChannelApiFp(this.configuration).respondChannelInvite(requestParameters.respond_channel_invite_req_body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns a list of channels based on ID or name + * @summary Search by ID or name + * @param {ChannelApiSearchChannelsRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ChannelApi + * @returns {Promise} A promise that resolves to a `ChannelSearchResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/search-channels) + * + */ + public searchChannels(requestParameters: ChannelApiSearchChannelsRequest, options?: RawAxiosRequestConfig) { + return ChannelApiFp(this.configuration).searchChannels(requestParameters.q, requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Unfollow a channel + * @summary Unfollow a channel + * @param {ChannelApiUnfollowChannelRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ChannelApi + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/unfollow-channel) + * */ - public userChannels(fid: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig) { - return ChannelApiFp(this.configuration).userChannels(fid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); + public unfollowChannel(requestParameters: ChannelApiUnfollowChannelRequest, options?: RawAxiosRequestConfig) { + return ChannelApiFp(this.configuration).unfollowChannel(requestParameters.channel_follow_req_body, options).then((request) => request(this.axios, this.basePath)); } } /** * @export */ -export const TrendingChannelsTimeWindowEnum = { +export const FetchTrendingChannelsTimeWindowEnum = { _1d: '1d', _7d: '7d', _30d: '30d' } as const; -export type TrendingChannelsTimeWindowEnum = typeof TrendingChannelsTimeWindowEnum[keyof typeof TrendingChannelsTimeWindowEnum]; +export type FetchTrendingChannelsTimeWindowEnum = typeof FetchTrendingChannelsTimeWindowEnum[keyof typeof FetchTrendingChannelsTimeWindowEnum]; diff --git a/src/neynar-api/v2/openapi-farcaster/apis/feed-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/feed-api.ts index 70149856..a887eff1 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/feed-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/feed-api.ts @@ -28,14 +28,14 @@ import type { EmbedType } from '../models'; // @ts-ignore import type { ErrorRes } from '../models'; // @ts-ignore -import type { FeedForYou400Response } from '../models'; -// @ts-ignore import type { FeedResponse } from '../models'; // @ts-ignore import type { FeedTrendingProvider } from '../models'; // @ts-ignore import type { FeedType } from '../models'; // @ts-ignore +import type { FetchFeedForYou400Response } from '../models'; +// @ts-ignore import type { FilterType } from '../models'; // @ts-ignore import type { ForYouProvider } from '../models'; @@ -45,28 +45,106 @@ import type { ForYouProvider } from '../models'; */ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) { return { + /** + * Fetch casts for a given user FID in reverse chronological order. Also allows filtering by parent_url and channel + * @summary Chronologically + * @param {number} fid FID of user whose recent casts you want to fetch + * @param {number} [viewer_fid] FID of the user viewing the feed + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 150) + * @param {string} [cursor] Pagination cursor + * @param {boolean} [include_replies] Include reply casts by the author in the response, true by default + * @param {string} [parent_url] Parent URL to filter the feed; mutually exclusive with channel_id + * @param {string} [channel_id] Channel ID to filter the feed; mutually exclusive with parent_url + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-casts-for-user) + * + */ + fetchCastsForUser: async (fid: number, viewer_fid?: number, limit?: number, cursor?: string, include_replies?: boolean, parent_url?: string, channel_id?: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'fid' is not null or undefined + assertParamExists('fetchCastsForUser', 'fid', fid) + const localVarPath = `/farcaster/feed/user/casts`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyAuth required + await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) + + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } + + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + if (include_replies !== undefined) { + localVarQueryParameter['include_replies'] = include_replies; + } + + if (parent_url !== undefined) { + localVarQueryParameter['parent_url'] = parent_url; + } + + if (channel_id !== undefined) { + localVarQueryParameter['channel_id'] = channel_id; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * Fetch casts based on filters. Ensure setting the correct parameters based on the feed_type and filter_type. * @summary By filters - * @param {FeedType} feedType Defaults to following (requires FID or address). If set to filter (requires filter_type) - * @param {FilterType} [filterType] Used when feed_type=filter. Can be set to FIDs (requires FIDs) or parent_url (requires parent_url) or channel_id (requires channel_id) - * @param {number} [fid] (Optional) FID of user whose feed you want to create. By default, the API expects this field, except if you pass a filter_type - * @param {string} [fids] Used when filter_type=FIDs . Create a feed based on a list of FIDs. Max array size is 250. Requires feed_type and filter_type. - * @param {string} [parentUrl] Used when filter_type=parent_url can be used to fetch content under any parent url e.g. FIP-2 channels on Warpcast. Requires feed_type and filter_type - * @param {string} [channelId] Used when filter_type=channel_id can be used to fetch casts under a channel. Requires feed_type and filter_type. - * @param {boolean} [membersOnly] Used when filter_type=channel_id. Only include casts from members of the channel. True by default. - * @param {string} [embedUrl] Used when filter_type=embed_url can be used to fetch all casts with an embed url that contains embed_url. Requires feed_type and filter_type - * @param {Array} [embedTypes] Used when filter_type=embed_types can be used to fetch all casts with matching content types. Requires feed_type and filter_type - * @param {boolean} [withRecasts] Include recasts in the response, true by default - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {FeedType} feed_type Defaults to following (requires FID or address). If set to filter (requires filter_type) + * @param {FilterType} [filter_type] Used when feed_type=filter. Can be set to FIDs (requires FIDs) or parent_url (requires parent_url) or channel_id (requires channel_id) + * @param {number} [fid] (Optional) FID of user whose feed you want to create. By default, the API expects this field, except if you pass a filter_type + * @param {string} [fids] Used when filter_type=FIDs . Create a feed based on a list of FIDs. Max array size is 250. Requires feed_type and filter_type. + * @param {string} [parent_url] Used when filter_type=parent_url can be used to fetch content under any parent url e.g. FIP-2 channels on Warpcast. Requires feed_type and filter_type + * @param {string} [channel_id] Used when filter_type=channel_id can be used to fetch casts under a channel. Requires feed_type and filter_type. + * @param {boolean} [members_only] Used when filter_type=channel_id. Only include casts from members of the channel. True by default. + * @param {string} [embed_url] Used when filter_type=embed_url can be used to fetch all casts with an embed url that contains embed_url. Requires feed_type and filter_type + * @param {Array} [embed_types] Used when filter_type=embed_types can be used to fetch all casts with matching content types. Requires feed_type and filter_type + * @param {boolean} [with_recasts] Include recasts in the response, true by default + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100) + * @param {string} [cursor] Pagination cursor. + * @param {number} [viewer_fid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-feed) + * */ - feed: async (feedType: FeedType, filterType?: FilterType, fid?: number, fids?: string, parentUrl?: string, channelId?: string, membersOnly?: boolean, embedUrl?: string, embedTypes?: Array, withRecasts?: boolean, limit?: number, cursor?: string, viewerFid?: number, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'feedType' is not null or undefined - assertParamExists('feed', 'feedType', feedType) + fetchFeed: async (feed_type: FeedType, filter_type?: FilterType, fid?: number, fids?: string, parent_url?: string, channel_id?: string, members_only?: boolean, embed_url?: string, embed_types?: Array, with_recasts?: boolean, limit?: number, cursor?: string, viewer_fid?: number, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'feed_type' is not null or undefined + assertParamExists('fetchFeed', 'feed_type', feed_type) const localVarPath = `/farcaster/feed`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -82,12 +160,12 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (feedType !== undefined) { - localVarQueryParameter['feed_type'] = feedType; + if (feed_type !== undefined) { + localVarQueryParameter['feed_type'] = feed_type; } - if (filterType !== undefined) { - localVarQueryParameter['filter_type'] = filterType; + if (filter_type !== undefined) { + localVarQueryParameter['filter_type'] = filter_type; } if (fid !== undefined) { @@ -98,28 +176,28 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) localVarQueryParameter['fids'] = fids; } - if (parentUrl !== undefined) { - localVarQueryParameter['parent_url'] = parentUrl; + if (parent_url !== undefined) { + localVarQueryParameter['parent_url'] = parent_url; } - if (channelId !== undefined) { - localVarQueryParameter['channel_id'] = channelId; + if (channel_id !== undefined) { + localVarQueryParameter['channel_id'] = channel_id; } - if (membersOnly !== undefined) { - localVarQueryParameter['members_only'] = membersOnly; + if (members_only !== undefined) { + localVarQueryParameter['members_only'] = members_only; } - if (embedUrl !== undefined) { - localVarQueryParameter['embed_url'] = embedUrl; + if (embed_url !== undefined) { + localVarQueryParameter['embed_url'] = embed_url; } - if (embedTypes) { - localVarQueryParameter['embed_types'] = embedTypes.join(COLLECTION_FORMATS.csv); + if (embed_types) { + localVarQueryParameter['embed_types'] = embed_types.join(COLLECTION_FORMATS.csv); } - if (withRecasts !== undefined) { - localVarQueryParameter['with_recasts'] = withRecasts; + if (with_recasts !== undefined) { + localVarQueryParameter['with_recasts'] = with_recasts; } if (limit !== undefined) { @@ -130,8 +208,8 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) localVarQueryParameter['cursor'] = cursor; } - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; } @@ -148,20 +226,24 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) /** * Fetch feed based on channel IDs * @summary By channel IDs - * @param {string} channelIds Comma separated list of channel IDs e.g. neynar,farcaster - * @param {boolean} [withRecasts] Include recasts in the response, true by default - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {boolean} [withReplies] Include replies in the response, false by default - * @param {boolean} [membersOnly] Only include casts from members of the channel. True by default. - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. - * @param {boolean} [shouldModerate] If true, only casts that have been liked by the moderator (if one exists) will be returned. + * @param {string} channel_ids Comma separated list of channel IDs e.g. neynar,farcaster + * @param {boolean} [with_recasts] Include recasts in the response, true by default + * @param {number} [viewer_fid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {boolean} [with_replies] Include replies in the response, false by default + * @param {boolean} [members_only] Only include casts from members of the channel. True by default. + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100) + * @param {string} [cursor] Pagination cursor. + * @param {boolean} [should_moderate] If true, only casts that have been liked by the moderator (if one exists) will be returned. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-feed-by-channel-ids) + * */ - feedChannels: async (channelIds: string, withRecasts?: boolean, viewerFid?: number, withReplies?: boolean, membersOnly?: boolean, limit?: number, cursor?: string, shouldModerate?: boolean, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'channelIds' is not null or undefined - assertParamExists('feedChannels', 'channelIds', channelIds) + fetchFeedByChannelIds: async (channel_ids: string, with_recasts?: boolean, viewer_fid?: number, with_replies?: boolean, members_only?: boolean, limit?: number, cursor?: string, should_moderate?: boolean, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'channel_ids' is not null or undefined + assertParamExists('fetchFeedByChannelIds', 'channel_ids', channel_ids) const localVarPath = `/farcaster/feed/channels`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -177,24 +259,24 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (channelIds !== undefined) { - localVarQueryParameter['channel_ids'] = channelIds; + if (channel_ids !== undefined) { + localVarQueryParameter['channel_ids'] = channel_ids; } - if (withRecasts !== undefined) { - localVarQueryParameter['with_recasts'] = withRecasts; + if (with_recasts !== undefined) { + localVarQueryParameter['with_recasts'] = with_recasts; } - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; } - if (withReplies !== undefined) { - localVarQueryParameter['with_replies'] = withReplies; + if (with_replies !== undefined) { + localVarQueryParameter['with_replies'] = with_replies; } - if (membersOnly !== undefined) { - localVarQueryParameter['members_only'] = membersOnly; + if (members_only !== undefined) { + localVarQueryParameter['members_only'] = members_only; } if (limit !== undefined) { @@ -205,8 +287,8 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) localVarQueryParameter['cursor'] = cursor; } - if (shouldModerate !== undefined) { - localVarQueryParameter['should_moderate'] = shouldModerate; + if (should_moderate !== undefined) { + localVarQueryParameter['should_moderate'] = should_moderate; } @@ -221,20 +303,25 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Fetch feed based on who a user is following - * @summary Following - * @param {number} fid FID of user whose feed you want to create - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {boolean} [withRecasts] Include recasts in the response, true by default - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. + * Fetch feed based on parent URLs + * @summary By parent URLs + * @param {string} parent_urls Comma separated list of parent_urls + * @param {boolean} [with_recasts] Include recasts in the response, true by default + * @param {number} [viewer_fid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {boolean} [with_replies] Include replies in the response, false by default + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-feed-by-parent-urls) + * */ - feedFollowing: async (fid: number, viewerFid?: number, withRecasts?: boolean, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'fid' is not null or undefined - assertParamExists('feedFollowing', 'fid', fid) - const localVarPath = `/farcaster/feed/following`; + fetchFeedByParentUrls: async (parent_urls: string, with_recasts?: boolean, viewer_fid?: number, with_replies?: boolean, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'parent_urls' is not null or undefined + assertParamExists('fetchFeedByParentUrls', 'parent_urls', parent_urls) + const localVarPath = `/farcaster/feed/parent_urls`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -249,16 +336,20 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (fid !== undefined) { - localVarQueryParameter['fid'] = fid; + if (parent_urls !== undefined) { + localVarQueryParameter['parent_urls'] = parent_urls; } - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; + if (with_recasts !== undefined) { + localVarQueryParameter['with_recasts'] = with_recasts; } - if (withRecasts !== undefined) { - localVarQueryParameter['with_recasts'] = withRecasts; + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; + } + + if (with_replies !== undefined) { + localVarQueryParameter['with_replies'] = with_replies; } if (limit !== undefined) { @@ -283,18 +374,22 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) /** * Fetch a personalized For You feed for a user * @summary For you - * @param {number} fid FID of user whose feed you want to create - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {ForYouProvider} [provider] - * @param {number} [limit] Number of results to fetch (default 25, max 50) - * @param {string} [cursor] Pagination cursor. - * @param {string} [providerMetadata] provider_metadata is a URI-encoded stringified JSON object that can be used to pass additional metadata to the provider. Only available for mbd provider right now. See [here](https://docs.neynar.com/docs/feed-for-you-w-external-providers) on how to use. + * @param {number} fid FID of user whose feed you want to create + * @param {number} [viewer_fid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {ForYouProvider} [provider] + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 50) + * @param {string} [cursor] Pagination cursor. + * @param {string} [provider_metadata] provider_metadata is a URI-encoded stringified JSON object that can be used to pass additional metadata to the provider. Only available for mbd provider right now. See [here](https://docs.neynar.com/docs/feed-for-you-w-external-providers) on how to use. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-feed-for-you) + * */ - feedForYou: async (fid: number, viewerFid?: number, provider?: ForYouProvider, limit?: number, cursor?: string, providerMetadata?: string, options: RawAxiosRequestConfig = {}): Promise => { + fetchFeedForYou: async (fid: number, viewer_fid?: number, provider?: ForYouProvider, limit?: number, cursor?: string, provider_metadata?: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'fid' is not null or undefined - assertParamExists('feedForYou', 'fid', fid) + assertParamExists('fetchFeedForYou', 'fid', fid) const localVarPath = `/farcaster/feed/for_you`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -314,8 +409,8 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) localVarQueryParameter['fid'] = fid; } - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; } if (provider !== undefined) { @@ -330,8 +425,8 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) localVarQueryParameter['cursor'] = cursor; } - if (providerMetadata !== undefined) { - localVarQueryParameter['provider_metadata'] = providerMetadata; + if (provider_metadata !== undefined) { + localVarQueryParameter['provider_metadata'] = provider_metadata; } @@ -348,13 +443,17 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) /** * Fetch feed of casts with Frames, reverse chronological order * @summary Casts with Frames - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100) + * @param {number} [viewer_fid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-frames-only-feed) + * */ - feedFrames: async (limit?: number, viewerFid?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { + fetchFramesOnlyFeed: async (limit?: number, viewer_fid?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/farcaster/feed/frames`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -374,8 +473,8 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) localVarQueryParameter['limit'] = limit; } - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; } if (cursor !== undefined) { @@ -394,21 +493,21 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Fetch feed based on parent URLs - * @summary By parent URLs - * @param {string} parentUrls Comma separated list of parent_urls - * @param {boolean} [withRecasts] Include recasts in the response, true by default - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {boolean} [withReplies] Include replies in the response, false by default - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. + * Fetch 10 most popular casts for a given user FID; popularity based on replies, likes and recasts; sorted by most popular first + * @summary 10 most popular casts + * @param {number} fid FID of user whose feed you want to create + * @param {number} [viewer_fid] * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `BulkCastsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-popular-casts-by-user) + * */ - feedParentUrls: async (parentUrls: string, withRecasts?: boolean, viewerFid?: number, withReplies?: boolean, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'parentUrls' is not null or undefined - assertParamExists('feedParentUrls', 'parentUrls', parentUrls) - const localVarPath = `/farcaster/feed/parent_urls`; + fetchPopularCastsByUser: async (fid: number, viewer_fid?: number, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'fid' is not null or undefined + assertParamExists('fetchPopularCastsByUser', 'fid', fid) + const localVarPath = `/farcaster/feed/user/popular`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -423,28 +522,12 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (parentUrls !== undefined) { - localVarQueryParameter['parent_urls'] = parentUrls; - } - - if (withRecasts !== undefined) { - localVarQueryParameter['with_recasts'] = withRecasts; - } - - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; - } - - if (withReplies !== undefined) { - localVarQueryParameter['with_replies'] = withReplies; - } - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; } - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; } @@ -459,20 +542,24 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Fetch trending casts or on the global feed or channels feeds. 7d time window available for channel feeds only. - * @summary Trending casts - * @param {number} [limit] Number of results to fetch (max 10) - * @param {string} [cursor] Pagination cursor - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {FeedTrendingTimeWindowEnum} [timeWindow] Time window for trending casts (7d window for channel feeds only) - * @param {string} [channelId] Channel ID to filter trending casts. Less active channels might have no casts in the time window selected. - * @param {FeedTrendingProvider} [provider] The provider of the trending casts feed. - * @param {string} [providerMetadata] provider_metadata is a URI-encoded stringified JSON object that can be used to pass additional metadata to the provider. Only available for mbd provider right now. See [here](https://docs.neynar.com/docs/feed-for-you-w-external-providers) on how to use. + * Fetch recent replies and recasts for a given user FID; sorted by most recent first + * @summary Replies and recasts + * @param {number} fid FID of user whose replies and recasts you want to fetch + * @param {FetchRepliesAndRecastsForUserFilterEnum} [filter] filter to fetch only replies or recasts + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 50) + * @param {string} [cursor] Pagination cursor. + * @param {number} [viewer_fid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-replies-and-recasts-for-user) + * */ - feedTrending: async (limit?: number, cursor?: string, viewerFid?: number, timeWindow?: FeedTrendingTimeWindowEnum, channelId?: string, provider?: FeedTrendingProvider, providerMetadata?: string, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/farcaster/feed/trending`; + fetchRepliesAndRecastsForUser: async (fid: number, filter?: FetchRepliesAndRecastsForUserFilterEnum, limit?: number, cursor?: string, viewer_fid?: number, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'fid' is not null or undefined + assertParamExists('fetchRepliesAndRecastsForUser', 'fid', fid) + const localVarPath = `/farcaster/feed/user/replies_and_recasts`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -487,32 +574,24 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; - } - - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; } - if (timeWindow !== undefined) { - localVarQueryParameter['time_window'] = timeWindow; + if (filter !== undefined) { + localVarQueryParameter['filter'] = filter; } - if (channelId !== undefined) { - localVarQueryParameter['channel_id'] = channelId; + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; } - if (provider !== undefined) { - localVarQueryParameter['provider'] = provider; + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; } - if (providerMetadata !== undefined) { - localVarQueryParameter['provider_metadata'] = providerMetadata; + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; } @@ -527,22 +606,24 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Fetch casts for a given user FID in reverse chronological order. Also allows filtering by parent_url and channel - * @summary Chronologically - * @param {number} fid FID of user whose recent casts you want to fetch - * @param {number} [viewerFid] FID of the user viewing the feed - * @param {number} [limit] Number of results to fetch - * @param {string} [cursor] Pagination cursor - * @param {boolean} [includeReplies] Include reply casts by the author in the response, true by default - * @param {string} [parentUrl] Parent URL to filter the feed; mutually exclusive with channel_id - * @param {string} [channelId] Channel ID to filter the feed; mutually exclusive with parent_url + * Fetch trending casts or on the global feed or channels feeds. 7d time window available for channel feeds only. + * @summary Trending casts + * @param {number} [limit] Number of results to fetch (Default: 10, Maximum: 10) + * @param {string} [cursor] Pagination cursor + * @param {number} [viewer_fid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {FetchTrendingFeedTimeWindowEnum} [time_window] Time window for trending casts (7d window for channel feeds only) + * @param {string} [channel_id] Channel ID to filter trending casts. Less active channels might have no casts in the time window selected. + * @param {FeedTrendingProvider} [provider] The provider of the trending casts feed. + * @param {string} [provider_metadata] provider_metadata is a URI-encoded stringified JSON object that can be used to pass additional metadata to the provider. Only available for mbd provider right now. See [here](https://docs.neynar.com/docs/feed-for-you-w-external-providers) on how to use. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-trending-feed) + * */ - feedUserCasts: async (fid: number, viewerFid?: number, limit?: number, cursor?: string, includeReplies?: boolean, parentUrl?: string, channelId?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'fid' is not null or undefined - assertParamExists('feedUserCasts', 'fid', fid) - const localVarPath = `/farcaster/feed/user/casts`; + fetchTrendingFeed: async (limit?: number, cursor?: string, viewer_fid?: number, time_window?: FetchTrendingFeedTimeWindowEnum, channel_id?: string, provider?: FeedTrendingProvider, provider_metadata?: string, options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/farcaster/feed/trending`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -557,14 +638,6 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (fid !== undefined) { - localVarQueryParameter['fid'] = fid; - } - - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; - } - if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } @@ -573,61 +646,24 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) localVarQueryParameter['cursor'] = cursor; } - if (includeReplies !== undefined) { - localVarQueryParameter['include_replies'] = includeReplies; - } - - if (parentUrl !== undefined) { - localVarQueryParameter['parent_url'] = parentUrl; + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; } - if (channelId !== undefined) { - localVarQueryParameter['channel_id'] = channelId; + if (time_window !== undefined) { + localVarQueryParameter['time_window'] = time_window; } - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Fetch 10 most popular casts for a given user FID; popularity based on replies, likes and recasts; sorted by most popular first - * @summary 10 most popular casts - * @param {number} fid FID of user whose feed you want to create - * @param {number} [viewerFid] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - feedUserPopular: async (fid: number, viewerFid?: number, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'fid' is not null or undefined - assertParamExists('feedUserPopular', 'fid', fid) - const localVarPath = `/farcaster/feed/user/popular`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; + if (channel_id !== undefined) { + localVarQueryParameter['channel_id'] = channel_id; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication ApiKeyAuth required - await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - - if (fid !== undefined) { - localVarQueryParameter['fid'] = fid; + if (provider !== undefined) { + localVarQueryParameter['provider'] = provider; } - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; + if (provider_metadata !== undefined) { + localVarQueryParameter['provider_metadata'] = provider_metadata; } @@ -642,20 +678,24 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Fetch recent replies and recasts for a given user FID; sorted by most recent first - * @summary Replies and recasts - * @param {number} fid FID of user whose replies and recasts you want to fetch - * @param {FeedUserRepliesRecastsFilterEnum} [filter] filter to fetch only replies or recasts - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. + * Fetch feed based on who a user is following + * @summary Following + * @param {number} fid FID of user whose feed you want to create + * @param {number} [viewer_fid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {boolean} [with_recasts] Include recasts in the response, true by default + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-following-feed) + * */ - feedUserRepliesRecasts: async (fid: number, filter?: FeedUserRepliesRecastsFilterEnum, limit?: number, cursor?: string, viewerFid?: number, options: RawAxiosRequestConfig = {}): Promise => { + fetchUserFollowingFeed: async (fid: number, viewer_fid?: number, with_recasts?: boolean, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'fid' is not null or undefined - assertParamExists('feedUserRepliesRecasts', 'fid', fid) - const localVarPath = `/farcaster/feed/user/replies_and_recasts`; + assertParamExists('fetchUserFollowingFeed', 'fid', fid) + const localVarPath = `/farcaster/feed/following`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -674,8 +714,12 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) localVarQueryParameter['fid'] = fid; } - if (filter !== undefined) { - localVarQueryParameter['filter'] = filter; + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; + } + + if (with_recasts !== undefined) { + localVarQueryParameter['with_recasts'] = with_recasts; } if (limit !== undefined) { @@ -686,10 +730,6 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) localVarQueryParameter['cursor'] = cursor; } - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; - } - setSearchParams(localVarUrlObj, localVarQueryParameter); @@ -711,186 +751,226 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) export const FeedApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = FeedApiAxiosParamCreator(configuration) return { + /** + * Fetch casts for a given user FID in reverse chronological order. Also allows filtering by parent_url and channel + * @summary Chronologically + * @param {number} fid FID of user whose recent casts you want to fetch + * @param {number} [viewer_fid] FID of the user viewing the feed + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 150) + * @param {string} [cursor] Pagination cursor + * @param {boolean} [include_replies] Include reply casts by the author in the response, true by default + * @param {string} [parent_url] Parent URL to filter the feed; mutually exclusive with channel_id + * @param {string} [channel_id] Channel ID to filter the feed; mutually exclusive with parent_url + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-casts-for-user) + * + */ + async fetchCastsForUser(fid: number, viewer_fid?: number, limit?: number, cursor?: string, include_replies?: boolean, parent_url?: string, channel_id?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchCastsForUser(fid, viewer_fid, limit, cursor, include_replies, parent_url, channel_id, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['FeedApi.fetchCastsForUser']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, /** * Fetch casts based on filters. Ensure setting the correct parameters based on the feed_type and filter_type. * @summary By filters - * @param {FeedType} feedType Defaults to following (requires FID or address). If set to filter (requires filter_type) - * @param {FilterType} [filterType] Used when feed_type=filter. Can be set to FIDs (requires FIDs) or parent_url (requires parent_url) or channel_id (requires channel_id) - * @param {number} [fid] (Optional) FID of user whose feed you want to create. By default, the API expects this field, except if you pass a filter_type - * @param {string} [fids] Used when filter_type=FIDs . Create a feed based on a list of FIDs. Max array size is 250. Requires feed_type and filter_type. - * @param {string} [parentUrl] Used when filter_type=parent_url can be used to fetch content under any parent url e.g. FIP-2 channels on Warpcast. Requires feed_type and filter_type - * @param {string} [channelId] Used when filter_type=channel_id can be used to fetch casts under a channel. Requires feed_type and filter_type. - * @param {boolean} [membersOnly] Used when filter_type=channel_id. Only include casts from members of the channel. True by default. - * @param {string} [embedUrl] Used when filter_type=embed_url can be used to fetch all casts with an embed url that contains embed_url. Requires feed_type and filter_type - * @param {Array} [embedTypes] Used when filter_type=embed_types can be used to fetch all casts with matching content types. Requires feed_type and filter_type - * @param {boolean} [withRecasts] Include recasts in the response, true by default - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {FeedType} feed_type Defaults to following (requires FID or address). If set to filter (requires filter_type) + * @param {FilterType} [filter_type] Used when feed_type=filter. Can be set to FIDs (requires FIDs) or parent_url (requires parent_url) or channel_id (requires channel_id) + * @param {number} [fid] (Optional) FID of user whose feed you want to create. By default, the API expects this field, except if you pass a filter_type + * @param {string} [fids] Used when filter_type=FIDs . Create a feed based on a list of FIDs. Max array size is 250. Requires feed_type and filter_type. + * @param {string} [parent_url] Used when filter_type=parent_url can be used to fetch content under any parent url e.g. FIP-2 channels on Warpcast. Requires feed_type and filter_type + * @param {string} [channel_id] Used when filter_type=channel_id can be used to fetch casts under a channel. Requires feed_type and filter_type. + * @param {boolean} [members_only] Used when filter_type=channel_id. Only include casts from members of the channel. True by default. + * @param {string} [embed_url] Used when filter_type=embed_url can be used to fetch all casts with an embed url that contains embed_url. Requires feed_type and filter_type + * @param {Array} [embed_types] Used when filter_type=embed_types can be used to fetch all casts with matching content types. Requires feed_type and filter_type + * @param {boolean} [with_recasts] Include recasts in the response, true by default + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100) + * @param {string} [cursor] Pagination cursor. + * @param {number} [viewer_fid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-feed) + * */ - async feed(feedType: FeedType, filterType?: FilterType, fid?: number, fids?: string, parentUrl?: string, channelId?: string, membersOnly?: boolean, embedUrl?: string, embedTypes?: Array, withRecasts?: boolean, limit?: number, cursor?: string, viewerFid?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.feed(feedType, filterType, fid, fids, parentUrl, channelId, membersOnly, embedUrl, embedTypes, withRecasts, limit, cursor, viewerFid, options); + async fetchFeed(feed_type: FeedType, filter_type?: FilterType, fid?: number, fids?: string, parent_url?: string, channel_id?: string, members_only?: boolean, embed_url?: string, embed_types?: Array, with_recasts?: boolean, limit?: number, cursor?: string, viewer_fid?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchFeed(feed_type, filter_type, fid, fids, parent_url, channel_id, members_only, embed_url, embed_types, with_recasts, limit, cursor, viewer_fid, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['FeedApi.feed']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['FeedApi.fetchFeed']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Fetch feed based on channel IDs * @summary By channel IDs - * @param {string} channelIds Comma separated list of channel IDs e.g. neynar,farcaster - * @param {boolean} [withRecasts] Include recasts in the response, true by default - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {boolean} [withReplies] Include replies in the response, false by default - * @param {boolean} [membersOnly] Only include casts from members of the channel. True by default. - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. - * @param {boolean} [shouldModerate] If true, only casts that have been liked by the moderator (if one exists) will be returned. + * @param {string} channel_ids Comma separated list of channel IDs e.g. neynar,farcaster + * @param {boolean} [with_recasts] Include recasts in the response, true by default + * @param {number} [viewer_fid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {boolean} [with_replies] Include replies in the response, false by default + * @param {boolean} [members_only] Only include casts from members of the channel. True by default. + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100) + * @param {string} [cursor] Pagination cursor. + * @param {boolean} [should_moderate] If true, only casts that have been liked by the moderator (if one exists) will be returned. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-feed-by-channel-ids) + * */ - async feedChannels(channelIds: string, withRecasts?: boolean, viewerFid?: number, withReplies?: boolean, membersOnly?: boolean, limit?: number, cursor?: string, shouldModerate?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.feedChannels(channelIds, withRecasts, viewerFid, withReplies, membersOnly, limit, cursor, shouldModerate, options); + async fetchFeedByChannelIds(channel_ids: string, with_recasts?: boolean, viewer_fid?: number, with_replies?: boolean, members_only?: boolean, limit?: number, cursor?: string, should_moderate?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchFeedByChannelIds(channel_ids, with_recasts, viewer_fid, with_replies, members_only, limit, cursor, should_moderate, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['FeedApi.feedChannels']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['FeedApi.fetchFeedByChannelIds']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Fetch feed based on who a user is following - * @summary Following - * @param {number} fid FID of user whose feed you want to create - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {boolean} [withRecasts] Include recasts in the response, true by default - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. + * Fetch feed based on parent URLs + * @summary By parent URLs + * @param {string} parent_urls Comma separated list of parent_urls + * @param {boolean} [with_recasts] Include recasts in the response, true by default + * @param {number} [viewer_fid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {boolean} [with_replies] Include replies in the response, false by default + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-feed-by-parent-urls) + * */ - async feedFollowing(fid: number, viewerFid?: number, withRecasts?: boolean, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.feedFollowing(fid, viewerFid, withRecasts, limit, cursor, options); + async fetchFeedByParentUrls(parent_urls: string, with_recasts?: boolean, viewer_fid?: number, with_replies?: boolean, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchFeedByParentUrls(parent_urls, with_recasts, viewer_fid, with_replies, limit, cursor, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['FeedApi.feedFollowing']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['FeedApi.fetchFeedByParentUrls']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Fetch a personalized For You feed for a user * @summary For you - * @param {number} fid FID of user whose feed you want to create - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {ForYouProvider} [provider] - * @param {number} [limit] Number of results to fetch (default 25, max 50) - * @param {string} [cursor] Pagination cursor. - * @param {string} [providerMetadata] provider_metadata is a URI-encoded stringified JSON object that can be used to pass additional metadata to the provider. Only available for mbd provider right now. See [here](https://docs.neynar.com/docs/feed-for-you-w-external-providers) on how to use. + * @param {number} fid FID of user whose feed you want to create + * @param {number} [viewer_fid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {ForYouProvider} [provider] + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 50) + * @param {string} [cursor] Pagination cursor. + * @param {string} [provider_metadata] provider_metadata is a URI-encoded stringified JSON object that can be used to pass additional metadata to the provider. Only available for mbd provider right now. See [here](https://docs.neynar.com/docs/feed-for-you-w-external-providers) on how to use. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-feed-for-you) + * */ - async feedForYou(fid: number, viewerFid?: number, provider?: ForYouProvider, limit?: number, cursor?: string, providerMetadata?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.feedForYou(fid, viewerFid, provider, limit, cursor, providerMetadata, options); + async fetchFeedForYou(fid: number, viewer_fid?: number, provider?: ForYouProvider, limit?: number, cursor?: string, provider_metadata?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchFeedForYou(fid, viewer_fid, provider, limit, cursor, provider_metadata, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['FeedApi.feedForYou']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['FeedApi.fetchFeedForYou']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Fetch feed of casts with Frames, reverse chronological order * @summary Casts with Frames - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {string} [cursor] Pagination cursor. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async feedFrames(limit?: number, viewerFid?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.feedFrames(limit, viewerFid, cursor, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['FeedApi.feedFrames']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Fetch feed based on parent URLs - * @summary By parent URLs - * @param {string} parentUrls Comma separated list of parent_urls - * @param {boolean} [withRecasts] Include recasts in the response, true by default - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {boolean} [withReplies] Include replies in the response, false by default - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100) + * @param {number} [viewer_fid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-frames-only-feed) + * */ - async feedParentUrls(parentUrls: string, withRecasts?: boolean, viewerFid?: number, withReplies?: boolean, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.feedParentUrls(parentUrls, withRecasts, viewerFid, withReplies, limit, cursor, options); + async fetchFramesOnlyFeed(limit?: number, viewer_fid?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchFramesOnlyFeed(limit, viewer_fid, cursor, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['FeedApi.feedParentUrls']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['FeedApi.fetchFramesOnlyFeed']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Fetch trending casts or on the global feed or channels feeds. 7d time window available for channel feeds only. - * @summary Trending casts - * @param {number} [limit] Number of results to fetch (max 10) - * @param {string} [cursor] Pagination cursor - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {FeedTrendingTimeWindowEnum} [timeWindow] Time window for trending casts (7d window for channel feeds only) - * @param {string} [channelId] Channel ID to filter trending casts. Less active channels might have no casts in the time window selected. - * @param {FeedTrendingProvider} [provider] The provider of the trending casts feed. - * @param {string} [providerMetadata] provider_metadata is a URI-encoded stringified JSON object that can be used to pass additional metadata to the provider. Only available for mbd provider right now. See [here](https://docs.neynar.com/docs/feed-for-you-w-external-providers) on how to use. + * Fetch 10 most popular casts for a given user FID; popularity based on replies, likes and recasts; sorted by most popular first + * @summary 10 most popular casts + * @param {number} fid FID of user whose feed you want to create + * @param {number} [viewer_fid] * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `BulkCastsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-popular-casts-by-user) + * */ - async feedTrending(limit?: number, cursor?: string, viewerFid?: number, timeWindow?: FeedTrendingTimeWindowEnum, channelId?: string, provider?: FeedTrendingProvider, providerMetadata?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.feedTrending(limit, cursor, viewerFid, timeWindow, channelId, provider, providerMetadata, options); + async fetchPopularCastsByUser(fid: number, viewer_fid?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchPopularCastsByUser(fid, viewer_fid, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['FeedApi.feedTrending']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['FeedApi.fetchPopularCastsByUser']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Fetch casts for a given user FID in reverse chronological order. Also allows filtering by parent_url and channel - * @summary Chronologically - * @param {number} fid FID of user whose recent casts you want to fetch - * @param {number} [viewerFid] FID of the user viewing the feed - * @param {number} [limit] Number of results to fetch - * @param {string} [cursor] Pagination cursor - * @param {boolean} [includeReplies] Include reply casts by the author in the response, true by default - * @param {string} [parentUrl] Parent URL to filter the feed; mutually exclusive with channel_id - * @param {string} [channelId] Channel ID to filter the feed; mutually exclusive with parent_url + * Fetch recent replies and recasts for a given user FID; sorted by most recent first + * @summary Replies and recasts + * @param {number} fid FID of user whose replies and recasts you want to fetch + * @param {FetchRepliesAndRecastsForUserFilterEnum} [filter] filter to fetch only replies or recasts + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 50) + * @param {string} [cursor] Pagination cursor. + * @param {number} [viewer_fid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-replies-and-recasts-for-user) + * */ - async feedUserCasts(fid: number, viewerFid?: number, limit?: number, cursor?: string, includeReplies?: boolean, parentUrl?: string, channelId?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.feedUserCasts(fid, viewerFid, limit, cursor, includeReplies, parentUrl, channelId, options); + async fetchRepliesAndRecastsForUser(fid: number, filter?: FetchRepliesAndRecastsForUserFilterEnum, limit?: number, cursor?: string, viewer_fid?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchRepliesAndRecastsForUser(fid, filter, limit, cursor, viewer_fid, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['FeedApi.feedUserCasts']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['FeedApi.fetchRepliesAndRecastsForUser']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Fetch 10 most popular casts for a given user FID; popularity based on replies, likes and recasts; sorted by most popular first - * @summary 10 most popular casts - * @param {number} fid FID of user whose feed you want to create - * @param {number} [viewerFid] + * Fetch trending casts or on the global feed or channels feeds. 7d time window available for channel feeds only. + * @summary Trending casts + * @param {number} [limit] Number of results to fetch (Default: 10, Maximum: 10) + * @param {string} [cursor] Pagination cursor + * @param {number} [viewer_fid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {FetchTrendingFeedTimeWindowEnum} [time_window] Time window for trending casts (7d window for channel feeds only) + * @param {string} [channel_id] Channel ID to filter trending casts. Less active channels might have no casts in the time window selected. + * @param {FeedTrendingProvider} [provider] The provider of the trending casts feed. + * @param {string} [provider_metadata] provider_metadata is a URI-encoded stringified JSON object that can be used to pass additional metadata to the provider. Only available for mbd provider right now. See [here](https://docs.neynar.com/docs/feed-for-you-w-external-providers) on how to use. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-trending-feed) + * */ - async feedUserPopular(fid: number, viewerFid?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.feedUserPopular(fid, viewerFid, options); + async fetchTrendingFeed(limit?: number, cursor?: string, viewer_fid?: number, time_window?: FetchTrendingFeedTimeWindowEnum, channel_id?: string, provider?: FeedTrendingProvider, provider_metadata?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchTrendingFeed(limit, cursor, viewer_fid, time_window, channel_id, provider, provider_metadata, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['FeedApi.feedUserPopular']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['FeedApi.fetchTrendingFeed']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Fetch recent replies and recasts for a given user FID; sorted by most recent first - * @summary Replies and recasts - * @param {number} fid FID of user whose replies and recasts you want to fetch - * @param {FeedUserRepliesRecastsFilterEnum} [filter] filter to fetch only replies or recasts - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. + * Fetch feed based on who a user is following + * @summary Following + * @param {number} fid FID of user whose feed you want to create + * @param {number} [viewer_fid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {boolean} [with_recasts] Include recasts in the response, true by default + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-following-feed) + * */ - async feedUserRepliesRecasts(fid: number, filter?: FeedUserRepliesRecastsFilterEnum, limit?: number, cursor?: string, viewerFid?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.feedUserRepliesRecasts(fid, filter, limit, cursor, viewerFid, options); + async fetchUserFollowingFeed(fid: number, viewer_fid?: number, with_recasts?: boolean, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchUserFollowingFeed(fid, viewer_fid, with_recasts, limit, cursor, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['FeedApi.feedUserRepliesRecasts']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['FeedApi.fetchUserFollowingFeed']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } @@ -903,358 +983,1110 @@ export const FeedApiFp = function(configuration?: Configuration) { export const FeedApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = FeedApiFp(configuration) return { + /** + * Fetch casts for a given user FID in reverse chronological order. Also allows filtering by parent_url and channel + * @summary Chronologically + * @param {FeedApiFetchCastsForUserRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-casts-for-user) + * + */ + fetchCastsForUser(requestParameters: FeedApiFetchCastsForUserRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchCastsForUser(requestParameters.fid, requestParameters.viewer_fid, requestParameters.limit, requestParameters.cursor, requestParameters.include_replies, requestParameters.parent_url, requestParameters.channel_id, options).then((request) => request(axios, basePath)); + }, /** * Fetch casts based on filters. Ensure setting the correct parameters based on the feed_type and filter_type. * @summary By filters - * @param {FeedType} feedType Defaults to following (requires FID or address). If set to filter (requires filter_type) - * @param {FilterType} [filterType] Used when feed_type=filter. Can be set to FIDs (requires FIDs) or parent_url (requires parent_url) or channel_id (requires channel_id) - * @param {number} [fid] (Optional) FID of user whose feed you want to create. By default, the API expects this field, except if you pass a filter_type - * @param {string} [fids] Used when filter_type=FIDs . Create a feed based on a list of FIDs. Max array size is 250. Requires feed_type and filter_type. - * @param {string} [parentUrl] Used when filter_type=parent_url can be used to fetch content under any parent url e.g. FIP-2 channels on Warpcast. Requires feed_type and filter_type - * @param {string} [channelId] Used when filter_type=channel_id can be used to fetch casts under a channel. Requires feed_type and filter_type. - * @param {boolean} [membersOnly] Used when filter_type=channel_id. Only include casts from members of the channel. True by default. - * @param {string} [embedUrl] Used when filter_type=embed_url can be used to fetch all casts with an embed url that contains embed_url. Requires feed_type and filter_type - * @param {Array} [embedTypes] Used when filter_type=embed_types can be used to fetch all casts with matching content types. Requires feed_type and filter_type - * @param {boolean} [withRecasts] Include recasts in the response, true by default - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {FeedApiFetchFeedRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-feed) + * */ - feed(feedType: FeedType, filterType?: FilterType, fid?: number, fids?: string, parentUrl?: string, channelId?: string, membersOnly?: boolean, embedUrl?: string, embedTypes?: Array, withRecasts?: boolean, limit?: number, cursor?: string, viewerFid?: number, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.feed(feedType, filterType, fid, fids, parentUrl, channelId, membersOnly, embedUrl, embedTypes, withRecasts, limit, cursor, viewerFid, options).then((request) => request(axios, basePath)); + fetchFeed(requestParameters: FeedApiFetchFeedRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchFeed(requestParameters.feed_type, requestParameters.filter_type, requestParameters.fid, requestParameters.fids, requestParameters.parent_url, requestParameters.channel_id, requestParameters.members_only, requestParameters.embed_url, requestParameters.embed_types, requestParameters.with_recasts, requestParameters.limit, requestParameters.cursor, requestParameters.viewer_fid, options).then((request) => request(axios, basePath)); }, /** * Fetch feed based on channel IDs * @summary By channel IDs - * @param {string} channelIds Comma separated list of channel IDs e.g. neynar,farcaster - * @param {boolean} [withRecasts] Include recasts in the response, true by default - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {boolean} [withReplies] Include replies in the response, false by default - * @param {boolean} [membersOnly] Only include casts from members of the channel. True by default. - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. - * @param {boolean} [shouldModerate] If true, only casts that have been liked by the moderator (if one exists) will be returned. + * @param {FeedApiFetchFeedByChannelIdsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-feed-by-channel-ids) + * */ - feedChannels(channelIds: string, withRecasts?: boolean, viewerFid?: number, withReplies?: boolean, membersOnly?: boolean, limit?: number, cursor?: string, shouldModerate?: boolean, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.feedChannels(channelIds, withRecasts, viewerFid, withReplies, membersOnly, limit, cursor, shouldModerate, options).then((request) => request(axios, basePath)); + fetchFeedByChannelIds(requestParameters: FeedApiFetchFeedByChannelIdsRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchFeedByChannelIds(requestParameters.channel_ids, requestParameters.with_recasts, requestParameters.viewer_fid, requestParameters.with_replies, requestParameters.members_only, requestParameters.limit, requestParameters.cursor, requestParameters.should_moderate, options).then((request) => request(axios, basePath)); }, /** - * Fetch feed based on who a user is following - * @summary Following - * @param {number} fid FID of user whose feed you want to create - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {boolean} [withRecasts] Include recasts in the response, true by default - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. + * Fetch feed based on parent URLs + * @summary By parent URLs + * @param {FeedApiFetchFeedByParentUrlsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-feed-by-parent-urls) + * */ - feedFollowing(fid: number, viewerFid?: number, withRecasts?: boolean, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.feedFollowing(fid, viewerFid, withRecasts, limit, cursor, options).then((request) => request(axios, basePath)); + fetchFeedByParentUrls(requestParameters: FeedApiFetchFeedByParentUrlsRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchFeedByParentUrls(requestParameters.parent_urls, requestParameters.with_recasts, requestParameters.viewer_fid, requestParameters.with_replies, requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath)); }, /** * Fetch a personalized For You feed for a user * @summary For you - * @param {number} fid FID of user whose feed you want to create - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {ForYouProvider} [provider] - * @param {number} [limit] Number of results to fetch (default 25, max 50) - * @param {string} [cursor] Pagination cursor. - * @param {string} [providerMetadata] provider_metadata is a URI-encoded stringified JSON object that can be used to pass additional metadata to the provider. Only available for mbd provider right now. See [here](https://docs.neynar.com/docs/feed-for-you-w-external-providers) on how to use. + * @param {FeedApiFetchFeedForYouRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-feed-for-you) + * */ - feedForYou(fid: number, viewerFid?: number, provider?: ForYouProvider, limit?: number, cursor?: string, providerMetadata?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.feedForYou(fid, viewerFid, provider, limit, cursor, providerMetadata, options).then((request) => request(axios, basePath)); + fetchFeedForYou(requestParameters: FeedApiFetchFeedForYouRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchFeedForYou(requestParameters.fid, requestParameters.viewer_fid, requestParameters.provider, requestParameters.limit, requestParameters.cursor, requestParameters.provider_metadata, options).then((request) => request(axios, basePath)); }, /** * Fetch feed of casts with Frames, reverse chronological order * @summary Casts with Frames - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {string} [cursor] Pagination cursor. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - feedFrames(limit?: number, viewerFid?: number, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.feedFrames(limit, viewerFid, cursor, options).then((request) => request(axios, basePath)); - }, - /** - * Fetch feed based on parent URLs - * @summary By parent URLs - * @param {string} parentUrls Comma separated list of parent_urls - * @param {boolean} [withRecasts] Include recasts in the response, true by default - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {boolean} [withReplies] Include replies in the response, false by default - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. + * @param {FeedApiFetchFramesOnlyFeedRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-frames-only-feed) + * */ - feedParentUrls(parentUrls: string, withRecasts?: boolean, viewerFid?: number, withReplies?: boolean, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.feedParentUrls(parentUrls, withRecasts, viewerFid, withReplies, limit, cursor, options).then((request) => request(axios, basePath)); + fetchFramesOnlyFeed(requestParameters: FeedApiFetchFramesOnlyFeedRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchFramesOnlyFeed(requestParameters.limit, requestParameters.viewer_fid, requestParameters.cursor, options).then((request) => request(axios, basePath)); }, /** - * Fetch trending casts or on the global feed or channels feeds. 7d time window available for channel feeds only. - * @summary Trending casts - * @param {number} [limit] Number of results to fetch (max 10) - * @param {string} [cursor] Pagination cursor - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {FeedTrendingTimeWindowEnum} [timeWindow] Time window for trending casts (7d window for channel feeds only) - * @param {string} [channelId] Channel ID to filter trending casts. Less active channels might have no casts in the time window selected. - * @param {FeedTrendingProvider} [provider] The provider of the trending casts feed. - * @param {string} [providerMetadata] provider_metadata is a URI-encoded stringified JSON object that can be used to pass additional metadata to the provider. Only available for mbd provider right now. See [here](https://docs.neynar.com/docs/feed-for-you-w-external-providers) on how to use. + * Fetch 10 most popular casts for a given user FID; popularity based on replies, likes and recasts; sorted by most popular first + * @summary 10 most popular casts + * @param {FeedApiFetchPopularCastsByUserRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `BulkCastsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-popular-casts-by-user) + * */ - feedTrending(limit?: number, cursor?: string, viewerFid?: number, timeWindow?: FeedTrendingTimeWindowEnum, channelId?: string, provider?: FeedTrendingProvider, providerMetadata?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.feedTrending(limit, cursor, viewerFid, timeWindow, channelId, provider, providerMetadata, options).then((request) => request(axios, basePath)); + fetchPopularCastsByUser(requestParameters: FeedApiFetchPopularCastsByUserRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchPopularCastsByUser(requestParameters.fid, requestParameters.viewer_fid, options).then((request) => request(axios, basePath)); }, /** - * Fetch casts for a given user FID in reverse chronological order. Also allows filtering by parent_url and channel - * @summary Chronologically - * @param {number} fid FID of user whose recent casts you want to fetch - * @param {number} [viewerFid] FID of the user viewing the feed - * @param {number} [limit] Number of results to fetch - * @param {string} [cursor] Pagination cursor - * @param {boolean} [includeReplies] Include reply casts by the author in the response, true by default - * @param {string} [parentUrl] Parent URL to filter the feed; mutually exclusive with channel_id - * @param {string} [channelId] Channel ID to filter the feed; mutually exclusive with parent_url + * Fetch recent replies and recasts for a given user FID; sorted by most recent first + * @summary Replies and recasts + * @param {FeedApiFetchRepliesAndRecastsForUserRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-replies-and-recasts-for-user) + * */ - feedUserCasts(fid: number, viewerFid?: number, limit?: number, cursor?: string, includeReplies?: boolean, parentUrl?: string, channelId?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.feedUserCasts(fid, viewerFid, limit, cursor, includeReplies, parentUrl, channelId, options).then((request) => request(axios, basePath)); + fetchRepliesAndRecastsForUser(requestParameters: FeedApiFetchRepliesAndRecastsForUserRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchRepliesAndRecastsForUser(requestParameters.fid, requestParameters.filter, requestParameters.limit, requestParameters.cursor, requestParameters.viewer_fid, options).then((request) => request(axios, basePath)); }, /** - * Fetch 10 most popular casts for a given user FID; popularity based on replies, likes and recasts; sorted by most popular first - * @summary 10 most popular casts - * @param {number} fid FID of user whose feed you want to create - * @param {number} [viewerFid] + * Fetch trending casts or on the global feed or channels feeds. 7d time window available for channel feeds only. + * @summary Trending casts + * @param {FeedApiFetchTrendingFeedRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-trending-feed) + * */ - feedUserPopular(fid: number, viewerFid?: number, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.feedUserPopular(fid, viewerFid, options).then((request) => request(axios, basePath)); + fetchTrendingFeed(requestParameters: FeedApiFetchTrendingFeedRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchTrendingFeed(requestParameters.limit, requestParameters.cursor, requestParameters.viewer_fid, requestParameters.time_window, requestParameters.channel_id, requestParameters.provider, requestParameters.provider_metadata, options).then((request) => request(axios, basePath)); }, /** - * Fetch recent replies and recasts for a given user FID; sorted by most recent first - * @summary Replies and recasts - * @param {number} fid FID of user whose replies and recasts you want to fetch - * @param {FeedUserRepliesRecastsFilterEnum} [filter] filter to fetch only replies or recasts - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. + * Fetch feed based on who a user is following + * @summary Following + * @param {FeedApiFetchUserFollowingFeedRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-following-feed) + * */ - feedUserRepliesRecasts(fid: number, filter?: FeedUserRepliesRecastsFilterEnum, limit?: number, cursor?: string, viewerFid?: number, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.feedUserRepliesRecasts(fid, filter, limit, cursor, viewerFid, options).then((request) => request(axios, basePath)); + fetchUserFollowingFeed(requestParameters: FeedApiFetchUserFollowingFeedRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchUserFollowingFeed(requestParameters.fid, requestParameters.viewer_fid, requestParameters.with_recasts, requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath)); }, }; }; /** - * FeedApi - object-oriented interface + * FeedApi - interface * @export - * @class FeedApi - * @extends {BaseAPI} + * @interface FeedApi */ -export class FeedApi extends BaseAPI { +export interface FeedApiInterface { /** - * Fetch casts based on filters. Ensure setting the correct parameters based on the feed_type and filter_type. - * @summary By filters - * @param {FeedType} feedType Defaults to following (requires FID or address). If set to filter (requires filter_type) - * @param {FilterType} [filterType] Used when feed_type=filter. Can be set to FIDs (requires FIDs) or parent_url (requires parent_url) or channel_id (requires channel_id) - * @param {number} [fid] (Optional) FID of user whose feed you want to create. By default, the API expects this field, except if you pass a filter_type - * @param {string} [fids] Used when filter_type=FIDs . Create a feed based on a list of FIDs. Max array size is 250. Requires feed_type and filter_type. - * @param {string} [parentUrl] Used when filter_type=parent_url can be used to fetch content under any parent url e.g. FIP-2 channels on Warpcast. Requires feed_type and filter_type - * @param {string} [channelId] Used when filter_type=channel_id can be used to fetch casts under a channel. Requires feed_type and filter_type. - * @param {boolean} [membersOnly] Used when filter_type=channel_id. Only include casts from members of the channel. True by default. - * @param {string} [embedUrl] Used when filter_type=embed_url can be used to fetch all casts with an embed url that contains embed_url. Requires feed_type and filter_type - * @param {Array} [embedTypes] Used when filter_type=embed_types can be used to fetch all casts with matching content types. Requires feed_type and filter_type - * @param {boolean} [withRecasts] Include recasts in the response, true by default - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. + * Fetch casts for a given user FID in reverse chronological order. Also allows filtering by parent_url and channel + * @summary Chronologically + * @param {FeedApiFetchCastsForUserRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof FeedApi + * @memberof FeedApiInterface + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-casts-for-user) + * */ - public feed(feedType: FeedType, filterType?: FilterType, fid?: number, fids?: string, parentUrl?: string, channelId?: string, membersOnly?: boolean, embedUrl?: string, embedTypes?: Array, withRecasts?: boolean, limit?: number, cursor?: string, viewerFid?: number, options?: RawAxiosRequestConfig) { - return FeedApiFp(this.configuration).feed(feedType, filterType, fid, fids, parentUrl, channelId, membersOnly, embedUrl, embedTypes, withRecasts, limit, cursor, viewerFid, options).then((request) => request(this.axios, this.basePath)); - } + fetchCastsForUser(requestParameters: FeedApiFetchCastsForUserRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** - * Fetch feed based on channel IDs + * Fetch casts based on filters. Ensure setting the correct parameters based on the feed_type and filter_type. + * @summary By filters + * @param {FeedApiFetchFeedRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FeedApiInterface + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-feed) + * + */ + fetchFeed(requestParameters: FeedApiFetchFeedRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Fetch feed based on channel IDs * @summary By channel IDs - * @param {string} channelIds Comma separated list of channel IDs e.g. neynar,farcaster - * @param {boolean} [withRecasts] Include recasts in the response, true by default - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {boolean} [withReplies] Include replies in the response, false by default - * @param {boolean} [membersOnly] Only include casts from members of the channel. True by default. - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. - * @param {boolean} [shouldModerate] If true, only casts that have been liked by the moderator (if one exists) will be returned. + * @param {FeedApiFetchFeedByChannelIdsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof FeedApi + * @memberof FeedApiInterface + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-feed-by-channel-ids) + * */ - public feedChannels(channelIds: string, withRecasts?: boolean, viewerFid?: number, withReplies?: boolean, membersOnly?: boolean, limit?: number, cursor?: string, shouldModerate?: boolean, options?: RawAxiosRequestConfig) { - return FeedApiFp(this.configuration).feedChannels(channelIds, withRecasts, viewerFid, withReplies, membersOnly, limit, cursor, shouldModerate, options).then((request) => request(this.axios, this.basePath)); - } + fetchFeedByChannelIds(requestParameters: FeedApiFetchFeedByChannelIdsRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Fetch feed based on parent URLs + * @summary By parent URLs + * @param {FeedApiFetchFeedByParentUrlsRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FeedApiInterface + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-feed-by-parent-urls) + * + */ + fetchFeedByParentUrls(requestParameters: FeedApiFetchFeedByParentUrlsRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Fetch a personalized For You feed for a user + * @summary For you + * @param {FeedApiFetchFeedForYouRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FeedApiInterface + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-feed-for-you) + * + */ + fetchFeedForYou(requestParameters: FeedApiFetchFeedForYouRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Fetch feed of casts with Frames, reverse chronological order + * @summary Casts with Frames + * @param {FeedApiFetchFramesOnlyFeedRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FeedApiInterface + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-frames-only-feed) + * + */ + fetchFramesOnlyFeed(requestParameters?: FeedApiFetchFramesOnlyFeedRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Fetch 10 most popular casts for a given user FID; popularity based on replies, likes and recasts; sorted by most popular first + * @summary 10 most popular casts + * @param {FeedApiFetchPopularCastsByUserRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FeedApiInterface + * @returns {Promise} A promise that resolves to a `BulkCastsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-popular-casts-by-user) + * + */ + fetchPopularCastsByUser(requestParameters: FeedApiFetchPopularCastsByUserRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Fetch recent replies and recasts for a given user FID; sorted by most recent first + * @summary Replies and recasts + * @param {FeedApiFetchRepliesAndRecastsForUserRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FeedApiInterface + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-replies-and-recasts-for-user) + * + */ + fetchRepliesAndRecastsForUser(requestParameters: FeedApiFetchRepliesAndRecastsForUserRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Fetch trending casts or on the global feed or channels feeds. 7d time window available for channel feeds only. + * @summary Trending casts + * @param {FeedApiFetchTrendingFeedRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FeedApiInterface + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-trending-feed) + * + */ + fetchTrendingFeed(requestParameters?: FeedApiFetchTrendingFeedRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Fetch feed based on who a user is following * @summary Following - * @param {number} fid FID of user whose feed you want to create - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {boolean} [withRecasts] Include recasts in the response, true by default - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. + * @param {FeedApiFetchUserFollowingFeedRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FeedApiInterface + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-following-feed) + * + */ + fetchUserFollowingFeed(requestParameters: FeedApiFetchUserFollowingFeedRequest, options?: RawAxiosRequestConfig): AxiosPromise; + +} + +/** + * Request parameters for fetchCastsForUser operation in FeedApi. + * @export + * @interface FeedApiFetchCastsForUserRequest + */ +export interface FeedApiFetchCastsForUserRequest { + /** + * FID of user whose recent casts you want to fetch + * + * + * @type {number} + * @memberof FeedApiFetchCastsForUser + */ + readonly fid: number + + /** + * FID of the user viewing the feed + * + * + * @type {number} + * @memberof FeedApiFetchCastsForUser + */ + readonly viewer_fid?: number + + /** + * Number of results to fetch (Default: 25, Maximum: 150) + * + * + * @type {number} + * @memberof FeedApiFetchCastsForUser + */ + readonly limit?: number + + /** + * Pagination cursor + * + * + * @type {string} + * @memberof FeedApiFetchCastsForUser + */ + readonly cursor?: string + + /** + * Include reply casts by the author in the response, true by default + * + * + * @type {boolean} + * @memberof FeedApiFetchCastsForUser + */ + readonly include_replies?: boolean + + /** + * Parent URL to filter the feed; mutually exclusive with channel_id + * + * + * @type {string} + * @memberof FeedApiFetchCastsForUser + */ + readonly parent_url?: string + + /** + * Channel ID to filter the feed; mutually exclusive with parent_url + * + * + * @type {string} + * @memberof FeedApiFetchCastsForUser + */ + readonly channel_id?: string +} + +/** + * Request parameters for fetchFeed operation in FeedApi. + * @export + * @interface FeedApiFetchFeedRequest + */ +export interface FeedApiFetchFeedRequest { + /** + * Defaults to following (requires FID or address). If set to filter (requires filter_type) + * + * + * @type {FeedType} + * @memberof FeedApiFetchFeed + */ + readonly feed_type: FeedType + + /** + * Used when feed_type=filter. Can be set to FIDs (requires FIDs) or parent_url (requires parent_url) or channel_id (requires channel_id) + * + * + * @type {FilterType} + * @memberof FeedApiFetchFeed + */ + readonly filter_type?: FilterType + + /** + * (Optional) FID of user whose feed you want to create. By default, the API expects this field, except if you pass a filter_type + * + * + * @type {number} + * @memberof FeedApiFetchFeed + */ + readonly fid?: number + + /** + * Used when filter_type=FIDs . Create a feed based on a list of FIDs. Max array size is 250. Requires feed_type and filter_type. + * + * + * @type {string} + * @memberof FeedApiFetchFeed + */ + readonly fids?: string + + /** + * Used when filter_type=parent_url can be used to fetch content under any parent url e.g. FIP-2 channels on Warpcast. Requires feed_type and filter_type + * + * + * @type {string} + * @memberof FeedApiFetchFeed + */ + readonly parent_url?: string + + /** + * Used when filter_type=channel_id can be used to fetch casts under a channel. Requires feed_type and filter_type. + * + * + * @type {string} + * @memberof FeedApiFetchFeed + */ + readonly channel_id?: string + + /** + * Used when filter_type=channel_id. Only include casts from members of the channel. True by default. + * + * + * @type {boolean} + * @memberof FeedApiFetchFeed + */ + readonly members_only?: boolean + + /** + * Used when filter_type=embed_url can be used to fetch all casts with an embed url that contains embed_url. Requires feed_type and filter_type + * + * + * @type {string} + * @memberof FeedApiFetchFeed + */ + readonly embed_url?: string + + /** + * Used when filter_type=embed_types can be used to fetch all casts with matching content types. Requires feed_type and filter_type + * + * + * @type {Array} + * @memberof FeedApiFetchFeed + */ + readonly embed_types?: Array + + /** + * Include recasts in the response, true by default + * + * + * @type {boolean} + * @memberof FeedApiFetchFeed + */ + readonly with_recasts?: boolean + + /** + * Number of results to fetch (Default: 25, Maximum: 100) + * + * + * @type {number} + * @memberof FeedApiFetchFeed + */ + readonly limit?: number + + /** + * Pagination cursor. + * + * + * @type {string} + * @memberof FeedApiFetchFeed + */ + readonly cursor?: string + + /** + * Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. + * + * + * @type {number} + * @memberof FeedApiFetchFeed + */ + readonly viewer_fid?: number +} + +/** + * Request parameters for fetchFeedByChannelIds operation in FeedApi. + * @export + * @interface FeedApiFetchFeedByChannelIdsRequest + */ +export interface FeedApiFetchFeedByChannelIdsRequest { + /** + * Comma separated list of channel IDs e.g. neynar,farcaster + * + * @commaSeparated + * @type {string} + * @memberof FeedApiFetchFeedByChannelIds + */ + readonly channel_ids: string + + /** + * Include recasts in the response, true by default + * + * + * @type {boolean} + * @memberof FeedApiFetchFeedByChannelIds + */ + readonly with_recasts?: boolean + + /** + * Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. + * + * + * @type {number} + * @memberof FeedApiFetchFeedByChannelIds + */ + readonly viewer_fid?: number + + /** + * Include replies in the response, false by default + * + * + * @type {boolean} + * @memberof FeedApiFetchFeedByChannelIds + */ + readonly with_replies?: boolean + + /** + * Only include casts from members of the channel. True by default. + * + * + * @type {boolean} + * @memberof FeedApiFetchFeedByChannelIds + */ + readonly members_only?: boolean + + /** + * Number of results to fetch (Default: 25, Maximum: 100) + * + * + * @type {number} + * @memberof FeedApiFetchFeedByChannelIds + */ + readonly limit?: number + + /** + * Pagination cursor. + * + * + * @type {string} + * @memberof FeedApiFetchFeedByChannelIds + */ + readonly cursor?: string + + /** + * If true, only casts that have been liked by the moderator (if one exists) will be returned. + * + * + * @type {boolean} + * @memberof FeedApiFetchFeedByChannelIds + */ + readonly should_moderate?: boolean +} + +/** + * Request parameters for fetchFeedByParentUrls operation in FeedApi. + * @export + * @interface FeedApiFetchFeedByParentUrlsRequest + */ +export interface FeedApiFetchFeedByParentUrlsRequest { + /** + * Comma separated list of parent_urls + * + * @commaSeparated + * @type {string} + * @memberof FeedApiFetchFeedByParentUrls + */ + readonly parent_urls: string + + /** + * Include recasts in the response, true by default + * + * + * @type {boolean} + * @memberof FeedApiFetchFeedByParentUrls + */ + readonly with_recasts?: boolean + + /** + * Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. + * + * + * @type {number} + * @memberof FeedApiFetchFeedByParentUrls + */ + readonly viewer_fid?: number + + /** + * Include replies in the response, false by default + * + * + * @type {boolean} + * @memberof FeedApiFetchFeedByParentUrls + */ + readonly with_replies?: boolean + + /** + * Number of results to fetch (Default: 25, Maximum: 100) + * + * + * @type {number} + * @memberof FeedApiFetchFeedByParentUrls + */ + readonly limit?: number + + /** + * Pagination cursor. + * + * + * @type {string} + * @memberof FeedApiFetchFeedByParentUrls + */ + readonly cursor?: string +} + +/** + * Request parameters for fetchFeedForYou operation in FeedApi. + * @export + * @interface FeedApiFetchFeedForYouRequest + */ +export interface FeedApiFetchFeedForYouRequest { + /** + * FID of user whose feed you want to create + * + * + * @type {number} + * @memberof FeedApiFetchFeedForYou + */ + readonly fid: number + + /** + * Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. + * + * + * @type {number} + * @memberof FeedApiFetchFeedForYou + */ + readonly viewer_fid?: number + + /** + * + * + * + * @type {ForYouProvider} + * @memberof FeedApiFetchFeedForYou + */ + readonly provider?: ForYouProvider + + /** + * Number of results to fetch (Default: 25, Maximum: 50) + * + * + * @type {number} + * @memberof FeedApiFetchFeedForYou + */ + readonly limit?: number + + /** + * Pagination cursor. + * + * + * @type {string} + * @memberof FeedApiFetchFeedForYou + */ + readonly cursor?: string + + /** + * provider_metadata is a URI-encoded stringified JSON object that can be used to pass additional metadata to the provider. Only available for mbd provider right now. See [here](https://docs.neynar.com/docs/feed-for-you-w-external-providers) on how to use. + * + * + * @type {string} + * @memberof FeedApiFetchFeedForYou + */ + readonly provider_metadata?: string +} + +/** + * Request parameters for fetchFramesOnlyFeed operation in FeedApi. + * @export + * @interface FeedApiFetchFramesOnlyFeedRequest + */ +export interface FeedApiFetchFramesOnlyFeedRequest { + /** + * Number of results to fetch (Default: 25, Maximum: 100) + * + * + * @type {number} + * @memberof FeedApiFetchFramesOnlyFeed + */ + readonly limit?: number + + /** + * Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. + * + * + * @type {number} + * @memberof FeedApiFetchFramesOnlyFeed + */ + readonly viewer_fid?: number + + /** + * Pagination cursor. + * + * + * @type {string} + * @memberof FeedApiFetchFramesOnlyFeed + */ + readonly cursor?: string +} + +/** + * Request parameters for fetchPopularCastsByUser operation in FeedApi. + * @export + * @interface FeedApiFetchPopularCastsByUserRequest + */ +export interface FeedApiFetchPopularCastsByUserRequest { + /** + * FID of user whose feed you want to create + * + * + * @type {number} + * @memberof FeedApiFetchPopularCastsByUser + */ + readonly fid: number + + /** + * + * + * + * @type {number} + * @memberof FeedApiFetchPopularCastsByUser + */ + readonly viewer_fid?: number +} + +/** + * Request parameters for fetchRepliesAndRecastsForUser operation in FeedApi. + * @export + * @interface FeedApiFetchRepliesAndRecastsForUserRequest + */ +export interface FeedApiFetchRepliesAndRecastsForUserRequest { + /** + * FID of user whose replies and recasts you want to fetch + * + * + * @type {number} + * @memberof FeedApiFetchRepliesAndRecastsForUser + */ + readonly fid: number + + /** + * filter to fetch only replies or recasts + * + * + * @type {'replies' | 'recasts' | 'all'} + * @memberof FeedApiFetchRepliesAndRecastsForUser + */ + readonly filter?: FetchRepliesAndRecastsForUserFilterEnum + + /** + * Number of results to fetch (Default: 25, Maximum: 50) + * + * + * @type {number} + * @memberof FeedApiFetchRepliesAndRecastsForUser + */ + readonly limit?: number + + /** + * Pagination cursor. + * + * + * @type {string} + * @memberof FeedApiFetchRepliesAndRecastsForUser + */ + readonly cursor?: string + + /** + * Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. + * + * + * @type {number} + * @memberof FeedApiFetchRepliesAndRecastsForUser + */ + readonly viewer_fid?: number +} + +/** + * Request parameters for fetchTrendingFeed operation in FeedApi. + * @export + * @interface FeedApiFetchTrendingFeedRequest + */ +export interface FeedApiFetchTrendingFeedRequest { + /** + * Number of results to fetch (Default: 10, Maximum: 10) + * + * + * @type {number} + * @memberof FeedApiFetchTrendingFeed + */ + readonly limit?: number + + /** + * Pagination cursor + * + * + * @type {string} + * @memberof FeedApiFetchTrendingFeed + */ + readonly cursor?: string + + /** + * Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. + * + * + * @type {number} + * @memberof FeedApiFetchTrendingFeed + */ + readonly viewer_fid?: number + + /** + * Time window for trending casts (7d window for channel feeds only) + * + * + * @type {'1h' | '6h' | '12h' | '24h' | '7d'} + * @memberof FeedApiFetchTrendingFeed + */ + readonly time_window?: FetchTrendingFeedTimeWindowEnum + + /** + * Channel ID to filter trending casts. Less active channels might have no casts in the time window selected. + * + * + * @type {string} + * @memberof FeedApiFetchTrendingFeed + */ + readonly channel_id?: string + + /** + * The provider of the trending casts feed. + * + * + * @type {FeedTrendingProvider} + * @memberof FeedApiFetchTrendingFeed + */ + readonly provider?: FeedTrendingProvider + + /** + * provider_metadata is a URI-encoded stringified JSON object that can be used to pass additional metadata to the provider. Only available for mbd provider right now. See [here](https://docs.neynar.com/docs/feed-for-you-w-external-providers) on how to use. + * + * + * @type {string} + * @memberof FeedApiFetchTrendingFeed + */ + readonly provider_metadata?: string +} + +/** + * Request parameters for fetchUserFollowingFeed operation in FeedApi. + * @export + * @interface FeedApiFetchUserFollowingFeedRequest + */ +export interface FeedApiFetchUserFollowingFeedRequest { + /** + * FID of user whose feed you want to create + * + * + * @type {number} + * @memberof FeedApiFetchUserFollowingFeed + */ + readonly fid: number + + /** + * Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. + * + * + * @type {number} + * @memberof FeedApiFetchUserFollowingFeed + */ + readonly viewer_fid?: number + + /** + * Include recasts in the response, true by default + * + * + * @type {boolean} + * @memberof FeedApiFetchUserFollowingFeed + */ + readonly with_recasts?: boolean + + /** + * Number of results to fetch (Default: 25, Maximum: 100) + * + * + * @type {number} + * @memberof FeedApiFetchUserFollowingFeed + */ + readonly limit?: number + + /** + * Pagination cursor. + * + * + * @type {string} + * @memberof FeedApiFetchUserFollowingFeed + */ + readonly cursor?: string +} + +/** + * FeedApi - object-oriented interface + * @export + * @class FeedApi + * @extends {BaseAPI} + */ +export class FeedApi extends BaseAPI implements FeedApiInterface { + /** + * Fetch casts for a given user FID in reverse chronological order. Also allows filtering by parent_url and channel + * @summary Chronologically + * @param {FeedApiFetchCastsForUserRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FeedApi + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-casts-for-user) + * */ - public feedFollowing(fid: number, viewerFid?: number, withRecasts?: boolean, limit?: number, cursor?: string, options?: RawAxiosRequestConfig) { - return FeedApiFp(this.configuration).feedFollowing(fid, viewerFid, withRecasts, limit, cursor, options).then((request) => request(this.axios, this.basePath)); + public fetchCastsForUser(requestParameters: FeedApiFetchCastsForUserRequest, options?: RawAxiosRequestConfig) { + return FeedApiFp(this.configuration).fetchCastsForUser(requestParameters.fid, requestParameters.viewer_fid, requestParameters.limit, requestParameters.cursor, requestParameters.include_replies, requestParameters.parent_url, requestParameters.channel_id, options).then((request) => request(this.axios, this.basePath)); } /** - * Fetch a personalized For You feed for a user - * @summary For you - * @param {number} fid FID of user whose feed you want to create - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {ForYouProvider} [provider] - * @param {number} [limit] Number of results to fetch (default 25, max 50) - * @param {string} [cursor] Pagination cursor. - * @param {string} [providerMetadata] provider_metadata is a URI-encoded stringified JSON object that can be used to pass additional metadata to the provider. Only available for mbd provider right now. See [here](https://docs.neynar.com/docs/feed-for-you-w-external-providers) on how to use. + * Fetch casts based on filters. Ensure setting the correct parameters based on the feed_type and filter_type. + * @summary By filters + * @param {FeedApiFetchFeedRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FeedApi + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-feed) + * */ - public feedForYou(fid: number, viewerFid?: number, provider?: ForYouProvider, limit?: number, cursor?: string, providerMetadata?: string, options?: RawAxiosRequestConfig) { - return FeedApiFp(this.configuration).feedForYou(fid, viewerFid, provider, limit, cursor, providerMetadata, options).then((request) => request(this.axios, this.basePath)); + public fetchFeed(requestParameters: FeedApiFetchFeedRequest, options?: RawAxiosRequestConfig) { + return FeedApiFp(this.configuration).fetchFeed(requestParameters.feed_type, requestParameters.filter_type, requestParameters.fid, requestParameters.fids, requestParameters.parent_url, requestParameters.channel_id, requestParameters.members_only, requestParameters.embed_url, requestParameters.embed_types, requestParameters.with_recasts, requestParameters.limit, requestParameters.cursor, requestParameters.viewer_fid, options).then((request) => request(this.axios, this.basePath)); } /** - * Fetch feed of casts with Frames, reverse chronological order - * @summary Casts with Frames - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {string} [cursor] Pagination cursor. + * Fetch feed based on channel IDs + * @summary By channel IDs + * @param {FeedApiFetchFeedByChannelIdsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FeedApi + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-feed-by-channel-ids) + * */ - public feedFrames(limit?: number, viewerFid?: number, cursor?: string, options?: RawAxiosRequestConfig) { - return FeedApiFp(this.configuration).feedFrames(limit, viewerFid, cursor, options).then((request) => request(this.axios, this.basePath)); + public fetchFeedByChannelIds(requestParameters: FeedApiFetchFeedByChannelIdsRequest, options?: RawAxiosRequestConfig) { + return FeedApiFp(this.configuration).fetchFeedByChannelIds(requestParameters.channel_ids, requestParameters.with_recasts, requestParameters.viewer_fid, requestParameters.with_replies, requestParameters.members_only, requestParameters.limit, requestParameters.cursor, requestParameters.should_moderate, options).then((request) => request(this.axios, this.basePath)); } /** * Fetch feed based on parent URLs * @summary By parent URLs - * @param {string} parentUrls Comma separated list of parent_urls - * @param {boolean} [withRecasts] Include recasts in the response, true by default - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {boolean} [withReplies] Include replies in the response, false by default - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. + * @param {FeedApiFetchFeedByParentUrlsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FeedApi + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-feed-by-parent-urls) + * */ - public feedParentUrls(parentUrls: string, withRecasts?: boolean, viewerFid?: number, withReplies?: boolean, limit?: number, cursor?: string, options?: RawAxiosRequestConfig) { - return FeedApiFp(this.configuration).feedParentUrls(parentUrls, withRecasts, viewerFid, withReplies, limit, cursor, options).then((request) => request(this.axios, this.basePath)); + public fetchFeedByParentUrls(requestParameters: FeedApiFetchFeedByParentUrlsRequest, options?: RawAxiosRequestConfig) { + return FeedApiFp(this.configuration).fetchFeedByParentUrls(requestParameters.parent_urls, requestParameters.with_recasts, requestParameters.viewer_fid, requestParameters.with_replies, requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath)); } /** - * Fetch trending casts or on the global feed or channels feeds. 7d time window available for channel feeds only. - * @summary Trending casts - * @param {number} [limit] Number of results to fetch (max 10) - * @param {string} [cursor] Pagination cursor - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {FeedTrendingTimeWindowEnum} [timeWindow] Time window for trending casts (7d window for channel feeds only) - * @param {string} [channelId] Channel ID to filter trending casts. Less active channels might have no casts in the time window selected. - * @param {FeedTrendingProvider} [provider] The provider of the trending casts feed. - * @param {string} [providerMetadata] provider_metadata is a URI-encoded stringified JSON object that can be used to pass additional metadata to the provider. Only available for mbd provider right now. See [here](https://docs.neynar.com/docs/feed-for-you-w-external-providers) on how to use. + * Fetch a personalized For You feed for a user + * @summary For you + * @param {FeedApiFetchFeedForYouRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FeedApi + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-feed-for-you) + * */ - public feedTrending(limit?: number, cursor?: string, viewerFid?: number, timeWindow?: FeedTrendingTimeWindowEnum, channelId?: string, provider?: FeedTrendingProvider, providerMetadata?: string, options?: RawAxiosRequestConfig) { - return FeedApiFp(this.configuration).feedTrending(limit, cursor, viewerFid, timeWindow, channelId, provider, providerMetadata, options).then((request) => request(this.axios, this.basePath)); + public fetchFeedForYou(requestParameters: FeedApiFetchFeedForYouRequest, options?: RawAxiosRequestConfig) { + return FeedApiFp(this.configuration).fetchFeedForYou(requestParameters.fid, requestParameters.viewer_fid, requestParameters.provider, requestParameters.limit, requestParameters.cursor, requestParameters.provider_metadata, options).then((request) => request(this.axios, this.basePath)); } /** - * Fetch casts for a given user FID in reverse chronological order. Also allows filtering by parent_url and channel - * @summary Chronologically - * @param {number} fid FID of user whose recent casts you want to fetch - * @param {number} [viewerFid] FID of the user viewing the feed - * @param {number} [limit] Number of results to fetch - * @param {string} [cursor] Pagination cursor - * @param {boolean} [includeReplies] Include reply casts by the author in the response, true by default - * @param {string} [parentUrl] Parent URL to filter the feed; mutually exclusive with channel_id - * @param {string} [channelId] Channel ID to filter the feed; mutually exclusive with parent_url + * Fetch feed of casts with Frames, reverse chronological order + * @summary Casts with Frames + * @param {FeedApiFetchFramesOnlyFeedRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FeedApi + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-frames-only-feed) + * */ - public feedUserCasts(fid: number, viewerFid?: number, limit?: number, cursor?: string, includeReplies?: boolean, parentUrl?: string, channelId?: string, options?: RawAxiosRequestConfig) { - return FeedApiFp(this.configuration).feedUserCasts(fid, viewerFid, limit, cursor, includeReplies, parentUrl, channelId, options).then((request) => request(this.axios, this.basePath)); + public fetchFramesOnlyFeed(requestParameters: FeedApiFetchFramesOnlyFeedRequest = {}, options?: RawAxiosRequestConfig) { + return FeedApiFp(this.configuration).fetchFramesOnlyFeed(requestParameters.limit, requestParameters.viewer_fid, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath)); } /** * Fetch 10 most popular casts for a given user FID; popularity based on replies, likes and recasts; sorted by most popular first * @summary 10 most popular casts - * @param {number} fid FID of user whose feed you want to create - * @param {number} [viewerFid] + * @param {FeedApiFetchPopularCastsByUserRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FeedApi + * @returns {Promise} A promise that resolves to a `BulkCastsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-popular-casts-by-user) + * */ - public feedUserPopular(fid: number, viewerFid?: number, options?: RawAxiosRequestConfig) { - return FeedApiFp(this.configuration).feedUserPopular(fid, viewerFid, options).then((request) => request(this.axios, this.basePath)); + public fetchPopularCastsByUser(requestParameters: FeedApiFetchPopularCastsByUserRequest, options?: RawAxiosRequestConfig) { + return FeedApiFp(this.configuration).fetchPopularCastsByUser(requestParameters.fid, requestParameters.viewer_fid, options).then((request) => request(this.axios, this.basePath)); } /** * Fetch recent replies and recasts for a given user FID; sorted by most recent first * @summary Replies and recasts - * @param {number} fid FID of user whose replies and recasts you want to fetch - * @param {FeedUserRepliesRecastsFilterEnum} [filter] filter to fetch only replies or recasts - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. - * @param {number} [viewerFid] Providing this will return a feed that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {FeedApiFetchRepliesAndRecastsForUserRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FeedApi + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-replies-and-recasts-for-user) + * + */ + public fetchRepliesAndRecastsForUser(requestParameters: FeedApiFetchRepliesAndRecastsForUserRequest, options?: RawAxiosRequestConfig) { + return FeedApiFp(this.configuration).fetchRepliesAndRecastsForUser(requestParameters.fid, requestParameters.filter, requestParameters.limit, requestParameters.cursor, requestParameters.viewer_fid, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Fetch trending casts or on the global feed or channels feeds. 7d time window available for channel feeds only. + * @summary Trending casts + * @param {FeedApiFetchTrendingFeedRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FeedApi + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-trending-feed) + * + */ + public fetchTrendingFeed(requestParameters: FeedApiFetchTrendingFeedRequest = {}, options?: RawAxiosRequestConfig) { + return FeedApiFp(this.configuration).fetchTrendingFeed(requestParameters.limit, requestParameters.cursor, requestParameters.viewer_fid, requestParameters.time_window, requestParameters.channel_id, requestParameters.provider, requestParameters.provider_metadata, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Fetch feed based on who a user is following + * @summary Following + * @param {FeedApiFetchUserFollowingFeedRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FeedApi + * @returns {Promise} A promise that resolves to a `FeedResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-following-feed) + * */ - public feedUserRepliesRecasts(fid: number, filter?: FeedUserRepliesRecastsFilterEnum, limit?: number, cursor?: string, viewerFid?: number, options?: RawAxiosRequestConfig) { - return FeedApiFp(this.configuration).feedUserRepliesRecasts(fid, filter, limit, cursor, viewerFid, options).then((request) => request(this.axios, this.basePath)); + public fetchUserFollowingFeed(requestParameters: FeedApiFetchUserFollowingFeedRequest, options?: RawAxiosRequestConfig) { + return FeedApiFp(this.configuration).fetchUserFollowingFeed(requestParameters.fid, requestParameters.viewer_fid, requestParameters.with_recasts, requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath)); } } /** * @export */ -export const FeedTrendingTimeWindowEnum = { +export const FetchRepliesAndRecastsForUserFilterEnum = { + Replies: 'replies', + Recasts: 'recasts', + All: 'all' +} as const; +export type FetchRepliesAndRecastsForUserFilterEnum = typeof FetchRepliesAndRecastsForUserFilterEnum[keyof typeof FetchRepliesAndRecastsForUserFilterEnum]; +/** + * @export + */ +export const FetchTrendingFeedTimeWindowEnum = { _1h: '1h', _6h: '6h', _12h: '12h', _24h: '24h', _7d: '7d' } as const; -export type FeedTrendingTimeWindowEnum = typeof FeedTrendingTimeWindowEnum[keyof typeof FeedTrendingTimeWindowEnum]; -/** - * @export - */ -export const FeedUserRepliesRecastsFilterEnum = { - Replies: 'replies', - Recasts: 'recasts', - All: 'all' -} as const; -export type FeedUserRepliesRecastsFilterEnum = typeof FeedUserRepliesRecastsFilterEnum[keyof typeof FeedUserRepliesRecastsFilterEnum]; +export type FetchTrendingFeedTimeWindowEnum = typeof FetchTrendingFeedTimeWindowEnum[keyof typeof FetchTrendingFeedTimeWindowEnum]; diff --git a/src/neynar-api/v2/openapi-farcaster/apis/fname-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/fname-api.ts index 88dc4acc..74cb1c73 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/fname-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/fname-api.ts @@ -34,13 +34,17 @@ export const FnameApiAxiosParamCreator = function (configuration?: Configuration /** * Check if a given fname is available * @summary Check fname availability - * @param {string} fname + * @param {string} fname * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FnameAvailabilityResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/is-fname-available) + * */ - fnameAvailability: async (fname: string, options: RawAxiosRequestConfig = {}): Promise => { + isFnameAvailable: async (fname: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'fname' is not null or undefined - assertParamExists('fnameAvailability', 'fname', fname) + assertParamExists('isFnameAvailable', 'fname', fname) const localVarPath = `/farcaster/fname/availability`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -84,14 +88,18 @@ export const FnameApiFp = function(configuration?: Configuration) { /** * Check if a given fname is available * @summary Check fname availability - * @param {string} fname + * @param {string} fname * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FnameAvailabilityResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/is-fname-available) + * */ - async fnameAvailability(fname: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.fnameAvailability(fname, options); + async isFnameAvailable(fname: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.isFnameAvailable(fname, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['FnameApi.fnameAvailability']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['FnameApi.isFnameAvailable']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } @@ -107,33 +115,79 @@ export const FnameApiFactory = function (configuration?: Configuration, basePath /** * Check if a given fname is available * @summary Check fname availability - * @param {string} fname + * @param {FnameApiIsFnameAvailableRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FnameAvailabilityResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/is-fname-available) + * */ - fnameAvailability(fname: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.fnameAvailability(fname, options).then((request) => request(axios, basePath)); + isFnameAvailable(requestParameters: FnameApiIsFnameAvailableRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.isFnameAvailable(requestParameters.fname, options).then((request) => request(axios, basePath)); }, }; }; +/** + * FnameApi - interface + * @export + * @interface FnameApi + */ +export interface FnameApiInterface { + /** + * Check if a given fname is available + * @summary Check fname availability + * @param {FnameApiIsFnameAvailableRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FnameApiInterface + * @returns {Promise} A promise that resolves to a `FnameAvailabilityResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/is-fname-available) + * + */ + isFnameAvailable(requestParameters: FnameApiIsFnameAvailableRequest, options?: RawAxiosRequestConfig): AxiosPromise; + +} + +/** + * Request parameters for isFnameAvailable operation in FnameApi. + * @export + * @interface FnameApiIsFnameAvailableRequest + */ +export interface FnameApiIsFnameAvailableRequest { + /** + * + * + * + * @type {string} + * @memberof FnameApiIsFnameAvailable + */ + readonly fname: string +} + /** * FnameApi - object-oriented interface * @export * @class FnameApi * @extends {BaseAPI} */ -export class FnameApi extends BaseAPI { +export class FnameApi extends BaseAPI implements FnameApiInterface { /** * Check if a given fname is available * @summary Check fname availability - * @param {string} fname + * @param {FnameApiIsFnameAvailableRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FnameApi + * @returns {Promise} A promise that resolves to a `FnameAvailabilityResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/is-fname-available) + * */ - public fnameAvailability(fname: string, options?: RawAxiosRequestConfig) { - return FnameApiFp(this.configuration).fnameAvailability(fname, options).then((request) => request(this.axios, this.basePath)); + public isFnameAvailable(requestParameters: FnameApiIsFnameAvailableRequest, options?: RawAxiosRequestConfig) { + return FnameApiFp(this.configuration).isFnameAvailable(requestParameters.fname, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/src/neynar-api/v2/openapi-farcaster/apis/follows-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/follows-api.ts index 87aba065..79796a4f 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/follows-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/follows-api.ts @@ -38,20 +38,22 @@ import type { UsersResponse } from '../models'; export const FollowsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** - * Returns a list of followers for a specific FID. - * @summary Followers - * @param {number} fid User who\'s profile you are looking at - * @param {number} [viewerFid] Providing this will return a list of followers that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {FollowSortType} [sortType] Sort type for fetch followers. Default is `desc_chron` - * @param {number} [limit] Number of results to fetch (default 20, max 100) - * @param {string} [cursor] Pagination cursor. + * Fetch a list of suggested users to follow. Used to help users discover new users to follow + * @summary Suggest Follows + * @param {number} fid FID of the user whose following you want to fetch. + * @param {number} [viewer_fid] Providing this will return a list of users that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100) * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `UsersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-follow-suggestions) + * */ - followersV2: async (fid: number, viewerFid?: number, sortType?: FollowSortType, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { + fetchFollowSuggestions: async (fid: number, viewer_fid?: number, limit?: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'fid' is not null or undefined - assertParamExists('followersV2', 'fid', fid) - const localVarPath = `/farcaster/followers`; + assertParamExists('fetchFollowSuggestions', 'fid', fid) + const localVarPath = `/farcaster/following/suggested`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -70,22 +72,14 @@ export const FollowsApiAxiosParamCreator = function (configuration?: Configurati localVarQueryParameter['fid'] = fid; } - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; - } - - if (sortType !== undefined) { - localVarQueryParameter['sort_type'] = sortType; + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; - } - setSearchParams(localVarUrlObj, localVarQueryParameter); @@ -98,20 +92,23 @@ export const FollowsApiAxiosParamCreator = function (configuration?: Configurati }; }, /** - * Fetch a list of users followed by a user. Can optionally include a viewer_fid and sort_type. - * @summary Followed by - * @param {number} fid FID of the user whose following you want to fetch. - * @param {number} [viewerFid] Providing this will return a list of users that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {FollowSortType} [sortType] Optional parameter to sort the users based on different criteria. - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. + * Returns a list of relevant followers for a specific FID. This usually shows on a profile as \"X, Y and Z follow this user\". + * @summary Relevant followers + * @param {number} target_fid User who\'s profile you are looking at + * @param {number} viewer_fid The FID of the user to customize this response for. Providing this will also return a list of followers that respects this user\'s mutes and blocks and includes `viewer_context`. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `RelevantFollowersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-relevant-followers) + * */ - followingV2: async (fid: number, viewerFid?: number, sortType?: FollowSortType, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'fid' is not null or undefined - assertParamExists('followingV2', 'fid', fid) - const localVarPath = `/farcaster/following`; + fetchRelevantFollowers: async (target_fid: number, viewer_fid: number, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'target_fid' is not null or undefined + assertParamExists('fetchRelevantFollowers', 'target_fid', target_fid) + // verify required parameter 'viewer_fid' is not null or undefined + assertParamExists('fetchRelevantFollowers', 'viewer_fid', viewer_fid) + const localVarPath = `/farcaster/followers/relevant`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -126,24 +123,12 @@ export const FollowsApiAxiosParamCreator = function (configuration?: Configurati // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (fid !== undefined) { - localVarQueryParameter['fid'] = fid; - } - - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; + if (target_fid !== undefined) { + localVarQueryParameter['target_fid'] = target_fid; } - if (sortType !== undefined) { - localVarQueryParameter['sort_type'] = sortType; - } - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; } @@ -158,19 +143,24 @@ export const FollowsApiAxiosParamCreator = function (configuration?: Configurati }; }, /** - * Returns a list of relevant followers for a specific FID. This usually shows on a profile as \"X, Y and Z follow this user\". - * @summary Relevant followers - * @param {number} targetFid User who\'s profile you are looking at - * @param {number} viewerFid The FID of the user to customize this response for. Providing this will also return a list of followers that respects this user\'s mutes and blocks and includes `viewer_context`. + * Returns a list of followers for a specific FID. + * @summary Followers + * @param {number} fid User who\'s profile you are looking at + * @param {number} [viewer_fid] Providing this will return a list of followers that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {FollowSortType} [sort_type] Sort type for fetch followers. Default is `desc_chron` + * @param {number} [limit] Number of results to fetch (Default: 20, Maximum: 100) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FollowersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-followers) + * */ - relevantFollowers: async (targetFid: number, viewerFid: number, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'targetFid' is not null or undefined - assertParamExists('relevantFollowers', 'targetFid', targetFid) - // verify required parameter 'viewerFid' is not null or undefined - assertParamExists('relevantFollowers', 'viewerFid', viewerFid) - const localVarPath = `/farcaster/followers/relevant`; + fetchUserFollowers: async (fid: number, viewer_fid?: number, sort_type?: FollowSortType, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'fid' is not null or undefined + assertParamExists('fetchUserFollowers', 'fid', fid) + const localVarPath = `/farcaster/followers`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -185,12 +175,24 @@ export const FollowsApiAxiosParamCreator = function (configuration?: Configurati // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (targetFid !== undefined) { - localVarQueryParameter['target_fid'] = targetFid; + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } + + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; + } + + if (sort_type !== undefined) { + localVarQueryParameter['sort_type'] = sort_type; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; } - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; } @@ -205,18 +207,24 @@ export const FollowsApiAxiosParamCreator = function (configuration?: Configurati }; }, /** - * Fetch a list of suggested users to follow. Used to help users discover new users to follow - * @summary Suggest Follows - * @param {number} fid FID of the user whose following you want to fetch. - * @param {number} [viewerFid] Providing this will return a list of users that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {number} [limit] Number of results to fetch (default 25, max 100) + * Fetch a list of users followed by a user. Can optionally include a viewer_fid and sort_type. + * @summary Followed by + * @param {number} fid FID of the user whose following you want to fetch. + * @param {number} [viewer_fid] Providing this will return a list of users that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {FollowSortType} [sort_type] Optional parameter to sort the users based on different criteria. + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FollowersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-following) + * */ - suggestedFollows: async (fid: number, viewerFid?: number, limit?: number, options: RawAxiosRequestConfig = {}): Promise => { + fetchUserFollowing: async (fid: number, viewer_fid?: number, sort_type?: FollowSortType, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'fid' is not null or undefined - assertParamExists('suggestedFollows', 'fid', fid) - const localVarPath = `/farcaster/following/suggested`; + assertParamExists('fetchUserFollowing', 'fid', fid) + const localVarPath = `/farcaster/following`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -235,14 +243,22 @@ export const FollowsApiAxiosParamCreator = function (configuration?: Configurati localVarQueryParameter['fid'] = fid; } - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; + } + + if (sort_type !== undefined) { + localVarQueryParameter['sort_type'] = sort_type; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); @@ -265,66 +281,82 @@ export const FollowsApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = FollowsApiAxiosParamCreator(configuration) return { /** - * Returns a list of followers for a specific FID. - * @summary Followers - * @param {number} fid User who\'s profile you are looking at - * @param {number} [viewerFid] Providing this will return a list of followers that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {FollowSortType} [sortType] Sort type for fetch followers. Default is `desc_chron` - * @param {number} [limit] Number of results to fetch (default 20, max 100) - * @param {string} [cursor] Pagination cursor. + * Fetch a list of suggested users to follow. Used to help users discover new users to follow + * @summary Suggest Follows + * @param {number} fid FID of the user whose following you want to fetch. + * @param {number} [viewer_fid] Providing this will return a list of users that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100) * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `UsersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-follow-suggestions) + * */ - async followersV2(fid: number, viewerFid?: number, sortType?: FollowSortType, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.followersV2(fid, viewerFid, sortType, limit, cursor, options); + async fetchFollowSuggestions(fid: number, viewer_fid?: number, limit?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchFollowSuggestions(fid, viewer_fid, limit, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['FollowsApi.followersV2']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['FollowsApi.fetchFollowSuggestions']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Fetch a list of users followed by a user. Can optionally include a viewer_fid and sort_type. - * @summary Followed by - * @param {number} fid FID of the user whose following you want to fetch. - * @param {number} [viewerFid] Providing this will return a list of users that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {FollowSortType} [sortType] Optional parameter to sort the users based on different criteria. - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. + * Returns a list of relevant followers for a specific FID. This usually shows on a profile as \"X, Y and Z follow this user\". + * @summary Relevant followers + * @param {number} target_fid User who\'s profile you are looking at + * @param {number} viewer_fid The FID of the user to customize this response for. Providing this will also return a list of followers that respects this user\'s mutes and blocks and includes `viewer_context`. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `RelevantFollowersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-relevant-followers) + * */ - async followingV2(fid: number, viewerFid?: number, sortType?: FollowSortType, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.followingV2(fid, viewerFid, sortType, limit, cursor, options); + async fetchRelevantFollowers(target_fid: number, viewer_fid: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchRelevantFollowers(target_fid, viewer_fid, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['FollowsApi.followingV2']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['FollowsApi.fetchRelevantFollowers']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Returns a list of relevant followers for a specific FID. This usually shows on a profile as \"X, Y and Z follow this user\". - * @summary Relevant followers - * @param {number} targetFid User who\'s profile you are looking at - * @param {number} viewerFid The FID of the user to customize this response for. Providing this will also return a list of followers that respects this user\'s mutes and blocks and includes `viewer_context`. + * Returns a list of followers for a specific FID. + * @summary Followers + * @param {number} fid User who\'s profile you are looking at + * @param {number} [viewer_fid] Providing this will return a list of followers that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {FollowSortType} [sort_type] Sort type for fetch followers. Default is `desc_chron` + * @param {number} [limit] Number of results to fetch (Default: 20, Maximum: 100) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FollowersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-followers) + * */ - async relevantFollowers(targetFid: number, viewerFid: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.relevantFollowers(targetFid, viewerFid, options); + async fetchUserFollowers(fid: number, viewer_fid?: number, sort_type?: FollowSortType, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchUserFollowers(fid, viewer_fid, sort_type, limit, cursor, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['FollowsApi.relevantFollowers']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['FollowsApi.fetchUserFollowers']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Fetch a list of suggested users to follow. Used to help users discover new users to follow - * @summary Suggest Follows - * @param {number} fid FID of the user whose following you want to fetch. - * @param {number} [viewerFid] Providing this will return a list of users that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {number} [limit] Number of results to fetch (default 25, max 100) + * Fetch a list of users followed by a user. Can optionally include a viewer_fid and sort_type. + * @summary Followed by + * @param {number} fid FID of the user whose following you want to fetch. + * @param {number} [viewer_fid] Providing this will return a list of users that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {FollowSortType} [sort_type] Optional parameter to sort the users based on different criteria. + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FollowersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-following) + * */ - async suggestedFollows(fid: number, viewerFid?: number, limit?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.suggestedFollows(fid, viewerFid, limit, options); + async fetchUserFollowing(fid: number, viewer_fid?: number, sort_type?: FollowSortType, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchUserFollowing(fid, viewer_fid, sort_type, limit, cursor, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['FollowsApi.suggestedFollows']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['FollowsApi.fetchUserFollowing']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } @@ -338,123 +370,360 @@ export const FollowsApiFactory = function (configuration?: Configuration, basePa const localVarFp = FollowsApiFp(configuration) return { /** - * Returns a list of followers for a specific FID. - * @summary Followers - * @param {number} fid User who\'s profile you are looking at - * @param {number} [viewerFid] Providing this will return a list of followers that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {FollowSortType} [sortType] Sort type for fetch followers. Default is `desc_chron` - * @param {number} [limit] Number of results to fetch (default 20, max 100) - * @param {string} [cursor] Pagination cursor. + * Fetch a list of suggested users to follow. Used to help users discover new users to follow + * @summary Suggest Follows + * @param {FollowsApiFetchFollowSuggestionsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `UsersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-follow-suggestions) + * */ - followersV2(fid: number, viewerFid?: number, sortType?: FollowSortType, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.followersV2(fid, viewerFid, sortType, limit, cursor, options).then((request) => request(axios, basePath)); + fetchFollowSuggestions(requestParameters: FollowsApiFetchFollowSuggestionsRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchFollowSuggestions(requestParameters.fid, requestParameters.viewer_fid, requestParameters.limit, options).then((request) => request(axios, basePath)); }, /** - * Fetch a list of users followed by a user. Can optionally include a viewer_fid and sort_type. - * @summary Followed by - * @param {number} fid FID of the user whose following you want to fetch. - * @param {number} [viewerFid] Providing this will return a list of users that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {FollowSortType} [sortType] Optional parameter to sort the users based on different criteria. - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. + * Returns a list of relevant followers for a specific FID. This usually shows on a profile as \"X, Y and Z follow this user\". + * @summary Relevant followers + * @param {FollowsApiFetchRelevantFollowersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `RelevantFollowersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-relevant-followers) + * */ - followingV2(fid: number, viewerFid?: number, sortType?: FollowSortType, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.followingV2(fid, viewerFid, sortType, limit, cursor, options).then((request) => request(axios, basePath)); + fetchRelevantFollowers(requestParameters: FollowsApiFetchRelevantFollowersRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchRelevantFollowers(requestParameters.target_fid, requestParameters.viewer_fid, options).then((request) => request(axios, basePath)); }, /** - * Returns a list of relevant followers for a specific FID. This usually shows on a profile as \"X, Y and Z follow this user\". - * @summary Relevant followers - * @param {number} targetFid User who\'s profile you are looking at - * @param {number} viewerFid The FID of the user to customize this response for. Providing this will also return a list of followers that respects this user\'s mutes and blocks and includes `viewer_context`. + * Returns a list of followers for a specific FID. + * @summary Followers + * @param {FollowsApiFetchUserFollowersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FollowersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-followers) + * */ - relevantFollowers(targetFid: number, viewerFid: number, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.relevantFollowers(targetFid, viewerFid, options).then((request) => request(axios, basePath)); + fetchUserFollowers(requestParameters: FollowsApiFetchUserFollowersRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchUserFollowers(requestParameters.fid, requestParameters.viewer_fid, requestParameters.sort_type, requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath)); }, /** - * Fetch a list of suggested users to follow. Used to help users discover new users to follow - * @summary Suggest Follows - * @param {number} fid FID of the user whose following you want to fetch. - * @param {number} [viewerFid] Providing this will return a list of users that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {number} [limit] Number of results to fetch (default 25, max 100) + * Fetch a list of users followed by a user. Can optionally include a viewer_fid and sort_type. + * @summary Followed by + * @param {FollowsApiFetchUserFollowingRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FollowersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-following) + * */ - suggestedFollows(fid: number, viewerFid?: number, limit?: number, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.suggestedFollows(fid, viewerFid, limit, options).then((request) => request(axios, basePath)); + fetchUserFollowing(requestParameters: FollowsApiFetchUserFollowingRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchUserFollowing(requestParameters.fid, requestParameters.viewer_fid, requestParameters.sort_type, requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath)); }, }; }; /** - * FollowsApi - object-oriented interface + * FollowsApi - interface * @export - * @class FollowsApi - * @extends {BaseAPI} + * @interface FollowsApi */ -export class FollowsApi extends BaseAPI { +export interface FollowsApiInterface { + /** + * Fetch a list of suggested users to follow. Used to help users discover new users to follow + * @summary Suggest Follows + * @param {FollowsApiFetchFollowSuggestionsRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FollowsApiInterface + * @returns {Promise} A promise that resolves to a `UsersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-follow-suggestions) + * + */ + fetchFollowSuggestions(requestParameters: FollowsApiFetchFollowSuggestionsRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Returns a list of relevant followers for a specific FID. This usually shows on a profile as \"X, Y and Z follow this user\". + * @summary Relevant followers + * @param {FollowsApiFetchRelevantFollowersRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FollowsApiInterface + * @returns {Promise} A promise that resolves to a `RelevantFollowersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-relevant-followers) + * + */ + fetchRelevantFollowers(requestParameters: FollowsApiFetchRelevantFollowersRequest, options?: RawAxiosRequestConfig): AxiosPromise; + /** * Returns a list of followers for a specific FID. * @summary Followers - * @param {number} fid User who\'s profile you are looking at - * @param {number} [viewerFid] Providing this will return a list of followers that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {FollowSortType} [sortType] Sort type for fetch followers. Default is `desc_chron` - * @param {number} [limit] Number of results to fetch (default 20, max 100) - * @param {string} [cursor] Pagination cursor. + * @param {FollowsApiFetchUserFollowersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof FollowsApi + * @memberof FollowsApiInterface + * @returns {Promise} A promise that resolves to a `FollowersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-followers) + * */ - public followersV2(fid: number, viewerFid?: number, sortType?: FollowSortType, limit?: number, cursor?: string, options?: RawAxiosRequestConfig) { - return FollowsApiFp(this.configuration).followersV2(fid, viewerFid, sortType, limit, cursor, options).then((request) => request(this.axios, this.basePath)); - } + fetchUserFollowers(requestParameters: FollowsApiFetchUserFollowersRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Fetch a list of users followed by a user. Can optionally include a viewer_fid and sort_type. * @summary Followed by - * @param {number} fid FID of the user whose following you want to fetch. - * @param {number} [viewerFid] Providing this will return a list of users that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {FollowSortType} [sortType] Optional parameter to sort the users based on different criteria. - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. + * @param {FollowsApiFetchUserFollowingRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FollowsApiInterface + * @returns {Promise} A promise that resolves to a `FollowersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-following) + * + */ + fetchUserFollowing(requestParameters: FollowsApiFetchUserFollowingRequest, options?: RawAxiosRequestConfig): AxiosPromise; + +} + +/** + * Request parameters for fetchFollowSuggestions operation in FollowsApi. + * @export + * @interface FollowsApiFetchFollowSuggestionsRequest + */ +export interface FollowsApiFetchFollowSuggestionsRequest { + /** + * FID of the user whose following you want to fetch. + * + * + * @type {number} + * @memberof FollowsApiFetchFollowSuggestions + */ + readonly fid: number + + /** + * Providing this will return a list of users that respects this user\'s mutes and blocks and includes `viewer_context`. + * + * + * @type {number} + * @memberof FollowsApiFetchFollowSuggestions + */ + readonly viewer_fid?: number + + /** + * Number of results to fetch (Default: 25, Maximum: 100) + * + * + * @type {number} + * @memberof FollowsApiFetchFollowSuggestions + */ + readonly limit?: number +} + +/** + * Request parameters for fetchRelevantFollowers operation in FollowsApi. + * @export + * @interface FollowsApiFetchRelevantFollowersRequest + */ +export interface FollowsApiFetchRelevantFollowersRequest { + /** + * User who\'s profile you are looking at + * + * + * @type {number} + * @memberof FollowsApiFetchRelevantFollowers + */ + readonly target_fid: number + + /** + * The FID of the user to customize this response for. Providing this will also return a list of followers that respects this user\'s mutes and blocks and includes `viewer_context`. + * + * + * @type {number} + * @memberof FollowsApiFetchRelevantFollowers + */ + readonly viewer_fid: number +} + +/** + * Request parameters for fetchUserFollowers operation in FollowsApi. + * @export + * @interface FollowsApiFetchUserFollowersRequest + */ +export interface FollowsApiFetchUserFollowersRequest { + /** + * User who\'s profile you are looking at + * + * + * @type {number} + * @memberof FollowsApiFetchUserFollowers + */ + readonly fid: number + + /** + * Providing this will return a list of followers that respects this user\'s mutes and blocks and includes `viewer_context`. + * + * + * @type {number} + * @memberof FollowsApiFetchUserFollowers + */ + readonly viewer_fid?: number + + /** + * Sort type for fetch followers. Default is `desc_chron` + * + * + * @type {FollowSortType} + * @memberof FollowsApiFetchUserFollowers + */ + readonly sort_type?: FollowSortType + + /** + * Number of results to fetch (Default: 20, Maximum: 100) + * + * + * @type {number} + * @memberof FollowsApiFetchUserFollowers + */ + readonly limit?: number + + /** + * Pagination cursor. + * + * + * @type {string} + * @memberof FollowsApiFetchUserFollowers + */ + readonly cursor?: string +} + +/** + * Request parameters for fetchUserFollowing operation in FollowsApi. + * @export + * @interface FollowsApiFetchUserFollowingRequest + */ +export interface FollowsApiFetchUserFollowingRequest { + /** + * FID of the user whose following you want to fetch. + * + * + * @type {number} + * @memberof FollowsApiFetchUserFollowing + */ + readonly fid: number + + /** + * Providing this will return a list of users that respects this user\'s mutes and blocks and includes `viewer_context`. + * + * + * @type {number} + * @memberof FollowsApiFetchUserFollowing + */ + readonly viewer_fid?: number + + /** + * Optional parameter to sort the users based on different criteria. + * + * + * @type {FollowSortType} + * @memberof FollowsApiFetchUserFollowing + */ + readonly sort_type?: FollowSortType + + /** + * Number of results to fetch (Default: 25, Maximum: 100) + * + * + * @type {number} + * @memberof FollowsApiFetchUserFollowing + */ + readonly limit?: number + + /** + * Pagination cursor. + * + * + * @type {string} + * @memberof FollowsApiFetchUserFollowing + */ + readonly cursor?: string +} + +/** + * FollowsApi - object-oriented interface + * @export + * @class FollowsApi + * @extends {BaseAPI} + */ +export class FollowsApi extends BaseAPI implements FollowsApiInterface { + /** + * Fetch a list of suggested users to follow. Used to help users discover new users to follow + * @summary Suggest Follows + * @param {FollowsApiFetchFollowSuggestionsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FollowsApi + * @returns {Promise} A promise that resolves to a `UsersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-follow-suggestions) + * */ - public followingV2(fid: number, viewerFid?: number, sortType?: FollowSortType, limit?: number, cursor?: string, options?: RawAxiosRequestConfig) { - return FollowsApiFp(this.configuration).followingV2(fid, viewerFid, sortType, limit, cursor, options).then((request) => request(this.axios, this.basePath)); + public fetchFollowSuggestions(requestParameters: FollowsApiFetchFollowSuggestionsRequest, options?: RawAxiosRequestConfig) { + return FollowsApiFp(this.configuration).fetchFollowSuggestions(requestParameters.fid, requestParameters.viewer_fid, requestParameters.limit, options).then((request) => request(this.axios, this.basePath)); } /** * Returns a list of relevant followers for a specific FID. This usually shows on a profile as \"X, Y and Z follow this user\". * @summary Relevant followers - * @param {number} targetFid User who\'s profile you are looking at - * @param {number} viewerFid The FID of the user to customize this response for. Providing this will also return a list of followers that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {FollowsApiFetchRelevantFollowersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FollowsApi + * @returns {Promise} A promise that resolves to a `RelevantFollowersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-relevant-followers) + * */ - public relevantFollowers(targetFid: number, viewerFid: number, options?: RawAxiosRequestConfig) { - return FollowsApiFp(this.configuration).relevantFollowers(targetFid, viewerFid, options).then((request) => request(this.axios, this.basePath)); + public fetchRelevantFollowers(requestParameters: FollowsApiFetchRelevantFollowersRequest, options?: RawAxiosRequestConfig) { + return FollowsApiFp(this.configuration).fetchRelevantFollowers(requestParameters.target_fid, requestParameters.viewer_fid, options).then((request) => request(this.axios, this.basePath)); } /** - * Fetch a list of suggested users to follow. Used to help users discover new users to follow - * @summary Suggest Follows - * @param {number} fid FID of the user whose following you want to fetch. - * @param {number} [viewerFid] Providing this will return a list of users that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {number} [limit] Number of results to fetch (default 25, max 100) + * Returns a list of followers for a specific FID. + * @summary Followers + * @param {FollowsApiFetchUserFollowersRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FollowsApi + * @returns {Promise} A promise that resolves to a `FollowersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-followers) + * + */ + public fetchUserFollowers(requestParameters: FollowsApiFetchUserFollowersRequest, options?: RawAxiosRequestConfig) { + return FollowsApiFp(this.configuration).fetchUserFollowers(requestParameters.fid, requestParameters.viewer_fid, requestParameters.sort_type, requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Fetch a list of users followed by a user. Can optionally include a viewer_fid and sort_type. + * @summary Followed by + * @param {FollowsApiFetchUserFollowingRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FollowsApi + * @returns {Promise} A promise that resolves to a `FollowersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-following) + * */ - public suggestedFollows(fid: number, viewerFid?: number, limit?: number, options?: RawAxiosRequestConfig) { - return FollowsApiFp(this.configuration).suggestedFollows(fid, viewerFid, limit, options).then((request) => request(this.axios, this.basePath)); + public fetchUserFollowing(requestParameters: FollowsApiFetchUserFollowingRequest, options?: RawAxiosRequestConfig) { + return FollowsApiFp(this.configuration).fetchUserFollowing(requestParameters.fid, requestParameters.viewer_fid, requestParameters.sort_type, requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/src/neynar-api/v2/openapi-farcaster/apis/frame-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/frame-api.ts index b7dcb797..cfbbf503 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/frame-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/frame-api.ts @@ -22,20 +22,20 @@ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObj // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore -import type { DeleteFrameResponse } from '../models'; +import type { DeleteFrameReqBody } from '../models'; // @ts-ignore -import type { DeleteNeynarFrameRequest } from '../models'; +import type { DeleteFrameResponse } from '../models'; // @ts-ignore import type { ErrorRes } from '../models'; // @ts-ignore +import type { FetchFrameMetaTagsFromUrl200Response } from '../models'; +// @ts-ignore import type { Frame } from '../models'; // @ts-ignore import type { FrameActionReqBody } from '../models'; // @ts-ignore import type { FrameDeveloperManagedActionReqBody } from '../models'; // @ts-ignore -import type { FrameFromUrl200Response } from '../models'; -// @ts-ignore import type { FrameType } from '../models'; // @ts-ignore import type { FrameValidateAnalyticsResponse } from '../models'; @@ -44,15 +44,15 @@ import type { FrameValidateListResponse } from '../models'; // @ts-ignore import type { NeynarFrame } from '../models'; // @ts-ignore -import type { NeynarFrameCreationRequest } from '../models'; +import type { NeynarFrameCreationReqBody } from '../models'; // @ts-ignore -import type { NeynarFrameUpdateRequest } from '../models'; +import type { NeynarFrameUpdateReqBody } from '../models'; +// @ts-ignore +import type { ValidateFrameActionReqBody } from '../models'; // @ts-ignore import type { ValidateFrameActionResponse } from '../models'; // @ts-ignore import type { ValidateFrameAnalyticsType } from '../models'; -// @ts-ignore -import type { ValidateFrameRequest } from '../models'; /** * FrameApi - axios parameter creator * @export @@ -62,13 +62,17 @@ export const FrameApiAxiosParamCreator = function (configuration?: Configuration /** * Delete an existing frame, if it was made by the developer (identified by API key) * @summary Delete frame - * @param {DeleteNeynarFrameRequest} deleteNeynarFrameRequest + * @param {DeleteFrameReqBody} delete_frame_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `DeleteFrameResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-neynar-frame) + * */ - deleteNeynarFrame: async (deleteNeynarFrameRequest: DeleteNeynarFrameRequest, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'deleteNeynarFrameRequest' is not null or undefined - assertParamExists('deleteNeynarFrame', 'deleteNeynarFrameRequest', deleteNeynarFrameRequest) + deleteNeynarFrame: async (delete_frame_req_body: DeleteFrameReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'delete_frame_req_body' is not null or undefined + assertParamExists('deleteNeynarFrame', 'delete_frame_req_body', delete_frame_req_body) const localVarPath = `/farcaster/frame`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -91,7 +95,7 @@ export const FrameApiAxiosParamCreator = function (configuration?: Configuration setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(deleteNeynarFrameRequest, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(delete_frame_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -99,13 +103,20 @@ export const FrameApiAxiosParamCreator = function (configuration?: Configuration }; }, /** - * Fetch a list of frames made by the developer (identified by API key) - * @summary List of frames + * Fetches the frame meta tags from the URL + * @summary Meta tags from URL + * @param {string} url The frame URL to crawl * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FetchFrameMetaTagsFromUrl200Response` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-frame-meta-tags-from-url) + * */ - fetchNeynarFrames: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/farcaster/frame/list`; + fetchFrameMetaTagsFromUrl: async (url: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'url' is not null or undefined + assertParamExists('fetchFrameMetaTagsFromUrl', 'url', url) + const localVarPath = `/farcaster/frame/crawl`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -120,6 +131,10 @@ export const FrameApiAxiosParamCreator = function (configuration?: Configuration // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) + if (url !== undefined) { + localVarQueryParameter['url'] = url; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); @@ -132,16 +147,17 @@ export const FrameApiAxiosParamCreator = function (configuration?: Configuration }; }, /** - * Fetches the frame meta tags from the URL - * @summary Meta tags from URL - * @param {string} url The frame URL to crawl + * Fetch a list of frames made by the developer (identified by API key) + * @summary List of frames * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise>} A promise that resolves to a `Array` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-neynar-frames) + * */ - frameFromUrl: async (url: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'url' is not null or undefined - assertParamExists('frameFromUrl', 'url', url) - const localVarPath = `/farcaster/frame/crawl`; + fetchNeynarFrames: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/farcaster/frame/list`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -156,10 +172,6 @@ export const FrameApiAxiosParamCreator = function (configuration?: Configuration // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (url !== undefined) { - localVarQueryParameter['url'] = url; - } - setSearchParams(localVarUrlObj, localVarQueryParameter); @@ -172,18 +184,30 @@ export const FrameApiAxiosParamCreator = function (configuration?: Configuration }; }, /** - * Fetch a frame either by UUID or Neynar URL - * @summary Frame by UUID or URL - * @param {FrameType} type - * @param {string} [uuid] UUID of the frame to fetch - * @param {string} [url] URL of the Neynar frame to fetch + * Fetch analytics for total-interactors, interactors, nteractions-per-cast and input-text. + * @summary Analytics for the frame + * @param {string} frame_url + * @param {ValidateFrameAnalyticsType} analytics_type + * @param {string} start + * @param {string} stop + * @param {FetchValidateFrameAnalyticsAggregateWindowEnum} [aggregate_window] Required for `analytics_type=interactions-per-cast` * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FrameValidateAnalyticsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-validate-frame-analytics) + * */ - lookupNeynarFrame: async (type: FrameType, uuid?: string, url?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'type' is not null or undefined - assertParamExists('lookupNeynarFrame', 'type', type) - const localVarPath = `/farcaster/frame`; + fetchValidateFrameAnalytics: async (frame_url: string, analytics_type: ValidateFrameAnalyticsType, start: string, stop: string, aggregate_window?: FetchValidateFrameAnalyticsAggregateWindowEnum, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'frame_url' is not null or undefined + assertParamExists('fetchValidateFrameAnalytics', 'frame_url', frame_url) + // verify required parameter 'analytics_type' is not null or undefined + assertParamExists('fetchValidateFrameAnalytics', 'analytics_type', analytics_type) + // verify required parameter 'start' is not null or undefined + assertParamExists('fetchValidateFrameAnalytics', 'start', start) + // verify required parameter 'stop' is not null or undefined + assertParamExists('fetchValidateFrameAnalytics', 'stop', stop) + const localVarPath = `/farcaster/frame/validate/analytics`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -198,16 +222,28 @@ export const FrameApiAxiosParamCreator = function (configuration?: Configuration // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (type !== undefined) { - localVarQueryParameter['type'] = type; + if (frame_url !== undefined) { + localVarQueryParameter['frame_url'] = frame_url; } - if (uuid !== undefined) { - localVarQueryParameter['uuid'] = uuid; + if (analytics_type !== undefined) { + localVarQueryParameter['analytics_type'] = analytics_type; } - if (url !== undefined) { - localVarQueryParameter['url'] = url; + if (start !== undefined) { + localVarQueryParameter['start'] = (start as any instanceof Date) ? + (start as any).toISOString() : + start; + } + + if (stop !== undefined) { + localVarQueryParameter['stop'] = (stop as any instanceof Date) ? + (stop as any).toISOString() : + stop; + } + + if (aggregate_window !== undefined) { + localVarQueryParameter['aggregate_window'] = aggregate_window; } @@ -222,16 +258,17 @@ export const FrameApiAxiosParamCreator = function (configuration?: Configuration }; }, /** - * Post frame actions, cast actions or cast composer actions to the server \\ (In order to post any of these actions, you need to have an approved `signer_uuid`) The POST request to the post_url has a timeout of 5 seconds for frames. - * @summary Post a frame action, cast action or a cast composer action - * @param {FrameActionReqBody} frameActionReqBody + * Fetch a list of all the frames validated by a user + * @summary All frames validated by user * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FrameValidateListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-validate-frame-list) + * */ - postFrameAction: async (frameActionReqBody: FrameActionReqBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'frameActionReqBody' is not null or undefined - assertParamExists('postFrameAction', 'frameActionReqBody', frameActionReqBody) - const localVarPath = `/farcaster/frame/action`; + fetchValidateFrameList: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/farcaster/frame/validate/list`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -239,7 +276,7 @@ export const FrameApiAxiosParamCreator = function (configuration?: Configuration baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -248,12 +285,9 @@ export const FrameApiAxiosParamCreator = function (configuration?: Configuration - localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(frameActionReqBody, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -261,16 +295,22 @@ export const FrameApiAxiosParamCreator = function (configuration?: Configuration }; }, /** - * Post a frame action that has been signed with a developer managed signer The POST request to the post_url has a timeout of 5 seconds. - * @summary Signature packet - * @param {FrameDeveloperManagedActionReqBody} frameDeveloperManagedActionReqBody + * Fetch a frame either by UUID or Neynar URL + * @summary Frame by UUID or URL + * @param {FrameType} type + * @param {string} [uuid] UUID of the frame to fetch + * @param {string} [url] URL of the Neynar frame to fetch * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `NeynarFrame` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-neynar-frame) + * */ - postFrameDeveloperManagedAction: async (frameDeveloperManagedActionReqBody: FrameDeveloperManagedActionReqBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'frameDeveloperManagedActionReqBody' is not null or undefined - assertParamExists('postFrameDeveloperManagedAction', 'frameDeveloperManagedActionReqBody', frameDeveloperManagedActionReqBody) - const localVarPath = `/farcaster/frame/developer_managed/action`; + lookupNeynarFrame: async (type: FrameType, uuid?: string, url?: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'type' is not null or undefined + assertParamExists('lookupNeynarFrame', 'type', type) + const localVarPath = `/farcaster/frame`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -278,21 +318,30 @@ export const FrameApiAxiosParamCreator = function (configuration?: Configuration baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) + if (type !== undefined) { + localVarQueryParameter['type'] = type; + } + + if (uuid !== undefined) { + localVarQueryParameter['uuid'] = uuid; + } - - localVarHeaderParameter['Content-Type'] = 'application/json'; + if (url !== undefined) { + localVarQueryParameter['url'] = url; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(frameDeveloperManagedActionReqBody, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -300,16 +349,20 @@ export const FrameApiAxiosParamCreator = function (configuration?: Configuration }; }, /** - * Create a new frame with a list of pages. - * @summary Create frame - * @param {NeynarFrameCreationRequest} neynarFrameCreationRequest + * Post frame actions, cast actions or cast composer actions to the server \\ (In order to post any of these actions, you need to have an approved `signer_uuid`) The POST request to the post_url has a timeout of 5 seconds for frames. + * @summary Post a frame action, cast action or a cast composer action + * @param {FrameActionReqBody} frame_action_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `Frame` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/post-frame-action) + * */ - publishNeynarFrame: async (neynarFrameCreationRequest: NeynarFrameCreationRequest, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'neynarFrameCreationRequest' is not null or undefined - assertParamExists('publishNeynarFrame', 'neynarFrameCreationRequest', neynarFrameCreationRequest) - const localVarPath = `/farcaster/frame`; + postFrameAction: async (frame_action_req_body: FrameActionReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'frame_action_req_body' is not null or undefined + assertParamExists('postFrameAction', 'frame_action_req_body', frame_action_req_body) + const localVarPath = `/farcaster/frame/action`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -331,7 +384,7 @@ export const FrameApiAxiosParamCreator = function (configuration?: Configuration setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(neynarFrameCreationRequest, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(frame_action_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -339,16 +392,20 @@ export const FrameApiAxiosParamCreator = function (configuration?: Configuration }; }, /** - * Update an existing frame with a list of pages, if it was made by the developer (identified by API key) - * @summary Update frame - * @param {NeynarFrameUpdateRequest} neynarFrameUpdateRequest + * Post a frame action that has been signed with a developer managed signer The POST request to the post_url has a timeout of 5 seconds. + * @summary Signature packet + * @param {FrameDeveloperManagedActionReqBody} frame_developer_managed_action_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `Frame` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/post-frame-action-developer-managed) + * */ - updateNeynarFrame: async (neynarFrameUpdateRequest: NeynarFrameUpdateRequest, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'neynarFrameUpdateRequest' is not null or undefined - assertParamExists('updateNeynarFrame', 'neynarFrameUpdateRequest', neynarFrameUpdateRequest) - const localVarPath = `/farcaster/frame`; + postFrameActionDeveloperManaged: async (frame_developer_managed_action_req_body: FrameDeveloperManagedActionReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'frame_developer_managed_action_req_body' is not null or undefined + assertParamExists('postFrameActionDeveloperManaged', 'frame_developer_managed_action_req_body', frame_developer_managed_action_req_body) + const localVarPath = `/farcaster/frame/developer_managed/action`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -356,7 +413,7 @@ export const FrameApiAxiosParamCreator = function (configuration?: Configuration baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -370,7 +427,7 @@ export const FrameApiAxiosParamCreator = function (configuration?: Configuration setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(neynarFrameUpdateRequest, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(frame_developer_managed_action_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -378,16 +435,20 @@ export const FrameApiAxiosParamCreator = function (configuration?: Configuration }; }, /** - * Validates a frame against by an interacting user against a Farcaster Hub \\ (In order to validate a frame, message bytes from Frame Action must be provided in hex) - * @summary Validate frame action - * @param {ValidateFrameRequest} validateFrameRequest + * Create a new frame with a list of pages. + * @summary Create frame + * @param {NeynarFrameCreationReqBody} neynar_frame_creation_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `NeynarFrame` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-neynar-frame) + * */ - validateFrame: async (validateFrameRequest: ValidateFrameRequest, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'validateFrameRequest' is not null or undefined - assertParamExists('validateFrame', 'validateFrameRequest', validateFrameRequest) - const localVarPath = `/farcaster/frame/validate`; + publishNeynarFrame: async (neynar_frame_creation_req_body: NeynarFrameCreationReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'neynar_frame_creation_req_body' is not null or undefined + assertParamExists('publishNeynarFrame', 'neynar_frame_creation_req_body', neynar_frame_creation_req_body) + const localVarPath = `/farcaster/frame`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -409,7 +470,7 @@ export const FrameApiAxiosParamCreator = function (configuration?: Configuration setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(validateFrameRequest, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(neynar_frame_creation_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -417,26 +478,20 @@ export const FrameApiAxiosParamCreator = function (configuration?: Configuration }; }, /** - * Fetch analytics for total-interactors, interactors, nteractions-per-cast and input-text. - * @summary Analytics for the frame - * @param {string} frameUrl - * @param {ValidateFrameAnalyticsType} analyticsType - * @param {string} start - * @param {string} stop - * @param {ValidateFrameAnalyticsAggregateWindowEnum} [aggregateWindow] Required for `analytics_type=interactions-per-cast` + * Update an existing frame with a list of pages, if it was made by the developer (identified by API key) + * @summary Update frame + * @param {NeynarFrameUpdateReqBody} neynar_frame_update_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `NeynarFrame` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/update-neynar-frame) + * */ - validateFrameAnalytics: async (frameUrl: string, analyticsType: ValidateFrameAnalyticsType, start: string, stop: string, aggregateWindow?: ValidateFrameAnalyticsAggregateWindowEnum, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'frameUrl' is not null or undefined - assertParamExists('validateFrameAnalytics', 'frameUrl', frameUrl) - // verify required parameter 'analyticsType' is not null or undefined - assertParamExists('validateFrameAnalytics', 'analyticsType', analyticsType) - // verify required parameter 'start' is not null or undefined - assertParamExists('validateFrameAnalytics', 'start', start) - // verify required parameter 'stop' is not null or undefined - assertParamExists('validateFrameAnalytics', 'stop', stop) - const localVarPath = `/farcaster/frame/validate/analytics`; + updateNeynarFrame: async (neynar_frame_update_req_body: NeynarFrameUpdateReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'neynar_frame_update_req_body' is not null or undefined + assertParamExists('updateNeynarFrame', 'neynar_frame_update_req_body', neynar_frame_update_req_body) + const localVarPath = `/farcaster/frame`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -444,42 +499,21 @@ export const FrameApiAxiosParamCreator = function (configuration?: Configuration baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (frameUrl !== undefined) { - localVarQueryParameter['frame_url'] = frameUrl; - } - - if (analyticsType !== undefined) { - localVarQueryParameter['analytics_type'] = analyticsType; - } - - if (start !== undefined) { - localVarQueryParameter['start'] = (start as any instanceof Date) ? - (start as any).toISOString() : - start; - } - - if (stop !== undefined) { - localVarQueryParameter['stop'] = (stop as any instanceof Date) ? - (stop as any).toISOString() : - stop; - } - - if (aggregateWindow !== undefined) { - localVarQueryParameter['aggregate_window'] = aggregateWindow; - } - + localVarHeaderParameter['Content-Type'] = 'application/json'; + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(neynar_frame_update_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -487,13 +521,20 @@ export const FrameApiAxiosParamCreator = function (configuration?: Configuration }; }, /** - * Fetch a list of all the frames validated by a user - * @summary All frames validated by user + * Validates a frame against by an interacting user against a Farcaster Hub \\ (In order to validate a frame, message bytes from Frame Action must be provided in hex) + * @summary Validate frame action + * @param {ValidateFrameActionReqBody} validate_frame_action_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ValidateFrameActionResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/validate-frame-action) + * */ - validateFrameList: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/farcaster/frame/validate/list`; + validateFrameAction: async (validate_frame_action_req_body: ValidateFrameActionReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'validate_frame_action_req_body' is not null or undefined + assertParamExists('validateFrameAction', 'validate_frame_action_req_body', validate_frame_action_req_body) + const localVarPath = `/farcaster/frame/validate`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -501,7 +542,7 @@ export const FrameApiAxiosParamCreator = function (configuration?: Configuration baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -510,9 +551,12 @@ export const FrameApiAxiosParamCreator = function (configuration?: Configuration + localVarHeaderParameter['Content-Type'] = 'application/json'; + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(validate_frame_action_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -532,21 +576,46 @@ export const FrameApiFp = function(configuration?: Configuration) { /** * Delete an existing frame, if it was made by the developer (identified by API key) * @summary Delete frame - * @param {DeleteNeynarFrameRequest} deleteNeynarFrameRequest + * @param {DeleteFrameReqBody} delete_frame_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `DeleteFrameResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-neynar-frame) + * */ - async deleteNeynarFrame(deleteNeynarFrameRequest: DeleteNeynarFrameRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteNeynarFrame(deleteNeynarFrameRequest, options); + async deleteNeynarFrame(delete_frame_req_body: DeleteFrameReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteNeynarFrame(delete_frame_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['FrameApi.deleteNeynarFrame']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, + /** + * Fetches the frame meta tags from the URL + * @summary Meta tags from URL + * @param {string} url The frame URL to crawl + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FetchFrameMetaTagsFromUrl200Response` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-frame-meta-tags-from-url) + * + */ + async fetchFrameMetaTagsFromUrl(url: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchFrameMetaTagsFromUrl(url, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['FrameApi.fetchFrameMetaTagsFromUrl']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, /** * Fetch a list of frames made by the developer (identified by API key) * @summary List of frames * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise>} A promise that resolves to a `Array` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-neynar-frames) + * */ async fetchNeynarFrames(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.fetchNeynarFrames(options); @@ -555,26 +624,54 @@ export const FrameApiFp = function(configuration?: Configuration) { return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Fetches the frame meta tags from the URL - * @summary Meta tags from URL - * @param {string} url The frame URL to crawl + * Fetch analytics for total-interactors, interactors, nteractions-per-cast and input-text. + * @summary Analytics for the frame + * @param {string} frame_url + * @param {ValidateFrameAnalyticsType} analytics_type + * @param {string} start + * @param {string} stop + * @param {FetchValidateFrameAnalyticsAggregateWindowEnum} [aggregate_window] Required for `analytics_type=interactions-per-cast` + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FrameValidateAnalyticsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-validate-frame-analytics) + * + */ + async fetchValidateFrameAnalytics(frame_url: string, analytics_type: ValidateFrameAnalyticsType, start: string, stop: string, aggregate_window?: FetchValidateFrameAnalyticsAggregateWindowEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchValidateFrameAnalytics(frame_url, analytics_type, start, stop, aggregate_window, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['FrameApi.fetchValidateFrameAnalytics']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Fetch a list of all the frames validated by a user + * @summary All frames validated by user * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FrameValidateListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-validate-frame-list) + * */ - async frameFromUrl(url: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.frameFromUrl(url, options); + async fetchValidateFrameList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchValidateFrameList(options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['FrameApi.frameFromUrl']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['FrameApi.fetchValidateFrameList']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Fetch a frame either by UUID or Neynar URL * @summary Frame by UUID or URL - * @param {FrameType} type - * @param {string} [uuid] UUID of the frame to fetch - * @param {string} [url] URL of the Neynar frame to fetch + * @param {FrameType} type + * @param {string} [uuid] UUID of the frame to fetch + * @param {string} [url] URL of the Neynar frame to fetch * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `NeynarFrame` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-neynar-frame) + * */ async lookupNeynarFrame(type: FrameType, uuid?: string, url?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.lookupNeynarFrame(type, uuid, url, options); @@ -585,12 +682,16 @@ export const FrameApiFp = function(configuration?: Configuration) { /** * Post frame actions, cast actions or cast composer actions to the server \\ (In order to post any of these actions, you need to have an approved `signer_uuid`) The POST request to the post_url has a timeout of 5 seconds for frames. * @summary Post a frame action, cast action or a cast composer action - * @param {FrameActionReqBody} frameActionReqBody + * @param {FrameActionReqBody} frame_action_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `Frame` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/post-frame-action) + * */ - async postFrameAction(frameActionReqBody: FrameActionReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.postFrameAction(frameActionReqBody, options); + async postFrameAction(frame_action_req_body: FrameActionReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.postFrameAction(frame_action_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['FrameApi.postFrameAction']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); @@ -598,25 +699,33 @@ export const FrameApiFp = function(configuration?: Configuration) { /** * Post a frame action that has been signed with a developer managed signer The POST request to the post_url has a timeout of 5 seconds. * @summary Signature packet - * @param {FrameDeveloperManagedActionReqBody} frameDeveloperManagedActionReqBody + * @param {FrameDeveloperManagedActionReqBody} frame_developer_managed_action_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `Frame` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/post-frame-action-developer-managed) + * */ - async postFrameDeveloperManagedAction(frameDeveloperManagedActionReqBody: FrameDeveloperManagedActionReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.postFrameDeveloperManagedAction(frameDeveloperManagedActionReqBody, options); + async postFrameActionDeveloperManaged(frame_developer_managed_action_req_body: FrameDeveloperManagedActionReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.postFrameActionDeveloperManaged(frame_developer_managed_action_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['FrameApi.postFrameDeveloperManagedAction']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['FrameApi.postFrameActionDeveloperManaged']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Create a new frame with a list of pages. * @summary Create frame - * @param {NeynarFrameCreationRequest} neynarFrameCreationRequest + * @param {NeynarFrameCreationReqBody} neynar_frame_creation_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `NeynarFrame` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-neynar-frame) + * */ - async publishNeynarFrame(neynarFrameCreationRequest: NeynarFrameCreationRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.publishNeynarFrame(neynarFrameCreationRequest, options); + async publishNeynarFrame(neynar_frame_creation_req_body: NeynarFrameCreationReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.publishNeynarFrame(neynar_frame_creation_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['FrameApi.publishNeynarFrame']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); @@ -624,12 +733,16 @@ export const FrameApiFp = function(configuration?: Configuration) { /** * Update an existing frame with a list of pages, if it was made by the developer (identified by API key) * @summary Update frame - * @param {NeynarFrameUpdateRequest} neynarFrameUpdateRequest + * @param {NeynarFrameUpdateReqBody} neynar_frame_update_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `NeynarFrame` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/update-neynar-frame) + * */ - async updateNeynarFrame(neynarFrameUpdateRequest: NeynarFrameUpdateRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.updateNeynarFrame(neynarFrameUpdateRequest, options); + async updateNeynarFrame(neynar_frame_update_req_body: NeynarFrameUpdateReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateNeynarFrame(neynar_frame_update_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['FrameApi.updateNeynarFrame']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); @@ -637,43 +750,18 @@ export const FrameApiFp = function(configuration?: Configuration) { /** * Validates a frame against by an interacting user against a Farcaster Hub \\ (In order to validate a frame, message bytes from Frame Action must be provided in hex) * @summary Validate frame action - * @param {ValidateFrameRequest} validateFrameRequest + * @param {ValidateFrameActionReqBody} validate_frame_action_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ValidateFrameActionResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/validate-frame-action) + * */ - async validateFrame(validateFrameRequest: ValidateFrameRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.validateFrame(validateFrameRequest, options); + async validateFrameAction(validate_frame_action_req_body: ValidateFrameActionReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.validateFrameAction(validate_frame_action_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['FrameApi.validateFrame']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Fetch analytics for total-interactors, interactors, nteractions-per-cast and input-text. - * @summary Analytics for the frame - * @param {string} frameUrl - * @param {ValidateFrameAnalyticsType} analyticsType - * @param {string} start - * @param {string} stop - * @param {ValidateFrameAnalyticsAggregateWindowEnum} [aggregateWindow] Required for `analytics_type=interactions-per-cast` - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async validateFrameAnalytics(frameUrl: string, analyticsType: ValidateFrameAnalyticsType, start: string, stop: string, aggregateWindow?: ValidateFrameAnalyticsAggregateWindowEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.validateFrameAnalytics(frameUrl, analyticsType, start, stop, aggregateWindow, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['FrameApi.validateFrameAnalytics']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Fetch a list of all the frames validated by a user - * @summary All frames validated by user - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async validateFrameList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.validateFrameList(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['FrameApi.validateFrameList']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['FrameApi.validateFrameAction']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } @@ -689,137 +777,553 @@ export const FrameApiFactory = function (configuration?: Configuration, basePath /** * Delete an existing frame, if it was made by the developer (identified by API key) * @summary Delete frame - * @param {DeleteNeynarFrameRequest} deleteNeynarFrameRequest + * @param {FrameApiDeleteNeynarFrameRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `DeleteFrameResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-neynar-frame) + * */ - deleteNeynarFrame(deleteNeynarFrameRequest: DeleteNeynarFrameRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.deleteNeynarFrame(deleteNeynarFrameRequest, options).then((request) => request(axios, basePath)); + deleteNeynarFrame(requestParameters: FrameApiDeleteNeynarFrameRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.deleteNeynarFrame(requestParameters.delete_frame_req_body, options).then((request) => request(axios, basePath)); + }, + /** + * Fetches the frame meta tags from the URL + * @summary Meta tags from URL + * @param {FrameApiFetchFrameMetaTagsFromUrlRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FetchFrameMetaTagsFromUrl200Response` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-frame-meta-tags-from-url) + * + */ + fetchFrameMetaTagsFromUrl(requestParameters: FrameApiFetchFrameMetaTagsFromUrlRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchFrameMetaTagsFromUrl(requestParameters.url, options).then((request) => request(axios, basePath)); }, /** * Fetch a list of frames made by the developer (identified by API key) * @summary List of frames * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise>} A promise that resolves to a `Array` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-neynar-frames) + * */ fetchNeynarFrames(options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.fetchNeynarFrames(options).then((request) => request(axios, basePath)); }, /** - * Fetches the frame meta tags from the URL - * @summary Meta tags from URL - * @param {string} url The frame URL to crawl + * Fetch analytics for total-interactors, interactors, nteractions-per-cast and input-text. + * @summary Analytics for the frame + * @param {FrameApiFetchValidateFrameAnalyticsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FrameValidateAnalyticsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-validate-frame-analytics) + * */ - frameFromUrl(url: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.frameFromUrl(url, options).then((request) => request(axios, basePath)); + fetchValidateFrameAnalytics(requestParameters: FrameApiFetchValidateFrameAnalyticsRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchValidateFrameAnalytics(requestParameters.frame_url, requestParameters.analytics_type, requestParameters.start, requestParameters.stop, requestParameters.aggregate_window, options).then((request) => request(axios, basePath)); + }, + /** + * Fetch a list of all the frames validated by a user + * @summary All frames validated by user + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `FrameValidateListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-validate-frame-list) + * + */ + fetchValidateFrameList(options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchValidateFrameList(options).then((request) => request(axios, basePath)); }, /** * Fetch a frame either by UUID or Neynar URL * @summary Frame by UUID or URL - * @param {FrameType} type - * @param {string} [uuid] UUID of the frame to fetch - * @param {string} [url] URL of the Neynar frame to fetch + * @param {FrameApiLookupNeynarFrameRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `NeynarFrame` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-neynar-frame) + * */ - lookupNeynarFrame(type: FrameType, uuid?: string, url?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.lookupNeynarFrame(type, uuid, url, options).then((request) => request(axios, basePath)); + lookupNeynarFrame(requestParameters: FrameApiLookupNeynarFrameRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.lookupNeynarFrame(requestParameters.type, requestParameters.uuid, requestParameters.url, options).then((request) => request(axios, basePath)); }, /** * Post frame actions, cast actions or cast composer actions to the server \\ (In order to post any of these actions, you need to have an approved `signer_uuid`) The POST request to the post_url has a timeout of 5 seconds for frames. * @summary Post a frame action, cast action or a cast composer action - * @param {FrameActionReqBody} frameActionReqBody + * @param {FrameApiPostFrameActionRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `Frame` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/post-frame-action) + * */ - postFrameAction(frameActionReqBody: FrameActionReqBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.postFrameAction(frameActionReqBody, options).then((request) => request(axios, basePath)); + postFrameAction(requestParameters: FrameApiPostFrameActionRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.postFrameAction(requestParameters.frame_action_req_body, options).then((request) => request(axios, basePath)); }, /** * Post a frame action that has been signed with a developer managed signer The POST request to the post_url has a timeout of 5 seconds. * @summary Signature packet - * @param {FrameDeveloperManagedActionReqBody} frameDeveloperManagedActionReqBody + * @param {FrameApiPostFrameActionDeveloperManagedRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `Frame` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/post-frame-action-developer-managed) + * */ - postFrameDeveloperManagedAction(frameDeveloperManagedActionReqBody: FrameDeveloperManagedActionReqBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.postFrameDeveloperManagedAction(frameDeveloperManagedActionReqBody, options).then((request) => request(axios, basePath)); + postFrameActionDeveloperManaged(requestParameters: FrameApiPostFrameActionDeveloperManagedRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.postFrameActionDeveloperManaged(requestParameters.frame_developer_managed_action_req_body, options).then((request) => request(axios, basePath)); }, /** * Create a new frame with a list of pages. * @summary Create frame - * @param {NeynarFrameCreationRequest} neynarFrameCreationRequest + * @param {FrameApiPublishNeynarFrameRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `NeynarFrame` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-neynar-frame) + * */ - publishNeynarFrame(neynarFrameCreationRequest: NeynarFrameCreationRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.publishNeynarFrame(neynarFrameCreationRequest, options).then((request) => request(axios, basePath)); + publishNeynarFrame(requestParameters: FrameApiPublishNeynarFrameRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.publishNeynarFrame(requestParameters.neynar_frame_creation_req_body, options).then((request) => request(axios, basePath)); }, /** * Update an existing frame with a list of pages, if it was made by the developer (identified by API key) * @summary Update frame - * @param {NeynarFrameUpdateRequest} neynarFrameUpdateRequest + * @param {FrameApiUpdateNeynarFrameRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `NeynarFrame` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/update-neynar-frame) + * */ - updateNeynarFrame(neynarFrameUpdateRequest: NeynarFrameUpdateRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.updateNeynarFrame(neynarFrameUpdateRequest, options).then((request) => request(axios, basePath)); + updateNeynarFrame(requestParameters: FrameApiUpdateNeynarFrameRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.updateNeynarFrame(requestParameters.neynar_frame_update_req_body, options).then((request) => request(axios, basePath)); }, /** * Validates a frame against by an interacting user against a Farcaster Hub \\ (In order to validate a frame, message bytes from Frame Action must be provided in hex) * @summary Validate frame action - * @param {ValidateFrameRequest} validateFrameRequest + * @param {FrameApiValidateFrameActionRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ValidateFrameActionResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/validate-frame-action) + * */ - validateFrame(validateFrameRequest: ValidateFrameRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.validateFrame(validateFrameRequest, options).then((request) => request(axios, basePath)); - }, - /** - * Fetch analytics for total-interactors, interactors, nteractions-per-cast and input-text. - * @summary Analytics for the frame - * @param {string} frameUrl - * @param {ValidateFrameAnalyticsType} analyticsType - * @param {string} start - * @param {string} stop - * @param {ValidateFrameAnalyticsAggregateWindowEnum} [aggregateWindow] Required for `analytics_type=interactions-per-cast` - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - validateFrameAnalytics(frameUrl: string, analyticsType: ValidateFrameAnalyticsType, start: string, stop: string, aggregateWindow?: ValidateFrameAnalyticsAggregateWindowEnum, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.validateFrameAnalytics(frameUrl, analyticsType, start, stop, aggregateWindow, options).then((request) => request(axios, basePath)); - }, - /** - * Fetch a list of all the frames validated by a user - * @summary All frames validated by user - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - validateFrameList(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.validateFrameList(options).then((request) => request(axios, basePath)); + validateFrameAction(requestParameters: FrameApiValidateFrameActionRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.validateFrameAction(requestParameters.validate_frame_action_req_body, options).then((request) => request(axios, basePath)); }, }; }; +/** + * FrameApi - interface + * @export + * @interface FrameApi + */ +export interface FrameApiInterface { + /** + * Delete an existing frame, if it was made by the developer (identified by API key) + * @summary Delete frame + * @param {FrameApiDeleteNeynarFrameRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FrameApiInterface + * @returns {Promise} A promise that resolves to a `DeleteFrameResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-neynar-frame) + * + */ + deleteNeynarFrame(requestParameters: FrameApiDeleteNeynarFrameRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Fetches the frame meta tags from the URL + * @summary Meta tags from URL + * @param {FrameApiFetchFrameMetaTagsFromUrlRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FrameApiInterface + * @returns {Promise} A promise that resolves to a `FetchFrameMetaTagsFromUrl200Response` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-frame-meta-tags-from-url) + * + */ + fetchFrameMetaTagsFromUrl(requestParameters: FrameApiFetchFrameMetaTagsFromUrlRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Fetch a list of frames made by the developer (identified by API key) + * @summary List of frames + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FrameApiInterface + * @returns {Promise>} A promise that resolves to a `Array` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-neynar-frames) + * + */ + fetchNeynarFrames(options?: RawAxiosRequestConfig): AxiosPromise>; + + /** + * Fetch analytics for total-interactors, interactors, nteractions-per-cast and input-text. + * @summary Analytics for the frame + * @param {FrameApiFetchValidateFrameAnalyticsRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FrameApiInterface + * @returns {Promise} A promise that resolves to a `FrameValidateAnalyticsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-validate-frame-analytics) + * + */ + fetchValidateFrameAnalytics(requestParameters: FrameApiFetchValidateFrameAnalyticsRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Fetch a list of all the frames validated by a user + * @summary All frames validated by user + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FrameApiInterface + * @returns {Promise} A promise that resolves to a `FrameValidateListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-validate-frame-list) + * + */ + fetchValidateFrameList(options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Fetch a frame either by UUID or Neynar URL + * @summary Frame by UUID or URL + * @param {FrameApiLookupNeynarFrameRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FrameApiInterface + * @returns {Promise} A promise that resolves to a `NeynarFrame` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-neynar-frame) + * + */ + lookupNeynarFrame(requestParameters: FrameApiLookupNeynarFrameRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Post frame actions, cast actions or cast composer actions to the server \\ (In order to post any of these actions, you need to have an approved `signer_uuid`) The POST request to the post_url has a timeout of 5 seconds for frames. + * @summary Post a frame action, cast action or a cast composer action + * @param {FrameApiPostFrameActionRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FrameApiInterface + * @returns {Promise} A promise that resolves to a `Frame` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/post-frame-action) + * + */ + postFrameAction(requestParameters: FrameApiPostFrameActionRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Post a frame action that has been signed with a developer managed signer The POST request to the post_url has a timeout of 5 seconds. + * @summary Signature packet + * @param {FrameApiPostFrameActionDeveloperManagedRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FrameApiInterface + * @returns {Promise} A promise that resolves to a `Frame` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/post-frame-action-developer-managed) + * + */ + postFrameActionDeveloperManaged(requestParameters: FrameApiPostFrameActionDeveloperManagedRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Create a new frame with a list of pages. + * @summary Create frame + * @param {FrameApiPublishNeynarFrameRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FrameApiInterface + * @returns {Promise} A promise that resolves to a `NeynarFrame` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-neynar-frame) + * + */ + publishNeynarFrame(requestParameters: FrameApiPublishNeynarFrameRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Update an existing frame with a list of pages, if it was made by the developer (identified by API key) + * @summary Update frame + * @param {FrameApiUpdateNeynarFrameRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FrameApiInterface + * @returns {Promise} A promise that resolves to a `NeynarFrame` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/update-neynar-frame) + * + */ + updateNeynarFrame(requestParameters: FrameApiUpdateNeynarFrameRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Validates a frame against by an interacting user against a Farcaster Hub \\ (In order to validate a frame, message bytes from Frame Action must be provided in hex) + * @summary Validate frame action + * @param {FrameApiValidateFrameActionRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FrameApiInterface + * @returns {Promise} A promise that resolves to a `ValidateFrameActionResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/validate-frame-action) + * + */ + validateFrameAction(requestParameters: FrameApiValidateFrameActionRequest, options?: RawAxiosRequestConfig): AxiosPromise; + +} + +/** + * Request parameters for deleteNeynarFrame operation in FrameApi. + * @export + * @interface FrameApiDeleteNeynarFrameRequest + */ +export interface FrameApiDeleteNeynarFrameRequest { + /** + * + * + * + * @type {DeleteFrameReqBody} + * @memberof FrameApiDeleteNeynarFrame + */ + readonly delete_frame_req_body: DeleteFrameReqBody +} + +/** + * Request parameters for fetchFrameMetaTagsFromUrl operation in FrameApi. + * @export + * @interface FrameApiFetchFrameMetaTagsFromUrlRequest + */ +export interface FrameApiFetchFrameMetaTagsFromUrlRequest { + /** + * The frame URL to crawl + * + * + * @type {string} + * @memberof FrameApiFetchFrameMetaTagsFromUrl + */ + readonly url: string +} + +/** + * Request parameters for fetchValidateFrameAnalytics operation in FrameApi. + * @export + * @interface FrameApiFetchValidateFrameAnalyticsRequest + */ +export interface FrameApiFetchValidateFrameAnalyticsRequest { + /** + * + * + * + * @type {string} + * @memberof FrameApiFetchValidateFrameAnalytics + */ + readonly frame_url: string + + /** + * + * + * + * @type {ValidateFrameAnalyticsType} + * @memberof FrameApiFetchValidateFrameAnalytics + */ + readonly analytics_type: ValidateFrameAnalyticsType + + /** + * + * + * + * @type {string} + * @memberof FrameApiFetchValidateFrameAnalytics + */ + readonly start: string + + /** + * + * + * + * @type {string} + * @memberof FrameApiFetchValidateFrameAnalytics + */ + readonly stop: string + + /** + * Required for `analytics_type=interactions-per-cast` + * + * + * @type {'10s' | '1m' | '2m' | '5m' | '10m' | '20m' | '30m' | '2h' | '12h' | '1d' | '7d'} + * @memberof FrameApiFetchValidateFrameAnalytics + */ + readonly aggregate_window?: FetchValidateFrameAnalyticsAggregateWindowEnum +} + +/** + * Request parameters for lookupNeynarFrame operation in FrameApi. + * @export + * @interface FrameApiLookupNeynarFrameRequest + */ +export interface FrameApiLookupNeynarFrameRequest { + /** + * + * + * + * @type {FrameType} + * @memberof FrameApiLookupNeynarFrame + */ + readonly type: FrameType + + /** + * UUID of the frame to fetch + * + * + * @type {string} + * @memberof FrameApiLookupNeynarFrame + */ + readonly uuid?: string + + /** + * URL of the Neynar frame to fetch + * + * + * @type {string} + * @memberof FrameApiLookupNeynarFrame + */ + readonly url?: string +} + +/** + * Request parameters for postFrameAction operation in FrameApi. + * @export + * @interface FrameApiPostFrameActionRequest + */ +export interface FrameApiPostFrameActionRequest { + /** + * + * + * + * @type {FrameActionReqBody} + * @memberof FrameApiPostFrameAction + */ + readonly frame_action_req_body: FrameActionReqBody +} + +/** + * Request parameters for postFrameActionDeveloperManaged operation in FrameApi. + * @export + * @interface FrameApiPostFrameActionDeveloperManagedRequest + */ +export interface FrameApiPostFrameActionDeveloperManagedRequest { + /** + * + * + * + * @type {FrameDeveloperManagedActionReqBody} + * @memberof FrameApiPostFrameActionDeveloperManaged + */ + readonly frame_developer_managed_action_req_body: FrameDeveloperManagedActionReqBody +} + +/** + * Request parameters for publishNeynarFrame operation in FrameApi. + * @export + * @interface FrameApiPublishNeynarFrameRequest + */ +export interface FrameApiPublishNeynarFrameRequest { + /** + * + * + * + * @type {NeynarFrameCreationReqBody} + * @memberof FrameApiPublishNeynarFrame + */ + readonly neynar_frame_creation_req_body: NeynarFrameCreationReqBody +} + +/** + * Request parameters for updateNeynarFrame operation in FrameApi. + * @export + * @interface FrameApiUpdateNeynarFrameRequest + */ +export interface FrameApiUpdateNeynarFrameRequest { + /** + * + * + * + * @type {NeynarFrameUpdateReqBody} + * @memberof FrameApiUpdateNeynarFrame + */ + readonly neynar_frame_update_req_body: NeynarFrameUpdateReqBody +} + +/** + * Request parameters for validateFrameAction operation in FrameApi. + * @export + * @interface FrameApiValidateFrameActionRequest + */ +export interface FrameApiValidateFrameActionRequest { + /** + * + * + * + * @type {ValidateFrameActionReqBody} + * @memberof FrameApiValidateFrameAction + */ + readonly validate_frame_action_req_body: ValidateFrameActionReqBody +} + /** * FrameApi - object-oriented interface * @export * @class FrameApi * @extends {BaseAPI} */ -export class FrameApi extends BaseAPI { +export class FrameApi extends BaseAPI implements FrameApiInterface { /** * Delete an existing frame, if it was made by the developer (identified by API key) * @summary Delete frame - * @param {DeleteNeynarFrameRequest} deleteNeynarFrameRequest + * @param {FrameApiDeleteNeynarFrameRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FrameApi + * @returns {Promise} A promise that resolves to a `DeleteFrameResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-neynar-frame) + * */ - public deleteNeynarFrame(deleteNeynarFrameRequest: DeleteNeynarFrameRequest, options?: RawAxiosRequestConfig) { - return FrameApiFp(this.configuration).deleteNeynarFrame(deleteNeynarFrameRequest, options).then((request) => request(this.axios, this.basePath)); + public deleteNeynarFrame(requestParameters: FrameApiDeleteNeynarFrameRequest, options?: RawAxiosRequestConfig) { + return FrameApiFp(this.configuration).deleteNeynarFrame(requestParameters.delete_frame_req_body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Fetches the frame meta tags from the URL + * @summary Meta tags from URL + * @param {FrameApiFetchFrameMetaTagsFromUrlRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FrameApi + * @returns {Promise} A promise that resolves to a `FetchFrameMetaTagsFromUrl200Response` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-frame-meta-tags-from-url) + * + */ + public fetchFrameMetaTagsFromUrl(requestParameters: FrameApiFetchFrameMetaTagsFromUrlRequest, options?: RawAxiosRequestConfig) { + return FrameApiFp(this.configuration).fetchFrameMetaTagsFromUrl(requestParameters.url, options).then((request) => request(this.axios, this.basePath)); } /** @@ -828,129 +1332,147 @@ export class FrameApi extends BaseAPI { * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FrameApi + * @returns {Promise>} A promise that resolves to a `Array` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-neynar-frames) + * */ public fetchNeynarFrames(options?: RawAxiosRequestConfig) { return FrameApiFp(this.configuration).fetchNeynarFrames(options).then((request) => request(this.axios, this.basePath)); } /** - * Fetches the frame meta tags from the URL - * @summary Meta tags from URL - * @param {string} url The frame URL to crawl + * Fetch analytics for total-interactors, interactors, nteractions-per-cast and input-text. + * @summary Analytics for the frame + * @param {FrameApiFetchValidateFrameAnalyticsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FrameApi + * @returns {Promise} A promise that resolves to a `FrameValidateAnalyticsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-validate-frame-analytics) + * */ - public frameFromUrl(url: string, options?: RawAxiosRequestConfig) { - return FrameApiFp(this.configuration).frameFromUrl(url, options).then((request) => request(this.axios, this.basePath)); + public fetchValidateFrameAnalytics(requestParameters: FrameApiFetchValidateFrameAnalyticsRequest, options?: RawAxiosRequestConfig) { + return FrameApiFp(this.configuration).fetchValidateFrameAnalytics(requestParameters.frame_url, requestParameters.analytics_type, requestParameters.start, requestParameters.stop, requestParameters.aggregate_window, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Fetch a list of all the frames validated by a user + * @summary All frames validated by user + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FrameApi + * @returns {Promise} A promise that resolves to a `FrameValidateListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-validate-frame-list) + * + */ + public fetchValidateFrameList(options?: RawAxiosRequestConfig) { + return FrameApiFp(this.configuration).fetchValidateFrameList(options).then((request) => request(this.axios, this.basePath)); } /** * Fetch a frame either by UUID or Neynar URL * @summary Frame by UUID or URL - * @param {FrameType} type - * @param {string} [uuid] UUID of the frame to fetch - * @param {string} [url] URL of the Neynar frame to fetch + * @param {FrameApiLookupNeynarFrameRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FrameApi + * @returns {Promise} A promise that resolves to a `NeynarFrame` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-neynar-frame) + * */ - public lookupNeynarFrame(type: FrameType, uuid?: string, url?: string, options?: RawAxiosRequestConfig) { - return FrameApiFp(this.configuration).lookupNeynarFrame(type, uuid, url, options).then((request) => request(this.axios, this.basePath)); + public lookupNeynarFrame(requestParameters: FrameApiLookupNeynarFrameRequest, options?: RawAxiosRequestConfig) { + return FrameApiFp(this.configuration).lookupNeynarFrame(requestParameters.type, requestParameters.uuid, requestParameters.url, options).then((request) => request(this.axios, this.basePath)); } /** * Post frame actions, cast actions or cast composer actions to the server \\ (In order to post any of these actions, you need to have an approved `signer_uuid`) The POST request to the post_url has a timeout of 5 seconds for frames. * @summary Post a frame action, cast action or a cast composer action - * @param {FrameActionReqBody} frameActionReqBody + * @param {FrameApiPostFrameActionRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FrameApi + * @returns {Promise} A promise that resolves to a `Frame` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/post-frame-action) + * */ - public postFrameAction(frameActionReqBody: FrameActionReqBody, options?: RawAxiosRequestConfig) { - return FrameApiFp(this.configuration).postFrameAction(frameActionReqBody, options).then((request) => request(this.axios, this.basePath)); + public postFrameAction(requestParameters: FrameApiPostFrameActionRequest, options?: RawAxiosRequestConfig) { + return FrameApiFp(this.configuration).postFrameAction(requestParameters.frame_action_req_body, options).then((request) => request(this.axios, this.basePath)); } /** * Post a frame action that has been signed with a developer managed signer The POST request to the post_url has a timeout of 5 seconds. * @summary Signature packet - * @param {FrameDeveloperManagedActionReqBody} frameDeveloperManagedActionReqBody + * @param {FrameApiPostFrameActionDeveloperManagedRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FrameApi + * @returns {Promise} A promise that resolves to a `Frame` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/post-frame-action-developer-managed) + * */ - public postFrameDeveloperManagedAction(frameDeveloperManagedActionReqBody: FrameDeveloperManagedActionReqBody, options?: RawAxiosRequestConfig) { - return FrameApiFp(this.configuration).postFrameDeveloperManagedAction(frameDeveloperManagedActionReqBody, options).then((request) => request(this.axios, this.basePath)); + public postFrameActionDeveloperManaged(requestParameters: FrameApiPostFrameActionDeveloperManagedRequest, options?: RawAxiosRequestConfig) { + return FrameApiFp(this.configuration).postFrameActionDeveloperManaged(requestParameters.frame_developer_managed_action_req_body, options).then((request) => request(this.axios, this.basePath)); } /** * Create a new frame with a list of pages. * @summary Create frame - * @param {NeynarFrameCreationRequest} neynarFrameCreationRequest + * @param {FrameApiPublishNeynarFrameRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FrameApi + * @returns {Promise} A promise that resolves to a `NeynarFrame` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-neynar-frame) + * */ - public publishNeynarFrame(neynarFrameCreationRequest: NeynarFrameCreationRequest, options?: RawAxiosRequestConfig) { - return FrameApiFp(this.configuration).publishNeynarFrame(neynarFrameCreationRequest, options).then((request) => request(this.axios, this.basePath)); + public publishNeynarFrame(requestParameters: FrameApiPublishNeynarFrameRequest, options?: RawAxiosRequestConfig) { + return FrameApiFp(this.configuration).publishNeynarFrame(requestParameters.neynar_frame_creation_req_body, options).then((request) => request(this.axios, this.basePath)); } /** * Update an existing frame with a list of pages, if it was made by the developer (identified by API key) * @summary Update frame - * @param {NeynarFrameUpdateRequest} neynarFrameUpdateRequest + * @param {FrameApiUpdateNeynarFrameRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FrameApi + * @returns {Promise} A promise that resolves to a `NeynarFrame` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/update-neynar-frame) + * */ - public updateNeynarFrame(neynarFrameUpdateRequest: NeynarFrameUpdateRequest, options?: RawAxiosRequestConfig) { - return FrameApiFp(this.configuration).updateNeynarFrame(neynarFrameUpdateRequest, options).then((request) => request(this.axios, this.basePath)); + public updateNeynarFrame(requestParameters: FrameApiUpdateNeynarFrameRequest, options?: RawAxiosRequestConfig) { + return FrameApiFp(this.configuration).updateNeynarFrame(requestParameters.neynar_frame_update_req_body, options).then((request) => request(this.axios, this.basePath)); } /** * Validates a frame against by an interacting user against a Farcaster Hub \\ (In order to validate a frame, message bytes from Frame Action must be provided in hex) * @summary Validate frame action - * @param {ValidateFrameRequest} validateFrameRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof FrameApi - */ - public validateFrame(validateFrameRequest: ValidateFrameRequest, options?: RawAxiosRequestConfig) { - return FrameApiFp(this.configuration).validateFrame(validateFrameRequest, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Fetch analytics for total-interactors, interactors, nteractions-per-cast and input-text. - * @summary Analytics for the frame - * @param {string} frameUrl - * @param {ValidateFrameAnalyticsType} analyticsType - * @param {string} start - * @param {string} stop - * @param {ValidateFrameAnalyticsAggregateWindowEnum} [aggregateWindow] Required for `analytics_type=interactions-per-cast` - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof FrameApi - */ - public validateFrameAnalytics(frameUrl: string, analyticsType: ValidateFrameAnalyticsType, start: string, stop: string, aggregateWindow?: ValidateFrameAnalyticsAggregateWindowEnum, options?: RawAxiosRequestConfig) { - return FrameApiFp(this.configuration).validateFrameAnalytics(frameUrl, analyticsType, start, stop, aggregateWindow, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Fetch a list of all the frames validated by a user - * @summary All frames validated by user + * @param {FrameApiValidateFrameActionRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FrameApi + * @returns {Promise} A promise that resolves to a `ValidateFrameActionResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/validate-frame-action) + * */ - public validateFrameList(options?: RawAxiosRequestConfig) { - return FrameApiFp(this.configuration).validateFrameList(options).then((request) => request(this.axios, this.basePath)); + public validateFrameAction(requestParameters: FrameApiValidateFrameActionRequest, options?: RawAxiosRequestConfig) { + return FrameApiFp(this.configuration).validateFrameAction(requestParameters.validate_frame_action_req_body, options).then((request) => request(this.axios, this.basePath)); } } /** * @export */ -export const ValidateFrameAnalyticsAggregateWindowEnum = { +export const FetchValidateFrameAnalyticsAggregateWindowEnum = { _10s: '10s', _1m: '1m', _2m: '2m', @@ -963,4 +1485,4 @@ export const ValidateFrameAnalyticsAggregateWindowEnum = { _1d: '1d', _7d: '7d' } as const; -export type ValidateFrameAnalyticsAggregateWindowEnum = typeof ValidateFrameAnalyticsAggregateWindowEnum[keyof typeof ValidateFrameAnalyticsAggregateWindowEnum]; +export type FetchValidateFrameAnalyticsAggregateWindowEnum = typeof FetchValidateFrameAnalyticsAggregateWindowEnum[keyof typeof FetchValidateFrameAnalyticsAggregateWindowEnum]; diff --git a/src/neynar-api/v2/openapi-farcaster/apis/mute-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/mute-api.ts index 55eb74b4..8c7e4b31 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/mute-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/mute-api.ts @@ -36,15 +36,19 @@ import type { MuteResponse } from '../models'; export const MuteApiAxiosParamCreator = function (configuration?: Configuration) { return { /** - * Adds a mute for a given FID. This is a whitelisted API, reach out if you want access. - * @summary Mute FID - * @param {MuteReqBody} muteReqBody + * Deletes a mute for a given FID. This is a whitelisted API, reach out if you want access. + * @summary Unmute FID + * @param {MuteReqBody} mute_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `MuteResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-mute) + * */ - addMute: async (muteReqBody: MuteReqBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'muteReqBody' is not null or undefined - assertParamExists('addMute', 'muteReqBody', muteReqBody) + deleteMute: async (mute_req_body: MuteReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'mute_req_body' is not null or undefined + assertParamExists('deleteMute', 'mute_req_body', mute_req_body) const localVarPath = `/farcaster/mute`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -53,7 +57,7 @@ export const MuteApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -67,7 +71,7 @@ export const MuteApiAxiosParamCreator = function (configuration?: Configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(muteReqBody, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(mute_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -75,16 +79,22 @@ export const MuteApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Deletes a mute for a given FID. This is a whitelisted API, reach out if you want access. - * @summary Unmute FID - * @param {MuteReqBody} muteReqBody + * Fetches all FIDs that a user has muted. + * @summary Muted FIDs of user + * @param {number} fid The user\'s FID (identifier) + * @param {number} [limit] Number of results to fetch (Default: 20, Maximum: 100) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `MuteListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-mute-list) + * */ - deleteMute: async (muteReqBody: MuteReqBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'muteReqBody' is not null or undefined - assertParamExists('deleteMute', 'muteReqBody', muteReqBody) - const localVarPath = `/farcaster/mute`; + fetchMuteList: async (fid: number, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'fid' is not null or undefined + assertParamExists('fetchMuteList', 'fid', fid) + const localVarPath = `/farcaster/mute/list`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -92,21 +102,30 @@ export const MuteApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } - - localVarHeaderParameter['Content-Type'] = 'application/json'; + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(muteReqBody, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -114,18 +133,20 @@ export const MuteApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Fetches all FIDs that a user has muted. - * @summary Muted FIDs of user - * @param {number} fid The user\'s FID (identifier) - * @param {number} [limit] Number of results to fetch (default 20, max 100). - * @param {string} [cursor] Pagination cursor. + * Adds a mute for a given FID. This is a whitelisted API, reach out if you want access. + * @summary Mute FID + * @param {MuteReqBody} mute_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `MuteResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-mute) + * */ - muteList: async (fid: number, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'fid' is not null or undefined - assertParamExists('muteList', 'fid', fid) - const localVarPath = `/farcaster/mute/list`; + publishMute: async (mute_req_body: MuteReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'mute_req_body' is not null or undefined + assertParamExists('publishMute', 'mute_req_body', mute_req_body) + const localVarPath = `/farcaster/mute`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -133,30 +154,21 @@ export const MuteApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (fid !== undefined) { - localVarQueryParameter['fid'] = fid; - } - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; - } - + localVarHeaderParameter['Content-Type'] = 'application/json'; + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(mute_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -174,44 +186,56 @@ export const MuteApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = MuteApiAxiosParamCreator(configuration) return { /** - * Adds a mute for a given FID. This is a whitelisted API, reach out if you want access. - * @summary Mute FID - * @param {MuteReqBody} muteReqBody + * Deletes a mute for a given FID. This is a whitelisted API, reach out if you want access. + * @summary Unmute FID + * @param {MuteReqBody} mute_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `MuteResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-mute) + * */ - async addMute(muteReqBody: MuteReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.addMute(muteReqBody, options); + async deleteMute(mute_req_body: MuteReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteMute(mute_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['MuteApi.addMute']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['MuteApi.deleteMute']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Deletes a mute for a given FID. This is a whitelisted API, reach out if you want access. - * @summary Unmute FID - * @param {MuteReqBody} muteReqBody + * Fetches all FIDs that a user has muted. + * @summary Muted FIDs of user + * @param {number} fid The user\'s FID (identifier) + * @param {number} [limit] Number of results to fetch (Default: 20, Maximum: 100) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `MuteListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-mute-list) + * */ - async deleteMute(muteReqBody: MuteReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteMute(muteReqBody, options); + async fetchMuteList(fid: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchMuteList(fid, limit, cursor, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['MuteApi.deleteMute']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['MuteApi.fetchMuteList']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Fetches all FIDs that a user has muted. - * @summary Muted FIDs of user - * @param {number} fid The user\'s FID (identifier) - * @param {number} [limit] Number of results to fetch (default 20, max 100). - * @param {string} [cursor] Pagination cursor. + * Adds a mute for a given FID. This is a whitelisted API, reach out if you want access. + * @summary Mute FID + * @param {MuteReqBody} mute_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `MuteResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-mute) + * */ - async muteList(fid: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.muteList(fid, limit, cursor, options); + async publishMute(mute_req_body: MuteReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.publishMute(mute_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['MuteApi.muteList']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['MuteApi.publishMute']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } @@ -225,83 +249,219 @@ export const MuteApiFactory = function (configuration?: Configuration, basePath? const localVarFp = MuteApiFp(configuration) return { /** - * Adds a mute for a given FID. This is a whitelisted API, reach out if you want access. - * @summary Mute FID - * @param {MuteReqBody} muteReqBody + * Deletes a mute for a given FID. This is a whitelisted API, reach out if you want access. + * @summary Unmute FID + * @param {MuteApiDeleteMuteRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `MuteResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-mute) + * */ - addMute(muteReqBody: MuteReqBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.addMute(muteReqBody, options).then((request) => request(axios, basePath)); + deleteMute(requestParameters: MuteApiDeleteMuteRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.deleteMute(requestParameters.mute_req_body, options).then((request) => request(axios, basePath)); }, /** - * Deletes a mute for a given FID. This is a whitelisted API, reach out if you want access. - * @summary Unmute FID - * @param {MuteReqBody} muteReqBody + * Fetches all FIDs that a user has muted. + * @summary Muted FIDs of user + * @param {MuteApiFetchMuteListRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `MuteListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-mute-list) + * */ - deleteMute(muteReqBody: MuteReqBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.deleteMute(muteReqBody, options).then((request) => request(axios, basePath)); + fetchMuteList(requestParameters: MuteApiFetchMuteListRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchMuteList(requestParameters.fid, requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath)); }, /** - * Fetches all FIDs that a user has muted. - * @summary Muted FIDs of user - * @param {number} fid The user\'s FID (identifier) - * @param {number} [limit] Number of results to fetch (default 20, max 100). - * @param {string} [cursor] Pagination cursor. + * Adds a mute for a given FID. This is a whitelisted API, reach out if you want access. + * @summary Mute FID + * @param {MuteApiPublishMuteRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `MuteResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-mute) + * */ - muteList(fid: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.muteList(fid, limit, cursor, options).then((request) => request(axios, basePath)); + publishMute(requestParameters: MuteApiPublishMuteRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.publishMute(requestParameters.mute_req_body, options).then((request) => request(axios, basePath)); }, }; }; /** - * MuteApi - object-oriented interface + * MuteApi - interface * @export - * @class MuteApi - * @extends {BaseAPI} + * @interface MuteApi */ -export class MuteApi extends BaseAPI { +export interface MuteApiInterface { + /** + * Deletes a mute for a given FID. This is a whitelisted API, reach out if you want access. + * @summary Unmute FID + * @param {MuteApiDeleteMuteRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof MuteApiInterface + * @returns {Promise} A promise that resolves to a `MuteResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-mute) + * + */ + deleteMute(requestParameters: MuteApiDeleteMuteRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Fetches all FIDs that a user has muted. + * @summary Muted FIDs of user + * @param {MuteApiFetchMuteListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof MuteApiInterface + * @returns {Promise} A promise that resolves to a `MuteListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-mute-list) + * + */ + fetchMuteList(requestParameters: MuteApiFetchMuteListRequest, options?: RawAxiosRequestConfig): AxiosPromise; + /** * Adds a mute for a given FID. This is a whitelisted API, reach out if you want access. * @summary Mute FID - * @param {MuteReqBody} muteReqBody + * @param {MuteApiPublishMuteRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof MuteApi + * @memberof MuteApiInterface + * @returns {Promise} A promise that resolves to a `MuteResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-mute) + * */ - public addMute(muteReqBody: MuteReqBody, options?: RawAxiosRequestConfig) { - return MuteApiFp(this.configuration).addMute(muteReqBody, options).then((request) => request(this.axios, this.basePath)); - } + publishMute(requestParameters: MuteApiPublishMuteRequest, options?: RawAxiosRequestConfig): AxiosPromise; + +} + +/** + * Request parameters for deleteMute operation in MuteApi. + * @export + * @interface MuteApiDeleteMuteRequest + */ +export interface MuteApiDeleteMuteRequest { + /** + * + * + * + * @type {MuteReqBody} + * @memberof MuteApiDeleteMute + */ + readonly mute_req_body: MuteReqBody +} + +/** + * Request parameters for fetchMuteList operation in MuteApi. + * @export + * @interface MuteApiFetchMuteListRequest + */ +export interface MuteApiFetchMuteListRequest { + /** + * The user\'s FID (identifier) + * + * + * @type {number} + * @memberof MuteApiFetchMuteList + */ + readonly fid: number + + /** + * Number of results to fetch (Default: 20, Maximum: 100) + * + * + * @type {number} + * @memberof MuteApiFetchMuteList + */ + readonly limit?: number + /** + * Pagination cursor. + * + * + * @type {string} + * @memberof MuteApiFetchMuteList + */ + readonly cursor?: string +} + +/** + * Request parameters for publishMute operation in MuteApi. + * @export + * @interface MuteApiPublishMuteRequest + */ +export interface MuteApiPublishMuteRequest { + /** + * + * + * + * @type {MuteReqBody} + * @memberof MuteApiPublishMute + */ + readonly mute_req_body: MuteReqBody +} + +/** + * MuteApi - object-oriented interface + * @export + * @class MuteApi + * @extends {BaseAPI} + */ +export class MuteApi extends BaseAPI implements MuteApiInterface { /** * Deletes a mute for a given FID. This is a whitelisted API, reach out if you want access. * @summary Unmute FID - * @param {MuteReqBody} muteReqBody + * @param {MuteApiDeleteMuteRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof MuteApi + * @returns {Promise} A promise that resolves to a `MuteResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-mute) + * */ - public deleteMute(muteReqBody: MuteReqBody, options?: RawAxiosRequestConfig) { - return MuteApiFp(this.configuration).deleteMute(muteReqBody, options).then((request) => request(this.axios, this.basePath)); + public deleteMute(requestParameters: MuteApiDeleteMuteRequest, options?: RawAxiosRequestConfig) { + return MuteApiFp(this.configuration).deleteMute(requestParameters.mute_req_body, options).then((request) => request(this.axios, this.basePath)); } /** * Fetches all FIDs that a user has muted. * @summary Muted FIDs of user - * @param {number} fid The user\'s FID (identifier) - * @param {number} [limit] Number of results to fetch (default 20, max 100). - * @param {string} [cursor] Pagination cursor. + * @param {MuteApiFetchMuteListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof MuteApi + * @returns {Promise} A promise that resolves to a `MuteListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-mute-list) + * + */ + public fetchMuteList(requestParameters: MuteApiFetchMuteListRequest, options?: RawAxiosRequestConfig) { + return MuteApiFp(this.configuration).fetchMuteList(requestParameters.fid, requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Adds a mute for a given FID. This is a whitelisted API, reach out if you want access. + * @summary Mute FID + * @param {MuteApiPublishMuteRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof MuteApi + * @returns {Promise} A promise that resolves to a `MuteResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-mute) + * */ - public muteList(fid: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig) { - return MuteApiFp(this.configuration).muteList(fid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); + public publishMute(requestParameters: MuteApiPublishMuteRequest, options?: RawAxiosRequestConfig) { + return MuteApiFp(this.configuration).publishMute(requestParameters.mute_req_body, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/src/neynar-api/v2/openapi-farcaster/apis/notifications-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/notifications-api.ts index 5eab7793..48d76d27 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/notifications-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/notifications-api.ts @@ -26,8 +26,6 @@ import type { ErrorRes } from '../models'; // @ts-ignore import type { MarkNotificationsAsSeenReqBody } from '../models'; // @ts-ignore -import type { NotificationType } from '../models'; -// @ts-ignore import type { NotificationsResponse } from '../models'; // @ts-ignore import type { OperationResponse } from '../models'; @@ -38,16 +36,23 @@ import type { OperationResponse } from '../models'; export const NotificationsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** - * Mark notifications as seen - * @summary Mark as seen - * @param {MarkNotificationsAsSeenReqBody} markNotificationsAsSeenReqBody + * Returns a list of notifications for a specific FID. + * @summary For user + * @param {number} fid FID of the user you you want to fetch notifications for. The response will respect this user\'s mutes and blocks. + * @param {string} [type] Notification type to fetch. Comma separated values of follows, recasts, likes, mentions, replies. + * @param {boolean} [priority_mode] When true, only returns notifications from power badge users and users that the viewer follows (if viewer_fid is provided). + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `NotificationsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-all-notifications) + * */ - markNotificationsAsSeen: async (markNotificationsAsSeenReqBody: MarkNotificationsAsSeenReqBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'markNotificationsAsSeenReqBody' is not null or undefined - assertParamExists('markNotificationsAsSeen', 'markNotificationsAsSeenReqBody', markNotificationsAsSeenReqBody) - const localVarPath = `/farcaster/notifications/seen`; + fetchAllNotifications: async (fid: number, type?: string, priority_mode?: boolean, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'fid' is not null or undefined + assertParamExists('fetchAllNotifications', 'fid', fid) + const localVarPath = `/farcaster/notifications`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -55,21 +60,34 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } + + if (type !== undefined) { + localVarQueryParameter['type'] = type; + } + + if (priority_mode !== undefined) { + localVarQueryParameter['priority_mode'] = priority_mode; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } - - localVarHeaderParameter['Content-Type'] = 'application/json'; + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(markNotificationsAsSeenReqBody, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -77,19 +95,25 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi }; }, /** - * Returns a list of notifications for a specific FID. - * @summary For user - * @param {number} fid FID of the user you you want to fetch notifications for. The response will respect this user\'s mutes and blocks. - * @param {NotificationType} [type] Notification type to fetch. - * @param {boolean} [priorityMode] When true, only returns notifications from power badge users and users that the viewer follows (if viewer_fid is provided). - * @param {string} [cursor] Pagination cursor. + * Returns a list of notifications for a user in specific channels + * @summary For user by channel + * @param {number} fid FID of the user you you want to fetch notifications for. The response will respect this user\'s mutes and blocks. + * @param {string} channel_ids Comma separated channel_ids (find list of all channels here - https://docs.neynar.com/reference/list-all-channels) + * @param {boolean} [priority_mode] When true, only returns notifications from power badge users and users that the viewer follows (if viewer_fid is provided). + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `NotificationsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-channel-notifications-for-user) + * */ - notifications: async (fid: number, type?: NotificationType, priorityMode?: boolean, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { + fetchChannelNotificationsForUser: async (fid: number, channel_ids: string, priority_mode?: boolean, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'fid' is not null or undefined - assertParamExists('notifications', 'fid', fid) - const localVarPath = `/farcaster/notifications`; + assertParamExists('fetchChannelNotificationsForUser', 'fid', fid) + // verify required parameter 'channel_ids' is not null or undefined + assertParamExists('fetchChannelNotificationsForUser', 'channel_ids', channel_ids) + const localVarPath = `/farcaster/notifications/channel`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -108,12 +132,12 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi localVarQueryParameter['fid'] = fid; } - if (type !== undefined) { - localVarQueryParameter['type'] = type; + if (channel_ids !== undefined) { + localVarQueryParameter['channel_ids'] = channel_ids; } - if (priorityMode !== undefined) { - localVarQueryParameter['priority_mode'] = priorityMode; + if (priority_mode !== undefined) { + localVarQueryParameter['priority_mode'] = priority_mode; } if (cursor !== undefined) { @@ -132,21 +156,25 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi }; }, /** - * Returns a list of notifications for a user in specific channels - * @summary For user by channel - * @param {number} fid FID of the user you you want to fetch notifications for. The response will respect this user\'s mutes and blocks. - * @param {string} channelIds Comma separated channel_ids (find list of all channels here - https://docs.neynar.com/reference/list-all-channels) - * @param {boolean} [priorityMode] When true, only returns notifications from power badge users and users that the viewer follows (if viewer_fid is provided). - * @param {string} [cursor] Pagination cursor. + * Returns a list of notifications for a user in specific parent_urls + * @summary For user by parent_urls + * @param {number} fid FID of the user you you want to fetch notifications for. The response will respect this user\'s mutes and blocks. + * @param {string} parent_urls Comma separated parent_urls + * @param {boolean} [priority_mode] When true, only returns notifications from power badge users and users that the viewer follows (if viewer_fid is provided). + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `NotificationsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-notifications-by-parent-url-for-user) + * */ - notificationsChannel: async (fid: number, channelIds: string, priorityMode?: boolean, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { + fetchNotificationsByParentUrlForUser: async (fid: number, parent_urls: string, priority_mode?: boolean, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'fid' is not null or undefined - assertParamExists('notificationsChannel', 'fid', fid) - // verify required parameter 'channelIds' is not null or undefined - assertParamExists('notificationsChannel', 'channelIds', channelIds) - const localVarPath = `/farcaster/notifications/channel`; + assertParamExists('fetchNotificationsByParentUrlForUser', 'fid', fid) + // verify required parameter 'parent_urls' is not null or undefined + assertParamExists('fetchNotificationsByParentUrlForUser', 'parent_urls', parent_urls) + const localVarPath = `/farcaster/notifications/parent_url`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -165,12 +193,12 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi localVarQueryParameter['fid'] = fid; } - if (channelIds !== undefined) { - localVarQueryParameter['channel_ids'] = channelIds; + if (parent_urls !== undefined) { + localVarQueryParameter['parent_urls'] = parent_urls; } - if (priorityMode !== undefined) { - localVarQueryParameter['priority_mode'] = priorityMode; + if (priority_mode !== undefined) { + localVarQueryParameter['priority_mode'] = priority_mode; } if (cursor !== undefined) { @@ -189,21 +217,20 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi }; }, /** - * Returns a list of notifications for a user in specific parent_urls - * @summary For user by parent_urls - * @param {number} fid FID of the user you you want to fetch notifications for. The response will respect this user\'s mutes and blocks. - * @param {string} parentUrls Comma separated parent_urls - * @param {boolean} [priorityMode] When true, only returns notifications from power badge users and users that the viewer follows (if viewer_fid is provided). - * @param {string} [cursor] Pagination cursor. + * Mark notifications as seen + * @summary Mark as seen + * @param {MarkNotificationsAsSeenReqBody} mark_notifications_as_seen_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/mark-notifications-as-seen) + * */ - notificationsParentUrl: async (fid: number, parentUrls: string, priorityMode?: boolean, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'fid' is not null or undefined - assertParamExists('notificationsParentUrl', 'fid', fid) - // verify required parameter 'parentUrls' is not null or undefined - assertParamExists('notificationsParentUrl', 'parentUrls', parentUrls) - const localVarPath = `/farcaster/notifications/parent_url`; + markNotificationsAsSeen: async (mark_notifications_as_seen_req_body: MarkNotificationsAsSeenReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'mark_notifications_as_seen_req_body' is not null or undefined + assertParamExists('markNotificationsAsSeen', 'mark_notifications_as_seen_req_body', mark_notifications_as_seen_req_body) + const localVarPath = `/farcaster/notifications/seen`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -211,34 +238,21 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (fid !== undefined) { - localVarQueryParameter['fid'] = fid; - } - - if (parentUrls !== undefined) { - localVarQueryParameter['parent_urls'] = parentUrls; - } - - if (priorityMode !== undefined) { - localVarQueryParameter['priority_mode'] = priorityMode; - } - - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; - } - + localVarHeaderParameter['Content-Type'] = 'application/json'; + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(mark_notifications_as_seen_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -256,64 +270,80 @@ export const NotificationsApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = NotificationsApiAxiosParamCreator(configuration) return { /** - * Mark notifications as seen - * @summary Mark as seen - * @param {MarkNotificationsAsSeenReqBody} markNotificationsAsSeenReqBody + * Returns a list of notifications for a specific FID. + * @summary For user + * @param {number} fid FID of the user you you want to fetch notifications for. The response will respect this user\'s mutes and blocks. + * @param {string} [type] Notification type to fetch. Comma separated values of follows, recasts, likes, mentions, replies. + * @param {boolean} [priority_mode] When true, only returns notifications from power badge users and users that the viewer follows (if viewer_fid is provided). + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `NotificationsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-all-notifications) + * */ - async markNotificationsAsSeen(markNotificationsAsSeenReqBody: MarkNotificationsAsSeenReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.markNotificationsAsSeen(markNotificationsAsSeenReqBody, options); + async fetchAllNotifications(fid: number, type?: string, priority_mode?: boolean, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchAllNotifications(fid, type, priority_mode, cursor, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['NotificationsApi.markNotificationsAsSeen']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['NotificationsApi.fetchAllNotifications']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Returns a list of notifications for a specific FID. - * @summary For user - * @param {number} fid FID of the user you you want to fetch notifications for. The response will respect this user\'s mutes and blocks. - * @param {NotificationType} [type] Notification type to fetch. - * @param {boolean} [priorityMode] When true, only returns notifications from power badge users and users that the viewer follows (if viewer_fid is provided). - * @param {string} [cursor] Pagination cursor. + * Returns a list of notifications for a user in specific channels + * @summary For user by channel + * @param {number} fid FID of the user you you want to fetch notifications for. The response will respect this user\'s mutes and blocks. + * @param {string} channel_ids Comma separated channel_ids (find list of all channels here - https://docs.neynar.com/reference/list-all-channels) + * @param {boolean} [priority_mode] When true, only returns notifications from power badge users and users that the viewer follows (if viewer_fid is provided). + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `NotificationsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-channel-notifications-for-user) + * */ - async notifications(fid: number, type?: NotificationType, priorityMode?: boolean, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.notifications(fid, type, priorityMode, cursor, options); + async fetchChannelNotificationsForUser(fid: number, channel_ids: string, priority_mode?: boolean, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchChannelNotificationsForUser(fid, channel_ids, priority_mode, cursor, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['NotificationsApi.notifications']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['NotificationsApi.fetchChannelNotificationsForUser']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Returns a list of notifications for a user in specific channels - * @summary For user by channel - * @param {number} fid FID of the user you you want to fetch notifications for. The response will respect this user\'s mutes and blocks. - * @param {string} channelIds Comma separated channel_ids (find list of all channels here - https://docs.neynar.com/reference/list-all-channels) - * @param {boolean} [priorityMode] When true, only returns notifications from power badge users and users that the viewer follows (if viewer_fid is provided). - * @param {string} [cursor] Pagination cursor. + * Returns a list of notifications for a user in specific parent_urls + * @summary For user by parent_urls + * @param {number} fid FID of the user you you want to fetch notifications for. The response will respect this user\'s mutes and blocks. + * @param {string} parent_urls Comma separated parent_urls + * @param {boolean} [priority_mode] When true, only returns notifications from power badge users and users that the viewer follows (if viewer_fid is provided). + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `NotificationsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-notifications-by-parent-url-for-user) + * */ - async notificationsChannel(fid: number, channelIds: string, priorityMode?: boolean, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.notificationsChannel(fid, channelIds, priorityMode, cursor, options); + async fetchNotificationsByParentUrlForUser(fid: number, parent_urls: string, priority_mode?: boolean, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchNotificationsByParentUrlForUser(fid, parent_urls, priority_mode, cursor, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['NotificationsApi.notificationsChannel']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['NotificationsApi.fetchNotificationsByParentUrlForUser']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Returns a list of notifications for a user in specific parent_urls - * @summary For user by parent_urls - * @param {number} fid FID of the user you you want to fetch notifications for. The response will respect this user\'s mutes and blocks. - * @param {string} parentUrls Comma separated parent_urls - * @param {boolean} [priorityMode] When true, only returns notifications from power badge users and users that the viewer follows (if viewer_fid is provided). - * @param {string} [cursor] Pagination cursor. + * Mark notifications as seen + * @summary Mark as seen + * @param {MarkNotificationsAsSeenReqBody} mark_notifications_as_seen_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/mark-notifications-as-seen) + * */ - async notificationsParentUrl(fid: number, parentUrls: string, priorityMode?: boolean, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.notificationsParentUrl(fid, parentUrls, priorityMode, cursor, options); + async markNotificationsAsSeen(mark_notifications_as_seen_req_body: MarkNotificationsAsSeenReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.markNotificationsAsSeen(mark_notifications_as_seen_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['NotificationsApi.notificationsParentUrl']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['NotificationsApi.markNotificationsAsSeen']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } @@ -326,120 +356,343 @@ export const NotificationsApiFp = function(configuration?: Configuration) { export const NotificationsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = NotificationsApiFp(configuration) return { - /** - * Mark notifications as seen - * @summary Mark as seen - * @param {MarkNotificationsAsSeenReqBody} markNotificationsAsSeenReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - markNotificationsAsSeen(markNotificationsAsSeenReqBody: MarkNotificationsAsSeenReqBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.markNotificationsAsSeen(markNotificationsAsSeenReqBody, options).then((request) => request(axios, basePath)); - }, /** * Returns a list of notifications for a specific FID. * @summary For user - * @param {number} fid FID of the user you you want to fetch notifications for. The response will respect this user\'s mutes and blocks. - * @param {NotificationType} [type] Notification type to fetch. - * @param {boolean} [priorityMode] When true, only returns notifications from power badge users and users that the viewer follows (if viewer_fid is provided). - * @param {string} [cursor] Pagination cursor. + * @param {NotificationsApiFetchAllNotificationsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `NotificationsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-all-notifications) + * */ - notifications(fid: number, type?: NotificationType, priorityMode?: boolean, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.notifications(fid, type, priorityMode, cursor, options).then((request) => request(axios, basePath)); + fetchAllNotifications(requestParameters: NotificationsApiFetchAllNotificationsRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchAllNotifications(requestParameters.fid, requestParameters.type, requestParameters.priority_mode, requestParameters.cursor, options).then((request) => request(axios, basePath)); }, /** * Returns a list of notifications for a user in specific channels * @summary For user by channel - * @param {number} fid FID of the user you you want to fetch notifications for. The response will respect this user\'s mutes and blocks. - * @param {string} channelIds Comma separated channel_ids (find list of all channels here - https://docs.neynar.com/reference/list-all-channels) - * @param {boolean} [priorityMode] When true, only returns notifications from power badge users and users that the viewer follows (if viewer_fid is provided). - * @param {string} [cursor] Pagination cursor. + * @param {NotificationsApiFetchChannelNotificationsForUserRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `NotificationsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-channel-notifications-for-user) + * */ - notificationsChannel(fid: number, channelIds: string, priorityMode?: boolean, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.notificationsChannel(fid, channelIds, priorityMode, cursor, options).then((request) => request(axios, basePath)); + fetchChannelNotificationsForUser(requestParameters: NotificationsApiFetchChannelNotificationsForUserRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchChannelNotificationsForUser(requestParameters.fid, requestParameters.channel_ids, requestParameters.priority_mode, requestParameters.cursor, options).then((request) => request(axios, basePath)); }, /** * Returns a list of notifications for a user in specific parent_urls * @summary For user by parent_urls - * @param {number} fid FID of the user you you want to fetch notifications for. The response will respect this user\'s mutes and blocks. - * @param {string} parentUrls Comma separated parent_urls - * @param {boolean} [priorityMode] When true, only returns notifications from power badge users and users that the viewer follows (if viewer_fid is provided). - * @param {string} [cursor] Pagination cursor. + * @param {NotificationsApiFetchNotificationsByParentUrlForUserRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `NotificationsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-notifications-by-parent-url-for-user) + * + */ + fetchNotificationsByParentUrlForUser(requestParameters: NotificationsApiFetchNotificationsByParentUrlForUserRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchNotificationsByParentUrlForUser(requestParameters.fid, requestParameters.parent_urls, requestParameters.priority_mode, requestParameters.cursor, options).then((request) => request(axios, basePath)); + }, + /** + * Mark notifications as seen + * @summary Mark as seen + * @param {NotificationsApiMarkNotificationsAsSeenRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/mark-notifications-as-seen) + * */ - notificationsParentUrl(fid: number, parentUrls: string, priorityMode?: boolean, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.notificationsParentUrl(fid, parentUrls, priorityMode, cursor, options).then((request) => request(axios, basePath)); + markNotificationsAsSeen(requestParameters: NotificationsApiMarkNotificationsAsSeenRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.markNotificationsAsSeen(requestParameters.mark_notifications_as_seen_req_body, options).then((request) => request(axios, basePath)); }, }; }; /** - * NotificationsApi - object-oriented interface + * NotificationsApi - interface * @export - * @class NotificationsApi - * @extends {BaseAPI} + * @interface NotificationsApi */ -export class NotificationsApi extends BaseAPI { +export interface NotificationsApiInterface { + /** + * Returns a list of notifications for a specific FID. + * @summary For user + * @param {NotificationsApiFetchAllNotificationsRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationsApiInterface + * @returns {Promise} A promise that resolves to a `NotificationsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-all-notifications) + * + */ + fetchAllNotifications(requestParameters: NotificationsApiFetchAllNotificationsRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Returns a list of notifications for a user in specific channels + * @summary For user by channel + * @param {NotificationsApiFetchChannelNotificationsForUserRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationsApiInterface + * @returns {Promise} A promise that resolves to a `NotificationsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-channel-notifications-for-user) + * + */ + fetchChannelNotificationsForUser(requestParameters: NotificationsApiFetchChannelNotificationsForUserRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Returns a list of notifications for a user in specific parent_urls + * @summary For user by parent_urls + * @param {NotificationsApiFetchNotificationsByParentUrlForUserRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationsApiInterface + * @returns {Promise} A promise that resolves to a `NotificationsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-notifications-by-parent-url-for-user) + * + */ + fetchNotificationsByParentUrlForUser(requestParameters: NotificationsApiFetchNotificationsByParentUrlForUserRequest, options?: RawAxiosRequestConfig): AxiosPromise; + /** * Mark notifications as seen * @summary Mark as seen - * @param {MarkNotificationsAsSeenReqBody} markNotificationsAsSeenReqBody + * @param {NotificationsApiMarkNotificationsAsSeenRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof NotificationsApi + * @memberof NotificationsApiInterface + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/mark-notifications-as-seen) + * */ - public markNotificationsAsSeen(markNotificationsAsSeenReqBody: MarkNotificationsAsSeenReqBody, options?: RawAxiosRequestConfig) { - return NotificationsApiFp(this.configuration).markNotificationsAsSeen(markNotificationsAsSeenReqBody, options).then((request) => request(this.axios, this.basePath)); - } + markNotificationsAsSeen(requestParameters: NotificationsApiMarkNotificationsAsSeenRequest, options?: RawAxiosRequestConfig): AxiosPromise; + +} + +/** + * Request parameters for fetchAllNotifications operation in NotificationsApi. + * @export + * @interface NotificationsApiFetchAllNotificationsRequest + */ +export interface NotificationsApiFetchAllNotificationsRequest { + /** + * FID of the user you you want to fetch notifications for. The response will respect this user\'s mutes and blocks. + * + * + * @type {number} + * @memberof NotificationsApiFetchAllNotifications + */ + readonly fid: number + + /** + * Notification type to fetch. Comma separated values of follows, recasts, likes, mentions, replies. + * + * @commaSeparated + * @type {string} + * @memberof NotificationsApiFetchAllNotifications + */ + readonly type?: string + + /** + * When true, only returns notifications from power badge users and users that the viewer follows (if viewer_fid is provided). + * + * + * @type {boolean} + * @memberof NotificationsApiFetchAllNotifications + */ + readonly priority_mode?: boolean + + /** + * Pagination cursor. + * + * + * @type {string} + * @memberof NotificationsApiFetchAllNotifications + */ + readonly cursor?: string +} + +/** + * Request parameters for fetchChannelNotificationsForUser operation in NotificationsApi. + * @export + * @interface NotificationsApiFetchChannelNotificationsForUserRequest + */ +export interface NotificationsApiFetchChannelNotificationsForUserRequest { + /** + * FID of the user you you want to fetch notifications for. The response will respect this user\'s mutes and blocks. + * + * + * @type {number} + * @memberof NotificationsApiFetchChannelNotificationsForUser + */ + readonly fid: number + /** + * Comma separated channel_ids (find list of all channels here - https://docs.neynar.com/reference/list-all-channels) + * + * @commaSeparated + * @type {string} + * @memberof NotificationsApiFetchChannelNotificationsForUser + */ + readonly channel_ids: string + + /** + * When true, only returns notifications from power badge users and users that the viewer follows (if viewer_fid is provided). + * + * + * @type {boolean} + * @memberof NotificationsApiFetchChannelNotificationsForUser + */ + readonly priority_mode?: boolean + + /** + * Pagination cursor. + * + * + * @type {string} + * @memberof NotificationsApiFetchChannelNotificationsForUser + */ + readonly cursor?: string +} + +/** + * Request parameters for fetchNotificationsByParentUrlForUser operation in NotificationsApi. + * @export + * @interface NotificationsApiFetchNotificationsByParentUrlForUserRequest + */ +export interface NotificationsApiFetchNotificationsByParentUrlForUserRequest { + /** + * FID of the user you you want to fetch notifications for. The response will respect this user\'s mutes and blocks. + * + * + * @type {number} + * @memberof NotificationsApiFetchNotificationsByParentUrlForUser + */ + readonly fid: number + + /** + * Comma separated parent_urls + * + * @commaSeparated + * @type {string} + * @memberof NotificationsApiFetchNotificationsByParentUrlForUser + */ + readonly parent_urls: string + + /** + * When true, only returns notifications from power badge users and users that the viewer follows (if viewer_fid is provided). + * + * + * @type {boolean} + * @memberof NotificationsApiFetchNotificationsByParentUrlForUser + */ + readonly priority_mode?: boolean + + /** + * Pagination cursor. + * + * + * @type {string} + * @memberof NotificationsApiFetchNotificationsByParentUrlForUser + */ + readonly cursor?: string +} + +/** + * Request parameters for markNotificationsAsSeen operation in NotificationsApi. + * @export + * @interface NotificationsApiMarkNotificationsAsSeenRequest + */ +export interface NotificationsApiMarkNotificationsAsSeenRequest { + /** + * + * + * + * @type {MarkNotificationsAsSeenReqBody} + * @memberof NotificationsApiMarkNotificationsAsSeen + */ + readonly mark_notifications_as_seen_req_body: MarkNotificationsAsSeenReqBody +} + +/** + * NotificationsApi - object-oriented interface + * @export + * @class NotificationsApi + * @extends {BaseAPI} + */ +export class NotificationsApi extends BaseAPI implements NotificationsApiInterface { /** * Returns a list of notifications for a specific FID. * @summary For user - * @param {number} fid FID of the user you you want to fetch notifications for. The response will respect this user\'s mutes and blocks. - * @param {NotificationType} [type] Notification type to fetch. - * @param {boolean} [priorityMode] When true, only returns notifications from power badge users and users that the viewer follows (if viewer_fid is provided). - * @param {string} [cursor] Pagination cursor. + * @param {NotificationsApiFetchAllNotificationsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof NotificationsApi + * @returns {Promise} A promise that resolves to a `NotificationsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-all-notifications) + * */ - public notifications(fid: number, type?: NotificationType, priorityMode?: boolean, cursor?: string, options?: RawAxiosRequestConfig) { - return NotificationsApiFp(this.configuration).notifications(fid, type, priorityMode, cursor, options).then((request) => request(this.axios, this.basePath)); + public fetchAllNotifications(requestParameters: NotificationsApiFetchAllNotificationsRequest, options?: RawAxiosRequestConfig) { + return NotificationsApiFp(this.configuration).fetchAllNotifications(requestParameters.fid, requestParameters.type, requestParameters.priority_mode, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath)); } /** * Returns a list of notifications for a user in specific channels * @summary For user by channel - * @param {number} fid FID of the user you you want to fetch notifications for. The response will respect this user\'s mutes and blocks. - * @param {string} channelIds Comma separated channel_ids (find list of all channels here - https://docs.neynar.com/reference/list-all-channels) - * @param {boolean} [priorityMode] When true, only returns notifications from power badge users and users that the viewer follows (if viewer_fid is provided). - * @param {string} [cursor] Pagination cursor. + * @param {NotificationsApiFetchChannelNotificationsForUserRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof NotificationsApi + * @returns {Promise} A promise that resolves to a `NotificationsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-channel-notifications-for-user) + * */ - public notificationsChannel(fid: number, channelIds: string, priorityMode?: boolean, cursor?: string, options?: RawAxiosRequestConfig) { - return NotificationsApiFp(this.configuration).notificationsChannel(fid, channelIds, priorityMode, cursor, options).then((request) => request(this.axios, this.basePath)); + public fetchChannelNotificationsForUser(requestParameters: NotificationsApiFetchChannelNotificationsForUserRequest, options?: RawAxiosRequestConfig) { + return NotificationsApiFp(this.configuration).fetchChannelNotificationsForUser(requestParameters.fid, requestParameters.channel_ids, requestParameters.priority_mode, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath)); } /** * Returns a list of notifications for a user in specific parent_urls * @summary For user by parent_urls - * @param {number} fid FID of the user you you want to fetch notifications for. The response will respect this user\'s mutes and blocks. - * @param {string} parentUrls Comma separated parent_urls - * @param {boolean} [priorityMode] When true, only returns notifications from power badge users and users that the viewer follows (if viewer_fid is provided). - * @param {string} [cursor] Pagination cursor. + * @param {NotificationsApiFetchNotificationsByParentUrlForUserRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationsApi + * @returns {Promise} A promise that resolves to a `NotificationsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-notifications-by-parent-url-for-user) + * + */ + public fetchNotificationsByParentUrlForUser(requestParameters: NotificationsApiFetchNotificationsByParentUrlForUserRequest, options?: RawAxiosRequestConfig) { + return NotificationsApiFp(this.configuration).fetchNotificationsByParentUrlForUser(requestParameters.fid, requestParameters.parent_urls, requestParameters.priority_mode, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Mark notifications as seen + * @summary Mark as seen + * @param {NotificationsApiMarkNotificationsAsSeenRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof NotificationsApi + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/mark-notifications-as-seen) + * */ - public notificationsParentUrl(fid: number, parentUrls: string, priorityMode?: boolean, cursor?: string, options?: RawAxiosRequestConfig) { - return NotificationsApiFp(this.configuration).notificationsParentUrl(fid, parentUrls, priorityMode, cursor, options).then((request) => request(this.axios, this.basePath)); + public markNotificationsAsSeen(requestParameters: NotificationsApiMarkNotificationsAsSeenRequest, options?: RawAxiosRequestConfig) { + return NotificationsApiFp(this.configuration).markNotificationsAsSeen(requestParameters.mark_notifications_as_seen_req_body, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/src/neynar-api/v2/openapi-farcaster/apis/reaction-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/reaction-api.ts index b9efcc6d..5ecad731 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/reaction-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/reaction-api.ts @@ -42,13 +42,17 @@ export const ReactionApiAxiosParamCreator = function (configuration?: Configurat /** * Delete a reaction (like or recast) to a cast \\ (In order to delete a reaction `signer_uuid` must be approved) * @summary Delete reaction - * @param {ReactionReqBody} reactionReqBody + * @param {ReactionReqBody} reaction_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-reaction) + * */ - deleteReaction: async (reactionReqBody: ReactionReqBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'reactionReqBody' is not null or undefined - assertParamExists('deleteReaction', 'reactionReqBody', reactionReqBody) + deleteReaction: async (reaction_req_body: ReactionReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'reaction_req_body' is not null or undefined + assertParamExists('deleteReaction', 'reaction_req_body', reaction_req_body) const localVarPath = `/farcaster/reaction`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -71,46 +75,7 @@ export const ReactionApiAxiosParamCreator = function (configuration?: Configurat setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(reactionReqBody, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Post a reaction (like or recast) to a given cast \\ (In order to post a reaction `signer_uuid` must be approved) - * @summary Post a reaction - * @param {ReactionReqBody} reactionReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - postReaction: async (reactionReqBody: ReactionReqBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'reactionReqBody' is not null or undefined - assertParamExists('postReaction', 'reactionReqBody', reactionReqBody) - const localVarPath = `/farcaster/reaction`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication ApiKeyAuth required - await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(reactionReqBody, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(reaction_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -120,19 +85,23 @@ export const ReactionApiAxiosParamCreator = function (configuration?: Configurat /** * Fetches reactions for a given cast * @summary Reactions for cast - * @param {string} hash - * @param {string} types Customize which reaction types the request should search for. This is a comma-separated string that can include the following values: \'likes\' and \'recasts\'. By default api returns both. To select multiple types, use a comma-separated list of these values. - * @param {number} [viewerFid] Providing this will return a list of reactions that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. + * @param {string} hash + * @param {string} types Customize which reaction types the request should search for. This is a comma-separated string that can include the following values: \'likes\' and \'recasts\'. By default api returns both. To select multiple types, use a comma-separated list of these values. + * @param {number} [viewer_fid] Providing this will return a list of reactions that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ReactionsCastResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-cast-reactions) + * */ - reactionsCast: async (hash: string, types: string, viewerFid?: number, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { + fetchCastReactions: async (hash: string, types: string, viewer_fid?: number, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'hash' is not null or undefined - assertParamExists('reactionsCast', 'hash', hash) + assertParamExists('fetchCastReactions', 'hash', hash) // verify required parameter 'types' is not null or undefined - assertParamExists('reactionsCast', 'types', types) + assertParamExists('fetchCastReactions', 'types', types) const localVarPath = `/farcaster/reactions/cast`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -156,8 +125,8 @@ export const ReactionApiAxiosParamCreator = function (configuration?: Configurat localVarQueryParameter['types'] = types; } - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; } if (limit !== undefined) { @@ -182,19 +151,23 @@ export const ReactionApiAxiosParamCreator = function (configuration?: Configurat /** * Fetches reactions for a given user * @summary Reactions for user - * @param {number} fid - * @param {ReactionsType} type Type of reaction to fetch (likes or recasts or all) - * @param {number} [viewerFid] Providing this will return a list of reactions that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. + * @param {number} fid + * @param {ReactionsType} type Type of reaction to fetch (likes or recasts or all) + * @param {number} [viewer_fid] Providing this will return a list of reactions that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ReactionsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-reactions) + * */ - reactionsUser: async (fid: number, type: ReactionsType, viewerFid?: number, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { + fetchUserReactions: async (fid: number, type: ReactionsType, viewer_fid?: number, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'fid' is not null or undefined - assertParamExists('reactionsUser', 'fid', fid) + assertParamExists('fetchUserReactions', 'fid', fid) // verify required parameter 'type' is not null or undefined - assertParamExists('reactionsUser', 'type', type) + assertParamExists('fetchUserReactions', 'type', type) const localVarPath = `/farcaster/reactions/user`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -214,8 +187,8 @@ export const ReactionApiAxiosParamCreator = function (configuration?: Configurat localVarQueryParameter['fid'] = fid; } - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; } if (type !== undefined) { @@ -236,6 +209,49 @@ export const ReactionApiAxiosParamCreator = function (configuration?: Configurat let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Post a reaction (like or recast) to a given cast \\ (In order to post a reaction `signer_uuid` must be approved) + * @summary Post a reaction + * @param {ReactionReqBody} reaction_req_body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-reaction) + * + */ + publishReaction: async (reaction_req_body: ReactionReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'reaction_req_body' is not null or undefined + assertParamExists('publishReaction', 'reaction_req_body', reaction_req_body) + const localVarPath = `/farcaster/reaction`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyAuth required + await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(reaction_req_body, localVarRequestOptions, configuration) + return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, @@ -254,61 +270,77 @@ export const ReactionApiFp = function(configuration?: Configuration) { /** * Delete a reaction (like or recast) to a cast \\ (In order to delete a reaction `signer_uuid` must be approved) * @summary Delete reaction - * @param {ReactionReqBody} reactionReqBody + * @param {ReactionReqBody} reaction_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-reaction) + * */ - async deleteReaction(reactionReqBody: ReactionReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteReaction(reactionReqBody, options); + async deleteReaction(reaction_req_body: ReactionReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteReaction(reaction_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['ReactionApi.deleteReaction']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Post a reaction (like or recast) to a given cast \\ (In order to post a reaction `signer_uuid` must be approved) - * @summary Post a reaction - * @param {ReactionReqBody} reactionReqBody + * Fetches reactions for a given cast + * @summary Reactions for cast + * @param {string} hash + * @param {string} types Customize which reaction types the request should search for. This is a comma-separated string that can include the following values: \'likes\' and \'recasts\'. By default api returns both. To select multiple types, use a comma-separated list of these values. + * @param {number} [viewer_fid] Providing this will return a list of reactions that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ReactionsCastResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-cast-reactions) + * */ - async postReaction(reactionReqBody: ReactionReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.postReaction(reactionReqBody, options); + async fetchCastReactions(hash: string, types: string, viewer_fid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchCastReactions(hash, types, viewer_fid, limit, cursor, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ReactionApi.postReaction']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['ReactionApi.fetchCastReactions']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Fetches reactions for a given cast - * @summary Reactions for cast - * @param {string} hash - * @param {string} types Customize which reaction types the request should search for. This is a comma-separated string that can include the following values: \'likes\' and \'recasts\'. By default api returns both. To select multiple types, use a comma-separated list of these values. - * @param {number} [viewerFid] Providing this will return a list of reactions that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. + * Fetches reactions for a given user + * @summary Reactions for user + * @param {number} fid + * @param {ReactionsType} type Type of reaction to fetch (likes or recasts or all) + * @param {number} [viewer_fid] Providing this will return a list of reactions that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ReactionsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-reactions) + * */ - async reactionsCast(hash: string, types: string, viewerFid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.reactionsCast(hash, types, viewerFid, limit, cursor, options); + async fetchUserReactions(fid: number, type: ReactionsType, viewer_fid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchUserReactions(fid, type, viewer_fid, limit, cursor, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ReactionApi.reactionsCast']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['ReactionApi.fetchUserReactions']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Fetches reactions for a given user - * @summary Reactions for user - * @param {number} fid - * @param {ReactionsType} type Type of reaction to fetch (likes or recasts or all) - * @param {number} [viewerFid] Providing this will return a list of reactions that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. + * Post a reaction (like or recast) to a given cast \\ (In order to post a reaction `signer_uuid` must be approved) + * @summary Post a reaction + * @param {ReactionReqBody} reaction_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-reaction) + * */ - async reactionsUser(fid: number, type: ReactionsType, viewerFid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.reactionsUser(fid, type, viewerFid, limit, cursor, options); + async publishReaction(reaction_req_body: ReactionReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.publishReaction(reaction_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ReactionApi.reactionsUser']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['ReactionApi.publishReaction']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } @@ -324,115 +356,331 @@ export const ReactionApiFactory = function (configuration?: Configuration, baseP /** * Delete a reaction (like or recast) to a cast \\ (In order to delete a reaction `signer_uuid` must be approved) * @summary Delete reaction - * @param {ReactionReqBody} reactionReqBody + * @param {ReactionApiDeleteReactionRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-reaction) + * */ - deleteReaction(reactionReqBody: ReactionReqBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.deleteReaction(reactionReqBody, options).then((request) => request(axios, basePath)); + deleteReaction(requestParameters: ReactionApiDeleteReactionRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.deleteReaction(requestParameters.reaction_req_body, options).then((request) => request(axios, basePath)); }, /** - * Post a reaction (like or recast) to a given cast \\ (In order to post a reaction `signer_uuid` must be approved) - * @summary Post a reaction - * @param {ReactionReqBody} reactionReqBody + * Fetches reactions for a given cast + * @summary Reactions for cast + * @param {ReactionApiFetchCastReactionsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ReactionsCastResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-cast-reactions) + * */ - postReaction(reactionReqBody: ReactionReqBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.postReaction(reactionReqBody, options).then((request) => request(axios, basePath)); + fetchCastReactions(requestParameters: ReactionApiFetchCastReactionsRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchCastReactions(requestParameters.hash, requestParameters.types, requestParameters.viewer_fid, requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath)); }, /** - * Fetches reactions for a given cast - * @summary Reactions for cast - * @param {string} hash - * @param {string} types Customize which reaction types the request should search for. This is a comma-separated string that can include the following values: \'likes\' and \'recasts\'. By default api returns both. To select multiple types, use a comma-separated list of these values. - * @param {number} [viewerFid] Providing this will return a list of reactions that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. + * Fetches reactions for a given user + * @summary Reactions for user + * @param {ReactionApiFetchUserReactionsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `ReactionsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-reactions) + * */ - reactionsCast(hash: string, types: string, viewerFid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.reactionsCast(hash, types, viewerFid, limit, cursor, options).then((request) => request(axios, basePath)); + fetchUserReactions(requestParameters: ReactionApiFetchUserReactionsRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchUserReactions(requestParameters.fid, requestParameters.type, requestParameters.viewer_fid, requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath)); }, /** - * Fetches reactions for a given user - * @summary Reactions for user - * @param {number} fid - * @param {ReactionsType} type Type of reaction to fetch (likes or recasts or all) - * @param {number} [viewerFid] Providing this will return a list of reactions that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. + * Post a reaction (like or recast) to a given cast \\ (In order to post a reaction `signer_uuid` must be approved) + * @summary Post a reaction + * @param {ReactionApiPublishReactionRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-reaction) + * */ - reactionsUser(fid: number, type: ReactionsType, viewerFid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.reactionsUser(fid, type, viewerFid, limit, cursor, options).then((request) => request(axios, basePath)); + publishReaction(requestParameters: ReactionApiPublishReactionRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.publishReaction(requestParameters.reaction_req_body, options).then((request) => request(axios, basePath)); }, }; }; /** - * ReactionApi - object-oriented interface + * ReactionApi - interface * @export - * @class ReactionApi - * @extends {BaseAPI} + * @interface ReactionApi */ -export class ReactionApi extends BaseAPI { +export interface ReactionApiInterface { /** * Delete a reaction (like or recast) to a cast \\ (In order to delete a reaction `signer_uuid` must be approved) * @summary Delete reaction - * @param {ReactionReqBody} reactionReqBody + * @param {ReactionApiDeleteReactionRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof ReactionApi + * @memberof ReactionApiInterface + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-reaction) + * */ - public deleteReaction(reactionReqBody: ReactionReqBody, options?: RawAxiosRequestConfig) { - return ReactionApiFp(this.configuration).deleteReaction(reactionReqBody, options).then((request) => request(this.axios, this.basePath)); - } + deleteReaction(requestParameters: ReactionApiDeleteReactionRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Fetches reactions for a given cast + * @summary Reactions for cast + * @param {ReactionApiFetchCastReactionsRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ReactionApiInterface + * @returns {Promise} A promise that resolves to a `ReactionsCastResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-cast-reactions) + * + */ + fetchCastReactions(requestParameters: ReactionApiFetchCastReactionsRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Fetches reactions for a given user + * @summary Reactions for user + * @param {ReactionApiFetchUserReactionsRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ReactionApiInterface + * @returns {Promise} A promise that resolves to a `ReactionsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-reactions) + * + */ + fetchUserReactions(requestParameters: ReactionApiFetchUserReactionsRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Post a reaction (like or recast) to a given cast \\ (In order to post a reaction `signer_uuid` must be approved) * @summary Post a reaction - * @param {ReactionReqBody} reactionReqBody + * @param {ReactionApiPublishReactionRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ReactionApiInterface + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-reaction) + * + */ + publishReaction(requestParameters: ReactionApiPublishReactionRequest, options?: RawAxiosRequestConfig): AxiosPromise; + +} + +/** + * Request parameters for deleteReaction operation in ReactionApi. + * @export + * @interface ReactionApiDeleteReactionRequest + */ +export interface ReactionApiDeleteReactionRequest { + /** + * + * + * + * @type {ReactionReqBody} + * @memberof ReactionApiDeleteReaction + */ + readonly reaction_req_body: ReactionReqBody +} + +/** + * Request parameters for fetchCastReactions operation in ReactionApi. + * @export + * @interface ReactionApiFetchCastReactionsRequest + */ +export interface ReactionApiFetchCastReactionsRequest { + /** + * + * + * + * @type {string} + * @memberof ReactionApiFetchCastReactions + */ + readonly hash: string + + /** + * Customize which reaction types the request should search for. This is a comma-separated string that can include the following values: \'likes\' and \'recasts\'. By default api returns both. To select multiple types, use a comma-separated list of these values. + * + * @commaSeparated + * @type {string} + * @memberof ReactionApiFetchCastReactions + */ + readonly types: string + + /** + * Providing this will return a list of reactions that respects this user\'s mutes and blocks and includes `viewer_context`. + * + * + * @type {number} + * @memberof ReactionApiFetchCastReactions + */ + readonly viewer_fid?: number + + /** + * Number of results to fetch (Default: 25, Maximum: 100) + * + * + * @type {number} + * @memberof ReactionApiFetchCastReactions + */ + readonly limit?: number + + /** + * Pagination cursor. + * + * + * @type {string} + * @memberof ReactionApiFetchCastReactions + */ + readonly cursor?: string +} + +/** + * Request parameters for fetchUserReactions operation in ReactionApi. + * @export + * @interface ReactionApiFetchUserReactionsRequest + */ +export interface ReactionApiFetchUserReactionsRequest { + /** + * + * + * + * @type {number} + * @memberof ReactionApiFetchUserReactions + */ + readonly fid: number + + /** + * Type of reaction to fetch (likes or recasts or all) + * + * + * @type {ReactionsType} + * @memberof ReactionApiFetchUserReactions + */ + readonly type: ReactionsType + + /** + * Providing this will return a list of reactions that respects this user\'s mutes and blocks and includes `viewer_context`. + * + * + * @type {number} + * @memberof ReactionApiFetchUserReactions + */ + readonly viewer_fid?: number + + /** + * Number of results to fetch (Default: 25, Maximum: 100) + * + * + * @type {number} + * @memberof ReactionApiFetchUserReactions + */ + readonly limit?: number + + /** + * Pagination cursor. + * + * + * @type {string} + * @memberof ReactionApiFetchUserReactions + */ + readonly cursor?: string +} + +/** + * Request parameters for publishReaction operation in ReactionApi. + * @export + * @interface ReactionApiPublishReactionRequest + */ +export interface ReactionApiPublishReactionRequest { + /** + * + * + * + * @type {ReactionReqBody} + * @memberof ReactionApiPublishReaction + */ + readonly reaction_req_body: ReactionReqBody +} + +/** + * ReactionApi - object-oriented interface + * @export + * @class ReactionApi + * @extends {BaseAPI} + */ +export class ReactionApi extends BaseAPI implements ReactionApiInterface { + /** + * Delete a reaction (like or recast) to a cast \\ (In order to delete a reaction `signer_uuid` must be approved) + * @summary Delete reaction + * @param {ReactionApiDeleteReactionRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ReactionApi + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-reaction) + * */ - public postReaction(reactionReqBody: ReactionReqBody, options?: RawAxiosRequestConfig) { - return ReactionApiFp(this.configuration).postReaction(reactionReqBody, options).then((request) => request(this.axios, this.basePath)); + public deleteReaction(requestParameters: ReactionApiDeleteReactionRequest, options?: RawAxiosRequestConfig) { + return ReactionApiFp(this.configuration).deleteReaction(requestParameters.reaction_req_body, options).then((request) => request(this.axios, this.basePath)); } /** * Fetches reactions for a given cast * @summary Reactions for cast - * @param {string} hash - * @param {string} types Customize which reaction types the request should search for. This is a comma-separated string that can include the following values: \'likes\' and \'recasts\'. By default api returns both. To select multiple types, use a comma-separated list of these values. - * @param {number} [viewerFid] Providing this will return a list of reactions that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. + * @param {ReactionApiFetchCastReactionsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ReactionApi + * @returns {Promise} A promise that resolves to a `ReactionsCastResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-cast-reactions) + * */ - public reactionsCast(hash: string, types: string, viewerFid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig) { - return ReactionApiFp(this.configuration).reactionsCast(hash, types, viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); + public fetchCastReactions(requestParameters: ReactionApiFetchCastReactionsRequest, options?: RawAxiosRequestConfig) { + return ReactionApiFp(this.configuration).fetchCastReactions(requestParameters.hash, requestParameters.types, requestParameters.viewer_fid, requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath)); } /** * Fetches reactions for a given user * @summary Reactions for user - * @param {number} fid - * @param {ReactionsType} type Type of reaction to fetch (likes or recasts or all) - * @param {number} [viewerFid] Providing this will return a list of reactions that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {number} [limit] Number of results to fetch (default 25, max 100) - * @param {string} [cursor] Pagination cursor. + * @param {ReactionApiFetchUserReactionsRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ReactionApi + * @returns {Promise} A promise that resolves to a `ReactionsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-reactions) + * + */ + public fetchUserReactions(requestParameters: ReactionApiFetchUserReactionsRequest, options?: RawAxiosRequestConfig) { + return ReactionApiFp(this.configuration).fetchUserReactions(requestParameters.fid, requestParameters.type, requestParameters.viewer_fid, requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Post a reaction (like or recast) to a given cast \\ (In order to post a reaction `signer_uuid` must be approved) + * @summary Post a reaction + * @param {ReactionApiPublishReactionRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ReactionApi + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-reaction) + * */ - public reactionsUser(fid: number, type: ReactionsType, viewerFid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig) { - return ReactionApiFp(this.configuration).reactionsUser(fid, type, viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); + public publishReaction(requestParameters: ReactionApiPublishReactionRequest, options?: RawAxiosRequestConfig) { + return ReactionApiFp(this.configuration).publishReaction(requestParameters.reaction_req_body, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/src/neynar-api/v2/openapi-farcaster/apis/signer-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/signer-api.ts index 83508178..f50d098e 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/signer-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/signer-api.ts @@ -46,6 +46,10 @@ export const SignerApiAxiosParamCreator = function (configuration?: Configuratio * @summary Create signer * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `Signer` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/create-signer) + * */ createSigner: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/farcaster/signer`; @@ -75,16 +79,23 @@ export const SignerApiAxiosParamCreator = function (configuration?: Configuratio }; }, /** - * Fetches the status of a developer managed signer by public key - * @summary Status by public key - * @param {string} publicKey + * Fetch authorization url (Fetched authorized url useful for SIWN login operation) + * @summary Fetch authorization url + * @param {string} client_id + * @param {AuthorizationUrlResponseType} response_type * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `AuthorizationUrlResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-authorization-url) + * */ - developerManagedSigner: async (publicKey: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'publicKey' is not null or undefined - assertParamExists('developerManagedSigner', 'publicKey', publicKey) - const localVarPath = `/farcaster/signer/developer_managed`; + fetchAuthorizationUrl: async (client_id: string, response_type: AuthorizationUrlResponseType, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'client_id' is not null or undefined + assertParamExists('fetchAuthorizationUrl', 'client_id', client_id) + // verify required parameter 'response_type' is not null or undefined + assertParamExists('fetchAuthorizationUrl', 'response_type', response_type) + const localVarPath = `/farcaster/login/authorize`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -99,8 +110,12 @@ export const SignerApiAxiosParamCreator = function (configuration?: Configuratio // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (publicKey !== undefined) { - localVarQueryParameter['public_key'] = publicKey; + if (client_id !== undefined) { + localVarQueryParameter['client_id'] = client_id; + } + + if (response_type !== undefined) { + localVarQueryParameter['response_type'] = response_type; } @@ -115,19 +130,20 @@ export const SignerApiAxiosParamCreator = function (configuration?: Configuratio }; }, /** - * Fetch authorization url (Fetched authorized url useful for SIWN login operation) - * @summary Fetch authorization url - * @param {string} clientId - * @param {AuthorizationUrlResponseType} responseType + * Fetches the status of a developer managed signer by public key + * @summary Status by public key + * @param {string} public_key * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `DeveloperManagedSigner` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-developer-managed-signer) + * */ - fetchAuthorizationUrl: async (clientId: string, responseType: AuthorizationUrlResponseType, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'clientId' is not null or undefined - assertParamExists('fetchAuthorizationUrl', 'clientId', clientId) - // verify required parameter 'responseType' is not null or undefined - assertParamExists('fetchAuthorizationUrl', 'responseType', responseType) - const localVarPath = `/farcaster/login/authorize`; + lookupDeveloperManagedSigner: async (public_key: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'public_key' is not null or undefined + assertParamExists('lookupDeveloperManagedSigner', 'public_key', public_key) + const localVarPath = `/farcaster/signer/developer_managed`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -142,12 +158,8 @@ export const SignerApiAxiosParamCreator = function (configuration?: Configuratio // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (clientId !== undefined) { - localVarQueryParameter['client_id'] = clientId; - } - - if (responseType !== undefined) { - localVarQueryParameter['response_type'] = responseType; + if (public_key !== undefined) { + localVarQueryParameter['public_key'] = public_key; } @@ -162,16 +174,20 @@ export const SignerApiAxiosParamCreator = function (configuration?: Configuratio }; }, /** - * Publish a message to farcaster. The message must be signed by a signer managed by the developer. Use the @farcaster/core library to construct and sign the message. Use the Message.toJSON method on the signed message and pass the JSON in the body of this POST request. - * @summary Publish message - * @param {object} body + * Gets information status of a signer by passing in a signer_uuid (Use post API to generate a signer) + * @summary Status + * @param {string} signer_uuid * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `Signer` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-signer) + * */ - publishMessage: async (body: object, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'body' is not null or undefined - assertParamExists('publishMessage', 'body', body) - const localVarPath = `/farcaster/message`; + lookupSigner: async (signer_uuid: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'signer_uuid' is not null or undefined + assertParamExists('lookupSigner', 'signer_uuid', signer_uuid) + const localVarPath = `/farcaster/signer`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -179,21 +195,22 @@ export const SignerApiAxiosParamCreator = function (configuration?: Configuratio baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) + if (signer_uuid !== undefined) { + localVarQueryParameter['signer_uuid'] = signer_uuid; + } - - localVarHeaderParameter['Content-Type'] = 'application/json'; + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -201,16 +218,20 @@ export const SignerApiAxiosParamCreator = function (configuration?: Configuratio }; }, /** - * Registers an app FID, deadline and a signature. Returns the signer status with an approval url. - * @summary Register Signed Key - * @param {RegisterSignerKeyReqBody} registerSignerKeyReqBody + * Publish a message to farcaster. The message must be signed by a signer managed by the developer. Use the @farcaster/core library to construct and sign the message. Use the Message.toJSON method on the signed message and pass the JSON in the body of this POST request. + * @summary Publish message + * @param {object} body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `object` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-message-to-farcaster) + * */ - registerSignedKey: async (registerSignerKeyReqBody: RegisterSignerKeyReqBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'registerSignerKeyReqBody' is not null or undefined - assertParamExists('registerSignedKey', 'registerSignerKeyReqBody', registerSignerKeyReqBody) - const localVarPath = `/farcaster/signer/signed_key`; + publishMessageToFarcaster: async (body: object, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'body' is not null or undefined + assertParamExists('publishMessageToFarcaster', 'body', body) + const localVarPath = `/farcaster/message`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -232,7 +253,7 @@ export const SignerApiAxiosParamCreator = function (configuration?: Configuratio setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(registerSignerKeyReqBody, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -240,16 +261,20 @@ export const SignerApiAxiosParamCreator = function (configuration?: Configuratio }; }, /** - * Registers an signed key and returns the developer managed signer status with an approval url. + * Registers an app FID, deadline and a signature. Returns the signer status with an approval url. * @summary Register Signed Key - * @param {RegisterDeveloperManagedSignedKeyReqBody} registerDeveloperManagedSignedKeyReqBody + * @param {RegisterSignerKeyReqBody} register_signer_key_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `Signer` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/register-signed-key) + * */ - registerSignedKeyForDeveloperManagedSigner: async (registerDeveloperManagedSignedKeyReqBody: RegisterDeveloperManagedSignedKeyReqBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'registerDeveloperManagedSignedKeyReqBody' is not null or undefined - assertParamExists('registerSignedKeyForDeveloperManagedSigner', 'registerDeveloperManagedSignedKeyReqBody', registerDeveloperManagedSignedKeyReqBody) - const localVarPath = `/farcaster/signer/developer_managed/signed_key`; + registerSignedKey: async (register_signer_key_req_body: RegisterSignerKeyReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'register_signer_key_req_body' is not null or undefined + assertParamExists('registerSignedKey', 'register_signer_key_req_body', register_signer_key_req_body) + const localVarPath = `/farcaster/signer/signed_key`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -271,7 +296,7 @@ export const SignerApiAxiosParamCreator = function (configuration?: Configuratio setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(registerDeveloperManagedSignedKeyReqBody, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(register_signer_key_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -279,16 +304,20 @@ export const SignerApiAxiosParamCreator = function (configuration?: Configuratio }; }, /** - * Gets information status of a signer by passing in a signer_uuid (Use post API to generate a signer) - * @summary Status - * @param {string} signerUuid + * Registers an signed key and returns the developer managed signer status with an approval url. + * @summary Register Signed Key + * @param {RegisterDeveloperManagedSignedKeyReqBody} register_developer_managed_signed_key_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `DeveloperManagedSigner` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/register-signed-key-for-developer-managed-signer) + * */ - signer: async (signerUuid: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'signerUuid' is not null or undefined - assertParamExists('signer', 'signerUuid', signerUuid) - const localVarPath = `/farcaster/signer`; + registerSignedKeyForDeveloperManagedSigner: async (register_developer_managed_signed_key_req_body: RegisterDeveloperManagedSignedKeyReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'register_developer_managed_signed_key_req_body' is not null or undefined + assertParamExists('registerSignedKeyForDeveloperManagedSigner', 'register_developer_managed_signed_key_req_body', register_developer_managed_signed_key_req_body) + const localVarPath = `/farcaster/signer/developer_managed/signed_key`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -296,22 +325,21 @@ export const SignerApiAxiosParamCreator = function (configuration?: Configuratio baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (signerUuid !== undefined) { - localVarQueryParameter['signer_uuid'] = signerUuid; - } - + localVarHeaderParameter['Content-Type'] = 'application/json'; + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(register_developer_managed_signed_key_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -333,6 +361,10 @@ export const SignerApiFp = function(configuration?: Configuration) { * @summary Create signer * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `Signer` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/create-signer) + * */ async createSigner(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createSigner(options); @@ -340,55 +372,88 @@ export const SignerApiFp = function(configuration?: Configuration) { const localVarOperationServerBasePath = operationServerMap['SignerApi.createSigner']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, + /** + * Fetch authorization url (Fetched authorized url useful for SIWN login operation) + * @summary Fetch authorization url + * @param {string} client_id + * @param {AuthorizationUrlResponseType} response_type + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `AuthorizationUrlResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-authorization-url) + * + */ + async fetchAuthorizationUrl(client_id: string, response_type: AuthorizationUrlResponseType, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchAuthorizationUrl(client_id, response_type, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['SignerApi.fetchAuthorizationUrl']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, /** * Fetches the status of a developer managed signer by public key * @summary Status by public key - * @param {string} publicKey + * @param {string} public_key * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `DeveloperManagedSigner` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-developer-managed-signer) + * */ - async developerManagedSigner(publicKey: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.developerManagedSigner(publicKey, options); + async lookupDeveloperManagedSigner(public_key: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.lookupDeveloperManagedSigner(public_key, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['SignerApi.developerManagedSigner']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['SignerApi.lookupDeveloperManagedSigner']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Fetch authorization url (Fetched authorized url useful for SIWN login operation) - * @summary Fetch authorization url - * @param {string} clientId - * @param {AuthorizationUrlResponseType} responseType + * Gets information status of a signer by passing in a signer_uuid (Use post API to generate a signer) + * @summary Status + * @param {string} signer_uuid * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `Signer` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-signer) + * */ - async fetchAuthorizationUrl(clientId: string, responseType: AuthorizationUrlResponseType, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.fetchAuthorizationUrl(clientId, responseType, options); + async lookupSigner(signer_uuid: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.lookupSigner(signer_uuid, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['SignerApi.fetchAuthorizationUrl']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['SignerApi.lookupSigner']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Publish a message to farcaster. The message must be signed by a signer managed by the developer. Use the @farcaster/core library to construct and sign the message. Use the Message.toJSON method on the signed message and pass the JSON in the body of this POST request. * @summary Publish message - * @param {object} body + * @param {object} body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `object` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-message-to-farcaster) + * */ - async publishMessage(body: object, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.publishMessage(body, options); + async publishMessageToFarcaster(body: object, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.publishMessageToFarcaster(body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['SignerApi.publishMessage']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['SignerApi.publishMessageToFarcaster']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Registers an app FID, deadline and a signature. Returns the signer status with an approval url. * @summary Register Signed Key - * @param {RegisterSignerKeyReqBody} registerSignerKeyReqBody + * @param {RegisterSignerKeyReqBody} register_signer_key_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `Signer` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/register-signed-key) + * */ - async registerSignedKey(registerSignerKeyReqBody: RegisterSignerKeyReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.registerSignedKey(registerSignerKeyReqBody, options); + async registerSignedKey(register_signer_key_req_body: RegisterSignerKeyReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.registerSignedKey(register_signer_key_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['SignerApi.registerSignedKey']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); @@ -396,29 +461,20 @@ export const SignerApiFp = function(configuration?: Configuration) { /** * Registers an signed key and returns the developer managed signer status with an approval url. * @summary Register Signed Key - * @param {RegisterDeveloperManagedSignedKeyReqBody} registerDeveloperManagedSignedKeyReqBody + * @param {RegisterDeveloperManagedSignedKeyReqBody} register_developer_managed_signed_key_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `DeveloperManagedSigner` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/register-signed-key-for-developer-managed-signer) + * */ - async registerSignedKeyForDeveloperManagedSigner(registerDeveloperManagedSignedKeyReqBody: RegisterDeveloperManagedSignedKeyReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.registerSignedKeyForDeveloperManagedSigner(registerDeveloperManagedSignedKeyReqBody, options); + async registerSignedKeyForDeveloperManagedSigner(register_developer_managed_signed_key_req_body: RegisterDeveloperManagedSignedKeyReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.registerSignedKeyForDeveloperManagedSigner(register_developer_managed_signed_key_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['SignerApi.registerSignedKeyForDeveloperManagedSigner']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, - /** - * Gets information status of a signer by passing in a signer_uuid (Use post API to generate a signer) - * @summary Status - * @param {string} signerUuid - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async signer(signerUuid: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.signer(signerUuid, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['SignerApi.signer']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, } }; @@ -434,163 +490,427 @@ export const SignerApiFactory = function (configuration?: Configuration, basePat * @summary Create signer * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `Signer` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/create-signer) + * */ createSigner(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createSigner(options).then((request) => request(axios, basePath)); }, + /** + * Fetch authorization url (Fetched authorized url useful for SIWN login operation) + * @summary Fetch authorization url + * @param {SignerApiFetchAuthorizationUrlRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `AuthorizationUrlResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-authorization-url) + * + */ + fetchAuthorizationUrl(requestParameters: SignerApiFetchAuthorizationUrlRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchAuthorizationUrl(requestParameters.client_id, requestParameters.response_type, options).then((request) => request(axios, basePath)); + }, /** * Fetches the status of a developer managed signer by public key * @summary Status by public key - * @param {string} publicKey + * @param {SignerApiLookupDeveloperManagedSignerRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `DeveloperManagedSigner` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-developer-managed-signer) + * */ - developerManagedSigner(publicKey: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.developerManagedSigner(publicKey, options).then((request) => request(axios, basePath)); + lookupDeveloperManagedSigner(requestParameters: SignerApiLookupDeveloperManagedSignerRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.lookupDeveloperManagedSigner(requestParameters.public_key, options).then((request) => request(axios, basePath)); }, /** - * Fetch authorization url (Fetched authorized url useful for SIWN login operation) - * @summary Fetch authorization url - * @param {string} clientId - * @param {AuthorizationUrlResponseType} responseType + * Gets information status of a signer by passing in a signer_uuid (Use post API to generate a signer) + * @summary Status + * @param {SignerApiLookupSignerRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `Signer` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-signer) + * */ - fetchAuthorizationUrl(clientId: string, responseType: AuthorizationUrlResponseType, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.fetchAuthorizationUrl(clientId, responseType, options).then((request) => request(axios, basePath)); + lookupSigner(requestParameters: SignerApiLookupSignerRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.lookupSigner(requestParameters.signer_uuid, options).then((request) => request(axios, basePath)); }, /** * Publish a message to farcaster. The message must be signed by a signer managed by the developer. Use the @farcaster/core library to construct and sign the message. Use the Message.toJSON method on the signed message and pass the JSON in the body of this POST request. * @summary Publish message - * @param {object} body + * @param {SignerApiPublishMessageToFarcasterRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `object` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-message-to-farcaster) + * */ - publishMessage(body: object, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.publishMessage(body, options).then((request) => request(axios, basePath)); + publishMessageToFarcaster(requestParameters: SignerApiPublishMessageToFarcasterRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.publishMessageToFarcaster(requestParameters.body, options).then((request) => request(axios, basePath)); }, /** * Registers an app FID, deadline and a signature. Returns the signer status with an approval url. * @summary Register Signed Key - * @param {RegisterSignerKeyReqBody} registerSignerKeyReqBody + * @param {SignerApiRegisterSignedKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `Signer` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/register-signed-key) + * */ - registerSignedKey(registerSignerKeyReqBody: RegisterSignerKeyReqBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.registerSignedKey(registerSignerKeyReqBody, options).then((request) => request(axios, basePath)); + registerSignedKey(requestParameters: SignerApiRegisterSignedKeyRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.registerSignedKey(requestParameters.register_signer_key_req_body, options).then((request) => request(axios, basePath)); }, /** * Registers an signed key and returns the developer managed signer status with an approval url. * @summary Register Signed Key - * @param {RegisterDeveloperManagedSignedKeyReqBody} registerDeveloperManagedSignedKeyReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - registerSignedKeyForDeveloperManagedSigner(registerDeveloperManagedSignedKeyReqBody: RegisterDeveloperManagedSignedKeyReqBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.registerSignedKeyForDeveloperManagedSigner(registerDeveloperManagedSignedKeyReqBody, options).then((request) => request(axios, basePath)); - }, - /** - * Gets information status of a signer by passing in a signer_uuid (Use post API to generate a signer) - * @summary Status - * @param {string} signerUuid + * @param {SignerApiRegisterSignedKeyForDeveloperManagedSignerRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `DeveloperManagedSigner` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/register-signed-key-for-developer-managed-signer) + * */ - signer(signerUuid: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.signer(signerUuid, options).then((request) => request(axios, basePath)); + registerSignedKeyForDeveloperManagedSigner(requestParameters: SignerApiRegisterSignedKeyForDeveloperManagedSignerRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.registerSignedKeyForDeveloperManagedSigner(requestParameters.register_developer_managed_signed_key_req_body, options).then((request) => request(axios, basePath)); }, }; }; +/** + * SignerApi - interface + * @export + * @interface SignerApi + */ +export interface SignerApiInterface { + /** + * Creates a signer and returns the signer status. \\ **Note**: While tesing please reuse the signer, it costs money to approve a signer. + * @summary Create signer + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SignerApiInterface + * @returns {Promise} A promise that resolves to a `Signer` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/create-signer) + * + */ + createSigner(options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Fetch authorization url (Fetched authorized url useful for SIWN login operation) + * @summary Fetch authorization url + * @param {SignerApiFetchAuthorizationUrlRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SignerApiInterface + * @returns {Promise} A promise that resolves to a `AuthorizationUrlResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-authorization-url) + * + */ + fetchAuthorizationUrl(requestParameters: SignerApiFetchAuthorizationUrlRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Fetches the status of a developer managed signer by public key + * @summary Status by public key + * @param {SignerApiLookupDeveloperManagedSignerRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SignerApiInterface + * @returns {Promise} A promise that resolves to a `DeveloperManagedSigner` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-developer-managed-signer) + * + */ + lookupDeveloperManagedSigner(requestParameters: SignerApiLookupDeveloperManagedSignerRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Gets information status of a signer by passing in a signer_uuid (Use post API to generate a signer) + * @summary Status + * @param {SignerApiLookupSignerRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SignerApiInterface + * @returns {Promise} A promise that resolves to a `Signer` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-signer) + * + */ + lookupSigner(requestParameters: SignerApiLookupSignerRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Publish a message to farcaster. The message must be signed by a signer managed by the developer. Use the @farcaster/core library to construct and sign the message. Use the Message.toJSON method on the signed message and pass the JSON in the body of this POST request. + * @summary Publish message + * @param {SignerApiPublishMessageToFarcasterRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SignerApiInterface + * @returns {Promise} A promise that resolves to a `object` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-message-to-farcaster) + * + */ + publishMessageToFarcaster(requestParameters: SignerApiPublishMessageToFarcasterRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Registers an app FID, deadline and a signature. Returns the signer status with an approval url. + * @summary Register Signed Key + * @param {SignerApiRegisterSignedKeyRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SignerApiInterface + * @returns {Promise} A promise that resolves to a `Signer` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/register-signed-key) + * + */ + registerSignedKey(requestParameters: SignerApiRegisterSignedKeyRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Registers an signed key and returns the developer managed signer status with an approval url. + * @summary Register Signed Key + * @param {SignerApiRegisterSignedKeyForDeveloperManagedSignerRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SignerApiInterface + * @returns {Promise} A promise that resolves to a `DeveloperManagedSigner` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/register-signed-key-for-developer-managed-signer) + * + */ + registerSignedKeyForDeveloperManagedSigner(requestParameters: SignerApiRegisterSignedKeyForDeveloperManagedSignerRequest, options?: RawAxiosRequestConfig): AxiosPromise; + +} + +/** + * Request parameters for fetchAuthorizationUrl operation in SignerApi. + * @export + * @interface SignerApiFetchAuthorizationUrlRequest + */ +export interface SignerApiFetchAuthorizationUrlRequest { + /** + * + * + * + * @type {string} + * @memberof SignerApiFetchAuthorizationUrl + */ + readonly client_id: string + + /** + * + * + * + * @type {AuthorizationUrlResponseType} + * @memberof SignerApiFetchAuthorizationUrl + */ + readonly response_type: AuthorizationUrlResponseType +} + +/** + * Request parameters for lookupDeveloperManagedSigner operation in SignerApi. + * @export + * @interface SignerApiLookupDeveloperManagedSignerRequest + */ +export interface SignerApiLookupDeveloperManagedSignerRequest { + /** + * + * + * + * @type {string} + * @memberof SignerApiLookupDeveloperManagedSigner + */ + readonly public_key: string +} + +/** + * Request parameters for lookupSigner operation in SignerApi. + * @export + * @interface SignerApiLookupSignerRequest + */ +export interface SignerApiLookupSignerRequest { + /** + * + * + * + * @type {string} + * @memberof SignerApiLookupSigner + */ + readonly signer_uuid: string +} + +/** + * Request parameters for publishMessageToFarcaster operation in SignerApi. + * @export + * @interface SignerApiPublishMessageToFarcasterRequest + */ +export interface SignerApiPublishMessageToFarcasterRequest { + /** + * + * + * + * @type {object} + * @memberof SignerApiPublishMessageToFarcaster + */ + readonly body: object +} + +/** + * Request parameters for registerSignedKey operation in SignerApi. + * @export + * @interface SignerApiRegisterSignedKeyRequest + */ +export interface SignerApiRegisterSignedKeyRequest { + /** + * + * + * + * @type {RegisterSignerKeyReqBody} + * @memberof SignerApiRegisterSignedKey + */ + readonly register_signer_key_req_body: RegisterSignerKeyReqBody +} + +/** + * Request parameters for registerSignedKeyForDeveloperManagedSigner operation in SignerApi. + * @export + * @interface SignerApiRegisterSignedKeyForDeveloperManagedSignerRequest + */ +export interface SignerApiRegisterSignedKeyForDeveloperManagedSignerRequest { + /** + * + * + * + * @type {RegisterDeveloperManagedSignedKeyReqBody} + * @memberof SignerApiRegisterSignedKeyForDeveloperManagedSigner + */ + readonly register_developer_managed_signed_key_req_body: RegisterDeveloperManagedSignedKeyReqBody +} + /** * SignerApi - object-oriented interface * @export * @class SignerApi * @extends {BaseAPI} */ -export class SignerApi extends BaseAPI { +export class SignerApi extends BaseAPI implements SignerApiInterface { /** * Creates a signer and returns the signer status. \\ **Note**: While tesing please reuse the signer, it costs money to approve a signer. * @summary Create signer * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SignerApi + * @returns {Promise} A promise that resolves to a `Signer` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/create-signer) + * */ public createSigner(options?: RawAxiosRequestConfig) { return SignerApiFp(this.configuration).createSigner(options).then((request) => request(this.axios, this.basePath)); } /** - * Fetches the status of a developer managed signer by public key - * @summary Status by public key - * @param {string} publicKey + * Fetch authorization url (Fetched authorized url useful for SIWN login operation) + * @summary Fetch authorization url + * @param {SignerApiFetchAuthorizationUrlRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SignerApi + * @returns {Promise} A promise that resolves to a `AuthorizationUrlResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-authorization-url) + * */ - public developerManagedSigner(publicKey: string, options?: RawAxiosRequestConfig) { - return SignerApiFp(this.configuration).developerManagedSigner(publicKey, options).then((request) => request(this.axios, this.basePath)); + public fetchAuthorizationUrl(requestParameters: SignerApiFetchAuthorizationUrlRequest, options?: RawAxiosRequestConfig) { + return SignerApiFp(this.configuration).fetchAuthorizationUrl(requestParameters.client_id, requestParameters.response_type, options).then((request) => request(this.axios, this.basePath)); } /** - * Fetch authorization url (Fetched authorized url useful for SIWN login operation) - * @summary Fetch authorization url - * @param {string} clientId - * @param {AuthorizationUrlResponseType} responseType + * Fetches the status of a developer managed signer by public key + * @summary Status by public key + * @param {SignerApiLookupDeveloperManagedSignerRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SignerApi + * @returns {Promise} A promise that resolves to a `DeveloperManagedSigner` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-developer-managed-signer) + * */ - public fetchAuthorizationUrl(clientId: string, responseType: AuthorizationUrlResponseType, options?: RawAxiosRequestConfig) { - return SignerApiFp(this.configuration).fetchAuthorizationUrl(clientId, responseType, options).then((request) => request(this.axios, this.basePath)); + public lookupDeveloperManagedSigner(requestParameters: SignerApiLookupDeveloperManagedSignerRequest, options?: RawAxiosRequestConfig) { + return SignerApiFp(this.configuration).lookupDeveloperManagedSigner(requestParameters.public_key, options).then((request) => request(this.axios, this.basePath)); } /** - * Publish a message to farcaster. The message must be signed by a signer managed by the developer. Use the @farcaster/core library to construct and sign the message. Use the Message.toJSON method on the signed message and pass the JSON in the body of this POST request. - * @summary Publish message - * @param {object} body + * Gets information status of a signer by passing in a signer_uuid (Use post API to generate a signer) + * @summary Status + * @param {SignerApiLookupSignerRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SignerApi + * @returns {Promise} A promise that resolves to a `Signer` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-signer) + * */ - public publishMessage(body: object, options?: RawAxiosRequestConfig) { - return SignerApiFp(this.configuration).publishMessage(body, options).then((request) => request(this.axios, this.basePath)); + public lookupSigner(requestParameters: SignerApiLookupSignerRequest, options?: RawAxiosRequestConfig) { + return SignerApiFp(this.configuration).lookupSigner(requestParameters.signer_uuid, options).then((request) => request(this.axios, this.basePath)); } /** - * Registers an app FID, deadline and a signature. Returns the signer status with an approval url. - * @summary Register Signed Key - * @param {RegisterSignerKeyReqBody} registerSignerKeyReqBody + * Publish a message to farcaster. The message must be signed by a signer managed by the developer. Use the @farcaster/core library to construct and sign the message. Use the Message.toJSON method on the signed message and pass the JSON in the body of this POST request. + * @summary Publish message + * @param {SignerApiPublishMessageToFarcasterRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SignerApi + * @returns {Promise} A promise that resolves to a `object` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-message-to-farcaster) + * */ - public registerSignedKey(registerSignerKeyReqBody: RegisterSignerKeyReqBody, options?: RawAxiosRequestConfig) { - return SignerApiFp(this.configuration).registerSignedKey(registerSignerKeyReqBody, options).then((request) => request(this.axios, this.basePath)); + public publishMessageToFarcaster(requestParameters: SignerApiPublishMessageToFarcasterRequest, options?: RawAxiosRequestConfig) { + return SignerApiFp(this.configuration).publishMessageToFarcaster(requestParameters.body, options).then((request) => request(this.axios, this.basePath)); } /** - * Registers an signed key and returns the developer managed signer status with an approval url. + * Registers an app FID, deadline and a signature. Returns the signer status with an approval url. * @summary Register Signed Key - * @param {RegisterDeveloperManagedSignedKeyReqBody} registerDeveloperManagedSignedKeyReqBody + * @param {SignerApiRegisterSignedKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SignerApi + * @returns {Promise} A promise that resolves to a `Signer` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/register-signed-key) + * */ - public registerSignedKeyForDeveloperManagedSigner(registerDeveloperManagedSignedKeyReqBody: RegisterDeveloperManagedSignedKeyReqBody, options?: RawAxiosRequestConfig) { - return SignerApiFp(this.configuration).registerSignedKeyForDeveloperManagedSigner(registerDeveloperManagedSignedKeyReqBody, options).then((request) => request(this.axios, this.basePath)); + public registerSignedKey(requestParameters: SignerApiRegisterSignedKeyRequest, options?: RawAxiosRequestConfig) { + return SignerApiFp(this.configuration).registerSignedKey(requestParameters.register_signer_key_req_body, options).then((request) => request(this.axios, this.basePath)); } /** - * Gets information status of a signer by passing in a signer_uuid (Use post API to generate a signer) - * @summary Status - * @param {string} signerUuid + * Registers an signed key and returns the developer managed signer status with an approval url. + * @summary Register Signed Key + * @param {SignerApiRegisterSignedKeyForDeveloperManagedSignerRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SignerApi + * @returns {Promise} A promise that resolves to a `DeveloperManagedSigner` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/register-signed-key-for-developer-managed-signer) + * */ - public signer(signerUuid: string, options?: RawAxiosRequestConfig) { - return SignerApiFp(this.configuration).signer(signerUuid, options).then((request) => request(this.axios, this.basePath)); + public registerSignedKeyForDeveloperManagedSigner(requestParameters: SignerApiRegisterSignedKeyForDeveloperManagedSignerRequest, options?: RawAxiosRequestConfig) { + return SignerApiFp(this.configuration).registerSignedKeyForDeveloperManagedSigner(requestParameters.register_developer_managed_signed_key_req_body, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/src/neynar-api/v2/openapi-farcaster/apis/storage-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/storage-api.ts index 2c57449f..a7eab1f9 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/storage-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/storage-api.ts @@ -42,13 +42,17 @@ export const StorageApiAxiosParamCreator = function (configuration?: Configurati /** * This api will help you rent units of storage for an year for a specific FID. A storage unit lets you store 5000 casts, 2500 reactions and 2500 links. * @summary Buy storage - * @param {BuyStorageReqBody} buyStorageReqBody + * @param {BuyStorageReqBody} buy_storage_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `StorageAllocationsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/buy-storage) + * */ - buyStorage: async (buyStorageReqBody: BuyStorageReqBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'buyStorageReqBody' is not null or undefined - assertParamExists('buyStorage', 'buyStorageReqBody', buyStorageReqBody) + buyStorage: async (buy_storage_req_body: BuyStorageReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'buy_storage_req_body' is not null or undefined + assertParamExists('buyStorage', 'buy_storage_req_body', buy_storage_req_body) const localVarPath = `/farcaster/storage/buy`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -71,7 +75,7 @@ export const StorageApiAxiosParamCreator = function (configuration?: Configurati setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(buyStorageReqBody, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(buy_storage_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -81,13 +85,17 @@ export const StorageApiAxiosParamCreator = function (configuration?: Configurati /** * Fetches storage allocations for a given user * @summary Allocation of user - * @param {number} fid + * @param {number} fid * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `StorageAllocationsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-user-storage-allocations) + * */ - storageAllocations: async (fid: number, options: RawAxiosRequestConfig = {}): Promise => { + lookupUserStorageAllocations: async (fid: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'fid' is not null or undefined - assertParamExists('storageAllocations', 'fid', fid) + assertParamExists('lookupUserStorageAllocations', 'fid', fid) const localVarPath = `/farcaster/storage/allocations`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -121,13 +129,17 @@ export const StorageApiAxiosParamCreator = function (configuration?: Configurati /** * Fetches storage usage for a given user * @summary Usage of user - * @param {number} fid + * @param {number} fid * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `StorageUsageResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-user-storage-usage) + * */ - storageUsage: async (fid: number, options: RawAxiosRequestConfig = {}): Promise => { + lookupUserStorageUsage: async (fid: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'fid' is not null or undefined - assertParamExists('storageUsage', 'fid', fid) + assertParamExists('lookupUserStorageUsage', 'fid', fid) const localVarPath = `/farcaster/storage/usage`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -171,12 +183,16 @@ export const StorageApiFp = function(configuration?: Configuration) { /** * This api will help you rent units of storage for an year for a specific FID. A storage unit lets you store 5000 casts, 2500 reactions and 2500 links. * @summary Buy storage - * @param {BuyStorageReqBody} buyStorageReqBody + * @param {BuyStorageReqBody} buy_storage_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `StorageAllocationsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/buy-storage) + * */ - async buyStorage(buyStorageReqBody: BuyStorageReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.buyStorage(buyStorageReqBody, options); + async buyStorage(buy_storage_req_body: BuyStorageReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.buyStorage(buy_storage_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['StorageApi.buyStorage']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); @@ -184,27 +200,35 @@ export const StorageApiFp = function(configuration?: Configuration) { /** * Fetches storage allocations for a given user * @summary Allocation of user - * @param {number} fid + * @param {number} fid * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `StorageAllocationsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-user-storage-allocations) + * */ - async storageAllocations(fid: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.storageAllocations(fid, options); + async lookupUserStorageAllocations(fid: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.lookupUserStorageAllocations(fid, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['StorageApi.storageAllocations']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['StorageApi.lookupUserStorageAllocations']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Fetches storage usage for a given user * @summary Usage of user - * @param {number} fid + * @param {number} fid * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `StorageUsageResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-user-storage-usage) + * */ - async storageUsage(fid: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.storageUsage(fid, options); + async lookupUserStorageUsage(fid: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.lookupUserStorageUsage(fid, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['StorageApi.storageUsage']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['StorageApi.lookupUserStorageUsage']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } @@ -220,77 +244,199 @@ export const StorageApiFactory = function (configuration?: Configuration, basePa /** * This api will help you rent units of storage for an year for a specific FID. A storage unit lets you store 5000 casts, 2500 reactions and 2500 links. * @summary Buy storage - * @param {BuyStorageReqBody} buyStorageReqBody + * @param {StorageApiBuyStorageRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `StorageAllocationsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/buy-storage) + * */ - buyStorage(buyStorageReqBody: BuyStorageReqBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.buyStorage(buyStorageReqBody, options).then((request) => request(axios, basePath)); + buyStorage(requestParameters: StorageApiBuyStorageRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.buyStorage(requestParameters.buy_storage_req_body, options).then((request) => request(axios, basePath)); }, /** * Fetches storage allocations for a given user * @summary Allocation of user - * @param {number} fid + * @param {StorageApiLookupUserStorageAllocationsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `StorageAllocationsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-user-storage-allocations) + * */ - storageAllocations(fid: number, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.storageAllocations(fid, options).then((request) => request(axios, basePath)); + lookupUserStorageAllocations(requestParameters: StorageApiLookupUserStorageAllocationsRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.lookupUserStorageAllocations(requestParameters.fid, options).then((request) => request(axios, basePath)); }, /** * Fetches storage usage for a given user * @summary Usage of user - * @param {number} fid + * @param {StorageApiLookupUserStorageUsageRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `StorageUsageResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-user-storage-usage) + * */ - storageUsage(fid: number, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.storageUsage(fid, options).then((request) => request(axios, basePath)); + lookupUserStorageUsage(requestParameters: StorageApiLookupUserStorageUsageRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.lookupUserStorageUsage(requestParameters.fid, options).then((request) => request(axios, basePath)); }, }; }; +/** + * StorageApi - interface + * @export + * @interface StorageApi + */ +export interface StorageApiInterface { + /** + * This api will help you rent units of storage for an year for a specific FID. A storage unit lets you store 5000 casts, 2500 reactions and 2500 links. + * @summary Buy storage + * @param {StorageApiBuyStorageRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StorageApiInterface + * @returns {Promise} A promise that resolves to a `StorageAllocationsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/buy-storage) + * + */ + buyStorage(requestParameters: StorageApiBuyStorageRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Fetches storage allocations for a given user + * @summary Allocation of user + * @param {StorageApiLookupUserStorageAllocationsRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StorageApiInterface + * @returns {Promise} A promise that resolves to a `StorageAllocationsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-user-storage-allocations) + * + */ + lookupUserStorageAllocations(requestParameters: StorageApiLookupUserStorageAllocationsRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Fetches storage usage for a given user + * @summary Usage of user + * @param {StorageApiLookupUserStorageUsageRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StorageApiInterface + * @returns {Promise} A promise that resolves to a `StorageUsageResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-user-storage-usage) + * + */ + lookupUserStorageUsage(requestParameters: StorageApiLookupUserStorageUsageRequest, options?: RawAxiosRequestConfig): AxiosPromise; + +} + +/** + * Request parameters for buyStorage operation in StorageApi. + * @export + * @interface StorageApiBuyStorageRequest + */ +export interface StorageApiBuyStorageRequest { + /** + * + * + * + * @type {BuyStorageReqBody} + * @memberof StorageApiBuyStorage + */ + readonly buy_storage_req_body: BuyStorageReqBody +} + +/** + * Request parameters for lookupUserStorageAllocations operation in StorageApi. + * @export + * @interface StorageApiLookupUserStorageAllocationsRequest + */ +export interface StorageApiLookupUserStorageAllocationsRequest { + /** + * + * + * + * @type {number} + * @memberof StorageApiLookupUserStorageAllocations + */ + readonly fid: number +} + +/** + * Request parameters for lookupUserStorageUsage operation in StorageApi. + * @export + * @interface StorageApiLookupUserStorageUsageRequest + */ +export interface StorageApiLookupUserStorageUsageRequest { + /** + * + * + * + * @type {number} + * @memberof StorageApiLookupUserStorageUsage + */ + readonly fid: number +} + /** * StorageApi - object-oriented interface * @export * @class StorageApi * @extends {BaseAPI} */ -export class StorageApi extends BaseAPI { +export class StorageApi extends BaseAPI implements StorageApiInterface { /** * This api will help you rent units of storage for an year for a specific FID. A storage unit lets you store 5000 casts, 2500 reactions and 2500 links. * @summary Buy storage - * @param {BuyStorageReqBody} buyStorageReqBody + * @param {StorageApiBuyStorageRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof StorageApi + * @returns {Promise} A promise that resolves to a `StorageAllocationsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/buy-storage) + * */ - public buyStorage(buyStorageReqBody: BuyStorageReqBody, options?: RawAxiosRequestConfig) { - return StorageApiFp(this.configuration).buyStorage(buyStorageReqBody, options).then((request) => request(this.axios, this.basePath)); + public buyStorage(requestParameters: StorageApiBuyStorageRequest, options?: RawAxiosRequestConfig) { + return StorageApiFp(this.configuration).buyStorage(requestParameters.buy_storage_req_body, options).then((request) => request(this.axios, this.basePath)); } /** * Fetches storage allocations for a given user * @summary Allocation of user - * @param {number} fid + * @param {StorageApiLookupUserStorageAllocationsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof StorageApi + * @returns {Promise} A promise that resolves to a `StorageAllocationsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-user-storage-allocations) + * */ - public storageAllocations(fid: number, options?: RawAxiosRequestConfig) { - return StorageApiFp(this.configuration).storageAllocations(fid, options).then((request) => request(this.axios, this.basePath)); + public lookupUserStorageAllocations(requestParameters: StorageApiLookupUserStorageAllocationsRequest, options?: RawAxiosRequestConfig) { + return StorageApiFp(this.configuration).lookupUserStorageAllocations(requestParameters.fid, options).then((request) => request(this.axios, this.basePath)); } /** * Fetches storage usage for a given user * @summary Usage of user - * @param {number} fid + * @param {StorageApiLookupUserStorageUsageRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof StorageApi + * @returns {Promise} A promise that resolves to a `StorageUsageResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-user-storage-usage) + * */ - public storageUsage(fid: number, options?: RawAxiosRequestConfig) { - return StorageApiFp(this.configuration).storageUsage(fid, options).then((request) => request(this.axios, this.basePath)); + public lookupUserStorageUsage(requestParameters: StorageApiLookupUserStorageUsageRequest, options?: RawAxiosRequestConfig) { + return StorageApiFp(this.configuration).lookupUserStorageUsage(requestParameters.fid, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/src/neynar-api/v2/openapi-farcaster/apis/subscribers-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/subscribers-api.ts index 1b78f249..18c08ca8 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/subscribers-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/subscribers-api.ts @@ -42,17 +42,21 @@ export const SubscribersApiAxiosParamCreator = function (configuration?: Configu /** * Fetch what FIDs and contracts a FID is subscribed to. * @summary Subscribed to - * @param {number} fid - * @param {SubscriptionProvider} subscriptionProvider - * @param {number} [viewerFid] + * @param {number} fid + * @param {SubscriptionProvider} subscription_provider + * @param {number} [viewer_fid] * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `SubscribedToResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscribed-to-for-fid) + * */ - subscribedTo: async (fid: number, subscriptionProvider: SubscriptionProvider, viewerFid?: number, options: RawAxiosRequestConfig = {}): Promise => { + fetchSubscribedToForFid: async (fid: number, subscription_provider: SubscriptionProvider, viewer_fid?: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'fid' is not null or undefined - assertParamExists('subscribedTo', 'fid', fid) - // verify required parameter 'subscriptionProvider' is not null or undefined - assertParamExists('subscribedTo', 'subscriptionProvider', subscriptionProvider) + assertParamExists('fetchSubscribedToForFid', 'fid', fid) + // verify required parameter 'subscription_provider' is not null or undefined + assertParamExists('fetchSubscribedToForFid', 'subscription_provider', subscription_provider) const localVarPath = `/farcaster/user/subscribed_to`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -72,12 +76,12 @@ export const SubscribersApiAxiosParamCreator = function (configuration?: Configu localVarQueryParameter['fid'] = fid; } - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; } - if (subscriptionProvider !== undefined) { - localVarQueryParameter['subscription_provider'] = subscriptionProvider; + if (subscription_provider !== undefined) { + localVarQueryParameter['subscription_provider'] = subscription_provider; } @@ -94,17 +98,21 @@ export const SubscribersApiAxiosParamCreator = function (configuration?: Configu /** * Fetch subscribers for a given FID\'s contracts. Doesn\'t return addresses that don\'t have an FID. * @summary Subscribers of a user - * @param {number} fid - * @param {SubscriptionProviders} subscriptionProvider - * @param {number} [viewerFid] + * @param {number} fid + * @param {SubscriptionProviders} subscription_provider + * @param {number} [viewer_fid] * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `SubscribersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscribers-for-fid) + * */ - subscribers: async (fid: number, subscriptionProvider: SubscriptionProviders, viewerFid?: number, options: RawAxiosRequestConfig = {}): Promise => { + fetchSubscribersForFid: async (fid: number, subscription_provider: SubscriptionProviders, viewer_fid?: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'fid' is not null or undefined - assertParamExists('subscribers', 'fid', fid) - // verify required parameter 'subscriptionProvider' is not null or undefined - assertParamExists('subscribers', 'subscriptionProvider', subscriptionProvider) + assertParamExists('fetchSubscribersForFid', 'fid', fid) + // verify required parameter 'subscription_provider' is not null or undefined + assertParamExists('fetchSubscribersForFid', 'subscription_provider', subscription_provider) const localVarPath = `/farcaster/user/subscribers`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -124,12 +132,12 @@ export const SubscribersApiAxiosParamCreator = function (configuration?: Configu localVarQueryParameter['fid'] = fid; } - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; } - if (subscriptionProvider !== undefined) { - localVarQueryParameter['subscription_provider'] = subscriptionProvider; + if (subscription_provider !== undefined) { + localVarQueryParameter['subscription_provider'] = subscription_provider; } @@ -146,16 +154,20 @@ export const SubscribersApiAxiosParamCreator = function (configuration?: Configu /** * Fetch created subscriptions for a given FID\'s. * @summary Subscriptions created by FID - * @param {number} fid - * @param {SubscriptionProvider} subscriptionProvider + * @param {number} fid + * @param {SubscriptionProvider} subscription_provider * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `SubscriptionsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscriptions-for-fid) + * */ - subscriptionsCreated: async (fid: number, subscriptionProvider: SubscriptionProvider, options: RawAxiosRequestConfig = {}): Promise => { + fetchSubscriptionsForFid: async (fid: number, subscription_provider: SubscriptionProvider, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'fid' is not null or undefined - assertParamExists('subscriptionsCreated', 'fid', fid) - // verify required parameter 'subscriptionProvider' is not null or undefined - assertParamExists('subscriptionsCreated', 'subscriptionProvider', subscriptionProvider) + assertParamExists('fetchSubscriptionsForFid', 'fid', fid) + // verify required parameter 'subscription_provider' is not null or undefined + assertParamExists('fetchSubscriptionsForFid', 'subscription_provider', subscription_provider) const localVarPath = `/farcaster/user/subscriptions_created`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -175,8 +187,8 @@ export const SubscribersApiAxiosParamCreator = function (configuration?: Configu localVarQueryParameter['fid'] = fid; } - if (subscriptionProvider !== undefined) { - localVarQueryParameter['subscription_provider'] = subscriptionProvider; + if (subscription_provider !== undefined) { + localVarQueryParameter['subscription_provider'] = subscription_provider; } @@ -203,45 +215,57 @@ export const SubscribersApiFp = function(configuration?: Configuration) { /** * Fetch what FIDs and contracts a FID is subscribed to. * @summary Subscribed to - * @param {number} fid - * @param {SubscriptionProvider} subscriptionProvider - * @param {number} [viewerFid] + * @param {number} fid + * @param {SubscriptionProvider} subscription_provider + * @param {number} [viewer_fid] * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `SubscribedToResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscribed-to-for-fid) + * */ - async subscribedTo(fid: number, subscriptionProvider: SubscriptionProvider, viewerFid?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.subscribedTo(fid, subscriptionProvider, viewerFid, options); + async fetchSubscribedToForFid(fid: number, subscription_provider: SubscriptionProvider, viewer_fid?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchSubscribedToForFid(fid, subscription_provider, viewer_fid, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['SubscribersApi.subscribedTo']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['SubscribersApi.fetchSubscribedToForFid']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Fetch subscribers for a given FID\'s contracts. Doesn\'t return addresses that don\'t have an FID. * @summary Subscribers of a user - * @param {number} fid - * @param {SubscriptionProviders} subscriptionProvider - * @param {number} [viewerFid] + * @param {number} fid + * @param {SubscriptionProviders} subscription_provider + * @param {number} [viewer_fid] * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `SubscribersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscribers-for-fid) + * */ - async subscribers(fid: number, subscriptionProvider: SubscriptionProviders, viewerFid?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.subscribers(fid, subscriptionProvider, viewerFid, options); + async fetchSubscribersForFid(fid: number, subscription_provider: SubscriptionProviders, viewer_fid?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchSubscribersForFid(fid, subscription_provider, viewer_fid, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['SubscribersApi.subscribers']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['SubscribersApi.fetchSubscribersForFid']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Fetch created subscriptions for a given FID\'s. * @summary Subscriptions created by FID - * @param {number} fid - * @param {SubscriptionProvider} subscriptionProvider + * @param {number} fid + * @param {SubscriptionProvider} subscription_provider * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `SubscriptionsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscriptions-for-fid) + * */ - async subscriptionsCreated(fid: number, subscriptionProvider: SubscriptionProvider, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.subscriptionsCreated(fid, subscriptionProvider, options); + async fetchSubscriptionsForFid(fid: number, subscription_provider: SubscriptionProvider, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchSubscriptionsForFid(fid, subscription_provider, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['SubscribersApi.subscriptionsCreated']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['SubscribersApi.fetchSubscriptionsForFid']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } @@ -257,87 +281,244 @@ export const SubscribersApiFactory = function (configuration?: Configuration, ba /** * Fetch what FIDs and contracts a FID is subscribed to. * @summary Subscribed to - * @param {number} fid - * @param {SubscriptionProvider} subscriptionProvider - * @param {number} [viewerFid] + * @param {SubscribersApiFetchSubscribedToForFidRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `SubscribedToResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscribed-to-for-fid) + * */ - subscribedTo(fid: number, subscriptionProvider: SubscriptionProvider, viewerFid?: number, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.subscribedTo(fid, subscriptionProvider, viewerFid, options).then((request) => request(axios, basePath)); + fetchSubscribedToForFid(requestParameters: SubscribersApiFetchSubscribedToForFidRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchSubscribedToForFid(requestParameters.fid, requestParameters.subscription_provider, requestParameters.viewer_fid, options).then((request) => request(axios, basePath)); }, /** * Fetch subscribers for a given FID\'s contracts. Doesn\'t return addresses that don\'t have an FID. * @summary Subscribers of a user - * @param {number} fid - * @param {SubscriptionProviders} subscriptionProvider - * @param {number} [viewerFid] + * @param {SubscribersApiFetchSubscribersForFidRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `SubscribersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscribers-for-fid) + * */ - subscribers(fid: number, subscriptionProvider: SubscriptionProviders, viewerFid?: number, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.subscribers(fid, subscriptionProvider, viewerFid, options).then((request) => request(axios, basePath)); + fetchSubscribersForFid(requestParameters: SubscribersApiFetchSubscribersForFidRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchSubscribersForFid(requestParameters.fid, requestParameters.subscription_provider, requestParameters.viewer_fid, options).then((request) => request(axios, basePath)); }, /** * Fetch created subscriptions for a given FID\'s. * @summary Subscriptions created by FID - * @param {number} fid - * @param {SubscriptionProvider} subscriptionProvider + * @param {SubscribersApiFetchSubscriptionsForFidRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `SubscriptionsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscriptions-for-fid) + * */ - subscriptionsCreated(fid: number, subscriptionProvider: SubscriptionProvider, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.subscriptionsCreated(fid, subscriptionProvider, options).then((request) => request(axios, basePath)); + fetchSubscriptionsForFid(requestParameters: SubscribersApiFetchSubscriptionsForFidRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchSubscriptionsForFid(requestParameters.fid, requestParameters.subscription_provider, options).then((request) => request(axios, basePath)); }, }; }; +/** + * SubscribersApi - interface + * @export + * @interface SubscribersApi + */ +export interface SubscribersApiInterface { + /** + * Fetch what FIDs and contracts a FID is subscribed to. + * @summary Subscribed to + * @param {SubscribersApiFetchSubscribedToForFidRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SubscribersApiInterface + * @returns {Promise} A promise that resolves to a `SubscribedToResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscribed-to-for-fid) + * + */ + fetchSubscribedToForFid(requestParameters: SubscribersApiFetchSubscribedToForFidRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Fetch subscribers for a given FID\'s contracts. Doesn\'t return addresses that don\'t have an FID. + * @summary Subscribers of a user + * @param {SubscribersApiFetchSubscribersForFidRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SubscribersApiInterface + * @returns {Promise} A promise that resolves to a `SubscribersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscribers-for-fid) + * + */ + fetchSubscribersForFid(requestParameters: SubscribersApiFetchSubscribersForFidRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Fetch created subscriptions for a given FID\'s. + * @summary Subscriptions created by FID + * @param {SubscribersApiFetchSubscriptionsForFidRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SubscribersApiInterface + * @returns {Promise} A promise that resolves to a `SubscriptionsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscriptions-for-fid) + * + */ + fetchSubscriptionsForFid(requestParameters: SubscribersApiFetchSubscriptionsForFidRequest, options?: RawAxiosRequestConfig): AxiosPromise; + +} + +/** + * Request parameters for fetchSubscribedToForFid operation in SubscribersApi. + * @export + * @interface SubscribersApiFetchSubscribedToForFidRequest + */ +export interface SubscribersApiFetchSubscribedToForFidRequest { + /** + * + * + * + * @type {number} + * @memberof SubscribersApiFetchSubscribedToForFid + */ + readonly fid: number + + /** + * + * + * + * @type {SubscriptionProvider} + * @memberof SubscribersApiFetchSubscribedToForFid + */ + readonly subscription_provider: SubscriptionProvider + + /** + * + * + * + * @type {number} + * @memberof SubscribersApiFetchSubscribedToForFid + */ + readonly viewer_fid?: number +} + +/** + * Request parameters for fetchSubscribersForFid operation in SubscribersApi. + * @export + * @interface SubscribersApiFetchSubscribersForFidRequest + */ +export interface SubscribersApiFetchSubscribersForFidRequest { + /** + * + * + * + * @type {number} + * @memberof SubscribersApiFetchSubscribersForFid + */ + readonly fid: number + + /** + * + * + * + * @type {SubscriptionProviders} + * @memberof SubscribersApiFetchSubscribersForFid + */ + readonly subscription_provider: SubscriptionProviders + + /** + * + * + * + * @type {number} + * @memberof SubscribersApiFetchSubscribersForFid + */ + readonly viewer_fid?: number +} + +/** + * Request parameters for fetchSubscriptionsForFid operation in SubscribersApi. + * @export + * @interface SubscribersApiFetchSubscriptionsForFidRequest + */ +export interface SubscribersApiFetchSubscriptionsForFidRequest { + /** + * + * + * + * @type {number} + * @memberof SubscribersApiFetchSubscriptionsForFid + */ + readonly fid: number + + /** + * + * + * + * @type {SubscriptionProvider} + * @memberof SubscribersApiFetchSubscriptionsForFid + */ + readonly subscription_provider: SubscriptionProvider +} + /** * SubscribersApi - object-oriented interface * @export * @class SubscribersApi * @extends {BaseAPI} */ -export class SubscribersApi extends BaseAPI { +export class SubscribersApi extends BaseAPI implements SubscribersApiInterface { /** * Fetch what FIDs and contracts a FID is subscribed to. * @summary Subscribed to - * @param {number} fid - * @param {SubscriptionProvider} subscriptionProvider - * @param {number} [viewerFid] + * @param {SubscribersApiFetchSubscribedToForFidRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SubscribersApi + * @returns {Promise} A promise that resolves to a `SubscribedToResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscribed-to-for-fid) + * */ - public subscribedTo(fid: number, subscriptionProvider: SubscriptionProvider, viewerFid?: number, options?: RawAxiosRequestConfig) { - return SubscribersApiFp(this.configuration).subscribedTo(fid, subscriptionProvider, viewerFid, options).then((request) => request(this.axios, this.basePath)); + public fetchSubscribedToForFid(requestParameters: SubscribersApiFetchSubscribedToForFidRequest, options?: RawAxiosRequestConfig) { + return SubscribersApiFp(this.configuration).fetchSubscribedToForFid(requestParameters.fid, requestParameters.subscription_provider, requestParameters.viewer_fid, options).then((request) => request(this.axios, this.basePath)); } /** * Fetch subscribers for a given FID\'s contracts. Doesn\'t return addresses that don\'t have an FID. * @summary Subscribers of a user - * @param {number} fid - * @param {SubscriptionProviders} subscriptionProvider - * @param {number} [viewerFid] + * @param {SubscribersApiFetchSubscribersForFidRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SubscribersApi + * @returns {Promise} A promise that resolves to a `SubscribersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscribers-for-fid) + * */ - public subscribers(fid: number, subscriptionProvider: SubscriptionProviders, viewerFid?: number, options?: RawAxiosRequestConfig) { - return SubscribersApiFp(this.configuration).subscribers(fid, subscriptionProvider, viewerFid, options).then((request) => request(this.axios, this.basePath)); + public fetchSubscribersForFid(requestParameters: SubscribersApiFetchSubscribersForFidRequest, options?: RawAxiosRequestConfig) { + return SubscribersApiFp(this.configuration).fetchSubscribersForFid(requestParameters.fid, requestParameters.subscription_provider, requestParameters.viewer_fid, options).then((request) => request(this.axios, this.basePath)); } /** * Fetch created subscriptions for a given FID\'s. * @summary Subscriptions created by FID - * @param {number} fid - * @param {SubscriptionProvider} subscriptionProvider + * @param {SubscribersApiFetchSubscriptionsForFidRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SubscribersApi + * @returns {Promise} A promise that resolves to a `SubscriptionsResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscriptions-for-fid) + * */ - public subscriptionsCreated(fid: number, subscriptionProvider: SubscriptionProvider, options?: RawAxiosRequestConfig) { - return SubscribersApiFp(this.configuration).subscriptionsCreated(fid, subscriptionProvider, options).then((request) => request(this.axios, this.basePath)); + public fetchSubscriptionsForFid(requestParameters: SubscribersApiFetchSubscriptionsForFidRequest, options?: RawAxiosRequestConfig) { + return SubscribersApiFp(this.configuration).fetchSubscriptionsForFid(requestParameters.fid, requestParameters.subscription_provider, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/src/neynar-api/v2/openapi-farcaster/apis/user-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/user-api.ts index 6b5483f0..47d92989 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/user-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/user-api.ts @@ -26,6 +26,8 @@ import type { AddVerificationReqBody } from '../models'; // @ts-ignore import type { BulkFollowResponse } from '../models'; // @ts-ignore +import type { BulkUsersByAddressResponse } from '../models'; +// @ts-ignore import type { BulkUsersResponse } from '../models'; // @ts-ignore import type { ConflictErrorRes } from '../models'; @@ -44,8 +46,6 @@ import type { RemoveVerificationReqBody } from '../models'; // @ts-ignore import type { UpdateUserReqBody } from '../models'; // @ts-ignore -import type { User } from '../models'; -// @ts-ignore import type { UserFIDResponse } from '../models'; // @ts-ignore import type { UserPowerLiteResponse } from '../models'; @@ -62,16 +62,20 @@ import type { UsersResponse } from '../models'; export const UserApiAxiosParamCreator = function (configuration?: Configuration) { return { /** - * Warpcast has deprecated the active badge. Use user/power endpoint instead. - * @summary Fetch active users - * @param {number} [limit] - * @param {string} [cursor] Pagination cursor. + * Removes verification for an eth address for the user \\ (In order to delete verification `signer_uuid` must be approved) + * @summary Delete verification + * @param {RemoveVerificationReqBody} remove_verification_req_body * @param {*} [options] Override http request option. - * @deprecated * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-verification) + * */ - activeUsers: async (limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/farcaster/user/active`; + deleteVerification: async (remove_verification_req_body: RemoveVerificationReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'remove_verification_req_body' is not null or undefined + assertParamExists('deleteVerification', 'remove_verification_req_body', remove_verification_req_body) + const localVarPath = `/farcaster/user/verification`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -79,26 +83,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; - } - + localVarHeaderParameter['Content-Type'] = 'application/json'; + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(remove_verification_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -106,16 +105,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Removes verification for an eth address for the user \\ (In order to delete verification `signer_uuid` must be approved) - * @summary Delete verification - * @param {RemoveVerificationReqBody} removeVerificationReqBody + * Fetches information about multiple users based on FIDs + * @summary By FIDs + * @param {string} fids Comma separated list of FIDs, up to 100 at a time + * @param {number} [viewer_fid] * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `BulkUsersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-bulk-users) + * */ - farcasterUserVerificationDelete: async (removeVerificationReqBody: RemoveVerificationReqBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'removeVerificationReqBody' is not null or undefined - assertParamExists('farcasterUserVerificationDelete', 'removeVerificationReqBody', removeVerificationReqBody) - const localVarPath = `/farcaster/user/verification`; + fetchBulkUsers: async (fids: string, viewer_fid?: number, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'fids' is not null or undefined + assertParamExists('fetchBulkUsers', 'fids', fids) + const localVarPath = `/farcaster/user/bulk`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -123,21 +127,26 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) + if (fids !== undefined) { + localVarQueryParameter['fids'] = fids; + } - - localVarHeaderParameter['Content-Type'] = 'application/json'; + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(removeVerificationReqBody, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -145,16 +154,22 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Adds verification for an eth address or contract for the user \\ (In order to add verification `signer_uuid` must be approved) - * @summary Add verification - * @param {AddVerificationReqBody} addVerificationReqBody + * Fetches all users based on multiple Ethereum or Solana addresses. Each farcaster user has a custody Ethereum address and optionally verified Ethereum or Solana addresses. This endpoint returns all users that have any of the given addresses as their custody or verified Ethereum or Solana addresses. A custody address can be associated with only 1 farcaster user at a time but a verified address can be associated with multiple users. You can pass in Ethereum and Solana addresses, comma separated, in the same request. The response will contain users associated with the given addresses. + * @summary By Eth or Sol addresses + * @param {string} addresses Comma separated list of Ethereum addresses, up to 350 at a time + * @param {string} [address_types] Customize which address types the request should search for. This is a comma-separated string that can include the following values: \'custody_address\' and \'verified_address\'. By default api returns both. To select multiple types, use a comma-separated list of these values. + * @param {number} [viewer_fid] * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `BulkUsersByAddressResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-bulk-users-by-ethereum-address) + * */ - farcasterUserVerificationPost: async (addVerificationReqBody: AddVerificationReqBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'addVerificationReqBody' is not null or undefined - assertParamExists('farcasterUserVerificationPost', 'addVerificationReqBody', addVerificationReqBody) - const localVarPath = `/farcaster/user/verification`; + fetchBulkUsersByEthereumAddress: async (addresses: string, address_types?: string, viewer_fid?: number, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'addresses' is not null or undefined + assertParamExists('fetchBulkUsersByEthereumAddress', 'addresses', addresses) + const localVarPath = `/farcaster/user/bulk-by-address`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -162,21 +177,30 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) + if (addresses !== undefined) { + localVarQueryParameter['addresses'] = addresses; + } + + if (address_types !== undefined) { + localVarQueryParameter['address_types'] = address_types; + } + + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; + } - - localVarHeaderParameter['Content-Type'] = 'application/json'; + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(addVerificationReqBody, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -184,22 +208,20 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Fetches a list of users given a location - * @summary By location - * @param {number} latitude Latitude of the location - * @param {number} longitude Longitude of the location - * @param {number} [viewerFid] FID of the user viewing the feed. Providing this will return a list of users that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {number} [limit] Number of results to fetch - * @param {string} [cursor] Pagination cursor + * Fetches power users based on Warpcast power badges. Information is updated once a day. + * @summary Power users + * @param {number} [viewer_fid] + * @param {number} [limit] Number of power users to fetch (Default: 25, Maximum: 100) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `UsersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-power-users) + * */ - fetchUsersByLocation: async (latitude: number, longitude: number, viewerFid?: number, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'latitude' is not null or undefined - assertParamExists('fetchUsersByLocation', 'latitude', latitude) - // verify required parameter 'longitude' is not null or undefined - assertParamExists('fetchUsersByLocation', 'longitude', longitude) - const localVarPath = `/farcaster/user/by_location`; + fetchPowerUsers: async (viewer_fid?: number, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/farcaster/user/power`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -214,16 +236,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (latitude !== undefined) { - localVarQueryParameter['latitude'] = latitude; - } - - if (longitude !== undefined) { - localVarQueryParameter['longitude'] = longitude; - } - - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; } if (limit !== undefined) { @@ -246,16 +260,17 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Follow a user \\ (In order to follow a user `signer_uuid` must be approved) - * @summary Follow user - * @param {FollowReqBody} followReqBody + * Fetches power users and respond in a backwards compatible format to Warpcast\'s deprecated power badge endpoint. + * @summary Power user FIDs * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `UserPowerLiteResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-power-users-lite) + * */ - followUser: async (followReqBody: FollowReqBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'followReqBody' is not null or undefined - assertParamExists('followUser', 'followReqBody', followReqBody) - const localVarPath = `/farcaster/user/follow`; + fetchPowerUsersLite: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/farcaster/user/power_lite`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -263,7 +278,7 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -272,12 +287,9 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(followReqBody, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -285,13 +297,26 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Fetches FID to [assign it to new user](https://docs.neynar.com/reference/register-user) - * @summary Fetch fresh FID + * Fetches a list of users given a location + * @summary By location + * @param {number} latitude Latitude of the location + * @param {number} longitude Longitude of the location + * @param {number} [viewer_fid] FID of the user viewing the feed. Providing this will return a list of users that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100) + * @param {string} [cursor] Pagination cursor * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `UsersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-users-by-location) + * */ - getFreshFid: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/farcaster/user/fid`; + fetchUsersByLocation: async (latitude: number, longitude: number, viewer_fid?: number, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'latitude' is not null or undefined + assertParamExists('fetchUsersByLocation', 'latitude', latitude) + // verify required parameter 'longitude' is not null or undefined + assertParamExists('fetchUsersByLocation', 'longitude', longitude) + const localVarPath = `/farcaster/user/by_location`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -306,6 +331,26 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) + if (latitude !== undefined) { + localVarQueryParameter['latitude'] = latitude; + } + + if (longitude !== undefined) { + localVarQueryParameter['longitude'] = longitude; + } + + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); @@ -318,16 +363,20 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Lookup a user by custody-address - * @summary By custody-address - * @param {string} custodyAddress Custody Address associated with mnemonic + * Follow a user \\ (In order to follow a user `signer_uuid` must be approved) + * @summary Follow user + * @param {FollowReqBody} follow_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `BulkFollowResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/follow-user) + * */ - lookupUserByCustodyAddress: async (custodyAddress: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'custodyAddress' is not null or undefined - assertParamExists('lookupUserByCustodyAddress', 'custodyAddress', custodyAddress) - const localVarPath = `/farcaster/user/custody-address`; + followUser: async (follow_req_body: FollowReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'follow_req_body' is not null or undefined + assertParamExists('followUser', 'follow_req_body', follow_req_body) + const localVarPath = `/farcaster/user/follow`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -335,22 +384,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (custodyAddress !== undefined) { - localVarQueryParameter['custody_address'] = custodyAddress; - } - + localVarHeaderParameter['Content-Type'] = 'application/json'; + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(follow_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -358,16 +406,17 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Fetches power users based on Warpcast power badges. Information is updated once a day. - * @summary Power users - * @param {number} [viewerFid] - * @param {number} [limit] Number of power users to fetch, max 100 - * @param {string} [cursor] Pagination cursor. + * Fetches FID to [assign it to new user](https://docs.neynar.com/reference/register-user) + * @summary Fetch fresh FID * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `UserFIDResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/get-fresh-account-fid) + * */ - powerUsers: async (viewerFid?: number, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/farcaster/user/power`; + getFreshAccountFID: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/farcaster/user/fid`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -382,18 +431,6 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; - } - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; - } - setSearchParams(localVarUrlObj, localVarQueryParameter); @@ -406,16 +443,20 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Register account on farcaster. **Note:** This API must be called within 10 minutes of the fetch FID API call (i.e., /v2/farcaster/user/fid). Otherwise, Neynar will assign this FID to another available user. - * @summary Register new account - * @param {RegisterUserReqBody} registerUserReqBody + * Lookup a user by custody-address + * @summary By custody-address + * @param {string} custody_address Custody Address associated with mnemonic * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `UserResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-user-by-custody-address) + * */ - registerUser: async (registerUserReqBody: RegisterUserReqBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'registerUserReqBody' is not null or undefined - assertParamExists('registerUser', 'registerUserReqBody', registerUserReqBody) - const localVarPath = `/farcaster/user`; + lookupUserByCustodyAddress: async (custody_address: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'custody_address' is not null or undefined + assertParamExists('lookupUserByCustodyAddress', 'custody_address', custody_address) + const localVarPath = `/farcaster/user/custody-address`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -423,21 +464,22 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) + if (custody_address !== undefined) { + localVarQueryParameter['custody_address'] = custody_address; + } - - localVarHeaderParameter['Content-Type'] = 'application/json'; + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(registerUserReqBody, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -445,16 +487,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Unfollow a user \\ (In order to unfollow a user `signer_uuid` must be approved) - * @summary Unfollow user - * @param {FollowReqBody} followReqBody + * Fetches a single hydrated user object given a username + * @summary By username + * @param {string} username Username of the user to fetch + * @param {number} [viewer_fid] * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `UserResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-user-by-username) + * */ - unfollowUser: async (followReqBody: FollowReqBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'followReqBody' is not null or undefined - assertParamExists('unfollowUser', 'followReqBody', followReqBody) - const localVarPath = `/farcaster/user/follow`; + lookupUserByUsername: async (username: string, viewer_fid?: number, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'username' is not null or undefined + assertParamExists('lookupUserByUsername', 'username', username) + const localVarPath = `/farcaster/user/by_username`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -462,21 +509,26 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) + if (username !== undefined) { + localVarQueryParameter['username'] = username; + } + + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; + } - - localVarHeaderParameter['Content-Type'] = 'application/json'; + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(followReqBody, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -484,16 +536,20 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Update user profile \\ (In order to update user\'s profile `signer_uuid` must be approved) - * @summary Update user profile - * @param {UpdateUserReqBody} updateUserReqBody + * Adds verification for an eth address or contract for the user \\ (In order to add verification `signer_uuid` must be approved) + * @summary Add verification + * @param {AddVerificationReqBody} add_verification_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-verification) + * */ - updateUser: async (updateUserReqBody: UpdateUserReqBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'updateUserReqBody' is not null or undefined - assertParamExists('updateUser', 'updateUserReqBody', updateUserReqBody) - const localVarPath = `/farcaster/user`; + publishVerification: async (add_verification_req_body: AddVerificationReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'add_verification_req_body' is not null or undefined + assertParamExists('publishVerification', 'add_verification_req_body', add_verification_req_body) + const localVarPath = `/farcaster/user/verification`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -501,7 +557,7 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -515,7 +571,7 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(updateUserReqBody, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(add_verification_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -523,17 +579,20 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Fetches information about multiple users based on FIDs - * @summary By FIDs - * @param {string} fids Comma separated list of FIDs, up to 100 at a time - * @param {number} [viewerFid] + * Register account on farcaster. **Note:** This API must be called within 10 minutes of the fetch FID API call (i.e., /v2/farcaster/user/fid). Otherwise, Neynar will assign this FID to another available user. + * @summary Register new account + * @param {RegisterUserReqBody} register_user_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `RegisterUserResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/register-account) + * */ - userBulk: async (fids: string, viewerFid?: number, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'fids' is not null or undefined - assertParamExists('userBulk', 'fids', fids) - const localVarPath = `/farcaster/user/bulk`; + registerAccount: async (register_user_req_body: RegisterUserReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'register_user_req_body' is not null or undefined + assertParamExists('registerAccount', 'register_user_req_body', register_user_req_body) + const localVarPath = `/farcaster/user`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -541,26 +600,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (fids !== undefined) { - localVarQueryParameter['fids'] = fids; - } - - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; - } - + localVarHeaderParameter['Content-Type'] = 'application/json'; + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(register_user_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -568,18 +622,23 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Fetches all users based on multiple Ethereum or Solana addresses. Each farcaster user has a custody Ethereum address and optionally verified Ethereum or Solana addresses. This endpoint returns all users that have any of the given addresses as their custody or verified Ethereum or Solana addresses. A custody address can be associated with only 1 farcaster user at a time but a verified address can be associated with multiple users. You can pass in Ethereum and Solana addresses, comma separated, in the same request. The response will contain users associated with the given addresses. - * @summary By Eth or Sol addresses - * @param {string} addresses Comma separated list of Ethereum addresses, up to 350 at a time - * @param {string} [addressTypes] Customize which address types the request should search for. This is a comma-separated string that can include the following values: \'custody_address\' and \'verified_address\'. By default api returns both. To select multiple types, use a comma-separated list of these values. - * @param {number} [viewerFid] + * Search for Usernames + * @summary Search for Usernames + * @param {string} q + * @param {number} [viewer_fid] Providing this will return search results that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {number} [limit] Number of users to fetch (Default: 5, Maximum: 10) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `UserSearchResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/search-user) + * */ - userBulkByAddress: async (addresses: string, addressTypes?: string, viewerFid?: number, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'addresses' is not null or undefined - assertParamExists('userBulkByAddress', 'addresses', addresses) - const localVarPath = `/farcaster/user/bulk-by-address`; + searchUser: async (q: string, viewer_fid?: number, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'q' is not null or undefined + assertParamExists('searchUser', 'q', q) + const localVarPath = `/farcaster/user/search`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -594,16 +653,20 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (addresses !== undefined) { - localVarQueryParameter['addresses'] = addresses; + if (q !== undefined) { + localVarQueryParameter['q'] = q; + } + + if (viewer_fid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewer_fid; } - if (addressTypes !== undefined) { - localVarQueryParameter['address_types'] = addressTypes; + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; } - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; } @@ -618,17 +681,20 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Fetches a single hydrated user object given a username - * @summary By username - * @param {string} username Username of the user to fetch - * @param {number} [viewerFid] + * Unfollow a user \\ (In order to unfollow a user `signer_uuid` must be approved) + * @summary Unfollow user + * @param {FollowReqBody} follow_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `BulkFollowResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/unfollow-user) + * */ - userByUsernameV2: async (username: string, viewerFid?: number, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'username' is not null or undefined - assertParamExists('userByUsernameV2', 'username', username) - const localVarPath = `/farcaster/user/by_username`; + unfollowUser: async (follow_req_body: FollowReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'follow_req_body' is not null or undefined + assertParamExists('unfollowUser', 'follow_req_body', follow_req_body) + const localVarPath = `/farcaster/user/follow`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -636,26 +702,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (username !== undefined) { - localVarQueryParameter['username'] = username; - } - - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; - } - + localVarHeaderParameter['Content-Type'] = 'application/json'; + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(follow_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -663,13 +724,20 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Fetches power users and respond in a backwards compatible format to Warpcast\'s deprecated power badge endpoint. - * @summary Power user FIDs + * Update user profile \\ (In order to update user\'s profile `signer_uuid` must be approved) + * @summary Update user profile + * @param {UpdateUserReqBody} update_user_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/update-user) + * */ - userPowerLite: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/farcaster/user/power_lite`; + updateUser: async (update_user_req_body: UpdateUserReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'update_user_req_body' is not null or undefined + assertParamExists('updateUser', 'update_user_req_body', update_user_req_body) + const localVarPath = `/farcaster/user`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -677,7 +745,7 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -686,134 +754,134 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) + localVarHeaderParameter['Content-Type'] = 'application/json'; + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(update_user_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, + } +}; + +/** + * UserApi - functional programming interface + * @export + */ +export const UserApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = UserApiAxiosParamCreator(configuration) + return { /** - * Search for Usernames - * @summary Search for Usernames - * @param {string} q - * @param {number} [viewerFid] Providing this will return search results that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {number} [limit] - * @param {string} [cursor] Pagination cursor. + * Removes verification for an eth address for the user \\ (In order to delete verification `signer_uuid` must be approved) + * @summary Delete verification + * @param {RemoveVerificationReqBody} remove_verification_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-verification) + * */ - userSearch: async (q: string, viewerFid?: number, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'q' is not null or undefined - assertParamExists('userSearch', 'q', q) - const localVarPath = `/farcaster/user/search`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication ApiKeyAuth required - await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - - if (q !== undefined) { - localVarQueryParameter['q'] = q; - } - - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; - } - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; + async deleteVerification(remove_verification_req_body: RemoveVerificationReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteVerification(remove_verification_req_body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['UserApi.deleteVerification']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, - } -}; - -/** - * UserApi - functional programming interface - * @export - */ -export const UserApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = UserApiAxiosParamCreator(configuration) - return { /** - * Warpcast has deprecated the active badge. Use user/power endpoint instead. - * @summary Fetch active users - * @param {number} [limit] - * @param {string} [cursor] Pagination cursor. + * Fetches information about multiple users based on FIDs + * @summary By FIDs + * @param {string} fids Comma separated list of FIDs, up to 100 at a time + * @param {number} [viewer_fid] * @param {*} [options] Override http request option. - * @deprecated * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `BulkUsersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-bulk-users) + * */ - async activeUsers(limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.activeUsers(limit, cursor, options); + async fetchBulkUsers(fids: string, viewer_fid?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchBulkUsers(fids, viewer_fid, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['UserApi.activeUsers']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['UserApi.fetchBulkUsers']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Removes verification for an eth address for the user \\ (In order to delete verification `signer_uuid` must be approved) - * @summary Delete verification - * @param {RemoveVerificationReqBody} removeVerificationReqBody + * Fetches all users based on multiple Ethereum or Solana addresses. Each farcaster user has a custody Ethereum address and optionally verified Ethereum or Solana addresses. This endpoint returns all users that have any of the given addresses as their custody or verified Ethereum or Solana addresses. A custody address can be associated with only 1 farcaster user at a time but a verified address can be associated with multiple users. You can pass in Ethereum and Solana addresses, comma separated, in the same request. The response will contain users associated with the given addresses. + * @summary By Eth or Sol addresses + * @param {string} addresses Comma separated list of Ethereum addresses, up to 350 at a time + * @param {string} [address_types] Customize which address types the request should search for. This is a comma-separated string that can include the following values: \'custody_address\' and \'verified_address\'. By default api returns both. To select multiple types, use a comma-separated list of these values. + * @param {number} [viewer_fid] * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `BulkUsersByAddressResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-bulk-users-by-ethereum-address) + * */ - async farcasterUserVerificationDelete(removeVerificationReqBody: RemoveVerificationReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.farcasterUserVerificationDelete(removeVerificationReqBody, options); + async fetchBulkUsersByEthereumAddress(addresses: string, address_types?: string, viewer_fid?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchBulkUsersByEthereumAddress(addresses, address_types, viewer_fid, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['UserApi.farcasterUserVerificationDelete']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['UserApi.fetchBulkUsersByEthereumAddress']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Adds verification for an eth address or contract for the user \\ (In order to add verification `signer_uuid` must be approved) - * @summary Add verification - * @param {AddVerificationReqBody} addVerificationReqBody + * Fetches power users based on Warpcast power badges. Information is updated once a day. + * @summary Power users + * @param {number} [viewer_fid] + * @param {number} [limit] Number of power users to fetch (Default: 25, Maximum: 100) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `UsersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-power-users) + * */ - async farcasterUserVerificationPost(addVerificationReqBody: AddVerificationReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.farcasterUserVerificationPost(addVerificationReqBody, options); + async fetchPowerUsers(viewer_fid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchPowerUsers(viewer_fid, limit, cursor, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['UserApi.farcasterUserVerificationPost']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['UserApi.fetchPowerUsers']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Fetches power users and respond in a backwards compatible format to Warpcast\'s deprecated power badge endpoint. + * @summary Power user FIDs + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `UserPowerLiteResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-power-users-lite) + * + */ + async fetchPowerUsersLite(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchPowerUsersLite(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['UserApi.fetchPowerUsersLite']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Fetches a list of users given a location * @summary By location - * @param {number} latitude Latitude of the location - * @param {number} longitude Longitude of the location - * @param {number} [viewerFid] FID of the user viewing the feed. Providing this will return a list of users that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {number} [limit] Number of results to fetch - * @param {string} [cursor] Pagination cursor + * @param {number} latitude Latitude of the location + * @param {number} longitude Longitude of the location + * @param {number} [viewer_fid] FID of the user viewing the feed. Providing this will return a list of users that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100) + * @param {string} [cursor] Pagination cursor * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `UsersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-users-by-location) + * */ - async fetchUsersByLocation(latitude: number, longitude: number, viewerFid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.fetchUsersByLocation(latitude, longitude, viewerFid, limit, cursor, options); + async fetchUsersByLocation(latitude: number, longitude: number, viewer_fid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchUsersByLocation(latitude, longitude, viewer_fid, limit, cursor, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['UserApi.fetchUsersByLocation']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); @@ -821,12 +889,16 @@ export const UserApiFp = function(configuration?: Configuration) { /** * Follow a user \\ (In order to follow a user `signer_uuid` must be approved) * @summary Follow user - * @param {FollowReqBody} followReqBody + * @param {FollowReqBody} follow_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `BulkFollowResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/follow-user) + * */ - async followUser(followReqBody: FollowReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.followUser(followReqBody, options); + async followUser(follow_req_body: FollowReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.followUser(follow_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['UserApi.followUser']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); @@ -836,149 +908,138 @@ export const UserApiFp = function(configuration?: Configuration) { * @summary Fetch fresh FID * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `UserFIDResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/get-fresh-account-fid) + * */ - async getFreshFid(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getFreshFid(options); + async getFreshAccountFID(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getFreshAccountFID(options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['UserApi.getFreshFid']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['UserApi.getFreshAccountFID']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Lookup a user by custody-address * @summary By custody-address - * @param {string} custodyAddress Custody Address associated with mnemonic + * @param {string} custody_address Custody Address associated with mnemonic * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `UserResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-user-by-custody-address) + * */ - async lookupUserByCustodyAddress(custodyAddress: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.lookupUserByCustodyAddress(custodyAddress, options); + async lookupUserByCustodyAddress(custody_address: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.lookupUserByCustodyAddress(custody_address, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['UserApi.lookupUserByCustodyAddress']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Fetches power users based on Warpcast power badges. Information is updated once a day. - * @summary Power users - * @param {number} [viewerFid] - * @param {number} [limit] Number of power users to fetch, max 100 - * @param {string} [cursor] Pagination cursor. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async powerUsers(viewerFid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.powerUsers(viewerFid, limit, cursor, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['UserApi.powerUsers']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Register account on farcaster. **Note:** This API must be called within 10 minutes of the fetch FID API call (i.e., /v2/farcaster/user/fid). Otherwise, Neynar will assign this FID to another available user. - * @summary Register new account - * @param {RegisterUserReqBody} registerUserReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async registerUser(registerUserReqBody: RegisterUserReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.registerUser(registerUserReqBody, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['UserApi.registerUser']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Unfollow a user \\ (In order to unfollow a user `signer_uuid` must be approved) - * @summary Unfollow user - * @param {FollowReqBody} followReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async unfollowUser(followReqBody: FollowReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.unfollowUser(followReqBody, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['UserApi.unfollowUser']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Update user profile \\ (In order to update user\'s profile `signer_uuid` must be approved) - * @summary Update user profile - * @param {UpdateUserReqBody} updateUserReqBody + * Fetches a single hydrated user object given a username + * @summary By username + * @param {string} username Username of the user to fetch + * @param {number} [viewer_fid] * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `UserResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-user-by-username) + * */ - async updateUser(updateUserReqBody: UpdateUserReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.updateUser(updateUserReqBody, options); + async lookupUserByUsername(username: string, viewer_fid?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.lookupUserByUsername(username, viewer_fid, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['UserApi.updateUser']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['UserApi.lookupUserByUsername']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Fetches information about multiple users based on FIDs - * @summary By FIDs - * @param {string} fids Comma separated list of FIDs, up to 100 at a time - * @param {number} [viewerFid] + * Adds verification for an eth address or contract for the user \\ (In order to add verification `signer_uuid` must be approved) + * @summary Add verification + * @param {AddVerificationReqBody} add_verification_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-verification) + * */ - async userBulk(fids: string, viewerFid?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.userBulk(fids, viewerFid, options); + async publishVerification(add_verification_req_body: AddVerificationReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.publishVerification(add_verification_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['UserApi.userBulk']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['UserApi.publishVerification']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Fetches all users based on multiple Ethereum or Solana addresses. Each farcaster user has a custody Ethereum address and optionally verified Ethereum or Solana addresses. This endpoint returns all users that have any of the given addresses as their custody or verified Ethereum or Solana addresses. A custody address can be associated with only 1 farcaster user at a time but a verified address can be associated with multiple users. You can pass in Ethereum and Solana addresses, comma separated, in the same request. The response will contain users associated with the given addresses. - * @summary By Eth or Sol addresses - * @param {string} addresses Comma separated list of Ethereum addresses, up to 350 at a time - * @param {string} [addressTypes] Customize which address types the request should search for. This is a comma-separated string that can include the following values: \'custody_address\' and \'verified_address\'. By default api returns both. To select multiple types, use a comma-separated list of these values. - * @param {number} [viewerFid] + * Register account on farcaster. **Note:** This API must be called within 10 minutes of the fetch FID API call (i.e., /v2/farcaster/user/fid). Otherwise, Neynar will assign this FID to another available user. + * @summary Register new account + * @param {RegisterUserReqBody} register_user_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `RegisterUserResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/register-account) + * */ - async userBulkByAddress(addresses: string, addressTypes?: string, viewerFid?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: Array; }>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.userBulkByAddress(addresses, addressTypes, viewerFid, options); + async registerAccount(register_user_req_body: RegisterUserReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.registerAccount(register_user_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['UserApi.userBulkByAddress']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['UserApi.registerAccount']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Fetches a single hydrated user object given a username - * @summary By username - * @param {string} username Username of the user to fetch - * @param {number} [viewerFid] + * Search for Usernames + * @summary Search for Usernames + * @param {string} q + * @param {number} [viewer_fid] Providing this will return search results that respects this user\'s mutes and blocks and includes `viewer_context`. + * @param {number} [limit] Number of users to fetch (Default: 5, Maximum: 10) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `UserSearchResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/search-user) + * */ - async userByUsernameV2(username: string, viewerFid?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.userByUsernameV2(username, viewerFid, options); + async searchUser(q: string, viewer_fid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.searchUser(q, viewer_fid, limit, cursor, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['UserApi.userByUsernameV2']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['UserApi.searchUser']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Fetches power users and respond in a backwards compatible format to Warpcast\'s deprecated power badge endpoint. - * @summary Power user FIDs + * Unfollow a user \\ (In order to unfollow a user `signer_uuid` must be approved) + * @summary Unfollow user + * @param {FollowReqBody} follow_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `BulkFollowResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/unfollow-user) + * */ - async userPowerLite(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.userPowerLite(options); + async unfollowUser(follow_req_body: FollowReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.unfollowUser(follow_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['UserApi.userPowerLite']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['UserApi.unfollowUser']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Search for Usernames - * @summary Search for Usernames - * @param {string} q - * @param {number} [viewerFid] Providing this will return search results that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {number} [limit] - * @param {string} [cursor] Pagination cursor. + * Update user profile \\ (In order to update user\'s profile `signer_uuid` must be approved) + * @summary Update user profile + * @param {UpdateUserReqBody} update_user_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/update-user) + * */ - async userSearch(q: string, viewerFid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.userSearch(q, viewerFid, limit, cursor, options); + async updateUser(update_user_req_body: UpdateUserReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateUser(update_user_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['UserApi.userSearch']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['UserApi.updateUser']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } @@ -991,366 +1052,827 @@ export const UserApiFp = function(configuration?: Configuration) { export const UserApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = UserApiFp(configuration) return { - /** - * Warpcast has deprecated the active badge. Use user/power endpoint instead. - * @summary Fetch active users - * @param {number} [limit] - * @param {string} [cursor] Pagination cursor. - * @param {*} [options] Override http request option. - * @deprecated - * @throws {RequiredError} - */ - activeUsers(limit?: number, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.activeUsers(limit, cursor, options).then((request) => request(axios, basePath)); - }, /** * Removes verification for an eth address for the user \\ (In order to delete verification `signer_uuid` must be approved) * @summary Delete verification - * @param {RemoveVerificationReqBody} removeVerificationReqBody + * @param {UserApiDeleteVerificationRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-verification) + * */ - farcasterUserVerificationDelete(removeVerificationReqBody: RemoveVerificationReqBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.farcasterUserVerificationDelete(removeVerificationReqBody, options).then((request) => request(axios, basePath)); + deleteVerification(requestParameters: UserApiDeleteVerificationRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.deleteVerification(requestParameters.remove_verification_req_body, options).then((request) => request(axios, basePath)); }, /** - * Adds verification for an eth address or contract for the user \\ (In order to add verification `signer_uuid` must be approved) - * @summary Add verification - * @param {AddVerificationReqBody} addVerificationReqBody + * Fetches information about multiple users based on FIDs + * @summary By FIDs + * @param {UserApiFetchBulkUsersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `BulkUsersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-bulk-users) + * */ - farcasterUserVerificationPost(addVerificationReqBody: AddVerificationReqBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.farcasterUserVerificationPost(addVerificationReqBody, options).then((request) => request(axios, basePath)); + fetchBulkUsers(requestParameters: UserApiFetchBulkUsersRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchBulkUsers(requestParameters.fids, requestParameters.viewer_fid, options).then((request) => request(axios, basePath)); }, /** - * Fetches a list of users given a location - * @summary By location - * @param {number} latitude Latitude of the location - * @param {number} longitude Longitude of the location - * @param {number} [viewerFid] FID of the user viewing the feed. Providing this will return a list of users that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {number} [limit] Number of results to fetch - * @param {string} [cursor] Pagination cursor + * Fetches all users based on multiple Ethereum or Solana addresses. Each farcaster user has a custody Ethereum address and optionally verified Ethereum or Solana addresses. This endpoint returns all users that have any of the given addresses as their custody or verified Ethereum or Solana addresses. A custody address can be associated with only 1 farcaster user at a time but a verified address can be associated with multiple users. You can pass in Ethereum and Solana addresses, comma separated, in the same request. The response will contain users associated with the given addresses. + * @summary By Eth or Sol addresses + * @param {UserApiFetchBulkUsersByEthereumAddressRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `BulkUsersByAddressResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-bulk-users-by-ethereum-address) + * */ - fetchUsersByLocation(latitude: number, longitude: number, viewerFid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.fetchUsersByLocation(latitude, longitude, viewerFid, limit, cursor, options).then((request) => request(axios, basePath)); + fetchBulkUsersByEthereumAddress(requestParameters: UserApiFetchBulkUsersByEthereumAddressRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchBulkUsersByEthereumAddress(requestParameters.addresses, requestParameters.address_types, requestParameters.viewer_fid, options).then((request) => request(axios, basePath)); }, /** - * Follow a user \\ (In order to follow a user `signer_uuid` must be approved) - * @summary Follow user - * @param {FollowReqBody} followReqBody + * Fetches power users based on Warpcast power badges. Information is updated once a day. + * @summary Power users + * @param {UserApiFetchPowerUsersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `UsersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-power-users) + * */ - followUser(followReqBody: FollowReqBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.followUser(followReqBody, options).then((request) => request(axios, basePath)); + fetchPowerUsers(requestParameters: UserApiFetchPowerUsersRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchPowerUsers(requestParameters.viewer_fid, requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath)); }, /** - * Fetches FID to [assign it to new user](https://docs.neynar.com/reference/register-user) - * @summary Fetch fresh FID + * Fetches power users and respond in a backwards compatible format to Warpcast\'s deprecated power badge endpoint. + * @summary Power user FIDs * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `UserPowerLiteResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-power-users-lite) + * */ - getFreshFid(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getFreshFid(options).then((request) => request(axios, basePath)); + fetchPowerUsersLite(options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchPowerUsersLite(options).then((request) => request(axios, basePath)); }, /** - * Lookup a user by custody-address - * @summary By custody-address - * @param {string} custodyAddress Custody Address associated with mnemonic + * Fetches a list of users given a location + * @summary By location + * @param {UserApiFetchUsersByLocationRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `UsersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-users-by-location) + * */ - lookupUserByCustodyAddress(custodyAddress: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.lookupUserByCustodyAddress(custodyAddress, options).then((request) => request(axios, basePath)); + fetchUsersByLocation(requestParameters: UserApiFetchUsersByLocationRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchUsersByLocation(requestParameters.latitude, requestParameters.longitude, requestParameters.viewer_fid, requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath)); }, /** - * Fetches power users based on Warpcast power badges. Information is updated once a day. - * @summary Power users - * @param {number} [viewerFid] - * @param {number} [limit] Number of power users to fetch, max 100 - * @param {string} [cursor] Pagination cursor. + * Follow a user \\ (In order to follow a user `signer_uuid` must be approved) + * @summary Follow user + * @param {UserApiFollowUserRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `BulkFollowResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/follow-user) + * */ - powerUsers(viewerFid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.powerUsers(viewerFid, limit, cursor, options).then((request) => request(axios, basePath)); + followUser(requestParameters: UserApiFollowUserRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.followUser(requestParameters.follow_req_body, options).then((request) => request(axios, basePath)); }, /** - * Register account on farcaster. **Note:** This API must be called within 10 minutes of the fetch FID API call (i.e., /v2/farcaster/user/fid). Otherwise, Neynar will assign this FID to another available user. - * @summary Register new account - * @param {RegisterUserReqBody} registerUserReqBody + * Fetches FID to [assign it to new user](https://docs.neynar.com/reference/register-user) + * @summary Fetch fresh FID * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `UserFIDResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/get-fresh-account-fid) + * */ - registerUser(registerUserReqBody: RegisterUserReqBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.registerUser(registerUserReqBody, options).then((request) => request(axios, basePath)); + getFreshAccountFID(options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getFreshAccountFID(options).then((request) => request(axios, basePath)); }, /** - * Unfollow a user \\ (In order to unfollow a user `signer_uuid` must be approved) - * @summary Unfollow user - * @param {FollowReqBody} followReqBody + * Lookup a user by custody-address + * @summary By custody-address + * @param {UserApiLookupUserByCustodyAddressRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `UserResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-user-by-custody-address) + * */ - unfollowUser(followReqBody: FollowReqBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.unfollowUser(followReqBody, options).then((request) => request(axios, basePath)); + lookupUserByCustodyAddress(requestParameters: UserApiLookupUserByCustodyAddressRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.lookupUserByCustodyAddress(requestParameters.custody_address, options).then((request) => request(axios, basePath)); }, /** - * Update user profile \\ (In order to update user\'s profile `signer_uuid` must be approved) - * @summary Update user profile - * @param {UpdateUserReqBody} updateUserReqBody + * Fetches a single hydrated user object given a username + * @summary By username + * @param {UserApiLookupUserByUsernameRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `UserResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-user-by-username) + * */ - updateUser(updateUserReqBody: UpdateUserReqBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.updateUser(updateUserReqBody, options).then((request) => request(axios, basePath)); + lookupUserByUsername(requestParameters: UserApiLookupUserByUsernameRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.lookupUserByUsername(requestParameters.username, requestParameters.viewer_fid, options).then((request) => request(axios, basePath)); }, /** - * Fetches information about multiple users based on FIDs - * @summary By FIDs - * @param {string} fids Comma separated list of FIDs, up to 100 at a time - * @param {number} [viewerFid] + * Adds verification for an eth address or contract for the user \\ (In order to add verification `signer_uuid` must be approved) + * @summary Add verification + * @param {UserApiPublishVerificationRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-verification) + * */ - userBulk(fids: string, viewerFid?: number, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.userBulk(fids, viewerFid, options).then((request) => request(axios, basePath)); + publishVerification(requestParameters: UserApiPublishVerificationRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.publishVerification(requestParameters.add_verification_req_body, options).then((request) => request(axios, basePath)); }, /** - * Fetches all users based on multiple Ethereum or Solana addresses. Each farcaster user has a custody Ethereum address and optionally verified Ethereum or Solana addresses. This endpoint returns all users that have any of the given addresses as their custody or verified Ethereum or Solana addresses. A custody address can be associated with only 1 farcaster user at a time but a verified address can be associated with multiple users. You can pass in Ethereum and Solana addresses, comma separated, in the same request. The response will contain users associated with the given addresses. - * @summary By Eth or Sol addresses - * @param {string} addresses Comma separated list of Ethereum addresses, up to 350 at a time - * @param {string} [addressTypes] Customize which address types the request should search for. This is a comma-separated string that can include the following values: \'custody_address\' and \'verified_address\'. By default api returns both. To select multiple types, use a comma-separated list of these values. - * @param {number} [viewerFid] + * Register account on farcaster. **Note:** This API must be called within 10 minutes of the fetch FID API call (i.e., /v2/farcaster/user/fid). Otherwise, Neynar will assign this FID to another available user. + * @summary Register new account + * @param {UserApiRegisterAccountRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `RegisterUserResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/register-account) + * */ - userBulkByAddress(addresses: string, addressTypes?: string, viewerFid?: number, options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: Array; }> { - return localVarFp.userBulkByAddress(addresses, addressTypes, viewerFid, options).then((request) => request(axios, basePath)); + registerAccount(requestParameters: UserApiRegisterAccountRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.registerAccount(requestParameters.register_user_req_body, options).then((request) => request(axios, basePath)); }, /** - * Fetches a single hydrated user object given a username - * @summary By username - * @param {string} username Username of the user to fetch - * @param {number} [viewerFid] + * Search for Usernames + * @summary Search for Usernames + * @param {UserApiSearchUserRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `UserSearchResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/search-user) + * */ - userByUsernameV2(username: string, viewerFid?: number, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.userByUsernameV2(username, viewerFid, options).then((request) => request(axios, basePath)); + searchUser(requestParameters: UserApiSearchUserRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.searchUser(requestParameters.q, requestParameters.viewer_fid, requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath)); }, /** - * Fetches power users and respond in a backwards compatible format to Warpcast\'s deprecated power badge endpoint. - * @summary Power user FIDs + * Unfollow a user \\ (In order to unfollow a user `signer_uuid` must be approved) + * @summary Unfollow user + * @param {UserApiUnfollowUserRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `BulkFollowResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/unfollow-user) + * */ - userPowerLite(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.userPowerLite(options).then((request) => request(axios, basePath)); + unfollowUser(requestParameters: UserApiUnfollowUserRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.unfollowUser(requestParameters.follow_req_body, options).then((request) => request(axios, basePath)); }, /** - * Search for Usernames - * @summary Search for Usernames - * @param {string} q - * @param {number} [viewerFid] Providing this will return search results that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {number} [limit] - * @param {string} [cursor] Pagination cursor. + * Update user profile \\ (In order to update user\'s profile `signer_uuid` must be approved) + * @summary Update user profile + * @param {UserApiUpdateUserRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/update-user) + * */ - userSearch(q: string, viewerFid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.userSearch(q, viewerFid, limit, cursor, options).then((request) => request(axios, basePath)); + updateUser(requestParameters: UserApiUpdateUserRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.updateUser(requestParameters.update_user_req_body, options).then((request) => request(axios, basePath)); }, }; }; /** - * UserApi - object-oriented interface + * UserApi - interface * @export - * @class UserApi - * @extends {BaseAPI} + * @interface UserApi */ -export class UserApi extends BaseAPI { +export interface UserApiInterface { /** - * Warpcast has deprecated the active badge. Use user/power endpoint instead. - * @summary Fetch active users - * @param {number} [limit] - * @param {string} [cursor] Pagination cursor. + * Removes verification for an eth address for the user \\ (In order to delete verification `signer_uuid` must be approved) + * @summary Delete verification + * @param {UserApiDeleteVerificationRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. - * @deprecated * @throws {RequiredError} - * @memberof UserApi + * @memberof UserApiInterface + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-verification) + * */ - public activeUsers(limit?: number, cursor?: string, options?: RawAxiosRequestConfig) { - return UserApiFp(this.configuration).activeUsers(limit, cursor, options).then((request) => request(this.axios, this.basePath)); - } + deleteVerification(requestParameters: UserApiDeleteVerificationRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** - * Removes verification for an eth address for the user \\ (In order to delete verification `signer_uuid` must be approved) - * @summary Delete verification - * @param {RemoveVerificationReqBody} removeVerificationReqBody + * Fetches information about multiple users based on FIDs + * @summary By FIDs + * @param {UserApiFetchBulkUsersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof UserApi + * @memberof UserApiInterface + * @returns {Promise} A promise that resolves to a `BulkUsersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-bulk-users) + * */ - public farcasterUserVerificationDelete(removeVerificationReqBody: RemoveVerificationReqBody, options?: RawAxiosRequestConfig) { - return UserApiFp(this.configuration).farcasterUserVerificationDelete(removeVerificationReqBody, options).then((request) => request(this.axios, this.basePath)); - } + fetchBulkUsers(requestParameters: UserApiFetchBulkUsersRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** - * Adds verification for an eth address or contract for the user \\ (In order to add verification `signer_uuid` must be approved) - * @summary Add verification - * @param {AddVerificationReqBody} addVerificationReqBody + * Fetches all users based on multiple Ethereum or Solana addresses. Each farcaster user has a custody Ethereum address and optionally verified Ethereum or Solana addresses. This endpoint returns all users that have any of the given addresses as their custody or verified Ethereum or Solana addresses. A custody address can be associated with only 1 farcaster user at a time but a verified address can be associated with multiple users. You can pass in Ethereum and Solana addresses, comma separated, in the same request. The response will contain users associated with the given addresses. + * @summary By Eth or Sol addresses + * @param {UserApiFetchBulkUsersByEthereumAddressRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof UserApi + * @memberof UserApiInterface + * @returns {Promise} A promise that resolves to a `BulkUsersByAddressResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-bulk-users-by-ethereum-address) + * */ - public farcasterUserVerificationPost(addVerificationReqBody: AddVerificationReqBody, options?: RawAxiosRequestConfig) { - return UserApiFp(this.configuration).farcasterUserVerificationPost(addVerificationReqBody, options).then((request) => request(this.axios, this.basePath)); - } + fetchBulkUsersByEthereumAddress(requestParameters: UserApiFetchBulkUsersByEthereumAddressRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Fetches power users based on Warpcast power badges. Information is updated once a day. + * @summary Power users + * @param {UserApiFetchPowerUsersRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApiInterface + * @returns {Promise} A promise that resolves to a `UsersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-power-users) + * + */ + fetchPowerUsers(requestParameters?: UserApiFetchPowerUsersRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Fetches power users and respond in a backwards compatible format to Warpcast\'s deprecated power badge endpoint. + * @summary Power user FIDs + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApiInterface + * @returns {Promise} A promise that resolves to a `UserPowerLiteResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-power-users-lite) + * + */ + fetchPowerUsersLite(options?: RawAxiosRequestConfig): AxiosPromise; /** * Fetches a list of users given a location * @summary By location - * @param {number} latitude Latitude of the location - * @param {number} longitude Longitude of the location - * @param {number} [viewerFid] FID of the user viewing the feed. Providing this will return a list of users that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {number} [limit] Number of results to fetch - * @param {string} [cursor] Pagination cursor + * @param {UserApiFetchUsersByLocationRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof UserApi + * @memberof UserApiInterface + * @returns {Promise} A promise that resolves to a `UsersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-users-by-location) + * */ - public fetchUsersByLocation(latitude: number, longitude: number, viewerFid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig) { - return UserApiFp(this.configuration).fetchUsersByLocation(latitude, longitude, viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); - } + fetchUsersByLocation(requestParameters: UserApiFetchUsersByLocationRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Follow a user \\ (In order to follow a user `signer_uuid` must be approved) * @summary Follow user - * @param {FollowReqBody} followReqBody + * @param {UserApiFollowUserRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof UserApi + * @memberof UserApiInterface + * @returns {Promise} A promise that resolves to a `BulkFollowResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/follow-user) + * */ - public followUser(followReqBody: FollowReqBody, options?: RawAxiosRequestConfig) { - return UserApiFp(this.configuration).followUser(followReqBody, options).then((request) => request(this.axios, this.basePath)); - } + followUser(requestParameters: UserApiFollowUserRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Fetches FID to [assign it to new user](https://docs.neynar.com/reference/register-user) * @summary Fetch fresh FID * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof UserApi + * @memberof UserApiInterface + * @returns {Promise} A promise that resolves to a `UserFIDResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/get-fresh-account-fid) + * */ - public getFreshFid(options?: RawAxiosRequestConfig) { - return UserApiFp(this.configuration).getFreshFid(options).then((request) => request(this.axios, this.basePath)); - } + getFreshAccountFID(options?: RawAxiosRequestConfig): AxiosPromise; /** * Lookup a user by custody-address * @summary By custody-address - * @param {string} custodyAddress Custody Address associated with mnemonic + * @param {UserApiLookupUserByCustodyAddressRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof UserApi + * @memberof UserApiInterface + * @returns {Promise} A promise that resolves to a `UserResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-user-by-custody-address) + * */ - public lookupUserByCustodyAddress(custodyAddress: string, options?: RawAxiosRequestConfig) { - return UserApiFp(this.configuration).lookupUserByCustodyAddress(custodyAddress, options).then((request) => request(this.axios, this.basePath)); - } + lookupUserByCustodyAddress(requestParameters: UserApiLookupUserByCustodyAddressRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** - * Fetches power users based on Warpcast power badges. Information is updated once a day. - * @summary Power users - * @param {number} [viewerFid] - * @param {number} [limit] Number of power users to fetch, max 100 - * @param {string} [cursor] Pagination cursor. + * Fetches a single hydrated user object given a username + * @summary By username + * @param {UserApiLookupUserByUsernameRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof UserApi + * @memberof UserApiInterface + * @returns {Promise} A promise that resolves to a `UserResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-user-by-username) + * */ - public powerUsers(viewerFid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig) { - return UserApiFp(this.configuration).powerUsers(viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); - } + lookupUserByUsername(requestParameters: UserApiLookupUserByUsernameRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Adds verification for an eth address or contract for the user \\ (In order to add verification `signer_uuid` must be approved) + * @summary Add verification + * @param {UserApiPublishVerificationRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApiInterface + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-verification) + * + */ + publishVerification(requestParameters: UserApiPublishVerificationRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Register account on farcaster. **Note:** This API must be called within 10 minutes of the fetch FID API call (i.e., /v2/farcaster/user/fid). Otherwise, Neynar will assign this FID to another available user. * @summary Register new account - * @param {RegisterUserReqBody} registerUserReqBody + * @param {UserApiRegisterAccountRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof UserApi + * @memberof UserApiInterface + * @returns {Promise} A promise that resolves to a `RegisterUserResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/register-account) + * */ - public registerUser(registerUserReqBody: RegisterUserReqBody, options?: RawAxiosRequestConfig) { - return UserApiFp(this.configuration).registerUser(registerUserReqBody, options).then((request) => request(this.axios, this.basePath)); - } + registerAccount(requestParameters: UserApiRegisterAccountRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Search for Usernames + * @summary Search for Usernames + * @param {UserApiSearchUserRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApiInterface + * @returns {Promise} A promise that resolves to a `UserSearchResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/search-user) + * + */ + searchUser(requestParameters: UserApiSearchUserRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Unfollow a user \\ (In order to unfollow a user `signer_uuid` must be approved) * @summary Unfollow user - * @param {FollowReqBody} followReqBody + * @param {UserApiUnfollowUserRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof UserApi + * @memberof UserApiInterface + * @returns {Promise} A promise that resolves to a `BulkFollowResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/unfollow-user) + * */ - public unfollowUser(followReqBody: FollowReqBody, options?: RawAxiosRequestConfig) { - return UserApiFp(this.configuration).unfollowUser(followReqBody, options).then((request) => request(this.axios, this.basePath)); - } + unfollowUser(requestParameters: UserApiUnfollowUserRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Update user profile \\ (In order to update user\'s profile `signer_uuid` must be approved) * @summary Update user profile - * @param {UpdateUserReqBody} updateUserReqBody + * @param {UserApiUpdateUserRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApiInterface + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/update-user) + * + */ + updateUser(requestParameters: UserApiUpdateUserRequest, options?: RawAxiosRequestConfig): AxiosPromise; + +} + +/** + * Request parameters for deleteVerification operation in UserApi. + * @export + * @interface UserApiDeleteVerificationRequest + */ +export interface UserApiDeleteVerificationRequest { + /** + * + * + * + * @type {RemoveVerificationReqBody} + * @memberof UserApiDeleteVerification + */ + readonly remove_verification_req_body: RemoveVerificationReqBody +} + +/** + * Request parameters for fetchBulkUsers operation in UserApi. + * @export + * @interface UserApiFetchBulkUsersRequest + */ +export interface UserApiFetchBulkUsersRequest { + /** + * Comma separated list of FIDs, up to 100 at a time + * @acceptAs integer + * @commaSeparated + * @type {string} + * @memberof UserApiFetchBulkUsers + */ + readonly fids: string + + /** + * + * + * + * @type {number} + * @memberof UserApiFetchBulkUsers + */ + readonly viewer_fid?: number +} + +/** + * Request parameters for fetchBulkUsersByEthereumAddress operation in UserApi. + * @export + * @interface UserApiFetchBulkUsersByEthereumAddressRequest + */ +export interface UserApiFetchBulkUsersByEthereumAddressRequest { + /** + * Comma separated list of Ethereum addresses, up to 350 at a time + * + * @commaSeparated + * @type {string} + * @memberof UserApiFetchBulkUsersByEthereumAddress + */ + readonly addresses: string + + /** + * Customize which address types the request should search for. This is a comma-separated string that can include the following values: \'custody_address\' and \'verified_address\'. By default api returns both. To select multiple types, use a comma-separated list of these values. + * + * @commaSeparated + * @type {string} + * @memberof UserApiFetchBulkUsersByEthereumAddress + */ + readonly address_types?: string + + /** + * + * + * + * @type {number} + * @memberof UserApiFetchBulkUsersByEthereumAddress + */ + readonly viewer_fid?: number +} + +/** + * Request parameters for fetchPowerUsers operation in UserApi. + * @export + * @interface UserApiFetchPowerUsersRequest + */ +export interface UserApiFetchPowerUsersRequest { + /** + * + * + * + * @type {number} + * @memberof UserApiFetchPowerUsers + */ + readonly viewer_fid?: number + + /** + * Number of power users to fetch (Default: 25, Maximum: 100) + * + * + * @type {number} + * @memberof UserApiFetchPowerUsers + */ + readonly limit?: number + + /** + * Pagination cursor. + * + * + * @type {string} + * @memberof UserApiFetchPowerUsers + */ + readonly cursor?: string +} + +/** + * Request parameters for fetchUsersByLocation operation in UserApi. + * @export + * @interface UserApiFetchUsersByLocationRequest + */ +export interface UserApiFetchUsersByLocationRequest { + /** + * Latitude of the location + * + * + * @type {number} + * @memberof UserApiFetchUsersByLocation + */ + readonly latitude: number + + /** + * Longitude of the location + * + * + * @type {number} + * @memberof UserApiFetchUsersByLocation + */ + readonly longitude: number + + /** + * FID of the user viewing the feed. Providing this will return a list of users that respects this user\'s mutes and blocks and includes `viewer_context`. + * + * + * @type {number} + * @memberof UserApiFetchUsersByLocation + */ + readonly viewer_fid?: number + + /** + * Number of results to fetch (Default: 25, Maximum: 100) + * + * + * @type {number} + * @memberof UserApiFetchUsersByLocation + */ + readonly limit?: number + + /** + * Pagination cursor + * + * + * @type {string} + * @memberof UserApiFetchUsersByLocation + */ + readonly cursor?: string +} + +/** + * Request parameters for followUser operation in UserApi. + * @export + * @interface UserApiFollowUserRequest + */ +export interface UserApiFollowUserRequest { + /** + * + * + * + * @type {FollowReqBody} + * @memberof UserApiFollowUser + */ + readonly follow_req_body: FollowReqBody +} + +/** + * Request parameters for lookupUserByCustodyAddress operation in UserApi. + * @export + * @interface UserApiLookupUserByCustodyAddressRequest + */ +export interface UserApiLookupUserByCustodyAddressRequest { + /** + * Custody Address associated with mnemonic + * + * + * @type {string} + * @memberof UserApiLookupUserByCustodyAddress + */ + readonly custody_address: string +} + +/** + * Request parameters for lookupUserByUsername operation in UserApi. + * @export + * @interface UserApiLookupUserByUsernameRequest + */ +export interface UserApiLookupUserByUsernameRequest { + /** + * Username of the user to fetch + * + * + * @type {string} + * @memberof UserApiLookupUserByUsername + */ + readonly username: string + + /** + * + * + * + * @type {number} + * @memberof UserApiLookupUserByUsername + */ + readonly viewer_fid?: number +} + +/** + * Request parameters for publishVerification operation in UserApi. + * @export + * @interface UserApiPublishVerificationRequest + */ +export interface UserApiPublishVerificationRequest { + /** + * + * + * + * @type {AddVerificationReqBody} + * @memberof UserApiPublishVerification + */ + readonly add_verification_req_body: AddVerificationReqBody +} + +/** + * Request parameters for registerAccount operation in UserApi. + * @export + * @interface UserApiRegisterAccountRequest + */ +export interface UserApiRegisterAccountRequest { + /** + * + * + * + * @type {RegisterUserReqBody} + * @memberof UserApiRegisterAccount + */ + readonly register_user_req_body: RegisterUserReqBody +} + +/** + * Request parameters for searchUser operation in UserApi. + * @export + * @interface UserApiSearchUserRequest + */ +export interface UserApiSearchUserRequest { + /** + * + * + * + * @type {string} + * @memberof UserApiSearchUser + */ + readonly q: string + + /** + * Providing this will return search results that respects this user\'s mutes and blocks and includes `viewer_context`. + * + * + * @type {number} + * @memberof UserApiSearchUser + */ + readonly viewer_fid?: number + + /** + * Number of users to fetch (Default: 5, Maximum: 10) + * + * + * @type {number} + * @memberof UserApiSearchUser + */ + readonly limit?: number + + /** + * Pagination cursor. + * + * + * @type {string} + * @memberof UserApiSearchUser + */ + readonly cursor?: string +} + +/** + * Request parameters for unfollowUser operation in UserApi. + * @export + * @interface UserApiUnfollowUserRequest + */ +export interface UserApiUnfollowUserRequest { + /** + * + * + * + * @type {FollowReqBody} + * @memberof UserApiUnfollowUser + */ + readonly follow_req_body: FollowReqBody +} + +/** + * Request parameters for updateUser operation in UserApi. + * @export + * @interface UserApiUpdateUserRequest + */ +export interface UserApiUpdateUserRequest { + /** + * + * + * + * @type {UpdateUserReqBody} + * @memberof UserApiUpdateUser + */ + readonly update_user_req_body: UpdateUserReqBody +} + +/** + * UserApi - object-oriented interface + * @export + * @class UserApi + * @extends {BaseAPI} + */ +export class UserApi extends BaseAPI implements UserApiInterface { + /** + * Removes verification for an eth address for the user \\ (In order to delete verification `signer_uuid` must be approved) + * @summary Delete verification + * @param {UserApiDeleteVerificationRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof UserApi + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-verification) + * */ - public updateUser(updateUserReqBody: UpdateUserReqBody, options?: RawAxiosRequestConfig) { - return UserApiFp(this.configuration).updateUser(updateUserReqBody, options).then((request) => request(this.axios, this.basePath)); + public deleteVerification(requestParameters: UserApiDeleteVerificationRequest, options?: RawAxiosRequestConfig) { + return UserApiFp(this.configuration).deleteVerification(requestParameters.remove_verification_req_body, options).then((request) => request(this.axios, this.basePath)); } /** * Fetches information about multiple users based on FIDs * @summary By FIDs - * @param {string} fids Comma separated list of FIDs, up to 100 at a time - * @param {number} [viewerFid] + * @param {UserApiFetchBulkUsersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof UserApi + * @returns {Promise} A promise that resolves to a `BulkUsersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-bulk-users) + * */ - public userBulk(fids: string, viewerFid?: number, options?: RawAxiosRequestConfig) { - return UserApiFp(this.configuration).userBulk(fids, viewerFid, options).then((request) => request(this.axios, this.basePath)); + public fetchBulkUsers(requestParameters: UserApiFetchBulkUsersRequest, options?: RawAxiosRequestConfig) { + return UserApiFp(this.configuration).fetchBulkUsers(requestParameters.fids, requestParameters.viewer_fid, options).then((request) => request(this.axios, this.basePath)); } /** * Fetches all users based on multiple Ethereum or Solana addresses. Each farcaster user has a custody Ethereum address and optionally verified Ethereum or Solana addresses. This endpoint returns all users that have any of the given addresses as their custody or verified Ethereum or Solana addresses. A custody address can be associated with only 1 farcaster user at a time but a verified address can be associated with multiple users. You can pass in Ethereum and Solana addresses, comma separated, in the same request. The response will contain users associated with the given addresses. * @summary By Eth or Sol addresses - * @param {string} addresses Comma separated list of Ethereum addresses, up to 350 at a time - * @param {string} [addressTypes] Customize which address types the request should search for. This is a comma-separated string that can include the following values: \'custody_address\' and \'verified_address\'. By default api returns both. To select multiple types, use a comma-separated list of these values. - * @param {number} [viewerFid] + * @param {UserApiFetchBulkUsersByEthereumAddressRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof UserApi + * @returns {Promise} A promise that resolves to a `BulkUsersByAddressResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-bulk-users-by-ethereum-address) + * */ - public userBulkByAddress(addresses: string, addressTypes?: string, viewerFid?: number, options?: RawAxiosRequestConfig) { - return UserApiFp(this.configuration).userBulkByAddress(addresses, addressTypes, viewerFid, options).then((request) => request(this.axios, this.basePath)); + public fetchBulkUsersByEthereumAddress(requestParameters: UserApiFetchBulkUsersByEthereumAddressRequest, options?: RawAxiosRequestConfig) { + return UserApiFp(this.configuration).fetchBulkUsersByEthereumAddress(requestParameters.addresses, requestParameters.address_types, requestParameters.viewer_fid, options).then((request) => request(this.axios, this.basePath)); } /** - * Fetches a single hydrated user object given a username - * @summary By username - * @param {string} username Username of the user to fetch - * @param {number} [viewerFid] + * Fetches power users based on Warpcast power badges. Information is updated once a day. + * @summary Power users + * @param {UserApiFetchPowerUsersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof UserApi + * @returns {Promise} A promise that resolves to a `UsersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-power-users) + * */ - public userByUsernameV2(username: string, viewerFid?: number, options?: RawAxiosRequestConfig) { - return UserApiFp(this.configuration).userByUsernameV2(username, viewerFid, options).then((request) => request(this.axios, this.basePath)); + public fetchPowerUsers(requestParameters: UserApiFetchPowerUsersRequest = {}, options?: RawAxiosRequestConfig) { + return UserApiFp(this.configuration).fetchPowerUsers(requestParameters.viewer_fid, requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath)); } /** @@ -1359,24 +1881,172 @@ export class UserApi extends BaseAPI { * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof UserApi + * @returns {Promise} A promise that resolves to a `UserPowerLiteResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-power-users-lite) + * + */ + public fetchPowerUsersLite(options?: RawAxiosRequestConfig) { + return UserApiFp(this.configuration).fetchPowerUsersLite(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Fetches a list of users given a location + * @summary By location + * @param {UserApiFetchUsersByLocationRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + * @returns {Promise} A promise that resolves to a `UsersResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-users-by-location) + * */ - public userPowerLite(options?: RawAxiosRequestConfig) { - return UserApiFp(this.configuration).userPowerLite(options).then((request) => request(this.axios, this.basePath)); + public fetchUsersByLocation(requestParameters: UserApiFetchUsersByLocationRequest, options?: RawAxiosRequestConfig) { + return UserApiFp(this.configuration).fetchUsersByLocation(requestParameters.latitude, requestParameters.longitude, requestParameters.viewer_fid, requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Follow a user \\ (In order to follow a user `signer_uuid` must be approved) + * @summary Follow user + * @param {UserApiFollowUserRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + * @returns {Promise} A promise that resolves to a `BulkFollowResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/follow-user) + * + */ + public followUser(requestParameters: UserApiFollowUserRequest, options?: RawAxiosRequestConfig) { + return UserApiFp(this.configuration).followUser(requestParameters.follow_req_body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Fetches FID to [assign it to new user](https://docs.neynar.com/reference/register-user) + * @summary Fetch fresh FID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + * @returns {Promise} A promise that resolves to a `UserFIDResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/get-fresh-account-fid) + * + */ + public getFreshAccountFID(options?: RawAxiosRequestConfig) { + return UserApiFp(this.configuration).getFreshAccountFID(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Lookup a user by custody-address + * @summary By custody-address + * @param {UserApiLookupUserByCustodyAddressRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + * @returns {Promise} A promise that resolves to a `UserResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-user-by-custody-address) + * + */ + public lookupUserByCustodyAddress(requestParameters: UserApiLookupUserByCustodyAddressRequest, options?: RawAxiosRequestConfig) { + return UserApiFp(this.configuration).lookupUserByCustodyAddress(requestParameters.custody_address, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Fetches a single hydrated user object given a username + * @summary By username + * @param {UserApiLookupUserByUsernameRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + * @returns {Promise} A promise that resolves to a `UserResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-user-by-username) + * + */ + public lookupUserByUsername(requestParameters: UserApiLookupUserByUsernameRequest, options?: RawAxiosRequestConfig) { + return UserApiFp(this.configuration).lookupUserByUsername(requestParameters.username, requestParameters.viewer_fid, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Adds verification for an eth address or contract for the user \\ (In order to add verification `signer_uuid` must be approved) + * @summary Add verification + * @param {UserApiPublishVerificationRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-verification) + * + */ + public publishVerification(requestParameters: UserApiPublishVerificationRequest, options?: RawAxiosRequestConfig) { + return UserApiFp(this.configuration).publishVerification(requestParameters.add_verification_req_body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Register account on farcaster. **Note:** This API must be called within 10 minutes of the fetch FID API call (i.e., /v2/farcaster/user/fid). Otherwise, Neynar will assign this FID to another available user. + * @summary Register new account + * @param {UserApiRegisterAccountRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + * @returns {Promise} A promise that resolves to a `RegisterUserResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/register-account) + * + */ + public registerAccount(requestParameters: UserApiRegisterAccountRequest, options?: RawAxiosRequestConfig) { + return UserApiFp(this.configuration).registerAccount(requestParameters.register_user_req_body, options).then((request) => request(this.axios, this.basePath)); } /** * Search for Usernames * @summary Search for Usernames - * @param {string} q - * @param {number} [viewerFid] Providing this will return search results that respects this user\'s mutes and blocks and includes `viewer_context`. - * @param {number} [limit] - * @param {string} [cursor] Pagination cursor. + * @param {UserApiSearchUserRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + * @returns {Promise} A promise that resolves to a `UserSearchResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/search-user) + * + */ + public searchUser(requestParameters: UserApiSearchUserRequest, options?: RawAxiosRequestConfig) { + return UserApiFp(this.configuration).searchUser(requestParameters.q, requestParameters.viewer_fid, requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Unfollow a user \\ (In order to unfollow a user `signer_uuid` must be approved) + * @summary Unfollow user + * @param {UserApiUnfollowUserRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + * @returns {Promise} A promise that resolves to a `BulkFollowResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/unfollow-user) + * + */ + public unfollowUser(requestParameters: UserApiUnfollowUserRequest, options?: RawAxiosRequestConfig) { + return UserApiFp(this.configuration).unfollowUser(requestParameters.follow_req_body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Update user profile \\ (In order to update user\'s profile `signer_uuid` must be approved) + * @summary Update user profile + * @param {UserApiUpdateUserRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof UserApi + * @returns {Promise} A promise that resolves to a `OperationResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/update-user) + * */ - public userSearch(q: string, viewerFid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig) { - return UserApiFp(this.configuration).userSearch(q, viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); + public updateUser(requestParameters: UserApiUpdateUserRequest, options?: RawAxiosRequestConfig) { + return UserApiFp(this.configuration).updateUser(requestParameters.update_user_req_body, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/src/neynar-api/v2/openapi-farcaster/apis/webhook-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/webhook-api.ts index 0f69fb04..4cdaa6c2 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/webhook-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/webhook-api.ts @@ -44,13 +44,17 @@ export const WebhookApiAxiosParamCreator = function (configuration?: Configurati /** * Delete a webhook * @summary Delete a webhook - * @param {WebhookDeleteReqBody} webhookDeleteReqBody + * @param {WebhookDeleteReqBody} webhook_delete_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `WebhookResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-webhook) + * */ - deleteWebhook: async (webhookDeleteReqBody: WebhookDeleteReqBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'webhookDeleteReqBody' is not null or undefined - assertParamExists('deleteWebhook', 'webhookDeleteReqBody', webhookDeleteReqBody) + deleteWebhook: async (webhook_delete_req_body: WebhookDeleteReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'webhook_delete_req_body' is not null or undefined + assertParamExists('deleteWebhook', 'webhook_delete_req_body', webhook_delete_req_body) const localVarPath = `/farcaster/webhook`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -73,7 +77,7 @@ export const WebhookApiAxiosParamCreator = function (configuration?: Configurati setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(webhookDeleteReqBody, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(webhook_delete_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -85,6 +89,10 @@ export const WebhookApiAxiosParamCreator = function (configuration?: Configurati * @summary Associated webhooks of user * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `WebhookListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-webhooks) + * */ fetchWebhooks: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/farcaster/webhook/list`; @@ -116,13 +124,17 @@ export const WebhookApiAxiosParamCreator = function (configuration?: Configurati /** * Fetch a webhook * @summary Fetch a webhook - * @param {string} webhookId + * @param {string} webhook_id * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `WebhookResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-webhook) + * */ - lookupWebhook: async (webhookId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'webhookId' is not null or undefined - assertParamExists('lookupWebhook', 'webhookId', webhookId) + lookupWebhook: async (webhook_id: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'webhook_id' is not null or undefined + assertParamExists('lookupWebhook', 'webhook_id', webhook_id) const localVarPath = `/farcaster/webhook`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -138,8 +150,8 @@ export const WebhookApiAxiosParamCreator = function (configuration?: Configurati // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - if (webhookId !== undefined) { - localVarQueryParameter['webhook_id'] = webhookId; + if (webhook_id !== undefined) { + localVarQueryParameter['webhook_id'] = webhook_id; } @@ -156,13 +168,17 @@ export const WebhookApiAxiosParamCreator = function (configuration?: Configurati /** * Create a webhook * @summary Create a webhook - * @param {WebhookPostReqBody} webhookPostReqBody + * @param {WebhookPostReqBody} webhook_post_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `WebhookResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-webhook) + * */ - publishWebhook: async (webhookPostReqBody: WebhookPostReqBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'webhookPostReqBody' is not null or undefined - assertParamExists('publishWebhook', 'webhookPostReqBody', webhookPostReqBody) + publishWebhook: async (webhook_post_req_body: WebhookPostReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'webhook_post_req_body' is not null or undefined + assertParamExists('publishWebhook', 'webhook_post_req_body', webhook_post_req_body) const localVarPath = `/farcaster/webhook`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -185,7 +201,7 @@ export const WebhookApiAxiosParamCreator = function (configuration?: Configurati setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(webhookPostReqBody, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(webhook_post_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -195,13 +211,17 @@ export const WebhookApiAxiosParamCreator = function (configuration?: Configurati /** * Update a webhook * @summary Update a webhook - * @param {WebhookPutReqBody} webhookPutReqBody + * @param {WebhookPutReqBody} webhook_put_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `WebhookResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/update-webhook) + * */ - updateWebhook: async (webhookPutReqBody: WebhookPutReqBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'webhookPutReqBody' is not null or undefined - assertParamExists('updateWebhook', 'webhookPutReqBody', webhookPutReqBody) + updateWebhook: async (webhook_put_req_body: WebhookPutReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'webhook_put_req_body' is not null or undefined + assertParamExists('updateWebhook', 'webhook_put_req_body', webhook_put_req_body) const localVarPath = `/farcaster/webhook`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -224,7 +244,7 @@ export const WebhookApiAxiosParamCreator = function (configuration?: Configurati setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(webhookPutReqBody, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(webhook_put_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -234,13 +254,17 @@ export const WebhookApiAxiosParamCreator = function (configuration?: Configurati /** * Update webhook active status * @summary Update webhook status - * @param {WebhookPatchReqBody} webhookPatchReqBody + * @param {WebhookPatchReqBody} webhook_patch_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `WebhookResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/update-webhook-active-status) + * */ - updateWebhookActiveStatus: async (webhookPatchReqBody: WebhookPatchReqBody, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'webhookPatchReqBody' is not null or undefined - assertParamExists('updateWebhookActiveStatus', 'webhookPatchReqBody', webhookPatchReqBody) + updateWebhookActiveStatus: async (webhook_patch_req_body: WebhookPatchReqBody, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'webhook_patch_req_body' is not null or undefined + assertParamExists('updateWebhookActiveStatus', 'webhook_patch_req_body', webhook_patch_req_body) const localVarPath = `/farcaster/webhook`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -263,7 +287,7 @@ export const WebhookApiAxiosParamCreator = function (configuration?: Configurati setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(webhookPatchReqBody, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(webhook_patch_req_body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -283,12 +307,16 @@ export const WebhookApiFp = function(configuration?: Configuration) { /** * Delete a webhook * @summary Delete a webhook - * @param {WebhookDeleteReqBody} webhookDeleteReqBody + * @param {WebhookDeleteReqBody} webhook_delete_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `WebhookResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-webhook) + * */ - async deleteWebhook(webhookDeleteReqBody: WebhookDeleteReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteWebhook(webhookDeleteReqBody, options); + async deleteWebhook(webhook_delete_req_body: WebhookDeleteReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteWebhook(webhook_delete_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['WebhookApi.deleteWebhook']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); @@ -298,6 +326,10 @@ export const WebhookApiFp = function(configuration?: Configuration) { * @summary Associated webhooks of user * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `WebhookListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-webhooks) + * */ async fetchWebhooks(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.fetchWebhooks(options); @@ -308,12 +340,16 @@ export const WebhookApiFp = function(configuration?: Configuration) { /** * Fetch a webhook * @summary Fetch a webhook - * @param {string} webhookId + * @param {string} webhook_id * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `WebhookResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-webhook) + * */ - async lookupWebhook(webhookId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.lookupWebhook(webhookId, options); + async lookupWebhook(webhook_id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.lookupWebhook(webhook_id, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['WebhookApi.lookupWebhook']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); @@ -321,12 +357,16 @@ export const WebhookApiFp = function(configuration?: Configuration) { /** * Create a webhook * @summary Create a webhook - * @param {WebhookPostReqBody} webhookPostReqBody + * @param {WebhookPostReqBody} webhook_post_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `WebhookResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-webhook) + * */ - async publishWebhook(webhookPostReqBody: WebhookPostReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.publishWebhook(webhookPostReqBody, options); + async publishWebhook(webhook_post_req_body: WebhookPostReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.publishWebhook(webhook_post_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['WebhookApi.publishWebhook']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); @@ -334,12 +374,16 @@ export const WebhookApiFp = function(configuration?: Configuration) { /** * Update a webhook * @summary Update a webhook - * @param {WebhookPutReqBody} webhookPutReqBody + * @param {WebhookPutReqBody} webhook_put_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `WebhookResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/update-webhook) + * */ - async updateWebhook(webhookPutReqBody: WebhookPutReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.updateWebhook(webhookPutReqBody, options); + async updateWebhook(webhook_put_req_body: WebhookPutReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateWebhook(webhook_put_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['WebhookApi.updateWebhook']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); @@ -347,12 +391,16 @@ export const WebhookApiFp = function(configuration?: Configuration) { /** * Update webhook active status * @summary Update webhook status - * @param {WebhookPatchReqBody} webhookPatchReqBody + * @param {WebhookPatchReqBody} webhook_patch_req_body * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `WebhookResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/update-webhook-active-status) + * */ - async updateWebhookActiveStatus(webhookPatchReqBody: WebhookPatchReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.updateWebhookActiveStatus(webhookPatchReqBody, options); + async updateWebhookActiveStatus(webhook_patch_req_body: WebhookPatchReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateWebhookActiveStatus(webhook_patch_req_body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['WebhookApi.updateWebhookActiveStatus']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); @@ -370,18 +418,26 @@ export const WebhookApiFactory = function (configuration?: Configuration, basePa /** * Delete a webhook * @summary Delete a webhook - * @param {WebhookDeleteReqBody} webhookDeleteReqBody + * @param {WebhookApiDeleteWebhookRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `WebhookResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-webhook) + * */ - deleteWebhook(webhookDeleteReqBody: WebhookDeleteReqBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.deleteWebhook(webhookDeleteReqBody, options).then((request) => request(axios, basePath)); + deleteWebhook(requestParameters: WebhookApiDeleteWebhookRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.deleteWebhook(requestParameters.webhook_delete_req_body, options).then((request) => request(axios, basePath)); }, /** * Fetch a list of webhooks associated to a user * @summary Associated webhooks of user * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `WebhookListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-webhooks) + * */ fetchWebhooks(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.fetchWebhooks(options).then((request) => request(axios, basePath)); @@ -389,63 +445,254 @@ export const WebhookApiFactory = function (configuration?: Configuration, basePa /** * Fetch a webhook * @summary Fetch a webhook - * @param {string} webhookId + * @param {WebhookApiLookupWebhookRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `WebhookResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-webhook) + * */ - lookupWebhook(webhookId: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.lookupWebhook(webhookId, options).then((request) => request(axios, basePath)); + lookupWebhook(requestParameters: WebhookApiLookupWebhookRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.lookupWebhook(requestParameters.webhook_id, options).then((request) => request(axios, basePath)); }, /** * Create a webhook * @summary Create a webhook - * @param {WebhookPostReqBody} webhookPostReqBody + * @param {WebhookApiPublishWebhookRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `WebhookResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-webhook) + * */ - publishWebhook(webhookPostReqBody: WebhookPostReqBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.publishWebhook(webhookPostReqBody, options).then((request) => request(axios, basePath)); + publishWebhook(requestParameters: WebhookApiPublishWebhookRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.publishWebhook(requestParameters.webhook_post_req_body, options).then((request) => request(axios, basePath)); }, /** * Update a webhook * @summary Update a webhook - * @param {WebhookPutReqBody} webhookPutReqBody + * @param {WebhookApiUpdateWebhookRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `WebhookResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/update-webhook) + * */ - updateWebhook(webhookPutReqBody: WebhookPutReqBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.updateWebhook(webhookPutReqBody, options).then((request) => request(axios, basePath)); + updateWebhook(requestParameters: WebhookApiUpdateWebhookRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.updateWebhook(requestParameters.webhook_put_req_body, options).then((request) => request(axios, basePath)); }, /** * Update webhook active status * @summary Update webhook status - * @param {WebhookPatchReqBody} webhookPatchReqBody + * @param {WebhookApiUpdateWebhookActiveStatusRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `WebhookResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/update-webhook-active-status) + * */ - updateWebhookActiveStatus(webhookPatchReqBody: WebhookPatchReqBody, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.updateWebhookActiveStatus(webhookPatchReqBody, options).then((request) => request(axios, basePath)); + updateWebhookActiveStatus(requestParameters: WebhookApiUpdateWebhookActiveStatusRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.updateWebhookActiveStatus(requestParameters.webhook_patch_req_body, options).then((request) => request(axios, basePath)); }, }; }; +/** + * WebhookApi - interface + * @export + * @interface WebhookApi + */ +export interface WebhookApiInterface { + /** + * Delete a webhook + * @summary Delete a webhook + * @param {WebhookApiDeleteWebhookRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof WebhookApiInterface + * @returns {Promise} A promise that resolves to a `WebhookResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-webhook) + * + */ + deleteWebhook(requestParameters: WebhookApiDeleteWebhookRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Fetch a list of webhooks associated to a user + * @summary Associated webhooks of user + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof WebhookApiInterface + * @returns {Promise} A promise that resolves to a `WebhookListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-webhooks) + * + */ + fetchWebhooks(options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Fetch a webhook + * @summary Fetch a webhook + * @param {WebhookApiLookupWebhookRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof WebhookApiInterface + * @returns {Promise} A promise that resolves to a `WebhookResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-webhook) + * + */ + lookupWebhook(requestParameters: WebhookApiLookupWebhookRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Create a webhook + * @summary Create a webhook + * @param {WebhookApiPublishWebhookRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof WebhookApiInterface + * @returns {Promise} A promise that resolves to a `WebhookResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-webhook) + * + */ + publishWebhook(requestParameters: WebhookApiPublishWebhookRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Update a webhook + * @summary Update a webhook + * @param {WebhookApiUpdateWebhookRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof WebhookApiInterface + * @returns {Promise} A promise that resolves to a `WebhookResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/update-webhook) + * + */ + updateWebhook(requestParameters: WebhookApiUpdateWebhookRequest, options?: RawAxiosRequestConfig): AxiosPromise; + + /** + * Update webhook active status + * @summary Update webhook status + * @param {WebhookApiUpdateWebhookActiveStatusRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof WebhookApiInterface + * @returns {Promise} A promise that resolves to a `WebhookResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/update-webhook-active-status) + * + */ + updateWebhookActiveStatus(requestParameters: WebhookApiUpdateWebhookActiveStatusRequest, options?: RawAxiosRequestConfig): AxiosPromise; + +} + +/** + * Request parameters for deleteWebhook operation in WebhookApi. + * @export + * @interface WebhookApiDeleteWebhookRequest + */ +export interface WebhookApiDeleteWebhookRequest { + /** + * + * + * + * @type {WebhookDeleteReqBody} + * @memberof WebhookApiDeleteWebhook + */ + readonly webhook_delete_req_body: WebhookDeleteReqBody +} + +/** + * Request parameters for lookupWebhook operation in WebhookApi. + * @export + * @interface WebhookApiLookupWebhookRequest + */ +export interface WebhookApiLookupWebhookRequest { + /** + * + * + * + * @type {string} + * @memberof WebhookApiLookupWebhook + */ + readonly webhook_id: string +} + +/** + * Request parameters for publishWebhook operation in WebhookApi. + * @export + * @interface WebhookApiPublishWebhookRequest + */ +export interface WebhookApiPublishWebhookRequest { + /** + * + * + * + * @type {WebhookPostReqBody} + * @memberof WebhookApiPublishWebhook + */ + readonly webhook_post_req_body: WebhookPostReqBody +} + +/** + * Request parameters for updateWebhook operation in WebhookApi. + * @export + * @interface WebhookApiUpdateWebhookRequest + */ +export interface WebhookApiUpdateWebhookRequest { + /** + * + * + * + * @type {WebhookPutReqBody} + * @memberof WebhookApiUpdateWebhook + */ + readonly webhook_put_req_body: WebhookPutReqBody +} + +/** + * Request parameters for updateWebhookActiveStatus operation in WebhookApi. + * @export + * @interface WebhookApiUpdateWebhookActiveStatusRequest + */ +export interface WebhookApiUpdateWebhookActiveStatusRequest { + /** + * + * + * + * @type {WebhookPatchReqBody} + * @memberof WebhookApiUpdateWebhookActiveStatus + */ + readonly webhook_patch_req_body: WebhookPatchReqBody +} + /** * WebhookApi - object-oriented interface * @export * @class WebhookApi * @extends {BaseAPI} */ -export class WebhookApi extends BaseAPI { +export class WebhookApi extends BaseAPI implements WebhookApiInterface { /** * Delete a webhook * @summary Delete a webhook - * @param {WebhookDeleteReqBody} webhookDeleteReqBody + * @param {WebhookApiDeleteWebhookRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhookApi + * @returns {Promise} A promise that resolves to a `WebhookResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-webhook) + * */ - public deleteWebhook(webhookDeleteReqBody: WebhookDeleteReqBody, options?: RawAxiosRequestConfig) { - return WebhookApiFp(this.configuration).deleteWebhook(webhookDeleteReqBody, options).then((request) => request(this.axios, this.basePath)); + public deleteWebhook(requestParameters: WebhookApiDeleteWebhookRequest, options?: RawAxiosRequestConfig) { + return WebhookApiFp(this.configuration).deleteWebhook(requestParameters.webhook_delete_req_body, options).then((request) => request(this.axios, this.basePath)); } /** @@ -454,6 +701,10 @@ export class WebhookApi extends BaseAPI { * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhookApi + * @returns {Promise} A promise that resolves to a `WebhookListResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-webhooks) + * */ public fetchWebhooks(options?: RawAxiosRequestConfig) { return WebhookApiFp(this.configuration).fetchWebhooks(options).then((request) => request(this.axios, this.basePath)); @@ -462,49 +713,65 @@ export class WebhookApi extends BaseAPI { /** * Fetch a webhook * @summary Fetch a webhook - * @param {string} webhookId + * @param {WebhookApiLookupWebhookRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhookApi + * @returns {Promise} A promise that resolves to a `WebhookResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-webhook) + * */ - public lookupWebhook(webhookId: string, options?: RawAxiosRequestConfig) { - return WebhookApiFp(this.configuration).lookupWebhook(webhookId, options).then((request) => request(this.axios, this.basePath)); + public lookupWebhook(requestParameters: WebhookApiLookupWebhookRequest, options?: RawAxiosRequestConfig) { + return WebhookApiFp(this.configuration).lookupWebhook(requestParameters.webhook_id, options).then((request) => request(this.axios, this.basePath)); } /** * Create a webhook * @summary Create a webhook - * @param {WebhookPostReqBody} webhookPostReqBody + * @param {WebhookApiPublishWebhookRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhookApi + * @returns {Promise} A promise that resolves to a `WebhookResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-webhook) + * */ - public publishWebhook(webhookPostReqBody: WebhookPostReqBody, options?: RawAxiosRequestConfig) { - return WebhookApiFp(this.configuration).publishWebhook(webhookPostReqBody, options).then((request) => request(this.axios, this.basePath)); + public publishWebhook(requestParameters: WebhookApiPublishWebhookRequest, options?: RawAxiosRequestConfig) { + return WebhookApiFp(this.configuration).publishWebhook(requestParameters.webhook_post_req_body, options).then((request) => request(this.axios, this.basePath)); } /** * Update a webhook * @summary Update a webhook - * @param {WebhookPutReqBody} webhookPutReqBody + * @param {WebhookApiUpdateWebhookRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhookApi + * @returns {Promise} A promise that resolves to a `WebhookResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/update-webhook) + * */ - public updateWebhook(webhookPutReqBody: WebhookPutReqBody, options?: RawAxiosRequestConfig) { - return WebhookApiFp(this.configuration).updateWebhook(webhookPutReqBody, options).then((request) => request(this.axios, this.basePath)); + public updateWebhook(requestParameters: WebhookApiUpdateWebhookRequest, options?: RawAxiosRequestConfig) { + return WebhookApiFp(this.configuration).updateWebhook(requestParameters.webhook_put_req_body, options).then((request) => request(this.axios, this.basePath)); } /** * Update webhook active status * @summary Update webhook status - * @param {WebhookPatchReqBody} webhookPatchReqBody + * @param {WebhookApiUpdateWebhookActiveStatusRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhookApi + * @returns {Promise} A promise that resolves to a `WebhookResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/update-webhook-active-status) + * */ - public updateWebhookActiveStatus(webhookPatchReqBody: WebhookPatchReqBody, options?: RawAxiosRequestConfig) { - return WebhookApiFp(this.configuration).updateWebhookActiveStatus(webhookPatchReqBody, options).then((request) => request(this.axios, this.basePath)); + public updateWebhookActiveStatus(requestParameters: WebhookApiUpdateWebhookActiveStatusRequest, options?: RawAxiosRequestConfig) { + return WebhookApiFp(this.configuration).updateWebhookActiveStatus(requestParameters.webhook_patch_req_body, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/src/neynar-api/v2/openapi-farcaster/models/bulk-users-by-address-response.ts b/src/neynar-api/v2/openapi-farcaster/models/bulk-users-by-address-response.ts new file mode 100644 index 00000000..729bca8d --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/bulk-users-by-address-response.ts @@ -0,0 +1,29 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import type { User } from './user'; + +/** + * + * @export + * @interface BulkUsersByAddressResponse + */ +export interface BulkUsersByAddressResponse { + [key: string]: Array; + +} + diff --git a/src/neynar-api/v2/openapi-farcaster/models/delete-neynar-frame-request.ts b/src/neynar-api/v2/openapi-farcaster/models/delete-frame-req-body.ts similarity index 79% rename from src/neynar-api/v2/openapi-farcaster/models/delete-neynar-frame-request.ts rename to src/neynar-api/v2/openapi-farcaster/models/delete-frame-req-body.ts index e462dce9..bc9e49d8 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/delete-neynar-frame-request.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/delete-frame-req-body.ts @@ -17,13 +17,13 @@ /** * * @export - * @interface DeleteNeynarFrameRequest + * @interface DeleteFrameReqBody */ -export interface DeleteNeynarFrameRequest { +export interface DeleteFrameReqBody { /** * * @type {string} - * @memberof DeleteNeynarFrameRequest + * @memberof DeleteFrameReqBody */ 'uuid'?: string; } diff --git a/src/neynar-api/v2/openapi-farcaster/models/feed-for-you400-response.ts b/src/neynar-api/v2/openapi-farcaster/models/fetch-feed-for-you400-response.ts similarity index 88% rename from src/neynar-api/v2/openapi-farcaster/models/feed-for-you400-response.ts rename to src/neynar-api/v2/openapi-farcaster/models/fetch-feed-for-you400-response.ts index 5945373a..86ba5ef5 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/feed-for-you400-response.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/fetch-feed-for-you400-response.ts @@ -24,9 +24,9 @@ import type { ZodError } from './zod-error'; import type { ZodErrorErrorsInner } from './zod-error-errors-inner'; /** - * @type FeedForYou400Response + * @type FetchFeedForYou400Response * @export */ -export type FeedForYou400Response = ErrorRes | ZodError; +export type FetchFeedForYou400Response = ErrorRes | ZodError; diff --git a/src/neynar-api/v2/openapi-farcaster/models/frame-from-url200-response.ts b/src/neynar-api/v2/openapi-farcaster/models/fetch-frame-meta-tags-from-url200-response.ts similarity index 79% rename from src/neynar-api/v2/openapi-farcaster/models/frame-from-url200-response.ts rename to src/neynar-api/v2/openapi-farcaster/models/fetch-frame-meta-tags-from-url200-response.ts index 440716a7..7b4d076a 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/frame-from-url200-response.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/fetch-frame-meta-tags-from-url200-response.ts @@ -20,13 +20,13 @@ import type { Frame } from './frame'; /** * The frame object containing the meta tags * @export - * @interface FrameFromUrl200Response + * @interface FetchFrameMetaTagsFromUrl200Response */ -export interface FrameFromUrl200Response { +export interface FetchFrameMetaTagsFromUrl200Response { /** * * @type {Frame} - * @memberof FrameFromUrl200Response + * @memberof FetchFrameMetaTagsFromUrl200Response */ 'frame': Frame; } diff --git a/src/neynar-api/v2/openapi-farcaster/models/webhook-put-req-body-all-of.ts b/src/neynar-api/v2/openapi-farcaster/models/fids.ts similarity index 68% rename from src/neynar-api/v2/openapi-farcaster/models/webhook-put-req-body-all-of.ts rename to src/neynar-api/v2/openapi-farcaster/models/fids.ts index e13141df..b23eea4c 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/webhook-put-req-body-all-of.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/fids.ts @@ -15,16 +15,10 @@ /** - * + * List of FIDs * @export - * @interface WebhookPutReqBodyAllOf + * @interface Fids */ -export interface WebhookPutReqBodyAllOf { - /** - * - * @type {string} - * @memberof WebhookPutReqBodyAllOf - */ - 'webhook_id': string; +export interface Fids extends Array { } diff --git a/src/neynar-api/v2/openapi-farcaster/models/for-you-provider.ts b/src/neynar-api/v2/openapi-farcaster/models/for-you-provider.ts index 0d4ffd3d..9e1a58f4 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/for-you-provider.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/for-you-provider.ts @@ -22,7 +22,6 @@ export const ForYouProvider = { Openrank: 'openrank', - Karma3: 'karma3', Mbd: 'mbd' } as const; diff --git a/src/neynar-api/v2/openapi-farcaster/models/frame-button-action-type.ts b/src/neynar-api/v2/openapi-farcaster/models/frame-button-action-type.ts index 1b701c80..e954fd4b 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/frame-button-action-type.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/frame-button-action-type.ts @@ -15,7 +15,7 @@ /** - * + * The action type of a frame button. Action types \"mint\" & \"link\" are to be handled on the client side only and so they will produce a no/op for POST /farcaster/frame/action. * @export * @enum {string} */ @@ -23,7 +23,9 @@ export const FrameButtonActionType = { Post: 'post', PostRedirect: 'post_redirect', - Tx: 'tx' + Tx: 'tx', + Link: 'link', + Mint: 'mint' } as const; export type FrameButtonActionType = typeof FrameButtonActionType[keyof typeof FrameButtonActionType]; diff --git a/src/neynar-api/v2/openapi-farcaster/models/index.ts b/src/neynar-api/v2/openapi-farcaster/models/index.ts index e63395a3..a2b5fc45 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/index.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/index.ts @@ -10,6 +10,7 @@ export * from './block-record'; export * from './block-req-body'; export * from './bulk-casts-response'; export * from './bulk-follow-response'; +export * from './bulk-users-by-address-response'; export * from './bulk-users-response'; export * from './buy-storage-req-body'; export * from './cast'; @@ -63,8 +64,8 @@ export * from './conversation-conversation'; export * from './dehydrated-channel'; export * from './dehydrated-follower'; export * from './delete-cast-req-body'; +export * from './delete-frame-req-body'; export * from './delete-frame-response'; -export * from './delete-neynar-frame-request'; export * from './developer-managed-signer'; export * from './embed'; export * from './embed-cast'; @@ -82,10 +83,12 @@ export * from './embed-url-metadata-video-stream-inner'; export * from './error-res'; export * from './farcaster-action-req-body'; export * from './farcaster-action-req-body-action'; -export * from './feed-for-you400-response'; export * from './feed-response'; export * from './feed-trending-provider'; export * from './feed-type'; +export * from './fetch-feed-for-you400-response'; +export * from './fetch-frame-meta-tags-from-url200-response'; +export * from './fids'; export * from './filter-type'; export * from './fname-availability-response'; export * from './follow'; @@ -100,7 +103,6 @@ export * from './frame-action-button'; export * from './frame-action-req-body'; export * from './frame-button-action-type'; export * from './frame-developer-managed-action-req-body'; -export * from './frame-from-url200-response'; export * from './frame-input'; export * from './frame-signature-packet'; export * from './frame-signature-packet-trusted-data'; @@ -120,6 +122,7 @@ export * from './frame-validate-list-response'; export * from './hydrated-follower'; export * from './image-object'; export * from './individual-hash-obj'; +export * from './invite-channel-member-req-body'; export * from './location'; export * from './location-address'; export * from './mark-notifications-as-seen-req-body'; @@ -129,9 +132,9 @@ export * from './mute-req-body'; export * from './mute-response'; export * from './next-cursor'; export * from './neynar-frame'; -export * from './neynar-frame-creation-request'; +export * from './neynar-frame-creation-req-body'; export * from './neynar-frame-page'; -export * from './neynar-frame-update-request'; +export * from './neynar-frame-update-req-body'; export * from './neynar-next-frame-page'; export * from './neynar-next-frame-page-mint-url'; export * from './neynar-next-frame-page-redirect'; @@ -176,9 +179,9 @@ export * from './register-signer-key-req-body'; export * from './register-user-req-body'; export * from './register-user-response'; export * from './relevant-followers-response'; -export * from './remove-channel-member-request'; +export * from './remove-channel-member-req-body'; export * from './remove-verification-req-body'; -export * from './respond-channel-invite-request'; +export * from './respond-channel-invite-req-body'; export * from './searched-user'; export * from './signed-key-request-sponsor'; export * from './signer'; @@ -221,9 +224,9 @@ export * from './user-verified-addresses'; export * from './user-viewer-context'; export * from './users-active-channels-response'; export * from './users-response'; +export * from './validate-frame-action-req-body'; export * from './validate-frame-action-response'; export * from './validate-frame-analytics-type'; -export * from './validate-frame-request'; export * from './validated-frame-action'; export * from './validated-frame-action-signer'; export * from './validated-frame-action-tapped-button'; @@ -236,7 +239,6 @@ export * from './webhook-list-response'; export * from './webhook-patch-req-body'; export * from './webhook-post-req-body'; export * from './webhook-put-req-body'; -export * from './webhook-put-req-body-all-of'; export * from './webhook-response'; export * from './webhook-secret'; export * from './webhook-subscription'; diff --git a/src/neynar-api/v2/openapi-farcaster/models/remove-channel-member-request.ts b/src/neynar-api/v2/openapi-farcaster/models/invite-channel-member-req-body.ts similarity index 78% rename from src/neynar-api/v2/openapi-farcaster/models/remove-channel-member-request.ts rename to src/neynar-api/v2/openapi-farcaster/models/invite-channel-member-req-body.ts index 8e78ffba..022d8a45 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/remove-channel-member-request.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/invite-channel-member-req-body.ts @@ -20,31 +20,31 @@ import type { ChannelMemberRole } from './channel-member-role'; /** * * @export - * @interface RemoveChannelMemberRequest + * @interface InviteChannelMemberReqBody */ -export interface RemoveChannelMemberRequest { +export interface InviteChannelMemberReqBody { /** * UUID of the signer * @type {string} - * @memberof RemoveChannelMemberRequest + * @memberof InviteChannelMemberReqBody */ 'signer_uuid': string; /** * The unique identifier of a farcaster channel * @type {string} - * @memberof RemoveChannelMemberRequest + * @memberof InviteChannelMemberReqBody */ 'channel_id': string; /** * The unique identifier of a farcaster user (unsigned integer) * @type {number} - * @memberof RemoveChannelMemberRequest + * @memberof InviteChannelMemberReqBody */ 'fid': number; /** * * @type {ChannelMemberRole} - * @memberof RemoveChannelMemberRequest + * @memberof InviteChannelMemberReqBody */ 'role': ChannelMemberRole; } diff --git a/src/neynar-api/v2/openapi-farcaster/models/neynar-frame-creation-request.ts b/src/neynar-api/v2/openapi-farcaster/models/neynar-frame-creation-req-body.ts similarity index 80% rename from src/neynar-api/v2/openapi-farcaster/models/neynar-frame-creation-request.ts rename to src/neynar-api/v2/openapi-farcaster/models/neynar-frame-creation-req-body.ts index cd2fbcc4..d0e948f7 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/neynar-frame-creation-request.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/neynar-frame-creation-req-body.ts @@ -20,19 +20,19 @@ import type { NeynarFramePage } from './neynar-frame-page'; /** * * @export - * @interface NeynarFrameCreationRequest + * @interface NeynarFrameCreationReqBody */ -export interface NeynarFrameCreationRequest { +export interface NeynarFrameCreationReqBody { /** * The name of the frame. * @type {string} - * @memberof NeynarFrameCreationRequest + * @memberof NeynarFrameCreationReqBody */ 'name': string; /** * * @type {Array} - * @memberof NeynarFrameCreationRequest + * @memberof NeynarFrameCreationReqBody */ 'pages': Array; } diff --git a/src/neynar-api/v2/openapi-farcaster/models/neynar-frame-update-request.ts b/src/neynar-api/v2/openapi-farcaster/models/neynar-frame-update-req-body.ts similarity index 79% rename from src/neynar-api/v2/openapi-farcaster/models/neynar-frame-update-request.ts rename to src/neynar-api/v2/openapi-farcaster/models/neynar-frame-update-req-body.ts index ba6d65e1..0d702aed 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/neynar-frame-update-request.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/neynar-frame-update-req-body.ts @@ -20,25 +20,25 @@ import type { NeynarFramePage } from './neynar-frame-page'; /** * * @export - * @interface NeynarFrameUpdateRequest + * @interface NeynarFrameUpdateReqBody */ -export interface NeynarFrameUpdateRequest { +export interface NeynarFrameUpdateReqBody { /** * The UUID of the frame to update. * @type {string} - * @memberof NeynarFrameUpdateRequest + * @memberof NeynarFrameUpdateReqBody */ 'uuid': string; /** * The name of the frame. * @type {string} - * @memberof NeynarFrameUpdateRequest + * @memberof NeynarFrameUpdateReqBody */ 'name'?: string; /** * * @type {Array} - * @memberof NeynarFrameUpdateRequest + * @memberof NeynarFrameUpdateReqBody */ 'pages': Array; } diff --git a/src/neynar-api/v2/openapi-farcaster/models/remove-channel-member-req-body.ts b/src/neynar-api/v2/openapi-farcaster/models/remove-channel-member-req-body.ts new file mode 100644 index 00000000..584d4180 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/remove-channel-member-req-body.ts @@ -0,0 +1,53 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import type { ChannelMemberRole } from './channel-member-role'; + +/** + * + * @export + * @interface RemoveChannelMemberReqBody + */ +export interface RemoveChannelMemberReqBody { + /** + * UUID of the signer + * @type {string} + * @memberof RemoveChannelMemberReqBody + */ + 'signer_uuid': string; + /** + * The unique identifier of a farcaster channel + * @type {string} + * @memberof RemoveChannelMemberReqBody + */ + 'channel_id': string; + /** + * The unique identifier of a farcaster user (unsigned integer) + * @type {number} + * @memberof RemoveChannelMemberReqBody + */ + 'fid': number; + /** + * + * @type {ChannelMemberRole} + * @memberof RemoveChannelMemberReqBody + */ + 'role': ChannelMemberRole; +} + + + diff --git a/src/neynar-api/v2/openapi-farcaster/models/respond-channel-invite-request.ts b/src/neynar-api/v2/openapi-farcaster/models/respond-channel-invite-req-body.ts similarity index 77% rename from src/neynar-api/v2/openapi-farcaster/models/respond-channel-invite-request.ts rename to src/neynar-api/v2/openapi-farcaster/models/respond-channel-invite-req-body.ts index 233080fa..e2944381 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/respond-channel-invite-request.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/respond-channel-invite-req-body.ts @@ -20,31 +20,31 @@ import type { ChannelMemberRole } from './channel-member-role'; /** * * @export - * @interface RespondChannelInviteRequest + * @interface RespondChannelInviteReqBody */ -export interface RespondChannelInviteRequest { +export interface RespondChannelInviteReqBody { /** * UUID of the signer * @type {string} - * @memberof RespondChannelInviteRequest + * @memberof RespondChannelInviteReqBody */ 'signer_uuid': string; /** * The unique identifier of a farcaster channel * @type {string} - * @memberof RespondChannelInviteRequest + * @memberof RespondChannelInviteReqBody */ 'channel_id': string; /** * * @type {ChannelMemberRole} - * @memberof RespondChannelInviteRequest + * @memberof RespondChannelInviteReqBody */ 'role': ChannelMemberRole; /** * Accept or reject the invite * @type {boolean} - * @memberof RespondChannelInviteRequest + * @memberof RespondChannelInviteReqBody */ 'accept': boolean; } diff --git a/src/neynar-api/v2/openapi-farcaster/models/user-power-lite-response-result.ts b/src/neynar-api/v2/openapi-farcaster/models/user-power-lite-response-result.ts index 35e80758..5a0c2ba0 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/user-power-lite-response-result.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/user-power-lite-response-result.ts @@ -13,6 +13,9 @@ */ +// May contain unused imports in some cases +// @ts-ignore +import type { Fids } from './fids'; /** * @@ -21,10 +24,10 @@ */ export interface UserPowerLiteResponseResult { /** - * List of FIDs - * @type {Array} + * + * @type {Fids} * @memberof UserPowerLiteResponseResult */ - 'fids': Array; + 'fids': Fids; } diff --git a/src/neynar-api/v2/openapi-farcaster/models/validate-frame-request.ts b/src/neynar-api/v2/openapi-farcaster/models/validate-frame-action-req-body.ts similarity index 80% rename from src/neynar-api/v2/openapi-farcaster/models/validate-frame-request.ts rename to src/neynar-api/v2/openapi-farcaster/models/validate-frame-action-req-body.ts index cd4504bf..99210026 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/validate-frame-request.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/validate-frame-action-req-body.ts @@ -17,37 +17,37 @@ /** * * @export - * @interface ValidateFrameRequest + * @interface ValidateFrameActionReqBody */ -export interface ValidateFrameRequest { +export interface ValidateFrameActionReqBody { /** * Hexadecimal string of message bytes. * @type {string} - * @memberof ValidateFrameRequest + * @memberof ValidateFrameActionReqBody */ 'message_bytes_in_hex': string; /** * Adds viewer_context inside the cast object to indicate whether the interactor reacted to the cast housing the frame. * @type {boolean} - * @memberof ValidateFrameRequest + * @memberof ValidateFrameActionReqBody */ 'cast_reaction_context'?: boolean; /** * Adds viewer_context inside the user (interactor) object to indicate whether the interactor follows or is followed by the cast author. * @type {boolean} - * @memberof ValidateFrameRequest + * @memberof ValidateFrameActionReqBody */ 'follow_context'?: boolean; /** * Adds context about the app used by the user inside `frame.action`. * @type {boolean} - * @memberof ValidateFrameRequest + * @memberof ValidateFrameActionReqBody */ 'signer_context'?: boolean; /** * Adds context about the channel that the cast belongs to inside of the cast object. * @type {boolean} - * @memberof ValidateFrameRequest + * @memberof ValidateFrameActionReqBody */ 'channel_follow_context'?: boolean; } diff --git a/src/neynar-api/v2/openapi-farcaster/models/webhook-put-req-body.ts b/src/neynar-api/v2/openapi-farcaster/models/webhook-put-req-body.ts index c00c5045..5ba3a3eb 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/webhook-put-req-body.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/webhook-put-req-body.ts @@ -13,20 +13,39 @@ */ -// May contain unused imports in some cases -// @ts-ignore -import type { WebhookPostReqBody } from './webhook-post-req-body'; -// May contain unused imports in some cases -// @ts-ignore -import type { WebhookPutReqBodyAllOf } from './webhook-put-req-body-all-of'; // May contain unused imports in some cases // @ts-ignore import type { WebhookSubscriptionFilters } from './webhook-subscription-filters'; /** - * @type WebhookPutReqBody + * * @export + * @interface WebhookPutReqBody */ -export type WebhookPutReqBody = WebhookPostReqBody & WebhookPutReqBodyAllOf; - +export interface WebhookPutReqBody { + /** + * + * @type {string} + * @memberof WebhookPutReqBody + */ + 'name': string; + /** + * + * @type {string} + * @memberof WebhookPutReqBody + */ + 'url': string; + /** + * + * @type {WebhookSubscriptionFilters} + * @memberof WebhookPutReqBody + */ + 'subscription'?: WebhookSubscriptionFilters; + /** + * + * @type {string} + * @memberof WebhookPutReqBody + */ + 'webhook_id': string; +} diff --git a/src/neynar-api/v2/openapi-stp/.openapi-generator/FILES b/src/neynar-api/v2/openapi-stp/.openapi-generator/FILES index ff2fd4b8..10c6b624 100644 --- a/src/neynar-api/v2/openapi-stp/.openapi-generator/FILES +++ b/src/neynar-api/v2/openapi-stp/.openapi-generator/FILES @@ -11,6 +11,7 @@ index.ts models/conflict-error-res.ts models/error-res.ts models/index.ts +models/subscription-check-response.ts models/subscription-status.ts models/subscription-tier-price.ts models/subscription-tier.ts diff --git a/src/neynar-api/v2/openapi-stp/apis/stpapi.ts b/src/neynar-api/v2/openapi-stp/apis/stpapi.ts index de532e53..0d7ab19c 100644 --- a/src/neynar-api/v2/openapi-stp/apis/stpapi.ts +++ b/src/neynar-api/v2/openapi-stp/apis/stpapi.ts @@ -24,7 +24,7 @@ import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError // @ts-ignore import type { ErrorRes } from '../models'; // @ts-ignore -import type { SubscriptionStatus } from '../models'; +import type { SubscriptionCheckResponse } from '../models'; /** * STPApi - axios parameter creator * @export @@ -34,19 +34,23 @@ export const STPApiAxiosParamCreator = function (configuration?: Configuration) /** * Check if a wallet address is subscribed to a given STP contract. * @summary Subscription check by wallet address - * @param {string} addresses Comma separated list of Ethereum addresses, up to 350 at a time - * @param {string} contractAddress Ethereum address of the STP contract - * @param {string} chainId Chain ID of the STP contract + * @param {string} addresses Comma separated list of Ethereum addresses, up to 350 at a time + * @param {string} contract_address Ethereum address of the STP contract + * @param {string} chain_id Chain ID of the STP contract * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `SubscriptionCheckResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscription-check) + * */ - subscriptionCheck: async (addresses: string, contractAddress: string, chainId: string, options: RawAxiosRequestConfig = {}): Promise => { + fetchSubscriptionCheck: async (addresses: string, contract_address: string, chain_id: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'addresses' is not null or undefined - assertParamExists('subscriptionCheck', 'addresses', addresses) - // verify required parameter 'contractAddress' is not null or undefined - assertParamExists('subscriptionCheck', 'contractAddress', contractAddress) - // verify required parameter 'chainId' is not null or undefined - assertParamExists('subscriptionCheck', 'chainId', chainId) + assertParamExists('fetchSubscriptionCheck', 'addresses', addresses) + // verify required parameter 'contract_address' is not null or undefined + assertParamExists('fetchSubscriptionCheck', 'contract_address', contract_address) + // verify required parameter 'chain_id' is not null or undefined + assertParamExists('fetchSubscriptionCheck', 'chain_id', chain_id) const localVarPath = `/stp/subscription_check`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -66,12 +70,12 @@ export const STPApiAxiosParamCreator = function (configuration?: Configuration) localVarQueryParameter['addresses'] = addresses; } - if (contractAddress !== undefined) { - localVarQueryParameter['contract_address'] = contractAddress; + if (contract_address !== undefined) { + localVarQueryParameter['contract_address'] = contract_address; } - if (chainId !== undefined) { - localVarQueryParameter['chain_id'] = chainId; + if (chain_id !== undefined) { + localVarQueryParameter['chain_id'] = chain_id; } @@ -98,16 +102,20 @@ export const STPApiFp = function(configuration?: Configuration) { /** * Check if a wallet address is subscribed to a given STP contract. * @summary Subscription check by wallet address - * @param {string} addresses Comma separated list of Ethereum addresses, up to 350 at a time - * @param {string} contractAddress Ethereum address of the STP contract - * @param {string} chainId Chain ID of the STP contract + * @param {string} addresses Comma separated list of Ethereum addresses, up to 350 at a time + * @param {string} contract_address Ethereum address of the STP contract + * @param {string} chain_id Chain ID of the STP contract * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `SubscriptionCheckResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscription-check) + * */ - async subscriptionCheck(addresses: string, contractAddress: string, chainId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: SubscriptionStatus; }>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.subscriptionCheck(addresses, contractAddress, chainId, options); + async fetchSubscriptionCheck(addresses: string, contract_address: string, chain_id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchSubscriptionCheck(addresses, contract_address, chain_id, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['STPApi.subscriptionCheck']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['STPApi.fetchSubscriptionCheck']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } @@ -123,37 +131,97 @@ export const STPApiFactory = function (configuration?: Configuration, basePath?: /** * Check if a wallet address is subscribed to a given STP contract. * @summary Subscription check by wallet address - * @param {string} addresses Comma separated list of Ethereum addresses, up to 350 at a time - * @param {string} contractAddress Ethereum address of the STP contract - * @param {string} chainId Chain ID of the STP contract + * @param {STPApiFetchSubscriptionCheckRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @returns {Promise} A promise that resolves to a `SubscriptionCheckResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscription-check) + * */ - subscriptionCheck(addresses: string, contractAddress: string, chainId: string, options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: SubscriptionStatus; }> { - return localVarFp.subscriptionCheck(addresses, contractAddress, chainId, options).then((request) => request(axios, basePath)); + fetchSubscriptionCheck(requestParameters: STPApiFetchSubscriptionCheckRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchSubscriptionCheck(requestParameters.addresses, requestParameters.contract_address, requestParameters.chain_id, options).then((request) => request(axios, basePath)); }, }; }; +/** + * STPApi - interface + * @export + * @interface STPApi + */ +export interface STPApiInterface { + /** + * Check if a wallet address is subscribed to a given STP contract. + * @summary Subscription check by wallet address + * @param {STPApiFetchSubscriptionCheckRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof STPApiInterface + * @returns {Promise} A promise that resolves to a `SubscriptionCheckResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscription-check) + * + */ + fetchSubscriptionCheck(requestParameters: STPApiFetchSubscriptionCheckRequest, options?: RawAxiosRequestConfig): AxiosPromise; + +} + +/** + * Request parameters for fetchSubscriptionCheck operation in STPApi. + * @export + * @interface STPApiFetchSubscriptionCheckRequest + */ +export interface STPApiFetchSubscriptionCheckRequest { + /** + * Comma separated list of Ethereum addresses, up to 350 at a time + * + * + * @type {string} + * @memberof STPApiFetchSubscriptionCheck + */ + readonly addresses: string + + /** + * Ethereum address of the STP contract + * + * + * @type {string} + * @memberof STPApiFetchSubscriptionCheck + */ + readonly contract_address: string + + /** + * Chain ID of the STP contract + * + * + * @type {string} + * @memberof STPApiFetchSubscriptionCheck + */ + readonly chain_id: string +} + /** * STPApi - object-oriented interface * @export * @class STPApi * @extends {BaseAPI} */ -export class STPApi extends BaseAPI { +export class STPApi extends BaseAPI implements STPApiInterface { /** * Check if a wallet address is subscribed to a given STP contract. * @summary Subscription check by wallet address - * @param {string} addresses Comma separated list of Ethereum addresses, up to 350 at a time - * @param {string} contractAddress Ethereum address of the STP contract - * @param {string} chainId Chain ID of the STP contract + * @param {STPApiFetchSubscriptionCheckRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof STPApi + * @returns {Promise} A promise that resolves to a `SubscriptionCheckResponse` object + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscription-check) + * */ - public subscriptionCheck(addresses: string, contractAddress: string, chainId: string, options?: RawAxiosRequestConfig) { - return STPApiFp(this.configuration).subscriptionCheck(addresses, contractAddress, chainId, options).then((request) => request(this.axios, this.basePath)); + public fetchSubscriptionCheck(requestParameters: STPApiFetchSubscriptionCheckRequest, options?: RawAxiosRequestConfig) { + return STPApiFp(this.configuration).fetchSubscriptionCheck(requestParameters.addresses, requestParameters.contract_address, requestParameters.chain_id, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/src/neynar-api/v2/openapi-stp/models/index.ts b/src/neynar-api/v2/openapi-stp/models/index.ts index 7828083b..ebf2073e 100644 --- a/src/neynar-api/v2/openapi-stp/models/index.ts +++ b/src/neynar-api/v2/openapi-stp/models/index.ts @@ -1,5 +1,6 @@ export * from './conflict-error-res'; export * from './error-res'; +export * from './subscription-check-response'; export * from './subscription-status'; export * from './subscription-tier'; export * from './subscription-tier-price'; diff --git a/src/neynar-api/v2/openapi-stp/models/subscription-check-response.ts b/src/neynar-api/v2/openapi-stp/models/subscription-check-response.ts new file mode 100644 index 00000000..55e9f5ca --- /dev/null +++ b/src/neynar-api/v2/openapi-stp/models/subscription-check-response.ts @@ -0,0 +1,29 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * STP API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import type { SubscriptionStatus } from './subscription-status'; + +/** + * + * @export + * @interface SubscriptionCheckResponse + */ +export interface SubscriptionCheckResponse { + [key: string]: SubscriptionStatus; + +} + diff --git a/src/oas b/src/oas index 842706f7..eb75414a 160000 --- a/src/oas +++ b/src/oas @@ -1 +1 @@ -Subproject commit 842706f778e192a45cf1bfeb64a04e67f384dde2 +Subproject commit eb75414a44f953b653631ee1cc0e405d935f8c37 diff --git a/templates/apiInner.mustache b/templates/apiInner.mustache new file mode 100644 index 00000000..93980938 --- /dev/null +++ b/templates/apiInner.mustache @@ -0,0 +1,490 @@ +{{#withSeparateModelsAndApi}} +/* tslint:disable */ +/* eslint-disable */ +{{>licenseInfo}} + +import type { Configuration } from '{{apiRelativeToRoot}}configuration'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +{{#withNodeImports}} +// URLSearchParams not necessarily used +// @ts-ignore +import { URL, URLSearchParams } from 'url'; +{{#multipartFormData}} +import FormData from 'form-data' +{{/multipartFormData}} +{{/withNodeImports}} +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '{{apiRelativeToRoot}}common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '{{apiRelativeToRoot}}base'; +{{#imports}} +// @ts-ignore +import type { {{classname}} } from '{{apiRelativeToRoot}}{{tsModelPackage}}'; +{{/imports}} +{{/withSeparateModelsAndApi}} +{{^withSeparateModelsAndApi}} +{{/withSeparateModelsAndApi}} +{{#operations}} +/** + * {{classname}} - axios parameter creator{{#description}} + * {{&description}}{{/description}} + * @export + */ +export const {{classname}}AxiosParamCreator = function (configuration?: Configuration) { + return { + {{#operation}} + /** + * {{¬es}} + {{#summary}} + * @summary {{&summary}} + {{/summary}} + {{#allParams}} + * @param {{=<% %>=}}{<%#isEnum%><%&datatypeWithEnum%><%/isEnum%><%^isEnum%><%&dataType%><%#isNullable%> | null<%/isNullable%><%/isEnum%>}<%={{ }}=%> {{^required}}[{{/required}}{{paramName}}{{^required}}]{{/required}} {{description}} {{#vendorExtensions.x-is-limit-param}}{{#schema}}{{#defaultValue}} (Default: {{defaultValue}}, {{/defaultValue}}{{#maximum}}Maximum: {{maximum}}){{/maximum}}{{/schema}}{{/vendorExtensions.x-is-limit-param}} + {{/allParams}} + * @param {*} [options] Override http request option.{{#isDeprecated}} + * @deprecated{{/isDeprecated}} + * @throws {RequiredError} + * @returns {Promise<{{{returnType}}}>} A promise that resolves to a `{{{returnType}}}` object + * {{#externalDocs}} + * For more information, refer to the [API documentation]({{url}}) + * {{/externalDocs}} + */ + {{nickname}}: async ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}}, {{/allParams}}options: RawAxiosRequestConfig = {}): Promise => { + {{#allParams}} + {{#required}} + // verify required parameter '{{paramName}}' is not null or undefined + assertParamExists('{{nickname}}', '{{paramName}}', {{paramName}}) + {{/required}} + {{/allParams}} + const localVarPath = `{{{path}}}`{{#pathParams}} + .replace(`{${"{{baseName}}"}}`, encodeURIComponent(String({{paramName}}))){{/pathParams}}; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: '{{httpMethod}}', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any;{{#vendorExtensions}}{{#hasFormParams}} + const localVarFormParams = new {{^multipartFormData}}URLSearchParams(){{/multipartFormData}}{{#multipartFormData}}((configuration && configuration.formDataCtor) || FormData)(){{/multipartFormData}};{{/hasFormParams}}{{/vendorExtensions}} + + {{#authMethods}} + // authentication {{name}} required + {{#isApiKey}} + {{#isKeyInHeader}} + await setApiKeyToObject(localVarHeaderParameter, "{{keyParamName}}", configuration) + {{/isKeyInHeader}} + {{#isKeyInQuery}} + await setApiKeyToObject(localVarQueryParameter, "{{keyParamName}}", configuration) + {{/isKeyInQuery}} + {{/isApiKey}} + {{#isBasicBasic}} + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration) + {{/isBasicBasic}} + {{#isBasicBearer}} + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + {{/isBasicBearer}} + {{#isOAuth}} + // oauth required + await setOAuthToObject(localVarHeaderParameter, "{{name}}", [{{#scopes}}"{{{scope}}}"{{^-last}}, {{/-last}}{{/scopes}}], configuration) + {{/isOAuth}} + + {{/authMethods}} + {{#queryParams}} + {{#isArray}} + if ({{paramName}}) { + {{#isCollectionFormatMulti}} + {{#uniqueItems}} + localVarQueryParameter['{{baseName}}'] = Array.from({{paramName}}); + {{/uniqueItems}} + {{^uniqueItems}} + localVarQueryParameter['{{baseName}}'] = {{paramName}}; + {{/uniqueItems}} + {{/isCollectionFormatMulti}} + {{^isCollectionFormatMulti}} + {{#uniqueItems}} + localVarQueryParameter['{{baseName}}'] = Array.from({{paramName}}).join(COLLECTION_FORMATS.{{collectionFormat}}); + {{/uniqueItems}} + {{^uniqueItems}} + localVarQueryParameter['{{baseName}}'] = {{paramName}}.join(COLLECTION_FORMATS.{{collectionFormat}}); + {{/uniqueItems}} + {{/isCollectionFormatMulti}} + } + {{/isArray}} + {{^isArray}} + if ({{paramName}} !== undefined) { + {{#isDateTime}} + localVarQueryParameter['{{baseName}}'] = ({{paramName}} as any instanceof Date) ? + ({{paramName}} as any).toISOString() : + {{paramName}}; + {{/isDateTime}} + {{^isDateTime}} + {{#isDate}} + localVarQueryParameter['{{baseName}}'] = ({{paramName}} as any instanceof Date) ? + ({{paramName}} as any).toISOString().substring(0,10) : + {{paramName}}; + {{/isDate}} + {{^isDate}} + {{#isExplode}} + {{#isPrimitiveType}} + localVarQueryParameter['{{baseName}}'] = {{paramName}}; + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{^isEnumRef}} + {{^isEnum}} + for (const [key, value] of Object.entries({{paramName}})) { + localVarQueryParameter[key] = value; + } + {{/isEnum}} + {{/isEnumRef}} + {{#isEnum}} + localVarQueryParameter['{{baseName}}'] = {{paramName}}; + {{/isEnum}} + {{#isEnumRef}} + localVarQueryParameter['{{baseName}}'] = {{paramName}}; + {{/isEnumRef}} + {{/isPrimitiveType}} + {{/isExplode}} + {{^isExplode}} + localVarQueryParameter['{{baseName}}'] = {{paramName}}; + {{/isExplode}} + {{/isDate}} + {{/isDateTime}} + } + {{/isArray}} + + {{/queryParams}} + {{#headerParams}} + {{#isArray}} + if ({{paramName}}) { + {{#uniqueItems}} + let mapped = Array.from({{paramName}}).map(value => ("{{{dataType}}}" !== "Set") ? JSON.stringify(value) : (value || "")); + {{/uniqueItems}} + {{^uniqueItems}} + let mapped = {{paramName}}.map(value => ("{{{dataType}}}" !== "Array") ? JSON.stringify(value) : (value || "")); + {{/uniqueItems}} + localVarHeaderParameter['{{baseName}}'] = mapped.join(COLLECTION_FORMATS["{{collectionFormat}}"]); + } + {{/isArray}} + {{^isArray}} + {{! `val == null` covers for both `null` and `undefined`}} + if ({{paramName}} != null) { + {{#isString}} + localVarHeaderParameter['{{baseName}}'] = String({{paramName}}); + {{/isString}} + {{^isString}} + {{! isString is falsy also for $ref that defines a string or enum type}} + localVarHeaderParameter['{{baseName}}'] = typeof {{paramName}} === 'string' + ? {{paramName}} + : JSON.stringify({{paramName}}); + {{/isString}} + } + {{/isArray}} + + {{/headerParams}} + {{#vendorExtensions}} + {{#formParams}} + {{#isArray}} + if ({{paramName}}) { + {{#isCollectionFormatMulti}} + {{#contentType}} + localVarFormParams.append('{{baseName}}', new Blob([JSON.stringify({{paramName}})], { type: "{{contentType}}", })); + {{/contentType}} + {{^contentType}} + {{paramName}}.forEach((element) => { + localVarFormParams.{{#multipartFormData}}append{{/multipartFormData}}{{^multipartFormData}}set{{/multipartFormData}}('{{baseName}}{{#useSquareBracketsInArrayNames}}[]{{/useSquareBracketsInArrayNames}}', element as any); + }) + {{/contentType}} + {{/isCollectionFormatMulti}} + {{^isCollectionFormatMulti}} + localVarFormParams.{{#multipartFormData}}append{{/multipartFormData}}{{^multipartFormData}}set{{/multipartFormData}}('{{baseName}}{{#useSquareBracketsInArrayNames}}[]{{/useSquareBracketsInArrayNames}}', {{paramName}}.join(COLLECTION_FORMATS.{{collectionFormat}})); + {{/isCollectionFormatMulti}} + }{{/isArray}} + {{^isArray}} + if ({{paramName}} !== undefined) { {{^multipartFormData}} + localVarFormParams.set('{{baseName}}', {{paramName}} as any);{{/multipartFormData}}{{#multipartFormData}}{{#isPrimitiveType}}{{^isBoolean}} + localVarFormParams.append('{{baseName}}', {{paramName}} as any);{{/isBoolean}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isBoolean}} + localVarFormParams.append('{{baseName}}', String({{paramName}}) as any);{{/isBoolean}}{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isEnumRef}} + localVarFormParams.append('{{baseName}}', {{paramName}} as any);{{/isEnumRef}}{{^isEnumRef}} + localVarFormParams.append('{{baseName}}', new Blob([JSON.stringify({{paramName}})], { type: "application/json", }));{{/isEnumRef}}{{/isPrimitiveType}}{{/multipartFormData}} + }{{/isArray}} + {{/formParams}}{{/vendorExtensions}} + {{#vendorExtensions}}{{#hasFormParams}}{{^multipartFormData}} + localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded';{{/multipartFormData}}{{#multipartFormData}} + localVarHeaderParameter['Content-Type'] = 'multipart/form-data';{{/multipartFormData}} + {{/hasFormParams}}{{/vendorExtensions}} + {{#bodyParam}} + {{^consumes}} + localVarHeaderParameter['Content-Type'] = 'application/json'; + {{/consumes}} + {{#consumes.0}} + localVarHeaderParameter['Content-Type'] = '{{{mediaType}}}'; + {{/consumes.0}} + + {{/bodyParam}} + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions,{{#hasFormParams}}{{#multipartFormData}} ...(localVarFormParams as any).getHeaders?.(),{{/multipartFormData}}{{/hasFormParams}} ...options.headers}; + {{#hasFormParams}} + localVarRequestOptions.data = localVarFormParams{{#vendorExtensions}}{{^multipartFormData}}.toString(){{/multipartFormData}}{{/vendorExtensions}}; + {{/hasFormParams}} + {{#bodyParam}} + localVarRequestOptions.data = serializeDataIfNeeded({{paramName}}, localVarRequestOptions, configuration) + {{/bodyParam}} + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + {{/operation}} + } +}; + +/** + * {{classname}} - functional programming interface{{#description}} + * {{{.}}}{{/description}} + * @export + */ +export const {{classname}}Fp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = {{classname}}AxiosParamCreator(configuration) + return { + {{#operation}} + /** + * {{¬es}} + {{#summary}} + * @summary {{&summary}} + {{/summary}} + {{#allParams}} + * @param {{=<% %>=}}{<%#isEnum%><%&datatypeWithEnum%><%/isEnum%><%^isEnum%><%&dataType%><%#isNullable%> | null<%/isNullable%><%/isEnum%>}<%={{ }}=%> {{^required}}[{{/required}}{{paramName}}{{^required}}]{{/required}} {{description}} {{#vendorExtensions.x-is-limit-param}}{{#schema}}{{#defaultValue}} (Default: {{defaultValue}}, {{/defaultValue}}{{#maximum}}Maximum: {{maximum}}){{/maximum}}{{/schema}}{{/vendorExtensions.x-is-limit-param}} + {{/allParams}} + * @param {*} [options] Override http request option.{{#isDeprecated}} + * @deprecated{{/isDeprecated}} + * @throws {RequiredError} + * @returns {Promise<{{{returnType}}}>} A promise that resolves to a `{{{returnType}}}` object + * {{#externalDocs}} + * For more information, refer to the [API documentation]({{url}}) + * {{/externalDocs}} + */ + async {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}}, {{/allParams}}options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{{{returnType}}}{{^returnType}}void{{/returnType}}>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['{{classname}}.{{nickname}}']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + {{/operation}} + } +}; + +/** + * {{classname}} - factory interface{{#description}} + * {{&description}}{{/description}} + * @export + */ +export const {{classname}}Factory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = {{classname}}Fp(configuration) + return { + {{#operation}} + /** + * {{¬es}} + {{#summary}} + * @summary {{&summary}} + {{/summary}} + {{#useSingleRequestParameter}} + {{#allParams.0}} + * @param {{=<% %>=}}{<%& classname %><%& operationIdCamelCase %>Request}<%={{ }}=%> requestParameters Request parameters. + {{/allParams.0}} + {{/useSingleRequestParameter}} + {{^useSingleRequestParameter}} + {{#allParams}} + * @param {{=<% %>=}}{<%#isEnum%><%&datatypeWithEnum%><%/isEnum%><%^isEnum%><%&dataType%><%#isNullable%> | null<%/isNullable%><%/isEnum%>}<%={{ }}=%> {{^required}}[{{/required}}{{paramName}}{{^required}}]{{/required}} {{description}} {{#schema}}{{#defaultValue}} (Default: {{defaultValue}}, {{/defaultValue}}{{#maximum}}Maximum: {{maximum}}){{/maximum}}{{/schema}} + {{/allParams}} + {{/useSingleRequestParameter}} + * @param {*} [options] Override http request option.{{#isDeprecated}} + * @deprecated{{/isDeprecated}} + * @throws {RequiredError} + * @returns {Promise<{{{returnType}}}>} A promise that resolves to a `{{{returnType}}}` object + * {{#externalDocs}} + * For more information, refer to the [API documentation]({{url}}) + * {{/externalDocs}} + */ + {{#useSingleRequestParameter}} + {{nickname}}({{#allParams.0}}requestParameters: {{classname}}{{operationIdCamelCase}}Request{{^hasRequiredParams}} = {}{{/hasRequiredParams}}, {{/allParams.0}}options?: RawAxiosRequestConfig): AxiosPromise<{{{returnType}}}{{^returnType}}void{{/returnType}}> { + return localVarFp.{{nickname}}({{#allParams.0}}{{#allParams}}requestParameters.{{paramName}}, {{/allParams}}{{/allParams.0}}options).then((request) => request(axios, basePath)); + }, + {{/useSingleRequestParameter}} + {{^useSingleRequestParameter}} + {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}}, {{/allParams}}options?: RawAxiosRequestConfig): AxiosPromise<{{{returnType}}}{{^returnType}}void{{/returnType}}> { + return localVarFp.{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}options).then((request) => request(axios, basePath)); + }, + {{/useSingleRequestParameter}} + {{/operation}} + }; +}; + +{{#withInterfaces}} +/** + * {{classname}} - interface{{#description}} + * {{&description}}{{/description}} + * @export + * @interface {{classname}} + */ +export interface {{classname}}Interface { +{{#operation}} + /** + * {{¬es}} + {{#summary}} + * @summary {{&summary}} + {{/summary}} + {{#useSingleRequestParameter}} + {{#allParams.0}} + * @param {{=<% %>=}}{<%& classname %><%& operationIdCamelCase %>Request}<%={{ }}=%> requestParameters Request parameters. + {{/allParams.0}} + {{/useSingleRequestParameter}} + {{^useSingleRequestParameter}} + {{#allParams}} + * @param {{=<% %>=}}{<%#isEnum%><%&datatypeWithEnum%><%/isEnum%><%^isEnum%><%&dataType%><%#isNullable%> | null<%/isNullable%><%/isEnum%>}<%={{ }}=%> {{^required}}[{{/required}}{{paramName}}{{^required}}]{{/required}} {{description}} {{#schema}}{{#defaultValue}} (Default: {{defaultValue}}, {{/defaultValue}}{{#maximum}}Maximum: {{maximum}}){{/maximum}}{{/schema}} + {{/allParams}} + {{/useSingleRequestParameter}} + * @param {*} [options] Override http request option.{{#isDeprecated}} + * @deprecated{{/isDeprecated}} + * @throws {RequiredError} + * @memberof {{classname}}Interface + * @returns {Promise<{{{returnType}}}>} A promise that resolves to a `{{{returnType}}}` object + * {{#externalDocs}} + * For more information, refer to the [API documentation]({{url}}) + * {{/externalDocs}} + */ + {{#useSingleRequestParameter}} + {{nickname}}({{#allParams.0}}requestParameters{{^hasRequiredParams}}?{{/hasRequiredParams}}: {{classname}}{{operationIdCamelCase}}Request, {{/allParams.0}}options?: RawAxiosRequestConfig): AxiosPromise<{{{returnType}}}{{^returnType}}void{{/returnType}}>; + {{/useSingleRequestParameter}} + {{^useSingleRequestParameter}} + {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}}, {{/allParams}}options?: RawAxiosRequestConfig): AxiosPromise<{{{returnType}}}{{^returnType}}void{{/returnType}}>; + {{/useSingleRequestParameter}} + +{{/operation}} +} + +{{/withInterfaces}} +{{#useSingleRequestParameter}} +{{#operation}} +{{#allParams.0}} +/** + * Request parameters for {{nickname}} operation in {{classname}}. + * @export + * @interface {{classname}}{{operationIdCamelCase}}Request + */ +export interface {{classname}}{{operationIdCamelCase}}Request { + {{#allParams}} + /** + * {{description}}{{#vendorExtensions.x-is-limit-param}}{{#schema}}{{#defaultValue}} (Default: {{defaultValue}}, {{/defaultValue}}{{#maximum}}Maximum: {{maximum}}){{/maximum}}{{/schema}}{{/vendorExtensions.x-is-limit-param}} + * {{#vendorExtensions.x-accept-as}}@acceptAs {{vendorExtensions.x-accept-as}}{{/vendorExtensions.x-accept-as}} + * {{#vendorExtensions.x-comma-separated}}@commaSeparated{{/vendorExtensions.x-comma-separated}} + * @type {{=<% %>=}}{<%&dataType%>}<%={{ }}=%> + * @memberof {{classname}}{{operationIdCamelCase}} + */ + readonly {{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}} + {{^-last}} + + {{/-last}} + {{/allParams}} +} + +{{/allParams.0}} +{{/operation}} +{{/useSingleRequestParameter}} +/** + * {{classname}} - object-oriented interface{{#description}} + * {{{.}}}{{/description}} + * @export + * @class {{classname}} + * @extends {BaseAPI} + */ +{{#withInterfaces}} +export class {{classname}} extends BaseAPI implements {{classname}}Interface { +{{/withInterfaces}} +{{^withInterfaces}} +export class {{classname}} extends BaseAPI { +{{/withInterfaces}} + {{#operation}} + /** + * {{¬es}} + {{#summary}} + * @summary {{&summary}} + {{/summary}} + {{#useSingleRequestParameter}} + {{#allParams.0}} + * @param {{=<% %>=}}{<%& classname %><%& operationIdCamelCase %>Request}<%={{ }}=%> requestParameters Request parameters. + {{/allParams.0}} + {{/useSingleRequestParameter}} + {{^useSingleRequestParameter}} + {{#allParams}} + * @param {{=<% %>=}}{<%#isEnum%><%&datatypeWithEnum%><%/isEnum%><%^isEnum%><%&dataType%><%#isNullable%> | null<%/isNullable%><%/isEnum%>}<%={{ }}=%> {{^required}}[{{/required}}{{paramName}}{{^required}}]{{/required}} {{description}} {{#schema}}{{#defaultValue}} (Default: {{defaultValue}}, {{/defaultValue}}{{#maximum}}Maximum: {{maximum}}){{/maximum}}{{/schema}} + {{/allParams}} + {{/useSingleRequestParameter}} + * @param {*} [options] Override http request option.{{#isDeprecated}} + * @deprecated{{/isDeprecated}} + * @throws {RequiredError} + * @memberof {{classname}} + * @returns {Promise<{{{returnType}}}>} A promise that resolves to a `{{{returnType}}}` object + * {{#externalDocs}} + * For more information, refer to the [API documentation]({{url}}) + * {{/externalDocs}} + */ + {{#useSingleRequestParameter}} + public {{nickname}}({{#allParams.0}}requestParameters: {{classname}}{{operationIdCamelCase}}Request{{^hasRequiredParams}} = {}{{/hasRequiredParams}}, {{/allParams.0}}options?: RawAxiosRequestConfig) { + return {{classname}}Fp(this.configuration).{{nickname}}({{#allParams.0}}{{#allParams}}requestParameters.{{paramName}}, {{/allParams}}{{/allParams.0}}options).then((request) => request(this.axios, this.basePath)); + } + {{/useSingleRequestParameter}} + {{^useSingleRequestParameter}} + public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}}, {{/allParams}}options?: RawAxiosRequestConfig) { + return {{classname}}Fp(this.configuration).{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}options).then((request) => request(this.axios, this.basePath)); + } + {{/useSingleRequestParameter}} + {{^-last}} + + {{/-last}} + {{/operation}} +} +{{/operations}} + +{{#operations}} +{{#operation}} +{{#allParams}} +{{#isEnum}} +{{#stringEnums}} +/** + * @export + * @enum {string} + */ +export enum {{operationIdCamelCase}}{{enumName}} { +{{#allowableValues}} + {{#enumVars}} + {{{name}}} = {{{value}}}{{^-last}},{{/-last}} + {{/enumVars}} +{{/allowableValues}} +} +{{/stringEnums}} +{{^stringEnums}} +/** + * @export + */ +export const {{operationIdCamelCase}}{{enumName}} = { +{{#allowableValues}} + {{#enumVars}} + {{{name}}}: {{{value}}}{{^-last}},{{/-last}} + {{/enumVars}} +{{/allowableValues}} +} as const; +export type {{operationIdCamelCase}}{{enumName}} = typeof {{operationIdCamelCase}}{{enumName}}[keyof typeof {{operationIdCamelCase}}{{enumName}}]; +{{/stringEnums}} +{{/isEnum}} +{{/allParams}} +{{/operation}} +{{/operations}} \ No newline at end of file