@anker-in/campaign-ui 0.5.13 → 0.5.15

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 (246) hide show
  1. package/dist/cjs/components/credits/context/provider.d.ts +1 -1
  2. package/dist/cjs/components/credits/context/provider.js.map +1 -1
  3. package/dist/cjs/components/credits/modal/ActivitiesModal.js +2 -0
  4. package/dist/cjs/components/credits/modal/ActivitiesModal.js.map +7 -0
  5. package/dist/cjs/components/credits/modal/RewardsModal.js +1 -1
  6. package/dist/cjs/components/credits/modal/RewardsModal.js.map +2 -2
  7. package/dist/cjs/templates/Credits.types.d.ts +1 -1
  8. package/dist/cjs/templates/Credits.types.js.map +1 -1
  9. package/dist/esm/components/credits/context/provider.d.ts +1 -1
  10. package/dist/esm/components/credits/context/provider.js.map +1 -1
  11. package/dist/esm/components/credits/modal/ActivitiesModal.js +2 -0
  12. package/dist/esm/components/credits/modal/ActivitiesModal.js.map +7 -0
  13. package/dist/esm/components/credits/modal/RewardsModal.js +1 -1
  14. package/dist/esm/components/credits/modal/RewardsModal.js.map +2 -2
  15. package/dist/esm/templates/Credits.types.d.ts +1 -1
  16. package/dist/esm/templates/Credits.types.js.map +1 -1
  17. package/package.json +19 -19
  18. package/src/components/credits/modal/ActivitiesModal.tsx +59 -66
  19. package/src/components/credits/modal/RewardsModal.tsx +1 -1
  20. package/src/templates/Credits.types.ts +1 -1
  21. package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.d.ts +0 -1
  22. package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js +0 -2
  23. package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js.map +0 -7
  24. package/dist/cjs/components/credits/context/hooks/useSubscriptions.d.ts +0 -5
  25. package/dist/cjs/components/credits/context/hooks/useSubscriptions.js +0 -2
  26. package/dist/cjs/components/credits/context/hooks/useSubscriptions.js.map +0 -7
  27. package/dist/cjs/components/credits/modal/MyRewardsModal.d.ts +0 -32
  28. package/dist/cjs/components/credits/modal/MyRewardsModal.js +0 -2
  29. package/dist/cjs/components/credits/modal/MyRewardsModal.js.map +0 -7
  30. package/dist/cjs/components/credits/modal/activitiesModal.js +0 -2
  31. package/dist/cjs/components/credits/modal/activitiesModal.js.map +0 -7
  32. package/dist/cjs/helpers/fetchResponse.d.ts +0 -14
  33. package/dist/cjs/helpers/fetchResponse.js +0 -2
  34. package/dist/cjs/helpers/fetchResponse.js.map +0 -7
  35. package/dist/cjs/helpers/fetcher.d.ts +0 -2
  36. package/dist/cjs/helpers/fetcher.js +0 -2
  37. package/dist/cjs/helpers/fetcher.js.map +0 -7
  38. package/dist/cjs/helpers/index.d.ts +0 -2
  39. package/dist/cjs/helpers/index.js +0 -2
  40. package/dist/cjs/helpers/index.js.map +0 -7
  41. package/dist/cjs/helpers/track.d.ts +0 -15
  42. package/dist/cjs/helpers/track.js +0 -2
  43. package/dist/cjs/helpers/track.js.map +0 -7
  44. package/dist/cjs/helpers/utils.d.ts +0 -3
  45. package/dist/cjs/helpers/utils.js +0 -2
  46. package/dist/cjs/helpers/utils.js.map +0 -7
  47. package/dist/cjs/index.css +0 -2
  48. package/dist/cjs/index.css.map +0 -7
  49. package/dist/cjs/shopify/context/ShopifyProvider.d.ts +0 -10
  50. package/dist/cjs/shopify/fetchers/create-cart.d.ts +0 -13
  51. package/dist/cjs/shopify/fetchers/get-products-by-handles.d.ts +0 -7
  52. package/dist/cjs/shopify/fetchers/index.d.ts +0 -2
  53. package/dist/cjs/shopify/fragments/article.d.ts +0 -2
  54. package/dist/cjs/shopify/fragments/blog.d.ts +0 -1
  55. package/dist/cjs/shopify/fragments/cart.d.ts +0 -1
  56. package/dist/cjs/shopify/fragments/collection.d.ts +0 -1
  57. package/dist/cjs/shopify/fragments/image.d.ts +0 -1
  58. package/dist/cjs/shopify/fragments/index.d.ts +0 -11
  59. package/dist/cjs/shopify/fragments/metafields.d.ts +0 -2
  60. package/dist/cjs/shopify/fragments/page-info.d.ts +0 -1
  61. package/dist/cjs/shopify/fragments/page.d.ts +0 -1
  62. package/dist/cjs/shopify/fragments/product.d.ts +0 -1
  63. package/dist/cjs/shopify/fragments/seo.d.ts +0 -1
  64. package/dist/cjs/shopify/fragments/variant.d.ts +0 -1
  65. package/dist/cjs/shopify/gql/fragment-masking.d.ts +0 -15
  66. package/dist/cjs/shopify/gql/gql.d.ts +0 -87
  67. package/dist/cjs/shopify/gql/graphql.d.ts +0 -7669
  68. package/dist/cjs/shopify/gql/index.d.ts +0 -3
  69. package/dist/cjs/shopify/hooks/index.d.ts +0 -2
  70. package/dist/cjs/shopify/hooks/useCreateCart.d.ts +0 -2
  71. package/dist/cjs/shopify/hooks/useProductsByHandles.d.ts +0 -4
  72. package/dist/cjs/shopify/mutations/create-cart.d.ts +0 -1
  73. package/dist/cjs/shopify/queries/get-product-by-handles.d.ts +0 -1
  74. package/dist/cjs/shopify/queries/index.d.ts +0 -1
  75. package/dist/cjs/shopify/src/index.d.ts +0 -5
  76. package/dist/cjs/shopify/tsup.config.d.ts +0 -2
  77. package/dist/cjs/shopify/types/article.d.ts +0 -48
  78. package/dist/cjs/shopify/types/cart.d.ts +0 -173
  79. package/dist/cjs/shopify/types/checkout.d.ts +0 -42
  80. package/dist/cjs/shopify/types/collection.d.ts +0 -122
  81. package/dist/cjs/shopify/types/common.d.ts +0 -42
  82. package/dist/cjs/shopify/types/config.d.ts +0 -12
  83. package/dist/cjs/shopify/types/customer.d.ts +0 -30
  84. package/dist/cjs/shopify/types/fetcher.d.ts +0 -38
  85. package/dist/cjs/shopify/types/index.d.ts +0 -10
  86. package/dist/cjs/shopify/types/page.d.ts +0 -33
  87. package/dist/cjs/shopify/types/product.d.ts +0 -174
  88. package/dist/cjs/shopify/types/search.d.ts +0 -54
  89. package/dist/cjs/shopify/types/site.d.ts +0 -33
  90. package/dist/cjs/shopify/types/type-helper.d.ts +0 -5
  91. package/dist/cjs/shopify/utils/colors.d.ts +0 -3
  92. package/dist/cjs/shopify/utils/const.d.ts +0 -76
  93. package/dist/cjs/shopify/utils/cookie.d.ts +0 -15
  94. package/dist/cjs/shopify/utils/errors.d.ts +0 -38
  95. package/dist/cjs/shopify/utils/fetch-graphql-api.d.ts +0 -19
  96. package/dist/cjs/shopify/utils/handle-fetch-response.d.ts +0 -5
  97. package/dist/cjs/shopify/utils/helper.d.ts +0 -28
  98. package/dist/cjs/shopify/utils/normalize/cart.d.ts +0 -7
  99. package/dist/cjs/shopify/utils/normalize/customer.d.ts +0 -3
  100. package/dist/cjs/shopify/utils/normalize/index.d.ts +0 -2
  101. package/dist/cjs/shopify/utils/normalize/metafield.d.ts +0 -5
  102. package/dist/cjs/shopify/utils/normalize/product.d.ts +0 -16
  103. package/dist/cjs/shopify/utils/store.d.ts +0 -2
  104. package/dist/cjs/shopify/utils/type-helper.d.ts +0 -5
  105. package/dist/cjs/tsconfig.tsbuildinfo +0 -1
  106. package/dist/esm/components/credits/context/hooks/useSendEmailValidation.d.ts +0 -1
  107. package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js +0 -2
  108. package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js.map +0 -7
  109. package/dist/esm/components/credits/context/hooks/useSubscriptions.d.ts +0 -5
  110. package/dist/esm/components/credits/context/hooks/useSubscriptions.js +0 -2
  111. package/dist/esm/components/credits/context/hooks/useSubscriptions.js.map +0 -7
  112. package/dist/esm/components/credits/modal/MyRewardsModal.d.ts +0 -32
  113. package/dist/esm/components/credits/modal/MyRewardsModal.js +0 -2
  114. package/dist/esm/components/credits/modal/MyRewardsModal.js.map +0 -7
  115. package/dist/esm/components/credits/modal/activitiesModal.js +0 -2
  116. package/dist/esm/components/credits/modal/activitiesModal.js.map +0 -7
  117. package/dist/esm/helpers/fetchResponse.d.ts +0 -14
  118. package/dist/esm/helpers/fetchResponse.js +0 -2
  119. package/dist/esm/helpers/fetchResponse.js.map +0 -7
  120. package/dist/esm/helpers/fetcher.d.ts +0 -2
  121. package/dist/esm/helpers/fetcher.js +0 -2
  122. package/dist/esm/helpers/fetcher.js.map +0 -7
  123. package/dist/esm/helpers/index.d.ts +0 -2
  124. package/dist/esm/helpers/index.js +0 -2
  125. package/dist/esm/helpers/index.js.map +0 -7
  126. package/dist/esm/helpers/track.d.ts +0 -15
  127. package/dist/esm/helpers/track.js +0 -2
  128. package/dist/esm/helpers/track.js.map +0 -7
  129. package/dist/esm/helpers/utils.d.ts +0 -3
  130. package/dist/esm/helpers/utils.js +0 -2
  131. package/dist/esm/helpers/utils.js.map +0 -7
  132. package/dist/esm/index.css +0 -2
  133. package/dist/esm/index.css.map +0 -7
  134. package/dist/esm/shopify/context/ShopifyProvider.d.ts +0 -10
  135. package/dist/esm/shopify/fetchers/create-cart.d.ts +0 -13
  136. package/dist/esm/shopify/fetchers/get-products-by-handles.d.ts +0 -7
  137. package/dist/esm/shopify/fetchers/index.d.ts +0 -2
  138. package/dist/esm/shopify/fragments/article.d.ts +0 -2
  139. package/dist/esm/shopify/fragments/blog.d.ts +0 -1
  140. package/dist/esm/shopify/fragments/cart.d.ts +0 -1
  141. package/dist/esm/shopify/fragments/collection.d.ts +0 -1
  142. package/dist/esm/shopify/fragments/image.d.ts +0 -1
  143. package/dist/esm/shopify/fragments/index.d.ts +0 -11
  144. package/dist/esm/shopify/fragments/metafields.d.ts +0 -2
  145. package/dist/esm/shopify/fragments/page-info.d.ts +0 -1
  146. package/dist/esm/shopify/fragments/page.d.ts +0 -1
  147. package/dist/esm/shopify/fragments/product.d.ts +0 -1
  148. package/dist/esm/shopify/fragments/seo.d.ts +0 -1
  149. package/dist/esm/shopify/fragments/variant.d.ts +0 -1
  150. package/dist/esm/shopify/gql/fragment-masking.d.ts +0 -15
  151. package/dist/esm/shopify/gql/gql.d.ts +0 -87
  152. package/dist/esm/shopify/gql/graphql.d.ts +0 -7669
  153. package/dist/esm/shopify/gql/index.d.ts +0 -3
  154. package/dist/esm/shopify/hooks/index.d.ts +0 -2
  155. package/dist/esm/shopify/hooks/useCreateCart.d.ts +0 -2
  156. package/dist/esm/shopify/hooks/useProductsByHandles.d.ts +0 -4
  157. package/dist/esm/shopify/mutations/create-cart.d.ts +0 -1
  158. package/dist/esm/shopify/queries/get-product-by-handles.d.ts +0 -1
  159. package/dist/esm/shopify/queries/index.d.ts +0 -1
  160. package/dist/esm/shopify/src/index.d.ts +0 -5
  161. package/dist/esm/shopify/tsup.config.d.ts +0 -2
  162. package/dist/esm/shopify/types/article.d.ts +0 -48
  163. package/dist/esm/shopify/types/cart.d.ts +0 -173
  164. package/dist/esm/shopify/types/checkout.d.ts +0 -42
  165. package/dist/esm/shopify/types/collection.d.ts +0 -122
  166. package/dist/esm/shopify/types/common.d.ts +0 -42
  167. package/dist/esm/shopify/types/config.d.ts +0 -12
  168. package/dist/esm/shopify/types/customer.d.ts +0 -30
  169. package/dist/esm/shopify/types/fetcher.d.ts +0 -38
  170. package/dist/esm/shopify/types/index.d.ts +0 -10
  171. package/dist/esm/shopify/types/page.d.ts +0 -33
  172. package/dist/esm/shopify/types/product.d.ts +0 -174
  173. package/dist/esm/shopify/types/search.d.ts +0 -54
  174. package/dist/esm/shopify/types/site.d.ts +0 -33
  175. package/dist/esm/shopify/types/type-helper.d.ts +0 -5
  176. package/dist/esm/shopify/utils/colors.d.ts +0 -3
  177. package/dist/esm/shopify/utils/const.d.ts +0 -76
  178. package/dist/esm/shopify/utils/cookie.d.ts +0 -15
  179. package/dist/esm/shopify/utils/errors.d.ts +0 -38
  180. package/dist/esm/shopify/utils/fetch-graphql-api.d.ts +0 -19
  181. package/dist/esm/shopify/utils/handle-fetch-response.d.ts +0 -5
  182. package/dist/esm/shopify/utils/helper.d.ts +0 -28
  183. package/dist/esm/shopify/utils/normalize/cart.d.ts +0 -7
  184. package/dist/esm/shopify/utils/normalize/customer.d.ts +0 -3
  185. package/dist/esm/shopify/utils/normalize/index.d.ts +0 -2
  186. package/dist/esm/shopify/utils/normalize/metafield.d.ts +0 -5
  187. package/dist/esm/shopify/utils/normalize/product.d.ts +0 -16
  188. package/dist/esm/shopify/utils/store.d.ts +0 -2
  189. package/dist/esm/shopify/utils/type-helper.d.ts +0 -5
  190. package/dist/esm/tsconfig.tsbuildinfo +0 -1
  191. /package/dist/cjs/components/credits/creditsBenefits/{benefitItem.d.ts → BenefitItem.d.ts} +0 -0
  192. /package/dist/cjs/components/credits/creditsBenefits/{benefitItem.js → BenefitItem.js} +0 -0
  193. /package/dist/cjs/components/credits/creditsBenefits/{benefitItem.js.map → BenefitItem.js.map} +0 -0
  194. /package/dist/cjs/components/credits/creditsBenefits/{iconInfo.d.ts → IconInfo.d.ts} +0 -0
  195. /package/dist/cjs/components/credits/creditsBenefits/{iconInfo.js → IconInfo.js} +0 -0
  196. /package/dist/cjs/components/credits/creditsBenefits/{iconInfo.js.map → IconInfo.js.map} +0 -0
  197. /package/dist/cjs/components/credits/modal/{activitiesModal.d.ts → ActivitiesModal.d.ts} +0 -0
  198. /package/dist/cjs/components/credits/modal/{creditsUploadReceiptModal.d.ts → CreditsUploadReceiptModal.d.ts} +0 -0
  199. /package/dist/cjs/components/credits/modal/{creditsUploadReceiptModal.js → CreditsUploadReceiptModal.js} +0 -0
  200. /package/dist/cjs/components/credits/modal/{creditsUploadReceiptModal.js.map → CreditsUploadReceiptModal.js.map} +0 -0
  201. /package/dist/cjs/components/credits/modal/{loadingDots.d.ts → LoadingDots.d.ts} +0 -0
  202. /package/dist/cjs/components/credits/modal/{loadingDots.js → LoadingDots.js} +0 -0
  203. /package/dist/cjs/components/credits/modal/{loadingDots.js.map → LoadingDots.js.map} +0 -0
  204. /package/dist/cjs/components/credits/modal/{modalContainer.d.ts → ModalContainer.d.ts} +0 -0
  205. /package/dist/cjs/components/credits/modal/{modalContainer.js → ModalContainer.js} +0 -0
  206. /package/dist/cjs/components/credits/modal/{modalContainer.js.map → ModalContainer.js.map} +0 -0
  207. /package/dist/cjs/components/credits/modal/{rulesModal.d.ts → RulesModal.d.ts} +0 -0
  208. /package/dist/cjs/components/credits/modal/{rulesModal.js → RulesModal.js} +0 -0
  209. /package/dist/cjs/components/credits/modal/{rulesModal.js.map → RulesModal.js.map} +0 -0
  210. /package/dist/cjs/components/credits/modal/{subscribeModal.d.ts → SubscribeModal.d.ts} +0 -0
  211. /package/dist/cjs/components/credits/modal/{subscribeModal.js → SubscribeModal.js} +0 -0
  212. /package/dist/cjs/components/credits/modal/{subscribeModal.js.map → SubscribeModal.js.map} +0 -0
  213. /package/dist/cjs/components/credits/modal/{tip.d.ts → Tip.d.ts} +0 -0
  214. /package/dist/cjs/components/credits/modal/{tip.js → Tip.js} +0 -0
  215. /package/dist/cjs/components/credits/modal/{tip.js.map → Tip.js.map} +0 -0
  216. /package/dist/cjs/templates/{credits.d.ts → Credits.d.ts} +0 -0
  217. /package/dist/cjs/templates/{credits.js → Credits.js} +0 -0
  218. /package/dist/cjs/templates/{credits.js.map → Credits.js.map} +0 -0
  219. /package/dist/esm/components/credits/creditsBenefits/{benefitItem.d.ts → BenefitItem.d.ts} +0 -0
  220. /package/dist/esm/components/credits/creditsBenefits/{benefitItem.js → BenefitItem.js} +0 -0
  221. /package/dist/esm/components/credits/creditsBenefits/{benefitItem.js.map → BenefitItem.js.map} +0 -0
  222. /package/dist/esm/components/credits/creditsBenefits/{iconInfo.d.ts → IconInfo.d.ts} +0 -0
  223. /package/dist/esm/components/credits/creditsBenefits/{iconInfo.js → IconInfo.js} +0 -0
  224. /package/dist/esm/components/credits/creditsBenefits/{iconInfo.js.map → IconInfo.js.map} +0 -0
  225. /package/dist/esm/components/credits/modal/{activitiesModal.d.ts → ActivitiesModal.d.ts} +0 -0
  226. /package/dist/esm/components/credits/modal/{creditsUploadReceiptModal.d.ts → CreditsUploadReceiptModal.d.ts} +0 -0
  227. /package/dist/esm/components/credits/modal/{creditsUploadReceiptModal.js → CreditsUploadReceiptModal.js} +0 -0
  228. /package/dist/esm/components/credits/modal/{creditsUploadReceiptModal.js.map → CreditsUploadReceiptModal.js.map} +0 -0
  229. /package/dist/esm/components/credits/modal/{loadingDots.d.ts → LoadingDots.d.ts} +0 -0
  230. /package/dist/esm/components/credits/modal/{loadingDots.js → LoadingDots.js} +0 -0
  231. /package/dist/esm/components/credits/modal/{loadingDots.js.map → LoadingDots.js.map} +0 -0
  232. /package/dist/esm/components/credits/modal/{modalContainer.d.ts → ModalContainer.d.ts} +0 -0
  233. /package/dist/esm/components/credits/modal/{modalContainer.js → ModalContainer.js} +0 -0
  234. /package/dist/esm/components/credits/modal/{modalContainer.js.map → ModalContainer.js.map} +0 -0
  235. /package/dist/esm/components/credits/modal/{rulesModal.d.ts → RulesModal.d.ts} +0 -0
  236. /package/dist/esm/components/credits/modal/{rulesModal.js → RulesModal.js} +0 -0
  237. /package/dist/esm/components/credits/modal/{rulesModal.js.map → RulesModal.js.map} +0 -0
  238. /package/dist/esm/components/credits/modal/{subscribeModal.d.ts → SubscribeModal.d.ts} +0 -0
  239. /package/dist/esm/components/credits/modal/{subscribeModal.js → SubscribeModal.js} +0 -0
  240. /package/dist/esm/components/credits/modal/{subscribeModal.js.map → SubscribeModal.js.map} +0 -0
  241. /package/dist/esm/components/credits/modal/{tip.d.ts → Tip.d.ts} +0 -0
  242. /package/dist/esm/components/credits/modal/{tip.js → Tip.js} +0 -0
  243. /package/dist/esm/components/credits/modal/{tip.js.map → Tip.js.map} +0 -0
  244. /package/dist/esm/templates/{credits.d.ts → Credits.d.ts} +0 -0
  245. /package/dist/esm/templates/{credits.js → Credits.js} +0 -0
  246. /package/dist/esm/templates/{credits.js.map → Credits.js.map} +0 -0
@@ -1,174 +0,0 @@
1
- import { Media, Product as ShopifyProduct } from '../gql';
2
- import { SearchHook } from './search';
3
- export type ProductImage = {
4
- url: string;
5
- alt?: string;
6
- };
7
- export type ProductPrice = {
8
- value: number;
9
- currencyCode?: 'USD' | 'EUR' | 'ARS' | string;
10
- retailPrice?: number;
11
- salePrice?: number;
12
- listPrice?: number;
13
- extendedSalePrice?: number;
14
- extendedListPrice?: number;
15
- };
16
- export type ProductOption = {
17
- __typename?: 'ProductOption';
18
- id: string;
19
- name: string;
20
- values: ProductOptionValues[];
21
- };
22
- export type ProductOptionValues = {
23
- label: string;
24
- hexColors?: string[];
25
- };
26
- export type ProductVariant = {
27
- id: string | number;
28
- options: ProductOption[];
29
- availableForSale?: boolean;
30
- quantityAvailable: number;
31
- metafields?: Record<string, any>;
32
- [key: string]: any;
33
- };
34
- type NormalizedProduct = {
35
- id: string;
36
- description: string;
37
- descriptionHtml?: string;
38
- productType?: string;
39
- sku?: string;
40
- slug?: string;
41
- handle?: string;
42
- path?: string;
43
- images: ProductImage[];
44
- media: ProductMedia[];
45
- variants: ProductVariant[];
46
- price: ProductPrice;
47
- listPrice?: number;
48
- options: ProductOption[];
49
- preRender?: string;
50
- seo?: any;
51
- metafields?: {
52
- [key: string]: any;
53
- };
54
- };
55
- export type Product = Omit<ShopifyProduct, keyof NormalizedProduct> & NormalizedProduct;
56
- export type GetProductBody = {
57
- handles: string;
58
- locale?: string;
59
- };
60
- export type ProductTypes = {
61
- product: Product;
62
- getBody: GetProductBody;
63
- };
64
- export type GetProductHook<T extends ProductTypes = ProductTypes> = {
65
- data: {
66
- products: (T['product'] | {})[] | [];
67
- };
68
- body: T['getBody'];
69
- input: T['getBody'];
70
- fetcherInput: T['getBody'];
71
- };
72
- export type ProductsSchema<T extends ProductTypes = ProductTypes> = {
73
- endpoint: {
74
- options: {};
75
- handlers: {
76
- getProducts: SearchHook;
77
- getProduct: GetProductHook<T>;
78
- };
79
- };
80
- };
81
- export type GetAllProductPathsOperation<T extends ProductTypes = ProductTypes> = {
82
- data: {
83
- products: Pick<T['product'], 'path'>[];
84
- };
85
- variables: {
86
- first?: number;
87
- };
88
- };
89
- export type GetAllProductsOperation<T extends ProductTypes = ProductTypes> = {
90
- data: {
91
- products: T['product'][];
92
- };
93
- variables: {
94
- relevance?: 'featured' | 'best_selling' | 'newest';
95
- ids?: string[];
96
- first?: number;
97
- };
98
- };
99
- export type GetProductOperation<T extends ProductTypes = ProductTypes> = {
100
- data: {
101
- product?: T['product'];
102
- };
103
- variables: {
104
- path: string;
105
- slug?: never;
106
- } | {
107
- path?: never;
108
- slug: string;
109
- };
110
- };
111
- export type Options = Record<string, string>;
112
- export type ProductCoupon = {
113
- sku: string;
114
- variant_shopify_id: number;
115
- variant_price: string;
116
- handle: string;
117
- product_type: string;
118
- product_title: string;
119
- product_shopify_id: number;
120
- title: string;
121
- starts_at: string;
122
- ends_at?: string;
123
- value_type: string;
124
- value: string;
125
- shopify_domain: string;
126
- currency: string;
127
- custom_domain: string;
128
- shop_discount_threshold_value: number;
129
- fixed_value: string;
130
- value_style: string;
131
- variant_price4wscode: number;
132
- variant_image: string;
133
- currency_symbol: string;
134
- fixed_amount_sort_key: number;
135
- percentage_sort_key: number;
136
- variant_url: string;
137
- variant_metafields: any[];
138
- product_tags: string;
139
- product_metafields: any[];
140
- available_for_sale: boolean;
141
- shopify_created_at: string;
142
- shopify_updated_at: string;
143
- timezone: string;
144
- starts_at_with_timezone: string;
145
- ends_at_with_timezone?: string;
146
- amazon_deal: boolean;
147
- };
148
- export type VariantCoupon = {
149
- title: string;
150
- starts_at: string;
151
- ends_at: string | null;
152
- variant_shopify_id: number;
153
- value_type: 'percentage' | 'fixed' | 'fixed_amount' | 'fix_discount_amount';
154
- value: string;
155
- currency: string;
156
- fixed_value: string;
157
- value_style: string;
158
- variant_price4wscode: number;
159
- discount_type: string;
160
- amazon_deal: boolean;
161
- cdi_id: number;
162
- cdi_updated_at: string;
163
- };
164
- export type ProductMedia = Media & {
165
- sources?: {
166
- url: string;
167
- altText: string;
168
- }[];
169
- image?: {
170
- url: string;
171
- altText: string;
172
- };
173
- };
174
- export {};
@@ -1,54 +0,0 @@
1
- import type { ProductTypes } from './product';
2
- import type { PageTypes } from './page';
3
- export type SearchBody = {
4
- first?: number;
5
- after?: string;
6
- before?: string;
7
- reverse?: boolean;
8
- sort?: string;
9
- sku?: string;
10
- query?: string;
11
- search?: string;
12
- sortKey?: string;
13
- filters?: any;
14
- productFilters?: any;
15
- categoryId?: string | number;
16
- brandId?: string | number;
17
- termSearch?: string;
18
- types?: string[];
19
- };
20
- export type SearchProductsInput = {
21
- after?: string;
22
- before?: string;
23
- sortKey?: string;
24
- locale?: string;
25
- first?: number;
26
- last?: number;
27
- types?: string[];
28
- filters?: any;
29
- productFilters?: any;
30
- reverse?: boolean;
31
- searchTerm?: string;
32
- };
33
- export type ShopifySearchOperation = {
34
- data: {
35
- products: ProductTypes['product'][];
36
- found: boolean;
37
- } | {
38
- pages: PageTypes['page'][];
39
- products: ProductTypes['product'][];
40
- };
41
- variables: SearchBody;
42
- };
43
- export type SearchHook = {
44
- data: {
45
- products: ProductTypes['product'][];
46
- found: boolean;
47
- } | {
48
- pages: PageTypes['page'][];
49
- products: ProductTypes['product'][];
50
- };
51
- body: SearchBody;
52
- input: SearchBody;
53
- fetcherInput: SearchBody;
54
- };
@@ -1,33 +0,0 @@
1
- import { Category } from './collection';
2
- export type Brand = any;
3
- export type Policy = {
4
- handle: string;
5
- id: string;
6
- title: string;
7
- body?: string;
8
- url?: string;
9
- };
10
- export type Shop = {
11
- name: string;
12
- privacyPolicy: Policy;
13
- refundPolicy: Policy;
14
- shippingPolicy: Policy;
15
- termsOfService: Policy;
16
- subscriptionPolicy: Policy;
17
- };
18
- export type SiteTypes = {
19
- shop: Shop;
20
- category: Category;
21
- brand: Brand;
22
- };
23
- export type GetSiteInfoOperation<T extends SiteTypes = SiteTypes> = {
24
- data: {
25
- shop: Shop;
26
- categories: T['category'][];
27
- brands: T['brand'][];
28
- shopName?: string;
29
- metafields?: {
30
- [key: string]: any;
31
- };
32
- };
33
- };
@@ -1,5 +0,0 @@
1
- export type PartialRecord<K extends string | number | symbol, T> = Partial<Record<K, T>>;
2
- export type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
3
- export type Replace<T, K extends keyof T, V> = Omit<T, K> & {
4
- [P in K]: V;
5
- };
@@ -1,3 +0,0 @@
1
- export declare function getRandomPairOfColors(): string[];
2
- export declare const colorMap: Record<string, string>;
3
- export declare function isDark(color?: string): boolean;
@@ -1,76 +0,0 @@
1
- export declare enum CartDataSource {
2
- Storefront = "storefront",
3
- Theme = "theme"
4
- }
5
- export declare const REVALIDATE_TIME: number;
6
- export declare const SOLD_OUT_PRICE = 9999999.99;
7
- export declare enum TemplateType {
8
- Page = "page",
9
- Product = "product",
10
- Collection = "collection",
11
- Blog = "blog",
12
- Article = "article"
13
- }
14
- export declare enum DiscountType {
15
- fixedAmount = "fixed_amount",
16
- percentage = "percentage"
17
- }
18
- export declare const createConstants: (config: {
19
- env: string;
20
- brand: string;
21
- locales: string[];
22
- googleClientId?: string;
23
- facebookAppId?: string;
24
- applicationName?: string;
25
- }) => {
26
- locales: string[];
27
- env: string;
28
- applicationName: any;
29
- host: string;
30
- brand: string;
31
- googleClientId: string | undefined;
32
- facebookAppId: string | undefined;
33
- };
34
- export declare const COLOR_LABEL: string[];
35
- export declare enum CouponChannel {
36
- LIGHTNING_DEAL = "LIGHTNING_DEAL",
37
- DEAL = "LIGHTNING_DEAL",
38
- COUPON = "COUPON",
39
- PED = "PED",
40
- WS24 = "WS24",
41
- WSTD = "WSTD",
42
- WSCH = "WSCH"
43
- }
44
- export declare const PRICE_SYMBOL: {
45
- us: string;
46
- uk: string;
47
- ca: string;
48
- eu: string;
49
- pl: string;
50
- fr: string;
51
- de: string;
52
- vn: string;
53
- cl: string;
54
- sg: string;
55
- ae: string;
56
- es: string;
57
- };
58
- export declare const CURRENCY_CODE: {
59
- us: string;
60
- uk: string;
61
- ca: string;
62
- eu: string;
63
- pl: string;
64
- fr: string;
65
- de: string;
66
- vn: string;
67
- cl: string;
68
- es: string;
69
- };
70
- export declare const COUNTRY_CODE: Record<string, string>;
71
- export declare const LANGUAGE_CODE: Record<string, string>;
72
- export declare const CUSTOMER_ATTRIBUTE_KEY = "_discounts_function_env";
73
- export declare const CUSTOMER_SCRIPT_GIFT_KEY = "_giveaway_gradient_gifts";
74
- export declare const CODE_AMOUNT_KEY = "_sku_code_money";
75
- export declare const SCRIPT_CODE_AMOUNT_KEY = "_code_money";
76
- export declare const MAIN_PRODUCT_CODE: string[];
@@ -1,15 +0,0 @@
1
- import { ShopifyConfig, SiteConfig } from '../types/config';
2
- export declare const SHOPIFY_COOKIE_EXPIRE = 30;
3
- export declare const SHOPIFY_CART_COOKIE_EXPIRE = 14;
4
- export declare const getCookieName: (type: string, domain: string, locale: string) => string;
5
- export declare const getCartIdCookieName: ({ shopifyConfig, siteConfig, withLocale, }: {
6
- shopifyConfig: ShopifyConfig;
7
- siteConfig: SiteConfig;
8
- withLocale?: boolean;
9
- }) => string;
10
- export declare const createCartCookieOptions: () => {
11
- domain: string;
12
- expires: number;
13
- };
14
- export declare const setCartCookies: (name: string, value: string) => void;
15
- export declare const removeCartCookies: (name: string) => void;
@@ -1,38 +0,0 @@
1
- export type ErrorData = {
2
- message: string;
3
- code?: string;
4
- };
5
- export type ErrorProps = {
6
- code?: string;
7
- } & ({
8
- message: string;
9
- errors?: never;
10
- } | {
11
- message?: never;
12
- errors: ErrorData[];
13
- });
14
- export declare class CommerceError extends Error {
15
- code?: string;
16
- errors: ErrorData[];
17
- constructor({ message, code, errors }: ErrorProps);
18
- }
19
- export declare class ValidationError extends CommerceError {
20
- constructor(options: ErrorProps);
21
- }
22
- export declare class CommerceFetcherError extends CommerceError {
23
- status: number;
24
- constructor(options: {
25
- status: number;
26
- } & ErrorProps);
27
- }
28
- export declare class FetcherError extends Error {
29
- status: number;
30
- errors: string[];
31
- errorCode: string;
32
- constructor(options: {
33
- status: number;
34
- errors?: string[];
35
- message?: string;
36
- errorCode?: string;
37
- });
38
- }
@@ -1,19 +0,0 @@
1
- import { ShopifyConfig } from '../types/config';
2
- /**
3
- * Graphql Api 接口 fetch 方法
4
- * @param query: 查询语句
5
- * @param variables: 查询参数
6
- * @param config: 店铺配置
7
- * @returns
8
- */
9
- export declare function fetchGraphqlApi<Data, Variables = undefined>({ query, variables, fetchOptions, headers, config, }: {
10
- query: string;
11
- variables?: Variables;
12
- headers?: Record<string, any>;
13
- fetchOptions?: Omit<RequestInit, 'headers' | 'method' | 'body'>;
14
- config: ShopifyConfig;
15
- }): Promise<{
16
- status: number;
17
- data: Data;
18
- errors?: any;
19
- } | never>;
@@ -1,5 +0,0 @@
1
- import { CommerceFetcherError, FetcherError } from './errors';
2
- export declare function getCommerceError(errors: any[] | null, status?: number): CommerceFetcherError;
3
- export declare function getFetcherError(error: string | string[], statusCode: any, errorCode: any): Promise<FetcherError>;
4
- export declare function getAsyncError(res: Response, responseData: any): Promise<FetcherError>;
5
- export declare const handleFetchResponse: (res: Response) => Promise<any>;
@@ -1,28 +0,0 @@
1
- import { HasMetafieldsIdentifier } from '../gql';
2
- import { HasMetafieldQueryRoot } from '../types/fetcher';
3
- import { PartialRecord } from '../utils/type-helper';
4
- import { ProductVariant } from '../types/product';
5
- export declare function isObjEmpty(obj?: Record<string, any>): boolean;
6
- export declare function atobID(id: string): string | undefined;
7
- export declare function btoaID(id: string, type?: 'ProductVariant' | 'Product'): string;
8
- export declare const getThemeLocale: (locale: string) => string;
9
- /**
10
- * 生成 metafieldIdentifiers 查询参数
11
- * {
12
- * product: { namespace: 'product', key: 'img' },
13
- * variant: { namespace: 'variant', key: 'img' }
14
- * }
15
- * =>
16
- * {
17
- * productMetafieldIdentifiers: [{ namespace: 'combo', key: 'product' }]
18
- * variantMetafieldIdentifiers: [{ namespace: 'combo', key: 'variant' }]
19
- * }
20
- */
21
- export declare function constructMetafieldIdentifiersQueryParams<T extends HasMetafieldQueryRoot>(metafieldIdentifiers?: PartialRecord<T, HasMetafieldsIdentifier[]>, metafieldsNamespace?: string): PartialRecord<`${T}MetafieldIdentifiers`, HasMetafieldsIdentifier[]>;
22
- export declare const referralAttributes: () => {
23
- key: string;
24
- value: string;
25
- }[];
26
- export declare const getNormalCoupon: ({ variant }: {
27
- variant?: ProductVariant;
28
- }) => any;
@@ -1,7 +0,0 @@
1
- import { CartLine as ShopifyCartLine } from '../../gql';
2
- import type { Cart, LineItem } from '../../types/cart';
3
- import type { Cart as ShopifyCart } from '../../gql';
4
- export declare function normalizeCart(cart: ShopifyCart, metafieldNamespacePrefix?: string): Cart;
5
- export declare function normalizeLineItem({ node: { id, merchandise: variant, quantity, discountAllocations, attributes, cost }, }: {
6
- node: ShopifyCartLine;
7
- }, metafieldNamespacePrefix?: string): LineItem;
@@ -1,3 +0,0 @@
1
- import { Customer } from '../../types/customer';
2
- import { Customer as ShopifyCustomer } from '../../gql';
3
- export declare function normalizeCustomer(customer: ShopifyCustomer): Customer;
@@ -1,2 +0,0 @@
1
- export * from './cart';
2
- export * from './metafield';
@@ -1,5 +0,0 @@
1
- import { Maybe } from 'graphql/jsutils/Maybe';
2
- import { Metafield } from '../../gql';
3
- export declare const normalizeMetafields: (metafields: Maybe<Metafield>[], metafieldNamespacePrefix: string) => Record<string, any>;
4
- export declare function parseJSON(str: string): any;
5
- export declare const parseMetafield: (metafield: Metafield) => any;
@@ -1,16 +0,0 @@
1
- import { Product as ShopifyProduct, ProductOption } from '../../gql';
2
- import type { Product } from '../../types/product';
3
- export declare const normalizeProductOption: ({ id, name, values, }: ProductOption) => {
4
- __typename: "ProductOption";
5
- id: string;
6
- name: string;
7
- values: {
8
- label: string;
9
- hexColors?: string[];
10
- }[];
11
- };
12
- export declare const getCouponsFromVariantMetafields: ({ metafields, variantId }: {
13
- metafields: any;
14
- variantId: string;
15
- }) => any;
16
- export declare function normalizeProduct(product: ShopifyProduct, metafieldNamespacePrefix?: string): Product;
@@ -1,2 +0,0 @@
1
- import { getThemeLocale } from './helper';
2
- export { getThemeLocale };
@@ -1,5 +0,0 @@
1
- export type PartialRecord<K extends string | number | symbol, T> = Partial<Record<K, T>>;
2
- export type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
3
- export type Replace<T, K extends keyof T, V> = Omit<T, K> & {
4
- [P in K]: V;
5
- };