UNPKG

@standard-crypto/farcaster-js-hub-rest

Version:

A tool for interacting with the REST API of any Farcaster hub.

356 lines (355 loc) 16.5 kB
/** * Farcaster Hub REST API * Perform basic queries of Farcaster state via the REST API of a Farcaster hub. See the [Farcaster docs](https://www.thehubble.xyz/docs/httpapi/httpapi.html) for more details. Some client libraries: - [TypeScript](https://www.npmjs.com/package/@standard-crypto/farcaster-js-hub-rest) * * 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 type { Configuration } from '../configuration.js'; import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; import { RequestArgs, BaseAPI } from '../base.js'; import { ListReactionsByCast200Response } from '../models/index.js'; import { Reaction } from '../models/index.js'; import { ReactionType } from '../models/index.js'; /** * ReactionsApi - axios parameter creator * @export */ export declare const ReactionsApiAxiosParamCreator: (configuration?: Configuration) => { /** * * @summary Get a reaction by its created FID and target Cast. * @param {number} fid The FID of the reaction\&#39;s creator * @param {number} targetFid The FID of the cast\&#39;s creator * @param {string} targetHash The cast\&#39;s hash * @param {ReactionType} reactionType The type of reaction, either as a numerical enum value or string representation * @param {*} [options] Override http request option. * @throws {RequiredError} */ getReactionById: (fid: number, targetFid: number, targetHash: string, reactionType: ReactionType, options?: AxiosRequestConfig) => Promise<RequestArgs>; /** * * @summary Get all reactions to a cast * @param {number} targetFid The FID of the cast\&#39;s creator * @param {string} targetHash The hash of the cast * @param {ReactionType} reactionType The type of reaction, either as a numerical enum value or string representation * @param {number} [pageSize] Maximum number of messages to return in a single response * @param {boolean} [reverse] Reverse the sort order, returning latest messages first * @param {string} [pageToken] The page token returned by the previous query, to fetch the next page. If this parameter is empty, fetch the first page * @param {*} [options] Override http request option. * @throws {RequiredError} */ listReactionsByCast: (targetFid: number, targetHash: string, reactionType: ReactionType, pageSize?: number, reverse?: boolean, pageToken?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>; /** * * @summary Get all reactions by an FID * @param {number} fid The FID of the reaction\&#39;s creator * @param {ReactionType} reactionType The type of reaction, either as a numerical enum value or string representation * @param {number} [pageSize] Maximum number of messages to return in a single response * @param {boolean} [reverse] Reverse the sort order, returning latest messages first * @param {string} [pageToken] The page token returned by the previous query, to fetch the next page. If this parameter is empty, fetch the first page * @param {*} [options] Override http request option. * @throws {RequiredError} */ listReactionsByFid: (fid: number, reactionType: ReactionType, pageSize?: number, reverse?: boolean, pageToken?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>; /** * * @summary Get all reactions to a target URL * @param {string} url The URL of the parent cast * @param {ReactionType} reactionType The type of reaction, either as a numerical enum value or string representation * @param {number} [pageSize] Maximum number of messages to return in a single response * @param {boolean} [reverse] Reverse the sort order, returning latest messages first * @param {string} [pageToken] The page token returned by the previous query, to fetch the next page. If this parameter is empty, fetch the first page * @param {*} [options] Override http request option. * @throws {RequiredError} */ listReactionsByTarget: (url: string, reactionType: ReactionType, pageSize?: number, reverse?: boolean, pageToken?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>; }; /** * ReactionsApi - functional programming interface * @export */ export declare const ReactionsApiFp: (configuration?: Configuration) => { /** * * @summary Get a reaction by its created FID and target Cast. * @param {number} fid The FID of the reaction\&#39;s creator * @param {number} targetFid The FID of the cast\&#39;s creator * @param {string} targetHash The cast\&#39;s hash * @param {ReactionType} reactionType The type of reaction, either as a numerical enum value or string representation * @param {*} [options] Override http request option. * @throws {RequiredError} */ getReactionById(fid: number, targetFid: number, targetHash: string, reactionType: ReactionType, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Reaction>>; /** * * @summary Get all reactions to a cast * @param {number} targetFid The FID of the cast\&#39;s creator * @param {string} targetHash The hash of the cast * @param {ReactionType} reactionType The type of reaction, either as a numerical enum value or string representation * @param {number} [pageSize] Maximum number of messages to return in a single response * @param {boolean} [reverse] Reverse the sort order, returning latest messages first * @param {string} [pageToken] The page token returned by the previous query, to fetch the next page. If this parameter is empty, fetch the first page * @param {*} [options] Override http request option. * @throws {RequiredError} */ listReactionsByCast(targetFid: number, targetHash: string, reactionType: ReactionType, pageSize?: number, reverse?: boolean, pageToken?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListReactionsByCast200Response>>; /** * * @summary Get all reactions by an FID * @param {number} fid The FID of the reaction\&#39;s creator * @param {ReactionType} reactionType The type of reaction, either as a numerical enum value or string representation * @param {number} [pageSize] Maximum number of messages to return in a single response * @param {boolean} [reverse] Reverse the sort order, returning latest messages first * @param {string} [pageToken] The page token returned by the previous query, to fetch the next page. If this parameter is empty, fetch the first page * @param {*} [options] Override http request option. * @throws {RequiredError} */ listReactionsByFid(fid: number, reactionType: ReactionType, pageSize?: number, reverse?: boolean, pageToken?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListReactionsByCast200Response>>; /** * * @summary Get all reactions to a target URL * @param {string} url The URL of the parent cast * @param {ReactionType} reactionType The type of reaction, either as a numerical enum value or string representation * @param {number} [pageSize] Maximum number of messages to return in a single response * @param {boolean} [reverse] Reverse the sort order, returning latest messages first * @param {string} [pageToken] The page token returned by the previous query, to fetch the next page. If this parameter is empty, fetch the first page * @param {*} [options] Override http request option. * @throws {RequiredError} */ listReactionsByTarget(url: string, reactionType: ReactionType, pageSize?: number, reverse?: boolean, pageToken?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListReactionsByCast200Response>>; }; /** * ReactionsApi - factory interface * @export */ export declare const ReactionsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => { /** * * @summary Get a reaction by its created FID and target Cast. * @param {ReactionsApiGetReactionByIdRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getReactionById(requestParameters: ReactionsApiGetReactionByIdRequest, options?: AxiosRequestConfig): AxiosPromise<Reaction>; /** * * @summary Get all reactions to a cast * @param {ReactionsApiListReactionsByCastRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listReactionsByCast(requestParameters: ReactionsApiListReactionsByCastRequest, options?: AxiosRequestConfig): AxiosPromise<ListReactionsByCast200Response>; /** * * @summary Get all reactions by an FID * @param {ReactionsApiListReactionsByFidRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listReactionsByFid(requestParameters: ReactionsApiListReactionsByFidRequest, options?: AxiosRequestConfig): AxiosPromise<ListReactionsByCast200Response>; /** * * @summary Get all reactions to a target URL * @param {ReactionsApiListReactionsByTargetRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listReactionsByTarget(requestParameters: ReactionsApiListReactionsByTargetRequest, options?: AxiosRequestConfig): AxiosPromise<ListReactionsByCast200Response>; }; /** * Request parameters for getReactionById operation in ReactionsApi. * @export * @interface ReactionsApiGetReactionByIdRequest */ export interface ReactionsApiGetReactionByIdRequest { /** * The FID of the reaction\&#39;s creator * @type {number} * @memberof ReactionsApiGetReactionById */ readonly fid: number; /** * The FID of the cast\&#39;s creator * @type {number} * @memberof ReactionsApiGetReactionById */ readonly targetFid: number; /** * The cast\&#39;s hash * @type {string} * @memberof ReactionsApiGetReactionById */ readonly targetHash: string; /** * The type of reaction, either as a numerical enum value or string representation * @type {ReactionType} * @memberof ReactionsApiGetReactionById */ readonly reactionType: ReactionType; } /** * Request parameters for listReactionsByCast operation in ReactionsApi. * @export * @interface ReactionsApiListReactionsByCastRequest */ export interface ReactionsApiListReactionsByCastRequest { /** * The FID of the cast\&#39;s creator * @type {number} * @memberof ReactionsApiListReactionsByCast */ readonly targetFid: number; /** * The hash of the cast * @type {string} * @memberof ReactionsApiListReactionsByCast */ readonly targetHash: string; /** * The type of reaction, either as a numerical enum value or string representation * @type {ReactionType} * @memberof ReactionsApiListReactionsByCast */ readonly reactionType: ReactionType; /** * Maximum number of messages to return in a single response * @type {number} * @memberof ReactionsApiListReactionsByCast */ readonly pageSize?: number; /** * Reverse the sort order, returning latest messages first * @type {boolean} * @memberof ReactionsApiListReactionsByCast */ readonly reverse?: boolean; /** * The page token returned by the previous query, to fetch the next page. If this parameter is empty, fetch the first page * @type {string} * @memberof ReactionsApiListReactionsByCast */ readonly pageToken?: string; } /** * Request parameters for listReactionsByFid operation in ReactionsApi. * @export * @interface ReactionsApiListReactionsByFidRequest */ export interface ReactionsApiListReactionsByFidRequest { /** * The FID of the reaction\&#39;s creator * @type {number} * @memberof ReactionsApiListReactionsByFid */ readonly fid: number; /** * The type of reaction, either as a numerical enum value or string representation * @type {ReactionType} * @memberof ReactionsApiListReactionsByFid */ readonly reactionType: ReactionType; /** * Maximum number of messages to return in a single response * @type {number} * @memberof ReactionsApiListReactionsByFid */ readonly pageSize?: number; /** * Reverse the sort order, returning latest messages first * @type {boolean} * @memberof ReactionsApiListReactionsByFid */ readonly reverse?: boolean; /** * The page token returned by the previous query, to fetch the next page. If this parameter is empty, fetch the first page * @type {string} * @memberof ReactionsApiListReactionsByFid */ readonly pageToken?: string; } /** * Request parameters for listReactionsByTarget operation in ReactionsApi. * @export * @interface ReactionsApiListReactionsByTargetRequest */ export interface ReactionsApiListReactionsByTargetRequest { /** * The URL of the parent cast * @type {string} * @memberof ReactionsApiListReactionsByTarget */ readonly url: string; /** * The type of reaction, either as a numerical enum value or string representation * @type {ReactionType} * @memberof ReactionsApiListReactionsByTarget */ readonly reactionType: ReactionType; /** * Maximum number of messages to return in a single response * @type {number} * @memberof ReactionsApiListReactionsByTarget */ readonly pageSize?: number; /** * Reverse the sort order, returning latest messages first * @type {boolean} * @memberof ReactionsApiListReactionsByTarget */ readonly reverse?: boolean; /** * The page token returned by the previous query, to fetch the next page. If this parameter is empty, fetch the first page * @type {string} * @memberof ReactionsApiListReactionsByTarget */ readonly pageToken?: string; } /** * ReactionsApi - object-oriented interface * @export * @class ReactionsApi * @extends {BaseAPI} */ export declare class ReactionsApi extends BaseAPI { /** * * @summary Get a reaction by its created FID and target Cast. * @param {ReactionsApiGetReactionByIdRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ReactionsApi */ getReactionById(requestParameters: ReactionsApiGetReactionByIdRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<Reaction, any>>; /** * * @summary Get all reactions to a cast * @param {ReactionsApiListReactionsByCastRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ReactionsApi */ listReactionsByCast(requestParameters: ReactionsApiListReactionsByCastRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListReactionsByCast200Response, any>>; /** * * @summary Get all reactions by an FID * @param {ReactionsApiListReactionsByFidRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ReactionsApi */ listReactionsByFid(requestParameters: ReactionsApiListReactionsByFidRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListReactionsByCast200Response, any>>; /** * * @summary Get all reactions to a target URL * @param {ReactionsApiListReactionsByTargetRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ReactionsApi */ listReactionsByTarget(requestParameters: ReactionsApiListReactionsByTargetRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListReactionsByCast200Response, any>>; }