Skip to content

Commit

Permalink
Add filter_type embed_url in fetchFeed api
Browse files Browse the repository at this point in the history
Add filter_type embed_url in fetchFeed api
  • Loading branch information
Shreyaschorge authored Dec 7, 2023
2 parents 62b706d + b1951d1 commit ab5146f
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@neynar/nodejs-sdk",
"version": "1.2.0",
"version": "1.3.0",
"description": "SDK to interact with Neynar APIs (https://docs.neynar.com/)",
"main": "./build/index.js",
"types": "./build/index.d.ts",
Expand Down
2 changes: 2 additions & 0 deletions src/neynar-api/neynar-api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,7 @@ export class NeynarAPIClient {
* @param {number} [options.fid] - FID of the user whose feed is being created. Required unless a 'filterType' is provided.
* @param {Array<number>} [options.fids] - Used for creating a feed based on a list of FIDs. Requires 'feedType' and 'filterType'.
* @param {string} [options.parentUrl] - Used for fetching content under a specific parent URL. Requires 'feedType' and 'filterType'.
* @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 {number} [options.limit] - The maximum number of users to be returned in the response.
* Defaults to 25, with a maximum allowable value of 100.
Expand All @@ -1149,6 +1150,7 @@ export class NeynarAPIClient {
fid?: number;
fids?: number[];
parentUrl?: string;
embedUrl?: string;
limit?: number;
cursor?: string;
withRecasts?: boolean;
Expand Down
3 changes: 3 additions & 0 deletions src/neynar-api/v2/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,7 @@ export class NeynarV2APIClient {
* @param {number} [options.fid] - FID of the user whose feed is being created. Required unless a 'filterType' is provided.
* @param {Array<number>} [options.fids] - Used for creating a feed based on a list of FIDs. Requires 'feedType' and 'filterType'.
* @param {string} [options.parentUrl] - Used for fetching content under a specific parent URL. Requires 'feedType' and 'filterType'.
* @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 {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.
Expand All @@ -692,6 +693,7 @@ export class NeynarV2APIClient {
fid?: number;
fids?: number[];
parentUrl?: string;
embedUrl?: string;
limit?: number;
cursor?: string;
withRecasts?: boolean;
Expand All @@ -706,6 +708,7 @@ export class NeynarV2APIClient {
options?.fid,
_fids,
options?.parentUrl,
options?.embedUrl,
options?.withRecasts,
options?.limit,
options?.cursor
Expand Down
22 changes: 15 additions & 7 deletions src/neynar-api/v2/openapi-farcaster/apis/feed-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration)
* @param {number} [fid] (Optional) fid of user whose feed you want to create. By default, the API expects this field, except if you pass a filter_type
* @param {string} [fids] Used when filter_type&#x3D;fids . Create a feed based on a list of fids. Max array size is 250. Requires feed_type and filter_type.
* @param {string} [parentUrl] Used when filter_type&#x3D;parent_url can be used to fetch content under any parent url e.g. FIP-2 channels on Warpcast. Requires feed_type and filter_type
* @param {string} [embedUrl] Used when filter_type&#x3D;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 {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, withRecasts?: boolean, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
feed: async (apiKey: string, feedType: FeedType, filterType?: FilterType, fid?: number, fids?: string, parentUrl?: string, embedUrl?: string, withRecasts?: boolean, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'apiKey' is not null or undefined
assertParamExists('feed', 'apiKey', apiKey)
// verify required parameter 'feedType' is not null or undefined
Expand Down Expand Up @@ -87,6 +88,10 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration)
localVarQueryParameter['parent_url'] = parentUrl;
}

if (embedUrl !== undefined) {
localVarQueryParameter['embed_url'] = embedUrl;
}

if (withRecasts !== undefined) {
localVarQueryParameter['with_recasts'] = withRecasts;
}
Expand Down Expand Up @@ -133,14 +138,15 @@ export const FeedApiFp = function(configuration?: Configuration) {
* @param {number} [fid] (Optional) fid of user whose feed you want to create. By default, the API expects this field, except if you pass a filter_type
* @param {string} [fids] Used when filter_type&#x3D;fids . Create a feed based on a list of fids. Max array size is 250. Requires feed_type and filter_type.
* @param {string} [parentUrl] Used when filter_type&#x3D;parent_url can be used to fetch content under any parent url e.g. FIP-2 channels on Warpcast. Requires feed_type and filter_type
* @param {string} [embedUrl] Used when filter_type&#x3D;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 {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, withRecasts?: boolean, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FeedResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.feed(apiKey, feedType, filterType, fid, fids, parentUrl, withRecasts, limit, cursor, options);
async feed(apiKey: string, feedType: FeedType, filterType?: FilterType, fid?: number, fids?: string, parentUrl?: string, embedUrl?: string, withRecasts?: boolean, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FeedResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.feed(apiKey, feedType, filterType, fid, fids, parentUrl, embedUrl, withRecasts, limit, cursor, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
}
Expand All @@ -162,14 +168,15 @@ export const FeedApiFactory = function (configuration?: Configuration, basePath?
* @param {number} [fid] (Optional) fid of user whose feed you want to create. By default, the API expects this field, except if you pass a filter_type
* @param {string} [fids] Used when filter_type&#x3D;fids . Create a feed based on a list of fids. Max array size is 250. Requires feed_type and filter_type.
* @param {string} [parentUrl] Used when filter_type&#x3D;parent_url can be used to fetch content under any parent url e.g. FIP-2 channels on Warpcast. Requires feed_type and filter_type
* @param {string} [embedUrl] Used when filter_type&#x3D;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 {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, withRecasts?: boolean, limit?: number, cursor?: string, options?: any): AxiosPromise<FeedResponse> {
return localVarFp.feed(apiKey, feedType, filterType, fid, fids, parentUrl, withRecasts, limit, cursor, options).then((request) => request(axios, basePath));
feed(apiKey: string, feedType: FeedType, filterType?: FilterType, fid?: number, fids?: string, parentUrl?: string, embedUrl?: string, withRecasts?: boolean, limit?: number, cursor?: string, options?: any): AxiosPromise<FeedResponse> {
return localVarFp.feed(apiKey, feedType, filterType, fid, fids, parentUrl, embedUrl, withRecasts, limit, cursor, options).then((request) => request(axios, basePath));
},
};
};
Expand All @@ -190,14 +197,15 @@ export class FeedApi extends BaseAPI {
* @param {number} [fid] (Optional) fid of user whose feed you want to create. By default, the API expects this field, except if you pass a filter_type
* @param {string} [fids] Used when filter_type&#x3D;fids . Create a feed based on a list of fids. Max array size is 250. Requires feed_type and filter_type.
* @param {string} [parentUrl] Used when filter_type&#x3D;parent_url can be used to fetch content under any parent url e.g. FIP-2 channels on Warpcast. Requires feed_type and filter_type
* @param {string} [embedUrl] Used when filter_type&#x3D;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 {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, withRecasts?: boolean, limit?: number, cursor?: string, options?: AxiosRequestConfig) {
return FeedApiFp(this.configuration).feed(apiKey, feedType, filterType, fid, fids, parentUrl, withRecasts, limit, cursor, options).then((request) => request(this.axios, this.basePath));
public feed(apiKey: string, feedType: FeedType, filterType?: FilterType, fid?: number, fids?: string, parentUrl?: string, embedUrl?: string, withRecasts?: boolean, limit?: number, cursor?: string, options?: AxiosRequestConfig) {
return FeedApiFp(this.configuration).feed(apiKey, feedType, filterType, fid, fids, parentUrl, embedUrl, withRecasts, limit, cursor, options).then((request) => request(this.axios, this.basePath));
}
}
1 change: 1 addition & 0 deletions src/neynar-api/v2/openapi-farcaster/models/filter-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
export const FilterType = {
Fids: 'fids',
ParentUrl: 'parent_url',
EmbedUrl: 'embed_url',
GlobalTrending: 'global_trending'
} as const;

Expand Down
2 changes: 1 addition & 1 deletion src/oas
Submodule oas updated 1 files
+6 −0 src/v2/spec.yaml

0 comments on commit ab5146f

Please sign in to comment.