diff --git a/README.md b/README.md index 18d74cc9..421ce7ce 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,13 @@ # @neynar/nodejs-sdk -@neynar/nodejs-sdk typescript-based, easy-to-use SDK built to interact with [Neynar API's](https://docs.neynar.com/). - -## Instantiate Client -Just set the NEYNAR_API_KEY while instantiating a client and you are good to go. - -``` -import { NeynarAPIClient } from "@neynar/nodejs-sdk"; +@neynar/nodejs-sdk typescript-based, easy-to-use SDK built to interact with [Neynar API's](https://docs.neynar.com/). -const neynarClient = new NeynarAPIClient(process.env.NEYNAR_API_KEY); +## Usage -export default neynarClient; -``` +Please refer our [Getting Started Guide](https://docs.neynar.com/reference/getting-started-with-sdk) -## Use Client +Checkout [examples](https://github.com/neynarxyz/farcaster-examples) using this SDK -Errors are propagated, so the user can handle them as they please, so use try/catch or .catch() and handle errors accordingly +## License -``` -try { - const recentCasts = await neynarClient.fetchRecentCasts(); - console.log("Recent Casts", recentCasts); -} catch (error) { - console.log((error as AxiosError).response?.data || (error as Error)); -} -``` +This project is licensed under the MIT License - see the [LICENSE](https://github.com/neynarxyz/nodejs-sdk/blob/main/LICENSE) file for details. diff --git a/docs/getting-started.md b/docs/getting-started.md deleted file mode 100644 index 0c41209a..00000000 --- a/docs/getting-started.md +++ /dev/null @@ -1,116 +0,0 @@ -Checkout the full github repo here: -https://github.com/neynarxyz/nodejs-sdk - -### Installation - -Install [ Nodejs](https://nodejs.org/en/download/package-manager), [yarn](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable) (Optional, you can also use npm) - -#### Initiallize project - -```bash -mkdir get-started-with-neynar -cd get-started-with-neynar -npm init -y -npm install -g typescript -tsc --init -``` - -#### Install Neynar SDK and other dependencies - -
-Install using npm -

-    npm i @neynar/nodejs-sdk axios
-    npm i -D typescript ts-node
-    
-
- -
- Install using Yarn -

-    yarn add @neynar/nodejs-sdk axios
-    yarn add -D typescript ts-node
-    
-
- -     - -### Example: Let's use sdk to look up a user by their FID - -Create index.ts file at root level - -```bash -touch index.ts -``` - -Add following code in index.ts - -```typescript -// index.ts - -import { NeynarAPIClient, isApiErrorResponse } from "@neynar/nodejs-sdk"; -import { AxiosError } from "axios"; - -// Instantiate the client -const client = new NeynarAPIClient(""); // Replace with your Neynar API Key. - -(async () => { - try { - // here 19960 (Required*) => User we are looking for. - // 191 (Optional) => is viewer looking for the user. - // Get more info @ https://docs.neynar.com/reference/user-v1 - const user = await client.lookupUserByFid(19960, 191); - - // Stringify and log the response - console.log(JSON.stringify(user)); - } catch (error) { - // isApiErrorResponse can be used to check for Neynar API errors - // handle errors accordingly - if (isApiErrorResponse(error)) { - console.log("API Error", error.response.data); - } else { - console.log("Generic Error", error); - } - } -})(); -``` - -Run the project - -```bash -npx ts-node index.ts -``` - -You should see a response like this. (You might not get beautified/ formated response since we `JSON.stringify` the response in order to log everything) - -```json -{ - "result": { - "user": { - "fid": 19960, - "custodyAddress": "0xd1b702203b1b3b641a699997746bd4a12d157909", - "username": "shreyas-chorge", - "displayName": "Shreyas", - "pfp": { - "url": "https://i.imgur.com/LPzRlQl.jpg" - }, - "profile": { - "bio": { - "text": "Everyday regular normal guy | 👨‍💻 @neynar", - "mentionedProfiles": [] - } - }, - "followerCount": 13, - "followingCount": 55, - "verifications": ["0xd1b702203b1b3b641a699997746bd4a12d157909"], - "activeStatus": "inactive", - "viewerContext": { - "following": true, - "followedBy": false - } - } - } -} -``` - -### Congratulation..!! 🎉 You successfully setup @neynar/nodejs-sdk and used it to look up a user by their FID. diff --git a/openapitools.json b/openapitools.json index 4053ae89..cd53ff4c 100644 --- a/openapitools.json +++ b/openapitools.json @@ -2,6 +2,6 @@ "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", "spaces": 2, "generator-cli": { - "version": "7.0.1" + "version": "6.6.0" } } diff --git a/package.json b/package.json index 38cfdfb0..cebe2e5f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@neynar/nodejs-sdk", - "version": "0.11.4", + "version": "1.0.0", "description": "SDK to interact with Neynar APIs (https://docs.neynar.com/)", "main": "./build/index.js", "types": "./build/index.d.ts", @@ -10,12 +10,12 @@ "scripts": { "clean": "del-cli ./build/*", "build": "yarn run clean && tsc", - "generate:neynar-oas": "openapi-generator-cli generate -i src/oas/src/v1/spec.yaml -g typescript-axios -o src/neynar-api/neynar-v1-api/openapi --config src/oas/openapi-generator-config.json", - "generate:neynar-oas-v2-farcaster": "openapi-generator-cli generate -i src/oas/src/v2/spec.yaml -g typescript-axios -o src/neynar-api/neynar-v2-api/openapi-farcaster --config src/oas/openapi-generator-config.json", - "generate:neynar-oas-v2-recommendation": "openapi-generator-cli generate -i src/oas/src/v2/recommendation/spec.yaml -g typescript-axios -o src/neynar-api/neynar-v2-api/openapi-recommendation --config src/oas/openapi-generator-config.json" + "generate:neynar-oas-v1-farcaster": "del-cli src/neynar-api/v1/openapi; openapi-generator-cli generate -i src/oas/src/v1/spec.yaml -g typescript-axios -o src/neynar-api/v1/openapi --config src/oas/openapi-generator-config.json", + "generate:neynar-oas-v2-farcaster": "del-cli src/neynar-api/v2/openapi-farcaster; openapi-generator-cli generate -i src/oas/src/v2/spec.yaml -g typescript-axios -o src/neynar-api/v2/openapi-farcaster --config src/oas/openapi-generator-config.json", + "generate:neynar-oas-v2-recommendation": "del-cli src/neynar-api/v2/openapi-recommendation; openapi-generator-cli generate -i src/oas/src/v2/recommendation/spec.yaml -g typescript-axios -o src/neynar-api/v2/openapi-recommendation --config src/oas/openapi-generator-config.json" }, "author": "Neynar", - "license": "ISC", + "license": "MIT", "devDependencies": { "@types/node": "^20.8.4", "del-cli": "^5.1.0", @@ -24,6 +24,7 @@ }, "dependencies": { "@openapitools/openapi-generator-cli": "^2.7.0", - "axios": "^1.6.2" + "axios": "^1.6.2", + "viem": "^1.19.9" } -} \ No newline at end of file +} diff --git a/src/neynar-api/abi/key-gateway.ts b/src/neynar-api/abi/key-gateway.ts new file mode 100644 index 00000000..5a541704 --- /dev/null +++ b/src/neynar-api/abi/key-gateway.ts @@ -0,0 +1,288 @@ +export const keyGatewayAbi = [ + { + inputs: [ + { internalType: "address", name: "_keyRegistry", type: "address" }, + { internalType: "address", name: "_initialOwner", type: "address" }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [ + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "currentNonce", type: "uint256" }, + ], + name: "InvalidAccountNonce", + type: "error", + }, + { inputs: [], name: "InvalidShortString", type: "error" }, + { inputs: [], name: "InvalidSignature", type: "error" }, + { inputs: [], name: "OnlyGuardian", type: "error" }, + { inputs: [], name: "SignatureExpired", type: "error" }, + { + inputs: [{ internalType: "string", name: "str", type: "string" }], + name: "StringTooLong", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "guardian", + type: "address", + }, + ], + name: "Add", + type: "event", + }, + { anonymous: false, inputs: [], name: "EIP712DomainChanged", type: "event" }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "previousOwner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnershipTransferStarted", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "previousOwner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnershipTransferred", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "Paused", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "guardian", + type: "address", + }, + ], + name: "Remove", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "Unpaused", + type: "event", + }, + { + inputs: [], + name: "ADD_TYPEHASH", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "VERSION", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "acceptOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint32", name: "keyType", type: "uint32" }, + { internalType: "bytes", name: "key", type: "bytes" }, + { internalType: "uint8", name: "metadataType", type: "uint8" }, + { internalType: "bytes", name: "metadata", type: "bytes" }, + ], + name: "add", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "fidOwner", type: "address" }, + { internalType: "uint32", name: "keyType", type: "uint32" }, + { internalType: "bytes", name: "key", type: "bytes" }, + { internalType: "uint8", name: "metadataType", type: "uint8" }, + { internalType: "bytes", name: "metadata", type: "bytes" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes", name: "sig", type: "bytes" }, + ], + name: "addFor", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "guardian", type: "address" }], + name: "addGuardian", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "domainSeparatorV4", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "eip712Domain", + outputs: [ + { internalType: "bytes1", name: "fields", type: "bytes1" }, + { internalType: "string", name: "name", type: "string" }, + { internalType: "string", name: "version", type: "string" }, + { internalType: "uint256", name: "chainId", type: "uint256" }, + { internalType: "address", name: "verifyingContract", type: "address" }, + { internalType: "bytes32", name: "salt", type: "bytes32" }, + { internalType: "uint256[]", name: "extensions", type: "uint256[]" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "guardian", type: "address" }], + name: "guardians", + outputs: [{ internalType: "bool", name: "isGuardian", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "structHash", type: "bytes32" }], + name: "hashTypedDataV4", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "keyRegistry", + outputs: [ + { internalType: "contract IKeyRegistry", name: "", type: "address" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "owner", type: "address" }], + name: "nonces", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "owner", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "pause", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "paused", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "pendingOwner", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "guardian", type: "address" }], + name: "removeGuardian", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "renounceOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "newOwner", type: "address" }], + name: "transferOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "unpause", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "useNonce", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, +] as const; diff --git a/src/neynar-api/abi/signed-key-request-metadata.ts b/src/neynar-api/abi/signed-key-request-metadata.ts new file mode 100644 index 00000000..7c4a4b81 --- /dev/null +++ b/src/neynar-api/abi/signed-key-request-metadata.ts @@ -0,0 +1,41 @@ +export const SignedKeyRequestMetadataABI = { + inputs: [ + { + components: [ + { + internalType: "uint256", + name: "requestFid", + type: "uint256", + }, + { + internalType: "address", + name: "requestSigner", + type: "address", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + ], + internalType: "struct SignedKeyRequestValidator.SignedKeyRequestMetadata", + name: "metadata", + type: "tuple", + }, + ], + name: "encodeMetadata", + outputs: [ + { + internalType: "bytes", + name: "", + type: "bytes", + }, + ], + stateMutability: "pure", + type: "function", +}; diff --git a/src/neynar-api/common/constants.ts b/src/neynar-api/common/constants.ts new file mode 100644 index 00000000..c2360af7 --- /dev/null +++ b/src/neynar-api/common/constants.ts @@ -0,0 +1,33 @@ +// DO NOT CHANGE ANY VALUES IN THIS CONSTANT +export const SIGNED_KEY_REQUEST_VALIDATOR_EIP_712_DOMAIN = { + name: "Farcaster SignedKeyRequestValidator", + version: "1", + chainId: 10, + verifyingContract: + "0x00000000fc700472606ed4fa22623acf62c60553" as `0x${string}`, +}; + +// DO NOT CHANGE ANY VALUES IN THIS CONSTANT +export const SIGNED_KEY_REQUEST_TYPE = [ + { name: "requestFid", type: "uint256" }, + { name: "key", type: "bytes" }, + { name: "deadline", type: "uint256" }, +]; + +export const SIGNED_KEY_REQUEST_VALIDATOR = { + name: "Farcaster SignedKeyRequestValidator", + version: "1", + chainId: 10, + verifyingContract: + "0x00000000fc700472606ed4fa22623acf62c60553" as `0x${string}`, +}; + +export const SIGNED_KEY_REQUEST_TYPE_FOR_ADD_FOR = [ + { name: "owner", type: "address" }, + { name: "keyType", type: "uint32" }, + { name: "key", type: "bytes" }, + { name: "metadataType", type: "uint8" }, + { name: "metadata", type: "bytes" }, + { name: "nonce", type: "uint256" }, + { name: "deadline", type: "uint256" }, +]; diff --git a/src/neynar-api/common/viemClient.ts b/src/neynar-api/common/viemClient.ts new file mode 100644 index 00000000..08043e27 --- /dev/null +++ b/src/neynar-api/common/viemClient.ts @@ -0,0 +1,7 @@ +import { createPublicClient, http } from "viem"; +import { optimism } from "viem/chains"; + +export const viemPublicClient = createPublicClient({ + chain: optimism, + transport: http(), +}); diff --git a/src/neynar-api/index.ts b/src/neynar-api/index.ts index 0aa31579..c4f9d1c4 100644 --- a/src/neynar-api/index.ts +++ b/src/neynar-api/index.ts @@ -1,2 +1,3 @@ export * from "./neynar-api-client"; export * from "./utils"; +export { FeedType, FilterType, ReactionsType, CastParamType } from "./v2"; diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index 61a557a0..536cd963 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -1,3 +1,5 @@ +import { mnemonicToAccount } from "viem/accounts"; + import { Signer, Cast, @@ -7,45 +9,63 @@ import { OperationResponse, BulkFollowResponse, EmbeddedCast, - FeedType, - FilterType, FeedResponse, NotificationsResponse, RelevantFollowersResponse, - UserBulk200Response, UserSearchResponse, CastResponse, CastsResponse, UserResponse, -} from "./neynar-v2-api/openapi-farcaster"; + BulkUsersResponse, + FeedType, + FilterType, + ReactionsResponse, + ReactionsType, + StorageAllocationsResponse, + StorageUsageResponse, + SignerStatusEnum, +} from "./v2/openapi-farcaster"; import { RecentUsersResponse, UserCastLikeResponse, - User, Cast as CastV1, CastsResponse as CastsResponseV1, RecentCastsResponse, - VerificationResponseResult, MentionsAndRepliesResponse, ReactionsAndRecastsResponse, CastLikesResponse, CastReactionsResponse, CastRecasterResponse, FollowResponse, - User200Response, -} from "./neynar-v1-api/openapi"; + UserResponse as UserResponseV1, + CustodyAddressResponse, + CastResponse as CastResponseV1, + VerificationResponse, + AllCastsInThreadResponse, +} from "./v1/openapi"; -import { FetchRelevantMints200Response } from "./neynar-v2-api/openapi-recommendation"; +import { RelevantMints } from "./v2/openapi-recommendation"; import { AxiosInstance } from "axios"; import { silentLogger, Logger } from "./common/logger"; -import { NeynarV1APIClient } from "./neynar-v1-api"; -import { NeynarV2APIClient } from "./neynar-v2-api"; +import { NeynarV1APIClient } from "./v1"; +import { NeynarV2APIClient } from "./v2"; +import { encodeAbiParameters } from "viem"; +import { viemPublicClient } from "./common/viemClient"; +import { SignedKeyRequestMetadataABI } from "./abi/signed-key-request-metadata"; +import { keyGatewayAbi } from "./abi/key-gateway"; +import { + SIGNED_KEY_REQUEST_TYPE, + SIGNED_KEY_REQUEST_TYPE_FOR_ADD_FOR, + SIGNED_KEY_REQUEST_VALIDATOR, + SIGNED_KEY_REQUEST_VALIDATOR_EIP_712_DOMAIN, +} from "./common/constants"; +import { isApiErrorResponse } from "./utils"; export class NeynarAPIClient { private readonly logger: Logger; - public readonly clients: { + private readonly clients: { v1: NeynarV1APIClient; v2: NeynarV2APIClient; }; @@ -86,9 +106,30 @@ export class NeynarAPIClient { // ------------ User ------------ /** - * A list of users in reverse chronological order based on sign up. - * See [Neynar documentation](https://docs.neynar.com/reference/recent-users-v1) + * Retrieves a list of users in reverse chronological order based on sign up. * + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {number} [options.viewerFid] - The FID (unique identifier) of the user viewing the data. + * This can be used for providing contextual information specific to the viewer. + * @param {number} [options.limit] - The maximum number of users to be returned in the response. + * Defaults to 100, with a maximum allowable value of 1000. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `RecentUsersResponse` object, + * containing the list of recent users and any associated metadata. + * + * @example + * // Fetch a specific number of recent users, using viewer FID and a pagination cursor + * client.fetchRecentUsers({ + * viewerFid: 3, + * limit: 50, // Fetching up to 50 users + * // cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Recent Users:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/recent-users-v1) */ public async fetchRecentUsers(options?: { viewerFid?: number; @@ -99,9 +140,32 @@ export class NeynarAPIClient { } /** - * Fetch all likes by a given user. - * See [Neynar documentation](https://docs.neynar.com/reference/user-cast-likes-v1) + * Retrieves all casts liked by a specific user. This method returns a list of casts that + * the specified user has liked, with support for pagination through optional parameters. + * + * @param {number} fid - The FID (unique identifier) of the user whose liked casts are to be fetched. + * @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 maximum number of liked casts to be returned in the response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `UserCastLikeResponse` object, + * containing the list of casts liked by the user and any associated metadata. + * + * @example + * // Fetch a specific number of casts liked by a user, using viewer FID and a pagination cursor + * client.fetchAllCastsLikedByUser(3, { + * viewerFid: 2, + * limit: 50, // Fetching up to 50 casts + * // cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Liked Casts:', response); + * }); * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/user-cast-likes-v1). */ public async fetchAllCastsLikedByUser( fid: number, @@ -111,69 +175,162 @@ export class NeynarAPIClient { } /** - * Gets the specified user via their FID (if found). - * See [Neynar documentation](https://docs.neynar.com/reference/user-v1) + * Retrieves the specified user via their FID (if found). * + * @param {number} fid - The FID of the user whose information is being retrieved. + * @param {number} [viewerFid] - Optional. The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * + * @returns {Promise} A promise that resolves to a `UserResponseV1` object, + * containing the metadata about the specified user. + * + * @example + * // Example: Retrieve information about a user with FID 19960 as viewed by a user with FID 194 + * client.lookupUserByFid(19960, 194).then(response => { + * console.log('User Information:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/user-v1). */ public async lookupUserByFid( fid: number, viewerFid?: number - ): Promise { + ): Promise { return await this.clients.v1.lookupUserByFid(fid, viewerFid); } /** - * Gets the specified user via their username (if found). - * See [Neynar documentation](https://docs.neynar.com/reference/user-by-username-v1) + * Retrieves the specified user via their username (if found). + * + * @param {string} username - The username of the user whose information is being retrieved. + * @param {number} [viewerFid] - Optional. The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * + * @returns {Promise} A promise that resolves to a `UserResponseV1` object, + * containing the metadata about the user associated with the given username. + * + * @example + * // Example: Retrieve information about a user with username 'manan' as viewed by a user with FID 3 + * client.lookupUserByUsername('manan', 3).then(response => { + * console.log('User Information:', response); + * }); * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/user-by-username-v1). */ public async lookupUserByUsername( username: string, viewerFid?: number - ): Promise { + ): Promise { return await this.clients.v1.lookupUserByUsername(username, viewerFid); } /** - * Gets the custody address for the specified user via their username (if found). - * See [Neynar documentation](https://docs.neynar.com/reference/custody-address-v1) + * Retrieves the custody address for the specified user via their fid (if found). * + * @param {number} fid - The FID (unique identifier) of the user whose custody address is being retrieved. + * + * @returns {Promise} A promise that resolves to a `CustodyAddressResponse` object, + * containing the custody address associated with the specified user. + * + * @example + * // Example: Retrieve the custody address for a user with FID 194 + * client.lookupCustodyAddressForUser(194).then(response => { + * console.log('Custody Address:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/custody-address-v1). */ - public async fetchCustodyAddressForUser(fid: number): Promise { - return await this.clients.v1.fetchCustodyAddressForUser(fid); + public async lookupCustodyAddressForUser( + fid: number + ): Promise { + return await this.clients.v1.lookupCustodyAddressForUser(fid); } // ------------ Cast ------------ /** - * Fetches a single cast by its hash. - * See [Neynar documentation](https://docs.neynar.com/reference/cast-v1) + * Retrieves information about a single cast using its unique hash identifier. + * + * @param {string} hash - The unique hash identifier of the cast to be retrieved. + * @param {Object} [options] - Optional parameters for the request. + * @param {number} [options.viewerFid] - Optional. The FID of the user viewing the information, + * used for providing contextual data specific to the viewer. * + * @returns {Promise} A promise that resolves to a `CastResponseV1` object, + * containing detailed information about the specified cast. + * + * @example + * // Example: Retrieve information about a cast with a specific hash, as viewed by a user with FID 3 + * client.lookUpCastByHash('0xfe90f9de682273e05b201629ad2338bdcd89b6be', { viewerFid: 3 }).then(response => { + * console.log('Cast Information:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/cast-v1). */ public async lookUpCastByHash( hash: string, options?: { viewerFid?: number } - ): Promise { + ): Promise { return await this.clients.v1.lookUpCastByHash(hash, options); } /** - * Gets all casts, including root cast and all replies for a given thread hash. No limit the depth of replies. - * See [Neynar documentation](https://docs.neynar.com/reference/all-casts-in-thread-v1) - * Note that the parent provided by the caller is included in the response. + * Retrieves all casts, including root cast and all replies for a given thread hash. No limit to the depth of replies. + * **Note :** The parent provided by the caller is included in the response. + * + * @param {CastV1 | string} threadParent - The parent cast or the hash of the thread for which + * all related casts are to be fetched. If a Cast object is provided, its hash is used. + * @param {number} [viewerFid] - The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. * + * @returns {Promise} A promise that resolves to an `AllCastsInThreadResponse` object, + * containing all casts within the specified thread. + * + * @example + * // Example: Fetch all casts in a thread using a thread hash + * client.fetchAllCastsInThread('0xfe90f9de682273e05b201629ad2338bdcd89b6be', 3).then(response => { + * console.log('Thread Casts:', response); // Outputs all casts in the thread + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/all-casts-in-thread-v1). */ public async fetchAllCastsInThread( - threadParent: CastV1 | { hash: string }, + threadParent: CastV1 | string, viewerFid?: number - ): Promise { + ): Promise { return await this.clients.v1.fetchAllCastsInThread(threadParent, viewerFid); } /** - * Gets all casts (including replies and recasts) created by the specified user. - * See [Neynar documentation](https://docs.neynar.com/reference/casts-v1) + * Retrieves all casts (including replies and recasts) created by the specified user. + * + * @param {number} fid - The FID (unique identifier) of the user whose casts are being retrieved. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {string} [options.parentUrl] - Optional. A URL identifying the channel to which the casts belong. + * A cast can be part of a certain channel. The channel is identified by parent_url. + * All casts in the channel ladder up to the same parent_url. + * @param {number} [options.viewerFid] - Optional. The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * @param {number} [options.limit] - Optional. The maximum number of casts to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. * + * @returns {Promise} A promise that resolves to a `CastsResponseV1` object, + * containing the casts created by the specified user along with any associated metadata. + * + * @example + * // Example: Retrieve casts created by a user with FID 3, including contextual information for a viewer + * client.fetchAllCastsCreatedByUser(3, { + * parentUrl: 'https://ethereum.org', + * viewerFid: 2, + * limit: 50, // Fetching up to 50 casts + * // cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('User Casts:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/casts-v1). */ public async fetchAllCastsCreatedByUser( fid: number, @@ -188,9 +345,30 @@ export class NeynarAPIClient { } /** - * Gets recent casts created by the specified user. - * See [Neynar documentation](https://docs.neynar.com/reference/recent-casts-v1) + * Retrieves a list of casts from the protocol in reverse chronological order based on timestamp + * + * @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 maximum number of casts to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 100. + * @param {string} [options.cursor] - Pagination cursor for the next set of results. + * Omit this parameter for the initial request. Useful for paginated retrieval of subsequent data. * + * @returns {Promise} A promise that resolves to a `RecentCastsResponse` object, + * containing the recent casts along with any associated metadata. + * + * @example + * // Example: Retrieve recent casts with a limit of 50, as viewed by a user with FID 3 + * client.fetchRecentCasts({ + * viewerFid: 3, + * limit: 50, // Fetching up to 50 casts + * // cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Recent Casts:', response); // Outputs the recent casts + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/recent-casts-v1). */ public async fetchRecentCasts(options?: { viewerFid?: number; @@ -203,36 +381,81 @@ export class NeynarAPIClient { // ------------ Verification ------------ /** - * Gets all known verifications of a user. - * See [Neynar documentation](https://docs.neynar.com/reference/verifications-v1) + * Retrieve all known verifications of a user. + * + * @param {number} fid - The FID (unique identifier) of the user whose verifications are being retrieved. * + * @returns {Promise} A promise that resolves to a `VerificationResponse` object + * + * @example + * // Example: Retrieve all verifications for a user with FID 3 + * client.fetchUserVerifications(3).then(response => { + * console.log('User Verifications:', response); // Outputs the user's verifications + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/verifications-v1). */ public async fetchUserVerifications( fid: number - ): Promise { + ): Promise { return await this.clients.v1.fetchUserVerifications(fid); } /** + * Retrieve user information using a verification address + * * Checks if a given Ethereum address has a Farcaster user associated with it. * Note: if an address is associated with multiple users, the API will return * the user who most recently published a verification with the address * (based on when Warpcast received the proof, not a self-reported timestamp). - * See [Neynar documentation](https://docs.neynar.com/reference/user-by-verification-v1) * + * @param {string} address - The Ethereum address that have has a Farcaster user associated with it + * + * @returns {Promise} A promise that resolves to a `UserResponseV1` object, + * containing user information linked to the given verification address. + * + * @example + * // Example: Retrieve user information using a verification address + * client.lookupUserByVerification('0x7ea5dada4021c2c625e73d2a78882e91b93c174c').then(response => { + * console.log('User Information:', response); // Outputs the user information associated with the verification address + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/user-by-verification-v1). */ public async lookupUserByVerification( address: string - ): Promise { + ): Promise { return await this.clients.v1.lookupUserByVerification(address); } // ------------ Notifications ------------ /** - * Gets a list of mentions and replies to the user’s casts in reverse chronological order. - * See [Neynar documentation](https://docs.neynar.com/reference/mentions-and-replies-v1) + * Retrieves a list of mentions and replies to the user’s casts in reverse chronological order. * + * @param {number} fid - The FID (unique identifier) of the user whose mentions and replies are being retrieved. + * @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 maximum number of results to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `MentionsAndRepliesResponse` object, + * containing a list of mentions and replies to the user's casts. + * + * @example + * // Example: Retrieve the first set of mentions and replies for a user with FID 12345, limited to 50 + * client.fetchMentionAndReplyNotifications(3, { + * viewerFid: 2, // The FID of the user viewing this information + * limit: 50, // Fetching up to 50 mentions and replies + * // cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Mentions and Replies:', response); // Outputs the mentions and replies + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/mentions-and-replies-v1). */ public async fetchMentionAndReplyNotifications( fid: number, @@ -245,9 +468,31 @@ export class NeynarAPIClient { } /** - * Get a list of likes and recasts to the users’s casts in reverse chronological order. - * See [Neynar documentation](https://docs.neynar.com/reference/reactions-and-recasts-v1) + * Retrieves a list of likes and recasts to the user’s casts in reverse chronological order. + * + * @param {number} fid - The FID (unique identifier) of the user whose likes and recasts are being retrieved. + * @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 maximum number of results to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `ReactionsAndRecastsResponse` object, + * containing a list of likes and recasts to the user's casts. * + * @example + * // Example: Retrieve the first set of likes and recasts for a user with FID 12345, limited to 50 + * client.fetchUserLikesAndRecasts(12345, { + * viewerFid: 67890, // The FID of the user viewing this information + * limit: 50, // Fetching up to 50 likes and recasts + * // cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Likes and Recasts:', response); // Outputs the likes and recasts + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/reactions-and-recasts-v1). */ public async fetchUserLikesAndRecasts( fid: number, @@ -259,9 +504,31 @@ export class NeynarAPIClient { // ------------ Reactions ------------ /** - * Lists a given cast's likes. - * See [Neynar documentation](https://docs.neynar.com/reference/cast-likes-v1) + * Retrieves all like reactions for a specific cast in reverse chronological order. + * + * @param {CastV1 | string} castOrCastHash - The Cast object or its hash for which likes are being retrieved. + * @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 maximum number of results to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `CastLikesResponse` object, + * containing a list of likes for the given cast. * + * @example + * // Example: Retrieve the first set of likes for a cast with a specific hash, limited to 2 + * client.fetchCastLikes('0xfe90f9de682273e05b201629ad2338bdcd89b6be', { + * viewerFid: 3, // The FID of the user viewing this information + * limit: 2, // Fetching up to 2 likes + * // cursor: "nextPageCursor", // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Cast Likes:', response); // Outputs the cast likes + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/cast-likes-v1). */ public async fetchCastLikes( castOrCastHash: CastV1 | string, @@ -271,9 +538,31 @@ export class NeynarAPIClient { } /** - * Get All Reactions For a Cast. - * See [Neynar documentation](https://docs.neynar.com/reference/cast-reactions-v1) + * Retrieves all reactions (likes and recasts) for a specific cast. + * + * @param {CastV1 | string} castOrCastHash - The Cast object or its hash for which reactions are being retrieved. + * @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 maximum number of results to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `CastReactionsResponse` object, + * containing a list of all reactions for the given cast. * + * @example + * // Example: Retrieve the first set of reactions for a cast with a specific hash, limited to 5 + * client.fetchCastReactions('0xfe90f9de682273e05b201629ad2338bdcd89b6be', { + * viewerFid: 3, // The FID of the user viewing this information + * limit: 5, // Fetching up to 5 reactions + * // cursor: "nextPageCursor", // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Cast Reactions:', response); // Outputs the cast reactions + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/cast-reactions-v1). */ public async fetchCastReactions( castOrCastHash: CastV1 | string, @@ -283,9 +572,31 @@ export class NeynarAPIClient { } /** - * Get the list of users who have recasted a specific cast. - * See [Neynar documentation](https://docs.neynar.com/reference/cast-recasters-v1) + * Retrieves the list of users who have recasted a specific cast. + * + * @param {CastV1 | string} castOrCastHash - The Cast object or its hash for which recasters are being retrieved. + * @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 maximum number of results to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `CastRecasterResponse` object, + * containing a list of recasters for the given cast. * + * @example + * // Example: Retrieve the first set of recasters for a cast with a specific hash, limited to 3 + * client.fetchRecasters('0xafadc0478ede366e3f5232af3190a82dea20b169', { + * viewerFid: 3, // The FID of the user viewing this information + * limit: 3, // Fetching up to 3 recasters + * // cursor: "nextPageCursor", // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Cast Recasters:', response); // Outputs the cast recasters + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/cast-recasters-v1). */ public async fetchRecasters( castOrCastHash: CastV1 | string, @@ -297,9 +608,31 @@ export class NeynarAPIClient { // ------------ Follows ------------ /** - * Get all users that follow the specified user. - * See [Neynar documentation](https://docs.neynar.com/reference/followers-v1) + * Retrieves all users that follow the specified user. + * + * @param {number} fid - The FID (unique identifier) of the user whose followers are being retrieved. + * @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 maximum number of results to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `FollowResponse` object, + * containing a list of the user's followers. * + * @example + * // Example: Retrieve the first set of followers for a user with FID 12345, limited to 50 + * client.fetchUserFollowers(3, { + * viewerFid: 2, // The FID of the user viewing this information + * limit: 50, // Fetching up to 50 followers + * // cursor: "nextPageCursor", // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('User Followers:', response); // Outputs the user's followers + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/followers-v1). */ public async fetchUserFollowers( fid: number, @@ -309,9 +642,31 @@ export class NeynarAPIClient { } /** - * Get all users the specified user is following. - * See [Neynar documentation](https://docs.neynar.com/reference/following-v1) + * Retrieves all users the specified user is following. + * + * @param {number} fid - The FID (unique identifier) of the user whose following list is being retrieved. + * @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 maximum number of results to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `FollowResponse` object, + * containing a list of users followed by the given user. * + * @example + * // Example: Retrieve the first set of users followed by a user with FID 12345, limited to 50 + * client.fetchUserFollowing(3, { + * viewerFid: 2, // The FID of the user viewing this information + * limit: 50, // Fetching up to 50 users + * // cursor: "nextPageCursor", // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Following Users:', response); // Outputs the list of users followed by the user + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/following-v1). */ public async fetchUserFollowing( fid: number, @@ -325,35 +680,81 @@ export class NeynarAPIClient { // ------------ Signer ------------ /** - * Creates a Signer. - * See [Neynar documentation](https://docs.neynar.com/reference/create-signer) + * Creates a Signer and returns the signer status. + * **Note**: While testing, please reuse the signer, as it costs money to approve a new signer. + * + * @returns {Promise} A promise that resolves to a `Signer` object, + * representing the newly created signer with its status. + * + * @example + * // Example: Create a new signer + * client.createSigner().then(response => { + * console.log('Signer Status:', response); // Outputs the status of the newly created signer + * }); * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/create-signer). */ public async createSigner(): Promise { return await this.clients.v2.createSigner(); } /** - * Fetches an existing Signer. - * See [Neynar documentation](https://docs.neynar.com/reference/signer) + * Retrieves information status of a signer by passing in a signer_uuid * + * @param {string} signerUuid - The unique identifier (UUID) of the signer to be fetched. + * + * @returns {Promise} A promise that resolves to a `Signer` object representing the + * requested signer, or null if no signer is found. + * + * @example + * // Example: Fetch an existing signer using its UUID + * client.lookupSigner('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec').then(response => { + * 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). */ - public async lookupSigner(signerUuid: string): Promise { + public async lookupSigner(signerUuid: string): Promise { return await this.clients.v2.lookupSigner(signerUuid); } /** - * Registers a Signer with an fid. - * See [Neynar documentation](https://docs.neynar.com/reference/register-signed-key) + * Registers an app fid, deadline and a signature. + * + * Easiest way to start is to clone our repo that has sign in w/ Farcaster and writes: + * https://github.com/manan19/example-farcaster-app + * + * Read more about how writes to Farcaster work with Neynar managed signers + * https://docs.neynar.com/docs/write-to-farcaster-with-neynar-managed-signers * + * @param {string} signerUuid - UUID of the signer. + * @param {number} fid - Application FID. + * @param {number} deadline - Unix timestamp in seconds that controls how long the signed key + * request is valid for. A 24-hour duration from now is recommended. + * @param {string} signature - Signature generated by the custody address of the app. + * Signed data includes app_fid, deadline, and signer’s public key. + * + * @returns {Promise} A promise that resolves to a `Signer` object, + * representing the registered signer with its status and approval URL. + * + * @example + * // Example: Register a signer with a specified FID, deadline, and signature + * // Following is an example of how to generate a signer, it may not work. Please fill in the correct values here. + * // Please refer https://github.com/manan19/example-farcaster-app to get started + * + * client.registerSignedKey('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', 18949, 1625097600, '0xe5d95c391e165dac8efea373efe301d3ea823e1f41713f8943713cbe2850566672e33ff3e17e19abb89703f650a2597f62b4fda0ce28ca15d59eb6d4e971ee531b').then(response => { + * console.log('Signer Registration:', response); // Outputs the registration status of the signer + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/register-signed-key). */ - public async registerSigner( + public async registerSignedKey( signerUuid: string, fid: number, deadline: number, signature: string ): Promise { - return await this.clients.v2.registerSigner( + return await this.clients.v2.registerSignedKey( signerUuid, fid, deadline, @@ -365,28 +766,56 @@ export class NeynarAPIClient { /** * Removes verification for an eth address for the user. - * See [Neynar documentation](https://docs.neynar.com/reference/remove-verification) + * (In order to delete verification signer_uuid must be approved) + * + * @param {string} signerUuid - UUID of the signer. + * @param {string} address - Ethereum address for which verification is being removed. + * + * @returns {Promise} A promise that resolves to an `OperationResponse` object, + * indicating the success or failure of the operation. * + * @example + * // Example: Remove verification for a user's Ethereum address + * client.deleteVerification('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', '0x1ea99cbed57e4020314ba3fadd7c692d2de34d5f').then(response => { + * console.log('Verification Removal Status:', response); // Outputs the status of verification removal + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/remove-verification). */ - public async removeVerification( + public async deleteVerification( signerUuid: string, address: string ): Promise { - return await this.clients.v2.removeVerification(signerUuid, address); + return await this.clients.v2.deleteVerification(signerUuid, address); } /** * Adds verification for an eth address for the user - * See [Neynar documentation](https://docs.neynar.com/reference/add-verification) + * (In order to add verification signerUuid must be approved) + * + * @param {string} signerUuid - UUID of the signer. + * @param {string} address - Ethereum address for which verification is being added. + * @param {string} blockHash - Block hash associated with the Ethereum transaction. + * @param {string} ethSignature - Ethereum signature for verification. + * + * @returns {Promise} A promise that resolves to an `OperationResponse` object, + * indicating the success or failure of the operation. * + * @example + * // Example: Add verification for a user's Ethereum address + * client.publishVerification('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', '0x1ea99cbed57e4020314ba3fadd7c692d2de34d5f', '0x191905a9201170abb55f4c90a4cc968b44c1b71cdf3db2764b775c93e7e22b29', '0x2fc09da1f4dcb723fefb91f77932c249c418c0af00c66ed92ee1f35002c80d6a1145280c9f361d207d28447f8f7463366840d3a9309036cf6954afd1fd331beb1b').then(response => { + * console.log('Verification Addition Status:', response); // Outputs the status of verification addition + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/add-verification). */ - public async addVerification( + public async publishVerification( signerUuid: string, address: string, blockHash: string, ethSignature: string ): Promise { - return await this.clients.v2.addVerification( + return await this.clients.v2.publishVerification( signerUuid, address, blockHash, @@ -395,11 +824,24 @@ export class NeynarAPIClient { } /** - * Follow a user. - * See [Neynar documentation](https://docs.neynar.com/reference/follow-user) + * Follows one or more users. This method allows a user, identified by their signer's UUID, + * to follow other users specified by their FIDs. + * (In order to follow a user signerUuid must be approved) + * + * @param {string} signerUuid - UUID of the signer who is following other users. + * @param {Array} targetFids - An array of FIDs representing the users to be followed. + * + * @returns {Promise} A promise that resolves to a `BulkFollowResponse` object, + * indicating the success or failure of the follow operation. * + * @example + * // Example: Follow multiple users + * client.followUser('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', [3, 2, 1]).then(response => { + * console.log('Follow opretation status', response); // Outputs the result of the follow operation + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/follow-user). */ - public async followUser( signerUuid: string, targetFids: number[] @@ -408,9 +850,23 @@ export class NeynarAPIClient { } /** - * Unfollow a user - * See [Neynar documentation](https://docs.neynar.com/reference/unfollow-user) + * Unfollows one or more users. This method enables a user, identified by their signer's UUID, + * to unfollow other users specified by their FIDs. + * (In order to unfollow a user signerUuid must be approved) + * + * @param {string} signerUuid - UUID of the signer who is unfollowing other users. + * @param {Array} targetFids - An array of FIDs representing the users to be unfollowed. * + * @returns {Promise} A promise that resolves to a `BulkFollowResponse` object, + * indicating the success or failure of the unfollow operation. + * + * @example + * // Example: Unfollow multiple users + * client.unfollowUser('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', [3, 2, 1]).then(response => { + * console.log('Unfollow Operation Status:', response); // Outputs the result of the unfollow operation + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/unfollow-user). */ public async unfollowUser( signerUuid: string, @@ -420,38 +876,92 @@ export class NeynarAPIClient { } /** - * Update user profile - * See [Neynar documentation](https://docs.neynar.com/reference/update-user) + * Updates a user's profile. + * (In order to update profile signerUuid must be approved) + * + * @param {string} signerUuid - UUID of the signer associated with the user profile. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {string} [options.bio] - A brief bio or description of the user. + * @param {string} [options.pfpUrl] - URL of the user's profile picture. + * @param {string} [options.url] - Personal URL of the user. + * @param {string} [options.username] - The user's chosen username. + * @param {string} [options.displayName] - The user's display name. * + * @returns {Promise} A promise that resolves to an `OperationResponse` object, + * indicating the success or failure of the update operation. + * + * @example + * // Example: Update a user's profile with bio, profile picture URL, username, and display name + * client.updateUser('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', { + * bio: 'New bio here', + * pfpUrl: 'https://example.com/pfp.jpg', + * username: 'newUsername', + * displayName: 'New Display Name' + * }).then(response => { + * console.log('Profile Update Operation Status:', response); // Outputs the result of the profile update operation + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/update-user). */ - public async updateUserProfile( + public async updateUser( signerUuid: string, options?: { bio?: string; - pfp_url?: string; + pfpUrl?: string; url?: string; username?: string; - display_name?: string; + displayName?: string; } ): Promise { - return await this.clients.v2.updateUserProfile(signerUuid, options); + return await this.clients.v2.updateUser(signerUuid, options); } /** - * Fetches information about multiple users based on FIDs - * See [Neynar documentation](https://docs.neynar.com/reference/user-bulk) + * Retrieves information about one or multiple users based on FIDs. This method allows for retrieving + * details of several users simultaneously, identified by their FIDs, with the option to provide + * information contextual to a specified viewer. + * + * @param {Array} fids - An array of FIDs representing the users whose information is being retrieved. + * @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. + * + * @returns {Promise} A promise that resolves to a `BulkUsersResponse` object, + * containing information about the requested users. + * + * @example + * // Example: Fetch information about multiple users with viewer context + * client.fetchBulkUsers([2, 3], { viewerFid: 19960 }).then(response => { + * console.log('Bulk Users Information:', response); // Outputs information about the specified users + * }); * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/user-bulk). */ - public async fetchUsersInBulk( - fids: string, - viewerFid?: number - ): Promise { - return await this.clients.v2.fetchUsersInBulk(fids, viewerFid); + public async fetchBulkUsers( + fids: number[], + options: { viewerFid?: number } + ): Promise { + return await this.clients.v2.fetchBulkUsers(fids, options); } /** - * Search User - * See [Neynar documentation](https://docs.neynar.com/reference/user-search) + * Searches for users based on a query. This method is used to find users by usernames or other + * identifiable information. The search can be contextualized to the viewer specified by `viewerFid`. + * + * @param {string} q - The query string used for searching users. + * @param {number} viewerFid - The FID of the user performing the search, + * used for providing contextual data specific to the viewer. + * + * @returns {Promise} A promise that resolves to a `UserSearchResponse` object, + * containing the results of the user search. + * + * @example + * // Example: Search for users with a specific query + * client.searchUser('ris', 19960).then(response => { + * console.log('User Search Results:', response); // Outputs the results of the user search + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/user-search). */ public async searchUser( q: string, @@ -461,8 +971,20 @@ export class NeynarAPIClient { } /** - * Lookup User by Custody Address - * See [Neynar documentation](https://docs.neynar.com/reference/lookup-user-by-custody-address) + * Looks up a user by their custody address. + * + * @param {string} custodyAddress - Custody Address associated with mnemonic + * + * @returns {Promise} A promise that resolves to a `UserResponse` object, + * containing information about the user linked to the given custody address. + * + * @example + * // Example: Look up a user by their custody address + * client.lookupUserByCustodyAddress('0xd1b702203b1b3b641a699997746bd4a12d157909').then(response => { + * console.log('User Information:', response); // Outputs the information of the user associated with the custody address + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/lookup-user-by-custody-address). */ public async lookupUserByCustodyAddress( custodyAddress: string @@ -473,9 +995,28 @@ export class NeynarAPIClient { // ------------ Cast ------------ /** - * Gets information about an individual cast by passing in a Warpcast web URL or cast hash - * See [Neynar documentation](https://docs.neynar.com/reference/cast) + * Retrieves information about an individual cast by passing in a Warpcast web URL or cast hash. + * + * @param {string} castHashOrUrl - The identifier for the cast, which can be either a cast hash or a Warpcast web URL. + * @param {CastParamType} type - The parameter type indicating whether the identifier is a hash or a URL. + * + * @returns {Promise} A promise that resolves to a `CastResponse` object, + * containing information about the specified cast. + * + * @example + * import { CastParamType } from "@neynar/nodejs-sdk/build/neynar-api/v2"; * + * // Example: Retrieve information for a cast using its hash + * client.lookUpCastByHashOrWarpcastUrl('0xfe90f9de682273e05b201629ad2338bdcd89b6be', CastParamType.Hash).then(response => { + * console.log('Cast Information:', response); // Outputs information about the cast + * }); + * + * // Example: Retrieve information for a cast using its Warpcast URL + * client.lookUpCastByHashOrWarpcastUrl('https://warpcast.com/rish/0x9288c1', CastParamType.Url).then(response => { + * console.log('Cast Information:', response); // Outputs information about the cast + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/cast). */ public async lookUpCastByHashOrWarpcastUrl( castHashOrUrl: string, @@ -488,19 +1029,54 @@ export class NeynarAPIClient { } /** - * Gets information about an array of casts. - * See [Neynar documentation](https://docs.neynar.com/reference/casts) - * @param casts - Cast hashes (Comma Separated) + * Retrieves information about multiple casts using an array of their hashes. This method is useful + * for fetching details of several casts at once, identified by their unique hashes. + * + * @param {Array} castsHashes - An array of strings representing the hashes of the casts + * to be retrieved. * + * @returns {Promise} A promise that resolves to a `CastsResponse` object, + * containing information about the requested casts. + * + * @example + * // Example: Fetch information about multiple casts using their hashes + * client.fetchBulkCasts(['0xa896906a5e397b4fec247c3ee0e9e4d4990b8004','0x27ff810f7f718afd8c40be236411f017982e0994']).then(response => { + * console.log('Bulk Casts Information:', response); // Outputs information about the specified casts + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/casts). */ - public async fetchBulkCastsByHash(casts: string): Promise { - return await this.clients.v2.fetchBulkCastsByHash(casts); + public async fetchBulkCasts(castsHashes: string[]): Promise { + return await this.clients.v2.fetchBulkCasts(castsHashes); } /** - * Publishes a cast for the currently authenticated user. - * See [Neynar documentation](https://docs.neynar.com/reference/post-cast) + * Publishes a cast for the currently authenticated user. This method allows users to post + * content, including text and embeds, and can also be used to reply to existing casts. + * (In order to publish a cast signerUuid must be approved) + * + * @param {string} signerUuid - UUID of the signer associated with the user posting the cast. + * @param {string} text - The text content of the cast. + * @param {Object} [options] - Optional parameters for the cast. + * @param {Array} [options.embeds] - An array of embeds to be included in the cast. + * @param {string} [options.replyTo] - The URL or hash of the parent cast if this is a reply. * + * @returns {Promise} A promise that resolves to a `PostCastResponseCast` object, + * representing the published cast. + * + * @example + * // Example: Publish a simple cast + * client.publishCast('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', 'Testing publishCast() method').then(response => { + * console.log('Published Cast:', response); // Outputs the published cast + * }); + * // Example: Reply to a Cast + * client.publishCast('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', 'Testing publishCast() method', { + * replyTo: '0x9e95c380791fce11ffbb14b2ea458b233161bafd', + * }).then(response => { + * console.log('Published Cast:', response); // Outputs the published reply cast with embeds + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/post-cast). */ public async publishCast( signerUuid: string, @@ -511,9 +1087,23 @@ export class NeynarAPIClient { } /** - * Delete a cast. - * See [Neynar documentation](https://docs.neynar.com/reference/delete-cast) + * Deletes an existing cast. This method is used to remove a cast, identified by its hash, + * from the system. + * (In order to delete a cast signerUuid must be approved) + * + * @param {string} signerUuid - UUID of the signer associated with the user who is deleting the cast. + * @param {Cast | string} castOrCastHash - The Cast object or its hash that is to be deleted. + * + * @returns {Promise} A promise that resolves to an `OperationResponse` object, + * indicating the success or failure of the deletion operation. + * + * @example + * // Example: Delete a cast using its hash + * client.deleteCast('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', '0x1ea99cbed57e4020314ba3fadd7c692d2de34d5f').then(response => { + * console.log('Cast Deletion:', response); // Outputs the result of the cast deletion operation + * }); * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/delete-cast). */ public async deleteCast( signerUuid: string, @@ -525,38 +1115,78 @@ export class NeynarAPIClient { // ------------ Feed ------------ /** - * Get reverse chronological feed page for a user based on their follow graph. - * See [Neynar documentation](https://docs.neynar.com/reference/feed) + * Retrieves a reverse chronological feed for a user based on their follow graph. + * This method allows users to fetch casts in their feed based on various filters, such as + * following a specific user, a list of users, or content under a specific parent URL. * + * @param {FeedType} feedType - Type of the feed, defaults to 'following' but can be set to 'filter' for specific filtering. + * @param {Object} [options] - Optional parameters for customizing the feed. + * @param {FilterType} [options.filterType] - Used when feedType is 'filter'. Determines the filter criteria (e.g., 'fids' or 'parent_url'). + * @param {number} [options.fid] - FID of the user whose feed is being created. Required unless a 'filterType' is provided. + * @param {Array} [options.fids] - Used for creating a feed based on a list of FIDs. Requires 'feedType' and 'filterType'. + * @param {string} [options.parentUrl] - Used for fetching content under a specific parent URL. Requires 'feedType' and 'filterType'. + * @param {boolean} [options.withRecasts] - Whether to include recasts in the response. True by default. + * @param {number} [options.limit] - The maximum number of users to be returned in the response. + * Defaults to 25, with a maximum allowable value of 100. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `FeedResponse` object, + * containing the requested feed data. + * + * @example + * // Example: Retrieve a user's feed based on their following graph with specific limits + * client.fetchFeed('following', { fid: 3, limit: 50, withRecasts: true }).then(response => { + * console.log('User Feed:', response); // Outputs the user's feed + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/feed). */ - public async fetchFeedPage( + public async fetchFeed( feedType: FeedType, options?: { filterType?: FilterType; fid?: number; - fids?: string; + fids?: number[]; parentUrl?: string; limit?: number; cursor?: string; withRecasts?: boolean; } ): Promise { - return await this.clients.v2.fetchFeedPage(feedType, options); + return await this.clients.v2.fetchFeed(feedType, options); } // ------------ Reaction ------------ /** - * React to a cast. - * See [Neynar documentation](https://docs.neynar.com/reference/post-reaction) + * Posts a reaction (like or recast) to a given cast. + * (In order to post a reaction signerUuid must be approved) + * + * @param {string} signerUuid - UUID of the signer expressing the reaction. + * @param {ReactionType} reaction - The type of reaction being expressed (like or recast). + * @param {Cast | string} castOrCastHash - The Cast object or its hash to which the reaction is targeted. + * + * @returns {Promise} A promise that resolves to an `OperationResponse` object, + * indicating the success or failure of the reaction post. + * + * @example * + * import { ReactionType } from "@neynar/nodejs-sdk/build/neynar-api/v2"; + * + * // Example: Post a 'like' reaction to a cast + * client.publishReactionToCast('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', ReactionType.Like, '0x1ea99cbed57e4020314ba3fadd7c692d2de34d5f').then(response => { + * console.log('Publish Reaction Operation Status:', response); // Outputs the status of the reaction post + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/post-reaction). */ - public async reactToCast( + public async publishReactionToCast( signerUuid: string, reaction: ReactionType, castOrCastHash: Cast | string ): Promise { - return await this.clients.v2.reactToCast( + return await this.clients.v2.publishReactionToCast( signerUuid, reaction, castOrCastHash @@ -564,26 +1194,102 @@ export class NeynarAPIClient { } /** - * Remove a reaction to a cast. See [Neynar documentation](https://docs.neynar.com/reference/delete-reaction) + * Removes a reaction (like or recast) from a given cast. + * (In order to delete a reaction signerUuid must be approved) + * + * @param {string} signerUuid - UUID of the signer who is removing the reaction. + * @param {ReactionType} reaction - The type of reaction being removed. + * @param {Cast | string} castOrCastHash - The Cast object or its hash from which the reaction is to be removed. + * + * @returns {Promise} A promise that resolves to an `OperationResponse` object, + * indicating the success or failure of the reaction removal. + * + * @example + * + * import { ReactionType } from "@neynar/nodejs-sdk/build/neynar-api/v2"; + * + * // Example: Remove a 'like' reaction from a cast + * client.deleteReactionFromCast('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', ReactionType.Like, '0x1ea99cbed57e4020314ba3fadd7c692d2de34d5f').then(response => { + * console.log('Delete Reaction Operation Status:', response); // Outputs the status of the reaction removal operation + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/delete-reaction). */ - public async removeReactionFromCast( + public async deleteReactionFromCast( signerUuid: string, reaction: ReactionType, castOrCastHash: Cast | string ): Promise { - return await this.clients.v2.removeReactionFromCast( + return await this.clients.v2.deleteReactionFromCast( signerUuid, reaction, castOrCastHash ); } + /** + * Fetches reactions (likes, recasts, or all) for a given user. This method allows retrieving + * the reactions associated with a user's casts, specified by the user's FID. + * + * @param {number} fid - The FID of the user whose reactions are being fetched. + * @param {ReactionsType} type - The type of reaction to fetch (likes, recasts, or all). + * @param {Object} [options] - Optional parameters for customizing the response. + * @param {number} [options.limit] - The maximum number of users to be returned in the response. + * Defaults to 25, with a maximum allowable value of 100. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `ReactionsResponse` object, + * containing the reactions associated with the user's casts. + * + * @example + * + * import { ReactionsType } from "@neynar/nodejs-sdk/build/neynar-api/v2"; + * + * // Example: Fetch a user's reactions + * client.fetchUserReactions(3, ReactionsType.All, { + * limit: 50, + * // cursor: "nextPageCursor" // Omit this parameter for the initial request + * }).then(response => { + * console.log('User Reactions:', response); // Outputs the user's reactions + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/reactions-user). + */ + public async fetchUserReactions( + fid: number, + type: ReactionsType, + options?: { limit?: number; cursor?: string } + ): Promise { + return await this.clients.v2.fetchUserReactions(fid, type, options); + } + // ------------ Notifications ------------ /** - * Returns a list of notifications for a specific FID in reverse chronological order. - * See [Neynar documentation](https://docs.neynar.com/reference/notifications) + * Retrieves a list of notifications for a specific FID in reverse chronological order. + * This method is useful for obtaining a user's notifications, keeping them updated on various interactions and updates. + * + * @param {number} fid - The FID of the user whose notifications are being fetched. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {number} [options.limit] - The maximum number of users to be returned in the response. + * Defaults to 25, with a maximum allowable value of 50. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. * + * @returns {Promise} A promise that resolves to a `NotificationsResponse` object, + * containing the user's notifications. + * + * @example + * // Example: Fetch the first 30 notifications for a user + * client.fetchAllNotifications(3, { + * limit: 30, + * // cursor: "nextPageCursor" // Omit this parameter for the initial request + * }).then(response => { + * console.log('User Notifications:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/notifications). */ public async fetchAllNotifications( fid: number, @@ -595,33 +1301,172 @@ export class NeynarAPIClient { // ------------ Follows ------------ /** - * Returns a list of relevant followers for a specific FID. - * See [Neynar documentation](https://docs.neynar.com/reference/relevant-followers) + * Retrieves a list of relevant followers for a specific FID. + * + * @param {number} targetFid - The FID of the user whose relevant followers are being fetched. + * @param {number} viewerFid - The FID of the viewer who is looking at the target user's profile. * + * @returns {Promise} A promise that resolves to a `RelevantFollowersResponse` object, + * containing a list of relevant followers for the specified user. + * + * @example + * // Example: Retrieve relevant followers for a user from the perspective of another user + * client.fetchRelevantFollowers(3, 19960).then(response => { + * console.log('Relevant Followers:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/relevant-followers). */ - public async fetchRelaventFollowers( + public async fetchRelevantFollowers( targetFid: number, viewerFid: number ): Promise { - return await this.clients.v2.fetchRelaventFollowers(targetFid, viewerFid); + return await this.clients.v2.fetchRelevantFollowers(targetFid, viewerFid); + } + + // ------------ Storage ------------ + + /** + * Retrieves storage allocations for a given user. + * + * @param {number} fid - The FID of the user whose storage allocations are being retrieved. + * + * @returns {Promise} A promise that resolves to a `StorageAllocationsResponse` object, + * containing information about the user's storage allocations. + * + * @example + * // Example: Retrieve storage allocations for a user + * client.lookupUserStorageAllocations(3).then(response => { + * console.log('User Storage Allocations:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/storage-allocations). + */ + public async lookupUserStorageAllocations( + fid: number + ): Promise { + return await this.clients.v2.lookupUserStorageAllocations(fid); + } + + /** + * Retrieves storage usage for a given user. + * + * @param {number} fid - The FID of the user whose storage usage is being queried. + * + * @returns {Promise} A promise that resolves to a `StorageUsageResponse` object, + * containing details about the user's storage usage. + * + * @example + * // Example: Retrieve storage usage for a user + * client.lookupUserStorageUsage(3).then(response => { + * console.log('User Storage Usage:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/storage-usage). + */ + public async lookupUserStorageUsage( + fid: number + ): Promise { + return await this.clients.v2.lookupUserStorageUsage(fid); } // ------------ Recommendation ------------ /** - * Fetches all mint actions relevant for a contract address (and optionally tokenId for ERC1155s) given a user's ethereum address - * See [Neynar documentation](https://docs.neynar.com/reference/fetch-relevant-mints) + * Fetches all mint actions relevant for a given contract address and user's Ethereum address, + * with an optional focus on a specific tokenId for ERC1155 contracts. This method is useful for + * tracking NFT minting activities linked to specific contracts and user addresses. + * + * @param {string} address - The Ethereum address of the user. + * @param {string} contractAddress - The contract address associated with the NFTs. + * @param {Object} [options] - Optional parameters for the request. + * @param {string} [options.tokenId] - (Optional) The tokenId, particularly for ERC1155 contract types. + * + * @returns {Promise} A promise that resolves to a `RelevantMints` object, + * containing information about mint actions relevant to the user and contract. * + * @example + * // Example: Fetch mint actions for a contract address with a specific tokenId + * client.fetchRelevantMints('0x5a927ac639636e534b678e81768ca19e2c6280b7', '0xe8e0e543a3dd32d366cb756fa4d112f30172bcb1', { tokenId: '1' }).then(response => { + * console.log('Relevant Mint Actions:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/fetch-relevant-mints). */ public async fetchRelevantMints( address: string, contractAddress: string, - tokenId?: string - ): Promise { + options?: { tokenId?: string } + ): Promise { return await this.clients.v2.fetchRelevantMints( address, contractAddress, - tokenId + options ); } + + // ------------ Additional utility methods ------------ + + /** + * Creates a signer and registers a signed key for the signer. + * It returns a Signer which includes `signer_approval_url` that can be used to create a QR Code for the user to scan and approve the signer. + * + * @param {string} farcasterDeveloperMnemonic - mnemonic of the farcaster developer account + * @param {Object} [options] - Optional parameters for the request. + * @param {number} [options.deadline] - (Optional) Unix timestamp in seconds that controls how long the signed key + * request is valid for. A 24-hour duration from now is recommended. + * + * @returns {Promise} A promise that resolves to a `Signer` object, + * that includes signer_approval_url. + * + * @example + * // Example: Create a signer and register a signed key + * const mnemonic = 'farcaster developer mnemonic'; + * client.createSignerAndRegisterSignedKey(mnemonic, { deadline: 1693927665 }).then(response => { + * console.log('Signer', response); + * }); + */ + public async createSignerAndRegisterSignedKey( + farcasterDeveloperMnemonic: string, + options?: { deadline?: number } + ) { + try { + const { public_key: signerPublicKey, signer_uuid } = + await this.createSigner(); + + const account = mnemonicToAccount(farcasterDeveloperMnemonic); + const { user: farcasterDeveloper } = + await this.lookupUserByCustodyAddress(account.address); + + // Generates an expiration date for the signature + // e.g. 1693927665 + const signed_key_deadline = + options?.deadline ?? Math.floor(Date.now() / 1000) + 86400; // signature is valid for 1 day from now + + let signature = await account.signTypedData({ + domain: SIGNED_KEY_REQUEST_VALIDATOR_EIP_712_DOMAIN, + types: { + SignedKeyRequest: SIGNED_KEY_REQUEST_TYPE, + }, + primaryType: "SignedKeyRequest", + message: { + requestFid: BigInt(farcasterDeveloper.fid), + key: signerPublicKey, + deadline: BigInt(signed_key_deadline), + }, + }); + + let signer_pending = await this.registerSignedKey( + signer_uuid, + farcasterDeveloper.fid, + signed_key_deadline, + signature + ); + return signer_pending; + } catch (err) { + if (isApiErrorResponse(err)) { + console.log(err.response.data); + } else console.log(err); + } + } } diff --git a/src/neynar-api/neynar-v1-api/index.ts b/src/neynar-api/neynar-v1-api/index.ts deleted file mode 100644 index f21e8894..00000000 --- a/src/neynar-api/neynar-v1-api/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './openapi' -export * from './neynar-api-v1-client' \ No newline at end of file diff --git a/src/neynar-api/neynar-v1-api/neynar-api-v1-client.ts b/src/neynar-api/neynar-v1-api/neynar-api-v1-client.ts deleted file mode 100644 index 45972474..00000000 --- a/src/neynar-api/neynar-v1-api/neynar-api-v1-client.ts +++ /dev/null @@ -1,463 +0,0 @@ -import { - Cast, - User, - CastApi, - UserApi, - VerificationApi, - NotificationsApi, - ReactionsApi, - FollowsApi, - Configuration, - ErrorRes, - VerificationResponseResult, - RecentUsersResponse, - RecentCastsResponse, - UserCastLikeResponse, - CastsResponse, - MentionsAndRepliesResponse, - ReactionsAndRecastsResponse, - CastLikesResponse, - CastReactionsResponse, - CastRecasterResponse, - FollowResponse, - User200Response, -} from "./openapi"; -import axios, { AxiosError, AxiosInstance } from "axios"; -import { silentLogger, Logger } from "../common/logger"; -import type { SetRequired } from "type-fest"; - -const BASE_PATH = "https://api.neynar.com/v1"; - -export class NeynarV1APIClient { - private readonly logger: Logger; - - public readonly apis: { - user: UserApi; - cast: CastApi; - follows: FollowsApi; - verification: VerificationApi; - notifications: NotificationsApi; - reactions: ReactionsApi; - }; - - /** - * Instantiates a NeynarV1APIClient - * - * Note: A Wallet must be provided if the API client is to mint new AuthTokens - */ - constructor( - apiKey: string, - { - basePath, - logger = silentLogger, - axiosInstance, - }: { - basePath?: string; - logger?: Logger; - axiosInstance?: AxiosInstance; - } = {} - ) { - this.logger = logger; - - if (apiKey === "") { - throw new Error( - "Attempt to use an authenticated API method without first providing an api key" - ); - } - - if (axiosInstance === undefined) { - axiosInstance = axios.create(); - } - axiosInstance.defaults.decompress = true; - axiosInstance.interceptors.response.use( - (response) => response, - (error) => { - if (NeynarV1APIClient.isApiErrorResponse(error)) { - const apiErrors = error.response.data; - this.logger.warn(`API errors: ${JSON.stringify(apiErrors)}`); - } - throw error; - } - ); - - const config: Configuration = new Configuration({ - basePath: basePath ? `${basePath}/v1` : BASE_PATH, - apiKey: apiKey, - }); - - this.apis = { - user: new UserApi(config, undefined, axiosInstance), - cast: new CastApi(config, undefined, axiosInstance), - follows: new FollowsApi(config, undefined, axiosInstance), - verification: new VerificationApi(config, undefined, axiosInstance), - notifications: new NotificationsApi(config, undefined, axiosInstance), - reactions: new ReactionsApi(config, undefined, axiosInstance), - }; - } - - /** - * Utility for parsing errors returned by the Neynar API servers. Returns true - * if the given error is caused by an error response from the server, and - * narrows the type of `error` accordingly. - */ - public static isApiErrorResponse( - // eslint-disable-next-line @typescript-eslint/no-explicit-any - error: any - ): error is SetRequired, "response"> { - if (!(error instanceof AxiosError)) return false; - return ( - error.response?.data !== undefined && "message" in error.response.data - ); - } - - // ------------ User ------------ - - /** - * A list of users in reverse chronological order based on sign up. - * See [Neynar documentation](https://docs.neynar.com/reference/recent-users-v1) - * - */ - public async fetchRecentUsers(options?: { - viewerFid?: number; - limit?: number; - cursor?: string; - }): Promise { - const response = await this.apis.user.recentUsers({ - viewerFid: options?.viewerFid, - cursor: options?.cursor, - limit: options?.limit, - }); - - return response.data; - } - - /** - * Fetch all likes by a given user. - * See [Neynar documentation](https://docs.neynar.com/reference/user-cast-likes-v1) - * - */ - public async fetchAllCastsLikedByUser( - fid: number, - options?: { viewerFid?: number; limit?: number; cursor?: string } - ): Promise { - const response = await this.apis.user.userCastLikes({ - fid: fid, - viewerFid: options?.viewerFid, - limit: options?.limit, - cursor: options?.cursor, - }); - - return response.data; - } - - /** - * Gets the specified user via their FID (if found). - * See [Neynar documentation](https://docs.neynar.com/reference/user-v1) - * - */ - public async lookupUserByFid( - fid: number, - viewerFid?: number - ): Promise { - const response = await this.apis.user.user({ fid, viewerFid }); - return response.data; - } - - /** - * Gets the specified user via their username (if found). - * See [Neynar documentation](https://docs.neynar.com/reference/user-by-username-v1) - * - */ - public async lookupUserByUsername( - username: string, - viewerFid?: number - ): Promise { - const response = await this.apis.user.userByUsername({ - username, - viewerFid, - }); - // result.user is undefined if not found - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - return response.data.result.user ?? null; - } - - /** - * Gets the custody address for the specified user via their username (if found). - * See [Neynar documentation](https://docs.neynar.com/reference/custody-address-v1) - * - */ - public async fetchCustodyAddressForUser(fid: number): Promise { - const response = await this.apis.user.custodyAddress({ fid }); - return response.data.result.custodyAddress; - } - - // ------------ Cast ------------ - - /** - * Fetches a single cast by its hash. - * See [Neynar documentation](https://docs.neynar.com/reference/cast-v1) - * - */ - public async lookUpCastByHash( - hash: string, - options?: { viewerFid?: number } - ): Promise { - const response = await this.apis.cast.cast({ - hash, - viewerFid: options?.viewerFid, - }); - return response.data.result.cast; - } - - /** - * Gets all casts, including root cast and all replies for a given thread hash. No limit the depth of replies. - * See [Neynar documentation](https://docs.neynar.com/reference/all-casts-in-thread-v1) - * Note that the parent provided by the caller is included in the response. - * - */ - public async fetchAllCastsInThread( - threadParent: Cast | { hash: string }, - viewerFid?: number - ): Promise { - const response = await this.apis.cast.allCastsInThread({ - threadHash: threadParent.hash, - viewerFid: viewerFid, - }); - return response.data.result.casts; - } - - /** - * Gets all casts (including replies and recasts) created by the specified user. - * See [Neynar documentation](https://docs.neynar.com/reference/casts-v1) - * - */ - public async fetchAllCastsCreatedByUser( - fid: number, - options?: { - parentUrl?: string; - viewerFid?: number; - limit?: number; - cursor?: string; - } - ): Promise { - const response = await this.apis.cast.casts({ - fid: fid, - viewerFid: options?.viewerFid, - parentUrl: options?.parentUrl, - cursor: options?.cursor, - limit: options?.limit, - }); - - return response.data; - } - - /** - * Gets recent casts created by the specified user. - * See [Neynar documentation](https://docs.neynar.com/reference/recent-casts-v1) - * - */ - public async fetchRecentCasts(options?: { - viewerFid?: number; - limit?: number; - cursor?: string; - }): Promise { - const response = await this.apis.cast.recentCasts({ - viewerFid: options?.viewerFid, - cursor: options?.cursor, - limit: options?.limit, - }); - - return response.data; - } - - // ------------ Verification ------------ - - /** - * Gets all known verifications of a user. - * See [Neynar documentation](https://docs.neynar.com/reference/verifications-v1) - * - */ - public async fetchUserVerifications( - fid: number - ): Promise { - const response = await this.apis.verification.verifications({ fid }); - return response.data.result; - } - - /** - * Checks if a given Ethereum address has a Farcaster user associated with it. - * Note: if an address is associated with multiple users, the API will return - * the user who most recently published a verification with the address - * (based on when Warpcast received the proof, not a self-reported timestamp). - * See [Neynar documentation](https://docs.neynar.com/reference/user-by-verification-v1) - * - */ - public async lookupUserByVerification( - address: string - ): Promise { - const response = await this.apis.verification.userByVerification({ - address, - }); - return response.data; - } - - // ------------ Notifications ------------ - - /** - * Gets a list of mentions and replies to the user’s casts in reverse chronological order. - * See [Neynar documentation](https://docs.neynar.com/reference/mentions-and-replies-v1) - * - */ - public async fetchMentionAndReplyNotifications( - fid: number, - options?: { viewerFid?: number; limit?: number; cursor?: string } - ): Promise { - const response = await this.apis.notifications.mentionsAndReplies({ - fid: fid, - viewerFid: options?.viewerFid, - cursor: options?.cursor, - limit: options?.limit, - }); - - return response.data; - } - - /** - * Get a list of likes and recasts to the users’s casts in reverse chronological order. - * See [Neynar documentation](https://docs.neynar.com/reference/reactions-and-recasts-v1) - * - */ - public async fetchUserLikesAndRecasts( - fid: number, - options?: { viewerFid?: number; limit?: number; cursor?: string } - ): Promise { - const response = await this.apis.notifications.reactionsAndRecasts({ - fid: fid, - viewerFid: options?.viewerFid, - cursor: options?.cursor, - limit: options?.limit, - }); - - return response.data; - } - - // ------------ Reactions ------------ - - /** - * Lists a given cast's likes. - * See [Neynar documentation](https://docs.neynar.com/reference/cast-likes-v1) - * - */ - public async fetchCastLikes( - castOrCastHash: Cast | string, - options?: { viewerFid?: number; limit?: number; cursor?: string } - ): Promise { - let castHash: string; - if (typeof castOrCastHash === "string") { - castHash = castOrCastHash; - } else { - castHash = castOrCastHash.hash; - } - - const response = await this.apis.reactions.castLikes({ - castHash: castHash, - viewerFid: options?.viewerFid, - cursor: options?.cursor, - limit: options?.limit, - }); - - return response.data; - } - - /** - * Get All Reactions For a Cast. - * See [Neynar documentation](https://docs.neynar.com/reference/cast-reactions-v1) - * - */ - public async fetchCastReactions( - castOrCastHash: Cast | string, - options?: { viewerFid?: number; limit?: number; cursor?: string } - ): Promise { - let castHash: string; - if (typeof castOrCastHash === "string") { - castHash = castOrCastHash; - } else { - castHash = castOrCastHash.hash; - } - - const response = await this.apis.reactions.castReactions({ - castHash: castHash, - viewerFid: options?.viewerFid, - cursor: options?.cursor, - limit: options?.limit, - }); - - return response.data; - } - - /** - * Get the list of users who have recasted a specific cast. - * See [Neynar documentation](https://docs.neynar.com/reference/cast-recasters-v1) - * - */ - public async fetchRecasters( - castOrCastHash: Cast | string, - options?: { viewerFid?: number; limit?: number; cursor?: string } - ): Promise { - let castHash: string; - if (typeof castOrCastHash === "string") { - castHash = castOrCastHash; - } else { - castHash = castOrCastHash.hash; - } - - const response = await this.apis.reactions.castRecasters({ - castHash: castHash, - viewerFid: options?.viewerFid, - cursor: options?.cursor, - limit: options?.limit, - }); - - return response.data; - } - - // ------------ Follows ------------ - - /** - * Get all users that follow the specified user. - * See [Neynar documentation](https://docs.neynar.com/reference/followers-v1) - * - */ - public async fetchUserFollowers( - fid: number, - options?: { viewerFid?: number; limit?: number; cursor?: string } - ): Promise { - const response = await this.apis.follows.followers({ - fid, - viewerFid: options?.viewerFid, - cursor: options?.cursor, - limit: options?.limit, - }); - - return response.data; - } - - /** - * Get all users the specified user is following. - * See [Neynar documentation](https://docs.neynar.com/reference/following-v1) - * - */ - public async fetchUserFollowing( - fid: number, - options?: { viewerFid?: number; limit?: number; cursor?: string } - ): Promise { - const response = await this.apis.follows.following({ - fid, - viewerFid: options?.viewerFid, - cursor: options?.cursor, - limit: options?.limit, - }); - - return response.data; - } -} diff --git a/src/neynar-api/neynar-v1-api/openapi/apis/cast-api.ts b/src/neynar-api/neynar-v1-api/openapi/apis/cast-api.ts deleted file mode 100644 index 74b3994c..00000000 --- a/src/neynar-api/neynar-v1-api/openapi/apis/cast-api.ts +++ /dev/null @@ -1,752 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Farcaster API V1 - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import type { Configuration } from "../configuration"; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios"; -import globalAxios from "axios"; -// Some imports not used depending on template conditions -// @ts-ignore -import { - DUMMY_BASE_URL, - assertParamExists, - setApiKeyToObject, - setBasicAuthToObject, - setBearerAuthToObject, - setOAuthToObject, - setSearchParams, - serializeDataIfNeeded, - toPathString, - createRequestFunction, -} from "../common"; -// @ts-ignore -import { - BASE_PATH, - COLLECTION_FORMATS, - RequestArgs, - BaseAPI, - RequiredError, -} from "../base"; -// @ts-ignore -import { AllCastsInThreadResponse } from "../models"; -// @ts-ignore -import { CastResponse } from "../models"; -// @ts-ignore -import { CastsResponse } from "../models"; -// @ts-ignore -import { ErrorRes } from "../models"; -// @ts-ignore -import { RecentCastsResponse } from "../models"; -/** - * CastApi - axios parameter creator - * @export - */ -export const CastApiAxiosParamCreator = function ( - configuration?: Configuration -) { - return { - /** - * Gets all casts, including root cast and all replies for a given thread hash. No limit the depth of replies. - * @summary Retrieve all casts in a given thread hash - * @param {string} threadHash The hash of the thread to retrieve casts from. - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - allCastsInThread: async ( - threadHash: string, - viewerFid?: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'threadHash' is not null or undefined - assertParamExists("allCastsInThread", "threadHash", threadHash); - const localVarPath = `/farcaster/all-casts-in-thread`; - // 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, - "api_key", - configuration - ); - - if (threadHash !== undefined) { - localVarQueryParameter["threadHash"] = threadHash; - } - - if (viewerFid !== undefined) { - localVarQueryParameter["viewerFid"] = viewerFid; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Gets information about an individual cast - * @summary Retrieve cast for a given hash - * @param {string} hash Cast hash - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - cast: async ( - hash: string, - viewerFid?: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'hash' is not null or undefined - assertParamExists("cast", "hash", hash); - 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; - 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, - "api_key", - configuration - ); - - if (hash !== undefined) { - localVarQueryParameter["hash"] = hash; - } - - if (viewerFid !== undefined) { - localVarQueryParameter["viewerFid"] = viewerFid; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Gets the most recent casts for a user - * @summary Retrieve casts for a given user - * @param {number} fid fid of a user - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [parentUrl] A cast can be part of a certain channel. The channel is identified by `parent_url`. All casts in the channel ladder up to the same parent_url. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 150) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - casts: async ( - fid: number, - viewerFid?: number, - parentUrl?: string, - cursor?: string, - limit?: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'fid' is not null or undefined - assertParamExists("casts", "fid", fid); - 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; - 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, - "api_key", - configuration - ); - - if (fid !== undefined) { - localVarQueryParameter["fid"] = fid; - } - - if (viewerFid !== undefined) { - localVarQueryParameter["viewerFid"] = viewerFid; - } - - if (parentUrl !== undefined) { - localVarQueryParameter["parent_url"] = parentUrl; - } - - if (cursor !== undefined) { - localVarQueryParameter["cursor"] = cursor; - } - - if (limit !== undefined) { - localVarQueryParameter["limit"] = limit; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Get a list of casts from the protocol in reverse chronological order based on timestamp - * @summary Get Recent Casts - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 100) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - recentCasts: async ( - viewerFid?: number, - cursor?: string, - limit?: number, - options: AxiosRequestConfig = {} - ): Promise => { - const localVarPath = `/farcaster/recent-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, - "api_key", - configuration - ); - - if (viewerFid !== undefined) { - localVarQueryParameter["viewerFid"] = viewerFid; - } - - if (cursor !== undefined) { - localVarQueryParameter["cursor"] = cursor; - } - - if (limit !== undefined) { - localVarQueryParameter["limit"] = limit; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; -}; - -/** - * CastApi - functional programming interface - * @export - */ -export const CastApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = CastApiAxiosParamCreator(configuration); - return { - /** - * Gets all casts, including root cast and all replies for a given thread hash. No limit the depth of replies. - * @summary Retrieve all casts in a given thread hash - * @param {string} threadHash The hash of the thread to retrieve casts from. - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async allCastsInThread( - threadHash: string, - viewerFid?: number, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.allCastsInThread( - threadHash, - viewerFid, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Gets information about an individual cast - * @summary Retrieve cast for a given hash - * @param {string} hash Cast hash - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async cast( - hash: string, - viewerFid?: number, - options?: AxiosRequestConfig - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.cast( - hash, - viewerFid, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Gets the most recent casts for a user - * @summary Retrieve casts for a given user - * @param {number} fid fid of a user - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [parentUrl] A cast can be part of a certain channel. The channel is identified by `parent_url`. All casts in the channel ladder up to the same parent_url. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 150) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async casts( - fid: number, - viewerFid?: number, - parentUrl?: string, - cursor?: string, - limit?: number, - options?: AxiosRequestConfig - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.casts( - fid, - viewerFid, - parentUrl, - cursor, - limit, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Get a list of casts from the protocol in reverse chronological order based on timestamp - * @summary Get Recent Casts - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 100) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async recentCasts( - viewerFid?: number, - cursor?: string, - limit?: number, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.recentCasts( - viewerFid, - cursor, - limit, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - }; -}; - -/** - * CastApi - factory interface - * @export - */ -export const CastApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance -) { - const localVarFp = CastApiFp(configuration); - return { - /** - * Gets all casts, including root cast and all replies for a given thread hash. No limit the depth of replies. - * @summary Retrieve all casts in a given thread hash - * @param {CastApiAllCastsInThreadRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - allCastsInThread( - requestParameters: CastApiAllCastsInThreadRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .allCastsInThread( - requestParameters.threadHash, - requestParameters.viewerFid, - options - ) - .then((request) => request(axios, basePath)); - }, - /** - * Gets information about an individual cast - * @summary Retrieve cast for a given hash - * @param {CastApiCastRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - cast( - requestParameters: CastApiCastRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .cast(requestParameters.hash, requestParameters.viewerFid, options) - .then((request) => request(axios, basePath)); - }, - /** - * Gets the most recent casts for a user - * @summary Retrieve casts for a given user - * @param {CastApiCastsRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - casts( - requestParameters: CastApiCastsRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .casts( - requestParameters.fid, - requestParameters.viewerFid, - requestParameters.parentUrl, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(axios, basePath)); - }, - /** - * Get a list of casts from the protocol in reverse chronological order based on timestamp - * @summary Get Recent Casts - * @param {CastApiRecentCastsRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - recentCasts( - requestParameters: CastApiRecentCastsRequest = {}, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .recentCasts( - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * Request parameters for allCastsInThread operation in CastApi. - * @export - * @interface CastApiAllCastsInThreadRequest - */ -export interface CastApiAllCastsInThreadRequest { - /** - * The hash of the thread to retrieve casts from. - * @type {string} - * @memberof CastApiAllCastsInThread - */ - readonly threadHash: string; - - /** - * fid of the user viewing this information, needed for contextual information. - * @type {number} - * @memberof CastApiAllCastsInThread - */ - readonly viewerFid?: number; -} - -/** - * Request parameters for cast operation in CastApi. - * @export - * @interface CastApiCastRequest - */ -export interface CastApiCastRequest { - /** - * Cast hash - * @type {string} - * @memberof CastApiCast - */ - readonly hash: string; - - /** - * fid of the user viewing this information, needed for contextual information. - * @type {number} - * @memberof CastApiCast - */ - readonly viewerFid?: number; -} - -/** - * Request parameters for casts operation in CastApi. - * @export - * @interface CastApiCastsRequest - */ -export interface CastApiCastsRequest { - /** - * fid of a user - * @type {number} - * @memberof CastApiCasts - */ - readonly fid: number; - - /** - * fid of the user viewing this information, needed for contextual information. - * @type {number} - * @memberof CastApiCasts - */ - readonly viewerFid?: number; - - /** - * A cast can be part of a certain channel. The channel is identified by `parent_url`. All casts in the channel ladder up to the same parent_url. - * @type {string} - * @memberof CastApiCasts - */ - readonly parentUrl?: string; - - /** - * Pagination cursor. - * @type {string} - * @memberof CastApiCasts - */ - readonly cursor?: string; - - /** - * Number of results to retrieve (default 25, max 150) - * @type {number} - * @memberof CastApiCasts - */ - readonly limit?: number; -} - -/** - * Request parameters for recentCasts operation in CastApi. - * @export - * @interface CastApiRecentCastsRequest - */ -export interface CastApiRecentCastsRequest { - /** - * fid of the user viewing this information, needed for contextual information. - * @type {number} - * @memberof CastApiRecentCasts - */ - readonly viewerFid?: number; - - /** - * Pagination cursor. - * @type {string} - * @memberof CastApiRecentCasts - */ - readonly cursor?: string; - - /** - * Number of results to retrieve (default 25, max 100) - * @type {number} - * @memberof CastApiRecentCasts - */ - readonly limit?: number; -} - -/** - * CastApi - object-oriented interface - * @export - * @class CastApi - * @extends {BaseAPI} - */ -export class CastApi extends BaseAPI { - /** - * Gets all casts, including root cast and all replies for a given thread hash. No limit the depth of replies. - * @summary Retrieve all casts in a given thread hash - * @param {CastApiAllCastsInThreadRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof CastApi - */ - public allCastsInThread( - requestParameters: CastApiAllCastsInThreadRequest, - options?: AxiosRequestConfig - ) { - return CastApiFp(this.configuration) - .allCastsInThread( - requestParameters.threadHash, - requestParameters.viewerFid, - options - ) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Gets information about an individual cast - * @summary Retrieve cast for a given hash - * @param {CastApiCastRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof CastApi - */ - public cast( - requestParameters: CastApiCastRequest, - options?: AxiosRequestConfig - ) { - return CastApiFp(this.configuration) - .cast(requestParameters.hash, requestParameters.viewerFid, options) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Gets the most recent casts for a user - * @summary Retrieve casts for a given user - * @param {CastApiCastsRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof CastApi - */ - public casts( - requestParameters: CastApiCastsRequest, - options?: AxiosRequestConfig - ) { - return CastApiFp(this.configuration) - .casts( - requestParameters.fid, - requestParameters.viewerFid, - requestParameters.parentUrl, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Get a list of casts from the protocol in reverse chronological order based on timestamp - * @summary Get Recent Casts - * @param {CastApiRecentCastsRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof CastApi - */ - public recentCasts( - requestParameters: CastApiRecentCastsRequest = {}, - options?: AxiosRequestConfig - ) { - return CastApiFp(this.configuration) - .recentCasts( - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(this.axios, this.basePath)); - } -} diff --git a/src/neynar-api/neynar-v1-api/openapi/apis/follows-api.ts b/src/neynar-api/neynar-v1-api/openapi/apis/follows-api.ts deleted file mode 100644 index 2ce16342..00000000 --- a/src/neynar-api/neynar-v1-api/openapi/apis/follows-api.ts +++ /dev/null @@ -1,453 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Farcaster API V1 - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import type { Configuration } from "../configuration"; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios"; -import globalAxios from "axios"; -// Some imports not used depending on template conditions -// @ts-ignore -import { - DUMMY_BASE_URL, - assertParamExists, - setApiKeyToObject, - setBasicAuthToObject, - setBearerAuthToObject, - setOAuthToObject, - setSearchParams, - serializeDataIfNeeded, - toPathString, - createRequestFunction, -} from "../common"; -// @ts-ignore -import { - BASE_PATH, - COLLECTION_FORMATS, - RequestArgs, - BaseAPI, - RequiredError, -} from "../base"; -// @ts-ignore -import { ErrorRes } from "../models"; -// @ts-ignore -import { FollowResponse } from "../models"; -/** - * FollowsApi - axios parameter creator - * @export - */ -export const FollowsApiAxiosParamCreator = function ( - configuration?: Configuration -) { - return { - /** - * Gets a list of users who follow a given user in reverse chronological order. - * @summary Gets all followers for a given FID - * @param {number} fid FID of the user - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 150) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - followers: async ( - fid: number, - viewerFid?: number, - cursor?: string, - limit?: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'fid' is not null or undefined - assertParamExists("followers", "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; - 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, - "api_key", - configuration - ); - - if (fid !== undefined) { - localVarQueryParameter["fid"] = fid; - } - - if (viewerFid !== undefined) { - localVarQueryParameter["viewerFid"] = viewerFid; - } - - if (cursor !== undefined) { - localVarQueryParameter["cursor"] = cursor; - } - - if (limit !== undefined) { - localVarQueryParameter["limit"] = limit; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Gets a list of users who is following a given user in reverse chronological order. - * @summary Gets all following users of a FID - * @param {number} fid FID of the user - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 150) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - following: async ( - fid: number, - viewerFid?: number, - cursor?: string, - limit?: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'fid' is not null or undefined - assertParamExists("following", "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; - 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, - "api_key", - configuration - ); - - if (fid !== undefined) { - localVarQueryParameter["fid"] = fid; - } - - if (viewerFid !== undefined) { - localVarQueryParameter["viewerFid"] = viewerFid; - } - - if (cursor !== undefined) { - localVarQueryParameter["cursor"] = cursor; - } - - if (limit !== undefined) { - localVarQueryParameter["limit"] = limit; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; -}; - -/** - * FollowsApi - functional programming interface - * @export - */ -export const FollowsApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = FollowsApiAxiosParamCreator(configuration); - return { - /** - * Gets a list of users who follow a given user in reverse chronological order. - * @summary Gets all followers for a given FID - * @param {number} fid FID of the user - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 150) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async followers( - fid: number, - viewerFid?: number, - cursor?: string, - limit?: number, - options?: AxiosRequestConfig - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.followers( - fid, - viewerFid, - cursor, - limit, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Gets a list of users who is following a given user in reverse chronological order. - * @summary Gets all following users of a FID - * @param {number} fid FID of the user - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 150) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async following( - fid: number, - viewerFid?: number, - cursor?: string, - limit?: number, - options?: AxiosRequestConfig - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.following( - fid, - viewerFid, - cursor, - limit, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - }; -}; - -/** - * FollowsApi - factory interface - * @export - */ -export const FollowsApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance -) { - const localVarFp = FollowsApiFp(configuration); - return { - /** - * Gets a list of users who follow a given user in reverse chronological order. - * @summary Gets all followers for a given FID - * @param {FollowsApiFollowersRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - followers( - requestParameters: FollowsApiFollowersRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .followers( - requestParameters.fid, - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(axios, basePath)); - }, - /** - * Gets a list of users who is following a given user in reverse chronological order. - * @summary Gets all following users of a FID - * @param {FollowsApiFollowingRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - following( - requestParameters: FollowsApiFollowingRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .following( - requestParameters.fid, - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * Request parameters for followers operation in FollowsApi. - * @export - * @interface FollowsApiFollowersRequest - */ -export interface FollowsApiFollowersRequest { - /** - * FID of the user - * @type {number} - * @memberof FollowsApiFollowers - */ - readonly fid: number; - - /** - * fid of the user viewing this information, needed for contextual information. - * @type {number} - * @memberof FollowsApiFollowers - */ - readonly viewerFid?: number; - - /** - * Pagination cursor. - * @type {string} - * @memberof FollowsApiFollowers - */ - readonly cursor?: string; - - /** - * Number of results to retrieve (default 25, max 100) - * @type {number} - * @memberof FollowsApiFollowers - */ - readonly limit?: number; -} - -/** - * Request parameters for following operation in FollowsApi. - * @export - * @interface FollowsApiFollowingRequest - */ -export interface FollowsApiFollowingRequest { - /** - * FID of the user - * @type {number} - * @memberof FollowsApiFollowing - */ - readonly fid: number; - - /** - * fid of the user viewing this information, needed for contextual information. - * @type {number} - * @memberof FollowsApiFollowing - */ - readonly viewerFid?: number; - - /** - * Pagination cursor. - * @type {string} - * @memberof FollowsApiFollowing - */ - readonly cursor?: string; - - /** - * Number of results to retrieve (default 25, max 100) - * @type {number} - * @memberof FollowsApiFollowing - */ - readonly limit?: number; -} - -/** - * FollowsApi - object-oriented interface - * @export - * @class FollowsApi - * @extends {BaseAPI} - */ -export class FollowsApi extends BaseAPI { - /** - * Gets a list of users who follow a given user in reverse chronological order. - * @summary Gets all followers for a given FID - * @param {FollowsApiFollowersRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof FollowsApi - */ - public followers( - requestParameters: FollowsApiFollowersRequest, - options?: AxiosRequestConfig - ) { - return FollowsApiFp(this.configuration) - .followers( - requestParameters.fid, - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Gets a list of users who is following a given user in reverse chronological order. - * @summary Gets all following users of a FID - * @param {FollowsApiFollowingRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof FollowsApi - */ - public following( - requestParameters: FollowsApiFollowingRequest, - options?: AxiosRequestConfig - ) { - return FollowsApiFp(this.configuration) - .following( - requestParameters.fid, - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(this.axios, this.basePath)); - } -} diff --git a/src/neynar-api/neynar-v1-api/openapi/apis/notifications-api.ts b/src/neynar-api/neynar-v1-api/openapi/apis/notifications-api.ts deleted file mode 100644 index 828dbabd..00000000 --- a/src/neynar-api/neynar-v1-api/openapi/apis/notifications-api.ts +++ /dev/null @@ -1,464 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Farcaster API V1 - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import type { Configuration } from "../configuration"; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios"; -import globalAxios from "axios"; -// Some imports not used depending on template conditions -// @ts-ignore -import { - DUMMY_BASE_URL, - assertParamExists, - setApiKeyToObject, - setBasicAuthToObject, - setBearerAuthToObject, - setOAuthToObject, - setSearchParams, - serializeDataIfNeeded, - toPathString, - createRequestFunction, -} from "../common"; -// @ts-ignore -import { - BASE_PATH, - COLLECTION_FORMATS, - RequestArgs, - BaseAPI, - RequiredError, -} from "../base"; -// @ts-ignore -import { ErrorRes } from "../models"; -// @ts-ignore -import { MentionsAndRepliesResponse } from "../models"; -// @ts-ignore -import { ReactionsAndRecastsResponse } from "../models"; -/** - * NotificationsApi - axios parameter creator - * @export - */ -export const NotificationsApiAxiosParamCreator = function ( - configuration?: Configuration -) { - return { - /** - * Gets a list of mentions and replies to the user’s casts in reverse chronological order - * @summary Get mentions and replies - * @param {number} fid fid of a user - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 150) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - mentionsAndReplies: async ( - fid: number, - viewerFid?: number, - cursor?: string, - limit?: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'fid' is not null or undefined - assertParamExists("mentionsAndReplies", "fid", fid); - const localVarPath = `/farcaster/mentions-and-replies`; - // 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, - "api_key", - configuration - ); - - if (fid !== undefined) { - localVarQueryParameter["fid"] = fid; - } - - if (viewerFid !== undefined) { - localVarQueryParameter["viewerFid"] = viewerFid; - } - - if (cursor !== undefined) { - localVarQueryParameter["cursor"] = cursor; - } - - if (limit !== undefined) { - localVarQueryParameter["limit"] = limit; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Get a list of reactions and recasts to the users’s casts in reverse chronological order - * @summary Get reactions and recasts - * @param {number} fid fid of a user - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 150) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - reactionsAndRecasts: async ( - fid: number, - viewerFid?: number, - cursor?: string, - limit?: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'fid' is not null or undefined - assertParamExists("reactionsAndRecasts", "fid", fid); - const localVarPath = `/farcaster/reactions-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; - 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, - "api_key", - configuration - ); - - if (fid !== undefined) { - localVarQueryParameter["fid"] = fid; - } - - if (viewerFid !== undefined) { - localVarQueryParameter["viewerFid"] = viewerFid; - } - - if (cursor !== undefined) { - localVarQueryParameter["cursor"] = cursor; - } - - if (limit !== undefined) { - localVarQueryParameter["limit"] = limit; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; -}; - -/** - * NotificationsApi - functional programming interface - * @export - */ -export const NotificationsApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = - NotificationsApiAxiosParamCreator(configuration); - return { - /** - * Gets a list of mentions and replies to the user’s casts in reverse chronological order - * @summary Get mentions and replies - * @param {number} fid fid of a user - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 150) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async mentionsAndReplies( - fid: number, - viewerFid?: number, - cursor?: string, - limit?: number, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.mentionsAndReplies( - fid, - viewerFid, - cursor, - limit, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Get a list of reactions and recasts to the users’s casts in reverse chronological order - * @summary Get reactions and recasts - * @param {number} fid fid of a user - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 150) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async reactionsAndRecasts( - fid: number, - viewerFid?: number, - cursor?: string, - limit?: number, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.reactionsAndRecasts( - fid, - viewerFid, - cursor, - limit, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - }; -}; - -/** - * NotificationsApi - factory interface - * @export - */ -export const NotificationsApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance -) { - const localVarFp = NotificationsApiFp(configuration); - return { - /** - * Gets a list of mentions and replies to the user’s casts in reverse chronological order - * @summary Get mentions and replies - * @param {NotificationsApiMentionsAndRepliesRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - mentionsAndReplies( - requestParameters: NotificationsApiMentionsAndRepliesRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .mentionsAndReplies( - requestParameters.fid, - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(axios, basePath)); - }, - /** - * Get a list of reactions and recasts to the users’s casts in reverse chronological order - * @summary Get reactions and recasts - * @param {NotificationsApiReactionsAndRecastsRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - reactionsAndRecasts( - requestParameters: NotificationsApiReactionsAndRecastsRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .reactionsAndRecasts( - requestParameters.fid, - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * Request parameters for mentionsAndReplies operation in NotificationsApi. - * @export - * @interface NotificationsApiMentionsAndRepliesRequest - */ -export interface NotificationsApiMentionsAndRepliesRequest { - /** - * fid of a user - * @type {number} - * @memberof NotificationsApiMentionsAndReplies - */ - readonly fid: number; - - /** - * fid of the user viewing this information, needed for contextual information. - * @type {number} - * @memberof NotificationsApiMentionsAndReplies - */ - readonly viewerFid?: number; - - /** - * Pagination cursor. - * @type {string} - * @memberof NotificationsApiMentionsAndReplies - */ - readonly cursor?: string; - - /** - * Number of results to retrieve (default 25, max 150) - * @type {number} - * @memberof NotificationsApiMentionsAndReplies - */ - readonly limit?: number; -} - -/** - * Request parameters for reactionsAndRecasts operation in NotificationsApi. - * @export - * @interface NotificationsApiReactionsAndRecastsRequest - */ -export interface NotificationsApiReactionsAndRecastsRequest { - /** - * fid of a user - * @type {number} - * @memberof NotificationsApiReactionsAndRecasts - */ - readonly fid: number; - - /** - * fid of the user viewing this information, needed for contextual information. - * @type {number} - * @memberof NotificationsApiReactionsAndRecasts - */ - readonly viewerFid?: number; - - /** - * Pagination cursor. - * @type {string} - * @memberof NotificationsApiReactionsAndRecasts - */ - readonly cursor?: string; - - /** - * Number of results to retrieve (default 25, max 150) - * @type {number} - * @memberof NotificationsApiReactionsAndRecasts - */ - readonly limit?: number; -} - -/** - * NotificationsApi - object-oriented interface - * @export - * @class NotificationsApi - * @extends {BaseAPI} - */ -export class NotificationsApi extends BaseAPI { - /** - * Gets a list of mentions and replies to the user’s casts in reverse chronological order - * @summary Get mentions and replies - * @param {NotificationsApiMentionsAndRepliesRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof NotificationsApi - */ - public mentionsAndReplies( - requestParameters: NotificationsApiMentionsAndRepliesRequest, - options?: AxiosRequestConfig - ) { - return NotificationsApiFp(this.configuration) - .mentionsAndReplies( - requestParameters.fid, - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Get a list of reactions and recasts to the users’s casts in reverse chronological order - * @summary Get reactions and recasts - * @param {NotificationsApiReactionsAndRecastsRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof NotificationsApi - */ - public reactionsAndRecasts( - requestParameters: NotificationsApiReactionsAndRecastsRequest, - options?: AxiosRequestConfig - ) { - return NotificationsApiFp(this.configuration) - .reactionsAndRecasts( - requestParameters.fid, - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(this.axios, this.basePath)); - } -} diff --git a/src/neynar-api/neynar-v1-api/openapi/apis/reactions-api.ts b/src/neynar-api/neynar-v1-api/openapi/apis/reactions-api.ts deleted file mode 100644 index 14ed7e0d..00000000 --- a/src/neynar-api/neynar-v1-api/openapi/apis/reactions-api.ts +++ /dev/null @@ -1,651 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Farcaster API V1 - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import type { Configuration } from "../configuration"; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios"; -import globalAxios from "axios"; -// Some imports not used depending on template conditions -// @ts-ignore -import { - DUMMY_BASE_URL, - assertParamExists, - setApiKeyToObject, - setBasicAuthToObject, - setBearerAuthToObject, - setOAuthToObject, - setSearchParams, - serializeDataIfNeeded, - toPathString, - createRequestFunction, -} from "../common"; -// @ts-ignore -import { - BASE_PATH, - COLLECTION_FORMATS, - RequestArgs, - BaseAPI, - RequiredError, -} from "../base"; -// @ts-ignore -import { CastLikesResponse } from "../models"; -// @ts-ignore -import { CastReactionsResponse } from "../models"; -// @ts-ignore -import { CastRecasterResponse } from "../models"; -// @ts-ignore -import { ErrorRes } from "../models"; -/** - * ReactionsApi - axios parameter creator - * @export - */ -export const ReactionsApiAxiosParamCreator = function ( - configuration?: Configuration -) { - return { - /** - * Get all like reactions for a specific cast in reverse chronological order. - * @summary Get all like reactions for a specific cast - * @param {string} castHash Cast hash - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 150) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - castLikes: async ( - castHash: string, - viewerFid?: number, - cursor?: string, - limit?: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'castHash' is not null or undefined - assertParamExists("castLikes", "castHash", castHash); - const localVarPath = `/farcaster/cast-likes`; - // 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, - "api_key", - configuration - ); - - if (castHash !== undefined) { - localVarQueryParameter["castHash"] = castHash; - } - - if (viewerFid !== undefined) { - localVarQueryParameter["viewerFid"] = viewerFid; - } - - if (cursor !== undefined) { - localVarQueryParameter["cursor"] = cursor; - } - - if (limit !== undefined) { - localVarQueryParameter["limit"] = limit; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Get all reactions (likes and recasts) for a specific cast. - * @summary Get all reactions for a specific cast - * @param {string} castHash Cast hash - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 150) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - castReactions: async ( - castHash: string, - viewerFid?: number, - cursor?: string, - limit?: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'castHash' is not null or undefined - assertParamExists("castReactions", "castHash", castHash); - const localVarPath = `/farcaster/cast-reactions`; - // 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, - "api_key", - configuration - ); - - if (castHash !== undefined) { - localVarQueryParameter["castHash"] = castHash; - } - - if (viewerFid !== undefined) { - localVarQueryParameter["viewerFid"] = viewerFid; - } - - if (cursor !== undefined) { - localVarQueryParameter["cursor"] = cursor; - } - - if (limit !== undefined) { - localVarQueryParameter["limit"] = limit; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Get all recasters for a specific cast. - * @summary Get all recasters for a specific cast - * @param {string} castHash Cast hash - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 150) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - castRecasters: async ( - castHash: string, - viewerFid?: number, - cursor?: string, - limit?: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'castHash' is not null or undefined - assertParamExists("castRecasters", "castHash", castHash); - const localVarPath = `/farcaster/cast-recasters`; - // 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, - "api_key", - configuration - ); - - if (castHash !== undefined) { - localVarQueryParameter["castHash"] = castHash; - } - - if (viewerFid !== undefined) { - localVarQueryParameter["viewerFid"] = viewerFid; - } - - if (cursor !== undefined) { - localVarQueryParameter["cursor"] = cursor; - } - - if (limit !== undefined) { - localVarQueryParameter["limit"] = limit; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; -}; - -/** - * ReactionsApi - functional programming interface - * @export - */ -export const ReactionsApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = - ReactionsApiAxiosParamCreator(configuration); - return { - /** - * Get all like reactions for a specific cast in reverse chronological order. - * @summary Get all like reactions for a specific cast - * @param {string} castHash Cast hash - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 150) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async castLikes( - castHash: string, - viewerFid?: number, - cursor?: string, - limit?: number, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.castLikes( - castHash, - viewerFid, - cursor, - limit, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Get all reactions (likes and recasts) for a specific cast. - * @summary Get all reactions for a specific cast - * @param {string} castHash Cast hash - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 150) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async castReactions( - castHash: string, - viewerFid?: number, - cursor?: string, - limit?: number, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.castReactions( - castHash, - viewerFid, - cursor, - limit, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Get all recasters for a specific cast. - * @summary Get all recasters for a specific cast - * @param {string} castHash Cast hash - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 150) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async castRecasters( - castHash: string, - viewerFid?: number, - cursor?: string, - limit?: number, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.castRecasters( - castHash, - viewerFid, - cursor, - limit, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - }; -}; - -/** - * ReactionsApi - factory interface - * @export - */ -export const ReactionsApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance -) { - const localVarFp = ReactionsApiFp(configuration); - return { - /** - * Get all like reactions for a specific cast in reverse chronological order. - * @summary Get all like reactions for a specific cast - * @param {ReactionsApiCastLikesRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - castLikes( - requestParameters: ReactionsApiCastLikesRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .castLikes( - requestParameters.castHash, - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(axios, basePath)); - }, - /** - * Get all reactions (likes and recasts) for a specific cast. - * @summary Get all reactions for a specific cast - * @param {ReactionsApiCastReactionsRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - castReactions( - requestParameters: ReactionsApiCastReactionsRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .castReactions( - requestParameters.castHash, - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(axios, basePath)); - }, - /** - * Get all recasters for a specific cast. - * @summary Get all recasters for a specific cast - * @param {ReactionsApiCastRecastersRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - castRecasters( - requestParameters: ReactionsApiCastRecastersRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .castRecasters( - requestParameters.castHash, - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * Request parameters for castLikes operation in ReactionsApi. - * @export - * @interface ReactionsApiCastLikesRequest - */ -export interface ReactionsApiCastLikesRequest { - /** - * Cast hash - * @type {string} - * @memberof ReactionsApiCastLikes - */ - readonly castHash: string; - - /** - * fid of the user viewing this information, needed for contextual information. - * @type {number} - * @memberof ReactionsApiCastLikes - */ - readonly viewerFid?: number; - - /** - * Pagination cursor. - * @type {string} - * @memberof ReactionsApiCastLikes - */ - readonly cursor?: string; - - /** - * Number of results to retrieve (default 25, max 150) - * @type {number} - * @memberof ReactionsApiCastLikes - */ - readonly limit?: number; -} - -/** - * Request parameters for castReactions operation in ReactionsApi. - * @export - * @interface ReactionsApiCastReactionsRequest - */ -export interface ReactionsApiCastReactionsRequest { - /** - * Cast hash - * @type {string} - * @memberof ReactionsApiCastReactions - */ - readonly castHash: string; - - /** - * fid of the user viewing this information, needed for contextual information. - * @type {number} - * @memberof ReactionsApiCastReactions - */ - readonly viewerFid?: number; - - /** - * Pagination cursor. - * @type {string} - * @memberof ReactionsApiCastReactions - */ - readonly cursor?: string; - - /** - * Number of results to retrieve (default 25, max 150) - * @type {number} - * @memberof ReactionsApiCastReactions - */ - readonly limit?: number; -} - -/** - * Request parameters for castRecasters operation in ReactionsApi. - * @export - * @interface ReactionsApiCastRecastersRequest - */ -export interface ReactionsApiCastRecastersRequest { - /** - * Cast hash - * @type {string} - * @memberof ReactionsApiCastRecasters - */ - readonly castHash: string; - - /** - * fid of the user viewing this information, needed for contextual information. - * @type {number} - * @memberof ReactionsApiCastRecasters - */ - readonly viewerFid?: number; - - /** - * Pagination cursor. - * @type {string} - * @memberof ReactionsApiCastRecasters - */ - readonly cursor?: string; - - /** - * Number of results to retrieve (default 25, max 150) - * @type {number} - * @memberof ReactionsApiCastRecasters - */ - readonly limit?: number; -} - -/** - * ReactionsApi - object-oriented interface - * @export - * @class ReactionsApi - * @extends {BaseAPI} - */ -export class ReactionsApi extends BaseAPI { - /** - * Get all like reactions for a specific cast in reverse chronological order. - * @summary Get all like reactions for a specific cast - * @param {ReactionsApiCastLikesRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ReactionsApi - */ - public castLikes( - requestParameters: ReactionsApiCastLikesRequest, - options?: AxiosRequestConfig - ) { - return ReactionsApiFp(this.configuration) - .castLikes( - requestParameters.castHash, - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Get all reactions (likes and recasts) for a specific cast. - * @summary Get all reactions for a specific cast - * @param {ReactionsApiCastReactionsRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ReactionsApi - */ - public castReactions( - requestParameters: ReactionsApiCastReactionsRequest, - options?: AxiosRequestConfig - ) { - return ReactionsApiFp(this.configuration) - .castReactions( - requestParameters.castHash, - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Get all recasters for a specific cast. - * @summary Get all recasters for a specific cast - * @param {ReactionsApiCastRecastersRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ReactionsApi - */ - public castRecasters( - requestParameters: ReactionsApiCastRecastersRequest, - options?: AxiosRequestConfig - ) { - return ReactionsApiFp(this.configuration) - .castRecasters( - requestParameters.castHash, - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(this.axios, this.basePath)); - } -} diff --git a/src/neynar-api/neynar-v1-api/openapi/apis/user-api.ts b/src/neynar-api/neynar-v1-api/openapi/apis/user-api.ts deleted file mode 100644 index 318e3b9b..00000000 --- a/src/neynar-api/neynar-v1-api/openapi/apis/user-api.ts +++ /dev/null @@ -1,866 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Farcaster API V1 - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import type { Configuration } from "../configuration"; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios"; -import globalAxios from "axios"; -// Some imports not used depending on template conditions -// @ts-ignore -import { - DUMMY_BASE_URL, - assertParamExists, - setApiKeyToObject, - setBasicAuthToObject, - setBearerAuthToObject, - setOAuthToObject, - setSearchParams, - serializeDataIfNeeded, - toPathString, - createRequestFunction, -} from "../common"; -// @ts-ignore -import { - BASE_PATH, - COLLECTION_FORMATS, - RequestArgs, - BaseAPI, - RequiredError, -} from "../base"; -// @ts-ignore -import { CustodyAddressResponse } from "../models"; -// @ts-ignore -import { ErrorRes } from "../models"; -// @ts-ignore -import { RecentUsersResponse } from "../models"; -// @ts-ignore -import { User200Response } from "../models"; -// @ts-ignore -import { UserCastLikeResponse } from "../models"; -/** - * UserApi - axios parameter creator - * @export - */ -export const UserApiAxiosParamCreator = function ( - configuration?: Configuration -) { - return { - /** - * Returns the custody address for a given FID - * @summary Get the custody address for a given FID - * @param {number} fid fid of a user - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - custodyAddress: async ( - fid: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'fid' is not null or undefined - assertParamExists("custodyAddress", "fid", fid); - const localVarPath = `/farcaster/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; - 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, - "api_key", - configuration - ); - - if (fid !== undefined) { - localVarQueryParameter["fid"] = fid; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Get a list of casts from the protocol in reverse chronological order based on timestamp - * @summary Get Recent Users - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 100, max 1000) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - recentUsers: async ( - viewerFid?: number, - cursor?: string, - limit?: number, - options: AxiosRequestConfig = {} - ): Promise => { - const localVarPath = `/farcaster/recent-users`; - // 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, - "api_key", - configuration - ); - - if (viewerFid !== undefined) { - localVarQueryParameter["viewerFid"] = viewerFid; - } - - if (cursor !== undefined) { - localVarQueryParameter["cursor"] = cursor; - } - - if (limit !== undefined) { - localVarQueryParameter["limit"] = limit; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Returns metadata about a specific user - * @summary Get User Information by FID - * @param {number} fid fid of a user - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - user: async ( - fid: number, - viewerFid?: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'fid' is not null or undefined - assertParamExists("user", "fid", fid); - 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; - 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, - "api_key", - configuration - ); - - if (fid !== undefined) { - localVarQueryParameter["fid"] = fid; - } - - if (viewerFid !== undefined) { - localVarQueryParameter["viewerFid"] = viewerFid; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Returns metadata about a specific user - * @summary Get User Information by username - * @param {string} username Username of the user - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - userByUsername: async ( - username: string, - viewerFid?: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'username' is not null or undefined - assertParamExists("userByUsername", "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; - 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, - "api_key", - configuration - ); - - if (username !== undefined) { - localVarQueryParameter["username"] = username; - } - - if (viewerFid !== undefined) { - localVarQueryParameter["viewerFid"] = viewerFid; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Fetch all the liked cast of a User - * @summary Get User Cast Likes - * @param {number} fid FID of the user - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {number} [limit] Number of results to retrieve (default 25, max 150) - * @param {string} [cursor] Pagination cursor - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - userCastLikes: async ( - fid: number, - viewerFid?: number, - limit?: number, - cursor?: string, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'fid' is not null or undefined - assertParamExists("userCastLikes", "fid", fid); - const localVarPath = `/farcaster/user-cast-likes`; - // 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, - "api_key", - configuration - ); - - if (fid !== undefined) { - localVarQueryParameter["fid"] = fid; - } - - if (viewerFid !== undefined) { - localVarQueryParameter["viewerFid"] = 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, - }; - }, - }; -}; - -/** - * UserApi - functional programming interface - * @export - */ -export const UserApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = UserApiAxiosParamCreator(configuration); - return { - /** - * Returns the custody address for a given FID - * @summary Get the custody address for a given FID - * @param {number} fid fid of a user - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async custodyAddress( - fid: number, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.custodyAddress( - fid, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Get a list of casts from the protocol in reverse chronological order based on timestamp - * @summary Get Recent Users - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 100, max 1000) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async recentUsers( - viewerFid?: number, - cursor?: string, - limit?: number, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.recentUsers( - viewerFid, - cursor, - limit, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Returns metadata about a specific user - * @summary Get User Information by FID - * @param {number} fid fid of a user - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async user( - fid: number, - viewerFid?: number, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.user( - fid, - viewerFid, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Returns metadata about a specific user - * @summary Get User Information by username - * @param {string} username Username of the user - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async userByUsername( - username: string, - viewerFid?: number, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.userByUsername( - username, - viewerFid, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Fetch all the liked cast of a User - * @summary Get User Cast Likes - * @param {number} fid FID of the user - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {number} [limit] Number of results to retrieve (default 25, max 150) - * @param {string} [cursor] Pagination cursor - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async userCastLikes( - fid: number, - viewerFid?: number, - limit?: number, - cursor?: string, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.userCastLikes( - fid, - viewerFid, - limit, - cursor, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - }; -}; - -/** - * UserApi - factory interface - * @export - */ -export const UserApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance -) { - const localVarFp = UserApiFp(configuration); - return { - /** - * Returns the custody address for a given FID - * @summary Get the custody address for a given FID - * @param {UserApiCustodyAddressRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - custodyAddress( - requestParameters: UserApiCustodyAddressRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .custodyAddress(requestParameters.fid, options) - .then((request) => request(axios, basePath)); - }, - /** - * Get a list of casts from the protocol in reverse chronological order based on timestamp - * @summary Get Recent Users - * @param {UserApiRecentUsersRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - recentUsers( - requestParameters: UserApiRecentUsersRequest = {}, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .recentUsers( - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(axios, basePath)); - }, - /** - * Returns metadata about a specific user - * @summary Get User Information by FID - * @param {UserApiUserRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - user( - requestParameters: UserApiUserRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .user(requestParameters.fid, requestParameters.viewerFid, options) - .then((request) => request(axios, basePath)); - }, - /** - * Returns metadata about a specific user - * @summary Get User Information by username - * @param {UserApiUserByUsernameRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - userByUsername( - requestParameters: UserApiUserByUsernameRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .userByUsername( - requestParameters.username, - requestParameters.viewerFid, - options - ) - .then((request) => request(axios, basePath)); - }, - /** - * Fetch all the liked cast of a User - * @summary Get User Cast Likes - * @param {UserApiUserCastLikesRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - userCastLikes( - requestParameters: UserApiUserCastLikesRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .userCastLikes( - requestParameters.fid, - requestParameters.viewerFid, - requestParameters.limit, - requestParameters.cursor, - options - ) - .then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * Request parameters for custodyAddress operation in UserApi. - * @export - * @interface UserApiCustodyAddressRequest - */ -export interface UserApiCustodyAddressRequest { - /** - * fid of a user - * @type {number} - * @memberof UserApiCustodyAddress - */ - readonly fid: number; -} - -/** - * Request parameters for recentUsers operation in UserApi. - * @export - * @interface UserApiRecentUsersRequest - */ -export interface UserApiRecentUsersRequest { - /** - * fid of the user viewing this information, needed for contextual information. - * @type {number} - * @memberof UserApiRecentUsers - */ - readonly viewerFid?: number; - - /** - * Pagination cursor. - * @type {string} - * @memberof UserApiRecentUsers - */ - readonly cursor?: string; - - /** - * Number of results to retrieve (default 100, max 1000) - * @type {number} - * @memberof UserApiRecentUsers - */ - readonly limit?: number; -} - -/** - * Request parameters for user operation in UserApi. - * @export - * @interface UserApiUserRequest - */ -export interface UserApiUserRequest { - /** - * fid of a user - * @type {number} - * @memberof UserApiUser - */ - readonly fid: number; - - /** - * fid of the user viewing this information, needed for contextual information. - * @type {number} - * @memberof UserApiUser - */ - readonly viewerFid?: number; -} - -/** - * Request parameters for userByUsername operation in UserApi. - * @export - * @interface UserApiUserByUsernameRequest - */ -export interface UserApiUserByUsernameRequest { - /** - * Username of the user - * @type {string} - * @memberof UserApiUserByUsername - */ - readonly username: string; - - /** - * fid of the user viewing this information, needed for contextual information. - * @type {number} - * @memberof UserApiUserByUsername - */ - readonly viewerFid?: number; -} - -/** - * Request parameters for userCastLikes operation in UserApi. - * @export - * @interface UserApiUserCastLikesRequest - */ -export interface UserApiUserCastLikesRequest { - /** - * FID of the user - * @type {number} - * @memberof UserApiUserCastLikes - */ - readonly fid: number; - - /** - * fid of the user viewing this information, needed for contextual information. - * @type {number} - * @memberof UserApiUserCastLikes - */ - readonly viewerFid?: number; - - /** - * Number of results to retrieve (default 25, max 150) - * @type {number} - * @memberof UserApiUserCastLikes - */ - readonly limit?: number; - - /** - * Pagination cursor - * @type {string} - * @memberof UserApiUserCastLikes - */ - readonly cursor?: string; -} - -/** - * UserApi - object-oriented interface - * @export - * @class UserApi - * @extends {BaseAPI} - */ -export class UserApi extends BaseAPI { - /** - * Returns the custody address for a given FID - * @summary Get the custody address for a given FID - * @param {UserApiCustodyAddressRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public custodyAddress( - requestParameters: UserApiCustodyAddressRequest, - options?: AxiosRequestConfig - ) { - return UserApiFp(this.configuration) - .custodyAddress(requestParameters.fid, options) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Get a list of casts from the protocol in reverse chronological order based on timestamp - * @summary Get Recent Users - * @param {UserApiRecentUsersRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public recentUsers( - requestParameters: UserApiRecentUsersRequest = {}, - options?: AxiosRequestConfig - ) { - return UserApiFp(this.configuration) - .recentUsers( - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Returns metadata about a specific user - * @summary Get User Information by FID - * @param {UserApiUserRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public user( - requestParameters: UserApiUserRequest, - options?: AxiosRequestConfig - ) { - return UserApiFp(this.configuration) - .user(requestParameters.fid, requestParameters.viewerFid, options) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Returns metadata about a specific user - * @summary Get User Information by username - * @param {UserApiUserByUsernameRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public userByUsername( - requestParameters: UserApiUserByUsernameRequest, - options?: AxiosRequestConfig - ) { - return UserApiFp(this.configuration) - .userByUsername( - requestParameters.username, - requestParameters.viewerFid, - options - ) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Fetch all the liked cast of a User - * @summary Get User Cast Likes - * @param {UserApiUserCastLikesRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public userCastLikes( - requestParameters: UserApiUserCastLikesRequest, - options?: AxiosRequestConfig - ) { - return UserApiFp(this.configuration) - .userCastLikes( - requestParameters.fid, - requestParameters.viewerFid, - requestParameters.limit, - requestParameters.cursor, - options - ) - .then((request) => request(this.axios, this.basePath)); - } -} diff --git a/src/neynar-api/neynar-v1-api/openapi/apis/verification-api.ts b/src/neynar-api/neynar-v1-api/openapi/apis/verification-api.ts deleted file mode 100644 index 509f1b8c..00000000 --- a/src/neynar-api/neynar-v1-api/openapi/apis/verification-api.ts +++ /dev/null @@ -1,340 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * vFarcaster API V1 - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import type { Configuration } from "../configuration"; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios"; -import globalAxios from "axios"; -// Some imports not used depending on template conditions -// @ts-ignore -import { - DUMMY_BASE_URL, - assertParamExists, - setApiKeyToObject, - setBasicAuthToObject, - setBearerAuthToObject, - setOAuthToObject, - setSearchParams, - serializeDataIfNeeded, - toPathString, - createRequestFunction, -} from "../common"; -// @ts-ignore -import { - BASE_PATH, - COLLECTION_FORMATS, - RequestArgs, - BaseAPI, - RequiredError, -} from "../base"; -// @ts-ignore -import { ErrorRes } from "../models"; -// @ts-ignore -import { User200Response } from "../models"; -// @ts-ignore -import { VerificationResponse } from "../models"; -/** - * VerificationApi - axios parameter creator - * @export - */ -export const VerificationApiAxiosParamCreator = function ( - configuration?: Configuration -) { - return { - /** - * Checks if a given Ethereum address has a Farcaster user associated with it. Note: if an address is associated with multiple users, the API will return the user who most recently published a verification with the address (based on when Warpcast received the proof, not a self-reported timestamp). - * @summary Retrieve user for a given ethereum address - * @param {string} address - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - userByVerification: async ( - address: string, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'address' is not null or undefined - assertParamExists("userByVerification", "address", address); - const localVarPath = `/farcaster/user-by-verification`; - // 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, - "api_key", - configuration - ); - - if (address !== undefined) { - localVarQueryParameter["address"] = address; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Get all known verifications of a user - * @summary Retrieve verifications for a given FID - * @param {number} fid FID of the user - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - verifications: async ( - fid: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'fid' is not null or undefined - assertParamExists("verifications", "fid", fid); - const localVarPath = `/farcaster/verifications`; - // 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, - "api_key", - configuration - ); - - if (fid !== undefined) { - localVarQueryParameter["fid"] = fid; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; -}; - -/** - * VerificationApi - functional programming interface - * @export - */ -export const VerificationApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = - VerificationApiAxiosParamCreator(configuration); - return { - /** - * Checks if a given Ethereum address has a Farcaster user associated with it. Note: if an address is associated with multiple users, the API will return the user who most recently published a verification with the address (based on when Warpcast received the proof, not a self-reported timestamp). - * @summary Retrieve user for a given ethereum address - * @param {string} address - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async userByVerification( - address: string, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.userByVerification(address, options); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Get all known verifications of a user - * @summary Retrieve verifications for a given FID - * @param {number} fid FID of the user - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async verifications( - fid: number, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.verifications( - fid, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - }; -}; - -/** - * VerificationApi - factory interface - * @export - */ -export const VerificationApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance -) { - const localVarFp = VerificationApiFp(configuration); - return { - /** - * Checks if a given Ethereum address has a Farcaster user associated with it. Note: if an address is associated with multiple users, the API will return the user who most recently published a verification with the address (based on when Warpcast received the proof, not a self-reported timestamp). - * @summary Retrieve user for a given ethereum address - * @param {VerificationApiUserByVerificationRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - userByVerification( - requestParameters: VerificationApiUserByVerificationRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .userByVerification(requestParameters.address, options) - .then((request) => request(axios, basePath)); - }, - /** - * Get all known verifications of a user - * @summary Retrieve verifications for a given FID - * @param {VerificationApiVerificationsRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - verifications( - requestParameters: VerificationApiVerificationsRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .verifications(requestParameters.fid, options) - .then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * Request parameters for userByVerification operation in VerificationApi. - * @export - * @interface VerificationApiUserByVerificationRequest - */ -export interface VerificationApiUserByVerificationRequest { - /** - * - * @type {string} - * @memberof VerificationApiUserByVerification - */ - readonly address: string; -} - -/** - * Request parameters for verifications operation in VerificationApi. - * @export - * @interface VerificationApiVerificationsRequest - */ -export interface VerificationApiVerificationsRequest { - /** - * FID of the user - * @type {number} - * @memberof VerificationApiVerifications - */ - readonly fid: number; -} - -/** - * VerificationApi - object-oriented interface - * @export - * @class VerificationApi - * @extends {BaseAPI} - */ -export class VerificationApi extends BaseAPI { - /** - * Checks if a given Ethereum address has a Farcaster user associated with it. Note: if an address is associated with multiple users, the API will return the user who most recently published a verification with the address (based on when Warpcast received the proof, not a self-reported timestamp). - * @summary Retrieve user for a given ethereum address - * @param {VerificationApiUserByVerificationRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof VerificationApi - */ - public userByVerification( - requestParameters: VerificationApiUserByVerificationRequest, - options?: AxiosRequestConfig - ) { - return VerificationApiFp(this.configuration) - .userByVerification(requestParameters.address, options) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Get all known verifications of a user - * @summary Retrieve verifications for a given FID - * @param {VerificationApiVerificationsRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof VerificationApi - */ - public verifications( - requestParameters: VerificationApiVerificationsRequest, - options?: AxiosRequestConfig - ) { - return VerificationApiFp(this.configuration) - .verifications(requestParameters.fid, options) - .then((request) => request(this.axios, this.basePath)); - } -} diff --git a/src/neynar-api/neynar-v2-api/index.ts b/src/neynar-api/neynar-v2-api/index.ts deleted file mode 100644 index 7df1bbac..00000000 --- a/src/neynar-api/neynar-v2-api/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./openapi-farcaster"; -export * from "./neynar-api-v2-client"; diff --git a/src/neynar-api/neynar-v2-api/neynar-api-v2-client.ts b/src/neynar-api/neynar-v2-api/neynar-api-v2-client.ts deleted file mode 100644 index fb961345..00000000 --- a/src/neynar-api/neynar-v2-api/neynar-api-v2-client.ts +++ /dev/null @@ -1,556 +0,0 @@ -import { - CastApi, - SignerApi, - Signer, - Cast, - CastParamType, - PostCastResponseCast, - DeleteCastReqBody, - ReactionApi, - ReactionReqBody, - ReactionType, - OperationResponse, - BulkFollowResponse, - EmbeddedCast, - Configuration, - ErrorRes, - FeedApi, - UserApi, - CastApiPostCastRequest, - FeedType, - FilterType, - FeedResponse, - SignerApiRegisterSignedKeyRequest, - NotificationsResponse, - NotificationsApi, - FollowsApi, - RelevantFollowersResponse, - UserApiRemoveVerificationRequest, - UserApiAddVerificationRequest, - UserApiFollowRequest, - UserApiUpdateUserRequest, - UserBulk200Response, - UserSearchResponse, - CastResponse, - CastsResponse, - UserResponse, -} from "./openapi-farcaster"; -import axios, { AxiosError, AxiosInstance } from "axios"; -import { silentLogger, Logger } from "../common/logger"; -import type { SetRequired } from "type-fest"; -import { - FetchRelevantMints200Response, - NFTApi, -} from "./openapi-recommendation"; - -const BASE_PATH = "https://api.neynar.com/v2"; - -export class NeynarV2APIClient { - private readonly logger: Logger; - - public readonly apis: { - signer: SignerApi; - user: UserApi; - cast: CastApi; - reaction: ReactionApi; - feed: FeedApi; - notifications: NotificationsApi; - follows: FollowsApi; - nft: NFTApi; - }; - - /** - * Instantiates a NeynarV1APIClient - * - * Note: A Wallet must be provided if the API client is to mint new AuthTokens - */ - constructor( - apiKey: string, - { - basePath, - logger = silentLogger, - axiosInstance, - }: { - basePath?: string; - logger?: Logger; - axiosInstance?: AxiosInstance; - } = {} - ) { - this.logger = logger; - - if (apiKey === "") { - throw new Error( - "Attempt to use an authenticated API method without first providing an api key" - ); - } - - if (axiosInstance === undefined) { - axiosInstance = axios.create(); - } - axiosInstance.defaults.decompress = true; - axiosInstance.interceptors.response.use( - (response) => response, - (error) => { - if (NeynarV2APIClient.isApiErrorResponse(error)) { - const apiErrors = error.response.data; - this.logger.warn(`API errors: ${JSON.stringify(apiErrors)}`); - } - throw error; - } - ); - - const config: Configuration = new Configuration({ - basePath: basePath ? `${basePath}/v2` : BASE_PATH, - apiKey: apiKey, - }); - - this.apis = { - signer: new SignerApi(config, undefined, axiosInstance), - user: new UserApi(config, undefined, axiosInstance), - cast: new CastApi(config, undefined, axiosInstance), - reaction: new ReactionApi(config, undefined, axiosInstance), - feed: new FeedApi(config, undefined, axiosInstance), - notifications: new NotificationsApi(config, undefined, axiosInstance), - follows: new FollowsApi(config, undefined, axiosInstance), - nft: new NFTApi(config, undefined, axiosInstance), - }; - } - - /** - * Utility for parsing errors returned by the Neynar API servers. Returns true - * if the given error is caused by an error response from the server, and - * narrows the type of `error` accordingly. - */ - public static isApiErrorResponse( - // eslint-disable-next-line @typescript-eslint/no-explicit-any - error: any - ): error is SetRequired, "response"> { - if (!(error instanceof AxiosError)) return false; - return ( - error.response?.data !== undefined && "message" in error.response.data - ); - } - - // ------------ Signer ------------ - - /** - * Creates a Signer. - * See [Neynar documentation](https://docs.neynar.com/reference/create-signer) - * - */ - public async createSigner(): Promise { - const response = await this.apis.signer.createSigner(); - return response.data; - } - - /** - * Fetches an existing Signer. - * See [Neynar documentation](https://docs.neynar.com/reference/signer) - * - */ - public async lookupSigner(signerUuid: string): Promise { - const response = await this.apis.signer.signer({ signerUuid }); - return response.data; - } - - /** - * Registers a Signer with an fid. - * See [Neynar documentation](https://docs.neynar.com/reference/register-signed-key) - * - */ - public async registerSigner( - signerUuid: string, - fid: number, - deadline: number, - signature: string - ): Promise { - const request: SignerApiRegisterSignedKeyRequest = { - registerSignerKeyReqBody: { - signer_uuid: signerUuid, - app_fid: fid, - deadline: deadline, - signature: signature, - }, - }; - const response = await this.apis.signer.registerSignedKey(request); - return response.data; - } - - // ------------ User ------------ - - /** - * Removes verification for an eth address for the user. - * See [Neynar documentation](https://docs.neynar.com/reference/remove-verification) - * - */ - public async removeVerification( - signerUuid: string, - address: string - ): Promise { - const request: UserApiRemoveVerificationRequest = { - removeVerificationReqBody: { - signer_uuid: signerUuid, - address, - }, - }; - - const response = await this.apis.user.farcasterUserVerificationDelete( - request - ); - return response.data; - } - - /** - * Adds verification for an eth address for the user - * See [Neynar documentation](https://docs.neynar.com/reference/add-verification) - * - */ - public async addVerification( - signerUuid: string, - address: string, - blockHash: string, - ethSignature: string - ): Promise { - const request: UserApiAddVerificationRequest = { - addVerificationReqBody: { - signer_uuid: signerUuid, - address, - block_hash: blockHash, - eth_signature: ethSignature, - }, - }; - - const response = await this.apis.user.farcasterUserVerificationPost( - request - ); - return response.data; - } - - /** - * Follow a user. - * See [Neynar documentation](https://docs.neynar.com/reference/follow-user) - * - */ - - public async followUser( - signerUuid: string, - targetFids: number[] - ): Promise { - const request: UserApiFollowRequest = { - followReqBody: { - signer_uuid: signerUuid, - target_fids: targetFids, - }, - }; - - const response = await this.apis.user.followUser(request); - return response.data; - } - - /** - * Unfollow a user - * See [Neynar documentation](https://docs.neynar.com/reference/unfollow-user) - * - */ - public async unfollowUser( - signerUuid: string, - targetFids: number[] - ): Promise { - const request: UserApiFollowRequest = { - followReqBody: { - signer_uuid: signerUuid, - target_fids: targetFids, - }, - }; - const response = await this.apis.user.unfollowUser(request); - return response.data; - } - - /** - * Update user profile - * See [Neynar documentation](https://docs.neynar.com/reference/update-user) - * - */ - public async updateUserProfile( - signerUuid: string, - options?: { - bio?: string; - pfpUrl?: string; - url?: string; - username?: string; - displayName?: string; - } - ): Promise { - const request: UserApiUpdateUserRequest = { - updateUserReqBody: { - signer_uuid: signerUuid, - bio: options?.bio, - pfp_url: options?.pfpUrl, - url: options?.url, - username: options?.username, - display_name: options?.displayName, - }, - }; - - const response = await this.apis.user.updateUser(request); - return response.data; - } - - /** - * Fetches information about multiple users based on FIDs - * See [Neynar documentation](https://docs.neynar.com/reference/user-bulk) - * - */ - public async fetchUsersInBulk( - fids: string, - viewerFid?: number - ): Promise { - const response = await this.apis.user.userBulk({ fids, viewerFid }); - return response.data; - } - - /** - * Search User - * See [Neynar documentation](https://docs.neynar.com/reference/user-search) - */ - public async searchUser( - q: string, - viewerFid: number - ): Promise { - const response = await this.apis.user.userSearch({ q, viewerFid }); - return response.data; - } - - /** - * Lookup User by Custody Address - * See [Neynar documentation](https://docs.neynar.com/reference/lookup-user-by-custody-address) - */ - public async lookupUserByCustodyAddress( - custodyAddress: string - ): Promise { - const response = await this.apis.user.lookupUserByCustodyAddress({ - custodyAddress, - }); - return response.data; - } - - // ------------ Cast ------------ - - /** - * Gets information about an individual cast by passing in a Warpcast web URL or cast hash - * See [Neynar documentation](https://docs.neynar.com/reference/cast) - * - */ - public async lookUpCastByHashOrWarpcastUrl( - castHashOrUrl: string, - type: CastParamType - ): Promise { - const response = await this.apis.cast.cast({ - type, - identifier: castHashOrUrl, - }); - return response.data; - } - - /** - * Gets information about an array of casts. - * See [Neynar documentation](https://docs.neynar.com/reference/casts) - * - */ - public async fetchBulkCastsByHash(casts: string): Promise { - const response = await this.apis.cast.casts({ - casts, - }); - return response.data; - } - - /** - * Publishes a cast for the currently authenticated user. - * See [Neynar documentation](https://docs.neynar.com/reference/post-cast) - * - */ - public async publishCast( - signerUuid: string, - text: string, - options?: { embeds?: EmbeddedCast[]; replyTo?: string } - ): Promise { - const request: CastApiPostCastRequest = { - postCastReqBody: { - signer_uuid: signerUuid, - text: text, - embeds: options?.embeds, - parent: options?.replyTo, - }, - }; - const response = await this.apis.cast.postCast(request); - return response.data.cast; - } - - /** - * Delete a cast. - * See [Neynar documentation](https://docs.neynar.com/reference/delete-cast) - * - */ - public async deleteCast( - signerUuid: string, - castOrCastHash: Cast | string - ): Promise { - let castHash: string; - if (typeof castOrCastHash === "string") { - castHash = castOrCastHash; - } else { - castHash = castOrCastHash.hash; - } - const body: DeleteCastReqBody = { - signer_uuid: signerUuid, - target_hash: castHash, - }; - const response = await this.apis.cast.deleteCast({ - deleteCastReqBody: body, - }); - return response.data; - } - - // ------------ Feed ------------ - - /** - * Get reverse chronological feed page for a user based on their follow graph. - * See [Neynar documentation](https://docs.neynar.com/reference/feed) - * - */ - public async fetchFeedPage( - feedType: FeedType, - options?: { - filterType?: FilterType; - fid?: number; - fids?: string; - parentUrl?: string; - limit?: number; - cursor?: string; - withRecasts?: boolean; - } - ): Promise { - const response = await this.apis.feed.feed({ - feedType, - filterType: options?.filterType, - fid: options?.fid, - fids: options?.fids, - parentUrl: options?.parentUrl, - cursor: options?.cursor, - limit: options?.limit, - withRecasts: options?.withRecasts, - }); - return response.data; - } - - // ------------ Reaction ------------ - - /** - * React to a cast. - * See [Neynar documentation](https://docs.neynar.com/reference/post-reaction) - * - */ - public async reactToCast( - signerUuid: string, - reaction: ReactionType, - castOrCastHash: Cast | string - ): Promise { - let castHash: string; - if (typeof castOrCastHash === "string") { - castHash = castOrCastHash; - } else { - castHash = castOrCastHash.hash; - } - const body: ReactionReqBody = { - signer_uuid: signerUuid, - reaction_type: reaction, - target: castHash, - }; - const response = await this.apis.reaction.postReaction({ - reactionReqBody: body, - }); - return response.data; - } - - /** - * Remove a reaction to a cast. See [Neynar documentation](https://docs.neynar.com/reference/delete-reaction) - */ - public async removeReactionFromCast( - signerUuid: string, - reaction: ReactionType, - castOrCastHash: Cast | string - ): Promise { - let castHash: string; - if (typeof castOrCastHash === "string") { - castHash = castOrCastHash; - } else { - castHash = castOrCastHash.hash; - } - const body: ReactionReqBody = { - signer_uuid: signerUuid, - reaction_type: reaction, - target: castHash, - }; - const response = await this.apis.reaction.deleteReaction({ - reactionReqBody: body, - }); - return response.data; - } - - // ------------ Notifications ------------ - - /** - * Returns a list of notifications for a specific FID in reverse chronological order. - * See [Neynar documentation](https://docs.neynar.com/reference/notifications) - * - */ - public async fetchAllNotifications( - fid: number, - options?: { cursor?: string; limit?: number } - ): Promise { - const response = await this.apis.notifications.notifications({ - fid, - cursor: options?.cursor, - limit: options?.limit, - }); - return response.data; - } - - // ------------ Follows ------------ - - /** - * Returns a list of relevant followers for a specific FID. - * See [Neynar documentation](https://docs.neynar.com/reference/relevant-followers) - * - */ - public async fetchRelaventFollowers( - targetFid: number, - viewerFid: number - ): Promise { - const response = await this.apis.follows.relevantFollowers({ - targetFid, - viewerFid, - }); - return response.data; - } - - // ------------ Recommendation ------------ - - /** - * Fetches all mint actions relevant for a contract address (and optionally tokenId for ERC1155s) given a user's ethereum address - * See [Neynar documentation](https://docs.neynar.com/reference/fetch-relevant-mints) - * - */ - public async fetchRelevantMints( - address: string, - contractAddress: string, - tokenId?: string - ): Promise { - const response = await this.apis.nft.fetchRelevantMints({ - address, - contractAddress, - tokenId, - }); - return response.data; - } -} diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/cast-api.ts b/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/cast-api.ts deleted file mode 100644 index 567b8924..00000000 --- a/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/cast-api.ts +++ /dev/null @@ -1,624 +0,0 @@ -/* 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. - */ - -import type { Configuration } from "../configuration"; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios"; -import globalAxios from "axios"; -// Some imports not used depending on template conditions -// @ts-ignore -import { - DUMMY_BASE_URL, - assertParamExists, - setApiKeyToObject, - setBasicAuthToObject, - setBearerAuthToObject, - setOAuthToObject, - setSearchParams, - serializeDataIfNeeded, - toPathString, - createRequestFunction, -} from "../common"; -// @ts-ignore -import { - BASE_PATH, - COLLECTION_FORMATS, - RequestArgs, - BaseAPI, - RequiredError, -} from "../base"; -// @ts-ignore -import { CastParamType } from "../models"; -// @ts-ignore -import { CastResponse } from "../models"; -// @ts-ignore -import { CastsResponse } from "../models"; -// @ts-ignore -import { DeleteCastReqBody } from "../models"; -// @ts-ignore -import { ErrorRes } from "../models"; -// @ts-ignore -import { OperationResponse } from "../models"; -// @ts-ignore -import { PostCastReqBody } from "../models"; -// @ts-ignore -import { PostCastResponse } from "../models"; -/** - * CastApi - axios parameter creator - * @export - */ -export const CastApiAxiosParamCreator = function ( - configuration?: Configuration -) { - return { - /** - * Gets information about an individual cast by passing in a Warpcast web URL or cast hash - * @summary Retrieve cast for a given hash or Warpcast URL - * @param {CastParamType} type - * @param {string} identifier Cast identifier (Its either a url or a hash) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - cast: async ( - type: CastParamType, - identifier: string, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'type' is not null or undefined - assertParamExists("cast", "type", type); - // verify required parameter 'identifier' is not null or undefined - assertParamExists("cast", "identifier", identifier); - 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; - 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, - "api_key", - configuration - ); - - if (type !== undefined) { - localVarQueryParameter["type"] = type; - } - - if (identifier !== undefined) { - localVarQueryParameter["identifier"] = identifier; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Retrieve multiple casts using their respective hashes. - * @summary Gets information about an array of casts - * @param {string} casts Hashes of the cast to be retrived (Comma separated) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - casts: async ( - casts: string, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'casts' is not null or undefined - assertParamExists("casts", "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; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { - method: "GET", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - if (casts !== undefined) { - localVarQueryParameter["casts"] = casts; - } - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Delete an existing cast. \\ (In order to delete a cast `signer_uuid` must be approved) - * @summary Delete a cast - * @param {DeleteCastReqBody} deleteCastReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteCast: async ( - deleteCastReqBody: DeleteCastReqBody, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'deleteCastReqBody' is not null or undefined - assertParamExists("deleteCast", "deleteCastReqBody", deleteCastReqBody); - 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; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { - method: "DELETE", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "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( - deleteCastReqBody, - localVarRequestOptions, - configuration - ); - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Posts a cast or cast reply. Works with mentions and embeds. (In order to post a cast `signer_uuid` must be approved) - * @summary Posts a cast - * @param {PostCastReqBody} postCastReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - postCast: async ( - postCastReqBody: PostCastReqBody, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'postCastReqBody' is not null or undefined - assertParamExists("postCast", "postCastReqBody", postCastReqBody); - 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; - 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, - "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( - postCastReqBody, - localVarRequestOptions, - configuration - ); - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; -}; - -/** - * CastApi - functional programming interface - * @export - */ -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 Retrieve cast for a given hash or Warpcast URL - * @param {CastParamType} type - * @param {string} identifier Cast identifier (Its either a url or a hash) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async cast( - type: CastParamType, - identifier: string, - options?: AxiosRequestConfig - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.cast( - type, - identifier, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Retrieve multiple casts using their respective hashes. - * @summary Gets information about an array of casts - * @param {string} casts Hashes of the cast to be retrived (Comma separated) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async casts( - casts: string, - options?: AxiosRequestConfig - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.casts( - casts, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Delete an existing cast. \\ (In order to delete a cast `signer_uuid` must be approved) - * @summary Delete a cast - * @param {DeleteCastReqBody} deleteCastReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async deleteCast( - deleteCastReqBody: DeleteCastReqBody, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteCast( - deleteCastReqBody, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Posts a cast or cast reply. Works with mentions and embeds. (In order to post a cast `signer_uuid` must be approved) - * @summary Posts a cast - * @param {PostCastReqBody} postCastReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async postCast( - postCastReqBody: PostCastReqBody, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.postCast( - postCastReqBody, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - }; -}; - -/** - * CastApi - factory interface - * @export - */ -export const CastApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance -) { - const localVarFp = CastApiFp(configuration); - return { - /** - * Gets information about an individual cast by passing in a Warpcast web URL or cast hash - * @summary Retrieve cast for a given hash or Warpcast URL - * @param {CastApiCastRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - cast( - requestParameters: CastApiCastRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .cast(requestParameters.type, requestParameters.identifier, options) - .then((request) => request(axios, basePath)); - }, - /** - * Retrieve multiple casts using their respective hashes. - * @summary Gets information about an array of casts - * @param {CastApiCastsRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - casts( - requestParameters: CastApiCastsRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .casts(requestParameters.casts, 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 {CastApiDeleteCastRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteCast( - requestParameters: CastApiDeleteCastRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .deleteCast(requestParameters.deleteCastReqBody, 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 Posts a cast - * @param {CastApiPostCastRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - postCast( - requestParameters: CastApiPostCastRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .postCast(requestParameters.postCastReqBody, options) - .then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * Request parameters for cast operation in CastApi. - * @export - * @interface CastApiCastRequest - */ -export interface CastApiCastRequest { - /** - * - * @type {CastParamType} - * @memberof CastApiCast - */ - readonly type: CastParamType; - - /** - * Cast identifier (Its either a url or a hash) - * @type {string} - * @memberof CastApiCast - */ - readonly identifier: string; -} - -/** - * Request parameters for casts operation in CastApi. - * @export - * @interface CastApiCastsRequest - */ -export interface CastApiCastsRequest { - - /** - * Hashes of the cast to be retrived (Comma separated) - * @type {string} - * @memberof CastApiCasts - */ - readonly casts: string; -} - -/** - * Request parameters for deleteCast operation in CastApi. - * @export - * @interface CastApiDeleteCastRequest - */ -export interface CastApiDeleteCastRequest { - /** - * - * @type {DeleteCastReqBody} - * @memberof CastApiDeleteCast - */ - readonly deleteCastReqBody: DeleteCastReqBody; -} - -/** - * Request parameters for postCast operation in CastApi. - * @export - * @interface CastApiPostCastRequest - */ -export interface CastApiPostCastRequest { - /** - * - * @type {PostCastReqBody} - * @memberof CastApiPostCast - */ - readonly postCastReqBody: PostCastReqBody; -} - -/** - * CastApi - object-oriented interface - * @export - * @class CastApi - * @extends {BaseAPI} - */ -export class CastApi extends BaseAPI { - /** - * Gets information about an individual cast by passing in a Warpcast web URL or cast hash - * @summary Retrieve cast for a given hash or Warpcast URL - * @param {CastApiCastRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof CastApi - */ - public cast( - requestParameters: CastApiCastRequest, - options?: AxiosRequestConfig - ) { - return CastApiFp(this.configuration) - .cast(requestParameters.type, requestParameters.identifier, options) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Retrieve multiple casts using their respective hashes. - * @summary Gets information about an array of casts - * @param {CastApiCastsRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof CastApi - */ - public casts( - requestParameters: CastApiCastsRequest, - options?: AxiosRequestConfig - ) { - return CastApiFp(this.configuration) - .casts(requestParameters.casts, 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 {CastApiDeleteCastRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof CastApi - */ - public deleteCast( - requestParameters: CastApiDeleteCastRequest, - options?: AxiosRequestConfig - ) { - return CastApiFp(this.configuration) - .deleteCast(requestParameters.deleteCastReqBody, 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 Posts a cast - * @param {CastApiPostCastRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof CastApi - */ - public postCast( - requestParameters: CastApiPostCastRequest, - options?: AxiosRequestConfig - ) { - return CastApiFp(this.configuration) - .postCast(requestParameters.postCastReqBody, options) - .then((request) => request(this.axios, this.basePath)); - } -} diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/feed-api.ts b/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/feed-api.ts deleted file mode 100644 index 69baf743..00000000 --- a/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/feed-api.ts +++ /dev/null @@ -1,351 +0,0 @@ -/* 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. - */ - -import type { Configuration } from "../configuration"; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios"; -import globalAxios from "axios"; -// Some imports not used depending on template conditions -// @ts-ignore -import { - DUMMY_BASE_URL, - assertParamExists, - setApiKeyToObject, - setBasicAuthToObject, - setBearerAuthToObject, - setOAuthToObject, - setSearchParams, - serializeDataIfNeeded, - toPathString, - createRequestFunction, -} from "../common"; -// @ts-ignore -import { - BASE_PATH, - COLLECTION_FORMATS, - RequestArgs, - BaseAPI, - RequiredError, -} from "../base"; -// @ts-ignore -import { ErrorRes } from "../models"; -// @ts-ignore -import { FeedResponse } from "../models"; -/** - * FeedApi - axios parameter creator - * @export - */ -export const FeedApiAxiosParamCreator = function ( - configuration?: Configuration -) { - return { - /** - * - * @summary Retrieve casts based on 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) - * @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} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 100) - * @param {boolean} [withRecasts] Include recasts in the response, true by default - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - feed: async ( - feedType: FeedType, - filterType?: FilterType, - fid?: number, - fids?: string, - parentUrl?: string, - cursor?: string, - limit?: number, - withRecasts?: boolean, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'feedType' is not null or undefined - assertParamExists("feed", "feedType", feedType); - 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); - 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, - "api_key", - configuration - ); - - if (feedType !== undefined) { - localVarQueryParameter["feed_type"] = feedType; - } - - if (filterType !== undefined) { - localVarQueryParameter["filter_type"] = filterType; - } - - if (fid !== undefined) { - localVarQueryParameter["fid"] = fid; - } - - if (fids !== undefined) { - localVarQueryParameter["fids"] = fids; - } - - if (parentUrl !== undefined) { - localVarQueryParameter["parent_url"] = parentUrl; - } - - if (cursor !== undefined) { - localVarQueryParameter["cursor"] = cursor; - } - - if (limit !== undefined) { - localVarQueryParameter["limit"] = limit; - } - - if (withRecasts !== undefined) { - localVarQueryParameter["with_recasts"] = withRecasts; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; -}; - -/** - * FeedApi - functional programming interface - * @export - */ -export const FeedApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = FeedApiAxiosParamCreator(configuration); - return { - /** - * - * @summary Retrieve casts based on 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) - * @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} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 100) - * @param {boolean} [withRecasts] Include recasts in the response, true by default - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async feed( - feedType: FeedType, - filterType?: FilterType, - fid?: number, - fids?: string, - parentUrl?: string, - cursor?: string, - limit?: number, - withRecasts?: boolean, - options?: AxiosRequestConfig - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.feed( - feedType, - filterType, - fid, - fids, - parentUrl, - cursor, - limit, - withRecasts, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - }; -}; - -/** - * FeedApi - factory interface - * @export - */ -export const FeedApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance -) { - const localVarFp = FeedApiFp(configuration); - return { - /** - * - * @summary Retrieve casts based on filters - * @param {FeedApiFeedRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - feed( - requestParameters: FeedApiFeedRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .feed( - requestParameters.feedType, - requestParameters.filterType, - requestParameters.fid, - requestParameters.fids, - requestParameters.parentUrl, - requestParameters.cursor, - requestParameters.limit, - requestParameters.withRecasts, - options - ) - .then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * Request parameters for feed operation in FeedApi. - * @export - * @interface FeedApiFeedRequest - */ -export interface FeedApiFeedRequest { - /** - * Defaults to following (requires fid or address). If set to filter (requires filter_type) - * @type {'filter' | 'following'} - * @memberof FeedApiFeed - */ - readonly feedType: FeedType; - - /** - * Used when feed_type=filter. Can be set to fids (requires fids) or parent_url (requires parent_url) - * @type {'fids' | 'parent_url' | 'global_trending'} - * @memberof FeedApiFeed - */ - readonly filterType?: FilterType; - - /** - * fid of a user - * @type {number} - * @memberof FeedApiFeed - */ - 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 FeedApiFeed - */ - 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 FeedApiFeed - */ - readonly parentUrl?: string; - - /** - * Pagination cursor. - * @type {string} - * @memberof FeedApiFeed - */ - readonly cursor?: string; - - /** - * Number of results to retrieve (default 25, max 100) - * @type {number} - * @memberof FeedApiFeed - */ - readonly limit?: number; - - /** - * Include recasts in the response, true by default - * @type {boolean} - * @memberof FeedApiFeed - */ - readonly withRecasts?: boolean; -} - -/** - * FeedApi - object-oriented interface - * @export - * @class FeedApi - * @extends {BaseAPI} - */ -export class FeedApi extends BaseAPI { - /** - * - * @summary Retrieve casts based on filters - * @param {FeedApiFeedRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof FeedApi - */ - public feed( - requestParameters: FeedApiFeedRequest, - options?: AxiosRequestConfig - ) { - return FeedApiFp(this.configuration) - .feed( - requestParameters.feedType, - requestParameters.filterType, - requestParameters.fid, - requestParameters.fids, - requestParameters.parentUrl, - requestParameters.cursor, - requestParameters.limit, - requestParameters.withRecasts, - options - ) - .then((request) => request(this.axios, this.basePath)); - } -} - -export enum FeedType { - Following = "following", - Filter = "filter", -} - -export enum FilterType { - Fids = "fids", - ParentUrl = "parent_url", - GlobalTrending = "global_trending", -} diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/follows-api.ts b/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/follows-api.ts deleted file mode 100644 index 28a474d3..00000000 --- a/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/follows-api.ts +++ /dev/null @@ -1,239 +0,0 @@ -/* 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. - */ - -import type { Configuration } from "../configuration"; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios"; -import globalAxios from "axios"; -// Some imports not used depending on template conditions -// @ts-ignore -import { - DUMMY_BASE_URL, - assertParamExists, - setApiKeyToObject, - setBasicAuthToObject, - setBearerAuthToObject, - setOAuthToObject, - setSearchParams, - serializeDataIfNeeded, - toPathString, - createRequestFunction, -} from "../common"; -// @ts-ignore -import { - BASE_PATH, - COLLECTION_FORMATS, - RequestArgs, - BaseAPI, - RequiredError, -} from "../base"; -// @ts-ignore -import { ErrorRes } from "../models"; -// @ts-ignore -import { RelevantFollowersResponse } from "../models"; -/** - * FollowsApi - axios parameter creator - * @export - */ -export const FollowsApiAxiosParamCreator = function ( - configuration?: Configuration -) { - return { - /** - * Returns a list of relevant followers for a specific FID. - * @summary Retrieve relevant followers for a given user - * @param {number} targetFid User who's profile you are looking at - * @param {number} viewerFid Viewer who's looking at the profile - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - relevantFollowers: async ( - targetFid: number, - viewerFid: number, - options: AxiosRequestConfig = {} - ): 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`; - // 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; - - if (targetFid !== undefined) { - localVarQueryParameter["target_fid"] = targetFid; - } - - if (viewerFid !== undefined) { - localVarQueryParameter["viewer_fid"] = viewerFid; - } - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; -}; - -/** - * FollowsApi - functional programming interface - * @export - */ -export const FollowsApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = FollowsApiAxiosParamCreator(configuration); - return { - /** - * Returns a list of relevant followers for a specific FID. - * @summary Retrieve relevant followers for a given user - * @param {number} targetFid User who's profile you are looking at - * @param {number} viewerFid Viewer who's looking at the profile - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async relevantFollowers( - targetFid: number, - viewerFid: number, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.relevantFollowers( - targetFid, - viewerFid, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - }; -}; - -/** - * FollowsApi - factory interface - * @export - */ -export const FollowsApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance -) { - const localVarFp = FollowsApiFp(configuration); - return { - /** - * Returns a list of relevant followers for a specific FID. - * @summary Retrieve relevant followers for a given user - * @param {FollowsApiRelaventFollowersRequest} requestParameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - relevantFollowers( - requestParameters: FollowsApiRelaventFollowersRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .relevantFollowers( - requestParameters.targetFid, - requestParameters.viewerFid, - options - ) - .then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * Request parameters for relavant followers operation in FollowsApi. - * @export - * @interface FollowsApiRelaventFollowersRequest - */ -export interface FollowsApiRelaventFollowersRequest { - /** - * User who's profile you are looking at - * @type {number} - * @memberof FollowsApiRelaventFollowers - */ - readonly targetFid: number; - - /** - * Viewer who's looking at the profile - * @type {number} - * @memberof FollowsApiRelaventFollowers - */ - readonly viewerFid: number; -} - -/** - * FollowsApi - object-oriented interface - * @export - * @class FollowsApi - * @extends {BaseAPI} - */ -export class FollowsApi extends BaseAPI { - /** - * Returns a list of relevant followers for a specific FID. - * @summary Retrieve relevant followers for a given user - * @param {FollowsApiRelaventFollowersRequest} requestParameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof FollowsApi - */ - public relevantFollowers( - requestParameters: FollowsApiRelaventFollowersRequest, - options?: AxiosRequestConfig - ) { - return FollowsApiFp(this.configuration) - .relevantFollowers( - requestParameters.targetFid, - requestParameters.viewerFid, - options - ) - .then((request) => request(this.axios, this.basePath)); - } -} diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/notifications-api.ts b/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/notifications-api.ts deleted file mode 100644 index d3841cb5..00000000 --- a/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/notifications-api.ts +++ /dev/null @@ -1,255 +0,0 @@ -/* 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. - */ - -import type { Configuration } from "../configuration"; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios"; -import globalAxios from "axios"; -// Some imports not used depending on template conditions -// @ts-ignore -import { - DUMMY_BASE_URL, - assertParamExists, - setApiKeyToObject, - setBasicAuthToObject, - setBearerAuthToObject, - setOAuthToObject, - setSearchParams, - serializeDataIfNeeded, - toPathString, - createRequestFunction, -} from "../common"; -// @ts-ignore -import { - BASE_PATH, - COLLECTION_FORMATS, - RequestArgs, - BaseAPI, - RequiredError, -} from "../base"; -// @ts-ignore -import { ErrorRes } from "../models"; -// @ts-ignore -import { NotificationsResponse } from "../models"; -/** - * NotificationsApi - axios parameter creator - * @export - */ -export const NotificationsApiAxiosParamCreator = function ( - configuration?: Configuration -) { - return { - /** - * Returns a list of notifications for a specific FID. - * @summary Retrieve notifications for a given user - * @param {number} fid - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 50) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - notifications: async ( - fid: number, - cursor?: string, - limit?: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'fid' is not null or undefined - assertParamExists("notifications", "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; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { - method: "GET", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - if (fid !== undefined) { - localVarQueryParameter["fid"] = fid; - } - - if (cursor !== undefined) { - localVarQueryParameter["cursor"] = cursor; - } - - if (limit !== undefined) { - localVarQueryParameter["limit"] = limit; - } - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; -}; - -/** - * NotificationsApi - functional programming interface - * @export - */ -export const NotificationsApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = - NotificationsApiAxiosParamCreator(configuration); - return { - /** - * Returns a list of notifications for a specific FID. - * @summary Retrieve notifications for a given user - * @param {number} fid - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 50) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async notifications( - fid: number, - cursor?: string, - limit?: number, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.notifications( - fid, - cursor, - limit, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - }; -}; - -/** - * NotificationsApi - factory interface - * @export - */ -export const NotificationsApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance -) { - const localVarFp = NotificationsApiFp(configuration); - return { - /** - * Returns a list of notifications for a specific FID. - * @summary Retrieve notifications for a given user - * @param {NotificationsApiNotificationRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - notifications( - requestParameters: NotificationsApiNotificationRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .notifications( - requestParameters.fid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * Request parameters for fetch notifications operation in NotificationsApi. - * @export - * @interface NotificationsApiNotificationRequest - */ -export interface NotificationsApiNotificationRequest { - /** - * fid of a user - * @type {number} - * @memberof NotificationsApiNotification - */ - readonly fid: number; - - /** - * Pagination cursor. - * @type {string} - * @memberof NotificationsApiNotification - */ - readonly cursor?: string; - - /** - * Number of results to retrieve (default 25, max 150) - * @type {number} - * @memberof NotificationsApiNotification - */ - readonly limit?: number; -} - -/** - * NotificationsApi - object-oriented interface - * @export - * @class NotificationsApi - * @extends {BaseAPI} - */ -export class NotificationsApi extends BaseAPI { - /** - * Returns a list of notifications for a specific FID. - * @summary Retrieve notifications for a given user - * @param {NotificationsApiNotificationRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof NotificationsApi - */ - public notifications( - requestParameters: NotificationsApiNotificationRequest, - options?: AxiosRequestConfig - ) { - return NotificationsApiFp(this.configuration) - .notifications( - requestParameters.fid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(this.axios, this.basePath)); - } -} diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/reaction-api.ts b/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/reaction-api.ts deleted file mode 100644 index 5f078d5b..00000000 --- a/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/reaction-api.ts +++ /dev/null @@ -1,347 +0,0 @@ -/* 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. - */ - -import type { Configuration } from "../configuration"; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios"; -import globalAxios from "axios"; -// Some imports not used depending on template conditions -// @ts-ignore -import { - DUMMY_BASE_URL, - assertParamExists, - setApiKeyToObject, - setBasicAuthToObject, - setBearerAuthToObject, - setOAuthToObject, - setSearchParams, - serializeDataIfNeeded, - toPathString, - createRequestFunction, -} from "../common"; -// @ts-ignore -import { - BASE_PATH, - COLLECTION_FORMATS, - RequestArgs, - BaseAPI, - RequiredError, -} from "../base"; -// @ts-ignore -import { ErrorRes } from "../models"; -// @ts-ignore -import { OperationResponse } from "../models"; -// @ts-ignore -import { ReactionReqBody } from "../models"; -/** - * ReactionApi - axios parameter creator - * @export - */ -export const ReactionApiAxiosParamCreator = function ( - configuration?: Configuration -) { - return { - /** - * Delete a reaction (like or recast) to a given cast \\ (In order to delete a reaction `signer_uuid` must be approved) - * @summary Delete a reaction - * @param {ReactionReqBody} reactionReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteReaction: async ( - reactionReqBody: ReactionReqBody, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'reactionReqBody' is not null or undefined - assertParamExists("deleteReaction", "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: "DELETE", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "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 - ); - - 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 Posts a reaction - * @param {ReactionReqBody} reactionReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - postReaction: async ( - reactionReqBody: ReactionReqBody, - options: AxiosRequestConfig = {} - ): 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, - "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 - ); - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; -}; - -/** - * ReactionApi - functional programming interface - * @export - */ -export const ReactionApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = ReactionApiAxiosParamCreator(configuration); - return { - /** - * Delete a reaction (like or recast) to a given cast \\ (In order to delete a reaction `signer_uuid` must be approved) - * @summary Delete a reaction - * @param {ReactionReqBody} reactionReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async deleteReaction( - reactionReqBody: ReactionReqBody, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteReaction( - reactionReqBody, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Post a reaction (like or recast) to a given cast \\ (In order to post a reaction `signer_uuid` must be approved) - * @summary Posts a reaction - * @param {ReactionReqBody} reactionReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async postReaction( - reactionReqBody: ReactionReqBody, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.postReaction( - reactionReqBody, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - }; -}; - -/** - * ReactionApi - factory interface - * @export - */ -export const ReactionApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance -) { - const localVarFp = ReactionApiFp(configuration); - return { - /** - * Delete a reaction (like or recast) to a given cast \\ (In order to delete a reaction `signer_uuid` must be approved) - * @summary Delete a reaction - * @param {ReactionApiDeleteReactionRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteReaction( - requestParameters: ReactionApiDeleteReactionRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .deleteReaction(requestParameters.reactionReqBody, 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 Posts a reaction - * @param {ReactionApiPostReactionRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - postReaction( - requestParameters: ReactionApiPostReactionRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .postReaction(requestParameters.reactionReqBody, options) - .then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * Request parameters for deleteReaction operation in ReactionApi. - * @export - * @interface ReactionApiDeleteReactionRequest - */ -export interface ReactionApiDeleteReactionRequest { - /** - * - * @type {ReactionReqBody} - * @memberof ReactionApiDeleteReaction - */ - readonly reactionReqBody: ReactionReqBody; -} - -/** - * Request parameters for postReaction operation in ReactionApi. - * @export - * @interface ReactionApiPostReactionRequest - */ -export interface ReactionApiPostReactionRequest { - /** - * - * @type {ReactionReqBody} - * @memberof ReactionApiPostReaction - */ - readonly reactionReqBody: ReactionReqBody; -} - -/** - * ReactionApi - object-oriented interface - * @export - * @class ReactionApi - * @extends {BaseAPI} - */ -export class ReactionApi extends BaseAPI { - /** - * Delete a reaction (like or recast) to a given cast \\ (In order to delete a reaction `signer_uuid` must be approved) - * @summary Delete a reaction - * @param {ReactionApiDeleteReactionRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ReactionApi - */ - public deleteReaction( - requestParameters: ReactionApiDeleteReactionRequest, - options?: AxiosRequestConfig - ) { - return ReactionApiFp(this.configuration) - .deleteReaction(requestParameters.reactionReqBody, 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 Posts a reaction - * @param {ReactionApiPostReactionRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ReactionApi - */ - public postReaction( - requestParameters: ReactionApiPostReactionRequest, - options?: AxiosRequestConfig - ) { - return ReactionApiFp(this.configuration) - .postReaction(requestParameters.reactionReqBody, options) - .then((request) => request(this.axios, this.basePath)); - } -} diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/signer-api.ts b/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/signer-api.ts deleted file mode 100644 index eee3a702..00000000 --- a/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/signer-api.ts +++ /dev/null @@ -1,435 +0,0 @@ -/* 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. - */ - -import type { Configuration } from "../configuration"; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios"; -import globalAxios from "axios"; -// Some imports not used depending on template conditions -// @ts-ignore -import { - DUMMY_BASE_URL, - assertParamExists, - setApiKeyToObject, - setBasicAuthToObject, - setBearerAuthToObject, - setOAuthToObject, - setSearchParams, - serializeDataIfNeeded, - toPathString, - createRequestFunction, -} from "../common"; -// @ts-ignore -import { - BASE_PATH, - COLLECTION_FORMATS, - RequestArgs, - BaseAPI, - RequiredError, -} from "../base"; -// @ts-ignore -import { ErrorRes } from "../models"; -// @ts-ignore -import { RegisterSignerKeyReqBody } from "../models"; -// @ts-ignore -import { Signer } from "../models"; -/** - * SignerApi - axios parameter creator - * @export - */ -export const SignerApiAxiosParamCreator = function ( - configuration?: Configuration -) { - return { - /** - * Creates a signer and returns the signer status. - * **Note**: While testing please reuse the signer, it costs money to approve a signer. - * @summary Creates a signer and returns the signer status - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createSigner: async ( - options: AxiosRequestConfig = {} - ): Promise => { - 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; - 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, - "api_key", - configuration - ); - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Registers an app fid, deadline and a signature. Returns the signer status with an approval url. - * @summary Register Signed Key - * @param {RegisterSignerKeyReqBody} registerSignerKeyReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - registerSignedKey: async ( - registerSignerKeyReqBody: RegisterSignerKeyReqBody, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'registerSignerKeyReqBody' is not null or undefined - assertParamExists( - "registerSignedKey", - "registerSignerKeyReqBody", - registerSignerKeyReqBody - ); - 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; - 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, - "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( - registerSignerKeyReqBody, - localVarRequestOptions, - configuration - ); - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Gets information status of a signer by passing in a signer_uuid (Use post API to generate a signer) - * @summary Fetches the status of a signer - * @param {string} signerUuid - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - signer: async ( - signerUuid: string, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'signerUuid' is not null or undefined - assertParamExists("signer", "signerUuid", signerUuid); - 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; - 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, - "api_key", - configuration - ); - - if (signerUuid !== undefined) { - localVarQueryParameter["signer_uuid"] = signerUuid; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; -}; - -/** - * SignerApi - functional programming interface - * @export - */ -export const SignerApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = SignerApiAxiosParamCreator(configuration); - return { - /** - * Creates a signer and returns the signer status. \\ **Note**: While testing please reuse the signer, it costs money to approve a signer. - * @summary Creates a signer and returns the signer status - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async createSigner( - options?: AxiosRequestConfig - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.createSigner( - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Registers an app fid, deadline and a signature. Returns the signer status with an approval url. - * @summary Register Signed Key - * @param {RegisterSignerKeyReqBody} registerSignerKeyReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async registerSignedKey( - registerSignerKeyReqBody: RegisterSignerKeyReqBody, - options?: AxiosRequestConfig - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.registerSignedKey( - registerSignerKeyReqBody, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Gets information status of a signer by passing in a signer_uuid (Use post API to generate a signer) - * @summary Fetches the status of a signer - * @param {string} signerUuid - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async signer( - signerUuid: string, - options?: AxiosRequestConfig - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.signer( - signerUuid, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - }; -}; - -/** - * SignerApi - factory interface - * @export - */ -export const SignerApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance -) { - const localVarFp = SignerApiFp(configuration); - return { - /** - * Creates a signer and returns the signer status. \\ **Note**: While testing please reuse the signer, it costs money to approve a signer. - * @summary Creates a signer and returns the signer status - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createSigner(options?: AxiosRequestConfig): AxiosPromise { - return localVarFp - .createSigner(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 {SignerApiRegisterSignedKeyRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - registerSignedKey( - requestParameters: SignerApiRegisterSignedKeyRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .registerSignedKey(requestParameters.registerSignerKeyReqBody, 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 Fetches the status of a signer - * @param {SignerApiSignerRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - signer( - requestParameters: SignerApiSignerRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .signer(requestParameters.signerUuid, options) - .then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * Request parameters for registerSignedKey operation in SignerApi. - * @export - * @interface SignerApiRegisterSignedKeyRequest - */ -export interface SignerApiRegisterSignedKeyRequest { - /** - * - * @type {RegisterSignerKeyReqBody} - * @memberof SignerApiRegisterSignedKey - */ - readonly registerSignerKeyReqBody: RegisterSignerKeyReqBody; -} - -/** - * Request parameters for signer operation in SignerApi. - * @export - * @interface SignerApiSignerRequest - */ -export interface SignerApiSignerRequest { - /** - * - * @type {string} - * @memberof SignerApiSigner - */ - readonly signerUuid: string; -} - -/** - * SignerApi - object-oriented interface - * @export - * @class SignerApi - * @extends {BaseAPI} - */ -export class SignerApi extends BaseAPI { - /** - * Creates a signer and returns the signer status. \\ **Note**: While testing please reuse the signer, it costs money to approve a signer. - * @summary Creates a signer and returns the signer status - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SignerApi - */ - public createSigner(options?: AxiosRequestConfig) { - return SignerApiFp(this.configuration) - .createSigner(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 {SignerApiRegisterSignedKeyRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SignerApi - */ - public registerSignedKey( - requestParameters: SignerApiRegisterSignedKeyRequest, - options?: AxiosRequestConfig - ) { - return SignerApiFp(this.configuration) - .registerSignedKey(requestParameters.registerSignerKeyReqBody, 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 Fetches the status of a signer - * @param {SignerApiSignerRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SignerApi - */ - public signer( - requestParameters: SignerApiSignerRequest, - options?: AxiosRequestConfig - ) { - return SignerApiFp(this.configuration) - .signer(requestParameters.signerUuid, options) - .then((request) => request(this.axios, this.basePath)); - } -} diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/user-api.ts b/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/user-api.ts deleted file mode 100644 index 604a0452..00000000 --- a/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/user-api.ts +++ /dev/null @@ -1,1174 +0,0 @@ -/* 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. - */ - -import type { Configuration } from "../configuration"; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios"; -import globalAxios from "axios"; -// Some imports not used depending on template conditions -// @ts-ignore -import { - DUMMY_BASE_URL, - assertParamExists, - setApiKeyToObject, - setBasicAuthToObject, - setBearerAuthToObject, - setOAuthToObject, - setSearchParams, - serializeDataIfNeeded, - toPathString, - createRequestFunction, -} from "../common"; -// @ts-ignore -import { - BASE_PATH, - COLLECTION_FORMATS, - RequestArgs, - BaseAPI, - RequiredError, -} from "../base"; -// @ts-ignore -import { AddVerificationReqBody } from "../models"; -// @ts-ignore -import { BulkFollowResponse } from "../models"; -// @ts-ignore -import { ErrorRes } from "../models"; -// @ts-ignore -import { FollowReqBody } from "../models"; -// @ts-ignore -import { OperationResponse } from "../models"; -// @ts-ignore -import { RemoveVerificationReqBody } from "../models"; -// @ts-ignore -import { UpdateUserReqBody } from "../models"; -// @ts-ignore -import { UserBulk200Response } from "../models"; -// @ts-ignore -import { UserResponse } from "../models"; -// @ts-ignore -import { UserSearchResponse } from "../models"; -/** - * UserApi - axios parameter creator - * @export - */ -export const UserApiAxiosParamCreator = function ( - configuration?: Configuration -) { - return { - /** - * Removes verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) - * @summary Removes verification for an eth address for the user - * @param {RemoveVerificationReqBody} removeVerificationReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - farcasterUserVerificationDelete: async ( - removeVerificationReqBody: RemoveVerificationReqBody, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'removeVerificationReqBody' is not null or undefined - assertParamExists( - "farcasterUserVerificationDelete", - "removeVerificationReqBody", - removeVerificationReqBody - ); - 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; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { - method: "DELETE", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "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( - removeVerificationReqBody, - localVarRequestOptions, - configuration - ); - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Adds verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) - * @summary Adds verification for an eth address for the user - * @param {AddVerificationReqBody} addVerificationReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - farcasterUserVerificationPost: async ( - addVerificationReqBody: AddVerificationReqBody, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'addVerificationReqBody' is not null or undefined - assertParamExists( - "farcasterUserVerificationPost", - "addVerificationReqBody", - addVerificationReqBody - ); - 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; - 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, - "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( - addVerificationReqBody, - localVarRequestOptions, - configuration - ); - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Follow a user \\ (In order to follow a user `signer_uuid` must be approved) - * @summary Follow a user - * @param {FollowReqBody} followReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - followUser: async ( - followReqBody: FollowReqBody, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'followReqBody' is not null or undefined - assertParamExists("followUser", "followReqBody", followReqBody); - 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; - 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, - "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( - followReqBody, - localVarRequestOptions, - configuration - ); - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Lookup a user by custody-address - * @summary Lookup a user by custody-address - * @param {string} custodyAddress Custody Address of the associated with mnemonic - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - lookupUserByCustodyAddress: async ( - custodyAddress: string, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'custodyAddress' is not null or undefined - assertParamExists( - "lookupUserByCustodyAddress", - "custodyAddress", - custodyAddress - ); - - 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; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { - method: "GET", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - if (custodyAddress !== undefined) { - localVarQueryParameter["custody_address"] = custodyAddress; - } - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Unfollow a user \\ (In order to unfollow a user `signer_uuid` must be approved) - * @summary Unfollow a user - * @param {FollowReqBody} followReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - unfollowUser: async ( - followReqBody: FollowReqBody, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'followReqBody' is not null or undefined - assertParamExists("unfollowUser", "followReqBody", followReqBody); - 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; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { - method: "DELETE", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "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( - followReqBody, - localVarRequestOptions, - configuration - ); - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Update user profile \\ (In order to update user\'s profile `signer_uuid` must be approved) - * @summary Update user profile - * @param {UpdateUserReqBody} updateUserReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateUser: async ( - updateUserReqBody: UpdateUserReqBody, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'updateUserReqBody' is not null or undefined - assertParamExists("updateUser", "updateUserReqBody", updateUserReqBody); - 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; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { - method: "PATCH", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "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( - updateUserReqBody, - localVarRequestOptions, - configuration - ); - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Fetches information about multiple users based on FIDs - * @summary Fetches information about multiple users based on FIDs - * @param {string} fids - * @param {number} [viewerFid] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - userBulk: async ( - fids: string, - viewerFid?: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'fids' is not null or undefined - assertParamExists("userBulk", "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; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { - method: "GET", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - if (fids !== undefined) { - localVarQueryParameter["fids"] = fids; - } - - if (viewerFid !== undefined) { - localVarQueryParameter["viewer_fid"] = viewerFid; - } - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Search for Usernames - * @summary Search for Usernames - * @param {number} viewerFid - * @param {string} q - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - userSearch: async ( - viewerFid: number, - q: string, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'viewerFid' is not null or undefined - assertParamExists("userSearch", "viewerFid", viewerFid); - // 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; - - if (viewerFid !== undefined) { - localVarQueryParameter["viewer_fid"] = viewerFid; - } - - if (q !== undefined) { - localVarQueryParameter["q"] = q; - } - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; -}; - -/** - * UserApi - functional programming interface - * @export - */ -export const UserApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = UserApiAxiosParamCreator(configuration); - return { - /** - * Removes verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) - * @summary Removes verification for an eth address for the user - * @param {RemoveVerificationReqBody} removeVerificationReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async farcasterUserVerificationDelete( - removeVerificationReqBody: RemoveVerificationReqBody, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.farcasterUserVerificationDelete( - removeVerificationReqBody, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Adds verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) - * @summary Adds verification for an eth address for the user - * @param {AddVerificationReqBody} addVerificationReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async farcasterUserVerificationPost( - addVerificationReqBody: AddVerificationReqBody, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.farcasterUserVerificationPost( - addVerificationReqBody, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Follow a user \\ (In order to follow a user `signer_uuid` must be approved) - * @summary Follow a user - * @param {FollowReqBody} followReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async followUser( - followReqBody: FollowReqBody, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.followUser( - followReqBody, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Lookup a user by custody-address - * @summary Lookup a user by custody-address - * @param {string} custodyAddress Custody Address of the associated with mnemonic - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async lookupUserByCustodyAddress( - custodyAddress: string, - options?: AxiosRequestConfig - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.lookupUserByCustodyAddress( - custodyAddress, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Unfollow a user \\ (In order to unfollow a user `signer_uuid` must be approved) - * @summary Unfollow a user - * @param {FollowReqBody} followReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async unfollowUser( - followReqBody: FollowReqBody, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.unfollowUser( - followReqBody, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Update user profile \\ (In order to update user\'s profile `signer_uuid` must be approved) - * @summary Update user profile - * @param {UpdateUserReqBody} updateUserReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async updateUser( - updateUserReqBody: UpdateUserReqBody, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.updateUser( - updateUserReqBody, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Fetches information about multiple users based on FIDs - * @summary Fetches information about multiple users based on FIDs - * @param {string} fids - * @param {number} [viewerFid] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async userBulk( - fids: string, - viewerFid?: number, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.userBulk( - fids, - viewerFid, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Search for Usernames - * @summary Search for Usernames - * @param {number} viewerFid - * @param {string} q - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async userSearch( - viewerFid: number, - q: string, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.userSearch( - viewerFid, - q, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - }; -}; - -/** - * UserApi - factory interface - * @export - */ -export const UserApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance -) { - const localVarFp = UserApiFp(configuration); - return { - /** - * Removes verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) - * @summary Removes verification for an eth address for the user - * @param {UserApiRemoveVerificationRequest} requestParameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - farcasterUserVerificationDelete( - requestParameters: UserApiRemoveVerificationRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .farcasterUserVerificationDelete( - requestParameters.removeVerificationReqBody, - options - ) - .then((request) => request(axios, basePath)); - }, - /** - * Adds verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) - * @summary Adds verification for an eth address for the user - * @param {UserApiAddVerificationRequest} requestParameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - farcasterUserVerificationPost( - requestParameters: UserApiAddVerificationRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .farcasterUserVerificationPost( - requestParameters.addVerificationReqBody, - options - ) - .then((request) => request(axios, basePath)); - }, - /** - * Follow a user \\ (In order to follow a user `signer_uuid` must be approved) - * @summary Follow a user - * @param {UserApiFollowRequest} requestParameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - followUser( - requestParameters: UserApiFollowRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .followUser(requestParameters.followReqBody, options) - .then((request) => request(axios, basePath)); - }, - /** - * Lookup a user by custody-address - * @summary Lookup a user by custody-address - * @param {UserApiLookupUserByCustodyAddressRequest} requestParameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - lookupUserByCustodyAddress( - requestParameters: UserApiLookupUserByCustodyAddressRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .lookupUserByCustodyAddress(requestParameters.custodyAddress, options) - .then((request) => request(axios, basePath)); - }, - /** - * Unfollow a user \\ (In order to unfollow a user `signer_uuid` must be approved) - * @summary Unfollow a user - * @param {UserApiFollowRequest} requestParameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - unfollowUser( - requestParameters: UserApiFollowRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .unfollowUser(requestParameters.followReqBody, 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 {UserApiUpdateUserRequest} requestParameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateUser( - requestParameters: UserApiUpdateUserRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .updateUser(requestParameters.updateUserReqBody, options) - .then((request) => request(axios, basePath)); - }, - /** - * Fetches information about multiple users based on FIDs - * @summary Fetches information about multiple users based on FIDs - * @param {UserApiBulkUserRequest} requestParameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - userBulk( - requestParameters: UserApiBulkUserRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .userBulk(requestParameters.fids, requestParameters.viewerFid, options) - .then((request) => request(axios, basePath)); - }, - /** - * Search for Usernames - * @summary Search for Usernames - * @param {UserApiUserSearchRequest} requestParameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - userSearch( - requestParameters: UserApiUserSearchRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .userSearch(requestParameters.viewerFid, requestParameters.q, options) - .then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * Request parameters to remove verification for an eth address operation in UserApi. - * @export - * @interface UserApiRemoveVerificationRequest - */ -export interface UserApiRemoveVerificationRequest { - /** - * - * @type {RemoveVerificationReqBody} - * @memberof UserApiRemoveVerification - */ - readonly removeVerificationReqBody: RemoveVerificationReqBody; -} - -/** - * Request parameters add verification for an eth address operation in UserApi. - * @export - * @interface UserApiAddVerificationRequest - */ -export interface UserApiAddVerificationRequest { - /** - * - * @type {AddVerificationReqBody} - * @memberof UserApiAddVerification - */ - readonly addVerificationReqBody: AddVerificationReqBody; -} - -/** - * Request parameters to follow user operation in UserApi. - * @export - * @interface UserApiFollowRequest - */ -export interface UserApiFollowRequest { - /** - * - * @type {FollowReqBody} - * @memberof UserApiFollow - */ - readonly followReqBody: FollowReqBody; -} - -/** - * Request parameters to update user operation in UserApi. - * @export - * @interface UserApiUpdateUserRequest - */ -export interface UserApiUpdateUserRequest { - /** - * - * @type {UpdateUserReqBody} - * @memberof UserApiUpdateUser - */ - readonly updateUserReqBody: UpdateUserReqBody; -} - -/** - * Request parameters for fetch users in bulk operation in UserApi. - * @export - * @interface UserApiBulkUserRequest - */ -export interface UserApiBulkUserRequest { - /** - * @type {string} - * @memberof UserApiBulkUser - */ - readonly fids: string; - - /** - * @type {number} - * @memberof UserApiBulkUser - */ - readonly viewerFid?: number; -} - -/** - * Request parameters for lookup user by custody address operation in UserApi. - * @export - * @interface UserApiLookupUserByCustodyAddressRequest - */ -export interface UserApiLookupUserByCustodyAddressRequest { - /** - * Custody Address of the associated with mnemonic - * - * @type {string} - * @memberof UserApiLookupUserByCustodyAddress - */ - readonly custodyAddress: string; -} - -/** - * Request parameters for search user in operation in UserApi. - * @export - * @interface UserApiUserSearchRequest - */ -export interface UserApiUserSearchRequest { - /** - * @type {string} - * @memberof UserApiUserSearch - */ - readonly q: string; - - /** - * @type {number} - * @memberof UserApiUserSearch - */ - readonly viewerFid: number; -} - -/** - * UserApi - object-oriented interface - * @export - * @class UserApi - * @extends {BaseAPI} - */ -export class UserApi extends BaseAPI { - /** - * Removes verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) - * @summary Removes verification for an eth address for the user - * @param {UserApiRemoveVerificationRequest} requestParameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public farcasterUserVerificationDelete( - requestParameters: UserApiRemoveVerificationRequest, - options?: AxiosRequestConfig - ) { - return UserApiFp(this.configuration) - .farcasterUserVerificationDelete( - requestParameters.removeVerificationReqBody, - options - ) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Adds verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) - * @summary Adds verification for an eth address for the user - * @param {UserApiAddVerificationRequest} requestParameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public farcasterUserVerificationPost( - requestParameters: UserApiAddVerificationRequest, - options?: AxiosRequestConfig - ) { - return UserApiFp(this.configuration) - .farcasterUserVerificationPost( - requestParameters.addVerificationReqBody, - options - ) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Follow a user \\ (In order to follow a user `signer_uuid` must be approved) - * @summary Follow a user - * @param {UserApiFollowRequest} requestParameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public followUser( - requestParameters: UserApiFollowRequest, - options?: AxiosRequestConfig - ) { - return UserApiFp(this.configuration) - .followUser(requestParameters.followReqBody, options) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Lookup a user by custody-address - * @summary Lookup a user by custody-address - * @param {UserApiLookupUserByCustodyAddressRequest} requestParameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public lookupUserByCustodyAddress( - requestParameters: UserApiLookupUserByCustodyAddressRequest, - options?: AxiosRequestConfig - ) { - return UserApiFp(this.configuration) - .lookupUserByCustodyAddress(requestParameters.custodyAddress, options) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Unfollow a user \\ (In order to unfollow a user `signer_uuid` must be approved) - * @summary Unfollow a user - * @param {UserApiFollowRequest} requestParameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public unfollowUser( - requestParameters: UserApiFollowRequest, - options?: AxiosRequestConfig - ) { - return UserApiFp(this.configuration) - .unfollowUser(requestParameters.followReqBody, 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 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public updateUser( - requestParameters: UserApiUpdateUserRequest, - options?: AxiosRequestConfig - ) { - return UserApiFp(this.configuration) - .updateUser(requestParameters.updateUserReqBody, options) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Fetches information about multiple users based on FIDs - * @summary Fetches information about multiple users based on FIDs - * @param {UserApiBulkUserRequest} requestParameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public userBulk( - requestParameters: UserApiBulkUserRequest, - options?: AxiosRequestConfig - ) { - return UserApiFp(this.configuration) - .userBulk(requestParameters.fids, requestParameters.viewerFid, options) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Search for Usernames - * @summary Search for Usernames - * @param {UserApiUserSearchRequest} requestParameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public userSearch( - requestParameters: UserApiUserSearchRequest, - options?: AxiosRequestConfig - ) { - return UserApiFp(this.configuration) - .userSearch(requestParameters.viewerFid, requestParameters.q, options) - .then((request) => request(this.axios, this.basePath)); - } -} diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/.openapi-generator/VERSION b/src/neynar-api/neynar-v2-api/openapi-recommendation/.openapi-generator/VERSION deleted file mode 100644 index 73a86b19..00000000 --- a/src/neynar-api/neynar-v2-api/openapi-recommendation/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.0.1 \ No newline at end of file diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/apis/nftapi.ts b/src/neynar-api/neynar-v2-api/openapi-recommendation/apis/nftapi.ts deleted file mode 100644 index 3064f677..00000000 --- a/src/neynar-api/neynar-v2-api/openapi-recommendation/apis/nftapi.ts +++ /dev/null @@ -1,261 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Recommendation 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. - */ - -import type { Configuration } from "../configuration"; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios"; -import globalAxios from "axios"; -// Some imports not used depending on template conditions -// @ts-ignore -import { - DUMMY_BASE_URL, - assertParamExists, - setApiKeyToObject, - setBasicAuthToObject, - setBearerAuthToObject, - setOAuthToObject, - setSearchParams, - serializeDataIfNeeded, - toPathString, - createRequestFunction, -} from "../common"; -// @ts-ignore -import { - BASE_PATH, - COLLECTION_FORMATS, - RequestArgs, - BaseAPI, - RequiredError, -} from "../base"; -// @ts-ignore -import { ErrorRes } from "../models"; -// @ts-ignore -import { FetchRelevantMints200Response } from "../models"; -/** - * NFTApi - axios parameter creator - * @export - */ -export const NFTApiAxiosParamCreator = function ( - configuration?: Configuration -) { - return { - /** - * Fetches all mint actions relevant for a contract address (and optionally tokenId for ERC1155s) given a user\'s ethereum address - * @summary Relevant Mints for a User - * @param {string} address - * @param {string} contractAddress - * @param {string} [tokenId] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - fetchRelevantMints: async ( - address: string, - contractAddress: string, - tokenId?: string, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'address' is not null or undefined - assertParamExists("fetchRelevantMints", "address", address); - // verify required parameter 'contractAddress' is not null or undefined - assertParamExists( - "fetchRelevantMints", - "contractAddress", - contractAddress - ); - const localVarPath = `/nft/relevant_mints`; - // 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; - - if (address !== undefined) { - localVarQueryParameter["address"] = address; - } - - if (contractAddress !== undefined) { - localVarQueryParameter["contract_address"] = contractAddress; - } - - if (tokenId !== undefined) { - localVarQueryParameter["token_id"] = tokenId; - } - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; -}; - -/** - * NFTApi - functional programming interface - * @export - */ -export const NFTApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = NFTApiAxiosParamCreator(configuration); - return { - /** - * Fetches all mint actions relevant for a contract address (and optionally tokenId for ERC1155s) given a user\'s ethereum address - * @summary Relevant Mints for a User - * @param {string} address - * @param {string} contractAddress - * @param {string} [tokenId] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async fetchRelevantMints( - address: string, - contractAddress: string, - tokenId?: string, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.fetchRelevantMints( - address, - contractAddress, - tokenId, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - }; -}; - -/** - * NFTApi - factory interface - * @export - */ -export const NFTApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance -) { - const localVarFp = NFTApiFp(configuration); - return { - /** - * Fetches all mint actions relevant for a contract address (and optionally tokenId for ERC1155s) given a user\'s ethereum address - * @summary Relevant Mints for a User - * @param {NFTApiGetRelaventMintsRequest} [requestParameters] Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - fetchRelevantMints( - requestParameters: NFTApiGetRelaventMintsRequest, - options?: any - ): AxiosPromise { - return localVarFp - .fetchRelevantMints( - requestParameters.address, - requestParameters.contractAddress, - requestParameters.tokenId, - options - ) - .then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * Request parameters to fetch relevant mints operation in NFTApi. - * @export - * @interface NFTApiGetRelaventMintsRequest - */ -export interface NFTApiGetRelaventMintsRequest { - /** - * Ethereum address - * @type {string} - * @memberof NFTApiGetRelaventMints - */ - readonly address: string; - - /** - * Ethereum address - * @type {string} - * @memberof NFTApiGetRelaventMints - */ - readonly contractAddress: string; - - /** - * @type {string} - * @memberof NFTApiGetRelaventMints - */ - readonly tokenId?: string; -} - -/** - * NFTApi - object-oriented interface - * @export - * @class NFTApi - * @extends {BaseAPI} - */ -export class NFTApi extends BaseAPI { - /** - * Fetches all mint actions relevant for a contract address (and optionally tokenId for ERC1155s) given a user\'s ethereum address - * @summary Relevant Mints for a User - * @param {NFTApiGetRelaventMintsRequest} [requestParameters] Request parameters. - * @param {string} [tokenId] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof NFTApi - */ - public fetchRelevantMints( - requestParameters: NFTApiGetRelaventMintsRequest, - options?: AxiosRequestConfig - ) { - return NFTApiFp(this.configuration) - .fetchRelevantMints( - requestParameters.address, - requestParameters.contractAddress, - requestParameters.tokenId, - options - ) - .then((request) => request(this.axios, this.basePath)); - } -} diff --git a/src/neynar-api/utils/index.ts b/src/neynar-api/utils/index.ts new file mode 100644 index 00000000..2e8cc259 --- /dev/null +++ b/src/neynar-api/utils/index.ts @@ -0,0 +1,2 @@ +export * from "./is-api-error-response"; +export * from "./v1-to-v2-converters"; diff --git a/src/neynar-api/utils.ts b/src/neynar-api/utils/is-api-error-response.ts similarity index 93% rename from src/neynar-api/utils.ts rename to src/neynar-api/utils/is-api-error-response.ts index 70bbe836..7c70f8d9 100644 --- a/src/neynar-api/utils.ts +++ b/src/neynar-api/utils/is-api-error-response.ts @@ -1,5 +1,5 @@ import { AxiosError } from "axios"; -import { ErrorRes } from "./neynar-v1-api"; +import { ErrorRes } from "../v1"; import type { SetRequired } from "type-fest"; /** diff --git a/src/neynar-api/utils/v1-to-v2-converters.ts b/src/neynar-api/utils/v1-to-v2-converters.ts new file mode 100644 index 00000000..a08e714f --- /dev/null +++ b/src/neynar-api/utils/v1-to-v2-converters.ts @@ -0,0 +1,120 @@ +import { + User as IUserV1, + Cast as ICastV1, + CastWithInteractions as ICastWithInteractionsV1, +} from "../v1"; +import { User as IUserV2, ActiveStatus, Cast as ICastV2 } from "../v2"; + +export const convertToV2User = (v1User: IUserV1): IUserV2 => { + const v2User: IUserV2 = { + object: "user", + fid: v1User.fid, + custody_address: v1User.custodyAddress, + username: v1User.username, + display_name: v1User.displayName, + pfp_url: v1User.pfp.url, + profile: { + bio: { + text: v1User.profile.bio.text, + mentioned_profiles: v1User.profile.bio?.mentionedProfiles ?? [], + }, + }, + follower_count: v1User?.followerCount, + following_count: v1User?.followingCount, + verifications: v1User?.verifications, + active_status: + v1User?.activeStatus === "active" + ? ActiveStatus.Active + : ActiveStatus.Inactive, + ...(v1User.viewerContext + ? { + following: v1User.viewerContext.following, + followed_by: v1User.viewerContext.followedBy, + } + : {}), + }; + + return v2User; +}; + +export const convertToV2UserList = (v1Users: IUserV1[]): IUserV2[] => { + const v2Users: IUserV2[] = []; + for (let i = 0; i < v1Users.length; i++) { + const v2User = convertToV2User(v1Users[i]); + v2Users.push(v2User); + } + return v2Users; +}; + +export const convertToV2Cast = ( + v1Cast: ICastV1 | ICastWithInteractionsV1 +): ICastV2 => { + const v2Cast = { + object: "cast_hydrated", + hash: v1Cast.hash, + thread_hash: v1Cast.threadHash, + parent_hash: v1Cast.parentHash, + parent_url: v1Cast.parentUrl ? v1Cast.parentUrl : null, + parent_author: { + fid: v1Cast.parentAuthor.fid, + }, + author: convertToV2User(v1Cast.author as IUserV1), + text: v1Cast.text, + timestamp: v1Cast.timestamp, + embeds: v1Cast.embeds.map((embed) => { + // Currently transformEmbeds is not being used. Leaving it here for now in case we need it later. + // if (embed.castId) { + // return { cast_id: embed.castId }; // changed 'castId' to 'cast_id' + // } else { + // return embed; // If there is no 'castId', return the embed object as is + // } + return embed; + }), + ...((v1Cast as ICastWithInteractionsV1).reactions + ? { + reactions: { + likes: (v1Cast as ICastWithInteractionsV1).reactions?.fids.map( + (fid, idx) => { + return { + fid: fid, + fname: (v1Cast as ICastWithInteractionsV1).reactions?.fnames[ + idx + ], + }; + } + ), + // assuming v1Cast.recasts is an array of fids and v1Cast.recasters is an array of fames + recasts: (v1Cast as ICastWithInteractionsV1).recasts?.fids.map( + (fid, idx) => { + return { + fid: fid, + fname: (v1Cast as ICastWithInteractionsV1).recasters[idx], + }; + } + ), + }, + } + : {}), + ...((v1Cast as ICastWithInteractionsV1).replies + ? { + replies: { + count: (v1Cast as ICastWithInteractionsV1).replies.count, + }, + } + : {}), + mentioned_profiles: convertToV2UserList(v1Cast.mentionedProfiles), + }; + return v2Cast; +}; + +export const convertToV2CastList = ( + v1Casts: ICastV1[] | ICastWithInteractionsV1[] +): ICastV2[] => { + const v2Casts = []; + for (let i = 0; i < v1Casts.length; i++) { + const v1Cast = v1Casts[i]; + const v2Cast = convertToV2Cast(v1Cast); + v2Casts.push(v2Cast); + } + return v2Casts; +}; diff --git a/src/neynar-api/v1/index.ts b/src/neynar-api/v1/index.ts new file mode 100644 index 00000000..7726b59b --- /dev/null +++ b/src/neynar-api/v1/index.ts @@ -0,0 +1,2 @@ +export * from './openapi' +export * from './v1-client' \ No newline at end of file diff --git a/src/neynar-api/neynar-v1-api/openapi/.gitignore b/src/neynar-api/v1/openapi/.gitignore similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/.gitignore rename to src/neynar-api/v1/openapi/.gitignore diff --git a/src/neynar-api/neynar-v1-api/openapi/.npmignore b/src/neynar-api/v1/openapi/.npmignore similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/.npmignore rename to src/neynar-api/v1/openapi/.npmignore diff --git a/src/neynar-api/neynar-v1-api/openapi/.openapi-generator-ignore b/src/neynar-api/v1/openapi/.openapi-generator-ignore similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/.openapi-generator-ignore rename to src/neynar-api/v1/openapi/.openapi-generator-ignore diff --git a/src/neynar-api/neynar-v1-api/openapi/.openapi-generator/FILES b/src/neynar-api/v1/openapi/.openapi-generator/FILES similarity index 89% rename from src/neynar-api/neynar-v1-api/openapi/.openapi-generator/FILES rename to src/neynar-api/v1/openapi/.openapi-generator/FILES index c26a6b56..4f18b991 100644 --- a/src/neynar-api/neynar-v1-api/openapi/.openapi-generator/FILES +++ b/src/neynar-api/v1/openapi/.openapi-generator/FILES @@ -1,5 +1,6 @@ .gitignore .npmignore +.openapi-generator-ignore api.ts apis/cast-api.ts apis/follows-api.ts @@ -19,6 +20,7 @@ models/cast-author-one-of.ts models/cast-author.ts models/cast-likes-response-result.ts models/cast-likes-response.ts +models/cast-parent-author-all-of.ts models/cast-parent-author.ts models/cast-reactions-response-result.ts models/cast-reactions-response.ts @@ -27,6 +29,7 @@ models/cast-recaster-response.ts models/cast-response-result.ts models/cast-response.ts models/cast-type.ts +models/cast-with-interactions-all-of.ts models/cast-with-interactions-reactions-or-recasts.ts models/cast-with-interactions-replies.ts models/cast-with-interactions.ts @@ -38,6 +41,7 @@ models/custody-address-response.ts models/embed-url.ts models/error-res.ts models/follow-response-result.ts +models/follow-response-user-all-of.ts models/follow-response-user.ts models/follow-response.ts models/index.ts @@ -49,6 +53,7 @@ models/reaction-with-cast-meta-cast.ts models/reaction-with-cast-meta-reaction.ts models/reaction-with-cast-meta.ts models/reaction.ts +models/reactions-and-recasts-notification-all-of.ts models/reactions-and-recasts-notification.ts models/reactions-and-recasts-response-result.ts models/reactions-and-recasts-response.ts @@ -68,9 +73,9 @@ models/user-cast-like-response.ts models/user-pfp.ts models/user-profile-bio.ts models/user-profile.ts +models/user-response-result.ts +models/user-response.ts models/user.ts -models/user200-response-result.ts -models/user200-response.ts models/verification-response-result.ts models/verification-response.ts models/viewer-context.ts diff --git a/src/neynar-api/v1/openapi/.openapi-generator/VERSION b/src/neynar-api/v1/openapi/.openapi-generator/VERSION new file mode 100644 index 00000000..cd802a1e --- /dev/null +++ b/src/neynar-api/v1/openapi/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/src/neynar-api/neynar-v1-api/openapi/api.ts b/src/neynar-api/v1/openapi/api.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/api.ts rename to src/neynar-api/v1/openapi/api.ts diff --git a/src/neynar-api/v1/openapi/apis/cast-api.ts b/src/neynar-api/v1/openapi/apis/cast-api.ts new file mode 100644 index 00000000..d5817b0a --- /dev/null +++ b/src/neynar-api/v1/openapi/apis/cast-api.ts @@ -0,0 +1,451 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { AllCastsInThreadResponse } from '../models'; +// @ts-ignore +import { CastResponse } from '../models'; +// @ts-ignore +import { CastsResponse } from '../models'; +// @ts-ignore +import { ErrorRes } from '../models'; +// @ts-ignore +import { RecentCastsResponse } from '../models'; +/** + * CastApi - axios parameter creator + * @export + */ +export const CastApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Gets all casts, including root cast and all replies for a given thread hash. No limit the depth of replies. + * @summary Retrieve all casts in a given thread hash + * @param {string} apiKey API key required for authentication. + * @param {string} threadHash The hash of the thread to retrieve casts from. + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + allCastsInThread: async (apiKey: string, threadHash: string, viewerFid?: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('allCastsInThread', 'apiKey', apiKey) + // verify required parameter 'threadHash' is not null or undefined + assertParamExists('allCastsInThread', 'threadHash', threadHash) + const localVarPath = `/farcaster/all-casts-in-thread`; + // 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; + + if (threadHash !== undefined) { + localVarQueryParameter['threadHash'] = threadHash; + } + + if (viewerFid !== undefined) { + localVarQueryParameter['viewerFid'] = viewerFid; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Gets information about an individual cast + * @summary Retrieve cast for a given hash + * @param {string} apiKey API key required for authentication. + * @param {string} hash Cast hash + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + cast: async (apiKey: string, hash: string, viewerFid?: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('cast', 'apiKey', apiKey) + // verify required parameter 'hash' is not null or undefined + assertParamExists('cast', 'hash', hash) + 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; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (hash !== undefined) { + localVarQueryParameter['hash'] = hash; + } + + if (viewerFid !== undefined) { + localVarQueryParameter['viewerFid'] = viewerFid; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Gets the most recent casts for a user + * @summary Retrieve casts for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {string} [parentUrl] A cast can be part of a certain channel. The channel is identified by `parent_url`. All casts in the channel ladder up to the same parent_url. + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + casts: async (apiKey: string, fid: number, parentUrl?: string, viewerFid?: number, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('casts', 'apiKey', apiKey) + // verify required parameter 'fid' is not null or undefined + assertParamExists('casts', 'fid', fid) + 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; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } + + if (parentUrl !== undefined) { + localVarQueryParameter['parent_url'] = parentUrl; + } + + if (viewerFid !== undefined) { + localVarQueryParameter['viewerFid'] = viewerFid; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Get a list of casts from the protocol in reverse chronological order based on timestamp + * @summary Get Recent Casts + * @param {string} apiKey API key required for authentication. + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 100) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + recentCasts: async (apiKey: string, viewerFid?: number, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('recentCasts', 'apiKey', apiKey) + const localVarPath = `/farcaster/recent-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; + + if (viewerFid !== undefined) { + localVarQueryParameter['viewerFid'] = viewerFid; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * CastApi - functional programming interface + * @export + */ +export const CastApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = CastApiAxiosParamCreator(configuration) + return { + /** + * Gets all casts, including root cast and all replies for a given thread hash. No limit the depth of replies. + * @summary Retrieve all casts in a given thread hash + * @param {string} apiKey API key required for authentication. + * @param {string} threadHash The hash of the thread to retrieve casts from. + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async allCastsInThread(apiKey: string, threadHash: string, viewerFid?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.allCastsInThread(apiKey, threadHash, viewerFid, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Gets information about an individual cast + * @summary Retrieve cast for a given hash + * @param {string} apiKey API key required for authentication. + * @param {string} hash Cast hash + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async cast(apiKey: string, hash: string, viewerFid?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.cast(apiKey, hash, viewerFid, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Gets the most recent casts for a user + * @summary Retrieve casts for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {string} [parentUrl] A cast can be part of a certain channel. The channel is identified by `parent_url`. All casts in the channel ladder up to the same parent_url. + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async casts(apiKey: string, fid: number, parentUrl?: string, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.casts(apiKey, fid, parentUrl, viewerFid, limit, cursor, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Get a list of casts from the protocol in reverse chronological order based on timestamp + * @summary Get Recent Casts + * @param {string} apiKey API key required for authentication. + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 100) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async recentCasts(apiKey: string, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.recentCasts(apiKey, viewerFid, limit, cursor, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * CastApi - factory interface + * @export + */ +export const CastApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = CastApiFp(configuration) + return { + /** + * Gets all casts, including root cast and all replies for a given thread hash. No limit the depth of replies. + * @summary Retrieve all casts in a given thread hash + * @param {string} apiKey API key required for authentication. + * @param {string} threadHash The hash of the thread to retrieve casts from. + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + allCastsInThread(apiKey: string, threadHash: string, viewerFid?: number, options?: any): AxiosPromise { + return localVarFp.allCastsInThread(apiKey, threadHash, viewerFid, options).then((request) => request(axios, basePath)); + }, + /** + * Gets information about an individual cast + * @summary Retrieve cast for a given hash + * @param {string} apiKey API key required for authentication. + * @param {string} hash Cast hash + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + cast(apiKey: string, hash: string, viewerFid?: number, options?: any): AxiosPromise { + return localVarFp.cast(apiKey, hash, viewerFid, options).then((request) => request(axios, basePath)); + }, + /** + * Gets the most recent casts for a user + * @summary Retrieve casts for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {string} [parentUrl] A cast can be part of a certain channel. The channel is identified by `parent_url`. All casts in the channel ladder up to the same parent_url. + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + casts(apiKey: string, fid: number, parentUrl?: string, viewerFid?: number, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.casts(apiKey, fid, parentUrl, viewerFid, limit, cursor, options).then((request) => request(axios, basePath)); + }, + /** + * Get a list of casts from the protocol in reverse chronological order based on timestamp + * @summary Get Recent Casts + * @param {string} apiKey API key required for authentication. + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 100) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + recentCasts(apiKey: string, viewerFid?: number, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.recentCasts(apiKey, viewerFid, limit, cursor, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * CastApi - object-oriented interface + * @export + * @class CastApi + * @extends {BaseAPI} + */ +export class CastApi extends BaseAPI { + /** + * Gets all casts, including root cast and all replies for a given thread hash. No limit the depth of replies. + * @summary Retrieve all casts in a given thread hash + * @param {string} apiKey API key required for authentication. + * @param {string} threadHash The hash of the thread to retrieve casts from. + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CastApi + */ + public allCastsInThread(apiKey: string, threadHash: string, viewerFid?: number, options?: AxiosRequestConfig) { + return CastApiFp(this.configuration).allCastsInThread(apiKey, threadHash, viewerFid, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Gets information about an individual cast + * @summary Retrieve cast for a given hash + * @param {string} apiKey API key required for authentication. + * @param {string} hash Cast hash + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CastApi + */ + public cast(apiKey: string, hash: string, viewerFid?: number, options?: AxiosRequestConfig) { + return CastApiFp(this.configuration).cast(apiKey, hash, viewerFid, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Gets the most recent casts for a user + * @summary Retrieve casts for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {string} [parentUrl] A cast can be part of a certain channel. The channel is identified by `parent_url`. All casts in the channel ladder up to the same parent_url. + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CastApi + */ + public casts(apiKey: string, fid: number, parentUrl?: string, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + return CastApiFp(this.configuration).casts(apiKey, fid, parentUrl, viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Get a list of casts from the protocol in reverse chronological order based on timestamp + * @summary Get Recent Casts + * @param {string} apiKey API key required for authentication. + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 100) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CastApi + */ + public recentCasts(apiKey: string, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + return CastApiFp(this.configuration).recentCasts(apiKey, viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); + } +} diff --git a/src/neynar-api/v1/openapi/apis/follows-api.ts b/src/neynar-api/v1/openapi/apis/follows-api.ts new file mode 100644 index 00000000..604c50f1 --- /dev/null +++ b/src/neynar-api/v1/openapi/apis/follows-api.ts @@ -0,0 +1,271 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { ErrorRes } from '../models'; +// @ts-ignore +import { FollowResponse } from '../models'; +/** + * FollowsApi - axios parameter creator + * @export + */ +export const FollowsApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Gets a list of users who follow a given user in reverse chronological order. + * @summary Gets all followers for a given FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + followers: async (apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('followers', 'apiKey', apiKey) + // verify required parameter 'fid' is not null or undefined + assertParamExists('followers', '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; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } + + if (viewerFid !== undefined) { + localVarQueryParameter['viewerFid'] = viewerFid; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Gets a list of users who is following a given user in reverse chronological order. + * @summary Gets all following users of a FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + following: async (apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('following', 'apiKey', apiKey) + // verify required parameter 'fid' is not null or undefined + assertParamExists('following', '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; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } + + if (viewerFid !== undefined) { + localVarQueryParameter['viewerFid'] = viewerFid; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * FollowsApi - functional programming interface + * @export + */ +export const FollowsApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = FollowsApiAxiosParamCreator(configuration) + return { + /** + * Gets a list of users who follow a given user in reverse chronological order. + * @summary Gets all followers for a given FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async followers(apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.followers(apiKey, fid, viewerFid, limit, cursor, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Gets a list of users who is following a given user in reverse chronological order. + * @summary Gets all following users of a FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async following(apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.following(apiKey, fid, viewerFid, limit, cursor, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * FollowsApi - factory interface + * @export + */ +export const FollowsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = FollowsApiFp(configuration) + return { + /** + * Gets a list of users who follow a given user in reverse chronological order. + * @summary Gets all followers for a given FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + followers(apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.followers(apiKey, fid, viewerFid, limit, cursor, options).then((request) => request(axios, basePath)); + }, + /** + * Gets a list of users who is following a given user in reverse chronological order. + * @summary Gets all following users of a FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + following(apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.following(apiKey, fid, viewerFid, limit, cursor, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * FollowsApi - object-oriented interface + * @export + * @class FollowsApi + * @extends {BaseAPI} + */ +export class FollowsApi extends BaseAPI { + /** + * Gets a list of users who follow a given user in reverse chronological order. + * @summary Gets all followers for a given FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FollowsApi + */ + public followers(apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + return FollowsApiFp(this.configuration).followers(apiKey, fid, viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Gets a list of users who is following a given user in reverse chronological order. + * @summary Gets all following users of a FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FollowsApi + */ + public following(apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + return FollowsApiFp(this.configuration).following(apiKey, fid, viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); + } +} diff --git a/src/neynar-api/v1/openapi/apis/notifications-api.ts b/src/neynar-api/v1/openapi/apis/notifications-api.ts new file mode 100644 index 00000000..8d90e624 --- /dev/null +++ b/src/neynar-api/v1/openapi/apis/notifications-api.ts @@ -0,0 +1,273 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { ErrorRes } from '../models'; +// @ts-ignore +import { MentionsAndRepliesResponse } from '../models'; +// @ts-ignore +import { ReactionsAndRecastsResponse } from '../models'; +/** + * NotificationsApi - axios parameter creator + * @export + */ +export const NotificationsApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Gets a list of mentions and replies to the user’s casts in reverse chronological order + * @summary Get mentions and replies + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + mentionsAndReplies: async (apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('mentionsAndReplies', 'apiKey', apiKey) + // verify required parameter 'fid' is not null or undefined + assertParamExists('mentionsAndReplies', 'fid', fid) + const localVarPath = `/farcaster/mentions-and-replies`; + // 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; + + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } + + if (viewerFid !== undefined) { + localVarQueryParameter['viewerFid'] = viewerFid; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Get a list of reactions and recasts to the users’s casts in reverse chronological order + * @summary Get reactions and recasts + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + reactionsAndRecasts: async (apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('reactionsAndRecasts', 'apiKey', apiKey) + // verify required parameter 'fid' is not null or undefined + assertParamExists('reactionsAndRecasts', 'fid', fid) + const localVarPath = `/farcaster/reactions-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; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } + + if (viewerFid !== undefined) { + localVarQueryParameter['viewerFid'] = viewerFid; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * NotificationsApi - functional programming interface + * @export + */ +export const NotificationsApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = NotificationsApiAxiosParamCreator(configuration) + return { + /** + * Gets a list of mentions and replies to the user’s casts in reverse chronological order + * @summary Get mentions and replies + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async mentionsAndReplies(apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.mentionsAndReplies(apiKey, fid, viewerFid, limit, cursor, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Get a list of reactions and recasts to the users’s casts in reverse chronological order + * @summary Get reactions and recasts + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async reactionsAndRecasts(apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.reactionsAndRecasts(apiKey, fid, viewerFid, limit, cursor, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * NotificationsApi - factory interface + * @export + */ +export const NotificationsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = NotificationsApiFp(configuration) + return { + /** + * Gets a list of mentions and replies to the user’s casts in reverse chronological order + * @summary Get mentions and replies + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + mentionsAndReplies(apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.mentionsAndReplies(apiKey, fid, viewerFid, limit, cursor, options).then((request) => request(axios, basePath)); + }, + /** + * Get a list of reactions and recasts to the users’s casts in reverse chronological order + * @summary Get reactions and recasts + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + reactionsAndRecasts(apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.reactionsAndRecasts(apiKey, fid, viewerFid, limit, cursor, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * NotificationsApi - object-oriented interface + * @export + * @class NotificationsApi + * @extends {BaseAPI} + */ +export class NotificationsApi extends BaseAPI { + /** + * Gets a list of mentions and replies to the user’s casts in reverse chronological order + * @summary Get mentions and replies + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationsApi + */ + public mentionsAndReplies(apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + return NotificationsApiFp(this.configuration).mentionsAndReplies(apiKey, fid, viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Get a list of reactions and recasts to the users’s casts in reverse chronological order + * @summary Get reactions and recasts + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationsApi + */ + public reactionsAndRecasts(apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + return NotificationsApiFp(this.configuration).reactionsAndRecasts(apiKey, fid, viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); + } +} diff --git a/src/neynar-api/v1/openapi/apis/reactions-api.ts b/src/neynar-api/v1/openapi/apis/reactions-api.ts new file mode 100644 index 00000000..c0d95e51 --- /dev/null +++ b/src/neynar-api/v1/openapi/apis/reactions-api.ts @@ -0,0 +1,379 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { CastLikesResponse } from '../models'; +// @ts-ignore +import { CastReactionsResponse } from '../models'; +// @ts-ignore +import { CastRecasterResponse } from '../models'; +// @ts-ignore +import { ErrorRes } from '../models'; +/** + * ReactionsApi - axios parameter creator + * @export + */ +export const ReactionsApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Get all like reactions for a specific cast in reverse chronological order. + * @summary Get all like reactions for a specific cast + * @param {string} apiKey API key required for authentication. + * @param {string} castHash Cast hash + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + castLikes: async (apiKey: string, castHash: string, viewerFid?: number, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('castLikes', 'apiKey', apiKey) + // verify required parameter 'castHash' is not null or undefined + assertParamExists('castLikes', 'castHash', castHash) + const localVarPath = `/farcaster/cast-likes`; + // 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; + + if (castHash !== undefined) { + localVarQueryParameter['castHash'] = castHash; + } + + if (viewerFid !== undefined) { + localVarQueryParameter['viewerFid'] = viewerFid; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Get all reactions (likes and recasts) for a specific cast. + * @summary Get all reactions for a specific cast + * @param {string} apiKey API key required for authentication. + * @param {string} castHash Cast hash + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + castReactions: async (apiKey: string, castHash: string, viewerFid?: number, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('castReactions', 'apiKey', apiKey) + // verify required parameter 'castHash' is not null or undefined + assertParamExists('castReactions', 'castHash', castHash) + const localVarPath = `/farcaster/cast-reactions`; + // 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; + + if (castHash !== undefined) { + localVarQueryParameter['castHash'] = castHash; + } + + if (viewerFid !== undefined) { + localVarQueryParameter['viewerFid'] = viewerFid; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Get all recasters for a specific cast. + * @summary Get all recasters for a specific cast + * @param {string} apiKey API key required for authentication. + * @param {string} castHash Cast hash + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + castRecasters: async (apiKey: string, castHash: string, viewerFid?: number, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('castRecasters', 'apiKey', apiKey) + // verify required parameter 'castHash' is not null or undefined + assertParamExists('castRecasters', 'castHash', castHash) + const localVarPath = `/farcaster/cast-recasters`; + // 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; + + if (castHash !== undefined) { + localVarQueryParameter['castHash'] = castHash; + } + + if (viewerFid !== undefined) { + localVarQueryParameter['viewerFid'] = viewerFid; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * ReactionsApi - functional programming interface + * @export + */ +export const ReactionsApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = ReactionsApiAxiosParamCreator(configuration) + return { + /** + * Get all like reactions for a specific cast in reverse chronological order. + * @summary Get all like reactions for a specific cast + * @param {string} apiKey API key required for authentication. + * @param {string} castHash Cast hash + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async castLikes(apiKey: string, castHash: string, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.castLikes(apiKey, castHash, viewerFid, limit, cursor, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Get all reactions (likes and recasts) for a specific cast. + * @summary Get all reactions for a specific cast + * @param {string} apiKey API key required for authentication. + * @param {string} castHash Cast hash + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async castReactions(apiKey: string, castHash: string, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.castReactions(apiKey, castHash, viewerFid, limit, cursor, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Get all recasters for a specific cast. + * @summary Get all recasters for a specific cast + * @param {string} apiKey API key required for authentication. + * @param {string} castHash Cast hash + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async castRecasters(apiKey: string, castHash: string, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.castRecasters(apiKey, castHash, viewerFid, limit, cursor, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * ReactionsApi - factory interface + * @export + */ +export const ReactionsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = ReactionsApiFp(configuration) + return { + /** + * Get all like reactions for a specific cast in reverse chronological order. + * @summary Get all like reactions for a specific cast + * @param {string} apiKey API key required for authentication. + * @param {string} castHash Cast hash + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + castLikes(apiKey: string, castHash: string, viewerFid?: number, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.castLikes(apiKey, castHash, viewerFid, limit, cursor, options).then((request) => request(axios, basePath)); + }, + /** + * Get all reactions (likes and recasts) for a specific cast. + * @summary Get all reactions for a specific cast + * @param {string} apiKey API key required for authentication. + * @param {string} castHash Cast hash + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + castReactions(apiKey: string, castHash: string, viewerFid?: number, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.castReactions(apiKey, castHash, viewerFid, limit, cursor, options).then((request) => request(axios, basePath)); + }, + /** + * Get all recasters for a specific cast. + * @summary Get all recasters for a specific cast + * @param {string} apiKey API key required for authentication. + * @param {string} castHash Cast hash + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + castRecasters(apiKey: string, castHash: string, viewerFid?: number, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.castRecasters(apiKey, castHash, viewerFid, limit, cursor, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * ReactionsApi - object-oriented interface + * @export + * @class ReactionsApi + * @extends {BaseAPI} + */ +export class ReactionsApi extends BaseAPI { + /** + * Get all like reactions for a specific cast in reverse chronological order. + * @summary Get all like reactions for a specific cast + * @param {string} apiKey API key required for authentication. + * @param {string} castHash Cast hash + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ReactionsApi + */ + public castLikes(apiKey: string, castHash: string, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + return ReactionsApiFp(this.configuration).castLikes(apiKey, castHash, viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Get all reactions (likes and recasts) for a specific cast. + * @summary Get all reactions for a specific cast + * @param {string} apiKey API key required for authentication. + * @param {string} castHash Cast hash + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ReactionsApi + */ + public castReactions(apiKey: string, castHash: string, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + return ReactionsApiFp(this.configuration).castReactions(apiKey, castHash, viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Get all recasters for a specific cast. + * @summary Get all recasters for a specific cast + * @param {string} apiKey API key required for authentication. + * @param {string} castHash Cast hash + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ReactionsApi + */ + public castRecasters(apiKey: string, castHash: string, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + return ReactionsApiFp(this.configuration).castRecasters(apiKey, castHash, viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); + } +} diff --git a/src/neynar-api/v1/openapi/apis/user-api.ts b/src/neynar-api/v1/openapi/apis/user-api.ts new file mode 100644 index 00000000..64586360 --- /dev/null +++ b/src/neynar-api/v1/openapi/apis/user-api.ts @@ -0,0 +1,523 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { CustodyAddressResponse } from '../models'; +// @ts-ignore +import { ErrorRes } from '../models'; +// @ts-ignore +import { RecentUsersResponse } from '../models'; +// @ts-ignore +import { UserCastLikeResponse } from '../models'; +// @ts-ignore +import { UserResponse } from '../models'; +/** + * UserApi - axios parameter creator + * @export + */ +export const UserApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Returns the custody address for a given FID + * @summary Get the custody address for a given FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + custodyAddress: async (apiKey: string, fid: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('custodyAddress', 'apiKey', apiKey) + // verify required parameter 'fid' is not null or undefined + assertParamExists('custodyAddress', 'fid', fid) + const localVarPath = `/farcaster/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; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Get a list of casts from the protocol in reverse chronological order based on timestamp + * @summary Get Recent Users + * @param {string} apiKey API key required for authentication. + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 100, max 1000) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + recentUsers: async (apiKey: string, viewerFid?: number, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('recentUsers', 'apiKey', apiKey) + const localVarPath = `/farcaster/recent-users`; + // 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; + + if (viewerFid !== undefined) { + localVarQueryParameter['viewerFid'] = viewerFid; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns metadata about a specific user + * @summary Get User Information by FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + user: async (apiKey: string, fid: number, viewerFid?: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('user', 'apiKey', apiKey) + // verify required parameter 'fid' is not null or undefined + assertParamExists('user', 'fid', fid) + 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; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } + + if (viewerFid !== undefined) { + localVarQueryParameter['viewerFid'] = viewerFid; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns metadata about a specific user + * @summary Get User Information by username + * @param {string} apiKey API key required for authentication. + * @param {string} username Username of the user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userByUsername: async (apiKey: string, username: string, viewerFid?: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('userByUsername', 'apiKey', apiKey) + // verify required parameter 'username' is not null or undefined + assertParamExists('userByUsername', '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; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (username !== undefined) { + localVarQueryParameter['username'] = username; + } + + if (viewerFid !== undefined) { + localVarQueryParameter['viewerFid'] = viewerFid; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Fetch all the liked cast of a User + * @summary Get User Cast Likes + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userCastLikes: async (apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('userCastLikes', 'apiKey', apiKey) + // verify required parameter 'fid' is not null or undefined + assertParamExists('userCastLikes', 'fid', fid) + const localVarPath = `/farcaster/user-cast-likes`; + // 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; + + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } + + if (viewerFid !== undefined) { + localVarQueryParameter['viewerFid'] = viewerFid; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * UserApi - functional programming interface + * @export + */ +export const UserApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = UserApiAxiosParamCreator(configuration) + return { + /** + * Returns the custody address for a given FID + * @summary Get the custody address for a given FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async custodyAddress(apiKey: string, fid: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.custodyAddress(apiKey, fid, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Get a list of casts from the protocol in reverse chronological order based on timestamp + * @summary Get Recent Users + * @param {string} apiKey API key required for authentication. + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 100, max 1000) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async recentUsers(apiKey: string, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.recentUsers(apiKey, viewerFid, limit, cursor, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns metadata about a specific user + * @summary Get User Information by FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async user(apiKey: string, fid: number, viewerFid?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.user(apiKey, fid, viewerFid, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns metadata about a specific user + * @summary Get User Information by username + * @param {string} apiKey API key required for authentication. + * @param {string} username Username of the user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async userByUsername(apiKey: string, username: string, viewerFid?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.userByUsername(apiKey, username, viewerFid, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Fetch all the liked cast of a User + * @summary Get User Cast Likes + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async userCastLikes(apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.userCastLikes(apiKey, fid, viewerFid, limit, cursor, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * UserApi - factory interface + * @export + */ +export const UserApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = UserApiFp(configuration) + return { + /** + * Returns the custody address for a given FID + * @summary Get the custody address for a given FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + custodyAddress(apiKey: string, fid: number, options?: any): AxiosPromise { + return localVarFp.custodyAddress(apiKey, fid, options).then((request) => request(axios, basePath)); + }, + /** + * Get a list of casts from the protocol in reverse chronological order based on timestamp + * @summary Get Recent Users + * @param {string} apiKey API key required for authentication. + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 100, max 1000) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + recentUsers(apiKey: string, viewerFid?: number, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.recentUsers(apiKey, viewerFid, limit, cursor, options).then((request) => request(axios, basePath)); + }, + /** + * Returns metadata about a specific user + * @summary Get User Information by FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + user(apiKey: string, fid: number, viewerFid?: number, options?: any): AxiosPromise { + return localVarFp.user(apiKey, fid, viewerFid, options).then((request) => request(axios, basePath)); + }, + /** + * Returns metadata about a specific user + * @summary Get User Information by username + * @param {string} apiKey API key required for authentication. + * @param {string} username Username of the user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userByUsername(apiKey: string, username: string, viewerFid?: number, options?: any): AxiosPromise { + return localVarFp.userByUsername(apiKey, username, viewerFid, options).then((request) => request(axios, basePath)); + }, + /** + * Fetch all the liked cast of a User + * @summary Get User Cast Likes + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userCastLikes(apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.userCastLikes(apiKey, fid, viewerFid, limit, cursor, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * UserApi - object-oriented interface + * @export + * @class UserApi + * @extends {BaseAPI} + */ +export class UserApi extends BaseAPI { + /** + * Returns the custody address for a given FID + * @summary Get the custody address for a given FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public custodyAddress(apiKey: string, fid: number, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).custodyAddress(apiKey, fid, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Get a list of casts from the protocol in reverse chronological order based on timestamp + * @summary Get Recent Users + * @param {string} apiKey API key required for authentication. + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 100, max 1000) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public recentUsers(apiKey: string, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).recentUsers(apiKey, viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns metadata about a specific user + * @summary Get User Information by FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public user(apiKey: string, fid: number, viewerFid?: number, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).user(apiKey, fid, viewerFid, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns metadata about a specific user + * @summary Get User Information by username + * @param {string} apiKey API key required for authentication. + * @param {string} username Username of the user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public userByUsername(apiKey: string, username: string, viewerFid?: number, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).userByUsername(apiKey, username, viewerFid, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Fetch all the liked cast of a User + * @summary Get User Cast Likes + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public userCastLikes(apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).userCastLikes(apiKey, fid, viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); + } +} diff --git a/src/neynar-api/v1/openapi/apis/verification-api.ts b/src/neynar-api/v1/openapi/apis/verification-api.ts new file mode 100644 index 00000000..2ad079c6 --- /dev/null +++ b/src/neynar-api/v1/openapi/apis/verification-api.ts @@ -0,0 +1,225 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { ErrorRes } from '../models'; +// @ts-ignore +import { UserResponse } from '../models'; +// @ts-ignore +import { VerificationResponse } from '../models'; +/** + * VerificationApi - axios parameter creator + * @export + */ +export const VerificationApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Checks if a given Ethereum address has a Farcaster user associated with it. Note: if an address is associated with multiple users, the API will return the user who most recently published a verification with the address (based on when Warpcast received the proof, not a self-reported timestamp). + * @summary Retrieve user for a given ethereum address + * @param {string} apiKey API key required for authentication. + * @param {string} address + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userByVerification: async (apiKey: string, address: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('userByVerification', 'apiKey', apiKey) + // verify required parameter 'address' is not null or undefined + assertParamExists('userByVerification', 'address', address) + const localVarPath = `/farcaster/user-by-verification`; + // 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; + + if (address !== undefined) { + localVarQueryParameter['address'] = address; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Get all known verifications of a user + * @summary Retrieve verifications for a given FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + verifications: async (apiKey: string, fid: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('verifications', 'apiKey', apiKey) + // verify required parameter 'fid' is not null or undefined + assertParamExists('verifications', 'fid', fid) + const localVarPath = `/farcaster/verifications`; + // 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; + + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * VerificationApi - functional programming interface + * @export + */ +export const VerificationApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = VerificationApiAxiosParamCreator(configuration) + return { + /** + * Checks if a given Ethereum address has a Farcaster user associated with it. Note: if an address is associated with multiple users, the API will return the user who most recently published a verification with the address (based on when Warpcast received the proof, not a self-reported timestamp). + * @summary Retrieve user for a given ethereum address + * @param {string} apiKey API key required for authentication. + * @param {string} address + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async userByVerification(apiKey: string, address: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.userByVerification(apiKey, address, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Get all known verifications of a user + * @summary Retrieve verifications for a given FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async verifications(apiKey: string, fid: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.verifications(apiKey, fid, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * VerificationApi - factory interface + * @export + */ +export const VerificationApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = VerificationApiFp(configuration) + return { + /** + * Checks if a given Ethereum address has a Farcaster user associated with it. Note: if an address is associated with multiple users, the API will return the user who most recently published a verification with the address (based on when Warpcast received the proof, not a self-reported timestamp). + * @summary Retrieve user for a given ethereum address + * @param {string} apiKey API key required for authentication. + * @param {string} address + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userByVerification(apiKey: string, address: string, options?: any): AxiosPromise { + return localVarFp.userByVerification(apiKey, address, options).then((request) => request(axios, basePath)); + }, + /** + * Get all known verifications of a user + * @summary Retrieve verifications for a given FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + verifications(apiKey: string, fid: number, options?: any): AxiosPromise { + return localVarFp.verifications(apiKey, fid, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * VerificationApi - object-oriented interface + * @export + * @class VerificationApi + * @extends {BaseAPI} + */ +export class VerificationApi extends BaseAPI { + /** + * Checks if a given Ethereum address has a Farcaster user associated with it. Note: if an address is associated with multiple users, the API will return the user who most recently published a verification with the address (based on when Warpcast received the proof, not a self-reported timestamp). + * @summary Retrieve user for a given ethereum address + * @param {string} apiKey API key required for authentication. + * @param {string} address + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VerificationApi + */ + public userByVerification(apiKey: string, address: string, options?: AxiosRequestConfig) { + return VerificationApiFp(this.configuration).userByVerification(apiKey, address, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Get all known verifications of a user + * @summary Retrieve verifications for a given FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VerificationApi + */ + public verifications(apiKey: string, fid: number, options?: AxiosRequestConfig) { + return VerificationApiFp(this.configuration).verifications(apiKey, fid, options).then((request) => request(this.axios, this.basePath)); + } +} diff --git a/src/neynar-api/neynar-v1-api/openapi/base.ts b/src/neynar-api/v1/openapi/base.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/base.ts rename to src/neynar-api/v1/openapi/base.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/common.ts b/src/neynar-api/v1/openapi/common.ts similarity index 98% rename from src/neynar-api/neynar-v1-api/openapi/common.ts rename to src/neynar-api/v1/openapi/common.ts index fb93d99d..9f95c6b1 100644 --- a/src/neynar-api/neynar-v1-api/openapi/common.ts +++ b/src/neynar-api/v1/openapi/common.ts @@ -144,7 +144,7 @@ export const toPathString = function (url: URL) { */ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || axios.defaults.baseURL || basePath) + axiosArgs.url}; + const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; return axios.request(axiosRequestArgs); }; } diff --git a/src/neynar-api/neynar-v1-api/openapi/configuration.ts b/src/neynar-api/v1/openapi/configuration.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/configuration.ts rename to src/neynar-api/v1/openapi/configuration.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/git_push.sh b/src/neynar-api/v1/openapi/git_push.sh similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/git_push.sh rename to src/neynar-api/v1/openapi/git_push.sh diff --git a/src/neynar-api/neynar-v1-api/openapi/index.ts b/src/neynar-api/v1/openapi/index.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/index.ts rename to src/neynar-api/v1/openapi/index.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/active-status.ts b/src/neynar-api/v1/openapi/models/active-status.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/active-status.ts rename to src/neynar-api/v1/openapi/models/active-status.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/all-casts-in-thread-response-result.ts b/src/neynar-api/v1/openapi/models/all-casts-in-thread-response-result.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/all-casts-in-thread-response-result.ts rename to src/neynar-api/v1/openapi/models/all-casts-in-thread-response-result.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/all-casts-in-thread-response.ts b/src/neynar-api/v1/openapi/models/all-casts-in-thread-response.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/all-casts-in-thread-response.ts rename to src/neynar-api/v1/openapi/models/all-casts-in-thread-response.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast-author-one-of.ts b/src/neynar-api/v1/openapi/models/cast-author-one-of.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/cast-author-one-of.ts rename to src/neynar-api/v1/openapi/models/cast-author-one-of.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast-author.ts b/src/neynar-api/v1/openapi/models/cast-author.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/cast-author.ts rename to src/neynar-api/v1/openapi/models/cast-author.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast-likes-response-result.ts b/src/neynar-api/v1/openapi/models/cast-likes-response-result.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/cast-likes-response-result.ts rename to src/neynar-api/v1/openapi/models/cast-likes-response-result.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast-likes-response.ts b/src/neynar-api/v1/openapi/models/cast-likes-response.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/cast-likes-response.ts rename to src/neynar-api/v1/openapi/models/cast-likes-response.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast-parent-author.ts b/src/neynar-api/v1/openapi/models/cast-parent-author-all-of.ts similarity index 81% rename from src/neynar-api/neynar-v1-api/openapi/models/cast-parent-author.ts rename to src/neynar-api/v1/openapi/models/cast-parent-author-all-of.ts index ac6043a0..9b0b1260 100644 --- a/src/neynar-api/neynar-v1-api/openapi/models/cast-parent-author.ts +++ b/src/neynar-api/v1/openapi/models/cast-parent-author-all-of.ts @@ -17,13 +17,13 @@ /** * * @export - * @interface CastParentAuthor + * @interface CastParentAuthorAllOf */ -export interface CastParentAuthor { +export interface CastParentAuthorAllOf { /** * * @type {string} - * @memberof CastParentAuthor + * @memberof CastParentAuthorAllOf */ 'fid': string | null; } diff --git a/src/neynar-api/v1/openapi/models/cast-parent-author.ts b/src/neynar-api/v1/openapi/models/cast-parent-author.ts new file mode 100644 index 00000000..d22b30d5 --- /dev/null +++ b/src/neynar-api/v1/openapi/models/cast-parent-author.ts @@ -0,0 +1,26 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.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 { CastParentAuthorAllOf } from './cast-parent-author-all-of'; + +/** + * @type CastParentAuthor + * @export + */ +export type CastParentAuthor = CastParentAuthorAllOf; + + diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast-reactions-response-result.ts b/src/neynar-api/v1/openapi/models/cast-reactions-response-result.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/cast-reactions-response-result.ts rename to src/neynar-api/v1/openapi/models/cast-reactions-response-result.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast-reactions-response.ts b/src/neynar-api/v1/openapi/models/cast-reactions-response.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/cast-reactions-response.ts rename to src/neynar-api/v1/openapi/models/cast-reactions-response.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast-recaster-response-result.ts b/src/neynar-api/v1/openapi/models/cast-recaster-response-result.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/cast-recaster-response-result.ts rename to src/neynar-api/v1/openapi/models/cast-recaster-response-result.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast-recaster-response.ts b/src/neynar-api/v1/openapi/models/cast-recaster-response.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/cast-recaster-response.ts rename to src/neynar-api/v1/openapi/models/cast-recaster-response.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast-response-result.ts b/src/neynar-api/v1/openapi/models/cast-response-result.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/cast-response-result.ts rename to src/neynar-api/v1/openapi/models/cast-response-result.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast-response.ts b/src/neynar-api/v1/openapi/models/cast-response.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/cast-response.ts rename to src/neynar-api/v1/openapi/models/cast-response.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast-type.ts b/src/neynar-api/v1/openapi/models/cast-type.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/cast-type.ts rename to src/neynar-api/v1/openapi/models/cast-type.ts diff --git a/src/neynar-api/v1/openapi/models/cast-with-interactions-all-of.ts b/src/neynar-api/v1/openapi/models/cast-with-interactions-all-of.ts new file mode 100644 index 00000000..364796b1 --- /dev/null +++ b/src/neynar-api/v1/openapi/models/cast-with-interactions-all-of.ts @@ -0,0 +1,63 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.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 { CastWithInteractionsReactionsOrRecasts } from './cast-with-interactions-reactions-or-recasts'; +// May contain unused imports in some cases +// @ts-ignore +import { CastWithInteractionsReplies } from './cast-with-interactions-replies'; +// May contain unused imports in some cases +// @ts-ignore +import { ViewerContext } from './viewer-context'; + +/** + * + * @export + * @interface CastWithInteractionsAllOf + */ +export interface CastWithInteractionsAllOf { + /** + * + * @type {CastWithInteractionsReactionsOrRecasts} + * @memberof CastWithInteractionsAllOf + */ + 'reactions': CastWithInteractionsReactionsOrRecasts; + /** + * + * @type {CastWithInteractionsReactionsOrRecasts} + * @memberof CastWithInteractionsAllOf + */ + 'recasts': CastWithInteractionsReactionsOrRecasts; + /** + * + * @type {Array} + * @memberof CastWithInteractionsAllOf + */ + 'recasters': Array; + /** + * + * @type {ViewerContext} + * @memberof CastWithInteractionsAllOf + */ + 'viewerContext'?: ViewerContext; + /** + * + * @type {CastWithInteractionsReplies} + * @memberof CastWithInteractionsAllOf + */ + 'replies': CastWithInteractionsReplies; +} + diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast-with-interactions-reactions-or-recasts.ts b/src/neynar-api/v1/openapi/models/cast-with-interactions-reactions-or-recasts.ts similarity index 85% rename from src/neynar-api/neynar-v1-api/openapi/models/cast-with-interactions-reactions-or-recasts.ts rename to src/neynar-api/v1/openapi/models/cast-with-interactions-reactions-or-recasts.ts index 4d1b5e58..504be372 100644 --- a/src/neynar-api/neynar-v1-api/openapi/models/cast-with-interactions-reactions-or-recasts.ts +++ b/src/neynar-api/v1/openapi/models/cast-with-interactions-reactions-or-recasts.ts @@ -32,5 +32,11 @@ export interface CastWithInteractionsReactionsOrRecasts { * @memberof CastWithInteractionsReactionsOrRecasts */ 'fids': Array; + /** + * + * @type {Array} + * @memberof CastWithInteractionsReactionsOrRecasts + */ + 'fnames': Array; } diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast-with-interactions-replies.ts b/src/neynar-api/v1/openapi/models/cast-with-interactions-replies.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/cast-with-interactions-replies.ts rename to src/neynar-api/v1/openapi/models/cast-with-interactions-replies.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast-with-interactions.ts b/src/neynar-api/v1/openapi/models/cast-with-interactions.ts similarity index 82% rename from src/neynar-api/neynar-v1-api/openapi/models/cast-with-interactions.ts rename to src/neynar-api/v1/openapi/models/cast-with-interactions.ts index 066614e0..ebef2f7f 100644 --- a/src/neynar-api/neynar-v1-api/openapi/models/cast-with-interactions.ts +++ b/src/neynar-api/v1/openapi/models/cast-with-interactions.ts @@ -27,6 +27,9 @@ import { CastParentAuthor } from './cast-parent-author'; import { CastType } from './cast-type'; // May contain unused imports in some cases // @ts-ignore +import { CastWithInteractionsAllOf } from './cast-with-interactions-all-of'; +// May contain unused imports in some cases +// @ts-ignore import { CastWithInteractionsReactionsOrRecasts } from './cast-with-interactions-reactions-or-recasts'; // May contain unused imports in some cases // @ts-ignore @@ -36,12 +39,15 @@ import { CastWithInteractionsReplies } from './cast-with-interactions-replies'; import { EmbedUrl } from './embed-url'; // May contain unused imports in some cases // @ts-ignore +import { User } from './user'; +// May contain unused imports in some cases +// @ts-ignore import { ViewerContext } from './viewer-context'; /** * @type CastWithInteractions * @export */ -export type CastWithInteractions = Cast; +export type CastWithInteractions = Cast & CastWithInteractionsAllOf; diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast.ts b/src/neynar-api/v1/openapi/models/cast.ts similarity index 85% rename from src/neynar-api/neynar-v1-api/openapi/models/cast.ts rename to src/neynar-api/v1/openapi/models/cast.ts index 8237c697..a67218d5 100644 --- a/src/neynar-api/neynar-v1-api/openapi/models/cast.ts +++ b/src/neynar-api/v1/openapi/models/cast.ts @@ -25,6 +25,9 @@ import { CastType } from './cast-type'; // May contain unused imports in some cases // @ts-ignore import { EmbedUrl } from './embed-url'; +// May contain unused imports in some cases +// @ts-ignore +import { User } from './user'; /** * @@ -50,12 +53,24 @@ export interface Cast { * @memberof Cast */ 'parentUrl': string | null; + /** + * + * @type {string} + * @memberof Cast + */ + 'threadHash': string; /** * * @type {CastParentAuthor} * @memberof Cast */ 'parentAuthor': CastParentAuthor; + /** + * + * @type {Array} + * @memberof Cast + */ + 'mentionedProfiles': Array; /** * * @type {CastAuthor} diff --git a/src/neynar-api/neynar-v1-api/openapi/models/casts-response-result.ts b/src/neynar-api/v1/openapi/models/casts-response-result.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/casts-response-result.ts rename to src/neynar-api/v1/openapi/models/casts-response-result.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/casts-response.ts b/src/neynar-api/v1/openapi/models/casts-response.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/casts-response.ts rename to src/neynar-api/v1/openapi/models/casts-response.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/custody-address-response-result.ts b/src/neynar-api/v1/openapi/models/custody-address-response-result.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/custody-address-response-result.ts rename to src/neynar-api/v1/openapi/models/custody-address-response-result.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/custody-address-response.ts b/src/neynar-api/v1/openapi/models/custody-address-response.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/custody-address-response.ts rename to src/neynar-api/v1/openapi/models/custody-address-response.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/embed-url.ts b/src/neynar-api/v1/openapi/models/embed-url.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/embed-url.ts rename to src/neynar-api/v1/openapi/models/embed-url.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/error-res.ts b/src/neynar-api/v1/openapi/models/error-res.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/error-res.ts rename to src/neynar-api/v1/openapi/models/error-res.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/follow-response-result.ts b/src/neynar-api/v1/openapi/models/follow-response-result.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/follow-response-result.ts rename to src/neynar-api/v1/openapi/models/follow-response-result.ts diff --git a/src/neynar-api/v1/openapi/models/follow-response-user-all-of.ts b/src/neynar-api/v1/openapi/models/follow-response-user-all-of.ts new file mode 100644 index 00000000..4463d719 --- /dev/null +++ b/src/neynar-api/v1/openapi/models/follow-response-user-all-of.ts @@ -0,0 +1,30 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface FollowResponseUserAllOf + */ +export interface FollowResponseUserAllOf { + /** + * + * @type {string} + * @memberof FollowResponseUserAllOf + */ + 'timestamp': string; +} + diff --git a/src/neynar-api/neynar-v1-api/openapi/models/follow-response-user.ts b/src/neynar-api/v1/openapi/models/follow-response-user.ts similarity index 82% rename from src/neynar-api/neynar-v1-api/openapi/models/follow-response-user.ts rename to src/neynar-api/v1/openapi/models/follow-response-user.ts index ddb0eba2..cb8aac39 100644 --- a/src/neynar-api/neynar-v1-api/openapi/models/follow-response-user.ts +++ b/src/neynar-api/v1/openapi/models/follow-response-user.ts @@ -18,6 +18,9 @@ import { ActiveStatus } from './active-status'; // May contain unused imports in some cases // @ts-ignore +import { FollowResponseUserAllOf } from './follow-response-user-all-of'; +// May contain unused imports in some cases +// @ts-ignore import { User } from './user'; // May contain unused imports in some cases // @ts-ignore @@ -33,6 +36,6 @@ import { ViewerContext } from './viewer-context'; * @type FollowResponseUser * @export */ -export type FollowResponseUser = User; +export type FollowResponseUser = FollowResponseUserAllOf & User; diff --git a/src/neynar-api/neynar-v1-api/openapi/models/follow-response.ts b/src/neynar-api/v1/openapi/models/follow-response.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/follow-response.ts rename to src/neynar-api/v1/openapi/models/follow-response.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/index.ts b/src/neynar-api/v1/openapi/models/index.ts similarity index 89% rename from src/neynar-api/neynar-v1-api/openapi/models/index.ts rename to src/neynar-api/v1/openapi/models/index.ts index 872d3c83..63f1f1e4 100644 --- a/src/neynar-api/neynar-v1-api/openapi/models/index.ts +++ b/src/neynar-api/v1/openapi/models/index.ts @@ -7,6 +7,7 @@ export * from './cast-author-one-of'; export * from './cast-likes-response'; export * from './cast-likes-response-result'; export * from './cast-parent-author'; +export * from './cast-parent-author-all-of'; export * from './cast-reactions-response'; export * from './cast-reactions-response-result'; export * from './cast-recaster-response'; @@ -15,6 +16,7 @@ export * from './cast-response'; export * from './cast-response-result'; export * from './cast-type'; export * from './cast-with-interactions'; +export * from './cast-with-interactions-all-of'; export * from './cast-with-interactions-reactions-or-recasts'; export * from './cast-with-interactions-replies'; export * from './casts-response'; @@ -26,6 +28,7 @@ export * from './error-res'; export * from './follow-response'; export * from './follow-response-result'; export * from './follow-response-user'; +export * from './follow-response-user-all-of'; export * from './mentions-and-replies-response'; export * from './mentions-and-replies-response-result'; export * from './next-cursor'; @@ -35,6 +38,7 @@ export * from './reaction-with-cast-meta'; export * from './reaction-with-cast-meta-cast'; export * from './reaction-with-cast-meta-reaction'; export * from './reactions-and-recasts-notification'; +export * from './reactions-and-recasts-notification-all-of'; export * from './reactions-and-recasts-response'; export * from './reactions-and-recasts-response-result'; export * from './reactor'; @@ -49,13 +53,13 @@ export * from './recent-casts-response'; export * from './recent-users-response'; export * from './recent-users-response-result'; export * from './user'; -export * from './user200-response'; -export * from './user200-response-result'; export * from './user-cast-like-response'; export * from './user-cast-like-response-result'; export * from './user-pfp'; export * from './user-profile'; export * from './user-profile-bio'; +export * from './user-response'; +export * from './user-response-result'; export * from './verification-response'; export * from './verification-response-result'; export * from './viewer-context'; diff --git a/src/neynar-api/neynar-v1-api/openapi/models/mentions-and-replies-response-result.ts b/src/neynar-api/v1/openapi/models/mentions-and-replies-response-result.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/mentions-and-replies-response-result.ts rename to src/neynar-api/v1/openapi/models/mentions-and-replies-response-result.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/mentions-and-replies-response.ts b/src/neynar-api/v1/openapi/models/mentions-and-replies-response.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/mentions-and-replies-response.ts rename to src/neynar-api/v1/openapi/models/mentions-and-replies-response.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/next-cursor.ts b/src/neynar-api/v1/openapi/models/next-cursor.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/next-cursor.ts rename to src/neynar-api/v1/openapi/models/next-cursor.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/reaction-type.ts b/src/neynar-api/v1/openapi/models/reaction-type.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/reaction-type.ts rename to src/neynar-api/v1/openapi/models/reaction-type.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/reaction-with-cast-meta-cast.ts b/src/neynar-api/v1/openapi/models/reaction-with-cast-meta-cast.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/reaction-with-cast-meta-cast.ts rename to src/neynar-api/v1/openapi/models/reaction-with-cast-meta-cast.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/reaction-with-cast-meta-reaction.ts b/src/neynar-api/v1/openapi/models/reaction-with-cast-meta-reaction.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/reaction-with-cast-meta-reaction.ts rename to src/neynar-api/v1/openapi/models/reaction-with-cast-meta-reaction.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/reaction-with-cast-meta.ts b/src/neynar-api/v1/openapi/models/reaction-with-cast-meta.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/reaction-with-cast-meta.ts rename to src/neynar-api/v1/openapi/models/reaction-with-cast-meta.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/reaction.ts b/src/neynar-api/v1/openapi/models/reaction.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/reaction.ts rename to src/neynar-api/v1/openapi/models/reaction.ts diff --git a/src/neynar-api/v1/openapi/models/reactions-and-recasts-notification-all-of.ts b/src/neynar-api/v1/openapi/models/reactions-and-recasts-notification-all-of.ts new file mode 100644 index 00000000..b5a32258 --- /dev/null +++ b/src/neynar-api/v1/openapi/models/reactions-and-recasts-notification-all-of.ts @@ -0,0 +1,44 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.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 { ReactionType } from './reaction-type'; +// May contain unused imports in some cases +// @ts-ignore +import { User } from './user'; + +/** + * + * @export + * @interface ReactionsAndRecastsNotificationAllOf + */ +export interface ReactionsAndRecastsNotificationAllOf { + /** + * + * @type {Array} + * @memberof ReactionsAndRecastsNotificationAllOf + */ + 'reactors'?: Array; + /** + * + * @type {ReactionType} + * @memberof ReactionsAndRecastsNotificationAllOf + */ + 'reactionType'?: ReactionType; +} + + + diff --git a/src/neynar-api/neynar-v1-api/openapi/models/reactions-and-recasts-notification.ts b/src/neynar-api/v1/openapi/models/reactions-and-recasts-notification.ts similarity index 82% rename from src/neynar-api/neynar-v1-api/openapi/models/reactions-and-recasts-notification.ts rename to src/neynar-api/v1/openapi/models/reactions-and-recasts-notification.ts index 0e8104a2..be1992ca 100644 --- a/src/neynar-api/neynar-v1-api/openapi/models/reactions-and-recasts-notification.ts +++ b/src/neynar-api/v1/openapi/models/reactions-and-recasts-notification.ts @@ -33,12 +33,15 @@ import { EmbedUrl } from './embed-url'; import { ReactionType } from './reaction-type'; // May contain unused imports in some cases // @ts-ignore +import { ReactionsAndRecastsNotificationAllOf } from './reactions-and-recasts-notification-all-of'; +// May contain unused imports in some cases +// @ts-ignore import { User } from './user'; /** * @type ReactionsAndRecastsNotification * @export */ -export type ReactionsAndRecastsNotification = Cast; +export type ReactionsAndRecastsNotification = Cast & ReactionsAndRecastsNotificationAllOf; diff --git a/src/neynar-api/neynar-v1-api/openapi/models/reactions-and-recasts-response-result.ts b/src/neynar-api/v1/openapi/models/reactions-and-recasts-response-result.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/reactions-and-recasts-response-result.ts rename to src/neynar-api/v1/openapi/models/reactions-and-recasts-response-result.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/reactions-and-recasts-response.ts b/src/neynar-api/v1/openapi/models/reactions-and-recasts-response.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/reactions-and-recasts-response.ts rename to src/neynar-api/v1/openapi/models/reactions-and-recasts-response.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/reactor-pfp.ts b/src/neynar-api/v1/openapi/models/reactor-pfp.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/reactor-pfp.ts rename to src/neynar-api/v1/openapi/models/reactor-pfp.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/reactor-viewer-context.ts b/src/neynar-api/v1/openapi/models/reactor-viewer-context.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/reactor-viewer-context.ts rename to src/neynar-api/v1/openapi/models/reactor-viewer-context.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/reactor.ts b/src/neynar-api/v1/openapi/models/reactor.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/reactor.ts rename to src/neynar-api/v1/openapi/models/reactor.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/recaster-pfp.ts b/src/neynar-api/v1/openapi/models/recaster-pfp.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/recaster-pfp.ts rename to src/neynar-api/v1/openapi/models/recaster-pfp.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/recaster-profile-bio.ts b/src/neynar-api/v1/openapi/models/recaster-profile-bio.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/recaster-profile-bio.ts rename to src/neynar-api/v1/openapi/models/recaster-profile-bio.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/recaster-profile.ts b/src/neynar-api/v1/openapi/models/recaster-profile.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/recaster-profile.ts rename to src/neynar-api/v1/openapi/models/recaster-profile.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/recaster-viewer-context.ts b/src/neynar-api/v1/openapi/models/recaster-viewer-context.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/recaster-viewer-context.ts rename to src/neynar-api/v1/openapi/models/recaster-viewer-context.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/recaster.ts b/src/neynar-api/v1/openapi/models/recaster.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/recaster.ts rename to src/neynar-api/v1/openapi/models/recaster.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/recent-casts-response.ts b/src/neynar-api/v1/openapi/models/recent-casts-response.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/recent-casts-response.ts rename to src/neynar-api/v1/openapi/models/recent-casts-response.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/recent-users-response-result.ts b/src/neynar-api/v1/openapi/models/recent-users-response-result.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/recent-users-response-result.ts rename to src/neynar-api/v1/openapi/models/recent-users-response-result.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/recent-users-response.ts b/src/neynar-api/v1/openapi/models/recent-users-response.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/recent-users-response.ts rename to src/neynar-api/v1/openapi/models/recent-users-response.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/user-cast-like-response-result.ts b/src/neynar-api/v1/openapi/models/user-cast-like-response-result.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/user-cast-like-response-result.ts rename to src/neynar-api/v1/openapi/models/user-cast-like-response-result.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/user-cast-like-response.ts b/src/neynar-api/v1/openapi/models/user-cast-like-response.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/user-cast-like-response.ts rename to src/neynar-api/v1/openapi/models/user-cast-like-response.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/user-pfp.ts b/src/neynar-api/v1/openapi/models/user-pfp.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/user-pfp.ts rename to src/neynar-api/v1/openapi/models/user-pfp.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/user-profile-bio.ts b/src/neynar-api/v1/openapi/models/user-profile-bio.ts similarity index 94% rename from src/neynar-api/neynar-v1-api/openapi/models/user-profile-bio.ts rename to src/neynar-api/v1/openapi/models/user-profile-bio.ts index 28fb12bc..fa66cca7 100644 --- a/src/neynar-api/neynar-v1-api/openapi/models/user-profile-bio.ts +++ b/src/neynar-api/v1/openapi/models/user-profile-bio.ts @@ -31,6 +31,6 @@ export interface UserProfileBio { * @type {Array} * @memberof UserProfileBio */ - 'mentions': Array; + 'mentionedProfiles': Array; } diff --git a/src/neynar-api/neynar-v1-api/openapi/models/user-profile.ts b/src/neynar-api/v1/openapi/models/user-profile.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/user-profile.ts rename to src/neynar-api/v1/openapi/models/user-profile.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/user200-response-result.ts b/src/neynar-api/v1/openapi/models/user-response-result.ts similarity index 83% rename from src/neynar-api/neynar-v1-api/openapi/models/user200-response-result.ts rename to src/neynar-api/v1/openapi/models/user-response-result.ts index a582a85d..f8fce01c 100644 --- a/src/neynar-api/neynar-v1-api/openapi/models/user200-response-result.ts +++ b/src/neynar-api/v1/openapi/models/user-response-result.ts @@ -20,13 +20,13 @@ import { User } from './user'; /** * * @export - * @interface User200ResponseResult + * @interface UserResponseResult */ -export interface User200ResponseResult { +export interface UserResponseResult { /** * * @type {User} - * @memberof User200ResponseResult + * @memberof UserResponseResult */ 'user': User; } diff --git a/src/neynar-api/neynar-v1-api/openapi/models/user200-response.ts b/src/neynar-api/v1/openapi/models/user-response.ts similarity index 67% rename from src/neynar-api/neynar-v1-api/openapi/models/user200-response.ts rename to src/neynar-api/v1/openapi/models/user-response.ts index 68d15d95..dba62972 100644 --- a/src/neynar-api/neynar-v1-api/openapi/models/user200-response.ts +++ b/src/neynar-api/v1/openapi/models/user-response.ts @@ -15,19 +15,19 @@ // May contain unused imports in some cases // @ts-ignore -import { User200ResponseResult } from './user200-response-result'; +import { UserResponseResult } from './user-response-result'; /** * * @export - * @interface User200Response + * @interface UserResponse */ -export interface User200Response { +export interface UserResponse { /** * - * @type {User200ResponseResult} - * @memberof User200Response + * @type {UserResponseResult} + * @memberof UserResponse */ - 'result': User200ResponseResult; + 'result': UserResponseResult; } diff --git a/src/neynar-api/neynar-v1-api/openapi/models/user.ts b/src/neynar-api/v1/openapi/models/user.ts similarity index 94% rename from src/neynar-api/neynar-v1-api/openapi/models/user.ts rename to src/neynar-api/v1/openapi/models/user.ts index 08e5f678..828f34d5 100644 --- a/src/neynar-api/neynar-v1-api/openapi/models/user.ts +++ b/src/neynar-api/v1/openapi/models/user.ts @@ -44,6 +44,12 @@ export interface User { * @memberof User */ 'username': string; + /** + * Custody Address of the user. + * @type {string} + * @memberof User + */ + 'custodyAddress': string; /** * The display of the reactor. * @type {string} diff --git a/src/neynar-api/neynar-v1-api/openapi/models/verification-response-result.ts b/src/neynar-api/v1/openapi/models/verification-response-result.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/verification-response-result.ts rename to src/neynar-api/v1/openapi/models/verification-response-result.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/verification-response.ts b/src/neynar-api/v1/openapi/models/verification-response.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/verification-response.ts rename to src/neynar-api/v1/openapi/models/verification-response.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/viewer-context.ts b/src/neynar-api/v1/openapi/models/viewer-context.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/viewer-context.ts rename to src/neynar-api/v1/openapi/models/viewer-context.ts diff --git a/src/neynar-api/v1/v1-client.ts b/src/neynar-api/v1/v1-client.ts new file mode 100644 index 00000000..2b63843a --- /dev/null +++ b/src/neynar-api/v1/v1-client.ts @@ -0,0 +1,826 @@ +import { + Cast, + CastApi, + UserApi, + VerificationApi, + NotificationsApi, + ReactionsApi, + FollowsApi, + Configuration, + ErrorRes, + RecentUsersResponse, + RecentCastsResponse, + UserCastLikeResponse, + CastsResponse, + MentionsAndRepliesResponse, + ReactionsAndRecastsResponse, + CastLikesResponse, + CastReactionsResponse, + CastRecasterResponse, + FollowResponse, + UserResponse, + CustodyAddressResponse, + CastResponse, + VerificationResponse, + AllCastsInThreadResponse, +} from "./openapi"; +import axios, { AxiosError, AxiosInstance } from "axios"; +import { silentLogger, Logger } from "../common/logger"; +import type { SetRequired } from "type-fest"; + +const BASE_PATH = "https://api.neynar.com/v1"; + +export class NeynarV1APIClient { + private readonly logger: Logger; + private readonly apiKey: string; + + public readonly apis: { + user: UserApi; + cast: CastApi; + follows: FollowsApi; + verification: VerificationApi; + notifications: NotificationsApi; + reactions: ReactionsApi; + }; + + /** + * Instantiates a NeynarV1APIClient + * + * Note: A Wallet must be provided if the API client is to mint new AuthTokens + */ + constructor( + apiKey: string, + { + basePath, + logger = silentLogger, + axiosInstance, + }: { + basePath?: string; + logger?: Logger; + axiosInstance?: AxiosInstance; + } = {} + ) { + this.logger = logger; + if (apiKey === "") { + throw new Error( + "Attempt to use an authenticated API method without first providing an api key" + ); + } + + this.apiKey = apiKey; + + if (axiosInstance === undefined) { + axiosInstance = axios.create(); + } + axiosInstance.defaults.decompress = true; + axiosInstance.interceptors.response.use( + (response) => response, + (error) => { + if (NeynarV1APIClient.isApiErrorResponse(error)) { + const apiErrors = error.response.data; + this.logger.warn(`API errors: ${JSON.stringify(apiErrors)}`); + } + throw error; + } + ); + + const config: Configuration = new Configuration({ + basePath: basePath ? `${basePath}/v1` : BASE_PATH, + apiKey: apiKey, + }); + + this.apis = { + user: new UserApi(config, undefined, axiosInstance), + cast: new CastApi(config, undefined, axiosInstance), + follows: new FollowsApi(config, undefined, axiosInstance), + verification: new VerificationApi(config, undefined, axiosInstance), + notifications: new NotificationsApi(config, undefined, axiosInstance), + reactions: new ReactionsApi(config, undefined, axiosInstance), + }; + } + + /** + * Utility for parsing errors returned by the Neynar API servers. Returns true + * if the given error is caused by an error response from the server, and + * narrows the type of `error` accordingly. + */ + public static isApiErrorResponse( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + error: any + ): error is SetRequired, "response"> { + if (!(error instanceof AxiosError)) return false; + return ( + error.response?.data !== undefined && "message" in error.response.data + ); + } + + // ------------ User ------------ + + /** + * Retrieves a list of users in reverse chronological order based on sign up. + * + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {number} [options.viewerFid] - The FID (unique identifier) of the user viewing the data. + * This can be used for providing contextual information specific to the viewer. + * @param {number} [options.limit] - The maximum number of users to be returned in the response. + * Defaults to 100, with a maximum allowable value of 1000. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `RecentUsersResponse` object, + * containing the list of recent users and any associated metadata. + * + * @example + * // Fetch a specific number of recent users, using viewer FID and a pagination cursor + * client.fetchRecentUsers({ + * viewerFid: 3, + * limit: 50, // Fetching up to 50 users + * // cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Recent Users:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/recent-users-v1) + */ + public async fetchRecentUsers(options?: { + viewerFid?: number; + limit?: number; + cursor?: string; + }): Promise { + const response = await this.apis.user.recentUsers( + this.apiKey, + options?.viewerFid, + options?.limit, + options?.cursor + ); + + return response.data; + } + + /** + * Retrieves all casts liked by a specific user. This method returns a list of casts that + * the specified user has liked, with support for pagination through optional parameters. + * + * @param {number} fid - The FID (unique identifier) of the user whose liked casts are to be fetched. + * @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 maximum number of liked casts to be returned in the response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `UserCastLikeResponse` object, + * containing the list of casts liked by the user and any associated metadata. + * + * @example + * // Fetch a specific number of casts liked by a user, using viewer FID and a pagination cursor + * client.fetchAllCastsLikedByUser(3, { + * viewerFid: 2, + * limit: 50, // Fetching up to 50 casts + * // cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Liked Casts:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/user-cast-likes-v1). + */ + public async fetchAllCastsLikedByUser( + fid: number, + options?: { viewerFid?: number; limit?: number; cursor?: string } + ): Promise { + const response = await this.apis.user.userCastLikes( + this.apiKey, + fid, + options?.viewerFid, + options?.limit, + options?.cursor + ); + + return response.data; + } + + /** + * Retrieves the specified user via their FID (if found). + * + * @param {number} fid - The FID of the user whose information is being retrieved. + * @param {number} [viewerFid] - Optional. The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * + * @returns {Promise} A promise that resolves to a `UserResponse` object, + * containing the metadata about the specified user. + * + * @example + * // Example: Retrieve information about a user with FID 19960 as viewed by a user with FID 194 + * client.lookupUserByFid(19960, 194).then(response => { + * console.log('User Information:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/user-v1). + */ + public async lookupUserByFid( + fid: number, + viewerFid?: number + ): Promise { + const response = await this.apis.user.user(this.apiKey, fid, viewerFid); + return response.data; + } + + /** + * Retrieves the specified user via their username (if found). + * + * @param {string} username - The username of the user whose information is being retrieved. + * @param {number} [viewerFid] - Optional. The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * + * @returns {Promise} A promise that resolves to a `UserResponse` object, + * containing the metadata about the user associated with the given username. + * + * @example + * // Example: Retrieve information about a user with username 'manan' as viewed by a user with FID 3 + * client.lookupUserByUsername('manan', 3).then(response => { + * console.log('User Information:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/user-by-username-v1). + */ + public async lookupUserByUsername( + username: string, + viewerFid?: number + ): Promise { + const response = await this.apis.user.userByUsername( + this.apiKey, + username, + viewerFid + ); + return response.data; + } + + /** + * Retrieves the custody address for the specified user via their fid (if found). + * + * @param {number} fid - The FID (unique identifier) of the user whose custody address is being retrieved. + * + * @returns {Promise} A promise that resolves to a `CustodyAddressResponse` object, + * containing the custody address associated with the specified user. + * + * @example + * // Example: Retrieve the custody address for a user with FID 194 + * client.lookupCustodyAddressForUser(194).then(response => { + * console.log('Custody Address:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/custody-address-v1). + */ + public async lookupCustodyAddressForUser( + fid: number + ): Promise { + const response = await this.apis.user.custodyAddress(this.apiKey, fid); + return response.data; + } + + // ------------ Cast ------------ + + /** + * Retrieves information about a single cast using its unique hash identifier. + * + * @param {string} hash - The unique hash identifier of the cast to be retrieved. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {number} [options.viewerFid] - Optional. The FID of the user viewing the information, + * used for providing contextual data specific to the viewer. + * + * @returns {Promise} A promise that resolves to a `CastResponse` object, + * containing detailed information about the specified cast. + * + * @example + * // Example: Retrieve information about a cast with a specific hash, as viewed by a user with FID 3 + * client.lookUpCastByHash('0xfe90f9de682273e05b201629ad2338bdcd89b6be', { viewerFid: 3 }).then(response => { + * console.log('Cast Information:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/cast-v1). + */ + public async lookUpCastByHash( + hash: string, + options?: { viewerFid?: number } + ): Promise { + const response = await this.apis.cast.cast( + this.apiKey, + hash, + options?.viewerFid + ); + return response.data; + } + + /** + * Retrieves all casts, including root cast and all replies for a given thread hash. No limit to the depth of replies. + * **Note :** The parent provided by the caller is included in the response. + * + * @param {Cast | string} threadParent - The parent cast or the hash of the thread for which + * all related casts are to be fetched. If a Cast object is provided, its hash is used. + * @param {number} [viewerFid] - The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * + * @returns {Promise} A promise that resolves to an `AllCastsInThreadResponse` object, + * containing all casts within the specified thread. + * + * @example + * // Example: Fetch all casts in a thread using a thread hash + * client.fetchAllCastsInThread('0xfe90f9de682273e05b201629ad2338bdcd89b6be', 3).then(response => { + * console.log('Thread Casts:', response); // Outputs all casts in the thread + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/all-casts-in-thread-v1). + */ + public async fetchAllCastsInThread( + threadParent: Cast | string, + viewerFid?: number + ): Promise { + let threadHash: string; + + if (typeof threadParent === "string") { + threadHash = threadParent; + } else { + threadHash = threadParent.hash; + } + + const response = await this.apis.cast.allCastsInThread( + this.apiKey, + threadHash, + viewerFid + ); + return response.data; + } + + /** + * Retrieves all casts (including replies and recasts) created by the specified user. + * + * @param {number} fid - The FID (unique identifier) of the user whose casts are being retrieved. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {string} [options.parentUrl] - Optional. A URL identifying the channel to which the casts belong. + * A cast can be part of a certain channel. The channel is identified by parent_url. + * All casts in the channel ladder up to the same parent_url. + * @param {number} [options.viewerFid] - Optional. The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * @param {number} [options.limit] - Optional. The maximum number of casts to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `CastsResponse` object, + * containing the casts created by the specified user along with any associated metadata. + * + * @example + * // Example: Retrieve casts created by a user with FID 3, including contextual information for a viewer + * client.fetchAllCastsCreatedByUser(3, { + * parentUrl: 'https://ethereum.org', + * viewerFid: 2, + * limit: 50, // Fetching up to 50 casts + * // cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('User Casts:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/casts-v1). + */ + public async fetchAllCastsCreatedByUser( + fid: number, + options?: { + parentUrl?: string; + viewerFid?: number; + limit?: number; + cursor?: string; + } + ): Promise { + const response = await this.apis.cast.casts( + this.apiKey, + fid, + options?.parentUrl, + options?.viewerFid, + options?.limit, + options?.cursor + ); + + return response.data; + } + + /** + * Retrieves a list of casts from the protocol in reverse chronological order based on timestamp + * + * @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 maximum number of casts to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 100. + * @param {string} [options.cursor] - Pagination cursor for the next set of results. + * Omit this parameter for the initial request. Useful for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `RecentCastsResponse` object, + * containing the recent casts along with any associated metadata. + * + * @example + * // Example: Retrieve recent casts with a limit of 50, as viewed by a user with FID 3 + * client.fetchRecentCasts({ + * viewerFid: 3, + * limit: 50, // Fetching up to 50 casts + * // cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Recent Casts:', response); // Outputs the recent casts + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/recent-casts-v1). + */ + public async fetchRecentCasts(options?: { + viewerFid?: number; + limit?: number; + cursor?: string; + }): Promise { + const response = await this.apis.cast.recentCasts( + this.apiKey, + options?.viewerFid, + options?.limit, + options?.cursor + ); + + return response.data; + } + + // ------------ Verification ------------ + + /** + * Retrieve all known verifications of a user. + * + * @param {number} fid - The FID (unique identifier) of the user whose verifications are being retrieved. + * + * @returns {Promise} A promise that resolves to a `VerificationResponse` object + * + * @example + * // Example: Retrieve all verifications for a user with FID 3 + * client.fetchUserVerifications(3).then(response => { + * console.log('User Verifications:', response); // Outputs the user's verifications + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/verifications-v1). + */ + public async fetchUserVerifications( + fid: number + ): Promise { + const response = await this.apis.verification.verifications( + this.apiKey, + fid + ); + return response.data; + } + + /** + * Retrieve user information using a verification address + * + * Checks if a given Ethereum address has a Farcaster user associated with it. + * Note: if an address is associated with multiple users, the API will return + * the user who most recently published a verification with the address + * (based on when Warpcast received the proof, not a self-reported timestamp). + * + * @param {string} address - The Ethereum address that have has a Farcaster user associated with it + * + * @returns {Promise} A promise that resolves to a `UserResponse` object, + * containing user information linked to the given verification address. + * + * @example + * // Example: Retrieve user information using a verification address + * client.lookupUserByVerification('0x7ea5dada4021c2c625e73d2a78882e91b93c174c').then(response => { + * console.log('User Information:', response); // Outputs the user information associated with the verification address + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/user-by-verification-v1). + */ + public async lookupUserByVerification( + address: string + ): Promise { + const response = await this.apis.verification.userByVerification( + this.apiKey, + address + ); + return response.data; + } + + // ------------ Notifications ------------ + + /** + * Retrieves a list of mentions and replies to the user’s casts in reverse chronological order. + * + * @param {number} fid - The FID (unique identifier) of the user whose mentions and replies are being retrieved. + * @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 maximum number of results to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `MentionsAndRepliesResponse` object, + * containing a list of mentions and replies to the user's casts. + * + * @example + * // Example: Retrieve the first set of mentions and replies for a user with FID 12345, limited to 50 + * client.fetchMentionAndReplyNotifications(3, { + * viewerFid: 2, // The FID of the user viewing this information + * limit: 50, // Fetching up to 50 mentions and replies + * // cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Mentions and Replies:', response); // Outputs the mentions and replies + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/mentions-and-replies-v1). + */ + public async fetchMentionAndReplyNotifications( + fid: number, + options?: { viewerFid?: number; limit?: number; cursor?: string } + ): Promise { + const response = await this.apis.notifications.mentionsAndReplies( + this.apiKey, + fid, + options?.viewerFid, + options?.limit, + options?.cursor + ); + + return response.data; + } + + /** + * Retrieves a list of likes and recasts to the user’s casts in reverse chronological order. + * + * @param {number} fid - The FID (unique identifier) of the user whose likes and recasts are being retrieved. + * @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 maximum number of results to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `ReactionsAndRecastsResponse` object, + * containing a list of likes and recasts to the user's casts. + * + * @example + * // Example: Retrieve the first set of likes and recasts for a user with FID 12345, limited to 50 + * client.fetchUserLikesAndRecasts(3, { + * viewerFid: 2, // The FID of the user viewing this information + * limit: 50, // Fetching up to 50 likes and recasts + * // cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Likes and Recasts:', response); // Outputs the likes and recasts + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/reactions-and-recasts-v1). + */ + public async fetchUserLikesAndRecasts( + fid: number, + options?: { viewerFid?: number; limit?: number; cursor?: string } + ): Promise { + const response = await this.apis.notifications.reactionsAndRecasts( + this.apiKey, + fid, + options?.viewerFid, + options?.limit, + options?.cursor + ); + + return response.data; + } + + // ------------ Reactions ------------ + + /** + * Retrieves all like reactions for a specific cast in reverse chronological order. + * + * @param {Cast | string} castOrCastHash - The Cast object or its hash for which likes are being retrieved. + * @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 maximum number of results to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `CastLikesResponse` object, + * containing a list of likes for the given cast. + * + * @example + * // Example: Retrieve the first set of likes for a cast with a specific hash, limited to 2 + * client.fetchCastLikes('0xfe90f9de682273e05b201629ad2338bdcd89b6be', { + * viewerFid: 3, // The FID of the user viewing this information + * limit: 2, // Fetching up to 2 likes + * // cursor: "nextPageCursor", // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Cast Likes:', response); // Outputs the cast likes + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/cast-likes-v1). + */ + public async fetchCastLikes( + castOrCastHash: Cast | string, + options?: { viewerFid?: number; limit?: number; cursor?: string } + ): Promise { + let castHash: string; + if (typeof castOrCastHash === "string") { + castHash = castOrCastHash; + } else { + castHash = castOrCastHash.hash; + } + + const response = await this.apis.reactions.castLikes( + this.apiKey, + castHash, + options?.viewerFid, + options?.limit, + options?.cursor + ); + + return response.data; + } + + /** + * Retrieves all reactions (likes and recasts) for a specific cast. + * + * @param {Cast | string} castOrCastHash - The Cast object or its hash for which reactions are being retrieved. + * @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 maximum number of results to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `CastReactionsResponse` object, + * containing a list of all reactions for the given cast. + * + * @example + * // Example: Retrieve the first set of reactions for a cast with a specific hash, limited to 5 + * client.fetchCastReactions('0xfe90f9de682273e05b201629ad2338bdcd89b6be', { + * viewerFid: 3, // The FID of the user viewing this information + * limit: 5, // Fetching up to 5 reactions + * // cursor: "nextPageCursor", // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Cast Reactions:', response); // Outputs the cast reactions + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/cast-reactions-v1). + */ + public async fetchCastReactions( + castOrCastHash: Cast | string, + options?: { viewerFid?: number; limit?: number; cursor?: string } + ): Promise { + let castHash: string; + if (typeof castOrCastHash === "string") { + castHash = castOrCastHash; + } else { + castHash = castOrCastHash.hash; + } + + const response = await this.apis.reactions.castReactions( + this.apiKey, + castHash, + options?.viewerFid, + options?.limit, + options?.cursor + ); + + return response.data; + } + + /** + * Retrieves the list of users who have recasted a specific cast. + * + * @param {Cast | string} castOrCastHash - The Cast object or its hash for which recasters are being retrieved. + * @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 maximum number of results to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `CastRecasterResponse` object, + * containing a list of recasters for the given cast. + * + * @example + * // Example: Retrieve the first set of recasters for a cast with a specific hash, limited to 3 + * client.fetchRecasters('0xafadc0478ede366e3f5232af3190a82dea20b169', { + * viewerFid: 3, // The FID of the user viewing this information + * limit: 3, // Fetching up to 3 recasters + * // cursor: "nextPageCursor", // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Cast Recasters:', response); // Outputs the cast recasters + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/cast-recasters-v1). + */ + public async fetchRecasters( + castOrCastHash: Cast | string, + options?: { viewerFid?: number; limit?: number; cursor?: string } + ): Promise { + let castHash: string; + if (typeof castOrCastHash === "string") { + castHash = castOrCastHash; + } else { + castHash = castOrCastHash.hash; + } + + const response = await this.apis.reactions.castRecasters( + this.apiKey, + castHash, + options?.viewerFid, + options?.limit, + options?.cursor + ); + + return response.data; + } + + // ------------ Follows ------------ + + /** + * Retrieves all users that follow the specified user. + * + * @param {number} fid - The FID (unique identifier) of the user whose followers are being retrieved. + * @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 maximum number of results to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `FollowResponse` object, + * containing a list of the user's followers. + * + * @example + * // Example: Retrieve the first set of followers for a user with FID 12345, limited to 50 + * client.fetchUserFollowers(3, { + * viewerFid: 2, // The FID of the user viewing this information + * limit: 50, // Fetching up to 50 followers + * // cursor: "nextPageCursor", // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('User Followers:', response); // Outputs the user's followers + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/followers-v1). + */ + public async fetchUserFollowers( + fid: number, + options?: { viewerFid?: number; limit?: number; cursor?: string } + ): Promise { + const response = await this.apis.follows.followers( + this.apiKey, + fid, + options?.viewerFid, + options?.limit, + options?.cursor + ); + + return response.data; + } + + /** + * Retrieves all users the specified user is following. + * + * @param {number} fid - The FID (unique identifier) of the user whose following list is being retrieved. + * @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 maximum number of results to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `FollowResponse` object, + * containing a list of users followed by the given user. + * + * @example + * // Example: Retrieve the first set of users followed by a user with FID 12345, limited to 50 + * client.fetchUserFollowing(3, { + * viewerFid: 2, // The FID of the user viewing this information + * limit: 50, // Fetching up to 50 users + * // cursor: "nextPageCursor", // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Following Users:', response); // Outputs the list of users followed by the user + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/following-v1). + */ + public async fetchUserFollowing( + fid: number, + options?: { viewerFid?: number; limit?: number; cursor?: string } + ): Promise { + const response = await this.apis.follows.following( + this.apiKey, + fid, + options?.viewerFid, + options?.limit, + options?.cursor + ); + + return response.data; + } +} diff --git a/src/neynar-api/v2/index.ts b/src/neynar-api/v2/index.ts new file mode 100644 index 00000000..a2a9880d --- /dev/null +++ b/src/neynar-api/v2/index.ts @@ -0,0 +1,2 @@ +export * from "./openapi-farcaster"; +export * from "./v2-client"; diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/.gitignore b/src/neynar-api/v2/openapi-farcaster/.gitignore similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/.gitignore rename to src/neynar-api/v2/openapi-farcaster/.gitignore diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/.npmignore b/src/neynar-api/v2/openapi-farcaster/.npmignore similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/.npmignore rename to src/neynar-api/v2/openapi-farcaster/.npmignore diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/.openapi-generator-ignore b/src/neynar-api/v2/openapi-farcaster/.openapi-generator-ignore similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/.openapi-generator-ignore rename to src/neynar-api/v2/openapi-farcaster/.openapi-generator-ignore diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/.openapi-generator/FILES b/src/neynar-api/v2/openapi-farcaster/.openapi-generator/FILES similarity index 82% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/.openapi-generator/FILES rename to src/neynar-api/v2/openapi-farcaster/.openapi-generator/FILES index a9829371..678a3318 100644 --- a/src/neynar-api/neynar-v2-api/openapi-farcaster/.openapi-generator/FILES +++ b/src/neynar-api/v2/openapi-farcaster/.openapi-generator/FILES @@ -1,5 +1,6 @@ .gitignore .npmignore +.openapi-generator-ignore api.ts apis/cast-api.ts apis/feed-api.ts @@ -7,6 +8,7 @@ apis/follows-api.ts apis/notifications-api.ts apis/reaction-api.ts apis/signer-api.ts +apis/storage-api.ts apis/user-api.ts base.ts common.ts @@ -16,6 +18,7 @@ index.ts models/active-status.ts models/add-verification-req-body.ts models/bulk-follow-response.ts +models/bulk-users-response.ts models/cast-id.ts models/cast-notification-type.ts models/cast-param-type.ts @@ -34,16 +37,16 @@ models/embed-url.ts models/embedded-cast.ts models/error-res.ts models/feed-response.ts +models/feed-type.ts +models/filter-type.ts models/follow-req-body.ts models/follow-response.ts +models/follow.ts models/get-casts-req-body.ts models/hydrated-follower.ts models/index.ts models/individual-hash-obj.ts models/next-cursor.ts -models/notification-follow.ts -models/notification-reactions-cast.ts -models/notification-reactions.ts models/notification.ts models/notifications-response.ts models/operation-response.ts @@ -57,13 +60,20 @@ models/reaction-like.ts models/reaction-recast.ts models/reaction-req-body.ts models/reaction-type.ts +models/reactions-cast.ts +models/reactions-response.ts +models/reactions-type.ts +models/reactions.ts models/register-signer-key-req-body.ts models/relevant-followers-response.ts models/remove-verification-req-body.ts models/searched-user.ts models/signer.ts +models/storage-allocation.ts +models/storage-allocations-response.ts +models/storage-object.ts +models/storage-usage-response.ts models/update-user-req-body.ts -models/user-bulk200-response.ts models/user-dehydrated.ts models/user-profile-bio.ts models/user-profile.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/.openapi-generator/VERSION b/src/neynar-api/v2/openapi-farcaster/.openapi-generator/VERSION similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/.openapi-generator/VERSION rename to src/neynar-api/v2/openapi-farcaster/.openapi-generator/VERSION diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/api.ts b/src/neynar-api/v2/openapi-farcaster/api.ts similarity index 94% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/api.ts rename to src/neynar-api/v2/openapi-farcaster/api.ts index 95a929b0..08e15808 100644 --- a/src/neynar-api/neynar-v2-api/openapi-farcaster/api.ts +++ b/src/neynar-api/v2/openapi-farcaster/api.ts @@ -20,5 +20,6 @@ export * from './apis/follows-api'; export * from './apis/notifications-api'; export * from './apis/reaction-api'; export * from './apis/signer-api'; +export * from './apis/storage-api'; export * from './apis/user-api'; diff --git a/src/neynar-api/v2/openapi-farcaster/apis/cast-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/cast-api.ts new file mode 100644 index 00000000..1caf02e0 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/apis/cast-api.ts @@ -0,0 +1,404 @@ +/* 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. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { CastParamType } from '../models'; +// @ts-ignore +import { CastResponse } from '../models'; +// @ts-ignore +import { CastsResponse } from '../models'; +// @ts-ignore +import { DeleteCastReqBody } from '../models'; +// @ts-ignore +import { ErrorRes } from '../models'; +// @ts-ignore +import { OperationResponse } from '../models'; +// @ts-ignore +import { PostCastReqBody } from '../models'; +// @ts-ignore +import { PostCastResponse } from '../models'; +/** + * CastApi - axios parameter creator + * @export + */ +export const CastApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Gets information about an individual cast by passing in a Warpcast web URL or cast hash + * @summary Retrieve cast for a given hash or Warpcast URL + * @param {string} apiKey API key required for authentication. + * @param {string} identifier Cast identifier (Its either a url or a hash) + * @param {CastParamType} type + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + cast: async (apiKey: string, identifier: string, type: CastParamType, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('cast', 'apiKey', apiKey) + // 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) + 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; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (identifier !== undefined) { + localVarQueryParameter['identifier'] = identifier; + } + + if (type !== undefined) { + localVarQueryParameter['type'] = type; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Retrieve multiple casts using their respective hashes. + * @summary Gets information about an array of casts + * @param {string} apiKey API key required for authentication. + * @param {string} casts Hashes of the cast to be retrived (Comma separated) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + casts: async (apiKey: string, casts: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('casts', 'apiKey', apiKey) + // verify required parameter 'casts' is not null or undefined + assertParamExists('casts', '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; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (casts !== undefined) { + localVarQueryParameter['casts'] = casts; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Delete an existing cast. \\ (In order to delete a cast `signer_uuid` must be approved) + * @summary Delete a cast + * @param {string} apiKey API key required for authentication. + * @param {DeleteCastReqBody} deleteCastReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteCast: async (apiKey: string, deleteCastReqBody: DeleteCastReqBody, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('deleteCast', 'apiKey', apiKey) + // verify required parameter 'deleteCastReqBody' is not null or undefined + assertParamExists('deleteCast', 'deleteCastReqBody', deleteCastReqBody) + 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; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(deleteCastReqBody, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Posts a cast or cast reply. Works with mentions and embeds. (In order to post a cast `signer_uuid` must be approved) + * @summary Posts a cast + * @param {string} apiKey API key required for authentication. + * @param {PostCastReqBody} postCastReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + postCast: async (apiKey: string, postCastReqBody: PostCastReqBody, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('postCast', 'apiKey', apiKey) + // verify required parameter 'postCastReqBody' is not null or undefined + assertParamExists('postCast', 'postCastReqBody', postCastReqBody) + 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; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + 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), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * CastApi - functional programming interface + * @export + */ +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 Retrieve cast for a given hash or Warpcast URL + * @param {string} apiKey API key required for authentication. + * @param {string} identifier Cast identifier (Its either a url or a hash) + * @param {CastParamType} type + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async cast(apiKey: string, identifier: string, type: CastParamType, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.cast(apiKey, identifier, type, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Retrieve multiple casts using their respective hashes. + * @summary Gets information about an array of casts + * @param {string} apiKey API key required for authentication. + * @param {string} casts Hashes of the cast to be retrived (Comma separated) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async casts(apiKey: string, casts: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.casts(apiKey, casts, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Delete an existing cast. \\ (In order to delete a cast `signer_uuid` must be approved) + * @summary Delete a cast + * @param {string} apiKey API key required for authentication. + * @param {DeleteCastReqBody} deleteCastReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteCast(apiKey: string, deleteCastReqBody: DeleteCastReqBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteCast(apiKey, deleteCastReqBody, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Posts a cast or cast reply. Works with mentions and embeds. (In order to post a cast `signer_uuid` must be approved) + * @summary Posts a cast + * @param {string} apiKey API key required for authentication. + * @param {PostCastReqBody} postCastReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async postCast(apiKey: string, postCastReqBody: PostCastReqBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.postCast(apiKey, postCastReqBody, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * CastApi - factory interface + * @export + */ +export const CastApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = CastApiFp(configuration) + return { + /** + * Gets information about an individual cast by passing in a Warpcast web URL or cast hash + * @summary Retrieve cast for a given hash or Warpcast URL + * @param {string} apiKey API key required for authentication. + * @param {string} identifier Cast identifier (Its either a url or a hash) + * @param {CastParamType} type + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + cast(apiKey: string, identifier: string, type: CastParamType, options?: any): AxiosPromise { + return localVarFp.cast(apiKey, identifier, type, options).then((request) => request(axios, basePath)); + }, + /** + * Retrieve multiple casts using their respective hashes. + * @summary Gets information about an array of casts + * @param {string} apiKey API key required for authentication. + * @param {string} casts Hashes of the cast to be retrived (Comma separated) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + casts(apiKey: string, casts: string, options?: any): AxiosPromise { + return localVarFp.casts(apiKey, casts, 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 {string} apiKey API key required for authentication. + * @param {DeleteCastReqBody} deleteCastReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteCast(apiKey: string, deleteCastReqBody: DeleteCastReqBody, options?: any): AxiosPromise { + return localVarFp.deleteCast(apiKey, deleteCastReqBody, 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 Posts a cast + * @param {string} apiKey API key required for authentication. + * @param {PostCastReqBody} postCastReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + postCast(apiKey: string, postCastReqBody: PostCastReqBody, options?: any): AxiosPromise { + return localVarFp.postCast(apiKey, postCastReqBody, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * CastApi - object-oriented interface + * @export + * @class CastApi + * @extends {BaseAPI} + */ +export class CastApi extends BaseAPI { + /** + * Gets information about an individual cast by passing in a Warpcast web URL or cast hash + * @summary Retrieve cast for a given hash or Warpcast URL + * @param {string} apiKey API key required for authentication. + * @param {string} identifier Cast identifier (Its either a url or a hash) + * @param {CastParamType} type + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CastApi + */ + public cast(apiKey: string, identifier: string, type: CastParamType, options?: AxiosRequestConfig) { + return CastApiFp(this.configuration).cast(apiKey, identifier, type, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Retrieve multiple casts using their respective hashes. + * @summary Gets information about an array of casts + * @param {string} apiKey API key required for authentication. + * @param {string} casts Hashes of the cast to be retrived (Comma separated) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CastApi + */ + public casts(apiKey: string, casts: string, options?: AxiosRequestConfig) { + return CastApiFp(this.configuration).casts(apiKey, casts, 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 {string} apiKey API key required for authentication. + * @param {DeleteCastReqBody} deleteCastReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CastApi + */ + public deleteCast(apiKey: string, deleteCastReqBody: DeleteCastReqBody, options?: AxiosRequestConfig) { + return CastApiFp(this.configuration).deleteCast(apiKey, deleteCastReqBody, 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 Posts a cast + * @param {string} apiKey API key required for authentication. + * @param {PostCastReqBody} postCastReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CastApi + */ + public postCast(apiKey: string, postCastReqBody: PostCastReqBody, options?: AxiosRequestConfig) { + return CastApiFp(this.configuration).postCast(apiKey, postCastReqBody, options).then((request) => request(this.axios, this.basePath)); + } +} + diff --git a/src/neynar-api/v2/openapi-farcaster/apis/feed-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/feed-api.ts new file mode 100644 index 00000000..8ece6713 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/apis/feed-api.ts @@ -0,0 +1,204 @@ +/* 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. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { ErrorRes } from '../models'; +// @ts-ignore +import { FeedResponse } from '../models'; +// @ts-ignore +import { FeedType } from '../models'; +// @ts-ignore +import { FilterType } from '../models'; +/** + * FeedApi - axios parameter creator + * @export + */ +export const FeedApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary Retrieve casts based on filters + * @param {string} apiKey API key required for authentication. + * @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) + * @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 {boolean} [withRecasts] Include recasts in the response, true by default + * @param {number} [limit] Number of results to retrieve (default 25, max 100) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + feed: async (apiKey: string, feedType: FeedType, filterType?: FilterType, fid?: number, fids?: string, parentUrl?: string, withRecasts?: boolean, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('feed', 'apiKey', apiKey) + // verify required parameter 'feedType' is not null or undefined + assertParamExists('feed', 'feedType', feedType) + 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); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (feedType !== undefined) { + localVarQueryParameter['feed_type'] = feedType; + } + + if (filterType !== undefined) { + localVarQueryParameter['filter_type'] = filterType; + } + + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } + + if (fids !== undefined) { + localVarQueryParameter['fids'] = fids; + } + + if (parentUrl !== undefined) { + localVarQueryParameter['parent_url'] = parentUrl; + } + + if (withRecasts !== undefined) { + localVarQueryParameter['with_recasts'] = withRecasts; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * FeedApi - functional programming interface + * @export + */ +export const FeedApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = FeedApiAxiosParamCreator(configuration) + return { + /** + * + * @summary Retrieve casts based on filters + * @param {string} apiKey API key required for authentication. + * @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) + * @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 {boolean} [withRecasts] Include recasts in the response, true by default + * @param {number} [limit] Number of results to retrieve (default 25, max 100) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async feed(apiKey: string, feedType: FeedType, filterType?: FilterType, fid?: number, fids?: string, parentUrl?: string, withRecasts?: boolean, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.feed(apiKey, feedType, filterType, fid, fids, parentUrl, withRecasts, limit, cursor, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * FeedApi - factory interface + * @export + */ +export const FeedApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = FeedApiFp(configuration) + return { + /** + * + * @summary Retrieve casts based on filters + * @param {string} apiKey API key required for authentication. + * @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) + * @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 {boolean} [withRecasts] Include recasts in the response, true by default + * @param {number} [limit] Number of results to retrieve (default 25, max 100) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + feed(apiKey: string, feedType: FeedType, filterType?: FilterType, fid?: number, fids?: string, parentUrl?: string, withRecasts?: boolean, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.feed(apiKey, feedType, filterType, fid, fids, parentUrl, withRecasts, limit, cursor, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * FeedApi - object-oriented interface + * @export + * @class FeedApi + * @extends {BaseAPI} + */ +export class FeedApi extends BaseAPI { + /** + * + * @summary Retrieve casts based on filters + * @param {string} apiKey API key required for authentication. + * @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) + * @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 {boolean} [withRecasts] Include recasts in the response, true by default + * @param {number} [limit] Number of results to retrieve (default 25, max 100) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FeedApi + */ + public feed(apiKey: string, feedType: FeedType, filterType?: FilterType, fid?: number, fids?: string, parentUrl?: string, withRecasts?: boolean, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + return FeedApiFp(this.configuration).feed(apiKey, feedType, filterType, fid, fids, parentUrl, withRecasts, limit, cursor, 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 new file mode 100644 index 00000000..65d21f3a --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/apis/follows-api.ts @@ -0,0 +1,154 @@ +/* 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. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { ErrorRes } from '../models'; +// @ts-ignore +import { RelevantFollowersResponse } from '../models'; +/** + * FollowsApi - axios parameter creator + * @export + */ +export const FollowsApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Returns a list of relevant followers for a specific FID. + * @summary Retrieve relevant followers for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} targetFid User who\'s profile you are looking at + * @param {number} viewerFid Viewer who\'s looking at the profile + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + relevantFollowers: async (apiKey: string, targetFid: number, viewerFid: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('relevantFollowers', 'apiKey', apiKey) + // 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`; + // 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; + + if (targetFid !== undefined) { + localVarQueryParameter['target_fid'] = targetFid; + } + + if (viewerFid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewerFid; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * FollowsApi - functional programming interface + * @export + */ +export const FollowsApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = FollowsApiAxiosParamCreator(configuration) + return { + /** + * Returns a list of relevant followers for a specific FID. + * @summary Retrieve relevant followers for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} targetFid User who\'s profile you are looking at + * @param {number} viewerFid Viewer who\'s looking at the profile + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async relevantFollowers(apiKey: string, targetFid: number, viewerFid: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.relevantFollowers(apiKey, targetFid, viewerFid, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * FollowsApi - factory interface + * @export + */ +export const FollowsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = FollowsApiFp(configuration) + return { + /** + * Returns a list of relevant followers for a specific FID. + * @summary Retrieve relevant followers for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} targetFid User who\'s profile you are looking at + * @param {number} viewerFid Viewer who\'s looking at the profile + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + relevantFollowers(apiKey: string, targetFid: number, viewerFid: number, options?: any): AxiosPromise { + return localVarFp.relevantFollowers(apiKey, targetFid, viewerFid, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * FollowsApi - object-oriented interface + * @export + * @class FollowsApi + * @extends {BaseAPI} + */ +export class FollowsApi extends BaseAPI { + /** + * Returns a list of relevant followers for a specific FID. + * @summary Retrieve relevant followers for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} targetFid User who\'s profile you are looking at + * @param {number} viewerFid Viewer who\'s looking at the profile + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FollowsApi + */ + public relevantFollowers(apiKey: string, targetFid: number, viewerFid: number, options?: AxiosRequestConfig) { + return FollowsApiFp(this.configuration).relevantFollowers(apiKey, targetFid, viewerFid, 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 new file mode 100644 index 00000000..0edeb864 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/apis/notifications-api.ts @@ -0,0 +1,160 @@ +/* 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. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { ErrorRes } from '../models'; +// @ts-ignore +import { NotificationsResponse } from '../models'; +/** + * NotificationsApi - axios parameter creator + * @export + */ +export const NotificationsApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Returns a list of notifications for a specific FID. + * @summary Retrieve notifications for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {number} [limit] Number of results to retrieve (default 25, max 50) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + notifications: async (apiKey: string, fid: number, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('notifications', 'apiKey', apiKey) + // verify required parameter 'fid' is not null or undefined + assertParamExists('notifications', '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; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * NotificationsApi - functional programming interface + * @export + */ +export const NotificationsApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = NotificationsApiAxiosParamCreator(configuration) + return { + /** + * Returns a list of notifications for a specific FID. + * @summary Retrieve notifications for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {number} [limit] Number of results to retrieve (default 25, max 50) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async notifications(apiKey: string, fid: number, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.notifications(apiKey, fid, limit, cursor, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * NotificationsApi - factory interface + * @export + */ +export const NotificationsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = NotificationsApiFp(configuration) + return { + /** + * Returns a list of notifications for a specific FID. + * @summary Retrieve notifications for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {number} [limit] Number of results to retrieve (default 25, max 50) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + notifications(apiKey: string, fid: number, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.notifications(apiKey, fid, limit, cursor, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * NotificationsApi - object-oriented interface + * @export + * @class NotificationsApi + * @extends {BaseAPI} + */ +export class NotificationsApi extends BaseAPI { + /** + * Returns a list of notifications for a specific FID. + * @summary Retrieve notifications for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {number} [limit] Number of results to retrieve (default 25, max 50) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationsApi + */ + public notifications(apiKey: string, fid: number, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + return NotificationsApiFp(this.configuration).notifications(apiKey, fid, limit, cursor, 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 new file mode 100644 index 00000000..c5e5e0bf --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/apis/reaction-api.ts @@ -0,0 +1,334 @@ +/* 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. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { ErrorRes } from '../models'; +// @ts-ignore +import { OperationResponse } from '../models'; +// @ts-ignore +import { ReactionReqBody } from '../models'; +// @ts-ignore +import { ReactionsResponse } from '../models'; +// @ts-ignore +import { ReactionsType } from '../models'; +/** + * ReactionApi - axios parameter creator + * @export + */ +export const ReactionApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Delete a reaction (like or recast) to a given cast \\ (In order to delete a reaction `signer_uuid` must be approved) + * @summary Delete a reaction + * @param {string} apiKey API key required for authentication. + * @param {ReactionReqBody} reactionReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteReaction: async (apiKey: string, reactionReqBody: ReactionReqBody, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('deleteReaction', 'apiKey', apiKey) + // verify required parameter 'reactionReqBody' is not null or undefined + assertParamExists('deleteReaction', '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: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + 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) + + 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 Posts a reaction + * @param {string} apiKey API key required for authentication. + * @param {ReactionReqBody} reactionReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + postReaction: async (apiKey: string, reactionReqBody: ReactionReqBody, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('postReaction', 'apiKey', apiKey) + // 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; + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + 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) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Fetches reactions for a given user + * @summary Fetches reactions for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {ReactionsType} type Type of reaction to fetch (likes or recasts or all) + * @param {number} [limit] Number of results to retrieve (default 25, max 100) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + reactionsUser: async (apiKey: string, fid: number, type: ReactionsType, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('reactionsUser', 'apiKey', apiKey) + // verify required parameter 'fid' is not null or undefined + assertParamExists('reactionsUser', 'fid', fid) + // verify required parameter 'type' is not null or undefined + assertParamExists('reactionsUser', '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); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } + + if (type !== undefined) { + localVarQueryParameter['type'] = type; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * ReactionApi - functional programming interface + * @export + */ +export const ReactionApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = ReactionApiAxiosParamCreator(configuration) + return { + /** + * Delete a reaction (like or recast) to a given cast \\ (In order to delete a reaction `signer_uuid` must be approved) + * @summary Delete a reaction + * @param {string} apiKey API key required for authentication. + * @param {ReactionReqBody} reactionReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteReaction(apiKey: string, reactionReqBody: ReactionReqBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteReaction(apiKey, reactionReqBody, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Post a reaction (like or recast) to a given cast \\ (In order to post a reaction `signer_uuid` must be approved) + * @summary Posts a reaction + * @param {string} apiKey API key required for authentication. + * @param {ReactionReqBody} reactionReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async postReaction(apiKey: string, reactionReqBody: ReactionReqBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.postReaction(apiKey, reactionReqBody, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Fetches reactions for a given user + * @summary Fetches reactions for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {ReactionsType} type Type of reaction to fetch (likes or recasts or all) + * @param {number} [limit] Number of results to retrieve (default 25, max 100) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async reactionsUser(apiKey: string, fid: number, type: ReactionsType, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.reactionsUser(apiKey, fid, type, limit, cursor, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * ReactionApi - factory interface + * @export + */ +export const ReactionApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = ReactionApiFp(configuration) + return { + /** + * Delete a reaction (like or recast) to a given cast \\ (In order to delete a reaction `signer_uuid` must be approved) + * @summary Delete a reaction + * @param {string} apiKey API key required for authentication. + * @param {ReactionReqBody} reactionReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteReaction(apiKey: string, reactionReqBody: ReactionReqBody, options?: any): AxiosPromise { + return localVarFp.deleteReaction(apiKey, reactionReqBody, 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 Posts a reaction + * @param {string} apiKey API key required for authentication. + * @param {ReactionReqBody} reactionReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + postReaction(apiKey: string, reactionReqBody: ReactionReqBody, options?: any): AxiosPromise { + return localVarFp.postReaction(apiKey, reactionReqBody, options).then((request) => request(axios, basePath)); + }, + /** + * Fetches reactions for a given user + * @summary Fetches reactions for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {ReactionsType} type Type of reaction to fetch (likes or recasts or all) + * @param {number} [limit] Number of results to retrieve (default 25, max 100) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + reactionsUser(apiKey: string, fid: number, type: ReactionsType, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.reactionsUser(apiKey, fid, type, limit, cursor, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * ReactionApi - object-oriented interface + * @export + * @class ReactionApi + * @extends {BaseAPI} + */ +export class ReactionApi extends BaseAPI { + /** + * Delete a reaction (like or recast) to a given cast \\ (In order to delete a reaction `signer_uuid` must be approved) + * @summary Delete a reaction + * @param {string} apiKey API key required for authentication. + * @param {ReactionReqBody} reactionReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ReactionApi + */ + public deleteReaction(apiKey: string, reactionReqBody: ReactionReqBody, options?: AxiosRequestConfig) { + return ReactionApiFp(this.configuration).deleteReaction(apiKey, reactionReqBody, 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 Posts a reaction + * @param {string} apiKey API key required for authentication. + * @param {ReactionReqBody} reactionReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ReactionApi + */ + public postReaction(apiKey: string, reactionReqBody: ReactionReqBody, options?: AxiosRequestConfig) { + return ReactionApiFp(this.configuration).postReaction(apiKey, reactionReqBody, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Fetches reactions for a given user + * @summary Fetches reactions for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {ReactionsType} type Type of reaction to fetch (likes or recasts or all) + * @param {number} [limit] Number of results to retrieve (default 25, max 100) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ReactionApi + */ + public reactionsUser(apiKey: string, fid: number, type: ReactionsType, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + return ReactionApiFp(this.configuration).reactionsUser(apiKey, fid, type, limit, cursor, 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 new file mode 100644 index 00000000..030f480e --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/apis/signer-api.ts @@ -0,0 +1,295 @@ +/* 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. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { ErrorRes } from '../models'; +// @ts-ignore +import { RegisterSignerKeyReqBody } from '../models'; +// @ts-ignore +import { Signer } from '../models'; +/** + * SignerApi - axios parameter creator + * @export + */ +export const SignerApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Creates a signer and returns the signer status. \\ **Note**: While tesing please reuse the signer, it costs money to approve a signer. + * @summary Creates a signer and returns the signer status + * @param {string} apiKey API key required for authentication. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createSigner: async (apiKey: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('createSigner', 'apiKey', apiKey) + 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; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Registers an app fid, deadline and a signature. Returns the signer status with an approval url. + * @summary Register Signed Key + * @param {string} apiKey API key required for authentication. + * @param {RegisterSignerKeyReqBody} registerSignerKeyReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + registerSignedKey: async (apiKey: string, registerSignerKeyReqBody: RegisterSignerKeyReqBody, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('registerSignedKey', 'apiKey', apiKey) + // verify required parameter 'registerSignerKeyReqBody' is not null or undefined + assertParamExists('registerSignedKey', 'registerSignerKeyReqBody', registerSignerKeyReqBody) + 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; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(registerSignerKeyReqBody, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Gets information status of a signer by passing in a signer_uuid (Use post API to generate a signer) + * @summary Fetches the status of a signer + * @param {string} apiKey API key required for authentication. + * @param {string} signerUuid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + signer: async (apiKey: string, signerUuid: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('signer', 'apiKey', apiKey) + // verify required parameter 'signerUuid' is not null or undefined + assertParamExists('signer', 'signerUuid', signerUuid) + 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; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (signerUuid !== undefined) { + localVarQueryParameter['signer_uuid'] = signerUuid; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * SignerApi - functional programming interface + * @export + */ +export const SignerApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = SignerApiAxiosParamCreator(configuration) + return { + /** + * Creates a signer and returns the signer status. \\ **Note**: While tesing please reuse the signer, it costs money to approve a signer. + * @summary Creates a signer and returns the signer status + * @param {string} apiKey API key required for authentication. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createSigner(apiKey: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createSigner(apiKey, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Registers an app fid, deadline and a signature. Returns the signer status with an approval url. + * @summary Register Signed Key + * @param {string} apiKey API key required for authentication. + * @param {RegisterSignerKeyReqBody} registerSignerKeyReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async registerSignedKey(apiKey: string, registerSignerKeyReqBody: RegisterSignerKeyReqBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.registerSignedKey(apiKey, registerSignerKeyReqBody, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Gets information status of a signer by passing in a signer_uuid (Use post API to generate a signer) + * @summary Fetches the status of a signer + * @param {string} apiKey API key required for authentication. + * @param {string} signerUuid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async signer(apiKey: string, signerUuid: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.signer(apiKey, signerUuid, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * SignerApi - factory interface + * @export + */ +export const SignerApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = SignerApiFp(configuration) + return { + /** + * Creates a signer and returns the signer status. \\ **Note**: While tesing please reuse the signer, it costs money to approve a signer. + * @summary Creates a signer and returns the signer status + * @param {string} apiKey API key required for authentication. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createSigner(apiKey: string, options?: any): AxiosPromise { + return localVarFp.createSigner(apiKey, 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 {string} apiKey API key required for authentication. + * @param {RegisterSignerKeyReqBody} registerSignerKeyReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + registerSignedKey(apiKey: string, registerSignerKeyReqBody: RegisterSignerKeyReqBody, options?: any): AxiosPromise { + return localVarFp.registerSignedKey(apiKey, registerSignerKeyReqBody, 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 Fetches the status of a signer + * @param {string} apiKey API key required for authentication. + * @param {string} signerUuid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + signer(apiKey: string, signerUuid: string, options?: any): AxiosPromise { + return localVarFp.signer(apiKey, signerUuid, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * SignerApi - object-oriented interface + * @export + * @class SignerApi + * @extends {BaseAPI} + */ +export class SignerApi extends BaseAPI { + /** + * Creates a signer and returns the signer status. \\ **Note**: While tesing please reuse the signer, it costs money to approve a signer. + * @summary Creates a signer and returns the signer status + * @param {string} apiKey API key required for authentication. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SignerApi + */ + public createSigner(apiKey: string, options?: AxiosRequestConfig) { + return SignerApiFp(this.configuration).createSigner(apiKey, 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 {string} apiKey API key required for authentication. + * @param {RegisterSignerKeyReqBody} registerSignerKeyReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SignerApi + */ + public registerSignedKey(apiKey: string, registerSignerKeyReqBody: RegisterSignerKeyReqBody, options?: AxiosRequestConfig) { + return SignerApiFp(this.configuration).registerSignedKey(apiKey, registerSignerKeyReqBody, 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 Fetches the status of a signer + * @param {string} apiKey API key required for authentication. + * @param {string} signerUuid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SignerApi + */ + public signer(apiKey: string, signerUuid: string, options?: AxiosRequestConfig) { + return SignerApiFp(this.configuration).signer(apiKey, signerUuid, 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 new file mode 100644 index 00000000..441d26ec --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/apis/storage-api.ts @@ -0,0 +1,226 @@ +/* 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. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { ErrorRes } from '../models'; +// @ts-ignore +import { StorageAllocationsResponse } from '../models'; +// @ts-ignore +import { StorageUsageResponse } from '../models'; +/** + * StorageApi - axios parameter creator + * @export + */ +export const StorageApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Fetches storage allocations for a given user + * @summary Fetches storage allocations for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + storageAllocations: async (apiKey: string, fid: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('storageAllocations', 'apiKey', apiKey) + // verify required parameter 'fid' is not null or undefined + assertParamExists('storageAllocations', '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); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Fetches storage usage for a given user + * @summary Fetches storage usage for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + storageUsage: async (apiKey: string, fid: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('storageUsage', 'apiKey', apiKey) + // verify required parameter 'fid' is not null or undefined + assertParamExists('storageUsage', '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); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * StorageApi - functional programming interface + * @export + */ +export const StorageApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = StorageApiAxiosParamCreator(configuration) + return { + /** + * Fetches storage allocations for a given user + * @summary Fetches storage allocations for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async storageAllocations(apiKey: string, fid: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.storageAllocations(apiKey, fid, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Fetches storage usage for a given user + * @summary Fetches storage usage for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async storageUsage(apiKey: string, fid: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.storageUsage(apiKey, fid, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * StorageApi - factory interface + * @export + */ +export const StorageApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = StorageApiFp(configuration) + return { + /** + * Fetches storage allocations for a given user + * @summary Fetches storage allocations for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + storageAllocations(apiKey: string, fid: number, options?: any): AxiosPromise { + return localVarFp.storageAllocations(apiKey, fid, options).then((request) => request(axios, basePath)); + }, + /** + * Fetches storage usage for a given user + * @summary Fetches storage usage for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + storageUsage(apiKey: string, fid: number, options?: any): AxiosPromise { + return localVarFp.storageUsage(apiKey, fid, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * StorageApi - object-oriented interface + * @export + * @class StorageApi + * @extends {BaseAPI} + */ +export class StorageApi extends BaseAPI { + /** + * Fetches storage allocations for a given user + * @summary Fetches storage allocations for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StorageApi + */ + public storageAllocations(apiKey: string, fid: number, options?: AxiosRequestConfig) { + return StorageApiFp(this.configuration).storageAllocations(apiKey, fid, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Fetches storage usage for a given user + * @summary Fetches storage usage for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StorageApi + */ + public storageUsage(apiKey: string, fid: number, options?: AxiosRequestConfig) { + return StorageApiFp(this.configuration).storageUsage(apiKey, fid, 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 new file mode 100644 index 00000000..ec829efb --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/apis/user-api.ts @@ -0,0 +1,733 @@ +/* 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. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { AddVerificationReqBody } from '../models'; +// @ts-ignore +import { BulkFollowResponse } from '../models'; +// @ts-ignore +import { BulkUsersResponse } from '../models'; +// @ts-ignore +import { ErrorRes } from '../models'; +// @ts-ignore +import { FollowReqBody } from '../models'; +// @ts-ignore +import { OperationResponse } from '../models'; +// @ts-ignore +import { RemoveVerificationReqBody } from '../models'; +// @ts-ignore +import { UpdateUserReqBody } from '../models'; +// @ts-ignore +import { UserResponse } from '../models'; +// @ts-ignore +import { UserSearchResponse } from '../models'; +/** + * UserApi - axios parameter creator + * @export + */ +export const UserApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Removes verification for an eth address for the user \\ (In order to delete verification `signer_uuid` must be approved) + * @summary Removes verification for an eth address for the user + * @param {string} apiKey API key required for authentication. + * @param {RemoveVerificationReqBody} removeVerificationReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + farcasterUserVerificationDelete: async (apiKey: string, removeVerificationReqBody: RemoveVerificationReqBody, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('farcasterUserVerificationDelete', 'apiKey', apiKey) + // verify required parameter 'removeVerificationReqBody' is not null or undefined + assertParamExists('farcasterUserVerificationDelete', 'removeVerificationReqBody', removeVerificationReqBody) + 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; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + 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), + options: localVarRequestOptions, + }; + }, + /** + * Adds verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) + * @summary Adds verification for an eth address for the user + * @param {string} apiKey API key required for authentication. + * @param {AddVerificationReqBody} addVerificationReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + farcasterUserVerificationPost: async (apiKey: string, addVerificationReqBody: AddVerificationReqBody, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('farcasterUserVerificationPost', 'apiKey', apiKey) + // verify required parameter 'addVerificationReqBody' is not null or undefined + assertParamExists('farcasterUserVerificationPost', 'addVerificationReqBody', addVerificationReqBody) + 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; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + 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), + options: localVarRequestOptions, + }; + }, + /** + * Follow a user \\ (In order to follow a user `signer_uuid` must be approved) + * @summary Follow a user + * @param {string} apiKey API key required for authentication. + * @param {FollowReqBody} followReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + followUser: async (apiKey: string, followReqBody: FollowReqBody, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('followUser', 'apiKey', apiKey) + // verify required parameter 'followReqBody' is not null or undefined + assertParamExists('followUser', 'followReqBody', followReqBody) + 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; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + 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), + options: localVarRequestOptions, + }; + }, + /** + * Lookup a user by custody-address + * @summary Lookup a user by custody-address + * @param {string} apiKey API key required for authentication. + * @param {string} custodyAddress Custody Address associated with mnemonic + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + lookupUserByCustodyAddress: async (apiKey: string, custodyAddress: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('lookupUserByCustodyAddress', 'apiKey', apiKey) + // verify required parameter 'custodyAddress' is not null or undefined + assertParamExists('lookupUserByCustodyAddress', 'custodyAddress', custodyAddress) + 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; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (custodyAddress !== undefined) { + localVarQueryParameter['custody_address'] = custodyAddress; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Unfollow a user \\ (In order to unfollow a user `signer_uuid` must be approved) + * @summary Unfollow a user + * @param {string} apiKey API key required for authentication. + * @param {FollowReqBody} followReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + unfollowUser: async (apiKey: string, followReqBody: FollowReqBody, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('unfollowUser', 'apiKey', apiKey) + // verify required parameter 'followReqBody' is not null or undefined + assertParamExists('unfollowUser', 'followReqBody', followReqBody) + 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; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + 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), + options: localVarRequestOptions, + }; + }, + /** + * Update user profile \\ (In order to update user\'s profile `signer_uuid` must be approved) + * @summary Update user profile + * @param {string} apiKey API key required for authentication. + * @param {UpdateUserReqBody} updateUserReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateUser: async (apiKey: string, updateUserReqBody: UpdateUserReqBody, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('updateUser', 'apiKey', apiKey) + // verify required parameter 'updateUserReqBody' is not null or undefined + assertParamExists('updateUser', 'updateUserReqBody', updateUserReqBody) + 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; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(updateUserReqBody, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Fetches information about multiple users based on FIDs + * @summary Fetches information about multiple users based on FIDs + * @param {string} apiKey API key required for authentication. + * @param {string} fids + * @param {number} [viewerFid] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userBulk: async (apiKey: string, fids: string, viewerFid?: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('userBulk', 'apiKey', apiKey) + // verify required parameter 'fids' is not null or undefined + assertParamExists('userBulk', '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; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (fids !== undefined) { + localVarQueryParameter['fids'] = fids; + } + + if (viewerFid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewerFid; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Search for Usernames + * @summary Search for Usernames + * @param {string} apiKey API key required for authentication. + * @param {string} q + * @param {number} viewerFid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userSearch: async (apiKey: string, q: string, viewerFid: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('userSearch', 'apiKey', apiKey) + // verify required parameter 'q' is not null or undefined + assertParamExists('userSearch', 'q', q) + // verify required parameter 'viewerFid' is not null or undefined + assertParamExists('userSearch', 'viewerFid', viewerFid) + 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; + + if (q !== undefined) { + localVarQueryParameter['q'] = q; + } + + if (viewerFid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewerFid; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * UserApi - functional programming interface + * @export + */ +export const UserApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = UserApiAxiosParamCreator(configuration) + return { + /** + * Removes verification for an eth address for the user \\ (In order to delete verification `signer_uuid` must be approved) + * @summary Removes verification for an eth address for the user + * @param {string} apiKey API key required for authentication. + * @param {RemoveVerificationReqBody} removeVerificationReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async farcasterUserVerificationDelete(apiKey: string, removeVerificationReqBody: RemoveVerificationReqBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.farcasterUserVerificationDelete(apiKey, removeVerificationReqBody, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Adds verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) + * @summary Adds verification for an eth address for the user + * @param {string} apiKey API key required for authentication. + * @param {AddVerificationReqBody} addVerificationReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async farcasterUserVerificationPost(apiKey: string, addVerificationReqBody: AddVerificationReqBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.farcasterUserVerificationPost(apiKey, addVerificationReqBody, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Follow a user \\ (In order to follow a user `signer_uuid` must be approved) + * @summary Follow a user + * @param {string} apiKey API key required for authentication. + * @param {FollowReqBody} followReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async followUser(apiKey: string, followReqBody: FollowReqBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.followUser(apiKey, followReqBody, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Lookup a user by custody-address + * @summary Lookup a user by custody-address + * @param {string} apiKey API key required for authentication. + * @param {string} custodyAddress Custody Address associated with mnemonic + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async lookupUserByCustodyAddress(apiKey: string, custodyAddress: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.lookupUserByCustodyAddress(apiKey, custodyAddress, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Unfollow a user \\ (In order to unfollow a user `signer_uuid` must be approved) + * @summary Unfollow a user + * @param {string} apiKey API key required for authentication. + * @param {FollowReqBody} followReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async unfollowUser(apiKey: string, followReqBody: FollowReqBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.unfollowUser(apiKey, followReqBody, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Update user profile \\ (In order to update user\'s profile `signer_uuid` must be approved) + * @summary Update user profile + * @param {string} apiKey API key required for authentication. + * @param {UpdateUserReqBody} updateUserReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateUser(apiKey: string, updateUserReqBody: UpdateUserReqBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateUser(apiKey, updateUserReqBody, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Fetches information about multiple users based on FIDs + * @summary Fetches information about multiple users based on FIDs + * @param {string} apiKey API key required for authentication. + * @param {string} fids + * @param {number} [viewerFid] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async userBulk(apiKey: string, fids: string, viewerFid?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.userBulk(apiKey, fids, viewerFid, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Search for Usernames + * @summary Search for Usernames + * @param {string} apiKey API key required for authentication. + * @param {string} q + * @param {number} viewerFid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async userSearch(apiKey: string, q: string, viewerFid: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.userSearch(apiKey, q, viewerFid, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * UserApi - factory interface + * @export + */ +export const UserApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = UserApiFp(configuration) + return { + /** + * Removes verification for an eth address for the user \\ (In order to delete verification `signer_uuid` must be approved) + * @summary Removes verification for an eth address for the user + * @param {string} apiKey API key required for authentication. + * @param {RemoveVerificationReqBody} removeVerificationReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + farcasterUserVerificationDelete(apiKey: string, removeVerificationReqBody: RemoveVerificationReqBody, options?: any): AxiosPromise { + return localVarFp.farcasterUserVerificationDelete(apiKey, removeVerificationReqBody, options).then((request) => request(axios, basePath)); + }, + /** + * Adds verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) + * @summary Adds verification for an eth address for the user + * @param {string} apiKey API key required for authentication. + * @param {AddVerificationReqBody} addVerificationReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + farcasterUserVerificationPost(apiKey: string, addVerificationReqBody: AddVerificationReqBody, options?: any): AxiosPromise { + return localVarFp.farcasterUserVerificationPost(apiKey, addVerificationReqBody, options).then((request) => request(axios, basePath)); + }, + /** + * Follow a user \\ (In order to follow a user `signer_uuid` must be approved) + * @summary Follow a user + * @param {string} apiKey API key required for authentication. + * @param {FollowReqBody} followReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + followUser(apiKey: string, followReqBody: FollowReqBody, options?: any): AxiosPromise { + return localVarFp.followUser(apiKey, followReqBody, options).then((request) => request(axios, basePath)); + }, + /** + * Lookup a user by custody-address + * @summary Lookup a user by custody-address + * @param {string} apiKey API key required for authentication. + * @param {string} custodyAddress Custody Address associated with mnemonic + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + lookupUserByCustodyAddress(apiKey: string, custodyAddress: string, options?: any): AxiosPromise { + return localVarFp.lookupUserByCustodyAddress(apiKey, custodyAddress, options).then((request) => request(axios, basePath)); + }, + /** + * Unfollow a user \\ (In order to unfollow a user `signer_uuid` must be approved) + * @summary Unfollow a user + * @param {string} apiKey API key required for authentication. + * @param {FollowReqBody} followReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + unfollowUser(apiKey: string, followReqBody: FollowReqBody, options?: any): AxiosPromise { + return localVarFp.unfollowUser(apiKey, followReqBody, 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 {string} apiKey API key required for authentication. + * @param {UpdateUserReqBody} updateUserReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateUser(apiKey: string, updateUserReqBody: UpdateUserReqBody, options?: any): AxiosPromise { + return localVarFp.updateUser(apiKey, updateUserReqBody, options).then((request) => request(axios, basePath)); + }, + /** + * Fetches information about multiple users based on FIDs + * @summary Fetches information about multiple users based on FIDs + * @param {string} apiKey API key required for authentication. + * @param {string} fids + * @param {number} [viewerFid] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userBulk(apiKey: string, fids: string, viewerFid?: number, options?: any): AxiosPromise { + return localVarFp.userBulk(apiKey, fids, viewerFid, options).then((request) => request(axios, basePath)); + }, + /** + * Search for Usernames + * @summary Search for Usernames + * @param {string} apiKey API key required for authentication. + * @param {string} q + * @param {number} viewerFid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userSearch(apiKey: string, q: string, viewerFid: number, options?: any): AxiosPromise { + return localVarFp.userSearch(apiKey, q, viewerFid, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * UserApi - object-oriented interface + * @export + * @class UserApi + * @extends {BaseAPI} + */ +export class UserApi extends BaseAPI { + /** + * Removes verification for an eth address for the user \\ (In order to delete verification `signer_uuid` must be approved) + * @summary Removes verification for an eth address for the user + * @param {string} apiKey API key required for authentication. + * @param {RemoveVerificationReqBody} removeVerificationReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public farcasterUserVerificationDelete(apiKey: string, removeVerificationReqBody: RemoveVerificationReqBody, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).farcasterUserVerificationDelete(apiKey, removeVerificationReqBody, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Adds verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) + * @summary Adds verification for an eth address for the user + * @param {string} apiKey API key required for authentication. + * @param {AddVerificationReqBody} addVerificationReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public farcasterUserVerificationPost(apiKey: string, addVerificationReqBody: AddVerificationReqBody, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).farcasterUserVerificationPost(apiKey, addVerificationReqBody, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Follow a user \\ (In order to follow a user `signer_uuid` must be approved) + * @summary Follow a user + * @param {string} apiKey API key required for authentication. + * @param {FollowReqBody} followReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public followUser(apiKey: string, followReqBody: FollowReqBody, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).followUser(apiKey, followReqBody, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Lookup a user by custody-address + * @summary Lookup a user by custody-address + * @param {string} apiKey API key required for authentication. + * @param {string} custodyAddress Custody Address associated with mnemonic + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public lookupUserByCustodyAddress(apiKey: string, custodyAddress: string, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).lookupUserByCustodyAddress(apiKey, custodyAddress, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Unfollow a user \\ (In order to unfollow a user `signer_uuid` must be approved) + * @summary Unfollow a user + * @param {string} apiKey API key required for authentication. + * @param {FollowReqBody} followReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public unfollowUser(apiKey: string, followReqBody: FollowReqBody, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).unfollowUser(apiKey, followReqBody, 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 {string} apiKey API key required for authentication. + * @param {UpdateUserReqBody} updateUserReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public updateUser(apiKey: string, updateUserReqBody: UpdateUserReqBody, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).updateUser(apiKey, updateUserReqBody, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Fetches information about multiple users based on FIDs + * @summary Fetches information about multiple users based on FIDs + * @param {string} apiKey API key required for authentication. + * @param {string} fids + * @param {number} [viewerFid] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public userBulk(apiKey: string, fids: string, viewerFid?: number, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).userBulk(apiKey, fids, viewerFid, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Search for Usernames + * @summary Search for Usernames + * @param {string} apiKey API key required for authentication. + * @param {string} q + * @param {number} viewerFid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public userSearch(apiKey: string, q: string, viewerFid: number, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).userSearch(apiKey, q, viewerFid, options).then((request) => request(this.axios, this.basePath)); + } +} + diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/base.ts b/src/neynar-api/v2/openapi-farcaster/base.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/base.ts rename to src/neynar-api/v2/openapi-farcaster/base.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/common.ts b/src/neynar-api/v2/openapi-farcaster/common.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/common.ts rename to src/neynar-api/v2/openapi-farcaster/common.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/configuration.ts b/src/neynar-api/v2/openapi-farcaster/configuration.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/configuration.ts rename to src/neynar-api/v2/openapi-farcaster/configuration.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/git_push.sh b/src/neynar-api/v2/openapi-farcaster/git_push.sh similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/git_push.sh rename to src/neynar-api/v2/openapi-farcaster/git_push.sh diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/index.ts b/src/neynar-api/v2/openapi-farcaster/index.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/index.ts rename to src/neynar-api/v2/openapi-farcaster/index.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/active-status.ts b/src/neynar-api/v2/openapi-farcaster/models/active-status.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/active-status.ts rename to src/neynar-api/v2/openapi-farcaster/models/active-status.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/add-verification-req-body.ts b/src/neynar-api/v2/openapi-farcaster/models/add-verification-req-body.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/add-verification-req-body.ts rename to src/neynar-api/v2/openapi-farcaster/models/add-verification-req-body.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/bulk-follow-response.ts b/src/neynar-api/v2/openapi-farcaster/models/bulk-follow-response.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/bulk-follow-response.ts rename to src/neynar-api/v2/openapi-farcaster/models/bulk-follow-response.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-bulk200-response.ts b/src/neynar-api/v2/openapi-farcaster/models/bulk-users-response.ts similarity index 84% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-bulk200-response.ts rename to src/neynar-api/v2/openapi-farcaster/models/bulk-users-response.ts index 110d77c4..d12e186a 100644 --- a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-bulk200-response.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/bulk-users-response.ts @@ -20,13 +20,13 @@ import { User } from './user'; /** * * @export - * @interface UserBulk200Response + * @interface BulkUsersResponse */ -export interface UserBulk200Response { +export interface BulkUsersResponse { /** * * @type {Array} - * @memberof UserBulk200Response + * @memberof BulkUsersResponse */ 'users': Array; } diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-id.ts b/src/neynar-api/v2/openapi-farcaster/models/cast-id.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-id.ts rename to src/neynar-api/v2/openapi-farcaster/models/cast-id.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-notification-type.ts b/src/neynar-api/v2/openapi-farcaster/models/cast-notification-type.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-notification-type.ts rename to src/neynar-api/v2/openapi-farcaster/models/cast-notification-type.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-param-type.ts b/src/neynar-api/v2/openapi-farcaster/models/cast-param-type.ts similarity index 78% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-param-type.ts rename to src/neynar-api/v2/openapi-farcaster/models/cast-param-type.ts index 45f0256a..c9279ee7 100644 --- a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-param-type.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/cast-param-type.ts @@ -20,10 +20,12 @@ * @enum {string} */ -export enum CastParamType { - Url = 'url', - Hash = 'hash' -} +export const CastParamType = { + Url: 'url', + Hash: 'hash' +} as const; + +export type CastParamType = typeof CastParamType[keyof typeof CastParamType]; diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-parent-author.ts b/src/neynar-api/v2/openapi-farcaster/models/cast-parent-author.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-parent-author.ts rename to src/neynar-api/v2/openapi-farcaster/models/cast-parent-author.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-response.ts b/src/neynar-api/v2/openapi-farcaster/models/cast-response.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-response.ts rename to src/neynar-api/v2/openapi-farcaster/models/cast-response.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-with-interactions-reactions.ts b/src/neynar-api/v2/openapi-farcaster/models/cast-with-interactions-reactions.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-with-interactions-reactions.ts rename to src/neynar-api/v2/openapi-farcaster/models/cast-with-interactions-reactions.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-with-interactions-replies.ts b/src/neynar-api/v2/openapi-farcaster/models/cast-with-interactions-replies.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-with-interactions-replies.ts rename to src/neynar-api/v2/openapi-farcaster/models/cast-with-interactions-replies.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-with-interactions.ts b/src/neynar-api/v2/openapi-farcaster/models/cast-with-interactions.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-with-interactions.ts rename to src/neynar-api/v2/openapi-farcaster/models/cast-with-interactions.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast.ts b/src/neynar-api/v2/openapi-farcaster/models/cast.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast.ts rename to src/neynar-api/v2/openapi-farcaster/models/cast.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/casts-response-result.ts b/src/neynar-api/v2/openapi-farcaster/models/casts-response-result.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/casts-response-result.ts rename to src/neynar-api/v2/openapi-farcaster/models/casts-response-result.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/casts-response.ts b/src/neynar-api/v2/openapi-farcaster/models/casts-response.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/casts-response.ts rename to src/neynar-api/v2/openapi-farcaster/models/casts-response.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/dehydrated-follower.ts b/src/neynar-api/v2/openapi-farcaster/models/dehydrated-follower.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/dehydrated-follower.ts rename to src/neynar-api/v2/openapi-farcaster/models/dehydrated-follower.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/delete-cast-req-body.ts b/src/neynar-api/v2/openapi-farcaster/models/delete-cast-req-body.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/delete-cast-req-body.ts rename to src/neynar-api/v2/openapi-farcaster/models/delete-cast-req-body.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/embed-cast-id.ts b/src/neynar-api/v2/openapi-farcaster/models/embed-cast-id.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/embed-cast-id.ts rename to src/neynar-api/v2/openapi-farcaster/models/embed-cast-id.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/embed-url.ts b/src/neynar-api/v2/openapi-farcaster/models/embed-url.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/embed-url.ts rename to src/neynar-api/v2/openapi-farcaster/models/embed-url.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/embedded-cast.ts b/src/neynar-api/v2/openapi-farcaster/models/embedded-cast.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/embedded-cast.ts rename to src/neynar-api/v2/openapi-farcaster/models/embedded-cast.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/error-res.ts b/src/neynar-api/v2/openapi-farcaster/models/error-res.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/error-res.ts rename to src/neynar-api/v2/openapi-farcaster/models/error-res.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/feed-response.ts b/src/neynar-api/v2/openapi-farcaster/models/feed-response.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/feed-response.ts rename to src/neynar-api/v2/openapi-farcaster/models/feed-response.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/reaction-type.ts b/src/neynar-api/v2/openapi-farcaster/models/feed-type.ts similarity index 72% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/reaction-type.ts rename to src/neynar-api/v2/openapi-farcaster/models/feed-type.ts index f96cbd52..d68c05b7 100644 --- a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/reaction-type.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/feed-type.ts @@ -5,20 +5,27 @@ * 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. */ + + /** - * + * * @export * @enum {string} */ -export enum ReactionType { - Like = "like", - Recast = "recast", -} +export const FeedType = { + Following: 'following', + Filter: 'filter' +} as const; + +export type FeedType = typeof FeedType[keyof typeof FeedType]; + + + diff --git a/src/neynar-api/v2/openapi-farcaster/models/filter-type.ts b/src/neynar-api/v2/openapi-farcaster/models/filter-type.ts new file mode 100644 index 00000000..e46fa7d3 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/filter-type.ts @@ -0,0 +1,32 @@ +/* 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. + */ + + + +/** + * + * @export + * @enum {string} + */ + +export const FilterType = { + Fids: 'fids', + ParentUrl: 'parent_url', + GlobalTrending: 'global_trending' +} as const; + +export type FilterType = typeof FilterType[keyof typeof FilterType]; + + + diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/follow-req-body.ts b/src/neynar-api/v2/openapi-farcaster/models/follow-req-body.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/follow-req-body.ts rename to src/neynar-api/v2/openapi-farcaster/models/follow-req-body.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/follow-response.ts b/src/neynar-api/v2/openapi-farcaster/models/follow-response.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/follow-response.ts rename to src/neynar-api/v2/openapi-farcaster/models/follow-response.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/notification-follow.ts b/src/neynar-api/v2/openapi-farcaster/models/follow.ts similarity index 64% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/notification-follow.ts rename to src/neynar-api/v2/openapi-farcaster/models/follow.ts index 071a3910..2980a07b 100644 --- a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/notification-follow.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/follow.ts @@ -20,27 +20,27 @@ import { User } from './user'; /** * * @export - * @interface NotificationFollow + * @interface Follow */ -export interface NotificationFollow { +export interface Follow { /** * * @type {string} - * @memberof NotificationFollow + * @memberof Follow */ - 'object': NotificationFollowObjectEnum; + 'object': FollowObjectEnum; /** * * @type {User} - * @memberof NotificationFollow + * @memberof Follow */ 'user': User; } -export const NotificationFollowObjectEnum = { +export const FollowObjectEnum = { Follow: 'follow' } as const; -export type NotificationFollowObjectEnum = typeof NotificationFollowObjectEnum[keyof typeof NotificationFollowObjectEnum]; +export type FollowObjectEnum = typeof FollowObjectEnum[keyof typeof FollowObjectEnum]; diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/get-casts-req-body.ts b/src/neynar-api/v2/openapi-farcaster/models/get-casts-req-body.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/get-casts-req-body.ts rename to src/neynar-api/v2/openapi-farcaster/models/get-casts-req-body.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/hydrated-follower.ts b/src/neynar-api/v2/openapi-farcaster/models/hydrated-follower.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/hydrated-follower.ts rename to src/neynar-api/v2/openapi-farcaster/models/hydrated-follower.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/index.ts b/src/neynar-api/v2/openapi-farcaster/models/index.ts similarity index 82% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/index.ts rename to src/neynar-api/v2/openapi-farcaster/models/index.ts index 28692408..56c7ddcc 100644 --- a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/index.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/index.ts @@ -1,6 +1,7 @@ export * from './active-status'; export * from './add-verification-req-body'; export * from './bulk-follow-response'; +export * from './bulk-users-response'; export * from './cast'; export * from './cast-id'; export * from './cast-notification-type'; @@ -19,6 +20,9 @@ export * from './embed-url'; export * from './embedded-cast'; export * from './error-res'; export * from './feed-response'; +export * from './feed-type'; +export * from './filter-type'; +export * from './follow'; export * from './follow-req-body'; export * from './follow-response'; export * from './get-casts-req-body'; @@ -26,9 +30,6 @@ export * from './hydrated-follower'; export * from './individual-hash-obj'; export * from './next-cursor'; export * from './notification'; -export * from './notification-follow'; -export * from './notification-reactions'; -export * from './notification-reactions-cast'; export * from './notifications-response'; export * from './operation-response'; export * from './post-cast-req-body'; @@ -41,14 +42,21 @@ export * from './reaction-like'; export * from './reaction-recast'; export * from './reaction-req-body'; export * from './reaction-type'; +export * from './reactions'; +export * from './reactions-cast'; +export * from './reactions-response'; +export * from './reactions-type'; export * from './register-signer-key-req-body'; export * from './relevant-followers-response'; export * from './remove-verification-req-body'; export * from './searched-user'; export * from './signer'; +export * from './storage-allocation'; +export * from './storage-allocations-response'; +export * from './storage-object'; +export * from './storage-usage-response'; export * from './update-user-req-body'; export * from './user'; -export * from './user-bulk200-response'; export * from './user-dehydrated'; export * from './user-profile'; export * from './user-profile-bio'; diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/individual-hash-obj.ts b/src/neynar-api/v2/openapi-farcaster/models/individual-hash-obj.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/individual-hash-obj.ts rename to src/neynar-api/v2/openapi-farcaster/models/individual-hash-obj.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/next-cursor.ts b/src/neynar-api/v2/openapi-farcaster/models/next-cursor.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/next-cursor.ts rename to src/neynar-api/v2/openapi-farcaster/models/next-cursor.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/notification.ts b/src/neynar-api/v2/openapi-farcaster/models/notification.ts similarity index 83% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/notification.ts rename to src/neynar-api/v2/openapi-farcaster/models/notification.ts index 372c281b..10d4d199 100644 --- a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/notification.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/notification.ts @@ -18,10 +18,10 @@ import { CastWithInteractions } from './cast-with-interactions'; // May contain unused imports in some cases // @ts-ignore -import { NotificationFollow } from './notification-follow'; +import { Follow } from './follow'; // May contain unused imports in some cases // @ts-ignore -import { NotificationReactions } from './notification-reactions'; +import { Reactions } from './reactions'; /** * @@ -49,10 +49,10 @@ export interface Notification { 'type': NotificationTypeEnum; /** * - * @type {Array} + * @type {Array} * @memberof Notification */ - 'follows'?: Array; + 'follows'?: Array; /** * * @type {CastWithInteractions} @@ -61,10 +61,10 @@ export interface Notification { 'cast'?: CastWithInteractions; /** * - * @type {Array} + * @type {Array} * @memberof Notification */ - 'reactions'?: Array; + 'reactions'?: Array; } export const NotificationTypeEnum = { diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/notifications-response.ts b/src/neynar-api/v2/openapi-farcaster/models/notifications-response.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/notifications-response.ts rename to src/neynar-api/v2/openapi-farcaster/models/notifications-response.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/operation-response.ts b/src/neynar-api/v2/openapi-farcaster/models/operation-response.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/operation-response.ts rename to src/neynar-api/v2/openapi-farcaster/models/operation-response.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/post-cast-req-body.ts b/src/neynar-api/v2/openapi-farcaster/models/post-cast-req-body.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/post-cast-req-body.ts rename to src/neynar-api/v2/openapi-farcaster/models/post-cast-req-body.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/post-cast-response-cast-author.ts b/src/neynar-api/v2/openapi-farcaster/models/post-cast-response-cast-author.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/post-cast-response-cast-author.ts rename to src/neynar-api/v2/openapi-farcaster/models/post-cast-response-cast-author.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/post-cast-response-cast.ts b/src/neynar-api/v2/openapi-farcaster/models/post-cast-response-cast.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/post-cast-response-cast.ts rename to src/neynar-api/v2/openapi-farcaster/models/post-cast-response-cast.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/post-cast-response.ts b/src/neynar-api/v2/openapi-farcaster/models/post-cast-response.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/post-cast-response.ts rename to src/neynar-api/v2/openapi-farcaster/models/post-cast-response.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/profile-url-pfp.ts b/src/neynar-api/v2/openapi-farcaster/models/profile-url-pfp.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/profile-url-pfp.ts rename to src/neynar-api/v2/openapi-farcaster/models/profile-url-pfp.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/profile-url.ts b/src/neynar-api/v2/openapi-farcaster/models/profile-url.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/profile-url.ts rename to src/neynar-api/v2/openapi-farcaster/models/profile-url.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/reaction-like.ts b/src/neynar-api/v2/openapi-farcaster/models/reaction-like.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/reaction-like.ts rename to src/neynar-api/v2/openapi-farcaster/models/reaction-like.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/reaction-recast.ts b/src/neynar-api/v2/openapi-farcaster/models/reaction-recast.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/reaction-recast.ts rename to src/neynar-api/v2/openapi-farcaster/models/reaction-recast.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/reaction-req-body.ts b/src/neynar-api/v2/openapi-farcaster/models/reaction-req-body.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/reaction-req-body.ts rename to src/neynar-api/v2/openapi-farcaster/models/reaction-req-body.ts diff --git a/src/neynar-api/v2/openapi-farcaster/models/reaction-type.ts b/src/neynar-api/v2/openapi-farcaster/models/reaction-type.ts new file mode 100644 index 00000000..0dac49b8 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/reaction-type.ts @@ -0,0 +1,31 @@ +/* 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. + */ + + + +/** + * + * @export + * @enum {string} + */ + +export const ReactionType = { + Like: 'like', + Recast: 'recast' +} as const; + +export type ReactionType = typeof ReactionType[keyof typeof ReactionType]; + + + diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/notification-reactions-cast.ts b/src/neynar-api/v2/openapi-farcaster/models/reactions-cast.ts similarity index 58% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/notification-reactions-cast.ts rename to src/neynar-api/v2/openapi-farcaster/models/reactions-cast.ts index c85bcec5..571e472d 100644 --- a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/notification-reactions-cast.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/reactions-cast.ts @@ -17,27 +17,27 @@ /** * * @export - * @interface NotificationReactionsCast + * @interface ReactionsCast */ -export interface NotificationReactionsCast { +export interface ReactionsCast { /** * * @type {string} - * @memberof NotificationReactionsCast + * @memberof ReactionsCast */ 'hash': string; /** * * @type {string} - * @memberof NotificationReactionsCast + * @memberof ReactionsCast */ - 'object': NotificationReactionsCastObjectEnum; + 'object': ReactionsCastObjectEnum; } -export const NotificationReactionsCastObjectEnum = { +export const ReactionsCastObjectEnum = { CastDehydrated: 'cast_dehydrated' } as const; -export type NotificationReactionsCastObjectEnum = typeof NotificationReactionsCastObjectEnum[keyof typeof NotificationReactionsCastObjectEnum]; +export type ReactionsCastObjectEnum = typeof ReactionsCastObjectEnum[keyof typeof ReactionsCastObjectEnum]; diff --git a/src/neynar-api/v2/openapi-farcaster/models/reactions-response.ts b/src/neynar-api/v2/openapi-farcaster/models/reactions-response.ts new file mode 100644 index 00000000..16fc01e8 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/reactions-response.ts @@ -0,0 +1,42 @@ +/* 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 { NextCursor } from './next-cursor'; +// May contain unused imports in some cases +// @ts-ignore +import { Reactions } from './reactions'; + +/** + * + * @export + * @interface ReactionsResponse + */ +export interface ReactionsResponse { + /** + * + * @type {Array} + * @memberof ReactionsResponse + */ + 'reactions': Array; + /** + * + * @type {NextCursor} + * @memberof ReactionsResponse + */ + 'next': NextCursor; +} + diff --git a/src/neynar-api/v2/openapi-farcaster/models/reactions-type.ts b/src/neynar-api/v2/openapi-farcaster/models/reactions-type.ts new file mode 100644 index 00000000..bd790042 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/reactions-type.ts @@ -0,0 +1,32 @@ +/* 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. + */ + + + +/** + * + * @export + * @enum {string} + */ + +export const ReactionsType = { + Likes: 'likes', + Recasts: 'recasts', + All: 'all' +} as const; + +export type ReactionsType = typeof ReactionsType[keyof typeof ReactionsType]; + + + diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/notification-reactions.ts b/src/neynar-api/v2/openapi-farcaster/models/reactions.ts similarity index 56% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/notification-reactions.ts rename to src/neynar-api/v2/openapi-farcaster/models/reactions.ts index 254ba878..bdd3068a 100644 --- a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/notification-reactions.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/reactions.ts @@ -15,7 +15,7 @@ // May contain unused imports in some cases // @ts-ignore -import { NotificationReactionsCast } from './notification-reactions-cast'; +import { ReactionsCast } from './reactions-cast'; // May contain unused imports in some cases // @ts-ignore import { User } from './user'; @@ -23,34 +23,34 @@ import { User } from './user'; /** * * @export - * @interface NotificationReactions + * @interface Reactions */ -export interface NotificationReactions { +export interface Reactions { /** * * @type {string} - * @memberof NotificationReactions + * @memberof Reactions */ - 'object': NotificationReactionsObjectEnum; + 'object': ReactionsObjectEnum; /** * - * @type {NotificationReactionsCast} - * @memberof NotificationReactions + * @type {ReactionsCast} + * @memberof Reactions */ - 'cast': NotificationReactionsCast; + 'cast': ReactionsCast; /** * * @type {User} - * @memberof NotificationReactions + * @memberof Reactions */ 'user': User; } -export const NotificationReactionsObjectEnum = { +export const ReactionsObjectEnum = { Likes: 'likes', Recasts: 'recasts' } as const; -export type NotificationReactionsObjectEnum = typeof NotificationReactionsObjectEnum[keyof typeof NotificationReactionsObjectEnum]; +export type ReactionsObjectEnum = typeof ReactionsObjectEnum[keyof typeof ReactionsObjectEnum]; diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/register-signer-key-req-body.ts b/src/neynar-api/v2/openapi-farcaster/models/register-signer-key-req-body.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/register-signer-key-req-body.ts rename to src/neynar-api/v2/openapi-farcaster/models/register-signer-key-req-body.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/relevant-followers-response.ts b/src/neynar-api/v2/openapi-farcaster/models/relevant-followers-response.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/relevant-followers-response.ts rename to src/neynar-api/v2/openapi-farcaster/models/relevant-followers-response.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/remove-verification-req-body.ts b/src/neynar-api/v2/openapi-farcaster/models/remove-verification-req-body.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/remove-verification-req-body.ts rename to src/neynar-api/v2/openapi-farcaster/models/remove-verification-req-body.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/searched-user.ts b/src/neynar-api/v2/openapi-farcaster/models/searched-user.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/searched-user.ts rename to src/neynar-api/v2/openapi-farcaster/models/searched-user.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/signer.ts b/src/neynar-api/v2/openapi-farcaster/models/signer.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/signer.ts rename to src/neynar-api/v2/openapi-farcaster/models/signer.ts diff --git a/src/neynar-api/v2/openapi-farcaster/models/storage-allocation.ts b/src/neynar-api/v2/openapi-farcaster/models/storage-allocation.ts new file mode 100644 index 00000000..68836ee7 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/storage-allocation.ts @@ -0,0 +1,57 @@ +/* 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 { UserDehydrated } from './user-dehydrated'; + +/** + * + * @export + * @interface StorageAllocation + */ +export interface StorageAllocation { + /** + * + * @type {string} + * @memberof StorageAllocation + */ + 'object'?: string; + /** + * + * @type {UserDehydrated} + * @memberof StorageAllocation + */ + 'user'?: UserDehydrated; + /** + * + * @type {number} + * @memberof StorageAllocation + */ + 'units'?: number; + /** + * + * @type {string} + * @memberof StorageAllocation + */ + 'expiry'?: string; + /** + * + * @type {string} + * @memberof StorageAllocation + */ + 'timestamp'?: string; +} + diff --git a/src/neynar-api/v2/openapi-farcaster/models/storage-allocations-response.ts b/src/neynar-api/v2/openapi-farcaster/models/storage-allocations-response.ts new file mode 100644 index 00000000..4c6b00a6 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/storage-allocations-response.ts @@ -0,0 +1,39 @@ +/* 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 { StorageAllocation } from './storage-allocation'; + +/** + * + * @export + * @interface StorageAllocationsResponse + */ +export interface StorageAllocationsResponse { + /** + * + * @type {number} + * @memberof StorageAllocationsResponse + */ + 'total_active_units'?: number; + /** + * + * @type {Array} + * @memberof StorageAllocationsResponse + */ + 'allocations'?: Array; +} + diff --git a/src/neynar-api/v2/openapi-farcaster/models/storage-object.ts b/src/neynar-api/v2/openapi-farcaster/models/storage-object.ts new file mode 100644 index 00000000..da1c061c --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/storage-object.ts @@ -0,0 +1,42 @@ +/* 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. + */ + + + +/** + * + * @export + * @interface StorageObject + */ +export interface StorageObject { + /** + * + * @type {string} + * @memberof StorageObject + */ + 'object'?: string; + /** + * + * @type {number} + * @memberof StorageObject + */ + 'used'?: number; + /** + * + * @type {number} + * @memberof StorageObject + */ + 'capacity'?: number; +} + diff --git a/src/neynar-api/v2/openapi-farcaster/models/storage-usage-response.ts b/src/neynar-api/v2/openapi-farcaster/models/storage-usage-response.ts new file mode 100644 index 00000000..885fe718 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/storage-usage-response.ts @@ -0,0 +1,84 @@ +/* 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 { StorageObject } from './storage-object'; +// May contain unused imports in some cases +// @ts-ignore +import { UserDehydrated } from './user-dehydrated'; + +/** + * + * @export + * @interface StorageUsageResponse + */ +export interface StorageUsageResponse { + /** + * + * @type {string} + * @memberof StorageUsageResponse + */ + 'object'?: string; + /** + * + * @type {UserDehydrated} + * @memberof StorageUsageResponse + */ + 'user'?: UserDehydrated; + /** + * + * @type {StorageObject} + * @memberof StorageUsageResponse + */ + 'casts'?: StorageObject; + /** + * + * @type {StorageObject} + * @memberof StorageUsageResponse + */ + 'reactions'?: StorageObject; + /** + * + * @type {StorageObject} + * @memberof StorageUsageResponse + */ + 'links'?: StorageObject; + /** + * + * @type {StorageObject} + * @memberof StorageUsageResponse + */ + 'verified_addresses'?: StorageObject; + /** + * + * @type {StorageObject} + * @memberof StorageUsageResponse + */ + 'username_proofs'?: StorageObject; + /** + * + * @type {StorageObject} + * @memberof StorageUsageResponse + */ + 'signers'?: StorageObject; + /** + * + * @type {number} + * @memberof StorageUsageResponse + */ + 'total_active_units'?: number; +} + diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/update-user-req-body.ts b/src/neynar-api/v2/openapi-farcaster/models/update-user-req-body.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/update-user-req-body.ts rename to src/neynar-api/v2/openapi-farcaster/models/update-user-req-body.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-dehydrated.ts b/src/neynar-api/v2/openapi-farcaster/models/user-dehydrated.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-dehydrated.ts rename to src/neynar-api/v2/openapi-farcaster/models/user-dehydrated.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-profile-bio.ts b/src/neynar-api/v2/openapi-farcaster/models/user-profile-bio.ts similarity index 82% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-profile-bio.ts rename to src/neynar-api/v2/openapi-farcaster/models/user-profile-bio.ts index fb6f1908..ba4b0901 100644 --- a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-profile-bio.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/user-profile-bio.ts @@ -26,5 +26,11 @@ export interface UserProfileBio { * @memberof UserProfileBio */ 'text': string; + /** + * + * @type {Array} + * @memberof UserProfileBio + */ + 'mentioned_profiles': Array; } diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-profile.ts b/src/neynar-api/v2/openapi-farcaster/models/user-profile.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-profile.ts rename to src/neynar-api/v2/openapi-farcaster/models/user-profile.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-response.ts b/src/neynar-api/v2/openapi-farcaster/models/user-response.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-response.ts rename to src/neynar-api/v2/openapi-farcaster/models/user-response.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-search-response-result.ts b/src/neynar-api/v2/openapi-farcaster/models/user-search-response-result.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-search-response-result.ts rename to src/neynar-api/v2/openapi-farcaster/models/user-search-response-result.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-search-response.ts b/src/neynar-api/v2/openapi-farcaster/models/user-search-response.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-search-response.ts rename to src/neynar-api/v2/openapi-farcaster/models/user-search-response.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-viewer-context.ts b/src/neynar-api/v2/openapi-farcaster/models/user-viewer-context.ts similarity index 85% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-viewer-context.ts rename to src/neynar-api/v2/openapi-farcaster/models/user-viewer-context.ts index 8a68f908..999f4291 100644 --- a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-viewer-context.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/user-viewer-context.ts @@ -22,15 +22,15 @@ export interface UserViewerContext { /** * - * @type {number} + * @type {boolean} * @memberof UserViewerContext */ - 'following': number; + 'following': boolean; /** * - * @type {number} + * @type {boolean} * @memberof UserViewerContext */ - 'followed_by': number; + 'followed_by': boolean; } diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/user.ts b/src/neynar-api/v2/openapi-farcaster/models/user.ts similarity index 98% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/user.ts rename to src/neynar-api/v2/openapi-farcaster/models/user.ts index 863bc66d..19d54584 100644 --- a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/user.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/user.ts @@ -94,7 +94,7 @@ export interface User { * @type {ActiveStatus} * @memberof User */ - 'activeStatus': ActiveStatus; + 'active_status': ActiveStatus; /** * * @type {UserViewerContext} diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/.gitignore b/src/neynar-api/v2/openapi-recommendation/.gitignore similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/.gitignore rename to src/neynar-api/v2/openapi-recommendation/.gitignore diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/.npmignore b/src/neynar-api/v2/openapi-recommendation/.npmignore similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/.npmignore rename to src/neynar-api/v2/openapi-recommendation/.npmignore diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/.openapi-generator-ignore b/src/neynar-api/v2/openapi-recommendation/.openapi-generator-ignore similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/.openapi-generator-ignore rename to src/neynar-api/v2/openapi-recommendation/.openapi-generator-ignore diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/.openapi-generator/FILES b/src/neynar-api/v2/openapi-recommendation/.openapi-generator/FILES similarity index 86% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/.openapi-generator/FILES rename to src/neynar-api/v2/openapi-recommendation/.openapi-generator/FILES index d1df1ba7..e9c6772f 100644 --- a/src/neynar-api/neynar-v2-api/openapi-recommendation/.openapi-generator/FILES +++ b/src/neynar-api/v2/openapi-recommendation/.openapi-generator/FILES @@ -10,9 +10,9 @@ git_push.sh index.ts models/active-status.ts models/error-res.ts -models/fetch-relevant-mints200-response.ts models/index.ts models/relevant-mint.ts +models/relevant-mints.ts models/user-profile-bio.ts models/user-profile.ts models/user.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/.openapi-generator/VERSION b/src/neynar-api/v2/openapi-recommendation/.openapi-generator/VERSION similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/.openapi-generator/VERSION rename to src/neynar-api/v2/openapi-recommendation/.openapi-generator/VERSION diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/api.ts b/src/neynar-api/v2/openapi-recommendation/api.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/api.ts rename to src/neynar-api/v2/openapi-recommendation/api.ts diff --git a/src/neynar-api/v2/openapi-recommendation/apis/nftapi.ts b/src/neynar-api/v2/openapi-recommendation/apis/nftapi.ts new file mode 100644 index 00000000..f2abf4a1 --- /dev/null +++ b/src/neynar-api/v2/openapi-recommendation/apis/nftapi.ts @@ -0,0 +1,162 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Recommendation 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. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { ErrorRes } from '../models'; +// @ts-ignore +import { RelevantMints } from '../models'; +/** + * NFTApi - axios parameter creator + * @export + */ +export const NFTApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Fetches all mint actions relevant for a contract address (and optionally tokenId for ERC1155s) given a user\'s ethereum address + * @summary Relevant Mints for a User + * @param {string} apiKey API key required for authentication. + * @param {string} address + * @param {string} contractAddress + * @param {string} [tokenId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + fetchRelevantMints: async (apiKey: string, address: string, contractAddress: string, tokenId?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('fetchRelevantMints', 'apiKey', apiKey) + // verify required parameter 'address' is not null or undefined + assertParamExists('fetchRelevantMints', 'address', address) + // verify required parameter 'contractAddress' is not null or undefined + assertParamExists('fetchRelevantMints', 'contractAddress', contractAddress) + const localVarPath = `/nft/relevant_mints`; + // 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; + + if (address !== undefined) { + localVarQueryParameter['address'] = address; + } + + if (contractAddress !== undefined) { + localVarQueryParameter['contract_address'] = contractAddress; + } + + if (tokenId !== undefined) { + localVarQueryParameter['token_id'] = tokenId; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * NFTApi - functional programming interface + * @export + */ +export const NFTApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = NFTApiAxiosParamCreator(configuration) + return { + /** + * Fetches all mint actions relevant for a contract address (and optionally tokenId for ERC1155s) given a user\'s ethereum address + * @summary Relevant Mints for a User + * @param {string} apiKey API key required for authentication. + * @param {string} address + * @param {string} contractAddress + * @param {string} [tokenId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async fetchRelevantMints(apiKey: string, address: string, contractAddress: string, tokenId?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchRelevantMints(apiKey, address, contractAddress, tokenId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * NFTApi - factory interface + * @export + */ +export const NFTApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = NFTApiFp(configuration) + return { + /** + * Fetches all mint actions relevant for a contract address (and optionally tokenId for ERC1155s) given a user\'s ethereum address + * @summary Relevant Mints for a User + * @param {string} apiKey API key required for authentication. + * @param {string} address + * @param {string} contractAddress + * @param {string} [tokenId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + fetchRelevantMints(apiKey: string, address: string, contractAddress: string, tokenId?: string, options?: any): AxiosPromise { + return localVarFp.fetchRelevantMints(apiKey, address, contractAddress, tokenId, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * NFTApi - object-oriented interface + * @export + * @class NFTApi + * @extends {BaseAPI} + */ +export class NFTApi extends BaseAPI { + /** + * Fetches all mint actions relevant for a contract address (and optionally tokenId for ERC1155s) given a user\'s ethereum address + * @summary Relevant Mints for a User + * @param {string} apiKey API key required for authentication. + * @param {string} address + * @param {string} contractAddress + * @param {string} [tokenId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NFTApi + */ + public fetchRelevantMints(apiKey: string, address: string, contractAddress: string, tokenId?: string, options?: AxiosRequestConfig) { + return NFTApiFp(this.configuration).fetchRelevantMints(apiKey, address, contractAddress, tokenId, options).then((request) => request(this.axios, this.basePath)); + } +} + diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/base.ts b/src/neynar-api/v2/openapi-recommendation/base.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/base.ts rename to src/neynar-api/v2/openapi-recommendation/base.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/common.ts b/src/neynar-api/v2/openapi-recommendation/common.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/common.ts rename to src/neynar-api/v2/openapi-recommendation/common.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/configuration.ts b/src/neynar-api/v2/openapi-recommendation/configuration.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/configuration.ts rename to src/neynar-api/v2/openapi-recommendation/configuration.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/git_push.sh b/src/neynar-api/v2/openapi-recommendation/git_push.sh similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/git_push.sh rename to src/neynar-api/v2/openapi-recommendation/git_push.sh diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/index.ts b/src/neynar-api/v2/openapi-recommendation/index.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/index.ts rename to src/neynar-api/v2/openapi-recommendation/index.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/models/active-status.ts b/src/neynar-api/v2/openapi-recommendation/models/active-status.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/models/active-status.ts rename to src/neynar-api/v2/openapi-recommendation/models/active-status.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/models/error-res.ts b/src/neynar-api/v2/openapi-recommendation/models/error-res.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/models/error-res.ts rename to src/neynar-api/v2/openapi-recommendation/models/error-res.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/models/index.ts b/src/neynar-api/v2/openapi-recommendation/models/index.ts similarity index 78% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/models/index.ts rename to src/neynar-api/v2/openapi-recommendation/models/index.ts index 1f8837f8..0bc1f2e7 100644 --- a/src/neynar-api/neynar-v2-api/openapi-recommendation/models/index.ts +++ b/src/neynar-api/v2/openapi-recommendation/models/index.ts @@ -1,7 +1,7 @@ export * from './active-status'; export * from './error-res'; -export * from './fetch-relevant-mints200-response'; export * from './relevant-mint'; +export * from './relevant-mints'; export * from './user'; export * from './user-profile'; export * from './user-profile-bio'; diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/models/relevant-mint.ts b/src/neynar-api/v2/openapi-recommendation/models/relevant-mint.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/models/relevant-mint.ts rename to src/neynar-api/v2/openapi-recommendation/models/relevant-mint.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/models/fetch-relevant-mints200-response.ts b/src/neynar-api/v2/openapi-recommendation/models/relevant-mints.ts similarity index 81% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/models/fetch-relevant-mints200-response.ts rename to src/neynar-api/v2/openapi-recommendation/models/relevant-mints.ts index 4e62a421..3d1a30e3 100644 --- a/src/neynar-api/neynar-v2-api/openapi-recommendation/models/fetch-relevant-mints200-response.ts +++ b/src/neynar-api/v2/openapi-recommendation/models/relevant-mints.ts @@ -18,15 +18,15 @@ import { RelevantMint } from './relevant-mint'; /** - * + * A list of mint objects relevant to the user * @export - * @interface FetchRelevantMints200Response + * @interface RelevantMints */ -export interface FetchRelevantMints200Response { +export interface RelevantMints { /** * * @type {Array} - * @memberof FetchRelevantMints200Response + * @memberof RelevantMints */ 'mints': Array; } diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/models/user-profile-bio.ts b/src/neynar-api/v2/openapi-recommendation/models/user-profile-bio.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/models/user-profile-bio.ts rename to src/neynar-api/v2/openapi-recommendation/models/user-profile-bio.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/models/user-profile.ts b/src/neynar-api/v2/openapi-recommendation/models/user-profile.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/models/user-profile.ts rename to src/neynar-api/v2/openapi-recommendation/models/user-profile.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/models/user.ts b/src/neynar-api/v2/openapi-recommendation/models/user.ts similarity index 88% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/models/user.ts rename to src/neynar-api/v2/openapi-recommendation/models/user.ts index 88a72209..ef211443 100644 --- a/src/neynar-api/neynar-v2-api/openapi-recommendation/models/user.ts +++ b/src/neynar-api/v2/openapi-recommendation/models/user.ts @@ -26,6 +26,12 @@ import { UserProfile } from './user-profile'; * @interface User */ export interface User { + /** + * + * @type {string} + * @memberof User + */ + 'object': UserObjectEnum; /** * User identifier (unsigned integer) * @type {number} @@ -88,5 +94,10 @@ export interface User { 'activeStatus': ActiveStatus; } +export const UserObjectEnum = { + User: 'user' +} as const; + +export type UserObjectEnum = typeof UserObjectEnum[keyof typeof UserObjectEnum]; diff --git a/src/neynar-api/v2/v2-client.ts b/src/neynar-api/v2/v2-client.ts new file mode 100644 index 00000000..81a1edf9 --- /dev/null +++ b/src/neynar-api/v2/v2-client.ts @@ -0,0 +1,1002 @@ +import { + CastApi, + SignerApi, + Signer, + Cast, + CastParamType, + PostCastResponseCast, + DeleteCastReqBody, + ReactionApi, + ReactionReqBody, + ReactionType, + OperationResponse, + BulkFollowResponse, + EmbeddedCast, + Configuration, + ErrorRes, + FeedApi, + UserApi, + FeedResponse, + NotificationsResponse, + NotificationsApi, + FollowsApi, + RelevantFollowersResponse, + UserSearchResponse, + CastResponse, + CastsResponse, + UserResponse, + BulkUsersResponse, + FeedType, + FilterType, + ReactionsType, + ReactionsResponse, + StorageApi, + StorageAllocationsResponse, + StorageUsageResponse, +} from "./openapi-farcaster"; +import axios, { AxiosError, AxiosInstance } from "axios"; +import { silentLogger, Logger } from "../common/logger"; +import type { SetRequired } from "type-fest"; +import { NFTApi, RelevantMints } from "./openapi-recommendation"; + +const BASE_PATH = "https://api.neynar.com/v2"; + +export class NeynarV2APIClient { + private readonly logger: Logger; + private readonly apiKey: string; + + public readonly apis: { + signer: SignerApi; + user: UserApi; + cast: CastApi; + reaction: ReactionApi; + feed: FeedApi; + notifications: NotificationsApi; + follows: FollowsApi; + storage: StorageApi; + nft: NFTApi; + }; + + /** + * Instantiates a NeynarV1APIClient + * + * Note: A Wallet must be provided if the API client is to mint new AuthTokens + */ + constructor( + apiKey: string, + { + basePath, + logger = silentLogger, + axiosInstance, + }: { + basePath?: string; + logger?: Logger; + axiosInstance?: AxiosInstance; + } = {} + ) { + this.logger = logger; + + if (apiKey === "") { + throw new Error( + "Attempt to use an authenticated API method without first providing an api key" + ); + } + + this.apiKey = apiKey; + + if (axiosInstance === undefined) { + axiosInstance = axios.create(); + } + axiosInstance.defaults.decompress = true; + axiosInstance.interceptors.response.use( + (response) => response, + (error) => { + if (NeynarV2APIClient.isApiErrorResponse(error)) { + const apiErrors = error.response.data; + this.logger.warn(`API errors: ${JSON.stringify(apiErrors)}`); + } + throw error; + } + ); + + const config: Configuration = new Configuration({ + basePath: basePath ? `${basePath}/v2` : BASE_PATH, + apiKey: apiKey, + }); + + this.apis = { + signer: new SignerApi(config, undefined, axiosInstance), + user: new UserApi(config, undefined, axiosInstance), + cast: new CastApi(config, undefined, axiosInstance), + reaction: new ReactionApi(config, undefined, axiosInstance), + feed: new FeedApi(config, undefined, axiosInstance), + notifications: new NotificationsApi(config, undefined, axiosInstance), + follows: new FollowsApi(config, undefined, axiosInstance), + storage: new StorageApi(config, undefined, axiosInstance), + nft: new NFTApi(config, undefined, axiosInstance), + }; + } + + /** + * Utility for parsing errors returned by the Neynar API servers. Returns true + * if the given error is caused by an error response from the server, and + * narrows the type of `error` accordingly. + */ + public static isApiErrorResponse( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + error: any + ): error is SetRequired, "response"> { + if (!(error instanceof AxiosError)) return false; + return ( + error.response?.data !== undefined && "message" in error.response.data + ); + } + + // ------------ Signer ------------ + + /** + * Creates a Signer and returns the signer status. + * **Note**: While testing, please reuse the signer, as it costs money to approve a new signer. + * + * @returns {Promise} A promise that resolves to a `Signer` object, + * representing the newly created signer with its status. + * + * @example + * // Example: Create a new signer + * client.createSigner().then(response => { + * console.log('Signer Status:', response); // Outputs the status of the newly created signer + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/create-signer). + */ + public async createSigner(): Promise { + const response = await this.apis.signer.createSigner(this.apiKey); + return response.data; + } + + /** + * Retrieves information status of a signer by passing in a signerUuid + * + * @param {string} signerUuid - The unique identifier (UUID) of the signer to be fetched. + * + * @returns {Promise} A promise that resolves to a `Signer` object representing the + * requested signer, or null if no signer is found. + * + * @example + * // Example: Fetch an existing signer using its UUID + * client.lookupSigner('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec').then(response => { + * 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). + */ + public async lookupSigner(signerUuid: string): Promise { + const response = await this.apis.signer.signer(this.apiKey, signerUuid); + return response.data; + } + + /** + * Registers an app fid, deadline and a signature. + * + * Easiest way to start is to clone our repo that has sign in w/ Farcaster and writes: + * https://github.com/manan19/example-farcaster-app + * + * Read more about how writes to Farcaster work with Neynar managed signers + * https://docs.neynar.com/docs/write-to-farcaster-with-neynar-managed-signers + * + * @param {string} signerUuid - UUID of the signer. + * @param {number} fid - Application FID. + * @param {number} deadline - Unix timestamp in seconds that controls how long the signed key + * request is valid for. A 24-hour duration from now is recommended. + * @param {string} signature - Signature generated by the custody address of the app. + * Signed data includes app_fid, deadline, and signer’s public key. + * + * @returns {Promise} A promise that resolves to a `Signer` object, + * representing the registered signer with its status and approval URL. + * + * @example + * // Example: Register a signer with a specified FID, deadline, and signature + * // Following is an example of how to generate a signer, it may not work. Please fill in the correct values here. + * // Please refer https://github.com/manan19/example-farcaster-app to get started + * + * client.registerSignedKey('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', 18949, 1625097600, '0xe5d95c391e165dac8efea373efe301d3ea823e1f41713f8943713cbe2850566672e33ff3e17e19abb89703f650a2597f62b4fda0ce28ca15d59eb6d4e971ee531b').then(response => { + * console.log('Signer Registration:', response); // Outputs the registration status of the signer + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/register-signed-key). + */ + public async registerSignedKey( + signerUuid: string, + fid: number, + deadline: number, + signature: string + ): Promise { + const registerSignerKeyReqBody = { + signer_uuid: signerUuid, + app_fid: fid, + deadline: deadline, + signature: signature, + }; + const response = await this.apis.signer.registerSignedKey( + this.apiKey, + registerSignerKeyReqBody + ); + return response.data; + } + + // ------------ User ------------ + + /** + * Removes verification for an eth address for the user. + * (In order to delete verification signerUuid must be approved) + * + * @param {string} signerUuid - UUID of the signer. + * @param {string} address - Ethereum address for which verification is being removed. + * + * @returns {Promise} A promise that resolves to an `OperationResponse` object, + * indicating the success or failure of the operation. + * + * @example + * // Example: Remove verification for a user's Ethereum address + * client.deleteVerification('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', '0x1ea99cbed57e4020314ba3fadd7c692d2de34d5f').then(response => { + * console.log('Verification Removal Status:', response); // Outputs the status of verification removal + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/remove-verification). + */ + public async deleteVerification( + signerUuid: string, + address: string + ): Promise { + const removeVerificationReqBody = { + signer_uuid: signerUuid, + address, + }; + + const response = await this.apis.user.farcasterUserVerificationDelete( + this.apiKey, + removeVerificationReqBody + ); + return response.data; + } + + /** + * Adds verification for an eth address for the user + * (In order to add verification signerUuid must be approved) + * + * @param {string} signerUuid - UUID of the signer. + * @param {string} address - Ethereum address for which verification is being added. + * @param {string} blockHash - Block hash associated with the Ethereum transaction. + * @param {string} ethSignature - Ethereum signature for verification. + * + * @returns {Promise} A promise that resolves to an `OperationResponse` object, + * indicating the success or failure of the operation. + * + * @example + * // Example: Add verification for a user's Ethereum address + * client.publishVerification('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', '0x1ea99cbed57e4020314ba3fadd7c692d2de34d5f', '0x191905a9201170abb55f4c90a4cc968b44c1b71cdf3db2764b775c93e7e22b29', '0x2fc09da1f4dcb723fefb91f77932c249c418c0af00c66ed92ee1f35002c80d6a1145280c9f361d207d28447f8f7463366840d3a9309036cf6954afd1fd331beb1b').then(response => { + * console.log('Verification Addition Status:', response); // Outputs the status of verification addition + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/add-verification). + */ + public async publishVerification( + signerUuid: string, + address: string, + blockHash: string, + ethSignature: string + ): Promise { + const addVerificationReqBody = { + signer_uuid: signerUuid, + address, + block_hash: blockHash, + eth_signature: ethSignature, + }; + + const response = await this.apis.user.farcasterUserVerificationPost( + this.apiKey, + addVerificationReqBody + ); + return response.data; + } + + /** + * Follows one or more users. This method allows a user, identified by their signer's UUID, + * to follow other users specified by their FIDs. + * (In order to follow a user signerUuid must be approved) + * + * @param {string} signerUuid - UUID of the signer who is following other users. + * @param {Array} targetFids - An array of FIDs representing the users to be followed. + * + * @returns {Promise} A promise that resolves to a `BulkFollowResponse` object, + * indicating the success or failure of the follow operation. + * + * @example + * // Example: Follow multiple users + * client.followUser('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', [3, 2, 1]).then(response => { + * console.log('Follow Opretation Status', response); // Outputs the result of the follow operation + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/follow-user). + */ + public async followUser( + signerUuid: string, + targetFids: number[] + ): Promise { + const followReqBody = { + signer_uuid: signerUuid, + target_fids: targetFids, + }; + + const response = await this.apis.user.followUser( + this.apiKey, + followReqBody + ); + return response.data; + } + + /** + * Unfollows one or more users. This method enables a user, identified by their signer's UUID, + * to unfollow other users specified by their FIDs. + * (In order to unfollow a user signerUuid must be approved) + * + * @param {string} signerUuid - UUID of the signer who is unfollowing other users. + * @param {Array} targetFids - An array of FIDs representing the users to be unfollowed. + * + * @returns {Promise} A promise that resolves to a `BulkFollowResponse` object, + * indicating the success or failure of the unfollow operation. + * + * @example + * // Example: Unfollow multiple users + * client.unfollowUser('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', [3, 2, 1]).then(response => { + * console.log('Unfollow Operation Status:', response); // Outputs the result of the unfollow operation + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/unfollow-user). + */ + public async unfollowUser( + signerUuid: string, + targetFids: number[] + ): Promise { + const followReqBody = { + signer_uuid: signerUuid, + target_fids: targetFids, + }; + const response = await this.apis.user.unfollowUser( + this.apiKey, + followReqBody + ); + return response.data; + } + + /** + * Updates a user's profile. + * (In order to update profile signerUuid must be approved) + * + * @param {string} signerUuid - UUID of the signer associated with the user profile. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {string} [options.bio] - A brief bio or description of the user. + * @param {string} [options.pfpUrl] - URL of the user's profile picture. + * @param {string} [options.url] - Personal URL of the user. + * @param {string} [options.username] - The user's chosen username. + * @param {string} [options.displayName] - The user's display name. + * + * @returns {Promise} A promise that resolves to an `OperationResponse` object, + * indicating the success or failure of the update operation. + * + * @example + * // Example: Update a user's profile with bio, profile picture URL, username, and display name + * client.updateUser('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', { + * bio: 'New bio here', + * pfpUrl: 'https://example.com/pfp.jpg', + * username: 'newUsername', + * displayName: 'New Display Name' + * }).then(response => { + * console.log('Profile Update Operation Status:', response); // Outputs the result of the profile update operation + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/update-user). + */ + public async updateUser( + signerUuid: string, + options?: { + bio?: string; + pfpUrl?: string; + url?: string; + username?: string; + displayName?: string; + } + ): Promise { + const updateUserReqBody = { + signer_uuid: signerUuid, + bio: options?.bio, + pfp_url: options?.pfpUrl, + url: options?.url, + username: options?.username, + display_name: options?.displayName, + }; + const response = await this.apis.user.updateUser( + this.apiKey, + updateUserReqBody + ); + return response.data; + } + + /** + * Retrieves information about one or multiple users based on FIDs. This method allows for retrieving + * details of several users simultaneously, identified by their FIDs, with the option to provide + * information contextual to a specified viewer. + * + * @param {Array} fids - An array of FIDs representing the users whose information is being retrieved. + * @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. + * + * @returns {Promise} A promise that resolves to a `BulkUsersResponse` object, + * containing information about the requested users. + * + * @example + * // Example: Fetch information about multiple users with viewer context + * client.fetchBulkUsers([2, 3], { viewerFid: 19960 }).then(response => { + * console.log('Bulk Users Information:', response); // Outputs information about the specified users + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/user-bulk). + */ + public async fetchBulkUsers( + fids: number[], + options: { viewerFid?: number } + ): Promise { + const _fids = fids.join(","); + const response = await this.apis.user.userBulk( + this.apiKey, + _fids, + options?.viewerFid + ); + return response.data; + } + + /** + * Searches for users based on a query. This method is used to find users by usernames or other + * identifiable information. The search can be contextualized to the viewer specified by `viewerFid`. + * + * @param {string} q - The query string used for searching users. + * @param {number} viewerFid - The FID of the user performing the search, + * used for providing contextual data specific to the viewer. + * + * @returns {Promise} A promise that resolves to a `UserSearchResponse` object, + * containing the results of the user search. + * + * @example + * // Example: Search for users with a specific query + * client.searchUser('ris', 19960).then(response => { + * console.log('User Search Results:', response); // Outputs the results of the user search + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/user-search). + */ + public async searchUser( + q: string, + viewerFid: number + ): Promise { + const response = await this.apis.user.userSearch(this.apiKey, q, viewerFid); + return response.data; + } + + /** + * Looks up a user by their custody address. + * + * @param {string} custodyAddress - Custody Address associated with mnemonic + * + * @returns {Promise} A promise that resolves to a `UserResponse` object, + * containing information about the user linked to the given custody address. + * + * @example + * // Example: Look up a user by their custody address + * client.lookupUserByCustodyAddress('0xd1b702203b1b3b641a699997746bd4a12d157909').then(response => { + * console.log('User Information:', response); // Outputs the information of the user associated with the custody address + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/lookup-user-by-custody-address). + */ + public async lookupUserByCustodyAddress( + custodyAddress: string + ): Promise { + const response = await this.apis.user.lookupUserByCustodyAddress( + this.apiKey, + custodyAddress + ); + return response.data; + } + + // ------------ Cast ------------ + + /** + * Retrieves information about an individual cast by passing in a Warpcast web URL or cast hash. + * + * @param {string} castHashOrUrl - The identifier for the cast, which can be either a cast hash or a Warpcast web URL. + * @param {CastParamType} type - The parameter type indicating whether the identifier is a hash or a URL. + * + * @returns {Promise} A promise that resolves to a `CastResponse` object, + * containing information about the specified cast. + * + * @example + * import { CastParamType } from "@neynar/nodejs-sdk/build/neynar-api/v2"; + * + * // Example: Retrieve information for a cast using its hash + * client.lookUpCastByHashOrWarpcastUrl('0xfe90f9de682273e05b201629ad2338bdcd89b6be', CastParamType.Hash).then(response => { + * console.log('Cast Information:', response); // Outputs information about the cast + * }); + * + * // Example: Retrieve information for a cast using its Warpcast URL + * client.lookUpCastByHashOrWarpcastUrl('https://warpcast.com/rish/0x9288c1', CastParamType.Url).then(response => { + * console.log('Cast Information:', response); // Outputs information about the cast + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/cast). + */ + public async lookUpCastByHashOrWarpcastUrl( + castHashOrUrl: string, + type: CastParamType + ): Promise { + const response = await this.apis.cast.cast( + this.apiKey, + castHashOrUrl, + type + ); + return response.data; + } + + /** + * Retrieves information about multiple casts using an array of their hashes. This method is useful + * for fetching details of several casts at once, identified by their unique hashes. + * + * @param {Array} castsHashes - An array of strings representing the hashes of the casts + * to be retrieved. + * + * @returns {Promise} A promise that resolves to a `CastsResponse` object, + * containing information about the requested casts. + * + * @example + * // Example: Fetch information about multiple casts using their hashes + * client.fetchBulkCasts(['0xa896906a5e397b4fec247c3ee0e9e4d4990b8004','0x27ff810f7f718afd8c40be236411f017982e0994']).then(response => { + * console.log('Bulk Casts Information:', response); // Outputs information about the specified casts + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/casts). + */ + public async fetchBulkCasts(castsHashes: string[]): Promise { + const _castsHashes = castsHashes.join(","); + const response = await this.apis.cast.casts(this.apiKey, _castsHashes); + return response.data; + } + + /** + * Publishes a cast for the currently authenticated user. This method allows users to post + * content, including text and embeds, and can also be used to reply to existing casts. + * (In order to publish a cast signerUuid must be approved) + * + * @param {string} signerUuid - UUID of the signer associated with the user posting the cast. + * @param {string} text - The text content of the cast. + * @param {Object} [options] - Optional parameters for the cast. + * @param {Array} [options.embeds] - An array of embeds to be included in the cast. + * @param {string} [options.replyTo] - The URL or hash of the parent cast if this is a reply. + * + * @returns {Promise} A promise that resolves to a `PostCastResponseCast` object, + * representing the published cast. + * + * @example + * // Example: Publish a simple cast + * client.publishCast('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', 'Testing publishCast() method').then(response => { + * console.log('Published Cast:', response); // Outputs the published cast + * }); + * // Example: Reply to a Cast + * client.publishCast('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', 'Testing publishCast() method', { + * replyTo: '0x9e95c380791fce11ffbb14b2ea458b233161bafd', + * }).then(response => { + * console.log('Published Cast:', response); // Outputs the published reply cast with embeds + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/post-cast). + */ + public async publishCast( + signerUuid: string, + text: string, + options?: { embeds?: EmbeddedCast[]; replyTo?: string } + ): Promise { + const postCastReqBody = { + signer_uuid: signerUuid, + text: text, + embeds: options?.embeds, + parent: options?.replyTo, + }; + const response = await this.apis.cast.postCast( + this.apiKey, + postCastReqBody + ); + return response.data.cast; + } + + /** + * Deletes an existing cast. This method is used to remove a cast, identified by its hash, + * from the system. + * (In order to delete a cast signerUuid must be approved) + * + * @param {string} signerUuid - UUID of the signer associated with the user who is deleting the cast. + * @param {Cast | string} castOrCastHash - The Cast object or its hash that is to be deleted. + * + * @returns {Promise} A promise that resolves to an `OperationResponse` object, + * indicating the success or failure of the deletion operation. + * + * @example + * // Example: Delete a cast using its hash + * client.deleteCast('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', '0x1ea99cbed57e4020314ba3fadd7c692d2de34d5f').then(response => { + * console.log('Cast Deletion:', response); // Outputs the result of the cast deletion operation + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/delete-cast). + */ + public async deleteCast( + signerUuid: string, + castOrCastHash: Cast | string + ): Promise { + let castHash: string; + if (typeof castOrCastHash === "string") { + castHash = castOrCastHash; + } else { + castHash = castOrCastHash.hash; + } + const deleteCastReqBody: DeleteCastReqBody = { + signer_uuid: signerUuid, + target_hash: castHash, + }; + const response = await this.apis.cast.deleteCast( + this.apiKey, + deleteCastReqBody + ); + return response.data; + } + + // ------------ Feed ------------ + + /** + * Retrieves a reverse chronological feed for a user based on their follow graph. + * This method allows users to fetch casts in their feed based on various filters, such as + * following a specific user, a list of users, or content under a specific parent URL. + * + * @param {FeedType} feedType - Type of the feed, defaults to 'following' but can be set to 'filter' for specific filtering. + * @param {Object} [options] - Optional parameters for customizing the feed. + * @param {FilterType} [options.filterType] - Used when feedType is 'filter'. Determines the filter criteria (e.g., 'fids' or 'parent_url'). + * @param {number} [options.fid] - FID of the user whose feed is being created. Required unless a 'filterType' is provided. + * @param {Array} [options.fids] - Used for creating a feed based on a list of FIDs. Requires 'feedType' and 'filterType'. + * @param {string} [options.parentUrl] - Used for fetching content under a specific parent URL. Requires 'feedType' and 'filterType'. + * @param {boolean} [options.withRecasts] - Whether to include recasts in the response. True by default. + * @param {number} [options.limit] - Number of results to retrieve, with a default of 25 and a maximum of 100. + * @param {string} [options.cursor] - Pagination cursor for fetching specific subsets of results. + * + * @returns {Promise} A promise that resolves to a `FeedResponse` object, + * containing the requested feed data. + * + * @example + * // Example: Retrieve a user's feed based on their following graph with specific limits + * client.fetchFeed('following', { fid: 3, limit: 50, withRecasts: true }).then(response => { + * console.log('User Feed:', response); // Outputs the user's feed + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/feed). + */ + public async fetchFeed( + feedType: FeedType, + options?: { + filterType?: FilterType; + fid?: number; + fids?: number[]; + parentUrl?: string; + limit?: number; + cursor?: string; + withRecasts?: boolean; + } + ): Promise { + const _fids = options?.fids?.join(","); + + const response = await this.apis.feed.feed( + this.apiKey, + feedType, + options?.filterType, + options?.fid, + _fids, + options?.parentUrl, + options?.withRecasts, + options?.limit, + options?.cursor + ); + return response.data; + } + + // ------------ Reaction ------------ + + /** + * Posts a reaction (like or recast) to a given cast. + * (In order to post a reaction signerUuid must be approved) + * + * @param {string} signerUuid - UUID of the signer expressing the reaction. + * @param {ReactionType} reaction - The type of reaction being expressed (like or recast). + * @param {Cast | string} castOrCastHash - The Cast object or its hash to which the reaction is targeted. + * + * @returns {Promise} A promise that resolves to an `OperationResponse` object, + * indicating the success or failure of the reaction post. + * + * @example + * + * import { ReactionType } from "@neynar/nodejs-sdk/build/neynar-api/v2"; + * + * // Example: Post a 'like' reaction to a cast + * client.publishReactionToCast('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', ReactionType.Like, '0x1ea99cbed57e4020314ba3fadd7c692d2de34d5f').then(response => { + * console.log('Publish Reaction Operation Status:', response); // Outputs the status of the reaction post + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/post-reaction). + */ + public async publishReactionToCast( + signerUuid: string, + reaction: ReactionType, + castOrCastHash: Cast | string + ): Promise { + let castHash: string; + if (typeof castOrCastHash === "string") { + castHash = castOrCastHash; + } else { + castHash = castOrCastHash.hash; + } + const body: ReactionReqBody = { + signer_uuid: signerUuid, + reaction_type: reaction, + target: castHash, + }; + const response = await this.apis.reaction.postReaction(this.apiKey, body); + return response.data; + } + + /** + * Removes a reaction (like or recast) from a given cast. + * + * (In order to delete a reaction signerUuid must be approved) + * + * @param {string} signerUuid - UUID of the signer who is removing the reaction. + * @param {ReactionType} reaction - The type of reaction being removed. + * @param {Cast | string} castOrCastHash - The Cast object or its hash from which the reaction is to be removed. + * + * @returns {Promise} A promise that resolves to an `OperationResponse` object, + * indicating the success or failure of the reaction removal. + * + * @example + * + * import { ReactionType } from "@neynar/nodejs-sdk/build/neynar-api/v2"; + * + * // Example: Remove a 'like' reaction from a cast + * client.deleteReactionFromCast('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', ReactionType.Like, '0x1ea99cbed57e4020314ba3fadd7c692d2de34d5f').then(response => { + * console.log('Delete Reaction Operation Status:', response); // Outputs the status of the reaction removal operation + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/delete-reaction). + */ + public async deleteReactionFromCast( + signerUuid: string, + reaction: ReactionType, + castOrCastHash: Cast | string + ): Promise { + let castHash: string; + if (typeof castOrCastHash === "string") { + castHash = castOrCastHash; + } else { + castHash = castOrCastHash.hash; + } + const body: ReactionReqBody = { + signer_uuid: signerUuid, + reaction_type: reaction, + target: castHash, + }; + const response = await this.apis.reaction.deleteReaction(this.apiKey, body); + return response.data; + } + + /** + * Fetches reactions (likes, recasts, or all) for a given user. This method allows retrieving + * the reactions associated with a user's casts, specified by the user's FID. + * + * @param {number} fid - The FID of the user whose reactions are being fetched. + * @param {ReactionsType} type - The type of reaction to fetch (likes, recasts, or all). + * @param {Object} [options] - Optional parameters for customizing the response. + * @param {number} [options.limit] - Limits the number of results. Default is 25, with a maximum of 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 `ReactionsResponse` object, + * containing the reactions associated with the user's casts. + * + * @example + * + * import { ReactionsType } from "@neynar/nodejs-sdk/build/neynar-api/v2"; + * + * // Example: Fetch a user's reactions + * client.fetchUserReactions(3, ReactionsType.All, { + * limit: 50, + * // cursor: "nextPageCursor" // Omit this parameter for the initial request + * }).then(response => { + * console.log('User Reactions:', response); // Outputs the user's reactions + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/reactions-user). + */ + public async fetchUserReactions( + fid: number, + type: ReactionsType, + options?: { limit?: number; cursor?: string } + ): Promise { + const response = await this.apis.reaction.reactionsUser( + this.apiKey, + fid, + type, + options?.limit, + options?.cursor + ); + return response.data; + } + + // ------------ Notifications ------------ + + /** + * Retrieves a list of notifications for a specific FID in reverse chronological order. + * This method is useful for obtaining a user's notifications, keeping them updated on various interactions and updates. + * + * @param {number} fid - The FID of the user whose notifications are being fetched. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {number} [options.limit] - Number of results to retrieve (default 25, max 50). + * @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 `NotificationsResponse` object, + * containing the user's notifications. + * + * @example + * // Example: Fetch the first 30 notifications for a user + * client.fetchAllNotifications(3, { + * limit: 30, + * // cursor: "nextPageCursor" // Omit this parameter for the initial request + * }).then(response => { + * console.log('User Notifications:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/notifications). + */ + public async fetchAllNotifications( + fid: number, + options?: { cursor?: string; limit?: number } + ): Promise { + const response = await this.apis.notifications.notifications( + this.apiKey, + fid, + options?.limit, + options?.cursor + ); + return response.data; + } + + // ------------ Follows ------------ + + /** + * Retrieves a list of relevant followers for a specific FID. + * + * @param {number} targetFid - The FID of the user whose relevant followers are being fetched. + * @param {number} viewerFid - The FID of the viewer who is looking at the target user's profile. + * + * @returns {Promise} A promise that resolves to a `RelevantFollowersResponse` object, + * containing a list of relevant followers for the specified user. + * + * @example + * // Example: Retrieve relevant followers for a user from the perspective of another user + * client.fetchRelevantFollowers(3, 19960).then(response => { + * console.log('Relevant Followers:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/relevant-followers). + */ + public async fetchRelevantFollowers( + targetFid: number, + viewerFid: number + ): Promise { + const response = await this.apis.follows.relevantFollowers( + this.apiKey, + targetFid, + viewerFid + ); + return response.data; + } + + // ------------ Storage ------------ + + /** + * Retrieves storage allocations for a given user. + * + * @param {number} fid - The FID of the user whose storage allocations are being retrieved. + * + * @returns {Promise} A promise that resolves to a `StorageAllocationsResponse` object, + * containing information about the user's storage allocations. + * + * @example + * // Example: Retrieve storage allocations for a user + * client.lookupUserStorageAllocations(3).then(response => { + * console.log('User Storage Allocations:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/storage-allocations). + */ + public async lookupUserStorageAllocations( + fid: number + ): Promise { + const response = await this.apis.storage.storageAllocations( + this.apiKey, + fid + ); + return response.data; + } + + /** + * Retrieves storage usage for a given user. + * + * @param {number} fid - The FID of the user whose storage usage is being queried. + * + * @returns {Promise} A promise that resolves to a `StorageUsageResponse` object, + * containing details about the user's storage usage. + * + * @example + * // Example: Retrieve storage usage for a user + * client.lookupUserStorageUsage(3).then(response => { + * console.log('User Storage Usage:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/storage-usage). + */ + public async lookupUserStorageUsage( + fid: number + ): Promise { + const response = await this.apis.storage.storageUsage(this.apiKey, fid); + return response.data; + } + // ------------ Recommendation ------------ + + /** + * Fetches all mint actions relevant for a given contract address and user's Ethereum address, + * with an optional focus on a specific tokenId for ERC1155 contracts. This method is useful for + * tracking NFT minting activities linked to specific contracts and user addresses. + * + * @param {string} address - The Ethereum address of the user. + * @param {string} contractAddress - The contract address associated with the NFTs. + * @param {Object} [options] - Optional parameters for the request. + * @param {string} [options.tokenId] - (Optional) The tokenId, particularly for ERC1155 contract types. + * + * @returns {Promise} A promise that resolves to a `RelevantMints` object, + * containing information about mint actions relevant to the user and contract. + * + * @example + * // Example: Fetch mint actions for a contract address with a specific tokenId + * client.fetchRelevantMints('0x5a927ac639636e534b678e81768ca19e2c6280b7', '0xe8e0e543a3dd32d366cb756fa4d112f30172bcb1', { tokenId: '1' }).then(response => { + * console.log('Relevant Mint Actions:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/fetch-relevant-mints). + */ + public async fetchRelevantMints( + address: string, + contractAddress: string, + options?: { tokenId?: string } + ): Promise { + const response = await this.apis.nft.fetchRelevantMints( + this.apiKey, + address, + contractAddress, + options?.tokenId + ); + return response.data; + } +} diff --git a/src/oas b/src/oas index 47474c45..213ed5e6 160000 --- a/src/oas +++ b/src/oas @@ -1 +1 @@ -Subproject commit 47474c45fa9c51ae9be7b81cea56021eb4d30da1 +Subproject commit 213ed5e6136f2076bdef589a3c5b73147a479acd diff --git a/yarn.lock b/yarn.lock index 1ad1dcf8..9b7cc355 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,11 @@ # yarn lockfile v1 +"@adraffy/ens-normalize@1.10.0": + version "1.10.0" + resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.10.0.tgz#d2a39395c587e092d77cbbc80acf956a54f38bf7" + integrity sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q== + "@babel/code-frame@^7.0.0": version "7.22.13" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.13.tgz#e3c1c099402598483b7a8c46a721d1038803755e" @@ -89,6 +94,18 @@ path-to-regexp "3.2.0" tslib "2.5.0" +"@noble/curves@1.2.0", "@noble/curves@~1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.2.0.tgz#92d7e12e4e49b23105a2555c6984d41733d65c35" + integrity sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw== + dependencies: + "@noble/hashes" "1.3.2" + +"@noble/hashes@1.3.2", "@noble/hashes@~1.3.0", "@noble/hashes@~1.3.2": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39" + integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -141,6 +158,28 @@ rxjs "7.8.0" tslib "2.0.3" +"@scure/base@~1.1.0", "@scure/base@~1.1.2": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.3.tgz#8584115565228290a6c6c4961973e0903bb3df2f" + integrity sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q== + +"@scure/bip32@1.3.2": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.3.2.tgz#90e78c027d5e30f0b22c1f8d50ff12f3fb7559f8" + integrity sha512-N1ZhksgwD3OBlwTv3R6KFEcPojl/W4ElJOeCZdi+vuI5QmTFwLq3OFf2zd2ROpKvxFdgZ6hUpb0dx9bVNEwYCA== + dependencies: + "@noble/curves" "~1.2.0" + "@noble/hashes" "~1.3.2" + "@scure/base" "~1.1.2" + +"@scure/bip39@1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.2.1.tgz#5cee8978656b272a917b7871c981e0541ad6ac2a" + integrity sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg== + dependencies: + "@noble/hashes" "~1.3.0" + "@scure/base" "~1.1.0" + "@tsconfig/node10@^1.0.7": version "1.0.9" resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" @@ -178,6 +217,11 @@ resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.2.tgz#9b0e3e8533fe5024ad32d6637eb9589988b6fdca" integrity sha512-lqa4UEhhv/2sjjIQgjX8B+RBjj47eo0mzGasklVJ78UKGQY1r0VpB9XHDaZZO9qzEFDdy4MrXLuEaSmPrPSe/A== +abitype@0.9.8: + version "0.9.8" + resolved "https://registry.yarnpkg.com/abitype/-/abitype-0.9.8.tgz#1f120b6b717459deafd213dfbf3a3dd1bf10ae8c" + integrity sha512-puLifILdm+8sjyss4S+fsUN09obiT1g2YW6CtcQF+QDzxR0euzgEB29MZujC6zMk2a6SVmtttq1fc6+YFA7WYQ== + acorn-walk@^8.1.1: version "8.3.0" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.0.tgz#2097665af50fd0cf7a2dfccd2b9368964e66540f" @@ -829,6 +873,11 @@ is-unicode-supported@^0.1.0: resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== +isows@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/isows/-/isows-1.0.3.tgz#93c1cf0575daf56e7120bab5c8c448b0809d0d74" + integrity sha512-2cKei4vlmg2cxEjm3wVSqn8pcoRF/LX/wpifuuNquFO4SQmPwarClT+SUCA2lt+l581tTeZIPIZuIDo2jWN1fg== + iterare@1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/iterare/-/iterare-1.2.1.tgz#139c400ff7363690e33abffa33cbba8920f00042" @@ -1437,6 +1486,20 @@ validate-npm-package-license@^3.0.1: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" +viem@^1.19.9: + version "1.19.9" + resolved "https://registry.yarnpkg.com/viem/-/viem-1.19.9.tgz#a11f3ad4a3323994ebd2010dbc659d1a2b12e583" + integrity sha512-Sf9U2x4jU0S/FALqYypcspWOGene0NZyD470oUripNhE0Ta6uOE/OgE4toTDVfRxov8qw0JFinr/wPGxYE3+HQ== + dependencies: + "@adraffy/ens-normalize" "1.10.0" + "@noble/curves" "1.2.0" + "@noble/hashes" "1.3.2" + "@scure/bip32" "1.3.2" + "@scure/bip39" "1.2.1" + abitype "0.9.8" + isows "1.0.3" + ws "8.13.0" + wcwidth@>=1.0.1, wcwidth@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" @@ -1471,6 +1534,11 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== +ws@8.13.0: + version "8.13.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0" + integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== + y18n@^5.0.5: version "5.0.8" resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55"