UNPKG

@neynar/nodejs-sdk

Version:

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

182 lines (181 loc) 7.63 kB
/** * 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.115.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. */ import type { Configuration } from '../configuration'; import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import { type RequestArgs, BaseAPI } from '../base'; import type { CastsMetricsResponse } from '../models'; /** * MetricsApi - axios parameter creator * @export */ export declare const MetricsApiAxiosParamCreator: (configuration?: Configuration) => { /** * Fetches metrics casts matching a query * @summary Metrics for casts * @param {string} q Query string to search for casts * @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 {FetchCastMetricsIntervalEnum} [interval] Interval of time for which to fetch metrics. Default is 30d. * @param {number} [authorFid] Fid of the user whose casts you want to search * @param {string} [channelId] Channel ID of the casts you want to search * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<CastsMetricsResponse>} A promise that resolves to a `CastsMetricsResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-cast-metrics) * */ fetchCastMetrics: (q: string, xNeynarExperimental?: boolean, interval?: FetchCastMetricsIntervalEnum, authorFid?: number, channelId?: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>; }; /** * MetricsApi - functional programming interface * @export */ export declare const MetricsApiFp: (configuration?: Configuration) => { /** * Fetches metrics casts matching a query * @summary Metrics for casts * @param {string} q Query string to search for casts * @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 {FetchCastMetricsIntervalEnum} [interval] Interval of time for which to fetch metrics. Default is 30d. * @param {number} [authorFid] Fid of the user whose casts you want to search * @param {string} [channelId] Channel ID of the casts you want to search * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<CastsMetricsResponse>} A promise that resolves to a `CastsMetricsResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-cast-metrics) * */ fetchCastMetrics(q: string, xNeynarExperimental?: boolean, interval?: FetchCastMetricsIntervalEnum, authorFid?: number, channelId?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CastsMetricsResponse>>; }; /** * MetricsApi - factory interface * @export */ export declare const MetricsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => { /** * Fetches metrics casts matching a query * @summary Metrics for casts * @param {MetricsApiFetchCastMetricsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<CastsMetricsResponse>} A promise that resolves to a `CastsMetricsResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-cast-metrics) * */ fetchCastMetrics(requestParameters: MetricsApiFetchCastMetricsRequest, options?: RawAxiosRequestConfig): AxiosPromise<CastsMetricsResponse>; }; /** * MetricsApi - interface * @export * @interface MetricsApi */ export interface MetricsApiInterface { /** * Fetches metrics casts matching a query * @summary Metrics for casts * @param {MetricsApiFetchCastMetricsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof MetricsApiInterface * @returns {Promise<CastsMetricsResponse>} A promise that resolves to a `CastsMetricsResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-cast-metrics) * */ fetchCastMetrics(requestParameters: MetricsApiFetchCastMetricsRequest, options?: RawAxiosRequestConfig): AxiosPromise<CastsMetricsResponse>; } /** * Request parameters for fetchCastMetrics operation in MetricsApi. * @export * @interface MetricsApiFetchCastMetricsRequest */ export interface MetricsApiFetchCastMetricsRequest { /** * Query string to search for casts * * * * @type {string} * @memberof MetricsApiFetchCastMetrics */ readonly q: string; /** * Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details. * * * @globalHeader * @type {boolean} * @memberof MetricsApiFetchCastMetrics */ readonly xNeynarExperimental?: boolean; /** * Interval of time for which to fetch metrics. Default is 30d. * * * * @type {'1d' | '7d' | '30d' | '90d' | '180d'} * @memberof MetricsApiFetchCastMetrics */ readonly interval?: FetchCastMetricsIntervalEnum; /** * Fid of the user whose casts you want to search * * * * @type {number} * @memberof MetricsApiFetchCastMetrics */ readonly authorFid?: number; /** * Channel ID of the casts you want to search * * * * @type {string} * @memberof MetricsApiFetchCastMetrics */ readonly channelId?: string; } /** * MetricsApi - object-oriented interface * @export * @class MetricsApi * @extends {BaseAPI} */ export declare class MetricsApi extends BaseAPI implements MetricsApiInterface { /** * Fetches metrics casts matching a query * @summary Metrics for casts * @param {MetricsApiFetchCastMetricsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof MetricsApi * @returns {Promise<CastsMetricsResponse>} A promise that resolves to a `CastsMetricsResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-cast-metrics) * */ fetchCastMetrics(requestParameters: MetricsApiFetchCastMetricsRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<CastsMetricsResponse, any, {}>>; } /** * @export */ export declare const FetchCastMetricsIntervalEnum: { readonly _1d: "1d"; readonly _7d: "7d"; readonly _30d: "30d"; readonly _90d: "90d"; readonly _180d: "180d"; }; export type FetchCastMetricsIntervalEnum = typeof FetchCastMetricsIntervalEnum[keyof typeof FetchCastMetricsIntervalEnum];