@shopify/shop-minis-react 0.0.10 → 0.0.12

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 (93) hide show
  1. package/dist/_virtual/debounce.js +8 -0
  2. package/dist/_virtual/debounce.js.map +1 -0
  3. package/dist/components/commerce/merchant-card.js +201 -0
  4. package/dist/components/commerce/merchant-card.js.map +1 -0
  5. package/dist/components/commerce/product-card.js +11 -9
  6. package/dist/components/commerce/product-card.js.map +1 -1
  7. package/dist/hooks/product/useCuratedProducts.js +20 -0
  8. package/dist/hooks/product/useCuratedProducts.js.map +1 -0
  9. package/dist/hooks/product/useProduct.js +24 -0
  10. package/dist/hooks/product/useProduct.js.map +1 -0
  11. package/dist/hooks/product/useProductMedia.js +24 -0
  12. package/dist/hooks/product/useProductMedia.js.map +1 -0
  13. package/dist/hooks/product/useProductSearch.js +44 -0
  14. package/dist/hooks/product/useProductSearch.js.map +1 -0
  15. package/dist/hooks/product/useProductVariants.js +21 -0
  16. package/dist/hooks/product/useProductVariants.js.map +1 -0
  17. package/dist/hooks/product/useProducts.js +17 -0
  18. package/dist/hooks/product/useProducts.js.map +1 -0
  19. package/dist/hooks/shop/useShop.js +17 -0
  20. package/dist/hooks/shop/useShop.js.map +1 -0
  21. package/dist/hooks/user/useFollowedShops.js +21 -0
  22. package/dist/hooks/user/useFollowedShops.js.map +1 -0
  23. package/dist/hooks/user/useRecentProducts.js +21 -0
  24. package/dist/hooks/user/useRecentProducts.js.map +1 -0
  25. package/dist/hooks/user/useRecentShops.js +21 -0
  26. package/dist/hooks/user/useRecentShops.js.map +1 -0
  27. package/dist/hooks/user/useSavedProducts.js +21 -0
  28. package/dist/hooks/user/useSavedProducts.js.map +1 -0
  29. package/dist/index.js +210 -178
  30. package/dist/index.js.map +1 -1
  31. package/dist/internal/useShopActionsPaginatedDataFetching.js +24 -24
  32. package/dist/internal/useShopActionsPaginatedDataFetching.js.map +1 -1
  33. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js +12 -0
  34. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js.map +1 -0
  35. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js +17 -0
  36. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js.map +1 -0
  37. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseTrim.js +15 -0
  38. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseTrim.js.map +1 -0
  39. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js +12 -0
  40. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js.map +1 -0
  41. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js +22 -0
  42. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js.map +1 -0
  43. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js +14 -0
  44. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js.map +1 -0
  45. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js +12 -0
  46. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js.map +1 -0
  47. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_trimmedEndIndex.js +16 -0
  48. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_trimmedEndIndex.js.map +1 -0
  49. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/debounce.js +61 -0
  50. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/debounce.js.map +1 -0
  51. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js +14 -0
  52. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js.map +1 -0
  53. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js +13 -0
  54. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js.map +1 -0
  55. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js +16 -0
  56. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js.map +1 -0
  57. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/now.js +14 -0
  58. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/now.js.map +1 -0
  59. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toNumber.js +29 -0
  60. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toNumber.js.map +1 -0
  61. package/dist/types/minisSDK.generated.d.js.map +1 -1
  62. package/package.json +18 -17
  63. package/src/base.css +264 -0
  64. package/src/components/commerce/merchant-card.tsx +262 -0
  65. package/src/components/commerce/product-card.tsx +3 -1
  66. package/src/components/index.ts +1 -0
  67. package/src/hooks/index.ts +11 -0
  68. package/src/hooks/product/useCuratedProducts.doc.ts +32 -0
  69. package/src/hooks/product/useCuratedProducts.example.tsx +10 -0
  70. package/src/hooks/product/useCuratedProducts.ts +41 -0
  71. package/src/hooks/product/useProduct.ts +45 -0
  72. package/src/hooks/product/useProductMedia.ts +51 -0
  73. package/src/hooks/product/useProductSearch.doc.ts +32 -0
  74. package/src/hooks/product/useProductSearch.example.tsx +13 -0
  75. package/src/hooks/product/useProductSearch.ts +95 -0
  76. package/src/hooks/product/useProductVariants.ts +48 -0
  77. package/src/hooks/product/useProducts.ts +38 -0
  78. package/src/hooks/shop/useShop.doc.ts +31 -0
  79. package/src/hooks/shop/useShop.example.tsx +7 -0
  80. package/src/hooks/shop/useShop.ts +38 -0
  81. package/src/hooks/user/useFollowedShops.ts +43 -0
  82. package/src/hooks/user/useRecentProducts.doc.ts +32 -0
  83. package/src/hooks/user/useRecentProducts.example.tsx +13 -0
  84. package/src/hooks/user/useRecentProducts.ts +46 -0
  85. package/src/hooks/user/useRecentShops.ts +43 -0
  86. package/src/hooks/user/useSavedProducts.doc.ts +32 -0
  87. package/src/hooks/user/useSavedProducts.example.tsx +13 -0
  88. package/src/hooks/user/useSavedProducts.ts +46 -0
  89. package/src/index.css +1 -221
  90. package/src/internal/useShopActionsPaginatedDataFetching.ts +8 -8
  91. package/src/types/minisSDK.generated.d.ts +239 -4
  92. package/src/dev.tsx +0 -868
  93. package/src/mockActions.ts +0 -237
@@ -0,0 +1,46 @@
1
+ import {useMemo} from 'react'
2
+
3
+ import {useShopActions} from '../../internal/useShopActions'
4
+ import {useShopActionsPaginatedDataFetching} from '../../internal/useShopActionsPaginatedDataFetching'
5
+ import {
6
+ PaginatedDataHookOptionsBase,
7
+ PaginatedDataHookReturnsBase,
8
+ Product,
9
+ } from '../../types'
10
+
11
+ export interface UseSavedProductsParams extends PaginatedDataHookOptionsBase {
12
+ includeSensitive?: boolean
13
+ }
14
+
15
+ export interface UseSavedProductsReturns extends PaginatedDataHookReturnsBase {
16
+ products: Product[] | null
17
+ }
18
+
19
+ /**
20
+ * Hook to fetch saved (favorited) products.
21
+ * @param params - Options for the hook.
22
+ */
23
+ export const useSavedProducts = (
24
+ params?: UseSavedProductsParams
25
+ ): UseSavedProductsReturns => {
26
+ const {getSavedProducts} = useShopActions()
27
+ const {skip, ...shopActionParams} = params ?? {}
28
+
29
+ const {data, ...rest} = useShopActionsPaginatedDataFetching(
30
+ getSavedProducts,
31
+ shopActionParams,
32
+ {
33
+ skip,
34
+ hook: 'useSavedProducts',
35
+ }
36
+ )
37
+
38
+ const products = useMemo(() => {
39
+ return data ?? null
40
+ }, [data])
41
+
42
+ return {
43
+ ...rest,
44
+ products,
45
+ }
46
+ }
package/src/index.css CHANGED
@@ -1,222 +1,2 @@
1
- @import 'tailwindcss';
2
- @import 'tw-animate-css';
1
+ @import './base.css';
3
2
  @source '../node_modules/@shopify/shop-minis-react/src/**/*.{js,ts,jsx,tsx}';
4
-
5
- @custom-variant dark (&:is(.dark *));
6
-
7
- @theme inline {
8
- --radius-sm: calc(var(--radius) - 4px);
9
- --radius-md: calc(var(--radius) - 2px);
10
- --radius-lg: var(--radius);
11
- --radius-xl: calc(var(--radius) + 4px);
12
- --color-background: var(--background);
13
- --color-foreground: var(--foreground);
14
- --color-card: var(--card);
15
- --color-card-foreground: var(--card-foreground);
16
- --color-popover: var(--popover);
17
- --color-popover-foreground: var(--popover-foreground);
18
- --color-primary: var(--primary);
19
- --color-primary-foreground: var(--primary-foreground);
20
- --color-secondary: var(--secondary);
21
- --color-secondary-foreground: var(--secondary-foreground);
22
- --color-muted: var(--muted);
23
- --color-muted-foreground: var(--muted-foreground);
24
- --color-accent: var(--accent);
25
- --color-accent-foreground: var(--accent-foreground);
26
- --color-destructive: var(--destructive);
27
- --color-border: var(--border);
28
- --color-input: var(--input);
29
- --color-ring: var(--ring);
30
- --color-chart-1: var(--chart-1);
31
- --color-chart-2: var(--chart-2);
32
- --color-chart-3: var(--chart-3);
33
- --color-chart-4: var(--chart-4);
34
- --color-chart-5: var(--chart-5);
35
- --color-sidebar: var(--sidebar);
36
- --color-sidebar-foreground: var(--sidebar-foreground);
37
- --color-sidebar-primary: var(--sidebar-primary);
38
- --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
39
- --color-sidebar-accent: var(--sidebar-accent);
40
- --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
41
- --color-sidebar-border: var(--sidebar-border);
42
- --color-sidebar-ring: var(--sidebar-ring);
43
-
44
- /* Grayscale palette colors for Tailwind */
45
- --color-grayscale-d100: var(--grayscale-d100);
46
- --color-grayscale-d93: var(--grayscale-d93);
47
- --color-grayscale-d90: var(--grayscale-d90);
48
- --color-grayscale-d80: var(--grayscale-d80);
49
- --color-grayscale-d70: var(--grayscale-d70);
50
- --color-grayscale-d60: var(--grayscale-d60);
51
- --color-grayscale-d50: var(--grayscale-d50);
52
- --color-grayscale-l40: var(--grayscale-l40);
53
- --color-grayscale-l20: var(--grayscale-l20);
54
- --color-grayscale-l10: var(--grayscale-l10);
55
- --color-grayscale-l6: var(--grayscale-l6);
56
- --color-grayscale-l5: var(--grayscale-l5);
57
- --color-grayscale-l0: var(--grayscale-l0);
58
- }
59
-
60
- :root {
61
- --radius: 0.65rem;
62
-
63
- /* Palette Colors - Purple */
64
- --purple-d80: #1b163b;
65
- --purple-d60: #322c7d;
66
- --purple-d50: #4524db;
67
- --purple-p40: #5433eb;
68
- --purple-l30: #6445ed;
69
- --purple-l20: #9c83f8;
70
- --purple-l10: #dbd1ff;
71
- --purple-l5: #eeeaff;
72
- --purple-l2: #f7f5ff;
73
-
74
- /* Palette Colors - Grayscale */
75
- --grayscale-d100: #000000;
76
- --grayscale-d93: #121212;
77
- --grayscale-d90: #1a1a1a;
78
- --grayscale-d80: #2a2a2a;
79
- --grayscale-d70: #404040;
80
- --grayscale-d60: #656667;
81
- --grayscale-d50: #6f7071;
82
- --grayscale-l40: #a6a8a9;
83
- --grayscale-l20: #c9cbcc;
84
- --grayscale-l10: #e1e4e5;
85
- --grayscale-l6: #eef0f1;
86
- --grayscale-l5: #f2f4f5;
87
- --grayscale-l0: #ffffff;
88
-
89
- /* Palette Colors - Green */
90
- --green-d90: #002e24;
91
- --green-d80: #004839;
92
- --green-d70: #008552;
93
- --green-l30: #92d08d;
94
- --green-l20: #baebcb;
95
- --green-l10: #d2f2de;
96
- --green-l5: #e4f6eb;
97
-
98
- /* Palette Colors - Poppy */
99
- --poppy-d80: #481609;
100
- --poppy-d70: #832711;
101
- --poppy-d50: #d92a0f;
102
- --poppy-l40: #f05d38;
103
- --poppy-l20: #ff967d;
104
- --poppy-l10: #ffd2c2;
105
- --poppy-l4: #ffece9;
106
-
107
- /* Palette Colors - Ochre */
108
- --ochre-d90: #443600;
109
- --ochre-d70: #8c6e01;
110
- --ochre-d60: #c29d05;
111
- --ochre-l50: #e3be2b;
112
- --ochre-l30: #f8db67;
113
- --ochre-l20: #ffec9f;
114
- --ochre-l10: #fff4cb;
115
- --ochre-l6: #fff9e2;
116
-
117
- /* Palette Colors - Brand */
118
- --brand-aqua: #8dc0c6;
119
- --brand-violet: #a327c2;
120
- --brand-magenta: #d354ff;
121
- --brand-olive: #8b8f01;
122
- --brand-lime: #c7de00;
123
- --brand-sage: #d8e59d;
124
- --brand-sand: #f4f4ed;
125
-
126
- /* Semantic Colors */
127
- --background: var(--grayscale-l0);
128
- --foreground: var(--grayscale-d100);
129
- --card: var(--grayscale-l0);
130
- --card-foreground: var(--grayscale-d100);
131
- --popover: var(--grayscale-l0);
132
- --popover-foreground: var(--grayscale-d100);
133
- --primary: var(--purple-p40);
134
- --primary-foreground: var(--grayscale-l0);
135
- --secondary: var(--grayscale-l5);
136
- --secondary-foreground: var(--grayscale-d70);
137
- --muted: var(--grayscale-l5);
138
- --muted-foreground: var(--grayscale-d70);
139
- --accent: var(--grayscale-l5);
140
- --accent-foreground: var(--grayscale-d70);
141
- --destructive: var(--poppy-d50);
142
- --border: rgba(0, 0, 0, 0.1);
143
- --input: var(--grayscale-l20);
144
- --ring: var(--purple-p40);
145
- --chart-1: var(--ochre-d90);
146
- --chart-2: var(--green-d70);
147
- --chart-3: var(--green-l30);
148
- --chart-4: var(--grayscale-d50);
149
- --chart-5: var(--green-l20);
150
- --sidebar: var(--grayscale-l5);
151
- --sidebar-foreground: var(--grayscale-d100);
152
- --sidebar-primary: var(--purple-p40);
153
- --sidebar-primary-foreground: var(--purple-l20);
154
- --sidebar-accent: var(--grayscale-l5);
155
- --sidebar-accent-foreground: var(--grayscale-d70);
156
- --sidebar-border: rgba(0, 0, 0, 0.1);
157
- --sidebar-ring: var(--purple-p40);
158
- }
159
-
160
- .dark {
161
- /* Dark mode semantic colors */
162
- --background: var(--grayscale-d93);
163
- --foreground: var(--grayscale-l0);
164
- --card: var(--grayscale-d93);
165
- --card-foreground: var(--grayscale-l0);
166
- --popover: var(--grayscale-d93);
167
- --popover-foreground: var(--grayscale-l0);
168
- --primary: var(--purple-l20);
169
- --primary-foreground: var(--grayscale-d100);
170
- --secondary: var(--grayscale-d80);
171
- --secondary-foreground: var(--grayscale-l0);
172
- --muted: var(--grayscale-d80);
173
- --muted-foreground: var(--grayscale-l20);
174
- --accent: var(--grayscale-d80);
175
- --accent-foreground: var(--grayscale-l0);
176
- --destructive: var(--poppy-l40);
177
- --border: rgba(255, 255, 255, 0.2);
178
- --input: var(--grayscale-l40);
179
- --ring: var(--purple-l20);
180
- --chart-1: var(--green-l30);
181
- --chart-2: var(--grayscale-d60);
182
- --chart-3: var(--green-l20);
183
- --chart-4: var(--grayscale-d60);
184
- --chart-5: var(--ochre-l30);
185
- --sidebar: var(--grayscale-d80);
186
- --sidebar-foreground: var(--grayscale-l0);
187
- --sidebar-primary: var(--purple-l20);
188
- --sidebar-primary-foreground: var(--purple-l10);
189
- --sidebar-accent: var(--grayscale-d80);
190
- --sidebar-accent-foreground: var(--grayscale-l0);
191
- --sidebar-border: rgba(255, 255, 255, 0.2);
192
- --sidebar-ring: var(--purple-l20);
193
- }
194
-
195
- @layer base {
196
- * {
197
- @apply border-border outline-ring/50;
198
- }
199
- body {
200
- @apply bg-background text-foreground;
201
- }
202
- }
203
-
204
- html,
205
- body {
206
- touch-action: manipulation;
207
- }
208
-
209
- /* Disable text selection */
210
- body {
211
- -webkit-user-select: none;
212
- -moz-user-select: -moz-none;
213
- -ms-user-select: none;
214
- user-select: none;
215
- }
216
-
217
- /* Disable image drag */
218
- img,
219
- .no-drag {
220
- -webkit-user-drag: none;
221
- user-drag: none;
222
- }
@@ -45,18 +45,17 @@ export const useShopActionsPaginatedDataFetching = <
45
45
  const skip = options?.skip === true
46
46
  const {validator, hook} = options
47
47
  const runValidator = useCallback(
48
- (dataToValidate: S) => {
48
+ (dataToValidate: S): Error | null => {
49
49
  try {
50
50
  validator?.(dataToValidate)
51
51
  return null
52
52
  } catch (err) {
53
- return (
54
- err ??
55
- new MiniError({
56
- hook,
57
- message: 'Validation failed',
58
- })
59
- )
53
+ if (err instanceof Error) return err
54
+
55
+ return new MiniError({
56
+ hook,
57
+ message: 'Validation failed',
58
+ })
60
59
  }
61
60
  },
62
61
  [validator, hook]
@@ -128,6 +127,7 @@ export const useShopActionsPaginatedDataFetching = <
128
127
  throw result.error
129
128
  }
130
129
  } catch (err) {
130
+ console.log('caught 1', err)
131
131
  queryError = formatError({hook}, err)
132
132
  }
133
133
 
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable @shopify/typescript/prefer-pascal-case-enums */
2
2
  // Auto-generated type definitions for MinisSDK
3
- // Generated on: 2025-06-18T10:56:57.588Z
3
+ // Generated on: 2025-06-18T21:41:30.210Z
4
4
  // Do not edit this file manually - run the generation script instead
5
5
  // Source: useShopActionsImplementationV3.ts + shopActionsV3Definitions.ts + shopActionsV3Types.ts
6
6
  // Generated using TypeScript compiler API for reliable AST parsing
@@ -173,6 +173,48 @@ export interface ShopActions {
173
173
  ): Promise<ShopActionResult<GetPopularProductsResponse>>
174
174
 
175
175
  share(params: ShareParams): Promise<ShopActionResult>
176
+
177
+ getCuratedProducts(
178
+ params: GetCuratedProductsParams
179
+ ): Promise<ShopActionResult<GetCuratedProductsResponse>>
180
+
181
+ getSavedProducts(
182
+ params?: GetSavedProductsParams
183
+ ): Promise<ShopActionResult<GetSavedProductsResponse>>
184
+
185
+ getRecentProducts(
186
+ params?: GetRecentProductsParams
187
+ ): Promise<ShopActionResult<GetRecentProductsResponse>>
188
+
189
+ getProductSearch(
190
+ params: GetProductSearchParams
191
+ ): Promise<ShopActionResult<GetProductSearchResponse>>
192
+
193
+ getProducts(
194
+ params: GetProductsParams
195
+ ): Promise<ShopActionResult<GetProductsResponse>>
196
+
197
+ getProduct(
198
+ params: GetProductParams
199
+ ): Promise<ShopActionResult<GetProductResponse>>
200
+
201
+ getProductVariants(
202
+ params: GetProductVariantsParams
203
+ ): Promise<ShopActionResult<GetProductVariantsResponse>>
204
+
205
+ getProductMedia(
206
+ params: GetProductMediaParams
207
+ ): Promise<ShopActionResult<GetProductMediaResponse>>
208
+
209
+ getShop(params: GetShopParams): Promise<ShopActionResult<GetShopResponse>>
210
+
211
+ getRecentShops(
212
+ params?: GetRecentShopsParams
213
+ ): Promise<ShopActionResult<GetRecentShopsResponse>>
214
+
215
+ getFollowedShops(
216
+ params?: GetFollowedShopsParams
217
+ ): Promise<ShopActionResult<GetFollowedShopsResponse>>
176
218
  }
177
219
 
178
220
  export interface AuthShopActions {
@@ -677,8 +719,8 @@ export interface PreviewProductInARParams {
677
719
 
678
720
  export interface GetCuratedProductsParams {
679
721
  handle: string
680
- requiredTags: string[]
681
- anyOfTags: string[]
722
+ requiredTags?: string[]
723
+ anyOfTags?: string[]
682
724
  first?: number
683
725
  after?: string
684
726
  fetchPolicy?: DataHookFetchPolicy
@@ -701,8 +743,39 @@ export interface GetProductMediaResponse {
701
743
  pageInfo: PaginationInfo
702
744
  }
703
745
 
746
+ export interface GetShopParams {
747
+ id: string
748
+ fetchPolicy?: DataHookFetchPolicy
749
+ }
750
+
751
+ export interface GetShopResponse {
752
+ data: Shop
753
+ }
754
+
755
+ export interface GetRecentShopsParams {
756
+ first?: number
757
+ after?: string
758
+ fetchPolicy?: DataHookFetchPolicy
759
+ }
760
+
761
+ export interface GetRecentShopsResponse {
762
+ data: Shop[]
763
+ pageInfo: PaginationInfo
764
+ }
765
+
766
+ export interface GetFollowedShopsParams {
767
+ first?: number
768
+ after?: string
769
+ fetchPolicy?: DataHookFetchPolicy
770
+ }
771
+
772
+ export interface GetFollowedShopsResponse {
773
+ data: Shop[]
774
+ pageInfo: PaginationInfo
775
+ }
776
+
704
777
  export interface GetProductsParams {
705
- productIds: string[]
778
+ ids: string[]
706
779
  fetchPolicy?: DataHookFetchPolicy
707
780
  }
708
781
 
@@ -728,6 +801,57 @@ export interface ShareParams {
728
801
  failOnCancel?: boolean
729
802
  }
730
803
 
804
+ export interface GetSavedProductsParams {
805
+ includeSensitive?: boolean
806
+ first?: number
807
+ after?: string
808
+ fetchPolicy?: DataHookFetchPolicy
809
+ }
810
+
811
+ export interface GetSavedProductsResponse {
812
+ data: Product[]
813
+ pageInfo: PaginationInfo
814
+ }
815
+
816
+ export interface GetRecentProductsParams {
817
+ includeSensitive?: boolean
818
+ first?: number
819
+ after?: string
820
+ fetchPolicy?: DataHookFetchPolicy
821
+ }
822
+
823
+ export interface GetRecentProductsResponse {
824
+ data: Product[]
825
+ pageInfo: PaginationInfo
826
+ }
827
+
828
+ export interface GetProductSearchParams {
829
+ query: string
830
+ filters?: ProductFilters
831
+ sortBy?: ProductSearchSortBy
832
+ includeSensitive?: boolean
833
+ first?: number
834
+ after?: string
835
+ fetchPolicy?: DataHookFetchPolicy
836
+ }
837
+
838
+ export interface GetProductSearchResponse {
839
+ data: Product[]
840
+ pageInfo: PaginationInfo
841
+ }
842
+
843
+ export interface GetProductVariantsParams {
844
+ id: string
845
+ first?: number
846
+ after?: string
847
+ fetchPolicy?: DataHookFetchPolicy
848
+ }
849
+
850
+ export interface GetProductVariantsResponse {
851
+ data: ProductVariant[]
852
+ pageInfo: PaginationInfo
853
+ }
854
+
731
855
  export interface MinisParams {
732
856
  /** The handle/identifier of the Mini application */
733
857
  handle: string
@@ -1204,6 +1328,117 @@ export interface PaginatedDataHookPageInfo {
1204
1328
  endCursor: string | null
1205
1329
  }
1206
1330
 
1331
+ export type ProductColorFilter =
1332
+ | 'BEIGE'
1333
+ | 'BLACK'
1334
+ | 'BLUE'
1335
+ | 'BROWN'
1336
+ | 'GOLD'
1337
+ | 'GREEN'
1338
+ | 'GREY'
1339
+ | 'NAVY'
1340
+ | 'ORANGE'
1341
+ | 'PINK'
1342
+ | 'PURPLE'
1343
+ | 'RED'
1344
+ | 'SILVER'
1345
+ | 'WHITE'
1346
+ | 'YELLOW'
1347
+
1348
+ export type ProductApparelSizeFilter =
1349
+ | 'SIZE_3XL'
1350
+ | 'SIZE_4XL'
1351
+ | 'SIZE_5XL'
1352
+ | 'SIZE_L'
1353
+ | 'SIZE_M'
1354
+ | 'SIZE_S'
1355
+ | 'SIZE_XL'
1356
+ | 'SIZE_XS'
1357
+ | 'SIZE_XXL'
1358
+ | 'SIZE_XXS'
1359
+
1360
+ export interface ProductFilters {
1361
+ /**
1362
+ * The apparel sizes to filter by.
1363
+ */
1364
+ apparelSize?: ProductApparelSizeFilter[]
1365
+ /**
1366
+ * Whether the product is in stock or not.
1367
+ */
1368
+ available?: boolean
1369
+ /**
1370
+ * The category IDs to filter by.
1371
+ */
1372
+ category?: string[]
1373
+ /**
1374
+ * The colors to filter by.
1375
+ */
1376
+ color?: ProductColorFilter[]
1377
+ /**
1378
+ * The gender to filter by.
1379
+ */
1380
+ gender?: 'MALE' | 'FEMALE' | 'NEUTRAL'
1381
+ /**
1382
+ * The shop IDs to include in the search.
1383
+ */
1384
+ includeShopIds?: string[]
1385
+ /**
1386
+ * The minimum rating to filter by.
1387
+ */
1388
+ minimumRating?: number
1389
+ /**
1390
+ * The price range to filter by.
1391
+ */
1392
+ price?: {
1393
+ min?: number
1394
+ max?: number
1395
+ }
1396
+ /**
1397
+ * The shoe sizes to filter by.
1398
+ */
1399
+ shoeSize?: ProductShoeSizeFilter[]
1400
+ }
1401
+
1402
+ export type ProductShoeSizeFilter =
1403
+ | 'SIZE_4'
1404
+ | 'SIZE_4_5'
1405
+ | 'SIZE_5'
1406
+ | 'SIZE_5_5'
1407
+ | 'SIZE_6'
1408
+ | 'SIZE_6_5'
1409
+ | 'SIZE_7'
1410
+ | 'SIZE_7_5'
1411
+ | 'SIZE_8'
1412
+ | 'SIZE_8_5'
1413
+ | 'SIZE_9'
1414
+ | 'SIZE_9_5'
1415
+ | 'SIZE_10'
1416
+ | 'SIZE_10_5'
1417
+ | 'SIZE_11'
1418
+ | 'SIZE_11_5'
1419
+ | 'SIZE_12'
1420
+ | 'SIZE_12_5'
1421
+ | 'SIZE_13'
1422
+ | 'SIZE_13_5'
1423
+ | 'SIZE_14'
1424
+ | 'SIZE_14_5'
1425
+ | 'SIZE_15'
1426
+
1427
+ export type ProductSizeFilter =
1428
+ | 'SIZE_XS'
1429
+ | 'SIZE_S'
1430
+ | 'SIZE_M'
1431
+ | 'SIZE_L'
1432
+ | 'SIZE_XL'
1433
+ | 'SIZE_XXL'
1434
+ | 'SIZE_XXS'
1435
+
1436
+ export type ProductSearchSortBy =
1437
+ | 'MOST_RECENT'
1438
+ | 'PRICE_HIGH_TO_LOW'
1439
+ | 'PRICE_LOW_TO_HIGH'
1440
+ | 'RELEVANCE'
1441
+
1207
1442
  declare global {
1208
1443
  interface Window {
1209
1444
  minisSDK: ShopActions