hey-pharmacist-ecommerce 1.0.0

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 (287) hide show
  1. package/README.md +269 -0
  2. package/dist/index.d.mts +564 -0
  3. package/dist/index.d.ts +564 -0
  4. package/dist/index.js +7541 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.mjs +7485 -0
  7. package/dist/index.mjs.map +1 -0
  8. package/package.json +70 -0
  9. package/src/components/CartItem.tsx +103 -0
  10. package/src/components/EmptyState.tsx +27 -0
  11. package/src/components/Footer.tsx +147 -0
  12. package/src/components/Header.tsx +151 -0
  13. package/src/components/OrderCard.tsx +98 -0
  14. package/src/components/ProductCard.tsx +122 -0
  15. package/src/components/ui/Badge.tsx +31 -0
  16. package/src/components/ui/Button.tsx +61 -0
  17. package/src/components/ui/Input.tsx +45 -0
  18. package/src/components/ui/Modal.tsx +79 -0
  19. package/src/components/ui/Skeleton.tsx +46 -0
  20. package/src/hooks/useOrders.ts +98 -0
  21. package/src/hooks/useProducts.ts +125 -0
  22. package/src/index.ts +71 -0
  23. package/src/lib/Apis/api.ts +46 -0
  24. package/src/lib/Apis/apis/addresses-api.ts +1461 -0
  25. package/src/lib/Apis/apis/auth-api.ts +945 -0
  26. package/src/lib/Apis/apis/blogs-api.ts +582 -0
  27. package/src/lib/Apis/apis/cart-api.ts +456 -0
  28. package/src/lib/Apis/apis/categories-api.ts +725 -0
  29. package/src/lib/Apis/apis/chats-api.ts +1101 -0
  30. package/src/lib/Apis/apis/contact-us-api.ts +394 -0
  31. package/src/lib/Apis/apis/discounts-api.ts +763 -0
  32. package/src/lib/Apis/apis/drafts-api.ts +448 -0
  33. package/src/lib/Apis/apis/events-api.ts +1311 -0
  34. package/src/lib/Apis/apis/file-proccesor-api.ts +293 -0
  35. package/src/lib/Apis/apis/health-api.ts +119 -0
  36. package/src/lib/Apis/apis/images-api.ts +271 -0
  37. package/src/lib/Apis/apis/inventory-api.ts +375 -0
  38. package/src/lib/Apis/apis/marketing-api.ts +3099 -0
  39. package/src/lib/Apis/apis/notifications-api.ts +843 -0
  40. package/src/lib/Apis/apis/open-aiapi.ts +513 -0
  41. package/src/lib/Apis/apis/orders-api.ts +1343 -0
  42. package/src/lib/Apis/apis/payment-methods-api.ts +411 -0
  43. package/src/lib/Apis/apis/payments-api.ts +469 -0
  44. package/src/lib/Apis/apis/product-attributes-api.ts +538 -0
  45. package/src/lib/Apis/apis/product-favorite-list-api.ts +321 -0
  46. package/src/lib/Apis/apis/product-variants-api.ts +648 -0
  47. package/src/lib/Apis/apis/products-api.ts +1442 -0
  48. package/src/lib/Apis/apis/review-api.ts +1383 -0
  49. package/src/lib/Apis/apis/roles-api.ts +614 -0
  50. package/src/lib/Apis/apis/shipping-api.ts +703 -0
  51. package/src/lib/Apis/apis/statistics-api.ts +234 -0
  52. package/src/lib/Apis/apis/stores-api.ts +1519 -0
  53. package/src/lib/Apis/apis/sub-categories-api.ts +1208 -0
  54. package/src/lib/Apis/apis/user-groups-api.ts +1198 -0
  55. package/src/lib/Apis/apis/users-api.ts +1403 -0
  56. package/src/lib/Apis/apis/web-hooks-api.ts +198 -0
  57. package/src/lib/Apis/base.ts +70 -0
  58. package/src/lib/Apis/configuration.ts +75 -0
  59. package/src/lib/Apis/index.ts +17 -0
  60. package/src/lib/Apis/models/add-contact-to-list-dto.ts +33 -0
  61. package/src/lib/Apis/models/add-message-dto.ts +56 -0
  62. package/src/lib/Apis/models/address-created-request.ts +134 -0
  63. package/src/lib/Apis/models/address.ts +164 -0
  64. package/src/lib/Apis/models/allow-user-credit-dto.ts +27 -0
  65. package/src/lib/Apis/models/appointment.ts +75 -0
  66. package/src/lib/Apis/models/available-dates-dto.ts +33 -0
  67. package/src/lib/Apis/models/available-suggested-dates-dto.ts +33 -0
  68. package/src/lib/Apis/models/blog.ts +75 -0
  69. package/src/lib/Apis/models/browser-stats-response-dto.ts +40 -0
  70. package/src/lib/Apis/models/bulk-move-subcategories-dto.ts +33 -0
  71. package/src/lib/Apis/models/bulk-unassign-subcategories-dto.ts +27 -0
  72. package/src/lib/Apis/models/campaign-content-response-dto.ts +40 -0
  73. package/src/lib/Apis/models/campaign-draft-dto.ts +175 -0
  74. package/src/lib/Apis/models/campaign-draft-response-dto.ts +40 -0
  75. package/src/lib/Apis/models/campaign-draft-schedule-dto.ts +49 -0
  76. package/src/lib/Apis/models/campaign-draft-schedule-response-dto.ts +40 -0
  77. package/src/lib/Apis/models/campaign-draft-sending-dto.ts +43 -0
  78. package/src/lib/Apis/models/campaign-draft-sending-response-dto.ts +40 -0
  79. package/src/lib/Apis/models/cart-body-dto.ts +40 -0
  80. package/src/lib/Apis/models/cart-body-populated.ts +47 -0
  81. package/src/lib/Apis/models/cart-item-populated.ts +41 -0
  82. package/src/lib/Apis/models/cart-item.ts +33 -0
  83. package/src/lib/Apis/models/cart-response-dto.ts +70 -0
  84. package/src/lib/Apis/models/categories-paginated-response-dto.ts +52 -0
  85. package/src/lib/Apis/models/category-filters.ts +40 -0
  86. package/src/lib/Apis/models/category-populated.ts +106 -0
  87. package/src/lib/Apis/models/category-sub-category-populated.ts +51 -0
  88. package/src/lib/Apis/models/category.ts +99 -0
  89. package/src/lib/Apis/models/categorys-headlines-response-dto.ts +40 -0
  90. package/src/lib/Apis/models/change-user-email-dto.ts +27 -0
  91. package/src/lib/Apis/models/chat.ts +33 -0
  92. package/src/lib/Apis/models/check-notifications-response-dto.ts +33 -0
  93. package/src/lib/Apis/models/contact-aggregated-stats-response-dto.ts +40 -0
  94. package/src/lib/Apis/models/contact-full-dto.ts +93 -0
  95. package/src/lib/Apis/models/contact-full-response-dto.ts +40 -0
  96. package/src/lib/Apis/models/contact-list-stats-response-dto.ts +40 -0
  97. package/src/lib/Apis/models/contact-lists-response-dto.ts +40 -0
  98. package/src/lib/Apis/models/contact-us.ts +81 -0
  99. package/src/lib/Apis/models/country-stats-response-dto.ts +40 -0
  100. package/src/lib/Apis/models/create-address-dto.ts +134 -0
  101. package/src/lib/Apis/models/create-blog-dto.ts +45 -0
  102. package/src/lib/Apis/models/create-category-dto.ts +45 -0
  103. package/src/lib/Apis/models/create-chat-dto.ts +39 -0
  104. package/src/lib/Apis/models/create-contact-dto.ts +39 -0
  105. package/src/lib/Apis/models/create-contact-list-dto.ts +27 -0
  106. package/src/lib/Apis/models/create-discount-dto.ts +208 -0
  107. package/src/lib/Apis/models/create-draft-dto.ts +67 -0
  108. package/src/lib/Apis/models/create-email-template-dto.ts +51 -0
  109. package/src/lib/Apis/models/create-event-dto.ts +52 -0
  110. package/src/lib/Apis/models/create-marketing-campaign-dto.ts +81 -0
  111. package/src/lib/Apis/models/create-message-dto.ts +57 -0
  112. package/src/lib/Apis/models/create-notification-dto.ts +75 -0
  113. package/src/lib/Apis/models/create-product-attribute-dto.ts +33 -0
  114. package/src/lib/Apis/models/create-product-dto.ts +94 -0
  115. package/src/lib/Apis/models/create-review-dto.ts +63 -0
  116. package/src/lib/Apis/models/create-role-dto.ts +57 -0
  117. package/src/lib/Apis/models/create-single-variant-product-dto.ts +155 -0
  118. package/src/lib/Apis/models/create-store-address-dto.ts +134 -0
  119. package/src/lib/Apis/models/create-store-dto.ts +105 -0
  120. package/src/lib/Apis/models/create-sub-category-dto.ts +45 -0
  121. package/src/lib/Apis/models/create-user-dto.ts +89 -0
  122. package/src/lib/Apis/models/create-user-group-dto.ts +39 -0
  123. package/src/lib/Apis/models/create-variant-dto.ts +119 -0
  124. package/src/lib/Apis/models/create-zone-dto.ts +82 -0
  125. package/src/lib/Apis/models/custom-product-dto.ts +63 -0
  126. package/src/lib/Apis/models/default-payment-method-request-dto.ts +27 -0
  127. package/src/lib/Apis/models/delete-file-dto.ts +27 -0
  128. package/src/lib/Apis/models/delete-many-files-dto.ts +27 -0
  129. package/src/lib/Apis/models/discount-paginated-response.ts +52 -0
  130. package/src/lib/Apis/models/discount.ts +245 -0
  131. package/src/lib/Apis/models/discounts-insights-dto.ts +57 -0
  132. package/src/lib/Apis/models/draft.ts +79 -0
  133. package/src/lib/Apis/models/email-invoice-dto.ts +45 -0
  134. package/src/lib/Apis/models/email-template-response-dto.ts +117 -0
  135. package/src/lib/Apis/models/event.ts +76 -0
  136. package/src/lib/Apis/models/extended-product-dto.ts +204 -0
  137. package/src/lib/Apis/models/fileproccesor-upload-body.ts +27 -0
  138. package/src/lib/Apis/models/forget-password.ts +27 -0
  139. package/src/lib/Apis/models/frequently-bought-product-dto.ts +71 -0
  140. package/src/lib/Apis/models/general-stats-response-dto.ts +40 -0
  141. package/src/lib/Apis/models/generate-day-slots-dto.ts +51 -0
  142. package/src/lib/Apis/models/generate-month-slots-dto.ts +57 -0
  143. package/src/lib/Apis/models/generate-week-slots-dto.ts +57 -0
  144. package/src/lib/Apis/models/google-analytics-request-dto.ts +55 -0
  145. package/src/lib/Apis/models/google-analytics-response-dto.ts +39 -0
  146. package/src/lib/Apis/models/group-with-no-users-dto.ts +75 -0
  147. package/src/lib/Apis/models/group-with-users-dto.ts +76 -0
  148. package/src/lib/Apis/models/images-upload-body.ts +27 -0
  149. package/src/lib/Apis/models/index.ts +197 -0
  150. package/src/lib/Apis/models/inventory-paginated-response.ts +75 -0
  151. package/src/lib/Apis/models/link-stats-response-dto.ts +40 -0
  152. package/src/lib/Apis/models/login-dto.ts +33 -0
  153. package/src/lib/Apis/models/manual-discount.ts +49 -0
  154. package/src/lib/Apis/models/manual-order-dto.ts +133 -0
  155. package/src/lib/Apis/models/manual-shipping-dto.ts +45 -0
  156. package/src/lib/Apis/models/marketing-campaign-content-dto.ts +27 -0
  157. package/src/lib/Apis/models/marketing-list-contact-dto.ts +51 -0
  158. package/src/lib/Apis/models/move-subcategory-dto.ts +27 -0
  159. package/src/lib/Apis/models/my-favorite-list-dto.ts +52 -0
  160. package/src/lib/Apis/models/notification.ts +93 -0
  161. package/src/lib/Apis/models/object-id.ts +21 -0
  162. package/src/lib/Apis/models/open-api.ts +33 -0
  163. package/src/lib/Apis/models/order-paginated-response.ts +52 -0
  164. package/src/lib/Apis/models/order.ts +214 -0
  165. package/src/lib/Apis/models/orders-insights-dto.ts +69 -0
  166. package/src/lib/Apis/models/paginated-products-dto.ts +52 -0
  167. package/src/lib/Apis/models/payment-method-data.ts +34 -0
  168. package/src/lib/Apis/models/payment-method.ts +51 -0
  169. package/src/lib/Apis/models/payment-time-line-dto.ts +56 -0
  170. package/src/lib/Apis/models/payment.ts +182 -0
  171. package/src/lib/Apis/models/payments-insights-dto.ts +69 -0
  172. package/src/lib/Apis/models/payments-paginated-response.ts +52 -0
  173. package/src/lib/Apis/models/pick-type-class.ts +51 -0
  174. package/src/lib/Apis/models/populated-chat-dto.ts +95 -0
  175. package/src/lib/Apis/models/populated-discount.ts +246 -0
  176. package/src/lib/Apis/models/populated-order.ts +209 -0
  177. package/src/lib/Apis/models/prefered-pick-or-delivery-time-dto.ts +33 -0
  178. package/src/lib/Apis/models/price-range.ts +33 -0
  179. package/src/lib/Apis/models/product-attribute.ts +57 -0
  180. package/src/lib/Apis/models/product-variant.ts +167 -0
  181. package/src/lib/Apis/models/product.ts +136 -0
  182. package/src/lib/Apis/models/products-insights-dto.ts +45 -0
  183. package/src/lib/Apis/models/rate-dto.ts +123 -0
  184. package/src/lib/Apis/models/refill-request-dto.ts +75 -0
  185. package/src/lib/Apis/models/refill-request.ts +105 -0
  186. package/src/lib/Apis/models/register-or-login-with-gmail.ts +27 -0
  187. package/src/lib/Apis/models/reserve-appointment.ts +261 -0
  188. package/src/lib/Apis/models/review.ts +93 -0
  189. package/src/lib/Apis/models/role.ts +69 -0
  190. package/src/lib/Apis/models/schedule-campaign-draft-dto.ts +27 -0
  191. package/src/lib/Apis/models/send-test-email-dto.ts +28 -0
  192. package/src/lib/Apis/models/shallow-parent-category-dto.ts +33 -0
  193. package/src/lib/Apis/models/shipment-details-dto.ts +88 -0
  194. package/src/lib/Apis/models/shipment-status-dto.ts +117 -0
  195. package/src/lib/Apis/models/shipment-with-order.ts +105 -0
  196. package/src/lib/Apis/models/shipment.ts +104 -0
  197. package/src/lib/Apis/models/shipping-info.ts +88 -0
  198. package/src/lib/Apis/models/single-browser-stats-dto.ts +45 -0
  199. package/src/lib/Apis/models/single-contact-aggregated-stats-dto.ts +129 -0
  200. package/src/lib/Apis/models/single-contact-list-stats-dto.ts +117 -0
  201. package/src/lib/Apis/models/single-country-stats-dto.ts +39 -0
  202. package/src/lib/Apis/models/single-general-stats.ts +153 -0
  203. package/src/lib/Apis/models/single-link-stats-dto.ts +39 -0
  204. package/src/lib/Apis/models/single-message-populated.ts +59 -0
  205. package/src/lib/Apis/models/single-notification-dto.ts +99 -0
  206. package/src/lib/Apis/models/single-product-media.ts +74 -0
  207. package/src/lib/Apis/models/single-recipient-dto.ts +33 -0
  208. package/src/lib/Apis/models/single-suggest-attribute.ts +33 -0
  209. package/src/lib/Apis/models/statistic-dto.ts +171 -0
  210. package/src/lib/Apis/models/store-entity.ts +117 -0
  211. package/src/lib/Apis/models/store.ts +135 -0
  212. package/src/lib/Apis/models/sub-category-headlines-only-response-dto.ts +39 -0
  213. package/src/lib/Apis/models/sub-category.ts +93 -0
  214. package/src/lib/Apis/models/suggest-attributes.ts +28 -0
  215. package/src/lib/Apis/models/suggested-slot.ts +33 -0
  216. package/src/lib/Apis/models/table-cell-dto.ts +33 -0
  217. package/src/lib/Apis/models/table-dto.ts +34 -0
  218. package/src/lib/Apis/models/tadmin-session-data.ts +47 -0
  219. package/src/lib/Apis/models/track-dto.ts +94 -0
  220. package/src/lib/Apis/models/tracking-status-location-base.ts +45 -0
  221. package/src/lib/Apis/models/tracking-status-substatus.ts +39 -0
  222. package/src/lib/Apis/models/tracking-status.ts +71 -0
  223. package/src/lib/Apis/models/transfere-patient-request.ts +123 -0
  224. package/src/lib/Apis/models/transfere-patients-request-dto.ts +99 -0
  225. package/src/lib/Apis/models/tuser-session-data.ts +34 -0
  226. package/src/lib/Apis/models/update-address-dto.ts +134 -0
  227. package/src/lib/Apis/models/update-blog-dto.ts +45 -0
  228. package/src/lib/Apis/models/update-campaign-draft-content-dto.ts +27 -0
  229. package/src/lib/Apis/models/update-category-dto.ts +45 -0
  230. package/src/lib/Apis/models/update-discount-dto.ts +208 -0
  231. package/src/lib/Apis/models/update-event-dto.ts +52 -0
  232. package/src/lib/Apis/models/update-items-order-dto.ts +27 -0
  233. package/src/lib/Apis/models/update-marketing-camp-draft-dto.ts +81 -0
  234. package/src/lib/Apis/models/update-message-dto.ts +57 -0
  235. package/src/lib/Apis/models/update-product-attribute-dto.ts +33 -0
  236. package/src/lib/Apis/models/update-product-dto.ts +96 -0
  237. package/src/lib/Apis/models/update-product-variant-dto.ts +119 -0
  238. package/src/lib/Apis/models/update-refill-request-dto.ts +75 -0
  239. package/src/lib/Apis/models/update-review-dto.ts +63 -0
  240. package/src/lib/Apis/models/update-role-dto.ts +57 -0
  241. package/src/lib/Apis/models/update-store-dto.ts +105 -0
  242. package/src/lib/Apis/models/update-sub-category-dto.ts +45 -0
  243. package/src/lib/Apis/models/update-transfere-patients-request-dto.ts +99 -0
  244. package/src/lib/Apis/models/update-user-dto.ts +239 -0
  245. package/src/lib/Apis/models/update-user-group-dto.ts +39 -0
  246. package/src/lib/Apis/models/update-zone-dto.ts +82 -0
  247. package/src/lib/Apis/models/upload-pdf-body.ts +27 -0
  248. package/src/lib/Apis/models/used-by.ts +87 -0
  249. package/src/lib/Apis/models/user-entity.ts +220 -0
  250. package/src/lib/Apis/models/user-group.ts +75 -0
  251. package/src/lib/Apis/models/user-insights-dto.ts +39 -0
  252. package/src/lib/Apis/models/user-with-no-id.ts +226 -0
  253. package/src/lib/Apis/models/user.ts +232 -0
  254. package/src/lib/Apis/models/users-paginated-response.ts +52 -0
  255. package/src/lib/Apis/models/verify-email-dto.ts +33 -0
  256. package/src/lib/Apis/models/zone-single-size.ts +51 -0
  257. package/src/lib/Apis/models/zone.ts +106 -0
  258. package/src/lib/Apis/wrapper.ts +37 -0
  259. package/src/lib/api/auth.ts +81 -0
  260. package/src/lib/api/cart.ts +42 -0
  261. package/src/lib/api/client.ts +118 -0
  262. package/src/lib/api/orders.ts +53 -0
  263. package/src/lib/api/products.ts +51 -0
  264. package/src/lib/api-adapter/auth-adapter.ts +196 -0
  265. package/src/lib/api-adapter/cart-adapter.ts +193 -0
  266. package/src/lib/api-adapter/config.ts +76 -0
  267. package/src/lib/api-adapter/index.ts +13 -0
  268. package/src/lib/api-adapter/mappers.ts +147 -0
  269. package/src/lib/api-adapter/orders-adapter.ts +195 -0
  270. package/src/lib/api-adapter/products-adapter.ts +194 -0
  271. package/src/lib/types/index.ts +152 -0
  272. package/src/lib/utils/colors.ts +51 -0
  273. package/src/lib/utils/format.ts +48 -0
  274. package/src/providers/AuthProvider.tsx +117 -0
  275. package/src/providers/CartProvider.tsx +131 -0
  276. package/src/providers/EcommerceProvider.tsx +34 -0
  277. package/src/providers/ThemeProvider.tsx +57 -0
  278. package/src/screens/CartScreen.tsx +140 -0
  279. package/src/screens/CheckoutScreen.tsx +340 -0
  280. package/src/screens/CurrentOrdersScreen.tsx +85 -0
  281. package/src/screens/LoginScreen.tsx +149 -0
  282. package/src/screens/OrdersScreen.tsx +86 -0
  283. package/src/screens/ProductDetailScreen.tsx +255 -0
  284. package/src/screens/ProfileScreen.tsx +211 -0
  285. package/src/screens/RegisterScreen.tsx +200 -0
  286. package/src/screens/ShopScreen.tsx +233 -0
  287. package/src/styles/globals.css +51 -0
@@ -0,0 +1,1343 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Hey Pharamcist API
5
+ * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
6
+ *
7
+ * OpenAPI spec version: 1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by the swagger code generator program.
11
+ * https://github.com/swagger-api/swagger-codegen.git
12
+ * Do not edit the class manually.
13
+ */
14
+ import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
15
+ import { Configuration } from '../configuration';
16
+ // Some imports not used depending on template conditions
17
+ // @ts-ignore
18
+ import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
19
+ import { EmailInvoiceDto } from '../models';
20
+ import { ManualOrderDTO } from '../models';
21
+ import { OrderPaginatedResponse } from '../models';
22
+ import { OrdersInsightsDto } from '../models';
23
+ import { PopulatedOrder } from '../models';
24
+ /**
25
+ * OrdersApi - axios parameter creator
26
+ * @export
27
+ */
28
+ export const OrdersApiAxiosParamCreator = function (configuration?: Configuration) {
29
+ return {
30
+ /**
31
+ *
32
+ * @summary Add payment method to Order
33
+ * @param {string} orderId
34
+ * @param {string} paymentMethod
35
+ * @param {string} [billingAddressId]
36
+ * @param {*} [options] Override http request option.
37
+ * @throws {RequiredError}
38
+ */
39
+ assignPaymentMethod: async (orderId: string, paymentMethod: string, billingAddressId?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
40
+ // verify required parameter 'orderId' is not null or undefined
41
+ if (orderId === null || orderId === undefined) {
42
+ throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling assignPaymentMethod.');
43
+ }
44
+ // verify required parameter 'paymentMethod' is not null or undefined
45
+ if (paymentMethod === null || paymentMethod === undefined) {
46
+ throw new RequiredError('paymentMethod','Required parameter paymentMethod was null or undefined when calling assignPaymentMethod.');
47
+ }
48
+ const localVarPath = `/orders/assign-payment-method/{orderId}`
49
+ .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId)));
50
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
51
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
52
+ let baseOptions;
53
+ if (configuration) {
54
+ baseOptions = configuration.baseOptions;
55
+ }
56
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
57
+ const localVarHeaderParameter = {} as any;
58
+ const localVarQueryParameter = {} as any;
59
+
60
+ // authentication bearer required
61
+ // http bearer authentication required
62
+ if (configuration && configuration.accessToken) {
63
+ const accessToken = typeof configuration.accessToken === 'function'
64
+ ? await configuration.accessToken()
65
+ : await configuration.accessToken;
66
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
67
+ }
68
+
69
+ // authentication x-store-key required
70
+ if (configuration && configuration.apiKey) {
71
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
72
+ ? await configuration.apiKey("x-store-key")
73
+ : await configuration.apiKey;
74
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
75
+ }
76
+
77
+ if (paymentMethod !== undefined) {
78
+ localVarQueryParameter['paymentMethod'] = paymentMethod;
79
+ }
80
+
81
+ if (billingAddressId !== undefined) {
82
+ localVarQueryParameter['billingAddressId'] = billingAddressId;
83
+ }
84
+
85
+ const query = new URLSearchParams(localVarUrlObj.search);
86
+ for (const key in localVarQueryParameter) {
87
+ query.set(key, localVarQueryParameter[key]);
88
+ }
89
+ for (const key in options.params) {
90
+ query.set(key, options.params[key]);
91
+ }
92
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
93
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
94
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
95
+
96
+ return {
97
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
98
+ options: localVarRequestOptions,
99
+ };
100
+ },
101
+ /**
102
+ *
103
+ * @summary Cancel an order
104
+ * @param {string} id
105
+ * @param {*} [options] Override http request option.
106
+ * @throws {RequiredError}
107
+ */
108
+ cancelOrder: async (id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
109
+ // verify required parameter 'id' is not null or undefined
110
+ if (id === null || id === undefined) {
111
+ throw new RequiredError('id','Required parameter id was null or undefined when calling cancelOrder.');
112
+ }
113
+ const localVarPath = `/orders/cancel/{id}`
114
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
115
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
116
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
117
+ let baseOptions;
118
+ if (configuration) {
119
+ baseOptions = configuration.baseOptions;
120
+ }
121
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'PATCH', ...baseOptions, ...options};
122
+ const localVarHeaderParameter = {} as any;
123
+ const localVarQueryParameter = {} as any;
124
+
125
+ // authentication bearer required
126
+ // http bearer authentication required
127
+ if (configuration && configuration.accessToken) {
128
+ const accessToken = typeof configuration.accessToken === 'function'
129
+ ? await configuration.accessToken()
130
+ : await configuration.accessToken;
131
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
132
+ }
133
+
134
+ // authentication x-store-key required
135
+ if (configuration && configuration.apiKey) {
136
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
137
+ ? await configuration.apiKey("x-store-key")
138
+ : await configuration.apiKey;
139
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
140
+ }
141
+
142
+ const query = new URLSearchParams(localVarUrlObj.search);
143
+ for (const key in localVarQueryParameter) {
144
+ query.set(key, localVarQueryParameter[key]);
145
+ }
146
+ for (const key in options.params) {
147
+ query.set(key, options.params[key]);
148
+ }
149
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
150
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
151
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
152
+
153
+ return {
154
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
155
+ options: localVarRequestOptions,
156
+ };
157
+ },
158
+ /**
159
+ *
160
+ * @summary Create an Order
161
+ * @param {ManualOrderDTO} body
162
+ * @param {boolean} isDelivery
163
+ * @param {string} [userId]
164
+ * @param {string} [rateId]
165
+ * @param {string} [billingAddressId] The desired address id for the billing address in case of paying by card
166
+ * @param {*} [options] Override http request option.
167
+ * @throws {RequiredError}
168
+ */
169
+ createCheckout: async (body: ManualOrderDTO, isDelivery: boolean, userId?: string, rateId?: string, billingAddressId?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
170
+ // verify required parameter 'body' is not null or undefined
171
+ if (body === null || body === undefined) {
172
+ throw new RequiredError('body','Required parameter body was null or undefined when calling createCheckout.');
173
+ }
174
+ // verify required parameter 'isDelivery' is not null or undefined
175
+ if (isDelivery === null || isDelivery === undefined) {
176
+ throw new RequiredError('isDelivery','Required parameter isDelivery was null or undefined when calling createCheckout.');
177
+ }
178
+ const localVarPath = `/orders/createOrder`;
179
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
180
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
181
+ let baseOptions;
182
+ if (configuration) {
183
+ baseOptions = configuration.baseOptions;
184
+ }
185
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
186
+ const localVarHeaderParameter = {} as any;
187
+ const localVarQueryParameter = {} as any;
188
+
189
+ // authentication bearer required
190
+ // http bearer authentication required
191
+ if (configuration && configuration.accessToken) {
192
+ const accessToken = typeof configuration.accessToken === 'function'
193
+ ? await configuration.accessToken()
194
+ : await configuration.accessToken;
195
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
196
+ }
197
+
198
+ // authentication x-store-key required
199
+ if (configuration && configuration.apiKey) {
200
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
201
+ ? await configuration.apiKey("x-store-key")
202
+ : await configuration.apiKey;
203
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
204
+ }
205
+
206
+ if (userId !== undefined) {
207
+ localVarQueryParameter['userId'] = userId;
208
+ }
209
+
210
+ if (isDelivery !== undefined) {
211
+ localVarQueryParameter['isDelivery'] = isDelivery;
212
+ }
213
+
214
+ if (rateId !== undefined) {
215
+ localVarQueryParameter['rateId'] = rateId;
216
+ }
217
+
218
+ if (billingAddressId !== undefined) {
219
+ localVarQueryParameter['billingAddressId'] = billingAddressId;
220
+ }
221
+
222
+ localVarHeaderParameter['Content-Type'] = 'application/json';
223
+
224
+ const query = new URLSearchParams(localVarUrlObj.search);
225
+ for (const key in localVarQueryParameter) {
226
+ query.set(key, localVarQueryParameter[key]);
227
+ }
228
+ for (const key in options.params) {
229
+ query.set(key, options.params[key]);
230
+ }
231
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
232
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
233
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
234
+ const needsSerialization = (typeof body !== "string") || (localVarRequestOptions.headers ||= {})['Content-Type'] === 'application/json';
235
+ localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
236
+
237
+ return {
238
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
239
+ options: localVarRequestOptions,
240
+ };
241
+ },
242
+ /**
243
+ *
244
+ * @summary Delete an order
245
+ * @param {string} id
246
+ * @param {*} [options] Override http request option.
247
+ * @throws {RequiredError}
248
+ */
249
+ deleteOrder: async (id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
250
+ // verify required parameter 'id' is not null or undefined
251
+ if (id === null || id === undefined) {
252
+ throw new RequiredError('id','Required parameter id was null or undefined when calling deleteOrder.');
253
+ }
254
+ const localVarPath = `/orders/{id}`
255
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
256
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
257
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
258
+ let baseOptions;
259
+ if (configuration) {
260
+ baseOptions = configuration.baseOptions;
261
+ }
262
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'DELETE', ...baseOptions, ...options};
263
+ const localVarHeaderParameter = {} as any;
264
+ const localVarQueryParameter = {} as any;
265
+
266
+ // authentication bearer required
267
+ // http bearer authentication required
268
+ if (configuration && configuration.accessToken) {
269
+ const accessToken = typeof configuration.accessToken === 'function'
270
+ ? await configuration.accessToken()
271
+ : await configuration.accessToken;
272
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
273
+ }
274
+
275
+ // authentication x-store-key required
276
+ if (configuration && configuration.apiKey) {
277
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
278
+ ? await configuration.apiKey("x-store-key")
279
+ : await configuration.apiKey;
280
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
281
+ }
282
+
283
+ const query = new URLSearchParams(localVarUrlObj.search);
284
+ for (const key in localVarQueryParameter) {
285
+ query.set(key, localVarQueryParameter[key]);
286
+ }
287
+ for (const key in options.params) {
288
+ query.set(key, options.params[key]);
289
+ }
290
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
291
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
292
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
293
+
294
+ return {
295
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
296
+ options: localVarRequestOptions,
297
+ };
298
+ },
299
+ /**
300
+ *
301
+ * @summary Get all orders
302
+ * @param {string} [paymentStatus]
303
+ * @param {string} [orderStatus]
304
+ * @param {number} [page]
305
+ * @param {number} [limit]
306
+ * @param {string} [search]
307
+ * @param {Date} [createdAfter]
308
+ * @param {Date} [createdBefore]
309
+ * @param {Date} [userId]
310
+ * @param {*} [options] Override http request option.
311
+ * @throws {RequiredError}
312
+ */
313
+ getAllOrders: async (paymentStatus?: string, orderStatus?: string, page?: number, limit?: number, search?: string, createdAfter?: Date, createdBefore?: Date, userId?: Date, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
314
+ const localVarPath = `/orders`;
315
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
316
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
317
+ let baseOptions;
318
+ if (configuration) {
319
+ baseOptions = configuration.baseOptions;
320
+ }
321
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
322
+ const localVarHeaderParameter = {} as any;
323
+ const localVarQueryParameter = {} as any;
324
+
325
+ // authentication bearer required
326
+ // http bearer authentication required
327
+ if (configuration && configuration.accessToken) {
328
+ const accessToken = typeof configuration.accessToken === 'function'
329
+ ? await configuration.accessToken()
330
+ : await configuration.accessToken;
331
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
332
+ }
333
+
334
+ // authentication x-store-key required
335
+ if (configuration && configuration.apiKey) {
336
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
337
+ ? await configuration.apiKey("x-store-key")
338
+ : await configuration.apiKey;
339
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
340
+ }
341
+
342
+ if (paymentStatus !== undefined) {
343
+ localVarQueryParameter['paymentStatus'] = paymentStatus;
344
+ }
345
+
346
+ if (orderStatus !== undefined) {
347
+ localVarQueryParameter['orderStatus'] = orderStatus;
348
+ }
349
+
350
+ if (page !== undefined) {
351
+ localVarQueryParameter['page'] = page;
352
+ }
353
+
354
+ if (limit !== undefined) {
355
+ localVarQueryParameter['limit'] = limit;
356
+ }
357
+
358
+ if (search !== undefined) {
359
+ localVarQueryParameter['search'] = search;
360
+ }
361
+
362
+ if (createdAfter !== undefined) {
363
+ localVarQueryParameter['createdAfter'] = (createdAfter as any instanceof Date) ?
364
+ (createdAfter as any).toISOString() :
365
+ createdAfter;
366
+ }
367
+
368
+ if (createdBefore !== undefined) {
369
+ localVarQueryParameter['createdBefore'] = (createdBefore as any instanceof Date) ?
370
+ (createdBefore as any).toISOString() :
371
+ createdBefore;
372
+ }
373
+
374
+ if (userId !== undefined) {
375
+ localVarQueryParameter['userId'] = (userId as any instanceof Date) ?
376
+ (userId as any).toISOString() :
377
+ userId;
378
+ }
379
+
380
+ const query = new URLSearchParams(localVarUrlObj.search);
381
+ for (const key in localVarQueryParameter) {
382
+ query.set(key, localVarQueryParameter[key]);
383
+ }
384
+ for (const key in options.params) {
385
+ query.set(key, options.params[key]);
386
+ }
387
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
388
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
389
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
390
+
391
+ return {
392
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
393
+ options: localVarRequestOptions,
394
+ };
395
+ },
396
+ /**
397
+ *
398
+ * @summary Get an order by id
399
+ * @param {string} id
400
+ * @param {*} [options] Override http request option.
401
+ * @throws {RequiredError}
402
+ */
403
+ getSingleOrder: async (id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
404
+ // verify required parameter 'id' is not null or undefined
405
+ if (id === null || id === undefined) {
406
+ throw new RequiredError('id','Required parameter id was null or undefined when calling getSingleOrder.');
407
+ }
408
+ const localVarPath = `/orders/{id}`
409
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
410
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
411
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
412
+ let baseOptions;
413
+ if (configuration) {
414
+ baseOptions = configuration.baseOptions;
415
+ }
416
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
417
+ const localVarHeaderParameter = {} as any;
418
+ const localVarQueryParameter = {} as any;
419
+
420
+ // authentication bearer required
421
+ // http bearer authentication required
422
+ if (configuration && configuration.accessToken) {
423
+ const accessToken = typeof configuration.accessToken === 'function'
424
+ ? await configuration.accessToken()
425
+ : await configuration.accessToken;
426
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
427
+ }
428
+
429
+ // authentication x-store-key required
430
+ if (configuration && configuration.apiKey) {
431
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
432
+ ? await configuration.apiKey("x-store-key")
433
+ : await configuration.apiKey;
434
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
435
+ }
436
+
437
+ const query = new URLSearchParams(localVarUrlObj.search);
438
+ for (const key in localVarQueryParameter) {
439
+ query.set(key, localVarQueryParameter[key]);
440
+ }
441
+ for (const key in options.params) {
442
+ query.set(key, options.params[key]);
443
+ }
444
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
445
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
446
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
447
+
448
+ return {
449
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
450
+ options: localVarRequestOptions,
451
+ };
452
+ },
453
+ /**
454
+ *
455
+ * @summary Get the insights for each type of orders
456
+ * @param {*} [options] Override http request option.
457
+ * @throws {RequiredError}
458
+ */
459
+ getStoreOrderInsights: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
460
+ const localVarPath = `/orders/insights`;
461
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
462
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
463
+ let baseOptions;
464
+ if (configuration) {
465
+ baseOptions = configuration.baseOptions;
466
+ }
467
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
468
+ const localVarHeaderParameter = {} as any;
469
+ const localVarQueryParameter = {} as any;
470
+
471
+ // authentication bearer required
472
+ // http bearer authentication required
473
+ if (configuration && configuration.accessToken) {
474
+ const accessToken = typeof configuration.accessToken === 'function'
475
+ ? await configuration.accessToken()
476
+ : await configuration.accessToken;
477
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
478
+ }
479
+
480
+ // authentication x-store-key required
481
+ if (configuration && configuration.apiKey) {
482
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
483
+ ? await configuration.apiKey("x-store-key")
484
+ : await configuration.apiKey;
485
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
486
+ }
487
+
488
+ const query = new URLSearchParams(localVarUrlObj.search);
489
+ for (const key in localVarQueryParameter) {
490
+ query.set(key, localVarQueryParameter[key]);
491
+ }
492
+ for (const key in options.params) {
493
+ query.set(key, options.params[key]);
494
+ }
495
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
496
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
497
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
498
+
499
+ return {
500
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
501
+ options: localVarRequestOptions,
502
+ };
503
+ },
504
+ /**
505
+ *
506
+ * @summary Get all orders for the current user
507
+ * @param {*} [options] Override http request option.
508
+ * @throws {RequiredError}
509
+ */
510
+ getUserOrders: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
511
+ const localVarPath = `/orders/user`;
512
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
513
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
514
+ let baseOptions;
515
+ if (configuration) {
516
+ baseOptions = configuration.baseOptions;
517
+ }
518
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
519
+ const localVarHeaderParameter = {} as any;
520
+ const localVarQueryParameter = {} as any;
521
+
522
+ // authentication bearer required
523
+ // http bearer authentication required
524
+ if (configuration && configuration.accessToken) {
525
+ const accessToken = typeof configuration.accessToken === 'function'
526
+ ? await configuration.accessToken()
527
+ : await configuration.accessToken;
528
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
529
+ }
530
+
531
+ // authentication x-store-key required
532
+ if (configuration && configuration.apiKey) {
533
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
534
+ ? await configuration.apiKey("x-store-key")
535
+ : await configuration.apiKey;
536
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
537
+ }
538
+
539
+ const query = new URLSearchParams(localVarUrlObj.search);
540
+ for (const key in localVarQueryParameter) {
541
+ query.set(key, localVarQueryParameter[key]);
542
+ }
543
+ for (const key in options.params) {
544
+ query.set(key, options.params[key]);
545
+ }
546
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
547
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
548
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
549
+
550
+ return {
551
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
552
+ options: localVarRequestOptions,
553
+ };
554
+ },
555
+ /**
556
+ *
557
+ * @summary Pay for an Order
558
+ * @param {string} orderId
559
+ * @param {*} [options] Override http request option.
560
+ * @throws {RequiredError}
561
+ */
562
+ payOrder: async (orderId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
563
+ // verify required parameter 'orderId' is not null or undefined
564
+ if (orderId === null || orderId === undefined) {
565
+ throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling payOrder.');
566
+ }
567
+ const localVarPath = `/orders/pay/{orderId}`
568
+ .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId)));
569
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
570
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
571
+ let baseOptions;
572
+ if (configuration) {
573
+ baseOptions = configuration.baseOptions;
574
+ }
575
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
576
+ const localVarHeaderParameter = {} as any;
577
+ const localVarQueryParameter = {} as any;
578
+
579
+ // authentication bearer required
580
+ // http bearer authentication required
581
+ if (configuration && configuration.accessToken) {
582
+ const accessToken = typeof configuration.accessToken === 'function'
583
+ ? await configuration.accessToken()
584
+ : await configuration.accessToken;
585
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
586
+ }
587
+
588
+ // authentication x-store-key required
589
+ if (configuration && configuration.apiKey) {
590
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
591
+ ? await configuration.apiKey("x-store-key")
592
+ : await configuration.apiKey;
593
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
594
+ }
595
+
596
+ const query = new URLSearchParams(localVarUrlObj.search);
597
+ for (const key in localVarQueryParameter) {
598
+ query.set(key, localVarQueryParameter[key]);
599
+ }
600
+ for (const key in options.params) {
601
+ query.set(key, options.params[key]);
602
+ }
603
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
604
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
605
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
606
+
607
+ return {
608
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
609
+ options: localVarRequestOptions,
610
+ };
611
+ },
612
+ /**
613
+ *
614
+ * @summary Send an Invoice to email
615
+ * @param {EmailInvoiceDto} body
616
+ * @param {*} [options] Override http request option.
617
+ * @throws {RequiredError}
618
+ */
619
+ sendOrderEmail: async (body: EmailInvoiceDto, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
620
+ // verify required parameter 'body' is not null or undefined
621
+ if (body === null || body === undefined) {
622
+ throw new RequiredError('body','Required parameter body was null or undefined when calling sendOrderEmail.');
623
+ }
624
+ const localVarPath = `/orders/email`;
625
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
626
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
627
+ let baseOptions;
628
+ if (configuration) {
629
+ baseOptions = configuration.baseOptions;
630
+ }
631
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
632
+ const localVarHeaderParameter = {} as any;
633
+ const localVarQueryParameter = {} as any;
634
+
635
+ // authentication bearer required
636
+ // http bearer authentication required
637
+ if (configuration && configuration.accessToken) {
638
+ const accessToken = typeof configuration.accessToken === 'function'
639
+ ? await configuration.accessToken()
640
+ : await configuration.accessToken;
641
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
642
+ }
643
+
644
+ // authentication x-store-key required
645
+ if (configuration && configuration.apiKey) {
646
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
647
+ ? await configuration.apiKey("x-store-key")
648
+ : await configuration.apiKey;
649
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
650
+ }
651
+
652
+ localVarHeaderParameter['Content-Type'] = 'application/json';
653
+
654
+ const query = new URLSearchParams(localVarUrlObj.search);
655
+ for (const key in localVarQueryParameter) {
656
+ query.set(key, localVarQueryParameter[key]);
657
+ }
658
+ for (const key in options.params) {
659
+ query.set(key, options.params[key]);
660
+ }
661
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
662
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
663
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
664
+ const needsSerialization = (typeof body !== "string") || (localVarRequestOptions.headers ||= {})['Content-Type'] === 'application/json';
665
+ localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
666
+
667
+ return {
668
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
669
+ options: localVarRequestOptions,
670
+ };
671
+ },
672
+ /**
673
+ *
674
+ * @summary Update an order
675
+ * @param {ManualOrderDTO} body
676
+ * @param {boolean} isDelivery
677
+ * @param {string} id
678
+ * @param {string} [paymentMethod]
679
+ * @param {string} [userId]
680
+ * @param {string} [rateId]
681
+ * @param {string} [addressId] The desired address id for the store location for the pickup
682
+ * @param {string} [billingAddressId] The desired address id for the billing address in case of paying by card
683
+ * @param {*} [options] Override http request option.
684
+ * @throws {RequiredError}
685
+ */
686
+ updateOrder: async (body: ManualOrderDTO, isDelivery: boolean, id: string, paymentMethod?: string, userId?: string, rateId?: string, addressId?: string, billingAddressId?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
687
+ // verify required parameter 'body' is not null or undefined
688
+ if (body === null || body === undefined) {
689
+ throw new RequiredError('body','Required parameter body was null or undefined when calling updateOrder.');
690
+ }
691
+ // verify required parameter 'isDelivery' is not null or undefined
692
+ if (isDelivery === null || isDelivery === undefined) {
693
+ throw new RequiredError('isDelivery','Required parameter isDelivery was null or undefined when calling updateOrder.');
694
+ }
695
+ // verify required parameter 'id' is not null or undefined
696
+ if (id === null || id === undefined) {
697
+ throw new RequiredError('id','Required parameter id was null or undefined when calling updateOrder.');
698
+ }
699
+ const localVarPath = `/orders/{id}`
700
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
701
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
702
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
703
+ let baseOptions;
704
+ if (configuration) {
705
+ baseOptions = configuration.baseOptions;
706
+ }
707
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'PATCH', ...baseOptions, ...options};
708
+ const localVarHeaderParameter = {} as any;
709
+ const localVarQueryParameter = {} as any;
710
+
711
+ // authentication bearer required
712
+ // http bearer authentication required
713
+ if (configuration && configuration.accessToken) {
714
+ const accessToken = typeof configuration.accessToken === 'function'
715
+ ? await configuration.accessToken()
716
+ : await configuration.accessToken;
717
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
718
+ }
719
+
720
+ // authentication x-store-key required
721
+ if (configuration && configuration.apiKey) {
722
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
723
+ ? await configuration.apiKey("x-store-key")
724
+ : await configuration.apiKey;
725
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
726
+ }
727
+
728
+ if (paymentMethod !== undefined) {
729
+ localVarQueryParameter['paymentMethod'] = paymentMethod;
730
+ }
731
+
732
+ if (userId !== undefined) {
733
+ localVarQueryParameter['userId'] = userId;
734
+ }
735
+
736
+ if (isDelivery !== undefined) {
737
+ localVarQueryParameter['isDelivery'] = isDelivery;
738
+ }
739
+
740
+ if (rateId !== undefined) {
741
+ localVarQueryParameter['rateId'] = rateId;
742
+ }
743
+
744
+ if (addressId !== undefined) {
745
+ localVarQueryParameter['addressId'] = addressId;
746
+ }
747
+
748
+ if (billingAddressId !== undefined) {
749
+ localVarQueryParameter['billingAddressId'] = billingAddressId;
750
+ }
751
+
752
+ localVarHeaderParameter['Content-Type'] = 'application/json';
753
+
754
+ const query = new URLSearchParams(localVarUrlObj.search);
755
+ for (const key in localVarQueryParameter) {
756
+ query.set(key, localVarQueryParameter[key]);
757
+ }
758
+ for (const key in options.params) {
759
+ query.set(key, options.params[key]);
760
+ }
761
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
762
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
763
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
764
+ const needsSerialization = (typeof body !== "string") || (localVarRequestOptions.headers ||= {})['Content-Type'] === 'application/json';
765
+ localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
766
+
767
+ return {
768
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
769
+ options: localVarRequestOptions,
770
+ };
771
+ },
772
+ /**
773
+ *
774
+ * @summary Update an order status
775
+ * @param {string} id
776
+ * @param {string} orderStatus
777
+ * @param {*} [options] Override http request option.
778
+ * @throws {RequiredError}
779
+ */
780
+ updateOrderStatus: async (id: string, orderStatus: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
781
+ // verify required parameter 'id' is not null or undefined
782
+ if (id === null || id === undefined) {
783
+ throw new RequiredError('id','Required parameter id was null or undefined when calling updateOrderStatus.');
784
+ }
785
+ // verify required parameter 'orderStatus' is not null or undefined
786
+ if (orderStatus === null || orderStatus === undefined) {
787
+ throw new RequiredError('orderStatus','Required parameter orderStatus was null or undefined when calling updateOrderStatus.');
788
+ }
789
+ const localVarPath = `/orders/{id}/status`
790
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
791
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
792
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
793
+ let baseOptions;
794
+ if (configuration) {
795
+ baseOptions = configuration.baseOptions;
796
+ }
797
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'PATCH', ...baseOptions, ...options};
798
+ const localVarHeaderParameter = {} as any;
799
+ const localVarQueryParameter = {} as any;
800
+
801
+ // authentication bearer required
802
+ // http bearer authentication required
803
+ if (configuration && configuration.accessToken) {
804
+ const accessToken = typeof configuration.accessToken === 'function'
805
+ ? await configuration.accessToken()
806
+ : await configuration.accessToken;
807
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
808
+ }
809
+
810
+ // authentication x-store-key required
811
+ if (configuration && configuration.apiKey) {
812
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
813
+ ? await configuration.apiKey("x-store-key")
814
+ : await configuration.apiKey;
815
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
816
+ }
817
+
818
+ if (orderStatus !== undefined) {
819
+ localVarQueryParameter['orderStatus'] = orderStatus;
820
+ }
821
+
822
+ const query = new URLSearchParams(localVarUrlObj.search);
823
+ for (const key in localVarQueryParameter) {
824
+ query.set(key, localVarQueryParameter[key]);
825
+ }
826
+ for (const key in options.params) {
827
+ query.set(key, options.params[key]);
828
+ }
829
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
830
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
831
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
832
+
833
+ return {
834
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
835
+ options: localVarRequestOptions,
836
+ };
837
+ },
838
+ }
839
+ };
840
+
841
+ /**
842
+ * OrdersApi - functional programming interface
843
+ * @export
844
+ */
845
+ export const OrdersApiFp = function(configuration?: Configuration) {
846
+ return {
847
+ /**
848
+ *
849
+ * @summary Add payment method to Order
850
+ * @param {string} orderId
851
+ * @param {string} paymentMethod
852
+ * @param {string} [billingAddressId]
853
+ * @param {*} [options] Override http request option.
854
+ * @throws {RequiredError}
855
+ */
856
+ async assignPaymentMethod(orderId: string, paymentMethod: string, billingAddressId?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<PopulatedOrder>>> {
857
+ const localVarAxiosArgs = await OrdersApiAxiosParamCreator(configuration).assignPaymentMethod(orderId, paymentMethod, billingAddressId, options);
858
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
859
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
860
+ return axios.request(axiosRequestArgs);
861
+ };
862
+ },
863
+ /**
864
+ *
865
+ * @summary Cancel an order
866
+ * @param {string} id
867
+ * @param {*} [options] Override http request option.
868
+ * @throws {RequiredError}
869
+ */
870
+ async cancelOrder(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<PopulatedOrder>>> {
871
+ const localVarAxiosArgs = await OrdersApiAxiosParamCreator(configuration).cancelOrder(id, options);
872
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
873
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
874
+ return axios.request(axiosRequestArgs);
875
+ };
876
+ },
877
+ /**
878
+ *
879
+ * @summary Create an Order
880
+ * @param {ManualOrderDTO} body
881
+ * @param {boolean} isDelivery
882
+ * @param {string} [userId]
883
+ * @param {string} [rateId]
884
+ * @param {string} [billingAddressId] The desired address id for the billing address in case of paying by card
885
+ * @param {*} [options] Override http request option.
886
+ * @throws {RequiredError}
887
+ */
888
+ async createCheckout(body: ManualOrderDTO, isDelivery: boolean, userId?: string, rateId?: string, billingAddressId?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<PopulatedOrder>>> {
889
+ const localVarAxiosArgs = await OrdersApiAxiosParamCreator(configuration).createCheckout(body, isDelivery, userId, rateId, billingAddressId, options);
890
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
891
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
892
+ return axios.request(axiosRequestArgs);
893
+ };
894
+ },
895
+ /**
896
+ *
897
+ * @summary Delete an order
898
+ * @param {string} id
899
+ * @param {*} [options] Override http request option.
900
+ * @throws {RequiredError}
901
+ */
902
+ async deleteOrder(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
903
+ const localVarAxiosArgs = await OrdersApiAxiosParamCreator(configuration).deleteOrder(id, options);
904
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
905
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
906
+ return axios.request(axiosRequestArgs);
907
+ };
908
+ },
909
+ /**
910
+ *
911
+ * @summary Get all orders
912
+ * @param {string} [paymentStatus]
913
+ * @param {string} [orderStatus]
914
+ * @param {number} [page]
915
+ * @param {number} [limit]
916
+ * @param {string} [search]
917
+ * @param {Date} [createdAfter]
918
+ * @param {Date} [createdBefore]
919
+ * @param {Date} [userId]
920
+ * @param {*} [options] Override http request option.
921
+ * @throws {RequiredError}
922
+ */
923
+ async getAllOrders(paymentStatus?: string, orderStatus?: string, page?: number, limit?: number, search?: string, createdAfter?: Date, createdBefore?: Date, userId?: Date, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<OrderPaginatedResponse>>> {
924
+ const localVarAxiosArgs = await OrdersApiAxiosParamCreator(configuration).getAllOrders(paymentStatus, orderStatus, page, limit, search, createdAfter, createdBefore, userId, options);
925
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
926
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
927
+ return axios.request(axiosRequestArgs);
928
+ };
929
+ },
930
+ /**
931
+ *
932
+ * @summary Get an order by id
933
+ * @param {string} id
934
+ * @param {*} [options] Override http request option.
935
+ * @throws {RequiredError}
936
+ */
937
+ async getSingleOrder(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<PopulatedOrder>>> {
938
+ const localVarAxiosArgs = await OrdersApiAxiosParamCreator(configuration).getSingleOrder(id, options);
939
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
940
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
941
+ return axios.request(axiosRequestArgs);
942
+ };
943
+ },
944
+ /**
945
+ *
946
+ * @summary Get the insights for each type of orders
947
+ * @param {*} [options] Override http request option.
948
+ * @throws {RequiredError}
949
+ */
950
+ async getStoreOrderInsights(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<OrdersInsightsDto>>> {
951
+ const localVarAxiosArgs = await OrdersApiAxiosParamCreator(configuration).getStoreOrderInsights(options);
952
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
953
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
954
+ return axios.request(axiosRequestArgs);
955
+ };
956
+ },
957
+ /**
958
+ *
959
+ * @summary Get all orders for the current user
960
+ * @param {*} [options] Override http request option.
961
+ * @throws {RequiredError}
962
+ */
963
+ async getUserOrders(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Array<PopulatedOrder>>>> {
964
+ const localVarAxiosArgs = await OrdersApiAxiosParamCreator(configuration).getUserOrders(options);
965
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
966
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
967
+ return axios.request(axiosRequestArgs);
968
+ };
969
+ },
970
+ /**
971
+ *
972
+ * @summary Pay for an Order
973
+ * @param {string} orderId
974
+ * @param {*} [options] Override http request option.
975
+ * @throws {RequiredError}
976
+ */
977
+ async payOrder(orderId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<PopulatedOrder>>> {
978
+ const localVarAxiosArgs = await OrdersApiAxiosParamCreator(configuration).payOrder(orderId, options);
979
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
980
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
981
+ return axios.request(axiosRequestArgs);
982
+ };
983
+ },
984
+ /**
985
+ *
986
+ * @summary Send an Invoice to email
987
+ * @param {EmailInvoiceDto} body
988
+ * @param {*} [options] Override http request option.
989
+ * @throws {RequiredError}
990
+ */
991
+ async sendOrderEmail(body: EmailInvoiceDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<string>>> {
992
+ const localVarAxiosArgs = await OrdersApiAxiosParamCreator(configuration).sendOrderEmail(body, options);
993
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
994
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
995
+ return axios.request(axiosRequestArgs);
996
+ };
997
+ },
998
+ /**
999
+ *
1000
+ * @summary Update an order
1001
+ * @param {ManualOrderDTO} body
1002
+ * @param {boolean} isDelivery
1003
+ * @param {string} id
1004
+ * @param {string} [paymentMethod]
1005
+ * @param {string} [userId]
1006
+ * @param {string} [rateId]
1007
+ * @param {string} [addressId] The desired address id for the store location for the pickup
1008
+ * @param {string} [billingAddressId] The desired address id for the billing address in case of paying by card
1009
+ * @param {*} [options] Override http request option.
1010
+ * @throws {RequiredError}
1011
+ */
1012
+ async updateOrder(body: ManualOrderDTO, isDelivery: boolean, id: string, paymentMethod?: string, userId?: string, rateId?: string, addressId?: string, billingAddressId?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<PopulatedOrder>>> {
1013
+ const localVarAxiosArgs = await OrdersApiAxiosParamCreator(configuration).updateOrder(body, isDelivery, id, paymentMethod, userId, rateId, addressId, billingAddressId, options);
1014
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1015
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1016
+ return axios.request(axiosRequestArgs);
1017
+ };
1018
+ },
1019
+ /**
1020
+ *
1021
+ * @summary Update an order status
1022
+ * @param {string} id
1023
+ * @param {string} orderStatus
1024
+ * @param {*} [options] Override http request option.
1025
+ * @throws {RequiredError}
1026
+ */
1027
+ async updateOrderStatus(id: string, orderStatus: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<PopulatedOrder>>> {
1028
+ const localVarAxiosArgs = await OrdersApiAxiosParamCreator(configuration).updateOrderStatus(id, orderStatus, options);
1029
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1030
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1031
+ return axios.request(axiosRequestArgs);
1032
+ };
1033
+ },
1034
+ }
1035
+ };
1036
+
1037
+ /**
1038
+ * OrdersApi - factory interface
1039
+ * @export
1040
+ */
1041
+ export const OrdersApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
1042
+ return {
1043
+ /**
1044
+ *
1045
+ * @summary Add payment method to Order
1046
+ * @param {string} orderId
1047
+ * @param {string} paymentMethod
1048
+ * @param {string} [billingAddressId]
1049
+ * @param {*} [options] Override http request option.
1050
+ * @throws {RequiredError}
1051
+ */
1052
+ async assignPaymentMethod(orderId: string, paymentMethod: string, billingAddressId?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<PopulatedOrder>> {
1053
+ return OrdersApiFp(configuration).assignPaymentMethod(orderId, paymentMethod, billingAddressId, options).then((request) => request(axios, basePath));
1054
+ },
1055
+ /**
1056
+ *
1057
+ * @summary Cancel an order
1058
+ * @param {string} id
1059
+ * @param {*} [options] Override http request option.
1060
+ * @throws {RequiredError}
1061
+ */
1062
+ async cancelOrder(id: string, options?: AxiosRequestConfig): Promise<AxiosResponse<PopulatedOrder>> {
1063
+ return OrdersApiFp(configuration).cancelOrder(id, options).then((request) => request(axios, basePath));
1064
+ },
1065
+ /**
1066
+ *
1067
+ * @summary Create an Order
1068
+ * @param {ManualOrderDTO} body
1069
+ * @param {boolean} isDelivery
1070
+ * @param {string} [userId]
1071
+ * @param {string} [rateId]
1072
+ * @param {string} [billingAddressId] The desired address id for the billing address in case of paying by card
1073
+ * @param {*} [options] Override http request option.
1074
+ * @throws {RequiredError}
1075
+ */
1076
+ async createCheckout(body: ManualOrderDTO, isDelivery: boolean, userId?: string, rateId?: string, billingAddressId?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<PopulatedOrder>> {
1077
+ return OrdersApiFp(configuration).createCheckout(body, isDelivery, userId, rateId, billingAddressId, options).then((request) => request(axios, basePath));
1078
+ },
1079
+ /**
1080
+ *
1081
+ * @summary Delete an order
1082
+ * @param {string} id
1083
+ * @param {*} [options] Override http request option.
1084
+ * @throws {RequiredError}
1085
+ */
1086
+ async deleteOrder(id: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
1087
+ return OrdersApiFp(configuration).deleteOrder(id, options).then((request) => request(axios, basePath));
1088
+ },
1089
+ /**
1090
+ *
1091
+ * @summary Get all orders
1092
+ * @param {string} [paymentStatus]
1093
+ * @param {string} [orderStatus]
1094
+ * @param {number} [page]
1095
+ * @param {number} [limit]
1096
+ * @param {string} [search]
1097
+ * @param {Date} [createdAfter]
1098
+ * @param {Date} [createdBefore]
1099
+ * @param {Date} [userId]
1100
+ * @param {*} [options] Override http request option.
1101
+ * @throws {RequiredError}
1102
+ */
1103
+ async getAllOrders(paymentStatus?: string, orderStatus?: string, page?: number, limit?: number, search?: string, createdAfter?: Date, createdBefore?: Date, userId?: Date, options?: AxiosRequestConfig): Promise<AxiosResponse<OrderPaginatedResponse>> {
1104
+ return OrdersApiFp(configuration).getAllOrders(paymentStatus, orderStatus, page, limit, search, createdAfter, createdBefore, userId, options).then((request) => request(axios, basePath));
1105
+ },
1106
+ /**
1107
+ *
1108
+ * @summary Get an order by id
1109
+ * @param {string} id
1110
+ * @param {*} [options] Override http request option.
1111
+ * @throws {RequiredError}
1112
+ */
1113
+ async getSingleOrder(id: string, options?: AxiosRequestConfig): Promise<AxiosResponse<PopulatedOrder>> {
1114
+ return OrdersApiFp(configuration).getSingleOrder(id, options).then((request) => request(axios, basePath));
1115
+ },
1116
+ /**
1117
+ *
1118
+ * @summary Get the insights for each type of orders
1119
+ * @param {*} [options] Override http request option.
1120
+ * @throws {RequiredError}
1121
+ */
1122
+ async getStoreOrderInsights(options?: AxiosRequestConfig): Promise<AxiosResponse<OrdersInsightsDto>> {
1123
+ return OrdersApiFp(configuration).getStoreOrderInsights(options).then((request) => request(axios, basePath));
1124
+ },
1125
+ /**
1126
+ *
1127
+ * @summary Get all orders for the current user
1128
+ * @param {*} [options] Override http request option.
1129
+ * @throws {RequiredError}
1130
+ */
1131
+ async getUserOrders(options?: AxiosRequestConfig): Promise<AxiosResponse<Array<PopulatedOrder>>> {
1132
+ return OrdersApiFp(configuration).getUserOrders(options).then((request) => request(axios, basePath));
1133
+ },
1134
+ /**
1135
+ *
1136
+ * @summary Pay for an Order
1137
+ * @param {string} orderId
1138
+ * @param {*} [options] Override http request option.
1139
+ * @throws {RequiredError}
1140
+ */
1141
+ async payOrder(orderId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<PopulatedOrder>> {
1142
+ return OrdersApiFp(configuration).payOrder(orderId, options).then((request) => request(axios, basePath));
1143
+ },
1144
+ /**
1145
+ *
1146
+ * @summary Send an Invoice to email
1147
+ * @param {EmailInvoiceDto} body
1148
+ * @param {*} [options] Override http request option.
1149
+ * @throws {RequiredError}
1150
+ */
1151
+ async sendOrderEmail(body: EmailInvoiceDto, options?: AxiosRequestConfig): Promise<AxiosResponse<string>> {
1152
+ return OrdersApiFp(configuration).sendOrderEmail(body, options).then((request) => request(axios, basePath));
1153
+ },
1154
+ /**
1155
+ *
1156
+ * @summary Update an order
1157
+ * @param {ManualOrderDTO} body
1158
+ * @param {boolean} isDelivery
1159
+ * @param {string} id
1160
+ * @param {string} [paymentMethod]
1161
+ * @param {string} [userId]
1162
+ * @param {string} [rateId]
1163
+ * @param {string} [addressId] The desired address id for the store location for the pickup
1164
+ * @param {string} [billingAddressId] The desired address id for the billing address in case of paying by card
1165
+ * @param {*} [options] Override http request option.
1166
+ * @throws {RequiredError}
1167
+ */
1168
+ async updateOrder(body: ManualOrderDTO, isDelivery: boolean, id: string, paymentMethod?: string, userId?: string, rateId?: string, addressId?: string, billingAddressId?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<PopulatedOrder>> {
1169
+ return OrdersApiFp(configuration).updateOrder(body, isDelivery, id, paymentMethod, userId, rateId, addressId, billingAddressId, options).then((request) => request(axios, basePath));
1170
+ },
1171
+ /**
1172
+ *
1173
+ * @summary Update an order status
1174
+ * @param {string} id
1175
+ * @param {string} orderStatus
1176
+ * @param {*} [options] Override http request option.
1177
+ * @throws {RequiredError}
1178
+ */
1179
+ async updateOrderStatus(id: string, orderStatus: string, options?: AxiosRequestConfig): Promise<AxiosResponse<PopulatedOrder>> {
1180
+ return OrdersApiFp(configuration).updateOrderStatus(id, orderStatus, options).then((request) => request(axios, basePath));
1181
+ },
1182
+ };
1183
+ };
1184
+
1185
+ /**
1186
+ * OrdersApi - object-oriented interface
1187
+ * @export
1188
+ * @class OrdersApi
1189
+ * @extends {BaseAPI}
1190
+ */
1191
+ export class OrdersApi extends BaseAPI {
1192
+ /**
1193
+ *
1194
+ * @summary Add payment method to Order
1195
+ * @param {string} orderId
1196
+ * @param {string} paymentMethod
1197
+ * @param {string} [billingAddressId]
1198
+ * @param {*} [options] Override http request option.
1199
+ * @throws {RequiredError}
1200
+ * @memberof OrdersApi
1201
+ */
1202
+ public async assignPaymentMethod(orderId: string, paymentMethod: string, billingAddressId?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<PopulatedOrder>> {
1203
+ return OrdersApiFp(this.configuration).assignPaymentMethod(orderId, paymentMethod, billingAddressId, options).then((request) => request(this.axios, this.basePath));
1204
+ }
1205
+ /**
1206
+ *
1207
+ * @summary Cancel an order
1208
+ * @param {string} id
1209
+ * @param {*} [options] Override http request option.
1210
+ * @throws {RequiredError}
1211
+ * @memberof OrdersApi
1212
+ */
1213
+ public async cancelOrder(id: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<PopulatedOrder>> {
1214
+ return OrdersApiFp(this.configuration).cancelOrder(id, options).then((request) => request(this.axios, this.basePath));
1215
+ }
1216
+ /**
1217
+ *
1218
+ * @summary Create an Order
1219
+ * @param {ManualOrderDTO} body
1220
+ * @param {boolean} isDelivery
1221
+ * @param {string} [userId]
1222
+ * @param {string} [rateId]
1223
+ * @param {string} [billingAddressId] The desired address id for the billing address in case of paying by card
1224
+ * @param {*} [options] Override http request option.
1225
+ * @throws {RequiredError}
1226
+ * @memberof OrdersApi
1227
+ */
1228
+ public async createCheckout(body: ManualOrderDTO, isDelivery: boolean, userId?: string, rateId?: string, billingAddressId?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<PopulatedOrder>> {
1229
+ return OrdersApiFp(this.configuration).createCheckout(body, isDelivery, userId, rateId, billingAddressId, options).then((request) => request(this.axios, this.basePath));
1230
+ }
1231
+ /**
1232
+ *
1233
+ * @summary Delete an order
1234
+ * @param {string} id
1235
+ * @param {*} [options] Override http request option.
1236
+ * @throws {RequiredError}
1237
+ * @memberof OrdersApi
1238
+ */
1239
+ public async deleteOrder(id: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
1240
+ return OrdersApiFp(this.configuration).deleteOrder(id, options).then((request) => request(this.axios, this.basePath));
1241
+ }
1242
+ /**
1243
+ *
1244
+ * @summary Get all orders
1245
+ * @param {string} [paymentStatus]
1246
+ * @param {string} [orderStatus]
1247
+ * @param {number} [page]
1248
+ * @param {number} [limit]
1249
+ * @param {string} [search]
1250
+ * @param {Date} [createdAfter]
1251
+ * @param {Date} [createdBefore]
1252
+ * @param {Date} [userId]
1253
+ * @param {*} [options] Override http request option.
1254
+ * @throws {RequiredError}
1255
+ * @memberof OrdersApi
1256
+ */
1257
+ public async getAllOrders(paymentStatus?: string, orderStatus?: string, page?: number, limit?: number, search?: string, createdAfter?: Date, createdBefore?: Date, userId?: Date, options?: AxiosRequestConfig) : Promise<AxiosResponse<OrderPaginatedResponse>> {
1258
+ return OrdersApiFp(this.configuration).getAllOrders(paymentStatus, orderStatus, page, limit, search, createdAfter, createdBefore, userId, options).then((request) => request(this.axios, this.basePath));
1259
+ }
1260
+ /**
1261
+ *
1262
+ * @summary Get an order by id
1263
+ * @param {string} id
1264
+ * @param {*} [options] Override http request option.
1265
+ * @throws {RequiredError}
1266
+ * @memberof OrdersApi
1267
+ */
1268
+ public async getSingleOrder(id: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<PopulatedOrder>> {
1269
+ return OrdersApiFp(this.configuration).getSingleOrder(id, options).then((request) => request(this.axios, this.basePath));
1270
+ }
1271
+ /**
1272
+ *
1273
+ * @summary Get the insights for each type of orders
1274
+ * @param {*} [options] Override http request option.
1275
+ * @throws {RequiredError}
1276
+ * @memberof OrdersApi
1277
+ */
1278
+ public async getStoreOrderInsights(options?: AxiosRequestConfig) : Promise<AxiosResponse<OrdersInsightsDto>> {
1279
+ return OrdersApiFp(this.configuration).getStoreOrderInsights(options).then((request) => request(this.axios, this.basePath));
1280
+ }
1281
+ /**
1282
+ *
1283
+ * @summary Get all orders for the current user
1284
+ * @param {*} [options] Override http request option.
1285
+ * @throws {RequiredError}
1286
+ * @memberof OrdersApi
1287
+ */
1288
+ public async getUserOrders(options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<PopulatedOrder>>> {
1289
+ return OrdersApiFp(this.configuration).getUserOrders(options).then((request) => request(this.axios, this.basePath));
1290
+ }
1291
+ /**
1292
+ *
1293
+ * @summary Pay for an Order
1294
+ * @param {string} orderId
1295
+ * @param {*} [options] Override http request option.
1296
+ * @throws {RequiredError}
1297
+ * @memberof OrdersApi
1298
+ */
1299
+ public async payOrder(orderId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<PopulatedOrder>> {
1300
+ return OrdersApiFp(this.configuration).payOrder(orderId, options).then((request) => request(this.axios, this.basePath));
1301
+ }
1302
+ /**
1303
+ *
1304
+ * @summary Send an Invoice to email
1305
+ * @param {EmailInvoiceDto} body
1306
+ * @param {*} [options] Override http request option.
1307
+ * @throws {RequiredError}
1308
+ * @memberof OrdersApi
1309
+ */
1310
+ public async sendOrderEmail(body: EmailInvoiceDto, options?: AxiosRequestConfig) : Promise<AxiosResponse<string>> {
1311
+ return OrdersApiFp(this.configuration).sendOrderEmail(body, options).then((request) => request(this.axios, this.basePath));
1312
+ }
1313
+ /**
1314
+ *
1315
+ * @summary Update an order
1316
+ * @param {ManualOrderDTO} body
1317
+ * @param {boolean} isDelivery
1318
+ * @param {string} id
1319
+ * @param {string} [paymentMethod]
1320
+ * @param {string} [userId]
1321
+ * @param {string} [rateId]
1322
+ * @param {string} [addressId] The desired address id for the store location for the pickup
1323
+ * @param {string} [billingAddressId] The desired address id for the billing address in case of paying by card
1324
+ * @param {*} [options] Override http request option.
1325
+ * @throws {RequiredError}
1326
+ * @memberof OrdersApi
1327
+ */
1328
+ public async updateOrder(body: ManualOrderDTO, isDelivery: boolean, id: string, paymentMethod?: string, userId?: string, rateId?: string, addressId?: string, billingAddressId?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<PopulatedOrder>> {
1329
+ return OrdersApiFp(this.configuration).updateOrder(body, isDelivery, id, paymentMethod, userId, rateId, addressId, billingAddressId, options).then((request) => request(this.axios, this.basePath));
1330
+ }
1331
+ /**
1332
+ *
1333
+ * @summary Update an order status
1334
+ * @param {string} id
1335
+ * @param {string} orderStatus
1336
+ * @param {*} [options] Override http request option.
1337
+ * @throws {RequiredError}
1338
+ * @memberof OrdersApi
1339
+ */
1340
+ public async updateOrderStatus(id: string, orderStatus: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<PopulatedOrder>> {
1341
+ return OrdersApiFp(this.configuration).updateOrderStatus(id, orderStatus, options).then((request) => request(this.axios, this.basePath));
1342
+ }
1343
+ }