@neynar/nodejs-sdk
Version:
SDK to interact with Neynar APIs (https://docs.neynar.com/reference/quickstart)
470 lines (469 loc) • 21.8 kB
TypeScript
/**
* 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 { OperationResponse } from '../models';
import type { ReactionReqBody } from '../models';
import type { ReactionsCastResponse } from '../models';
import type { ReactionsResponse } from '../models';
/**
* ReactionApi - axios parameter creator
* @export
*/
export declare const ReactionApiAxiosParamCreator: (configuration?: Configuration) => {
/**
* Delete a reaction (like or recast) to a cast (In order to delete a reaction `signer_uuid` must be approved)
* @summary Delete reaction
* @param {ReactionReqBody} reactionReqBody
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<OperationResponse>} A promise that resolves to a `OperationResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-reaction)
*
*/
deleteReaction: (reactionReqBody: ReactionReqBody, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
/**
* Fetches reactions for a given cast
* @summary Reactions for cast
* @param {string} hash
* @param {Array<FetchCastReactionsTypesEnum>} types Customize which reaction types the request should search for. This is a comma-separated string that can include the following values: \'likes\' and \'recasts\'. By default api returns both. To select multiple types, use a comma-separated list of these values.
* @param {number} [viewerFid] Providing this will return a list of reactions that respects this user\'s mutes and blocks and includes `viewer_context`.
* @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100)
* @param {string} [cursor] Pagination cursor.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<ReactionsCastResponse>} A promise that resolves to a `ReactionsCastResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-cast-reactions)
*
*/
fetchCastReactions: (hash: string, types: Array<FetchCastReactionsTypesEnum>, viewerFid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
/**
* Fetches reactions for a given user
* @summary Reactions for user
* @param {number} fid The unique identifier of a farcaster user or app (unsigned integer)
* @param {FetchUserReactionsTypeEnum} type Type of reaction to fetch (likes or recasts or all)
* @param {number} [viewerFid] Providing this will return a list of reactions that respects this user\'s mutes and blocks and includes `viewer_context`.
* @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100)
* @param {string} [cursor] Pagination cursor.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<ReactionsResponse>} A promise that resolves to a `ReactionsResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-reactions)
*
*/
fetchUserReactions: (fid: number, type: FetchUserReactionsTypeEnum, viewerFid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
/**
* Post a reaction (like or recast) to a given cast (In order to post a reaction `signer_uuid` must be approved)
* @summary Post a reaction
* @param {ReactionReqBody} reactionReqBody
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<OperationResponse>} A promise that resolves to a `OperationResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-reaction)
*
*/
publishReaction: (reactionReqBody: ReactionReqBody, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
};
/**
* ReactionApi - functional programming interface
* @export
*/
export declare const ReactionApiFp: (configuration?: Configuration) => {
/**
* Delete a reaction (like or recast) to a cast (In order to delete a reaction `signer_uuid` must be approved)
* @summary Delete reaction
* @param {ReactionReqBody} reactionReqBody
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<OperationResponse>} A promise that resolves to a `OperationResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-reaction)
*
*/
deleteReaction(reactionReqBody: ReactionReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<OperationResponse>>;
/**
* Fetches reactions for a given cast
* @summary Reactions for cast
* @param {string} hash
* @param {Array<FetchCastReactionsTypesEnum>} types Customize which reaction types the request should search for. This is a comma-separated string that can include the following values: \'likes\' and \'recasts\'. By default api returns both. To select multiple types, use a comma-separated list of these values.
* @param {number} [viewerFid] Providing this will return a list of reactions that respects this user\'s mutes and blocks and includes `viewer_context`.
* @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100)
* @param {string} [cursor] Pagination cursor.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<ReactionsCastResponse>} A promise that resolves to a `ReactionsCastResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-cast-reactions)
*
*/
fetchCastReactions(hash: string, types: Array<FetchCastReactionsTypesEnum>, viewerFid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ReactionsCastResponse>>;
/**
* Fetches reactions for a given user
* @summary Reactions for user
* @param {number} fid The unique identifier of a farcaster user or app (unsigned integer)
* @param {FetchUserReactionsTypeEnum} type Type of reaction to fetch (likes or recasts or all)
* @param {number} [viewerFid] Providing this will return a list of reactions that respects this user\'s mutes and blocks and includes `viewer_context`.
* @param {number} [limit] Number of results to fetch (Default: 25, Maximum: 100)
* @param {string} [cursor] Pagination cursor.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<ReactionsResponse>} A promise that resolves to a `ReactionsResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-reactions)
*
*/
fetchUserReactions(fid: number, type: FetchUserReactionsTypeEnum, viewerFid?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ReactionsResponse>>;
/**
* Post a reaction (like or recast) to a given cast (In order to post a reaction `signer_uuid` must be approved)
* @summary Post a reaction
* @param {ReactionReqBody} reactionReqBody
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<OperationResponse>} A promise that resolves to a `OperationResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-reaction)
*
*/
publishReaction(reactionReqBody: ReactionReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<OperationResponse>>;
};
/**
* ReactionApi - factory interface
* @export
*/
export declare const ReactionApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
/**
* Delete a reaction (like or recast) to a cast (In order to delete a reaction `signer_uuid` must be approved)
* @summary Delete reaction
* @param {ReactionApiDeleteReactionRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<OperationResponse>} A promise that resolves to a `OperationResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-reaction)
*
*/
deleteReaction(requestParameters: ReactionApiDeleteReactionRequest, options?: RawAxiosRequestConfig): AxiosPromise<OperationResponse>;
/**
* Fetches reactions for a given cast
* @summary Reactions for cast
* @param {ReactionApiFetchCastReactionsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<ReactionsCastResponse>} A promise that resolves to a `ReactionsCastResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-cast-reactions)
*
*/
fetchCastReactions(requestParameters: ReactionApiFetchCastReactionsRequest, options?: RawAxiosRequestConfig): AxiosPromise<ReactionsCastResponse>;
/**
* Fetches reactions for a given user
* @summary Reactions for user
* @param {ReactionApiFetchUserReactionsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<ReactionsResponse>} A promise that resolves to a `ReactionsResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-reactions)
*
*/
fetchUserReactions(requestParameters: ReactionApiFetchUserReactionsRequest, options?: RawAxiosRequestConfig): AxiosPromise<ReactionsResponse>;
/**
* Post a reaction (like or recast) to a given cast (In order to post a reaction `signer_uuid` must be approved)
* @summary Post a reaction
* @param {ReactionApiPublishReactionRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<OperationResponse>} A promise that resolves to a `OperationResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-reaction)
*
*/
publishReaction(requestParameters: ReactionApiPublishReactionRequest, options?: RawAxiosRequestConfig): AxiosPromise<OperationResponse>;
};
/**
* ReactionApi - interface
* @export
* @interface ReactionApi
*/
export interface ReactionApiInterface {
/**
* Delete a reaction (like or recast) to a cast (In order to delete a reaction `signer_uuid` must be approved)
* @summary Delete reaction
* @param {ReactionApiDeleteReactionRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ReactionApiInterface
* @returns {Promise<OperationResponse>} A promise that resolves to a `OperationResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-reaction)
*
*/
deleteReaction(requestParameters: ReactionApiDeleteReactionRequest, options?: RawAxiosRequestConfig): AxiosPromise<OperationResponse>;
/**
* Fetches reactions for a given cast
* @summary Reactions for cast
* @param {ReactionApiFetchCastReactionsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ReactionApiInterface
* @returns {Promise<ReactionsCastResponse>} A promise that resolves to a `ReactionsCastResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-cast-reactions)
*
*/
fetchCastReactions(requestParameters: ReactionApiFetchCastReactionsRequest, options?: RawAxiosRequestConfig): AxiosPromise<ReactionsCastResponse>;
/**
* Fetches reactions for a given user
* @summary Reactions for user
* @param {ReactionApiFetchUserReactionsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ReactionApiInterface
* @returns {Promise<ReactionsResponse>} A promise that resolves to a `ReactionsResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-reactions)
*
*/
fetchUserReactions(requestParameters: ReactionApiFetchUserReactionsRequest, options?: RawAxiosRequestConfig): AxiosPromise<ReactionsResponse>;
/**
* Post a reaction (like or recast) to a given cast (In order to post a reaction `signer_uuid` must be approved)
* @summary Post a reaction
* @param {ReactionApiPublishReactionRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ReactionApiInterface
* @returns {Promise<OperationResponse>} A promise that resolves to a `OperationResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-reaction)
*
*/
publishReaction(requestParameters: ReactionApiPublishReactionRequest, options?: RawAxiosRequestConfig): AxiosPromise<OperationResponse>;
}
/**
* Request parameters for deleteReaction operation in ReactionApi.
* @export
* @interface ReactionApiDeleteReactionRequest
*/
export interface ReactionApiDeleteReactionRequest {
/**
*
*
*
*
* @type {ReactionReqBody}
* @memberof ReactionApiDeleteReaction
*/
readonly reactionReqBody: ReactionReqBody;
}
/**
* Request parameters for fetchCastReactions operation in ReactionApi.
* @export
* @interface ReactionApiFetchCastReactionsRequest
*/
export interface ReactionApiFetchCastReactionsRequest {
/**
*
*
*
*
* @type {string}
* @memberof ReactionApiFetchCastReactions
*/
readonly hash: string;
/**
* Customize which reaction types the request should search for. This is a comma-separated string that can include the following values: \'likes\' and \'recasts\'. By default api returns both. To select multiple types, use a comma-separated list of these values.
*
*
*
* @type {Array<'all' | 'likes' | 'recasts'>}
* @memberof ReactionApiFetchCastReactions
*/
readonly types: Array<FetchCastReactionsTypesEnum>;
/**
* Providing this will return a list of reactions that respects this user\'s mutes and blocks and includes `viewer_context`.
*
*
*
* @type {number}
* @memberof ReactionApiFetchCastReactions
*/
readonly viewerFid?: number;
/**
* Number of results to fetch (Default: 25, Maximum: 100)
*
*
*
* @type {number}
* @memberof ReactionApiFetchCastReactions
*/
readonly limit?: number;
/**
* Pagination cursor.
*
*
*
* @type {string}
* @memberof ReactionApiFetchCastReactions
*/
readonly cursor?: string;
}
/**
* Request parameters for fetchUserReactions operation in ReactionApi.
* @export
* @interface ReactionApiFetchUserReactionsRequest
*/
export interface ReactionApiFetchUserReactionsRequest {
/**
* The unique identifier of a farcaster user or app (unsigned integer)
*
*
*
* @type {number}
* @memberof ReactionApiFetchUserReactions
*/
readonly fid: number;
/**
* Type of reaction to fetch (likes or recasts or all)
*
*
*
* @type {'all' | 'likes' | 'recasts'}
* @memberof ReactionApiFetchUserReactions
*/
readonly type: FetchUserReactionsTypeEnum;
/**
* Providing this will return a list of reactions that respects this user\'s mutes and blocks and includes `viewer_context`.
*
*
*
* @type {number}
* @memberof ReactionApiFetchUserReactions
*/
readonly viewerFid?: number;
/**
* Number of results to fetch (Default: 25, Maximum: 100)
*
*
*
* @type {number}
* @memberof ReactionApiFetchUserReactions
*/
readonly limit?: number;
/**
* Pagination cursor.
*
*
*
* @type {string}
* @memberof ReactionApiFetchUserReactions
*/
readonly cursor?: string;
}
/**
* Request parameters for publishReaction operation in ReactionApi.
* @export
* @interface ReactionApiPublishReactionRequest
*/
export interface ReactionApiPublishReactionRequest {
/**
*
*
*
*
* @type {ReactionReqBody}
* @memberof ReactionApiPublishReaction
*/
readonly reactionReqBody: ReactionReqBody;
}
/**
* ReactionApi - object-oriented interface
* @export
* @class ReactionApi
* @extends {BaseAPI}
*/
export declare class ReactionApi extends BaseAPI implements ReactionApiInterface {
/**
* Delete a reaction (like or recast) to a cast (In order to delete a reaction `signer_uuid` must be approved)
* @summary Delete reaction
* @param {ReactionApiDeleteReactionRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ReactionApi
* @returns {Promise<OperationResponse>} A promise that resolves to a `OperationResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-reaction)
*
*/
deleteReaction(requestParameters: ReactionApiDeleteReactionRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<OperationResponse, any, {}>>;
/**
* Fetches reactions for a given cast
* @summary Reactions for cast
* @param {ReactionApiFetchCastReactionsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ReactionApi
* @returns {Promise<ReactionsCastResponse>} A promise that resolves to a `ReactionsCastResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-cast-reactions)
*
*/
fetchCastReactions(requestParameters: ReactionApiFetchCastReactionsRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<ReactionsCastResponse, any, {}>>;
/**
* Fetches reactions for a given user
* @summary Reactions for user
* @param {ReactionApiFetchUserReactionsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ReactionApi
* @returns {Promise<ReactionsResponse>} A promise that resolves to a `ReactionsResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-reactions)
*
*/
fetchUserReactions(requestParameters: ReactionApiFetchUserReactionsRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<ReactionsResponse, any, {}>>;
/**
* Post a reaction (like or recast) to a given cast (In order to post a reaction `signer_uuid` must be approved)
* @summary Post a reaction
* @param {ReactionApiPublishReactionRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ReactionApi
* @returns {Promise<OperationResponse>} A promise that resolves to a `OperationResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-reaction)
*
*/
publishReaction(requestParameters: ReactionApiPublishReactionRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<OperationResponse, any, {}>>;
}
/**
* @export
*/
export declare const FetchCastReactionsTypesEnum: {
readonly All: "all";
readonly Likes: "likes";
readonly Recasts: "recasts";
};
export type FetchCastReactionsTypesEnum = typeof FetchCastReactionsTypesEnum[keyof typeof FetchCastReactionsTypesEnum];
/**
* @export
*/
export declare const FetchUserReactionsTypeEnum: {
readonly All: "all";
readonly Likes: "likes";
readonly Recasts: "recasts";
};
export type FetchUserReactionsTypeEnum = typeof FetchUserReactionsTypeEnum[keyof typeof FetchUserReactionsTypeEnum];