UNPKG

@standard-crypto/farcaster-js-neynar

Version:

A tool for interacting with Farcaster via Neynar APIs.

194 lines 9.07 kB
/* tslint:disable */ /* eslint-disable */ /** * v1 Farcaster * 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 globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setSearchParams, toPathString, createRequestFunction } from '../common.js'; // @ts-ignore import { BASE_PATH, BaseAPI } from '../base.js'; /** * FollowsApi - axios parameter creator * @export */ export const FollowsApiAxiosParamCreator = function (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 {*} [options] Override http request option. * @throws {RequiredError} */ followers: async (fid, viewerFid, options = {}) => { // 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 = {}; const localVarQueryParameter = {}; // 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, }; }, /** * 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 {*} [options] Override http request option. * @throws {RequiredError} */ following: async (fid, viewerFid, options = {}) => { // 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 = {}; const localVarQueryParameter = {}; // 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, }; }, }; }; /** * FollowsApi - functional programming interface * @export */ export const FollowsApiFp = function (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 {*} [options] Override http request option. * @throws {RequiredError} */ async followers(fid, viewerFid, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.followers(fid, viewerFid, 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 {*} [options] Override http request option. * @throws {RequiredError} */ async following(fid, viewerFid, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.following(fid, viewerFid, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, }; }; /** * FollowsApi - factory interface * @export */ export const FollowsApiFactory = function (configuration, basePath, axios) { 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, options) { return localVarFp.followers(requestParameters.fid, requestParameters.viewerFid, 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, options) { return localVarFp.following(requestParameters.fid, requestParameters.viewerFid, 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 {FollowsApiFollowersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FollowsApi */ followers(requestParameters, options) { return FollowsApiFp(this.configuration).followers(requestParameters.fid, requestParameters.viewerFid, 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 */ following(requestParameters, options) { return FollowsApiFp(this.configuration).following(requestParameters.fid, requestParameters.viewerFid, options).then((request) => request(this.axios, this.basePath)); } } //# sourceMappingURL=follows-api.js.map