@unchainedshop/api 4.0.0-rc.3 → 4.0.0-rc.4
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/lib/locale-context.d.ts.map +1 -1
- package/lib/locale-context.js +2 -2
- package/lib/locale-context.js.map +1 -1
- package/lib/mcp/index.d.ts.map +1 -1
- package/lib/mcp/index.js +54 -6
- package/lib/mcp/index.js.map +1 -1
- package/lib/mcp/tools/assortment/addAssortmentFilterHandler.d.ts +28 -0
- package/lib/mcp/tools/assortment/addAssortmentFilterHandler.d.ts.map +1 -0
- package/lib/mcp/tools/assortment/addAssortmentFilterHandler.js +57 -0
- package/lib/mcp/tools/assortment/addAssortmentFilterHandler.js.map +1 -0
- package/lib/mcp/tools/assortment/addAssortmentLinkHandler.d.ts +28 -0
- package/lib/mcp/tools/assortment/addAssortmentLinkHandler.d.ts.map +1 -0
- package/lib/mcp/tools/assortment/addAssortmentLinkHandler.js +56 -0
- package/lib/mcp/tools/assortment/addAssortmentLinkHandler.js.map +1 -0
- package/lib/mcp/tools/assortment/addAssortmentMediaUploadHandler.d.ts +28 -0
- package/lib/mcp/tools/assortment/addAssortmentMediaUploadHandler.d.ts.map +1 -0
- package/lib/mcp/tools/assortment/addAssortmentMediaUploadHandler.js +62 -0
- package/lib/mcp/tools/assortment/addAssortmentMediaUploadHandler.js.map +1 -0
- package/lib/mcp/tools/assortment/addAssortmentProductHandler.d.ts +28 -0
- package/lib/mcp/tools/assortment/addAssortmentProductHandler.d.ts.map +1 -0
- package/lib/mcp/tools/assortment/addAssortmentProductHandler.js +53 -0
- package/lib/mcp/tools/assortment/addAssortmentProductHandler.js.map +1 -0
- package/lib/mcp/tools/assortment/assortmentChildrenHandler.d.ts +24 -0
- package/lib/mcp/tools/assortment/assortmentChildrenHandler.d.ts.map +1 -0
- package/lib/mcp/tools/assortment/assortmentChildrenHandler.js +43 -0
- package/lib/mcp/tools/assortment/assortmentChildrenHandler.js.map +1 -0
- package/lib/mcp/tools/assortment/assortmentFiltersHandler.d.ts +20 -0
- package/lib/mcp/tools/assortment/assortmentFiltersHandler.d.ts.map +1 -0
- package/lib/mcp/tools/assortment/assortmentFiltersHandler.js +37 -0
- package/lib/mcp/tools/assortment/assortmentFiltersHandler.js.map +1 -0
- package/lib/mcp/tools/assortment/assortmentHandler.d.ts +30 -0
- package/lib/mcp/tools/assortment/assortmentHandler.d.ts.map +1 -0
- package/lib/mcp/tools/assortment/assortmentHandler.js +52 -0
- package/lib/mcp/tools/assortment/assortmentHandler.js.map +1 -0
- package/lib/mcp/tools/assortment/assortmentLinksHandler.d.ts +20 -0
- package/lib/mcp/tools/assortment/assortmentLinksHandler.d.ts.map +1 -0
- package/lib/mcp/tools/assortment/assortmentLinksHandler.js +49 -0
- package/lib/mcp/tools/assortment/assortmentLinksHandler.js.map +1 -0
- package/lib/mcp/tools/assortment/assortmentProductsHandler.d.ts +24 -0
- package/lib/mcp/tools/assortment/assortmentProductsHandler.d.ts.map +1 -0
- package/lib/mcp/tools/assortment/assortmentProductsHandler.js +44 -0
- package/lib/mcp/tools/assortment/assortmentProductsHandler.js.map +1 -0
- package/lib/mcp/tools/assortment/assortmentsCountHandler.d.ts +36 -0
- package/lib/mcp/tools/assortment/assortmentsCountHandler.d.ts.map +1 -0
- package/lib/mcp/tools/assortment/assortmentsCountHandler.js +47 -0
- package/lib/mcp/tools/assortment/assortmentsCountHandler.js.map +1 -0
- package/lib/mcp/tools/assortment/assortmentsHandler.d.ts +82 -0
- package/lib/mcp/tools/assortment/assortmentsHandler.d.ts.map +1 -0
- package/lib/mcp/tools/assortment/assortmentsHandler.js +57 -0
- package/lib/mcp/tools/assortment/assortmentsHandler.js.map +1 -0
- package/lib/mcp/tools/assortment/createAssortmentHandler.d.ts +125 -0
- package/lib/mcp/tools/assortment/createAssortmentHandler.d.ts.map +1 -0
- package/lib/mcp/tools/assortment/createAssortmentHandler.js +57 -0
- package/lib/mcp/tools/assortment/createAssortmentHandler.js.map +1 -0
- package/lib/mcp/tools/assortment/removeAssortmentFilterHandler.d.ts +20 -0
- package/lib/mcp/tools/assortment/removeAssortmentFilterHandler.d.ts.map +1 -0
- package/lib/mcp/tools/assortment/removeAssortmentFilterHandler.js +39 -0
- package/lib/mcp/tools/assortment/removeAssortmentFilterHandler.js.map +1 -0
- package/lib/mcp/tools/assortment/removeAssortmentHandler.d.ts +20 -0
- package/lib/mcp/tools/assortment/removeAssortmentHandler.d.ts.map +1 -0
- package/lib/mcp/tools/assortment/removeAssortmentHandler.js +38 -0
- package/lib/mcp/tools/assortment/removeAssortmentHandler.js.map +1 -0
- package/lib/mcp/tools/assortment/removeAssortmentLinkHandler.d.ts +20 -0
- package/lib/mcp/tools/assortment/removeAssortmentLinkHandler.d.ts.map +1 -0
- package/lib/mcp/tools/assortment/removeAssortmentLinkHandler.js +39 -0
- package/lib/mcp/tools/assortment/removeAssortmentLinkHandler.js.map +1 -0
- package/lib/mcp/tools/assortment/removeAssortmentMediaHandler.d.ts +20 -0
- package/lib/mcp/tools/assortment/removeAssortmentMediaHandler.d.ts.map +1 -0
- package/lib/mcp/tools/assortment/removeAssortmentMediaHandler.js +40 -0
- package/lib/mcp/tools/assortment/removeAssortmentMediaHandler.js.map +1 -0
- package/lib/mcp/tools/assortment/removeAssortmentProductHandler.d.ts +20 -0
- package/lib/mcp/tools/assortment/removeAssortmentProductHandler.d.ts.map +1 -0
- package/lib/mcp/tools/assortment/removeAssortmentProductHandler.js +39 -0
- package/lib/mcp/tools/assortment/removeAssortmentProductHandler.js.map +1 -0
- package/lib/mcp/tools/assortment/reorderAssortmentFiltersHandler.d.ts +54 -0
- package/lib/mcp/tools/assortment/reorderAssortmentFiltersHandler.d.ts.map +1 -0
- package/lib/mcp/tools/assortment/reorderAssortmentFiltersHandler.js +42 -0
- package/lib/mcp/tools/assortment/reorderAssortmentFiltersHandler.js.map +1 -0
- package/lib/mcp/tools/assortment/reorderAssortmentLinksHandler.d.ts +54 -0
- package/lib/mcp/tools/assortment/reorderAssortmentLinksHandler.d.ts.map +1 -0
- package/lib/mcp/tools/assortment/reorderAssortmentLinksHandler.js +42 -0
- package/lib/mcp/tools/assortment/reorderAssortmentLinksHandler.js.map +1 -0
- package/lib/mcp/tools/assortment/reorderAssortmentMediaHandler.d.ts +54 -0
- package/lib/mcp/tools/assortment/reorderAssortmentMediaHandler.d.ts.map +1 -0
- package/lib/mcp/tools/assortment/reorderAssortmentMediaHandler.js +42 -0
- package/lib/mcp/tools/assortment/reorderAssortmentMediaHandler.js.map +1 -0
- package/lib/mcp/tools/assortment/reorderAssortmentProductsHandler.d.ts +54 -0
- package/lib/mcp/tools/assortment/reorderAssortmentProductsHandler.d.ts.map +1 -0
- package/lib/mcp/tools/assortment/reorderAssortmentProductsHandler.js +42 -0
- package/lib/mcp/tools/assortment/reorderAssortmentProductsHandler.js.map +1 -0
- package/lib/mcp/tools/assortment/searchAssortmentProductHandler.d.ts +68 -0
- package/lib/mcp/tools/assortment/searchAssortmentProductHandler.d.ts.map +1 -0
- package/lib/mcp/tools/assortment/searchAssortmentProductHandler.js +75 -0
- package/lib/mcp/tools/assortment/searchAssortmentProductHandler.js.map +1 -0
- package/lib/mcp/tools/assortment/setBaseAssortmentHandler.d.ts +20 -0
- package/lib/mcp/tools/assortment/setBaseAssortmentHandler.d.ts.map +1 -0
- package/lib/mcp/tools/assortment/setBaseAssortmentHandler.js +39 -0
- package/lib/mcp/tools/assortment/setBaseAssortmentHandler.js.map +1 -0
- package/lib/mcp/tools/assortment/translatedAssortmentMediaTextsHandler.d.ts +20 -0
- package/lib/mcp/tools/assortment/translatedAssortmentMediaTextsHandler.d.ts.map +1 -0
- package/lib/mcp/tools/assortment/translatedAssortmentMediaTextsHandler.js +35 -0
- package/lib/mcp/tools/assortment/translatedAssortmentMediaTextsHandler.js.map +1 -0
- package/lib/mcp/tools/assortment/translatedAssortmentTextsHandler.d.ts +20 -0
- package/lib/mcp/tools/assortment/translatedAssortmentTextsHandler.d.ts.map +1 -0
- package/lib/mcp/tools/assortment/translatedAssortmentTextsHandler.js +33 -0
- package/lib/mcp/tools/assortment/translatedAssortmentTextsHandler.js.map +1 -0
- package/lib/mcp/tools/assortment/updateAssortmentHandler.d.ts +80 -0
- package/lib/mcp/tools/assortment/updateAssortmentHandler.d.ts.map +1 -0
- package/lib/mcp/tools/assortment/updateAssortmentHandler.js +57 -0
- package/lib/mcp/tools/assortment/updateAssortmentHandler.js.map +1 -0
- package/lib/mcp/tools/assortment/updateAssortmentMediaTextsHandler.d.ts +69 -0
- package/lib/mcp/tools/assortment/updateAssortmentMediaTextsHandler.d.ts.map +1 -0
- package/lib/mcp/tools/assortment/updateAssortmentMediaTextsHandler.js +48 -0
- package/lib/mcp/tools/assortment/updateAssortmentMediaTextsHandler.js.map +1 -0
- package/lib/mcp/tools/country/countriesCountHandler.d.ts +24 -0
- package/lib/mcp/tools/country/countriesCountHandler.d.ts.map +1 -0
- package/lib/mcp/tools/country/countriesCountHandler.js +41 -0
- package/lib/mcp/tools/country/countriesCountHandler.js.map +1 -0
- package/lib/mcp/tools/country/countriesHandler.d.ts +60 -0
- package/lib/mcp/tools/country/countriesHandler.d.ts.map +1 -0
- package/lib/mcp/tools/country/countriesHandler.js +48 -0
- package/lib/mcp/tools/country/countriesHandler.js.map +1 -0
- package/lib/mcp/tools/country/countryHandler.d.ts +20 -0
- package/lib/mcp/tools/country/countryHandler.d.ts.map +1 -0
- package/lib/mcp/tools/country/countryHandler.js +34 -0
- package/lib/mcp/tools/country/countryHandler.js.map +1 -0
- package/lib/mcp/tools/country/createCountryHandler.d.ts +36 -0
- package/lib/mcp/tools/country/createCountryHandler.d.ts.map +1 -0
- package/lib/mcp/tools/country/createCountryHandler.js +41 -0
- package/lib/mcp/tools/country/createCountryHandler.js.map +1 -0
- package/lib/mcp/tools/country/removeCountryHandler.d.ts +20 -0
- package/lib/mcp/tools/country/removeCountryHandler.d.ts.map +1 -0
- package/lib/mcp/tools/country/removeCountryHandler.js +37 -0
- package/lib/mcp/tools/country/removeCountryHandler.js.map +1 -0
- package/lib/mcp/tools/country/updateCountryHandler.d.ts +56 -0
- package/lib/mcp/tools/country/updateCountryHandler.d.ts.map +1 -0
- package/lib/mcp/tools/country/updateCountryHandler.js +53 -0
- package/lib/mcp/tools/country/updateCountryHandler.js.map +1 -0
- package/lib/mcp/tools/currency/createCurrencyHandler.d.ts +52 -0
- package/lib/mcp/tools/currency/createCurrencyHandler.d.ts.map +1 -0
- package/lib/mcp/tools/currency/createCurrencyHandler.js +48 -0
- package/lib/mcp/tools/currency/createCurrencyHandler.js.map +1 -0
- package/lib/mcp/tools/currency/currenciesCountHandler.d.ts +24 -0
- package/lib/mcp/tools/currency/currenciesCountHandler.d.ts.map +1 -0
- package/lib/mcp/tools/currency/currenciesCountHandler.js +40 -0
- package/lib/mcp/tools/currency/currenciesCountHandler.js.map +1 -0
- package/lib/mcp/tools/currency/currenciesHandler.d.ts +60 -0
- package/lib/mcp/tools/currency/currenciesHandler.d.ts.map +1 -0
- package/lib/mcp/tools/currency/currenciesHandler.js +50 -0
- package/lib/mcp/tools/currency/currenciesHandler.js.map +1 -0
- package/lib/mcp/tools/currency/currencyHandler.d.ts +20 -0
- package/lib/mcp/tools/currency/currencyHandler.d.ts.map +1 -0
- package/lib/mcp/tools/currency/currencyHandler.js +34 -0
- package/lib/mcp/tools/currency/currencyHandler.js.map +1 -0
- package/lib/mcp/tools/currency/removeCurrencyHandler.d.ts +20 -0
- package/lib/mcp/tools/currency/removeCurrencyHandler.d.ts.map +1 -0
- package/lib/mcp/tools/currency/removeCurrencyHandler.js +37 -0
- package/lib/mcp/tools/currency/removeCurrencyHandler.js.map +1 -0
- package/lib/mcp/tools/currency/updateCurrencyHandler.d.ts +56 -0
- package/lib/mcp/tools/currency/updateCurrencyHandler.d.ts.map +1 -0
- package/lib/mcp/tools/currency/updateCurrencyHandler.js +48 -0
- package/lib/mcp/tools/currency/updateCurrencyHandler.js.map +1 -0
- package/lib/mcp/tools/filter/createFilterHandler.d.ts +114 -0
- package/lib/mcp/tools/filter/createFilterHandler.d.ts.map +1 -0
- package/lib/mcp/tools/filter/createFilterHandler.js +53 -0
- package/lib/mcp/tools/filter/createFilterHandler.js.map +1 -0
- package/lib/mcp/tools/filter/createFilterOptionHandler.d.ts +73 -0
- package/lib/mcp/tools/filter/createFilterOptionHandler.d.ts.map +1 -0
- package/lib/mcp/tools/filter/createFilterOptionHandler.js +53 -0
- package/lib/mcp/tools/filter/createFilterOptionHandler.js.map +1 -0
- package/lib/mcp/tools/filter/getFilterHandler.d.ts +20 -0
- package/lib/mcp/tools/filter/getFilterHandler.d.ts.map +1 -0
- package/lib/mcp/tools/filter/getFilterHandler.js +38 -0
- package/lib/mcp/tools/filter/getFilterHandler.js.map +1 -0
- package/lib/mcp/tools/filter/getFiltersHandler.d.ts +60 -0
- package/lib/mcp/tools/filter/getFiltersHandler.d.ts.map +1 -0
- package/lib/mcp/tools/filter/getFiltersHandler.js +50 -0
- package/lib/mcp/tools/filter/getFiltersHandler.js.map +1 -0
- package/lib/mcp/tools/filter/removeFilterHandler.d.ts +20 -0
- package/lib/mcp/tools/filter/removeFilterHandler.d.ts.map +1 -0
- package/lib/mcp/tools/filter/removeFilterHandler.js +39 -0
- package/lib/mcp/tools/filter/removeFilterHandler.js.map +1 -0
- package/lib/mcp/tools/filter/removeFilterOptionHandler.d.ts +24 -0
- package/lib/mcp/tools/filter/removeFilterOptionHandler.d.ts.map +1 -0
- package/lib/mcp/tools/filter/removeFilterOptionHandler.js +44 -0
- package/lib/mcp/tools/filter/removeFilterOptionHandler.js.map +1 -0
- package/lib/mcp/tools/filter/translatedFilterTextsHandler.d.ts +24 -0
- package/lib/mcp/tools/filter/translatedFilterTextsHandler.d.ts.map +1 -0
- package/lib/mcp/tools/filter/translatedFilterTextsHandler.js +42 -0
- package/lib/mcp/tools/filter/translatedFilterTextsHandler.js.map +1 -0
- package/lib/mcp/tools/filter/updateFilterHandler.d.ts +58 -0
- package/lib/mcp/tools/filter/updateFilterHandler.d.ts.map +1 -0
- package/lib/mcp/tools/filter/updateFilterHandler.js +44 -0
- package/lib/mcp/tools/filter/updateFilterHandler.js.map +1 -0
- package/lib/mcp/tools/filter/updateFilterTextsHandler.d.ts +73 -0
- package/lib/mcp/tools/filter/updateFilterTextsHandler.d.ts.map +1 -0
- package/lib/mcp/tools/filter/updateFilterTextsHandler.js +46 -0
- package/lib/mcp/tools/filter/updateFilterTextsHandler.js.map +1 -0
- package/lib/mcp/tools/index.d.ts +83 -35
- package/lib/mcp/tools/index.d.ts.map +1 -1
- package/lib/mcp/tools/index.js +83 -35
- package/lib/mcp/tools/index.js.map +1 -1
- package/lib/mcp/tools/language/createLanguageHandler.d.ts +36 -0
- package/lib/mcp/tools/language/createLanguageHandler.d.ts.map +1 -0
- package/lib/mcp/tools/language/createLanguageHandler.js +39 -0
- package/lib/mcp/tools/language/createLanguageHandler.js.map +1 -0
- package/lib/mcp/tools/language/languageHandler.d.ts +20 -0
- package/lib/mcp/tools/language/languageHandler.d.ts.map +1 -0
- package/lib/mcp/tools/language/languageHandler.js +31 -0
- package/lib/mcp/tools/language/languageHandler.js.map +1 -0
- package/lib/mcp/tools/language/languagesCountHandler.d.ts +24 -0
- package/lib/mcp/tools/language/languagesCountHandler.d.ts.map +1 -0
- package/lib/mcp/tools/language/languagesCountHandler.js +36 -0
- package/lib/mcp/tools/language/languagesCountHandler.js.map +1 -0
- package/lib/mcp/tools/language/languagesHandler.d.ts +60 -0
- package/lib/mcp/tools/language/languagesHandler.d.ts.map +1 -0
- package/lib/mcp/tools/language/languagesHandler.js +42 -0
- package/lib/mcp/tools/language/languagesHandler.js.map +1 -0
- package/lib/mcp/tools/language/removeLanguageHandler.d.ts +20 -0
- package/lib/mcp/tools/language/removeLanguageHandler.d.ts.map +1 -0
- package/lib/mcp/tools/language/removeLanguageHandler.js +35 -0
- package/lib/mcp/tools/language/removeLanguageHandler.js.map +1 -0
- package/lib/mcp/tools/language/updateLanguageHandler.d.ts +48 -0
- package/lib/mcp/tools/language/updateLanguageHandler.d.ts.map +1 -0
- package/lib/mcp/tools/language/updateLanguageHandler.js +40 -0
- package/lib/mcp/tools/language/updateLanguageHandler.js.map +1 -0
- package/lib/mcp/tools/product/addProductAssignmentHandler.d.ts +52 -0
- package/lib/mcp/tools/product/addProductAssignmentHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/addProductAssignmentHandler.js +97 -0
- package/lib/mcp/tools/product/addProductAssignmentHandler.js.map +1 -0
- package/lib/mcp/tools/product/addProductMediaUploadHandler.d.ts +28 -0
- package/lib/mcp/tools/product/addProductMediaUploadHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/addProductMediaUploadHandler.js +62 -0
- package/lib/mcp/tools/product/addProductMediaUploadHandler.js.map +1 -0
- package/lib/mcp/tools/product/createProductHandler.d.ts +138 -0
- package/lib/mcp/tools/product/createProductHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/createProductHandler.js +60 -0
- package/lib/mcp/tools/product/createProductHandler.js.map +1 -0
- package/lib/mcp/tools/product/createProductVariationHandler.d.ts +84 -0
- package/lib/mcp/tools/product/createProductVariationHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/createProductVariationHandler.js +73 -0
- package/lib/mcp/tools/product/createProductVariationHandler.js.map +1 -0
- package/lib/mcp/tools/product/createProductVariationOptionHandler.d.ts +60 -0
- package/lib/mcp/tools/product/createProductVariationOptionHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/createProductVariationOptionHandler.js +59 -0
- package/lib/mcp/tools/product/createProductVariationOptionHandler.js.map +1 -0
- package/lib/mcp/tools/product/getProduct.d.ts +48 -0
- package/lib/mcp/tools/product/getProduct.d.ts.map +1 -0
- package/lib/mcp/tools/product/getProduct.js +61 -0
- package/lib/mcp/tools/product/getProduct.js.map +1 -0
- package/lib/mcp/tools/product/listProducts.d.ts +112 -0
- package/lib/mcp/tools/product/listProducts.d.ts.map +1 -0
- package/lib/mcp/tools/product/listProducts.js +110 -0
- package/lib/mcp/tools/product/listProducts.js.map +1 -0
- package/lib/mcp/tools/product/productReviewsCountHandler.d.ts +20 -0
- package/lib/mcp/tools/product/productReviewsCountHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/productReviewsCountHandler.js +30 -0
- package/lib/mcp/tools/product/productReviewsCountHandler.js.map +1 -0
- package/lib/mcp/tools/product/productReviewsHandler.d.ts +56 -0
- package/lib/mcp/tools/product/productReviewsHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/productReviewsHandler.js +45 -0
- package/lib/mcp/tools/product/productReviewsHandler.js.map +1 -0
- package/lib/mcp/tools/product/productsCountHandler.d.ts +32 -0
- package/lib/mcp/tools/product/productsCountHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/productsCountHandler.js +33 -0
- package/lib/mcp/tools/product/productsCountHandler.js.map +1 -0
- package/lib/mcp/tools/product/publishProduct.d.ts +20 -0
- package/lib/mcp/tools/product/publishProduct.d.ts.map +1 -0
- package/lib/mcp/tools/product/publishProduct.js +40 -0
- package/lib/mcp/tools/product/publishProduct.js.map +1 -0
- package/lib/mcp/tools/product/removeProductAssignmentHandler.d.ts +48 -0
- package/lib/mcp/tools/product/removeProductAssignmentHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/removeProductAssignmentHandler.js +51 -0
- package/lib/mcp/tools/product/removeProductAssignmentHandler.js.map +1 -0
- package/lib/mcp/tools/product/removeProductHandler.d.ts +20 -0
- package/lib/mcp/tools/product/removeProductHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/removeProductHandler.js +34 -0
- package/lib/mcp/tools/product/removeProductHandler.js.map +1 -0
- package/lib/mcp/tools/product/removeProductMediaHandler.d.ts +20 -0
- package/lib/mcp/tools/product/removeProductMediaHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/removeProductMediaHandler.js +42 -0
- package/lib/mcp/tools/product/removeProductMediaHandler.js.map +1 -0
- package/lib/mcp/tools/product/removeProductVariationHandler.d.ts +20 -0
- package/lib/mcp/tools/product/removeProductVariationHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/removeProductVariationHandler.js +43 -0
- package/lib/mcp/tools/product/removeProductVariationHandler.js.map +1 -0
- package/lib/mcp/tools/product/removeProductVariationOptionHandler.d.ts +24 -0
- package/lib/mcp/tools/product/removeProductVariationOptionHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/removeProductVariationOptionHandler.js +47 -0
- package/lib/mcp/tools/product/removeProductVariationOptionHandler.js.map +1 -0
- package/lib/mcp/tools/product/reorderProductMediaHandler.d.ts +44 -0
- package/lib/mcp/tools/product/reorderProductMediaHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/reorderProductMediaHandler.js +39 -0
- package/lib/mcp/tools/product/reorderProductMediaHandler.js.map +1 -0
- package/lib/mcp/tools/product/translatedProductMediaTextsHandler.d.ts +20 -0
- package/lib/mcp/tools/product/translatedProductMediaTextsHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/translatedProductMediaTextsHandler.js +33 -0
- package/lib/mcp/tools/product/translatedProductMediaTextsHandler.js.map +1 -0
- package/lib/mcp/tools/product/translatedProductTextsHandler.d.ts +20 -0
- package/lib/mcp/tools/product/translatedProductTextsHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/translatedProductTextsHandler.js +33 -0
- package/lib/mcp/tools/product/translatedProductTextsHandler.js.map +1 -0
- package/lib/mcp/tools/product/translatedProductVariationTextsHandler.d.ts +24 -0
- package/lib/mcp/tools/product/translatedProductVariationTextsHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/translatedProductVariationTextsHandler.js +42 -0
- package/lib/mcp/tools/product/translatedProductVariationTextsHandler.js.map +1 -0
- package/lib/mcp/tools/product/unPublishProduct.d.ts +20 -0
- package/lib/mcp/tools/product/unPublishProduct.d.ts.map +1 -0
- package/lib/mcp/tools/product/unPublishProduct.js +40 -0
- package/lib/mcp/tools/product/unPublishProduct.js.map +1 -0
- package/lib/mcp/tools/product/updateProduct.d.ts +56 -0
- package/lib/mcp/tools/product/updateProduct.d.ts.map +1 -0
- package/lib/mcp/tools/product/updateProduct.js +44 -0
- package/lib/mcp/tools/product/updateProduct.js.map +1 -0
- package/lib/mcp/tools/product/updateProductCommerceHandler.d.ts +166 -0
- package/lib/mcp/tools/product/updateProductCommerceHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/updateProductCommerceHandler.js +64 -0
- package/lib/mcp/tools/product/updateProductCommerceHandler.js.map +1 -0
- package/lib/mcp/tools/product/updateProductMediaTextsHandler.d.ts +56 -0
- package/lib/mcp/tools/product/updateProductMediaTextsHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/updateProductMediaTextsHandler.js +48 -0
- package/lib/mcp/tools/product/updateProductMediaTextsHandler.js.map +1 -0
- package/lib/mcp/tools/product/updateProductPlanHandler.d.ts +72 -0
- package/lib/mcp/tools/product/updateProductPlanHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/updateProductPlanHandler.js +51 -0
- package/lib/mcp/tools/product/updateProductPlanHandler.js.map +1 -0
- package/lib/mcp/tools/product/updateProductSupplyHandler.d.ts +64 -0
- package/lib/mcp/tools/product/updateProductSupplyHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/updateProductSupplyHandler.js +52 -0
- package/lib/mcp/tools/product/updateProductSupplyHandler.js.map +1 -0
- package/lib/mcp/tools/product/updateProductTextsHandler.d.ts +114 -0
- package/lib/mcp/tools/product/updateProductTextsHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/updateProductTextsHandler.js +50 -0
- package/lib/mcp/tools/product/updateProductTextsHandler.js.map +1 -0
- package/lib/mcp/tools/product/updateProductTokenizationHandler.d.ts +72 -0
- package/lib/mcp/tools/product/updateProductTokenizationHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/updateProductTokenizationHandler.js +49 -0
- package/lib/mcp/tools/product/updateProductTokenizationHandler.js.map +1 -0
- package/lib/mcp/tools/product/updateProductWarehousingHandler.d.ts +48 -0
- package/lib/mcp/tools/product/updateProductWarehousingHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/updateProductWarehousingHandler.js +45 -0
- package/lib/mcp/tools/product/updateProductWarehousingHandler.js.map +1 -0
- package/lib/mcp/tools/shopInfoHandler.d.ts +8 -0
- package/lib/mcp/tools/shopInfoHandler.d.ts.map +1 -0
- package/lib/mcp/tools/shopInfoHandler.js +29 -0
- package/lib/mcp/tools/shopInfoHandler.js.map +1 -0
- package/lib/mcp/utils/getNormalizedAssortmentDetails.d.ts +21 -0
- package/lib/mcp/utils/getNormalizedAssortmentDetails.d.ts.map +1 -0
- package/lib/mcp/utils/getNormalizedAssortmentDetails.js +32 -0
- package/lib/mcp/utils/getNormalizedAssortmentDetails.js.map +1 -0
- package/lib/mcp/utils/getNormalizedFilterDetails.d.ts +25 -0
- package/lib/mcp/utils/getNormalizedFilterDetails.d.ts.map +1 -0
- package/lib/mcp/utils/getNormalizedFilterDetails.js +19 -0
- package/lib/mcp/utils/getNormalizedFilterDetails.js.map +1 -0
- package/lib/resolvers/mutations/accounts/createUser.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/createUser.js +5 -0
- package/lib/resolvers/mutations/accounts/createUser.js.map +1 -1
- package/lib/resolvers/queries/index.js +1 -1
- package/lib/resolvers/queries/index.js.map +1 -1
- package/lib/roles/all.d.ts.map +1 -1
- package/lib/roles/all.js +10 -0
- package/lib/roles/all.js.map +1 -1
- package/lib/roles/index.d.ts.map +1 -1
- package/lib/roles/index.js +1 -0
- package/lib/roles/index.js.map +1 -1
- package/package.json +6 -6
- package/src/locale-context.ts +2 -7
- package/src/mcp/index.ts +410 -5
- package/src/mcp/tools/assortment/addAssortmentFilterHandler.ts +62 -0
- package/src/mcp/tools/assortment/addAssortmentLinkHandler.ts +63 -0
- package/src/mcp/tools/assortment/addAssortmentMediaUploadHandler.ts +79 -0
- package/src/mcp/tools/assortment/addAssortmentProductHandler.ts +57 -0
- package/src/mcp/tools/assortment/assortmentChildrenHandler.ts +54 -0
- package/src/mcp/tools/assortment/assortmentFiltersHandler.ts +46 -0
- package/src/mcp/tools/assortment/assortmentHandler.ts +63 -0
- package/src/mcp/tools/assortment/assortmentLinksHandler.ts +61 -0
- package/src/mcp/tools/assortment/assortmentProductsHandler.ts +56 -0
- package/src/mcp/tools/assortment/assortmentsCountHandler.ts +53 -0
- package/src/mcp/tools/assortment/assortmentsHandler.ts +67 -0
- package/src/mcp/tools/assortment/createAssortmentHandler.ts +71 -0
- package/src/mcp/tools/assortment/removeAssortmentFilterHandler.ts +50 -0
- package/src/mcp/tools/assortment/removeAssortmentHandler.ts +44 -0
- package/src/mcp/tools/assortment/removeAssortmentLinkHandler.ts +47 -0
- package/src/mcp/tools/assortment/removeAssortmentMediaHandler.ts +50 -0
- package/src/mcp/tools/assortment/removeAssortmentProductHandler.ts +49 -0
- package/src/mcp/tools/assortment/reorderAssortmentFiltersHandler.ts +53 -0
- package/src/mcp/tools/assortment/reorderAssortmentLinksHandler.ts +53 -0
- package/src/mcp/tools/assortment/reorderAssortmentMediaHandler.ts +53 -0
- package/src/mcp/tools/assortment/reorderAssortmentProductsHandler.ts +53 -0
- package/src/mcp/tools/assortment/searchAssortmentProductHandler.ts +87 -0
- package/src/mcp/tools/assortment/setBaseAssortmentHandler.ts +46 -0
- package/src/mcp/tools/assortment/translatedAssortmentMediaTextsHandler.ts +47 -0
- package/src/mcp/tools/assortment/translatedAssortmentTextsHandler.ts +43 -0
- package/src/mcp/tools/assortment/updateAssortmentHandler.ts +64 -0
- package/src/mcp/tools/assortment/updateAssortmentMediaTextsHandler.ts +64 -0
- package/src/mcp/tools/country/countriesCountHandler.ts +48 -0
- package/src/mcp/tools/{countriesHandler.ts → country/countriesHandler.ts} +1 -1
- package/src/mcp/tools/{countryHandler.ts → country/countryHandler.ts} +2 -2
- package/src/mcp/tools/country/createCountryHandler.ts +47 -0
- package/src/mcp/tools/country/removeCountryHandler.ts +46 -0
- package/src/mcp/tools/country/updateCountryHandler.ts +60 -0
- package/src/mcp/tools/currency/createCurrencyHandler.ts +55 -0
- package/src/mcp/tools/currency/currenciesCountHandler.ts +47 -0
- package/src/mcp/tools/{currenciesHandler.ts → currency/currenciesHandler.ts} +1 -1
- package/src/mcp/tools/{currencyHandler.ts → currency/currencyHandler.ts} +2 -2
- package/src/mcp/tools/currency/removeCurrencyHandler.ts +46 -0
- package/src/mcp/tools/currency/updateCurrencyHandler.ts +56 -0
- package/src/mcp/tools/filter/createFilterHandler.ts +65 -0
- package/src/mcp/tools/filter/createFilterOptionHandler.ts +64 -0
- package/src/mcp/tools/filter/getFilterHandler.ts +46 -0
- package/src/mcp/tools/filter/getFiltersHandler.ts +59 -0
- package/src/mcp/tools/filter/removeFilterHandler.ts +45 -0
- package/src/mcp/tools/filter/removeFilterOptionHandler.ts +50 -0
- package/src/mcp/tools/filter/translatedFilterTextsHandler.ts +53 -0
- package/src/mcp/tools/filter/updateFilterHandler.ts +51 -0
- package/src/mcp/tools/filter/updateFilterTextsHandler.ts +54 -0
- package/src/mcp/tools/index.ts +85 -35
- package/src/mcp/tools/{createLanguageHandler.ts → language/createLanguageHandler.ts} +1 -1
- package/src/mcp/tools/{languageHandler.ts → language/languageHandler.ts} +1 -1
- package/src/mcp/tools/language/languagesCountHandler.ts +43 -0
- package/src/mcp/tools/{languagesHandler.ts → language/languagesHandler.ts} +1 -1
- package/src/mcp/tools/{removeLanguageHandler.ts → language/removeLanguageHandler.ts} +2 -2
- package/src/mcp/tools/{updateLanguageHandler.ts → language/updateLanguageHandler.ts} +2 -2
- package/src/mcp/tools/{addProductAssignmentHandler.ts → product/addProductAssignmentHandler.ts} +3 -3
- package/src/mcp/tools/{addProductMediaUploadHandler.ts → product/addProductMediaUploadHandler.ts} +2 -2
- package/src/mcp/tools/{createProduct.ts → product/createProductHandler.ts} +2 -3
- package/src/mcp/tools/{createProductVariationHandler.ts → product/createProductVariationHandler.ts} +4 -4
- package/src/mcp/tools/{createProductVariationOptionHandler.ts → product/createProductVariationOptionHandler.ts} +4 -4
- package/src/mcp/tools/{getProduct.ts → product/getProduct.ts} +2 -2
- package/src/mcp/tools/{listProducts.ts → product/listProducts.ts} +3 -3
- package/src/mcp/tools/{productReviewsCountHandler.ts → product/productReviewsCountHandler.ts} +1 -1
- package/src/mcp/tools/{productReviewsHandler.ts → product/productReviewsHandler.ts} +2 -2
- package/src/mcp/tools/{productsCountHandler.ts → product/productsCountHandler.ts} +1 -1
- package/src/mcp/tools/{publishProduct.ts → product/publishProduct.ts} +3 -3
- package/src/mcp/tools/{removeProductAssignmentHandler.ts → product/removeProductAssignmentHandler.ts} +3 -3
- package/src/mcp/tools/{removeProductHandler.ts → product/removeProductHandler.ts} +2 -2
- package/src/mcp/tools/{removeProductMediaHandler.ts → product/removeProductMediaHandler.ts} +2 -2
- package/src/mcp/tools/{removeProductVariationHandler.ts → product/removeProductVariationHandler.ts} +3 -3
- package/src/mcp/tools/{removeProductVariationOptionHandler.ts → product/removeProductVariationOptionHandler.ts} +3 -3
- package/src/mcp/tools/{reorderProductMediaHandler.ts → product/reorderProductMediaHandler.ts} +2 -2
- package/src/mcp/tools/product/translatedProductMediaTextsHandler.ts +43 -0
- package/src/mcp/tools/product/translatedProductTextsHandler.ts +43 -0
- package/src/mcp/tools/product/translatedProductVariationTextsHandler.ts +57 -0
- package/src/mcp/tools/{unPublishProduct.ts → product/unPublishProduct.ts} +3 -3
- package/src/mcp/tools/{updateProduct.ts → product/updateProduct.ts} +3 -3
- package/src/mcp/tools/{updateProductCommerceHandler.ts → product/updateProductCommerceHandler.ts} +2 -2
- package/src/mcp/tools/{updateProductMediaTextsHandler.ts → product/updateProductMediaTextsHandler.ts} +8 -3
- package/src/mcp/tools/{updateProductPlanHandler.ts → product/updateProductPlanHandler.ts} +3 -3
- package/src/mcp/tools/{updateProductSupplyHandler.ts → product/updateProductSupplyHandler.ts} +3 -3
- package/src/mcp/tools/{updateProductTextsHandler.ts → product/updateProductTextsHandler.ts} +3 -3
- package/src/mcp/tools/{updateProductTokenizationHandler.ts → product/updateProductTokenizationHandler.ts} +3 -3
- package/src/mcp/tools/{updateProductWarehousingHandler.ts → product/updateProductWarehousingHandler.ts} +3 -3
- package/src/mcp/tools/shopInfoHandler.ts +33 -0
- package/src/mcp/utils/getNormalizedAssortmentDetails.ts +40 -0
- package/src/mcp/utils/getNormalizedFilterDetails.ts +23 -0
- package/src/resolvers/mutations/accounts/createUser.ts +6 -0
- package/src/resolvers/queries/index.ts +1 -1
- package/src/roles/all.ts +10 -0
- package/src/roles/index.ts +1 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Context } from '../../../context.js';
|
|
3
|
+
import { log } from '@unchainedshop/logger';
|
|
4
|
+
|
|
5
|
+
export const CountriesCountSchema = {
|
|
6
|
+
includeInactive: z
|
|
7
|
+
.boolean()
|
|
8
|
+
.optional()
|
|
9
|
+
.default(false)
|
|
10
|
+
.describe('Whether to include inactive countries in the count'),
|
|
11
|
+
queryString: z.string().optional().describe('Optional text search filter'),
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const CountriesCountZodSchema = z.object(CountriesCountSchema);
|
|
15
|
+
|
|
16
|
+
export type CountriesCountParams = z.infer<typeof CountriesCountZodSchema>;
|
|
17
|
+
|
|
18
|
+
// Handler function
|
|
19
|
+
export async function countriesCountHandler(context: Context, params: CountriesCountParams) {
|
|
20
|
+
const { includeInactive = false, queryString } = params;
|
|
21
|
+
const { modules, userId } = context;
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
log(`query countriesCount (includeInactive: ${includeInactive}, query: ${queryString || ''})`, {
|
|
25
|
+
userId,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const count = await modules.countries.count(params);
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
content: [
|
|
32
|
+
{
|
|
33
|
+
type: 'text' as const,
|
|
34
|
+
text: JSON.stringify(count),
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
} catch (error) {
|
|
39
|
+
return {
|
|
40
|
+
content: [
|
|
41
|
+
{
|
|
42
|
+
type: 'text' as const,
|
|
43
|
+
text: `Error counting countries: ${(error as Error).message}`,
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { Context } from '
|
|
3
|
-
import { CountryNotFoundError } from '
|
|
2
|
+
import { Context } from '../../../context.js';
|
|
3
|
+
import { CountryNotFoundError } from '../../../errors.js';
|
|
4
4
|
|
|
5
5
|
export const CountrySchema = {
|
|
6
6
|
countryId: z.string().min(1).describe('The ID of the country to fetch'),
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Context } from '../../../context.js';
|
|
3
|
+
import { log } from '@unchainedshop/logger';
|
|
4
|
+
|
|
5
|
+
export const CreateCountrySchema = {
|
|
6
|
+
country: z.object({
|
|
7
|
+
isoCode: z
|
|
8
|
+
.string()
|
|
9
|
+
.min(2)
|
|
10
|
+
.max(2)
|
|
11
|
+
.toUpperCase()
|
|
12
|
+
.describe('2-letter ISO 3166-1 alpha-2 country code (e.g., "CH", "US")'),
|
|
13
|
+
}),
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const CreateCountryZodSchema = z.object(CreateCountrySchema);
|
|
17
|
+
export type CreateCountryParams = z.infer<typeof CreateCountryZodSchema>;
|
|
18
|
+
|
|
19
|
+
export async function createCountryHandler(context: Context, params: CreateCountryParams) {
|
|
20
|
+
const { country } = params;
|
|
21
|
+
const { modules, userId } = context;
|
|
22
|
+
try {
|
|
23
|
+
log(`handler createCountry: ${country.isoCode}`, { userId });
|
|
24
|
+
|
|
25
|
+
const countryId = await modules.countries.create(country as any);
|
|
26
|
+
|
|
27
|
+
const newCountry = await modules.countries.findCountry({ countryId });
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
content: [
|
|
31
|
+
{
|
|
32
|
+
type: 'text' as const,
|
|
33
|
+
text: JSON.stringify({ country: newCountry }),
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
};
|
|
37
|
+
} catch (error) {
|
|
38
|
+
return {
|
|
39
|
+
content: [
|
|
40
|
+
{
|
|
41
|
+
type: 'text' as const,
|
|
42
|
+
text: `Error creating country: ${(error as Error).message}`,
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Context } from '../../../context.js';
|
|
3
|
+
import { log } from '@unchainedshop/logger';
|
|
4
|
+
import { CountryNotFoundError } from '../../../errors.js';
|
|
5
|
+
|
|
6
|
+
export const RemoveCountrySchema = {
|
|
7
|
+
countryId: z.string().min(1).describe('ID of the country to remove'),
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const RemoveCountryZodSchema = z.object(RemoveCountrySchema);
|
|
11
|
+
|
|
12
|
+
export type RemoveCountryParams = z.infer<typeof RemoveCountryZodSchema>;
|
|
13
|
+
|
|
14
|
+
export async function removeCountryHandler(context: Context, params: RemoveCountryParams) {
|
|
15
|
+
const { countryId } = params;
|
|
16
|
+
const { modules, userId } = context;
|
|
17
|
+
|
|
18
|
+
try {
|
|
19
|
+
log(`handler removeCountry: ${countryId}`, { userId });
|
|
20
|
+
|
|
21
|
+
if (!(await modules.countries.countryExists({ countryId })))
|
|
22
|
+
throw new CountryNotFoundError({ countryId });
|
|
23
|
+
|
|
24
|
+
await modules.countries.delete(countryId);
|
|
25
|
+
|
|
26
|
+
const removedCountry = await modules.countries.findCountry({ countryId });
|
|
27
|
+
|
|
28
|
+
return {
|
|
29
|
+
content: [
|
|
30
|
+
{
|
|
31
|
+
type: 'text' as const,
|
|
32
|
+
text: JSON.stringify({ country: removedCountry }),
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
};
|
|
36
|
+
} catch (error) {
|
|
37
|
+
return {
|
|
38
|
+
content: [
|
|
39
|
+
{
|
|
40
|
+
type: 'text' as const,
|
|
41
|
+
text: `Error removing country: ${(error as Error).message}`,
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Context } from '../../../context.js';
|
|
3
|
+
import { log } from '@unchainedshop/logger';
|
|
4
|
+
import { CountryNotFoundError } from '../../../errors.js';
|
|
5
|
+
|
|
6
|
+
export const UpdateCountrySchema = {
|
|
7
|
+
countryId: z.string().min(1).describe('ID of the country to update'),
|
|
8
|
+
country: z.object({
|
|
9
|
+
isoCode: z
|
|
10
|
+
.string()
|
|
11
|
+
.min(2)
|
|
12
|
+
.max(2)
|
|
13
|
+
.toUpperCase()
|
|
14
|
+
.describe('2-letter ISO 3166-1 alpha-2 country code (e.g., "CH", "US")'),
|
|
15
|
+
isActive: z.boolean().optional().describe('Whether the country is active'),
|
|
16
|
+
defaultCurrencyCode: z
|
|
17
|
+
.string()
|
|
18
|
+
.min(3)
|
|
19
|
+
.max(3)
|
|
20
|
+
.toUpperCase()
|
|
21
|
+
.optional()
|
|
22
|
+
.describe('Default currency code (e.g., "USD", "CHF")'),
|
|
23
|
+
}),
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const UpdateCountryZodSchema = z.object(UpdateCountrySchema);
|
|
27
|
+
export type UpdateCountryParams = z.infer<typeof UpdateCountryZodSchema>;
|
|
28
|
+
|
|
29
|
+
export async function updateCountryHandler(context: Context, params: UpdateCountryParams) {
|
|
30
|
+
const { country, countryId } = params;
|
|
31
|
+
const { modules, userId } = context;
|
|
32
|
+
try {
|
|
33
|
+
log(`handler updateCountry: ${countryId}`, { userId });
|
|
34
|
+
|
|
35
|
+
if (!(await modules.countries.countryExists({ countryId })))
|
|
36
|
+
throw new CountryNotFoundError({ countryId });
|
|
37
|
+
|
|
38
|
+
await modules.countries.update(countryId, country as any);
|
|
39
|
+
|
|
40
|
+
const updatedCountry = await modules.countries.findCountry({ countryId });
|
|
41
|
+
|
|
42
|
+
return {
|
|
43
|
+
content: [
|
|
44
|
+
{
|
|
45
|
+
type: 'text' as const,
|
|
46
|
+
text: JSON.stringify({ country: updatedCountry }),
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
};
|
|
50
|
+
} catch (error) {
|
|
51
|
+
return {
|
|
52
|
+
content: [
|
|
53
|
+
{
|
|
54
|
+
type: 'text' as const,
|
|
55
|
+
text: `Error updating country: ${(error as Error).message}`,
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Context } from '../../../context.js';
|
|
3
|
+
import { log } from '@unchainedshop/logger';
|
|
4
|
+
|
|
5
|
+
export const CreateCurrencySchema = {
|
|
6
|
+
currency: z.object({
|
|
7
|
+
isoCode: z
|
|
8
|
+
.string()
|
|
9
|
+
.min(3)
|
|
10
|
+
.max(3)
|
|
11
|
+
.toUpperCase()
|
|
12
|
+
.describe('3-letter ISO currency code (e.g., "USD", "EUR", "CHF")'),
|
|
13
|
+
contractAddress: z.string().optional().describe('Blockchain contract address (optional)'),
|
|
14
|
+
decimals: z
|
|
15
|
+
.number()
|
|
16
|
+
.int()
|
|
17
|
+
.nonnegative()
|
|
18
|
+
.optional()
|
|
19
|
+
.describe('Decimal precision for the currency (optional)'),
|
|
20
|
+
}),
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const CreateCurrencyZodSchema = z.object(CreateCurrencySchema);
|
|
24
|
+
export type CreateCurrencyParams = z.infer<typeof CreateCurrencyZodSchema>;
|
|
25
|
+
|
|
26
|
+
export async function createCurrencyHandler(context: Context, params: CreateCurrencyParams) {
|
|
27
|
+
const { currency } = params;
|
|
28
|
+
const { modules, userId } = context;
|
|
29
|
+
|
|
30
|
+
try {
|
|
31
|
+
log(`Handler createCurrency: ${currency.isoCode}`, { userId });
|
|
32
|
+
|
|
33
|
+
const currencyId = await modules.currencies.create(currency as any);
|
|
34
|
+
|
|
35
|
+
const newCurrency = await modules.currencies.findCurrency({ currencyId });
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
content: [
|
|
39
|
+
{
|
|
40
|
+
type: 'text' as const,
|
|
41
|
+
text: JSON.stringify({ currency: newCurrency }),
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
};
|
|
45
|
+
} catch (error) {
|
|
46
|
+
return {
|
|
47
|
+
content: [
|
|
48
|
+
{
|
|
49
|
+
type: 'text' as const,
|
|
50
|
+
text: `Error creating currency: ${(error as Error).message}`,
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Context } from '../../../context.js';
|
|
3
|
+
import { log } from '@unchainedshop/logger';
|
|
4
|
+
|
|
5
|
+
export const CurrenciesCountSchema = {
|
|
6
|
+
includeInactive: z
|
|
7
|
+
.boolean()
|
|
8
|
+
.optional()
|
|
9
|
+
.default(false)
|
|
10
|
+
.describe('Include inactive currencies in count'),
|
|
11
|
+
queryString: z.string().optional().describe('Optional search filter'),
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const CurrenciesCountZodSchema = z.object(CurrenciesCountSchema);
|
|
15
|
+
|
|
16
|
+
export type CurrenciesCountParams = z.infer<typeof CurrenciesCountZodSchema>;
|
|
17
|
+
|
|
18
|
+
export async function currenciesCountHandler(context: Context, params: CurrenciesCountParams) {
|
|
19
|
+
const { includeInactive = false, queryString } = params;
|
|
20
|
+
const { modules, userId } = context;
|
|
21
|
+
|
|
22
|
+
try {
|
|
23
|
+
log(`Handler currenciesCount (includeInactive: ${includeInactive}, query: ${queryString ?? ''})`, {
|
|
24
|
+
userId,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const count = await modules.currencies.count(params);
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
content: [
|
|
31
|
+
{
|
|
32
|
+
type: 'text' as const,
|
|
33
|
+
text: JSON.stringify(count),
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
};
|
|
37
|
+
} catch (error) {
|
|
38
|
+
return {
|
|
39
|
+
content: [
|
|
40
|
+
{
|
|
41
|
+
type: 'text' as const,
|
|
42
|
+
text: `Error counting currencies: ${(error as Error).message}`,
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { Context } from '
|
|
3
|
-
import { CurrencyNotFoundError } from '
|
|
2
|
+
import { Context } from '../../../context.js';
|
|
3
|
+
import { CurrencyNotFoundError } from '../../../errors.js';
|
|
4
4
|
|
|
5
5
|
export const CurrencySchema = {
|
|
6
6
|
currencyId: z.string().min(1).describe('The ID of the currency to fetch'),
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Context } from '../../../context.js';
|
|
3
|
+
import { log } from '@unchainedshop/logger';
|
|
4
|
+
import { CurrencyNotFoundError } from '../../../errors.js';
|
|
5
|
+
|
|
6
|
+
export const RemoveCurrencySchema = {
|
|
7
|
+
currencyId: z.string().min(1).describe('ID of the currency to remove'),
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const RemoveCurrencyZodSchema = z.object(RemoveCurrencySchema);
|
|
11
|
+
|
|
12
|
+
export type RemoveCurrencyParams = z.infer<typeof RemoveCurrencyZodSchema>;
|
|
13
|
+
|
|
14
|
+
export async function removeCurrencyHandler(context: Context, params: RemoveCurrencyParams) {
|
|
15
|
+
const { currencyId } = params;
|
|
16
|
+
const { modules, userId } = context;
|
|
17
|
+
|
|
18
|
+
try {
|
|
19
|
+
log(`mutation removeCurrency: ${currencyId}`, { userId });
|
|
20
|
+
|
|
21
|
+
if (!(await modules.currencies.currencyExists({ currencyId })))
|
|
22
|
+
throw new CurrencyNotFoundError({ currencyId });
|
|
23
|
+
|
|
24
|
+
await modules.currencies.delete(currencyId);
|
|
25
|
+
|
|
26
|
+
const removedCurrency = await modules.currencies.findCurrency({ currencyId });
|
|
27
|
+
|
|
28
|
+
return {
|
|
29
|
+
content: [
|
|
30
|
+
{
|
|
31
|
+
type: 'text' as const,
|
|
32
|
+
text: JSON.stringify({ currency: removedCurrency }),
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
};
|
|
36
|
+
} catch (error) {
|
|
37
|
+
return {
|
|
38
|
+
content: [
|
|
39
|
+
{
|
|
40
|
+
type: 'text' as const,
|
|
41
|
+
text: `Error removing currency: ${(error as Error).message}`,
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Context } from '../../../context.js';
|
|
3
|
+
import { log } from '@unchainedshop/logger';
|
|
4
|
+
import { CurrencyNotFoundError } from '../../../errors.js';
|
|
5
|
+
|
|
6
|
+
export const UpdateCurrencySchema = {
|
|
7
|
+
currencyId: z.string().min(1).describe('ID of the currency to update'),
|
|
8
|
+
currency: z.object({
|
|
9
|
+
isoCode: z
|
|
10
|
+
.string()
|
|
11
|
+
.min(3)
|
|
12
|
+
.max(3)
|
|
13
|
+
.toUpperCase()
|
|
14
|
+
.optional()
|
|
15
|
+
.describe('3-letter ISO currency code, e.g., "USD" if not valid throw error'),
|
|
16
|
+
contractAddress: z.string().optional().describe('Blockchain contract address'),
|
|
17
|
+
decimals: z.number().int().nonnegative().optional().describe('Decimal precision'),
|
|
18
|
+
}),
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const UpdateCurrencyZodSchema = z.object(UpdateCurrencySchema);
|
|
22
|
+
export type UpdateCurrencyParams = z.infer<typeof UpdateCurrencyZodSchema>;
|
|
23
|
+
|
|
24
|
+
export async function updateCurrencyHandler(context: Context, params: UpdateCurrencyParams) {
|
|
25
|
+
const { currencyId, currency } = params;
|
|
26
|
+
const { modules, userId } = context;
|
|
27
|
+
|
|
28
|
+
try {
|
|
29
|
+
log(`handler updateCurrency: ${currencyId}`, { userId });
|
|
30
|
+
|
|
31
|
+
if (!(await modules.currencies.currencyExists({ currencyId })))
|
|
32
|
+
throw new CurrencyNotFoundError({ currencyId });
|
|
33
|
+
|
|
34
|
+
await modules.currencies.update(currencyId, currency);
|
|
35
|
+
|
|
36
|
+
const updatedCurrency = await modules.currencies.findCurrency({ currencyId });
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
content: [
|
|
40
|
+
{
|
|
41
|
+
type: 'text' as const,
|
|
42
|
+
text: JSON.stringify({ currency: updatedCurrency }),
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
};
|
|
46
|
+
} catch (error) {
|
|
47
|
+
return {
|
|
48
|
+
content: [
|
|
49
|
+
{
|
|
50
|
+
type: 'text' as const,
|
|
51
|
+
text: `Error updating currency: ${(error as Error).message}`,
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Context } from '../../../context.js';
|
|
3
|
+
import { log } from '@unchainedshop/logger';
|
|
4
|
+
import { FilterDirector } from '@unchainedshop/core';
|
|
5
|
+
import { getNormalizedFilterDetails } from '../../utils/getNormalizedFilterDetails.js';
|
|
6
|
+
|
|
7
|
+
export const CreateFilterInputSchema = z.object({
|
|
8
|
+
key: z.string().min(1).describe('Unique key for the filter'),
|
|
9
|
+
type: z.enum(['SWITCH', 'SINGLE_CHOICE', 'MULTI_CHOICE', 'RANGE']).describe('Type of the filter'),
|
|
10
|
+
options: z.array(z.string().min(1)).optional().describe('Selectable options (if applicable)'),
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export const FilterTextInputSchema = z.object({
|
|
14
|
+
locale: z
|
|
15
|
+
.string()
|
|
16
|
+
.min(1)
|
|
17
|
+
.describe(
|
|
18
|
+
'locale iso code like "en-US", "de-CH" use default defaultLanguageIsoCode in shop info if not explicitly provided. if language is explicitly provided check if it exists',
|
|
19
|
+
),
|
|
20
|
+
title: z.string().min(1),
|
|
21
|
+
subtitle: z.string().optional(),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export const CreateFilterSchema = {
|
|
25
|
+
filter: CreateFilterInputSchema,
|
|
26
|
+
texts: z.array(FilterTextInputSchema).optional(),
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const CreateFilterZodSchema = z.object(CreateFilterSchema);
|
|
30
|
+
|
|
31
|
+
export type CreateFilterParams = z.infer<typeof CreateFilterZodSchema>;
|
|
32
|
+
|
|
33
|
+
export async function createFilterHandler(context: Context, params: CreateFilterParams) {
|
|
34
|
+
const { filter, texts = [] } = params;
|
|
35
|
+
const { modules, userId } = context;
|
|
36
|
+
|
|
37
|
+
try {
|
|
38
|
+
log('handler createFilter', { userId, filter, texts });
|
|
39
|
+
|
|
40
|
+
const newFilter = await modules.filters.create(filter as any);
|
|
41
|
+
|
|
42
|
+
await FilterDirector.invalidateProductIdCache(newFilter, context);
|
|
43
|
+
if (texts) {
|
|
44
|
+
await modules.filters.texts.updateTexts({ filterId: newFilter._id }, texts);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
content: [
|
|
49
|
+
{
|
|
50
|
+
type: 'text' as const,
|
|
51
|
+
text: JSON.stringify({ filter: await getNormalizedFilterDetails(newFilter._id, context) }),
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
};
|
|
55
|
+
} catch (error) {
|
|
56
|
+
return {
|
|
57
|
+
content: [
|
|
58
|
+
{
|
|
59
|
+
type: 'text' as const,
|
|
60
|
+
text: `Error creating filter: ${(error as Error).message}`,
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Context } from '../../../context.js';
|
|
3
|
+
import { log } from '@unchainedshop/logger';
|
|
4
|
+
import { FilterNotFoundError } from '../../../errors.js';
|
|
5
|
+
import { getNormalizedFilterDetails } from '../../utils/getNormalizedFilterDetails.js';
|
|
6
|
+
import { FilterDirector } from '@unchainedshop/core';
|
|
7
|
+
|
|
8
|
+
export const FilterOptionTextInputSchema = z.object({
|
|
9
|
+
locale: z
|
|
10
|
+
.string()
|
|
11
|
+
.min(1)
|
|
12
|
+
.describe(
|
|
13
|
+
'locale iso code like "en-US", "de-CH" use default defaultLanguageIsoCode in shop info if not explicitly provided. if language is explicitly provided check if it exists',
|
|
14
|
+
),
|
|
15
|
+
title: z.string().optional(),
|
|
16
|
+
subtitle: z.string().optional(),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export const CreateFilterOptionSchema = {
|
|
20
|
+
filterId: z.string().min(1).describe('ID of the filter to add the option to'),
|
|
21
|
+
option: z.string().min(1).describe('Value of the new filter option'),
|
|
22
|
+
texts: z.array(FilterOptionTextInputSchema).optional().describe('Localized titles and subtitles'),
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const CreateFilterOptionZodSchema = z.object(CreateFilterOptionSchema);
|
|
26
|
+
|
|
27
|
+
export type CreateFilterOptionParams = z.infer<typeof CreateFilterOptionZodSchema>;
|
|
28
|
+
|
|
29
|
+
export async function createFilterOptionHandler(context: Context, params: CreateFilterOptionParams) {
|
|
30
|
+
const { filterId, option, texts = [] } = params;
|
|
31
|
+
const { modules, userId } = context;
|
|
32
|
+
|
|
33
|
+
try {
|
|
34
|
+
log('handler createFilterOption', { userId, filterId, option, texts });
|
|
35
|
+
|
|
36
|
+
const filter = await getNormalizedFilterDetails(filterId, context);
|
|
37
|
+
if (!filter) throw new FilterNotFoundError({ filterId });
|
|
38
|
+
|
|
39
|
+
const newOptions = await modules.filters.createFilterOption(filterId, { value: option });
|
|
40
|
+
await FilterDirector.invalidateProductIdCache(newOptions, context);
|
|
41
|
+
|
|
42
|
+
if (texts) {
|
|
43
|
+
await modules.filters.texts.updateTexts({ filterId, filterOptionValue: option }, texts);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return {
|
|
47
|
+
content: [
|
|
48
|
+
{
|
|
49
|
+
type: 'text' as const,
|
|
50
|
+
text: JSON.stringify({ filter }),
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
};
|
|
54
|
+
} catch (error) {
|
|
55
|
+
return {
|
|
56
|
+
content: [
|
|
57
|
+
{
|
|
58
|
+
type: 'text' as const,
|
|
59
|
+
text: `Error creating filter option: ${(error as Error).message}`,
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Context } from '../../../context.js';
|
|
3
|
+
import { log } from '@unchainedshop/logger';
|
|
4
|
+
import { FilterNotFoundError } from '../../../errors.js';
|
|
5
|
+
import { getNormalizedFilterDetails } from '../../utils/getNormalizedFilterDetails.js';
|
|
6
|
+
|
|
7
|
+
export const GetFilterSchema = {
|
|
8
|
+
filterId: z.string().min(1).describe('ID of the filter to retrieve'),
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const GetFilterZodSchema = z.object(GetFilterSchema);
|
|
12
|
+
|
|
13
|
+
export type GetFilterParams = z.infer<typeof GetFilterZodSchema>;
|
|
14
|
+
|
|
15
|
+
export async function getFilterHandler(context: Context, params: GetFilterParams) {
|
|
16
|
+
const { filterId } = params;
|
|
17
|
+
const { userId } = context;
|
|
18
|
+
|
|
19
|
+
try {
|
|
20
|
+
log('handler getFilter', { userId, filterId });
|
|
21
|
+
|
|
22
|
+
const filter = await getNormalizedFilterDetails(filterId, context);
|
|
23
|
+
|
|
24
|
+
if (!filter) {
|
|
25
|
+
throw new FilterNotFoundError({ filterId });
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return {
|
|
29
|
+
content: [
|
|
30
|
+
{
|
|
31
|
+
type: 'text' as const,
|
|
32
|
+
text: JSON.stringify({ filter }),
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
};
|
|
36
|
+
} catch (error) {
|
|
37
|
+
return {
|
|
38
|
+
content: [
|
|
39
|
+
{
|
|
40
|
+
type: 'text' as const,
|
|
41
|
+
text: `Error retrieving filter: ${(error as Error).message}`,
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Context } from '../../../context.js';
|
|
3
|
+
import { log } from '@unchainedshop/logger';
|
|
4
|
+
import { getNormalizedFilterDetails } from '../../utils/getNormalizedFilterDetails.js';
|
|
5
|
+
|
|
6
|
+
const SortOptionInputSchema = z.object({
|
|
7
|
+
key: z.string().min(1).describe('Field to sort by'),
|
|
8
|
+
value: z.enum(['ASC', 'DESC']).describe('Sort direction'),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export const GetFiltersSchema = {
|
|
12
|
+
limit: z.number().min(1).max(100).default(20),
|
|
13
|
+
offset: z.number().min(0).default(0),
|
|
14
|
+
includeInactive: z.boolean().default(false),
|
|
15
|
+
queryString: z.string().optional(),
|
|
16
|
+
sort: z.array(SortOptionInputSchema).optional(),
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const GetFiltersZodSchema = z.object(GetFiltersSchema);
|
|
20
|
+
|
|
21
|
+
export type GetFiltersParams = z.infer<typeof GetFiltersZodSchema>;
|
|
22
|
+
|
|
23
|
+
export async function getFiltersHandler(context: Context, params: GetFiltersParams) {
|
|
24
|
+
const { limit, offset, includeInactive, queryString, sort } = params;
|
|
25
|
+
const { modules, userId } = context;
|
|
26
|
+
|
|
27
|
+
try {
|
|
28
|
+
log('handler getFilters', {
|
|
29
|
+
userId,
|
|
30
|
+
limit,
|
|
31
|
+
offset,
|
|
32
|
+
includeInactive,
|
|
33
|
+
queryString,
|
|
34
|
+
sort,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const filters = await modules.filters.findFilters(params as any);
|
|
38
|
+
const normalizedFilters = await await Promise.all(
|
|
39
|
+
filters.map(async ({ _id }) => getNormalizedFilterDetails(_id, context)),
|
|
40
|
+
);
|
|
41
|
+
return {
|
|
42
|
+
content: [
|
|
43
|
+
{
|
|
44
|
+
type: 'text' as const,
|
|
45
|
+
text: JSON.stringify({ filters: normalizedFilters }),
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
};
|
|
49
|
+
} catch (error) {
|
|
50
|
+
return {
|
|
51
|
+
content: [
|
|
52
|
+
{
|
|
53
|
+
type: 'text' as const,
|
|
54
|
+
text: `Error fetching filters: ${(error as Error).message}`,
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|