@clicktap/state 0.16.0 → 0.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/index.js +33 -33
  2. package/index.mjs +1460 -1535
  3. package/package.json +3 -3
  4. package/auth/AuthProvider.d.ts +0 -255
  5. package/auth/actions/addError.d.ts +0 -8
  6. package/auth/actions/clearErrors.d.ts +0 -5
  7. package/auth/actions/index.d.ts +0 -8
  8. package/auth/actions/notifyAuthenticated.d.ts +0 -6
  9. package/auth/actions/setAccessToken.d.ts +0 -9
  10. package/auth/actions/setIgnoreRefreshToken.d.ts +0 -4
  11. package/auth/actions/setUserContext.d.ts +0 -9
  12. package/auth/actions/unsetRefreshToken.d.ts +0 -4
  13. package/auth/actions/unsetUserContext.d.ts +0 -8
  14. package/auth/actors/authenticate.d.ts +0 -16
  15. package/auth/actors/index.d.ts +0 -3
  16. package/auth/actors/refreshAccessToken.d.ts +0 -18
  17. package/auth/actors/unauthenticate.d.ts +0 -14
  18. package/auth/auth.d.ts +0 -115
  19. package/auth/types.d.ts +0 -50
  20. package/helpers/request.d.ts +0 -2
  21. package/quote/CheckoutProvider.d.ts +0 -276
  22. package/quote/QuoteProvider.d.ts +0 -491
  23. package/quote/checkout/actions/changeStep.d.ts +0 -8
  24. package/quote/checkout/actions/index.d.ts +0 -5
  25. package/quote/checkout/actions/nextStep.d.ts +0 -8
  26. package/quote/checkout/actions/resetCheckout.d.ts +0 -104
  27. package/quote/checkout/actions/updateQuote.d.ts +0 -216
  28. package/quote/checkout/actions/updateSuccessId.d.ts +0 -8
  29. package/quote/checkout/actors/index.d.ts +0 -2
  30. package/quote/checkout/actors/placeOrder.d.ts +0 -20
  31. package/quote/checkout/actors/submitStepData.d.ts +0 -19
  32. package/quote/checkout/guards/index.d.ts +0 -1
  33. package/quote/checkout/guards/quoteExists.d.ts +0 -10
  34. package/quote/checkout/types.d.ts +0 -55
  35. package/quote/checkout.d.ts +0 -85
  36. package/quote/quote/actions/addItems.d.ts +0 -217
  37. package/quote/quote/actions/index.d.ts +0 -9
  38. package/quote/quote/actions/notifyAddItems.d.ts +0 -6
  39. package/quote/quote/actions/notifyRemoveItems.d.ts +0 -6
  40. package/quote/quote/actions/notifyUpdateItems.d.ts +0 -6
  41. package/quote/quote/actions/refresh.d.ts +0 -216
  42. package/quote/quote/actions/removeItems.d.ts +0 -217
  43. package/quote/quote/actions/reset.d.ts +0 -40
  44. package/quote/quote/actions/syncAccessToken.d.ts +0 -100
  45. package/quote/quote/actions/updateItems.d.ts +0 -217
  46. package/quote/quote/actors/addItems.d.ts +0 -24
  47. package/quote/quote/actors/index.d.ts +0 -4
  48. package/quote/quote/actors/refresh.d.ts +0 -22
  49. package/quote/quote/actors/removeItems.d.ts +0 -24
  50. package/quote/quote/actors/updateItems.d.ts +0 -24
  51. package/quote/quote/guards/canRefresh.d.ts +0 -10
  52. package/quote/quote/guards/hasItems.d.ts +0 -5
  53. package/quote/quote/guards/index.d.ts +0 -2
  54. package/quote/quote/types.d.ts +0 -291
  55. package/quote/quote.d.ts +0 -155
  56. package/quote/types.d.ts +0 -5
  57. package/toast/ToastProvider.d.ts +0 -93
  58. package/toast/timer.d.ts +0 -22
  59. package/toast/toast.d.ts +0 -82
  60. package/toast/types.d.ts +0 -59
@@ -1,216 +0,0 @@
1
- import { QuoteMachineContext, QuoteMachineEvents } from '../types';
2
- export declare function refresh({ context, event, }: {
3
- context: QuoteMachineContext;
4
- event: QuoteMachineEvents;
5
- }): QuoteMachineContext | {
6
- quote: {
7
- quote?: Partial<{
8
- id: string | null;
9
- accessToken: string | null;
10
- locale: string | null;
11
- checkoutSteps: import("../types").CheckoutStep[];
12
- baseCurrency: string | null;
13
- currency: string | null;
14
- currencyConversionRate: number | null;
15
- dateCreated: Date | null;
16
- dateLastUpdated: Date | null;
17
- items: Record<string, any>[] | null;
18
- promotions: Record<string, any>[] | null;
19
- shippingAddresses: {
20
- available: import("../types").QuoteAddress[];
21
- applied: {
22
- availableAddressId?: string | undefined;
23
- address: import("../types").QuoteAddress;
24
- itemIds: Record<string, any>[];
25
- }[];
26
- };
27
- paymentMethods: {
28
- available: import("../types").PaymentMethod[];
29
- applied: {
30
- paymentMethod: import("../types").PaymentMethod;
31
- options: Record<string, any>[];
32
- amount: number;
33
- }[];
34
- };
35
- shipments: {
36
- id: string;
37
- shippingAddress: {
38
- id: string;
39
- address: import("../types").QuoteAddress;
40
- };
41
- items: Record<string, any>[];
42
- shippingMethods: {
43
- available: {
44
- shippingMethod: {
45
- id: string;
46
- code: string;
47
- name: string;
48
- carrier: {
49
- id: string;
50
- code: string;
51
- name: string;
52
- };
53
- };
54
- estimatedTotal: number;
55
- earliestShipDate: Date;
56
- latestShipDate: Date;
57
- earliestArrivalDate: Date;
58
- latestArrivalDate: Date;
59
- }[];
60
- applied: {
61
- shippingMethod: {
62
- id: string;
63
- code: string;
64
- name: string;
65
- carrier: {
66
- id: string;
67
- code: string;
68
- name: string;
69
- };
70
- };
71
- estimatedTotal: number;
72
- earliestShipDate: Date;
73
- latestShipDate: Date;
74
- earliestArrivalDate: Date;
75
- latestArrivalDate: Date;
76
- };
77
- };
78
- }[];
79
- totals: {
80
- discount: number;
81
- taxAmount: number;
82
- shippingAmount: number;
83
- shippingTaxAmount: number;
84
- subtotal: number;
85
- grandTotal: number;
86
- } | null;
87
- appliedPriceRules: Record<string, any>[] | null;
88
- appliedPromotions: Record<string, any>[] | null;
89
- shippingMethods: Record<string, any>[] | null;
90
- storeCredit: Record<string, any>[] | null;
91
- rewards: Record<string, any>[] | null;
92
- giftCards: Record<string, any>[] | null;
93
- user: {
94
- id: string | null;
95
- email: string | null;
96
- firstName: string | null;
97
- lastName: string | null;
98
- } | null;
99
- }> | undefined;
100
- errors?: string[] | undefined;
101
- endpoints?: {
102
- client?: string | undefined;
103
- server?: string | undefined;
104
- } | undefined;
105
- graphql?: {
106
- refresh: {
107
- document: import("graphql-request").RequestDocument | import("@graphql-typed-document-node/core").TypedDocumentNode<unknown, {}>;
108
- requestHeaders?: import("graphql-request/build/esm/types").GraphQLClientRequestHeaders | undefined;
109
- };
110
- addItems: {
111
- document: import("graphql-request").RequestDocument | import("@graphql-typed-document-node/core").TypedDocumentNode<unknown, {}>;
112
- requestHeaders?: import("graphql-request/build/esm/types").GraphQLClientRequestHeaders | undefined;
113
- };
114
- removeItems: {
115
- document: import("graphql-request").RequestDocument | import("@graphql-typed-document-node/core").TypedDocumentNode<unknown, {}>;
116
- requestHeaders?: import("graphql-request/build/esm/types").GraphQLClientRequestHeaders | undefined;
117
- };
118
- updateItems: {
119
- document: import("graphql-request").RequestDocument | import("@graphql-typed-document-node/core").TypedDocumentNode<unknown, {}>;
120
- requestHeaders?: import("graphql-request/build/esm/types").GraphQLClientRequestHeaders | undefined;
121
- };
122
- } | undefined;
123
- id?: string | null | undefined;
124
- accessToken?: string | null | undefined;
125
- locale?: string | null | undefined;
126
- checkoutSteps?: import("../types").CheckoutStep[] | undefined;
127
- baseCurrency?: string | null | undefined;
128
- currency?: string | null | undefined;
129
- currencyConversionRate?: number | null | undefined;
130
- dateCreated?: Date | null | undefined;
131
- dateLastUpdated?: Date | null | undefined;
132
- items?: Record<string, any>[] | null | undefined;
133
- promotions?: Record<string, any>[] | null | undefined;
134
- shippingAddresses?: {
135
- available: import("../types").QuoteAddress[];
136
- applied: {
137
- availableAddressId?: string | undefined;
138
- address: import("../types").QuoteAddress;
139
- itemIds: Record<string, any>[];
140
- }[];
141
- } | undefined;
142
- paymentMethods?: {
143
- available: import("../types").PaymentMethod[];
144
- applied: {
145
- paymentMethod: import("../types").PaymentMethod;
146
- options: Record<string, any>[];
147
- amount: number;
148
- }[];
149
- } | undefined;
150
- shipments?: {
151
- id: string;
152
- shippingAddress: {
153
- id: string;
154
- address: import("../types").QuoteAddress;
155
- };
156
- items: Record<string, any>[];
157
- shippingMethods: {
158
- available: {
159
- shippingMethod: {
160
- id: string;
161
- code: string;
162
- name: string;
163
- carrier: {
164
- id: string;
165
- code: string;
166
- name: string;
167
- };
168
- };
169
- estimatedTotal: number;
170
- earliestShipDate: Date;
171
- latestShipDate: Date;
172
- earliestArrivalDate: Date;
173
- latestArrivalDate: Date;
174
- }[];
175
- applied: {
176
- shippingMethod: {
177
- id: string;
178
- code: string;
179
- name: string;
180
- carrier: {
181
- id: string;
182
- code: string;
183
- name: string;
184
- };
185
- };
186
- estimatedTotal: number;
187
- earliestShipDate: Date;
188
- latestShipDate: Date;
189
- earliestArrivalDate: Date;
190
- latestArrivalDate: Date;
191
- };
192
- };
193
- }[] | undefined;
194
- totals?: {
195
- discount: number;
196
- taxAmount: number;
197
- shippingAmount: number;
198
- shippingTaxAmount: number;
199
- subtotal: number;
200
- grandTotal: number;
201
- } | null | undefined;
202
- appliedPriceRules?: Record<string, any>[] | null | undefined;
203
- appliedPromotions?: Record<string, any>[] | null | undefined;
204
- shippingMethods?: Record<string, any>[] | null | undefined;
205
- storeCredit?: Record<string, any>[] | null | undefined;
206
- rewards?: Record<string, any>[] | null | undefined;
207
- giftCards?: Record<string, any>[] | null | undefined;
208
- user?: {
209
- id: string | null;
210
- email: string | null;
211
- firstName: string | null;
212
- lastName: string | null;
213
- } | null | undefined;
214
- };
215
- };
216
- export default refresh;
@@ -1,217 +0,0 @@
1
- import { QuoteMachineContext, QuoteMachineEvents } from '../types';
2
- export declare function removeItems({ context, event, }: {
3
- context: QuoteMachineContext;
4
- event: QuoteMachineEvents;
5
- }): QuoteMachineContext | {
6
- quote: {
7
- quote?: Partial<{
8
- id: string | null;
9
- accessToken: string | null;
10
- locale: string | null;
11
- checkoutSteps: import("../types").CheckoutStep[];
12
- baseCurrency: string | null;
13
- currency: string | null;
14
- currencyConversionRate: number | null;
15
- dateCreated: Date | null;
16
- dateLastUpdated: Date | null;
17
- items: Record<string, any>[] | null;
18
- promotions: Record<string, any>[] | null;
19
- shippingAddresses: {
20
- available: import("../types").QuoteAddress[];
21
- applied: {
22
- availableAddressId?: string | undefined;
23
- address: import("../types").QuoteAddress;
24
- itemIds: Record<string, any>[];
25
- }[];
26
- };
27
- paymentMethods: {
28
- available: import("../types").PaymentMethod[];
29
- applied: {
30
- paymentMethod: import("../types").PaymentMethod;
31
- options: Record<string, any>[];
32
- amount: number;
33
- }[];
34
- };
35
- shipments: {
36
- id: string;
37
- shippingAddress: {
38
- id: string;
39
- address: import("../types").QuoteAddress;
40
- };
41
- items: Record<string, any>[];
42
- shippingMethods: {
43
- available: {
44
- shippingMethod: {
45
- id: string;
46
- code: string;
47
- name: string;
48
- carrier: {
49
- id: string;
50
- code: string;
51
- name: string;
52
- };
53
- };
54
- estimatedTotal: number;
55
- earliestShipDate: Date;
56
- latestShipDate: Date;
57
- earliestArrivalDate: Date;
58
- latestArrivalDate: Date;
59
- }[];
60
- applied: {
61
- shippingMethod: {
62
- id: string;
63
- code: string;
64
- name: string;
65
- carrier: {
66
- id: string;
67
- code: string;
68
- name: string;
69
- };
70
- };
71
- estimatedTotal: number;
72
- earliestShipDate: Date;
73
- latestShipDate: Date;
74
- earliestArrivalDate: Date;
75
- latestArrivalDate: Date;
76
- };
77
- };
78
- }[];
79
- totals: {
80
- discount: number;
81
- taxAmount: number;
82
- shippingAmount: number;
83
- shippingTaxAmount: number;
84
- subtotal: number;
85
- grandTotal: number;
86
- } | null;
87
- appliedPriceRules: Record<string, any>[] | null;
88
- appliedPromotions: Record<string, any>[] | null;
89
- shippingMethods: Record<string, any>[] | null;
90
- storeCredit: Record<string, any>[] | null;
91
- rewards: Record<string, any>[] | null;
92
- giftCards: Record<string, any>[] | null;
93
- user: {
94
- id: string | null;
95
- email: string | null;
96
- firstName: string | null;
97
- lastName: string | null;
98
- } | null;
99
- }> | undefined;
100
- errors?: string[] | undefined;
101
- endpoints?: {
102
- client?: string | undefined;
103
- server?: string | undefined;
104
- } | undefined;
105
- graphql?: {
106
- refresh: {
107
- document: import("graphql-request").RequestDocument | import("@graphql-typed-document-node/core").TypedDocumentNode<unknown, {}>;
108
- requestHeaders?: import("graphql-request/build/esm/types").GraphQLClientRequestHeaders | undefined;
109
- };
110
- addItems: {
111
- document: import("graphql-request").RequestDocument | import("@graphql-typed-document-node/core").TypedDocumentNode<unknown, {}>;
112
- requestHeaders?: import("graphql-request/build/esm/types").GraphQLClientRequestHeaders | undefined;
113
- };
114
- removeItems: {
115
- document: import("graphql-request").RequestDocument | import("@graphql-typed-document-node/core").TypedDocumentNode<unknown, {}>;
116
- requestHeaders?: import("graphql-request/build/esm/types").GraphQLClientRequestHeaders | undefined;
117
- };
118
- updateItems: {
119
- document: import("graphql-request").RequestDocument | import("@graphql-typed-document-node/core").TypedDocumentNode<unknown, {}>;
120
- requestHeaders?: import("graphql-request/build/esm/types").GraphQLClientRequestHeaders | undefined;
121
- };
122
- } | undefined;
123
- id?: string | null | undefined;
124
- accessToken?: string | null | undefined;
125
- locale?: string | null | undefined;
126
- checkoutSteps?: import("../types").CheckoutStep[] | undefined;
127
- baseCurrency?: string | null | undefined;
128
- currency?: string | null | undefined;
129
- currencyConversionRate?: number | null | undefined;
130
- dateCreated?: Date | null | undefined;
131
- dateLastUpdated?: Date | null | undefined;
132
- items?: Record<string, any>[] | null | undefined;
133
- promotions?: Record<string, any>[] | null | undefined;
134
- shippingAddresses?: {
135
- available: import("../types").QuoteAddress[];
136
- applied: {
137
- availableAddressId?: string | undefined;
138
- address: import("../types").QuoteAddress;
139
- itemIds: Record<string, any>[];
140
- }[];
141
- } | undefined;
142
- paymentMethods?: {
143
- available: import("../types").PaymentMethod[];
144
- applied: {
145
- paymentMethod: import("../types").PaymentMethod;
146
- options: Record<string, any>[];
147
- amount: number;
148
- }[];
149
- } | undefined;
150
- shipments?: {
151
- id: string;
152
- shippingAddress: {
153
- id: string;
154
- address: import("../types").QuoteAddress;
155
- };
156
- items: Record<string, any>[];
157
- shippingMethods: {
158
- available: {
159
- shippingMethod: {
160
- id: string;
161
- code: string;
162
- name: string;
163
- carrier: {
164
- id: string;
165
- code: string;
166
- name: string;
167
- };
168
- };
169
- estimatedTotal: number;
170
- earliestShipDate: Date;
171
- latestShipDate: Date;
172
- earliestArrivalDate: Date;
173
- latestArrivalDate: Date;
174
- }[];
175
- applied: {
176
- shippingMethod: {
177
- id: string;
178
- code: string;
179
- name: string;
180
- carrier: {
181
- id: string;
182
- code: string;
183
- name: string;
184
- };
185
- };
186
- estimatedTotal: number;
187
- earliestShipDate: Date;
188
- latestShipDate: Date;
189
- earliestArrivalDate: Date;
190
- latestArrivalDate: Date;
191
- };
192
- };
193
- }[] | undefined;
194
- totals?: {
195
- discount: number;
196
- taxAmount: number;
197
- shippingAmount: number;
198
- shippingTaxAmount: number;
199
- subtotal: number;
200
- grandTotal: number;
201
- } | null | undefined;
202
- appliedPriceRules?: Record<string, any>[] | null | undefined;
203
- appliedPromotions?: Record<string, any>[] | null | undefined;
204
- shippingMethods?: Record<string, any>[] | null | undefined;
205
- storeCredit?: Record<string, any>[] | null | undefined;
206
- rewards?: Record<string, any>[] | null | undefined;
207
- giftCards?: Record<string, any>[] | null | undefined;
208
- user?: {
209
- id: string | null;
210
- email: string | null;
211
- firstName: string | null;
212
- lastName: string | null;
213
- } | null | undefined;
214
- };
215
- itemsRemoved: Record<string, any>[] | null | undefined;
216
- };
217
- export default removeItems;
@@ -1,40 +0,0 @@
1
- import { QuoteMachineContext, QuoteMachineEvents } from '../types';
2
- export declare function reset({ context, event, }: {
3
- context: QuoteMachineContext;
4
- event: QuoteMachineEvents;
5
- }): QuoteMachineContext | {
6
- quote: {
7
- id: string;
8
- locale: string;
9
- baseCurrency: string;
10
- currencyConversionRate: number;
11
- dateCreated: null;
12
- dateLastUpdated: null;
13
- currency: string;
14
- items: never[];
15
- promotions: never[];
16
- shippingAddresses: {
17
- available: never[];
18
- applied: never[];
19
- };
20
- paymentMethods: {
21
- available: never[];
22
- applied: never[];
23
- };
24
- totals: {
25
- discount: number;
26
- taxAmount: number;
27
- shippingAmount: number;
28
- shippingTaxAmount: number;
29
- subtotal: number;
30
- grandTotal: number;
31
- };
32
- appliedPriceRules: never[];
33
- appliedPromotions: never[];
34
- shippingMethods: never[];
35
- storeCredit: never[];
36
- rewards: never[];
37
- giftCards: never[];
38
- };
39
- };
40
- export default reset;
@@ -1,100 +0,0 @@
1
- import { QuoteMachineContext, QuoteMachineEvents } from '../types';
2
- export declare function syncAccessToken({ context, event, }: {
3
- context: QuoteMachineContext;
4
- event: QuoteMachineEvents;
5
- }): QuoteMachineContext | {
6
- quote: {
7
- accessToken: string;
8
- id?: string | null | undefined;
9
- locale?: string | null | undefined;
10
- checkoutSteps?: import("../types").CheckoutStep[] | undefined;
11
- baseCurrency?: string | null | undefined;
12
- currency?: string | null | undefined;
13
- currencyConversionRate?: number | null | undefined;
14
- dateCreated?: Date | null | undefined;
15
- dateLastUpdated?: Date | null | undefined;
16
- items?: Record<string, any>[] | null | undefined;
17
- promotions?: Record<string, any>[] | null | undefined;
18
- shippingAddresses?: {
19
- available: import("../types").QuoteAddress[];
20
- applied: {
21
- availableAddressId?: string | undefined;
22
- address: import("../types").QuoteAddress;
23
- itemIds: Record<string, any>[];
24
- }[];
25
- } | undefined;
26
- paymentMethods?: {
27
- available: import("../types").PaymentMethod[];
28
- applied: {
29
- paymentMethod: import("../types").PaymentMethod;
30
- options: Record<string, any>[];
31
- amount: number;
32
- }[];
33
- } | undefined;
34
- shipments?: {
35
- id: string;
36
- shippingAddress: {
37
- id: string;
38
- address: import("../types").QuoteAddress;
39
- };
40
- items: Record<string, any>[];
41
- shippingMethods: {
42
- available: {
43
- shippingMethod: {
44
- id: string;
45
- code: string;
46
- name: string;
47
- carrier: {
48
- id: string;
49
- code: string;
50
- name: string;
51
- };
52
- };
53
- estimatedTotal: number;
54
- earliestShipDate: Date;
55
- latestShipDate: Date;
56
- earliestArrivalDate: Date;
57
- latestArrivalDate: Date;
58
- }[];
59
- applied: {
60
- shippingMethod: {
61
- id: string;
62
- code: string;
63
- name: string;
64
- carrier: {
65
- id: string;
66
- code: string;
67
- name: string;
68
- };
69
- };
70
- estimatedTotal: number;
71
- earliestShipDate: Date;
72
- latestShipDate: Date;
73
- earliestArrivalDate: Date;
74
- latestArrivalDate: Date;
75
- };
76
- };
77
- }[] | undefined;
78
- totals?: {
79
- discount: number;
80
- taxAmount: number;
81
- shippingAmount: number;
82
- shippingTaxAmount: number;
83
- subtotal: number;
84
- grandTotal: number;
85
- } | null | undefined;
86
- appliedPriceRules?: Record<string, any>[] | null | undefined;
87
- appliedPromotions?: Record<string, any>[] | null | undefined;
88
- shippingMethods?: Record<string, any>[] | null | undefined;
89
- storeCredit?: Record<string, any>[] | null | undefined;
90
- rewards?: Record<string, any>[] | null | undefined;
91
- giftCards?: Record<string, any>[] | null | undefined;
92
- user?: {
93
- id: string | null;
94
- email: string | null;
95
- firstName: string | null;
96
- lastName: string | null;
97
- } | null | undefined;
98
- };
99
- };
100
- export default syncAccessToken;