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