@unchainedshop/api 3.0.0-alpha7 → 3.0.0-rc.11
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/README.md +1 -1
- package/lib/api-index.d.ts +4 -4
- package/lib/api-index.d.ts.map +1 -1
- package/lib/api-index.js +3 -2
- package/lib/api-index.js.map +1 -1
- package/lib/context.d.ts +32 -3
- package/lib/context.d.ts.map +1 -1
- package/lib/context.js +17 -21
- package/lib/context.js.map +1 -1
- package/lib/errors.d.ts +3 -0
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +3 -0
- package/lib/errors.js.map +1 -1
- package/lib/express/createBulkImportMiddleware.d.ts +2 -3
- package/lib/express/createBulkImportMiddleware.d.ts.map +1 -1
- package/lib/express/createBulkImportMiddleware.js +1 -1
- package/lib/express/createBulkImportMiddleware.js.map +1 -1
- package/lib/express/createERCMetadataMiddleware.d.ts +3 -5
- package/lib/express/createERCMetadataMiddleware.d.ts.map +1 -1
- package/lib/express/createERCMetadataMiddleware.js +13 -18
- package/lib/express/createERCMetadataMiddleware.js.map +1 -1
- package/lib/express/index.d.ts +2 -2
- package/lib/express/index.d.ts.map +1 -1
- package/lib/express/index.js +31 -12
- package/lib/express/index.js.map +1 -1
- package/lib/fastify/bulkImportHandler.d.ts +4 -0
- package/lib/fastify/bulkImportHandler.d.ts.map +1 -0
- package/lib/fastify/bulkImportHandler.js +47 -0
- package/lib/fastify/bulkImportHandler.js.map +1 -0
- package/lib/fastify/ercMetadataHandler.d.ts +4 -0
- package/lib/fastify/ercMetadataHandler.d.ts.map +1 -0
- package/lib/fastify/ercMetadataHandler.js +39 -0
- package/lib/fastify/ercMetadataHandler.js.map +1 -0
- package/lib/fastify/index.d.ts +2 -1
- package/lib/fastify/index.d.ts.map +1 -1
- package/lib/fastify/index.js +37 -17
- package/lib/fastify/index.js.map +1 -1
- package/lib/loaders/index.d.ts +63 -1
- package/lib/loaders/index.d.ts.map +1 -1
- package/lib/loaders/index.js +154 -86
- package/lib/loaders/index.js.map +1 -1
- package/lib/locale-context.d.ts +13 -4
- package/lib/locale-context.d.ts.map +1 -1
- package/lib/locale-context.js +10 -12
- package/lib/locale-context.js.map +1 -1
- package/lib/resolvers/mutations/accounts/addEmail.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/addEmail.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/addWeb3Address.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/addWeb3Address.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/addWebAuthnCredentials.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/addWebAuthnCredentials.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/addWebAuthnCredentials.js +3 -0
- package/lib/resolvers/mutations/accounts/addWebAuthnCredentials.js.map +1 -1
- package/lib/resolvers/mutations/accounts/changePassword.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/changePassword.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/createUser.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/createUser.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/createWebAuthnCredentialCreationOptions.d.ts +5 -2
- package/lib/resolvers/mutations/accounts/createWebAuthnCredentialCreationOptions.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/createWebAuthnCredentialCreationOptions.js.map +1 -1
- package/lib/resolvers/mutations/accounts/createWebAuthnCredentialRequestOptions.d.ts +5 -2
- package/lib/resolvers/mutations/accounts/createWebAuthnCredentialRequestOptions.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/createWebAuthnCredentialRequestOptions.js +2 -2
- package/lib/resolvers/mutations/accounts/createWebAuthnCredentialRequestOptions.js.map +1 -1
- package/lib/resolvers/mutations/accounts/enrollUser.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/enrollUser.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/forgotPassword.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/forgotPassword.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/loginAsGuest.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/loginAsGuest.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/loginAsGuest.js +2 -2
- package/lib/resolvers/mutations/accounts/loginAsGuest.js.map +1 -1
- package/lib/resolvers/mutations/accounts/loginWithPassword.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/loginWithPassword.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/loginWithPassword.js +2 -2
- package/lib/resolvers/mutations/accounts/loginWithPassword.js.map +1 -1
- package/lib/resolvers/mutations/accounts/loginWithWebAuthn.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/loginWithWebAuthn.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/loginWithWebAuthn.js +4 -1
- package/lib/resolvers/mutations/accounts/loginWithWebAuthn.js.map +1 -1
- package/lib/resolvers/mutations/accounts/logout.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/logout.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/removeEmail.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/removeEmail.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/removeWeb3Address.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/removeWeb3Address.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/removeWebAuthnCredentials.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/removeWebAuthnCredentials.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/resetPassword.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/resetPassword.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/resetPassword.js +12 -43
- package/lib/resolvers/mutations/accounts/resetPassword.js.map +1 -1
- package/lib/resolvers/mutations/accounts/sendEnrollmentEmail.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/sendEnrollmentEmail.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/sendVerificationEmail.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/sendVerificationEmail.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/setPassword.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/setPassword.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/setUsername.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/setUsername.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/verifyEmail.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/verifyEmail.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/verifyWeb3Address.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/verifyWeb3Address.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/verifyWeb3Address.js +3 -1
- package/lib/resolvers/mutations/accounts/verifyWeb3Address.js.map +1 -1
- package/lib/resolvers/mutations/assortments/addAssortmentFilter.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/addAssortmentFilter.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/addAssortmentLink.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/addAssortmentLink.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/addAssortmentProduct.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/addAssortmentProduct.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/createAssortment.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/createAssortment.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/prepareAssortmentMediaUpload.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/prepareAssortmentMediaUpload.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/prepareAssortmentMediaUpload.js +1 -1
- package/lib/resolvers/mutations/assortments/prepareAssortmentMediaUpload.js.map +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortment.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortment.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortmentFilter.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortmentFilter.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortmentLink.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortmentLink.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortmentMedia.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortmentMedia.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortmentProduct.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortmentProduct.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentFilters.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentFilters.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentLinks.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentLinks.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentMedia.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentMedia.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentProducts.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentProducts.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/setBaseAssortment.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/setBaseAssortment.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/updateAssortment.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/updateAssortment.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/updateAssortmentMediaTexts.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/updateAssortmentMediaTexts.d.ts.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/bookmarks/bookmark.d.ts +1 -1
- package/lib/resolvers/mutations/bookmarks/bookmark.d.ts.map +1 -1
- package/lib/resolvers/mutations/bookmarks/createBookmark.d.ts +1 -1
- package/lib/resolvers/mutations/bookmarks/createBookmark.d.ts.map +1 -1
- package/lib/resolvers/mutations/bookmarks/removeBookmark.d.ts +1 -1
- package/lib/resolvers/mutations/bookmarks/removeBookmark.d.ts.map +1 -1
- package/lib/resolvers/mutations/countries/createCountry.d.ts +1 -1
- package/lib/resolvers/mutations/countries/createCountry.d.ts.map +1 -1
- package/lib/resolvers/mutations/countries/removeCountry.d.ts +1 -1
- package/lib/resolvers/mutations/countries/removeCountry.d.ts.map +1 -1
- package/lib/resolvers/mutations/countries/updateCountry.d.ts +2 -4
- package/lib/resolvers/mutations/countries/updateCountry.d.ts.map +1 -1
- package/lib/resolvers/mutations/countries/updateCountry.js +1 -5
- package/lib/resolvers/mutations/countries/updateCountry.js.map +1 -1
- package/lib/resolvers/mutations/currencies/createCurrency.d.ts +1 -1
- package/lib/resolvers/mutations/currencies/createCurrency.d.ts.map +1 -1
- package/lib/resolvers/mutations/currencies/removeCurrency.d.ts +1 -1
- package/lib/resolvers/mutations/currencies/removeCurrency.d.ts.map +1 -1
- package/lib/resolvers/mutations/currencies/updateCurrency.d.ts +1 -1
- package/lib/resolvers/mutations/currencies/updateCurrency.d.ts.map +1 -1
- package/lib/resolvers/mutations/delivery/createDeliveryProvider.d.ts +1 -1
- package/lib/resolvers/mutations/delivery/createDeliveryProvider.d.ts.map +1 -1
- package/lib/resolvers/mutations/delivery/createDeliveryProvider.js +5 -0
- package/lib/resolvers/mutations/delivery/createDeliveryProvider.js.map +1 -1
- package/lib/resolvers/mutations/delivery/removeDeliveryProvider.d.ts +1 -1
- package/lib/resolvers/mutations/delivery/removeDeliveryProvider.d.ts.map +1 -1
- package/lib/resolvers/mutations/delivery/updateDeliveryProvider.d.ts +1 -1
- package/lib/resolvers/mutations/delivery/updateDeliveryProvider.d.ts.map +1 -1
- package/lib/resolvers/mutations/enrollments/activateEnrollment.d.ts +1 -1
- package/lib/resolvers/mutations/enrollments/activateEnrollment.d.ts.map +1 -1
- package/lib/resolvers/mutations/enrollments/activateEnrollment.js +2 -2
- package/lib/resolvers/mutations/enrollments/activateEnrollment.js.map +1 -1
- package/lib/resolvers/mutations/enrollments/createEnrollment.d.ts +2 -2
- package/lib/resolvers/mutations/enrollments/createEnrollment.d.ts.map +1 -1
- package/lib/resolvers/mutations/enrollments/createEnrollment.js +7 -3
- package/lib/resolvers/mutations/enrollments/createEnrollment.js.map +1 -1
- package/lib/resolvers/mutations/enrollments/terminateEnrollment.d.ts +2 -2
- package/lib/resolvers/mutations/enrollments/terminateEnrollment.d.ts.map +1 -1
- package/lib/resolvers/mutations/enrollments/terminateEnrollment.js +2 -2
- package/lib/resolvers/mutations/enrollments/terminateEnrollment.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/enrollments/updateEnrollment.js +3 -2
- package/lib/resolvers/mutations/enrollments/updateEnrollment.js.map +1 -1
- package/lib/resolvers/mutations/files/confirmMediaUpload.d.ts +1 -1
- package/lib/resolvers/mutations/files/confirmMediaUpload.d.ts.map +1 -1
- package/lib/resolvers/mutations/files/confirmMediaUpload.js +1 -1
- package/lib/resolvers/mutations/files/confirmMediaUpload.js.map +1 -1
- package/lib/resolvers/mutations/filters/createFilter.d.ts +3 -2
- package/lib/resolvers/mutations/filters/createFilter.d.ts.map +1 -1
- package/lib/resolvers/mutations/filters/createFilter.js +3 -1
- package/lib/resolvers/mutations/filters/createFilter.js.map +1 -1
- package/lib/resolvers/mutations/filters/createFilterOption.d.ts +2 -2
- package/lib/resolvers/mutations/filters/createFilterOption.d.ts.map +1 -1
- package/lib/resolvers/mutations/filters/createFilterOption.js +3 -1
- package/lib/resolvers/mutations/filters/createFilterOption.js.map +1 -1
- package/lib/resolvers/mutations/filters/removeFilter.d.ts +1 -1
- package/lib/resolvers/mutations/filters/removeFilter.d.ts.map +1 -1
- package/lib/resolvers/mutations/filters/removeFilterOption.d.ts +1 -1
- package/lib/resolvers/mutations/filters/removeFilterOption.d.ts.map +1 -1
- package/lib/resolvers/mutations/filters/removeFilterOption.js +3 -1
- package/lib/resolvers/mutations/filters/removeFilterOption.js.map +1 -1
- package/lib/resolvers/mutations/filters/updateFilter.d.ts +1 -1
- package/lib/resolvers/mutations/filters/updateFilter.d.ts.map +1 -1
- package/lib/resolvers/mutations/filters/updateFilter.js +4 -1
- package/lib/resolvers/mutations/filters/updateFilter.js.map +1 -1
- package/lib/resolvers/mutations/filters/updateFilterTexts.d.ts +1 -1
- package/lib/resolvers/mutations/filters/updateFilterTexts.d.ts.map +1 -1
- package/lib/resolvers/mutations/index.d.ts +2 -0
- package/lib/resolvers/mutations/index.d.ts.map +1 -1
- package/lib/resolvers/mutations/index.js +3 -1
- package/lib/resolvers/mutations/index.js.map +1 -1
- package/lib/resolvers/mutations/languages/createLanguage.d.ts +1 -1
- package/lib/resolvers/mutations/languages/createLanguage.d.ts.map +1 -1
- package/lib/resolvers/mutations/languages/removeLanguage.d.ts +1 -1
- package/lib/resolvers/mutations/languages/removeLanguage.d.ts.map +1 -1
- package/lib/resolvers/mutations/languages/updateLanguage.d.ts +1 -1
- package/lib/resolvers/mutations/languages/updateLanguage.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/addCartDiscount.d.ts +1 -1
- package/lib/resolvers/mutations/orders/addCartDiscount.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/addCartDiscount.js +16 -6
- package/lib/resolvers/mutations/orders/addCartDiscount.js.map +1 -1
- package/lib/resolvers/mutations/orders/addCartProduct.d.ts +2 -2
- package/lib/resolvers/mutations/orders/addCartProduct.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/addCartProduct.js +30 -13
- package/lib/resolvers/mutations/orders/addCartProduct.js.map +1 -1
- package/lib/resolvers/mutations/orders/addCartQuotation.d.ts +1 -1
- package/lib/resolvers/mutations/orders/addCartQuotation.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/addCartQuotation.js +21 -10
- package/lib/resolvers/mutations/orders/addCartQuotation.js.map +1 -1
- package/lib/resolvers/mutations/orders/addMultipleCartProducts.d.ts +2 -2
- package/lib/resolvers/mutations/orders/addMultipleCartProducts.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/addMultipleCartProducts.js +29 -11
- package/lib/resolvers/mutations/orders/addMultipleCartProducts.js.map +1 -1
- package/lib/resolvers/mutations/orders/checkoutCart.d.ts +2 -2
- package/lib/resolvers/mutations/orders/checkoutCart.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/checkoutCart.js +14 -8
- package/lib/resolvers/mutations/orders/checkoutCart.js.map +1 -1
- package/lib/resolvers/mutations/orders/confirmOrder.d.ts +2 -2
- package/lib/resolvers/mutations/orders/confirmOrder.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/confirmOrder.js +2 -2
- package/lib/resolvers/mutations/orders/confirmOrder.js.map +1 -1
- package/lib/resolvers/mutations/orders/createCart.d.ts +2 -2
- package/lib/resolvers/mutations/orders/createCart.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/createCart.js +6 -1
- package/lib/resolvers/mutations/orders/createCart.js.map +1 -1
- package/lib/resolvers/mutations/orders/deliverOrder.d.ts +1 -1
- package/lib/resolvers/mutations/orders/deliverOrder.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/deliverOrder.js +2 -2
- package/lib/resolvers/mutations/orders/deliverOrder.js.map +1 -1
- package/lib/resolvers/mutations/orders/emptyCart.d.ts +2 -2
- package/lib/resolvers/mutations/orders/emptyCart.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/emptyCart.js +10 -5
- package/lib/resolvers/mutations/orders/emptyCart.js.map +1 -1
- package/lib/resolvers/mutations/orders/payOrder.d.ts +1 -1
- package/lib/resolvers/mutations/orders/payOrder.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/payOrder.js +2 -2
- package/lib/resolvers/mutations/orders/payOrder.js.map +1 -1
- package/lib/resolvers/mutations/orders/rejectOrder.d.ts +2 -2
- package/lib/resolvers/mutations/orders/rejectOrder.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/rejectOrder.js +2 -2
- package/lib/resolvers/mutations/orders/rejectOrder.js.map +1 -1
- package/lib/resolvers/mutations/orders/removeCartDiscount.d.ts +2 -2
- package/lib/resolvers/mutations/orders/removeCartDiscount.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/removeCartDiscount.js +16 -4
- package/lib/resolvers/mutations/orders/removeCartDiscount.js.map +1 -1
- package/lib/resolvers/mutations/orders/removeCartItem.d.ts +1 -1
- package/lib/resolvers/mutations/orders/removeCartItem.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/removeCartItem.js +2 -2
- package/lib/resolvers/mutations/orders/removeCartItem.js.map +1 -1
- package/lib/resolvers/mutations/orders/removeOrder.d.ts +1 -1
- package/lib/resolvers/mutations/orders/removeOrder.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/setOrderDeliveryProvider.d.ts +2 -2
- package/lib/resolvers/mutations/orders/setOrderDeliveryProvider.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/setOrderDeliveryProvider.js +3 -3
- package/lib/resolvers/mutations/orders/setOrderDeliveryProvider.js.map +1 -1
- package/lib/resolvers/mutations/orders/setOrderPaymentProvider.d.ts +2 -2
- package/lib/resolvers/mutations/orders/setOrderPaymentProvider.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/setOrderPaymentProvider.js +3 -3
- package/lib/resolvers/mutations/orders/setOrderPaymentProvider.js.map +1 -1
- package/lib/resolvers/mutations/orders/signPaymentProviderForCheckout.d.ts +1 -1
- package/lib/resolvers/mutations/orders/signPaymentProviderForCheckout.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/signPaymentProviderForCheckout.js +4 -2
- package/lib/resolvers/mutations/orders/signPaymentProviderForCheckout.js.map +1 -1
- package/lib/resolvers/mutations/orders/updateCart.d.ts +3 -3
- package/lib/resolvers/mutations/orders/updateCart.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/updateCart.js +12 -7
- package/lib/resolvers/mutations/orders/updateCart.js.map +1 -1
- package/lib/resolvers/mutations/orders/updateCartItem.d.ts +1 -1
- package/lib/resolvers/mutations/orders/updateCartItem.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/updateCartItem.js +13 -7
- package/lib/resolvers/mutations/orders/updateCartItem.js.map +1 -1
- package/lib/resolvers/mutations/orders/updateOrderDeliveryPickUp.d.ts +1 -1
- package/lib/resolvers/mutations/orders/updateOrderDeliveryPickUp.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/updateOrderDeliveryPickUp.js +2 -2
- package/lib/resolvers/mutations/orders/updateOrderDeliveryPickUp.js.map +1 -1
- package/lib/resolvers/mutations/orders/updateOrderDeliveryShipping.d.ts +1 -1
- package/lib/resolvers/mutations/orders/updateOrderDeliveryShipping.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/updateOrderDeliveryShipping.js +2 -2
- package/lib/resolvers/mutations/orders/updateOrderDeliveryShipping.js.map +1 -1
- package/lib/resolvers/mutations/orders/updateOrderPaymentCard.d.ts +1 -1
- package/lib/resolvers/mutations/orders/updateOrderPaymentCard.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/updateOrderPaymentCard.js +2 -2
- package/lib/resolvers/mutations/orders/updateOrderPaymentCard.js.map +1 -1
- package/lib/resolvers/mutations/orders/updateOrderPaymentGeneric.d.ts +1 -1
- package/lib/resolvers/mutations/orders/updateOrderPaymentGeneric.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/updateOrderPaymentGeneric.js +2 -2
- package/lib/resolvers/mutations/orders/updateOrderPaymentGeneric.js.map +1 -1
- package/lib/resolvers/mutations/orders/updateOrderPaymentInvoice.d.ts +1 -1
- package/lib/resolvers/mutations/orders/updateOrderPaymentInvoice.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/updateOrderPaymentInvoice.js +2 -2
- package/lib/resolvers/mutations/orders/updateOrderPaymentInvoice.js.map +1 -1
- package/lib/resolvers/mutations/payment/createPaymentProvider.d.ts +1 -1
- package/lib/resolvers/mutations/payment/createPaymentProvider.d.ts.map +1 -1
- package/lib/resolvers/mutations/payment/createPaymentProvider.js +6 -4
- package/lib/resolvers/mutations/payment/createPaymentProvider.js.map +1 -1
- package/lib/resolvers/mutations/payment/markPaymentCredentialsPreferred.d.ts +1 -1
- package/lib/resolvers/mutations/payment/markPaymentCredentialsPreferred.d.ts.map +1 -1
- package/lib/resolvers/mutations/payment/registerPaymentCredentials.d.ts +1 -1
- package/lib/resolvers/mutations/payment/registerPaymentCredentials.d.ts.map +1 -1
- package/lib/resolvers/mutations/payment/registerPaymentCredentials.js +5 -2
- package/lib/resolvers/mutations/payment/registerPaymentCredentials.js.map +1 -1
- package/lib/resolvers/mutations/payment/removePaymentCredentials.d.ts +1 -1
- package/lib/resolvers/mutations/payment/removePaymentCredentials.d.ts.map +1 -1
- package/lib/resolvers/mutations/payment/removePaymentProvider.d.ts +1 -1
- package/lib/resolvers/mutations/payment/removePaymentProvider.d.ts.map +1 -1
- package/lib/resolvers/mutations/payment/signPaymentProviderForCredentialRegistration.d.ts +1 -1
- package/lib/resolvers/mutations/payment/signPaymentProviderForCredentialRegistration.d.ts.map +1 -1
- package/lib/resolvers/mutations/payment/signPaymentProviderForCredentialRegistration.js +6 -3
- package/lib/resolvers/mutations/payment/signPaymentProviderForCredentialRegistration.js.map +1 -1
- package/lib/resolvers/mutations/payment/updatePaymentProvider.d.ts +1 -1
- package/lib/resolvers/mutations/payment/updatePaymentProvider.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/addProductReviewVote.d.ts +1 -1
- package/lib/resolvers/mutations/products/addProductReviewVote.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/createProduct.d.ts +1 -1
- package/lib/resolvers/mutations/products/createProduct.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/createProductBundleItem.d.ts +1 -1
- package/lib/resolvers/mutations/products/createProductBundleItem.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/createProductReview.d.ts +1 -1
- package/lib/resolvers/mutations/products/createProductReview.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/createProductVariation.d.ts +6 -1
- 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/createProductVariationOption.d.ts +2 -1
- package/lib/resolvers/mutations/products/createProductVariationOption.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/createProductVariationOption.js.map +1 -1
- package/lib/resolvers/mutations/products/prepareProductMediaUpload.d.ts +1 -1
- package/lib/resolvers/mutations/products/prepareProductMediaUpload.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/prepareProductMediaUpload.js +1 -1
- package/lib/resolvers/mutations/products/prepareProductMediaUpload.js.map +1 -1
- package/lib/resolvers/mutations/products/publishProduct.d.ts +1 -1
- package/lib/resolvers/mutations/products/publishProduct.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/removeBundleItem.d.ts +1 -1
- package/lib/resolvers/mutations/products/removeBundleItem.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/removeProduct.d.ts +1 -1
- package/lib/resolvers/mutations/products/removeProduct.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/removeProduct.js +1 -1
- package/lib/resolvers/mutations/products/removeProduct.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/removeProductMedia.d.ts +1 -1
- package/lib/resolvers/mutations/products/removeProductMedia.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/removeProductReview.d.ts +1 -1
- package/lib/resolvers/mutations/products/removeProductReview.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/removeProductReviewVote.d.ts +1 -1
- package/lib/resolvers/mutations/products/removeProductReviewVote.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/removeProductVariation.d.ts +1 -1
- package/lib/resolvers/mutations/products/removeProductVariation.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/removeProductVariationOption.d.ts +1 -1
- package/lib/resolvers/mutations/products/removeProductVariationOption.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/reorderProductMedia.d.ts +1 -1
- package/lib/resolvers/mutations/products/reorderProductMedia.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/unpublishProduct.d.ts +1 -1
- package/lib/resolvers/mutations/products/unpublishProduct.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/updateProduct.d.ts +1 -1
- package/lib/resolvers/mutations/products/updateProduct.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/updateProductCommerce.d.ts +1 -1
- package/lib/resolvers/mutations/products/updateProductCommerce.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/updateProductMediaTexts.d.ts +1 -1
- package/lib/resolvers/mutations/products/updateProductMediaTexts.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/updateProductPlan.d.ts +1 -1
- package/lib/resolvers/mutations/products/updateProductPlan.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/updateProductReview.d.ts +1 -1
- package/lib/resolvers/mutations/products/updateProductReview.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/updateProductSupply.d.ts +1 -1
- package/lib/resolvers/mutations/products/updateProductSupply.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/updateProductTexts.d.ts +1 -1
- package/lib/resolvers/mutations/products/updateProductTexts.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/updateProductTokenization.d.ts +1 -1
- package/lib/resolvers/mutations/products/updateProductTokenization.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/updateProductVariationTexts.d.ts +1 -1
- package/lib/resolvers/mutations/products/updateProductVariationTexts.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/updateProductWarehousing.d.ts +1 -1
- package/lib/resolvers/mutations/products/updateProductWarehousing.d.ts.map +1 -1
- package/lib/resolvers/mutations/quotations/makeQuotationProposal.d.ts +2 -2
- package/lib/resolvers/mutations/quotations/makeQuotationProposal.d.ts.map +1 -1
- package/lib/resolvers/mutations/quotations/makeQuotationProposal.js +2 -2
- package/lib/resolvers/mutations/quotations/makeQuotationProposal.js.map +1 -1
- package/lib/resolvers/mutations/quotations/rejectQuotation.d.ts +2 -2
- package/lib/resolvers/mutations/quotations/rejectQuotation.d.ts.map +1 -1
- package/lib/resolvers/mutations/quotations/rejectQuotation.js +2 -2
- package/lib/resolvers/mutations/quotations/rejectQuotation.js.map +1 -1
- package/lib/resolvers/mutations/quotations/requestQuotation.d.ts +1 -1
- package/lib/resolvers/mutations/quotations/requestQuotation.d.ts.map +1 -1
- package/lib/resolvers/mutations/quotations/requestQuotation.js +5 -3
- package/lib/resolvers/mutations/quotations/requestQuotation.js.map +1 -1
- package/lib/resolvers/mutations/quotations/verifyQuotation.d.ts +2 -2
- package/lib/resolvers/mutations/quotations/verifyQuotation.d.ts.map +1 -1
- package/lib/resolvers/mutations/quotations/verifyQuotation.js +2 -2
- package/lib/resolvers/mutations/quotations/verifyQuotation.js.map +1 -1
- package/lib/resolvers/mutations/users/addPushSubscription.d.ts +1 -1
- package/lib/resolvers/mutations/users/addPushSubscription.d.ts.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/prepareUserAvatarUpload.d.ts +1 -1
- package/lib/resolvers/mutations/users/prepareUserAvatarUpload.d.ts.map +1 -1
- package/lib/resolvers/mutations/users/prepareUserAvatarUpload.js +1 -1
- package/lib/resolvers/mutations/users/prepareUserAvatarUpload.js.map +1 -1
- package/lib/resolvers/mutations/users/removePushSubscription.d.ts +1 -1
- package/lib/resolvers/mutations/users/removePushSubscription.d.ts.map +1 -1
- package/lib/resolvers/mutations/users/removeUser.d.ts +3 -2
- package/lib/resolvers/mutations/users/removeUser.d.ts.map +1 -1
- package/lib/resolvers/mutations/users/removeUser.js +8 -4
- package/lib/resolvers/mutations/users/removeUser.js.map +1 -1
- package/lib/resolvers/mutations/users/removeUserProductReviews.d.ts +5 -0
- package/lib/resolvers/mutations/users/removeUserProductReviews.d.ts.map +1 -0
- package/lib/resolvers/mutations/users/removeUserProductReviews.js +15 -0
- package/lib/resolvers/mutations/users/removeUserProductReviews.js.map +1 -0
- package/lib/resolvers/mutations/users/setRoles.d.ts +1 -1
- package/lib/resolvers/mutations/users/setRoles.d.ts.map +1 -1
- package/lib/resolvers/mutations/users/setUserTags.d.ts +1 -1
- package/lib/resolvers/mutations/users/setUserTags.d.ts.map +1 -1
- package/lib/resolvers/mutations/users/updateUserProfile.d.ts +1 -1
- package/lib/resolvers/mutations/users/updateUserProfile.d.ts.map +1 -1
- package/lib/resolvers/mutations/users/updateUserProfile.js +1 -1
- package/lib/resolvers/mutations/users/updateUserProfile.js.map +1 -1
- package/lib/resolvers/mutations/warehousing/createWarehousingProvider.d.ts +2 -2
- package/lib/resolvers/mutations/warehousing/createWarehousingProvider.d.ts.map +1 -1
- package/lib/resolvers/mutations/warehousing/createWarehousingProvider.js +11 -6
- package/lib/resolvers/mutations/warehousing/createWarehousingProvider.js.map +1 -1
- package/lib/resolvers/mutations/warehousing/exportToken.d.ts +1 -1
- package/lib/resolvers/mutations/warehousing/exportToken.d.ts.map +1 -1
- package/lib/resolvers/mutations/warehousing/invalidateToken.d.ts +1 -1
- package/lib/resolvers/mutations/warehousing/invalidateToken.d.ts.map +1 -1
- package/lib/resolvers/mutations/warehousing/invalidateToken.js +8 -3
- package/lib/resolvers/mutations/warehousing/invalidateToken.js.map +1 -1
- package/lib/resolvers/mutations/warehousing/removeWarehousingProvider.d.ts +1 -1
- package/lib/resolvers/mutations/warehousing/removeWarehousingProvider.d.ts.map +1 -1
- package/lib/resolvers/mutations/warehousing/updateWarehousingProvider.d.ts +2 -2
- package/lib/resolvers/mutations/warehousing/updateWarehousingProvider.d.ts.map +1 -1
- package/lib/resolvers/mutations/warehousing/updateWarehousingProvider.js +1 -2
- package/lib/resolvers/mutations/warehousing/updateWarehousingProvider.js.map +1 -1
- package/lib/resolvers/mutations/worker/addWork.d.ts +3 -3
- package/lib/resolvers/mutations/worker/addWork.d.ts.map +1 -1
- package/lib/resolvers/mutations/worker/addWork.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/finishWork.d.ts +1 -1
- package/lib/resolvers/mutations/worker/finishWork.d.ts.map +1 -1
- package/lib/resolvers/mutations/worker/processNextWork.d.ts +1 -1
- package/lib/resolvers/mutations/worker/processNextWork.d.ts.map +1 -1
- package/lib/resolvers/mutations/worker/processNextWork.js +2 -1
- package/lib/resolvers/mutations/worker/processNextWork.js.map +1 -1
- package/lib/resolvers/mutations/worker/removeWork.d.ts +1 -1
- package/lib/resolvers/mutations/worker/removeWork.d.ts.map +1 -1
- package/lib/resolvers/queries/assortments/assortment.d.ts +1 -1
- package/lib/resolvers/queries/assortments/assortment.d.ts.map +1 -1
- package/lib/resolvers/queries/assortments/assortments.d.ts +1 -1
- package/lib/resolvers/queries/assortments/assortments.d.ts.map +1 -1
- package/lib/resolvers/queries/assortments/assortmentsCount.d.ts +1 -1
- package/lib/resolvers/queries/assortments/assortmentsCount.d.ts.map +1 -1
- package/lib/resolvers/queries/assortments/translatedAssortmentMediaTexts.d.ts +1 -1
- package/lib/resolvers/queries/assortments/translatedAssortmentMediaTexts.d.ts.map +1 -1
- package/lib/resolvers/queries/assortments/translatedAssortmentTexts.d.ts +1 -1
- package/lib/resolvers/queries/assortments/translatedAssortmentTexts.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/countriesCount.d.ts +1 -1
- package/lib/resolvers/queries/countries/countriesCount.d.ts.map +1 -1
- package/lib/resolvers/queries/countries/country.d.ts +1 -1
- package/lib/resolvers/queries/countries/country.d.ts.map +1 -1
- package/lib/resolvers/queries/currencies/currencies.d.ts +1 -1
- package/lib/resolvers/queries/currencies/currencies.d.ts.map +1 -1
- package/lib/resolvers/queries/currencies/currenciesCount.d.ts +1 -1
- package/lib/resolvers/queries/currencies/currenciesCount.d.ts.map +1 -1
- package/lib/resolvers/queries/currencies/currency.d.ts +1 -1
- package/lib/resolvers/queries/currencies/currency.d.ts.map +1 -1
- package/lib/resolvers/queries/delivery/deliveryInterfaces.d.ts +6 -2
- package/lib/resolvers/queries/delivery/deliveryInterfaces.d.ts.map +1 -1
- package/lib/resolvers/queries/delivery/deliveryInterfaces.js +9 -2
- package/lib/resolvers/queries/delivery/deliveryInterfaces.js.map +1 -1
- package/lib/resolvers/queries/delivery/deliveryProvider.d.ts +1 -1
- package/lib/resolvers/queries/delivery/deliveryProvider.d.ts.map +1 -1
- package/lib/resolvers/queries/delivery/deliveryProviders.d.ts +5 -3
- package/lib/resolvers/queries/delivery/deliveryProviders.d.ts.map +1 -1
- package/lib/resolvers/queries/delivery/deliveryProviders.js.map +1 -1
- package/lib/resolvers/queries/delivery/deliveryProvidersCount.d.ts +5 -3
- package/lib/resolvers/queries/delivery/deliveryProvidersCount.d.ts.map +1 -1
- package/lib/resolvers/queries/delivery/deliveryProvidersCount.js.map +1 -1
- package/lib/resolvers/queries/enrollments/enrollment.d.ts +1 -1
- package/lib/resolvers/queries/enrollments/enrollment.d.ts.map +1 -1
- package/lib/resolvers/queries/enrollments/enrollments.d.ts +1 -1
- package/lib/resolvers/queries/enrollments/enrollments.d.ts.map +1 -1
- package/lib/resolvers/queries/enrollments/enrollmentsCount.d.ts +1 -1
- package/lib/resolvers/queries/enrollments/enrollmentsCount.d.ts.map +1 -1
- package/lib/resolvers/queries/events/event.d.ts +1 -1
- package/lib/resolvers/queries/events/event.d.ts.map +1 -1
- package/lib/resolvers/queries/events/eventStatistics.d.ts +3 -3
- package/lib/resolvers/queries/events/eventStatistics.d.ts.map +1 -1
- package/lib/resolvers/queries/events/eventStatistics.js +2 -1
- package/lib/resolvers/queries/events/eventStatistics.js.map +1 -1
- package/lib/resolvers/queries/events/events.d.ts +1 -1
- package/lib/resolvers/queries/events/events.d.ts.map +1 -1
- package/lib/resolvers/queries/events/eventsCounts.d.ts +1 -1
- package/lib/resolvers/queries/events/eventsCounts.d.ts.map +1 -1
- package/lib/resolvers/queries/filters/filter.d.ts +1 -1
- package/lib/resolvers/queries/filters/filter.d.ts.map +1 -1
- package/lib/resolvers/queries/filters/filters.d.ts +1 -1
- package/lib/resolvers/queries/filters/filters.d.ts.map +1 -1
- package/lib/resolvers/queries/filters/filtersCount.d.ts +1 -1
- package/lib/resolvers/queries/filters/filtersCount.d.ts.map +1 -1
- package/lib/resolvers/queries/filters/searchAssortments.d.ts +10 -2
- package/lib/resolvers/queries/filters/searchAssortments.d.ts.map +1 -1
- package/lib/resolvers/queries/filters/searchAssortments.js +3 -3
- package/lib/resolvers/queries/filters/searchAssortments.js.map +1 -1
- package/lib/resolvers/queries/filters/searchProducts.d.ts +7 -2
- package/lib/resolvers/queries/filters/searchProducts.d.ts.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/filters/translatedFilterTexts.d.ts +1 -1
- package/lib/resolvers/queries/filters/translatedFilterTexts.d.ts.map +1 -1
- package/lib/resolvers/queries/languages/language.d.ts +1 -1
- package/lib/resolvers/queries/languages/language.d.ts.map +1 -1
- package/lib/resolvers/queries/languages/languages.d.ts +1 -1
- package/lib/resolvers/queries/languages/languages.d.ts.map +1 -1
- package/lib/resolvers/queries/languages/languagesCount.d.ts +1 -1
- package/lib/resolvers/queries/languages/languagesCount.d.ts.map +1 -1
- package/lib/resolvers/queries/orders/order.d.ts +1 -1
- package/lib/resolvers/queries/orders/order.d.ts.map +1 -1
- package/lib/resolvers/queries/orders/orderStatistics.d.ts +3 -3
- package/lib/resolvers/queries/orders/orderStatistics.d.ts.map +1 -1
- package/lib/resolvers/queries/orders/orderStatistics.js +2 -1
- package/lib/resolvers/queries/orders/orderStatistics.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/ordersCount.d.ts +1 -1
- package/lib/resolvers/queries/orders/ordersCount.d.ts.map +1 -1
- package/lib/resolvers/queries/payment/paymentInterfaces.d.ts +6 -2
- package/lib/resolvers/queries/payment/paymentInterfaces.d.ts.map +1 -1
- package/lib/resolvers/queries/payment/paymentInterfaces.js +9 -2
- package/lib/resolvers/queries/payment/paymentInterfaces.js.map +1 -1
- package/lib/resolvers/queries/payment/paymentProvider.d.ts +1 -1
- package/lib/resolvers/queries/payment/paymentProvider.d.ts.map +1 -1
- package/lib/resolvers/queries/payment/paymentProviders.d.ts +1 -1
- package/lib/resolvers/queries/payment/paymentProviders.d.ts.map +1 -1
- package/lib/resolvers/queries/payment/paymentProvidersCount.d.ts +1 -1
- package/lib/resolvers/queries/payment/paymentProvidersCount.d.ts.map +1 -1
- package/lib/resolvers/queries/products/product.d.ts +1 -1
- package/lib/resolvers/queries/products/product.d.ts.map +1 -1
- package/lib/resolvers/queries/products/productCatalogPrices.d.ts +1 -1
- package/lib/resolvers/queries/products/productCatalogPrices.d.ts.map +1 -1
- package/lib/resolvers/queries/products/productReview.d.ts +1 -1
- package/lib/resolvers/queries/products/productReview.d.ts.map +1 -1
- package/lib/resolvers/queries/products/productReviews.d.ts +1 -1
- package/lib/resolvers/queries/products/productReviews.d.ts.map +1 -1
- package/lib/resolvers/queries/products/productReviewsCount.d.ts +1 -1
- package/lib/resolvers/queries/products/productReviewsCount.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/products/productsCount.d.ts +1 -1
- package/lib/resolvers/queries/products/productsCount.d.ts.map +1 -1
- package/lib/resolvers/queries/products/translatedProductMediaTexts.d.ts +1 -1
- package/lib/resolvers/queries/products/translatedProductMediaTexts.d.ts.map +1 -1
- package/lib/resolvers/queries/products/translatedProductTexts.d.ts +1 -1
- package/lib/resolvers/queries/products/translatedProductTexts.d.ts.map +1 -1
- package/lib/resolvers/queries/products/translatedProductVariationTexts.d.ts +1 -1
- package/lib/resolvers/queries/products/translatedProductVariationTexts.d.ts.map +1 -1
- package/lib/resolvers/queries/quotations/quotation.d.ts +1 -1
- package/lib/resolvers/queries/quotations/quotation.d.ts.map +1 -1
- package/lib/resolvers/queries/quotations/quotations.d.ts +1 -1
- package/lib/resolvers/queries/quotations/quotations.d.ts.map +1 -1
- package/lib/resolvers/queries/quotations/quotationsCount.d.ts +1 -1
- package/lib/resolvers/queries/quotations/quotationsCount.d.ts.map +1 -1
- package/lib/resolvers/queries/shopInfo.d.ts +1 -1
- package/lib/resolvers/queries/shopInfo.d.ts.map +1 -1
- package/lib/resolvers/queries/users/me.d.ts +1 -1
- package/lib/resolvers/queries/users/me.d.ts.map +1 -1
- package/lib/resolvers/queries/users/user.d.ts +1 -1
- package/lib/resolvers/queries/users/user.d.ts.map +1 -1
- package/lib/resolvers/queries/users/users.d.ts +5 -2
- package/lib/resolvers/queries/users/users.d.ts.map +1 -1
- package/lib/resolvers/queries/users/users.js +1 -0
- package/lib/resolvers/queries/users/users.js.map +1 -1
- package/lib/resolvers/queries/users/usersCount.d.ts +1 -1
- package/lib/resolvers/queries/users/usersCount.d.ts.map +1 -1
- package/lib/resolvers/queries/users/validateResetPasswordToken.d.ts +1 -1
- package/lib/resolvers/queries/users/validateResetPasswordToken.d.ts.map +1 -1
- package/lib/resolvers/queries/users/validateResetPasswordToken.js +2 -2
- package/lib/resolvers/queries/users/validateResetPasswordToken.js.map +1 -1
- package/lib/resolvers/queries/users/validateVerifyEmailToken.d.ts +1 -1
- package/lib/resolvers/queries/users/validateVerifyEmailToken.d.ts.map +1 -1
- package/lib/resolvers/queries/warehousing/token.d.ts +1 -1
- package/lib/resolvers/queries/warehousing/token.d.ts.map +1 -1
- package/lib/resolvers/queries/warehousing/tokens.d.ts +1 -1
- package/lib/resolvers/queries/warehousing/tokens.d.ts.map +1 -1
- package/lib/resolvers/queries/warehousing/warehousingInterfaces.d.ts +7 -3
- package/lib/resolvers/queries/warehousing/warehousingInterfaces.d.ts.map +1 -1
- package/lib/resolvers/queries/warehousing/warehousingInterfaces.js +10 -3
- package/lib/resolvers/queries/warehousing/warehousingInterfaces.js.map +1 -1
- package/lib/resolvers/queries/warehousing/warehousingProvider.d.ts +1 -1
- package/lib/resolvers/queries/warehousing/warehousingProvider.d.ts.map +1 -1
- package/lib/resolvers/queries/warehousing/warehousingProviders.d.ts +5 -3
- package/lib/resolvers/queries/warehousing/warehousingProviders.d.ts.map +1 -1
- package/lib/resolvers/queries/warehousing/warehousingProviders.js.map +1 -1
- package/lib/resolvers/queries/warehousing/warehousingProvidersCount.d.ts +5 -3
- package/lib/resolvers/queries/warehousing/warehousingProvidersCount.d.ts.map +1 -1
- package/lib/resolvers/queries/warehousing/warehousingProvidersCount.js.map +1 -1
- package/lib/resolvers/queries/worker/activeWorkTypes.d.ts +1 -1
- package/lib/resolvers/queries/worker/activeWorkTypes.d.ts.map +1 -1
- package/lib/resolvers/queries/worker/activeWorkTypes.js +6 -1
- package/lib/resolvers/queries/worker/activeWorkTypes.js.map +1 -1
- package/lib/resolvers/queries/worker/work.d.ts +1 -1
- package/lib/resolvers/queries/worker/work.d.ts.map +1 -1
- package/lib/resolvers/queries/worker/workQueue.d.ts +1 -1
- package/lib/resolvers/queries/worker/workQueue.d.ts.map +1 -1
- package/lib/resolvers/queries/worker/workQueueCount.d.ts +2 -2
- package/lib/resolvers/queries/worker/workQueueCount.d.ts.map +1 -1
- package/lib/resolvers/queries/worker/workStatistics.d.ts +3 -3
- package/lib/resolvers/queries/worker/workStatistics.d.ts.map +1 -1
- package/lib/resolvers/queries/worker/workStatistics.js +2 -1
- package/lib/resolvers/queries/worker/workStatistics.js.map +1 -1
- package/lib/resolvers/type/assortment/assortment-filter-types.d.ts +1 -1
- package/lib/resolvers/type/assortment/assortment-filter-types.d.ts.map +1 -1
- package/lib/resolvers/type/assortment/assortment-link-types.d.ts +1 -1
- package/lib/resolvers/type/assortment/assortment-link-types.d.ts.map +1 -1
- package/lib/resolvers/type/assortment/assortment-media-types.d.ts +1 -1
- package/lib/resolvers/type/assortment/assortment-media-types.d.ts.map +1 -1
- package/lib/resolvers/type/assortment/assortment-path-link-types.d.ts +1 -1
- package/lib/resolvers/type/assortment/assortment-path-link-types.d.ts.map +1 -1
- package/lib/resolvers/type/assortment/assortment-product-types.d.ts +1 -1
- package/lib/resolvers/type/assortment/assortment-product-types.d.ts.map +1 -1
- package/lib/resolvers/type/assortment/assortment-types.d.ts +27 -26
- package/lib/resolvers/type/assortment/assortment-types.d.ts.map +1 -1
- package/lib/resolvers/type/assortment/assortment-types.js +14 -11
- package/lib/resolvers/type/assortment/assortment-types.js.map +1 -1
- package/lib/resolvers/type/bookmark-types.d.ts +4 -4
- package/lib/resolvers/type/bookmark-types.d.ts.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/delivery-provider-types.d.ts +3 -3
- package/lib/resolvers/type/delivery-provider-types.d.ts.map +1 -1
- package/lib/resolvers/type/delivery-provider-types.js +18 -19
- package/lib/resolvers/type/delivery-provider-types.js.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-delivery-types.d.ts +1 -1
- package/lib/resolvers/type/enrollment/enrollment-delivery-types.d.ts.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-payment-types.d.ts +1 -1
- package/lib/resolvers/type/enrollment/enrollment-payment-types.d.ts.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-period-types.d.ts +1 -1
- package/lib/resolvers/type/enrollment/enrollment-period-types.d.ts.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-plan-tyes.d.ts +1 -1
- package/lib/resolvers/type/enrollment/enrollment-plan-tyes.d.ts.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-types.d.ts +1 -1
- package/lib/resolvers/type/enrollment/enrollment-types.d.ts.map +1 -1
- package/lib/resolvers/type/event-types.d.ts +2 -2
- package/lib/resolvers/type/event-types.d.ts.map +1 -1
- package/lib/resolvers/type/filter/filter-option-types.d.ts +1 -1
- package/lib/resolvers/type/filter/filter-option-types.d.ts.map +1 -1
- package/lib/resolvers/type/filter/filter-types.d.ts +1 -1
- package/lib/resolvers/type/filter/filter-types.d.ts.map +1 -1
- package/lib/resolvers/type/filter/loaded-filter-option-types.d.ts +11 -1
- package/lib/resolvers/type/filter/loaded-filter-option-types.d.ts.map +1 -1
- package/lib/resolvers/type/filter/loaded-filter-option-types.js +15 -1
- package/lib/resolvers/type/filter/loaded-filter-option-types.js.map +1 -1
- package/lib/resolvers/type/filter/loaded-filter-types.d.ts +24 -1
- package/lib/resolvers/type/filter/loaded-filter-types.d.ts.map +1 -1
- package/lib/resolvers/type/filter/loaded-filter-types.js +34 -1
- package/lib/resolvers/type/filter/loaded-filter-types.js.map +1 -1
- package/lib/resolvers/type/index.d.ts +355 -147
- package/lib/resolvers/type/index.d.ts.map +1 -1
- package/lib/resolvers/type/index.js +3 -5
- package/lib/resolvers/type/index.js.map +1 -1
- package/lib/resolvers/type/language-types.d.ts +1 -1
- package/lib/resolvers/type/language-types.d.ts.map +1 -1
- package/lib/resolvers/type/media-types.d.ts +2 -2
- package/lib/resolvers/type/media-types.d.ts.map +1 -1
- package/lib/resolvers/type/media-types.js +17 -2
- package/lib/resolvers/type/media-types.js.map +1 -1
- package/lib/resolvers/type/order/order-delivery-discount-types.d.ts +10 -10
- package/lib/resolvers/type/order/order-delivery-discount-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-delivery-discount-types.js +0 -5
- package/lib/resolvers/type/order/order-delivery-discount-types.js.map +1 -1
- package/lib/resolvers/type/order/order-delivery-pickup-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-delivery-pickup-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-delivery-pickup-types.js +14 -7
- package/lib/resolvers/type/order/order-delivery-pickup-types.js.map +1 -1
- package/lib/resolvers/type/order/order-delivery-shipping-types.d.ts +2 -2
- 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 -3
- 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-discount-types.d.ts +5 -3
- package/lib/resolvers/type/order/order-discount-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-discount-types.js +3 -3
- package/lib/resolvers/type/order/order-discount-types.js.map +1 -1
- package/lib/resolvers/type/order/order-discountable-types.d.ts +3 -6
- package/lib/resolvers/type/order/order-discountable-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-discountable-types.js.map +1 -1
- package/lib/resolvers/type/order/order-global-discount-types.d.ts +19 -14
- 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 -6
- package/lib/resolvers/type/order/order-global-discount-types.js.map +1 -1
- package/lib/resolvers/type/order/order-item-discount-types.d.ts +9 -11
- package/lib/resolvers/type/order/order-item-discount-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-item-discount-types.js +0 -5
- package/lib/resolvers/type/order/order-item-discount-types.js.map +1 -1
- package/lib/resolvers/type/order/order-item-types.d.ts +4 -4
- package/lib/resolvers/type/order/order-item-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-item-types.js +15 -26
- package/lib/resolvers/type/order/order-item-types.js.map +1 -1
- package/lib/resolvers/type/order/order-payment-card-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-payment-card-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-payment-card-types.js +7 -3
- package/lib/resolvers/type/order/order-payment-card-types.js.map +1 -1
- package/lib/resolvers/type/order/order-payment-discount-types.d.ts +19 -14
- package/lib/resolvers/type/order/order-payment-discount-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-payment-discount-types.js +9 -12
- package/lib/resolvers/type/order/order-payment-discount-types.js.map +1 -1
- package/lib/resolvers/type/order/order-payment-generic-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-payment-generic-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-payment-generic-types.js +7 -3
- package/lib/resolvers/type/order/order-payment-generic-types.js.map +1 -1
- package/lib/resolvers/type/order/order-payment-invoice-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-payment-invoice-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-payment-invoice-types.js +7 -3
- 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-types.d.ts +4 -8
- package/lib/resolvers/type/order/order-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-types.js +12 -16
- package/lib/resolvers/type/order/order-types.js.map +1 -1
- package/lib/resolvers/type/payment/payment-credentials-types.d.ts +1 -1
- package/lib/resolvers/type/payment/payment-credentials-types.d.ts.map +1 -1
- package/lib/resolvers/type/payment/payment-credentials-types.js +8 -3
- package/lib/resolvers/type/payment/payment-credentials-types.js.map +1 -1
- package/lib/resolvers/type/payment/payment-provider-types.d.ts +13 -15
- package/lib/resolvers/type/payment/payment-provider-types.d.ts.map +1 -1
- package/lib/resolvers/type/payment/payment-provider-types.js +20 -21
- package/lib/resolvers/type/payment/payment-provider-types.js.map +1 -1
- package/lib/resolvers/type/price-types.d.ts +0 -1
- package/lib/resolvers/type/price-types.d.ts.map +1 -1
- 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-item-types.d.ts +1 -1
- package/lib/resolvers/type/product/product-bundle-item-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-bundle-types.d.ts +7 -7
- package/lib/resolvers/type/product/product-bundle-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-catalog-price-types.d.ts +1 -1
- package/lib/resolvers/type/product/product-catalog-price-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-configurable-types.d.ts +3 -4
- package/lib/resolvers/type/product/product-configurable-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-configurable-types.js +32 -9
- package/lib/resolvers/type/product/product-configurable-types.js.map +1 -1
- package/lib/resolvers/type/product/product-discount.d.ts +6 -11
- package/lib/resolvers/type/product/product-discount.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-discount.js +7 -11
- package/lib/resolvers/type/product/product-discount.js.map +1 -1
- package/lib/resolvers/type/product/product-media-types.d.ts +1 -1
- package/lib/resolvers/type/product/product-media-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-plan-types.d.ts +2 -2
- package/lib/resolvers/type/product/product-plan-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-plan-types.js +17 -7
- 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-simple-types.d.ts +3 -5
- package/lib/resolvers/type/product/product-simple-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-simple-types.js +14 -48
- package/lib/resolvers/type/product/product-simple-types.js.map +1 -1
- package/lib/resolvers/type/product/product-tokenized-types.d.ts +2 -3
- package/lib/resolvers/type/product/product-tokenized-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-tokenized-types.js +6 -22
- package/lib/resolvers/type/product/product-tokenized-types.js.map +1 -1
- package/lib/resolvers/type/product/product-types.d.ts +2 -2
- package/lib/resolvers/type/product/product-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-types.js +8 -5
- package/lib/resolvers/type/product/product-types.js.map +1 -1
- package/lib/resolvers/type/product/product-variation-assignment-types.d.ts +1 -1
- package/lib/resolvers/type/product/product-variation-assignment-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-variation-assignment-vector.d.ts +1 -1
- package/lib/resolvers/type/product/product-variation-assignment-vector.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-variation-option-types.d.ts +1 -1
- package/lib/resolvers/type/product/product-variation-option-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-variation-types.d.ts +1 -1
- package/lib/resolvers/type/product/product-variation-types.d.ts.map +1 -1
- package/lib/resolvers/type/product-search-result-types.d.ts +28 -0
- package/lib/resolvers/type/product-search-result-types.d.ts.map +1 -0
- package/lib/resolvers/type/product-search-result-types.js +45 -0
- package/lib/resolvers/type/product-search-result-types.js.map +1 -0
- package/lib/resolvers/type/quotation-types.d.ts +1 -1
- package/lib/resolvers/type/quotation-types.d.ts.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/token-types.d.ts +3 -3
- package/lib/resolvers/type/token-types.d.ts.map +1 -1
- package/lib/resolvers/type/token-types.js +14 -6
- package/lib/resolvers/type/token-types.js.map +1 -1
- package/lib/resolvers/type/user-types.d.ts +24 -5
- package/lib/resolvers/type/user-types.d.ts.map +1 -1
- package/lib/resolvers/type/user-types.js +9 -3
- package/lib/resolvers/type/user-types.js.map +1 -1
- package/lib/resolvers/type/warehousing-provider-types.d.ts +3 -2
- package/lib/resolvers/type/warehousing-provider-types.d.ts.map +1 -1
- package/lib/resolvers/type/warehousing-provider-types.js +13 -6
- package/lib/resolvers/type/warehousing-provider-types.js.map +1 -1
- package/lib/resolvers/type/webauthn-credentials-types.d.ts +27 -10
- package/lib/resolvers/type/webauthn-credentials-types.d.ts.map +1 -1
- package/lib/resolvers/type/webauthn-credentials-types.js.map +1 -1
- package/lib/resolvers/type/work-types.d.ts +1 -1
- package/lib/resolvers/type/work-types.d.ts.map +1 -1
- package/lib/resolvers/type/work-types.js +6 -2
- package/lib/resolvers/type/work-types.js.map +1 -1
- package/lib/roles/all.d.ts.map +1 -1
- package/lib/roles/all.js +9 -0
- package/lib/roles/all.js.map +1 -1
- package/lib/roles/index.d.ts.map +1 -1
- package/lib/roles/index.js +3 -0
- package/lib/roles/index.js.map +1 -1
- package/lib/roles/loggedIn.d.ts.map +1 -1
- package/lib/roles/loggedIn.js +22 -0
- package/lib/roles/loggedIn.js.map +1 -1
- package/lib/schema/inputTypes.d.ts.map +1 -1
- package/lib/schema/inputTypes.js +0 -1
- package/lib/schema/inputTypes.js.map +1 -1
- package/lib/schema/mutation.d.ts.map +1 -1
- package/lib/schema/mutation.js +8 -3
- package/lib/schema/mutation.js.map +1 -1
- package/lib/schema/query.d.ts.map +1 -1
- package/lib/schema/query.js +11 -4
- package/lib/schema/query.js.map +1 -1
- package/lib/schema/types/assortment.js +1 -1
- package/lib/schema/types/dispatch.d.ts.map +1 -1
- package/lib/schema/types/dispatch.js +0 -1
- package/lib/schema/types/dispatch.js.map +1 -1
- package/lib/schema/types/media.js +1 -1
- package/lib/schema/types/price.d.ts.map +1 -1
- package/lib/schema/types/price.js +0 -2
- package/lib/schema/types/price.js.map +1 -1
- package/lib/schema/types/product/product.js +1 -1
- package/lib/schema/types/stock.d.ts.map +1 -1
- package/lib/schema/types/stock.js +0 -1
- package/lib/schema/types/stock.js.map +1 -1
- package/package.json +64 -43
- package/src/api-index.ts +4 -3
- package/src/context.ts +55 -26
- package/src/errors.ts +14 -0
- package/src/express/createBulkImportMiddleware.ts +7 -11
- package/src/express/createERCMetadataMiddleware.ts +18 -28
- package/src/express/index.ts +36 -15
- package/src/fastify/bulkImportHandler.ts +62 -0
- package/src/fastify/ercMetadataHandler.ts +50 -0
- package/src/fastify/index.ts +46 -20
- package/src/loaders/index.ts +363 -277
- package/src/locale-context.ts +25 -15
- package/src/resolvers/mutations/accounts/addEmail.ts +1 -1
- package/src/resolvers/mutations/accounts/addWeb3Address.ts +1 -1
- package/src/resolvers/mutations/accounts/addWebAuthnCredentials.ts +4 -1
- package/src/resolvers/mutations/accounts/changePassword.ts +1 -1
- package/src/resolvers/mutations/accounts/createUser.ts +1 -1
- package/src/resolvers/mutations/accounts/createWebAuthnCredentialCreationOptions.ts +2 -2
- package/src/resolvers/mutations/accounts/createWebAuthnCredentialRequestOptions.ts +4 -4
- package/src/resolvers/mutations/accounts/enrollUser.ts +1 -1
- package/src/resolvers/mutations/accounts/forgotPassword.ts +1 -1
- package/src/resolvers/mutations/accounts/loginAsGuest.ts +3 -3
- package/src/resolvers/mutations/accounts/loginWithPassword.ts +3 -3
- package/src/resolvers/mutations/accounts/loginWithWebAuthn.ts +5 -2
- package/src/resolvers/mutations/accounts/logout.ts +1 -1
- package/src/resolvers/mutations/accounts/removeEmail.ts +1 -1
- package/src/resolvers/mutations/accounts/removeWeb3Address.ts +1 -1
- package/src/resolvers/mutations/accounts/removeWebAuthnCredentials.ts +1 -1
- package/src/resolvers/mutations/accounts/resetPassword.ts +14 -47
- package/src/resolvers/mutations/accounts/sendEnrollmentEmail.ts +1 -1
- package/src/resolvers/mutations/accounts/sendVerificationEmail.ts +1 -1
- package/src/resolvers/mutations/accounts/setPassword.ts +1 -1
- package/src/resolvers/mutations/accounts/setUsername.ts +1 -1
- package/src/resolvers/mutations/accounts/verifyEmail.ts +1 -1
- package/src/resolvers/mutations/accounts/verifyWeb3Address.ts +5 -2
- package/src/resolvers/mutations/assortments/addAssortmentFilter.ts +1 -1
- package/src/resolvers/mutations/assortments/addAssortmentLink.ts +1 -1
- package/src/resolvers/mutations/assortments/addAssortmentProduct.ts +1 -1
- package/src/resolvers/mutations/assortments/createAssortment.ts +1 -1
- package/src/resolvers/mutations/assortments/prepareAssortmentMediaUpload.ts +6 -9
- package/src/resolvers/mutations/assortments/removeAssortment.ts +1 -1
- package/src/resolvers/mutations/assortments/removeAssortmentFilter.ts +1 -1
- package/src/resolvers/mutations/assortments/removeAssortmentLink.ts +1 -1
- package/src/resolvers/mutations/assortments/removeAssortmentMedia.ts +1 -1
- package/src/resolvers/mutations/assortments/removeAssortmentProduct.ts +1 -1
- 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/setBaseAssortment.ts +1 -1
- package/src/resolvers/mutations/assortments/updateAssortment.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/bookmarks/bookmark.ts +1 -1
- package/src/resolvers/mutations/bookmarks/createBookmark.ts +1 -1
- package/src/resolvers/mutations/bookmarks/removeBookmark.ts +1 -1
- package/src/resolvers/mutations/countries/createCountry.ts +1 -1
- package/src/resolvers/mutations/countries/removeCountry.ts +1 -1
- package/src/resolvers/mutations/countries/updateCountry.ts +3 -8
- package/src/resolvers/mutations/currencies/createCurrency.ts +1 -1
- package/src/resolvers/mutations/currencies/removeCurrency.ts +1 -1
- package/src/resolvers/mutations/currencies/updateCurrency.ts +1 -1
- package/src/resolvers/mutations/delivery/createDeliveryProvider.ts +6 -1
- package/src/resolvers/mutations/delivery/removeDeliveryProvider.ts +1 -1
- package/src/resolvers/mutations/delivery/updateDeliveryProvider.ts +1 -1
- package/src/resolvers/mutations/enrollments/activateEnrollment.ts +3 -3
- package/src/resolvers/mutations/enrollments/createEnrollment.ts +20 -18
- package/src/resolvers/mutations/enrollments/terminateEnrollment.ts +3 -3
- package/src/resolvers/mutations/enrollments/updateEnrollment.ts +5 -4
- package/src/resolvers/mutations/files/confirmMediaUpload.ts +2 -2
- package/src/resolvers/mutations/filters/createFilter.ts +11 -10
- package/src/resolvers/mutations/filters/createFilterOption.ts +4 -3
- package/src/resolvers/mutations/filters/removeFilter.ts +1 -1
- package/src/resolvers/mutations/filters/removeFilterOption.ts +7 -8
- package/src/resolvers/mutations/filters/updateFilter.ts +6 -2
- package/src/resolvers/mutations/filters/updateFilterTexts.ts +1 -1
- package/src/resolvers/mutations/index.ts +3 -1
- package/src/resolvers/mutations/languages/createLanguage.ts +1 -1
- package/src/resolvers/mutations/languages/removeLanguage.ts +1 -1
- package/src/resolvers/mutations/languages/updateLanguage.ts +1 -1
- package/src/resolvers/mutations/orders/addCartDiscount.ts +22 -7
- package/src/resolvers/mutations/orders/addCartProduct.ts +33 -13
- package/src/resolvers/mutations/orders/addCartQuotation.ts +31 -25
- package/src/resolvers/mutations/orders/addMultipleCartProducts.ts +45 -23
- package/src/resolvers/mutations/orders/checkoutCart.ts +15 -9
- package/src/resolvers/mutations/orders/confirmOrder.ts +3 -3
- package/src/resolvers/mutations/orders/createCart.ts +7 -5
- package/src/resolvers/mutations/orders/deliverOrder.ts +3 -3
- package/src/resolvers/mutations/orders/emptyCart.ts +11 -6
- package/src/resolvers/mutations/orders/payOrder.ts +3 -3
- package/src/resolvers/mutations/orders/rejectOrder.ts +3 -3
- package/src/resolvers/mutations/orders/removeCartDiscount.ts +18 -5
- package/src/resolvers/mutations/orders/removeCartItem.ts +3 -3
- package/src/resolvers/mutations/orders/removeOrder.ts +1 -1
- package/src/resolvers/mutations/orders/setOrderDeliveryProvider.ts +4 -4
- package/src/resolvers/mutations/orders/setOrderPaymentProvider.ts +4 -4
- package/src/resolvers/mutations/orders/signPaymentProviderForCheckout.ts +7 -4
- package/src/resolvers/mutations/orders/updateCart.ts +13 -9
- package/src/resolvers/mutations/orders/updateCartItem.ts +15 -9
- package/src/resolvers/mutations/orders/updateOrderDeliveryPickUp.ts +3 -3
- package/src/resolvers/mutations/orders/updateOrderDeliveryShipping.ts +3 -3
- package/src/resolvers/mutations/orders/updateOrderPaymentCard.ts +3 -3
- package/src/resolvers/mutations/orders/updateOrderPaymentGeneric.ts +3 -3
- package/src/resolvers/mutations/orders/updateOrderPaymentInvoice.ts +3 -3
- package/src/resolvers/mutations/payment/createPaymentProvider.ts +7 -6
- package/src/resolvers/mutations/payment/markPaymentCredentialsPreferred.ts +1 -1
- package/src/resolvers/mutations/payment/registerPaymentCredentials.ts +6 -7
- package/src/resolvers/mutations/payment/removePaymentCredentials.ts +1 -1
- package/src/resolvers/mutations/payment/removePaymentProvider.ts +1 -1
- package/src/resolvers/mutations/payment/signPaymentProviderForCredentialRegistration.ts +9 -9
- package/src/resolvers/mutations/payment/updatePaymentProvider.ts +1 -1
- package/src/resolvers/mutations/products/addProductAssignment.ts +1 -1
- package/src/resolvers/mutations/products/addProductReviewVote.ts +1 -1
- package/src/resolvers/mutations/products/createProduct.ts +1 -1
- package/src/resolvers/mutations/products/createProductBundleItem.ts +1 -1
- package/src/resolvers/mutations/products/createProductReview.ts +1 -1
- package/src/resolvers/mutations/products/createProductVariation.ts +3 -1
- package/src/resolvers/mutations/products/createProductVariationOption.ts +2 -1
- package/src/resolvers/mutations/products/prepareProductMediaUpload.ts +6 -9
- package/src/resolvers/mutations/products/publishProduct.ts +1 -1
- package/src/resolvers/mutations/products/removeBundleItem.ts +1 -1
- package/src/resolvers/mutations/products/removeProduct.ts +2 -2
- package/src/resolvers/mutations/products/removeProductAssignment.ts +1 -1
- package/src/resolvers/mutations/products/removeProductMedia.ts +1 -1
- package/src/resolvers/mutations/products/removeProductReview.ts +1 -1
- package/src/resolvers/mutations/products/removeProductReviewVote.ts +1 -1
- package/src/resolvers/mutations/products/removeProductVariation.ts +1 -1
- package/src/resolvers/mutations/products/removeProductVariationOption.ts +1 -1
- package/src/resolvers/mutations/products/reorderProductMedia.ts +1 -1
- package/src/resolvers/mutations/products/unpublishProduct.ts +1 -1
- package/src/resolvers/mutations/products/updateProduct.ts +1 -1
- package/src/resolvers/mutations/products/updateProductCommerce.ts +1 -1
- package/src/resolvers/mutations/products/updateProductMediaTexts.ts +1 -1
- package/src/resolvers/mutations/products/updateProductPlan.ts +1 -1
- package/src/resolvers/mutations/products/updateProductReview.ts +1 -1
- package/src/resolvers/mutations/products/updateProductSupply.ts +1 -1
- package/src/resolvers/mutations/products/updateProductTexts.ts +1 -1
- package/src/resolvers/mutations/products/updateProductTokenization.ts +1 -1
- package/src/resolvers/mutations/products/updateProductVariationTexts.ts +1 -1
- package/src/resolvers/mutations/products/updateProductWarehousing.ts +1 -1
- package/src/resolvers/mutations/quotations/makeQuotationProposal.ts +3 -3
- package/src/resolvers/mutations/quotations/rejectQuotation.ts +3 -3
- package/src/resolvers/mutations/quotations/requestQuotation.ts +11 -11
- package/src/resolvers/mutations/quotations/verifyQuotation.ts +3 -3
- package/src/resolvers/mutations/users/addPushSubscription.ts +1 -1
- package/src/resolvers/mutations/users/heartbeat.ts +1 -1
- package/src/resolvers/mutations/users/prepareUserAvatarUpload.ts +6 -9
- package/src/resolvers/mutations/users/removePushSubscription.ts +1 -1
- package/src/resolvers/mutations/users/removeUser.ts +10 -6
- package/src/resolvers/mutations/users/removeUserProductReviews.ts +23 -0
- package/src/resolvers/mutations/users/setRoles.ts +1 -1
- package/src/resolvers/mutations/users/setUserTags.ts +1 -1
- package/src/resolvers/mutations/users/updateUserProfile.ts +2 -2
- package/src/resolvers/mutations/warehousing/createWarehousingProvider.ts +11 -6
- package/src/resolvers/mutations/warehousing/exportToken.ts +1 -1
- package/src/resolvers/mutations/warehousing/invalidateToken.ts +11 -5
- package/src/resolvers/mutations/warehousing/removeWarehousingProvider.ts +1 -1
- package/src/resolvers/mutations/warehousing/updateWarehousingProvider.ts +2 -4
- package/src/resolvers/mutations/worker/addWork.ts +3 -3
- package/src/resolvers/mutations/worker/allocateWork.ts +1 -1
- package/src/resolvers/mutations/worker/finishWork.ts +1 -1
- package/src/resolvers/mutations/worker/processNextWork.ts +3 -2
- package/src/resolvers/mutations/worker/removeWork.ts +1 -1
- package/src/resolvers/queries/assortments/assortment.ts +1 -1
- package/src/resolvers/queries/assortments/assortments.ts +1 -1
- package/src/resolvers/queries/assortments/assortmentsCount.ts +1 -1
- package/src/resolvers/queries/assortments/translatedAssortmentMediaTexts.ts +1 -1
- package/src/resolvers/queries/assortments/translatedAssortmentTexts.ts +1 -1
- package/src/resolvers/queries/countries/countries.ts +1 -1
- package/src/resolvers/queries/countries/countriesCount.ts +1 -1
- package/src/resolvers/queries/countries/country.ts +1 -1
- package/src/resolvers/queries/currencies/currencies.ts +1 -1
- package/src/resolvers/queries/currencies/currenciesCount.ts +1 -1
- package/src/resolvers/queries/currencies/currency.ts +1 -1
- package/src/resolvers/queries/delivery/deliveryInterfaces.ts +10 -3
- package/src/resolvers/queries/delivery/deliveryProvider.ts +1 -1
- package/src/resolvers/queries/delivery/deliveryProviders.ts +5 -3
- package/src/resolvers/queries/delivery/deliveryProvidersCount.ts +5 -3
- package/src/resolvers/queries/enrollments/enrollment.ts +1 -1
- package/src/resolvers/queries/enrollments/enrollments.ts +1 -1
- package/src/resolvers/queries/enrollments/enrollmentsCount.ts +1 -1
- package/src/resolvers/queries/events/event.ts +1 -1
- package/src/resolvers/queries/events/eventStatistics.ts +5 -3
- package/src/resolvers/queries/events/events.ts +1 -1
- package/src/resolvers/queries/events/eventsCounts.ts +1 -1
- package/src/resolvers/queries/filters/filter.ts +1 -1
- package/src/resolvers/queries/filters/filters.ts +1 -1
- package/src/resolvers/queries/filters/filtersCount.ts +1 -1
- package/src/resolvers/queries/filters/searchAssortments.ts +5 -9
- package/src/resolvers/queries/filters/searchProducts.ts +4 -6
- package/src/resolvers/queries/filters/translatedFilterTexts.ts +1 -1
- package/src/resolvers/queries/languages/language.ts +1 -1
- package/src/resolvers/queries/languages/languages.ts +1 -1
- package/src/resolvers/queries/languages/languagesCount.ts +1 -1
- package/src/resolvers/queries/orders/order.ts +1 -1
- package/src/resolvers/queries/orders/orderStatistics.ts +5 -3
- package/src/resolvers/queries/orders/orders.ts +1 -1
- package/src/resolvers/queries/orders/ordersCount.ts +1 -1
- package/src/resolvers/queries/payment/paymentInterfaces.ts +10 -3
- package/src/resolvers/queries/payment/paymentProvider.ts +1 -1
- package/src/resolvers/queries/payment/paymentProviders.ts +1 -1
- package/src/resolvers/queries/payment/paymentProvidersCount.ts +1 -1
- package/src/resolvers/queries/products/product.ts +1 -1
- package/src/resolvers/queries/products/productCatalogPrices.ts +1 -1
- package/src/resolvers/queries/products/productReview.ts +1 -1
- package/src/resolvers/queries/products/productReviews.ts +1 -1
- package/src/resolvers/queries/products/productReviewsCount.ts +1 -1
- package/src/resolvers/queries/products/products.ts +1 -1
- package/src/resolvers/queries/products/productsCount.ts +1 -1
- package/src/resolvers/queries/products/translatedProductMediaTexts.ts +1 -1
- package/src/resolvers/queries/products/translatedProductTexts.ts +1 -1
- package/src/resolvers/queries/products/translatedProductVariationTexts.ts +1 -1
- package/src/resolvers/queries/quotations/quotation.ts +1 -1
- package/src/resolvers/queries/quotations/quotations.ts +1 -1
- package/src/resolvers/queries/quotations/quotationsCount.ts +1 -1
- package/src/resolvers/queries/shopInfo.ts +1 -1
- package/src/resolvers/queries/users/me.ts +1 -1
- package/src/resolvers/queries/users/user.ts +1 -1
- package/src/resolvers/queries/users/users.ts +6 -2
- package/src/resolvers/queries/users/usersCount.ts +1 -1
- package/src/resolvers/queries/users/validateResetPasswordToken.ts +3 -3
- package/src/resolvers/queries/users/validateVerifyEmailToken.ts +1 -1
- package/src/resolvers/queries/warehousing/token.ts +1 -1
- package/src/resolvers/queries/warehousing/tokens.ts +1 -1
- package/src/resolvers/queries/warehousing/warehousingInterfaces.ts +12 -5
- package/src/resolvers/queries/warehousing/warehousingProvider.ts +1 -1
- package/src/resolvers/queries/warehousing/warehousingProviders.ts +5 -3
- package/src/resolvers/queries/warehousing/warehousingProvidersCount.ts +5 -3
- package/src/resolvers/queries/worker/activeWorkTypes.ts +7 -2
- package/src/resolvers/queries/worker/work.ts +1 -1
- package/src/resolvers/queries/worker/workQueue.ts +1 -1
- package/src/resolvers/queries/worker/workQueueCount.ts +2 -2
- package/src/resolvers/queries/worker/workStatistics.ts +5 -3
- package/src/resolvers/type/assortment/assortment-filter-types.ts +1 -1
- package/src/resolvers/type/assortment/assortment-link-types.ts +1 -1
- package/src/resolvers/type/assortment/assortment-media-types.ts +1 -1
- package/src/resolvers/type/assortment/assortment-path-link-types.ts +1 -1
- package/src/resolvers/type/assortment/assortment-product-types.ts +1 -1
- package/src/resolvers/type/assortment/assortment-types.ts +53 -69
- package/src/resolvers/type/bookmark-types.ts +4 -4
- package/src/resolvers/type/country-types.ts +1 -1
- package/src/resolvers/type/delivery-provider-types.ts +26 -31
- package/src/resolvers/type/enrollment/enrollment-delivery-types.ts +1 -1
- package/src/resolvers/type/enrollment/enrollment-payment-types.ts +1 -1
- package/src/resolvers/type/enrollment/enrollment-period-types.ts +1 -1
- package/src/resolvers/type/enrollment/enrollment-plan-tyes.ts +1 -1
- package/src/resolvers/type/enrollment/enrollment-types.ts +1 -1
- package/src/resolvers/type/event-types.ts +2 -2
- package/src/resolvers/type/filter/filter-option-types.ts +1 -1
- package/src/resolvers/type/filter/filter-types.ts +1 -1
- package/src/resolvers/type/filter/loaded-filter-option-types.ts +18 -1
- package/src/resolvers/type/filter/loaded-filter-types.ts +58 -1
- package/src/resolvers/type/index.ts +3 -5
- package/src/resolvers/type/language-types.ts +1 -1
- package/src/resolvers/type/media-types.ts +17 -6
- package/src/resolvers/type/order/order-delivery-discount-types.ts +6 -23
- package/src/resolvers/type/order/order-delivery-pickup-types.ts +23 -8
- package/src/resolvers/type/order/order-delivery-shipping-types.ts +9 -5
- package/src/resolvers/type/order/order-delivery-types.ts +1 -1
- package/src/resolvers/type/order/order-discount-types.ts +7 -11
- package/src/resolvers/type/order/order-discountable-types.ts +9 -6
- package/src/resolvers/type/order/order-global-discount-types.ts +23 -27
- package/src/resolvers/type/order/order-item-discount-types.ts +5 -20
- package/src/resolvers/type/order/order-item-types.ts +21 -33
- package/src/resolvers/type/order/order-payment-card-types.ts +8 -4
- package/src/resolvers/type/order/order-payment-discount-types.ts +17 -28
- package/src/resolvers/type/order/order-payment-generic-types.ts +8 -4
- package/src/resolvers/type/order/order-payment-invoice-types.ts +8 -4
- package/src/resolvers/type/order/order-payment-types.ts +1 -1
- package/src/resolvers/type/order/order-types.ts +23 -35
- package/src/resolvers/type/payment/payment-credentials-types.ts +11 -6
- package/src/resolvers/type/payment/payment-provider-types.ts +32 -71
- package/src/resolvers/type/price-types.ts +0 -1
- package/src/resolvers/type/product/product-assortment-path-types.ts +1 -1
- package/src/resolvers/type/product/product-bundle-item-types.ts +1 -1
- package/src/resolvers/type/product/product-catalog-price-types.ts +1 -1
- package/src/resolvers/type/product/product-configurable-types.ts +43 -16
- package/src/resolvers/type/product/product-discount.ts +8 -32
- package/src/resolvers/type/product/product-media-types.ts +1 -1
- package/src/resolvers/type/product/product-plan-types.ts +21 -14
- package/src/resolvers/type/product/product-review-types.ts +1 -1
- package/src/resolvers/type/product/product-simple-types.ts +17 -81
- package/src/resolvers/type/product/product-tokenized-types.ts +9 -39
- package/src/resolvers/type/product/product-types.ts +12 -6
- package/src/resolvers/type/product/product-variation-assignment-types.ts +1 -1
- package/src/resolvers/type/product/product-variation-assignment-vector.ts +1 -1
- package/src/resolvers/type/product/product-variation-option-types.ts +1 -1
- package/src/resolvers/type/product/product-variation-types.ts +1 -1
- package/src/resolvers/type/product-search-result-types.ts +69 -0
- package/src/resolvers/type/quotation-types.ts +1 -1
- package/src/resolvers/type/shop-types.ts +1 -1
- package/src/resolvers/type/token-types.ts +21 -10
- package/src/resolvers/type/user-types.ts +38 -15
- package/src/resolvers/type/warehousing-provider-types.ts +15 -12
- package/src/resolvers/type/webauthn-credentials-types.ts +30 -18
- package/src/resolvers/type/work-types.ts +7 -3
- package/src/roles/all.ts +12 -2
- package/src/roles/index.ts +3 -0
- package/src/roles/loggedIn.ts +24 -1
- package/src/schema/inputTypes.ts +0 -1
- package/src/schema/mutation.ts +8 -3
- package/src/schema/query.ts +11 -4
- package/src/schema/types/assortment.ts +1 -1
- package/src/schema/types/dispatch.ts +0 -1
- package/src/schema/types/media.ts +1 -1
- package/src/schema/types/price.ts +0 -2
- package/src/schema/types/product/product.ts +1 -1
- package/src/schema/types/stock.ts +0 -1
- package/tests/api-index.test.ts +4 -4
- package/tsconfig.json +4 -4
- package/lib/express/passport/access-token-strategy.d.ts +0 -10
- package/lib/express/passport/access-token-strategy.d.ts.map +0 -1
- package/lib/express/passport/access-token-strategy.js +0 -33
- package/lib/express/passport/access-token-strategy.js.map +0 -1
- package/lib/express/passport/setup.d.ts +0 -4
- package/lib/express/passport/setup.d.ts.map +0 -1
- package/lib/express/passport/setup.js +0 -30
- package/lib/express/passport/setup.js.map +0 -1
- package/lib/resolvers/mutations/utils/getOrderCart.d.ts +0 -7
- package/lib/resolvers/mutations/utils/getOrderCart.d.ts.map +0 -1
- package/lib/resolvers/mutations/utils/getOrderCart.js +0 -13
- package/lib/resolvers/mutations/utils/getOrderCart.js.map +0 -1
- package/lib/resolvers/type/dispatch-types.d.ts +0 -15
- package/lib/resolvers/type/dispatch-types.d.ts.map +0 -1
- package/lib/resolvers/type/dispatch-types.js +0 -16
- package/lib/resolvers/type/dispatch-types.js.map +0 -1
- package/lib/resolvers/type/stock-types.d.ts +0 -14
- package/lib/resolvers/type/stock-types.d.ts.map +0 -1
- package/lib/resolvers/type/stock-types.js +0 -15
- package/lib/resolvers/type/stock-types.js.map +0 -1
- package/lib/types.d.ts +0 -100
- package/lib/types.d.ts.map +0 -1
- package/lib/types.js +0 -2
- package/lib/types.js.map +0 -1
- package/src/express/passport/access-token-strategy.ts +0 -39
- package/src/express/passport/setup.ts +0 -44
- package/src/resolvers/mutations/utils/getOrderCart.ts +0 -19
- package/src/resolvers/type/dispatch-types.ts +0 -30
- package/src/resolvers/type/stock-types.ts +0 -28
- package/src/types.ts +0 -94
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { createLogger } from '@unchainedshop/logger';
|
|
2
|
+
const logger = createLogger('unchained:erc-metadata');
|
|
3
|
+
const errorHandler = (res) => (e) => {
|
|
4
|
+
logger.error(e.message);
|
|
5
|
+
res.status(503);
|
|
6
|
+
return res.send(JSON.stringify({ name: e.name, code: e.code, message: e.message }));
|
|
7
|
+
};
|
|
8
|
+
const notFoundHandler = (res) => {
|
|
9
|
+
logger.error('Method not supported, return 404');
|
|
10
|
+
res.status(404);
|
|
11
|
+
return res.send();
|
|
12
|
+
};
|
|
13
|
+
const ercMetadataHandler = async (req, res) => {
|
|
14
|
+
try {
|
|
15
|
+
const { services, localeContext } = req.unchainedContext;
|
|
16
|
+
const url = new URL(req.url, process.env.ROOT_URL);
|
|
17
|
+
if (!url.pathname.toLowerCase().endsWith('.json'))
|
|
18
|
+
throw new Error('Invalid ERC Metadata URI');
|
|
19
|
+
const { productId, localeOrTokenFilename, tokenFileName } = req.params;
|
|
20
|
+
const locale = tokenFileName ? new Intl.Locale(localeOrTokenFilename) : localeContext;
|
|
21
|
+
const ercMetadata = await services.warehousing.ercMetadata({
|
|
22
|
+
productId,
|
|
23
|
+
locale,
|
|
24
|
+
chainTokenId: (tokenFileName || localeOrTokenFilename).toLowerCase().replace('.json', ''),
|
|
25
|
+
});
|
|
26
|
+
if (!ercMetadata)
|
|
27
|
+
return notFoundHandler(res);
|
|
28
|
+
const body = JSON.stringify(ercMetadata);
|
|
29
|
+
res.status(200);
|
|
30
|
+
res.header('Content-Length', Buffer.byteLength(body));
|
|
31
|
+
res.header('Content-Type', 'application/json');
|
|
32
|
+
return res.send(body);
|
|
33
|
+
}
|
|
34
|
+
catch (e) {
|
|
35
|
+
return errorHandler(res)(e);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
export default ercMetadataHandler;
|
|
39
|
+
//# sourceMappingURL=ercMetadataHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ercMetadataHandler.js","sourceRoot":"","sources":["../../src/fastify/ercMetadataHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAIrD,MAAM,MAAM,GAAG,YAAY,CAAC,wBAAwB,CAAC,CAAC;AAEtD,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE;IAClC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IACxB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAChB,OAAO,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;AACtF,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,GAAG,EAAE,EAAE;IAC9B,MAAM,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACjD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAChB,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC;AACpB,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAuB,KAAK,EAClD,GAAmD,EACnD,GAAG,EACH,EAAE;IACF,IAAI,CAAC;QACH,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,GAAG,CAAC,gBAAgB,CAAC;QACzD,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAEnD,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAE/F,MAAM,EAAE,SAAS,EAAE,qBAAqB,EAAE,aAAa,EAAE,GAAG,GAAG,CAAC,MAAa,CAAC;QAC9E,MAAM,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC;QAEtF,MAAM,WAAW,GAAG,MAAM,QAAQ,CAAC,WAAW,CAAC,WAAW,CAAC;YACzD,SAAS;YACT,MAAM;YACN,YAAY,EAAE,CAAC,aAAa,IAAI,qBAAqB,CAAC,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;SAC1F,CAAC,CAAC;QAEH,IAAI,CAAC,WAAW;YAAE,OAAO,eAAe,CAAC,GAAG,CAAC,CAAC;QAE9C,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QACzC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAChB,GAAG,CAAC,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;QACtD,GAAG,CAAC,MAAM,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;QAC/C,OAAO,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9B,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
package/lib/fastify/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { YogaServerInstance } from 'graphql-yoga';
|
|
2
2
|
import { mongodb } from '@unchainedshop/mongodb';
|
|
3
3
|
import { UnchainedCore } from '@unchainedshop/core';
|
|
4
|
-
|
|
4
|
+
import { FastifyInstance } from 'fastify';
|
|
5
|
+
export declare const connect: (fastify: FastifyInstance, { graphqlHandler, db, }: {
|
|
5
6
|
graphqlHandler: YogaServerInstance<any, any>;
|
|
6
7
|
db: mongodb.Db;
|
|
7
8
|
unchainedAPI: UnchainedCore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fastify/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fastify/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAMpD,OAAO,EAAE,eAAe,EAAkB,MAAM,SAAS,CAAC;AAuE1D,eAAO,MAAM,OAAO,YACT,eAAe,2BAIrB;IAAE,cAAc,EAAE,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAAC,EAAE,EAAE,OAAO,CAAC,EAAE,CAAC;IAAC,YAAY,EAAE,aAAa,CAAA;CAAE,SAiEjG,CAAC"}
|
package/lib/fastify/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getCurrentContextResolver } from '../context.js';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import bulkImportHandler from './bulkImportHandler.js';
|
|
3
|
+
import ercMetadataHandler from './ercMetadataHandler.js';
|
|
4
4
|
import MongoStore from 'connect-mongo';
|
|
5
5
|
import { emit } from '@unchainedshop/events';
|
|
6
6
|
import { API_EVENTS } from '../events.js';
|
|
@@ -13,7 +13,7 @@ const resolveUserRemoteAddress = (req) => {
|
|
|
13
13
|
const remotePort = req.socket?.remotePort;
|
|
14
14
|
return { remoteAddress, remotePort };
|
|
15
15
|
};
|
|
16
|
-
const { GRAPHQL_API_PATH = '/graphql', UNCHAINED_COOKIE_NAME = 'unchained_token', UNCHAINED_COOKIE_PATH = '/', UNCHAINED_COOKIE_DOMAIN,
|
|
16
|
+
const { GRAPHQL_API_PATH = '/graphql', BULK_IMPORT_API_PATH = '/bulk-import', ERC_METADATA_API_PATH = '/erc-metadata/:productId/:localeOrTokenFilename/:tokenFileName?', UNCHAINED_COOKIE_NAME = 'unchained_token', UNCHAINED_COOKIE_PATH = '/', UNCHAINED_COOKIE_DOMAIN, UNCHAINED_COOKIE_SAMESITE, UNCHAINED_COOKIE_INSECURE, } = process.env;
|
|
17
17
|
const middlewareHook = async function middlewareHook(req, reply) {
|
|
18
18
|
const setHeader = (key, value) => reply.header(key, value);
|
|
19
19
|
const getHeader = (key) => req.headers[key];
|
|
@@ -21,30 +21,30 @@ const middlewareHook = async function middlewareHook(req, reply) {
|
|
|
21
21
|
const context = getCurrentContextResolver();
|
|
22
22
|
async function login(user) {
|
|
23
23
|
req.session.user = user;
|
|
24
|
-
req.session.userId = user._id;
|
|
25
24
|
const tokenObject = {
|
|
26
25
|
_id: req.session.sessionId,
|
|
26
|
+
userId: user._id,
|
|
27
27
|
/* eslint-disable-next-line */
|
|
28
28
|
tokenExpires: new Date(req.session?.cookie._expires),
|
|
29
29
|
};
|
|
30
|
-
await emit(API_EVENTS.API_LOGIN_TOKEN_CREATED,
|
|
30
|
+
await emit(API_EVENTS.API_LOGIN_TOKEN_CREATED, tokenObject);
|
|
31
31
|
/* eslint-disable-next-line */
|
|
32
32
|
user._inLoginMethodResponse = true;
|
|
33
33
|
return { user, ...tokenObject };
|
|
34
34
|
}
|
|
35
35
|
async function logout() {
|
|
36
36
|
/* eslint-disable-line */
|
|
37
|
-
if (!req.session?.
|
|
37
|
+
if (!req.session?.user?._id)
|
|
38
38
|
return false;
|
|
39
39
|
const tokenObject = {
|
|
40
40
|
_id: req.session.sessionId,
|
|
41
|
-
userId: req.session?.
|
|
41
|
+
userId: req.session?.user?._id,
|
|
42
42
|
};
|
|
43
43
|
req.session.user = null;
|
|
44
|
-
req.session.userId = null;
|
|
45
44
|
await emit(API_EVENTS.API_LOGOUT, tokenObject);
|
|
46
45
|
return true;
|
|
47
46
|
}
|
|
47
|
+
const [, accessToken] = req.headers.authorization?.split(' ') || [];
|
|
48
48
|
req.unchainedContext = await context({
|
|
49
49
|
setHeader,
|
|
50
50
|
getHeader,
|
|
@@ -52,25 +52,37 @@ const middlewareHook = async function middlewareHook(req, reply) {
|
|
|
52
52
|
remotePort,
|
|
53
53
|
login,
|
|
54
54
|
logout,
|
|
55
|
-
|
|
56
|
-
userId: req.session.
|
|
55
|
+
accessToken,
|
|
56
|
+
userId: req.session.user?._id,
|
|
57
57
|
});
|
|
58
58
|
};
|
|
59
59
|
export const connect = (fastify, { graphqlHandler, db, }) => {
|
|
60
|
+
const cookieName = UNCHAINED_COOKIE_NAME;
|
|
61
|
+
const domain = UNCHAINED_COOKIE_DOMAIN;
|
|
62
|
+
const path = UNCHAINED_COOKIE_PATH;
|
|
63
|
+
const secure = UNCHAINED_COOKIE_INSECURE ? false : true;
|
|
64
|
+
const sameSite = ({
|
|
65
|
+
none: 'none',
|
|
66
|
+
lax: 'lax',
|
|
67
|
+
strict: 'strict',
|
|
68
|
+
'1': true,
|
|
69
|
+
'0': false,
|
|
70
|
+
}[UNCHAINED_COOKIE_SAMESITE?.trim()?.toLowerCase()] || false);
|
|
60
71
|
fastify.register(fastifyCookie);
|
|
61
72
|
fastify.register(fastifySession, {
|
|
62
73
|
secret: process.env.UNCHAINED_TOKEN_SECRET,
|
|
63
|
-
cookieName
|
|
74
|
+
cookieName,
|
|
64
75
|
store: MongoStore.create({
|
|
65
76
|
client: db.client,
|
|
66
77
|
dbName: db.databaseName,
|
|
67
78
|
collectionName: 'sessions',
|
|
68
79
|
}),
|
|
69
80
|
cookie: {
|
|
70
|
-
domain
|
|
71
|
-
httpOnly:
|
|
72
|
-
path
|
|
73
|
-
secure
|
|
81
|
+
domain,
|
|
82
|
+
httpOnly: true,
|
|
83
|
+
path,
|
|
84
|
+
secure,
|
|
85
|
+
sameSite,
|
|
74
86
|
maxAge: 1000 * 60 * 60 * 24 * 7,
|
|
75
87
|
},
|
|
76
88
|
});
|
|
@@ -93,7 +105,15 @@ export const connect = (fastify, { graphqlHandler, db, }) => {
|
|
|
93
105
|
return reply;
|
|
94
106
|
},
|
|
95
107
|
});
|
|
96
|
-
|
|
97
|
-
|
|
108
|
+
fastify.route({
|
|
109
|
+
url: ERC_METADATA_API_PATH,
|
|
110
|
+
method: ['GET'],
|
|
111
|
+
handler: ercMetadataHandler,
|
|
112
|
+
});
|
|
113
|
+
fastify.route({
|
|
114
|
+
url: BULK_IMPORT_API_PATH,
|
|
115
|
+
method: ['POST'],
|
|
116
|
+
handler: bulkImportHandler,
|
|
117
|
+
});
|
|
98
118
|
};
|
|
99
119
|
//# sourceMappingURL=index.js.map
|
package/lib/fastify/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/fastify/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC1D,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/fastify/index.ts"],"names":[],"mappings":"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"}
|
package/lib/loaders/index.d.ts
CHANGED
|
@@ -1,5 +1,67 @@
|
|
|
1
|
+
import DataLoader from 'dataloader';
|
|
1
2
|
import { UnchainedCore } from '@unchainedshop/core';
|
|
2
|
-
import {
|
|
3
|
+
import { Product, ProductText, ProductMediaText, ProductMedia } from '@unchainedshop/core-products';
|
|
4
|
+
import { Filter, FilterText } from '@unchainedshop/core-filters';
|
|
5
|
+
import { Assortment, AssortmentLink, AssortmentProduct, AssortmentText, AssortmentMediaType, AssortmentMediaText } from '@unchainedshop/core-assortments';
|
|
6
|
+
import { File } from '@unchainedshop/core-files';
|
|
7
|
+
export interface UnchainedLoaders {
|
|
8
|
+
loaders: {
|
|
9
|
+
productLoader: InstanceType<typeof DataLoader<{
|
|
10
|
+
productId: string;
|
|
11
|
+
}, Product>>;
|
|
12
|
+
productLoaderBySKU: InstanceType<typeof DataLoader<{
|
|
13
|
+
sku: string;
|
|
14
|
+
}, Product>>;
|
|
15
|
+
productTextLoader: InstanceType<typeof DataLoader<{
|
|
16
|
+
productId: string;
|
|
17
|
+
locale: string;
|
|
18
|
+
}, ProductText>>;
|
|
19
|
+
productMediaTextLoader: InstanceType<typeof DataLoader<{
|
|
20
|
+
productMediaId: string;
|
|
21
|
+
locale: string;
|
|
22
|
+
}, ProductMediaText>>;
|
|
23
|
+
fileLoader: InstanceType<typeof DataLoader<{
|
|
24
|
+
fileId: string;
|
|
25
|
+
}, File>>;
|
|
26
|
+
filterLoader: InstanceType<typeof DataLoader<{
|
|
27
|
+
filterId: string;
|
|
28
|
+
}, Filter>>;
|
|
29
|
+
filterTextLoader: InstanceType<typeof DataLoader<{
|
|
30
|
+
filterId: string;
|
|
31
|
+
filterOptionValue?: string;
|
|
32
|
+
locale: string;
|
|
33
|
+
}, FilterText>>;
|
|
34
|
+
assortmentLoader: InstanceType<typeof DataLoader<{
|
|
35
|
+
assortmentId: string;
|
|
36
|
+
}, Assortment>>;
|
|
37
|
+
assortmentTextLoader: InstanceType<typeof DataLoader<{
|
|
38
|
+
assortmentId: string;
|
|
39
|
+
locale: string;
|
|
40
|
+
}, AssortmentText>>;
|
|
41
|
+
assortmentLinkLoader: InstanceType<typeof DataLoader<{
|
|
42
|
+
parentAssortmentId: string;
|
|
43
|
+
childAssortmentId: string;
|
|
44
|
+
}, AssortmentLink>>;
|
|
45
|
+
assortmentLinksLoader: InstanceType<typeof DataLoader<{
|
|
46
|
+
parentAssortmentId?: string;
|
|
47
|
+
assortmentId?: string;
|
|
48
|
+
}, AssortmentLink[]>>;
|
|
49
|
+
assortmentProductLoader: InstanceType<typeof DataLoader<{
|
|
50
|
+
assortmentId: string;
|
|
51
|
+
productId: string;
|
|
52
|
+
}, AssortmentProduct>>;
|
|
53
|
+
assortmentMediaTextLoader: InstanceType<typeof DataLoader<{
|
|
54
|
+
assortmentMediaId: string;
|
|
55
|
+
locale: string;
|
|
56
|
+
}, AssortmentMediaText>>;
|
|
57
|
+
productMediasLoader: InstanceType<typeof DataLoader<{
|
|
58
|
+
productId?: string;
|
|
59
|
+
}, ProductMedia[]>>;
|
|
60
|
+
assortmentMediasLoader: InstanceType<typeof DataLoader<{
|
|
61
|
+
assortmentId?: string;
|
|
62
|
+
}, AssortmentMediaType[]>>;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
3
65
|
declare const loaders: (unchainedAPI: UnchainedCore) => Promise<UnchainedLoaders["loaders"]>;
|
|
4
66
|
export default loaders;
|
|
5
67
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/loaders/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/loaders/index.ts"],"names":[],"mappings":"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"}
|
package/lib/loaders/index.js
CHANGED
|
@@ -1,26 +1,15 @@
|
|
|
1
1
|
import DataLoader from 'dataloader';
|
|
2
2
|
import { systemLocale } from '@unchainedshop/utils';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
return [
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
function getFilteredQueries({ queries, texts, filterFn }) {
|
|
15
|
-
return queries.map(({ locale, ...queryParams }) => {
|
|
16
|
-
const localeObj = new Intl.Locale(locale);
|
|
17
|
-
const filteredTexts = texts.filter(filterFn(queryParams));
|
|
18
|
-
if (!filteredTexts.length)
|
|
19
|
-
return null;
|
|
20
|
-
const localeStrings = getLocaleStrings(localeObj);
|
|
21
|
-
const filterText = findMatchingText(filteredTexts, localeStrings);
|
|
22
|
-
return filterText || filteredTexts[0];
|
|
23
|
-
});
|
|
3
|
+
function getLocaleStrings(locale) {
|
|
4
|
+
const localeObj = new Intl.Locale(locale);
|
|
5
|
+
return [
|
|
6
|
+
...new Set([
|
|
7
|
+
localeObj.baseName.toLowerCase(),
|
|
8
|
+
localeObj.language.toLowerCase(),
|
|
9
|
+
systemLocale.baseName.toLowerCase(),
|
|
10
|
+
systemLocale.language.toLowerCase(),
|
|
11
|
+
]),
|
|
12
|
+
];
|
|
24
13
|
}
|
|
25
14
|
const loaders = async (unchainedAPI) => {
|
|
26
15
|
return {
|
|
@@ -31,14 +20,12 @@ const loaders = async (unchainedAPI) => {
|
|
|
31
20
|
includeInactive: true,
|
|
32
21
|
includeLeaves: true,
|
|
33
22
|
});
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
});
|
|
41
|
-
}, { batchScheduleFn: (cb) => setImmediate(cb) }),
|
|
23
|
+
const assortmentMap = {};
|
|
24
|
+
for (const assortment of assortments) {
|
|
25
|
+
assortmentMap[assortment._id] = assortment;
|
|
26
|
+
}
|
|
27
|
+
return queries.map((q) => assortmentMap[q.assortmentId]);
|
|
28
|
+
}),
|
|
42
29
|
assortmentTextLoader: new DataLoader(async (queries) => {
|
|
43
30
|
const assortmentIds = [...new Set(queries.map((q) => q.assortmentId).filter(Boolean))];
|
|
44
31
|
const texts = await unchainedAPI.modules.assortments.texts.findTexts({ assortmentId: { $in: assortmentIds } }, {
|
|
@@ -46,9 +33,17 @@ const loaders = async (unchainedAPI) => {
|
|
|
46
33
|
assortmentId: 1,
|
|
47
34
|
},
|
|
48
35
|
});
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
36
|
+
const queryLocales = [...new Set(queries.map((q) => q.locale.toLowerCase()))];
|
|
37
|
+
const textsMap = {};
|
|
38
|
+
const localeMap = Object.fromEntries(queryLocales.flatMap((queryLocale) => {
|
|
39
|
+
return getLocaleStrings(queryLocale).map((locale) => [locale, queryLocale]);
|
|
40
|
+
}));
|
|
41
|
+
for (const text of texts) {
|
|
42
|
+
const locale = localeMap[text.locale.toLowerCase()];
|
|
43
|
+
textsMap[`${locale}:${text.assortmentId}`] = text;
|
|
44
|
+
}
|
|
45
|
+
return queries.map((q) => textsMap[`${q.locale.toLowerCase()}:${q.assortmentId}`]);
|
|
46
|
+
}),
|
|
52
47
|
assortmentMediaTextLoader: new DataLoader(async (queries) => {
|
|
53
48
|
const assortmentMediaIds = [...new Set(queries.map((q) => q.assortmentMediaId).filter(Boolean))];
|
|
54
49
|
const texts = await unchainedAPI.modules.assortments.media.texts.findMediaTexts({ assortmentMediaId: { $in: assortmentMediaIds } }, {
|
|
@@ -56,26 +51,49 @@ const loaders = async (unchainedAPI) => {
|
|
|
56
51
|
assortmentMediaId: 1,
|
|
57
52
|
},
|
|
58
53
|
});
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
54
|
+
const queryLocales = [...new Set(queries.map((q) => q.locale.toLowerCase()))];
|
|
55
|
+
const textsMap = {};
|
|
56
|
+
const localeMap = Object.fromEntries(queryLocales.flatMap((queryLocale) => {
|
|
57
|
+
return getLocaleStrings(queryLocale).map((locale) => [locale, queryLocale]);
|
|
58
|
+
}));
|
|
59
|
+
for (const text of texts) {
|
|
60
|
+
const locale = localeMap[text.locale.toLowerCase()];
|
|
61
|
+
textsMap[`${locale}:${text.assortmentMediaId}`] = text;
|
|
62
|
+
}
|
|
63
|
+
return queries.map((q) => textsMap[`${q.locale.toLowerCase()}:${q.assortmentMediaId}`]);
|
|
64
|
+
}),
|
|
65
|
+
assortmentMediasLoader: new DataLoader(async (queries) => {
|
|
66
|
+
const assortmentIds = [...new Set(queries.map((q) => q.assortmentId).filter(Boolean))];
|
|
67
|
+
const assortmentMediaItems = await unchainedAPI.modules.assortments.media.findAssortmentMedias({
|
|
68
|
+
assortmentId: { $in: assortmentIds },
|
|
69
|
+
});
|
|
70
|
+
const assortmentMediaMap = {};
|
|
71
|
+
for (const assortmentMedia of assortmentMediaItems) {
|
|
72
|
+
if (!assortmentMediaMap[assortmentMedia.assortmentId]) {
|
|
73
|
+
assortmentMediaMap[assortmentMedia.assortmentId] = [assortmentMedia];
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
assortmentMediaMap[assortmentMedia.assortmentId].push(assortmentMedia);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return queries.map((q) => assortmentMediaMap[q.assortmentId] || []);
|
|
80
|
+
}),
|
|
62
81
|
assortmentLinkLoader: new DataLoader(async (queries) => {
|
|
63
|
-
const parentAssortmentIds = [
|
|
64
|
-
...new Set(queries.map((q) => q.parentAssortmentId).filter(Boolean)),
|
|
65
|
-
];
|
|
82
|
+
const parentAssortmentIds = [...new Set(queries.map((q) => q.parentAssortmentId).filter(Boolean))];
|
|
66
83
|
const links = await unchainedAPI.modules.assortments.links.findLinks({
|
|
67
84
|
parentAssortmentIds,
|
|
68
85
|
});
|
|
69
|
-
|
|
86
|
+
// TODO: Optimize
|
|
87
|
+
return queries.map((q) => {
|
|
70
88
|
return links.find((link) => {
|
|
71
|
-
if (link.parentAssortmentId !== parentAssortmentId)
|
|
89
|
+
if (link.parentAssortmentId !== q.parentAssortmentId)
|
|
72
90
|
return false;
|
|
73
|
-
if (childAssortmentId && link.childAssortmentId !== childAssortmentId)
|
|
91
|
+
if (q.childAssortmentId && link.childAssortmentId !== q.childAssortmentId)
|
|
74
92
|
return false;
|
|
75
93
|
return true;
|
|
76
94
|
});
|
|
77
95
|
});
|
|
78
|
-
}
|
|
96
|
+
}),
|
|
79
97
|
assortmentLinksLoader: new DataLoader(async (queries) => {
|
|
80
98
|
const parentAssortmentIds = [
|
|
81
99
|
...new Set(queries.flatMap((q) => q.parentAssortmentId).filter(Boolean)),
|
|
@@ -89,45 +107,45 @@ const loaders = async (unchainedAPI) => {
|
|
|
89
107
|
(await unchainedAPI.modules.assortments.links.findLinks({
|
|
90
108
|
assortmentIds,
|
|
91
109
|
}));
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
110
|
+
// TODO: Optimize
|
|
111
|
+
return queries.map((q) => {
|
|
112
|
+
if (q.parentAssortmentId) {
|
|
113
|
+
return linksByParentAssortmentId.filter((link) => link.parentAssortmentId === q.parentAssortmentId);
|
|
95
114
|
}
|
|
96
|
-
if (assortmentId) {
|
|
97
|
-
return linksByAssortmentId.filter((link) => link.parentAssortmentId === assortmentId || link.childAssortmentId === assortmentId);
|
|
115
|
+
if (q.assortmentId) {
|
|
116
|
+
return linksByAssortmentId.filter((link) => link.parentAssortmentId === q.assortmentId || link.childAssortmentId === q.assortmentId);
|
|
98
117
|
}
|
|
99
118
|
return [];
|
|
100
119
|
});
|
|
101
|
-
}
|
|
120
|
+
}),
|
|
102
121
|
assortmentProductLoader: new DataLoader(async (queries) => {
|
|
103
122
|
const assortmentIds = [...new Set(queries.map((q) => q.assortmentId).filter(Boolean))];
|
|
104
123
|
const assortmentProducts = await unchainedAPI.modules.assortments.products.findProducts({
|
|
105
124
|
assortmentIds,
|
|
106
125
|
});
|
|
107
|
-
|
|
126
|
+
// TODO: Optimize
|
|
127
|
+
return queries.map((q) => {
|
|
108
128
|
return assortmentProducts.find((assortmentProduct) => {
|
|
109
|
-
if (assortmentProduct.assortmentId !== assortmentId)
|
|
129
|
+
if (assortmentProduct.assortmentId !== q.assortmentId)
|
|
110
130
|
return false;
|
|
111
|
-
if (assortmentProduct.productId !== productId)
|
|
131
|
+
if (assortmentProduct.productId !== q.productId)
|
|
112
132
|
return false;
|
|
113
133
|
return true;
|
|
114
134
|
});
|
|
115
135
|
});
|
|
116
|
-
}
|
|
136
|
+
}),
|
|
117
137
|
filterLoader: new DataLoader(async (queries) => {
|
|
118
138
|
const filterIds = [...new Set(queries.map((q) => q.filterId).filter(Boolean))];
|
|
119
139
|
const filters = await unchainedAPI.modules.filters.findFilters({
|
|
120
140
|
filterIds,
|
|
121
141
|
includeInactive: true,
|
|
122
142
|
});
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
});
|
|
130
|
-
}, { batchScheduleFn: (cb) => setImmediate(cb) }),
|
|
143
|
+
const filterMap = {};
|
|
144
|
+
for (const filter of filters) {
|
|
145
|
+
filterMap[filter._id] = filter;
|
|
146
|
+
}
|
|
147
|
+
return queries.map((q) => filterMap[q.filterId]);
|
|
148
|
+
}),
|
|
131
149
|
filterTextLoader: new DataLoader(async (queries) => {
|
|
132
150
|
const filterIds = [...new Set(queries.map((q) => q.filterId).filter(Boolean))];
|
|
133
151
|
const texts = await unchainedAPI.modules.filters.texts.findTexts({ filterId: { $in: filterIds } }, {
|
|
@@ -135,35 +153,63 @@ const loaders = async (unchainedAPI) => {
|
|
|
135
153
|
filterId: 1,
|
|
136
154
|
},
|
|
137
155
|
});
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
|
|
156
|
+
const queryLocales = [...new Set(queries.map((q) => q.locale.toLowerCase()))];
|
|
157
|
+
const textsMap = {};
|
|
158
|
+
const localeMap = Object.fromEntries(queryLocales.flatMap((queryLocale) => {
|
|
159
|
+
return getLocaleStrings(queryLocale).map((locale) => [locale, queryLocale]);
|
|
160
|
+
}));
|
|
161
|
+
for (const text of texts) {
|
|
162
|
+
const locale = localeMap[text.locale.toLowerCase()];
|
|
163
|
+
textsMap[`${locale}:${text.filterId}:${text.filterOptionValue}`] = text;
|
|
164
|
+
}
|
|
165
|
+
return queries.map((q) => textsMap[`${q.locale.toLowerCase()}:${q.filterId}:${q.filterOptionValue}`]);
|
|
166
|
+
}),
|
|
141
167
|
productLoader: new DataLoader(async (queries) => {
|
|
142
168
|
const productIds = [...new Set(queries.map((q) => q.productId).filter(Boolean))]; // you don't need lodash, _.unique my ass
|
|
143
169
|
const products = await unchainedAPI.modules.products.findProducts({
|
|
144
170
|
productIds,
|
|
145
171
|
productSelector: {
|
|
146
|
-
status: { $
|
|
172
|
+
status: { $exists: true },
|
|
147
173
|
},
|
|
148
174
|
});
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
175
|
+
const productMap = {};
|
|
176
|
+
for (const product of products) {
|
|
177
|
+
productMap[product._id] = product;
|
|
178
|
+
}
|
|
179
|
+
return queries.map((q) => productMap[q.productId]);
|
|
180
|
+
}),
|
|
181
|
+
productLoaderBySKU: new DataLoader(async (queries) => {
|
|
182
|
+
const skus = [...new Set(queries.map((q) => q.sku).filter(Boolean))]; // you don't need lodash, _.unique my ass
|
|
183
|
+
const products = await unchainedAPI.modules.products.findProducts({
|
|
184
|
+
productSelector: {
|
|
185
|
+
'warehousing.sku': { $in: skus },
|
|
186
|
+
status: { $exists: true },
|
|
187
|
+
},
|
|
155
188
|
});
|
|
156
|
-
|
|
189
|
+
const productMap = {};
|
|
190
|
+
for (const product of products) {
|
|
191
|
+
productMap[product.warehousing.sku] = product;
|
|
192
|
+
}
|
|
193
|
+
return queries.map((q) => productMap[q.sku]);
|
|
194
|
+
}),
|
|
157
195
|
productTextLoader: new DataLoader(async (queries) => {
|
|
158
|
-
const productIds = [...new Set(queries.map((q) => q.productId).filter(Boolean)
|
|
196
|
+
const productIds = [...new Set(queries.map((q) => q.productId))].filter(Boolean);
|
|
159
197
|
const texts = await unchainedAPI.modules.products.texts.findTexts({ productId: { $in: productIds } }, {
|
|
160
198
|
sort: {
|
|
161
199
|
productId: 1,
|
|
162
200
|
},
|
|
163
201
|
});
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
|
|
202
|
+
const queryLocales = [...new Set(queries.map((q) => q.locale.toLowerCase()))];
|
|
203
|
+
const textsMap = {};
|
|
204
|
+
const localeMap = Object.fromEntries(queryLocales.flatMap((queryLocale) => {
|
|
205
|
+
return getLocaleStrings(queryLocale).map((locale) => [locale, queryLocale]);
|
|
206
|
+
}));
|
|
207
|
+
for (const text of texts) {
|
|
208
|
+
const locale = localeMap[text.locale.toLowerCase()];
|
|
209
|
+
textsMap[`${locale}:${text.productId}`] = text;
|
|
210
|
+
}
|
|
211
|
+
return queries.map((q) => textsMap[`${q.locale.toLowerCase()}:${q.productId}`]);
|
|
212
|
+
}),
|
|
167
213
|
productMediaTextLoader: new DataLoader(async (queries) => {
|
|
168
214
|
const productMediaIds = [...new Set(queries.map((q) => q.productMediaId).filter(Boolean))];
|
|
169
215
|
const texts = await unchainedAPI.modules.products.media.texts.findMediaTexts({ productMediaId: { $in: productMediaIds } }, {
|
|
@@ -171,22 +217,44 @@ const loaders = async (unchainedAPI) => {
|
|
|
171
217
|
productMediaId: 1,
|
|
172
218
|
},
|
|
173
219
|
});
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
|
|
220
|
+
const queryLocales = [...new Set(queries.map((q) => q.locale.toLowerCase()))];
|
|
221
|
+
const textsMap = {};
|
|
222
|
+
const localeMap = Object.fromEntries(queryLocales.flatMap((queryLocale) => {
|
|
223
|
+
return getLocaleStrings(queryLocale).map((locale) => [locale, queryLocale]);
|
|
224
|
+
}));
|
|
225
|
+
for (const text of texts) {
|
|
226
|
+
const locale = localeMap[text.locale.toLowerCase()];
|
|
227
|
+
textsMap[`${locale}:${text.productMediaId}`] = text;
|
|
228
|
+
}
|
|
229
|
+
return queries.map((q) => textsMap[`${q.locale.toLowerCase()}:${q.productMediaId}`]);
|
|
230
|
+
}),
|
|
231
|
+
productMediasLoader: new DataLoader(async (queries) => {
|
|
232
|
+
const productIds = [...new Set(queries.map((q) => q.productId).filter(Boolean))];
|
|
233
|
+
const productMediaItems = await unchainedAPI.modules.products.media.findProductMedias({
|
|
234
|
+
productId: { $in: productIds },
|
|
235
|
+
});
|
|
236
|
+
const productMediaMap = {};
|
|
237
|
+
for (const productMedia of productMediaItems) {
|
|
238
|
+
if (!productMediaMap[productMedia.productId]) {
|
|
239
|
+
productMediaMap[productMedia.productId] = [productMedia];
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
productMediaMap[productMedia.productId].push(productMedia);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return queries.map((q) => productMediaMap[q.productId] || []);
|
|
246
|
+
}),
|
|
177
247
|
fileLoader: new DataLoader(async (queries) => {
|
|
178
248
|
const fileIds = [...new Set(queries.map((q) => q.fileId).filter(Boolean))]; // you don't need lodash, _.unique my ass
|
|
179
249
|
const files = await unchainedAPI.modules.files.findFiles({
|
|
180
250
|
_id: { $in: fileIds },
|
|
181
251
|
});
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
});
|
|
189
|
-
}, { batchScheduleFn: (cb) => setImmediate(cb) }),
|
|
252
|
+
const fileMap = {};
|
|
253
|
+
for (const file of files) {
|
|
254
|
+
fileMap[file._id] = file;
|
|
255
|
+
}
|
|
256
|
+
return queries.map((q) => fileMap[q.fileId]);
|
|
257
|
+
}),
|
|
190
258
|
};
|
|
191
259
|
};
|
|
192
260
|
export default loaders;
|