scrapebadger 0.60.0 → 0.60.1

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.mjs CHANGED
@@ -3,7 +3,7 @@ import { EventEmitter } from 'events';
3
3
  import WebSocket from 'ws';
4
4
 
5
5
  // src/internal/version.ts
6
- var SDK_VERSION = "0.60.0";
6
+ var SDK_VERSION = "0.60.1";
7
7
 
8
8
  // src/internal/exceptions.ts
9
9
  var ScrapeBadgerError = class _ScrapeBadgerError extends Error {
@@ -6585,9 +6585,8 @@ var GumtreeClient = class {
6585
6585
  * Full listing: description, every attribute, images, location, seller and
6586
6586
  * similar ads. Motors listings carry the full vehicle spec.
6587
6587
  *
6588
- * @param listingId - Gumtree listing id — the number at the end of the
6589
- * listing URL (uk/au: ~10 digits; za: the full 26-digit ad id, not the
6590
- * short one).
6588
+ * @param listingId - Gumtree listing id from the end of the listing URL
6589
+ * (uk/au: ~10 digits; za: the listing ref, e.g. `"ls26bvmcpnsqmz7l9jz"`).
6591
6590
  * @param options - Optional parameters (market).
6592
6591
  * @throws NotFoundError - If the listing does not exist or has expired.
6593
6592
  */
@@ -6600,8 +6599,8 @@ var GumtreeClient = class {
6600
6599
  * Every live listing by the seller of `listingId`. Gumtree keys a seller's
6601
6600
  * ad list by one of their ads, so any listing id of theirs works.
6602
6601
  *
6603
- * @param listingId - Any Gumtree listing id belonging to the seller (za: the
6604
- * 26-digit id).
6602
+ * @param listingId - Any Gumtree listing id belonging to the seller (za: a
6603
+ * listing ref, e.g. `"ls26bvmcpnsqmz7l9jz"`).
6605
6604
  * @param options - Page number (1-50), or `{ page, market }`.
6606
6605
  */
6607
6606
  async getSellerListings(listingId, options = {}) {
@@ -6624,7 +6623,8 @@ var GumtreeClient = class {
6624
6623
  }
6625
6624
  /**
6626
6625
  * Resolve a place name or postcode prefix to Gumtree locations. The `id`
6627
- * (au/za) or `name` (uk) is what {@link search} takes as `location`.
6626
+ * (au: a number; za: a ref such as `"pfw8k"`) or `name` (uk) is what
6627
+ * {@link search} takes as `location`.
6628
6628
  *
6629
6629
  * @param query - Town, area or postcode prefix (min 2 chars), e.g. `"manch"` or `"SW1A"`.
6630
6630
  * @param options - Optional parameters (market).
@@ -6637,9 +6637,10 @@ var GumtreeClient = class {
6637
6637
  }
6638
6638
  /**
6639
6639
  * Browse Gumtree's location tree. uk: UK -> nations -> counties -> towns;
6640
- * au: states -> regions -> areas; za: provinces -> towns.
6640
+ * au: states -> regions -> areas; za: provinces -> towns and suburbs.
6641
6641
  *
6642
- * @param options - Location id to list the children of, or
6642
+ * @param options - Location id (uk/au: a number; za: a ref such as
6643
+ * `"dkp8y"` for Gauteng) to list the children of, or
6643
6644
  * `{ parent_id, market }`. Unset = the market's root (the whole country).
6644
6645
  */
6645
6646
  async listLocations(options = {}) {
@@ -6648,10 +6649,11 @@ var GumtreeClient = class {
6648
6649
  });
6649
6650
  }
6650
6651
  /**
6651
- * Browse Gumtree's category tree. A node's `slug` (uk) or `id` (au/za) is
6652
- * the {@link search} category.
6652
+ * Browse Gumtree's category tree. A node's `slug` (uk) or `id` (au: a
6653
+ * number; za: a ref such as `"p6dnh"`) is the {@link search} category.
6653
6654
  *
6654
- * @param options - Category id to list the children of, or
6655
+ * @param options - Category id (uk/au: a number; za: a ref such as
6656
+ * `"l4dq6"` for Vehicles) to list the children of, or
6655
6657
  * `{ parent_id, market }`. Unset = the market's root (all categories).
6656
6658
  */
6657
6659
  async listCategories(options = {}) {
@@ -6668,7 +6670,7 @@ var GumtreeClient = class {
6668
6670
  }
6669
6671
  };
6670
6672
  function treeParams(options) {
6671
- const { parent_id, market } = typeof options === "number" ? { parent_id: options } : options;
6673
+ const { parent_id, market } = typeof options === "object" ? options : { parent_id: options };
6672
6674
  return { parent_id, market };
6673
6675
  }
6674
6676