Skip to content

Commit

Permalink
Fix imports and sdk version (#241)
Browse files Browse the repository at this point in the history
* Moved OAS submodule to project root in 'oas' directory

* clean up

* Setup configurations

* Update readme

* Add wrapper generator script

* Add starter code and update path

* Add templates

* Update gitignore

* rename -> tsconfig.script.json

* update yarn lock

* Log number of generated methods

* Make webhook types fired from convoy available

* v2-alpha

* Update OAS and accept params as camelCase

* Update alpha version

* generate code

* Fix global header construction logic

* Generate code

* 2.0.0-alpha.3

* Accept addresses as string[] rather than string in fetchSubscriptionCheck

* 2.0.0-alpha.4

* Rename fetchBulkUsersByEthereumAddress -> fetchBulkUsersByEthereumOrSolAddress

* 2.0.0-alpha.5

* Rename fetchBulkUsersByEthereumOrSolAddress -> fetchBulkUsersByEthOrSolAddress

* 2.0.0-alpha.6

* Add postinstall logs and error out if config is a string and show the correct usage

* 2.0.0-alpha.7

* move postinstall script in src

* move postinstall script in src

* 2.0.0-alpha.9

* move postinstall script in src

* 2.0.0-alpha.10

* Change path for postinstall script

* change warn to log

* remove node postinstall

* 2.0.0-alpha.14

* 2.0.0-alpha.15

* Cleanup postinstall work

* Make apis private

* format errors correctly

* 2.0.0-alpha.18

* Generate code

* 2.0.0-alpha.19

* Update code

* 2.0.0-alpha.20

* change import style

* send correct sdk version

* 2.0.0-alpha.22

* Bumpup patch version

* fix trigger branch
  • Loading branch information
Shreyaschorge authored Nov 22, 2024
1 parent a37934e commit 54b8cfa
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 8 deletions.
2 changes: 1 addition & 1 deletion oas
Submodule oas updated 1 files
+110 −0 contribution.md
11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
{
"name": "@neynar/nodejs-sdk",
"version": "2.0.0",
"version": "2.0.1",
"description": "SDK to interact with Neynar APIs (https://docs.neynar.com/reference/quickstart)",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"exports": {
".": {
"require": "./build/index.js",
"import": "./build/index.js",
"types": "./build/index.d.ts"
},
"./api": "./build/api/index.js",
"./hub-api": "./build/hub-api/index.js"
},
"files": [
"build/**/*"
],
Expand Down
5 changes: 4 additions & 1 deletion scripts/generate-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,8 @@ const client = new ${clientClassName}(config);\\n\`);
const axiosInstance = customAxiosInstance || axios.create({
headers: {
"x-sdk-version": process.env.npm_package_version,
"x-sdk-version": sdkVersion,
"x-sdk": "node"
},
});
Expand Down Expand Up @@ -1105,6 +1106,8 @@ ${apiFiles
.join("\n")}
${importStatements}
const { version: sdkVersion } = require("../../package.json");
${utilityFunctions}
${wrapperCode}`;
Expand Down
5 changes: 4 additions & 1 deletion src/clients/NeynarAPIClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import { UserApi } from '../api/apis/user-api';
import { WebhookApi } from '../api/apis/webhook-api';
import type { AddVerificationReqBody, AuthorizationUrlResponse, AuthorizationUrlResponseType, BalanceResponse, BanListResponse, BanReqBody, BanResponse, BlockListResponse, BlockReqBody, BulkCastsResponse, BulkFollowResponse, BulkUserAddressType, BulkUsersByAddressResponse, BulkUsersResponse, BuyStorageReqBody, CastComposerActionsListResponse, CastComposerType, CastConversationSortType, CastParamType, CastResponse, CastsResponse, CastsSearchResponse, ChannelFollowReqBody, ChannelListResponse, ChannelMemberInviteListResponse, ChannelMemberListResponse, ChannelMemberRole, ChannelResponse, ChannelResponseBulk, ChannelSearchResponse, ChannelType, Conversation, DeleteCastReqBody, DeleteFrameReqBody, DeleteFrameResponse, DeveloperManagedSigner, EmbedType, ErrorRes, FarcasterActionReqBody, FarcasterActionReqBodyAction, FeedResponse, FeedTrendingProvider, FeedType, FetchBulkCastsSortTypeEnum, FetchFrameMetaTagsFromUrl200Response, FetchRepliesAndRecastsForUserFilterEnum, FetchTrendingChannelsTimeWindowEnum, FetchTrendingFeedTimeWindowEnum, FilterType, FnameAvailabilityResponse, FollowReqBody, FollowSortType, FollowersResponse, ForYouProvider, Frame, FrameAction, FrameActionReqBody, FrameDeveloperManagedActionReqBody, FrameSignaturePacket, FrameType, FrameValidateAnalyticsResponse, FrameValidateListResponse, InviteChannelMemberReqBody, LookupCastConversationFoldEnum, MarkNotificationsAsSeenReqBody, MuteListResponse, MuteReqBody, MuteResponse, Networks, NeynarFrame, NeynarFrameCreationReqBody, NeynarFramePage, NeynarFrameUpdateReqBody, NotificationType, NotificationsResponse, OperationResponse, PostCastReqBody, PostCastReqBodyEmbeds, PostCastResponse, ReactionReqBody, ReactionType, ReactionsCastResponse, ReactionsResponse, ReactionsType, RegisterDeveloperManagedSignedKeyReqBody, RegisterSignerKeyReqBody, RegisterUserReqBody, RegisterUserResponse, RelevantFollowersResponse, RemoveChannelMemberReqBody, RemoveVerificationReqBody, RespondChannelInviteReqBody, SignedKeyRequestSponsor, Signer, StorageAllocationsResponse, StorageUsageResponse, SubscribedToResponse, SubscribersResponse, SubscriptionCheckResponse, SubscriptionProvider, SubscriptionProviders, SubscriptionsResponse, TrendingChannelResponse, UpdateUserReqBody, UpdateUserReqBodyLocation, UserFIDResponse, UserPowerLiteResponse, UserResponse, UserSearchResponse, UsersActiveChannelsResponse, UsersResponse, ValidateFrameActionReqBody, ValidateFrameActionResponse, ValidateFrameAggregateWindow, ValidateFrameAnalyticsType, VerificationChainId, VerificationType, WebhookDeleteReqBody, WebhookListResponse, WebhookPatchReqBody, WebhookPatchReqBodyActiveEnum, WebhookPostReqBody, WebhookPutReqBody, WebhookResponse, WebhookSubscriptionFilters } from '../api';

const { version: sdkVersion } = require("../../package.json");


/**
* Converts a camelCase string to snake_case.
Expand Down Expand Up @@ -138,7 +140,8 @@ const client = new NeynarAPIClient(config);\n`);

const axiosInstance = customAxiosInstance || axios.create({
headers: {
"x-sdk-version": process.env.npm_package_version,
"x-sdk-version": sdkVersion,
"x-sdk": "node"
},
});

Expand Down
5 changes: 4 additions & 1 deletion src/clients/NeynarHubClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import { UsernamesApi } from '../hub-api/apis/usernames-api';
import { VerificationsApi } from '../hub-api/apis/verifications-api';
import type { CastAdd, FetchCastReactions200Response, FetchEvents200Response, FetchUserData200Response, FetchUserFollowing200Response, FetchUserOnChainEvents200Response, FetchUserOnChainSignersEvents200Response, FetchUsersCasts200Response, FetchVerificationsByFid200Response, FidsResponse, HubEvent, HubInfoResponse, LinkAdd, LinkType, Message, OnChainEventIdRegister, OnChainEventType, Reaction, ReactionType, StorageLimitsResponse, UserDataType, UserNameProof, UsernameProofsResponse, ValidateMessageResponse } from '../hub-api';

const { version: sdkVersion } = require("../../package.json");


/**
* Converts a camelCase string to snake_case.
Expand Down Expand Up @@ -126,7 +128,8 @@ const client = new NeynarHubClient(config);\n`);

const axiosInstance = customAxiosInstance || axios.create({
headers: {
"x-sdk-version": process.env.npm_package_version,
"x-sdk-version": sdkVersion,
"x-sdk": "node"
},
});

Expand Down
8 changes: 5 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@
"module": "commonjs" /* Specify what module code is generated. */,
// "rootDir": "./", /* Specify the root folder within your source files. */
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
"baseUrl": "./" /* Specify the base directory to resolve non-relative module names. */,
"paths": {
"@neynar/nodejs-sdk/*": ["./src/*"]
} /* Specify a set of entries that re-map imports to additional lookup locations. */,
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
Expand Down Expand Up @@ -107,5 +109,5 @@
"skipLibCheck": true /* Skip type checking all .d.ts files. */
},
"include": ["src/**/*"],
"exclude": ["scripts/**/*", "**/*.spec.ts"]
"exclude": ["scripts/**/*", "**/*.spec.ts", "node_modules", "build"]
}

0 comments on commit 54b8cfa

Please sign in to comment.