@jetshop/core 5.16.1 → 5.17.0-alpha.f7018eb5
Sign up to get free protection for your applications and to get access to all the features.
- package/global.d.ts +26 -2
- package/package.json +2 -2
- package/ChannelHandler/ChannelHandler.d.ts +0 -53
- package/ChannelHandler/ChannelHandler.js +0 -114
- package/ChannelHandler/ChannelHandler.js.map +0 -1
- package/ChannelHandler/channelUtils.d.ts +0 -73
- package/ChannelHandler/channelUtils.js +0 -313
- package/ChannelHandler/channelUtils.js.map +0 -1
- package/ChannelHandler/redirectUtils.d.ts +0 -4
- package/ChannelHandler/redirectUtils.js +0 -50
- package/ChannelHandler/redirectUtils.js.map +0 -1
- package/analytics/Analytics.d.ts +0 -18
- package/analytics/Analytics.js +0 -57
- package/analytics/Analytics.js.map +0 -1
- package/analytics/AnalyticsProvider.d.ts +0 -54
- package/analytics/AnalyticsProvider.js +0 -229
- package/analytics/AnalyticsProvider.js.map +0 -1
- package/analytics/deprecatedTracking.d.ts +0 -17
- package/analytics/deprecatedTracking.js +0 -33
- package/analytics/deprecatedTracking.js.map +0 -1
- package/analytics/integrations/ga4.d.ts +0 -28
- package/analytics/integrations/ga4.js +0 -189
- package/analytics/integrations/ga4.js.map +0 -1
- package/analytics/integrations/gtag/gtag.d.ts +0 -8
- package/analytics/integrations/gtag/gtag.js +0 -209
- package/analytics/integrations/gtag/gtag.js.map +0 -1
- package/analytics/integrations/gtag/index.d.ts +0 -1
- package/analytics/integrations/gtag/index.js +0 -2
- package/analytics/integrations/gtag/index.js.map +0 -1
- package/analytics/integrations/gtm/gtm.d.ts +0 -12
- package/analytics/integrations/gtm/gtm.js +0 -227
- package/analytics/integrations/gtm/gtm.js.map +0 -1
- package/analytics/integrations/gtm/index.d.ts +0 -1
- package/analytics/integrations/gtm/index.js +0 -2
- package/analytics/integrations/gtm/index.js.map +0 -1
- package/analytics/integrations/gtm/referrerModifier.d.ts +0 -1
- package/analytics/integrations/gtm/referrerModifier.js +0 -62
- package/analytics/integrations/gtm/referrerModifier.js.map +0 -1
- package/analytics/integrations/releware/index.d.ts +0 -3
- package/analytics/integrations/releware/index.js +0 -39
- package/analytics/integrations/releware/index.js.map +0 -1
- package/analytics/integrations/unslugify.d.ts +0 -1
- package/analytics/integrations/unslugify.js +0 -16
- package/analytics/integrations/unslugify.js.map +0 -1
- package/analytics/trackerRegistry.d.ts +0 -113
- package/analytics/trackerRegistry.js +0 -222
- package/analytics/trackerRegistry.js.map +0 -1
- package/analytics/tracking.d.ts +0 -14
- package/analytics/tracking.js +0 -72
- package/analytics/tracking.js.map +0 -1
- package/analytics/utils/breadcrumbsWithoutProduct.d.ts +0 -1
- package/analytics/utils/breadcrumbsWithoutProduct.js +0 -9
- package/analytics/utils/breadcrumbsWithoutProduct.js.map +0 -1
- package/analytics/utils/script.d.ts +0 -8
- package/analytics/utils/script.js +0 -40
- package/analytics/utils/script.js.map +0 -1
- package/analytics/webVitals.d.ts +0 -5
- package/analytics/webVitals.js +0 -39
- package/analytics/webVitals.js.map +0 -1
- package/boot/AuthHandler.d.ts +0 -14
- package/boot/AuthHandler.js +0 -39
- package/boot/AuthHandler.js.map +0 -1
- package/boot/PreviewHandler.d.ts +0 -7
- package/boot/PreviewHandler.js +0 -14
- package/boot/PreviewHandler.js.map +0 -1
- package/boot/SharedTree.d.ts +0 -25
- package/boot/SharedTree.js +0 -29
- package/boot/SharedTree.js.map +0 -1
- package/boot/addMissingConfig.d.ts +0 -5
- package/boot/addMissingConfig.js +0 -34
- package/boot/addMissingConfig.js.map +0 -1
- package/boot/apollo.d.ts +0 -21
- package/boot/apollo.js +0 -198
- package/boot/apollo.js.map +0 -1
- package/boot/client/entrypoint.d.ts +0 -1
- package/boot/client/entrypoint.js +0 -5
- package/boot/client/entrypoint.js.map +0 -1
- package/boot/client/index.d.ts +0 -1
- package/boot/client/index.js +0 -2
- package/boot/client/index.js.map +0 -1
- package/boot/client/startClient.d.ts +0 -4
- package/boot/client/startClient.js +0 -144
- package/boot/client/startClient.js.map +0 -1
- package/boot/server/IntervalQuery.d.ts +0 -32
- package/boot/server/IntervalQuery.js +0 -95
- package/boot/server/IntervalQuery.js.map +0 -1
- package/boot/server/PersistedApolloClient.d.ts +0 -20
- package/boot/server/PersistedApolloClient.js +0 -40
- package/boot/server/PersistedApolloClient.js.map +0 -1
- package/boot/server/asyncErrorHandler.d.ts +0 -3
- package/boot/server/asyncErrorHandler.js +0 -5
- package/boot/server/asyncErrorHandler.js.map +0 -1
- package/boot/server/breakpointMiddleware.d.ts +0 -3
- package/boot/server/breakpointMiddleware.js +0 -10
- package/boot/server/breakpointMiddleware.js.map +0 -1
- package/boot/server/createApolloServer.d.ts +0 -28
- package/boot/server/createApolloServer.js +0 -144
- package/boot/server/createApolloServer.js.map +0 -1
- package/boot/server/createDevServer.d.ts +0 -14
- package/boot/server/createDevServer.js +0 -30
- package/boot/server/createDevServer.js.map +0 -1
- package/boot/server/createRenderer.d.ts +0 -28
- package/boot/server/createRenderer.js +0 -237
- package/boot/server/createRenderer.js.map +0 -1
- package/boot/server/createServer.d.ts +0 -14
- package/boot/server/createServer.js +0 -42
- package/boot/server/createServer.js.map +0 -1
- package/boot/server/entrypoint.d.ts +0 -1
- package/boot/server/entrypoint.js +0 -36
- package/boot/server/entrypoint.js.map +0 -1
- package/boot/server/getPrefetchFiles.d.ts +0 -10
- package/boot/server/getPrefetchFiles.js +0 -20
- package/boot/server/getPrefetchFiles.js.map +0 -1
- package/boot/server/getPreloadAssets.d.ts +0 -10
- package/boot/server/getPreloadAssets.js +0 -18
- package/boot/server/getPreloadAssets.js.map +0 -1
- package/boot/server/index.d.ts +0 -9
- package/boot/server/index.js +0 -123
- package/boot/server/index.js.map +0 -1
- package/boot/server/listen.d.ts +0 -13
- package/boot/server/listen.js +0 -17
- package/boot/server/listen.js.map +0 -1
- package/boot/server/persistedQueries/PersistedClient.d.ts +0 -22
- package/boot/server/persistedQueries/PersistedClient.js +0 -58
- package/boot/server/persistedQueries/PersistedClient.js.map +0 -1
- package/boot/server/persistedQueries/getPersistedQueriesForRequest.d.ts +0 -3
- package/boot/server/persistedQueries/getPersistedQueriesForRequest.js +0 -27
- package/boot/server/persistedQueries/getPersistedQueriesForRequest.js.map +0 -1
- package/boot/server/salesSource.d.ts +0 -8
- package/boot/server/salesSource.js +0 -16
- package/boot/server/salesSource.js.map +0 -1
- package/boot/utils/createIntOptions.d.ts +0 -6
- package/boot/utils/createIntOptions.js +0 -19
- package/boot/utils/createIntOptions.js.map +0 -1
- package/boot/utils/queryLoggingMiddleware.d.ts +0 -2
- package/boot/utils/queryLoggingMiddleware.js +0 -15
- package/boot/utils/queryLoggingMiddleware.js.map +0 -1
- package/boot/utils/uid.d.ts +0 -3
- package/boot/utils/uid.js +0 -20
- package/boot/utils/uid.js.map +0 -1
- package/cart/AddToCartFormik.d.ts +0 -42
- package/cart/AddToCartFormik.js +0 -77
- package/cart/AddToCartFormik.js.map +0 -1
- package/cart/useAddToCart.d.ts +0 -88
- package/cart/useAddToCart.js +0 -119
- package/cart/useAddToCart.js.map +0 -1
- package/cart/useCart.d.ts +0 -0
- package/cart/useCart.js +0 -1
- package/cart/useCart.js.map +0 -1
- package/components/Auth/CustomerFormContainer.d.ts +0 -0
- package/components/Auth/CustomerFormContainer.js +0 -1
- package/components/Auth/CustomerFormContainer.js.map +0 -1
- package/components/Auth/CustomerUpdateForm.d.ts +0 -32
- package/components/Auth/CustomerUpdateForm.js +0 -122
- package/components/Auth/CustomerUpdateForm.js.map +0 -1
- package/components/Auth/ForgotPasswordProvider.d.ts +0 -71
- package/components/Auth/ForgotPasswordProvider.js +0 -57
- package/components/Auth/ForgotPasswordProvider.js.map +0 -1
- package/components/Auth/ResetPasswordProvider.d.ts +0 -88
- package/components/Auth/ResetPasswordProvider.js +0 -78
- package/components/Auth/ResetPasswordProvider.js.map +0 -1
- package/components/Auth/SSN.d.ts +0 -12
- package/components/Auth/SSN.js +0 -35
- package/components/Auth/SSN.js.map +0 -1
- package/components/Auth/SSNLookupContainer.d.ts +0 -15
- package/components/Auth/SSNLookupContainer.js +0 -20
- package/components/Auth/SSNLookupContainer.js.map +0 -1
- package/components/Auth/SignupFormContainer.d.ts +0 -19
- package/components/Auth/SignupFormContainer.js +0 -82
- package/components/Auth/SignupFormContainer.js.map +0 -1
- package/components/Auth/UpdatePasswordForm.d.ts +0 -44
- package/components/Auth/UpdatePasswordForm.js +0 -98
- package/components/Auth/UpdatePasswordForm.js.map +0 -1
- package/components/Auth/formFieldsFromSettings.d.ts +0 -65
- package/components/Auth/formFieldsFromSettings.js +0 -77
- package/components/Auth/formFieldsFromSettings.js.map +0 -1
- package/components/Auth/formatSignupInput.d.ts +0 -8
- package/components/Auth/formatSignupInput.js +0 -43
- package/components/Auth/formatSignupInput.js.map +0 -1
- package/components/Auth/signup-context.d.ts +0 -36
- package/components/Auth/signup-context.js +0 -72
- package/components/Auth/signup-context.js.map +0 -1
- package/components/Auth/signup-field-translations.d.ts +0 -3
- package/components/Auth/signup-field-translations.js +0 -44
- package/components/Auth/signup-field-translations.js.map +0 -1
- package/components/Auth/signupSubmit.d.ts +0 -6
- package/components/Auth/signupSubmit.js +0 -57
- package/components/Auth/signupSubmit.js.map +0 -1
- package/components/Auth/useAddressFields.d.ts +0 -22
- package/components/Auth/useAddressFields.js +0 -33
- package/components/Auth/useAddressFields.js.map +0 -1
- package/components/Auth/useCustomer.d.ts +0 -116
- package/components/Auth/useCustomer.js +0 -189
- package/components/Auth/useCustomer.js.map +0 -1
- package/components/Auth/useLoginFields.d.ts +0 -20
- package/components/Auth/useLoginFields.js +0 -21
- package/components/Auth/useLoginFields.js.map +0 -1
- package/components/Auth/useSignupForm.d.ts +0 -7
- package/components/Auth/useSignupForm.js +0 -15
- package/components/Auth/useSignupForm.js.map +0 -1
- package/components/AuthContext/AuthContext.d.ts +0 -8
- package/components/AuthContext/AuthContext.js +0 -9
- package/components/AuthContext/AuthContext.js.map +0 -1
- package/components/AuthContext/AuthProvider.d.ts +0 -6
- package/components/AuthContext/AuthProvider.js +0 -85
- package/components/AuthContext/AuthProvider.js.map +0 -1
- package/components/AuthContext/LogOut.d.ts +0 -5
- package/components/AuthContext/LogOut.js +0 -15
- package/components/AuthContext/LogOut.js.map +0 -1
- package/components/AuthContext/useAuth.d.ts +0 -6
- package/components/AuthContext/useAuth.js +0 -21
- package/components/AuthContext/useAuth.js.map +0 -1
- package/components/BreakpointProvider.d.ts +0 -21
- package/components/BreakpointProvider.js +0 -24
- package/components/BreakpointProvider.js.map +0 -1
- package/components/Cart/CartIdContext.d.ts +0 -11
- package/components/Cart/CartIdContext.js +0 -61
- package/components/Cart/CartIdContext.js.map +0 -1
- package/components/ChannelContext/ChannelContext.d.ts +0 -21
- package/components/ChannelContext/ChannelContext.js +0 -4
- package/components/ChannelContext/ChannelContext.js.map +0 -1
- package/components/ChannelContext/ChannelProvider.d.ts +0 -10
- package/components/ChannelContext/ChannelProvider.js +0 -45
- package/components/ChannelContext/ChannelProvider.js.map +0 -1
- package/components/ChannelContext/index.d.ts +0 -2
- package/components/ChannelContext/index.js +0 -3
- package/components/ChannelContext/index.js.map +0 -1
- package/components/ChannelContext/useCountrySettings.d.ts +0 -8
- package/components/ChannelContext/useCountrySettings.js +0 -24
- package/components/ChannelContext/useCountrySettings.js.map +0 -1
- package/components/ConfigProvider.d.ts +0 -108
- package/components/ConfigProvider.js +0 -20
- package/components/ConfigProvider.js.map +0 -1
- package/components/DynamicRoute/CategoryRoute.d.ts +0 -13
- package/components/DynamicRoute/CategoryRoute.js +0 -56
- package/components/DynamicRoute/CategoryRoute.js.map +0 -1
- package/components/DynamicRoute/ContentRoute.d.ts +0 -14
- package/components/DynamicRoute/ContentRoute.js +0 -28
- package/components/DynamicRoute/ContentRoute.js.map +0 -1
- package/components/DynamicRoute/CustomerRoute.d.ts +0 -0
- package/components/DynamicRoute/CustomerRoute.js +0 -1
- package/components/DynamicRoute/CustomerRoute.js.map +0 -1
- package/components/DynamicRoute/PreviewRoute.d.ts +0 -17
- package/components/DynamicRoute/PreviewRoute.js +0 -58
- package/components/DynamicRoute/PreviewRoute.js.map +0 -1
- package/components/DynamicRoute/ProductByArticlenumber.d.ts +0 -5
- package/components/DynamicRoute/ProductByArticlenumber.js +0 -22
- package/components/DynamicRoute/ProductByArticlenumber.js.map +0 -1
- package/components/DynamicRoute/ProductRoute.d.ts +0 -15
- package/components/DynamicRoute/ProductRoute.js +0 -65
- package/components/DynamicRoute/ProductRoute.js.map +0 -1
- package/components/DynamicRoute/RouteResolver.d.ts +0 -22
- package/components/DynamicRoute/RouteResolver.js +0 -65
- package/components/DynamicRoute/RouteResolver.js.map +0 -1
- package/components/DynamicRoute/Status.d.ts +0 -14
- package/components/DynamicRoute/Status.js +0 -20
- package/components/DynamicRoute/Status.js.map +0 -1
- package/components/DynamicRoute/index.d.ts +0 -17
- package/components/DynamicRoute/index.js +0 -96
- package/components/DynamicRoute/index.js.map +0 -1
- package/components/Filters/index.d.ts +0 -1
- package/components/Filters/index.js +0 -2
- package/components/Filters/index.js.map +0 -1
- package/components/Filters/utils/replaceInSearch.d.ts +0 -14
- package/components/Filters/utils/replaceInSearch.js +0 -23
- package/components/Filters/utils/replaceInSearch.js.map +0 -1
- package/components/Filters/utils/updateHistory.d.ts +0 -25
- package/components/Filters/utils/updateHistory.js +0 -30
- package/components/Filters/utils/updateHistory.js.map +0 -1
- package/components/Fonts/CustomFont.d.ts +0 -14
- package/components/Fonts/CustomFont.js +0 -17
- package/components/Fonts/CustomFont.js.map +0 -1
- package/components/Fonts/GoogleFont.d.ts +0 -10
- package/components/Fonts/GoogleFont.js +0 -35
- package/components/Fonts/GoogleFont.js.map +0 -1
- package/components/Fonts/TypekitFont.d.ts +0 -16
- package/components/Fonts/TypekitFont.js +0 -25
- package/components/Fonts/TypekitFont.js.map +0 -1
- package/components/Fonts/injectFont.d.ts +0 -11
- package/components/Fonts/injectFont.js +0 -30
- package/components/Fonts/injectFont.js.map +0 -1
- package/components/Head.d.ts +0 -11
- package/components/Head.js +0 -84
- package/components/Head.js.map +0 -1
- package/components/Mutation/AddToCart/addToCartUtils.d.ts +0 -18
- package/components/Mutation/AddToCart/addToCartUtils.js +0 -52
- package/components/Mutation/AddToCart/addToCartUtils.js.map +0 -1
- package/components/Mutation/AddToCartFormik.d.ts +0 -53
- package/components/Mutation/AddToCartFormik.js +0 -173
- package/components/Mutation/AddToCartFormik.js.map +0 -1
- package/components/Mutation/DecrementQuantity.d.ts +0 -4
- package/components/Mutation/DecrementQuantity.js +0 -35
- package/components/Mutation/DecrementQuantity.js.map +0 -1
- package/components/Mutation/IncrementQuantity.d.ts +0 -4
- package/components/Mutation/IncrementQuantity.js +0 -35
- package/components/Mutation/IncrementQuantity.js.map +0 -1
- package/components/Mutation/RemoveFromCart.d.ts +0 -5
- package/components/Mutation/RemoveFromCart.js +0 -52
- package/components/Mutation/RemoveFromCart.js.map +0 -1
- package/components/Mutation/SetQuantity.d.ts +0 -4
- package/components/Mutation/SetQuantity.js +0 -37
- package/components/Mutation/SetQuantity.js.map +0 -1
- package/components/Mutation/SubscribeToNewsletter.d.ts +0 -4
- package/components/Mutation/SubscribeToNewsletter.js +0 -30
- package/components/Mutation/SubscribeToNewsletter.js.map +0 -1
- package/components/Mutation/SubscribeToStockNotifications.d.ts +0 -4
- package/components/Mutation/SubscribeToStockNotifications.js +0 -31
- package/components/Mutation/SubscribeToStockNotifications.js.map +0 -1
- package/components/Mutation/cartMutationUtils.d.ts +0 -28
- package/components/Mutation/cartMutationUtils.js +0 -109
- package/components/Mutation/cartMutationUtils.js.map +0 -1
- package/components/Mutation/useDecrementQuantity.d.ts +0 -11
- package/components/Mutation/useDecrementQuantity.js +0 -54
- package/components/Mutation/useDecrementQuantity.js.map +0 -1
- package/components/Mutation/useIncrementQuantity.d.ts +0 -11
- package/components/Mutation/useIncrementQuantity.js +0 -54
- package/components/Mutation/useIncrementQuantity.js.map +0 -1
- package/components/Mutation/useRemoveFromCart.d.ts +0 -13
- package/components/Mutation/useRemoveFromCart.js +0 -50
- package/components/Mutation/useRemoveFromCart.js.map +0 -1
- package/components/Mutation/useSetQuantity.d.ts +0 -12
- package/components/Mutation/useSetQuantity.js +0 -38
- package/components/Mutation/useSetQuantity.js.map +0 -1
- package/components/Notifications/Notifications.d.ts +0 -15
- package/components/Notifications/Notifications.js +0 -27
- package/components/Notifications/Notifications.js.map +0 -1
- package/components/Notifications/index.d.ts +0 -2
- package/components/Notifications/index.js +0 -3
- package/components/Notifications/index.js.map +0 -1
- package/components/Notifications/notificationMachine.d.ts +0 -30
- package/components/Notifications/notificationMachine.js +0 -74
- package/components/Notifications/notificationMachine.js.map +0 -1
- package/components/Notifications/notificationsMachine.d.ts +0 -37
- package/components/Notifications/notificationsMachine.js +0 -66
- package/components/Notifications/notificationsMachine.js.map +0 -1
- package/components/Notifications/useNotification.d.ts +0 -9
- package/components/Notifications/useNotification.js +0 -27
- package/components/Notifications/useNotification.js.map +0 -1
- package/components/OpenGraph/OpenGraphGeneralPageData.d.ts +0 -25
- package/components/OpenGraph/OpenGraphGeneralPageData.js +0 -37
- package/components/OpenGraph/OpenGraphGeneralPageData.js.map +0 -1
- package/components/OpenGraph/OpenGraphProductData.d.ts +0 -25
- package/components/OpenGraph/OpenGraphProductData.js +0 -49
- package/components/OpenGraph/OpenGraphProductData.js.map +0 -1
- package/components/OpenGraph/index.d.ts +0 -2
- package/components/OpenGraph/index.js +0 -3
- package/components/OpenGraph/index.js.map +0 -1
- package/components/Pagination/PaginationContainer.d.ts +0 -2
- package/components/Pagination/PaginationContainer.js +0 -5
- package/components/Pagination/PaginationContainer.js.map +0 -1
- package/components/Pagination/PaginationContext.d.ts +0 -14
- package/components/Pagination/PaginationContext.js +0 -4
- package/components/Pagination/PaginationContext.js.map +0 -1
- package/components/Pagination/PaginationProvider.d.ts +0 -19
- package/components/Pagination/PaginationProvider.js +0 -95
- package/components/Pagination/PaginationProvider.js.map +0 -1
- package/components/PreviewContext.d.ts +0 -10
- package/components/PreviewContext.js +0 -27
- package/components/PreviewContext.js.map +0 -1
- package/components/ProductConfigurationProvider/ProductConfigurationContext.d.ts +0 -13
- package/components/ProductConfigurationProvider/ProductConfigurationContext.js +0 -5
- package/components/ProductConfigurationProvider/ProductConfigurationContext.js.map +0 -1
- package/components/ProductConfigurationProvider/ProductConfigurationProvider.d.ts +0 -6
- package/components/ProductConfigurationProvider/ProductConfigurationProvider.js +0 -50
- package/components/ProductConfigurationProvider/ProductConfigurationProvider.js.map +0 -1
- package/components/Query/CartProvider.d.ts +0 -22
- package/components/Query/CartProvider.js +0 -68
- package/components/Query/CartProvider.js.map +0 -1
- package/components/SortOrder/SortOrderContainer.d.ts +0 -40
- package/components/SortOrder/SortOrderContainer.js +0 -108
- package/components/SortOrder/SortOrderContainer.js.map +0 -1
- package/components/SortOrder/SortOrderContext.d.ts +0 -9
- package/components/SortOrder/SortOrderContext.js +0 -9
- package/components/SortOrder/SortOrderContext.js.map +0 -1
- package/components/StructuredData/SiteLinksSearchStructuredData.d.ts +0 -3
- package/components/StructuredData/SiteLinksSearchStructuredData.js +0 -25
- package/components/StructuredData/SiteLinksSearchStructuredData.js.map +0 -1
- package/components/StructuredData/StructuredBreadcrumbData.d.ts +0 -12
- package/components/StructuredData/StructuredBreadcrumbData.js +0 -55
- package/components/StructuredData/StructuredBreadcrumbData.js.map +0 -1
- package/components/StructuredData/StructuredCategoryData.d.ts +0 -16
- package/components/StructuredData/StructuredCategoryData.js +0 -18
- package/components/StructuredData/StructuredCategoryData.js.map +0 -1
- package/components/StructuredData/StructuredData.d.ts +0 -9
- package/components/StructuredData/StructuredData.js +0 -7
- package/components/StructuredData/StructuredData.js.map +0 -1
- package/components/StructuredData/StructuredPageData.d.ts +0 -16
- package/components/StructuredData/StructuredPageData.js +0 -17
- package/components/StructuredData/StructuredPageData.js.map +0 -1
- package/components/StructuredData/StructuredProductData.d.ts +0 -18
- package/components/StructuredData/StructuredProductData.js +0 -43
- package/components/StructuredData/StructuredProductData.js.map +0 -1
- package/components/StructuredData/index.d.ts +0 -5
- package/components/StructuredData/index.js +0 -6
- package/components/StructuredData/index.js.map +0 -1
- package/data/cache.d.ts +0 -3
- package/data/cache.js +0 -21
- package/data/cache.js.map +0 -1
- package/data/fragmentTypes.d.ts +0 -8
- package/data/fragmentTypes.js +0 -84
- package/data/fragmentTypes.js.map +0 -1
- package/data/fragments/index.d.ts +0 -1
- package/data/fragments/index.js +0 -2
- package/data/fragments/index.js.map +0 -1
- package/errorReporting.browser.d.ts +0 -3
- package/errorReporting.browser.js +0 -12
- package/errorReporting.browser.js.map +0 -1
- package/errorReporting.d.ts +0 -3
- package/errorReporting.js +0 -20
- package/errorReporting.js.map +0 -1
- package/errorReporting.server.d.ts +0 -3
- package/errorReporting.server.js +0 -12
- package/errorReporting.server.js.map +0 -1
- package/errorReporting.shared.d.ts +0 -5
- package/errorReporting.shared.js +0 -17
- package/errorReporting.shared.js.map +0 -1
- package/experiments/ExperimentsProvider.d.ts +0 -4
- package/experiments/ExperimentsProvider.js +0 -29
- package/experiments/ExperimentsProvider.js.map +0 -1
- package/experiments/selectExperimentVariant.d.ts +0 -3
- package/experiments/selectExperimentVariant.js +0 -35
- package/experiments/selectExperimentVariant.js.map +0 -1
- package/experiments/useExperiment.d.ts +0 -2
- package/experiments/useExperiment.js +0 -11
- package/experiments/useExperiment.js.map +0 -1
- package/helpers/decodeUrlQuery.d.ts +0 -9
- package/helpers/decodeUrlQuery.js +0 -27
- package/helpers/decodeUrlQuery.js.map +0 -1
- package/helpers/distance.d.ts +0 -7
- package/helpers/distance.js +0 -13
- package/helpers/distance.js.map +0 -1
- package/helpers/encodeVariant.d.ts +0 -3
- package/helpers/encodeVariant.js +0 -25
- package/helpers/encodeVariant.js.map +0 -1
- package/helpers/getBreakpointsFromValues.d.ts +0 -6
- package/helpers/getBreakpointsFromValues.js +0 -15
- package/helpers/getBreakpointsFromValues.js.map +0 -1
- package/helpers/getCartItemVariant.d.ts +0 -7
- package/helpers/getCartItemVariant.js +0 -9
- package/helpers/getCartItemVariant.js.map +0 -1
- package/helpers/getErrorDetail.d.ts +0 -7
- package/helpers/getErrorDetail.js +0 -12
- package/helpers/getErrorDetail.js.map +0 -1
- package/helpers/getHeaders.d.ts +0 -6
- package/helpers/getHeaders.js +0 -4
- package/helpers/getHeaders.js.map +0 -1
- package/helpers/isRelativeUrl.d.ts +0 -1
- package/helpers/isRelativeUrl.js +0 -4
- package/helpers/isRelativeUrl.js.map +0 -1
- package/helpers/logError.d.ts +0 -1
- package/helpers/logError.js +0 -17
- package/helpers/logError.js.map +0 -1
- package/helpers/logWarningInDev.d.ts +0 -1
- package/helpers/logWarningInDev.js +0 -7
- package/helpers/logWarningInDev.js.map +0 -1
- package/helpers/throwErrorInDev.d.ts +0 -6
- package/helpers/throwErrorInDev.js +0 -15
- package/helpers/throwErrorInDev.js.map +0 -1
- package/helpers/uniqueId.d.ts +0 -5
- package/helpers/uniqueId.js +0 -10
- package/helpers/uniqueId.js.map +0 -1
- package/hooks/Channels/useChannelSettings.d.ts +0 -7
- package/hooks/Channels/useChannelSettings.js +0 -12
- package/hooks/Channels/useChannelSettings.js.map +0 -1
- package/hooks/Filters/useBooleanFilter.d.ts +0 -8
- package/hooks/Filters/useBooleanFilter.js +0 -21
- package/hooks/Filters/useBooleanFilter.js.map +0 -1
- package/hooks/Filters/useFilters.d.ts +0 -3
- package/hooks/Filters/useFilters.js +0 -16
- package/hooks/Filters/useFilters.js.map +0 -1
- package/hooks/Filters/useListFilter.d.ts +0 -10
- package/hooks/Filters/useListFilter.js +0 -38
- package/hooks/Filters/useListFilter.js.map +0 -1
- package/hooks/Filters/useMultiFilter.d.ts +0 -13
- package/hooks/Filters/useMultiFilter.js +0 -50
- package/hooks/Filters/useMultiFilter.js.map +0 -1
- package/hooks/Filters/useRangeFilter.d.ts +0 -10
- package/hooks/Filters/useRangeFilter.js +0 -36
- package/hooks/Filters/useRangeFilter.js.map +0 -1
- package/hooks/Filters/useSortOrder.d.ts +0 -11
- package/hooks/Filters/useSortOrder.js +0 -22
- package/hooks/Filters/useSortOrder.js.map +0 -1
- package/hooks/PackageProducts/index.d.ts +0 -2
- package/hooks/PackageProducts/index.js +0 -3
- package/hooks/PackageProducts/index.js.map +0 -1
- package/hooks/PackageProducts/usePackageProductItem.d.ts +0 -17
- package/hooks/PackageProducts/usePackageProductItem.js +0 -27
- package/hooks/PackageProducts/usePackageProductItem.js.map +0 -1
- package/hooks/PackageProducts/usePackageProducts.d.ts +0 -19
- package/hooks/PackageProducts/usePackageProducts.js +0 -346
- package/hooks/PackageProducts/usePackageProducts.js.map +0 -1
- package/hooks/Product/index.d.ts +0 -1
- package/hooks/Product/index.js +0 -2
- package/hooks/Product/index.js.map +0 -1
- package/hooks/Product/useStockStatus.d.ts +0 -9
- package/hooks/Product/useStockStatus.js +0 -26
- package/hooks/Product/useStockStatus.js.map +0 -1
- package/hooks/Product/useSwitchToVariantImage.d.ts +0 -9
- package/hooks/Product/useSwitchToVariantImage.js +0 -21
- package/hooks/Product/useSwitchToVariantImage.js.map +0 -1
- package/hooks/ProductList/ProductListContext.d.ts +0 -7
- package/hooks/ProductList/ProductListContext.js +0 -111
- package/hooks/ProductList/ProductListContext.js.map +0 -1
- package/hooks/ProductList/action-creators.d.ts +0 -46
- package/hooks/ProductList/action-creators.js +0 -297
- package/hooks/ProductList/action-creators.js.map +0 -1
- package/hooks/ProductList/index.d.ts +0 -118
- package/hooks/ProductList/index.js +0 -22
- package/hooks/ProductList/index.js.map +0 -1
- package/hooks/ProductList/list-transforms.d.ts +0 -75
- package/hooks/ProductList/list-transforms.js +0 -107
- package/hooks/ProductList/list-transforms.js.map +0 -1
- package/hooks/ProductList/product-list-reducer.d.ts +0 -76
- package/hooks/ProductList/product-list-reducer.js +0 -198
- package/hooks/ProductList/product-list-reducer.js.map +0 -1
- package/hooks/ProductList/useProductList.d.ts +0 -13
- package/hooks/ProductList/useProductList.js +0 -94
- package/hooks/ProductList/useProductList.js.map +0 -1
- package/hooks/ProductList/useProductListItems.d.ts +0 -10
- package/hooks/ProductList/useProductListItems.js +0 -49
- package/hooks/ProductList/useProductListItems.js.map +0 -1
- package/hooks/ProductList/validate-product.d.ts +0 -6
- package/hooks/ProductList/validate-product.js +0 -41
- package/hooks/ProductList/validate-product.js.map +0 -1
- package/hooks/Subscriptions/useNewsletterSubscription.d.ts +0 -38
- package/hooks/Subscriptions/useNewsletterSubscription.js +0 -42
- package/hooks/Subscriptions/useNewsletterSubscription.js.map +0 -1
- package/hooks/Subscriptions/useStockNotifications.d.ts +0 -36
- package/hooks/Subscriptions/useStockNotifications.js +0 -38
- package/hooks/Subscriptions/useStockNotifications.js.map +0 -1
- package/hooks/Subscriptions/useStoreSubscriptions.d.ts +0 -48
- package/hooks/Subscriptions/useStoreSubscriptions.js +0 -151
- package/hooks/Subscriptions/useStoreSubscriptions.js.map +0 -1
- package/hooks/useAddMultipleToCart.d.ts +0 -27
- package/hooks/useAddMultipleToCart.js +0 -114
- package/hooks/useAddMultipleToCart.js.map +0 -1
- package/hooks/useChannels.d.ts +0 -1
- package/hooks/useChannels.js +0 -10
- package/hooks/useChannels.js.map +0 -1
- package/hooks/useCustomerOrdersQuery.d.ts +0 -21
- package/hooks/useCustomerOrdersQuery.js +0 -21
- package/hooks/useCustomerOrdersQuery.js.map +0 -1
- package/hooks/useDeleteAccountMutation.d.ts +0 -15
- package/hooks/useDeleteAccountMutation.js +0 -39
- package/hooks/useDeleteAccountMutation.js.map +0 -1
- package/hooks/useDynamicPrice.d.ts +0 -3
- package/hooks/useDynamicPrice.js +0 -25
- package/hooks/useDynamicPrice.js.map +0 -1
- package/hooks/useFreeShippingCheck.d.ts +0 -15
- package/hooks/useFreeShippingCheck.js +0 -31
- package/hooks/useFreeShippingCheck.js.map +0 -1
- package/hooks/useGeolocation.d.ts +0 -11
- package/hooks/useGeolocation.js +0 -34
- package/hooks/useGeolocation.js.map +0 -1
- package/hooks/useInfinitePagination.d.ts +0 -37
- package/hooks/useInfinitePagination.js +0 -139
- package/hooks/useInfinitePagination.js.map +0 -1
- package/hooks/useLogError.d.ts +0 -1
- package/hooks/useLogError.js +0 -8
- package/hooks/useLogError.js.map +0 -1
- package/hooks/useLoginMutation.d.ts +0 -12
- package/hooks/useLoginMutation.js +0 -15
- package/hooks/useLoginMutation.js.map +0 -1
- package/hooks/useLoginRedirect.d.ts +0 -4
- package/hooks/useLoginRedirect.js +0 -37
- package/hooks/useLoginRedirect.js.map +0 -1
- package/hooks/useOrderDetailQuery.d.ts +0 -20
- package/hooks/useOrderDetailQuery.js +0 -29
- package/hooks/useOrderDetailQuery.js.map +0 -1
- package/hooks/usePreconnectLinks.d.ts +0 -10
- package/hooks/usePreconnectLinks.js +0 -30
- package/hooks/usePreconnectLinks.js.map +0 -1
- package/hooks/usePrice.d.ts +0 -41
- package/hooks/usePrice.js +0 -73
- package/hooks/usePrice.js.map +0 -1
- package/hooks/useProductVariants/index.d.ts +0 -1
- package/hooks/useProductVariants/index.js +0 -2
- package/hooks/useProductVariants/index.js.map +0 -1
- package/hooks/useProductVariants/useProductVariants.d.ts +0 -19
- package/hooks/useProductVariants/useProductVariants.js +0 -203
- package/hooks/useProductVariants/useProductVariants.js.map +0 -1
- package/hooks/useProductVariants/useVariantFromUrl.d.ts +0 -5
- package/hooks/useProductVariants/useVariantFromUrl.js +0 -16
- package/hooks/useProductVariants/useVariantFromUrl.js.map +0 -1
- package/hooks/useRoutePreload.d.ts +0 -24
- package/hooks/useRoutePreload.js +0 -40
- package/hooks/useRoutePreload.js.map +0 -1
- package/hooks/useShopConfig.d.ts +0 -1
- package/hooks/useShopConfig.js +0 -11
- package/hooks/useShopConfig.js.map +0 -1
- package/hooks/useThrowErrorInDev.d.ts +0 -1
- package/hooks/useThrowErrorInDev.js +0 -8
- package/hooks/useThrowErrorInDev.js.map +0 -1
- package/hooks/useThunkReducer.d.ts +0 -7
- package/hooks/useThunkReducer.js +0 -24
- package/hooks/useThunkReducer.js.map +0 -1
- package/hooks/useWarningInDev.d.ts +0 -1
- package/hooks/useWarningInDev.js +0 -10
- package/hooks/useWarningInDev.js.map +0 -1
- package/inServer.d.ts +0 -1
- package/inServer.js +0 -3
- package/inServer.js.map +0 -1
- package/index.d.ts +0 -1
- package/index.js +0 -2
- package/index.js.map +0 -1
- package/integrations/addwishSchemaExtension.d.ts +0 -35
- package/integrations/addwishSchemaExtension.js +0 -141
- package/integrations/addwishSchemaExtension.js.map +0 -1
- package/integrations/nostoSchemaExtension.d.ts +0 -5
- package/integrations/nostoSchemaExtension.js +0 -77
- package/integrations/nostoSchemaExtension.js.map +0 -1
- package/integrations/sluggishSchemaExtension.d.ts +0 -2
- package/integrations/sluggishSchemaExtension.js +0 -27
- package/integrations/sluggishSchemaExtension.js.map +0 -1
- package/polyfills.d.ts +0 -1
- package/polyfills.js +0 -38
- package/polyfills.js.map +0 -1
- package/resolvers/filters/boolFilter.d.ts +0 -3
- package/resolvers/filters/boolFilter.js +0 -85
- package/resolvers/filters/boolFilter.js.map +0 -1
- package/resolvers/filters/defaultActiveFilters.d.ts +0 -3
- package/resolvers/filters/defaultActiveFilters.js +0 -9
- package/resolvers/filters/defaultActiveFilters.js.map +0 -1
- package/resolvers/filters/filterParams.d.ts +0 -3
- package/resolvers/filters/filterParams.js +0 -85
- package/resolvers/filters/filterParams.js.map +0 -1
- package/resolvers/filters/filters.d.ts +0 -5
- package/resolvers/filters/filters.js +0 -79
- package/resolvers/filters/filters.js.map +0 -1
- package/resolvers/filters/index.d.ts +0 -27
- package/resolvers/filters/index.js +0 -8
- package/resolvers/filters/index.js.map +0 -1
- package/resolvers/filters/listFilter.d.ts +0 -7
- package/resolvers/filters/listFilter.js +0 -74
- package/resolvers/filters/listFilter.js.map +0 -1
- package/resolvers/filters/listFilterItem.d.ts +0 -3
- package/resolvers/filters/listFilterItem.js +0 -123
- package/resolvers/filters/listFilterItem.js.map +0 -1
- package/resolvers/filters/multiListFilter.d.ts +0 -5
- package/resolvers/filters/multiListFilter.js +0 -196
- package/resolvers/filters/multiListFilter.js.map +0 -1
- package/resolvers/filters/multiListFilterList.d.ts +0 -3
- package/resolvers/filters/multiListFilterList.js +0 -56
- package/resolvers/filters/multiListFilterList.js.map +0 -1
- package/resolvers/filters/rangeFilter.d.ts +0 -5
- package/resolvers/filters/rangeFilter.js +0 -138
- package/resolvers/filters/rangeFilter.js.map +0 -1
- package/resolvers/filters/updateQueryString.d.ts +0 -12
- package/resolvers/filters/updateQueryString.js +0 -117
- package/resolvers/filters/updateQueryString.js.map +0 -1
- package/resolvers/index.d.ts +0 -37
- package/resolvers/index.js +0 -38
- package/resolvers/index.js.map +0 -1
- package/sentry/client.d.ts +0 -1
- package/sentry/client.js +0 -30
- package/sentry/client.js.map +0 -1
- package/sentry/common.d.ts +0 -1
- package/sentry/common.js +0 -5
- package/sentry/common.js.map +0 -1
- package/sentry/server.d.ts +0 -1
- package/sentry/server.js +0 -20
- package/sentry/server.js.map +0 -1
- package/sentry/utils.d.ts +0 -1
- package/sentry/utils.js +0 -2
- package/sentry/utils.js.map +0 -1
- package/server/graphql.d.ts +0 -20
- package/server/graphql.js +0 -119
- package/server/graphql.js.map +0 -1
- package/server/index.d.ts +0 -2
- package/server/index.js +0 -3
- package/server/index.js.map +0 -1
- package/server/tracking/facebook.d.ts +0 -5
- package/server/tracking/facebook.js +0 -148
- package/server/tracking/facebook.js.map +0 -1
- package/server/tracking/middleware.d.ts +0 -8
- package/server/tracking/middleware.js +0 -15
- package/server/tracking/middleware.js.map +0 -1
- package/time.d.ts +0 -1
- package/time.js +0 -6
- package/time.js.map +0 -1
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useThrowErrorInDev.js","sourceRoot":"","sources":["useThrowErrorInDev.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,eAAe,MAAM,4BAA4B,CAAC;AAEzD,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,SAAkB,EAAE,GAAW;IACxE,SAAS,CAAC,GAAG,EAAE;QACb,eAAe,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;IAClC,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC;AACvB,CAAC"}
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import { Reducer } from 'react';
|
2
|
-
export declare type ThunkAction<State, Action> = (dispatch: React.Dispatch<Action>, getState: () => State) => void;
|
3
|
-
/**
|
4
|
-
* Can be used the same way as useReducer, but allows functions to be passed as
|
5
|
-
* actions (aka thunks).
|
6
|
-
*/
|
7
|
-
export declare function useThunkReducer<State, Action>(reducer: Reducer<State, Action>, initialState: State, initializer?: (arg: State) => State): [State, React.Dispatch<Action | ThunkAction<State, Action>>];
|
package/hooks/useThunkReducer.js
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
import { useReducer, useRef, useCallback } from 'react';
|
2
|
-
function isThunk(action) {
|
3
|
-
return typeof action === 'function';
|
4
|
-
}
|
5
|
-
/**
|
6
|
-
* Can be used the same way as useReducer, but allows functions to be passed as
|
7
|
-
* actions (aka thunks).
|
8
|
-
*/
|
9
|
-
export function useThunkReducer(reducer, initialState, initializer) {
|
10
|
-
const [state, dispatch] = useReducer(reducer, initialState, initializer);
|
11
|
-
const previousState = useRef();
|
12
|
-
previousState.current = state;
|
13
|
-
const thunkedDispatch = useCallback(function thunkedDispatch(action) {
|
14
|
-
if (isThunk(action)) {
|
15
|
-
return action(thunkedDispatch, () => previousState.current);
|
16
|
-
}
|
17
|
-
dispatch(action);
|
18
|
-
},
|
19
|
-
// exhaustive-deps doesn't work with recursion
|
20
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
21
|
-
[]);
|
22
|
-
return [previousState.current, thunkedDispatch];
|
23
|
-
}
|
24
|
-
//# sourceMappingURL=useThunkReducer.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useThunkReducer.js","sourceRoot":"","sources":["useThunkReducer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAW,MAAM,OAAO,CAAC;AAOjE,SAAS,OAAO,CACd,MAA2C;IAE3C,OAAO,OAAO,MAAM,KAAK,UAAU,CAAC;AACtC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,eAAe,CAC7B,OAA+B,EAC/B,YAAmB,EACnB,WAAmC;IAEnC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,UAAU,CAAC,OAAO,EAAE,YAAY,EAAE,WAAW,CAAC,CAAC;IAEzE,MAAM,aAAa,GAAG,MAAM,EAAS,CAAC;IACtC,aAAa,CAAC,OAAO,GAAG,KAAK,CAAC;IAE9B,MAAM,eAAe,GAAG,WAAW,CACjC,SAAS,eAAe,CAAC,MAA2C;QAClE,IAAI,OAAO,CAAgB,MAAM,CAAC,EAAE;YAClC,OAAO,MAAM,CAAC,eAAe,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;SAC7D;QAED,QAAQ,CAAC,MAAM,CAAC,CAAC;IACnB,CAAC;IACD,8CAA8C;IAC9C,uDAAuD;IACvD,EAAE,CACH,CAAC;IAEF,OAAO,CAAC,aAAa,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;AAClD,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
export default function useWarningInDev(condition: boolean, msg: string): void;
|
package/hooks/useWarningInDev.js
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
import logWarningInDev from '../helpers/logWarningInDev';
|
2
|
-
import { useEffect } from 'react';
|
3
|
-
export default function useWarningInDev(condition, msg) {
|
4
|
-
useEffect(() => {
|
5
|
-
if (process.env.NODE_ENV !== 'production') {
|
6
|
-
logWarningInDev(condition, msg);
|
7
|
-
}
|
8
|
-
}, [condition, msg]);
|
9
|
-
}
|
10
|
-
//# sourceMappingURL=useWarningInDev.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useWarningInDev.js","sourceRoot":"","sources":["useWarningInDev.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,SAAkB,EAAE,GAAW;IACrE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;YACzC,eAAe,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;SACjC;IACH,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC;AACvB,CAAC"}
|
package/inServer.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export default __IN_SERVER__;
|
package/inServer.js
DELETED
package/inServer.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"inServer.js","sourceRoot":"","sources":["inServer.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,eAAe,aAAa,CAAC"}
|
package/index.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export { default as DynamicRoute } from './components/DynamicRoute';
|
package/index.js
DELETED
package/index.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,2BAA2B,CAAC"}
|
@@ -1,35 +0,0 @@
|
|
1
|
-
import { SchemaExtension } from './../boot/server/createApolloServer';
|
2
|
-
export interface AddwishGetRecommendationsResponseBoxItem {
|
3
|
-
/**
|
4
|
-
* Article number
|
5
|
-
* @see https://www.addwish.com/api/v1/product-recommendation/getProductBoxes?ids=5aaf90dc65f8014ff3957e9e%2C5aaf90da65f8014ff3957e91&url=https%3A%2F%2Fwww.scstyling.com&format=json
|
6
|
-
*/
|
7
|
-
productNumber: string;
|
8
|
-
url: string;
|
9
|
-
[key: string]: any;
|
10
|
-
}
|
11
|
-
export interface AddwishGetRecommendationsResponseBox {
|
12
|
-
result?: AddwishGetRecommendationsResponseBoxItem[];
|
13
|
-
errorCode?: string;
|
14
|
-
countAfterSource?: string;
|
15
|
-
}
|
16
|
-
export interface AddwishGetRecommendationsResponse {
|
17
|
-
result: {
|
18
|
-
[key: string]: AddwishGetRecommendationsResponseBox;
|
19
|
-
};
|
20
|
-
}
|
21
|
-
export declare function validateResponseBox({ response, id }: {
|
22
|
-
response: AddwishGetRecommendationsResponse;
|
23
|
-
id: string;
|
24
|
-
}): void;
|
25
|
-
export declare function fetchAddwishRecommendations({ ids, url }: {
|
26
|
-
/**
|
27
|
-
* List of recommendation box IDs. Separate multiple IDs with a comma.
|
28
|
-
*/
|
29
|
-
ids: string[];
|
30
|
-
/**
|
31
|
-
* This url specifies the product you want to find relations for. Note that you can also specify specific urls for each recommendation box.
|
32
|
-
*/
|
33
|
-
url?: string;
|
34
|
-
}): Promise<AddwishGetRecommendationsResponse>;
|
35
|
-
export declare const addwishSchemaExtension: SchemaExtension;
|
@@ -1,141 +0,0 @@
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8
|
-
});
|
9
|
-
};
|
10
|
-
import { print } from 'graphql';
|
11
|
-
import gql from 'graphql-tag';
|
12
|
-
import fetch from 'node-fetch';
|
13
|
-
import qs from 'qs';
|
14
|
-
const typeDefs = gql `
|
15
|
-
type GetAddwishProductsResponse {
|
16
|
-
# Addwish Box ID
|
17
|
-
id: String!
|
18
|
-
products: [Product!]
|
19
|
-
errorCode: String
|
20
|
-
countAfterSource: String
|
21
|
-
}
|
22
|
-
extend type Query {
|
23
|
-
getAddwishProducts(
|
24
|
-
# Recommendation box ID
|
25
|
-
id: String!
|
26
|
-
# This url specifies the product you want to find relations for. Note that you can also specify specific urls for each recommendation box.
|
27
|
-
url: String
|
28
|
-
): GetAddwishProductsResponse!
|
29
|
-
}
|
30
|
-
`;
|
31
|
-
class UnexpectedResponseError extends Error {
|
32
|
-
constructor(message, { id, response, box }) {
|
33
|
-
super(message);
|
34
|
-
console.warn(message, { id, response, box });
|
35
|
-
}
|
36
|
-
}
|
37
|
-
export function validateResponseBox({ response, id }) {
|
38
|
-
const box = response.result[id];
|
39
|
-
if (!box) {
|
40
|
-
throw new UnexpectedResponseError('Box not found in the rsponse.', {
|
41
|
-
id,
|
42
|
-
response,
|
43
|
-
box
|
44
|
-
});
|
45
|
-
}
|
46
|
-
if (box.errorCode) {
|
47
|
-
throw new UnexpectedResponseError(`Box error: "${box.errorCode}"`, {
|
48
|
-
id,
|
49
|
-
response,
|
50
|
-
box
|
51
|
-
});
|
52
|
-
}
|
53
|
-
if (!Array.isArray(box.result)) {
|
54
|
-
throw new UnexpectedResponseError("Result property wasn't an array", {
|
55
|
-
id,
|
56
|
-
response,
|
57
|
-
box
|
58
|
-
});
|
59
|
-
}
|
60
|
-
if (box.result.length > 0 &&
|
61
|
-
typeof box.result[0].productNumber !== 'string') {
|
62
|
-
throw new UnexpectedResponseError('"productNumber" needs to be a string', {
|
63
|
-
id,
|
64
|
-
response,
|
65
|
-
box
|
66
|
-
});
|
67
|
-
}
|
68
|
-
}
|
69
|
-
const ADDWISH_GET_PRODUCTBOXES_URL = `https://www.addwish.com/api/v1/product-recommendation/getProductBoxes`;
|
70
|
-
export function fetchAddwishRecommendations({ ids, url }) {
|
71
|
-
return __awaiter(this, void 0, void 0, function* () {
|
72
|
-
const addwishUrl = `${ADDWISH_GET_PRODUCTBOXES_URL}?${qs.stringify({
|
73
|
-
format: 'json',
|
74
|
-
url,
|
75
|
-
ids: ids.join(',')
|
76
|
-
})}`;
|
77
|
-
return fetch(addwishUrl).then(res => res.json());
|
78
|
-
});
|
79
|
-
}
|
80
|
-
export const addwishSchemaExtension = ({ remoteSchema }) => {
|
81
|
-
const resolvers = {
|
82
|
-
Query: {
|
83
|
-
getAddwishProducts: {
|
84
|
-
resolve(_source, { id, url }) {
|
85
|
-
return __awaiter(this, void 0, void 0, function* () {
|
86
|
-
// Don't fail the whole API response because Addwish is down etc
|
87
|
-
try {
|
88
|
-
// Could be refactored to use DataLoader
|
89
|
-
const response = yield fetchAddwishRecommendations({
|
90
|
-
ids: [id],
|
91
|
-
url
|
92
|
-
});
|
93
|
-
validateResponseBox({ response, id });
|
94
|
-
const box = response.result[id];
|
95
|
-
return {
|
96
|
-
id,
|
97
|
-
box,
|
98
|
-
errorCode: null,
|
99
|
-
countAfterSource: box.countAfterSource
|
100
|
-
};
|
101
|
-
}
|
102
|
-
catch (err) {
|
103
|
-
return {
|
104
|
-
id,
|
105
|
-
errorCode: err.message || 'Something went wrong',
|
106
|
-
box: null
|
107
|
-
};
|
108
|
-
}
|
109
|
-
});
|
110
|
-
}
|
111
|
-
}
|
112
|
-
},
|
113
|
-
GetAddwishProductsResponse: {
|
114
|
-
products: {
|
115
|
-
resolve({ box }, _args, context, info) {
|
116
|
-
return __awaiter(this, void 0, void 0, function* () {
|
117
|
-
if (!box) {
|
118
|
-
return null;
|
119
|
-
}
|
120
|
-
if (box.result.length <= 0) {
|
121
|
-
return [];
|
122
|
-
}
|
123
|
-
const articleNumbers = box.result.map(item => item.productNumber);
|
124
|
-
return info.mergeInfo.delegateToSchema({
|
125
|
-
schema: remoteSchema,
|
126
|
-
operation: 'query',
|
127
|
-
fieldName: 'products',
|
128
|
-
args: {
|
129
|
-
articleNumbers
|
130
|
-
},
|
131
|
-
context,
|
132
|
-
info
|
133
|
-
});
|
134
|
-
});
|
135
|
-
}
|
136
|
-
}
|
137
|
-
}
|
138
|
-
};
|
139
|
-
return { schema: print(typeDefs), resolvers };
|
140
|
-
};
|
141
|
-
//# sourceMappingURL=addwishSchemaExtension.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"addwishSchemaExtension.js","sourceRoot":"","sources":["addwishSchemaExtension.ts"],"names":[],"mappings":";;;;;;;;;AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,GAAG,MAAM,aAAa,CAAC;AAC9B,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,CAAC;AA6BpB,MAAM,QAAQ,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;CAgBnB,CAAC;AAEF,MAAM,uBAAwB,SAAQ,KAAK;IACzC,YACE,OAAe,EACf,EACE,EAAE,EACF,QAAQ,EACR,GAAG,EAKJ;QAED,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC;IAC/C,CAAC;CACF;AAED,MAAM,UAAU,mBAAmB,CAAC,EAClC,QAAQ,EACR,EAAE,EAIH;IACC,MAAM,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAEhC,IAAI,CAAC,GAAG,EAAE;QACR,MAAM,IAAI,uBAAuB,CAAC,+BAA+B,EAAE;YACjE,EAAE;YACF,QAAQ;YACR,GAAG;SACJ,CAAC,CAAC;KACJ;IACD,IAAI,GAAG,CAAC,SAAS,EAAE;QACjB,MAAM,IAAI,uBAAuB,CAAC,eAAe,GAAG,CAAC,SAAS,GAAG,EAAE;YACjE,EAAE;YACF,QAAQ;YACR,GAAG;SACJ,CAAC,CAAC;KACJ;IACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;QAC9B,MAAM,IAAI,uBAAuB,CAAC,iCAAiC,EAAE;YACnE,EAAE;YACF,QAAQ;YACR,GAAG;SACJ,CAAC,CAAC;KACJ;IACD,IAC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,GAAG,CAAC,gBAAgB;6BACvC,CAAC;yBACH;wBAAC,OAAO,GAAG,EAAE;4BACZ,OAAO;gCACL,EAAE;gCACF,SAAS,EAAE,GAAG,CAAC,OAAO,IAAI,sBAAsB;gCAChD,GAAG,EAAE,IAAI;6BACV,CAAC;yBACH;oBACH,CAAC;iBAAA;aACF;SACF;QACD,0BAA0B,EAAE;YAC1B,QAAQ,EAAE;gBACF,OAAO,CACX,EAAE,GAAG,EAA8B,EACnC,KAAK,EACL,OAAO,EACP,IAAI;;wBAEJ,IAAI,CAAC,GAAG,EAAE;4BACR,OAAO,IAAI,CAAC;yBACb;wBAED,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,EAAE;4BAC1B,OAAO,EAAE,CAAC;yBACX;wBAED,MAAM,cAAc,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;wBAElE,OAAO,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC;4BACrC,MAAM,EAAE,YAAY;4BACpB,SAAS,EAAE,OAAO;4BAClB,SAAS,EAAE,UAAU;4BACrB,IAAI,EAAE;gCACJ,cAAc;6BACf;4BACD,OAAO;4BACP,IAAI;yBACL,CAAC,CAAC;oBACL,CAAC;iBAAA;aACF;SACF;KACF,CAAC;IAEF,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC;AAChD,CAAC,CAAC"}
|
@@ -1,77 +0,0 @@
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8
|
-
});
|
9
|
-
};
|
10
|
-
import { setContext } from 'apollo-link-context';
|
11
|
-
import fetch from 'node-fetch';
|
12
|
-
import { introspectSchema, makeRemoteExecutableSchema, transformSchema, RenameTypes, RenameRootFields } from 'graphql-tools';
|
13
|
-
import { HttpLink } from 'apollo-link-http';
|
14
|
-
function getNostoSchema({ nostoApiToken }) {
|
15
|
-
return __awaiter(this, void 0, void 0, function* () {
|
16
|
-
const http = new HttpLink({
|
17
|
-
uri: `https://api.nosto.com/v1/graphql`,
|
18
|
-
fetch: fetch
|
19
|
-
});
|
20
|
-
// on introspect, get headers from conf/env
|
21
|
-
const introspectLink = setContext(() => ({
|
22
|
-
headers: {
|
23
|
-
Authorization: `Basic ${Buffer.from(`:${nostoApiToken}`).toString('base64')}`
|
24
|
-
}
|
25
|
-
})).concat(http);
|
26
|
-
// We could do this build-time to speed up start
|
27
|
-
const schema = yield introspectSchema(introspectLink);
|
28
|
-
const executableSchema = makeRemoteExecutableSchema({
|
29
|
-
schema,
|
30
|
-
link: introspectLink
|
31
|
-
});
|
32
|
-
const transformedNostoSchema = transformSchema(executableSchema, [
|
33
|
-
new RenameTypes((name) => `Nosto${name}`),
|
34
|
-
new RenameRootFields((_operation, name) => `nosto${name.substring(0, 1).toUpperCase()}${name.substring(1)}`)
|
35
|
-
]);
|
36
|
-
return transformedNostoSchema;
|
37
|
-
});
|
38
|
-
}
|
39
|
-
export const createNostoSchemaExtension = ({ nostoApiToken }) => {
|
40
|
-
const nostoSchemaExtension = ({ remoteSchema }) => __awaiter(void 0, void 0, void 0, function* () {
|
41
|
-
const schema = yield getNostoSchema({ nostoApiToken });
|
42
|
-
const resolvers = {
|
43
|
-
NostoRecommendedProduct: {
|
44
|
-
product: {
|
45
|
-
fragment: `... on RecommendedProduct { productId }`,
|
46
|
-
resolve(recommendedProduct, _args, context, info) {
|
47
|
-
return info.mergeInfo.delegateToSchema({
|
48
|
-
schema: remoteSchema,
|
49
|
-
operation: 'query',
|
50
|
-
fieldName: 'product',
|
51
|
-
args: {
|
52
|
-
id: parseInt(recommendedProduct.productId)
|
53
|
-
},
|
54
|
-
context,
|
55
|
-
info
|
56
|
-
});
|
57
|
-
}
|
58
|
-
}
|
59
|
-
}
|
60
|
-
};
|
61
|
-
return {
|
62
|
-
schema,
|
63
|
-
resolvers
|
64
|
-
};
|
65
|
-
});
|
66
|
-
return nostoSchemaExtension;
|
67
|
-
};
|
68
|
-
export const getNostoSchemaLinkTypeDefs = () => {
|
69
|
-
return {
|
70
|
-
schema: `
|
71
|
-
extend type NostoRecommendedProduct {
|
72
|
-
product: Product
|
73
|
-
}
|
74
|
-
`
|
75
|
-
};
|
76
|
-
};
|
77
|
-
//# sourceMappingURL=nostoSchemaExtension.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"nostoSchemaExtension.js","sourceRoot":"","sources":["nostoSchemaExtension.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EACL,gBAAgB,EAChB,0BAA0B,EAC1B,eAAe,EACf,WAAW,EACX,gBAAgB,EAEjB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,SAAe,cAAc,CAAC,EAC5B,aAAa,EAGd;;QACC,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC;YACxB,GAAG,EAAE,kCAAkC;YACvC,KAAK,EAAE,KAAY;SACpB,CAAC,CAAC;QAEH,2CAA2C;QAC3C,MAAM,cAAc,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC;YACvC,OAAO,EAAE;gBACP,aAAa,EAAE,SAAS,MAAM,CAAC,IAAI,CAAC,IAAI,aAAa,EAAE,CA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AC;6BAC3C;4BACD,OAAO;4BACP,IAAI;yBACL,CAAC,CAAC;oBACL,CAAC;iBACF;aACF;SACF,CAAC;QACF,OAAO;YACL,MAAM;YACN,SAAS;SACV,CAAC;IACJ,CAAC,CAAA,CAAC;IACF,OAAO,oBAAoB,CAAC;AAC9B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAoB,GAAG,EAAE;IAC9D,OAAO;QACL,MAAM,EAAE;;;;GAIT;KACA,CAAC;AACJ,CAAC,CAAC"}
|
@@ -1,27 +0,0 @@
|
|
1
|
-
import { print } from 'graphql';
|
2
|
-
import gql from 'graphql-tag';
|
3
|
-
export const sluggishSchemaExtension = () => {
|
4
|
-
const typeDefs = gql `
|
5
|
-
extend type Page {
|
6
|
-
sluggish: String!
|
7
|
-
}
|
8
|
-
`;
|
9
|
-
const resolvers = {
|
10
|
-
Page: {
|
11
|
-
sluggish: {
|
12
|
-
/**
|
13
|
-
* This fragment ensures that `id` + `name` are present in `source` when querying `sluggish`
|
14
|
-
*/
|
15
|
-
fragment: `... on Page { id, name }`,
|
16
|
-
resolve(source) {
|
17
|
-
return `${source.id}-${source.name
|
18
|
-
.toLowerCase()
|
19
|
-
.replace(/[^\w ]+/g, '')
|
20
|
-
.replace(/ +/g, '-')}`;
|
21
|
-
}
|
22
|
-
}
|
23
|
-
}
|
24
|
-
};
|
25
|
-
return { schema: print(typeDefs), resolvers };
|
26
|
-
};
|
27
|
-
//# sourceMappingURL=sluggishSchemaExtension.js.map
|
@@ -1 +0,0 @@
|
|
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,EAAE,CAAC;gBAC3B,CAAC;aACF;SACF;KACF,CAAC;IAEF,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC;AAChD,CAAC,CAAC"}
|
package/polyfills.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export declare const createPolyfill: (locale: string) => string;
|
package/polyfills.js
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
import { enableES5 } from 'immer';
|
2
|
-
enableES5();
|
3
|
-
const polyfills = (locale) => [
|
4
|
-
'es6',
|
5
|
-
'Object.values',
|
6
|
-
'Object.entries',
|
7
|
-
'Object.keys',
|
8
|
-
'Object.assign',
|
9
|
-
'Array.prototype.find',
|
10
|
-
'Array.prototype.findIndex',
|
11
|
-
'Array.prototype.flatMap',
|
12
|
-
'Array.prototype.includes',
|
13
|
-
'Array.prototype.keys',
|
14
|
-
'Array.from',
|
15
|
-
'Array.prototype.fill',
|
16
|
-
'String.prototype.endsWith',
|
17
|
-
'String.prototype.startsWith',
|
18
|
-
'URL',
|
19
|
-
'IntersectionObserver',
|
20
|
-
`Intl.~locale.${locale}`,
|
21
|
-
'Promise',
|
22
|
-
'fetch',
|
23
|
-
'Symbol',
|
24
|
-
'ResizeObserver'
|
25
|
-
];
|
26
|
-
export const createPolyfill = (locale) => {
|
27
|
-
const features = polyfills(locale).join(',');
|
28
|
-
// Here we add two script tags to be run once the client is loaded. One sets a global variable 'polyFillsLoaded' to false and adds a function bootShop which, when called will set 'polyFillsLoaded' to true. The second script will load the polyfills and once they are loaded will call the bootShop function to let the client know that the polyfills have been loaded and that the shop can be started.
|
29
|
-
return `
|
30
|
-
<script>
|
31
|
-
window.polyFillsLoaded = false;
|
32
|
-
window.bootShop = function() {
|
33
|
-
window.polyFillsLoaded = true;
|
34
|
-
};
|
35
|
-
</script>
|
36
|
-
<script async defer src="https://cdn.polyfill.io/v3/polyfill${process.env.NODE_ENV === 'production' ? '.min' : ''}.js?callback=bootShop&features=${features}&flags=gated"></script>`;
|
37
|
-
};
|
38
|
-
//# sourceMappingURL=polyfills.js.map
|
package/polyfills.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"polyfills.js","sourceRoot":"","sources":["polyfills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,SAAS,EAAE,CAAC;AAEZ,MAAM,SAAS,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC;IACpC,KAAK;IACL,eAAe;IACf,gBAAgB;IAChB,aAAa;IACb,eAAe;IACf,sBAAsB;IACtB,2BAA2B;IAC3B,yBAAyB;IACzB,0BAA0B;IAC1B,sBAAsB;IACtB,YAAY;IACZ,sBAAsB;IACtB,2BAA2B;IAC3B,6BAA6B;IAC7B,KAAK;IACL,sBAAsB;IACtB,gBAAgB,MAAM,EAAE;IACxB,SAAS;IACT,OAAO;IACP,QAAQ;IACR,gBAAgB;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAc,EAAE,EAAE;IAC/C,MAAM,QAAQ,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7C,6YAA6Y;IAC7Y,OAAO;;;;;;;gEAQL,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EACnD,kCAAkC,QAAQ,yBAAyB,CAAC;AACtE,CAAC,CAAC"}
|
@@ -1,85 +0,0 @@
|
|
1
|
-
import produce from 'immer';
|
2
|
-
import gql from 'graphql-tag';
|
3
|
-
import { updateBooleanQueryString } from './updateQueryString';
|
4
|
-
import { parse } from 'qs';
|
5
|
-
// QUERY
|
6
|
-
export const boolFilterValue = function boolFilterValue(parent) {
|
7
|
-
return (searchParams) => {
|
8
|
-
var _a;
|
9
|
-
const query = __IN_SERVER__ ? searchParams : document.location.search;
|
10
|
-
const parsed = parse(query, {
|
11
|
-
ignoreQueryPrefix: true
|
12
|
-
});
|
13
|
-
let result;
|
14
|
-
if (typeof ((_a = parsed.boolean) === null || _a === void 0 ? void 0 : _a[parent.id]) !== 'undefined') {
|
15
|
-
result = parsed.boolean[parent.id] === 'true';
|
16
|
-
}
|
17
|
-
else {
|
18
|
-
result = parent.default;
|
19
|
-
}
|
20
|
-
return result ? true : false;
|
21
|
-
};
|
22
|
-
};
|
23
|
-
////////////////////////////////////////////////////////////////////////////////
|
24
|
-
// MUTATION
|
25
|
-
export const setBoolFilter = (_, { value, id }, { cache, getCacheKey }) => {
|
26
|
-
const fragmentId = getCacheKey({
|
27
|
-
id,
|
28
|
-
__typename: 'BooleanFilter'
|
29
|
-
});
|
30
|
-
const boolFilter = cache.readFragment({
|
31
|
-
fragment: gql `
|
32
|
-
fragment BoolFilterState on BooleanFilter {
|
33
|
-
id
|
34
|
-
default
|
35
|
-
value @client
|
36
|
-
}
|
37
|
-
`,
|
38
|
-
id: fragmentId
|
39
|
-
});
|
40
|
-
const data = produce(boolFilter, draft => {
|
41
|
-
if (draft.default !== null) {
|
42
|
-
draft.value = value === draft.default ? null : value;
|
43
|
-
}
|
44
|
-
else {
|
45
|
-
draft.value = value === false ? null : value;
|
46
|
-
}
|
47
|
-
});
|
48
|
-
cache.writeData({
|
49
|
-
id: fragmentId,
|
50
|
-
data
|
51
|
-
});
|
52
|
-
// Update the active filters in cache
|
53
|
-
const activeFilters = updateActiveFilters(cache, data);
|
54
|
-
updateBooleanQueryString(activeFilters);
|
55
|
-
return data;
|
56
|
-
};
|
57
|
-
function updateActiveFilters(cache, data) {
|
58
|
-
const activeBoolFilterQuery = gql `
|
59
|
-
query GetActiveBoolFilters {
|
60
|
-
activeFilters @client {
|
61
|
-
booleanFilters {
|
62
|
-
id
|
63
|
-
value @client
|
64
|
-
}
|
65
|
-
}
|
66
|
-
}
|
67
|
-
`;
|
68
|
-
const currentActiveFilters = cache.readQuery({ query: activeBoolFilterQuery });
|
69
|
-
const { activeFilters } = produce(currentActiveFilters, draft => {
|
70
|
-
// Clear this filter from active filters
|
71
|
-
if (data.value === null) {
|
72
|
-
draft.activeFilters.booleanFilters = draft.activeFilters.booleanFilters.filter(boolFilter => boolFilter.id !== data.id);
|
73
|
-
}
|
74
|
-
else {
|
75
|
-
draft.activeFilters.booleanFilters.push({
|
76
|
-
id: data.id,
|
77
|
-
value: data.value,
|
78
|
-
__typename: 'BooleanFilterInput'
|
79
|
-
});
|
80
|
-
}
|
81
|
-
});
|
82
|
-
cache.writeData({ data: { activeFilters } });
|
83
|
-
return activeFilters;
|
84
|
-
}
|
85
|
-
//# sourceMappingURL=boolFilter.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"boolFilter.js","sourceRoot":"","sources":["boolFilter.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,OAAO,CAAC;AAI5B,OAAO,GAAG,MAAM,aAAa,CAAC;AAC9B,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,IAAI,CAAC;AAE3B,QAAQ;AACR,MAAM,CAAC,MAAM,eAAe,GAAa,SAAS,eAAe,CAAC,MAAM;IACtE,OAAO,CAAC,YAAoB,EAAW,EAAE;;QACvC,MAAM,KAAK,GAAG,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC;QAEtE,MAAM,MAAM,GAAG,KAAK,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E,EAAE;IAChB,cAAc,EAAE,EAAE;IAClB,gBAAgB,EAAE,EAAE;IACpB,UAAU,EAAE,eAAe;CAC5B,CAAC;AAEF,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|
@@ -1,85 +0,0 @@
|
|
1
|
-
// Manage the search params for filters using qs
|
2
|
-
import qs from 'qs';
|
3
|
-
import { defaultActiveFilters } from './defaultActiveFilters';
|
4
|
-
const typeMap = {
|
5
|
-
list: 'listFilters',
|
6
|
-
range: 'rangeFilters',
|
7
|
-
boolean: 'booleanFilters',
|
8
|
-
multiList: 'multiListFilters'
|
9
|
-
};
|
10
|
-
export function getActiveFiltersFromSearch(query) {
|
11
|
-
if (!query || query.length === 0) {
|
12
|
-
return defaultActiveFilters;
|
13
|
-
}
|
14
|
-
// Query may be a string (from location.search) or an object (from req.query)
|
15
|
-
const initialSearchParams = typeof query === 'string'
|
16
|
-
? qs.parse(query, {
|
17
|
-
ignoreQueryPrefix: true,
|
18
|
-
arrayLimit: 100
|
19
|
-
})
|
20
|
-
: query;
|
21
|
-
const typeMapValues = new Set(Object.keys(typeMap));
|
22
|
-
const filterParams = Object.keys(initialSearchParams)
|
23
|
-
.map((param) => {
|
24
|
-
return typeMapValues.has(param)
|
25
|
-
? { [param]: initialSearchParams[param] }
|
26
|
-
: false;
|
27
|
-
})
|
28
|
-
.filter(Boolean);
|
29
|
-
// If there are no filter keys in the search params, do nothing
|
30
|
-
if (filterParams.length === 0)
|
31
|
-
return defaultActiveFilters;
|
32
|
-
const activeFilters = Object.assign({}, defaultActiveFilters);
|
33
|
-
filterParams.forEach((filter) => {
|
34
|
-
convertFilterQueryToActiveFilter({
|
35
|
-
activeFilters,
|
36
|
-
initialSearchParams,
|
37
|
-
filter
|
38
|
-
});
|
39
|
-
});
|
40
|
-
return activeFilters;
|
41
|
-
}
|
42
|
-
function convertFilterQueryToActiveFilter({ initialSearchParams, filter, activeFilters }) {
|
43
|
-
switch (Object.keys(filter)[0]) {
|
44
|
-
case 'list':
|
45
|
-
return (activeFilters['listFilters'] = Object.keys(filter.list).map((id) => {
|
46
|
-
const filter = {
|
47
|
-
id,
|
48
|
-
values: initialSearchParams.list[id],
|
49
|
-
__typename: 'ListFilterInput'
|
50
|
-
};
|
51
|
-
return filter;
|
52
|
-
}));
|
53
|
-
case 'range':
|
54
|
-
return (activeFilters['rangeFilters'] = Object.keys(filter.range).map((id) => {
|
55
|
-
const filter = {
|
56
|
-
id,
|
57
|
-
min: +initialSearchParams.range[id][0],
|
58
|
-
max: +initialSearchParams.range[id][1],
|
59
|
-
__typename: 'RangeFilterInput'
|
60
|
-
};
|
61
|
-
return filter;
|
62
|
-
}));
|
63
|
-
case 'boolean':
|
64
|
-
return (activeFilters['booleanFilters'] = Object.keys(filter.boolean).map((id) => {
|
65
|
-
const filter = {
|
66
|
-
id,
|
67
|
-
value: JSON.parse(initialSearchParams.boolean[id]),
|
68
|
-
__typename: 'BooleanFilterInput'
|
69
|
-
};
|
70
|
-
return filter;
|
71
|
-
}));
|
72
|
-
case 'multiList':
|
73
|
-
return (activeFilters['multiListFilters'] = Object.keys(filter.multiList).map((id) => {
|
74
|
-
const filter = {
|
75
|
-
id,
|
76
|
-
values: initialSearchParams.multiList[id],
|
77
|
-
__typename: 'MultiListFilterInput'
|
78
|
-
};
|
79
|
-
return filter;
|
80
|
-
}));
|
81
|
-
default:
|
82
|
-
break;
|
83
|
-
}
|
84
|
-
}
|
85
|
-
//# sourceMappingURL=filterParams.js.map
|