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 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:** `Product[] | null`
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:** `Product[] | null`
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:** `Product | null`
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:** `Product[]`
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:** `Product[]`
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 `Product[]`
495
+ - Returns normalized `ProductResult[]`
496
496
  - Locale-aware endpoint `/{locale}/recommendations/products.json`
497
497
 
498
- ### Minimal Products
498
+ ### Product Columns
499
499
 
500
- Convenience methods for minimal product returns:
500
+ Default product payload is minimal. Use `columns` to override the product payload shape (full vs minimal):
501
501
 
502
502
  ```typescript
503
- // All products (minimal)
504
- const minimalAll = await shop.products.minimal.all();
503
+ // Minimal products (default)
504
+ const minimal = await shop.products.all();
505
505
 
506
- // Paginated (minimal)
507
- const minimalPage = await shop.products.minimal.paginated({ page: 1, limit: 25 });
508
-
509
- // Find one (minimal)
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
- // Recommendations (minimal)
519
- const minimalRecos = await shop.products.minimal.recommendations(1234567890, { limit: 6 });
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:** `Product[] | null`
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:** `Product[] | null`
609
-
610
- #### `collections.products.minimal.*`
603
+ **Returns:** `ProductResult[] | null`
611
604
 
612
- Convenience methods for minimal product returns from collections:
605
+ Collection products also default to minimal. To request full products from collections, pass `columns`:
613
606
 
614
607
  ```typescript
615
- // All products (minimal)
616
- const minimalCollectionAll = await shop.collections.products.minimal.all("collection-handle");
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 product pricing display fields only:
630
- - `Product.localizedPricing` formatted strings
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 as full products.
624
+ Fetches products showcased on the store’s homepage (shape controlled by `columns`).
638
625
 
639
626
  ```typescript
640
- const featuredProducts = await shop.products.showcased();
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
- Fetches showcased products as minimal product items.
648
-
649
- ```typescript
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:** `MinimalProduct[]`
635
+ **Returns:** `ProductResult[]`
654
636
 
655
637
  ```typescript
656
638
  // Products
@@ -1,4 +1,4 @@
1
- import { O as OpenRouterConfig, l as ProductClassification, m as SEOContent, n as SystemUserPrompt, a as ShopifySingleProduct } from '../types-QekjTHzI.js';
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;