From cc4a13a46e10bbeaa0f2a3abe7a4b64ac702bb54 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Tue, 21 Nov 2023 17:39:08 +0530 Subject: [PATCH 01/77] Rename folder name form neynar-v1-api to v1 and neynar-v2-api to v2 --- package.json | 8 ++++---- src/neynar-api/{neynar-v1-api => v1}/index.ts | 0 .../{neynar-v1-api => v1}/neynar-api-v1-client.ts | 0 src/neynar-api/{neynar-v1-api => v1}/openapi/.gitignore | 0 src/neynar-api/{neynar-v1-api => v1}/openapi/.npmignore | 0 .../openapi/.openapi-generator-ignore | 0 .../openapi/.openapi-generator/FILES | 0 .../openapi/.openapi-generator/VERSION | 0 src/neynar-api/{neynar-v1-api => v1}/openapi/api.ts | 0 .../{neynar-v1-api => v1}/openapi/apis/cast-api.ts | 0 .../{neynar-v1-api => v1}/openapi/apis/follows-api.ts | 0 .../openapi/apis/notifications-api.ts | 0 .../{neynar-v1-api => v1}/openapi/apis/reactions-api.ts | 0 .../{neynar-v1-api => v1}/openapi/apis/user-api.ts | 0 .../openapi/apis/verification-api.ts | 0 src/neynar-api/{neynar-v1-api => v1}/openapi/base.ts | 0 src/neynar-api/{neynar-v1-api => v1}/openapi/common.ts | 0 .../{neynar-v1-api => v1}/openapi/configuration.ts | 0 src/neynar-api/{neynar-v1-api => v1}/openapi/git_push.sh | 0 src/neynar-api/{neynar-v1-api => v1}/openapi/index.ts | 0 .../{neynar-v1-api => v1}/openapi/models/active-status.ts | 0 .../openapi/models/all-casts-in-thread-response-result.ts | 0 .../openapi/models/all-casts-in-thread-response.ts | 0 .../openapi/models/cast-author-one-of.ts | 0 .../{neynar-v1-api => v1}/openapi/models/cast-author.ts | 0 .../openapi/models/cast-likes-response-result.ts | 0 .../openapi/models/cast-likes-response.ts | 0 .../openapi/models/cast-parent-author.ts | 0 .../openapi/models/cast-reactions-response-result.ts | 0 .../openapi/models/cast-reactions-response.ts | 0 .../openapi/models/cast-recaster-response-result.ts | 0 .../openapi/models/cast-recaster-response.ts | 0 .../openapi/models/cast-response-result.ts | 0 .../{neynar-v1-api => v1}/openapi/models/cast-response.ts | 0 .../{neynar-v1-api => v1}/openapi/models/cast-type.ts | 0 .../models/cast-with-interactions-reactions-or-recasts.ts | 0 .../openapi/models/cast-with-interactions-replies.ts | 0 .../openapi/models/cast-with-interactions.ts | 0 .../{neynar-v1-api => v1}/openapi/models/cast.ts | 0 .../openapi/models/casts-response-result.ts | 0 .../openapi/models/casts-response.ts | 0 .../openapi/models/custody-address-response-result.ts | 0 .../openapi/models/custody-address-response.ts | 0 .../{neynar-v1-api => v1}/openapi/models/embed-url.ts | 0 .../{neynar-v1-api => v1}/openapi/models/error-res.ts | 0 .../openapi/models/follow-response-result.ts | 0 .../openapi/models/follow-response-user.ts | 0 .../openapi/models/follow-response.ts | 0 .../{neynar-v1-api => v1}/openapi/models/index.ts | 0 .../models/mentions-and-replies-response-result.ts | 0 .../openapi/models/mentions-and-replies-response.ts | 0 .../{neynar-v1-api => v1}/openapi/models/next-cursor.ts | 0 .../{neynar-v1-api => v1}/openapi/models/reaction-type.ts | 0 .../openapi/models/reaction-with-cast-meta-cast.ts | 0 .../openapi/models/reaction-with-cast-meta-reaction.ts | 0 .../openapi/models/reaction-with-cast-meta.ts | 0 .../{neynar-v1-api => v1}/openapi/models/reaction.ts | 0 .../openapi/models/reactions-and-recasts-notification.ts | 0 .../models/reactions-and-recasts-response-result.ts | 0 .../openapi/models/reactions-and-recasts-response.ts | 0 .../{neynar-v1-api => v1}/openapi/models/reactor-pfp.ts | 0 .../openapi/models/reactor-viewer-context.ts | 0 .../{neynar-v1-api => v1}/openapi/models/reactor.ts | 0 .../{neynar-v1-api => v1}/openapi/models/recaster-pfp.ts | 0 .../openapi/models/recaster-profile-bio.ts | 0 .../openapi/models/recaster-profile.ts | 0 .../openapi/models/recaster-viewer-context.ts | 0 .../{neynar-v1-api => v1}/openapi/models/recaster.ts | 0 .../openapi/models/recent-casts-response.ts | 0 .../openapi/models/recent-users-response-result.ts | 0 .../openapi/models/recent-users-response.ts | 0 .../openapi/models/user-cast-like-response-result.ts | 0 .../openapi/models/user-cast-like-response.ts | 0 .../{neynar-v1-api => v1}/openapi/models/user-pfp.ts | 0 .../openapi/models/user-profile-bio.ts | 0 .../{neynar-v1-api => v1}/openapi/models/user-profile.ts | 0 .../{neynar-v1-api => v1}/openapi/models/user.ts | 0 .../openapi/models/user200-response-result.ts | 0 .../openapi/models/user200-response.ts | 0 .../openapi/models/verification-response-result.ts | 0 .../openapi/models/verification-response.ts | 0 .../openapi/models/viewer-context.ts | 0 src/neynar-api/{neynar-v2-api => v2}/index.ts | 0 .../{neynar-v2-api => v2}/neynar-api-v2-client.ts | 0 .../{neynar-v2-api => v2}/openapi-farcaster/.gitignore | 0 .../{neynar-v2-api => v2}/openapi-farcaster/.npmignore | 0 .../openapi-farcaster/.openapi-generator-ignore | 0 .../openapi-farcaster/.openapi-generator/FILES | 0 .../openapi-farcaster/.openapi-generator/VERSION | 0 .../{neynar-v2-api => v2}/openapi-farcaster/api.ts | 0 .../openapi-farcaster/apis/cast-api.ts | 0 .../openapi-farcaster/apis/feed-api.ts | 0 .../openapi-farcaster/apis/follows-api.ts | 0 .../openapi-farcaster/apis/notifications-api.ts | 0 .../openapi-farcaster/apis/reaction-api.ts | 0 .../openapi-farcaster/apis/signer-api.ts | 0 .../openapi-farcaster/apis/user-api.ts | 0 .../{neynar-v2-api => v2}/openapi-farcaster/base.ts | 0 .../{neynar-v2-api => v2}/openapi-farcaster/common.ts | 0 .../openapi-farcaster/configuration.ts | 0 .../{neynar-v2-api => v2}/openapi-farcaster/git_push.sh | 0 .../{neynar-v2-api => v2}/openapi-farcaster/index.ts | 0 .../openapi-farcaster/models/active-status.ts | 0 .../openapi-farcaster/models/add-verification-req-body.ts | 0 .../openapi-farcaster/models/bulk-follow-response.ts | 0 .../openapi-farcaster/models/cast-id.ts | 0 .../openapi-farcaster/models/cast-notification-type.ts | 0 .../openapi-farcaster/models/cast-param-type.ts | 0 .../openapi-farcaster/models/cast-parent-author.ts | 0 .../openapi-farcaster/models/cast-response.ts | 0 .../models/cast-with-interactions-reactions.ts | 0 .../models/cast-with-interactions-replies.ts | 0 .../openapi-farcaster/models/cast-with-interactions.ts | 0 .../openapi-farcaster/models/cast.ts | 0 .../openapi-farcaster/models/casts-response-result.ts | 0 .../openapi-farcaster/models/casts-response.ts | 0 .../openapi-farcaster/models/dehydrated-follower.ts | 0 .../openapi-farcaster/models/delete-cast-req-body.ts | 0 .../openapi-farcaster/models/embed-cast-id.ts | 0 .../openapi-farcaster/models/embed-url.ts | 0 .../openapi-farcaster/models/embedded-cast.ts | 0 .../openapi-farcaster/models/error-res.ts | 0 .../openapi-farcaster/models/feed-response.ts | 0 .../openapi-farcaster/models/follow-req-body.ts | 0 .../openapi-farcaster/models/follow-response.ts | 0 .../openapi-farcaster/models/get-casts-req-body.ts | 0 .../openapi-farcaster/models/hydrated-follower.ts | 0 .../openapi-farcaster/models/index.ts | 0 .../openapi-farcaster/models/individual-hash-obj.ts | 0 .../openapi-farcaster/models/next-cursor.ts | 0 .../openapi-farcaster/models/notification-follow.ts | 0 .../models/notification-reactions-cast.ts | 0 .../openapi-farcaster/models/notification-reactions.ts | 0 .../openapi-farcaster/models/notification.ts | 0 .../openapi-farcaster/models/notifications-response.ts | 0 .../openapi-farcaster/models/operation-response.ts | 0 .../openapi-farcaster/models/post-cast-req-body.ts | 0 .../models/post-cast-response-cast-author.ts | 0 .../openapi-farcaster/models/post-cast-response-cast.ts | 0 .../openapi-farcaster/models/post-cast-response.ts | 0 .../openapi-farcaster/models/profile-url-pfp.ts | 0 .../openapi-farcaster/models/profile-url.ts | 0 .../openapi-farcaster/models/reaction-like.ts | 0 .../openapi-farcaster/models/reaction-recast.ts | 0 .../openapi-farcaster/models/reaction-req-body.ts | 0 .../openapi-farcaster/models/reaction-type.ts | 0 .../models/register-signer-key-req-body.ts | 0 .../models/relevant-followers-response.ts | 0 .../models/remove-verification-req-body.ts | 0 .../openapi-farcaster/models/searched-user.ts | 0 .../openapi-farcaster/models/signer.ts | 0 .../openapi-farcaster/models/update-user-req-body.ts | 0 .../openapi-farcaster/models/user-bulk200-response.ts | 0 .../openapi-farcaster/models/user-dehydrated.ts | 0 .../openapi-farcaster/models/user-profile-bio.ts | 0 .../openapi-farcaster/models/user-profile.ts | 0 .../openapi-farcaster/models/user-response.ts | 0 .../models/user-search-response-result.ts | 0 .../openapi-farcaster/models/user-search-response.ts | 0 .../openapi-farcaster/models/user-viewer-context.ts | 0 .../openapi-farcaster/models/user.ts | 0 .../openapi-recommendation/.gitignore | 0 .../openapi-recommendation/.npmignore | 0 .../openapi-recommendation/.openapi-generator-ignore | 0 .../openapi-recommendation/.openapi-generator/FILES | 0 .../openapi-recommendation/.openapi-generator/VERSION | 0 .../{neynar-v2-api => v2}/openapi-recommendation/api.ts | 0 .../openapi-recommendation/apis/nftapi.ts | 0 .../{neynar-v2-api => v2}/openapi-recommendation/base.ts | 0 .../openapi-recommendation/common.ts | 0 .../openapi-recommendation/configuration.ts | 0 .../openapi-recommendation/git_push.sh | 0 .../{neynar-v2-api => v2}/openapi-recommendation/index.ts | 0 .../openapi-recommendation/models/active-status.ts | 0 .../openapi-recommendation/models/error-res.ts | 0 .../models/fetch-relevant-mints200-response.ts | 0 .../openapi-recommendation/models/index.ts | 0 .../openapi-recommendation/models/relevant-mint.ts | 0 .../openapi-recommendation/models/user-profile-bio.ts | 0 .../openapi-recommendation/models/user-profile.ts | 0 .../openapi-recommendation/models/user.ts | 0 181 files changed, 4 insertions(+), 4 deletions(-) rename src/neynar-api/{neynar-v1-api => v1}/index.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/neynar-api-v1-client.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/.gitignore (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/.npmignore (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/.openapi-generator-ignore (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/.openapi-generator/FILES (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/.openapi-generator/VERSION (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/api.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/apis/cast-api.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/apis/follows-api.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/apis/notifications-api.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/apis/reactions-api.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/apis/user-api.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/apis/verification-api.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/base.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/common.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/configuration.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/git_push.sh (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/index.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/active-status.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/all-casts-in-thread-response-result.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/all-casts-in-thread-response.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/cast-author-one-of.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/cast-author.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/cast-likes-response-result.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/cast-likes-response.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/cast-parent-author.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/cast-reactions-response-result.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/cast-reactions-response.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/cast-recaster-response-result.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/cast-recaster-response.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/cast-response-result.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/cast-response.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/cast-type.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/cast-with-interactions-reactions-or-recasts.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/cast-with-interactions-replies.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/cast-with-interactions.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/cast.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/casts-response-result.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/casts-response.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/custody-address-response-result.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/custody-address-response.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/embed-url.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/error-res.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/follow-response-result.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/follow-response-user.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/follow-response.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/index.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/mentions-and-replies-response-result.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/mentions-and-replies-response.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/next-cursor.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/reaction-type.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/reaction-with-cast-meta-cast.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/reaction-with-cast-meta-reaction.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/reaction-with-cast-meta.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/reaction.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/reactions-and-recasts-notification.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/reactions-and-recasts-response-result.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/reactions-and-recasts-response.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/reactor-pfp.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/reactor-viewer-context.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/reactor.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/recaster-pfp.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/recaster-profile-bio.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/recaster-profile.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/recaster-viewer-context.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/recaster.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/recent-casts-response.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/recent-users-response-result.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/recent-users-response.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/user-cast-like-response-result.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/user-cast-like-response.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/user-pfp.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/user-profile-bio.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/user-profile.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/user.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/user200-response-result.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/user200-response.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/verification-response-result.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/verification-response.ts (100%) rename src/neynar-api/{neynar-v1-api => v1}/openapi/models/viewer-context.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/index.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/neynar-api-v2-client.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/.gitignore (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/.npmignore (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/.openapi-generator-ignore (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/.openapi-generator/FILES (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/.openapi-generator/VERSION (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/api.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/apis/cast-api.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/apis/feed-api.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/apis/follows-api.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/apis/notifications-api.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/apis/reaction-api.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/apis/signer-api.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/apis/user-api.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/base.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/common.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/configuration.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/git_push.sh (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/index.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/active-status.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/add-verification-req-body.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/bulk-follow-response.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/cast-id.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/cast-notification-type.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/cast-param-type.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/cast-parent-author.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/cast-response.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/cast-with-interactions-reactions.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/cast-with-interactions-replies.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/cast-with-interactions.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/cast.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/casts-response-result.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/casts-response.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/dehydrated-follower.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/delete-cast-req-body.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/embed-cast-id.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/embed-url.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/embedded-cast.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/error-res.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/feed-response.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/follow-req-body.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/follow-response.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/get-casts-req-body.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/hydrated-follower.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/index.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/individual-hash-obj.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/next-cursor.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/notification-follow.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/notification-reactions-cast.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/notification-reactions.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/notification.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/notifications-response.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/operation-response.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/post-cast-req-body.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/post-cast-response-cast-author.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/post-cast-response-cast.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/post-cast-response.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/profile-url-pfp.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/profile-url.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/reaction-like.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/reaction-recast.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/reaction-req-body.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/reaction-type.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/register-signer-key-req-body.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/relevant-followers-response.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/remove-verification-req-body.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/searched-user.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/signer.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/update-user-req-body.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/user-bulk200-response.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/user-dehydrated.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/user-profile-bio.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/user-profile.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/user-response.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/user-search-response-result.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/user-search-response.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/user-viewer-context.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-farcaster/models/user.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-recommendation/.gitignore (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-recommendation/.npmignore (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-recommendation/.openapi-generator-ignore (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-recommendation/.openapi-generator/FILES (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-recommendation/.openapi-generator/VERSION (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-recommendation/api.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-recommendation/apis/nftapi.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-recommendation/base.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-recommendation/common.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-recommendation/configuration.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-recommendation/git_push.sh (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-recommendation/index.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-recommendation/models/active-status.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-recommendation/models/error-res.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-recommendation/models/fetch-relevant-mints200-response.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-recommendation/models/index.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-recommendation/models/relevant-mint.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-recommendation/models/user-profile-bio.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-recommendation/models/user-profile.ts (100%) rename src/neynar-api/{neynar-v2-api => v2}/openapi-recommendation/models/user.ts (100%) diff --git a/package.json b/package.json index 38cfdfb0..b26c9ba3 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,9 @@ "scripts": { "clean": "del-cli ./build/*", "build": "yarn run clean && tsc", - "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" + "generate:neynar-oas": "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": "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": "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" }, "author": "Neynar", "license": "ISC", @@ -26,4 +26,4 @@ "@openapitools/openapi-generator-cli": "^2.7.0", "axios": "^1.6.2" } -} \ No newline at end of file +} diff --git a/src/neynar-api/neynar-v1-api/index.ts b/src/neynar-api/v1/index.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/index.ts rename to src/neynar-api/v1/index.ts diff --git a/src/neynar-api/neynar-v1-api/neynar-api-v1-client.ts b/src/neynar-api/v1/neynar-api-v1-client.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/neynar-api-v1-client.ts rename to src/neynar-api/v1/neynar-api-v1-client.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/.gitignore b/src/neynar-api/v1/openapi/.gitignore similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/.gitignore rename to src/neynar-api/v1/openapi/.gitignore diff --git a/src/neynar-api/neynar-v1-api/openapi/.npmignore b/src/neynar-api/v1/openapi/.npmignore similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/.npmignore rename to src/neynar-api/v1/openapi/.npmignore diff --git a/src/neynar-api/neynar-v1-api/openapi/.openapi-generator-ignore b/src/neynar-api/v1/openapi/.openapi-generator-ignore similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/.openapi-generator-ignore rename to src/neynar-api/v1/openapi/.openapi-generator-ignore diff --git a/src/neynar-api/neynar-v1-api/openapi/.openapi-generator/FILES b/src/neynar-api/v1/openapi/.openapi-generator/FILES similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/.openapi-generator/FILES rename to src/neynar-api/v1/openapi/.openapi-generator/FILES diff --git a/src/neynar-api/neynar-v1-api/openapi/.openapi-generator/VERSION b/src/neynar-api/v1/openapi/.openapi-generator/VERSION similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/.openapi-generator/VERSION rename to src/neynar-api/v1/openapi/.openapi-generator/VERSION diff --git a/src/neynar-api/neynar-v1-api/openapi/api.ts b/src/neynar-api/v1/openapi/api.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/api.ts rename to src/neynar-api/v1/openapi/api.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/apis/cast-api.ts b/src/neynar-api/v1/openapi/apis/cast-api.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/apis/cast-api.ts rename to src/neynar-api/v1/openapi/apis/cast-api.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/apis/follows-api.ts b/src/neynar-api/v1/openapi/apis/follows-api.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/apis/follows-api.ts rename to src/neynar-api/v1/openapi/apis/follows-api.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/apis/notifications-api.ts b/src/neynar-api/v1/openapi/apis/notifications-api.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/apis/notifications-api.ts rename to src/neynar-api/v1/openapi/apis/notifications-api.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/apis/reactions-api.ts b/src/neynar-api/v1/openapi/apis/reactions-api.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/apis/reactions-api.ts rename to src/neynar-api/v1/openapi/apis/reactions-api.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/apis/user-api.ts b/src/neynar-api/v1/openapi/apis/user-api.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/apis/user-api.ts rename to src/neynar-api/v1/openapi/apis/user-api.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/apis/verification-api.ts b/src/neynar-api/v1/openapi/apis/verification-api.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/apis/verification-api.ts rename to src/neynar-api/v1/openapi/apis/verification-api.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/base.ts b/src/neynar-api/v1/openapi/base.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/base.ts rename to src/neynar-api/v1/openapi/base.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/common.ts b/src/neynar-api/v1/openapi/common.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/common.ts rename to src/neynar-api/v1/openapi/common.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/configuration.ts b/src/neynar-api/v1/openapi/configuration.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/configuration.ts rename to src/neynar-api/v1/openapi/configuration.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/git_push.sh b/src/neynar-api/v1/openapi/git_push.sh similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/git_push.sh rename to src/neynar-api/v1/openapi/git_push.sh diff --git a/src/neynar-api/neynar-v1-api/openapi/index.ts b/src/neynar-api/v1/openapi/index.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/index.ts rename to src/neynar-api/v1/openapi/index.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/active-status.ts b/src/neynar-api/v1/openapi/models/active-status.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/active-status.ts rename to src/neynar-api/v1/openapi/models/active-status.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/all-casts-in-thread-response-result.ts b/src/neynar-api/v1/openapi/models/all-casts-in-thread-response-result.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/all-casts-in-thread-response-result.ts rename to src/neynar-api/v1/openapi/models/all-casts-in-thread-response-result.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/all-casts-in-thread-response.ts b/src/neynar-api/v1/openapi/models/all-casts-in-thread-response.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/all-casts-in-thread-response.ts rename to src/neynar-api/v1/openapi/models/all-casts-in-thread-response.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast-author-one-of.ts b/src/neynar-api/v1/openapi/models/cast-author-one-of.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/cast-author-one-of.ts rename to src/neynar-api/v1/openapi/models/cast-author-one-of.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast-author.ts b/src/neynar-api/v1/openapi/models/cast-author.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/cast-author.ts rename to src/neynar-api/v1/openapi/models/cast-author.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast-likes-response-result.ts b/src/neynar-api/v1/openapi/models/cast-likes-response-result.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/cast-likes-response-result.ts rename to src/neynar-api/v1/openapi/models/cast-likes-response-result.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast-likes-response.ts b/src/neynar-api/v1/openapi/models/cast-likes-response.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/cast-likes-response.ts rename to src/neynar-api/v1/openapi/models/cast-likes-response.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast-parent-author.ts b/src/neynar-api/v1/openapi/models/cast-parent-author.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/cast-parent-author.ts rename to src/neynar-api/v1/openapi/models/cast-parent-author.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast-reactions-response-result.ts b/src/neynar-api/v1/openapi/models/cast-reactions-response-result.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/cast-reactions-response-result.ts rename to src/neynar-api/v1/openapi/models/cast-reactions-response-result.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast-reactions-response.ts b/src/neynar-api/v1/openapi/models/cast-reactions-response.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/cast-reactions-response.ts rename to src/neynar-api/v1/openapi/models/cast-reactions-response.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast-recaster-response-result.ts b/src/neynar-api/v1/openapi/models/cast-recaster-response-result.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/cast-recaster-response-result.ts rename to src/neynar-api/v1/openapi/models/cast-recaster-response-result.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast-recaster-response.ts b/src/neynar-api/v1/openapi/models/cast-recaster-response.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/cast-recaster-response.ts rename to src/neynar-api/v1/openapi/models/cast-recaster-response.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast-response-result.ts b/src/neynar-api/v1/openapi/models/cast-response-result.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/cast-response-result.ts rename to src/neynar-api/v1/openapi/models/cast-response-result.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast-response.ts b/src/neynar-api/v1/openapi/models/cast-response.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/cast-response.ts rename to src/neynar-api/v1/openapi/models/cast-response.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast-type.ts b/src/neynar-api/v1/openapi/models/cast-type.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/cast-type.ts rename to src/neynar-api/v1/openapi/models/cast-type.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast-with-interactions-reactions-or-recasts.ts b/src/neynar-api/v1/openapi/models/cast-with-interactions-reactions-or-recasts.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/cast-with-interactions-reactions-or-recasts.ts rename to src/neynar-api/v1/openapi/models/cast-with-interactions-reactions-or-recasts.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast-with-interactions-replies.ts b/src/neynar-api/v1/openapi/models/cast-with-interactions-replies.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/cast-with-interactions-replies.ts rename to src/neynar-api/v1/openapi/models/cast-with-interactions-replies.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast-with-interactions.ts b/src/neynar-api/v1/openapi/models/cast-with-interactions.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/cast-with-interactions.ts rename to src/neynar-api/v1/openapi/models/cast-with-interactions.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/cast.ts b/src/neynar-api/v1/openapi/models/cast.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/cast.ts rename to src/neynar-api/v1/openapi/models/cast.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/casts-response-result.ts b/src/neynar-api/v1/openapi/models/casts-response-result.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/casts-response-result.ts rename to src/neynar-api/v1/openapi/models/casts-response-result.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/casts-response.ts b/src/neynar-api/v1/openapi/models/casts-response.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/casts-response.ts rename to src/neynar-api/v1/openapi/models/casts-response.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/custody-address-response-result.ts b/src/neynar-api/v1/openapi/models/custody-address-response-result.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/custody-address-response-result.ts rename to src/neynar-api/v1/openapi/models/custody-address-response-result.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/custody-address-response.ts b/src/neynar-api/v1/openapi/models/custody-address-response.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/custody-address-response.ts rename to src/neynar-api/v1/openapi/models/custody-address-response.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/embed-url.ts b/src/neynar-api/v1/openapi/models/embed-url.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/embed-url.ts rename to src/neynar-api/v1/openapi/models/embed-url.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/error-res.ts b/src/neynar-api/v1/openapi/models/error-res.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/error-res.ts rename to src/neynar-api/v1/openapi/models/error-res.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/follow-response-result.ts b/src/neynar-api/v1/openapi/models/follow-response-result.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/follow-response-result.ts rename to src/neynar-api/v1/openapi/models/follow-response-result.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/follow-response-user.ts b/src/neynar-api/v1/openapi/models/follow-response-user.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/follow-response-user.ts rename to src/neynar-api/v1/openapi/models/follow-response-user.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/follow-response.ts b/src/neynar-api/v1/openapi/models/follow-response.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/follow-response.ts rename to src/neynar-api/v1/openapi/models/follow-response.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/index.ts b/src/neynar-api/v1/openapi/models/index.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/index.ts rename to src/neynar-api/v1/openapi/models/index.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/mentions-and-replies-response-result.ts b/src/neynar-api/v1/openapi/models/mentions-and-replies-response-result.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/mentions-and-replies-response-result.ts rename to src/neynar-api/v1/openapi/models/mentions-and-replies-response-result.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/mentions-and-replies-response.ts b/src/neynar-api/v1/openapi/models/mentions-and-replies-response.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/mentions-and-replies-response.ts rename to src/neynar-api/v1/openapi/models/mentions-and-replies-response.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/next-cursor.ts b/src/neynar-api/v1/openapi/models/next-cursor.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/next-cursor.ts rename to src/neynar-api/v1/openapi/models/next-cursor.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/reaction-type.ts b/src/neynar-api/v1/openapi/models/reaction-type.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/reaction-type.ts rename to src/neynar-api/v1/openapi/models/reaction-type.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/reaction-with-cast-meta-cast.ts b/src/neynar-api/v1/openapi/models/reaction-with-cast-meta-cast.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/reaction-with-cast-meta-cast.ts rename to src/neynar-api/v1/openapi/models/reaction-with-cast-meta-cast.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/reaction-with-cast-meta-reaction.ts b/src/neynar-api/v1/openapi/models/reaction-with-cast-meta-reaction.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/reaction-with-cast-meta-reaction.ts rename to src/neynar-api/v1/openapi/models/reaction-with-cast-meta-reaction.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/reaction-with-cast-meta.ts b/src/neynar-api/v1/openapi/models/reaction-with-cast-meta.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/reaction-with-cast-meta.ts rename to src/neynar-api/v1/openapi/models/reaction-with-cast-meta.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/reaction.ts b/src/neynar-api/v1/openapi/models/reaction.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/reaction.ts rename to src/neynar-api/v1/openapi/models/reaction.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/reactions-and-recasts-notification.ts b/src/neynar-api/v1/openapi/models/reactions-and-recasts-notification.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/reactions-and-recasts-notification.ts rename to src/neynar-api/v1/openapi/models/reactions-and-recasts-notification.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/reactions-and-recasts-response-result.ts b/src/neynar-api/v1/openapi/models/reactions-and-recasts-response-result.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/reactions-and-recasts-response-result.ts rename to src/neynar-api/v1/openapi/models/reactions-and-recasts-response-result.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/reactions-and-recasts-response.ts b/src/neynar-api/v1/openapi/models/reactions-and-recasts-response.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/reactions-and-recasts-response.ts rename to src/neynar-api/v1/openapi/models/reactions-and-recasts-response.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/reactor-pfp.ts b/src/neynar-api/v1/openapi/models/reactor-pfp.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/reactor-pfp.ts rename to src/neynar-api/v1/openapi/models/reactor-pfp.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/reactor-viewer-context.ts b/src/neynar-api/v1/openapi/models/reactor-viewer-context.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/reactor-viewer-context.ts rename to src/neynar-api/v1/openapi/models/reactor-viewer-context.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/reactor.ts b/src/neynar-api/v1/openapi/models/reactor.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/reactor.ts rename to src/neynar-api/v1/openapi/models/reactor.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/recaster-pfp.ts b/src/neynar-api/v1/openapi/models/recaster-pfp.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/recaster-pfp.ts rename to src/neynar-api/v1/openapi/models/recaster-pfp.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/recaster-profile-bio.ts b/src/neynar-api/v1/openapi/models/recaster-profile-bio.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/recaster-profile-bio.ts rename to src/neynar-api/v1/openapi/models/recaster-profile-bio.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/recaster-profile.ts b/src/neynar-api/v1/openapi/models/recaster-profile.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/recaster-profile.ts rename to src/neynar-api/v1/openapi/models/recaster-profile.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/recaster-viewer-context.ts b/src/neynar-api/v1/openapi/models/recaster-viewer-context.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/recaster-viewer-context.ts rename to src/neynar-api/v1/openapi/models/recaster-viewer-context.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/recaster.ts b/src/neynar-api/v1/openapi/models/recaster.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/recaster.ts rename to src/neynar-api/v1/openapi/models/recaster.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/recent-casts-response.ts b/src/neynar-api/v1/openapi/models/recent-casts-response.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/recent-casts-response.ts rename to src/neynar-api/v1/openapi/models/recent-casts-response.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/recent-users-response-result.ts b/src/neynar-api/v1/openapi/models/recent-users-response-result.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/recent-users-response-result.ts rename to src/neynar-api/v1/openapi/models/recent-users-response-result.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/recent-users-response.ts b/src/neynar-api/v1/openapi/models/recent-users-response.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/recent-users-response.ts rename to src/neynar-api/v1/openapi/models/recent-users-response.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/user-cast-like-response-result.ts b/src/neynar-api/v1/openapi/models/user-cast-like-response-result.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/user-cast-like-response-result.ts rename to src/neynar-api/v1/openapi/models/user-cast-like-response-result.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/user-cast-like-response.ts b/src/neynar-api/v1/openapi/models/user-cast-like-response.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/user-cast-like-response.ts rename to src/neynar-api/v1/openapi/models/user-cast-like-response.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/user-pfp.ts b/src/neynar-api/v1/openapi/models/user-pfp.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/user-pfp.ts rename to src/neynar-api/v1/openapi/models/user-pfp.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/user-profile-bio.ts b/src/neynar-api/v1/openapi/models/user-profile-bio.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/user-profile-bio.ts rename to src/neynar-api/v1/openapi/models/user-profile-bio.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/user-profile.ts b/src/neynar-api/v1/openapi/models/user-profile.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/user-profile.ts rename to src/neynar-api/v1/openapi/models/user-profile.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/user.ts b/src/neynar-api/v1/openapi/models/user.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/user.ts rename to src/neynar-api/v1/openapi/models/user.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/user200-response-result.ts b/src/neynar-api/v1/openapi/models/user200-response-result.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/user200-response-result.ts rename to src/neynar-api/v1/openapi/models/user200-response-result.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/user200-response.ts b/src/neynar-api/v1/openapi/models/user200-response.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/user200-response.ts rename to src/neynar-api/v1/openapi/models/user200-response.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/verification-response-result.ts b/src/neynar-api/v1/openapi/models/verification-response-result.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/verification-response-result.ts rename to src/neynar-api/v1/openapi/models/verification-response-result.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/verification-response.ts b/src/neynar-api/v1/openapi/models/verification-response.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/verification-response.ts rename to src/neynar-api/v1/openapi/models/verification-response.ts diff --git a/src/neynar-api/neynar-v1-api/openapi/models/viewer-context.ts b/src/neynar-api/v1/openapi/models/viewer-context.ts similarity index 100% rename from src/neynar-api/neynar-v1-api/openapi/models/viewer-context.ts rename to src/neynar-api/v1/openapi/models/viewer-context.ts diff --git a/src/neynar-api/neynar-v2-api/index.ts b/src/neynar-api/v2/index.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/index.ts rename to src/neynar-api/v2/index.ts diff --git a/src/neynar-api/neynar-v2-api/neynar-api-v2-client.ts b/src/neynar-api/v2/neynar-api-v2-client.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/neynar-api-v2-client.ts rename to src/neynar-api/v2/neynar-api-v2-client.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/.gitignore b/src/neynar-api/v2/openapi-farcaster/.gitignore similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/.gitignore rename to src/neynar-api/v2/openapi-farcaster/.gitignore diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/.npmignore b/src/neynar-api/v2/openapi-farcaster/.npmignore similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/.npmignore rename to src/neynar-api/v2/openapi-farcaster/.npmignore diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/.openapi-generator-ignore b/src/neynar-api/v2/openapi-farcaster/.openapi-generator-ignore similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/.openapi-generator-ignore rename to src/neynar-api/v2/openapi-farcaster/.openapi-generator-ignore diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/.openapi-generator/FILES b/src/neynar-api/v2/openapi-farcaster/.openapi-generator/FILES similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/.openapi-generator/FILES rename to src/neynar-api/v2/openapi-farcaster/.openapi-generator/FILES diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/.openapi-generator/VERSION b/src/neynar-api/v2/openapi-farcaster/.openapi-generator/VERSION similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/.openapi-generator/VERSION rename to src/neynar-api/v2/openapi-farcaster/.openapi-generator/VERSION diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/api.ts b/src/neynar-api/v2/openapi-farcaster/api.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/api.ts rename to src/neynar-api/v2/openapi-farcaster/api.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/cast-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/cast-api.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/apis/cast-api.ts rename to src/neynar-api/v2/openapi-farcaster/apis/cast-api.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/feed-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/feed-api.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/apis/feed-api.ts rename to src/neynar-api/v2/openapi-farcaster/apis/feed-api.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/follows-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/follows-api.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/apis/follows-api.ts rename to src/neynar-api/v2/openapi-farcaster/apis/follows-api.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/notifications-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/notifications-api.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/apis/notifications-api.ts rename to src/neynar-api/v2/openapi-farcaster/apis/notifications-api.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/reaction-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/reaction-api.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/apis/reaction-api.ts rename to src/neynar-api/v2/openapi-farcaster/apis/reaction-api.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/signer-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/signer-api.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/apis/signer-api.ts rename to src/neynar-api/v2/openapi-farcaster/apis/signer-api.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/apis/user-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/user-api.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/apis/user-api.ts rename to src/neynar-api/v2/openapi-farcaster/apis/user-api.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/base.ts b/src/neynar-api/v2/openapi-farcaster/base.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/base.ts rename to src/neynar-api/v2/openapi-farcaster/base.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/common.ts b/src/neynar-api/v2/openapi-farcaster/common.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/common.ts rename to src/neynar-api/v2/openapi-farcaster/common.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/configuration.ts b/src/neynar-api/v2/openapi-farcaster/configuration.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/configuration.ts rename to src/neynar-api/v2/openapi-farcaster/configuration.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/git_push.sh b/src/neynar-api/v2/openapi-farcaster/git_push.sh similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/git_push.sh rename to src/neynar-api/v2/openapi-farcaster/git_push.sh diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/index.ts b/src/neynar-api/v2/openapi-farcaster/index.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/index.ts rename to src/neynar-api/v2/openapi-farcaster/index.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/active-status.ts b/src/neynar-api/v2/openapi-farcaster/models/active-status.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/active-status.ts rename to src/neynar-api/v2/openapi-farcaster/models/active-status.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/add-verification-req-body.ts b/src/neynar-api/v2/openapi-farcaster/models/add-verification-req-body.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/add-verification-req-body.ts rename to src/neynar-api/v2/openapi-farcaster/models/add-verification-req-body.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/bulk-follow-response.ts b/src/neynar-api/v2/openapi-farcaster/models/bulk-follow-response.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/bulk-follow-response.ts rename to src/neynar-api/v2/openapi-farcaster/models/bulk-follow-response.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-id.ts b/src/neynar-api/v2/openapi-farcaster/models/cast-id.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-id.ts rename to src/neynar-api/v2/openapi-farcaster/models/cast-id.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-notification-type.ts b/src/neynar-api/v2/openapi-farcaster/models/cast-notification-type.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-notification-type.ts rename to src/neynar-api/v2/openapi-farcaster/models/cast-notification-type.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-param-type.ts b/src/neynar-api/v2/openapi-farcaster/models/cast-param-type.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-param-type.ts rename to src/neynar-api/v2/openapi-farcaster/models/cast-param-type.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-parent-author.ts b/src/neynar-api/v2/openapi-farcaster/models/cast-parent-author.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-parent-author.ts rename to src/neynar-api/v2/openapi-farcaster/models/cast-parent-author.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-response.ts b/src/neynar-api/v2/openapi-farcaster/models/cast-response.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-response.ts rename to src/neynar-api/v2/openapi-farcaster/models/cast-response.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-with-interactions-reactions.ts b/src/neynar-api/v2/openapi-farcaster/models/cast-with-interactions-reactions.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-with-interactions-reactions.ts rename to src/neynar-api/v2/openapi-farcaster/models/cast-with-interactions-reactions.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-with-interactions-replies.ts b/src/neynar-api/v2/openapi-farcaster/models/cast-with-interactions-replies.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-with-interactions-replies.ts rename to src/neynar-api/v2/openapi-farcaster/models/cast-with-interactions-replies.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-with-interactions.ts b/src/neynar-api/v2/openapi-farcaster/models/cast-with-interactions.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast-with-interactions.ts rename to src/neynar-api/v2/openapi-farcaster/models/cast-with-interactions.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast.ts b/src/neynar-api/v2/openapi-farcaster/models/cast.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/cast.ts rename to src/neynar-api/v2/openapi-farcaster/models/cast.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/casts-response-result.ts b/src/neynar-api/v2/openapi-farcaster/models/casts-response-result.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/casts-response-result.ts rename to src/neynar-api/v2/openapi-farcaster/models/casts-response-result.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/casts-response.ts b/src/neynar-api/v2/openapi-farcaster/models/casts-response.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/casts-response.ts rename to src/neynar-api/v2/openapi-farcaster/models/casts-response.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/dehydrated-follower.ts b/src/neynar-api/v2/openapi-farcaster/models/dehydrated-follower.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/dehydrated-follower.ts rename to src/neynar-api/v2/openapi-farcaster/models/dehydrated-follower.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/delete-cast-req-body.ts b/src/neynar-api/v2/openapi-farcaster/models/delete-cast-req-body.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/delete-cast-req-body.ts rename to src/neynar-api/v2/openapi-farcaster/models/delete-cast-req-body.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/embed-cast-id.ts b/src/neynar-api/v2/openapi-farcaster/models/embed-cast-id.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/embed-cast-id.ts rename to src/neynar-api/v2/openapi-farcaster/models/embed-cast-id.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/embed-url.ts b/src/neynar-api/v2/openapi-farcaster/models/embed-url.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/embed-url.ts rename to src/neynar-api/v2/openapi-farcaster/models/embed-url.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/embedded-cast.ts b/src/neynar-api/v2/openapi-farcaster/models/embedded-cast.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/embedded-cast.ts rename to src/neynar-api/v2/openapi-farcaster/models/embedded-cast.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/error-res.ts b/src/neynar-api/v2/openapi-farcaster/models/error-res.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/error-res.ts rename to src/neynar-api/v2/openapi-farcaster/models/error-res.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/feed-response.ts b/src/neynar-api/v2/openapi-farcaster/models/feed-response.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/feed-response.ts rename to src/neynar-api/v2/openapi-farcaster/models/feed-response.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/follow-req-body.ts b/src/neynar-api/v2/openapi-farcaster/models/follow-req-body.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/follow-req-body.ts rename to src/neynar-api/v2/openapi-farcaster/models/follow-req-body.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/follow-response.ts b/src/neynar-api/v2/openapi-farcaster/models/follow-response.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/follow-response.ts rename to src/neynar-api/v2/openapi-farcaster/models/follow-response.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/get-casts-req-body.ts b/src/neynar-api/v2/openapi-farcaster/models/get-casts-req-body.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/get-casts-req-body.ts rename to src/neynar-api/v2/openapi-farcaster/models/get-casts-req-body.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/hydrated-follower.ts b/src/neynar-api/v2/openapi-farcaster/models/hydrated-follower.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/hydrated-follower.ts rename to src/neynar-api/v2/openapi-farcaster/models/hydrated-follower.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/index.ts b/src/neynar-api/v2/openapi-farcaster/models/index.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/index.ts rename to src/neynar-api/v2/openapi-farcaster/models/index.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/individual-hash-obj.ts b/src/neynar-api/v2/openapi-farcaster/models/individual-hash-obj.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/individual-hash-obj.ts rename to src/neynar-api/v2/openapi-farcaster/models/individual-hash-obj.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/next-cursor.ts b/src/neynar-api/v2/openapi-farcaster/models/next-cursor.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/next-cursor.ts rename to src/neynar-api/v2/openapi-farcaster/models/next-cursor.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/notification-follow.ts b/src/neynar-api/v2/openapi-farcaster/models/notification-follow.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/notification-follow.ts rename to src/neynar-api/v2/openapi-farcaster/models/notification-follow.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/notification-reactions-cast.ts b/src/neynar-api/v2/openapi-farcaster/models/notification-reactions-cast.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/notification-reactions-cast.ts rename to src/neynar-api/v2/openapi-farcaster/models/notification-reactions-cast.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/notification-reactions.ts b/src/neynar-api/v2/openapi-farcaster/models/notification-reactions.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/notification-reactions.ts rename to src/neynar-api/v2/openapi-farcaster/models/notification-reactions.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/notification.ts b/src/neynar-api/v2/openapi-farcaster/models/notification.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/notification.ts rename to src/neynar-api/v2/openapi-farcaster/models/notification.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/notifications-response.ts b/src/neynar-api/v2/openapi-farcaster/models/notifications-response.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/notifications-response.ts rename to src/neynar-api/v2/openapi-farcaster/models/notifications-response.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/operation-response.ts b/src/neynar-api/v2/openapi-farcaster/models/operation-response.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/operation-response.ts rename to src/neynar-api/v2/openapi-farcaster/models/operation-response.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/post-cast-req-body.ts b/src/neynar-api/v2/openapi-farcaster/models/post-cast-req-body.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/post-cast-req-body.ts rename to src/neynar-api/v2/openapi-farcaster/models/post-cast-req-body.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/post-cast-response-cast-author.ts b/src/neynar-api/v2/openapi-farcaster/models/post-cast-response-cast-author.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/post-cast-response-cast-author.ts rename to src/neynar-api/v2/openapi-farcaster/models/post-cast-response-cast-author.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/post-cast-response-cast.ts b/src/neynar-api/v2/openapi-farcaster/models/post-cast-response-cast.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/post-cast-response-cast.ts rename to src/neynar-api/v2/openapi-farcaster/models/post-cast-response-cast.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/post-cast-response.ts b/src/neynar-api/v2/openapi-farcaster/models/post-cast-response.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/post-cast-response.ts rename to src/neynar-api/v2/openapi-farcaster/models/post-cast-response.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/profile-url-pfp.ts b/src/neynar-api/v2/openapi-farcaster/models/profile-url-pfp.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/profile-url-pfp.ts rename to src/neynar-api/v2/openapi-farcaster/models/profile-url-pfp.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/profile-url.ts b/src/neynar-api/v2/openapi-farcaster/models/profile-url.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/profile-url.ts rename to src/neynar-api/v2/openapi-farcaster/models/profile-url.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/reaction-like.ts b/src/neynar-api/v2/openapi-farcaster/models/reaction-like.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/reaction-like.ts rename to src/neynar-api/v2/openapi-farcaster/models/reaction-like.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/reaction-recast.ts b/src/neynar-api/v2/openapi-farcaster/models/reaction-recast.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/reaction-recast.ts rename to src/neynar-api/v2/openapi-farcaster/models/reaction-recast.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/reaction-req-body.ts b/src/neynar-api/v2/openapi-farcaster/models/reaction-req-body.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/reaction-req-body.ts rename to src/neynar-api/v2/openapi-farcaster/models/reaction-req-body.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/reaction-type.ts b/src/neynar-api/v2/openapi-farcaster/models/reaction-type.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/reaction-type.ts rename to src/neynar-api/v2/openapi-farcaster/models/reaction-type.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/register-signer-key-req-body.ts b/src/neynar-api/v2/openapi-farcaster/models/register-signer-key-req-body.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/register-signer-key-req-body.ts rename to src/neynar-api/v2/openapi-farcaster/models/register-signer-key-req-body.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/relevant-followers-response.ts b/src/neynar-api/v2/openapi-farcaster/models/relevant-followers-response.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/relevant-followers-response.ts rename to src/neynar-api/v2/openapi-farcaster/models/relevant-followers-response.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/remove-verification-req-body.ts b/src/neynar-api/v2/openapi-farcaster/models/remove-verification-req-body.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/remove-verification-req-body.ts rename to src/neynar-api/v2/openapi-farcaster/models/remove-verification-req-body.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/searched-user.ts b/src/neynar-api/v2/openapi-farcaster/models/searched-user.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/searched-user.ts rename to src/neynar-api/v2/openapi-farcaster/models/searched-user.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/signer.ts b/src/neynar-api/v2/openapi-farcaster/models/signer.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/signer.ts rename to src/neynar-api/v2/openapi-farcaster/models/signer.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/update-user-req-body.ts b/src/neynar-api/v2/openapi-farcaster/models/update-user-req-body.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/update-user-req-body.ts rename to src/neynar-api/v2/openapi-farcaster/models/update-user-req-body.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-bulk200-response.ts b/src/neynar-api/v2/openapi-farcaster/models/user-bulk200-response.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-bulk200-response.ts rename to src/neynar-api/v2/openapi-farcaster/models/user-bulk200-response.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-dehydrated.ts b/src/neynar-api/v2/openapi-farcaster/models/user-dehydrated.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-dehydrated.ts rename to src/neynar-api/v2/openapi-farcaster/models/user-dehydrated.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-profile-bio.ts b/src/neynar-api/v2/openapi-farcaster/models/user-profile-bio.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-profile-bio.ts rename to src/neynar-api/v2/openapi-farcaster/models/user-profile-bio.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-profile.ts b/src/neynar-api/v2/openapi-farcaster/models/user-profile.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-profile.ts rename to src/neynar-api/v2/openapi-farcaster/models/user-profile.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-response.ts b/src/neynar-api/v2/openapi-farcaster/models/user-response.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-response.ts rename to src/neynar-api/v2/openapi-farcaster/models/user-response.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-search-response-result.ts b/src/neynar-api/v2/openapi-farcaster/models/user-search-response-result.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-search-response-result.ts rename to src/neynar-api/v2/openapi-farcaster/models/user-search-response-result.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-search-response.ts b/src/neynar-api/v2/openapi-farcaster/models/user-search-response.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-search-response.ts rename to src/neynar-api/v2/openapi-farcaster/models/user-search-response.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-viewer-context.ts b/src/neynar-api/v2/openapi-farcaster/models/user-viewer-context.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/user-viewer-context.ts rename to src/neynar-api/v2/openapi-farcaster/models/user-viewer-context.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-farcaster/models/user.ts b/src/neynar-api/v2/openapi-farcaster/models/user.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-farcaster/models/user.ts rename to src/neynar-api/v2/openapi-farcaster/models/user.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/.gitignore b/src/neynar-api/v2/openapi-recommendation/.gitignore similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/.gitignore rename to src/neynar-api/v2/openapi-recommendation/.gitignore diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/.npmignore b/src/neynar-api/v2/openapi-recommendation/.npmignore similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/.npmignore rename to src/neynar-api/v2/openapi-recommendation/.npmignore diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/.openapi-generator-ignore b/src/neynar-api/v2/openapi-recommendation/.openapi-generator-ignore similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/.openapi-generator-ignore rename to src/neynar-api/v2/openapi-recommendation/.openapi-generator-ignore diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/.openapi-generator/FILES b/src/neynar-api/v2/openapi-recommendation/.openapi-generator/FILES similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/.openapi-generator/FILES rename to src/neynar-api/v2/openapi-recommendation/.openapi-generator/FILES diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/.openapi-generator/VERSION b/src/neynar-api/v2/openapi-recommendation/.openapi-generator/VERSION similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/.openapi-generator/VERSION rename to src/neynar-api/v2/openapi-recommendation/.openapi-generator/VERSION diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/api.ts b/src/neynar-api/v2/openapi-recommendation/api.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/api.ts rename to src/neynar-api/v2/openapi-recommendation/api.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/apis/nftapi.ts b/src/neynar-api/v2/openapi-recommendation/apis/nftapi.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/apis/nftapi.ts rename to src/neynar-api/v2/openapi-recommendation/apis/nftapi.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/base.ts b/src/neynar-api/v2/openapi-recommendation/base.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/base.ts rename to src/neynar-api/v2/openapi-recommendation/base.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/common.ts b/src/neynar-api/v2/openapi-recommendation/common.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/common.ts rename to src/neynar-api/v2/openapi-recommendation/common.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/configuration.ts b/src/neynar-api/v2/openapi-recommendation/configuration.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/configuration.ts rename to src/neynar-api/v2/openapi-recommendation/configuration.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/git_push.sh b/src/neynar-api/v2/openapi-recommendation/git_push.sh similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/git_push.sh rename to src/neynar-api/v2/openapi-recommendation/git_push.sh diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/index.ts b/src/neynar-api/v2/openapi-recommendation/index.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/index.ts rename to src/neynar-api/v2/openapi-recommendation/index.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/models/active-status.ts b/src/neynar-api/v2/openapi-recommendation/models/active-status.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/models/active-status.ts rename to src/neynar-api/v2/openapi-recommendation/models/active-status.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/models/error-res.ts b/src/neynar-api/v2/openapi-recommendation/models/error-res.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/models/error-res.ts rename to src/neynar-api/v2/openapi-recommendation/models/error-res.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/models/fetch-relevant-mints200-response.ts b/src/neynar-api/v2/openapi-recommendation/models/fetch-relevant-mints200-response.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/models/fetch-relevant-mints200-response.ts rename to src/neynar-api/v2/openapi-recommendation/models/fetch-relevant-mints200-response.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/models/index.ts b/src/neynar-api/v2/openapi-recommendation/models/index.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/models/index.ts rename to src/neynar-api/v2/openapi-recommendation/models/index.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/models/relevant-mint.ts b/src/neynar-api/v2/openapi-recommendation/models/relevant-mint.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/models/relevant-mint.ts rename to src/neynar-api/v2/openapi-recommendation/models/relevant-mint.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/models/user-profile-bio.ts b/src/neynar-api/v2/openapi-recommendation/models/user-profile-bio.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/models/user-profile-bio.ts rename to src/neynar-api/v2/openapi-recommendation/models/user-profile-bio.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/models/user-profile.ts b/src/neynar-api/v2/openapi-recommendation/models/user-profile.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/models/user-profile.ts rename to src/neynar-api/v2/openapi-recommendation/models/user-profile.ts diff --git a/src/neynar-api/neynar-v2-api/openapi-recommendation/models/user.ts b/src/neynar-api/v2/openapi-recommendation/models/user.ts similarity index 100% rename from src/neynar-api/neynar-v2-api/openapi-recommendation/models/user.ts rename to src/neynar-api/v2/openapi-recommendation/models/user.ts From 60aae13e3db65c018ecae2049996129165e0b568 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Tue, 21 Nov 2023 17:42:08 +0530 Subject: [PATCH 02/77] Rename client from neynar-v1-client to v1-client and neynar-v2-client to v2-client --- src/neynar-api/v1/index.ts | 2 +- src/neynar-api/v1/{neynar-api-v1-client.ts => v1-client.ts} | 0 src/neynar-api/v2/index.ts | 2 +- src/neynar-api/v2/{neynar-api-v2-client.ts => v2-client.ts} | 0 4 files changed, 2 insertions(+), 2 deletions(-) rename src/neynar-api/v1/{neynar-api-v1-client.ts => v1-client.ts} (100%) rename src/neynar-api/v2/{neynar-api-v2-client.ts => v2-client.ts} (100%) diff --git a/src/neynar-api/v1/index.ts b/src/neynar-api/v1/index.ts index f21e8894..7726b59b 100644 --- a/src/neynar-api/v1/index.ts +++ b/src/neynar-api/v1/index.ts @@ -1,2 +1,2 @@ export * from './openapi' -export * from './neynar-api-v1-client' \ No newline at end of file +export * from './v1-client' \ No newline at end of file diff --git a/src/neynar-api/v1/neynar-api-v1-client.ts b/src/neynar-api/v1/v1-client.ts similarity index 100% rename from src/neynar-api/v1/neynar-api-v1-client.ts rename to src/neynar-api/v1/v1-client.ts diff --git a/src/neynar-api/v2/index.ts b/src/neynar-api/v2/index.ts index 7df1bbac..a2a9880d 100644 --- a/src/neynar-api/v2/index.ts +++ b/src/neynar-api/v2/index.ts @@ -1,2 +1,2 @@ export * from "./openapi-farcaster"; -export * from "./neynar-api-v2-client"; +export * from "./v2-client"; diff --git a/src/neynar-api/v2/neynar-api-v2-client.ts b/src/neynar-api/v2/v2-client.ts similarity index 100% rename from src/neynar-api/v2/neynar-api-v2-client.ts rename to src/neynar-api/v2/v2-client.ts From e454a6cb9a19d6a2ef84e95e9f756e8bdae14e66 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Tue, 21 Nov 2023 17:55:05 +0530 Subject: [PATCH 03/77] Sync up OAS --- src/oas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oas b/src/oas index 47474c45..a1b367ea 160000 --- a/src/oas +++ b/src/oas @@ -1 +1 @@ -Subproject commit 47474c45fa9c51ae9be7b81cea56021eb4d30da1 +Subproject commit a1b367eaaec7c7bcbc430afa757f9fb89f9ff81d From 3ca7466aca57a79e608b3125912101966ce62aec Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Tue, 21 Nov 2023 18:11:06 +0530 Subject: [PATCH 04/77] Update generator scripts --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index b26c9ba3..652ff281 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,9 @@ "scripts": { "clean": "del-cli ./build/*", "build": "yarn run clean && tsc", - "generate:neynar-oas": "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": "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": "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": "rm -rf 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": "rm -rf 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": "rm -rf 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" }, "author": "Neynar", "license": "ISC", From 0a6780eaebbadfeb3200deaa4ac24ac12e17944e Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Tue, 21 Nov 2023 18:32:30 +0530 Subject: [PATCH 05/77] unmodify generated files for v1 api --- .../v1/openapi/.openapi-generator/FILES | 1 + src/neynar-api/v1/openapi/apis/cast-api.ts | 1066 +++++--------- src/neynar-api/v1/openapi/apis/follows-api.ts | 593 +++----- .../v1/openapi/apis/notifications-api.ts | 604 +++----- .../v1/openapi/apis/reactions-api.ts | 907 +++++------- src/neynar-api/v1/openapi/apis/user-api.ts | 1240 ++++++----------- .../v1/openapi/apis/verification-api.ts | 470 +++---- 7 files changed, 1742 insertions(+), 3139 deletions(-) diff --git a/src/neynar-api/v1/openapi/.openapi-generator/FILES b/src/neynar-api/v1/openapi/.openapi-generator/FILES index c26a6b56..7b829a39 100644 --- a/src/neynar-api/v1/openapi/.openapi-generator/FILES +++ b/src/neynar-api/v1/openapi/.openapi-generator/FILES @@ -1,5 +1,6 @@ .gitignore .npmignore +.openapi-generator-ignore api.ts apis/cast-api.ts apis/follows-api.ts diff --git a/src/neynar-api/v1/openapi/apis/cast-api.ts b/src/neynar-api/v1/openapi/apis/cast-api.ts index 74b3994c..26f1e0fe 100644 --- a/src/neynar-api/v1/openapi/apis/cast-api.ts +++ b/src/neynar-api/v1/openapi/apis/cast-api.ts @@ -5,389 +5,422 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.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"; + +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"; +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"; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; // @ts-ignore -import { AllCastsInThreadResponse } from "../models"; +import { AllCastsInThreadResponse } from '../models'; // @ts-ignore -import { CastResponse } from "../models"; +import { CastResponse } from '../models'; // @ts-ignore -import { CastsResponse } from "../models"; +import { CastsResponse } from '../models'; // @ts-ignore -import { ErrorRes } from "../models"; +import { ErrorRes } from '../models'; // @ts-ignore -import { RecentCastsResponse } from "../models"; +import { RecentCastsResponse } from '../models'; /** * CastApi - axios parameter creator * @export */ -export const CastApiAxiosParamCreator = function ( - configuration?: Configuration -) { - return { - /** - * 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. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - allCastsInThread: async ( - threadHash: string, - viewerFid?: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'threadHash' is not null or undefined - assertParamExists("allCastsInThread", "threadHash", threadHash); - const localVarPath = `/farcaster/all-casts-in-thread`; - // 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; - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - if (threadHash !== undefined) { - localVarQueryParameter["threadHash"] = threadHash; - } - - if (viewerFid !== undefined) { - localVarQueryParameter["viewerFid"] = viewerFid; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Gets information about an individual cast - * @summary Retrieve 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. - * @throws {RequiredError} - */ - cast: async ( - hash: string, - viewerFid?: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'hash' is not null or undefined - assertParamExists("cast", "hash", hash); - const localVarPath = `/farcaster/cast`; - // 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; - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - if (hash !== undefined) { - localVarQueryParameter["hash"] = hash; - } - - if (viewerFid !== undefined) { - localVarQueryParameter["viewerFid"] = viewerFid; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Gets the most recent casts for a user - * @summary Retrieve casts for a given user - * @param {number} fid fid of a user - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [parentUrl] A cast can be part of a certain channel. The channel is identified by `parent_url`. All casts in the channel ladder up to the same parent_url. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 150) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - casts: async ( - fid: number, - viewerFid?: number, - parentUrl?: string, - cursor?: string, - limit?: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'fid' is not null or undefined - assertParamExists("casts", "fid", fid); - 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); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { - method: "GET", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - if (fid !== undefined) { - localVarQueryParameter["fid"] = fid; - } - - if (viewerFid !== undefined) { - localVarQueryParameter["viewerFid"] = viewerFid; - } - - if (parentUrl !== undefined) { - localVarQueryParameter["parent_url"] = parentUrl; - } - - if (cursor !== undefined) { - localVarQueryParameter["cursor"] = cursor; - } - - if (limit !== undefined) { - localVarQueryParameter["limit"] = limit; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Get a list of casts from the protocol in reverse chronological order based on timestamp - * @summary Get Recent Casts - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 100) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - recentCasts: async ( - viewerFid?: number, - cursor?: string, - limit?: number, - options: AxiosRequestConfig = {} - ): Promise => { - const localVarPath = `/farcaster/recent-casts`; - // 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; - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - if (viewerFid !== undefined) { - localVarQueryParameter["viewerFid"] = viewerFid; - } - - if (cursor !== undefined) { - localVarQueryParameter["cursor"] = cursor; - } - - if (limit !== undefined) { - localVarQueryParameter["limit"] = limit; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; +export const CastApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * 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} apiKey API key required for authentication. + * @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. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + allCastsInThread: async (apiKey: string, threadHash: string, viewerFid?: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('allCastsInThread', 'apiKey', apiKey) + // verify required parameter 'threadHash' is not null or undefined + assertParamExists('allCastsInThread', 'threadHash', threadHash) + const localVarPath = `/farcaster/all-casts-in-thread`; + // 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 (threadHash !== undefined) { + localVarQueryParameter['threadHash'] = threadHash; + } + + if (viewerFid !== undefined) { + localVarQueryParameter['viewerFid'] = viewerFid; + } + + 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, + }; + }, + /** + * Gets information about an individual cast + * @summary Retrieve cast for a given hash + * @param {string} apiKey API key required for authentication. + * @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. + * @throws {RequiredError} + */ + cast: async (apiKey: string, hash: string, viewerFid?: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('cast', 'apiKey', apiKey) + // verify required parameter 'hash' is not null or undefined + assertParamExists('cast', 'hash', hash) + const localVarPath = `/farcaster/cast`; + // 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 (hash !== undefined) { + localVarQueryParameter['hash'] = hash; + } + + if (viewerFid !== undefined) { + localVarQueryParameter['viewerFid'] = viewerFid; + } + + 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, + }; + }, + /** + * Gets the most recent casts for a user + * @summary Retrieve casts for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {string} [parentUrl] A cast can be part of a certain channel. The channel is identified by `parent_url`. All casts in the channel ladder up to the same parent_url. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + casts: async (apiKey: string, fid: number, viewerFid?: number, parentUrl?: string, cursor?: string, limit?: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('casts', 'apiKey', apiKey) + // verify required parameter 'fid' is not null or undefined + assertParamExists('casts', 'fid', fid) + 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); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } + + if (viewerFid !== undefined) { + localVarQueryParameter['viewerFid'] = viewerFid; + } + + if (parentUrl !== undefined) { + localVarQueryParameter['parent_url'] = parentUrl; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + 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, + }; + }, + /** + * Get a list of casts from the protocol in reverse chronological order based on timestamp + * @summary Get Recent Casts + * @param {string} apiKey API key required for authentication. + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to retrieve (default 25, max 100) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + recentCasts: async (apiKey: string, viewerFid?: number, cursor?: string, limit?: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('recentCasts', 'apiKey', apiKey) + const localVarPath = `/farcaster/recent-casts`; + // 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 (viewerFid !== undefined) { + localVarQueryParameter['viewerFid'] = viewerFid; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + 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, + }; + }, + } }; /** * CastApi - functional programming interface * @export */ -export const CastApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = CastApiAxiosParamCreator(configuration); - return { +export const CastApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = CastApiAxiosParamCreator(configuration) + return { + /** + * 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} apiKey API key required for authentication. + * @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. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async allCastsInThread(apiKey: string, threadHash: string, viewerFid?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.allCastsInThread(apiKey, threadHash, viewerFid, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Gets information about an individual cast + * @summary Retrieve cast for a given hash + * @param {string} apiKey API key required for authentication. + * @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. + * @throws {RequiredError} + */ + async cast(apiKey: string, hash: string, viewerFid?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.cast(apiKey, hash, viewerFid, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Gets the most recent casts for a user + * @summary Retrieve casts for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {string} [parentUrl] A cast can be part of a certain channel. The channel is identified by `parent_url`. All casts in the channel ladder up to the same parent_url. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async casts(apiKey: string, fid: number, viewerFid?: number, parentUrl?: string, cursor?: string, limit?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.casts(apiKey, fid, viewerFid, parentUrl, cursor, limit, options); + 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 + * @param {string} apiKey API key required for authentication. + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to retrieve (default 25, max 100) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async recentCasts(apiKey: string, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.recentCasts(apiKey, viewerFid, cursor, limit, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * CastApi - factory interface + * @export + */ +export const CastApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = CastApiFp(configuration) + return { + /** + * 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} apiKey API key required for authentication. + * @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. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + allCastsInThread(apiKey: string, threadHash: string, viewerFid?: number, options?: any): AxiosPromise { + return localVarFp.allCastsInThread(apiKey, threadHash, viewerFid, options).then((request) => request(axios, basePath)); + }, + /** + * Gets information about an individual cast + * @summary Retrieve cast for a given hash + * @param {string} apiKey API key required for authentication. + * @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. + * @throws {RequiredError} + */ + cast(apiKey: string, hash: string, viewerFid?: number, options?: any): AxiosPromise { + return localVarFp.cast(apiKey, hash, viewerFid, options).then((request) => request(axios, basePath)); + }, + /** + * Gets the most recent casts for a user + * @summary Retrieve casts for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {string} [parentUrl] A cast can be part of a certain channel. The channel is identified by `parent_url`. All casts in the channel ladder up to the same parent_url. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + casts(apiKey: string, fid: number, viewerFid?: number, parentUrl?: string, cursor?: string, limit?: number, options?: any): AxiosPromise { + return localVarFp.casts(apiKey, fid, viewerFid, parentUrl, cursor, limit, 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 + * @param {string} apiKey API key required for authentication. + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to retrieve (default 25, max 100) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + recentCasts(apiKey: string, viewerFid?: number, cursor?: string, limit?: number, options?: any): AxiosPromise { + return localVarFp.recentCasts(apiKey, viewerFid, cursor, limit, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * CastApi - object-oriented interface + * @export + * @class CastApi + * @extends {BaseAPI} + */ +export class CastApi extends BaseAPI { /** * 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} apiKey API key required for authentication. * @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. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof CastApi */ - async allCastsInThread( - threadHash: string, - viewerFid?: number, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.allCastsInThread( - threadHash, - viewerFid, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, + public allCastsInThread(apiKey: string, threadHash: string, viewerFid?: number, options?: AxiosRequestConfig) { + return CastApiFp(this.configuration).allCastsInThread(apiKey, threadHash, viewerFid, options).then((request) => request(this.axios, this.basePath)); + } + /** * Gets information about an individual cast * @summary Retrieve cast for a given hash + * @param {string} apiKey API key required for authentication. * @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. * @throws {RequiredError} + * @memberof CastApi */ - async cast( - hash: string, - viewerFid?: number, - options?: AxiosRequestConfig - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.cast( - hash, - viewerFid, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, + public cast(apiKey: string, hash: string, viewerFid?: number, options?: AxiosRequestConfig) { + return CastApiFp(this.configuration).cast(apiKey, hash, viewerFid, options).then((request) => request(this.axios, this.basePath)); + } + /** * Gets the most recent casts for a user * @summary Retrieve casts for a given user + * @param {string} apiKey API key required for authentication. * @param {number} fid fid of a user * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. * @param {string} [parentUrl] A cast can be part of a certain channel. The channel is identified by `parent_url`. All casts in the channel ladder up to the same parent_url. @@ -395,358 +428,25 @@ export const CastApiFp = function (configuration?: Configuration) { * @param {number} [limit] Number of results to retrieve (default 25, max 150) * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof CastApi */ - async casts( - fid: number, - viewerFid?: number, - parentUrl?: string, - cursor?: string, - limit?: number, - options?: AxiosRequestConfig - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.casts( - fid, - viewerFid, - parentUrl, - cursor, - limit, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, + public casts(apiKey: string, fid: number, viewerFid?: number, parentUrl?: string, cursor?: string, limit?: number, options?: AxiosRequestConfig) { + return CastApiFp(this.configuration).casts(apiKey, fid, viewerFid, parentUrl, cursor, limit, options).then((request) => request(this.axios, this.basePath)); + } + /** * Get a list of casts from the protocol in reverse chronological order based on timestamp * @summary Get Recent Casts + * @param {string} apiKey API key required for authentication. * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 100) * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof CastApi */ - async recentCasts( - viewerFid?: number, - cursor?: string, - limit?: number, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.recentCasts( - viewerFid, - cursor, - limit, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - }; -}; - -/** - * CastApi - factory interface - * @export - */ -export const CastApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance -) { - const localVarFp = CastApiFp(configuration); - return { - /** - * 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. - * @throws {RequiredError} - */ - allCastsInThread( - requestParameters: CastApiAllCastsInThreadRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .allCastsInThread( - requestParameters.threadHash, - requestParameters.viewerFid, - options - ) - .then((request) => request(axios, basePath)); - }, - /** - * Gets information about an individual cast - * @summary Retrieve cast for a given hash - * @param {CastApiCastRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - cast( - requestParameters: CastApiCastRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .cast(requestParameters.hash, requestParameters.viewerFid, options) - .then((request) => request(axios, basePath)); - }, - /** - * Gets the most recent casts for a user - * @summary Retrieve casts for a given user - * @param {CastApiCastsRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - casts( - requestParameters: CastApiCastsRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .casts( - requestParameters.fid, - requestParameters.viewerFid, - requestParameters.parentUrl, - requestParameters.cursor, - requestParameters.limit, - 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 - * @param {CastApiRecentCastsRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - recentCasts( - requestParameters: CastApiRecentCastsRequest = {}, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .recentCasts( - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * Request parameters for allCastsInThread operation in CastApi. - * @export - * @interface CastApiAllCastsInThreadRequest - */ -export interface CastApiAllCastsInThreadRequest { - /** - * The hash of the thread to retrieve casts from. - * @type {string} - * @memberof CastApiAllCastsInThread - */ - readonly threadHash: string; - - /** - * fid of the user viewing this information, needed for contextual information. - * @type {number} - * @memberof CastApiAllCastsInThread - */ - readonly viewerFid?: number; -} - -/** - * Request parameters for cast operation in CastApi. - * @export - * @interface CastApiCastRequest - */ -export interface CastApiCastRequest { - /** - * Cast hash - * @type {string} - * @memberof CastApiCast - */ - readonly hash: string; - - /** - * fid of the user viewing this information, needed for contextual information. - * @type {number} - * @memberof CastApiCast - */ - readonly viewerFid?: number; -} - -/** - * Request parameters for casts operation in CastApi. - * @export - * @interface CastApiCastsRequest - */ -export interface CastApiCastsRequest { - /** - * fid of a user - * @type {number} - * @memberof CastApiCasts - */ - readonly fid: number; - - /** - * fid of the user viewing this information, needed for contextual information. - * @type {number} - * @memberof CastApiCasts - */ - readonly viewerFid?: number; - - /** - * A cast can be part of a certain channel. The channel is identified by `parent_url`. All casts in the channel ladder up to the same parent_url. - * @type {string} - * @memberof CastApiCasts - */ - readonly parentUrl?: string; - - /** - * Pagination cursor. - * @type {string} - * @memberof CastApiCasts - */ - readonly cursor?: string; - - /** - * Number of results to retrieve (default 25, max 150) - * @type {number} - * @memberof CastApiCasts - */ - readonly limit?: number; + public recentCasts(apiKey: string, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig) { + return CastApiFp(this.configuration).recentCasts(apiKey, viewerFid, cursor, limit, options).then((request) => request(this.axios, this.basePath)); + } } -/** - * Request parameters for recentCasts operation in CastApi. - * @export - * @interface CastApiRecentCastsRequest - */ -export interface CastApiRecentCastsRequest { - /** - * fid of the user viewing this information, needed for contextual information. - * @type {number} - * @memberof CastApiRecentCasts - */ - readonly viewerFid?: number; - - /** - * Pagination cursor. - * @type {string} - * @memberof CastApiRecentCasts - */ - readonly cursor?: string; - - /** - * Number of results to retrieve (default 25, max 100) - * @type {number} - * @memberof CastApiRecentCasts - */ - readonly limit?: number; -} - -/** - * CastApi - object-oriented interface - * @export - * @class CastApi - * @extends {BaseAPI} - */ -export class CastApi extends BaseAPI { - /** - * 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. - * @throws {RequiredError} - * @memberof CastApi - */ - public allCastsInThread( - requestParameters: CastApiAllCastsInThreadRequest, - options?: AxiosRequestConfig - ) { - return CastApiFp(this.configuration) - .allCastsInThread( - requestParameters.threadHash, - requestParameters.viewerFid, - options - ) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Gets information about an individual cast - * @summary Retrieve cast for a given hash - * @param {CastApiCastRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof CastApi - */ - public cast( - requestParameters: CastApiCastRequest, - options?: AxiosRequestConfig - ) { - return CastApiFp(this.configuration) - .cast(requestParameters.hash, requestParameters.viewerFid, options) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Gets the most recent casts for a user - * @summary Retrieve casts for a given user - * @param {CastApiCastsRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof CastApi - */ - public casts( - requestParameters: CastApiCastsRequest, - options?: AxiosRequestConfig - ) { - return CastApiFp(this.configuration) - .casts( - requestParameters.fid, - requestParameters.viewerFid, - requestParameters.parentUrl, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Get a list of casts from the protocol in reverse chronological order based on timestamp - * @summary Get Recent Casts - * @param {CastApiRecentCastsRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof CastApi - */ - public recentCasts( - requestParameters: CastApiRecentCastsRequest = {}, - options?: AxiosRequestConfig - ) { - return CastApiFp(this.configuration) - .recentCasts( - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(this.axios, this.basePath)); - } -} diff --git a/src/neynar-api/v1/openapi/apis/follows-api.ts b/src/neynar-api/v1/openapi/apis/follows-api.ts index 2ce16342..8cbfef03 100644 --- a/src/neynar-api/v1/openapi/apis/follows-api.ts +++ b/src/neynar-api/v1/openapi/apis/follows-api.ts @@ -5,449 +5,268 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.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"; + +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"; +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"; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; // @ts-ignore -import { ErrorRes } from "../models"; +import { ErrorRes } from '../models'; // @ts-ignore -import { FollowResponse } from "../models"; +import { FollowResponse } from '../models'; /** * FollowsApi - axios parameter creator * @export */ -export const FollowsApiAxiosParamCreator = function ( - configuration?: Configuration -) { - return { - /** - * Gets a list of users who follow a given user in reverse chronological order. - * @summary Gets all followers for a given FID - * @param {number} fid FID of the user - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 150) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - followers: async ( - fid: number, - viewerFid?: number, - cursor?: string, - limit?: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'fid' is not null or undefined - assertParamExists("followers", "fid", fid); - const localVarPath = `/farcaster/followers`; - // 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; - } +export const FollowsApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Gets a list of users who follow a given user in reverse chronological order. + * @summary Gets all followers for a given FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + followers: async (apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('followers', 'apiKey', apiKey) + // verify required parameter 'fid' is not null or undefined + assertParamExists('followers', 'fid', fid) + const localVarPath = `/farcaster/followers`; + // 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; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } - if (fid !== undefined) { - localVarQueryParameter["fid"] = fid; - } + if (viewerFid !== undefined) { + localVarQueryParameter['viewerFid'] = viewerFid; + } - if (viewerFid !== undefined) { - localVarQueryParameter["viewerFid"] = viewerFid; - } + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } - if (cursor !== undefined) { - localVarQueryParameter["cursor"] = cursor; - } + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } - if (limit !== undefined) { - localVarQueryParameter["limit"] = limit; - } + 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, - }; - }, - /** - * Gets a list of users who is following a given user in reverse chronological order. - * @summary Gets all following users of a FID - * @param {number} fid FID of the user - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 150) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - following: async ( - fid: number, - viewerFid?: number, - cursor?: string, - limit?: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'fid' is not null or undefined - assertParamExists("following", "fid", fid); - const localVarPath = `/farcaster/following`; - // 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; - } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Gets a list of users who is following a given user in reverse chronological order. + * @summary Gets all following users of a FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + following: async (apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('following', 'apiKey', apiKey) + // verify required parameter 'fid' is not null or undefined + assertParamExists('following', 'fid', fid) + const localVarPath = `/farcaster/following`; + // 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; - const localVarRequestOptions = { - method: "GET", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); + if (viewerFid !== undefined) { + localVarQueryParameter['viewerFid'] = viewerFid; + } - if (fid !== undefined) { - localVarQueryParameter["fid"] = fid; - } + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } - if (viewerFid !== undefined) { - localVarQueryParameter["viewerFid"] = viewerFid; - } + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } - if (cursor !== undefined) { - localVarQueryParameter["cursor"] = cursor; - } + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } - if (limit !== undefined) { - localVarQueryParameter["limit"] = limit; - } - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } }; /** * FollowsApi - functional programming interface * @export */ -export const FollowsApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = FollowsApiAxiosParamCreator(configuration); - return { +export const FollowsApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = FollowsApiAxiosParamCreator(configuration) + return { + /** + * Gets a list of users who follow a given user in reverse chronological order. + * @summary Gets all followers for a given FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async followers(apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.followers(apiKey, fid, viewerFid, cursor, limit, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Gets a list of users who is following a given user in reverse chronological order. + * @summary Gets all following users of a FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async following(apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.following(apiKey, fid, viewerFid, cursor, limit, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * FollowsApi - factory interface + * @export + */ +export const FollowsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = FollowsApiFp(configuration) + return { + /** + * Gets a list of users who follow a given user in reverse chronological order. + * @summary Gets all followers for a given FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + followers(apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options?: any): AxiosPromise { + return localVarFp.followers(apiKey, fid, viewerFid, cursor, limit, options).then((request) => request(axios, basePath)); + }, + /** + * Gets a list of users who is following a given user in reverse chronological order. + * @summary Gets all following users of a FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + following(apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options?: any): AxiosPromise { + return localVarFp.following(apiKey, fid, viewerFid, cursor, limit, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * FollowsApi - object-oriented interface + * @export + * @class FollowsApi + * @extends {BaseAPI} + */ +export class FollowsApi extends BaseAPI { /** * Gets a list of users who follow a given user in reverse chronological order. * @summary Gets all followers for a given FID + * @param {string} apiKey API key required for authentication. * @param {number} fid FID of the user * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof FollowsApi */ - async followers( - fid: number, - viewerFid?: number, - cursor?: string, - limit?: number, - options?: AxiosRequestConfig - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.followers( - fid, - viewerFid, - cursor, - limit, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, + public followers(apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig) { + return FollowsApiFp(this.configuration).followers(apiKey, fid, viewerFid, cursor, limit, options).then((request) => request(this.axios, this.basePath)); + } + /** * Gets a list of users who is following a given user in reverse chronological order. * @summary Gets all following users of a FID + * @param {string} apiKey API key required for authentication. * @param {number} fid FID of the user * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof FollowsApi */ - async following( - fid: number, - viewerFid?: number, - cursor?: string, - limit?: number, - options?: AxiosRequestConfig - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.following( - fid, - viewerFid, - cursor, - limit, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - }; -}; - -/** - * FollowsApi - factory interface - * @export - */ -export const FollowsApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance -) { - const localVarFp = FollowsApiFp(configuration); - return { - /** - * Gets a list of users who follow a given user in reverse chronological order. - * @summary Gets all followers for a given FID - * @param {FollowsApiFollowersRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - followers( - requestParameters: FollowsApiFollowersRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .followers( - requestParameters.fid, - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(axios, basePath)); - }, - /** - * Gets a list of users who is following a given user in reverse chronological order. - * @summary Gets all following users of a FID - * @param {FollowsApiFollowingRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - following( - requestParameters: FollowsApiFollowingRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .following( - requestParameters.fid, - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * Request parameters for followers operation in FollowsApi. - * @export - * @interface FollowsApiFollowersRequest - */ -export interface FollowsApiFollowersRequest { - /** - * FID of the user - * @type {number} - * @memberof FollowsApiFollowers - */ - readonly fid: number; - - /** - * fid of the user viewing this information, needed for contextual information. - * @type {number} - * @memberof FollowsApiFollowers - */ - readonly viewerFid?: number; - - /** - * Pagination cursor. - * @type {string} - * @memberof FollowsApiFollowers - */ - readonly cursor?: string; - - /** - * Number of results to retrieve (default 25, max 100) - * @type {number} - * @memberof FollowsApiFollowers - */ - readonly limit?: number; -} - -/** - * Request parameters for following operation in FollowsApi. - * @export - * @interface FollowsApiFollowingRequest - */ -export interface FollowsApiFollowingRequest { - /** - * FID of the user - * @type {number} - * @memberof FollowsApiFollowing - */ - readonly fid: number; - - /** - * fid of the user viewing this information, needed for contextual information. - * @type {number} - * @memberof FollowsApiFollowing - */ - readonly viewerFid?: number; - - /** - * Pagination cursor. - * @type {string} - * @memberof FollowsApiFollowing - */ - readonly cursor?: string; - - /** - * Number of results to retrieve (default 25, max 100) - * @type {number} - * @memberof FollowsApiFollowing - */ - readonly limit?: number; + public following(apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig) { + return FollowsApiFp(this.configuration).following(apiKey, fid, viewerFid, cursor, limit, options).then((request) => request(this.axios, this.basePath)); + } } -/** - * FollowsApi - object-oriented interface - * @export - * @class FollowsApi - * @extends {BaseAPI} - */ -export class FollowsApi extends BaseAPI { - /** - * Gets a list of users who follow a given user in reverse chronological order. - * @summary Gets all followers for a given FID - * @param {FollowsApiFollowersRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof FollowsApi - */ - public followers( - requestParameters: FollowsApiFollowersRequest, - options?: AxiosRequestConfig - ) { - return FollowsApiFp(this.configuration) - .followers( - requestParameters.fid, - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Gets a list of users who is following a given user in reverse chronological order. - * @summary Gets all following users of a FID - * @param {FollowsApiFollowingRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof FollowsApi - */ - public following( - requestParameters: FollowsApiFollowingRequest, - options?: AxiosRequestConfig - ) { - return FollowsApiFp(this.configuration) - .following( - requestParameters.fid, - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(this.axios, this.basePath)); - } -} diff --git a/src/neynar-api/v1/openapi/apis/notifications-api.ts b/src/neynar-api/v1/openapi/apis/notifications-api.ts index 828dbabd..1777d853 100644 --- a/src/neynar-api/v1/openapi/apis/notifications-api.ts +++ b/src/neynar-api/v1/openapi/apis/notifications-api.ts @@ -5,460 +5,270 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.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"; + +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"; +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"; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; // @ts-ignore -import { ErrorRes } from "../models"; +import { ErrorRes } from '../models'; // @ts-ignore -import { MentionsAndRepliesResponse } from "../models"; +import { MentionsAndRepliesResponse } from '../models'; // @ts-ignore -import { ReactionsAndRecastsResponse } from "../models"; +import { ReactionsAndRecastsResponse } from '../models'; /** * NotificationsApi - axios parameter creator * @export */ -export const NotificationsApiAxiosParamCreator = function ( - configuration?: Configuration -) { - return { - /** - * Gets a list of mentions and replies to the user’s casts in reverse chronological order - * @summary Get mentions and replies - * @param {number} fid fid of a user - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 150) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - mentionsAndReplies: async ( - fid: number, - viewerFid?: number, - cursor?: string, - limit?: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'fid' is not null or undefined - assertParamExists("mentionsAndReplies", "fid", fid); - const localVarPath = `/farcaster/mentions-and-replies`; - // 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; - } +export const NotificationsApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Gets a list of mentions and replies to the user’s casts in reverse chronological order + * @summary Get mentions and replies + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + mentionsAndReplies: async (apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('mentionsAndReplies', 'apiKey', apiKey) + // verify required parameter 'fid' is not null or undefined + assertParamExists('mentionsAndReplies', 'fid', fid) + const localVarPath = `/farcaster/mentions-and-replies`; + // 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; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } - if (fid !== undefined) { - localVarQueryParameter["fid"] = fid; - } + if (viewerFid !== undefined) { + localVarQueryParameter['viewerFid'] = viewerFid; + } - if (viewerFid !== undefined) { - localVarQueryParameter["viewerFid"] = viewerFid; - } + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } - if (cursor !== undefined) { - localVarQueryParameter["cursor"] = cursor; - } + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } - if (limit !== undefined) { - localVarQueryParameter["limit"] = limit; - } + 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, - }; - }, - /** - * Get a list of reactions and recasts to the users’s casts in reverse chronological order - * @summary Get reactions and recasts - * @param {number} fid fid of a user - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 150) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - reactionsAndRecasts: async ( - fid: number, - viewerFid?: number, - cursor?: string, - limit?: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'fid' is not null or undefined - assertParamExists("reactionsAndRecasts", "fid", fid); - const localVarPath = `/farcaster/reactions-and-recasts`; - // 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; - } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Get a list of reactions and recasts to the users’s casts in reverse chronological order + * @summary Get reactions and recasts + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + reactionsAndRecasts: async (apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('reactionsAndRecasts', 'apiKey', apiKey) + // verify required parameter 'fid' is not null or undefined + assertParamExists('reactionsAndRecasts', 'fid', fid) + const localVarPath = `/farcaster/reactions-and-recasts`; + // 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; - const localVarRequestOptions = { - method: "GET", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); + if (viewerFid !== undefined) { + localVarQueryParameter['viewerFid'] = viewerFid; + } - if (fid !== undefined) { - localVarQueryParameter["fid"] = fid; - } + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } - if (viewerFid !== undefined) { - localVarQueryParameter["viewerFid"] = viewerFid; - } + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } - if (cursor !== undefined) { - localVarQueryParameter["cursor"] = cursor; - } + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } - if (limit !== undefined) { - localVarQueryParameter["limit"] = limit; - } - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } }; /** * NotificationsApi - functional programming interface * @export */ -export const NotificationsApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = - NotificationsApiAxiosParamCreator(configuration); - return { +export const NotificationsApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = NotificationsApiAxiosParamCreator(configuration) + return { + /** + * Gets a list of mentions and replies to the user’s casts in reverse chronological order + * @summary Get mentions and replies + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async mentionsAndReplies(apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.mentionsAndReplies(apiKey, fid, viewerFid, cursor, limit, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Get a list of reactions and recasts to the users’s casts in reverse chronological order + * @summary Get reactions and recasts + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async reactionsAndRecasts(apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.reactionsAndRecasts(apiKey, fid, viewerFid, cursor, limit, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * NotificationsApi - factory interface + * @export + */ +export const NotificationsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = NotificationsApiFp(configuration) + return { + /** + * Gets a list of mentions and replies to the user’s casts in reverse chronological order + * @summary Get mentions and replies + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + mentionsAndReplies(apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options?: any): AxiosPromise { + return localVarFp.mentionsAndReplies(apiKey, fid, viewerFid, cursor, limit, options).then((request) => request(axios, basePath)); + }, + /** + * Get a list of reactions and recasts to the users’s casts in reverse chronological order + * @summary Get reactions and recasts + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + reactionsAndRecasts(apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options?: any): AxiosPromise { + return localVarFp.reactionsAndRecasts(apiKey, fid, viewerFid, cursor, limit, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * NotificationsApi - object-oriented interface + * @export + * @class NotificationsApi + * @extends {BaseAPI} + */ +export class NotificationsApi extends BaseAPI { /** * Gets a list of mentions and replies to the user’s casts in reverse chronological order * @summary Get mentions and replies + * @param {string} apiKey API key required for authentication. * @param {number} fid fid of a user * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof NotificationsApi */ - async mentionsAndReplies( - fid: number, - viewerFid?: number, - cursor?: string, - limit?: number, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.mentionsAndReplies( - fid, - viewerFid, - cursor, - limit, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, + public mentionsAndReplies(apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig) { + return NotificationsApiFp(this.configuration).mentionsAndReplies(apiKey, fid, viewerFid, cursor, limit, options).then((request) => request(this.axios, this.basePath)); + } + /** * Get a list of reactions and recasts to the users’s casts in reverse chronological order * @summary Get reactions and recasts + * @param {string} apiKey API key required for authentication. * @param {number} fid fid of a user * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof NotificationsApi */ - async reactionsAndRecasts( - fid: number, - viewerFid?: number, - cursor?: string, - limit?: number, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.reactionsAndRecasts( - fid, - viewerFid, - cursor, - limit, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - }; -}; - -/** - * NotificationsApi - factory interface - * @export - */ -export const NotificationsApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance -) { - const localVarFp = NotificationsApiFp(configuration); - return { - /** - * Gets a list of mentions and replies to the user’s casts in reverse chronological order - * @summary Get mentions and replies - * @param {NotificationsApiMentionsAndRepliesRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - mentionsAndReplies( - requestParameters: NotificationsApiMentionsAndRepliesRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .mentionsAndReplies( - requestParameters.fid, - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(axios, basePath)); - }, - /** - * Get a list of reactions and recasts to the users’s casts in reverse chronological order - * @summary Get reactions and recasts - * @param {NotificationsApiReactionsAndRecastsRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - reactionsAndRecasts( - requestParameters: NotificationsApiReactionsAndRecastsRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .reactionsAndRecasts( - requestParameters.fid, - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * Request parameters for mentionsAndReplies operation in NotificationsApi. - * @export - * @interface NotificationsApiMentionsAndRepliesRequest - */ -export interface NotificationsApiMentionsAndRepliesRequest { - /** - * fid of a user - * @type {number} - * @memberof NotificationsApiMentionsAndReplies - */ - readonly fid: number; - - /** - * fid of the user viewing this information, needed for contextual information. - * @type {number} - * @memberof NotificationsApiMentionsAndReplies - */ - readonly viewerFid?: number; - - /** - * Pagination cursor. - * @type {string} - * @memberof NotificationsApiMentionsAndReplies - */ - readonly cursor?: string; - - /** - * Number of results to retrieve (default 25, max 150) - * @type {number} - * @memberof NotificationsApiMentionsAndReplies - */ - readonly limit?: number; -} - -/** - * Request parameters for reactionsAndRecasts operation in NotificationsApi. - * @export - * @interface NotificationsApiReactionsAndRecastsRequest - */ -export interface NotificationsApiReactionsAndRecastsRequest { - /** - * fid of a user - * @type {number} - * @memberof NotificationsApiReactionsAndRecasts - */ - readonly fid: number; - - /** - * fid of the user viewing this information, needed for contextual information. - * @type {number} - * @memberof NotificationsApiReactionsAndRecasts - */ - readonly viewerFid?: number; - - /** - * Pagination cursor. - * @type {string} - * @memberof NotificationsApiReactionsAndRecasts - */ - readonly cursor?: string; - - /** - * Number of results to retrieve (default 25, max 150) - * @type {number} - * @memberof NotificationsApiReactionsAndRecasts - */ - readonly limit?: number; + public reactionsAndRecasts(apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig) { + return NotificationsApiFp(this.configuration).reactionsAndRecasts(apiKey, fid, viewerFid, cursor, limit, options).then((request) => request(this.axios, this.basePath)); + } } -/** - * NotificationsApi - object-oriented interface - * @export - * @class NotificationsApi - * @extends {BaseAPI} - */ -export class NotificationsApi extends BaseAPI { - /** - * Gets a list of mentions and replies to the user’s casts in reverse chronological order - * @summary Get mentions and replies - * @param {NotificationsApiMentionsAndRepliesRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof NotificationsApi - */ - public mentionsAndReplies( - requestParameters: NotificationsApiMentionsAndRepliesRequest, - options?: AxiosRequestConfig - ) { - return NotificationsApiFp(this.configuration) - .mentionsAndReplies( - requestParameters.fid, - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Get a list of reactions and recasts to the users’s casts in reverse chronological order - * @summary Get reactions and recasts - * @param {NotificationsApiReactionsAndRecastsRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof NotificationsApi - */ - public reactionsAndRecasts( - requestParameters: NotificationsApiReactionsAndRecastsRequest, - options?: AxiosRequestConfig - ) { - return NotificationsApiFp(this.configuration) - .reactionsAndRecasts( - requestParameters.fid, - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(this.axios, this.basePath)); - } -} diff --git a/src/neynar-api/v1/openapi/apis/reactions-api.ts b/src/neynar-api/v1/openapi/apis/reactions-api.ts index 14ed7e0d..853d865b 100644 --- a/src/neynar-api/v1/openapi/apis/reactions-api.ts +++ b/src/neynar-api/v1/openapi/apis/reactions-api.ts @@ -5,647 +5,376 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.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"; + +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"; +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"; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; // @ts-ignore -import { CastLikesResponse } from "../models"; +import { CastLikesResponse } from '../models'; // @ts-ignore -import { CastReactionsResponse } from "../models"; +import { CastReactionsResponse } from '../models'; // @ts-ignore -import { CastRecasterResponse } from "../models"; +import { CastRecasterResponse } from '../models'; // @ts-ignore -import { ErrorRes } from "../models"; +import { ErrorRes } from '../models'; /** * ReactionsApi - axios parameter creator * @export */ -export const ReactionsApiAxiosParamCreator = function ( - configuration?: Configuration -) { - return { - /** - * Get all like reactions for a specific cast in reverse chronological order. - * @summary Get all like reactions for a specific cast - * @param {string} castHash Cast hash - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 150) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - castLikes: async ( - castHash: string, - viewerFid?: number, - cursor?: string, - limit?: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'castHash' is not null or undefined - assertParamExists("castLikes", "castHash", castHash); - const localVarPath = `/farcaster/cast-likes`; - // 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; - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - if (castHash !== undefined) { - localVarQueryParameter["castHash"] = castHash; - } - - if (viewerFid !== undefined) { - localVarQueryParameter["viewerFid"] = viewerFid; - } - - if (cursor !== undefined) { - localVarQueryParameter["cursor"] = cursor; - } - - if (limit !== undefined) { - localVarQueryParameter["limit"] = limit; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Get all reactions (likes and recasts) for a specific cast. - * @summary Get all reactions for a specific cast - * @param {string} castHash Cast hash - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 150) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - castReactions: async ( - castHash: string, - viewerFid?: number, - cursor?: string, - limit?: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'castHash' is not null or undefined - assertParamExists("castReactions", "castHash", castHash); - const localVarPath = `/farcaster/cast-reactions`; - // 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; - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - if (castHash !== undefined) { - localVarQueryParameter["castHash"] = castHash; - } - - if (viewerFid !== undefined) { - localVarQueryParameter["viewerFid"] = viewerFid; - } - - if (cursor !== undefined) { - localVarQueryParameter["cursor"] = cursor; - } - - if (limit !== undefined) { - localVarQueryParameter["limit"] = limit; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Get all recasters for a specific cast. - * @summary Get all recasters for a specific cast - * @param {string} castHash Cast hash - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 150) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - castRecasters: async ( - castHash: string, - viewerFid?: number, - cursor?: string, - limit?: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'castHash' is not null or undefined - assertParamExists("castRecasters", "castHash", castHash); - const localVarPath = `/farcaster/cast-recasters`; - // 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; - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - if (castHash !== undefined) { - localVarQueryParameter["castHash"] = castHash; - } - - if (viewerFid !== undefined) { - localVarQueryParameter["viewerFid"] = viewerFid; - } - - if (cursor !== undefined) { - localVarQueryParameter["cursor"] = cursor; - } - - if (limit !== undefined) { - localVarQueryParameter["limit"] = limit; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; +export const ReactionsApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Get all like reactions for a specific cast in reverse chronological order. + * @summary Get all like reactions for a specific cast + * @param {string} apiKey API key required for authentication. + * @param {string} castHash Cast hash + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + castLikes: async (apiKey: string, castHash: string, viewerFid?: number, cursor?: string, limit?: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('castLikes', 'apiKey', apiKey) + // verify required parameter 'castHash' is not null or undefined + assertParamExists('castLikes', 'castHash', castHash) + const localVarPath = `/farcaster/cast-likes`; + // 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 (castHash !== undefined) { + localVarQueryParameter['castHash'] = castHash; + } + + if (viewerFid !== undefined) { + localVarQueryParameter['viewerFid'] = viewerFid; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + 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, + }; + }, + /** + * Get all reactions (likes and recasts) for a specific cast. + * @summary Get all reactions for a specific cast + * @param {string} apiKey API key required for authentication. + * @param {string} castHash Cast hash + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + castReactions: async (apiKey: string, castHash: string, viewerFid?: number, cursor?: string, limit?: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('castReactions', 'apiKey', apiKey) + // verify required parameter 'castHash' is not null or undefined + assertParamExists('castReactions', 'castHash', castHash) + const localVarPath = `/farcaster/cast-reactions`; + // 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 (castHash !== undefined) { + localVarQueryParameter['castHash'] = castHash; + } + + if (viewerFid !== undefined) { + localVarQueryParameter['viewerFid'] = viewerFid; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + 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, + }; + }, + /** + * Get all recasters for a specific cast. + * @summary Get all recasters for a specific cast + * @param {string} apiKey API key required for authentication. + * @param {string} castHash Cast hash + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + castRecasters: async (apiKey: string, castHash: string, viewerFid?: number, cursor?: string, limit?: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('castRecasters', 'apiKey', apiKey) + // verify required parameter 'castHash' is not null or undefined + assertParamExists('castRecasters', 'castHash', castHash) + const localVarPath = `/farcaster/cast-recasters`; + // 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 (castHash !== undefined) { + localVarQueryParameter['castHash'] = castHash; + } + + if (viewerFid !== undefined) { + localVarQueryParameter['viewerFid'] = viewerFid; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + 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, + }; + }, + } }; /** * ReactionsApi - functional programming interface * @export */ -export const ReactionsApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = - ReactionsApiAxiosParamCreator(configuration); - return { +export const ReactionsApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = ReactionsApiAxiosParamCreator(configuration) + return { + /** + * Get all like reactions for a specific cast in reverse chronological order. + * @summary Get all like reactions for a specific cast + * @param {string} apiKey API key required for authentication. + * @param {string} castHash Cast hash + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async castLikes(apiKey: string, castHash: string, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.castLikes(apiKey, castHash, viewerFid, cursor, limit, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Get all reactions (likes and recasts) for a specific cast. + * @summary Get all reactions for a specific cast + * @param {string} apiKey API key required for authentication. + * @param {string} castHash Cast hash + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async castReactions(apiKey: string, castHash: string, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.castReactions(apiKey, castHash, viewerFid, cursor, limit, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Get all recasters for a specific cast. + * @summary Get all recasters for a specific cast + * @param {string} apiKey API key required for authentication. + * @param {string} castHash Cast hash + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async castRecasters(apiKey: string, castHash: string, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.castRecasters(apiKey, castHash, viewerFid, cursor, limit, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * ReactionsApi - factory interface + * @export + */ +export const ReactionsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = ReactionsApiFp(configuration) + return { + /** + * Get all like reactions for a specific cast in reverse chronological order. + * @summary Get all like reactions for a specific cast + * @param {string} apiKey API key required for authentication. + * @param {string} castHash Cast hash + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + castLikes(apiKey: string, castHash: string, viewerFid?: number, cursor?: string, limit?: number, options?: any): AxiosPromise { + return localVarFp.castLikes(apiKey, castHash, viewerFid, cursor, limit, options).then((request) => request(axios, basePath)); + }, + /** + * Get all reactions (likes and recasts) for a specific cast. + * @summary Get all reactions for a specific cast + * @param {string} apiKey API key required for authentication. + * @param {string} castHash Cast hash + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + castReactions(apiKey: string, castHash: string, viewerFid?: number, cursor?: string, limit?: number, options?: any): AxiosPromise { + return localVarFp.castReactions(apiKey, castHash, viewerFid, cursor, limit, options).then((request) => request(axios, basePath)); + }, + /** + * Get all recasters for a specific cast. + * @summary Get all recasters for a specific cast + * @param {string} apiKey API key required for authentication. + * @param {string} castHash Cast hash + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + castRecasters(apiKey: string, castHash: string, viewerFid?: number, cursor?: string, limit?: number, options?: any): AxiosPromise { + return localVarFp.castRecasters(apiKey, castHash, viewerFid, cursor, limit, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * ReactionsApi - object-oriented interface + * @export + * @class ReactionsApi + * @extends {BaseAPI} + */ +export class ReactionsApi extends BaseAPI { /** * Get all like reactions for a specific cast in reverse chronological order. * @summary Get all like reactions for a specific cast + * @param {string} apiKey API key required for authentication. * @param {string} castHash Cast hash * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof ReactionsApi */ - async castLikes( - castHash: string, - viewerFid?: number, - cursor?: string, - limit?: number, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.castLikes( - castHash, - viewerFid, - cursor, - limit, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, + public castLikes(apiKey: string, castHash: string, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig) { + return ReactionsApiFp(this.configuration).castLikes(apiKey, castHash, viewerFid, cursor, limit, options).then((request) => request(this.axios, this.basePath)); + } + /** * Get all reactions (likes and recasts) for a specific cast. * @summary Get all reactions for a specific cast + * @param {string} apiKey API key required for authentication. * @param {string} castHash Cast hash * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof ReactionsApi */ - async castReactions( - castHash: string, - viewerFid?: number, - cursor?: string, - limit?: number, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.castReactions( - castHash, - viewerFid, - cursor, - limit, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, + public castReactions(apiKey: string, castHash: string, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig) { + return ReactionsApiFp(this.configuration).castReactions(apiKey, castHash, viewerFid, cursor, limit, options).then((request) => request(this.axios, this.basePath)); + } + /** * Get all recasters for a specific cast. * @summary Get all recasters for a specific cast + * @param {string} apiKey API key required for authentication. * @param {string} castHash Cast hash * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof ReactionsApi */ - async castRecasters( - castHash: string, - viewerFid?: number, - cursor?: string, - limit?: number, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.castRecasters( - castHash, - viewerFid, - cursor, - limit, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - }; -}; - -/** - * ReactionsApi - factory interface - * @export - */ -export const ReactionsApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance -) { - const localVarFp = ReactionsApiFp(configuration); - return { - /** - * Get all like reactions for a specific cast in reverse chronological order. - * @summary Get all like reactions for a specific cast - * @param {ReactionsApiCastLikesRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - castLikes( - requestParameters: ReactionsApiCastLikesRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .castLikes( - requestParameters.castHash, - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(axios, basePath)); - }, - /** - * Get all reactions (likes and recasts) for a specific cast. - * @summary Get all reactions for a specific cast - * @param {ReactionsApiCastReactionsRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - castReactions( - requestParameters: ReactionsApiCastReactionsRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .castReactions( - requestParameters.castHash, - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(axios, basePath)); - }, - /** - * Get all recasters for a specific cast. - * @summary Get all recasters for a specific cast - * @param {ReactionsApiCastRecastersRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - castRecasters( - requestParameters: ReactionsApiCastRecastersRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .castRecasters( - requestParameters.castHash, - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * Request parameters for castLikes operation in ReactionsApi. - * @export - * @interface ReactionsApiCastLikesRequest - */ -export interface ReactionsApiCastLikesRequest { - /** - * Cast hash - * @type {string} - * @memberof ReactionsApiCastLikes - */ - readonly castHash: string; - - /** - * fid of the user viewing this information, needed for contextual information. - * @type {number} - * @memberof ReactionsApiCastLikes - */ - readonly viewerFid?: number; - - /** - * Pagination cursor. - * @type {string} - * @memberof ReactionsApiCastLikes - */ - readonly cursor?: string; - - /** - * Number of results to retrieve (default 25, max 150) - * @type {number} - * @memberof ReactionsApiCastLikes - */ - readonly limit?: number; -} - -/** - * Request parameters for castReactions operation in ReactionsApi. - * @export - * @interface ReactionsApiCastReactionsRequest - */ -export interface ReactionsApiCastReactionsRequest { - /** - * Cast hash - * @type {string} - * @memberof ReactionsApiCastReactions - */ - readonly castHash: string; - - /** - * fid of the user viewing this information, needed for contextual information. - * @type {number} - * @memberof ReactionsApiCastReactions - */ - readonly viewerFid?: number; - - /** - * Pagination cursor. - * @type {string} - * @memberof ReactionsApiCastReactions - */ - readonly cursor?: string; - - /** - * Number of results to retrieve (default 25, max 150) - * @type {number} - * @memberof ReactionsApiCastReactions - */ - readonly limit?: number; -} - -/** - * Request parameters for castRecasters operation in ReactionsApi. - * @export - * @interface ReactionsApiCastRecastersRequest - */ -export interface ReactionsApiCastRecastersRequest { - /** - * Cast hash - * @type {string} - * @memberof ReactionsApiCastRecasters - */ - readonly castHash: string; - - /** - * fid of the user viewing this information, needed for contextual information. - * @type {number} - * @memberof ReactionsApiCastRecasters - */ - readonly viewerFid?: number; - - /** - * Pagination cursor. - * @type {string} - * @memberof ReactionsApiCastRecasters - */ - readonly cursor?: string; - - /** - * Number of results to retrieve (default 25, max 150) - * @type {number} - * @memberof ReactionsApiCastRecasters - */ - readonly limit?: number; + public castRecasters(apiKey: string, castHash: string, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig) { + return ReactionsApiFp(this.configuration).castRecasters(apiKey, castHash, viewerFid, cursor, limit, options).then((request) => request(this.axios, this.basePath)); + } } -/** - * ReactionsApi - object-oriented interface - * @export - * @class ReactionsApi - * @extends {BaseAPI} - */ -export class ReactionsApi extends BaseAPI { - /** - * Get all like reactions for a specific cast in reverse chronological order. - * @summary Get all like reactions for a specific cast - * @param {ReactionsApiCastLikesRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ReactionsApi - */ - public castLikes( - requestParameters: ReactionsApiCastLikesRequest, - options?: AxiosRequestConfig - ) { - return ReactionsApiFp(this.configuration) - .castLikes( - requestParameters.castHash, - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Get all reactions (likes and recasts) for a specific cast. - * @summary Get all reactions for a specific cast - * @param {ReactionsApiCastReactionsRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ReactionsApi - */ - public castReactions( - requestParameters: ReactionsApiCastReactionsRequest, - options?: AxiosRequestConfig - ) { - return ReactionsApiFp(this.configuration) - .castReactions( - requestParameters.castHash, - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Get all recasters for a specific cast. - * @summary Get all recasters for a specific cast - * @param {ReactionsApiCastRecastersRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ReactionsApi - */ - public castRecasters( - requestParameters: ReactionsApiCastRecastersRequest, - options?: AxiosRequestConfig - ) { - return ReactionsApiFp(this.configuration) - .castRecasters( - requestParameters.castHash, - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(this.axios, this.basePath)); - } -} diff --git a/src/neynar-api/v1/openapi/apis/user-api.ts b/src/neynar-api/v1/openapi/apis/user-api.ts index 318e3b9b..50583f5a 100644 --- a/src/neynar-api/v1/openapi/apis/user-api.ts +++ b/src/neynar-api/v1/openapi/apis/user-api.ts @@ -5,862 +5,520 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.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"; + +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"; +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"; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; // @ts-ignore -import { CustodyAddressResponse } from "../models"; +import { CustodyAddressResponse } from '../models'; // @ts-ignore -import { ErrorRes } from "../models"; +import { ErrorRes } from '../models'; // @ts-ignore -import { RecentUsersResponse } from "../models"; +import { RecentUsersResponse } from '../models'; // @ts-ignore -import { User200Response } from "../models"; +import { User200Response } from '../models'; // @ts-ignore -import { UserCastLikeResponse } from "../models"; +import { UserCastLikeResponse } from '../models'; /** * UserApi - axios parameter creator * @export */ -export const UserApiAxiosParamCreator = function ( - configuration?: Configuration -) { - return { - /** - * Returns the custody address for a given FID - * @summary Get the custody address for a given FID - * @param {number} fid fid of a user - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - custodyAddress: async ( - fid: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'fid' is not null or undefined - assertParamExists("custodyAddress", "fid", fid); - const localVarPath = `/farcaster/custody-address`; - // 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; - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - if (fid !== undefined) { - localVarQueryParameter["fid"] = fid; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Get a list of casts from the protocol in reverse chronological order based on timestamp - * @summary Get Recent Users - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 100, max 1000) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - recentUsers: async ( - viewerFid?: number, - cursor?: string, - limit?: number, - options: AxiosRequestConfig = {} - ): Promise => { - const localVarPath = `/farcaster/recent-users`; - // 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; - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - if (viewerFid !== undefined) { - localVarQueryParameter["viewerFid"] = viewerFid; - } - - if (cursor !== undefined) { - localVarQueryParameter["cursor"] = cursor; - } - - if (limit !== undefined) { - localVarQueryParameter["limit"] = limit; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Returns metadata about a specific user - * @summary Get User Information by FID - * @param {number} fid fid of a user - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - user: async ( - fid: number, - viewerFid?: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'fid' is not null or undefined - assertParamExists("user", "fid", fid); - const localVarPath = `/farcaster/user`; - // 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; - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - if (fid !== undefined) { - localVarQueryParameter["fid"] = fid; - } - - if (viewerFid !== undefined) { - localVarQueryParameter["viewerFid"] = viewerFid; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Returns metadata about a specific user - * @summary Get User Information by username - * @param {string} username Username of the user - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - userByUsername: async ( - username: string, - viewerFid?: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'username' is not null or undefined - assertParamExists("userByUsername", "username", username); - const localVarPath = `/farcaster/user-by-username`; - // 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; - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - if (username !== undefined) { - localVarQueryParameter["username"] = username; - } - - if (viewerFid !== undefined) { - localVarQueryParameter["viewerFid"] = viewerFid; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Fetch all the liked cast of a User - * @summary Get User Cast Likes - * @param {number} fid FID of the user - * @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 {string} [cursor] Pagination cursor - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - userCastLikes: async ( - fid: number, - viewerFid?: number, - limit?: number, - cursor?: string, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'fid' is not null or undefined - assertParamExists("userCastLikes", "fid", fid); - const localVarPath = `/farcaster/user-cast-likes`; - // 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; - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - if (fid !== undefined) { - localVarQueryParameter["fid"] = fid; - } - - if (viewerFid !== undefined) { - localVarQueryParameter["viewerFid"] = viewerFid; - } - - if (limit !== undefined) { - localVarQueryParameter["limit"] = limit; - } - - if (cursor !== undefined) { - localVarQueryParameter["cursor"] = cursor; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; +export const UserApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Returns the custody address for a given FID + * @summary Get the custody address for a given FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + custodyAddress: async (apiKey: string, fid: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('custodyAddress', 'apiKey', apiKey) + // verify required parameter 'fid' is not null or undefined + assertParamExists('custodyAddress', 'fid', fid) + const localVarPath = `/farcaster/custody-address`; + // 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 (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } + + 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, + }; + }, + /** + * Get a list of casts from the protocol in reverse chronological order based on timestamp + * @summary Get Recent Users + * @param {string} apiKey API key required for authentication. + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to retrieve (default 100, max 1000) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + recentUsers: async (apiKey: string, viewerFid?: number, cursor?: string, limit?: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('recentUsers', 'apiKey', apiKey) + const localVarPath = `/farcaster/recent-users`; + // 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 (viewerFid !== undefined) { + localVarQueryParameter['viewerFid'] = viewerFid; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + 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, + }; + }, + /** + * Returns metadata about a specific user + * @summary Get User Information by FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + user: async (apiKey: string, fid: number, viewerFid?: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('user', 'apiKey', apiKey) + // verify required parameter 'fid' is not null or undefined + assertParamExists('user', 'fid', fid) + const localVarPath = `/farcaster/user`; + // 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 (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } + + if (viewerFid !== undefined) { + localVarQueryParameter['viewerFid'] = viewerFid; + } + + 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, + }; + }, + /** + * Returns metadata about a specific user + * @summary Get User Information by username + * @param {string} apiKey API key required for authentication. + * @param {string} username Username of the user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userByUsername: async (apiKey: string, username: string, viewerFid?: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('userByUsername', 'apiKey', apiKey) + // verify required parameter 'username' is not null or undefined + assertParamExists('userByUsername', 'username', username) + const localVarPath = `/farcaster/user-by-username`; + // 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 (username !== undefined) { + localVarQueryParameter['username'] = username; + } + + if (viewerFid !== undefined) { + localVarQueryParameter['viewerFid'] = viewerFid; + } + + 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, + }; + }, + /** + * Fetch all the liked cast of a User + * @summary Get User Cast Likes + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user + * @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 {string} [cursor] Pagination cursor + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userCastLikes: async (apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('userCastLikes', 'apiKey', apiKey) + // verify required parameter 'fid' is not null or undefined + assertParamExists('userCastLikes', 'fid', fid) + const localVarPath = `/farcaster/user-cast-likes`; + // 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 (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } + + if (viewerFid !== undefined) { + localVarQueryParameter['viewerFid'] = viewerFid; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + 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, + }; + }, + } }; /** * UserApi - functional programming interface * @export */ -export const UserApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = UserApiAxiosParamCreator(configuration); - return { +export const UserApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = UserApiAxiosParamCreator(configuration) + return { + /** + * Returns the custody address for a given FID + * @summary Get the custody address for a given FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async custodyAddress(apiKey: string, fid: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.custodyAddress(apiKey, fid, options); + 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 Users + * @param {string} apiKey API key required for authentication. + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to retrieve (default 100, max 1000) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async recentUsers(apiKey: string, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.recentUsers(apiKey, viewerFid, cursor, limit, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns metadata about a specific user + * @summary Get User Information by FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async user(apiKey: string, fid: number, viewerFid?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.user(apiKey, fid, viewerFid, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns metadata about a specific user + * @summary Get User Information by username + * @param {string} apiKey API key required for authentication. + * @param {string} username Username of the user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async userByUsername(apiKey: string, username: string, viewerFid?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.userByUsername(apiKey, username, viewerFid, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Fetch all the liked cast of a User + * @summary Get User Cast Likes + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user + * @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 {string} [cursor] Pagination cursor + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async userCastLikes(apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.userCastLikes(apiKey, fid, viewerFid, limit, cursor, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * UserApi - factory interface + * @export + */ +export const UserApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = UserApiFp(configuration) + return { + /** + * Returns the custody address for a given FID + * @summary Get the custody address for a given FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + custodyAddress(apiKey: string, fid: number, options?: any): AxiosPromise { + return localVarFp.custodyAddress(apiKey, fid, options).then((request) => request(axios, basePath)); + }, + /** + * Get a list of casts from the protocol in reverse chronological order based on timestamp + * @summary Get Recent Users + * @param {string} apiKey API key required for authentication. + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of results to retrieve (default 100, max 1000) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + recentUsers(apiKey: string, viewerFid?: number, cursor?: string, limit?: number, options?: any): AxiosPromise { + return localVarFp.recentUsers(apiKey, viewerFid, cursor, limit, options).then((request) => request(axios, basePath)); + }, + /** + * Returns metadata about a specific user + * @summary Get User Information by FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of a user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + user(apiKey: string, fid: number, viewerFid?: number, options?: any): AxiosPromise { + return localVarFp.user(apiKey, fid, viewerFid, options).then((request) => request(axios, basePath)); + }, + /** + * Returns metadata about a specific user + * @summary Get User Information by username + * @param {string} apiKey API key required for authentication. + * @param {string} username Username of the user + * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userByUsername(apiKey: string, username: string, viewerFid?: number, options?: any): AxiosPromise { + return localVarFp.userByUsername(apiKey, username, viewerFid, options).then((request) => request(axios, basePath)); + }, + /** + * Fetch all the liked cast of a User + * @summary Get User Cast Likes + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user + * @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 {string} [cursor] Pagination cursor + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userCastLikes(apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.userCastLikes(apiKey, fid, viewerFid, limit, cursor, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * UserApi - object-oriented interface + * @export + * @class UserApi + * @extends {BaseAPI} + */ +export class UserApi extends BaseAPI { /** * Returns the custody address for a given FID * @summary Get the custody address for a given FID + * @param {string} apiKey API key required for authentication. * @param {number} fid fid of a user * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof UserApi */ - async custodyAddress( - fid: number, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.custodyAddress( - fid, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, + public custodyAddress(apiKey: string, fid: number, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).custodyAddress(apiKey, fid, options).then((request) => request(this.axios, this.basePath)); + } + /** * Get a list of casts from the protocol in reverse chronological order based on timestamp * @summary Get Recent Users + * @param {string} apiKey API key required for authentication. * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 100, max 1000) * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof UserApi */ - async recentUsers( - viewerFid?: number, - cursor?: string, - limit?: number, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.recentUsers( - viewerFid, - cursor, - limit, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, + public recentUsers(apiKey: string, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).recentUsers(apiKey, viewerFid, cursor, limit, options).then((request) => request(this.axios, this.basePath)); + } + /** * Returns metadata about a specific user * @summary Get User Information by FID + * @param {string} apiKey API key required for authentication. * @param {number} fid fid of a user * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof UserApi */ - async user( - fid: number, - viewerFid?: number, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.user( - fid, - viewerFid, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, + public user(apiKey: string, fid: number, viewerFid?: number, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).user(apiKey, fid, viewerFid, options).then((request) => request(this.axios, this.basePath)); + } + /** * Returns metadata about a specific user * @summary Get User Information by username + * @param {string} apiKey API key required for authentication. * @param {string} username Username of the user * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof UserApi */ - async userByUsername( - username: string, - viewerFid?: number, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.userByUsername( - username, - viewerFid, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, + public userByUsername(apiKey: string, username: string, viewerFid?: number, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).userByUsername(apiKey, username, viewerFid, options).then((request) => request(this.axios, this.basePath)); + } + /** * Fetch all the liked cast of a User * @summary Get User Cast Likes + * @param {string} apiKey API key required for authentication. * @param {number} fid FID of the user * @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 {string} [cursor] Pagination cursor * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof UserApi */ - async userCastLikes( - fid: number, - viewerFid?: number, - limit?: number, - cursor?: string, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.userCastLikes( - fid, - viewerFid, - limit, - cursor, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - }; -}; - -/** - * UserApi - factory interface - * @export - */ -export const UserApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance -) { - const localVarFp = UserApiFp(configuration); - return { - /** - * Returns the custody address for a given FID - * @summary Get the custody address for a given FID - * @param {UserApiCustodyAddressRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - custodyAddress( - requestParameters: UserApiCustodyAddressRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .custodyAddress(requestParameters.fid, options) - .then((request) => request(axios, basePath)); - }, - /** - * Get a list of casts from the protocol in reverse chronological order based on timestamp - * @summary Get Recent Users - * @param {UserApiRecentUsersRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - recentUsers( - requestParameters: UserApiRecentUsersRequest = {}, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .recentUsers( - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(axios, basePath)); - }, - /** - * Returns metadata about a specific user - * @summary Get User Information by FID - * @param {UserApiUserRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - user( - requestParameters: UserApiUserRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .user(requestParameters.fid, requestParameters.viewerFid, options) - .then((request) => request(axios, basePath)); - }, - /** - * Returns metadata about a specific user - * @summary Get User Information by username - * @param {UserApiUserByUsernameRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - userByUsername( - requestParameters: UserApiUserByUsernameRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .userByUsername( - requestParameters.username, - requestParameters.viewerFid, - options - ) - .then((request) => request(axios, basePath)); - }, - /** - * Fetch all the liked cast of a User - * @summary Get User Cast Likes - * @param {UserApiUserCastLikesRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - userCastLikes( - requestParameters: UserApiUserCastLikesRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .userCastLikes( - requestParameters.fid, - requestParameters.viewerFid, - requestParameters.limit, - requestParameters.cursor, - options - ) - .then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * Request parameters for custodyAddress operation in UserApi. - * @export - * @interface UserApiCustodyAddressRequest - */ -export interface UserApiCustodyAddressRequest { - /** - * fid of a user - * @type {number} - * @memberof UserApiCustodyAddress - */ - readonly fid: number; + public userCastLikes(apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).userCastLikes(apiKey, fid, viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); + } } -/** - * Request parameters for recentUsers operation in UserApi. - * @export - * @interface UserApiRecentUsersRequest - */ -export interface UserApiRecentUsersRequest { - /** - * fid of the user viewing this information, needed for contextual information. - * @type {number} - * @memberof UserApiRecentUsers - */ - readonly viewerFid?: number; - - /** - * Pagination cursor. - * @type {string} - * @memberof UserApiRecentUsers - */ - readonly cursor?: string; - - /** - * Number of results to retrieve (default 100, max 1000) - * @type {number} - * @memberof UserApiRecentUsers - */ - readonly limit?: number; -} - -/** - * Request parameters for user operation in UserApi. - * @export - * @interface UserApiUserRequest - */ -export interface UserApiUserRequest { - /** - * fid of a user - * @type {number} - * @memberof UserApiUser - */ - readonly fid: number; - - /** - * fid of the user viewing this information, needed for contextual information. - * @type {number} - * @memberof UserApiUser - */ - readonly viewerFid?: number; -} - -/** - * Request parameters for userByUsername operation in UserApi. - * @export - * @interface UserApiUserByUsernameRequest - */ -export interface UserApiUserByUsernameRequest { - /** - * Username of the user - * @type {string} - * @memberof UserApiUserByUsername - */ - readonly username: string; - - /** - * fid of the user viewing this information, needed for contextual information. - * @type {number} - * @memberof UserApiUserByUsername - */ - readonly viewerFid?: number; -} - -/** - * Request parameters for userCastLikes operation in UserApi. - * @export - * @interface UserApiUserCastLikesRequest - */ -export interface UserApiUserCastLikesRequest { - /** - * FID of the user - * @type {number} - * @memberof UserApiUserCastLikes - */ - readonly fid: number; - - /** - * fid of the user viewing this information, needed for contextual information. - * @type {number} - * @memberof UserApiUserCastLikes - */ - readonly viewerFid?: number; - - /** - * Number of results to retrieve (default 25, max 150) - * @type {number} - * @memberof UserApiUserCastLikes - */ - readonly limit?: number; - - /** - * Pagination cursor - * @type {string} - * @memberof UserApiUserCastLikes - */ - readonly cursor?: string; -} - -/** - * UserApi - object-oriented interface - * @export - * @class UserApi - * @extends {BaseAPI} - */ -export class UserApi extends BaseAPI { - /** - * Returns the custody address for a given FID - * @summary Get the custody address for a given FID - * @param {UserApiCustodyAddressRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public custodyAddress( - requestParameters: UserApiCustodyAddressRequest, - options?: AxiosRequestConfig - ) { - return UserApiFp(this.configuration) - .custodyAddress(requestParameters.fid, options) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Get a list of casts from the protocol in reverse chronological order based on timestamp - * @summary Get Recent Users - * @param {UserApiRecentUsersRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public recentUsers( - requestParameters: UserApiRecentUsersRequest = {}, - options?: AxiosRequestConfig - ) { - return UserApiFp(this.configuration) - .recentUsers( - requestParameters.viewerFid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Returns metadata about a specific user - * @summary Get User Information by FID - * @param {UserApiUserRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public user( - requestParameters: UserApiUserRequest, - options?: AxiosRequestConfig - ) { - return UserApiFp(this.configuration) - .user(requestParameters.fid, requestParameters.viewerFid, options) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Returns metadata about a specific user - * @summary Get User Information by username - * @param {UserApiUserByUsernameRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public userByUsername( - requestParameters: UserApiUserByUsernameRequest, - options?: AxiosRequestConfig - ) { - return UserApiFp(this.configuration) - .userByUsername( - requestParameters.username, - requestParameters.viewerFid, - options - ) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Fetch all the liked cast of a User - * @summary Get User Cast Likes - * @param {UserApiUserCastLikesRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public userCastLikes( - requestParameters: UserApiUserCastLikesRequest, - options?: AxiosRequestConfig - ) { - return UserApiFp(this.configuration) - .userCastLikes( - requestParameters.fid, - requestParameters.viewerFid, - requestParameters.limit, - requestParameters.cursor, - options - ) - .then((request) => request(this.axios, this.basePath)); - } -} diff --git a/src/neynar-api/v1/openapi/apis/verification-api.ts b/src/neynar-api/v1/openapi/apis/verification-api.ts index 509f1b8c..a8b79c71 100644 --- a/src/neynar-api/v1/openapi/apis/verification-api.ts +++ b/src/neynar-api/v1/openapi/apis/verification-api.ts @@ -1,340 +1,226 @@ /* tslint:disable */ /* eslint-disable */ /** - * vFarcaster API V1 + * Farcaster API V1 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.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"; + +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"; +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"; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; // @ts-ignore -import { ErrorRes } from "../models"; +import { ErrorRes } from '../models'; // @ts-ignore -import { User200Response } from "../models"; +import { User200Response } from '../models'; // @ts-ignore -import { VerificationResponse } from "../models"; +import { VerificationResponse } from '../models'; /** * VerificationApi - axios parameter creator * @export */ -export const VerificationApiAxiosParamCreator = function ( - configuration?: Configuration -) { - return { - /** - * Checks if a given Ethereum address has a Farcaster user associated with it. Note: if an address is associated with multiple users, the API will return the user who most recently published a verification with the address (based on when Warpcast received the proof, not a self-reported timestamp). - * @summary Retrieve user for a given ethereum address - * @param {string} address - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - userByVerification: async ( - address: string, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'address' is not null or undefined - assertParamExists("userByVerification", "address", address); - const localVarPath = `/farcaster/user-by-verification`; - // 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; - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - if (address !== undefined) { - localVarQueryParameter["address"] = address; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Get all known verifications of a user - * @summary Retrieve verifications for a given FID - * @param {number} fid FID of the user - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - verifications: async ( - fid: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'fid' is not null or undefined - assertParamExists("verifications", "fid", fid); - const localVarPath = `/farcaster/verifications`; - // 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; - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - if (fid !== undefined) { - localVarQueryParameter["fid"] = fid; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; +export const VerificationApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Checks if a given Ethereum address has a Farcaster user associated with it. Note: if an address is associated with multiple users, the API will return the user who most recently published a verification with the address (based on when Warpcast received the proof, not a self-reported timestamp). + * @summary Retrieve user for a given ethereum address + * @param {string} apiKey API key required for authentication. + * @param {string} address + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userByVerification: async (apiKey: string, address: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('userByVerification', 'apiKey', apiKey) + // verify required parameter 'address' is not null or undefined + assertParamExists('userByVerification', 'address', address) + const localVarPath = `/farcaster/user-by-verification`; + // 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 (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, + }; + }, + /** + * Get all known verifications of a user + * @summary Retrieve verifications for a given FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + verifications: async (apiKey: string, fid: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('verifications', 'apiKey', apiKey) + // verify required parameter 'fid' is not null or undefined + assertParamExists('verifications', 'fid', fid) + const localVarPath = `/farcaster/verifications`; + // 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 (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } + + 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, + }; + }, + } }; /** * VerificationApi - functional programming interface * @export */ -export const VerificationApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = - VerificationApiAxiosParamCreator(configuration); - return { - /** - * Checks if a given Ethereum address has a Farcaster user associated with it. Note: if an address is associated with multiple users, the API will return the user who most recently published a verification with the address (based on when Warpcast received the proof, not a self-reported timestamp). - * @summary Retrieve user for a given ethereum address - * @param {string} address - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async userByVerification( - address: string, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.userByVerification(address, options); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Get all known verifications of a user - * @summary Retrieve verifications for a given FID - * @param {number} fid FID of the user - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async verifications( - fid: number, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.verifications( - fid, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - }; +export const VerificationApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = VerificationApiAxiosParamCreator(configuration) + return { + /** + * Checks if a given Ethereum address has a Farcaster user associated with it. Note: if an address is associated with multiple users, the API will return the user who most recently published a verification with the address (based on when Warpcast received the proof, not a self-reported timestamp). + * @summary Retrieve user for a given ethereum address + * @param {string} apiKey API key required for authentication. + * @param {string} address + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async userByVerification(apiKey: string, address: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.userByVerification(apiKey, address, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Get all known verifications of a user + * @summary Retrieve verifications for a given FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async verifications(apiKey: string, fid: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.verifications(apiKey, fid, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } }; /** * VerificationApi - factory interface * @export */ -export const VerificationApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance -) { - const localVarFp = VerificationApiFp(configuration); - return { +export const VerificationApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = VerificationApiFp(configuration) + return { + /** + * Checks if a given Ethereum address has a Farcaster user associated with it. Note: if an address is associated with multiple users, the API will return the user who most recently published a verification with the address (based on when Warpcast received the proof, not a self-reported timestamp). + * @summary Retrieve user for a given ethereum address + * @param {string} apiKey API key required for authentication. + * @param {string} address + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userByVerification(apiKey: string, address: string, options?: any): AxiosPromise { + return localVarFp.userByVerification(apiKey, address, options).then((request) => request(axios, basePath)); + }, + /** + * Get all known verifications of a user + * @summary Retrieve verifications for a given FID + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + verifications(apiKey: string, fid: number, options?: any): AxiosPromise { + return localVarFp.verifications(apiKey, fid, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * VerificationApi - object-oriented interface + * @export + * @class VerificationApi + * @extends {BaseAPI} + */ +export class VerificationApi extends BaseAPI { /** * Checks if a given Ethereum address has a Farcaster user associated with it. Note: if an address is associated with multiple users, the API will return the user who most recently published a verification with the address (based on when Warpcast received the proof, not a self-reported timestamp). * @summary Retrieve user for a given ethereum address - * @param {VerificationApiUserByVerificationRequest} requestParameters Request parameters. + * @param {string} apiKey API key required for authentication. + * @param {string} address * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof VerificationApi */ - userByVerification( - requestParameters: VerificationApiUserByVerificationRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .userByVerification(requestParameters.address, options) - .then((request) => request(axios, basePath)); - }, + public userByVerification(apiKey: string, address: string, options?: AxiosRequestConfig) { + return VerificationApiFp(this.configuration).userByVerification(apiKey, address, options).then((request) => request(this.axios, this.basePath)); + } + /** * Get all known verifications of a user * @summary Retrieve verifications for a given FID - * @param {VerificationApiVerificationsRequest} requestParameters Request parameters. + * @param {string} apiKey API key required for authentication. + * @param {number} fid FID of the user * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof VerificationApi */ - verifications( - requestParameters: VerificationApiVerificationsRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .verifications(requestParameters.fid, options) - .then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * Request parameters for userByVerification operation in VerificationApi. - * @export - * @interface VerificationApiUserByVerificationRequest - */ -export interface VerificationApiUserByVerificationRequest { - /** - * - * @type {string} - * @memberof VerificationApiUserByVerification - */ - readonly address: string; + public verifications(apiKey: string, fid: number, options?: AxiosRequestConfig) { + return VerificationApiFp(this.configuration).verifications(apiKey, fid, options).then((request) => request(this.axios, this.basePath)); + } } -/** - * Request parameters for verifications operation in VerificationApi. - * @export - * @interface VerificationApiVerificationsRequest - */ -export interface VerificationApiVerificationsRequest { - /** - * FID of the user - * @type {number} - * @memberof VerificationApiVerifications - */ - readonly fid: number; -} - -/** - * VerificationApi - object-oriented interface - * @export - * @class VerificationApi - * @extends {BaseAPI} - */ -export class VerificationApi extends BaseAPI { - /** - * Checks if a given Ethereum address has a Farcaster user associated with it. Note: if an address is associated with multiple users, the API will return the user who most recently published a verification with the address (based on when Warpcast received the proof, not a self-reported timestamp). - * @summary Retrieve user for a given ethereum address - * @param {VerificationApiUserByVerificationRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof VerificationApi - */ - public userByVerification( - requestParameters: VerificationApiUserByVerificationRequest, - options?: AxiosRequestConfig - ) { - return VerificationApiFp(this.configuration) - .userByVerification(requestParameters.address, options) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Get all known verifications of a user - * @summary Retrieve verifications for a given FID - * @param {VerificationApiVerificationsRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof VerificationApi - */ - public verifications( - requestParameters: VerificationApiVerificationsRequest, - options?: AxiosRequestConfig - ) { - return VerificationApiFp(this.configuration) - .verifications(requestParameters.fid, options) - .then((request) => request(this.axios, this.basePath)); - } -} From 63b70967942488c087c05c99ab91aa8137a678be Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Tue, 21 Nov 2023 19:23:51 +0530 Subject: [PATCH 06/77] Sync up OAS --- src/oas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oas b/src/oas index a1b367ea..efe04165 160000 --- a/src/oas +++ b/src/oas @@ -1 +1 @@ -Subproject commit a1b367eaaec7c7bcbc430afa757f9fb89f9ff81d +Subproject commit efe04165c6c508fe0f150a578732498c8f5bdd92 From 6c1375605524cd74db2194211c0e417e85ce936d Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Tue, 21 Nov 2023 19:38:56 +0530 Subject: [PATCH 07/77] generate code for rearranged cursor and limit positioning --- src/neynar-api/v1/openapi/apis/cast-api.ts | 72 +++++++-------- src/neynar-api/v1/openapi/apis/follows-api.ts | 60 ++++++------- .../v1/openapi/apis/notifications-api.ts | 60 ++++++------- .../v1/openapi/apis/reactions-api.ts | 90 +++++++++---------- src/neynar-api/v1/openapi/apis/user-api.ts | 30 +++---- 5 files changed, 156 insertions(+), 156 deletions(-) diff --git a/src/neynar-api/v1/openapi/apis/cast-api.ts b/src/neynar-api/v1/openapi/apis/cast-api.ts index 26f1e0fe..c2b62b48 100644 --- a/src/neynar-api/v1/openapi/apis/cast-api.ts +++ b/src/neynar-api/v1/openapi/apis/cast-api.ts @@ -140,14 +140,14 @@ export const CastApiAxiosParamCreator = function (configuration?: Configuration) * @summary Retrieve casts for a given user * @param {string} apiKey API key required for authentication. * @param {number} fid fid of a user - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. * @param {string} [parentUrl] A cast can be part of a certain channel. The channel is identified by `parent_url`. All casts in the channel ladder up to the same parent_url. - * @param {string} [cursor] Pagination cursor. + * @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 {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - casts: async (apiKey: string, fid: number, viewerFid?: number, parentUrl?: string, cursor?: string, limit?: number, options: AxiosRequestConfig = {}): Promise => { + casts: async (apiKey: string, fid: number, parentUrl?: string, viewerFid?: number, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'apiKey' is not null or undefined assertParamExists('casts', 'apiKey', apiKey) // verify required parameter 'fid' is not null or undefined @@ -168,22 +168,22 @@ export const CastApiAxiosParamCreator = function (configuration?: Configuration) localVarQueryParameter['fid'] = fid; } - if (viewerFid !== undefined) { - localVarQueryParameter['viewerFid'] = viewerFid; - } - if (parentUrl !== undefined) { localVarQueryParameter['parent_url'] = parentUrl; } - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; + if (viewerFid !== undefined) { + localVarQueryParameter['viewerFid'] = viewerFid; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + if (apiKey != null) { localVarHeaderParameter['api_key'] = String(apiKey); } @@ -204,12 +204,12 @@ export const CastApiAxiosParamCreator = function (configuration?: Configuration) * @summary Get Recent Casts * @param {string} apiKey API key required for authentication. * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @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} */ - recentCasts: async (apiKey: string, viewerFid?: number, cursor?: string, limit?: number, options: AxiosRequestConfig = {}): Promise => { + recentCasts: async (apiKey: string, viewerFid?: number, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'apiKey' is not null or undefined assertParamExists('recentCasts', 'apiKey', apiKey) const localVarPath = `/farcaster/recent-casts`; @@ -228,14 +228,14 @@ export const CastApiAxiosParamCreator = function (configuration?: Configuration) localVarQueryParameter['viewerFid'] = viewerFid; } - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; - } - if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + if (apiKey != null) { localVarHeaderParameter['api_key'] = String(apiKey); } @@ -292,15 +292,15 @@ export const CastApiFp = function(configuration?: Configuration) { * @summary Retrieve casts for a given user * @param {string} apiKey API key required for authentication. * @param {number} fid fid of a user - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. * @param {string} [parentUrl] A cast can be part of a certain channel. The channel is identified by `parent_url`. All casts in the channel ladder up to the same parent_url. - * @param {string} [cursor] Pagination cursor. + * @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 {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async casts(apiKey: string, fid: number, viewerFid?: number, parentUrl?: string, cursor?: string, limit?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.casts(apiKey, fid, viewerFid, parentUrl, cursor, limit, options); + async casts(apiKey: string, fid: number, parentUrl?: string, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.casts(apiKey, fid, parentUrl, viewerFid, limit, cursor, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -308,13 +308,13 @@ export const CastApiFp = function(configuration?: Configuration) { * @summary Get Recent Casts * @param {string} apiKey API key required for authentication. * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @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 recentCasts(apiKey: string, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.recentCasts(apiKey, viewerFid, cursor, limit, options); + async recentCasts(apiKey: string, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.recentCasts(apiKey, viewerFid, limit, cursor, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } @@ -356,28 +356,28 @@ export const CastApiFactory = function (configuration?: Configuration, basePath? * @summary Retrieve casts for a given user * @param {string} apiKey API key required for authentication. * @param {number} fid fid of a user - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. * @param {string} [parentUrl] A cast can be part of a certain channel. The channel is identified by `parent_url`. All casts in the channel ladder up to the same parent_url. - * @param {string} [cursor] Pagination cursor. + * @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 {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - casts(apiKey: string, fid: number, viewerFid?: number, parentUrl?: string, cursor?: string, limit?: number, options?: any): AxiosPromise { - return localVarFp.casts(apiKey, fid, viewerFid, parentUrl, cursor, limit, options).then((request) => request(axios, basePath)); + casts(apiKey: string, fid: number, parentUrl?: string, viewerFid?: number, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.casts(apiKey, 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 * @param {string} apiKey API key required for authentication. * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @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} */ - recentCasts(apiKey: string, viewerFid?: number, cursor?: string, limit?: number, options?: any): AxiosPromise { - return localVarFp.recentCasts(apiKey, viewerFid, cursor, limit, options).then((request) => request(axios, basePath)); + recentCasts(apiKey: string, viewerFid?: number, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.recentCasts(apiKey, viewerFid, limit, cursor, options).then((request) => request(axios, basePath)); }, }; }; @@ -422,16 +422,16 @@ export class CastApi extends BaseAPI { * @summary Retrieve casts for a given user * @param {string} apiKey API key required for authentication. * @param {number} fid fid of a user - * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. * @param {string} [parentUrl] A cast can be part of a certain channel. The channel is identified by `parent_url`. All casts in the channel ladder up to the same parent_url. - * @param {string} [cursor] Pagination cursor. + * @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 {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CastApi */ - public casts(apiKey: string, fid: number, viewerFid?: number, parentUrl?: string, cursor?: string, limit?: number, options?: AxiosRequestConfig) { - return CastApiFp(this.configuration).casts(apiKey, fid, viewerFid, parentUrl, cursor, limit, options).then((request) => request(this.axios, this.basePath)); + public casts(apiKey: string, fid: number, parentUrl?: string, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + return CastApiFp(this.configuration).casts(apiKey, fid, parentUrl, viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); } /** @@ -439,14 +439,14 @@ export class CastApi extends BaseAPI { * @summary Get Recent Casts * @param {string} apiKey API key required for authentication. * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @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 CastApi */ - public recentCasts(apiKey: string, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig) { - return CastApiFp(this.configuration).recentCasts(apiKey, viewerFid, cursor, limit, options).then((request) => request(this.axios, this.basePath)); + public recentCasts(apiKey: string, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + return CastApiFp(this.configuration).recentCasts(apiKey, viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/src/neynar-api/v1/openapi/apis/follows-api.ts b/src/neynar-api/v1/openapi/apis/follows-api.ts index 8cbfef03..85e56bcd 100644 --- a/src/neynar-api/v1/openapi/apis/follows-api.ts +++ b/src/neynar-api/v1/openapi/apis/follows-api.ts @@ -37,12 +37,12 @@ export const FollowsApiAxiosParamCreator = function (configuration?: Configurati * @param {string} apiKey API key required for authentication. * @param {number} fid FID of the user * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - followers: async (apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options: AxiosRequestConfig = {}): Promise => { + followers: async (apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'apiKey' is not null or undefined assertParamExists('followers', 'apiKey', apiKey) // verify required parameter 'fid' is not null or undefined @@ -67,14 +67,14 @@ export const FollowsApiAxiosParamCreator = function (configuration?: Configurati localVarQueryParameter['viewerFid'] = viewerFid; } - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; - } - if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + if (apiKey != null) { localVarHeaderParameter['api_key'] = String(apiKey); } @@ -96,12 +96,12 @@ export const FollowsApiAxiosParamCreator = function (configuration?: Configurati * @param {string} apiKey API key required for authentication. * @param {number} fid FID of the user * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - following: async (apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options: AxiosRequestConfig = {}): Promise => { + following: async (apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'apiKey' is not null or undefined assertParamExists('following', 'apiKey', apiKey) // verify required parameter 'fid' is not null or undefined @@ -126,14 +126,14 @@ export const FollowsApiAxiosParamCreator = function (configuration?: Configurati localVarQueryParameter['viewerFid'] = viewerFid; } - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; - } - if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + if (apiKey != null) { localVarHeaderParameter['api_key'] = String(apiKey); } @@ -165,13 +165,13 @@ export const FollowsApiFp = function(configuration?: Configuration) { * @param {string} apiKey API key required for authentication. * @param {number} fid FID of the user * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async followers(apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.followers(apiKey, fid, viewerFid, cursor, limit, options); + async followers(apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.followers(apiKey, fid, viewerFid, limit, cursor, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -180,13 +180,13 @@ export const FollowsApiFp = function(configuration?: Configuration) { * @param {string} apiKey API key required for authentication. * @param {number} fid FID of the user * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async following(apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.following(apiKey, fid, viewerFid, cursor, limit, options); + async following(apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.following(apiKey, fid, viewerFid, limit, cursor, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } @@ -205,13 +205,13 @@ export const FollowsApiFactory = function (configuration?: Configuration, basePa * @param {string} apiKey API key required for authentication. * @param {number} fid FID of the user * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - followers(apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options?: any): AxiosPromise { - return localVarFp.followers(apiKey, fid, viewerFid, cursor, limit, options).then((request) => request(axios, basePath)); + followers(apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.followers(apiKey, fid, viewerFid, limit, cursor, options).then((request) => request(axios, basePath)); }, /** * Gets a list of users who is following a given user in reverse chronological order. @@ -219,13 +219,13 @@ export const FollowsApiFactory = function (configuration?: Configuration, basePa * @param {string} apiKey API key required for authentication. * @param {number} fid FID of the user * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - following(apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options?: any): AxiosPromise { - return localVarFp.following(apiKey, fid, viewerFid, cursor, limit, options).then((request) => request(axios, basePath)); + following(apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.following(apiKey, fid, viewerFid, limit, cursor, options).then((request) => request(axios, basePath)); }, }; }; @@ -243,14 +243,14 @@ export class FollowsApi extends BaseAPI { * @param {string} apiKey API key required for authentication. * @param {number} fid FID of the user * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FollowsApi */ - public followers(apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig) { - return FollowsApiFp(this.configuration).followers(apiKey, fid, viewerFid, cursor, limit, options).then((request) => request(this.axios, this.basePath)); + public followers(apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + return FollowsApiFp(this.configuration).followers(apiKey, fid, viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); } /** @@ -259,14 +259,14 @@ export class FollowsApi extends BaseAPI { * @param {string} apiKey API key required for authentication. * @param {number} fid FID of the user * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FollowsApi */ - public following(apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig) { - return FollowsApiFp(this.configuration).following(apiKey, fid, viewerFid, cursor, limit, options).then((request) => request(this.axios, this.basePath)); + public following(apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + return FollowsApiFp(this.configuration).following(apiKey, fid, viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/src/neynar-api/v1/openapi/apis/notifications-api.ts b/src/neynar-api/v1/openapi/apis/notifications-api.ts index 1777d853..43b128a7 100644 --- a/src/neynar-api/v1/openapi/apis/notifications-api.ts +++ b/src/neynar-api/v1/openapi/apis/notifications-api.ts @@ -39,12 +39,12 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi * @param {string} apiKey API key required for authentication. * @param {number} fid fid of a user * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - mentionsAndReplies: async (apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options: AxiosRequestConfig = {}): Promise => { + mentionsAndReplies: async (apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'apiKey' is not null or undefined assertParamExists('mentionsAndReplies', 'apiKey', apiKey) // verify required parameter 'fid' is not null or undefined @@ -69,14 +69,14 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi localVarQueryParameter['viewerFid'] = viewerFid; } - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; - } - if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + if (apiKey != null) { localVarHeaderParameter['api_key'] = String(apiKey); } @@ -98,12 +98,12 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi * @param {string} apiKey API key required for authentication. * @param {number} fid fid of a user * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - reactionsAndRecasts: async (apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options: AxiosRequestConfig = {}): Promise => { + reactionsAndRecasts: async (apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'apiKey' is not null or undefined assertParamExists('reactionsAndRecasts', 'apiKey', apiKey) // verify required parameter 'fid' is not null or undefined @@ -128,14 +128,14 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi localVarQueryParameter['viewerFid'] = viewerFid; } - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; - } - if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + if (apiKey != null) { localVarHeaderParameter['api_key'] = String(apiKey); } @@ -167,13 +167,13 @@ export const NotificationsApiFp = function(configuration?: Configuration) { * @param {string} apiKey API key required for authentication. * @param {number} fid fid of a user * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async mentionsAndReplies(apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.mentionsAndReplies(apiKey, fid, viewerFid, cursor, limit, options); + async mentionsAndReplies(apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.mentionsAndReplies(apiKey, fid, viewerFid, limit, cursor, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -182,13 +182,13 @@ export const NotificationsApiFp = function(configuration?: Configuration) { * @param {string} apiKey API key required for authentication. * @param {number} fid fid of a user * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async reactionsAndRecasts(apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.reactionsAndRecasts(apiKey, fid, viewerFid, cursor, limit, options); + async reactionsAndRecasts(apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.reactionsAndRecasts(apiKey, fid, viewerFid, limit, cursor, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } @@ -207,13 +207,13 @@ export const NotificationsApiFactory = function (configuration?: Configuration, * @param {string} apiKey API key required for authentication. * @param {number} fid fid of a user * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - mentionsAndReplies(apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options?: any): AxiosPromise { - return localVarFp.mentionsAndReplies(apiKey, fid, viewerFid, cursor, limit, options).then((request) => request(axios, basePath)); + mentionsAndReplies(apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.mentionsAndReplies(apiKey, fid, viewerFid, limit, cursor, options).then((request) => request(axios, basePath)); }, /** * Get a list of reactions and recasts to the users’s casts in reverse chronological order @@ -221,13 +221,13 @@ export const NotificationsApiFactory = function (configuration?: Configuration, * @param {string} apiKey API key required for authentication. * @param {number} fid fid of a user * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - reactionsAndRecasts(apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options?: any): AxiosPromise { - return localVarFp.reactionsAndRecasts(apiKey, fid, viewerFid, cursor, limit, options).then((request) => request(axios, basePath)); + reactionsAndRecasts(apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.reactionsAndRecasts(apiKey, fid, viewerFid, limit, cursor, options).then((request) => request(axios, basePath)); }, }; }; @@ -245,14 +245,14 @@ export class NotificationsApi extends BaseAPI { * @param {string} apiKey API key required for authentication. * @param {number} fid fid of a user * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof NotificationsApi */ - public mentionsAndReplies(apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig) { - return NotificationsApiFp(this.configuration).mentionsAndReplies(apiKey, fid, viewerFid, cursor, limit, options).then((request) => request(this.axios, this.basePath)); + public mentionsAndReplies(apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + return NotificationsApiFp(this.configuration).mentionsAndReplies(apiKey, fid, viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); } /** @@ -261,14 +261,14 @@ export class NotificationsApi extends BaseAPI { * @param {string} apiKey API key required for authentication. * @param {number} fid fid of a user * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof NotificationsApi */ - public reactionsAndRecasts(apiKey: string, fid: number, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig) { - return NotificationsApiFp(this.configuration).reactionsAndRecasts(apiKey, fid, viewerFid, cursor, limit, options).then((request) => request(this.axios, this.basePath)); + public reactionsAndRecasts(apiKey: string, fid: number, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + return NotificationsApiFp(this.configuration).reactionsAndRecasts(apiKey, fid, viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/src/neynar-api/v1/openapi/apis/reactions-api.ts b/src/neynar-api/v1/openapi/apis/reactions-api.ts index 853d865b..6b8035fc 100644 --- a/src/neynar-api/v1/openapi/apis/reactions-api.ts +++ b/src/neynar-api/v1/openapi/apis/reactions-api.ts @@ -41,12 +41,12 @@ export const ReactionsApiAxiosParamCreator = function (configuration?: Configura * @param {string} apiKey API key required for authentication. * @param {string} castHash Cast hash * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - castLikes: async (apiKey: string, castHash: string, viewerFid?: number, cursor?: string, limit?: number, options: AxiosRequestConfig = {}): Promise => { + castLikes: async (apiKey: string, castHash: string, viewerFid?: number, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'apiKey' is not null or undefined assertParamExists('castLikes', 'apiKey', apiKey) // verify required parameter 'castHash' is not null or undefined @@ -71,14 +71,14 @@ export const ReactionsApiAxiosParamCreator = function (configuration?: Configura localVarQueryParameter['viewerFid'] = viewerFid; } - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; - } - if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + if (apiKey != null) { localVarHeaderParameter['api_key'] = String(apiKey); } @@ -100,12 +100,12 @@ export const ReactionsApiAxiosParamCreator = function (configuration?: Configura * @param {string} apiKey API key required for authentication. * @param {string} castHash Cast hash * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - castReactions: async (apiKey: string, castHash: string, viewerFid?: number, cursor?: string, limit?: number, options: AxiosRequestConfig = {}): Promise => { + castReactions: async (apiKey: string, castHash: string, viewerFid?: number, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'apiKey' is not null or undefined assertParamExists('castReactions', 'apiKey', apiKey) // verify required parameter 'castHash' is not null or undefined @@ -130,14 +130,14 @@ export const ReactionsApiAxiosParamCreator = function (configuration?: Configura localVarQueryParameter['viewerFid'] = viewerFid; } - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; - } - if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + if (apiKey != null) { localVarHeaderParameter['api_key'] = String(apiKey); } @@ -159,12 +159,12 @@ export const ReactionsApiAxiosParamCreator = function (configuration?: Configura * @param {string} apiKey API key required for authentication. * @param {string} castHash Cast hash * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - castRecasters: async (apiKey: string, castHash: string, viewerFid?: number, cursor?: string, limit?: number, options: AxiosRequestConfig = {}): Promise => { + castRecasters: async (apiKey: string, castHash: string, viewerFid?: number, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'apiKey' is not null or undefined assertParamExists('castRecasters', 'apiKey', apiKey) // verify required parameter 'castHash' is not null or undefined @@ -189,14 +189,14 @@ export const ReactionsApiAxiosParamCreator = function (configuration?: Configura localVarQueryParameter['viewerFid'] = viewerFid; } - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; - } - if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + if (apiKey != null) { localVarHeaderParameter['api_key'] = String(apiKey); } @@ -228,13 +228,13 @@ export const ReactionsApiFp = function(configuration?: Configuration) { * @param {string} apiKey API key required for authentication. * @param {string} castHash Cast hash * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async castLikes(apiKey: string, castHash: string, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.castLikes(apiKey, castHash, viewerFid, cursor, limit, options); + async castLikes(apiKey: string, castHash: string, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.castLikes(apiKey, castHash, viewerFid, limit, cursor, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -243,13 +243,13 @@ export const ReactionsApiFp = function(configuration?: Configuration) { * @param {string} apiKey API key required for authentication. * @param {string} castHash Cast hash * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async castReactions(apiKey: string, castHash: string, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.castReactions(apiKey, castHash, viewerFid, cursor, limit, options); + async castReactions(apiKey: string, castHash: string, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.castReactions(apiKey, castHash, viewerFid, limit, cursor, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -258,13 +258,13 @@ export const ReactionsApiFp = function(configuration?: Configuration) { * @param {string} apiKey API key required for authentication. * @param {string} castHash Cast hash * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async castRecasters(apiKey: string, castHash: string, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.castRecasters(apiKey, castHash, viewerFid, cursor, limit, options); + async castRecasters(apiKey: string, castHash: string, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.castRecasters(apiKey, castHash, viewerFid, limit, cursor, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } @@ -283,13 +283,13 @@ export const ReactionsApiFactory = function (configuration?: Configuration, base * @param {string} apiKey API key required for authentication. * @param {string} castHash Cast hash * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - castLikes(apiKey: string, castHash: string, viewerFid?: number, cursor?: string, limit?: number, options?: any): AxiosPromise { - return localVarFp.castLikes(apiKey, castHash, viewerFid, cursor, limit, options).then((request) => request(axios, basePath)); + castLikes(apiKey: string, castHash: string, viewerFid?: number, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.castLikes(apiKey, castHash, viewerFid, limit, cursor, options).then((request) => request(axios, basePath)); }, /** * Get all reactions (likes and recasts) for a specific cast. @@ -297,13 +297,13 @@ export const ReactionsApiFactory = function (configuration?: Configuration, base * @param {string} apiKey API key required for authentication. * @param {string} castHash Cast hash * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - castReactions(apiKey: string, castHash: string, viewerFid?: number, cursor?: string, limit?: number, options?: any): AxiosPromise { - return localVarFp.castReactions(apiKey, castHash, viewerFid, cursor, limit, options).then((request) => request(axios, basePath)); + castReactions(apiKey: string, castHash: string, viewerFid?: number, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.castReactions(apiKey, castHash, viewerFid, limit, cursor, options).then((request) => request(axios, basePath)); }, /** * Get all recasters for a specific cast. @@ -311,13 +311,13 @@ export const ReactionsApiFactory = function (configuration?: Configuration, base * @param {string} apiKey API key required for authentication. * @param {string} castHash Cast hash * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - castRecasters(apiKey: string, castHash: string, viewerFid?: number, cursor?: string, limit?: number, options?: any): AxiosPromise { - return localVarFp.castRecasters(apiKey, castHash, viewerFid, cursor, limit, options).then((request) => request(axios, basePath)); + castRecasters(apiKey: string, castHash: string, viewerFid?: number, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.castRecasters(apiKey, castHash, viewerFid, limit, cursor, options).then((request) => request(axios, basePath)); }, }; }; @@ -335,14 +335,14 @@ export class ReactionsApi extends BaseAPI { * @param {string} apiKey API key required for authentication. * @param {string} castHash Cast hash * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ReactionsApi */ - public castLikes(apiKey: string, castHash: string, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig) { - return ReactionsApiFp(this.configuration).castLikes(apiKey, castHash, viewerFid, cursor, limit, options).then((request) => request(this.axios, this.basePath)); + public castLikes(apiKey: string, castHash: string, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + return ReactionsApiFp(this.configuration).castLikes(apiKey, castHash, viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); } /** @@ -351,14 +351,14 @@ export class ReactionsApi extends BaseAPI { * @param {string} apiKey API key required for authentication. * @param {string} castHash Cast hash * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ReactionsApi */ - public castReactions(apiKey: string, castHash: string, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig) { - return ReactionsApiFp(this.configuration).castReactions(apiKey, castHash, viewerFid, cursor, limit, options).then((request) => request(this.axios, this.basePath)); + public castReactions(apiKey: string, castHash: string, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + return ReactionsApiFp(this.configuration).castReactions(apiKey, castHash, viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); } /** @@ -367,14 +367,14 @@ export class ReactionsApi extends BaseAPI { * @param {string} apiKey API key required for authentication. * @param {string} castHash Cast hash * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 25, max 150) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ReactionsApi */ - public castRecasters(apiKey: string, castHash: string, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig) { - return ReactionsApiFp(this.configuration).castRecasters(apiKey, castHash, viewerFid, cursor, limit, options).then((request) => request(this.axios, this.basePath)); + public castRecasters(apiKey: string, castHash: string, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + return ReactionsApiFp(this.configuration).castRecasters(apiKey, castHash, viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/src/neynar-api/v1/openapi/apis/user-api.ts b/src/neynar-api/v1/openapi/apis/user-api.ts index 50583f5a..d9eba319 100644 --- a/src/neynar-api/v1/openapi/apis/user-api.ts +++ b/src/neynar-api/v1/openapi/apis/user-api.ts @@ -86,12 +86,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) * @summary Get Recent Users * @param {string} apiKey API key required for authentication. * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 100, max 1000) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - recentUsers: async (apiKey: string, viewerFid?: number, cursor?: string, limit?: number, options: AxiosRequestConfig = {}): Promise => { + recentUsers: async (apiKey: string, viewerFid?: number, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'apiKey' is not null or undefined assertParamExists('recentUsers', 'apiKey', apiKey) const localVarPath = `/farcaster/recent-users`; @@ -110,14 +110,14 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarQueryParameter['viewerFid'] = viewerFid; } - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; - } - if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + if (apiKey != null) { localVarHeaderParameter['api_key'] = String(apiKey); } @@ -317,13 +317,13 @@ export const UserApiFp = function(configuration?: Configuration) { * @summary Get Recent Users * @param {string} apiKey API key required for authentication. * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 100, max 1000) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async recentUsers(apiKey: string, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.recentUsers(apiKey, viewerFid, cursor, limit, options); + async recentUsers(apiKey: string, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.recentUsers(apiKey, viewerFid, limit, cursor, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -393,13 +393,13 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @summary Get Recent Users * @param {string} apiKey API key required for authentication. * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 100, max 1000) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - recentUsers(apiKey: string, viewerFid?: number, cursor?: string, limit?: number, options?: any): AxiosPromise { - return localVarFp.recentUsers(apiKey, viewerFid, cursor, limit, options).then((request) => request(axios, basePath)); + recentUsers(apiKey: string, viewerFid?: number, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.recentUsers(apiKey, viewerFid, limit, cursor, options).then((request) => request(axios, basePath)); }, /** * Returns metadata about a specific user @@ -467,14 +467,14 @@ export class UserApi extends BaseAPI { * @summary Get Recent Users * @param {string} apiKey API key required for authentication. * @param {number} [viewerFid] fid of the user viewing this information, needed for contextual information. - * @param {string} [cursor] Pagination cursor. * @param {number} [limit] Number of results to retrieve (default 100, max 1000) + * @param {string} [cursor] Pagination cursor. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof UserApi */ - public recentUsers(apiKey: string, viewerFid?: number, cursor?: string, limit?: number, options?: AxiosRequestConfig) { - return UserApiFp(this.configuration).recentUsers(apiKey, viewerFid, cursor, limit, options).then((request) => request(this.axios, this.basePath)); + public recentUsers(apiKey: string, viewerFid?: number, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).recentUsers(apiKey, viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); } /** From cc5b1dcedbf9f702681cbc5d97d9ea3ffeefeb13 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Tue, 21 Nov 2023 21:03:50 +0530 Subject: [PATCH 08/77] Add wrapper for v1 client and update generator script to use del-cli --- package.json | 6 +- src/neynar-api/neynar-api-client.ts | 12 +- src/neynar-api/utils.ts | 2 +- src/neynar-api/v1/v1-client.ts | 190 ++++++++++++++++------------ 4 files changed, 119 insertions(+), 91 deletions(-) diff --git a/package.json b/package.json index 652ff281..8e9711ae 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,9 @@ "scripts": { "clean": "del-cli ./build/*", "build": "yarn run clean && tsc", - "generate:neynar-oas": "rm -rf 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": "rm -rf 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": "rm -rf 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": "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" }, "author": "Neynar", "license": "ISC", diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index 61a557a0..4408e050 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -17,7 +17,7 @@ import { CastResponse, CastsResponse, UserResponse, -} from "./neynar-v2-api/openapi-farcaster"; +} from "./v2/openapi-farcaster"; import { RecentUsersResponse, @@ -34,13 +34,13 @@ import { CastRecasterResponse, FollowResponse, User200Response, -} from "./neynar-v1-api/openapi"; +} from "./v1/openapi"; -import { FetchRelevantMints200Response } from "./neynar-v2-api/openapi-recommendation"; +import { FetchRelevantMints200Response } from "./v2/openapi-recommendation"; import { AxiosInstance } from "axios"; import { silentLogger, Logger } from "./common/logger"; -import { NeynarV1APIClient } from "./neynar-v1-api"; -import { NeynarV2APIClient } from "./neynar-v2-api"; +import { NeynarV1APIClient } from "./v1"; +import { NeynarV2APIClient } from "./v2"; export class NeynarAPIClient { private readonly logger: Logger; @@ -164,7 +164,7 @@ export class NeynarAPIClient { * */ public async fetchAllCastsInThread( - threadParent: CastV1 | { hash: string }, + threadParent: CastV1 | string, viewerFid?: number ): Promise { return await this.clients.v1.fetchAllCastsInThread(threadParent, viewerFid); diff --git a/src/neynar-api/utils.ts b/src/neynar-api/utils.ts index 70bbe836..131a5307 100644 --- a/src/neynar-api/utils.ts +++ b/src/neynar-api/utils.ts @@ -1,5 +1,5 @@ import { AxiosError } from "axios"; -import { ErrorRes } from "./neynar-v1-api"; +import { ErrorRes } from "./v1"; import type { SetRequired } from "type-fest"; /** diff --git a/src/neynar-api/v1/v1-client.ts b/src/neynar-api/v1/v1-client.ts index 45972474..33db8959 100644 --- a/src/neynar-api/v1/v1-client.ts +++ b/src/neynar-api/v1/v1-client.ts @@ -30,6 +30,7 @@ const BASE_PATH = "https://api.neynar.com/v1"; export class NeynarV1APIClient { private readonly logger: Logger; + private readonly apiKey: string; public readonly apis: { user: UserApi; @@ -58,12 +59,13 @@ export class NeynarV1APIClient { } = {} ) { this.logger = logger; - if (apiKey === "") { throw new Error( "Attempt to use an authenticated API method without first providing an api key" ); } + + this.apiKey = apiKey; if (axiosInstance === undefined) { axiosInstance = axios.create(); @@ -122,11 +124,12 @@ export class NeynarV1APIClient { limit?: number; cursor?: string; }): Promise { - const response = await this.apis.user.recentUsers({ - viewerFid: options?.viewerFid, - cursor: options?.cursor, - limit: options?.limit, - }); + const response = await this.apis.user.recentUsers( + this.apiKey, + options?.viewerFid, + options?.limit, + options?.cursor + ); return response.data; } @@ -140,12 +143,13 @@ export class NeynarV1APIClient { fid: number, options?: { viewerFid?: number; limit?: number; cursor?: string } ): Promise { - const response = await this.apis.user.userCastLikes({ - fid: fid, - viewerFid: options?.viewerFid, - limit: options?.limit, - cursor: options?.cursor, - }); + const response = await this.apis.user.userCastLikes( + this.apiKey, + fid, + options?.viewerFid, + options?.limit, + options?.cursor + ); return response.data; } @@ -159,7 +163,7 @@ export class NeynarV1APIClient { fid: number, viewerFid?: number ): Promise { - const response = await this.apis.user.user({ fid, viewerFid }); + const response = await this.apis.user.user(this.apiKey, fid, viewerFid); return response.data; } @@ -172,10 +176,11 @@ export class NeynarV1APIClient { username: string, viewerFid?: number ): Promise { - const response = await this.apis.user.userByUsername({ + const response = await this.apis.user.userByUsername( + this.apiKey, username, - viewerFid, - }); + viewerFid + ); // result.user is undefined if not found // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition return response.data.result.user ?? null; @@ -187,7 +192,7 @@ export class NeynarV1APIClient { * */ public async fetchCustodyAddressForUser(fid: number): Promise { - const response = await this.apis.user.custodyAddress({ fid }); + const response = await this.apis.user.custodyAddress(this.apiKey, fid); return response.data.result.custodyAddress; } @@ -202,10 +207,11 @@ export class NeynarV1APIClient { hash: string, options?: { viewerFid?: number } ): Promise { - const response = await this.apis.cast.cast({ + const response = await this.apis.cast.cast( + this.apiKey, hash, - viewerFid: options?.viewerFid, - }); + options?.viewerFid + ); return response.data.result.cast; } @@ -216,13 +222,22 @@ export class NeynarV1APIClient { * */ public async fetchAllCastsInThread( - threadParent: Cast | { hash: string }, + threadParent: Cast | string, viewerFid?: number ): Promise { - const response = await this.apis.cast.allCastsInThread({ - threadHash: threadParent.hash, - viewerFid: viewerFid, - }); + let threadHash: string; + + if (typeof threadParent === "string") { + threadHash = threadParent; + } else { + threadHash = threadParent.hash; + } + + const response = await this.apis.cast.allCastsInThread( + this.apiKey, + threadHash, + viewerFid + ); return response.data.result.casts; } @@ -240,13 +255,14 @@ export class NeynarV1APIClient { cursor?: string; } ): Promise { - const response = await this.apis.cast.casts({ - fid: fid, - viewerFid: options?.viewerFid, - parentUrl: options?.parentUrl, - cursor: options?.cursor, - limit: options?.limit, - }); + const response = await this.apis.cast.casts( + this.apiKey, + fid, + options?.parentUrl, + options?.viewerFid, + options?.limit, + options?.cursor + ); return response.data; } @@ -261,11 +277,12 @@ export class NeynarV1APIClient { limit?: number; cursor?: string; }): Promise { - const response = await this.apis.cast.recentCasts({ - viewerFid: options?.viewerFid, - cursor: options?.cursor, - limit: options?.limit, - }); + const response = await this.apis.cast.recentCasts( + this.apiKey, + options?.viewerFid, + options?.limit, + options?.cursor + ); return response.data; } @@ -280,7 +297,10 @@ export class NeynarV1APIClient { public async fetchUserVerifications( fid: number ): Promise { - const response = await this.apis.verification.verifications({ fid }); + const response = await this.apis.verification.verifications( + this.apiKey, + fid + ); return response.data.result; } @@ -295,9 +315,10 @@ export class NeynarV1APIClient { public async lookupUserByVerification( address: string ): Promise { - const response = await this.apis.verification.userByVerification({ - address, - }); + const response = await this.apis.verification.userByVerification( + this.apiKey, + address + ); return response.data; } @@ -312,12 +333,13 @@ export class NeynarV1APIClient { fid: number, options?: { viewerFid?: number; limit?: number; cursor?: string } ): Promise { - const response = await this.apis.notifications.mentionsAndReplies({ - fid: fid, - viewerFid: options?.viewerFid, - cursor: options?.cursor, - limit: options?.limit, - }); + const response = await this.apis.notifications.mentionsAndReplies( + this.apiKey, + fid, + options?.viewerFid, + options?.limit, + options?.cursor + ); return response.data; } @@ -331,12 +353,13 @@ export class NeynarV1APIClient { fid: number, options?: { viewerFid?: number; limit?: number; cursor?: string } ): Promise { - const response = await this.apis.notifications.reactionsAndRecasts({ - fid: fid, - viewerFid: options?.viewerFid, - cursor: options?.cursor, - limit: options?.limit, - }); + const response = await this.apis.notifications.reactionsAndRecasts( + this.apiKey, + fid, + options?.viewerFid, + options?.limit, + options?.cursor + ); return response.data; } @@ -359,12 +382,13 @@ export class NeynarV1APIClient { castHash = castOrCastHash.hash; } - const response = await this.apis.reactions.castLikes({ - castHash: castHash, - viewerFid: options?.viewerFid, - cursor: options?.cursor, - limit: options?.limit, - }); + const response = await this.apis.reactions.castLikes( + this.apiKey, + castHash, + options?.viewerFid, + options?.limit, + options?.cursor + ); return response.data; } @@ -385,12 +409,13 @@ export class NeynarV1APIClient { castHash = castOrCastHash.hash; } - const response = await this.apis.reactions.castReactions({ - castHash: castHash, - viewerFid: options?.viewerFid, - cursor: options?.cursor, - limit: options?.limit, - }); + const response = await this.apis.reactions.castReactions( + this.apiKey, + castHash, + options?.viewerFid, + options?.limit, + options?.cursor + ); return response.data; } @@ -411,12 +436,13 @@ export class NeynarV1APIClient { castHash = castOrCastHash.hash; } - const response = await this.apis.reactions.castRecasters({ - castHash: castHash, - viewerFid: options?.viewerFid, - cursor: options?.cursor, - limit: options?.limit, - }); + const response = await this.apis.reactions.castRecasters( + this.apiKey, + castHash, + options?.viewerFid, + options?.limit, + options?.cursor + ); return response.data; } @@ -432,12 +458,13 @@ export class NeynarV1APIClient { fid: number, options?: { viewerFid?: number; limit?: number; cursor?: string } ): Promise { - const response = await this.apis.follows.followers({ + const response = await this.apis.follows.followers( + this.apiKey, fid, - viewerFid: options?.viewerFid, - cursor: options?.cursor, - limit: options?.limit, - }); + options?.viewerFid, + options?.limit, + options?.cursor + ); return response.data; } @@ -451,12 +478,13 @@ export class NeynarV1APIClient { fid: number, options?: { viewerFid?: number; limit?: number; cursor?: string } ): Promise { - const response = await this.apis.follows.following({ + const response = await this.apis.follows.following( + this.apiKey, fid, - viewerFid: options?.viewerFid, - cursor: options?.cursor, - limit: options?.limit, - }); + options?.viewerFid, + options?.limit, + options?.cursor + ); return response.data; } From f0ea46ee53a4c9e162a74a17ded84bb3d7750713 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Tue, 21 Nov 2023 23:12:35 +0530 Subject: [PATCH 09/77] Syncup OAS --- src/oas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oas b/src/oas index efe04165..8482fef7 160000 --- a/src/oas +++ b/src/oas @@ -1 +1 @@ -Subproject commit efe04165c6c508fe0f150a578732498c8f5bdd92 +Subproject commit 8482fef70bc7c64b489d4f75a1570424db67c103 From 18bdb57f333075c73f85b9e6dd591953303dfee6 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Tue, 21 Nov 2023 23:18:34 +0530 Subject: [PATCH 10/77] Generate updated OAS code --- src/neynar-api/v1/openapi/.openapi-generator/FILES | 4 ++-- src/neynar-api/v1/openapi/apis/user-api.ts | 12 ++++++------ src/neynar-api/v1/openapi/apis/verification-api.ts | 6 +++--- src/neynar-api/v1/openapi/models/index.ts | 4 ++-- src/neynar-api/v1/openapi/models/user-profile-bio.ts | 2 +- ...nse-result.ts => user-success-response-result.ts} | 6 +++--- ...{user200-response.ts => user-success-response.ts} | 12 ++++++------ src/neynar-api/v1/openapi/models/user.ts | 6 ++++++ 8 files changed, 29 insertions(+), 23 deletions(-) rename src/neynar-api/v1/openapi/models/{user200-response-result.ts => user-success-response-result.ts} (81%) rename src/neynar-api/v1/openapi/models/{user200-response.ts => user-success-response.ts} (65%) diff --git a/src/neynar-api/v1/openapi/.openapi-generator/FILES b/src/neynar-api/v1/openapi/.openapi-generator/FILES index 7b829a39..2af50b84 100644 --- a/src/neynar-api/v1/openapi/.openapi-generator/FILES +++ b/src/neynar-api/v1/openapi/.openapi-generator/FILES @@ -69,9 +69,9 @@ models/user-cast-like-response.ts models/user-pfp.ts models/user-profile-bio.ts models/user-profile.ts +models/user-success-response-result.ts +models/user-success-response.ts models/user.ts -models/user200-response-result.ts -models/user200-response.ts models/verification-response-result.ts models/verification-response.ts models/viewer-context.ts diff --git a/src/neynar-api/v1/openapi/apis/user-api.ts b/src/neynar-api/v1/openapi/apis/user-api.ts index d9eba319..7516885d 100644 --- a/src/neynar-api/v1/openapi/apis/user-api.ts +++ b/src/neynar-api/v1/openapi/apis/user-api.ts @@ -28,9 +28,9 @@ import { ErrorRes } from '../models'; // @ts-ignore import { RecentUsersResponse } from '../models'; // @ts-ignore -import { User200Response } from '../models'; -// @ts-ignore import { UserCastLikeResponse } from '../models'; +// @ts-ignore +import { UserSuccessResponse } from '../models'; /** * UserApi - axios parameter creator * @export @@ -335,7 +335,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async user(apiKey: string, fid: number, viewerFid?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async user(apiKey: string, fid: number, viewerFid?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.user(apiKey, fid, viewerFid, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -348,7 +348,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async userByUsername(apiKey: string, username: string, viewerFid?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async userByUsername(apiKey: string, username: string, viewerFid?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.userByUsername(apiKey, username, viewerFid, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -410,7 +410,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - user(apiKey: string, fid: number, viewerFid?: number, options?: any): AxiosPromise { + user(apiKey: string, fid: number, viewerFid?: number, options?: any): AxiosPromise { return localVarFp.user(apiKey, fid, viewerFid, options).then((request) => request(axios, basePath)); }, /** @@ -422,7 +422,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - userByUsername(apiKey: string, username: string, viewerFid?: number, options?: any): AxiosPromise { + userByUsername(apiKey: string, username: string, viewerFid?: number, options?: any): AxiosPromise { return localVarFp.userByUsername(apiKey, username, viewerFid, options).then((request) => request(axios, basePath)); }, /** diff --git a/src/neynar-api/v1/openapi/apis/verification-api.ts b/src/neynar-api/v1/openapi/apis/verification-api.ts index a8b79c71..df2abf6d 100644 --- a/src/neynar-api/v1/openapi/apis/verification-api.ts +++ b/src/neynar-api/v1/openapi/apis/verification-api.ts @@ -24,7 +24,7 @@ import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } fr // @ts-ignore import { ErrorRes } from '../models'; // @ts-ignore -import { User200Response } from '../models'; +import { UserSuccessResponse } from '../models'; // @ts-ignore import { VerificationResponse } from '../models'; /** @@ -139,7 +139,7 @@ export const VerificationApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async userByVerification(apiKey: string, address: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async userByVerification(apiKey: string, address: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.userByVerification(apiKey, address, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -173,7 +173,7 @@ export const VerificationApiFactory = function (configuration?: Configuration, b * @param {*} [options] Override http request option. * @throws {RequiredError} */ - userByVerification(apiKey: string, address: string, options?: any): AxiosPromise { + userByVerification(apiKey: string, address: string, options?: any): AxiosPromise { return localVarFp.userByVerification(apiKey, address, options).then((request) => request(axios, basePath)); }, /** diff --git a/src/neynar-api/v1/openapi/models/index.ts b/src/neynar-api/v1/openapi/models/index.ts index 872d3c83..c75fe3a5 100644 --- a/src/neynar-api/v1/openapi/models/index.ts +++ b/src/neynar-api/v1/openapi/models/index.ts @@ -49,13 +49,13 @@ export * from './recent-casts-response'; export * from './recent-users-response'; export * from './recent-users-response-result'; export * from './user'; -export * from './user200-response'; -export * from './user200-response-result'; export * from './user-cast-like-response'; export * from './user-cast-like-response-result'; export * from './user-pfp'; export * from './user-profile'; export * from './user-profile-bio'; +export * from './user-success-response'; +export * from './user-success-response-result'; export * from './verification-response'; export * from './verification-response-result'; export * from './viewer-context'; diff --git a/src/neynar-api/v1/openapi/models/user-profile-bio.ts b/src/neynar-api/v1/openapi/models/user-profile-bio.ts index 28fb12bc..6045310d 100644 --- a/src/neynar-api/v1/openapi/models/user-profile-bio.ts +++ b/src/neynar-api/v1/openapi/models/user-profile-bio.ts @@ -31,6 +31,6 @@ export interface UserProfileBio { * @type {Array} * @memberof UserProfileBio */ - 'mentions': Array; + 'mentionedProfiles'?: Array; } diff --git a/src/neynar-api/v1/openapi/models/user200-response-result.ts b/src/neynar-api/v1/openapi/models/user-success-response-result.ts similarity index 81% rename from src/neynar-api/v1/openapi/models/user200-response-result.ts rename to src/neynar-api/v1/openapi/models/user-success-response-result.ts index a582a85d..df1bde17 100644 --- a/src/neynar-api/v1/openapi/models/user200-response-result.ts +++ b/src/neynar-api/v1/openapi/models/user-success-response-result.ts @@ -20,13 +20,13 @@ import { User } from './user'; /** * * @export - * @interface User200ResponseResult + * @interface UserSuccessResponseResult */ -export interface User200ResponseResult { +export interface UserSuccessResponseResult { /** * * @type {User} - * @memberof User200ResponseResult + * @memberof UserSuccessResponseResult */ 'user': User; } diff --git a/src/neynar-api/v1/openapi/models/user200-response.ts b/src/neynar-api/v1/openapi/models/user-success-response.ts similarity index 65% rename from src/neynar-api/v1/openapi/models/user200-response.ts rename to src/neynar-api/v1/openapi/models/user-success-response.ts index 68d15d95..6c1298ff 100644 --- a/src/neynar-api/v1/openapi/models/user200-response.ts +++ b/src/neynar-api/v1/openapi/models/user-success-response.ts @@ -15,19 +15,19 @@ // May contain unused imports in some cases // @ts-ignore -import { User200ResponseResult } from './user200-response-result'; +import { UserSuccessResponseResult } from './user-success-response-result'; /** * * @export - * @interface User200Response + * @interface UserSuccessResponse */ -export interface User200Response { +export interface UserSuccessResponse { /** * - * @type {User200ResponseResult} - * @memberof User200Response + * @type {UserSuccessResponseResult} + * @memberof UserSuccessResponse */ - 'result': User200ResponseResult; + 'result': UserSuccessResponseResult; } diff --git a/src/neynar-api/v1/openapi/models/user.ts b/src/neynar-api/v1/openapi/models/user.ts index 08e5f678..828f34d5 100644 --- a/src/neynar-api/v1/openapi/models/user.ts +++ b/src/neynar-api/v1/openapi/models/user.ts @@ -44,6 +44,12 @@ export interface User { * @memberof User */ 'username': string; + /** + * Custody Address of the user. + * @type {string} + * @memberof User + */ + 'custodyAddress': string; /** * The display of the reactor. * @type {string} From 4d20f452976613a2eccf51d7612434dd9cc1b36f Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Tue, 21 Nov 2023 23:25:34 +0530 Subject: [PATCH 11/77] Syncup OAS --- src/oas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oas b/src/oas index 8482fef7..7fcc943d 160000 --- a/src/oas +++ b/src/oas @@ -1 +1 @@ -Subproject commit 8482fef70bc7c64b489d4f75a1570424db67c103 +Subproject commit 7fcc943d48b6106eb2b13e62ec6dec6b5527a91e From beec3bcc937648aada3656871090e93e2acc9974 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Tue, 21 Nov 2023 23:26:59 +0530 Subject: [PATCH 12/77] generate code for updated oas --- src/neynar-api/v1/openapi/.openapi-generator/FILES | 4 ++-- src/neynar-api/v1/openapi/apis/user-api.ts | 10 +++++----- src/neynar-api/v1/openapi/apis/verification-api.ts | 6 +++--- src/neynar-api/v1/openapi/models/index.ts | 4 ++-- ...ss-response-result.ts => user-response-result.ts} | 6 +++--- .../{user-success-response.ts => user-response.ts} | 12 ++++++------ 6 files changed, 21 insertions(+), 21 deletions(-) rename src/neynar-api/v1/openapi/models/{user-success-response-result.ts => user-response-result.ts} (81%) rename src/neynar-api/v1/openapi/models/{user-success-response.ts => user-response.ts} (65%) diff --git a/src/neynar-api/v1/openapi/.openapi-generator/FILES b/src/neynar-api/v1/openapi/.openapi-generator/FILES index 2af50b84..9d6c3a6e 100644 --- a/src/neynar-api/v1/openapi/.openapi-generator/FILES +++ b/src/neynar-api/v1/openapi/.openapi-generator/FILES @@ -69,8 +69,8 @@ models/user-cast-like-response.ts models/user-pfp.ts models/user-profile-bio.ts models/user-profile.ts -models/user-success-response-result.ts -models/user-success-response.ts +models/user-response-result.ts +models/user-response.ts models/user.ts models/verification-response-result.ts models/verification-response.ts diff --git a/src/neynar-api/v1/openapi/apis/user-api.ts b/src/neynar-api/v1/openapi/apis/user-api.ts index 7516885d..1d29687e 100644 --- a/src/neynar-api/v1/openapi/apis/user-api.ts +++ b/src/neynar-api/v1/openapi/apis/user-api.ts @@ -30,7 +30,7 @@ import { RecentUsersResponse } from '../models'; // @ts-ignore import { UserCastLikeResponse } from '../models'; // @ts-ignore -import { UserSuccessResponse } from '../models'; +import { UserResponse } from '../models'; /** * UserApi - axios parameter creator * @export @@ -335,7 +335,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async user(apiKey: string, fid: number, viewerFid?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async user(apiKey: string, fid: number, viewerFid?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.user(apiKey, fid, viewerFid, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -348,7 +348,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async userByUsername(apiKey: string, username: string, viewerFid?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async userByUsername(apiKey: string, username: string, viewerFid?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.userByUsername(apiKey, username, viewerFid, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -410,7 +410,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - user(apiKey: string, fid: number, viewerFid?: number, options?: any): AxiosPromise { + user(apiKey: string, fid: number, viewerFid?: number, options?: any): AxiosPromise { return localVarFp.user(apiKey, fid, viewerFid, options).then((request) => request(axios, basePath)); }, /** @@ -422,7 +422,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - userByUsername(apiKey: string, username: string, viewerFid?: number, options?: any): AxiosPromise { + userByUsername(apiKey: string, username: string, viewerFid?: number, options?: any): AxiosPromise { return localVarFp.userByUsername(apiKey, username, viewerFid, options).then((request) => request(axios, basePath)); }, /** diff --git a/src/neynar-api/v1/openapi/apis/verification-api.ts b/src/neynar-api/v1/openapi/apis/verification-api.ts index df2abf6d..a2148bcd 100644 --- a/src/neynar-api/v1/openapi/apis/verification-api.ts +++ b/src/neynar-api/v1/openapi/apis/verification-api.ts @@ -24,7 +24,7 @@ import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } fr // @ts-ignore import { ErrorRes } from '../models'; // @ts-ignore -import { UserSuccessResponse } from '../models'; +import { UserResponse } from '../models'; // @ts-ignore import { VerificationResponse } from '../models'; /** @@ -139,7 +139,7 @@ export const VerificationApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async userByVerification(apiKey: string, address: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async userByVerification(apiKey: string, address: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.userByVerification(apiKey, address, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -173,7 +173,7 @@ export const VerificationApiFactory = function (configuration?: Configuration, b * @param {*} [options] Override http request option. * @throws {RequiredError} */ - userByVerification(apiKey: string, address: string, options?: any): AxiosPromise { + userByVerification(apiKey: string, address: string, options?: any): AxiosPromise { return localVarFp.userByVerification(apiKey, address, options).then((request) => request(axios, basePath)); }, /** diff --git a/src/neynar-api/v1/openapi/models/index.ts b/src/neynar-api/v1/openapi/models/index.ts index c75fe3a5..e4a911ad 100644 --- a/src/neynar-api/v1/openapi/models/index.ts +++ b/src/neynar-api/v1/openapi/models/index.ts @@ -54,8 +54,8 @@ export * from './user-cast-like-response-result'; export * from './user-pfp'; export * from './user-profile'; export * from './user-profile-bio'; -export * from './user-success-response'; -export * from './user-success-response-result'; +export * from './user-response'; +export * from './user-response-result'; export * from './verification-response'; export * from './verification-response-result'; export * from './viewer-context'; diff --git a/src/neynar-api/v1/openapi/models/user-success-response-result.ts b/src/neynar-api/v1/openapi/models/user-response-result.ts similarity index 81% rename from src/neynar-api/v1/openapi/models/user-success-response-result.ts rename to src/neynar-api/v1/openapi/models/user-response-result.ts index df1bde17..f8fce01c 100644 --- a/src/neynar-api/v1/openapi/models/user-success-response-result.ts +++ b/src/neynar-api/v1/openapi/models/user-response-result.ts @@ -20,13 +20,13 @@ import { User } from './user'; /** * * @export - * @interface UserSuccessResponseResult + * @interface UserResponseResult */ -export interface UserSuccessResponseResult { +export interface UserResponseResult { /** * * @type {User} - * @memberof UserSuccessResponseResult + * @memberof UserResponseResult */ 'user': User; } diff --git a/src/neynar-api/v1/openapi/models/user-success-response.ts b/src/neynar-api/v1/openapi/models/user-response.ts similarity index 65% rename from src/neynar-api/v1/openapi/models/user-success-response.ts rename to src/neynar-api/v1/openapi/models/user-response.ts index 6c1298ff..dba62972 100644 --- a/src/neynar-api/v1/openapi/models/user-success-response.ts +++ b/src/neynar-api/v1/openapi/models/user-response.ts @@ -15,19 +15,19 @@ // May contain unused imports in some cases // @ts-ignore -import { UserSuccessResponseResult } from './user-success-response-result'; +import { UserResponseResult } from './user-response-result'; /** * * @export - * @interface UserSuccessResponse + * @interface UserResponse */ -export interface UserSuccessResponse { +export interface UserResponse { /** * - * @type {UserSuccessResponseResult} - * @memberof UserSuccessResponse + * @type {UserResponseResult} + * @memberof UserResponse */ - 'result': UserSuccessResponseResult; + 'result': UserResponseResult; } From f4276cff182b9b46bf9a8d1506943ba1fe27fba8 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Tue, 21 Nov 2023 23:37:46 +0530 Subject: [PATCH 13/77] Rename User200Success to UserResponse in sdk methods and return entire response rather than inner objects --- src/neynar-api/neynar-api-client.ts | 15 +++++++++------ src/neynar-api/v1/v1-client.ts | 22 +++++++++++----------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index 4408e050..3f565e30 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -33,7 +33,8 @@ import { CastReactionsResponse, CastRecasterResponse, FollowResponse, - User200Response, + UserResponse as UserResponseV1, + CustodyAddressResponse, } from "./v1/openapi"; import { FetchRelevantMints200Response } from "./v2/openapi-recommendation"; @@ -118,7 +119,7 @@ export class NeynarAPIClient { public async lookupUserByFid( fid: number, viewerFid?: number - ): Promise { + ): Promise { return await this.clients.v1.lookupUserByFid(fid, viewerFid); } @@ -130,7 +131,7 @@ export class NeynarAPIClient { public async lookupUserByUsername( username: string, viewerFid?: number - ): Promise { + ): Promise { return await this.clients.v1.lookupUserByUsername(username, viewerFid); } @@ -139,8 +140,10 @@ export class NeynarAPIClient { * See [Neynar documentation](https://docs.neynar.com/reference/custody-address-v1) * */ - public async fetchCustodyAddressForUser(fid: number): Promise { - return await this.clients.v1.fetchCustodyAddressForUser(fid); + public async lookupCustodyAddressForUser( + fid: number + ): Promise { + return await this.clients.v1.lookupCustodyAddressForUser(fid); } // ------------ Cast ------------ @@ -223,7 +226,7 @@ export class NeynarAPIClient { */ public async lookupUserByVerification( address: string - ): Promise { + ): Promise { return await this.clients.v1.lookupUserByVerification(address); } diff --git a/src/neynar-api/v1/v1-client.ts b/src/neynar-api/v1/v1-client.ts index 33db8959..74048315 100644 --- a/src/neynar-api/v1/v1-client.ts +++ b/src/neynar-api/v1/v1-client.ts @@ -20,7 +20,8 @@ import { CastReactionsResponse, CastRecasterResponse, FollowResponse, - User200Response, + UserResponse, + CustodyAddressResponse, } from "./openapi"; import axios, { AxiosError, AxiosInstance } from "axios"; import { silentLogger, Logger } from "../common/logger"; @@ -64,7 +65,7 @@ export class NeynarV1APIClient { "Attempt to use an authenticated API method without first providing an api key" ); } - + this.apiKey = apiKey; if (axiosInstance === undefined) { @@ -137,7 +138,6 @@ export class NeynarV1APIClient { /** * Fetch all likes by a given user. * See [Neynar documentation](https://docs.neynar.com/reference/user-cast-likes-v1) - * */ public async fetchAllCastsLikedByUser( fid: number, @@ -162,7 +162,7 @@ export class NeynarV1APIClient { public async lookupUserByFid( fid: number, viewerFid?: number - ): Promise { + ): Promise { const response = await this.apis.user.user(this.apiKey, fid, viewerFid); return response.data; } @@ -175,15 +175,13 @@ export class NeynarV1APIClient { public async lookupUserByUsername( username: string, viewerFid?: number - ): Promise { + ): Promise { const response = await this.apis.user.userByUsername( this.apiKey, username, viewerFid ); - // result.user is undefined if not found - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - return response.data.result.user ?? null; + return response.data; } /** @@ -191,9 +189,11 @@ export class NeynarV1APIClient { * See [Neynar documentation](https://docs.neynar.com/reference/custody-address-v1) * */ - public async fetchCustodyAddressForUser(fid: number): Promise { + public async lookupCustodyAddressForUser( + fid: number + ): Promise { const response = await this.apis.user.custodyAddress(this.apiKey, fid); - return response.data.result.custodyAddress; + return response.data; } // ------------ Cast ------------ @@ -314,7 +314,7 @@ export class NeynarV1APIClient { */ public async lookupUserByVerification( address: string - ): Promise { + ): Promise { const response = await this.apis.verification.userByVerification( this.apiKey, address From 10e377eadd9754261ceb2596ec81794dea1da9f8 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Wed, 22 Nov 2023 11:41:07 +0530 Subject: [PATCH 14/77] Add doc-string for fetchRecentUsers and send entire casts response rather than casts --- src/neynar-api/neynar-api-client.ts | 18 ++++++++++++++++-- src/neynar-api/v1/v1-client.ts | 19 ++++++++++++++++--- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index 3f565e30..ba68afa8 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -35,6 +35,7 @@ import { FollowResponse, UserResponse as UserResponseV1, CustodyAddressResponse, + CastResponse as CastResponseV1, } from "./v1/openapi"; import { FetchRelevantMints200Response } from "./v2/openapi-recommendation"; @@ -88,8 +89,21 @@ export class NeynarAPIClient { /** * A list of users in reverse chronological order based on sign up. - * See [Neynar documentation](https://docs.neynar.com/reference/recent-users-v1) * + * @param {Object} [options] - Optional parameters for the request. + * @param {number} [options.viewerFid] - The FID (unique identifier) of the user viewing the data. + * This can be used for providing contextual information specific to the viewer. + * @param {number} [options.limit] - The maximum number of users to be returned in the response. + * By default, 100 users are returned, but this can be adjusted up to a maximum of 1000. + * @param {string} [options.cursor] - A pagination cursor to fetch a specific set of results. + * This is useful for implementing paginated retrieval of the data. + * + * + * @returns {Promise} A promise that resolves to a `RecentUsersResponse` object, + * containing the list of recent users and any associated metadata. + * + * For more information, refer to the Neynar documentation: + * [Neynar documentation](https://docs.neynar.com/reference/recent-users-v1) */ public async fetchRecentUsers(options?: { viewerFid?: number; @@ -156,7 +170,7 @@ export class NeynarAPIClient { public async lookUpCastByHash( hash: string, options?: { viewerFid?: number } - ): Promise { + ): Promise { return await this.clients.v1.lookUpCastByHash(hash, options); } diff --git a/src/neynar-api/v1/v1-client.ts b/src/neynar-api/v1/v1-client.ts index 74048315..fc991c1c 100644 --- a/src/neynar-api/v1/v1-client.ts +++ b/src/neynar-api/v1/v1-client.ts @@ -22,6 +22,7 @@ import { FollowResponse, UserResponse, CustodyAddressResponse, + CastResponse, } from "./openapi"; import axios, { AxiosError, AxiosInstance } from "axios"; import { silentLogger, Logger } from "../common/logger"; @@ -117,8 +118,20 @@ export class NeynarV1APIClient { /** * A list of users in reverse chronological order based on sign up. - * See [Neynar documentation](https://docs.neynar.com/reference/recent-users-v1) * + * @param {Object} options - Optional configuration for fine-tuning the request. + * @param {number} options.viewerFid - The FID (unique identifier) of the user making the request. + * Specifying this can provide contextual data tailored to the viewer. + * @param {number} options.limit=100 - Limits the number of users returned in a single request. + * Defaults to 100, with a maximum allowable value of 1000. + * @param {string} options.cursor - A cursor for pagination. Use this to fetch subsequent + * sets of users after the initial request. + * + * @returns {Promise} A promise that resolves to a `RecentUsersResponse` object, + * containing the list of recent users and any associated metadata. + * + * For more information, refer to the Neynar documentation: + * [Neynar documentation](https://docs.neynar.com/reference/recent-users-v1) */ public async fetchRecentUsers(options?: { viewerFid?: number; @@ -206,13 +219,13 @@ export class NeynarV1APIClient { public async lookUpCastByHash( hash: string, options?: { viewerFid?: number } - ): Promise { + ): Promise { const response = await this.apis.cast.cast( this.apiKey, hash, options?.viewerFid ); - return response.data.result.cast; + return response.data; } /** From 58a7f5bcb751dc531a4a5639a752a76494a5affb Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Wed, 22 Nov 2023 12:07:44 +0530 Subject: [PATCH 15/77] Add doc string for fetchAllCastsLikedByUser and update docs for fetchRecentUsers --- src/neynar-api/neynar-api-client.ts | 43 ++++++++++++++++++---- src/neynar-api/v1/v1-client.ts | 55 +++++++++++++++++++++++------ 2 files changed, 81 insertions(+), 17 deletions(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index ba68afa8..19724cc0 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -94,16 +94,24 @@ export class NeynarAPIClient { * @param {number} [options.viewerFid] - The FID (unique identifier) of the user viewing the data. * This can be used for providing contextual information specific to the viewer. * @param {number} [options.limit] - The maximum number of users to be returned in the response. - * By default, 100 users are returned, but this can be adjusted up to a maximum of 1000. + * Can be adjusted up to a maximum of 1000. * @param {string} [options.cursor] - A pagination cursor to fetch a specific set of results. * This is useful for implementing paginated retrieval of the data. * - * * @returns {Promise} A promise that resolves to a `RecentUsersResponse` object, * containing the list of recent users and any associated metadata. * - * For more information, refer to the Neynar documentation: - * [Neynar documentation](https://docs.neynar.com/reference/recent-users-v1) + * @example + * // Fetch a specific number of recent users, using viewer FID and a pagination cursor + * apiClient.fetchRecentUsers({ + * viewerFid: 3, + * limit: 50, + * cursor: 'nextPageCursor' + * }).then(response => { + * console.log('Recent Users:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/recent-users-v1) */ public async fetchRecentUsers(options?: { viewerFid?: number; @@ -114,9 +122,32 @@ export class NeynarAPIClient { } /** - * Fetch all likes by a given user. - * See [Neynar documentation](https://docs.neynar.com/reference/user-cast-likes-v1) + * Fetches all casts liked by a specific user. This method returns a list of casts that + * the specified user has liked, with support for pagination through optional parameters. + * + * @param {number} fid - The FID (unique identifier) of the user whose liked casts are to be fetched. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {number} [options.viewerFid] - The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * @param {number} [options.limit] - The maximum number of liked casts to be returned in the response. + * This can be adjusted, with a sensible maximum to ensure performance. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results, + * useful for implementing paginated data retrieval. + * + * @returns {Promise} A promise that resolves to a `UserCastLikeResponse` object, + * containing the list of casts liked by the user and any associated metadata. + * + * @example + * // Fetch a specific number of casts liked by a user, using viewer FID and a pagination cursor + * apiClient.fetchAllCastsLikedByUser(3, { + * viewerFid: 2, + * limit: 50, + * cursor: 'nextPageCursor' + * }).then(response => { + * console.log('Liked Casts:', response); + * }); * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/user-cast-likes-v1). */ public async fetchAllCastsLikedByUser( fid: number, diff --git a/src/neynar-api/v1/v1-client.ts b/src/neynar-api/v1/v1-client.ts index fc991c1c..cd3274c9 100644 --- a/src/neynar-api/v1/v1-client.ts +++ b/src/neynar-api/v1/v1-client.ts @@ -119,19 +119,28 @@ export class NeynarV1APIClient { /** * A list of users in reverse chronological order based on sign up. * - * @param {Object} options - Optional configuration for fine-tuning the request. - * @param {number} options.viewerFid - The FID (unique identifier) of the user making the request. - * Specifying this can provide contextual data tailored to the viewer. - * @param {number} options.limit=100 - Limits the number of users returned in a single request. - * Defaults to 100, with a maximum allowable value of 1000. - * @param {string} options.cursor - A cursor for pagination. Use this to fetch subsequent - * sets of users after the initial request. + * @param {Object} [options] - Optional parameters for the request. + * @param {number} [options.viewerFid] - The FID (unique identifier) of the user viewing the data. + * This can be used for providing contextual information specific to the viewer. + * @param {number} [options.limit] - The maximum number of users to be returned in the response. + * Can be adjusted up to a maximum of 1000. + * @param {string} [options.cursor] - A pagination cursor to fetch a specific set of results. + * This is useful for implementing paginated retrieval of the data. * * @returns {Promise} A promise that resolves to a `RecentUsersResponse` object, * containing the list of recent users and any associated metadata. * - * For more information, refer to the Neynar documentation: - * [Neynar documentation](https://docs.neynar.com/reference/recent-users-v1) + * @example + * // Fetch a specific number of recent users, using viewer FID and a pagination cursor + * apiClient.fetchRecentUsers({ + * viewerFid: 3, + * limit: 50, + * cursor: 'nextPageCursor' + * }).then(response => { + * console.log('Recent Users:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/recent-users-v1) */ public async fetchRecentUsers(options?: { viewerFid?: number; @@ -149,8 +158,32 @@ export class NeynarV1APIClient { } /** - * Fetch all likes by a given user. - * See [Neynar documentation](https://docs.neynar.com/reference/user-cast-likes-v1) + * Fetches all casts liked by a specific user. This method returns a list of casts that + * the specified user has liked, with support for pagination through optional parameters. + * + * @param {number} fid - The FID (unique identifier) of the user whose liked casts are to be fetched. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {number} [options.viewerFid] - The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * @param {number} [options.limit] - The maximum number of liked casts to be returned in the response. + * This can be adjusted, with a sensible maximum to ensure performance. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results, + * useful for implementing paginated data retrieval. + * + * @returns {Promise} A promise that resolves to a `UserCastLikeResponse` object, + * containing the list of casts liked by the user and any associated metadata. + * + * @example + * // Fetch a specific number of casts liked by a user, using viewer FID and a pagination cursor + * apiClient.fetchAllCastsLikedByUser(3, { + * viewerFid: 2, + * limit: 50, + * cursor: 'nextPageCursor' + * }).then(response => { + * console.log('Liked Casts:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/user-cast-likes-v1). */ public async fetchAllCastsLikedByUser( fid: number, From b59b2634dabed71ebcad6377ba3842a2a07b1611 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Wed, 22 Nov 2023 18:31:24 +0530 Subject: [PATCH 16/77] Add Docs for V1 Users APIs --- src/neynar-api/neynar-api-client.ts | 51 +++++++++++++++++++++++++---- src/neynar-api/v1/v1-client.ts | 51 +++++++++++++++++++++++++---- 2 files changed, 88 insertions(+), 14 deletions(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index 19724cc0..18aff8ca 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -103,7 +103,7 @@ export class NeynarAPIClient { * * @example * // Fetch a specific number of recent users, using viewer FID and a pagination cursor - * apiClient.fetchRecentUsers({ + * client.fetchRecentUsers({ * viewerFid: 3, * limit: 50, * cursor: 'nextPageCursor' @@ -139,7 +139,7 @@ export class NeynarAPIClient { * * @example * // Fetch a specific number of casts liked by a user, using viewer FID and a pagination cursor - * apiClient.fetchAllCastsLikedByUser(3, { + * client.fetchAllCastsLikedByUser(3, { * viewerFid: 2, * limit: 50, * cursor: 'nextPageCursor' @@ -158,8 +158,21 @@ export class NeynarAPIClient { /** * Gets the specified user via their FID (if found). - * See [Neynar documentation](https://docs.neynar.com/reference/user-v1) * + * @param {number} fid - The FID of the user whose information is being retrieved. + * @param {number} [viewerFid] - Optional. The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * + * @returns {Promise} A promise that resolves to a `UserResponseV1` object, + * containing the metadata about the specified user. + * + * @example + * // Example: Retrieve information about a user with FID 19960 as viewed by a user with FID 194 + * client.lookupUserByFid(19960, 194).then(response => { + * console.log('User Information:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/user-v1). */ public async lookupUserByFid( fid: number, @@ -169,9 +182,22 @@ export class NeynarAPIClient { } /** - * Gets the specified user via their username (if found). - * See [Neynar documentation](https://docs.neynar.com/reference/user-by-username-v1) + * Retrieves the specified user via their username (if found). + * + * @param {string} username - The username of the user whose information is being retrieved. + * @param {number} [viewerFid] - Optional. The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * + * @returns {Promise} A promise that resolves to a `UserResponseV1` object, + * containing the metadata about the user associated with the given username. * + * @example + * // Example: Retrieve information about a user with username 'manan' as viewed by a user with FID 3 + * client.lookupUserByUsername('manan', 3).then(response => { + * console.log('User Information:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/user-by-username-v1). */ public async lookupUserByUsername( username: string, @@ -181,9 +207,20 @@ export class NeynarAPIClient { } /** - * Gets the custody address for the specified user via their username (if found). - * See [Neynar documentation](https://docs.neynar.com/reference/custody-address-v1) + * Gets the custody address for the specified user via their fid (if found). + * + * @param {number} fid - The FID (unique identifier) of the user whose custody address is being retrieved. + * + * @returns {Promise} A promise that resolves to a `CustodyAddressResponse` object, + * containing the custody address associated with the specified user. + * + * @example + * // Example: Retrieve the custody address for a user with FID 194 + * client.lookupCustodyAddressForUser(194).then(response => { + * console.log('Custody Address:', response); + * }); * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/custody-address-v1). */ public async lookupCustodyAddressForUser( fid: number diff --git a/src/neynar-api/v1/v1-client.ts b/src/neynar-api/v1/v1-client.ts index cd3274c9..b762fb7b 100644 --- a/src/neynar-api/v1/v1-client.ts +++ b/src/neynar-api/v1/v1-client.ts @@ -132,7 +132,7 @@ export class NeynarV1APIClient { * * @example * // Fetch a specific number of recent users, using viewer FID and a pagination cursor - * apiClient.fetchRecentUsers({ + * client.fetchRecentUsers({ * viewerFid: 3, * limit: 50, * cursor: 'nextPageCursor' @@ -175,7 +175,7 @@ export class NeynarV1APIClient { * * @example * // Fetch a specific number of casts liked by a user, using viewer FID and a pagination cursor - * apiClient.fetchAllCastsLikedByUser(3, { + * client.fetchAllCastsLikedByUser(3, { * viewerFid: 2, * limit: 50, * cursor: 'nextPageCursor' @@ -202,8 +202,21 @@ export class NeynarV1APIClient { /** * Gets the specified user via their FID (if found). - * See [Neynar documentation](https://docs.neynar.com/reference/user-v1) * + * @param {number} fid - The FID of the user whose information is being retrieved. + * @param {number} [viewerFid] - Optional. The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * + * @returns {Promise} A promise that resolves to a `UserResponse` object, + * containing the metadata about the specified user. + * + * @example + * // Example: Retrieve information about a user with FID 19960 as viewed by a user with FID 194 + * client.lookupUserByFid(19960, 194).then(response => { + * console.log('User Information:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/user-v1). */ public async lookupUserByFid( fid: number, @@ -214,9 +227,22 @@ export class NeynarV1APIClient { } /** - * Gets the specified user via their username (if found). - * See [Neynar documentation](https://docs.neynar.com/reference/user-by-username-v1) + * Retrieves the specified user via their username (if found). + * + * @param {string} username - The username of the user whose information is being retrieved. + * @param {number} [viewerFid] - Optional. The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * + * @returns {Promise} A promise that resolves to a `UserResponse` object, + * containing the metadata about the user associated with the given username. * + * @example + * // Example: Retrieve information about a user with username 'manan' as viewed by a user with FID 3 + * client.lookupUserByUsername('manan', 3).then(response => { + * console.log('User Information:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/user-by-username-v1). */ public async lookupUserByUsername( username: string, @@ -231,9 +257,20 @@ export class NeynarV1APIClient { } /** - * Gets the custody address for the specified user via their username (if found). - * See [Neynar documentation](https://docs.neynar.com/reference/custody-address-v1) + * Gets the custody address for the specified user via their fid (if found). + * + * @param {number} fid - The FID (unique identifier) of the user whose custody address is being retrieved. + * + * @returns {Promise} A promise that resolves to a `CustodyAddressResponse` object, + * containing the custody address associated with the specified user. + * + * @example + * // Example: Retrieve the custody address for a user with FID 194 + * client.lookupCustodyAddressForUser(194).then(response => { + * console.log('Custody Address:', response); + * }); * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/custody-address-v1). */ public async lookupCustodyAddressForUser( fid: number From 48c169b9f7930532c9d878af3b0682704ce777d4 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Wed, 22 Nov 2023 20:56:21 +0530 Subject: [PATCH 17/77] Update docs as per the guidelines and Add docs for fetchAllCastsCreatedByUser and lookUpCastByHash --- src/neynar-api/neynar-api-client.ts | 78 ++++++++++++++++++++++------- src/neynar-api/v1/v1-client.ts | 78 ++++++++++++++++++++++------- 2 files changed, 118 insertions(+), 38 deletions(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index 18aff8ca..e14e77c5 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -88,15 +88,15 @@ export class NeynarAPIClient { // ------------ User ------------ /** - * A list of users in reverse chronological order based on sign up. + * Retrieves a list of users in reverse chronological order based on sign up. * - * @param {Object} [options] - Optional parameters for the request. + * @param {Object} [options] - Optional parameters to tailor the request. * @param {number} [options.viewerFid] - The FID (unique identifier) of the user viewing the data. * This can be used for providing contextual information specific to the viewer. * @param {number} [options.limit] - The maximum number of users to be returned in the response. - * Can be adjusted up to a maximum of 1000. - * @param {string} [options.cursor] - A pagination cursor to fetch a specific set of results. - * This is useful for implementing paginated retrieval of the data. + * Defaults to 100, with a maximum allowable value of 1000. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. * * @returns {Promise} A promise that resolves to a `RecentUsersResponse` object, * containing the list of recent users and any associated metadata. @@ -105,8 +105,8 @@ export class NeynarAPIClient { * // Fetch a specific number of recent users, using viewer FID and a pagination cursor * client.fetchRecentUsers({ * viewerFid: 3, - * limit: 50, - * cursor: 'nextPageCursor' + * limit: 50, // Fetching up to 50 users + * cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. * }).then(response => { * console.log('Recent Users:', response); * }); @@ -122,7 +122,7 @@ export class NeynarAPIClient { } /** - * Fetches all casts liked by a specific user. This method returns a list of casts that + * Retrieves all casts liked by a specific user. This method returns a list of casts that * the specified user has liked, with support for pagination through optional parameters. * * @param {number} fid - The FID (unique identifier) of the user whose liked casts are to be fetched. @@ -130,9 +130,9 @@ export class NeynarAPIClient { * @param {number} [options.viewerFid] - The FID of the user viewing this information, * used for providing contextual data specific to the viewer. * @param {number} [options.limit] - The maximum number of liked casts to be returned in the response. - * This can be adjusted, with a sensible maximum to ensure performance. - * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results, - * useful for implementing paginated data retrieval. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. * * @returns {Promise} A promise that resolves to a `UserCastLikeResponse` object, * containing the list of casts liked by the user and any associated metadata. @@ -141,8 +141,8 @@ export class NeynarAPIClient { * // Fetch a specific number of casts liked by a user, using viewer FID and a pagination cursor * client.fetchAllCastsLikedByUser(3, { * viewerFid: 2, - * limit: 50, - * cursor: 'nextPageCursor' + * limit: 50, // Fetching up to 50 casts + * cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. * }).then(response => { * console.log('Liked Casts:', response); * }); @@ -157,7 +157,7 @@ export class NeynarAPIClient { } /** - * Gets the specified user via their FID (if found). + * Retrieves the specified user via their FID (if found). * * @param {number} fid - The FID of the user whose information is being retrieved. * @param {number} [viewerFid] - Optional. The FID of the user viewing this information, @@ -207,7 +207,7 @@ export class NeynarAPIClient { } /** - * Gets the custody address for the specified user via their fid (if found). + * Retrieves the custody address for the specified user via their fid (if found). * * @param {number} fid - The FID (unique identifier) of the user whose custody address is being retrieved. * @@ -231,9 +231,23 @@ export class NeynarAPIClient { // ------------ Cast ------------ /** - * Fetches a single cast by its hash. - * See [Neynar documentation](https://docs.neynar.com/reference/cast-v1) + * Retrieves information about a single cast using its unique hash identifier. + * + * @param {string} hash - The unique hash identifier of the cast to be retrieved. + * @param {Object} [options] - Optional parameters for the request. + * @param {number} [options.viewerFid] - Optional. The FID of the user viewing the information, + * used for providing contextual data specific to the viewer. + * + * @returns {Promise} A promise that resolves to a `CastResponseV1` object, + * containing detailed information about the specified cast. + * + * @example + * // Example: Retrieve information about a cast with a specific hash, as viewed by a user with FID 3 + * client.lookUpCastByHash('0xfe90f9de682273e05b201629ad2338bdcd89b6be', { viewerFid: 3 }).then(response => { + * console.log('Cast Information:', response); + * }); * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/cast-v1). */ public async lookUpCastByHash( hash: string, @@ -256,9 +270,35 @@ export class NeynarAPIClient { } /** - * Gets all casts (including replies and recasts) created by the specified user. - * See [Neynar documentation](https://docs.neynar.com/reference/casts-v1) + * Retrieves all casts (including replies and recasts) created by the specified user. + * + * @param {number} fid - The FID (unique identifier) of the user whose casts are being retrieved. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {string} [options.parentUrl] - Optional. A URL identifying the channel to which the casts belong. + * A cast can be part of a certain channel. The channel is identified by parent_url. + * All casts in the channel ladder up to the same parent_url. + * @param {number} [options.viewerFid] - Optional. The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * @param {number} [options.limit] - Optional. The maximum number of casts to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `CastsResponseV1` object, + * containing the casts created by the specified user along with any associated metadata. + * + * @example + * // Example: Retrieve casts created by a user with FID 3, including contextual information for a viewer + * client.fetchAllCastsCreatedByUser(3, { + * parentUrl: 'https://ethereum.org', + * viewerFid: 2, + * limit: 50, // Fetching up to 50 casts + * cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('User Casts:', response); + * }); * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/casts-v1). */ public async fetchAllCastsCreatedByUser( fid: number, diff --git a/src/neynar-api/v1/v1-client.ts b/src/neynar-api/v1/v1-client.ts index b762fb7b..8e2f0763 100644 --- a/src/neynar-api/v1/v1-client.ts +++ b/src/neynar-api/v1/v1-client.ts @@ -117,15 +117,15 @@ export class NeynarV1APIClient { // ------------ User ------------ /** - * A list of users in reverse chronological order based on sign up. + * Retrieves a list of users in reverse chronological order based on sign up. * - * @param {Object} [options] - Optional parameters for the request. + * @param {Object} [options] - Optional parameters to tailor the request. * @param {number} [options.viewerFid] - The FID (unique identifier) of the user viewing the data. * This can be used for providing contextual information specific to the viewer. * @param {number} [options.limit] - The maximum number of users to be returned in the response. - * Can be adjusted up to a maximum of 1000. - * @param {string} [options.cursor] - A pagination cursor to fetch a specific set of results. - * This is useful for implementing paginated retrieval of the data. + * Defaults to 100, with a maximum allowable value of 1000. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. * * @returns {Promise} A promise that resolves to a `RecentUsersResponse` object, * containing the list of recent users and any associated metadata. @@ -134,8 +134,8 @@ export class NeynarV1APIClient { * // Fetch a specific number of recent users, using viewer FID and a pagination cursor * client.fetchRecentUsers({ * viewerFid: 3, - * limit: 50, - * cursor: 'nextPageCursor' + * limit: 50, // Fetching up to 50 users + * cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. * }).then(response => { * console.log('Recent Users:', response); * }); @@ -158,7 +158,7 @@ export class NeynarV1APIClient { } /** - * Fetches all casts liked by a specific user. This method returns a list of casts that + * Retrieves all casts liked by a specific user. This method returns a list of casts that * the specified user has liked, with support for pagination through optional parameters. * * @param {number} fid - The FID (unique identifier) of the user whose liked casts are to be fetched. @@ -166,9 +166,9 @@ export class NeynarV1APIClient { * @param {number} [options.viewerFid] - The FID of the user viewing this information, * used for providing contextual data specific to the viewer. * @param {number} [options.limit] - The maximum number of liked casts to be returned in the response. - * This can be adjusted, with a sensible maximum to ensure performance. - * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results, - * useful for implementing paginated data retrieval. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. * * @returns {Promise} A promise that resolves to a `UserCastLikeResponse` object, * containing the list of casts liked by the user and any associated metadata. @@ -177,8 +177,8 @@ export class NeynarV1APIClient { * // Fetch a specific number of casts liked by a user, using viewer FID and a pagination cursor * client.fetchAllCastsLikedByUser(3, { * viewerFid: 2, - * limit: 50, - * cursor: 'nextPageCursor' + * limit: 50, // Fetching up to 50 casts + * cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. * }).then(response => { * console.log('Liked Casts:', response); * }); @@ -201,7 +201,7 @@ export class NeynarV1APIClient { } /** - * Gets the specified user via their FID (if found). + * Retrieves the specified user via their FID (if found). * * @param {number} fid - The FID of the user whose information is being retrieved. * @param {number} [viewerFid] - Optional. The FID of the user viewing this information, @@ -257,7 +257,7 @@ export class NeynarV1APIClient { } /** - * Gets the custody address for the specified user via their fid (if found). + * Retrieves the custody address for the specified user via their fid (if found). * * @param {number} fid - The FID (unique identifier) of the user whose custody address is being retrieved. * @@ -282,9 +282,23 @@ export class NeynarV1APIClient { // ------------ Cast ------------ /** - * Fetches a single cast by its hash. - * See [Neynar documentation](https://docs.neynar.com/reference/cast-v1) + * Retrieves information about a single cast using its unique hash identifier. + * + * @param {string} hash - The unique hash identifier of the cast to be retrieved. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {number} [options.viewerFid] - Optional. The FID of the user viewing the information, + * used for providing contextual data specific to the viewer. + * + * @returns {Promise} A promise that resolves to a `CastResponse` object, + * containing detailed information about the specified cast. * + * @example + * // Example: Retrieve information about a cast with a specific hash, as viewed by a user with FID 3 + * client.lookUpCastByHash('0xfe90f9de682273e05b201629ad2338bdcd89b6be', { viewerFid: 3 }).then(response => { + * console.log('Cast Information:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/cast-v1). */ public async lookUpCastByHash( hash: string, @@ -325,9 +339,35 @@ export class NeynarV1APIClient { } /** - * Gets all casts (including replies and recasts) created by the specified user. - * See [Neynar documentation](https://docs.neynar.com/reference/casts-v1) + * Retrieves all casts (including replies and recasts) created by the specified user. + * + * @param {number} fid - The FID (unique identifier) of the user whose casts are being retrieved. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {string} [options.parentUrl] - Optional. A URL identifying the channel to which the casts belong. + * A cast can be part of a certain channel. The channel is identified by parent_url. + * All casts in the channel ladder up to the same parent_url. + * @param {number} [options.viewerFid] - Optional. The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * @param {number} [options.limit] - Optional. The maximum number of casts to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `CastsResponse` object, + * containing the casts created by the specified user along with any associated metadata. + * + * @example + * // Example: Retrieve casts created by a user with FID 3, including contextual information for a viewer + * client.fetchAllCastsCreatedByUser(3, { + * parentUrl: 'https://ethereum.org', + * viewerFid: 2, + * limit: 50, // Fetching up to 50 casts + * cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('User Casts:', response); + * }); * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/casts-v1). */ public async fetchAllCastsCreatedByUser( fid: number, From 469de4114377a5725a3656a05180a381472c7698 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Wed, 22 Nov 2023 21:20:25 +0530 Subject: [PATCH 18/77] Add JS docstring for Casts V1 apis --- src/neynar-api/neynar-api-client.ts | 25 +++++++++++++++++++++++-- src/neynar-api/v1/v1-client.ts | 25 +++++++++++++++++++++++-- 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index e14e77c5..56a55ec1 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -313,9 +313,30 @@ export class NeynarAPIClient { } /** - * Gets recent casts created by the specified user. - * See [Neynar documentation](https://docs.neynar.com/reference/recent-casts-v1) + * Retrieves a list of casts from the protocol in reverse chronological order based on timestamp * + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {number} [options.viewerFid] - The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * @param {number} [options.limit] - The maximum number of casts to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 100. + * @param {string} [options.cursor] - Pagination cursor for the next set of results. + * Omit this parameter for the initial request. Useful for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `RecentCastsResponse` object, + * containing the recent casts along with any associated metadata. + * + * @example + * // Example: Retrieve recent casts with a limit of 50, as viewed by a user with FID 3 + * client.fetchRecentCasts({ + * viewerFid: 3, + * limit: 50 // Fetching up to 50 casts + * cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Recent Casts:', response); // Outputs the recent casts + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/recent-casts-v1). */ public async fetchRecentCasts(options?: { viewerFid?: number; diff --git a/src/neynar-api/v1/v1-client.ts b/src/neynar-api/v1/v1-client.ts index 8e2f0763..5507b1c7 100644 --- a/src/neynar-api/v1/v1-client.ts +++ b/src/neynar-api/v1/v1-client.ts @@ -391,9 +391,30 @@ export class NeynarV1APIClient { } /** - * Gets recent casts created by the specified user. - * See [Neynar documentation](https://docs.neynar.com/reference/recent-casts-v1) + * Retrieves a list of casts from the protocol in reverse chronological order based on timestamp * + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {number} [options.viewerFid] - The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * @param {number} [options.limit] - The maximum number of casts to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 100. + * @param {string} [options.cursor] - Pagination cursor for the next set of results. + * Omit this parameter for the initial request. Useful for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `RecentCastsResponse` object, + * containing the recent casts along with any associated metadata. + * + * @example + * // Example: Retrieve recent casts with a limit of 50, as viewed by a user with FID 3 + * client.fetchRecentCasts({ + * viewerFid: 3, + * limit: 50 // Fetching up to 50 casts + * cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Recent Casts:', response); // Outputs the recent casts + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/recent-casts-v1). */ public async fetchRecentCasts(options?: { viewerFid?: number; From fac149b088dbf9d4bcd592fa4c97b1945e815c1f Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Wed, 22 Nov 2023 21:37:40 +0530 Subject: [PATCH 19/77] add comma in example --- src/neynar-api/neynar-api-client.ts | 2 +- src/neynar-api/v1/v1-client.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index 56a55ec1..baa60a0e 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -330,7 +330,7 @@ export class NeynarAPIClient { * // Example: Retrieve recent casts with a limit of 50, as viewed by a user with FID 3 * client.fetchRecentCasts({ * viewerFid: 3, - * limit: 50 // Fetching up to 50 casts + * limit: 50, // Fetching up to 50 casts * cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. * }).then(response => { * console.log('Recent Casts:', response); // Outputs the recent casts diff --git a/src/neynar-api/v1/v1-client.ts b/src/neynar-api/v1/v1-client.ts index 5507b1c7..55e5062b 100644 --- a/src/neynar-api/v1/v1-client.ts +++ b/src/neynar-api/v1/v1-client.ts @@ -408,7 +408,7 @@ export class NeynarV1APIClient { * // Example: Retrieve recent casts with a limit of 50, as viewed by a user with FID 3 * client.fetchRecentCasts({ * viewerFid: 3, - * limit: 50 // Fetching up to 50 casts + * limit: 50, // Fetching up to 50 casts * cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. * }).then(response => { * console.log('Recent Casts:', response); // Outputs the recent casts From ecc90f85fab7556948bd6bfc053aa4dc96e8ff00 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Wed, 22 Nov 2023 22:29:16 +0530 Subject: [PATCH 20/77] Add docString for lookupUserByVerification and Notifications APIs --- src/neynar-api/neynar-api-client.ts | 67 ++++++++++++++++++++++++++--- src/neynar-api/v1/v1-client.ts | 67 ++++++++++++++++++++++++++--- 2 files changed, 124 insertions(+), 10 deletions(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index baa60a0e..88291baa 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -360,12 +360,25 @@ export class NeynarAPIClient { } /** + * Retrieve user information using a verification address + * * Checks if a given Ethereum address has a Farcaster user associated with it. * Note: if an address is associated with multiple users, the API will return * the user who most recently published a verification with the address * (based on when Warpcast received the proof, not a self-reported timestamp). - * See [Neynar documentation](https://docs.neynar.com/reference/user-by-verification-v1) * + * @param {string} address - The Ethereum address that have has a Farcaster user associated with it + * + * @returns {Promise} A promise that resolves to a `UserResponseV1` object, + * containing user information linked to the given verification address. + * + * @example + * // Example: Retrieve user information using a verification address + * client.lookupUserByVerification('0x7ea5dada4021c2c625e73d2a78882e91b93c174c').then(response => { + * console.log('User Information:', response); // Outputs the user information associated with the verification address + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/user-by-verification-v1). */ public async lookupUserByVerification( address: string @@ -376,9 +389,31 @@ export class NeynarAPIClient { // ------------ Notifications ------------ /** - * Gets a list of mentions and replies to the user’s casts in reverse chronological order. - * See [Neynar documentation](https://docs.neynar.com/reference/mentions-and-replies-v1) + * Retrieves a list of mentions and replies to the user’s casts in reverse chronological order. * + * @param {number} fid - The FID (unique identifier) of the user whose mentions and replies are being retrieved. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {number} [options.viewerFid] - The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * @param {number} [options.limit] - The maximum number of results to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `MentionsAndRepliesResponse` object, + * containing a list of mentions and replies to the user's casts. + * + * @example + * // Example: Retrieve the first set of mentions and replies for a user with FID 12345, limited to 50 + * client.fetchMentionAndReplyNotifications(3, { + * viewerFid: 2, // The FID of the user viewing this information + * limit: 50, // Fetching up to 50 mentions and replies + * cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Mentions and Replies:', response); // Outputs the mentions and replies + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/mentions-and-replies-v1). */ public async fetchMentionAndReplyNotifications( fid: number, @@ -391,9 +426,31 @@ export class NeynarAPIClient { } /** - * Get a list of likes and recasts to the users’s casts in reverse chronological order. - * See [Neynar documentation](https://docs.neynar.com/reference/reactions-and-recasts-v1) + * Retrieves a list of likes and recasts to the user’s casts in reverse chronological order. + * + * @param {number} fid - The FID (unique identifier) of the user whose likes and recasts are being retrieved. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {number} [options.viewerFid] - The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * @param {number} [options.limit] - The maximum number of results to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `ReactionsAndRecastsResponse` object, + * containing a list of likes and recasts to the user's casts. + * + * @example + * // Example: Retrieve the first set of likes and recasts for a user with FID 12345, limited to 50 + * client.fetchUserLikesAndRecasts(12345, { + * viewerFid: 67890, // The FID of the user viewing this information + * limit: 50, // Fetching up to 50 likes and recasts + * cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Likes and Recasts:', response); // Outputs the likes and recasts + * }); * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/reactions-and-recasts-v1). */ public async fetchUserLikesAndRecasts( fid: number, diff --git a/src/neynar-api/v1/v1-client.ts b/src/neynar-api/v1/v1-client.ts index 55e5062b..00d4a0e9 100644 --- a/src/neynar-api/v1/v1-client.ts +++ b/src/neynar-api/v1/v1-client.ts @@ -449,12 +449,25 @@ export class NeynarV1APIClient { } /** + * Retrieve user information using a verification address + * * Checks if a given Ethereum address has a Farcaster user associated with it. * Note: if an address is associated with multiple users, the API will return * the user who most recently published a verification with the address * (based on when Warpcast received the proof, not a self-reported timestamp). - * See [Neynar documentation](https://docs.neynar.com/reference/user-by-verification-v1) * + * @param {string} address - The Ethereum address that have has a Farcaster user associated with it + * + * @returns {Promise} A promise that resolves to a `UserResponse` object, + * containing user information linked to the given verification address. + * + * @example + * // Example: Retrieve user information using a verification address + * client.lookupUserByVerification('0x7ea5dada4021c2c625e73d2a78882e91b93c174c').then(response => { + * console.log('User Information:', response); // Outputs the user information associated with the verification address + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/user-by-verification-v1). */ public async lookupUserByVerification( address: string @@ -469,9 +482,31 @@ export class NeynarV1APIClient { // ------------ Notifications ------------ /** - * Gets a list of mentions and replies to the user’s casts in reverse chronological order. - * See [Neynar documentation](https://docs.neynar.com/reference/mentions-and-replies-v1) + * Retrieves a list of mentions and replies to the user’s casts in reverse chronological order. * + * @param {number} fid - The FID (unique identifier) of the user whose mentions and replies are being retrieved. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {number} [options.viewerFid] - The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * @param {number} [options.limit] - The maximum number of results to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `MentionsAndRepliesResponse` object, + * containing a list of mentions and replies to the user's casts. + * + * @example + * // Example: Retrieve the first set of mentions and replies for a user with FID 12345, limited to 50 + * client.fetchMentionAndReplyNotifications(3, { + * viewerFid: 2, // The FID of the user viewing this information + * limit: 50, // Fetching up to 50 mentions and replies + * cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Mentions and Replies:', response); // Outputs the mentions and replies + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/mentions-and-replies-v1). */ public async fetchMentionAndReplyNotifications( fid: number, @@ -489,9 +524,31 @@ export class NeynarV1APIClient { } /** - * Get a list of likes and recasts to the users’s casts in reverse chronological order. - * See [Neynar documentation](https://docs.neynar.com/reference/reactions-and-recasts-v1) + * Retrieves a list of likes and recasts to the user’s casts in reverse chronological order. + * + * @param {number} fid - The FID (unique identifier) of the user whose likes and recasts are being retrieved. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {number} [options.viewerFid] - The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * @param {number} [options.limit] - The maximum number of results to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `ReactionsAndRecastsResponse` object, + * containing a list of likes and recasts to the user's casts. + * + * @example + * // Example: Retrieve the first set of likes and recasts for a user with FID 12345, limited to 50 + * client.fetchUserLikesAndRecasts(3, { + * viewerFid: 2, // The FID of the user viewing this information + * limit: 50, // Fetching up to 50 likes and recasts + * cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Likes and Recasts:', response); // Outputs the likes and recasts + * }); * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/reactions-and-recasts-v1). */ public async fetchUserLikesAndRecasts( fid: number, From 92c23735e8ca7ed6fa849cf28275e1b7a591ac37 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Wed, 22 Nov 2023 22:40:59 +0530 Subject: [PATCH 21/77] Make cursor optional in example --- src/neynar-api/neynar-api-client.ts | 12 ++++++------ src/neynar-api/v1/v1-client.ts | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index 88291baa..6d8b3c93 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -106,7 +106,7 @@ export class NeynarAPIClient { * client.fetchRecentUsers({ * viewerFid: 3, * limit: 50, // Fetching up to 50 users - * cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * // cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. * }).then(response => { * console.log('Recent Users:', response); * }); @@ -142,7 +142,7 @@ export class NeynarAPIClient { * client.fetchAllCastsLikedByUser(3, { * viewerFid: 2, * limit: 50, // Fetching up to 50 casts - * cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * // cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. * }).then(response => { * console.log('Liked Casts:', response); * }); @@ -293,7 +293,7 @@ export class NeynarAPIClient { * parentUrl: 'https://ethereum.org', * viewerFid: 2, * limit: 50, // Fetching up to 50 casts - * cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * // cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. * }).then(response => { * console.log('User Casts:', response); * }); @@ -331,7 +331,7 @@ export class NeynarAPIClient { * client.fetchRecentCasts({ * viewerFid: 3, * limit: 50, // Fetching up to 50 casts - * cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * // cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. * }).then(response => { * console.log('Recent Casts:', response); // Outputs the recent casts * }); @@ -408,7 +408,7 @@ export class NeynarAPIClient { * client.fetchMentionAndReplyNotifications(3, { * viewerFid: 2, // The FID of the user viewing this information * limit: 50, // Fetching up to 50 mentions and replies - * cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * // cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. * }).then(response => { * console.log('Mentions and Replies:', response); // Outputs the mentions and replies * }); @@ -445,7 +445,7 @@ export class NeynarAPIClient { * client.fetchUserLikesAndRecasts(12345, { * viewerFid: 67890, // The FID of the user viewing this information * limit: 50, // Fetching up to 50 likes and recasts - * cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * // cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. * }).then(response => { * console.log('Likes and Recasts:', response); // Outputs the likes and recasts * }); diff --git a/src/neynar-api/v1/v1-client.ts b/src/neynar-api/v1/v1-client.ts index 00d4a0e9..98fe5019 100644 --- a/src/neynar-api/v1/v1-client.ts +++ b/src/neynar-api/v1/v1-client.ts @@ -135,7 +135,7 @@ export class NeynarV1APIClient { * client.fetchRecentUsers({ * viewerFid: 3, * limit: 50, // Fetching up to 50 users - * cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * // cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. * }).then(response => { * console.log('Recent Users:', response); * }); @@ -178,7 +178,7 @@ export class NeynarV1APIClient { * client.fetchAllCastsLikedByUser(3, { * viewerFid: 2, * limit: 50, // Fetching up to 50 casts - * cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * // cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. * }).then(response => { * console.log('Liked Casts:', response); * }); @@ -362,7 +362,7 @@ export class NeynarV1APIClient { * parentUrl: 'https://ethereum.org', * viewerFid: 2, * limit: 50, // Fetching up to 50 casts - * cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * // cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. * }).then(response => { * console.log('User Casts:', response); * }); @@ -409,7 +409,7 @@ export class NeynarV1APIClient { * client.fetchRecentCasts({ * viewerFid: 3, * limit: 50, // Fetching up to 50 casts - * cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * // cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. * }).then(response => { * console.log('Recent Casts:', response); // Outputs the recent casts * }); @@ -501,7 +501,7 @@ export class NeynarV1APIClient { * client.fetchMentionAndReplyNotifications(3, { * viewerFid: 2, // The FID of the user viewing this information * limit: 50, // Fetching up to 50 mentions and replies - * cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * // cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. * }).then(response => { * console.log('Mentions and Replies:', response); // Outputs the mentions and replies * }); @@ -543,7 +543,7 @@ export class NeynarV1APIClient { * client.fetchUserLikesAndRecasts(3, { * viewerFid: 2, // The FID of the user viewing this information * limit: 50, // Fetching up to 50 likes and recasts - * cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * // cursor: 'nextPageCursor' // Pagination cursor for the next set of results, Omit this parameter for the initial request. * }).then(response => { * console.log('Likes and Recasts:', response); // Outputs the likes and recasts * }); From 68776940cd6c25e6ad11bbdef163db86a9f7e352 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Wed, 22 Nov 2023 23:10:57 +0530 Subject: [PATCH 22/77] Add JS docstring to v1 Reaction APIs --- src/neynar-api/neynar-api-client.ts | 78 ++++++++++++++++++++++++++--- src/neynar-api/v1/v1-client.ts | 78 ++++++++++++++++++++++++++--- 2 files changed, 144 insertions(+), 12 deletions(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index 6d8b3c93..2cd65260 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -462,9 +462,31 @@ export class NeynarAPIClient { // ------------ Reactions ------------ /** - * Lists a given cast's likes. - * See [Neynar documentation](https://docs.neynar.com/reference/cast-likes-v1) + * Retrieves all like reactions for a specific cast in reverse chronological order. * + * @param {CastV1 | string} castOrCastHash - The Cast object or its hash for which likes are being retrieved. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {number} [options.viewerFid] - The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * @param {number} [options.limit] - The maximum number of results to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `CastLikesResponse` object, + * containing a list of likes for the given cast. + * + * @example + * // Example: Retrieve the first set of likes for a cast with a specific hash, limited to 5 + * client.fetchCastLikes('0xfe90f9de682273e05b201629ad2338bdcd89b6be', { + * viewerFid: 3, // The FID of the user viewing this information + * limit: 5, // Fetching up to 5 likes + * // cursor: "nextPageCursor", // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Cast Likes:', response); // Outputs the cast likes + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/cast-likes-v1). */ public async fetchCastLikes( castOrCastHash: CastV1 | string, @@ -474,9 +496,31 @@ export class NeynarAPIClient { } /** - * Get All Reactions For a Cast. - * See [Neynar documentation](https://docs.neynar.com/reference/cast-reactions-v1) + * Retrieves all reactions (likes and recasts) for a specific cast. * + * @param {CastV1 | string} castOrCastHash - The Cast object or its hash for which reactions are being retrieved. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {number} [options.viewerFid] - The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * @param {number} [options.limit] - The maximum number of results to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `CastReactionsResponse` object, + * containing a list of all reactions for the given cast. + * + * @example + * // Example: Retrieve the first set of reactions for a cast with a specific hash, limited to 5 + * client.fetchCastReactions('0xfe90f9de682273e05b201629ad2338bdcd89b6be', { + * viewerFid: 3, // The FID of the user viewing this information + * limit: 5, // Fetching up to 5 reactions + * // cursor: "nextPageCursor", // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Cast Reactions:', response); // Outputs the cast reactions + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/cast-reactions-v1). */ public async fetchCastReactions( castOrCastHash: CastV1 | string, @@ -486,9 +530,31 @@ export class NeynarAPIClient { } /** - * Get the list of users who have recasted a specific cast. - * See [Neynar documentation](https://docs.neynar.com/reference/cast-recasters-v1) + * Retrieves the list of users who have recasted a specific cast. + * + * @param {Cast | string} castOrCastHash - The Cast object or its hash for which recasters are being retrieved. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {number} [options.viewerFid] - The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * @param {number} [options.limit] - The maximum number of results to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `CastRecasterResponse` object, + * containing a list of recasters for the given cast. + * + * @example + * // Example: Retrieve the first set of recasters for a cast with a specific hash, limited to 5 + * client.fetchRecasters('0xfe90f9de682273e05b201629ad2338bdcd89b6be', { + * viewerFid: 3, // The FID of the user viewing this information + * limit: 5, // Fetching up to 5 recasters + * // cursor: "nextPageCursor", // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Cast Recasters:', response); // Outputs the cast recasters + * }); * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/cast-recasters-v1). */ public async fetchRecasters( castOrCastHash: CastV1 | string, diff --git a/src/neynar-api/v1/v1-client.ts b/src/neynar-api/v1/v1-client.ts index 98fe5019..24baa86f 100644 --- a/src/neynar-api/v1/v1-client.ts +++ b/src/neynar-api/v1/v1-client.ts @@ -568,9 +568,31 @@ export class NeynarV1APIClient { // ------------ Reactions ------------ /** - * Lists a given cast's likes. - * See [Neynar documentation](https://docs.neynar.com/reference/cast-likes-v1) + * Retrieves all like reactions for a specific cast in reverse chronological order. * + * @param {Cast | string} castOrCastHash - The Cast object or its hash for which likes are being retrieved. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {number} [options.viewerFid] - The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * @param {number} [options.limit] - The maximum number of results to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `CastLikesResponse` object, + * containing a list of likes for the given cast. + * + * @example + * // Example: Retrieve the first set of likes for a cast with a specific hash, limited to 5 + * client.fetchCastLikes('0xfe90f9de682273e05b201629ad2338bdcd89b6be', { + * viewerFid: 3, // The FID of the user viewing this information + * limit: 5, // Fetching up to 5 likes + * // cursor: "nextPageCursor", // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Cast Likes:', response); // Outputs the cast likes + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/cast-likes-v1). */ public async fetchCastLikes( castOrCastHash: Cast | string, @@ -595,9 +617,31 @@ export class NeynarV1APIClient { } /** - * Get All Reactions For a Cast. - * See [Neynar documentation](https://docs.neynar.com/reference/cast-reactions-v1) + * Retrieves all reactions (likes and recasts) for a specific cast. * + * @param {Cast | string} castOrCastHash - The Cast object or its hash for which reactions are being retrieved. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {number} [options.viewerFid] - The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * @param {number} [options.limit] - The maximum number of results to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `CastReactionsResponse` object, + * containing a list of all reactions for the given cast. + * + * @example + * // Example: Retrieve the first set of reactions for a cast with a specific hash, limited to 5 + * client.fetchCastReactions('0xfe90f9de682273e05b201629ad2338bdcd89b6be', { + * viewerFid: 3, // The FID of the user viewing this information + * limit: 5, // Fetching up to 5 reactions + * // cursor: "nextPageCursor", // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Cast Reactions:', response); // Outputs the cast reactions + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/cast-reactions-v1). */ public async fetchCastReactions( castOrCastHash: Cast | string, @@ -622,9 +666,31 @@ export class NeynarV1APIClient { } /** - * Get the list of users who have recasted a specific cast. - * See [Neynar documentation](https://docs.neynar.com/reference/cast-recasters-v1) + * Retrieves the list of users who have recasted a specific cast. + * + * @param {Cast | string} castOrCastHash - The Cast object or its hash for which recasters are being retrieved. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {number} [options.viewerFid] - The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * @param {number} [options.limit] - The maximum number of results to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `CastRecasterResponse` object, + * containing a list of recasters for the given cast. + * + * @example + * // Example: Retrieve the first set of recasters for a cast with a specific hash, limited to 5 + * client.fetchRecasters('0xfe90f9de682273e05b201629ad2338bdcd89b6be', { + * viewerFid: 3, // The FID of the user viewing this information + * limit: 5, // Fetching up to 5 recasters + * // cursor: "nextPageCursor", // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Cast Recasters:', response); // Outputs the cast recasters + * }); * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/cast-recasters-v1). */ public async fetchRecasters( castOrCastHash: Cast | string, From ce6c32eb9da7b207c8cb5dcef897001064fe4435 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Wed, 22 Nov 2023 23:20:28 +0530 Subject: [PATCH 23/77] Update examples to incorporate the cursor working --- src/neynar-api/neynar-api-client.ts | 10 +++++----- src/neynar-api/v1/v1-client.ts | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index 2cd65260..e8522ce3 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -477,10 +477,10 @@ export class NeynarAPIClient { * containing a list of likes for the given cast. * * @example - * // Example: Retrieve the first set of likes for a cast with a specific hash, limited to 5 + * // Example: Retrieve the first set of likes for a cast with a specific hash, limited to 2 * client.fetchCastLikes('0xfe90f9de682273e05b201629ad2338bdcd89b6be', { * viewerFid: 3, // The FID of the user viewing this information - * limit: 5, // Fetching up to 5 likes + * limit: 2, // Fetching up to 2 likes * // cursor: "nextPageCursor", // Pagination cursor for the next set of results, Omit this parameter for the initial request. * }).then(response => { * console.log('Cast Likes:', response); // Outputs the cast likes @@ -545,10 +545,10 @@ export class NeynarAPIClient { * containing a list of recasters for the given cast. * * @example - * // Example: Retrieve the first set of recasters for a cast with a specific hash, limited to 5 - * client.fetchRecasters('0xfe90f9de682273e05b201629ad2338bdcd89b6be', { + * // Example: Retrieve the first set of recasters for a cast with a specific hash, limited to 3 + * client.fetchRecasters('0xafadc0478ede366e3f5232af3190a82dea20b169', { * viewerFid: 3, // The FID of the user viewing this information - * limit: 5, // Fetching up to 5 recasters + * limit: 3, // Fetching up to 3 recasters * // cursor: "nextPageCursor", // Pagination cursor for the next set of results, Omit this parameter for the initial request. * }).then(response => { * console.log('Cast Recasters:', response); // Outputs the cast recasters diff --git a/src/neynar-api/v1/v1-client.ts b/src/neynar-api/v1/v1-client.ts index 24baa86f..16653555 100644 --- a/src/neynar-api/v1/v1-client.ts +++ b/src/neynar-api/v1/v1-client.ts @@ -583,10 +583,10 @@ export class NeynarV1APIClient { * containing a list of likes for the given cast. * * @example - * // Example: Retrieve the first set of likes for a cast with a specific hash, limited to 5 + * // Example: Retrieve the first set of likes for a cast with a specific hash, limited to 2 * client.fetchCastLikes('0xfe90f9de682273e05b201629ad2338bdcd89b6be', { * viewerFid: 3, // The FID of the user viewing this information - * limit: 5, // Fetching up to 5 likes + * limit: 2, // Fetching up to 2 likes * // cursor: "nextPageCursor", // Pagination cursor for the next set of results, Omit this parameter for the initial request. * }).then(response => { * console.log('Cast Likes:', response); // Outputs the cast likes @@ -681,10 +681,10 @@ export class NeynarV1APIClient { * containing a list of recasters for the given cast. * * @example - * // Example: Retrieve the first set of recasters for a cast with a specific hash, limited to 5 - * client.fetchRecasters('0xfe90f9de682273e05b201629ad2338bdcd89b6be', { + * // Example: Retrieve the first set of recasters for a cast with a specific hash, limited to 3 + * client.fetchRecasters('0xafadc0478ede366e3f5232af3190a82dea20b169', { * viewerFid: 3, // The FID of the user viewing this information - * limit: 5, // Fetching up to 5 recasters + * limit: 3, // Fetching up to 3 recasters * // cursor: "nextPageCursor", // Pagination cursor for the next set of results, Omit this parameter for the initial request. * }).then(response => { * console.log('Cast Recasters:', response); // Outputs the cast recasters From 4ada8756dfc039f906ee597a102f3ba0c5345217 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Wed, 22 Nov 2023 23:38:44 +0530 Subject: [PATCH 24/77] Add JS docstring to v1 Follow APIs --- src/neynar-api/neynar-api-client.ts | 54 ++++++++++++++++++++++++++--- src/neynar-api/v1/v1-client.ts | 52 ++++++++++++++++++++++++--- 2 files changed, 97 insertions(+), 9 deletions(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index e8522ce3..b23157be 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -532,7 +532,7 @@ export class NeynarAPIClient { /** * Retrieves the list of users who have recasted a specific cast. * - * @param {Cast | string} castOrCastHash - The Cast object or its hash for which recasters are being retrieved. + * @param {CastV1 | string} castOrCastHash - The Cast object or its hash for which recasters are being retrieved. * @param {Object} [options] - Optional parameters to tailor the request. * @param {number} [options.viewerFid] - The FID of the user viewing this information, * used for providing contextual data specific to the viewer. @@ -566,9 +566,31 @@ export class NeynarAPIClient { // ------------ Follows ------------ /** - * Get all users that follow the specified user. - * See [Neynar documentation](https://docs.neynar.com/reference/followers-v1) + * Retrieves all users that follow the specified user. * + * @param {number} fid - The FID (unique identifier) of the user whose followers are being retrieved. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {number} [options.viewerFid] - The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * @param {number} [options.limit] - The maximum number of results to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `FollowResponse` object, + * containing a list of the user's followers. + * + * @example + * // Example: Retrieve the first set of followers for a user with FID 12345, limited to 50 + * client.fetchUserFollowers(3, { + * viewerFid: 2, // The FID of the user viewing this information + * limit: 50, // Fetching up to 50 followers + * // cursor: "nextPageCursor", // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('User Followers:', response); // Outputs the user's followers + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/followers-v1). */ public async fetchUserFollowers( fid: number, @@ -578,9 +600,31 @@ export class NeynarAPIClient { } /** - * Get all users the specified user is following. - * See [Neynar documentation](https://docs.neynar.com/reference/following-v1) + * Retrieves all users the specified user is following. + * + * @param {number} fid - The FID (unique identifier) of the user whose following list is being retrieved. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {number} [options.viewerFid] - The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * @param {number} [options.limit] - The maximum number of results to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `FollowResponse` object, + * containing a list of users followed by the given user. + * + * @example + * // Example: Retrieve the first set of users followed by a user with FID 12345, limited to 50 + * client.fetchUserFollowing(3, { + * viewerFid: 2, // The FID of the user viewing this information + * limit: 50, // Fetching up to 50 users + * // cursor: "nextPageCursor", // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Following Users:', response); // Outputs the list of users followed by the user + * }); * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/following-v1). */ public async fetchUserFollowing( fid: number, diff --git a/src/neynar-api/v1/v1-client.ts b/src/neynar-api/v1/v1-client.ts index 16653555..fc6e96b9 100644 --- a/src/neynar-api/v1/v1-client.ts +++ b/src/neynar-api/v1/v1-client.ts @@ -717,9 +717,31 @@ export class NeynarV1APIClient { // ------------ Follows ------------ /** - * Get all users that follow the specified user. - * See [Neynar documentation](https://docs.neynar.com/reference/followers-v1) + * Retrieves all users that follow the specified user. * + * @param {number} fid - The FID (unique identifier) of the user whose followers are being retrieved. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {number} [options.viewerFid] - The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * @param {number} [options.limit] - The maximum number of results to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `FollowResponse` object, + * containing a list of the user's followers. + * + * @example + * // Example: Retrieve the first set of followers for a user with FID 12345, limited to 50 + * client.fetchUserFollowers(3, { + * viewerFid: 2, // The FID of the user viewing this information + * limit: 50, // Fetching up to 50 followers + * // cursor: "nextPageCursor", // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('User Followers:', response); // Outputs the user's followers + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/followers-v1). */ public async fetchUserFollowers( fid: number, @@ -737,9 +759,31 @@ export class NeynarV1APIClient { } /** - * Get all users the specified user is following. - * See [Neynar documentation](https://docs.neynar.com/reference/following-v1) + * Retrieves all users the specified user is following. + * + * @param {number} fid - The FID (unique identifier) of the user whose following list is being retrieved. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {number} [options.viewerFid] - The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * @param {number} [options.limit] - The maximum number of results to be returned in a single response. + * Defaults to 25, with a maximum allowable value of 150. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. + * + * @returns {Promise} A promise that resolves to a `FollowResponse` object, + * containing a list of users followed by the given user. + * + * @example + * // Example: Retrieve the first set of users followed by a user with FID 12345, limited to 50 + * client.fetchUserFollowing(3, { + * viewerFid: 2, // The FID of the user viewing this information + * limit: 50, // Fetching up to 50 users + * // cursor: "nextPageCursor", // Pagination cursor for the next set of results, Omit this parameter for the initial request. + * }).then(response => { + * console.log('Following Users:', response); // Outputs the list of users followed by the user + * }); * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/following-v1). */ public async fetchUserFollowing( fid: number, From 8a7bd7cd771fd2da02487535aa873b9da386a84b Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Thu, 23 Nov 2023 10:42:34 +0530 Subject: [PATCH 25/77] Add docstring for fetchAllCastsInThread and fetchUserVerifications --- src/neynar-api/neynar-api-client.ts | 40 ++++++++++++++++++++----- src/neynar-api/v1/v1-client.ts | 46 ++++++++++++++++++++++------- 2 files changed, 68 insertions(+), 18 deletions(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index b23157be..edcabd0a 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -36,6 +36,8 @@ import { UserResponse as UserResponseV1, CustodyAddressResponse, CastResponse as CastResponseV1, + VerificationResponse, + AllCastsInThreadResponse, } from "./v1/openapi"; import { FetchRelevantMints200Response } from "./v2/openapi-recommendation"; @@ -257,15 +259,29 @@ export class NeynarAPIClient { } /** - * 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. + * Retrieves all casts, including root cast and all replies for a given thread hash. No limit to the depth of replies. + * **Note :** The parent provided by the caller is included in the response. * + * @param {CastV1 | string} threadParent - The parent cast or the hash of the thread for which + * all related casts are to be fetched. If a Cast object is provided, its hash is used. + * @param {number} [viewerFid] - The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * + * @returns {Promise} A promise that resolves to an `AllCastsInThreadResponse` object, + * containing all casts within the specified thread. + * + * @example + * // Example: Fetch all casts in a thread using a thread hash + * client.fetchAllCastsInThread('0xfe90f9de682273e05b201629ad2338bdcd89b6be', 3).then(response => { + * console.log('Thread Casts:', response); // Outputs all casts in the thread + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/all-casts-in-thread-v1). */ public async fetchAllCastsInThread( threadParent: CastV1 | string, viewerFid?: number - ): Promise { + ): Promise { return await this.clients.v1.fetchAllCastsInThread(threadParent, viewerFid); } @@ -349,13 +365,23 @@ export class NeynarAPIClient { // ------------ Verification ------------ /** - * Gets all known verifications of a user. - * See [Neynar documentation](https://docs.neynar.com/reference/verifications-v1) + * Retrieve all known verifications of a user. + * + * @param {number} fid - The FID (unique identifier) of the user whose verifications are being retrieved. + * + * @returns {Promise} A promise that resolves to a `VerificationResponse` object + * + * @example + * // Example: Retrieve all verifications for a user with FID 3 + * client.fetchUserVerifications(3).then(response => { + * console.log('User Verifications:', response); // Outputs the user's verifications + * }); * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/verifications-v1). */ public async fetchUserVerifications( fid: number - ): Promise { + ): Promise { return await this.clients.v1.fetchUserVerifications(fid); } diff --git a/src/neynar-api/v1/v1-client.ts b/src/neynar-api/v1/v1-client.ts index fc6e96b9..2b63843a 100644 --- a/src/neynar-api/v1/v1-client.ts +++ b/src/neynar-api/v1/v1-client.ts @@ -1,6 +1,5 @@ import { Cast, - User, CastApi, UserApi, VerificationApi, @@ -9,7 +8,6 @@ import { FollowsApi, Configuration, ErrorRes, - VerificationResponseResult, RecentUsersResponse, RecentCastsResponse, UserCastLikeResponse, @@ -23,6 +21,8 @@ import { UserResponse, CustodyAddressResponse, CastResponse, + VerificationResponse, + AllCastsInThreadResponse, } from "./openapi"; import axios, { AxiosError, AxiosInstance } from "axios"; import { silentLogger, Logger } from "../common/logger"; @@ -313,15 +313,29 @@ export class NeynarV1APIClient { } /** - * 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. + * Retrieves all casts, including root cast and all replies for a given thread hash. No limit to the depth of replies. + * **Note :** The parent provided by the caller is included in the response. * + * @param {Cast | string} threadParent - The parent cast or the hash of the thread for which + * all related casts are to be fetched. If a Cast object is provided, its hash is used. + * @param {number} [viewerFid] - The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * + * @returns {Promise} A promise that resolves to an `AllCastsInThreadResponse` object, + * containing all casts within the specified thread. + * + * @example + * // Example: Fetch all casts in a thread using a thread hash + * client.fetchAllCastsInThread('0xfe90f9de682273e05b201629ad2338bdcd89b6be', 3).then(response => { + * console.log('Thread Casts:', response); // Outputs all casts in the thread + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/all-casts-in-thread-v1). */ public async fetchAllCastsInThread( threadParent: Cast | string, viewerFid?: number - ): Promise { + ): Promise { let threadHash: string; if (typeof threadParent === "string") { @@ -335,7 +349,7 @@ export class NeynarV1APIClient { threadHash, viewerFid ); - return response.data.result.casts; + return response.data; } /** @@ -434,18 +448,28 @@ export class NeynarV1APIClient { // ------------ Verification ------------ /** - * Gets all known verifications of a user. - * See [Neynar documentation](https://docs.neynar.com/reference/verifications-v1) + * Retrieve all known verifications of a user. * + * @param {number} fid - The FID (unique identifier) of the user whose verifications are being retrieved. + * + * @returns {Promise} A promise that resolves to a `VerificationResponse` object + * + * @example + * // Example: Retrieve all verifications for a user with FID 3 + * client.fetchUserVerifications(3).then(response => { + * console.log('User Verifications:', response); // Outputs the user's verifications + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/verifications-v1). */ public async fetchUserVerifications( fid: number - ): Promise { + ): Promise { const response = await this.apis.verification.verifications( this.apiKey, fid ); - return response.data.result; + return response.data; } /** From 195b0cd9da009f354822e83fa5c9ecb3bb26922b Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Thu, 23 Nov 2023 11:22:46 +0530 Subject: [PATCH 26/77] Change method names --- src/neynar-api/neynar-api-client.ts | 36 ++++++++++++++--------------- src/neynar-api/v2/v2-client.ts | 18 +++++++-------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index edcabd0a..c3b7c5da 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -707,11 +707,11 @@ export class NeynarAPIClient { * See [Neynar documentation](https://docs.neynar.com/reference/remove-verification) * */ - public async removeVerification( + public async deleteVerification( signerUuid: string, address: string ): Promise { - return await this.clients.v2.removeVerification(signerUuid, address); + return await this.clients.v2.deleteVerification(signerUuid, address); } /** @@ -719,13 +719,13 @@ export class NeynarAPIClient { * See [Neynar documentation](https://docs.neynar.com/reference/add-verification) * */ - public async addVerification( + public async publishVerification( signerUuid: string, address: string, blockHash: string, ethSignature: string ): Promise { - return await this.clients.v2.addVerification( + return await this.clients.v2.publishVerification( signerUuid, address, blockHash, @@ -763,7 +763,7 @@ export class NeynarAPIClient { * See [Neynar documentation](https://docs.neynar.com/reference/update-user) * */ - public async updateUserProfile( + public async updateUser( signerUuid: string, options?: { bio?: string; @@ -773,7 +773,7 @@ export class NeynarAPIClient { display_name?: string; } ): Promise { - return await this.clients.v2.updateUserProfile(signerUuid, options); + return await this.clients.v2.updateUser(signerUuid, options); } /** @@ -781,11 +781,11 @@ export class NeynarAPIClient { * See [Neynar documentation](https://docs.neynar.com/reference/user-bulk) * */ - public async fetchUsersInBulk( + public async fetchBulkUsers( fids: string, viewerFid?: number ): Promise { - return await this.clients.v2.fetchUsersInBulk(fids, viewerFid); + return await this.clients.v2.fetchBulkUsers(fids, viewerFid); } /** @@ -832,8 +832,8 @@ export class NeynarAPIClient { * @param casts - Cast hashes (Comma Separated) * */ - public async fetchBulkCastsByHash(casts: string): Promise { - return await this.clients.v2.fetchBulkCastsByHash(casts); + public async fetchBulkCasts(casts: string): Promise { + return await this.clients.v2.fetchBulkCasts(casts); } /** @@ -868,7 +868,7 @@ export class NeynarAPIClient { * See [Neynar documentation](https://docs.neynar.com/reference/feed) * */ - public async fetchFeedPage( + public async fetchFeed( feedType: FeedType, options?: { filterType?: FilterType; @@ -880,7 +880,7 @@ export class NeynarAPIClient { withRecasts?: boolean; } ): Promise { - return await this.clients.v2.fetchFeedPage(feedType, options); + return await this.clients.v2.fetchFeed(feedType, options); } // ------------ Reaction ------------ @@ -890,12 +890,12 @@ export class NeynarAPIClient { * See [Neynar documentation](https://docs.neynar.com/reference/post-reaction) * */ - public async reactToCast( + public async publishReactionToCast( signerUuid: string, reaction: ReactionType, castOrCastHash: Cast | string ): Promise { - return await this.clients.v2.reactToCast( + return await this.clients.v2.publishReactionToCast( signerUuid, reaction, castOrCastHash @@ -905,12 +905,12 @@ export class NeynarAPIClient { /** * Remove a reaction to a cast. See [Neynar documentation](https://docs.neynar.com/reference/delete-reaction) */ - public async removeReactionFromCast( + public async deleteReactionFromCast( signerUuid: string, reaction: ReactionType, castOrCastHash: Cast | string ): Promise { - return await this.clients.v2.removeReactionFromCast( + return await this.clients.v2.deleteReactionFromCast( signerUuid, reaction, castOrCastHash @@ -938,11 +938,11 @@ export class NeynarAPIClient { * See [Neynar documentation](https://docs.neynar.com/reference/relevant-followers) * */ - public async fetchRelaventFollowers( + public async fetchRelevantFollowers( targetFid: number, viewerFid: number ): Promise { - return await this.clients.v2.fetchRelaventFollowers(targetFid, viewerFid); + return await this.clients.v2.fetchRelevantFollowers(targetFid, viewerFid); } // ------------ Recommendation ------------ diff --git a/src/neynar-api/v2/v2-client.ts b/src/neynar-api/v2/v2-client.ts index fb961345..c3d91502 100644 --- a/src/neynar-api/v2/v2-client.ts +++ b/src/neynar-api/v2/v2-client.ts @@ -183,7 +183,7 @@ export class NeynarV2APIClient { * See [Neynar documentation](https://docs.neynar.com/reference/remove-verification) * */ - public async removeVerification( + public async deleteVerification( signerUuid: string, address: string ): Promise { @@ -205,7 +205,7 @@ export class NeynarV2APIClient { * See [Neynar documentation](https://docs.neynar.com/reference/add-verification) * */ - public async addVerification( + public async publishVerification( signerUuid: string, address: string, blockHash: string, @@ -271,7 +271,7 @@ export class NeynarV2APIClient { * See [Neynar documentation](https://docs.neynar.com/reference/update-user) * */ - public async updateUserProfile( + public async updateUser( signerUuid: string, options?: { bio?: string; @@ -301,7 +301,7 @@ export class NeynarV2APIClient { * See [Neynar documentation](https://docs.neynar.com/reference/user-bulk) * */ - public async fetchUsersInBulk( + public async fetchBulkUsers( fids: string, viewerFid?: number ): Promise { @@ -357,7 +357,7 @@ export class NeynarV2APIClient { * See [Neynar documentation](https://docs.neynar.com/reference/casts) * */ - public async fetchBulkCastsByHash(casts: string): Promise { + public async fetchBulkCasts(casts: string): Promise { const response = await this.apis.cast.casts({ casts, }); @@ -418,7 +418,7 @@ export class NeynarV2APIClient { * See [Neynar documentation](https://docs.neynar.com/reference/feed) * */ - public async fetchFeedPage( + public async fetchFeed( feedType: FeedType, options?: { filterType?: FilterType; @@ -450,7 +450,7 @@ export class NeynarV2APIClient { * See [Neynar documentation](https://docs.neynar.com/reference/post-reaction) * */ - public async reactToCast( + public async publishReactionToCast( signerUuid: string, reaction: ReactionType, castOrCastHash: Cast | string @@ -475,7 +475,7 @@ export class NeynarV2APIClient { /** * Remove a reaction to a cast. See [Neynar documentation](https://docs.neynar.com/reference/delete-reaction) */ - public async removeReactionFromCast( + public async deleteReactionFromCast( signerUuid: string, reaction: ReactionType, castOrCastHash: Cast | string @@ -523,7 +523,7 @@ export class NeynarV2APIClient { * See [Neynar documentation](https://docs.neynar.com/reference/relevant-followers) * */ - public async fetchRelaventFollowers( + public async fetchRelevantFollowers( targetFid: number, viewerFid: number ): Promise { From 53903227aa5711484442d059d022824ff43495bc Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Thu, 23 Nov 2023 11:58:00 +0530 Subject: [PATCH 27/77] Sync up oas --- src/oas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oas b/src/oas index 7fcc943d..63728679 160000 --- a/src/oas +++ b/src/oas @@ -1 +1 @@ -Subproject commit 7fcc943d48b6106eb2b13e62ec6dec6b5527a91e +Subproject commit 6372867983979b899774da4abf0fcd5dfb41fe1d From e2801c0ac8b946c958ef10980b5f72ae381c3ecf Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Thu, 23 Nov 2023 18:04:19 +0530 Subject: [PATCH 28/77] generate relevant --- .../.openapi-generator/FILES | 3 +- .../v2/openapi-recommendation/apis/nftapi.ts | 321 ++++++------------ .../v2/openapi-recommendation/models/index.ts | 3 +- ...mints200-response.ts => relevant-mints.ts} | 8 +- .../models/user-viewer-context.ts | 36 ++ .../v2/openapi-recommendation/models/user.ts | 20 ++ 6 files changed, 175 insertions(+), 216 deletions(-) rename src/neynar-api/v2/openapi-recommendation/models/{fetch-relevant-mints200-response.ts => relevant-mints.ts} (81%) create mode 100644 src/neynar-api/v2/openapi-recommendation/models/user-viewer-context.ts diff --git a/src/neynar-api/v2/openapi-recommendation/.openapi-generator/FILES b/src/neynar-api/v2/openapi-recommendation/.openapi-generator/FILES index d1df1ba7..ba6f4d1c 100644 --- a/src/neynar-api/v2/openapi-recommendation/.openapi-generator/FILES +++ b/src/neynar-api/v2/openapi-recommendation/.openapi-generator/FILES @@ -10,9 +10,10 @@ 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/relevant-mints.ts models/user-profile-bio.ts models/user-profile.ts +models/user-viewer-context.ts models/user.ts diff --git a/src/neynar-api/v2/openapi-recommendation/apis/nftapi.ts b/src/neynar-api/v2/openapi-recommendation/apis/nftapi.ts index 3064f677..f2abf4a1 100644 --- a/src/neynar-api/v2/openapi-recommendation/apis/nftapi.ts +++ b/src/neynar-api/v2/openapi-recommendation/apis/nftapi.ts @@ -5,230 +5,138 @@ * 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"; + +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"; +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"; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; // @ts-ignore -import { ErrorRes } from "../models"; +import { ErrorRes } from '../models'; // @ts-ignore -import { FetchRelevantMints200Response } from "../models"; +import { RelevantMints } 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} address - * @param {string} contractAddress - * @param {string} [tokenId] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - fetchRelevantMints: async ( - address: string, - contractAddress: string, - tokenId?: string, - options: AxiosRequestConfig = {} - ): Promise => { - // 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; - } +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; - const localVarRequestOptions = { - method: "GET", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; + if (address !== undefined) { + localVarQueryParameter['address'] = address; + } - if (address !== undefined) { - localVarQueryParameter["address"] = address; - } + if (contractAddress !== undefined) { + localVarQueryParameter['contract_address'] = contractAddress; + } - if (contractAddress !== undefined) { - localVarQueryParameter["contract_address"] = contractAddress; - } + if (tokenId !== undefined) { + localVarQueryParameter['token_id'] = tokenId; + } - if (tokenId !== undefined) { - 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 = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; + 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} address - * @param {string} contractAddress - * @param {string} [tokenId] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async fetchRelevantMints( - address: string, - contractAddress: string, - tokenId?: string, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.fetchRelevantMints( - address, - contractAddress, - tokenId, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - }; +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 {NFTApiGetRelaventMintsRequest} [requestParameters] Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - fetchRelevantMints( - requestParameters: NFTApiGetRelaventMintsRequest, - options?: any - ): AxiosPromise { - return localVarFp - .fetchRelevantMints( - requestParameters.address, - requestParameters.contractAddress, - requestParameters.tokenId, - options - ) - .then((request) => request(axios, basePath)); - }, - }; +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)); + }, + }; }; -/** - * 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 @@ -236,26 +144,19 @@ export interface NFTApiGetRelaventMintsRequest { * @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 {NFTApiGetRelaventMintsRequest} [requestParameters] Request parameters. - * @param {string} [tokenId] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof NFTApi - */ - public fetchRelevantMints( - requestParameters: NFTApiGetRelaventMintsRequest, - options?: AxiosRequestConfig - ) { - return NFTApiFp(this.configuration) - .fetchRelevantMints( - requestParameters.address, - requestParameters.contractAddress, - requestParameters.tokenId, - options - ) - .then((request) => request(this.axios, this.basePath)); - } + /** + * 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/v2/openapi-recommendation/models/index.ts b/src/neynar-api/v2/openapi-recommendation/models/index.ts index 1f8837f8..967ace58 100644 --- a/src/neynar-api/v2/openapi-recommendation/models/index.ts +++ b/src/neynar-api/v2/openapi-recommendation/models/index.ts @@ -1,7 +1,8 @@ export * from './active-status'; export * from './error-res'; -export * from './fetch-relevant-mints200-response'; export * from './relevant-mint'; +export * from './relevant-mints'; export * from './user'; export * from './user-profile'; export * from './user-profile-bio'; +export * from './user-viewer-context'; diff --git a/src/neynar-api/v2/openapi-recommendation/models/fetch-relevant-mints200-response.ts b/src/neynar-api/v2/openapi-recommendation/models/relevant-mints.ts similarity index 81% rename from src/neynar-api/v2/openapi-recommendation/models/fetch-relevant-mints200-response.ts rename to src/neynar-api/v2/openapi-recommendation/models/relevant-mints.ts index 4e62a421..3d1a30e3 100644 --- a/src/neynar-api/v2/openapi-recommendation/models/fetch-relevant-mints200-response.ts +++ b/src/neynar-api/v2/openapi-recommendation/models/relevant-mints.ts @@ -18,15 +18,15 @@ import { RelevantMint } from './relevant-mint'; /** - * + * A list of mint objects relevant to the user * @export - * @interface FetchRelevantMints200Response + * @interface RelevantMints */ -export interface FetchRelevantMints200Response { +export interface RelevantMints { /** * * @type {Array} - * @memberof FetchRelevantMints200Response + * @memberof RelevantMints */ 'mints': Array; } diff --git a/src/neynar-api/v2/openapi-recommendation/models/user-viewer-context.ts b/src/neynar-api/v2/openapi-recommendation/models/user-viewer-context.ts new file mode 100644 index 00000000..ed974a54 --- /dev/null +++ b/src/neynar-api/v2/openapi-recommendation/models/user-viewer-context.ts @@ -0,0 +1,36 @@ +/* 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 UserViewerContext + */ +export interface UserViewerContext { + /** + * + * @type {number} + * @memberof UserViewerContext + */ + 'following': number; + /** + * + * @type {number} + * @memberof UserViewerContext + */ + 'followed_by': number; +} + diff --git a/src/neynar-api/v2/openapi-recommendation/models/user.ts b/src/neynar-api/v2/openapi-recommendation/models/user.ts index 88a72209..0d83813f 100644 --- a/src/neynar-api/v2/openapi-recommendation/models/user.ts +++ b/src/neynar-api/v2/openapi-recommendation/models/user.ts @@ -19,6 +19,9 @@ import { ActiveStatus } from './active-status'; // May contain unused imports in some cases // @ts-ignore import { UserProfile } from './user-profile'; +// May contain unused imports in some cases +// @ts-ignore +import { UserViewerContext } from './user-viewer-context'; /** * @@ -26,6 +29,12 @@ import { UserProfile } from './user-profile'; * @interface User */ export interface User { + /** + * + * @type {string} + * @memberof User + */ + 'object': UserObjectEnum; /** * User identifier (unsigned integer) * @type {number} @@ -86,7 +95,18 @@ export interface User { * @memberof User */ 'activeStatus': ActiveStatus; + /** + * + * @type {UserViewerContext} + * @memberof User + */ + 'viewer_context'?: UserViewerContext; } +export const UserObjectEnum = { + User: 'user' +} as const; + +export type UserObjectEnum = typeof UserObjectEnum[keyof typeof UserObjectEnum]; From f2681be3b5d5f2bb1d7feb3a52714faa4f6d6b34 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Thu, 23 Nov 2023 18:12:28 +0530 Subject: [PATCH 29/77] Generate code for v2 APIs --- .../.openapi-generator/FILES | 14 +- src/neynar-api/v2/openapi-farcaster/api.ts | 1 + .../v2/openapi-farcaster/apis/cast-api.ts | 900 ++++----- .../v2/openapi-farcaster/apis/feed-api.ts | 476 ++--- .../v2/openapi-farcaster/apis/follows-api.ts | 293 +-- .../apis/notifications-api.ts | 313 ++- .../v2/openapi-farcaster/apis/reaction-api.ts | 565 +++--- .../v2/openapi-farcaster/apis/signer-api.ts | 594 +++--- .../v2/openapi-farcaster/apis/storage-api.ts | 226 +++ .../v2/openapi-farcaster/apis/user-api.ts | 1733 ++++++----------- .../models/cast-param-type.ts | 10 +- .../{notification-follow.ts => follow.ts} | 14 +- .../v2/openapi-farcaster/models/index.ts | 12 +- .../openapi-farcaster/models/notification.ts | 12 +- .../openapi-farcaster/models/reaction-type.ts | 19 +- ...on-reactions-cast.ts => reactions-cast.ts} | 14 +- .../models/reactions-response.ts | 42 + .../models/reactions-type.ts | 32 + ...notification-reactions.ts => reactions.ts} | 22 +- .../models/storage-allocation.ts | 57 + .../models/storage-allocations-response.ts | 39 + .../models/storage-object.ts | 42 + .../models/storage-usage-response.ts | 84 + 23 files changed, 2466 insertions(+), 3048 deletions(-) create mode 100644 src/neynar-api/v2/openapi-farcaster/apis/storage-api.ts rename src/neynar-api/v2/openapi-farcaster/models/{notification-follow.ts => follow.ts} (64%) rename src/neynar-api/v2/openapi-farcaster/models/{notification-reactions-cast.ts => reactions-cast.ts} (58%) create mode 100644 src/neynar-api/v2/openapi-farcaster/models/reactions-response.ts create mode 100644 src/neynar-api/v2/openapi-farcaster/models/reactions-type.ts rename src/neynar-api/v2/openapi-farcaster/models/{notification-reactions.ts => reactions.ts} (56%) create mode 100644 src/neynar-api/v2/openapi-farcaster/models/storage-allocation.ts create mode 100644 src/neynar-api/v2/openapi-farcaster/models/storage-allocations-response.ts create mode 100644 src/neynar-api/v2/openapi-farcaster/models/storage-object.ts create mode 100644 src/neynar-api/v2/openapi-farcaster/models/storage-usage-response.ts diff --git a/src/neynar-api/v2/openapi-farcaster/.openapi-generator/FILES b/src/neynar-api/v2/openapi-farcaster/.openapi-generator/FILES index a9829371..e2b3d41c 100644 --- a/src/neynar-api/v2/openapi-farcaster/.openapi-generator/FILES +++ b/src/neynar-api/v2/openapi-farcaster/.openapi-generator/FILES @@ -1,5 +1,6 @@ .gitignore .npmignore +.openapi-generator-ignore api.ts apis/cast-api.ts apis/feed-api.ts @@ -7,6 +8,7 @@ apis/follows-api.ts apis/notifications-api.ts apis/reaction-api.ts apis/signer-api.ts +apis/storage-api.ts apis/user-api.ts base.ts common.ts @@ -36,14 +38,12 @@ models/error-res.ts models/feed-response.ts models/follow-req-body.ts models/follow-response.ts +models/follow.ts models/get-casts-req-body.ts models/hydrated-follower.ts models/index.ts models/individual-hash-obj.ts models/next-cursor.ts -models/notification-follow.ts -models/notification-reactions-cast.ts -models/notification-reactions.ts models/notification.ts models/notifications-response.ts models/operation-response.ts @@ -57,11 +57,19 @@ models/reaction-like.ts models/reaction-recast.ts models/reaction-req-body.ts models/reaction-type.ts +models/reactions-cast.ts +models/reactions-response.ts +models/reactions-type.ts +models/reactions.ts models/register-signer-key-req-body.ts models/relevant-followers-response.ts models/remove-verification-req-body.ts models/searched-user.ts models/signer.ts +models/storage-allocation.ts +models/storage-allocations-response.ts +models/storage-object.ts +models/storage-usage-response.ts models/update-user-req-body.ts models/user-bulk200-response.ts models/user-dehydrated.ts diff --git a/src/neynar-api/v2/openapi-farcaster/api.ts b/src/neynar-api/v2/openapi-farcaster/api.ts index 95a929b0..08e15808 100644 --- a/src/neynar-api/v2/openapi-farcaster/api.ts +++ b/src/neynar-api/v2/openapi-farcaster/api.ts @@ -20,5 +20,6 @@ export * from './apis/follows-api'; export * from './apis/notifications-api'; export * from './apis/reaction-api'; export * from './apis/signer-api'; +export * from './apis/storage-api'; export * from './apis/user-api'; diff --git a/src/neynar-api/v2/openapi-farcaster/apis/cast-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/cast-api.ts index 567b8924..bdc36445 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/cast-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/cast-api.ts @@ -5,620 +5,400 @@ * 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"; + +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"; +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"; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; // @ts-ignore -import { CastParamType } from "../models"; +import { CastParamType } from '../models'; // @ts-ignore -import { CastResponse } from "../models"; +import { CastResponse } from '../models'; // @ts-ignore -import { CastsResponse } from "../models"; +import { CastsResponse } from '../models'; // @ts-ignore -import { DeleteCastReqBody } from "../models"; +import { DeleteCastReqBody } from '../models'; // @ts-ignore -import { ErrorRes } from "../models"; +import { ErrorRes } from '../models'; // @ts-ignore -import { OperationResponse } from "../models"; +import { OperationResponse } from '../models'; // @ts-ignore -import { PostCastReqBody } from "../models"; +import { PostCastReqBody } from '../models'; // @ts-ignore -import { PostCastResponse } from "../models"; +import { PostCastResponse } from '../models'; /** * CastApi - axios parameter creator * @export */ -export const CastApiAxiosParamCreator = function ( - configuration?: Configuration -) { - return { - /** - * 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. - * @throws {RequiredError} - */ - cast: async ( - type: CastParamType, - identifier: string, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'type' is not null or undefined - assertParamExists("cast", "type", type); - // verify required parameter 'identifier' is not null or undefined - assertParamExists("cast", "identifier", identifier); - const localVarPath = `/farcaster/cast`; - // 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; - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - if (type !== undefined) { - localVarQueryParameter["type"] = type; - } - - if (identifier !== undefined) { - localVarQueryParameter["identifier"] = identifier; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Retrieve multiple casts using their respective hashes. - * @summary Gets information about an array of casts - * @param {string} casts Hashes of the cast to be retrived (Comma separated) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - casts: async ( - casts: string, - options: AxiosRequestConfig = {} - ): Promise => { - // 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); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { - method: "GET", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - if (casts !== undefined) { - localVarQueryParameter["casts"] = casts; - } - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * 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. - * @throws {RequiredError} - */ - deleteCast: async ( - deleteCastReqBody: DeleteCastReqBody, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'deleteCastReqBody' is not null or undefined - assertParamExists("deleteCast", "deleteCastReqBody", deleteCastReqBody); - const localVarPath = `/farcaster/cast`; - // 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: "DELETE", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - localVarHeaderParameter["Content-Type"] = "application/json"; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - localVarRequestOptions.data = serializeDataIfNeeded( - deleteCastReqBody, - localVarRequestOptions, - configuration - ); - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Posts a cast or cast reply. Works with mentions and embeds. (In order to post a cast `signer_uuid` must be approved) - * @summary Posts a cast - * @param {PostCastReqBody} postCastReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - postCast: async ( - postCastReqBody: PostCastReqBody, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'postCastReqBody' is not null or undefined - assertParamExists("postCast", "postCastReqBody", postCastReqBody); - const localVarPath = `/farcaster/cast`; - // 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: "POST", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - localVarHeaderParameter["Content-Type"] = "application/json"; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - localVarRequestOptions.data = serializeDataIfNeeded( - postCastReqBody, - localVarRequestOptions, - configuration - ); - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; +export const CastApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * 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 {string} apiKey API key required for authentication. + * @param {CastParamType} type + * @param {string} identifier Cast identifier (Its either a url or a hash) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + cast: async (apiKey: string, type: CastParamType, identifier: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('cast', 'apiKey', apiKey) + // verify required parameter 'type' is not null or undefined + assertParamExists('cast', 'type', type) + // verify required parameter 'identifier' is not null or undefined + assertParamExists('cast', 'identifier', identifier) + const localVarPath = `/farcaster/cast`; + // 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 (type !== undefined) { + localVarQueryParameter['type'] = type; + } + + if (identifier !== undefined) { + localVarQueryParameter['identifier'] = identifier; + } + + 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, + }; + }, + /** + * Retrieve multiple casts using their respective hashes. + * @summary Gets information about an array of casts + * @param {string} apiKey API key required for authentication. + * @param {string} casts Hashes of the cast to be retrived (Comma separated) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + casts: async (apiKey: string, casts: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('casts', 'apiKey', apiKey) + // 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); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (casts !== undefined) { + localVarQueryParameter['casts'] = casts; + } + + 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, + }; + }, + /** + * Delete an existing cast. \\ (In order to delete a cast `signer_uuid` must be approved) + * @summary Delete a cast + * @param {string} apiKey API key required for authentication. + * @param {DeleteCastReqBody} deleteCastReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteCast: async (apiKey: string, deleteCastReqBody: DeleteCastReqBody, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('deleteCast', 'apiKey', apiKey) + // verify required parameter 'deleteCastReqBody' is not null or undefined + assertParamExists('deleteCast', 'deleteCastReqBody', deleteCastReqBody) + const localVarPath = `/farcaster/cast`; + // 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: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(deleteCastReqBody, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Posts a cast or cast reply. Works with mentions and embeds. (In order to post a cast `signer_uuid` must be approved) + * @summary Posts a cast + * @param {string} apiKey API key required for authentication. + * @param {PostCastReqBody} postCastReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + postCast: async (apiKey: string, postCastReqBody: PostCastReqBody, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('postCast', 'apiKey', apiKey) + // verify required parameter 'postCastReqBody' is not null or undefined + assertParamExists('postCast', 'postCastReqBody', postCastReqBody) + const localVarPath = `/farcaster/cast`; + // 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: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(postCastReqBody, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } }; /** * CastApi - functional programming interface * @export */ -export const CastApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = CastApiAxiosParamCreator(configuration); - return { - /** - * 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. - * @throws {RequiredError} - */ - async cast( - type: CastParamType, - identifier: string, - options?: AxiosRequestConfig - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.cast( - type, - identifier, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Retrieve multiple casts using their respective hashes. - * @summary Gets information about an array of casts - * @param {string} casts Hashes of the cast to be retrived (Comma separated) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async casts( - casts: string, - options?: AxiosRequestConfig - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.casts( - casts, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * 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. - * @throws {RequiredError} - */ - async deleteCast( - deleteCastReqBody: DeleteCastReqBody, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteCast( - deleteCastReqBody, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Posts a cast or cast reply. Works with mentions and embeds. (In order to post a cast `signer_uuid` must be approved) - * @summary Posts a cast - * @param {PostCastReqBody} postCastReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async postCast( - postCastReqBody: PostCastReqBody, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.postCast( - postCastReqBody, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - }; +export const CastApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = CastApiAxiosParamCreator(configuration) + return { + /** + * 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 {string} apiKey API key required for authentication. + * @param {CastParamType} type + * @param {string} identifier Cast identifier (Its either a url or a hash) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async cast(apiKey: string, type: CastParamType, identifier: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.cast(apiKey, type, identifier, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Retrieve multiple casts using their respective hashes. + * @summary Gets information about an array of casts + * @param {string} apiKey API key required for authentication. + * @param {string} casts Hashes of the cast to be retrived (Comma separated) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async casts(apiKey: string, casts: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.casts(apiKey, casts, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Delete an existing cast. \\ (In order to delete a cast `signer_uuid` must be approved) + * @summary Delete a cast + * @param {string} apiKey API key required for authentication. + * @param {DeleteCastReqBody} deleteCastReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteCast(apiKey: string, deleteCastReqBody: DeleteCastReqBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteCast(apiKey, deleteCastReqBody, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Posts a cast or cast reply. Works with mentions and embeds. (In order to post a cast `signer_uuid` must be approved) + * @summary Posts a cast + * @param {string} apiKey API key required for authentication. + * @param {PostCastReqBody} postCastReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async postCast(apiKey: string, postCastReqBody: PostCastReqBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.postCast(apiKey, postCastReqBody, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } }; /** * CastApi - factory interface * @export */ -export const CastApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance -) { - const localVarFp = CastApiFp(configuration); - return { +export const CastApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = CastApiFp(configuration) + return { + /** + * 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 {string} apiKey API key required for authentication. + * @param {CastParamType} type + * @param {string} identifier Cast identifier (Its either a url or a hash) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + cast(apiKey: string, type: CastParamType, identifier: string, options?: any): AxiosPromise { + return localVarFp.cast(apiKey, type, identifier, options).then((request) => request(axios, basePath)); + }, + /** + * Retrieve multiple casts using their respective hashes. + * @summary Gets information about an array of casts + * @param {string} apiKey API key required for authentication. + * @param {string} casts Hashes of the cast to be retrived (Comma separated) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + casts(apiKey: string, casts: string, options?: any): AxiosPromise { + return localVarFp.casts(apiKey, casts, options).then((request) => request(axios, basePath)); + }, + /** + * Delete an existing cast. \\ (In order to delete a cast `signer_uuid` must be approved) + * @summary Delete a cast + * @param {string} apiKey API key required for authentication. + * @param {DeleteCastReqBody} deleteCastReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteCast(apiKey: string, deleteCastReqBody: DeleteCastReqBody, options?: any): AxiosPromise { + return localVarFp.deleteCast(apiKey, deleteCastReqBody, options).then((request) => request(axios, basePath)); + }, + /** + * Posts a cast or cast reply. Works with mentions and embeds. (In order to post a cast `signer_uuid` must be approved) + * @summary Posts a cast + * @param {string} apiKey API key required for authentication. + * @param {PostCastReqBody} postCastReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + postCast(apiKey: string, postCastReqBody: PostCastReqBody, options?: any): AxiosPromise { + return localVarFp.postCast(apiKey, postCastReqBody, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * CastApi - object-oriented interface + * @export + * @class CastApi + * @extends {BaseAPI} + */ +export class CastApi extends BaseAPI { /** * 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 {string} apiKey API key required for authentication. + * @param {CastParamType} type + * @param {string} identifier Cast identifier (Its either a url or a hash) * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof CastApi */ - cast( - requestParameters: CastApiCastRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .cast(requestParameters.type, requestParameters.identifier, options) - .then((request) => request(axios, basePath)); - }, + public cast(apiKey: string, type: CastParamType, identifier: string, options?: AxiosRequestConfig) { + return CastApiFp(this.configuration).cast(apiKey, type, identifier, options).then((request) => request(this.axios, this.basePath)); + } + /** * Retrieve multiple casts using their respective hashes. * @summary Gets information about an array of casts - * @param {CastApiCastsRequest} requestParameters Request parameters. + * @param {string} apiKey API key required for authentication. + * @param {string} casts Hashes of the cast to be retrived (Comma separated) * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof CastApi */ - casts( - requestParameters: CastApiCastsRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .casts(requestParameters.casts, options) - .then((request) => request(axios, basePath)); - }, + public casts(apiKey: string, casts: string, options?: AxiosRequestConfig) { + return CastApiFp(this.configuration).casts(apiKey, 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 {string} apiKey API key required for authentication. + * @param {DeleteCastReqBody} deleteCastReqBody * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof CastApi */ - deleteCast( - requestParameters: CastApiDeleteCastRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .deleteCast(requestParameters.deleteCastReqBody, options) - .then((request) => request(axios, basePath)); - }, + public deleteCast(apiKey: string, deleteCastReqBody: DeleteCastReqBody, options?: AxiosRequestConfig) { + return CastApiFp(this.configuration).deleteCast(apiKey, deleteCastReqBody, options).then((request) => request(this.axios, this.basePath)); + } + /** - * Posts a cast or cast reply. Works with mentions and embeds. (In order to post a cast `signer_uuid` must be approved) + * Posts a cast or cast reply. Works with mentions and embeds. (In order to post a cast `signer_uuid` must be approved) * @summary Posts a cast - * @param {CastApiPostCastRequest} requestParameters Request parameters. + * @param {string} apiKey API key required for authentication. + * @param {PostCastReqBody} postCastReqBody * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof CastApi */ - postCast( - requestParameters: CastApiPostCastRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .postCast(requestParameters.postCastReqBody, options) - .then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * Request parameters for cast operation in CastApi. - * @export - * @interface CastApiCastRequest - */ -export interface CastApiCastRequest { - /** - * - * @type {CastParamType} - * @memberof CastApiCast - */ - readonly type: CastParamType; - - /** - * Cast identifier (Its either a url or a hash) - * @type {string} - * @memberof CastApiCast - */ - readonly identifier: string; + public postCast(apiKey: string, postCastReqBody: PostCastReqBody, options?: AxiosRequestConfig) { + return CastApiFp(this.configuration).postCast(apiKey, postCastReqBody, options).then((request) => request(this.axios, this.basePath)); + } } -/** - * Request parameters for casts operation in CastApi. - * @export - * @interface CastApiCastsRequest - */ -export interface CastApiCastsRequest { - - /** - * Hashes of the cast to be retrived (Comma separated) - * @type {string} - * @memberof CastApiCasts - */ - readonly casts: string; -} - -/** - * Request parameters for deleteCast operation in CastApi. - * @export - * @interface CastApiDeleteCastRequest - */ -export interface CastApiDeleteCastRequest { - /** - * - * @type {DeleteCastReqBody} - * @memberof CastApiDeleteCast - */ - readonly deleteCastReqBody: DeleteCastReqBody; -} - -/** - * Request parameters for postCast operation in CastApi. - * @export - * @interface CastApiPostCastRequest - */ -export interface CastApiPostCastRequest { - /** - * - * @type {PostCastReqBody} - * @memberof CastApiPostCast - */ - readonly postCastReqBody: PostCastReqBody; -} - -/** - * CastApi - object-oriented interface - * @export - * @class CastApi - * @extends {BaseAPI} - */ -export class CastApi extends BaseAPI { - /** - * 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} - * @memberof CastApi - */ - public cast( - requestParameters: CastApiCastRequest, - options?: AxiosRequestConfig - ) { - return CastApiFp(this.configuration) - .cast(requestParameters.type, requestParameters.identifier, options) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Retrieve multiple casts using their respective hashes. - * @summary Gets information about an array of casts - * @param {CastApiCastsRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof CastApi - */ - public casts( - requestParameters: CastApiCastsRequest, - options?: AxiosRequestConfig - ) { - return CastApiFp(this.configuration) - .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) - * @summary Delete a cast - * @param {CastApiDeleteCastRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof CastApi - */ - public deleteCast( - requestParameters: CastApiDeleteCastRequest, - options?: AxiosRequestConfig - ) { - return CastApiFp(this.configuration) - .deleteCast(requestParameters.deleteCastReqBody, options) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Posts a cast or cast reply. Works with mentions and embeds. (In order to post a cast `signer_uuid` must be approved) - * @summary Posts a cast - * @param {CastApiPostCastRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof CastApi - */ - public postCast( - requestParameters: CastApiPostCastRequest, - options?: AxiosRequestConfig - ) { - return CastApiFp(this.configuration) - .postCast(requestParameters.postCastReqBody, options) - .then((request) => request(this.axios, this.basePath)); - } -} diff --git a/src/neynar-api/v2/openapi-farcaster/apis/feed-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/feed-api.ts index 69baf743..cf238c34 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/feed-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/feed-api.ts @@ -5,347 +5,213 @@ * 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"; + +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"; +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"; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; // @ts-ignore -import { ErrorRes } from "../models"; +import { ErrorRes } from '../models'; // @ts-ignore -import { FeedResponse } from "../models"; +import { FeedResponse } from '../models'; /** * FeedApi - axios parameter creator * @export */ -export const FeedApiAxiosParamCreator = function ( - configuration?: Configuration -) { - return { - /** - * - * @summary Retrieve casts based on filters - * @param {FeedType} feedType Defaults to following (requires fid or address). If set to filter (requires filter_type) - * @param {FilterType} [filterType] Used when feed_type=filter. Can be set to fids (requires fids) or parent_url (requires parent_url) - * @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=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 100) - * @param {boolean} [withRecasts] Include recasts in the response, true by default - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - feed: async ( - feedType: FeedType, - filterType?: FilterType, - fid?: number, - fids?: string, - parentUrl?: string, - cursor?: string, - limit?: number, - withRecasts?: boolean, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'feedType' is not null or undefined - assertParamExists("feed", "feedType", feedType); - const localVarPath = `/farcaster/feed`; - // 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; - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - if (feedType !== undefined) { - localVarQueryParameter["feed_type"] = feedType; - } - - if (filterType !== undefined) { - localVarQueryParameter["filter_type"] = filterType; - } - - if (fid !== undefined) { - localVarQueryParameter["fid"] = fid; - } - - if (fids !== undefined) { - localVarQueryParameter["fids"] = fids; - } - - if (parentUrl !== undefined) { - localVarQueryParameter["parent_url"] = parentUrl; - } - - if (cursor !== undefined) { - localVarQueryParameter["cursor"] = cursor; - } - - if (limit !== undefined) { - localVarQueryParameter["limit"] = limit; - } - - if (withRecasts !== undefined) { - localVarQueryParameter["with_recasts"] = withRecasts; - } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; +export const FeedApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary Retrieve casts based on filters + * @param {string} apiKey API key required for authentication. + * @param {FeedFeedTypeEnum} feedType Defaults to following (requires fid or address). If set to filter (requires filter_type) + * @param {FeedFilterTypeEnum} [filterType] Used when feed_type=filter. Can be set to fids (requires fids) or parent_url (requires parent_url) + * @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=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 {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: FeedFeedTypeEnum, filterType?: FeedFilterTypeEnum, fid?: number, fids?: string, parentUrl?: string, withRecasts?: boolean, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('feed', 'apiKey', apiKey) + // verify required parameter 'feedType' is not null or undefined + assertParamExists('feed', 'feedType', feedType) + const localVarPath = `/farcaster/feed`; + // 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 (feedType !== undefined) { + localVarQueryParameter['feed_type'] = feedType; + } + + if (filterType !== undefined) { + localVarQueryParameter['filter_type'] = filterType; + } + + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } + + if (fids !== undefined) { + localVarQueryParameter['fids'] = fids; + } + + if (parentUrl !== undefined) { + localVarQueryParameter['parent_url'] = parentUrl; + } + + if (withRecasts !== undefined) { + localVarQueryParameter['with_recasts'] = withRecasts; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + 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, + }; + }, + } }; /** * FeedApi - functional programming interface * @export */ -export const FeedApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = FeedApiAxiosParamCreator(configuration); - return { - /** - * - * @summary Retrieve casts based on filters - * @param {FeedType} feedType Defaults to following (requires fid or address). If set to filter (requires filter_type) - * @param {FilterType} [filterType] Used when feed_type=filter. Can be set to fids (requires fids) or parent_url (requires parent_url) - * @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=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 100) - * @param {boolean} [withRecasts] Include recasts in the response, true by default - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async feed( - feedType: FeedType, - filterType?: FilterType, - fid?: number, - fids?: string, - parentUrl?: string, - cursor?: string, - limit?: number, - withRecasts?: boolean, - options?: AxiosRequestConfig - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.feed( - feedType, - filterType, - fid, - fids, - parentUrl, - cursor, - limit, - withRecasts, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - }; +export const FeedApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = FeedApiAxiosParamCreator(configuration) + return { + /** + * + * @summary Retrieve casts based on filters + * @param {string} apiKey API key required for authentication. + * @param {FeedFeedTypeEnum} feedType Defaults to following (requires fid or address). If set to filter (requires filter_type) + * @param {FeedFilterTypeEnum} [filterType] Used when feed_type=filter. Can be set to fids (requires fids) or parent_url (requires parent_url) + * @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=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 {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: FeedFeedTypeEnum, filterType?: FeedFilterTypeEnum, fid?: number, fids?: string, parentUrl?: string, withRecasts?: boolean, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.feed(apiKey, feedType, filterType, fid, fids, parentUrl, withRecasts, limit, cursor, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } }; /** * FeedApi - factory interface * @export */ -export const FeedApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance -) { - const localVarFp = FeedApiFp(configuration); - return { +export const FeedApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = FeedApiFp(configuration) + return { + /** + * + * @summary Retrieve casts based on filters + * @param {string} apiKey API key required for authentication. + * @param {FeedFeedTypeEnum} feedType Defaults to following (requires fid or address). If set to filter (requires filter_type) + * @param {FeedFilterTypeEnum} [filterType] Used when feed_type=filter. Can be set to fids (requires fids) or parent_url (requires parent_url) + * @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=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 {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: FeedFeedTypeEnum, filterType?: FeedFilterTypeEnum, fid?: number, fids?: string, parentUrl?: string, withRecasts?: boolean, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.feed(apiKey, feedType, filterType, fid, fids, parentUrl, withRecasts, limit, cursor, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * FeedApi - object-oriented interface + * @export + * @class FeedApi + * @extends {BaseAPI} + */ +export class FeedApi extends BaseAPI { /** - * + * * @summary Retrieve casts based on filters - * @param {FeedApiFeedRequest} requestParameters Request parameters. + * @param {string} apiKey API key required for authentication. + * @param {FeedFeedTypeEnum} feedType Defaults to following (requires fid or address). If set to filter (requires filter_type) + * @param {FeedFilterTypeEnum} [filterType] Used when feed_type=filter. Can be set to fids (requires fids) or parent_url (requires parent_url) + * @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=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 {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 */ - feed( - requestParameters: FeedApiFeedRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .feed( - requestParameters.feedType, - requestParameters.filterType, - requestParameters.fid, - requestParameters.fids, - requestParameters.parentUrl, - requestParameters.cursor, - requestParameters.limit, - requestParameters.withRecasts, - options - ) - .then((request) => request(axios, basePath)); - }, - }; -}; + public feed(apiKey: string, feedType: FeedFeedTypeEnum, filterType?: FeedFilterTypeEnum, 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)); + } +} /** - * Request parameters for feed operation in FeedApi. * @export - * @interface FeedApiFeedRequest */ -export interface FeedApiFeedRequest { - /** - * Defaults to following (requires fid or address). If set to filter (requires filter_type) - * @type {'filter' | 'following'} - * @memberof FeedApiFeed - */ - readonly feedType: FeedType; - - /** - * Used when feed_type=filter. Can be set to fids (requires fids) or parent_url (requires parent_url) - * @type {'fids' | 'parent_url' | 'global_trending'} - * @memberof FeedApiFeed - */ - readonly filterType?: FilterType; - - /** - * fid of a user - * @type {number} - * @memberof FeedApiFeed - */ - readonly fid?: number; - - /** - * 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. - * @type {string} - * @memberof FeedApiFeed - */ - readonly fids?: string; - - /** - * 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 - * @type {string} - * @memberof FeedApiFeed - */ - readonly parentUrl?: string; - - /** - * Pagination cursor. - * @type {string} - * @memberof FeedApiFeed - */ - readonly cursor?: string; - - /** - * 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; -} - +export const FeedFeedTypeEnum = { + Following: 'following', + Filter: 'filter' +} as const; +export type FeedFeedTypeEnum = typeof FeedFeedTypeEnum[keyof typeof FeedFeedTypeEnum]; /** - * FeedApi - object-oriented interface * @export - * @class FeedApi - * @extends {BaseAPI} */ -export class FeedApi extends BaseAPI { - /** - * - * @summary Retrieve casts based on filters - * @param {FeedApiFeedRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof FeedApi - */ - public feed( - requestParameters: FeedApiFeedRequest, - options?: AxiosRequestConfig - ) { - return FeedApiFp(this.configuration) - .feed( - requestParameters.feedType, - requestParameters.filterType, - requestParameters.fid, - requestParameters.fids, - requestParameters.parentUrl, - requestParameters.cursor, - requestParameters.limit, - requestParameters.withRecasts, - options - ) - .then((request) => request(this.axios, this.basePath)); - } -} - -export enum FeedType { - Following = "following", - Filter = "filter", -} - -export enum FilterType { - Fids = "fids", - ParentUrl = "parent_url", - GlobalTrending = "global_trending", -} +export const FeedFilterTypeEnum = { + Fids: 'fids', + ParentUrl: 'parent_url', + GlobalTrending: 'global_trending' +} as const; +export type FeedFilterTypeEnum = typeof FeedFilterTypeEnum[keyof typeof FeedFilterTypeEnum]; diff --git a/src/neynar-api/v2/openapi-farcaster/apis/follows-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/follows-api.ts index 28a474d3..65d21f3a 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/follows-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/follows-api.ts @@ -5,210 +5,131 @@ * 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"; + +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"; +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"; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; // @ts-ignore -import { ErrorRes } from "../models"; +import { ErrorRes } from '../models'; // @ts-ignore -import { RelevantFollowersResponse } from "../models"; +import { RelevantFollowersResponse } from '../models'; /** * FollowsApi - axios parameter creator * @export */ -export const FollowsApiAxiosParamCreator = function ( - configuration?: Configuration -) { - return { - /** - * Returns a list of relevant followers for a specific FID. - * @summary Retrieve relevant followers for a given user - * @param {number} targetFid User who's profile you are looking at - * @param {number} viewerFid Viewer who's looking at the profile - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - relevantFollowers: async ( - targetFid: number, - viewerFid: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'targetFid' is not null or undefined - assertParamExists("relevantFollowers", "targetFid", targetFid); - // verify required parameter 'viewerFid' is not null or undefined - assertParamExists("relevantFollowers", "viewerFid", viewerFid); - const localVarPath = `/farcaster/followers/relevant`; - // 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; - } +export const FollowsApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Returns a list of relevant followers for a specific FID. + * @summary Retrieve relevant followers for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} targetFid User who\'s profile you are looking at + * @param {number} viewerFid Viewer who\'s looking at the profile + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + relevantFollowers: async (apiKey: string, targetFid: number, viewerFid: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('relevantFollowers', 'apiKey', apiKey) + // verify required parameter 'targetFid' is not null or undefined + assertParamExists('relevantFollowers', 'targetFid', targetFid) + // verify required parameter 'viewerFid' is not null or undefined + assertParamExists('relevantFollowers', 'viewerFid', viewerFid) + const localVarPath = `/farcaster/followers/relevant`; + // 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; - const localVarRequestOptions = { - method: "GET", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; + if (targetFid !== undefined) { + localVarQueryParameter['target_fid'] = targetFid; + } - if (targetFid !== undefined) { - localVarQueryParameter["target_fid"] = targetFid; - } + if (viewerFid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewerFid; + } - if (viewerFid !== undefined) { - localVarQueryParameter["viewer_fid"] = viewerFid; - } + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } }; /** * FollowsApi - functional programming interface * @export */ -export const FollowsApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = FollowsApiAxiosParamCreator(configuration); - return { - /** - * Returns a list of relevant followers for a specific FID. - * @summary Retrieve relevant followers for a given user - * @param {number} targetFid User who's profile you are looking at - * @param {number} viewerFid Viewer who's looking at the profile - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async relevantFollowers( - targetFid: number, - viewerFid: number, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.relevantFollowers( - targetFid, - viewerFid, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - }; +export const FollowsApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = FollowsApiAxiosParamCreator(configuration) + return { + /** + * Returns a list of relevant followers for a specific FID. + * @summary Retrieve relevant followers for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} targetFid User who\'s profile you are looking at + * @param {number} viewerFid Viewer who\'s looking at the profile + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async relevantFollowers(apiKey: string, targetFid: number, viewerFid: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.relevantFollowers(apiKey, targetFid, viewerFid, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } }; /** * FollowsApi - factory interface * @export */ -export const FollowsApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance -) { - const localVarFp = FollowsApiFp(configuration); - return { - /** - * Returns a list of relevant followers for a specific FID. - * @summary Retrieve relevant followers for a given user - * @param {FollowsApiRelaventFollowersRequest} requestParameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - relevantFollowers( - requestParameters: FollowsApiRelaventFollowersRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .relevantFollowers( - requestParameters.targetFid, - requestParameters.viewerFid, - options - ) - .then((request) => request(axios, basePath)); - }, - }; +export const FollowsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = FollowsApiFp(configuration) + return { + /** + * Returns a list of relevant followers for a specific FID. + * @summary Retrieve relevant followers for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} targetFid User who\'s profile you are looking at + * @param {number} viewerFid Viewer who\'s looking at the profile + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + relevantFollowers(apiKey: string, targetFid: number, viewerFid: number, options?: any): AxiosPromise { + return localVarFp.relevantFollowers(apiKey, targetFid, viewerFid, options).then((request) => request(axios, basePath)); + }, + }; }; -/** - * Request parameters for relavant followers operation in FollowsApi. - * @export - * @interface FollowsApiRelaventFollowersRequest - */ -export interface FollowsApiRelaventFollowersRequest { - /** - * User who's profile you are looking at - * @type {number} - * @memberof FollowsApiRelaventFollowers - */ - readonly targetFid: number; - - /** - * Viewer who's looking at the profile - * @type {number} - * @memberof FollowsApiRelaventFollowers - */ - readonly viewerFid: number; -} - /** * FollowsApi - object-oriented interface * @export @@ -216,24 +137,18 @@ export interface FollowsApiRelaventFollowersRequest { * @extends {BaseAPI} */ export class FollowsApi extends BaseAPI { - /** - * Returns a list of relevant followers for a specific FID. - * @summary Retrieve relevant followers for a given user - * @param {FollowsApiRelaventFollowersRequest} requestParameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof FollowsApi - */ - public relevantFollowers( - requestParameters: FollowsApiRelaventFollowersRequest, - options?: AxiosRequestConfig - ) { - return FollowsApiFp(this.configuration) - .relevantFollowers( - requestParameters.targetFid, - requestParameters.viewerFid, - options - ) - .then((request) => request(this.axios, this.basePath)); - } + /** + * Returns a list of relevant followers for a specific FID. + * @summary Retrieve relevant followers for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} targetFid User who\'s profile you are looking at + * @param {number} viewerFid Viewer who\'s looking at the profile + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FollowsApi + */ + public relevantFollowers(apiKey: string, targetFid: number, viewerFid: number, options?: AxiosRequestConfig) { + return FollowsApiFp(this.configuration).relevantFollowers(apiKey, targetFid, viewerFid, options).then((request) => request(this.axios, this.basePath)); + } } + diff --git a/src/neynar-api/v2/openapi-farcaster/apis/notifications-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/notifications-api.ts index d3841cb5..0edeb864 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/notifications-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/notifications-api.ts @@ -5,225 +5,136 @@ * 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"; + +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"; +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"; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; // @ts-ignore -import { ErrorRes } from "../models"; +import { ErrorRes } from '../models'; // @ts-ignore -import { NotificationsResponse } from "../models"; +import { NotificationsResponse } from '../models'; /** * NotificationsApi - axios parameter creator * @export */ -export const NotificationsApiAxiosParamCreator = function ( - configuration?: Configuration -) { - return { - /** - * Returns a list of notifications for a specific FID. - * @summary Retrieve notifications for a given user - * @param {number} fid - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 50) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - notifications: async ( - fid: number, - cursor?: string, - limit?: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'fid' is not null or undefined - assertParamExists("notifications", "fid", fid); - const localVarPath = `/farcaster/notifications`; - // 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; - } +export const NotificationsApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Returns a list of notifications for a specific FID. + * @summary Retrieve notifications for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {number} [limit] Number of results to retrieve (default 25, max 50) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + notifications: async (apiKey: string, fid: number, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('notifications', 'apiKey', apiKey) + // verify required parameter 'fid' is not null or undefined + assertParamExists('notifications', 'fid', fid) + const localVarPath = `/farcaster/notifications`; + // 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; - const localVarRequestOptions = { - method: "GET", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } - if (fid !== undefined) { - localVarQueryParameter["fid"] = fid; - } + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } - if (cursor !== undefined) { - localVarQueryParameter["cursor"] = cursor; - } + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } - if (limit !== undefined) { - localVarQueryParameter["limit"] = limit; - } + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } }; /** * NotificationsApi - functional programming interface * @export */ -export const NotificationsApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = - NotificationsApiAxiosParamCreator(configuration); - return { - /** - * Returns a list of notifications for a specific FID. - * @summary Retrieve notifications for a given user - * @param {number} fid - * @param {string} [cursor] Pagination cursor. - * @param {number} [limit] Number of results to retrieve (default 25, max 50) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async notifications( - fid: number, - cursor?: string, - limit?: number, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.notifications( - fid, - cursor, - limit, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - }; +export const NotificationsApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = NotificationsApiAxiosParamCreator(configuration) + return { + /** + * Returns a list of notifications for a specific FID. + * @summary Retrieve notifications for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {number} [limit] Number of results to retrieve (default 25, max 50) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async notifications(apiKey: string, fid: number, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.notifications(apiKey, fid, limit, cursor, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } }; /** * NotificationsApi - factory interface * @export */ -export const NotificationsApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance -) { - const localVarFp = NotificationsApiFp(configuration); - return { - /** - * Returns a list of notifications for a specific FID. - * @summary Retrieve notifications for a given user - * @param {NotificationsApiNotificationRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - notifications( - requestParameters: NotificationsApiNotificationRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .notifications( - requestParameters.fid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(axios, basePath)); - }, - }; +export const NotificationsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = NotificationsApiFp(configuration) + return { + /** + * Returns a list of notifications for a specific FID. + * @summary Retrieve notifications for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {number} [limit] Number of results to retrieve (default 25, max 50) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + notifications(apiKey: string, fid: number, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.notifications(apiKey, fid, limit, cursor, options).then((request) => request(axios, basePath)); + }, + }; }; -/** - * Request parameters for fetch notifications operation in NotificationsApi. - * @export - * @interface NotificationsApiNotificationRequest - */ -export interface NotificationsApiNotificationRequest { - /** - * fid of a user - * @type {number} - * @memberof NotificationsApiNotification - */ - readonly fid: number; - - /** - * Pagination cursor. - * @type {string} - * @memberof NotificationsApiNotification - */ - readonly cursor?: string; - - /** - * Number of results to retrieve (default 25, max 150) - * @type {number} - * @memberof NotificationsApiNotification - */ - readonly limit?: number; -} - /** * NotificationsApi - object-oriented interface * @export @@ -231,25 +142,19 @@ export interface NotificationsApiNotificationRequest { * @extends {BaseAPI} */ export class NotificationsApi extends BaseAPI { - /** - * Returns a list of notifications for a specific FID. - * @summary Retrieve notifications for a given user - * @param {NotificationsApiNotificationRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof NotificationsApi - */ - public notifications( - requestParameters: NotificationsApiNotificationRequest, - options?: AxiosRequestConfig - ) { - return NotificationsApiFp(this.configuration) - .notifications( - requestParameters.fid, - requestParameters.cursor, - requestParameters.limit, - options - ) - .then((request) => request(this.axios, this.basePath)); - } + /** + * Returns a list of notifications for a specific FID. + * @summary Retrieve notifications for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {number} [limit] Number of results to retrieve (default 25, max 50) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationsApi + */ + public notifications(apiKey: string, fid: number, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + return NotificationsApiFp(this.configuration).notifications(apiKey, fid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); + } } + diff --git a/src/neynar-api/v2/openapi-farcaster/apis/reaction-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/reaction-api.ts index 5f078d5b..c5e5e0bf 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/reaction-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/reaction-api.ts @@ -5,343 +5,330 @@ * 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"; + +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"; +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 { - BASE_PATH, - COLLECTION_FORMATS, - RequestArgs, - BaseAPI, - RequiredError, -} from "../base"; +import { ErrorRes } from '../models'; // @ts-ignore -import { ErrorRes } from "../models"; +import { OperationResponse } from '../models'; // @ts-ignore -import { OperationResponse } from "../models"; +import { ReactionReqBody } from '../models'; // @ts-ignore -import { ReactionReqBody } from "../models"; +import { ReactionsResponse } from '../models'; +// @ts-ignore +import { ReactionsType } from '../models'; /** * ReactionApi - axios parameter creator * @export */ -export const ReactionApiAxiosParamCreator = function ( - configuration?: Configuration -) { - return { - /** - * Delete a reaction (like or recast) to a given cast \\ (In order to delete a reaction `signer_uuid` must be approved) - * @summary Delete a reaction - * @param {ReactionReqBody} reactionReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteReaction: async ( - reactionReqBody: ReactionReqBody, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'reactionReqBody' is not null or undefined - assertParamExists("deleteReaction", "reactionReqBody", reactionReqBody); - const localVarPath = `/farcaster/reaction`; - // 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; - } +export const ReactionApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Delete a reaction (like or recast) to a given cast \\ (In order to delete a reaction `signer_uuid` must be approved) + * @summary Delete a reaction + * @param {string} apiKey API key required for authentication. + * @param {ReactionReqBody} reactionReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteReaction: async (apiKey: string, reactionReqBody: ReactionReqBody, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('deleteReaction', 'apiKey', apiKey) + // verify required parameter 'reactionReqBody' is not null or undefined + assertParamExists('deleteReaction', 'reactionReqBody', reactionReqBody) + const localVarPath = `/farcaster/reaction`; + // 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: "DELETE", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } - localVarHeaderParameter["Content-Type"] = "application/json"; - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - localVarRequestOptions.data = serializeDataIfNeeded( - reactionReqBody, - localVarRequestOptions, - configuration - ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Post a reaction (like or recast) to a given cast \\ (In order to post a reaction `signer_uuid` must be approved) - * @summary Posts a reaction - * @param {ReactionReqBody} reactionReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - postReaction: async ( - reactionReqBody: ReactionReqBody, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'reactionReqBody' is not null or undefined - assertParamExists("postReaction", "reactionReqBody", reactionReqBody); - const localVarPath = `/farcaster/reaction`; - // 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; - } + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(reactionReqBody, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Post a reaction (like or recast) to a given cast \\ (In order to post a reaction `signer_uuid` must be approved) + * @summary Posts a reaction + * @param {string} apiKey API key required for authentication. + * @param {ReactionReqBody} reactionReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + postReaction: async (apiKey: string, reactionReqBody: ReactionReqBody, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('postReaction', 'apiKey', apiKey) + // verify required parameter 'reactionReqBody' is not null or undefined + assertParamExists('postReaction', 'reactionReqBody', reactionReqBody) + const localVarPath = `/farcaster/reaction`; + // 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: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } - const localVarRequestOptions = { - method: "POST", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter["Content-Type"] = "application/json"; + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(reactionReqBody, localVarRequestOptions, configuration) - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - localVarRequestOptions.data = serializeDataIfNeeded( - reactionReqBody, - localVarRequestOptions, - configuration - ); + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Fetches reactions for a given user + * @summary Fetches reactions for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {ReactionsType} type Type of reaction to fetch (likes or recasts or all) + * @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} + */ + reactionsUser: async (apiKey: string, fid: number, type: ReactionsType, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('reactionsUser', 'apiKey', apiKey) + // verify required parameter 'fid' is not null or undefined + assertParamExists('reactionsUser', 'fid', fid) + // verify required parameter 'type' is not null or undefined + assertParamExists('reactionsUser', 'type', type) + const localVarPath = `/farcaster/reactions/user`; + // 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; + } - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } + + if (type !== undefined) { + localVarQueryParameter['type'] = type; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + 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, + }; + }, + } }; /** * ReactionApi - functional programming interface * @export */ -export const ReactionApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = ReactionApiAxiosParamCreator(configuration); - return { - /** - * Delete a reaction (like or recast) to a given cast \\ (In order to delete a reaction `signer_uuid` must be approved) - * @summary Delete a reaction - * @param {ReactionReqBody} reactionReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async deleteReaction( - reactionReqBody: ReactionReqBody, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteReaction( - reactionReqBody, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Post a reaction (like or recast) to a given cast \\ (In order to post a reaction `signer_uuid` must be approved) - * @summary Posts a reaction - * @param {ReactionReqBody} reactionReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async postReaction( - reactionReqBody: ReactionReqBody, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.postReaction( - reactionReqBody, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - }; +export const ReactionApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = ReactionApiAxiosParamCreator(configuration) + return { + /** + * Delete a reaction (like or recast) to a given cast \\ (In order to delete a reaction `signer_uuid` must be approved) + * @summary Delete a reaction + * @param {string} apiKey API key required for authentication. + * @param {ReactionReqBody} reactionReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteReaction(apiKey: string, reactionReqBody: ReactionReqBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteReaction(apiKey, reactionReqBody, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Post a reaction (like or recast) to a given cast \\ (In order to post a reaction `signer_uuid` must be approved) + * @summary Posts a reaction + * @param {string} apiKey API key required for authentication. + * @param {ReactionReqBody} reactionReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async postReaction(apiKey: string, reactionReqBody: ReactionReqBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.postReaction(apiKey, reactionReqBody, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Fetches reactions for a given user + * @summary Fetches reactions for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {ReactionsType} type Type of reaction to fetch (likes or recasts or all) + * @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 reactionsUser(apiKey: string, fid: number, type: ReactionsType, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.reactionsUser(apiKey, fid, type, limit, cursor, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } }; /** * ReactionApi - factory interface * @export */ -export const ReactionApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance -) { - const localVarFp = ReactionApiFp(configuration); - return { +export const ReactionApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = ReactionApiFp(configuration) + return { + /** + * Delete a reaction (like or recast) to a given cast \\ (In order to delete a reaction `signer_uuid` must be approved) + * @summary Delete a reaction + * @param {string} apiKey API key required for authentication. + * @param {ReactionReqBody} reactionReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteReaction(apiKey: string, reactionReqBody: ReactionReqBody, options?: any): AxiosPromise { + return localVarFp.deleteReaction(apiKey, reactionReqBody, options).then((request) => request(axios, basePath)); + }, + /** + * Post a reaction (like or recast) to a given cast \\ (In order to post a reaction `signer_uuid` must be approved) + * @summary Posts a reaction + * @param {string} apiKey API key required for authentication. + * @param {ReactionReqBody} reactionReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + postReaction(apiKey: string, reactionReqBody: ReactionReqBody, options?: any): AxiosPromise { + return localVarFp.postReaction(apiKey, reactionReqBody, options).then((request) => request(axios, basePath)); + }, + /** + * Fetches reactions for a given user + * @summary Fetches reactions for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {ReactionsType} type Type of reaction to fetch (likes or recasts or all) + * @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} + */ + reactionsUser(apiKey: string, fid: number, type: ReactionsType, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.reactionsUser(apiKey, fid, type, limit, cursor, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * ReactionApi - object-oriented interface + * @export + * @class ReactionApi + * @extends {BaseAPI} + */ +export class ReactionApi extends BaseAPI { /** - * Delete a reaction (like or recast) to a given cast \\ (In order to delete a reaction `signer_uuid` must be approved) + * Delete a reaction (like or recast) to a given cast \\ (In order to delete a reaction `signer_uuid` must be approved) * @summary Delete a reaction - * @param {ReactionApiDeleteReactionRequest} requestParameters Request parameters. + * @param {string} apiKey API key required for authentication. + * @param {ReactionReqBody} reactionReqBody * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof ReactionApi */ - deleteReaction( - requestParameters: ReactionApiDeleteReactionRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .deleteReaction(requestParameters.reactionReqBody, options) - .then((request) => request(axios, basePath)); - }, + public deleteReaction(apiKey: string, reactionReqBody: ReactionReqBody, options?: AxiosRequestConfig) { + return ReactionApiFp(this.configuration).deleteReaction(apiKey, reactionReqBody, options).then((request) => request(this.axios, this.basePath)); + } + /** - * Post a reaction (like or recast) to a given cast \\ (In order to post a reaction `signer_uuid` must be approved) + * Post a reaction (like or recast) to a given cast \\ (In order to post a reaction `signer_uuid` must be approved) * @summary Posts a reaction - * @param {ReactionApiPostReactionRequest} requestParameters Request parameters. + * @param {string} apiKey API key required for authentication. + * @param {ReactionReqBody} reactionReqBody * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof ReactionApi */ - postReaction( - requestParameters: ReactionApiPostReactionRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .postReaction(requestParameters.reactionReqBody, options) - .then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * Request parameters for deleteReaction operation in ReactionApi. - * @export - * @interface ReactionApiDeleteReactionRequest - */ -export interface ReactionApiDeleteReactionRequest { - /** - * - * @type {ReactionReqBody} - * @memberof ReactionApiDeleteReaction - */ - readonly reactionReqBody: ReactionReqBody; -} + public postReaction(apiKey: string, reactionReqBody: ReactionReqBody, options?: AxiosRequestConfig) { + return ReactionApiFp(this.configuration).postReaction(apiKey, reactionReqBody, options).then((request) => request(this.axios, this.basePath)); + } -/** - * Request parameters for postReaction operation in ReactionApi. - * @export - * @interface ReactionApiPostReactionRequest - */ -export interface ReactionApiPostReactionRequest { - /** - * - * @type {ReactionReqBody} - * @memberof ReactionApiPostReaction - */ - readonly reactionReqBody: ReactionReqBody; + /** + * Fetches reactions for a given user + * @summary Fetches reactions for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {ReactionsType} type Type of reaction to fetch (likes or recasts or all) + * @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 ReactionApi + */ + public reactionsUser(apiKey: string, fid: number, type: ReactionsType, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + return ReactionApiFp(this.configuration).reactionsUser(apiKey, fid, type, limit, cursor, options).then((request) => request(this.axios, this.basePath)); + } } -/** - * ReactionApi - object-oriented interface - * @export - * @class ReactionApi - * @extends {BaseAPI} - */ -export class ReactionApi extends BaseAPI { - /** - * Delete a reaction (like or recast) to a given cast \\ (In order to delete a reaction `signer_uuid` must be approved) - * @summary Delete a reaction - * @param {ReactionApiDeleteReactionRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ReactionApi - */ - public deleteReaction( - requestParameters: ReactionApiDeleteReactionRequest, - options?: AxiosRequestConfig - ) { - return ReactionApiFp(this.configuration) - .deleteReaction(requestParameters.reactionReqBody, options) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Post a reaction (like or recast) to a given cast \\ (In order to post a reaction `signer_uuid` must be approved) - * @summary Posts a reaction - * @param {ReactionApiPostReactionRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ReactionApi - */ - public postReaction( - requestParameters: ReactionApiPostReactionRequest, - options?: AxiosRequestConfig - ) { - return ReactionApiFp(this.configuration) - .postReaction(requestParameters.reactionReqBody, options) - .then((request) => request(this.axios, this.basePath)); - } -} diff --git a/src/neynar-api/v2/openapi-farcaster/apis/signer-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/signer-api.ts index eee3a702..030f480e 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/signer-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/signer-api.ts @@ -5,431 +5,291 @@ * 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"; + +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"; +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"; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; // @ts-ignore -import { ErrorRes } from "../models"; +import { ErrorRes } from '../models'; // @ts-ignore -import { RegisterSignerKeyReqBody } from "../models"; +import { RegisterSignerKeyReqBody } from '../models'; // @ts-ignore -import { Signer } from "../models"; +import { Signer } from '../models'; /** * SignerApi - axios parameter creator * @export */ -export const SignerApiAxiosParamCreator = function ( - configuration?: Configuration -) { - return { - /** - * Creates a signer and returns the signer status. - * **Note**: While testing please reuse the signer, it costs money to approve a signer. - * @summary Creates a signer and returns the signer status - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createSigner: async ( - options: AxiosRequestConfig = {} - ): Promise => { - const localVarPath = `/farcaster/signer`; - // 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; - } +export const SignerApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Creates a signer and returns the signer status. \\ **Note**: While tesing please reuse the signer, it costs money to approve a signer. + * @summary Creates a signer and returns the signer status + * @param {string} apiKey API key required for authentication. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createSigner: async (apiKey: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('createSigner', 'apiKey', apiKey) + const localVarPath = `/farcaster/signer`; + // 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: "POST", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); + 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, - }; - }, - /** - * Registers an app fid, deadline and a signature. Returns the signer status with an approval url. - * @summary Register Signed Key - * @param {RegisterSignerKeyReqBody} registerSignerKeyReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - registerSignedKey: async ( - registerSignerKeyReqBody: RegisterSignerKeyReqBody, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'registerSignerKeyReqBody' is not null or undefined - assertParamExists( - "registerSignedKey", - "registerSignerKeyReqBody", - registerSignerKeyReqBody - ); - const localVarPath = `/farcaster/signer/signed_key`; - // 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; - } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const localVarRequestOptions = { - method: "POST", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Registers an app fid, deadline and a signature. Returns the signer status with an approval url. + * @summary Register Signed Key + * @param {string} apiKey API key required for authentication. + * @param {RegisterSignerKeyReqBody} registerSignerKeyReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + registerSignedKey: async (apiKey: string, registerSignerKeyReqBody: RegisterSignerKeyReqBody, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('registerSignedKey', 'apiKey', apiKey) + // verify required parameter 'registerSignerKeyReqBody' is not null or undefined + assertParamExists('registerSignedKey', 'registerSignerKeyReqBody', registerSignerKeyReqBody) + const localVarPath = `/farcaster/signer/signed_key`; + // 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; + } - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - localVarHeaderParameter["Content-Type"] = "application/json"; + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - localVarRequestOptions.data = serializeDataIfNeeded( - registerSignerKeyReqBody, - localVarRequestOptions, - configuration - ); - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Gets information status of a signer by passing in a signer_uuid (Use post API to generate a signer) - * @summary Fetches the status of a signer - * @param {string} signerUuid - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - signer: async ( - signerUuid: string, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'signerUuid' is not null or undefined - assertParamExists("signer", "signerUuid", signerUuid); - const localVarPath = `/farcaster/signer`; - // 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; - } + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(registerSignerKeyReqBody, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Gets information status of a signer by passing in a signer_uuid (Use post API to generate a signer) + * @summary Fetches the status of a signer + * @param {string} apiKey API key required for authentication. + * @param {string} signerUuid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + signer: async (apiKey: string, signerUuid: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('signer', 'apiKey', apiKey) + // verify required parameter 'signerUuid' is not null or undefined + assertParamExists('signer', 'signerUuid', signerUuid) + const localVarPath = `/farcaster/signer`; + // 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; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); + if (signerUuid !== undefined) { + localVarQueryParameter['signer_uuid'] = signerUuid; + } - if (signerUuid !== undefined) { - localVarQueryParameter["signer_uuid"] = signerUuid; - } + 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, - }; - }, - }; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } }; /** * SignerApi - functional programming interface * @export */ -export const SignerApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = SignerApiAxiosParamCreator(configuration); - return { - /** - * Creates a signer and returns the signer status. \\ **Note**: While testing please reuse the signer, it costs money to approve a signer. - * @summary Creates a signer and returns the signer status - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async createSigner( - options?: AxiosRequestConfig - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.createSigner( - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Registers an app fid, deadline and a signature. Returns the signer status with an approval url. - * @summary Register Signed Key - * @param {RegisterSignerKeyReqBody} registerSignerKeyReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async registerSignedKey( - registerSignerKeyReqBody: RegisterSignerKeyReqBody, - options?: AxiosRequestConfig - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.registerSignedKey( - registerSignerKeyReqBody, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Gets information status of a signer by passing in a signer_uuid (Use post API to generate a signer) - * @summary Fetches the status of a signer - * @param {string} signerUuid - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async signer( - signerUuid: string, - options?: AxiosRequestConfig - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.signer( - signerUuid, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - }; +export const SignerApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = SignerApiAxiosParamCreator(configuration) + return { + /** + * Creates a signer and returns the signer status. \\ **Note**: While tesing please reuse the signer, it costs money to approve a signer. + * @summary Creates a signer and returns the signer status + * @param {string} apiKey API key required for authentication. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createSigner(apiKey: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createSigner(apiKey, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Registers an app fid, deadline and a signature. Returns the signer status with an approval url. + * @summary Register Signed Key + * @param {string} apiKey API key required for authentication. + * @param {RegisterSignerKeyReqBody} registerSignerKeyReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async registerSignedKey(apiKey: string, registerSignerKeyReqBody: RegisterSignerKeyReqBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.registerSignedKey(apiKey, registerSignerKeyReqBody, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Gets information status of a signer by passing in a signer_uuid (Use post API to generate a signer) + * @summary Fetches the status of a signer + * @param {string} apiKey API key required for authentication. + * @param {string} signerUuid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async signer(apiKey: string, signerUuid: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.signer(apiKey, signerUuid, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } }; /** * SignerApi - factory interface * @export */ -export const SignerApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance -) { - const localVarFp = SignerApiFp(configuration); - return { +export const SignerApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = SignerApiFp(configuration) + return { + /** + * Creates a signer and returns the signer status. \\ **Note**: While tesing please reuse the signer, it costs money to approve a signer. + * @summary Creates a signer and returns the signer status + * @param {string} apiKey API key required for authentication. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createSigner(apiKey: string, options?: any): AxiosPromise { + return localVarFp.createSigner(apiKey, options).then((request) => request(axios, basePath)); + }, + /** + * Registers an app fid, deadline and a signature. Returns the signer status with an approval url. + * @summary Register Signed Key + * @param {string} apiKey API key required for authentication. + * @param {RegisterSignerKeyReqBody} registerSignerKeyReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + registerSignedKey(apiKey: string, registerSignerKeyReqBody: RegisterSignerKeyReqBody, options?: any): AxiosPromise { + return localVarFp.registerSignedKey(apiKey, registerSignerKeyReqBody, options).then((request) => request(axios, basePath)); + }, + /** + * Gets information status of a signer by passing in a signer_uuid (Use post API to generate a signer) + * @summary Fetches the status of a signer + * @param {string} apiKey API key required for authentication. + * @param {string} signerUuid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + signer(apiKey: string, signerUuid: string, options?: any): AxiosPromise { + return localVarFp.signer(apiKey, signerUuid, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * SignerApi - object-oriented interface + * @export + * @class SignerApi + * @extends {BaseAPI} + */ +export class SignerApi extends BaseAPI { /** - * Creates a signer and returns the signer status. \\ **Note**: While testing please reuse the signer, it costs money to approve a signer. + * Creates a signer and returns the signer status. \\ **Note**: While tesing please reuse the signer, it costs money to approve a signer. * @summary Creates a signer and returns the signer status + * @param {string} apiKey API key required for authentication. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof SignerApi */ - createSigner(options?: AxiosRequestConfig): AxiosPromise { - return localVarFp - .createSigner(options) - .then((request) => request(axios, basePath)); - }, + public createSigner(apiKey: string, options?: AxiosRequestConfig) { + return SignerApiFp(this.configuration).createSigner(apiKey, options).then((request) => request(this.axios, this.basePath)); + } + /** * Registers an app fid, deadline and a signature. Returns the signer status with an approval url. * @summary Register Signed Key - * @param {SignerApiRegisterSignedKeyRequest} requestParameters Request parameters. + * @param {string} apiKey API key required for authentication. + * @param {RegisterSignerKeyReqBody} registerSignerKeyReqBody * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof SignerApi */ - registerSignedKey( - requestParameters: SignerApiRegisterSignedKeyRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .registerSignedKey(requestParameters.registerSignerKeyReqBody, options) - .then((request) => request(axios, basePath)); - }, + public registerSignedKey(apiKey: string, registerSignerKeyReqBody: RegisterSignerKeyReqBody, options?: AxiosRequestConfig) { + return SignerApiFp(this.configuration).registerSignedKey(apiKey, registerSignerKeyReqBody, options).then((request) => request(this.axios, this.basePath)); + } + /** * Gets information status of a signer by passing in a signer_uuid (Use post API to generate a signer) * @summary Fetches the status of a signer - * @param {SignerApiSignerRequest} requestParameters Request parameters. + * @param {string} apiKey API key required for authentication. + * @param {string} signerUuid * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof SignerApi */ - signer( - requestParameters: SignerApiSignerRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .signer(requestParameters.signerUuid, options) - .then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * Request parameters for registerSignedKey operation in SignerApi. - * @export - * @interface SignerApiRegisterSignedKeyRequest - */ -export interface SignerApiRegisterSignedKeyRequest { - /** - * - * @type {RegisterSignerKeyReqBody} - * @memberof SignerApiRegisterSignedKey - */ - readonly registerSignerKeyReqBody: RegisterSignerKeyReqBody; + public signer(apiKey: string, signerUuid: string, options?: AxiosRequestConfig) { + return SignerApiFp(this.configuration).signer(apiKey, signerUuid, options).then((request) => request(this.axios, this.basePath)); + } } -/** - * Request parameters for signer operation in SignerApi. - * @export - * @interface SignerApiSignerRequest - */ -export interface SignerApiSignerRequest { - /** - * - * @type {string} - * @memberof SignerApiSigner - */ - readonly signerUuid: string; -} - -/** - * SignerApi - object-oriented interface - * @export - * @class SignerApi - * @extends {BaseAPI} - */ -export class SignerApi extends BaseAPI { - /** - * Creates a signer and returns the signer status. \\ **Note**: While testing please reuse the signer, it costs money to approve a signer. - * @summary Creates a signer and returns the signer status - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SignerApi - */ - public createSigner(options?: AxiosRequestConfig) { - return SignerApiFp(this.configuration) - .createSigner(options) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Registers an app fid, deadline and a signature. Returns the signer status with an approval url. - * @summary Register Signed Key - * @param {SignerApiRegisterSignedKeyRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SignerApi - */ - public registerSignedKey( - requestParameters: SignerApiRegisterSignedKeyRequest, - options?: AxiosRequestConfig - ) { - return SignerApiFp(this.configuration) - .registerSignedKey(requestParameters.registerSignerKeyReqBody, options) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Gets information status of a signer by passing in a signer_uuid (Use post API to generate a signer) - * @summary Fetches the status of a signer - * @param {SignerApiSignerRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SignerApi - */ - public signer( - requestParameters: SignerApiSignerRequest, - options?: AxiosRequestConfig - ) { - return SignerApiFp(this.configuration) - .signer(requestParameters.signerUuid, options) - .then((request) => request(this.axios, this.basePath)); - } -} diff --git a/src/neynar-api/v2/openapi-farcaster/apis/storage-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/storage-api.ts new file mode 100644 index 00000000..441d26ec --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/apis/storage-api.ts @@ -0,0 +1,226 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster 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 { StorageAllocationsResponse } from '../models'; +// @ts-ignore +import { StorageUsageResponse } from '../models'; +/** + * StorageApi - axios parameter creator + * @export + */ +export const StorageApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Fetches storage allocations for a given user + * @summary Fetches storage allocations for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + storageAllocations: async (apiKey: string, fid: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('storageAllocations', 'apiKey', apiKey) + // verify required parameter 'fid' is not null or undefined + assertParamExists('storageAllocations', 'fid', fid) + const localVarPath = `/farcaster/storage/allocations`; + // 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 (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } + + 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, + }; + }, + /** + * Fetches storage usage for a given user + * @summary Fetches storage usage for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + storageUsage: async (apiKey: string, fid: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('storageUsage', 'apiKey', apiKey) + // verify required parameter 'fid' is not null or undefined + assertParamExists('storageUsage', 'fid', fid) + const localVarPath = `/farcaster/storage/usage`; + // 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 (fid !== undefined) { + localVarQueryParameter['fid'] = fid; + } + + 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, + }; + }, + } +}; + +/** + * StorageApi - functional programming interface + * @export + */ +export const StorageApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = StorageApiAxiosParamCreator(configuration) + return { + /** + * Fetches storage allocations for a given user + * @summary Fetches storage allocations for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async storageAllocations(apiKey: string, fid: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.storageAllocations(apiKey, fid, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Fetches storage usage for a given user + * @summary Fetches storage usage for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async storageUsage(apiKey: string, fid: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.storageUsage(apiKey, fid, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * StorageApi - factory interface + * @export + */ +export const StorageApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = StorageApiFp(configuration) + return { + /** + * Fetches storage allocations for a given user + * @summary Fetches storage allocations for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + storageAllocations(apiKey: string, fid: number, options?: any): AxiosPromise { + return localVarFp.storageAllocations(apiKey, fid, options).then((request) => request(axios, basePath)); + }, + /** + * Fetches storage usage for a given user + * @summary Fetches storage usage for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + storageUsage(apiKey: string, fid: number, options?: any): AxiosPromise { + return localVarFp.storageUsage(apiKey, fid, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * StorageApi - object-oriented interface + * @export + * @class StorageApi + * @extends {BaseAPI} + */ +export class StorageApi extends BaseAPI { + /** + * Fetches storage allocations for a given user + * @summary Fetches storage allocations for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StorageApi + */ + public storageAllocations(apiKey: string, fid: number, options?: AxiosRequestConfig) { + return StorageApiFp(this.configuration).storageAllocations(apiKey, fid, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Fetches storage usage for a given user + * @summary Fetches storage usage for a given user + * @param {string} apiKey API key required for authentication. + * @param {number} fid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StorageApi + */ + public storageUsage(apiKey: string, fid: number, options?: AxiosRequestConfig) { + return StorageApiFp(this.configuration).storageUsage(apiKey, fid, options).then((request) => request(this.axios, this.basePath)); + } +} + diff --git a/src/neynar-api/v2/openapi-farcaster/apis/user-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/user-api.ts index 604a0452..0f540cf1 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/user-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/user-api.ts @@ -5,1170 +5,729 @@ * 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"; + +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"; +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"; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; // @ts-ignore -import { AddVerificationReqBody } from "../models"; +import { AddVerificationReqBody } from '../models'; // @ts-ignore -import { BulkFollowResponse } from "../models"; +import { BulkFollowResponse } from '../models'; // @ts-ignore -import { ErrorRes } from "../models"; +import { ErrorRes } from '../models'; // @ts-ignore -import { FollowReqBody } from "../models"; +import { FollowReqBody } from '../models'; // @ts-ignore -import { OperationResponse } from "../models"; +import { OperationResponse } from '../models'; // @ts-ignore -import { RemoveVerificationReqBody } from "../models"; +import { RemoveVerificationReqBody } from '../models'; // @ts-ignore -import { UpdateUserReqBody } from "../models"; +import { UpdateUserReqBody } from '../models'; // @ts-ignore -import { UserBulk200Response } from "../models"; +import { UserBulk200Response } from '../models'; // @ts-ignore -import { UserResponse } from "../models"; +import { UserResponse } from '../models'; // @ts-ignore -import { UserSearchResponse } from "../models"; +import { UserSearchResponse } from '../models'; /** * UserApi - axios parameter creator * @export */ -export const UserApiAxiosParamCreator = function ( - configuration?: Configuration -) { - return { - /** - * Removes verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) - * @summary Removes verification for an eth address for the user - * @param {RemoveVerificationReqBody} removeVerificationReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - farcasterUserVerificationDelete: async ( - removeVerificationReqBody: RemoveVerificationReqBody, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'removeVerificationReqBody' is not null or undefined - assertParamExists( - "farcasterUserVerificationDelete", - "removeVerificationReqBody", - removeVerificationReqBody - ); - const localVarPath = `/farcaster/user/verification`; - // 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: "DELETE", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - localVarHeaderParameter["Content-Type"] = "application/json"; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - localVarRequestOptions.data = serializeDataIfNeeded( - removeVerificationReqBody, - localVarRequestOptions, - configuration - ); - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Adds verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) - * @summary Adds verification for an eth address for the user - * @param {AddVerificationReqBody} addVerificationReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - farcasterUserVerificationPost: async ( - addVerificationReqBody: AddVerificationReqBody, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'addVerificationReqBody' is not null or undefined - assertParamExists( - "farcasterUserVerificationPost", - "addVerificationReqBody", - addVerificationReqBody - ); - const localVarPath = `/farcaster/user/verification`; - // 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: "POST", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - localVarHeaderParameter["Content-Type"] = "application/json"; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - localVarRequestOptions.data = serializeDataIfNeeded( - addVerificationReqBody, - localVarRequestOptions, - configuration - ); - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Follow a user \\ (In order to follow a user `signer_uuid` must be approved) - * @summary Follow a user - * @param {FollowReqBody} followReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - followUser: async ( - followReqBody: FollowReqBody, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'followReqBody' is not null or undefined - assertParamExists("followUser", "followReqBody", followReqBody); - const localVarPath = `/farcaster/user/follow`; - // 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: "POST", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - localVarHeaderParameter["Content-Type"] = "application/json"; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - localVarRequestOptions.data = serializeDataIfNeeded( - followReqBody, - localVarRequestOptions, - configuration - ); - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Lookup a user by custody-address - * @summary Lookup a user by custody-address - * @param {string} custodyAddress Custody Address of the associated with mnemonic - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - lookupUserByCustodyAddress: async ( - custodyAddress: string, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'custodyAddress' is not null or undefined - assertParamExists( - "lookupUserByCustodyAddress", - "custodyAddress", - custodyAddress - ); - - const localVarPath = `/farcaster/user/custody-address`; - // 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 (custodyAddress !== undefined) { - localVarQueryParameter["custody_address"] = custodyAddress; - } - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Unfollow a user \\ (In order to unfollow a user `signer_uuid` must be approved) - * @summary Unfollow a user - * @param {FollowReqBody} followReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - unfollowUser: async ( - followReqBody: FollowReqBody, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'followReqBody' is not null or undefined - assertParamExists("unfollowUser", "followReqBody", followReqBody); - const localVarPath = `/farcaster/user/follow`; - // 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: "DELETE", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - localVarHeaderParameter["Content-Type"] = "application/json"; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - localVarRequestOptions.data = serializeDataIfNeeded( - followReqBody, - localVarRequestOptions, - configuration - ); - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Update user profile \\ (In order to update user\'s profile `signer_uuid` must be approved) - * @summary Update user profile - * @param {UpdateUserReqBody} updateUserReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateUser: async ( - updateUserReqBody: UpdateUserReqBody, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'updateUserReqBody' is not null or undefined - assertParamExists("updateUser", "updateUserReqBody", updateUserReqBody); - const localVarPath = `/farcaster/user`; - // 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: "PATCH", - ...baseOptions, - ...options, - }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - localVarHeaderParameter["Content-Type"] = "application/json"; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - localVarRequestOptions.data = serializeDataIfNeeded( - updateUserReqBody, - localVarRequestOptions, - configuration - ); - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Fetches information about multiple users based on FIDs - * @summary Fetches information about multiple users based on FIDs - * @param {string} fids - * @param {number} [viewerFid] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - userBulk: async ( - fids: string, - viewerFid?: number, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'fids' is not null or undefined - assertParamExists("userBulk", "fids", fids); - const localVarPath = `/farcaster/user/bulk`; - // 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 (fids !== undefined) { - localVarQueryParameter["fids"] = fids; - } - - if (viewerFid !== undefined) { - localVarQueryParameter["viewer_fid"] = viewerFid; - } - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Search for Usernames - * @summary Search for Usernames - * @param {number} viewerFid - * @param {string} q - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - userSearch: async ( - viewerFid: number, - q: string, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'viewerFid' is not null or undefined - assertParamExists("userSearch", "viewerFid", viewerFid); - // verify required parameter 'q' is not null or undefined - assertParamExists("userSearch", "q", q); - const localVarPath = `/farcaster/user/search`; - // 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 (viewerFid !== undefined) { - localVarQueryParameter["viewer_fid"] = viewerFid; - } - - if (q !== undefined) { - localVarQueryParameter["q"] = q; - } - - // authentication ApiKeyAuth required - await setApiKeyToObject( - localVarHeaderParameter, - "api_key", - configuration - ); - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - }; +export const UserApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Removes verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) + * @summary Removes verification for an eth address for the user + * @param {string} apiKey API key required for authentication. + * @param {RemoveVerificationReqBody} removeVerificationReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + farcasterUserVerificationDelete: async (apiKey: string, removeVerificationReqBody: RemoveVerificationReqBody, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('farcasterUserVerificationDelete', 'apiKey', apiKey) + // verify required parameter 'removeVerificationReqBody' is not null or undefined + assertParamExists('farcasterUserVerificationDelete', 'removeVerificationReqBody', removeVerificationReqBody) + const localVarPath = `/farcaster/user/verification`; + // 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: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(removeVerificationReqBody, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Adds verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) + * @summary Adds verification for an eth address for the user + * @param {string} apiKey API key required for authentication. + * @param {AddVerificationReqBody} addVerificationReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + farcasterUserVerificationPost: async (apiKey: string, addVerificationReqBody: AddVerificationReqBody, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('farcasterUserVerificationPost', 'apiKey', apiKey) + // verify required parameter 'addVerificationReqBody' is not null or undefined + assertParamExists('farcasterUserVerificationPost', 'addVerificationReqBody', addVerificationReqBody) + const localVarPath = `/farcaster/user/verification`; + // 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: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(addVerificationReqBody, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Follow a user \\ (In order to follow a user `signer_uuid` must be approved) + * @summary Follow a user + * @param {string} apiKey API key required for authentication. + * @param {FollowReqBody} followReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + followUser: async (apiKey: string, followReqBody: FollowReqBody, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('followUser', 'apiKey', apiKey) + // verify required parameter 'followReqBody' is not null or undefined + assertParamExists('followUser', 'followReqBody', followReqBody) + const localVarPath = `/farcaster/user/follow`; + // 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: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(followReqBody, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Lookup a user by custody-address + * @summary Lookup a user by custody-address + * @param {string} apiKey API key required for authentication. + * @param {string} custodyAddress Custody Address associated with mnemonic + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + lookupUserByCustodyAddress: async (apiKey: string, custodyAddress: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('lookupUserByCustodyAddress', 'apiKey', apiKey) + // verify required parameter 'custodyAddress' is not null or undefined + assertParamExists('lookupUserByCustodyAddress', 'custodyAddress', custodyAddress) + const localVarPath = `/farcaster/user/custody-address`; + // 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 (custodyAddress !== undefined) { + localVarQueryParameter['custody_address'] = custodyAddress; + } + + 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, + }; + }, + /** + * Unfollow a user \\ (In order to unfollow a user `signer_uuid` must be approved) + * @summary Unfollow a user + * @param {string} apiKey API key required for authentication. + * @param {FollowReqBody} followReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + unfollowUser: async (apiKey: string, followReqBody: FollowReqBody, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('unfollowUser', 'apiKey', apiKey) + // verify required parameter 'followReqBody' is not null or undefined + assertParamExists('unfollowUser', 'followReqBody', followReqBody) + const localVarPath = `/farcaster/user/follow`; + // 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: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(followReqBody, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Update user profile \\ (In order to update user\'s profile `signer_uuid` must be approved) + * @summary Update user profile + * @param {string} apiKey API key required for authentication. + * @param {UpdateUserReqBody} updateUserReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateUser: async (apiKey: string, updateUserReqBody: UpdateUserReqBody, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('updateUser', 'apiKey', apiKey) + // verify required parameter 'updateUserReqBody' is not null or undefined + assertParamExists('updateUser', 'updateUserReqBody', updateUserReqBody) + const localVarPath = `/farcaster/user`; + // 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: 'PATCH', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(updateUserReqBody, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Fetches information about multiple users based on FIDs + * @summary Fetches information about multiple users based on FIDs + * @param {string} apiKey API key required for authentication. + * @param {string} fids + * @param {number} [viewerFid] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userBulk: async (apiKey: string, fids: string, viewerFid?: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('userBulk', 'apiKey', apiKey) + // verify required parameter 'fids' is not null or undefined + assertParamExists('userBulk', 'fids', fids) + const localVarPath = `/farcaster/user/bulk`; + // 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 (fids !== undefined) { + localVarQueryParameter['fids'] = fids; + } + + if (viewerFid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewerFid; + } + + 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, + }; + }, + /** + * Search for Usernames + * @summary Search for Usernames + * @param {string} apiKey API key required for authentication. + * @param {number} viewerFid + * @param {string} q + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userSearch: async (apiKey: string, viewerFid: number, q: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('userSearch', 'apiKey', apiKey) + // verify required parameter 'viewerFid' is not null or undefined + assertParamExists('userSearch', 'viewerFid', viewerFid) + // verify required parameter 'q' is not null or undefined + assertParamExists('userSearch', 'q', q) + const localVarPath = `/farcaster/user/search`; + // 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 (viewerFid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewerFid; + } + + if (q !== undefined) { + localVarQueryParameter['q'] = q; + } + + 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, + }; + }, + } }; /** * UserApi - functional programming interface * @export */ -export const UserApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = UserApiAxiosParamCreator(configuration); - return { - /** - * Removes verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) - * @summary Removes verification for an eth address for the user - * @param {RemoveVerificationReqBody} removeVerificationReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async farcasterUserVerificationDelete( - removeVerificationReqBody: RemoveVerificationReqBody, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.farcasterUserVerificationDelete( - removeVerificationReqBody, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Adds verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) - * @summary Adds verification for an eth address for the user - * @param {AddVerificationReqBody} addVerificationReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async farcasterUserVerificationPost( - addVerificationReqBody: AddVerificationReqBody, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.farcasterUserVerificationPost( - addVerificationReqBody, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Follow a user \\ (In order to follow a user `signer_uuid` must be approved) - * @summary Follow a user - * @param {FollowReqBody} followReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async followUser( - followReqBody: FollowReqBody, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.followUser( - followReqBody, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Lookup a user by custody-address - * @summary Lookup a user by custody-address - * @param {string} custodyAddress Custody Address of the associated with mnemonic - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async lookupUserByCustodyAddress( - custodyAddress: string, - options?: AxiosRequestConfig - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.lookupUserByCustodyAddress( - custodyAddress, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Unfollow a user \\ (In order to unfollow a user `signer_uuid` must be approved) - * @summary Unfollow a user - * @param {FollowReqBody} followReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async unfollowUser( - followReqBody: FollowReqBody, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.unfollowUser( - followReqBody, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Update user profile \\ (In order to update user\'s profile `signer_uuid` must be approved) - * @summary Update user profile - * @param {UpdateUserReqBody} updateUserReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async updateUser( - updateUserReqBody: UpdateUserReqBody, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.updateUser( - updateUserReqBody, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Fetches information about multiple users based on FIDs - * @summary Fetches information about multiple users based on FIDs - * @param {string} fids - * @param {number} [viewerFid] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async userBulk( - fids: string, - viewerFid?: number, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.userBulk( - fids, - viewerFid, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - /** - * Search for Usernames - * @summary Search for Usernames - * @param {number} viewerFid - * @param {string} q - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async userSearch( - viewerFid: number, - q: string, - options?: AxiosRequestConfig - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.userSearch( - viewerFid, - q, - options - ); - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration - ); - }, - }; +export const UserApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = UserApiAxiosParamCreator(configuration) + return { + /** + * Removes verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) + * @summary Removes verification for an eth address for the user + * @param {string} apiKey API key required for authentication. + * @param {RemoveVerificationReqBody} removeVerificationReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async farcasterUserVerificationDelete(apiKey: string, removeVerificationReqBody: RemoveVerificationReqBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.farcasterUserVerificationDelete(apiKey, removeVerificationReqBody, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Adds verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) + * @summary Adds verification for an eth address for the user + * @param {string} apiKey API key required for authentication. + * @param {AddVerificationReqBody} addVerificationReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async farcasterUserVerificationPost(apiKey: string, addVerificationReqBody: AddVerificationReqBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.farcasterUserVerificationPost(apiKey, addVerificationReqBody, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Follow a user \\ (In order to follow a user `signer_uuid` must be approved) + * @summary Follow a user + * @param {string} apiKey API key required for authentication. + * @param {FollowReqBody} followReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async followUser(apiKey: string, followReqBody: FollowReqBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.followUser(apiKey, followReqBody, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Lookup a user by custody-address + * @summary Lookup a user by custody-address + * @param {string} apiKey API key required for authentication. + * @param {string} custodyAddress Custody Address associated with mnemonic + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async lookupUserByCustodyAddress(apiKey: string, custodyAddress: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.lookupUserByCustodyAddress(apiKey, custodyAddress, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Unfollow a user \\ (In order to unfollow a user `signer_uuid` must be approved) + * @summary Unfollow a user + * @param {string} apiKey API key required for authentication. + * @param {FollowReqBody} followReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async unfollowUser(apiKey: string, followReqBody: FollowReqBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.unfollowUser(apiKey, followReqBody, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Update user profile \\ (In order to update user\'s profile `signer_uuid` must be approved) + * @summary Update user profile + * @param {string} apiKey API key required for authentication. + * @param {UpdateUserReqBody} updateUserReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateUser(apiKey: string, updateUserReqBody: UpdateUserReqBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateUser(apiKey, updateUserReqBody, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Fetches information about multiple users based on FIDs + * @summary Fetches information about multiple users based on FIDs + * @param {string} apiKey API key required for authentication. + * @param {string} fids + * @param {number} [viewerFid] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async userBulk(apiKey: string, fids: string, viewerFid?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.userBulk(apiKey, fids, viewerFid, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Search for Usernames + * @summary Search for Usernames + * @param {string} apiKey API key required for authentication. + * @param {number} viewerFid + * @param {string} q + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async userSearch(apiKey: string, viewerFid: number, q: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.userSearch(apiKey, viewerFid, q, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } }; /** * UserApi - factory interface * @export */ -export const UserApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance -) { - const localVarFp = UserApiFp(configuration); - return { +export const UserApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = UserApiFp(configuration) + return { + /** + * Removes verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) + * @summary Removes verification for an eth address for the user + * @param {string} apiKey API key required for authentication. + * @param {RemoveVerificationReqBody} removeVerificationReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + farcasterUserVerificationDelete(apiKey: string, removeVerificationReqBody: RemoveVerificationReqBody, options?: any): AxiosPromise { + return localVarFp.farcasterUserVerificationDelete(apiKey, removeVerificationReqBody, options).then((request) => request(axios, basePath)); + }, + /** + * Adds verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) + * @summary Adds verification for an eth address for the user + * @param {string} apiKey API key required for authentication. + * @param {AddVerificationReqBody} addVerificationReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + farcasterUserVerificationPost(apiKey: string, addVerificationReqBody: AddVerificationReqBody, options?: any): AxiosPromise { + return localVarFp.farcasterUserVerificationPost(apiKey, addVerificationReqBody, options).then((request) => request(axios, basePath)); + }, + /** + * Follow a user \\ (In order to follow a user `signer_uuid` must be approved) + * @summary Follow a user + * @param {string} apiKey API key required for authentication. + * @param {FollowReqBody} followReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + followUser(apiKey: string, followReqBody: FollowReqBody, options?: any): AxiosPromise { + return localVarFp.followUser(apiKey, followReqBody, options).then((request) => request(axios, basePath)); + }, + /** + * Lookup a user by custody-address + * @summary Lookup a user by custody-address + * @param {string} apiKey API key required for authentication. + * @param {string} custodyAddress Custody Address associated with mnemonic + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + lookupUserByCustodyAddress(apiKey: string, custodyAddress: string, options?: any): AxiosPromise { + return localVarFp.lookupUserByCustodyAddress(apiKey, custodyAddress, options).then((request) => request(axios, basePath)); + }, + /** + * Unfollow a user \\ (In order to unfollow a user `signer_uuid` must be approved) + * @summary Unfollow a user + * @param {string} apiKey API key required for authentication. + * @param {FollowReqBody} followReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + unfollowUser(apiKey: string, followReqBody: FollowReqBody, options?: any): AxiosPromise { + return localVarFp.unfollowUser(apiKey, followReqBody, options).then((request) => request(axios, basePath)); + }, + /** + * Update user profile \\ (In order to update user\'s profile `signer_uuid` must be approved) + * @summary Update user profile + * @param {string} apiKey API key required for authentication. + * @param {UpdateUserReqBody} updateUserReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateUser(apiKey: string, updateUserReqBody: UpdateUserReqBody, options?: any): AxiosPromise { + return localVarFp.updateUser(apiKey, updateUserReqBody, options).then((request) => request(axios, basePath)); + }, + /** + * Fetches information about multiple users based on FIDs + * @summary Fetches information about multiple users based on FIDs + * @param {string} apiKey API key required for authentication. + * @param {string} fids + * @param {number} [viewerFid] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userBulk(apiKey: string, fids: string, viewerFid?: number, options?: any): AxiosPromise { + return localVarFp.userBulk(apiKey, fids, viewerFid, options).then((request) => request(axios, basePath)); + }, + /** + * Search for Usernames + * @summary Search for Usernames + * @param {string} apiKey API key required for authentication. + * @param {number} viewerFid + * @param {string} q + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userSearch(apiKey: string, viewerFid: number, q: string, options?: any): AxiosPromise { + return localVarFp.userSearch(apiKey, viewerFid, q, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * UserApi - object-oriented interface + * @export + * @class UserApi + * @extends {BaseAPI} + */ +export class UserApi extends BaseAPI { /** - * Removes verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) + * Removes verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) * @summary Removes verification for an eth address for the user - * @param {UserApiRemoveVerificationRequest} requestParameters + * @param {string} apiKey API key required for authentication. + * @param {RemoveVerificationReqBody} removeVerificationReqBody * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof UserApi */ - farcasterUserVerificationDelete( - requestParameters: UserApiRemoveVerificationRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .farcasterUserVerificationDelete( - requestParameters.removeVerificationReqBody, - options - ) - .then((request) => request(axios, basePath)); - }, + public farcasterUserVerificationDelete(apiKey: string, removeVerificationReqBody: RemoveVerificationReqBody, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).farcasterUserVerificationDelete(apiKey, removeVerificationReqBody, options).then((request) => request(this.axios, this.basePath)); + } + /** - * Adds verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) + * Adds verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) * @summary Adds verification for an eth address for the user - * @param {UserApiAddVerificationRequest} requestParameters + * @param {string} apiKey API key required for authentication. + * @param {AddVerificationReqBody} addVerificationReqBody * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof UserApi */ - farcasterUserVerificationPost( - requestParameters: UserApiAddVerificationRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .farcasterUserVerificationPost( - requestParameters.addVerificationReqBody, - options - ) - .then((request) => request(axios, basePath)); - }, + public farcasterUserVerificationPost(apiKey: string, addVerificationReqBody: AddVerificationReqBody, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).farcasterUserVerificationPost(apiKey, addVerificationReqBody, options).then((request) => request(this.axios, this.basePath)); + } + /** - * Follow a user \\ (In order to follow a user `signer_uuid` must be approved) + * Follow a user \\ (In order to follow a user `signer_uuid` must be approved) * @summary Follow a user - * @param {UserApiFollowRequest} requestParameters + * @param {string} apiKey API key required for authentication. + * @param {FollowReqBody} followReqBody * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof UserApi */ - followUser( - requestParameters: UserApiFollowRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .followUser(requestParameters.followReqBody, options) - .then((request) => request(axios, basePath)); - }, + public followUser(apiKey: string, followReqBody: FollowReqBody, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).followUser(apiKey, followReqBody, options).then((request) => request(this.axios, this.basePath)); + } + /** * Lookup a user by custody-address * @summary Lookup a user by custody-address - * @param {UserApiLookupUserByCustodyAddressRequest} requestParameters + * @param {string} apiKey API key required for authentication. + * @param {string} custodyAddress Custody Address associated with mnemonic * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof UserApi */ - lookupUserByCustodyAddress( - requestParameters: UserApiLookupUserByCustodyAddressRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .lookupUserByCustodyAddress(requestParameters.custodyAddress, options) - .then((request) => request(axios, basePath)); - }, + public lookupUserByCustodyAddress(apiKey: string, custodyAddress: string, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).lookupUserByCustodyAddress(apiKey, custodyAddress, options).then((request) => request(this.axios, this.basePath)); + } + /** - * Unfollow a user \\ (In order to unfollow a user `signer_uuid` must be approved) + * Unfollow a user \\ (In order to unfollow a user `signer_uuid` must be approved) * @summary Unfollow a user - * @param {UserApiFollowRequest} requestParameters + * @param {string} apiKey API key required for authentication. + * @param {FollowReqBody} followReqBody * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof UserApi */ - unfollowUser( - requestParameters: UserApiFollowRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .unfollowUser(requestParameters.followReqBody, options) - .then((request) => request(axios, basePath)); - }, + public unfollowUser(apiKey: string, followReqBody: FollowReqBody, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).unfollowUser(apiKey, followReqBody, options).then((request) => request(this.axios, this.basePath)); + } + /** - * Update user profile \\ (In order to update user\'s profile `signer_uuid` must be approved) + * Update user profile \\ (In order to update user\'s profile `signer_uuid` must be approved) * @summary Update user profile - * @param {UserApiUpdateUserRequest} requestParameters + * @param {string} apiKey API key required for authentication. + * @param {UpdateUserReqBody} updateUserReqBody * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof UserApi */ - updateUser( - requestParameters: UserApiUpdateUserRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .updateUser(requestParameters.updateUserReqBody, options) - .then((request) => request(axios, basePath)); - }, + public updateUser(apiKey: string, updateUserReqBody: UpdateUserReqBody, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).updateUser(apiKey, updateUserReqBody, options).then((request) => request(this.axios, this.basePath)); + } + /** * Fetches information about multiple users based on FIDs * @summary Fetches information about multiple users based on FIDs - * @param {UserApiBulkUserRequest} requestParameters + * @param {string} apiKey API key required for authentication. + * @param {string} fids + * @param {number} [viewerFid] * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof UserApi */ - userBulk( - requestParameters: UserApiBulkUserRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .userBulk(requestParameters.fids, requestParameters.viewerFid, options) - .then((request) => request(axios, basePath)); - }, + public userBulk(apiKey: string, fids: string, viewerFid?: number, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).userBulk(apiKey, fids, viewerFid, options).then((request) => request(this.axios, this.basePath)); + } + /** * Search for Usernames * @summary Search for Usernames - * @param {UserApiUserSearchRequest} requestParameters + * @param {string} apiKey API key required for authentication. + * @param {number} viewerFid + * @param {string} q * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof UserApi */ - userSearch( - requestParameters: UserApiUserSearchRequest, - options?: AxiosRequestConfig - ): AxiosPromise { - return localVarFp - .userSearch(requestParameters.viewerFid, requestParameters.q, options) - .then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * Request parameters to remove verification for an eth address operation in UserApi. - * @export - * @interface UserApiRemoveVerificationRequest - */ -export interface UserApiRemoveVerificationRequest { - /** - * - * @type {RemoveVerificationReqBody} - * @memberof UserApiRemoveVerification - */ - readonly removeVerificationReqBody: RemoveVerificationReqBody; -} - -/** - * Request parameters add verification for an eth address operation in UserApi. - * @export - * @interface UserApiAddVerificationRequest - */ -export interface UserApiAddVerificationRequest { - /** - * - * @type {AddVerificationReqBody} - * @memberof UserApiAddVerification - */ - readonly addVerificationReqBody: AddVerificationReqBody; + public userSearch(apiKey: string, viewerFid: number, q: string, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).userSearch(apiKey, viewerFid, q, options).then((request) => request(this.axios, this.basePath)); + } } -/** - * Request parameters to follow user operation in UserApi. - * @export - * @interface UserApiFollowRequest - */ -export interface UserApiFollowRequest { - /** - * - * @type {FollowReqBody} - * @memberof UserApiFollow - */ - readonly followReqBody: FollowReqBody; -} - -/** - * Request parameters to update user operation in UserApi. - * @export - * @interface UserApiUpdateUserRequest - */ -export interface UserApiUpdateUserRequest { - /** - * - * @type {UpdateUserReqBody} - * @memberof UserApiUpdateUser - */ - readonly updateUserReqBody: UpdateUserReqBody; -} - -/** - * Request parameters for fetch users in bulk operation in UserApi. - * @export - * @interface UserApiBulkUserRequest - */ -export interface UserApiBulkUserRequest { - /** - * @type {string} - * @memberof UserApiBulkUser - */ - readonly fids: string; - - /** - * @type {number} - * @memberof UserApiBulkUser - */ - readonly viewerFid?: number; -} - -/** - * Request parameters for lookup user by custody address operation in UserApi. - * @export - * @interface UserApiLookupUserByCustodyAddressRequest - */ -export interface UserApiLookupUserByCustodyAddressRequest { - /** - * Custody Address of the associated with mnemonic - * - * @type {string} - * @memberof UserApiLookupUserByCustodyAddress - */ - readonly custodyAddress: string; -} - -/** - * Request parameters for search user in operation in UserApi. - * @export - * @interface UserApiUserSearchRequest - */ -export interface UserApiUserSearchRequest { - /** - * @type {string} - * @memberof UserApiUserSearch - */ - readonly q: string; - - /** - * @type {number} - * @memberof UserApiUserSearch - */ - readonly viewerFid: number; -} - -/** - * UserApi - object-oriented interface - * @export - * @class UserApi - * @extends {BaseAPI} - */ -export class UserApi extends BaseAPI { - /** - * Removes verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) - * @summary Removes verification for an eth address for the user - * @param {UserApiRemoveVerificationRequest} requestParameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public farcasterUserVerificationDelete( - requestParameters: UserApiRemoveVerificationRequest, - options?: AxiosRequestConfig - ) { - return UserApiFp(this.configuration) - .farcasterUserVerificationDelete( - requestParameters.removeVerificationReqBody, - options - ) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Adds verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) - * @summary Adds verification for an eth address for the user - * @param {UserApiAddVerificationRequest} requestParameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public farcasterUserVerificationPost( - requestParameters: UserApiAddVerificationRequest, - options?: AxiosRequestConfig - ) { - return UserApiFp(this.configuration) - .farcasterUserVerificationPost( - requestParameters.addVerificationReqBody, - options - ) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Follow a user \\ (In order to follow a user `signer_uuid` must be approved) - * @summary Follow a user - * @param {UserApiFollowRequest} requestParameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public followUser( - requestParameters: UserApiFollowRequest, - options?: AxiosRequestConfig - ) { - return UserApiFp(this.configuration) - .followUser(requestParameters.followReqBody, options) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Lookup a user by custody-address - * @summary Lookup a user by custody-address - * @param {UserApiLookupUserByCustodyAddressRequest} requestParameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public lookupUserByCustodyAddress( - requestParameters: UserApiLookupUserByCustodyAddressRequest, - options?: AxiosRequestConfig - ) { - return UserApiFp(this.configuration) - .lookupUserByCustodyAddress(requestParameters.custodyAddress, options) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Unfollow a user \\ (In order to unfollow a user `signer_uuid` must be approved) - * @summary Unfollow a user - * @param {UserApiFollowRequest} requestParameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public unfollowUser( - requestParameters: UserApiFollowRequest, - options?: AxiosRequestConfig - ) { - return UserApiFp(this.configuration) - .unfollowUser(requestParameters.followReqBody, options) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Update user profile \\ (In order to update user\'s profile `signer_uuid` must be approved) - * @summary Update user profile - * @param {UserApiUpdateUserRequest} requestParameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public updateUser( - requestParameters: UserApiUpdateUserRequest, - options?: AxiosRequestConfig - ) { - return UserApiFp(this.configuration) - .updateUser(requestParameters.updateUserReqBody, options) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Fetches information about multiple users based on FIDs - * @summary Fetches information about multiple users based on FIDs - * @param {UserApiBulkUserRequest} requestParameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public userBulk( - requestParameters: UserApiBulkUserRequest, - options?: AxiosRequestConfig - ) { - return UserApiFp(this.configuration) - .userBulk(requestParameters.fids, requestParameters.viewerFid, options) - .then((request) => request(this.axios, this.basePath)); - } - - /** - * Search for Usernames - * @summary Search for Usernames - * @param {UserApiUserSearchRequest} requestParameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public userSearch( - requestParameters: UserApiUserSearchRequest, - options?: AxiosRequestConfig - ) { - return UserApiFp(this.configuration) - .userSearch(requestParameters.viewerFid, requestParameters.q, options) - .then((request) => request(this.axios, this.basePath)); - } -} diff --git a/src/neynar-api/v2/openapi-farcaster/models/cast-param-type.ts b/src/neynar-api/v2/openapi-farcaster/models/cast-param-type.ts index 45f0256a..c9279ee7 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/cast-param-type.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/cast-param-type.ts @@ -20,10 +20,12 @@ * @enum {string} */ -export enum CastParamType { - Url = 'url', - Hash = 'hash' -} +export const CastParamType = { + Url: 'url', + Hash: 'hash' +} as const; + +export type CastParamType = typeof CastParamType[keyof typeof CastParamType]; diff --git a/src/neynar-api/v2/openapi-farcaster/models/notification-follow.ts b/src/neynar-api/v2/openapi-farcaster/models/follow.ts similarity index 64% rename from src/neynar-api/v2/openapi-farcaster/models/notification-follow.ts rename to src/neynar-api/v2/openapi-farcaster/models/follow.ts index 071a3910..2980a07b 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/notification-follow.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/follow.ts @@ -20,27 +20,27 @@ import { User } from './user'; /** * * @export - * @interface NotificationFollow + * @interface Follow */ -export interface NotificationFollow { +export interface Follow { /** * * @type {string} - * @memberof NotificationFollow + * @memberof Follow */ - 'object': NotificationFollowObjectEnum; + 'object': FollowObjectEnum; /** * * @type {User} - * @memberof NotificationFollow + * @memberof Follow */ 'user': User; } -export const NotificationFollowObjectEnum = { +export const FollowObjectEnum = { Follow: 'follow' } as const; -export type NotificationFollowObjectEnum = typeof NotificationFollowObjectEnum[keyof typeof NotificationFollowObjectEnum]; +export type FollowObjectEnum = typeof FollowObjectEnum[keyof typeof FollowObjectEnum]; diff --git a/src/neynar-api/v2/openapi-farcaster/models/index.ts b/src/neynar-api/v2/openapi-farcaster/models/index.ts index 28692408..5794d154 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/index.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/index.ts @@ -19,6 +19,7 @@ export * from './embed-url'; export * from './embedded-cast'; export * from './error-res'; export * from './feed-response'; +export * from './follow'; export * from './follow-req-body'; export * from './follow-response'; export * from './get-casts-req-body'; @@ -26,9 +27,6 @@ export * from './hydrated-follower'; export * from './individual-hash-obj'; export * from './next-cursor'; export * from './notification'; -export * from './notification-follow'; -export * from './notification-reactions'; -export * from './notification-reactions-cast'; export * from './notifications-response'; export * from './operation-response'; export * from './post-cast-req-body'; @@ -41,11 +39,19 @@ export * from './reaction-like'; export * from './reaction-recast'; export * from './reaction-req-body'; export * from './reaction-type'; +export * from './reactions'; +export * from './reactions-cast'; +export * from './reactions-response'; +export * from './reactions-type'; export * from './register-signer-key-req-body'; export * from './relevant-followers-response'; export * from './remove-verification-req-body'; export * from './searched-user'; export * from './signer'; +export * from './storage-allocation'; +export * from './storage-allocations-response'; +export * from './storage-object'; +export * from './storage-usage-response'; export * from './update-user-req-body'; export * from './user'; export * from './user-bulk200-response'; diff --git a/src/neynar-api/v2/openapi-farcaster/models/notification.ts b/src/neynar-api/v2/openapi-farcaster/models/notification.ts index 372c281b..10d4d199 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/notification.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/notification.ts @@ -18,10 +18,10 @@ import { CastWithInteractions } from './cast-with-interactions'; // May contain unused imports in some cases // @ts-ignore -import { NotificationFollow } from './notification-follow'; +import { Follow } from './follow'; // May contain unused imports in some cases // @ts-ignore -import { NotificationReactions } from './notification-reactions'; +import { Reactions } from './reactions'; /** * @@ -49,10 +49,10 @@ export interface Notification { 'type': NotificationTypeEnum; /** * - * @type {Array} + * @type {Array} * @memberof Notification */ - 'follows'?: Array; + 'follows'?: Array; /** * * @type {CastWithInteractions} @@ -61,10 +61,10 @@ export interface Notification { 'cast'?: CastWithInteractions; /** * - * @type {Array} + * @type {Array} * @memberof Notification */ - 'reactions'?: Array; + 'reactions'?: Array; } export const NotificationTypeEnum = { diff --git a/src/neynar-api/v2/openapi-farcaster/models/reaction-type.ts b/src/neynar-api/v2/openapi-farcaster/models/reaction-type.ts index f96cbd52..0dac49b8 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/reaction-type.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/reaction-type.ts @@ -5,20 +5,27 @@ * 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 * @enum {string} */ -export enum ReactionType { - Like = "like", - Recast = "recast", -} +export const ReactionType = { + Like: 'like', + Recast: 'recast' +} as const; + +export type ReactionType = typeof ReactionType[keyof typeof ReactionType]; + + + diff --git a/src/neynar-api/v2/openapi-farcaster/models/notification-reactions-cast.ts b/src/neynar-api/v2/openapi-farcaster/models/reactions-cast.ts similarity index 58% rename from src/neynar-api/v2/openapi-farcaster/models/notification-reactions-cast.ts rename to src/neynar-api/v2/openapi-farcaster/models/reactions-cast.ts index c85bcec5..571e472d 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/notification-reactions-cast.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/reactions-cast.ts @@ -17,27 +17,27 @@ /** * * @export - * @interface NotificationReactionsCast + * @interface ReactionsCast */ -export interface NotificationReactionsCast { +export interface ReactionsCast { /** * * @type {string} - * @memberof NotificationReactionsCast + * @memberof ReactionsCast */ 'hash': string; /** * * @type {string} - * @memberof NotificationReactionsCast + * @memberof ReactionsCast */ - 'object': NotificationReactionsCastObjectEnum; + 'object': ReactionsCastObjectEnum; } -export const NotificationReactionsCastObjectEnum = { +export const ReactionsCastObjectEnum = { CastDehydrated: 'cast_dehydrated' } as const; -export type NotificationReactionsCastObjectEnum = typeof NotificationReactionsCastObjectEnum[keyof typeof NotificationReactionsCastObjectEnum]; +export type ReactionsCastObjectEnum = typeof ReactionsCastObjectEnum[keyof typeof ReactionsCastObjectEnum]; diff --git a/src/neynar-api/v2/openapi-farcaster/models/reactions-response.ts b/src/neynar-api/v2/openapi-farcaster/models/reactions-response.ts new file mode 100644 index 00000000..16fc01e8 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/reactions-response.ts @@ -0,0 +1,42 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster 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 { NextCursor } from './next-cursor'; +// May contain unused imports in some cases +// @ts-ignore +import { Reactions } from './reactions'; + +/** + * + * @export + * @interface ReactionsResponse + */ +export interface ReactionsResponse { + /** + * + * @type {Array} + * @memberof ReactionsResponse + */ + 'reactions': Array; + /** + * + * @type {NextCursor} + * @memberof ReactionsResponse + */ + 'next': NextCursor; +} + diff --git a/src/neynar-api/v2/openapi-farcaster/models/reactions-type.ts b/src/neynar-api/v2/openapi-farcaster/models/reactions-type.ts new file mode 100644 index 00000000..bd790042 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/reactions-type.ts @@ -0,0 +1,32 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster 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 + * @enum {string} + */ + +export const ReactionsType = { + Likes: 'likes', + Recasts: 'recasts', + All: 'all' +} as const; + +export type ReactionsType = typeof ReactionsType[keyof typeof ReactionsType]; + + + diff --git a/src/neynar-api/v2/openapi-farcaster/models/notification-reactions.ts b/src/neynar-api/v2/openapi-farcaster/models/reactions.ts similarity index 56% rename from src/neynar-api/v2/openapi-farcaster/models/notification-reactions.ts rename to src/neynar-api/v2/openapi-farcaster/models/reactions.ts index 254ba878..bdd3068a 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/notification-reactions.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/reactions.ts @@ -15,7 +15,7 @@ // May contain unused imports in some cases // @ts-ignore -import { NotificationReactionsCast } from './notification-reactions-cast'; +import { ReactionsCast } from './reactions-cast'; // May contain unused imports in some cases // @ts-ignore import { User } from './user'; @@ -23,34 +23,34 @@ import { User } from './user'; /** * * @export - * @interface NotificationReactions + * @interface Reactions */ -export interface NotificationReactions { +export interface Reactions { /** * * @type {string} - * @memberof NotificationReactions + * @memberof Reactions */ - 'object': NotificationReactionsObjectEnum; + 'object': ReactionsObjectEnum; /** * - * @type {NotificationReactionsCast} - * @memberof NotificationReactions + * @type {ReactionsCast} + * @memberof Reactions */ - 'cast': NotificationReactionsCast; + 'cast': ReactionsCast; /** * * @type {User} - * @memberof NotificationReactions + * @memberof Reactions */ 'user': User; } -export const NotificationReactionsObjectEnum = { +export const ReactionsObjectEnum = { Likes: 'likes', Recasts: 'recasts' } as const; -export type NotificationReactionsObjectEnum = typeof NotificationReactionsObjectEnum[keyof typeof NotificationReactionsObjectEnum]; +export type ReactionsObjectEnum = typeof ReactionsObjectEnum[keyof typeof ReactionsObjectEnum]; diff --git a/src/neynar-api/v2/openapi-farcaster/models/storage-allocation.ts b/src/neynar-api/v2/openapi-farcaster/models/storage-allocation.ts new file mode 100644 index 00000000..68836ee7 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/storage-allocation.ts @@ -0,0 +1,57 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster 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 { UserDehydrated } from './user-dehydrated'; + +/** + * + * @export + * @interface StorageAllocation + */ +export interface StorageAllocation { + /** + * + * @type {string} + * @memberof StorageAllocation + */ + 'object'?: string; + /** + * + * @type {UserDehydrated} + * @memberof StorageAllocation + */ + 'user'?: UserDehydrated; + /** + * + * @type {number} + * @memberof StorageAllocation + */ + 'units'?: number; + /** + * + * @type {string} + * @memberof StorageAllocation + */ + 'expiry'?: string; + /** + * + * @type {string} + * @memberof StorageAllocation + */ + 'timestamp'?: string; +} + diff --git a/src/neynar-api/v2/openapi-farcaster/models/storage-allocations-response.ts b/src/neynar-api/v2/openapi-farcaster/models/storage-allocations-response.ts new file mode 100644 index 00000000..4c6b00a6 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/storage-allocations-response.ts @@ -0,0 +1,39 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster 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 { StorageAllocation } from './storage-allocation'; + +/** + * + * @export + * @interface StorageAllocationsResponse + */ +export interface StorageAllocationsResponse { + /** + * + * @type {number} + * @memberof StorageAllocationsResponse + */ + 'total_active_units'?: number; + /** + * + * @type {Array} + * @memberof StorageAllocationsResponse + */ + 'allocations'?: Array; +} + diff --git a/src/neynar-api/v2/openapi-farcaster/models/storage-object.ts b/src/neynar-api/v2/openapi-farcaster/models/storage-object.ts new file mode 100644 index 00000000..da1c061c --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/storage-object.ts @@ -0,0 +1,42 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster 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 StorageObject + */ +export interface StorageObject { + /** + * + * @type {string} + * @memberof StorageObject + */ + 'object'?: string; + /** + * + * @type {number} + * @memberof StorageObject + */ + 'used'?: number; + /** + * + * @type {number} + * @memberof StorageObject + */ + 'capacity'?: number; +} + diff --git a/src/neynar-api/v2/openapi-farcaster/models/storage-usage-response.ts b/src/neynar-api/v2/openapi-farcaster/models/storage-usage-response.ts new file mode 100644 index 00000000..885fe718 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/storage-usage-response.ts @@ -0,0 +1,84 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster 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 { StorageObject } from './storage-object'; +// May contain unused imports in some cases +// @ts-ignore +import { UserDehydrated } from './user-dehydrated'; + +/** + * + * @export + * @interface StorageUsageResponse + */ +export interface StorageUsageResponse { + /** + * + * @type {string} + * @memberof StorageUsageResponse + */ + 'object'?: string; + /** + * + * @type {UserDehydrated} + * @memberof StorageUsageResponse + */ + 'user'?: UserDehydrated; + /** + * + * @type {StorageObject} + * @memberof StorageUsageResponse + */ + 'casts'?: StorageObject; + /** + * + * @type {StorageObject} + * @memberof StorageUsageResponse + */ + 'reactions'?: StorageObject; + /** + * + * @type {StorageObject} + * @memberof StorageUsageResponse + */ + 'links'?: StorageObject; + /** + * + * @type {StorageObject} + * @memberof StorageUsageResponse + */ + 'verified_addresses'?: StorageObject; + /** + * + * @type {StorageObject} + * @memberof StorageUsageResponse + */ + 'username_proofs'?: StorageObject; + /** + * + * @type {StorageObject} + * @memberof StorageUsageResponse + */ + 'signers'?: StorageObject; + /** + * + * @type {number} + * @memberof StorageUsageResponse + */ + 'total_active_units'?: number; +} + From 5df7149b5ecd1f1e60e68b21eddf0e8c52d8d13e Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Thu, 23 Nov 2023 20:56:15 +0530 Subject: [PATCH 30/77] Syncup oas --- src/oas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oas b/src/oas index 63728679..30a1a322 160000 --- a/src/oas +++ b/src/oas @@ -1 +1 @@ -Subproject commit 6372867983979b899774da4abf0fcd5dfb41fe1d +Subproject commit 30a1a322df2a722c9c84bffd7cda802cbcda3a77 From 56fb315b06613cdfe3c0155574ff9dbb935b4718 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Thu, 23 Nov 2023 21:06:14 +0530 Subject: [PATCH 31/77] Generate code for update OAS --- .../v2/openapi-farcaster/.openapi-generator/FILES | 2 +- src/neynar-api/v2/openapi-farcaster/apis/user-api.ts | 8 ++++---- .../{user-bulk200-response.ts => bulk-users-response.ts} | 6 +++--- src/neynar-api/v2/openapi-farcaster/models/index.ts | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) rename src/neynar-api/v2/openapi-farcaster/models/{user-bulk200-response.ts => bulk-users-response.ts} (84%) diff --git a/src/neynar-api/v2/openapi-farcaster/.openapi-generator/FILES b/src/neynar-api/v2/openapi-farcaster/.openapi-generator/FILES index e2b3d41c..409ab90b 100644 --- a/src/neynar-api/v2/openapi-farcaster/.openapi-generator/FILES +++ b/src/neynar-api/v2/openapi-farcaster/.openapi-generator/FILES @@ -18,6 +18,7 @@ index.ts models/active-status.ts models/add-verification-req-body.ts models/bulk-follow-response.ts +models/bulk-users-response.ts models/cast-id.ts models/cast-notification-type.ts models/cast-param-type.ts @@ -71,7 +72,6 @@ models/storage-allocations-response.ts models/storage-object.ts models/storage-usage-response.ts models/update-user-req-body.ts -models/user-bulk200-response.ts models/user-dehydrated.ts models/user-profile-bio.ts models/user-profile.ts diff --git a/src/neynar-api/v2/openapi-farcaster/apis/user-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/user-api.ts index 0f540cf1..43027592 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/user-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/user-api.ts @@ -26,6 +26,8 @@ import { AddVerificationReqBody } from '../models'; // @ts-ignore import { BulkFollowResponse } from '../models'; // @ts-ignore +import { BulkUsersResponse } from '../models'; +// @ts-ignore import { ErrorRes } from '../models'; // @ts-ignore import { FollowReqBody } from '../models'; @@ -36,8 +38,6 @@ import { RemoveVerificationReqBody } from '../models'; // @ts-ignore import { UpdateUserReqBody } from '../models'; // @ts-ignore -import { UserBulk200Response } from '../models'; -// @ts-ignore import { UserResponse } from '../models'; // @ts-ignore import { UserSearchResponse } from '../models'; @@ -497,7 +497,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async userBulk(apiKey: string, fids: string, viewerFid?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async userBulk(apiKey: string, fids: string, viewerFid?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.userBulk(apiKey, fids, viewerFid, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -599,7 +599,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - userBulk(apiKey: string, fids: string, viewerFid?: number, options?: any): AxiosPromise { + userBulk(apiKey: string, fids: string, viewerFid?: number, options?: any): AxiosPromise { return localVarFp.userBulk(apiKey, fids, viewerFid, options).then((request) => request(axios, basePath)); }, /** diff --git a/src/neynar-api/v2/openapi-farcaster/models/user-bulk200-response.ts b/src/neynar-api/v2/openapi-farcaster/models/bulk-users-response.ts similarity index 84% rename from src/neynar-api/v2/openapi-farcaster/models/user-bulk200-response.ts rename to src/neynar-api/v2/openapi-farcaster/models/bulk-users-response.ts index 110d77c4..d12e186a 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/user-bulk200-response.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/bulk-users-response.ts @@ -20,13 +20,13 @@ import { User } from './user'; /** * * @export - * @interface UserBulk200Response + * @interface BulkUsersResponse */ -export interface UserBulk200Response { +export interface BulkUsersResponse { /** * * @type {Array} - * @memberof UserBulk200Response + * @memberof BulkUsersResponse */ 'users': Array; } diff --git a/src/neynar-api/v2/openapi-farcaster/models/index.ts b/src/neynar-api/v2/openapi-farcaster/models/index.ts index 5794d154..a4ee9e95 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/index.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/index.ts @@ -1,6 +1,7 @@ export * from './active-status'; export * from './add-verification-req-body'; export * from './bulk-follow-response'; +export * from './bulk-users-response'; export * from './cast'; export * from './cast-id'; export * from './cast-notification-type'; @@ -54,7 +55,6 @@ export * from './storage-object'; export * from './storage-usage-response'; export * from './update-user-req-body'; export * from './user'; -export * from './user-bulk200-response'; export * from './user-dehydrated'; export * from './user-profile'; export * from './user-profile-bio'; From fa32ae5033790113e1ad63df86b527cddbcc621f Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Thu, 23 Nov 2023 22:35:37 +0530 Subject: [PATCH 32/77] Rearrange param order of searchUser and lookUpCastByHashOrWarpcastUrl --- .../v2/openapi-farcaster/apis/cast-api.ts | 34 +++++++++---------- .../v2/openapi-farcaster/apis/user-api.ts | 34 +++++++++---------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/neynar-api/v2/openapi-farcaster/apis/cast-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/cast-api.ts index bdc36445..1caf02e0 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/cast-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/cast-api.ts @@ -47,18 +47,18 @@ export const CastApiAxiosParamCreator = function (configuration?: Configuration) * 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 {string} apiKey API key required for authentication. - * @param {CastParamType} type * @param {string} identifier Cast identifier (Its either a url or a hash) + * @param {CastParamType} type * @param {*} [options] Override http request option. * @throws {RequiredError} */ - cast: async (apiKey: string, type: CastParamType, identifier: string, options: AxiosRequestConfig = {}): Promise => { + cast: async (apiKey: string, identifier: string, type: CastParamType, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'apiKey' is not null or undefined assertParamExists('cast', 'apiKey', apiKey) - // verify required parameter 'type' is not null or undefined - assertParamExists('cast', 'type', type) // verify required parameter 'identifier' is not null or undefined assertParamExists('cast', 'identifier', identifier) + // verify required parameter 'type' is not null or undefined + assertParamExists('cast', 'type', type) const localVarPath = `/farcaster/cast`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -71,14 +71,14 @@ export const CastApiAxiosParamCreator = function (configuration?: Configuration) const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; - if (type !== undefined) { - localVarQueryParameter['type'] = type; - } - if (identifier !== undefined) { localVarQueryParameter['identifier'] = identifier; } + if (type !== undefined) { + localVarQueryParameter['type'] = type; + } + if (apiKey != null) { localVarHeaderParameter['api_key'] = String(apiKey); } @@ -238,13 +238,13 @@ export const CastApiFp = function(configuration?: Configuration) { * 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 {string} apiKey API key required for authentication. - * @param {CastParamType} type * @param {string} identifier Cast identifier (Its either a url or a hash) + * @param {CastParamType} type * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async cast(apiKey: string, type: CastParamType, identifier: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.cast(apiKey, type, identifier, options); + async cast(apiKey: string, identifier: string, type: CastParamType, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.cast(apiKey, identifier, type, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -297,13 +297,13 @@ export const CastApiFactory = function (configuration?: Configuration, basePath? * 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 {string} apiKey API key required for authentication. - * @param {CastParamType} type * @param {string} identifier Cast identifier (Its either a url or a hash) + * @param {CastParamType} type * @param {*} [options] Override http request option. * @throws {RequiredError} */ - cast(apiKey: string, type: CastParamType, identifier: string, options?: any): AxiosPromise { - return localVarFp.cast(apiKey, type, identifier, options).then((request) => request(axios, basePath)); + cast(apiKey: string, identifier: string, type: CastParamType, options?: any): AxiosPromise { + return localVarFp.cast(apiKey, identifier, type, options).then((request) => request(axios, basePath)); }, /** * Retrieve multiple casts using their respective hashes. @@ -352,14 +352,14 @@ export class CastApi extends BaseAPI { * 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 {string} apiKey API key required for authentication. - * @param {CastParamType} type * @param {string} identifier Cast identifier (Its either a url or a hash) + * @param {CastParamType} type * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CastApi */ - public cast(apiKey: string, type: CastParamType, identifier: string, options?: AxiosRequestConfig) { - return CastApiFp(this.configuration).cast(apiKey, type, identifier, options).then((request) => request(this.axios, this.basePath)); + public cast(apiKey: string, identifier: string, type: CastParamType, options?: AxiosRequestConfig) { + return CastApiFp(this.configuration).cast(apiKey, identifier, type, options).then((request) => request(this.axios, this.basePath)); } /** diff --git a/src/neynar-api/v2/openapi-farcaster/apis/user-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/user-api.ts index 43027592..ec963913 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/user-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/user-api.ts @@ -359,18 +359,18 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) * Search for Usernames * @summary Search for Usernames * @param {string} apiKey API key required for authentication. - * @param {number} viewerFid * @param {string} q + * @param {number} viewerFid * @param {*} [options] Override http request option. * @throws {RequiredError} */ - userSearch: async (apiKey: string, viewerFid: number, q: string, options: AxiosRequestConfig = {}): Promise => { + userSearch: async (apiKey: string, q: string, viewerFid: number, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'apiKey' is not null or undefined assertParamExists('userSearch', 'apiKey', apiKey) - // verify required parameter 'viewerFid' is not null or undefined - assertParamExists('userSearch', 'viewerFid', viewerFid) // verify required parameter 'q' is not null or undefined assertParamExists('userSearch', 'q', q) + // verify required parameter 'viewerFid' is not null or undefined + assertParamExists('userSearch', 'viewerFid', viewerFid) const localVarPath = `/farcaster/user/search`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -383,14 +383,14 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; - if (viewerFid !== undefined) { - localVarQueryParameter['viewer_fid'] = viewerFid; - } - if (q !== undefined) { localVarQueryParameter['q'] = q; } + if (viewerFid !== undefined) { + localVarQueryParameter['viewer_fid'] = viewerFid; + } + if (apiKey != null) { localVarHeaderParameter['api_key'] = String(apiKey); } @@ -505,13 +505,13 @@ export const UserApiFp = function(configuration?: Configuration) { * Search for Usernames * @summary Search for Usernames * @param {string} apiKey API key required for authentication. - * @param {number} viewerFid * @param {string} q + * @param {number} viewerFid * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async userSearch(apiKey: string, viewerFid: number, q: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.userSearch(apiKey, viewerFid, q, options); + async userSearch(apiKey: string, q: string, viewerFid: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.userSearch(apiKey, q, viewerFid, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } @@ -606,13 +606,13 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * Search for Usernames * @summary Search for Usernames * @param {string} apiKey API key required for authentication. - * @param {number} viewerFid * @param {string} q + * @param {number} viewerFid * @param {*} [options] Override http request option. * @throws {RequiredError} */ - userSearch(apiKey: string, viewerFid: number, q: string, options?: any): AxiosPromise { - return localVarFp.userSearch(apiKey, viewerFid, q, options).then((request) => request(axios, basePath)); + userSearch(apiKey: string, q: string, viewerFid: number, options?: any): AxiosPromise { + return localVarFp.userSearch(apiKey, q, viewerFid, options).then((request) => request(axios, basePath)); }, }; }; @@ -720,14 +720,14 @@ export class UserApi extends BaseAPI { * Search for Usernames * @summary Search for Usernames * @param {string} apiKey API key required for authentication. - * @param {number} viewerFid * @param {string} q + * @param {number} viewerFid * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof UserApi */ - public userSearch(apiKey: string, viewerFid: number, q: string, options?: AxiosRequestConfig) { - return UserApiFp(this.configuration).userSearch(apiKey, viewerFid, q, options).then((request) => request(this.axios, this.basePath)); + public userSearch(apiKey: string, q: string, viewerFid: number, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).userSearch(apiKey, q, viewerFid, options).then((request) => request(this.axios, this.basePath)); } } From cdd5dd932a9f407177287cea327e2d3931403bfa Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Thu, 23 Nov 2023 23:16:01 +0530 Subject: [PATCH 33/77] Write wrapper for v2 APIs --- src/neynar-api/neynar-api-client.ts | 28 ++-- src/neynar-api/v2/v2-client.ts | 237 ++++++++++++++-------------- 2 files changed, 134 insertions(+), 131 deletions(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index c3b7c5da..f2b0454c 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -7,26 +7,24 @@ import { OperationResponse, BulkFollowResponse, EmbeddedCast, - FeedType, - FilterType, FeedResponse, NotificationsResponse, RelevantFollowersResponse, - UserBulk200Response, UserSearchResponse, CastResponse, CastsResponse, UserResponse, + BulkUsersResponse, + FeedFeedTypeEnum, + FeedFilterTypeEnum, } from "./v2/openapi-farcaster"; import { RecentUsersResponse, UserCastLikeResponse, - User, Cast as CastV1, CastsResponse as CastsResponseV1, RecentCastsResponse, - VerificationResponseResult, MentionsAndRepliesResponse, ReactionsAndRecastsResponse, CastLikesResponse, @@ -40,7 +38,7 @@ import { AllCastsInThreadResponse, } from "./v1/openapi"; -import { FetchRelevantMints200Response } from "./v2/openapi-recommendation"; +import { RelevantMints } from "./v2/openapi-recommendation"; import { AxiosInstance } from "axios"; import { silentLogger, Logger } from "./common/logger"; import { NeynarV1APIClient } from "./v1"; @@ -49,7 +47,7 @@ import { NeynarV2APIClient } from "./v2"; export class NeynarAPIClient { private readonly logger: Logger; - public readonly clients: { + private readonly clients: { v1: NeynarV1APIClient; v2: NeynarV2APIClient; }; @@ -782,9 +780,9 @@ export class NeynarAPIClient { * */ public async fetchBulkUsers( - fids: string, + fids: number[], viewerFid?: number - ): Promise { + ): Promise { return await this.clients.v2.fetchBulkUsers(fids, viewerFid); } @@ -832,8 +830,8 @@ export class NeynarAPIClient { * @param casts - Cast hashes (Comma Separated) * */ - public async fetchBulkCasts(casts: string): Promise { - return await this.clients.v2.fetchBulkCasts(casts); + public async fetchBulkCasts(castsHashes: string[]): Promise { + return await this.clients.v2.fetchBulkCasts(castsHashes); } /** @@ -869,11 +867,11 @@ export class NeynarAPIClient { * */ public async fetchFeed( - feedType: FeedType, + feedType: FeedFeedTypeEnum, options?: { - filterType?: FilterType; + filterType?: FeedFilterTypeEnum; fid?: number; - fids?: string; + fids?: number[]; parentUrl?: string; limit?: number; cursor?: string; @@ -956,7 +954,7 @@ export class NeynarAPIClient { address: string, contractAddress: string, tokenId?: string - ): Promise { + ): Promise { return await this.clients.v2.fetchRelevantMints( address, contractAddress, diff --git a/src/neynar-api/v2/v2-client.ts b/src/neynar-api/v2/v2-client.ts index c3d91502..daa6e052 100644 --- a/src/neynar-api/v2/v2-client.ts +++ b/src/neynar-api/v2/v2-client.ts @@ -16,37 +16,29 @@ import { ErrorRes, FeedApi, UserApi, - CastApiPostCastRequest, - FeedType, - FilterType, FeedResponse, - SignerApiRegisterSignedKeyRequest, NotificationsResponse, NotificationsApi, FollowsApi, RelevantFollowersResponse, - UserApiRemoveVerificationRequest, - UserApiAddVerificationRequest, - UserApiFollowRequest, - UserApiUpdateUserRequest, - UserBulk200Response, UserSearchResponse, CastResponse, CastsResponse, UserResponse, + BulkUsersResponse, + FeedFeedTypeEnum, + FeedFilterTypeEnum, } from "./openapi-farcaster"; import axios, { AxiosError, AxiosInstance } from "axios"; import { silentLogger, Logger } from "../common/logger"; import type { SetRequired } from "type-fest"; -import { - FetchRelevantMints200Response, - NFTApi, -} from "./openapi-recommendation"; +import { NFTApi, RelevantMints } from "./openapi-recommendation"; const BASE_PATH = "https://api.neynar.com/v2"; export class NeynarV2APIClient { private readonly logger: Logger; + private readonly apiKey: string; public readonly apis: { signer: SignerApi; @@ -84,6 +76,8 @@ export class NeynarV2APIClient { ); } + this.apiKey = apiKey; + if (axiosInstance === undefined) { axiosInstance = axios.create(); } @@ -139,7 +133,7 @@ export class NeynarV2APIClient { * */ public async createSigner(): Promise { - const response = await this.apis.signer.createSigner(); + const response = await this.apis.signer.createSigner(this.apiKey); return response.data; } @@ -149,7 +143,7 @@ export class NeynarV2APIClient { * */ public async lookupSigner(signerUuid: string): Promise { - const response = await this.apis.signer.signer({ signerUuid }); + const response = await this.apis.signer.signer(this.apiKey, signerUuid); return response.data; } @@ -164,15 +158,16 @@ export class NeynarV2APIClient { deadline: number, signature: string ): Promise { - const request: SignerApiRegisterSignedKeyRequest = { - registerSignerKeyReqBody: { - signer_uuid: signerUuid, - app_fid: fid, - deadline: deadline, - signature: signature, - }, + const registerSignerKeyReqBody = { + signer_uuid: signerUuid, + app_fid: fid, + deadline: deadline, + signature: signature, }; - const response = await this.apis.signer.registerSignedKey(request); + const response = await this.apis.signer.registerSignedKey( + this.apiKey, + registerSignerKeyReqBody + ); return response.data; } @@ -187,15 +182,14 @@ export class NeynarV2APIClient { signerUuid: string, address: string ): Promise { - const request: UserApiRemoveVerificationRequest = { - removeVerificationReqBody: { - signer_uuid: signerUuid, - address, - }, + const removeVerificationReqBody = { + signer_uuid: signerUuid, + address, }; const response = await this.apis.user.farcasterUserVerificationDelete( - request + this.apiKey, + removeVerificationReqBody ); return response.data; } @@ -211,17 +205,16 @@ export class NeynarV2APIClient { blockHash: string, ethSignature: string ): Promise { - const request: UserApiAddVerificationRequest = { - addVerificationReqBody: { - signer_uuid: signerUuid, - address, - block_hash: blockHash, - eth_signature: ethSignature, - }, + const addVerificationReqBody = { + signer_uuid: signerUuid, + address, + block_hash: blockHash, + eth_signature: ethSignature, }; const response = await this.apis.user.farcasterUserVerificationPost( - request + this.apiKey, + addVerificationReqBody ); return response.data; } @@ -236,14 +229,15 @@ export class NeynarV2APIClient { signerUuid: string, targetFids: number[] ): Promise { - const request: UserApiFollowRequest = { - followReqBody: { - signer_uuid: signerUuid, - target_fids: targetFids, - }, + const followReqBody = { + signer_uuid: signerUuid, + target_fids: targetFids, }; - const response = await this.apis.user.followUser(request); + const response = await this.apis.user.followUser( + this.apiKey, + followReqBody + ); return response.data; } @@ -256,13 +250,14 @@ export class NeynarV2APIClient { signerUuid: string, targetFids: number[] ): Promise { - const request: UserApiFollowRequest = { - followReqBody: { - signer_uuid: signerUuid, - target_fids: targetFids, - }, + const followReqBody = { + signer_uuid: signerUuid, + target_fids: targetFids, }; - const response = await this.apis.user.unfollowUser(request); + const response = await this.apis.user.unfollowUser( + this.apiKey, + followReqBody + ); return response.data; } @@ -281,18 +276,18 @@ export class NeynarV2APIClient { displayName?: string; } ): Promise { - const request: UserApiUpdateUserRequest = { - updateUserReqBody: { - signer_uuid: signerUuid, - bio: options?.bio, - pfp_url: options?.pfpUrl, - url: options?.url, - username: options?.username, - display_name: options?.displayName, - }, + const updateUserReqBody = { + signer_uuid: signerUuid, + bio: options?.bio, + pfp_url: options?.pfpUrl, + url: options?.url, + username: options?.username, + display_name: options?.displayName, }; - - const response = await this.apis.user.updateUser(request); + const response = await this.apis.user.updateUser( + this.apiKey, + updateUserReqBody + ); return response.data; } @@ -302,10 +297,15 @@ export class NeynarV2APIClient { * */ public async fetchBulkUsers( - fids: string, + fids: number[], viewerFid?: number - ): Promise { - const response = await this.apis.user.userBulk({ fids, viewerFid }); + ): Promise { + const _fids = fids.join(","); + const response = await this.apis.user.userBulk( + this.apiKey, + _fids, + viewerFid + ); return response.data; } @@ -317,7 +317,7 @@ export class NeynarV2APIClient { q: string, viewerFid: number ): Promise { - const response = await this.apis.user.userSearch({ q, viewerFid }); + const response = await this.apis.user.userSearch(this.apiKey, q, viewerFid); return response.data; } @@ -328,9 +328,10 @@ export class NeynarV2APIClient { public async lookupUserByCustodyAddress( custodyAddress: string ): Promise { - const response = await this.apis.user.lookupUserByCustodyAddress({ - custodyAddress, - }); + const response = await this.apis.user.lookupUserByCustodyAddress( + this.apiKey, + custodyAddress + ); return response.data; } @@ -345,10 +346,11 @@ export class NeynarV2APIClient { castHashOrUrl: string, type: CastParamType ): Promise { - const response = await this.apis.cast.cast({ - type, - identifier: castHashOrUrl, - }); + const response = await this.apis.cast.cast( + this.apiKey, + castHashOrUrl, + type + ); return response.data; } @@ -357,10 +359,9 @@ export class NeynarV2APIClient { * See [Neynar documentation](https://docs.neynar.com/reference/casts) * */ - public async fetchBulkCasts(casts: string): Promise { - const response = await this.apis.cast.casts({ - casts, - }); + public async fetchBulkCasts(castsHashes: string[]): Promise { + const _castsHashes = castsHashes.join(","); + const response = await this.apis.cast.casts(this.apiKey, _castsHashes); return response.data; } @@ -374,15 +375,16 @@ export class NeynarV2APIClient { text: string, options?: { embeds?: EmbeddedCast[]; replyTo?: string } ): Promise { - const request: CastApiPostCastRequest = { - postCastReqBody: { - signer_uuid: signerUuid, - text: text, - embeds: options?.embeds, - parent: options?.replyTo, - }, + const postCastReqBody = { + signer_uuid: signerUuid, + text: text, + embeds: options?.embeds, + parent: options?.replyTo, }; - const response = await this.apis.cast.postCast(request); + const response = await this.apis.cast.postCast( + this.apiKey, + postCastReqBody + ); return response.data.cast; } @@ -401,13 +403,14 @@ export class NeynarV2APIClient { } else { castHash = castOrCastHash.hash; } - const body: DeleteCastReqBody = { + const deleteCastReqBody: DeleteCastReqBody = { signer_uuid: signerUuid, target_hash: castHash, }; - const response = await this.apis.cast.deleteCast({ - deleteCastReqBody: body, - }); + const response = await this.apis.cast.deleteCast( + this.apiKey, + deleteCastReqBody + ); return response.data; } @@ -419,27 +422,30 @@ export class NeynarV2APIClient { * */ public async fetchFeed( - feedType: FeedType, + feedType: FeedFeedTypeEnum, options?: { - filterType?: FilterType; + filterType?: FeedFilterTypeEnum; fid?: number; - fids?: string; + fids?: number[]; parentUrl?: string; limit?: number; cursor?: string; withRecasts?: boolean; } ): Promise { - const response = await this.apis.feed.feed({ + const _fids = options?.fids?.join(","); + + const response = await this.apis.feed.feed( + this.apiKey, feedType, - filterType: options?.filterType, - fid: options?.fid, - fids: options?.fids, - parentUrl: options?.parentUrl, - cursor: options?.cursor, - limit: options?.limit, - withRecasts: options?.withRecasts, - }); + options?.filterType, + options?.fid, + _fids, + options?.parentUrl, + options?.withRecasts, + options?.limit, + options?.cursor + ); return response.data; } @@ -466,9 +472,7 @@ export class NeynarV2APIClient { reaction_type: reaction, target: castHash, }; - const response = await this.apis.reaction.postReaction({ - reactionReqBody: body, - }); + const response = await this.apis.reaction.postReaction(this.apiKey, body); return response.data; } @@ -491,9 +495,7 @@ export class NeynarV2APIClient { reaction_type: reaction, target: castHash, }; - const response = await this.apis.reaction.deleteReaction({ - reactionReqBody: body, - }); + const response = await this.apis.reaction.deleteReaction(this.apiKey, body); return response.data; } @@ -508,11 +510,12 @@ export class NeynarV2APIClient { fid: number, options?: { cursor?: string; limit?: number } ): Promise { - const response = await this.apis.notifications.notifications({ + const response = await this.apis.notifications.notifications( + this.apiKey, fid, - cursor: options?.cursor, - limit: options?.limit, - }); + options?.limit, + options?.cursor + ); return response.data; } @@ -527,10 +530,11 @@ export class NeynarV2APIClient { targetFid: number, viewerFid: number ): Promise { - const response = await this.apis.follows.relevantFollowers({ + const response = await this.apis.follows.relevantFollowers( + this.apiKey, targetFid, - viewerFid, - }); + viewerFid + ); return response.data; } @@ -545,12 +549,13 @@ export class NeynarV2APIClient { address: string, contractAddress: string, tokenId?: string - ): Promise { - const response = await this.apis.nft.fetchRelevantMints({ + ): Promise { + const response = await this.apis.nft.fetchRelevantMints( + this.apiKey, address, contractAddress, - tokenId, - }); + tokenId + ); return response.data; } } From 29c7f03f49e18b9f5afdd7ee9f805e6e3c5b3d18 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Thu, 23 Nov 2023 23:43:54 +0530 Subject: [PATCH 34/77] Add fetchUserReactions, lookupUserStorageAllocations and lookupUserStorageUsage --- src/neynar-api/neynar-api-client.ts | 38 +++++++++++++++++++++ src/neynar-api/v2/v2-client.ts | 52 +++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index f2b0454c..0cfce002 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -17,6 +17,10 @@ import { BulkUsersResponse, FeedFeedTypeEnum, FeedFilterTypeEnum, + ReactionsResponse, + ReactionsType, + StorageAllocationsResponse, + StorageUsageResponse, } from "./v2/openapi-farcaster"; import { @@ -915,6 +919,18 @@ export class NeynarAPIClient { ); } + /** + * Fetches reactions for a given user + * See [Neynar documentation](https://docs.neynar.com/reference/reactions-user) + */ + public async fetchUserReactions( + fid: number, + type: ReactionsType, + options?: { limit?: number; cursor?: string } + ): Promise { + return await this.clients.v2.fetchUserReactions(fid, type, options); + } + // ------------ Notifications ------------ /** @@ -943,6 +959,28 @@ export class NeynarAPIClient { return await this.clients.v2.fetchRelevantFollowers(targetFid, viewerFid); } + // ------------ Storage ------------ + + /** + * Retrieves storage allocations for a given user. + * See [Neynar documentation](https://docs.neynar.com/reference/storage-allocations) + */ + public async lookupUserStorageAllocations( + fid: number + ): Promise { + return await this.clients.v2.lookupUserStorageAllocations(fid); + } + + /** + * Retrieves storage usage for a given user + * See [Neynar documentation](https://docs.neynar.com/reference/storage-usage) + */ + public async lookupUserStorageUsage( + fid: number + ): Promise { + return await this.clients.v2.lookupUserStorageUsage(fid); + } + // ------------ Recommendation ------------ /** diff --git a/src/neynar-api/v2/v2-client.ts b/src/neynar-api/v2/v2-client.ts index daa6e052..a99fd98a 100644 --- a/src/neynar-api/v2/v2-client.ts +++ b/src/neynar-api/v2/v2-client.ts @@ -28,6 +28,11 @@ import { BulkUsersResponse, FeedFeedTypeEnum, FeedFilterTypeEnum, + ReactionsType, + ReactionsResponse, + StorageApi, + StorageAllocationsResponse, + StorageUsageResponse, } from "./openapi-farcaster"; import axios, { AxiosError, AxiosInstance } from "axios"; import { silentLogger, Logger } from "../common/logger"; @@ -48,6 +53,7 @@ export class NeynarV2APIClient { feed: FeedApi; notifications: NotificationsApi; follows: FollowsApi; + storage: StorageApi; nft: NFTApi; }; @@ -106,6 +112,7 @@ export class NeynarV2APIClient { feed: new FeedApi(config, undefined, axiosInstance), notifications: new NotificationsApi(config, undefined, axiosInstance), follows: new FollowsApi(config, undefined, axiosInstance), + storage: new StorageApi(config, undefined, axiosInstance), nft: new NFTApi(config, undefined, axiosInstance), }; } @@ -499,6 +506,25 @@ export class NeynarV2APIClient { return response.data; } + /** + * Fetches reactions for a given user + * See [Neynar documentation](https://docs.neynar.com/reference/reactions-user) + */ + public async fetchUserReactions( + fid: number, + type: ReactionsType, + options?: { limit?: number; cursor?: string } + ): Promise { + const response = await this.apis.reaction.reactionsUser( + this.apiKey, + fid, + type, + options?.limit, + options?.cursor + ); + return response.data; + } + // ------------ Notifications ------------ /** @@ -538,6 +564,32 @@ export class NeynarV2APIClient { return response.data; } + // ------------ Storage ------------ + + /** + * Retrieves storage allocations for a given user. + * See [Neynar documentation](https://docs.neynar.com/reference/storage-allocations) + */ + public async lookupUserStorageAllocations( + fid: number + ): Promise { + const response = await this.apis.storage.storageAllocations( + this.apiKey, + fid + ); + return response.data; + } + + /** + * Retrieves storage usage for a given user + * See [Neynar documentation](https://docs.neynar.com/reference/storage-usage) + */ + public async lookupUserStorageUsage( + fid: number + ): Promise { + const response = await this.apis.storage.storageUsage(this.apiKey, fid); + return response.data; + } // ------------ Recommendation ------------ /** From ff583a8c669a04a24f1f88ea0e1d024a3d59a0fa Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Fri, 24 Nov 2023 10:30:24 +0530 Subject: [PATCH 35/77] Sync up OAS --- src/oas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oas b/src/oas index 30a1a322..56268ba3 160000 --- a/src/oas +++ b/src/oas @@ -1 +1 @@ -Subproject commit 30a1a322df2a722c9c84bffd7cda802cbcda3a77 +Subproject commit 56268ba3dfc99272ca40f6045a178662a59b46f8 From 8d0834d9714ccd32040bf4aee31028c63ddc7117 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Fri, 24 Nov 2023 10:59:20 +0530 Subject: [PATCH 36/77] Generate code --- .../.openapi-generator/FILES | 1 - .../v2/openapi-recommendation/models/index.ts | 1 - .../models/user-viewer-context.ts | 36 ------------------- .../v2/openapi-recommendation/models/user.ts | 20 ----------- src/oas | 2 +- 5 files changed, 1 insertion(+), 59 deletions(-) delete mode 100644 src/neynar-api/v2/openapi-recommendation/models/user-viewer-context.ts diff --git a/src/neynar-api/v2/openapi-recommendation/.openapi-generator/FILES b/src/neynar-api/v2/openapi-recommendation/.openapi-generator/FILES index ba6f4d1c..e9c6772f 100644 --- a/src/neynar-api/v2/openapi-recommendation/.openapi-generator/FILES +++ b/src/neynar-api/v2/openapi-recommendation/.openapi-generator/FILES @@ -15,5 +15,4 @@ models/relevant-mint.ts models/relevant-mints.ts models/user-profile-bio.ts models/user-profile.ts -models/user-viewer-context.ts models/user.ts diff --git a/src/neynar-api/v2/openapi-recommendation/models/index.ts b/src/neynar-api/v2/openapi-recommendation/models/index.ts index 967ace58..0bc1f2e7 100644 --- a/src/neynar-api/v2/openapi-recommendation/models/index.ts +++ b/src/neynar-api/v2/openapi-recommendation/models/index.ts @@ -5,4 +5,3 @@ export * from './relevant-mints'; export * from './user'; export * from './user-profile'; export * from './user-profile-bio'; -export * from './user-viewer-context'; diff --git a/src/neynar-api/v2/openapi-recommendation/models/user-viewer-context.ts b/src/neynar-api/v2/openapi-recommendation/models/user-viewer-context.ts deleted file mode 100644 index ed974a54..00000000 --- a/src/neynar-api/v2/openapi-recommendation/models/user-viewer-context.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* 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 UserViewerContext - */ -export interface UserViewerContext { - /** - * - * @type {number} - * @memberof UserViewerContext - */ - 'following': number; - /** - * - * @type {number} - * @memberof UserViewerContext - */ - 'followed_by': number; -} - diff --git a/src/neynar-api/v2/openapi-recommendation/models/user.ts b/src/neynar-api/v2/openapi-recommendation/models/user.ts index 0d83813f..88a72209 100644 --- a/src/neynar-api/v2/openapi-recommendation/models/user.ts +++ b/src/neynar-api/v2/openapi-recommendation/models/user.ts @@ -19,9 +19,6 @@ import { ActiveStatus } from './active-status'; // May contain unused imports in some cases // @ts-ignore import { UserProfile } from './user-profile'; -// May contain unused imports in some cases -// @ts-ignore -import { UserViewerContext } from './user-viewer-context'; /** * @@ -29,12 +26,6 @@ import { UserViewerContext } from './user-viewer-context'; * @interface User */ export interface User { - /** - * - * @type {string} - * @memberof User - */ - 'object': UserObjectEnum; /** * User identifier (unsigned integer) * @type {number} @@ -95,18 +86,7 @@ export interface User { * @memberof User */ 'activeStatus': ActiveStatus; - /** - * - * @type {UserViewerContext} - * @memberof User - */ - 'viewer_context'?: UserViewerContext; } -export const UserObjectEnum = { - User: 'user' -} as const; - -export type UserObjectEnum = typeof UserObjectEnum[keyof typeof UserObjectEnum]; diff --git a/src/oas b/src/oas index 56268ba3..7eea1bca 160000 --- a/src/oas +++ b/src/oas @@ -1 +1 @@ -Subproject commit 56268ba3dfc99272ca40f6045a178662a59b46f8 +Subproject commit 7eea1bcae0bf283bcf89b0350b152373d03b1121 From 5b9bac5325372bfd964d59be18efdb8ac7a67615 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Fri, 24 Nov 2023 11:09:24 +0530 Subject: [PATCH 37/77] Sync Oas --- src/oas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oas b/src/oas index 7eea1bca..bfdc4e2f 160000 --- a/src/oas +++ b/src/oas @@ -1 +1 @@ -Subproject commit 7eea1bcae0bf283bcf89b0350b152373d03b1121 +Subproject commit bfdc4e2fd1e5d5c4ee3e4bc6333b2dc7964a25d2 From be0df2e529dcc3f1418ae823f3b3933c39094f9c Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Fri, 24 Nov 2023 11:11:02 +0530 Subject: [PATCH 38/77] Generate code --- .../v2/openapi-recommendation/models/user.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/neynar-api/v2/openapi-recommendation/models/user.ts b/src/neynar-api/v2/openapi-recommendation/models/user.ts index 88a72209..ef211443 100644 --- a/src/neynar-api/v2/openapi-recommendation/models/user.ts +++ b/src/neynar-api/v2/openapi-recommendation/models/user.ts @@ -26,6 +26,12 @@ import { UserProfile } from './user-profile'; * @interface User */ export interface User { + /** + * + * @type {string} + * @memberof User + */ + 'object': UserObjectEnum; /** * User identifier (unsigned integer) * @type {number} @@ -88,5 +94,10 @@ export interface User { 'activeStatus': ActiveStatus; } +export const UserObjectEnum = { + User: 'user' +} as const; + +export type UserObjectEnum = typeof UserObjectEnum[keyof typeof UserObjectEnum]; From ab263f27b2653bcd6cadc0ceb47d63f9da50825b Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Fri, 24 Nov 2023 11:12:13 +0530 Subject: [PATCH 39/77] Generate code for v1 oas --- src/neynar-api/v1/openapi/models/user-profile-bio.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/neynar-api/v1/openapi/models/user-profile-bio.ts b/src/neynar-api/v1/openapi/models/user-profile-bio.ts index 6045310d..4c7f2e21 100644 --- a/src/neynar-api/v1/openapi/models/user-profile-bio.ts +++ b/src/neynar-api/v1/openapi/models/user-profile-bio.ts @@ -26,11 +26,5 @@ export interface UserProfileBio { * @memberof UserProfileBio */ 'text': string; - /** - * - * @type {Array} - * @memberof UserProfileBio - */ - 'mentionedProfiles'?: Array; } From c16776ac8db45ee64c8e18b531400189a85945fe Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Fri, 24 Nov 2023 21:28:47 +0530 Subject: [PATCH 40/77] Add docstring for v2 users and signer API methods --- src/neynar-api/neynar-api-client.ts | 215 ++++++++++++++++++++++++---- src/neynar-api/v2/v2-client.ts | 215 ++++++++++++++++++++++++---- 2 files changed, 382 insertions(+), 48 deletions(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index 0cfce002..74c25dd2 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -666,27 +666,73 @@ export class NeynarAPIClient { // ------------ Signer ------------ /** - * Creates a Signer. - * See [Neynar documentation](https://docs.neynar.com/reference/create-signer) + * Creates a Signer and returns the signer status. + * **Note**: While testing, please reuse the signer, as it costs money to approve a new signer. * + * @returns {Promise} A promise that resolves to a `Signer` object, + * representing the newly created signer with its status. + * + * @example + * // Example: Create a new signer + * client.createSigner().then(response => { + * console.log('Signer Status:', response); // Outputs the status of the newly created signer + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/create-signer). */ public async createSigner(): Promise { return await this.clients.v2.createSigner(); } /** - * Fetches an existing Signer. - * See [Neynar documentation](https://docs.neynar.com/reference/signer) + * Retrieves information status of a signer by passing in a signer_uuid + * + * @param {string} signerUuid - The unique identifier (UUID) of the signer to be fetched. + * + * @returns {Promise} A promise that resolves to a `Signer` object representing the + * requested signer, or null if no signer is found. + * + * @example + * // Example: Fetch an existing signer using its UUID + * client.lookupSigner('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec').then(response => { + * console.log('Signer Details:', response); // Outputs the details of the signer + * }); * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/signer). */ - public async lookupSigner(signerUuid: string): Promise { + public async lookupSigner(signerUuid: string): Promise { return await this.clients.v2.lookupSigner(signerUuid); } /** - * Registers a Signer with an fid. - * See [Neynar documentation](https://docs.neynar.com/reference/register-signed-key) + * Registers an app fid, deadline and a signature. + * + * Easiest way to start is to clone our repo that has sign in w/ Farcaster and writes: + * https://github.com/manan19/example-farcaster-app + * + * Read more about how writes to Farcaster work with Neynar managed signers + * https://docs.neynar.com/docs/write-to-farcaster-with-neynar-managed-signers + * + * @param {string} signerUuid - UUID of the signer. + * @param {number} fid - Application FID. + * @param {number} deadline - Unix timestamp in seconds that controls how long the signed key + * request is valid for. A 24-hour duration from now is recommended. + * @param {string} signature - Signature generated by the custody address of the app. + * Signed data includes app_fid, deadline, and signer’s public key. + * + * @returns {Promise} A promise that resolves to a `Signer` object, + * representing the registered signer with its status and approval URL. + * + * @example + * // Example: Register a signer with a specified FID, deadline, and signature + * // Following is an example of how to generate a signer, it may not work. Please fill in the correct values here. + * // Please refer https://github.com/manan19/example-farcaster-app to get started + * + * client.registerSigner('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', 18949, 1625097600, '0xe5d95c391e165dac8efea373efe301d3ea823e1f41713f8943713cbe2850566672e33ff3e17e19abb89703f650a2597f62b4fda0ce28ca15d59eb6d4e971ee531b').then(response => { + * console.log('Signer Registration:', response); // Outputs the registration status of the signer + * }); * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/register-signed-key). */ public async registerSigner( signerUuid: string, @@ -706,8 +752,21 @@ export class NeynarAPIClient { /** * Removes verification for an eth address for the user. - * See [Neynar documentation](https://docs.neynar.com/reference/remove-verification) + * (In order to delete verification signer_uuid must be approved) * + * @param {string} signerUuid - UUID of the signer. + * @param {string} address - Ethereum address for which verification is being removed. + * + * @returns {Promise} A promise that resolves to an `OperationResponse` object, + * indicating the success or failure of the operation. + * + * @example + * // Example: Remove verification for a user's Ethereum address + * client.deleteVerification('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', '0x1ea99cbed57e4020314ba3fadd7c692d2de34d5f').then(response => { + * console.log('Verification Removal Status:', response); // Outputs the status of verification removal + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/remove-verification). */ public async deleteVerification( signerUuid: string, @@ -718,8 +777,23 @@ export class NeynarAPIClient { /** * Adds verification for an eth address for the user - * See [Neynar documentation](https://docs.neynar.com/reference/add-verification) + * (In order to add verification signerUuid must be approved) * + * @param {string} signerUuid - UUID of the signer. + * @param {string} address - Ethereum address for which verification is being added. + * @param {string} blockHash - Block hash associated with the Ethereum transaction. + * @param {string} ethSignature - Ethereum signature for verification. + * + * @returns {Promise} A promise that resolves to an `OperationResponse` object, + * indicating the success or failure of the operation. + * + * @example + * // Example: Add verification for a user's Ethereum address + * client.publishVerification('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', '0x1ea99cbed57e4020314ba3fadd7c692d2de34d5f', '0x191905a9201170abb55f4c90a4cc968b44c1b71cdf3db2764b775c93e7e22b29', '0x2fc09da1f4dcb723fefb91f77932c249c418c0af00c66ed92ee1f35002c80d6a1145280c9f361d207d28447f8f7463366840d3a9309036cf6954afd1fd331beb1b').then(response => { + * console.log('Verification Addition Status:', response); // Outputs the status of verification addition + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/add-verification). */ public async publishVerification( signerUuid: string, @@ -736,11 +810,24 @@ export class NeynarAPIClient { } /** - * Follow a user. - * See [Neynar documentation](https://docs.neynar.com/reference/follow-user) + * Follows one or more users. This method allows a user, identified by their signer's UUID, + * to follow other users specified by their FIDs. + * (In order to follow a user signerUuid must be approved) + * + * @param {string} signerUuid - UUID of the signer who is following other users. + * @param {Array} targetFids - An array of FIDs representing the users to be followed. + * + * @returns {Promise} A promise that resolves to a `BulkFollowResponse` object, + * indicating the success or failure of the follow operation. + * + * @example + * // Example: Follow multiple users + * client.followUser('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', [3, 2, 1]).then(response => { + * console.log('Follow opretation status', response); // Outputs the result of the follow operation + * }); * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/follow-user). */ - public async followUser( signerUuid: string, targetFids: number[] @@ -749,9 +836,23 @@ export class NeynarAPIClient { } /** - * Unfollow a user - * See [Neynar documentation](https://docs.neynar.com/reference/unfollow-user) + * Unfollows one or more users. This method enables a user, identified by their signer's UUID, + * to unfollow other users specified by their FIDs. + * (In order to unfollow a user signerUuid must be approved) + * + * @param {string} signerUuid - UUID of the signer who is unfollowing other users. + * @param {Array} targetFids - An array of FIDs representing the users to be unfollowed. * + * @returns {Promise} A promise that resolves to a `BulkFollowResponse` object, + * indicating the success or failure of the unfollow operation. + * + * @example + * // Example: Unfollow multiple users + * client.unfollowUser('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', [3, 2, 1]).then(response => { + * console.log('Unfollow Operation Status:', response); // Outputs the result of the unfollow operation + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/unfollow-user). */ public async unfollowUser( signerUuid: string, @@ -761,9 +862,32 @@ export class NeynarAPIClient { } /** - * Update user profile - * See [Neynar documentation](https://docs.neynar.com/reference/update-user) + * Updates a user's profile. + * (In order to update profile signerUuid must be approved) * + * @param {string} signerUuid - UUID of the signer associated with the user profile. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {string} [options.bio] - A brief bio or description of the user. + * @param {string} [options.pfpUrl] - URL of the user's profile picture. + * @param {string} [options.url] - Personal URL of the user. + * @param {string} [options.username] - The user's chosen username. + * @param {string} [options.displayName] - The user's display name. + * + * @returns {Promise} A promise that resolves to an `OperationResponse` object, + * indicating the success or failure of the update operation. + * + * @example + * // Example: Update a user's profile with bio, profile picture URL, username, and display name + * client.updateUser('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', { + * bio: 'New bio here', + * pfpUrl: 'https://example.com/pfp.jpg', + * username: 'newUsername', + * displayName: 'New Display Name' + * }).then(response => { + * console.log('Profile Update Operation Status:', response); // Outputs the result of the profile update operation + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/update-user). */ public async updateUser( signerUuid: string, @@ -779,20 +903,51 @@ export class NeynarAPIClient { } /** - * Fetches information about multiple users based on FIDs - * See [Neynar documentation](https://docs.neynar.com/reference/user-bulk) + * Retrieves information about one or multiple users based on FIDs. This method allows for retrieving + * details of several users simultaneously, identified by their FIDs, with the option to provide + * information contextual to a specified viewer. + * + * @param {Array} fids - An array of FIDs representing the users whose information is being retrieved. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {number} [options.viewerFid] - The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. * + * @returns {Promise} A promise that resolves to a `BulkUsersResponse` object, + * containing information about the requested users. + * + * @example + * // Example: Fetch information about multiple users with viewer context + * client.fetchBulkUsers([2, 3], { viewerFid: 19960 }).then(response => { + * console.log('Bulk Users Information:', response); // Outputs information about the specified users + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/user-bulk). */ public async fetchBulkUsers( fids: number[], - viewerFid?: number + options: { viewerFid?: number } ): Promise { - return await this.clients.v2.fetchBulkUsers(fids, viewerFid); + return await this.clients.v2.fetchBulkUsers(fids, options); } /** - * Search User - * See [Neynar documentation](https://docs.neynar.com/reference/user-search) + * Searches for users based on a query. This method is used to find users by usernames or other + * identifiable information. The search can be contextualized to the viewer specified by `viewerFid`. + * + * @param {string} q - The query string used for searching users. + * @param {number} viewerFid - The FID of the user performing the search, + * used for providing contextual data specific to the viewer. + * + * @returns {Promise} A promise that resolves to a `UserSearchResponse` object, + * containing the results of the user search. + * + * @example + * // Example: Search for users with a specific query + * client.searchUser('ris', 19960).then(response => { + * console.log('User Search Results:', response); // Outputs the results of the user search + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/user-search). */ public async searchUser( q: string, @@ -802,8 +957,20 @@ export class NeynarAPIClient { } /** - * Lookup User by Custody Address - * See [Neynar documentation](https://docs.neynar.com/reference/lookup-user-by-custody-address) + * Looks up a user by their custody address. + * + * @param {string} custodyAddress - Custody Address associated with mnemonic + * + * @returns {Promise} A promise that resolves to a `UserResponse` object, + * containing information about the user linked to the given custody address. + * + * @example + * // Example: Look up a user by their custody address + * client.lookupUserByCustodyAddress('0xd1b702203b1b3b641a699997746bd4a12d157909').then(response => { + * console.log('User Information:', response); // Outputs the information of the user associated with the custody address + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/lookup-user-by-custody-address). */ public async lookupUserByCustodyAddress( custodyAddress: string diff --git a/src/neynar-api/v2/v2-client.ts b/src/neynar-api/v2/v2-client.ts index a99fd98a..bf252ae6 100644 --- a/src/neynar-api/v2/v2-client.ts +++ b/src/neynar-api/v2/v2-client.ts @@ -135,9 +135,19 @@ export class NeynarV2APIClient { // ------------ Signer ------------ /** - * Creates a Signer. - * See [Neynar documentation](https://docs.neynar.com/reference/create-signer) + * Creates a Signer and returns the signer status. + * **Note**: While testing, please reuse the signer, as it costs money to approve a new signer. * + * @returns {Promise} A promise that resolves to a `Signer` object, + * representing the newly created signer with its status. + * + * @example + * // Example: Create a new signer + * client.createSigner().then(response => { + * console.log('Signer Status:', response); // Outputs the status of the newly created signer + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/create-signer). */ public async createSigner(): Promise { const response = await this.apis.signer.createSigner(this.apiKey); @@ -145,19 +155,55 @@ export class NeynarV2APIClient { } /** - * Fetches an existing Signer. - * See [Neynar documentation](https://docs.neynar.com/reference/signer) + * Retrieves information status of a signer by passing in a signerUuid + * + * @param {string} signerUuid - The unique identifier (UUID) of the signer to be fetched. + * + * @returns {Promise} A promise that resolves to a `Signer` object representing the + * requested signer, or null if no signer is found. + * + * @example + * // Example: Fetch an existing signer using its UUID + * client.lookupSigner('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec').then(response => { + * console.log('Signer Details:', response); // Outputs the details of the signer + * }); * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/signer). */ - public async lookupSigner(signerUuid: string): Promise { + public async lookupSigner(signerUuid: string): Promise { const response = await this.apis.signer.signer(this.apiKey, signerUuid); return response.data; } /** - * Registers a Signer with an fid. - * See [Neynar documentation](https://docs.neynar.com/reference/register-signed-key) + * Registers an app fid, deadline and a signature. + * + * Easiest way to start is to clone our repo that has sign in w/ Farcaster and writes: + * https://github.com/manan19/example-farcaster-app + * + * Read more about how writes to Farcaster work with Neynar managed signers + * https://docs.neynar.com/docs/write-to-farcaster-with-neynar-managed-signers + * + * @param {string} signerUuid - UUID of the signer. + * @param {number} fid - Application FID. + * @param {number} deadline - Unix timestamp in seconds that controls how long the signed key + * request is valid for. A 24-hour duration from now is recommended. + * @param {string} signature - Signature generated by the custody address of the app. + * Signed data includes app_fid, deadline, and signer’s public key. + * + * @returns {Promise} A promise that resolves to a `Signer` object, + * representing the registered signer with its status and approval URL. + * + * @example + * // Example: Register a signer with a specified FID, deadline, and signature + * // Following is an example of how to generate a signer, it may not work. Please fill in the correct values here. + * // Please refer https://github.com/manan19/example-farcaster-app to get started * + * client.registerSigner('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', 18949, 1625097600, '0xe5d95c391e165dac8efea373efe301d3ea823e1f41713f8943713cbe2850566672e33ff3e17e19abb89703f650a2597f62b4fda0ce28ca15d59eb6d4e971ee531b').then(response => { + * console.log('Signer Registration:', response); // Outputs the registration status of the signer + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/register-signed-key). */ public async registerSigner( signerUuid: string, @@ -182,8 +228,21 @@ export class NeynarV2APIClient { /** * Removes verification for an eth address for the user. - * See [Neynar documentation](https://docs.neynar.com/reference/remove-verification) + * (In order to delete verification signerUuid must be approved) + * + * @param {string} signerUuid - UUID of the signer. + * @param {string} address - Ethereum address for which verification is being removed. + * + * @returns {Promise} A promise that resolves to an `OperationResponse` object, + * indicating the success or failure of the operation. * + * @example + * // Example: Remove verification for a user's Ethereum address + * client.deleteVerification('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', '0x1ea99cbed57e4020314ba3fadd7c692d2de34d5f').then(response => { + * console.log('Verification Removal Status:', response); // Outputs the status of verification removal + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/remove-verification). */ public async deleteVerification( signerUuid: string, @@ -203,8 +262,23 @@ export class NeynarV2APIClient { /** * Adds verification for an eth address for the user - * See [Neynar documentation](https://docs.neynar.com/reference/add-verification) + * (In order to add verification signerUuid must be approved) + * + * @param {string} signerUuid - UUID of the signer. + * @param {string} address - Ethereum address for which verification is being added. + * @param {string} blockHash - Block hash associated with the Ethereum transaction. + * @param {string} ethSignature - Ethereum signature for verification. * + * @returns {Promise} A promise that resolves to an `OperationResponse` object, + * indicating the success or failure of the operation. + * + * @example + * // Example: Add verification for a user's Ethereum address + * client.publishVerification('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', '0x1ea99cbed57e4020314ba3fadd7c692d2de34d5f', '0x191905a9201170abb55f4c90a4cc968b44c1b71cdf3db2764b775c93e7e22b29', '0x2fc09da1f4dcb723fefb91f77932c249c418c0af00c66ed92ee1f35002c80d6a1145280c9f361d207d28447f8f7463366840d3a9309036cf6954afd1fd331beb1b').then(response => { + * console.log('Verification Addition Status:', response); // Outputs the status of verification addition + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/add-verification). */ public async publishVerification( signerUuid: string, @@ -227,11 +301,24 @@ export class NeynarV2APIClient { } /** - * Follow a user. - * See [Neynar documentation](https://docs.neynar.com/reference/follow-user) + * Follows one or more users. This method allows a user, identified by their signer's UUID, + * to follow other users specified by their FIDs. + * (In order to follow a user signerUuid must be approved) + * + * @param {string} signerUuid - UUID of the signer who is following other users. + * @param {Array} targetFids - An array of FIDs representing the users to be followed. + * + * @returns {Promise} A promise that resolves to a `BulkFollowResponse` object, + * indicating the success or failure of the follow operation. + * + * @example + * // Example: Follow multiple users + * client.followUser('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', [3, 2, 1]).then(response => { + * console.log('Follow Opretation Status', response); // Outputs the result of the follow operation + * }); * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/follow-user). */ - public async followUser( signerUuid: string, targetFids: number[] @@ -249,9 +336,23 @@ export class NeynarV2APIClient { } /** - * Unfollow a user - * See [Neynar documentation](https://docs.neynar.com/reference/unfollow-user) + * Unfollows one or more users. This method enables a user, identified by their signer's UUID, + * to unfollow other users specified by their FIDs. + * (In order to unfollow a user signerUuid must be approved) + * + * @param {string} signerUuid - UUID of the signer who is unfollowing other users. + * @param {Array} targetFids - An array of FIDs representing the users to be unfollowed. + * + * @returns {Promise} A promise that resolves to a `BulkFollowResponse` object, + * indicating the success or failure of the unfollow operation. * + * @example + * // Example: Unfollow multiple users + * client.unfollowUser('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', [3, 2, 1]).then(response => { + * console.log('Unfollow Operation Status:', response); // Outputs the result of the unfollow operation + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/unfollow-user). */ public async unfollowUser( signerUuid: string, @@ -269,9 +370,32 @@ export class NeynarV2APIClient { } /** - * Update user profile - * See [Neynar documentation](https://docs.neynar.com/reference/update-user) + * Updates a user's profile. + * (In order to update profile signerUuid must be approved) + * + * @param {string} signerUuid - UUID of the signer associated with the user profile. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {string} [options.bio] - A brief bio or description of the user. + * @param {string} [options.pfpUrl] - URL of the user's profile picture. + * @param {string} [options.url] - Personal URL of the user. + * @param {string} [options.username] - The user's chosen username. + * @param {string} [options.displayName] - The user's display name. * + * @returns {Promise} A promise that resolves to an `OperationResponse` object, + * indicating the success or failure of the update operation. + * + * @example + * // Example: Update a user's profile with bio, profile picture URL, username, and display name + * client.updateUser('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', { + * bio: 'New bio here', + * pfpUrl: 'https://example.com/pfp.jpg', + * username: 'newUsername', + * displayName: 'New Display Name' + * }).then(response => { + * console.log('Profile Update Operation Status:', response); // Outputs the result of the profile update operation + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/update-user). */ public async updateUser( signerUuid: string, @@ -299,26 +423,57 @@ export class NeynarV2APIClient { } /** - * Fetches information about multiple users based on FIDs - * See [Neynar documentation](https://docs.neynar.com/reference/user-bulk) + * Retrieves information about one or multiple users based on FIDs. This method allows for retrieving + * details of several users simultaneously, identified by their FIDs, with the option to provide + * information contextual to a specified viewer. + * + * @param {Array} fids - An array of FIDs representing the users whose information is being retrieved. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {number} [options.viewerFid] - The FID of the user viewing this information, + * used for providing contextual data specific to the viewer. + * + * @returns {Promise} A promise that resolves to a `BulkUsersResponse` object, + * containing information about the requested users. + * + * @example + * // Example: Fetch information about multiple users with viewer context + * client.fetchBulkUsers([2, 3], { viewerFid: 19960 }).then(response => { + * console.log('Bulk Users Information:', response); // Outputs information about the specified users + * }); * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/user-bulk). */ public async fetchBulkUsers( fids: number[], - viewerFid?: number + options: { viewerFid?: number } ): Promise { const _fids = fids.join(","); const response = await this.apis.user.userBulk( this.apiKey, _fids, - viewerFid + options?.viewerFid ); return response.data; } /** - * Search User - * See [Neynar documentation](https://docs.neynar.com/reference/user-search) + * Searches for users based on a query. This method is used to find users by usernames or other + * identifiable information. The search can be contextualized to the viewer specified by `viewerFid`. + * + * @param {string} q - The query string used for searching users. + * @param {number} viewerFid - The FID of the user performing the search, + * used for providing contextual data specific to the viewer. + * + * @returns {Promise} A promise that resolves to a `UserSearchResponse` object, + * containing the results of the user search. + * + * @example + * // Example: Search for users with a specific query + * client.searchUser('ris', 19960).then(response => { + * console.log('User Search Results:', response); // Outputs the results of the user search + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/user-search). */ public async searchUser( q: string, @@ -329,8 +484,20 @@ export class NeynarV2APIClient { } /** - * Lookup User by Custody Address - * See [Neynar documentation](https://docs.neynar.com/reference/lookup-user-by-custody-address) + * Looks up a user by their custody address. + * + * @param {string} custodyAddress - Custody Address associated with mnemonic + * + * @returns {Promise} A promise that resolves to a `UserResponse` object, + * containing information about the user linked to the given custody address. + * + * @example + * // Example: Look up a user by their custody address + * client.lookupUserByCustodyAddress('0xd1b702203b1b3b641a699997746bd4a12d157909').then(response => { + * console.log('User Information:', response); // Outputs the information of the user associated with the custody address + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/lookup-user-by-custody-address). */ public async lookupUserByCustodyAddress( custodyAddress: string From 8f7fad630dfa6edcad68cc1faa5cbfb89c8f9d7a Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Fri, 24 Nov 2023 21:52:16 +0530 Subject: [PATCH 41/77] Syncup Oas --- src/oas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oas b/src/oas index bfdc4e2f..f189c971 160000 --- a/src/oas +++ b/src/oas @@ -1 +1 @@ -Subproject commit bfdc4e2fd1e5d5c4ee3e4bc6333b2dc7964a25d2 +Subproject commit f189c971a5cd3d86edfb540a2ab8deb1252e21a9 From 422083e81efbc1b7c1e499a8133c8b5bb01a074a Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Fri, 24 Nov 2023 21:57:27 +0530 Subject: [PATCH 42/77] Generate Code --- src/neynar-api/neynar-api-client.ts | 8 ++-- .../.openapi-generator/FILES | 2 + .../v2/openapi-farcaster/apis/feed-api.ts | 45 +++++++------------ .../v2/openapi-farcaster/apis/user-api.ts | 8 ++-- .../v2/openapi-farcaster/models/feed-type.ts | 31 +++++++++++++ .../openapi-farcaster/models/filter-type.ts | 32 +++++++++++++ .../v2/openapi-farcaster/models/index.ts | 2 + src/neynar-api/v2/v2-client.ts | 8 ++-- 8 files changed, 95 insertions(+), 41 deletions(-) create mode 100644 src/neynar-api/v2/openapi-farcaster/models/feed-type.ts create mode 100644 src/neynar-api/v2/openapi-farcaster/models/filter-type.ts diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index 74c25dd2..a8676353 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -15,8 +15,8 @@ import { CastsResponse, UserResponse, BulkUsersResponse, - FeedFeedTypeEnum, - FeedFilterTypeEnum, + FeedType, + FilterType, ReactionsResponse, ReactionsType, StorageAllocationsResponse, @@ -1038,9 +1038,9 @@ export class NeynarAPIClient { * */ public async fetchFeed( - feedType: FeedFeedTypeEnum, + feedType: FeedType, options?: { - filterType?: FeedFilterTypeEnum; + filterType?: FilterType; fid?: number; fids?: number[]; parentUrl?: string; diff --git a/src/neynar-api/v2/openapi-farcaster/.openapi-generator/FILES b/src/neynar-api/v2/openapi-farcaster/.openapi-generator/FILES index 409ab90b..678a3318 100644 --- a/src/neynar-api/v2/openapi-farcaster/.openapi-generator/FILES +++ b/src/neynar-api/v2/openapi-farcaster/.openapi-generator/FILES @@ -37,6 +37,8 @@ models/embed-url.ts models/embedded-cast.ts models/error-res.ts models/feed-response.ts +models/feed-type.ts +models/filter-type.ts models/follow-req-body.ts models/follow-response.ts models/follow.ts diff --git a/src/neynar-api/v2/openapi-farcaster/apis/feed-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/feed-api.ts index cf238c34..8ece6713 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/feed-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/feed-api.ts @@ -25,6 +25,10 @@ import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } fr import { ErrorRes } from '../models'; // @ts-ignore import { FeedResponse } from '../models'; +// @ts-ignore +import { FeedType } from '../models'; +// @ts-ignore +import { FilterType } from '../models'; /** * FeedApi - axios parameter creator * @export @@ -35,8 +39,8 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) * * @summary Retrieve casts based on filters * @param {string} apiKey API key required for authentication. - * @param {FeedFeedTypeEnum} feedType Defaults to following (requires fid or address). If set to filter (requires filter_type) - * @param {FeedFilterTypeEnum} [filterType] Used when feed_type=filter. Can be set to fids (requires fids) or parent_url (requires parent_url) + * @param {FeedType} feedType Defaults to following (requires fid or address). If set to filter (requires filter_type) + * @param {FilterType} [filterType] Used when feed_type=filter. Can be set to fids (requires fids) or parent_url (requires parent_url) * @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=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 @@ -46,7 +50,7 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) * @param {*} [options] Override http request option. * @throws {RequiredError} */ - feed: async (apiKey: string, feedType: FeedFeedTypeEnum, filterType?: FeedFilterTypeEnum, fid?: number, fids?: string, parentUrl?: string, withRecasts?: boolean, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { + feed: async (apiKey: string, feedType: FeedType, filterType?: FilterType, fid?: number, fids?: string, parentUrl?: string, withRecasts?: boolean, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'apiKey' is not null or undefined assertParamExists('feed', 'apiKey', apiKey) // verify required parameter 'feedType' is not null or undefined @@ -124,8 +128,8 @@ export const FeedApiFp = function(configuration?: Configuration) { * * @summary Retrieve casts based on filters * @param {string} apiKey API key required for authentication. - * @param {FeedFeedTypeEnum} feedType Defaults to following (requires fid or address). If set to filter (requires filter_type) - * @param {FeedFilterTypeEnum} [filterType] Used when feed_type=filter. Can be set to fids (requires fids) or parent_url (requires parent_url) + * @param {FeedType} feedType Defaults to following (requires fid or address). If set to filter (requires filter_type) + * @param {FilterType} [filterType] Used when feed_type=filter. Can be set to fids (requires fids) or parent_url (requires parent_url) * @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=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 @@ -135,7 +139,7 @@ export const FeedApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async feed(apiKey: string, feedType: FeedFeedTypeEnum, filterType?: FeedFilterTypeEnum, fid?: number, fids?: string, parentUrl?: string, withRecasts?: boolean, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + 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> { const localVarAxiosArgs = await localVarAxiosParamCreator.feed(apiKey, feedType, filterType, fid, fids, parentUrl, withRecasts, limit, cursor, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -153,8 +157,8 @@ export const FeedApiFactory = function (configuration?: Configuration, basePath? * * @summary Retrieve casts based on filters * @param {string} apiKey API key required for authentication. - * @param {FeedFeedTypeEnum} feedType Defaults to following (requires fid or address). If set to filter (requires filter_type) - * @param {FeedFilterTypeEnum} [filterType] Used when feed_type=filter. Can be set to fids (requires fids) or parent_url (requires parent_url) + * @param {FeedType} feedType Defaults to following (requires fid or address). If set to filter (requires filter_type) + * @param {FilterType} [filterType] Used when feed_type=filter. Can be set to fids (requires fids) or parent_url (requires parent_url) * @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=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 @@ -164,7 +168,7 @@ export const FeedApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - feed(apiKey: string, feedType: FeedFeedTypeEnum, filterType?: FeedFilterTypeEnum, fid?: number, fids?: string, parentUrl?: string, withRecasts?: boolean, limit?: number, cursor?: string, options?: any): AxiosPromise { + feed(apiKey: string, feedType: FeedType, filterType?: FilterType, fid?: number, fids?: string, parentUrl?: string, withRecasts?: boolean, limit?: number, cursor?: string, options?: any): AxiosPromise { return localVarFp.feed(apiKey, feedType, filterType, fid, fids, parentUrl, withRecasts, limit, cursor, options).then((request) => request(axios, basePath)); }, }; @@ -181,8 +185,8 @@ export class FeedApi extends BaseAPI { * * @summary Retrieve casts based on filters * @param {string} apiKey API key required for authentication. - * @param {FeedFeedTypeEnum} feedType Defaults to following (requires fid or address). If set to filter (requires filter_type) - * @param {FeedFilterTypeEnum} [filterType] Used when feed_type=filter. Can be set to fids (requires fids) or parent_url (requires parent_url) + * @param {FeedType} feedType Defaults to following (requires fid or address). If set to filter (requires filter_type) + * @param {FilterType} [filterType] Used when feed_type=filter. Can be set to fids (requires fids) or parent_url (requires parent_url) * @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=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 @@ -193,25 +197,8 @@ export class FeedApi extends BaseAPI { * @throws {RequiredError} * @memberof FeedApi */ - public feed(apiKey: string, feedType: FeedFeedTypeEnum, filterType?: FeedFilterTypeEnum, fid?: number, fids?: string, parentUrl?: string, withRecasts?: boolean, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + 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)); } } -/** - * @export - */ -export const FeedFeedTypeEnum = { - Following: 'following', - Filter: 'filter' -} as const; -export type FeedFeedTypeEnum = typeof FeedFeedTypeEnum[keyof typeof FeedFeedTypeEnum]; -/** - * @export - */ -export const FeedFilterTypeEnum = { - Fids: 'fids', - ParentUrl: 'parent_url', - GlobalTrending: 'global_trending' -} as const; -export type FeedFilterTypeEnum = typeof FeedFilterTypeEnum[keyof typeof FeedFilterTypeEnum]; diff --git a/src/neynar-api/v2/openapi-farcaster/apis/user-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/user-api.ts index ec963913..ec829efb 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/user-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/user-api.ts @@ -48,7 +48,7 @@ import { UserSearchResponse } from '../models'; export const UserApiAxiosParamCreator = function (configuration?: Configuration) { return { /** - * Removes verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) + * Removes verification for an eth address for the user \\ (In order to delete verification `signer_uuid` must be approved) * @summary Removes verification for an eth address for the user * @param {string} apiKey API key required for authentication. * @param {RemoveVerificationReqBody} removeVerificationReqBody @@ -417,7 +417,7 @@ export const UserApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = UserApiAxiosParamCreator(configuration) return { /** - * Removes verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) + * Removes verification for an eth address for the user \\ (In order to delete verification `signer_uuid` must be approved) * @summary Removes verification for an eth address for the user * @param {string} apiKey API key required for authentication. * @param {RemoveVerificationReqBody} removeVerificationReqBody @@ -525,7 +525,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? const localVarFp = UserApiFp(configuration) return { /** - * Removes verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) + * Removes verification for an eth address for the user \\ (In order to delete verification `signer_uuid` must be approved) * @summary Removes verification for an eth address for the user * @param {string} apiKey API key required for authentication. * @param {RemoveVerificationReqBody} removeVerificationReqBody @@ -625,7 +625,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? */ export class UserApi extends BaseAPI { /** - * Removes verification for an eth address for the user \\ (In order to add verification `signer_uuid` must be approved) + * Removes verification for an eth address for the user \\ (In order to delete verification `signer_uuid` must be approved) * @summary Removes verification for an eth address for the user * @param {string} apiKey API key required for authentication. * @param {RemoveVerificationReqBody} removeVerificationReqBody diff --git a/src/neynar-api/v2/openapi-farcaster/models/feed-type.ts b/src/neynar-api/v2/openapi-farcaster/models/feed-type.ts new file mode 100644 index 00000000..d68c05b7 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/feed-type.ts @@ -0,0 +1,31 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster 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 + * @enum {string} + */ + +export const FeedType = { + Following: 'following', + Filter: 'filter' +} as const; + +export type FeedType = typeof FeedType[keyof typeof FeedType]; + + + diff --git a/src/neynar-api/v2/openapi-farcaster/models/filter-type.ts b/src/neynar-api/v2/openapi-farcaster/models/filter-type.ts new file mode 100644 index 00000000..e46fa7d3 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/filter-type.ts @@ -0,0 +1,32 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster 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 + * @enum {string} + */ + +export const FilterType = { + Fids: 'fids', + ParentUrl: 'parent_url', + GlobalTrending: 'global_trending' +} as const; + +export type FilterType = typeof FilterType[keyof typeof FilterType]; + + + diff --git a/src/neynar-api/v2/openapi-farcaster/models/index.ts b/src/neynar-api/v2/openapi-farcaster/models/index.ts index a4ee9e95..56c7ddcc 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/index.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/index.ts @@ -20,6 +20,8 @@ export * from './embed-url'; export * from './embedded-cast'; export * from './error-res'; export * from './feed-response'; +export * from './feed-type'; +export * from './filter-type'; export * from './follow'; export * from './follow-req-body'; export * from './follow-response'; diff --git a/src/neynar-api/v2/v2-client.ts b/src/neynar-api/v2/v2-client.ts index bf252ae6..91c4471a 100644 --- a/src/neynar-api/v2/v2-client.ts +++ b/src/neynar-api/v2/v2-client.ts @@ -26,8 +26,8 @@ import { CastsResponse, UserResponse, BulkUsersResponse, - FeedFeedTypeEnum, - FeedFilterTypeEnum, + FeedType, + FilterType, ReactionsType, ReactionsResponse, StorageApi, @@ -596,9 +596,9 @@ export class NeynarV2APIClient { * */ public async fetchFeed( - feedType: FeedFeedTypeEnum, + feedType: FeedType, options?: { - filterType?: FeedFilterTypeEnum; + filterType?: FilterType; fid?: number; fids?: number[]; parentUrl?: string; From 45e3ffe174fefd9f9949aa811b86747b8e6392c1 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Fri, 24 Nov 2023 22:25:54 +0530 Subject: [PATCH 43/77] Fix url parmas for updateUser --- src/neynar-api/neynar-api-client.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index a8676353..e3a18f94 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -893,10 +893,10 @@ export class NeynarAPIClient { signerUuid: string, options?: { bio?: string; - pfp_url?: string; + pfpUrl?: string; url?: string; username?: string; - display_name?: string; + displayName?: string; } ): Promise { return await this.clients.v2.updateUser(signerUuid, options); From d3b5e74e94649170858e7c31f4aeec0861ca01a8 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Fri, 24 Nov 2023 23:32:45 +0530 Subject: [PATCH 44/77] Add docstring for Cast methods --- src/neynar-api/neynar-api-client.ts | 86 ++++++++++++++++++++++++++--- src/neynar-api/v2/v2-client.ts | 85 +++++++++++++++++++++++++--- 2 files changed, 154 insertions(+), 17 deletions(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index e3a18f94..c03477cb 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -981,9 +981,28 @@ export class NeynarAPIClient { // ------------ 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) + * Retrieves information about an individual cast by passing in a Warpcast web URL or cast hash. * + * @param {string} castHashOrUrl - The identifier for the cast, which can be either a cast hash or a Warpcast web URL. + * @param {CastParamType} type - The parameter type indicating whether the identifier is a hash or a URL. + * + * @returns {Promise} A promise that resolves to a `CastResponse` object, + * containing information about the specified cast. + * + * @example + * import { CastParamType } from "@neynar/nodejs-sdk/build/neynar-api/neynar-v2-api"; + * + * // Example: Retrieve information for a cast using its hash + * client.lookUpCastByHashOrWarpcastUrl('0xfe90f9de682273e05b201629ad2338bdcd89b6be', CastParamType.Hash).then(response => { + * console.log('Cast Information:', response); // Outputs information about the cast + * }); + * + * // Example: Retrieve information for a cast using its Warpcast URL + * client.lookUpCastByHashOrWarpcastUrl('https://warpcast.com/rish/0x9288c1', CastParamType.Url).then(response => { + * console.log('Cast Information:', response); // Outputs information about the cast + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/cast). */ public async lookUpCastByHashOrWarpcastUrl( castHashOrUrl: string, @@ -996,19 +1015,54 @@ 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) + * Retrieves information about multiple casts using an array of their hashes. This method is useful + * for fetching details of several casts at once, identified by their unique hashes. + * + * @param {Array} castsHashes - An array of strings representing the hashes of the casts + * to be retrieved. + * + * @returns {Promise} A promise that resolves to a `CastsResponse` object, + * containing information about the requested casts. + * + * @example + * // Example: Fetch information about multiple casts using their hashes + * client.fetchBulkCasts(['0xa896906a5e397b4fec247c3ee0e9e4d4990b8004','0x27ff810f7f718afd8c40be236411f017982e0994']).then(response => { + * console.log('Bulk Casts Information:', response); // Outputs information about the specified casts + * }); * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/casts). */ public async fetchBulkCasts(castsHashes: string[]): Promise { return await this.clients.v2.fetchBulkCasts(castsHashes); } /** - * Publishes a cast for the currently authenticated user. - * See [Neynar documentation](https://docs.neynar.com/reference/post-cast) + * Publishes a cast for the currently authenticated user. This method allows users to post + * content, including text and embeds, and can also be used to reply to existing casts. + * (In order to publish a cast signerUuid must be approved) * + * @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} [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. + * + * @returns {Promise} A promise that resolves to a `PostCastResponseCast` object, + * representing the published cast. + * + * @example + * // Example: Publish a simple cast + * client.publishCast('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', 'Testing publishCast() method').then(response => { + * console.log('Published Cast:', response); // Outputs the published cast + * }); + * // Example: Reply to a Cast + * client.publishCast('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', 'Testing publishCast() method', { + * replyTo: '0x9e95c380791fce11ffbb14b2ea458b233161bafd', + * }).then(response => { + * console.log('Published Cast:', response); // Outputs the published reply cast with embeds + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/post-cast). */ public async publishCast( signerUuid: string, @@ -1019,9 +1073,23 @@ export class NeynarAPIClient { } /** - * Delete a cast. - * See [Neynar documentation](https://docs.neynar.com/reference/delete-cast) + * Deletes an existing cast. This method is used to remove a cast, identified by its hash, + * from the system. + * (In order to delete a cast signerUuid must be approved) + * + * @param {string} signerUuid - UUID of the signer associated with the user who is deleting the cast. + * @param {Cast | string} castOrCastHash - The Cast object or its hash that is to be deleted. + * + * @returns {Promise} A promise that resolves to an `OperationResponse` object, + * indicating the success or failure of the deletion operation. + * + * @example + * // Example: Delete a cast using its hash + * client.deleteCast('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', '0x1ea99cbed57e4020314ba3fadd7c692d2de34d5f').then(response => { + * console.log('Cast Deletion:', response); // Outputs the result of the cast deletion operation + * }); * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/delete-cast). */ public async deleteCast( signerUuid: string, diff --git a/src/neynar-api/v2/v2-client.ts b/src/neynar-api/v2/v2-client.ts index 91c4471a..7943f7e0 100644 --- a/src/neynar-api/v2/v2-client.ts +++ b/src/neynar-api/v2/v2-client.ts @@ -512,9 +512,28 @@ export class NeynarV2APIClient { // ------------ 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) + * Retrieves information about an individual cast by passing in a Warpcast web URL or cast hash. * + * @param {string} castHashOrUrl - The identifier for the cast, which can be either a cast hash or a Warpcast web URL. + * @param {CastParamType} type - The parameter type indicating whether the identifier is a hash or a URL. + * + * @returns {Promise} A promise that resolves to a `CastResponse` object, + * containing information about the specified cast. + * + * @example + * import { CastParamType } from "@neynar/nodejs-sdk/build/neynar-api/neynar-v2-api"; + * + * // Example: Retrieve information for a cast using its hash + * client.lookUpCastByHashOrWarpcastUrl('0xfe90f9de682273e05b201629ad2338bdcd89b6be', CastParamType.Hash).then(response => { + * console.log('Cast Information:', response); // Outputs information about the cast + * }); + * + * // Example: Retrieve information for a cast using its Warpcast URL + * client.lookUpCastByHashOrWarpcastUrl('https://warpcast.com/rish/0x9288c1', CastParamType.Url).then(response => { + * console.log('Cast Information:', response); // Outputs information about the cast + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/cast). */ public async lookUpCastByHashOrWarpcastUrl( castHashOrUrl: string, @@ -529,9 +548,22 @@ export class NeynarV2APIClient { } /** - * Gets information about an array of casts. - * See [Neynar documentation](https://docs.neynar.com/reference/casts) + * Retrieves information about multiple casts using an array of their hashes. This method is useful + * for fetching details of several casts at once, identified by their unique hashes. + * + * @param {Array} castsHashes - An array of strings representing the hashes of the casts + * to be retrieved. + * + * @returns {Promise} A promise that resolves to a `CastsResponse` object, + * containing information about the requested casts. + * + * @example + * // Example: Fetch information about multiple casts using their hashes + * client.fetchBulkCasts(['0xa896906a5e397b4fec247c3ee0e9e4d4990b8004','0x27ff810f7f718afd8c40be236411f017982e0994']).then(response => { + * console.log('Bulk Casts Information:', response); // Outputs information about the specified casts + * }); * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/casts). */ public async fetchBulkCasts(castsHashes: string[]): Promise { const _castsHashes = castsHashes.join(","); @@ -540,9 +572,32 @@ export class NeynarV2APIClient { } /** - * Publishes a cast for the currently authenticated user. - * See [Neynar documentation](https://docs.neynar.com/reference/post-cast) + * Publishes a cast for the currently authenticated user. This method allows users to post + * content, including text and embeds, and can also be used to reply to existing casts. + * (In order to publish a cast signerUuid must be approved) * + * @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} [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. + * + * @returns {Promise} A promise that resolves to a `PostCastResponseCast` object, + * representing the published cast. + * + * @example + * // Example: Publish a simple cast + * client.publishCast('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', 'Testing publishCast() method').then(response => { + * console.log('Published Cast:', response); // Outputs the published cast + * }); + * // Example: Reply to a Cast + * client.publishCast('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', 'Testing publishCast() method', { + * replyTo: '0x9e95c380791fce11ffbb14b2ea458b233161bafd', + * }).then(response => { + * console.log('Published Cast:', response); // Outputs the published reply cast with embeds + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/post-cast). */ public async publishCast( signerUuid: string, @@ -563,9 +618,23 @@ export class NeynarV2APIClient { } /** - * Delete a cast. - * See [Neynar documentation](https://docs.neynar.com/reference/delete-cast) + * Deletes an existing cast. This method is used to remove a cast, identified by its hash, + * from the system. + * (In order to delete a cast signerUuid must be approved) + * + * @param {string} signerUuid - UUID of the signer associated with the user who is deleting the cast. + * @param {Cast | string} castOrCastHash - The Cast object or its hash that is to be deleted. + * + * @returns {Promise} A promise that resolves to an `OperationResponse` object, + * indicating the success or failure of the deletion operation. + * + * @example + * // Example: Delete a cast using its hash + * client.deleteCast('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', '0x1ea99cbed57e4020314ba3fadd7c692d2de34d5f').then(response => { + * console.log('Cast Deletion:', response); // Outputs the result of the cast deletion operation + * }); * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/delete-cast). */ public async deleteCast( signerUuid: string, From fa4deaeae375d2246f65f1dda30f5d8ddc591044 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Sat, 25 Nov 2023 00:04:07 +0530 Subject: [PATCH 45/77] Add doc string for fetchFeed method --- src/neynar-api/neynar-api-client.ts | 25 +++++++++++++++++++++++-- src/neynar-api/v2/v2-client.ts | 25 +++++++++++++++++++++++-- 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index c03477cb..09d602a8 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -1101,9 +1101,30 @@ export class NeynarAPIClient { // ------------ Feed ------------ /** - * Get reverse chronological feed page for a user based on their follow graph. - * See [Neynar documentation](https://docs.neynar.com/reference/feed) + * Retrieves a reverse chronological feed for a user based on their follow graph. + * This method allows users to fetch casts in their feed based on various filters, such as + * following a specific user, a list of users, or content under a specific parent URL. + * + * @param {FeedType} feedType - Type of the feed, defaults to 'following' but can be set to 'filter' for specific filtering. + * @param {Object} [options] - Optional parameters for customizing the feed. + * @param {FilterType} [options.filterType] - Used when feedType is 'filter'. Determines the filter criteria (e.g., 'fids' or 'parent_url'). + * @param {number} [options.fid] - FID of the user whose feed is being created. Required unless a 'filterType' is provided. + * @param {Array} [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 {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. + * + * @returns {Promise} A promise that resolves to a `FeedResponse` object, + * containing the requested feed data. * + * @example + * // Example: Retrieve a user's feed based on their following graph with specific limits + * client.fetchFeed('following', { fid: 3, limit: 50, withRecasts: true }).then(response => { + * console.log('User Feed:', response); // Outputs the user's feed + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/feed). */ public async fetchFeed( feedType: FeedType, diff --git a/src/neynar-api/v2/v2-client.ts b/src/neynar-api/v2/v2-client.ts index 7943f7e0..f8cd96b3 100644 --- a/src/neynar-api/v2/v2-client.ts +++ b/src/neynar-api/v2/v2-client.ts @@ -660,9 +660,30 @@ export class NeynarV2APIClient { // ------------ Feed ------------ /** - * Get reverse chronological feed page for a user based on their follow graph. - * See [Neynar documentation](https://docs.neynar.com/reference/feed) + * Retrieves a reverse chronological feed for a user based on their follow graph. + * This method allows users to fetch casts in their feed based on various filters, such as + * following a specific user, a list of users, or content under a specific parent URL. + * + * @param {FeedType} feedType - Type of the feed, defaults to 'following' but can be set to 'filter' for specific filtering. + * @param {Object} [options] - Optional parameters for customizing the feed. + * @param {FilterType} [options.filterType] - Used when feedType is 'filter'. Determines the filter criteria (e.g., 'fids' or 'parent_url'). + * @param {number} [options.fid] - FID of the user whose feed is being created. Required unless a 'filterType' is provided. + * @param {Array} [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 {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. + * + * @returns {Promise} A promise that resolves to a `FeedResponse` object, + * containing the requested feed data. * + * @example + * // Example: Retrieve a user's feed based on their following graph with specific limits + * client.fetchFeed('following', { fid: 3, limit: 50, withRecasts: true }).then(response => { + * console.log('User Feed:', response); // Outputs the user's feed + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/feed). */ public async fetchFeed( feedType: FeedType, From 3bef33e096002040f9e2193b107dcf6b535c77c0 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Sat, 25 Nov 2023 00:37:07 +0530 Subject: [PATCH 46/77] Add doc string for Reactions API methods --- src/neynar-api/neynar-api-client.ts | 72 +++++++++++++++++++++++++--- src/neynar-api/v2/v2-client.ts | 73 ++++++++++++++++++++++++++--- 2 files changed, 133 insertions(+), 12 deletions(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index 09d602a8..a94c7648 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -990,7 +990,7 @@ export class NeynarAPIClient { * containing information about the specified cast. * * @example - * import { CastParamType } from "@neynar/nodejs-sdk/build/neynar-api/neynar-v2-api"; + * import { CastParamType } from "@neynar/nodejs-sdk/build/neynar-api/v2"; * * // Example: Retrieve information for a cast using its hash * client.lookUpCastByHashOrWarpcastUrl('0xfe90f9de682273e05b201629ad2338bdcd89b6be', CastParamType.Hash).then(response => { @@ -1144,9 +1144,26 @@ export class NeynarAPIClient { // ------------ Reaction ------------ /** - * React to a cast. - * See [Neynar documentation](https://docs.neynar.com/reference/post-reaction) + * Posts a reaction (like or recast) to a given cast. + * (In order to post a reaction signerUuid must be approved) * + * @param {string} signerUuid - UUID of the signer expressing the reaction. + * @param {ReactionType} reaction - The type of reaction being expressed (like or recast). + * @param {Cast | string} castOrCastHash - The Cast object or its hash to which the reaction is targeted. + * + * @returns {Promise} A promise that resolves to an `OperationResponse` object, + * indicating the success or failure of the reaction post. + * + * @example + * + * import { ReactionType } from "@neynar/nodejs-sdk/build/neynar-api/v2"; + * + * // Example: Post a 'like' reaction to a cast + * client.publishReactionToCast('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', ReactionType.Like, '0x1ea99cbed57e4020314ba3fadd7c692d2de34d5f').then(response => { + * console.log('Publish Reaction Operation Status:', response); // Outputs the status of the reaction post + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/post-reaction). */ public async publishReactionToCast( signerUuid: string, @@ -1161,7 +1178,26 @@ export class NeynarAPIClient { } /** - * Remove a reaction to a cast. See [Neynar documentation](https://docs.neynar.com/reference/delete-reaction) + * Removes a reaction (like or recast) from a given cast. + * (In order to delete a reaction signerUuid must be approved) + * + * @param {string} signerUuid - UUID of the signer who is removing the reaction. + * @param {ReactionType} reaction - The type of reaction being removed. + * @param {Cast | string} castOrCastHash - The Cast object or its hash from which the reaction is to be removed. + * + * @returns {Promise} A promise that resolves to an `OperationResponse` object, + * indicating the success or failure of the reaction removal. + * + * @example + * + * import { ReactionType } from "@neynar/nodejs-sdk/build/neynar-api/v2"; + * + * // Example: Remove a 'like' reaction from a cast + * client.deleteReactionFromCast('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', ReactionType.Like, '0x1ea99cbed57e4020314ba3fadd7c692d2de34d5f').then(response => { + * console.log('Delete Reaction Operation Status:', response); // Outputs the status of the reaction removal operation + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/delete-reaction). */ public async deleteReactionFromCast( signerUuid: string, @@ -1176,8 +1212,32 @@ export class NeynarAPIClient { } /** - * Fetches reactions for a given user - * See [Neynar documentation](https://docs.neynar.com/reference/reactions-user) + * Fetches reactions (likes, recasts, or all) for a given user. This method allows retrieving + * the reactions associated with a user's casts, specified by the user's FID. + * + * @param {number} fid - The FID of the user whose reactions are being fetched. + * @param {ReactionsType} type - The type of reaction to fetch (likes, recasts, or all). + * @param {Object} [options] - Optional parameters for customizing the response. + * @param {number} [options.limit] - Limits the number of results. Default is 25, with a maximum of 100. + * @param {string} [options.cursor] - Pagination cursor for the next set of results, + * omit this parameter for the initial request. + * + * @returns {Promise} A promise that resolves to a `ReactionsResponse` object, + * containing the reactions associated with the user's casts. + * + * @example + * + * import { ReactionsType } from "@neynar/nodejs-sdk/build/neynar-api/v2"; + * + * // Example: Fetch a user's reactions + * client.fetchUserReactions(3, ReactionsType.All, { + * limit: 50, + * // cursor: "nextPageCursor" // Omit this parameter for the initial request + * }).then(response => { + * console.log('User Reactions:', response); // Outputs the user's reactions + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/reactions-user). */ public async fetchUserReactions( fid: number, diff --git a/src/neynar-api/v2/v2-client.ts b/src/neynar-api/v2/v2-client.ts index f8cd96b3..50871d80 100644 --- a/src/neynar-api/v2/v2-client.ts +++ b/src/neynar-api/v2/v2-client.ts @@ -521,7 +521,7 @@ export class NeynarV2APIClient { * containing information about the specified cast. * * @example - * import { CastParamType } from "@neynar/nodejs-sdk/build/neynar-api/neynar-v2-api"; + * import { CastParamType } from "@neynar/nodejs-sdk/build/neynar-api/v2"; * * // Example: Retrieve information for a cast using its hash * client.lookUpCastByHashOrWarpcastUrl('0xfe90f9de682273e05b201629ad2338bdcd89b6be', CastParamType.Hash).then(response => { @@ -716,9 +716,26 @@ export class NeynarV2APIClient { // ------------ Reaction ------------ /** - * React to a cast. - * See [Neynar documentation](https://docs.neynar.com/reference/post-reaction) + * Posts a reaction (like or recast) to a given cast. + * (In order to post a reaction signerUuid must be approved) * + * @param {string} signerUuid - UUID of the signer expressing the reaction. + * @param {ReactionType} reaction - The type of reaction being expressed (like or recast). + * @param {Cast | string} castOrCastHash - The Cast object or its hash to which the reaction is targeted. + * + * @returns {Promise} A promise that resolves to an `OperationResponse` object, + * indicating the success or failure of the reaction post. + * + * @example + * + * import { ReactionType } from "@neynar/nodejs-sdk/build/neynar-api/v2"; + * + * // Example: Post a 'like' reaction to a cast + * client.publishReactionToCast('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', ReactionType.Like, '0x1ea99cbed57e4020314ba3fadd7c692d2de34d5f').then(response => { + * console.log('Publish Reaction Operation Status:', response); // Outputs the status of the reaction post + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/post-reaction). */ public async publishReactionToCast( signerUuid: string, @@ -741,7 +758,27 @@ export class NeynarV2APIClient { } /** - * Remove a reaction to a cast. See [Neynar documentation](https://docs.neynar.com/reference/delete-reaction) + * Removes a reaction (like or recast) from a given cast. + * + * (In order to delete a reaction signerUuid must be approved) + * + * @param {string} signerUuid - UUID of the signer who is removing the reaction. + * @param {ReactionType} reaction - The type of reaction being removed. + * @param {Cast | string} castOrCastHash - The Cast object or its hash from which the reaction is to be removed. + * + * @returns {Promise} A promise that resolves to an `OperationResponse` object, + * indicating the success or failure of the reaction removal. + * + * @example + * + * import { ReactionType } from "@neynar/nodejs-sdk/build/neynar-api/v2"; + * + * // Example: Remove a 'like' reaction from a cast + * client.deleteReactionFromCast('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', ReactionType.Like, '0x1ea99cbed57e4020314ba3fadd7c692d2de34d5f').then(response => { + * console.log('Delete Reaction Operation Status:', response); // Outputs the status of the reaction removal operation + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/delete-reaction). */ public async deleteReactionFromCast( signerUuid: string, @@ -764,8 +801,32 @@ export class NeynarV2APIClient { } /** - * Fetches reactions for a given user - * See [Neynar documentation](https://docs.neynar.com/reference/reactions-user) + * Fetches reactions (likes, recasts, or all) for a given user. This method allows retrieving + * the reactions associated with a user's casts, specified by the user's FID. + * + * @param {number} fid - The FID of the user whose reactions are being fetched. + * @param {ReactionsType} type - The type of reaction to fetch (likes, recasts, or all). + * @param {Object} [options] - Optional parameters for customizing the response. + * @param {number} [options.limit] - Limits the number of results. Default is 25, with a maximum of 100. + * @param {string} [options.cursor] - Pagination cursor for the next set of results, + * omit this parameter for the initial request. + * + * @returns {Promise} A promise that resolves to a `ReactionsResponse` object, + * containing the reactions associated with the user's casts. + * + * @example + * + * import { ReactionsType } from "@neynar/nodejs-sdk/build/neynar-api/v2"; + * + * // Example: Fetch a user's reactions + * client.fetchUserReactions(3, ReactionsType.All, { + * limit: 50, + * // cursor: "nextPageCursor" // Omit this parameter for the initial request + * }).then(response => { + * console.log('User Reactions:', response); // Outputs the user's reactions + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/reactions-user). */ public async fetchUserReactions( fid: number, From 7553f13180f87e1b47ae0419eba9f1fdfb560478 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Sat, 25 Nov 2023 00:42:19 +0530 Subject: [PATCH 47/77] Add doc string for v2 notifications API methods --- src/neynar-api/neynar-api-client.ts | 23 +++++++++++++++++++++-- src/neynar-api/v2/v2-client.ts | 25 ++++++++++++++++++++++--- 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index a94c7648..cf18df66 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -1250,9 +1250,28 @@ export class NeynarAPIClient { // ------------ Notifications ------------ /** - * Returns a list of notifications for a specific FID in reverse chronological order. - * See [Neynar documentation](https://docs.neynar.com/reference/notifications) + * Retrieves a list of notifications for a specific FID in reverse chronological order. + * This method is useful for obtaining a user's notifications, keeping them updated on various interactions and updates. * + * @param {number} fid - The FID of the user whose notifications are being fetched. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {number} [options.limit] - Number of results to retrieve (default 25, max 50). + * @param {string} [options.cursor] - Pagination cursor for the next set of results, + * omit this parameter for the initial request. + * + * @returns {Promise} A promise that resolves to a `NotificationsResponse` object, + * containing the user's notifications. + * + * @example + * // Example: Fetch the first 30 notifications for a user + * client.fetchAllNotifications(3, { + * limit: 30, + * // cursor: "nextPageCursor" // Omit this parameter for the initial request + * }).then(response => { + * console.log('User Notifications:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/notifications). */ public async fetchAllNotifications( fid: number, diff --git a/src/neynar-api/v2/v2-client.ts b/src/neynar-api/v2/v2-client.ts index 50871d80..4d91077c 100644 --- a/src/neynar-api/v2/v2-client.ts +++ b/src/neynar-api/v2/v2-client.ts @@ -759,7 +759,7 @@ export class NeynarV2APIClient { /** * Removes a reaction (like or recast) from a given cast. - * + * * (In order to delete a reaction signerUuid must be approved) * * @param {string} signerUuid - UUID of the signer who is removing the reaction. @@ -846,9 +846,28 @@ export class NeynarV2APIClient { // ------------ Notifications ------------ /** - * Returns a list of notifications for a specific FID in reverse chronological order. - * See [Neynar documentation](https://docs.neynar.com/reference/notifications) + * Retrieves a list of notifications for a specific FID in reverse chronological order. + * This method is useful for obtaining a user's notifications, keeping them updated on various interactions and updates. + * + * @param {number} fid - The FID of the user whose notifications are being fetched. + * @param {Object} [options] - Optional parameters to tailor the request. + * @param {number} [options.limit] - Number of results to retrieve (default 25, max 50). + * @param {string} [options.cursor] - Pagination cursor for the next set of results, + * omit this parameter for the initial request. + * + * @returns {Promise} A promise that resolves to a `NotificationsResponse` object, + * containing the user's notifications. + * + * @example + * // Example: Fetch the first 30 notifications for a user + * client.fetchAllNotifications(3, { + * limit: 30, + * // cursor: "nextPageCursor" // Omit this parameter for the initial request + * }).then(response => { + * console.log('User Notifications:', response); + * }); * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/notifications). */ public async fetchAllNotifications( fid: number, From 1699d5f18883a001e3e947c76352e13c9ad173e4 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Sat, 25 Nov 2023 00:47:22 +0530 Subject: [PATCH 48/77] Add doc string for v2 Follows API method --- src/neynar-api/neynar-api-client.ts | 16 ++++++++++++++-- src/neynar-api/v2/v2-client.ts | 18 +++++++++++++++--- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index cf18df66..180a08b0 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -1283,9 +1283,21 @@ export class NeynarAPIClient { // ------------ Follows ------------ /** - * Returns a list of relevant followers for a specific FID. - * See [Neynar documentation](https://docs.neynar.com/reference/relevant-followers) + * Retrieves a list of relevant followers for a specific FID. * + * @param {number} targetFid - The FID of the user whose relevant followers are being fetched. + * @param {number} viewerFid - The FID of the viewer who is looking at the target user's profile. + * + * @returns {Promise} A promise that resolves to a `RelevantFollowersResponse` object, + * containing a list of relevant followers for the specified user. + * + * @example + * // Example: Retrieve relevant followers for a user from the perspective of another user + * client.fetchRelevantFollowers(3, 19960).then(response => { + * console.log('Relevant Followers:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/relevant-followers). */ public async fetchRelevantFollowers( targetFid: number, diff --git a/src/neynar-api/v2/v2-client.ts b/src/neynar-api/v2/v2-client.ts index 4d91077c..355a888b 100644 --- a/src/neynar-api/v2/v2-client.ts +++ b/src/neynar-api/v2/v2-client.ts @@ -860,7 +860,7 @@ export class NeynarV2APIClient { * * @example * // Example: Fetch the first 30 notifications for a user - * client.fetchAllNotifications(3, { + * client.fetchAllNotifications(3, { * limit: 30, * // cursor: "nextPageCursor" // Omit this parameter for the initial request * }).then(response => { @@ -885,9 +885,21 @@ export class NeynarV2APIClient { // ------------ Follows ------------ /** - * Returns a list of relevant followers for a specific FID. - * See [Neynar documentation](https://docs.neynar.com/reference/relevant-followers) + * Retrieves a list of relevant followers for a specific FID. * + * @param {number} targetFid - The FID of the user whose relevant followers are being fetched. + * @param {number} viewerFid - The FID of the viewer who is looking at the target user's profile. + * + * @returns {Promise} A promise that resolves to a `RelevantFollowersResponse` object, + * containing a list of relevant followers for the specified user. + * + * @example + * // Example: Retrieve relevant followers for a user from the perspective of another user + * client.fetchRelevantFollowers(3, 19960).then(response => { + * console.log('Relevant Followers:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/relevant-followers). */ public async fetchRelevantFollowers( targetFid: number, From 6404a0e2a392f08b3962f8b9efb4f757aa55310e Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Sat, 25 Nov 2023 00:57:39 +0530 Subject: [PATCH 49/77] Add doc string for v2 storage API methods --- src/neynar-api/neynar-api-client.ts | 30 ++++++++++++++++++++++++++--- src/neynar-api/v2/v2-client.ts | 30 ++++++++++++++++++++++++++--- 2 files changed, 54 insertions(+), 6 deletions(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index 180a08b0..272f76c6 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -1310,7 +1310,19 @@ export class NeynarAPIClient { /** * Retrieves storage allocations for a given user. - * See [Neynar documentation](https://docs.neynar.com/reference/storage-allocations) + * + * @param {number} fid - The FID of the user whose storage allocations are being retrieved. + * + * @returns {Promise} A promise that resolves to a `StorageAllocationsResponse` object, + * containing information about the user's storage allocations. + * + * @example + * // Example: Retrieve storage allocations for a user + * client.lookupUserStorageAllocations(3).then(response => { + * console.log('User Storage Allocations:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/storage-allocations). */ public async lookupUserStorageAllocations( fid: number @@ -1319,8 +1331,20 @@ export class NeynarAPIClient { } /** - * Retrieves storage usage for a given user - * See [Neynar documentation](https://docs.neynar.com/reference/storage-usage) + * Retrieves storage usage for a given user. + * + * @param {number} fid - The FID of the user whose storage usage is being queried. + * + * @returns {Promise} A promise that resolves to a `StorageUsageResponse` object, + * containing details about the user's storage usage. + * + * @example + * // Example: Retrieve storage usage for a user + * client.lookupUserStorageUsage(3).then(response => { + * console.log('User Storage Usage:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/storage-usage). */ public async lookupUserStorageUsage( fid: number diff --git a/src/neynar-api/v2/v2-client.ts b/src/neynar-api/v2/v2-client.ts index 355a888b..8439e8ca 100644 --- a/src/neynar-api/v2/v2-client.ts +++ b/src/neynar-api/v2/v2-client.ts @@ -917,7 +917,19 @@ export class NeynarV2APIClient { /** * Retrieves storage allocations for a given user. - * See [Neynar documentation](https://docs.neynar.com/reference/storage-allocations) + * + * @param {number} fid - The FID of the user whose storage allocations are being retrieved. + * + * @returns {Promise} A promise that resolves to a `StorageAllocationsResponse` object, + * containing information about the user's storage allocations. + * + * @example + * // Example: Retrieve storage allocations for a user + * client.lookupUserStorageAllocations(3).then(response => { + * console.log('User Storage Allocations:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/storage-allocations). */ public async lookupUserStorageAllocations( fid: number @@ -930,8 +942,20 @@ export class NeynarV2APIClient { } /** - * Retrieves storage usage for a given user - * See [Neynar documentation](https://docs.neynar.com/reference/storage-usage) + * Retrieves storage usage for a given user. + * + * @param {number} fid - The FID of the user whose storage usage is being queried. + * + * @returns {Promise} A promise that resolves to a `StorageUsageResponse` object, + * containing details about the user's storage usage. + * + * @example + * // Example: Retrieve storage usage for a user + * client.lookupUserStorageUsage(3).then(response => { + * console.log('User Storage Usage:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/storage-usage). */ public async lookupUserStorageUsage( fid: number From 108aedba99d99e642ff2f5b4d56cac0cca8d2e4f Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Sat, 25 Nov 2023 01:05:08 +0530 Subject: [PATCH 50/77] Add doc string for Recommendation API method --- src/neynar-api/neynar-api-client.ts | 24 ++++++++++++++++++++---- src/neynar-api/v2/v2-client.ts | 24 ++++++++++++++++++++---- 2 files changed, 40 insertions(+), 8 deletions(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index 272f76c6..b5919916 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -1355,19 +1355,35 @@ export class NeynarAPIClient { // ------------ 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) + * 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} 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, - tokenId?: string + options?: { tokenId?: string } ): Promise { return await this.clients.v2.fetchRelevantMints( address, contractAddress, - tokenId + options ); } } diff --git a/src/neynar-api/v2/v2-client.ts b/src/neynar-api/v2/v2-client.ts index 8439e8ca..eeabc3ad 100644 --- a/src/neynar-api/v2/v2-client.ts +++ b/src/neynar-api/v2/v2-client.ts @@ -966,20 +966,36 @@ export class NeynarV2APIClient { // ------------ 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) + * 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} 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, - tokenId?: string + options?: { tokenId?: string } ): Promise { const response = await this.apis.nft.fetchRelevantMints( this.apiKey, address, contractAddress, - tokenId + options?.tokenId ); return response.data; } From 2fc0bd38358f337c50af13ad74fda52b32dca7f1 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Sat, 25 Nov 2023 01:05:44 +0530 Subject: [PATCH 51/77] Major update: v1.0.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 8e9711ae..6a0279fa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@neynar/nodejs-sdk", - "version": "0.11.4", + "version": "1.0.0", "description": "SDK to interact with Neynar APIs (https://docs.neynar.com/)", "main": "./build/index.js", "types": "./build/index.d.ts", @@ -26,4 +26,4 @@ "@openapitools/openapi-generator-cli": "^2.7.0", "axios": "^1.6.2" } -} +} \ No newline at end of file From 95b585f2539ef75e2efff7a9756182b7526214fa Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Mon, 27 Nov 2023 11:33:30 +0530 Subject: [PATCH 52/77] Syncup OAS --- src/oas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oas b/src/oas index f189c971..21e66b58 160000 --- a/src/oas +++ b/src/oas @@ -1 +1 @@ -Subproject commit f189c971a5cd3d86edfb540a2ab8deb1252e21a9 +Subproject commit 21e66b5899183e8e3e26490ed55bd24ca6fcd549 From 58904dd11f127f32575e4649c66a0c2dfad95924 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Mon, 27 Nov 2023 11:34:01 +0530 Subject: [PATCH 53/77] Generate Code --- src/neynar-api/v1/openapi/models/user-profile-bio.ts | 6 ++++++ .../v2/openapi-farcaster/models/user-profile-bio.ts | 6 ++++++ .../v2/openapi-farcaster/models/user-viewer-context.ts | 8 ++++---- src/neynar-api/v2/openapi-farcaster/models/user.ts | 2 +- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/neynar-api/v1/openapi/models/user-profile-bio.ts b/src/neynar-api/v1/openapi/models/user-profile-bio.ts index 4c7f2e21..fa66cca7 100644 --- a/src/neynar-api/v1/openapi/models/user-profile-bio.ts +++ b/src/neynar-api/v1/openapi/models/user-profile-bio.ts @@ -26,5 +26,11 @@ export interface UserProfileBio { * @memberof UserProfileBio */ 'text': string; + /** + * + * @type {Array} + * @memberof UserProfileBio + */ + 'mentionedProfiles': Array; } diff --git a/src/neynar-api/v2/openapi-farcaster/models/user-profile-bio.ts b/src/neynar-api/v2/openapi-farcaster/models/user-profile-bio.ts index fb6f1908..ba4b0901 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/user-profile-bio.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/user-profile-bio.ts @@ -26,5 +26,11 @@ export interface UserProfileBio { * @memberof UserProfileBio */ 'text': string; + /** + * + * @type {Array} + * @memberof UserProfileBio + */ + 'mentioned_profiles': Array; } diff --git a/src/neynar-api/v2/openapi-farcaster/models/user-viewer-context.ts b/src/neynar-api/v2/openapi-farcaster/models/user-viewer-context.ts index 8a68f908..999f4291 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/user-viewer-context.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/user-viewer-context.ts @@ -22,15 +22,15 @@ export interface UserViewerContext { /** * - * @type {number} + * @type {boolean} * @memberof UserViewerContext */ - 'following': number; + 'following': boolean; /** * - * @type {number} + * @type {boolean} * @memberof UserViewerContext */ - 'followed_by': number; + 'followed_by': boolean; } diff --git a/src/neynar-api/v2/openapi-farcaster/models/user.ts b/src/neynar-api/v2/openapi-farcaster/models/user.ts index 863bc66d..19d54584 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/user.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/user.ts @@ -94,7 +94,7 @@ export interface User { * @type {ActiveStatus} * @memberof User */ - 'activeStatus': ActiveStatus; + 'active_status': ActiveStatus; /** * * @type {UserViewerContext} From 3fb9e7380ac7af2075e46fa5c14784890519dacc Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Mon, 27 Nov 2023 11:34:53 +0530 Subject: [PATCH 54/77] Restructure utils and add convertToV2UserProfile and convertToV2UserProfileList utility --- .../utils/convert-v1-to-v2-object.ts | 44 +++++++++++++++++++ src/neynar-api/utils/index.ts | 1 + .../is-api-error-response.ts} | 2 +- 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 src/neynar-api/utils/convert-v1-to-v2-object.ts create mode 100644 src/neynar-api/utils/index.ts rename src/neynar-api/{utils.ts => utils/is-api-error-response.ts} (94%) diff --git a/src/neynar-api/utils/convert-v1-to-v2-object.ts b/src/neynar-api/utils/convert-v1-to-v2-object.ts new file mode 100644 index 00000000..aca32566 --- /dev/null +++ b/src/neynar-api/utils/convert-v1-to-v2-object.ts @@ -0,0 +1,44 @@ +import { User as UserV1 } from "../v1"; +import { User as UserV2, ActiveStatus } from "../v2"; + +export const convertToV2UserProfile = (v1Profile: UserV1): UserV2 => { + let cleanProfile: UserV2 = { + object: "user", + fid: v1Profile.fid, + custody_address: v1Profile.custodyAddress, + username: v1Profile.username, + display_name: v1Profile.displayName, + pfp_url: v1Profile.pfp.url, + profile: { + bio: { + text: v1Profile.profile.bio.text, + mentioned_profiles: v1Profile.profile.bio?.mentionedProfiles ?? [], + }, + }, + follower_count: v1Profile?.followerCount, + following_count: v1Profile?.followingCount, + verifications: v1Profile?.verifications, + active_status: + v1Profile?.activeStatus === "active" + ? ActiveStatus.Active + : ActiveStatus.Inactive, + }; + + if (v1Profile.viewerContext != null) { + cleanProfile.viewer_context = { + following: v1Profile.viewerContext.following, + followed_by: v1Profile.viewerContext.followedBy, + }; + } + + return cleanProfile; +}; + +export const convertToV2UserProfileList = (v1Profiles: UserV1[]): UserV2[] => { + let v2Profiles: UserV2[] = []; + for (let i = 0; i < v1Profiles.length; i++) { + let v2Profile = convertToV2UserProfile(v1Profiles[i]); + v2Profiles.push(v2Profile); + } + return v2Profiles; +}; diff --git a/src/neynar-api/utils/index.ts b/src/neynar-api/utils/index.ts new file mode 100644 index 00000000..dc338d99 --- /dev/null +++ b/src/neynar-api/utils/index.ts @@ -0,0 +1 @@ +export * from "./is-api-error-response"; diff --git a/src/neynar-api/utils.ts b/src/neynar-api/utils/is-api-error-response.ts similarity index 94% rename from src/neynar-api/utils.ts rename to src/neynar-api/utils/is-api-error-response.ts index 131a5307..7c70f8d9 100644 --- a/src/neynar-api/utils.ts +++ b/src/neynar-api/utils/is-api-error-response.ts @@ -1,5 +1,5 @@ import { AxiosError } from "axios"; -import { ErrorRes } from "./v1"; +import { ErrorRes } from "../v1"; import type { SetRequired } from "type-fest"; /** From fccb1001682daafb5b646fa79833463a004c7540 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Mon, 27 Nov 2023 17:27:56 +0530 Subject: [PATCH 55/77] Syncup OAS --- src/oas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oas b/src/oas index 21e66b58..26504929 160000 --- a/src/oas +++ b/src/oas @@ -1 +1 @@ -Subproject commit 21e66b5899183e8e3e26490ed55bd24ca6fcd549 +Subproject commit 26504929d5cd6040a10303d701ff0022a7135a6a From 3c40f00a73ad803ad750cf1150debce56924eb1a Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Mon, 27 Nov 2023 17:28:26 +0530 Subject: [PATCH 56/77] Generate code --- src/neynar-api/v1/openapi/models/cast.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/neynar-api/v1/openapi/models/cast.ts b/src/neynar-api/v1/openapi/models/cast.ts index 8237c697..271c9b06 100644 --- a/src/neynar-api/v1/openapi/models/cast.ts +++ b/src/neynar-api/v1/openapi/models/cast.ts @@ -50,6 +50,12 @@ export interface Cast { * @memberof Cast */ 'parentUrl': string | null; + /** + * + * @type {string} + * @memberof Cast + */ + 'threadHash': string; /** * * @type {CastParentAuthor} From 265afe75e57dda8b9c2b45ba45668346ce850a17 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Mon, 27 Nov 2023 18:30:19 +0530 Subject: [PATCH 57/77] Generate code for 6.6.0 generator version --- openapitools.json | 2 +- .../v1/openapi/.openapi-generator/FILES | 4 ++ .../v1/openapi/.openapi-generator/VERSION | 2 +- src/neynar-api/v1/openapi/apis/cast-api.ts | 1 - src/neynar-api/v1/openapi/apis/follows-api.ts | 1 - .../v1/openapi/apis/notifications-api.ts | 1 - .../v1/openapi/apis/reactions-api.ts | 1 - src/neynar-api/v1/openapi/apis/user-api.ts | 1 - .../v1/openapi/apis/verification-api.ts | 1 - src/neynar-api/v1/openapi/common.ts | 2 +- .../models/cast-parent-author-all-of.ts | 30 +++++++++ .../v1/openapi/models/cast-parent-author.ts | 16 ++--- .../models/cast-with-interactions-all-of.ts | 63 +++++++++++++++++++ .../openapi/models/cast-with-interactions.ts | 5 +- .../models/follow-response-user-all-of.ts | 30 +++++++++ .../v1/openapi/models/follow-response-user.ts | 5 +- src/neynar-api/v1/openapi/models/index.ts | 4 ++ ...actions-and-recasts-notification-all-of.ts | 44 +++++++++++++ .../reactions-and-recasts-notification.ts | 5 +- 19 files changed, 196 insertions(+), 22 deletions(-) create mode 100644 src/neynar-api/v1/openapi/models/cast-parent-author-all-of.ts create mode 100644 src/neynar-api/v1/openapi/models/cast-with-interactions-all-of.ts create mode 100644 src/neynar-api/v1/openapi/models/follow-response-user-all-of.ts create mode 100644 src/neynar-api/v1/openapi/models/reactions-and-recasts-notification-all-of.ts diff --git a/openapitools.json b/openapitools.json index 4053ae89..cd53ff4c 100644 --- a/openapitools.json +++ b/openapitools.json @@ -2,6 +2,6 @@ "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", "spaces": 2, "generator-cli": { - "version": "7.0.1" + "version": "6.6.0" } } diff --git a/src/neynar-api/v1/openapi/.openapi-generator/FILES b/src/neynar-api/v1/openapi/.openapi-generator/FILES index 9d6c3a6e..4f18b991 100644 --- a/src/neynar-api/v1/openapi/.openapi-generator/FILES +++ b/src/neynar-api/v1/openapi/.openapi-generator/FILES @@ -20,6 +20,7 @@ models/cast-author-one-of.ts models/cast-author.ts models/cast-likes-response-result.ts models/cast-likes-response.ts +models/cast-parent-author-all-of.ts models/cast-parent-author.ts models/cast-reactions-response-result.ts models/cast-reactions-response.ts @@ -28,6 +29,7 @@ models/cast-recaster-response.ts models/cast-response-result.ts models/cast-response.ts models/cast-type.ts +models/cast-with-interactions-all-of.ts models/cast-with-interactions-reactions-or-recasts.ts models/cast-with-interactions-replies.ts models/cast-with-interactions.ts @@ -39,6 +41,7 @@ models/custody-address-response.ts models/embed-url.ts models/error-res.ts models/follow-response-result.ts +models/follow-response-user-all-of.ts models/follow-response-user.ts models/follow-response.ts models/index.ts @@ -50,6 +53,7 @@ models/reaction-with-cast-meta-cast.ts models/reaction-with-cast-meta-reaction.ts models/reaction-with-cast-meta.ts models/reaction.ts +models/reactions-and-recasts-notification-all-of.ts models/reactions-and-recasts-notification.ts models/reactions-and-recasts-response-result.ts models/reactions-and-recasts-response.ts diff --git a/src/neynar-api/v1/openapi/.openapi-generator/VERSION b/src/neynar-api/v1/openapi/.openapi-generator/VERSION index 73a86b19..cd802a1e 100644 --- a/src/neynar-api/v1/openapi/.openapi-generator/VERSION +++ b/src/neynar-api/v1/openapi/.openapi-generator/VERSION @@ -1 +1 @@ -7.0.1 \ No newline at end of file +6.6.0 \ No newline at end of file diff --git a/src/neynar-api/v1/openapi/apis/cast-api.ts b/src/neynar-api/v1/openapi/apis/cast-api.ts index c2b62b48..d5817b0a 100644 --- a/src/neynar-api/v1/openapi/apis/cast-api.ts +++ b/src/neynar-api/v1/openapi/apis/cast-api.ts @@ -449,4 +449,3 @@ export class CastApi extends BaseAPI { return CastApiFp(this.configuration).recentCasts(apiKey, viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); } } - diff --git a/src/neynar-api/v1/openapi/apis/follows-api.ts b/src/neynar-api/v1/openapi/apis/follows-api.ts index 85e56bcd..604c50f1 100644 --- a/src/neynar-api/v1/openapi/apis/follows-api.ts +++ b/src/neynar-api/v1/openapi/apis/follows-api.ts @@ -269,4 +269,3 @@ export class FollowsApi extends BaseAPI { return FollowsApiFp(this.configuration).following(apiKey, fid, viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); } } - diff --git a/src/neynar-api/v1/openapi/apis/notifications-api.ts b/src/neynar-api/v1/openapi/apis/notifications-api.ts index 43b128a7..8d90e624 100644 --- a/src/neynar-api/v1/openapi/apis/notifications-api.ts +++ b/src/neynar-api/v1/openapi/apis/notifications-api.ts @@ -271,4 +271,3 @@ export class NotificationsApi extends BaseAPI { return NotificationsApiFp(this.configuration).reactionsAndRecasts(apiKey, fid, viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); } } - diff --git a/src/neynar-api/v1/openapi/apis/reactions-api.ts b/src/neynar-api/v1/openapi/apis/reactions-api.ts index 6b8035fc..c0d95e51 100644 --- a/src/neynar-api/v1/openapi/apis/reactions-api.ts +++ b/src/neynar-api/v1/openapi/apis/reactions-api.ts @@ -377,4 +377,3 @@ export class ReactionsApi extends BaseAPI { return ReactionsApiFp(this.configuration).castRecasters(apiKey, castHash, viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); } } - diff --git a/src/neynar-api/v1/openapi/apis/user-api.ts b/src/neynar-api/v1/openapi/apis/user-api.ts index 1d29687e..64586360 100644 --- a/src/neynar-api/v1/openapi/apis/user-api.ts +++ b/src/neynar-api/v1/openapi/apis/user-api.ts @@ -521,4 +521,3 @@ export class UserApi extends BaseAPI { return UserApiFp(this.configuration).userCastLikes(apiKey, fid, viewerFid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); } } - diff --git a/src/neynar-api/v1/openapi/apis/verification-api.ts b/src/neynar-api/v1/openapi/apis/verification-api.ts index a2148bcd..2ad079c6 100644 --- a/src/neynar-api/v1/openapi/apis/verification-api.ts +++ b/src/neynar-api/v1/openapi/apis/verification-api.ts @@ -223,4 +223,3 @@ export class VerificationApi extends BaseAPI { return VerificationApiFp(this.configuration).verifications(apiKey, fid, options).then((request) => request(this.axios, this.basePath)); } } - diff --git a/src/neynar-api/v1/openapi/common.ts b/src/neynar-api/v1/openapi/common.ts index fb93d99d..9f95c6b1 100644 --- a/src/neynar-api/v1/openapi/common.ts +++ b/src/neynar-api/v1/openapi/common.ts @@ -144,7 +144,7 @@ export const toPathString = function (url: URL) { */ 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}; + const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; return axios.request(axiosRequestArgs); }; } diff --git a/src/neynar-api/v1/openapi/models/cast-parent-author-all-of.ts b/src/neynar-api/v1/openapi/models/cast-parent-author-all-of.ts new file mode 100644 index 00000000..9b0b1260 --- /dev/null +++ b/src/neynar-api/v1/openapi/models/cast-parent-author-all-of.ts @@ -0,0 +1,30 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.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 CastParentAuthorAllOf + */ +export interface CastParentAuthorAllOf { + /** + * + * @type {string} + * @memberof CastParentAuthorAllOf + */ + 'fid': string | null; +} + diff --git a/src/neynar-api/v1/openapi/models/cast-parent-author.ts b/src/neynar-api/v1/openapi/models/cast-parent-author.ts index ac6043a0..d22b30d5 100644 --- a/src/neynar-api/v1/openapi/models/cast-parent-author.ts +++ b/src/neynar-api/v1/openapi/models/cast-parent-author.ts @@ -13,18 +13,14 @@ */ +// May contain unused imports in some cases +// @ts-ignore +import { CastParentAuthorAllOf } from './cast-parent-author-all-of'; /** - * + * @type CastParentAuthor * @export - * @interface CastParentAuthor */ -export interface CastParentAuthor { - /** - * - * @type {string} - * @memberof CastParentAuthor - */ - 'fid': string | null; -} +export type CastParentAuthor = CastParentAuthorAllOf; + diff --git a/src/neynar-api/v1/openapi/models/cast-with-interactions-all-of.ts b/src/neynar-api/v1/openapi/models/cast-with-interactions-all-of.ts new file mode 100644 index 00000000..364796b1 --- /dev/null +++ b/src/neynar-api/v1/openapi/models/cast-with-interactions-all-of.ts @@ -0,0 +1,63 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.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 { CastWithInteractionsReactionsOrRecasts } from './cast-with-interactions-reactions-or-recasts'; +// May contain unused imports in some cases +// @ts-ignore +import { CastWithInteractionsReplies } from './cast-with-interactions-replies'; +// May contain unused imports in some cases +// @ts-ignore +import { ViewerContext } from './viewer-context'; + +/** + * + * @export + * @interface CastWithInteractionsAllOf + */ +export interface CastWithInteractionsAllOf { + /** + * + * @type {CastWithInteractionsReactionsOrRecasts} + * @memberof CastWithInteractionsAllOf + */ + 'reactions': CastWithInteractionsReactionsOrRecasts; + /** + * + * @type {CastWithInteractionsReactionsOrRecasts} + * @memberof CastWithInteractionsAllOf + */ + 'recasts': CastWithInteractionsReactionsOrRecasts; + /** + * + * @type {Array} + * @memberof CastWithInteractionsAllOf + */ + 'recasters': Array; + /** + * + * @type {ViewerContext} + * @memberof CastWithInteractionsAllOf + */ + 'viewerContext'?: ViewerContext; + /** + * + * @type {CastWithInteractionsReplies} + * @memberof CastWithInteractionsAllOf + */ + 'replies': CastWithInteractionsReplies; +} + diff --git a/src/neynar-api/v1/openapi/models/cast-with-interactions.ts b/src/neynar-api/v1/openapi/models/cast-with-interactions.ts index 066614e0..5605c896 100644 --- a/src/neynar-api/v1/openapi/models/cast-with-interactions.ts +++ b/src/neynar-api/v1/openapi/models/cast-with-interactions.ts @@ -27,6 +27,9 @@ import { CastParentAuthor } from './cast-parent-author'; import { CastType } from './cast-type'; // May contain unused imports in some cases // @ts-ignore +import { CastWithInteractionsAllOf } from './cast-with-interactions-all-of'; +// May contain unused imports in some cases +// @ts-ignore import { CastWithInteractionsReactionsOrRecasts } from './cast-with-interactions-reactions-or-recasts'; // May contain unused imports in some cases // @ts-ignore @@ -42,6 +45,6 @@ import { ViewerContext } from './viewer-context'; * @type CastWithInteractions * @export */ -export type CastWithInteractions = Cast; +export type CastWithInteractions = Cast & CastWithInteractionsAllOf; diff --git a/src/neynar-api/v1/openapi/models/follow-response-user-all-of.ts b/src/neynar-api/v1/openapi/models/follow-response-user-all-of.ts new file mode 100644 index 00000000..4463d719 --- /dev/null +++ b/src/neynar-api/v1/openapi/models/follow-response-user-all-of.ts @@ -0,0 +1,30 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.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 FollowResponseUserAllOf + */ +export interface FollowResponseUserAllOf { + /** + * + * @type {string} + * @memberof FollowResponseUserAllOf + */ + 'timestamp': string; +} + diff --git a/src/neynar-api/v1/openapi/models/follow-response-user.ts b/src/neynar-api/v1/openapi/models/follow-response-user.ts index ddb0eba2..cb8aac39 100644 --- a/src/neynar-api/v1/openapi/models/follow-response-user.ts +++ b/src/neynar-api/v1/openapi/models/follow-response-user.ts @@ -18,6 +18,9 @@ import { ActiveStatus } from './active-status'; // May contain unused imports in some cases // @ts-ignore +import { FollowResponseUserAllOf } from './follow-response-user-all-of'; +// May contain unused imports in some cases +// @ts-ignore import { User } from './user'; // May contain unused imports in some cases // @ts-ignore @@ -33,6 +36,6 @@ import { ViewerContext } from './viewer-context'; * @type FollowResponseUser * @export */ -export type FollowResponseUser = User; +export type FollowResponseUser = FollowResponseUserAllOf & User; diff --git a/src/neynar-api/v1/openapi/models/index.ts b/src/neynar-api/v1/openapi/models/index.ts index e4a911ad..63f1f1e4 100644 --- a/src/neynar-api/v1/openapi/models/index.ts +++ b/src/neynar-api/v1/openapi/models/index.ts @@ -7,6 +7,7 @@ export * from './cast-author-one-of'; export * from './cast-likes-response'; export * from './cast-likes-response-result'; export * from './cast-parent-author'; +export * from './cast-parent-author-all-of'; export * from './cast-reactions-response'; export * from './cast-reactions-response-result'; export * from './cast-recaster-response'; @@ -15,6 +16,7 @@ export * from './cast-response'; export * from './cast-response-result'; export * from './cast-type'; export * from './cast-with-interactions'; +export * from './cast-with-interactions-all-of'; export * from './cast-with-interactions-reactions-or-recasts'; export * from './cast-with-interactions-replies'; export * from './casts-response'; @@ -26,6 +28,7 @@ export * from './error-res'; export * from './follow-response'; export * from './follow-response-result'; export * from './follow-response-user'; +export * from './follow-response-user-all-of'; export * from './mentions-and-replies-response'; export * from './mentions-and-replies-response-result'; export * from './next-cursor'; @@ -35,6 +38,7 @@ export * from './reaction-with-cast-meta'; export * from './reaction-with-cast-meta-cast'; export * from './reaction-with-cast-meta-reaction'; export * from './reactions-and-recasts-notification'; +export * from './reactions-and-recasts-notification-all-of'; export * from './reactions-and-recasts-response'; export * from './reactions-and-recasts-response-result'; export * from './reactor'; diff --git a/src/neynar-api/v1/openapi/models/reactions-and-recasts-notification-all-of.ts b/src/neynar-api/v1/openapi/models/reactions-and-recasts-notification-all-of.ts new file mode 100644 index 00000000..b5a32258 --- /dev/null +++ b/src/neynar-api/v1/openapi/models/reactions-and-recasts-notification-all-of.ts @@ -0,0 +1,44 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.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 { ReactionType } from './reaction-type'; +// May contain unused imports in some cases +// @ts-ignore +import { User } from './user'; + +/** + * + * @export + * @interface ReactionsAndRecastsNotificationAllOf + */ +export interface ReactionsAndRecastsNotificationAllOf { + /** + * + * @type {Array} + * @memberof ReactionsAndRecastsNotificationAllOf + */ + 'reactors'?: Array; + /** + * + * @type {ReactionType} + * @memberof ReactionsAndRecastsNotificationAllOf + */ + 'reactionType'?: ReactionType; +} + + + diff --git a/src/neynar-api/v1/openapi/models/reactions-and-recasts-notification.ts b/src/neynar-api/v1/openapi/models/reactions-and-recasts-notification.ts index 0e8104a2..be1992ca 100644 --- a/src/neynar-api/v1/openapi/models/reactions-and-recasts-notification.ts +++ b/src/neynar-api/v1/openapi/models/reactions-and-recasts-notification.ts @@ -33,12 +33,15 @@ import { EmbedUrl } from './embed-url'; import { ReactionType } from './reaction-type'; // May contain unused imports in some cases // @ts-ignore +import { ReactionsAndRecastsNotificationAllOf } from './reactions-and-recasts-notification-all-of'; +// May contain unused imports in some cases +// @ts-ignore import { User } from './user'; /** * @type ReactionsAndRecastsNotification * @export */ -export type ReactionsAndRecastsNotification = Cast; +export type ReactionsAndRecastsNotification = Cast & ReactionsAndRecastsNotificationAllOf; From 7d5400b7f5783e6034f248cdeaf05c8bae5a670e Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Mon, 27 Nov 2023 18:47:31 +0530 Subject: [PATCH 58/77] Syncup OAS --- src/oas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oas b/src/oas index 26504929..7fd089c9 160000 --- a/src/oas +++ b/src/oas @@ -1 +1 @@ -Subproject commit 26504929d5cd6040a10303d701ff0022a7135a6a +Subproject commit 7fd089c9f12058212dd77bbd3a5a0a86405deefd From 410e1320cda4ebd42f9ec176574faccc6fb426f8 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Mon, 27 Nov 2023 18:49:10 +0530 Subject: [PATCH 59/77] Generate code --- .../models/cast-with-interactions-reactions-or-recasts.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/neynar-api/v1/openapi/models/cast-with-interactions-reactions-or-recasts.ts b/src/neynar-api/v1/openapi/models/cast-with-interactions-reactions-or-recasts.ts index 4d1b5e58..504be372 100644 --- a/src/neynar-api/v1/openapi/models/cast-with-interactions-reactions-or-recasts.ts +++ b/src/neynar-api/v1/openapi/models/cast-with-interactions-reactions-or-recasts.ts @@ -32,5 +32,11 @@ export interface CastWithInteractionsReactionsOrRecasts { * @memberof CastWithInteractionsReactionsOrRecasts */ 'fids': Array; + /** + * + * @type {Array} + * @memberof CastWithInteractionsReactionsOrRecasts + */ + 'fnames': Array; } From 558a58ad5ed3adfe955e5e11d8352c33d71d753d Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Mon, 27 Nov 2023 19:01:57 +0530 Subject: [PATCH 60/77] Export FeedType, FilterType and ReactionsType --- src/neynar-api/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/neynar-api/index.ts b/src/neynar-api/index.ts index 0aa31579..6d669883 100644 --- a/src/neynar-api/index.ts +++ b/src/neynar-api/index.ts @@ -1,2 +1,3 @@ export * from "./neynar-api-client"; export * from "./utils"; +export { FeedType, FilterType, ReactionsType } from "./v2"; From a2a4bd3f87a3d2eee5a4c992e497af4a8e11d8ab Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Mon, 27 Nov 2023 19:49:04 +0530 Subject: [PATCH 61/77] Sync OAS --- src/oas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oas b/src/oas index 7fd089c9..213ed5e6 160000 --- a/src/oas +++ b/src/oas @@ -1 +1 @@ -Subproject commit 7fd089c9f12058212dd77bbd3a5a0a86405deefd +Subproject commit 213ed5e6136f2076bdef589a3c5b73147a479acd From b4c0a21faa0afdb61a408a67b2ef1752c68c4db7 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Mon, 27 Nov 2023 21:20:06 +0530 Subject: [PATCH 62/77] Generate Code --- .../v1/openapi/models/cast-with-interactions.ts | 3 +++ src/neynar-api/v1/openapi/models/cast.ts | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/src/neynar-api/v1/openapi/models/cast-with-interactions.ts b/src/neynar-api/v1/openapi/models/cast-with-interactions.ts index 5605c896..ebef2f7f 100644 --- a/src/neynar-api/v1/openapi/models/cast-with-interactions.ts +++ b/src/neynar-api/v1/openapi/models/cast-with-interactions.ts @@ -39,6 +39,9 @@ import { CastWithInteractionsReplies } from './cast-with-interactions-replies'; import { EmbedUrl } from './embed-url'; // May contain unused imports in some cases // @ts-ignore +import { User } from './user'; +// May contain unused imports in some cases +// @ts-ignore import { ViewerContext } from './viewer-context'; /** diff --git a/src/neynar-api/v1/openapi/models/cast.ts b/src/neynar-api/v1/openapi/models/cast.ts index 271c9b06..a67218d5 100644 --- a/src/neynar-api/v1/openapi/models/cast.ts +++ b/src/neynar-api/v1/openapi/models/cast.ts @@ -25,6 +25,9 @@ import { CastType } from './cast-type'; // May contain unused imports in some cases // @ts-ignore import { EmbedUrl } from './embed-url'; +// May contain unused imports in some cases +// @ts-ignore +import { User } from './user'; /** * @@ -62,6 +65,12 @@ export interface Cast { * @memberof Cast */ 'parentAuthor': CastParentAuthor; + /** + * + * @type {Array} + * @memberof Cast + */ + 'mentionedProfiles': Array; /** * * @type {CastAuthor} From 81be34701abdca0b6a473ea46a56ea8dc58106f1 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Mon, 27 Nov 2023 21:21:39 +0530 Subject: [PATCH 63/77] Add convertToV2User, convertToV2UserList, convertToV2Cast and convertToV2CastList utility functions --- .../utils/convert-v1-to-v2-object.ts | 130 ++++++++++++++---- 1 file changed, 103 insertions(+), 27 deletions(-) diff --git a/src/neynar-api/utils/convert-v1-to-v2-object.ts b/src/neynar-api/utils/convert-v1-to-v2-object.ts index aca32566..b6e974ed 100644 --- a/src/neynar-api/utils/convert-v1-to-v2-object.ts +++ b/src/neynar-api/utils/convert-v1-to-v2-object.ts @@ -1,44 +1,120 @@ -import { User as UserV1 } from "../v1"; -import { User as UserV2, ActiveStatus } from "../v2"; +import { + User as IUserV1, + Cast as ICastV1, + CastWithInteractions as ICastWithInteractionsV1, +} from "../v1"; +import { User as IUserV2, ActiveStatus, Cast as ICastV2 } from "../v2"; -export const convertToV2UserProfile = (v1Profile: UserV1): UserV2 => { - let cleanProfile: UserV2 = { +export const convertToV2User = (v1User: IUserV1): IUserV2 => { + const v2User: IUserV2 = { object: "user", - fid: v1Profile.fid, - custody_address: v1Profile.custodyAddress, - username: v1Profile.username, - display_name: v1Profile.displayName, - pfp_url: v1Profile.pfp.url, + fid: v1User.fid, + custody_address: v1User.custodyAddress, + username: v1User.username, + display_name: v1User.displayName, + pfp_url: v1User.pfp.url, profile: { bio: { - text: v1Profile.profile.bio.text, - mentioned_profiles: v1Profile.profile.bio?.mentionedProfiles ?? [], + text: v1User.profile.bio.text, + mentioned_profiles: v1User.profile.bio?.mentionedProfiles ?? [], }, }, - follower_count: v1Profile?.followerCount, - following_count: v1Profile?.followingCount, - verifications: v1Profile?.verifications, + follower_count: v1User?.followerCount, + following_count: v1User?.followingCount, + verifications: v1User?.verifications, active_status: - v1Profile?.activeStatus === "active" + v1User?.activeStatus === "active" ? ActiveStatus.Active : ActiveStatus.Inactive, + ...(v1User.viewerContext + ? { + following: v1User.viewerContext.following, + followed_by: v1User.viewerContext.followedBy, + } + : {}), }; - if (v1Profile.viewerContext != null) { - cleanProfile.viewer_context = { - following: v1Profile.viewerContext.following, - followed_by: v1Profile.viewerContext.followedBy, - }; + return v2User; +}; + +export const convertToV2UserList = (v1Users: IUserV1[]): IUserV2[] => { + const v2Users: IUserV2[] = []; + for (let i = 0; i < v1Users.length; i++) { + const v2User = convertToV2User(v1Users[i]); + v2Users.push(v2User); } + return v2Users; +}; - return cleanProfile; +export const convertToV2Cast = ( + v1Cast: ICastV1 | ICastWithInteractionsV1 +): ICastV2 => { + const v2Cast = { + object: "cast_hydrated", + hash: v1Cast.hash, + thread_hash: v1Cast.threadHash, + parent_hash: v1Cast.parentHash, + parent_url: v1Cast.parentUrl ? v1Cast.parentUrl : null, + parent_author: { + fid: v1Cast.parentAuthor.fid, + }, + author: convertToV2User(v1Cast.author as IUserV1), + text: v1Cast.text, + timestamp: v1Cast.timestamp, + embeds: v1Cast.embeds.map((embed) => { + // Currently transformEmbeds is not being used. Leaving it here for now in case we need it later. + // if (embed.castId) { + // return { cast_id: embed.castId }; // changed 'castId' to 'cast_id' + // } else { + // return embed; // If there is no 'castId', return the embed object as is + // } + return embed; + }), + ...((v1Cast as ICastWithInteractionsV1).reactions + ? { + reactions: { + likes: (v1Cast as ICastWithInteractionsV1).reactions?.fids.map( + (fid, idx) => { + return { + fid: fid, + fname: (v1Cast as ICastWithInteractionsV1).reactions?.fnames[ + idx + ], + }; + } + ), + // assuming v1Cast.recasts is an array of fids and v1Cast.recasters is an array of fames + recasts: (v1Cast as ICastWithInteractionsV1).recasts?.fids.map( + (fid, idx) => { + return { + fid: fid, + fname: (v1Cast as ICastWithInteractionsV1).recasters[idx], + }; + } + ), + }, + } + : {}), + ...((v1Cast as ICastWithInteractionsV1).replies + ? { + replies: { + count: (v1Cast as ICastWithInteractionsV1).replies.count, + }, + } + : {}), + mentioned_profiles: convertToV2UserList(v1Cast.mentionedProfiles), + }; + return v2Cast; }; -export const convertToV2UserProfileList = (v1Profiles: UserV1[]): UserV2[] => { - let v2Profiles: UserV2[] = []; - for (let i = 0; i < v1Profiles.length; i++) { - let v2Profile = convertToV2UserProfile(v1Profiles[i]); - v2Profiles.push(v2Profile); +export const convertToV2CastsList = ( + v1Casts: ICastV1[] | ICastWithInteractionsV1[] +): ICastV2[] => { + const v2Casts = []; + for (let i = 0; i < v1Casts.length; i++) { + const v1Cast = v1Casts[i]; + const v2Cast = convertToV2Cast(v1Cast); + v2Casts.push(v2Cast); } - return v2Profiles; + return v2Casts; }; From 77c6316c900294152115659c3542fb6a1e20455b Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Mon, 27 Nov 2023 21:22:22 +0530 Subject: [PATCH 64/77] Rename convertToV2CastsList to convertToV2CastList --- src/neynar-api/utils/convert-v1-to-v2-object.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/neynar-api/utils/convert-v1-to-v2-object.ts b/src/neynar-api/utils/convert-v1-to-v2-object.ts index b6e974ed..a08e714f 100644 --- a/src/neynar-api/utils/convert-v1-to-v2-object.ts +++ b/src/neynar-api/utils/convert-v1-to-v2-object.ts @@ -107,7 +107,7 @@ export const convertToV2Cast = ( return v2Cast; }; -export const convertToV2CastsList = ( +export const convertToV2CastList = ( v1Casts: ICastV1[] | ICastWithInteractionsV1[] ): ICastV2[] => { const v2Casts = []; From 4e5c2a2e91c59e150054c01c218e8f951d56158c Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Mon, 27 Nov 2023 21:49:20 +0530 Subject: [PATCH 65/77] Rename converters file --- .../utils/{convert-v1-to-v2-object.ts => v1-to-v2-converters.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/neynar-api/utils/{convert-v1-to-v2-object.ts => v1-to-v2-converters.ts} (100%) diff --git a/src/neynar-api/utils/convert-v1-to-v2-object.ts b/src/neynar-api/utils/v1-to-v2-converters.ts similarity index 100% rename from src/neynar-api/utils/convert-v1-to-v2-object.ts rename to src/neynar-api/utils/v1-to-v2-converters.ts From b9015761ddabb19487affc55fad0d9e4421721ca Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Mon, 27 Nov 2023 23:19:25 +0530 Subject: [PATCH 66/77] Add generateApprovedSigner method --- package.json | 5 +- src/neynar-api/abi/key-gateway.ts | 288 ++++++++++++++++++ .../abi/signed-key-request-metadata.ts | 41 +++ src/neynar-api/common/viemClient.ts | 7 + src/neynar-api/neynar-api-client.ts | 153 ++++++++++ yarn.lock | 68 +++++ 6 files changed, 560 insertions(+), 2 deletions(-) create mode 100644 src/neynar-api/abi/key-gateway.ts create mode 100644 src/neynar-api/abi/signed-key-request-metadata.ts create mode 100644 src/neynar-api/common/viemClient.ts diff --git a/package.json b/package.json index 6a0279fa..a177dfb4 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ }, "dependencies": { "@openapitools/openapi-generator-cli": "^2.7.0", - "axios": "^1.6.2" + "axios": "^1.6.2", + "viem": "^1.19.9" } -} \ No newline at end of file +} diff --git a/src/neynar-api/abi/key-gateway.ts b/src/neynar-api/abi/key-gateway.ts new file mode 100644 index 00000000..5a541704 --- /dev/null +++ b/src/neynar-api/abi/key-gateway.ts @@ -0,0 +1,288 @@ +export const keyGatewayAbi = [ + { + inputs: [ + { internalType: "address", name: "_keyRegistry", type: "address" }, + { internalType: "address", name: "_initialOwner", type: "address" }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [ + { internalType: "address", name: "account", type: "address" }, + { internalType: "uint256", name: "currentNonce", type: "uint256" }, + ], + name: "InvalidAccountNonce", + type: "error", + }, + { inputs: [], name: "InvalidShortString", type: "error" }, + { inputs: [], name: "InvalidSignature", type: "error" }, + { inputs: [], name: "OnlyGuardian", type: "error" }, + { inputs: [], name: "SignatureExpired", type: "error" }, + { + inputs: [{ internalType: "string", name: "str", type: "string" }], + name: "StringTooLong", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "guardian", + type: "address", + }, + ], + name: "Add", + type: "event", + }, + { anonymous: false, inputs: [], name: "EIP712DomainChanged", type: "event" }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "previousOwner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnershipTransferStarted", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "previousOwner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnershipTransferred", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "Paused", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "guardian", + type: "address", + }, + ], + name: "Remove", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "Unpaused", + type: "event", + }, + { + inputs: [], + name: "ADD_TYPEHASH", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "VERSION", + outputs: [{ internalType: "string", name: "", type: "string" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "acceptOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "uint32", name: "keyType", type: "uint32" }, + { internalType: "bytes", name: "key", type: "bytes" }, + { internalType: "uint8", name: "metadataType", type: "uint8" }, + { internalType: "bytes", name: "metadata", type: "bytes" }, + ], + name: "add", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "fidOwner", type: "address" }, + { internalType: "uint32", name: "keyType", type: "uint32" }, + { internalType: "bytes", name: "key", type: "bytes" }, + { internalType: "uint8", name: "metadataType", type: "uint8" }, + { internalType: "bytes", name: "metadata", type: "bytes" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "bytes", name: "sig", type: "bytes" }, + ], + name: "addFor", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "guardian", type: "address" }], + name: "addGuardian", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "domainSeparatorV4", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "eip712Domain", + outputs: [ + { internalType: "bytes1", name: "fields", type: "bytes1" }, + { internalType: "string", name: "name", type: "string" }, + { internalType: "string", name: "version", type: "string" }, + { internalType: "uint256", name: "chainId", type: "uint256" }, + { internalType: "address", name: "verifyingContract", type: "address" }, + { internalType: "bytes32", name: "salt", type: "bytes32" }, + { internalType: "uint256[]", name: "extensions", type: "uint256[]" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "guardian", type: "address" }], + name: "guardians", + outputs: [{ internalType: "bool", name: "isGuardian", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "structHash", type: "bytes32" }], + name: "hashTypedDataV4", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "keyRegistry", + outputs: [ + { internalType: "contract IKeyRegistry", name: "", type: "address" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "owner", type: "address" }], + name: "nonces", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "owner", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "pause", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "paused", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "pendingOwner", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "guardian", type: "address" }], + name: "removeGuardian", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "renounceOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "newOwner", type: "address" }], + name: "transferOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "unpause", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "useNonce", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "nonpayable", + type: "function", + }, +] as const; diff --git a/src/neynar-api/abi/signed-key-request-metadata.ts b/src/neynar-api/abi/signed-key-request-metadata.ts new file mode 100644 index 00000000..7c4a4b81 --- /dev/null +++ b/src/neynar-api/abi/signed-key-request-metadata.ts @@ -0,0 +1,41 @@ +export const SignedKeyRequestMetadataABI = { + inputs: [ + { + components: [ + { + internalType: "uint256", + name: "requestFid", + type: "uint256", + }, + { + internalType: "address", + name: "requestSigner", + type: "address", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + ], + internalType: "struct SignedKeyRequestValidator.SignedKeyRequestMetadata", + name: "metadata", + type: "tuple", + }, + ], + name: "encodeMetadata", + outputs: [ + { + internalType: "bytes", + name: "", + type: "bytes", + }, + ], + stateMutability: "pure", + type: "function", +}; diff --git a/src/neynar-api/common/viemClient.ts b/src/neynar-api/common/viemClient.ts new file mode 100644 index 00000000..08043e27 --- /dev/null +++ b/src/neynar-api/common/viemClient.ts @@ -0,0 +1,7 @@ +import { createPublicClient, http } from "viem"; +import { optimism } from "viem/chains"; + +export const viemPublicClient = createPublicClient({ + chain: optimism, + transport: http(), +}); diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index b5919916..873f15f9 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -1,3 +1,5 @@ +import { mnemonicToAccount } from "viem/accounts"; + import { Signer, Cast, @@ -21,6 +23,7 @@ import { ReactionsType, StorageAllocationsResponse, StorageUsageResponse, + SignerStatusEnum, } from "./v2/openapi-farcaster"; import { @@ -47,6 +50,10 @@ import { AxiosInstance } from "axios"; import { silentLogger, Logger } from "./common/logger"; import { NeynarV1APIClient } from "./v1"; import { NeynarV2APIClient } from "./v2"; +import { encodeAbiParameters } from "viem"; +import { viemPublicClient } from "./common/viemClient"; +import { SignedKeyRequestMetadataABI } from "./abi/signed-key-request-metadata"; +import { keyGatewayAbi } from "./abi/key-gateway"; export class NeynarAPIClient { private readonly logger: Logger; @@ -1386,4 +1393,150 @@ export class NeynarAPIClient { options ); } + + // ------------ Misc ------------ + + /** + * Retri + * @param farcasterDeveloperMnemonic - mnemonic of the farcaster developer account + * + */ + public async generateApprovedSigner(farcasterDeveloperMnemonic: string) { + try { + const { public_key: signerPublicKey, signer_uuid } = + await this.createSigner(); + + // DO NOT CHANGE ANY VALUES IN THIS CONSTANT + const SIGNED_KEY_REQUEST_VALIDATOR_EIP_712_DOMAIN = { + name: "Farcaster SignedKeyRequestValidator", + version: "1", + chainId: 10, + verifyingContract: + "0x00000000fc700472606ed4fa22623acf62c60553" as `0x${string}`, + }; + + // DO NOT CHANGE ANY VALUES IN THIS CONSTANT + const SIGNED_KEY_REQUEST_TYPE = [ + { name: "requestFid", type: "uint256" }, + { name: "key", type: "bytes" }, + { name: "deadline", type: "uint256" }, + ]; + + const account = mnemonicToAccount(farcasterDeveloperMnemonic); + + const { user: farcasterDeveloper } = + await this.lookupUserByCustodyAddress(account.address); + + console.log( + `✅ Detected user with fid ${farcasterDeveloper.fid} and custody address: ${farcasterDeveloper.custody_address}` + ); + + // Generates an expiration date for the signature + // e.g. 1693927665 + const deadline = Math.floor(Date.now() / 1000) + 86400; // signature is valid for 1 day from now + + let signature = await account.signTypedData({ + domain: SIGNED_KEY_REQUEST_VALIDATOR_EIP_712_DOMAIN, + types: { + SignedKeyRequest: SIGNED_KEY_REQUEST_TYPE, + }, + primaryType: "SignedKeyRequest", + message: { + requestFid: BigInt(farcasterDeveloper.fid), + key: signerPublicKey, + deadline: BigInt(deadline), + }, + }); + + const metadata = encodeAbiParameters(SignedKeyRequestMetadataABI.inputs, [ + { + requestFid: BigInt(farcasterDeveloper.fid), + requestSigner: account.address, + signature: signature, + deadline: BigInt(deadline), + }, + ]); + + const developerKeyGatewayNonce = await viemPublicClient.readContract({ + address: "0x00000000fc56947c7e7183f8ca4b62398caadf0b", // gateway address + abi: keyGatewayAbi, + functionName: "nonces", + args: [farcasterDeveloper.custody_address as `0x${string}`], + }); + + const SIGNED_KEY_REQUEST_VALIDATOR = { + name: "Farcaster SignedKeyRequestValidator", + version: "1", + chainId: 10, + verifyingContract: + "0x00000000fc700472606ed4fa22623acf62c60553" as `0x${string}`, + }; + + const SIGNED_KEY_REQUEST_TYPE_FOR_ADD_FOR = [ + { name: "owner", type: "address" }, + { name: "keyType", type: "uint32" }, + { name: "key", type: "bytes" }, + { name: "metadataType", type: "uint8" }, + { name: "metadata", type: "bytes" }, + { name: "nonce", type: "uint256" }, + { name: "deadline", type: "uint256" }, + ]; + + signature = await account.signTypedData({ + domain: SIGNED_KEY_REQUEST_VALIDATOR, + types: { + SignedKeyRequest: SIGNED_KEY_REQUEST_TYPE_FOR_ADD_FOR, + }, + primaryType: "SignedKeyRequest", + message: { + owner: account.address, + keyType: 1, + key: signerPublicKey, + metadataType: 1, + metadata: metadata, + nonce: BigInt(developerKeyGatewayNonce), + deadline: BigInt(deadline), + }, + }); + + console.log("✅ Generated signer", "\n"); + + console.log( + "In order to get an approved signer you need to do an on-chain transaction on OP mainnet. \nGo to Farcaster KeyGateway optimism explorer\nhttps://optimistic.etherscan.io/address/0x00000000fc56947c7e7183f8ca4b62398caadf0b#writeContract \n" + ); + console.log( + "Connect to Web3.\n\nNavigate to `addFor` function and add following values inside the respective placeholders.\n" + ); + + console.log( + "fidOwner (address) :=> ", + farcasterDeveloper.custody_address, + "\n -" + ); + console.log("keyType (uint32) :=> ", 1, "\n -"); + console.log("key (bytes) :=> ", signerPublicKey, "\n -"); + console.log("metadataType (uint8) :=> ", 1, "\n -"); + console.log("metadata (bytes) :=> ", metadata, "\n -"); + console.log("deadline (uint256) :=> ", deadline, "\n -"); + console.log("sig (bytes) :=> ", signature, "\n -\n"); + console.log( + "We are polling for the signer to be approved. It will be approved once the onchain transaction is confirmed." + ); + console.log("Checking for the status of signer..."); + + while (true) { + const res = await this.lookupSigner(signer_uuid); + if (res && res.status === SignerStatusEnum.Approved) { + break; + } + console.log("Waiting for signer to be approved..."); + await new Promise((r) => setTimeout(r, 5000)); + } + + console.log("✅ Transaction confirmed\n"); + return signer_uuid; + } catch (err) { + console.log(err); + } + } } diff --git a/yarn.lock b/yarn.lock index 1ad1dcf8..9b7cc355 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,11 @@ # yarn lockfile v1 +"@adraffy/ens-normalize@1.10.0": + version "1.10.0" + resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.10.0.tgz#d2a39395c587e092d77cbbc80acf956a54f38bf7" + integrity sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q== + "@babel/code-frame@^7.0.0": version "7.22.13" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.13.tgz#e3c1c099402598483b7a8c46a721d1038803755e" @@ -89,6 +94,18 @@ path-to-regexp "3.2.0" tslib "2.5.0" +"@noble/curves@1.2.0", "@noble/curves@~1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.2.0.tgz#92d7e12e4e49b23105a2555c6984d41733d65c35" + integrity sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw== + dependencies: + "@noble/hashes" "1.3.2" + +"@noble/hashes@1.3.2", "@noble/hashes@~1.3.0", "@noble/hashes@~1.3.2": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39" + integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -141,6 +158,28 @@ rxjs "7.8.0" tslib "2.0.3" +"@scure/base@~1.1.0", "@scure/base@~1.1.2": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.3.tgz#8584115565228290a6c6c4961973e0903bb3df2f" + integrity sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q== + +"@scure/bip32@1.3.2": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.3.2.tgz#90e78c027d5e30f0b22c1f8d50ff12f3fb7559f8" + integrity sha512-N1ZhksgwD3OBlwTv3R6KFEcPojl/W4ElJOeCZdi+vuI5QmTFwLq3OFf2zd2ROpKvxFdgZ6hUpb0dx9bVNEwYCA== + dependencies: + "@noble/curves" "~1.2.0" + "@noble/hashes" "~1.3.2" + "@scure/base" "~1.1.2" + +"@scure/bip39@1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.2.1.tgz#5cee8978656b272a917b7871c981e0541ad6ac2a" + integrity sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg== + dependencies: + "@noble/hashes" "~1.3.0" + "@scure/base" "~1.1.0" + "@tsconfig/node10@^1.0.7": version "1.0.9" resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" @@ -178,6 +217,11 @@ resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.2.tgz#9b0e3e8533fe5024ad32d6637eb9589988b6fdca" integrity sha512-lqa4UEhhv/2sjjIQgjX8B+RBjj47eo0mzGasklVJ78UKGQY1r0VpB9XHDaZZO9qzEFDdy4MrXLuEaSmPrPSe/A== +abitype@0.9.8: + version "0.9.8" + resolved "https://registry.yarnpkg.com/abitype/-/abitype-0.9.8.tgz#1f120b6b717459deafd213dfbf3a3dd1bf10ae8c" + integrity sha512-puLifILdm+8sjyss4S+fsUN09obiT1g2YW6CtcQF+QDzxR0euzgEB29MZujC6zMk2a6SVmtttq1fc6+YFA7WYQ== + acorn-walk@^8.1.1: version "8.3.0" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.0.tgz#2097665af50fd0cf7a2dfccd2b9368964e66540f" @@ -829,6 +873,11 @@ is-unicode-supported@^0.1.0: resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== +isows@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/isows/-/isows-1.0.3.tgz#93c1cf0575daf56e7120bab5c8c448b0809d0d74" + integrity sha512-2cKei4vlmg2cxEjm3wVSqn8pcoRF/LX/wpifuuNquFO4SQmPwarClT+SUCA2lt+l581tTeZIPIZuIDo2jWN1fg== + iterare@1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/iterare/-/iterare-1.2.1.tgz#139c400ff7363690e33abffa33cbba8920f00042" @@ -1437,6 +1486,20 @@ validate-npm-package-license@^3.0.1: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" +viem@^1.19.9: + version "1.19.9" + resolved "https://registry.yarnpkg.com/viem/-/viem-1.19.9.tgz#a11f3ad4a3323994ebd2010dbc659d1a2b12e583" + integrity sha512-Sf9U2x4jU0S/FALqYypcspWOGene0NZyD470oUripNhE0Ta6uOE/OgE4toTDVfRxov8qw0JFinr/wPGxYE3+HQ== + dependencies: + "@adraffy/ens-normalize" "1.10.0" + "@noble/curves" "1.2.0" + "@noble/hashes" "1.3.2" + "@scure/bip32" "1.3.2" + "@scure/bip39" "1.2.1" + abitype "0.9.8" + isows "1.0.3" + ws "8.13.0" + wcwidth@>=1.0.1, wcwidth@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" @@ -1471,6 +1534,11 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== +ws@8.13.0: + version "8.13.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0" + integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== + y18n@^5.0.5: version "5.0.8" resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" From b8fa1b71a5fd2dc6727ed84e93b8fe1113e019bd Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Mon, 27 Nov 2023 23:21:17 +0530 Subject: [PATCH 67/77] Expose converter utility functions --- src/neynar-api/utils/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/neynar-api/utils/index.ts b/src/neynar-api/utils/index.ts index dc338d99..2e8cc259 100644 --- a/src/neynar-api/utils/index.ts +++ b/src/neynar-api/utils/index.ts @@ -1 +1,2 @@ export * from "./is-api-error-response"; +export * from "./v1-to-v2-converters"; From a9bd3da56cae8594bfb202478b8c769855d177e9 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Tue, 28 Nov 2023 10:33:51 +0530 Subject: [PATCH 68/77] Export constants --- src/neynar-api/common/constants.ts | 33 +++++++++++++++++++++++++++ src/neynar-api/neynar-api-client.ts | 35 +---------------------------- 2 files changed, 34 insertions(+), 34 deletions(-) create mode 100644 src/neynar-api/common/constants.ts diff --git a/src/neynar-api/common/constants.ts b/src/neynar-api/common/constants.ts new file mode 100644 index 00000000..c2360af7 --- /dev/null +++ b/src/neynar-api/common/constants.ts @@ -0,0 +1,33 @@ +// DO NOT CHANGE ANY VALUES IN THIS CONSTANT +export const SIGNED_KEY_REQUEST_VALIDATOR_EIP_712_DOMAIN = { + name: "Farcaster SignedKeyRequestValidator", + version: "1", + chainId: 10, + verifyingContract: + "0x00000000fc700472606ed4fa22623acf62c60553" as `0x${string}`, +}; + +// DO NOT CHANGE ANY VALUES IN THIS CONSTANT +export const SIGNED_KEY_REQUEST_TYPE = [ + { name: "requestFid", type: "uint256" }, + { name: "key", type: "bytes" }, + { name: "deadline", type: "uint256" }, +]; + +export const SIGNED_KEY_REQUEST_VALIDATOR = { + name: "Farcaster SignedKeyRequestValidator", + version: "1", + chainId: 10, + verifyingContract: + "0x00000000fc700472606ed4fa22623acf62c60553" as `0x${string}`, +}; + +export const SIGNED_KEY_REQUEST_TYPE_FOR_ADD_FOR = [ + { name: "owner", type: "address" }, + { name: "keyType", type: "uint32" }, + { name: "key", type: "bytes" }, + { name: "metadataType", type: "uint8" }, + { name: "metadata", type: "bytes" }, + { name: "nonce", type: "uint256" }, + { name: "deadline", type: "uint256" }, +]; diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index 873f15f9..4b463536 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -54,6 +54,7 @@ import { encodeAbiParameters } from "viem"; import { viemPublicClient } from "./common/viemClient"; import { SignedKeyRequestMetadataABI } from "./abi/signed-key-request-metadata"; import { keyGatewayAbi } from "./abi/key-gateway"; +import { SIGNED_KEY_REQUEST_TYPE, SIGNED_KEY_REQUEST_TYPE_FOR_ADD_FOR, SIGNED_KEY_REQUEST_VALIDATOR, SIGNED_KEY_REQUEST_VALIDATOR_EIP_712_DOMAIN } from "./common/constants"; export class NeynarAPIClient { private readonly logger: Logger; @@ -1406,22 +1407,6 @@ export class NeynarAPIClient { const { public_key: signerPublicKey, signer_uuid } = await this.createSigner(); - // DO NOT CHANGE ANY VALUES IN THIS CONSTANT - const SIGNED_KEY_REQUEST_VALIDATOR_EIP_712_DOMAIN = { - name: "Farcaster SignedKeyRequestValidator", - version: "1", - chainId: 10, - verifyingContract: - "0x00000000fc700472606ed4fa22623acf62c60553" as `0x${string}`, - }; - - // DO NOT CHANGE ANY VALUES IN THIS CONSTANT - const SIGNED_KEY_REQUEST_TYPE = [ - { name: "requestFid", type: "uint256" }, - { name: "key", type: "bytes" }, - { name: "deadline", type: "uint256" }, - ]; - const account = mnemonicToAccount(farcasterDeveloperMnemonic); const { user: farcasterDeveloper } = @@ -1464,24 +1449,6 @@ export class NeynarAPIClient { args: [farcasterDeveloper.custody_address as `0x${string}`], }); - const SIGNED_KEY_REQUEST_VALIDATOR = { - name: "Farcaster SignedKeyRequestValidator", - version: "1", - chainId: 10, - verifyingContract: - "0x00000000fc700472606ed4fa22623acf62c60553" as `0x${string}`, - }; - - const SIGNED_KEY_REQUEST_TYPE_FOR_ADD_FOR = [ - { name: "owner", type: "address" }, - { name: "keyType", type: "uint32" }, - { name: "key", type: "bytes" }, - { name: "metadataType", type: "uint8" }, - { name: "metadata", type: "bytes" }, - { name: "nonce", type: "uint256" }, - { name: "deadline", type: "uint256" }, - ]; - signature = await account.signTypedData({ domain: SIGNED_KEY_REQUEST_VALIDATOR, types: { From dddc7a51e76a988b726a28415446e699fd93de16 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Tue, 28 Nov 2023 10:48:58 +0530 Subject: [PATCH 69/77] Add description for generateApprovedSigner --- src/neynar-api/neynar-api-client.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index 4b463536..81e103b5 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -1398,7 +1398,9 @@ export class NeynarAPIClient { // ------------ Misc ------------ /** - * Retri + * Generate and Retrieve approved signer + * Using this signer you can do CRUD operations on farcaster. + * * @param farcasterDeveloperMnemonic - mnemonic of the farcaster developer account * */ From 28412743eea96c4d379b1399bfd1f5e94855c374 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Tue, 28 Nov 2023 10:51:37 +0530 Subject: [PATCH 70/77] Add error handling for generateApprovedSigner --- src/neynar-api/neynar-api-client.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index 81e103b5..0a4b05ca 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -54,7 +54,13 @@ import { encodeAbiParameters } from "viem"; import { viemPublicClient } from "./common/viemClient"; import { SignedKeyRequestMetadataABI } from "./abi/signed-key-request-metadata"; import { keyGatewayAbi } from "./abi/key-gateway"; -import { SIGNED_KEY_REQUEST_TYPE, SIGNED_KEY_REQUEST_TYPE_FOR_ADD_FOR, SIGNED_KEY_REQUEST_VALIDATOR, SIGNED_KEY_REQUEST_VALIDATOR_EIP_712_DOMAIN } from "./common/constants"; +import { + SIGNED_KEY_REQUEST_TYPE, + SIGNED_KEY_REQUEST_TYPE_FOR_ADD_FOR, + SIGNED_KEY_REQUEST_VALIDATOR, + SIGNED_KEY_REQUEST_VALIDATOR_EIP_712_DOMAIN, +} from "./common/constants"; +import { isApiErrorResponse } from "./utils"; export class NeynarAPIClient { private readonly logger: Logger; @@ -1400,7 +1406,7 @@ export class NeynarAPIClient { /** * Generate and Retrieve approved signer * Using this signer you can do CRUD operations on farcaster. - * + * * @param farcasterDeveloperMnemonic - mnemonic of the farcaster developer account * */ @@ -1505,7 +1511,9 @@ export class NeynarAPIClient { console.log("✅ Transaction confirmed\n"); return signer_uuid; } catch (err) { - console.log(err); + if (isApiErrorResponse(err)) { + console.log(err.response.data); + } else console.log(err); } } } From de14bf113a1c749ca87320102b9657ff7c453436 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Tue, 28 Nov 2023 20:16:17 +0530 Subject: [PATCH 71/77] Send approved signer --- src/neynar-api/neynar-api-client.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index 0a4b05ca..7449e56d 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -1499,9 +1499,12 @@ export class NeynarAPIClient { ); console.log("Checking for the status of signer..."); + let approvedSignerUuid: string; + while (true) { const res = await this.lookupSigner(signer_uuid); if (res && res.status === SignerStatusEnum.Approved) { + approvedSignerUuid = res.signer_uuid; break; } console.log("Waiting for signer to be approved..."); @@ -1509,7 +1512,7 @@ export class NeynarAPIClient { } console.log("✅ Transaction confirmed\n"); - return signer_uuid; + return approvedSignerUuid; } catch (err) { if (isApiErrorResponse(err)) { console.log(err.response.data); From 2e46676667c96e4b0e8487038cb281719b858e9c Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Tue, 28 Nov 2023 20:23:52 +0530 Subject: [PATCH 72/77] Rename registerSigner to registerSignedKey --- src/neynar-api/neynar-api-client.ts | 8 ++++---- src/neynar-api/v2/v2-client.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index 7449e56d..7eb97d74 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -742,19 +742,19 @@ export class NeynarAPIClient { * // Following is an example of how to generate a signer, it may not work. Please fill in the correct values here. * // Please refer https://github.com/manan19/example-farcaster-app to get started * - * client.registerSigner('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', 18949, 1625097600, '0xe5d95c391e165dac8efea373efe301d3ea823e1f41713f8943713cbe2850566672e33ff3e17e19abb89703f650a2597f62b4fda0ce28ca15d59eb6d4e971ee531b').then(response => { + * client.registerSignedKey('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', 18949, 1625097600, '0xe5d95c391e165dac8efea373efe301d3ea823e1f41713f8943713cbe2850566672e33ff3e17e19abb89703f650a2597f62b4fda0ce28ca15d59eb6d4e971ee531b').then(response => { * console.log('Signer Registration:', response); // Outputs the registration status of the signer * }); * * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/register-signed-key). */ - public async registerSigner( + public async registerSignedKey( signerUuid: string, fid: number, deadline: number, signature: string ): Promise { - return await this.clients.v2.registerSigner( + return await this.clients.v2.registerSignedKey( signerUuid, fid, deadline, @@ -1499,7 +1499,7 @@ export class NeynarAPIClient { ); console.log("Checking for the status of signer..."); - let approvedSignerUuid: string; + let approvedSignerUuid: string; while (true) { const res = await this.lookupSigner(signer_uuid); diff --git a/src/neynar-api/v2/v2-client.ts b/src/neynar-api/v2/v2-client.ts index eeabc3ad..81a1edf9 100644 --- a/src/neynar-api/v2/v2-client.ts +++ b/src/neynar-api/v2/v2-client.ts @@ -199,13 +199,13 @@ export class NeynarV2APIClient { * // Following is an example of how to generate a signer, it may not work. Please fill in the correct values here. * // Please refer https://github.com/manan19/example-farcaster-app to get started * - * client.registerSigner('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', 18949, 1625097600, '0xe5d95c391e165dac8efea373efe301d3ea823e1f41713f8943713cbe2850566672e33ff3e17e19abb89703f650a2597f62b4fda0ce28ca15d59eb6d4e971ee531b').then(response => { + * client.registerSignedKey('19d0c5fd-9b33-4a48-a0e2-bc7b0555baec', 18949, 1625097600, '0xe5d95c391e165dac8efea373efe301d3ea823e1f41713f8943713cbe2850566672e33ff3e17e19abb89703f650a2597f62b4fda0ce28ca15d59eb6d4e971ee531b').then(response => { * console.log('Signer Registration:', response); // Outputs the registration status of the signer * }); * * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/register-signed-key). */ - public async registerSigner( + public async registerSignedKey( signerUuid: string, fid: number, deadline: number, From d8803641a2d3468a7c76cda16ae799eed0209cd2 Mon Sep 17 00:00:00 2001 From: Manan Date: Tue, 28 Nov 2023 07:15:07 -0800 Subject: [PATCH 73/77] feat: change approved signer function to just return pending signer --- src/neynar-api/neynar-api-client.ts | 91 +++-------------------------- 1 file changed, 9 insertions(+), 82 deletions(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index 7eb97d74..ccde81a3 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -1407,26 +1407,23 @@ export class NeynarAPIClient { * Generate and Retrieve approved signer * Using this signer you can do CRUD operations on farcaster. * - * @param farcasterDeveloperMnemonic - mnemonic of the farcaster developer account - * + * @param {string} farcasterDeveloperMnemonic - mnemonic of the farcaster developer account + * @param {Object} [options] - Optional parameters for the request. + * @param {number} [options.deadline] - (Optional) Unix timestamp in seconds that controls how long the signed key + * request is valid for. A 24-hour duration from now is recommended. */ - public async generateApprovedSigner(farcasterDeveloperMnemonic: string) { + public async createSignerAndRegisterSignedKey(farcasterDeveloperMnemonic: string, options?: { deadline?: number }) { try { const { public_key: signerPublicKey, signer_uuid } = await this.createSigner(); const account = mnemonicToAccount(farcasterDeveloperMnemonic); - const { user: farcasterDeveloper } = await this.lookupUserByCustodyAddress(account.address); - console.log( - `✅ Detected user with fid ${farcasterDeveloper.fid} and custody address: ${farcasterDeveloper.custody_address}` - ); - // Generates an expiration date for the signature // e.g. 1693927665 - const deadline = Math.floor(Date.now() / 1000) + 86400; // signature is valid for 1 day from now + const signed_key_deadline = options?.deadline ?? Math.floor(Date.now() / 1000) + 86400; // signature is valid for 1 day from now let signature = await account.signTypedData({ domain: SIGNED_KEY_REQUEST_VALIDATOR_EIP_712_DOMAIN, @@ -1437,82 +1434,12 @@ export class NeynarAPIClient { message: { requestFid: BigInt(farcasterDeveloper.fid), key: signerPublicKey, - deadline: BigInt(deadline), - }, - }); - - const metadata = encodeAbiParameters(SignedKeyRequestMetadataABI.inputs, [ - { - requestFid: BigInt(farcasterDeveloper.fid), - requestSigner: account.address, - signature: signature, - deadline: BigInt(deadline), - }, - ]); - - const developerKeyGatewayNonce = await viemPublicClient.readContract({ - address: "0x00000000fc56947c7e7183f8ca4b62398caadf0b", // gateway address - abi: keyGatewayAbi, - functionName: "nonces", - args: [farcasterDeveloper.custody_address as `0x${string}`], - }); - - signature = await account.signTypedData({ - domain: SIGNED_KEY_REQUEST_VALIDATOR, - types: { - SignedKeyRequest: SIGNED_KEY_REQUEST_TYPE_FOR_ADD_FOR, - }, - primaryType: "SignedKeyRequest", - message: { - owner: account.address, - keyType: 1, - key: signerPublicKey, - metadataType: 1, - metadata: metadata, - nonce: BigInt(developerKeyGatewayNonce), - deadline: BigInt(deadline), + deadline: BigInt(signed_key_deadline), }, }); - console.log("✅ Generated signer", "\n"); - - console.log( - "In order to get an approved signer you need to do an on-chain transaction on OP mainnet. \nGo to Farcaster KeyGateway optimism explorer\nhttps://optimistic.etherscan.io/address/0x00000000fc56947c7e7183f8ca4b62398caadf0b#writeContract \n" - ); - console.log( - "Connect to Web3.\n\nNavigate to `addFor` function and add following values inside the respective placeholders.\n" - ); - - console.log( - "fidOwner (address) :=> ", - farcasterDeveloper.custody_address, - "\n -" - ); - console.log("keyType (uint32) :=> ", 1, "\n -"); - console.log("key (bytes) :=> ", signerPublicKey, "\n -"); - console.log("metadataType (uint8) :=> ", 1, "\n -"); - console.log("metadata (bytes) :=> ", metadata, "\n -"); - console.log("deadline (uint256) :=> ", deadline, "\n -"); - console.log("sig (bytes) :=> ", signature, "\n -\n"); - console.log( - "We are polling for the signer to be approved. It will be approved once the onchain transaction is confirmed." - ); - console.log("Checking for the status of signer..."); - - let approvedSignerUuid: string; - - while (true) { - const res = await this.lookupSigner(signer_uuid); - if (res && res.status === SignerStatusEnum.Approved) { - approvedSignerUuid = res.signer_uuid; - break; - } - console.log("Waiting for signer to be approved..."); - await new Promise((r) => setTimeout(r, 5000)); - } - - console.log("✅ Transaction confirmed\n"); - return approvedSignerUuid; + let signer_pending = await this.registerSignedKey(signer_uuid, farcasterDeveloper.fid, signed_key_deadline, signature); + return signer_pending; } catch (err) { if (isApiErrorResponse(err)) { console.log(err.response.data); From bd6495a69a7b52c96ab0fcf44b62907b4fbb5ac5 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Tue, 28 Nov 2023 22:04:44 +0530 Subject: [PATCH 74/77] Add js doc strings to createSignerAndRegisterSignedKey --- src/neynar-api/neynar-api-client.ts | 33 +++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index ccde81a3..b115de93 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -1401,18 +1401,31 @@ export class NeynarAPIClient { ); } - // ------------ Misc ------------ + // ------------ Additional utility methods ------------ /** - * Generate and Retrieve approved signer - * Using this signer you can do CRUD operations on farcaster. + * Creates a signer and registers a signed key for the signer. + * It returns a Signer which includes `signer_approval_url` that can be used to create a QR Code for the user to scan and approve the signer. * * @param {string} farcasterDeveloperMnemonic - mnemonic of the farcaster developer account - * @param {Object} [options] - Optional parameters for the request. + * @param {Object} [options] - Optional parameters for the request. * @param {number} [options.deadline] - (Optional) Unix timestamp in seconds that controls how long the signed key * request is valid for. A 24-hour duration from now is recommended. + * + * @returns {Promise} A promise that resolves to a `Signer` object, + * that includes signer_approval_url. + * + * @example + * // Example: Create a signer and register a signed key + * const mnemonic = 'farcaster developer mnemonic'; + * client.createSignerAndRegisterSignedKey(mnemonic, { deadline: 1693927665 }).then(response => { + * console.log('Signer', response); + * }); */ - public async createSignerAndRegisterSignedKey(farcasterDeveloperMnemonic: string, options?: { deadline?: number }) { + public async createSignerAndRegisterSignedKey( + farcasterDeveloperMnemonic: string, + options?: { deadline?: number } + ) { try { const { public_key: signerPublicKey, signer_uuid } = await this.createSigner(); @@ -1423,7 +1436,8 @@ export class NeynarAPIClient { // Generates an expiration date for the signature // e.g. 1693927665 - const signed_key_deadline = options?.deadline ?? Math.floor(Date.now() / 1000) + 86400; // signature is valid for 1 day from now + const signed_key_deadline = + options?.deadline ?? Math.floor(Date.now() / 1000) + 86400; // signature is valid for 1 day from now let signature = await account.signTypedData({ domain: SIGNED_KEY_REQUEST_VALIDATOR_EIP_712_DOMAIN, @@ -1438,7 +1452,12 @@ export class NeynarAPIClient { }, }); - let signer_pending = await this.registerSignedKey(signer_uuid, farcasterDeveloper.fid, signed_key_deadline, signature); + let signer_pending = await this.registerSignedKey( + signer_uuid, + farcasterDeveloper.fid, + signed_key_deadline, + signature + ); return signer_pending; } catch (err) { if (isApiErrorResponse(err)) { From 0e74cb2169515130b3549a4aa465346dad9e95b2 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Tue, 28 Nov 2023 22:11:50 +0530 Subject: [PATCH 75/77] Update limit and cursor description in js docstring --- src/neynar-api/neynar-api-client.ts | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index b115de93..536cd963 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -1126,8 +1126,10 @@ export class NeynarAPIClient { * @param {Array} [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 {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. + * @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. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. * * @returns {Promise} A promise that resolves to a `FeedResponse` object, * containing the requested feed data. @@ -1232,9 +1234,10 @@ export class NeynarAPIClient { * @param {number} fid - The FID of the user whose reactions are being fetched. * @param {ReactionsType} type - The type of reaction to fetch (likes, recasts, or all). * @param {Object} [options] - Optional parameters for customizing the response. - * @param {number} [options.limit] - Limits the number of results. Default is 25, with a maximum of 100. - * @param {string} [options.cursor] - Pagination cursor for the next set of results, - * omit this parameter for the initial request. + * @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. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. * * @returns {Promise} A promise that resolves to a `ReactionsResponse` object, * containing the reactions associated with the user's casts. @@ -1269,9 +1272,10 @@ export class NeynarAPIClient { * * @param {number} fid - The FID of the user whose notifications are being fetched. * @param {Object} [options] - Optional parameters to tailor the request. - * @param {number} [options.limit] - Number of results to retrieve (default 25, max 50). - * @param {string} [options.cursor] - Pagination cursor for the next set of results, - * omit this parameter for the initial request. + * @param {number} [options.limit] - The maximum number of users to be returned in the response. + * Defaults to 25, with a maximum allowable value of 50. + * @param {string} [options.cursor] - A pagination cursor for fetching specific subsets of results. + * Omit this parameter for the initial request. Use it for paginated retrieval of subsequent data. * * @returns {Promise} A promise that resolves to a `NotificationsResponse` object, * containing the user's notifications. From 1f7796b7bd825007b78018aa4a208419ab3af64a Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Tue, 28 Nov 2023 22:18:28 +0530 Subject: [PATCH 76/77] Export CastParamType from index.ts --- src/neynar-api/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/neynar-api/index.ts b/src/neynar-api/index.ts index 6d669883..c4f9d1c4 100644 --- a/src/neynar-api/index.ts +++ b/src/neynar-api/index.ts @@ -1,3 +1,3 @@ export * from "./neynar-api-client"; export * from "./utils"; -export { FeedType, FilterType, ReactionsType } from "./v2"; +export { FeedType, FilterType, ReactionsType, CastParamType } from "./v2"; From 82072d15bd5bcec1f24f7064042986b55670bfa9 Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Tue, 28 Nov 2023 23:15:04 +0530 Subject: [PATCH 77/77] Update readme and package.json --- README.md | 26 +++------ docs/getting-started.md | 116 ---------------------------------------- package.json | 4 +- 3 files changed, 8 insertions(+), 138 deletions(-) delete mode 100644 docs/getting-started.md diff --git a/README.md b/README.md index 18d74cc9..421ce7ce 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,13 @@ # @neynar/nodejs-sdk -@neynar/nodejs-sdk typescript-based, easy-to-use SDK built to interact with [Neynar API's](https://docs.neynar.com/). - -## Instantiate Client -Just set the NEYNAR_API_KEY while instantiating a client and you are good to go. - -``` -import { NeynarAPIClient } from "@neynar/nodejs-sdk"; +@neynar/nodejs-sdk typescript-based, easy-to-use SDK built to interact with [Neynar API's](https://docs.neynar.com/). -const neynarClient = new NeynarAPIClient(process.env.NEYNAR_API_KEY); +## Usage -export default neynarClient; -``` +Please refer our [Getting Started Guide](https://docs.neynar.com/reference/getting-started-with-sdk) -## Use Client +Checkout [examples](https://github.com/neynarxyz/farcaster-examples) using this SDK -Errors are propagated, so the user can handle them as they please, so use try/catch or .catch() and handle errors accordingly +## License -``` -try { - const recentCasts = await neynarClient.fetchRecentCasts(); - console.log("Recent Casts", recentCasts); -} catch (error) { - console.log((error as AxiosError).response?.data || (error as Error)); -} -``` +This project is licensed under the MIT License - see the [LICENSE](https://github.com/neynarxyz/nodejs-sdk/blob/main/LICENSE) file for details. diff --git a/docs/getting-started.md b/docs/getting-started.md deleted file mode 100644 index 0c41209a..00000000 --- a/docs/getting-started.md +++ /dev/null @@ -1,116 +0,0 @@ -Checkout the full github repo here: -https://github.com/neynarxyz/nodejs-sdk - -### Installation - -Install [ Nodejs](https://nodejs.org/en/download/package-manager), [yarn](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable) (Optional, you can also use npm) - -#### Initiallize project - -```bash -mkdir get-started-with-neynar -cd get-started-with-neynar -npm init -y -npm install -g typescript -tsc --init -``` - -#### Install Neynar SDK and other dependencies - -
-Install using npm -

-    npm i @neynar/nodejs-sdk axios
-    npm i -D typescript ts-node
-    
-
- -
- Install using Yarn -

-    yarn add @neynar/nodejs-sdk axios
-    yarn add -D typescript ts-node
-    
-
- -     - -### Example: Let's use sdk to look up a user by their FID - -Create index.ts file at root level - -```bash -touch index.ts -``` - -Add following code in index.ts - -```typescript -// index.ts - -import { NeynarAPIClient, isApiErrorResponse } from "@neynar/nodejs-sdk"; -import { AxiosError } from "axios"; - -// Instantiate the client -const client = new NeynarAPIClient(""); // Replace with your Neynar API Key. - -(async () => { - try { - // here 19960 (Required*) => User we are looking for. - // 191 (Optional) => is viewer looking for the user. - // Get more info @ https://docs.neynar.com/reference/user-v1 - const user = await client.lookupUserByFid(19960, 191); - - // Stringify and log the response - console.log(JSON.stringify(user)); - } catch (error) { - // isApiErrorResponse can be used to check for Neynar API errors - // handle errors accordingly - if (isApiErrorResponse(error)) { - console.log("API Error", error.response.data); - } else { - console.log("Generic Error", error); - } - } -})(); -``` - -Run the project - -```bash -npx ts-node index.ts -``` - -You should see a response like this. (You might not get beautified/ formated response since we `JSON.stringify` the response in order to log everything) - -```json -{ - "result": { - "user": { - "fid": 19960, - "custodyAddress": "0xd1b702203b1b3b641a699997746bd4a12d157909", - "username": "shreyas-chorge", - "displayName": "Shreyas", - "pfp": { - "url": "https://i.imgur.com/LPzRlQl.jpg" - }, - "profile": { - "bio": { - "text": "Everyday regular normal guy | 👨‍💻 @neynar", - "mentionedProfiles": [] - } - }, - "followerCount": 13, - "followingCount": 55, - "verifications": ["0xd1b702203b1b3b641a699997746bd4a12d157909"], - "activeStatus": "inactive", - "viewerContext": { - "following": true, - "followedBy": false - } - } - } -} -``` - -### Congratulation..!! 🎉 You successfully setup @neynar/nodejs-sdk and used it to look up a user by their FID. diff --git a/package.json b/package.json index a177dfb4..cebe2e5f 100644 --- a/package.json +++ b/package.json @@ -10,12 +10,12 @@ "scripts": { "clean": "del-cli ./build/*", "build": "yarn run clean && tsc", - "generate:neynar-oas": "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-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" }, "author": "Neynar", - "license": "ISC", + "license": "MIT", "devDependencies": { "@types/node": "^20.8.4", "del-cli": "^5.1.0",