From 93eefc1bf4b5f1449bbc71f9c7be2f4aede6214f Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Tue, 19 Mar 2024 13:49:15 +0530 Subject: [PATCH 1/2] Sync OAS, generate code, remove with_replies, add fetchTrendingFeed method --- src/neynar-api/common/constants.ts | 7 + src/neynar-api/neynar-api-client.ts | 36 ++++- src/neynar-api/v2/client.ts | 49 ++++++- .../v2/openapi-farcaster/apis/feed-api.ts | 138 ++++++++++++++---- .../openapi-farcaster/models/frame-action.ts | 6 + ...bhook-subscription-filters-cast-created.ts | 6 + src/oas | 2 +- 7 files changed, 200 insertions(+), 44 deletions(-) diff --git a/src/neynar-api/common/constants.ts b/src/neynar-api/common/constants.ts index 3ed4235c..8ee66bc0 100644 --- a/src/neynar-api/common/constants.ts +++ b/src/neynar-api/common/constants.ts @@ -38,6 +38,13 @@ export enum TimeWindow { THIRTY_DAYS = "30d", } +export enum TrendingFeedTimeWindow { + ONE_HOUR = "1h", + SIX_HOUR = "6h", + TWELVE_HOUR = "12h", + TWENTY_FOUR_HOUR = "24h", +} + export enum BulkCastsSortType { TRENDING = "trending", LIKES = "likes", diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index a5fe0354..30ce9443 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -81,6 +81,7 @@ import { SIGNED_KEY_REQUEST_VALIDATOR, SIGNED_KEY_REQUEST_VALIDATOR_EIP_712_DOMAIN, TimeWindow, + TrendingFeedTimeWindow, } from "./common/constants"; import { isApiErrorResponse } from "./utils"; @@ -1388,7 +1389,6 @@ export class NeynarAPIClient { * @param {string} [options.channelId] Used when filter_type=channel_id can be used to fetch all casts under a channel. Requires feed_type and filter_type * @param {string} [options.embedUrl] - Used when filter_type=embed_url can be used to fetch all casts with an embed url that contains embed_url. Requires feed_type and filter_type * @param {boolean} [options.withRecasts] - Whether to include recasts in the response. True by default. - * @param {boolean} [options.withReplies] - Include replies in the response, false by default * @param {number} [options.limit] - Number of results to retrieve, with a default of 25 and a maximum of 100. * @param {string} [options.cursor] - Pagination cursor for fetching specific subsets of results. * @@ -1415,7 +1415,6 @@ export class NeynarAPIClient { limit?: number; cursor?: string; withRecasts?: boolean; - withReplies?: boolean; } ): Promise { return await this.clients.v2.fetchFeed(feedType, options); @@ -1461,7 +1460,6 @@ export class NeynarAPIClient { * @param {number} fid - fid of user whose feed you want to create * @param {Object} [options] - Optional parameters for customizing the feed. * @param {boolean} [options.withRecasts] - Include recasts in the response, true by default - * @param {boolean} [options.withReplies] - Include replies in the response, false by default * @param {number} [options.limit] - Number of results to retrieve (default 25, max 100). * @param {string} [options.cursor] - Pagination cursor for the next set of results, * omit this parameter for the initial request. @@ -1473,7 +1471,6 @@ export class NeynarAPIClient { * // Example: Retrieve a user's feed based on who they are following * client.fetchUserFollowingFeed(3, { * withRecasts: true, - * withReplies: false, * limit: 30, * // cursor: "nextPageCursor" // Omit this parameter for the initial request. * }).then(response => { @@ -1486,7 +1483,6 @@ export class NeynarAPIClient { fid: number, options?: { withRecasts?: boolean; - withReplies?: boolean; limit?: number; cursor?: string; } @@ -1574,6 +1570,36 @@ export class NeynarAPIClient { return await this.clients.v2.fetchFramesOnlyFeed(options); } + /** + * Retrieves a feed of the most popular cast. + * + * @param {Object} [options] - Optional parameters for customizing the response. + * @param {number} [options.limit] - Number of results to retrieve (default 10, max 10). + * @param {string} [options.cursor] - Pagination cursor for the next set of results, + * omit this parameter for the initial request. + * @param {TrendingFeedTimeWindow} [options.timeWindow] - Time window for the trending feed. + * + * @returns {Promise} A promise that resolves to a `FeedResponse` object, + * containing the most popular casts on the platform. + * + * @example + * // Example: Retrieve a feed of the most popular casts + * import { TrendingFeedTimeWindow } from "@neynar/nodejs-sdk"; + * + * client.fetchTrendingFeed({ limit: 10, timeWindow: TrendingFeedTimeWindow.SIX_HOUR }).then(response => { + * console.log('Popular Feed:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/feed-trending). + */ + public async fetchTrendingFeed(options?: { + limit?: number; + cursor?: string; + timeWindow?: TrendingFeedTimeWindow; + }) { + return await this.clients.v2.fetchTrendingFeed(options); + } + // ------------ Reaction ------------ /** diff --git a/src/neynar-api/v2/client.ts b/src/neynar-api/v2/client.ts index 18ea2aa5..99b0698e 100644 --- a/src/neynar-api/v2/client.ts +++ b/src/neynar-api/v2/client.ts @@ -65,7 +65,11 @@ 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 { BulkCastsSortType, TimeWindow } from "../common/constants"; +import { + BulkCastsSortType, + TimeWindow, + TrendingFeedTimeWindow, +} from "../common/constants"; const BASE_PATH = "https://api.neynar.com/v2"; @@ -979,7 +983,6 @@ export class NeynarV2APIClient { * @param {string} [options.channelId] Used when filter_type=channel_id can be used to fetch all casts under a channel. Requires feed_type and filter_type * @param {string} [options.embedUrl] - Used when filter_type=embed_url can be used to fetch all casts with an embed url that contains embed_url. Requires feed_type and filter_type * @param {boolean} [options.withRecasts] - Whether to include recasts in the response. True by default. - * @param {boolean} [options.withReplies] - Include replies in the response, false by default * @param {number} [options.limit] - Number of results to retrieve, with a default of 25 and a maximum of 100. * @param {string} [options.cursor] - Pagination cursor for fetching specific subsets of results. * @@ -1006,7 +1009,6 @@ export class NeynarV2APIClient { limit?: number; cursor?: string; withRecasts?: boolean; - withReplies?: boolean; } ): Promise { const _fids = options?.fids?.join(","); @@ -1021,7 +1023,6 @@ export class NeynarV2APIClient { options?.channelId, options?.embedUrl, options?.withRecasts, - options?.withReplies, options?.limit, options?.cursor ); @@ -1077,7 +1078,6 @@ export class NeynarV2APIClient { * @param {number} fid - fid of user whose feed you want to create * @param {Object} [options] - Optional parameters for customizing the feed. * @param {boolean} [options.withRecasts] - Include recasts in the response, true by default - * @param {boolean} [options.withReplies] - Include replies in the response, false by default * @param {number} [options.limit] - Number of results to retrieve (default 25, max 100). * @param {string} [options.cursor] - Pagination cursor for the next set of results, * omit this parameter for the initial request. @@ -1089,7 +1089,6 @@ export class NeynarV2APIClient { * // Example: Retrieve a user's feed based on who they are following * client.fetchUserFollowingFeed(3, { * withRecasts: true, - * withReplies: false, * limit: 30, * // cursor: "nextPageCursor" // Omit this parameter for the initial request. * }).then(response => { @@ -1102,7 +1101,6 @@ export class NeynarV2APIClient { fid: number, options?: { withRecasts?: boolean; - withReplies?: boolean; limit?: number; cursor?: string; } @@ -1111,7 +1109,6 @@ export class NeynarV2APIClient { this.apiKey, fid, options?.withRecasts, - options?.withReplies, options?.limit, options?.cursor ); @@ -1213,6 +1210,42 @@ export class NeynarV2APIClient { return response.data; } + /** + * Retrieves a feed of the most popular cast. + * + * @param {Object} [options] - Optional parameters for customizing the response. + * @param {number} [options.limit] - Number of results to retrieve (default 10, max 10). + * @param {string} [options.cursor] - Pagination cursor for the next set of results, + * omit this parameter for the initial request. + * @param {TrendingFeedTimeWindow} [options.timeWindow] - Time window for the trending feed. + * + * @returns {Promise} A promise that resolves to a `FeedResponse` object, + * containing the most popular casts on the platform. + * + * @example + * // Example: Retrieve a feed of the most popular casts + * import { TrendingFeedTimeWindow } from "@neynar/nodejs-sdk"; + * + * client.fetchTrendingFeed({ limit: 10, timeWindow: TrendingFeedTimeWindow.SIX_HOUR }).then(response => { + * console.log('Popular Feed:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/feed-trending). + */ + public async fetchTrendingFeed(options?: { + limit?: number; + cursor?: string; + timeWindow?: TrendingFeedTimeWindow; + }) { + const response = await this.apis.feed.feedTrending( + this.apiKey, + options?.limit, + options?.cursor, + options?.timeWindow + ); + return response.data; + } + // ------------ Reaction ------------ /** diff --git a/src/neynar-api/v2/openapi-farcaster/apis/feed-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/feed-api.ts index 6decdd8a..ad6a4506 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/feed-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/feed-api.ts @@ -49,13 +49,12 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) * @param {string} [channelId] Used when filter_type=channel_id can be used to fetch all casts under a channel. Requires feed_type and filter_type * @param {string} [embedUrl] Used when filter_type=embed_url can be used to fetch all casts with an embed url that contains embed_url. Requires feed_type and filter_type * @param {boolean} [withRecasts] Include recasts in the response, true by default - * @param {boolean} [withReplies] Include replies in the response, false by default * @param {number} [limit] Number of results to retrieve (default 25, max 100) * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - feed: async (apiKey: string, feedType: FeedType, filterType?: FilterType, fid?: number, fids?: string, parentUrl?: string, channelId?: string, embedUrl?: string, withRecasts?: boolean, withReplies?: boolean, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { + feed: async (apiKey: string, feedType: FeedType, filterType?: FilterType, fid?: number, fids?: string, parentUrl?: string, channelId?: string, embedUrl?: string, withRecasts?: boolean, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'apiKey' is not null or undefined assertParamExists('feed', 'apiKey', apiKey) // verify required parameter 'feedType' is not null or undefined @@ -104,10 +103,6 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) localVarQueryParameter['with_recasts'] = withRecasts; } - if (withReplies !== undefined) { - localVarQueryParameter['with_replies'] = withReplies; - } - if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } @@ -201,13 +196,12 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) * @param {string} apiKey API key required for authentication. * @param {number} fid fid of user whose feed you want to create * @param {boolean} [withRecasts] Include recasts in the response, true by default - * @param {boolean} [withReplies] Include replies in the response, false by default * @param {number} [limit] Number of results to retrieve (default 25, max 100) * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - feedFollowing: async (apiKey: string, fid: number, withRecasts?: boolean, withReplies?: boolean, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { + feedFollowing: async (apiKey: string, fid: number, withRecasts?: boolean, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'apiKey' is not null or undefined assertParamExists('feedFollowing', 'apiKey', apiKey) // verify required parameter 'fid' is not null or undefined @@ -232,10 +226,6 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) localVarQueryParameter['with_recasts'] = withRecasts; } - if (withReplies !== undefined) { - localVarQueryParameter['with_replies'] = withReplies; - } - if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } @@ -297,6 +287,58 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Retrieve trending casts + * @param {string} apiKey API key required for authentication. + * @param {number} [limit] Number of results to retrieve (max 10) + * @param {string} [cursor] Pagination cursor + * @param {'1h' | '6h' | '12h' | '24h'} [timeWindow] Time window for trending casts + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + feedTrending: async (apiKey: string, limit?: number, cursor?: string, timeWindow?: '1h' | '6h' | '12h' | '24h', options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('feedTrending', 'apiKey', apiKey) + const localVarPath = `/farcaster/feed/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 (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + 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}; @@ -420,14 +462,13 @@ export const FeedApiFp = function(configuration?: Configuration) { * @param {string} [channelId] Used when filter_type=channel_id can be used to fetch all casts under a channel. Requires feed_type and filter_type * @param {string} [embedUrl] Used when filter_type=embed_url can be used to fetch all casts with an embed url that contains embed_url. Requires feed_type and filter_type * @param {boolean} [withRecasts] Include recasts in the response, true by default - * @param {boolean} [withReplies] Include replies in the response, false by default * @param {number} [limit] Number of results to retrieve (default 25, max 100) * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async feed(apiKey: string, feedType: FeedType, filterType?: FilterType, fid?: number, fids?: string, parentUrl?: string, channelId?: string, embedUrl?: string, withRecasts?: boolean, withReplies?: boolean, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.feed(apiKey, feedType, filterType, fid, fids, parentUrl, channelId, embedUrl, withRecasts, withReplies, limit, cursor, options); + async feed(apiKey: string, feedType: FeedType, filterType?: FilterType, fid?: number, fids?: string, parentUrl?: string, channelId?: string, embedUrl?: string, withRecasts?: boolean, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.feed(apiKey, feedType, filterType, fid, fids, parentUrl, channelId, embedUrl, withRecasts, limit, cursor, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -452,14 +493,13 @@ export const FeedApiFp = function(configuration?: Configuration) { * @param {string} apiKey API key required for authentication. * @param {number} fid fid of user whose feed you want to create * @param {boolean} [withRecasts] Include recasts in the response, true by default - * @param {boolean} [withReplies] Include replies in the response, false by default * @param {number} [limit] Number of results to retrieve (default 25, max 100) * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async feedFollowing(apiKey: string, fid: number, withRecasts?: boolean, withReplies?: boolean, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.feedFollowing(apiKey, fid, withRecasts, withReplies, limit, cursor, options); + async feedFollowing(apiKey: string, fid: number, withRecasts?: boolean, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.feedFollowing(apiKey, fid, withRecasts, limit, cursor, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -475,6 +515,20 @@ export const FeedApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.feedFrames(apiKey, limit, cursor, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * + * @summary Retrieve trending casts + * @param {string} apiKey API key required for authentication. + * @param {number} [limit] Number of results to retrieve (max 10) + * @param {string} [cursor] Pagination cursor + * @param {'1h' | '6h' | '12h' | '24h'} [timeWindow] Time window for trending casts + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async feedTrending(apiKey: string, limit?: number, cursor?: string, timeWindow?: '1h' | '6h' | '12h' | '24h', options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.feedTrending(apiKey, limit, cursor, timeWindow, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * Retrieve 10 most popular casts for a given user FID; popularity based on replies, likes and recasts; sorted by most popular first * @summary Retrieve 10 most popular casts for a user @@ -523,14 +577,13 @@ export const FeedApiFactory = function (configuration?: Configuration, basePath? * @param {string} [channelId] Used when filter_type=channel_id can be used to fetch all casts under a channel. Requires feed_type and filter_type * @param {string} [embedUrl] Used when filter_type=embed_url can be used to fetch all casts with an embed url that contains embed_url. Requires feed_type and filter_type * @param {boolean} [withRecasts] Include recasts in the response, true by default - * @param {boolean} [withReplies] Include replies in the response, false by default * @param {number} [limit] Number of results to retrieve (default 25, max 100) * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - feed(apiKey: string, feedType: FeedType, filterType?: FilterType, fid?: number, fids?: string, parentUrl?: string, channelId?: string, embedUrl?: string, withRecasts?: boolean, withReplies?: boolean, limit?: number, cursor?: string, options?: any): AxiosPromise { - return localVarFp.feed(apiKey, feedType, filterType, fid, fids, parentUrl, channelId, embedUrl, withRecasts, withReplies, limit, cursor, options).then((request) => request(axios, basePath)); + feed(apiKey: string, feedType: FeedType, filterType?: FilterType, fid?: number, fids?: string, parentUrl?: string, channelId?: string, embedUrl?: string, withRecasts?: boolean, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.feed(apiKey, feedType, filterType, fid, fids, parentUrl, channelId, embedUrl, withRecasts, limit, cursor, options).then((request) => request(axios, basePath)); }, /** * @@ -553,14 +606,13 @@ export const FeedApiFactory = function (configuration?: Configuration, basePath? * @param {string} apiKey API key required for authentication. * @param {number} fid fid of user whose feed you want to create * @param {boolean} [withRecasts] Include recasts in the response, true by default - * @param {boolean} [withReplies] Include replies in the response, false by default * @param {number} [limit] Number of results to retrieve (default 25, max 100) * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - feedFollowing(apiKey: string, fid: number, withRecasts?: boolean, withReplies?: boolean, limit?: number, cursor?: string, options?: any): AxiosPromise { - return localVarFp.feedFollowing(apiKey, fid, withRecasts, withReplies, limit, cursor, options).then((request) => request(axios, basePath)); + feedFollowing(apiKey: string, fid: number, withRecasts?: boolean, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.feedFollowing(apiKey, fid, withRecasts, limit, cursor, options).then((request) => request(axios, basePath)); }, /** * @@ -574,6 +626,19 @@ export const FeedApiFactory = function (configuration?: Configuration, basePath? feedFrames(apiKey: string, limit?: number, cursor?: string, options?: any): AxiosPromise { return localVarFp.feedFrames(apiKey, limit, cursor, options).then((request) => request(axios, basePath)); }, + /** + * + * @summary Retrieve trending casts + * @param {string} apiKey API key required for authentication. + * @param {number} [limit] Number of results to retrieve (max 10) + * @param {string} [cursor] Pagination cursor + * @param {'1h' | '6h' | '12h' | '24h'} [timeWindow] Time window for trending casts + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + feedTrending(apiKey: string, limit?: number, cursor?: string, timeWindow?: '1h' | '6h' | '12h' | '24h', options?: any): AxiosPromise { + return localVarFp.feedTrending(apiKey, limit, cursor, timeWindow, options).then((request) => request(axios, basePath)); + }, /** * Retrieve 10 most popular casts for a given user FID; popularity based on replies, likes and recasts; sorted by most popular first * @summary Retrieve 10 most popular casts for a user @@ -620,15 +685,14 @@ export class FeedApi extends BaseAPI { * @param {string} [channelId] Used when filter_type=channel_id can be used to fetch all casts under a channel. Requires feed_type and filter_type * @param {string} [embedUrl] Used when filter_type=embed_url can be used to fetch all casts with an embed url that contains embed_url. Requires feed_type and filter_type * @param {boolean} [withRecasts] Include recasts in the response, true by default - * @param {boolean} [withReplies] Include replies in the response, false by default * @param {number} [limit] Number of results to retrieve (default 25, max 100) * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FeedApi */ - public feed(apiKey: string, feedType: FeedType, filterType?: FilterType, fid?: number, fids?: string, parentUrl?: string, channelId?: string, embedUrl?: string, withRecasts?: boolean, withReplies?: boolean, limit?: number, cursor?: string, options?: AxiosRequestConfig) { - return FeedApiFp(this.configuration).feed(apiKey, feedType, filterType, fid, fids, parentUrl, channelId, embedUrl, withRecasts, withReplies, limit, cursor, options).then((request) => request(this.axios, this.basePath)); + public feed(apiKey: string, feedType: FeedType, filterType?: FilterType, fid?: number, fids?: string, parentUrl?: string, channelId?: string, embedUrl?: string, withRecasts?: boolean, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + return FeedApiFp(this.configuration).feed(apiKey, feedType, filterType, fid, fids, parentUrl, channelId, embedUrl, withRecasts, limit, cursor, options).then((request) => request(this.axios, this.basePath)); } /** @@ -654,15 +718,14 @@ export class FeedApi extends BaseAPI { * @param {string} apiKey API key required for authentication. * @param {number} fid fid of user whose feed you want to create * @param {boolean} [withRecasts] Include recasts in the response, true by default - * @param {boolean} [withReplies] Include replies in the response, false by default * @param {number} [limit] Number of results to retrieve (default 25, max 100) * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FeedApi */ - public feedFollowing(apiKey: string, fid: number, withRecasts?: boolean, withReplies?: boolean, limit?: number, cursor?: string, options?: AxiosRequestConfig) { - return FeedApiFp(this.configuration).feedFollowing(apiKey, fid, withRecasts, withReplies, limit, cursor, options).then((request) => request(this.axios, this.basePath)); + public feedFollowing(apiKey: string, fid: number, withRecasts?: boolean, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + return FeedApiFp(this.configuration).feedFollowing(apiKey, fid, withRecasts, limit, cursor, options).then((request) => request(this.axios, this.basePath)); } /** @@ -679,6 +742,21 @@ export class FeedApi extends BaseAPI { return FeedApiFp(this.configuration).feedFrames(apiKey, limit, cursor, options).then((request) => request(this.axios, this.basePath)); } + /** + * + * @summary Retrieve trending casts + * @param {string} apiKey API key required for authentication. + * @param {number} [limit] Number of results to retrieve (max 10) + * @param {string} [cursor] Pagination cursor + * @param {'1h' | '6h' | '12h' | '24h'} [timeWindow] Time window for trending casts + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FeedApi + */ + public feedTrending(apiKey: string, limit?: number, cursor?: string, timeWindow?: '1h' | '6h' | '12h' | '24h', options?: AxiosRequestConfig) { + return FeedApiFp(this.configuration).feedTrending(apiKey, limit, cursor, timeWindow, options).then((request) => request(this.axios, this.basePath)); + } + /** * Retrieve 10 most popular casts for a given user FID; popularity based on replies, likes and recasts; sorted by most popular first * @summary Retrieve 10 most popular casts for a user diff --git a/src/neynar-api/v2/openapi-farcaster/models/frame-action.ts b/src/neynar-api/v2/openapi-farcaster/models/frame-action.ts index 17748def..8e2e8436 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/frame-action.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/frame-action.ts @@ -74,6 +74,12 @@ export interface FrameAction { * @memberof FrameAction */ 'transaction'?: FrameTransaction; + /** + * The connected wallet address of the interacting user. + * @type {string} + * @memberof FrameAction + */ + 'address'?: string; /** * URL of the frames * @type {string} diff --git a/src/neynar-api/v2/openapi-farcaster/models/webhook-subscription-filters-cast-created.ts b/src/neynar-api/v2/openapi-farcaster/models/webhook-subscription-filters-cast-created.ts index 46269903..3b44c6b8 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/webhook-subscription-filters-cast-created.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/webhook-subscription-filters-cast-created.ts @@ -44,5 +44,11 @@ export interface WebhookSubscriptionFiltersCastCreated { * @memberof WebhookSubscriptionFiltersCastCreated */ 'root_parent_urls'?: Array; + /** + * + * @type {Array} + * @memberof WebhookSubscriptionFiltersCastCreated + */ + 'text'?: Array; } diff --git a/src/oas b/src/oas index aaabaeb1..03aa3e22 160000 --- a/src/oas +++ b/src/oas @@ -1 +1 @@ -Subproject commit aaabaeb16641d8064a7bb43e40f457ec110347f5 +Subproject commit 03aa3e22aa470c61ad92ea37bd1001d36b1a3893 From 3a6d0ab0103ca58877f9aac21ac11c144eb60374 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Tue, 19 Mar 2024 13:51:00 +0530 Subject: [PATCH 2/2] Minor update: v1.13.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e386777b..738460a7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@neynar/nodejs-sdk", - "version": "1.12.0", + "version": "1.13.0", "description": "SDK to interact with Neynar APIs (https://docs.neynar.com/)", "main": "./build/index.js", "types": "./build/index.d.ts",