@standard-crypto/farcaster-js-neynar
Version:
A tool for interacting with Farcaster via Neynar APIs.
214 lines • 10.7 kB
JavaScript
/* tslint:disable */
/* eslint-disable */
/**
* v1 Farcaster
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* 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 globalAxios from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setSearchParams, toPathString, createRequestFunction } from '../common.js';
// @ts-ignore
import { BASE_PATH, BaseAPI } from '../base.js';
/**
* NotificationsApi - axios parameter creator
* @export
*/
export const NotificationsApiAxiosParamCreator = function (configuration) {
return {
/**
* Gets a list of mentions and replies to the user’s casts in reverse chronological order
* @summary Get mentions and replies
* @param {number} fid fid of a user
* @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information.
* @param {string} [cursor] Pagination cursor.
* @param {number} [limit] Number of results to retrieve (default 25, max 150)
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
mentionsAndReplies: async (fid, viewerFid, cursor, limit, options = {}) => {
// verify required parameter 'fid' is not null or undefined
assertParamExists('mentionsAndReplies', 'fid', fid);
const localVarPath = `/farcaster/mentions-and-replies`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKeyAuth required
await setApiKeyToObject(localVarHeaderParameter, "api_key", configuration);
if (fid !== undefined) {
localVarQueryParameter['fid'] = fid;
}
if (viewerFid !== undefined) {
localVarQueryParameter['viewerFid'] = viewerFid;
}
if (cursor !== undefined) {
localVarQueryParameter['cursor'] = cursor;
}
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Get a list of reactions and recasts to the users’s casts in reverse chronological order
* @summary Get reactions and recasts
* @param {number} fid fid of a user
* @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information.
* @param {string} [cursor] Pagination cursor.
* @param {number} [limit] Number of results to retrieve (default 25, max 150)
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
reactionsAndRecasts: async (fid, viewerFid, cursor, limit, options = {}) => {
// verify required parameter 'fid' is not null or undefined
assertParamExists('reactionsAndRecasts', 'fid', fid);
const localVarPath = `/farcaster/reactions-and-recasts`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKeyAuth required
await setApiKeyToObject(localVarHeaderParameter, "api_key", configuration);
if (fid !== undefined) {
localVarQueryParameter['fid'] = fid;
}
if (viewerFid !== undefined) {
localVarQueryParameter['viewerFid'] = viewerFid;
}
if (cursor !== undefined) {
localVarQueryParameter['cursor'] = cursor;
}
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};
/**
* NotificationsApi - functional programming interface
* @export
*/
export const NotificationsApiFp = function (configuration) {
const localVarAxiosParamCreator = NotificationsApiAxiosParamCreator(configuration);
return {
/**
* Gets a list of mentions and replies to the user’s casts in reverse chronological order
* @summary Get mentions and replies
* @param {number} fid fid of a user
* @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information.
* @param {string} [cursor] Pagination cursor.
* @param {number} [limit] Number of results to retrieve (default 25, max 150)
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async mentionsAndReplies(fid, viewerFid, cursor, limit, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.mentionsAndReplies(fid, viewerFid, cursor, limit, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Get a list of reactions and recasts to the users’s casts in reverse chronological order
* @summary Get reactions and recasts
* @param {number} fid fid of a user
* @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information.
* @param {string} [cursor] Pagination cursor.
* @param {number} [limit] Number of results to retrieve (default 25, max 150)
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async reactionsAndRecasts(fid, viewerFid, cursor, limit, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.reactionsAndRecasts(fid, viewerFid, cursor, limit, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
};
};
/**
* NotificationsApi - factory interface
* @export
*/
export const NotificationsApiFactory = function (configuration, basePath, axios) {
const localVarFp = NotificationsApiFp(configuration);
return {
/**
* Gets a list of mentions and replies to the user’s casts in reverse chronological order
* @summary Get mentions and replies
* @param {NotificationsApiMentionsAndRepliesRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
mentionsAndReplies(requestParameters, options) {
return localVarFp.mentionsAndReplies(requestParameters.fid, requestParameters.viewerFid, requestParameters.cursor, requestParameters.limit, options).then((request) => request(axios, basePath));
},
/**
* Get a list of reactions and recasts to the users’s casts in reverse chronological order
* @summary Get reactions and recasts
* @param {NotificationsApiReactionsAndRecastsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
reactionsAndRecasts(requestParameters, options) {
return localVarFp.reactionsAndRecasts(requestParameters.fid, requestParameters.viewerFid, requestParameters.cursor, requestParameters.limit, options).then((request) => request(axios, basePath));
},
};
};
/**
* NotificationsApi - object-oriented interface
* @export
* @class NotificationsApi
* @extends {BaseAPI}
*/
export class NotificationsApi extends BaseAPI {
/**
* Gets a list of mentions and replies to the user’s casts in reverse chronological order
* @summary Get mentions and replies
* @param {NotificationsApiMentionsAndRepliesRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof NotificationsApi
*/
mentionsAndReplies(requestParameters, options) {
return NotificationsApiFp(this.configuration).mentionsAndReplies(requestParameters.fid, requestParameters.viewerFid, requestParameters.cursor, requestParameters.limit, options).then((request) => request(this.axios, this.basePath));
}
/**
* Get a list of reactions and recasts to the users’s casts in reverse chronological order
* @summary Get reactions and recasts
* @param {NotificationsApiReactionsAndRecastsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof NotificationsApi
*/
reactionsAndRecasts(requestParameters, options) {
return NotificationsApiFp(this.configuration).reactionsAndRecasts(requestParameters.fid, requestParameters.viewerFid, requestParameters.cursor, requestParameters.limit, options).then((request) => request(this.axios, this.basePath));
}
}
//# sourceMappingURL=notifications-api.js.map