@unchainedshop/api 4.0.0-rc.15 → 4.0.0-rc.17
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/api-index.d.ts +1 -1
- package/lib/api-index.d.ts.map +1 -1
- package/lib/api-index.js +5 -3
- package/lib/api-index.js.map +1 -1
- package/lib/chat/defaultSystemPrompt.d.ts +3 -0
- package/lib/chat/defaultSystemPrompt.d.ts.map +1 -0
- package/lib/chat/defaultSystemPrompt.js +16 -0
- package/lib/chat/defaultSystemPrompt.js.map +1 -0
- package/lib/chat/generateImageHandler.d.ts +7 -0
- package/lib/chat/generateImageHandler.d.ts.map +1 -0
- package/lib/chat/generateImageHandler.js +64 -0
- package/lib/chat/generateImageHandler.js.map +1 -0
- package/lib/chat/normalizeToolsIndex.d.ts +7 -0
- package/lib/chat/normalizeToolsIndex.d.ts.map +1 -0
- package/lib/chat/normalizeToolsIndex.js +11 -0
- package/lib/chat/normalizeToolsIndex.js.map +1 -0
- package/lib/chat/utils.d.ts +13 -0
- package/lib/chat/utils.d.ts.map +1 -0
- package/lib/chat/utils.js +32 -0
- package/lib/chat/utils.js.map +1 -0
- package/lib/context.d.ts +3 -0
- package/lib/context.d.ts.map +1 -1
- package/lib/context.js +5 -2
- package/lib/context.js.map +1 -1
- package/lib/createGraphQLServer.d.ts +7 -4
- package/lib/createGraphQLServer.d.ts.map +1 -1
- package/lib/createGraphQLServer.js +6 -6
- package/lib/createGraphQLServer.js.map +1 -1
- package/lib/errors.d.ts +1 -0
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +1 -0
- package/lib/errors.js.map +1 -1
- package/lib/express/chatHandler.d.ts +5 -0
- package/lib/express/chatHandler.d.ts.map +1 -0
- package/lib/express/chatHandler.js +165 -0
- package/lib/express/chatHandler.js.map +1 -0
- package/lib/express/createApolloMiddleware.d.ts +4 -0
- package/lib/express/createApolloMiddleware.d.ts.map +1 -0
- package/lib/express/createApolloMiddleware.js +36 -0
- package/lib/express/createApolloMiddleware.js.map +1 -0
- package/lib/express/createBulkImportMiddleware.d.ts.map +1 -1
- package/lib/express/createBulkImportMiddleware.js +8 -7
- package/lib/express/createBulkImportMiddleware.js.map +1 -1
- package/lib/express/createERCMetadataMiddleware.d.ts.map +1 -1
- package/lib/express/createERCMetadataMiddleware.js +9 -11
- package/lib/express/createERCMetadataMiddleware.js.map +1 -1
- package/lib/express/createMCPMiddleware.js +1 -1
- package/lib/express/createMCPMiddleware.js.map +1 -1
- package/lib/express/createSingleSignOnMiddleware.d.ts +5 -0
- package/lib/express/createSingleSignOnMiddleware.d.ts.map +1 -0
- package/lib/express/createSingleSignOnMiddleware.js +71 -0
- package/lib/express/createSingleSignOnMiddleware.js.map +1 -0
- package/lib/express/createTempUploadMiddleware.d.ts.map +1 -1
- package/lib/express/createTempUploadMiddleware.js +6 -8
- package/lib/express/createTempUploadMiddleware.js.map +1 -1
- package/lib/express/index.d.ts +1 -0
- package/lib/express/index.d.ts.map +1 -1
- package/lib/express/index.js +2 -1
- package/lib/express/index.js.map +1 -1
- package/lib/fastify/bulkImportHandler.d.ts.map +1 -1
- package/lib/fastify/bulkImportHandler.js +7 -6
- package/lib/fastify/bulkImportHandler.js.map +1 -1
- package/lib/fastify/chatHandler.d.ts +4 -0
- package/lib/fastify/chatHandler.d.ts.map +1 -0
- package/lib/fastify/chatHandler.js +157 -0
- package/lib/fastify/chatHandler.js.map +1 -0
- package/lib/fastify/ercMetadataHandler.d.ts.map +1 -1
- package/lib/fastify/ercMetadataHandler.js +4 -7
- package/lib/fastify/ercMetadataHandler.js.map +1 -1
- package/lib/fastify/index.d.ts +6 -1
- package/lib/fastify/index.d.ts.map +1 -1
- package/lib/fastify/index.js +29 -1
- package/lib/fastify/index.js.map +1 -1
- package/lib/fastify/mcpHandler.js +2 -2
- package/lib/fastify/mcpHandler.js.map +1 -1
- package/lib/fastify/tempUploadHandler.d.ts.map +1 -1
- package/lib/fastify/tempUploadHandler.js +5 -6
- package/lib/fastify/tempUploadHandler.js.map +1 -1
- package/lib/hashPassword.d.ts +2 -0
- package/lib/hashPassword.d.ts.map +1 -0
- package/lib/hashPassword.js +5 -0
- package/lib/hashPassword.js.map +1 -0
- package/lib/loaders/assortmentLinksLoader.d.ts.map +1 -1
- package/lib/loaders/assortmentLinksLoader.js +7 -4
- package/lib/loaders/assortmentLinksLoader.js.map +1 -1
- package/lib/loaders/assortmentMediasLoader.d.ts +2 -2
- package/lib/loaders/assortmentMediasLoader.d.ts.map +1 -1
- package/lib/loaders/assortmentMediasLoader.js.map +1 -1
- package/lib/loaders/filterTextLoader.d.ts +2 -2
- package/lib/loaders/filterTextLoader.d.ts.map +1 -1
- package/lib/loaders/filterTextLoader.js.map +1 -1
- package/lib/loaders/index.d.ts +8 -8
- package/lib/loaders/productMediasLoader.d.ts +2 -2
- package/lib/loaders/productMediasLoader.d.ts.map +1 -1
- package/lib/loaders/productMediasLoader.js.map +1 -1
- package/lib/loaders/productProxiesLoader.d.ts +2 -2
- package/lib/loaders/productProxiesLoader.d.ts.map +1 -1
- package/lib/loaders/productProxiesLoader.js.map +1 -1
- package/lib/loaders/utils.js +1 -1
- package/lib/loaders/utils.js.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 +4 -0
- package/lib/mcp/index.js.map +1 -1
- package/lib/mcp/resources/localization.d.ts +4 -0
- package/lib/mcp/resources/localization.d.ts.map +1 -0
- package/lib/mcp/resources/localization.js +93 -0
- package/lib/mcp/resources/localization.js.map +1 -0
- package/lib/mcp/tools/assortment/handlers/addAssortmentFilter.d.ts +24 -1
- package/lib/mcp/tools/assortment/handlers/addAssortmentFilter.d.ts.map +1 -1
- package/lib/mcp/tools/assortment/handlers/addAssortmentLink.d.ts +24 -1
- package/lib/mcp/tools/assortment/handlers/addAssortmentLink.d.ts.map +1 -1
- package/lib/mcp/tools/assortment/handlers/addAssortmentMedia.d.ts +24 -1
- package/lib/mcp/tools/assortment/handlers/addAssortmentMedia.d.ts.map +1 -1
- package/lib/mcp/tools/assortment/handlers/addAssortmentProduct.d.ts +24 -1
- package/lib/mcp/tools/assortment/handlers/addAssortmentProduct.d.ts.map +1 -1
- package/lib/mcp/tools/assortment/handlers/createAssortment.d.ts +25 -1
- package/lib/mcp/tools/assortment/handlers/createAssortment.d.ts.map +1 -1
- package/lib/mcp/tools/assortment/handlers/getAssortment.d.ts +24 -1
- package/lib/mcp/tools/assortment/handlers/getAssortment.d.ts.map +1 -1
- package/lib/mcp/tools/assortment/handlers/getAssortmentChildren.d.ts +48 -2
- package/lib/mcp/tools/assortment/handlers/getAssortmentChildren.d.ts.map +1 -1
- package/lib/mcp/tools/assortment/handlers/getAssortmentFilters.d.ts +33 -10
- package/lib/mcp/tools/assortment/handlers/getAssortmentFilters.d.ts.map +1 -1
- package/lib/mcp/tools/assortment/handlers/getAssortmentLinks.d.ts +51 -2
- package/lib/mcp/tools/assortment/handlers/getAssortmentLinks.d.ts.map +1 -1
- package/lib/mcp/tools/assortment/handlers/getAssortmentMedia.d.ts +30 -2
- package/lib/mcp/tools/assortment/handlers/getAssortmentMedia.d.ts.map +1 -1
- package/lib/mcp/tools/assortment/handlers/getAssortmentProducts.d.ts +46 -18
- package/lib/mcp/tools/assortment/handlers/getAssortmentProducts.d.ts.map +1 -1
- package/lib/mcp/tools/assortment/handlers/listAssortments.d.ts +24 -1
- package/lib/mcp/tools/assortment/handlers/listAssortments.d.ts.map +1 -1
- package/lib/mcp/tools/assortment/handlers/removeAssortment.js +2 -2
- package/lib/mcp/tools/assortment/handlers/removeAssortment.js.map +1 -1
- package/lib/mcp/tools/assortment/handlers/removeAssortmentFilter.js +2 -2
- package/lib/mcp/tools/assortment/handlers/removeAssortmentFilter.js.map +1 -1
- package/lib/mcp/tools/assortment/handlers/removeAssortmentLink.js +2 -2
- package/lib/mcp/tools/assortment/handlers/removeAssortmentLink.js.map +1 -1
- package/lib/mcp/tools/assortment/handlers/removeAssortmentProduct.js +2 -2
- package/lib/mcp/tools/assortment/handlers/removeAssortmentProduct.js.map +1 -1
- package/lib/mcp/tools/assortment/handlers/reorderAssortmentFilters.d.ts +9 -9
- package/lib/mcp/tools/assortment/handlers/reorderAssortmentLinks.d.ts +27 -1
- package/lib/mcp/tools/assortment/handlers/reorderAssortmentLinks.d.ts.map +1 -1
- package/lib/mcp/tools/assortment/handlers/reorderAssortmentMedia.d.ts +6 -1
- package/lib/mcp/tools/assortment/handlers/reorderAssortmentMedia.d.ts.map +1 -1
- package/lib/mcp/tools/assortment/handlers/reorderAssortmentProducts.d.ts +22 -17
- package/lib/mcp/tools/assortment/handlers/reorderAssortmentProducts.d.ts.map +1 -1
- package/lib/mcp/tools/assortment/handlers/searchAssortmentProducts.d.ts +43 -15
- package/lib/mcp/tools/assortment/handlers/searchAssortmentProducts.d.ts.map +1 -1
- package/lib/mcp/tools/assortment/handlers/setAssortmentBase.d.ts +24 -1
- package/lib/mcp/tools/assortment/handlers/setAssortmentBase.d.ts.map +1 -1
- package/lib/mcp/tools/assortment/handlers/updateAssortment.d.ts +24 -1
- package/lib/mcp/tools/assortment/handlers/updateAssortment.d.ts.map +1 -1
- package/lib/mcp/tools/assortment/handlers/updateAssortmentMediaTexts.d.ts +7 -1
- package/lib/mcp/tools/assortment/handlers/updateAssortmentMediaTexts.d.ts.map +1 -1
- package/lib/mcp/tools/assortment/handlers/updateAssortmentMediaTexts.js.map +1 -1
- package/lib/mcp/tools/assortment/handlers/updateAssortmentStatus.d.ts +24 -1
- package/lib/mcp/tools/assortment/handlers/updateAssortmentStatus.d.ts.map +1 -1
- package/lib/mcp/tools/assortment/schemas.d.ts +478 -478
- package/lib/mcp/tools/assortment/schemas.js +1 -1
- package/lib/mcp/tools/assortment/schemas.js.map +1 -1
- package/lib/mcp/tools/filter/handlers/createFilter.d.ts +12 -11
- package/lib/mcp/tools/filter/handlers/createFilter.d.ts.map +1 -1
- package/lib/mcp/tools/filter/handlers/createFilter.js.map +1 -1
- package/lib/mcp/tools/filter/handlers/createFilterOption.d.ts +14 -11
- package/lib/mcp/tools/filter/handlers/createFilterOption.d.ts.map +1 -1
- package/lib/mcp/tools/filter/handlers/createFilterOption.js +4 -2
- package/lib/mcp/tools/filter/handlers/createFilterOption.js.map +1 -1
- package/lib/mcp/tools/filter/handlers/getFilter.d.ts +10 -10
- package/lib/mcp/tools/filter/handlers/listFilters.d.ts +10 -10
- package/lib/mcp/tools/filter/handlers/removeFilterOption.d.ts +12 -10
- package/lib/mcp/tools/filter/handlers/removeFilterOption.d.ts.map +1 -1
- package/lib/mcp/tools/filter/handlers/removeFilterOption.js +2 -0
- package/lib/mcp/tools/filter/handlers/removeFilterOption.js.map +1 -1
- package/lib/mcp/tools/filter/handlers/updateFilter.d.ts +10 -10
- package/lib/mcp/tools/filter/handlers/updateFilterTexts.d.ts +13 -12
- package/lib/mcp/tools/filter/handlers/updateFilterTexts.d.ts.map +1 -1
- package/lib/mcp/tools/filter/handlers/updateFilterTexts.js.map +1 -1
- package/lib/mcp/tools/filter/schemas.d.ts +266 -266
- package/lib/mcp/tools/localization/handlers/getLocalization.d.ts +1 -1
- package/lib/mcp/tools/localization/index.js +1 -1
- package/lib/mcp/tools/localization/index.js.map +1 -1
- package/lib/mcp/tools/localization/schemas.d.ts +154 -154
- package/lib/mcp/tools/order/handlers/confirmOrder.d.ts +38 -57
- package/lib/mcp/tools/order/handlers/confirmOrder.d.ts.map +1 -1
- package/lib/mcp/tools/order/handlers/deliverOrder.d.ts +38 -57
- package/lib/mcp/tools/order/handlers/deliverOrder.d.ts.map +1 -1
- package/lib/mcp/tools/order/handlers/deliverOrder.js +7 -4
- package/lib/mcp/tools/order/handlers/deliverOrder.js.map +1 -1
- package/lib/mcp/tools/order/handlers/getMonthlyBreakdown.d.ts +10 -0
- package/lib/mcp/tools/order/handlers/getMonthlyBreakdown.d.ts.map +1 -1
- package/lib/mcp/tools/order/handlers/getOrder.d.ts +38 -57
- package/lib/mcp/tools/order/handlers/getOrder.d.ts.map +1 -1
- package/lib/mcp/tools/order/handlers/getSalesSummary.d.ts +10 -0
- package/lib/mcp/tools/order/handlers/getSalesSummary.d.ts.map +1 -1
- package/lib/mcp/tools/order/handlers/getTopCustomers.d.ts +13 -13
- package/lib/mcp/tools/order/handlers/getTopCustomers.d.ts.map +1 -1
- package/lib/mcp/tools/order/handlers/getTopCustomers.js +10 -7
- package/lib/mcp/tools/order/handlers/getTopCustomers.js.map +1 -1
- package/lib/mcp/tools/order/handlers/getTopProducts.d.ts +20 -15
- package/lib/mcp/tools/order/handlers/getTopProducts.d.ts.map +1 -1
- package/lib/mcp/tools/order/handlers/getUserCart.d.ts +38 -57
- package/lib/mcp/tools/order/handlers/getUserCart.d.ts.map +1 -1
- package/lib/mcp/tools/order/handlers/listOrders.d.ts +39 -58
- package/lib/mcp/tools/order/handlers/listOrders.d.ts.map +1 -1
- package/lib/mcp/tools/order/handlers/payOrder.d.ts +38 -57
- package/lib/mcp/tools/order/handlers/payOrder.d.ts.map +1 -1
- package/lib/mcp/tools/order/handlers/payOrder.js +7 -4
- package/lib/mcp/tools/order/handlers/payOrder.js.map +1 -1
- package/lib/mcp/tools/order/handlers/rejectOrder.d.ts +38 -57
- package/lib/mcp/tools/order/handlers/rejectOrder.d.ts.map +1 -1
- package/lib/mcp/tools/order/schemas.d.ts +184 -184
- package/lib/mcp/tools/product/handlers/addBundleItem.d.ts +18 -13
- package/lib/mcp/tools/product/handlers/addBundleItem.d.ts.map +1 -1
- package/lib/mcp/tools/product/handlers/addBundleItem.js +16 -19
- package/lib/mcp/tools/product/handlers/addBundleItem.js.map +1 -1
- package/lib/mcp/tools/product/handlers/addProductAssignment.d.ts +20 -15
- package/lib/mcp/tools/product/handlers/addProductAssignment.d.ts.map +1 -1
- package/lib/mcp/tools/product/handlers/addProductAssignment.js.map +1 -1
- package/lib/mcp/tools/product/handlers/addProductMedia.d.ts +31 -1
- package/lib/mcp/tools/product/handlers/addProductMedia.d.ts.map +1 -1
- package/lib/mcp/tools/product/handlers/addProductMedia.js +4 -4
- package/lib/mcp/tools/product/handlers/addProductMedia.js.map +1 -1
- package/lib/mcp/tools/product/handlers/addProductVariationOption.d.ts +18 -13
- package/lib/mcp/tools/product/handlers/addProductVariationOption.d.ts.map +1 -1
- package/lib/mcp/tools/product/handlers/addProductVariationOption.js +2 -2
- package/lib/mcp/tools/product/handlers/addProductVariationOption.js.map +1 -1
- package/lib/mcp/tools/product/handlers/createProduct.d.ts +18 -13
- package/lib/mcp/tools/product/handlers/createProduct.d.ts.map +1 -1
- package/lib/mcp/tools/product/handlers/createProductVariation.d.ts +18 -13
- package/lib/mcp/tools/product/handlers/createProductVariation.d.ts.map +1 -1
- package/lib/mcp/tools/product/handlers/createProductVariation.js +1 -0
- package/lib/mcp/tools/product/handlers/createProductVariation.js.map +1 -1
- package/lib/mcp/tools/product/handlers/getBundleItems.d.ts +18 -13
- package/lib/mcp/tools/product/handlers/getBundleItems.d.ts.map +1 -1
- package/lib/mcp/tools/product/handlers/getCatalogPrice.d.ts +4 -2
- package/lib/mcp/tools/product/handlers/getCatalogPrice.d.ts.map +1 -1
- package/lib/mcp/tools/product/handlers/getCatalogPrice.js +3 -1
- package/lib/mcp/tools/product/handlers/getCatalogPrice.js.map +1 -1
- package/lib/mcp/tools/product/handlers/getProduct.d.ts +18 -13
- package/lib/mcp/tools/product/handlers/getProduct.d.ts.map +1 -1
- package/lib/mcp/tools/product/handlers/getProductAssignments.d.ts +1 -2
- package/lib/mcp/tools/product/handlers/getProductAssignments.d.ts.map +1 -1
- package/lib/mcp/tools/product/handlers/getProductAssignments.js +4 -4
- package/lib/mcp/tools/product/handlers/getProductAssignments.js.map +1 -1
- package/lib/mcp/tools/product/handlers/getProductMedia.d.ts +6 -1
- package/lib/mcp/tools/product/handlers/getProductMedia.d.ts.map +1 -1
- package/lib/mcp/tools/product/handlers/getSiblings.d.ts +19 -14
- package/lib/mcp/tools/product/handlers/getSiblings.d.ts.map +1 -1
- package/lib/mcp/tools/product/handlers/getVariationProducts.d.ts +19 -14
- package/lib/mcp/tools/product/handlers/getVariationProducts.d.ts.map +1 -1
- package/lib/mcp/tools/product/handlers/index.d.ts +2 -0
- package/lib/mcp/tools/product/handlers/index.d.ts.map +1 -1
- package/lib/mcp/tools/product/handlers/index.js +2 -0
- package/lib/mcp/tools/product/handlers/index.js.map +1 -1
- package/lib/mcp/tools/product/handlers/listProducts.d.ts +19 -14
- package/lib/mcp/tools/product/handlers/listProducts.d.ts.map +1 -1
- package/lib/mcp/tools/product/handlers/removeProduct.d.ts.map +1 -1
- package/lib/mcp/tools/product/handlers/removeProduct.js +15 -3
- package/lib/mcp/tools/product/handlers/removeProduct.js.map +1 -1
- package/lib/mcp/tools/product/handlers/reorderProductMedia.d.ts +6 -1
- package/lib/mcp/tools/product/handlers/reorderProductMedia.d.ts.map +1 -1
- package/lib/mcp/tools/product/handlers/simulatePrice.d.ts +4 -2
- package/lib/mcp/tools/product/handlers/simulatePrice.d.ts.map +1 -1
- package/lib/mcp/tools/product/handlers/simulatePrice.js +2 -0
- package/lib/mcp/tools/product/handlers/simulatePrice.js.map +1 -1
- package/lib/mcp/tools/product/handlers/simulatePriceRange.d.ts +9 -2
- package/lib/mcp/tools/product/handlers/simulatePriceRange.d.ts.map +1 -1
- package/lib/mcp/tools/product/handlers/simulatePriceRange.js +2 -0
- package/lib/mcp/tools/product/handlers/simulatePriceRange.js.map +1 -1
- package/lib/mcp/tools/product/handlers/updateProduct.d.ts +18 -13
- package/lib/mcp/tools/product/handlers/updateProduct.d.ts.map +1 -1
- package/lib/mcp/tools/product/handlers/updateProduct.js +10 -2
- package/lib/mcp/tools/product/handlers/updateProduct.js.map +1 -1
- package/lib/mcp/tools/product/handlers/updateProductMediaTexts.d.ts +2 -1
- package/lib/mcp/tools/product/handlers/updateProductMediaTexts.d.ts.map +1 -1
- package/lib/mcp/tools/product/handlers/updateProductMediaTexts.js.map +1 -1
- package/lib/mcp/tools/product/handlers/updateProductStatus.d.ts +18 -13
- package/lib/mcp/tools/product/handlers/updateProductStatus.d.ts.map +1 -1
- package/lib/mcp/tools/product/handlers/updateProductTexts.d.ts +6 -0
- package/lib/mcp/tools/product/handlers/updateProductTexts.d.ts.map +1 -0
- package/lib/mcp/tools/product/handlers/updateProductTexts.js +11 -0
- package/lib/mcp/tools/product/handlers/updateProductTexts.js.map +1 -0
- package/lib/mcp/tools/product/schemas.d.ts +1605 -1549
- package/lib/mcp/tools/product/schemas.d.ts.map +1 -1
- package/lib/mcp/tools/product/schemas.js +13 -6
- package/lib/mcp/tools/product/schemas.js.map +1 -1
- package/lib/mcp/tools/provider/handlers/getProvider.d.ts +1 -1
- package/lib/mcp/tools/provider/handlers/getProviderInterfaces.d.ts +1 -1
- package/lib/mcp/tools/provider/schemas.d.ts +110 -110
- package/lib/mcp/tools/quotation/handlers/countQuotations.d.ts +4 -0
- package/lib/mcp/tools/quotation/handlers/countQuotations.d.ts.map +1 -0
- package/lib/mcp/tools/quotation/handlers/countQuotations.js +5 -0
- package/lib/mcp/tools/quotation/handlers/countQuotations.js.map +1 -0
- package/lib/mcp/tools/quotation/handlers/getQuotation.d.ts +105 -0
- package/lib/mcp/tools/quotation/handlers/getQuotation.d.ts.map +1 -0
- package/lib/mcp/tools/quotation/handlers/getQuotation.js +6 -0
- package/lib/mcp/tools/quotation/handlers/getQuotation.js.map +1 -0
- package/lib/mcp/tools/quotation/handlers/index.d.ts +16 -0
- package/lib/mcp/tools/quotation/handlers/index.d.ts.map +1 -0
- package/lib/mcp/tools/quotation/handlers/index.js +15 -0
- package/lib/mcp/tools/quotation/handlers/index.js.map +1 -0
- package/lib/mcp/tools/quotation/handlers/listQuotations.d.ts +107 -0
- package/lib/mcp/tools/quotation/handlers/listQuotations.d.ts.map +1 -0
- package/lib/mcp/tools/quotation/handlers/listQuotations.js +9 -0
- package/lib/mcp/tools/quotation/handlers/listQuotations.js.map +1 -0
- package/lib/mcp/tools/quotation/handlers/makeQuotationProposal.d.ts +106 -0
- package/lib/mcp/tools/quotation/handlers/makeQuotationProposal.d.ts.map +1 -0
- package/lib/mcp/tools/quotation/handlers/makeQuotationProposal.js +16 -0
- package/lib/mcp/tools/quotation/handlers/makeQuotationProposal.js.map +1 -0
- package/lib/mcp/tools/quotation/handlers/rejectQuotation.d.ts +106 -0
- package/lib/mcp/tools/quotation/handlers/rejectQuotation.d.ts.map +1 -0
- package/lib/mcp/tools/quotation/handlers/rejectQuotation.js +16 -0
- package/lib/mcp/tools/quotation/handlers/rejectQuotation.js.map +1 -0
- package/lib/mcp/tools/quotation/handlers/verifyQuotation.d.ts +106 -0
- package/lib/mcp/tools/quotation/handlers/verifyQuotation.d.ts.map +1 -0
- package/lib/mcp/tools/quotation/handlers/verifyQuotation.js +16 -0
- package/lib/mcp/tools/quotation/handlers/verifyQuotation.js.map +1 -0
- package/lib/mcp/tools/quotation/index.d.ts +4 -0
- package/lib/mcp/tools/quotation/index.d.ts.map +1 -0
- package/lib/mcp/tools/quotation/index.js +5 -0
- package/lib/mcp/tools/quotation/index.js.map +1 -0
- package/lib/mcp/tools/quotation/quotationManagement.d.ts +10 -0
- package/lib/mcp/tools/quotation/quotationManagement.d.ts.map +1 -0
- package/lib/mcp/tools/quotation/quotationManagement.js +24 -0
- package/lib/mcp/tools/quotation/quotationManagement.js.map +1 -0
- package/lib/mcp/tools/quotation/schemas.d.ts +240 -0
- package/lib/mcp/tools/quotation/schemas.d.ts.map +1 -0
- package/lib/mcp/tools/quotation/schemas.js +99 -0
- package/lib/mcp/tools/quotation/schemas.js.map +1 -0
- package/lib/mcp/tools/system/handlers/getEvent.d.ts +1 -1
- package/lib/mcp/tools/system/handlers/getShopInfo.d.ts +2 -2
- package/lib/mcp/tools/system/handlers/getWorkStatistics.d.ts +2 -2
- package/lib/mcp/tools/system/handlers/index.d.ts +6 -6
- package/lib/mcp/tools/system/handlers/listWork.d.ts +2 -2
- package/lib/mcp/tools/system/handlers/listWork.d.ts.map +1 -1
- package/lib/mcp/tools/system/handlers/listWork.js.map +1 -1
- package/lib/mcp/tools/system/index.js +1 -1
- package/lib/mcp/tools/system/index.js.map +1 -1
- package/lib/mcp/tools/system/schemas.d.ts +220 -220
- package/lib/mcp/tools/system/schemas.js +2 -2
- package/lib/mcp/tools/system/schemas.js.map +1 -1
- package/lib/mcp/tools/system/types.d.ts +1 -1
- package/lib/mcp/tools/system/types.d.ts.map +1 -1
- package/lib/mcp/tools/users/handlers/addUserEmail.d.ts +9 -4
- package/lib/mcp/tools/users/handlers/addUserEmail.d.ts.map +1 -1
- package/lib/mcp/tools/users/handlers/addUserEmail.js +2 -2
- package/lib/mcp/tools/users/handlers/addUserEmail.js.map +1 -1
- package/lib/mcp/tools/users/handlers/createUser.d.ts +9 -4
- package/lib/mcp/tools/users/handlers/createUser.d.ts.map +1 -1
- package/lib/mcp/tools/users/handlers/enrollUser.d.ts +9 -4
- package/lib/mcp/tools/users/handlers/enrollUser.d.ts.map +1 -1
- package/lib/mcp/tools/users/handlers/enrollUser.js +1 -1
- package/lib/mcp/tools/users/handlers/enrollUser.js.map +1 -1
- package/lib/mcp/tools/users/handlers/getCurrentUser.d.ts +9 -4
- package/lib/mcp/tools/users/handlers/getCurrentUser.d.ts.map +1 -1
- package/lib/mcp/tools/users/handlers/getCurrentUser.js.map +1 -1
- package/lib/mcp/tools/users/handlers/getUser.d.ts +9 -4
- package/lib/mcp/tools/users/handlers/getUser.d.ts.map +1 -1
- package/lib/mcp/tools/users/handlers/getUserAvatar.d.ts +7 -2
- package/lib/mcp/tools/users/handlers/getUserAvatar.d.ts.map +1 -1
- package/lib/mcp/tools/users/handlers/getUserAvatar.js +1 -1
- package/lib/mcp/tools/users/handlers/getUserAvatar.js.map +1 -1
- package/lib/mcp/tools/users/handlers/getUserBookmarks.d.ts +23 -18
- package/lib/mcp/tools/users/handlers/getUserBookmarks.d.ts.map +1 -1
- package/lib/mcp/tools/users/handlers/getUserEnrollments.d.ts +33 -24
- package/lib/mcp/tools/users/handlers/getUserEnrollments.d.ts.map +1 -1
- package/lib/mcp/tools/users/handlers/getUserOrders.d.ts +39 -58
- package/lib/mcp/tools/users/handlers/getUserOrders.d.ts.map +1 -1
- package/lib/mcp/tools/users/handlers/getUserQuotations.d.ts +29 -20
- package/lib/mcp/tools/users/handlers/getUserQuotations.d.ts.map +1 -1
- package/lib/mcp/tools/users/handlers/getUserReviews.d.ts +23 -18
- package/lib/mcp/tools/users/handlers/getUserReviews.d.ts.map +1 -1
- package/lib/mcp/tools/users/handlers/listUsers.d.ts +10 -5
- package/lib/mcp/tools/users/handlers/listUsers.d.ts.map +1 -1
- package/lib/mcp/tools/users/handlers/removeUserEmail.js.map +1 -1
- package/lib/mcp/tools/users/handlers/setUserTags.d.ts +9 -4
- package/lib/mcp/tools/users/handlers/setUserTags.d.ts.map +1 -1
- package/lib/mcp/tools/users/handlers/setUserUsername.d.ts +9 -4
- package/lib/mcp/tools/users/handlers/setUserUsername.d.ts.map +1 -1
- package/lib/mcp/tools/users/handlers/updateUser.d.ts +9 -4
- package/lib/mcp/tools/users/handlers/updateUser.d.ts.map +1 -1
- package/lib/mcp/tools/users/schemas.d.ts +586 -586
- package/lib/mcp/utils/getNormalizedAssortmentDetails.d.ts +24 -1
- package/lib/mcp/utils/getNormalizedAssortmentDetails.d.ts.map +1 -1
- package/lib/mcp/utils/getNormalizedAssortmentDetails.js +5 -21
- package/lib/mcp/utils/getNormalizedAssortmentDetails.js.map +1 -1
- package/lib/mcp/utils/getNormalizedFilterDetails.d.ts +10 -10
- package/lib/mcp/utils/getNormalizedFilterDetails.js.map +1 -1
- package/lib/mcp/utils/getNormalizedOrderDetails.d.ts +38 -57
- package/lib/mcp/utils/getNormalizedOrderDetails.d.ts.map +1 -1
- package/lib/mcp/utils/getNormalizedOrderDetails.js.map +1 -1
- package/lib/mcp/utils/getNormalizedProductDetails.d.ts +18 -13
- package/lib/mcp/utils/getNormalizedProductDetails.d.ts.map +1 -1
- package/lib/mcp/utils/getNormalizedProductDetails.js +5 -24
- package/lib/mcp/utils/getNormalizedProductDetails.js.map +1 -1
- package/lib/mcp/utils/getNormalizedQuotationDetails.d.ts +104 -0
- package/lib/mcp/utils/getNormalizedQuotationDetails.d.ts.map +1 -0
- package/lib/mcp/utils/getNormalizedQuotationDetails.js +35 -0
- package/lib/mcp/utils/getNormalizedQuotationDetails.js.map +1 -0
- package/lib/mcp/utils/getNormalizedUserDetails.d.ts +9 -4
- package/lib/mcp/utils/getNormalizedUserDetails.d.ts.map +1 -1
- package/lib/mcp/utils/getNormalizedUserDetails.js.map +1 -1
- package/lib/mcp/utils/normalizeMediaUrl.d.ts +8 -1
- package/lib/mcp/utils/normalizeMediaUrl.d.ts.map +1 -1
- package/lib/mcp/utils/normalizeMediaUrl.js.map +1 -1
- package/lib/mcp/utils/normalizeProxyAssignments.d.ts +6 -0
- package/lib/mcp/utils/normalizeProxyAssignments.d.ts.map +1 -0
- package/lib/mcp/utils/normalizeProxyAssignments.js +27 -0
- package/lib/mcp/utils/normalizeProxyAssignments.js.map +1 -0
- package/lib/mcp/utils/orderFilters.d.ts +1 -1
- package/lib/mcp/utils/orderFilters.d.ts.map +1 -1
- package/lib/mcp/utils/sharedSchemas.d.ts +14 -14
- package/lib/mcp/utils/sharedSchemas.js +1 -1
- package/lib/mcp/utils/sharedSchemas.js.map +1 -1
- package/lib/resolvers/mutations/accounts/addEmail.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/addEmail.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/addEmail.js.map +1 -1
- package/lib/resolvers/mutations/accounts/addWeb3Address.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/addWeb3Address.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/addWeb3Address.js.map +1 -1
- package/lib/resolvers/mutations/accounts/addWebAuthnCredentials.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/addWebAuthnCredentials.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/addWebAuthnCredentials.js.map +1 -1
- package/lib/resolvers/mutations/accounts/buildSecretTOTPAuthURL.d.ts +3 -0
- package/lib/resolvers/mutations/accounts/buildSecretTOTPAuthURL.d.ts.map +1 -0
- package/lib/resolvers/mutations/accounts/buildSecretTOTPAuthURL.js +6 -0
- package/lib/resolvers/mutations/accounts/buildSecretTOTPAuthURL.js.map +1 -0
- package/lib/resolvers/mutations/accounts/changePassword.js.map +1 -1
- package/lib/resolvers/mutations/accounts/createUser.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/createUser.js +2 -2
- package/lib/resolvers/mutations/accounts/createUser.js.map +1 -1
- package/lib/resolvers/mutations/accounts/createWebAuthnCredentialCreationOptions.d.ts +2 -2
- package/lib/resolvers/mutations/accounts/createWebAuthnCredentialCreationOptions.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/createWebAuthnCredentialRequestOptions.d.ts +2 -2
- package/lib/resolvers/mutations/accounts/createWebAuthnCredentialRequestOptions.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/disableTOTP.d.ts +6 -0
- package/lib/resolvers/mutations/accounts/disableTOTP.d.ts.map +1 -0
- package/lib/resolvers/mutations/accounts/disableTOTP.js +27 -0
- package/lib/resolvers/mutations/accounts/disableTOTP.js.map +1 -0
- package/lib/resolvers/mutations/accounts/enableTOTP.d.ts +6 -0
- package/lib/resolvers/mutations/accounts/enableTOTP.d.ts.map +1 -0
- package/lib/resolvers/mutations/accounts/enableTOTP.js +20 -0
- package/lib/resolvers/mutations/accounts/enableTOTP.js.map +1 -0
- package/lib/resolvers/mutations/accounts/enrollUser.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/enrollUser.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/linkOAuthAccount.d.ts +7 -0
- package/lib/resolvers/mutations/accounts/linkOAuthAccount.d.ts.map +1 -0
- package/lib/resolvers/mutations/accounts/linkOAuthAccount.js +30 -0
- package/lib/resolvers/mutations/accounts/linkOAuthAccount.js.map +1 -0
- package/lib/resolvers/mutations/accounts/loginAsGuest.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/loginAsGuest.js +2 -2
- package/lib/resolvers/mutations/accounts/loginAsGuest.js.map +1 -1
- package/lib/resolvers/mutations/accounts/loginWithOAuth.d.ts +8 -0
- package/lib/resolvers/mutations/accounts/loginWithOAuth.d.ts.map +1 -0
- package/lib/resolvers/mutations/accounts/loginWithOAuth.js +25 -0
- package/lib/resolvers/mutations/accounts/loginWithOAuth.js.map +1 -0
- package/lib/resolvers/mutations/accounts/loginWithPassword.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/loginWithPassword.js +2 -2
- package/lib/resolvers/mutations/accounts/loginWithPassword.js.map +1 -1
- package/lib/resolvers/mutations/accounts/loginWithWebAuthn.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/loginWithWebAuthn.js +2 -2
- package/lib/resolvers/mutations/accounts/loginWithWebAuthn.js.map +1 -1
- package/lib/resolvers/mutations/accounts/logoutAllSessions.d.ts +5 -0
- package/lib/resolvers/mutations/accounts/logoutAllSessions.d.ts.map +1 -0
- package/lib/resolvers/mutations/accounts/logoutAllSessions.js +20 -0
- package/lib/resolvers/mutations/accounts/logoutAllSessions.js.map +1 -0
- package/lib/resolvers/mutations/accounts/removeEmail.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/removeEmail.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/removeEmail.js.map +1 -1
- package/lib/resolvers/mutations/accounts/removeWeb3Address.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/removeWeb3Address.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/removeWeb3Address.js +2 -2
- package/lib/resolvers/mutations/accounts/removeWeb3Address.js.map +1 -1
- package/lib/resolvers/mutations/accounts/removeWebAuthnCredentials.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/removeWebAuthnCredentials.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/removeWebAuthnCredentials.js +2 -2
- package/lib/resolvers/mutations/accounts/removeWebAuthnCredentials.js.map +1 -1
- package/lib/resolvers/mutations/accounts/setPassword.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/setPassword.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/setUsername.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/setUsername.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/stopImpersonation.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/stopImpersonation.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/unlinkOAuthAccount.d.ts +6 -0
- package/lib/resolvers/mutations/accounts/unlinkOAuthAccount.d.ts.map +1 -0
- package/lib/resolvers/mutations/accounts/unlinkOAuthAccount.js +13 -0
- package/lib/resolvers/mutations/accounts/unlinkOAuthAccount.js.map +1 -0
- package/lib/resolvers/mutations/accounts/verifyEmail.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/verifyEmail.js +2 -2
- package/lib/resolvers/mutations/accounts/verifyEmail.js.map +1 -1
- package/lib/resolvers/mutations/accounts/verifyWeb3Address.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/verifyWeb3Address.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/verifyWeb3Address.js +3 -3
- package/lib/resolvers/mutations/accounts/verifyWeb3Address.js.map +1 -1
- package/lib/resolvers/mutations/assortments/addAssortmentFilter.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/addAssortmentFilter.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/addAssortmentLink.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/addAssortmentLink.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/addAssortmentMedia.d.ts +6 -0
- package/lib/resolvers/mutations/assortments/addAssortmentMedia.d.ts.map +1 -0
- package/lib/resolvers/mutations/assortments/addAssortmentMedia.js +18 -0
- package/lib/resolvers/mutations/assortments/addAssortmentMedia.js.map +1 -0
- package/lib/resolvers/mutations/assortments/addAssortmentProduct.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/addAssortmentProduct.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortment.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortment.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortment.js +3 -4
- package/lib/resolvers/mutations/assortments/removeAssortment.js.map +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortmentFilter.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortmentFilter.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortmentLink.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortmentLink.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortmentMedia.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortmentMedia.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortmentProduct.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortmentProduct.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/setBaseAssortment.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/setBaseAssortment.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/updateAssortment.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/updateAssortment.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/updateAssortmentMediaTexts.d.ts +7 -1
- package/lib/resolvers/mutations/assortments/updateAssortmentMediaTexts.d.ts.map +1 -1
- package/lib/resolvers/mutations/bookmarks/bookmark.d.ts +1 -1
- package/lib/resolvers/mutations/bookmarks/bookmark.d.ts.map +1 -1
- package/lib/resolvers/mutations/bookmarks/createBookmark.d.ts +1 -1
- package/lib/resolvers/mutations/bookmarks/createBookmark.d.ts.map +1 -1
- package/lib/resolvers/mutations/bookmarks/removeBookmark.d.ts +1 -1
- package/lib/resolvers/mutations/bookmarks/removeBookmark.d.ts.map +1 -1
- package/lib/resolvers/mutations/countries/createCountry.d.ts +1 -1
- package/lib/resolvers/mutations/countries/createCountry.d.ts.map +1 -1
- package/lib/resolvers/mutations/countries/removeCountry.d.ts +1 -1
- package/lib/resolvers/mutations/countries/removeCountry.d.ts.map +1 -1
- package/lib/resolvers/mutations/countries/updateCountry.d.ts +1 -1
- package/lib/resolvers/mutations/countries/updateCountry.d.ts.map +1 -1
- package/lib/resolvers/mutations/currencies/createCurrency.d.ts +1 -1
- package/lib/resolvers/mutations/currencies/createCurrency.d.ts.map +1 -1
- package/lib/resolvers/mutations/currencies/removeCurrency.d.ts +1 -1
- package/lib/resolvers/mutations/currencies/removeCurrency.d.ts.map +1 -1
- package/lib/resolvers/mutations/currencies/updateCurrency.d.ts +1 -1
- package/lib/resolvers/mutations/currencies/updateCurrency.d.ts.map +1 -1
- package/lib/resolvers/mutations/delivery/createDeliveryProvider.d.ts +2 -2
- package/lib/resolvers/mutations/delivery/createDeliveryProvider.d.ts.map +1 -1
- package/lib/resolvers/mutations/delivery/createDeliveryProvider.js.map +1 -1
- package/lib/resolvers/mutations/delivery/removeDeliveryProvider.d.ts +1 -1
- package/lib/resolvers/mutations/delivery/removeDeliveryProvider.d.ts.map +1 -1
- package/lib/resolvers/mutations/delivery/updateDeliveryProvider.d.ts +1 -1
- package/lib/resolvers/mutations/delivery/updateDeliveryProvider.d.ts.map +1 -1
- package/lib/resolvers/mutations/enrollments/createEnrollment.d.ts +1 -1
- package/lib/resolvers/mutations/enrollments/createEnrollment.d.ts.map +1 -1
- package/lib/resolvers/mutations/enrollments/createEnrollment.js +1 -1
- package/lib/resolvers/mutations/enrollments/createEnrollment.js.map +1 -1
- package/lib/resolvers/mutations/enrollments/updateEnrollment.d.ts.map +1 -1
- package/lib/resolvers/mutations/enrollments/updateEnrollment.js +6 -6
- package/lib/resolvers/mutations/enrollments/updateEnrollment.js.map +1 -1
- package/lib/resolvers/mutations/files/confirmMediaUpload.d.ts +1 -1
- package/lib/resolvers/mutations/files/confirmMediaUpload.d.ts.map +1 -1
- package/lib/resolvers/mutations/filters/createFilterOption.d.ts +1 -1
- package/lib/resolvers/mutations/filters/createFilterOption.d.ts.map +1 -1
- package/lib/resolvers/mutations/filters/createFilterOption.js.map +1 -1
- package/lib/resolvers/mutations/filters/removeFilter.d.ts +1 -1
- package/lib/resolvers/mutations/filters/removeFilter.d.ts.map +1 -1
- package/lib/resolvers/mutations/filters/removeFilterOption.d.ts +1 -1
- package/lib/resolvers/mutations/filters/removeFilterOption.d.ts.map +1 -1
- package/lib/resolvers/mutations/filters/removeFilterOption.js.map +1 -1
- package/lib/resolvers/mutations/filters/updateFilter.d.ts +1 -1
- package/lib/resolvers/mutations/filters/updateFilter.d.ts.map +1 -1
- package/lib/resolvers/mutations/filters/updateFilter.js.map +1 -1
- package/lib/resolvers/mutations/languages/createLanguage.d.ts +1 -1
- package/lib/resolvers/mutations/languages/createLanguage.d.ts.map +1 -1
- package/lib/resolvers/mutations/languages/removeLanguage.d.ts +1 -1
- package/lib/resolvers/mutations/languages/removeLanguage.d.ts.map +1 -1
- package/lib/resolvers/mutations/languages/updateLanguage.d.ts +1 -1
- package/lib/resolvers/mutations/languages/updateLanguage.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/addCartDiscount.d.ts +1 -1
- package/lib/resolvers/mutations/orders/addCartDiscount.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/addCartDiscount.js +1 -1
- package/lib/resolvers/mutations/orders/addCartDiscount.js.map +1 -1
- package/lib/resolvers/mutations/orders/addCartProduct.d.ts +1 -1
- package/lib/resolvers/mutations/orders/addCartProduct.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/addCartProduct.js +1 -1
- package/lib/resolvers/mutations/orders/addCartProduct.js.map +1 -1
- package/lib/resolvers/mutations/orders/addCartQuotation.d.ts +1 -1
- package/lib/resolvers/mutations/orders/addCartQuotation.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/addCartQuotation.js +5 -3
- package/lib/resolvers/mutations/orders/addCartQuotation.js.map +1 -1
- package/lib/resolvers/mutations/orders/addMultipleCartProducts.d.ts +1 -1
- package/lib/resolvers/mutations/orders/addMultipleCartProducts.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/addMultipleCartProducts.js +1 -1
- package/lib/resolvers/mutations/orders/addMultipleCartProducts.js.map +1 -1
- package/lib/resolvers/mutations/orders/checkoutCart.d.ts +1 -1
- package/lib/resolvers/mutations/orders/checkoutCart.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/checkoutCart.js +2 -2
- package/lib/resolvers/mutations/orders/checkoutCart.js.map +1 -1
- package/lib/resolvers/mutations/orders/confirmOrder.d.ts +1 -1
- package/lib/resolvers/mutations/orders/confirmOrder.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/createCart.d.ts +1 -1
- package/lib/resolvers/mutations/orders/createCart.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/createCart.js +1 -1
- package/lib/resolvers/mutations/orders/createCart.js.map +1 -1
- package/lib/resolvers/mutations/orders/deliverOrder.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/deliverOrder.js +7 -4
- package/lib/resolvers/mutations/orders/deliverOrder.js.map +1 -1
- package/lib/resolvers/mutations/orders/emptyCart.d.ts +1 -1
- package/lib/resolvers/mutations/orders/emptyCart.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/emptyCart.js +1 -1
- package/lib/resolvers/mutations/orders/emptyCart.js.map +1 -1
- package/lib/resolvers/mutations/orders/payOrder.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/payOrder.js +7 -4
- package/lib/resolvers/mutations/orders/payOrder.js.map +1 -1
- package/lib/resolvers/mutations/orders/rejectOrder.d.ts +1 -1
- package/lib/resolvers/mutations/orders/rejectOrder.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/removeCartDiscount.d.ts +1 -1
- package/lib/resolvers/mutations/orders/removeCartDiscount.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/removeCartDiscount.js +3 -1
- package/lib/resolvers/mutations/orders/removeCartDiscount.js.map +1 -1
- package/lib/resolvers/mutations/orders/removeCartItem.d.ts +1 -1
- package/lib/resolvers/mutations/orders/removeCartItem.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/removeCartItem.js +3 -1
- package/lib/resolvers/mutations/orders/removeCartItem.js.map +1 -1
- package/lib/resolvers/mutations/orders/setOrderDeliveryProvider.d.ts +1 -1
- package/lib/resolvers/mutations/orders/setOrderDeliveryProvider.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/setOrderPaymentProvider.d.ts +1 -1
- package/lib/resolvers/mutations/orders/setOrderPaymentProvider.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/signPaymentProviderForCheckout.d.ts +1 -1
- package/lib/resolvers/mutations/orders/signPaymentProviderForCheckout.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/signPaymentProviderForCheckout.js +9 -5
- package/lib/resolvers/mutations/orders/signPaymentProviderForCheckout.js.map +1 -1
- package/lib/resolvers/mutations/orders/updateCart.d.ts +1 -1
- package/lib/resolvers/mutations/orders/updateCart.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/updateCart.js +1 -1
- package/lib/resolvers/mutations/orders/updateCart.js.map +1 -1
- package/lib/resolvers/mutations/orders/updateCartDeliveryPickUp.d.ts +1 -1
- package/lib/resolvers/mutations/orders/updateCartDeliveryPickUp.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/updateCartDeliveryPickUp.js +4 -2
- package/lib/resolvers/mutations/orders/updateCartDeliveryPickUp.js.map +1 -1
- package/lib/resolvers/mutations/orders/updateCartDeliveryShipping.d.ts +1 -1
- package/lib/resolvers/mutations/orders/updateCartDeliveryShipping.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/updateCartDeliveryShipping.js +4 -2
- package/lib/resolvers/mutations/orders/updateCartDeliveryShipping.js.map +1 -1
- package/lib/resolvers/mutations/orders/updateCartItem.d.ts +1 -1
- package/lib/resolvers/mutations/orders/updateCartItem.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/updateCartItem.js +6 -4
- package/lib/resolvers/mutations/orders/updateCartItem.js.map +1 -1
- package/lib/resolvers/mutations/orders/updateCartPaymentGeneric.d.ts +1 -1
- package/lib/resolvers/mutations/orders/updateCartPaymentGeneric.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/updateCartPaymentGeneric.js +4 -2
- package/lib/resolvers/mutations/orders/updateCartPaymentGeneric.js.map +1 -1
- package/lib/resolvers/mutations/orders/updateCartPaymentInvoice.d.ts +1 -1
- package/lib/resolvers/mutations/orders/updateCartPaymentInvoice.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/updateCartPaymentInvoice.js +4 -2
- package/lib/resolvers/mutations/orders/updateCartPaymentInvoice.js.map +1 -1
- package/lib/resolvers/mutations/orders/updateOrderDeliveryPickUp.d.ts +1 -1
- package/lib/resolvers/mutations/orders/updateOrderDeliveryPickUp.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/updateOrderDeliveryShipping.d.ts +1 -1
- package/lib/resolvers/mutations/orders/updateOrderDeliveryShipping.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/updateOrderPaymentGeneric.d.ts +1 -1
- package/lib/resolvers/mutations/orders/updateOrderPaymentGeneric.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/updateOrderPaymentInvoice.d.ts +1 -1
- package/lib/resolvers/mutations/orders/updateOrderPaymentInvoice.d.ts.map +1 -1
- package/lib/resolvers/mutations/payment/createPaymentProvider.d.ts +1 -1
- package/lib/resolvers/mutations/payment/createPaymentProvider.d.ts.map +1 -1
- package/lib/resolvers/mutations/payment/createPaymentProvider.js.map +1 -1
- package/lib/resolvers/mutations/payment/markPaymentCredentialsPreferred.d.ts +1 -1
- package/lib/resolvers/mutations/payment/markPaymentCredentialsPreferred.d.ts.map +1 -1
- package/lib/resolvers/mutations/payment/markPaymentCredentialsPreferred.js +1 -1
- package/lib/resolvers/mutations/payment/markPaymentCredentialsPreferred.js.map +1 -1
- package/lib/resolvers/mutations/payment/registerPaymentCredentials.d.ts +1 -1
- package/lib/resolvers/mutations/payment/registerPaymentCredentials.d.ts.map +1 -1
- package/lib/resolvers/mutations/payment/removePaymentCredentials.d.ts +1 -1
- package/lib/resolvers/mutations/payment/removePaymentProvider.d.ts +1 -1
- package/lib/resolvers/mutations/payment/signPaymentProviderForCredentialRegistration.d.ts +1 -1
- package/lib/resolvers/mutations/payment/signPaymentProviderForCredentialRegistration.d.ts.map +1 -1
- package/lib/resolvers/mutations/payment/updatePaymentProvider.d.ts +1 -1
- package/lib/resolvers/mutations/products/addProductAssignment.d.ts +1 -1
- package/lib/resolvers/mutations/products/addProductAssignment.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/addProductAssignment.js.map +1 -1
- package/lib/resolvers/mutations/products/addProductMedia.d.ts +6 -0
- package/lib/resolvers/mutations/products/addProductMedia.d.ts.map +1 -0
- package/lib/resolvers/mutations/products/addProductMedia.js +18 -0
- package/lib/resolvers/mutations/products/addProductMedia.js.map +1 -0
- package/lib/resolvers/mutations/products/addProductReviewVote.d.ts +1 -1
- package/lib/resolvers/mutations/products/addProductReviewVote.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/addProductReviewVote.js +1 -1
- package/lib/resolvers/mutations/products/addProductReviewVote.js.map +1 -1
- package/lib/resolvers/mutations/products/createProductBundleItem.d.ts +1 -1
- package/lib/resolvers/mutations/products/createProductBundleItem.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/createProductReview.d.ts +2 -2
- package/lib/resolvers/mutations/products/createProductReview.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/createProductReview.js +2 -2
- package/lib/resolvers/mutations/products/createProductReview.js.map +1 -1
- package/lib/resolvers/mutations/products/createProductVariationOption.d.ts +1 -1
- package/lib/resolvers/mutations/products/createProductVariationOption.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/publishProduct.d.ts +1 -1
- package/lib/resolvers/mutations/products/publishProduct.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/removeBundleItem.d.ts +1 -1
- package/lib/resolvers/mutations/products/removeBundleItem.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/removeProduct.d.ts +1 -1
- package/lib/resolvers/mutations/products/removeProduct.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/removeProductAssignment.d.ts +1 -1
- package/lib/resolvers/mutations/products/removeProductAssignment.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/removeProductMedia.d.ts +1 -1
- package/lib/resolvers/mutations/products/removeProductMedia.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/removeProductReview.d.ts +1 -1
- package/lib/resolvers/mutations/products/removeProductReview.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/removeProductReviewVote.d.ts +1 -1
- package/lib/resolvers/mutations/products/removeProductReviewVote.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/removeProductVariation.d.ts +1 -1
- package/lib/resolvers/mutations/products/removeProductVariation.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/removeProductVariationOption.d.ts +1 -1
- package/lib/resolvers/mutations/products/removeProductVariationOption.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/unpublishProduct.d.ts +1 -1
- package/lib/resolvers/mutations/products/unpublishProduct.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/updateProduct.d.ts +1 -1
- package/lib/resolvers/mutations/products/updateProduct.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/updateProductCommerce.d.ts +1 -1
- package/lib/resolvers/mutations/products/updateProductCommerce.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/updateProductPlan.d.ts +1 -1
- package/lib/resolvers/mutations/products/updateProductPlan.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/updateProductReview.d.ts +1 -1
- package/lib/resolvers/mutations/products/updateProductReview.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/updateProductSupply.d.ts +1 -1
- package/lib/resolvers/mutations/products/updateProductSupply.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/updateProductTokenization.d.ts +1 -1
- package/lib/resolvers/mutations/products/updateProductTokenization.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/updateProductWarehousing.d.ts +1 -1
- package/lib/resolvers/mutations/products/updateProductWarehousing.d.ts.map +1 -1
- package/lib/resolvers/mutations/quotations/makeQuotationProposal.d.ts +1 -1
- package/lib/resolvers/mutations/quotations/makeQuotationProposal.d.ts.map +1 -1
- package/lib/resolvers/mutations/quotations/rejectQuotation.d.ts +1 -1
- package/lib/resolvers/mutations/quotations/rejectQuotation.d.ts.map +1 -1
- package/lib/resolvers/mutations/quotations/requestQuotation.js +1 -1
- package/lib/resolvers/mutations/quotations/requestQuotation.js.map +1 -1
- package/lib/resolvers/mutations/quotations/verifyQuotation.d.ts +1 -1
- package/lib/resolvers/mutations/quotations/verifyQuotation.d.ts.map +1 -1
- package/lib/resolvers/mutations/users/addPushSubscription.d.ts +2 -2
- package/lib/resolvers/mutations/users/addPushSubscription.d.ts.map +1 -1
- package/lib/resolvers/mutations/users/addPushSubscription.js.map +1 -1
- package/lib/resolvers/mutations/users/heartbeat.d.ts +1 -1
- package/lib/resolvers/mutations/users/heartbeat.d.ts.map +1 -1
- package/lib/resolvers/mutations/users/removePushSubscription.d.ts +1 -1
- package/lib/resolvers/mutations/users/removePushSubscription.d.ts.map +1 -1
- package/lib/resolvers/mutations/users/removePushSubscription.js.map +1 -1
- package/lib/resolvers/mutations/users/removeUser.d.ts +1 -1
- package/lib/resolvers/mutations/users/removeUser.d.ts.map +1 -1
- package/lib/resolvers/mutations/users/removeUser.js.map +1 -1
- package/lib/resolvers/mutations/users/setRoles.d.ts +1 -1
- package/lib/resolvers/mutations/users/setRoles.d.ts.map +1 -1
- package/lib/resolvers/mutations/users/setUserTags.d.ts +1 -1
- package/lib/resolvers/mutations/users/setUserTags.d.ts.map +1 -1
- package/lib/resolvers/mutations/users/updateUserAvatar.d.ts +6 -0
- package/lib/resolvers/mutations/users/updateUserAvatar.d.ts.map +1 -0
- package/lib/resolvers/mutations/users/updateUserAvatar.js +22 -0
- package/lib/resolvers/mutations/users/updateUserAvatar.js.map +1 -0
- package/lib/resolvers/mutations/users/updateUserProfile.d.ts +1 -1
- package/lib/resolvers/mutations/users/updateUserProfile.d.ts.map +1 -1
- package/lib/resolvers/mutations/users/updateUserProfile.js.map +1 -1
- package/lib/resolvers/mutations/utils/getOrderCart.d.ts +7 -0
- package/lib/resolvers/mutations/utils/getOrderCart.d.ts.map +1 -0
- package/lib/resolvers/mutations/utils/getOrderCart.js +13 -0
- package/lib/resolvers/mutations/utils/getOrderCart.js.map +1 -0
- package/lib/resolvers/mutations/warehousing/createWarehousingProvider.d.ts +2 -2
- package/lib/resolvers/mutations/warehousing/createWarehousingProvider.d.ts.map +1 -1
- package/lib/resolvers/mutations/warehousing/createWarehousingProvider.js.map +1 -1
- package/lib/resolvers/mutations/warehousing/exportToken.d.ts +1 -1
- package/lib/resolvers/mutations/warehousing/exportToken.d.ts.map +1 -1
- package/lib/resolvers/mutations/warehousing/invalidateToken.d.ts +1 -1
- package/lib/resolvers/mutations/warehousing/invalidateToken.d.ts.map +1 -1
- package/lib/resolvers/mutations/warehousing/removeWarehousingProvider.d.ts +1 -1
- package/lib/resolvers/mutations/warehousing/removeWarehousingProvider.d.ts.map +1 -1
- package/lib/resolvers/mutations/warehousing/updateWarehousingProvider.d.ts +1 -1
- package/lib/resolvers/mutations/warehousing/updateWarehousingProvider.d.ts.map +1 -1
- package/lib/resolvers/mutations/worker/allocateWork.d.ts +3 -3
- package/lib/resolvers/mutations/worker/allocateWork.d.ts.map +1 -1
- package/lib/resolvers/mutations/worker/allocateWork.js.map +1 -1
- package/lib/resolvers/mutations/worker/finishWork.d.ts +2 -2
- package/lib/resolvers/mutations/worker/finishWork.d.ts.map +1 -1
- package/lib/resolvers/mutations/worker/finishWork.js +2 -2
- package/lib/resolvers/mutations/worker/finishWork.js.map +1 -1
- package/lib/resolvers/mutations/worker/processNextWork.d.ts +1 -1
- package/lib/resolvers/mutations/worker/processNextWork.d.ts.map +1 -1
- package/lib/resolvers/mutations/worker/removeWork.d.ts +1 -1
- package/lib/resolvers/mutations/worker/removeWork.d.ts.map +1 -1
- package/lib/resolvers/queries/assortments/assortment.d.ts +1 -1
- package/lib/resolvers/queries/assortments/assortment.d.ts.map +1 -1
- package/lib/resolvers/queries/countries/country.d.ts +1 -1
- package/lib/resolvers/queries/countries/country.d.ts.map +1 -1
- package/lib/resolvers/queries/currencies/currency.d.ts +1 -1
- package/lib/resolvers/queries/currencies/currency.d.ts.map +1 -1
- package/lib/resolvers/queries/delivery/deliveryProvider.d.ts +1 -1
- package/lib/resolvers/queries/delivery/deliveryProvider.d.ts.map +1 -1
- package/lib/resolvers/queries/enrollments/enrollment.d.ts +1 -1
- package/lib/resolvers/queries/enrollments/enrollment.d.ts.map +1 -1
- package/lib/resolvers/queries/events/event.d.ts +1 -1
- package/lib/resolvers/queries/events/event.d.ts.map +1 -1
- package/lib/resolvers/queries/filters/filter.d.ts +1 -1
- package/lib/resolvers/queries/filters/filter.d.ts.map +1 -1
- package/lib/resolvers/queries/languages/language.d.ts +1 -1
- package/lib/resolvers/queries/languages/language.d.ts.map +1 -1
- package/lib/resolvers/queries/orders/order.d.ts +1 -1
- package/lib/resolvers/queries/orders/order.d.ts.map +1 -1
- package/lib/resolvers/queries/orders/orderStatistics.d.ts +1 -1
- package/lib/resolvers/queries/payment/paymentProvider.d.ts +1 -1
- package/lib/resolvers/queries/payment/paymentProvider.d.ts.map +1 -1
- package/lib/resolvers/queries/products/product.d.ts +1 -1
- package/lib/resolvers/queries/products/product.d.ts.map +1 -1
- package/lib/resolvers/queries/products/product.js +1 -1
- package/lib/resolvers/queries/products/product.js.map +1 -1
- package/lib/resolvers/queries/products/productCatalogPrices.d.ts +1 -1
- package/lib/resolvers/queries/products/productCatalogPrices.d.ts.map +1 -1
- package/lib/resolvers/queries/products/productReview.d.ts +1 -1
- package/lib/resolvers/queries/products/productReview.d.ts.map +1 -1
- package/lib/resolvers/queries/quotations/quotation.d.ts +1 -1
- package/lib/resolvers/queries/quotations/quotation.d.ts.map +1 -1
- package/lib/resolvers/queries/shopInfo.d.ts.map +1 -1
- package/lib/resolvers/queries/shopInfo.js +53 -3
- package/lib/resolvers/queries/shopInfo.js.map +1 -1
- package/lib/resolvers/queries/users/impersonator.d.ts +1 -1
- package/lib/resolvers/queries/users/impersonator.d.ts.map +1 -1
- package/lib/resolvers/queries/users/me.d.ts +1 -1
- package/lib/resolvers/queries/users/me.d.ts.map +1 -1
- package/lib/resolvers/queries/users/user.d.ts +1 -1
- package/lib/resolvers/queries/users/user.d.ts.map +1 -1
- package/lib/resolvers/queries/users/user.js +1 -1
- package/lib/resolvers/queries/users/user.js.map +1 -1
- package/lib/resolvers/queries/warehousing/token.d.ts +1 -1
- package/lib/resolvers/queries/warehousing/token.d.ts.map +1 -1
- package/lib/resolvers/queries/warehousing/tokens.d.ts.map +1 -1
- package/lib/resolvers/queries/warehousing/tokens.js +1 -1
- package/lib/resolvers/queries/warehousing/tokens.js.map +1 -1
- package/lib/resolvers/queries/warehousing/tokensCount.d.ts +1 -1
- package/lib/resolvers/queries/warehousing/warehousingProvider.d.ts +1 -1
- package/lib/resolvers/queries/warehousing/warehousingProvider.d.ts.map +1 -1
- package/lib/resolvers/queries/worker/work.d.ts +1 -1
- package/lib/resolvers/queries/worker/work.d.ts.map +1 -1
- package/lib/resolvers/scalars/LowerCaseString.d.ts +1 -1
- package/lib/resolvers/scalars/LowerCaseString.d.ts.map +1 -1
- package/lib/resolvers/scalars/index.d.ts +1 -1
- package/lib/resolvers/type/country-types.d.ts +2 -2
- package/lib/resolvers/type/country-types.d.ts.map +1 -1
- package/lib/resolvers/type/delivery-provider-types.d.ts +4 -4
- package/lib/resolvers/type/delivery-provider-types.js +1 -1
- package/lib/resolvers/type/delivery-provider-types.js.map +1 -1
- package/lib/resolvers/type/dimensions-types.d.ts +4 -4
- package/lib/resolvers/type/dispatch-types.d.ts +15 -0
- package/lib/resolvers/type/dispatch-types.d.ts.map +1 -0
- package/lib/resolvers/type/dispatch-types.js +16 -0
- package/lib/resolvers/type/dispatch-types.js.map +1 -0
- package/lib/resolvers/type/enrollment/enrollment-delivery-types.d.ts +1 -1
- package/lib/resolvers/type/enrollment/enrollment-delivery-types.d.ts.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-delivery-types.js +2 -0
- package/lib/resolvers/type/enrollment/enrollment-delivery-types.js.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-payment-types.d.ts +1 -1
- package/lib/resolvers/type/enrollment/enrollment-payment-types.d.ts.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-payment-types.js +4 -2
- package/lib/resolvers/type/enrollment/enrollment-payment-types.js.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-period-types.d.ts +1 -1
- package/lib/resolvers/type/enrollment/enrollment-period-types.d.ts.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-period-types.js +2 -0
- package/lib/resolvers/type/enrollment/enrollment-period-types.js.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-types.d.ts +4 -4
- package/lib/resolvers/type/enrollment/enrollment-types.js +2 -2
- package/lib/resolvers/type/enrollment/enrollment-types.js.map +1 -1
- package/lib/resolvers/type/filter/filter-types.d.ts +3 -3
- package/lib/resolvers/type/filter/loaded-filter-types.d.ts +3 -3
- package/lib/resolvers/type/index.d.ts +73 -90
- package/lib/resolvers/type/index.d.ts.map +1 -1
- package/lib/resolvers/type/index.js +0 -2
- package/lib/resolvers/type/index.js.map +1 -1
- package/lib/resolvers/type/media-types.d.ts +1 -1
- package/lib/resolvers/type/media-types.d.ts.map +1 -1
- package/lib/resolvers/type/media-types.js +5 -1
- package/lib/resolvers/type/media-types.js.map +1 -1
- package/lib/resolvers/type/oauth-account.d.ts +6 -0
- package/lib/resolvers/type/oauth-account.d.ts.map +1 -0
- package/lib/resolvers/type/oauth-account.js +7 -0
- package/lib/resolvers/type/oauth-account.js.map +1 -0
- package/lib/resolvers/type/oauth-provider.d.ts +6 -0
- package/lib/resolvers/type/oauth-provider.d.ts.map +1 -0
- package/lib/resolvers/type/oauth-provider.js +6 -0
- package/lib/resolvers/type/oauth-provider.js.map +1 -0
- package/lib/resolvers/type/order/order-delivery-discount-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-delivery-pickup-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-discount-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-global-discount-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-item-discount-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-item-types.d.ts +4 -4
- package/lib/resolvers/type/order/order-item-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-item-types.js +8 -3
- package/lib/resolvers/type/order/order-item-types.js.map +1 -1
- package/lib/resolvers/type/order/order-payment-discount-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-statistics-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-statistics-types.js.map +1 -1
- package/lib/resolvers/type/order/order-types.d.ts +4 -4
- package/lib/resolvers/type/order/order-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-types.js +18 -7
- package/lib/resolvers/type/order/order-types.js.map +1 -1
- package/lib/resolvers/type/payment/payment-provider-types.d.ts +3 -3
- package/lib/resolvers/type/payment/payment-provider-types.js.map +1 -1
- package/lib/resolvers/type/price-types.d.ts +2 -2
- package/lib/resolvers/type/price-types.d.ts.map +1 -1
- package/lib/resolvers/type/price-types.js +5 -2
- package/lib/resolvers/type/price-types.js.map +1 -1
- package/lib/resolvers/type/product/product-bundle-types.d.ts +5 -5
- package/lib/resolvers/type/product/product-bundle-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-configurable-types.d.ts +2 -2
- package/lib/resolvers/type/product/product-configurable-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-configurable-types.js +3 -2
- package/lib/resolvers/type/product/product-configurable-types.js.map +1 -1
- package/lib/resolvers/type/product/product-discount.d.ts +2 -2
- package/lib/resolvers/type/product/product-discount.js +1 -1
- package/lib/resolvers/type/product/product-discount.js.map +1 -1
- package/lib/resolvers/type/product/product-plan-types.d.ts +5 -5
- package/lib/resolvers/type/product/product-plan-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-plan-types.js +7 -5
- package/lib/resolvers/type/product/product-plan-types.js.map +1 -1
- package/lib/resolvers/type/product/product-review-types.js +1 -1
- package/lib/resolvers/type/product/product-review-types.js.map +1 -1
- package/lib/resolvers/type/product/product-simple-types.d.ts +6 -6
- package/lib/resolvers/type/product/product-simple-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-tokenized-types.d.ts +8 -8
- package/lib/resolvers/type/product/product-tokenized-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-tokenized-types.js +2 -2
- package/lib/resolvers/type/product/product-tokenized-types.js.map +1 -1
- package/lib/resolvers/type/product/product-variation-assignment-vector.d.ts +2 -2
- package/lib/resolvers/type/product/product-variation-assignment-vector.d.ts.map +1 -1
- package/lib/resolvers/type/product-search-result-types.js +2 -2
- package/lib/resolvers/type/product-search-result-types.js.map +1 -1
- package/lib/resolvers/type/quotation-types.d.ts +2 -2
- package/lib/resolvers/type/quotation-types.js +2 -2
- package/lib/resolvers/type/quotation-types.js.map +1 -1
- package/lib/resolvers/type/shop-types.d.ts.map +1 -1
- package/lib/resolvers/type/shop-types.js +2 -1
- package/lib/resolvers/type/shop-types.js.map +1 -1
- package/lib/resolvers/type/stock-types.d.ts +14 -0
- package/lib/resolvers/type/stock-types.d.ts.map +1 -0
- package/lib/resolvers/type/stock-types.js +15 -0
- package/lib/resolvers/type/stock-types.js.map +1 -0
- package/lib/resolvers/type/token-types.d.ts +2 -2
- package/lib/resolvers/type/user-types.d.ts +3 -3
- package/lib/resolvers/type/user-types.d.ts.map +1 -1
- package/lib/resolvers/type/user-types.js +4 -0
- package/lib/resolvers/type/user-types.js.map +1 -1
- package/lib/resolvers/type/warehousing-provider-types.d.ts +2 -2
- package/lib/resolvers/type/warehousing-provider-types.d.ts.map +1 -1
- package/lib/resolvers/type/web3-address.d.ts +1 -1
- package/lib/resolvers/type/work-types.d.ts +1 -1
- package/lib/resolvers/type/work-types.d.ts.map +1 -1
- package/lib/roles/all.js +2 -2
- package/lib/roles/all.js.map +1 -1
- package/lib/roles/index.d.ts +9 -9
- package/lib/roles/index.d.ts.map +1 -1
- package/lib/roles/index.js +3 -3
- package/lib/roles/index.js.map +1 -1
- package/lib/schema/index.d.ts +1 -1
- package/lib/schema/index.d.ts.map +1 -1
- package/lib/schema/index.js +3 -3
- package/lib/schema/index.js.map +1 -1
- package/lib/schema/query.d.ts.map +1 -1
- package/lib/schema/query.js +2 -0
- package/lib/schema/query.js.map +1 -1
- package/lib/schema/types/shop.d.ts.map +1 -1
- package/lib/schema/types/shop.js +3 -0
- package/lib/schema/types/shop.js.map +1 -1
- package/lib/schema/types/warehousing.js +1 -1
- package/lib/user-context.d.ts +7 -0
- package/lib/user-context.d.ts.map +1 -0
- package/lib/user-context.js +76 -0
- package/lib/user-context.js.map +1 -0
- package/package.json +18 -8
- package/src/api-index.ts +7 -6
- package/src/chat/defaultSystemPrompt.ts +16 -0
- package/src/chat/generateImageHandler.ts +78 -0
- package/src/chat/normalizeToolsIndex.ts +11 -0
- package/src/chat/utils.ts +31 -0
- package/src/context.ts +8 -2
- package/src/createGraphQLServer.ts +16 -13
- package/src/errors.ts +6 -0
- package/src/express/chatHandler.ts +204 -0
- package/src/express/createBulkImportMiddleware.ts +8 -7
- package/src/express/createERCMetadataMiddleware.ts +9 -11
- package/src/express/createMCPMiddleware.ts +1 -1
- package/src/express/createTempUploadMiddleware.ts +5 -9
- package/src/express/index.ts +3 -1
- package/src/fastify/bulkImportHandler.ts +8 -6
- package/src/fastify/chatHandler.ts +198 -0
- package/src/fastify/ercMetadataHandler.ts +4 -7
- package/src/fastify/index.ts +39 -3
- package/src/fastify/mcpHandler.ts +2 -2
- package/src/fastify/tempUploadHandler.ts +4 -6
- package/src/loaders/assortmentLinksLoader.ts +10 -7
- package/src/loaders/assortmentMediasLoader.ts +1 -1
- package/src/loaders/filterTextLoader.ts +16 -15
- package/src/loaders/productMediasLoader.ts +1 -1
- package/src/loaders/productProxiesLoader.ts +1 -1
- package/src/loaders/utils.ts +1 -1
- package/src/locale-context.ts +3 -3
- package/src/mcp/index.ts +6 -0
- package/src/mcp/resources/localization.ts +129 -0
- package/src/mcp/tools/assortment/handlers/removeAssortment.ts +2 -2
- package/src/mcp/tools/assortment/handlers/removeAssortmentFilter.ts +2 -2
- package/src/mcp/tools/assortment/handlers/removeAssortmentLink.ts +2 -2
- package/src/mcp/tools/assortment/handlers/removeAssortmentProduct.ts +2 -2
- package/src/mcp/tools/assortment/handlers/updateAssortmentMediaTexts.ts +2 -1
- package/src/mcp/tools/assortment/schemas.ts +1 -1
- package/src/mcp/tools/filter/handlers/createFilter.ts +2 -1
- package/src/mcp/tools/filter/handlers/createFilterOption.ts +9 -3
- package/src/mcp/tools/filter/handlers/removeFilterOption.ts +3 -0
- package/src/mcp/tools/filter/handlers/updateFilterTexts.ts +2 -1
- package/src/mcp/tools/localization/index.ts +1 -1
- package/src/mcp/tools/order/handlers/deliverOrder.ts +8 -3
- package/src/mcp/tools/order/handlers/getTopCustomers.ts +11 -7
- package/src/mcp/tools/order/handlers/payOrder.ts +8 -3
- package/src/mcp/tools/product/handlers/addBundleItem.ts +21 -20
- package/src/mcp/tools/product/handlers/addProductAssignment.ts +4 -4
- package/src/mcp/tools/product/handlers/addProductMedia.ts +4 -5
- package/src/mcp/tools/product/handlers/addProductVariationOption.ts +3 -2
- package/src/mcp/tools/product/handlers/createProductVariation.ts +1 -0
- package/src/mcp/tools/product/handlers/getCatalogPrice.ts +3 -1
- package/src/mcp/tools/product/handlers/getProductAssignments.ts +8 -4
- package/src/mcp/tools/product/handlers/index.ts +2 -0
- package/src/mcp/tools/product/handlers/removeProduct.ts +23 -3
- package/src/mcp/tools/product/handlers/simulatePrice.ts +2 -0
- package/src/mcp/tools/product/handlers/simulatePriceRange.ts +3 -0
- package/src/mcp/tools/product/handlers/updateProduct.ts +12 -1
- package/src/mcp/tools/product/handlers/updateProductMediaTexts.ts +5 -1
- package/src/mcp/tools/product/handlers/updateProductTexts.ts +16 -0
- package/src/mcp/tools/product/schemas.ts +19 -6
- package/src/mcp/tools/quotation/handlers/countQuotations.ts +8 -0
- package/src/mcp/tools/quotation/handlers/getQuotation.ts +8 -0
- package/src/mcp/tools/quotation/handlers/index.ts +15 -0
- package/src/mcp/tools/quotation/handlers/listQuotations.ts +14 -0
- package/src/mcp/tools/quotation/handlers/makeQuotationProposal.ts +23 -0
- package/src/mcp/tools/quotation/handlers/rejectQuotation.ts +21 -0
- package/src/mcp/tools/quotation/handlers/verifyQuotation.ts +21 -0
- package/src/mcp/tools/quotation/index.ts +12 -0
- package/src/mcp/tools/quotation/quotationManagement.ts +34 -0
- package/src/mcp/tools/quotation/schemas.ts +136 -0
- package/src/mcp/tools/system/handlers/listWork.ts +3 -3
- package/src/mcp/tools/system/index.ts +1 -1
- package/src/mcp/tools/system/schemas.ts +2 -2
- package/src/mcp/tools/system/types.ts +1 -1
- package/src/mcp/tools/users/handlers/addUserEmail.ts +2 -2
- package/src/mcp/tools/users/handlers/enrollUser.ts +1 -1
- package/src/mcp/tools/users/handlers/getCurrentUser.ts +1 -1
- package/src/mcp/tools/users/handlers/getUserAvatar.ts +1 -1
- package/src/mcp/tools/users/handlers/removeUserEmail.ts +2 -2
- package/src/mcp/utils/getNormalizedAssortmentDetails.ts +9 -29
- package/src/mcp/utils/getNormalizedFilterDetails.ts +3 -3
- package/src/mcp/utils/getNormalizedOrderDetails.ts +3 -3
- package/src/mcp/utils/getNormalizedProductDetails.ts +11 -29
- package/src/mcp/utils/getNormalizedQuotationDetails.ts +38 -0
- package/src/mcp/utils/getNormalizedUserDetails.ts +3 -3
- package/src/mcp/utils/normalizeMediaUrl.ts +1 -1
- package/src/mcp/utils/normalizeProxyAssignments.ts +29 -0
- package/src/mcp/utils/sharedSchemas.ts +1 -1
- package/src/resolvers/mutations/accounts/addEmail.ts +3 -3
- package/src/resolvers/mutations/accounts/addWeb3Address.ts +2 -2
- package/src/resolvers/mutations/accounts/addWebAuthnCredentials.ts +2 -2
- package/src/resolvers/mutations/accounts/changePassword.ts +4 -4
- package/src/resolvers/mutations/accounts/createUser.ts +3 -3
- package/src/resolvers/mutations/accounts/loginAsGuest.ts +3 -2
- package/src/resolvers/mutations/accounts/loginWithPassword.ts +4 -3
- package/src/resolvers/mutations/accounts/loginWithWebAuthn.ts +4 -3
- package/src/resolvers/mutations/accounts/removeEmail.ts +3 -3
- package/src/resolvers/mutations/accounts/removeWeb3Address.ts +2 -2
- package/src/resolvers/mutations/accounts/removeWebAuthnCredentials.ts +2 -2
- package/src/resolvers/mutations/accounts/verifyEmail.ts +3 -2
- package/src/resolvers/mutations/accounts/verifyWeb3Address.ts +3 -3
- package/src/resolvers/mutations/assortments/removeAssortment.ts +3 -5
- package/src/resolvers/mutations/delivery/createDeliveryProvider.ts +1 -1
- package/src/resolvers/mutations/enrollments/createEnrollment.ts +1 -1
- package/src/resolvers/mutations/enrollments/updateEnrollment.ts +9 -6
- package/src/resolvers/mutations/filters/createFilterOption.ts +1 -1
- package/src/resolvers/mutations/filters/removeFilterOption.ts +1 -1
- package/src/resolvers/mutations/filters/updateFilter.ts +1 -1
- package/src/resolvers/mutations/orders/addCartDiscount.ts +1 -1
- package/src/resolvers/mutations/orders/addCartProduct.ts +1 -1
- package/src/resolvers/mutations/orders/addCartQuotation.ts +5 -2
- package/src/resolvers/mutations/orders/addMultipleCartProducts.ts +3 -3
- package/src/resolvers/mutations/orders/checkoutCart.ts +2 -2
- package/src/resolvers/mutations/orders/createCart.ts +1 -1
- package/src/resolvers/mutations/orders/deliverOrder.ts +8 -3
- package/src/resolvers/mutations/orders/emptyCart.ts +1 -1
- package/src/resolvers/mutations/orders/payOrder.ts +8 -3
- package/src/resolvers/mutations/orders/removeCartDiscount.ts +10 -2
- package/src/resolvers/mutations/orders/removeCartItem.ts +8 -1
- package/src/resolvers/mutations/orders/signPaymentProviderForCheckout.ts +10 -4
- package/src/resolvers/mutations/orders/updateCart.ts +1 -1
- package/src/resolvers/mutations/orders/updateCartDeliveryPickUp.ts +4 -1
- package/src/resolvers/mutations/orders/updateCartDeliveryShipping.ts +4 -1
- package/src/resolvers/mutations/orders/updateCartItem.ts +8 -3
- package/src/resolvers/mutations/orders/updateCartPaymentGeneric.ts +4 -1
- package/src/resolvers/mutations/orders/updateCartPaymentInvoice.ts +4 -1
- package/src/resolvers/mutations/payment/createPaymentProvider.ts +1 -1
- package/src/resolvers/mutations/payment/markPaymentCredentialsPreferred.ts +1 -1
- package/src/resolvers/mutations/products/addProductAssignment.ts +2 -2
- package/src/resolvers/mutations/products/addProductReviewVote.ts +1 -1
- package/src/resolvers/mutations/products/createProductReview.ts +6 -3
- package/src/resolvers/mutations/quotations/requestQuotation.ts +1 -1
- package/src/resolvers/mutations/users/addPushSubscription.ts +2 -2
- package/src/resolvers/mutations/users/removePushSubscription.ts +2 -2
- package/src/resolvers/mutations/users/removeUser.ts +3 -3
- package/src/resolvers/mutations/users/updateUserProfile.ts +2 -2
- package/src/resolvers/mutations/warehousing/createWarehousingProvider.ts +1 -1
- package/src/resolvers/mutations/worker/allocateWork.ts +1 -1
- package/src/resolvers/mutations/worker/finishWork.ts +3 -3
- package/src/resolvers/queries/products/product.ts +1 -1
- package/src/resolvers/queries/shopInfo.ts +52 -3
- package/src/resolvers/queries/users/user.ts +2 -2
- package/src/resolvers/queries/warehousing/tokens.ts +1 -1
- package/src/resolvers/type/country-types.ts +2 -2
- package/src/resolvers/type/delivery-provider-types.ts +1 -1
- package/src/resolvers/type/enrollment/enrollment-delivery-types.ts +1 -0
- package/src/resolvers/type/enrollment/enrollment-payment-types.ts +3 -2
- package/src/resolvers/type/enrollment/enrollment-period-types.ts +1 -0
- package/src/resolvers/type/enrollment/enrollment-types.ts +2 -2
- package/src/resolvers/type/index.ts +0 -2
- package/src/resolvers/type/media-types.ts +6 -2
- package/src/resolvers/type/order/order-item-types.ts +20 -13
- package/src/resolvers/type/order/order-statistics-types.ts +3 -3
- package/src/resolvers/type/order/order-types.ts +22 -11
- package/src/resolvers/type/payment/payment-provider-types.ts +2 -2
- package/src/resolvers/type/price-types.ts +5 -3
- package/src/resolvers/type/product/product-configurable-types.ts +7 -5
- package/src/resolvers/type/product/product-discount.ts +1 -1
- package/src/resolvers/type/product/product-plan-types.ts +12 -10
- package/src/resolvers/type/product/product-review-types.ts +1 -1
- package/src/resolvers/type/product/product-simple-types.ts +1 -1
- package/src/resolvers/type/product/product-tokenized-types.ts +8 -8
- package/src/resolvers/type/product/product-variation-assignment-vector.ts +2 -2
- package/src/resolvers/type/product-search-result-types.ts +2 -2
- package/src/resolvers/type/quotation-types.ts +2 -2
- package/src/resolvers/type/shop-types.ts +3 -3
- package/src/resolvers/type/user-types.ts +5 -4
- package/src/resolvers/type/warehousing-provider-types.ts +2 -2
- package/src/resolvers/type/work-types.ts +1 -1
- package/src/roles/all.ts +2 -2
- package/src/roles/index.ts +9 -3
- package/src/schema/index.ts +4 -4
- package/src/schema/query.ts +2 -0
- package/src/schema/types/shop.ts +3 -0
- package/src/schema/types/warehousing.ts +1 -1
- package/src/resolvers/type/color-types.ts +0 -31
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import express from 'express';
|
|
2
|
+
import type { Express, Request, RequestHandler, Response } from 'express';
|
|
3
|
+
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
4
|
+
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
5
|
+
import {
|
|
6
|
+
convertToModelMessages,
|
|
7
|
+
experimental_createMCPClient as createMCPClient,
|
|
8
|
+
MCPTransport,
|
|
9
|
+
stepCountIs,
|
|
10
|
+
streamText,
|
|
11
|
+
ToolSet,
|
|
12
|
+
} from 'ai';
|
|
13
|
+
import { ChatConfiguration, errorHandler } from '../chat/utils.js';
|
|
14
|
+
import generateImageHandler from '../chat/generateImageHandler.js';
|
|
15
|
+
import defaultSystemPrompt from '../chat/defaultSystemPrompt.js';
|
|
16
|
+
import normalizeToolsIndex from '../chat/normalizeToolsIndex.js';
|
|
17
|
+
|
|
18
|
+
export const expressRouter = () => {
|
|
19
|
+
const router = express.Router();
|
|
20
|
+
|
|
21
|
+
const staticURL = import.meta.resolve('@unchainedshop/admin-ui');
|
|
22
|
+
const staticPath = new URL(staticURL).pathname.split('/').slice(0, -1).join('/');
|
|
23
|
+
|
|
24
|
+
router.use(express.static(staticPath));
|
|
25
|
+
|
|
26
|
+
router.get(/(.*)/, (_, res) => {
|
|
27
|
+
res.sendFile(`${staticPath}/index.html`);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
return router;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const setupMCPChatHandler = (chatConfiguration: ChatConfiguration & any): RequestHandler => {
|
|
34
|
+
if (!chatConfiguration || !chatConfiguration.model) {
|
|
35
|
+
throw new Error('Model is required');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const {
|
|
39
|
+
tools: additionalTools = {},
|
|
40
|
+
unchainedMCPUrl = `${process.env.ROOT_URL}/mcp`,
|
|
41
|
+
model,
|
|
42
|
+
imageGenerationTool,
|
|
43
|
+
...restChatConfig
|
|
44
|
+
}: any = chatConfiguration;
|
|
45
|
+
|
|
46
|
+
const system = chatConfiguration.system ?? defaultSystemPrompt;
|
|
47
|
+
|
|
48
|
+
const mcpChatHandler: RequestHandler = async (req: Request, res: Response): Promise<void> => {
|
|
49
|
+
if (req.method === 'OPTIONS') {
|
|
50
|
+
res.setHeader('access-control-allow-credentials', 'true');
|
|
51
|
+
res.setHeader('access-control-allow-private-network', 'true');
|
|
52
|
+
res.status(200).end();
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (req.method !== 'POST' && req.method !== 'GET') {
|
|
56
|
+
res.status(405).json({ error: 'Method Not Allowed. Use POST.' });
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const resourceTransport = new StreamableHTTPClientTransport(new URL(unchainedMCPUrl), {
|
|
60
|
+
requestInit: {
|
|
61
|
+
headers: {
|
|
62
|
+
Cookie: req.headers.cookie || '',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const sdkClient = new Client(
|
|
68
|
+
{ name: 'unchained-chat-client', version: '1.0.0' },
|
|
69
|
+
{
|
|
70
|
+
capabilities: { resources: {} },
|
|
71
|
+
},
|
|
72
|
+
);
|
|
73
|
+
await sdkClient.connect(resourceTransport as any);
|
|
74
|
+
const transport = new StreamableHTTPClientTransport(new URL(unchainedMCPUrl), {
|
|
75
|
+
requestInit: {
|
|
76
|
+
headers: {
|
|
77
|
+
Cookie: req.headers.cookie || '',
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
const client = await createMCPClient({
|
|
83
|
+
transport: transport as MCPTransport,
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
try {
|
|
87
|
+
const defaultUnchainedTools = await client.tools();
|
|
88
|
+
let resourceContext = '';
|
|
89
|
+
try {
|
|
90
|
+
const resources = await sdkClient.listResources();
|
|
91
|
+
if (resources?.resources) {
|
|
92
|
+
const resourceTexts = await Promise.all(
|
|
93
|
+
resources.resources.map(async (resource) => {
|
|
94
|
+
try {
|
|
95
|
+
const content = await sdkClient.readResource({ uri: resource.uri });
|
|
96
|
+
if (content?.contents?.[0]?.text) {
|
|
97
|
+
return `${resource.name}:\n${content.contents[0].text}`;
|
|
98
|
+
}
|
|
99
|
+
} catch (e) {
|
|
100
|
+
console.error(`Failed to read resource ${resource.uri}:`, e);
|
|
101
|
+
}
|
|
102
|
+
return null;
|
|
103
|
+
}),
|
|
104
|
+
);
|
|
105
|
+
resourceContext =
|
|
106
|
+
'\n\nAVAILABLE SHOP CONFIGURATION:\n' + resourceTexts.filter(Boolean).join('\n\n');
|
|
107
|
+
}
|
|
108
|
+
} catch (e) {
|
|
109
|
+
console.error('Failed to fetch MCP resources:', e);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const tools: ToolSet = {
|
|
113
|
+
...defaultUnchainedTools,
|
|
114
|
+
...additionalTools,
|
|
115
|
+
};
|
|
116
|
+
if (imageGenerationTool) {
|
|
117
|
+
tools.generateImage = generateImageHandler(req)(imageGenerationTool) as any;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (req.method === 'GET') {
|
|
121
|
+
res.status(200).json({
|
|
122
|
+
tools: normalizeToolsIndex(tools),
|
|
123
|
+
cached: false,
|
|
124
|
+
});
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
const { messages } = req.body;
|
|
128
|
+
|
|
129
|
+
const cacheControlledTools = { ...tools };
|
|
130
|
+
const keys = Object.keys(cacheControlledTools);
|
|
131
|
+
const lastKey = keys[keys.length - 1];
|
|
132
|
+
|
|
133
|
+
cacheControlledTools[lastKey] = {
|
|
134
|
+
...cacheControlledTools[lastKey],
|
|
135
|
+
providerOptions: {
|
|
136
|
+
anthropic: { cacheControl: { type: 'ephemeral' } },
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const normalizedMessages = convertToModelMessages(messages, { tools: cacheControlledTools });
|
|
141
|
+
|
|
142
|
+
if (normalizedMessages.length > 0) {
|
|
143
|
+
const lastIndex = normalizedMessages.length - 1;
|
|
144
|
+
normalizedMessages[lastIndex] = {
|
|
145
|
+
...normalizedMessages[lastIndex],
|
|
146
|
+
providerOptions: { anthropic: { cacheControl: { type: 'ephemeral' } } },
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const MAX_MESSAGES = 10;
|
|
151
|
+
let startIndex = Math.max(0, normalizedMessages.length - MAX_MESSAGES);
|
|
152
|
+
while (startIndex < normalizedMessages.length) {
|
|
153
|
+
const msg = normalizedMessages[startIndex];
|
|
154
|
+
const hasOrphanedToolResult =
|
|
155
|
+
Array.isArray(msg.content) && msg.content.some((c: any) => c.type === 'tool-result');
|
|
156
|
+
|
|
157
|
+
if (!hasOrphanedToolResult) break;
|
|
158
|
+
startIndex++;
|
|
159
|
+
}
|
|
160
|
+
const messagesToInclude = normalizedMessages.slice(startIndex);
|
|
161
|
+
|
|
162
|
+
const result = streamText({
|
|
163
|
+
stopWhen: stepCountIs(10),
|
|
164
|
+
temperature: 0.2,
|
|
165
|
+
maxRetries: 3,
|
|
166
|
+
...restChatConfig,
|
|
167
|
+
system: system + resourceContext,
|
|
168
|
+
model,
|
|
169
|
+
tools: cacheControlledTools,
|
|
170
|
+
onFinish: async () => {
|
|
171
|
+
await client?.close();
|
|
172
|
+
},
|
|
173
|
+
messages: messagesToInclude,
|
|
174
|
+
providerOptions: {
|
|
175
|
+
anthropic: {
|
|
176
|
+
cacheControl: {
|
|
177
|
+
type: 'ephemeral',
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
result.pipeUIMessageStreamToResponse(res, {
|
|
184
|
+
onError: errorHandler,
|
|
185
|
+
});
|
|
186
|
+
} catch (err) {
|
|
187
|
+
await client?.close();
|
|
188
|
+
await sdkClient?.close();
|
|
189
|
+
res.status(500).json({ error: errorHandler(err) });
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
return mcpChatHandler;
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
export const connectChat = (app: Express, chatConfiguration: ChatConfiguration) => {
|
|
197
|
+
const handler = setupMCPChatHandler(chatConfiguration);
|
|
198
|
+
if (!handler) {
|
|
199
|
+
throw new Error('Invalid chat configuration: model is required.');
|
|
200
|
+
}
|
|
201
|
+
app.post('/chat', express.json({ limit: '10mb' }), handler);
|
|
202
|
+
app.options('/chat', handler);
|
|
203
|
+
app.get('/chat/tools', handler);
|
|
204
|
+
};
|
|
@@ -7,8 +7,7 @@ const logger = createLogger('unchained:bulk-import');
|
|
|
7
7
|
|
|
8
8
|
const methodWrongHandler = (res) => {
|
|
9
9
|
logger.error('Method not supported, return 404');
|
|
10
|
-
res.
|
|
11
|
-
res.end();
|
|
10
|
+
res.status(404).end();
|
|
12
11
|
return;
|
|
13
12
|
};
|
|
14
13
|
|
|
@@ -41,6 +40,10 @@ export default async function bulkImportMiddleware(
|
|
|
41
40
|
meta: {},
|
|
42
41
|
});
|
|
43
42
|
|
|
43
|
+
const validationStream = await context.services.files.createDownloadStream({ fileId: file._id });
|
|
44
|
+
if (!validationStream) throw new Error('Could not create download stream from uploaded file');
|
|
45
|
+
await context.bulkImporter.validateEventStream(validationStream);
|
|
46
|
+
|
|
44
47
|
input.payloadId = file._id;
|
|
45
48
|
input.payloadSize = file.size;
|
|
46
49
|
|
|
@@ -53,12 +56,10 @@ export default async function bulkImportMiddleware(
|
|
|
53
56
|
priority: 10,
|
|
54
57
|
});
|
|
55
58
|
|
|
56
|
-
res.
|
|
57
|
-
res.end(JSON.stringify(work));
|
|
59
|
+
res.status(200).send(work);
|
|
58
60
|
} catch (e) {
|
|
59
|
-
logger.error(e
|
|
60
|
-
res.
|
|
61
|
-
res.end(JSON.stringify({ name: e.name, code: e.code, message: e.message }));
|
|
61
|
+
logger.error(e);
|
|
62
|
+
res.status(503).send({ name: e.name, code: e.code, message: e.message });
|
|
62
63
|
return;
|
|
63
64
|
}
|
|
64
65
|
}
|
|
@@ -8,8 +8,7 @@ const { ROOT_URL = 'http://localhost:4010' } = process.env;
|
|
|
8
8
|
|
|
9
9
|
const methodWrongHandler = (res) => {
|
|
10
10
|
logger.error('Method not supported, return 404');
|
|
11
|
-
res.
|
|
12
|
-
res.end();
|
|
11
|
+
res.status(404).end();
|
|
13
12
|
return;
|
|
14
13
|
};
|
|
15
14
|
|
|
@@ -30,14 +29,16 @@ const ercMetadataMiddleware: RequestHandler = async (
|
|
|
30
29
|
if (!pathname.toLowerCase().endsWith('.json')) throw new Error('Invalid ERC Metadata URI');
|
|
31
30
|
|
|
32
31
|
const fileName = pathname.split('/').pop();
|
|
33
|
-
|
|
32
|
+
|
|
33
|
+
if (!fileName) throw new Error('Invalid ERC Metadata URI');
|
|
34
|
+
const tokenSerialNumber = fileName.slice(0, fileName.lastIndexOf('.'));
|
|
34
35
|
|
|
35
36
|
const [, productId, localeOrTokenFilename, tokenFileName] = url.pathname.split('/');
|
|
36
37
|
|
|
37
38
|
const product = await loaders.productLoader.load({ productId });
|
|
38
39
|
|
|
39
40
|
const [token] = await modules.warehousing.findTokens({
|
|
40
|
-
|
|
41
|
+
tokenSerialNumber,
|
|
41
42
|
contractAddress: product?.tokenization?.contractAddress,
|
|
42
43
|
});
|
|
43
44
|
|
|
@@ -51,15 +52,12 @@ const ercMetadataMiddleware: RequestHandler = async (
|
|
|
51
52
|
return methodWrongHandler(res);
|
|
52
53
|
}
|
|
53
54
|
|
|
54
|
-
const body = JSON.stringify(ercMetadata);
|
|
55
55
|
res.status(200);
|
|
56
|
-
res.
|
|
57
|
-
res.setHeader('Content-Length', new TextEncoder().encode(body).length);
|
|
58
|
-
return res.send(body);
|
|
56
|
+
return res.send(ercMetadata);
|
|
59
57
|
} catch (e) {
|
|
60
|
-
logger.error(e
|
|
61
|
-
res.
|
|
62
|
-
res.
|
|
58
|
+
logger.error(e);
|
|
59
|
+
res.status(503);
|
|
60
|
+
res.send({ name: e.name, code: e.code, message: e.message });
|
|
63
61
|
return;
|
|
64
62
|
}
|
|
65
63
|
};
|
|
@@ -34,7 +34,7 @@ const handlePostRequest: RequestHandler = async (req: Request & { unchainedConte
|
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
const roles = req.unchainedContext.user
|
|
37
|
+
const roles = req.unchainedContext.user?.roles || [];
|
|
38
38
|
const server = createMcpServer(req.unchainedContext, roles);
|
|
39
39
|
await server.connect(transport);
|
|
40
40
|
} else {
|
|
@@ -8,8 +8,7 @@ const logger = createLogger('unchained:temp-upload');
|
|
|
8
8
|
|
|
9
9
|
const methodWrongHandler = (res) => {
|
|
10
10
|
logger.error('Method not supported, return 404');
|
|
11
|
-
res.
|
|
12
|
-
res.end();
|
|
11
|
+
res.status(404).end();
|
|
13
12
|
return;
|
|
14
13
|
};
|
|
15
14
|
|
|
@@ -46,15 +45,12 @@ export default async function tempUploadMiddleware(
|
|
|
46
45
|
|
|
47
46
|
const fileUploadAdapter = getFileAdapter();
|
|
48
47
|
const rawUrl = await fileUploadAdapter.createDownloadURL(file);
|
|
48
|
+
if (!rawUrl) throw new Error('Could not create download URL for file');
|
|
49
49
|
const url = context.modules.files.normalizeUrl(rawUrl, {});
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
res.writeHead(200);
|
|
53
|
-
res.end(body);
|
|
50
|
+
res.status(200).send({ fileId: file._id, url, expires: expires.toISOString() });
|
|
54
51
|
} catch (e) {
|
|
55
|
-
logger.error(e
|
|
56
|
-
res.
|
|
57
|
-
res.end(JSON.stringify({ name: e.name, code: e.code, message: e.message }));
|
|
52
|
+
logger.error(e);
|
|
53
|
+
res.status(503).send({ name: e.name, code: e.code, message: e.message });
|
|
58
54
|
return;
|
|
59
55
|
}
|
|
60
56
|
}
|
package/src/express/index.ts
CHANGED
|
@@ -16,6 +16,8 @@ import createTempUploadMiddleware from './createTempUploadMiddleware.js';
|
|
|
16
16
|
import createMCPMiddleware from './createMCPMiddleware.js';
|
|
17
17
|
import { API_EVENTS } from '../events.js';
|
|
18
18
|
|
|
19
|
+
export * from './chatHandler.js';
|
|
20
|
+
|
|
19
21
|
const resolveUserRemoteAddress = (req: e.Request) => {
|
|
20
22
|
const remoteAddress =
|
|
21
23
|
(req.headers['x-real-ip'] as string) ||
|
|
@@ -39,7 +41,7 @@ const {
|
|
|
39
41
|
UNCHAINED_COOKIE_NAME = 'unchained_token',
|
|
40
42
|
UNCHAINED_COOKIE_PATH = '/',
|
|
41
43
|
UNCHAINED_COOKIE_DOMAIN,
|
|
42
|
-
UNCHAINED_COOKIE_SAMESITE,
|
|
44
|
+
UNCHAINED_COOKIE_SAMESITE = 'none',
|
|
43
45
|
UNCHAINED_COOKIE_INSECURE,
|
|
44
46
|
} = process.env;
|
|
45
47
|
|
|
@@ -32,6 +32,11 @@ const bulkImportHandler: RouteHandlerMethod = async (
|
|
|
32
32
|
chunkSizeBytes: 1024 * 1024 * 5, // 5MB chunks
|
|
33
33
|
});
|
|
34
34
|
|
|
35
|
+
const validationStream = await context.services.files.createDownloadStream({ fileId: file._id });
|
|
36
|
+
if (!validationStream) throw new Error('Could not create download stream from uploaded file');
|
|
37
|
+
|
|
38
|
+
await context.bulkImporter.validateEventStream(validationStream);
|
|
39
|
+
|
|
35
40
|
input.payloadId = file._id;
|
|
36
41
|
input.payloadSize = file.size;
|
|
37
42
|
|
|
@@ -44,15 +49,12 @@ const bulkImportHandler: RouteHandlerMethod = async (
|
|
|
44
49
|
priority: 10,
|
|
45
50
|
});
|
|
46
51
|
|
|
47
|
-
const body = JSON.stringify(work);
|
|
48
52
|
res.status(200);
|
|
49
|
-
res.
|
|
50
|
-
res.header('Content-Type', 'application/json');
|
|
51
|
-
return res.send(body);
|
|
53
|
+
return res.send(work);
|
|
52
54
|
} catch (e) {
|
|
53
|
-
logger.error(e
|
|
55
|
+
logger.error(e);
|
|
54
56
|
res.status(503);
|
|
55
|
-
return res.send(
|
|
57
|
+
return res.send({ name: e.name, code: e.code, message: e.message });
|
|
56
58
|
}
|
|
57
59
|
};
|
|
58
60
|
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { FastifyInstance, RouteHandlerMethod, FastifyRequest } from 'fastify';
|
|
2
|
+
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
3
|
+
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
4
|
+
import {
|
|
5
|
+
convertToModelMessages,
|
|
6
|
+
experimental_createMCPClient as createMCPClient,
|
|
7
|
+
MCPTransport,
|
|
8
|
+
stepCountIs,
|
|
9
|
+
streamText,
|
|
10
|
+
ToolSet,
|
|
11
|
+
} from 'ai';
|
|
12
|
+
import generateImageHandler from '../chat/generateImageHandler.js';
|
|
13
|
+
import defaultSystemPrompt from '../chat/defaultSystemPrompt.js';
|
|
14
|
+
import normalizeToolsIndex from '../chat/normalizeToolsIndex.js';
|
|
15
|
+
import { ChatConfiguration, errorHandler } from '../chat/utils.js';
|
|
16
|
+
import { createLogger } from '@unchainedshop/logger';
|
|
17
|
+
|
|
18
|
+
const logger = createLogger('unchained:api:chat');
|
|
19
|
+
|
|
20
|
+
const setupMCPChatHandler = (chatConfiguration: ChatConfiguration & any) => {
|
|
21
|
+
if (!chatConfiguration?.model) {
|
|
22
|
+
throw new Error('Model is required');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const {
|
|
26
|
+
tools: additionalTools = {},
|
|
27
|
+
unchainedMCPUrl = `${process.env.ROOT_URL}/mcp`,
|
|
28
|
+
imageGenerationTool,
|
|
29
|
+
...restChatConfig
|
|
30
|
+
} = chatConfiguration;
|
|
31
|
+
|
|
32
|
+
const system = chatConfiguration.system ?? defaultSystemPrompt;
|
|
33
|
+
|
|
34
|
+
const mcpChatHandler: RouteHandlerMethod = async (req: FastifyRequest, res) => {
|
|
35
|
+
let client;
|
|
36
|
+
try {
|
|
37
|
+
if (req.method === 'OPTIONS') {
|
|
38
|
+
res.headers({
|
|
39
|
+
'access-control-allow-credentials': 'true',
|
|
40
|
+
'access-control-allow-private-network': 'true',
|
|
41
|
+
});
|
|
42
|
+
return res.status(200).send();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const resourceTransport = new StreamableHTTPClientTransport(new URL(unchainedMCPUrl), {
|
|
46
|
+
requestInit: {
|
|
47
|
+
headers: {
|
|
48
|
+
Cookie: req.headers.cookie || '',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
const sdkClient = new Client(
|
|
54
|
+
{ name: 'unchained-chat-client', version: '1.0.0' },
|
|
55
|
+
{
|
|
56
|
+
capabilities: { resources: {} },
|
|
57
|
+
},
|
|
58
|
+
);
|
|
59
|
+
await sdkClient.connect(resourceTransport as any);
|
|
60
|
+
|
|
61
|
+
const transport = new StreamableHTTPClientTransport(new URL(unchainedMCPUrl), {
|
|
62
|
+
requestInit: {
|
|
63
|
+
headers: {
|
|
64
|
+
Cookie: req.headers.cookie || '',
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
client = await createMCPClient({
|
|
70
|
+
transport: transport as MCPTransport,
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const defaultUnchainedTools = await client.tools();
|
|
74
|
+
|
|
75
|
+
let resourceContext = '';
|
|
76
|
+
try {
|
|
77
|
+
const resources = await sdkClient.listResources();
|
|
78
|
+
if (resources?.resources) {
|
|
79
|
+
const resourceTexts = await Promise.all(
|
|
80
|
+
resources.resources.map(async (resource) => {
|
|
81
|
+
try {
|
|
82
|
+
const content = await sdkClient.readResource({ uri: resource.uri });
|
|
83
|
+
if (content?.contents?.[0]?.text) {
|
|
84
|
+
return `${resource.name}:\n${content.contents[0].text}`;
|
|
85
|
+
}
|
|
86
|
+
} catch (e) {
|
|
87
|
+
logger.error(`Failed to read resource ${resource.uri}:`, e);
|
|
88
|
+
}
|
|
89
|
+
return null;
|
|
90
|
+
}),
|
|
91
|
+
);
|
|
92
|
+
resourceContext =
|
|
93
|
+
'\n\nAVAILABLE SHOP CONFIGURATION:\n' + resourceTexts.filter(Boolean).join('\n\n');
|
|
94
|
+
}
|
|
95
|
+
} catch (e) {
|
|
96
|
+
logger.error('Failed to fetch MCP resources:', e);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const tools: ToolSet = {
|
|
100
|
+
...defaultUnchainedTools,
|
|
101
|
+
...additionalTools,
|
|
102
|
+
};
|
|
103
|
+
if (imageGenerationTool) {
|
|
104
|
+
tools.generateImage = generateImageHandler(req)(imageGenerationTool) as any;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (req.method === 'GET') {
|
|
108
|
+
return res.status(200).send({
|
|
109
|
+
tools: normalizeToolsIndex(tools),
|
|
110
|
+
cached: false,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const { messages } = req.body as any;
|
|
115
|
+
|
|
116
|
+
const cacheControlledTools = { ...tools };
|
|
117
|
+
const keys = Object.keys(cacheControlledTools);
|
|
118
|
+
const lastKey = keys[keys.length - 1];
|
|
119
|
+
|
|
120
|
+
cacheControlledTools[lastKey] = {
|
|
121
|
+
...cacheControlledTools[lastKey],
|
|
122
|
+
providerOptions: {
|
|
123
|
+
anthropic: { cacheControl: { type: 'ephemeral' } },
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const normalizedMessages = convertToModelMessages(messages, { tools: cacheControlledTools });
|
|
128
|
+
|
|
129
|
+
if (normalizedMessages.length > 0) {
|
|
130
|
+
const lastIndex = normalizedMessages.length - 1;
|
|
131
|
+
normalizedMessages[lastIndex] = {
|
|
132
|
+
...normalizedMessages[lastIndex],
|
|
133
|
+
providerOptions: { anthropic: { cacheControl: { type: 'ephemeral' } } },
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const MAX_MESSAGES = 10;
|
|
138
|
+
let startIndex = Math.max(0, normalizedMessages.length - MAX_MESSAGES);
|
|
139
|
+
while (startIndex < normalizedMessages.length) {
|
|
140
|
+
const msg = normalizedMessages[startIndex];
|
|
141
|
+
const hasOrphanedToolResult =
|
|
142
|
+
Array.isArray(msg.content) && msg.content.some((c: any) => c.type === 'tool-result');
|
|
143
|
+
|
|
144
|
+
if (!hasOrphanedToolResult) break;
|
|
145
|
+
startIndex++;
|
|
146
|
+
}
|
|
147
|
+
const messagesToInclude = normalizedMessages.slice(startIndex);
|
|
148
|
+
|
|
149
|
+
const result = streamText({
|
|
150
|
+
stopWhen: stepCountIs(500),
|
|
151
|
+
temperature: 0.2,
|
|
152
|
+
maxRetries: 3,
|
|
153
|
+
...restChatConfig,
|
|
154
|
+
messages: messagesToInclude,
|
|
155
|
+
system: system + resourceContext,
|
|
156
|
+
tools: cacheControlledTools,
|
|
157
|
+
onFinish: async () => {
|
|
158
|
+
await client?.close();
|
|
159
|
+
},
|
|
160
|
+
providerOptions: {
|
|
161
|
+
anthropic: {
|
|
162
|
+
cacheControl: {
|
|
163
|
+
type: 'ephemeral',
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
return res.send(
|
|
170
|
+
result.toUIMessageStreamResponse({
|
|
171
|
+
onError: errorHandler,
|
|
172
|
+
}),
|
|
173
|
+
);
|
|
174
|
+
} catch (err: any) {
|
|
175
|
+
logger.error(err);
|
|
176
|
+
await client?.close();
|
|
177
|
+
res.status(500);
|
|
178
|
+
return res.send({ error: errorHandler(err) });
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
return mcpChatHandler;
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
export const connectChat = (app: FastifyInstance, chatConfiguration: ChatConfiguration) => {
|
|
185
|
+
const handler = setupMCPChatHandler(chatConfiguration);
|
|
186
|
+
|
|
187
|
+
app.route({
|
|
188
|
+
url: '/chat',
|
|
189
|
+
method: ['POST', 'OPTIONS'],
|
|
190
|
+
handler,
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
app.route({
|
|
194
|
+
url: '/chat/tools',
|
|
195
|
+
method: ['GET', 'OPTIONS'],
|
|
196
|
+
handler,
|
|
197
|
+
});
|
|
198
|
+
};
|
|
@@ -27,7 +27,7 @@ const ercMetadataHandler: RouteHandlerMethod = async (
|
|
|
27
27
|
const product = await loaders.productLoader.load({ productId });
|
|
28
28
|
|
|
29
29
|
const [token] = await modules.warehousing.findTokens({
|
|
30
|
-
|
|
30
|
+
tokenSerialNumber: (tokenFileName || localeOrTokenFilename).toLowerCase().replace('.json', ''),
|
|
31
31
|
contractAddress: product?.tokenization?.contractAddress,
|
|
32
32
|
});
|
|
33
33
|
|
|
@@ -39,15 +39,12 @@ const ercMetadataHandler: RouteHandlerMethod = async (
|
|
|
39
39
|
|
|
40
40
|
if (!ercMetadata) return notFoundHandler(res);
|
|
41
41
|
|
|
42
|
-
const body = JSON.stringify(ercMetadata);
|
|
43
42
|
res.status(200);
|
|
44
|
-
res.
|
|
45
|
-
res.header('Content-Type', 'application/json');
|
|
46
|
-
return res.send(body);
|
|
43
|
+
return res.send(ercMetadata);
|
|
47
44
|
} catch (e) {
|
|
48
|
-
logger.error(e
|
|
45
|
+
logger.error(e);
|
|
49
46
|
res.status(503);
|
|
50
|
-
return res.send(
|
|
47
|
+
return res.send({ name: e.name, code: e.code, message: e.message });
|
|
51
48
|
}
|
|
52
49
|
};
|
|
53
50
|
|
package/src/fastify/index.ts
CHANGED
|
@@ -11,10 +11,12 @@ import { User } from '@unchainedshop/core-users';
|
|
|
11
11
|
import fastifySession from '@fastify/session';
|
|
12
12
|
import fastifyCookie from '@fastify/cookie';
|
|
13
13
|
import fastifyMultipart from '@fastify/multipart';
|
|
14
|
-
import { FastifyBaseLogger, FastifyInstance, FastifyRequest } from 'fastify';
|
|
14
|
+
import { FastifyBaseLogger, FastifyInstance, FastifyPluginAsync, FastifyRequest } from 'fastify';
|
|
15
15
|
import { createLogger } from '@unchainedshop/logger';
|
|
16
16
|
import mcpHandler from './mcpHandler.js';
|
|
17
17
|
import tempUploadHandler from './tempUploadHandler.js';
|
|
18
|
+
import fastifyStatic from '@fastify/static';
|
|
19
|
+
export * from './chatHandler.js';
|
|
18
20
|
|
|
19
21
|
const resolveUserRemoteAddress = (req: FastifyRequest) => {
|
|
20
22
|
const remoteAddress =
|
|
@@ -36,7 +38,7 @@ const {
|
|
|
36
38
|
UNCHAINED_COOKIE_NAME = 'unchained_token',
|
|
37
39
|
UNCHAINED_COOKIE_PATH = '/',
|
|
38
40
|
UNCHAINED_COOKIE_DOMAIN,
|
|
39
|
-
UNCHAINED_COOKIE_SAMESITE,
|
|
41
|
+
UNCHAINED_COOKIE_SAMESITE = 'none',
|
|
40
42
|
UNCHAINED_COOKIE_INSECURE,
|
|
41
43
|
} = process.env;
|
|
42
44
|
|
|
@@ -158,7 +160,7 @@ export const connect = (
|
|
|
158
160
|
if (!fastify.hasPlugin('@fastify/cookie')) {
|
|
159
161
|
fastify.register(fastifyCookie);
|
|
160
162
|
}
|
|
161
|
-
fastify.register(fastifySession, {
|
|
163
|
+
fastify.register(fastifySession as any, {
|
|
162
164
|
secret: process.env.UNCHAINED_TOKEN_SECRET,
|
|
163
165
|
cookieName,
|
|
164
166
|
store: MongoStore.create({
|
|
@@ -234,3 +236,37 @@ export const connect = (
|
|
|
234
236
|
registered();
|
|
235
237
|
});
|
|
236
238
|
};
|
|
239
|
+
|
|
240
|
+
interface FastifyRouterOptions {
|
|
241
|
+
prefix?: string;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export const fastifyRouter: FastifyPluginAsync<FastifyRouterOptions> = async (
|
|
245
|
+
fastify: FastifyInstance,
|
|
246
|
+
opts,
|
|
247
|
+
) => {
|
|
248
|
+
try {
|
|
249
|
+
const staticURL = import.meta.resolve('@unchainedshop/admin-ui');
|
|
250
|
+
const staticPath = new URL(staticURL).pathname.split('/').slice(0, -1).join('/');
|
|
251
|
+
|
|
252
|
+
await fastify.register(fastifyStatic, {
|
|
253
|
+
root: staticPath,
|
|
254
|
+
prefix: opts.prefix || '/',
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
fastify.setNotFoundHandler((request, reply) => {
|
|
258
|
+
if (request.raw.method === 'GET') {
|
|
259
|
+
return reply.type('text/html').sendFile('index.html');
|
|
260
|
+
} else {
|
|
261
|
+
return reply.status(404).send();
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
} catch {
|
|
265
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
266
|
+
// Trying the default admin ui dev port
|
|
267
|
+
fastify.get('/', async (request, reply) => {
|
|
268
|
+
return reply.redirect('http://localhost:3000');
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
};
|
|
@@ -85,8 +85,8 @@ const mcpHandler: RouteHandlerMethod = async (
|
|
|
85
85
|
|
|
86
86
|
return res.status(405).send('Method Not Allowed');
|
|
87
87
|
} catch (e) {
|
|
88
|
-
logger.error(e
|
|
89
|
-
return res.status(503).send(
|
|
88
|
+
logger.error(e);
|
|
89
|
+
return res.status(503).send({ name: e.name, code: e.code, message: e.message });
|
|
90
90
|
}
|
|
91
91
|
};
|
|
92
92
|
|