shop-client 3.16.0 → 3.17.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/dist/index.mjs CHANGED
@@ -3,26 +3,26 @@ import {
3
3
  } from "./chunk-W4SF6W2P.mjs";
4
4
  import {
5
5
  createCollectionOperations
6
- } from "./chunk-QCB3U4AO.mjs";
6
+ } from "./chunk-242GBM2V.mjs";
7
7
  import {
8
8
  createProductOperations
9
- } from "./chunk-THCO3JT4.mjs";
9
+ } from "./chunk-3KRUT5BD.mjs";
10
10
  import {
11
11
  createShopOperations,
12
12
  getInfoForShop
13
- } from "./chunk-OA76XD32.mjs";
13
+ } from "./chunk-YWAW6C74.mjs";
14
14
  import {
15
15
  classifyProduct,
16
16
  determineStoreType,
17
17
  generateSEOContent
18
- } from "./chunk-ZX4IG4TY.mjs";
18
+ } from "./chunk-5TGMDRUF.mjs";
19
19
  import {
20
20
  configureRateLimit,
21
21
  rateLimitedFetch
22
- } from "./chunk-D5MTUWFO.mjs";
22
+ } from "./chunk-O77Z6OBJ.mjs";
23
23
  import {
24
24
  detectShopCountry
25
- } from "./chunk-G7OCMGA6.mjs";
25
+ } from "./chunk-SBHTEKLB.mjs";
26
26
  import {
27
27
  buildVariantOptionsMap,
28
28
  calculateDiscount,
@@ -83,51 +83,64 @@ function collectionsDto(collections) {
83
83
  // src/dto/products.mapped.ts
84
84
  function mapVariants(product) {
85
85
  var _a;
86
+ const toCents = (value) => {
87
+ if (typeof value === "number" && Number.isFinite(value)) return value;
88
+ if (typeof value === "string") {
89
+ const n = Number.parseFloat(value);
90
+ return Number.isFinite(n) ? Math.round(n * 100) : 0;
91
+ }
92
+ return 0;
93
+ };
86
94
  const variants = (_a = product.variants) != null ? _a : [];
87
95
  return variants.map((variant) => {
88
- var _a2;
96
+ var _a2, _b, _c;
97
+ const featuredImage = variant.featured_image ? {
98
+ id: variant.featured_image.id,
99
+ src: variant.featured_image.src,
100
+ width: variant.featured_image.width,
101
+ height: variant.featured_image.height,
102
+ position: variant.featured_image.position,
103
+ productId: variant.featured_image.product_id,
104
+ aspectRatio: (_a2 = variant.featured_image.aspect_ratio) != null ? _a2 : 0,
105
+ variantIds: (_b = variant.featured_image.variant_ids) != null ? _b : [],
106
+ createdAt: variant.featured_image.created_at,
107
+ updatedAt: variant.featured_image.updated_at,
108
+ alt: variant.featured_image.alt
109
+ } : null;
89
110
  return {
90
111
  id: variant.id.toString(),
91
112
  platformId: variant.id.toString(),
92
- name: variant.name,
113
+ name: "name" in variant ? variant.name : void 0,
93
114
  title: variant.title,
94
115
  option1: variant.option1 || null,
95
116
  option2: variant.option2 || null,
96
117
  option3: variant.option3 || null,
97
118
  options: [variant.option1, variant.option2, variant.option3].filter(
98
- Boolean
119
+ (v) => Boolean(v)
99
120
  ),
100
121
  sku: variant.sku || null,
101
122
  requiresShipping: variant.requires_shipping,
102
123
  taxable: variant.taxable,
103
- featuredImage: variant.featured_image ? {
104
- id: variant.featured_image.id,
105
- src: variant.featured_image.src,
106
- width: variant.featured_image.width,
107
- height: variant.featured_image.height,
108
- position: variant.featured_image.position,
109
- productId: variant.featured_image.product_id,
110
- aspectRatio: variant.featured_image.aspect_ratio || 0,
111
- variantIds: variant.featured_image.variant_ids || [],
112
- createdAt: variant.featured_image.created_at,
113
- updatedAt: variant.featured_image.updated_at,
114
- alt: variant.featured_image.alt
115
- } : null,
116
- available: Boolean(variant.available),
117
- price: typeof variant.price === "string" ? Number.parseFloat(variant.price) * 100 : variant.price,
118
- weightInGrams: (_a2 = variant.weightInGrams) != null ? _a2 : variant.grams,
119
- compareAtPrice: variant.compare_at_price ? typeof variant.compare_at_price === "string" ? Number.parseFloat(variant.compare_at_price) * 100 : variant.compare_at_price : 0,
124
+ featuredImage,
125
+ available: typeof variant.available === "boolean" ? variant.available : true,
126
+ price: toCents(variant.price),
127
+ weightInGrams: "weightInGrams" in variant ? variant.weightInGrams : (_c = variant.grams) != null ? _c : void 0,
128
+ compareAtPrice: toCents(variant.compare_at_price),
120
129
  position: variant.position,
121
130
  productId: variant.product_id,
122
131
  createdAt: variant.created_at,
123
- updatedAt: variant.updated_at
132
+ updatedAt: variant.updated_at,
133
+ compareAtPriceVaries: false,
134
+ priceVaries: false
124
135
  };
125
136
  });
126
137
  }
127
- function mapProductsDto(products, ctx) {
138
+ function mapProductsDto(products, ctx, options) {
139
+ var _a;
128
140
  if (!products || products.length === 0) return null;
129
- return products.map((product) => {
130
- var _a, _b, _c;
141
+ const isMinimal = (_a = options == null ? void 0 : options.minimal) != null ? _a : true;
142
+ const mapOne = (product) => {
143
+ var _a2, _b, _c, _d, _e;
131
144
  const optionNames = product.options.map((o) => o.name);
132
145
  const variantOptionsMap = buildVariantOptionsMap(
133
146
  optionNames,
@@ -142,11 +155,42 @@ function mapProductsDto(products, ctx) {
142
155
  const compareAtMin = compareAtValues.length ? Math.min(...compareAtValues) : 0;
143
156
  const compareAtMax = compareAtValues.length ? Math.max(...compareAtValues) : 0;
144
157
  const compareAtVaries = mappedVariants.length > 1 && compareAtMin !== compareAtMax;
145
- return {
146
- slug: genProductSlug({
147
- handle: product.handle,
148
- storeDomain: ctx.storeDomain
149
- }),
158
+ const slug = genProductSlug({
159
+ handle: product.handle,
160
+ storeDomain: ctx.storeDomain
161
+ });
162
+ const url = `${ctx.storeDomain}/products/${product.handle}`;
163
+ const discount = calculateDiscount(priceMin, compareAtMin);
164
+ if (isMinimal) {
165
+ const minimal = {
166
+ title: product.title,
167
+ bodyHtml: product.body_html || null,
168
+ price: priceMin,
169
+ compareAtPrice: compareAtMin,
170
+ discount,
171
+ images: product.images.map((img) => ({
172
+ src: ctx.normalizeImageUrl(img.src)
173
+ })),
174
+ featuredImage: ((_b = (_a2 = product.images) == null ? void 0 : _a2[0]) == null ? void 0 : _b.src) ? ctx.normalizeImageUrl(product.images[0].src) : null,
175
+ available: mappedVariants.some((v) => v.available),
176
+ localizedPricing: {
177
+ priceFormatted: ctx.formatPrice(priceMin),
178
+ compareAtPriceFormatted: ctx.formatPrice(compareAtMin)
179
+ },
180
+ options: product.options.map((option) => ({
181
+ key: normalizeKey(option.name),
182
+ name: option.name,
183
+ values: option.values
184
+ })),
185
+ variantOptionsMap,
186
+ url,
187
+ slug,
188
+ platformId: product.id.toString()
189
+ };
190
+ return minimal;
191
+ }
192
+ const full = {
193
+ slug,
150
194
  handle: product.handle,
151
195
  platformId: product.id.toString(),
152
196
  title: product.title,
@@ -159,7 +203,7 @@ function mapProductsDto(products, ctx) {
159
203
  compareAtPriceMin: compareAtMin,
160
204
  compareAtPriceMax: compareAtMax,
161
205
  compareAtPriceVaries: compareAtVaries,
162
- discount: 0,
206
+ discount,
163
207
  currency: ctx.currency,
164
208
  localizedPricing: {
165
209
  currency: ctx.currency,
@@ -181,7 +225,7 @@ function mapProductsDto(products, ctx) {
181
225
  productType: product.product_type || null,
182
226
  tags: Array.isArray(product.tags) ? product.tags : [],
183
227
  vendor: product.vendor,
184
- featuredImage: ((_b = (_a = product.images) == null ? void 0 : _a[0]) == null ? void 0 : _b.src) ? ctx.normalizeImageUrl(product.images[0].src) : null,
228
+ featuredImage: ((_d = (_c = product.images) == null ? void 0 : _c[0]) == null ? void 0 : _d.src) ? ctx.normalizeImageUrl(product.images[0].src) : null,
185
229
  isProxyFeaturedImage: false,
186
230
  createdAt: safeParseDate(product.created_at),
187
231
  updatedAt: safeParseDate(product.updated_at),
@@ -199,29 +243,65 @@ function mapProductsDto(products, ctx) {
199
243
  createdAt: image.created_at,
200
244
  updatedAt: image.updated_at
201
245
  })),
202
- publishedAt: (_c = safeParseDate(product.published_at)) != null ? _c : null,
246
+ publishedAt: (_e = safeParseDate(product.published_at)) != null ? _e : null,
203
247
  seo: null,
204
248
  metaTags: null,
205
249
  displayScore: void 0,
206
250
  deletedAt: null,
207
251
  storeSlug: ctx.storeSlug,
208
252
  storeDomain: ctx.storeDomain,
209
- url: `${ctx.storeDomain}/products/${product.handle}`
253
+ url
210
254
  };
211
- });
255
+ return full;
256
+ };
257
+ return isMinimal ? products.map(mapOne) : products.map(mapOne);
212
258
  }
213
- function mapProductDto(product, ctx) {
214
- var _a;
259
+ function mapProductDto(product, ctx, options) {
260
+ var _a, _b;
261
+ const isMinimal = (_a = options == null ? void 0 : options.minimal) != null ? _a : true;
215
262
  const optionNames = product.options.map((o) => o.name);
216
263
  const variantOptionsMap = buildVariantOptionsMap(
217
264
  optionNames,
218
265
  product.variants
219
266
  );
267
+ const slug = genProductSlug({
268
+ handle: product.handle,
269
+ storeDomain: ctx.storeDomain
270
+ });
271
+ const url = product.url || `${ctx.storeDomain}/products/${product.handle}`;
272
+ const discount = calculateDiscount(
273
+ product.price,
274
+ product.compare_at_price || 0
275
+ );
276
+ if (isMinimal) {
277
+ return {
278
+ title: product.title,
279
+ bodyHtml: product.description || null,
280
+ price: product.price,
281
+ compareAtPrice: product.compare_at_price || 0,
282
+ discount,
283
+ images: Array.isArray(product.images) ? product.images.map((imageSrc) => ({
284
+ src: ctx.normalizeImageUrl(imageSrc)
285
+ })) : [],
286
+ featuredImage: ctx.normalizeImageUrl(product.featured_image),
287
+ available: product.available,
288
+ localizedPricing: {
289
+ priceFormatted: ctx.formatPrice(product.price),
290
+ compareAtPriceFormatted: ctx.formatPrice(product.compare_at_price || 0)
291
+ },
292
+ options: product.options.map((option) => ({
293
+ key: normalizeKey(option.name),
294
+ name: option.name,
295
+ values: option.values
296
+ })),
297
+ variantOptionsMap,
298
+ url,
299
+ slug,
300
+ platformId: product.id.toString()
301
+ };
302
+ }
220
303
  const mapped = {
221
- slug: genProductSlug({
222
- handle: product.handle,
223
- storeDomain: ctx.storeDomain
224
- }),
304
+ slug,
225
305
  handle: product.handle,
226
306
  platformId: product.id.toString(),
227
307
  title: product.title,
@@ -234,7 +314,7 @@ function mapProductDto(product, ctx) {
234
314
  compareAtPriceMin: product.compare_at_price_min,
235
315
  compareAtPriceMax: product.compare_at_price_max,
236
316
  compareAtPriceVaries: product.compare_at_price_varies,
237
- discount: 0,
317
+ discount,
238
318
  currency: ctx.currency,
239
319
  localizedPricing: {
240
320
  currency: ctx.currency,
@@ -274,14 +354,14 @@ function mapProductDto(product, ctx) {
274
354
  createdAt: product.created_at,
275
355
  updatedAt: product.updated_at
276
356
  })) : [],
277
- publishedAt: (_a = safeParseDate(product.published_at)) != null ? _a : null,
357
+ publishedAt: (_b = safeParseDate(product.published_at)) != null ? _b : null,
278
358
  seo: null,
279
359
  metaTags: null,
280
360
  displayScore: void 0,
281
361
  deletedAt: null,
282
362
  storeSlug: ctx.storeSlug,
283
363
  storeDomain: ctx.storeDomain,
284
- url: product.url || `${ctx.storeDomain}/products/${product.handle}`
364
+ url
285
365
  };
286
366
  return mapped;
287
367
  }
@@ -416,25 +496,33 @@ var ShopClient = class {
416
496
  /**
417
497
  * Transform Shopify products to our Product format
418
498
  */
419
- productsDto(products) {
420
- var _a;
421
- return mapProductsDto(products, {
422
- storeDomain: this.storeDomain,
423
- storeSlug: this.storeSlug,
424
- currency: (_a = this.storeCurrency) != null ? _a : "USD",
425
- normalizeImageUrl: (url) => this.normalizeImageUrl(url),
426
- formatPrice: (amount) => this.formatPrice(amount)
427
- });
499
+ productsDto(products, options) {
500
+ var _a, _b;
501
+ return mapProductsDto(
502
+ products,
503
+ {
504
+ storeDomain: this.storeDomain,
505
+ storeSlug: this.storeSlug,
506
+ currency: (_a = this.storeCurrency) != null ? _a : "USD",
507
+ normalizeImageUrl: (url) => this.normalizeImageUrl(url),
508
+ formatPrice: (amount) => this.formatPrice(amount)
509
+ },
510
+ { minimal: (_b = options == null ? void 0 : options.minimal) != null ? _b : false }
511
+ );
428
512
  }
429
- productDto(product) {
430
- var _a;
431
- return mapProductDto(product, {
432
- storeDomain: this.storeDomain,
433
- storeSlug: this.storeSlug,
434
- currency: (_a = this.storeCurrency) != null ? _a : "USD",
435
- normalizeImageUrl: (url) => this.normalizeImageUrl(url),
436
- formatPrice: (amount) => this.formatPrice(amount)
437
- });
513
+ productDto(product, options) {
514
+ var _a, _b;
515
+ return mapProductDto(
516
+ product,
517
+ {
518
+ storeDomain: this.storeDomain,
519
+ storeSlug: this.storeSlug,
520
+ currency: (_a = this.storeCurrency) != null ? _a : "USD",
521
+ normalizeImageUrl: (url) => this.normalizeImageUrl(url),
522
+ formatPrice: (amount) => this.formatPrice(amount)
523
+ },
524
+ { minimal: (_b = options == null ? void 0 : options.minimal) != null ? _b : false }
525
+ );
438
526
  }
439
527
  collectionsDto(collections) {
440
528
  var _a;
@@ -444,14 +532,17 @@ var ShopClient = class {
444
532
  * Enhanced error handling with context
445
533
  */
446
534
  handleFetchError(error, context, url) {
535
+ const getStatus = (err) => {
536
+ if (!err || typeof err !== "object") return void 0;
537
+ const rec = err;
538
+ const status = rec.status;
539
+ return typeof status === "number" ? status : void 0;
540
+ };
447
541
  let errorMessage = `Error ${context}`;
448
542
  let statusCode;
449
543
  if (error instanceof Error) {
450
544
  errorMessage += `: ${error.message}`;
451
- const anyErr = error;
452
- if (anyErr && typeof anyErr.status === "number") {
453
- statusCode = anyErr.status;
454
- }
545
+ statusCode = getStatus(error);
455
546
  } else if (typeof error === "string") {
456
547
  errorMessage += `: ${error}`;
457
548
  } else {
@@ -461,17 +552,22 @@ var ShopClient = class {
461
552
  if (statusCode) {
462
553
  errorMessage += ` (Status: ${statusCode})`;
463
554
  }
464
- const enhancedError = new Error(errorMessage);
465
- enhancedError.context = context;
466
- enhancedError.url = url;
467
- enhancedError.statusCode = statusCode;
468
- enhancedError.originalError = error;
555
+ const enhancedError = Object.assign(
556
+ new Error(errorMessage),
557
+ {
558
+ context,
559
+ url,
560
+ statusCode,
561
+ originalError: error
562
+ }
563
+ );
469
564
  throw enhancedError;
470
565
  }
471
566
  /**
472
567
  * Fetch products with pagination
473
568
  */
474
- async fetchProducts(page, limit) {
569
+ async fetchProducts(page, limit, options) {
570
+ var _a;
475
571
  try {
476
572
  const url = `${this.baseUrl}products.json?page=${page}&limit=${limit}`;
477
573
  const response = await rateLimitedFetch(url, {
@@ -481,7 +577,9 @@ var ShopClient = class {
481
577
  throw new Error(`HTTP ${response.status}: ${response.statusText}`);
482
578
  }
483
579
  const data = await response.json();
484
- return this.productsDto(data.products);
580
+ return this.productsDto(data.products, {
581
+ minimal: (_a = options == null ? void 0 : options.minimal) != null ? _a : false
582
+ });
485
583
  } catch (error) {
486
584
  this.handleFetchError(
487
585
  error,
@@ -516,6 +614,7 @@ var ShopClient = class {
516
614
  * Fetch paginated products from a specific collection
517
615
  */
518
616
  async fetchPaginatedProductsFromCollection(collectionHandle, options = {}) {
617
+ var _a;
519
618
  try {
520
619
  const { page = 1, limit = 250 } = options;
521
620
  let finalHandle = collectionHandle;
@@ -549,7 +648,9 @@ var ShopClient = class {
549
648
  throw new Error(`HTTP ${response.status}: ${response.statusText}`);
550
649
  }
551
650
  const data = await response.json();
552
- return this.productsDto(data.products);
651
+ return this.productsDto(data.products, {
652
+ minimal: (_a = options == null ? void 0 : options.minimal) != null ? _a : false
653
+ });
553
654
  } catch (error) {
554
655
  this.handleFetchError(
555
656
  error,
@@ -1,5 +1,5 @@
1
1
  import { ShopInfo } from './store.js';
2
- import { f as CurrencyCode, P as Product, k as ProductClassification, l as SEOContent, S as ShopifyProduct, a as ShopifySingleProduct, O as OpenRouterConfig } from './types-BRXamZMS.js';
2
+ import { f as CurrencyCode, P as Product, l as ProductClassification, m as SEOContent, M as MinimalProduct, S as ShopifyProduct, a as ShopifySingleProduct, O as OpenRouterConfig } from './types-w9n4csBQ.js';
3
3
 
4
4
  /**
5
5
  * Interface for product operations
@@ -7,12 +7,14 @@ import { f as CurrencyCode, P as Product, k as ProductClassification, l as SEOCo
7
7
  interface ProductOperations {
8
8
  /**
9
9
  * Fetches all products from the store across all pages.
10
+ * Use `shop.products.minimal.all()` for MinimalProduct returns.
10
11
  */
11
12
  all(options?: {
12
13
  currency?: CurrencyCode;
13
14
  }): Promise<Product[] | null>;
14
15
  /**
15
16
  * Fetches products with pagination support.
17
+ * Use `shop.products.minimal.paginated()` for MinimalProduct returns.
16
18
  */
17
19
  paginated(options?: {
18
20
  page?: number;
@@ -21,6 +23,7 @@ interface ProductOperations {
21
23
  }): Promise<Product[] | null>;
22
24
  /**
23
25
  * Finds a specific product by its handle.
26
+ * Use `shop.products.minimal.find()` for MinimalProduct returns.
24
27
  */
25
28
  find(productHandle: string, options?: {
26
29
  currency?: CurrencyCode;
@@ -76,12 +79,22 @@ interface ProductOperations {
76
79
  * Fetches products that are showcased/featured on the store's homepage.
77
80
  */
78
81
  showcased(): Promise<Product[]>;
82
+ /**
83
+ * Showcase namespace for convenience methods related to featured items.
84
+ */
85
+ showcase: {
86
+ /**
87
+ * Returns showcased products in MinimalProduct form.
88
+ */
89
+ minimal(): Promise<MinimalProduct[]>;
90
+ };
79
91
  /**
80
92
  * Creates a filter map of variant options and their distinct values from all products.
81
93
  */
82
94
  filter(): Promise<Record<string, string[]> | null>;
83
95
  /**
84
96
  * Predictive product search using Shopify Ajax API.
97
+ * Use `shop.products.minimal.predictiveSearch()` for MinimalProduct returns.
85
98
  */
86
99
  predictiveSearch(query: string, options?: {
87
100
  limit?: number;
@@ -91,6 +104,7 @@ interface ProductOperations {
91
104
  }): Promise<Product[]>;
92
105
  /**
93
106
  * Product recommendations for a given product ID using Shopify Ajax API.
107
+ * Use `shop.products.minimal.recommendations()` for MinimalProduct returns.
94
108
  */
95
109
  recommendations(productId: number, options?: {
96
110
  limit?: number;
@@ -98,11 +112,48 @@ interface ProductOperations {
98
112
  locale?: string;
99
113
  currency?: CurrencyCode;
100
114
  }): Promise<Product[] | null>;
115
+ /**
116
+ * Minimal namespace for convenience methods that always return MinimalProduct types.
117
+ */
118
+ minimal: {
119
+ all(options?: {
120
+ currency?: CurrencyCode;
121
+ }): Promise<MinimalProduct[] | null>;
122
+ paginated(options?: {
123
+ page?: number;
124
+ limit?: number;
125
+ currency?: CurrencyCode;
126
+ }): Promise<MinimalProduct[] | null>;
127
+ find(productHandle: string, options?: {
128
+ currency?: CurrencyCode;
129
+ }): Promise<MinimalProduct | null>;
130
+ showcased(): Promise<MinimalProduct[]>;
131
+ predictiveSearch(query: string, options?: {
132
+ limit?: number;
133
+ locale?: string;
134
+ currency?: CurrencyCode;
135
+ unavailableProducts?: "show" | "hide" | "last";
136
+ }): Promise<MinimalProduct[]>;
137
+ recommendations(productId: number, options?: {
138
+ limit?: number;
139
+ intent?: "related" | "complementary";
140
+ locale?: string;
141
+ currency?: CurrencyCode;
142
+ }): Promise<MinimalProduct[] | null>;
143
+ };
101
144
  }
102
145
  /**
103
146
  * Creates product operations for a store instance
104
147
  */
105
- declare function createProductOperations(baseUrl: string, storeDomain: string, fetchProducts: (page: number, limit: number) => Promise<Product[] | null>, productsDto: (products: ShopifyProduct[]) => Product[] | null, productDto: (product: ShopifySingleProduct) => Product, getStoreInfo: () => Promise<ShopInfo>, findProduct: (handle: string) => Promise<Product | null>, ai?: {
148
+ declare function createProductOperations(baseUrl: string, storeDomain: string, fetchProducts: (page: number, limit: number, options?: {
149
+ minimal?: boolean;
150
+ }) => Promise<Product[] | MinimalProduct[] | null>, productsDto: (products: ShopifyProduct[], options?: {
151
+ minimal?: boolean;
152
+ }) => Product[] | MinimalProduct[] | null, productDto: (product: ShopifySingleProduct, options?: {
153
+ minimal?: boolean;
154
+ }) => Product | MinimalProduct, getStoreInfo: () => Promise<ShopInfo>, _findProduct: (handle: string, options?: {
155
+ minimal?: boolean;
156
+ }) => Promise<Product | MinimalProduct | null>, ai?: {
106
157
  openRouter?: OpenRouterConfig;
107
158
  }): ProductOperations;
108
159
 
package/dist/products.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createProductOperations
3
- } from "./chunk-THCO3JT4.mjs";
4
- import "./chunk-D5MTUWFO.mjs";
3
+ } from "./chunk-3KRUT5BD.mjs";
4
+ import "./chunk-O77Z6OBJ.mjs";
5
5
  import "./chunk-U3RQRBXZ.mjs";
6
6
  export {
7
7
  createProductOperations
package/dist/store.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { J as JsonLdEntry, d as CountryDetectionResult, f as CurrencyCode } from './types-BRXamZMS.js';
1
+ import { J as JsonLdEntry, d as CountryDetectionResult, f as CurrencyCode } from './types-w9n4csBQ.js';
2
2
 
3
3
  /**
4
4
  * Store operations interface for managing store-related functionality.
package/dist/store.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createShopOperations
3
- } from "./chunk-OA76XD32.mjs";
4
- import "./chunk-D5MTUWFO.mjs";
5
- import "./chunk-G7OCMGA6.mjs";
3
+ } from "./chunk-YWAW6C74.mjs";
4
+ import "./chunk-O77Z6OBJ.mjs";
5
+ import "./chunk-SBHTEKLB.mjs";
6
6
  import "./chunk-U3RQRBXZ.mjs";
7
7
  export {
8
8
  createShopOperations
@@ -116,6 +116,7 @@ type ShopifyProductVariant = ShopifyBaseVariant & {
116
116
  } | null;
117
117
  available: boolean;
118
118
  price: string | number;
119
+ grams?: number | undefined;
119
120
  weightInGrams?: number | undefined;
120
121
  compare_at_price?: string | number | undefined;
121
122
  };
@@ -321,6 +322,31 @@ type Product = {
321
322
  variantOptionsMap: Record<string, string>;
322
323
  enriched_content?: string;
323
324
  };
325
+ /**
326
+ * Minimal product structure with reduced data.
327
+ */
328
+ type MinimalProduct = {
329
+ title: string;
330
+ bodyHtml: string | null;
331
+ price: number;
332
+ compareAtPrice: number;
333
+ discount: number;
334
+ images: {
335
+ src: string;
336
+ }[];
337
+ featuredImage: string | null;
338
+ available: boolean;
339
+ localizedPricing: Pick<LocalizedPricing, "priceFormatted" | "compareAtPriceFormatted">;
340
+ options: {
341
+ key: string;
342
+ name: string;
343
+ values: string[];
344
+ }[];
345
+ variantOptionsMap: Record<string, string>;
346
+ url: string;
347
+ slug: string;
348
+ platformId: string;
349
+ };
324
350
  /**
325
351
  * Shopify collection structure from API responses.
326
352
  */
@@ -411,4 +437,4 @@ type SEOContent = {
411
437
  };
412
438
  type StoreTypeBreakdown = Partial<Record<"adult_male" | "adult_female" | "kid_male" | "kid_female" | "generic", Partial<Record<"clothing" | "beauty" | "accessories" | "home-decor" | "food-and-beverages", string[]>>>>;
413
439
 
414
- export type { Collection as C, JsonLdEntry as J, LocalizedPricing as L, MetaTag as M, OpenRouterConfig as O, Product as P, ShopifyProduct as S, ShopifySingleProduct as a, ShopifyCollection as b, StoreTypeBreakdown as c, CountryDetectionResult as d, CountryScores as e, CurrencyCode as f, ProductImage as g, ProductOption as h, ProductVariant as i, ProductVariantImage as j, ProductClassification as k, SEOContent as l, SystemUserPrompt as m };
440
+ export type { Collection as C, JsonLdEntry as J, LocalizedPricing as L, MinimalProduct as M, OpenRouterConfig as O, Product as P, ShopifyProduct as S, ShopifySingleProduct as a, ShopifyCollection as b, StoreTypeBreakdown as c, CountryDetectionResult as d, CountryScores as e, CurrencyCode as f, MetaTag as g, ProductImage as h, ProductOption as i, ProductVariant as j, ProductVariantImage as k, ProductClassification as l, SEOContent as m, SystemUserPrompt as n };
@@ -1,4 +1,4 @@
1
- import { d as CountryDetectionResult } from '../types-BRXamZMS.js';
1
+ import { d as CountryDetectionResult } from '../types-w9n4csBQ.js';
2
2
 
3
3
  /**
4
4
  * Detects the country of a Shopify store by analyzing various signals in the HTML content.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  detectShopCountry
3
- } from "../chunk-G7OCMGA6.mjs";
3
+ } from "../chunk-SBHTEKLB.mjs";
4
4
  export {
5
5
  detectShopCountry
6
6
  };
@@ -1,4 +1,4 @@
1
- import { f as CurrencyCode } from '../types-BRXamZMS.js';
1
+ import { f as CurrencyCode } from '../types-w9n4csBQ.js';
2
2
 
3
3
  declare function extractDomainWithoutSuffix(domain: string): string | null;
4
4
  declare function generateStoreSlug(domain: string): string;
@@ -2,7 +2,7 @@ import {
2
2
  configureRateLimit,
3
3
  getRateLimitStatus,
4
4
  rateLimitedFetch
5
- } from "../chunk-D5MTUWFO.mjs";
5
+ } from "../chunk-O77Z6OBJ.mjs";
6
6
  export {
7
7
  configureRateLimit,
8
8
  getRateLimitStatus,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shop-client",
3
- "version": "3.16.0",
3
+ "version": "3.17.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.mjs",
6
6
  "module": "./dist/index.mjs",