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