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