@standard-crypto/farcaster-js-hub-rest
Version:
A tool for interacting with the REST API of any Farcaster hub.
324 lines (323 loc) • 13.9 kB
TypeScript
/**
* 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 globalAxios from 'axios';
import { RequestArgs, BaseAPI } from '../base.js';
import { CastAdd } from '../models/index.js';
import { ListCastsByFid200Response } from '../models/index.js';
/**
* CastsApi - axios parameter creator
* @export
*/
export declare const CastsApiAxiosParamCreator: (configuration?: Configuration) => {
/**
*
* @summary Get a cast by its FID and Hash.
* @param {number} fid The FID of the cast\'s creator
* @param {string} hash The cast\'s hash
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCastById: (fid: number, hash: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
/**
*
* @summary Fetch all casts authored by an FID.
* @param {number} fid The FID of the casts\' creator
* @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}
*/
listCastsByFid: (fid: number, pageSize?: number, reverse?: boolean, pageToken?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
/**
*
* @summary Fetch all casts that mention an FID
* @param {number} fid The FID that is mentioned in a cast
* @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}
*/
listCastsByMention: (fid: number, pageSize?: number, reverse?: boolean, pageToken?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
/**
*
* @summary Fetch all casts by parent cast\'s FID and Hash OR by the parent\'s URL
* @param {number} [fid] The FID of the parent cast
* @param {string} [hash] The parent cast\'s hash
* @param {string} [url]
* @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}
*/
listCastsByParent: (fid?: number, hash?: string, url?: string, pageSize?: number, reverse?: boolean, pageToken?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
};
/**
* CastsApi - functional programming interface
* @export
*/
export declare const CastsApiFp: (configuration?: Configuration) => {
/**
*
* @summary Get a cast by its FID and Hash.
* @param {number} fid The FID of the cast\'s creator
* @param {string} hash The cast\'s hash
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCastById(fid: number, hash: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CastAdd>>;
/**
*
* @summary Fetch all casts authored by an FID.
* @param {number} fid The FID of the casts\' creator
* @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}
*/
listCastsByFid(fid: number, pageSize?: number, reverse?: boolean, pageToken?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListCastsByFid200Response>>;
/**
*
* @summary Fetch all casts that mention an FID
* @param {number} fid The FID that is mentioned in a cast
* @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}
*/
listCastsByMention(fid: number, pageSize?: number, reverse?: boolean, pageToken?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListCastsByFid200Response>>;
/**
*
* @summary Fetch all casts by parent cast\'s FID and Hash OR by the parent\'s URL
* @param {number} [fid] The FID of the parent cast
* @param {string} [hash] The parent cast\'s hash
* @param {string} [url]
* @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}
*/
listCastsByParent(fid?: number, hash?: string, url?: string, pageSize?: number, reverse?: boolean, pageToken?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListCastsByFid200Response>>;
};
/**
* CastsApi - factory interface
* @export
*/
export declare const CastsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
/**
*
* @summary Get a cast by its FID and Hash.
* @param {CastsApiGetCastByIdRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCastById(requestParameters: CastsApiGetCastByIdRequest, options?: AxiosRequestConfig): AxiosPromise<CastAdd>;
/**
*
* @summary Fetch all casts authored by an FID.
* @param {CastsApiListCastsByFidRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listCastsByFid(requestParameters: CastsApiListCastsByFidRequest, options?: AxiosRequestConfig): AxiosPromise<ListCastsByFid200Response>;
/**
*
* @summary Fetch all casts that mention an FID
* @param {CastsApiListCastsByMentionRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listCastsByMention(requestParameters: CastsApiListCastsByMentionRequest, options?: AxiosRequestConfig): AxiosPromise<ListCastsByFid200Response>;
/**
*
* @summary Fetch all casts by parent cast\'s FID and Hash OR by the parent\'s URL
* @param {CastsApiListCastsByParentRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listCastsByParent(requestParameters?: CastsApiListCastsByParentRequest, options?: AxiosRequestConfig): AxiosPromise<ListCastsByFid200Response>;
};
/**
* Request parameters for getCastById operation in CastsApi.
* @export
* @interface CastsApiGetCastByIdRequest
*/
export interface CastsApiGetCastByIdRequest {
/**
* The FID of the cast\'s creator
* @type {number}
* @memberof CastsApiGetCastById
*/
readonly fid: number;
/**
* The cast\'s hash
* @type {string}
* @memberof CastsApiGetCastById
*/
readonly hash: string;
}
/**
* Request parameters for listCastsByFid operation in CastsApi.
* @export
* @interface CastsApiListCastsByFidRequest
*/
export interface CastsApiListCastsByFidRequest {
/**
* The FID of the casts\' creator
* @type {number}
* @memberof CastsApiListCastsByFid
*/
readonly fid: number;
/**
* Maximum number of messages to return in a single response
* @type {number}
* @memberof CastsApiListCastsByFid
*/
readonly pageSize?: number;
/**
* Reverse the sort order, returning latest messages first
* @type {boolean}
* @memberof CastsApiListCastsByFid
*/
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 CastsApiListCastsByFid
*/
readonly pageToken?: string;
}
/**
* Request parameters for listCastsByMention operation in CastsApi.
* @export
* @interface CastsApiListCastsByMentionRequest
*/
export interface CastsApiListCastsByMentionRequest {
/**
* The FID that is mentioned in a cast
* @type {number}
* @memberof CastsApiListCastsByMention
*/
readonly fid: number;
/**
* Maximum number of messages to return in a single response
* @type {number}
* @memberof CastsApiListCastsByMention
*/
readonly pageSize?: number;
/**
* Reverse the sort order, returning latest messages first
* @type {boolean}
* @memberof CastsApiListCastsByMention
*/
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 CastsApiListCastsByMention
*/
readonly pageToken?: string;
}
/**
* Request parameters for listCastsByParent operation in CastsApi.
* @export
* @interface CastsApiListCastsByParentRequest
*/
export interface CastsApiListCastsByParentRequest {
/**
* The FID of the parent cast
* @type {number}
* @memberof CastsApiListCastsByParent
*/
readonly fid?: number;
/**
* The parent cast\'s hash
* @type {string}
* @memberof CastsApiListCastsByParent
*/
readonly hash?: string;
/**
*
* @type {string}
* @memberof CastsApiListCastsByParent
*/
readonly url?: string;
/**
* Maximum number of messages to return in a single response
* @type {number}
* @memberof CastsApiListCastsByParent
*/
readonly pageSize?: number;
/**
* Reverse the sort order, returning latest messages first
* @type {boolean}
* @memberof CastsApiListCastsByParent
*/
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 CastsApiListCastsByParent
*/
readonly pageToken?: string;
}
/**
* CastsApi - object-oriented interface
* @export
* @class CastsApi
* @extends {BaseAPI}
*/
export declare class CastsApi extends BaseAPI {
/**
*
* @summary Get a cast by its FID and Hash.
* @param {CastsApiGetCastByIdRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CastsApi
*/
getCastById(requestParameters: CastsApiGetCastByIdRequest, options?: AxiosRequestConfig): Promise<globalAxios.AxiosResponse<CastAdd, any>>;
/**
*
* @summary Fetch all casts authored by an FID.
* @param {CastsApiListCastsByFidRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CastsApi
*/
listCastsByFid(requestParameters: CastsApiListCastsByFidRequest, options?: AxiosRequestConfig): Promise<globalAxios.AxiosResponse<ListCastsByFid200Response, any>>;
/**
*
* @summary Fetch all casts that mention an FID
* @param {CastsApiListCastsByMentionRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CastsApi
*/
listCastsByMention(requestParameters: CastsApiListCastsByMentionRequest, options?: AxiosRequestConfig): Promise<globalAxios.AxiosResponse<ListCastsByFid200Response, any>>;
/**
*
* @summary Fetch all casts by parent cast\'s FID and Hash OR by the parent\'s URL
* @param {CastsApiListCastsByParentRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CastsApi
*/
listCastsByParent(requestParameters?: CastsApiListCastsByParentRequest, options?: AxiosRequestConfig): Promise<globalAxios.AxiosResponse<ListCastsByFid200Response, any>>;
}