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,1383 @@
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 { CreateReviewDto } from '../models';
20
+ import { Review } from '../models';
21
+ import { UpdateReviewDto } from '../models';
22
+ /**
23
+ * ReviewApi - axios parameter creator
24
+ * @export
25
+ */
26
+ export const ReviewApiAxiosParamCreator = function (configuration?: Configuration) {
27
+ return {
28
+ /**
29
+ *
30
+ * @summary Add a reply to a review
31
+ * @param {UpdateReviewDto} body
32
+ * @param {string} id
33
+ * @param {*} [options] Override http request option.
34
+ * @throws {RequiredError}
35
+ */
36
+ addReplay: async (body: UpdateReviewDto, id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
37
+ // verify required parameter 'body' is not null or undefined
38
+ if (body === null || body === undefined) {
39
+ throw new RequiredError('body','Required parameter body was null or undefined when calling addReplay.');
40
+ }
41
+ // verify required parameter 'id' is not null or undefined
42
+ if (id === null || id === undefined) {
43
+ throw new RequiredError('id','Required parameter id was null or undefined when calling addReplay.');
44
+ }
45
+ const localVarPath = `/reviews/addReplay/{id}`
46
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
47
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
48
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
49
+ let baseOptions;
50
+ if (configuration) {
51
+ baseOptions = configuration.baseOptions;
52
+ }
53
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
54
+ const localVarHeaderParameter = {} as any;
55
+ const localVarQueryParameter = {} as any;
56
+
57
+ // authentication bearer required
58
+ // http bearer authentication required
59
+ if (configuration && configuration.accessToken) {
60
+ const accessToken = typeof configuration.accessToken === 'function'
61
+ ? await configuration.accessToken()
62
+ : await configuration.accessToken;
63
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
64
+ }
65
+
66
+ // authentication x-store-key required
67
+ if (configuration && configuration.apiKey) {
68
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
69
+ ? await configuration.apiKey("x-store-key")
70
+ : await configuration.apiKey;
71
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
72
+ }
73
+
74
+ localVarHeaderParameter['Content-Type'] = 'application/json';
75
+
76
+ const query = new URLSearchParams(localVarUrlObj.search);
77
+ for (const key in localVarQueryParameter) {
78
+ query.set(key, localVarQueryParameter[key]);
79
+ }
80
+ for (const key in options.params) {
81
+ query.set(key, options.params[key]);
82
+ }
83
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
84
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
85
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
86
+ const needsSerialization = (typeof body !== "string") || (localVarRequestOptions.headers ||= {})['Content-Type'] === 'application/json';
87
+ localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
88
+
89
+ return {
90
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
91
+ options: localVarRequestOptions,
92
+ };
93
+ },
94
+ /**
95
+ *
96
+ * @summary Create a review
97
+ * @param {CreateReviewDto} body
98
+ * @param {string} orderId
99
+ * @param {*} [options] Override http request option.
100
+ * @throws {RequiredError}
101
+ */
102
+ createReview: async (body: CreateReviewDto, orderId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
103
+ // verify required parameter 'body' is not null or undefined
104
+ if (body === null || body === undefined) {
105
+ throw new RequiredError('body','Required parameter body was null or undefined when calling createReview.');
106
+ }
107
+ // verify required parameter 'orderId' is not null or undefined
108
+ if (orderId === null || orderId === undefined) {
109
+ throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling createReview.');
110
+ }
111
+ const localVarPath = `/reviews/createReview/{orderId}`
112
+ .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId)));
113
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
114
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
115
+ let baseOptions;
116
+ if (configuration) {
117
+ baseOptions = configuration.baseOptions;
118
+ }
119
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
120
+ const localVarHeaderParameter = {} as any;
121
+ const localVarQueryParameter = {} as any;
122
+
123
+ // authentication bearer required
124
+ // http bearer authentication required
125
+ if (configuration && configuration.accessToken) {
126
+ const accessToken = typeof configuration.accessToken === 'function'
127
+ ? await configuration.accessToken()
128
+ : await configuration.accessToken;
129
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
130
+ }
131
+
132
+ // authentication x-store-key required
133
+ if (configuration && configuration.apiKey) {
134
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
135
+ ? await configuration.apiKey("x-store-key")
136
+ : await configuration.apiKey;
137
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
138
+ }
139
+
140
+ localVarHeaderParameter['Content-Type'] = 'application/json';
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
+ const needsSerialization = (typeof body !== "string") || (localVarRequestOptions.headers ||= {})['Content-Type'] === 'application/json';
153
+ localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
154
+
155
+ return {
156
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
157
+ options: localVarRequestOptions,
158
+ };
159
+ },
160
+ /**
161
+ *
162
+ * @summary Get the total number of reviews
163
+ * @param {*} [options] Override http request option.
164
+ * @throws {RequiredError}
165
+ */
166
+ getReviewCount: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
167
+ const localVarPath = `/reviews/getReviewCount`;
168
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
169
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
170
+ let baseOptions;
171
+ if (configuration) {
172
+ baseOptions = configuration.baseOptions;
173
+ }
174
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
175
+ const localVarHeaderParameter = {} as any;
176
+ const localVarQueryParameter = {} as any;
177
+
178
+ // authentication bearer required
179
+ // http bearer authentication required
180
+ if (configuration && configuration.accessToken) {
181
+ const accessToken = typeof configuration.accessToken === 'function'
182
+ ? await configuration.accessToken()
183
+ : await configuration.accessToken;
184
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
185
+ }
186
+
187
+ // authentication x-store-key required
188
+ if (configuration && configuration.apiKey) {
189
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
190
+ ? await configuration.apiKey("x-store-key")
191
+ : await configuration.apiKey;
192
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
193
+ }
194
+
195
+ const query = new URLSearchParams(localVarUrlObj.search);
196
+ for (const key in localVarQueryParameter) {
197
+ query.set(key, localVarQueryParameter[key]);
198
+ }
199
+ for (const key in options.params) {
200
+ query.set(key, options.params[key]);
201
+ }
202
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
203
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
204
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
205
+
206
+ return {
207
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
208
+ options: localVarRequestOptions,
209
+ };
210
+ },
211
+ /**
212
+ *
213
+ * @summary Get all reviews by date
214
+ * @param {string} date
215
+ * @param {*} [options] Override http request option.
216
+ * @throws {RequiredError}
217
+ */
218
+ getReviewsByDate: async (date: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
219
+ // verify required parameter 'date' is not null or undefined
220
+ if (date === null || date === undefined) {
221
+ throw new RequiredError('date','Required parameter date was null or undefined when calling getReviewsByDate.');
222
+ }
223
+ const localVarPath = `/reviews/reviewsByDate/{date}`
224
+ .replace(`{${"date"}}`, encodeURIComponent(String(date)));
225
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
226
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
227
+ let baseOptions;
228
+ if (configuration) {
229
+ baseOptions = configuration.baseOptions;
230
+ }
231
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
232
+ const localVarHeaderParameter = {} as any;
233
+ const localVarQueryParameter = {} as any;
234
+
235
+ // authentication bearer required
236
+ // http bearer authentication required
237
+ if (configuration && configuration.accessToken) {
238
+ const accessToken = typeof configuration.accessToken === 'function'
239
+ ? await configuration.accessToken()
240
+ : await configuration.accessToken;
241
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
242
+ }
243
+
244
+ // authentication x-store-key required
245
+ if (configuration && configuration.apiKey) {
246
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
247
+ ? await configuration.apiKey("x-store-key")
248
+ : await configuration.apiKey;
249
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
250
+ }
251
+
252
+ const query = new URLSearchParams(localVarUrlObj.search);
253
+ for (const key in localVarQueryParameter) {
254
+ query.set(key, localVarQueryParameter[key]);
255
+ }
256
+ for (const key in options.params) {
257
+ query.set(key, options.params[key]);
258
+ }
259
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
260
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
261
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
262
+
263
+ return {
264
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
265
+ options: localVarRequestOptions,
266
+ };
267
+ },
268
+ /**
269
+ *
270
+ * @summary Get all reviews by date range
271
+ * @param {string} from
272
+ * @param {string} to
273
+ * @param {*} [options] Override http request option.
274
+ * @throws {RequiredError}
275
+ */
276
+ getReviewsByDateRange: async (from: string, to: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
277
+ // verify required parameter 'from' is not null or undefined
278
+ if (from === null || from === undefined) {
279
+ throw new RequiredError('from','Required parameter from was null or undefined when calling getReviewsByDateRange.');
280
+ }
281
+ // verify required parameter 'to' is not null or undefined
282
+ if (to === null || to === undefined) {
283
+ throw new RequiredError('to','Required parameter to was null or undefined when calling getReviewsByDateRange.');
284
+ }
285
+ const localVarPath = `/reviews/reviewsByDateRange/{from}/{to}`
286
+ .replace(`{${"from"}}`, encodeURIComponent(String(from)))
287
+ .replace(`{${"to"}}`, encodeURIComponent(String(to)));
288
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
289
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
290
+ let baseOptions;
291
+ if (configuration) {
292
+ baseOptions = configuration.baseOptions;
293
+ }
294
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
295
+ const localVarHeaderParameter = {} as any;
296
+ const localVarQueryParameter = {} as any;
297
+
298
+ // authentication bearer required
299
+ // http bearer authentication required
300
+ if (configuration && configuration.accessToken) {
301
+ const accessToken = typeof configuration.accessToken === 'function'
302
+ ? await configuration.accessToken()
303
+ : await configuration.accessToken;
304
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
305
+ }
306
+
307
+ // authentication x-store-key required
308
+ if (configuration && configuration.apiKey) {
309
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
310
+ ? await configuration.apiKey("x-store-key")
311
+ : await configuration.apiKey;
312
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
313
+ }
314
+
315
+ const query = new URLSearchParams(localVarUrlObj.search);
316
+ for (const key in localVarQueryParameter) {
317
+ query.set(key, localVarQueryParameter[key]);
318
+ }
319
+ for (const key in options.params) {
320
+ query.set(key, options.params[key]);
321
+ }
322
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
323
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
324
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
325
+
326
+ return {
327
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
328
+ options: localVarRequestOptions,
329
+ };
330
+ },
331
+ /**
332
+ *
333
+ * @summary Get all reviews for a product
334
+ * @param {string} productId
335
+ * @param {*} [options] Override http request option.
336
+ * @throws {RequiredError}
337
+ */
338
+ getReviewsByProduct: async (productId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
339
+ // verify required parameter 'productId' is not null or undefined
340
+ if (productId === null || productId === undefined) {
341
+ throw new RequiredError('productId','Required parameter productId was null or undefined when calling getReviewsByProduct.');
342
+ }
343
+ const localVarPath = `/reviews/reviewsByProduct/{productId}`
344
+ .replace(`{${"productId"}}`, encodeURIComponent(String(productId)));
345
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
346
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
347
+ let baseOptions;
348
+ if (configuration) {
349
+ baseOptions = configuration.baseOptions;
350
+ }
351
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
352
+ const localVarHeaderParameter = {} as any;
353
+ const localVarQueryParameter = {} as any;
354
+
355
+ // authentication bearer required
356
+ // http bearer authentication required
357
+ if (configuration && configuration.accessToken) {
358
+ const accessToken = typeof configuration.accessToken === 'function'
359
+ ? await configuration.accessToken()
360
+ : await configuration.accessToken;
361
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
362
+ }
363
+
364
+ // authentication x-store-key required
365
+ if (configuration && configuration.apiKey) {
366
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
367
+ ? await configuration.apiKey("x-store-key")
368
+ : await configuration.apiKey;
369
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
370
+ }
371
+
372
+ const query = new URLSearchParams(localVarUrlObj.search);
373
+ for (const key in localVarQueryParameter) {
374
+ query.set(key, localVarQueryParameter[key]);
375
+ }
376
+ for (const key in options.params) {
377
+ query.set(key, options.params[key]);
378
+ }
379
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
380
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
381
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
382
+
383
+ return {
384
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
385
+ options: localVarRequestOptions,
386
+ };
387
+ },
388
+ /**
389
+ *
390
+ * @summary Get all reviews by rating
391
+ * @param {number} rating
392
+ * @param {*} [options] Override http request option.
393
+ * @throws {RequiredError}
394
+ */
395
+ getReviewsByRating: async (rating: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
396
+ // verify required parameter 'rating' is not null or undefined
397
+ if (rating === null || rating === undefined) {
398
+ throw new RequiredError('rating','Required parameter rating was null or undefined when calling getReviewsByRating.');
399
+ }
400
+ const localVarPath = `/reviews/reviewsByRating/{rating}`
401
+ .replace(`{${"rating"}}`, encodeURIComponent(String(rating)));
402
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
403
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
404
+ let baseOptions;
405
+ if (configuration) {
406
+ baseOptions = configuration.baseOptions;
407
+ }
408
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
409
+ const localVarHeaderParameter = {} as any;
410
+ const localVarQueryParameter = {} as any;
411
+
412
+ // authentication bearer required
413
+ // http bearer authentication required
414
+ if (configuration && configuration.accessToken) {
415
+ const accessToken = typeof configuration.accessToken === 'function'
416
+ ? await configuration.accessToken()
417
+ : await configuration.accessToken;
418
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
419
+ }
420
+
421
+ // authentication x-store-key required
422
+ if (configuration && configuration.apiKey) {
423
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
424
+ ? await configuration.apiKey("x-store-key")
425
+ : await configuration.apiKey;
426
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
427
+ }
428
+
429
+ const query = new URLSearchParams(localVarUrlObj.search);
430
+ for (const key in localVarQueryParameter) {
431
+ query.set(key, localVarQueryParameter[key]);
432
+ }
433
+ for (const key in options.params) {
434
+ query.set(key, options.params[key]);
435
+ }
436
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
437
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
438
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
439
+
440
+ return {
441
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
442
+ options: localVarRequestOptions,
443
+ };
444
+ },
445
+ /**
446
+ *
447
+ * @summary Get all reviews for a store
448
+ * @param {*} [options] Override http request option.
449
+ * @throws {RequiredError}
450
+ */
451
+ getReviewsByStore: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
452
+ const localVarPath = `/reviews/store-reviews`;
453
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
454
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
455
+ let baseOptions;
456
+ if (configuration) {
457
+ baseOptions = configuration.baseOptions;
458
+ }
459
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
460
+ const localVarHeaderParameter = {} as any;
461
+ const localVarQueryParameter = {} as any;
462
+
463
+ // authentication bearer required
464
+ // http bearer authentication required
465
+ if (configuration && configuration.accessToken) {
466
+ const accessToken = typeof configuration.accessToken === 'function'
467
+ ? await configuration.accessToken()
468
+ : await configuration.accessToken;
469
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
470
+ }
471
+
472
+ // authentication x-store-key required
473
+ if (configuration && configuration.apiKey) {
474
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
475
+ ? await configuration.apiKey("x-store-key")
476
+ : await configuration.apiKey;
477
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
478
+ }
479
+
480
+ const query = new URLSearchParams(localVarUrlObj.search);
481
+ for (const key in localVarQueryParameter) {
482
+ query.set(key, localVarQueryParameter[key]);
483
+ }
484
+ for (const key in options.params) {
485
+ query.set(key, options.params[key]);
486
+ }
487
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
488
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
489
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
490
+
491
+ return {
492
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
493
+ options: localVarRequestOptions,
494
+ };
495
+ },
496
+ /**
497
+ *
498
+ * @summary Get all reviews by type
499
+ * @param {string} type
500
+ * @param {*} [options] Override http request option.
501
+ * @throws {RequiredError}
502
+ */
503
+ getReviewsByType: async (type: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
504
+ // verify required parameter 'type' is not null or undefined
505
+ if (type === null || type === undefined) {
506
+ throw new RequiredError('type','Required parameter type was null or undefined when calling getReviewsByType.');
507
+ }
508
+ const localVarPath = `/reviews/reviewsByType/{type}`
509
+ .replace(`{${"type"}}`, encodeURIComponent(String(type)));
510
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
511
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
512
+ let baseOptions;
513
+ if (configuration) {
514
+ baseOptions = configuration.baseOptions;
515
+ }
516
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
517
+ const localVarHeaderParameter = {} as any;
518
+ const localVarQueryParameter = {} as any;
519
+
520
+ // authentication bearer required
521
+ // http bearer authentication required
522
+ if (configuration && configuration.accessToken) {
523
+ const accessToken = typeof configuration.accessToken === 'function'
524
+ ? await configuration.accessToken()
525
+ : await configuration.accessToken;
526
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
527
+ }
528
+
529
+ // authentication x-store-key required
530
+ if (configuration && configuration.apiKey) {
531
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
532
+ ? await configuration.apiKey("x-store-key")
533
+ : await configuration.apiKey;
534
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
535
+ }
536
+
537
+ const query = new URLSearchParams(localVarUrlObj.search);
538
+ for (const key in localVarQueryParameter) {
539
+ query.set(key, localVarQueryParameter[key]);
540
+ }
541
+ for (const key in options.params) {
542
+ query.set(key, options.params[key]);
543
+ }
544
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
545
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
546
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
547
+
548
+ return {
549
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
550
+ options: localVarRequestOptions,
551
+ };
552
+ },
553
+ /**
554
+ *
555
+ * @summary Get all reviews by a user
556
+ * @param {string} userId
557
+ * @param {*} [options] Override http request option.
558
+ * @throws {RequiredError}
559
+ */
560
+ getReviewsByUser: async (userId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
561
+ // verify required parameter 'userId' is not null or undefined
562
+ if (userId === null || userId === undefined) {
563
+ throw new RequiredError('userId','Required parameter userId was null or undefined when calling getReviewsByUser.');
564
+ }
565
+ const localVarPath = `/reviews/reviewsByUser/{userId}`
566
+ .replace(`{${"userId"}}`, encodeURIComponent(String(userId)));
567
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
568
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
569
+ let baseOptions;
570
+ if (configuration) {
571
+ baseOptions = configuration.baseOptions;
572
+ }
573
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
574
+ const localVarHeaderParameter = {} as any;
575
+ const localVarQueryParameter = {} as any;
576
+
577
+ // authentication bearer required
578
+ // http bearer authentication required
579
+ if (configuration && configuration.accessToken) {
580
+ const accessToken = typeof configuration.accessToken === 'function'
581
+ ? await configuration.accessToken()
582
+ : await configuration.accessToken;
583
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
584
+ }
585
+
586
+ // authentication x-store-key required
587
+ if (configuration && configuration.apiKey) {
588
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
589
+ ? await configuration.apiKey("x-store-key")
590
+ : await configuration.apiKey;
591
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
592
+ }
593
+
594
+ const query = new URLSearchParams(localVarUrlObj.search);
595
+ for (const key in localVarQueryParameter) {
596
+ query.set(key, localVarQueryParameter[key]);
597
+ }
598
+ for (const key in options.params) {
599
+ query.set(key, options.params[key]);
600
+ }
601
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
602
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
603
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
604
+
605
+ return {
606
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
607
+ options: localVarRequestOptions,
608
+ };
609
+ },
610
+ /**
611
+ *
612
+ * @summary Remove a reply from a review
613
+ * @param {string} id
614
+ * @param {*} [options] Override http request option.
615
+ * @throws {RequiredError}
616
+ */
617
+ removeReplay: async (id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
618
+ // verify required parameter 'id' is not null or undefined
619
+ if (id === null || id === undefined) {
620
+ throw new RequiredError('id','Required parameter id was null or undefined when calling removeReplay.');
621
+ }
622
+ const localVarPath = `/reviews/removeReplay/{id}`
623
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
624
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
625
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
626
+ let baseOptions;
627
+ if (configuration) {
628
+ baseOptions = configuration.baseOptions;
629
+ }
630
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'DELETE', ...baseOptions, ...options};
631
+ const localVarHeaderParameter = {} as any;
632
+ const localVarQueryParameter = {} as any;
633
+
634
+ // authentication bearer required
635
+ // http bearer authentication required
636
+ if (configuration && configuration.accessToken) {
637
+ const accessToken = typeof configuration.accessToken === 'function'
638
+ ? await configuration.accessToken()
639
+ : await configuration.accessToken;
640
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
641
+ }
642
+
643
+ // authentication x-store-key required
644
+ if (configuration && configuration.apiKey) {
645
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
646
+ ? await configuration.apiKey("x-store-key")
647
+ : await configuration.apiKey;
648
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
649
+ }
650
+
651
+ const query = new URLSearchParams(localVarUrlObj.search);
652
+ for (const key in localVarQueryParameter) {
653
+ query.set(key, localVarQueryParameter[key]);
654
+ }
655
+ for (const key in options.params) {
656
+ query.set(key, options.params[key]);
657
+ }
658
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
659
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
660
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
661
+
662
+ return {
663
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
664
+ options: localVarRequestOptions,
665
+ };
666
+ },
667
+ /**
668
+ *
669
+ * @summary Remove a review
670
+ * @param {string} id
671
+ * @param {*} [options] Override http request option.
672
+ * @throws {RequiredError}
673
+ */
674
+ removeReview: async (id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
675
+ // verify required parameter 'id' is not null or undefined
676
+ if (id === null || id === undefined) {
677
+ throw new RequiredError('id','Required parameter id was null or undefined when calling removeReview.');
678
+ }
679
+ const localVarPath = `/reviews/remove/{id}`
680
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
681
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
682
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
683
+ let baseOptions;
684
+ if (configuration) {
685
+ baseOptions = configuration.baseOptions;
686
+ }
687
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'DELETE', ...baseOptions, ...options};
688
+ const localVarHeaderParameter = {} as any;
689
+ const localVarQueryParameter = {} as any;
690
+
691
+ // authentication bearer required
692
+ // http bearer authentication required
693
+ if (configuration && configuration.accessToken) {
694
+ const accessToken = typeof configuration.accessToken === 'function'
695
+ ? await configuration.accessToken()
696
+ : await configuration.accessToken;
697
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
698
+ }
699
+
700
+ // authentication x-store-key required
701
+ if (configuration && configuration.apiKey) {
702
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
703
+ ? await configuration.apiKey("x-store-key")
704
+ : await configuration.apiKey;
705
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
706
+ }
707
+
708
+ const query = new URLSearchParams(localVarUrlObj.search);
709
+ for (const key in localVarQueryParameter) {
710
+ query.set(key, localVarQueryParameter[key]);
711
+ }
712
+ for (const key in options.params) {
713
+ query.set(key, options.params[key]);
714
+ }
715
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
716
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
717
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
718
+
719
+ return {
720
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
721
+ options: localVarRequestOptions,
722
+ };
723
+ },
724
+ /**
725
+ *
726
+ * @summary Update a reply to a review
727
+ * @param {UpdateReviewDto} body
728
+ * @param {string} id
729
+ * @param {*} [options] Override http request option.
730
+ * @throws {RequiredError}
731
+ */
732
+ updateReplay: async (body: UpdateReviewDto, id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
733
+ // verify required parameter 'body' is not null or undefined
734
+ if (body === null || body === undefined) {
735
+ throw new RequiredError('body','Required parameter body was null or undefined when calling updateReplay.');
736
+ }
737
+ // verify required parameter 'id' is not null or undefined
738
+ if (id === null || id === undefined) {
739
+ throw new RequiredError('id','Required parameter id was null or undefined when calling updateReplay.');
740
+ }
741
+ const localVarPath = `/reviews/updateReplay/{id}`
742
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
743
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
744
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
745
+ let baseOptions;
746
+ if (configuration) {
747
+ baseOptions = configuration.baseOptions;
748
+ }
749
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'PATCH', ...baseOptions, ...options};
750
+ const localVarHeaderParameter = {} as any;
751
+ const localVarQueryParameter = {} as any;
752
+
753
+ // authentication bearer required
754
+ // http bearer authentication required
755
+ if (configuration && configuration.accessToken) {
756
+ const accessToken = typeof configuration.accessToken === 'function'
757
+ ? await configuration.accessToken()
758
+ : await configuration.accessToken;
759
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
760
+ }
761
+
762
+ // authentication x-store-key required
763
+ if (configuration && configuration.apiKey) {
764
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
765
+ ? await configuration.apiKey("x-store-key")
766
+ : await configuration.apiKey;
767
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
768
+ }
769
+
770
+ localVarHeaderParameter['Content-Type'] = 'application/json';
771
+
772
+ const query = new URLSearchParams(localVarUrlObj.search);
773
+ for (const key in localVarQueryParameter) {
774
+ query.set(key, localVarQueryParameter[key]);
775
+ }
776
+ for (const key in options.params) {
777
+ query.set(key, options.params[key]);
778
+ }
779
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
780
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
781
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
782
+ const needsSerialization = (typeof body !== "string") || (localVarRequestOptions.headers ||= {})['Content-Type'] === 'application/json';
783
+ localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
784
+
785
+ return {
786
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
787
+ options: localVarRequestOptions,
788
+ };
789
+ },
790
+ /**
791
+ *
792
+ * @summary Update a review
793
+ * @param {UpdateReviewDto} body
794
+ * @param {string} id
795
+ * @param {*} [options] Override http request option.
796
+ * @throws {RequiredError}
797
+ */
798
+ updateReview: async (body: UpdateReviewDto, id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
799
+ // verify required parameter 'body' is not null or undefined
800
+ if (body === null || body === undefined) {
801
+ throw new RequiredError('body','Required parameter body was null or undefined when calling updateReview.');
802
+ }
803
+ // verify required parameter 'id' is not null or undefined
804
+ if (id === null || id === undefined) {
805
+ throw new RequiredError('id','Required parameter id was null or undefined when calling updateReview.');
806
+ }
807
+ const localVarPath = `/reviews/update/{id}`
808
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
809
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
810
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
811
+ let baseOptions;
812
+ if (configuration) {
813
+ baseOptions = configuration.baseOptions;
814
+ }
815
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'PATCH', ...baseOptions, ...options};
816
+ const localVarHeaderParameter = {} as any;
817
+ const localVarQueryParameter = {} as any;
818
+
819
+ // authentication bearer required
820
+ // http bearer authentication required
821
+ if (configuration && configuration.accessToken) {
822
+ const accessToken = typeof configuration.accessToken === 'function'
823
+ ? await configuration.accessToken()
824
+ : await configuration.accessToken;
825
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
826
+ }
827
+
828
+ // authentication x-store-key required
829
+ if (configuration && configuration.apiKey) {
830
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
831
+ ? await configuration.apiKey("x-store-key")
832
+ : await configuration.apiKey;
833
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
834
+ }
835
+
836
+ localVarHeaderParameter['Content-Type'] = 'application/json';
837
+
838
+ const query = new URLSearchParams(localVarUrlObj.search);
839
+ for (const key in localVarQueryParameter) {
840
+ query.set(key, localVarQueryParameter[key]);
841
+ }
842
+ for (const key in options.params) {
843
+ query.set(key, options.params[key]);
844
+ }
845
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
846
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
847
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
848
+ const needsSerialization = (typeof body !== "string") || (localVarRequestOptions.headers ||= {})['Content-Type'] === 'application/json';
849
+ localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
850
+
851
+ return {
852
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
853
+ options: localVarRequestOptions,
854
+ };
855
+ },
856
+ }
857
+ };
858
+
859
+ /**
860
+ * ReviewApi - functional programming interface
861
+ * @export
862
+ */
863
+ export const ReviewApiFp = function(configuration?: Configuration) {
864
+ return {
865
+ /**
866
+ *
867
+ * @summary Add a reply to a review
868
+ * @param {UpdateReviewDto} body
869
+ * @param {string} id
870
+ * @param {*} [options] Override http request option.
871
+ * @throws {RequiredError}
872
+ */
873
+ async addReplay(body: UpdateReviewDto, id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Review>>> {
874
+ const localVarAxiosArgs = await ReviewApiAxiosParamCreator(configuration).addReplay(body, id, options);
875
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
876
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
877
+ return axios.request(axiosRequestArgs);
878
+ };
879
+ },
880
+ /**
881
+ *
882
+ * @summary Create a review
883
+ * @param {CreateReviewDto} body
884
+ * @param {string} orderId
885
+ * @param {*} [options] Override http request option.
886
+ * @throws {RequiredError}
887
+ */
888
+ async createReview(body: CreateReviewDto, orderId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Review>>> {
889
+ const localVarAxiosArgs = await ReviewApiAxiosParamCreator(configuration).createReview(body, orderId, 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 Get the total number of reviews
898
+ * @param {*} [options] Override http request option.
899
+ * @throws {RequiredError}
900
+ */
901
+ async getReviewCount(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<number>>> {
902
+ const localVarAxiosArgs = await ReviewApiAxiosParamCreator(configuration).getReviewCount(options);
903
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
904
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
905
+ return axios.request(axiosRequestArgs);
906
+ };
907
+ },
908
+ /**
909
+ *
910
+ * @summary Get all reviews by date
911
+ * @param {string} date
912
+ * @param {*} [options] Override http request option.
913
+ * @throws {RequiredError}
914
+ */
915
+ async getReviewsByDate(date: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Array<Review>>>> {
916
+ const localVarAxiosArgs = await ReviewApiAxiosParamCreator(configuration).getReviewsByDate(date, options);
917
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
918
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
919
+ return axios.request(axiosRequestArgs);
920
+ };
921
+ },
922
+ /**
923
+ *
924
+ * @summary Get all reviews by date range
925
+ * @param {string} from
926
+ * @param {string} to
927
+ * @param {*} [options] Override http request option.
928
+ * @throws {RequiredError}
929
+ */
930
+ async getReviewsByDateRange(from: string, to: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Array<Review>>>> {
931
+ const localVarAxiosArgs = await ReviewApiAxiosParamCreator(configuration).getReviewsByDateRange(from, to, options);
932
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
933
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
934
+ return axios.request(axiosRequestArgs);
935
+ };
936
+ },
937
+ /**
938
+ *
939
+ * @summary Get all reviews for a product
940
+ * @param {string} productId
941
+ * @param {*} [options] Override http request option.
942
+ * @throws {RequiredError}
943
+ */
944
+ async getReviewsByProduct(productId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Array<Review>>>> {
945
+ const localVarAxiosArgs = await ReviewApiAxiosParamCreator(configuration).getReviewsByProduct(productId, options);
946
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
947
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
948
+ return axios.request(axiosRequestArgs);
949
+ };
950
+ },
951
+ /**
952
+ *
953
+ * @summary Get all reviews by rating
954
+ * @param {number} rating
955
+ * @param {*} [options] Override http request option.
956
+ * @throws {RequiredError}
957
+ */
958
+ async getReviewsByRating(rating: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Array<Review>>>> {
959
+ const localVarAxiosArgs = await ReviewApiAxiosParamCreator(configuration).getReviewsByRating(rating, options);
960
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
961
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
962
+ return axios.request(axiosRequestArgs);
963
+ };
964
+ },
965
+ /**
966
+ *
967
+ * @summary Get all reviews for a store
968
+ * @param {*} [options] Override http request option.
969
+ * @throws {RequiredError}
970
+ */
971
+ async getReviewsByStore(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Array<Review>>>> {
972
+ const localVarAxiosArgs = await ReviewApiAxiosParamCreator(configuration).getReviewsByStore(options);
973
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
974
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
975
+ return axios.request(axiosRequestArgs);
976
+ };
977
+ },
978
+ /**
979
+ *
980
+ * @summary Get all reviews by type
981
+ * @param {string} type
982
+ * @param {*} [options] Override http request option.
983
+ * @throws {RequiredError}
984
+ */
985
+ async getReviewsByType(type: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Array<Review>>>> {
986
+ const localVarAxiosArgs = await ReviewApiAxiosParamCreator(configuration).getReviewsByType(type, options);
987
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
988
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
989
+ return axios.request(axiosRequestArgs);
990
+ };
991
+ },
992
+ /**
993
+ *
994
+ * @summary Get all reviews by a user
995
+ * @param {string} userId
996
+ * @param {*} [options] Override http request option.
997
+ * @throws {RequiredError}
998
+ */
999
+ async getReviewsByUser(userId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Array<Review>>>> {
1000
+ const localVarAxiosArgs = await ReviewApiAxiosParamCreator(configuration).getReviewsByUser(userId, options);
1001
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1002
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1003
+ return axios.request(axiosRequestArgs);
1004
+ };
1005
+ },
1006
+ /**
1007
+ *
1008
+ * @summary Remove a reply from a review
1009
+ * @param {string} id
1010
+ * @param {*} [options] Override http request option.
1011
+ * @throws {RequiredError}
1012
+ */
1013
+ async removeReplay(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
1014
+ const localVarAxiosArgs = await ReviewApiAxiosParamCreator(configuration).removeReplay(id, options);
1015
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1016
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1017
+ return axios.request(axiosRequestArgs);
1018
+ };
1019
+ },
1020
+ /**
1021
+ *
1022
+ * @summary Remove a review
1023
+ * @param {string} id
1024
+ * @param {*} [options] Override http request option.
1025
+ * @throws {RequiredError}
1026
+ */
1027
+ async removeReview(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
1028
+ const localVarAxiosArgs = await ReviewApiAxiosParamCreator(configuration).removeReview(id, 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
+ * @summary Update a reply to a review
1037
+ * @param {UpdateReviewDto} body
1038
+ * @param {string} id
1039
+ * @param {*} [options] Override http request option.
1040
+ * @throws {RequiredError}
1041
+ */
1042
+ async updateReplay(body: UpdateReviewDto, id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Review>>> {
1043
+ const localVarAxiosArgs = await ReviewApiAxiosParamCreator(configuration).updateReplay(body, id, options);
1044
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1045
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1046
+ return axios.request(axiosRequestArgs);
1047
+ };
1048
+ },
1049
+ /**
1050
+ *
1051
+ * @summary Update a review
1052
+ * @param {UpdateReviewDto} body
1053
+ * @param {string} id
1054
+ * @param {*} [options] Override http request option.
1055
+ * @throws {RequiredError}
1056
+ */
1057
+ async updateReview(body: UpdateReviewDto, id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Review>>> {
1058
+ const localVarAxiosArgs = await ReviewApiAxiosParamCreator(configuration).updateReview(body, id, options);
1059
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1060
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1061
+ return axios.request(axiosRequestArgs);
1062
+ };
1063
+ },
1064
+ }
1065
+ };
1066
+
1067
+ /**
1068
+ * ReviewApi - factory interface
1069
+ * @export
1070
+ */
1071
+ export const ReviewApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
1072
+ return {
1073
+ /**
1074
+ *
1075
+ * @summary Add a reply to a review
1076
+ * @param {UpdateReviewDto} body
1077
+ * @param {string} id
1078
+ * @param {*} [options] Override http request option.
1079
+ * @throws {RequiredError}
1080
+ */
1081
+ async addReplay(body: UpdateReviewDto, id: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Review>> {
1082
+ return ReviewApiFp(configuration).addReplay(body, id, options).then((request) => request(axios, basePath));
1083
+ },
1084
+ /**
1085
+ *
1086
+ * @summary Create a review
1087
+ * @param {CreateReviewDto} body
1088
+ * @param {string} orderId
1089
+ * @param {*} [options] Override http request option.
1090
+ * @throws {RequiredError}
1091
+ */
1092
+ async createReview(body: CreateReviewDto, orderId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Review>> {
1093
+ return ReviewApiFp(configuration).createReview(body, orderId, options).then((request) => request(axios, basePath));
1094
+ },
1095
+ /**
1096
+ *
1097
+ * @summary Get the total number of reviews
1098
+ * @param {*} [options] Override http request option.
1099
+ * @throws {RequiredError}
1100
+ */
1101
+ async getReviewCount(options?: AxiosRequestConfig): Promise<AxiosResponse<number>> {
1102
+ return ReviewApiFp(configuration).getReviewCount(options).then((request) => request(axios, basePath));
1103
+ },
1104
+ /**
1105
+ *
1106
+ * @summary Get all reviews by date
1107
+ * @param {string} date
1108
+ * @param {*} [options] Override http request option.
1109
+ * @throws {RequiredError}
1110
+ */
1111
+ async getReviewsByDate(date: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Array<Review>>> {
1112
+ return ReviewApiFp(configuration).getReviewsByDate(date, options).then((request) => request(axios, basePath));
1113
+ },
1114
+ /**
1115
+ *
1116
+ * @summary Get all reviews by date range
1117
+ * @param {string} from
1118
+ * @param {string} to
1119
+ * @param {*} [options] Override http request option.
1120
+ * @throws {RequiredError}
1121
+ */
1122
+ async getReviewsByDateRange(from: string, to: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Array<Review>>> {
1123
+ return ReviewApiFp(configuration).getReviewsByDateRange(from, to, options).then((request) => request(axios, basePath));
1124
+ },
1125
+ /**
1126
+ *
1127
+ * @summary Get all reviews for a product
1128
+ * @param {string} productId
1129
+ * @param {*} [options] Override http request option.
1130
+ * @throws {RequiredError}
1131
+ */
1132
+ async getReviewsByProduct(productId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Array<Review>>> {
1133
+ return ReviewApiFp(configuration).getReviewsByProduct(productId, options).then((request) => request(axios, basePath));
1134
+ },
1135
+ /**
1136
+ *
1137
+ * @summary Get all reviews by rating
1138
+ * @param {number} rating
1139
+ * @param {*} [options] Override http request option.
1140
+ * @throws {RequiredError}
1141
+ */
1142
+ async getReviewsByRating(rating: number, options?: AxiosRequestConfig): Promise<AxiosResponse<Array<Review>>> {
1143
+ return ReviewApiFp(configuration).getReviewsByRating(rating, options).then((request) => request(axios, basePath));
1144
+ },
1145
+ /**
1146
+ *
1147
+ * @summary Get all reviews for a store
1148
+ * @param {*} [options] Override http request option.
1149
+ * @throws {RequiredError}
1150
+ */
1151
+ async getReviewsByStore(options?: AxiosRequestConfig): Promise<AxiosResponse<Array<Review>>> {
1152
+ return ReviewApiFp(configuration).getReviewsByStore(options).then((request) => request(axios, basePath));
1153
+ },
1154
+ /**
1155
+ *
1156
+ * @summary Get all reviews by type
1157
+ * @param {string} type
1158
+ * @param {*} [options] Override http request option.
1159
+ * @throws {RequiredError}
1160
+ */
1161
+ async getReviewsByType(type: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Array<Review>>> {
1162
+ return ReviewApiFp(configuration).getReviewsByType(type, options).then((request) => request(axios, basePath));
1163
+ },
1164
+ /**
1165
+ *
1166
+ * @summary Get all reviews by a user
1167
+ * @param {string} userId
1168
+ * @param {*} [options] Override http request option.
1169
+ * @throws {RequiredError}
1170
+ */
1171
+ async getReviewsByUser(userId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Array<Review>>> {
1172
+ return ReviewApiFp(configuration).getReviewsByUser(userId, options).then((request) => request(axios, basePath));
1173
+ },
1174
+ /**
1175
+ *
1176
+ * @summary Remove a reply from a review
1177
+ * @param {string} id
1178
+ * @param {*} [options] Override http request option.
1179
+ * @throws {RequiredError}
1180
+ */
1181
+ async removeReplay(id: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
1182
+ return ReviewApiFp(configuration).removeReplay(id, options).then((request) => request(axios, basePath));
1183
+ },
1184
+ /**
1185
+ *
1186
+ * @summary Remove a review
1187
+ * @param {string} id
1188
+ * @param {*} [options] Override http request option.
1189
+ * @throws {RequiredError}
1190
+ */
1191
+ async removeReview(id: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
1192
+ return ReviewApiFp(configuration).removeReview(id, options).then((request) => request(axios, basePath));
1193
+ },
1194
+ /**
1195
+ *
1196
+ * @summary Update a reply to a review
1197
+ * @param {UpdateReviewDto} body
1198
+ * @param {string} id
1199
+ * @param {*} [options] Override http request option.
1200
+ * @throws {RequiredError}
1201
+ */
1202
+ async updateReplay(body: UpdateReviewDto, id: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Review>> {
1203
+ return ReviewApiFp(configuration).updateReplay(body, id, options).then((request) => request(axios, basePath));
1204
+ },
1205
+ /**
1206
+ *
1207
+ * @summary Update a review
1208
+ * @param {UpdateReviewDto} body
1209
+ * @param {string} id
1210
+ * @param {*} [options] Override http request option.
1211
+ * @throws {RequiredError}
1212
+ */
1213
+ async updateReview(body: UpdateReviewDto, id: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Review>> {
1214
+ return ReviewApiFp(configuration).updateReview(body, id, options).then((request) => request(axios, basePath));
1215
+ },
1216
+ };
1217
+ };
1218
+
1219
+ /**
1220
+ * ReviewApi - object-oriented interface
1221
+ * @export
1222
+ * @class ReviewApi
1223
+ * @extends {BaseAPI}
1224
+ */
1225
+ export class ReviewApi extends BaseAPI {
1226
+ /**
1227
+ *
1228
+ * @summary Add a reply to a review
1229
+ * @param {UpdateReviewDto} body
1230
+ * @param {string} id
1231
+ * @param {*} [options] Override http request option.
1232
+ * @throws {RequiredError}
1233
+ * @memberof ReviewApi
1234
+ */
1235
+ public async addReplay(body: UpdateReviewDto, id: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Review>> {
1236
+ return ReviewApiFp(this.configuration).addReplay(body, id, options).then((request) => request(this.axios, this.basePath));
1237
+ }
1238
+ /**
1239
+ *
1240
+ * @summary Create a review
1241
+ * @param {CreateReviewDto} body
1242
+ * @param {string} orderId
1243
+ * @param {*} [options] Override http request option.
1244
+ * @throws {RequiredError}
1245
+ * @memberof ReviewApi
1246
+ */
1247
+ public async createReview(body: CreateReviewDto, orderId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Review>> {
1248
+ return ReviewApiFp(this.configuration).createReview(body, orderId, options).then((request) => request(this.axios, this.basePath));
1249
+ }
1250
+ /**
1251
+ *
1252
+ * @summary Get the total number of reviews
1253
+ * @param {*} [options] Override http request option.
1254
+ * @throws {RequiredError}
1255
+ * @memberof ReviewApi
1256
+ */
1257
+ public async getReviewCount(options?: AxiosRequestConfig) : Promise<AxiosResponse<number>> {
1258
+ return ReviewApiFp(this.configuration).getReviewCount(options).then((request) => request(this.axios, this.basePath));
1259
+ }
1260
+ /**
1261
+ *
1262
+ * @summary Get all reviews by date
1263
+ * @param {string} date
1264
+ * @param {*} [options] Override http request option.
1265
+ * @throws {RequiredError}
1266
+ * @memberof ReviewApi
1267
+ */
1268
+ public async getReviewsByDate(date: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<Review>>> {
1269
+ return ReviewApiFp(this.configuration).getReviewsByDate(date, options).then((request) => request(this.axios, this.basePath));
1270
+ }
1271
+ /**
1272
+ *
1273
+ * @summary Get all reviews by date range
1274
+ * @param {string} from
1275
+ * @param {string} to
1276
+ * @param {*} [options] Override http request option.
1277
+ * @throws {RequiredError}
1278
+ * @memberof ReviewApi
1279
+ */
1280
+ public async getReviewsByDateRange(from: string, to: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<Review>>> {
1281
+ return ReviewApiFp(this.configuration).getReviewsByDateRange(from, to, options).then((request) => request(this.axios, this.basePath));
1282
+ }
1283
+ /**
1284
+ *
1285
+ * @summary Get all reviews for a product
1286
+ * @param {string} productId
1287
+ * @param {*} [options] Override http request option.
1288
+ * @throws {RequiredError}
1289
+ * @memberof ReviewApi
1290
+ */
1291
+ public async getReviewsByProduct(productId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<Review>>> {
1292
+ return ReviewApiFp(this.configuration).getReviewsByProduct(productId, options).then((request) => request(this.axios, this.basePath));
1293
+ }
1294
+ /**
1295
+ *
1296
+ * @summary Get all reviews by rating
1297
+ * @param {number} rating
1298
+ * @param {*} [options] Override http request option.
1299
+ * @throws {RequiredError}
1300
+ * @memberof ReviewApi
1301
+ */
1302
+ public async getReviewsByRating(rating: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<Review>>> {
1303
+ return ReviewApiFp(this.configuration).getReviewsByRating(rating, options).then((request) => request(this.axios, this.basePath));
1304
+ }
1305
+ /**
1306
+ *
1307
+ * @summary Get all reviews for a store
1308
+ * @param {*} [options] Override http request option.
1309
+ * @throws {RequiredError}
1310
+ * @memberof ReviewApi
1311
+ */
1312
+ public async getReviewsByStore(options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<Review>>> {
1313
+ return ReviewApiFp(this.configuration).getReviewsByStore(options).then((request) => request(this.axios, this.basePath));
1314
+ }
1315
+ /**
1316
+ *
1317
+ * @summary Get all reviews by type
1318
+ * @param {string} type
1319
+ * @param {*} [options] Override http request option.
1320
+ * @throws {RequiredError}
1321
+ * @memberof ReviewApi
1322
+ */
1323
+ public async getReviewsByType(type: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<Review>>> {
1324
+ return ReviewApiFp(this.configuration).getReviewsByType(type, options).then((request) => request(this.axios, this.basePath));
1325
+ }
1326
+ /**
1327
+ *
1328
+ * @summary Get all reviews by a user
1329
+ * @param {string} userId
1330
+ * @param {*} [options] Override http request option.
1331
+ * @throws {RequiredError}
1332
+ * @memberof ReviewApi
1333
+ */
1334
+ public async getReviewsByUser(userId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<Review>>> {
1335
+ return ReviewApiFp(this.configuration).getReviewsByUser(userId, options).then((request) => request(this.axios, this.basePath));
1336
+ }
1337
+ /**
1338
+ *
1339
+ * @summary Remove a reply from a review
1340
+ * @param {string} id
1341
+ * @param {*} [options] Override http request option.
1342
+ * @throws {RequiredError}
1343
+ * @memberof ReviewApi
1344
+ */
1345
+ public async removeReplay(id: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
1346
+ return ReviewApiFp(this.configuration).removeReplay(id, options).then((request) => request(this.axios, this.basePath));
1347
+ }
1348
+ /**
1349
+ *
1350
+ * @summary Remove a review
1351
+ * @param {string} id
1352
+ * @param {*} [options] Override http request option.
1353
+ * @throws {RequiredError}
1354
+ * @memberof ReviewApi
1355
+ */
1356
+ public async removeReview(id: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
1357
+ return ReviewApiFp(this.configuration).removeReview(id, options).then((request) => request(this.axios, this.basePath));
1358
+ }
1359
+ /**
1360
+ *
1361
+ * @summary Update a reply to a review
1362
+ * @param {UpdateReviewDto} body
1363
+ * @param {string} id
1364
+ * @param {*} [options] Override http request option.
1365
+ * @throws {RequiredError}
1366
+ * @memberof ReviewApi
1367
+ */
1368
+ public async updateReplay(body: UpdateReviewDto, id: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Review>> {
1369
+ return ReviewApiFp(this.configuration).updateReplay(body, id, options).then((request) => request(this.axios, this.basePath));
1370
+ }
1371
+ /**
1372
+ *
1373
+ * @summary Update a review
1374
+ * @param {UpdateReviewDto} body
1375
+ * @param {string} id
1376
+ * @param {*} [options] Override http request option.
1377
+ * @throws {RequiredError}
1378
+ * @memberof ReviewApi
1379
+ */
1380
+ public async updateReview(body: UpdateReviewDto, id: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Review>> {
1381
+ return ReviewApiFp(this.configuration).updateReview(body, id, options).then((request) => request(this.axios, this.basePath));
1382
+ }
1383
+ }