From dbd9ec29fe0da7a97c2cdf0dc02a96a42093ab73 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Mon, 6 Nov 2023 10:29:02 +0530 Subject: [PATCH 1/9] Sync up OAS --- src/oas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oas b/src/oas index 26e36bf9..b0beae1c 160000 --- a/src/oas +++ b/src/oas @@ -1 +1 @@ -Subproject commit 26e36bf9e270255655a5ddf11818c20613ec5019 +Subproject commit b0beae1c3fb9b5fc57be8a5f0a98d45b40285b98 From d19a06c1a0eae0d5c303257f7e8201900478aa23 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Mon, 6 Nov 2023 10:41:19 +0530 Subject: [PATCH 2/9] Sync up changes for v1 specs --- package.json | 2 +- .../neynar-v1-api/openapi/.openapi-generator/FILES | 1 - src/neynar-api/neynar-v1-api/openapi/apis/cast-api.ts | 8 ++++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index e02d0066..74db11b4 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "scripts": { "clean": "del-cli ./build/*", "build": "yarn run clean && tsc", - "generate:neynar-oas": "rm -rf src/neynar-api/neynar-v1-api/openapi-tmp; openapi-generator-cli generate -i src/oas/src/v1/spec.yaml -g typescript-axios -o src/neynar-api/neynar-v1-api/openapi-tmp --config src/oas/openapi-generator-config.json", + "generate:neynar-oas": "rm -rf src/neynar-api/neynar-v1-api/openapi-tmp; openapi-generator-cli generate -i src/oas/src/v1/spec.yaml -g typescript-axios -o src/neynar-api/neynar-v1-api/openapi --config src/oas/openapi-generator-config.json", "generate:neynar-oas-v2-farcaster": "rm -rf src/neynar-api/neynar-v2-api/openapi-farcaster-tmp; openapi-generator-cli generate -i src/oas/src/v2/spec.yaml -g typescript-axios -o src/neynar-api/neynar-v2-api/openapi-farcaster --config src/oas/openapi-generator-config.json" }, "author": "Neynar", diff --git a/src/neynar-api/neynar-v1-api/openapi/.openapi-generator/FILES b/src/neynar-api/neynar-v1-api/openapi/.openapi-generator/FILES index 7b829a39..c26a6b56 100644 --- a/src/neynar-api/neynar-v1-api/openapi/.openapi-generator/FILES +++ b/src/neynar-api/neynar-v1-api/openapi/.openapi-generator/FILES @@ -1,6 +1,5 @@ .gitignore .npmignore -.openapi-generator-ignore api.ts apis/cast-api.ts apis/follows-api.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/apis/cast-api.ts b/src/neynar-api/neynar-v1-api/openapi/apis/cast-api.ts index 4760b8ad..74b3994c 100644 --- a/src/neynar-api/neynar-v1-api/openapi/apis/cast-api.ts +++ b/src/neynar-api/neynar-v1-api/openapi/apis/cast-api.ts @@ -56,7 +56,7 @@ export const CastApiAxiosParamCreator = function ( ) { return { /** - * Gets the most recent casts for a user in reverse-chronological order + * Gets all casts, including root cast and all replies for a given thread hash. No limit the depth of replies. * @summary Retrieve all casts in a given thread hash * @param {string} threadHash The hash of the thread to retrieve casts from. * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. @@ -328,7 +328,7 @@ export const CastApiFp = function (configuration?: Configuration) { const localVarAxiosParamCreator = CastApiAxiosParamCreator(configuration); return { /** - * Gets the most recent casts for a user in reverse-chronological order + * Gets all casts, including root cast and all replies for a given thread hash. No limit the depth of replies. * @summary Retrieve all casts in a given thread hash * @param {string} threadHash The hash of the thread to retrieve casts from. * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. @@ -469,7 +469,7 @@ export const CastApiFactory = function ( const localVarFp = CastApiFp(configuration); return { /** - * Gets the most recent casts for a user in reverse-chronological order + * Gets all casts, including root cast and all replies for a given thread hash. No limit the depth of replies. * @summary Retrieve all casts in a given thread hash * @param {CastApiAllCastsInThreadRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. @@ -667,7 +667,7 @@ export interface CastApiRecentCastsRequest { */ export class CastApi extends BaseAPI { /** - * Gets the most recent casts for a user in reverse-chronological order + * Gets all casts, including root cast and all replies for a given thread hash. No limit the depth of replies. * @summary Retrieve all casts in a given thread hash * @param {CastApiAllCastsInThreadRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. From f066a3de50e8ea15db3bd086b3b88e0306348621 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Mon, 6 Nov 2023 10:53:59 +0530 Subject: [PATCH 3/9] Change description for fetchCastsInThread --- src/neynar-api/neynar-v1-api/neynar-api-v1-client.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/neynar-api/neynar-v1-api/neynar-api-v1-client.ts b/src/neynar-api/neynar-v1-api/neynar-api-v1-client.ts index cd55e058..4e0a657a 100644 --- a/src/neynar-api/neynar-v1-api/neynar-api-v1-client.ts +++ b/src/neynar-api/neynar-v1-api/neynar-api-v1-client.ts @@ -210,7 +210,7 @@ export class NeynarV1APIClient { } /** - * Fetches casts in a given thread. + * Gets all casts, including root cast and all replies for a given thread hash. No limit the depth of replies. * See [Neynar documentation](https://docs.neynar.com/reference/all-casts-in-thread-v1) * Note that the parent provided by the caller is included in the response. * @@ -384,7 +384,7 @@ export class NeynarV1APIClient { */ public async fetchCastReactions( castOrCastHash: Cast | string, - options?: { viewerFid?: number; limit?: number, cursor?: string } + options?: { viewerFid?: number; limit?: number; cursor?: string } ): Promise { let castHash: string; if (typeof castOrCastHash === "string") { From 3c9155c1511efa46f3c459380626c25ae722da87 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Mon, 6 Nov 2023 11:17:59 +0530 Subject: [PATCH 4/9] Sync up v2 farcaster apis with oas --- .../neynar-v2-api/neynar-api-v2-client.ts | 4 +++- .../openapi-farcaster/apis/cast-api.ts | 18 +++++++------- .../openapi-farcaster/apis/feed-api.ts | 24 ++++++++++++++++--- 3 files changed, 33 insertions(+), 13 deletions(-) diff --git a/src/neynar-api/neynar-v2-api/neynar-api-v2-client.ts b/src/neynar-api/neynar-v2-api/neynar-api-v2-client.ts index 577072c4..43c69bdc 100644 --- a/src/neynar-api/neynar-v2-api/neynar-api-v2-client.ts +++ b/src/neynar-api/neynar-v2-api/neynar-api-v2-client.ts @@ -313,7 +313,7 @@ export class NeynarV2APIClient { // ------------ Cast ------------ /** - * Gets information about an individual cast. + * Gets information about an individual cast by passing in a Warpcast web URL or cast hash * See [Neynar documentation](https://docs.neynar.com/reference/cast) * */ @@ -479,6 +479,7 @@ export class NeynarV2APIClient { parentUrl?: string; limit?: number; cursor?: string; + withRecasts?: boolean; } ): Promise { const response = await this.apis.feed.feed({ @@ -489,6 +490,7 @@ export class NeynarV2APIClient { parentUrl: options?.parentUrl, cursor: options?.cursor, limit: options?.limit, + withRecasts: options?.withRecasts, }); return response.data; } diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/cast-api.ts b/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/cast-api.ts index ea86bcbc..aa156556 100644 --- a/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/cast-api.ts +++ b/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/cast-api.ts @@ -64,8 +64,8 @@ export const CastApiAxiosParamCreator = function ( ) { return { /** - * Gets information about an individual cast by passing in a web URL or cast hash - * @summary Retrieve cast for a given hash + * Gets information about an individual cast by passing in a Warpcast web URL or cast hash + * @summary Retrieve cast for a given hash or Warpcast URL * @param {CastParamType} type * @param {string} identifier Cast identifier (Its either a url or a hash) * @param {*} [options] Override http request option. @@ -185,7 +185,7 @@ export const CastApiAxiosParamCreator = function ( /** * Delete an existing cast. * (In order to delete a cast `signer_uuid` must be approved) - * + * * @summary Delete a cast * @param {DeleteCastReqBody} deleteCastReqBody * @param {*} [options] Override http request option. @@ -309,8 +309,8 @@ export const CastApiFp = function (configuration?: Configuration) { const localVarAxiosParamCreator = CastApiAxiosParamCreator(configuration); return { /** - * Gets information about an individual cast by passing in a web URL or cast hash - * @summary Retrieve cast for a given hash + * Gets information about an individual cast by passing in a Warpcast web URL or cast hash + * @summary Retrieve cast for a given hash or Warpcast URL * @param {CastParamType} type * @param {string} identifier Cast identifier (Its either a url or a hash) * @param {*} [options] Override http request option. @@ -429,8 +429,8 @@ export const CastApiFactory = function ( const localVarFp = CastApiFp(configuration); return { /** - * Gets information about an individual cast by passing in a web URL or cast hash - * @summary Retrieve cast for a given hash + * Gets information about an individual cast by passing in a Warpcast web URL or cast hash + * @summary Retrieve cast for a given hash or Warpcast URL * @param {CastApiCastRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -563,8 +563,8 @@ export interface CastApiPostCastRequest { */ export class CastApi extends BaseAPI { /** - * Gets information about an individual cast by passing in a web URL or cast hash - * @summary Retrieve cast for a given hash + * Gets information about an individual cast by passing in a Warpcast web URL or cast hash + * @summary Retrieve cast for a given hash or Warpcast URL * @param {CastApiCastRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/feed-api.ts b/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/feed-api.ts index 4ad0530c..7066a846 100644 --- a/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/feed-api.ts +++ b/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/feed-api.ts @@ -58,7 +58,8 @@ export const FeedApiAxiosParamCreator = function ( * @param {string} [fids] Used when filter_type=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=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} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {number} [limit] Number of results to retrieve (default 25, max 100) + * @param {boolean} [withRecasts] Include recasts in the response, true by default * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -70,6 +71,7 @@ export const FeedApiAxiosParamCreator = function ( parentUrl?: string, cursor?: string, limit?: number, + withRecasts?: boolean, options: AxiosRequestConfig = {} ): Promise => { // verify required parameter 'fid' is not null or undefined @@ -125,6 +127,10 @@ export const FeedApiAxiosParamCreator = function ( localVarQueryParameter["limit"] = limit; } + if (withRecasts !== undefined) { + localVarQueryParameter["with_recasts"] = withRecasts; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; @@ -158,7 +164,8 @@ export const FeedApiFp = function (configuration?: Configuration) { * @param {string} [fids] Used when filter_type=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=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} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {number} [limit] Number of results to retrieve (default 25, max 100) + * @param {boolean} [withRecasts] Include recasts in the response, true by default * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -170,6 +177,7 @@ export const FeedApiFp = function (configuration?: Configuration) { parentUrl?: string, cursor?: string, limit?: number, + withRecasts?: boolean, options?: AxiosRequestConfig ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise @@ -182,6 +190,7 @@ export const FeedApiFp = function (configuration?: Configuration) { parentUrl, cursor, limit, + withRecasts, options ); return createRequestFunction( @@ -225,6 +234,7 @@ export const FeedApiFactory = function ( requestParameters.parentUrl, requestParameters.cursor, requestParameters.limit, + requestParameters.withRecasts, options ) .then((request) => request(axios, basePath)); @@ -281,11 +291,18 @@ export interface FeedApiFeedRequest { readonly cursor?: string; /** - * Number of results to retrieve (default 25, max 150) + * Number of results to retrieve (default 25, max 100) * @type {number} * @memberof FeedApiFeed */ readonly limit?: number; + + /** + * Include recasts in the response, true by default + * @type {boolean} + * @memberof FeedApiFeed + */ + readonly withRecasts?: boolean; } /** @@ -316,6 +333,7 @@ export class FeedApi extends BaseAPI { requestParameters.parentUrl, requestParameters.cursor, requestParameters.limit, + requestParameters.withRecasts, options ) .then((request) => request(this.axios, this.basePath)); From 134930d416709a039dfe352a12f30e1eec96a6f9 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Mon, 6 Nov 2023 11:42:36 +0530 Subject: [PATCH 5/9] Update scripts --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 74db11b4..6228a4db 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,9 @@ "scripts": { "clean": "del-cli ./build/*", "build": "yarn run clean && tsc", - "generate:neynar-oas": "rm -rf src/neynar-api/neynar-v1-api/openapi-tmp; openapi-generator-cli generate -i src/oas/src/v1/spec.yaml -g typescript-axios -o src/neynar-api/neynar-v1-api/openapi --config src/oas/openapi-generator-config.json", - "generate:neynar-oas-v2-farcaster": "rm -rf src/neynar-api/neynar-v2-api/openapi-farcaster-tmp; openapi-generator-cli generate -i src/oas/src/v2/spec.yaml -g typescript-axios -o src/neynar-api/neynar-v2-api/openapi-farcaster --config src/oas/openapi-generator-config.json" + "generate:neynar-oas": "openapi-generator-cli generate -i src/oas/src/v1/spec.yaml -g typescript-axios -o src/neynar-api/neynar-v1-api/openapi --config src/oas/openapi-generator-config.json", + "generate:neynar-oas-v2-farcaster": "openapi-generator-cli generate -i src/oas/src/v2/spec.yaml -g typescript-axios -o src/neynar-api/neynar-v2-api/openapi-farcaster --config src/oas/openapi-generator-config.json", + "generate:neynar-oas-v2-recommendation": "openapi-generator-cli generate -i src/oas/src/v2/recommendation/spec.yaml -g typescript-axios -o src/neynar-api/neynar-v2-api/openapi-recommendation --config src/oas/openapi-generator-config.json" }, "author": "Neynar", "license": "ISC", From e7ef31bfe2473d801c099f00397a8376ce1c6c50 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Mon, 6 Nov 2023 11:44:54 +0530 Subject: [PATCH 6/9] Generate code for recommendation api --- .../openapi-recommendation/.gitignore | 4 + .../openapi-recommendation/.npmignore | 1 + .../.openapi-generator-ignore | 23 ++ .../.openapi-generator/FILES | 18 ++ .../.openapi-generator/VERSION | 1 + .../openapi-recommendation/api.ts | 18 ++ .../openapi-recommendation/apis/nftapi.ts | 239 ++++++++++++++++++ .../openapi-recommendation/base.ts | 72 ++++++ .../openapi-recommendation/common.ts | 150 +++++++++++ .../openapi-recommendation/configuration.ts | 101 ++++++++ .../openapi-recommendation/git_push.sh | 57 +++++ .../openapi-recommendation/index.ts | 18 ++ .../models/active-status.ts | 31 +++ .../models/error-res.ts | 48 ++++ .../fetch-relevant-mints200-response.ts | 33 +++ .../openapi-recommendation/models/index.ts | 7 + .../models/relevant-mint.ts | 57 +++++ .../models/user-profile-bio.ts | 30 +++ .../models/user-profile.ts | 33 +++ .../openapi-recommendation/models/user.ts | 92 +++++++ 20 files changed, 1033 insertions(+) create mode 100644 src/neynar-api/neynar-v2-api/openapi-recommendation/.gitignore create mode 100644 src/neynar-api/neynar-v2-api/openapi-recommendation/.npmignore create mode 100644 src/neynar-api/neynar-v2-api/openapi-recommendation/.openapi-generator-ignore create mode 100644 src/neynar-api/neynar-v2-api/openapi-recommendation/.openapi-generator/FILES create mode 100644 src/neynar-api/neynar-v2-api/openapi-recommendation/.openapi-generator/VERSION create mode 100644 src/neynar-api/neynar-v2-api/openapi-recommendation/api.ts create mode 100644 src/neynar-api/neynar-v2-api/openapi-recommendation/apis/nftapi.ts create mode 100644 src/neynar-api/neynar-v2-api/openapi-recommendation/base.ts create mode 100644 src/neynar-api/neynar-v2-api/openapi-recommendation/common.ts create mode 100644 src/neynar-api/neynar-v2-api/openapi-recommendation/configuration.ts create mode 100644 src/neynar-api/neynar-v2-api/openapi-recommendation/git_push.sh create mode 100644 src/neynar-api/neynar-v2-api/openapi-recommendation/index.ts create mode 100644 src/neynar-api/neynar-v2-api/openapi-recommendation/models/active-status.ts create mode 100644 src/neynar-api/neynar-v2-api/openapi-recommendation/models/error-res.ts create mode 100644 src/neynar-api/neynar-v2-api/openapi-recommendation/models/fetch-relevant-mints200-response.ts create mode 100644 src/neynar-api/neynar-v2-api/openapi-recommendation/models/index.ts create mode 100644 src/neynar-api/neynar-v2-api/openapi-recommendation/models/relevant-mint.ts create mode 100644 src/neynar-api/neynar-v2-api/openapi-recommendation/models/user-profile-bio.ts create mode 100644 src/neynar-api/neynar-v2-api/openapi-recommendation/models/user-profile.ts create mode 100644 src/neynar-api/neynar-v2-api/openapi-recommendation/models/user.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/.gitignore b/src/neynar-api/neynar-v2-api/openapi-recommendation/.gitignore new file mode 100644 index 00000000..149b5765 --- /dev/null +++ b/src/neynar-api/neynar-v2-api/openapi-recommendation/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/.npmignore b/src/neynar-api/neynar-v2-api/openapi-recommendation/.npmignore new file mode 100644 index 00000000..999d88df --- /dev/null +++ b/src/neynar-api/neynar-v2-api/openapi-recommendation/.npmignore @@ -0,0 +1 @@ +# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm \ No newline at end of file diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/.openapi-generator-ignore b/src/neynar-api/neynar-v2-api/openapi-recommendation/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/src/neynar-api/neynar-v2-api/openapi-recommendation/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/.openapi-generator/FILES b/src/neynar-api/neynar-v2-api/openapi-recommendation/.openapi-generator/FILES new file mode 100644 index 00000000..d1df1ba7 --- /dev/null +++ b/src/neynar-api/neynar-v2-api/openapi-recommendation/.openapi-generator/FILES @@ -0,0 +1,18 @@ +.gitignore +.npmignore +.openapi-generator-ignore +api.ts +apis/nftapi.ts +base.ts +common.ts +configuration.ts +git_push.sh +index.ts +models/active-status.ts +models/error-res.ts +models/fetch-relevant-mints200-response.ts +models/index.ts +models/relevant-mint.ts +models/user-profile-bio.ts +models/user-profile.ts +models/user.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/.openapi-generator/VERSION b/src/neynar-api/neynar-v2-api/openapi-recommendation/.openapi-generator/VERSION new file mode 100644 index 00000000..73a86b19 --- /dev/null +++ b/src/neynar-api/neynar-v2-api/openapi-recommendation/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.0.1 \ No newline at end of file diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/api.ts b/src/neynar-api/neynar-v2-api/openapi-recommendation/api.ts new file mode 100644 index 00000000..7ac94b1e --- /dev/null +++ b/src/neynar-api/neynar-v2-api/openapi-recommendation/api.ts @@ -0,0 +1,18 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Recommendation API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +export * from './apis/nftapi'; + diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/apis/nftapi.ts b/src/neynar-api/neynar-v2-api/openapi-recommendation/apis/nftapi.ts new file mode 100644 index 00000000..4fc6843b --- /dev/null +++ b/src/neynar-api/neynar-v2-api/openapi-recommendation/apis/nftapi.ts @@ -0,0 +1,239 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Recommendation API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios"; +import globalAxios from "axios"; +// Some imports not used depending on template conditions +// @ts-ignore +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; +// @ts-ignore +import { + BASE_PATH, + COLLECTION_FORMATS, + RequestArgs, + BaseAPI, + RequiredError, +} from "../base"; +// @ts-ignore +import { ErrorRes } from "../models"; +// @ts-ignore +import { FetchRelevantMints200Response } from "../models"; +/** + * NFTApi - axios parameter creator + * @export + */ +export const NFTApiAxiosParamCreator = function ( + configuration?: Configuration +) { + return { + /** + * Fetches all mint actions relevant for a contract address (and optionally tokenId for ERC1155s) given a user\'s ethereum address + * @summary Relevant Mints for a User + * @param {string} apiKey API key required for authentication. + * @param {string} address + * @param {string} contractAddress + * @param {string} [tokenId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + fetchRelevantMints: async ( + apiKey: string, + address: string, + contractAddress: string, + tokenId?: string, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists("fetchRelevantMints", "apiKey", apiKey); + // verify required parameter 'address' is not null or undefined + assertParamExists("fetchRelevantMints", "address", address); + // verify required parameter 'contractAddress' is not null or undefined + assertParamExists( + "fetchRelevantMints", + "contractAddress", + contractAddress + ); + const localVarPath = `/nft/relevant_mints`; + // 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 (address !== undefined) { + localVarQueryParameter["address"] = address; + } + + if (contractAddress !== undefined) { + localVarQueryParameter["contract_address"] = contractAddress; + } + + if (tokenId !== undefined) { + localVarQueryParameter["token_id"] = tokenId; + } + + if (apiKey != null) { + localVarHeaderParameter["api_key"] = String(apiKey); + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * NFTApi - functional programming interface + * @export + */ +export const NFTApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = NFTApiAxiosParamCreator(configuration); + return { + /** + * Fetches all mint actions relevant for a contract address (and optionally tokenId for ERC1155s) given a user\'s ethereum address + * @summary Relevant Mints for a User + * @param {string} apiKey API key required for authentication. + * @param {string} address + * @param {string} contractAddress + * @param {string} [tokenId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async fetchRelevantMints( + apiKey: string, + address: string, + contractAddress: string, + tokenId?: string, + options?: AxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.fetchRelevantMints( + apiKey, + address, + contractAddress, + tokenId, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + }; +}; + +/** + * NFTApi - factory interface + * @export + */ +export const NFTApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = NFTApiFp(configuration); + return { + /** + * Fetches all mint actions relevant for a contract address (and optionally tokenId for ERC1155s) given a user\'s ethereum address + * @summary Relevant Mints for a User + * @param {string} apiKey API key required for authentication. + * @param {string} address + * @param {string} contractAddress + * @param {string} [tokenId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + fetchRelevantMints( + apiKey: string, + address: string, + contractAddress: string, + tokenId?: string, + options?: any + ): AxiosPromise { + return localVarFp + .fetchRelevantMints(apiKey, address, contractAddress, tokenId, options) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * NFTApi - object-oriented interface + * @export + * @class NFTApi + * @extends {BaseAPI} + */ +export class NFTApi extends BaseAPI { + /** + * Fetches all mint actions relevant for a contract address (and optionally tokenId for ERC1155s) given a user\'s ethereum address + * @summary Relevant Mints for a User + * @param {string} apiKey API key required for authentication. + * @param {string} address + * @param {string} contractAddress + * @param {string} [tokenId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NFTApi + */ + public fetchRelevantMints( + apiKey: string, + address: string, + contractAddress: string, + tokenId?: string, + options?: AxiosRequestConfig + ) { + return NFTApiFp(this.configuration) + .fetchRelevantMints(apiKey, address, contractAddress, tokenId, options) + .then((request) => request(this.axios, this.basePath)); + } +} diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/base.ts b/src/neynar-api/neynar-v2-api/openapi-recommendation/base.ts new file mode 100644 index 00000000..7caa6ee8 --- /dev/null +++ b/src/neynar-api/neynar-v2-api/openapi-recommendation/base.ts @@ -0,0 +1,72 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Recommendation API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from './configuration'; +// Some imports not used depending on template conditions +// @ts-ignore +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; + +export const BASE_PATH = "https://api.neynar.com/v2".replace(/\/+$/, ""); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +/** + * + * @export + * @interface RequestArgs + */ +export interface RequestArgs { + url: string; + options: AxiosRequestConfig; +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + protected configuration: Configuration | undefined; + + constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath || this.basePath; + } + } +}; + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + constructor(public field: string, msg?: string) { + super(msg); + this.name = "RequiredError" + } +} diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/common.ts b/src/neynar-api/neynar-v2-api/openapi-recommendation/common.ts new file mode 100644 index 00000000..8cd7382d --- /dev/null +++ b/src/neynar-api/neynar-v2-api/openapi-recommendation/common.ts @@ -0,0 +1,150 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Recommendation API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from "./configuration"; +import type { RequestArgs } from "./base"; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from "./base"; + +/** + * + * @export + */ +export const DUMMY_BASE_URL = 'https://example.com' + +/** + * + * @throws {RequiredError} + * @export + */ +export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); + } +} + +/** + * + * @export + */ +export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } +} + +/** + * + * @export + */ +export const setBasicAuthToObject = function (object: any, configuration?: Configuration) { + if (configuration && (configuration.username || configuration.password)) { + object["auth"] = { username: configuration.username, password: configuration.password }; + } +} + +/** + * + * @export + */ +export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + object["Authorization"] = "Bearer " + accessToken; + } +} + +/** + * + * @export + */ +export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken; + object["Authorization"] = "Bearer " + localVarAccessTokenValue; + } +} + +function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { + if (parameter == null) return; + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); + } + else { + Object.keys(parameter).forEach(currentKey => + setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) + ); + } + } + else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } + else { + urlSearchParams.set(key, parameter); + } + } +} + +/** + * + * @export + */ +export const setSearchParams = function (url: URL, ...objects: any[]) { + const searchParams = new URLSearchParams(url.search); + setFlattenedQueryParams(searchParams, objects); + url.search = searchParams.toString(); +} + +/** + * + * @export + */ +export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) { + const nonString = typeof value !== 'string'; + const needsSerialization = nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers['Content-Type']) + : nonString; + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : (value || ""); +} + +/** + * + * @export + */ +export const toPathString = function (url: URL) { + return url.pathname + url.search + url.hash +} + +/** + * + * @export + */ +export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { + return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || axios.defaults.baseURL || basePath) + axiosArgs.url}; + return axios.request(axiosRequestArgs); + }; +} diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/configuration.ts b/src/neynar-api/neynar-v2-api/openapi-recommendation/configuration.ts new file mode 100644 index 00000000..93da376e --- /dev/null +++ b/src/neynar-api/neynar-v2-api/openapi-recommendation/configuration.ts @@ -0,0 +1,101 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Recommendation API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface ConfigurationParameters { + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + username?: string; + password?: string; + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); + basePath?: string; + baseOptions?: any; + formDataCtor?: new () => any; +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + /** + * base options for axios calls + * + * @type {any} + * @memberof Configuration + */ + baseOptions?: any; + /** + * The FormData constructor that will be used to create multipart form data + * requests. You can inject this here so that execution environments that + * do not support the FormData class can still run the generated client. + * + * @type {new () => FormData} + */ + formDataCtor?: new () => any; + + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + this.baseOptions = param.baseOptions; + this.formDataCtor = param.formDataCtor; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } +} diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/git_push.sh b/src/neynar-api/neynar-v2-api/openapi-recommendation/git_push.sh new file mode 100644 index 00000000..f53a75d4 --- /dev/null +++ b/src/neynar-api/neynar-v2-api/openapi-recommendation/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/index.ts b/src/neynar-api/neynar-v2-api/openapi-recommendation/index.ts new file mode 100644 index 00000000..73a6ba4a --- /dev/null +++ b/src/neynar-api/neynar-v2-api/openapi-recommendation/index.ts @@ -0,0 +1,18 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Recommendation API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export * from "./api"; +export * from "./configuration"; +export * from "./models"; diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/models/active-status.ts b/src/neynar-api/neynar-v2-api/openapi-recommendation/models/active-status.ts new file mode 100644 index 00000000..9f4429b8 --- /dev/null +++ b/src/neynar-api/neynar-v2-api/openapi-recommendation/models/active-status.ts @@ -0,0 +1,31 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Recommendation API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * The status of a user. - active: The user is currently active. - inactive: The user is not currently active. + * @export + * @enum {string} + */ + +export const ActiveStatus = { + Active: 'active', + Inactive: 'inactive' +} as const; + +export type ActiveStatus = typeof ActiveStatus[keyof typeof ActiveStatus]; + + + diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/models/error-res.ts b/src/neynar-api/neynar-v2-api/openapi-recommendation/models/error-res.ts new file mode 100644 index 00000000..ee4319b8 --- /dev/null +++ b/src/neynar-api/neynar-v2-api/openapi-recommendation/models/error-res.ts @@ -0,0 +1,48 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Recommendation API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * Returns ErrorRes metadata + * @export + * @interface ErrorRes + */ +export interface ErrorRes { + /** + * + * @type {string} + * @memberof ErrorRes + */ + 'code'?: string; + /** + * + * @type {string} + * @memberof ErrorRes + */ + 'message': string; + /** + * + * @type {string} + * @memberof ErrorRes + */ + 'property'?: string; + /** + * + * @type {number} + * @memberof ErrorRes + */ + 'status'?: number; +} + diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/models/fetch-relevant-mints200-response.ts b/src/neynar-api/neynar-v2-api/openapi-recommendation/models/fetch-relevant-mints200-response.ts new file mode 100644 index 00000000..4e62a421 --- /dev/null +++ b/src/neynar-api/neynar-v2-api/openapi-recommendation/models/fetch-relevant-mints200-response.ts @@ -0,0 +1,33 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Recommendation API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { RelevantMint } from './relevant-mint'; + +/** + * + * @export + * @interface FetchRelevantMints200Response + */ +export interface FetchRelevantMints200Response { + /** + * + * @type {Array} + * @memberof FetchRelevantMints200Response + */ + 'mints': Array; +} + diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/models/index.ts b/src/neynar-api/neynar-v2-api/openapi-recommendation/models/index.ts new file mode 100644 index 00000000..1f8837f8 --- /dev/null +++ b/src/neynar-api/neynar-v2-api/openapi-recommendation/models/index.ts @@ -0,0 +1,7 @@ +export * from './active-status'; +export * from './error-res'; +export * from './fetch-relevant-mints200-response'; +export * from './relevant-mint'; +export * from './user'; +export * from './user-profile'; +export * from './user-profile-bio'; diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/models/relevant-mint.ts b/src/neynar-api/neynar-v2-api/openapi-recommendation/models/relevant-mint.ts new file mode 100644 index 00000000..9d4fb5cc --- /dev/null +++ b/src/neynar-api/neynar-v2-api/openapi-recommendation/models/relevant-mint.ts @@ -0,0 +1,57 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Recommendation API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { User } from './user'; + +/** + * A mint object relevant to the user + * @export + * @interface RelevantMint + */ +export interface RelevantMint { + /** + * Ethereum address + * @type {string} + * @memberof RelevantMint + */ + 'contract_address': string; + /** + * + * @type {string} + * @memberof RelevantMint + */ + 'token_id': string; + /** + * + * @type {number} + * @memberof RelevantMint + */ + 'block_number': number; + /** + * + * @type {string} + * @memberof RelevantMint + */ + 'tx_hash': string; + /** + * + * @type {User} + * @memberof RelevantMint + */ + 'minter': User; +} + diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/models/user-profile-bio.ts b/src/neynar-api/neynar-v2-api/openapi-recommendation/models/user-profile-bio.ts new file mode 100644 index 00000000..3402e114 --- /dev/null +++ b/src/neynar-api/neynar-v2-api/openapi-recommendation/models/user-profile-bio.ts @@ -0,0 +1,30 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Recommendation API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface UserProfileBio + */ +export interface UserProfileBio { + /** + * + * @type {string} + * @memberof UserProfileBio + */ + 'text': string; +} + diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/models/user-profile.ts b/src/neynar-api/neynar-v2-api/openapi-recommendation/models/user-profile.ts new file mode 100644 index 00000000..91f37f74 --- /dev/null +++ b/src/neynar-api/neynar-v2-api/openapi-recommendation/models/user-profile.ts @@ -0,0 +1,33 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Recommendation API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { UserProfileBio } from './user-profile-bio'; + +/** + * + * @export + * @interface UserProfile + */ +export interface UserProfile { + /** + * + * @type {UserProfileBio} + * @memberof UserProfile + */ + 'bio': UserProfileBio; +} + diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/models/user.ts b/src/neynar-api/neynar-v2-api/openapi-recommendation/models/user.ts new file mode 100644 index 00000000..88a72209 --- /dev/null +++ b/src/neynar-api/neynar-v2-api/openapi-recommendation/models/user.ts @@ -0,0 +1,92 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Recommendation API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { ActiveStatus } from './active-status'; +// May contain unused imports in some cases +// @ts-ignore +import { UserProfile } from './user-profile'; + +/** + * + * @export + * @interface User + */ +export interface User { + /** + * User identifier (unsigned integer) + * @type {number} + * @memberof User + */ + 'fid': number; + /** + * + * @type {string} + * @memberof User + */ + 'username': string; + /** + * + * @type {string} + * @memberof User + */ + 'display_name': string; + /** + * Ethereum address + * @type {string} + * @memberof User + */ + 'custody_address'?: string; + /** + * The URL of the user\'s profile picture + * @type {string} + * @memberof User + */ + 'pfp_url': string; + /** + * + * @type {UserProfile} + * @memberof User + */ + 'profile': UserProfile; + /** + * The number of followers the user has. + * @type {number} + * @memberof User + */ + 'follower_count': number; + /** + * The number of users the user is following. + * @type {number} + * @memberof User + */ + 'following_count': number; + /** + * + * @type {Array} + * @memberof User + */ + 'verifications': Array; + /** + * + * @type {ActiveStatus} + * @memberof User + */ + 'activeStatus': ActiveStatus; +} + + + From f5653dc193b2bc73f3da7a919ee6aeca9695aeb2 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Mon, 6 Nov 2023 12:09:40 +0530 Subject: [PATCH 7/9] Refactor nftapi --- .../openapi-recommendation/apis/nftapi.ts | 76 ++++++++++++------- 1 file changed, 49 insertions(+), 27 deletions(-) diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/apis/nftapi.ts b/src/neynar-api/neynar-v2-api/openapi-recommendation/apis/nftapi.ts index 4fc6843b..3064f677 100644 --- a/src/neynar-api/neynar-v2-api/openapi-recommendation/apis/nftapi.ts +++ b/src/neynar-api/neynar-v2-api/openapi-recommendation/apis/nftapi.ts @@ -52,7 +52,6 @@ export const NFTApiAxiosParamCreator = function ( /** * Fetches all mint actions relevant for a contract address (and optionally tokenId for ERC1155s) given a user\'s ethereum address * @summary Relevant Mints for a User - * @param {string} apiKey API key required for authentication. * @param {string} address * @param {string} contractAddress * @param {string} [tokenId] @@ -60,14 +59,11 @@ export const NFTApiAxiosParamCreator = function ( * @throws {RequiredError} */ fetchRelevantMints: async ( - apiKey: string, address: string, contractAddress: string, tokenId?: string, options: AxiosRequestConfig = {} ): Promise => { - // verify required parameter 'apiKey' is not null or undefined - assertParamExists("fetchRelevantMints", "apiKey", apiKey); // verify required parameter 'address' is not null or undefined assertParamExists("fetchRelevantMints", "address", address); // verify required parameter 'contractAddress' is not null or undefined @@ -104,9 +100,12 @@ export const NFTApiAxiosParamCreator = function ( localVarQueryParameter["token_id"] = tokenId; } - if (apiKey != null) { - localVarHeaderParameter["api_key"] = String(apiKey); - } + // authentication ApiKeyAuth required + await setApiKeyToObject( + localVarHeaderParameter, + "api_key", + configuration + ); setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = @@ -135,7 +134,6 @@ export const NFTApiFp = function (configuration?: Configuration) { /** * Fetches all mint actions relevant for a contract address (and optionally tokenId for ERC1155s) given a user\'s ethereum address * @summary Relevant Mints for a User - * @param {string} apiKey API key required for authentication. * @param {string} address * @param {string} contractAddress * @param {string} [tokenId] @@ -143,7 +141,6 @@ export const NFTApiFp = function (configuration?: Configuration) { * @throws {RequiredError} */ async fetchRelevantMints( - apiKey: string, address: string, contractAddress: string, tokenId?: string, @@ -156,7 +153,6 @@ export const NFTApiFp = function (configuration?: Configuration) { > { const localVarAxiosArgs = await localVarAxiosParamCreator.fetchRelevantMints( - apiKey, address, contractAddress, tokenId, @@ -186,27 +182,53 @@ export const NFTApiFactory = function ( /** * Fetches all mint actions relevant for a contract address (and optionally tokenId for ERC1155s) given a user\'s ethereum address * @summary Relevant Mints for a User - * @param {string} apiKey API key required for authentication. - * @param {string} address - * @param {string} contractAddress - * @param {string} [tokenId] + * @param {NFTApiGetRelaventMintsRequest} [requestParameters] Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ fetchRelevantMints( - apiKey: string, - address: string, - contractAddress: string, - tokenId?: string, + requestParameters: NFTApiGetRelaventMintsRequest, options?: any ): AxiosPromise { return localVarFp - .fetchRelevantMints(apiKey, address, contractAddress, tokenId, options) + .fetchRelevantMints( + requestParameters.address, + requestParameters.contractAddress, + requestParameters.tokenId, + options + ) .then((request) => request(axios, basePath)); }, }; }; +/** + * Request parameters to fetch relevant mints operation in NFTApi. + * @export + * @interface NFTApiGetRelaventMintsRequest + */ +export interface NFTApiGetRelaventMintsRequest { + /** + * Ethereum address + * @type {string} + * @memberof NFTApiGetRelaventMints + */ + readonly address: string; + + /** + * Ethereum address + * @type {string} + * @memberof NFTApiGetRelaventMints + */ + readonly contractAddress: string; + + /** + * @type {string} + * @memberof NFTApiGetRelaventMints + */ + readonly tokenId?: string; +} + /** * NFTApi - object-oriented interface * @export @@ -217,23 +239,23 @@ export class NFTApi extends BaseAPI { /** * Fetches all mint actions relevant for a contract address (and optionally tokenId for ERC1155s) given a user\'s ethereum address * @summary Relevant Mints for a User - * @param {string} apiKey API key required for authentication. - * @param {string} address - * @param {string} contractAddress + * @param {NFTApiGetRelaventMintsRequest} [requestParameters] Request parameters. * @param {string} [tokenId] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof NFTApi */ public fetchRelevantMints( - apiKey: string, - address: string, - contractAddress: string, - tokenId?: string, + requestParameters: NFTApiGetRelaventMintsRequest, options?: AxiosRequestConfig ) { return NFTApiFp(this.configuration) - .fetchRelevantMints(apiKey, address, contractAddress, tokenId, options) + .fetchRelevantMints( + requestParameters.address, + requestParameters.contractAddress, + requestParameters.tokenId, + options + ) .then((request) => request(this.axios, this.basePath)); } } From f284eaffddfc60ce91f4930ff1fe761b5d85d371 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Mon, 6 Nov 2023 12:16:18 +0530 Subject: [PATCH 8/9] Add fetchRelevantMints API --- .../neynar-v2-api/neynar-api-v2-client.ts | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/neynar-api/neynar-v2-api/neynar-api-v2-client.ts b/src/neynar-api/neynar-v2-api/neynar-api-v2-client.ts index 43c69bdc..fd95929d 100644 --- a/src/neynar-api/neynar-v2-api/neynar-api-v2-client.ts +++ b/src/neynar-api/neynar-v2-api/neynar-api-v2-client.ts @@ -39,6 +39,10 @@ import { import axios, { AxiosError, AxiosInstance } from "axios"; import { silentLogger, Logger } from "../common/logger"; import type { SetRequired } from "type-fest"; +import { + FetchRelevantMints200Response, + NFTApi, +} from "./openapi-recommendation"; const BASE_PATH = "https://api.neynar.com/v2"; @@ -53,6 +57,7 @@ export class NeynarV2APIClient { feed: FeedApi; notifications: NotificationsApi; follows: FollowsApi; + nft: NFTApi; }; /** @@ -102,6 +107,7 @@ export class NeynarV2APIClient { feed: new FeedApi(config, undefined, axiosInstance), notifications: new NotificationsApi(config, undefined, axiosInstance), follows: new FollowsApi(config, undefined, axiosInstance), + nft: new NFTApi(config, undefined, axiosInstance), }; } @@ -531,4 +537,24 @@ export class NeynarV2APIClient { }); return response.data; } + + // ------------ Recommendation ------------ + + /** + * Fetches all mint actions relevant for a contract address (and optionally tokenId for ERC1155s) given a user's ethereum address + * See [Neynar documentation](https://docs.neynar.com/reference/fetch-relevant-mints) + * + */ + public async fetchRelevantMints( + address: string, + contractAddress: string, + tokenId?: string + ): Promise { + const response = await this.apis.nft.fetchRelevantMints({ + address, + contractAddress, + tokenId, + }); + return response.data; + } } From c6cc8f2789124183447cdf635fb9da02a91c4eac Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Mon, 6 Nov 2023 12:16:58 +0530 Subject: [PATCH 9/9] Patch update: v0.9.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6228a4db..9aedee30 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@neynar/nodejs-sdk", - "version": "0.9.0", + "version": "0.9.1", "description": "SDK to interact with Neynar APIs (https://docs.neynar.com/)", "main": "./build/index.js", "types": "./build/index.d.ts",