@neynar/nodejs-sdk
Version:
SDK to interact with Neynar APIs (https://docs.neynar.com/reference/quickstart)
318 lines (317 loc) • 15.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.34.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 { AppHostGetEventResponse } from '../models';
import type { AppHostPostEventReqBody } 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 Generate event
* @param {string} appDomain The domain of the mini app
* @param {number} fid The FID of the user who initiated the event
* @param {AppHostGetEventEventEnum} event The type of event
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<AppHostGetEventResponse>} A promise that resolves to a `AppHostGetEventResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/app-host-get-event)
*
*/
appHostGetEvent: (appDomain: string, fid: number, event: AppHostGetEventEventEnum, 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 Enabled notifications
* @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
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/app-host-get-user-state)
*
*/
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 Send event
* @param {AppHostPostEventReqBody} appHostPostEventReqBody
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<AppHostPostEventResponse>} A promise that resolves to a `AppHostPostEventResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/app-host-post-event)
*
*/
appHostPostEvent: (appHostPostEventReqBody: AppHostPostEventReqBody, 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 Generate event
* @param {string} appDomain The domain of the mini app
* @param {number} fid The FID of the user who initiated the event
* @param {AppHostGetEventEventEnum} event The type of event
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<AppHostGetEventResponse>} A promise that resolves to a `AppHostGetEventResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/app-host-get-event)
*
*/
appHostGetEvent(appDomain: string, fid: number, event: AppHostGetEventEventEnum, 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 Enabled notifications
* @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
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/app-host-get-user-state)
*
*/
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 Send event
* @param {AppHostPostEventReqBody} appHostPostEventReqBody
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<AppHostPostEventResponse>} A promise that resolves to a `AppHostPostEventResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/app-host-post-event)
*
*/
appHostPostEvent(appHostPostEventReqBody: AppHostPostEventReqBody, 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 Generate 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
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/app-host-get-event)
*
*/
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 Enabled notifications
* @param {AppHostApiAppHostGetUserStateRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<AppHostUserStateResponse>} A promise that resolves to a `AppHostUserStateResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/app-host-get-user-state)
*
*/
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 Send 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
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/app-host-post-event)
*
*/
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 Generate 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
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/app-host-get-event)
*
*/
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 Enabled notifications
* @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
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/app-host-get-user-state)
*
*/
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 Send 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
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/app-host-post-event)
*
*/
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 {'frame_added' | 'frame_removed' | 'notifications_enabled' | 'notifications_disabled'}
* @memberof AppHostApiAppHostGetEvent
*/
readonly event: AppHostGetEventEventEnum;
}
/**
* 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 {AppHostPostEventReqBody}
* @memberof AppHostApiAppHostPostEvent
*/
readonly appHostPostEventReqBody: AppHostPostEventReqBody;
}
/**
* 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 Generate 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
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/app-host-get-event)
*
*/
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 Enabled notifications
* @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
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/app-host-get-user-state)
*
*/
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 Send 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
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/app-host-post-event)
*
*/
appHostPostEvent(requestParameters: AppHostApiAppHostPostEventRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<AppHostPostEventResponse, any>>;
}
/**
* @export
*/
export declare const AppHostGetEventEventEnum: {
readonly FrameAdded: "frame_added";
readonly FrameRemoved: "frame_removed";
readonly NotificationsEnabled: "notifications_enabled";
readonly NotificationsDisabled: "notifications_disabled";
};
export type AppHostGetEventEventEnum = typeof AppHostGetEventEventEnum[keyof typeof AppHostGetEventEventEnum];