@shopify/hydrogen-react 2024.10.0 → 2025.1.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.
Files changed (180) hide show
  1. package/customer-account.schema.json +1 -1
  2. package/dist/browser-dev/AddToCartButton.mjs.map +1 -1
  3. package/dist/browser-dev/BuyNowButton.mjs.map +1 -1
  4. package/dist/browser-dev/CartCost.mjs.map +1 -1
  5. package/dist/browser-dev/CartLineProvider.mjs.map +1 -1
  6. package/dist/browser-dev/CartProvider.mjs.map +1 -1
  7. package/dist/browser-dev/ExternalVideo.mjs.map +1 -1
  8. package/dist/browser-dev/Image.mjs.map +1 -1
  9. package/dist/browser-dev/ModelViewer.mjs.map +1 -1
  10. package/dist/browser-dev/Money.mjs.map +1 -1
  11. package/dist/browser-dev/ProductPrice.mjs.map +1 -1
  12. package/dist/browser-dev/RichText.mjs.map +1 -1
  13. package/dist/browser-dev/Video.mjs.map +1 -1
  14. package/dist/browser-dev/codegen.helpers.mjs.map +1 -1
  15. package/dist/browser-dev/getProductOptions.mjs +241 -0
  16. package/dist/browser-dev/getProductOptions.mjs.map +1 -0
  17. package/dist/browser-dev/index.mjs +6 -0
  18. package/dist/browser-dev/index.mjs.map +1 -1
  19. package/dist/browser-dev/optionValueDecoder.mjs +10 -8
  20. package/dist/browser-dev/optionValueDecoder.mjs.map +1 -1
  21. package/dist/browser-dev/packages/hydrogen-react/package.json.mjs +1 -1
  22. package/dist/browser-dev/storefront-api-constants.mjs +1 -1
  23. package/dist/browser-dev/storefront-api-constants.mjs.map +1 -1
  24. package/dist/browser-dev/useCartAPIStateMachine.mjs.map +1 -1
  25. package/dist/browser-dev/useCartActions.mjs.map +1 -1
  26. package/dist/browser-dev/useSelectedOptionInUrlParam.mjs +30 -0
  27. package/dist/browser-dev/useSelectedOptionInUrlParam.mjs.map +1 -0
  28. package/dist/browser-prod/AddToCartButton.mjs.map +1 -1
  29. package/dist/browser-prod/BuyNowButton.mjs.map +1 -1
  30. package/dist/browser-prod/CartCost.mjs.map +1 -1
  31. package/dist/browser-prod/CartLineProvider.mjs.map +1 -1
  32. package/dist/browser-prod/CartProvider.mjs.map +1 -1
  33. package/dist/browser-prod/ExternalVideo.mjs.map +1 -1
  34. package/dist/browser-prod/Image.mjs.map +1 -1
  35. package/dist/browser-prod/ModelViewer.mjs.map +1 -1
  36. package/dist/browser-prod/Money.mjs.map +1 -1
  37. package/dist/browser-prod/ProductPrice.mjs.map +1 -1
  38. package/dist/browser-prod/RichText.mjs.map +1 -1
  39. package/dist/browser-prod/Video.mjs.map +1 -1
  40. package/dist/browser-prod/codegen.helpers.mjs.map +1 -1
  41. package/dist/browser-prod/getProductOptions.mjs +241 -0
  42. package/dist/browser-prod/getProductOptions.mjs.map +1 -0
  43. package/dist/browser-prod/index.mjs +6 -0
  44. package/dist/browser-prod/index.mjs.map +1 -1
  45. package/dist/browser-prod/optionValueDecoder.mjs +10 -8
  46. package/dist/browser-prod/optionValueDecoder.mjs.map +1 -1
  47. package/dist/browser-prod/packages/hydrogen-react/package.json.mjs +1 -1
  48. package/dist/browser-prod/storefront-api-constants.mjs +1 -1
  49. package/dist/browser-prod/storefront-api-constants.mjs.map +1 -1
  50. package/dist/browser-prod/useCartAPIStateMachine.mjs.map +1 -1
  51. package/dist/browser-prod/useCartActions.mjs.map +1 -1
  52. package/dist/browser-prod/useSelectedOptionInUrlParam.mjs +30 -0
  53. package/dist/browser-prod/useSelectedOptionInUrlParam.mjs.map +1 -0
  54. package/dist/node-dev/AddToCartButton.js.map +1 -1
  55. package/dist/node-dev/AddToCartButton.mjs.map +1 -1
  56. package/dist/node-dev/BuyNowButton.js.map +1 -1
  57. package/dist/node-dev/BuyNowButton.mjs.map +1 -1
  58. package/dist/node-dev/CartCost.js.map +1 -1
  59. package/dist/node-dev/CartCost.mjs.map +1 -1
  60. package/dist/node-dev/CartLineProvider.js.map +1 -1
  61. package/dist/node-dev/CartLineProvider.mjs.map +1 -1
  62. package/dist/node-dev/CartProvider.js.map +1 -1
  63. package/dist/node-dev/CartProvider.mjs.map +1 -1
  64. package/dist/node-dev/ExternalVideo.js.map +1 -1
  65. package/dist/node-dev/ExternalVideo.mjs.map +1 -1
  66. package/dist/node-dev/Image.js.map +1 -1
  67. package/dist/node-dev/Image.mjs.map +1 -1
  68. package/dist/node-dev/ModelViewer.js.map +1 -1
  69. package/dist/node-dev/ModelViewer.mjs.map +1 -1
  70. package/dist/node-dev/Money.js.map +1 -1
  71. package/dist/node-dev/Money.mjs.map +1 -1
  72. package/dist/node-dev/ProductPrice.js.map +1 -1
  73. package/dist/node-dev/ProductPrice.mjs.map +1 -1
  74. package/dist/node-dev/RichText.js.map +1 -1
  75. package/dist/node-dev/RichText.mjs.map +1 -1
  76. package/dist/node-dev/Video.js.map +1 -1
  77. package/dist/node-dev/Video.mjs.map +1 -1
  78. package/dist/node-dev/codegen.helpers.js.map +1 -1
  79. package/dist/node-dev/codegen.helpers.mjs.map +1 -1
  80. package/dist/node-dev/getProductOptions.js +241 -0
  81. package/dist/node-dev/getProductOptions.js.map +1 -0
  82. package/dist/node-dev/getProductOptions.mjs +241 -0
  83. package/dist/node-dev/getProductOptions.mjs.map +1 -0
  84. package/dist/node-dev/index.js +6 -0
  85. package/dist/node-dev/index.js.map +1 -1
  86. package/dist/node-dev/index.mjs +6 -0
  87. package/dist/node-dev/index.mjs.map +1 -1
  88. package/dist/node-dev/optionValueDecoder.js +10 -8
  89. package/dist/node-dev/optionValueDecoder.js.map +1 -1
  90. package/dist/node-dev/optionValueDecoder.mjs +10 -8
  91. package/dist/node-dev/optionValueDecoder.mjs.map +1 -1
  92. package/dist/node-dev/packages/hydrogen-react/package.json.js +1 -1
  93. package/dist/node-dev/packages/hydrogen-react/package.json.mjs +1 -1
  94. package/dist/node-dev/storefront-api-constants.js +1 -1
  95. package/dist/node-dev/storefront-api-constants.js.map +1 -1
  96. package/dist/node-dev/storefront-api-constants.mjs +1 -1
  97. package/dist/node-dev/storefront-api-constants.mjs.map +1 -1
  98. package/dist/node-dev/useCartAPIStateMachine.js.map +1 -1
  99. package/dist/node-dev/useCartAPIStateMachine.mjs.map +1 -1
  100. package/dist/node-dev/useCartActions.js.map +1 -1
  101. package/dist/node-dev/useCartActions.mjs.map +1 -1
  102. package/dist/node-dev/useSelectedOptionInUrlParam.js +30 -0
  103. package/dist/node-dev/useSelectedOptionInUrlParam.js.map +1 -0
  104. package/dist/node-dev/useSelectedOptionInUrlParam.mjs +30 -0
  105. package/dist/node-dev/useSelectedOptionInUrlParam.mjs.map +1 -0
  106. package/dist/node-prod/AddToCartButton.js.map +1 -1
  107. package/dist/node-prod/AddToCartButton.mjs.map +1 -1
  108. package/dist/node-prod/BuyNowButton.js.map +1 -1
  109. package/dist/node-prod/BuyNowButton.mjs.map +1 -1
  110. package/dist/node-prod/CartCost.js.map +1 -1
  111. package/dist/node-prod/CartCost.mjs.map +1 -1
  112. package/dist/node-prod/CartLineProvider.js.map +1 -1
  113. package/dist/node-prod/CartLineProvider.mjs.map +1 -1
  114. package/dist/node-prod/CartProvider.js.map +1 -1
  115. package/dist/node-prod/CartProvider.mjs.map +1 -1
  116. package/dist/node-prod/ExternalVideo.js.map +1 -1
  117. package/dist/node-prod/ExternalVideo.mjs.map +1 -1
  118. package/dist/node-prod/Image.js.map +1 -1
  119. package/dist/node-prod/Image.mjs.map +1 -1
  120. package/dist/node-prod/ModelViewer.js.map +1 -1
  121. package/dist/node-prod/ModelViewer.mjs.map +1 -1
  122. package/dist/node-prod/Money.js.map +1 -1
  123. package/dist/node-prod/Money.mjs.map +1 -1
  124. package/dist/node-prod/ProductPrice.js.map +1 -1
  125. package/dist/node-prod/ProductPrice.mjs.map +1 -1
  126. package/dist/node-prod/RichText.js.map +1 -1
  127. package/dist/node-prod/RichText.mjs.map +1 -1
  128. package/dist/node-prod/Video.js.map +1 -1
  129. package/dist/node-prod/Video.mjs.map +1 -1
  130. package/dist/node-prod/codegen.helpers.js.map +1 -1
  131. package/dist/node-prod/codegen.helpers.mjs.map +1 -1
  132. package/dist/node-prod/getProductOptions.js +241 -0
  133. package/dist/node-prod/getProductOptions.js.map +1 -0
  134. package/dist/node-prod/getProductOptions.mjs +241 -0
  135. package/dist/node-prod/getProductOptions.mjs.map +1 -0
  136. package/dist/node-prod/index.js +6 -0
  137. package/dist/node-prod/index.js.map +1 -1
  138. package/dist/node-prod/index.mjs +6 -0
  139. package/dist/node-prod/index.mjs.map +1 -1
  140. package/dist/node-prod/optionValueDecoder.js +10 -8
  141. package/dist/node-prod/optionValueDecoder.js.map +1 -1
  142. package/dist/node-prod/optionValueDecoder.mjs +10 -8
  143. package/dist/node-prod/optionValueDecoder.mjs.map +1 -1
  144. package/dist/node-prod/packages/hydrogen-react/package.json.js +1 -1
  145. package/dist/node-prod/packages/hydrogen-react/package.json.mjs +1 -1
  146. package/dist/node-prod/storefront-api-constants.js +1 -1
  147. package/dist/node-prod/storefront-api-constants.js.map +1 -1
  148. package/dist/node-prod/storefront-api-constants.mjs +1 -1
  149. package/dist/node-prod/storefront-api-constants.mjs.map +1 -1
  150. package/dist/node-prod/useCartAPIStateMachine.js.map +1 -1
  151. package/dist/node-prod/useCartAPIStateMachine.mjs.map +1 -1
  152. package/dist/node-prod/useCartActions.js.map +1 -1
  153. package/dist/node-prod/useCartActions.mjs.map +1 -1
  154. package/dist/node-prod/useSelectedOptionInUrlParam.js +30 -0
  155. package/dist/node-prod/useSelectedOptionInUrlParam.js.map +1 -0
  156. package/dist/node-prod/useSelectedOptionInUrlParam.mjs +30 -0
  157. package/dist/node-prod/useSelectedOptionInUrlParam.mjs.map +1 -0
  158. package/dist/types/CartLineProvider.d.ts +1 -1
  159. package/dist/types/CartProvider.d.ts +6 -5
  160. package/dist/types/Image.d.ts +1 -1
  161. package/dist/types/ModelViewer.d.ts +1 -1
  162. package/dist/types/Money.d.ts +1 -1
  163. package/dist/types/Video.d.ts +1 -1
  164. package/dist/types/codegen.helpers.d.ts +2 -2
  165. package/dist/types/getProductOptions.d.ts +49 -0
  166. package/dist/types/index.d.cts +2 -0
  167. package/dist/types/index.d.ts +2 -0
  168. package/dist/types/optionValueDecoder.d.ts +2 -2
  169. package/dist/types/storefront-api-constants.d.ts +1 -1
  170. package/dist/types/storefront-api-response.types.d.ts +5 -5
  171. package/dist/types/storefront-api-types.d.ts +641 -127
  172. package/dist/types/useCartAPIStateMachine.d.ts +2 -2
  173. package/dist/types/useCartActions.d.ts +2 -2
  174. package/dist/types/useSelectedOptionInUrlParam.d.ts +2 -0
  175. package/dist/umd/hydrogen-react.dev.js +351 -88
  176. package/dist/umd/hydrogen-react.dev.js.map +1 -1
  177. package/dist/umd/hydrogen-react.prod.js +18 -18
  178. package/dist/umd/hydrogen-react.prod.js.map +1 -1
  179. package/package.json +3 -3
  180. package/storefront.schema.json +1 -1
@@ -43,17 +43,17 @@ type CartProviderProps = {
43
43
  onAttributesUpdateComplete?: () => void;
44
44
  /** A callback that is invoked when the process to update the cart discount codes completes */
45
45
  onDiscountCodesUpdateComplete?: () => void;
46
- /** An object with fields that correspond to the Storefront API's [Cart object](https://shopify.dev/api/storefront/2024-10/objects/cart). */
46
+ /** An object with fields that correspond to the Storefront API's [Cart object](https://shopify.dev/api/storefront/2025-01/objects/cart). */
47
47
  data?: PartialDeep<CartType, {
48
48
  recurseIntoArrays: true;
49
49
  }>;
50
- /** A fragment used to query the Storefront API's [Cart object](https://shopify.dev/api/storefront/2024-10/objects/cart) for all queries and mutations. A default value is used if no argument is provided. */
50
+ /** A fragment used to query the Storefront API's [Cart object](https://shopify.dev/api/storefront/2025-01/objects/cart) for all queries and mutations. A default value is used if no argument is provided. */
51
51
  cartFragment?: string;
52
52
  /** A customer access token that's accessible on the server if there's a customer login. */
53
53
  customerAccessToken?: CartBuyerIdentityInput['customerAccessToken'];
54
54
  /** The ISO country code for i18n. */
55
55
  countryCode?: CountryCode;
56
- /** The ISO luanguage code for i18n. */
56
+ /** The ISO language code for i18n. */
57
57
  languageCode?: LanguageCode;
58
58
  };
59
59
  /**
@@ -67,8 +67,9 @@ type CartProviderProps = {
67
67
  * The `CartProvider` component must be a descendant of the `ShopifyProvider` component.
68
68
  */
69
69
  export declare function CartProvider({ children, numCartLines, onCreate, onLineAdd, onLineRemove, onLineUpdate, onNoteUpdate, onBuyerIdentityUpdate, onAttributesUpdate, onDiscountCodesUpdate, onCreateComplete, onLineAddComplete, onLineRemoveComplete, onLineUpdateComplete, onNoteUpdateComplete, onBuyerIdentityUpdateComplete, onAttributesUpdateComplete, onDiscountCodesUpdateComplete, data: cart, cartFragment, customerAccessToken, countryCode, languageCode, }: CartProviderProps): JSX.Element;
70
- /** Check for storage availability funciton obtained from
71
- * https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API
70
+ /**
71
+ * Check for storage availability function obtained from
72
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API
72
73
  */
73
74
  export declare function storageAvailable(type: 'localStorage' | 'sessionStorage'): boolean;
74
75
  export {};
@@ -42,7 +42,7 @@ type HydrogenImageBaseProps = {
42
42
  * @defaultValue `center`
43
43
  */
44
44
  crop?: Crop;
45
- /** Data mapping to the [Storefront API `Image`](https://shopify.dev/docs/api/storefront/2024-10/objects/Image) object. Must be an Image object.
45
+ /** Data mapping to the [Storefront API `Image`](https://shopify.dev/docs/api/storefront/2025-01/objects/Image) object. Must be an Image object.
46
46
  *
47
47
  * @example
48
48
  * ```
@@ -14,7 +14,7 @@ type ModelViewerProps = Omit<PartialDeep<JSX.IntrinsicElements['model-viewer'],
14
14
  recurseIntoArrays: true;
15
15
  }>, 'src'> & ModelViewerBaseProps;
16
16
  type ModelViewerBaseProps = {
17
- /** An object with fields that correspond to the Storefront API's [Model3D object](https://shopify.dev/api/storefront/2024-10/objects/model3d). */
17
+ /** An object with fields that correspond to the Storefront API's [Model3D object](https://shopify.dev/api/storefront/2025-01/objects/model3d). */
18
18
  data: PartialDeep<Model3d, {
19
19
  recurseIntoArrays: true;
20
20
  }>;
@@ -12,7 +12,7 @@ export interface MoneyPropsBase<ComponentGeneric extends React.ElementType> {
12
12
  withoutCurrency?: boolean;
13
13
  /** Whether to remove trailing zeros (fractional money) from the output. */
14
14
  withoutTrailingZeros?: boolean;
15
- /** A [UnitPriceMeasurement object](https://shopify.dev/api/storefront/2024-10/objects/unitpricemeasurement). */
15
+ /** A [UnitPriceMeasurement object](https://shopify.dev/api/storefront/2025-01/objects/unitpricemeasurement). */
16
16
  measurement?: PartialDeep<UnitPriceMeasurement, {
17
17
  recurseIntoArrays: true;
18
18
  }>;
@@ -3,7 +3,7 @@ import { shopifyLoader } from './Image.js';
3
3
  import type { Video as VideoType } from './storefront-api-types.js';
4
4
  import type { PartialDeep } from 'type-fest';
5
5
  export interface VideoProps {
6
- /** An object with fields that correspond to the Storefront API's [Video object](https://shopify.dev/api/storefront/2024-10/objects/video). */
6
+ /** An object with fields that correspond to the Storefront API's [Video object](https://shopify.dev/api/storefront/2025-01/objects/video). */
7
7
  data: PartialDeep<VideoType, {
8
8
  recurseIntoArrays: true;
9
9
  }>;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Meant to be used with GraphQL CodeGen to type the Storefront API's custom scalars correctly.
3
- * Reference for the GraphQL types: https://shopify.dev/docs/api/storefront/2024-10/scalars/HTML
3
+ * Reference for the GraphQL types: https://shopify.dev/docs/api/storefront/2025-01/scalars/HTML
4
4
  * Note: JSON is generated as 'unknown' by default.
5
5
  */
6
6
  export declare const storefrontApiCustomScalars: {
@@ -13,7 +13,7 @@ export declare const storefrontApiCustomScalars: {
13
13
  };
14
14
  /**
15
15
  * Meant to be used with GraphQL CodeGen to type the Storefront API's custom scalars correctly.
16
- * Reference for the GraphQL types: https://shopify.dev/docs/api/customer/2024-10/scalars/HTML
16
+ * Reference for the GraphQL types: https://shopify.dev/docs/api/customer/2025-01/scalars/HTML
17
17
  * Note: JSON is generated as 'unknown' by default.
18
18
  */
19
19
  export declare const customerAccountApiCustomScalars: {
@@ -0,0 +1,49 @@
1
+ import type { Product, ProductOption, ProductOptionValue, ProductVariant, SelectedOption } from './storefront-api-types';
2
+ export type RecursivePartial<T> = {
3
+ [P in keyof T]?: RecursivePartial<T[P]>;
4
+ };
5
+ type ProductOptionValueState = {
6
+ variant: ProductVariant;
7
+ handle: string;
8
+ variantUriQuery: string;
9
+ selected: boolean;
10
+ exists: boolean;
11
+ available: boolean;
12
+ isDifferentProduct: boolean;
13
+ };
14
+ type MappedProductOptionValue = ProductOptionValue & ProductOptionValueState;
15
+ /**
16
+ * Converts the product option into an Object\<key, value\> for building query params
17
+ * For example, a selected product option of
18
+ * [
19
+ * \{
20
+ * name: 'Color',
21
+ * value: 'Red',
22
+ * \},
23
+ * \{
24
+ * name: 'Size',
25
+ * value: 'Medium',
26
+ * \}
27
+ * ]
28
+ * Would return
29
+ * \{
30
+ * Color: 'Red',
31
+ * Size: 'Medium',
32
+ * \}
33
+ */
34
+ export declare function mapSelectedProductOptionToObject(options: Pick<SelectedOption, 'name' | 'value'>[]): Record<string, string>;
35
+ export type MappedProductOptions = Omit<ProductOption, 'optionValues'> & {
36
+ optionValues: MappedProductOptionValue[];
37
+ };
38
+ export declare function checkProductParam(product: RecursivePartial<Product>, checkAll?: boolean): Product;
39
+ /**
40
+ * Finds all the variants provided by adjacentVariants, options.optionValues.firstAvailableVariant,
41
+ * and selectedOrFirstAvailableVariant and return them in a single array
42
+ */
43
+ export declare function getAdjacentAndFirstAvailableVariants(product: RecursivePartial<Product>): ProductVariant[];
44
+ /**
45
+ * Returns a product options array with its relevant information
46
+ * about the variant
47
+ */
48
+ export declare function getProductOptions(product: RecursivePartial<Product>): MappedProductOptions[];
49
+ export {};
@@ -16,6 +16,7 @@ export { customerAccountApiCustomScalars, storefrontApiCustomScalars, } from './
16
16
  export { getShopifyCookies } from './cookies-utils.js';
17
17
  export { ExternalVideo } from './ExternalVideo.js';
18
18
  export { flattenConnection } from './flatten-connection.js';
19
+ export { getAdjacentAndFirstAvailableVariants, getProductOptions, type MappedProductOptions, mapSelectedProductOptionToObject, } from './getProductOptions.js';
19
20
  export { Image, IMAGE_FRAGMENT } from './Image.js';
20
21
  export { useLoadScript } from './load-script.js';
21
22
  export { MediaFile } from './MediaFile.js';
@@ -32,5 +33,6 @@ export type { StorefrontApiResponse, StorefrontApiResponseError, StorefrontApiRe
32
33
  export type { StorefrontClientProps } from './storefront-client.js';
33
34
  export { createStorefrontClient } from './storefront-client.js';
34
35
  export { useMoney } from './useMoney.js';
36
+ export { useSelectedOptionInUrlParam } from './useSelectedOptionInUrlParam.js';
35
37
  export { useShopifyCookies } from './useShopifyCookies.js';
36
38
  export { Video } from './Video.js';
@@ -16,6 +16,7 @@ export { customerAccountApiCustomScalars, storefrontApiCustomScalars, } from './
16
16
  export { getShopifyCookies } from './cookies-utils.js';
17
17
  export { ExternalVideo } from './ExternalVideo.js';
18
18
  export { flattenConnection } from './flatten-connection.js';
19
+ export { getAdjacentAndFirstAvailableVariants, getProductOptions, type MappedProductOptions, mapSelectedProductOptionToObject, } from './getProductOptions.js';
19
20
  export { Image, IMAGE_FRAGMENT } from './Image.js';
20
21
  export { useLoadScript } from './load-script.js';
21
22
  export { MediaFile } from './MediaFile.js';
@@ -32,5 +33,6 @@ export type { StorefrontApiResponse, StorefrontApiResponseError, StorefrontApiRe
32
33
  export type { StorefrontClientProps } from './storefront-client.js';
33
34
  export { createStorefrontClient } from './storefront-client.js';
34
35
  export { useMoney } from './useMoney.js';
36
+ export { useSelectedOptionInUrlParam } from './useSelectedOptionInUrlParam.js';
35
37
  export { useShopifyCookies } from './useShopifyCookies.js';
36
38
  export { Video } from './Video.js';
@@ -14,7 +14,7 @@ export type IsOptionValueCombinationInEncodedVariant = (targetOptionValueCombina
14
14
  * Determine whether an option value combination is present in an encoded option value string. Function is memoized by encodedVariantField.
15
15
  *
16
16
  * @param targetOptionValueCombination - Indices of option values to look up in the encoded option value string. A partial set of indices may be passed to determine whether a node or any children is present. For example, if a product has 3 options, passing [0] will return true if any option value combination for the first option's option value is present in the encoded string.
17
- * @param encodedVariantField - Encoded option value string from the Storefront API, e.g. [product.encodedVariantExistence](/docs/api/storefront/2024-10/objects/Product#field-encodedvariantexistence) or [product.encodedVariantAvailability](/docs/api/storefront/2024-10/objects/Product#field-encodedvariantavailability)
17
+ * @param encodedVariantField - Encoded option value string from the Storefront API, e.g. [product.encodedVariantExistence](/docs/api/storefront/2025-01/objects/Product#field-encodedvariantexistence) or [product.encodedVariantAvailability](/docs/api/storefront/2025-01/objects/Product#field-encodedvariantavailability)
18
18
  * @returns - True if a full or partial targetOptionValueIndices is present in the encoded option value string, false otherwise.
19
19
  */
20
20
  export declare const isOptionValueCombinationInEncodedVariant: IsOptionValueCombinationInEncodedVariant;
@@ -22,7 +22,7 @@ type EncodedVariantField = Product['encodedVariantAvailability'] | Product['enco
22
22
  type DecodedOptionValues = number[][];
23
23
  /**
24
24
  * For an encoded option value string, decode into option value combinations. Entries represent a valid combination formatted as an array of option value positions.
25
- * @param encodedVariantField - Encoded option value string from the Storefront API, e.g. [product.encodedVariantExistence](/docs/api/storefront/2024-10/objects/Product#field-encodedvariantexistence) or [product.encodedVariantAvailability](/docs/api/storefront/2024-10/objects/Product#field-encodedvariantavailability)
25
+ * @param encodedVariantField - Encoded option value string from the Storefront API, e.g. [product.encodedVariantExistence](/docs/api/storefront/2025-01/objects/Product#field-encodedvariantexistence) or [product.encodedVariantAvailability](/docs/api/storefront/2025-01/objects/Product#field-encodedvariantavailability)
26
26
  * @returns Decoded option value combinations
27
27
  */
28
28
  export declare function decodeEncodedVariant(encodedVariantField: EncodedVariantField): DecodedOptionValues;
@@ -1 +1 @@
1
- export declare const SFAPI_VERSION = "2024-10";
1
+ export declare const SFAPI_VERSION = "2025-01";
@@ -7,14 +7,14 @@ import type { PartialDeep } from 'type-fest';
7
7
  type StorefrontApiExtensions = {
8
8
  /**
9
9
  * Shows error codes common to Shopify. Additional error codes may also be shown.
10
- * https://shopify.dev/api/storefront#status_and_error_codes
10
+ * @see https://shopify.dev/api/storefront#status_and_error_codes
11
11
  */
12
12
  code?: 'THROTTLED' | 'ACCESS_DENIED' | 'SHOP_INACTIVE' | 'INTERNAL_SERVER_ERROR' | (string & {});
13
13
  };
14
14
  /**
15
15
  * The Storefront API can return a 200 OK response code when the query succeeds, and will populate the `data` property. The generic you pass in through type parameters will be the shape of the `data` object if successful. If you prefer a "deeply-partial" version of that generic object, consider using `StorefrontApiResponseOkPartial` instead.
16
16
  *
17
- * The Storefront API can also return a 200 OK response code in cases that would typically produce 4xx errors in REST. This will propulate the `errors` property.
17
+ * The Storefront API can also return a 200 OK response code in cases that would typically produce 4xx errors in REST. This will populate the `errors` property.
18
18
  *
19
19
  * Refer to https://shopify.dev/api/storefront#status_and_error_codes for more information.
20
20
  */
@@ -22,7 +22,7 @@ export type StorefrontApiResponseOk<DataGeneric> = FormattedExecutionResult<Data
22
22
  /**
23
23
  * The Storefront API can return a 200 OK response code when the query succeeds, and will populate the `data` property. The generic you pass in through type parameters will be the shape of the `data` object, with `Partial` deeply-applied to all nested objects and properties, if successful. If you prefer not using this "deeply-partial" generic data object, consider using `StorefrontApiResponseOk` instead.
24
24
  *
25
- * The Storefront API can also return a 200 OK response code in cases that would typically produce 4xx errors in REST. This will propulate the `errors` property.
25
+ * The Storefront API can also return a 200 OK response code in cases that would typically produce 4xx errors in REST. This will populate the `errors` property.
26
26
  *
27
27
  * Refer to https://shopify.dev/api/storefront#status_and_error_codes for more information.
28
28
  */
@@ -48,7 +48,7 @@ export type StorefrontApiResponseError = string | {
48
48
  /**
49
49
  * The Storefront API can return a 200 OK response code when the query succeeds, and will populate the `data` property. The generic you pass in through type parameters will be the shape of the `data` object if successful. If you prefer a "deeply-partial" version of that generic object, consider using `StorefrontApiResponseOkPartial` instead.
50
50
  *
51
- * The Storefront API can also return a 200 OK response code in cases that would typically produce 4xx errors in REST. This will propulate the `errors` property.
51
+ * The Storefront API can also return a 200 OK response code in cases that would typically produce 4xx errors in REST. This will populate the `errors` property.
52
52
  *
53
53
  * 4xx and 5xx errors occur infrequently. They are often related to network communications, your account, or an issue with Shopify’s services. Commonly the response is a `JSON.parse`-able string, but in rare occasions may also return HTML which is not `JSON.parse()`-able.
54
54
  *
@@ -58,7 +58,7 @@ export type StorefrontApiResponse<DataGeneric> = StorefrontApiResponseOk<DataGen
58
58
  /**
59
59
  * The Storefront API can return a 200 OK response code when the query succeeds, and will populate the `data` property. The generic you pass in through type parameters will be the shape of the `data` object, with `Partial` deeply-applied to all nested objects and properties, if successful. If you prefer not using this "deeply-partial" generic data object, consider using `StorefrontApiResponseOk` instead.
60
60
  *
61
- * The Storefront API can also return a 200 OK response code in cases that would typically produce 4xx errors in REST. This will propulate the `errors` property.
61
+ * The Storefront API can also return a 200 OK response code in cases that would typically produce 4xx errors in REST. This will populate the `errors` property.
62
62
  *
63
63
  * 4xx and 5xx errors occur infrequently. They are often related to network communications, your account, or an issue with Shopify’s services. Commonly the response is a `JSON.parse`-able string, but in rare occasions may also return HTML which is not `JSON.parse()`-able.
64
64
  *