@unchainedshop/admin-ui 5.0.0-alpha.11 → 5.0.0-alpha.12

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 (752) hide show
  1. package/README.md +1 -1
  2. package/dist/{chunk-WPLOTFGW.js → chunk-2HTCKO4E.js} +12 -3
  3. package/dist/{chunk-BMDNY67T.js → chunk-33ZO52Z7.js} +3241 -1753
  4. package/dist/{chunk-PJLYVMUM.js → chunk-4MXPTVDL.js} +2 -2
  5. package/dist/{chunk-I64TXIE7.js → chunk-ATZJXTRA.js} +1 -1
  6. package/dist/{chunk-QHR23GVH.js → chunk-CUYIP5XG.js} +1 -1
  7. package/dist/{chunk-5WPFHQZN.js → chunk-E6HDJYA6.js} +3 -3
  8. package/dist/{chunk-FDHXLNZQ.js → chunk-EAVP6XZQ.js} +1 -1
  9. package/dist/{chunk-E77YIMGR.js → chunk-ED2FP42R.js} +1 -1
  10. package/dist/{chunk-HJKRGBDG.js → chunk-GWMLIF3C.js} +1 -1
  11. package/dist/{chunk-3L6EZQ6P.js → chunk-NFJE5EJG.js} +1 -1
  12. package/dist/{chunk-ICJH36K4.js → chunk-YUXHILXY.js} +1 -1
  13. package/dist/components/ui/Loading.d.ts +8 -1
  14. package/dist/components/ui/Loading.d.ts.map +1 -1
  15. package/dist/components/ui/index.d.ts +1 -0
  16. package/dist/components/ui/index.d.ts.map +1 -1
  17. package/dist/form.js +797 -286
  18. package/dist/gql/schema-types.d.ts +3 -2
  19. package/dist/gql/schema-types.d.ts.map +1 -1
  20. package/dist/hooks.js +3 -3
  21. package/dist/modal.js +5 -5
  22. package/dist/modules/accounts.js +1 -1
  23. package/dist/modules/assortment.js +1 -1
  24. package/dist/modules/country.js +1 -1
  25. package/dist/modules/currency.js +1 -1
  26. package/dist/modules/delivery-provider.js +1 -1
  27. package/dist/modules/enrollment.js +1 -1
  28. package/dist/modules/event.js +1 -1
  29. package/dist/modules/filter.js +1 -1
  30. package/dist/modules/language.js +1 -1
  31. package/dist/modules/order.js +1 -1
  32. package/dist/modules/payment-providers.js +1 -1
  33. package/dist/modules/product-review.js +1 -1
  34. package/dist/modules/product.js +5 -5
  35. package/dist/modules/quotation.js +1 -1
  36. package/dist/modules/token.js +1 -1
  37. package/dist/modules/warehousing-providers.js +1 -1
  38. package/dist/modules/work.js +1 -1
  39. package/dist/plugins.js +1 -1
  40. package/dist/providers.js +5 -5
  41. package/dist/shims/admin-ui-plugins.js +1 -1
  42. package/dist/shims/apollo-client-react.js +1 -1
  43. package/dist/shims/apollo-client.js +1 -1
  44. package/dist/shims/next-head.js +1 -1
  45. package/dist/shims/next-image.js +1 -1
  46. package/dist/shims/next-link.js +1 -1
  47. package/dist/shims/next-router.js +1 -1
  48. package/dist/shims/react-dom-client.js +1 -1
  49. package/dist/shims/react-dom.js +1 -1
  50. package/dist/shims/react-hook-form.js +1 -1
  51. package/dist/shims/react-intl.js +1 -1
  52. package/dist/shims/react-jsx-runtime.js +1 -1
  53. package/dist/shims/react-toastify.js +1 -1
  54. package/dist/shims/react.js +1 -1
  55. package/dist/theme.js +1 -1
  56. package/dist/ui.js +3933 -3416
  57. package/out/403/index.html +3 -3
  58. package/out/404/index.html +3 -3
  59. package/out/404.html +3 -3
  60. package/out/423/index.html +3 -3
  61. package/out/500/index.html +3 -3
  62. package/out/_next/static/bg3Z_ZBjStiTvJAHlsPDE/_buildManifest.js +262 -0
  63. package/out/_next/static/chunks/0-kvzk5p0hp-4.js +11 -0
  64. package/out/_next/static/chunks/0-nzk-g6k41e-.js +119 -0
  65. package/out/_next/static/chunks/00wlebfe9j80r.js +24 -0
  66. package/out/_next/static/chunks/01isyk4v59s_4.js +5 -0
  67. package/out/_next/static/chunks/01otzjqxk372n.js +1 -0
  68. package/out/_next/static/chunks/03x_mgpai_kbn.js +1 -0
  69. package/out/_next/static/chunks/04327_1fq5i7-.js +9 -0
  70. package/out/_next/static/chunks/04_r4qnsjmy81.js +4 -0
  71. package/out/_next/static/chunks/04egfa7kckou_.js +165 -0
  72. package/out/_next/static/chunks/05474mknnr_tw.js +4 -0
  73. package/out/_next/static/chunks/{2ajr0rk0_yax6.js → 06kqbwwnuu3te.js} +1 -1
  74. package/out/_next/static/chunks/0728622u98g6r.js +1 -0
  75. package/out/_next/static/chunks/09irjy-7k1922.js +1 -0
  76. package/out/_next/static/chunks/0_3suta3t3lus.js +5 -0
  77. package/out/_next/static/chunks/0_a5fzdztv84p.js +272 -0
  78. package/out/_next/static/chunks/0_ppdn6x6ci0v.js +31 -0
  79. package/out/_next/static/chunks/0br42_xli8-2x.js +6 -0
  80. package/out/_next/static/chunks/0cdk-eqghrgee.js +5 -0
  81. package/out/_next/static/chunks/0d54jo566j9ka.js +12 -0
  82. package/out/_next/static/chunks/0gfia1t8drmnx.js +182 -0
  83. package/out/_next/static/chunks/0gwd6ju8j_bwr.js +39 -0
  84. package/out/_next/static/chunks/{0_pn7w49dpkak.js → 0hv3x0mo1tt7i.js} +2 -2
  85. package/out/_next/static/chunks/0i481ym5-ss1t.js +5 -0
  86. package/out/_next/static/chunks/0iohwbogpxe5r.js +1 -0
  87. package/out/_next/static/chunks/0j46qnxaxeqk_.js +1 -0
  88. package/out/_next/static/chunks/{1jmdpa0tc5puj.js → 0mcu2o1ir2t_w.js} +3 -3
  89. package/out/_next/static/chunks/0o4aj3bm49d_h.js +61 -0
  90. package/out/_next/static/chunks/0op3htrvd-ix6.js +5 -0
  91. package/out/_next/static/chunks/0p55j-ysba0wq.js +63 -0
  92. package/out/_next/static/chunks/0qv2nce7okzy5.js +103 -0
  93. package/out/_next/static/chunks/0rrhyxuk32t3n.js +95 -0
  94. package/out/_next/static/chunks/0rt4le6syjqdj.js +21 -0
  95. package/out/_next/static/chunks/0s2jvi6_qj0lc.js +16 -0
  96. package/out/_next/static/chunks/0uef4ugmc_g10.js +1 -0
  97. package/out/_next/static/chunks/0v1tb34y7e1y4.js +5 -0
  98. package/out/_next/static/chunks/0w9d4swf95hvu.js +33 -0
  99. package/out/_next/static/chunks/0we1tw4xvdb7o.js +7 -0
  100. package/out/_next/static/chunks/0zlzflyq18hhy.js +4 -0
  101. package/out/_next/static/chunks/0zqdvl0b4w5nc.js +7 -0
  102. package/out/_next/static/chunks/1-wbp_4f-c4-3.js +837 -0
  103. package/out/_next/static/chunks/11vnr4kb9qkjr.js +1 -0
  104. package/out/_next/static/chunks/12cy_5m_0fj96.js +44 -0
  105. package/out/_next/static/chunks/131uuhqexo4si.js +4 -0
  106. package/out/_next/static/chunks/14eqp21pspjud.js +234 -0
  107. package/out/_next/static/chunks/14jd75j8ij4u2.js +3 -0
  108. package/out/_next/static/chunks/153-_av1r1ssb.js +4 -0
  109. package/out/_next/static/chunks/{0m73vd78oga92.js → 157ndq6b9jcvv.js} +11 -11
  110. package/out/_next/static/chunks/177p92k5pdloo.js +1 -0
  111. package/out/_next/static/chunks/19-1z6h5eeq_w.js +134 -0
  112. package/out/_next/static/chunks/1bxznw06g-5u2.js +5 -0
  113. package/out/_next/static/chunks/1bypzyw5fs3w2.js +59 -0
  114. package/out/_next/static/chunks/1cz2fp89ssu5d.js +4 -0
  115. package/out/_next/static/chunks/1e2jykfql801f.js +16 -0
  116. package/out/_next/static/chunks/1eokbzdgdicpa.js +33 -0
  117. package/out/_next/static/chunks/1f0t23r6y0hni.js +1 -0
  118. package/out/_next/static/chunks/1fehej_7rgmmo.js +5 -0
  119. package/out/_next/static/chunks/1gl4h7w9t850f.js +1 -0
  120. package/out/_next/static/chunks/1gv0k-w7m83om.js +41 -0
  121. package/out/_next/static/chunks/1hzt0aoixrv4_.js +7 -0
  122. package/out/_next/static/chunks/1ia6hdgf7pj9y.js +174 -0
  123. package/out/_next/static/chunks/1in8spfokcjsp.js +8 -0
  124. package/out/_next/static/chunks/1j2gw9gyg8j80.js +5 -0
  125. package/out/_next/static/chunks/1k06h8wbfrx_v.js +5 -0
  126. package/out/_next/static/chunks/1kdcu-0jkya-b.js +61 -0
  127. package/out/_next/static/chunks/1msc4qrgaanh7.js +43 -0
  128. package/out/_next/static/chunks/{1iamjw8qh1m4o.js → 1mx0p6r-9c5u_.js} +1 -1
  129. package/out/_next/static/chunks/1oqc8etm-romv.js +1 -0
  130. package/out/_next/static/chunks/1p5lt4tkyouxz.js +4 -0
  131. package/out/_next/static/chunks/1q7wxp4rlhy0x.js +12 -0
  132. package/out/_next/static/chunks/1r61kgm2ct0nf.js +74 -0
  133. package/out/_next/static/chunks/1rmlm4404fsge.js +15 -0
  134. package/out/_next/static/chunks/1s3ool53utm9o.js +39 -0
  135. package/out/_next/static/chunks/1sc2ug6_szd_d.js +2 -0
  136. package/out/_next/static/chunks/{12yd8t4k6c0t1.js → 1t8jj0-6g8uyd.js} +1 -1
  137. package/out/_next/static/chunks/1tbd6m-xvx0um.js +353 -0
  138. package/out/_next/static/chunks/1th1-x1szvnq8.js +5 -0
  139. package/out/_next/static/chunks/1tosw188dr9d6.js +44 -0
  140. package/out/_next/static/chunks/1tw97cvdosb89.js +5 -0
  141. package/out/_next/static/chunks/1ubmbegreszhk.js +1 -0
  142. package/out/_next/static/chunks/{43uqmej6-s4am.js → 1ug1ie2lrhi0a.js} +3 -3
  143. package/out/_next/static/chunks/1uw7hr3o4w5cj.js +8 -0
  144. package/out/_next/static/chunks/1vzs8hvrsoslf.js +5 -0
  145. package/out/_next/static/chunks/1w6gc_cygbi6h.js +5 -0
  146. package/out/_next/static/chunks/1xybsisfyvqrj.js +115 -0
  147. package/out/_next/static/chunks/1yvl8l5yx1rj8.js +4 -0
  148. package/out/_next/static/chunks/{3dcwbsiechj8e.js → 1z-etrje5tsj6.js} +3 -3
  149. package/out/_next/static/chunks/1z1d11slpalrq.js +4 -0
  150. package/out/_next/static/chunks/1zdral15la_p7.js +99 -0
  151. package/out/_next/static/chunks/2-qo63s4vlxol.js +156 -0
  152. package/out/_next/static/chunks/20au-bdji0nu2.js +14 -0
  153. package/out/_next/static/chunks/21zghy5-42i1e.js +1 -0
  154. package/out/_next/static/chunks/22duvsj-priip.js +7 -0
  155. package/out/_next/static/chunks/22rdge7enz4nd.js +12 -0
  156. package/out/_next/static/chunks/{3m_9ozv0orvze.js → 249b4cg2ev597.js} +3 -3
  157. package/out/_next/static/chunks/24caedynuzux0.js +5 -0
  158. package/out/_next/static/chunks/25ite4-jpq_mo.js +4 -0
  159. package/out/_next/static/chunks/25vdihxswn7dy.js +1 -0
  160. package/out/_next/static/chunks/26guwpx1_pkxv.js +1 -0
  161. package/out/_next/static/chunks/28o6402k4vuky.js +11 -0
  162. package/out/_next/static/chunks/29x7cj-318eaa.js +1 -0
  163. package/out/_next/static/chunks/2_0v0fw6x71zy.js +46 -0
  164. package/out/_next/static/chunks/2a9dpzjx5mfjp.js +4 -0
  165. package/out/_next/static/chunks/2apnv1hcv-4zc.js +23 -0
  166. package/out/_next/static/chunks/2b4k5t_myq-pa.js +1 -0
  167. package/out/_next/static/chunks/2bugi3kot5jtu.js +1 -0
  168. package/out/_next/static/chunks/2bxdh-td1el8z.js +5 -0
  169. package/out/_next/static/chunks/2dz0_3jf4m9cy.js +31 -0
  170. package/out/_next/static/chunks/2ege1545af18d.js +4 -0
  171. package/out/_next/static/chunks/2erqawjj0rnih.js +117 -0
  172. package/out/_next/static/chunks/2gfzt_fdr-h96.js +81 -0
  173. package/out/_next/static/chunks/2grm6dtosrvoq.js +1 -0
  174. package/out/_next/static/chunks/2hc3d38gb0q-v.js +1 -0
  175. package/out/_next/static/chunks/2hci18oosfv5d.js +5 -0
  176. package/out/_next/static/chunks/2imf3_f1_ex86.js +1 -0
  177. package/out/_next/static/chunks/{3fpgg_wy6j2ph.js → 2ipcn3vy6d4_6.js} +1 -1
  178. package/out/_next/static/chunks/2iwst7mjldlcz.js +1 -0
  179. package/out/_next/static/chunks/2ja0dztzyw8zw.js +1 -0
  180. package/out/_next/static/chunks/2ja1--2x_gs49.js +83 -0
  181. package/out/_next/static/chunks/2lec5u8obskt6.js +5 -0
  182. package/out/_next/static/chunks/2m38nntt3z8zi.js +103 -0
  183. package/out/_next/static/chunks/2pogx3xggqd8y.js +1 -0
  184. package/out/_next/static/chunks/2q988j4vovsiy.js +8 -0
  185. package/out/_next/static/chunks/2s-0q8i8lr2p2.js +5 -0
  186. package/out/_next/static/chunks/{0a_gulnq-c7to.js → 2u64ldp2xfy8a.js} +7 -7
  187. package/out/_next/static/chunks/2ud5j0_nqocf4.js +5 -0
  188. package/out/_next/static/chunks/2uo6puoi0y082.js +5 -0
  189. package/out/_next/static/chunks/2w3z7kqh6nbmw.js +23 -0
  190. package/out/_next/static/chunks/2y11qf38baxpu.js +14 -0
  191. package/out/_next/static/chunks/{2yw5sk06gdixu.js → 2y8uau15r3p-o.js} +1 -1
  192. package/out/_next/static/chunks/2zb-xmda5rbn0.js +1 -0
  193. package/out/_next/static/chunks/2zsvxbghbsuz1.js +4 -0
  194. package/out/_next/static/chunks/{0s6u_6w75ggbw.js → 3205eg3ochzp4.js} +7 -7
  195. package/out/_next/static/chunks/32g5gxee1kcdc.js +28 -0
  196. package/out/_next/static/chunks/32whi9clpxjd0.js +5 -0
  197. package/out/_next/static/chunks/3368kg846t33d.js +57 -0
  198. package/out/_next/static/chunks/33oz-znvi5-m6.js +1 -0
  199. package/out/_next/static/chunks/345s7967cwd02.js +5 -0
  200. package/out/_next/static/chunks/34wf3lz_fft3k.js +2 -0
  201. package/out/_next/static/chunks/{3btkj1_irjkq7.js → 36x7q29atus_r.js} +6 -6
  202. package/out/_next/static/chunks/37jjn1wguhj-a.js +5 -0
  203. package/out/_next/static/chunks/{1so6ouxrq_ffa.js → 393--hagnnm97.js} +3 -3
  204. package/out/_next/static/chunks/39moagn46hde9.js +5 -0
  205. package/out/_next/static/chunks/3_0q-dmk8few_.css +1 -0
  206. package/out/_next/static/chunks/3_adkt8r_brx4.js +165 -0
  207. package/out/_next/static/chunks/3b1kt-r_75q1a.js +43 -0
  208. package/out/_next/static/chunks/3e38rrs6dszgt.js +8 -0
  209. package/out/_next/static/chunks/{01xy3u9ybz9ts.js → 3e7d8sb4289js.js} +2 -2
  210. package/out/_next/static/chunks/3ek1bahoqa_ll.js +5 -0
  211. package/out/_next/static/chunks/3ek680kdzjdr7.js +1 -0
  212. package/out/_next/static/chunks/3eth7s2-06yuz.js +1 -0
  213. package/out/_next/static/chunks/3exy4ii5maq4x.js +54 -0
  214. package/out/_next/static/chunks/3fevbt4ysloo8.js +8 -0
  215. package/out/_next/static/chunks/3fu072xwkf88o.js +6 -0
  216. package/out/_next/static/chunks/3h6a3clw5m5ro.js +4 -0
  217. package/out/_next/static/chunks/3hmoy4f23y1s4.js +147 -0
  218. package/out/_next/static/chunks/3i4_3b36nutw7.js +33 -0
  219. package/out/_next/static/chunks/3jfe0uesrzz7a.js +1 -0
  220. package/out/_next/static/chunks/3k01tdsm6l20w.js +54 -0
  221. package/out/_next/static/chunks/3lr6hkso67d68.js +6 -0
  222. package/out/_next/static/chunks/3lzin6_25n8rs.js +30 -0
  223. package/out/_next/static/chunks/3nrrzhhoy8amt.js +4 -0
  224. package/out/_next/static/chunks/3o-h2po9z09dk.js +4 -0
  225. package/out/_next/static/chunks/3onharcadlou0.js +327 -0
  226. package/out/_next/static/chunks/3pls-kicv4xu9.js +175 -0
  227. package/out/_next/static/chunks/3t48n1yk76zoa.js +1 -0
  228. package/out/_next/static/chunks/3t_520l4ihlg3.js +54 -0
  229. package/out/_next/static/chunks/3tg_clsx6ux4o.js +1 -0
  230. package/out/_next/static/chunks/3ttz1zgoq3xmp.js +1 -0
  231. package/out/_next/static/chunks/3uekb_s0jaboj.js +1 -0
  232. package/out/_next/static/chunks/3ujdligrod612.js +5 -0
  233. package/out/_next/static/chunks/3www97fxyknos.js +4 -0
  234. package/out/_next/static/chunks/3x_gia2m5w9_l.js +147 -0
  235. package/out/_next/static/chunks/{3j25u7rzawm9f.js → 3xs_undkbcqp7.js} +5 -5
  236. package/out/_next/static/chunks/3yktizlgzr6vc.js +4 -0
  237. package/out/_next/static/chunks/3ytp87o76hzmx.js +100 -0
  238. package/out/_next/static/chunks/40kvu3lk3s9h2.js +276 -0
  239. package/out/_next/static/chunks/41c4n9whpyrjc.js +7 -0
  240. package/out/_next/static/chunks/42dygj7ul4k54.js +33 -0
  241. package/out/_next/static/chunks/449x6nw2kd7l6.js +119 -0
  242. package/out/_next/static/chunks/44b7_q6pkf1k9.js +5 -0
  243. package/out/_next/static/chunks/44qc0zn0tudui.js +2 -0
  244. package/out/_next/static/chunks/45c05mbjow5wz.js +4 -0
  245. package/out/_next/static/chunks/{turbopack-2c3mg3r-05n1w.js → turbopack-077hmtqrhcoji.js} +1 -1
  246. package/out/_offline/index.html +3 -3
  247. package/out/account/forgot-password/index.html +3 -3
  248. package/out/account/index.html +3 -3
  249. package/out/assortments/AssortmentDetailPage/index.html +3 -3
  250. package/out/assortments/index.html +3 -3
  251. package/out/assortments/new/index.html +3 -3
  252. package/out/copilot/index.html +3 -3
  253. package/out/country/CountryDetailPage/index.html +3 -3
  254. package/out/country/index.html +3 -3
  255. package/out/country/new/index.html +3 -3
  256. package/out/currency/CurrencyDetailPage/index.html +3 -3
  257. package/out/currency/index.html +3 -3
  258. package/out/currency/new/index.html +3 -3
  259. package/out/delivery-provider/DeliveryProviderDetailPage/index.html +3 -3
  260. package/out/delivery-provider/index.html +3 -3
  261. package/out/delivery-provider/new/index.html +3 -3
  262. package/out/enrollments/EnrollmentDetailPage/index.html +3 -3
  263. package/out/enrollments/index.html +3 -3
  264. package/out/events/EventDetailPage/index.html +3 -3
  265. package/out/events/index.html +3 -3
  266. package/out/exports/index.html +3 -3
  267. package/out/ext/[[...slug]]/index.html +3 -3
  268. package/out/external/index.html +3 -3
  269. package/out/filters/FilterDetailPage/index.html +3 -3
  270. package/out/filters/index.html +3 -3
  271. package/out/filters/new/index.html +3 -3
  272. package/out/index.html +3 -3
  273. package/out/install/index.html +3 -3
  274. package/out/language/LanguageDetailPage/index.html +3 -3
  275. package/out/language/index.html +3 -3
  276. package/out/language/new/index.html +3 -3
  277. package/out/log-in/index.html +3 -3
  278. package/out/orders/OrderDetailPage/index.html +3 -3
  279. package/out/orders/index.html +3 -3
  280. package/out/payment-provider/PaymentProviderDetailPage/index.html +3 -3
  281. package/out/payment-provider/index.html +3 -3
  282. package/out/payment-provider/new/index.html +3 -3
  283. package/out/products/ProductDetailPage/index.html +3 -3
  284. package/out/products/index.html +3 -3
  285. package/out/products/new/index.html +3 -3
  286. package/out/quotations/QuotationDetailPage/index.html +3 -3
  287. package/out/quotations/index.html +3 -3
  288. package/out/reset-password/index.html +3 -3
  289. package/out/sign-up/index.html +3 -3
  290. package/out/styleguide/index.html +3 -3
  291. package/out/tokens/TokenDetailPage/index.html +3 -3
  292. package/out/tokens/index.html +3 -3
  293. package/out/users/UserDetailPage/index.html +3 -3
  294. package/out/users/index.html +3 -3
  295. package/out/users/new/index.html +3 -3
  296. package/out/verify-email/index.html +3 -3
  297. package/out/warehousing-provider/WarehousingProviderDetailPage/index.html +3 -3
  298. package/out/warehousing-provider/index.html +3 -3
  299. package/out/warehousing-provider/new/index.html +3 -3
  300. package/out/works/WorkDetailPage/index.html +3 -3
  301. package/out/works/WorkQueueListView/index.html +3 -3
  302. package/out/works/index.html +3 -3
  303. package/out/works/management/index.html +3 -3
  304. package/package.json +10 -10
  305. package/src/modules/accounts/hooks/logOut.ts +26 -0
  306. package/src/modules/accounts/hooks/useAddEmail.ts +34 -0
  307. package/src/modules/accounts/hooks/useAddWeb3Address.ts +38 -0
  308. package/src/modules/accounts/hooks/useAddWebAuthnCredentials.ts +48 -0
  309. package/src/modules/accounts/hooks/useBulkUserOperations.ts +91 -0
  310. package/src/modules/accounts/hooks/useChangePassword.ts +36 -0
  311. package/src/modules/accounts/hooks/useCreateUser.ts +74 -0
  312. package/src/modules/accounts/hooks/useCreateWebAuthnCredentialCreationOptions.ts +31 -0
  313. package/src/modules/accounts/hooks/useCreateWebAuthnCredentialRequestOptions.ts +30 -0
  314. package/src/modules/accounts/hooks/useCurrentUser.ts +44 -0
  315. package/src/modules/accounts/hooks/useDeleteUser.ts +26 -0
  316. package/src/modules/accounts/hooks/useEnrollUser.ts +48 -0
  317. package/src/modules/accounts/hooks/useForgotPassword.ts +35 -0
  318. package/src/modules/accounts/hooks/useGenerateLoginCredentials.ts +80 -0
  319. package/src/modules/accounts/hooks/useGenerateWebAuthCredentials.ts +102 -0
  320. package/src/modules/accounts/hooks/useLoginWithPassword.ts +65 -0
  321. package/src/modules/accounts/hooks/useLoginWithWebAuthn.ts +38 -0
  322. package/src/modules/accounts/hooks/useLogoutAllSessions.ts +27 -0
  323. package/src/modules/accounts/hooks/useRemoveBookmark.ts +36 -0
  324. package/src/modules/accounts/hooks/useRemoveEmail.ts +40 -0
  325. package/src/modules/accounts/hooks/useRemoveWeb3Address.ts +38 -0
  326. package/src/modules/accounts/hooks/useRemoveWebAuthCredentials.ts +36 -0
  327. package/src/modules/accounts/hooks/useResetPassword.ts +46 -0
  328. package/src/modules/accounts/hooks/useSendVerificationEmail.ts +35 -0
  329. package/src/modules/accounts/hooks/useSetPassword.ts +38 -0
  330. package/src/modules/accounts/hooks/useSetRoles.ts +40 -0
  331. package/src/modules/accounts/hooks/useSetUserTags.ts +48 -0
  332. package/src/modules/accounts/hooks/useSetUsername.ts +40 -0
  333. package/src/modules/accounts/hooks/useUpdateUserAvatar.ts +49 -0
  334. package/src/modules/accounts/hooks/useUpdateUserProfile.ts +40 -0
  335. package/src/modules/accounts/hooks/useUser.ts +201 -0
  336. package/src/modules/accounts/hooks/useUserBookmarks.ts +51 -0
  337. package/src/modules/accounts/hooks/useUserExport.ts +107 -0
  338. package/src/modules/accounts/hooks/useUserWebAuthnCredentials.ts +44 -0
  339. package/src/modules/accounts/hooks/useUsers.ts +82 -0
  340. package/src/modules/accounts/hooks/useUsersCount.ts +50 -0
  341. package/src/modules/accounts/hooks/useValidateEmailVerificationToken.ts +34 -0
  342. package/src/modules/accounts/hooks/useValidateResetPasswordToken.ts +35 -0
  343. package/src/modules/accounts/hooks/useVerifyEmail.ts +41 -0
  344. package/src/modules/accounts/hooks/useVerifyWeb3Address.ts +40 -0
  345. package/src/modules/assortment/fragments/AssortmentChildrenFragment.ts +16 -0
  346. package/src/modules/assortment/fragments/AssortmentFragment.ts +31 -0
  347. package/src/modules/assortment/fragments/AssortmentLinkFragment.ts +18 -0
  348. package/src/modules/assortment/fragments/AssortmentMediaFragment.ts +19 -0
  349. package/src/modules/assortment/fragments/AssortmentMediaTextsFragment.ts +12 -0
  350. package/src/modules/assortment/fragments/AssortmentTextsFragment.ts +14 -0
  351. package/src/modules/assortment/hooks/useAddAssortmentFilter.ts +46 -0
  352. package/src/modules/assortment/hooks/useAddAssortmentLink.ts +46 -0
  353. package/src/modules/assortment/hooks/useAddAssortmentMedia.ts +52 -0
  354. package/src/modules/assortment/hooks/useAddAssortmentProduct.ts +46 -0
  355. package/src/modules/assortment/hooks/useAssortment.ts +56 -0
  356. package/src/modules/assortment/hooks/useAssortmentChildren.ts +58 -0
  357. package/src/modules/assortment/hooks/useAssortmentExport.ts +60 -0
  358. package/src/modules/assortment/hooks/useAssortmentFilters.ts +51 -0
  359. package/src/modules/assortment/hooks/useAssortmentLinks.ts +54 -0
  360. package/src/modules/assortment/hooks/useAssortmentMedia.ts +57 -0
  361. package/src/modules/assortment/hooks/useAssortmentPaths.ts +39 -0
  362. package/src/modules/assortment/hooks/useAssortmentProducts.ts +62 -0
  363. package/src/modules/assortment/hooks/useAssortments.ts +103 -0
  364. package/src/modules/assortment/hooks/useAssortmentsCount.ts +51 -0
  365. package/src/modules/assortment/hooks/useBulkAssortmentOperations.ts +100 -0
  366. package/src/modules/assortment/hooks/useCreateAssortment.ts +55 -0
  367. package/src/modules/assortment/hooks/usePrepareAssortmentImport.ts +211 -0
  368. package/src/modules/assortment/hooks/useRemoveAssortment.ts +36 -0
  369. package/src/modules/assortment/hooks/useRemoveAssortmentFilter.ts +36 -0
  370. package/src/modules/assortment/hooks/useRemoveAssortmentLink.ts +36 -0
  371. package/src/modules/assortment/hooks/useRemoveAssortmentMedia.ts +36 -0
  372. package/src/modules/assortment/hooks/useRemoveAssortmentProduct.ts +36 -0
  373. package/src/modules/assortment/hooks/useReorderAssortmentFilters.ts +39 -0
  374. package/src/modules/assortment/hooks/useReorderAssortmentLinks.ts +37 -0
  375. package/src/modules/assortment/hooks/useReorderAssortmentMedia.ts +37 -0
  376. package/src/modules/assortment/hooks/useReorderAssortmentProducts.ts +39 -0
  377. package/src/modules/assortment/hooks/useTranslatedAssortmentMediaTexts.ts +41 -0
  378. package/src/modules/assortment/hooks/useTranslatedAssortmentTexts.ts +40 -0
  379. package/src/modules/assortment/hooks/useUpdateAssortment.ts +43 -0
  380. package/src/modules/assortment/hooks/useUpdateAssortmentMediaTexts.ts +45 -0
  381. package/src/modules/assortment/hooks/useUpdateAssortmentTexts.ts +42 -0
  382. package/src/modules/common/fragments/AddressFragment.ts +16 -0
  383. package/src/modules/common/hooks/useApp.ts +11 -0
  384. package/src/modules/common/hooks/useBulkActionConfirmation.tsx +68 -0
  385. package/src/modules/common/hooks/useBulkResultHandler.ts +83 -0
  386. package/src/modules/common/hooks/useBulkSelection.ts +86 -0
  387. package/src/modules/common/hooks/useCSVExport.ts +94 -0
  388. package/src/modules/common/hooks/useCSVImport.ts +69 -0
  389. package/src/modules/common/hooks/useChatEndpointChecker.ts +25 -0
  390. package/src/modules/common/hooks/useConfirmMediaUpload.ts +45 -0
  391. package/src/modules/common/hooks/useDashboardMetrics.ts +42 -0
  392. package/src/modules/common/hooks/useLocalStorage.ts +34 -0
  393. package/src/modules/common/hooks/useOrderAnalytics.ts +139 -0
  394. package/src/modules/common/hooks/useOrderItemsAnalytics.ts +107 -0
  395. package/src/modules/common/hooks/useOutsideClick.ts +29 -0
  396. package/src/modules/common/hooks/usePortal.ts +54 -0
  397. package/src/modules/common/hooks/useScrollRestoration.ts +123 -0
  398. package/src/modules/common/hooks/useShopConfiguration.ts +83 -0
  399. package/src/modules/common/hooks/useShopInfo.ts +65 -0
  400. package/src/modules/common/hooks/useStatusTypes.ts +29 -0
  401. package/src/modules/common/hooks/useSystemRoles.ts +29 -0
  402. package/src/modules/common/hooks/useTheme.ts +14 -0
  403. package/src/modules/copilot/hooks/useAvailableTools.ts +92 -0
  404. package/src/modules/copilot/hooks/useChatManager.ts +169 -0
  405. package/src/modules/copilot/hooks/useToolTextNormalizer.ts +84 -0
  406. package/src/modules/country/fragments/CountryFragment.ts +17 -0
  407. package/src/modules/country/hooks/useCountries.ts +66 -0
  408. package/src/modules/country/hooks/useCountry.ts +34 -0
  409. package/src/modules/country/hooks/useCreateCountry.ts +41 -0
  410. package/src/modules/country/hooks/useRemoveCountry.ts +38 -0
  411. package/src/modules/country/hooks/useUpdateCountry.ts +42 -0
  412. package/src/modules/currency/fragments/CurrencyFragment.ts +13 -0
  413. package/src/modules/currency/hooks/useCreateCurrency.ts +48 -0
  414. package/src/modules/currency/hooks/useCurrencies.ts +68 -0
  415. package/src/modules/currency/hooks/useCurrency.ts +34 -0
  416. package/src/modules/currency/hooks/useRemoveCurrency.ts +38 -0
  417. package/src/modules/currency/hooks/useUpdateCurrency.ts +47 -0
  418. package/src/modules/delivery-provider/hooks/useCreateDeliveryProvider.ts +67 -0
  419. package/src/modules/delivery-provider/hooks/useDeliveryInterfacesByType.ts +38 -0
  420. package/src/modules/delivery-provider/hooks/useDeliveryProvider.ts +60 -0
  421. package/src/modules/delivery-provider/hooks/useDeliveryProviderTypes.ts +34 -0
  422. package/src/modules/delivery-provider/hooks/useDeliveryProviders.ts +59 -0
  423. package/src/modules/delivery-provider/hooks/useRemoveDeliveryProvider.ts +38 -0
  424. package/src/modules/delivery-provider/hooks/useUpdateDeliveryProvider.ts +68 -0
  425. package/src/modules/enrollment/fragments/EnrollmentDetailFragment.ts +110 -0
  426. package/src/modules/enrollment/fragments/EnrollmentFragment.ts +66 -0
  427. package/src/modules/enrollment/hooks/useActivateEnrollment.ts +36 -0
  428. package/src/modules/enrollment/hooks/useEnrollment.ts +39 -0
  429. package/src/modules/enrollment/hooks/useEnrollments.ts +70 -0
  430. package/src/modules/enrollment/hooks/useSendEnrollmentEmail.ts +35 -0
  431. package/src/modules/enrollment/hooks/useSuspendEnrollment.ts +29 -0
  432. package/src/modules/enrollment/hooks/useTerminateEnrollment.ts +36 -0
  433. package/src/modules/enrollment/hooks/useUpdateEnrollmentPlan.ts +45 -0
  434. package/src/modules/enrollment/hooks/useUserEnrollments.ts +61 -0
  435. package/src/modules/event/fragments/EventFragment.ts +12 -0
  436. package/src/modules/event/hooks/useEvent.ts +32 -0
  437. package/src/modules/event/hooks/useEventTypes.ts +29 -0
  438. package/src/modules/event/hooks/useEvents.ts +77 -0
  439. package/src/modules/filter/fragments/FilterFragment.ts +24 -0
  440. package/src/modules/filter/fragments/FilterOptionFragment.ts +16 -0
  441. package/src/modules/filter/fragments/FilterTextsFragment.ts +12 -0
  442. package/src/modules/filter/hooks/useBulkFilterOperations.ts +59 -0
  443. package/src/modules/filter/hooks/useCreateFilter.ts +44 -0
  444. package/src/modules/filter/hooks/useCreateFilterOption.ts +42 -0
  445. package/src/modules/filter/hooks/useFilter.ts +44 -0
  446. package/src/modules/filter/hooks/useFilterExport.ts +35 -0
  447. package/src/modules/filter/hooks/useFilterOptions.ts +40 -0
  448. package/src/modules/filter/hooks/useFilterTypes.ts +34 -0
  449. package/src/modules/filter/hooks/useFilters.ts +78 -0
  450. package/src/modules/filter/hooks/useFiltersCount.ts +37 -0
  451. package/src/modules/filter/hooks/usePrepareFilterImport.ts +142 -0
  452. package/src/modules/filter/hooks/useRemoveFilter.ts +34 -0
  453. package/src/modules/filter/hooks/useRemoveFilterOption.ts +40 -0
  454. package/src/modules/filter/hooks/useTranslatedFilterTexts.ts +40 -0
  455. package/src/modules/filter/hooks/useUpdateFilter.ts +38 -0
  456. package/src/modules/filter/hooks/useUpdateFilterTexts.ts +48 -0
  457. package/src/modules/forms/hooks/useField.ts +151 -0
  458. package/src/modules/forms/hooks/useForm.ts +210 -0
  459. package/src/modules/forms/hooks/useFormContext.ts +7 -0
  460. package/src/modules/language/fragments/LanguageFragment.ts +13 -0
  461. package/src/modules/language/hooks/useCreateLanguage.ts +40 -0
  462. package/src/modules/language/hooks/useLanguage.ts +34 -0
  463. package/src/modules/language/hooks/useLanguages.ts +64 -0
  464. package/src/modules/language/hooks/useRemoveLanguage.ts +38 -0
  465. package/src/modules/language/hooks/useUpdateLanguage.ts +42 -0
  466. package/src/modules/modal/hooks/useModal.ts +8 -0
  467. package/src/modules/order/fragments/OrderDetailFragment.ts +255 -0
  468. package/src/modules/order/fragments/OrderFragment.ts +42 -0
  469. package/src/modules/order/hooks/useConfirmOrder.ts +36 -0
  470. package/src/modules/order/hooks/useDeliverOrder.ts +36 -0
  471. package/src/modules/order/hooks/useOrder.ts +35 -0
  472. package/src/modules/order/hooks/useOrders.ts +105 -0
  473. package/src/modules/order/hooks/usePayOrder.ts +36 -0
  474. package/src/modules/order/hooks/useRejectOrder.ts +36 -0
  475. package/src/modules/order/hooks/useRemoveOrder.ts +36 -0
  476. package/src/modules/order/hooks/useUserCart.ts +71 -0
  477. package/src/modules/order/hooks/useUserOrders.ts +65 -0
  478. package/src/modules/payment-providers/fragments/PaymentProviderFragment.ts +21 -0
  479. package/src/modules/payment-providers/hooks/useCreatePaymentProvider.ts +43 -0
  480. package/src/modules/payment-providers/hooks/usePaymentInterfacesByType.ts +38 -0
  481. package/src/modules/payment-providers/hooks/usePaymentProvider.ts +39 -0
  482. package/src/modules/payment-providers/hooks/usePaymentProviderTypes.ts +34 -0
  483. package/src/modules/payment-providers/hooks/usePaymentProviders.ts +42 -0
  484. package/src/modules/payment-providers/hooks/useRemovePaymentProvider.ts +38 -0
  485. package/src/modules/payment-providers/hooks/useUpdatePaymentProvider.ts +47 -0
  486. package/src/modules/product/fragments/ProductAssignmentFragment.ts +39 -0
  487. package/src/modules/product/fragments/ProductBriefFragment.ts +57 -0
  488. package/src/modules/product/fragments/ProductCatalogPriceFragment.ts +23 -0
  489. package/src/modules/product/fragments/ProductDetailFragment.ts +51 -0
  490. package/src/modules/product/fragments/ProductDimensionFragment.ts +12 -0
  491. package/src/modules/product/fragments/ProductMediaFragment.ts +24 -0
  492. package/src/modules/product/fragments/ProductMediaTextsFragment.ts +12 -0
  493. package/src/modules/product/fragments/ProductPlanConfigurationFragment.ts +14 -0
  494. package/src/modules/product/fragments/ProductTextsFragment.ts +17 -0
  495. package/src/modules/product/fragments/ProductVariationFragment.ts +27 -0
  496. package/src/modules/product/fragments/TokenFragment.ts +24 -0
  497. package/src/modules/product/hooks/useAddProductAssignment.ts +46 -0
  498. package/src/modules/product/hooks/useAddProductMedia.ts +47 -0
  499. package/src/modules/product/hooks/useBulkProductOperations.ts +123 -0
  500. package/src/modules/product/hooks/useCreateProduct.ts +72 -0
  501. package/src/modules/product/hooks/useCreateProductBundleItem.ts +40 -0
  502. package/src/modules/product/hooks/useCreateProductVariation.ts +46 -0
  503. package/src/modules/product/hooks/useCreateProductVariationOption.ts +46 -0
  504. package/src/modules/product/hooks/useExportToken.ts +51 -0
  505. package/src/modules/product/hooks/useMenuPosition.ts +34 -0
  506. package/src/modules/product/hooks/usePrepareProductImport.ts +350 -0
  507. package/src/modules/product/hooks/useProduct.ts +93 -0
  508. package/src/modules/product/hooks/useProductAssignments.ts +71 -0
  509. package/src/modules/product/hooks/useProductBundleItems.ts +61 -0
  510. package/src/modules/product/hooks/useProductCatalogPrices.ts +39 -0
  511. package/src/modules/product/hooks/useProductExport.ts +90 -0
  512. package/src/modules/product/hooks/useProductFulfillmentSimulation.ts +137 -0
  513. package/src/modules/product/hooks/useProductMedia.ts +44 -0
  514. package/src/modules/product/hooks/useProductPlan.ts +50 -0
  515. package/src/modules/product/hooks/useProductPlanConfigurationOptions.ts +42 -0
  516. package/src/modules/product/hooks/useProductReviews.ts +62 -0
  517. package/src/modules/product/hooks/useProductSupply.ts +52 -0
  518. package/src/modules/product/hooks/useProductTokenization.ts +51 -0
  519. package/src/modules/product/hooks/useProductVariationTypes.ts +34 -0
  520. package/src/modules/product/hooks/useProductVariations.ts +50 -0
  521. package/src/modules/product/hooks/useProductWarehousing.ts +45 -0
  522. package/src/modules/product/hooks/useProducts.ts +111 -0
  523. package/src/modules/product/hooks/useProductsCount.ts +50 -0
  524. package/src/modules/product/hooks/usePublishProduct.ts +39 -0
  525. package/src/modules/product/hooks/useReOrderProductMedia.ts +36 -0
  526. package/src/modules/product/hooks/useRemoveBundleItem.ts +37 -0
  527. package/src/modules/product/hooks/useRemoveProduct.ts +36 -0
  528. package/src/modules/product/hooks/useRemoveProductAssignment.ts +40 -0
  529. package/src/modules/product/hooks/useRemoveProductMedia.ts +36 -0
  530. package/src/modules/product/hooks/useRemoveProductVariation.ts +36 -0
  531. package/src/modules/product/hooks/useRemoveProductVariationOption.ts +43 -0
  532. package/src/modules/product/hooks/useScaffoldBundleItem.ts +38 -0
  533. package/src/modules/product/hooks/useScaffoldVariationProduct.ts +50 -0
  534. package/src/modules/product/hooks/useSmartContractStandards.ts +34 -0
  535. package/src/modules/product/hooks/useTranslatedProductMediaTexts.ts +39 -0
  536. package/src/modules/product/hooks/useTranslatedProductTexts.ts +42 -0
  537. package/src/modules/product/hooks/useUnPublishProduct.ts +39 -0
  538. package/src/modules/product/hooks/useUpdateProduct.ts +46 -0
  539. package/src/modules/product/hooks/useUpdateProductCommerce.ts +61 -0
  540. package/src/modules/product/hooks/useUpdateProductMediaTexts.ts +42 -0
  541. package/src/modules/product/hooks/useUpdateProductPlan.ts +54 -0
  542. package/src/modules/product/hooks/useUpdateProductSupply.ts +60 -0
  543. package/src/modules/product/hooks/useUpdateProductTexts.ts +39 -0
  544. package/src/modules/product/hooks/useUpdateProductTokenization.ts +51 -0
  545. package/src/modules/product/hooks/useUpdateProductVariationTexts.ts +50 -0
  546. package/src/modules/product/hooks/useUpdateProductWarehousing.ts +50 -0
  547. package/src/modules/product/hooks/useUserTokens.ts +48 -0
  548. package/src/modules/product-review/fragments/ProductReviewDetailFragment.ts +55 -0
  549. package/src/modules/product-review/hooks/useAddProductReviewVote.ts +55 -0
  550. package/src/modules/product-review/hooks/useCreateProductReview.ts +47 -0
  551. package/src/modules/product-review/hooks/useProductReviewsByProductId.ts +70 -0
  552. package/src/modules/product-review/hooks/useRemoveProductReview.ts +38 -0
  553. package/src/modules/product-review/hooks/useRemoveProductReviewVote.ts +43 -0
  554. package/src/modules/product-review/hooks/useUserProductReviews.ts +92 -0
  555. package/src/modules/quotation/fragments/QuotationDetailFragment.ts +70 -0
  556. package/src/modules/quotation/fragments/QuotationFragment.ts +54 -0
  557. package/src/modules/quotation/hooks/useMakeQuotationProposal.ts +41 -0
  558. package/src/modules/quotation/hooks/useQuotation.ts +37 -0
  559. package/src/modules/quotation/hooks/useQuotations.ts +61 -0
  560. package/src/modules/quotation/hooks/useRejectQuotation.ts +41 -0
  561. package/src/modules/quotation/hooks/useUserQuotations.ts +60 -0
  562. package/src/modules/quotation/hooks/useVerifyQuotation.ts +41 -0
  563. package/src/modules/search/fragments/GlobalSearchFragment.ts +20 -0
  564. package/src/modules/search/hooks/useGlobalSearch.ts +168 -0
  565. package/src/modules/token/hooks/useInvalidateTicket.ts +27 -0
  566. package/src/modules/token/hooks/useToken.ts +64 -0
  567. package/src/modules/token/hooks/useTokens.ts +72 -0
  568. package/src/modules/warehousing-providers/fragments/WarehousingProviderFragment.ts +21 -0
  569. package/src/modules/warehousing-providers/hooks/useCreateWarehousingProvider.ts +46 -0
  570. package/src/modules/warehousing-providers/hooks/useRemoveWarehousingProvider.ts +38 -0
  571. package/src/modules/warehousing-providers/hooks/useUpdateWarehousingProvider.ts +47 -0
  572. package/src/modules/warehousing-providers/hooks/useWarehousingInterfacesByType.ts +38 -0
  573. package/src/modules/warehousing-providers/hooks/useWarehousingProvider.ts +39 -0
  574. package/src/modules/warehousing-providers/hooks/useWarehousingProviderTypes.ts +34 -0
  575. package/src/modules/warehousing-providers/hooks/useWarehousingProviders.ts +41 -0
  576. package/src/modules/work/fragments/WorkFragment.ts +24 -0
  577. package/src/modules/work/hooks/useActiveWorkTypes.ts +29 -0
  578. package/src/modules/work/hooks/useAddWork.ts +62 -0
  579. package/src/modules/work/hooks/useAllocateWork.ts +40 -0
  580. package/src/modules/work/hooks/useRecentExports.ts +129 -0
  581. package/src/modules/work/hooks/useRegisteredWorkTypes.ts +27 -0
  582. package/src/modules/work/hooks/useRemoveWork.ts +36 -0
  583. package/src/modules/work/hooks/useWork.ts +42 -0
  584. package/src/modules/work/hooks/useWorkQueue.ts +98 -0
  585. package/src/sdk/README.md +2 -2
  586. package/out/_next/static/BPoacQET3TJr2q9E370Ez/_buildManifest.js +0 -262
  587. package/out/_next/static/chunks/02ir8k2vqhw7u.js +0 -4
  588. package/out/_next/static/chunks/03mdkmx9pb3yx.js +0 -28
  589. package/out/_next/static/chunks/03spbldywp99b.js +0 -31
  590. package/out/_next/static/chunks/0531sa8v36e39.js +0 -1
  591. package/out/_next/static/chunks/065ltxdt7s8b2.js +0 -134
  592. package/out/_next/static/chunks/06b1jza2fvc6f.js +0 -4
  593. package/out/_next/static/chunks/0701uizxsgs75.js +0 -4
  594. package/out/_next/static/chunks/09olk50zbo5r6.js +0 -5
  595. package/out/_next/static/chunks/09pabifvs84zb.js +0 -12
  596. package/out/_next/static/chunks/0agx-csdwbk-x.js +0 -5
  597. package/out/_next/static/chunks/0clmvy-auef0p.js +0 -14
  598. package/out/_next/static/chunks/0czktxcs2aa12.js +0 -1
  599. package/out/_next/static/chunks/0d_qylr054ab-.js +0 -5
  600. package/out/_next/static/chunks/0e2znhpcecrqs.js +0 -175
  601. package/out/_next/static/chunks/0ef4vp3ehm369.js +0 -4
  602. package/out/_next/static/chunks/0fggi8jpi5gjk.js +0 -165
  603. package/out/_next/static/chunks/0gyabz3vqllr6.js +0 -83
  604. package/out/_next/static/chunks/0j05dboa5_xkw.js +0 -5
  605. package/out/_next/static/chunks/0kr4ift9_1a3s.js +0 -1
  606. package/out/_next/static/chunks/0l8tmlevl_6p0.js +0 -1
  607. package/out/_next/static/chunks/0o91usftba97q.js +0 -54
  608. package/out/_next/static/chunks/0oi1kpp0levnm.js +0 -1
  609. package/out/_next/static/chunks/0p86ng98eiz5q.js +0 -11
  610. package/out/_next/static/chunks/0pw1zl8_l93xl.js +0 -5
  611. package/out/_next/static/chunks/0py8-umjmwiwi.js +0 -156
  612. package/out/_next/static/chunks/0q0m2pv-3b2e2.js +0 -4
  613. package/out/_next/static/chunks/0r57e83u39trg.js +0 -5
  614. package/out/_next/static/chunks/0r9a_mcjh1k24.js +0 -6
  615. package/out/_next/static/chunks/0rgtc82y8z7_x.js +0 -5
  616. package/out/_next/static/chunks/0rxhx_x-7dojh.js +0 -182
  617. package/out/_next/static/chunks/0teb3b5h78855.js +0 -44
  618. package/out/_next/static/chunks/0thsuuvsozjop.js +0 -54
  619. package/out/_next/static/chunks/0v6x3uondh5hw.js +0 -5
  620. package/out/_next/static/chunks/0v_uz3j8jolmq.js +0 -4
  621. package/out/_next/static/chunks/0vwmp6qrw7odm.js +0 -7
  622. package/out/_next/static/chunks/0w6t6v_jzrudq.js +0 -4
  623. package/out/_next/static/chunks/0w7gz501ry22r.js +0 -4
  624. package/out/_next/static/chunks/0xgn-89s97a5w.js +0 -1
  625. package/out/_next/static/chunks/0xqtemh7t38y9.js +0 -119
  626. package/out/_next/static/chunks/1-1rj15j67dqt.js +0 -1
  627. package/out/_next/static/chunks/10drou7w-k58p.js +0 -4
  628. package/out/_next/static/chunks/11w7hldkge7sg.js +0 -8
  629. package/out/_next/static/chunks/130c8cta7pec6.js +0 -1
  630. package/out/_next/static/chunks/13qi39a_b6gkv.js +0 -1
  631. package/out/_next/static/chunks/15142badc5ufq.js +0 -4
  632. package/out/_next/static/chunks/155boltbcvwo-.js +0 -63
  633. package/out/_next/static/chunks/15_nwd8p454gd.js +0 -1
  634. package/out/_next/static/chunks/15s4qkdyz56pg.js +0 -115
  635. package/out/_next/static/chunks/15vdx0kewzv-6.js +0 -33
  636. package/out/_next/static/chunks/16shuavdpgni8.js +0 -327
  637. package/out/_next/static/chunks/170j06y4-47o4.js +0 -5
  638. package/out/_next/static/chunks/18a5kibvycb6u.js +0 -1
  639. package/out/_next/static/chunks/1_bckhq06wfmb.js +0 -4
  640. package/out/_next/static/chunks/1_ymf_rfke1aw.js +0 -6
  641. package/out/_next/static/chunks/1a1m389awxw4k.js +0 -1
  642. package/out/_next/static/chunks/1albq_5cppsa1.js +0 -5
  643. package/out/_next/static/chunks/1bhibqf8k2-z1.js +0 -117
  644. package/out/_next/static/chunks/1bxesp6kakz8_.js +0 -353
  645. package/out/_next/static/chunks/1d80ahah359g5.js +0 -174
  646. package/out/_next/static/chunks/1dbjry-rs_5we.js +0 -1
  647. package/out/_next/static/chunks/1dlr1eig6zpl1.js +0 -12
  648. package/out/_next/static/chunks/1gq8ickcg_vmv.js +0 -147
  649. package/out/_next/static/chunks/1gyrsx1nip-lm.js +0 -2
  650. package/out/_next/static/chunks/1hma23kynopdj.js +0 -3
  651. package/out/_next/static/chunks/1i996uxxmc736.js +0 -234
  652. package/out/_next/static/chunks/1ivhp-mi-5l--.js +0 -57
  653. package/out/_next/static/chunks/1ktkks-wpk8q-.js +0 -1
  654. package/out/_next/static/chunks/1kz62r46jwi0y.js +0 -5
  655. package/out/_next/static/chunks/1lex3myb5hmsw.js +0 -1
  656. package/out/_next/static/chunks/1lha1nklxo2g7.js +0 -1
  657. package/out/_next/static/chunks/1mwmcucidjio0.js +0 -8
  658. package/out/_next/static/chunks/1mzejejof4s6g.js +0 -147
  659. package/out/_next/static/chunks/1os6pvhjeb16o.js +0 -1
  660. package/out/_next/static/chunks/1p937fyqa7ssz.js +0 -1
  661. package/out/_next/static/chunks/1po7d3udj6iv4.js +0 -5
  662. package/out/_next/static/chunks/1qxxbcidu-hmv.js +0 -1
  663. package/out/_next/static/chunks/1re4i2t_po4sr.js +0 -95
  664. package/out/_next/static/chunks/1s4oi1bw8zl5d.js +0 -31
  665. package/out/_next/static/chunks/1sb04cqudnfpj.js +0 -4
  666. package/out/_next/static/chunks/1uom050rz5iol.js +0 -272
  667. package/out/_next/static/chunks/1uymuiqrms2h8.js +0 -103
  668. package/out/_next/static/chunks/1wijj_fal57co.js +0 -2
  669. package/out/_next/static/chunks/1wpen9t3_zbte.js +0 -1
  670. package/out/_next/static/chunks/1wpv1sl7vwg04.js +0 -99
  671. package/out/_next/static/chunks/1y3poj860g968.js +0 -24
  672. package/out/_next/static/chunks/1yk0pxcl4urkd.js +0 -4
  673. package/out/_next/static/chunks/1z2rl3h7scna4.js +0 -7
  674. package/out/_next/static/chunks/1zyhq82pkterc.js +0 -61
  675. package/out/_next/static/chunks/2-zr9-ri30va5.css +0 -1
  676. package/out/_next/static/chunks/20j8cdot33hql.js +0 -13
  677. package/out/_next/static/chunks/21fo9zerxyx-l.js +0 -59
  678. package/out/_next/static/chunks/22sxsq82r3cwy.js +0 -41
  679. package/out/_next/static/chunks/23nwkbry8kz0-.js +0 -1
  680. package/out/_next/static/chunks/259ckrmoldaqg.js +0 -5
  681. package/out/_next/static/chunks/25y2dqqrhstuq.js +0 -5
  682. package/out/_next/static/chunks/28myh-gi8t3t7.js +0 -7
  683. package/out/_next/static/chunks/29y82c6-u55hj.js +0 -5
  684. package/out/_next/static/chunks/2ahlen2u4lbnm.js +0 -16
  685. package/out/_next/static/chunks/2c3ehieqiwiw8.js +0 -119
  686. package/out/_next/static/chunks/2c5gq6izeq6nx.js +0 -81
  687. package/out/_next/static/chunks/2cj8g3fxmitaa.js +0 -1
  688. package/out/_next/static/chunks/2d9lzme_uzwvq.js +0 -1
  689. package/out/_next/static/chunks/2dqoft2pp4355.js +0 -1
  690. package/out/_next/static/chunks/2gso7_8v7owco.js +0 -1
  691. package/out/_next/static/chunks/2hc4nowrexhn3.js +0 -100
  692. package/out/_next/static/chunks/2hoi6cb1lromr.js +0 -4
  693. package/out/_next/static/chunks/2hw2_8kkf_2fg.js +0 -1
  694. package/out/_next/static/chunks/2kd4p_esjbozz.js +0 -21
  695. package/out/_next/static/chunks/2lwhn1ypqwukz.js +0 -11
  696. package/out/_next/static/chunks/2oz432iieo_c6.js +0 -43
  697. package/out/_next/static/chunks/2qjnhmz4c5fq1.js +0 -23
  698. package/out/_next/static/chunks/2rdjgc7_za785.js +0 -9
  699. package/out/_next/static/chunks/2ru66cyp0hbxn.js +0 -103
  700. package/out/_next/static/chunks/2ung-az_h871_.js +0 -4
  701. package/out/_next/static/chunks/2v4rvvdyh028e.js +0 -1
  702. package/out/_next/static/chunks/2vsl3-revotpl.js +0 -43
  703. package/out/_next/static/chunks/2wbc_9uwtsjbp.js +0 -15
  704. package/out/_next/static/chunks/2xixk0t9e9mnw.js +0 -1
  705. package/out/_next/static/chunks/2y6i_xssusr93.js +0 -1
  706. package/out/_next/static/chunks/2y_t26eglpeka.js +0 -4
  707. package/out/_next/static/chunks/3-hgyqm9mhcm9.js +0 -33
  708. package/out/_next/static/chunks/364y5vueeinvz.js +0 -276
  709. package/out/_next/static/chunks/366b9y413lk4d.js +0 -33
  710. package/out/_next/static/chunks/36vauyb71ot_b.js +0 -61
  711. package/out/_next/static/chunks/394m309ssmlo3.js +0 -5
  712. package/out/_next/static/chunks/39pveojee3ma1.js +0 -33
  713. package/out/_next/static/chunks/3_--novhq2u1q.js +0 -807
  714. package/out/_next/static/chunks/3apnk6kuvwze8.js +0 -5
  715. package/out/_next/static/chunks/3b0868kyqqkn3.js +0 -5
  716. package/out/_next/static/chunks/3dyd0ilb-ee5w.js +0 -8
  717. package/out/_next/static/chunks/3eftzknnu45-s.js +0 -1
  718. package/out/_next/static/chunks/3ejsx4af27cct.js +0 -7
  719. package/out/_next/static/chunks/3es4yddhl8uwc.js +0 -7
  720. package/out/_next/static/chunks/3inp15oicq85k.js +0 -1
  721. package/out/_next/static/chunks/3kd-t_qz3nxh7.js +0 -30
  722. package/out/_next/static/chunks/3kl8vv7w9jkjr.js +0 -23
  723. package/out/_next/static/chunks/3kmfx3f7oyfdm.js +0 -5
  724. package/out/_next/static/chunks/3koj4-48a7p_9.js +0 -4
  725. package/out/_next/static/chunks/3l7glrtu8ueuo.js +0 -4
  726. package/out/_next/static/chunks/3lgq9oa_2erwo.js +0 -5
  727. package/out/_next/static/chunks/3muxcxam24i5z.js +0 -1
  728. package/out/_next/static/chunks/3nimt7ngr5zv6.js +0 -46
  729. package/out/_next/static/chunks/3pwezwpggrz59.js +0 -74
  730. package/out/_next/static/chunks/3r02t7a7jknrv.js +0 -7
  731. package/out/_next/static/chunks/3s40iuaou1rt4.js +0 -1
  732. package/out/_next/static/chunks/3selzn479n73i.js +0 -16
  733. package/out/_next/static/chunks/3srflqnqdfd60.js +0 -5
  734. package/out/_next/static/chunks/3t57k35xu2eo8.js +0 -5
  735. package/out/_next/static/chunks/3tu90a7do336z.js +0 -12
  736. package/out/_next/static/chunks/3ukgj2jzxf10n.js +0 -5
  737. package/out/_next/static/chunks/3vosu-lpiis6v.js +0 -5
  738. package/out/_next/static/chunks/3xaz8fvw2x6b3.js +0 -5
  739. package/out/_next/static/chunks/3xgjhwzul66dp.js +0 -4
  740. package/out/_next/static/chunks/3zze6y1x00k__.js +0 -165
  741. package/out/_next/static/chunks/40730dyt912zu.js +0 -5
  742. package/out/_next/static/chunks/40f26tfp8txip.js +0 -5
  743. package/out/_next/static/chunks/40kc42ezz2dri.js +0 -1
  744. package/out/_next/static/chunks/41f60q88qcigi.js +0 -39
  745. package/out/_next/static/chunks/41l5iphw-rna3.js +0 -44
  746. package/out/_next/static/chunks/423kk9x5t9_b8.js +0 -5
  747. package/out/_next/static/chunks/42k5e3tr3uyzs.js +0 -54
  748. package/out/_next/static/chunks/4481d7yj7bm2q.js +0 -5
  749. package/out/_next/static/chunks/448is1kpt9eaa.js +0 -39
  750. package/out/_next/static/chunks/44fkzg2e80pqt.js +0 -8
  751. /package/out/_next/static/{BPoacQET3TJr2q9E370Ez → bg3Z_ZBjStiTvJAHlsPDE}/_clientMiddlewareManifest.js +0 -0
  752. /package/out/_next/static/{BPoacQET3TJr2q9E370Ez → bg3Z_ZBjStiTvJAHlsPDE}/_ssgManifest.js +0 -0
@@ -0,0 +1,350 @@
1
+ import { IProductStatus, IProductVariationType } from '../../../gql/types';
2
+ import { CSVRow } from '../../common/utils/csvUtils';
3
+ import parseMeta from '../../common/utils/parseMeta';
4
+ import { PRODUCT_TYPES } from '../ProductTypes';
5
+ import {
6
+ BuildProductEventsParam,
7
+ ProductCSVRow,
8
+ ProductImportPayload,
9
+ } from '../types';
10
+
11
+ const normalizeContent = (row: CSVRow) => {
12
+ const content: Record<string, any> = {};
13
+ const textPrefix = 'texts.';
14
+
15
+ Object.entries(row).forEach(([key, value]) => {
16
+ if (!key.startsWith(textPrefix)) return;
17
+ const [, locale, field] = key.split('.');
18
+ content[locale] ||= {};
19
+ if (field === 'labels') {
20
+ content[locale][field] = value ? (value as string).split(';') : [];
21
+ } else {
22
+ content[locale][field] = value || '';
23
+ }
24
+ });
25
+
26
+ return content;
27
+ };
28
+
29
+ export const productMapper = (row: ProductCSVRow): ProductCSVRow => {
30
+ const hasSupply =
31
+ row['supply.weightInGram'] ||
32
+ row['supply.heightInMillimeters'] ||
33
+ row['supply.lengthInMillimeters'] ||
34
+ row['supply.widthInMillimeters'];
35
+ const hasWarehousing = row['sku'] || row['baseUnit'];
36
+ const content = normalizeContent(row);
37
+ const meta = parseMeta(row['meta']);
38
+ const mapped = {
39
+ _id: row['_id'] || undefined,
40
+ warehousing: hasWarehousing
41
+ ? {
42
+ sku: row['sku'] || undefined,
43
+ baseUnit: row['baseUnit'] || undefined,
44
+ }
45
+ : undefined,
46
+ sequence:
47
+ typeof row['sequence'] === 'string'
48
+ ? parseInt(row['sequence'] || '0', 10)
49
+ : row['sequence'] || 0,
50
+ status: row['status'] || null,
51
+ type: row['type'],
52
+ tags: row['tags'] ? (row['tags'] as string).split(';') : [],
53
+ updated: row['updated'] || undefined,
54
+ published: row['published'] || undefined,
55
+ content,
56
+ supply: hasSupply
57
+ ? {
58
+ weightInGram: row['supply.weightInGram']
59
+ ? (parseFloat(row['supply.weightInGram'] as string) ?? undefined)
60
+ : undefined,
61
+ heightInMillimeters: row['supply.heightInMillimeters']
62
+ ? (parseFloat(row['supply.heightInMillimeters'] as string) ??
63
+ undefined)
64
+ : undefined,
65
+ lengthInMillimeters: row['supply.lengthInMillimeters']
66
+ ? (parseFloat(row['supply.lengthInMillimeters'] as string) ??
67
+ undefined)
68
+ : undefined,
69
+ widthInMillimeters: row['supply.widthInMillimeters']
70
+ ? (parseFloat(row['supply.widthInMillimeters'] as string) ??
71
+ undefined)
72
+ : undefined,
73
+ }
74
+ : undefined,
75
+ meta,
76
+ };
77
+
78
+ return mapped;
79
+ };
80
+
81
+ export const validateProduct = (
82
+ {
83
+ productsCSV,
84
+ pricesCSV,
85
+ bundleItemsCSV,
86
+ variationOptionsCSV,
87
+ variationsCSV,
88
+ }: ProductImportPayload,
89
+ intl,
90
+ ): string[] => {
91
+ const errors: string[] = [];
92
+ for (const product of productsCSV) {
93
+ if (!Object.values(PRODUCT_TYPES).includes(product?.type)) {
94
+ errors.push(
95
+ intl.formatMessage(
96
+ {
97
+ id: 'product_import.validation.invalid_type',
98
+ defaultMessage: 'Invalid product type: {type}',
99
+ },
100
+ { type: product.type },
101
+ ),
102
+ );
103
+ }
104
+ if (!product.sequence) {
105
+ errors.push(
106
+ intl.formatMessage({
107
+ id: 'product_import_sequence_required',
108
+ defaultMessage: 'Required field sequence missing',
109
+ }),
110
+ );
111
+ }
112
+
113
+ if (
114
+ product.status &&
115
+ ![
116
+ IProductStatus.Active,
117
+ IProductStatus.Draft,
118
+ IProductStatus.Deleted,
119
+ ].includes(product.status)
120
+ ) {
121
+ errors.push(
122
+ intl.formatMessage(
123
+ {
124
+ id: 'product_import_status_invalid',
125
+ defaultMessage: 'Invalid status value given ({status})',
126
+ },
127
+ { status: product.status },
128
+ ),
129
+ );
130
+ }
131
+ }
132
+
133
+ for (const price of pricesCSV) {
134
+ if (!price.productId) {
135
+ errors.push(
136
+ intl.formatMessage({
137
+ id: 'product_price_import_product_id_required',
138
+ defaultMessage: 'Required field productId missing',
139
+ }),
140
+ );
141
+ }
142
+ if (!price.amount) {
143
+ errors.push(
144
+ intl.formatMessage({
145
+ id: 'product_price_import_amount_required',
146
+ defaultMessage: 'Required field amount missing',
147
+ }),
148
+ );
149
+ }
150
+ if (!price.countryCode) {
151
+ errors.push(
152
+ intl.formatMessage({
153
+ id: 'product_price_import_countryCode_required',
154
+ defaultMessage: 'Required field countryCode missing',
155
+ }),
156
+ );
157
+ }
158
+ if (!price.currencyCode) {
159
+ errors.push(
160
+ intl.formatMessage({
161
+ id: 'product_price_import_currencyCode_required',
162
+ defaultMessage: 'Required field currencyCode missing',
163
+ }),
164
+ );
165
+ }
166
+ }
167
+
168
+ for (const price of bundleItemsCSV) {
169
+ if (!price.productId) {
170
+ errors.push(
171
+ intl.formatMessage({
172
+ id: 'product_bundle_import_product_id_required',
173
+ defaultMessage: 'Required field variation productId missing',
174
+ }),
175
+ );
176
+ }
177
+ if (!price.bundleItemProductId) {
178
+ errors.push(
179
+ intl.formatMessage({
180
+ id: 'product_bundle_import_item_id_required',
181
+ defaultMessage: 'Required field bundleItemProductId missing',
182
+ }),
183
+ );
184
+ }
185
+ }
186
+
187
+ for (const variation of variationsCSV) {
188
+ if (!variation.productId) {
189
+ errors.push(
190
+ intl.formatMessage({
191
+ id: 'product_variation_import_product_id_required',
192
+ defaultMessage: 'Required field variation productId missing',
193
+ }),
194
+ );
195
+ }
196
+ if (!variation.variationId) {
197
+ errors.push(
198
+ intl.formatMessage({
199
+ id: 'product_variation_import_variation_id_required',
200
+ defaultMessage: 'Required field variationId missing',
201
+ }),
202
+ );
203
+ }
204
+ if (!variation.type) {
205
+ errors.push(
206
+ intl.formatMessage({
207
+ id: 'product_variation_import_type_required',
208
+ defaultMessage: 'Required field variation type missing',
209
+ }),
210
+ );
211
+ }
212
+
213
+ if (
214
+ variation.type &&
215
+ ![IProductVariationType.Color, IProductVariationType.Text].includes(
216
+ variation.type,
217
+ )
218
+ ) {
219
+ errors.push(
220
+ intl.formatMessage(
221
+ {
222
+ id: 'product_variation_import_invalid_type_required',
223
+ defaultMessage: 'Invalid variation type given ({type})',
224
+ },
225
+ { type: variation.type },
226
+ ),
227
+ );
228
+ }
229
+ }
230
+
231
+ for (const variationOption of variationOptionsCSV) {
232
+ if (!variationOption.variationId) {
233
+ errors.push(
234
+ intl.formatMessage({
235
+ id: 'product_variation_option_import_variation_id_required',
236
+ defaultMessage: 'Required field variation id missing',
237
+ }),
238
+ );
239
+ }
240
+ if (!variationOption.value) {
241
+ errors.push(
242
+ intl.formatMessage({
243
+ id: 'product_variation_option_import_value_required',
244
+ defaultMessage: 'Required field variation option value missing',
245
+ }),
246
+ );
247
+ }
248
+ }
249
+
250
+ return errors;
251
+ };
252
+
253
+ const buildProductEvents = ({
254
+ variations = [],
255
+ ...product
256
+ }: BuildProductEventsParam) => {
257
+ const now = new Date();
258
+
259
+ return {
260
+ entity: 'PRODUCT',
261
+ operation: 'CREATE',
262
+ payload: {
263
+ _id: product._id,
264
+ specification: {
265
+ ...product,
266
+ published: product.status === 'ACTIVE' ? now : null,
267
+ status: product.status === 'ACTIVE' ? 'ACTIVE' : null,
268
+ warehousing: {
269
+ sku: product.sku,
270
+ baseUnit: product.baseUnit,
271
+ },
272
+ commerce: product.commerce ? { pricing: product.commerce } : undefined,
273
+ bundleItems: product?.bundleItems,
274
+ },
275
+ variations: variations?.length ? variations : undefined,
276
+ },
277
+ };
278
+ };
279
+
280
+ const usePrepareProductImport = () => {
281
+ const prepareProductImport = async ({
282
+ productsCSV,
283
+ pricesCSV,
284
+ bundleItemsCSV,
285
+ variationsCSV,
286
+ variationOptionsCSV,
287
+ }: ProductImportPayload) => {
288
+ return (productsCSV || []).map((product) => {
289
+ const prices = (pricesCSV || []).filter(
290
+ (option) => option['productId'] === product._id,
291
+ );
292
+ const bundles = (bundleItemsCSV || []).filter(
293
+ (item) => item['productId'] === product._id,
294
+ );
295
+
296
+ const productVariations = (variationsCSV || []).filter(
297
+ (item) => item['productId'] === product._id,
298
+ );
299
+ let price = undefined;
300
+ let bundleItems = undefined;
301
+ let variations = undefined;
302
+ if (prices.length)
303
+ price = prices.map(
304
+ ({ amount, minQuantity, isNetPrice, isTaxable, ...restPrice }) => ({
305
+ ...restPrice,
306
+ amount: parseInt(amount) ?? 0,
307
+ isNetPrice: isNetPrice === 'true',
308
+ isTaxable: isTaxable === 'true',
309
+ minQuantity: parseInt(minQuantity, 10) || 0,
310
+ }),
311
+ );
312
+
313
+ if (bundles.length)
314
+ bundleItems = bundles.map(
315
+ ({ bundleItemProductId, quantity, configuration }) => ({
316
+ productId: bundleItemProductId,
317
+ quantity: Number(quantity || 1),
318
+ configuration: (configuration || '').split(';').map((v) => {
319
+ const [key, value] = v.split(':');
320
+ return { key, value };
321
+ }),
322
+ }),
323
+ );
324
+ if (productVariations.length)
325
+ variations = productVariations.map(
326
+ ({ variationId, type, key, configuration, ...row }) => ({
327
+ variationId,
328
+ key,
329
+ type,
330
+ content: normalizeContent(row),
331
+ options: (variationOptionsCSV || [])
332
+ .filter((o) => o.variationId === variationId)
333
+ .map((o) => ({
334
+ value: o?.value ?? '',
335
+ content: normalizeContent(o),
336
+ })),
337
+ }),
338
+ );
339
+ return buildProductEvents({
340
+ ...productMapper(product),
341
+ commerce: price,
342
+ bundleItems,
343
+ variations,
344
+ });
345
+ });
346
+ };
347
+ return { prepareProductImport };
348
+ };
349
+
350
+ export default usePrepareProductImport;
@@ -0,0 +1,93 @@
1
+ import { gql } from '@apollo/client';
2
+ import { useQuery } from '@apollo/client/react';
3
+ import { IProductQuery, IProductQueryVariables } from '../../../gql/types';
4
+ import { parseUniqueId } from '../../common/utils/getUniqueId';
5
+ import useUnchainedContext from '../../UnchainedContext/useUnchainedContext';
6
+ import ProductDetailFragment from '../fragments/ProductDetailFragment';
7
+
8
+ const GetProductQuery = (inlineFragment = '') => gql`
9
+ query Product($productId: ID, $slug: String) {
10
+ product(productId: $productId, slug: $slug) {
11
+ ...ProductDetailFragment
12
+ ${inlineFragment}
13
+ texts {
14
+ _id
15
+ title
16
+ subtitle
17
+ description
18
+ }
19
+ ... on SimpleProduct {
20
+ texts {
21
+ _id
22
+ title
23
+ subtitle
24
+ description
25
+ }
26
+ proxies {
27
+ __typename
28
+ }
29
+ }
30
+ ... on ConfigurableProduct {
31
+ texts {
32
+ _id
33
+ title
34
+ subtitle
35
+ description
36
+ }
37
+ }
38
+ ... on PlanProduct {
39
+ texts {
40
+ _id
41
+ title
42
+ subtitle
43
+ description
44
+ }
45
+ proxies {
46
+ __typename
47
+ }
48
+ }
49
+ ... on BundleProduct {
50
+ texts {
51
+ _id
52
+ title
53
+ subtitle
54
+ description
55
+ }
56
+ proxies {
57
+ __typename
58
+ }
59
+ }
60
+ }
61
+ }
62
+ ${ProductDetailFragment}
63
+ `;
64
+
65
+ const useProduct = ({
66
+ productId: id = null,
67
+ slug = null,
68
+ }: IProductQueryVariables = {}) => {
69
+ const parsedId = parseUniqueId(slug);
70
+
71
+ const { customProperties, hydrateFragment } = useUnchainedContext();
72
+ const { data, loading, error } = useQuery<
73
+ IProductQuery,
74
+ IProductQueryVariables
75
+ >(GetProductQuery(customProperties?.Product), {
76
+ skip: !id && !parsedId,
77
+ variables: { productId: id || parsedId },
78
+ });
79
+
80
+ const extendedData = hydrateFragment(
81
+ customProperties?.Product,
82
+ data?.product,
83
+ );
84
+
85
+ return {
86
+ product: data?.product,
87
+ loading,
88
+ error,
89
+ extendedData,
90
+ };
91
+ };
92
+
93
+ export default useProduct;
@@ -0,0 +1,71 @@
1
+ import { gql } from '@apollo/client';
2
+ import { useQuery } from '@apollo/client/react';
3
+ import {
4
+ IConfigurableProduct,
5
+ IProductAssignmentsQuery,
6
+ IProductAssignmentsQueryVariables,
7
+ } from '../../../gql/types';
8
+ import { parseUniqueId } from '../../common/utils/getUniqueId';
9
+
10
+ import ProductAssignmentFragment from '../fragments/ProductAssignmentFragment';
11
+
12
+ const ProductAssignmentQuery = gql`
13
+ query ProductAssignments($productId: ID, $slug: String) {
14
+ product(productId: $productId, slug: $slug) {
15
+ _id
16
+ ... on ConfigurableProduct {
17
+ texts {
18
+ _id
19
+ subtitle
20
+ slug
21
+ title
22
+ }
23
+ variations {
24
+ _id
25
+ key
26
+ texts {
27
+ _id
28
+ title
29
+ }
30
+ options {
31
+ _id
32
+ value
33
+ texts {
34
+ _id
35
+ title
36
+ }
37
+ }
38
+ }
39
+ assignments(includeInactive: true) {
40
+ ...ProductAssignmentFragment
41
+ }
42
+ }
43
+ }
44
+ }
45
+ ${ProductAssignmentFragment}
46
+ `;
47
+
48
+ const useProductAssignments = ({
49
+ productId: id = null,
50
+ slug = null,
51
+ }: IProductAssignmentsQueryVariables = {}) => {
52
+ const parsedId = parseUniqueId(slug);
53
+
54
+ const { data, loading, error } = useQuery<
55
+ IProductAssignmentsQuery,
56
+ IProductAssignmentsQueryVariables
57
+ >(ProductAssignmentQuery, {
58
+ skip: !id && !parsedId,
59
+ variables: { productId: id || parsedId },
60
+ });
61
+
62
+ const product = data?.product as IConfigurableProduct;
63
+
64
+ return {
65
+ product,
66
+ loading,
67
+ error,
68
+ };
69
+ };
70
+
71
+ export default useProductAssignments;
@@ -0,0 +1,61 @@
1
+ import { gql } from '@apollo/client';
2
+ import { useQuery } from '@apollo/client/react';
3
+ import {
4
+ IBundleProduct,
5
+ IProductBundleItemsQuery,
6
+ IProductBundleItemsQueryVariables,
7
+ } from '../../../gql/types';
8
+ import { parseUniqueId } from '../../common/utils/getUniqueId';
9
+ import ProductBriefFragment from '../fragments/ProductBriefFragment';
10
+ import useApp from '../../common/hooks/useApp';
11
+
12
+ export const ProductBundleItemQuery = gql`
13
+ query ProductBundleItems(
14
+ $productId: ID
15
+ $slug: String
16
+ $forceLocale: Locale
17
+ ) {
18
+ product(productId: $productId, slug: $slug) {
19
+ _id
20
+ ... on BundleProduct {
21
+ bundleItems {
22
+ product {
23
+ ...ProductBriefFragment
24
+ }
25
+ quantity
26
+ }
27
+ }
28
+ }
29
+ }
30
+ ${ProductBriefFragment}
31
+ `;
32
+
33
+ const useProductBundleItems = ({
34
+ productId: id = null,
35
+ slug = null,
36
+ }: IProductBundleItemsQueryVariables = {}) => {
37
+ const { selectedLocale } = useApp();
38
+ const parsedId = parseUniqueId(slug);
39
+ const { data, loading, error } = useQuery<
40
+ IProductBundleItemsQuery,
41
+ IProductBundleItemsQueryVariables
42
+ >(ProductBundleItemQuery, {
43
+ skip: !id && !parsedId,
44
+ variables: { productId: id || parsedId, forceLocale: selectedLocale },
45
+ context: {
46
+ headers: {
47
+ forceLocale: selectedLocale,
48
+ },
49
+ },
50
+ });
51
+
52
+ const bundleItems = (data?.product as IBundleProduct)?.bundleItems || [];
53
+
54
+ return {
55
+ bundleItems,
56
+ loading,
57
+ error,
58
+ };
59
+ };
60
+
61
+ export default useProductBundleItems;
@@ -0,0 +1,39 @@
1
+ import { gql } from '@apollo/client';
2
+ import { useQuery } from '@apollo/client/react';
3
+ import {
4
+ IProductCatalogPricesQuery,
5
+ IProductCatalogPricesQueryVariables,
6
+ } from '../../../gql/types';
7
+ import ProductCatalogPriceFragment from '../fragments/ProductCatalogPriceFragment';
8
+
9
+ export const ProductCatalogPricesQuery = gql`
10
+ query ProductCatalogPrices($productId: ID!) {
11
+ productCatalogPrices(productId: $productId) {
12
+ ...ProductCatalogPriceFragment
13
+ }
14
+ }
15
+ ${ProductCatalogPriceFragment}
16
+ `;
17
+
18
+ const useProductCatalogPrices = ({
19
+ productId,
20
+ }: IProductCatalogPricesQueryVariables) => {
21
+ const { data, loading, error } = useQuery<
22
+ IProductCatalogPricesQuery,
23
+ IProductCatalogPricesQueryVariables
24
+ >(ProductCatalogPricesQuery, {
25
+ skip: !productId,
26
+ variables: {
27
+ productId,
28
+ },
29
+ });
30
+ const catalogPrices = data?.productCatalogPrices || [];
31
+
32
+ return {
33
+ catalogPrices,
34
+ loading,
35
+ error,
36
+ };
37
+ };
38
+
39
+ export default useProductCatalogPrices;
@@ -0,0 +1,90 @@
1
+ import { useCallback } from 'react';
2
+ import { useCSVExport } from '../../common/hooks/useCSVExport';
3
+
4
+ export const PRODUCT_CSV_SCHEMA = {
5
+ base: [
6
+ '_id',
7
+ 'sku',
8
+ 'baseUnit',
9
+ 'sequence',
10
+ 'status',
11
+ 'tags',
12
+ 'updated',
13
+ 'published',
14
+ 'type',
15
+ ],
16
+ textFields: [
17
+ 'title',
18
+ 'subtitle',
19
+ 'description',
20
+ 'vendor',
21
+ 'brand',
22
+ 'labels',
23
+ 'slug',
24
+ ],
25
+ priceFields: [
26
+ 'productId',
27
+ 'amount',
28
+ 'currencyCode',
29
+ 'countryCode',
30
+ 'isTaxable',
31
+ 'isNetPrice',
32
+ 'minQuantity',
33
+ ],
34
+ bundleItemHeaders: [
35
+ 'productId',
36
+ 'bundleItemProductId',
37
+ 'quantity',
38
+ 'configuration',
39
+ ],
40
+ variationItemHeaders: ['productId', 'variationId', 'key', 'type'],
41
+ variationTextFields: ['title', 'subtitle'],
42
+ variationOptionItemHeaders: ['variationId', 'value'],
43
+ variationOptionTextFields: ['title', 'subtitle'],
44
+ };
45
+
46
+ export const buildProductHeaders = (locales: string[]) => [
47
+ ...PRODUCT_CSV_SCHEMA.base,
48
+ ...locales.flatMap((locale) =>
49
+ PRODUCT_CSV_SCHEMA.textFields.map((field) => `texts.${locale}.${field}`),
50
+ ),
51
+ 'supply.weightInGram',
52
+ 'supply.heightInMillimeters',
53
+ 'supply.lengthInMillimeters',
54
+ 'supply.widthInMillimeters',
55
+ ];
56
+
57
+ export const buildPriceHeaders = () => [...PRODUCT_CSV_SCHEMA.priceFields];
58
+ export const buildBundleHeaders = () => [
59
+ ...PRODUCT_CSV_SCHEMA.bundleItemHeaders,
60
+ ];
61
+ export const buildVariationHeaders = (locales: string[]) => [
62
+ ...PRODUCT_CSV_SCHEMA.variationItemHeaders,
63
+ ...locales.flatMap((locale) =>
64
+ PRODUCT_CSV_SCHEMA.variationTextFields.map(
65
+ (field) => `texts.${locale}.${field}`,
66
+ ),
67
+ ),
68
+ ];
69
+
70
+ export const buildVariationOptionsHeaders = (locales: string[]) => [
71
+ ...PRODUCT_CSV_SCHEMA.variationOptionItemHeaders,
72
+ ...locales.flatMap((locale) =>
73
+ PRODUCT_CSV_SCHEMA.variationOptionTextFields.map(
74
+ (field) => `texts.${locale}.${field}`,
75
+ ),
76
+ ),
77
+ ];
78
+
79
+ export const useProductExport = () => {
80
+ const { exportCSV, isExporting } = useCSVExport();
81
+
82
+ const exportProducts = useCallback(
83
+ async (data: Record<string, unknown>) => {
84
+ await exportCSV({ type: 'PRODUCTS', ...data });
85
+ },
86
+ [exportCSV],
87
+ );
88
+
89
+ return { exportProducts, isExporting };
90
+ };