From ad766bb6e9fe159e89a5107efa3c4b909fb7a9a2 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Fri, 19 Jan 2024 17:27:11 +0530 Subject: [PATCH 1/4] Sync up OAS --- src/neynar-api/v2/client.ts | 2 +- src/oas | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/neynar-api/v2/client.ts b/src/neynar-api/v2/client.ts index 1b75b1c7..b5efce41 100644 --- a/src/neynar-api/v2/client.ts +++ b/src/neynar-api/v2/client.ts @@ -1013,7 +1013,7 @@ export class NeynarV2APIClient { * console.log('Channel Notifications:', response); * }); * - * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/notifications). + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/notifications-channel). */ public async fetchChannelNotificationsForUser( fid: number, diff --git a/src/oas b/src/oas index d2e3fddd..5d87da67 160000 --- a/src/oas +++ b/src/oas @@ -1 +1 @@ -Subproject commit d2e3fdddc9c29b6bc9da181bee0232aa5674bf02 +Subproject commit 5d87da67ae13b819ea948b0bf0184122162e7811 From 8bad7786c165f6fe1930d829ee65afea1a48bfa7 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Fri, 19 Jan 2024 19:28:06 +0530 Subject: [PATCH 2/4] Add fetchTrendingChannels --- src/neynar-api/common/constants.ts | 6 ++ src/neynar-api/index.ts | 9 ++- src/neynar-api/neynar-api-client.ts | 29 ++++++- src/neynar-api/v2/client.ts | 31 ++++++++ .../v2/openapi-farcaster/apis/channel-api.ts | 78 +++++++++++++++++++ 5 files changed, 151 insertions(+), 2 deletions(-) diff --git a/src/neynar-api/common/constants.ts b/src/neynar-api/common/constants.ts index c2360af7..5edee4c8 100644 --- a/src/neynar-api/common/constants.ts +++ b/src/neynar-api/common/constants.ts @@ -31,3 +31,9 @@ export const SIGNED_KEY_REQUEST_TYPE_FOR_ADD_FOR = [ { name: "nonce", type: "uint256" }, { name: "deadline", type: "uint256" }, ]; + +export enum TimeWindow { + ONE_DAY = "1d", + SEVEN_DAYS = "7d", + THIRTY_DAYS = "30d", +} diff --git a/src/neynar-api/index.ts b/src/neynar-api/index.ts index 43aae58e..063fcbb0 100644 --- a/src/neynar-api/index.ts +++ b/src/neynar-api/index.ts @@ -1,3 +1,10 @@ export * from "./neynar-api-client"; export * from "./utils"; -export { FeedType, FilterType, ReactionsType, CastParamType, ReactionType } from "./v2"; +export { + FeedType, + FilterType, + ReactionsType, + CastParamType, + ReactionType, +} from "./v2"; +export { TimeWindow } from "./common/constants"; diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index 90f331e3..6381f937 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -61,6 +61,7 @@ import { SIGNED_KEY_REQUEST_TYPE_FOR_ADD_FOR, SIGNED_KEY_REQUEST_VALIDATOR, SIGNED_KEY_REQUEST_VALIDATOR_EIP_712_DOMAIN, + TimeWindow, } from "./common/constants"; import { isApiErrorResponse } from "./utils"; @@ -1403,7 +1404,7 @@ export class NeynarAPIClient { * console.log('Channel Notifications:', response); * }); * - * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/notifications). + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/notifications-channel). */ public async fetchChannelNotificationsForUser( fid: number, @@ -1528,6 +1529,32 @@ export class NeynarAPIClient { return await this.clients.v2.searchChannels(q); } + /** + * Retrieves a list of trending channels based on activity within a specified time window. + * This method is useful for identifying channels that are currently popular or receiving significant engagement. + * + * @param {'1d' | '7d' | '30d'} [timeWindow] - The time window for trending analysis. Options are '1d' (one day), + * '7d' (seven days), or '30d' (thirty days). + * + * @returns {Promise} A promise that resolves to a `ChannelListResponse` object, + * containing a list of trending channels based on the specified time window. + * + * @example + * // Example: Retrieve trending channels over the past week + * import { TimeWindow } from '@neynar/nodejs-sdk' + * + * client.fetchTrendingChannels(TimeWindow.SEVEN_DAYS).then(response => { + * console.log('Trending Channels:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/trending-channels). + */ + public async fetchTrendingChannels( + timeWindow?: TimeWindow + ): Promise { + return await this.clients.v2.fetchTrendingChannels(timeWindow); + } + // ------------ Follows ------------ /** diff --git a/src/neynar-api/v2/client.ts b/src/neynar-api/v2/client.ts index b5efce41..663fba6f 100644 --- a/src/neynar-api/v2/client.ts +++ b/src/neynar-api/v2/client.ts @@ -41,6 +41,7 @@ import axios, { AxiosError, AxiosInstance } from "axios"; import { silentLogger, Logger } from "../common/logger"; import type { SetRequired } from "type-fest"; import { NFTApi, RelevantMints } from "./openapi-recommendation"; +import { TimeWindow } from "../common/constants"; const BASE_PATH = "https://api.neynar.com/v2"; @@ -1151,6 +1152,36 @@ export class NeynarV2APIClient { return response.data; } + /** + * Retrieves a list of trending channels based on activity within a specified time window. + * This method is useful for identifying channels that are currently popular or receiving significant engagement. + * + * @param {'1d' | '7d' | '30d'} [timeWindow] - The time window for trending analysis. Options are '1d' (one day), + * '7d' (seven days), or '30d' (thirty days). + * + * @returns {Promise} A promise that resolves to a `ChannelListResponse` object, + * containing a list of trending channels based on the specified time window. + * + * @example + * // Example: Retrieve trending channels over the past week + * import { TimeWindow } from '@neynar/nodejs-sdk' + * + * client.fetchTrendingChannels(TimeWindow.SEVEN_DAYS).then(response => { + * console.log('Trending Channels:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/trending-channels). + */ + public async fetchTrendingChannels( + timeWindow?: TimeWindow + ): Promise { + const response = await this.apis.channel.trendingChannels( + this.apiKey, + timeWindow + ); + return response.data; + } + // ------------ Follows ------------ /** diff --git a/src/neynar-api/v2/openapi-farcaster/apis/channel-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/channel-api.ts index a6cbfcd2..3b6f97c5 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/channel-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/channel-api.ts @@ -227,6 +227,48 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns a list of trending channels based on activity + * @summary Retrieve trending channels based on activity + * @param {string} apiKey API key required for authentication. + * @param {'1d' | '7d' | '30d'} [timeWindow] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + trendingChannels: async (apiKey: string, timeWindow?: '1d' | '7d' | '30d', options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('trendingChannels', 'apiKey', apiKey) + const localVarPath = `/farcaster/channel/trending`; + // 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 = {} as any; + const localVarQueryParameter = {} as any; + + if (timeWindow !== undefined) { + localVarQueryParameter['time_window'] = timeWindow; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -299,6 +341,18 @@ export const ChannelApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.searchChannels(apiKey, q, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Returns a list of trending channels based on activity + * @summary Retrieve trending channels based on activity + * @param {string} apiKey API key required for authentication. + * @param {'1d' | '7d' | '30d'} [timeWindow] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async trendingChannels(apiKey: string, timeWindow?: '1d' | '7d' | '30d', options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.trendingChannels(apiKey, timeWindow, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, } }; @@ -358,6 +412,17 @@ export const ChannelApiFactory = function (configuration?: Configuration, basePa searchChannels(apiKey: string, q: string, options?: any): AxiosPromise { return localVarFp.searchChannels(apiKey, q, options).then((request) => request(axios, basePath)); }, + /** + * Returns a list of trending channels based on activity + * @summary Retrieve trending channels based on activity + * @param {string} apiKey API key required for authentication. + * @param {'1d' | '7d' | '30d'} [timeWindow] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + trendingChannels(apiKey: string, timeWindow?: '1d' | '7d' | '30d', options?: any): AxiosPromise { + return localVarFp.trendingChannels(apiKey, timeWindow, options).then((request) => request(axios, basePath)); + }, }; }; @@ -424,4 +489,17 @@ export class ChannelApi extends BaseAPI { public searchChannels(apiKey: string, q: string, options?: AxiosRequestConfig) { return ChannelApiFp(this.configuration).searchChannels(apiKey, q, options).then((request) => request(this.axios, this.basePath)); } + + /** + * Returns a list of trending channels based on activity + * @summary Retrieve trending channels based on activity + * @param {string} apiKey API key required for authentication. + * @param {'1d' | '7d' | '30d'} [timeWindow] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ChannelApi + */ + public trendingChannels(apiKey: string, timeWindow?: '1d' | '7d' | '30d', options?: AxiosRequestConfig) { + return ChannelApiFp(this.configuration).trendingChannels(apiKey, timeWindow, options).then((request) => request(this.axios, this.basePath)); + } } From 8d70ae946cf4be2eabd2f96d07ddaba88fe2bafd Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Fri, 19 Jan 2024 21:12:10 +0530 Subject: [PATCH 3/4] Add Keywords --- package.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index e2b00574..3707a599 100644 --- a/package.json +++ b/package.json @@ -26,5 +26,12 @@ "@openapitools/openapi-generator-cli": "^2.7.0", "axios": "^1.6.2", "viem": "^1.19.9" - } + }, + "keywords": [ + "ethereum", + "optimism", + "farcaster", + "neynar", + "nodejs" + ] } \ No newline at end of file From d3e68a132fc2c87c117861669f853d0253373f3a Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Fri, 19 Jan 2024 22:43:58 +0530 Subject: [PATCH 4/4] Add fetchNotificationsByParentUrlForUser --- src/neynar-api/neynar-api-client.ts | 35 +++++ src/neynar-api/v2/client.ts | 39 +++++ .../apis/notifications-api.ts | 138 ++++++++++++++++-- 3 files changed, 196 insertions(+), 16 deletions(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index 6381f937..7e034543 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -1555,6 +1555,41 @@ export class NeynarAPIClient { return await this.clients.v2.fetchTrendingChannels(timeWindow); } + /** + * Retrieves a list of notifications for a user based on specific parent URLs. This method is + * particularly useful for fetching notifications related to user interactions within designated + * channels or content categories. + * + * @param {number} fid - The FID of the user for whom notifications are being fetched. + * @param {Array} parentUrls - An array of parent URLs to specify the channels. + * @param {Object} [options] - Optional parameters for customizing the response. + * @param {number} [options.limit] - Number of results to retrieve (default 25, max 50). + * @param {string} [options.cursor] - Pagination cursor for the next set of results, + * omit this parameter for the initial request. + * + * @returns {Promise} A promise that resolves to a `NotificationsResponse` object, + * containing the notifications for the specified user and parent URLs. + * + * @example + * // Example: Retrieve notifications for a user based on specific parent URLs + * client.fetchNotificationsByParentUrlForUser(3, ['chain://eip155:1/erc721:0xd4498134211baad5846ce70ce04e7c4da78931cc', 'chain://eip155:1/erc721:0xfd8427165df67df6d7fd689ae67c8ebf56d9ca61'], { limit: 30 }).then(response => { + * console.log('User Notifications:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/notifications-parent-url). + */ + public async fetchNotificationsByParentUrlForUser( + fid: number, + parentUrls: string[], + options?: { cursor?: string; limit?: number } + ) { + return await this.clients.v2.fetchNotificationsByParentUrlForUser( + fid, + parentUrls, + options + ); + } + // ------------ Follows ------------ /** diff --git a/src/neynar-api/v2/client.ts b/src/neynar-api/v2/client.ts index 663fba6f..4bf0ecc3 100644 --- a/src/neynar-api/v2/client.ts +++ b/src/neynar-api/v2/client.ts @@ -1032,6 +1032,45 @@ export class NeynarV2APIClient { return response.data; } + /** + * Retrieves a list of notifications for a user based on specific parent URLs. This method is + * particularly useful for fetching notifications related to user interactions within designated + * channels or content categories. + * + * @param {number} fid - The FID of the user for whom notifications are being fetched. + * @param {Array} parentUrls - An array of parent URLs to specify the channels. + * @param {Object} [options] - Optional parameters for customizing the response. + * @param {number} [options.limit] - Number of results to retrieve (default 25, max 50). + * @param {string} [options.cursor] - Pagination cursor for the next set of results, + * omit this parameter for the initial request. + * + * @returns {Promise} A promise that resolves to a `NotificationsResponse` object, + * containing the notifications for the specified user and parent URLs. + * + * @example + * // Example: Retrieve notifications for a user based on specific parent URLs + * client.fetchNotificationsByParentUrlForUser(3, ['chain://eip155:1/erc721:0xd4498134211baad5846ce70ce04e7c4da78931cc', 'chain://eip155:1/erc721:0xfd8427165df67df6d7fd689ae67c8ebf56d9ca61'], { limit: 30 }).then(response => { + * console.log('User Notifications:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/notifications-parent-url). + */ + public async fetchNotificationsByParentUrlForUser( + fid: number, + parentUrls: string[], + options?: { cursor?: string; limit?: number } + ) { + const _parentUrls = parentUrls.join(","); + const response = await this.apis.notifications.notificationsParentUrl( + this.apiKey, + fid, + _parentUrls, + options?.limit, + options?.cursor + ); + return response.data; + } + // ------------ Channel ------------ /** diff --git a/src/neynar-api/v2/openapi-farcaster/apis/notifications-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/notifications-api.ts index 26413081..49c2d410 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/notifications-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/notifications-api.ts @@ -35,7 +35,7 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi * Returns a list of notifications for a specific FID. * @summary Retrieve notifications for a given user * @param {string} apiKey API key required for authentication. - * @param {number} fid + * @param {number} fid FID of the user you you want to fetch notifications for * @param {number} [limit] Number of results to retrieve (default 25, max 50) * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. @@ -86,10 +86,10 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi }; }, /** - * Returns a list of notifications for a user in a specific channel - * @summary Retrieve notifications for a user for a given channel + * Returns a list of notifications for a user in specific channels + * @summary Retrieve notifications for a user in given channels * @param {string} apiKey API key required for authentication. - * @param {number} fid + * @param {number} fid FID of the user you you want to fetch notifications for * @param {string} channelIds Comma separated channel_ids (find list of all channels here - https://docs.neynar.com/reference/list-all-channels) * @param {number} [limit] Number of results to retrieve (default 25, max 50) * @param {string} [cursor] Pagination cursor. @@ -137,6 +137,67 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns a list of notifications for a user in specific parent_urls + * @summary Retrieve notifications for a user in given parent_urls + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user you you want to fetch notifications for + * @param {string} parentUrls Comma separated parent_urls + * @param {number} [limit] Number of results to retrieve (default 25, max 50) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + notificationsParentUrl: async (apiKey: string, fid: number, parentUrls: string, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('notificationsParentUrl', 'apiKey', apiKey) + // verify required parameter 'fid' is not null or undefined + assertParamExists('notificationsParentUrl', 'fid', fid) + // verify required parameter 'parentUrls' is not null or undefined + assertParamExists('notificationsParentUrl', 'parentUrls', parentUrls) + const localVarPath = `/farcaster/notifications/parent_url`; + // 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 = {} as any; + const localVarQueryParameter = {} as any; + + 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 (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -160,7 +221,7 @@ export const NotificationsApiFp = function(configuration?: Configuration) { * Returns a list of notifications for a specific FID. * @summary Retrieve notifications for a given user * @param {string} apiKey API key required for authentication. - * @param {number} fid + * @param {number} fid FID of the user you you want to fetch notifications for * @param {number} [limit] Number of results to retrieve (default 25, max 50) * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. @@ -171,10 +232,10 @@ export const NotificationsApiFp = function(configuration?: Configuration) { return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** - * Returns a list of notifications for a user in a specific channel - * @summary Retrieve notifications for a user for a given channel + * Returns a list of notifications for a user in specific channels + * @summary Retrieve notifications for a user in given channels * @param {string} apiKey API key required for authentication. - * @param {number} fid + * @param {number} fid FID of the user you you want to fetch notifications for * @param {string} channelIds Comma separated channel_ids (find list of all channels here - https://docs.neynar.com/reference/list-all-channels) * @param {number} [limit] Number of results to retrieve (default 25, max 50) * @param {string} [cursor] Pagination cursor. @@ -185,6 +246,21 @@ export const NotificationsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.notificationsChannel(apiKey, fid, channelIds, limit, cursor, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Returns a list of notifications for a user in specific parent_urls + * @summary Retrieve notifications for a user in given parent_urls + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user you you want to fetch notifications for + * @param {string} parentUrls Comma separated parent_urls + * @param {number} [limit] Number of results to retrieve (default 25, max 50) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async notificationsParentUrl(apiKey: string, fid: number, parentUrls: string, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.notificationsParentUrl(apiKey, fid, parentUrls, limit, cursor, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, } }; @@ -199,7 +275,7 @@ export const NotificationsApiFactory = function (configuration?: Configuration, * Returns a list of notifications for a specific FID. * @summary Retrieve notifications for a given user * @param {string} apiKey API key required for authentication. - * @param {number} fid + * @param {number} fid FID of the user you you want to fetch notifications for * @param {number} [limit] Number of results to retrieve (default 25, max 50) * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. @@ -209,10 +285,10 @@ export const NotificationsApiFactory = function (configuration?: Configuration, return localVarFp.notifications(apiKey, fid, limit, cursor, options).then((request) => request(axios, basePath)); }, /** - * Returns a list of notifications for a user in a specific channel - * @summary Retrieve notifications for a user for a given channel + * Returns a list of notifications for a user in specific channels + * @summary Retrieve notifications for a user in given channels * @param {string} apiKey API key required for authentication. - * @param {number} fid + * @param {number} fid FID of the user you you want to fetch notifications for * @param {string} channelIds Comma separated channel_ids (find list of all channels here - https://docs.neynar.com/reference/list-all-channels) * @param {number} [limit] Number of results to retrieve (default 25, max 50) * @param {string} [cursor] Pagination cursor. @@ -222,6 +298,20 @@ export const NotificationsApiFactory = function (configuration?: Configuration, notificationsChannel(apiKey: string, fid: number, channelIds: string, limit?: number, cursor?: string, options?: any): AxiosPromise { return localVarFp.notificationsChannel(apiKey, fid, channelIds, limit, cursor, options).then((request) => request(axios, basePath)); }, + /** + * Returns a list of notifications for a user in specific parent_urls + * @summary Retrieve notifications for a user in given parent_urls + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user you you want to fetch notifications for + * @param {string} parentUrls Comma separated parent_urls + * @param {number} [limit] Number of results to retrieve (default 25, max 50) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + notificationsParentUrl(apiKey: string, fid: number, parentUrls: string, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.notificationsParentUrl(apiKey, fid, parentUrls, limit, cursor, options).then((request) => request(axios, basePath)); + }, }; }; @@ -236,7 +326,7 @@ export class NotificationsApi extends BaseAPI { * Returns a list of notifications for a specific FID. * @summary Retrieve notifications for a given user * @param {string} apiKey API key required for authentication. - * @param {number} fid + * @param {number} fid FID of the user you you want to fetch notifications for * @param {number} [limit] Number of results to retrieve (default 25, max 50) * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. @@ -248,10 +338,10 @@ export class NotificationsApi extends BaseAPI { } /** - * Returns a list of notifications for a user in a specific channel - * @summary Retrieve notifications for a user for a given channel + * Returns a list of notifications for a user in specific channels + * @summary Retrieve notifications for a user in given channels * @param {string} apiKey API key required for authentication. - * @param {number} fid + * @param {number} fid FID of the user you you want to fetch notifications for * @param {string} channelIds Comma separated channel_ids (find list of all channels here - https://docs.neynar.com/reference/list-all-channels) * @param {number} [limit] Number of results to retrieve (default 25, max 50) * @param {string} [cursor] Pagination cursor. @@ -262,4 +352,20 @@ export class NotificationsApi extends BaseAPI { public notificationsChannel(apiKey: string, fid: number, channelIds: string, limit?: number, cursor?: string, options?: AxiosRequestConfig) { return NotificationsApiFp(this.configuration).notificationsChannel(apiKey, fid, channelIds, limit, cursor, options).then((request) => request(this.axios, this.basePath)); } + + /** + * Returns a list of notifications for a user in specific parent_urls + * @summary Retrieve notifications for a user in given parent_urls + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user you you want to fetch notifications for + * @param {string} parentUrls Comma separated parent_urls + * @param {number} [limit] Number of results to retrieve (default 25, max 50) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationsApi + */ + public notificationsParentUrl(apiKey: string, fid: number, parentUrls: string, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + return NotificationsApiFp(this.configuration).notificationsParentUrl(apiKey, fid, parentUrls, limit, cursor, options).then((request) => request(this.axios, this.basePath)); + } }