@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
|
@@ -20,9 +20,9 @@ export const Product = {
|
|
|
20
20
|
},
|
|
21
21
|
{ modules, loaders }: Context,
|
|
22
22
|
): Promise<
|
|
23
|
-
|
|
24
|
-
links:
|
|
25
|
-
}
|
|
23
|
+
{
|
|
24
|
+
links: AssortmentPathLink[];
|
|
25
|
+
}[]
|
|
26
26
|
> {
|
|
27
27
|
return modules.assortments.breadcrumbs(
|
|
28
28
|
{
|
|
@@ -41,16 +41,15 @@ export const Product = {
|
|
|
41
41
|
);
|
|
42
42
|
},
|
|
43
43
|
|
|
44
|
-
// TODO: Use a loader!
|
|
45
44
|
async media(
|
|
46
45
|
product: ProductType,
|
|
47
46
|
params: {
|
|
48
47
|
limit: number;
|
|
49
48
|
offset: number;
|
|
50
|
-
tags?:
|
|
49
|
+
tags?: string[];
|
|
51
50
|
},
|
|
52
51
|
{ loaders, modules }: Context,
|
|
53
|
-
): Promise<
|
|
52
|
+
): Promise<ProductMedia[]> {
|
|
54
53
|
if (params.offset || params.tags) {
|
|
55
54
|
return modules.products.media.findProductMedias({
|
|
56
55
|
productId: product._id,
|
|
@@ -74,11 +73,10 @@ export const Product = {
|
|
|
74
73
|
queryString?: string;
|
|
75
74
|
limit?: number;
|
|
76
75
|
offset?: number;
|
|
77
|
-
sort?:
|
|
76
|
+
sort?: SortOption[];
|
|
78
77
|
},
|
|
79
78
|
{ modules }: Context,
|
|
80
|
-
): Promise<
|
|
81
|
-
// TODO: use loader?
|
|
79
|
+
): Promise<ProductReview[]> {
|
|
82
80
|
return modules.products.reviews.findProductReviews({
|
|
83
81
|
productId: product._id,
|
|
84
82
|
limit,
|
|
@@ -107,7 +105,7 @@ export const Product = {
|
|
|
107
105
|
includeInactive: boolean;
|
|
108
106
|
},
|
|
109
107
|
{ modules }: Context,
|
|
110
|
-
): Promise<
|
|
108
|
+
): Promise<(typeof product)[]> {
|
|
111
109
|
const { assortmentId, limit, offset, includeInactive = false } = params;
|
|
112
110
|
|
|
113
111
|
const productId = product._id;
|
|
@@ -141,12 +139,11 @@ export const Product = {
|
|
|
141
139
|
}: {
|
|
142
140
|
forceLocale?: string;
|
|
143
141
|
},
|
|
144
|
-
|
|
142
|
+
{ locale, loaders }: Context,
|
|
145
143
|
): Promise<ProductText> {
|
|
146
|
-
const { localeContext, loaders } = requestContext;
|
|
147
144
|
return loaders.productTextLoader.load({
|
|
148
145
|
productId: product._id,
|
|
149
|
-
locale: forceLocale
|
|
146
|
+
locale: forceLocale ? new Intl.Locale(forceLocale) : locale,
|
|
150
147
|
});
|
|
151
148
|
},
|
|
152
149
|
};
|
|
@@ -9,13 +9,13 @@ export type AssignmentHelperType<T> = (
|
|
|
9
9
|
|
|
10
10
|
export interface ProductVariationAssignmentHelperTypes {
|
|
11
11
|
_id: AssignmentHelperType<string>;
|
|
12
|
-
vectors: AssignmentHelperType<
|
|
12
|
+
vectors: AssignmentHelperType<({ product: Product } & ProductConfiguration)[]>;
|
|
13
13
|
product: AssignmentHelperType<Promise<Product>>;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export const ProductVariationAssignment: ProductVariationAssignmentHelperTypes = {
|
|
17
17
|
_id: ({ product, assignment }) => {
|
|
18
|
-
return `${product
|
|
18
|
+
return `${product?._id}:${Object.values(assignment.vector).join('-')}`;
|
|
19
19
|
},
|
|
20
20
|
vectors: ({ assignment, product }) => {
|
|
21
21
|
return Object.keys(assignment.vector || {}).map((key) => ({
|
|
@@ -18,7 +18,7 @@ export const ProductVariationAssignmentVector: ProductVariationAssignmentVectorH
|
|
|
18
18
|
_id: ({ product, key, value }) => `${product._id}:${key}=${value}`,
|
|
19
19
|
|
|
20
20
|
option: async (obj, _, { modules }) => {
|
|
21
|
-
// TODO: use loader
|
|
21
|
+
// TODO: use product variation loader
|
|
22
22
|
const productVariation = await modules.products.variations.findProductVariationByKey({
|
|
23
23
|
key: obj.key,
|
|
24
24
|
productId: obj.product._id,
|
|
@@ -30,7 +30,7 @@ export const ProductVariationAssignmentVector: ProductVariationAssignmentVectorH
|
|
|
30
30
|
},
|
|
31
31
|
|
|
32
32
|
variation: (obj, _, { modules }) => {
|
|
33
|
-
// TODO: use loader
|
|
33
|
+
// TODO: use product variation loader
|
|
34
34
|
return modules.products.variations.findProductVariationByKey({
|
|
35
35
|
productId: obj?.product?._id,
|
|
36
36
|
key: obj?.key,
|
|
@@ -20,12 +20,12 @@ export const ProductVariationOption: ProductVariationOptionHelperTypes = {
|
|
|
20
20
|
return obj.productVariationOption;
|
|
21
21
|
},
|
|
22
22
|
|
|
23
|
-
texts: async (obj, { forceLocale }, { modules,
|
|
24
|
-
// TODO: use loader
|
|
23
|
+
texts: async (obj, { forceLocale }, { modules, locale }) => {
|
|
24
|
+
// TODO: use variation text loader
|
|
25
25
|
return modules.products.variations.texts.findLocalizedVariationText({
|
|
26
|
-
locale: forceLocale || localeContext.baseName,
|
|
27
26
|
productVariationId: obj._id,
|
|
28
27
|
productVariationOptionValue: obj.productVariationOption,
|
|
28
|
+
locale: forceLocale ? new Intl.Locale(forceLocale) : locale,
|
|
29
29
|
});
|
|
30
30
|
},
|
|
31
31
|
};
|
|
@@ -13,10 +13,10 @@ export type HelperType<P, T> = (
|
|
|
13
13
|
export interface ProductVariationHelperTypes {
|
|
14
14
|
options: HelperType<
|
|
15
15
|
never,
|
|
16
|
-
|
|
16
|
+
{
|
|
17
17
|
_id: string;
|
|
18
18
|
productVariationOption: string;
|
|
19
|
-
}
|
|
19
|
+
}[]
|
|
20
20
|
>;
|
|
21
21
|
texts: HelperType<{ forceLocale?: string }, Promise<ProductVariationText>>;
|
|
22
22
|
}
|
|
@@ -28,11 +28,11 @@ export const ProductVariation: ProductVariationHelperTypes = {
|
|
|
28
28
|
}));
|
|
29
29
|
},
|
|
30
30
|
|
|
31
|
-
texts: async (obj, { forceLocale }, { modules,
|
|
32
|
-
// TODO: use loader
|
|
31
|
+
texts: async (obj, { forceLocale }, { modules, locale }) => {
|
|
32
|
+
// TODO: use variation text loader
|
|
33
33
|
return modules.products.variations.texts.findLocalizedVariationText({
|
|
34
34
|
productVariationId: obj._id,
|
|
35
|
-
locale: forceLocale
|
|
35
|
+
locale: forceLocale ? new Intl.Locale(forceLocale) : locale,
|
|
36
36
|
});
|
|
37
37
|
},
|
|
38
38
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Context } from '../../context.js';
|
|
2
2
|
import { SearchConfiguration } from '@unchainedshop/core-filters';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
export interface SearchResultData {
|
|
5
5
|
searchConfiguration: SearchConfiguration & { productSelector: any };
|
|
6
|
-
totalProductIds:
|
|
7
|
-
aggregatedTotalProductIds:
|
|
8
|
-
aggregatedFilteredProductIds:
|
|
9
|
-
}
|
|
6
|
+
totalProductIds: string[];
|
|
7
|
+
aggregatedTotalProductIds: string[];
|
|
8
|
+
aggregatedFilteredProductIds: string[];
|
|
9
|
+
}
|
|
10
10
|
|
|
11
11
|
export const ProductSearchResult = {
|
|
12
12
|
productsCount: async (
|
|
@@ -1,40 +1,26 @@
|
|
|
1
1
|
import { Quotation as QuotationType } from '@unchainedshop/core-quotations';
|
|
2
2
|
import { Context } from '../../context.js';
|
|
3
|
-
import { User } from '@unchainedshop/core-users';
|
|
4
|
-
import { Product } from '@unchainedshop/core-products';
|
|
5
|
-
import { Country } from '@unchainedshop/core-countries';
|
|
6
|
-
import { Currency } from '@unchainedshop/core-currencies';
|
|
7
3
|
|
|
8
|
-
|
|
4
|
+
export const Quotation = {
|
|
5
|
+
country: async (obj: QuotationType, _: never, { loaders }: Context) =>
|
|
6
|
+
loaders.countryLoader.load({ isoCode: obj.countryCode }),
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
currency: HelperType<never, Promise<Currency>>;
|
|
13
|
-
isExpired: HelperType<{ referenceDate: Date }, boolean>;
|
|
14
|
-
status: HelperType<never, string>;
|
|
15
|
-
product: HelperType<never, Promise<Product>>;
|
|
16
|
-
user: HelperType<never, Promise<User>>;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const Quotation: QuotationHelperTypes = {
|
|
20
|
-
// TODO: use loader
|
|
21
|
-
country: async (obj, _, { modules }) => modules.countries.findCountry({ isoCode: obj.countryCode }),
|
|
22
|
-
|
|
23
|
-
// TODO: use loader
|
|
24
|
-
currency: async (obj, _, { modules }) => modules.currencies.findCurrency({ isoCode: obj.currency }),
|
|
8
|
+
currency: async (obj: QuotationType, _: never, { loaders }: Context) =>
|
|
9
|
+
loaders.currencyLoader.load({ isoCode: obj.currencyCode }),
|
|
25
10
|
|
|
26
|
-
isExpired: (obj, { referenceDate }, { modules }) =>
|
|
11
|
+
isExpired: (obj: QuotationType, { referenceDate }: { referenceDate: Date }, { modules }: Context) =>
|
|
27
12
|
modules.quotations.isExpired(obj, { referenceDate }),
|
|
28
13
|
|
|
29
|
-
product: async (obj, _, { loaders }) => {
|
|
14
|
+
product: async (obj: QuotationType, _: never, { loaders }: Context) => {
|
|
30
15
|
const product = await loaders.productLoader.load({
|
|
31
16
|
productId: obj.productId,
|
|
32
17
|
});
|
|
33
18
|
return product;
|
|
34
19
|
},
|
|
35
20
|
|
|
36
|
-
status: (obj, _, { modules }) =>
|
|
21
|
+
status: (obj: QuotationType, _: never, { modules }: Context) =>
|
|
22
|
+
modules.quotations.normalizedStatus(obj),
|
|
37
23
|
|
|
38
|
-
|
|
39
|
-
|
|
24
|
+
user: async (obj: QuotationType, _: never, { loaders }: Context) =>
|
|
25
|
+
loaders.userLoader.load({ userId: obj.userId }),
|
|
40
26
|
};
|
|
@@ -10,7 +10,7 @@ export interface ShopHelperTypes {
|
|
|
10
10
|
_id: () => string;
|
|
11
11
|
country: HelperType<Country>;
|
|
12
12
|
language: HelperType<Language>;
|
|
13
|
-
userRoles: HelperType<
|
|
13
|
+
userRoles: HelperType<string[]>;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export const Shop: ShopHelperTypes = {
|
|
@@ -18,13 +18,11 @@ export const Shop: ShopHelperTypes = {
|
|
|
18
18
|
return 'root';
|
|
19
19
|
},
|
|
20
20
|
|
|
21
|
-
language: async (_root, _params, {
|
|
22
|
-
|
|
23
|
-
return modules.languages.findLanguage({ isoCode: localeContext.language });
|
|
21
|
+
language: async (_root, _params, { locale, loaders }) => {
|
|
22
|
+
return loaders.languageLoader.load({ isoCode: locale.language });
|
|
24
23
|
},
|
|
25
|
-
country: async (_root, _params, {
|
|
26
|
-
|
|
27
|
-
return modules.countries.findCountry({ isoCode: countryContext });
|
|
24
|
+
country: async (_root, _params, { countryCode, loaders }) => {
|
|
25
|
+
return loaders.countryLoader.load({ isoCode: countryCode });
|
|
28
26
|
},
|
|
29
27
|
|
|
30
28
|
userRoles: async (_root, _params, context) => {
|
|
@@ -6,22 +6,19 @@ import { actions } from '../../roles/index.js';
|
|
|
6
6
|
import { WarehousingDirector } from '@unchainedshop/core';
|
|
7
7
|
|
|
8
8
|
export const Token = {
|
|
9
|
-
product: async (token: TokenSurrogate, params: never, {
|
|
10
|
-
|
|
11
|
-
return modules.products.findProduct({ productId: token.productId });
|
|
9
|
+
product: async (token: TokenSurrogate, params: never, { loaders }: Context) => {
|
|
10
|
+
return loaders.productLoader.load({ productId: token.productId });
|
|
12
11
|
},
|
|
13
12
|
|
|
14
|
-
user: async (token: TokenSurrogate, params: never, {
|
|
13
|
+
user: async (token: TokenSurrogate, params: never, { loaders }: Context) => {
|
|
15
14
|
if (!token.userId) return null;
|
|
16
|
-
|
|
17
|
-
return modules.users.findUserById(token.userId);
|
|
15
|
+
return loaders.userLoader.load({ userId: token.userId });
|
|
18
16
|
},
|
|
19
17
|
|
|
20
18
|
status: async (token: TokenSurrogate, params: never, { modules }: Context) => {
|
|
21
19
|
if (token.walletAddress && !token.userId) {
|
|
22
20
|
return TokenStatus.DECENTRALIZED;
|
|
23
21
|
}
|
|
24
|
-
// TODO: use loader?
|
|
25
22
|
const workItems = await modules.worker.findWorkQueue({
|
|
26
23
|
types: ['EXPORT_TOKEN'],
|
|
27
24
|
status: [WorkStatus.NEW, WorkStatus.ALLOCATED],
|
|
@@ -35,37 +32,23 @@ export const Token = {
|
|
|
35
32
|
{ forceLocale }: { forceLocale: string },
|
|
36
33
|
context: Context,
|
|
37
34
|
) => {
|
|
38
|
-
const {
|
|
39
|
-
|
|
40
|
-
const product = await modules.products.findProduct({ productId: token.productId });
|
|
35
|
+
const { loaders, services } = context;
|
|
36
|
+
const product = await loaders.productLoader.load({ productId: token.productId });
|
|
41
37
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
return services.warehousing.ercMetadata({
|
|
39
|
+
product,
|
|
40
|
+
token,
|
|
41
|
+
locale: forceLocale ? new Intl.Locale(forceLocale) : context.locale,
|
|
45
42
|
});
|
|
46
|
-
|
|
47
|
-
return WarehousingDirector.tokenMetadata(
|
|
48
|
-
virtualProviders,
|
|
49
|
-
{
|
|
50
|
-
product,
|
|
51
|
-
token,
|
|
52
|
-
locale: forceLocale ? new Intl.Locale(forceLocale) : context.localeContext,
|
|
53
|
-
quantity: token?.quantity || 1,
|
|
54
|
-
referenceDate: new Date(),
|
|
55
|
-
},
|
|
56
|
-
context,
|
|
57
|
-
);
|
|
58
43
|
},
|
|
59
44
|
|
|
60
45
|
isInvalidateable: async (token: TokenSurrogate, _params: never, context: Context) => {
|
|
61
|
-
const {
|
|
62
|
-
|
|
63
|
-
const product = await modules.products.findProduct({ productId: token.productId });
|
|
46
|
+
const { loaders } = context;
|
|
47
|
+
const product = await loaders.productLoader.load({ productId: token.productId });
|
|
64
48
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
});
|
|
49
|
+
const virtualProviders = (await context.modules.warehousing.allProviders()).filter(
|
|
50
|
+
({ type }) => type === WarehousingProviderType.VIRTUAL,
|
|
51
|
+
);
|
|
69
52
|
|
|
70
53
|
const isInvalidateable = await WarehousingDirector.isInvalidateable(
|
|
71
54
|
virtualProviders,
|
|
@@ -44,62 +44,62 @@ export interface UserHelperTypes {
|
|
|
44
44
|
created: HelperType<any, Date>;
|
|
45
45
|
updated: HelperType<any, Date>;
|
|
46
46
|
deleted: HelperType<any, Date>;
|
|
47
|
-
avatar: HelperType<{
|
|
48
|
-
bookmarks: HelperType<any,
|
|
47
|
+
avatar: HelperType<{ locale: Intl.Locale }, File>;
|
|
48
|
+
bookmarks: HelperType<any, Bookmark[]>;
|
|
49
49
|
cart: HelperType<{ orderNumber?: string }, Order>;
|
|
50
|
-
country: HelperType<{
|
|
51
|
-
emails: HelperType<any,
|
|
50
|
+
country: HelperType<{ locale: Intl.Locale }, Country>;
|
|
51
|
+
emails: HelperType<any, string[]>;
|
|
52
52
|
enrollments: HelperType<
|
|
53
53
|
{
|
|
54
|
-
sort?:
|
|
54
|
+
sort?: SortOption[];
|
|
55
55
|
queryString?: string;
|
|
56
56
|
limit?: number;
|
|
57
57
|
offset?: number;
|
|
58
|
-
status?:
|
|
58
|
+
status?: EnrollmentStatus[];
|
|
59
59
|
},
|
|
60
|
-
|
|
60
|
+
Enrollment[]
|
|
61
61
|
>;
|
|
62
62
|
isGuest: HelperType<any, boolean>;
|
|
63
63
|
isInitialPassword: HelperType<any, boolean>;
|
|
64
|
-
language: HelperType<{
|
|
64
|
+
language: HelperType<{ locale: Intl.Locale }, Language>;
|
|
65
65
|
lastBillingAddress: HelperType<any, UserType['lastBillingAddress']>;
|
|
66
66
|
lastContact: HelperType<any, Contact>;
|
|
67
67
|
lastLogin: HelperType<any, UserType['lastLogin']>;
|
|
68
|
-
allowedActions: HelperType<any,
|
|
68
|
+
allowedActions: HelperType<any, string[]>;
|
|
69
69
|
name: HelperType<any, string>;
|
|
70
70
|
orders: HelperType<
|
|
71
71
|
{
|
|
72
72
|
includeCarts: boolean;
|
|
73
|
-
sort?:
|
|
73
|
+
sort?: SortOption[];
|
|
74
74
|
queryString?: string;
|
|
75
75
|
status?: OrderStatus[];
|
|
76
76
|
userId?: string;
|
|
77
77
|
limit?: number;
|
|
78
78
|
offset?: number;
|
|
79
79
|
},
|
|
80
|
-
|
|
80
|
+
Order[]
|
|
81
81
|
>;
|
|
82
|
-
paymentCredentials: HelperType<any,
|
|
83
|
-
tokens: HelperType<any,
|
|
84
|
-
webAuthnCredentials: HelperType<any,
|
|
85
|
-
web3Addresses: HelperType<any,
|
|
82
|
+
paymentCredentials: HelperType<any, PaymentCredentials[]>;
|
|
83
|
+
tokens: HelperType<any, TokenSurrogate[]>;
|
|
84
|
+
webAuthnCredentials: HelperType<any, WebAuthnCredentials[]>;
|
|
85
|
+
web3Addresses: HelperType<any, Web3Address[]>;
|
|
86
86
|
primaryEmail: HelperType<any, Email>;
|
|
87
87
|
profile: HelperType<any, UserProfile>;
|
|
88
88
|
quotations: HelperType<
|
|
89
|
-
{ sort?:
|
|
90
|
-
|
|
89
|
+
{ sort?: SortOption[]; queryString?: string; userId?: string; limit?: number; offset?: number },
|
|
90
|
+
Quotation[]
|
|
91
91
|
>;
|
|
92
|
-
roles: HelperType<any,
|
|
93
|
-
tags: HelperType<any,
|
|
92
|
+
roles: HelperType<any, string[]>;
|
|
93
|
+
tags: HelperType<any, string[]>;
|
|
94
94
|
username: HelperType<any, string>;
|
|
95
|
-
pushSubscriptions: HelperType<any,
|
|
95
|
+
pushSubscriptions: HelperType<any, PushSubscription[]>;
|
|
96
96
|
reviews: HelperType<
|
|
97
97
|
{
|
|
98
|
-
sort?:
|
|
98
|
+
sort?: SortOption[];
|
|
99
99
|
limit?: number;
|
|
100
100
|
offset?: number;
|
|
101
101
|
},
|
|
102
|
-
|
|
102
|
+
ProductReview[]
|
|
103
103
|
>;
|
|
104
104
|
reviewsCount: HelperType<any, number>;
|
|
105
105
|
}
|
|
@@ -170,15 +170,14 @@ export const User: UserHelperTypes = {
|
|
|
170
170
|
bookmarks: async (user, params, context) => {
|
|
171
171
|
await checkAction(context, viewUserPrivateInfos, [user, params]);
|
|
172
172
|
|
|
173
|
-
// TODO: use loader?
|
|
174
173
|
return context.modules.bookmarks.findBookmarksByUserId(user._id);
|
|
175
174
|
},
|
|
176
175
|
|
|
177
176
|
async cart(user, params, context) {
|
|
178
|
-
const { modules,
|
|
177
|
+
const { modules, countryCode } = context;
|
|
179
178
|
await checkAction(context, viewUserOrders, [user, params]);
|
|
180
179
|
return modules.orders.cart({
|
|
181
|
-
countryCode
|
|
180
|
+
countryCode,
|
|
182
181
|
orderNumber: params.orderNumber,
|
|
183
182
|
userId: user._id,
|
|
184
183
|
});
|
|
@@ -191,7 +190,6 @@ export const User: UserHelperTypes = {
|
|
|
191
190
|
return service.verified ? [service.address] : [];
|
|
192
191
|
}) || [];
|
|
193
192
|
|
|
194
|
-
// TODO: use loader?
|
|
195
193
|
return context.modules.warehousing.findTokensForUser({
|
|
196
194
|
userId: user._id,
|
|
197
195
|
walletAddresses,
|
|
@@ -202,16 +200,14 @@ export const User: UserHelperTypes = {
|
|
|
202
200
|
await checkAction(context, viewUserPrivateInfos, [user, params]);
|
|
203
201
|
const userLocale = context.modules.users.userLocale(user);
|
|
204
202
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
isoCode: userLocale.region?.toUpperCase(),
|
|
203
|
+
return context.loaders.countryLoader.load({
|
|
204
|
+
isoCode: userLocale.region,
|
|
208
205
|
});
|
|
209
206
|
},
|
|
210
207
|
|
|
211
208
|
async enrollments(user, params, context) {
|
|
212
209
|
await checkAction(context, viewUserEnrollments, [user, params]);
|
|
213
210
|
|
|
214
|
-
// TODO: use loader?
|
|
215
211
|
return context.modules.enrollments.findEnrollments({
|
|
216
212
|
...(params || {}),
|
|
217
213
|
userId: user._id,
|
|
@@ -221,11 +217,7 @@ export const User: UserHelperTypes = {
|
|
|
221
217
|
language: async (user, params, context) => {
|
|
222
218
|
await checkAction(context, viewUserPrivateInfos, [user, params]);
|
|
223
219
|
const userLocale = context.modules.users.userLocale(user);
|
|
224
|
-
|
|
225
|
-
// TODO: use loader
|
|
226
|
-
return context.modules.languages.findLanguage({
|
|
227
|
-
isoCode: userLocale.language,
|
|
228
|
-
});
|
|
220
|
+
return context.loaders.languageLoader.load({ isoCode: userLocale.language });
|
|
229
221
|
},
|
|
230
222
|
|
|
231
223
|
allowedActions: async (user, params, context) => {
|
|
@@ -238,7 +230,6 @@ export const User: UserHelperTypes = {
|
|
|
238
230
|
orders: async (user, params, context) => {
|
|
239
231
|
await checkAction(context, viewUserOrders, [user, params]);
|
|
240
232
|
|
|
241
|
-
// TODO: use loader?
|
|
242
233
|
return context.modules.orders.findOrders({
|
|
243
234
|
...(params || {}),
|
|
244
235
|
userId: user._id,
|
|
@@ -248,7 +239,6 @@ export const User: UserHelperTypes = {
|
|
|
248
239
|
paymentCredentials: async (user, params, context) => {
|
|
249
240
|
await checkAction(context, viewUserPrivateInfos, [user, params]);
|
|
250
241
|
|
|
251
|
-
// TODO: use loader?
|
|
252
242
|
return context.modules.payment.paymentCredentials.findPaymentCredentials(
|
|
253
243
|
{ ...params.selector, userId: user._id },
|
|
254
244
|
{
|
|
@@ -271,7 +261,6 @@ export const User: UserHelperTypes = {
|
|
|
271
261
|
quotations: async (user, params, context) => {
|
|
272
262
|
await checkAction(context, viewUserQuotations, [user, params]);
|
|
273
263
|
|
|
274
|
-
// TODO: use loader?
|
|
275
264
|
return context.modules.quotations.findQuotations({
|
|
276
265
|
...(params || {}),
|
|
277
266
|
userId: user._id,
|
|
@@ -290,7 +279,6 @@ export const User: UserHelperTypes = {
|
|
|
290
279
|
const { modules } = context;
|
|
291
280
|
await checkAction(context, viewUserProductReviews, [user, params]);
|
|
292
281
|
|
|
293
|
-
// TODO: use loader?
|
|
294
282
|
return modules.products.reviews.findProductReviews({
|
|
295
283
|
...(params || {}),
|
|
296
284
|
authorId: user._id,
|
package/src/roles/all.ts
CHANGED
package/src/schema/mutation.ts
CHANGED
|
@@ -2,7 +2,7 @@ export default [
|
|
|
2
2
|
/* GraphQL */ `
|
|
3
3
|
type AssortmentMediaTexts @cacheControl(maxAge: 180) {
|
|
4
4
|
_id: ID!
|
|
5
|
-
locale: Locale
|
|
5
|
+
locale: Locale!
|
|
6
6
|
title: String
|
|
7
7
|
subtitle: String
|
|
8
8
|
}
|
|
@@ -12,7 +12,7 @@ export default [
|
|
|
12
12
|
tags: [LowerCaseString!]
|
|
13
13
|
file: Media
|
|
14
14
|
sortKey: Int!
|
|
15
|
-
texts(forceLocale:
|
|
15
|
+
texts(forceLocale: Locale): AssortmentMediaTexts
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
"""
|
|
@@ -29,7 +29,7 @@ export default [
|
|
|
29
29
|
sequence: Int!
|
|
30
30
|
tags: [LowerCaseString!]
|
|
31
31
|
media(limit: Int = 10, offset: Int = 0, tags: [LowerCaseString!]): [AssortmentMedia!]!
|
|
32
|
-
texts(forceLocale:
|
|
32
|
+
texts(forceLocale: Locale): AssortmentTexts
|
|
33
33
|
productAssignments: [AssortmentProduct!]
|
|
34
34
|
filterAssignments: [AssortmentFilter!]
|
|
35
35
|
linkedAssortments: [AssortmentLink!]
|
|
@@ -59,7 +59,7 @@ export default [
|
|
|
59
59
|
"""
|
|
60
60
|
type AssortmentPathLink @cacheControl(maxAge: 180) {
|
|
61
61
|
assortmentId: ID!
|
|
62
|
-
assortmentTexts(forceLocale:
|
|
62
|
+
assortmentTexts(forceLocale: Locale): AssortmentTexts!
|
|
63
63
|
link: AssortmentLink
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -89,7 +89,7 @@ export default [
|
|
|
89
89
|
|
|
90
90
|
type AssortmentTexts @cacheControl(maxAge: 180) {
|
|
91
91
|
_id: ID!
|
|
92
|
-
locale: Locale
|
|
92
|
+
locale: Locale!
|
|
93
93
|
slug: String
|
|
94
94
|
title: String
|
|
95
95
|
subtitle: String
|
|
@@ -35,8 +35,12 @@ export default [
|
|
|
35
35
|
configuration: JSON
|
|
36
36
|
configurationError: DeliveryProviderError
|
|
37
37
|
isActive: Boolean
|
|
38
|
-
simulatedPrice(
|
|
39
|
-
|
|
38
|
+
simulatedPrice(
|
|
39
|
+
currencyCode: String
|
|
40
|
+
useNetPrice: Boolean = false
|
|
41
|
+
orderId: ID
|
|
42
|
+
context: JSON
|
|
43
|
+
): Price @cacheControl(scope: PRIVATE, maxAge: 10)
|
|
40
44
|
}
|
|
41
45
|
`,
|
|
42
46
|
];
|
|
@@ -24,14 +24,14 @@ export default [
|
|
|
24
24
|
|
|
25
25
|
type FilterTexts @cacheControl(maxAge: 180) {
|
|
26
26
|
_id: ID!
|
|
27
|
-
locale: Locale
|
|
27
|
+
locale: Locale!
|
|
28
28
|
title: String
|
|
29
29
|
subtitle: String
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
type FilterOption @cacheControl(maxAge: 180) {
|
|
33
33
|
_id: ID!
|
|
34
|
-
texts(forceLocale:
|
|
34
|
+
texts(forceLocale: Locale): FilterTexts
|
|
35
35
|
value: String
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -40,7 +40,7 @@ export default [
|
|
|
40
40
|
updated: DateTime
|
|
41
41
|
created: DateTime
|
|
42
42
|
isActive: Boolean
|
|
43
|
-
texts(forceLocale:
|
|
43
|
+
texts(forceLocale: Locale): FilterTexts
|
|
44
44
|
type: FilterType
|
|
45
45
|
key: String
|
|
46
46
|
options: [FilterOption!]
|
|
@@ -50,8 +50,12 @@ export default [
|
|
|
50
50
|
configuration: JSON
|
|
51
51
|
configurationError: PaymentProviderError
|
|
52
52
|
isActive: Boolean
|
|
53
|
-
simulatedPrice(
|
|
54
|
-
|
|
53
|
+
simulatedPrice(
|
|
54
|
+
currencyCode: String
|
|
55
|
+
useNetPrice: Boolean = false
|
|
56
|
+
orderId: ID
|
|
57
|
+
context: JSON
|
|
58
|
+
): Price @cacheControl(scope: PRIVATE, maxAge: 10)
|
|
55
59
|
}
|
|
56
60
|
`,
|
|
57
61
|
];
|
|
@@ -12,7 +12,7 @@ export default [
|
|
|
12
12
|
updated: DateTime
|
|
13
13
|
published: DateTime
|
|
14
14
|
media(limit: Int = 10, offset: Int = 0, tags: [LowerCaseString!]): [ProductMedia!]!
|
|
15
|
-
texts(forceLocale:
|
|
15
|
+
texts(forceLocale: Locale): ProductTexts
|
|
16
16
|
bundleItems: [ProductBundleItem!]
|
|
17
17
|
reviews(
|
|
18
18
|
limit: Int = 10
|