@unchainedshop/api 3.1.13 → 4.0.0-rc.3
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.map +1 -1
- package/lib/api-index.js +4 -1
- package/lib/api-index.js.map +1 -1
- package/lib/context.d.ts +2 -2
- package/lib/context.d.ts.map +1 -1
- package/lib/context.js +1 -1
- package/lib/context.js.map +1 -1
- package/lib/createGraphQLServer.d.ts +2 -2
- package/lib/createGraphQLServer.d.ts.map +1 -1
- package/lib/errors.d.ts +2 -1
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +2 -1
- package/lib/errors.js.map +1 -1
- package/lib/express/createBulkImportMiddleware copy.d.ts +6 -0
- package/lib/express/createBulkImportMiddleware copy.d.ts.map +1 -0
- package/lib/express/createBulkImportMiddleware copy.js +49 -0
- package/lib/express/createBulkImportMiddleware copy.js.map +1 -0
- package/lib/express/createERCMetadataMiddleware.d.ts.map +1 -1
- package/lib/express/createERCMetadataMiddleware.js +9 -5
- package/lib/express/createERCMetadataMiddleware.js.map +1 -1
- package/lib/express/createMCPMiddleware.d.ts.map +1 -1
- package/lib/express/createMCPMiddleware.js +12 -3
- package/lib/express/createMCPMiddleware.js.map +1 -1
- package/lib/express/createTempUploadMiddleware.d.ts +7 -0
- package/lib/express/createTempUploadMiddleware.d.ts.map +1 -0
- package/lib/express/createTempUploadMiddleware.js +48 -0
- package/lib/express/createTempUploadMiddleware.js.map +1 -0
- package/lib/express/index.d.ts.map +1 -1
- package/lib/express/index.js +17 -6
- package/lib/express/index.js.map +1 -1
- package/lib/express/setupMCPChatHandler.d.ts +3 -0
- package/lib/express/setupMCPChatHandler.d.ts.map +1 -0
- package/lib/express/setupMCPChatHandler.js +57 -0
- package/lib/express/setupMCPChatHandler.js.map +1 -0
- package/lib/fastify/ercMetadataHandler.d.ts.map +1 -1
- package/lib/fastify/ercMetadataHandler.js +9 -5
- package/lib/fastify/ercMetadataHandler.js.map +1 -1
- package/lib/fastify/index.d.ts.map +1 -1
- package/lib/fastify/index.js +24 -5
- package/lib/fastify/index.js.map +1 -1
- package/lib/fastify/mcpChatHandler.d.ts +3 -0
- package/lib/fastify/mcpChatHandler.d.ts.map +1 -0
- package/lib/fastify/mcpChatHandler.js +60 -0
- package/lib/fastify/mcpChatHandler.js.map +1 -0
- package/lib/fastify/mcpHandler copy.d.ts +4 -0
- package/lib/fastify/mcpHandler copy.d.ts.map +1 -0
- package/lib/fastify/mcpHandler copy.js +72 -0
- package/lib/fastify/mcpHandler copy.js.map +1 -0
- package/lib/fastify/mcpHandler.d.ts +4 -0
- package/lib/fastify/mcpHandler.d.ts.map +1 -0
- package/lib/fastify/mcpHandler.js +78 -0
- package/lib/fastify/mcpHandler.js.map +1 -0
- package/lib/fastify/tempUploadHandler.d.ts +4 -0
- package/lib/fastify/tempUploadHandler.d.ts.map +1 -0
- package/lib/fastify/tempUploadHandler.js +41 -0
- package/lib/fastify/tempUploadHandler.js.map +1 -0
- package/lib/loaders/buildLocaleMap.d.ts +4 -4
- package/lib/loaders/buildLocaleMap.d.ts.map +1 -1
- package/lib/loaders/buildLocaleMap.js +34 -5
- package/lib/loaders/buildLocaleMap.js.map +1 -1
- package/lib/loaders/buildTextMap.d.ts +2 -2
- package/lib/loaders/buildTextMap.d.ts.map +1 -1
- package/lib/loaders/buildTextMap.js +3 -0
- package/lib/loaders/buildTextMap.js.map +1 -1
- package/lib/loaders/index.d.ts +79 -49
- package/lib/loaders/index.d.ts.map +1 -1
- package/lib/loaders/index.js +47 -240
- package/lib/loaders/index.js.map +1 -1
- package/lib/locale-context.d.ts +3 -3
- package/lib/locale-context.d.ts.map +1 -1
- package/lib/locale-context.js +9 -10
- package/lib/locale-context.js.map +1 -1
- package/lib/mcp/index.d.ts +1 -1
- package/lib/mcp/index.d.ts.map +1 -1
- package/lib/mcp/index.js +38 -2
- package/lib/mcp/index.js.map +1 -1
- package/lib/mcp/tools/addProductAssignmentHandler.js.map +1 -1
- package/lib/mcp/tools/addProductMediaUploadHandler.d.ts +28 -0
- package/lib/mcp/tools/addProductMediaUploadHandler.d.ts.map +1 -0
- package/lib/mcp/tools/addProductMediaUploadHandler.js +62 -0
- package/lib/mcp/tools/addProductMediaUploadHandler.js.map +1 -0
- package/lib/mcp/tools/createLanguageHandler.d.ts +36 -0
- package/lib/mcp/tools/createLanguageHandler.d.ts.map +1 -0
- package/lib/mcp/tools/createLanguageHandler.js +39 -0
- package/lib/mcp/tools/createLanguageHandler.js.map +1 -0
- package/lib/mcp/tools/createProductVariationHandler.d.ts +2 -2
- package/lib/mcp/tools/createProductVariationHandler.d.ts.map +1 -1
- package/lib/mcp/tools/createProductVariationHandler.js +10 -4
- package/lib/mcp/tools/createProductVariationHandler.js.map +1 -1
- package/lib/mcp/tools/createProductVariationOptionHandler.d.ts +60 -0
- package/lib/mcp/tools/createProductVariationOptionHandler.d.ts.map +1 -0
- package/lib/mcp/tools/createProductVariationOptionHandler.js +59 -0
- package/lib/mcp/tools/createProductVariationOptionHandler.js.map +1 -0
- package/lib/mcp/tools/getProduct.d.ts.map +1 -1
- package/lib/mcp/tools/getProduct.js +2 -45
- package/lib/mcp/tools/getProduct.js.map +1 -1
- package/lib/mcp/tools/index.d.ts +33 -0
- package/lib/mcp/tools/index.d.ts.map +1 -1
- package/lib/mcp/tools/index.js +33 -0
- package/lib/mcp/tools/index.js.map +1 -1
- package/lib/mcp/tools/listProducts.d.ts.map +1 -1
- package/lib/mcp/tools/listProducts.js +29 -17
- package/lib/mcp/tools/listProducts.js.map +1 -1
- package/lib/mcp/tools/productReviewsCountHandler.d.ts +20 -0
- package/lib/mcp/tools/productReviewsCountHandler.d.ts.map +1 -0
- package/lib/mcp/tools/productReviewsCountHandler.js +30 -0
- package/lib/mcp/tools/productReviewsCountHandler.js.map +1 -0
- package/lib/mcp/tools/productReviewsHandler.d.ts +56 -0
- package/lib/mcp/tools/productReviewsHandler.d.ts.map +1 -0
- package/lib/mcp/tools/productReviewsHandler.js +45 -0
- package/lib/mcp/tools/productReviewsHandler.js.map +1 -0
- package/lib/mcp/tools/removeLanguageHandler.d.ts +20 -0
- package/lib/mcp/tools/removeLanguageHandler.d.ts.map +1 -0
- package/lib/mcp/tools/removeLanguageHandler.js +35 -0
- package/lib/mcp/tools/removeLanguageHandler.js.map +1 -0
- package/lib/mcp/tools/removeProductAssignmentHandler.d.ts +48 -0
- package/lib/mcp/tools/removeProductAssignmentHandler.d.ts.map +1 -0
- package/lib/mcp/tools/removeProductAssignmentHandler.js +51 -0
- package/lib/mcp/tools/removeProductAssignmentHandler.js.map +1 -0
- package/lib/mcp/tools/removeProductHandler.d.ts +20 -0
- package/lib/mcp/tools/removeProductHandler.d.ts.map +1 -0
- package/lib/mcp/tools/removeProductHandler.js +34 -0
- package/lib/mcp/tools/removeProductHandler.js.map +1 -0
- package/lib/mcp/tools/removeProductMediaHandler.d.ts +20 -0
- package/lib/mcp/tools/removeProductMediaHandler.d.ts.map +1 -0
- package/lib/mcp/tools/removeProductMediaHandler.js +42 -0
- package/lib/mcp/tools/removeProductMediaHandler.js.map +1 -0
- package/lib/mcp/tools/removeProductVariationOptionHandler.d.ts +24 -0
- package/lib/mcp/tools/removeProductVariationOptionHandler.d.ts.map +1 -0
- package/lib/mcp/tools/removeProductVariationOptionHandler.js +47 -0
- package/lib/mcp/tools/removeProductVariationOptionHandler.js.map +1 -0
- package/lib/mcp/tools/reorderProductMediaHandler.d.ts +44 -0
- package/lib/mcp/tools/reorderProductMediaHandler.d.ts.map +1 -0
- package/lib/mcp/tools/reorderProductMediaHandler.js +39 -0
- package/lib/mcp/tools/reorderProductMediaHandler.js.map +1 -0
- package/lib/mcp/tools/updateLanguageHandler.d.ts +48 -0
- package/lib/mcp/tools/updateLanguageHandler.d.ts.map +1 -0
- package/lib/mcp/tools/updateLanguageHandler.js +40 -0
- package/lib/mcp/tools/updateLanguageHandler.js.map +1 -0
- package/lib/mcp/tools/updateProductMediaTextsHandler.d.ts +56 -0
- package/lib/mcp/tools/updateProductMediaTextsHandler.d.ts.map +1 -0
- package/lib/mcp/tools/updateProductMediaTextsHandler.js +45 -0
- package/lib/mcp/tools/updateProductMediaTextsHandler.js.map +1 -0
- package/lib/mcp/utils/getNormalizedProductDetails.d.ts.map +1 -1
- package/lib/mcp/utils/getNormalizedProductDetails.js +2 -0
- package/lib/mcp/utils/getNormalizedProductDetails.js.map +1 -1
- package/lib/resolvers/mutations/accounts/createUser.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/createUser.js +4 -5
- package/lib/resolvers/mutations/accounts/createUser.js.map +1 -1
- package/lib/resolvers/mutations/accounts/impersonate.js +1 -1
- package/lib/resolvers/mutations/accounts/impersonate.js.map +1 -1
- package/lib/resolvers/mutations/accounts/loginAsGuest.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/loginAsGuest.js +4 -5
- package/lib/resolvers/mutations/accounts/loginAsGuest.js.map +1 -1
- package/lib/resolvers/mutations/accounts/loginWithPassword.js +3 -3
- package/lib/resolvers/mutations/accounts/loginWithPassword.js.map +1 -1
- package/lib/resolvers/mutations/accounts/loginWithWebAuthn.js +3 -3
- package/lib/resolvers/mutations/accounts/loginWithWebAuthn.js.map +1 -1
- package/lib/resolvers/mutations/accounts/resetPassword.js +3 -3
- package/lib/resolvers/mutations/accounts/resetPassword.js.map +1 -1
- package/lib/resolvers/mutations/accounts/stopImpersonation.js +1 -1
- package/lib/resolvers/mutations/accounts/stopImpersonation.js.map +1 -1
- package/lib/resolvers/mutations/accounts/verifyEmail.js +3 -3
- package/lib/resolvers/mutations/accounts/verifyEmail.js.map +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentFilters.d.ts +2 -2
- package/lib/resolvers/mutations/assortments/reorderAssortmentFilters.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentFilters.js.map +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentLinks.d.ts +2 -2
- package/lib/resolvers/mutations/assortments/reorderAssortmentLinks.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentLinks.js.map +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentMedia.d.ts +2 -2
- package/lib/resolvers/mutations/assortments/reorderAssortmentMedia.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentMedia.js.map +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentProducts.d.ts +2 -2
- package/lib/resolvers/mutations/assortments/reorderAssortmentProducts.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentProducts.js.map +1 -1
- package/lib/resolvers/mutations/assortments/updateAssortmentMediaTexts.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/updateAssortmentMediaTexts.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/updateAssortmentMediaTexts.js.map +1 -1
- package/lib/resolvers/mutations/assortments/updateAssortmentTexts.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/updateAssortmentTexts.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/updateAssortmentTexts.js.map +1 -1
- package/lib/resolvers/mutations/enrollments/createEnrollment.js +3 -3
- package/lib/resolvers/mutations/enrollments/createEnrollment.js.map +1 -1
- package/lib/resolvers/mutations/enrollments/updateEnrollment.d.ts +2 -2
- package/lib/resolvers/mutations/enrollments/updateEnrollment.d.ts.map +1 -1
- package/lib/resolvers/mutations/filters/createFilter.d.ts.map +1 -1
- package/lib/resolvers/mutations/filters/createFilter.js +2 -6
- package/lib/resolvers/mutations/filters/createFilter.js.map +1 -1
- package/lib/resolvers/mutations/filters/updateFilterTexts.d.ts +2 -2
- package/lib/resolvers/mutations/filters/updateFilterTexts.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.js +1 -1
- package/lib/resolvers/mutations/orders/addCartProduct.js.map +1 -1
- package/lib/resolvers/mutations/orders/addCartQuotation.d.ts +2 -2
- package/lib/resolvers/mutations/orders/addCartQuotation.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/addCartQuotation.js +1 -1
- package/lib/resolvers/mutations/orders/addCartQuotation.js.map +1 -1
- package/lib/resolvers/mutations/orders/addMultipleCartProducts.d.ts +4 -4
- 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.js +1 -1
- package/lib/resolvers/mutations/orders/checkoutCart.js.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/emptyCart.js +1 -1
- package/lib/resolvers/mutations/orders/emptyCart.js.map +1 -1
- package/lib/resolvers/mutations/orders/signPaymentProviderForCheckout.js +1 -1
- package/lib/resolvers/mutations/orders/signPaymentProviderForCheckout.js.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/updateCartItem.d.ts +2 -2
- package/lib/resolvers/mutations/orders/updateCartItem.d.ts.map +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 +35 -2
- package/lib/resolvers/mutations/products/addProductAssignment.js.map +1 -1
- package/lib/resolvers/mutations/products/createProductVariation.d.ts +2 -2
- package/lib/resolvers/mutations/products/createProductVariation.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/createProductVariation.js.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/removeProductAssignment.js.map +1 -1
- package/lib/resolvers/mutations/products/reorderProductMedia.d.ts +2 -2
- package/lib/resolvers/mutations/products/reorderProductMedia.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/reorderProductMedia.js.map +1 -1
- package/lib/resolvers/mutations/products/updateProductMediaTexts.d.ts +1 -1
- package/lib/resolvers/mutations/products/updateProductMediaTexts.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/updateProductMediaTexts.js.map +1 -1
- package/lib/resolvers/mutations/products/updateProductVariationTexts.d.ts +1 -1
- package/lib/resolvers/mutations/products/updateProductVariationTexts.d.ts.map +1 -1
- package/lib/resolvers/mutations/quotations/requestQuotation.d.ts +2 -2
- package/lib/resolvers/mutations/quotations/requestQuotation.d.ts.map +1 -1
- package/lib/resolvers/mutations/quotations/requestQuotation.js +3 -3
- package/lib/resolvers/mutations/quotations/requestQuotation.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/heartbeat.js +3 -3
- package/lib/resolvers/mutations/users/heartbeat.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/setRoles.js.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/setUserTags.js.map +1 -1
- package/lib/resolvers/mutations/warehousing/invalidateToken.js +1 -3
- package/lib/resolvers/mutations/warehousing/invalidateToken.js.map +1 -1
- package/lib/resolvers/mutations/worker/allocateWork.d.ts +1 -1
- package/lib/resolvers/mutations/worker/allocateWork.d.ts.map +1 -1
- package/lib/resolvers/mutations/worker/allocateWork.js.map +1 -1
- package/lib/resolvers/queries/assortments/assortments.d.ts +1 -1
- package/lib/resolvers/queries/assortments/assortments.d.ts.map +1 -1
- package/lib/resolvers/queries/countries/countries.d.ts +1 -1
- package/lib/resolvers/queries/countries/countries.d.ts.map +1 -1
- package/lib/resolvers/queries/countries/countries.js.map +1 -1
- package/lib/resolvers/queries/currencies/currencies.d.ts +1 -1
- package/lib/resolvers/queries/currencies/currencies.d.ts.map +1 -1
- package/lib/resolvers/queries/currencies/currencies.js.map +1 -1
- package/lib/resolvers/queries/enrollments/enrollments.d.ts +1 -1
- package/lib/resolvers/queries/enrollments/enrollments.d.ts.map +1 -1
- package/lib/resolvers/queries/filters/filters.d.ts +1 -1
- package/lib/resolvers/queries/filters/filters.d.ts.map +1 -1
- package/lib/resolvers/queries/filters/searchAssortments.d.ts.map +1 -1
- package/lib/resolvers/queries/filters/searchAssortments.js +2 -7
- package/lib/resolvers/queries/filters/searchAssortments.js.map +1 -1
- package/lib/resolvers/queries/filters/searchProducts.d.ts.map +1 -1
- package/lib/resolvers/queries/filters/searchProducts.js +3 -8
- package/lib/resolvers/queries/filters/searchProducts.js.map +1 -1
- package/lib/resolvers/queries/languages/languages.d.ts +1 -1
- package/lib/resolvers/queries/languages/languages.d.ts.map +1 -1
- package/lib/resolvers/queries/languages/languages.js.map +1 -1
- package/lib/resolvers/queries/orders/orders.d.ts +1 -1
- package/lib/resolvers/queries/orders/orders.d.ts.map +1 -1
- package/lib/resolvers/queries/orders/orders.js.map +1 -1
- package/lib/resolvers/queries/products/productReviews.d.ts +1 -1
- package/lib/resolvers/queries/products/productReviews.d.ts.map +1 -1
- package/lib/resolvers/queries/products/products.d.ts +1 -1
- package/lib/resolvers/queries/products/products.d.ts.map +1 -1
- package/lib/resolvers/queries/quotations/quotations.d.ts +1 -1
- package/lib/resolvers/queries/quotations/quotations.d.ts.map +1 -1
- package/lib/resolvers/queries/quotations/quotations.js.map +1 -1
- package/lib/resolvers/queries/users/impersonator.d.ts.map +1 -1
- package/lib/resolvers/queries/users/impersonator.js +1 -1
- package/lib/resolvers/queries/users/impersonator.js.map +1 -1
- package/lib/resolvers/queries/users/user.d.ts.map +1 -1
- package/lib/resolvers/queries/users/user.js.map +1 -1
- package/lib/resolvers/queries/users/users.d.ts +1 -1
- package/lib/resolvers/queries/users/users.d.ts.map +1 -1
- package/lib/resolvers/queries/worker/workQueue.d.ts +3 -3
- package/lib/resolvers/queries/worker/workQueue.d.ts.map +1 -1
- package/lib/resolvers/type/assortment/assortment-filter-types.d.ts +4 -8
- package/lib/resolvers/type/assortment/assortment-filter-types.d.ts.map +1 -1
- package/lib/resolvers/type/assortment/assortment-filter-types.js +4 -6
- package/lib/resolvers/type/assortment/assortment-filter-types.js.map +1 -1
- package/lib/resolvers/type/assortment/assortment-link-types.d.ts +2 -2
- package/lib/resolvers/type/assortment/assortment-link-types.d.ts.map +1 -1
- package/lib/resolvers/type/assortment/assortment-media-types.js +2 -2
- package/lib/resolvers/type/assortment/assortment-media-types.js.map +1 -1
- package/lib/resolvers/type/assortment/assortment-path-link-types.d.ts +2 -2
- package/lib/resolvers/type/assortment/assortment-path-link-types.d.ts.map +1 -1
- package/lib/resolvers/type/assortment/assortment-path-link-types.js +2 -2
- package/lib/resolvers/type/assortment/assortment-path-link-types.js.map +1 -1
- package/lib/resolvers/type/assortment/assortment-product-types.d.ts +2 -2
- package/lib/resolvers/type/assortment/assortment-product-types.d.ts.map +1 -1
- package/lib/resolvers/type/assortment/assortment-types.d.ts +2 -2
- package/lib/resolvers/type/assortment/assortment-types.d.ts.map +1 -1
- package/lib/resolvers/type/assortment/assortment-types.js +5 -5
- package/lib/resolvers/type/assortment/assortment-types.js.map +1 -1
- package/lib/resolvers/type/bookmark-types.d.ts.map +1 -1
- package/lib/resolvers/type/bookmark-types.js +2 -3
- package/lib/resolvers/type/bookmark-types.js.map +1 -1
- package/lib/resolvers/type/country-types.d.ts +1 -1
- package/lib/resolvers/type/country-types.d.ts.map +1 -1
- package/lib/resolvers/type/country-types.js +4 -7
- package/lib/resolvers/type/country-types.js.map +1 -1
- package/lib/resolvers/type/delivery-provider-types.d.ts +10 -13
- package/lib/resolvers/type/delivery-provider-types.d.ts.map +1 -1
- package/lib/resolvers/type/delivery-provider-types.js +8 -9
- package/lib/resolvers/type/delivery-provider-types.js.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-delivery-types.d.ts +2 -6
- package/lib/resolvers/type/enrollment/enrollment-delivery-types.d.ts.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-delivery-types.js +4 -3
- package/lib/resolvers/type/enrollment/enrollment-delivery-types.js.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-payment-types.d.ts +2 -6
- package/lib/resolvers/type/enrollment/enrollment-payment-types.d.ts.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-payment-types.js +2 -3
- package/lib/resolvers/type/enrollment/enrollment-payment-types.js.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-period-types.d.ts +2 -6
- package/lib/resolvers/type/enrollment/enrollment-period-types.d.ts.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-period-types.js +2 -3
- package/lib/resolvers/type/enrollment/enrollment-period-types.js.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-plan-tyes.d.ts +2 -6
- package/lib/resolvers/type/enrollment/enrollment-plan-tyes.d.ts.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-plan-tyes.js +2 -3
- package/lib/resolvers/type/enrollment/enrollment-plan-tyes.js.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-types.d.ts +15 -14
- package/lib/resolvers/type/enrollment/enrollment-types.d.ts.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-types.js +3 -6
- package/lib/resolvers/type/enrollment/enrollment-types.js.map +1 -1
- package/lib/resolvers/type/filter/filter-option-types.d.ts +6 -9
- package/lib/resolvers/type/filter/filter-option-types.d.ts.map +1 -1
- package/lib/resolvers/type/filter/filter-option-types.js +2 -3
- package/lib/resolvers/type/filter/filter-option-types.js.map +1 -1
- package/lib/resolvers/type/filter/filter-types.d.ts +16 -8
- package/lib/resolvers/type/filter/filter-types.d.ts.map +1 -1
- package/lib/resolvers/type/filter/filter-types.js +2 -3
- package/lib/resolvers/type/filter/filter-types.js.map +1 -1
- package/lib/resolvers/type/filter/loaded-filter-types.d.ts +2 -3
- package/lib/resolvers/type/filter/loaded-filter-types.d.ts.map +1 -1
- package/lib/resolvers/type/index.d.ts +273 -261
- package/lib/resolvers/type/index.d.ts.map +1 -1
- package/lib/resolvers/type/login-method-response-types.js +1 -1
- package/lib/resolvers/type/login-method-response-types.js.map +1 -1
- package/lib/resolvers/type/order/order-delivery-discount-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-delivery-discount-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-delivery-discount-types.js +1 -2
- package/lib/resolvers/type/order/order-delivery-discount-types.js.map +1 -1
- package/lib/resolvers/type/order/order-delivery-pickup-types.d.ts +13 -12
- package/lib/resolvers/type/order/order-delivery-pickup-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-delivery-pickup-types.js +10 -14
- package/lib/resolvers/type/order/order-delivery-pickup-types.js.map +1 -1
- package/lib/resolvers/type/order/order-delivery-shipping-types.d.ts +12 -12
- package/lib/resolvers/type/order/order-delivery-shipping-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-delivery-shipping-types.js +7 -10
- package/lib/resolvers/type/order/order-delivery-shipping-types.js.map +1 -1
- package/lib/resolvers/type/order/order-delivery-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-delivery-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-delivery-types.js +2 -3
- package/lib/resolvers/type/order/order-delivery-types.js.map +1 -1
- package/lib/resolvers/type/order/order-discount-types.d.ts +11 -13
- package/lib/resolvers/type/order/order-discount-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-discount-types.js +9 -16
- package/lib/resolvers/type/order/order-discount-types.js.map +1 -1
- package/lib/resolvers/type/order/order-global-discount-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-global-discount-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-global-discount-types.js +1 -2
- package/lib/resolvers/type/order/order-global-discount-types.js.map +1 -1
- package/lib/resolvers/type/order/order-item-discount-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-item-discount-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-item-discount-types.js +1 -2
- package/lib/resolvers/type/order/order-item-discount-types.js.map +1 -1
- package/lib/resolvers/type/order/order-item-types.d.ts +5 -5
- package/lib/resolvers/type/order/order-item-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-item-types.js +14 -17
- package/lib/resolvers/type/order/order-item-types.js.map +1 -1
- package/lib/resolvers/type/order/order-payment-card-types.d.ts +11 -10
- package/lib/resolvers/type/order/order-payment-card-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-payment-card-types.js +6 -9
- package/lib/resolvers/type/order/order-payment-card-types.js.map +1 -1
- package/lib/resolvers/type/order/order-payment-discount-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-payment-discount-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-payment-discount-types.js +2 -4
- package/lib/resolvers/type/order/order-payment-discount-types.js.map +1 -1
- package/lib/resolvers/type/order/order-payment-generic-types.d.ts +11 -10
- package/lib/resolvers/type/order/order-payment-generic-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-payment-generic-types.js +6 -9
- package/lib/resolvers/type/order/order-payment-generic-types.js.map +1 -1
- package/lib/resolvers/type/order/order-payment-invoice-types.d.ts +11 -10
- package/lib/resolvers/type/order/order-payment-invoice-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-payment-invoice-types.js +6 -9
- package/lib/resolvers/type/order/order-payment-invoice-types.js.map +1 -1
- package/lib/resolvers/type/order/order-payment-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-payment-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-payment-types.js +2 -3
- package/lib/resolvers/type/order/order-payment-types.js.map +1 -1
- package/lib/resolvers/type/order/order-types.d.ts +6 -6
- package/lib/resolvers/type/order/order-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-types.js +7 -15
- package/lib/resolvers/type/order/order-types.js.map +1 -1
- package/lib/resolvers/type/payment/payment-credentials-types.d.ts.map +1 -1
- package/lib/resolvers/type/payment/payment-credentials-types.js +6 -9
- package/lib/resolvers/type/payment/payment-credentials-types.js.map +1 -1
- package/lib/resolvers/type/payment/payment-provider-types.d.ts +2 -2
- package/lib/resolvers/type/payment/payment-provider-types.d.ts.map +1 -1
- package/lib/resolvers/type/payment/payment-provider-types.js +8 -9
- package/lib/resolvers/type/payment/payment-provider-types.js.map +1 -1
- package/lib/resolvers/type/price-types.d.ts +3 -4
- package/lib/resolvers/type/price-types.d.ts.map +1 -1
- package/lib/resolvers/type/price-types.js +2 -2
- package/lib/resolvers/type/price-types.js.map +1 -1
- package/lib/resolvers/type/product/product-assortment-path-types.d.ts +1 -1
- package/lib/resolvers/type/product/product-assortment-path-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-bundle-types.d.ts +10 -10
- package/lib/resolvers/type/product/product-bundle-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-catalog-price-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-catalog-price-types.js +4 -6
- package/lib/resolvers/type/product/product-catalog-price-types.js.map +1 -1
- package/lib/resolvers/type/product/product-configurable-types.d.ts +20 -20
- package/lib/resolvers/type/product/product-configurable-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-configurable-types.js +10 -12
- package/lib/resolvers/type/product/product-configurable-types.js.map +1 -1
- package/lib/resolvers/type/product/product-discount.d.ts +1 -1
- 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-media-types.js +2 -2
- package/lib/resolvers/type/product/product-media-types.js.map +1 -1
- package/lib/resolvers/type/product/product-plan-types.d.ts +18 -18
- package/lib/resolvers/type/product/product-plan-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-plan-types.js +16 -16
- package/lib/resolvers/type/product/product-plan-types.js.map +1 -1
- package/lib/resolvers/type/product/product-review-types.d.ts +1 -1
- package/lib/resolvers/type/product/product-review-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-review-types.js +2 -3
- package/lib/resolvers/type/product/product-review-types.js.map +1 -1
- package/lib/resolvers/type/product/product-simple-types.d.ts +22 -22
- package/lib/resolvers/type/product/product-simple-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-simple-types.js +3 -11
- package/lib/resolvers/type/product/product-simple-types.js.map +1 -1
- package/lib/resolvers/type/product/product-tokenized-types.d.ts +20 -20
- package/lib/resolvers/type/product/product-tokenized-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-tokenized-types.js +1 -5
- package/lib/resolvers/type/product/product-tokenized-types.js.map +1 -1
- package/lib/resolvers/type/product/product-types.d.ts +9 -9
- package/lib/resolvers/type/product/product-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-types.js +2 -5
- package/lib/resolvers/type/product/product-types.js.map +1 -1
- package/lib/resolvers/type/product/product-variation-assignment-types.d.ts +2 -2
- package/lib/resolvers/type/product/product-variation-assignment-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-variation-assignment-types.js +1 -1
- package/lib/resolvers/type/product/product-variation-assignment-types.js.map +1 -1
- package/lib/resolvers/type/product/product-variation-assignment-vector.js +2 -2
- package/lib/resolvers/type/product/product-variation-assignment-vector.js.map +1 -1
- package/lib/resolvers/type/product/product-variation-option-types.js +3 -3
- package/lib/resolvers/type/product/product-variation-option-types.js.map +1 -1
- package/lib/resolvers/type/product/product-variation-types.d.ts +2 -2
- package/lib/resolvers/type/product/product-variation-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-variation-types.js +3 -3
- package/lib/resolvers/type/product/product-variation-types.js.map +1 -1
- package/lib/resolvers/type/product-search-result-types.d.ts +5 -6
- package/lib/resolvers/type/product-search-result-types.d.ts.map +1 -1
- package/lib/resolvers/type/quotation-types.d.ts +8 -15
- package/lib/resolvers/type/quotation-types.d.ts.map +1 -1
- package/lib/resolvers/type/quotation-types.js +3 -6
- package/lib/resolvers/type/quotation-types.js.map +1 -1
- package/lib/resolvers/type/shop-types.d.ts +1 -1
- package/lib/resolvers/type/shop-types.d.ts.map +1 -1
- package/lib/resolvers/type/shop-types.js +4 -6
- package/lib/resolvers/type/shop-types.js.map +1 -1
- package/lib/resolvers/type/token-types.d.ts +2 -2
- package/lib/resolvers/type/token-types.d.ts.map +1 -1
- package/lib/resolvers/type/token-types.js +12 -26
- package/lib/resolvers/type/token-types.js.map +1 -1
- package/lib/resolvers/type/user-types.d.ts +22 -22
- package/lib/resolvers/type/user-types.d.ts.map +1 -1
- package/lib/resolvers/type/user-types.js +5 -16
- package/lib/resolvers/type/user-types.js.map +1 -1
- package/lib/resolvers/type/work-types.d.ts.map +1 -1
- package/lib/resolvers/type/work-types.js +0 -1
- package/lib/resolvers/type/work-types.js.map +1 -1
- package/lib/roles/all.js +1 -1
- package/lib/roles/all.js.map +1 -1
- package/lib/roles/index.d.ts.map +1 -1
- package/lib/roles/index.js +1 -0
- package/lib/roles/index.js.map +1 -1
- package/lib/roles/loggedIn.d.ts.map +1 -1
- package/lib/roles/loggedIn.js +1 -0
- package/lib/roles/loggedIn.js.map +1 -1
- package/lib/schema/types/assortment.js +5 -5
- package/lib/schema/types/country.js +1 -1
- package/lib/schema/types/delivery.d.ts.map +1 -1
- package/lib/schema/types/delivery.js +6 -2
- package/lib/schema/types/delivery.js.map +1 -1
- package/lib/schema/types/filter.js +3 -3
- package/lib/schema/types/payment.d.ts.map +1 -1
- package/lib/schema/types/payment.js +6 -2
- package/lib/schema/types/payment.js.map +1 -1
- package/lib/schema/types/price.js +1 -1
- package/lib/schema/types/product/bundle-product.js +1 -1
- package/lib/schema/types/product/configurable-product.js +6 -6
- package/lib/schema/types/product/plan-product.js +5 -5
- package/lib/schema/types/product/product.js +4 -4
- package/lib/schema/types/product/simple-product.js +4 -4
- package/lib/schema/types/product/tokenized-product.js +5 -5
- package/lib/schema/types/warehousing.js +1 -1
- package/package.json +32 -16
- package/src/api-index.ts +4 -1
- package/src/context.ts +3 -3
- package/src/createGraphQLServer.ts +2 -2
- package/src/errors.ts +10 -4
- package/src/express/createERCMetadataMiddleware.ts +11 -5
- package/src/express/createMCPMiddleware.ts +91 -0
- package/src/express/createTempUploadMiddleware.ts +60 -0
- package/src/express/index.ts +37 -9
- package/src/fastify/ercMetadataHandler.ts +11 -5
- package/src/fastify/index.ts +34 -5
- package/src/fastify/mcpHandler.ts +97 -0
- package/src/fastify/tempUploadHandler.ts +52 -0
- package/src/loaders/assortmentLinkLoader.ts +32 -0
- package/src/loaders/assortmentLinksLoader.ts +46 -0
- package/src/loaders/assortmentLoader.ts +20 -0
- package/src/loaders/assortmentMediaTextLoader.ts +26 -0
- package/src/loaders/assortmentMediasLoader.ts +21 -0
- package/src/loaders/assortmentProductLoader.ts +19 -0
- package/src/loaders/assortmentProductsLoader.ts +22 -0
- package/src/loaders/assortmentTextLoader.ts +24 -0
- package/src/loaders/buildLocaleMap.test.ts +9 -5
- package/src/loaders/buildLocaleMap.ts +43 -9
- package/src/loaders/buildTextMap.ts +4 -1
- package/src/loaders/countryLoader.ts +20 -0
- package/src/loaders/currencyLoader.ts +20 -0
- package/src/loaders/deliveryProviderLoader.ts +19 -0
- package/src/loaders/fileLoader.ts +19 -0
- package/src/loaders/filterLoader.ts +20 -0
- package/src/loaders/filterTextLoader.ts +26 -0
- package/src/loaders/index.ts +48 -329
- package/src/loaders/languageLoader.ts +20 -0
- package/src/loaders/orderLoader.ts +22 -0
- package/src/loaders/paymentProviderLoader.ts +19 -0
- package/src/loaders/productLoader.ts +22 -0
- package/src/loaders/productLoaderBySKU.ts +22 -0
- package/src/loaders/productMediaTextLoader.ts +24 -0
- package/src/loaders/productMediasLoader.ts +21 -0
- package/src/loaders/productTextLoader.ts +22 -0
- package/src/loaders/userLoader.ts +23 -0
- package/src/loaders/utils.ts +35 -0
- package/src/locale-context.ts +16 -22
- package/src/mcp/README.md +25 -0
- package/src/mcp/index.ts +313 -0
- package/src/mcp/tools/addProductAssignmentHandler.ts +118 -0
- package/src/mcp/tools/addProductMediaUploadHandler.ts +79 -0
- package/src/mcp/tools/countriesHandler.ts +60 -0
- package/src/mcp/tools/countryHandler.ts +40 -0
- package/src/mcp/tools/createLanguageHandler.ts +46 -0
- package/src/mcp/tools/createProduct.ts +75 -0
- package/src/mcp/tools/createProductVariationHandler.ts +93 -0
- package/src/mcp/tools/createProductVariationOptionHandler.ts +73 -0
- package/src/mcp/tools/currenciesHandler.ts +63 -0
- package/src/mcp/tools/currencyHandler.ts +40 -0
- package/src/mcp/tools/getProduct.ts +74 -0
- package/src/mcp/tools/index.ts +39 -0
- package/src/mcp/tools/languageHandler.ts +37 -0
- package/src/mcp/tools/languagesHandler.ts +54 -0
- package/src/mcp/tools/listProducts.ts +148 -0
- package/src/mcp/tools/productReviewsCountHandler.ts +36 -0
- package/src/mcp/tools/productReviewsHandler.ts +54 -0
- package/src/mcp/tools/productsCountHandler.ts +38 -0
- package/src/mcp/tools/publishProduct.ts +45 -0
- package/src/mcp/tools/removeLanguageHandler.ts +42 -0
- package/src/mcp/tools/removeProductAssignmentHandler.ts +61 -0
- package/src/mcp/tools/removeProductHandler.ts +40 -0
- package/src/mcp/tools/removeProductMediaHandler.ts +49 -0
- package/src/mcp/tools/removeProductVariationHandler.ts +51 -0
- package/src/mcp/tools/removeProductVariationOptionHandler.ts +58 -0
- package/src/mcp/tools/reorderProductMediaHandler.ts +48 -0
- package/src/mcp/tools/unPublishProduct.ts +46 -0
- package/src/mcp/tools/updateLanguageHandler.ts +47 -0
- package/src/mcp/tools/updateProduct.ts +51 -0
- package/src/mcp/tools/updateProductCommerceHandler.ts +79 -0
- package/src/mcp/tools/updateProductMediaTextsHandler.ts +56 -0
- package/src/mcp/tools/updateProductPlanHandler.ts +58 -0
- package/src/mcp/tools/updateProductSupplyHandler.ts +59 -0
- package/src/mcp/tools/updateProductTextsHandler.ts +59 -0
- package/src/mcp/tools/updateProductTokenizationHandler.ts +58 -0
- package/src/mcp/tools/updateProductWarehousingHandler.ts +54 -0
- package/src/mcp/utils/getNormalizedProductDetails.ts +42 -0
- package/src/mcp/utils/normalizeMediaUrl.ts +26 -0
- package/src/resolvers/mutations/accounts/createUser.ts +4 -6
- package/src/resolvers/mutations/accounts/impersonate.ts +1 -1
- package/src/resolvers/mutations/accounts/loginAsGuest.ts +4 -6
- package/src/resolvers/mutations/accounts/loginWithPassword.ts +3 -3
- package/src/resolvers/mutations/accounts/loginWithWebAuthn.ts +3 -3
- package/src/resolvers/mutations/accounts/resetPassword.ts +3 -3
- package/src/resolvers/mutations/accounts/stopImpersonation.ts +1 -1
- package/src/resolvers/mutations/accounts/verifyEmail.ts +3 -3
- package/src/resolvers/mutations/assortments/reorderAssortmentFilters.ts +1 -1
- package/src/resolvers/mutations/assortments/reorderAssortmentLinks.ts +1 -1
- package/src/resolvers/mutations/assortments/reorderAssortmentMedia.ts +1 -1
- package/src/resolvers/mutations/assortments/reorderAssortmentProducts.ts +1 -1
- package/src/resolvers/mutations/assortments/updateAssortmentMediaTexts.ts +1 -1
- package/src/resolvers/mutations/assortments/updateAssortmentTexts.ts +1 -1
- package/src/resolvers/mutations/enrollments/createEnrollment.ts +3 -3
- package/src/resolvers/mutations/enrollments/updateEnrollment.ts +2 -2
- package/src/resolvers/mutations/filters/createFilter.ts +2 -6
- package/src/resolvers/mutations/filters/updateFilterTexts.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 +2 -2
- package/src/resolvers/mutations/orders/addMultipleCartProducts.ts +4 -4
- package/src/resolvers/mutations/orders/checkoutCart.ts +1 -1
- package/src/resolvers/mutations/orders/createCart.ts +1 -1
- package/src/resolvers/mutations/orders/emptyCart.ts +1 -1
- package/src/resolvers/mutations/orders/signPaymentProviderForCheckout.ts +1 -1
- package/src/resolvers/mutations/orders/updateCart.ts +1 -1
- package/src/resolvers/mutations/orders/updateCartItem.ts +1 -1
- package/src/resolvers/mutations/products/addProductAssignment.ts +45 -2
- package/src/resolvers/mutations/products/createProductVariation.ts +5 -1
- package/src/resolvers/mutations/products/removeProductAssignment.ts +1 -1
- package/src/resolvers/mutations/products/reorderProductMedia.ts +1 -1
- package/src/resolvers/mutations/products/updateProductMediaTexts.ts +1 -1
- package/src/resolvers/mutations/products/updateProductVariationTexts.ts +1 -1
- package/src/resolvers/mutations/quotations/requestQuotation.ts +4 -4
- package/src/resolvers/mutations/users/heartbeat.ts +3 -3
- package/src/resolvers/mutations/users/setRoles.ts +1 -1
- package/src/resolvers/mutations/users/setUserTags.ts +1 -1
- package/src/resolvers/mutations/warehousing/invalidateToken.ts +3 -3
- package/src/resolvers/mutations/worker/allocateWork.ts +1 -1
- package/src/resolvers/queries/assortments/assortments.ts +1 -1
- package/src/resolvers/queries/countries/countries.ts +1 -1
- package/src/resolvers/queries/currencies/currencies.ts +1 -1
- package/src/resolvers/queries/enrollments/enrollments.ts +1 -1
- package/src/resolvers/queries/filters/filters.ts +1 -1
- package/src/resolvers/queries/filters/searchAssortments.ts +2 -7
- package/src/resolvers/queries/filters/searchProducts.ts +3 -8
- package/src/resolvers/queries/languages/languages.ts +1 -1
- package/src/resolvers/queries/orders/orders.ts +1 -1
- package/src/resolvers/queries/products/productReviews.ts +1 -1
- package/src/resolvers/queries/products/products.ts +1 -1
- package/src/resolvers/queries/quotations/quotations.ts +1 -1
- package/src/resolvers/queries/users/impersonator.ts +2 -1
- package/src/resolvers/queries/users/user.ts +1 -0
- package/src/resolvers/queries/users/users.ts +1 -1
- package/src/resolvers/queries/worker/workQueue.ts +3 -3
- package/src/resolvers/type/assortment/assortment-filter-types.ts +6 -16
- package/src/resolvers/type/assortment/assortment-link-types.ts +2 -2
- package/src/resolvers/type/assortment/assortment-media-types.ts +2 -2
- package/src/resolvers/type/assortment/assortment-path-link-types.ts +3 -3
- package/src/resolvers/type/assortment/assortment-product-types.ts +2 -2
- package/src/resolvers/type/assortment/assortment-types.ts +6 -6
- package/src/resolvers/type/bookmark-types.ts +2 -3
- package/src/resolvers/type/country-types.ts +5 -8
- package/src/resolvers/type/delivery-provider-types.ts +26 -47
- package/src/resolvers/type/enrollment/enrollment-delivery-types.ts +5 -11
- package/src/resolvers/type/enrollment/enrollment-payment-types.ts +3 -11
- package/src/resolvers/type/enrollment/enrollment-period-types.ts +3 -11
- package/src/resolvers/type/enrollment/enrollment-plan-tyes.ts +3 -11
- package/src/resolvers/type/enrollment/enrollment-types.ts +10 -25
- package/src/resolvers/type/filter/filter-option-types.ts +10 -15
- package/src/resolvers/type/filter/filter-types.ts +5 -13
- package/src/resolvers/type/filter/loaded-filter-types.ts +2 -2
- package/src/resolvers/type/login-method-response-types.ts +1 -1
- package/src/resolvers/type/order/order-delivery-discount-types.ts +1 -2
- package/src/resolvers/type/order/order-delivery-pickup-types.ts +12 -28
- package/src/resolvers/type/order/order-delivery-shipping-types.ts +9 -23
- package/src/resolvers/type/order/order-delivery-types.ts +2 -3
- package/src/resolvers/type/order/order-discount-types.ts +12 -39
- package/src/resolvers/type/order/order-global-discount-types.ts +1 -2
- package/src/resolvers/type/order/order-item-discount-types.ts +1 -2
- package/src/resolvers/type/order/order-item-types.ts +19 -27
- package/src/resolvers/type/order/order-payment-card-types.ts +8 -21
- package/src/resolvers/type/order/order-payment-discount-types.ts +1 -2
- package/src/resolvers/type/order/order-payment-generic-types.ts +8 -20
- package/src/resolvers/type/order/order-payment-invoice-types.ts +8 -20
- package/src/resolvers/type/order/order-payment-types.ts +2 -3
- package/src/resolvers/type/order/order-types.ts +10 -22
- package/src/resolvers/type/payment/payment-credentials-types.ts +6 -10
- package/src/resolvers/type/payment/payment-provider-types.ts +9 -10
- package/src/resolvers/type/price-types.ts +4 -4
- package/src/resolvers/type/product/product-assortment-path-types.ts +1 -1
- package/src/resolvers/type/product/product-bundle-types.ts +1 -1
- package/src/resolvers/type/product/product-catalog-price-types.ts +4 -6
- package/src/resolvers/type/product/product-configurable-types.ts +20 -21
- package/src/resolvers/type/product/product-discount.ts +1 -1
- package/src/resolvers/type/product/product-media-types.ts +2 -2
- package/src/resolvers/type/product/product-plan-types.ts +22 -22
- package/src/resolvers/type/product/product-review-types.ts +3 -4
- package/src/resolvers/type/product/product-simple-types.ts +7 -19
- package/src/resolvers/type/product/product-tokenized-types.ts +3 -10
- package/src/resolvers/type/product/product-types.ts +10 -13
- package/src/resolvers/type/product/product-variation-assignment-types.ts +2 -2
- package/src/resolvers/type/product/product-variation-assignment-vector.ts +2 -2
- package/src/resolvers/type/product/product-variation-option-types.ts +3 -3
- package/src/resolvers/type/product/product-variation-types.ts +5 -5
- package/src/resolvers/type/product-search-result-types.ts +5 -5
- package/src/resolvers/type/quotation-types.ts +11 -25
- package/src/resolvers/type/shop-types.ts +5 -7
- package/src/resolvers/type/token-types.ts +15 -32
- package/src/resolvers/type/user-types.ts +27 -39
- package/src/resolvers/type/work-types.ts +0 -2
- package/src/roles/all.ts +1 -1
- package/src/roles/index.ts +1 -0
- package/src/roles/loggedIn.ts +1 -0
- package/src/schema/types/assortment.ts +5 -5
- package/src/schema/types/country.ts +1 -1
- package/src/schema/types/delivery.ts +6 -2
- package/src/schema/types/filter.ts +3 -3
- package/src/schema/types/payment.ts +6 -2
- package/src/schema/types/price.ts +1 -1
- package/src/schema/types/product/bundle-product.ts +1 -1
- package/src/schema/types/product/configurable-product.ts +6 -6
- package/src/schema/types/product/plan-product.ts +5 -5
- package/src/schema/types/product/product.ts +4 -4
- package/src/schema/types/product/simple-product.ts +4 -4
- package/src/schema/types/product/tokenized-product.ts +5 -5
- package/src/schema/types/warehousing.ts +1 -1
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
import { Context } from '../../../context.js';
|
|
2
2
|
import { SearchQuery } from '@unchainedshop/core-filters';
|
|
3
3
|
import { log } from '@unchainedshop/logger';
|
|
4
|
-
import { QueryStringRequiredError } from '../../../errors.js';
|
|
5
4
|
|
|
6
5
|
export default async function searchAssortments(root: never, query: SearchQuery, context: Context) {
|
|
7
|
-
const { services, userId,
|
|
8
|
-
const forceLiveCollection = false;
|
|
6
|
+
const { services, userId, locale } = context;
|
|
9
7
|
|
|
10
8
|
log(`query search assortments ${JSON.stringify(query)}`, { userId });
|
|
11
9
|
|
|
12
|
-
if (!query.queryString && !query.assortmentIds?.length) throw new QueryStringRequiredError({});
|
|
13
|
-
|
|
14
10
|
return services.filters.searchAssortments(query, {
|
|
15
|
-
|
|
16
|
-
locale: localeContext,
|
|
11
|
+
locale,
|
|
17
12
|
});
|
|
18
13
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { log } from '@unchainedshop/logger';
|
|
2
2
|
import { SearchFilterQuery } from '@unchainedshop/core-filters';
|
|
3
|
-
import { QueryStringRequiredError } from '../../../errors.js';
|
|
4
3
|
import { Context } from '../../../context.js';
|
|
5
4
|
|
|
6
5
|
export default async function searchProducts(
|
|
@@ -15,8 +14,7 @@ export default async function searchProducts(
|
|
|
15
14
|
},
|
|
16
15
|
context: Context,
|
|
17
16
|
) {
|
|
18
|
-
const { modules, services, userId,
|
|
19
|
-
const forceLiveCollection = false;
|
|
17
|
+
const { modules, services, userId, locale } = context;
|
|
20
18
|
const { queryString, includeInactive, filterQuery, assortmentId, ignoreChildAssortments, ...rest } =
|
|
21
19
|
query;
|
|
22
20
|
|
|
@@ -25,7 +23,6 @@ export default async function searchProducts(
|
|
|
25
23
|
if (assortmentId) {
|
|
26
24
|
const productIds = await modules.assortments.findProductIds({
|
|
27
25
|
assortmentId,
|
|
28
|
-
forceLiveCollection,
|
|
29
26
|
ignoreChildAssortments,
|
|
30
27
|
});
|
|
31
28
|
const filterIds = await modules.assortments.filters.findFilterIds({
|
|
@@ -33,14 +30,12 @@ export default async function searchProducts(
|
|
|
33
30
|
});
|
|
34
31
|
return services.filters.searchProducts(
|
|
35
32
|
{ queryString, includeInactive, filterQuery, productIds, filterIds, ...rest },
|
|
36
|
-
{
|
|
33
|
+
{ locale: locale },
|
|
37
34
|
);
|
|
38
35
|
}
|
|
39
36
|
|
|
40
|
-
if (!queryString) throw new QueryStringRequiredError({});
|
|
41
|
-
|
|
42
37
|
return services.filters.searchProducts(
|
|
43
38
|
{ queryString, includeInactive, filterQuery, ...rest },
|
|
44
|
-
{
|
|
39
|
+
{ locale: locale },
|
|
45
40
|
);
|
|
46
41
|
}
|
|
@@ -5,7 +5,7 @@ import { Context } from '../../../context.js';
|
|
|
5
5
|
|
|
6
6
|
export default async function languages(
|
|
7
7
|
root: never,
|
|
8
|
-
params: LanguageQuery & { limit: number; offset: number; sort?:
|
|
8
|
+
params: LanguageQuery & { limit: number; offset: number; sort?: SortOption[] },
|
|
9
9
|
{ modules, userId }: Context,
|
|
10
10
|
) {
|
|
11
11
|
log(
|
|
@@ -5,7 +5,7 @@ import { Context } from '../../../context.js';
|
|
|
5
5
|
|
|
6
6
|
export default async function orders(
|
|
7
7
|
root: never,
|
|
8
|
-
params: OrderQuery & { limit?: number; offset?: number; sort?:
|
|
8
|
+
params: OrderQuery & { limit?: number; offset?: number; sort?: SortOption[] },
|
|
9
9
|
{ modules, userId }: Context,
|
|
10
10
|
) {
|
|
11
11
|
const { includeCarts, limit, offset, queryString } = params;
|
|
@@ -5,7 +5,7 @@ import { Context } from '../../../context.js';
|
|
|
5
5
|
|
|
6
6
|
export default async function quotations(
|
|
7
7
|
root: never,
|
|
8
|
-
params: QuotationQuery & { limit?: number; offset?: number; sort?:
|
|
8
|
+
params: QuotationQuery & { limit?: number; offset?: number; sort?: SortOption[] },
|
|
9
9
|
{ modules, userId }: Context,
|
|
10
10
|
) {
|
|
11
11
|
log(`query quotations: ${params.limit} ${params.offset}`, { userId });
|
|
@@ -17,13 +17,13 @@ export default async function workQueue(
|
|
|
17
17
|
limit?: number;
|
|
18
18
|
offset?: number;
|
|
19
19
|
queryString?: string;
|
|
20
|
-
status?:
|
|
21
|
-
types?:
|
|
20
|
+
status?: WorkStatus[];
|
|
21
|
+
types?: string[];
|
|
22
22
|
created?: {
|
|
23
23
|
start: Date;
|
|
24
24
|
end: Date;
|
|
25
25
|
};
|
|
26
|
-
sort?:
|
|
26
|
+
sort?: SortOption[];
|
|
27
27
|
},
|
|
28
28
|
{ modules, userId }: Context,
|
|
29
29
|
) {
|
|
@@ -1,26 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Filter } from '@unchainedshop/core-filters';
|
|
1
|
+
import { AssortmentFilter as AssortmentFilterType } from '@unchainedshop/core-assortments';
|
|
3
2
|
import { Context } from '../../../context.js';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
assortment: HelperType<Promise<Assortment>>;
|
|
9
|
-
filter: HelperType<Promise<Filter>>;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const AssortmentFilter: AssortmentFilterHelperTypes = {
|
|
13
|
-
assortment: async (obj, _, { loaders }) => {
|
|
14
|
-
const assortment = await loaders.assortmentLoader.load({
|
|
4
|
+
export const AssortmentFilter = {
|
|
5
|
+
async assortment(obj: AssortmentFilterType, _, { loaders }: Context) {
|
|
6
|
+
return loaders.assortmentLoader.load({
|
|
15
7
|
assortmentId: obj.assortmentId,
|
|
16
8
|
});
|
|
17
|
-
return assortment;
|
|
18
9
|
},
|
|
19
10
|
|
|
20
|
-
|
|
21
|
-
|
|
11
|
+
async filter(obj: AssortmentFilterType, _, { loaders }: Context) {
|
|
12
|
+
return loaders.filterLoader.load({
|
|
22
13
|
filterId: obj.filterId,
|
|
23
14
|
});
|
|
24
|
-
return filter;
|
|
25
15
|
},
|
|
26
16
|
};
|
|
@@ -3,10 +3,10 @@ import { Assortment, AssortmentLink as AssortmentLinkType } from '@unchainedshop
|
|
|
3
3
|
|
|
4
4
|
type HelperType<T> = (assortmentLink: AssortmentLinkType, _: never, context: Context) => T;
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export interface AssortmentLinkHelperTypes {
|
|
7
7
|
child: HelperType<Promise<Assortment>>;
|
|
8
8
|
parent: HelperType<Promise<Assortment>>;
|
|
9
|
-
}
|
|
9
|
+
}
|
|
10
10
|
|
|
11
11
|
export const AssortmentLink: AssortmentLinkHelperTypes = {
|
|
12
12
|
child: async (obj, _, { loaders }) => {
|
|
@@ -11,10 +11,10 @@ export interface AssortmentMediaHelperTypes {
|
|
|
11
11
|
|
|
12
12
|
export const AssortmentMedia: AssortmentMediaHelperTypes = {
|
|
13
13
|
async texts(obj, { forceLocale }, requestContext) {
|
|
14
|
-
const {
|
|
14
|
+
const { locale, loaders } = requestContext;
|
|
15
15
|
return loaders.assortmentMediaTextLoader.load({
|
|
16
16
|
assortmentMediaId: obj._id,
|
|
17
|
-
locale: forceLocale
|
|
17
|
+
locale: forceLocale ? new Intl.Locale(forceLocale) : locale,
|
|
18
18
|
});
|
|
19
19
|
},
|
|
20
20
|
|
|
@@ -13,12 +13,12 @@ export const AssortmentPathLink = {
|
|
|
13
13
|
|
|
14
14
|
assortmentTexts: async (
|
|
15
15
|
{ childAssortmentId }: AssortmentLink,
|
|
16
|
-
|
|
17
|
-
{ loaders,
|
|
16
|
+
{ forceLocale }: { forceLocale?: string },
|
|
17
|
+
{ loaders, locale }: Context,
|
|
18
18
|
) => {
|
|
19
19
|
const text = await loaders.assortmentTextLoader.load({
|
|
20
20
|
assortmentId: childAssortmentId,
|
|
21
|
-
locale:
|
|
21
|
+
locale: forceLocale ? new Intl.Locale(forceLocale) : locale,
|
|
22
22
|
});
|
|
23
23
|
return text;
|
|
24
24
|
},
|
|
@@ -4,10 +4,10 @@ import { Product } from '@unchainedshop/core-products';
|
|
|
4
4
|
|
|
5
5
|
type HelperType<T> = (assortmentProduct: AssortmentProductType, _: never, context: Context) => T;
|
|
6
6
|
|
|
7
|
-
export
|
|
7
|
+
export interface AssortmentProductHelperTypes {
|
|
8
8
|
assortment: HelperType<Promise<Assortment>>;
|
|
9
9
|
product: HelperType<Promise<Product>>;
|
|
10
|
-
}
|
|
10
|
+
}
|
|
11
11
|
|
|
12
12
|
export const AssortmentProduct: AssortmentProductHelperTypes = {
|
|
13
13
|
assortment: async (obj, _, { loaders }) => {
|
|
@@ -51,7 +51,7 @@ export const AssortmentTypes = {
|
|
|
51
51
|
},
|
|
52
52
|
|
|
53
53
|
async filterAssignments(obj: Assortment, _, { modules }: Context) {
|
|
54
|
-
// TODO:
|
|
54
|
+
// TODO: move default sort to module
|
|
55
55
|
return modules.assortments.filters.findFilters(
|
|
56
56
|
{
|
|
57
57
|
assortmentId: obj._id,
|
|
@@ -73,7 +73,7 @@ export const AssortmentTypes = {
|
|
|
73
73
|
params: {
|
|
74
74
|
limit: number;
|
|
75
75
|
offset: number;
|
|
76
|
-
tags?:
|
|
76
|
+
tags?: string[];
|
|
77
77
|
},
|
|
78
78
|
{ modules, loaders }: Context,
|
|
79
79
|
) {
|
|
@@ -90,7 +90,7 @@ export const AssortmentTypes = {
|
|
|
90
90
|
},
|
|
91
91
|
|
|
92
92
|
async productAssignments(obj: Assortment, _, { modules }: Context) {
|
|
93
|
-
// TODO:
|
|
93
|
+
// TODO: move default sort to core module
|
|
94
94
|
return modules.assortments.products.findAssortmentProducts(
|
|
95
95
|
{
|
|
96
96
|
assortmentId: obj._id,
|
|
@@ -102,10 +102,10 @@ export const AssortmentTypes = {
|
|
|
102
102
|
},
|
|
103
103
|
|
|
104
104
|
async texts(obj: Assortment, { forceLocale }: { forceLocale?: string }, requestContext: Context) {
|
|
105
|
-
const {
|
|
105
|
+
const { locale, loaders } = requestContext;
|
|
106
106
|
return loaders.assortmentTextLoader.load({
|
|
107
107
|
assortmentId: obj._id,
|
|
108
|
-
locale: forceLocale
|
|
108
|
+
locale: forceLocale ? new Intl.Locale(forceLocale) : locale,
|
|
109
109
|
});
|
|
110
110
|
},
|
|
111
111
|
|
|
@@ -132,7 +132,7 @@ export const AssortmentTypes = {
|
|
|
132
132
|
return services.filters.searchProducts(
|
|
133
133
|
{ ...query, productIds, filterIds },
|
|
134
134
|
{
|
|
135
|
-
locale: requestContext.
|
|
135
|
+
locale: requestContext.locale,
|
|
136
136
|
},
|
|
137
137
|
);
|
|
138
138
|
},
|
|
@@ -19,8 +19,7 @@ export const Bookmark: BookmarkHelperTypes = {
|
|
|
19
19
|
return product;
|
|
20
20
|
},
|
|
21
21
|
|
|
22
|
-
user: async (obj, _, {
|
|
23
|
-
|
|
24
|
-
return modules.users.findUserById(obj.userId);
|
|
22
|
+
user: async (obj, _, { loaders }) => {
|
|
23
|
+
return loaders.userLoader.load({ userId: obj.userId });
|
|
25
24
|
},
|
|
26
25
|
};
|
|
@@ -7,17 +7,14 @@ export type HelperType<P, T> = (country: CountryType, params: P, context: Contex
|
|
|
7
7
|
export interface CountryHelperTypes {
|
|
8
8
|
flagEmoji: HelperType<never, string>;
|
|
9
9
|
isBase: HelperType<never, boolean>;
|
|
10
|
-
name: HelperType<{ forceLocale
|
|
10
|
+
name: HelperType<{ forceLocale?: string }, string>;
|
|
11
11
|
defaultCurrency: HelperType<never, Promise<Currency>>;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export const Country: CountryHelperTypes = {
|
|
15
|
-
defaultCurrency: async (country, _, {
|
|
15
|
+
defaultCurrency: async (country, _, { loaders }) => {
|
|
16
16
|
if (country.defaultCurrencyCode) {
|
|
17
|
-
|
|
18
|
-
return modules.currencies.findCurrency({
|
|
19
|
-
isoCode: country.defaultCurrencyCode,
|
|
20
|
-
});
|
|
17
|
+
return loaders.currencyLoader.load({ isoCode: country.defaultCurrencyCode });
|
|
21
18
|
}
|
|
22
19
|
return null;
|
|
23
20
|
},
|
|
@@ -28,7 +25,7 @@ export const Country: CountryHelperTypes = {
|
|
|
28
25
|
isBase: (country, _, { modules }: Context) => {
|
|
29
26
|
return modules.countries.isBase(country);
|
|
30
27
|
},
|
|
31
|
-
name: (country, { forceLocale }, {
|
|
32
|
-
return modules.countries.name(country, forceLocale
|
|
28
|
+
name: (country, { forceLocale }, { locale, modules }) => {
|
|
29
|
+
return modules.countries.name(country, forceLocale ? new Intl.Locale(forceLocale) : locale);
|
|
33
30
|
},
|
|
34
31
|
};
|
|
@@ -1,39 +1,9 @@
|
|
|
1
1
|
import { Context } from '../../context.js';
|
|
2
2
|
import { DeliveryProvider as DeliveryProviderType } from '@unchainedshop/core-delivery';
|
|
3
|
-
import { DeliveryDirector,
|
|
3
|
+
import { DeliveryDirector, DeliveryPricingDirector } from '@unchainedshop/core';
|
|
4
4
|
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
export interface DeliveryProviderHelperTypes {
|
|
8
|
-
interface: HelperType<
|
|
9
|
-
never,
|
|
10
|
-
{
|
|
11
|
-
_id: string;
|
|
12
|
-
label: string;
|
|
13
|
-
version: string;
|
|
14
|
-
}
|
|
15
|
-
>;
|
|
16
|
-
isActive: HelperType<void, Promise<boolean>>;
|
|
17
|
-
configurationError: HelperType<never, Promise<DeliveryError>>;
|
|
18
|
-
simulatedPrice: HelperType<
|
|
19
|
-
{
|
|
20
|
-
currency?: string;
|
|
21
|
-
orderId: string;
|
|
22
|
-
useNetPrice?: boolean;
|
|
23
|
-
context: any;
|
|
24
|
-
},
|
|
25
|
-
Promise<{
|
|
26
|
-
amount: number;
|
|
27
|
-
currencyCode: string;
|
|
28
|
-
countryCode: string;
|
|
29
|
-
isTaxable: boolean;
|
|
30
|
-
isNetPrice: boolean;
|
|
31
|
-
}>
|
|
32
|
-
>;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export const DeliveryProvider: DeliveryProviderHelperTypes = {
|
|
36
|
-
interface(deliveryProvider) {
|
|
5
|
+
export const DeliveryProvider = {
|
|
6
|
+
interface(deliveryProvider: DeliveryProviderType) {
|
|
37
7
|
const Adapter = DeliveryDirector.getAdapter(deliveryProvider.adapterKey);
|
|
38
8
|
if (!Adapter) return null;
|
|
39
9
|
return {
|
|
@@ -43,29 +13,38 @@ export const DeliveryProvider: DeliveryProviderHelperTypes = {
|
|
|
43
13
|
};
|
|
44
14
|
},
|
|
45
15
|
|
|
46
|
-
async isActive(deliveryProvider, _, requestContext) {
|
|
16
|
+
async isActive(deliveryProvider: DeliveryProviderType, _: never, requestContext: Context) {
|
|
47
17
|
const director = await DeliveryDirector.actions(deliveryProvider, {}, requestContext);
|
|
48
18
|
return Boolean(director.isActive());
|
|
49
19
|
},
|
|
50
20
|
|
|
51
|
-
async configurationError(deliveryProvider, _, requestContext) {
|
|
21
|
+
async configurationError(deliveryProvider: DeliveryProviderType, _: never, requestContext: Context) {
|
|
52
22
|
const director = await DeliveryDirector.actions(deliveryProvider, {}, requestContext);
|
|
53
23
|
return director.configurationError();
|
|
54
24
|
},
|
|
55
25
|
|
|
56
26
|
async simulatedPrice(
|
|
57
|
-
deliveryProvider,
|
|
58
|
-
{
|
|
59
|
-
|
|
27
|
+
deliveryProvider: DeliveryProviderType,
|
|
28
|
+
{
|
|
29
|
+
currencyCode: forcedCurrencyCode,
|
|
30
|
+
orderId,
|
|
31
|
+
useNetPrice,
|
|
32
|
+
context: providerContext,
|
|
33
|
+
}: {
|
|
34
|
+
currencyCode?: string;
|
|
35
|
+
orderId: string;
|
|
36
|
+
useNetPrice?: boolean;
|
|
37
|
+
context: any;
|
|
38
|
+
},
|
|
39
|
+
requestContext: Context,
|
|
60
40
|
) {
|
|
61
|
-
const {
|
|
41
|
+
const { loaders, countryCode, user } = requestContext;
|
|
62
42
|
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
const currency = currencyCode || order?.currency || requestContext.currencyContext;
|
|
43
|
+
const order = await loaders.orderLoader.load({ orderId });
|
|
44
|
+
const currencyCode = forcedCurrencyCode || order?.currencyCode || requestContext.currencyCode;
|
|
66
45
|
const pricingContext = {
|
|
67
|
-
|
|
68
|
-
|
|
46
|
+
countryCode,
|
|
47
|
+
currencyCode,
|
|
69
48
|
provider: deliveryProvider,
|
|
70
49
|
order,
|
|
71
50
|
providerContext,
|
|
@@ -80,13 +59,13 @@ export const DeliveryProvider: DeliveryProviderHelperTypes = {
|
|
|
80
59
|
|
|
81
60
|
const orderPrice = pricing.total({ useNetPrice }) as {
|
|
82
61
|
amount: number;
|
|
83
|
-
|
|
62
|
+
currencyCode: string;
|
|
84
63
|
};
|
|
85
64
|
|
|
86
65
|
return {
|
|
87
66
|
amount: orderPrice.amount,
|
|
88
|
-
currencyCode: orderPrice.
|
|
89
|
-
countryCode
|
|
67
|
+
currencyCode: orderPrice.currencyCode,
|
|
68
|
+
countryCode,
|
|
90
69
|
isTaxable: pricing.taxSum() > 0,
|
|
91
70
|
isNetPrice: useNetPrice,
|
|
92
71
|
};
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import { Context } from '../../../context.js';
|
|
2
|
-
import { DeliveryProvider } from '@unchainedshop/core-delivery';
|
|
3
2
|
import { Enrollment } from '@unchainedshop/core-enrollments';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export const EnrollmentDelivery: EnrollmentDeliveryHelperTypes = {
|
|
12
|
-
provider: async ({ deliveryProviderId }, _, { modules }) => {
|
|
13
|
-
// TODO: use loader
|
|
14
|
-
return modules.delivery.findProvider({ deliveryProviderId });
|
|
4
|
+
export const EnrollmentDelivery = {
|
|
5
|
+
provider: async ({ deliveryProviderId }: Enrollment['delivery'], _: never, { loaders }: Context) => {
|
|
6
|
+
return loaders.deliveryProviderLoader.load({
|
|
7
|
+
deliveryProviderId,
|
|
8
|
+
});
|
|
15
9
|
},
|
|
16
10
|
};
|
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
import { Context } from '../../../context.js';
|
|
2
|
-
import { PaymentProvider } from '@unchainedshop/core-payment';
|
|
3
2
|
import { Enrollment } from '@unchainedshop/core-enrollments';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
provider: HelperType<Promise<PaymentProvider>>;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export const EnrollmentPayment: EnrollmentPaymentHelperTypes = {
|
|
12
|
-
provider: async ({ paymentProviderId }, _, { modules }) => {
|
|
13
|
-
// TODO: use loader
|
|
14
|
-
return modules.payment.paymentProviders.findProvider({
|
|
4
|
+
export const EnrollmentPayment = {
|
|
5
|
+
provider: async ({ paymentProviderId }: Enrollment['payment'], _: never, { loaders }: Context) => {
|
|
6
|
+
return loaders.paymentProviderLoader.load({
|
|
15
7
|
paymentProviderId,
|
|
16
8
|
});
|
|
17
9
|
},
|
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
import { Context } from '../../../context.js';
|
|
2
2
|
import { EnrollmentPeriod as EnrollmentPeriodType } from '@unchainedshop/core-enrollments';
|
|
3
|
-
import { Order } from '@unchainedshop/core-orders';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
order: HelperType<Promise<Order>>;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export const EnrollmentPeriod: EnrollmentPeriodHelperTypes = {
|
|
12
|
-
order: async (period, _, { modules }) => {
|
|
13
|
-
// TODO: use loader
|
|
14
|
-
return modules.orders.findOrder({ orderId: period.orderId });
|
|
4
|
+
export const EnrollmentPeriod = {
|
|
5
|
+
async order(period: EnrollmentPeriodType, _: never, { loaders }: Context) {
|
|
6
|
+
return loaders.orderLoader.load({ orderId: period.orderId });
|
|
15
7
|
},
|
|
16
8
|
};
|
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
import { Context } from '../../../context.js';
|
|
2
2
|
import { EnrollmentPlan as EnrollmentPlanType } from '@unchainedshop/core-enrollments';
|
|
3
|
-
import { Product } from '@unchainedshop/core-products';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
product: HelperType<Promise<Product>>;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export const EnrollmentPlan: EnrollmentPlanHelperTypes = {
|
|
12
|
-
product: async (plan, _, { loaders }) => {
|
|
13
|
-
const product = await loaders.productLoader.load({
|
|
4
|
+
export const EnrollmentPlan = {
|
|
5
|
+
async product(plan: EnrollmentPlanType, _: never, { loaders }: Context) {
|
|
6
|
+
return loaders.productLoader.load({
|
|
14
7
|
productId: plan.productId,
|
|
15
8
|
});
|
|
16
|
-
return product;
|
|
17
9
|
},
|
|
18
10
|
};
|
|
@@ -1,25 +1,12 @@
|
|
|
1
1
|
import { Context } from '../../../context.js';
|
|
2
|
-
import {
|
|
3
|
-
import { Currency } from '@unchainedshop/core-currencies';
|
|
4
|
-
import { Enrollment as EnrollmentType, EnrollmentPlan } from '@unchainedshop/core-enrollments';
|
|
5
|
-
import { User } from '@unchainedshop/core-users';
|
|
2
|
+
import { Enrollment as EnrollmentType } from '@unchainedshop/core-enrollments';
|
|
6
3
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
type EnrollmentHelperTypes = {
|
|
10
|
-
isExpired: HelperType<{ referenceDate?: Date }, boolean>;
|
|
11
|
-
plan: HelperType<never, EnrollmentPlan>;
|
|
12
|
-
user: HelperType<never, Promise<User>>;
|
|
13
|
-
country: HelperType<never, Promise<Country>>;
|
|
14
|
-
currency: HelperType<never, Promise<Currency>>;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export const Enrollment: EnrollmentHelperTypes = {
|
|
18
|
-
isExpired: (obj, params, { modules }) => {
|
|
4
|
+
export const Enrollment = {
|
|
5
|
+
isExpired: (obj: EnrollmentType, params: { referenceDate?: Date }, { modules }: Context) => {
|
|
19
6
|
return modules.enrollments.isExpired(obj, params);
|
|
20
7
|
},
|
|
21
8
|
|
|
22
|
-
plan: ({ quantity, productId, configuration }) => {
|
|
9
|
+
plan: ({ quantity, productId, configuration }: EnrollmentType) => {
|
|
23
10
|
return {
|
|
24
11
|
quantity,
|
|
25
12
|
productId,
|
|
@@ -27,12 +14,10 @@ export const Enrollment: EnrollmentHelperTypes = {
|
|
|
27
14
|
};
|
|
28
15
|
},
|
|
29
16
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
// TODO: use loader
|
|
37
|
-
user: (obj, _, { modules }) => modules.users.findUserById(obj.userId),
|
|
17
|
+
country: async (obj: EnrollmentType, _: never, { loaders }: Context) =>
|
|
18
|
+
loaders.currencyLoader.load({ isoCode: obj.countryCode }),
|
|
19
|
+
currency: async (obj: EnrollmentType, _: never, { loaders }: Context) =>
|
|
20
|
+
loaders.currencyLoader.load({ isoCode: obj.currencyCode }),
|
|
21
|
+
user: async (obj: EnrollmentType, _: never, { loaders }: Context) =>
|
|
22
|
+
loaders.userLoader.load({ userId: obj.userId }),
|
|
38
23
|
};
|
|
@@ -1,29 +1,24 @@
|
|
|
1
1
|
import { Context } from '../../../context.js';
|
|
2
|
-
import { FilterOption as FilterOptionType
|
|
2
|
+
import { FilterOption as FilterOptionType } from '@unchainedshop/core-filters';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
type FilterOptionHelperTypes = {
|
|
7
|
-
_id: HelperType<never, string>;
|
|
8
|
-
texts: HelperType<{ forceLocale?: string }, Promise<FilterText>>;
|
|
9
|
-
value: HelperType<never, string>;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const FilterOption: FilterOptionHelperTypes = {
|
|
13
|
-
_id(obj) {
|
|
4
|
+
export const FilterOption = {
|
|
5
|
+
_id(obj: FilterOptionType) {
|
|
14
6
|
return `${obj._id}:${obj.filterOption}`;
|
|
15
7
|
},
|
|
16
8
|
|
|
17
|
-
value(obj) {
|
|
9
|
+
value(obj: FilterOptionType) {
|
|
18
10
|
return obj.filterOption;
|
|
19
11
|
},
|
|
20
12
|
|
|
21
|
-
async texts(
|
|
22
|
-
|
|
13
|
+
async texts(
|
|
14
|
+
obj: FilterOptionType,
|
|
15
|
+
{ forceLocale }: { forceLocale?: string },
|
|
16
|
+
{ locale, loaders }: Context,
|
|
17
|
+
) {
|
|
23
18
|
return loaders.filterTextLoader.load({
|
|
24
19
|
filterId: obj._id,
|
|
25
20
|
filterOptionValue: obj.filterOption,
|
|
26
|
-
locale: forceLocale
|
|
21
|
+
locale: forceLocale ? new Intl.Locale(forceLocale) : locale,
|
|
27
22
|
});
|
|
28
23
|
},
|
|
29
24
|
};
|