scavio 0.26.4 → 0.27.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 +7 -0
- package/dist/index.cjs +13 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -7
- package/dist/index.d.ts +26 -7
- package/dist/index.js +13 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -967,8 +967,15 @@ await client.target.search({ keyword: "office chair", store_id: "1234" });
|
|
|
967
967
|
await client.target.category({ category_id: "5xtg6" });
|
|
968
968
|
await client.target.product({ tcin: "82291396" });
|
|
969
969
|
await client.target.reviews({ tcin: "82291396" });
|
|
970
|
+
// In-store stock at every Target near a ZIP (new in 0.27.0)
|
|
971
|
+
await client.target.availability({ tcin: "85978609", zip: "79407" });
|
|
970
972
|
```
|
|
971
973
|
|
|
974
|
+
`store_id` on search, category, product and reviews sets the store for prices.
|
|
975
|
+
`availability` is the in-store stock call: per store it returns units,
|
|
976
|
+
in-store, pickup, curbside and ship-to-store status, distance, address and hours
|
|
977
|
+
(up to 20 stores; pass `store_id` to keep one). About 3s.
|
|
978
|
+
|
|
972
979
|
1 credit per call, but these are the slowest endpoints in the SDK: product about
|
|
973
980
|
4s, search about 9s, category about 37s, reviews about 40s. Raise `timeout`
|
|
974
981
|
accordingly. `reviews` returns at most 8 review bodies whatever `review_count`
|
package/dist/index.cjs
CHANGED
|
@@ -235,7 +235,7 @@ function parseRetryAfter(header) {
|
|
|
235
235
|
var BASE_URL = "https://api.scavio.dev";
|
|
236
236
|
var DEFAULT_TIMEOUT = 3e4;
|
|
237
237
|
var DEFAULT_MAX_RETRIES = 2;
|
|
238
|
-
var SDK_VERSION = true ? "0.
|
|
238
|
+
var SDK_VERSION = true ? "0.27.0" : "0.0.0";
|
|
239
239
|
var USER_AGENT = `scavio-js/${SDK_VERSION}`;
|
|
240
240
|
function isServerRuntime() {
|
|
241
241
|
const g = globalThis;
|
|
@@ -1529,8 +1529,8 @@ var TargetNamespace = class {
|
|
|
1529
1529
|
* Target product details by TCIN: price, rating, images, specifications,
|
|
1530
1530
|
* variants, return policy and fulfillment.
|
|
1531
1531
|
*
|
|
1532
|
-
* `store_id` is a real request param here - the price
|
|
1533
|
-
*
|
|
1532
|
+
* `store_id` is a real request param here - the price you get back is the
|
|
1533
|
+
* store you asked for. For in-store stock use availability().
|
|
1534
1534
|
*
|
|
1535
1535
|
* Costs 1 credit. Typically ~4s. Single response, no pagination.
|
|
1536
1536
|
*/
|
|
@@ -1550,6 +1550,16 @@ var TargetNamespace = class {
|
|
|
1550
1550
|
async reviews(options) {
|
|
1551
1551
|
return this.client._post("/api/v1/target/reviews", options);
|
|
1552
1552
|
}
|
|
1553
|
+
/**
|
|
1554
|
+
* In-store stock for one product at every Target store near a ZIP: units,
|
|
1555
|
+
* in-store, pickup, curbside and ship-to-store status, distance, address and
|
|
1556
|
+
* hours. Up to 20 stores; `store_id` narrows to one.
|
|
1557
|
+
*
|
|
1558
|
+
* Costs 1 credit. Typically ~3s.
|
|
1559
|
+
*/
|
|
1560
|
+
async availability(options) {
|
|
1561
|
+
return this.client._post("/api/v1/target/availability", options);
|
|
1562
|
+
}
|
|
1553
1563
|
};
|
|
1554
1564
|
|
|
1555
1565
|
// src/namespaces/home-depot.ts
|