@standard-crypto/farcaster-js-neynar
Version:
A tool for interacting with Farcaster via Neynar APIs.
304 lines • 15.8 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.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReactionsApi = exports.ReactionsApiFactory = exports.ReactionsApiFp = exports.ReactionsApiAxiosParamCreator = void 0;
const axios_1 = __importDefault(require("axios"));
// Some imports not used depending on template conditions
// @ts-ignore
const common_js_1 = require("../common.js");
// @ts-ignore
const base_js_1 = require("../base.js");
/**
* ReactionsApi - axios parameter creator
* @export
*/
const ReactionsApiAxiosParamCreator = function (configuration) {
return {
/**
* Get all like reactions for a specific cast in reverse chronological order.
* @summary Get all like reactions for a specific cast
* @param {string} castHash Cast hash
* @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}
*/
castLikes: async (castHash, viewerFid, cursor, limit, options = {}) => {
// verify required parameter 'castHash' is not null or undefined
(0, common_js_1.assertParamExists)('castLikes', 'castHash', castHash);
const localVarPath = `/farcaster/cast-likes`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_js_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKeyAuth required
await (0, common_js_1.setApiKeyToObject)(localVarHeaderParameter, "api_key", configuration);
if (castHash !== undefined) {
localVarQueryParameter['castHash'] = castHash;
}
if (viewerFid !== undefined) {
localVarQueryParameter['viewerFid'] = viewerFid;
}
if (cursor !== undefined) {
localVarQueryParameter['cursor'] = cursor;
}
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
(0, common_js_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_js_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Get all reactions (likes and recasts) for a specific cast.
* @summary Get all reactions for a specific cast
* @param {string} castHash Cast hash
* @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}
*/
castReactions: async (castHash, viewerFid, cursor, limit, options = {}) => {
// verify required parameter 'castHash' is not null or undefined
(0, common_js_1.assertParamExists)('castReactions', 'castHash', castHash);
const localVarPath = `/farcaster/cast-reactions`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_js_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKeyAuth required
await (0, common_js_1.setApiKeyToObject)(localVarHeaderParameter, "api_key", configuration);
if (castHash !== undefined) {
localVarQueryParameter['castHash'] = castHash;
}
if (viewerFid !== undefined) {
localVarQueryParameter['viewerFid'] = viewerFid;
}
if (cursor !== undefined) {
localVarQueryParameter['cursor'] = cursor;
}
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
(0, common_js_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_js_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Get all recasters for a specific cast.
* @summary Get all recasters for a specific cast
* @param {string} castHash Cast hash
* @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}
*/
castRecasters: async (castHash, viewerFid, cursor, limit, options = {}) => {
// verify required parameter 'castHash' is not null or undefined
(0, common_js_1.assertParamExists)('castRecasters', 'castHash', castHash);
const localVarPath = `/farcaster/cast-recasters`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_js_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKeyAuth required
await (0, common_js_1.setApiKeyToObject)(localVarHeaderParameter, "api_key", configuration);
if (castHash !== undefined) {
localVarQueryParameter['castHash'] = castHash;
}
if (viewerFid !== undefined) {
localVarQueryParameter['viewerFid'] = viewerFid;
}
if (cursor !== undefined) {
localVarQueryParameter['cursor'] = cursor;
}
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
(0, common_js_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_js_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};
exports.ReactionsApiAxiosParamCreator = ReactionsApiAxiosParamCreator;
/**
* ReactionsApi - functional programming interface
* @export
*/
const ReactionsApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.ReactionsApiAxiosParamCreator)(configuration);
return {
/**
* Get all like reactions for a specific cast in reverse chronological order.
* @summary Get all like reactions for a specific cast
* @param {string} castHash Cast hash
* @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 castLikes(castHash, viewerFid, cursor, limit, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.castLikes(castHash, viewerFid, cursor, limit, options);
return (0, common_js_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_js_1.BASE_PATH, configuration);
},
/**
* Get all reactions (likes and recasts) for a specific cast.
* @summary Get all reactions for a specific cast
* @param {string} castHash Cast hash
* @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 castReactions(castHash, viewerFid, cursor, limit, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.castReactions(castHash, viewerFid, cursor, limit, options);
return (0, common_js_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_js_1.BASE_PATH, configuration);
},
/**
* Get all recasters for a specific cast.
* @summary Get all recasters for a specific cast
* @param {string} castHash Cast hash
* @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 castRecasters(castHash, viewerFid, cursor, limit, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.castRecasters(castHash, viewerFid, cursor, limit, options);
return (0, common_js_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_js_1.BASE_PATH, configuration);
},
};
};
exports.ReactionsApiFp = ReactionsApiFp;
/**
* ReactionsApi - factory interface
* @export
*/
const ReactionsApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.ReactionsApiFp)(configuration);
return {
/**
* Get all like reactions for a specific cast in reverse chronological order.
* @summary Get all like reactions for a specific cast
* @param {ReactionsApiCastLikesRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
castLikes(requestParameters, options) {
return localVarFp.castLikes(requestParameters.castHash, requestParameters.viewerFid, requestParameters.cursor, requestParameters.limit, options).then((request) => request(axios, basePath));
},
/**
* Get all reactions (likes and recasts) for a specific cast.
* @summary Get all reactions for a specific cast
* @param {ReactionsApiCastReactionsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
castReactions(requestParameters, options) {
return localVarFp.castReactions(requestParameters.castHash, requestParameters.viewerFid, requestParameters.cursor, requestParameters.limit, options).then((request) => request(axios, basePath));
},
/**
* Get all recasters for a specific cast.
* @summary Get all recasters for a specific cast
* @param {ReactionsApiCastRecastersRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
castRecasters(requestParameters, options) {
return localVarFp.castRecasters(requestParameters.castHash, requestParameters.viewerFid, requestParameters.cursor, requestParameters.limit, options).then((request) => request(axios, basePath));
},
};
};
exports.ReactionsApiFactory = ReactionsApiFactory;
/**
* ReactionsApi - object-oriented interface
* @export
* @class ReactionsApi
* @extends {BaseAPI}
*/
class ReactionsApi extends base_js_1.BaseAPI {
/**
* Get all like reactions for a specific cast in reverse chronological order.
* @summary Get all like reactions for a specific cast
* @param {ReactionsApiCastLikesRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ReactionsApi
*/
castLikes(requestParameters, options) {
return (0, exports.ReactionsApiFp)(this.configuration).castLikes(requestParameters.castHash, requestParameters.viewerFid, requestParameters.cursor, requestParameters.limit, options).then((request) => request(this.axios, this.basePath));
}
/**
* Get all reactions (likes and recasts) for a specific cast.
* @summary Get all reactions for a specific cast
* @param {ReactionsApiCastReactionsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ReactionsApi
*/
castReactions(requestParameters, options) {
return (0, exports.ReactionsApiFp)(this.configuration).castReactions(requestParameters.castHash, requestParameters.viewerFid, requestParameters.cursor, requestParameters.limit, options).then((request) => request(this.axios, this.basePath));
}
/**
* Get all recasters for a specific cast.
* @summary Get all recasters for a specific cast
* @param {ReactionsApiCastRecastersRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ReactionsApi
*/
castRecasters(requestParameters, options) {
return (0, exports.ReactionsApiFp)(this.configuration).castRecasters(requestParameters.castHash, requestParameters.viewerFid, requestParameters.cursor, requestParameters.limit, options).then((request) => request(this.axios, this.basePath));
}
}
exports.ReactionsApi = ReactionsApi;
//# sourceMappingURL=reactions-api.js.map