diff --git a/package.json b/package.json index e2a5ad7a..5a8d4e03 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@neynar/nodejs-sdk", - "version": "0.10.13", + "version": "0.11.0", "description": "SDK to interact with Neynar APIs (https://docs.neynar.com/)", "main": "./build/index.js", "types": "./build/index.d.ts", diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index 88c11714..ba5010dc 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -479,12 +479,11 @@ export class NeynarAPIClient { /** * Gets information about an array of casts. * See [Neynar documentation](https://docs.neynar.com/reference/casts) + * @param casts - Cast hashes (Comma Separated) * */ - public async fetchBulkCastsByHash( - castHashes: string[] - ): Promise { - return await this.clients.v2.fetchBulkCastsByHash(castHashes); + public async fetchBulkCastsByHash(casts: string): Promise { + return await this.clients.v2.fetchBulkCastsByHash(casts); } /** 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 76971efb..87d81ede 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 @@ -102,7 +102,7 @@ export class NeynarV2APIClient { basePath: basePath ? `${basePath}/v2` : BASE_PATH, apiKey: apiKey, }); - + this.apis = { signer: new SignerApi(config, undefined, axiosInstance), user: new UserApi(config, undefined, axiosInstance), @@ -343,13 +343,9 @@ export class NeynarV2APIClient { * See [Neynar documentation](https://docs.neynar.com/reference/casts) * */ - public async fetchBulkCastsByHash( - castHashes: string[] - ): Promise { + public async fetchBulkCastsByHash(casts: string): Promise { const response = await this.apis.cast.casts({ - getCastsReqBody: { - casts: castHashes.map((hash) => ({ hash })), - }, + casts, }); 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 aa156556..567b8924 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 @@ -48,8 +48,6 @@ import { DeleteCastReqBody } from "../models"; // @ts-ignore import { ErrorRes } from "../models"; // @ts-ignore -import { GetCastsReqBody } from "../models"; -// @ts-ignore import { OperationResponse } from "../models"; // @ts-ignore import { PostCastReqBody } from "../models"; @@ -128,16 +126,16 @@ export const CastApiAxiosParamCreator = function ( /** * Retrieve multiple casts using their respective hashes. * @summary Gets information about an array of casts - * @param {GetCastsReqBody} getCastsReqBody + * @param {string} casts Hashes of the cast to be retrived (Comma separated) * @param {*} [options] Override http request option. * @throws {RequiredError} */ casts: async ( - getCastsReqBody: GetCastsReqBody, + casts: string, options: AxiosRequestConfig = {} ): Promise => { - // verify required parameter 'getCastsReqBody' is not null or undefined - assertParamExists("casts", "getCastsReqBody", getCastsReqBody); + // verify required parameter 'casts' is not null or undefined + assertParamExists("casts", "casts", casts); const localVarPath = `/farcaster/casts`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -154,6 +152,10 @@ export const CastApiAxiosParamCreator = function ( const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; + if (casts !== undefined) { + localVarQueryParameter["casts"] = casts; + } + // authentication ApiKeyAuth required await setApiKeyToObject( localVarHeaderParameter, @@ -161,8 +163,6 @@ export const CastApiAxiosParamCreator = function ( configuration ); - localVarHeaderParameter["Content-Type"] = "application/json"; - setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; @@ -171,11 +171,6 @@ export const CastApiAxiosParamCreator = function ( ...headersFromBaseOptions, ...options.headers, }; - localVarRequestOptions.data = serializeDataIfNeeded( - getCastsReqBody, - localVarRequestOptions, - configuration - ); return { url: toPathString(localVarUrlObj), @@ -183,9 +178,7 @@ export const CastApiAxiosParamCreator = function ( }; }, /** - * Delete an existing cast. - * (In order to delete a cast `signer_uuid` must be approved) - * + * 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. @@ -338,18 +331,18 @@ export const CastApiFp = function (configuration?: Configuration) { /** * Retrieve multiple casts using their respective hashes. * @summary Gets information about an array of casts - * @param {GetCastsReqBody} getCastsReqBody + * @param {string} casts Hashes of the cast to be retrived (Comma separated) * @param {*} [options] Override http request option. * @throws {RequiredError} */ async casts( - getCastsReqBody: GetCastsReqBody, + casts: string, options?: AxiosRequestConfig ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.casts( - getCastsReqBody, + casts, options ); return createRequestFunction( @@ -360,8 +353,7 @@ export const CastApiFp = function (configuration?: Configuration) { ); }, /** - * Delete an existing cast. - * (In order to delete a cast `signer_uuid` must be approved) + * 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. @@ -455,12 +447,11 @@ export const CastApiFactory = function ( options?: AxiosRequestConfig ): AxiosPromise { return localVarFp - .casts(requestParameters.getCastsReqBody, options) + .casts(requestParameters.casts, options) .then((request) => request(axios, basePath)); }, /** - * Delete an existing cast. - * (In order to delete a cast `signer_uuid` must be approved) + * Delete an existing cast. \\ (In order to delete a cast `signer_uuid` must be approved) * @summary Delete a cast * @param {CastApiDeleteCastRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. @@ -519,12 +510,13 @@ export interface CastApiCastRequest { * @interface CastApiCastsRequest */ export interface CastApiCastsRequest { + /** - * - * @type {GetCastsReqBody} + * Hashes of the cast to be retrived (Comma separated) + * @type {string} * @memberof CastApiCasts */ - readonly getCastsReqBody: GetCastsReqBody; + readonly casts: string; } /** @@ -592,13 +584,12 @@ export class CastApi extends BaseAPI { options?: AxiosRequestConfig ) { return CastApiFp(this.configuration) - .casts(requestParameters.getCastsReqBody, options) + .casts(requestParameters.casts, options) .then((request) => request(this.axios, this.basePath)); } /** - * Delete an existing cast. - * (In order to delete a cast `signer_uuid` must be approved) + * Delete an existing cast. \\ (In order to delete a cast `signer_uuid` must be approved) * @summary Delete a cast * @param {CastApiDeleteCastRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. diff --git a/src/oas b/src/oas index 42a103fe..47474c45 160000 --- a/src/oas +++ b/src/oas @@ -1 +1 @@ -Subproject commit 42a103fec631dcda36c7db53d495332f626e5940 +Subproject commit 47474c45fa9c51ae9be7b81cea56021eb4d30da1