@jetshop/core 5.17.0-alpha.3f5cbd3a → 5.17.0-alpha.418dfcd7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (253) hide show
  1. package/ChannelHandler/ChannelHandler.js.map +1 -1
  2. package/ChannelHandler/PreserveRedirectRouteQuery.gql +4 -4
  3. package/ChannelHandler/redirectUtils.d.ts +1 -1
  4. package/ChannelHandler/redirectUtils.js +5 -3
  5. package/ChannelHandler/redirectUtils.js.map +1 -1
  6. package/ChannelHandler/redirectUtils.test.js +5 -5
  7. package/ChannelHandler/redirectUtilsGroupedChannels.test.js +5 -5
  8. package/analytics/webVitals.js +5 -5
  9. package/analytics/webVitals.js.map +1 -1
  10. package/boot/NetworkStatusNotifier.d.ts +2 -0
  11. package/boot/NetworkStatusNotifier.js +4 -0
  12. package/boot/NetworkStatusNotifier.js.map +1 -0
  13. package/boot/SharedTree.d.ts +1 -1
  14. package/boot/SharedTree.js +1 -1
  15. package/boot/SharedTree.js.map +1 -1
  16. package/boot/apollo.d.ts +1 -2
  17. package/boot/apollo.js +13 -8
  18. package/boot/apollo.js.map +1 -1
  19. package/boot/client/startClient.js +8 -2
  20. package/boot/client/startClient.js.map +1 -1
  21. package/boot/server/IntervalQuery.d.ts +1 -1
  22. package/boot/server/IntervalQuery.js +2 -2
  23. package/boot/server/IntervalQuery.js.map +1 -1
  24. package/boot/server/IntervalQuery.test.js +9 -13
  25. package/boot/server/PersistedApolloClient.test.js +8 -7
  26. package/boot/server/createApolloServer.d.ts +2 -1
  27. package/boot/server/createApolloServer.js +5 -5
  28. package/boot/server/createApolloServer.js.map +1 -1
  29. package/boot/server/createRenderer.js +4 -2
  30. package/boot/server/createRenderer.js.map +1 -1
  31. package/boot/server/entrypoint.js +7 -4
  32. package/boot/server/entrypoint.js.map +1 -1
  33. package/boot/server/persistedQueries/__tests__/getPersistedQueriesForRequest.test.js +1 -1
  34. package/boot/utils/queryLoggingMiddleware.d.ts +1 -1
  35. package/boot/utils/queryLoggingMiddleware.js +2 -2
  36. package/boot/utils/queryLoggingMiddleware.js.map +1 -1
  37. package/cart/AddToCartFormik.d.ts +2 -2
  38. package/cart/AddToCartFormik.js +2 -2
  39. package/cart/AddToCartFormik.js.map +1 -1
  40. package/cart/useAddToCart.d.ts +1 -1
  41. package/components/Auth/ForgotPasswordProvider.d.ts +3 -3
  42. package/components/Auth/ForgotPasswordProvider.js +1 -1
  43. package/components/Auth/ForgotPasswordProvider.js.map +1 -1
  44. package/components/Auth/ResetPasswordProvider.d.ts +5 -3
  45. package/components/Auth/ResetPasswordProvider.js +1 -1
  46. package/components/Auth/ResetPasswordProvider.js.map +1 -1
  47. package/components/Auth/SSN.js +4 -4
  48. package/components/Auth/SSN.js.map +1 -1
  49. package/components/Auth/SignupFormContainer.d.ts +2 -2
  50. package/components/Auth/UpdatePasswordForm.js +6 -6
  51. package/components/Auth/UpdatePasswordForm.js.map +1 -1
  52. package/components/Auth/signup-context.d.ts +2 -2
  53. package/components/Auth/signup-context.js +2 -3
  54. package/components/Auth/signup-context.js.map +1 -1
  55. package/components/Auth/signupSubmit.js +4 -4
  56. package/components/Auth/signupSubmit.js.map +1 -1
  57. package/components/Auth/useAddressFields.js +3 -3
  58. package/components/Auth/useAddressFields.js.map +1 -1
  59. package/components/Auth/useAddressFields.test.js +10 -8
  60. package/components/Auth/useCustomer.d.ts +2 -2
  61. package/components/Auth/useCustomer.js +1 -1
  62. package/components/Auth/useCustomer.js.map +1 -1
  63. package/components/AuthContext/AuthProvider.js +2 -2
  64. package/components/AuthContext/AuthProvider.js.map +1 -1
  65. package/components/AuthContext/AuthProvider.test.js +1 -1
  66. package/components/AuthContext/LogOut.d.ts +2 -2
  67. package/components/ChannelContext/ChannelProvider.d.ts +1 -1
  68. package/components/ChannelContext/useCountrySettings.d.ts +1 -1
  69. package/components/ChannelContext/useCountrySettings.js +1 -1
  70. package/components/ChannelContext/useCountrySettings.js.map +1 -1
  71. package/components/DynamicRoute/ActiveFiltersQuery.gql +4 -4
  72. package/components/DynamicRoute/CategoryRoute.d.ts +3 -3
  73. package/components/DynamicRoute/CategoryRoute.js +6 -3
  74. package/components/DynamicRoute/CategoryRoute.js.map +1 -1
  75. package/components/DynamicRoute/ContentRoute.d.ts +1 -1
  76. package/components/DynamicRoute/GenericError.d.ts +18 -0
  77. package/components/DynamicRoute/GenericError.js +61 -0
  78. package/components/DynamicRoute/GenericError.js.map +1 -0
  79. package/components/DynamicRoute/PreviewRoute.d.ts +1 -1
  80. package/components/DynamicRoute/PreviewRoute.js +1 -1
  81. package/components/DynamicRoute/PreviewRoute.js.map +1 -1
  82. package/components/DynamicRoute/ProductByArticlenumber.d.ts +2 -2
  83. package/components/DynamicRoute/ProductByArticlenumber.js +2 -2
  84. package/components/DynamicRoute/ProductByArticlenumber.js.map +1 -1
  85. package/components/DynamicRoute/ProductRoute.d.ts +3 -3
  86. package/components/DynamicRoute/RouteResolver.d.ts +2 -2
  87. package/components/DynamicRoute/RouteResolver.js +2 -1
  88. package/components/DynamicRoute/RouteResolver.js.map +1 -1
  89. package/components/DynamicRoute/Status.d.ts +2 -2
  90. package/components/DynamicRoute/index.d.ts +4 -4
  91. package/components/DynamicRoute/index.js +47 -42
  92. package/components/DynamicRoute/index.js.map +1 -1
  93. package/components/Filters/utils/replaceInSearch.d.ts +1 -1
  94. package/components/Filters/utils/replaceInSearch.js.map +1 -1
  95. package/components/Mutation/AddToCartFormik.d.ts +1 -1
  96. package/components/Mutation/AddToCartFormik.js +2 -2
  97. package/components/Mutation/AddToCartFormik.js.map +1 -1
  98. package/components/Mutation/DecrementQuantity.d.ts +2 -2
  99. package/components/Mutation/DecrementQuantity.js +1 -1
  100. package/components/Mutation/DecrementQuantity.js.map +1 -1
  101. package/components/Mutation/IncrementQuantity.d.ts +2 -2
  102. package/components/Mutation/IncrementQuantity.js +1 -1
  103. package/components/Mutation/IncrementQuantity.js.map +1 -1
  104. package/components/Mutation/RemoveFromCart.d.ts +2 -2
  105. package/components/Mutation/RemoveFromCart.js +1 -1
  106. package/components/Mutation/RemoveFromCart.js.map +1 -1
  107. package/components/Mutation/SetQuantity.d.ts +2 -2
  108. package/components/Mutation/SetQuantity.js +1 -1
  109. package/components/Mutation/SetQuantity.js.map +1 -1
  110. package/components/Mutation/SubscribeToNewsletter.d.ts +1 -1
  111. package/components/Mutation/SubscribeToNewsletter.js +1 -1
  112. package/components/Mutation/SubscribeToNewsletter.js.map +1 -1
  113. package/components/Mutation/SubscribeToStockNotifications.d.ts +1 -1
  114. package/components/Mutation/SubscribeToStockNotifications.js +6 -2
  115. package/components/Mutation/SubscribeToStockNotifications.js.map +1 -1
  116. package/components/Mutation/cartMutationUtils.d.ts +1 -2
  117. package/components/Mutation/cartMutationUtils.js.map +1 -1
  118. package/components/Mutation/useDecrementQuantity.d.ts +1 -1
  119. package/components/Mutation/useDecrementQuantity.js +1 -1
  120. package/components/Mutation/useDecrementQuantity.js.map +1 -1
  121. package/components/Mutation/useIncrementQuantity.d.ts +1 -1
  122. package/components/Mutation/useIncrementQuantity.js +1 -1
  123. package/components/Mutation/useIncrementQuantity.js.map +1 -1
  124. package/components/Mutation/useRemoveFromCart.d.ts +1 -1
  125. package/components/Mutation/useRemoveFromCart.js +1 -1
  126. package/components/Mutation/useRemoveFromCart.js.map +1 -1
  127. package/components/Mutation/useSetQuantity.d.ts +1 -1
  128. package/components/Mutation/useSetQuantity.js +1 -1
  129. package/components/Mutation/useSetQuantity.js.map +1 -1
  130. package/components/Notifications/Notifications.d.ts +3 -3
  131. package/components/Notifications/Notifications.js +2 -3
  132. package/components/Notifications/Notifications.js.map +1 -1
  133. package/components/ProductConfigurationProvider/ProductConfigurationProvider.js +6 -6
  134. package/components/ProductConfigurationProvider/ProductConfigurationProvider.js.map +1 -1
  135. package/components/Query/CartProvider.d.ts +1 -1
  136. package/components/Query/CartProvider.js +1 -1
  137. package/components/Query/CartProvider.js.map +1 -1
  138. package/components/SortOrder/SortOrderContainer.d.ts +1 -1
  139. package/components/StructuredData/StructuredBreadcrumbData.d.ts +2 -2
  140. package/data/cache.d.ts +1 -1
  141. package/data/cache.js +62 -12
  142. package/data/cache.js.map +1 -1
  143. package/data/fragments/StockStatusFragment.gql +1 -0
  144. package/global.d.ts +6 -0
  145. package/helpers/getErrorDetail.d.ts +1 -1
  146. package/helpers/getErrorDetail.js +2 -2
  147. package/helpers/getErrorDetail.js.map +1 -1
  148. package/hooks/Filters/useBooleanFilter.d.ts +1 -1
  149. package/hooks/Filters/useBooleanFilter.js +1 -2
  150. package/hooks/Filters/useBooleanFilter.js.map +1 -1
  151. package/hooks/Filters/useFilters.d.ts +1 -1
  152. package/hooks/Filters/useFilters.js +1 -2
  153. package/hooks/Filters/useFilters.js.map +1 -1
  154. package/hooks/Filters/useListFilter.d.ts +2 -2
  155. package/hooks/Filters/useListFilter.js +1 -2
  156. package/hooks/Filters/useListFilter.js.map +1 -1
  157. package/hooks/Filters/useMultiFilter.d.ts +3 -3
  158. package/hooks/Filters/useMultiFilter.js +1 -2
  159. package/hooks/Filters/useMultiFilter.js.map +1 -1
  160. package/hooks/Filters/useRangeFilter.d.ts +2 -2
  161. package/hooks/Filters/useRangeFilter.js +1 -2
  162. package/hooks/Filters/useRangeFilter.js.map +1 -1
  163. package/hooks/Filters/useSortOrder.d.ts +6 -1
  164. package/hooks/Filters/useSortOrder.js.map +1 -1
  165. package/hooks/PackageProducts/usePackageProductItem.d.ts +1 -1
  166. package/hooks/PackageProducts/usePackageProductItem.js +1 -1
  167. package/hooks/PackageProducts/usePackageProductItem.js.map +1 -1
  168. package/hooks/PackageProducts/usePackageProducts.js +17 -17
  169. package/hooks/PackageProducts/usePackageProducts.js.map +1 -1
  170. package/hooks/PackageProducts/usePackageProducts.test.js +1 -1
  171. package/hooks/ProductList/ProductListContext.js +1 -1
  172. package/hooks/ProductList/ProductListContext.js.map +1 -1
  173. package/hooks/ProductList/action-creators.d.ts +1 -1
  174. package/hooks/ProductList/index.d.ts +1 -1
  175. package/hooks/ProductList/list-transforms.js +1 -1
  176. package/hooks/ProductList/list-transforms.js.map +1 -1
  177. package/hooks/ProductList/product-list-reducer.js +1 -1
  178. package/hooks/ProductList/product-list-reducer.js.map +1 -1
  179. package/hooks/ProductList/useProductList.js +1 -1
  180. package/hooks/ProductList/useProductList.js.map +1 -1
  181. package/hooks/ProductList/useProductListItems.js +1 -1
  182. package/hooks/ProductList/useProductListItems.js.map +1 -1
  183. package/hooks/Subscriptions/useNewsletterSubscription.js +3 -3
  184. package/hooks/Subscriptions/useNewsletterSubscription.js.map +1 -1
  185. package/hooks/Subscriptions/useStockNotifications.d.ts +1 -1
  186. package/hooks/Subscriptions/useStockNotifications.js +3 -3
  187. package/hooks/Subscriptions/useStockNotifications.js.map +1 -1
  188. package/hooks/Subscriptions/useStoreSubscriptions.d.ts +1 -1
  189. package/hooks/Subscriptions/useStoreSubscriptions.js +3 -6
  190. package/hooks/Subscriptions/useStoreSubscriptions.js.map +1 -1
  191. package/hooks/Subscriptions/useStoresubscriptions.test.js +5 -7
  192. package/hooks/useAddMultipleToCart.d.ts +1 -1
  193. package/hooks/useAddMultipleToCart.js +1 -1
  194. package/hooks/useAddMultipleToCart.js.map +1 -1
  195. package/hooks/useAddMultipleToCart.test.js +1 -1
  196. package/hooks/useCustomerOrders.test.js +7 -5
  197. package/hooks/useCustomerOrdersQuery.d.ts +2 -2
  198. package/hooks/useCustomerOrdersQuery.js +1 -1
  199. package/hooks/useCustomerOrdersQuery.js.map +1 -1
  200. package/hooks/useDeleteAccountMutation.js +3 -3
  201. package/hooks/useDeleteAccountMutation.js.map +1 -1
  202. package/hooks/useInfinitePagination.d.ts +1 -1
  203. package/hooks/useInfinitePagination.js +4 -1
  204. package/hooks/useInfinitePagination.js.map +1 -1
  205. package/hooks/useLoginMutation.d.ts +3 -3
  206. package/hooks/useLoginMutation.js +2 -2
  207. package/hooks/useLoginMutation.js.map +1 -1
  208. package/hooks/useLoginRedirect.js +2 -2
  209. package/hooks/useLoginRedirect.js.map +1 -1
  210. package/hooks/useOrderDetailQuery.d.ts +3 -3
  211. package/hooks/useOrderDetailQuery.js +1 -1
  212. package/hooks/useOrderDetailQuery.js.map +1 -1
  213. package/hooks/useRoutePreload.js +1 -1
  214. package/hooks/useRoutePreload.js.map +1 -1
  215. package/hooks/useStockStatus.d.ts +8 -0
  216. package/hooks/useStockStatus.js +26 -0
  217. package/hooks/useStockStatus.js.map +1 -0
  218. package/integrations/sluggishSchemaExtension.js +1 -1
  219. package/integrations/sluggishSchemaExtension.js.map +1 -1
  220. package/package.json +15 -32
  221. package/polyfills.js +0 -2
  222. package/polyfills.js.map +1 -1
  223. package/resolvers/filters/boolFilter.js +24 -27
  224. package/resolvers/filters/boolFilter.js.map +1 -1
  225. package/resolvers/filters/filterParams.js +8 -8
  226. package/resolvers/filters/filterParams.js.map +1 -1
  227. package/resolvers/filters/filters.js +5 -5
  228. package/resolvers/filters/filters.js.map +1 -1
  229. package/resolvers/filters/index.d.ts +0 -4
  230. package/resolvers/filters/listFilter.js +24 -29
  231. package/resolvers/filters/listFilter.js.map +1 -1
  232. package/resolvers/filters/listFilterItem.js +21 -27
  233. package/resolvers/filters/listFilterItem.js.map +1 -1
  234. package/resolvers/filters/multiListFilter.js +41 -42
  235. package/resolvers/filters/multiListFilter.js.map +1 -1
  236. package/resolvers/filters/multiListFilterList.js +1 -1
  237. package/resolvers/filters/multiListFilterList.js.map +1 -1
  238. package/resolvers/filters/rangeFilter.js +27 -43
  239. package/resolvers/filters/rangeFilter.js.map +1 -1
  240. package/test-utils/ProviderPyramid.js +1 -1
  241. package/types.d.ts +1820 -1955
  242. package/components/Fonts/GoogleFont.d.ts +0 -10
  243. package/components/Fonts/GoogleFont.js +0 -35
  244. package/components/Fonts/GoogleFont.js.map +0 -1
  245. package/components/Fonts/TypekitFont.d.ts +0 -16
  246. package/components/Fonts/TypekitFont.js +0 -25
  247. package/components/Fonts/TypekitFont.js.map +0 -1
  248. package/integrations/addwishSchemaExtension.d.ts +0 -35
  249. package/integrations/addwishSchemaExtension.js +0 -141
  250. package/integrations/addwishSchemaExtension.js.map +0 -1
  251. package/integrations/nostoSchemaExtension.d.ts +0 -5
  252. package/integrations/nostoSchemaExtension.js +0 -77
  253. package/integrations/nostoSchemaExtension.js.map +0 -1
@@ -9,7 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { useMutation } from 'react-apollo';
12
+ import { useMutation } from '@apollo/client';
13
13
  import subscribeToNewsletterMutation from '@jetshop/core/data/mutations/subscribeToNewsletter.gql';
14
14
  import { useStoreSubscriptions } from './useStoreSubscriptions';
15
15
  function useNewsletterSubscription({ enabled }) {
@@ -26,8 +26,8 @@ function useNewsletterSubscription({ enabled }) {
26
26
  email: fields.email
27
27
  }
28
28
  })
29
- .then(data => resolve(data))
30
- .catch(error => reject(error));
29
+ .then((data) => resolve(data))
30
+ .catch((error) => reject(error));
31
31
  });
32
32
  }
33
33
  const errorStates = {
@@ -1 +1 @@
1
- {"version":3,"file":"useNewsletterSubscription.js","sourceRoot":"","sources":["useNewsletterSubscription.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,6BAA6B,MAAM,wDAAwD,CAAC;AACnG,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAGhE,SAAS,yBAAyB,CAAC,EAAE,OAAO,EAAyB;;IACnE,MAAM,CAAC,iBAAiB,CAAC,GAAG,WAAW,CAGrC,6BAA6B,CAAC,CAAC;IAEjC,MAAM,KAAoC,qBAAqB,CAAC;QAC9D,QAAQ,EAAE,EAAE,SAAS,EAAE;QACvB,OAAO;KACR,CAAC,EAHI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,OAG1B,EAH+B,IAAI,cAA/B,4BAAiC,CAGrC,CAAC;IAEH,SAAS,SAAS;QAChB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,OAAO,iBAAiB,CAAC;gBACvB,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,cAA/B,4BAAiC,CAGrC,CAAC;IAEH,SAAS,SAAS;QAChB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,OAAO,iBAAiB,CAAC;gBACvB,SAAS,EAAE;oBACT,KAAK,EAAE,MAAM,CAAC,KAAK;iBACpB;aACF,CAAC;iBACC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;iBAC7B,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACL,CAAC;IAED,MAAM,WAAW,GAAG;QAClB,YAAY,EACV,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,+BAA+B,CAAC;QACzE,iBAAiB,EACf,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,mBAAmB,CAAC;KAC9D,CAAC;IAEF,MAAM,UAAU,mCACX,KAAK,KACR,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,MAAA,MAAM,CAAC,KAAK,mCAAI,EAAE,GAC1B,CAAC;IAEF,qDACK,MAAM,GACN,IAAI,KACP,UAAU;QACV,WAAW,IACX;AACJ,CAAC;AAED,OAAO,EAAE,yBAAyB,EAAE,CAAC"}
@@ -19,7 +19,7 @@ declare function useStockNotifications({ articleNumber, enabled }: {
19
19
  context: import("./useStoreSubscriptions").SubscribeContext;
20
20
  }>;
21
21
  };
22
- error: string[] | import("apollo-client").ApolloError;
22
+ error: string[] | import("@apollo/client").ApolloError;
23
23
  toggle: () => import("xstate").State<import("./useStoreSubscriptions").SubscribeContext, import("xstate").AnyEventObject, any, {
24
24
  value: any;
25
25
  context: import("./useStoreSubscriptions").SubscribeContext;
@@ -9,7 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { useMutation } from 'react-apollo';
12
+ import { useMutation } from '@apollo/client';
13
13
  import subscribeToStockNotificationsMutation from '@jetshop/core/data/mutations/subscribeToStockNotifications.gql';
14
14
  import { useStoreSubscriptions } from './useStoreSubscriptions';
15
15
  function useStockNotifications({ articleNumber, enabled = false }) {
@@ -27,8 +27,8 @@ function useStockNotifications({ articleNumber, enabled = false }) {
27
27
  email: fields.email
28
28
  }
29
29
  })
30
- .then(data => resolve(data))
31
- .catch(error => reject(error));
30
+ .then((data) => resolve(data))
31
+ .catch((error) => reject(error));
32
32
  });
33
33
  }
34
34
  const inputProps = Object.assign(Object.assign({}, input), { name: 'email', value: (_a = fields.email) !== null && _a !== void 0 ? _a : '' });
@@ -1 +1 @@
1
- {"version":3,"file":"useStockNotifications.js","sourceRoot":"","sources":["useStockNotifications.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,qCAAqC,MAAM,gEAAgE,CAAC;AACnH,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAMhE,SAAS,qBAAqB,CAAC,EAC7B,aAAa,EACb,OAAO,GAAG,KAAK,EAIhB;;IACC,MAAM,CAAC,iBAAiB,CAAC,GAAG,WAAW,CAGrC,qCAAqC,CAAC,CAAC;IAEzC,MAAM,KAA6B,qBAAqB,CAAC;QACvD,QAAQ,EAAE,EAAE,SAAS,EAAE;QACvB,OAAO;KACR,CAAC,EAHI,EAAE,MAAM,EAAE,KAAK,OAGnB,EAHwB,IAAI,cAAxB,mBAA0B,CAG9B,CAAC;IAEH,SAAS,SAAS;QAChB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,OAAO,iBAAiB,CAAC;gBACvB,SAAS,EAAE;oBACT,aAAa;oBACb,KAAK,EAAE,MAAM,CAAC,KAAK;iBACpB;aACF,CAAC;iBACC,IAAI,CAAC,IAAI,CAAC,EA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AAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACL,CAAC;IAED,MAAM,UAAU,mCACX,KAAK,KACR,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,MAAA,MAAM,CAAC,KAAK,mCAAI,EAAE,GAC1B,CAAC;IAEF,qDACK,MAAM,GACN,IAAI,KACP,UAAU,IACV;AACJ,CAAC;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
@@ -1,4 +1,4 @@
1
- import { ApolloError } from 'apollo-client';
1
+ import { ApolloError } from '@apollo/client';
2
2
  import { ChangeEvent } from 'react';
3
3
  import { AnyEventObject, ServiceConfig } from 'xstate';
4
4
  export interface SubscribeContext {
@@ -11,7 +11,7 @@ const setError = assign({
11
11
  error: (_, event) => event.data
12
12
  });
13
13
  const interpretError = assign({
14
- error: context => getErrorDetail(context.error).codes
14
+ error: (context) => getErrorDetail(context.error).codes
15
15
  });
16
16
  const unsetError = assign({ error: null });
17
17
  const unsetFields = assign({ fields: {} });
@@ -117,7 +117,7 @@ function useStoreSubscriptions({ services, enabled }) {
117
117
  key: event.target.name,
118
118
  value: event.target.value
119
119
  }), [send]);
120
- const submit = useCallback(e => {
120
+ const submit = useCallback((e) => {
121
121
  e.preventDefault();
122
122
  send('TRY_SUBMIT');
123
123
  }, [send]);
@@ -132,10 +132,7 @@ function useStoreSubscriptions({ services, enabled }) {
132
132
  failed: current.matches('failed')
133
133
  }), [current]);
134
134
  const { inactive } = states;
135
- const toggle = useCallback(() => send(inactive ? 'ACTIVATE' : 'INACTIVATE'), [
136
- inactive,
137
- send
138
- ]);
135
+ const toggle = useCallback(() => send(inactive ? 'ACTIVATE' : 'INACTIVATE'), [inactive, send]);
139
136
  const input = {
140
137
  onFocus,
141
138
  onBlur,
@@ -1 +1 @@
1
- {"version":3,"file":"useStoreSubscriptions.js","sourceRoot":"","sources":["useStoreSubscriptions.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,sC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;QACN,MAAM;QACN,MAAM,IACN;AACJ,CAAC;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
@@ -1,12 +1,10 @@
1
1
  import { act, renderHook } from '@testing-library/react-hooks';
2
- import { InMemoryCache } from 'apollo-cache-inmemory';
3
- import { ApolloClient } from 'apollo-client';
4
- import { MockLink } from 'apollo-link-mock';
2
+ import { ApolloClient, ApolloProvider, InMemoryCache } from '@apollo/client';
3
+ import { MockLink } from '@apollo/client';
5
4
  import React from 'react';
6
- import { ApolloProvider } from 'react-apollo';
7
5
  import { useStoreSubscriptions } from './useStoreSubscriptions';
8
6
 
9
- const wrapper = props => <WithApolloProvider {...props} />;
7
+ const wrapper = (props) => <WithApolloProvider {...props} />;
10
8
 
11
9
  const event = {
12
10
  preventDefault: () => null
@@ -113,7 +111,7 @@ describe('useStoreSubscriptions', () => {
113
111
  useStoreSubscriptions({
114
112
  ...subscriptionArgs,
115
113
  services: {
116
- trySubmit: data => Promise.resolve(data)
114
+ trySubmit: (data) => Promise.resolve(data)
117
115
  }
118
116
  }),
119
117
  wrapper
@@ -145,7 +143,7 @@ describe('useStoreSubscriptions', () => {
145
143
  useStoreSubscriptions({
146
144
  ...subscriptionArgs,
147
145
  services: {
148
- trySubmit: error => Promise.reject(error)
146
+ trySubmit: (error) => Promise.reject(error)
149
147
  }
150
148
  }),
151
149
  wrapper
@@ -1,4 +1,4 @@
1
- import { FetchResult, DocumentNode } from 'apollo-link';
1
+ import { FetchResult, DocumentNode } from '@apollo/client';
2
2
  import { CartMutation, AddMultipleToCartInput, Product } from '../types';
3
3
  type AddMultipleToCartMutationResponse = FetchResult<{
4
4
  addMultipleToCart: CartMutation;
@@ -1,4 +1,4 @@
1
- import { useApolloClient } from '@apollo/react-hooks';
1
+ import { useApolloClient } from '@apollo/client';
2
2
  import { CartIdContext } from '@jetshop/core/components/Cart/CartIdContext';
3
3
  import { useContext, useState } from 'react';
4
4
  import throwErrorInDev from '../helpers/throwErrorInDev';
@@ -1 +1 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B,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,OAAO,KAAI,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YAC7C,iEAAiE;YACjE,qBAAqB;YACrB,gGAAgG;QAClG,CAAC,CAA0D,CAAC;IAChE,CAAC;IAED,+EAA+E;IAC/E,6EAA6E;IAC7E,0EAA0E;IAC1E,0CAA0C;IAC1C,MAAM,WAAW,GAA8C,IAAI,GAAG,EAAE,CAAC;IAEzE,IAAI,MAAM,KAAK,gBAAgB,EAAE;QAC/B,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE;YAC/B,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAEhD,WAAW,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;SAC9C;KACF;IACD,8BAA8B;IAE9B,sDAAsD;IACtD,OAAO;QACL,WAAW;QACX;YACE,OAAO,EAAE,MAAM,KAAK,SAAS;YAC7B,MAAM,EAAE,MAAM,KAAK,MAAM;YACzB,KAAK,EAAE,MAAM,KAAK,OAAO;YACzB,IAAI;YACJ,WAAW;SACZ;KACF,CAAC;AACJ,CAAC"}
@@ -1,5 +1,5 @@
1
+ import { gql } from '@apollo/client';
1
2
  import { act, renderHook } from '@testing-library/react-hooks';
2
- import gql from 'graphql-tag';
3
3
  import { ProviderPyramid } from 'ProviderPyramid';
4
4
  import React from 'react';
5
5
  import { CartIdProvider } from '../components/Cart/CartIdContext';
@@ -1,9 +1,11 @@
1
- import { InMemoryCache } from 'apollo-cache-inmemory';
2
- import { ApolloClient } from 'apollo-client';
3
- import { MockLink } from 'apollo-link-mock';
4
- import gql from 'graphql-tag';
1
+ import {
2
+ ApolloClient,
3
+ ApolloProvider,
4
+ InMemoryCache,
5
+ gql
6
+ } from '@apollo/client';
7
+ import { MockLink } from '@apollo/client';
5
8
  import * as React from 'react';
6
- import { ApolloProvider } from 'react-apollo';
7
9
  import { render, wait, cleanup } from '@testing-library/react';
8
10
  import useCustomerOrders from './useCustomerOrdersQuery';
9
11
  import throwErrorInDev from '../helpers/throwErrorInDev';
@@ -11,11 +11,11 @@ interface UseCustomerOrdersQuery {
11
11
  export default function useCustomerOrdersQuery({ query, variables }: UseCustomerOrdersQuery): {
12
12
  loading: boolean;
13
13
  orders: OrderHeader[];
14
- result: import("react-apollo").QueryResult<{
14
+ result: import("@apollo/client").QueryResult<{
15
15
  customer: {
16
16
  orderHeaders: OrderHeaderResult;
17
17
  };
18
- }, import("react-apollo").OperationVariables>;
18
+ }, import("@apollo/client").OperationVariables>;
19
19
  totalOrders: number;
20
20
  };
21
21
  export {};
@@ -1,4 +1,4 @@
1
- import { useQuery } from '@apollo/react-hooks';
1
+ import { useQuery } from '@apollo/client';
2
2
  import throwErrorInDev from '../helpers/throwErrorInDev';
3
3
  /**
4
4
  * Takes in the orderHeaders query and optional query variables, and returns
@@ -1 +1 @@
1
- {"version":3,"file":"useCustomerOrdersQuery.js","sourceRoot":"","sources":["useCustomerOrdersQuery.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,eAAe,MAAM,4BAA4B,CAAC;AAYzD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAC7C,KAAK,EACL,SAAS,EACc;;IACvB,MAAM,MAAM,GAAG,QAAQ,CACrB,KAAK,EACL,EAAE,SAAS,EAAE,CACd,CAAC;IACF,eAAe,CACb,CAAC,MAAM,CAAC,OAAO,IAAI,CAAC,CAAA,MAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,0CAAE,QAAQ,0CAAE,YAAY,CAAA,EACxD,uEAAuE,CACxE,CAAC;IAEF,MAAM,MAAM,GACV,MAAA,MAAA,MAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,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MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI;QACvC,MAAM;QACN,MAAM;QACN,WAAW;KACZ,CAAC;AACJ,CAAC"}
@@ -1,5 +1,5 @@
1
+ import { useMutation } from '@apollo/client';
1
2
  import { useState } from 'react';
2
- import { useMutation } from '@apollo/react-hooks';
3
3
  import useAuth from '../components/AuthContext/useAuth';
4
4
  import t from '@jetshop/intl';
5
5
  import { deleteAccount } from '@jetshop/core/data/mutations/accountMutations.gql';
@@ -17,7 +17,7 @@ const useDeleteAccountMutation = function useDeleteAccountMutation({ confirmatio
17
17
  return;
18
18
  }
19
19
  mutate()
20
- .then(r => {
20
+ .then((r) => {
21
21
  // response is a boolean. If it is false, `something` went wrong… but we
22
22
  // don't have an error from the API to display
23
23
  if (r.data.deleteCustomer) {
@@ -28,7 +28,7 @@ const useDeleteAccountMutation = function useDeleteAccountMutation({ confirmatio
28
28
  handleMutationError();
29
29
  }
30
30
  })
31
- .catch(err => {
31
+ .catch((err) => {
32
32
  console.warn(err);
33
33
  handleMutationError();
34
34
  });
@@ -1 +1 @@
1
- {"version":3,"file":"useDeleteAccountMutation.js","sourceRoot":"","sources":["useDeleteAccountMutation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,OAAO,MAAM,mCAAmC,CAAC;AAExD,OAAO,CAAC,MAAM,eAAe,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,mDAAmD,CAAC;AAgBlF,MAAM,wBAAwB,GAA6B,SAAS,wBAAwB,CAAC,EAC3F,mBAAmB,EACpB;IACC,MAAM,CAAC,MAAM,CAAC,GAAG,WAAW,CAC1B,aAAa,CACd,CAAC;IAEF,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,CAAC;IAC7B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KA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AAC,MAAM,CAAC,GAAG,WAAW,CAEzB,aAAa,CAAC,CAAC;IAElB,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,CAAC;IAC7B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,EAAE,CAAC;IAErC,SAAS,mBAAmB;QAC1B,QAAQ,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC;IACtC,CAAC;IAED,SAAS,eAAe;QACtB,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CACjC,mBAAmB,IAAI,+CAA+C,CACvE,CAAC;QAEF,IAAI,CAAC,YAAY,EAAE;YACjB,OAAO;SACR;QAED,MAAM,EAAE;aACL,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;YACV,wEAAwE;YACxE,8CAA8C;YAC9C,IAAI,CAAC,CAAC,IAAI,CAAC,cAAc,EAAE;gBACzB,UAAU,CAAC,IAAI,CAAC,CAAC;gBACjB,MAAM,EAAE,CAAC;aACV;iBAAM;gBACL,mBAAmB,EAAE,CAAC;aACvB;QACH,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YACb,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAClB,mBAAmB,EAAE,CAAC;QACxB,CAAC,CAAC,CAAC;IACP,CAAC;IAED,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAC7C,CAAC,CAAC;AAEJ,OAAO,EAAE,wBAAwB,EAAE,CAAC"}
@@ -1,6 +1,6 @@
1
- import { QueryResult } from 'react-apollo';
2
1
  import { DocumentNode } from 'graphql';
3
2
  import { Route, SearchResult, Category } from '../types';
3
+ import { QueryResult } from '@apollo/client';
4
4
  interface QueryVariables {
5
5
  offset: number;
6
6
  first?: number;
@@ -1,6 +1,6 @@
1
1
  import { useCallback, useContext, useEffect, useReducer, useMemo, useRef } from 'react';
2
2
  import PaginationContext from '@jetshop/core/components/Pagination/PaginationContext';
3
- import { useApolloClient } from 'react-apollo';
3
+ import { useApolloClient } from '@apollo/client';
4
4
  function getProductsFromPreviousPages(products, client, query, variables) {
5
5
  var _a, _b, _c, _d, _e;
6
6
  const nextVariables = Object.assign(Object.assign({}, variables), { offset: variables.offset - (variables.first || variables.limit) });
@@ -23,6 +23,9 @@ function getProductsFromNextPages(products, client, query, variables) {
23
23
  query,
24
24
  variables: nextVariables
25
25
  });
26
+ if (!res) {
27
+ throw new Error('No data');
28
+ }
26
29
  return getProductsFromNextPages(products.concat(((_c = (_b = (_a = res === null || res === void 0 ? void 0 : res.route) === null || _a === void 0 ? void 0 : _a.object) === null || _b === void 0 ? void 0 : _b.products) === null || _c === void 0 ? void 0 : _c.result) || ((_e = (_d = res === null || res === void 0 ? void 0 : res.search) === null || _d === void 0 ? void 0 : _d.products) === null || _e === void 0 ? void 0 : _e.result)), client, query, nextVariables);
27
30
  }
28
31
  catch (e) {
@@ -1 +1 @@
1
- {"version":3,"file":"useInfinitePagination.js","sourceRoot":"","sources":["useInfinitePagination.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,UAAU,EACV,SAAS,EACT,UAAU,EACV,OAAO,EACP,MAAM,EACP,MAAM,OAAO,CAAC;AACf,OAAO,iBAAiB,MAAM,uDAAuD,CAAC;AACtF,OAAO,EAAE,eAAe,EAAe,MAAM,cAAc,CAAC;AAW5D,SAAS,4BAA4B,CACnC,QAAmB,EACnB,MAA4B,EAC5B,KAAmB,EACnB,SAAyB;;IAEzB,MAAM,aAAa,mCACd,SAAS,KACZ,MAAM,EAAE,SAAS,CAAC,MAAM,GAAG,CAAC,SAAS,CAAC,KAAK,IAAI,SAAS,CAAC,KAAK,CAAC,GAChE,CAAC;IAEF,IAAI;QACF,MAAM,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC;YAC3B,KAAK;YACL,SAAS,EAAE,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AI;YAC7B,WAAW,EAAE,UAAU,GAAG,YAAY;YACtC,aAAa,EAAE,GAAG,EAAE,CAAC,qBAAqB,CAAC,UAAU,CAAC;YACtD,MAAM,EAAE,UAAU;YAClB,IAAI,EAAE,UAAU,GAAG,OAAO,GAAG,CAAC;SAC/B;QACD,QAAQ,EAAE,gBAAgB;KAC3B,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -1,12 +1,12 @@
1
1
  import { LoginResponse } from '../types';
2
2
  declare const useLoginMutation: () => {
3
- loginMutation: (options?: import("react-apollo").MutationFunctionOptions<{
3
+ loginMutation: (options?: import("@apollo/client").MutationFunctionOptions<{
4
4
  login: LoginResponse;
5
5
  }, {
6
6
  email: string;
7
7
  password: string;
8
- }>) => Promise<import("react-apollo").ExecutionResult<{
8
+ }, import("@apollo/client").DefaultContext, import("@apollo/client").ApolloCache<any>>) => Promise<import("@apollo/client").FetchResult<{
9
9
  login: LoginResponse;
10
- }>>;
10
+ }, Record<string, any>, Record<string, any>>>;
11
11
  };
12
12
  export { useLoginMutation };
@@ -1,11 +1,11 @@
1
1
  import { useContext } from 'react';
2
- import { useMutation } from 'react-apollo';
2
+ import { useMutation } from '@apollo/client';
3
3
  import { login } from '@jetshop/core/data/mutations/accountMutations.gql';
4
4
  import AuthContext from '../components/AuthContext/AuthContext';
5
5
  const useLoginMutation = () => {
6
6
  const { updateLoggedIn } = useContext(AuthContext);
7
7
  const [loginMutation] = useMutation(login, {
8
- onCompleted: data => {
8
+ onCompleted: (data) => {
9
9
  updateLoggedIn(!!data.login.token, data.login.token.value);
10
10
  }
11
11
  });
@@ -1 +1 @@
1
- {"version":3,"file":"useLoginMutation.js","sourceRoot":"","sources":["useLoginMutation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,mD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2,7 @@ import { useContext } from 'react';
2
2
  import qs from 'qs';
3
3
  import cartCheckoutQuery from './CartCheckoutQuery.gql';
4
4
  import { CartIdContext } from '../components/Cart/CartIdContext';
5
- import { useApolloClient } from 'react-apollo';
5
+ import { useApolloClient } from '@apollo/client';
6
6
  function useLoginRedirect() {
7
7
  const { ReturnURL } = __IN_SERVER__
8
8
  ? { ReturnURL: null }
@@ -22,7 +22,7 @@ function useLoginRedirect() {
22
22
  cartId
23
23
  }
24
24
  })
25
- .then(result => {
25
+ .then((result) => {
26
26
  const externalCheckoutUrl = result.data.cart.externalCheckoutUrl;
27
27
  return externalCheckoutUrl;
28
28
  });
@@ -1 +1 @@
1
- {"version":3,"file":"useLoginRedirect.js","sourceRoot":"","sources":["useLoginRedirect.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,SAAS,gBAAgB;IACvB,MAAM,EAAE,SAAS,EAAE,GAA0B,aAAa;QACxD,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE;QACrB,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE;YAC/B,iBAAiB,EAAE,IAAI;SACxB,CAAC,CAAC;IACP,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAG,eAAe,EAAE,CAAC;IACjC,SAAS,cAAc;QACrB,IAAI,CAAC,SAAS;YAAE,OAAO;QACvB,IAAI,SAAS,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE;YACrC,OAAO,MAAM;iBACV,KAAK,CAAiB;gBACrB,KAAK,EAAE,iB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ACT,MAAM;iBACP;aACF,CAAC;iBACD,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;gBACf,MAAM,mBAAmB,GACvB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC;gBACvC,OAAO,mBAAmB,CAAC;YAC7B,CAAC,CAAC,CAAC;SACN;aAAM;YACL,OAAO,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;SACnC;IACH,CAAC;IACD,OAAO,EAAE,cAAc,EAAE,CAAC;AAC5B,CAAC;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -11,10 +11,10 @@ interface UseOrderDetail {
11
11
  */
12
12
  export default function useOrderDetailQuery({ query, id }: UseOrderDetail): {
13
13
  loading: boolean;
14
- error: import("apollo-client").ApolloError;
14
+ error: import("@apollo/client").ApolloError;
15
15
  order: Order;
16
- result: import("react-apollo").QueryResult<{
16
+ result: import("@apollo/client").QueryResult<{
17
17
  order: Order;
18
- }, import("react-apollo").OperationVariables>;
18
+ }, import("@apollo/client").OperationVariables>;
19
19
  };
20
20
  export {};
@@ -1,4 +1,4 @@
1
- import { useQuery } from '@apollo/react-hooks';
1
+ import { useQuery } from '@apollo/client';
2
2
  import throwErrorInDev from '../helpers/throwErrorInDev';
3
3
  import logWarningInDev from '../helpers/logWarningInDev';
4
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"useOrderDetailQuery.js","sourceRoot":"","sources":["useOrderDetailQuery.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,eAAe,MAAM,4BAA4B,CAAC;AACzD,OAAO,eAAe,MAAM,4BAA4B,CAAC;AASzD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAAE,KAAK,EAAE,EAAE,EAAkB;;IACvE,MAAM,qBAAqB;IACzB,aAAa;IACb,CAAA,MAAA,MAAA,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,0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AM,qBAAqB;IACzB,aAAa;IACb,CAAA,MAAA,MAAA,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,0CAAE,mBAAmB,CAAC,CAAC,CAAC,0CAAE,QAAQ,CAAC,IAAI,CAAC,KAAK;QACjE,SAAS,CAAC;IAEZ,MAAM,MAAM,GAAG,QAAQ,CAAmB,KAAK,EAAE;QAC/C,SAAS,EAAE,qBAAqB,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;KAChE,CAAC,CAAC;IAEH,eAAe,CACb,CAAC,CAAC,MAAM,CAAC,KAAK,EACd,yDAAyD,EAAE;MACzD,MAAM,CAAC,KAAK,EAAE,CACjB,CAAC;IAEF,eAAe,CACb,CAAC,qBAAqB,EACtB,gGAAgG,CACjG,CAAC;IAEF,eAAe,CACb,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EACnE,2GAA2G,CAC5G,CAAC;IAEF,OAAO;QACL,kCAAkC;QAClC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI;QACvC,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;QAC7C,MAAM;KACP,CAAC;AACJ,CAAC"}
@@ -1,5 +1,5 @@
1
+ import { useLazyQuery } from '@apollo/client';
1
2
  import { useContext } from 'react';
2
- import { useLazyQuery } from 'react-apollo';
3
3
  import { useShopConfig } from './useShopConfig';
4
4
  import { usePagination } from '../components/Pagination/PaginationProvider';
5
5
  import SortOrderContext from '../components/SortOrder/SortOrderContext';
@@ -1 +1 @@
1
- {"version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CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;gBACjD,SAAS,CAAC,OAAO,EAAE,CAAC;YACtB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;IAEF,OAAO,EAAE,OAAO,EAAE,CAAC;AACrB,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { Maybe, Product, ProductVariant, Scalars } from '@jetshop/core/types';
2
+ export interface StockStatusContainerRender {
3
+ status: Maybe<'inStock' | 'outOfStock' | 'notifyWhenBack'>;
4
+ text: Maybe<string>;
5
+ maxOrderQuantity?: number | null;
6
+ stockDate?: Scalars['DateTime'];
7
+ }
8
+ export declare function useStockStatus(product: Product | ProductVariant): StockStatusContainerRender;
@@ -0,0 +1,26 @@
1
+ function getStatus(statusObject) {
2
+ return statusObject.buyable
3
+ ? 'inStock'
4
+ : statusObject.stockNotificationEnabled
5
+ ? 'notifyWhenBack'
6
+ : 'outOfStock';
7
+ }
8
+ export function useStockStatus(product) {
9
+ const stockStatus = product === null || product === void 0 ? void 0 : product.stockStatus;
10
+ if (!stockStatus) {
11
+ console.warn('The provided product does not have a stockStatus');
12
+ return {
13
+ status: null,
14
+ text: null,
15
+ maxOrderQuantity: null,
16
+ stockDate: null
17
+ };
18
+ }
19
+ return {
20
+ status: getStatus(stockStatus),
21
+ text: stockStatus.text || null,
22
+ maxOrderQuantity: stockStatus.maxOrderQuantity,
23
+ stockDate: stockStatus.stockDate
24
+ };
25
+ }
26
+ //# sourceMappingURL=useStockStatus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStockStatus.js","sourceRoot":"","sources":["useStockStatus.ts"],"names":[],"mappings":"AAeA,SAAS,SAAS,CAChB,YAAyB;IAEzB,OAAO,YAAY,CAAC,OAAO;QACzB,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,YAAY,CAAC,wBAAwB;YACvC,CAAC,CAAC,gBAAgB;YAClB,CAAC,CAAC,YAAY,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,cAAc,CAC5B,OAAiC;IAEjC,MAAM,WAAW,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,CAAC;IAEzC,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,CAAC,IAAI,CAAC,kDAAkD,CAAC,CAAC;QACjE,OAAO;YACL,MAAM,EAAE,IAAI;YACZ,IAAI,EAAE,IAAI;YACV,gBAAgB,EAAE,IAAI;YACtB,SAAS,EAAE,IAAI;SAChB,CAAC;KACH;IAED,OAAO;QACL,MAAM,EAAE,SAAS,CAAC,WAAW,CAAC;QAC9B,IAAI,EAAE,WAAW,CAAC,IAAI,IAAI,IAAI;QAC9B,gBAAgB,EAAE,WAAW,CAAC,gBAAgB;QAC9C,SAAS,EAAE,WAAW,CAAC,SAAS;KACjC,CAAC;AACJ,CAAC"}
@@ -1,5 +1,5 @@
1
+ import { gql } from '@apollo/client';
1
2
  import { print } from 'graphql';
2
- import gql from 'graphql-tag';
3
3
  export const sluggishSchemaExtension = () => {
4
4
  const typeDefs = gql `
5
5
  extend type Page {
@@ -1 +1 @@
1
- {"version":3,"file":"sluggishSchemaExtension.js","sourceRoot":"","sources":["sluggishSchemaExtension.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,GAAG,MAAM,aAAa,CAAC;AAG9B,MAAM,CAAC,MAAM,uBAAuB,GAAoB,GAAG,EAAE;IAC3D,MAAM,QAAQ,GAAG,GAAG,CAAA;;;;GAInB,CAAC;IAEF,MAAM,SAAS,GAAwB;QACrC,IAAI,EAAE;YACJ,QAAQ,EAAE;gBACR;;mBAEG;gBACH,QAAQ,EAAE,0BAA0B;gBACpC,OAAO,CAAC,MAAiC;oBACvC,OAAO,GAAG,MAAM,CAAC,EAAE,IAAI,MAAM,CAAC,IAAI;yBAC/B,WAAW,EAAE;yBACb,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;yBACvB,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,EA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