scrapebadger 0.82.0 → 0.83.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.cjs +38 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +48 -17
- package/dist/index.d.ts +48 -17
- package/dist/index.mjs +38 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -9,7 +9,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
9
9
|
var WebSocket__default = /*#__PURE__*/_interopDefault(WebSocket);
|
|
10
10
|
|
|
11
11
|
// src/internal/version.ts
|
|
12
|
-
var SDK_VERSION = "0.
|
|
12
|
+
var SDK_VERSION = "0.83.0";
|
|
13
13
|
|
|
14
14
|
// src/internal/exceptions.ts
|
|
15
15
|
var ScrapeBadgerError = class _ScrapeBadgerError extends Error {
|
|
@@ -3497,10 +3497,12 @@ var MapsClient = class {
|
|
|
3497
3497
|
* Get full place detail by `place_id` or `data_id`.
|
|
3498
3498
|
*
|
|
3499
3499
|
* Returns title, address, phone, website, GPS, rating, reviews_count,
|
|
3500
|
-
*
|
|
3501
|
-
* (
|
|
3502
|
-
*
|
|
3503
|
-
*
|
|
3500
|
+
* categories, extensions (amenity groups such as accessibility),
|
|
3501
|
+
* opening hours (`open_state`, today's `hours`, and `operating_hours`
|
|
3502
|
+
* for the coming seven days), `price_level` (Google's price per person,
|
|
3503
|
+
* e.g. "฿2,000+"), popular_times, provider_id, `thumbnail`/`image`, and
|
|
3504
|
+
* up to 20 photo URLs. `service_options` is null: Google no longer
|
|
3505
|
+
* exposes those flags to signed-out clients.
|
|
3504
3506
|
*/
|
|
3505
3507
|
async place(params) {
|
|
3506
3508
|
if (!params.place_id && !params.data_id) {
|
|
@@ -3523,12 +3525,13 @@ var MapsClient = class {
|
|
|
3523
3525
|
});
|
|
3524
3526
|
}
|
|
3525
3527
|
/**
|
|
3526
|
-
* Get photos for a place
|
|
3528
|
+
* Get photos for a place.
|
|
3527
3529
|
*
|
|
3528
|
-
* Returns
|
|
3529
|
-
*
|
|
3530
|
-
*
|
|
3531
|
-
* one
|
|
3530
|
+
* Returns the photos Google exposes to signed-out clients (usually the
|
|
3531
|
+
* first 8 of the gallery) as `thumbnail` and `image` URLs.
|
|
3532
|
+
* `pagination.total_results` is the place's total photo count on Google;
|
|
3533
|
+
* there is one page (`next` is null). To get another size, replace a
|
|
3534
|
+
* URL's `=w..-h..-k-no` suffix and keep its path.
|
|
3532
3535
|
*/
|
|
3533
3536
|
async photos(params) {
|
|
3534
3537
|
return this.client.request("/v1/google/maps/photos", {
|
|
@@ -10513,6 +10516,10 @@ var DepopClient = class {
|
|
|
10513
10516
|
|
|
10514
10517
|
// src/wallapop/client.ts
|
|
10515
10518
|
var onlyTrue = (value) => value ? true : void 0;
|
|
10519
|
+
var idList = (ids) => {
|
|
10520
|
+
if (ids === void 0 || typeof ids === "string") return ids;
|
|
10521
|
+
return ids.length > 0 ? ids.join(",") : void 0;
|
|
10522
|
+
};
|
|
10516
10523
|
var WallapopClient = class {
|
|
10517
10524
|
client;
|
|
10518
10525
|
constructor(client) {
|
|
@@ -10521,15 +10528,26 @@ var WallapopClient = class {
|
|
|
10521
10528
|
/**
|
|
10522
10529
|
* Search Wallapop listings (40 per page).
|
|
10523
10530
|
*
|
|
10524
|
-
* Needs a query, a `categoryId`, or
|
|
10525
|
-
* which case every other parameter is
|
|
10531
|
+
* Needs a query, a `categoryId`, `subcategoryIds`, or a combination —
|
|
10532
|
+
* unless `nextPage` is given, in which case every other parameter is
|
|
10533
|
+
* ignored (the cursor already carries them).
|
|
10526
10534
|
*
|
|
10527
10535
|
* @param query - Search text, e.g. "iphone 14" (optional with `categoryId` or `nextPage`).
|
|
10528
10536
|
* @param options - Optional parameters (market, location/radius, category,
|
|
10529
|
-
* price, condition, brand/model/colour, cars filters,
|
|
10537
|
+
* subcategories, price, condition, brand/model/colour, cars filters,
|
|
10538
|
+
* sort, cursor).
|
|
10530
10539
|
* @returns Search response with matching listings and the next-page cursor.
|
|
10531
10540
|
* @throws AuthenticationError - If the API key is invalid.
|
|
10532
|
-
* @throws ValidationError - If neither a query nor a category is given.
|
|
10541
|
+
* @throws ValidationError - If neither a query nor a category/subcategory is given.
|
|
10542
|
+
*
|
|
10543
|
+
* @example
|
|
10544
|
+
* ```typescript
|
|
10545
|
+
* // Smartphones (9447) under Technology & electronics (24200)
|
|
10546
|
+
* const phones = await client.wallapop.search("iphone", {
|
|
10547
|
+
* categoryId: 24200,
|
|
10548
|
+
* subcategoryIds: [9447],
|
|
10549
|
+
* });
|
|
10550
|
+
* ```
|
|
10533
10551
|
*/
|
|
10534
10552
|
async search(query, options = {}) {
|
|
10535
10553
|
return this.client.request("/v1/wallapop/search", {
|
|
@@ -10540,6 +10558,7 @@ var WallapopClient = class {
|
|
|
10540
10558
|
longitude: options.longitude,
|
|
10541
10559
|
distance_km: options.distanceKm,
|
|
10542
10560
|
category_id: options.categoryId,
|
|
10561
|
+
subcategory_ids: idList(options.subcategoryIds),
|
|
10543
10562
|
min_price: options.minPrice,
|
|
10544
10563
|
max_price: options.maxPrice,
|
|
10545
10564
|
condition: options.condition,
|
|
@@ -10646,13 +10665,14 @@ var WallapopClient = class {
|
|
|
10646
10665
|
* Get the search filters Wallapop offers for a category and/or query,
|
|
10647
10666
|
* with their option ids.
|
|
10648
10667
|
*
|
|
10649
|
-
* @param options - Optional parameters (categoryId, query, market).
|
|
10668
|
+
* @param options - Optional parameters (categoryId, subcategoryIds, query, market).
|
|
10650
10669
|
* @returns Available filters.
|
|
10651
10670
|
*/
|
|
10652
10671
|
async listFilters(options = {}) {
|
|
10653
10672
|
return this.client.request("/v1/wallapop/filters", {
|
|
10654
10673
|
params: {
|
|
10655
10674
|
category_id: options.categoryId,
|
|
10675
|
+
subcategory_ids: idList(options.subcategoryIds),
|
|
10656
10676
|
query: options.query,
|
|
10657
10677
|
market: options.market
|
|
10658
10678
|
}
|
|
@@ -10663,7 +10683,8 @@ var WallapopClient = class {
|
|
|
10663
10683
|
* separately — filters flagged `options_endpoint` in `listFilters`.
|
|
10664
10684
|
*
|
|
10665
10685
|
* @param filterId - Filter id, e.g. "brand".
|
|
10666
|
-
* @param options - Optional parameters (categoryId, query,
|
|
10686
|
+
* @param options - Optional parameters (categoryId, subcategoryIds, query,
|
|
10687
|
+
* market); e.g. `subcategoryIds: [9447]` returns phone brands only.
|
|
10667
10688
|
* @returns The filter's options.
|
|
10668
10689
|
* @throws ValidationError - If the filter id is invalid.
|
|
10669
10690
|
*/
|
|
@@ -10673,6 +10694,7 @@ var WallapopClient = class {
|
|
|
10673
10694
|
{
|
|
10674
10695
|
params: {
|
|
10675
10696
|
category_id: options.categoryId,
|
|
10697
|
+
subcategory_ids: idList(options.subcategoryIds),
|
|
10676
10698
|
query: options.query,
|
|
10677
10699
|
market: options.market
|
|
10678
10700
|
}
|