scrapebadger 0.52.0 → 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-BzPGfcwJ.d.cts → index-DBk60c2e.d.cts} +10 -1
- package/dist/{index-BzPGfcwJ.d.ts → index-DBk60c2e.d.ts} +10 -1
- package/dist/index.d.cts +10 -8
- package/dist/index.d.ts +10 -8
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -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
|
@@ -2098,6 +2098,15 @@ declare class PermissionDeniedError extends AuthenticationError {
|
|
|
2098
2098
|
readonly allowedScopes: string[];
|
|
2099
2099
|
constructor(message?: string, requiredScope?: string, allowedScopes?: string[]);
|
|
2100
2100
|
}
|
|
2101
|
+
/**
|
|
2102
|
+
* Raised when the API key is restricted to IP addresses and this request came
|
|
2103
|
+
* from another one (HTTP 403, `error: "ip_not_allowed"`). Not charged.
|
|
2104
|
+
*/
|
|
2105
|
+
declare class IPNotAllowedError extends PermissionDeniedError {
|
|
2106
|
+
/** The address ScrapeBadger saw (null when relayed, e.g. via the hosted MCP server) */
|
|
2107
|
+
readonly clientIp: string | null;
|
|
2108
|
+
constructor(message?: string, clientIp?: string | null);
|
|
2109
|
+
}
|
|
2101
2110
|
/**
|
|
2102
2111
|
* Raised when rate limit is exceeded.
|
|
2103
2112
|
*/
|
|
@@ -3166,4 +3175,4 @@ declare class TwitterClient {
|
|
|
3166
3175
|
removeWebhookFromMonitor(webhookId: string, body?: unknown, params?: Record<string, string | number | boolean | undefined>): Promise<Record<string, unknown>>;
|
|
3167
3176
|
}
|
|
3168
3177
|
|
|
3169
|
-
export { type
|
|
3178
|
+
export { type PlaceTrends as $, AuthenticationError as A, BaseClient as B, ConflictError as C, type User as D, type UserAbout as E, type UserIds as F, GeoClient as G, type Hashtag as H, InsufficientCreditsError as I, type List as J, type CommunityBanner as K, ListsClient as L, type Media as M, NotFoundError as N, type CommunityRule as O, PermissionDeniedError as P, type QueryType as Q, type ResolvedConfig as R, type ScrapeBadgerConfig as S, TwitterClient as T, UsersClient as U, ValidationError as V, WebSocketStreamError as W, type Community as X, type CommunityMember as Y, type Trend as Z, type Location as _, ScrapeBadgerError as a, type Place as a0, type Article as a1, type CommunityNote as a2, type Space as a3, type Broadcast as a4, type ApiResponse as a5, type ListResponse as a6, type MonitorStatus as a7, type StreamMonitor as a8, type StreamMonitorList as a9, type CreateMonitorParams as aa, type UpdateMonitorParams as ab, type StreamTweet as ac, type ConnectedEvent as ad, type PingEvent as ae, type TweetEvent as af, type ErrorEvent as ag, type StreamEvent as ah, type StreamEventType as ai, type DeliveryLog as aj, type DeliveryLogList as ak, type BillingLog as al, type BillingLogList as am, type ConnectOptions as an, type FilterRuleStatus as ao, type FilterRuleResponse as ap, type FilterRuleCreate as aq, type FilterRuleUpdate as ar, type FilterRulePricingTier as as, type FilterRuleListResponse as at, type FilterRuleValidateResponse as au, type FilterRuleDeliveryLog as av, type FilterRuleDeliveryLogListResponse as aw, type FilterRulePricingTiersResponse as ax, RateLimitError as b, ServerError as c, TimeoutError as d, AccountRestrictedError as e, IPNotAllowedError as f, type PaginatedResponse as g, type PaginationOptions as h, type IteratorOptions as i, collectAll as j, TweetsClient as k, CommunitiesClient as l, TrendsClient as m, type GeoSearchOptions as n, StreamClient as o, type StreamEmitter as p, SpacesClient as q, type TrendCategory as r, type CommunityTweetType as s, type PollOption as t, type Poll as u, verifyWebhookSignature as v, type Url as w, type UserMention as x, type TweetPlace as y, type Tweet as z };
|
|
@@ -2098,6 +2098,15 @@ declare class PermissionDeniedError extends AuthenticationError {
|
|
|
2098
2098
|
readonly allowedScopes: string[];
|
|
2099
2099
|
constructor(message?: string, requiredScope?: string, allowedScopes?: string[]);
|
|
2100
2100
|
}
|
|
2101
|
+
/**
|
|
2102
|
+
* Raised when the API key is restricted to IP addresses and this request came
|
|
2103
|
+
* from another one (HTTP 403, `error: "ip_not_allowed"`). Not charged.
|
|
2104
|
+
*/
|
|
2105
|
+
declare class IPNotAllowedError extends PermissionDeniedError {
|
|
2106
|
+
/** The address ScrapeBadger saw (null when relayed, e.g. via the hosted MCP server) */
|
|
2107
|
+
readonly clientIp: string | null;
|
|
2108
|
+
constructor(message?: string, clientIp?: string | null);
|
|
2109
|
+
}
|
|
2101
2110
|
/**
|
|
2102
2111
|
* Raised when rate limit is exceeded.
|
|
2103
2112
|
*/
|
|
@@ -3166,4 +3175,4 @@ declare class TwitterClient {
|
|
|
3166
3175
|
removeWebhookFromMonitor(webhookId: string, body?: unknown, params?: Record<string, string | number | boolean | undefined>): Promise<Record<string, unknown>>;
|
|
3167
3176
|
}
|
|
3168
3177
|
|
|
3169
|
-
export { type
|
|
3178
|
+
export { type PlaceTrends as $, AuthenticationError as A, BaseClient as B, ConflictError as C, type User as D, type UserAbout as E, type UserIds as F, GeoClient as G, type Hashtag as H, InsufficientCreditsError as I, type List as J, type CommunityBanner as K, ListsClient as L, type Media as M, NotFoundError as N, type CommunityRule as O, PermissionDeniedError as P, type QueryType as Q, type ResolvedConfig as R, type ScrapeBadgerConfig as S, TwitterClient as T, UsersClient as U, ValidationError as V, WebSocketStreamError as W, type Community as X, type CommunityMember as Y, type Trend as Z, type Location as _, ScrapeBadgerError as a, type Place as a0, type Article as a1, type CommunityNote as a2, type Space as a3, type Broadcast as a4, type ApiResponse as a5, type ListResponse as a6, type MonitorStatus as a7, type StreamMonitor as a8, type StreamMonitorList as a9, type CreateMonitorParams as aa, type UpdateMonitorParams as ab, type StreamTweet as ac, type ConnectedEvent as ad, type PingEvent as ae, type TweetEvent as af, type ErrorEvent as ag, type StreamEvent as ah, type StreamEventType as ai, type DeliveryLog as aj, type DeliveryLogList as ak, type BillingLog as al, type BillingLogList as am, type ConnectOptions as an, type FilterRuleStatus as ao, type FilterRuleResponse as ap, type FilterRuleCreate as aq, type FilterRuleUpdate as ar, type FilterRulePricingTier as as, type FilterRuleListResponse as at, type FilterRuleValidateResponse as au, type FilterRuleDeliveryLog as av, type FilterRuleDeliveryLogListResponse as aw, type FilterRulePricingTiersResponse as ax, RateLimitError as b, ServerError as c, TimeoutError as d, AccountRestrictedError as e, IPNotAllowedError as f, type PaginatedResponse as g, type PaginationOptions as h, type IteratorOptions as i, collectAll as j, TweetsClient as k, CommunitiesClient as l, TrendsClient as m, type GeoSearchOptions as n, StreamClient as o, type StreamEmitter as p, SpacesClient as q, type TrendCategory as r, type CommunityTweetType as s, type PollOption as t, type Poll as u, verifyWebhookSignature as v, type Url as w, type UserMention as x, type TweetPlace as y, type Tweet as z };
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BaseClient, T as TwitterClient, S as ScrapeBadgerConfig } from './index-
|
|
2
|
-
export { e as AccountRestrictedError,
|
|
1
|
+
import { B as BaseClient, T as TwitterClient, S as ScrapeBadgerConfig } from './index-DBk60c2e.cjs';
|
|
2
|
+
export { e as AccountRestrictedError, a5 as ApiResponse, a1 as Article, A as AuthenticationError, al as BillingLog, am as BillingLogList, a4 as Broadcast, l as CommunitiesClient, X as Community, K as CommunityBanner, Y as CommunityMember, a2 as CommunityNote, O as CommunityRule, s as CommunityTweetType, C as ConflictError, an as ConnectOptions, ad as ConnectedEvent, aa as CreateMonitorParams, aj as DeliveryLog, ak as DeliveryLogList, ag as ErrorEvent, aq as FilterRuleCreate, av as FilterRuleDeliveryLog, aw as FilterRuleDeliveryLogListResponse, at as FilterRuleListResponse, as as FilterRulePricingTier, ax as FilterRulePricingTiersResponse, ap as FilterRuleResponse, ao as FilterRuleStatus, ar as FilterRuleUpdate, au as FilterRuleValidateResponse, G as GeoClient, n as GeoSearchOptions, H as Hashtag, f as IPNotAllowedError, I as InsufficientCreditsError, i as IteratorOptions, J as List, a6 as ListResponse, L as ListsClient, _ as Location, M as Media, a7 as MonitorStatus, N as NotFoundError, g as PaginatedResponse, h as PaginationOptions, P as PermissionDeniedError, ae as PingEvent, a0 as Place, $ as PlaceTrends, u as Poll, t as PollOption, Q as QueryType, b as RateLimitError, R as ResolvedConfig, a as ScrapeBadgerError, c as ServerError, a3 as Space, q as SpacesClient, o as StreamClient, p as StreamEmitter, ah as StreamEvent, ai as StreamEventType, a8 as StreamMonitor, a9 as StreamMonitorList, ac as StreamTweet, d as TimeoutError, Z as Trend, r as TrendCategory, m as TrendsClient, z as Tweet, af as TweetEvent, y as TweetPlace, k as TweetsClient, ab as UpdateMonitorParams, w as Url, D as User, E as UserAbout, F as UserIds, x as UserMention, U as UsersClient, V as ValidationError, W as WebSocketStreamError, j as collectAll, v as verifyWebhookSignature } from './index-DBk60c2e.cjs';
|
|
3
3
|
import 'node:events';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1499,8 +1499,10 @@ interface LensSearchParams {
|
|
|
1499
1499
|
gl?: string;
|
|
1500
1500
|
hl?: string;
|
|
1501
1501
|
/**
|
|
1502
|
-
*
|
|
1503
|
-
*
|
|
1502
|
+
* Return only the tiles Google marked as buyable — those carrying a price
|
|
1503
|
+
* chip and stock status — drawn from the same grid with no extra request.
|
|
1504
|
+
* When the image has no shoppable matches the full grid is returned and
|
|
1505
|
+
* `warnings` says so.
|
|
1504
1506
|
*/
|
|
1505
1507
|
product?: boolean;
|
|
1506
1508
|
/**
|
|
@@ -1511,8 +1513,8 @@ interface LensSearchParams {
|
|
|
1511
1513
|
/**
|
|
1512
1514
|
* Return just the pages hosting this image, each flagged `exact_match`,
|
|
1513
1515
|
* instead of the broad visual grid — what a copyright or provenance
|
|
1514
|
-
* check needs. Google exposes this set for most images but not all (
|
|
1515
|
-
*
|
|
1516
|
+
* check needs. Google exposes this set for most images but not all (8 of 10
|
|
1517
|
+
* in our sampling); when it is unavailable the full grid is
|
|
1516
1518
|
* returned and `warnings` says the filter was not applied.
|
|
1517
1519
|
*/
|
|
1518
1520
|
exact_matches?: boolean;
|
|
@@ -1807,8 +1809,8 @@ declare class JobsClient {
|
|
|
1807
1809
|
* Also carries a `warnings` array naming any parameter that could not be
|
|
1808
1810
|
* applied. `exact_matches: true` returns just the pages hosting the image,
|
|
1809
1811
|
* flagged `exact_match`, for most images; when Google does not expose that
|
|
1810
|
-
* set the grid comes back and `warnings` says so. `product`
|
|
1811
|
-
*
|
|
1812
|
+
* set the grid comes back and `warnings` says so. `product: true` narrows the same grid to the tiles Google marked
|
|
1813
|
+
* buyable.
|
|
1812
1814
|
*
|
|
1813
1815
|
* @example
|
|
1814
1816
|
* ```typescript
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BaseClient, T as TwitterClient, S as ScrapeBadgerConfig } from './index-
|
|
2
|
-
export { e as AccountRestrictedError,
|
|
1
|
+
import { B as BaseClient, T as TwitterClient, S as ScrapeBadgerConfig } from './index-DBk60c2e.js';
|
|
2
|
+
export { e as AccountRestrictedError, a5 as ApiResponse, a1 as Article, A as AuthenticationError, al as BillingLog, am as BillingLogList, a4 as Broadcast, l as CommunitiesClient, X as Community, K as CommunityBanner, Y as CommunityMember, a2 as CommunityNote, O as CommunityRule, s as CommunityTweetType, C as ConflictError, an as ConnectOptions, ad as ConnectedEvent, aa as CreateMonitorParams, aj as DeliveryLog, ak as DeliveryLogList, ag as ErrorEvent, aq as FilterRuleCreate, av as FilterRuleDeliveryLog, aw as FilterRuleDeliveryLogListResponse, at as FilterRuleListResponse, as as FilterRulePricingTier, ax as FilterRulePricingTiersResponse, ap as FilterRuleResponse, ao as FilterRuleStatus, ar as FilterRuleUpdate, au as FilterRuleValidateResponse, G as GeoClient, n as GeoSearchOptions, H as Hashtag, f as IPNotAllowedError, I as InsufficientCreditsError, i as IteratorOptions, J as List, a6 as ListResponse, L as ListsClient, _ as Location, M as Media, a7 as MonitorStatus, N as NotFoundError, g as PaginatedResponse, h as PaginationOptions, P as PermissionDeniedError, ae as PingEvent, a0 as Place, $ as PlaceTrends, u as Poll, t as PollOption, Q as QueryType, b as RateLimitError, R as ResolvedConfig, a as ScrapeBadgerError, c as ServerError, a3 as Space, q as SpacesClient, o as StreamClient, p as StreamEmitter, ah as StreamEvent, ai as StreamEventType, a8 as StreamMonitor, a9 as StreamMonitorList, ac as StreamTweet, d as TimeoutError, Z as Trend, r as TrendCategory, m as TrendsClient, z as Tweet, af as TweetEvent, y as TweetPlace, k as TweetsClient, ab as UpdateMonitorParams, w as Url, D as User, E as UserAbout, F as UserIds, x as UserMention, U as UsersClient, V as ValidationError, W as WebSocketStreamError, j as collectAll, v as verifyWebhookSignature } from './index-DBk60c2e.js';
|
|
3
3
|
import 'node:events';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1499,8 +1499,10 @@ interface LensSearchParams {
|
|
|
1499
1499
|
gl?: string;
|
|
1500
1500
|
hl?: string;
|
|
1501
1501
|
/**
|
|
1502
|
-
*
|
|
1503
|
-
*
|
|
1502
|
+
* Return only the tiles Google marked as buyable — those carrying a price
|
|
1503
|
+
* chip and stock status — drawn from the same grid with no extra request.
|
|
1504
|
+
* When the image has no shoppable matches the full grid is returned and
|
|
1505
|
+
* `warnings` says so.
|
|
1504
1506
|
*/
|
|
1505
1507
|
product?: boolean;
|
|
1506
1508
|
/**
|
|
@@ -1511,8 +1513,8 @@ interface LensSearchParams {
|
|
|
1511
1513
|
/**
|
|
1512
1514
|
* Return just the pages hosting this image, each flagged `exact_match`,
|
|
1513
1515
|
* instead of the broad visual grid — what a copyright or provenance
|
|
1514
|
-
* check needs. Google exposes this set for most images but not all (
|
|
1515
|
-
*
|
|
1516
|
+
* check needs. Google exposes this set for most images but not all (8 of 10
|
|
1517
|
+
* in our sampling); when it is unavailable the full grid is
|
|
1516
1518
|
* returned and `warnings` says the filter was not applied.
|
|
1517
1519
|
*/
|
|
1518
1520
|
exact_matches?: boolean;
|
|
@@ -1807,8 +1809,8 @@ declare class JobsClient {
|
|
|
1807
1809
|
* Also carries a `warnings` array naming any parameter that could not be
|
|
1808
1810
|
* applied. `exact_matches: true` returns just the pages hosting the image,
|
|
1809
1811
|
* flagged `exact_match`, for most images; when Google does not expose that
|
|
1810
|
-
* set the grid comes back and `warnings` says so. `product`
|
|
1811
|
-
*
|
|
1812
|
+
* set the grid comes back and `warnings` says so. `product: true` narrows the same grid to the tiles Google marked
|
|
1813
|
+
* buyable.
|
|
1812
1814
|
*
|
|
1813
1815
|
* @example
|
|
1814
1816
|
* ```typescript
|
package/dist/index.js
CHANGED
|
@@ -39,6 +39,16 @@ var PermissionDeniedError = class _PermissionDeniedError extends AuthenticationE
|
|
|
39
39
|
Object.setPrototypeOf(this, _PermissionDeniedError.prototype);
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
|
+
var IPNotAllowedError = class _IPNotAllowedError extends PermissionDeniedError {
|
|
43
|
+
/** The address ScrapeBadger saw (null when relayed, e.g. via the hosted MCP server) */
|
|
44
|
+
clientIp;
|
|
45
|
+
constructor(message = "This API key may not be used from this IP address.", clientIp = null) {
|
|
46
|
+
super(message);
|
|
47
|
+
this.name = "IPNotAllowedError";
|
|
48
|
+
this.clientIp = clientIp;
|
|
49
|
+
Object.setPrototypeOf(this, _IPNotAllowedError.prototype);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
42
52
|
var RateLimitError = class _RateLimitError extends ScrapeBadgerError {
|
|
43
53
|
/** Unix timestamp when the rate limit resets */
|
|
44
54
|
retryAfter;
|
|
@@ -354,6 +364,9 @@ var BaseClient = class _BaseClient {
|
|
|
354
364
|
case 402:
|
|
355
365
|
throw new InsufficientCreditsError(message, errorData.credits_balance);
|
|
356
366
|
case 403:
|
|
367
|
+
if (errorData.error === "ip_not_allowed") {
|
|
368
|
+
throw new IPNotAllowedError(message, errorData.client_ip ?? null);
|
|
369
|
+
}
|
|
357
370
|
if (errorData.error === "insufficient_scope") {
|
|
358
371
|
throw new PermissionDeniedError(
|
|
359
372
|
message,
|
|
@@ -9117,6 +9130,7 @@ exports.GoogleShoppingClient = ShoppingClient;
|
|
|
9117
9130
|
exports.GoogleShortsClient = ShortsClient;
|
|
9118
9131
|
exports.GoogleTrendsClient = TrendsClient2;
|
|
9119
9132
|
exports.GoogleVideosClient = VideosClient;
|
|
9133
|
+
exports.IPNotAllowedError = IPNotAllowedError;
|
|
9120
9134
|
exports.ImmobiliareClient = ImmobiliareClient;
|
|
9121
9135
|
exports.InstagramAudioClient = AudioClient;
|
|
9122
9136
|
exports.InstagramClient = InstagramClient;
|