@jetshop/core 5.8.4 → 5.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ChannelHandler/ChannelHandler.d.ts +9 -13
- package/ChannelHandler/ChannelHandler.js +24 -66
- package/ChannelHandler/ChannelHandler.js.map +1 -1
- package/ChannelHandler/channelUtils.d.ts +13 -0
- package/ChannelHandler/channelUtils.js +26 -15
- package/ChannelHandler/channelUtils.js.map +1 -1
- package/ChannelHandler/redirectUtils.d.ts +3 -0
- package/ChannelHandler/redirectUtils.js +48 -0
- package/ChannelHandler/redirectUtils.js.map +1 -0
- package/ChannelHandler/redirectUtils.test.js +8 -0
- package/analytics/AnalyticsProvider.js +9 -2
- package/analytics/AnalyticsProvider.js.map +1 -1
- package/analytics/integrations/ga4.d.ts +2 -1
- package/analytics/integrations/ga4.js +15 -6
- package/analytics/integrations/ga4.js.map +1 -1
- package/analytics/integrations/gtag/gtag.d.ts +2 -1
- package/analytics/integrations/gtag/gtag.js +20 -10
- package/analytics/integrations/gtag/gtag.js.map +1 -1
- package/analytics/integrations/gtm/index.d.ts +10 -1
- package/analytics/integrations/gtm/index.js +175 -2
- package/analytics/integrations/gtm/index.js.map +1 -1
- package/boot/SharedTree.js +1 -1
- package/boot/SharedTree.js.map +1 -1
- package/boot/apollo.d.ts +5 -4
- package/boot/apollo.js +18 -18
- package/boot/apollo.js.map +1 -1
- package/boot/client/startClient.js +7 -16
- package/boot/client/startClient.js.map +1 -1
- package/boot/server/createRenderer.js +8 -7
- package/boot/server/createRenderer.js.map +1 -1
- package/boot/server/index.js +2 -2
- package/boot/server/index.js.map +1 -1
- package/boot/server/persistedQueries/__tests__/getPersistedQueriesForRequest.test.js +53 -39
- package/boot/server/persistedQueries/getPersistedQueriesForRequest.js +2 -2
- package/boot/server/persistedQueries/getPersistedQueriesForRequest.js.map +1 -1
- package/cart/useAddToCart.d.ts +2 -2
- package/cart/useAddToCart.js +13 -12
- package/cart/useAddToCart.js.map +1 -1
- package/components/Auth/CustomerUpdateForm.js +7 -7
- package/components/Auth/CustomerUpdateForm.js.map +1 -1
- package/components/AuthContext/LogOut.d.ts +1 -0
- package/components/ChannelContext/ChannelProvider.d.ts +1 -3
- package/components/ChannelContext/ChannelProvider.js +6 -13
- package/components/ChannelContext/ChannelProvider.js.map +1 -1
- package/components/ChannelContext/ChannelProvider.test.js +110 -0
- package/components/ConfigProvider.d.ts +1 -0
- package/components/ConfigProvider.js.map +1 -1
- package/components/DynamicRoute/ContentRoute.d.ts +1 -1
- package/components/DynamicRoute/ProductByArticlenumber.d.ts +1 -0
- package/components/DynamicRoute/ProductRoute.d.ts +1 -0
- package/components/DynamicRoute/ProductRoute.js +4 -2
- package/components/DynamicRoute/ProductRoute.js.map +1 -1
- package/components/DynamicRoute/RouteResolver.js +1 -1
- package/components/DynamicRoute/RouteResolver.js.map +1 -1
- package/components/Mutation/AddToCart/addToCartUtils.js +3 -2
- package/components/Mutation/AddToCart/addToCartUtils.js.map +1 -1
- package/components/Mutation/DecrementQuantity.d.ts +1 -0
- package/components/Mutation/IncrementQuantity.d.ts +1 -0
- package/components/Mutation/RemoveFromCart.d.ts +2 -1
- package/components/Mutation/SetQuantity.d.ts +1 -0
- package/components/Mutation/cartMutationUtils.js +7 -6
- package/components/Mutation/cartMutationUtils.js.map +1 -1
- package/components/OpenGraph/OpenGraph.test.js +32 -5
- package/components/OpenGraph/OpenGraphProductData.d.ts +6 -1
- package/components/OpenGraph/OpenGraphProductData.js +18 -12
- package/components/OpenGraph/OpenGraphProductData.js.map +1 -1
- package/components/Query/CartProvider.js +32 -22
- package/components/Query/CartProvider.js.map +1 -1
- package/components/StructuredData/SiteLinksSearchStructuredData.d.ts +1 -0
- package/components/StructuredData/StructuredBreadcrumbData.d.ts +1 -0
- package/components/StructuredData/StructuredBreadcrumbData.js +4 -3
- package/components/StructuredData/StructuredBreadcrumbData.js.map +1 -1
- package/data/fragments/ProductListsFragments.gql +94 -0
- package/data/mutations/productListMutations.gql +18 -0
- package/data/queries/ProductLists.gql +8 -0
- package/dependencies.d.ts +10 -1
- package/hooks/ProductList/ProductListContext.js +49 -14
- package/hooks/ProductList/ProductListContext.js.map +1 -1
- package/hooks/ProductList/ProductLists.gql +0 -0
- package/hooks/ProductList/action-creators.d.ts +20 -7
- package/hooks/ProductList/action-creators.js +138 -44
- package/hooks/ProductList/action-creators.js.map +1 -1
- package/hooks/ProductList/index.d.ts +34 -8
- package/hooks/ProductList/index.js +19 -0
- package/hooks/ProductList/index.js.map +1 -1
- package/hooks/ProductList/list-transforms.d.ts +3 -2
- package/hooks/ProductList/list-transforms.js +22 -22
- package/hooks/ProductList/list-transforms.js.map +1 -1
- package/hooks/ProductList/list-transforms.test.js +103 -100
- package/hooks/ProductList/product-list-reducer.d.ts +37 -14
- package/hooks/ProductList/product-list-reducer.js +106 -43
- package/hooks/ProductList/product-list-reducer.js.map +1 -1
- package/hooks/ProductList/product-list-reducer.test.js +144 -82
- package/hooks/ProductList/useProductList.d.ts +2 -2
- package/hooks/ProductList/useProductList.js +12 -5
- package/hooks/ProductList/useProductList.js.map +1 -1
- package/hooks/ProductList/useProductListItems.d.ts +1 -1
- package/hooks/ProductList/useProductListItems.js +8 -6
- package/hooks/ProductList/useProductListItems.js.map +1 -1
- package/hooks/useInfinitePagination.js +1 -1
- package/hooks/useInfinitePagination.js.map +1 -1
- package/hooks/useRoutePreload.js +2 -2
- package/hooks/useRoutePreload.js.map +1 -1
- package/package.json +5 -5
- package/resolvers/index.d.ts +3 -0
- package/resolvers/index.js +3 -0
- package/resolvers/index.js.map +1 -1
- package/sentry/client.js +9 -4
- package/sentry/client.js.map +1 -1
- package/sentry/common.d.ts +1 -0
- package/sentry/common.js +5 -0
- package/sentry/common.js.map +1 -0
- package/sentry/server.js +11 -2
- package/sentry/server.js.map +1 -1
- package/time.d.ts +1 -0
- package/time.js +6 -0
- package/time.js.map +1 -0
- package/types.d.ts +1 -0
|
@@ -5,12 +5,13 @@ function StructuredBreadcrumbData({ parents, breadcrumbText }) {
|
|
|
5
5
|
const { selectedChannel } = useContext(ChannelContext);
|
|
6
6
|
let mappedParents = [];
|
|
7
7
|
if (parents && parents.length > 0) {
|
|
8
|
-
mappedParents = parents
|
|
9
|
-
var _a;
|
|
8
|
+
mappedParents = parents
|
|
9
|
+
.filter((parent) => { var _a; return (_a = parent.object) === null || _a === void 0 ? void 0 : _a.breadcrumbText; })
|
|
10
|
+
.map((parent, index) => {
|
|
10
11
|
return {
|
|
11
12
|
'@type': 'ListItem',
|
|
12
13
|
position: parents.length - index,
|
|
13
|
-
name:
|
|
14
|
+
name: parent.object.breadcrumbText.toString(),
|
|
14
15
|
item: `${selectedChannel.url}${parent.path}`
|
|
15
16
|
};
|
|
16
17
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StructuredBreadcrumbData.js","sourceRoot":"","sources":["StructuredBreadcrumbData.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,SAAS,wBAAwB,CAAC,EAChC,OAAO,EACP,cAAc,EAIf;IACC,MAAM,EAAE,eAAe,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IACvD,IAAI,aAAa,GAAe,EAAE,CAAC;IACnC,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;QACjC,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE
|
|
1
|
+
{"version":3,"file":"StructuredBreadcrumbData.js","sourceRoot":"","sources":["StructuredBreadcrumbData.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,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|
|
2
|
+
#import "@jetshop/core/data/fragments/ProductPriceFragment.gql"
|
|
3
|
+
|
|
4
|
+
fragment MinimalProductListDetail on CustomerProductList {
|
|
5
|
+
id
|
|
6
|
+
name
|
|
7
|
+
# TODO
|
|
8
|
+
# typeId {...}
|
|
9
|
+
# description
|
|
10
|
+
items {
|
|
11
|
+
variant {
|
|
12
|
+
articleNumber
|
|
13
|
+
}
|
|
14
|
+
product {
|
|
15
|
+
articleNumber
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
fragment VariantDetail on ProductVariant {
|
|
21
|
+
id
|
|
22
|
+
articleNumber
|
|
23
|
+
values
|
|
24
|
+
stockStatus {
|
|
25
|
+
buyable
|
|
26
|
+
text
|
|
27
|
+
}
|
|
28
|
+
images {
|
|
29
|
+
modifiedDate
|
|
30
|
+
alt
|
|
31
|
+
title
|
|
32
|
+
url
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
fragment VariantsDetail on ProductVariants {
|
|
37
|
+
options {
|
|
38
|
+
name
|
|
39
|
+
values
|
|
40
|
+
}
|
|
41
|
+
values {
|
|
42
|
+
...VariantDetail
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
fragment ProductDetail on Product {
|
|
47
|
+
id
|
|
48
|
+
articleNumber
|
|
49
|
+
name
|
|
50
|
+
subName
|
|
51
|
+
hasConfigurations
|
|
52
|
+
hasVariants
|
|
53
|
+
isPreOrder
|
|
54
|
+
isPackage
|
|
55
|
+
stockStatus {
|
|
56
|
+
buyable
|
|
57
|
+
text
|
|
58
|
+
}
|
|
59
|
+
primaryRoute {
|
|
60
|
+
id
|
|
61
|
+
path
|
|
62
|
+
slug
|
|
63
|
+
}
|
|
64
|
+
...ProductPrice
|
|
65
|
+
badges {
|
|
66
|
+
...Badge
|
|
67
|
+
}
|
|
68
|
+
images {
|
|
69
|
+
modifiedDate
|
|
70
|
+
alt
|
|
71
|
+
title
|
|
72
|
+
url
|
|
73
|
+
}
|
|
74
|
+
variants {
|
|
75
|
+
...VariantsDetail
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
fragment ProductListFragment on CustomerProductList {
|
|
80
|
+
id
|
|
81
|
+
description
|
|
82
|
+
name
|
|
83
|
+
shareToken
|
|
84
|
+
items {
|
|
85
|
+
quantity
|
|
86
|
+
description
|
|
87
|
+
product {
|
|
88
|
+
...ProductDetail
|
|
89
|
+
}
|
|
90
|
+
variant {
|
|
91
|
+
...VariantDetail
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#import "@jetshop/core/data/fragments/ProductListsFragments.gql"
|
|
2
|
+
|
|
3
|
+
## Create a product list
|
|
4
|
+
mutation CreateProductList($input: CreateCustomerProductListInput!) {
|
|
5
|
+
createCustomerProductList(input: $input) {
|
|
6
|
+
success
|
|
7
|
+
customerProductList {
|
|
8
|
+
...MinimalProductListDetail
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
## delete product list
|
|
14
|
+
mutation DeleteProductList($id: ID) {
|
|
15
|
+
deleteCustomerProductList(id: $id) {
|
|
16
|
+
success
|
|
17
|
+
}
|
|
18
|
+
}
|
package/dependencies.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ declare module '@jetshop/intl/config';
|
|
|
11
11
|
declare module 'store-css';
|
|
12
12
|
declare module 'dnscache';
|
|
13
13
|
declare module 'isbot' {
|
|
14
|
-
export default function(userAgent: string): boolean;
|
|
14
|
+
export default function (userAgent: string): boolean;
|
|
15
15
|
}
|
|
16
16
|
declare module '*.gql' {
|
|
17
17
|
import { DocumentNode } from 'graphql';
|
|
@@ -32,6 +32,15 @@ declare module '@jetshop/core/data/mutations/accountMutations.gql' {
|
|
|
32
32
|
export const resetRequest: DocumentNode;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
declare module '@jetshop/core/data/mutations/productListMutations.gql' {
|
|
36
|
+
export const CreateProductList: DocumentNode;
|
|
37
|
+
export const DeleteProductList: DocumentNode;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
declare module '@jetshop/core/data/queries/ProductLists.gql' {
|
|
41
|
+
export const ProductLists: DocumentNode;
|
|
42
|
+
}
|
|
43
|
+
|
|
35
44
|
declare module '*.svg' {
|
|
36
45
|
import React = require('react');
|
|
37
46
|
|
|
@@ -11,28 +11,60 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import React, { useEffect, useMemo } from 'react';
|
|
13
13
|
import { useMutation, useQuery } from 'react-apollo';
|
|
14
|
+
import useWarningInDev from '@jetshop/core/hooks/useWarningInDev';
|
|
15
|
+
import productListQueries from '@jetshop/core/data/queries/ProductLists.gql';
|
|
16
|
+
import productListMutations from '@jetshop/core/data/mutations/productListMutations.gql';
|
|
17
|
+
import { emptyProductLists, productListMapToArray, PRODUCT_LISTS_KEY } from '.';
|
|
14
18
|
import useAuth from '../../components/AuthContext/useAuth';
|
|
15
19
|
import { useThunkReducer } from '../useThunkReducer';
|
|
16
|
-
import { loginAction, refreshAction } from './action-creators';
|
|
20
|
+
import { createListAction, deleteListAction, loginAction, refreshAction } from './action-creators';
|
|
17
21
|
import { normalizeServerList } from './list-transforms';
|
|
18
22
|
import { init, reducer } from './product-list-reducer';
|
|
19
23
|
export const ProductListContext = React.createContext(undefined);
|
|
20
|
-
|
|
24
|
+
function useMissingQueryWarning(property, queries) {
|
|
25
|
+
return useWarningInDev(!(property in queries), `No \`${property}\` query available in \`queries\` for \`ProductListProvider\`. ` +
|
|
26
|
+
`Check migration guide for 5.11.0 (product lists section) to remove this warning`);
|
|
27
|
+
}
|
|
21
28
|
export const ProductListProvider = function ProductListProvider(_a) {
|
|
22
29
|
var { queries, initialState = {} } = _a, rest = __rest(_a, ["queries", "initialState"]);
|
|
30
|
+
// NOTE: Warn about missing queries, should be removed in next major release.
|
|
31
|
+
useMissingQueryWarning('all', queries);
|
|
32
|
+
useMissingQueryWarning('createList', queries);
|
|
33
|
+
useMissingQueryWarning('deleteList', queries);
|
|
23
34
|
const { loggedIn } = useAuth();
|
|
24
35
|
const requestIdRef = React.useRef(null);
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
skip: !loggedIn
|
|
36
|
+
const allQuery = queries.all || productListQueries.ProductLists;
|
|
37
|
+
const { data: serverList, client } = useQuery(allQuery, {
|
|
38
|
+
skip: !loggedIn
|
|
28
39
|
});
|
|
40
|
+
const lists = serverList
|
|
41
|
+
? new Map(serverList.customerProductLists.map(
|
|
42
|
+
// The default list (name === null) must have listId null
|
|
43
|
+
(productList) => [
|
|
44
|
+
productList.name === null ? null : productList.id,
|
|
45
|
+
normalizeServerList(productList)
|
|
46
|
+
]))
|
|
47
|
+
: emptyProductLists();
|
|
29
48
|
const defaultInitialState = Object.assign({ loggedIn,
|
|
30
|
-
requestIdRef,
|
|
49
|
+
requestIdRef,
|
|
50
|
+
lists }, initialState);
|
|
31
51
|
const [state, dispatch] = useThunkReducer(reducer, defaultInitialState, (initialState) => init(initialState));
|
|
32
52
|
const usingLocalList = !state.loggedIn;
|
|
33
|
-
usePersistLocalList({
|
|
53
|
+
usePersistLocalList({ lists: state.lists });
|
|
54
|
+
// When localstorage updates, sync it to reducer state
|
|
34
55
|
useLocalStorageListener({ refresh });
|
|
56
|
+
// loginMutation is a mutation to merge product lists
|
|
35
57
|
const [loginMutation] = useMutation(queries.login);
|
|
58
|
+
// To be used to fetch all lists of user after login
|
|
59
|
+
const fetchAll = () => client.query({ query: allQuery });
|
|
60
|
+
const [createMutation] = useMutation(queries.createList || productListMutations.CreateProductList);
|
|
61
|
+
const [deleteListMutation] = useMutation(queries.deleteList || productListMutations.DeleteProductList);
|
|
62
|
+
function deleteList(listId) {
|
|
63
|
+
dispatch(deleteListAction({ listId, deleteListMutation }));
|
|
64
|
+
}
|
|
65
|
+
function createList(name) {
|
|
66
|
+
dispatch(createListAction({ name, createMutation }));
|
|
67
|
+
}
|
|
36
68
|
function refresh() {
|
|
37
69
|
dispatch(refreshAction());
|
|
38
70
|
}
|
|
@@ -40,14 +72,16 @@ export const ProductListProvider = function ProductListProvider(_a) {
|
|
|
40
72
|
if (loggedIn === state.loggedIn)
|
|
41
73
|
return;
|
|
42
74
|
loggedIn
|
|
43
|
-
? dispatch(loginAction({ loginMutation }))
|
|
44
|
-
: dispatch({ type: 'LOGOUT' });
|
|
75
|
+
? dispatch(loginAction({ loginMutation, fetchAll })) // Merge logged out lists to account
|
|
76
|
+
: dispatch({ type: 'LOGOUT' }); // Clear lists
|
|
45
77
|
}, [dispatch, loggedIn, loginMutation, state.loggedIn]);
|
|
46
78
|
const value = useMemo(() => ({
|
|
79
|
+
createList,
|
|
80
|
+
deleteList,
|
|
47
81
|
state,
|
|
48
82
|
dispatch,
|
|
49
83
|
queries,
|
|
50
|
-
usingLocalList
|
|
84
|
+
usingLocalList
|
|
51
85
|
}), [dispatch, queries, state, usingLocalList]);
|
|
52
86
|
// We spread props here so during testing we can override value
|
|
53
87
|
return React.createElement(ProductListContext.Provider, Object.assign({ value: value }, rest));
|
|
@@ -55,15 +89,16 @@ export const ProductListProvider = function ProductListProvider(_a) {
|
|
|
55
89
|
/**
|
|
56
90
|
* Persist local list to localStorage on every change
|
|
57
91
|
*/
|
|
58
|
-
function usePersistLocalList({
|
|
92
|
+
function usePersistLocalList({ lists }) {
|
|
93
|
+
const productListArray = productListMapToArray(lists);
|
|
59
94
|
useEffect(() => {
|
|
60
|
-
localStorage.setItem(
|
|
61
|
-
}, [
|
|
95
|
+
localStorage.setItem(PRODUCT_LISTS_KEY, JSON.stringify(productListArray));
|
|
96
|
+
}, [lists]);
|
|
62
97
|
}
|
|
63
98
|
function useLocalStorageListener({ refresh }) {
|
|
64
99
|
useEffect(() => {
|
|
65
100
|
const listener = (e) => {
|
|
66
|
-
if (e.storageArea === localStorage && e.key ===
|
|
101
|
+
if (e.storageArea === localStorage && e.key === PRODUCT_LISTS_KEY) {
|
|
67
102
|
refresh();
|
|
68
103
|
}
|
|
69
104
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductListContext.js","sourceRoot":"","sources":["ProductListContext.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAW,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"ProductListContext.js","sourceRoot":"","sources":["ProductListContext.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAW,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,eAAe,MAAM,qCAAqC,CAAC;AAClE,OAAO,kBAAkB,MAAM,6CAA6C,CAAC;AAC7E,OAAO,oBAAoB,MAAM,uDAAuD,CAAC;AACzF,OAAO,EAEL,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EAKlB,MAAM,GAAG,CAAC;AACX,OAAO,OAAO,MAAM,sCAAsC,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,aAAa,EACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAU,IAAI,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAE/D,MAAM,CAAC,MAAM,kBAAkB,GAC7B,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;AAEjC,SAAS,sBAAsB,CAAC,QAAgB,EAAE,OAAY;IAC5D,OAAO,eAAe,CACpB,CAAC,CAAC,QAAQ,IA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QAClD,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC"}
|
|
File without changes
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { MutationFunction } from 'react-apollo';
|
|
3
|
-
import { AddToListMutation, ProductListItemOptions, ProductListState, RemoveFromListMutation, UpdateListInput, UpdateListOptions } from '.';
|
|
3
|
+
import { AddToListMutation, ProductListItemOptions, ProductListState, ProductListId, RemoveFromListMutation, UpdateListInput, UpdateListOptions } from '.';
|
|
4
4
|
import { Mutation } from '../../types';
|
|
5
5
|
import { Action } from './product-list-reducer';
|
|
6
|
-
export declare function loginAction({ loginMutation }: {
|
|
7
|
-
loginMutation: MutationFunction<Mutation
|
|
6
|
+
export declare function loginAction({ loginMutation, fetchAll }: {
|
|
7
|
+
loginMutation: MutationFunction<Pick<Mutation, 'addToCustomerProductList'>>;
|
|
8
|
+
fetchAll: any;
|
|
8
9
|
}): (dispatch: React.Dispatch<Action>, getState: () => ProductListState) => void;
|
|
9
10
|
export declare function refreshAction(): (dispatch: React.Dispatch<Action>) => void;
|
|
10
|
-
export declare function
|
|
11
|
+
export declare function createListAction({ createMutation, name }: {
|
|
12
|
+
createMutation: MutationFunction<Pick<Mutation, 'createCustomerProductList'>>;
|
|
13
|
+
name: string;
|
|
14
|
+
}): (dispatch: React.Dispatch<Action>) => void;
|
|
15
|
+
export declare function deleteListAction({ listId, deleteListMutation }: {
|
|
16
|
+
listId: ProductListId;
|
|
17
|
+
deleteListMutation: MutationFunction<Pick<Mutation, 'deleteCustomerProductList'>>;
|
|
18
|
+
}): (dispatch: React.Dispatch<Action>) => void;
|
|
19
|
+
export declare function updateAction({ listId, updateAPI, removeMutation, addMutation, options, articleNumber, variantToReplace, variantArticleNumber }: {
|
|
20
|
+
listId: ProductListId;
|
|
11
21
|
updateAPI: boolean;
|
|
12
22
|
removeMutation: RemoveFromListMutation;
|
|
13
23
|
addMutation: AddToListMutation;
|
|
@@ -16,16 +26,19 @@ export declare function updateAction({ updateAPI, removeMutation, addMutation, o
|
|
|
16
26
|
variantArticleNumber: string;
|
|
17
27
|
articleNumber: string;
|
|
18
28
|
}): (dispatch: React.Dispatch<Action>, getState: () => ProductListState) => void;
|
|
19
|
-
export declare function removeAction({ updateAPI, articleNumber, variantArticleNumber, removeMutation }: UpdateListInput & {
|
|
29
|
+
export declare function removeAction({ listId, updateAPI, articleNumber, variantArticleNumber, removeMutation }: UpdateListInput & {
|
|
30
|
+
listId: ProductListId;
|
|
20
31
|
removeMutation: RemoveFromListMutation;
|
|
21
32
|
updateAPI: boolean;
|
|
22
33
|
articleNumber: string;
|
|
23
34
|
}): (dispatch: React.Dispatch<Action>, getState: () => ProductListState) => void;
|
|
24
|
-
export declare function clearAction({ updateAPI, removeMutation }: {
|
|
35
|
+
export declare function clearAction({ listId, updateAPI, removeMutation }: {
|
|
36
|
+
listId: ProductListId;
|
|
25
37
|
updateAPI: boolean;
|
|
26
38
|
removeMutation: RemoveFromListMutation;
|
|
27
39
|
}): (dispatch: React.Dispatch<Action>, getState: () => ProductListState) => void;
|
|
28
|
-
export declare function addAction({ articleNumber, variantArticleNumber, addMutation, options, updateAPI }: UpdateListInput & {
|
|
40
|
+
export declare function addAction({ listId, articleNumber, variantArticleNumber, addMutation, options, updateAPI }: UpdateListInput & {
|
|
41
|
+
listId: ProductListId;
|
|
29
42
|
addMutation: AddToListMutation;
|
|
30
43
|
options: ProductListItemOptions;
|
|
31
44
|
updateAPI: boolean;
|