@dropins/storefront-order 0.1.0-alpha3 → 0.1.0-alpha30

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 (220) hide show
  1. package/api/cancelOrder/cancelOrder.d.ts +2 -0
  2. package/api/cancelOrder/graphql/cancelOrderMutation.d.ts +2 -0
  3. package/api/cancelOrder/index.d.ts +2 -0
  4. package/api/confirmCancelOrder/confirmCancelOrder.d.ts +16 -0
  5. package/api/confirmCancelOrder/graphql/ConfirmCancelOrder.d.ts +16 -0
  6. package/api/confirmCancelOrder/index.d.ts +16 -0
  7. package/api/getAttributesForm/getAttributesForm.d.ts +4 -0
  8. package/api/getAttributesForm/graphql/getAttributesForm.graphql.d.ts +3 -0
  9. package/api/getAttributesForm/index.d.ts +2 -0
  10. package/api/getAttributesList/getAttributesList.d.ts +5 -0
  11. package/api/getAttributesList/graphql/getAttributesList.graphql.d.ts +2 -0
  12. package/api/getAttributesList/index.d.ts +2 -0
  13. package/api/getCustomer/getCustomer.d.ts +4 -0
  14. package/api/getCustomer/graphql/getCustomer.graphql.d.ts +2 -0
  15. package/api/getCustomer/index.d.ts +2 -0
  16. package/api/getCustomerOrdersReturn/getCustomerOrdersReturn.d.ts +4 -0
  17. package/api/getCustomerOrdersReturn/graphql/getCustomerOrdersReturn.graphql.d.ts +2 -0
  18. package/api/getCustomerOrdersReturn/index.d.ts +2 -0
  19. package/api/getGuestOrder/getGuestOrder.d.ts +3 -3
  20. package/api/getGuestOrder/graphql/index.d.ts +2 -0
  21. package/api/getOrderDetailsById/getOrderDetailsById.d.ts +2 -2
  22. package/api/getOrderDetailsById/graphql/index.d.ts +1 -0
  23. package/api/getOrderDetailsById/graphql/orderItemsFragment.graphql.d.ts +5 -1
  24. package/api/getOrderDetailsById/graphql/orderSummaryFragment.graphql.d.ts +1 -1
  25. package/api/getOrderDetailsById/graphql/returnsFragment.graphql.d.ts +2 -0
  26. package/api/getStoreConfig/getStoreConfig.d.ts +4 -0
  27. package/api/getStoreConfig/graphql/StoreConfigQuery.d.ts +2 -0
  28. package/api/getStoreConfig/index.d.ts +2 -0
  29. package/api/guestOrderByToken/graphql/guestOrderByToken.graphql.d.ts +2 -0
  30. package/api/guestOrderByToken/guestOrderByToken.d.ts +4 -0
  31. package/api/guestOrderByToken/index.d.ts +2 -0
  32. package/api/helpers/initializeOrderDetails.d.ts +3 -1
  33. package/api/index.d.ts +13 -2
  34. package/api/placeOrder/graphql/placeOrderMutation.d.ts +2 -0
  35. package/api/placeOrder/index.d.ts +2 -0
  36. package/api/placeOrder/placeOrder.d.ts +4 -0
  37. package/api/reorderItems/graphql/reorderItems.graphql.d.ts +2 -0
  38. package/api/reorderItems/index.d.ts +2 -0
  39. package/api/reorderItems/reorderItems.d.ts +4 -0
  40. package/api/requestGuestOrderCancel/graphql/requestGuestOrderCancelMutation.d.ts +2 -0
  41. package/api/requestGuestOrderCancel/index.d.ts +2 -0
  42. package/api/requestGuestOrderCancel/requestGuestOrderCancel.d.ts +2 -0
  43. package/api/requestReturn/graphql/fragments.d.ts +2 -0
  44. package/api/requestReturn/graphql/requestReturn.graphql.d.ts +2 -0
  45. package/api/requestReturn/index.d.ts +2 -0
  46. package/api/requestReturn/requestReturn.d.ts +9 -0
  47. package/api.js +281 -13
  48. package/chunks/CartSummaryItem.js +3 -0
  49. package/chunks/OrderCancelForm.js +3 -0
  50. package/chunks/OrderLoaders.js +3 -0
  51. package/chunks/ReturnsListContent.js +3 -0
  52. package/chunks/ShippingStatusCard.js +3 -0
  53. package/chunks/convertCase.js +3 -0
  54. package/chunks/fetch-graphql.js +3 -0
  55. package/chunks/formatDateToLocale.js +3 -0
  56. package/chunks/getAttributesForm.js +49 -0
  57. package/chunks/getCustomerOrdersReturn.js +21 -0
  58. package/chunks/getFormValues.js +3 -0
  59. package/chunks/getGuestOrder.graphql.js +160 -0
  60. package/chunks/getGuestOrder.js +9 -131
  61. package/chunks/getStoreConfig.js +19 -0
  62. package/chunks/network-error.js +3 -0
  63. package/chunks/redirectTo.js +3 -0
  64. package/chunks/reorderItems.js +20 -0
  65. package/chunks/requestGuestOrderCancel.js +99 -0
  66. package/chunks/requestReturn.js +52 -0
  67. package/chunks/returnOrdersHelper.js +3 -0
  68. package/chunks/setTaxStatus.js +3 -0
  69. package/chunks/transform-attributes-form.js +3 -0
  70. package/chunks/transform-customer-orders-returns.js +142 -0
  71. package/chunks/useGetStoreConfig.js +3 -0
  72. package/chunks/useIsMobile.js +3 -0
  73. package/components/CustomerDetailsContent/CustomerDetailsContent.d.ts +5 -0
  74. package/components/CustomerDetailsContent/index.d.ts +3 -0
  75. package/components/EmptyList/EmptyList.d.ts +5 -0
  76. package/components/EmptyList/index.d.ts +3 -0
  77. package/components/OrderActions/OrderActions.d.ts +5 -0
  78. package/components/OrderActions/index.d.ts +3 -0
  79. package/components/OrderCancel/OrderCancel.d.ts +5 -0
  80. package/components/OrderCancel/index.d.ts +3 -0
  81. package/components/OrderCostSummaryContent/Blocks.d.ts +38 -0
  82. package/components/OrderCostSummaryContent/OrderCostSummaryContent.d.ts +5 -0
  83. package/components/OrderCostSummaryContent/index.d.ts +3 -0
  84. package/components/OrderHeader/OrderHeader.d.ts +9 -0
  85. package/components/OrderHeader/index.d.ts +2 -0
  86. package/components/OrderLoaders/OrderLoaders.d.ts +10 -0
  87. package/components/OrderLoaders/index.d.ts +3 -0
  88. package/components/OrderProductListContent/CartSummaryItem.d.ts +5 -0
  89. package/components/OrderProductListContent/OrderProductListContent.d.ts +5 -0
  90. package/components/OrderProductListContent/index.d.ts +4 -0
  91. package/components/OrderStatusContent/OrderStatusContent.d.ts +5 -0
  92. package/components/OrderStatusContent/index.d.ts +3 -0
  93. package/components/Reorder/Reorder.d.ts +5 -0
  94. package/components/Reorder/index.d.ts +3 -0
  95. package/components/ReturnOrderMessage/ReturnOrderMessage.d.ts +5 -0
  96. package/components/ReturnOrderMessage/index.d.ts +3 -0
  97. package/components/ReturnOrderProductList/ReturnOrderProductList.d.ts +5 -0
  98. package/components/ReturnOrderProductList/index.d.ts +3 -0
  99. package/components/ReturnReasonForm/ReturnReasonForm.d.ts +5 -0
  100. package/components/ReturnReasonForm/index.d.ts +3 -0
  101. package/components/ReturnsListContent/ReturnsListContent.d.ts +5 -0
  102. package/components/ReturnsListContent/index.d.ts +3 -0
  103. package/components/ShippingStatusCard/ShippingStatusCard.d.ts +5 -0
  104. package/components/ShippingStatusCard/ShippingStatusReturnCard.d.ts +5 -0
  105. package/components/ShippingStatusCard/index.d.ts +4 -0
  106. package/components/index.d.ts +16 -1
  107. package/configs/defaultAttributePreset.config.d.ts +2 -0
  108. package/configs/mock.config.d.ts +3567 -0
  109. package/containers/CreateReturn/CreateReturn.d.ts +5 -0
  110. package/containers/CreateReturn/index.d.ts +3 -0
  111. package/containers/CreateReturn.d.ts +3 -0
  112. package/containers/CreateReturn.js +3 -0
  113. package/containers/CustomerDetails/CustomerDetails.d.ts +5 -0
  114. package/containers/CustomerDetails/index.d.ts +3 -0
  115. package/containers/CustomerDetails.d.ts +3 -0
  116. package/containers/CustomerDetails.js +3 -0
  117. package/containers/OrderCancelForm/OrderCancelForm.d.ts +5 -0
  118. package/containers/OrderCancelForm/index.d.ts +3 -0
  119. package/containers/OrderCancelForm.d.ts +3 -0
  120. package/containers/OrderCancelForm.js +3 -0
  121. package/containers/OrderCostSummary/OrderCostSummary.d.ts +5 -0
  122. package/containers/OrderCostSummary/index.d.ts +3 -0
  123. package/containers/OrderCostSummary.d.ts +3 -0
  124. package/containers/OrderCostSummary.js +3 -0
  125. package/containers/OrderHeader/OrderHeader.d.ts +5 -0
  126. package/containers/OrderHeader/index.d.ts +3 -0
  127. package/containers/OrderHeader.d.ts +3 -0
  128. package/containers/OrderHeader.js +3 -0
  129. package/containers/OrderProductList/OrderProductList.d.ts +5 -0
  130. package/containers/OrderProductList/index.d.ts +3 -0
  131. package/containers/OrderProductList.d.ts +3 -0
  132. package/containers/OrderProductList.js +3 -0
  133. package/containers/OrderReturns/OrderReturns.d.ts +5 -0
  134. package/containers/OrderReturns/index.d.ts +3 -0
  135. package/containers/OrderReturns.d.ts +3 -0
  136. package/containers/OrderReturns.js +3 -0
  137. package/containers/OrderSearch.js +3 -1
  138. package/containers/OrderStatus/OrderStatus.d.ts +5 -0
  139. package/containers/OrderStatus/index.d.ts +3 -0
  140. package/containers/OrderStatus.d.ts +3 -0
  141. package/containers/OrderStatus.js +22 -0
  142. package/containers/ReturnsList/ReturnsList.d.ts +5 -0
  143. package/containers/ReturnsList/index.d.ts +3 -0
  144. package/containers/ReturnsList.d.ts +3 -0
  145. package/containers/ReturnsList.js +3 -0
  146. package/containers/ShippingStatus/ShippingStatus.d.ts +5 -0
  147. package/containers/ShippingStatus/index.d.ts +3 -0
  148. package/containers/ShippingStatus.d.ts +3 -0
  149. package/containers/ShippingStatus.js +3 -0
  150. package/containers/index.d.ts +10 -0
  151. package/data/models/acdl.d.ts +99 -0
  152. package/data/models/attributes-form.d.ts +27 -0
  153. package/data/models/customer-orders-return.d.ts +38 -0
  154. package/data/models/customer.d.ts +6 -0
  155. package/data/models/index.d.ts +5 -1
  156. package/data/models/order-details.d.ts +162 -31
  157. package/data/models/store-config.d.ts +15 -0
  158. package/data/transforms/index.d.ts +8 -1
  159. package/data/transforms/transform-acdl.d.ts +5 -0
  160. package/data/transforms/transform-attributes-form.d.ts +7 -0
  161. package/data/transforms/transform-customer-address-input.d.ts +22 -0
  162. package/data/transforms/transform-customer-orders-returns.d.ts +5 -0
  163. package/data/transforms/transform-customer.d.ts +5 -0
  164. package/data/transforms/transform-guest-order.d.ts +4 -3
  165. package/data/transforms/transform-order-details.d.ts +15 -3
  166. package/data/transforms/transform-place-order.d.ts +5 -0
  167. package/data/transforms/transform-store-config.d.ts +4 -0
  168. package/hooks/api/useGetStoreConfig.d.ts +4 -0
  169. package/hooks/containers/useConfirmCancelOrder.d.ts +9 -0
  170. package/hooks/containers/useCreateReturn.d.ts +64 -0
  171. package/hooks/containers/useCustomerDetails.d.ts +12 -0
  172. package/hooks/containers/useOrderCostSummary.d.ts +9 -0
  173. package/hooks/containers/useOrderHeader.d.ts +8 -0
  174. package/hooks/containers/useOrderProductList.d.ts +8 -0
  175. package/hooks/containers/useOrderReturns.d.ts +8 -0
  176. package/hooks/containers/useOrderSearch.d.ts +3 -3
  177. package/hooks/containers/useOrderStatus.d.ts +8 -0
  178. package/hooks/containers/useReturnsList.d.ts +15 -0
  179. package/hooks/containers/useShippingStatus.d.ts +9 -0
  180. package/hooks/index.d.ts +11 -0
  181. package/hooks/useInLineAlert.d.ts +7 -0
  182. package/hooks/useIsMobile.d.ts +2 -0
  183. package/i18n/en_US.json.d.ts +322 -3
  184. package/lib/acdl.d.ts +18 -0
  185. package/lib/capitalizeFirst.d.ts +2 -0
  186. package/lib/categorizeProducts.d.ts +66 -0
  187. package/lib/convertCase.d.ts +4 -0
  188. package/lib/formatDateToLocale.d.ts +31 -0
  189. package/lib/getQueryParam.d.ts +2 -0
  190. package/lib/redirectTo.d.ts +3 -0
  191. package/lib/returnOrdersHelper.d.ts +36 -0
  192. package/lib/setTaxStatus.d.ts +4 -0
  193. package/package.json +1 -1
  194. package/render.js +5 -2
  195. package/types/api/getAttributesForm.types.d.ts +31 -0
  196. package/types/api/getAttributesList.types.d.ts +28 -0
  197. package/types/api/getCustomer.types.d.ts +13 -0
  198. package/types/api/getCustomerOrdersReturn.types.d.ts +21 -0
  199. package/types/api/getOrderDetails.types.d.ts +123 -39
  200. package/types/api/guestOrderByToken.types.d.ts +13 -0
  201. package/types/api/placeOrder.types.d.ts +19 -0
  202. package/types/api/reorderItems.types.d.ts +27 -0
  203. package/types/api/requestReturn.types.d.ts +33 -0
  204. package/types/createReturn.types.d.ts +71 -0
  205. package/types/customerDetails.types.d.ts +59 -0
  206. package/types/emptyList.types.d.ts +7 -0
  207. package/types/form.types.d.ts +6 -6
  208. package/types/index.d.ts +22 -2
  209. package/types/notification.types.d.ts +14 -0
  210. package/types/orderCancel.types.d.ts +16 -0
  211. package/types/orderCostSummary.types.d.ts +29 -0
  212. package/types/orderHeader.types.d.ts +19 -0
  213. package/types/orderProductList.types.d.ts +36 -0
  214. package/types/orderSearch.types.d.ts +21 -3
  215. package/types/orderStatus.types.d.ts +49 -0
  216. package/types/reorder.types.d.ts +9 -0
  217. package/types/returnsList.types.d.ts +82 -0
  218. package/types/shippingStatus.types.d.ts +49 -0
  219. package/data/models/guest-order.d.ts +0 -21
  220. package/lib/convertToInputDateFormat.d.ts +0 -2
@@ -0,0 +1,31 @@
1
+ export interface ResponseAttributesFormItemsProps {
2
+ code: string;
3
+ sort_order: string;
4
+ default_value: null | string;
5
+ entity_type: string;
6
+ frontend_class: null | string;
7
+ multiline_count: number;
8
+ frontend_input: string;
9
+ is_required: boolean;
10
+ is_unique: boolean;
11
+ label: string;
12
+ options: {
13
+ is_default: boolean;
14
+ label: string;
15
+ value: string;
16
+ }[];
17
+ }
18
+ export interface GetAttributesFormResponse {
19
+ data: {
20
+ attributesForm: {
21
+ errors?: {
22
+ message: string;
23
+ }[];
24
+ items?: ResponseAttributesFormItemsProps[];
25
+ };
26
+ };
27
+ errors?: {
28
+ message: string;
29
+ }[];
30
+ }
31
+ //# sourceMappingURL=getAttributesForm.types.d.ts.map
@@ -0,0 +1,28 @@
1
+ export type AttributesListItems = {
2
+ code: string;
3
+ sort_order: string;
4
+ default_value: null | string;
5
+ frontend_class: null | string;
6
+ multiline_count: number;
7
+ entity_type: string;
8
+ frontend_input: string;
9
+ is_required: boolean;
10
+ is_unique: boolean;
11
+ label: string;
12
+ options: {
13
+ is_default: boolean;
14
+ label: string;
15
+ value: string;
16
+ }[];
17
+ };
18
+ export interface GetAttributesListResponse {
19
+ data: {
20
+ attributesList: {
21
+ items: AttributesListItems[];
22
+ };
23
+ };
24
+ errors?: {
25
+ message: string;
26
+ }[];
27
+ }
28
+ //# sourceMappingURL=getAttributesList.types.d.ts.map
@@ -0,0 +1,13 @@
1
+ export interface getCustomerShortResponse {
2
+ data: {
3
+ customer: {
4
+ firstname: string;
5
+ lastname: string;
6
+ email: string;
7
+ };
8
+ };
9
+ errors?: {
10
+ message: string;
11
+ }[];
12
+ }
13
+ //# sourceMappingURL=getCustomer.types.d.ts.map
@@ -0,0 +1,21 @@
1
+ import { ReturnsItemsProps } from './getOrderDetails.types';
2
+
3
+ export interface OrdersReturnResponseProps {
4
+ page_info?: {
5
+ page_size: number;
6
+ total_pages: number;
7
+ current_page: number;
8
+ };
9
+ items?: ReturnsItemsProps[];
10
+ }
11
+ export interface GetCustomerOrdersReturnResponse {
12
+ data: {
13
+ customer: {
14
+ returns: OrdersReturnResponseProps;
15
+ };
16
+ };
17
+ errors?: {
18
+ message: string;
19
+ }[];
20
+ }
21
+ //# sourceMappingURL=getCustomerOrdersReturn.types.d.ts.map
@@ -1,4 +1,4 @@
1
- export type QueryType = 'orderData' | 'orderSummary' | 'orderStatus' | 'orderCustomerInformation';
1
+ export type QueryType = 'orderData';
2
2
  export interface UserAddressesProps {
3
3
  city?: string;
4
4
  company?: string;
@@ -16,21 +16,29 @@ export interface UserAddressesProps {
16
16
  telephone?: string;
17
17
  vat_id?: string;
18
18
  }
19
- interface SmallImageProps {
19
+ interface ThumbnailImageProps {
20
20
  url?: string;
21
+ label?: string;
21
22
  }
22
- interface ProductProps {
23
- small_image?: SmallImageProps;
24
- }
25
- export interface OrderItemProps {
26
- status?: string;
27
- product_name?: string;
28
- id?: string;
29
- product?: ProductProps;
23
+ export interface ProductProps {
24
+ thumbnail?: ThumbnailImageProps;
25
+ image: ThumbnailImageProps;
26
+ canonical_url: string;
27
+ url_key: string;
28
+ id: string;
29
+ uid: string;
30
+ name: string;
31
+ __typename: string;
32
+ sku: string;
33
+ price_range: {
34
+ maximum_price: {
35
+ regular_price: MoneyProps;
36
+ };
37
+ };
30
38
  }
31
39
  export interface MoneyProps {
32
- value?: number;
33
- currency?: string;
40
+ value: number;
41
+ currency: string;
34
42
  }
35
43
  interface GrandTotalProps extends MoneyProps {
36
44
  }
@@ -48,10 +56,11 @@ interface TaxDetailProps {
48
56
  title?: string;
49
57
  }
50
58
  export interface DiscountProps {
51
- amount?: MoneyProps;
52
- label?: string;
59
+ amount: MoneyProps;
60
+ label: string;
53
61
  }
54
62
  export interface TotalProps {
63
+ total_giftcard?: MoneyProps;
55
64
  grand_total?: GrandTotalProps;
56
65
  subtotal?: SubtotalProps;
57
66
  taxes?: TaxDetailProps[];
@@ -72,11 +81,9 @@ interface InvoiceProps {
72
81
  }[];
73
82
  }
74
83
  export interface GiftMessageProps {
75
- gift_message: {
76
- form: string;
77
- message: string;
78
- to: string;
79
- };
84
+ form: string;
85
+ message: string;
86
+ to: string;
80
87
  }
81
88
  export interface GiftWrappingProps {
82
89
  gift_wrapping: {
@@ -89,7 +96,15 @@ export interface GiftWrappingProps {
89
96
  };
90
97
  };
91
98
  }
92
- interface OrderItemInterface {
99
+ export interface giftCardProps {
100
+ sender_name: string;
101
+ sender_email: string;
102
+ recipient_email: string;
103
+ recipient_name: string;
104
+ message: string;
105
+ }
106
+ export interface OrderItemProps {
107
+ __typename: string;
93
108
  discounts: DiscountProps[];
94
109
  eligible_for_return: boolean;
95
110
  entered_options: {
@@ -111,13 +126,33 @@ interface OrderItemInterface {
111
126
  quantity_refunded: number;
112
127
  quantity_returned: number;
113
128
  quantity_shipped: number;
129
+ quantity_return_requested: number;
114
130
  selected_options: {
115
131
  label: string;
116
132
  value: string;
117
133
  }[];
134
+ bundle_options: any;
118
135
  status: string;
136
+ gift_card?: giftCardProps;
137
+ downloadable_links: {
138
+ title: string;
139
+ }[];
140
+ prices: {
141
+ price_including_tax: MoneyProps;
142
+ original_price: MoneyProps;
143
+ original_price_including_tax: MoneyProps;
144
+ price: MoneyProps;
145
+ discounts: [
146
+ {
147
+ label: string;
148
+ amount: {
149
+ value: number;
150
+ };
151
+ }
152
+ ];
153
+ };
119
154
  }
120
- export interface paymentMethodsProps {
155
+ export interface PaymentMethodsProps {
121
156
  name: string;
122
157
  type: string;
123
158
  additional_data: {
@@ -125,7 +160,60 @@ export interface paymentMethodsProps {
125
160
  value: string;
126
161
  }[];
127
162
  }
163
+ export interface ShipmentsProps {
164
+ id: string;
165
+ number: string;
166
+ tracking: {
167
+ carrier: string;
168
+ number: string;
169
+ title: string;
170
+ }[];
171
+ comments: {
172
+ message: string;
173
+ timestamp: string;
174
+ }[];
175
+ items: {
176
+ id: string;
177
+ product_sku: string;
178
+ product_name: string;
179
+ };
180
+ }
181
+ export declare enum AvailableActionsProps {
182
+ CANCEL = "CANCEL",
183
+ RETURN = "RETURN",
184
+ REORDER = "REORDER"
185
+ }
186
+ export interface ReturnsItemsProps {
187
+ number: string;
188
+ status: string;
189
+ created_at: string;
190
+ order: {
191
+ number: string;
192
+ token: string;
193
+ };
194
+ shipping: {
195
+ tracking: {
196
+ status: {
197
+ text: string;
198
+ type: string;
199
+ };
200
+ carrier: {
201
+ uid: string;
202
+ label: string;
203
+ };
204
+ tracking_number: string;
205
+ }[];
206
+ };
207
+ items: {
208
+ quantity: number;
209
+ status: string;
210
+ uid: string;
211
+ request_quantity: number;
212
+ order_item: OrderItemProps;
213
+ }[];
214
+ }
128
215
  export interface OrderProps {
216
+ available_actions: AvailableActionsProps[];
129
217
  shipping_method: string;
130
218
  status: string;
131
219
  token: string;
@@ -139,29 +227,17 @@ export interface OrderProps {
139
227
  applied_coupons: {
140
228
  code: string;
141
229
  }[];
142
- shipments: {
143
- id: string;
144
- number: string;
145
- tracking: {
146
- carrier: string;
147
- number: string;
148
- title: string;
149
- }[];
150
- comments: {
151
- message: string;
152
- timestamp: string;
153
- }[];
154
- }[];
155
230
  returns: {
156
- pageSize: number;
157
- currentPage: number;
231
+ __typename: string;
232
+ items: ReturnsItemsProps[];
158
233
  };
159
- items_eligible_for_return: OrderItemInterface[];
234
+ shipments: ShipmentsProps[];
235
+ items_eligible_for_return: OrderItemProps[];
236
+ items: OrderItemProps[];
160
237
  gift_wrapping: GiftWrappingProps;
161
238
  gift_message: GiftMessageProps;
162
- payment_methods: paymentMethodsProps[];
239
+ payment_methods: PaymentMethodsProps[];
163
240
  invoices: InvoiceProps[];
164
- items: OrderItemProps[];
165
241
  shipping_address: UserAddressesProps;
166
242
  billing_address: UserAddressesProps;
167
243
  total?: TotalProps;
@@ -171,6 +247,14 @@ export interface ErrorProps {
171
247
  message?: string;
172
248
  }[];
173
249
  }
250
+ type GetOrderDetailsByParams<T extends QueryType> = {
251
+ orderId?: string;
252
+ returnRef?: string;
253
+ queryType: T;
254
+ returnsPageSize?: number;
255
+ };
256
+ export interface GetOrderDetailsByIdProps extends GetOrderDetailsByParams<QueryType> {
257
+ }
174
258
  export interface OrdersResponse extends ErrorProps {
175
259
  data?: {
176
260
  customer?: {
@@ -0,0 +1,13 @@
1
+ import { OrderProps } from '..';
2
+
3
+ export interface GuestOrderByTokenProps extends OrderProps {
4
+ }
5
+ export interface GuestOrderByTokenResponse {
6
+ data: {
7
+ guestOrderByToken?: GuestOrderByTokenProps;
8
+ };
9
+ errors?: {
10
+ message: string;
11
+ }[];
12
+ }
13
+ //# sourceMappingURL=guestOrderByToken.types.d.ts.map
@@ -0,0 +1,19 @@
1
+ import { OrderProps } from '..';
2
+
3
+ export interface PlaceOrderProps extends OrderProps {
4
+ }
5
+ export interface PlaceOrderResponse {
6
+ data: {
7
+ placeOrder?: {
8
+ errors?: {
9
+ code: string;
10
+ message: string;
11
+ }[];
12
+ orderV2?: PlaceOrderProps;
13
+ };
14
+ };
15
+ errors?: {
16
+ message: string;
17
+ }[];
18
+ }
19
+ //# sourceMappingURL=placeOrder.types.d.ts.map
@@ -0,0 +1,27 @@
1
+ export interface UserInputErrorProps {
2
+ code: string;
3
+ message: string;
4
+ path: [string];
5
+ }
6
+ export interface ReorderItemsResponse {
7
+ data: {
8
+ reorderItems: {
9
+ cart: {
10
+ itemsV2: {
11
+ items: {
12
+ uid: string;
13
+ }[];
14
+ };
15
+ };
16
+ userInputErrors: UserInputErrorProps[];
17
+ };
18
+ };
19
+ errors?: {
20
+ message: string;
21
+ }[];
22
+ }
23
+ export interface ReorderItemsProps {
24
+ success: boolean;
25
+ userInputErrors: UserInputErrorProps[];
26
+ }
27
+ //# sourceMappingURL=reorderItems.types.d.ts.map
@@ -0,0 +1,33 @@
1
+ export interface RequestReturnProps {
2
+ orderUid: string;
3
+ contactEmail: string;
4
+ items: {
5
+ orderItemUid: string;
6
+ quantityToReturn: number;
7
+ selectedCustomAttributes?: {
8
+ attribute_code: string;
9
+ value: string;
10
+ }[];
11
+ enteredCustomAttributes?: {
12
+ attribute_code: string;
13
+ value: string;
14
+ }[];
15
+ }[];
16
+ }
17
+ export interface ReturnProps {
18
+ uid: string;
19
+ number: string;
20
+ status: string;
21
+ created_at: string;
22
+ }
23
+ export interface RequestReturnResponse {
24
+ data: {
25
+ requestReturn: {
26
+ return: ReturnProps;
27
+ };
28
+ };
29
+ errors?: {
30
+ message: string;
31
+ }[];
32
+ }
33
+ //# sourceMappingURL=requestReturn.types.d.ts.map
@@ -0,0 +1,71 @@
1
+ import { AttributesFormModel, OrderDataModel, OrderItemModel } from '../data/models';
2
+ import { InLineAlertProps, TaxTypes } from '.';
3
+ import { SlotProps } from '@dropins/tools/types/elsie/src/lib';
4
+ import { RefObject } from 'preact';
5
+ import { MutableRefObject } from 'preact/compat';
6
+
7
+ type options = Record<string, string | number | boolean>;
8
+ export type StepsTypes = 'products' | 'attributes' | 'success' | 'error';
9
+ type onSuccessTypes = {
10
+ uid: string;
11
+ number: string;
12
+ status: string;
13
+ createdAt: string;
14
+ };
15
+ export interface CreateReturnProps {
16
+ orderData?: OrderDataModel;
17
+ slots?: {
18
+ ReturnOrderItem: SlotProps;
19
+ ReturnFormActions: SlotProps<{
20
+ handleChangeStep: (value: StepsTypes) => void;
21
+ }>;
22
+ };
23
+ className: string;
24
+ onSuccess?: (response: onSuccessTypes) => void;
25
+ onError?: (message: string) => void;
26
+ routeReturnSuccess?: () => string;
27
+ showConfigurableOptions?: (options: options | {}) => options;
28
+ }
29
+ export interface ReturnOrderProductListProps {
30
+ placeholderImage: string;
31
+ slots?: {
32
+ ReturnOrderItem: SlotProps;
33
+ };
34
+ itemsEligibleForReturn: OrderItemModel[];
35
+ loading: boolean;
36
+ taxConfig: TaxTypes;
37
+ translations: Record<string, string>;
38
+ selectedProductList: OrderItemModel[] | [];
39
+ handleSelectedProductList: (product: any) => void;
40
+ showConfigurableOptions?: (options: options | {}) => options;
41
+ handleSetQuantity: (value: number, productSku: string) => void;
42
+ handleChangeStep: (value: StepsTypes) => void;
43
+ }
44
+ export interface ReturnReasonFormProps {
45
+ placeholderImage: string;
46
+ slots?: {
47
+ ReturnFormActions: SlotProps<{
48
+ handleChangeStep: (value: StepsTypes) => void;
49
+ }>;
50
+ };
51
+ formsRef: MutableRefObject<RefObject<HTMLFormElement>[]>;
52
+ loading: boolean;
53
+ translations: Record<string, string>;
54
+ fieldsConfig: AttributesFormModel[] | [];
55
+ selectedProductList: OrderItemModel[] | [];
56
+ handleChangeStep: (value: StepsTypes) => void;
57
+ onSubmit?: (event: SubmitEvent, isValid: boolean) => Promise<void | null | undefined>;
58
+ }
59
+ export interface ReturnOrderMessageProps {
60
+ translations: Record<string, string>;
61
+ routeReturnSuccess?: (orderData?: OrderDataModel) => string;
62
+ orderData?: OrderDataModel;
63
+ }
64
+ export interface UseCreateReturn {
65
+ orderData?: OrderDataModel;
66
+ onSuccess?: (response: onSuccessTypes) => void;
67
+ onError?: (message: string) => void;
68
+ handleSetInLineAlert: (value?: InLineAlertProps) => void;
69
+ }
70
+ export {};
71
+ //# sourceMappingURL=createReturn.types.d.ts.map
@@ -0,0 +1,59 @@
1
+ import { SlotProps } from '@dropins/tools/types/elsie/src/lib';
2
+ import { OrderDataModel, OrdersReturnPropsModel } from '../data/models';
3
+ import { IconNode, IconType } from '@dropins/tools/types/elsie/src/components';
4
+
5
+ export interface KeysSortOrderProps {
6
+ name: string;
7
+ orderNumber?: number;
8
+ label?: string | null;
9
+ }
10
+ export interface NormalizeAddressProps extends KeysSortOrderProps {
11
+ name: string;
12
+ orderNumber: number;
13
+ value?: string | string[];
14
+ label?: string | null;
15
+ }
16
+ export interface CustomerDetailsProps {
17
+ className?: string;
18
+ paymentIconsMap?: Record<string, IconType | IconNode>;
19
+ orderData?: OrderDataModel;
20
+ withHeader?: boolean;
21
+ title?: string;
22
+ slots?: {
23
+ OrderReturnInformation: SlotProps<OrdersReturnPropsModel | undefined>;
24
+ PaymentMethodIcon: SlotProps<Record<string, string>>;
25
+ };
26
+ }
27
+ export interface UseCustomerDetails {
28
+ orderData?: OrderDataModel;
29
+ }
30
+ export interface CustomerDetailsContentProps extends Omit<CustomerDetailsProps, 'orderData' | 'className'> {
31
+ translations: Record<string, string>;
32
+ loading: boolean;
33
+ order?: OrderDataModel;
34
+ normalizeAddress: {
35
+ billingAddress: NormalizeAddressProps[][];
36
+ shippingAddress: NormalizeAddressProps[][];
37
+ };
38
+ }
39
+ export interface CustomerAddressesModel {
40
+ firstname?: string;
41
+ lastname?: string;
42
+ city?: string;
43
+ company?: string;
44
+ countryCode?: string;
45
+ region?: {
46
+ region: string;
47
+ regionCode: string;
48
+ regionId: string | number;
49
+ };
50
+ telephone?: string;
51
+ id?: string;
52
+ vatId?: string;
53
+ postcode?: string;
54
+ street?: string;
55
+ street_2?: string;
56
+ defaultShipping?: boolean;
57
+ defaultBilling?: boolean;
58
+ }
59
+ //# sourceMappingURL=customerDetails.types.d.ts.map
@@ -0,0 +1,7 @@
1
+ export interface EmptyListProps {
2
+ isEmpty: boolean;
3
+ typeList: 'orders';
4
+ minifiedView: boolean;
5
+ message: string;
6
+ }
7
+ //# sourceMappingURL=emptyList.types.d.ts.map
@@ -26,15 +26,15 @@ export interface FieldsProps {
26
26
  code: string;
27
27
  name: string;
28
28
  defaultValue: string | boolean | number;
29
- entity_type: string;
29
+ entityType: string;
30
30
  required: boolean;
31
- is_unique: boolean;
31
+ isUnique: boolean;
32
32
  label: string;
33
33
  orderNumber: number;
34
- options: {
35
- is_default: boolean;
36
- label: string;
37
- value: string;
34
+ options?: {
35
+ is_default?: boolean;
36
+ label?: string;
37
+ value?: string;
38
38
  }[];
39
39
  }
40
40
  export interface FormProps {
package/types/index.d.ts CHANGED
@@ -1,5 +1,25 @@
1
- export * from './api/getOrderDetails.types';
1
+ export * from './api/getAttributesForm.types';
2
+ export * from './api/getAttributesList.types';
3
+ export * from './api/getCustomer.types';
4
+ export * from './api/getCustomerOrdersReturn.types';
2
5
  export * from './api/getGuestOrder.types';
3
- export * from './orderSearch.types';
6
+ export * from './api/getOrderDetails.types';
7
+ export * from './api/guestOrderByToken.types';
8
+ export * from './api/placeOrder.types';
9
+ export * from './api/reorderItems.types';
10
+ export * from './api/requestReturn.types';
11
+ export * from './createReturn.types';
12
+ export * from './customerDetails.types';
13
+ export * from './emptyList.types';
4
14
  export * from './form.types';
15
+ export * from './notification.types';
16
+ export * from './orderCancel.types';
17
+ export * from './orderCostSummary.types';
18
+ export * from './orderHeader.types';
19
+ export * from './orderProductList.types';
20
+ export * from './orderSearch.types';
21
+ export * from './orderStatus.types';
22
+ export * from './reorder.types';
23
+ export * from './returnsList.types';
24
+ export * from './shippingStatus.types';
5
25
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,14 @@
1
+ import { VNode } from 'preact';
2
+ import { HTMLAttributes } from 'preact/compat';
3
+
4
+ export type AdditionalActionsAlertProps = Array<{
5
+ label: string;
6
+ onClick: (event: Event) => void;
7
+ }>;
8
+ export interface InLineAlertProps {
9
+ type: 'success' | 'warning' | 'error';
10
+ heading: string;
11
+ icon?: VNode<HTMLAttributes<SVGSVGElement>>;
12
+ }
13
+ export type statusTypes = '' | 'success' | 'error' | 'pending';
14
+ //# sourceMappingURL=notification.types.d.ts.map
@@ -0,0 +1,16 @@
1
+ import { ButtonProps, PickerProps } from '@dropins/tools/types/elsie/src/src/components';
2
+ import { PickerOption } from '@dropins/tools/types/elsie/src/components';
3
+
4
+ export interface OrderCancelProps {
5
+ orderRef: string;
6
+ }
7
+ export interface OrderCancelFormProps {
8
+ orderRef: string;
9
+ pickerProps?: PickerProps;
10
+ submitButtonProps?: ButtonProps;
11
+ cancelReasons: PickerOption[];
12
+ }
13
+ export interface ConfirmCancelOrderProps {
14
+ enableOrderCancellation: boolean | undefined;
15
+ }
16
+ //# sourceMappingURL=orderCancel.types.d.ts.map
@@ -0,0 +1,29 @@
1
+ import { HTMLAttributes } from 'preact/compat';
2
+ import { OrderDataModel, StoreConfigModel } from '../data/models';
3
+
4
+ type TaxTypes = {
5
+ taxIncluded: boolean;
6
+ taxExcluded: boolean;
7
+ };
8
+ export interface StoreConfigProps extends Omit<StoreConfigModel, 'orderCancellationEnabled' | 'orderCancellationReasons' | 'shoppingCartDisplayPrice' | 'shoppingOrdersDisplayShipping' | 'shoppingOrdersDisplaySubtotal'> {
9
+ shoppingCartDisplayPrice: TaxTypes;
10
+ shoppingOrdersDisplayShipping: TaxTypes;
11
+ shoppingOrdersDisplaySubtotal: TaxTypes;
12
+ }
13
+ export interface OrderCostSummaryProps extends HTMLAttributes<HTMLDivElement> {
14
+ orderData?: OrderDataModel;
15
+ withHeader?: boolean;
16
+ }
17
+ export interface OrderCostSummaryContentProps {
18
+ order?: OrderDataModel;
19
+ withHeader?: boolean;
20
+ loading?: boolean;
21
+ storeConfig: StoreConfigProps | null;
22
+ translations: Record<string, string>;
23
+ }
24
+ export interface UseOrderCostSummaryProps {
25
+ orderData?: OrderDataModel;
26
+ config: StoreConfigModel | null;
27
+ }
28
+ export {};
29
+ //# sourceMappingURL=orderCostSummary.types.d.ts.map