@standard-crypto/farcaster-js-neynar
Version:
A tool for interacting with Farcaster via Neynar APIs.
204 lines • 9.76 kB
JavaScript
;
/* 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.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
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_js_1 = require("../common.js");
// @ts-ignore
const base_js_1 = require("../base.js");
/**
* FollowsApi - axios parameter creator
* @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
(0, common_js_1.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, common_js_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKeyAuth required
await (0, common_js_1.setApiKeyToObject)(localVarHeaderParameter, "api_key", configuration);
if (fid !== undefined) {
localVarQueryParameter['fid'] = fid;
}
if (viewerFid !== undefined) {
localVarQueryParameter['viewerFid'] = viewerFid;
}
(0, common_js_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_js_1.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
(0, common_js_1.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, common_js_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKeyAuth required
await (0, common_js_1.setApiKeyToObject)(localVarHeaderParameter, "api_key", configuration);
if (fid !== undefined) {
localVarQueryParameter['fid'] = fid;
}
if (viewerFid !== undefined) {
localVarQueryParameter['viewerFid'] = viewerFid;
}
(0, common_js_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_js_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};
exports.FollowsApiAxiosParamCreator = FollowsApiAxiosParamCreator;
/**
* FollowsApi - functional programming interface
* @export
*/
const FollowsApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.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 (0, common_js_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_js_1.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 (0, common_js_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_js_1.BASE_PATH, configuration);
},
};
};
exports.FollowsApiFp = FollowsApiFp;
/**
* FollowsApi - factory interface
* @export
*/
const FollowsApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.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));
},
};
};
exports.FollowsApiFactory = FollowsApiFactory;
/**
* FollowsApi - object-oriented interface
* @export
* @class FollowsApi
* @extends {BaseAPI}
*/
class FollowsApi extends base_js_1.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 (0, exports.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 (0, exports.FollowsApiFp)(this.configuration).following(requestParameters.fid, requestParameters.viewerFid, options).then((request) => request(this.axios, this.basePath));
}
}
exports.FollowsApi = FollowsApi;
//# sourceMappingURL=follows-api.js.map