@unchainedshop/api 3.1.13 → 4.0.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api-index.d.ts.map +1 -1
- package/lib/api-index.js +4 -1
- package/lib/api-index.js.map +1 -1
- package/lib/context.d.ts +2 -2
- package/lib/context.d.ts.map +1 -1
- package/lib/context.js +1 -1
- package/lib/context.js.map +1 -1
- package/lib/createGraphQLServer.d.ts +2 -2
- package/lib/createGraphQLServer.d.ts.map +1 -1
- package/lib/errors.d.ts +2 -1
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +2 -1
- package/lib/errors.js.map +1 -1
- package/lib/express/createBulkImportMiddleware copy.d.ts +6 -0
- package/lib/express/createBulkImportMiddleware copy.d.ts.map +1 -0
- package/lib/express/createBulkImportMiddleware copy.js +49 -0
- package/lib/express/createBulkImportMiddleware copy.js.map +1 -0
- package/lib/express/createERCMetadataMiddleware.d.ts.map +1 -1
- package/lib/express/createERCMetadataMiddleware.js +9 -5
- package/lib/express/createERCMetadataMiddleware.js.map +1 -1
- package/lib/express/createMCPMiddleware.d.ts.map +1 -1
- package/lib/express/createMCPMiddleware.js +12 -3
- package/lib/express/createMCPMiddleware.js.map +1 -1
- package/lib/express/createTempUploadMiddleware.d.ts +7 -0
- package/lib/express/createTempUploadMiddleware.d.ts.map +1 -0
- package/lib/express/createTempUploadMiddleware.js +48 -0
- package/lib/express/createTempUploadMiddleware.js.map +1 -0
- package/lib/express/index.d.ts.map +1 -1
- package/lib/express/index.js +17 -6
- package/lib/express/index.js.map +1 -1
- package/lib/express/setupMCPChatHandler.d.ts +3 -0
- package/lib/express/setupMCPChatHandler.d.ts.map +1 -0
- package/lib/express/setupMCPChatHandler.js +57 -0
- package/lib/express/setupMCPChatHandler.js.map +1 -0
- package/lib/fastify/ercMetadataHandler.d.ts.map +1 -1
- package/lib/fastify/ercMetadataHandler.js +9 -5
- package/lib/fastify/ercMetadataHandler.js.map +1 -1
- package/lib/fastify/index.d.ts.map +1 -1
- package/lib/fastify/index.js +24 -5
- package/lib/fastify/index.js.map +1 -1
- package/lib/fastify/mcpChatHandler.d.ts +3 -0
- package/lib/fastify/mcpChatHandler.d.ts.map +1 -0
- package/lib/fastify/mcpChatHandler.js +60 -0
- package/lib/fastify/mcpChatHandler.js.map +1 -0
- package/lib/fastify/mcpHandler copy.d.ts +4 -0
- package/lib/fastify/mcpHandler copy.d.ts.map +1 -0
- package/lib/fastify/mcpHandler copy.js +72 -0
- package/lib/fastify/mcpHandler copy.js.map +1 -0
- package/lib/fastify/mcpHandler.d.ts +4 -0
- package/lib/fastify/mcpHandler.d.ts.map +1 -0
- package/lib/fastify/mcpHandler.js +78 -0
- package/lib/fastify/mcpHandler.js.map +1 -0
- package/lib/fastify/tempUploadHandler.d.ts +4 -0
- package/lib/fastify/tempUploadHandler.d.ts.map +1 -0
- package/lib/fastify/tempUploadHandler.js +41 -0
- package/lib/fastify/tempUploadHandler.js.map +1 -0
- package/lib/loaders/buildLocaleMap.d.ts +4 -4
- package/lib/loaders/buildLocaleMap.d.ts.map +1 -1
- package/lib/loaders/buildLocaleMap.js +34 -5
- package/lib/loaders/buildLocaleMap.js.map +1 -1
- package/lib/loaders/buildTextMap.d.ts +2 -2
- package/lib/loaders/buildTextMap.d.ts.map +1 -1
- package/lib/loaders/buildTextMap.js +3 -0
- package/lib/loaders/buildTextMap.js.map +1 -1
- package/lib/loaders/index.d.ts +79 -49
- package/lib/loaders/index.d.ts.map +1 -1
- package/lib/loaders/index.js +47 -240
- package/lib/loaders/index.js.map +1 -1
- package/lib/locale-context.d.ts +3 -3
- package/lib/locale-context.d.ts.map +1 -1
- package/lib/locale-context.js +9 -10
- package/lib/locale-context.js.map +1 -1
- package/lib/mcp/index.d.ts +1 -1
- package/lib/mcp/index.d.ts.map +1 -1
- package/lib/mcp/index.js +38 -2
- package/lib/mcp/index.js.map +1 -1
- package/lib/mcp/tools/addProductAssignmentHandler.js.map +1 -1
- package/lib/mcp/tools/addProductMediaUploadHandler.d.ts +28 -0
- package/lib/mcp/tools/addProductMediaUploadHandler.d.ts.map +1 -0
- package/lib/mcp/tools/addProductMediaUploadHandler.js +62 -0
- package/lib/mcp/tools/addProductMediaUploadHandler.js.map +1 -0
- package/lib/mcp/tools/createLanguageHandler.d.ts +36 -0
- package/lib/mcp/tools/createLanguageHandler.d.ts.map +1 -0
- package/lib/mcp/tools/createLanguageHandler.js +39 -0
- package/lib/mcp/tools/createLanguageHandler.js.map +1 -0
- package/lib/mcp/tools/createProductVariationHandler.d.ts +2 -2
- package/lib/mcp/tools/createProductVariationHandler.d.ts.map +1 -1
- package/lib/mcp/tools/createProductVariationHandler.js +10 -4
- package/lib/mcp/tools/createProductVariationHandler.js.map +1 -1
- package/lib/mcp/tools/createProductVariationOptionHandler.d.ts +60 -0
- package/lib/mcp/tools/createProductVariationOptionHandler.d.ts.map +1 -0
- package/lib/mcp/tools/createProductVariationOptionHandler.js +59 -0
- package/lib/mcp/tools/createProductVariationOptionHandler.js.map +1 -0
- package/lib/mcp/tools/getProduct.d.ts.map +1 -1
- package/lib/mcp/tools/getProduct.js +2 -45
- package/lib/mcp/tools/getProduct.js.map +1 -1
- package/lib/mcp/tools/index.d.ts +33 -0
- package/lib/mcp/tools/index.d.ts.map +1 -1
- package/lib/mcp/tools/index.js +33 -0
- package/lib/mcp/tools/index.js.map +1 -1
- package/lib/mcp/tools/listProducts.d.ts.map +1 -1
- package/lib/mcp/tools/listProducts.js +29 -17
- package/lib/mcp/tools/listProducts.js.map +1 -1
- package/lib/mcp/tools/productReviewsCountHandler.d.ts +20 -0
- package/lib/mcp/tools/productReviewsCountHandler.d.ts.map +1 -0
- package/lib/mcp/tools/productReviewsCountHandler.js +30 -0
- package/lib/mcp/tools/productReviewsCountHandler.js.map +1 -0
- package/lib/mcp/tools/productReviewsHandler.d.ts +56 -0
- package/lib/mcp/tools/productReviewsHandler.d.ts.map +1 -0
- package/lib/mcp/tools/productReviewsHandler.js +45 -0
- package/lib/mcp/tools/productReviewsHandler.js.map +1 -0
- package/lib/mcp/tools/removeLanguageHandler.d.ts +20 -0
- package/lib/mcp/tools/removeLanguageHandler.d.ts.map +1 -0
- package/lib/mcp/tools/removeLanguageHandler.js +35 -0
- package/lib/mcp/tools/removeLanguageHandler.js.map +1 -0
- package/lib/mcp/tools/removeProductAssignmentHandler.d.ts +48 -0
- package/lib/mcp/tools/removeProductAssignmentHandler.d.ts.map +1 -0
- package/lib/mcp/tools/removeProductAssignmentHandler.js +51 -0
- package/lib/mcp/tools/removeProductAssignmentHandler.js.map +1 -0
- package/lib/mcp/tools/removeProductHandler.d.ts +20 -0
- package/lib/mcp/tools/removeProductHandler.d.ts.map +1 -0
- package/lib/mcp/tools/removeProductHandler.js +34 -0
- package/lib/mcp/tools/removeProductHandler.js.map +1 -0
- package/lib/mcp/tools/removeProductMediaHandler.d.ts +20 -0
- package/lib/mcp/tools/removeProductMediaHandler.d.ts.map +1 -0
- package/lib/mcp/tools/removeProductMediaHandler.js +42 -0
- package/lib/mcp/tools/removeProductMediaHandler.js.map +1 -0
- package/lib/mcp/tools/removeProductVariationOptionHandler.d.ts +24 -0
- package/lib/mcp/tools/removeProductVariationOptionHandler.d.ts.map +1 -0
- package/lib/mcp/tools/removeProductVariationOptionHandler.js +47 -0
- package/lib/mcp/tools/removeProductVariationOptionHandler.js.map +1 -0
- package/lib/mcp/tools/reorderProductMediaHandler.d.ts +44 -0
- package/lib/mcp/tools/reorderProductMediaHandler.d.ts.map +1 -0
- package/lib/mcp/tools/reorderProductMediaHandler.js +39 -0
- package/lib/mcp/tools/reorderProductMediaHandler.js.map +1 -0
- package/lib/mcp/tools/updateLanguageHandler.d.ts +48 -0
- package/lib/mcp/tools/updateLanguageHandler.d.ts.map +1 -0
- package/lib/mcp/tools/updateLanguageHandler.js +40 -0
- package/lib/mcp/tools/updateLanguageHandler.js.map +1 -0
- package/lib/mcp/tools/updateProductMediaTextsHandler.d.ts +56 -0
- package/lib/mcp/tools/updateProductMediaTextsHandler.d.ts.map +1 -0
- package/lib/mcp/tools/updateProductMediaTextsHandler.js +45 -0
- package/lib/mcp/tools/updateProductMediaTextsHandler.js.map +1 -0
- package/lib/mcp/utils/getNormalizedProductDetails.d.ts.map +1 -1
- package/lib/mcp/utils/getNormalizedProductDetails.js +2 -0
- package/lib/mcp/utils/getNormalizedProductDetails.js.map +1 -1
- package/lib/resolvers/mutations/accounts/createUser.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/createUser.js +4 -5
- package/lib/resolvers/mutations/accounts/createUser.js.map +1 -1
- package/lib/resolvers/mutations/accounts/impersonate.js +1 -1
- package/lib/resolvers/mutations/accounts/impersonate.js.map +1 -1
- package/lib/resolvers/mutations/accounts/loginAsGuest.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/loginAsGuest.js +4 -5
- package/lib/resolvers/mutations/accounts/loginAsGuest.js.map +1 -1
- package/lib/resolvers/mutations/accounts/loginWithPassword.js +3 -3
- package/lib/resolvers/mutations/accounts/loginWithPassword.js.map +1 -1
- package/lib/resolvers/mutations/accounts/loginWithWebAuthn.js +3 -3
- package/lib/resolvers/mutations/accounts/loginWithWebAuthn.js.map +1 -1
- package/lib/resolvers/mutations/accounts/resetPassword.js +3 -3
- package/lib/resolvers/mutations/accounts/resetPassword.js.map +1 -1
- package/lib/resolvers/mutations/accounts/stopImpersonation.js +1 -1
- package/lib/resolvers/mutations/accounts/stopImpersonation.js.map +1 -1
- package/lib/resolvers/mutations/accounts/verifyEmail.js +3 -3
- package/lib/resolvers/mutations/accounts/verifyEmail.js.map +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentFilters.d.ts +2 -2
- package/lib/resolvers/mutations/assortments/reorderAssortmentFilters.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentFilters.js.map +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentLinks.d.ts +2 -2
- package/lib/resolvers/mutations/assortments/reorderAssortmentLinks.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentLinks.js.map +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentMedia.d.ts +2 -2
- package/lib/resolvers/mutations/assortments/reorderAssortmentMedia.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentMedia.js.map +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentProducts.d.ts +2 -2
- package/lib/resolvers/mutations/assortments/reorderAssortmentProducts.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentProducts.js.map +1 -1
- package/lib/resolvers/mutations/assortments/updateAssortmentMediaTexts.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/updateAssortmentMediaTexts.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/updateAssortmentMediaTexts.js.map +1 -1
- package/lib/resolvers/mutations/assortments/updateAssortmentTexts.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/updateAssortmentTexts.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/updateAssortmentTexts.js.map +1 -1
- package/lib/resolvers/mutations/enrollments/createEnrollment.js +3 -3
- package/lib/resolvers/mutations/enrollments/createEnrollment.js.map +1 -1
- package/lib/resolvers/mutations/enrollments/updateEnrollment.d.ts +2 -2
- package/lib/resolvers/mutations/enrollments/updateEnrollment.d.ts.map +1 -1
- package/lib/resolvers/mutations/filters/createFilter.d.ts.map +1 -1
- package/lib/resolvers/mutations/filters/createFilter.js +2 -6
- package/lib/resolvers/mutations/filters/createFilter.js.map +1 -1
- package/lib/resolvers/mutations/filters/updateFilterTexts.d.ts +2 -2
- package/lib/resolvers/mutations/filters/updateFilterTexts.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/addCartDiscount.js +1 -1
- package/lib/resolvers/mutations/orders/addCartDiscount.js.map +1 -1
- package/lib/resolvers/mutations/orders/addCartProduct.js +1 -1
- package/lib/resolvers/mutations/orders/addCartProduct.js.map +1 -1
- package/lib/resolvers/mutations/orders/addCartQuotation.d.ts +2 -2
- package/lib/resolvers/mutations/orders/addCartQuotation.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/addCartQuotation.js +1 -1
- package/lib/resolvers/mutations/orders/addCartQuotation.js.map +1 -1
- package/lib/resolvers/mutations/orders/addMultipleCartProducts.d.ts +4 -4
- package/lib/resolvers/mutations/orders/addMultipleCartProducts.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/addMultipleCartProducts.js +1 -1
- package/lib/resolvers/mutations/orders/addMultipleCartProducts.js.map +1 -1
- package/lib/resolvers/mutations/orders/checkoutCart.js +1 -1
- package/lib/resolvers/mutations/orders/checkoutCart.js.map +1 -1
- package/lib/resolvers/mutations/orders/createCart.js +1 -1
- package/lib/resolvers/mutations/orders/createCart.js.map +1 -1
- package/lib/resolvers/mutations/orders/emptyCart.js +1 -1
- package/lib/resolvers/mutations/orders/emptyCart.js.map +1 -1
- package/lib/resolvers/mutations/orders/signPaymentProviderForCheckout.js +1 -1
- package/lib/resolvers/mutations/orders/signPaymentProviderForCheckout.js.map +1 -1
- package/lib/resolvers/mutations/orders/updateCart.js +1 -1
- package/lib/resolvers/mutations/orders/updateCart.js.map +1 -1
- package/lib/resolvers/mutations/orders/updateCartItem.d.ts +2 -2
- package/lib/resolvers/mutations/orders/updateCartItem.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/addProductAssignment.d.ts +1 -1
- package/lib/resolvers/mutations/products/addProductAssignment.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/addProductAssignment.js +35 -2
- package/lib/resolvers/mutations/products/addProductAssignment.js.map +1 -1
- package/lib/resolvers/mutations/products/createProductVariation.d.ts +2 -2
- package/lib/resolvers/mutations/products/createProductVariation.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/createProductVariation.js.map +1 -1
- package/lib/resolvers/mutations/products/removeProductAssignment.d.ts +1 -1
- package/lib/resolvers/mutations/products/removeProductAssignment.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/removeProductAssignment.js.map +1 -1
- package/lib/resolvers/mutations/products/reorderProductMedia.d.ts +2 -2
- package/lib/resolvers/mutations/products/reorderProductMedia.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/reorderProductMedia.js.map +1 -1
- package/lib/resolvers/mutations/products/updateProductMediaTexts.d.ts +1 -1
- package/lib/resolvers/mutations/products/updateProductMediaTexts.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/updateProductMediaTexts.js.map +1 -1
- package/lib/resolvers/mutations/products/updateProductVariationTexts.d.ts +1 -1
- package/lib/resolvers/mutations/products/updateProductVariationTexts.d.ts.map +1 -1
- package/lib/resolvers/mutations/quotations/requestQuotation.d.ts +2 -2
- package/lib/resolvers/mutations/quotations/requestQuotation.d.ts.map +1 -1
- package/lib/resolvers/mutations/quotations/requestQuotation.js +3 -3
- package/lib/resolvers/mutations/quotations/requestQuotation.js.map +1 -1
- package/lib/resolvers/mutations/users/heartbeat.d.ts +1 -1
- package/lib/resolvers/mutations/users/heartbeat.d.ts.map +1 -1
- package/lib/resolvers/mutations/users/heartbeat.js +3 -3
- package/lib/resolvers/mutations/users/heartbeat.js.map +1 -1
- package/lib/resolvers/mutations/users/setRoles.d.ts +1 -1
- package/lib/resolvers/mutations/users/setRoles.d.ts.map +1 -1
- package/lib/resolvers/mutations/users/setRoles.js.map +1 -1
- package/lib/resolvers/mutations/users/setUserTags.d.ts +1 -1
- package/lib/resolvers/mutations/users/setUserTags.d.ts.map +1 -1
- package/lib/resolvers/mutations/users/setUserTags.js.map +1 -1
- package/lib/resolvers/mutations/warehousing/invalidateToken.js +1 -3
- package/lib/resolvers/mutations/warehousing/invalidateToken.js.map +1 -1
- package/lib/resolvers/mutations/worker/allocateWork.d.ts +1 -1
- package/lib/resolvers/mutations/worker/allocateWork.d.ts.map +1 -1
- package/lib/resolvers/mutations/worker/allocateWork.js.map +1 -1
- package/lib/resolvers/queries/assortments/assortments.d.ts +1 -1
- package/lib/resolvers/queries/assortments/assortments.d.ts.map +1 -1
- package/lib/resolvers/queries/countries/countries.d.ts +1 -1
- package/lib/resolvers/queries/countries/countries.d.ts.map +1 -1
- package/lib/resolvers/queries/countries/countries.js.map +1 -1
- package/lib/resolvers/queries/currencies/currencies.d.ts +1 -1
- package/lib/resolvers/queries/currencies/currencies.d.ts.map +1 -1
- package/lib/resolvers/queries/currencies/currencies.js.map +1 -1
- package/lib/resolvers/queries/enrollments/enrollments.d.ts +1 -1
- package/lib/resolvers/queries/enrollments/enrollments.d.ts.map +1 -1
- package/lib/resolvers/queries/filters/filters.d.ts +1 -1
- package/lib/resolvers/queries/filters/filters.d.ts.map +1 -1
- package/lib/resolvers/queries/filters/searchAssortments.d.ts.map +1 -1
- package/lib/resolvers/queries/filters/searchAssortments.js +2 -7
- package/lib/resolvers/queries/filters/searchAssortments.js.map +1 -1
- package/lib/resolvers/queries/filters/searchProducts.d.ts.map +1 -1
- package/lib/resolvers/queries/filters/searchProducts.js +3 -8
- package/lib/resolvers/queries/filters/searchProducts.js.map +1 -1
- package/lib/resolvers/queries/languages/languages.d.ts +1 -1
- package/lib/resolvers/queries/languages/languages.d.ts.map +1 -1
- package/lib/resolvers/queries/languages/languages.js.map +1 -1
- package/lib/resolvers/queries/orders/orders.d.ts +1 -1
- package/lib/resolvers/queries/orders/orders.d.ts.map +1 -1
- package/lib/resolvers/queries/orders/orders.js.map +1 -1
- package/lib/resolvers/queries/products/productReviews.d.ts +1 -1
- package/lib/resolvers/queries/products/productReviews.d.ts.map +1 -1
- package/lib/resolvers/queries/products/products.d.ts +1 -1
- package/lib/resolvers/queries/products/products.d.ts.map +1 -1
- package/lib/resolvers/queries/quotations/quotations.d.ts +1 -1
- package/lib/resolvers/queries/quotations/quotations.d.ts.map +1 -1
- package/lib/resolvers/queries/quotations/quotations.js.map +1 -1
- package/lib/resolvers/queries/users/impersonator.d.ts.map +1 -1
- package/lib/resolvers/queries/users/impersonator.js +1 -1
- package/lib/resolvers/queries/users/impersonator.js.map +1 -1
- package/lib/resolvers/queries/users/user.d.ts.map +1 -1
- package/lib/resolvers/queries/users/user.js.map +1 -1
- package/lib/resolvers/queries/users/users.d.ts +1 -1
- package/lib/resolvers/queries/users/users.d.ts.map +1 -1
- package/lib/resolvers/queries/worker/workQueue.d.ts +3 -3
- package/lib/resolvers/queries/worker/workQueue.d.ts.map +1 -1
- package/lib/resolvers/type/assortment/assortment-filter-types.d.ts +4 -8
- package/lib/resolvers/type/assortment/assortment-filter-types.d.ts.map +1 -1
- package/lib/resolvers/type/assortment/assortment-filter-types.js +4 -6
- package/lib/resolvers/type/assortment/assortment-filter-types.js.map +1 -1
- package/lib/resolvers/type/assortment/assortment-link-types.d.ts +2 -2
- package/lib/resolvers/type/assortment/assortment-link-types.d.ts.map +1 -1
- package/lib/resolvers/type/assortment/assortment-media-types.js +2 -2
- package/lib/resolvers/type/assortment/assortment-media-types.js.map +1 -1
- package/lib/resolvers/type/assortment/assortment-path-link-types.d.ts +2 -2
- package/lib/resolvers/type/assortment/assortment-path-link-types.d.ts.map +1 -1
- package/lib/resolvers/type/assortment/assortment-path-link-types.js +2 -2
- package/lib/resolvers/type/assortment/assortment-path-link-types.js.map +1 -1
- package/lib/resolvers/type/assortment/assortment-product-types.d.ts +2 -2
- package/lib/resolvers/type/assortment/assortment-product-types.d.ts.map +1 -1
- package/lib/resolvers/type/assortment/assortment-types.d.ts +2 -2
- package/lib/resolvers/type/assortment/assortment-types.d.ts.map +1 -1
- package/lib/resolvers/type/assortment/assortment-types.js +5 -5
- package/lib/resolvers/type/assortment/assortment-types.js.map +1 -1
- package/lib/resolvers/type/bookmark-types.d.ts.map +1 -1
- package/lib/resolvers/type/bookmark-types.js +2 -3
- package/lib/resolvers/type/bookmark-types.js.map +1 -1
- package/lib/resolvers/type/country-types.d.ts +1 -1
- package/lib/resolvers/type/country-types.d.ts.map +1 -1
- package/lib/resolvers/type/country-types.js +4 -7
- package/lib/resolvers/type/country-types.js.map +1 -1
- package/lib/resolvers/type/delivery-provider-types.d.ts +10 -13
- package/lib/resolvers/type/delivery-provider-types.d.ts.map +1 -1
- package/lib/resolvers/type/delivery-provider-types.js +8 -9
- package/lib/resolvers/type/delivery-provider-types.js.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-delivery-types.d.ts +2 -6
- package/lib/resolvers/type/enrollment/enrollment-delivery-types.d.ts.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-delivery-types.js +4 -3
- package/lib/resolvers/type/enrollment/enrollment-delivery-types.js.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-payment-types.d.ts +2 -6
- package/lib/resolvers/type/enrollment/enrollment-payment-types.d.ts.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-payment-types.js +2 -3
- package/lib/resolvers/type/enrollment/enrollment-payment-types.js.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-period-types.d.ts +2 -6
- package/lib/resolvers/type/enrollment/enrollment-period-types.d.ts.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-period-types.js +2 -3
- package/lib/resolvers/type/enrollment/enrollment-period-types.js.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-plan-tyes.d.ts +2 -6
- package/lib/resolvers/type/enrollment/enrollment-plan-tyes.d.ts.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-plan-tyes.js +2 -3
- package/lib/resolvers/type/enrollment/enrollment-plan-tyes.js.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-types.d.ts +15 -14
- package/lib/resolvers/type/enrollment/enrollment-types.d.ts.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-types.js +3 -6
- package/lib/resolvers/type/enrollment/enrollment-types.js.map +1 -1
- package/lib/resolvers/type/filter/filter-option-types.d.ts +6 -9
- package/lib/resolvers/type/filter/filter-option-types.d.ts.map +1 -1
- package/lib/resolvers/type/filter/filter-option-types.js +2 -3
- package/lib/resolvers/type/filter/filter-option-types.js.map +1 -1
- package/lib/resolvers/type/filter/filter-types.d.ts +16 -8
- package/lib/resolvers/type/filter/filter-types.d.ts.map +1 -1
- package/lib/resolvers/type/filter/filter-types.js +2 -3
- package/lib/resolvers/type/filter/filter-types.js.map +1 -1
- package/lib/resolvers/type/filter/loaded-filter-types.d.ts +2 -3
- package/lib/resolvers/type/filter/loaded-filter-types.d.ts.map +1 -1
- package/lib/resolvers/type/index.d.ts +273 -261
- package/lib/resolvers/type/index.d.ts.map +1 -1
- package/lib/resolvers/type/login-method-response-types.js +1 -1
- package/lib/resolvers/type/login-method-response-types.js.map +1 -1
- package/lib/resolvers/type/order/order-delivery-discount-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-delivery-discount-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-delivery-discount-types.js +1 -2
- package/lib/resolvers/type/order/order-delivery-discount-types.js.map +1 -1
- package/lib/resolvers/type/order/order-delivery-pickup-types.d.ts +13 -12
- package/lib/resolvers/type/order/order-delivery-pickup-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-delivery-pickup-types.js +10 -14
- package/lib/resolvers/type/order/order-delivery-pickup-types.js.map +1 -1
- package/lib/resolvers/type/order/order-delivery-shipping-types.d.ts +12 -12
- package/lib/resolvers/type/order/order-delivery-shipping-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-delivery-shipping-types.js +7 -10
- package/lib/resolvers/type/order/order-delivery-shipping-types.js.map +1 -1
- package/lib/resolvers/type/order/order-delivery-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-delivery-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-delivery-types.js +2 -3
- package/lib/resolvers/type/order/order-delivery-types.js.map +1 -1
- package/lib/resolvers/type/order/order-discount-types.d.ts +11 -13
- package/lib/resolvers/type/order/order-discount-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-discount-types.js +9 -16
- package/lib/resolvers/type/order/order-discount-types.js.map +1 -1
- package/lib/resolvers/type/order/order-global-discount-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-global-discount-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-global-discount-types.js +1 -2
- package/lib/resolvers/type/order/order-global-discount-types.js.map +1 -1
- package/lib/resolvers/type/order/order-item-discount-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-item-discount-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-item-discount-types.js +1 -2
- package/lib/resolvers/type/order/order-item-discount-types.js.map +1 -1
- package/lib/resolvers/type/order/order-item-types.d.ts +5 -5
- package/lib/resolvers/type/order/order-item-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-item-types.js +14 -17
- package/lib/resolvers/type/order/order-item-types.js.map +1 -1
- package/lib/resolvers/type/order/order-payment-card-types.d.ts +11 -10
- package/lib/resolvers/type/order/order-payment-card-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-payment-card-types.js +6 -9
- package/lib/resolvers/type/order/order-payment-card-types.js.map +1 -1
- package/lib/resolvers/type/order/order-payment-discount-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-payment-discount-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-payment-discount-types.js +2 -4
- package/lib/resolvers/type/order/order-payment-discount-types.js.map +1 -1
- package/lib/resolvers/type/order/order-payment-generic-types.d.ts +11 -10
- package/lib/resolvers/type/order/order-payment-generic-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-payment-generic-types.js +6 -9
- package/lib/resolvers/type/order/order-payment-generic-types.js.map +1 -1
- package/lib/resolvers/type/order/order-payment-invoice-types.d.ts +11 -10
- package/lib/resolvers/type/order/order-payment-invoice-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-payment-invoice-types.js +6 -9
- package/lib/resolvers/type/order/order-payment-invoice-types.js.map +1 -1
- package/lib/resolvers/type/order/order-payment-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-payment-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-payment-types.js +2 -3
- package/lib/resolvers/type/order/order-payment-types.js.map +1 -1
- package/lib/resolvers/type/order/order-types.d.ts +6 -6
- package/lib/resolvers/type/order/order-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-types.js +7 -15
- package/lib/resolvers/type/order/order-types.js.map +1 -1
- package/lib/resolvers/type/payment/payment-credentials-types.d.ts.map +1 -1
- package/lib/resolvers/type/payment/payment-credentials-types.js +6 -9
- package/lib/resolvers/type/payment/payment-credentials-types.js.map +1 -1
- package/lib/resolvers/type/payment/payment-provider-types.d.ts +2 -2
- package/lib/resolvers/type/payment/payment-provider-types.d.ts.map +1 -1
- package/lib/resolvers/type/payment/payment-provider-types.js +8 -9
- package/lib/resolvers/type/payment/payment-provider-types.js.map +1 -1
- package/lib/resolvers/type/price-types.d.ts +3 -4
- package/lib/resolvers/type/price-types.d.ts.map +1 -1
- package/lib/resolvers/type/price-types.js +2 -2
- package/lib/resolvers/type/price-types.js.map +1 -1
- package/lib/resolvers/type/product/product-assortment-path-types.d.ts +1 -1
- package/lib/resolvers/type/product/product-assortment-path-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-bundle-types.d.ts +10 -10
- package/lib/resolvers/type/product/product-bundle-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-catalog-price-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-catalog-price-types.js +4 -6
- package/lib/resolvers/type/product/product-catalog-price-types.js.map +1 -1
- package/lib/resolvers/type/product/product-configurable-types.d.ts +20 -20
- package/lib/resolvers/type/product/product-configurable-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-configurable-types.js +10 -12
- package/lib/resolvers/type/product/product-configurable-types.js.map +1 -1
- package/lib/resolvers/type/product/product-discount.d.ts +1 -1
- package/lib/resolvers/type/product/product-discount.js +1 -1
- package/lib/resolvers/type/product/product-discount.js.map +1 -1
- package/lib/resolvers/type/product/product-media-types.js +2 -2
- package/lib/resolvers/type/product/product-media-types.js.map +1 -1
- package/lib/resolvers/type/product/product-plan-types.d.ts +18 -18
- package/lib/resolvers/type/product/product-plan-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-plan-types.js +16 -16
- package/lib/resolvers/type/product/product-plan-types.js.map +1 -1
- package/lib/resolvers/type/product/product-review-types.d.ts +1 -1
- package/lib/resolvers/type/product/product-review-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-review-types.js +2 -3
- package/lib/resolvers/type/product/product-review-types.js.map +1 -1
- package/lib/resolvers/type/product/product-simple-types.d.ts +22 -22
- package/lib/resolvers/type/product/product-simple-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-simple-types.js +3 -11
- package/lib/resolvers/type/product/product-simple-types.js.map +1 -1
- package/lib/resolvers/type/product/product-tokenized-types.d.ts +20 -20
- package/lib/resolvers/type/product/product-tokenized-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-tokenized-types.js +1 -5
- package/lib/resolvers/type/product/product-tokenized-types.js.map +1 -1
- package/lib/resolvers/type/product/product-types.d.ts +9 -9
- package/lib/resolvers/type/product/product-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-types.js +2 -5
- package/lib/resolvers/type/product/product-types.js.map +1 -1
- package/lib/resolvers/type/product/product-variation-assignment-types.d.ts +2 -2
- package/lib/resolvers/type/product/product-variation-assignment-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-variation-assignment-types.js +1 -1
- package/lib/resolvers/type/product/product-variation-assignment-types.js.map +1 -1
- package/lib/resolvers/type/product/product-variation-assignment-vector.js +2 -2
- package/lib/resolvers/type/product/product-variation-assignment-vector.js.map +1 -1
- package/lib/resolvers/type/product/product-variation-option-types.js +3 -3
- package/lib/resolvers/type/product/product-variation-option-types.js.map +1 -1
- package/lib/resolvers/type/product/product-variation-types.d.ts +2 -2
- package/lib/resolvers/type/product/product-variation-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-variation-types.js +3 -3
- package/lib/resolvers/type/product/product-variation-types.js.map +1 -1
- package/lib/resolvers/type/product-search-result-types.d.ts +5 -6
- package/lib/resolvers/type/product-search-result-types.d.ts.map +1 -1
- package/lib/resolvers/type/quotation-types.d.ts +8 -15
- package/lib/resolvers/type/quotation-types.d.ts.map +1 -1
- package/lib/resolvers/type/quotation-types.js +3 -6
- package/lib/resolvers/type/quotation-types.js.map +1 -1
- package/lib/resolvers/type/shop-types.d.ts +1 -1
- package/lib/resolvers/type/shop-types.d.ts.map +1 -1
- package/lib/resolvers/type/shop-types.js +4 -6
- package/lib/resolvers/type/shop-types.js.map +1 -1
- package/lib/resolvers/type/token-types.d.ts +2 -2
- package/lib/resolvers/type/token-types.d.ts.map +1 -1
- package/lib/resolvers/type/token-types.js +12 -26
- package/lib/resolvers/type/token-types.js.map +1 -1
- package/lib/resolvers/type/user-types.d.ts +22 -22
- package/lib/resolvers/type/user-types.d.ts.map +1 -1
- package/lib/resolvers/type/user-types.js +5 -16
- package/lib/resolvers/type/user-types.js.map +1 -1
- package/lib/resolvers/type/work-types.d.ts.map +1 -1
- package/lib/resolvers/type/work-types.js +0 -1
- package/lib/resolvers/type/work-types.js.map +1 -1
- package/lib/roles/all.js +1 -1
- package/lib/roles/all.js.map +1 -1
- package/lib/roles/index.d.ts.map +1 -1
- package/lib/roles/index.js +1 -0
- package/lib/roles/index.js.map +1 -1
- package/lib/roles/loggedIn.d.ts.map +1 -1
- package/lib/roles/loggedIn.js +1 -0
- package/lib/roles/loggedIn.js.map +1 -1
- package/lib/schema/types/assortment.js +5 -5
- package/lib/schema/types/country.js +1 -1
- package/lib/schema/types/delivery.d.ts.map +1 -1
- package/lib/schema/types/delivery.js +6 -2
- package/lib/schema/types/delivery.js.map +1 -1
- package/lib/schema/types/filter.js +3 -3
- package/lib/schema/types/payment.d.ts.map +1 -1
- package/lib/schema/types/payment.js +6 -2
- package/lib/schema/types/payment.js.map +1 -1
- package/lib/schema/types/price.js +1 -1
- package/lib/schema/types/product/bundle-product.js +1 -1
- package/lib/schema/types/product/configurable-product.js +6 -6
- package/lib/schema/types/product/plan-product.js +5 -5
- package/lib/schema/types/product/product.js +4 -4
- package/lib/schema/types/product/simple-product.js +4 -4
- package/lib/schema/types/product/tokenized-product.js +5 -5
- package/lib/schema/types/warehousing.js +1 -1
- package/package.json +32 -16
- package/src/api-index.ts +4 -1
- package/src/context.ts +3 -3
- package/src/createGraphQLServer.ts +2 -2
- package/src/errors.ts +10 -4
- package/src/express/createERCMetadataMiddleware.ts +11 -5
- package/src/express/createMCPMiddleware.ts +91 -0
- package/src/express/createTempUploadMiddleware.ts +60 -0
- package/src/express/index.ts +37 -9
- package/src/fastify/ercMetadataHandler.ts +11 -5
- package/src/fastify/index.ts +34 -5
- package/src/fastify/mcpHandler.ts +97 -0
- package/src/fastify/tempUploadHandler.ts +52 -0
- package/src/loaders/assortmentLinkLoader.ts +32 -0
- package/src/loaders/assortmentLinksLoader.ts +46 -0
- package/src/loaders/assortmentLoader.ts +20 -0
- package/src/loaders/assortmentMediaTextLoader.ts +26 -0
- package/src/loaders/assortmentMediasLoader.ts +21 -0
- package/src/loaders/assortmentProductLoader.ts +19 -0
- package/src/loaders/assortmentProductsLoader.ts +22 -0
- package/src/loaders/assortmentTextLoader.ts +24 -0
- package/src/loaders/buildLocaleMap.test.ts +9 -5
- package/src/loaders/buildLocaleMap.ts +43 -9
- package/src/loaders/buildTextMap.ts +4 -1
- package/src/loaders/countryLoader.ts +20 -0
- package/src/loaders/currencyLoader.ts +20 -0
- package/src/loaders/deliveryProviderLoader.ts +19 -0
- package/src/loaders/fileLoader.ts +19 -0
- package/src/loaders/filterLoader.ts +20 -0
- package/src/loaders/filterTextLoader.ts +26 -0
- package/src/loaders/index.ts +48 -329
- package/src/loaders/languageLoader.ts +20 -0
- package/src/loaders/orderLoader.ts +22 -0
- package/src/loaders/paymentProviderLoader.ts +19 -0
- package/src/loaders/productLoader.ts +22 -0
- package/src/loaders/productLoaderBySKU.ts +22 -0
- package/src/loaders/productMediaTextLoader.ts +24 -0
- package/src/loaders/productMediasLoader.ts +21 -0
- package/src/loaders/productTextLoader.ts +22 -0
- package/src/loaders/userLoader.ts +23 -0
- package/src/loaders/utils.ts +35 -0
- package/src/locale-context.ts +16 -22
- package/src/mcp/README.md +25 -0
- package/src/mcp/index.ts +313 -0
- package/src/mcp/tools/addProductAssignmentHandler.ts +118 -0
- package/src/mcp/tools/addProductMediaUploadHandler.ts +79 -0
- package/src/mcp/tools/countriesHandler.ts +60 -0
- package/src/mcp/tools/countryHandler.ts +40 -0
- package/src/mcp/tools/createLanguageHandler.ts +46 -0
- package/src/mcp/tools/createProduct.ts +75 -0
- package/src/mcp/tools/createProductVariationHandler.ts +93 -0
- package/src/mcp/tools/createProductVariationOptionHandler.ts +73 -0
- package/src/mcp/tools/currenciesHandler.ts +63 -0
- package/src/mcp/tools/currencyHandler.ts +40 -0
- package/src/mcp/tools/getProduct.ts +74 -0
- package/src/mcp/tools/index.ts +39 -0
- package/src/mcp/tools/languageHandler.ts +37 -0
- package/src/mcp/tools/languagesHandler.ts +54 -0
- package/src/mcp/tools/listProducts.ts +148 -0
- package/src/mcp/tools/productReviewsCountHandler.ts +36 -0
- package/src/mcp/tools/productReviewsHandler.ts +54 -0
- package/src/mcp/tools/productsCountHandler.ts +38 -0
- package/src/mcp/tools/publishProduct.ts +45 -0
- package/src/mcp/tools/removeLanguageHandler.ts +42 -0
- package/src/mcp/tools/removeProductAssignmentHandler.ts +61 -0
- package/src/mcp/tools/removeProductHandler.ts +40 -0
- package/src/mcp/tools/removeProductMediaHandler.ts +49 -0
- package/src/mcp/tools/removeProductVariationHandler.ts +51 -0
- package/src/mcp/tools/removeProductVariationOptionHandler.ts +58 -0
- package/src/mcp/tools/reorderProductMediaHandler.ts +48 -0
- package/src/mcp/tools/unPublishProduct.ts +46 -0
- package/src/mcp/tools/updateLanguageHandler.ts +47 -0
- package/src/mcp/tools/updateProduct.ts +51 -0
- package/src/mcp/tools/updateProductCommerceHandler.ts +79 -0
- package/src/mcp/tools/updateProductMediaTextsHandler.ts +56 -0
- package/src/mcp/tools/updateProductPlanHandler.ts +58 -0
- package/src/mcp/tools/updateProductSupplyHandler.ts +59 -0
- package/src/mcp/tools/updateProductTextsHandler.ts +59 -0
- package/src/mcp/tools/updateProductTokenizationHandler.ts +58 -0
- package/src/mcp/tools/updateProductWarehousingHandler.ts +54 -0
- package/src/mcp/utils/getNormalizedProductDetails.ts +42 -0
- package/src/mcp/utils/normalizeMediaUrl.ts +26 -0
- package/src/resolvers/mutations/accounts/createUser.ts +4 -6
- package/src/resolvers/mutations/accounts/impersonate.ts +1 -1
- package/src/resolvers/mutations/accounts/loginAsGuest.ts +4 -6
- package/src/resolvers/mutations/accounts/loginWithPassword.ts +3 -3
- package/src/resolvers/mutations/accounts/loginWithWebAuthn.ts +3 -3
- package/src/resolvers/mutations/accounts/resetPassword.ts +3 -3
- package/src/resolvers/mutations/accounts/stopImpersonation.ts +1 -1
- package/src/resolvers/mutations/accounts/verifyEmail.ts +3 -3
- package/src/resolvers/mutations/assortments/reorderAssortmentFilters.ts +1 -1
- package/src/resolvers/mutations/assortments/reorderAssortmentLinks.ts +1 -1
- package/src/resolvers/mutations/assortments/reorderAssortmentMedia.ts +1 -1
- package/src/resolvers/mutations/assortments/reorderAssortmentProducts.ts +1 -1
- package/src/resolvers/mutations/assortments/updateAssortmentMediaTexts.ts +1 -1
- package/src/resolvers/mutations/assortments/updateAssortmentTexts.ts +1 -1
- package/src/resolvers/mutations/enrollments/createEnrollment.ts +3 -3
- package/src/resolvers/mutations/enrollments/updateEnrollment.ts +2 -2
- package/src/resolvers/mutations/filters/createFilter.ts +2 -6
- package/src/resolvers/mutations/filters/updateFilterTexts.ts +1 -1
- package/src/resolvers/mutations/orders/addCartDiscount.ts +1 -1
- package/src/resolvers/mutations/orders/addCartProduct.ts +1 -1
- package/src/resolvers/mutations/orders/addCartQuotation.ts +2 -2
- package/src/resolvers/mutations/orders/addMultipleCartProducts.ts +4 -4
- package/src/resolvers/mutations/orders/checkoutCart.ts +1 -1
- package/src/resolvers/mutations/orders/createCart.ts +1 -1
- package/src/resolvers/mutations/orders/emptyCart.ts +1 -1
- package/src/resolvers/mutations/orders/signPaymentProviderForCheckout.ts +1 -1
- package/src/resolvers/mutations/orders/updateCart.ts +1 -1
- package/src/resolvers/mutations/orders/updateCartItem.ts +1 -1
- package/src/resolvers/mutations/products/addProductAssignment.ts +45 -2
- package/src/resolvers/mutations/products/createProductVariation.ts +5 -1
- package/src/resolvers/mutations/products/removeProductAssignment.ts +1 -1
- package/src/resolvers/mutations/products/reorderProductMedia.ts +1 -1
- package/src/resolvers/mutations/products/updateProductMediaTexts.ts +1 -1
- package/src/resolvers/mutations/products/updateProductVariationTexts.ts +1 -1
- package/src/resolvers/mutations/quotations/requestQuotation.ts +4 -4
- package/src/resolvers/mutations/users/heartbeat.ts +3 -3
- package/src/resolvers/mutations/users/setRoles.ts +1 -1
- package/src/resolvers/mutations/users/setUserTags.ts +1 -1
- package/src/resolvers/mutations/warehousing/invalidateToken.ts +3 -3
- package/src/resolvers/mutations/worker/allocateWork.ts +1 -1
- package/src/resolvers/queries/assortments/assortments.ts +1 -1
- package/src/resolvers/queries/countries/countries.ts +1 -1
- package/src/resolvers/queries/currencies/currencies.ts +1 -1
- package/src/resolvers/queries/enrollments/enrollments.ts +1 -1
- package/src/resolvers/queries/filters/filters.ts +1 -1
- package/src/resolvers/queries/filters/searchAssortments.ts +2 -7
- package/src/resolvers/queries/filters/searchProducts.ts +3 -8
- package/src/resolvers/queries/languages/languages.ts +1 -1
- package/src/resolvers/queries/orders/orders.ts +1 -1
- package/src/resolvers/queries/products/productReviews.ts +1 -1
- package/src/resolvers/queries/products/products.ts +1 -1
- package/src/resolvers/queries/quotations/quotations.ts +1 -1
- package/src/resolvers/queries/users/impersonator.ts +2 -1
- package/src/resolvers/queries/users/user.ts +1 -0
- package/src/resolvers/queries/users/users.ts +1 -1
- package/src/resolvers/queries/worker/workQueue.ts +3 -3
- package/src/resolvers/type/assortment/assortment-filter-types.ts +6 -16
- package/src/resolvers/type/assortment/assortment-link-types.ts +2 -2
- package/src/resolvers/type/assortment/assortment-media-types.ts +2 -2
- package/src/resolvers/type/assortment/assortment-path-link-types.ts +3 -3
- package/src/resolvers/type/assortment/assortment-product-types.ts +2 -2
- package/src/resolvers/type/assortment/assortment-types.ts +6 -6
- package/src/resolvers/type/bookmark-types.ts +2 -3
- package/src/resolvers/type/country-types.ts +5 -8
- package/src/resolvers/type/delivery-provider-types.ts +26 -47
- package/src/resolvers/type/enrollment/enrollment-delivery-types.ts +5 -11
- package/src/resolvers/type/enrollment/enrollment-payment-types.ts +3 -11
- package/src/resolvers/type/enrollment/enrollment-period-types.ts +3 -11
- package/src/resolvers/type/enrollment/enrollment-plan-tyes.ts +3 -11
- package/src/resolvers/type/enrollment/enrollment-types.ts +10 -25
- package/src/resolvers/type/filter/filter-option-types.ts +10 -15
- package/src/resolvers/type/filter/filter-types.ts +5 -13
- package/src/resolvers/type/filter/loaded-filter-types.ts +2 -2
- package/src/resolvers/type/login-method-response-types.ts +1 -1
- package/src/resolvers/type/order/order-delivery-discount-types.ts +1 -2
- package/src/resolvers/type/order/order-delivery-pickup-types.ts +12 -28
- package/src/resolvers/type/order/order-delivery-shipping-types.ts +9 -23
- package/src/resolvers/type/order/order-delivery-types.ts +2 -3
- package/src/resolvers/type/order/order-discount-types.ts +12 -39
- package/src/resolvers/type/order/order-global-discount-types.ts +1 -2
- package/src/resolvers/type/order/order-item-discount-types.ts +1 -2
- package/src/resolvers/type/order/order-item-types.ts +19 -27
- package/src/resolvers/type/order/order-payment-card-types.ts +8 -21
- package/src/resolvers/type/order/order-payment-discount-types.ts +1 -2
- package/src/resolvers/type/order/order-payment-generic-types.ts +8 -20
- package/src/resolvers/type/order/order-payment-invoice-types.ts +8 -20
- package/src/resolvers/type/order/order-payment-types.ts +2 -3
- package/src/resolvers/type/order/order-types.ts +10 -22
- package/src/resolvers/type/payment/payment-credentials-types.ts +6 -10
- package/src/resolvers/type/payment/payment-provider-types.ts +9 -10
- package/src/resolvers/type/price-types.ts +4 -4
- package/src/resolvers/type/product/product-assortment-path-types.ts +1 -1
- package/src/resolvers/type/product/product-bundle-types.ts +1 -1
- package/src/resolvers/type/product/product-catalog-price-types.ts +4 -6
- package/src/resolvers/type/product/product-configurable-types.ts +20 -21
- package/src/resolvers/type/product/product-discount.ts +1 -1
- package/src/resolvers/type/product/product-media-types.ts +2 -2
- package/src/resolvers/type/product/product-plan-types.ts +22 -22
- package/src/resolvers/type/product/product-review-types.ts +3 -4
- package/src/resolvers/type/product/product-simple-types.ts +7 -19
- package/src/resolvers/type/product/product-tokenized-types.ts +3 -10
- package/src/resolvers/type/product/product-types.ts +10 -13
- package/src/resolvers/type/product/product-variation-assignment-types.ts +2 -2
- package/src/resolvers/type/product/product-variation-assignment-vector.ts +2 -2
- package/src/resolvers/type/product/product-variation-option-types.ts +3 -3
- package/src/resolvers/type/product/product-variation-types.ts +5 -5
- package/src/resolvers/type/product-search-result-types.ts +5 -5
- package/src/resolvers/type/quotation-types.ts +11 -25
- package/src/resolvers/type/shop-types.ts +5 -7
- package/src/resolvers/type/token-types.ts +15 -32
- package/src/resolvers/type/user-types.ts +27 -39
- package/src/resolvers/type/work-types.ts +0 -2
- package/src/roles/all.ts +1 -1
- package/src/roles/index.ts +1 -0
- package/src/roles/loggedIn.ts +1 -0
- package/src/schema/types/assortment.ts +5 -5
- package/src/schema/types/country.ts +1 -1
- package/src/schema/types/delivery.ts +6 -2
- package/src/schema/types/filter.ts +3 -3
- package/src/schema/types/payment.ts +6 -2
- package/src/schema/types/price.ts +1 -1
- package/src/schema/types/product/bundle-product.ts +1 -1
- package/src/schema/types/product/configurable-product.ts +6 -6
- package/src/schema/types/product/plan-product.ts +5 -5
- package/src/schema/types/product/product.ts +4 -4
- package/src/schema/types/product/simple-product.ts +4 -4
- package/src/schema/types/product/tokenized-product.ts +5 -5
- package/src/schema/types/warehousing.ts +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { UnchainedCore } from '@unchainedshop/core';
|
|
2
|
+
import { Currency } from '@unchainedshop/core-currencies';
|
|
3
|
+
import DataLoader from 'dataloader';
|
|
4
|
+
|
|
5
|
+
export default (unchainedAPI: UnchainedCore) =>
|
|
6
|
+
new DataLoader<{ isoCode: string }, Currency>(async (queries) => {
|
|
7
|
+
const isoCodes = [...new Set(queries.map((q) => q.isoCode).filter(Boolean))];
|
|
8
|
+
|
|
9
|
+
const currencies = await unchainedAPI.modules.currencies.findCurrencies({
|
|
10
|
+
isoCode: { $in: isoCodes },
|
|
11
|
+
includeInactive: true,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const currencyMap = {};
|
|
15
|
+
for (const currency of currencies) {
|
|
16
|
+
currencyMap[currency.isoCode] = currency;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return queries.map((q) => currencyMap[q.isoCode]);
|
|
20
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { UnchainedCore } from '@unchainedshop/core';
|
|
2
|
+
import { DeliveryProvider } from '@unchainedshop/core-delivery';
|
|
3
|
+
import DataLoader from 'dataloader';
|
|
4
|
+
|
|
5
|
+
export default (unchainedAPI: UnchainedCore) =>
|
|
6
|
+
new DataLoader<{ deliveryProviderId: string }, DeliveryProvider>(async (queries) => {
|
|
7
|
+
const deliveryProviderIds = [...new Set(queries.map((q) => q.deliveryProviderId).filter(Boolean))];
|
|
8
|
+
|
|
9
|
+
const deliveryProviders = await unchainedAPI.modules.delivery.findProviders({
|
|
10
|
+
_id: { $in: deliveryProviderIds },
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const deliveryProviderMap = {};
|
|
14
|
+
for (const deliveryProvider of deliveryProviders) {
|
|
15
|
+
deliveryProviderMap[deliveryProvider._id] = deliveryProvider;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return queries.map((q) => deliveryProviderMap[q.deliveryProviderId]);
|
|
19
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { UnchainedCore } from '@unchainedshop/core';
|
|
2
|
+
import { File } from '@unchainedshop/core-files';
|
|
3
|
+
import DataLoader from 'dataloader';
|
|
4
|
+
|
|
5
|
+
export default (unchainedAPI: UnchainedCore) =>
|
|
6
|
+
new DataLoader<{ fileId: string }, File>(async (queries) => {
|
|
7
|
+
const fileIds = [...new Set(queries.map((q) => q.fileId).filter(Boolean))];
|
|
8
|
+
|
|
9
|
+
const files = await unchainedAPI.modules.files.findFiles({
|
|
10
|
+
_id: { $in: fileIds },
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const fileMap = {};
|
|
14
|
+
for (const file of files) {
|
|
15
|
+
fileMap[file._id] = file;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return queries.map((q) => fileMap[q.fileId]);
|
|
19
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { UnchainedCore } from '@unchainedshop/core';
|
|
2
|
+
import { Filter } from '@unchainedshop/core-filters';
|
|
3
|
+
import DataLoader from 'dataloader';
|
|
4
|
+
|
|
5
|
+
export default (unchainedAPI: UnchainedCore) =>
|
|
6
|
+
new DataLoader<{ filterId: string }, Filter>(async (queries) => {
|
|
7
|
+
const filterIds = [...new Set(queries.map((q) => q.filterId).filter(Boolean))];
|
|
8
|
+
|
|
9
|
+
const filters = await unchainedAPI.modules.filters.findFilters({
|
|
10
|
+
filterIds,
|
|
11
|
+
includeInactive: true,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const filterMap = {};
|
|
15
|
+
for (const filter of filters) {
|
|
16
|
+
filterMap[filter._id] = filter;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return queries.map((q) => filterMap[q.filterId]);
|
|
20
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { UnchainedCore } from '@unchainedshop/core';
|
|
2
|
+
import DataLoader from 'dataloader';
|
|
3
|
+
import buildLocaleMap from './buildLocaleMap.js';
|
|
4
|
+
import { FilterText } from '@unchainedshop/core-filters';
|
|
5
|
+
import buildTextMap from './buildTextMap.js';
|
|
6
|
+
|
|
7
|
+
export default (unchainedAPI: UnchainedCore) =>
|
|
8
|
+
new DataLoader<{ filterId: string; filterOptionValue?: string; locale: Intl.Locale }, FilterText>(
|
|
9
|
+
async (queries) => {
|
|
10
|
+
const filterIds = [...new Set(queries.map((q) => q.filterId).filter(Boolean))];
|
|
11
|
+
|
|
12
|
+
const texts = await unchainedAPI.modules.filters.texts.findTexts(
|
|
13
|
+
{ filterId: { $in: filterIds } },
|
|
14
|
+
{
|
|
15
|
+
sort: {
|
|
16
|
+
filterId: 1,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
const localeMap = buildLocaleMap(queries, texts);
|
|
22
|
+
const textsMap = buildTextMap(localeMap, texts, (text) => text.filterId + text.filterOptionValue);
|
|
23
|
+
|
|
24
|
+
return queries.map((q) => textsMap[q.locale + q.filterId + q.filterOptionValue]);
|
|
25
|
+
},
|
|
26
|
+
);
|
package/src/loaders/index.ts
CHANGED
|
@@ -1,344 +1,63 @@
|
|
|
1
|
-
import DataLoader from 'dataloader';
|
|
2
1
|
import { UnchainedCore } from '@unchainedshop/core';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
2
|
+
import assortmentLoader from './assortmentLoader.js';
|
|
3
|
+
import assortmentTextLoader from './assortmentTextLoader.js';
|
|
4
|
+
import assortmentMediaTextLoader from './assortmentMediaTextLoader.js';
|
|
5
|
+
import assortmentMediasLoader from './assortmentMediasLoader.js';
|
|
6
|
+
import assortmentLinkLoader from './assortmentLinkLoader.js';
|
|
7
|
+
import assortmentLinksLoader from './assortmentLinksLoader.js';
|
|
8
|
+
import assortmentProductLoader from './assortmentProductLoader.js';
|
|
9
|
+
import assortmentProductsLoader from './assortmentProductsLoader.js';
|
|
10
|
+
import filterLoader from './filterLoader.js';
|
|
11
|
+
import filterTextLoader from './filterTextLoader.js';
|
|
12
|
+
import productLoader from './productLoader.js';
|
|
13
|
+
import productLoaderBySKU from './productLoaderBySKU.js';
|
|
14
|
+
import productTextLoader from './productTextLoader.js';
|
|
15
|
+
import productMediaTextLoader from './productMediaTextLoader.js';
|
|
16
|
+
import productMediasLoader from './productMediasLoader.js';
|
|
17
|
+
import fileLoader from './fileLoader.js';
|
|
18
|
+
import userLoader from './userLoader.js';
|
|
19
|
+
import countryLoader from './countryLoader.js';
|
|
20
|
+
import currencyLoader from './currencyLoader.js';
|
|
21
|
+
import languageLoader from './languageLoader.js';
|
|
22
|
+
import deliveryProviderLoader from './deliveryProviderLoader.js';
|
|
23
|
+
import paymentProviderLoader from './paymentProviderLoader.js';
|
|
24
|
+
import orderLoader from './orderLoader.js';
|
|
25
|
+
|
|
26
|
+
const loaders = (unchainedAPI: UnchainedCore) => {
|
|
18
27
|
return {
|
|
19
|
-
assortmentLoader:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const assortmentMap = {};
|
|
29
|
-
for (const assortment of assortments) {
|
|
30
|
-
assortmentMap[assortment._id] = assortment;
|
|
31
|
-
}
|
|
32
|
-
return queries.map((q) => assortmentMap[q.assortmentId]);
|
|
33
|
-
}),
|
|
34
|
-
|
|
35
|
-
assortmentTextLoader: new DataLoader<{ assortmentId: string; locale: string }, AssortmentText>(
|
|
36
|
-
async (queries) => {
|
|
37
|
-
const assortmentIds = [...new Set(queries.map((q) => q.assortmentId).filter(Boolean))];
|
|
38
|
-
|
|
39
|
-
const texts = await unchainedAPI.modules.assortments.texts.findTexts(
|
|
40
|
-
{ assortmentId: { $in: assortmentIds } },
|
|
41
|
-
{
|
|
42
|
-
sort: {
|
|
43
|
-
assortmentId: 1,
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
const localeMap = buildLocaleMap(queries, texts);
|
|
49
|
-
const textsMap = buildTextMap(localeMap, texts, (text) => text.assortmentId);
|
|
50
|
-
return queries.map((q) => textsMap[q.locale + q.assortmentId]);
|
|
51
|
-
},
|
|
52
|
-
),
|
|
53
|
-
|
|
54
|
-
assortmentMediaTextLoader: new DataLoader<
|
|
55
|
-
{ assortmentMediaId: string; locale: string },
|
|
56
|
-
AssortmentMediaText
|
|
57
|
-
>(async (queries) => {
|
|
58
|
-
const assortmentMediaIds = [...new Set(queries.map((q) => q.assortmentMediaId).filter(Boolean))];
|
|
59
|
-
|
|
60
|
-
const texts = await unchainedAPI.modules.assortments.media.texts.findMediaTexts(
|
|
61
|
-
{ assortmentMediaId: { $in: assortmentMediaIds } },
|
|
62
|
-
{
|
|
63
|
-
sort: {
|
|
64
|
-
assortmentMediaId: 1,
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
);
|
|
68
|
-
|
|
69
|
-
const localeMap = buildLocaleMap(queries, texts);
|
|
70
|
-
const textsMap = buildTextMap(localeMap, texts, (text) => text.assortmentMediaId);
|
|
71
|
-
return queries.map((q) => textsMap[q.locale + q.assortmentMediaId]);
|
|
72
|
-
}),
|
|
73
|
-
|
|
74
|
-
assortmentMediasLoader: new DataLoader<{ assortmentId?: string }, AssortmentMediaType[]>(
|
|
75
|
-
async (queries) => {
|
|
76
|
-
const assortmentIds = [...new Set(queries.map((q) => q.assortmentId).filter(Boolean))];
|
|
77
|
-
const assortmentMediaItems = await unchainedAPI.modules.assortments.media.findAssortmentMedias({
|
|
78
|
-
assortmentId: { $in: assortmentIds },
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
const assortmentMediaMap = {};
|
|
82
|
-
for (const assortmentMedia of assortmentMediaItems) {
|
|
83
|
-
if (!assortmentMediaMap[assortmentMedia.assortmentId]) {
|
|
84
|
-
assortmentMediaMap[assortmentMedia.assortmentId] = [assortmentMedia];
|
|
85
|
-
} else {
|
|
86
|
-
assortmentMediaMap[assortmentMedia.assortmentId].push(assortmentMedia);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return queries.map((q) => assortmentMediaMap[q.assortmentId] || []);
|
|
90
|
-
},
|
|
91
|
-
),
|
|
92
|
-
|
|
93
|
-
assortmentLinkLoader: new DataLoader<
|
|
94
|
-
{ parentAssortmentId: string; childAssortmentId: string },
|
|
95
|
-
AssortmentLink
|
|
96
|
-
>(async (queries) => {
|
|
97
|
-
const parentAssortmentIds = [...new Set(queries.map((q) => q.parentAssortmentId).filter(Boolean))];
|
|
98
|
-
|
|
99
|
-
const links = await unchainedAPI.modules.assortments.links.findLinks({
|
|
100
|
-
parentAssortmentIds,
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
const assortmentLinkMap = {};
|
|
104
|
-
for (const link of links) {
|
|
105
|
-
if (!assortmentLinkMap[link.parentAssortmentId]) {
|
|
106
|
-
assortmentLinkMap[link.parentAssortmentId] = [link];
|
|
107
|
-
} else {
|
|
108
|
-
assortmentLinkMap[link.parentAssortmentId].push(link);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
return queries.map((q) => {
|
|
113
|
-
if (q.childAssortmentId) {
|
|
114
|
-
return assortmentLinkMap[q.parentAssortmentId].find(
|
|
115
|
-
(link) => link.childAssortmentId === q.childAssortmentId,
|
|
116
|
-
);
|
|
117
|
-
}
|
|
118
|
-
return assortmentLinkMap[q.parentAssortmentId][0];
|
|
119
|
-
});
|
|
120
|
-
}),
|
|
121
|
-
|
|
122
|
-
assortmentLinksLoader: new DataLoader<
|
|
123
|
-
{ parentAssortmentId?: string; childAssortmentId?: string; assortmentId?: string },
|
|
124
|
-
AssortmentLink[]
|
|
125
|
-
>(async (queries) => {
|
|
126
|
-
const parentAssortmentIds = queries.flatMap((q) => q.parentAssortmentId).filter(Boolean);
|
|
127
|
-
const childAssortmentIds = queries.flatMap((q) => q.childAssortmentId).filter(Boolean);
|
|
128
|
-
const assortmentIds = queries.flatMap((q) => q.assortmentId).filter(Boolean);
|
|
129
|
-
|
|
130
|
-
const allLinks = await unchainedAPI.modules.assortments.links.findLinks({
|
|
131
|
-
assortmentIds: [...new Set([...parentAssortmentIds, ...childAssortmentIds, ...assortmentIds])],
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
const parentAssortmentLinkMap = {};
|
|
135
|
-
const childAssortmentLinkMap = {};
|
|
136
|
-
|
|
137
|
-
for (const link of allLinks) {
|
|
138
|
-
if (!parentAssortmentLinkMap[link.parentAssortmentId]) {
|
|
139
|
-
parentAssortmentLinkMap[link.parentAssortmentId] = [link];
|
|
140
|
-
} else {
|
|
141
|
-
parentAssortmentLinkMap[link.parentAssortmentId].push(link);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
if (!childAssortmentLinkMap[link.childAssortmentId]) {
|
|
145
|
-
childAssortmentLinkMap[link.childAssortmentId] = [link];
|
|
146
|
-
} else {
|
|
147
|
-
childAssortmentLinkMap[link.childAssortmentId].push(link);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
return queries.map((q) => {
|
|
152
|
-
if (q.parentAssortmentId) {
|
|
153
|
-
return parentAssortmentLinkMap[q.parentAssortmentId] || [];
|
|
154
|
-
} else if (q.childAssortmentId) {
|
|
155
|
-
return childAssortmentLinkMap[q.childAssortmentId] || [];
|
|
156
|
-
}
|
|
157
|
-
return [
|
|
158
|
-
...(parentAssortmentLinkMap[q.assortmentId] || []),
|
|
159
|
-
...(childAssortmentLinkMap[q.assortmentId] || []),
|
|
160
|
-
];
|
|
161
|
-
});
|
|
162
|
-
}),
|
|
163
|
-
|
|
164
|
-
assortmentProductLoader: new DataLoader<
|
|
165
|
-
{ assortmentId: string; productId: string },
|
|
166
|
-
AssortmentProduct
|
|
167
|
-
>(async (queries) => {
|
|
168
|
-
const assortmentIds = [...new Set(queries.map((q) => q.assortmentId).filter(Boolean))];
|
|
169
|
-
|
|
170
|
-
const assortmentProducts = await unchainedAPI.modules.assortments.products.findAssortmentProducts({
|
|
171
|
-
assortmentIds,
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
const assortmentProductMap = {};
|
|
175
|
-
for (const assortmentProduct of assortmentProducts) {
|
|
176
|
-
assortmentProductMap[assortmentProduct.assortmentId + assortmentProduct.productId] =
|
|
177
|
-
assortmentProduct;
|
|
178
|
-
}
|
|
179
|
-
return queries.map((q) => assortmentProductMap[q.assortmentId + q.productId]);
|
|
180
|
-
}),
|
|
181
|
-
|
|
182
|
-
assortmentProductsLoader: new DataLoader<{ productId: string }, AssortmentProduct[]>(
|
|
183
|
-
async (queries) => {
|
|
184
|
-
const productIds = [...new Set(queries.map((q) => q.productId).filter(Boolean))];
|
|
185
|
-
|
|
186
|
-
const assortmentProducts =
|
|
187
|
-
await unchainedAPI.modules.assortments.products.findAssortmentProducts({
|
|
188
|
-
productIds,
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
const assortmentProductsMap = {};
|
|
192
|
-
for (const assortmentProduct of assortmentProducts) {
|
|
193
|
-
if (!assortmentProductsMap[assortmentProduct.productId]) {
|
|
194
|
-
assortmentProductsMap[assortmentProduct.productId] = [assortmentProduct];
|
|
195
|
-
} else {
|
|
196
|
-
assortmentProductsMap[assortmentProduct.productId].push(assortmentProduct);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
return queries.map((q) => assortmentProductsMap[q.productId] || []);
|
|
200
|
-
},
|
|
201
|
-
),
|
|
202
|
-
|
|
203
|
-
filterLoader: new DataLoader<{ filterId: string }, Filter>(async (queries) => {
|
|
204
|
-
const filterIds = [...new Set(queries.map((q) => q.filterId).filter(Boolean))];
|
|
205
|
-
|
|
206
|
-
const filters = await unchainedAPI.modules.filters.findFilters({
|
|
207
|
-
filterIds,
|
|
208
|
-
includeInactive: true,
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
const filterMap = {};
|
|
212
|
-
for (const filter of filters) {
|
|
213
|
-
filterMap[filter._id] = filter;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
return queries.map((q) => filterMap[q.filterId]);
|
|
217
|
-
}),
|
|
218
|
-
|
|
219
|
-
filterTextLoader: new DataLoader<
|
|
220
|
-
{ filterId: string; filterOptionValue?: string; locale: string },
|
|
221
|
-
FilterText
|
|
222
|
-
>(async (queries) => {
|
|
223
|
-
const filterIds = [...new Set(queries.map((q) => q.filterId).filter(Boolean))];
|
|
224
|
-
|
|
225
|
-
const texts = await unchainedAPI.modules.filters.texts.findTexts(
|
|
226
|
-
{ filterId: { $in: filterIds } },
|
|
227
|
-
{
|
|
228
|
-
sort: {
|
|
229
|
-
filterId: 1,
|
|
230
|
-
},
|
|
231
|
-
},
|
|
232
|
-
);
|
|
233
|
-
|
|
234
|
-
const localeMap = buildLocaleMap(queries, texts);
|
|
235
|
-
const textsMap = buildTextMap(localeMap, texts, (text) => text.filterId + text.filterOptionValue);
|
|
236
|
-
return queries.map((q) => textsMap[q.locale + q.filterId + q.filterOptionValue]);
|
|
237
|
-
}),
|
|
238
|
-
|
|
239
|
-
productLoader: new DataLoader<{ productId: string }, Product>(async (queries) => {
|
|
240
|
-
const productIds = [...new Set(queries.map((q) => q.productId).filter(Boolean))]; // you don't need lodash, _.unique my ass
|
|
241
|
-
|
|
242
|
-
const products = await unchainedAPI.modules.products.findProducts({
|
|
243
|
-
productIds,
|
|
244
|
-
productSelector: {
|
|
245
|
-
status: { $exists: true },
|
|
246
|
-
},
|
|
247
|
-
});
|
|
248
|
-
|
|
249
|
-
const productMap = {};
|
|
250
|
-
for (const product of products) {
|
|
251
|
-
productMap[product._id] = product;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
return queries.map((q) => productMap[q.productId]);
|
|
255
|
-
}),
|
|
256
|
-
|
|
257
|
-
productLoaderBySKU: new DataLoader<{ sku: string }, Product>(async (queries) => {
|
|
258
|
-
const skus = [...new Set(queries.map((q) => q.sku).filter(Boolean))]; // you don't need lodash, _.unique my ass
|
|
259
|
-
|
|
260
|
-
const products = await unchainedAPI.modules.products.findProducts({
|
|
261
|
-
productSelector: {
|
|
262
|
-
'warehousing.sku': { $in: skus },
|
|
263
|
-
status: { $exists: true },
|
|
264
|
-
},
|
|
265
|
-
});
|
|
266
|
-
|
|
267
|
-
const productMap = {};
|
|
268
|
-
for (const product of products) {
|
|
269
|
-
productMap[product.warehousing!.sku!] = product;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
return queries.map((q) => productMap[q.sku]);
|
|
273
|
-
}),
|
|
28
|
+
assortmentLoader: assortmentLoader(unchainedAPI),
|
|
29
|
+
assortmentTextLoader: assortmentTextLoader(unchainedAPI),
|
|
30
|
+
assortmentMediaTextLoader: assortmentMediaTextLoader(unchainedAPI),
|
|
31
|
+
assortmentMediasLoader: assortmentMediasLoader(unchainedAPI),
|
|
32
|
+
assortmentLinkLoader: assortmentLinkLoader(unchainedAPI),
|
|
33
|
+
assortmentLinksLoader: assortmentLinksLoader(unchainedAPI),
|
|
34
|
+
assortmentProductLoader: assortmentProductLoader(unchainedAPI),
|
|
35
|
+
assortmentProductsLoader: assortmentProductsLoader(unchainedAPI),
|
|
274
36
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
const productIds = [...new Set(queries.map((q) => q.productId))].filter(Boolean);
|
|
278
|
-
const texts = await unchainedAPI.modules.products.texts.findTexts(
|
|
279
|
-
{ productId: { $in: productIds } },
|
|
280
|
-
{
|
|
281
|
-
sort: {
|
|
282
|
-
productId: 1,
|
|
283
|
-
},
|
|
284
|
-
},
|
|
285
|
-
);
|
|
286
|
-
const localeMap = buildLocaleMap(queries, texts);
|
|
287
|
-
const textsMap = buildTextMap(localeMap, texts, (text) => text.productId);
|
|
288
|
-
return queries.map((q) => textsMap[q.locale + q.productId]);
|
|
289
|
-
},
|
|
290
|
-
),
|
|
37
|
+
filterLoader: filterLoader(unchainedAPI),
|
|
38
|
+
filterTextLoader: filterTextLoader(unchainedAPI),
|
|
291
39
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
40
|
+
productLoader: productLoader(unchainedAPI),
|
|
41
|
+
productLoaderBySKU: productLoaderBySKU(unchainedAPI),
|
|
42
|
+
productTextLoader: productTextLoader(unchainedAPI),
|
|
43
|
+
productMediaTextLoader: productMediaTextLoader(unchainedAPI),
|
|
44
|
+
productMediasLoader: productMediasLoader(unchainedAPI),
|
|
295
45
|
|
|
296
|
-
|
|
297
|
-
{ productMediaId: { $in: productMediaIds } },
|
|
298
|
-
{
|
|
299
|
-
sort: {
|
|
300
|
-
productMediaId: 1,
|
|
301
|
-
},
|
|
302
|
-
},
|
|
303
|
-
);
|
|
46
|
+
fileLoader: fileLoader(unchainedAPI),
|
|
304
47
|
|
|
305
|
-
|
|
306
|
-
const textsMap = buildTextMap(localeMap, texts, (text) => text.productMediaId);
|
|
307
|
-
return queries.map((q) => textsMap[q.locale + q.productMediaId]);
|
|
308
|
-
},
|
|
309
|
-
),
|
|
48
|
+
userLoader: userLoader(unchainedAPI),
|
|
310
49
|
|
|
311
|
-
|
|
312
|
-
const productIds = [...new Set(queries.map((q) => q.productId).filter(Boolean))];
|
|
313
|
-
const productMediaItems = await unchainedAPI.modules.products.media.findProductMedias({
|
|
314
|
-
productId: { $in: productIds },
|
|
315
|
-
});
|
|
50
|
+
countryLoader: countryLoader(unchainedAPI),
|
|
316
51
|
|
|
317
|
-
|
|
318
|
-
for (const productMedia of productMediaItems) {
|
|
319
|
-
if (!productMediaMap[productMedia.productId]) {
|
|
320
|
-
productMediaMap[productMedia.productId] = [productMedia];
|
|
321
|
-
} else {
|
|
322
|
-
productMediaMap[productMedia.productId].push(productMedia);
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
return queries.map((q) => productMediaMap[q.productId] || []);
|
|
326
|
-
}),
|
|
52
|
+
currencyLoader: currencyLoader(unchainedAPI),
|
|
327
53
|
|
|
328
|
-
|
|
329
|
-
const fileIds = [...new Set(queries.map((q) => q.fileId).filter(Boolean))]; // you don't need lodash, _.unique my ass
|
|
54
|
+
languageLoader: languageLoader(unchainedAPI),
|
|
330
55
|
|
|
331
|
-
|
|
332
|
-
_id: { $in: fileIds },
|
|
333
|
-
});
|
|
56
|
+
deliveryProviderLoader: deliveryProviderLoader(unchainedAPI),
|
|
334
57
|
|
|
335
|
-
|
|
336
|
-
for (const file of files) {
|
|
337
|
-
fileMap[file._id] = file;
|
|
338
|
-
}
|
|
58
|
+
paymentProviderLoader: paymentProviderLoader(unchainedAPI),
|
|
339
59
|
|
|
340
|
-
|
|
341
|
-
}),
|
|
60
|
+
orderLoader: orderLoader(unchainedAPI),
|
|
342
61
|
};
|
|
343
62
|
};
|
|
344
63
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { UnchainedCore } from '@unchainedshop/core';
|
|
2
|
+
import { Language } from '@unchainedshop/core-languages';
|
|
3
|
+
import DataLoader from 'dataloader';
|
|
4
|
+
|
|
5
|
+
export default (unchainedAPI: UnchainedCore) =>
|
|
6
|
+
new DataLoader<{ isoCode: string }, Language>(async (queries) => {
|
|
7
|
+
const isoCodes = [...new Set(queries.map((q) => q.isoCode).filter(Boolean))];
|
|
8
|
+
|
|
9
|
+
const languages = await unchainedAPI.modules.languages.findLanguages({
|
|
10
|
+
isoCode: { $in: isoCodes },
|
|
11
|
+
includeInactive: true,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const languageMap = {};
|
|
15
|
+
for (const language of languages) {
|
|
16
|
+
languageMap[language.isoCode] = language;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return queries.map((q) => languageMap[q.isoCode]);
|
|
20
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { UnchainedCore } from '@unchainedshop/core';
|
|
2
|
+
import { Order } from '@unchainedshop/core-orders';
|
|
3
|
+
import DataLoader from 'dataloader';
|
|
4
|
+
|
|
5
|
+
export default (unchainedAPI: UnchainedCore) =>
|
|
6
|
+
new DataLoader<{ orderId: string }, Order>(async (queries) => {
|
|
7
|
+
const orderIds = [...new Set(queries.map((q) => q.orderId).filter(Boolean))];
|
|
8
|
+
|
|
9
|
+
// It's important to also fetch deleted with the loader,
|
|
10
|
+
// because the loader fetches entities by id.
|
|
11
|
+
const orders = await unchainedAPI.modules.orders.findOrders({
|
|
12
|
+
includeCarts: true,
|
|
13
|
+
_id: { $in: orderIds },
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const orderMap = {};
|
|
17
|
+
for (const order of orders) {
|
|
18
|
+
orderMap[order._id] = order;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return queries.map((q) => orderMap[q.orderId]);
|
|
22
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { UnchainedCore } from '@unchainedshop/core';
|
|
2
|
+
import { PaymentProvider } from '@unchainedshop/core-payment';
|
|
3
|
+
import DataLoader from 'dataloader';
|
|
4
|
+
|
|
5
|
+
export default (unchainedAPI: UnchainedCore) =>
|
|
6
|
+
new DataLoader<{ paymentProviderId: string }, PaymentProvider>(async (queries) => {
|
|
7
|
+
const paymentProviderIds = [...new Set(queries.map((q) => q.paymentProviderId).filter(Boolean))];
|
|
8
|
+
|
|
9
|
+
const paymentProviders = await unchainedAPI.modules.payment.paymentProviders.findProviders({
|
|
10
|
+
_id: { $in: paymentProviderIds },
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const paymentProviderMap = {};
|
|
14
|
+
for (const paymentProvider of paymentProviders) {
|
|
15
|
+
paymentProviderMap[paymentProvider._id] = paymentProvider;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return queries.map((q) => paymentProviderMap[q.paymentProviderId]);
|
|
19
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { UnchainedCore } from '@unchainedshop/core';
|
|
2
|
+
import { Product } from '@unchainedshop/core-products';
|
|
3
|
+
import DataLoader from 'dataloader';
|
|
4
|
+
|
|
5
|
+
export default (unchainedAPI: UnchainedCore) =>
|
|
6
|
+
new DataLoader<{ productId: string }, Product>(async (queries) => {
|
|
7
|
+
const productIds = [...new Set(queries.map((q) => q.productId).filter(Boolean))];
|
|
8
|
+
|
|
9
|
+
const products = await unchainedAPI.modules.products.findProducts({
|
|
10
|
+
productIds,
|
|
11
|
+
productSelector: {
|
|
12
|
+
status: { $exists: true },
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const productMap = {};
|
|
17
|
+
for (const product of products) {
|
|
18
|
+
productMap[product._id] = product;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return queries.map((q) => productMap[q.productId]);
|
|
22
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { UnchainedCore } from '@unchainedshop/core';
|
|
2
|
+
import { Product } from '@unchainedshop/core-products';
|
|
3
|
+
import DataLoader from 'dataloader';
|
|
4
|
+
|
|
5
|
+
export default (unchainedAPI: UnchainedCore) =>
|
|
6
|
+
new DataLoader<{ sku: string }, Product>(async (queries) => {
|
|
7
|
+
const skus = [...new Set(queries.map((q) => q.sku).filter(Boolean))];
|
|
8
|
+
|
|
9
|
+
const products = await unchainedAPI.modules.products.findProducts({
|
|
10
|
+
productSelector: {
|
|
11
|
+
'warehousing.sku': { $in: skus },
|
|
12
|
+
status: { $exists: true },
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const productMap = {};
|
|
17
|
+
for (const product of products) {
|
|
18
|
+
productMap[product.warehousing!.sku!] = product;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return queries.map((q) => productMap[q.sku]);
|
|
22
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { UnchainedCore } from '@unchainedshop/core';
|
|
2
|
+
import DataLoader from 'dataloader';
|
|
3
|
+
import { ProductMediaText } from '@unchainedshop/core-products';
|
|
4
|
+
import buildLocaleMap from './buildLocaleMap.js';
|
|
5
|
+
import buildTextMap from './buildTextMap.js';
|
|
6
|
+
|
|
7
|
+
export default (unchainedAPI: UnchainedCore) =>
|
|
8
|
+
new DataLoader<{ productMediaId: string; locale: Intl.Locale }, ProductMediaText>(async (queries) => {
|
|
9
|
+
const productMediaIds = [...new Set(queries.map((q) => q.productMediaId).filter(Boolean))];
|
|
10
|
+
|
|
11
|
+
const texts = await unchainedAPI.modules.products.media.texts.findMediaTexts(
|
|
12
|
+
{ productMediaId: { $in: productMediaIds } },
|
|
13
|
+
{
|
|
14
|
+
sort: {
|
|
15
|
+
productMediaId: 1,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
const localeMap = buildLocaleMap(queries, texts);
|
|
21
|
+
const textsMap = buildTextMap(localeMap, texts, (text) => text.productMediaId);
|
|
22
|
+
|
|
23
|
+
return queries.map((q) => textsMap[q.locale + q.productMediaId]);
|
|
24
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { UnchainedCore } from '@unchainedshop/core';
|
|
2
|
+
import { ProductMedia } from '@unchainedshop/core-products';
|
|
3
|
+
import DataLoader from 'dataloader';
|
|
4
|
+
|
|
5
|
+
export default (unchainedAPI: UnchainedCore) =>
|
|
6
|
+
new DataLoader<{ productId?: string }, ProductMedia[]>(async (queries) => {
|
|
7
|
+
const productIds = [...new Set(queries.map((q) => q.productId).filter(Boolean))];
|
|
8
|
+
const productMediaItems = await unchainedAPI.modules.products.media.findProductMedias({
|
|
9
|
+
productId: { $in: productIds },
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const productMediaMap = {};
|
|
13
|
+
for (const productMedia of productMediaItems) {
|
|
14
|
+
if (!productMediaMap[productMedia.productId]) {
|
|
15
|
+
productMediaMap[productMedia.productId] = [productMedia];
|
|
16
|
+
} else {
|
|
17
|
+
productMediaMap[productMedia.productId].push(productMedia);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return queries.map((q) => productMediaMap[q.productId] || []);
|
|
21
|
+
});
|