@standard-crypto/farcaster-js-neynar
Version:
A tool for interacting with Farcaster via Neynar APIs.
126 lines • 5.53 kB
JavaScript
/* 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 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 {
/**
* 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, viewerFid, options = {}) => {
// 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 = {};
const localVarQueryParameter = {};
// authentication ApiKeyAuth required
await setApiKeyToObject(localVarHeaderParameter, "api_key", configuration);
if (targetFid !== undefined) {
localVarQueryParameter['target_fid'] = targetFid;
}
if (viewerFid !== undefined) {
localVarQueryParameter['viewer_fid'] = 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 {
/**
* 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, viewerFid, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.relevantFollowers(targetFid, 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 {
/**
* Returns a list of relevant followers for a specific FID.
* @summary Retrieve relevant followers for a given user
* @param {FollowsApiRelevantFollowersRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
relevantFollowers(requestParameters, options) {
return localVarFp.relevantFollowers(requestParameters.targetFid, requestParameters.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 {FollowsApiRelevantFollowersRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FollowsApi
*/
relevantFollowers(requestParameters, options) {
return FollowsApiFp(this.configuration).relevantFollowers(requestParameters.targetFid, requestParameters.viewerFid, options).then((request) => request(this.axios, this.basePath));
}
}
//# sourceMappingURL=follows-api.js.map