twitter-openapi-typescript-generated 0.0.15 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +59 -1
- package/.openapi-generator/VERSION +1 -1
- package/README.md +5 -4
- package/dist/apis/DefaultApi.d.ts +1 -1
- package/dist/apis/DefaultApi.d.ts.map +1 -1
- package/dist/apis/DefaultApi.js +305 -137
- package/dist/apis/DefaultApi.js.map +1 -1
- package/dist/apis/OtherApi.d.ts +1 -1
- package/dist/apis/OtherApi.d.ts.map +1 -1
- package/dist/apis/OtherApi.js +153 -69
- package/dist/apis/OtherApi.js.map +1 -1
- package/dist/apis/PostApi.d.ts +1 -1
- package/dist/apis/PostApi.d.ts.map +1 -1
- package/dist/apis/PostApi.js +919 -415
- package/dist/apis/PostApi.js.map +1 -1
- package/dist/apis/TweetApi.d.ts +1 -1
- package/dist/apis/TweetApi.d.ts.map +1 -1
- package/dist/apis/TweetApi.js +1673 -749
- package/dist/apis/TweetApi.js.map +1 -1
- package/dist/apis/UserApi.d.ts +1 -1
- package/dist/apis/UserApi.d.ts.map +1 -1
- package/dist/apis/UserApi.js +305 -137
- package/dist/apis/UserApi.js.map +1 -1
- package/dist/apis/UserListApi.d.ts +1 -1
- package/dist/apis/UserListApi.d.ts.map +1 -1
- package/dist/apis/UserListApi.js +761 -341
- package/dist/apis/UserListApi.js.map +1 -1
- package/dist/apis/UsersApi.d.ts +1 -1
- package/dist/apis/UsersApi.d.ts.map +1 -1
- package/dist/apis/UsersApi.js +153 -69
- package/dist/apis/UsersApi.js.map +1 -1
- package/dist/apis/V11GetApi.js +302 -134
- package/dist/apis/V11GetApi.js.map +1 -1
- package/dist/apis/V11PostApi.js +292 -122
- package/dist/apis/V11PostApi.js.map +1 -1
- package/dist/apis/V20GetApi.js +151 -67
- package/dist/apis/V20GetApi.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/models/AdditionalMediaInfo.d.ts +32 -0
- package/dist/models/AdditionalMediaInfo.d.ts.map +1 -1
- package/dist/models/AdditionalMediaInfo.js +13 -0
- package/dist/models/AdditionalMediaInfo.js.map +1 -1
- package/dist/models/AdditionalMediaInfoCallToActions.d.ts +39 -0
- package/dist/models/AdditionalMediaInfoCallToActions.d.ts.map +1 -0
- package/dist/models/AdditionalMediaInfoCallToActions.js +54 -0
- package/dist/models/AdditionalMediaInfoCallToActions.js.map +1 -0
- package/dist/models/AdditionalMediaInfoCallToActionsUrl.d.ts +32 -0
- package/dist/models/AdditionalMediaInfoCallToActionsUrl.d.ts.map +1 -0
- package/dist/models/AdditionalMediaInfoCallToActionsUrl.js +51 -0
- package/dist/models/AdditionalMediaInfoCallToActionsUrl.js.map +1 -0
- package/dist/models/AuthorCommunityRelationship.d.ts +53 -0
- package/dist/models/AuthorCommunityRelationship.d.ts.map +1 -0
- package/dist/models/AuthorCommunityRelationship.js +64 -0
- package/dist/models/AuthorCommunityRelationship.js.map +1 -0
- package/dist/models/BirdwatchEntityRef.d.ts +9 -2
- package/dist/models/BirdwatchEntityRef.d.ts.map +1 -1
- package/dist/models/BirdwatchEntityRef.js +7 -5
- package/dist/models/BirdwatchEntityRef.js.map +1 -1
- package/dist/models/BirdwatchPivot.d.ts +7 -0
- package/dist/models/BirdwatchPivot.d.ts.map +1 -1
- package/dist/models/BirdwatchPivot.js +3 -0
- package/dist/models/BirdwatchPivot.js.map +1 -1
- package/dist/models/BirdwatchPivotCallToAction.d.ts +44 -0
- package/dist/models/BirdwatchPivotCallToAction.d.ts.map +1 -0
- package/dist/models/BirdwatchPivotCallToAction.js +57 -0
- package/dist/models/BirdwatchPivotCallToAction.js.map +1 -0
- package/dist/models/Community.d.ts +33 -0
- package/dist/models/Community.d.ts.map +1 -0
- package/dist/models/Community.js +52 -0
- package/dist/models/Community.js.map +1 -0
- package/dist/models/CommunityActions.d.ts +54 -0
- package/dist/models/CommunityActions.d.ts.map +1 -0
- package/dist/models/CommunityActions.js +64 -0
- package/dist/models/CommunityActions.js.map +1 -0
- package/dist/models/CommunityData.d.ts +217 -0
- package/dist/models/CommunityData.d.ts.map +1 -0
- package/dist/models/CommunityData.js +145 -0
- package/dist/models/CommunityData.js.map +1 -0
- package/dist/models/CommunityDeleteActionResult.d.ts +46 -0
- package/dist/models/CommunityDeleteActionResult.d.ts.map +1 -0
- package/dist/models/CommunityDeleteActionResult.js +61 -0
- package/dist/models/CommunityDeleteActionResult.js.map +1 -0
- package/dist/models/CommunityInvitesResult.d.ts +52 -0
- package/dist/models/CommunityInvitesResult.d.ts.map +1 -0
- package/dist/models/CommunityInvitesResult.js +64 -0
- package/dist/models/CommunityInvitesResult.js.map +1 -0
- package/dist/models/CommunityJoinActionResult.d.ts +33 -0
- package/dist/models/CommunityJoinActionResult.d.ts.map +1 -0
- package/dist/models/CommunityJoinActionResult.js +52 -0
- package/dist/models/CommunityJoinActionResult.js.map +1 -0
- package/dist/models/CommunityJoinRequestsResult.d.ts +33 -0
- package/dist/models/CommunityJoinRequestsResult.d.ts.map +1 -0
- package/dist/models/CommunityJoinRequestsResult.js +52 -0
- package/dist/models/CommunityJoinRequestsResult.js.map +1 -0
- package/dist/models/CommunityLeaveActionResult.d.ts +52 -0
- package/dist/models/CommunityLeaveActionResult.d.ts.map +1 -0
- package/dist/models/CommunityLeaveActionResult.js +64 -0
- package/dist/models/CommunityLeaveActionResult.js.map +1 -0
- package/dist/models/CommunityPinActionResult.d.ts +33 -0
- package/dist/models/CommunityPinActionResult.d.ts.map +1 -0
- package/dist/models/CommunityPinActionResult.js +52 -0
- package/dist/models/CommunityPinActionResult.js.map +1 -0
- package/dist/models/CommunityRule.d.ts +44 -0
- package/dist/models/CommunityRule.d.ts.map +1 -0
- package/dist/models/CommunityRule.js +57 -0
- package/dist/models/CommunityRule.js.map +1 -0
- package/dist/models/CommunityUrls.d.ts +33 -0
- package/dist/models/CommunityUrls.d.ts.map +1 -0
- package/dist/models/CommunityUrls.js +52 -0
- package/dist/models/CommunityUrls.js.map +1 -0
- package/dist/models/CommunityUrlsPermalink.d.ts +32 -0
- package/dist/models/CommunityUrlsPermalink.d.ts.map +1 -0
- package/dist/models/CommunityUrlsPermalink.js +51 -0
- package/dist/models/CommunityUrlsPermalink.js.map +1 -0
- package/dist/models/ContentUnion.d.ts +3 -3
- package/dist/models/ContentUnion.d.ts.map +1 -1
- package/dist/models/ContentUnion.js.map +1 -1
- package/dist/models/DisplayTreatment.d.ts +32 -0
- package/dist/models/DisplayTreatment.d.ts.map +1 -0
- package/dist/models/DisplayTreatment.js +51 -0
- package/dist/models/DisplayTreatment.js.map +1 -0
- package/dist/models/DisplayType.d.ts +26 -0
- package/dist/models/DisplayType.d.ts.map +1 -0
- package/dist/models/DisplayType.js +39 -0
- package/dist/models/DisplayType.js.map +1 -0
- package/dist/models/FeedbackInfo.d.ts +32 -0
- package/dist/models/FeedbackInfo.d.ts.map +1 -0
- package/dist/models/FeedbackInfo.js +51 -0
- package/dist/models/FeedbackInfo.js.map +1 -0
- package/dist/models/GetBookmarks200Response.d.ts +2 -2
- package/dist/models/GetBookmarks200Response.d.ts.map +1 -1
- package/dist/models/GetBookmarks200Response.js.map +1 -1
- package/dist/models/GetFavoriters200Response.d.ts +2 -2
- package/dist/models/GetFavoriters200Response.d.ts.map +1 -1
- package/dist/models/GetFavoriters200Response.js.map +1 -1
- package/dist/models/GetFollowers200Response.d.ts +2 -2
- package/dist/models/GetFollowers200Response.d.ts.map +1 -1
- package/dist/models/GetFollowers200Response.js.map +1 -1
- package/dist/models/GetHomeLatestTimeline200Response.d.ts +2 -2
- package/dist/models/GetHomeLatestTimeline200Response.d.ts.map +1 -1
- package/dist/models/GetHomeLatestTimeline200Response.js.map +1 -1
- package/dist/models/GetLikes200Response.d.ts +2 -2
- package/dist/models/GetLikes200Response.d.ts.map +1 -1
- package/dist/models/GetLikes200Response.js.map +1 -1
- package/dist/models/GetListLatestTweetsTimeline200Response.d.ts +2 -2
- package/dist/models/GetListLatestTweetsTimeline200Response.d.ts.map +1 -1
- package/dist/models/GetListLatestTweetsTimeline200Response.js.map +1 -1
- package/dist/models/GetProfileSpotlightsQuery200Response.d.ts +2 -2
- package/dist/models/GetProfileSpotlightsQuery200Response.d.ts.map +1 -1
- package/dist/models/GetProfileSpotlightsQuery200Response.js.map +1 -1
- package/dist/models/GetRetweeters200Response.d.ts +2 -2
- package/dist/models/GetRetweeters200Response.d.ts.map +1 -1
- package/dist/models/GetRetweeters200Response.js.map +1 -1
- package/dist/models/GetSearchTimeline200Response.d.ts +2 -2
- package/dist/models/GetSearchTimeline200Response.d.ts.map +1 -1
- package/dist/models/GetSearchTimeline200Response.js.map +1 -1
- package/dist/models/GetTweetDetail200Response.d.ts +2 -2
- package/dist/models/GetTweetDetail200Response.d.ts.map +1 -1
- package/dist/models/GetTweetDetail200Response.js.map +1 -1
- package/dist/models/GetTweetResultByRestId200Response.d.ts +2 -2
- package/dist/models/GetTweetResultByRestId200Response.d.ts.map +1 -1
- package/dist/models/GetTweetResultByRestId200Response.js.map +1 -1
- package/dist/models/GetUserByRestId200Response.d.ts +2 -2
- package/dist/models/GetUserByRestId200Response.d.ts.map +1 -1
- package/dist/models/GetUserByRestId200Response.js.map +1 -1
- package/dist/models/GetUserHighlightsTweets200Response.d.ts +2 -2
- package/dist/models/GetUserHighlightsTweets200Response.d.ts.map +1 -1
- package/dist/models/GetUserHighlightsTweets200Response.js.map +1 -1
- package/dist/models/GetUsersByRestIds200Response.d.ts +2 -2
- package/dist/models/GetUsersByRestIds200Response.d.ts.map +1 -1
- package/dist/models/GetUsersByRestIds200Response.js.map +1 -1
- package/dist/models/Highlight.d.ts +33 -0
- package/dist/models/Highlight.d.ts.map +1 -0
- package/dist/models/Highlight.js +52 -0
- package/dist/models/Highlight.js.map +1 -0
- package/dist/models/InstructionUnion.d.ts +8 -8
- package/dist/models/InstructionUnion.d.ts.map +1 -1
- package/dist/models/InstructionUnion.js.map +1 -1
- package/dist/models/ItemContentUnion.d.ts +6 -6
- package/dist/models/ItemContentUnion.d.ts.map +1 -1
- package/dist/models/ItemContentUnion.js +1 -1
- package/dist/models/ItemContentUnion.js.map +1 -1
- package/dist/models/Media.d.ts +54 -0
- package/dist/models/Media.d.ts.map +1 -1
- package/dist/models/Media.js +20 -0
- package/dist/models/Media.js.map +1 -1
- package/dist/models/MediaExtended.d.ts +25 -0
- package/dist/models/MediaExtended.d.ts.map +1 -1
- package/dist/models/MediaExtended.js +9 -0
- package/dist/models/MediaExtended.js.map +1 -1
- package/dist/models/ModuleEntry.d.ts +8 -1
- package/dist/models/ModuleEntry.d.ts.map +1 -1
- package/dist/models/ModuleEntry.js +5 -2
- package/dist/models/ModuleEntry.js.map +1 -1
- package/dist/models/Other200Response.d.ts +1 -1
- package/dist/models/Other200Response.d.ts.map +1 -1
- package/dist/models/Other200Response.js.map +1 -1
- package/dist/models/PostCreateRetweet200Response.d.ts +2 -2
- package/dist/models/PostCreateRetweet200Response.d.ts.map +1 -1
- package/dist/models/PostCreateRetweet200Response.js.map +1 -1
- package/dist/models/PostCreateTweet200Response.d.ts +2 -2
- package/dist/models/PostCreateTweet200Response.d.ts.map +1 -1
- package/dist/models/PostCreateTweet200Response.js.map +1 -1
- package/dist/models/PostCreateTweetRequestFeatures.d.ts +12 -0
- package/dist/models/PostCreateTweetRequestFeatures.d.ts.map +1 -1
- package/dist/models/PostCreateTweetRequestFeatures.js +6 -0
- package/dist/models/PostCreateTweetRequestFeatures.js.map +1 -1
- package/dist/models/PostCreateTweetRequestVariables.d.ts +7 -0
- package/dist/models/PostCreateTweetRequestVariables.d.ts.map +1 -1
- package/dist/models/PostCreateTweetRequestVariables.js +4 -0
- package/dist/models/PostCreateTweetRequestVariables.js.map +1 -1
- package/dist/models/PostCreateTweetRequestVariablesReply.d.ts +38 -0
- package/dist/models/PostCreateTweetRequestVariablesReply.d.ts.map +1 -0
- package/dist/models/PostCreateTweetRequestVariablesReply.js +54 -0
- package/dist/models/PostCreateTweetRequestVariablesReply.js.map +1 -0
- package/dist/models/PostDeleteRetweet200Response.d.ts +2 -2
- package/dist/models/PostDeleteRetweet200Response.d.ts.map +1 -1
- package/dist/models/PostDeleteRetweet200Response.js.map +1 -1
- package/dist/models/PostDeleteTweet200Response.d.ts +2 -2
- package/dist/models/PostDeleteTweet200Response.d.ts.map +1 -1
- package/dist/models/PostDeleteTweet200Response.js.map +1 -1
- package/dist/models/PostFavoriteTweet200Response.d.ts +2 -2
- package/dist/models/PostFavoriteTweet200Response.d.ts.map +1 -1
- package/dist/models/PostFavoriteTweet200Response.js.map +1 -1
- package/dist/models/PostUnfavoriteTweet200Response.d.ts +2 -2
- package/dist/models/PostUnfavoriteTweet200Response.d.ts.map +1 -1
- package/dist/models/PostUnfavoriteTweet200Response.js.map +1 -1
- package/dist/models/PrimaryCommunityTopic.d.ts +38 -0
- package/dist/models/PrimaryCommunityTopic.d.ts.map +1 -0
- package/dist/models/PrimaryCommunityTopic.js +54 -0
- package/dist/models/PrimaryCommunityTopic.js.map +1 -0
- package/dist/models/QuotedRefResult.d.ts +33 -0
- package/dist/models/QuotedRefResult.d.ts.map +1 -0
- package/dist/models/QuotedRefResult.js +52 -0
- package/dist/models/QuotedRefResult.js.map +1 -0
- package/dist/models/QuotedStatusPermalink.d.ts +44 -0
- package/dist/models/QuotedStatusPermalink.d.ts.map +1 -0
- package/dist/models/QuotedStatusPermalink.js +57 -0
- package/dist/models/QuotedStatusPermalink.js.map +1 -0
- package/dist/models/SensitiveMediaWarning.d.ts +44 -0
- package/dist/models/SensitiveMediaWarning.d.ts.map +1 -0
- package/dist/models/SensitiveMediaWarning.js +57 -0
- package/dist/models/SensitiveMediaWarning.js.map +1 -0
- package/dist/models/SocialContextLandingUrl.d.ts +54 -0
- package/dist/models/SocialContextLandingUrl.d.ts.map +1 -0
- package/dist/models/SocialContextLandingUrl.js +64 -0
- package/dist/models/SocialContextLandingUrl.js.map +1 -0
- package/dist/models/SocialContextUnion.d.ts +27 -0
- package/dist/models/SocialContextUnion.d.ts.map +1 -0
- package/dist/models/SocialContextUnion.js +65 -0
- package/dist/models/SocialContextUnion.js.map +1 -0
- package/dist/models/SocialContextUnionType.d.ts +24 -0
- package/dist/models/SocialContextUnionType.d.ts.map +1 -0
- package/dist/models/SocialContextUnionType.js +37 -0
- package/dist/models/SocialContextUnionType.js.map +1 -0
- package/dist/models/SuperFollowsReplyUserResult.d.ts +33 -0
- package/dist/models/SuperFollowsReplyUserResult.d.ts.map +1 -0
- package/dist/models/SuperFollowsReplyUserResult.js +52 -0
- package/dist/models/SuperFollowsReplyUserResult.js.map +1 -0
- package/dist/models/SuperFollowsReplyUserResultData.d.ts +40 -0
- package/dist/models/SuperFollowsReplyUserResultData.d.ts.map +1 -0
- package/dist/models/SuperFollowsReplyUserResultData.js +56 -0
- package/dist/models/SuperFollowsReplyUserResultData.js.map +1 -0
- package/dist/models/SuperFollowsReplyUserResultLegacy.d.ts +32 -0
- package/dist/models/SuperFollowsReplyUserResultLegacy.d.ts.map +1 -0
- package/dist/models/SuperFollowsReplyUserResultLegacy.js +51 -0
- package/dist/models/SuperFollowsReplyUserResultLegacy.js.map +1 -0
- package/dist/models/TextHighlight.d.ts +38 -0
- package/dist/models/TextHighlight.d.ts.map +1 -0
- package/dist/models/TextHighlight.js +54 -0
- package/dist/models/TextHighlight.js.map +1 -0
- package/dist/models/TimelineGeneralContext.d.ts +65 -0
- package/dist/models/TimelineGeneralContext.d.ts.map +1 -0
- package/dist/models/TimelineGeneralContext.js +71 -0
- package/dist/models/TimelineGeneralContext.js.map +1 -0
- package/dist/models/TimelineTimelineCursor.d.ts +13 -0
- package/dist/models/TimelineTimelineCursor.d.ts.map +1 -1
- package/dist/models/TimelineTimelineCursor.js +6 -0
- package/dist/models/TimelineTimelineCursor.js.map +1 -1
- package/dist/models/TimelineTimelineModule.d.ts +18 -10
- package/dist/models/TimelineTimelineModule.d.ts.map +1 -1
- package/dist/models/TimelineTimelineModule.js +9 -10
- package/dist/models/TimelineTimelineModule.js.map +1 -1
- package/dist/models/TimelineTopicContext.d.ts +53 -0
- package/dist/models/TimelineTopicContext.d.ts.map +1 -0
- package/dist/models/TimelineTopicContext.js +63 -0
- package/dist/models/TimelineTopicContext.js.map +1 -0
- package/dist/models/TimelineTweet.d.ts +12 -5
- package/dist/models/TimelineTweet.d.ts.map +1 -1
- package/dist/models/TimelineTweet.js +6 -3
- package/dist/models/TimelineTweet.js.map +1 -1
- package/dist/models/TimelineUser.d.ts +7 -7
- package/dist/models/TimelineUser.d.ts.map +1 -1
- package/dist/models/TimelineUser.js +3 -3
- package/dist/models/TimelineUser.js.map +1 -1
- package/dist/models/TopicContext.d.ts +68 -0
- package/dist/models/TopicContext.d.ts.map +1 -0
- package/dist/models/TopicContext.js +63 -0
- package/dist/models/TopicContext.js.map +1 -0
- package/dist/models/Tweet.d.ts +44 -3
- package/dist/models/Tweet.d.ts.map +1 -1
- package/dist/models/Tweet.js +20 -6
- package/dist/models/Tweet.js.map +1 -1
- package/dist/models/TweetCardLegacy.d.ts +14 -0
- package/dist/models/TweetCardLegacy.d.ts.map +1 -1
- package/dist/models/TweetCardLegacy.js +7 -0
- package/dist/models/TweetCardLegacy.js.map +1 -1
- package/dist/models/TweetCardLegacyBindingValueData.d.ts +22 -0
- package/dist/models/TweetCardLegacyBindingValueData.d.ts.map +1 -1
- package/dist/models/TweetCardLegacyBindingValueData.js +8 -0
- package/dist/models/TweetCardLegacyBindingValueData.js.map +1 -1
- package/dist/models/TweetCardLegacyBindingValueDataImage.d.ts +50 -0
- package/dist/models/TweetCardLegacyBindingValueDataImage.d.ts.map +1 -0
- package/dist/models/TweetCardLegacyBindingValueDataImage.js +60 -0
- package/dist/models/TweetCardLegacyBindingValueDataImage.js.map +1 -0
- package/dist/models/TweetCardPlatform.d.ts +40 -0
- package/dist/models/TweetCardPlatform.d.ts.map +1 -0
- package/dist/models/TweetCardPlatform.js +56 -0
- package/dist/models/TweetCardPlatform.js.map +1 -0
- package/dist/models/TweetCardPlatformAudience.d.ts +39 -0
- package/dist/models/TweetCardPlatformAudience.d.ts.map +1 -0
- package/dist/models/TweetCardPlatformAudience.js +57 -0
- package/dist/models/TweetCardPlatformAudience.js.map +1 -0
- package/dist/models/TweetCardPlatformData.d.ts +33 -0
- package/dist/models/TweetCardPlatformData.d.ts.map +1 -0
- package/dist/models/TweetCardPlatformData.js +52 -0
- package/dist/models/TweetCardPlatformData.js.map +1 -0
- package/dist/models/TweetCardPlatformDevice.d.ts +38 -0
- package/dist/models/TweetCardPlatformDevice.d.ts.map +1 -0
- package/dist/models/TweetCardPlatformDevice.js +54 -0
- package/dist/models/TweetCardPlatformDevice.js.map +1 -0
- package/dist/models/TweetInterstitial.d.ts +60 -0
- package/dist/models/TweetInterstitial.d.ts.map +1 -0
- package/dist/models/TweetInterstitial.js +69 -0
- package/dist/models/TweetInterstitial.js.map +1 -0
- package/dist/models/TweetInterstitialRevealText.d.ts +45 -0
- package/dist/models/TweetInterstitialRevealText.d.ts.map +1 -0
- package/dist/models/TweetInterstitialRevealText.js +58 -0
- package/dist/models/TweetInterstitialRevealText.js.map +1 -0
- package/dist/models/TweetInterstitialText.d.ts +45 -0
- package/dist/models/TweetInterstitialText.d.ts.map +1 -0
- package/dist/models/TweetInterstitialText.js +58 -0
- package/dist/models/TweetInterstitialText.js.map +1 -0
- package/dist/models/TweetInterstitialTextEntity.d.ts +45 -0
- package/dist/models/TweetInterstitialTextEntity.d.ts.map +1 -0
- package/dist/models/TweetInterstitialTextEntity.js +58 -0
- package/dist/models/TweetInterstitialTextEntity.js.map +1 -0
- package/dist/models/TweetInterstitialTextEntityRef.d.ts +58 -0
- package/dist/models/TweetInterstitialTextEntityRef.d.ts.map +1 -0
- package/dist/models/TweetInterstitialTextEntityRef.js +69 -0
- package/dist/models/TweetInterstitialTextEntityRef.js.map +1 -0
- package/dist/models/TweetLegacy.d.ts +71 -0
- package/dist/models/TweetLegacy.d.ts.map +1 -1
- package/dist/models/TweetLegacy.js +31 -1
- package/dist/models/TweetLegacy.js.map +1 -1
- package/dist/models/TweetLegacyScopes.d.ts +32 -0
- package/dist/models/TweetLegacyScopes.d.ts.map +1 -0
- package/dist/models/TweetLegacyScopes.js +51 -0
- package/dist/models/TweetLegacyScopes.js.map +1 -0
- package/dist/models/TweetPreviousCounts.d.ts +56 -0
- package/dist/models/TweetPreviousCounts.d.ts.map +1 -0
- package/dist/models/TweetPreviousCounts.js +63 -0
- package/dist/models/TweetPreviousCounts.js.map +1 -0
- package/dist/models/TweetUnion.d.ts +3 -3
- package/dist/models/TweetUnion.d.ts.map +1 -1
- package/dist/models/TweetUnion.js +1 -1
- package/dist/models/TweetUnion.js.map +1 -1
- package/dist/models/TweetView.d.ts +1 -0
- package/dist/models/TweetView.d.ts.map +1 -1
- package/dist/models/TweetView.js +1 -0
- package/dist/models/TweetView.js.map +1 -1
- package/dist/models/TweetWithVisibilityResults.d.ts +15 -0
- package/dist/models/TweetWithVisibilityResults.d.ts.map +1 -1
- package/dist/models/TweetWithVisibilityResults.js +6 -0
- package/dist/models/TweetWithVisibilityResults.js.map +1 -1
- package/dist/models/TypeName.d.ts +8 -0
- package/dist/models/TypeName.d.ts.map +1 -1
- package/dist/models/TypeName.js +9 -1
- package/dist/models/TypeName.js.map +1 -1
- package/dist/models/UnifiedCard.d.ts +39 -0
- package/dist/models/UnifiedCard.d.ts.map +1 -0
- package/dist/models/UnifiedCard.js +57 -0
- package/dist/models/UnifiedCard.js.map +1 -0
- package/dist/models/UrtEndpointOptions.d.ts +39 -0
- package/dist/models/UrtEndpointOptions.d.ts.map +1 -0
- package/dist/models/UrtEndpointOptions.js +55 -0
- package/dist/models/UrtEndpointOptions.js.map +1 -0
- package/dist/models/UrtEndpointRequestParams.d.ts +38 -0
- package/dist/models/UrtEndpointRequestParams.d.ts.map +1 -0
- package/dist/models/UrtEndpointRequestParams.js +54 -0
- package/dist/models/UrtEndpointRequestParams.js.map +1 -0
- package/dist/models/User.d.ts +54 -0
- package/dist/models/User.d.ts.map +1 -1
- package/dist/models/User.js +27 -1
- package/dist/models/User.js.map +1 -1
- package/dist/models/UserHighlightsInfo.d.ts +38 -0
- package/dist/models/UserHighlightsInfo.d.ts.map +1 -0
- package/dist/models/UserHighlightsInfo.js +54 -0
- package/dist/models/UserHighlightsInfo.js.map +1 -0
- package/dist/models/UserLegacy.d.ts +20 -0
- package/dist/models/UserLegacy.d.ts.map +1 -1
- package/dist/models/UserLegacy.js +12 -1
- package/dist/models/UserLegacy.js.map +1 -1
- package/dist/models/UserProfessional.d.ts +53 -0
- package/dist/models/UserProfessional.d.ts.map +1 -0
- package/dist/models/UserProfessional.js +65 -0
- package/dist/models/UserProfessional.js.map +1 -0
- package/dist/models/UserProfessionalCategory.d.ts +44 -0
- package/dist/models/UserProfessionalCategory.d.ts.map +1 -0
- package/dist/models/UserProfessionalCategory.js +57 -0
- package/dist/models/UserProfessionalCategory.js.map +1 -0
- package/dist/models/UserUnion.d.ts +2 -2
- package/dist/models/UserUnion.d.ts.map +1 -1
- package/dist/models/UserUnion.js +1 -1
- package/dist/models/UserUnion.js.map +1 -1
- package/dist/models/UserValue.d.ts +32 -0
- package/dist/models/UserValue.d.ts.map +1 -0
- package/dist/models/UserValue.js +51 -0
- package/dist/models/UserValue.js.map +1 -0
- package/dist/models/UserVerificationInfo.d.ts +39 -0
- package/dist/models/UserVerificationInfo.d.ts.map +1 -0
- package/dist/models/UserVerificationInfo.js +55 -0
- package/dist/models/UserVerificationInfo.js.map +1 -0
- package/dist/models/UserVerificationInfoReason.d.ts +45 -0
- package/dist/models/UserVerificationInfoReason.d.ts.map +1 -0
- package/dist/models/UserVerificationInfoReason.js +58 -0
- package/dist/models/UserVerificationInfoReason.js.map +1 -0
- package/dist/models/UserVerificationInfoReasonDescription.d.ts +39 -0
- package/dist/models/UserVerificationInfoReasonDescription.d.ts.map +1 -0
- package/dist/models/UserVerificationInfoReasonDescription.js +55 -0
- package/dist/models/UserVerificationInfoReasonDescription.js.map +1 -0
- package/dist/models/UserVerificationInfoReasonDescriptionEntities.d.ts +45 -0
- package/dist/models/UserVerificationInfoReasonDescriptionEntities.d.ts.map +1 -0
- package/dist/models/UserVerificationInfoReasonDescriptionEntities.js +58 -0
- package/dist/models/UserVerificationInfoReasonDescriptionEntities.js.map +1 -0
- package/dist/models/UserVerificationInfoReasonDescriptionEntitiesRef.d.ts +45 -0
- package/dist/models/UserVerificationInfoReasonDescriptionEntitiesRef.d.ts.map +1 -0
- package/dist/models/UserVerificationInfoReasonDescriptionEntitiesRef.js +60 -0
- package/dist/models/UserVerificationInfoReasonDescriptionEntitiesRef.js.map +1 -0
- package/dist/models/index.d.ts +59 -1
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +59 -1
- package/dist/models/index.js.map +1 -1
- package/dist/runtime.d.ts +2 -2
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +13 -6
- package/dist/runtime.js.map +1 -1
- package/package.json +1 -1
- package/src/apis/DefaultApi.ts +289 -289
- package/src/apis/OtherApi.ts +132 -132
- package/src/apis/PostApi.ts +771 -771
- package/src/apis/TweetApi.ts +1465 -1465
- package/src/apis/UserApi.ts +295 -295
- package/src/apis/UserListApi.ts +676 -676
- package/src/apis/UsersApi.ts +158 -158
- package/src/apis/V11GetApi.ts +438 -438
- package/src/apis/V11PostApi.ts +513 -513
- package/src/apis/V20GetApi.ts +460 -460
- package/src/apis/index.ts +12 -12
- package/src/index.ts +5 -5
- package/src/models/AdditionalMediaInfo.ts +119 -66
- package/src/models/AdditionalMediaInfoCallToActions.ts +80 -0
- package/src/models/AdditionalMediaInfoCallToActionsUrl.ts +66 -0
- package/src/models/AuthorCommunityRelationship.ts +105 -0
- package/src/models/BirdwatchEntity.ts +91 -91
- package/src/models/BirdwatchEntityRef.ts +109 -102
- package/src/models/BirdwatchPivot.ts +179 -165
- package/src/models/BirdwatchPivotCallToAction.ts +84 -0
- package/src/models/BirdwatchPivotFooter.ts +82 -82
- package/src/models/BirdwatchPivotNote.ts +66 -66
- package/src/models/BirdwatchPivotSubtitle.ts +82 -82
- package/src/models/BookmarksResponse.ts +73 -73
- package/src/models/BookmarksResponseData.ts +73 -73
- package/src/models/BookmarksTimeline.ts +73 -73
- package/src/models/Callback.ts +66 -66
- package/src/models/ClientEventInfo.ts +81 -81
- package/src/models/CommunitiesActions.ts +66 -66
- package/src/models/Community.ts +73 -0
- package/src/models/CommunityActions.ts +118 -0
- package/src/models/CommunityData.ts +358 -0
- package/src/models/CommunityDeleteActionResult.ts +92 -0
- package/src/models/CommunityInvitesResult.ts +101 -0
- package/src/models/CommunityJoinActionResult.ts +73 -0
- package/src/models/CommunityJoinRequestsResult.ts +73 -0
- package/src/models/CommunityLeaveActionResult.ts +101 -0
- package/src/models/CommunityPinActionResult.ts +73 -0
- package/src/models/CommunityRule.ts +83 -0
- package/src/models/CommunityUrls.ts +73 -0
- package/src/models/CommunityUrlsPermalink.ts +66 -0
- package/src/models/ContentEntryType.ts +39 -39
- package/src/models/ContentItemType.ts +42 -42
- package/src/models/ContentUnion.ts +83 -83
- package/src/models/CoverCta.ts +129 -129
- package/src/models/CreateRetweet.ts +73 -73
- package/src/models/CreateRetweetResponse.ts +73 -73
- package/src/models/CreateRetweetResponseData.ts +73 -73
- package/src/models/CreateRetweetResponseResult.ts +73 -73
- package/src/models/CreateTweet.ts +73 -73
- package/src/models/CreateTweetResponse.ts +73 -73
- package/src/models/CreateTweetResponseData.ts +73 -73
- package/src/models/CreateTweetResponseResult.ts +73 -73
- package/src/models/CtaClientEventInfo.ts +76 -76
- package/src/models/CursorType.ts +41 -41
- package/src/models/DeleteRetweet.ts +73 -73
- package/src/models/DeleteRetweetResponse.ts +73 -73
- package/src/models/DeleteRetweetResponseData.ts +72 -72
- package/src/models/DeleteRetweetResponseResult.ts +72 -72
- package/src/models/DeleteTweetResponse.ts +73 -73
- package/src/models/DeleteTweetResponseData.ts +72 -72
- package/src/models/DeleteTweetResponseResult.ts +66 -66
- package/src/models/DisplayTreatment.ts +66 -0
- package/src/models/DisplayType.ts +40 -0
- package/src/models/Entities.ts +114 -114
- package/src/models/ErrorExtensions.ts +118 -118
- package/src/models/ErrorResponse.ts +73 -73
- package/src/models/Errors.ts +66 -66
- package/src/models/ExtMediaAvailability.ts +84 -84
- package/src/models/ExtendedEntities.ts +73 -73
- package/src/models/Extensions.ts +109 -109
- package/src/models/FavoriteTweet.ts +66 -66
- package/src/models/FavoriteTweetResponseData.ts +73 -73
- package/src/models/FeedbackInfo.ts +65 -0
- package/src/models/FollowResponse.ts +73 -73
- package/src/models/FollowResponseData.ts +73 -73
- package/src/models/FollowResponseResult.ts +88 -88
- package/src/models/FollowResponseUser.ts +73 -73
- package/src/models/FollowTimeline.ts +73 -73
- package/src/models/GetBookmarks200Response.ts +65 -65
- package/src/models/GetFavoriters200Response.ts +65 -65
- package/src/models/GetFollowers200Response.ts +65 -65
- package/src/models/GetHomeLatestTimeline200Response.ts +65 -65
- package/src/models/GetLikes200Response.ts +65 -65
- package/src/models/GetListLatestTweetsTimeline200Response.ts +65 -65
- package/src/models/GetProfileSpotlightsQuery200Response.ts +65 -65
- package/src/models/GetRetweeters200Response.ts +65 -65
- package/src/models/GetSearchTimeline200Response.ts +65 -65
- package/src/models/GetTweetDetail200Response.ts +65 -65
- package/src/models/GetTweetResultByRestId200Response.ts +65 -65
- package/src/models/GetUserByRestId200Response.ts +65 -65
- package/src/models/GetUserHighlightsTweets200Response.ts +65 -65
- package/src/models/GetUsersByRestIds200Response.ts +65 -65
- package/src/models/Highlight.ts +73 -0
- package/src/models/HomeTimelineHome.ts +73 -73
- package/src/models/HomeTimelineResponseData.ts +73 -73
- package/src/models/InstructionType.ts +44 -44
- package/src/models/InstructionUnion.ts +138 -138
- package/src/models/ItemContentUnion.ts +116 -116
- package/src/models/ItemResult.ts +86 -86
- package/src/models/ListLatestTweetsTimelineResponse.ts +73 -73
- package/src/models/ListTweetsTimeline.ts +72 -72
- package/src/models/ListTweetsTimelineData.ts +73 -73
- package/src/models/ListTweetsTimelineList.ts +73 -73
- package/src/models/Location.ts +75 -75
- package/src/models/Media.ts +249 -171
- package/src/models/MediaExtended.ts +274 -236
- package/src/models/MediaOriginalInfo.ts +90 -90
- package/src/models/MediaOriginalInfoFocusRect.ts +93 -93
- package/src/models/MediaSize.ts +95 -95
- package/src/models/MediaSizes.ts +100 -100
- package/src/models/MediaStats.ts +66 -66
- package/src/models/MediaVideoInfo.ts +90 -90
- package/src/models/MediaVideoInfoVariant.ts +83 -83
- package/src/models/ModelError.ts +166 -166
- package/src/models/ModuleEntry.ts +101 -88
- package/src/models/ModuleItem.ts +82 -82
- package/src/models/NoteTweet.ts +82 -82
- package/src/models/NoteTweetResult.ts +73 -73
- package/src/models/NoteTweetResultData.ts +119 -119
- package/src/models/NoteTweetResultMedia.ts +73 -73
- package/src/models/NoteTweetResultMediaInlineMedia.ts +75 -75
- package/src/models/NoteTweetResultRichText.ts +73 -73
- package/src/models/NoteTweetResultRichTextTag.ts +95 -95
- package/src/models/OneFactorLoginEligibility.ts +66 -66
- package/src/models/Other200Response.ts +55 -55
- package/src/models/OtherResponse.ts +72 -72
- package/src/models/PostCreateRetweet200Response.ts +65 -65
- package/src/models/PostCreateRetweetRequest.ts +82 -82
- package/src/models/PostCreateRetweetRequestVariables.ts +75 -75
- package/src/models/PostCreateTweet200Response.ts +65 -65
- package/src/models/PostCreateTweetRequest.ts +97 -97
- package/src/models/PostCreateTweetRequestFeatures.ts +237 -219
- package/src/models/PostCreateTweetRequestVariables.ts +114 -100
- package/src/models/PostCreateTweetRequestVariablesMedia.ts +82 -82
- package/src/models/PostCreateTweetRequestVariablesMediaMediaEntitiesInner.ts +75 -75
- package/src/models/PostCreateTweetRequestVariablesReply.ts +75 -0
- package/src/models/PostDeleteRetweet200Response.ts +65 -65
- package/src/models/PostDeleteRetweetRequest.ts +82 -82
- package/src/models/PostDeleteRetweetRequestVariables.ts +75 -75
- package/src/models/PostDeleteTweet200Response.ts +65 -65
- package/src/models/PostDeleteTweetRequest.ts +82 -82
- package/src/models/PostFavoriteTweet200Response.ts +65 -65
- package/src/models/PostFavoriteTweetRequest.ts +82 -82
- package/src/models/PostUnfavoriteTweet200Response.ts +65 -65
- package/src/models/PostUnfavoriteTweetRequest.ts +82 -82
- package/src/models/PrimaryCommunityTopic.ts +75 -0
- package/src/models/ProfileResponse.ts +73 -73
- package/src/models/ProfileResponseData.ts +73 -73
- package/src/models/QuotedRefResult.ts +72 -0
- package/src/models/QuotedStatusPermalink.ts +84 -0
- package/src/models/Retweet.ts +82 -82
- package/src/models/RetweetLegacy.ts +66 -66
- package/src/models/SearchByRawQuery.ts +73 -73
- package/src/models/SearchTimeline.ts +73 -73
- package/src/models/SearchTimelineData.ts +73 -73
- package/src/models/SearchTimelineResponse.ts +73 -73
- package/src/models/SelfThread.ts +66 -66
- package/src/models/SensitiveMediaWarning.ts +84 -0
- package/src/models/Session.ts +211 -211
- package/src/models/SocialContextLandingUrl.ts +100 -0
- package/src/models/SocialContextUnion.ts +72 -0
- package/src/models/SocialContextUnionType.ts +38 -0
- package/src/models/SuperFollowsReplyUserResult.ts +73 -0
- package/src/models/SuperFollowsReplyUserResultData.ts +88 -0
- package/src/models/SuperFollowsReplyUserResultLegacy.ts +66 -0
- package/src/models/Text.ts +82 -82
- package/src/models/TextEntity.ts +91 -91
- package/src/models/TextEntityRef.ts +102 -102
- package/src/models/TextHighlight.ts +75 -0
- package/src/models/Timeline.ts +89 -89
- package/src/models/TimelineAddEntries.ts +88 -88
- package/src/models/TimelineAddEntry.ts +91 -91
- package/src/models/TimelineAddToModule.ts +105 -105
- package/src/models/TimelineClearCache.ts +73 -73
- package/src/models/TimelineCommunity.ts +75 -75
- package/src/models/TimelineCoverBehavior.ts +76 -76
- package/src/models/TimelineGeneralContext.ts +118 -0
- package/src/models/TimelineHalfCover.ts +157 -157
- package/src/models/TimelineMessagePrompt.ts +75 -75
- package/src/models/TimelinePinEntry.ts +88 -88
- package/src/models/TimelinePrompt.ts +75 -75
- package/src/models/TimelineReplaceEntry.ts +97 -97
- package/src/models/TimelineResponse.ts +73 -73
- package/src/models/TimelineShowAlert.ts +169 -169
- package/src/models/TimelineShowAlertRichText.ts +73 -73
- package/src/models/TimelineShowCover.ts +103 -103
- package/src/models/TimelineTerminateTimeline.ts +93 -93
- package/src/models/TimelineTimelineCursor.ts +142 -119
- package/src/models/TimelineTimelineItem.ts +125 -125
- package/src/models/TimelineTimelineModule.ts +164 -147
- package/src/models/TimelineTopicContext.ts +104 -0
- package/src/models/TimelineTweet.ts +148 -134
- package/src/models/TimelineUser.ts +138 -138
- package/src/models/TimelineV2.ts +73 -73
- package/src/models/TopicContext.ts +113 -0
- package/src/models/Tracing.ts +66 -66
- package/src/models/Tweet.ts +317 -242
- package/src/models/TweetCard.ts +80 -80
- package/src/models/TweetCardLegacy.ts +119 -91
- package/src/models/TweetCardLegacyBindingValue.ts +82 -82
- package/src/models/TweetCardLegacyBindingValueData.ts +127 -90
- package/src/models/TweetCardLegacyBindingValueDataImage.ts +92 -0
- package/src/models/TweetCardPlatform.ts +88 -0
- package/src/models/TweetCardPlatformAudience.ts +76 -0
- package/src/models/TweetCardPlatformData.ts +73 -0
- package/src/models/TweetCardPlatformDevice.ts +75 -0
- package/src/models/TweetDetailResponse.ts +73 -73
- package/src/models/TweetDetailResponseData.ts +73 -73
- package/src/models/TweetEditControl.ts +112 -112
- package/src/models/TweetEditControlInitial.ts +93 -93
- package/src/models/TweetEditPrespective.ts +73 -73
- package/src/models/TweetFavoritersResponse.ts +73 -73
- package/src/models/TweetFavoritersResponseData.ts +73 -73
- package/src/models/TweetInterstitial.ts +122 -0
- package/src/models/TweetInterstitialRevealText.ts +91 -0
- package/src/models/TweetInterstitialText.ts +91 -0
- package/src/models/TweetInterstitialTextEntity.ts +91 -0
- package/src/models/TweetInterstitialTextEntityRef.ts +102 -0
- package/src/models/TweetLegacy.ts +373 -275
- package/src/models/TweetLegacyScopes.ts +66 -0
- package/src/models/TweetPreviousCounts.ts +102 -0
- package/src/models/TweetResultByRestIdData.ts +73 -73
- package/src/models/TweetResultByRestIdResponse.ts +73 -73
- package/src/models/TweetRetweetersResponse.ts +73 -73
- package/src/models/TweetRetweetersResponseData.ts +73 -73
- package/src/models/TweetTombstone.ts +75 -75
- package/src/models/TweetUnion.ts +83 -83
- package/src/models/TweetView.ts +85 -84
- package/src/models/TweetWithVisibilityResults.ts +110 -88
- package/src/models/TypeName.ts +58 -50
- package/src/models/UnfavoriteTweet.ts +66 -66
- package/src/models/UnfavoriteTweetResponseData.ts +73 -73
- package/src/models/UnifiedCard.ts +76 -0
- package/src/models/Url.ts +93 -93
- package/src/models/UrtEndpointOptions.ts +82 -0
- package/src/models/UrtEndpointRequestParams.ts +75 -0
- package/src/models/User.ts +262 -175
- package/src/models/UserFeatures.ts +66 -66
- package/src/models/UserHighlightsInfo.ts +75 -0
- package/src/models/UserHighlightsTweetsData.ts +73 -73
- package/src/models/UserHighlightsTweetsResponse.ts +73 -73
- package/src/models/UserHighlightsTweetsResult.ts +88 -88
- package/src/models/UserHighlightsTweetsTimeline.ts +73 -73
- package/src/models/UserHighlightsTweetsUser.ts +73 -73
- package/src/models/UserLegacy.ts +426 -399
- package/src/models/UserProfessional.ts +102 -0
- package/src/models/UserProfessionalCategory.ts +84 -0
- package/src/models/UserResponse.ts +73 -73
- package/src/models/UserResponseData.ts +73 -73
- package/src/models/UserResultByScreenName.ts +82 -82
- package/src/models/UserResultByScreenNameLegacy.ts +113 -113
- package/src/models/UserResultByScreenNameResult.ts +115 -115
- package/src/models/UserResultCore.ts +73 -73
- package/src/models/UserResults.ts +72 -72
- package/src/models/UserTweetsData.ts +73 -73
- package/src/models/UserTweetsResponse.ts +73 -73
- package/src/models/UserTweetsResult.ts +88 -88
- package/src/models/UserTweetsUser.ts +73 -73
- package/src/models/UserUnavailable.ts +82 -82
- package/src/models/UserUnion.ts +72 -72
- package/src/models/UserValue.ts +66 -0
- package/src/models/UserVerificationInfo.ts +81 -0
- package/src/models/UserVerificationInfoReason.ts +91 -0
- package/src/models/UserVerificationInfoReasonDescription.ts +82 -0
- package/src/models/UserVerificationInfoReasonDescriptionEntities.ts +91 -0
- package/src/models/UserVerificationInfoReasonDescriptionEntitiesRef.ts +85 -0
- package/src/models/UsersResponse.ts +73 -73
- package/src/models/UsersResponseData.ts +73 -73
- package/src/models/index.ts +259 -201
- package/src/runtime.ts +431 -425
- package/tools/openapi-generator-config.yaml +1 -1
- package/tools/win/init.ps1 +1 -1
- package/tools/win/replace.py +9 -16
- package/twitter-openapi/.github/workflows/test-build.yaml +1 -1
- package/twitter-openapi/.github/workflows/test-python.yaml +1 -1
- package/twitter-openapi/.vscode/extensions.json +8 -2
- package/twitter-openapi/.vscode/launch.json +7 -5
- package/twitter-openapi/.vscode/settings.json +11 -1
- package/twitter-openapi/.vscode/tasks.json +4 -3
- package/twitter-openapi/dist/compatible/openapi-3.0.yaml +1195 -337
- package/twitter-openapi/dist/docs/openapi-3.0.yaml +1159 -120
- package/twitter-openapi/requirements.txt +0 -0
- package/twitter-openapi/src/config/placeholder.json +89 -44
- package/twitter-openapi/src/openapi/response/error.yaml +3 -0
- package/twitter-openapi/src/openapi/schemas/content.yaml +159 -10
- package/twitter-openapi/src/openapi/schemas/tweet.yaml +598 -17
- package/twitter-openapi/src/openapi/schemas/typename.yaml +8 -0
- package/twitter-openapi/src/openapi/schemas/user.yaml +127 -0
- package/twitter-openapi/test/python/test_serialize.py +121 -47
- package/twitter-openapi/tools/hooks.py +29 -21
- package/dist/models/SocialContext.d.ts +0 -44
- package/dist/models/SocialContext.d.ts.map +0 -1
- package/dist/models/SocialContext.js +0 -55
- package/dist/models/SocialContext.js.map +0 -1
- package/src/models/SocialContext.ts +0 -81
package/src/runtime.ts
CHANGED
|
@@ -1,425 +1,431 @@
|
|
|
1
|
-
/* tslint:disable */
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
/**
|
|
4
|
-
* Twitter OpenAPI
|
|
5
|
-
* Twitter OpenAPI(Swagger) specification
|
|
6
|
-
*
|
|
7
|
-
* The version of the OpenAPI document: 0.0.1
|
|
8
|
-
* Contact: yuki@yuki0311.com
|
|
9
|
-
*
|
|
10
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
-
* https://openapi-generator.tech
|
|
12
|
-
* Do not edit the class manually.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export const BASE_PATH = "https://twitter.com/i/api".replace(/\/+$/, "");
|
|
17
|
-
|
|
18
|
-
export interface ConfigurationParameters {
|
|
19
|
-
basePath?: string; // override base path
|
|
20
|
-
fetchApi?: FetchAPI; // override for fetch implementation
|
|
21
|
-
middleware?: Middleware[]; // middleware to apply before/after fetch requests
|
|
22
|
-
queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings
|
|
23
|
-
username?: string; // parameter for basic security
|
|
24
|
-
password?: string; // parameter for basic security
|
|
25
|
-
apiKey?: string | ((name: string) => string); // parameter for apiKey security
|
|
26
|
-
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>); // parameter for oauth2 security
|
|
27
|
-
headers?: HTTPHeaders; //header params we want to use on every request
|
|
28
|
-
credentials?: RequestCredentials; //value for the credentials param we want to use on each request
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export class Configuration {
|
|
32
|
-
constructor(private configuration: ConfigurationParameters = {}) {}
|
|
33
|
-
|
|
34
|
-
set config(configuration: Configuration) {
|
|
35
|
-
this.configuration = configuration;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
get basePath(): string {
|
|
39
|
-
return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
get fetchApi(): FetchAPI | undefined {
|
|
43
|
-
return this.configuration.fetchApi;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
get middleware(): Middleware[] {
|
|
47
|
-
return this.configuration.middleware || [];
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
get queryParamsStringify(): (params: HTTPQuery) => string {
|
|
51
|
-
return this.configuration.queryParamsStringify || querystring;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
get username(): string | undefined {
|
|
55
|
-
return this.configuration.username;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
get password(): string | undefined {
|
|
59
|
-
return this.configuration.password;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
get apiKey(): ((name: string) => string) | undefined {
|
|
63
|
-
const apiKey = this.configuration.apiKey;
|
|
64
|
-
if (apiKey) {
|
|
65
|
-
return typeof apiKey === 'function' ? apiKey : () => apiKey;
|
|
66
|
-
}
|
|
67
|
-
return undefined;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
get accessToken(): ((name?: string, scopes?: string[]) => string | Promise<string>) | undefined {
|
|
71
|
-
const accessToken = this.configuration.accessToken;
|
|
72
|
-
if (accessToken) {
|
|
73
|
-
return typeof accessToken === 'function' ? accessToken : async () => accessToken;
|
|
74
|
-
}
|
|
75
|
-
return undefined;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
get headers(): HTTPHeaders | undefined {
|
|
79
|
-
return this.configuration.headers;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
get credentials(): RequestCredentials | undefined {
|
|
83
|
-
return this.configuration.credentials;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export const DefaultConfig = new Configuration();
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* This is the base class for all generated API classes.
|
|
91
|
-
*/
|
|
92
|
-
export class BaseAPI {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
private middleware: Middleware[];
|
|
96
|
-
|
|
97
|
-
constructor(protected configuration = DefaultConfig) {
|
|
98
|
-
this.middleware = configuration.middleware;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
withMiddleware<T extends BaseAPI>(this: T, ...middlewares: Middleware[]) {
|
|
102
|
-
const next = this.clone<T>();
|
|
103
|
-
next.middleware = next.middleware.concat(...middlewares);
|
|
104
|
-
return next;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
withPreMiddleware<T extends BaseAPI>(this: T, ...preMiddlewares: Array<Middleware['pre']>) {
|
|
108
|
-
const middlewares = preMiddlewares.map((pre) => ({ pre }));
|
|
109
|
-
return this.withMiddleware<T>(...middlewares);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
withPostMiddleware<T extends BaseAPI>(this: T, ...postMiddlewares: Array<Middleware['post']>) {
|
|
113
|
-
const middlewares = postMiddlewares.map((post) => ({ post }));
|
|
114
|
-
return this.withMiddleware<T>(...middlewares);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Check if the given MIME is a JSON MIME.
|
|
119
|
-
* JSON MIME examples:
|
|
120
|
-
* application/json
|
|
121
|
-
* application/json; charset=UTF8
|
|
122
|
-
* APPLICATION/JSON
|
|
123
|
-
* application/vnd.company+json
|
|
124
|
-
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
125
|
-
* @return True if the given MIME is JSON, false otherwise.
|
|
126
|
-
*/
|
|
127
|
-
protected isJsonMime(mime: string | null | undefined): boolean {
|
|
128
|
-
if (!mime) {
|
|
129
|
-
return false;
|
|
130
|
-
}
|
|
131
|
-
return BaseAPI.jsonRegex.test(mime);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise<Response> {
|
|
135
|
-
const { url, init } = await this.createFetchParams(context, initOverrides);
|
|
136
|
-
const response = await this.fetchApi(url, init);
|
|
137
|
-
if (response && (response.status >= 200 && response.status < 300)) {
|
|
138
|
-
return response;
|
|
139
|
-
}
|
|
140
|
-
throw new ResponseError(response, 'Response returned an error code');
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
private async createFetchParams(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction) {
|
|
144
|
-
let url = this.configuration.basePath + context.path;
|
|
145
|
-
if (context.query !== undefined && Object.keys(context.query).length !== 0) {
|
|
146
|
-
// only add the querystring to the URL if there are query parameters.
|
|
147
|
-
// this is done to avoid urls ending with a "?" character which buggy webservers
|
|
148
|
-
// do not handle correctly sometimes.
|
|
149
|
-
url += '?' + this.configuration.queryParamsStringify(context.query);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
const headers = Object.assign({}, this.configuration.headers, context.headers);
|
|
153
|
-
Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {});
|
|
154
|
-
|
|
155
|
-
const initOverrideFn =
|
|
156
|
-
typeof initOverrides === "function"
|
|
157
|
-
? initOverrides
|
|
158
|
-
: async () => initOverrides;
|
|
159
|
-
|
|
160
|
-
const initParams = {
|
|
161
|
-
method: context.method,
|
|
162
|
-
headers,
|
|
163
|
-
body: context.body,
|
|
164
|
-
credentials: this.configuration.credentials,
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
const overriddenInit: RequestInit = {
|
|
168
|
-
...initParams,
|
|
169
|
-
...(await initOverrideFn({
|
|
170
|
-
init: initParams,
|
|
171
|
-
context,
|
|
172
|
-
}))
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
body
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
export type
|
|
289
|
-
|
|
290
|
-
export type
|
|
291
|
-
|
|
292
|
-
export type
|
|
293
|
-
|
|
294
|
-
export
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
return
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
{}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
export interface
|
|
366
|
-
fetch: FetchAPI;
|
|
367
|
-
url: string;
|
|
368
|
-
init: RequestInit;
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
export interface
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Twitter OpenAPI
|
|
5
|
+
* Twitter OpenAPI(Swagger) specification
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.0.1
|
|
8
|
+
* Contact: yuki@yuki0311.com
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
export const BASE_PATH = "https://twitter.com/i/api".replace(/\/+$/, "");
|
|
17
|
+
|
|
18
|
+
export interface ConfigurationParameters {
|
|
19
|
+
basePath?: string; // override base path
|
|
20
|
+
fetchApi?: FetchAPI; // override for fetch implementation
|
|
21
|
+
middleware?: Middleware[]; // middleware to apply before/after fetch requests
|
|
22
|
+
queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings
|
|
23
|
+
username?: string; // parameter for basic security
|
|
24
|
+
password?: string; // parameter for basic security
|
|
25
|
+
apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>); // parameter for apiKey security
|
|
26
|
+
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>); // parameter for oauth2 security
|
|
27
|
+
headers?: HTTPHeaders; //header params we want to use on every request
|
|
28
|
+
credentials?: RequestCredentials; //value for the credentials param we want to use on each request
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export class Configuration {
|
|
32
|
+
constructor(private configuration: ConfigurationParameters = {}) {}
|
|
33
|
+
|
|
34
|
+
set config(configuration: Configuration) {
|
|
35
|
+
this.configuration = configuration;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
get basePath(): string {
|
|
39
|
+
return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
get fetchApi(): FetchAPI | undefined {
|
|
43
|
+
return this.configuration.fetchApi;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
get middleware(): Middleware[] {
|
|
47
|
+
return this.configuration.middleware || [];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
get queryParamsStringify(): (params: HTTPQuery) => string {
|
|
51
|
+
return this.configuration.queryParamsStringify || querystring;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
get username(): string | undefined {
|
|
55
|
+
return this.configuration.username;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
get password(): string | undefined {
|
|
59
|
+
return this.configuration.password;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
get apiKey(): ((name: string) => string | Promise<string>) | undefined {
|
|
63
|
+
const apiKey = this.configuration.apiKey;
|
|
64
|
+
if (apiKey) {
|
|
65
|
+
return typeof apiKey === 'function' ? apiKey : () => apiKey;
|
|
66
|
+
}
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
get accessToken(): ((name?: string, scopes?: string[]) => string | Promise<string>) | undefined {
|
|
71
|
+
const accessToken = this.configuration.accessToken;
|
|
72
|
+
if (accessToken) {
|
|
73
|
+
return typeof accessToken === 'function' ? accessToken : async () => accessToken;
|
|
74
|
+
}
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
get headers(): HTTPHeaders | undefined {
|
|
79
|
+
return this.configuration.headers;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
get credentials(): RequestCredentials | undefined {
|
|
83
|
+
return this.configuration.credentials;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export const DefaultConfig = new Configuration();
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* This is the base class for all generated API classes.
|
|
91
|
+
*/
|
|
92
|
+
export class BaseAPI {
|
|
93
|
+
|
|
94
|
+
private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i');
|
|
95
|
+
private middleware: Middleware[];
|
|
96
|
+
|
|
97
|
+
constructor(protected configuration = DefaultConfig) {
|
|
98
|
+
this.middleware = configuration.middleware;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
withMiddleware<T extends BaseAPI>(this: T, ...middlewares: Middleware[]) {
|
|
102
|
+
const next = this.clone<T>();
|
|
103
|
+
next.middleware = next.middleware.concat(...middlewares);
|
|
104
|
+
return next;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
withPreMiddleware<T extends BaseAPI>(this: T, ...preMiddlewares: Array<Middleware['pre']>) {
|
|
108
|
+
const middlewares = preMiddlewares.map((pre) => ({ pre }));
|
|
109
|
+
return this.withMiddleware<T>(...middlewares);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
withPostMiddleware<T extends BaseAPI>(this: T, ...postMiddlewares: Array<Middleware['post']>) {
|
|
113
|
+
const middlewares = postMiddlewares.map((post) => ({ post }));
|
|
114
|
+
return this.withMiddleware<T>(...middlewares);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Check if the given MIME is a JSON MIME.
|
|
119
|
+
* JSON MIME examples:
|
|
120
|
+
* application/json
|
|
121
|
+
* application/json; charset=UTF8
|
|
122
|
+
* APPLICATION/JSON
|
|
123
|
+
* application/vnd.company+json
|
|
124
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
125
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
126
|
+
*/
|
|
127
|
+
protected isJsonMime(mime: string | null | undefined): boolean {
|
|
128
|
+
if (!mime) {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
return BaseAPI.jsonRegex.test(mime);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise<Response> {
|
|
135
|
+
const { url, init } = await this.createFetchParams(context, initOverrides);
|
|
136
|
+
const response = await this.fetchApi(url, init);
|
|
137
|
+
if (response && (response.status >= 200 && response.status < 300)) {
|
|
138
|
+
return response;
|
|
139
|
+
}
|
|
140
|
+
throw new ResponseError(response, 'Response returned an error code');
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
private async createFetchParams(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction) {
|
|
144
|
+
let url = this.configuration.basePath + context.path;
|
|
145
|
+
if (context.query !== undefined && Object.keys(context.query).length !== 0) {
|
|
146
|
+
// only add the querystring to the URL if there are query parameters.
|
|
147
|
+
// this is done to avoid urls ending with a "?" character which buggy webservers
|
|
148
|
+
// do not handle correctly sometimes.
|
|
149
|
+
url += '?' + this.configuration.queryParamsStringify(context.query);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const headers = Object.assign({}, this.configuration.headers, context.headers);
|
|
153
|
+
Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {});
|
|
154
|
+
|
|
155
|
+
const initOverrideFn =
|
|
156
|
+
typeof initOverrides === "function"
|
|
157
|
+
? initOverrides
|
|
158
|
+
: async () => initOverrides;
|
|
159
|
+
|
|
160
|
+
const initParams = {
|
|
161
|
+
method: context.method,
|
|
162
|
+
headers,
|
|
163
|
+
body: context.body,
|
|
164
|
+
credentials: this.configuration.credentials,
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
const overriddenInit: RequestInit = {
|
|
168
|
+
...initParams,
|
|
169
|
+
...(await initOverrideFn({
|
|
170
|
+
init: initParams,
|
|
171
|
+
context,
|
|
172
|
+
}))
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
let body: any;
|
|
176
|
+
if (isFormData(overriddenInit.body)
|
|
177
|
+
|| (overriddenInit.body instanceof URLSearchParams)
|
|
178
|
+
|| isBlob(overriddenInit.body)) {
|
|
179
|
+
body = overriddenInit.body;
|
|
180
|
+
} else if (this.isJsonMime(headers['Content-Type'])) {
|
|
181
|
+
body = JSON.stringify(overriddenInit.body);
|
|
182
|
+
} else {
|
|
183
|
+
body = overriddenInit.body;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const init: RequestInit = {
|
|
187
|
+
...overriddenInit,
|
|
188
|
+
body
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
return { url, init };
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
private fetchApi = async (url: string, init: RequestInit) => {
|
|
195
|
+
let fetchParams = { url, init };
|
|
196
|
+
for (const middleware of this.middleware) {
|
|
197
|
+
if (middleware.pre) {
|
|
198
|
+
fetchParams = await middleware.pre({
|
|
199
|
+
fetch: this.fetchApi,
|
|
200
|
+
...fetchParams,
|
|
201
|
+
}) || fetchParams;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
let response: Response | undefined = undefined;
|
|
205
|
+
try {
|
|
206
|
+
response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
|
|
207
|
+
} catch (e) {
|
|
208
|
+
for (const middleware of this.middleware) {
|
|
209
|
+
if (middleware.onError) {
|
|
210
|
+
response = await middleware.onError({
|
|
211
|
+
fetch: this.fetchApi,
|
|
212
|
+
url: fetchParams.url,
|
|
213
|
+
init: fetchParams.init,
|
|
214
|
+
error: e,
|
|
215
|
+
response: response ? response.clone() : undefined,
|
|
216
|
+
}) || response;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
if (response === undefined) {
|
|
220
|
+
if (e instanceof Error) {
|
|
221
|
+
throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response');
|
|
222
|
+
} else {
|
|
223
|
+
throw e;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
for (const middleware of this.middleware) {
|
|
228
|
+
if (middleware.post) {
|
|
229
|
+
response = await middleware.post({
|
|
230
|
+
fetch: this.fetchApi,
|
|
231
|
+
url: fetchParams.url,
|
|
232
|
+
init: fetchParams.init,
|
|
233
|
+
response: response.clone(),
|
|
234
|
+
}) || response;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
return response;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Create a shallow clone of `this` by constructing a new instance
|
|
242
|
+
* and then shallow cloning data members.
|
|
243
|
+
*/
|
|
244
|
+
private clone<T extends BaseAPI>(this: T): T {
|
|
245
|
+
const constructor = this.constructor as any;
|
|
246
|
+
const next = new constructor(this.configuration);
|
|
247
|
+
next.middleware = this.middleware.slice();
|
|
248
|
+
return next;
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
function isBlob(value: any): value is Blob {
|
|
253
|
+
return typeof Blob !== 'undefined' && value instanceof Blob;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function isFormData(value: any): value is FormData {
|
|
257
|
+
return typeof FormData !== "undefined" && value instanceof FormData;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export class ResponseError extends Error {
|
|
261
|
+
override name: "ResponseError" = "ResponseError";
|
|
262
|
+
constructor(public response: Response, msg?: string) {
|
|
263
|
+
super(msg);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export class FetchError extends Error {
|
|
268
|
+
override name: "FetchError" = "FetchError";
|
|
269
|
+
constructor(public cause: Error, msg?: string) {
|
|
270
|
+
super(msg);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export class RequiredError extends Error {
|
|
275
|
+
override name: "RequiredError" = "RequiredError";
|
|
276
|
+
constructor(public field: string, msg?: string) {
|
|
277
|
+
super(msg);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export const COLLECTION_FORMATS = {
|
|
282
|
+
csv: ",",
|
|
283
|
+
ssv: " ",
|
|
284
|
+
tsv: "\t",
|
|
285
|
+
pipes: "|",
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
export type FetchAPI = WindowOrWorkerGlobalScope['fetch'];
|
|
289
|
+
|
|
290
|
+
export type Json = any;
|
|
291
|
+
export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD';
|
|
292
|
+
export type HTTPHeaders = { [key: string]: string };
|
|
293
|
+
export type HTTPQuery = { [key: string]: string | number | null | boolean | Array<string | number | null | boolean> | Set<string | number | null | boolean> | HTTPQuery };
|
|
294
|
+
export type HTTPBody = Json | FormData | URLSearchParams;
|
|
295
|
+
export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody };
|
|
296
|
+
export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original';
|
|
297
|
+
|
|
298
|
+
export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise<RequestInit>
|
|
299
|
+
|
|
300
|
+
export interface FetchParams {
|
|
301
|
+
url: string;
|
|
302
|
+
init: RequestInit;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export interface RequestOpts {
|
|
306
|
+
path: string;
|
|
307
|
+
method: HTTPMethod;
|
|
308
|
+
headers: HTTPHeaders;
|
|
309
|
+
query?: HTTPQuery;
|
|
310
|
+
body?: HTTPBody;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
export function exists(json: any, key: string) {
|
|
314
|
+
const value = json[key];
|
|
315
|
+
return value !== null && value !== undefined;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export function querystring(params: HTTPQuery, prefix: string = ''): string {
|
|
319
|
+
return Object.keys(params)
|
|
320
|
+
.map(key => querystringSingleKey(key, params[key], prefix))
|
|
321
|
+
.filter(part => part.length > 0)
|
|
322
|
+
.join('&');
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
function querystringSingleKey(key: string, value: string | number | null | undefined | boolean | Array<string | number | null | boolean> | Set<string | number | null | boolean> | HTTPQuery, keyPrefix: string = ''): string {
|
|
326
|
+
const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
|
|
327
|
+
if (value instanceof Array) {
|
|
328
|
+
const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue)))
|
|
329
|
+
.join(`&${encodeURIComponent(fullKey)}=`);
|
|
330
|
+
return `${encodeURIComponent(fullKey)}=${multiValue}`;
|
|
331
|
+
}
|
|
332
|
+
if (value instanceof Set) {
|
|
333
|
+
const valueAsArray = Array.from(value);
|
|
334
|
+
return querystringSingleKey(key, valueAsArray, keyPrefix);
|
|
335
|
+
}
|
|
336
|
+
if (value instanceof Date) {
|
|
337
|
+
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
|
|
338
|
+
}
|
|
339
|
+
if (value instanceof Object) {
|
|
340
|
+
return querystring(value as HTTPQuery, fullKey);
|
|
341
|
+
}
|
|
342
|
+
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
export function mapValues(data: any, fn: (item: any) => any) {
|
|
346
|
+
return Object.keys(data).reduce(
|
|
347
|
+
(acc, key) => ({ ...acc, [key]: fn(data[key]) }),
|
|
348
|
+
{}
|
|
349
|
+
);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export function canConsumeForm(consumes: Consume[]): boolean {
|
|
353
|
+
for (const consume of consumes) {
|
|
354
|
+
if ('multipart/form-data' === consume.contentType) {
|
|
355
|
+
return true;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
return false;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
export interface Consume {
|
|
362
|
+
contentType: string;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
export interface RequestContext {
|
|
366
|
+
fetch: FetchAPI;
|
|
367
|
+
url: string;
|
|
368
|
+
init: RequestInit;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
export interface ResponseContext {
|
|
372
|
+
fetch: FetchAPI;
|
|
373
|
+
url: string;
|
|
374
|
+
init: RequestInit;
|
|
375
|
+
response: Response;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
export interface ErrorContext {
|
|
379
|
+
fetch: FetchAPI;
|
|
380
|
+
url: string;
|
|
381
|
+
init: RequestInit;
|
|
382
|
+
error: unknown;
|
|
383
|
+
response?: Response;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
export interface Middleware {
|
|
387
|
+
pre?(context: RequestContext): Promise<FetchParams | void>;
|
|
388
|
+
post?(context: ResponseContext): Promise<Response | void>;
|
|
389
|
+
onError?(context: ErrorContext): Promise<Response | void>;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
export interface ApiResponse<T> {
|
|
393
|
+
raw: Response;
|
|
394
|
+
value(): Promise<T>;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
export interface ResponseTransformer<T> {
|
|
398
|
+
(json: any): T;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
export class JSONApiResponse<T> {
|
|
402
|
+
constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}
|
|
403
|
+
|
|
404
|
+
async value(): Promise<T> {
|
|
405
|
+
return this.transformer(await this.raw.json());
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
export class VoidApiResponse {
|
|
410
|
+
constructor(public raw: Response) {}
|
|
411
|
+
|
|
412
|
+
async value(): Promise<void> {
|
|
413
|
+
return undefined;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
export class BlobApiResponse {
|
|
418
|
+
constructor(public raw: Response) {}
|
|
419
|
+
|
|
420
|
+
async value(): Promise<Blob> {
|
|
421
|
+
return await this.raw.blob();
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
export class TextApiResponse {
|
|
426
|
+
constructor(public raw: Response) {}
|
|
427
|
+
|
|
428
|
+
async value(): Promise<string> {
|
|
429
|
+
return await this.raw.text();
|
|
430
|
+
};
|
|
431
|
+
}
|