scavio 0.26.4 → 0.28.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 +88 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +127 -7
- package/dist/index.d.ts +127 -7
- package/dist/index.js +86 -3
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
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
|
@@ -49,11 +49,13 @@ __export(index_exports, {
|
|
|
49
49
|
GoogleAdsNamespace: () => GoogleAdsNamespace,
|
|
50
50
|
GoogleNamespace: () => GoogleNamespace,
|
|
51
51
|
GooglePlayNamespace: () => GooglePlayNamespace,
|
|
52
|
+
HebNamespace: () => HebNamespace,
|
|
52
53
|
HomeDepotNamespace: () => HomeDepotNamespace,
|
|
53
54
|
IndeedNamespace: () => IndeedNamespace,
|
|
54
55
|
InstagramNamespace: () => InstagramNamespace,
|
|
55
56
|
InsufficientCreditsError: () => InsufficientCreditsError,
|
|
56
57
|
InvalidAPIKeyError: () => InvalidAPIKeyError,
|
|
58
|
+
KrogerNamespace: () => KrogerNamespace,
|
|
57
59
|
KuaishouNamespace: () => KuaishouNamespace,
|
|
58
60
|
LinkedInNamespace: () => LinkedInNamespace,
|
|
59
61
|
MAX_REQUESTS_PER_SECOND: () => MAX_REQUESTS_PER_SECOND,
|
|
@@ -235,7 +237,7 @@ function parseRetryAfter(header) {
|
|
|
235
237
|
var BASE_URL = "https://api.scavio.dev";
|
|
236
238
|
var DEFAULT_TIMEOUT = 3e4;
|
|
237
239
|
var DEFAULT_MAX_RETRIES = 2;
|
|
238
|
-
var SDK_VERSION = true ? "0.
|
|
240
|
+
var SDK_VERSION = true ? "0.28.0" : "0.0.0";
|
|
239
241
|
var USER_AGENT = `scavio-js/${SDK_VERSION}`;
|
|
240
242
|
function isServerRuntime() {
|
|
241
243
|
const g = globalThis;
|
|
@@ -1529,8 +1531,8 @@ var TargetNamespace = class {
|
|
|
1529
1531
|
* Target product details by TCIN: price, rating, images, specifications,
|
|
1530
1532
|
* variants, return policy and fulfillment.
|
|
1531
1533
|
*
|
|
1532
|
-
* `store_id` is a real request param here - the price
|
|
1533
|
-
*
|
|
1534
|
+
* `store_id` is a real request param here - the price you get back is the
|
|
1535
|
+
* store you asked for. For in-store stock use availability().
|
|
1534
1536
|
*
|
|
1535
1537
|
* Costs 1 credit. Typically ~4s. Single response, no pagination.
|
|
1536
1538
|
*/
|
|
@@ -1550,6 +1552,16 @@ var TargetNamespace = class {
|
|
|
1550
1552
|
async reviews(options) {
|
|
1551
1553
|
return this.client._post("/api/v1/target/reviews", options);
|
|
1552
1554
|
}
|
|
1555
|
+
/**
|
|
1556
|
+
* In-store stock for one product at every Target store near a ZIP: units,
|
|
1557
|
+
* in-store, pickup, curbside and ship-to-store status, distance, address and
|
|
1558
|
+
* hours. Up to 20 stores; `store_id` narrows to one.
|
|
1559
|
+
*
|
|
1560
|
+
* Costs 1 credit. Typically ~3s.
|
|
1561
|
+
*/
|
|
1562
|
+
async availability(options) {
|
|
1563
|
+
return this.client._post("/api/v1/target/availability", options);
|
|
1564
|
+
}
|
|
1553
1565
|
};
|
|
1554
1566
|
|
|
1555
1567
|
// src/namespaces/home-depot.ts
|
|
@@ -2746,6 +2758,73 @@ var CostcoNamespace = class {
|
|
|
2746
2758
|
}
|
|
2747
2759
|
};
|
|
2748
2760
|
|
|
2761
|
+
// src/namespaces/heb.ts
|
|
2762
|
+
var HebNamespace = class {
|
|
2763
|
+
constructor(client) {
|
|
2764
|
+
this.client = client;
|
|
2765
|
+
}
|
|
2766
|
+
client;
|
|
2767
|
+
/**
|
|
2768
|
+
* Search HEB grocery products by keyword: price (cents), sale status, unit
|
|
2769
|
+
* price, size, UPC, stock, EBT/SNAP eligibility, aisle location and product
|
|
2770
|
+
* URL.
|
|
2771
|
+
*
|
|
2772
|
+
* Costs 2 credits.
|
|
2773
|
+
*/
|
|
2774
|
+
async search(options) {
|
|
2775
|
+
return this.client._post("/api/v1/heb/search", options);
|
|
2776
|
+
}
|
|
2777
|
+
/**
|
|
2778
|
+
* Full HEB product detail: nutrition facts, ingredients, description, images,
|
|
2779
|
+
* similar products, coupons, EBT/SNAP eligibility and breadcrumbs. Pass
|
|
2780
|
+
* product_url (from search()) or slug + product_id.
|
|
2781
|
+
*
|
|
2782
|
+
* Costs 2 credits.
|
|
2783
|
+
*/
|
|
2784
|
+
async product(options) {
|
|
2785
|
+
return this.client._post("/api/v1/heb/product", options);
|
|
2786
|
+
}
|
|
2787
|
+
/**
|
|
2788
|
+
* HEB stores near a US ZIP code or city: store number, address, phone, hours,
|
|
2789
|
+
* pharmacy availability, fulfillment channels, distance and store URL.
|
|
2790
|
+
*
|
|
2791
|
+
* Costs 2 credits.
|
|
2792
|
+
*/
|
|
2793
|
+
async stores(options) {
|
|
2794
|
+
return this.client._post("/api/v1/heb/stores", options);
|
|
2795
|
+
}
|
|
2796
|
+
};
|
|
2797
|
+
|
|
2798
|
+
// src/namespaces/kroger.ts
|
|
2799
|
+
var KrogerNamespace = class {
|
|
2800
|
+
constructor(client) {
|
|
2801
|
+
this.client = client;
|
|
2802
|
+
}
|
|
2803
|
+
client;
|
|
2804
|
+
/**
|
|
2805
|
+
* Search Kroger grocery products by keyword: price (cents), promo price,
|
|
2806
|
+
* n-for deals, unit price, size, UPC, stock, SNAP eligibility, dietary info,
|
|
2807
|
+
* rating and category. Kroger operates Kroger, Ralphs, Fred Meyer, Harris
|
|
2808
|
+
* Teeter, King Soopers, Fry's and other banners.
|
|
2809
|
+
*
|
|
2810
|
+
* Costs 2 credits.
|
|
2811
|
+
*/
|
|
2812
|
+
async search(options) {
|
|
2813
|
+
return this.client._post("/api/v1/kroger/search", options);
|
|
2814
|
+
}
|
|
2815
|
+
/**
|
|
2816
|
+
* Full Kroger product detail by URL or UPC: nutrition facts (allergens,
|
|
2817
|
+
* ingredients, nutrients with daily values), description, images, rating
|
|
2818
|
+
* distribution, store aisle location, stock level, dietary flags (organic,
|
|
2819
|
+
* non-GMO, gluten-free), SNAP eligibility, dimensions and country of origin.
|
|
2820
|
+
*
|
|
2821
|
+
* Costs 2 credits.
|
|
2822
|
+
*/
|
|
2823
|
+
async product(options) {
|
|
2824
|
+
return this.client._post("/api/v1/kroger/product", options);
|
|
2825
|
+
}
|
|
2826
|
+
};
|
|
2827
|
+
|
|
2749
2828
|
// src/namespaces/trustpilot.ts
|
|
2750
2829
|
var TrustpilotNamespace = class {
|
|
2751
2830
|
constructor(client) {
|
|
@@ -3257,6 +3336,8 @@ var Scavio = class extends ScavioCore {
|
|
|
3257
3336
|
googleAds;
|
|
3258
3337
|
metaAds;
|
|
3259
3338
|
costco;
|
|
3339
|
+
heb;
|
|
3340
|
+
kroger;
|
|
3260
3341
|
trustpilot;
|
|
3261
3342
|
chatgpt;
|
|
3262
3343
|
gemini;
|
|
@@ -3316,6 +3397,8 @@ var Scavio = class extends ScavioCore {
|
|
|
3316
3397
|
this.googleAds = new GoogleAdsNamespace(this);
|
|
3317
3398
|
this.metaAds = new MetaAdsNamespace(this);
|
|
3318
3399
|
this.costco = new CostcoNamespace(this);
|
|
3400
|
+
this.heb = new HebNamespace(this);
|
|
3401
|
+
this.kroger = new KrogerNamespace(this);
|
|
3319
3402
|
this.trustpilot = new TrustpilotNamespace(this);
|
|
3320
3403
|
this.chatgpt = new ChatgptNamespace(this);
|
|
3321
3404
|
this.gemini = new GeminiNamespace(this);
|
|
@@ -3444,11 +3527,13 @@ async function getSubtle() {
|
|
|
3444
3527
|
GoogleAdsNamespace,
|
|
3445
3528
|
GoogleNamespace,
|
|
3446
3529
|
GooglePlayNamespace,
|
|
3530
|
+
HebNamespace,
|
|
3447
3531
|
HomeDepotNamespace,
|
|
3448
3532
|
IndeedNamespace,
|
|
3449
3533
|
InstagramNamespace,
|
|
3450
3534
|
InsufficientCreditsError,
|
|
3451
3535
|
InvalidAPIKeyError,
|
|
3536
|
+
KrogerNamespace,
|
|
3452
3537
|
KuaishouNamespace,
|
|
3453
3538
|
LinkedInNamespace,
|
|
3454
3539
|
MAX_REQUESTS_PER_SECOND,
|