UNPKG

@standard-crypto/farcaster-js-neynar

Version:

A tool for interacting with Farcaster via Neynar APIs.

294 lines 14.9 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'; /** * ReactionsApi - axios parameter creator * @export */ export const ReactionsApiAxiosParamCreator = function (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, viewerFid, cursor, limit, options = {}) => { // 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 = {}; const localVarQueryParameter = {}; // 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, viewerFid, cursor, limit, options = {}) => { // 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 = {}; const localVarQueryParameter = {}; // 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, viewerFid, cursor, limit, options = {}) => { // 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 = {}; const localVarQueryParameter = {}; // 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) { 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, viewerFid, cursor, limit, options) { 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, viewerFid, cursor, limit, options) { 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, viewerFid, cursor, limit, options) { 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, basePath, axios) { 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, options) { 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, options) { 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, options) { return localVarFp.castRecasters(requestParameters.castHash, requestParameters.viewerFid, requestParameters.cursor, requestParameters.limit, 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 {ReactionsApiCastLikesRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ReactionsApi */ castLikes(requestParameters, options) { 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 */ castReactions(requestParameters, options) { 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 */ castRecasters(requestParameters, options) { return ReactionsApiFp(this.configuration).castRecasters(requestParameters.castHash, requestParameters.viewerFid, requestParameters.cursor, requestParameters.limit, options).then((request) => request(this.axios, this.basePath)); } } //# sourceMappingURL=reactions-api.js.map