UNPKG

@neynar/nodejs-sdk

Version:

SDK to interact with Neynar APIs (https://docs.neynar.com/reference/quickstart)

617 lines (616 loc) 39.6 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * Neynar API * The Neynar API allows you to interact with the Farcaster protocol among other things. See the [Neynar docs](https://docs.neynar.com/reference) for more details. * * The version of the OpenAPI document: 3.34.0 * Contact: team@neynar.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.FetchUserReciprocalFollowersSortTypeEnum = exports.FetchUserFollowingSortTypeEnum = exports.FetchUserFollowersSortTypeEnum = exports.FollowsApi = exports.FollowsApiFactory = exports.FollowsApiFp = exports.FollowsApiAxiosParamCreator = void 0; const axios_1 = __importDefault(require("axios")); // Some imports not used depending on template conditions // @ts-ignore const common_1 = require("../common"); // @ts-ignore const base_1 = require("../base"); /** * FollowsApi - axios parameter creator * @export */ const FollowsApiAxiosParamCreator = function (configuration) { return { /** * Fetch a list of suggested users to follow. Used to help users discover new users to follow * @summary Suggest Follows * @param {number | null} fid FID of the user whose following you want to fetch. * @param {boolean} [xNeynarExperimental] Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details. * @param {number | null} [viewerFid] Providing this will return a list of users that respects this user\&#39;s mutes and blocks and includes &#x60;viewer_context&#x60;. * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100) * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<UsersResponse>} A promise that resolves to a `UsersResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-follow-suggestions) * */ fetchFollowSuggestions: async (fid, xNeynarExperimental, viewerFid, limit, options = {}) => { // verify required parameter 'fid' is not null or undefined (0, common_1.assertParamExists)('fetchFollowSuggestions', 'fid', fid); const localVarPath = `/v2/farcaster/following/suggested/`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); if (fid !== undefined) { localVarQueryParameter['fid'] = fid; } if (viewerFid !== undefined) { localVarQueryParameter['viewer_fid'] = viewerFid; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (xNeynarExperimental != null) { localVarHeaderParameter['x-neynar-experimental'] = typeof xNeynarExperimental === 'string' ? xNeynarExperimental : JSON.stringify(xNeynarExperimental); } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns a list of relevant followers for a specific FID. This usually shows on a profile as \"X, Y and Z follow this user\". * @summary Relevant followers * @param {number} targetFid User who\&#39;s profile you are looking at * @param {number} viewerFid The FID of the user to customize this response for. Providing this will also return a list of followers that respects this user\&#39;s mutes and blocks and includes &#x60;viewer_context&#x60;. * @param {boolean} [xNeynarExperimental] Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<RelevantFollowersResponse>} A promise that resolves to a `RelevantFollowersResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-relevant-followers) * */ fetchRelevantFollowers: async (targetFid, viewerFid, xNeynarExperimental, options = {}) => { // verify required parameter 'targetFid' is not null or undefined (0, common_1.assertParamExists)('fetchRelevantFollowers', 'targetFid', targetFid); // verify required parameter 'viewerFid' is not null or undefined (0, common_1.assertParamExists)('fetchRelevantFollowers', 'viewerFid', viewerFid); const localVarPath = `/v2/farcaster/followers/relevant/`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); if (targetFid !== undefined) { localVarQueryParameter['target_fid'] = targetFid; } if (viewerFid !== undefined) { localVarQueryParameter['viewer_fid'] = viewerFid; } if (xNeynarExperimental != null) { localVarHeaderParameter['x-neynar-experimental'] = typeof xNeynarExperimental === 'string' ? xNeynarExperimental : JSON.stringify(xNeynarExperimental); } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns a list of followers for a specific FID. * @summary Followers * @param {number} fid User who\&#39;s profile you are looking at * @param {boolean} [xNeynarExperimental] Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details. * @param {number} [viewerFid] Providing this will return a list of followers that respects this user\&#39;s mutes and blocks and includes &#x60;viewer_context&#x60;. * @param {FetchUserFollowersSortTypeEnum} [sortType] Sort type for fetch followers. Default is &#x60;desc_chron&#x60; * @param {number} [limit] Number of results to fetch (Default: 20, Maximum: 100) * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<FollowersResponse>} A promise that resolves to a `FollowersResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-followers) * */ fetchUserFollowers: async (fid, xNeynarExperimental, viewerFid, sortType, limit, cursor, options = {}) => { // verify required parameter 'fid' is not null or undefined (0, common_1.assertParamExists)('fetchUserFollowers', 'fid', fid); const localVarPath = `/v2/farcaster/followers/`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); if (fid !== undefined) { localVarQueryParameter['fid'] = fid; } if (viewerFid !== undefined) { localVarQueryParameter['viewer_fid'] = viewerFid; } if (sortType !== undefined) { localVarQueryParameter['sort_type'] = sortType; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (cursor !== undefined) { localVarQueryParameter['cursor'] = cursor; } if (xNeynarExperimental != null) { localVarHeaderParameter['x-neynar-experimental'] = typeof xNeynarExperimental === 'string' ? xNeynarExperimental : JSON.stringify(xNeynarExperimental); } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Fetch a list of users who a given user is following. Can optionally include a viewer_fid and sort_type. * @summary Following * @param {number} fid FID of the user whose following you want to fetch. * @param {boolean} [xNeynarExperimental] Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details. * @param {number} [viewerFid] Providing this will return a list of users that respects this user\&#39;s mutes and blocks and includes &#x60;viewer_context&#x60;. * @param {FetchUserFollowingSortTypeEnum} [sortType] Optional parameter to sort the users based on different criteria. * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100) * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<FollowersResponse>} A promise that resolves to a `FollowersResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-following) * */ fetchUserFollowing: async (fid, xNeynarExperimental, viewerFid, sortType, limit, cursor, options = {}) => { // verify required parameter 'fid' is not null or undefined (0, common_1.assertParamExists)('fetchUserFollowing', 'fid', fid); const localVarPath = `/v2/farcaster/following/`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); if (fid !== undefined) { localVarQueryParameter['fid'] = fid; } if (viewerFid !== undefined) { localVarQueryParameter['viewer_fid'] = viewerFid; } if (sortType !== undefined) { localVarQueryParameter['sort_type'] = sortType; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (cursor !== undefined) { localVarQueryParameter['cursor'] = cursor; } if (xNeynarExperimental != null) { localVarHeaderParameter['x-neynar-experimental'] = typeof xNeynarExperimental === 'string' ? xNeynarExperimental : JSON.stringify(xNeynarExperimental); } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns users who the given FID follows and they follow the FID back (reciprocal following relationship) * @summary Reciprocal Followers * @param {number} fid * @param {boolean} [xNeynarExperimental] Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details. * @param {number} [viewerFid] * @param {number} [limit] (Default: 25, Maximum: 100) * @param {string} [cursor] Pagination cursor * @param {FetchUserReciprocalFollowersSortTypeEnum} [sortType] * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<FetchUserReciprocalFollowers200Response>} A promise that resolves to a `FetchUserReciprocalFollowers200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-reciprocal-followers) * */ fetchUserReciprocalFollowers: async (fid, xNeynarExperimental, viewerFid, limit, cursor, sortType, options = {}) => { // verify required parameter 'fid' is not null or undefined (0, common_1.assertParamExists)('fetchUserReciprocalFollowers', 'fid', fid); const localVarPath = `/v2/farcaster/followers/reciprocal/`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); if (fid !== undefined) { localVarQueryParameter['fid'] = fid; } if (viewerFid !== undefined) { localVarQueryParameter['viewer_fid'] = viewerFid; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (cursor !== undefined) { localVarQueryParameter['cursor'] = cursor; } if (sortType !== undefined) { localVarQueryParameter['sort_type'] = sortType; } if (xNeynarExperimental != null) { localVarHeaderParameter['x-neynar-experimental'] = typeof xNeynarExperimental === 'string' ? xNeynarExperimental : JSON.stringify(xNeynarExperimental); } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; exports.FollowsApiAxiosParamCreator = FollowsApiAxiosParamCreator; /** * FollowsApi - functional programming interface * @export */ const FollowsApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.FollowsApiAxiosParamCreator)(configuration); return { /** * Fetch a list of suggested users to follow. Used to help users discover new users to follow * @summary Suggest Follows * @param {number | null} fid FID of the user whose following you want to fetch. * @param {boolean} [xNeynarExperimental] Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details. * @param {number | null} [viewerFid] Providing this will return a list of users that respects this user\&#39;s mutes and blocks and includes &#x60;viewer_context&#x60;. * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100) * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<UsersResponse>} A promise that resolves to a `UsersResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-follow-suggestions) * */ async fetchFollowSuggestions(fid, xNeynarExperimental, viewerFid, limit, options) { var _a, _b, _c; const localVarAxiosArgs = await localVarAxiosParamCreator.fetchFollowSuggestions(fid, xNeynarExperimental, viewerFid, limit, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['FollowsApi.fetchFollowSuggestions']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Returns a list of relevant followers for a specific FID. This usually shows on a profile as \"X, Y and Z follow this user\". * @summary Relevant followers * @param {number} targetFid User who\&#39;s profile you are looking at * @param {number} viewerFid The FID of the user to customize this response for. Providing this will also return a list of followers that respects this user\&#39;s mutes and blocks and includes &#x60;viewer_context&#x60;. * @param {boolean} [xNeynarExperimental] Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<RelevantFollowersResponse>} A promise that resolves to a `RelevantFollowersResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-relevant-followers) * */ async fetchRelevantFollowers(targetFid, viewerFid, xNeynarExperimental, options) { var _a, _b, _c; const localVarAxiosArgs = await localVarAxiosParamCreator.fetchRelevantFollowers(targetFid, viewerFid, xNeynarExperimental, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['FollowsApi.fetchRelevantFollowers']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Returns a list of followers for a specific FID. * @summary Followers * @param {number} fid User who\&#39;s profile you are looking at * @param {boolean} [xNeynarExperimental] Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details. * @param {number} [viewerFid] Providing this will return a list of followers that respects this user\&#39;s mutes and blocks and includes &#x60;viewer_context&#x60;. * @param {FetchUserFollowersSortTypeEnum} [sortType] Sort type for fetch followers. Default is &#x60;desc_chron&#x60; * @param {number} [limit] Number of results to fetch (Default: 20, Maximum: 100) * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<FollowersResponse>} A promise that resolves to a `FollowersResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-followers) * */ async fetchUserFollowers(fid, xNeynarExperimental, viewerFid, sortType, limit, cursor, options) { var _a, _b, _c; const localVarAxiosArgs = await localVarAxiosParamCreator.fetchUserFollowers(fid, xNeynarExperimental, viewerFid, sortType, limit, cursor, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['FollowsApi.fetchUserFollowers']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Fetch a list of users who a given user is following. Can optionally include a viewer_fid and sort_type. * @summary Following * @param {number} fid FID of the user whose following you want to fetch. * @param {boolean} [xNeynarExperimental] Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details. * @param {number} [viewerFid] Providing this will return a list of users that respects this user\&#39;s mutes and blocks and includes &#x60;viewer_context&#x60;. * @param {FetchUserFollowingSortTypeEnum} [sortType] Optional parameter to sort the users based on different criteria. * @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100) * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<FollowersResponse>} A promise that resolves to a `FollowersResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-following) * */ async fetchUserFollowing(fid, xNeynarExperimental, viewerFid, sortType, limit, cursor, options) { var _a, _b, _c; const localVarAxiosArgs = await localVarAxiosParamCreator.fetchUserFollowing(fid, xNeynarExperimental, viewerFid, sortType, limit, cursor, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['FollowsApi.fetchUserFollowing']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Returns users who the given FID follows and they follow the FID back (reciprocal following relationship) * @summary Reciprocal Followers * @param {number} fid * @param {boolean} [xNeynarExperimental] Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details. * @param {number} [viewerFid] * @param {number} [limit] (Default: 25, Maximum: 100) * @param {string} [cursor] Pagination cursor * @param {FetchUserReciprocalFollowersSortTypeEnum} [sortType] * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<FetchUserReciprocalFollowers200Response>} A promise that resolves to a `FetchUserReciprocalFollowers200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-reciprocal-followers) * */ async fetchUserReciprocalFollowers(fid, xNeynarExperimental, viewerFid, limit, cursor, sortType, options) { var _a, _b, _c; const localVarAxiosArgs = await localVarAxiosParamCreator.fetchUserReciprocalFollowers(fid, xNeynarExperimental, viewerFid, limit, cursor, sortType, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['FollowsApi.fetchUserReciprocalFollowers']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, }; }; exports.FollowsApiFp = FollowsApiFp; /** * FollowsApi - factory interface * @export */ const FollowsApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.FollowsApiFp)(configuration); return { /** * Fetch a list of suggested users to follow. Used to help users discover new users to follow * @summary Suggest Follows * @param {FollowsApiFetchFollowSuggestionsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<UsersResponse>} A promise that resolves to a `UsersResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-follow-suggestions) * */ fetchFollowSuggestions(requestParameters, options) { return localVarFp.fetchFollowSuggestions(requestParameters.fid, requestParameters.xNeynarExperimental, requestParameters.viewerFid, requestParameters.limit, options).then((request) => request(axios, basePath)); }, /** * Returns a list of relevant followers for a specific FID. This usually shows on a profile as \"X, Y and Z follow this user\". * @summary Relevant followers * @param {FollowsApiFetchRelevantFollowersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<RelevantFollowersResponse>} A promise that resolves to a `RelevantFollowersResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-relevant-followers) * */ fetchRelevantFollowers(requestParameters, options) { return localVarFp.fetchRelevantFollowers(requestParameters.targetFid, requestParameters.viewerFid, requestParameters.xNeynarExperimental, options).then((request) => request(axios, basePath)); }, /** * Returns a list of followers for a specific FID. * @summary Followers * @param {FollowsApiFetchUserFollowersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<FollowersResponse>} A promise that resolves to a `FollowersResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-followers) * */ fetchUserFollowers(requestParameters, options) { return localVarFp.fetchUserFollowers(requestParameters.fid, requestParameters.xNeynarExperimental, requestParameters.viewerFid, requestParameters.sortType, requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath)); }, /** * Fetch a list of users who a given user is following. Can optionally include a viewer_fid and sort_type. * @summary Following * @param {FollowsApiFetchUserFollowingRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<FollowersResponse>} A promise that resolves to a `FollowersResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-following) * */ fetchUserFollowing(requestParameters, options) { return localVarFp.fetchUserFollowing(requestParameters.fid, requestParameters.xNeynarExperimental, requestParameters.viewerFid, requestParameters.sortType, requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath)); }, /** * Returns users who the given FID follows and they follow the FID back (reciprocal following relationship) * @summary Reciprocal Followers * @param {FollowsApiFetchUserReciprocalFollowersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<FetchUserReciprocalFollowers200Response>} A promise that resolves to a `FetchUserReciprocalFollowers200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-reciprocal-followers) * */ fetchUserReciprocalFollowers(requestParameters, options) { return localVarFp.fetchUserReciprocalFollowers(requestParameters.fid, requestParameters.xNeynarExperimental, requestParameters.viewerFid, requestParameters.limit, requestParameters.cursor, requestParameters.sortType, options).then((request) => request(axios, basePath)); }, }; }; exports.FollowsApiFactory = FollowsApiFactory; /** * FollowsApi - object-oriented interface * @export * @class FollowsApi * @extends {BaseAPI} */ class FollowsApi extends base_1.BaseAPI { /** * Fetch a list of suggested users to follow. Used to help users discover new users to follow * @summary Suggest Follows * @param {FollowsApiFetchFollowSuggestionsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FollowsApi * @returns {Promise<UsersResponse>} A promise that resolves to a `UsersResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-follow-suggestions) * */ fetchFollowSuggestions(requestParameters, options) { return (0, exports.FollowsApiFp)(this.configuration).fetchFollowSuggestions(requestParameters.fid, requestParameters.xNeynarExperimental, requestParameters.viewerFid, requestParameters.limit, options).then((request) => request(this.axios, this.basePath)); } /** * Returns a list of relevant followers for a specific FID. This usually shows on a profile as \"X, Y and Z follow this user\". * @summary Relevant followers * @param {FollowsApiFetchRelevantFollowersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FollowsApi * @returns {Promise<RelevantFollowersResponse>} A promise that resolves to a `RelevantFollowersResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-relevant-followers) * */ fetchRelevantFollowers(requestParameters, options) { return (0, exports.FollowsApiFp)(this.configuration).fetchRelevantFollowers(requestParameters.targetFid, requestParameters.viewerFid, requestParameters.xNeynarExperimental, options).then((request) => request(this.axios, this.basePath)); } /** * Returns a list of followers for a specific FID. * @summary Followers * @param {FollowsApiFetchUserFollowersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FollowsApi * @returns {Promise<FollowersResponse>} A promise that resolves to a `FollowersResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-followers) * */ fetchUserFollowers(requestParameters, options) { return (0, exports.FollowsApiFp)(this.configuration).fetchUserFollowers(requestParameters.fid, requestParameters.xNeynarExperimental, requestParameters.viewerFid, requestParameters.sortType, requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath)); } /** * Fetch a list of users who a given user is following. Can optionally include a viewer_fid and sort_type. * @summary Following * @param {FollowsApiFetchUserFollowingRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FollowsApi * @returns {Promise<FollowersResponse>} A promise that resolves to a `FollowersResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-following) * */ fetchUserFollowing(requestParameters, options) { return (0, exports.FollowsApiFp)(this.configuration).fetchUserFollowing(requestParameters.fid, requestParameters.xNeynarExperimental, requestParameters.viewerFid, requestParameters.sortType, requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath)); } /** * Returns users who the given FID follows and they follow the FID back (reciprocal following relationship) * @summary Reciprocal Followers * @param {FollowsApiFetchUserReciprocalFollowersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FollowsApi * @returns {Promise<FetchUserReciprocalFollowers200Response>} A promise that resolves to a `FetchUserReciprocalFollowers200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-reciprocal-followers) * */ fetchUserReciprocalFollowers(requestParameters, options) { return (0, exports.FollowsApiFp)(this.configuration).fetchUserReciprocalFollowers(requestParameters.fid, requestParameters.xNeynarExperimental, requestParameters.viewerFid, requestParameters.limit, requestParameters.cursor, requestParameters.sortType, options).then((request) => request(this.axios, this.basePath)); } } exports.FollowsApi = FollowsApi; /** * @export */ exports.FetchUserFollowersSortTypeEnum = { DescChron: 'desc_chron', Algorithmic: 'algorithmic' }; /** * @export */ exports.FetchUserFollowingSortTypeEnum = { DescChron: 'desc_chron', Algorithmic: 'algorithmic' }; /** * @export */ exports.FetchUserReciprocalFollowersSortTypeEnum = { DescChron: 'desc_chron', Algorithmic: 'algorithmic' };