@unchainedshop/api 3.1.10 → 4.0.0-rc.2
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/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 -0
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +2 -0
- package/lib/errors.js.map +1 -1
- 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 +8 -0
- package/lib/express/createMCPMiddleware.d.ts.map +1 -0
- package/lib/express/createMCPMiddleware.js +46 -0
- package/lib/express/createMCPMiddleware.js.map +1 -0
- package/lib/express/index.d.ts.map +1 -1
- package/lib/express/index.js +0 -2
- package/lib/express/index.js.map +1 -1
- package/lib/express/mcpHandler.d.ts.map +1 -0
- package/lib/express/mcpHandler.js +68 -0
- package/lib/express/mcpHandler.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 copy.d.ts.map +1 -0
- package/lib/fastify/index copy.js +157 -0
- package/lib/fastify/index copy.js.map +1 -0
- package/lib/fastify/index.d.ts.map +1 -1
- package/lib/fastify/index.js +0 -3
- package/lib/fastify/index.js.map +1 -1
- package/lib/fastify/mcpHandler.d.ts +8 -0
- package/lib/fastify/mcpHandler.d.ts.map +1 -0
- package/lib/fastify/mcpHandler.js +46 -0
- package/lib/fastify/mcpHandler.js.map +1 -0
- package/lib/loaders/assortmentLinkLoader.d.ts +12 -0
- package/lib/loaders/assortmentLinkLoader.d.ts.map +1 -0
- package/lib/loaders/assortmentLinkLoader.js +23 -0
- package/lib/loaders/assortmentLinkLoader.js.map +1 -0
- package/lib/loaders/assortmentLinksLoader.d.ts +14 -0
- package/lib/loaders/assortmentLinksLoader.d.ts.map +1 -0
- package/lib/loaders/assortmentLinksLoader.js +38 -0
- package/lib/loaders/assortmentLinksLoader.js.map +1 -0
- package/lib/loaders/assortmentLoader.d.ts +10 -0
- package/lib/loaders/assortmentLoader.d.ts.map +1 -0
- package/lib/loaders/assortmentLoader.js +15 -0
- package/lib/loaders/assortmentLoader.js.map +1 -0
- package/lib/loaders/assortmentMediaTextLoader.d.ts +12 -0
- package/lib/loaders/assortmentMediaTextLoader.d.ts.map +1 -0
- package/lib/loaders/assortmentMediaTextLoader.js +15 -0
- package/lib/loaders/assortmentMediaTextLoader.js.map +1 -0
- package/lib/loaders/assortmentMediasLoader.d.ts +10 -0
- package/lib/loaders/assortmentMediasLoader.d.ts.map +1 -0
- package/lib/loaders/assortmentMediasLoader.js +18 -0
- package/lib/loaders/assortmentMediasLoader.js.map +1 -0
- package/lib/loaders/assortmentProductLoader.d.ts +12 -0
- package/lib/loaders/assortmentProductLoader.d.ts.map +1 -0
- package/lib/loaders/assortmentProductLoader.js +14 -0
- package/lib/loaders/assortmentProductLoader.js.map +1 -0
- package/lib/loaders/assortmentProductsLoader.d.ts +10 -0
- package/lib/loaders/assortmentProductsLoader.d.ts.map +1 -0
- package/lib/loaders/assortmentProductsLoader.js +18 -0
- package/lib/loaders/assortmentProductsLoader.js.map +1 -0
- package/lib/loaders/assortmentTextLoader.d.ts +12 -0
- package/lib/loaders/assortmentTextLoader.d.ts.map +1 -0
- package/lib/loaders/assortmentTextLoader.js +15 -0
- package/lib/loaders/assortmentTextLoader.js.map +1 -0
- package/lib/loaders/buildTextMap.d.ts +2 -2
- package/lib/loaders/buildTextMap.d.ts.map +1 -1
- package/lib/loaders/countryLoader.d.ts +10 -0
- package/lib/loaders/countryLoader.d.ts.map +1 -0
- package/lib/loaders/countryLoader.js +14 -0
- package/lib/loaders/countryLoader.js.map +1 -0
- package/lib/loaders/currencyLoader.d.ts +10 -0
- package/lib/loaders/currencyLoader.d.ts.map +1 -0
- package/lib/loaders/currencyLoader.js +14 -0
- package/lib/loaders/currencyLoader.js.map +1 -0
- package/lib/loaders/deliveryProviderLoader.d.ts +10 -0
- package/lib/loaders/deliveryProviderLoader.d.ts.map +1 -0
- package/lib/loaders/deliveryProviderLoader.js +13 -0
- package/lib/loaders/deliveryProviderLoader.js.map +1 -0
- package/lib/loaders/fileLoader.d.ts +10 -0
- package/lib/loaders/fileLoader.d.ts.map +1 -0
- package/lib/loaders/fileLoader.js +13 -0
- package/lib/loaders/fileLoader.js.map +1 -0
- package/lib/loaders/filterLoader.d.ts +10 -0
- package/lib/loaders/filterLoader.d.ts.map +1 -0
- package/lib/loaders/filterLoader.js +14 -0
- package/lib/loaders/filterLoader.js.map +1 -0
- package/lib/loaders/filterTextLoader.d.ts +14 -0
- package/lib/loaders/filterTextLoader.d.ts.map +1 -0
- package/lib/loaders/filterTextLoader.js +15 -0
- package/lib/loaders/filterTextLoader.js.map +1 -0
- package/lib/loaders/index.d.ts +79 -49
- package/lib/loaders/index.d.ts.map +1 -1
- package/lib/loaders/index.js +47 -268
- package/lib/loaders/index.js.map +1 -1
- package/lib/loaders/languageLoader.d.ts +10 -0
- package/lib/loaders/languageLoader.d.ts.map +1 -0
- package/lib/loaders/languageLoader.js +14 -0
- package/lib/loaders/languageLoader.js.map +1 -0
- package/lib/loaders/orderLoader.d.ts +10 -0
- package/lib/loaders/orderLoader.d.ts.map +1 -0
- package/lib/loaders/orderLoader.js +16 -0
- package/lib/loaders/orderLoader.js.map +1 -0
- package/lib/loaders/paymentProviderLoader.d.ts +10 -0
- package/lib/loaders/paymentProviderLoader.d.ts.map +1 -0
- package/lib/loaders/paymentProviderLoader.js +13 -0
- package/lib/loaders/paymentProviderLoader.js.map +1 -0
- package/lib/loaders/productLoader.d.ts +10 -0
- package/lib/loaders/productLoader.d.ts.map +1 -0
- package/lib/loaders/productLoader.js +16 -0
- package/lib/loaders/productLoader.js.map +1 -0
- package/lib/loaders/productLoaderBySKU.d.ts +10 -0
- package/lib/loaders/productLoaderBySKU.d.ts.map +1 -0
- package/lib/loaders/productLoaderBySKU.js +16 -0
- package/lib/loaders/productLoaderBySKU.js.map +1 -0
- package/lib/loaders/productMediaTextLoader.d.ts +12 -0
- package/lib/loaders/productMediaTextLoader.d.ts.map +1 -0
- package/lib/loaders/productMediaTextLoader.js +15 -0
- package/lib/loaders/productMediaTextLoader.js.map +1 -0
- package/lib/loaders/productMediasLoader.d.ts +10 -0
- package/lib/loaders/productMediasLoader.d.ts.map +1 -0
- package/lib/loaders/productMediasLoader.js +18 -0
- package/lib/loaders/productMediasLoader.js.map +1 -0
- package/lib/loaders/productTextLoader.d.ts +12 -0
- package/lib/loaders/productTextLoader.d.ts.map +1 -0
- package/lib/loaders/productTextLoader.js +15 -0
- package/lib/loaders/productTextLoader.js.map +1 -0
- package/lib/loaders/userLoader.d.ts +10 -0
- package/lib/loaders/userLoader.d.ts.map +1 -0
- package/lib/loaders/userLoader.js +17 -0
- package/lib/loaders/userLoader.js.map +1 -0
- package/lib/loaders/utils.d.ts +7 -0
- package/lib/loaders/utils.d.ts.map +1 -0
- package/lib/loaders/utils.js +29 -0
- package/lib/loaders/utils.js.map +1 -0
- 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 +95 -0
- package/lib/mcp/index.d.ts.map +1 -0
- package/lib/mcp/index.js +138 -0
- package/lib/mcp/index.js.map +1 -0
- package/lib/mcp/server.d.ts +4 -0
- package/lib/mcp/server.d.ts.map +1 -0
- package/lib/mcp/server.js +60 -0
- package/lib/mcp/server.js.map +1 -0
- package/lib/mcp/types.d.ts +28 -0
- package/lib/mcp/types.d.ts.map +1 -0
- package/lib/mcp/types.js +2 -0
- package/lib/mcp/types.js.map +1 -0
- package/lib/middleware/accountLockout.d.ts.map +1 -0
- package/lib/middleware/accountLockout.js +84 -0
- package/lib/middleware/accountLockout.js.map +1 -0
- package/lib/middleware/rateLimiter.d.ts.map +1 -0
- package/lib/middleware/rateLimiter.js +91 -0
- package/lib/middleware/rateLimiter.js.map +1 -0
- package/lib/plugins/inputValidation.d.ts.map +1 -0
- package/lib/plugins/inputValidation.js +95 -0
- package/lib/plugins/inputValidation.js.map +1 -0
- 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.js +2 -2
- package/lib/resolvers/queries/filters/searchAssortments.js.map +1 -1
- package/lib/resolvers/queries/filters/searchProducts.js +3 -3
- 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.d.ts.map +1 -1
- package/lib/roles/all.js +0 -1
- package/lib/roles/all.js.map +1 -1
- package/lib/schema/mutation.js +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/lib/utils/inputValidation.d.ts.map +1 -0
- package/lib/utils/inputValidation.js +51 -0
- package/lib/utils/inputValidation.js.map +1 -0
- package/package.json +12 -12
- package/src/context.ts +3 -3
- package/src/createGraphQLServer.ts +2 -2
- package/src/errors.ts +10 -0
- package/src/express/createERCMetadataMiddleware.ts +11 -5
- package/src/express/index.ts +2 -3
- package/src/fastify/ercMetadataHandler.ts +11 -5
- package/src/fastify/index.ts +2 -3
- 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/buildTextMap.ts +1 -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 -360
- 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/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 +50 -3
- 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 -2
- package/src/resolvers/queries/filters/searchProducts.ts +3 -3
- 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 +0 -1
- package/src/schema/mutation.ts +1 -1
- 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
|
@@ -3,7 +3,7 @@ import { Context } from '../../../context.js';
|
|
|
3
3
|
|
|
4
4
|
export default async function reorderProductMedia(
|
|
5
5
|
root: never,
|
|
6
|
-
params: { sortKeys:
|
|
6
|
+
params: { sortKeys: { productMediaId: string; sortKey: number }[] },
|
|
7
7
|
{ modules, userId }: Context,
|
|
8
8
|
) {
|
|
9
9
|
const { sortKeys = [] } = params;
|
|
@@ -5,7 +5,7 @@ import { ProductMediaNotFoundError, InvalidIdError } from '../../../errors.js';
|
|
|
5
5
|
|
|
6
6
|
export default async function updateProductMediaTexts(
|
|
7
7
|
root: never,
|
|
8
|
-
{ productMediaId, texts }: { productMediaId: string; texts:
|
|
8
|
+
{ productMediaId, texts }: { productMediaId: string; texts: ProductMediaText[] },
|
|
9
9
|
{ modules, userId }: Context,
|
|
10
10
|
) {
|
|
11
11
|
log(`mutation updateProductMediaTexts ${productMediaId}`, { userId });
|
|
@@ -4,10 +4,10 @@ import { ProductNotFoundError, InvalidIdError } from '../../../errors.js';
|
|
|
4
4
|
|
|
5
5
|
export default async function requestQuotation(
|
|
6
6
|
root: never,
|
|
7
|
-
params: { productId: string; configuration:
|
|
7
|
+
params: { productId: string; configuration: { key: string; value: string }[] },
|
|
8
8
|
context: Context,
|
|
9
9
|
) {
|
|
10
|
-
const {
|
|
10
|
+
const { countryCode, currencyCode, modules, services, userId } = context;
|
|
11
11
|
const { productId, configuration } = params;
|
|
12
12
|
|
|
13
13
|
log(`mutation requestQuotation ${productId} ${configuration ? JSON.stringify(configuration) : ''}`, {
|
|
@@ -22,8 +22,8 @@ export default async function requestQuotation(
|
|
|
22
22
|
const newQuotation = await modules.quotations.create({
|
|
23
23
|
userId,
|
|
24
24
|
productId,
|
|
25
|
-
countryCode
|
|
26
|
-
|
|
25
|
+
countryCode,
|
|
26
|
+
currencyCode,
|
|
27
27
|
configuration,
|
|
28
28
|
});
|
|
29
29
|
|
|
@@ -5,7 +5,7 @@ import { UserNotFoundError } from '../../../errors.js';
|
|
|
5
5
|
export default async function heartbeat(
|
|
6
6
|
root: never,
|
|
7
7
|
_: any,
|
|
8
|
-
{
|
|
8
|
+
{ countryCode, locale, modules, remoteAddress, remotePort, userId, getHeader }: Context,
|
|
9
9
|
) {
|
|
10
10
|
log(`mutation heartbeat`, { userId });
|
|
11
11
|
|
|
@@ -16,8 +16,8 @@ export default async function heartbeat(
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
const user = await modules.users.updateHeartbeat(userId, {
|
|
19
|
-
countryCode
|
|
20
|
-
locale:
|
|
19
|
+
countryCode,
|
|
20
|
+
locale: locale.baseName,
|
|
21
21
|
remoteAddress,
|
|
22
22
|
remotePort,
|
|
23
23
|
userAgent: getHeader('user-agent'),
|
|
@@ -4,7 +4,7 @@ import { InvalidIdError, UserNotFoundError } from '../../../errors.js';
|
|
|
4
4
|
|
|
5
5
|
export default async function setRoles(
|
|
6
6
|
root: never,
|
|
7
|
-
params: { roles:
|
|
7
|
+
params: { roles: string[]; userId: string },
|
|
8
8
|
{ modules, userId }: Context,
|
|
9
9
|
) {
|
|
10
10
|
const foreignUserId = params.userId;
|
|
@@ -4,7 +4,7 @@ import { InvalidIdError, UserNotFoundError } from '../../../errors.js';
|
|
|
4
4
|
|
|
5
5
|
export default async function setUserTags(
|
|
6
6
|
root: never,
|
|
7
|
-
params: { tags:
|
|
7
|
+
params: { tags: string[]; userId: string },
|
|
8
8
|
{ modules, userId }: Context,
|
|
9
9
|
) {
|
|
10
10
|
const normalizedUserId = params.userId;
|
|
@@ -27,9 +27,9 @@ export default async function invalidateToken(
|
|
|
27
27
|
const product = await modules.products.findProduct({ productId: token.productId });
|
|
28
28
|
if (!product) throw new ProductNotFoundError({ productId: token.productId });
|
|
29
29
|
|
|
30
|
-
const virtualProviders = await context.modules.warehousing.
|
|
31
|
-
type
|
|
32
|
-
|
|
30
|
+
const virtualProviders = (await context.modules.warehousing.allProviders()).filter(
|
|
31
|
+
({ type }) => type === WarehousingProviderType.VIRTUAL,
|
|
32
|
+
);
|
|
33
33
|
|
|
34
34
|
const isInvalidateable = await WarehousingDirector.isInvalidateable(
|
|
35
35
|
virtualProviders,
|
|
@@ -3,7 +3,7 @@ import { log } from '@unchainedshop/logger';
|
|
|
3
3
|
|
|
4
4
|
export default async function allocateWork(
|
|
5
5
|
root: never,
|
|
6
|
-
{ types, worker }: { types?:
|
|
6
|
+
{ types, worker }: { types?: string[]; worker?: string },
|
|
7
7
|
{ modules, userId }: Context,
|
|
8
8
|
) {
|
|
9
9
|
log(`mutation allocateWork ${(types || []).join(',')} ${worker}`, {
|
|
@@ -5,7 +5,7 @@ import { Context } from '../../../context.js';
|
|
|
5
5
|
|
|
6
6
|
export default async function countries(
|
|
7
7
|
root: never,
|
|
8
|
-
params: CountryQuery & { limit?: number; offset?: number; sort?:
|
|
8
|
+
params: CountryQuery & { 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 currencies(
|
|
7
7
|
root: never,
|
|
8
|
-
params: CurrencyQuery & { limit: number; offset: number; sort?:
|
|
8
|
+
params: CurrencyQuery & { limit: number; offset: number; sort?: SortOption[] },
|
|
9
9
|
{ modules, userId }: Context,
|
|
10
10
|
) {
|
|
11
11
|
log(
|
|
@@ -4,7 +4,7 @@ import { log } from '@unchainedshop/logger';
|
|
|
4
4
|
import { QueryStringRequiredError } from '../../../errors.js';
|
|
5
5
|
|
|
6
6
|
export default async function searchAssortments(root: never, query: SearchQuery, context: Context) {
|
|
7
|
-
const { services, userId,
|
|
7
|
+
const { services, userId, locale } = context;
|
|
8
8
|
const forceLiveCollection = false;
|
|
9
9
|
|
|
10
10
|
log(`query search assortments ${JSON.stringify(query)}`, { userId });
|
|
@@ -13,6 +13,6 @@ export default async function searchAssortments(root: never, query: SearchQuery,
|
|
|
13
13
|
|
|
14
14
|
return services.filters.searchAssortments(query, {
|
|
15
15
|
forceLiveCollection,
|
|
16
|
-
locale
|
|
16
|
+
locale,
|
|
17
17
|
});
|
|
18
18
|
}
|
|
@@ -15,7 +15,7 @@ export default async function searchProducts(
|
|
|
15
15
|
},
|
|
16
16
|
context: Context,
|
|
17
17
|
) {
|
|
18
|
-
const { modules, services, userId,
|
|
18
|
+
const { modules, services, userId, locale } = context;
|
|
19
19
|
const forceLiveCollection = false;
|
|
20
20
|
const { queryString, includeInactive, filterQuery, assortmentId, ignoreChildAssortments, ...rest } =
|
|
21
21
|
query;
|
|
@@ -33,7 +33,7 @@ export default async function searchProducts(
|
|
|
33
33
|
});
|
|
34
34
|
return services.filters.searchProducts(
|
|
35
35
|
{ queryString, includeInactive, filterQuery, productIds, filterIds, ...rest },
|
|
36
|
-
{ forceLiveCollection, locale:
|
|
36
|
+
{ forceLiveCollection, locale: locale },
|
|
37
37
|
);
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -41,6 +41,6 @@ export default async function searchProducts(
|
|
|
41
41
|
|
|
42
42
|
return services.filters.searchProducts(
|
|
43
43
|
{ queryString, includeInactive, filterQuery, ...rest },
|
|
44
|
-
{ forceLiveCollection, locale:
|
|
44
|
+
{ forceLiveCollection, locale: locale },
|
|
45
45
|
);
|
|
46
46
|
}
|
|
@@ -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
|
},
|