shop-client 3.22.0 → 3.23.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 +32 -50
- package/dist/ai/enrich.d.ts +1 -1
- package/dist/{chunk-ZW7ZIQBC.mjs → chunk-HEQDULXV.mjs} +122 -249
- package/dist/{chunk-GYQQU54C.mjs → chunk-LAJWR2GQ.mjs} +28 -122
- package/dist/collections.d.ts +7 -18
- package/dist/collections.mjs +1 -1
- package/dist/index.d.ts +11 -7
- package/dist/index.mjs +140 -85
- package/dist/products.d.ts +24 -64
- package/dist/products.mjs +1 -1
- package/dist/store.d.ts +6 -2
- package/dist/{types-QekjTHzI.d.ts → types-C0NvqVL-.d.ts} +27 -1
- package/dist/utils/detect-country.d.ts +1 -1
- package/dist/utils/func.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -359,7 +359,7 @@ Fetches all products from the store with automatic pagination handling.
|
|
|
359
359
|
const allProducts = await shop.products.all();
|
|
360
360
|
```
|
|
361
361
|
|
|
362
|
-
**Returns:** `
|
|
362
|
+
**Returns:** `ProductResult[] | null`
|
|
363
363
|
|
|
364
364
|
#### `products.paginated(options)`
|
|
365
365
|
|
|
@@ -379,7 +379,7 @@ const products = await shop.products.paginated({
|
|
|
379
379
|
- `limit` (number, optional): Products per page (default: 250, max: 250)
|
|
380
380
|
- `currency` (CurrencyCode, optional): ISO 4217 code aligned with `Intl.NumberFormatOptions['currency']` (e.g., `"USD"`, `"EUR"`, `"JPY"`)
|
|
381
381
|
|
|
382
|
-
**Returns:** `
|
|
382
|
+
**Returns:** `ProductResult[] | null`
|
|
383
383
|
|
|
384
384
|
#### `products.find(handle)`
|
|
385
385
|
|
|
@@ -397,7 +397,7 @@ const productEur = await shop.products.find("product-handle", { currency: "EUR"
|
|
|
397
397
|
- `options` (object, optional): Additional options
|
|
398
398
|
- `currency` (CurrencyCode, optional): ISO 4217 code aligned with `Intl.NumberFormatOptions['currency']`
|
|
399
399
|
|
|
400
|
-
**Returns:** `
|
|
400
|
+
**Returns:** `ProductResult | null`
|
|
401
401
|
|
|
402
402
|
#### `products.showcased()`
|
|
403
403
|
|
|
@@ -407,7 +407,7 @@ Fetches products featured on the store's homepage.
|
|
|
407
407
|
const showcasedProducts = await shop.products.showcased();
|
|
408
408
|
```
|
|
409
409
|
|
|
410
|
-
**Returns:** `
|
|
410
|
+
**Returns:** `ProductResult[]`
|
|
411
411
|
|
|
412
412
|
#### `products.infoHtml(productHandle, content?)`
|
|
413
413
|
|
|
@@ -475,7 +475,7 @@ const results = await shop.products.predictiveSearch("dress", {
|
|
|
475
475
|
- Extracts handles from Ajax results, fetches full products via `find`
|
|
476
476
|
- Falls back to non-locale path when locale returns 404/417
|
|
477
477
|
|
|
478
|
-
**Returns:** `
|
|
478
|
+
**Returns:** `ProductResult[]`
|
|
479
479
|
|
|
480
480
|
### Recommendations
|
|
481
481
|
|
|
@@ -492,31 +492,26 @@ const recos = await shop.products.recommendations(1234567890, {
|
|
|
492
492
|
});
|
|
493
493
|
```
|
|
494
494
|
|
|
495
|
-
- Returns normalized `
|
|
495
|
+
- Returns normalized `ProductResult[]`
|
|
496
496
|
- Locale-aware endpoint `/{locale}/recommendations/products.json`
|
|
497
497
|
|
|
498
|
-
###
|
|
498
|
+
### Product Columns
|
|
499
499
|
|
|
500
|
-
|
|
500
|
+
Default product payload is minimal. Use `columns` to override the product payload shape (full vs minimal):
|
|
501
501
|
|
|
502
502
|
```typescript
|
|
503
|
-
//
|
|
504
|
-
const
|
|
503
|
+
// Minimal products (default)
|
|
504
|
+
const minimal = await shop.products.all();
|
|
505
505
|
|
|
506
|
-
//
|
|
507
|
-
const
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
const minimalOne = await shop.products.minimal.find("product-handle");
|
|
511
|
-
|
|
512
|
-
// Showcased (minimal)
|
|
513
|
-
const minimalShowcased = await shop.products.showcase.minimal();
|
|
514
|
-
|
|
515
|
-
// Predictive search (minimal)
|
|
516
|
-
const minimalSearch = await shop.products.minimal.predictiveSearch("dress", { limit: 10 });
|
|
506
|
+
// Full products
|
|
507
|
+
const full = await shop.products.all({
|
|
508
|
+
columns: { mode: "full", images: "full", options: "full" },
|
|
509
|
+
});
|
|
517
510
|
|
|
518
|
-
//
|
|
519
|
-
const
|
|
511
|
+
// Minimal single product
|
|
512
|
+
const minimalOne = await shop.products.find("product-handle", {
|
|
513
|
+
columns: { mode: "minimal", images: "minimal", options: "minimal" },
|
|
514
|
+
});
|
|
520
515
|
```
|
|
521
516
|
|
|
522
517
|
### Collections
|
|
@@ -584,7 +579,7 @@ const products = await shop.collections.products.all("collection-handle");
|
|
|
584
579
|
**Parameters:**
|
|
585
580
|
- `handle` (string): The collection handle
|
|
586
581
|
|
|
587
|
-
**Returns:** `
|
|
582
|
+
**Returns:** `ProductResult[] | null`
|
|
588
583
|
|
|
589
584
|
#### `collections.products.paginated(handle, options)`
|
|
590
585
|
|
|
@@ -605,20 +600,13 @@ const products = await shop.collections.products.paginated("collection-handle",
|
|
|
605
600
|
- `limit` (number, optional): Products per page (default: 250)
|
|
606
601
|
- `currency` (CurrencyCode, optional): ISO 4217 code aligned with `Intl.NumberFormatOptions['currency']`
|
|
607
602
|
|
|
608
|
-
**Returns:** `
|
|
609
|
-
|
|
610
|
-
#### `collections.products.minimal.*`
|
|
603
|
+
**Returns:** `ProductResult[] | null`
|
|
611
604
|
|
|
612
|
-
|
|
605
|
+
Collection products also default to minimal. To request full products from collections, pass `columns`:
|
|
613
606
|
|
|
614
607
|
```typescript
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
// Paginated (minimal)
|
|
619
|
-
const minimalCollectionPage = await shop.collections.products.minimal.paginated("collection-handle", {
|
|
620
|
-
page: 1,
|
|
621
|
-
limit: 25,
|
|
608
|
+
const fullCollectionAll = await shop.collections.products.all("collection-handle", {
|
|
609
|
+
columns: { mode: "full", images: "full", options: "full" },
|
|
622
610
|
});
|
|
623
611
|
```
|
|
624
612
|
|
|
@@ -626,31 +614,25 @@ const minimalCollectionPage = await shop.collections.products.minimal.paginated(
|
|
|
626
614
|
|
|
627
615
|
By default, pricing is formatted using the store’s detected currency.
|
|
628
616
|
You can override the currency for product and collection queries by passing a `currency` option.
|
|
629
|
-
This override updates
|
|
630
|
-
- `
|
|
631
|
-
- `MinimalProduct.localizedPricing` formatted strings
|
|
617
|
+
This override updates pricing display fields only:
|
|
618
|
+
- `ProductResult.localizedPricing` formatted strings
|
|
632
619
|
|
|
633
620
|
### Showcased Products
|
|
634
621
|
|
|
635
622
|
#### `products.showcased()`
|
|
636
623
|
|
|
637
|
-
Fetches products showcased on the store’s homepage
|
|
624
|
+
Fetches products showcased on the store’s homepage (shape controlled by `columns`).
|
|
638
625
|
|
|
639
626
|
```typescript
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
**Returns:** `Product[]`
|
|
644
|
-
|
|
645
|
-
#### `products.showcase.minimal()`
|
|
627
|
+
// Minimal showcased products (default)
|
|
628
|
+
const minimalFeatured = await shop.products.showcased();
|
|
646
629
|
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
const minimalFeatured = await shop.products.showcase.minimal();
|
|
630
|
+
const featuredProducts = await shop.products.showcased({
|
|
631
|
+
columns: { mode: "full", images: "full", options: "full" },
|
|
632
|
+
});
|
|
651
633
|
```
|
|
652
634
|
|
|
653
|
-
**Returns:** `
|
|
635
|
+
**Returns:** `ProductResult[]`
|
|
654
636
|
|
|
655
637
|
```typescript
|
|
656
638
|
// Products
|
package/dist/ai/enrich.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as OpenRouterConfig,
|
|
1
|
+
import { O as OpenRouterConfig, n as ProductClassification, o as SEOContent, p as SystemUserPrompt, b as ShopifySingleProduct } from '../types-C0NvqVL-.js';
|
|
2
2
|
|
|
3
3
|
declare function buildEnrichPrompt(args: {
|
|
4
4
|
bodyInput: string;
|