@serik_lav/api-fe 0.47.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 (279) hide show
  1. package/CHANGELOG.md +906 -0
  2. package/README.md +1100 -0
  3. package/dist/entities/ad/api/adApi.d.ts +6 -0
  4. package/dist/entities/ad/api/adApi.d.ts.map +1 -0
  5. package/dist/entities/ad/api/adApi.js +29 -0
  6. package/dist/entities/ad/api/adApi.js.map +1 -0
  7. package/dist/entities/ad/index.d.ts +3 -0
  8. package/dist/entities/ad/index.d.ts.map +1 -0
  9. package/dist/entities/ad/index.js +3 -0
  10. package/dist/entities/ad/index.js.map +1 -0
  11. package/dist/entities/ad/model/types.d.ts +22 -0
  12. package/dist/entities/ad/model/types.d.ts.map +1 -0
  13. package/dist/entities/ad/model/types.js +1 -0
  14. package/dist/entities/ad/model/types.js.map +1 -0
  15. package/dist/entities/auth/api/authApi.d.ts +9 -0
  16. package/dist/entities/auth/api/authApi.d.ts.map +1 -0
  17. package/dist/entities/auth/api/authApi.js +46 -0
  18. package/dist/entities/auth/api/authApi.js.map +1 -0
  19. package/dist/entities/auth/index.d.ts +3 -0
  20. package/dist/entities/auth/index.d.ts.map +1 -0
  21. package/dist/entities/auth/index.js +3 -0
  22. package/dist/entities/auth/index.js.map +1 -0
  23. package/dist/entities/auth/model/types.d.ts +77 -0
  24. package/dist/entities/auth/model/types.d.ts.map +1 -0
  25. package/dist/entities/auth/model/types.js +1 -0
  26. package/dist/entities/auth/model/types.js.map +1 -0
  27. package/dist/entities/cart/api/cartApi.d.ts +12 -0
  28. package/dist/entities/cart/api/cartApi.d.ts.map +1 -0
  29. package/dist/entities/cart/api/cartApi.js +396 -0
  30. package/dist/entities/cart/api/cartApi.js.map +1 -0
  31. package/dist/entities/cart/index.d.ts +3 -0
  32. package/dist/entities/cart/index.d.ts.map +1 -0
  33. package/dist/entities/cart/index.js +4 -0
  34. package/dist/entities/cart/index.js.map +1 -0
  35. package/dist/entities/cart/model/types.d.ts +91 -0
  36. package/dist/entities/cart/model/types.d.ts.map +1 -0
  37. package/dist/entities/cart/model/types.js +1 -0
  38. package/dist/entities/cart/model/types.js.map +1 -0
  39. package/dist/entities/category/api/categoryApi.d.ts +8 -0
  40. package/dist/entities/category/api/categoryApi.d.ts.map +1 -0
  41. package/dist/entities/category/api/categoryApi.js +33 -0
  42. package/dist/entities/category/api/categoryApi.js.map +1 -0
  43. package/dist/entities/category/index.d.ts +4 -0
  44. package/dist/entities/category/index.d.ts.map +1 -0
  45. package/dist/entities/category/index.js +4 -0
  46. package/dist/entities/category/index.js.map +1 -0
  47. package/dist/entities/category/model/store-category.d.ts +88 -0
  48. package/dist/entities/category/model/store-category.d.ts.map +1 -0
  49. package/dist/entities/category/model/store-category.js +24 -0
  50. package/dist/entities/category/model/store-category.js.map +1 -0
  51. package/dist/entities/category/model/types.d.ts +155 -0
  52. package/dist/entities/category/model/types.d.ts.map +1 -0
  53. package/dist/entities/category/model/types.js +18 -0
  54. package/dist/entities/category/model/types.js.map +1 -0
  55. package/dist/entities/category/model/useCategoryBreadcrumbs.d.ts +30 -0
  56. package/dist/entities/category/model/useCategoryBreadcrumbs.d.ts.map +1 -0
  57. package/dist/entities/category/model/useCategoryBreadcrumbs.js +72 -0
  58. package/dist/entities/category/model/useCategoryBreadcrumbs.js.map +1 -0
  59. package/dist/entities/chat/api/chatApi.d.ts +15 -0
  60. package/dist/entities/chat/api/chatApi.d.ts.map +1 -0
  61. package/dist/entities/chat/api/chatApi.js +400 -0
  62. package/dist/entities/chat/api/chatApi.js.map +1 -0
  63. package/dist/entities/chat/index.d.ts +3 -0
  64. package/dist/entities/chat/index.d.ts.map +1 -0
  65. package/dist/entities/chat/index.js +3 -0
  66. package/dist/entities/chat/index.js.map +1 -0
  67. package/dist/entities/chat/model/types.d.ts +439 -0
  68. package/dist/entities/chat/model/types.d.ts.map +1 -0
  69. package/dist/entities/chat/model/types.js +1 -0
  70. package/dist/entities/chat/model/types.js.map +1 -0
  71. package/dist/entities/country/api/countryApi.d.ts +5 -0
  72. package/dist/entities/country/api/countryApi.d.ts.map +1 -0
  73. package/dist/entities/country/api/countryApi.js +21 -0
  74. package/dist/entities/country/api/countryApi.js.map +1 -0
  75. package/dist/entities/country/index.d.ts +3 -0
  76. package/dist/entities/country/index.d.ts.map +1 -0
  77. package/dist/entities/country/index.js +3 -0
  78. package/dist/entities/country/index.js.map +1 -0
  79. package/dist/entities/country/model/types.d.ts +19 -0
  80. package/dist/entities/country/model/types.d.ts.map +1 -0
  81. package/dist/entities/country/model/types.js +1 -0
  82. package/dist/entities/country/model/types.js.map +1 -0
  83. package/dist/entities/customer/api/customerApi.d.ts +6 -0
  84. package/dist/entities/customer/api/customerApi.d.ts.map +1 -0
  85. package/dist/entities/customer/api/customerApi.js +21 -0
  86. package/dist/entities/customer/api/customerApi.js.map +1 -0
  87. package/dist/entities/customer/index.d.ts +3 -0
  88. package/dist/entities/customer/index.d.ts.map +1 -0
  89. package/dist/entities/customer/index.js +3 -0
  90. package/dist/entities/customer/index.js.map +1 -0
  91. package/dist/entities/customer/model/types.d.ts +237 -0
  92. package/dist/entities/customer/model/types.d.ts.map +1 -0
  93. package/dist/entities/customer/model/types.js +1 -0
  94. package/dist/entities/customer/model/types.js.map +1 -0
  95. package/dist/entities/favorite/api/favoriteApi.d.ts +32 -0
  96. package/dist/entities/favorite/api/favoriteApi.d.ts.map +1 -0
  97. package/dist/entities/favorite/api/favoriteApi.js +344 -0
  98. package/dist/entities/favorite/api/favoriteApi.js.map +1 -0
  99. package/dist/entities/favorite/index.d.ts +3 -0
  100. package/dist/entities/favorite/index.d.ts.map +1 -0
  101. package/dist/entities/favorite/index.js +3 -0
  102. package/dist/entities/favorite/index.js.map +1 -0
  103. package/dist/entities/favorite/model/types.d.ts +39 -0
  104. package/dist/entities/favorite/model/types.d.ts.map +1 -0
  105. package/dist/entities/favorite/model/types.js +1 -0
  106. package/dist/entities/favorite/model/types.js.map +1 -0
  107. package/dist/entities/notification/api/notificationApi.d.ts +12 -0
  108. package/dist/entities/notification/api/notificationApi.d.ts.map +1 -0
  109. package/dist/entities/notification/api/notificationApi.js +109 -0
  110. package/dist/entities/notification/api/notificationApi.js.map +1 -0
  111. package/dist/entities/notification/index.d.ts +3 -0
  112. package/dist/entities/notification/index.d.ts.map +1 -0
  113. package/dist/entities/notification/index.js +3 -0
  114. package/dist/entities/notification/index.js.map +1 -0
  115. package/dist/entities/notification/model/types.d.ts +273 -0
  116. package/dist/entities/notification/model/types.d.ts.map +1 -0
  117. package/dist/entities/notification/model/types.js +1 -0
  118. package/dist/entities/notification/model/types.js.map +1 -0
  119. package/dist/entities/novaposhta/api/novaposhtaApi.d.ts +11 -0
  120. package/dist/entities/novaposhta/api/novaposhtaApi.d.ts.map +1 -0
  121. package/dist/entities/novaposhta/api/novaposhtaApi.js +69 -0
  122. package/dist/entities/novaposhta/api/novaposhtaApi.js.map +1 -0
  123. package/dist/entities/novaposhta/index.d.ts +6 -0
  124. package/dist/entities/novaposhta/index.d.ts.map +1 -0
  125. package/dist/entities/novaposhta/index.js +6 -0
  126. package/dist/entities/novaposhta/index.js.map +1 -0
  127. package/dist/entities/novaposhta/model/novaposhtaCity.d.ts +101 -0
  128. package/dist/entities/novaposhta/model/novaposhtaCity.d.ts.map +1 -0
  129. package/dist/entities/novaposhta/model/novaposhtaCity.js +16 -0
  130. package/dist/entities/novaposhta/model/novaposhtaCity.js.map +1 -0
  131. package/dist/entities/novaposhta/model/novaposhtaSettlement.d.ts +140 -0
  132. package/dist/entities/novaposhta/model/novaposhtaSettlement.d.ts.map +1 -0
  133. package/dist/entities/novaposhta/model/novaposhtaSettlement.js +23 -0
  134. package/dist/entities/novaposhta/model/novaposhtaSettlement.js.map +1 -0
  135. package/dist/entities/novaposhta/model/novaposhtaStreet.d.ts +123 -0
  136. package/dist/entities/novaposhta/model/novaposhtaStreet.d.ts.map +1 -0
  137. package/dist/entities/novaposhta/model/novaposhtaStreet.js +16 -0
  138. package/dist/entities/novaposhta/model/novaposhtaStreet.js.map +1 -0
  139. package/dist/entities/novaposhta/model/novaposhtaWarehouse.d.ts +131 -0
  140. package/dist/entities/novaposhta/model/novaposhtaWarehouse.d.ts.map +1 -0
  141. package/dist/entities/novaposhta/model/novaposhtaWarehouse.js +19 -0
  142. package/dist/entities/novaposhta/model/novaposhtaWarehouse.js.map +1 -0
  143. package/dist/entities/order/api/orderApi.d.ts +18 -0
  144. package/dist/entities/order/api/orderApi.d.ts.map +1 -0
  145. package/dist/entities/order/api/orderApi.js +105 -0
  146. package/dist/entities/order/api/orderApi.js.map +1 -0
  147. package/dist/entities/order/index.d.ts +3 -0
  148. package/dist/entities/order/index.d.ts.map +1 -0
  149. package/dist/entities/order/index.js +3 -0
  150. package/dist/entities/order/index.js.map +1 -0
  151. package/dist/entities/order/model/types.d.ts +630 -0
  152. package/dist/entities/order/model/types.d.ts.map +1 -0
  153. package/dist/entities/order/model/types.js +27 -0
  154. package/dist/entities/order/model/types.js.map +1 -0
  155. package/dist/entities/product/api/productApi.d.ts +27 -0
  156. package/dist/entities/product/api/productApi.d.ts.map +1 -0
  157. package/dist/entities/product/api/productApi.js +252 -0
  158. package/dist/entities/product/api/productApi.js.map +1 -0
  159. package/dist/entities/product/index.d.ts +3 -0
  160. package/dist/entities/product/index.d.ts.map +1 -0
  161. package/dist/entities/product/index.js +3 -0
  162. package/dist/entities/product/index.js.map +1 -0
  163. package/dist/entities/product/model/store-product.d.ts +138 -0
  164. package/dist/entities/product/model/store-product.d.ts.map +1 -0
  165. package/dist/entities/product/model/store-product.js +9 -0
  166. package/dist/entities/product/model/store-product.js.map +1 -0
  167. package/dist/entities/product/model/types.d.ts +898 -0
  168. package/dist/entities/product/model/types.d.ts.map +1 -0
  169. package/dist/entities/product/model/types.js +40 -0
  170. package/dist/entities/product/model/types.js.map +1 -0
  171. package/dist/entities/referral/api/referralApi.d.ts +7 -0
  172. package/dist/entities/referral/api/referralApi.d.ts.map +1 -0
  173. package/dist/entities/referral/api/referralApi.js +41 -0
  174. package/dist/entities/referral/api/referralApi.js.map +1 -0
  175. package/dist/entities/referral/index.d.ts +3 -0
  176. package/dist/entities/referral/index.d.ts.map +1 -0
  177. package/dist/entities/referral/index.js +3 -0
  178. package/dist/entities/referral/index.js.map +1 -0
  179. package/dist/entities/referral/model/types.d.ts +42 -0
  180. package/dist/entities/referral/model/types.d.ts.map +1 -0
  181. package/dist/entities/referral/model/types.js +1 -0
  182. package/dist/entities/referral/model/types.js.map +1 -0
  183. package/dist/entities/store/api/storeApi.d.ts +14 -0
  184. package/dist/entities/store/api/storeApi.d.ts.map +1 -0
  185. package/dist/entities/store/api/storeApi.js +134 -0
  186. package/dist/entities/store/api/storeApi.js.map +1 -0
  187. package/dist/entities/store/index.d.ts +3 -0
  188. package/dist/entities/store/index.d.ts.map +1 -0
  189. package/dist/entities/store/index.js +3 -0
  190. package/dist/entities/store/index.js.map +1 -0
  191. package/dist/entities/store/model/types.d.ts +853 -0
  192. package/dist/entities/store/model/types.d.ts.map +1 -0
  193. package/dist/entities/store/model/types.js +1 -0
  194. package/dist/entities/store/model/types.js.map +1 -0
  195. package/dist/entities/stories/api/storiesApi.d.ts +12 -0
  196. package/dist/entities/stories/api/storiesApi.d.ts.map +1 -0
  197. package/dist/entities/stories/api/storiesApi.js +225 -0
  198. package/dist/entities/stories/api/storiesApi.js.map +1 -0
  199. package/dist/entities/stories/index.d.ts +3 -0
  200. package/dist/entities/stories/index.d.ts.map +1 -0
  201. package/dist/entities/stories/index.js +3 -0
  202. package/dist/entities/stories/index.js.map +1 -0
  203. package/dist/entities/stories/model/types.d.ts +330 -0
  204. package/dist/entities/stories/model/types.d.ts.map +1 -0
  205. package/dist/entities/stories/model/types.js +1 -0
  206. package/dist/entities/stories/model/types.js.map +1 -0
  207. package/dist/entities/supplier/api/supplierApi.d.ts +20 -0
  208. package/dist/entities/supplier/api/supplierApi.d.ts.map +1 -0
  209. package/dist/entities/supplier/api/supplierApi.js +148 -0
  210. package/dist/entities/supplier/api/supplierApi.js.map +1 -0
  211. package/dist/entities/supplier/index.d.ts +3 -0
  212. package/dist/entities/supplier/index.d.ts.map +1 -0
  213. package/dist/entities/supplier/index.js +3 -0
  214. package/dist/entities/supplier/index.js.map +1 -0
  215. package/dist/entities/supplier/model/types.d.ts +295 -0
  216. package/dist/entities/supplier/model/types.d.ts.map +1 -0
  217. package/dist/entities/supplier/model/types.js +1 -0
  218. package/dist/entities/supplier/model/types.js.map +1 -0
  219. package/dist/entities/system/api/systemApi.d.ts +7 -0
  220. package/dist/entities/system/api/systemApi.d.ts.map +1 -0
  221. package/dist/entities/system/api/systemApi.js +60 -0
  222. package/dist/entities/system/api/systemApi.js.map +1 -0
  223. package/dist/entities/system/index.d.ts +3 -0
  224. package/dist/entities/system/index.d.ts.map +1 -0
  225. package/dist/entities/system/index.js +3 -0
  226. package/dist/entities/system/index.js.map +1 -0
  227. package/dist/entities/system/model/types.d.ts +55 -0
  228. package/dist/entities/system/model/types.d.ts.map +1 -0
  229. package/dist/entities/system/model/types.js +1 -0
  230. package/dist/entities/system/model/types.js.map +1 -0
  231. package/dist/index.d.ts +20 -0
  232. package/dist/index.d.ts.map +1 -0
  233. package/dist/index.js +21 -0
  234. package/dist/index.js.map +1 -0
  235. package/dist/shared/api/api.d.ts +18 -0
  236. package/dist/shared/api/api.d.ts.map +1 -0
  237. package/dist/shared/api/api.js +74 -0
  238. package/dist/shared/api/api.js.map +1 -0
  239. package/dist/shared/api/index.d.ts +3 -0
  240. package/dist/shared/api/index.d.ts.map +1 -0
  241. package/dist/shared/api/index.js +3 -0
  242. package/dist/shared/api/index.js.map +1 -0
  243. package/dist/shared/api/validation-error/ValidationError.d.ts +7 -0
  244. package/dist/shared/api/validation-error/ValidationError.d.ts.map +1 -0
  245. package/dist/shared/api/validation-error/ValidationError.js +1 -0
  246. package/dist/shared/api/validation-error/ValidationError.js.map +1 -0
  247. package/dist/shared/api/validation-error/handleValidationError.d.ts +2 -0
  248. package/dist/shared/api/validation-error/handleValidationError.d.ts.map +1 -0
  249. package/dist/shared/api/validation-error/handleValidationError.js +24 -0
  250. package/dist/shared/api/validation-error/handleValidationError.js.map +1 -0
  251. package/dist/shared/api/validation-error/index.d.ts +3 -0
  252. package/dist/shared/api/validation-error/index.d.ts.map +1 -0
  253. package/dist/shared/api/validation-error/index.js +3 -0
  254. package/dist/shared/api/validation-error/index.js.map +1 -0
  255. package/dist/shared/api/validation-error/isValidationError.d.ts +3 -0
  256. package/dist/shared/api/validation-error/isValidationError.d.ts.map +1 -0
  257. package/dist/shared/api/validation-error/isValidationError.js +11 -0
  258. package/dist/shared/api/validation-error/isValidationError.js.map +1 -0
  259. package/dist/shared/lib/getNextPageParam.d.ts +3 -0
  260. package/dist/shared/lib/getNextPageParam.d.ts.map +1 -0
  261. package/dist/shared/lib/getNextPageParam.js +4 -0
  262. package/dist/shared/lib/getNextPageParam.js.map +1 -0
  263. package/dist/shared/lib/index.d.ts +3 -0
  264. package/dist/shared/lib/index.d.ts.map +1 -0
  265. package/dist/shared/lib/index.js +3 -0
  266. package/dist/shared/lib/index.js.map +1 -0
  267. package/dist/shared/lib/objectToFormData.d.ts +2 -0
  268. package/dist/shared/lib/objectToFormData.d.ts.map +1 -0
  269. package/dist/shared/lib/objectToFormData.js +36 -0
  270. package/dist/shared/lib/objectToFormData.js.map +1 -0
  271. package/dist/shared/model/index.d.ts +2 -0
  272. package/dist/shared/model/index.d.ts.map +1 -0
  273. package/dist/shared/model/index.js +2 -0
  274. package/dist/shared/model/index.js.map +1 -0
  275. package/dist/shared/model/types.d.ts +75 -0
  276. package/dist/shared/model/types.d.ts.map +1 -0
  277. package/dist/shared/model/types.js +31 -0
  278. package/dist/shared/model/types.js.map +1 -0
  279. package/package.json +46 -0
@@ -0,0 +1,27 @@
1
+ import type { GenerateProductDescriptionRequest, GenerateProductDescriptionResponse, GetPaginatedProductsRequest, GetPaginatedSupplierProductsRequest, GetProductAttributesRequest, GetProductAttributesResponse, GetProductDetailsRequest, GetProductDetailsResponse, GetProductOptionsRequest, GetProductOptionsResponse, GetProductRequest, GetProductResponse, GetProductsByQrRequest, GetProductsByQrResponse, GetProductsRequest, GetProductsResponse, GetProductStatisticsRequest, GetProductStatisticsResponse, GetSupplierProductDetailsRequest, GetSupplierProductDetailsResponse, GetSupplierProductsRequest, GetSupplierProductsResponse } from '../model/types';
2
+ import { type GetStoreProductsRequest, type GetStoreProductsResponse } from '../model/store-product';
3
+ export declare const productApi: import("@reduxjs/toolkit/query").Api<import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError>, import("@reduxjs/toolkit/query").UpdateDefinitions<import("@reduxjs/toolkit/query").UpdateDefinitions<{
4
+ getCartCount: import("@reduxjs/toolkit/query").QueryDefinition<void, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError>, never, import("../../cart").GetCartCountResponse, "buymeuaApi", unknown>;
5
+ getCartMerchants: import("@reduxjs/toolkit/query").InfiniteQueryDefinition<void | import("../../cart").GetCartMerchantsRequest, number, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError>, never, import("../../cart").GetCartMerchantsResponse, "buymeuaApi", unknown>;
6
+ getCartMerchantItems: import("@reduxjs/toolkit/query").InfiniteQueryDefinition<import("../../cart").GetCartMerchantItemsRequest, number, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError>, never, import("../../cart").GetCartMerchantItemsResponse, "buymeuaApi", unknown>;
7
+ addToCart: import("@reduxjs/toolkit/query").MutationDefinition<import("../../cart").AddToCartRequest, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError>, never, import("../../cart").AddToCartResponse, "buymeuaApi", unknown>;
8
+ removeItemFromCart: import("@reduxjs/toolkit/query").MutationDefinition<import("../../cart").RemoveItemFromCartRequest, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError>, never, undefined, "buymeuaApi", unknown>;
9
+ removeMerchantFromCart: import("@reduxjs/toolkit/query").MutationDefinition<import("../../cart").RemoveMerchantFromCartRequest, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError>, never, undefined, "buymeuaApi", unknown>;
10
+ updateCartItemQuantity: import("@reduxjs/toolkit/query").MutationDefinition<import("../../cart").UpdateCartItemQuantityRequest, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError>, never, import("../../cart").UpdateCartItemQuantityResponse, "buymeuaApi", unknown>;
11
+ toggleGiftPackage: import("@reduxjs/toolkit/query").MutationDefinition<import("../../cart").ToggleGiftPackageRequest, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError>, never, import("../../cart").ToggleGiftPackageResponse, "buymeuaApi", unknown>;
12
+ }, "CartCount" | "CartMerchant" | "CartMerchantItem", never> & {
13
+ getProducts: import("@reduxjs/toolkit/query").InfiniteQueryDefinition<void | GetProductsRequest, number, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError>, "CartCount" | "CartMerchant" | "CartMerchantItem", GetProductsResponse, "buymeuaApi", unknown>;
14
+ getPaginatedProducts: import("@reduxjs/toolkit/query").QueryDefinition<void | GetPaginatedProductsRequest, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError>, "CartCount" | "CartMerchant" | "CartMerchantItem", GetProductsResponse, "buymeuaApi", unknown>;
15
+ getProductsByQr: import("@reduxjs/toolkit/query").InfiniteQueryDefinition<void | GetProductsByQrRequest, number, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError>, "CartCount" | "CartMerchant" | "CartMerchantItem", GetProductsByQrResponse, "buymeuaApi", unknown>;
16
+ getProduct: import("@reduxjs/toolkit/query").QueryDefinition<GetProductRequest, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError>, "CartCount" | "CartMerchant" | "CartMerchantItem", GetProductResponse, "buymeuaApi", unknown>;
17
+ getProductStatistics: import("@reduxjs/toolkit/query").QueryDefinition<GetProductStatisticsRequest, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError>, "CartCount" | "CartMerchant" | "CartMerchantItem", GetProductStatisticsResponse, "buymeuaApi", unknown>;
18
+ getProductDetails: import("@reduxjs/toolkit/query").QueryDefinition<GetProductDetailsRequest, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError>, "CartCount" | "CartMerchant" | "CartMerchantItem", GetProductDetailsResponse, "buymeuaApi", unknown>;
19
+ getProductAttributes: import("@reduxjs/toolkit/query").QueryDefinition<void | GetProductAttributesRequest, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError>, "CartCount" | "CartMerchant" | "CartMerchantItem", GetProductAttributesResponse, "buymeuaApi", unknown>;
20
+ getProductOptions: import("@reduxjs/toolkit/query").QueryDefinition<void | GetProductOptionsRequest, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError>, "CartCount" | "CartMerchant" | "CartMerchantItem", GetProductOptionsResponse, "buymeuaApi", unknown>;
21
+ getSupplierProducts: import("@reduxjs/toolkit/query").InfiniteQueryDefinition<void | GetSupplierProductsRequest, number, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError>, "CartCount" | "CartMerchant" | "CartMerchantItem", GetSupplierProductsResponse, "buymeuaApi", unknown>;
22
+ getPaginatedSupplierProducts: import("@reduxjs/toolkit/query").QueryDefinition<void | GetPaginatedSupplierProductsRequest, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError>, "CartCount" | "CartMerchant" | "CartMerchantItem", GetSupplierProductsResponse, "buymeuaApi", unknown>;
23
+ getSupplierProductDetails: import("@reduxjs/toolkit/query").QueryDefinition<GetSupplierProductDetailsRequest, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError>, "CartCount" | "CartMerchant" | "CartMerchantItem", GetSupplierProductDetailsResponse, "buymeuaApi", unknown>;
24
+ generateProductDescription: import("@reduxjs/toolkit/query").QueryDefinition<GenerateProductDescriptionRequest, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError>, "CartCount" | "CartMerchant" | "CartMerchantItem", GenerateProductDescriptionResponse, "buymeuaApi", unknown>;
25
+ getStoreProducts: import("@reduxjs/toolkit/query").InfiniteQueryDefinition<void | GetStoreProductsRequest, number, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError>, "CartCount" | "CartMerchant" | "CartMerchantItem", GetStoreProductsResponse, "buymeuaApi", unknown>;
26
+ }, "CartCount" | "CartMerchant" | "CartMerchantItem" | "Product" | "ProductDetails" | "SupplierProduct" | "SupplierProductDetails", never>, "buymeuaApi", "CartCount" | "CartMerchant" | "CartMerchantItem" | "Product" | "ProductDetails" | "SupplierProduct" | "SupplierProductDetails", typeof import("@reduxjs/toolkit/query").coreModuleName | typeof import("@reduxjs/toolkit/query/react").reactHooksModuleName>;
27
+ //# sourceMappingURL=productApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"productApi.d.ts","sourceRoot":"","sources":["../../../../src/entities/product/api/productApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iCAAiC,EACjC,kCAAkC,EAClC,2BAA2B,EAC3B,mCAAmC,EACnC,2BAA2B,EAC3B,4BAA4B,EAC5B,wBAAwB,EACxB,yBAAyB,EACzB,wBAAwB,EACxB,yBAAyB,EACzB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,2BAA2B,EAC3B,4BAA4B,EAC5B,gCAAgC,EAChC,iCAAiC,EACjC,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC9B,MAAM,wBAAwB,CAAC;AAEhC,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;uZA2UnB,CAAC"}
@@ -0,0 +1,252 @@
1
+ import { getNextPageParam } from '../../../shared/lib';
2
+ import { cartApi } from '../../cart';
3
+ import { getStoreProductsResponseSchema, } from '../model/store-product';
4
+ export const productApi = cartApi
5
+ .injectEndpoints({
6
+ endpoints: (build) => ({
7
+ getProducts: build.infiniteQuery({
8
+ infiniteQueryOptions: {
9
+ initialPageParam: 1,
10
+ getNextPageParam,
11
+ },
12
+ query: (arg) => ({
13
+ url: 'v2/products/search',
14
+ method: 'POST',
15
+ body: {
16
+ ...arg.queryArg,
17
+ page: arg.pageParam,
18
+ },
19
+ }),
20
+ }),
21
+ getPaginatedProducts: build.query({
22
+ query: (arg) => ({
23
+ url: 'v2/products/search',
24
+ method: 'POST',
25
+ body: {
26
+ ...arg,
27
+ },
28
+ }),
29
+ }),
30
+ getProductsByQr: build.infiniteQuery({
31
+ infiniteQueryOptions: {
32
+ initialPageParam: 1,
33
+ getNextPageParam,
34
+ },
35
+ query: (arg) => ({
36
+ url: 'v1/products/qr-search',
37
+ params: {
38
+ ...arg.queryArg,
39
+ page: arg.pageParam,
40
+ },
41
+ }),
42
+ }),
43
+ getProduct: build.query({
44
+ query: (arg) => ({
45
+ url: `v1/products/${arg.product.toString()}`,
46
+ }),
47
+ }),
48
+ getProductStatistics: build.query({
49
+ query: (arg) => ({
50
+ url: `v1/products/${arg.product.toString()}/statistics`,
51
+ }),
52
+ }),
53
+ getProductDetails: build.query({
54
+ query: (arg) => ({
55
+ url: `v1/products/${arg.product.toString()}/details`,
56
+ }),
57
+ }),
58
+ getProductAttributes: build.query({
59
+ query: (arg) => ({
60
+ url: 'v2/products/attributes/search',
61
+ method: 'POST',
62
+ body: arg,
63
+ }),
64
+ }),
65
+ getProductOptions: build.query({
66
+ query: (arg) => ({
67
+ url: 'v2/products/option-values/search',
68
+ method: 'POST',
69
+ body: arg,
70
+ }),
71
+ }),
72
+ getSupplierProducts: build.infiniteQuery({
73
+ infiniteQueryOptions: {
74
+ initialPageParam: 1,
75
+ getNextPageParam,
76
+ },
77
+ query: (arg) => ({
78
+ url: 'suppliers/v1/products/list',
79
+ method: 'POST',
80
+ body: {
81
+ ...arg.queryArg,
82
+ page: arg.pageParam,
83
+ },
84
+ }),
85
+ }),
86
+ // TODO: Check tags invalidation correctness
87
+ getPaginatedSupplierProducts: build.query({
88
+ query: (arg) => ({
89
+ url: 'suppliers/v1/products/list',
90
+ method: 'POST',
91
+ body: {
92
+ ...arg,
93
+ },
94
+ }),
95
+ }),
96
+ getSupplierProductDetails: build.query({
97
+ query: (arg) => ({
98
+ url: `suppliers/v1/products/${arg.id.toString()}/product-detail`,
99
+ }),
100
+ }),
101
+ generateProductDescription: build.query({
102
+ query: (arg) => ({
103
+ url: `v1/products/${arg.product.toString()}/open-ai/generate-description`,
104
+ }),
105
+ }),
106
+ getStoreProducts: build.infiniteQuery({
107
+ infiniteQueryOptions: {
108
+ initialPageParam: 1,
109
+ getNextPageParam,
110
+ },
111
+ query: (arg) => ({
112
+ url: 'v1/store/products',
113
+ method: 'POST',
114
+ body: {
115
+ ...arg.queryArg,
116
+ page: arg.pageParam,
117
+ },
118
+ }),
119
+ responseSchema: getStoreProductsResponseSchema,
120
+ }),
121
+ }),
122
+ overrideExisting: false,
123
+ })
124
+ .enhanceEndpoints({
125
+ addTagTypes: [
126
+ 'Product',
127
+ 'ProductDetails',
128
+ 'SupplierProduct',
129
+ 'SupplierProductDetails',
130
+ ],
131
+ endpoints: {
132
+ getProducts: {
133
+ providesTags: (result, _error, _arg, _meta) => {
134
+ return result
135
+ ? [
136
+ ...result.pages
137
+ .flatMap((page) => page.data)
138
+ .map((product) => ({
139
+ type: 'Product',
140
+ id: product.id,
141
+ })),
142
+ { type: 'Product', id: 'LIST' },
143
+ ]
144
+ : [{ type: 'Product', id: 'LIST' }];
145
+ },
146
+ },
147
+ getPaginatedProducts: {
148
+ providesTags: (result, _error, _arg, _meta) => {
149
+ return result
150
+ ? [
151
+ ...result.data.map((product) => ({
152
+ type: 'Product',
153
+ id: product.id,
154
+ })),
155
+ { type: 'Product', id: 'LIST' },
156
+ ]
157
+ : [{ type: 'Product', id: 'LIST' }];
158
+ },
159
+ },
160
+ getProductsByQr: {
161
+ // TODO: Check
162
+ providesTags: (result, _error, _arg, _meta) => {
163
+ return result
164
+ ? [
165
+ ...result.pages
166
+ .flatMap((page) => page.data)
167
+ .map((product) => ({
168
+ type: 'Product',
169
+ id: product.product_id,
170
+ })),
171
+ { type: 'Product', id: 'LIST' },
172
+ ]
173
+ : [{ type: 'Product', id: 'LIST' }];
174
+ },
175
+ },
176
+ getProductDetails: {
177
+ providesTags: (result, _error, _arg, _meta) => {
178
+ return result
179
+ ? [{ type: 'ProductDetails', id: result.data.product_id }]
180
+ : // TODO: Check if empty array is correct
181
+ [];
182
+ },
183
+ },
184
+ getSupplierProducts: {
185
+ providesTags: (result, _error, _arg, _meta) => {
186
+ return result
187
+ ? [
188
+ ...result.pages
189
+ .flatMap((page) => page.data)
190
+ .map((supplierProduct) => ({
191
+ type: 'SupplierProduct',
192
+ id: supplierProduct.id,
193
+ })),
194
+ { type: 'SupplierProduct', id: 'LIST' },
195
+ ]
196
+ : [{ type: 'SupplierProduct', id: 'LIST' }];
197
+ },
198
+ },
199
+ getPaginatedSupplierProducts: {
200
+ providesTags: (result, _error, _arg, _meta) => {
201
+ return result
202
+ ? [
203
+ ...result.data.map((supplierProduct) => ({
204
+ type: 'SupplierProduct',
205
+ id: supplierProduct.id,
206
+ })),
207
+ { type: 'SupplierProduct', id: 'LIST' },
208
+ ]
209
+ : [{ type: 'SupplierProduct', id: 'LIST' }];
210
+ },
211
+ },
212
+ getSupplierProductDetails: {
213
+ providesTags: (result, _error, _arg, _meta) => {
214
+ return result
215
+ ? [{ type: 'SupplierProductDetails', id: result.data.product_id }]
216
+ : // TODO: Check if empty array is correct
217
+ [];
218
+ },
219
+ },
220
+ getStoreProducts: {
221
+ providesTags: (result, _error, _arg, _meta) => {
222
+ if (!result) {
223
+ return [
224
+ { type: 'Product', id: 'LIST' },
225
+ { type: 'SupplierProduct', id: 'LIST' },
226
+ ];
227
+ }
228
+ const products = result.pages.flatMap((page) => page.data);
229
+ const [firstProduct] = products;
230
+ if (!firstProduct) {
231
+ return [
232
+ { type: 'Product', id: 'LIST' },
233
+ { type: 'SupplierProduct', id: 'LIST' },
234
+ ];
235
+ }
236
+ const listTag = firstProduct.product_type === 'supplier'
237
+ ? { type: 'SupplierProduct', id: 'LIST' }
238
+ : { type: 'Product', id: 'LIST' };
239
+ return [
240
+ ...products.map((product) => ({
241
+ type: product.product_type === 'buyme'
242
+ ? 'Product'
243
+ : 'SupplierProduct',
244
+ id: product.id,
245
+ })),
246
+ listTag,
247
+ ];
248
+ },
249
+ },
250
+ },
251
+ });
252
+ //# sourceMappingURL=productApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"productApi.js","sourceRoot":"","sources":["../../../../src/entities/product/api/productApi.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EACL,8BAA8B,GAG/B,MAAM,wBAAwB,CAAC;AAEhC,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO;KAC9B,eAAe,CAAC;IACf,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACrB,WAAW,EAAE,KAAK,CAAC,aAAa,CAK9B;YACA,oBAAoB,EAAE;gBACpB,gBAAgB,EAAE,CAAC;gBAEnB,gBAAgB;aACjB;YAED,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;gBACf,GAAG,EAAE,oBAAoB;gBACzB,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE;oBACJ,GAAG,GAAG,CAAC,QAAQ;oBACf,IAAI,EAAE,GAAG,CAAC,SAAS;iBACpB;aACF,CAAC;SACH,CAAC;QAEF,oBAAoB,EAAE,KAAK,CAAC,KAAK,CAI/B;YACA,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;gBACf,GAAG,EAAE,oBAAoB;gBACzB,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE;oBACJ,GAAG,GAAG;iBACP;aACF,CAAC;SACH,CAAC;QAEF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M,EAAE;wBAC/B,EAAE,IAAI,EAAE,iBAAiB,EAAE,EAAE,EAAE,MAAM,EAAE;qBACxC,CAAC;gBACJ,CAAC;gBAED,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAE3D,MAAM,CAAC,YAAY,CAAC,GAAG,QAAQ,CAAC;gBAChC,IAAI,CAAC,YAAY,EAAE,CAAC;oBAClB,OAAO;wBACL,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE;wBAC/B,EAAE,IAAI,EAAE,iBAAiB,EAAE,EAAE,EAAE,MAAM,EAAE;qBACxC,CAAC;gBACJ,CAAC;gBAED,MAAM,OAAO,GACX,YAAY,CAAC,YAAY,KAAK,UAAU;oBACtC,CAAC,CAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,EAAE,EAAE,MAAM,EAAY;oBACpD,CAAC,CAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAY,CAAC;gBAEjD,OAAO;oBACL,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;wBAC5B,IAAI,EACF,OAAO,CAAC,YAAY,KAAK,OAAO;4BAC9B,CAAC,CAAE,SAAmB;4BACtB,CAAC,CAAE,iBAA2B;wBAClC,EAAE,EAAE,OAAO,CAAC,EAAE;qBACf,CAAC,CAAC;oBACH,OAAO;iBACR,CAAC;YACJ,CAAC;SACF;KACF;CACF,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './api/productApi';
2
+ export * from './model/types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entities/product/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AAEjC,cAAc,eAAe,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './api/productApi';
2
+ export * from './model/types';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/entities/product/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AAEjC,cAAc,eAAe,CAAC"}
@@ -0,0 +1,138 @@
1
+ import z from 'zod';
2
+ import { type PaginatedResponse } from '../../../shared/model';
3
+ import { type BaseProduct } from './types';
4
+ /**
5
+ * Возвращает список товаров для storefront по фильтрам категорий или товаров.
6
+ *
7
+ * Контекст магазина определяется по заголовку X-BSTORE-ID.
8
+ */
9
+ export interface GetStoreProductsRequest {
10
+ /**
11
+ * Массив ID категорий для фильтрации (опционально). Для buyme ограничены категориями магазина.
12
+ *
13
+ * @example [506, 514]
14
+ */
15
+ filter_category_ids?: number[];
16
+ /**
17
+ * Массив ID товаров для фильтрации (опционально).
18
+ *
19
+ * @example [123, 456]
20
+ */
21
+ filter_product_ids?: number[];
22
+ /**
23
+ * Строка поиска по товарам (опционально).
24
+ *
25
+ * @example "платье"
26
+ */
27
+ filter_search?: string;
28
+ /**
29
+ * Количество товаров на странице
30
+ *
31
+ * @example 15
32
+ */
33
+ per_page?: number;
34
+ /**
35
+ * Сортування товарів. Доступні значення: price_asc, price_desc, newest, discount
36
+ *
37
+ * @example "price_asc"
38
+ */
39
+ order_by?: 'price_asc' | 'price_desc' | 'newest' | 'discount';
40
+ /**
41
+ * Массив ID значений опций для фильтрации (размеры, цвета). OR между значениями одной опции, учитывает все склады.
42
+ *
43
+ * @example [31, 32]
44
+ */
45
+ filter_option_value_ids?: number[];
46
+ /**
47
+ * Массив filter_key атрибутов для фильтрации.
48
+ *
49
+ * Формат: "attr_id:value_id" (buyme) или "attr_id:value_text" (supplier). OR внутри одного атрибута, AND между разными атрибутами.
50
+ *
51
+ * @example ["12:345", "12:346"]
52
+ */
53
+ filter_attribute_values?: string[];
54
+ /**
55
+ * Минимальная цена товара (включительно).
56
+ *
57
+ * @example 500
58
+ */
59
+ filter_price_from?: number;
60
+ /**
61
+ * Максимальная цена товара (включительно).
62
+ *
63
+ * @example 2000
64
+ */
65
+ filter_price_to?: number;
66
+ /**
67
+ * Только товары со скидкой/спецценой (has_special_price).
68
+ *
69
+ * @example true
70
+ */
71
+ filter_has_special?: boolean;
72
+ }
73
+ /**
74
+ * Список товаров успешно получен
75
+ */
76
+ export interface GetStoreProductsResponse extends PaginatedResponse {
77
+ /**
78
+ * @see {@link BaseProduct}
79
+ */
80
+ data: BaseProduct[];
81
+ }
82
+ export declare const getStoreProductsResponseSchema: z.ZodObject<{
83
+ data: z.ZodArray<z.ZodObject<{
84
+ id: z.ZodNumber;
85
+ merchant_id: z.ZodNumber;
86
+ product_type: z.ZodEnum<{
87
+ supplier: "supplier";
88
+ buyme: "buyme";
89
+ }>;
90
+ name: z.ZodString;
91
+ model: z.ZodString;
92
+ in_favorite: z.ZodBoolean;
93
+ price: z.ZodString;
94
+ special: z.ZodNullable<z.ZodString>;
95
+ category: z.ZodObject<{
96
+ id: z.ZodNumber;
97
+ name: z.ZodString;
98
+ }, z.core.$strip>;
99
+ thumb: z.ZodString;
100
+ thumb_small: z.ZodString;
101
+ thumb_large: z.ZodString;
102
+ download: z.ZodString;
103
+ video: z.ZodExactOptional<z.ZodString>;
104
+ images: z.ZodExactOptional<z.ZodArray<z.ZodObject<{
105
+ thumb: z.ZodString;
106
+ popup: z.ZodString;
107
+ }, z.core.$strip>>>;
108
+ buyme_category: z.ZodExactOptional<z.ZodObject<{
109
+ id: z.ZodNumber;
110
+ name: z.ZodString;
111
+ }, z.core.$strip>>;
112
+ options: z.ZodUnknown;
113
+ price_per_unit: z.ZodExactOptional<z.ZodObject<{
114
+ description: z.ZodString;
115
+ }, z.core.$strip>>;
116
+ }, z.core.$strip>>;
117
+ meta: z.ZodObject<{
118
+ current_page: z.ZodNumber;
119
+ from: z.ZodNullable<z.ZodNumber>;
120
+ last_page: z.ZodNumber;
121
+ links: z.ZodArray<z.ZodObject<{
122
+ url: z.ZodNullable<z.ZodString>;
123
+ label: z.ZodString;
124
+ active: z.ZodBoolean;
125
+ }, z.core.$strip>>;
126
+ path: z.ZodString;
127
+ per_page: z.ZodNumber;
128
+ to: z.ZodNullable<z.ZodNumber>;
129
+ total: z.ZodNumber;
130
+ }, z.core.$strip>;
131
+ links: z.ZodObject<{
132
+ first: z.ZodString;
133
+ last: z.ZodString;
134
+ prev: z.ZodNullable<z.ZodString>;
135
+ next: z.ZodNullable<z.ZodString>;
136
+ }, z.core.$strip>;
137
+ }, z.core.$strip>;
138
+ //# sourceMappingURL=store-product.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store-product.d.ts","sourceRoot":"","sources":["../../../../src/entities/product/model/store-product.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAE9D;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE/B;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE9B;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,WAAW,GAAG,YAAY,GAAG,QAAQ,GAAG,UAAU,CAAC;IAE9D;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnC;;;;;;OAMG;IACH,uBAAuB,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,iBAAiB;IACjE;;OAEG;IACH,IAAI,EAAE,WAAW,EAAE,CAAC;CACrB;AACD,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAIzC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import z from 'zod';
2
+ import { PaginatedResponseSchema, } from '../../../shared/model';
3
+ import { baseProductSchema } from './types';
4
+ export const getStoreProductsResponseSchema = z.object({
5
+ // TODO: Rename PaginatedResponseSchema to paginatedResponseSchema
6
+ ...PaginatedResponseSchema.shape,
7
+ data: z.array(baseProductSchema),
8
+ });
9
+ //# sourceMappingURL=store-product.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store-product.js","sourceRoot":"","sources":["../../../../src/entities/product/model/store-product.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,EACL,uBAAuB,GAExB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAoB,MAAM,SAAS,CAAC;AA0F9D,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IACrD,kEAAkE;IAClE,GAAG,uBAAuB,CAAC,KAAK;IAChC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC;CACjC,CAAC,CAAC"}