@unchainedshop/admin-ui 5.0.0-alpha.10 → 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.
- package/README.md +1 -1
- package/dist/{chunk-WPLOTFGW.js → chunk-2HTCKO4E.js} +12 -3
- package/dist/{chunk-HTPSKUXQ.js → chunk-33ZO52Z7.js} +3337 -1778
- package/dist/{chunk-AE5LOZGH.js → chunk-4MXPTVDL.js} +16 -58
- package/dist/{chunk-I64TXIE7.js → chunk-ATZJXTRA.js} +1 -1
- package/dist/{chunk-AOR2B5N5.js → chunk-BOMSMJF2.js} +4 -1
- package/dist/{chunk-QHR23GVH.js → chunk-CUYIP5XG.js} +1 -1
- package/dist/{chunk-5WPFHQZN.js → chunk-E6HDJYA6.js} +3 -3
- package/dist/{chunk-FDHXLNZQ.js → chunk-EAVP6XZQ.js} +1 -1
- package/dist/{chunk-E7BVYJ3R.js → chunk-ED2FP42R.js} +2 -2
- package/dist/{chunk-H6G4UTZ5.js → chunk-GWMLIF3C.js} +5 -11
- package/dist/chunk-IWKDBADX.js +73 -0
- package/dist/{chunk-3L6EZQ6P.js → chunk-NFJE5EJG.js} +1 -1
- package/dist/chunk-VYEXPG3M.js +107 -0
- package/dist/{chunk-DTJ2DTKS.js → chunk-YUXHILXY.js} +15 -3
- package/dist/{chunk-VDKQGOMV.js → chunk-ZUOVKRKC.js} +118 -1
- package/dist/components/ui/Badge.d.ts.map +1 -1
- package/dist/components/ui/BreadCrumbs.d.ts.map +1 -1
- package/dist/components/ui/Loading.d.ts +8 -1
- package/dist/components/ui/Loading.d.ts.map +1 -1
- package/dist/components/ui/Pagination.d.ts.map +1 -1
- package/dist/components/ui/form/Combobox.d.ts.map +1 -1
- package/dist/components/ui/form/TextField.d.ts.map +1 -1
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/form.js +814 -292
- package/dist/gql/operation-types.d.ts +195 -19
- package/dist/gql/operation-types.d.ts.map +1 -1
- package/dist/gql/schema-types.d.ts +65 -9
- package/dist/gql/schema-types.d.ts.map +1 -1
- package/dist/hooks.js +5 -5
- package/dist/modal.js +5 -5
- package/dist/modules/accounts.js +183 -3
- package/dist/modules/assortment.js +82 -3
- package/dist/modules/common/components/AppContext.d.ts.map +1 -1
- package/dist/modules/common/components/FormWrapper.d.ts.map +1 -1
- package/dist/modules/common/components/ThemeWrapper.d.ts.map +1 -1
- package/dist/modules/common/data/miscellaneous.d.ts +1 -0
- package/dist/modules/common/data/miscellaneous.d.ts.map +1 -1
- package/dist/modules/country.js +1 -1
- package/dist/modules/currency.js +1 -1
- package/dist/modules/delivery-provider.js +1 -1
- package/dist/modules/enrollment.js +66 -9
- package/dist/modules/event.js +1 -1
- package/dist/modules/filter.js +52 -3
- package/dist/modules/language.js +1 -1
- package/dist/modules/order.js +2 -2
- package/dist/modules/payment-providers.js +1 -1
- package/dist/modules/product-review.js +3 -3
- package/dist/modules/product.js +261 -13
- package/dist/modules/quotation.js +8 -1
- package/dist/modules/token.js +2 -2
- package/dist/modules/warehousing-providers.js +1 -1
- package/dist/modules/work.js +18 -102
- package/dist/plugins.js +1 -1
- package/dist/providers.js +6 -6
- package/dist/shims/admin-ui-plugins.js +1 -1
- package/dist/shims/apollo-client-react.js +1 -1
- package/dist/shims/apollo-client.js +1 -1
- package/dist/shims/next-head.js +1 -1
- package/dist/shims/next-image.js +1 -1
- package/dist/shims/next-link.js +1 -1
- package/dist/shims/next-router.js +1 -1
- package/dist/shims/react-dom-client.js +1 -1
- package/dist/shims/react-dom.js +1 -1
- package/dist/shims/react-hook-form.js +1 -1
- package/dist/shims/react-intl.js +1 -1
- package/dist/shims/react-jsx-runtime.js +1 -1
- package/dist/shims/react-toastify.js +1 -1
- package/dist/shims/react.js +1 -1
- package/dist/theme.js +1 -1
- package/dist/ui.js +3965 -3417
- package/out/403/index.html +3 -2
- package/out/404/index.html +3 -2
- package/out/404.html +3 -2
- package/out/423/index.html +3 -2
- package/out/500/index.html +3 -2
- package/out/_next/static/bg3Z_ZBjStiTvJAHlsPDE/_buildManifest.js +262 -0
- package/out/_next/static/chunks/0-kvzk5p0hp-4.js +11 -0
- package/out/_next/static/chunks/0-nzk-g6k41e-.js +119 -0
- package/out/_next/static/chunks/00wlebfe9j80r.js +24 -0
- package/out/_next/static/chunks/01isyk4v59s_4.js +5 -0
- package/out/_next/static/chunks/01otzjqxk372n.js +1 -0
- package/out/_next/static/chunks/03x_mgpai_kbn.js +1 -0
- package/out/_next/static/chunks/04327_1fq5i7-.js +9 -0
- package/out/_next/static/chunks/04_r4qnsjmy81.js +4 -0
- package/out/_next/static/chunks/04egfa7kckou_.js +165 -0
- package/out/_next/static/chunks/05474mknnr_tw.js +4 -0
- package/out/_next/static/chunks/{2kzyda4a6mqut.js → 06kqbwwnuu3te.js} +1 -1
- package/out/_next/static/chunks/0728622u98g6r.js +1 -0
- package/out/_next/static/chunks/09irjy-7k1922.js +1 -0
- package/out/_next/static/chunks/0_3suta3t3lus.js +5 -0
- package/out/_next/static/chunks/0_a5fzdztv84p.js +272 -0
- package/out/_next/static/chunks/0_ppdn6x6ci0v.js +31 -0
- package/out/_next/static/chunks/0br42_xli8-2x.js +6 -0
- package/out/_next/static/chunks/0cdk-eqghrgee.js +5 -0
- package/out/_next/static/chunks/0d54jo566j9ka.js +12 -0
- package/out/_next/static/chunks/0gfia1t8drmnx.js +182 -0
- package/out/_next/static/chunks/0gwd6ju8j_bwr.js +39 -0
- package/out/_next/static/chunks/0hv3x0mo1tt7i.js +5 -0
- package/out/_next/static/chunks/0i481ym5-ss1t.js +5 -0
- package/out/_next/static/chunks/0iohwbogpxe5r.js +1 -0
- package/out/_next/static/chunks/0j46qnxaxeqk_.js +1 -0
- package/out/_next/static/chunks/0mcu2o1ir2t_w.js +7 -0
- package/out/_next/static/chunks/0o4aj3bm49d_h.js +61 -0
- package/out/_next/static/chunks/0op3htrvd-ix6.js +5 -0
- package/out/_next/static/chunks/0p55j-ysba0wq.js +63 -0
- package/out/_next/static/chunks/0p7said9rdor1.js +1 -0
- package/out/_next/static/chunks/0qv2nce7okzy5.js +103 -0
- package/out/_next/static/chunks/0rrhyxuk32t3n.js +95 -0
- package/out/_next/static/chunks/0rt4le6syjqdj.js +21 -0
- package/out/_next/static/chunks/0s2jvi6_qj0lc.js +16 -0
- package/out/_next/static/chunks/0uef4ugmc_g10.js +1 -0
- package/out/_next/static/chunks/0v1tb34y7e1y4.js +5 -0
- package/out/_next/static/chunks/0w9d4swf95hvu.js +33 -0
- package/out/_next/static/chunks/0we1tw4xvdb7o.js +7 -0
- package/out/_next/static/chunks/0zlzflyq18hhy.js +4 -0
- package/out/_next/static/chunks/0zqdvl0b4w5nc.js +7 -0
- package/out/_next/static/chunks/1-wbp_4f-c4-3.js +837 -0
- package/out/_next/static/chunks/11vnr4kb9qkjr.js +1 -0
- package/out/_next/static/chunks/12cy_5m_0fj96.js +44 -0
- package/out/_next/static/chunks/131uuhqexo4si.js +4 -0
- package/out/_next/static/chunks/14eqp21pspjud.js +234 -0
- package/out/_next/static/chunks/14jd75j8ij4u2.js +3 -0
- package/out/_next/static/chunks/153-_av1r1ssb.js +4 -0
- package/out/_next/static/chunks/157ndq6b9jcvv.js +342 -0
- package/out/_next/static/chunks/177p92k5pdloo.js +1 -0
- package/out/_next/static/chunks/19-1z6h5eeq_w.js +134 -0
- package/out/_next/static/chunks/1bxznw06g-5u2.js +5 -0
- package/out/_next/static/chunks/1bypzyw5fs3w2.js +59 -0
- package/out/_next/static/chunks/1cz2fp89ssu5d.js +4 -0
- package/out/_next/static/chunks/1e2jykfql801f.js +16 -0
- package/out/_next/static/chunks/1eokbzdgdicpa.js +33 -0
- package/out/_next/static/chunks/1f0t23r6y0hni.js +1 -0
- package/out/_next/static/chunks/1fehej_7rgmmo.js +5 -0
- package/out/_next/static/chunks/1gl4h7w9t850f.js +1 -0
- package/out/_next/static/chunks/1gv0k-w7m83om.js +41 -0
- package/out/_next/static/chunks/1hzt0aoixrv4_.js +7 -0
- package/out/_next/static/chunks/1ia6hdgf7pj9y.js +174 -0
- package/out/_next/static/chunks/1in8spfokcjsp.js +8 -0
- package/out/_next/static/chunks/1j2gw9gyg8j80.js +5 -0
- package/out/_next/static/chunks/1k06h8wbfrx_v.js +5 -0
- package/out/_next/static/chunks/1kdcu-0jkya-b.js +61 -0
- package/out/_next/static/chunks/1msc4qrgaanh7.js +43 -0
- package/out/_next/static/chunks/1mx0p6r-9c5u_.js +4 -0
- package/out/_next/static/chunks/1oqc8etm-romv.js +1 -0
- package/out/_next/static/chunks/1p5lt4tkyouxz.js +4 -0
- package/out/_next/static/chunks/1q7wxp4rlhy0x.js +12 -0
- package/out/_next/static/chunks/1r61kgm2ct0nf.js +74 -0
- package/out/_next/static/chunks/1rmlm4404fsge.js +15 -0
- package/out/_next/static/chunks/1s3ool53utm9o.js +39 -0
- package/out/_next/static/chunks/1sc2ug6_szd_d.js +2 -0
- package/out/_next/static/chunks/1sh2ogc7tcbu-.js +1 -0
- package/out/_next/static/chunks/1t8jj0-6g8uyd.js +1 -0
- package/out/_next/static/chunks/1tbd6m-xvx0um.js +353 -0
- package/out/_next/static/chunks/1th1-x1szvnq8.js +5 -0
- package/out/_next/static/chunks/1tosw188dr9d6.js +44 -0
- package/out/_next/static/chunks/1tw97cvdosb89.js +5 -0
- package/out/_next/static/chunks/1ubmbegreszhk.js +1 -0
- package/out/_next/static/chunks/1ug1ie2lrhi0a.js +7 -0
- package/out/_next/static/chunks/1ulje1tawz8fl.js +1 -0
- package/out/_next/static/chunks/1uw7hr3o4w5cj.js +8 -0
- package/out/_next/static/chunks/1vzs8hvrsoslf.js +5 -0
- package/out/_next/static/chunks/1w6gc_cygbi6h.js +5 -0
- package/out/_next/static/chunks/1xybsisfyvqrj.js +115 -0
- package/out/_next/static/chunks/1yvl8l5yx1rj8.js +4 -0
- package/out/_next/static/chunks/1z-etrje5tsj6.js +7 -0
- package/out/_next/static/chunks/1z1d11slpalrq.js +4 -0
- package/out/_next/static/chunks/1z1mbux-7g74d.js +1 -0
- package/out/_next/static/chunks/1zdral15la_p7.js +99 -0
- package/out/_next/static/chunks/2-4610weysas_.js +1 -0
- package/out/_next/static/chunks/2-qo63s4vlxol.js +156 -0
- package/out/_next/static/chunks/20au-bdji0nu2.js +14 -0
- package/out/_next/static/chunks/21zghy5-42i1e.js +1 -0
- package/out/_next/static/chunks/22duvsj-priip.js +7 -0
- package/out/_next/static/chunks/22rdge7enz4nd.js +12 -0
- package/out/_next/static/chunks/249b4cg2ev597.js +187 -0
- package/out/_next/static/chunks/24caedynuzux0.js +5 -0
- package/out/_next/static/chunks/25ite4-jpq_mo.js +4 -0
- package/out/_next/static/chunks/25vdihxswn7dy.js +1 -0
- package/out/_next/static/chunks/26guwpx1_pkxv.js +1 -0
- package/out/_next/static/chunks/28o6402k4vuky.js +11 -0
- package/out/_next/static/chunks/28oppyg7ev102.js +1 -0
- package/out/_next/static/chunks/29x7cj-318eaa.js +1 -0
- package/out/_next/static/chunks/2_0v0fw6x71zy.js +46 -0
- package/out/_next/static/chunks/2a9dpzjx5mfjp.js +4 -0
- package/out/_next/static/chunks/2apnv1hcv-4zc.js +23 -0
- package/out/_next/static/chunks/2b4k5t_myq-pa.js +1 -0
- package/out/_next/static/chunks/2bugi3kot5jtu.js +1 -0
- package/out/_next/static/chunks/2bxdh-td1el8z.js +5 -0
- package/out/_next/static/chunks/2dz0_3jf4m9cy.js +31 -0
- package/out/_next/static/chunks/2ege1545af18d.js +4 -0
- package/out/_next/static/chunks/2erqawjj0rnih.js +117 -0
- package/out/_next/static/chunks/2gfzt_fdr-h96.js +81 -0
- package/out/_next/static/chunks/2grm6dtosrvoq.js +1 -0
- package/out/_next/static/chunks/2hc3d38gb0q-v.js +1 -0
- package/out/_next/static/chunks/2hci18oosfv5d.js +5 -0
- package/out/_next/static/chunks/2imf3_f1_ex86.js +1 -0
- package/out/_next/static/chunks/2ipcn3vy6d4_6.js +2 -0
- package/out/_next/static/chunks/2iwst7mjldlcz.js +1 -0
- package/out/_next/static/chunks/2ja0dztzyw8zw.js +1 -0
- package/out/_next/static/chunks/2ja1--2x_gs49.js +83 -0
- package/out/_next/static/chunks/2l8gepfm4kyjp.js +1 -0
- package/out/_next/static/chunks/2lec5u8obskt6.js +5 -0
- package/out/_next/static/chunks/2m38nntt3z8zi.js +103 -0
- package/out/_next/static/chunks/2pogx3xggqd8y.js +1 -0
- package/out/_next/static/chunks/2q988j4vovsiy.js +8 -0
- package/out/_next/static/chunks/2s-0q8i8lr2p2.js +5 -0
- package/out/_next/static/chunks/2u64ldp2xfy8a.js +709 -0
- package/out/_next/static/chunks/2ud5j0_nqocf4.js +5 -0
- package/out/_next/static/chunks/2uo6puoi0y082.js +5 -0
- package/out/_next/static/chunks/2w3z7kqh6nbmw.js +23 -0
- package/out/_next/static/chunks/2y11qf38baxpu.js +14 -0
- package/out/_next/static/chunks/2y8uau15r3p-o.js +1 -0
- package/out/_next/static/chunks/2zb-xmda5rbn0.js +1 -0
- package/out/_next/static/chunks/2zsvxbghbsuz1.js +4 -0
- package/out/_next/static/chunks/3-ve59izq9j-p.js +1 -0
- package/out/_next/static/chunks/3205eg3ochzp4.js +297 -0
- package/out/_next/static/chunks/32g5gxee1kcdc.js +28 -0
- package/out/_next/static/chunks/32whi9clpxjd0.js +5 -0
- package/out/_next/static/chunks/3368kg846t33d.js +57 -0
- package/out/_next/static/chunks/33oz-znvi5-m6.js +1 -0
- package/out/_next/static/chunks/345s7967cwd02.js +5 -0
- package/out/_next/static/chunks/34wf3lz_fft3k.js +2 -0
- package/out/_next/static/chunks/36x7q29atus_r.js +161 -0
- package/out/_next/static/chunks/37jjn1wguhj-a.js +5 -0
- package/out/_next/static/chunks/393--hagnnm97.js +39 -0
- package/out/_next/static/chunks/39moagn46hde9.js +5 -0
- package/out/_next/static/chunks/3_0q-dmk8few_.css +1 -0
- package/out/_next/static/chunks/3_adkt8r_brx4.js +165 -0
- package/out/_next/static/chunks/3b1kt-r_75q1a.js +43 -0
- package/out/_next/static/chunks/3e38rrs6dszgt.js +8 -0
- package/out/_next/static/chunks/3e7d8sb4289js.js +5 -0
- package/out/_next/static/chunks/3ek1bahoqa_ll.js +5 -0
- package/out/_next/static/chunks/3ek680kdzjdr7.js +1 -0
- package/out/_next/static/chunks/3eth7s2-06yuz.js +1 -0
- package/out/_next/static/chunks/3exy4ii5maq4x.js +54 -0
- package/out/_next/static/chunks/3fevbt4ysloo8.js +8 -0
- package/out/_next/static/chunks/3fu072xwkf88o.js +6 -0
- package/out/_next/static/chunks/3h6a3clw5m5ro.js +4 -0
- package/out/_next/static/chunks/3hmoy4f23y1s4.js +147 -0
- package/out/_next/static/chunks/3i4_3b36nutw7.js +33 -0
- package/out/_next/static/chunks/3jfe0uesrzz7a.js +1 -0
- package/out/_next/static/chunks/3jxeyjg2g7w94.js +1 -0
- package/out/_next/static/chunks/3k01tdsm6l20w.js +54 -0
- package/out/_next/static/chunks/3lr6hkso67d68.js +6 -0
- package/out/_next/static/chunks/3lzin6_25n8rs.js +30 -0
- package/out/_next/static/chunks/3nrrzhhoy8amt.js +4 -0
- package/out/_next/static/chunks/3o-h2po9z09dk.js +4 -0
- package/out/_next/static/chunks/3onharcadlou0.js +327 -0
- package/out/_next/static/chunks/3pls-kicv4xu9.js +175 -0
- package/out/_next/static/chunks/3t48n1yk76zoa.js +1 -0
- package/out/_next/static/chunks/3t_520l4ihlg3.js +54 -0
- package/out/_next/static/chunks/3tg_clsx6ux4o.js +1 -0
- package/out/_next/static/chunks/3ttz1zgoq3xmp.js +1 -0
- package/out/_next/static/chunks/3uekb_s0jaboj.js +1 -0
- package/out/_next/static/chunks/3ujdligrod612.js +5 -0
- package/out/_next/static/chunks/3www97fxyknos.js +4 -0
- package/out/_next/static/chunks/3x_gia2m5w9_l.js +147 -0
- package/out/_next/static/chunks/3xs_undkbcqp7.js +367 -0
- package/out/_next/static/chunks/3yktizlgzr6vc.js +4 -0
- package/out/_next/static/chunks/3ytp87o76hzmx.js +100 -0
- package/out/_next/static/chunks/40kvu3lk3s9h2.js +276 -0
- package/out/_next/static/chunks/41c4n9whpyrjc.js +7 -0
- package/out/_next/static/chunks/42dygj7ul4k54.js +33 -0
- package/out/_next/static/chunks/449x6nw2kd7l6.js +119 -0
- package/out/_next/static/chunks/44b7_q6pkf1k9.js +5 -0
- package/out/_next/static/chunks/44qc0zn0tudui.js +2 -0
- package/out/_next/static/chunks/45c05mbjow5wz.js +4 -0
- package/out/_next/static/chunks/turbopack-077hmtqrhcoji.js +1 -0
- package/out/_offline/index.html +3 -2
- package/out/account/forgot-password/index.html +3 -2
- package/out/account/index.html +3 -2
- package/out/assortments/AssortmentDetailPage/index.html +3 -2
- package/out/assortments/index.html +3 -2
- package/out/assortments/new/index.html +3 -2
- package/out/copilot/index.html +3 -2
- package/out/country/CountryDetailPage/index.html +3 -2
- package/out/country/index.html +3 -2
- package/out/country/new/index.html +3 -2
- package/out/currency/CurrencyDetailPage/index.html +3 -2
- package/out/currency/index.html +3 -2
- package/out/currency/new/index.html +3 -2
- package/out/delivery-provider/DeliveryProviderDetailPage/index.html +3 -2
- package/out/delivery-provider/index.html +3 -2
- package/out/delivery-provider/new/index.html +3 -2
- package/out/enrollments/EnrollmentDetailPage/index.html +3 -2
- package/out/enrollments/index.html +3 -2
- package/out/events/EventDetailPage/index.html +3 -2
- package/out/events/index.html +3 -2
- package/out/exports/index.html +3 -2
- package/out/ext/[[...slug]]/index.html +3 -2
- package/out/external/index.html +3 -2
- package/out/filters/FilterDetailPage/index.html +3 -2
- package/out/filters/index.html +3 -2
- package/out/filters/new/index.html +3 -2
- package/out/index.html +3 -2
- package/out/install/index.html +3 -2
- package/out/language/LanguageDetailPage/index.html +3 -2
- package/out/language/index.html +3 -2
- package/out/language/new/index.html +3 -2
- package/out/log-in/index.html +3 -2
- package/out/orders/OrderDetailPage/index.html +3 -2
- package/out/orders/index.html +3 -2
- package/out/payment-provider/PaymentProviderDetailPage/index.html +3 -2
- package/out/payment-provider/index.html +3 -2
- package/out/payment-provider/new/index.html +3 -2
- package/out/products/ProductDetailPage/index.html +3 -2
- package/out/products/index.html +3 -2
- package/out/products/new/index.html +3 -2
- package/out/quotations/QuotationDetailPage/index.html +3 -2
- package/out/quotations/index.html +3 -2
- package/out/reset-password/index.html +3 -2
- package/out/sign-up/index.html +3 -2
- package/out/styleguide/index.html +3 -2
- package/out/tokens/TokenDetailPage/index.html +3 -2
- package/out/tokens/index.html +3 -2
- package/out/users/UserDetailPage/index.html +3 -2
- package/out/users/index.html +3 -2
- package/out/users/new/index.html +3 -2
- package/out/verify-email/index.html +3 -2
- package/out/warehousing-provider/WarehousingProviderDetailPage/index.html +3 -2
- package/out/warehousing-provider/index.html +3 -2
- package/out/warehousing-provider/new/index.html +3 -2
- package/out/works/WorkDetailPage/index.html +3 -2
- package/out/works/WorkQueueListView/index.html +3 -2
- package/out/works/index.html +3 -2
- package/out/works/management/index.html +3 -2
- package/package.json +10 -10
- package/src/modules/accounts/hooks/logOut.ts +26 -0
- package/src/modules/accounts/hooks/useAddEmail.ts +34 -0
- package/src/modules/accounts/hooks/useAddWeb3Address.ts +38 -0
- package/src/modules/accounts/hooks/useAddWebAuthnCredentials.ts +48 -0
- package/src/modules/accounts/hooks/useBulkUserOperations.ts +91 -0
- package/src/modules/accounts/hooks/useChangePassword.ts +36 -0
- package/src/modules/accounts/hooks/useCreateUser.ts +74 -0
- package/src/modules/accounts/hooks/useCreateWebAuthnCredentialCreationOptions.ts +31 -0
- package/src/modules/accounts/hooks/useCreateWebAuthnCredentialRequestOptions.ts +30 -0
- package/src/modules/accounts/hooks/useCurrentUser.ts +44 -0
- package/src/modules/accounts/hooks/useDeleteUser.ts +26 -0
- package/src/modules/accounts/hooks/useEnrollUser.ts +48 -0
- package/src/modules/accounts/hooks/useForgotPassword.ts +35 -0
- package/src/modules/accounts/hooks/useGenerateLoginCredentials.ts +80 -0
- package/src/modules/accounts/hooks/useGenerateWebAuthCredentials.ts +102 -0
- package/src/modules/accounts/hooks/useLoginWithPassword.ts +65 -0
- package/src/modules/accounts/hooks/useLoginWithWebAuthn.ts +38 -0
- package/src/modules/accounts/hooks/useLogoutAllSessions.ts +27 -0
- package/src/modules/accounts/hooks/useRemoveBookmark.ts +36 -0
- package/src/modules/accounts/hooks/useRemoveEmail.ts +40 -0
- package/src/modules/accounts/hooks/useRemoveWeb3Address.ts +38 -0
- package/src/modules/accounts/hooks/useRemoveWebAuthCredentials.ts +36 -0
- package/src/modules/accounts/hooks/useResetPassword.ts +46 -0
- package/src/modules/accounts/hooks/useSendVerificationEmail.ts +35 -0
- package/src/modules/accounts/hooks/useSetPassword.ts +38 -0
- package/src/modules/accounts/hooks/useSetRoles.ts +40 -0
- package/src/modules/accounts/hooks/useSetUserTags.ts +48 -0
- package/src/modules/accounts/hooks/useSetUsername.ts +40 -0
- package/src/modules/accounts/hooks/useUpdateUserAvatar.ts +49 -0
- package/src/modules/accounts/hooks/useUpdateUserProfile.ts +40 -0
- package/src/modules/accounts/hooks/useUser.ts +201 -0
- package/src/modules/accounts/hooks/useUserBookmarks.ts +51 -0
- package/src/modules/accounts/hooks/useUserExport.ts +107 -0
- package/src/modules/accounts/hooks/useUserWebAuthnCredentials.ts +44 -0
- package/src/modules/accounts/hooks/useUsers.ts +82 -0
- package/src/modules/accounts/hooks/useUsersCount.ts +50 -0
- package/src/modules/accounts/hooks/useValidateEmailVerificationToken.ts +34 -0
- package/src/modules/accounts/hooks/useValidateResetPasswordToken.ts +35 -0
- package/src/modules/accounts/hooks/useVerifyEmail.ts +41 -0
- package/src/modules/accounts/hooks/useVerifyWeb3Address.ts +40 -0
- package/src/modules/accounts/index.ts +6 -0
- package/src/modules/assortment/fragments/AssortmentChildrenFragment.ts +16 -0
- package/src/modules/assortment/fragments/AssortmentFragment.ts +31 -0
- package/src/modules/assortment/fragments/AssortmentLinkFragment.ts +18 -0
- package/src/modules/assortment/fragments/AssortmentMediaFragment.ts +19 -0
- package/src/modules/assortment/fragments/AssortmentMediaTextsFragment.ts +12 -0
- package/src/modules/assortment/fragments/AssortmentTextsFragment.ts +14 -0
- package/src/modules/assortment/hooks/useAddAssortmentFilter.ts +46 -0
- package/src/modules/assortment/hooks/useAddAssortmentLink.ts +46 -0
- package/src/modules/assortment/hooks/useAddAssortmentMedia.ts +52 -0
- package/src/modules/assortment/hooks/useAddAssortmentProduct.ts +46 -0
- package/src/modules/assortment/hooks/useAssortment.ts +56 -0
- package/src/modules/assortment/hooks/useAssortmentChildren.ts +58 -0
- package/src/modules/assortment/hooks/useAssortmentExport.ts +60 -0
- package/src/modules/assortment/hooks/useAssortmentFilters.ts +51 -0
- package/src/modules/assortment/hooks/useAssortmentLinks.ts +54 -0
- package/src/modules/assortment/hooks/useAssortmentMedia.ts +57 -0
- package/src/modules/assortment/hooks/useAssortmentPaths.ts +39 -0
- package/src/modules/assortment/hooks/useAssortmentProducts.ts +62 -0
- package/src/modules/assortment/hooks/useAssortments.ts +103 -0
- package/src/modules/assortment/hooks/useAssortmentsCount.ts +51 -0
- package/src/modules/assortment/hooks/useBulkAssortmentOperations.ts +100 -0
- package/src/modules/assortment/hooks/useCreateAssortment.ts +55 -0
- package/src/modules/assortment/hooks/usePrepareAssortmentImport.ts +211 -0
- package/src/modules/assortment/hooks/useRemoveAssortment.ts +36 -0
- package/src/modules/assortment/hooks/useRemoveAssortmentFilter.ts +36 -0
- package/src/modules/assortment/hooks/useRemoveAssortmentLink.ts +36 -0
- package/src/modules/assortment/hooks/useRemoveAssortmentMedia.ts +36 -0
- package/src/modules/assortment/hooks/useRemoveAssortmentProduct.ts +36 -0
- package/src/modules/assortment/hooks/useReorderAssortmentFilters.ts +39 -0
- package/src/modules/assortment/hooks/useReorderAssortmentLinks.ts +37 -0
- package/src/modules/assortment/hooks/useReorderAssortmentMedia.ts +37 -0
- package/src/modules/assortment/hooks/useReorderAssortmentProducts.ts +39 -0
- package/src/modules/assortment/hooks/useTranslatedAssortmentMediaTexts.ts +41 -0
- package/src/modules/assortment/hooks/useTranslatedAssortmentTexts.ts +40 -0
- package/src/modules/assortment/hooks/useUpdateAssortment.ts +43 -0
- package/src/modules/assortment/hooks/useUpdateAssortmentMediaTexts.ts +45 -0
- package/src/modules/assortment/hooks/useUpdateAssortmentTexts.ts +42 -0
- package/src/modules/assortment/index.ts +2 -0
- package/src/modules/common/fragments/AddressFragment.ts +16 -0
- package/src/modules/common/hooks/useApp.ts +11 -0
- package/src/modules/common/hooks/useBulkActionConfirmation.tsx +68 -0
- package/src/modules/common/hooks/useBulkResultHandler.ts +83 -0
- package/src/modules/common/hooks/useBulkSelection.ts +86 -0
- package/src/modules/common/hooks/useCSVExport.ts +94 -0
- package/src/modules/common/hooks/useCSVImport.ts +69 -0
- package/src/modules/common/hooks/useChatEndpointChecker.ts +25 -0
- package/src/modules/common/hooks/useConfirmMediaUpload.ts +45 -0
- package/src/modules/common/hooks/useDashboardMetrics.ts +42 -0
- package/src/modules/common/hooks/useLocalStorage.ts +34 -0
- package/src/modules/common/hooks/useOrderAnalytics.ts +139 -0
- package/src/modules/common/hooks/useOrderItemsAnalytics.ts +107 -0
- package/src/modules/common/hooks/useOutsideClick.ts +29 -0
- package/src/modules/common/hooks/usePortal.ts +54 -0
- package/src/modules/common/hooks/useScrollRestoration.ts +123 -0
- package/src/modules/common/hooks/useShopConfiguration.ts +83 -0
- package/src/modules/common/hooks/useShopInfo.ts +65 -0
- package/src/modules/common/hooks/useStatusTypes.ts +29 -0
- package/src/modules/common/hooks/useSystemRoles.ts +29 -0
- package/src/modules/common/hooks/useTheme.ts +14 -0
- package/src/modules/copilot/hooks/useAvailableTools.ts +92 -0
- package/src/modules/copilot/hooks/useChatManager.ts +169 -0
- package/src/modules/copilot/hooks/useToolTextNormalizer.ts +84 -0
- package/src/modules/country/fragments/CountryFragment.ts +17 -0
- package/src/modules/country/hooks/useCountries.ts +66 -0
- package/src/modules/country/hooks/useCountry.ts +34 -0
- package/src/modules/country/hooks/useCreateCountry.ts +41 -0
- package/src/modules/country/hooks/useRemoveCountry.ts +38 -0
- package/src/modules/country/hooks/useUpdateCountry.ts +42 -0
- package/src/modules/currency/fragments/CurrencyFragment.ts +13 -0
- package/src/modules/currency/hooks/useCreateCurrency.ts +48 -0
- package/src/modules/currency/hooks/useCurrencies.ts +68 -0
- package/src/modules/currency/hooks/useCurrency.ts +34 -0
- package/src/modules/currency/hooks/useRemoveCurrency.ts +38 -0
- package/src/modules/currency/hooks/useUpdateCurrency.ts +47 -0
- package/src/modules/delivery-provider/hooks/useCreateDeliveryProvider.ts +67 -0
- package/src/modules/delivery-provider/hooks/useDeliveryInterfacesByType.ts +38 -0
- package/src/modules/delivery-provider/hooks/useDeliveryProvider.ts +60 -0
- package/src/modules/delivery-provider/hooks/useDeliveryProviderTypes.ts +34 -0
- package/src/modules/delivery-provider/hooks/useDeliveryProviders.ts +59 -0
- package/src/modules/delivery-provider/hooks/useRemoveDeliveryProvider.ts +38 -0
- package/src/modules/delivery-provider/hooks/useUpdateDeliveryProvider.ts +68 -0
- package/src/modules/enrollment/fragments/EnrollmentDetailFragment.ts +110 -0
- package/src/modules/enrollment/fragments/EnrollmentFragment.ts +66 -0
- package/src/modules/enrollment/hooks/useActivateEnrollment.ts +36 -0
- package/src/modules/enrollment/hooks/useEnrollment.ts +39 -0
- package/src/modules/enrollment/hooks/useEnrollments.ts +70 -0
- package/src/modules/enrollment/hooks/useSendEnrollmentEmail.ts +35 -0
- package/src/modules/enrollment/hooks/useSuspendEnrollment.ts +29 -0
- package/src/modules/enrollment/hooks/useTerminateEnrollment.ts +36 -0
- package/src/modules/enrollment/hooks/useUpdateEnrollmentPlan.ts +45 -0
- package/src/modules/enrollment/hooks/useUserEnrollments.ts +61 -0
- package/src/modules/enrollment/index.ts +2 -0
- package/src/modules/event/fragments/EventFragment.ts +12 -0
- package/src/modules/event/hooks/useEvent.ts +32 -0
- package/src/modules/event/hooks/useEventTypes.ts +29 -0
- package/src/modules/event/hooks/useEvents.ts +77 -0
- package/src/modules/filter/fragments/FilterFragment.ts +24 -0
- package/src/modules/filter/fragments/FilterOptionFragment.ts +16 -0
- package/src/modules/filter/fragments/FilterTextsFragment.ts +12 -0
- package/src/modules/filter/hooks/useBulkFilterOperations.ts +59 -0
- package/src/modules/filter/hooks/useCreateFilter.ts +44 -0
- package/src/modules/filter/hooks/useCreateFilterOption.ts +42 -0
- package/src/modules/filter/hooks/useFilter.ts +44 -0
- package/src/modules/filter/hooks/useFilterExport.ts +35 -0
- package/src/modules/filter/hooks/useFilterOptions.ts +40 -0
- package/src/modules/filter/hooks/useFilterTypes.ts +34 -0
- package/src/modules/filter/hooks/useFilters.ts +78 -0
- package/src/modules/filter/hooks/useFiltersCount.ts +37 -0
- package/src/modules/filter/hooks/usePrepareFilterImport.ts +142 -0
- package/src/modules/filter/hooks/useRemoveFilter.ts +34 -0
- package/src/modules/filter/hooks/useRemoveFilterOption.ts +40 -0
- package/src/modules/filter/hooks/useTranslatedFilterTexts.ts +40 -0
- package/src/modules/filter/hooks/useUpdateFilter.ts +38 -0
- package/src/modules/filter/hooks/useUpdateFilterTexts.ts +48 -0
- package/src/modules/filter/index.ts +2 -0
- package/src/modules/forms/hooks/useField.ts +151 -0
- package/src/modules/forms/hooks/useForm.ts +210 -0
- package/src/modules/forms/hooks/useFormContext.ts +7 -0
- package/src/modules/language/fragments/LanguageFragment.ts +13 -0
- package/src/modules/language/hooks/useCreateLanguage.ts +40 -0
- package/src/modules/language/hooks/useLanguage.ts +34 -0
- package/src/modules/language/hooks/useLanguages.ts +64 -0
- package/src/modules/language/hooks/useRemoveLanguage.ts +38 -0
- package/src/modules/language/hooks/useUpdateLanguage.ts +42 -0
- package/src/modules/modal/hooks/useModal.ts +8 -0
- package/src/modules/order/fragments/OrderDetailFragment.ts +255 -0
- package/src/modules/order/fragments/OrderFragment.ts +42 -0
- package/src/modules/order/hooks/useConfirmOrder.ts +36 -0
- package/src/modules/order/hooks/useDeliverOrder.ts +36 -0
- package/src/modules/order/hooks/useOrder.ts +35 -0
- package/src/modules/order/hooks/useOrders.ts +105 -0
- package/src/modules/order/hooks/usePayOrder.ts +36 -0
- package/src/modules/order/hooks/useRejectOrder.ts +36 -0
- package/src/modules/order/hooks/useRemoveOrder.ts +36 -0
- package/src/modules/order/hooks/useUserCart.ts +71 -0
- package/src/modules/order/hooks/useUserOrders.ts +65 -0
- package/src/modules/payment-providers/fragments/PaymentProviderFragment.ts +21 -0
- package/src/modules/payment-providers/hooks/useCreatePaymentProvider.ts +43 -0
- package/src/modules/payment-providers/hooks/usePaymentInterfacesByType.ts +38 -0
- package/src/modules/payment-providers/hooks/usePaymentProvider.ts +39 -0
- package/src/modules/payment-providers/hooks/usePaymentProviderTypes.ts +34 -0
- package/src/modules/payment-providers/hooks/usePaymentProviders.ts +42 -0
- package/src/modules/payment-providers/hooks/useRemovePaymentProvider.ts +38 -0
- package/src/modules/payment-providers/hooks/useUpdatePaymentProvider.ts +47 -0
- package/src/modules/product/fragments/ProductAssignmentFragment.ts +39 -0
- package/src/modules/product/fragments/ProductBriefFragment.ts +57 -0
- package/src/modules/product/fragments/ProductCatalogPriceFragment.ts +23 -0
- package/src/modules/product/fragments/ProductDetailFragment.ts +51 -0
- package/src/modules/product/fragments/ProductDimensionFragment.ts +12 -0
- package/src/modules/product/fragments/ProductMediaFragment.ts +24 -0
- package/src/modules/product/fragments/ProductMediaTextsFragment.ts +12 -0
- package/src/modules/product/fragments/ProductPlanConfigurationFragment.ts +14 -0
- package/src/modules/product/fragments/ProductTextsFragment.ts +17 -0
- package/src/modules/product/fragments/ProductVariationFragment.ts +27 -0
- package/src/modules/product/fragments/TokenFragment.ts +24 -0
- package/src/modules/product/hooks/useAddProductAssignment.ts +46 -0
- package/src/modules/product/hooks/useAddProductMedia.ts +47 -0
- package/src/modules/product/hooks/useBulkProductOperations.ts +123 -0
- package/src/modules/product/hooks/useCreateProduct.ts +72 -0
- package/src/modules/product/hooks/useCreateProductBundleItem.ts +40 -0
- package/src/modules/product/hooks/useCreateProductVariation.ts +46 -0
- package/src/modules/product/hooks/useCreateProductVariationOption.ts +46 -0
- package/src/modules/product/hooks/useExportToken.ts +51 -0
- package/src/modules/product/hooks/useMenuPosition.ts +34 -0
- package/src/modules/product/hooks/usePrepareProductImport.ts +350 -0
- package/src/modules/product/hooks/useProduct.ts +93 -0
- package/src/modules/product/hooks/useProductAssignments.ts +71 -0
- package/src/modules/product/hooks/useProductBundleItems.ts +61 -0
- package/src/modules/product/hooks/useProductCatalogPrices.ts +39 -0
- package/src/modules/product/hooks/useProductExport.ts +90 -0
- package/src/modules/product/hooks/useProductFulfillmentSimulation.ts +137 -0
- package/src/modules/product/hooks/useProductMedia.ts +44 -0
- package/src/modules/product/hooks/useProductPlan.ts +50 -0
- package/src/modules/product/hooks/useProductPlanConfigurationOptions.ts +42 -0
- package/src/modules/product/hooks/useProductReviews.ts +62 -0
- package/src/modules/product/hooks/useProductSupply.ts +52 -0
- package/src/modules/product/hooks/useProductTokenization.ts +51 -0
- package/src/modules/product/hooks/useProductVariationTypes.ts +34 -0
- package/src/modules/product/hooks/useProductVariations.ts +50 -0
- package/src/modules/product/hooks/useProductWarehousing.ts +45 -0
- package/src/modules/product/hooks/useProducts.ts +111 -0
- package/src/modules/product/hooks/useProductsCount.ts +50 -0
- package/src/modules/product/hooks/usePublishProduct.ts +39 -0
- package/src/modules/product/hooks/useReOrderProductMedia.ts +36 -0
- package/src/modules/product/hooks/useRemoveBundleItem.ts +37 -0
- package/src/modules/product/hooks/useRemoveProduct.ts +36 -0
- package/src/modules/product/hooks/useRemoveProductAssignment.ts +40 -0
- package/src/modules/product/hooks/useRemoveProductMedia.ts +36 -0
- package/src/modules/product/hooks/useRemoveProductVariation.ts +36 -0
- package/src/modules/product/hooks/useRemoveProductVariationOption.ts +43 -0
- package/src/modules/product/hooks/useScaffoldBundleItem.ts +38 -0
- package/src/modules/product/hooks/useScaffoldVariationProduct.ts +50 -0
- package/src/modules/product/hooks/useSmartContractStandards.ts +34 -0
- package/src/modules/product/hooks/useTranslatedProductMediaTexts.ts +39 -0
- package/src/modules/product/hooks/useTranslatedProductTexts.ts +42 -0
- package/src/modules/product/hooks/useUnPublishProduct.ts +39 -0
- package/src/modules/product/hooks/useUpdateProduct.ts +46 -0
- package/src/modules/product/hooks/useUpdateProductCommerce.ts +61 -0
- package/src/modules/product/hooks/useUpdateProductMediaTexts.ts +42 -0
- package/src/modules/product/hooks/useUpdateProductPlan.ts +54 -0
- package/src/modules/product/hooks/useUpdateProductSupply.ts +60 -0
- package/src/modules/product/hooks/useUpdateProductTexts.ts +39 -0
- package/src/modules/product/hooks/useUpdateProductTokenization.ts +51 -0
- package/src/modules/product/hooks/useUpdateProductVariationTexts.ts +50 -0
- package/src/modules/product/hooks/useUpdateProductWarehousing.ts +50 -0
- package/src/modules/product/hooks/useUserTokens.ts +48 -0
- package/src/modules/product/index.ts +4 -0
- package/src/modules/product-review/fragments/ProductReviewDetailFragment.ts +55 -0
- package/src/modules/product-review/hooks/useAddProductReviewVote.ts +55 -0
- package/src/modules/product-review/hooks/useCreateProductReview.ts +47 -0
- package/src/modules/product-review/hooks/useProductReviewsByProductId.ts +70 -0
- package/src/modules/product-review/hooks/useRemoveProductReview.ts +38 -0
- package/src/modules/product-review/hooks/useRemoveProductReviewVote.ts +43 -0
- package/src/modules/product-review/hooks/useUserProductReviews.ts +92 -0
- package/src/modules/quotation/fragments/QuotationDetailFragment.ts +70 -0
- package/src/modules/quotation/fragments/QuotationFragment.ts +54 -0
- package/src/modules/quotation/hooks/useMakeQuotationProposal.ts +41 -0
- package/src/modules/quotation/hooks/useQuotation.ts +37 -0
- package/src/modules/quotation/hooks/useQuotations.ts +61 -0
- package/src/modules/quotation/hooks/useRejectQuotation.ts +41 -0
- package/src/modules/quotation/hooks/useUserQuotations.ts +60 -0
- package/src/modules/quotation/hooks/useVerifyQuotation.ts +41 -0
- package/src/modules/search/fragments/GlobalSearchFragment.ts +20 -0
- package/src/modules/search/hooks/useGlobalSearch.ts +168 -0
- package/src/modules/token/hooks/useInvalidateTicket.ts +27 -0
- package/src/modules/token/hooks/useToken.ts +64 -0
- package/src/modules/token/hooks/useTokens.ts +72 -0
- package/src/modules/warehousing-providers/fragments/WarehousingProviderFragment.ts +21 -0
- package/src/modules/warehousing-providers/hooks/useCreateWarehousingProvider.ts +46 -0
- package/src/modules/warehousing-providers/hooks/useRemoveWarehousingProvider.ts +38 -0
- package/src/modules/warehousing-providers/hooks/useUpdateWarehousingProvider.ts +47 -0
- package/src/modules/warehousing-providers/hooks/useWarehousingInterfacesByType.ts +38 -0
- package/src/modules/warehousing-providers/hooks/useWarehousingProvider.ts +39 -0
- package/src/modules/warehousing-providers/hooks/useWarehousingProviderTypes.ts +34 -0
- package/src/modules/warehousing-providers/hooks/useWarehousingProviders.ts +41 -0
- package/src/modules/work/fragments/WorkFragment.ts +24 -0
- package/src/modules/work/hooks/useActiveWorkTypes.ts +29 -0
- package/src/modules/work/hooks/useAddWork.ts +62 -0
- package/src/modules/work/hooks/useAllocateWork.ts +40 -0
- package/src/modules/work/hooks/useRecentExports.ts +129 -0
- package/src/modules/work/hooks/useRegisteredWorkTypes.ts +27 -0
- package/src/modules/work/hooks/useRemoveWork.ts +36 -0
- package/src/modules/work/hooks/useWork.ts +42 -0
- package/src/modules/work/hooks/useWorkQueue.ts +98 -0
- package/src/modules/work/index.ts +1 -0
- package/src/sdk/README.md +12 -3
- package/src/sdk/plugin-navigation.test.mjs +59 -0
- package/out/_next/static/chunks/0-2b37ubdpy0o.js +0 -7
- package/out/_next/static/chunks/012cafv-4m7rj.js +0 -807
- package/out/_next/static/chunks/02dnhll1bce87.js +0 -46
- package/out/_next/static/chunks/02ptvddfjlsxb.js +0 -1
- package/out/_next/static/chunks/03ebenjfvoj8n.js +0 -1
- package/out/_next/static/chunks/03r347235l6c4.js +0 -7
- package/out/_next/static/chunks/05au-xyt__0f2.js +0 -3
- package/out/_next/static/chunks/05nn5xr3ufcsh.js +0 -1
- package/out/_next/static/chunks/05o_q7jg8wucs.js +0 -44
- package/out/_next/static/chunks/05scroolqe8fu.js +0 -234
- package/out/_next/static/chunks/072qxdqjtqvn9.js +0 -11
- package/out/_next/static/chunks/0752goe9_9g2s.js +0 -110
- package/out/_next/static/chunks/07e-sk6v9u-qh.js +0 -807
- package/out/_next/static/chunks/07evy5u8ldd1y.js +0 -50
- package/out/_next/static/chunks/083ylavob4a8d.js +0 -3
- package/out/_next/static/chunks/08jrw03_vxllg.js +0 -54
- package/out/_next/static/chunks/08pag0k09j2b3.js +0 -807
- package/out/_next/static/chunks/09n6h-_l73rez.js +0 -13
- package/out/_next/static/chunks/0_b5faks_mrvi.js +0 -14
- package/out/_next/static/chunks/0a_bg-ub3r2eo.js +0 -60
- package/out/_next/static/chunks/0aqxsjssb0dh9.js +0 -21
- package/out/_next/static/chunks/0aw4jxe6zcc0c.js +0 -32
- package/out/_next/static/chunks/0b0hrx3sbbs70.js +0 -807
- package/out/_next/static/chunks/0bg4_y1qh5y5h.js +0 -47
- package/out/_next/static/chunks/0bgz44wi1lidl.js +0 -13
- package/out/_next/static/chunks/0dcpvidzyamvk.js +0 -100
- package/out/_next/static/chunks/0dnh0kr83_tj0.js +0 -1
- package/out/_next/static/chunks/0dxp17sbyy_dr.js +0 -22
- package/out/_next/static/chunks/0dxu94yin5gdn.js +0 -35
- package/out/_next/static/chunks/0e2c-jlh2q_eq.js +0 -74
- package/out/_next/static/chunks/0el7gr-83bm5j.js +0 -3
- package/out/_next/static/chunks/0f_ofo__wyqsp.js +0 -22
- package/out/_next/static/chunks/0gx9t6j5kx_ho.js +0 -9
- package/out/_next/static/chunks/0h0r_q6xa9qr_.js +0 -1
- package/out/_next/static/chunks/0i9ymn9xxs0nx.js +0 -18
- package/out/_next/static/chunks/0iy11ws57hzzr.js +0 -99
- package/out/_next/static/chunks/0j8_uikfyrn1f.js +0 -1
- package/out/_next/static/chunks/0jeddko6bac8h.js +0 -1
- package/out/_next/static/chunks/0jzx7vxh13cpi.js +0 -15
- package/out/_next/static/chunks/0kody3217__os.js +0 -16
- package/out/_next/static/chunks/0kwo-m1-mo-s-.js +0 -31
- package/out/_next/static/chunks/0lp_pnq1t06sl.js +0 -104
- package/out/_next/static/chunks/0m6jydfuy_4o3.js +0 -1
- package/out/_next/static/chunks/0mez27zlo26ni.js +0 -103
- package/out/_next/static/chunks/0nj8vn3509oe-.js +0 -9
- package/out/_next/static/chunks/0np9pcbt6dmxe.js +0 -25
- package/out/_next/static/chunks/0o7k5vanq57ch.js +0 -807
- package/out/_next/static/chunks/0r5wwinf72z4g.js +0 -1
- package/out/_next/static/chunks/0rqjr_lmrk4pz.js +0 -5
- package/out/_next/static/chunks/0swe0fkt4vyzn.js +0 -136
- package/out/_next/static/chunks/0u4st428hgv1v.js +0 -27
- package/out/_next/static/chunks/0u7--d8_-qyne.js +0 -83
- package/out/_next/static/chunks/0ubzi2s1spm4e.js +0 -342
- package/out/_next/static/chunks/0uecw_5mn0zvr.js +0 -110
- package/out/_next/static/chunks/0uw9cbq0ivaz0.js +0 -1
- package/out/_next/static/chunks/0uxwblyj0htyb.js +0 -1
- package/out/_next/static/chunks/0uyhr7vs9ltp0.js +0 -141
- package/out/_next/static/chunks/0vr19nswhvt2-.js +0 -14
- package/out/_next/static/chunks/0vyvc19p87f_r.js +0 -234
- package/out/_next/static/chunks/0wznlnzc2xsbz.js +0 -16
- package/out/_next/static/chunks/0ycu-q8fcc8ta.js +0 -1
- package/out/_next/static/chunks/0ytserk6fuf71.js +0 -175
- package/out/_next/static/chunks/0zoum0jzrtu0s.js +0 -145
- package/out/_next/static/chunks/1-6s62fsl_z_7.js +0 -126
- package/out/_next/static/chunks/10b6et0qn-pa0.js +0 -59
- package/out/_next/static/chunks/13m7st62a61df.js +0 -25
- package/out/_next/static/chunks/13u_a5l2xngm4.js +0 -1
- package/out/_next/static/chunks/15vz50rks0o2-.js +0 -238
- package/out/_next/static/chunks/1647yxi4ymq0z.js +0 -14
- package/out/_next/static/chunks/16hd7xvkocqxs.js +0 -807
- package/out/_next/static/chunks/16t18hhd4ax36.js +0 -2
- package/out/_next/static/chunks/17wle25pg9jkp.js +0 -11
- package/out/_next/static/chunks/18juy_eauk94g.js +0 -58
- package/out/_next/static/chunks/19eflki8bmivb.js +0 -81
- package/out/_next/static/chunks/19eu5d-wm2hfr.js +0 -23
- package/out/_next/static/chunks/19izcjxrrapb3.js +0 -9
- package/out/_next/static/chunks/1_jbj-c1d2606.js +0 -21
- package/out/_next/static/chunks/1_pwqdjxb6oou.js +0 -226
- package/out/_next/static/chunks/1ae-9ft5cgojf.js +0 -1
- package/out/_next/static/chunks/1bftmuhck_-7b.js +0 -1
- package/out/_next/static/chunks/1bww_2og01jxh.js +0 -807
- package/out/_next/static/chunks/1c0cemuv_tf6i.js +0 -16
- package/out/_next/static/chunks/1c4a2qxtb3r4_.js +0 -16
- package/out/_next/static/chunks/1cjd95y23a9qx.js +0 -1
- package/out/_next/static/chunks/1cy-2yb5j5_9b.js +0 -157
- package/out/_next/static/chunks/1dkv555kaccbl.js +0 -13
- package/out/_next/static/chunks/1dt9_bzfioi8a.js +0 -24
- package/out/_next/static/chunks/1fd7ewfb7bi_g.js +0 -234
- package/out/_next/static/chunks/1gncrqljnmqjn.js +0 -43
- package/out/_next/static/chunks/1gt65pz91hyuz.js +0 -1
- package/out/_next/static/chunks/1iewktf-9h_n8.js +0 -15
- package/out/_next/static/chunks/1l7p7exnzd0c2.js +0 -12
- package/out/_next/static/chunks/1nqu3ymv6lgev.js +0 -3
- package/out/_next/static/chunks/1o_8g-kpuqi9h.js +0 -1
- package/out/_next/static/chunks/1oent0-9-0rgb.js +0 -20
- package/out/_next/static/chunks/1og09fg689_nc.js +0 -180
- package/out/_next/static/chunks/1pj279k5ntty3.js +0 -13
- package/out/_next/static/chunks/1q_sewe1wbxsk.js +0 -54
- package/out/_next/static/chunks/1qvs4gd4rbhb2.js +0 -15
- package/out/_next/static/chunks/1rtv3c_klo0jk.js +0 -1
- package/out/_next/static/chunks/1sdqr2_r6o46f.js +0 -16
- package/out/_next/static/chunks/1vti949e9wuhz.js +0 -15
- package/out/_next/static/chunks/1x-yucftdml28.js +0 -1
- package/out/_next/static/chunks/1xbofs3ibkjvj.js +0 -1
- package/out/_next/static/chunks/1ylgjha1c0ua_.js +0 -124
- package/out/_next/static/chunks/1yp98n-n4gxwy.js +0 -15
- package/out/_next/static/chunks/1zcm_9oew7412.js +0 -14
- package/out/_next/static/chunks/2-e0d1qpp7rk9.js +0 -14
- package/out/_next/static/chunks/20ubrczdsehfm.js +0 -879
- package/out/_next/static/chunks/23m--gc-gjenm.js +0 -3
- package/out/_next/static/chunks/24-pobk4qjjvp.js +0 -3
- package/out/_next/static/chunks/24jptulqn322i.js +0 -15
- package/out/_next/static/chunks/24jyi7e2pq4gy.js +0 -15
- package/out/_next/static/chunks/252jebodi67kg.js +0 -1
- package/out/_next/static/chunks/26eux546aoag5.js +0 -58
- package/out/_next/static/chunks/270ua9t85a7ev.js +0 -5
- package/out/_next/static/chunks/28r_j2kquxrjn.js +0 -807
- package/out/_next/static/chunks/2_ccruvok3u8j.js +0 -16
- package/out/_next/static/chunks/2_ojfjgg8do9t.js +0 -1
- package/out/_next/static/chunks/2aj5aq_c0b4r_.js +0 -13
- package/out/_next/static/chunks/2ba3n9zx9e9q9.js +0 -807
- package/out/_next/static/chunks/2d-hxb31pgpn7.js +0 -13
- package/out/_next/static/chunks/2df2cqwidgpan.js +0 -15
- package/out/_next/static/chunks/2djnsowjy3p8y.js +0 -1
- package/out/_next/static/chunks/2dyj8q92_k5el.js +0 -708
- package/out/_next/static/chunks/2e0k9dt1emjfm.js +0 -1
- package/out/_next/static/chunks/2e3gba1n-yyuj.js +0 -15
- package/out/_next/static/chunks/2e_p1vqr0g_-_.js +0 -7
- package/out/_next/static/chunks/2e_te6sbs_5uw.js +0 -1
- package/out/_next/static/chunks/2f16josk9b_cl.js +0 -8
- package/out/_next/static/chunks/2fo2ki1egxbah.js +0 -39
- package/out/_next/static/chunks/2g8gzs8wpsofk.js +0 -2
- package/out/_next/static/chunks/2gh355-kh19zx.js +0 -13
- package/out/_next/static/chunks/2gr4t5xe0atdr.js +0 -15
- package/out/_next/static/chunks/2ib6fee-nqe-z.js +0 -23
- package/out/_next/static/chunks/2kjux30i3gg-c.js +0 -5
- package/out/_next/static/chunks/2ljoq6sr-g2da.js +0 -1
- package/out/_next/static/chunks/2ll_mqee86g8c.js +0 -1
- package/out/_next/static/chunks/2lx_iig9xewfj.js +0 -52
- package/out/_next/static/chunks/2lylr4-3tu1_t.js +0 -15
- package/out/_next/static/chunks/2n1v8ph2nt43w.js +0 -17
- package/out/_next/static/chunks/2o9hdz0gk1-s7.js +0 -165
- package/out/_next/static/chunks/2oadogfqpak51.js +0 -1
- package/out/_next/static/chunks/2oogwntgnu9rf.js +0 -17
- package/out/_next/static/chunks/2p4e3kh8sa8iq.js +0 -13
- package/out/_next/static/chunks/2q-mpau-4gsvd.js +0 -1
- package/out/_next/static/chunks/2rddaar-ns45d.js +0 -116
- package/out/_next/static/chunks/2s3qhuh87mu_w.js +0 -126
- package/out/_next/static/chunks/2s6u8274_jzk2.js +0 -105
- package/out/_next/static/chunks/2skfzjx2g9hkk.js +0 -134
- package/out/_next/static/chunks/2u6jwsqz0uhes.js +0 -24
- package/out/_next/static/chunks/2v4k4vpb2id7m.js +0 -44
- package/out/_next/static/chunks/2xctb084h1lyg.js +0 -329
- package/out/_next/static/chunks/2xgpwzpd6-tdb.js +0 -234
- package/out/_next/static/chunks/3-soz24u9483h.js +0 -15
- package/out/_next/static/chunks/30_ns6urg1dkn.js +0 -41
- package/out/_next/static/chunks/30nxkqu5mcga3.js +0 -1
- package/out/_next/static/chunks/313i1x81q2xj1.js +0 -1
- package/out/_next/static/chunks/31qwglme02a_r.js +0 -807
- package/out/_next/static/chunks/31sk60zzj3bc5.js +0 -17
- package/out/_next/static/chunks/325a7n__tfxy_.js +0 -61
- package/out/_next/static/chunks/33emlry70k-lv.js +0 -2
- package/out/_next/static/chunks/33v8la4hkia7j.js +0 -1
- package/out/_next/static/chunks/34ar-34flu6bu.js +0 -43
- package/out/_next/static/chunks/34z48lfdm9u0l.js +0 -9
- package/out/_next/static/chunks/351jscvbk_wb9.js +0 -13
- package/out/_next/static/chunks/357odtev0t245.js +0 -59
- package/out/_next/static/chunks/360g4b1clnt45.js +0 -142
- package/out/_next/static/chunks/360uyru28azf6.js +0 -20
- package/out/_next/static/chunks/366apf6d0xh2u.js +0 -30
- package/out/_next/static/chunks/36_zbuqpk5cpj.js +0 -14
- package/out/_next/static/chunks/36aqs7u7s-lb1.js +0 -119
- package/out/_next/static/chunks/36beon3q8orx2.js +0 -1
- package/out/_next/static/chunks/37703j9_zf5_h.js +0 -13
- package/out/_next/static/chunks/37rwzuocwsv_k.js +0 -16
- package/out/_next/static/chunks/37w6b3h04uc4c.js +0 -19
- package/out/_next/static/chunks/38ffn8gazqz8_.js +0 -3
- package/out/_next/static/chunks/38xse6_r51yqp.js +0 -234
- package/out/_next/static/chunks/39s8xbnm9f08v.js +0 -14
- package/out/_next/static/chunks/39x-p8r_sl0ng.js +0 -15
- package/out/_next/static/chunks/39zisxvmik0t_.js +0 -34
- package/out/_next/static/chunks/3_97tge0xvvon.js +0 -11
- package/out/_next/static/chunks/3aw-ri7876ngd.js +0 -39
- package/out/_next/static/chunks/3bv7gi3o6-41h.js +0 -11
- package/out/_next/static/chunks/3cdfuacs4_0d-.js +0 -1
- package/out/_next/static/chunks/3cxpx38ycu7u2.js +0 -9
- package/out/_next/static/chunks/3d1ofcqmlbg-5.js +0 -52
- package/out/_next/static/chunks/3e3i3qqkv_my7.js +0 -15
- package/out/_next/static/chunks/3ex71q3pp_ekc.js +0 -247
- package/out/_next/static/chunks/3g1lpkudwo8kg.js +0 -1
- package/out/_next/static/chunks/3h68t22714to5.js +0 -3
- package/out/_next/static/chunks/3jpzhwqgdnobq.js +0 -103
- package/out/_next/static/chunks/3jxuqt_2-j_uc.js +0 -18
- package/out/_next/static/chunks/3kqqv33l7ssn0.js +0 -16
- package/out/_next/static/chunks/3l-9xxd1i1sya.js +0 -1
- package/out/_next/static/chunks/3mancxzz8c7hl.js +0 -51
- package/out/_next/static/chunks/3mq2s9rfy78je.js +0 -27
- package/out/_next/static/chunks/3om1fkw-lrmng.js +0 -1
- package/out/_next/static/chunks/3oynij37wfjb2.js +0 -119
- package/out/_next/static/chunks/3pbyo5kkko3wh.js +0 -1
- package/out/_next/static/chunks/3pjja1obml896.js +0 -15
- package/out/_next/static/chunks/3qaiz-jwi7q2x.js +0 -1
- package/out/_next/static/chunks/3rh3nigvg06yu.js +0 -337
- package/out/_next/static/chunks/3rppjab6j3_k9.js +0 -1
- package/out/_next/static/chunks/3t_3vlnk1ntkb.js +0 -95
- package/out/_next/static/chunks/3tpo2ho54vtth.js +0 -807
- package/out/_next/static/chunks/3tqspv0ggt8j0.js +0 -17
- package/out/_next/static/chunks/3um54w4ca27n_.js +0 -17
- package/out/_next/static/chunks/3vet2a9q9rf2c.js +0 -61
- package/out/_next/static/chunks/3vjgbl76cgrmt.js +0 -1
- package/out/_next/static/chunks/3vz3gqmojh7sx.js +0 -4
- package/out/_next/static/chunks/3w2e5xa061qou.js +0 -9
- package/out/_next/static/chunks/3w9xrlkiztuwi.js +0 -23
- package/out/_next/static/chunks/3x4xfy_av3o0d.js +0 -1
- package/out/_next/static/chunks/3x9k13s5fam4j.js +0 -22
- package/out/_next/static/chunks/3xmtbqm0gddn8.js +0 -3
- package/out/_next/static/chunks/3z5uyt9mc9_fd.js +0 -2
- package/out/_next/static/chunks/3zlwp96x3hoy9.js +0 -16
- package/out/_next/static/chunks/3zr_sumh1g7il.js +0 -22
- package/out/_next/static/chunks/40jl8yfmy6tp6.js +0 -234
- package/out/_next/static/chunks/40xhwnc_48o73.js +0 -297
- package/out/_next/static/chunks/41-iysd7qkyg1.js +0 -16
- package/out/_next/static/chunks/4105a9rejv_p4.js +0 -1
- package/out/_next/static/chunks/41e2wlkp9_pvk.js +0 -28
- package/out/_next/static/chunks/41g7mv3yuhz6k.js +0 -68
- package/out/_next/static/chunks/43jyzccx6x0lw.js +0 -1
- package/out/_next/static/chunks/43vuxh3wdo567.js +0 -10
- package/out/_next/static/chunks/44daaafswok67.css +0 -1
- package/out/_next/static/chunks/452fv7r-tie6t.js +0 -1
- package/out/_next/static/chunks/457j51b69odrw.js +0 -1
- package/out/_next/static/chunks/turbopack-02vysfmmbped5.js +0 -1
- package/out/_next/static/chunks/turbopack-03fj2scz_09ul.js +0 -1
- package/out/_next/static/chunks/turbopack-07wtduwtfqsl_.js +0 -1
- package/out/_next/static/chunks/turbopack-0_zihh5ueb_wj.js +0 -1
- package/out/_next/static/chunks/turbopack-0b8-ww_z1vgvn.js +0 -1
- package/out/_next/static/chunks/turbopack-0beql_u-wc_3e.js +0 -1
- package/out/_next/static/chunks/turbopack-0dxdn-gyy3_qj.js +0 -1
- package/out/_next/static/chunks/turbopack-0hqw81t-42tbj.js +0 -1
- package/out/_next/static/chunks/turbopack-0jsdrr-oq87lm.js +0 -1
- package/out/_next/static/chunks/turbopack-0jxa33q3ikjqg.js +0 -1
- package/out/_next/static/chunks/turbopack-0k9zths9zte_8.js +0 -1
- package/out/_next/static/chunks/turbopack-0pa42wgwsv141.js +0 -1
- package/out/_next/static/chunks/turbopack-0te09_mp07k1x.js +0 -1
- package/out/_next/static/chunks/turbopack-0xsxl45thi-35.js +0 -1
- package/out/_next/static/chunks/turbopack-10-8q-q2zomxa.js +0 -1
- package/out/_next/static/chunks/turbopack-142w-8owzbg7_.js +0 -1
- package/out/_next/static/chunks/turbopack-18tezl3vagvil.js +0 -1
- package/out/_next/static/chunks/turbopack-1_1a-_v7vml72.js +0 -1
- package/out/_next/static/chunks/turbopack-1_k-7s9lmntml.js +0 -1
- package/out/_next/static/chunks/turbopack-1a47di2tss4e-.js +0 -1
- package/out/_next/static/chunks/turbopack-1c60gn7g-uduw.js +0 -1
- package/out/_next/static/chunks/turbopack-1e1yk3pkaodr5.js +0 -1
- package/out/_next/static/chunks/turbopack-1jtk1c9w2axlk.js +0 -1
- package/out/_next/static/chunks/turbopack-1k2ukl9u-7ovo.js +0 -1
- package/out/_next/static/chunks/turbopack-1lkz81ntcp1zv.js +0 -1
- package/out/_next/static/chunks/turbopack-1pkw_r5dvv20d.js +0 -1
- package/out/_next/static/chunks/turbopack-1pu2s2k3szn0s.js +0 -1
- package/out/_next/static/chunks/turbopack-1rxz_6lqtls5b.js +0 -1
- package/out/_next/static/chunks/turbopack-1uf07pugrv1fy.js +0 -1
- package/out/_next/static/chunks/turbopack-1uobzdn2r7ebw.js +0 -1
- package/out/_next/static/chunks/turbopack-1wv610ktbtzka.js +0 -1
- package/out/_next/static/chunks/turbopack-1wz4te1fj20zp.js +0 -1
- package/out/_next/static/chunks/turbopack-1zi2ss8eiiyfx.js +0 -1
- package/out/_next/static/chunks/turbopack-207p7bsc5wea7.js +0 -1
- package/out/_next/static/chunks/turbopack-21zngkzhonfcm.js +0 -1
- package/out/_next/static/chunks/turbopack-23y20ll8n-nwk.js +0 -1
- package/out/_next/static/chunks/turbopack-26wtylwa4_s95.js +0 -1
- package/out/_next/static/chunks/turbopack-27l7xplqpifq6.js +0 -1
- package/out/_next/static/chunks/turbopack-285oyoobdo21x.js +0 -1
- package/out/_next/static/chunks/turbopack-28b0zyhf3uqaq.js +0 -1
- package/out/_next/static/chunks/turbopack-28m_9eg3draop.js +0 -1
- package/out/_next/static/chunks/turbopack-29h9fgcal-fng.js +0 -1
- package/out/_next/static/chunks/turbopack-2a84kh6nmf_78.js +0 -1
- package/out/_next/static/chunks/turbopack-2b73dx1bsdg5f.js +0 -1
- package/out/_next/static/chunks/turbopack-2bslf96g-y1vv.js +0 -1
- package/out/_next/static/chunks/turbopack-2d-2wg8-_f9-v.js +0 -1
- package/out/_next/static/chunks/turbopack-2ez-mfb63qve0.js +0 -1
- package/out/_next/static/chunks/turbopack-2g7u83j1wlswz.js +0 -1
- package/out/_next/static/chunks/turbopack-2m4gns1_64-7_.js +0 -1
- package/out/_next/static/chunks/turbopack-2n4ba44aafc4x.js +0 -1
- package/out/_next/static/chunks/turbopack-2t3zb47_j-ahd.js +0 -1
- package/out/_next/static/chunks/turbopack-2tf6rdek5zvm6.js +0 -1
- package/out/_next/static/chunks/turbopack-2vb0p2htqo4nd.js +0 -1
- package/out/_next/static/chunks/turbopack-30-bi-9_7jd01.js +0 -1
- package/out/_next/static/chunks/turbopack-32pjcar5xpn1o.js +0 -1
- package/out/_next/static/chunks/turbopack-3a3skasosq9-4.js +0 -1
- package/out/_next/static/chunks/turbopack-3d2rk8-5wcgrs.js +0 -1
- package/out/_next/static/chunks/turbopack-3i91g2le3tkne.js +0 -1
- package/out/_next/static/chunks/turbopack-3j4bdo8-ldea5.js +0 -1
- package/out/_next/static/chunks/turbopack-3m47jybfw85nc.js +0 -1
- package/out/_next/static/chunks/turbopack-3yfksvslbm14s.js +0 -1
- package/out/_next/static/chunks/turbopack-414roft8p92hp.js +0 -1
- package/out/_next/static/chunks/turbopack-424slv1lqxh_5.js +0 -1
- package/out/_next/static/chunks/turbopack-444yt6auyioxn.js +0 -1
- package/out/_next/static/z5KrmhOz2mLscINN5EbUf/_buildManifest.js +0 -262
- /package/dist/{chunk-JED6SHHG.js → chunk-PUI5BIKO.js} +0 -0
- /package/out/_next/static/{z5KrmhOz2mLscINN5EbUf → bg3Z_ZBjStiTvJAHlsPDE}/_clientMiddlewareManifest.js +0 -0
- /package/out/_next/static/{z5KrmhOz2mLscINN5EbUf → bg3Z_ZBjStiTvJAHlsPDE}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { useState, useEffect, useCallback, useMemo } from 'react';
|
|
2
|
+
import { ToolName } from './useToolTextNormalizer';
|
|
3
|
+
import { useIntl } from 'react-intl';
|
|
4
|
+
|
|
5
|
+
export interface Tool {
|
|
6
|
+
name: ToolName;
|
|
7
|
+
description: string;
|
|
8
|
+
category: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface ToolsResponse {
|
|
12
|
+
tools: Tool[];
|
|
13
|
+
cached: boolean;
|
|
14
|
+
timestamp: number;
|
|
15
|
+
error?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface UseAvailableToolsReturn {
|
|
19
|
+
tools: Tool[];
|
|
20
|
+
groupedTools: Record<string, Tool[]>;
|
|
21
|
+
loading: boolean;
|
|
22
|
+
error: string | null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const useAvailableTools = (): UseAvailableToolsReturn => {
|
|
26
|
+
const { formatMessage } = useIntl();
|
|
27
|
+
const [tools, setTools] = useState<Tool[]>([]);
|
|
28
|
+
const [loading, setLoading] = useState(true);
|
|
29
|
+
const [error, setError] = useState<string | null>(null);
|
|
30
|
+
|
|
31
|
+
const fetchTools = useCallback(async () => {
|
|
32
|
+
setLoading(true);
|
|
33
|
+
setError(null);
|
|
34
|
+
|
|
35
|
+
const url = process.env.NEXT_PUBLIC_CHAT_URL
|
|
36
|
+
? `${process.env.NEXT_PUBLIC_CHAT_URL}/tools`
|
|
37
|
+
: '/chat/tools';
|
|
38
|
+
|
|
39
|
+
try {
|
|
40
|
+
const response = await fetch(url, { credentials: 'include' });
|
|
41
|
+
|
|
42
|
+
if (!response.ok) {
|
|
43
|
+
throw new Error(`HTTP error: ${response.statusText}`);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const data: ToolsResponse = await response.json();
|
|
47
|
+
|
|
48
|
+
if (data.error && !data.tools?.length) {
|
|
49
|
+
throw new Error(data.error);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
setTools(data.tools || []);
|
|
53
|
+
} catch (err) {
|
|
54
|
+
const message =
|
|
55
|
+
process.env.NODE_ENV === 'development'
|
|
56
|
+
? null
|
|
57
|
+
: formatMessage({
|
|
58
|
+
id: 'tool_fetch_failed_error',
|
|
59
|
+
defaultMessage: 'Failed to fetch available tools',
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
if (process.env.NODE_ENV === 'development') {
|
|
63
|
+
console.warn(
|
|
64
|
+
'Chat tools endpoint not available, using default tools. This is expected if the backend chat service is not running.',
|
|
65
|
+
err,
|
|
66
|
+
);
|
|
67
|
+
} else {
|
|
68
|
+
console.error('Error fetching tools:', err);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
setError(message);
|
|
72
|
+
setTools([]);
|
|
73
|
+
} finally {
|
|
74
|
+
setLoading(false);
|
|
75
|
+
}
|
|
76
|
+
}, [formatMessage]);
|
|
77
|
+
|
|
78
|
+
useEffect(() => {
|
|
79
|
+
fetchTools();
|
|
80
|
+
}, [fetchTools]);
|
|
81
|
+
|
|
82
|
+
const groupedTools = useMemo(() => {
|
|
83
|
+
return tools.reduce<Record<string, Tool[]>>(
|
|
84
|
+
(acc, tool) => {
|
|
85
|
+
(acc[tool.category] ||= []).push(tool);
|
|
86
|
+
return acc;
|
|
87
|
+
},
|
|
88
|
+
{} as Record<string, Tool[]>,
|
|
89
|
+
);
|
|
90
|
+
}, [tools]);
|
|
91
|
+
return { tools, groupedTools, loading, error };
|
|
92
|
+
};
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
import { useChat } from '@ai-sdk/react';
|
|
3
|
+
import { useIntl } from 'react-intl';
|
|
4
|
+
|
|
5
|
+
import { chatUtils } from '../utils/chatUtils';
|
|
6
|
+
import useLocalStorage from '../../common/hooks/useLocalStorage';
|
|
7
|
+
import { ChatStatus, DefaultChatTransport, UIMessage } from 'ai';
|
|
8
|
+
import { ChatMessage } from '../types';
|
|
9
|
+
|
|
10
|
+
function formatFileLink(url: string): string {
|
|
11
|
+
const extension = url.split('.').pop()?.toLowerCase().split('?')[0] || '';
|
|
12
|
+
const imageExtensions = ['png', 'jpg', 'jpeg', 'gif', 'webp', 'bmp', 'svg'];
|
|
13
|
+
|
|
14
|
+
return imageExtensions.includes(extension)
|
|
15
|
+
? ``
|
|
16
|
+
: `[${url.split('/').pop() || 'file'}](${url})`;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const useChatManager = () => {
|
|
20
|
+
const intl = useIntl();
|
|
21
|
+
const [chatHistory, setChatHistory] = useLocalStorage(
|
|
22
|
+
'copilot-chat-history',
|
|
23
|
+
[],
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
const hasInitialized = useRef(false);
|
|
27
|
+
const {
|
|
28
|
+
messages,
|
|
29
|
+
error,
|
|
30
|
+
resumeStream,
|
|
31
|
+
status,
|
|
32
|
+
setMessages,
|
|
33
|
+
stop,
|
|
34
|
+
regenerate: reload,
|
|
35
|
+
sendMessage,
|
|
36
|
+
} = useChat({
|
|
37
|
+
transport: new DefaultChatTransport({
|
|
38
|
+
api: process.env.NEXT_PUBLIC_CHAT_URL || '/chat',
|
|
39
|
+
credentials: 'include',
|
|
40
|
+
}),
|
|
41
|
+
messages: chatHistory,
|
|
42
|
+
onError: (error) => {
|
|
43
|
+
let errorContent: string;
|
|
44
|
+
const chatUrl = process.env.NEXT_PUBLIC_CHAT_URL || '/chat';
|
|
45
|
+
|
|
46
|
+
if (
|
|
47
|
+
error.message?.includes('401') ||
|
|
48
|
+
error.message?.includes('invalid_token') ||
|
|
49
|
+
error.message?.includes('Unauthorized')
|
|
50
|
+
) {
|
|
51
|
+
errorContent = intl.formatMessage({
|
|
52
|
+
id: 'chat.error.auth',
|
|
53
|
+
defaultMessage:
|
|
54
|
+
'🔐 **Authentication Error**\n\nYour session has expired or the authentication token is invalid.\n\n**To fix this:**\n1. Refresh the page (Ctrl+R / Cmd+R)\n2. Log out and log back in\n3. Check your permissions\n\n*This happens when your session expires after being idle too long.*',
|
|
55
|
+
});
|
|
56
|
+
} else if (
|
|
57
|
+
error.message?.includes('fetch') ||
|
|
58
|
+
error.message?.includes('Failed to fetch') ||
|
|
59
|
+
error.message?.includes('NetworkError')
|
|
60
|
+
) {
|
|
61
|
+
errorContent = intl.formatMessage(
|
|
62
|
+
{
|
|
63
|
+
id: 'chat.error.connection',
|
|
64
|
+
defaultMessage:
|
|
65
|
+
'🚫 **Connection Error**\n\nCannot connect to the chat API server at {chatUrl}.\n\n**To enable chat:**\n1. Start the backend\n2. Ensure chat/MCP endpoint is configured\n3. Check NEXT_PUBLIC_CHAT_URL\n\n**Current configuration:**\n- Chat URL: {chatUrl}\n\n*Please start the backend.*',
|
|
66
|
+
},
|
|
67
|
+
{ chatUrl },
|
|
68
|
+
);
|
|
69
|
+
} else if (
|
|
70
|
+
error.message?.includes('stream') ||
|
|
71
|
+
error.message?.includes('process')
|
|
72
|
+
) {
|
|
73
|
+
errorContent = intl.formatMessage(
|
|
74
|
+
{
|
|
75
|
+
id: 'chat.error.stream',
|
|
76
|
+
defaultMessage:
|
|
77
|
+
'⚠️ **Stream Processing Error**\n\nThere was an error processing the AI response stream.\n\n**Possible causes:**\n1. Backend not running\n2. MCP server not responding\n3. Missing/invalid API keys\n4. Network issues\n\n**Error details:** {details}',
|
|
78
|
+
},
|
|
79
|
+
{ details: error.message },
|
|
80
|
+
);
|
|
81
|
+
} else {
|
|
82
|
+
errorContent = intl.formatMessage(
|
|
83
|
+
{
|
|
84
|
+
id: 'chat.error.unexpected',
|
|
85
|
+
defaultMessage:
|
|
86
|
+
'❌ **Chat Error**\n\nAn unexpected error occurred: {details}\n\n*Please try again or check the console for details.*',
|
|
87
|
+
},
|
|
88
|
+
{ details: error.message },
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const errorMessage: UIMessage = {
|
|
93
|
+
id: `error-${Date.now()}`,
|
|
94
|
+
role: 'assistant',
|
|
95
|
+
parts: [{ type: 'text', text: errorContent }],
|
|
96
|
+
};
|
|
97
|
+
setMessages((prev) => [...prev, errorMessage]);
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
useEffect(() => {
|
|
102
|
+
if (status === 'streaming') return;
|
|
103
|
+
setChatHistory(messages as ChatMessage[]);
|
|
104
|
+
}, [status]);
|
|
105
|
+
|
|
106
|
+
const clearHistory = () => {
|
|
107
|
+
setMessages([]);
|
|
108
|
+
setChatHistory([]);
|
|
109
|
+
hasInitialized.current = false;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const addInterruptionMessage = (currentStatus: ChatStatus) => {
|
|
113
|
+
const interruptionMessage =
|
|
114
|
+
chatUtils.createInterruptionMessage(currentStatus);
|
|
115
|
+
setMessages((prev) => [...prev, interruptionMessage as UIMessage]);
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
const handleSubmit = async (inputText: string, imageUrls?: string[]) => {
|
|
119
|
+
try {
|
|
120
|
+
const assets = imageUrls?.map(formatFileLink).join('\n') ?? '';
|
|
121
|
+
const messageContent = [inputText, assets].filter(Boolean).join('\n');
|
|
122
|
+
|
|
123
|
+
if (inputText) {
|
|
124
|
+
sendMessage({ text: messageContent });
|
|
125
|
+
}
|
|
126
|
+
} catch (error) {
|
|
127
|
+
console.error('Error in handleSubmit:', error);
|
|
128
|
+
|
|
129
|
+
const errorMessage =
|
|
130
|
+
error instanceof Error ? error.message : 'Unknown error';
|
|
131
|
+
|
|
132
|
+
const localizedError =
|
|
133
|
+
errorMessage.includes('401') || errorMessage.includes('Unauthorized')
|
|
134
|
+
? intl.formatMessage({
|
|
135
|
+
id: 'chat.error.auth',
|
|
136
|
+
defaultMessage:
|
|
137
|
+
'🔐 **Authentication Error**\n\nYour session has expired or the authentication token is invalid.\n\n*Please refresh or log in again.*',
|
|
138
|
+
})
|
|
139
|
+
: intl.formatMessage(
|
|
140
|
+
{
|
|
141
|
+
id: 'chat.error.submission',
|
|
142
|
+
defaultMessage:
|
|
143
|
+
'❌ **Submission Error**\n\nFailed to send your message.\n\n**Error:** {details}\n\n*Please ensure the backend is running.*',
|
|
144
|
+
},
|
|
145
|
+
{ details: errorMessage },
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
const chatError: UIMessage = {
|
|
149
|
+
id: `error-${Date.now()}`,
|
|
150
|
+
role: 'assistant',
|
|
151
|
+
parts: [{ type: 'text', text: localizedError }],
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
setMessages((prev) => [...prev, chatError]);
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
return {
|
|
158
|
+
messages,
|
|
159
|
+
handleSubmit,
|
|
160
|
+
error,
|
|
161
|
+
status,
|
|
162
|
+
clearHistory,
|
|
163
|
+
stop,
|
|
164
|
+
addInterruptionMessage,
|
|
165
|
+
sendMessage,
|
|
166
|
+
reload,
|
|
167
|
+
resumeStream,
|
|
168
|
+
};
|
|
169
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
|
|
4
|
+
export type ToolName = any;
|
|
5
|
+
const useToolTextNormalizer = () => {
|
|
6
|
+
const { formatMessage } = useIntl();
|
|
7
|
+
|
|
8
|
+
const normalizeToolName = (toolName: ToolName | string): string => {
|
|
9
|
+
if (!toolName) return '';
|
|
10
|
+
|
|
11
|
+
const parts = toolName.split('_');
|
|
12
|
+
if (parts.length !== 2) return toolName;
|
|
13
|
+
|
|
14
|
+
const [rawSubject, rawAction] = parts;
|
|
15
|
+
const splitCamelCase = (str: string): string[] =>
|
|
16
|
+
str
|
|
17
|
+
.replace(/([a-z0-9])([A-Z])/g, '$1 $2')
|
|
18
|
+
.split(' ')
|
|
19
|
+
.map(capitalize);
|
|
20
|
+
|
|
21
|
+
const match = rawAction.match(/^([a-z]+)(.*)$/);
|
|
22
|
+
const verb = match?.[1] ?? rawAction;
|
|
23
|
+
const action = match?.[2] ?? '';
|
|
24
|
+
|
|
25
|
+
const capitalize = (s: string) => s.charAt(0).toUpperCase() + s.slice(1);
|
|
26
|
+
|
|
27
|
+
const subject = splitCamelCase(rawSubject);
|
|
28
|
+
const word = action ? capitalize(action) : '';
|
|
29
|
+
|
|
30
|
+
return `${capitalize(verb)} ${subject.join(' ')}${word ? ` ${word}` : ''}`;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const getToolDescription = useCallback(
|
|
34
|
+
(toolName: string): string => {
|
|
35
|
+
const name = toolName.toLowerCase();
|
|
36
|
+
|
|
37
|
+
const TOOL_TO_DESCRIPTION_MATCH: Partial<Record<ToolName, string>> = {
|
|
38
|
+
product_management: formatMessage({
|
|
39
|
+
id: 'list_product_tool_definition',
|
|
40
|
+
defaultMessage: 'Show me all draft products',
|
|
41
|
+
}),
|
|
42
|
+
};
|
|
43
|
+
if (TOOL_TO_DESCRIPTION_MATCH[name]) {
|
|
44
|
+
return `"${TOOL_TO_DESCRIPTION_MATCH[name]}"`;
|
|
45
|
+
}
|
|
46
|
+
if (name.includes('assortment'))
|
|
47
|
+
return formatMessage({
|
|
48
|
+
id: 'assortment_management_tool_definition',
|
|
49
|
+
defaultMessage: '"Manage product categories"',
|
|
50
|
+
});
|
|
51
|
+
if (name.includes('media') && name.includes('remove'))
|
|
52
|
+
return formatMessage({
|
|
53
|
+
id: 'media_remover_tool_definition',
|
|
54
|
+
defaultMessage: '"Remove media files"',
|
|
55
|
+
});
|
|
56
|
+
if (name.includes('media') && name.includes('add'))
|
|
57
|
+
return formatMessage({
|
|
58
|
+
id: 'media_add_tool_definition',
|
|
59
|
+
defaultMessage: '"Add media files"',
|
|
60
|
+
});
|
|
61
|
+
if (name.includes('media'))
|
|
62
|
+
return formatMessage({
|
|
63
|
+
id: 'media_management_tool_definition',
|
|
64
|
+
defaultMessage: '"Manage media files"',
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
return formatMessage(
|
|
68
|
+
{
|
|
69
|
+
id: 'general_tool_definition',
|
|
70
|
+
defaultMessage: `"Help me with {toolName}"`,
|
|
71
|
+
},
|
|
72
|
+
{ toolName: normalizeToolName(toolName) },
|
|
73
|
+
);
|
|
74
|
+
},
|
|
75
|
+
[formatMessage],
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
return {
|
|
79
|
+
getToolDescription,
|
|
80
|
+
normalizeToolName,
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export default useToolTextNormalizer;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { gql } from '@apollo/client';
|
|
2
|
+
import { useQuery } from '@apollo/client/react';
|
|
3
|
+
import { ICountriesQuery, ICountriesQueryVariables } from '../../../gql/types';
|
|
4
|
+
import CountryFragment from '../fragments/CountryFragment';
|
|
5
|
+
|
|
6
|
+
const CountriesQuery = gql`
|
|
7
|
+
query Countries(
|
|
8
|
+
$queryString: String
|
|
9
|
+
$limit: Int
|
|
10
|
+
$offset: Int
|
|
11
|
+
$includeInactive: Boolean
|
|
12
|
+
$sort: [SortOptionInput!]
|
|
13
|
+
) {
|
|
14
|
+
countries(
|
|
15
|
+
queryString: $queryString
|
|
16
|
+
limit: $limit
|
|
17
|
+
offset: $offset
|
|
18
|
+
includeInactive: $includeInactive
|
|
19
|
+
sort: $sort
|
|
20
|
+
) {
|
|
21
|
+
...CountryFragment
|
|
22
|
+
}
|
|
23
|
+
countriesCount(includeInactive: $includeInactive, queryString: $queryString)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
${CountryFragment}
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
|
+
const useCountries = ({
|
|
30
|
+
queryString = '',
|
|
31
|
+
limit = 20,
|
|
32
|
+
offset = 0,
|
|
33
|
+
includeInactive = true,
|
|
34
|
+
sort = [],
|
|
35
|
+
skip = false,
|
|
36
|
+
}: ICountriesQueryVariables & { skip?: boolean } = {}) => {
|
|
37
|
+
const { data, loading, error, fetchMore } = useQuery<
|
|
38
|
+
ICountriesQuery,
|
|
39
|
+
ICountriesQueryVariables
|
|
40
|
+
>(CountriesQuery, {
|
|
41
|
+
variables: { queryString, limit, offset, includeInactive, sort },
|
|
42
|
+
errorPolicy: 'all',
|
|
43
|
+
skip,
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const countries = data?.countries || [];
|
|
47
|
+
const countriesCount = data?.countriesCount;
|
|
48
|
+
const hasMore = countries?.length < countriesCount;
|
|
49
|
+
|
|
50
|
+
const loadMore = () => {
|
|
51
|
+
fetchMore({
|
|
52
|
+
variables: { offset: countries?.length },
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
return {
|
|
57
|
+
countries,
|
|
58
|
+
countriesCount,
|
|
59
|
+
hasMore,
|
|
60
|
+
loading,
|
|
61
|
+
error,
|
|
62
|
+
loadMore,
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export default useCountries;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { gql } from '@apollo/client';
|
|
2
|
+
import { useQuery } from '@apollo/client/react';
|
|
3
|
+
import { ICountryQuery, ICountryQueryVariables } from '../../../gql/types';
|
|
4
|
+
import useUnchainedContext from '../../UnchainedContext/useUnchainedContext';
|
|
5
|
+
import CountryFragment from '../fragments/CountryFragment';
|
|
6
|
+
|
|
7
|
+
const GetCountryQuery = (inlineFragment = '') => gql`
|
|
8
|
+
query Country($countryId: ID!) {
|
|
9
|
+
country(countryId: $countryId) {
|
|
10
|
+
...CountryFragment
|
|
11
|
+
${inlineFragment}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
${CountryFragment}
|
|
15
|
+
`;
|
|
16
|
+
|
|
17
|
+
const useCountry = ({ countryId }: ICountryQueryVariables) => {
|
|
18
|
+
const { customProperties } = useUnchainedContext();
|
|
19
|
+
const { data, loading, error } = useQuery<
|
|
20
|
+
ICountryQuery,
|
|
21
|
+
ICountryQueryVariables
|
|
22
|
+
>(GetCountryQuery(customProperties?.Country), {
|
|
23
|
+
skip: !countryId,
|
|
24
|
+
variables: { countryId },
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
country: data?.country,
|
|
29
|
+
loading,
|
|
30
|
+
error,
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export default useCountry;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { gql } from '@apollo/client';
|
|
2
|
+
import { useMutation } from '@apollo/client/react';
|
|
3
|
+
import {
|
|
4
|
+
ICreateCountryMutation,
|
|
5
|
+
ICreateCountryMutationVariables,
|
|
6
|
+
} from '../../../gql/types';
|
|
7
|
+
import CountryFragment from '../fragments/CountryFragment';
|
|
8
|
+
|
|
9
|
+
const CreateCountryMutation = gql`
|
|
10
|
+
mutation CreateCountry($country: CreateCountryInput!) {
|
|
11
|
+
createCountry(country: $country) {
|
|
12
|
+
...CountryFragment
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
${CountryFragment}
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
const useCreateCountry = () => {
|
|
19
|
+
const [createCountryMutation, { data, loading, error }] = useMutation<
|
|
20
|
+
ICreateCountryMutation,
|
|
21
|
+
ICreateCountryMutationVariables
|
|
22
|
+
>(CreateCountryMutation);
|
|
23
|
+
|
|
24
|
+
const createCountry = async ({
|
|
25
|
+
country,
|
|
26
|
+
}: ICreateCountryMutationVariables) => {
|
|
27
|
+
return createCountryMutation({
|
|
28
|
+
variables: { country },
|
|
29
|
+
refetchQueries: ['Countries', 'ShopStatus', 'ShopInfo'],
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
const newCountry = data?.createCountry;
|
|
33
|
+
return {
|
|
34
|
+
createCountry,
|
|
35
|
+
newCountry,
|
|
36
|
+
loading,
|
|
37
|
+
error,
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export default useCreateCountry;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { gql } from '@apollo/client';
|
|
2
|
+
import { useMutation } from '@apollo/client/react';
|
|
3
|
+
import {
|
|
4
|
+
IRemoveCountryMutation,
|
|
5
|
+
IRemoveCountryMutationVariables,
|
|
6
|
+
} from '../../../gql/types';
|
|
7
|
+
import CountryFragment from '../fragments/CountryFragment';
|
|
8
|
+
|
|
9
|
+
const RemoveCountryMutation = gql`
|
|
10
|
+
mutation RemoveCountry($countryId: ID!) {
|
|
11
|
+
removeCountry(countryId: $countryId) {
|
|
12
|
+
...CountryFragment
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
${CountryFragment}
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
const useRemoveCountry = () => {
|
|
19
|
+
const [removeCountryMutation] = useMutation<
|
|
20
|
+
IRemoveCountryMutation,
|
|
21
|
+
IRemoveCountryMutationVariables
|
|
22
|
+
>(RemoveCountryMutation);
|
|
23
|
+
|
|
24
|
+
const removeCountry = async ({
|
|
25
|
+
countryId,
|
|
26
|
+
}: IRemoveCountryMutationVariables) => {
|
|
27
|
+
return removeCountryMutation({
|
|
28
|
+
variables: { countryId },
|
|
29
|
+
refetchQueries: ['Countries', 'ShopStatus', 'ShopInfo'],
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
removeCountry,
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default useRemoveCountry;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { gql } from '@apollo/client';
|
|
2
|
+
import { useMutation } from '@apollo/client/react';
|
|
3
|
+
import {
|
|
4
|
+
IUpdateCountryMutation,
|
|
5
|
+
IUpdateCountryMutationVariables,
|
|
6
|
+
} from '../../../gql/types';
|
|
7
|
+
import CountryFragment from '../fragments/CountryFragment';
|
|
8
|
+
|
|
9
|
+
const UpdateCountryMutation = gql`
|
|
10
|
+
mutation UpdateCountry($country: UpdateCountryInput!, $countryId: ID!) {
|
|
11
|
+
updateCountry(country: $country, countryId: $countryId) {
|
|
12
|
+
...CountryFragment
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
${CountryFragment}
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
const useUpdateCountry = () => {
|
|
19
|
+
const [updateCountryMutation] = useMutation<
|
|
20
|
+
IUpdateCountryMutation,
|
|
21
|
+
IUpdateCountryMutationVariables
|
|
22
|
+
>(UpdateCountryMutation);
|
|
23
|
+
|
|
24
|
+
const updateCountry = async ({
|
|
25
|
+
country,
|
|
26
|
+
countryId,
|
|
27
|
+
}: IUpdateCountryMutationVariables) => {
|
|
28
|
+
return updateCountryMutation({
|
|
29
|
+
variables: {
|
|
30
|
+
country,
|
|
31
|
+
countryId,
|
|
32
|
+
},
|
|
33
|
+
refetchQueries: ['Countries', 'ShopStatus', 'ShopInfo'],
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
updateCountry,
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default useUpdateCountry;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { gql } from '@apollo/client';
|
|
2
|
+
import { useMutation } from '@apollo/client/react';
|
|
3
|
+
import {
|
|
4
|
+
ICreateCurrencyMutation,
|
|
5
|
+
ICreateCurrencyMutationVariables,
|
|
6
|
+
} from '../../../gql/types';
|
|
7
|
+
import CurrencyFragment from '../fragments/CurrencyFragment';
|
|
8
|
+
|
|
9
|
+
const CreateCurrencyMutation = gql`
|
|
10
|
+
mutation CreateCurrency($currency: CreateCurrencyInput!) {
|
|
11
|
+
createCurrency(currency: $currency) {
|
|
12
|
+
...CurrencyFragment
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
${CurrencyFragment}
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
const useCreateCurrency = () => {
|
|
19
|
+
const [createCurrencyMutation, { data, loading, error }] = useMutation<
|
|
20
|
+
ICreateCurrencyMutation,
|
|
21
|
+
ICreateCurrencyMutationVariables
|
|
22
|
+
>(CreateCurrencyMutation);
|
|
23
|
+
|
|
24
|
+
const createCurrency = async ({
|
|
25
|
+
currency: { isoCode, contractAddress, decimals },
|
|
26
|
+
}: ICreateCurrencyMutationVariables) => {
|
|
27
|
+
return createCurrencyMutation({
|
|
28
|
+
variables: {
|
|
29
|
+
currency: {
|
|
30
|
+
isoCode,
|
|
31
|
+
contractAddress,
|
|
32
|
+
decimals: parseInt((decimals || '2') as string, 10),
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
refetchQueries: ['Currencies', 'ShopStatus', 'ShopInfo'],
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
const newCurrency = data?.createCurrency;
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
createCurrency,
|
|
42
|
+
newCurrency,
|
|
43
|
+
error,
|
|
44
|
+
loading,
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export default useCreateCurrency;
|