Skip to content

Commit

Permalink
Merge pull request #211 from neynarxyz/tdb/fix-v1.65.0
Browse files Browse the repository at this point in the history
Fix v1.65.0
  • Loading branch information
tybook authored Oct 21, 2024
2 parents acf39d8 + 0ab2b3c commit 524b69c
Show file tree
Hide file tree
Showing 34 changed files with 310 additions and 1,130 deletions.
5 changes: 0 additions & 5 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ Auto-generated code is located in the following directories:

- `src/neynar-api/v1/openapi`
- `src/neynar-api/v2/openapi-farcaster`
- `src/neynar-api/v2/openapi-recommendation`
- `src/neynar-api/v2/openapi-stp`

These are generated using [openapi-generator-cli](https://github.com/OpenAPITools/openapi-generator-cli). To make changes, update the OpenAPI Specification (OAS) in the [OAS Repository](https://github.com/neynarxyz/oas). After updating the OAS, synchronize the OAS in your local clone of the SDK repository.
Expand All @@ -50,10 +49,6 @@ yarn generate:neynar-oas-v1-farcaster
```bash
yarn generate:neynar-oas-v2-farcaster
```
- For recommendation APIs
```bash
yarn generate:neynar-oas-v2-recommendation
```
- For STP APIs
```bash
yarn generate:neynar-oas-v2-stp
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"build": "yarn run clean && tsc",
"generate:neynar-oas-v1-farcaster": "del-cli src/neynar-api/v1/openapi; openapi-generator-cli generate -i src/oas/src/v1/spec.yaml -g typescript-axios -o src/neynar-api/v1/openapi --config src/oas/openapi-generator-config.json",
"generate:neynar-oas-v2-farcaster": "del-cli src/neynar-api/v2/openapi-farcaster; openapi-generator-cli generate -i src/oas/src/v2/spec.yaml -g typescript-axios -o src/neynar-api/v2/openapi-farcaster --config src/oas/openapi-generator-config.json",
"generate:neynar-oas-v2-recommendation": "del-cli src/neynar-api/v2/openapi-recommendation; openapi-generator-cli generate -i src/oas/src/v2/recommendation/spec.yaml -g typescript-axios -o src/neynar-api/v2/openapi-recommendation --config src/oas/openapi-generator-config.json",
"generate:neynar-oas-v2-stp": "del-cli src/neynar-api/v2/openapi-stp; openapi-generator-cli generate -i src/oas/src/v2/stp/spec.yaml -g typescript-axios -o src/neynar-api/v2/openapi-stp --config src/oas/openapi-generator-config.json"
},
"author": "Neynar",
Expand All @@ -39,4 +38,4 @@
"neynar",
"nodejs"
]
}
}
41 changes: 3 additions & 38 deletions src/neynar-api/neynar-api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
ReactionType,
OperationResponse,
BulkFollowResponse,
EmbeddedCast,
Embed,
FeedResponse,
NotificationsResponse,
RelevantFollowersResponse,
Expand Down Expand Up @@ -103,7 +103,6 @@ import {
AllCastsInThreadResponse,
} from "./v1/openapi";

import { RelevantMints } from "./v2/openapi-recommendation";
import { AxiosInstance } from "axios";
import { silentLogger, Logger } from "./common/logger";
import { NeynarV1APIClient } from "./v1";
Expand Down Expand Up @@ -1608,7 +1607,7 @@ export class NeynarAPIClient {
* @param {string} signerUuid - UUID of the signer associated with the user posting the cast.
* @param {string} text - The text content of the cast.
* @param {Object} [options] - Optional parameters for the cast.
* @param {Array<EmbeddedCast>} [options.embeds] - An array of embeds to be included in the cast.
* @param {Array<Embed>} [options.embeds] - An array of embeds to be included in the cast.
* @param {string} [options.replyTo] - The URL or hash of the parent cast if this is a reply.
* @param {string} [options.channelId] - Channel ID of the channel where the cast is to be posted. e.g. neynar, farcaster, warpcast.
* @param {string} [options.idem] - An Idempotency key to prevent duplicate publishing of events. Recommended format is a 16-character string generated by the developer at the time of publishing. Use the same idem key on retry attempts.
Expand All @@ -1635,7 +1634,7 @@ export class NeynarAPIClient {
signerUuid: string,
text: string,
options?: {
embeds?: EmbeddedCast[];
embeds?: Embed[];
replyTo?: string;
channelId?: string;
idem?: string;
Expand Down Expand Up @@ -3596,40 +3595,6 @@ export class NeynarAPIClient {
return await this.clients.v2.fetchWebhooks();
}

// ------------ Recommendation ------------

/**
* Fetches all mint actions relevant for a given contract address and user's Ethereum address,
* with an optional focus on a specific tokenId for ERC1155 contracts. This method is useful for
* tracking NFT minting activities linked to specific contracts and user addresses.
*
* @param {string} address - The Ethereum address of the user.
* @param {string} contractAddress - The contract address associated with the NFTs.
* @param {Object} [options] - Optional parameters for the request.
* @param {string} [options.tokenId] - (Optional) The tokenId, particularly for ERC1155 contract types.
*
* @returns {Promise<RelevantMints>} A promise that resolves to a `RelevantMints` object,
* containing information about mint actions relevant to the user and contract.
*
* @example
* // Example: Fetch mint actions for a contract address with a specific tokenId
* client.fetchRelevantMints('0x5a927ac639636e534b678e81768ca19e2c6280b7', '0xe8e0e543a3dd32d366cb756fa4d112f30172bcb1', { tokenId: '1' }).then(response => {
* console.log('Relevant Mint Actions:', response);
* });
*
* For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/fetch-relevant-mints).
*/
public async fetchRelevantMints(
address: string,
contractAddress: string,
options?: { tokenId?: string }
): Promise<RelevantMints> {
return await this.clients.v2.fetchRelevantMints(
address,
contractAddress,
options
);
}

// ------------ Additional utility methods ------------

Expand Down
64 changes: 32 additions & 32 deletions src/neynar-api/v1/openapi/apis/cast-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export const CastApiAxiosParamCreator = function (configuration?: Configuration)
return {
/**
* Now deprecated, use [v2/cast/conversation](https://docs.neynar.com/reference/cast-conversation). Gets all casts, including root cast and all replies for a given thread hash. No limit the depth of replies.
* @summary DEPRECATED - Retrieve all casts in a given thread hash
* @param {string} threadHash The hash of the thread to retrieve casts from.
* @summary DEPRECATED - Fetch all casts in a given thread hash
* @param {string} threadHash The hash of the thread to fetch casts from.
* @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information.
* @param {*} [options] Override http request option.
* @deprecated
Expand Down Expand Up @@ -85,7 +85,7 @@ export const CastApiAxiosParamCreator = function (configuration?: Configuration)
},
/**
* Now deprecated, use [v2/cast](https://docs.neynar.com/reference/cast). Gets information about an individual cast
* @summary DEPRECATED - Retrieve cast for a given hash
* @summary DEPRECATED - Fetch cast for a given hash
* @param {string} hash Cast hash
* @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information.
* @param {*} [options] Override http request option.
Expand Down Expand Up @@ -131,11 +131,11 @@ export const CastApiAxiosParamCreator = function (configuration?: Configuration)
},
/**
* Now deprecated, use [/v2/farcaster/feed/user/casts](https://docs.neynar.com/reference/feed-user-casts) instead
* @summary DEPRECATED - Retrieve casts for a given user
* @summary DEPRECATED - Fetch casts for a given user
* @param {number} fid fid of a user
* @param {string} [parentUrl] A cast can be part of a certain channel. The channel is identified by &#x60;parent_url&#x60;. All casts in the channel ladder up to the same parent_url.
* @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information.
* @param {number} [limit] Number of results to retrieve (default 25, max 150)
* @param {number} [limit] Number of results to fetch (default 25, max 150)
* @param {string} [cursor] Pagination cursor.
* @param {*} [options] Override http request option.
* @deprecated
Expand Down Expand Up @@ -191,10 +191,10 @@ export const CastApiAxiosParamCreator = function (configuration?: Configuration)
};
},
/**
* Get a list of casts from the protocol in reverse chronological order based on timestamp
* @summary Get Recent Casts
* Fetch a list of casts from the protocol in reverse chronological order based on timestamp
* @summary Fetch Recent Casts
* @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information.
* @param {number} [limit] Number of results to retrieve (default 25, max 100)
* @param {number} [limit] Number of results to fetch (default 25, max 100)
* @param {string} [cursor] Pagination cursor.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
Expand Down Expand Up @@ -250,8 +250,8 @@ export const CastApiFp = function(configuration?: Configuration) {
return {
/**
* Now deprecated, use [v2/cast/conversation](https://docs.neynar.com/reference/cast-conversation). Gets all casts, including root cast and all replies for a given thread hash. No limit the depth of replies.
* @summary DEPRECATED - Retrieve all casts in a given thread hash
* @param {string} threadHash The hash of the thread to retrieve casts from.
* @summary DEPRECATED - Fetch all casts in a given thread hash
* @param {string} threadHash The hash of the thread to fetch casts from.
* @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information.
* @param {*} [options] Override http request option.
* @deprecated
Expand All @@ -263,7 +263,7 @@ export const CastApiFp = function(configuration?: Configuration) {
},
/**
* Now deprecated, use [v2/cast](https://docs.neynar.com/reference/cast). Gets information about an individual cast
* @summary DEPRECATED - Retrieve cast for a given hash
* @summary DEPRECATED - Fetch cast for a given hash
* @param {string} hash Cast hash
* @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information.
* @param {*} [options] Override http request option.
Expand All @@ -276,11 +276,11 @@ export const CastApiFp = function(configuration?: Configuration) {
},
/**
* Now deprecated, use [/v2/farcaster/feed/user/casts](https://docs.neynar.com/reference/feed-user-casts) instead
* @summary DEPRECATED - Retrieve casts for a given user
* @summary DEPRECATED - Fetch casts for a given user
* @param {number} fid fid of a user
* @param {string} [parentUrl] A cast can be part of a certain channel. The channel is identified by &#x60;parent_url&#x60;. All casts in the channel ladder up to the same parent_url.
* @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information.
* @param {number} [limit] Number of results to retrieve (default 25, max 150)
* @param {number} [limit] Number of results to fetch (default 25, max 150)
* @param {string} [cursor] Pagination cursor.
* @param {*} [options] Override http request option.
* @deprecated
Expand All @@ -291,10 +291,10 @@ export const CastApiFp = function(configuration?: Configuration) {
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Get a list of casts from the protocol in reverse chronological order based on timestamp
* @summary Get Recent Casts
* Fetch a list of casts from the protocol in reverse chronological order based on timestamp
* @summary Fetch Recent Casts
* @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information.
* @param {number} [limit] Number of results to retrieve (default 25, max 100)
* @param {number} [limit] Number of results to fetch (default 25, max 100)
* @param {string} [cursor] Pagination cursor.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
Expand All @@ -315,8 +315,8 @@ export const CastApiFactory = function (configuration?: Configuration, basePath?
return {
/**
* Now deprecated, use [v2/cast/conversation](https://docs.neynar.com/reference/cast-conversation). Gets all casts, including root cast and all replies for a given thread hash. No limit the depth of replies.
* @summary DEPRECATED - Retrieve all casts in a given thread hash
* @param {string} threadHash The hash of the thread to retrieve casts from.
* @summary DEPRECATED - Fetch all casts in a given thread hash
* @param {string} threadHash The hash of the thread to fetch casts from.
* @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information.
* @param {*} [options] Override http request option.
* @deprecated
Expand All @@ -327,7 +327,7 @@ export const CastApiFactory = function (configuration?: Configuration, basePath?
},
/**
* Now deprecated, use [v2/cast](https://docs.neynar.com/reference/cast). Gets information about an individual cast
* @summary DEPRECATED - Retrieve cast for a given hash
* @summary DEPRECATED - Fetch cast for a given hash
* @param {string} hash Cast hash
* @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information.
* @param {*} [options] Override http request option.
Expand All @@ -339,11 +339,11 @@ export const CastApiFactory = function (configuration?: Configuration, basePath?
},
/**
* Now deprecated, use [/v2/farcaster/feed/user/casts](https://docs.neynar.com/reference/feed-user-casts) instead
* @summary DEPRECATED - Retrieve casts for a given user
* @summary DEPRECATED - Fetch casts for a given user
* @param {number} fid fid of a user
* @param {string} [parentUrl] A cast can be part of a certain channel. The channel is identified by &#x60;parent_url&#x60;. All casts in the channel ladder up to the same parent_url.
* @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information.
* @param {number} [limit] Number of results to retrieve (default 25, max 150)
* @param {number} [limit] Number of results to fetch (default 25, max 150)
* @param {string} [cursor] Pagination cursor.
* @param {*} [options] Override http request option.
* @deprecated
Expand All @@ -353,10 +353,10 @@ export const CastApiFactory = function (configuration?: Configuration, basePath?
return localVarFp.casts(fid, parentUrl, viewerFid, limit, cursor, options).then((request) => request(axios, basePath));
},
/**
* Get a list of casts from the protocol in reverse chronological order based on timestamp
* @summary Get Recent Casts
* Fetch a list of casts from the protocol in reverse chronological order based on timestamp
* @summary Fetch Recent Casts
* @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information.
* @param {number} [limit] Number of results to retrieve (default 25, max 100)
* @param {number} [limit] Number of results to fetch (default 25, max 100)
* @param {string} [cursor] Pagination cursor.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
Expand All @@ -376,8 +376,8 @@ export const CastApiFactory = function (configuration?: Configuration, basePath?
export class CastApi extends BaseAPI {
/**
* Now deprecated, use [v2/cast/conversation](https://docs.neynar.com/reference/cast-conversation). Gets all casts, including root cast and all replies for a given thread hash. No limit the depth of replies.
* @summary DEPRECATED - Retrieve all casts in a given thread hash
* @param {string} threadHash The hash of the thread to retrieve casts from.
* @summary DEPRECATED - Fetch all casts in a given thread hash
* @param {string} threadHash The hash of the thread to fetch casts from.
* @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information.
* @param {*} [options] Override http request option.
* @deprecated
Expand All @@ -390,7 +390,7 @@ export class CastApi extends BaseAPI {

/**
* Now deprecated, use [v2/cast](https://docs.neynar.com/reference/cast). Gets information about an individual cast
* @summary DEPRECATED - Retrieve cast for a given hash
* @summary DEPRECATED - Fetch cast for a given hash
* @param {string} hash Cast hash
* @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information.
* @param {*} [options] Override http request option.
Expand All @@ -404,11 +404,11 @@ export class CastApi extends BaseAPI {

/**
* Now deprecated, use [/v2/farcaster/feed/user/casts](https://docs.neynar.com/reference/feed-user-casts) instead
* @summary DEPRECATED - Retrieve casts for a given user
* @summary DEPRECATED - Fetch casts for a given user
* @param {number} fid fid of a user
* @param {string} [parentUrl] A cast can be part of a certain channel. The channel is identified by &#x60;parent_url&#x60;. All casts in the channel ladder up to the same parent_url.
* @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information.
* @param {number} [limit] Number of results to retrieve (default 25, max 150)
* @param {number} [limit] Number of results to fetch (default 25, max 150)
* @param {string} [cursor] Pagination cursor.
* @param {*} [options] Override http request option.
* @deprecated
Expand All @@ -420,10 +420,10 @@ export class CastApi extends BaseAPI {
}

/**
* Get a list of casts from the protocol in reverse chronological order based on timestamp
* @summary Get Recent Casts
* Fetch a list of casts from the protocol in reverse chronological order based on timestamp
* @summary Fetch Recent Casts
* @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information.
* @param {number} [limit] Number of results to retrieve (default 25, max 100)
* @param {number} [limit] Number of results to fetch (default 25, max 100)
* @param {string} [cursor] Pagination cursor.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
Expand Down
Loading

0 comments on commit 524b69c

Please sign in to comment.