UNPKG

@neynar/nodejs-sdk

Version:

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

279 lines (278 loc) 13.7 kB
/** * Farcaster API V2 * The Farcaster API allows you to interact with the Farcaster protocol. See the [Neynar docs](https://docs.neynar.com/reference) for more details. * * The version of the OpenAPI document: 2.46.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 { AppHostEventType } from '../models'; import type { AppHostGetEventResponse } from '../models'; import type { AppHostPostEventBody } from '../models'; import type { AppHostPostEventResponse } from '../models'; import type { AppHostUserStateResponse } from '../models'; /** * AppHostApi - axios parameter creator * @export */ export declare const AppHostApiAxiosParamCreator: (configuration?: Configuration) => { /** * Returns event object for app host events. Used if the app host intends to sign the event message instead of using Neynar-hosted signers. * @summary Get app host event * @param {string} appDomain The domain of the mini app * @param {number} fid The FID of the user who initiated the event * @param {AppHostEventType} event The type of event * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<AppHostGetEventResponse>} A promise that resolves to a `AppHostGetEventResponse` object * */ appHostGetEvent: (appDomain: string, fid: number, event: AppHostEventType, options?: RawAxiosRequestConfig) => Promise<RequestArgs>; /** * Returns the current notification state for a specific user across all mini app domains in this app host. Shows which domains have notifications enabled. * @summary Get the user\'s notification subscriptions * @param {number} fid The FID of the user * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<AppHostUserStateResponse>} A promise that resolves to a `AppHostUserStateResponse` object * */ appHostGetUserState: (fid: number, options?: RawAxiosRequestConfig) => Promise<RequestArgs>; /** * Post an app_host event to the domain\'s webhook. Events such as enabling or disabling notifications for a user. Provide either a signed message or the signer UUID of an authorized neynar-hosted signers. * @summary Process app host event * @param {AppHostPostEventBody} appHostPostEventBody * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<AppHostPostEventResponse>} A promise that resolves to a `AppHostPostEventResponse` object * */ appHostPostEvent: (appHostPostEventBody: AppHostPostEventBody, options?: RawAxiosRequestConfig) => Promise<RequestArgs>; }; /** * AppHostApi - functional programming interface * @export */ export declare const AppHostApiFp: (configuration?: Configuration) => { /** * Returns event object for app host events. Used if the app host intends to sign the event message instead of using Neynar-hosted signers. * @summary Get app host event * @param {string} appDomain The domain of the mini app * @param {number} fid The FID of the user who initiated the event * @param {AppHostEventType} event The type of event * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<AppHostGetEventResponse>} A promise that resolves to a `AppHostGetEventResponse` object * */ appHostGetEvent(appDomain: string, fid: number, event: AppHostEventType, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AppHostGetEventResponse>>; /** * Returns the current notification state for a specific user across all mini app domains in this app host. Shows which domains have notifications enabled. * @summary Get the user\'s notification subscriptions * @param {number} fid The FID of the user * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<AppHostUserStateResponse>} A promise that resolves to a `AppHostUserStateResponse` object * */ appHostGetUserState(fid: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AppHostUserStateResponse>>; /** * Post an app_host event to the domain\'s webhook. Events such as enabling or disabling notifications for a user. Provide either a signed message or the signer UUID of an authorized neynar-hosted signers. * @summary Process app host event * @param {AppHostPostEventBody} appHostPostEventBody * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<AppHostPostEventResponse>} A promise that resolves to a `AppHostPostEventResponse` object * */ appHostPostEvent(appHostPostEventBody: AppHostPostEventBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AppHostPostEventResponse>>; }; /** * AppHostApi - factory interface * @export */ export declare const AppHostApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => { /** * Returns event object for app host events. Used if the app host intends to sign the event message instead of using Neynar-hosted signers. * @summary Get app host event * @param {AppHostApiAppHostGetEventRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<AppHostGetEventResponse>} A promise that resolves to a `AppHostGetEventResponse` object * */ appHostGetEvent(requestParameters: AppHostApiAppHostGetEventRequest, options?: RawAxiosRequestConfig): AxiosPromise<AppHostGetEventResponse>; /** * Returns the current notification state for a specific user across all mini app domains in this app host. Shows which domains have notifications enabled. * @summary Get the user\'s notification subscriptions * @param {AppHostApiAppHostGetUserStateRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<AppHostUserStateResponse>} A promise that resolves to a `AppHostUserStateResponse` object * */ appHostGetUserState(requestParameters: AppHostApiAppHostGetUserStateRequest, options?: RawAxiosRequestConfig): AxiosPromise<AppHostUserStateResponse>; /** * Post an app_host event to the domain\'s webhook. Events such as enabling or disabling notifications for a user. Provide either a signed message or the signer UUID of an authorized neynar-hosted signers. * @summary Process app host event * @param {AppHostApiAppHostPostEventRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<AppHostPostEventResponse>} A promise that resolves to a `AppHostPostEventResponse` object * */ appHostPostEvent(requestParameters: AppHostApiAppHostPostEventRequest, options?: RawAxiosRequestConfig): AxiosPromise<AppHostPostEventResponse>; }; /** * AppHostApi - interface * @export * @interface AppHostApi */ export interface AppHostApiInterface { /** * Returns event object for app host events. Used if the app host intends to sign the event message instead of using Neynar-hosted signers. * @summary Get app host event * @param {AppHostApiAppHostGetEventRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AppHostApiInterface * @returns {Promise<AppHostGetEventResponse>} A promise that resolves to a `AppHostGetEventResponse` object * */ appHostGetEvent(requestParameters: AppHostApiAppHostGetEventRequest, options?: RawAxiosRequestConfig): AxiosPromise<AppHostGetEventResponse>; /** * Returns the current notification state for a specific user across all mini app domains in this app host. Shows which domains have notifications enabled. * @summary Get the user\'s notification subscriptions * @param {AppHostApiAppHostGetUserStateRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AppHostApiInterface * @returns {Promise<AppHostUserStateResponse>} A promise that resolves to a `AppHostUserStateResponse` object * */ appHostGetUserState(requestParameters: AppHostApiAppHostGetUserStateRequest, options?: RawAxiosRequestConfig): AxiosPromise<AppHostUserStateResponse>; /** * Post an app_host event to the domain\'s webhook. Events such as enabling or disabling notifications for a user. Provide either a signed message or the signer UUID of an authorized neynar-hosted signers. * @summary Process app host event * @param {AppHostApiAppHostPostEventRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AppHostApiInterface * @returns {Promise<AppHostPostEventResponse>} A promise that resolves to a `AppHostPostEventResponse` object * */ appHostPostEvent(requestParameters: AppHostApiAppHostPostEventRequest, options?: RawAxiosRequestConfig): AxiosPromise<AppHostPostEventResponse>; } /** * Request parameters for appHostGetEvent operation in AppHostApi. * @export * @interface AppHostApiAppHostGetEventRequest */ export interface AppHostApiAppHostGetEventRequest { /** * The domain of the mini app * * * * @type {string} * @memberof AppHostApiAppHostGetEvent */ readonly appDomain: string; /** * The FID of the user who initiated the event * * * * @type {number} * @memberof AppHostApiAppHostGetEvent */ readonly fid: number; /** * The type of event * * * * @type {AppHostEventType} * @memberof AppHostApiAppHostGetEvent */ readonly event: AppHostEventType; } /** * Request parameters for appHostGetUserState operation in AppHostApi. * @export * @interface AppHostApiAppHostGetUserStateRequest */ export interface AppHostApiAppHostGetUserStateRequest { /** * The FID of the user * * * * @type {number} * @memberof AppHostApiAppHostGetUserState */ readonly fid: number; } /** * Request parameters for appHostPostEvent operation in AppHostApi. * @export * @interface AppHostApiAppHostPostEventRequest */ export interface AppHostApiAppHostPostEventRequest { /** * * * * * @type {AppHostPostEventBody} * @memberof AppHostApiAppHostPostEvent */ readonly appHostPostEventBody: AppHostPostEventBody; } /** * AppHostApi - object-oriented interface * @export * @class AppHostApi * @extends {BaseAPI} */ export declare class AppHostApi extends BaseAPI implements AppHostApiInterface { /** * Returns event object for app host events. Used if the app host intends to sign the event message instead of using Neynar-hosted signers. * @summary Get app host event * @param {AppHostApiAppHostGetEventRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AppHostApi * @returns {Promise<AppHostGetEventResponse>} A promise that resolves to a `AppHostGetEventResponse` object * */ appHostGetEvent(requestParameters: AppHostApiAppHostGetEventRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<AppHostGetEventResponse, any>>; /** * Returns the current notification state for a specific user across all mini app domains in this app host. Shows which domains have notifications enabled. * @summary Get the user\'s notification subscriptions * @param {AppHostApiAppHostGetUserStateRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AppHostApi * @returns {Promise<AppHostUserStateResponse>} A promise that resolves to a `AppHostUserStateResponse` object * */ appHostGetUserState(requestParameters: AppHostApiAppHostGetUserStateRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<AppHostUserStateResponse, any>>; /** * Post an app_host event to the domain\'s webhook. Events such as enabling or disabling notifications for a user. Provide either a signed message or the signer UUID of an authorized neynar-hosted signers. * @summary Process app host event * @param {AppHostApiAppHostPostEventRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AppHostApi * @returns {Promise<AppHostPostEventResponse>} A promise that resolves to a `AppHostPostEventResponse` object * */ appHostPostEvent(requestParameters: AppHostApiAppHostPostEventRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<AppHostPostEventResponse, any>>; }