@clicktap/state 0.16.3 → 0.16.4

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.
@@ -11,39 +11,39 @@ export declare function resetCheckout({ context, event, }: {
11
11
  id: string | null;
12
12
  accessToken: string | null;
13
13
  locale: string | null;
14
- checkoutSteps: import('../../..').CheckoutStep[];
14
+ checkoutSteps: Array<import('../../..').CheckoutStep>;
15
15
  baseCurrency: string | null;
16
16
  currency: string | null;
17
17
  currencyConversionRate: number | null;
18
18
  dateCreated: Date | null;
19
19
  dateLastUpdated: Date | null;
20
- items: Record<string, any>[] | null;
21
- promotions: Record<string, any>[] | null;
20
+ items: Array<Record<string, any>> | null;
21
+ promotions: Array<Record<string, any>> | null;
22
22
  shippingAddresses: {
23
- available: import('../../..').QuoteAddress[];
24
- applied: {
25
- availableAddressId?: string | undefined;
23
+ available: Array<import('../../..').QuoteAddress>;
24
+ applied: Array<{
25
+ availableAddressId?: string;
26
26
  address: import('../../..').QuoteAddress;
27
- itemIds: Record<string, any>[];
28
- }[];
27
+ itemIds: Array<Record<string, any>>;
28
+ }>;
29
29
  };
30
30
  paymentMethods: {
31
- available: import('../../..').PaymentMethod[];
32
- applied: {
31
+ available: Array<import('../../..').PaymentMethod>;
32
+ applied: Array<{
33
33
  paymentMethod: import('../../..').PaymentMethod;
34
- options: Record<string, any>[];
34
+ options: Array<Record<string, any>>;
35
35
  amount: number;
36
- }[];
36
+ }>;
37
37
  };
38
- shipments: {
38
+ shipments: Array<{
39
39
  id: string;
40
40
  shippingAddress: {
41
41
  id: string;
42
42
  address: import('../../..').QuoteAddress;
43
43
  };
44
- items: Record<string, any>[];
44
+ items: Array<Record<string, any>>;
45
45
  shippingMethods: {
46
- available: {
46
+ available: Array<{
47
47
  shippingMethod: {
48
48
  id: string;
49
49
  code: string;
@@ -59,7 +59,7 @@ export declare function resetCheckout({ context, event, }: {
59
59
  latestShipDate: Date;
60
60
  earliestArrivalDate: Date;
61
61
  latestArrivalDate: Date;
62
- }[];
62
+ }>;
63
63
  applied: {
64
64
  shippingMethod: {
65
65
  id: string;
@@ -78,7 +78,7 @@ export declare function resetCheckout({ context, event, }: {
78
78
  latestArrivalDate: Date;
79
79
  };
80
80
  };
81
- }[];
81
+ }>;
82
82
  totals: {
83
83
  discount: number;
84
84
  taxAmount: number;
@@ -87,12 +87,12 @@ export declare function resetCheckout({ context, event, }: {
87
87
  subtotal: number;
88
88
  grandTotal: number;
89
89
  } | null;
90
- appliedPriceRules: Record<string, any>[] | null;
91
- appliedPromotions: Record<string, any>[] | null;
92
- shippingMethods: Record<string, any>[] | null;
93
- storeCredit: Record<string, any>[] | null;
94
- rewards: Record<string, any>[] | null;
95
- giftCards: Record<string, any>[] | null;
90
+ appliedPriceRules: Array<Record<string, any>> | null;
91
+ appliedPromotions: Array<Record<string, any>> | null;
92
+ shippingMethods: Array<Record<string, any>> | null;
93
+ storeCredit: Array<Record<string, any>> | null;
94
+ rewards: Array<Record<string, any>> | null;
95
+ giftCards: Array<Record<string, any>> | null;
96
96
  user: {
97
97
  id: string | null;
98
98
  email: string | null;
@@ -8,39 +8,39 @@ export declare function updateQuote({ context, event, }: {
8
8
  id: string | null;
9
9
  accessToken: string | null;
10
10
  locale: string | null;
11
- checkoutSteps: import('../../..').CheckoutStep[];
11
+ checkoutSteps: Array<import('../../..').CheckoutStep>;
12
12
  baseCurrency: string | null;
13
13
  currency: string | null;
14
14
  currencyConversionRate: number | null;
15
15
  dateCreated: Date | null;
16
16
  dateLastUpdated: Date | null;
17
- items: Record<string, any>[] | null;
18
- promotions: Record<string, any>[] | null;
17
+ items: Array<Record<string, any>> | null;
18
+ promotions: Array<Record<string, any>> | null;
19
19
  shippingAddresses: {
20
- available: import('../../..').QuoteAddress[];
21
- applied: {
22
- availableAddressId?: string | undefined;
20
+ available: Array<import('../../..').QuoteAddress>;
21
+ applied: Array<{
22
+ availableAddressId?: string;
23
23
  address: import('../../..').QuoteAddress;
24
- itemIds: Record<string, any>[];
25
- }[];
24
+ itemIds: Array<Record<string, any>>;
25
+ }>;
26
26
  };
27
27
  paymentMethods: {
28
- available: import('../../..').PaymentMethod[];
29
- applied: {
28
+ available: Array<import('../../..').PaymentMethod>;
29
+ applied: Array<{
30
30
  paymentMethod: import('../../..').PaymentMethod;
31
- options: Record<string, any>[];
31
+ options: Array<Record<string, any>>;
32
32
  amount: number;
33
- }[];
33
+ }>;
34
34
  };
35
- shipments: {
35
+ shipments: Array<{
36
36
  id: string;
37
37
  shippingAddress: {
38
38
  id: string;
39
39
  address: import('../../..').QuoteAddress;
40
40
  };
41
- items: Record<string, any>[];
41
+ items: Array<Record<string, any>>;
42
42
  shippingMethods: {
43
- available: {
43
+ available: Array<{
44
44
  shippingMethod: {
45
45
  id: string;
46
46
  code: string;
@@ -56,7 +56,7 @@ export declare function updateQuote({ context, event, }: {
56
56
  latestShipDate: Date;
57
57
  earliestArrivalDate: Date;
58
58
  latestArrivalDate: Date;
59
- }[];
59
+ }>;
60
60
  applied: {
61
61
  shippingMethod: {
62
62
  id: string;
@@ -75,7 +75,7 @@ export declare function updateQuote({ context, event, }: {
75
75
  latestArrivalDate: Date;
76
76
  };
77
77
  };
78
- }[];
78
+ }>;
79
79
  totals: {
80
80
  discount: number;
81
81
  taxAmount: number;
@@ -84,12 +84,12 @@ export declare function updateQuote({ context, event, }: {
84
84
  subtotal: number;
85
85
  grandTotal: number;
86
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;
87
+ appliedPriceRules: Array<Record<string, any>> | null;
88
+ appliedPromotions: Array<Record<string, any>> | null;
89
+ shippingMethods: Array<Record<string, any>> | null;
90
+ storeCredit: Array<Record<string, any>> | null;
91
+ rewards: Array<Record<string, any>> | null;
92
+ giftCards: Array<Record<string, any>> | null;
93
93
  user: {
94
94
  id: string | null;
95
95
  email: string | null;
@@ -99,8 +99,8 @@ export declare function updateQuote({ context, event, }: {
99
99
  }> | undefined;
100
100
  errors?: string[] | undefined;
101
101
  endpoints?: {
102
- client?: string | undefined;
103
- server?: string | undefined;
102
+ client?: string;
103
+ server?: string;
104
104
  } | undefined;
105
105
  graphql?: {
106
106
  refresh: {
@@ -132,20 +132,20 @@ export declare function updateQuote({ context, event, }: {
132
132
  items?: Record<string, any>[] | null | undefined;
133
133
  promotions?: Record<string, any>[] | null | undefined;
134
134
  shippingAddresses?: {
135
- available: import('../../..').QuoteAddress[];
136
- applied: {
137
- availableAddressId?: string | undefined;
135
+ available: Array<import('../../..').QuoteAddress>;
136
+ applied: Array<{
137
+ availableAddressId?: string;
138
138
  address: import('../../..').QuoteAddress;
139
- itemIds: Record<string, any>[];
140
- }[];
139
+ itemIds: Array<Record<string, any>>;
140
+ }>;
141
141
  } | undefined;
142
142
  paymentMethods?: {
143
- available: import('../../..').PaymentMethod[];
144
- applied: {
143
+ available: Array<import('../../..').PaymentMethod>;
144
+ applied: Array<{
145
145
  paymentMethod: import('../../..').PaymentMethod;
146
- options: Record<string, any>[];
146
+ options: Array<Record<string, any>>;
147
147
  amount: number;
148
- }[];
148
+ }>;
149
149
  } | undefined;
150
150
  shipments?: {
151
151
  id: string;
@@ -153,9 +153,9 @@ export declare function updateQuote({ context, event, }: {
153
153
  id: string;
154
154
  address: import('../../..').QuoteAddress;
155
155
  };
156
- items: Record<string, any>[];
156
+ items: Array<Record<string, any>>;
157
157
  shippingMethods: {
158
- available: {
158
+ available: Array<{
159
159
  shippingMethod: {
160
160
  id: string;
161
161
  code: string;
@@ -171,7 +171,7 @@ export declare function updateQuote({ context, event, }: {
171
171
  latestShipDate: Date;
172
172
  earliestArrivalDate: Date;
173
173
  latestArrivalDate: Date;
174
- }[];
174
+ }>;
175
175
  applied: {
176
176
  shippingMethod: {
177
177
  id: string;
@@ -16,5 +16,5 @@ export type PlaceOrderDataOutput = Partial<{
16
16
  }>;
17
17
  };
18
18
  }>;
19
- export declare const placeOrder: import('xstate').PromiseActorLogic<PlaceOrderSuccessEvent, PlaceOrderDataInput>;
19
+ export declare const placeOrder: import('xstate').PromiseActorLogic<PlaceOrderSuccessEvent, PlaceOrderDataInput, import('xstate').EventObject>;
20
20
  export default placeOrder;
@@ -15,5 +15,5 @@ export type SubmitStepDataOutput = Partial<{
15
15
  }>;
16
16
  };
17
17
  }>;
18
- export declare const submitStepData: import('xstate').PromiseActorLogic<SubmitStepDataSuccessEvent, SubmitStepDataInput>;
18
+ export declare const submitStepData: import('xstate').PromiseActorLogic<SubmitStepDataSuccessEvent, SubmitStepDataInput, import('xstate').EventObject>;
19
19
  export default submitStepData;
@@ -1,85 +1,46 @@
1
1
  import { CheckoutMachineContext } from './checkout/types';
2
2
  import { DeepPartial } from './types';
3
- export declare const checkoutMachine: import('xstate').StateMachine<CheckoutMachineContext, import('./checkout/types').ChangeStepEvent | import('./checkout/types').PlaceOrderEvent | import('./checkout/types').ResetCheckoutEvent | import('./checkout/types').SubmitStepDataEvent | import('xstate').DoneActorEvent<import('./checkout/types').PlaceOrderSuccessEvent> | import('xstate').DoneActorEvent<import('./checkout/types').SubmitStepDataSuccessEvent>, {
4
- [x: string]: import('xstate').ActorRef<import('xstate').PromiseSnapshot<import('./checkout/types').PlaceOrderSuccessEvent, import('./checkout/actors').PlaceOrderDataInput>, {
5
- [k: string]: unknown;
6
- type: string;
7
- }, import('xstate').EventObject> | import('xstate').ActorRef<import('xstate').PromiseSnapshot<import('./checkout/types').SubmitStepDataSuccessEvent, import('./checkout/actors').SubmitStepDataInput>, {
8
- [k: string]: unknown;
9
- type: string;
10
- }, import('xstate').EventObject> | undefined;
11
- }, import('xstate').Values<{
12
- placeOrder: {
13
- src: "placeOrder";
14
- logic: import('xstate').PromiseActorLogic<import('./checkout/types').PlaceOrderSuccessEvent, import('./checkout/actors').PlaceOrderDataInput>;
15
- id: string | undefined;
16
- };
17
- submitStepData: {
18
- src: "submitStepData";
19
- logic: import('xstate').PromiseActorLogic<import('./checkout/types').SubmitStepDataSuccessEvent, import('./checkout/actors').SubmitStepDataInput>;
20
- id: string | undefined;
21
- };
22
- }>, import('xstate').Values<{
23
- changeStep: {
24
- type: "changeStep";
25
- params: import('xstate').NonReducibleUnknown;
26
- };
27
- nextStep: {
28
- type: "nextStep";
29
- params: import('xstate').NonReducibleUnknown;
30
- };
31
- resetCheckout: {
32
- type: "resetCheckout";
33
- params: import('xstate').NonReducibleUnknown;
34
- };
35
- updateQuote: {
36
- type: "updateQuote";
37
- params: import('xstate').NonReducibleUnknown;
38
- };
39
- updateSuccessId: {
40
- type: "updateSuccessId";
41
- params: import('xstate').NonReducibleUnknown;
42
- };
43
- }>, {
3
+ export declare const checkoutMachine: import('xstate').StateMachine<CheckoutMachineContext, import('./checkout/types').ChangeStepEvent | import('./checkout/types').PlaceOrderEvent | import('./checkout/types').ResetCheckoutEvent | import('./checkout/types').SubmitStepDataEvent | import('xstate').DoneActorEvent<import('./checkout/types').PlaceOrderSuccessEvent, string> | import('xstate').DoneActorEvent<import('./checkout/types').SubmitStepDataSuccessEvent, string>, {
4
+ [x: string]: import('xstate').ActorRefFromLogic<import('xstate').PromiseActorLogic<import('./checkout/types').PlaceOrderSuccessEvent, import('./checkout/actors').PlaceOrderDataInput, import('xstate').EventObject>> | import('xstate').ActorRefFromLogic<import('xstate').PromiseActorLogic<import('./checkout/types').SubmitStepDataSuccessEvent, import('./checkout/actors').SubmitStepDataInput, import('xstate').EventObject>> | undefined;
5
+ }, {
6
+ src: "placeOrder";
7
+ logic: import('xstate').PromiseActorLogic<import('./checkout/types').PlaceOrderSuccessEvent, import('./checkout/actors').PlaceOrderDataInput, import('xstate').EventObject>;
8
+ id: string | undefined;
9
+ } | {
10
+ src: "submitStepData";
11
+ logic: import('xstate').PromiseActorLogic<import('./checkout/types').SubmitStepDataSuccessEvent, import('./checkout/actors').SubmitStepDataInput, import('xstate').EventObject>;
12
+ id: string | undefined;
13
+ }, {
14
+ type: "changeStep";
15
+ params: import('xstate').NonReducibleUnknown;
16
+ } | {
17
+ type: "nextStep";
18
+ params: import('xstate').NonReducibleUnknown;
19
+ } | {
20
+ type: "resetCheckout";
21
+ params: import('xstate').NonReducibleUnknown;
22
+ } | {
23
+ type: "updateQuote";
24
+ params: import('xstate').NonReducibleUnknown;
25
+ } | {
26
+ type: "updateSuccessId";
27
+ params: import('xstate').NonReducibleUnknown;
28
+ }, {
44
29
  type: "quoteExists";
45
30
  params: unknown;
46
31
  }, never, "uninitialized" | "initializing" | "showStep" | "submittingStepData" | "changingStep" | "placingOrder" | "success", string, {
47
32
  initialContext: DeepPartial<CheckoutMachineContext>;
48
- initialState?: string | undefined;
49
- }, import('xstate').NonReducibleUnknown, import('xstate').EventObject, import('xstate').MetaObject, import('xstate').ResolveTypegenMeta<import('xstate').TypegenDisabled, import('./checkout/types').ChangeStepEvent | import('./checkout/types').PlaceOrderEvent | import('./checkout/types').ResetCheckoutEvent | import('./checkout/types').SubmitStepDataEvent | import('xstate').DoneActorEvent<import('./checkout/types').PlaceOrderSuccessEvent> | import('xstate').DoneActorEvent<import('./checkout/types').SubmitStepDataSuccessEvent>, import('xstate').Values<{
50
- placeOrder: {
51
- src: "placeOrder";
52
- logic: import('xstate').PromiseActorLogic<import('./checkout/types').PlaceOrderSuccessEvent, import('./checkout/actors').PlaceOrderDataInput>;
53
- id: string | undefined;
54
- };
55
- submitStepData: {
56
- src: "submitStepData";
57
- logic: import('xstate').PromiseActorLogic<import('./checkout/types').SubmitStepDataSuccessEvent, import('./checkout/actors').SubmitStepDataInput>;
58
- id: string | undefined;
59
- };
60
- }>, import('xstate').Values<{
61
- changeStep: {
62
- type: "changeStep";
63
- params: import('xstate').NonReducibleUnknown;
64
- };
65
- nextStep: {
66
- type: "nextStep";
67
- params: import('xstate').NonReducibleUnknown;
68
- };
69
- resetCheckout: {
70
- type: "resetCheckout";
71
- params: import('xstate').NonReducibleUnknown;
72
- };
73
- updateQuote: {
74
- type: "updateQuote";
75
- params: import('xstate').NonReducibleUnknown;
76
- };
77
- updateSuccessId: {
78
- type: "updateSuccessId";
79
- params: import('xstate').NonReducibleUnknown;
80
- };
81
- }>, {
82
- type: "quoteExists";
83
- params: unknown;
84
- }, never, string, import('xstate').EventObject>>;
33
+ initialState?: string;
34
+ }, import('xstate').NonReducibleUnknown, import('xstate').EventObject, import('xstate').MetaObject, {
35
+ id: "checkout";
36
+ states: {
37
+ readonly uninitialized: {};
38
+ readonly initializing: {};
39
+ readonly showStep: {};
40
+ readonly submittingStepData: {};
41
+ readonly changingStep: {};
42
+ readonly placingOrder: {};
43
+ readonly success: {};
44
+ };
45
+ }>;
85
46
  export default checkoutMachine;
@@ -8,39 +8,39 @@ export declare function addItems({ context, event, }: {
8
8
  id: string | null;
9
9
  accessToken: string | null;
10
10
  locale: string | null;
11
- checkoutSteps: import('../types').CheckoutStep[];
11
+ checkoutSteps: Array<import('../types').CheckoutStep>;
12
12
  baseCurrency: string | null;
13
13
  currency: string | null;
14
14
  currencyConversionRate: number | null;
15
15
  dateCreated: Date | null;
16
16
  dateLastUpdated: Date | null;
17
- items: Record<string, any>[] | null;
18
- promotions: Record<string, any>[] | null;
17
+ items: Array<Record<string, any>> | null;
18
+ promotions: Array<Record<string, any>> | null;
19
19
  shippingAddresses: {
20
- available: import('../types').QuoteAddress[];
21
- applied: {
22
- availableAddressId?: string | undefined;
20
+ available: Array<import('../types').QuoteAddress>;
21
+ applied: Array<{
22
+ availableAddressId?: string;
23
23
  address: import('../types').QuoteAddress;
24
- itemIds: Record<string, any>[];
25
- }[];
24
+ itemIds: Array<Record<string, any>>;
25
+ }>;
26
26
  };
27
27
  paymentMethods: {
28
- available: import('../types').PaymentMethod[];
29
- applied: {
28
+ available: Array<import('../types').PaymentMethod>;
29
+ applied: Array<{
30
30
  paymentMethod: import('../types').PaymentMethod;
31
- options: Record<string, any>[];
31
+ options: Array<Record<string, any>>;
32
32
  amount: number;
33
- }[];
33
+ }>;
34
34
  };
35
- shipments: {
35
+ shipments: Array<{
36
36
  id: string;
37
37
  shippingAddress: {
38
38
  id: string;
39
39
  address: import('../types').QuoteAddress;
40
40
  };
41
- items: Record<string, any>[];
41
+ items: Array<Record<string, any>>;
42
42
  shippingMethods: {
43
- available: {
43
+ available: Array<{
44
44
  shippingMethod: {
45
45
  id: string;
46
46
  code: string;
@@ -56,7 +56,7 @@ export declare function addItems({ context, event, }: {
56
56
  latestShipDate: Date;
57
57
  earliestArrivalDate: Date;
58
58
  latestArrivalDate: Date;
59
- }[];
59
+ }>;
60
60
  applied: {
61
61
  shippingMethod: {
62
62
  id: string;
@@ -75,7 +75,7 @@ export declare function addItems({ context, event, }: {
75
75
  latestArrivalDate: Date;
76
76
  };
77
77
  };
78
- }[];
78
+ }>;
79
79
  totals: {
80
80
  discount: number;
81
81
  taxAmount: number;
@@ -84,12 +84,12 @@ export declare function addItems({ context, event, }: {
84
84
  subtotal: number;
85
85
  grandTotal: number;
86
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;
87
+ appliedPriceRules: Array<Record<string, any>> | null;
88
+ appliedPromotions: Array<Record<string, any>> | null;
89
+ shippingMethods: Array<Record<string, any>> | null;
90
+ storeCredit: Array<Record<string, any>> | null;
91
+ rewards: Array<Record<string, any>> | null;
92
+ giftCards: Array<Record<string, any>> | null;
93
93
  user: {
94
94
  id: string | null;
95
95
  email: string | null;
@@ -99,8 +99,8 @@ export declare function addItems({ context, event, }: {
99
99
  }> | undefined;
100
100
  errors?: string[] | undefined;
101
101
  endpoints?: {
102
- client?: string | undefined;
103
- server?: string | undefined;
102
+ client?: string;
103
+ server?: string;
104
104
  } | undefined;
105
105
  graphql?: {
106
106
  refresh: {
@@ -132,20 +132,20 @@ export declare function addItems({ context, event, }: {
132
132
  items?: Record<string, any>[] | null | undefined;
133
133
  promotions?: Record<string, any>[] | null | undefined;
134
134
  shippingAddresses?: {
135
- available: import('../types').QuoteAddress[];
136
- applied: {
137
- availableAddressId?: string | undefined;
135
+ available: Array<import('../types').QuoteAddress>;
136
+ applied: Array<{
137
+ availableAddressId?: string;
138
138
  address: import('../types').QuoteAddress;
139
- itemIds: Record<string, any>[];
140
- }[];
139
+ itemIds: Array<Record<string, any>>;
140
+ }>;
141
141
  } | undefined;
142
142
  paymentMethods?: {
143
- available: import('../types').PaymentMethod[];
144
- applied: {
143
+ available: Array<import('../types').PaymentMethod>;
144
+ applied: Array<{
145
145
  paymentMethod: import('../types').PaymentMethod;
146
- options: Record<string, any>[];
146
+ options: Array<Record<string, any>>;
147
147
  amount: number;
148
- }[];
148
+ }>;
149
149
  } | undefined;
150
150
  shipments?: {
151
151
  id: string;
@@ -153,9 +153,9 @@ export declare function addItems({ context, event, }: {
153
153
  id: string;
154
154
  address: import('../types').QuoteAddress;
155
155
  };
156
- items: Record<string, any>[];
156
+ items: Array<Record<string, any>>;
157
157
  shippingMethods: {
158
- available: {
158
+ available: Array<{
159
159
  shippingMethod: {
160
160
  id: string;
161
161
  code: string;
@@ -171,7 +171,7 @@ export declare function addItems({ context, event, }: {
171
171
  latestShipDate: Date;
172
172
  earliestArrivalDate: Date;
173
173
  latestArrivalDate: Date;
174
- }[];
174
+ }>;
175
175
  applied: {
176
176
  shippingMethod: {
177
177
  id: string;