scavio 0.35.0 → 0.36.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/README.md CHANGED
@@ -685,13 +685,35 @@ to `MENARDS_PRODUCT_TIMEOUT` (120s). None ever lowers a longer client timeout.
685
685
 
686
686
  ### [Nordstrom](https://scavio.dev/docs/nordstrom-search?utm_source=npm-scavio-js&utm_medium=package&utm_campaign=readme)
687
687
 
688
- Two endpoints, new in 0.35.0, 5 credits each. nordstrom.com (US site only).
689
- `search` returns 24 products a page with current and original price ranges,
690
- percent off, on-sale flag, rating, review count, badges and colors; `sort` is
691
- `relevance` (default), `rating`, `price_high`, `price_low`, `newest` or
692
- `percent_off`. `product` takes a result's `url` or `style_id` and lists every
693
- color and size as a sku with UPC, price, price type, `in_stock` and the
694
- `quantity` available to ship online.
688
+ Seven endpoints, nordstrom.com (US site only). `search` and `product` are new in
689
+ 0.35.0; `category`, `brand`, `stores`, `availability` and `suggestions` are new
690
+ in 0.36.0. `availability` costs 10 credits (the product page plus the store
691
+ lookup); every other call costs 5.
692
+
693
+ - `search`, `category` and `brand` return 24 products a page with current and
694
+ original price ranges, percent off, on-sale flag, rating, review count,
695
+ badges and colors; `sort` is `relevance` (default), `rating`, `price_high`,
696
+ `price_low`, `newest` or `percent_off`. `category` takes a `/browse` path or
697
+ URL (departments, `sale/women`, `/browse/new`); `brand` takes a
698
+ `/brands/<slug>--<id>` path or URL (a product's `brand_url` works). Both also
699
+ return the category or brand (name, title, path, URL, breadcrumbs,
700
+ subcategories) and the filter sidebar with option counts (top 100 options per
701
+ group); filters inside a category URL are ignored.
702
+ - `product` takes a result's `url` or `style_id` and lists every color and size
703
+ as a sku with UPC, price, price type, `in_stock` and the `quantity` available
704
+ to ship. `in_stock` is true when the sku can be shipped or picked up in a
705
+ store, so a sku can be in stock with `quantity` 0 (store-only).
706
+ - `availability` takes `url` or `style_id` (optionally `sku_id`) and returns per
707
+ sku `ship_quantity`, `pickup_available`, `pick_quantity` and the stores that
708
+ can do in-store pickup. Quantities are chain-wide; per store Nordstrom only
709
+ says whether pickup is available, not how many.
710
+ - `stores` takes exactly one of `zip`, `latitude` + `longitude`, or
711
+ `store_numbers` (array or comma-separated string), with `distance_miles`
712
+ 1-100 (default 100). Each store has address, phone, hours, daily hours,
713
+ coordinates, pickup and curbside flags and amenities. A ZIP with no store in
714
+ range is an empty list (still billed).
715
+ - `suggestions` returns the site's autocomplete strings for a partial `query`
716
+ (`limit` 1-20, default 8).
695
717
 
696
718
  ```ts
697
719
  const found = await client.nordstrom.search({ query: "dress", sort: "percent_off" });
@@ -702,12 +724,25 @@ const item = await client.nordstrom.product({ style_id: top.style_id });
702
724
  for (const color of (item as any).data.colors) {
703
725
  for (const sku of color.skus) console.log(color.name, sku.size, sku.upc, sku.price, sku.price_type, sku.quantity);
704
726
  }
727
+
728
+ const dresses = await client.nordstrom.category({ category: "/browse/women/clothing/dresses", sort: "price_low" });
729
+ const label = await client.nordstrom.brand({ brand: "/brands/astr-the-label--53360" });
730
+ const near = await client.nordstrom.stores({ zip: "10001" });
731
+
732
+ const stock = await client.nordstrom.availability({ style_id: "7737947" });
733
+ for (const sku of (stock as any).data.skus) {
734
+ console.log(sku.sku_id, sku.size, sku.color, sku.ship_quantity, sku.pick_quantity, sku.pickup_store_count);
735
+ }
736
+
737
+ const ideas = await client.nordstrom.suggestions({ query: "nike air" });
738
+ console.log((ideas as any).data.suggestions);
705
739
  ```
706
740
 
707
- Reviews are the 12-13 shown on the product page, with no deeper paging. There
708
- is no store locator, store-level stock or category endpoint. An unknown style
709
- id is a 404. Both calls raise the request timeout to `NORDSTROM_TIMEOUT`
710
- (120s), never lowering a longer client timeout.
741
+ `product` returns the reviews shown on the product page (up to about 13) plus
742
+ the total review count and star histogram; the full review history is not
743
+ available. An unknown style id, sku id, category or brand is a 404. Every call
744
+ raises the request timeout to `NORDSTROM_TIMEOUT` (120s), never lowering a
745
+ longer client timeout.
711
746
 
712
747
  ### [Mercado Libre](https://scavio.dev/docs/mercadolibre-search?utm_source=npm-scavio-js&utm_medium=package&utm_campaign=readme)
713
748
 
package/dist/index.cjs CHANGED
@@ -261,7 +261,7 @@ function parseRetryAfter(header) {
261
261
  var BASE_URL = "https://api.scavio.dev";
262
262
  var DEFAULT_TIMEOUT = 3e4;
263
263
  var DEFAULT_MAX_RETRIES = 2;
264
- var SDK_VERSION = true ? "0.35.0" : "0.0.0";
264
+ var SDK_VERSION = true ? "0.36.0" : "0.0.0";
265
265
  var USER_AGENT = `scavio-js/${SDK_VERSION}`;
266
266
  function isServerRuntime() {
267
267
  const g = globalThis;
@@ -3935,8 +3935,11 @@ var NordstromNamespace = class {
3935
3935
  * criticized features with a quote each, breadcrumbs and images. Every color
3936
3936
  * lists its images and every size as a sku with sku id, size, size type,
3937
3937
  * UPC, price, original price, percent off, price type (regular, clearance,
3938
- * promotion), in_stock and the quantity available to ship. Includes the
3939
- * 12-13 reviews shown on the product page, with title, text, rating, size
3938
+ * promotion), in_stock and the quantity available to ship. in_stock is true
3939
+ * when the sku can be shipped or picked up in a store, so a sku held only in
3940
+ * a store reads in stock with quantity 0 (availability() lists its pickup
3941
+ * stores). Includes the reviews shown on the product page (up to about 13),
3942
+ * with the total review count; each review has title, text, rating, size
3940
3943
  * rating, author, date, helpful votes and verified-purchase flag. Pass url
3941
3944
  * or style_id. An unknown style id is a 404.
3942
3945
  *
@@ -3945,6 +3948,76 @@ var NordstromNamespace = class {
3945
3948
  async product(options) {
3946
3949
  return this.client._post("/api/v1/nordstrom/product", options, void 0, NORDSTROM_TIMEOUT);
3947
3950
  }
3951
+ /**
3952
+ * Browse a nordstrom.com (US) category page, 24 products per page, sorted
3953
+ * by relevance, rating, price, newest or percent off. Works on any /browse
3954
+ * category, including sale (sale/women), new arrivals (/browse/new) and
3955
+ * top-level departments (/browse/women). Returns the category's name, page
3956
+ * title, path, URL, breadcrumbs and subcategories (name and path, for
3957
+ * drilling down). Each product has the same fields as a search result. Also
3958
+ * returns the total result count, page count, and the filter sidebar: each
3959
+ * filter group with its options and product counts (groups with more than
3960
+ * 100 options list the 100 with the most products and give the full
3961
+ * option_count). An unknown category is a 404.
3962
+ *
3963
+ * Costs 5 credits.
3964
+ */
3965
+ async category(options) {
3966
+ return this.client._post("/api/v1/nordstrom/category", options, void 0, NORDSTROM_TIMEOUT);
3967
+ }
3968
+ /**
3969
+ * List a brand's products on nordstrom.com (US) from its brand page, 24 per
3970
+ * page, sorted by relevance, rating, price, newest or percent off. Returns
3971
+ * the brand's name, path, URL, breadcrumbs and sub-pages (Women, Men,
3972
+ * Kids...), products with the same fields as a search result, the total
3973
+ * result count, page count and the filter sidebar with option counts. An
3974
+ * unknown brand is a 404.
3975
+ *
3976
+ * Costs 5 credits.
3977
+ */
3978
+ async brand(options) {
3979
+ return this.client._post("/api/v1/nordstrom/brand", options, void 0, NORDSTROM_TIMEOUT);
3980
+ }
3981
+ /**
3982
+ * Find Nordstrom stores (full-line stores and Nordstrom Local) near a US ZIP
3983
+ * code or latitude/longitude within up to 100 miles, nearest first, or look
3984
+ * stores up by store number. Each store has store number, name, type
3985
+ * (full_line or local), address, phone, weekly hours, holiday hours when
3986
+ * posted, open and close times for the next 8 days, time zone, distance in
3987
+ * miles, coordinates, whether it offers buy-online pickup and curbside
3988
+ * pickup, its amenities and its store page URL. A ZIP with no store in range
3989
+ * returns an empty list.
3990
+ *
3991
+ * Costs 5 credits.
3992
+ */
3993
+ async stores(options) {
3994
+ return this.client._post("/api/v1/nordstrom/stores", options, void 0, NORDSTROM_TIMEOUT);
3995
+ }
3996
+ /**
3997
+ * Online and store-pickup availability for every size and color of one
3998
+ * nordstrom.com (US) product, by URL or style id, optionally one sku. Each
3999
+ * sku has sku id, size, color, UPC, in_stock, whether it ships and the
4000
+ * quantity available to ship, the quantity available for pickup, and the
4001
+ * stores where it can be picked up (store number, name, address, city,
4002
+ * state, ZIP, phone). Quantities are chain-wide: per store Nordstrom only
4003
+ * says whether pickup is available, not how many. An unknown style id or sku
4004
+ * id is a 404.
4005
+ *
4006
+ * Costs 10 credits (the product page plus the store lookup).
4007
+ */
4008
+ async availability(options) {
4009
+ return this.client._post("/api/v1/nordstrom/availability", options, void 0, NORDSTROM_TIMEOUT);
4010
+ }
4011
+ /**
4012
+ * The search-box autocomplete of nordstrom.com: the queries Nordstrom
4013
+ * suggests for a partial search term, most likely first. Useful for keyword
4014
+ * research and for building queries for search().
4015
+ *
4016
+ * Costs 5 credits.
4017
+ */
4018
+ async suggestions(options) {
4019
+ return this.client._post("/api/v1/nordstrom/suggestions", options, void 0, NORDSTROM_TIMEOUT);
4020
+ }
3948
4021
  };
3949
4022
 
3950
4023
  // src/namespaces/trustpilot.ts