@neynar/nodejs-sdk
Version:
SDK to interact with Neynar APIs (https://docs.neynar.com/reference/quickstart)
485 lines (484 loc) • 32.3 kB
JavaScript
;
/* tslint:disable */
/* eslint-disable */
/**
* 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.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.FetchAllNotificationsTypeEnum = exports.NotificationsApi = exports.NotificationsApiFactory = exports.NotificationsApiFp = exports.NotificationsApiAxiosParamCreator = void 0;
const axios_1 = __importDefault(require("axios"));
// Some imports not used depending on template conditions
// @ts-ignore
const common_1 = require("../common");
// @ts-ignore
const base_1 = require("../base");
/**
* NotificationsApi - axios parameter creator
* @export
*/
const NotificationsApiAxiosParamCreator = function (configuration) {
return {
/**
* Returns a list of notifications for a specific FID.
* @summary For user
* @param {number} fid FID of the user you you want to fetch notifications for. The response will respect this user\'s mutes and blocks.
* @param {boolean} [xNeynarExperimental] Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details.
* @param {Array<FetchAllNotificationsTypeEnum>} [type] Notification type to fetch. Comma separated values of follows, recasts, likes, mentions, replies.
* @param {number} [limit] Number of results to fetch (Default: 15, Maximum: 25)
* @param {string} [cursor] Pagination cursor.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<NotificationsResponse>} A promise that resolves to a `NotificationsResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-all-notifications)
*
*/
fetchAllNotifications: async (fid, xNeynarExperimental, type, limit, cursor, options = {}) => {
// verify required parameter 'fid' is not null or undefined
(0, common_1.assertParamExists)('fetchAllNotifications', 'fid', fid);
const localVarPath = `/v2/farcaster/notifications/`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKeyAuth required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration);
if (fid !== undefined) {
localVarQueryParameter['fid'] = fid;
}
if (type) {
localVarQueryParameter['type'] = type;
}
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
if (cursor !== undefined) {
localVarQueryParameter['cursor'] = cursor;
}
if (xNeynarExperimental != null) {
localVarHeaderParameter['x-neynar-experimental'] = typeof xNeynarExperimental === 'string'
? xNeynarExperimental
: JSON.stringify(xNeynarExperimental);
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Returns a list of notifications for a user in specific channels
* @summary For user by channel
* @param {number} fid FID of the user you you want to fetch notifications for. The response will respect this user\'s mutes and blocks.
* @param {string} channelIds Comma separated channel_ids (find list of all channels here - https://docs.neynar.com/reference/list-all-channels)
* @param {boolean} [xNeynarExperimental] Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details.
* @param {number} [limit] Number of results to fetch (Default: 15, Maximum: 25)
* @param {string} [cursor] Pagination cursor.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<NotificationsResponse>} A promise that resolves to a `NotificationsResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-channel-notifications-for-user)
*
*/
fetchChannelNotificationsForUser: async (fid, channelIds, xNeynarExperimental, limit, cursor, options = {}) => {
// verify required parameter 'fid' is not null or undefined
(0, common_1.assertParamExists)('fetchChannelNotificationsForUser', 'fid', fid);
// verify required parameter 'channelIds' is not null or undefined
(0, common_1.assertParamExists)('fetchChannelNotificationsForUser', 'channelIds', channelIds);
const localVarPath = `/v2/farcaster/notifications/channel/`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKeyAuth required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration);
if (fid !== undefined) {
localVarQueryParameter['fid'] = fid;
}
if (channelIds !== undefined) {
localVarQueryParameter['channel_ids'] = channelIds;
}
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
if (cursor !== undefined) {
localVarQueryParameter['cursor'] = cursor;
}
if (xNeynarExperimental != null) {
localVarHeaderParameter['x-neynar-experimental'] = typeof xNeynarExperimental === 'string'
? xNeynarExperimental
: JSON.stringify(xNeynarExperimental);
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Returns a list of notifications for a user in specific parent_urls
* @summary For user by parent_urls
* @param {number} fid FID of the user you you want to fetch notifications for. The response will respect this user\'s mutes and blocks.
* @param {string} parentUrls Comma separated parent_urls
* @param {boolean} [xNeynarExperimental] Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details.
* @param {number} [limit] Number of results to fetch (Default: 15, Maximum: 25)
* @param {string} [cursor] Pagination cursor.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<NotificationsResponse>} A promise that resolves to a `NotificationsResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-notifications-by-parent-url-for-user)
*
*/
fetchNotificationsByParentUrlForUser: async (fid, parentUrls, xNeynarExperimental, limit, cursor, options = {}) => {
// verify required parameter 'fid' is not null or undefined
(0, common_1.assertParamExists)('fetchNotificationsByParentUrlForUser', 'fid', fid);
// verify required parameter 'parentUrls' is not null or undefined
(0, common_1.assertParamExists)('fetchNotificationsByParentUrlForUser', 'parentUrls', parentUrls);
const localVarPath = `/v2/farcaster/notifications/parent_url/`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKeyAuth required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration);
if (fid !== undefined) {
localVarQueryParameter['fid'] = fid;
}
if (parentUrls !== undefined) {
localVarQueryParameter['parent_urls'] = parentUrls;
}
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
if (cursor !== undefined) {
localVarQueryParameter['cursor'] = cursor;
}
if (xNeynarExperimental != null) {
localVarHeaderParameter['x-neynar-experimental'] = typeof xNeynarExperimental === 'string'
? xNeynarExperimental
: JSON.stringify(xNeynarExperimental);
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Mark notifications as seen. You can choose one of two authorization methods, either: 1. Provide a valid signer_uuid in the request body (Most common) 2. Provide a valid, signed \"Bearer\" token in the request\'s `Authorization` header similar to the approach described [here](https://docs.farcaster.xyz/reference/warpcast/api#authentication)
* @summary Mark as seen
* @param {MarkNotificationsAsSeenReqBody} markNotificationsAsSeenReqBody
* @param {string} [authorization] Optional Bearer token for certain endpoints. The token format is described [here](https://docs.farcaster.xyz/reference/warpcast/api#authentication).
* @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/mark-notifications-as-seen)
*
*/
markNotificationsAsSeen: async (markNotificationsAsSeenReqBody, authorization, options = {}) => {
// verify required parameter 'markNotificationsAsSeenReqBody' is not null or undefined
(0, common_1.assertParamExists)('markNotificationsAsSeen', 'markNotificationsAsSeenReqBody', markNotificationsAsSeenReqBody);
const localVarPath = `/v2/farcaster/notifications/seen/`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKeyAuth required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration);
if (authorization != null) {
localVarHeaderParameter['Authorization'] = String(authorization);
}
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(markNotificationsAsSeenReqBody, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};
exports.NotificationsApiAxiosParamCreator = NotificationsApiAxiosParamCreator;
/**
* NotificationsApi - functional programming interface
* @export
*/
const NotificationsApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.NotificationsApiAxiosParamCreator)(configuration);
return {
/**
* Returns a list of notifications for a specific FID.
* @summary For user
* @param {number} fid FID of the user you you want to fetch notifications for. The response will respect this user\'s mutes and blocks.
* @param {boolean} [xNeynarExperimental] Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details.
* @param {Array<FetchAllNotificationsTypeEnum>} [type] Notification type to fetch. Comma separated values of follows, recasts, likes, mentions, replies.
* @param {number} [limit] Number of results to fetch (Default: 15, Maximum: 25)
* @param {string} [cursor] Pagination cursor.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<NotificationsResponse>} A promise that resolves to a `NotificationsResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-all-notifications)
*
*/
async fetchAllNotifications(fid, xNeynarExperimental, type, limit, cursor, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.fetchAllNotifications(fid, xNeynarExperimental, type, limit, cursor, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['NotificationsApi.fetchAllNotifications']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Returns a list of notifications for a user in specific channels
* @summary For user by channel
* @param {number} fid FID of the user you you want to fetch notifications for. The response will respect this user\'s mutes and blocks.
* @param {string} channelIds Comma separated channel_ids (find list of all channels here - https://docs.neynar.com/reference/list-all-channels)
* @param {boolean} [xNeynarExperimental] Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details.
* @param {number} [limit] Number of results to fetch (Default: 15, Maximum: 25)
* @param {string} [cursor] Pagination cursor.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<NotificationsResponse>} A promise that resolves to a `NotificationsResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-channel-notifications-for-user)
*
*/
async fetchChannelNotificationsForUser(fid, channelIds, xNeynarExperimental, limit, cursor, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.fetchChannelNotificationsForUser(fid, channelIds, xNeynarExperimental, limit, cursor, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['NotificationsApi.fetchChannelNotificationsForUser']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Returns a list of notifications for a user in specific parent_urls
* @summary For user by parent_urls
* @param {number} fid FID of the user you you want to fetch notifications for. The response will respect this user\'s mutes and blocks.
* @param {string} parentUrls Comma separated parent_urls
* @param {boolean} [xNeynarExperimental] Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details.
* @param {number} [limit] Number of results to fetch (Default: 15, Maximum: 25)
* @param {string} [cursor] Pagination cursor.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<NotificationsResponse>} A promise that resolves to a `NotificationsResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-notifications-by-parent-url-for-user)
*
*/
async fetchNotificationsByParentUrlForUser(fid, parentUrls, xNeynarExperimental, limit, cursor, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.fetchNotificationsByParentUrlForUser(fid, parentUrls, xNeynarExperimental, limit, cursor, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['NotificationsApi.fetchNotificationsByParentUrlForUser']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Mark notifications as seen. You can choose one of two authorization methods, either: 1. Provide a valid signer_uuid in the request body (Most common) 2. Provide a valid, signed \"Bearer\" token in the request\'s `Authorization` header similar to the approach described [here](https://docs.farcaster.xyz/reference/warpcast/api#authentication)
* @summary Mark as seen
* @param {MarkNotificationsAsSeenReqBody} markNotificationsAsSeenReqBody
* @param {string} [authorization] Optional Bearer token for certain endpoints. The token format is described [here](https://docs.farcaster.xyz/reference/warpcast/api#authentication).
* @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/mark-notifications-as-seen)
*
*/
async markNotificationsAsSeen(markNotificationsAsSeenReqBody, authorization, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.markNotificationsAsSeen(markNotificationsAsSeenReqBody, authorization, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['NotificationsApi.markNotificationsAsSeen']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
};
};
exports.NotificationsApiFp = NotificationsApiFp;
/**
* NotificationsApi - factory interface
* @export
*/
const NotificationsApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.NotificationsApiFp)(configuration);
return {
/**
* Returns a list of notifications for a specific FID.
* @summary For user
* @param {NotificationsApiFetchAllNotificationsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<NotificationsResponse>} A promise that resolves to a `NotificationsResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-all-notifications)
*
*/
fetchAllNotifications(requestParameters, options) {
return localVarFp.fetchAllNotifications(requestParameters.fid, requestParameters.xNeynarExperimental, requestParameters.type, requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath));
},
/**
* Returns a list of notifications for a user in specific channels
* @summary For user by channel
* @param {NotificationsApiFetchChannelNotificationsForUserRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<NotificationsResponse>} A promise that resolves to a `NotificationsResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-channel-notifications-for-user)
*
*/
fetchChannelNotificationsForUser(requestParameters, options) {
return localVarFp.fetchChannelNotificationsForUser(requestParameters.fid, requestParameters.channelIds, requestParameters.xNeynarExperimental, requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath));
},
/**
* Returns a list of notifications for a user in specific parent_urls
* @summary For user by parent_urls
* @param {NotificationsApiFetchNotificationsByParentUrlForUserRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<NotificationsResponse>} A promise that resolves to a `NotificationsResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-notifications-by-parent-url-for-user)
*
*/
fetchNotificationsByParentUrlForUser(requestParameters, options) {
return localVarFp.fetchNotificationsByParentUrlForUser(requestParameters.fid, requestParameters.parentUrls, requestParameters.xNeynarExperimental, requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath));
},
/**
* Mark notifications as seen. You can choose one of two authorization methods, either: 1. Provide a valid signer_uuid in the request body (Most common) 2. Provide a valid, signed \"Bearer\" token in the request\'s `Authorization` header similar to the approach described [here](https://docs.farcaster.xyz/reference/warpcast/api#authentication)
* @summary Mark as seen
* @param {NotificationsApiMarkNotificationsAsSeenRequest} 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/mark-notifications-as-seen)
*
*/
markNotificationsAsSeen(requestParameters, options) {
return localVarFp.markNotificationsAsSeen(requestParameters.markNotificationsAsSeenReqBody, requestParameters.authorization, options).then((request) => request(axios, basePath));
},
};
};
exports.NotificationsApiFactory = NotificationsApiFactory;
/**
* NotificationsApi - object-oriented interface
* @export
* @class NotificationsApi
* @extends {BaseAPI}
*/
class NotificationsApi extends base_1.BaseAPI {
/**
* Returns a list of notifications for a specific FID.
* @summary For user
* @param {NotificationsApiFetchAllNotificationsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof NotificationsApi
* @returns {Promise<NotificationsResponse>} A promise that resolves to a `NotificationsResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-all-notifications)
*
*/
fetchAllNotifications(requestParameters, options) {
return (0, exports.NotificationsApiFp)(this.configuration).fetchAllNotifications(requestParameters.fid, requestParameters.xNeynarExperimental, requestParameters.type, requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath));
}
/**
* Returns a list of notifications for a user in specific channels
* @summary For user by channel
* @param {NotificationsApiFetchChannelNotificationsForUserRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof NotificationsApi
* @returns {Promise<NotificationsResponse>} A promise that resolves to a `NotificationsResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-channel-notifications-for-user)
*
*/
fetchChannelNotificationsForUser(requestParameters, options) {
return (0, exports.NotificationsApiFp)(this.configuration).fetchChannelNotificationsForUser(requestParameters.fid, requestParameters.channelIds, requestParameters.xNeynarExperimental, requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath));
}
/**
* Returns a list of notifications for a user in specific parent_urls
* @summary For user by parent_urls
* @param {NotificationsApiFetchNotificationsByParentUrlForUserRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof NotificationsApi
* @returns {Promise<NotificationsResponse>} A promise that resolves to a `NotificationsResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-notifications-by-parent-url-for-user)
*
*/
fetchNotificationsByParentUrlForUser(requestParameters, options) {
return (0, exports.NotificationsApiFp)(this.configuration).fetchNotificationsByParentUrlForUser(requestParameters.fid, requestParameters.parentUrls, requestParameters.xNeynarExperimental, requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath));
}
/**
* Mark notifications as seen. You can choose one of two authorization methods, either: 1. Provide a valid signer_uuid in the request body (Most common) 2. Provide a valid, signed \"Bearer\" token in the request\'s `Authorization` header similar to the approach described [here](https://docs.farcaster.xyz/reference/warpcast/api#authentication)
* @summary Mark as seen
* @param {NotificationsApiMarkNotificationsAsSeenRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof NotificationsApi
* @returns {Promise<OperationResponse>} A promise that resolves to a `OperationResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/mark-notifications-as-seen)
*
*/
markNotificationsAsSeen(requestParameters, options) {
return (0, exports.NotificationsApiFp)(this.configuration).markNotificationsAsSeen(requestParameters.markNotificationsAsSeenReqBody, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
}
}
exports.NotificationsApi = NotificationsApi;
/**
* @export
*/
exports.FetchAllNotificationsTypeEnum = {
Follows: 'follows',
Recasts: 'recasts',
Likes: 'likes',
Mentions: 'mentions',
Replies: 'replies',
Quotes: 'quotes'
};