scrapebadger 0.51.1 → 0.53.0
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/dist/{index-Dz6kHfFt.d.cts → index-DBk60c2e.d.cts} +24 -1
- package/dist/{index-Dz6kHfFt.d.ts → index-DBk60c2e.d.ts} +24 -1
- package/dist/index.d.cts +28 -6
- package/dist/index.d.ts +28 -6
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +34 -1
- package/dist/index.mjs.map +1 -1
- package/dist/twitter/index.d.cts +1 -1
- package/dist/twitter/index.d.ts +1 -1
- package/dist/twitter/index.js.map +1 -1
- package/dist/twitter/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -20,6 +20,29 @@ var AuthenticationError = class _AuthenticationError extends ScrapeBadgerError {
|
|
|
20
20
|
Object.setPrototypeOf(this, _AuthenticationError.prototype);
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
+
var PermissionDeniedError = class _PermissionDeniedError extends AuthenticationError {
|
|
24
|
+
/** The API the request needed, e.g. `"twitter"` */
|
|
25
|
+
requiredScope;
|
|
26
|
+
/** The APIs this key may call */
|
|
27
|
+
allowedScopes;
|
|
28
|
+
constructor(message = "This API key is not permitted to call this API.", requiredScope, allowedScopes = []) {
|
|
29
|
+
super(message);
|
|
30
|
+
this.name = "PermissionDeniedError";
|
|
31
|
+
this.requiredScope = requiredScope;
|
|
32
|
+
this.allowedScopes = allowedScopes;
|
|
33
|
+
Object.setPrototypeOf(this, _PermissionDeniedError.prototype);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
var IPNotAllowedError = class _IPNotAllowedError extends PermissionDeniedError {
|
|
37
|
+
/** The address ScrapeBadger saw (null when relayed, e.g. via the hosted MCP server) */
|
|
38
|
+
clientIp;
|
|
39
|
+
constructor(message = "This API key may not be used from this IP address.", clientIp = null) {
|
|
40
|
+
super(message);
|
|
41
|
+
this.name = "IPNotAllowedError";
|
|
42
|
+
this.clientIp = clientIp;
|
|
43
|
+
Object.setPrototypeOf(this, _IPNotAllowedError.prototype);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
23
46
|
var RateLimitError = class _RateLimitError extends ScrapeBadgerError {
|
|
24
47
|
/** Unix timestamp when the rate limit resets */
|
|
25
48
|
retryAfter;
|
|
@@ -335,6 +358,16 @@ var BaseClient = class _BaseClient {
|
|
|
335
358
|
case 402:
|
|
336
359
|
throw new InsufficientCreditsError(message, errorData.credits_balance);
|
|
337
360
|
case 403:
|
|
361
|
+
if (errorData.error === "ip_not_allowed") {
|
|
362
|
+
throw new IPNotAllowedError(message, errorData.client_ip ?? null);
|
|
363
|
+
}
|
|
364
|
+
if (errorData.error === "insufficient_scope") {
|
|
365
|
+
throw new PermissionDeniedError(
|
|
366
|
+
message,
|
|
367
|
+
errorData.required_scope,
|
|
368
|
+
errorData.allowed_scopes ?? []
|
|
369
|
+
);
|
|
370
|
+
}
|
|
338
371
|
if (message.toLowerCase().includes("restricted")) {
|
|
339
372
|
throw new AccountRestrictedError(message, errorData.reason);
|
|
340
373
|
}
|
|
@@ -9036,6 +9069,6 @@ var ScrapeBadger = class {
|
|
|
9036
9069
|
}
|
|
9037
9070
|
};
|
|
9038
9071
|
|
|
9039
|
-
export { AccountRestrictedError, AmazonClient, ListingsClient as AmazonListingsClient, ProductsClient2 as AmazonProductsClient, ReferenceClient2 as AmazonReferenceClient, SearchClient5 as AmazonSearchClient, SellersClient as AmazonSellersClient, ApartmentsClient, AuthenticationError, BaiduClient, BingClient, MediaClient3 as BingMediaClient, NewsClient2 as BingNewsClient, ReferenceClient8 as BingReferenceClient, SearchClient11 as BingSearchClient, AskClient as ChatGPTAskClient, BrandClient as ChatGPTBrandClient, ChatGPTClient, ReferenceClient16 as ChatGPTReferenceClient, CommunitiesClient, ConflictError, DepopClient, DuckDuckGoClient, MediaClient2 as DuckDuckGoMediaClient, ReferenceClient7 as DuckDuckGoReferenceClient, SearchClient10 as DuckDuckGoSearchClient, CategoriesClient as EbayCategoriesClient, EbayClient, ItemsClient2 as EbayItemsClient, ReferenceClient5 as EbayReferenceClient, SearchClient8 as EbaySearchClient, SellersClient2 as EbaySellersClient, AskClient2 as GeminiAskClient, BrandClient2 as GeminiBrandClient, GeminiClient, GeoClient, AiModeClient as GoogleAiModeClient, AutocompleteClient as GoogleAutocompleteClient, GoogleClient, FinanceClient as GoogleFinanceClient, FlightsClient as GoogleFlightsClient, HotelsClient as GoogleHotelsClient, ImagesClient as GoogleImagesClient, JobsClient as GoogleJobsClient, LensClient as GoogleLensClient, MapsClient as GoogleMapsClient, NewsClient as GoogleNewsClient, PatentsClient as GooglePatentsClient, ProductsClient as GoogleProductsClient, ScholarClient as GoogleScholarClient, SearchClient2 as GoogleSearchClient, ShoppingClient as GoogleShoppingClient, ShortsClient as GoogleShortsClient, TrendsClient2 as GoogleTrendsClient, VideosClient as GoogleVideosClient, ImmobiliareClient, AudioClient as InstagramAudioClient, InstagramClient, HashtagsClient as InstagramHashtagsClient, LocationsClient as InstagramLocationsClient, MediaClient as InstagramMediaClient, SearchClient4 as InstagramSearchClient, UsersClient4 as InstagramUsersClient, InsufficientCreditsError, AdsClient2 as LeboncoinAdsClient, LeboncoinClient, ReferenceClient13 as LeboncoinReferenceClient, SearchClient16 as LeboncoinSearchClient, SellersClient4 as LeboncoinSellersClient, LinkedInClient, ListsClient, BrokersClient as LoopNetBrokersClient, LoopNetClient, ListingsClient2 as LoopNetListingsClient, ReferenceClient15 as LoopNetReferenceClient, SearchClient18 as LoopNetSearchClient, NotFoundError, RateLimitError, RealtorClient, PropertiesClient as RealtorPropertiesClient, ReferenceClient12 as RealtorReferenceClient, SearchClient15 as RealtorSearchClient, RedditClient, PostsClient as RedditPostsClient, SearchClient3 as RedditSearchClient, SubredditsClient as RedditSubredditsClient, UsersClient3 as RedditUsersClient, RedfinClient, ScrapeBadger, ScrapeBadgerError, ServerError, ShopeeClient, ProductsClient3 as ShopeeProductsClient, ReferenceClient3 as ShopeeReferenceClient, ReviewsClient as ShopeeReviewsClient, SearchClient6 as ShopeeSearchClient, SpacesClient, StreamClient, AdsClient as TikTokAdsClient, TikTokClient, HashtagsClient2 as TikTokHashtagsClient, MusicClient as TikTokMusicClient, ReferenceClient4 as TikTokReferenceClient, SearchClient7 as TikTokSearchClient, TrendingClient as TikTokTrendingClient, UsersClient5 as TikTokUsersClient, VideosClient2 as TikTokVideosClient, TimeoutError, TrendsClient, TweetsClient, TwitterClient, UsersClient, ValidationError, VintedClient, ItemsClient as VintedItemsClient, ReferenceClient as VintedReferenceClient, SearchClient as VintedSearchClient, UsersClient2 as VintedUsersClient, WalmartClient, ProductsClient4 as WalmartProductsClient, ReferenceClient6 as WalmartReferenceClient, SearchClient9 as WalmartSearchClient, SellersClient3 as WalmartSellersClient, StoresClient as WalmartStoresClient, WebClient, WebSocketStreamError, YahooClient, MediaClient4 as YahooMediaClient, NewsClient3 as YahooNewsClient, ReferenceClient9 as YahooReferenceClient, SearchClient12 as YahooSearchClient, YandexClient, ImagesClient2 as YandexImagesClient, ReferenceClient10 as YandexReferenceClient, SearchClient13 as YandexSearchClient, ChannelsClient as YoutubeChannelsClient, YoutubeClient, CommunityClient as YoutubeCommunityClient, MusicClient2 as YoutubeMusicClient, PlaylistsClient as YoutubePlaylistsClient, ReferenceClient11 as YoutubeReferenceClient, SearchClient14 as YoutubeSearchClient, ShortsClient2 as YoutubeShortsClient, TrendingClient2 as YoutubeTrendingClient, VideosClient3 as YoutubeVideosClient, AgentClient as ZillowAgentClient, ZillowClient, PropertiesClient2 as ZillowPropertiesClient, ReferenceClient14 as ZillowReferenceClient, SearchClient17 as ZillowSearchClient, collectAll, verifyWebhookSignature };
|
|
9072
|
+
export { AccountRestrictedError, AmazonClient, ListingsClient as AmazonListingsClient, ProductsClient2 as AmazonProductsClient, ReferenceClient2 as AmazonReferenceClient, SearchClient5 as AmazonSearchClient, SellersClient as AmazonSellersClient, ApartmentsClient, AuthenticationError, BaiduClient, BingClient, MediaClient3 as BingMediaClient, NewsClient2 as BingNewsClient, ReferenceClient8 as BingReferenceClient, SearchClient11 as BingSearchClient, AskClient as ChatGPTAskClient, BrandClient as ChatGPTBrandClient, ChatGPTClient, ReferenceClient16 as ChatGPTReferenceClient, CommunitiesClient, ConflictError, DepopClient, DuckDuckGoClient, MediaClient2 as DuckDuckGoMediaClient, ReferenceClient7 as DuckDuckGoReferenceClient, SearchClient10 as DuckDuckGoSearchClient, CategoriesClient as EbayCategoriesClient, EbayClient, ItemsClient2 as EbayItemsClient, ReferenceClient5 as EbayReferenceClient, SearchClient8 as EbaySearchClient, SellersClient2 as EbaySellersClient, AskClient2 as GeminiAskClient, BrandClient2 as GeminiBrandClient, GeminiClient, GeoClient, AiModeClient as GoogleAiModeClient, AutocompleteClient as GoogleAutocompleteClient, GoogleClient, FinanceClient as GoogleFinanceClient, FlightsClient as GoogleFlightsClient, HotelsClient as GoogleHotelsClient, ImagesClient as GoogleImagesClient, JobsClient as GoogleJobsClient, LensClient as GoogleLensClient, MapsClient as GoogleMapsClient, NewsClient as GoogleNewsClient, PatentsClient as GooglePatentsClient, ProductsClient as GoogleProductsClient, ScholarClient as GoogleScholarClient, SearchClient2 as GoogleSearchClient, ShoppingClient as GoogleShoppingClient, ShortsClient as GoogleShortsClient, TrendsClient2 as GoogleTrendsClient, VideosClient as GoogleVideosClient, IPNotAllowedError, ImmobiliareClient, AudioClient as InstagramAudioClient, InstagramClient, HashtagsClient as InstagramHashtagsClient, LocationsClient as InstagramLocationsClient, MediaClient as InstagramMediaClient, SearchClient4 as InstagramSearchClient, UsersClient4 as InstagramUsersClient, InsufficientCreditsError, AdsClient2 as LeboncoinAdsClient, LeboncoinClient, ReferenceClient13 as LeboncoinReferenceClient, SearchClient16 as LeboncoinSearchClient, SellersClient4 as LeboncoinSellersClient, LinkedInClient, ListsClient, BrokersClient as LoopNetBrokersClient, LoopNetClient, ListingsClient2 as LoopNetListingsClient, ReferenceClient15 as LoopNetReferenceClient, SearchClient18 as LoopNetSearchClient, NotFoundError, PermissionDeniedError, RateLimitError, RealtorClient, PropertiesClient as RealtorPropertiesClient, ReferenceClient12 as RealtorReferenceClient, SearchClient15 as RealtorSearchClient, RedditClient, PostsClient as RedditPostsClient, SearchClient3 as RedditSearchClient, SubredditsClient as RedditSubredditsClient, UsersClient3 as RedditUsersClient, RedfinClient, ScrapeBadger, ScrapeBadgerError, ServerError, ShopeeClient, ProductsClient3 as ShopeeProductsClient, ReferenceClient3 as ShopeeReferenceClient, ReviewsClient as ShopeeReviewsClient, SearchClient6 as ShopeeSearchClient, SpacesClient, StreamClient, AdsClient as TikTokAdsClient, TikTokClient, HashtagsClient2 as TikTokHashtagsClient, MusicClient as TikTokMusicClient, ReferenceClient4 as TikTokReferenceClient, SearchClient7 as TikTokSearchClient, TrendingClient as TikTokTrendingClient, UsersClient5 as TikTokUsersClient, VideosClient2 as TikTokVideosClient, TimeoutError, TrendsClient, TweetsClient, TwitterClient, UsersClient, ValidationError, VintedClient, ItemsClient as VintedItemsClient, ReferenceClient as VintedReferenceClient, SearchClient as VintedSearchClient, UsersClient2 as VintedUsersClient, WalmartClient, ProductsClient4 as WalmartProductsClient, ReferenceClient6 as WalmartReferenceClient, SearchClient9 as WalmartSearchClient, SellersClient3 as WalmartSellersClient, StoresClient as WalmartStoresClient, WebClient, WebSocketStreamError, YahooClient, MediaClient4 as YahooMediaClient, NewsClient3 as YahooNewsClient, ReferenceClient9 as YahooReferenceClient, SearchClient12 as YahooSearchClient, YandexClient, ImagesClient2 as YandexImagesClient, ReferenceClient10 as YandexReferenceClient, SearchClient13 as YandexSearchClient, ChannelsClient as YoutubeChannelsClient, YoutubeClient, CommunityClient as YoutubeCommunityClient, MusicClient2 as YoutubeMusicClient, PlaylistsClient as YoutubePlaylistsClient, ReferenceClient11 as YoutubeReferenceClient, SearchClient14 as YoutubeSearchClient, ShortsClient2 as YoutubeShortsClient, TrendingClient2 as YoutubeTrendingClient, VideosClient3 as YoutubeVideosClient, AgentClient as ZillowAgentClient, ZillowClient, PropertiesClient2 as ZillowPropertiesClient, ReferenceClient14 as ZillowReferenceClient, SearchClient17 as ZillowSearchClient, collectAll, verifyWebhookSignature };
|
|
9040
9073
|
//# sourceMappingURL=index.mjs.map
|
|
9041
9074
|
//# sourceMappingURL=index.mjs.map
|