@clicktap/state 0.13.13 → 0.13.14
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/index.js +34 -60
- package/index.mjs +3212 -6882
- package/package.json +3 -5
- package/quote/actions/addItems.d.ts +77 -30
- package/quote/actions/refresh.d.ts +77 -30
- package/quote/actions/removeItems.d.ts +47 -45
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clicktap/state",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.14",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Clicktap",
|
|
6
6
|
"description": "A state management library for Clicktap reference frontend.",
|
|
@@ -15,17 +15,15 @@
|
|
|
15
15
|
"types": "./index.d.ts",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@graphql-typed-document-node/core": "^3.2.0",
|
|
18
|
-
"@xstate/react": "^4.1.
|
|
18
|
+
"@xstate/react": "^4.1.1",
|
|
19
19
|
"cookie": "^0.5.0",
|
|
20
20
|
"graphql": "^16.6.0",
|
|
21
21
|
"graphql-request": "^6.1.0",
|
|
22
|
-
"lodash": "^4.17.21",
|
|
23
22
|
"nanoid": "^4.0.2",
|
|
24
|
-
"xstate": "^5.
|
|
23
|
+
"xstate": "^5.13.0"
|
|
25
24
|
},
|
|
26
25
|
"devDependencies": {
|
|
27
26
|
"@types/cookie": "^0.5.1",
|
|
28
|
-
"@types/lodash": "^4.17.1",
|
|
29
27
|
"@types/react": "18.0.28"
|
|
30
28
|
},
|
|
31
29
|
"peerDependencies": {
|
|
@@ -2,34 +2,81 @@ import { QuoteMachineContext, QuoteMachineEvents } from '../types';
|
|
|
2
2
|
export declare function addItems({ context, event, }: {
|
|
3
3
|
context: QuoteMachineContext;
|
|
4
4
|
event: QuoteMachineEvents;
|
|
5
|
-
}): QuoteMachineContext |
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
5
|
+
}): QuoteMachineContext | {
|
|
6
|
+
quote: {
|
|
7
|
+
quote?: {
|
|
8
|
+
id: string | null;
|
|
9
|
+
locale: string | null;
|
|
10
|
+
baseCurrency: string | null;
|
|
11
|
+
currency: string | null;
|
|
12
|
+
currencyConversionRate: number | null;
|
|
13
|
+
dateCreated: Date | null;
|
|
14
|
+
dateLastUpdated: Date | null;
|
|
15
|
+
items: Record<string, any>[] | null;
|
|
16
|
+
promotions: Record<string, any>[] | null;
|
|
17
|
+
shippingAddresses: {
|
|
18
|
+
available: Record<string, any>[];
|
|
19
|
+
selected: string | null;
|
|
20
|
+
} | null;
|
|
21
|
+
totals: {
|
|
22
|
+
discount: number;
|
|
23
|
+
tax: number;
|
|
24
|
+
shipping: number;
|
|
25
|
+
shippingTax: number;
|
|
26
|
+
subtotal: number;
|
|
27
|
+
grandTotal: number;
|
|
28
|
+
} | null;
|
|
29
|
+
appliedPriceRules: Record<string, any>[] | null;
|
|
30
|
+
appliedPromotions: Record<string, any>[] | null;
|
|
31
|
+
shippingMethods: Record<string, any>[] | null;
|
|
32
|
+
paymentMethods: Record<string, any>[] | null;
|
|
33
|
+
storeCredit: Record<string, any>[] | null;
|
|
34
|
+
rewards: Record<string, any>[] | null;
|
|
35
|
+
giftCards: Record<string, any>[] | null;
|
|
36
|
+
} | undefined;
|
|
37
|
+
endpoints?: {
|
|
38
|
+
client?: string | undefined;
|
|
39
|
+
server?: string | undefined;
|
|
40
|
+
} | undefined;
|
|
41
|
+
graphql?: {
|
|
42
|
+
refresh: {
|
|
43
|
+
document: import("graphql-request").RequestDocument | import("@graphql-typed-document-node/core").TypedDocumentNode<unknown, {}>;
|
|
44
|
+
requestHeaders?: import("graphql-request/build/esm/types").GraphQLClientRequestHeaders | undefined;
|
|
45
|
+
};
|
|
46
|
+
addItems: {
|
|
47
|
+
document: import("graphql-request").RequestDocument | import("@graphql-typed-document-node/core").TypedDocumentNode<unknown, {}>;
|
|
48
|
+
requestHeaders?: import("graphql-request/build/esm/types").GraphQLClientRequestHeaders | undefined;
|
|
49
|
+
};
|
|
50
|
+
} | undefined;
|
|
51
|
+
errors?: string[] | undefined;
|
|
52
|
+
id: string | null;
|
|
53
|
+
locale: string | null;
|
|
54
|
+
baseCurrency: string | null;
|
|
55
|
+
currency: string | null;
|
|
56
|
+
currencyConversionRate: number | null;
|
|
57
|
+
dateCreated: Date | null;
|
|
58
|
+
dateLastUpdated: Date | null;
|
|
59
|
+
items: Record<string, any>[] | null;
|
|
60
|
+
promotions: Record<string, any>[] | null;
|
|
61
|
+
shippingAddresses: {
|
|
62
|
+
available: Record<string, any>[];
|
|
63
|
+
selected: string | null;
|
|
64
|
+
} | null;
|
|
65
|
+
totals: {
|
|
66
|
+
discount: number;
|
|
67
|
+
tax: number;
|
|
68
|
+
shipping: number;
|
|
69
|
+
shippingTax: number;
|
|
70
|
+
subtotal: number;
|
|
71
|
+
grandTotal: number;
|
|
72
|
+
} | null;
|
|
73
|
+
appliedPriceRules: Record<string, any>[] | null;
|
|
74
|
+
appliedPromotions: Record<string, any>[] | null;
|
|
75
|
+
shippingMethods: Record<string, any>[] | null;
|
|
76
|
+
paymentMethods: Record<string, any>[] | null;
|
|
77
|
+
storeCredit: Record<string, any>[] | null;
|
|
78
|
+
rewards: Record<string, any>[] | null;
|
|
79
|
+
giftCards: Record<string, any>[] | null;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
35
82
|
export default addItems;
|
|
@@ -2,34 +2,81 @@ import { QuoteMachineContext, QuoteMachineEvents } from '../types';
|
|
|
2
2
|
export declare function refresh({ context, event, }: {
|
|
3
3
|
context: QuoteMachineContext;
|
|
4
4
|
event: QuoteMachineEvents;
|
|
5
|
-
}): QuoteMachineContext |
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
5
|
+
}): QuoteMachineContext | {
|
|
6
|
+
quote: {
|
|
7
|
+
quote?: {
|
|
8
|
+
id: string | null;
|
|
9
|
+
locale: string | null;
|
|
10
|
+
baseCurrency: string | null;
|
|
11
|
+
currency: string | null;
|
|
12
|
+
currencyConversionRate: number | null;
|
|
13
|
+
dateCreated: Date | null;
|
|
14
|
+
dateLastUpdated: Date | null;
|
|
15
|
+
items: Record<string, any>[] | null;
|
|
16
|
+
promotions: Record<string, any>[] | null;
|
|
17
|
+
shippingAddresses: {
|
|
18
|
+
available: Record<string, any>[];
|
|
19
|
+
selected: string | null;
|
|
20
|
+
} | null;
|
|
21
|
+
totals: {
|
|
22
|
+
discount: number;
|
|
23
|
+
tax: number;
|
|
24
|
+
shipping: number;
|
|
25
|
+
shippingTax: number;
|
|
26
|
+
subtotal: number;
|
|
27
|
+
grandTotal: number;
|
|
28
|
+
} | null;
|
|
29
|
+
appliedPriceRules: Record<string, any>[] | null;
|
|
30
|
+
appliedPromotions: Record<string, any>[] | null;
|
|
31
|
+
shippingMethods: Record<string, any>[] | null;
|
|
32
|
+
paymentMethods: Record<string, any>[] | null;
|
|
33
|
+
storeCredit: Record<string, any>[] | null;
|
|
34
|
+
rewards: Record<string, any>[] | null;
|
|
35
|
+
giftCards: Record<string, any>[] | null;
|
|
36
|
+
} | undefined;
|
|
37
|
+
endpoints?: {
|
|
38
|
+
client?: string | undefined;
|
|
39
|
+
server?: string | undefined;
|
|
40
|
+
} | undefined;
|
|
41
|
+
graphql?: {
|
|
42
|
+
refresh: {
|
|
43
|
+
document: import("graphql-request").RequestDocument | import("@graphql-typed-document-node/core").TypedDocumentNode<unknown, {}>;
|
|
44
|
+
requestHeaders?: import("graphql-request/build/esm/types").GraphQLClientRequestHeaders | undefined;
|
|
45
|
+
};
|
|
46
|
+
addItems: {
|
|
47
|
+
document: import("graphql-request").RequestDocument | import("@graphql-typed-document-node/core").TypedDocumentNode<unknown, {}>;
|
|
48
|
+
requestHeaders?: import("graphql-request/build/esm/types").GraphQLClientRequestHeaders | undefined;
|
|
49
|
+
};
|
|
50
|
+
} | undefined;
|
|
51
|
+
errors?: string[] | undefined;
|
|
52
|
+
id: string | null;
|
|
53
|
+
locale: string | null;
|
|
54
|
+
baseCurrency: string | null;
|
|
55
|
+
currency: string | null;
|
|
56
|
+
currencyConversionRate: number | null;
|
|
57
|
+
dateCreated: Date | null;
|
|
58
|
+
dateLastUpdated: Date | null;
|
|
59
|
+
items: Record<string, any>[] | null;
|
|
60
|
+
promotions: Record<string, any>[] | null;
|
|
61
|
+
shippingAddresses: {
|
|
62
|
+
available: Record<string, any>[];
|
|
63
|
+
selected: string | null;
|
|
64
|
+
} | null;
|
|
65
|
+
totals: {
|
|
66
|
+
discount: number;
|
|
67
|
+
tax: number;
|
|
68
|
+
shipping: number;
|
|
69
|
+
shippingTax: number;
|
|
70
|
+
subtotal: number;
|
|
71
|
+
grandTotal: number;
|
|
72
|
+
} | null;
|
|
73
|
+
appliedPriceRules: Record<string, any>[] | null;
|
|
74
|
+
appliedPromotions: Record<string, any>[] | null;
|
|
75
|
+
shippingMethods: Record<string, any>[] | null;
|
|
76
|
+
paymentMethods: Record<string, any>[] | null;
|
|
77
|
+
storeCredit: Record<string, any>[] | null;
|
|
78
|
+
rewards: Record<string, any>[] | null;
|
|
79
|
+
giftCards: Record<string, any>[] | null;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
35
82
|
export default refresh;
|
|
@@ -3,7 +3,52 @@ export declare function removeItems({ context, event, }: {
|
|
|
3
3
|
context: QuoteMachineContext;
|
|
4
4
|
event: QuoteMachineEvents;
|
|
5
5
|
}): QuoteMachineContext | {
|
|
6
|
-
quote
|
|
6
|
+
quote: {
|
|
7
|
+
quote?: {
|
|
8
|
+
id: string | null;
|
|
9
|
+
locale: string | null;
|
|
10
|
+
baseCurrency: string | null;
|
|
11
|
+
currency: string | null;
|
|
12
|
+
currencyConversionRate: number | null;
|
|
13
|
+
dateCreated: Date | null;
|
|
14
|
+
dateLastUpdated: Date | null;
|
|
15
|
+
items: Record<string, any>[] | null;
|
|
16
|
+
promotions: Record<string, any>[] | null;
|
|
17
|
+
shippingAddresses: {
|
|
18
|
+
available: Record<string, any>[];
|
|
19
|
+
selected: string | null;
|
|
20
|
+
} | null;
|
|
21
|
+
totals: {
|
|
22
|
+
discount: number;
|
|
23
|
+
tax: number;
|
|
24
|
+
shipping: number;
|
|
25
|
+
shippingTax: number;
|
|
26
|
+
subtotal: number;
|
|
27
|
+
grandTotal: number;
|
|
28
|
+
} | null;
|
|
29
|
+
appliedPriceRules: Record<string, any>[] | null;
|
|
30
|
+
appliedPromotions: Record<string, any>[] | null;
|
|
31
|
+
shippingMethods: Record<string, any>[] | null;
|
|
32
|
+
paymentMethods: Record<string, any>[] | null;
|
|
33
|
+
storeCredit: Record<string, any>[] | null;
|
|
34
|
+
rewards: Record<string, any>[] | null;
|
|
35
|
+
giftCards: Record<string, any>[] | null;
|
|
36
|
+
} | undefined;
|
|
37
|
+
endpoints?: {
|
|
38
|
+
client?: string | undefined;
|
|
39
|
+
server?: string | undefined;
|
|
40
|
+
} | undefined;
|
|
41
|
+
graphql?: {
|
|
42
|
+
refresh: {
|
|
43
|
+
document: import("graphql-request").RequestDocument | import("@graphql-typed-document-node/core").TypedDocumentNode<unknown, {}>;
|
|
44
|
+
requestHeaders?: import("graphql-request/build/esm/types").GraphQLClientRequestHeaders | undefined;
|
|
45
|
+
};
|
|
46
|
+
addItems: {
|
|
47
|
+
document: import("graphql-request").RequestDocument | import("@graphql-typed-document-node/core").TypedDocumentNode<unknown, {}>;
|
|
48
|
+
requestHeaders?: import("graphql-request/build/esm/types").GraphQLClientRequestHeaders | undefined;
|
|
49
|
+
};
|
|
50
|
+
} | undefined;
|
|
51
|
+
errors?: string[] | undefined;
|
|
7
52
|
id: string | null;
|
|
8
53
|
locale: string | null;
|
|
9
54
|
baseCurrency: string | null;
|
|
@@ -32,49 +77,6 @@ export declare function removeItems({ context, event, }: {
|
|
|
32
77
|
storeCredit: Record<string, any>[] | null;
|
|
33
78
|
rewards: Record<string, any>[] | null;
|
|
34
79
|
giftCards: Record<string, any>[] | null;
|
|
35
|
-
}
|
|
36
|
-
endpoints?: {
|
|
37
|
-
client?: string | undefined;
|
|
38
|
-
server?: string | undefined;
|
|
39
|
-
} | undefined;
|
|
40
|
-
graphql?: {
|
|
41
|
-
refresh: {
|
|
42
|
-
document: import("graphql-request").RequestDocument | import("@graphql-typed-document-node/core").TypedDocumentNode<unknown, {}>;
|
|
43
|
-
requestHeaders?: import("graphql-request/build/esm/types").GraphQLClientRequestHeaders | undefined;
|
|
44
|
-
};
|
|
45
|
-
addItems: {
|
|
46
|
-
document: import("graphql-request").RequestDocument | import("@graphql-typed-document-node/core").TypedDocumentNode<unknown, {}>;
|
|
47
|
-
requestHeaders?: import("graphql-request/build/esm/types").GraphQLClientRequestHeaders | undefined;
|
|
48
|
-
};
|
|
49
|
-
} | undefined;
|
|
50
|
-
errors?: string[] | undefined;
|
|
51
|
-
id: string | null;
|
|
52
|
-
locale: string | null;
|
|
53
|
-
baseCurrency: string | null;
|
|
54
|
-
currency: string | null;
|
|
55
|
-
currencyConversionRate: number | null;
|
|
56
|
-
dateCreated: Date | null;
|
|
57
|
-
dateLastUpdated: Date | null;
|
|
58
|
-
items: Record<string, any>[] | null;
|
|
59
|
-
promotions: Record<string, any>[] | null;
|
|
60
|
-
shippingAddresses: {
|
|
61
|
-
available: Record<string, any>[];
|
|
62
|
-
selected: string | null;
|
|
63
|
-
} | null;
|
|
64
|
-
totals: {
|
|
65
|
-
discount: number;
|
|
66
|
-
tax: number;
|
|
67
|
-
shipping: number;
|
|
68
|
-
shippingTax: number;
|
|
69
|
-
subtotal: number;
|
|
70
|
-
grandTotal: number;
|
|
71
|
-
} | null;
|
|
72
|
-
appliedPriceRules: Record<string, any>[] | null;
|
|
73
|
-
appliedPromotions: Record<string, any>[] | null;
|
|
74
|
-
shippingMethods: Record<string, any>[] | null;
|
|
75
|
-
paymentMethods: Record<string, any>[] | null;
|
|
76
|
-
storeCredit: Record<string, any>[] | null;
|
|
77
|
-
rewards: Record<string, any>[] | null;
|
|
78
|
-
giftCards: Record<string, any>[] | null;
|
|
80
|
+
};
|
|
79
81
|
};
|
|
80
82
|
export default removeItems;
|