@unchainedshop/api 2.0.0-beta7 → 2.0.0-beta9
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/jest.config.js +9 -0
- package/lib/acl.d.ts +2 -0
- package/lib/acl.js +2 -2
- package/lib/acl.js.map +1 -1
- package/lib/api-index.d.ts +4 -6
- package/lib/api-index.js +5 -13
- package/lib/api-index.js.map +1 -1
- package/lib/context.d.ts +0 -1
- package/lib/context.js +0 -12
- package/lib/context.js.map +1 -1
- package/lib/createGraphQLServer.d.ts +1 -1
- package/lib/createGraphQLServer.js +13 -50
- package/lib/createGraphQLServer.js.map +1 -1
- package/lib/errors.d.ts +20 -0
- package/lib/errors.js +20 -0
- package/lib/errors.js.map +1 -1
- package/lib/express/createApolloMiddleware.d.ts +4 -0
- package/lib/express/createApolloMiddleware.js +34 -0
- package/lib/express/createApolloMiddleware.js.map +1 -0
- package/lib/express/createBulkImportMiddleware.d.ts +2 -0
- package/lib/express/createBulkImportMiddleware.js +79 -0
- package/lib/express/createBulkImportMiddleware.js.map +1 -0
- package/lib/express/createERCMetadataMiddleware.d.ts +3 -0
- package/lib/express/createERCMetadataMiddleware.js +57 -0
- package/lib/express/createERCMetadataMiddleware.js.map +1 -0
- package/lib/express/createSingleSignOnMiddleware.d.ts +6 -0
- package/lib/express/createSingleSignOnMiddleware.js +71 -0
- package/lib/express/createSingleSignOnMiddleware.js.map +1 -0
- package/lib/express/index.d.ts +6 -0
- package/lib/express/index.js +27 -0
- package/lib/express/index.js.map +1 -0
- package/lib/loaders/index.js +5 -9
- package/lib/loaders/index.js.map +1 -1
- package/lib/resolvers/mutations/accounts/changePassword.d.ts +0 -2
- package/lib/resolvers/mutations/accounts/changePassword.js +14 -3
- package/lib/resolvers/mutations/accounts/changePassword.js.map +1 -1
- package/lib/resolvers/mutations/accounts/createUser.js +19 -5
- package/lib/resolvers/mutations/accounts/createUser.js.map +1 -1
- package/lib/resolvers/mutations/accounts/disableTOTP.js +15 -2
- package/lib/resolvers/mutations/accounts/disableTOTP.js.map +1 -1
- package/lib/resolvers/mutations/accounts/enableTOTP.js +12 -1
- package/lib/resolvers/mutations/accounts/enableTOTP.js.map +1 -1
- package/lib/resolvers/mutations/accounts/enrollUser.js +18 -5
- package/lib/resolvers/mutations/accounts/enrollUser.js.map +1 -1
- package/lib/resolvers/mutations/accounts/forgotPassword.js +11 -1
- package/lib/resolvers/mutations/accounts/forgotPassword.js.map +1 -1
- package/lib/resolvers/mutations/accounts/impersonate.js +1 -1
- package/lib/resolvers/mutations/accounts/impersonate.js.map +1 -1
- package/lib/resolvers/mutations/accounts/loginWithPassword.d.ts +0 -1
- package/lib/resolvers/mutations/accounts/loginWithPassword.js +22 -4
- package/lib/resolvers/mutations/accounts/loginWithPassword.js.map +1 -1
- package/lib/resolvers/mutations/accounts/loginWithWebAuthn.js +13 -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.js +6 -2
- package/lib/resolvers/mutations/accounts/logout.js.map +1 -1
- package/lib/resolvers/mutations/accounts/logoutAllSessions.js +4 -1
- package/lib/resolvers/mutations/accounts/logoutAllSessions.js.map +1 -1
- package/lib/resolvers/mutations/accounts/resetPassword.d.ts +0 -1
- package/lib/resolvers/mutations/accounts/resetPassword.js +18 -3
- package/lib/resolvers/mutations/accounts/resetPassword.js.map +1 -1
- package/lib/resolvers/mutations/accounts/setPassword.d.ts +0 -1
- package/lib/resolvers/mutations/accounts/setPassword.js +1 -1
- package/lib/resolvers/mutations/accounts/setPassword.js.map +1 -1
- package/lib/resolvers/mutations/assortments/addAssortmentFilter.js +1 -2
- package/lib/resolvers/mutations/assortments/addAssortmentFilter.js.map +1 -1
- package/lib/resolvers/mutations/assortments/addAssortmentLink.js +16 -9
- package/lib/resolvers/mutations/assortments/addAssortmentLink.js.map +1 -1
- package/lib/resolvers/mutations/assortments/addAssortmentMedia.js +2 -3
- package/lib/resolvers/mutations/assortments/addAssortmentMedia.js.map +1 -1
- package/lib/resolvers/mutations/assortments/addAssortmentProduct.js +1 -2
- package/lib/resolvers/mutations/assortments/addAssortmentProduct.js.map +1 -1
- package/lib/resolvers/mutations/assortments/createAssortment.js +1 -2
- package/lib/resolvers/mutations/assortments/createAssortment.js.map +1 -1
- package/lib/resolvers/mutations/assortments/prepareAssortmentMediaUpload.js +0 -1
- package/lib/resolvers/mutations/assortments/prepareAssortmentMediaUpload.js.map +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortment.js +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortment.js.map +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortmentFilter.js +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortmentFilter.js.map +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortmentLink.js +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortmentLink.js.map +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortmentMedia.js +2 -2
- package/lib/resolvers/mutations/assortments/removeAssortmentMedia.js.map +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortmentProduct.js +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortmentProduct.js.map +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentFilters.js +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentFilters.js.map +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentLinks.js +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentLinks.js.map +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentMedia.js +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentMedia.js.map +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentProducts.js +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentProducts.js.map +1 -1
- package/lib/resolvers/mutations/assortments/setBaseAssortment.js +1 -1
- package/lib/resolvers/mutations/assortments/setBaseAssortment.js.map +1 -1
- package/lib/resolvers/mutations/assortments/updateAssortment.js +1 -1
- package/lib/resolvers/mutations/assortments/updateAssortment.js.map +1 -1
- package/lib/resolvers/mutations/assortments/updateAssortmentMediaTexts.js +1 -1
- package/lib/resolvers/mutations/assortments/updateAssortmentMediaTexts.js.map +1 -1
- package/lib/resolvers/mutations/assortments/updateAssortmentTexts.js +1 -1
- package/lib/resolvers/mutations/assortments/updateAssortmentTexts.js.map +1 -1
- package/lib/resolvers/mutations/bookmarks/bookmark.js +2 -2
- package/lib/resolvers/mutations/bookmarks/bookmark.js.map +1 -1
- package/lib/resolvers/mutations/bookmarks/createBookmark.js +1 -1
- package/lib/resolvers/mutations/bookmarks/createBookmark.js.map +1 -1
- package/lib/resolvers/mutations/countries/createCountry.js +1 -2
- package/lib/resolvers/mutations/countries/createCountry.js.map +1 -1
- package/lib/resolvers/mutations/countries/removeCountry.js +1 -1
- package/lib/resolvers/mutations/countries/removeCountry.js.map +1 -1
- package/lib/resolvers/mutations/countries/updateCountry.js +1 -1
- package/lib/resolvers/mutations/countries/updateCountry.js.map +1 -1
- package/lib/resolvers/mutations/currencies/createCurrency.js +1 -2
- package/lib/resolvers/mutations/currencies/createCurrency.js.map +1 -1
- package/lib/resolvers/mutations/currencies/removeCurrency.js +1 -1
- package/lib/resolvers/mutations/currencies/removeCurrency.js.map +1 -1
- package/lib/resolvers/mutations/currencies/updateCurrency.js +1 -1
- package/lib/resolvers/mutations/currencies/updateCurrency.js.map +1 -1
- package/lib/resolvers/mutations/delivery/createDeliveryProvider.js +1 -2
- package/lib/resolvers/mutations/delivery/createDeliveryProvider.js.map +1 -1
- package/lib/resolvers/mutations/delivery/removeDeliveryProvider.js +1 -1
- package/lib/resolvers/mutations/delivery/removeDeliveryProvider.js.map +1 -1
- package/lib/resolvers/mutations/delivery/updateDeliveryProvider.js +1 -1
- package/lib/resolvers/mutations/delivery/updateDeliveryProvider.js.map +1 -1
- package/lib/resolvers/mutations/enrollments/activateEnrollment.js +1 -1
- package/lib/resolvers/mutations/enrollments/activateEnrollment.js.map +1 -1
- package/lib/resolvers/mutations/enrollments/terminateEnrollment.js +1 -1
- package/lib/resolvers/mutations/enrollments/terminateEnrollment.js.map +1 -1
- package/lib/resolvers/mutations/enrollments/updateEnrollment.d.ts +1 -1
- package/lib/resolvers/mutations/enrollments/updateEnrollment.js +5 -5
- package/lib/resolvers/mutations/enrollments/updateEnrollment.js.map +1 -1
- package/lib/resolvers/mutations/filters/createFilter.js +1 -2
- package/lib/resolvers/mutations/filters/createFilter.js.map +1 -1
- package/lib/resolvers/mutations/filters/createFilterOption.js +1 -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.js +4 -4
- package/lib/resolvers/mutations/filters/removeFilter.js.map +1 -1
- package/lib/resolvers/mutations/filters/updateFilter.js +1 -1
- package/lib/resolvers/mutations/filters/updateFilter.js.map +1 -1
- package/lib/resolvers/mutations/filters/updateFilterTexts.js +1 -1
- package/lib/resolvers/mutations/filters/updateFilterTexts.js.map +1 -1
- package/lib/resolvers/mutations/index.d.ts +2 -1
- package/lib/resolvers/mutations/index.js +2 -0
- package/lib/resolvers/mutations/index.js.map +1 -1
- package/lib/resolvers/mutations/languages/createLanguage.js +1 -2
- package/lib/resolvers/mutations/languages/createLanguage.js.map +1 -1
- package/lib/resolvers/mutations/languages/removeLanguage.js +1 -1
- package/lib/resolvers/mutations/languages/removeLanguage.js.map +1 -1
- package/lib/resolvers/mutations/languages/updateLanguage.js +1 -1
- package/lib/resolvers/mutations/languages/updateLanguage.js.map +1 -1
- package/lib/resolvers/mutations/orders/createCart.js +1 -1
- package/lib/resolvers/mutations/orders/createCart.js.map +1 -1
- package/lib/resolvers/mutations/orders/payOrder.js +1 -1
- package/lib/resolvers/mutations/orders/payOrder.js.map +1 -1
- package/lib/resolvers/mutations/orders/removeOrder.js +1 -1
- package/lib/resolvers/mutations/orders/removeOrder.js.map +1 -1
- package/lib/resolvers/mutations/pageView.d.ts +1 -1
- package/lib/resolvers/mutations/pageView.js +2 -2
- package/lib/resolvers/mutations/pageView.js.map +1 -1
- package/lib/resolvers/mutations/payment/createPaymentProvider.js +1 -2
- package/lib/resolvers/mutations/payment/createPaymentProvider.js.map +1 -1
- package/lib/resolvers/mutations/payment/registerPaymentCredentials.js +2 -2
- package/lib/resolvers/mutations/payment/registerPaymentCredentials.js.map +1 -1
- package/lib/resolvers/mutations/payment/removePaymentProvider.js +1 -1
- package/lib/resolvers/mutations/payment/removePaymentProvider.js.map +1 -1
- package/lib/resolvers/mutations/payment/updatePaymentProvider.js +1 -1
- package/lib/resolvers/mutations/payment/updatePaymentProvider.js.map +1 -1
- package/lib/resolvers/mutations/products/addProductAssignment.js +1 -1
- package/lib/resolvers/mutations/products/addProductAssignment.js.map +1 -1
- package/lib/resolvers/mutations/products/addProductMedia.js +1 -2
- package/lib/resolvers/mutations/products/addProductMedia.js.map +1 -1
- package/lib/resolvers/mutations/products/addProductReviewVote.js +1 -1
- package/lib/resolvers/mutations/products/addProductReviewVote.js.map +1 -1
- package/lib/resolvers/mutations/products/createProduct.js +1 -2
- package/lib/resolvers/mutations/products/createProduct.js.map +1 -1
- package/lib/resolvers/mutations/products/createProductBundleItem.js +1 -1
- package/lib/resolvers/mutations/products/createProductBundleItem.js.map +1 -1
- package/lib/resolvers/mutations/products/createProductReview.js +1 -1
- package/lib/resolvers/mutations/products/createProductReview.js.map +1 -1
- package/lib/resolvers/mutations/products/createProductVariation.js +1 -2
- package/lib/resolvers/mutations/products/createProductVariation.js.map +1 -1
- package/lib/resolvers/mutations/products/createProductVariationOption.js +4 -1
- package/lib/resolvers/mutations/products/createProductVariationOption.js.map +1 -1
- package/lib/resolvers/mutations/products/prepareProductMediaUpload.js +0 -1
- package/lib/resolvers/mutations/products/prepareProductMediaUpload.js.map +1 -1
- package/lib/resolvers/mutations/products/publishProduct.js +1 -1
- package/lib/resolvers/mutations/products/publishProduct.js.map +1 -1
- package/lib/resolvers/mutations/products/removeBundleItem.js +2 -2
- package/lib/resolvers/mutations/products/removeBundleItem.js.map +1 -1
- package/lib/resolvers/mutations/products/removeProduct.d.ts +1 -1
- package/lib/resolvers/mutations/products/removeProduct.js +17 -8
- package/lib/resolvers/mutations/products/removeProduct.js.map +1 -1
- package/lib/resolvers/mutations/products/removeProductAssignment.js +1 -1
- package/lib/resolvers/mutations/products/removeProductAssignment.js.map +1 -1
- package/lib/resolvers/mutations/products/removeProductMedia.js +2 -2
- package/lib/resolvers/mutations/products/removeProductMedia.js.map +1 -1
- package/lib/resolvers/mutations/products/removeProductReview.js +1 -1
- package/lib/resolvers/mutations/products/removeProductReview.js.map +1 -1
- package/lib/resolvers/mutations/products/removeProductReviewVote.js +1 -1
- package/lib/resolvers/mutations/products/removeProductReviewVote.js.map +1 -1
- package/lib/resolvers/mutations/products/removeProductVariation.js +1 -1
- package/lib/resolvers/mutations/products/removeProductVariation.js.map +1 -1
- package/lib/resolvers/mutations/products/removeProductVariationOption.js +1 -1
- package/lib/resolvers/mutations/products/removeProductVariationOption.js.map +1 -1
- package/lib/resolvers/mutations/products/reorderProductMedia.js +1 -1
- package/lib/resolvers/mutations/products/reorderProductMedia.js.map +1 -1
- package/lib/resolvers/mutations/products/unpublishProduct.js +1 -1
- package/lib/resolvers/mutations/products/unpublishProduct.js.map +1 -1
- package/lib/resolvers/mutations/products/updateProduct.js +1 -1
- package/lib/resolvers/mutations/products/updateProduct.js.map +1 -1
- package/lib/resolvers/mutations/products/updateProductCommerce.js +1 -1
- package/lib/resolvers/mutations/products/updateProductCommerce.js.map +1 -1
- package/lib/resolvers/mutations/products/updateProductMediaTexts.js +1 -1
- package/lib/resolvers/mutations/products/updateProductMediaTexts.js.map +1 -1
- package/lib/resolvers/mutations/products/updateProductPlan.js +1 -1
- package/lib/resolvers/mutations/products/updateProductPlan.js.map +1 -1
- package/lib/resolvers/mutations/products/updateProductReview.js +1 -1
- package/lib/resolvers/mutations/products/updateProductReview.js.map +1 -1
- package/lib/resolvers/mutations/products/updateProductSupply.js +1 -1
- package/lib/resolvers/mutations/products/updateProductSupply.js.map +1 -1
- package/lib/resolvers/mutations/products/updateProductTexts.js +1 -1
- package/lib/resolvers/mutations/products/updateProductTexts.js.map +1 -1
- package/lib/resolvers/mutations/products/updateProductTokenization.js +1 -1
- package/lib/resolvers/mutations/products/updateProductTokenization.js.map +1 -1
- package/lib/resolvers/mutations/products/updateProductVariationTexts.js +1 -1
- package/lib/resolvers/mutations/products/updateProductVariationTexts.js.map +1 -1
- package/lib/resolvers/mutations/products/updateProductWarehousing.js +1 -1
- package/lib/resolvers/mutations/products/updateProductWarehousing.js.map +1 -1
- package/lib/resolvers/mutations/users/prepareUserAvatarUpload.js +0 -1
- package/lib/resolvers/mutations/users/prepareUserAvatarUpload.js.map +1 -1
- package/lib/resolvers/mutations/users/removeUser.d.ts +4 -0
- package/lib/resolvers/mutations/users/removeUser.js +11 -0
- package/lib/resolvers/mutations/users/removeUser.js.map +1 -0
- package/lib/resolvers/mutations/users/setRoles.js +1 -1
- package/lib/resolvers/mutations/users/setRoles.js.map +1 -1
- package/lib/resolvers/mutations/users/setUserTags.js +1 -1
- package/lib/resolvers/mutations/users/setUserTags.js.map +1 -1
- package/lib/resolvers/mutations/users/updateUserAvatar.js +1 -2
- package/lib/resolvers/mutations/users/updateUserAvatar.js.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/utils/getOrderCart.js +1 -1
- package/lib/resolvers/mutations/utils/getOrderCart.js.map +1 -1
- package/lib/resolvers/mutations/warehousing/createWarehousingProvider.js +1 -2
- package/lib/resolvers/mutations/warehousing/createWarehousingProvider.js.map +1 -1
- package/lib/resolvers/mutations/warehousing/removeWarehousingProvider.js +1 -1
- package/lib/resolvers/mutations/warehousing/removeWarehousingProvider.js.map +1 -1
- package/lib/resolvers/mutations/warehousing/updateWarehousingProvider.js +1 -1
- package/lib/resolvers/mutations/warehousing/updateWarehousingProvider.js.map +1 -1
- package/lib/resolvers/mutations/worker/addWork.js +1 -1
- package/lib/resolvers/mutations/worker/addWork.js.map +1 -1
- package/lib/resolvers/mutations/worker/finishWork.js +1 -1
- package/lib/resolvers/mutations/worker/finishWork.js.map +1 -1
- package/lib/resolvers/mutations/worker/removeWork.js +1 -1
- package/lib/resolvers/mutations/worker/removeWork.js.map +1 -1
- package/lib/resolvers/queries/products/productCatalogPrices.js +0 -1
- package/lib/resolvers/queries/products/productCatalogPrices.js.map +1 -1
- package/lib/resolvers/queries/users/users.d.ts +2 -1
- package/lib/resolvers/queries/users/users.js.map +1 -1
- package/lib/resolvers/queries/worker/workQueue.d.ts +1 -1
- package/lib/resolvers/queries/worker/workQueue.js +1 -1
- package/lib/resolvers/queries/worker/workQueue.js.map +1 -1
- package/lib/resolvers/type/assortment/assortment-filter-types.d.ts +2 -2
- package/lib/resolvers/type/assortment/assortment-filter-types.js +0 -1
- package/lib/resolvers/type/assortment/assortment-filter-types.js.map +1 -1
- package/lib/resolvers/type/assortment/assortment-link-types.d.ts +2 -2
- package/lib/resolvers/type/assortment/assortment-link-types.js +0 -2
- package/lib/resolvers/type/assortment/assortment-link-types.js.map +1 -1
- package/lib/resolvers/type/assortment/assortment-media-types.d.ts +1 -1
- package/lib/resolvers/type/assortment/assortment-media-types.js +2 -0
- package/lib/resolvers/type/assortment/assortment-media-types.js.map +1 -1
- package/lib/resolvers/type/assortment/assortment-path-link-types.d.ts +1 -4
- package/lib/resolvers/type/assortment/assortment-path-link-types.js +1 -7
- package/lib/resolvers/type/assortment/assortment-path-link-types.js.map +1 -1
- package/lib/resolvers/type/assortment/assortment-product-types.d.ts +2 -2
- package/lib/resolvers/type/assortment/assortment-product-types.js +0 -2
- package/lib/resolvers/type/assortment/assortment-product-types.js.map +1 -1
- package/lib/resolvers/type/assortment/assortment-types.d.ts +1 -1
- package/lib/resolvers/type/assortment/assortment-types.js +8 -4
- package/lib/resolvers/type/assortment/assortment-types.js.map +1 -1
- package/lib/resolvers/type/bookmark-types.d.ts +1 -1
- package/lib/resolvers/type/bookmark-types.js +0 -1
- package/lib/resolvers/type/bookmark-types.js.map +1 -1
- package/lib/resolvers/type/country-types.d.ts +1 -1
- package/lib/resolvers/type/delivery-provider-types.d.ts +1 -1
- package/lib/resolvers/type/enrollment/enrollment-delivery-types.d.ts +2 -2
- package/lib/resolvers/type/enrollment/enrollment-payment-types.d.ts +2 -2
- package/lib/resolvers/type/enrollment/enrollment-period-types.d.ts +2 -2
- package/lib/resolvers/type/enrollment/enrollment-plan-tyes.d.ts +2 -2
- package/lib/resolvers/type/enrollment/enrollment-plan-tyes.js +0 -1
- package/lib/resolvers/type/enrollment/enrollment-plan-tyes.js.map +1 -1
- package/lib/resolvers/type/enrollment/enrollment-types.d.ts +2 -2
- package/lib/resolvers/type/event-types.d.ts +1 -1
- package/lib/resolvers/type/filter/filter-option-types.d.ts +2 -2
- package/lib/resolvers/type/filter/filter-types.d.ts +2 -2
- package/lib/resolvers/type/index.d.ts +1 -0
- package/lib/resolvers/type/login-method-response-types.d.ts +1 -0
- package/lib/resolvers/type/order/order-delivery-discount-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-delivery-pickup-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-delivery-shipping-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-discount-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-global-discount-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-item-discount-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-item-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-item-types.js +0 -3
- 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-discount-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-payment-generic-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-payment-invoice-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-types.d.ts +1 -1
- package/lib/resolvers/type/price-types.d.ts +1 -1
- package/lib/resolvers/type/product/product-assortment-path-types.js +1 -0
- package/lib/resolvers/type/product/product-assortment-path-types.js.map +1 -1
- package/lib/resolvers/type/product/product-bundle-item-types.js +0 -1
- package/lib/resolvers/type/product/product-bundle-item-types.js.map +1 -1
- package/lib/resolvers/type/product/product-configurable-types.js +1 -0
- package/lib/resolvers/type/product/product-configurable-types.js.map +1 -1
- package/lib/resolvers/type/product/product-discount.d.ts +1 -1
- package/lib/resolvers/type/product/product-media-types.js +2 -0
- package/lib/resolvers/type/product/product-media-types.js.map +1 -1
- package/lib/resolvers/type/product/product-plan-types.js +1 -12
- 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.js +0 -1
- package/lib/resolvers/type/product/product-review-types.js.map +1 -1
- package/lib/resolvers/type/product/product-variation-assignment-types.js +0 -1
- package/lib/resolvers/type/product/product-variation-assignment-types.js.map +1 -1
- package/lib/resolvers/type/quotation-types.d.ts +2 -2
- package/lib/resolvers/type/quotation-types.js +0 -1
- package/lib/resolvers/type/quotation-types.js.map +1 -1
- package/lib/resolvers/type/shop-types.d.ts +1 -1
- package/lib/resolvers/type/token-types.d.ts +1 -1
- package/lib/resolvers/type/token-types.js +2 -1
- package/lib/resolvers/type/token-types.js.map +1 -1
- package/lib/resolvers/type/user-types.d.ts +4 -3
- package/lib/resolvers/type/user-types.js +10 -21
- package/lib/resolvers/type/user-types.js.map +1 -1
- package/lib/resolvers/type/webauthn-credentials-types.d.ts +1 -1
- package/lib/resolvers/type/work-types.d.ts +1 -1
- package/lib/roles/admin.js +3 -72
- package/lib/roles/admin.js.map +1 -1
- package/lib/schema/{types/log.d.ts → directives.d.ts} +0 -0
- package/lib/schema/directives.js +15 -0
- package/lib/schema/directives.js.map +1 -0
- package/lib/schema/index.js +2 -1
- package/lib/schema/index.js.map +1 -1
- package/lib/schema/inputTypes.js +0 -15
- package/lib/schema/inputTypes.js.map +1 -1
- package/lib/schema/mutation.js +22 -36
- package/lib/schema/mutation.js.map +1 -1
- package/lib/schema/query.js +42 -22
- package/lib/schema/query.js.map +1 -1
- package/lib/schema/types/assortment.js +10 -10
- package/lib/schema/types/color.js +1 -1
- package/lib/schema/types/country.js +1 -1
- package/lib/schema/types/currency.js +1 -1
- package/lib/schema/types/delivery.js +3 -2
- package/lib/schema/types/delivery.js.map +1 -1
- package/lib/schema/types/dimensions.js +1 -1
- package/lib/schema/types/discount.js +1 -1
- package/lib/schema/types/filter.js +5 -8
- package/lib/schema/types/filter.js.map +1 -1
- package/lib/schema/types/geo-position.js +1 -1
- package/lib/schema/types/language.js +1 -1
- package/lib/schema/types/media.js +1 -1
- package/lib/schema/types/payment.js +3 -3
- package/lib/schema/types/price.js +2 -2
- package/lib/schema/types/product/bundle-product.js +2 -3
- package/lib/schema/types/product/bundle-product.js.map +1 -1
- package/lib/schema/types/product/configurable-product.js +7 -7
- package/lib/schema/types/product/plan-product.js +3 -3
- package/lib/schema/types/product/product.js +11 -11
- package/lib/schema/types/product/simple-product.js +4 -4
- package/lib/schema/types/product/tokenized-product.js +3 -3
- package/lib/schema/types/search.js +3 -8
- package/lib/schema/types/search.js.map +1 -1
- package/lib/schema/types/shop.js +2 -2
- package/lib/schema/types/types.js +1 -1
- package/lib/schema/types/user.js +4 -3
- package/lib/schema/types/user.js.map +1 -1
- package/lib/schema/types/warehousing.js +3 -3
- package/package.json +26 -12
- package/src/acl.ts +2 -2
- package/src/api-index.ts +6 -27
- package/src/context.ts +0 -18
- package/src/createGraphQLServer.ts +14 -68
- package/src/errors.ts +85 -0
- package/src/express/createApolloMiddleware.ts +40 -0
- package/src/express/createBulkImportMiddleware.ts +87 -0
- package/src/express/createERCMetadataMiddleware.ts +73 -0
- package/src/express/createSingleSignOnMiddleware.ts +84 -0
- package/src/express/index.ts +48 -0
- package/src/loaders/index.ts +27 -35
- package/src/resolvers/mutations/accounts/changePassword.ts +11 -6
- package/src/resolvers/mutations/accounts/createUser.ts +21 -6
- package/src/resolvers/mutations/accounts/disableTOTP.ts +13 -3
- package/src/resolvers/mutations/accounts/enableTOTP.ts +9 -2
- package/src/resolvers/mutations/accounts/enrollUser.ts +20 -5
- package/src/resolvers/mutations/accounts/forgotPassword.ts +8 -1
- package/src/resolvers/mutations/accounts/impersonate.ts +1 -1
- package/src/resolvers/mutations/accounts/loginWithPassword.ts +27 -5
- package/src/resolvers/mutations/accounts/loginWithWebAuthn.ts +13 -2
- package/src/resolvers/mutations/accounts/logout.ts +9 -2
- package/src/resolvers/mutations/accounts/logoutAllSessions.ts +7 -1
- package/src/resolvers/mutations/accounts/resetPassword.ts +21 -5
- package/src/resolvers/mutations/accounts/setPassword.ts +2 -2
- package/src/resolvers/mutations/assortments/addAssortmentFilter.ts +5 -9
- package/src/resolvers/mutations/assortments/addAssortmentLink.ts +22 -14
- package/src/resolvers/mutations/assortments/addAssortmentMedia.ts +2 -6
- package/src/resolvers/mutations/assortments/addAssortmentProduct.ts +0 -2
- package/src/resolvers/mutations/assortments/createAssortment.ts +4 -8
- package/src/resolvers/mutations/assortments/prepareAssortmentMediaUpload.ts +0 -1
- 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 +2 -2
- package/src/resolvers/mutations/assortments/removeAssortmentProduct.ts +1 -1
- package/src/resolvers/mutations/assortments/reorderAssortmentFilters.ts +3 -6
- package/src/resolvers/mutations/assortments/reorderAssortmentLinks.ts +0 -1
- package/src/resolvers/mutations/assortments/reorderAssortmentMedia.ts +3 -6
- package/src/resolvers/mutations/assortments/reorderAssortmentProducts.ts +0 -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 +4 -7
- package/src/resolvers/mutations/bookmarks/createBookmark.ts +4 -7
- package/src/resolvers/mutations/countries/createCountry.ts +3 -7
- package/src/resolvers/mutations/countries/removeCountry.ts +1 -1
- package/src/resolvers/mutations/countries/updateCountry.ts +1 -1
- package/src/resolvers/mutations/currencies/createCurrency.ts +3 -7
- 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 +3 -7
- 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 +1 -1
- package/src/resolvers/mutations/enrollments/terminateEnrollment.ts +1 -1
- package/src/resolvers/mutations/enrollments/updateEnrollment.ts +5 -5
- package/src/resolvers/mutations/filters/createFilter.ts +0 -2
- package/src/resolvers/mutations/filters/createFilterOption.ts +5 -1
- package/src/resolvers/mutations/filters/removeFilter.ts +4 -4
- package/src/resolvers/mutations/filters/updateFilter.ts +1 -1
- package/src/resolvers/mutations/filters/updateFilterTexts.ts +1 -1
- package/src/resolvers/mutations/index.ts +2 -0
- package/src/resolvers/mutations/languages/createLanguage.ts +3 -7
- package/src/resolvers/mutations/languages/removeLanguage.ts +1 -1
- package/src/resolvers/mutations/languages/updateLanguage.ts +1 -1
- package/src/resolvers/mutations/orders/createCart.ts +4 -1
- package/src/resolvers/mutations/orders/payOrder.ts +1 -1
- package/src/resolvers/mutations/orders/removeOrder.ts +1 -1
- package/src/resolvers/mutations/pageView.ts +2 -2
- package/src/resolvers/mutations/payment/createPaymentProvider.ts +3 -7
- package/src/resolvers/mutations/payment/registerPaymentCredentials.ts +6 -2
- package/src/resolvers/mutations/payment/removePaymentProvider.ts +1 -1
- package/src/resolvers/mutations/payment/updatePaymentProvider.ts +1 -1
- package/src/resolvers/mutations/products/addProductAssignment.ts +4 -8
- package/src/resolvers/mutations/products/addProductMedia.ts +1 -2
- package/src/resolvers/mutations/products/addProductReviewVote.ts +1 -1
- package/src/resolvers/mutations/products/createProduct.ts +4 -8
- package/src/resolvers/mutations/products/createProductBundleItem.ts +1 -1
- package/src/resolvers/mutations/products/createProductReview.ts +5 -8
- package/src/resolvers/mutations/products/createProductVariation.ts +6 -10
- package/src/resolvers/mutations/products/createProductVariationOption.ts +4 -5
- package/src/resolvers/mutations/products/prepareProductMediaUpload.ts +0 -1
- package/src/resolvers/mutations/products/publishProduct.ts +1 -1
- package/src/resolvers/mutations/products/removeBundleItem.ts +2 -2
- package/src/resolvers/mutations/products/removeProduct.ts +26 -7
- package/src/resolvers/mutations/products/removeProductAssignment.ts +1 -1
- package/src/resolvers/mutations/products/removeProductMedia.ts +2 -2
- 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 +0 -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 +0 -1
- package/src/resolvers/mutations/products/updateProductWarehousing.ts +1 -1
- package/src/resolvers/mutations/users/prepareUserAvatarUpload.ts +0 -1
- package/src/resolvers/mutations/users/removeUser.ts +19 -0
- package/src/resolvers/mutations/users/setRoles.ts +1 -1
- package/src/resolvers/mutations/users/setUserTags.ts +1 -1
- package/src/resolvers/mutations/users/updateUserAvatar.ts +1 -2
- package/src/resolvers/mutations/users/updateUserProfile.ts +1 -1
- package/src/resolvers/mutations/utils/getOrderCart.ts +1 -1
- package/src/resolvers/mutations/warehousing/createWarehousingProvider.ts +3 -7
- package/src/resolvers/mutations/warehousing/removeWarehousingProvider.ts +1 -1
- package/src/resolvers/mutations/warehousing/updateWarehousingProvider.ts +1 -1
- package/src/resolvers/mutations/worker/addWork.ts +1 -1
- package/src/resolvers/mutations/worker/finishWork.ts +8 -12
- package/src/resolvers/mutations/worker/removeWork.ts +1 -1
- package/src/resolvers/queries/products/productCatalogPrices.ts +0 -1
- package/src/resolvers/queries/users/users.ts +2 -1
- package/src/resolvers/queries/worker/workQueue.ts +1 -1
- package/src/resolvers/type/assortment/assortment-filter-types.ts +0 -1
- package/src/resolvers/type/assortment/assortment-link-types.ts +0 -2
- package/src/resolvers/type/assortment/assortment-media-types.ts +2 -0
- package/src/resolvers/type/assortment/assortment-path-link-types.ts +1 -11
- package/src/resolvers/type/assortment/assortment-product-types.ts +0 -2
- package/src/resolvers/type/assortment/assortment-types.ts +9 -4
- package/src/resolvers/type/bookmark-types.ts +0 -1
- package/src/resolvers/type/enrollment/enrollment-plan-tyes.ts +0 -1
- package/src/resolvers/type/order/order-item-types.ts +0 -3
- package/src/resolvers/type/product/product-assortment-path-types.ts +1 -0
- package/src/resolvers/type/product/product-bundle-item-types.ts +0 -1
- package/src/resolvers/type/product/product-configurable-types.ts +1 -0
- package/src/resolvers/type/product/product-media-types.ts +2 -0
- package/src/resolvers/type/product/product-plan-types.ts +2 -18
- package/src/resolvers/type/product/product-review-types.ts +0 -1
- package/src/resolvers/type/product/product-variation-assignment-types.ts +0 -1
- package/src/resolvers/type/quotation-types.ts +0 -1
- package/src/resolvers/type/token-types.ts +2 -1
- package/src/resolvers/type/user-types.ts +14 -25
- package/src/roles/admin.ts +3 -72
- package/src/schema/directives.js +14 -0
- package/src/schema/index.js +2 -1
- package/src/schema/inputTypes.js +0 -15
- package/src/schema/mutation.js +22 -36
- package/src/schema/query.js +42 -22
- package/src/schema/types/assortment.js +10 -10
- package/src/schema/types/color.js +1 -1
- package/src/schema/types/country.js +1 -1
- package/src/schema/types/currency.js +1 -1
- package/src/schema/types/delivery.js +3 -2
- package/src/schema/types/dimensions.js +1 -1
- package/src/schema/types/discount.js +1 -1
- package/src/schema/types/filter.js +5 -8
- package/src/schema/types/geo-position.js +1 -1
- package/src/schema/types/language.js +1 -1
- package/src/schema/types/media.js +1 -1
- package/src/schema/types/payment.js +3 -3
- package/src/schema/types/price.js +2 -2
- package/src/schema/types/product/bundle-product.js +2 -3
- package/src/schema/types/product/configurable-product.js +7 -7
- package/src/schema/types/product/plan-product.js +3 -3
- package/src/schema/types/product/product.js +11 -11
- package/src/schema/types/product/simple-product.js +4 -4
- package/src/schema/types/product/tokenized-product.js +3 -3
- package/src/schema/types/search.js +3 -8
- package/src/schema/types/shop.js +2 -2
- package/src/schema/types/types.js +1 -1
- package/src/schema/types/user.js +4 -3
- package/src/schema/types/warehousing.js +3 -3
- package/tests/api-index.test.ts +78 -0
- package/lib/createBulkImportServer.d.ts +0 -2
- package/lib/createBulkImportServer.js +0 -81
- package/lib/createBulkImportServer.js.map +0 -1
- package/lib/createERCMetadataServer.d.ts +0 -2
- package/lib/createERCMetadataServer.js +0 -59
- package/lib/createERCMetadataServer.js.map +0 -1
- package/lib/schema/types/log.js +0 -16
- package/lib/schema/types/log.js.map +0 -1
- package/src/createBulkImportServer.ts +0 -95
- package/src/createERCMetadataServer.ts +0 -78
- package/src/schema/types/log.js +0 -15
|
@@ -13,7 +13,7 @@ export default [
|
|
|
13
13
|
METERED
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
type ProductPlanConfiguration {
|
|
16
|
+
type ProductPlanConfiguration @cacheControl(maxAge: 180) {
|
|
17
17
|
usageCalculationType: ProductPlanUsageCalculationType!
|
|
18
18
|
billingInterval: ProductPlanConfigurationInterval!
|
|
19
19
|
billingIntervalCount: Int
|
|
@@ -32,7 +32,7 @@ export default [
|
|
|
32
32
|
"""
|
|
33
33
|
Plan (Virtual Product that somebody can enroll to)
|
|
34
34
|
"""
|
|
35
|
-
type PlanProduct implements Product {
|
|
35
|
+
type PlanProduct implements Product @cacheControl(maxAge: 180) {
|
|
36
36
|
_id: ID!
|
|
37
37
|
sequence: Int!
|
|
38
38
|
status: ProductStatus!
|
|
@@ -45,7 +45,7 @@ export default [
|
|
|
45
45
|
catalogPrice(quantity: Int = 1, currency: String): Price
|
|
46
46
|
leveledCatalogPrices(currency: String): [PriceLevel!]!
|
|
47
47
|
simulatedPrice(currency: String, useNetPrice: Boolean = false, quantity: Int = 1): Price
|
|
48
|
-
|
|
48
|
+
@cacheControl(scope: PRIVATE)
|
|
49
49
|
assortmentPaths(forceLocale: String): [ProductAssortmentPath!]!
|
|
50
50
|
siblings(
|
|
51
51
|
assortmentId: ID
|
|
@@ -17,20 +17,20 @@ export default [
|
|
|
17
17
|
DELETED
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
type ProductDiscount {
|
|
20
|
+
type ProductDiscount @cacheControl(maxAge: 0) {
|
|
21
21
|
_id: ID!
|
|
22
22
|
interface: DiscountInterface
|
|
23
23
|
total: Price!
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
type ProductMediaTexts {
|
|
26
|
+
type ProductMediaTexts @cacheControl(maxAge: 180) {
|
|
27
27
|
_id: ID!
|
|
28
28
|
locale: String
|
|
29
29
|
title: String
|
|
30
30
|
subtitle: String
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
type ProductMedia {
|
|
33
|
+
type ProductMedia @cacheControl(maxAge: 180) {
|
|
34
34
|
_id: ID!
|
|
35
35
|
tags: [LowerCaseString!]
|
|
36
36
|
file: Media!
|
|
@@ -38,7 +38,7 @@ export default [
|
|
|
38
38
|
texts(forceLocale: String): ProductMediaTexts
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
type ProductTexts {
|
|
41
|
+
type ProductTexts @cacheControl(maxAge: 180) {
|
|
42
42
|
_id: ID!
|
|
43
43
|
locale: String
|
|
44
44
|
slug: String
|
|
@@ -53,7 +53,7 @@ export default [
|
|
|
53
53
|
"""
|
|
54
54
|
Abstract Product
|
|
55
55
|
"""
|
|
56
|
-
interface Product {
|
|
56
|
+
interface Product @cacheControl(maxAge: 180) {
|
|
57
57
|
_id: ID!
|
|
58
58
|
sequence: Int!
|
|
59
59
|
status: ProductStatus!
|
|
@@ -81,12 +81,12 @@ export default [
|
|
|
81
81
|
"""
|
|
82
82
|
Directed assortment to product paths (breadcrumbs)
|
|
83
83
|
"""
|
|
84
|
-
type ProductAssortmentPath {
|
|
84
|
+
type ProductAssortmentPath @cacheControl(maxAge: 180) {
|
|
85
85
|
assortmentProduct: AssortmentProduct!
|
|
86
86
|
links: [AssortmentPathLink!]!
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
type ProductReview {
|
|
89
|
+
type ProductReview @cacheControl(maxAge: 60) {
|
|
90
90
|
_id: ID!
|
|
91
91
|
created: DateTime
|
|
92
92
|
updated: DateTime
|
|
@@ -97,10 +97,10 @@ export default [
|
|
|
97
97
|
title: String
|
|
98
98
|
review: String
|
|
99
99
|
voteCount(type: ProductReviewVoteType): Int
|
|
100
|
-
ownVotes: [ProductReviewVote!]!
|
|
100
|
+
ownVotes: [ProductReviewVote!]! @cacheControl(scope: PRIVATE, maxAge: 60)
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
type ProductReviewVote {
|
|
103
|
+
type ProductReviewVote @cacheControl(maxAge: 60) {
|
|
104
104
|
_id: ID!
|
|
105
105
|
timestamp: Timestamp!
|
|
106
106
|
type: ProductReviewVoteType!
|
|
@@ -117,13 +117,13 @@ export default [
|
|
|
117
117
|
value: String!
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
type PriceLevel {
|
|
120
|
+
type PriceLevel @cacheControl(maxAge: 60) {
|
|
121
121
|
minQuantity: Int!
|
|
122
122
|
maxQuantity: Int
|
|
123
123
|
price: Price!
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
type ProductCatalogPrice {
|
|
126
|
+
type ProductCatalogPrice @cacheControl(maxAge: 60) {
|
|
127
127
|
_id: ID!
|
|
128
128
|
isTaxable: Boolean!
|
|
129
129
|
isNetPrice: Boolean!
|
|
@@ -3,7 +3,7 @@ export default [
|
|
|
3
3
|
"""
|
|
4
4
|
Simple Product
|
|
5
5
|
"""
|
|
6
|
-
type SimpleProduct implements Product {
|
|
6
|
+
type SimpleProduct implements Product @cacheControl(maxAge: 180) {
|
|
7
7
|
_id: ID!
|
|
8
8
|
sequence: Int!
|
|
9
9
|
status: ProductStatus!
|
|
@@ -16,16 +16,16 @@ export default [
|
|
|
16
16
|
catalogPrice(quantity: Int = 1, currency: String): Price
|
|
17
17
|
leveledCatalogPrices(currency: String): [PriceLevel!]!
|
|
18
18
|
simulatedPrice(currency: String, useNetPrice: Boolean = false, quantity: Int = 1): Price
|
|
19
|
-
|
|
19
|
+
@cacheControl(scope: PRIVATE, maxAge: 10)
|
|
20
20
|
simulatedDispatches(
|
|
21
21
|
deliveryProviderType: DeliveryProviderType = SHIPPING
|
|
22
22
|
referenceDate: Timestamp
|
|
23
23
|
quantity: Int = 1
|
|
24
|
-
): [Dispatch!]
|
|
24
|
+
): [Dispatch!] @cacheControl(scope: PRIVATE, maxAge: 10)
|
|
25
25
|
simulatedStocks(
|
|
26
26
|
deliveryProviderType: DeliveryProviderType = SHIPPING
|
|
27
27
|
referenceDate: Timestamp
|
|
28
|
-
): [Stock!]
|
|
28
|
+
): [Stock!] @cacheControl(scope: PRIVATE, maxAge: 10)
|
|
29
29
|
assortmentPaths: [ProductAssortmentPath!]!
|
|
30
30
|
siblings(
|
|
31
31
|
assortmentId: ID
|
|
@@ -13,7 +13,7 @@ export default [
|
|
|
13
13
|
ERC721
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
type ContractConfiguration {
|
|
16
|
+
type ContractConfiguration @cacheControl(maxAge: 180) {
|
|
17
17
|
tokenId: String
|
|
18
18
|
supply: Int
|
|
19
19
|
ercMetadataProperties: JSON
|
|
@@ -35,8 +35,8 @@ export default [
|
|
|
35
35
|
catalogPrice(quantity: Int = 1, currency: String): Price
|
|
36
36
|
leveledCatalogPrices(currency: String): [PriceLevel!]!
|
|
37
37
|
simulatedPrice(currency: String, useNetPrice: Boolean = false, quantity: Int = 1): Price
|
|
38
|
-
|
|
39
|
-
simulatedStocks(referenceDate: Timestamp): [Stock!]
|
|
38
|
+
@cacheControl(scope: PRIVATE, maxAge: 10)
|
|
39
|
+
simulatedStocks(referenceDate: Timestamp): [Stock!] @cacheControl(scope: PRIVATE, maxAge: 10)
|
|
40
40
|
assortmentPaths(forceLocale: String): [ProductAssortmentPath!]!
|
|
41
41
|
siblings(
|
|
42
42
|
assortmentId: ID
|
|
@@ -7,10 +7,8 @@ export default [
|
|
|
7
7
|
"""
|
|
8
8
|
Search result
|
|
9
9
|
"""
|
|
10
|
-
type SearchResult {
|
|
11
|
-
totalProducts: Int! @deprecated(reason: "Renamed, use the productsCount field")
|
|
10
|
+
type SearchResult @cacheControl(maxAge: 180) {
|
|
12
11
|
productsCount: Int!
|
|
13
|
-
filteredProducts: Int! @deprecated(reason: "Renamed, use the filteredProductsCount field")
|
|
14
12
|
filteredProductsCount: Int!
|
|
15
13
|
filters: [LoadedFilter!]!
|
|
16
14
|
products(limit: Int = 10, offset: Int = 0): [Product!]!
|
|
@@ -19,17 +17,14 @@ export default [
|
|
|
19
17
|
"""
|
|
20
18
|
Search result
|
|
21
19
|
"""
|
|
22
|
-
type ProductSearchResult {
|
|
23
|
-
totalProducts: Int! @deprecated(reason: "Renamed, use the productsCount field")
|
|
20
|
+
type ProductSearchResult @cacheControl(maxAge: 180) {
|
|
24
21
|
productsCount: Int!
|
|
25
|
-
filteredProducts: Int! @deprecated(reason: "Renamed, use the filteredProductsCount field")
|
|
26
22
|
filteredProductsCount: Int!
|
|
27
23
|
filters: [LoadedFilter!]!
|
|
28
24
|
products(limit: Int = 10, offset: Int = 0): [Product!]!
|
|
29
25
|
}
|
|
30
26
|
|
|
31
|
-
type AssortmentSearchResult {
|
|
32
|
-
totalAssortments: Int! @deprecated(reason: "Renamed, use the assortmentsCount field")
|
|
27
|
+
type AssortmentSearchResult @cacheControl(maxAge: 180) {
|
|
33
28
|
assortmentsCount: Int!
|
|
34
29
|
assortments(limit: Int = 10, offset: Int = 0): [Assortment!]!
|
|
35
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/schema/types/search.js"],"names":[],"mappings":"AAAA,eAAe;IACb,aAAa,CAAC
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/schema/types/search.js"],"names":[],"mappings":"AAAA,eAAe;IACb,aAAa,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6Bb;CACF,CAAC"}
|
package/lib/schema/types/shop.js
CHANGED
package/lib/schema/types/user.js
CHANGED
|
@@ -5,7 +5,7 @@ export default [
|
|
|
5
5
|
"""
|
|
6
6
|
Type returned when the user logs in
|
|
7
7
|
"""
|
|
8
|
-
type LoginMethodResponse {
|
|
8
|
+
type LoginMethodResponse @cacheControl(maxAge: 0, scope: PRIVATE) {
|
|
9
9
|
"""
|
|
10
10
|
Id of the user logged in user
|
|
11
11
|
"""
|
|
@@ -86,9 +86,10 @@ export default [
|
|
|
86
86
|
|
|
87
87
|
type User {
|
|
88
88
|
_id: ID!
|
|
89
|
-
|
|
89
|
+
created: DateTime!
|
|
90
|
+
updated: DateTime
|
|
91
|
+
deleted: DateTime
|
|
90
92
|
username: String
|
|
91
|
-
isEmailVerified: Boolean! @deprecated(reason: "Please use primaryEmail.verified instead")
|
|
92
93
|
isGuest: Boolean!
|
|
93
94
|
isTwoFactorEnabled: Boolean!
|
|
94
95
|
isInitialPassword: Boolean!
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../src/schema/types/user.js"],"names":[],"mappings":"AAAA,eAAe;IACb,aAAa,CAAC
|
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../src/schema/types/user.js"],"names":[],"mappings":"AAAA,eAAe;IACb,aAAa,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqHb;CACF,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export default [
|
|
2
2
|
/* GraphQL */ `
|
|
3
|
-
type WarehousingInterface {
|
|
3
|
+
type WarehousingInterface @cacheControl(maxAge: 180) {
|
|
4
4
|
_id: ID!
|
|
5
5
|
label: String
|
|
6
6
|
version: String
|
|
@@ -24,7 +24,7 @@ export default [
|
|
|
24
24
|
WRONG_CREDENTIALS
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
type WarehousingProvider {
|
|
27
|
+
type WarehousingProvider @cacheControl(maxAge: 60) {
|
|
28
28
|
_id: ID!
|
|
29
29
|
created: DateTime
|
|
30
30
|
updated: DateTime
|
|
@@ -42,7 +42,7 @@ export default [
|
|
|
42
42
|
DECENTRALIZED
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
type Token {
|
|
45
|
+
type Token @cacheControl(maxAge: 0, scope: PRIVATE) {
|
|
46
46
|
_id: ID!
|
|
47
47
|
user: User
|
|
48
48
|
walletAddress: String
|
package/package.json
CHANGED
|
@@ -1,18 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unchainedshop/api",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-beta9",
|
|
4
4
|
"main": "lib/api-index.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./lib/api-index.js",
|
|
7
7
|
"./*": "./lib/*"
|
|
8
8
|
},
|
|
9
|
-
"
|
|
9
|
+
"typesVersions": {
|
|
10
|
+
"*": {
|
|
11
|
+
"express": [
|
|
12
|
+
"./lib/express/index.d.ts"
|
|
13
|
+
],
|
|
14
|
+
"express/*": [
|
|
15
|
+
"./lib/express/*"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
10
19
|
"type": "module",
|
|
11
20
|
"scripts": {
|
|
12
21
|
"clean": "rm -rf lib",
|
|
13
22
|
"build": "npm run clean && tsc",
|
|
14
23
|
"watch": "tsc -w",
|
|
15
|
-
"test": "jest --
|
|
24
|
+
"test": "NODE_OPTIONS=--experimental-vm-modules jest --detectOpenHandles --forceExit",
|
|
25
|
+
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch --detectOpenHandles --forceExit"
|
|
16
26
|
},
|
|
17
27
|
"repository": {
|
|
18
28
|
"type": "git",
|
|
@@ -30,17 +40,20 @@
|
|
|
30
40
|
},
|
|
31
41
|
"homepage": "https://github.com/unchainedshop/unchained#readme",
|
|
32
42
|
"peerDependencies": {
|
|
33
|
-
"@apollo/server": "^4.
|
|
43
|
+
"@apollo/server": "^4.2.2",
|
|
34
44
|
"cookie": "^0.5.0",
|
|
35
45
|
"graphql": "^16.6.0"
|
|
36
46
|
},
|
|
47
|
+
"optionalDependencies": {
|
|
48
|
+
"express": "^4.18.2"
|
|
49
|
+
},
|
|
37
50
|
"dependencies": {
|
|
38
51
|
"@metamask/eth-sig-util": "^5.0.2",
|
|
39
|
-
"@unchainedshop/core": "^2.0.0-
|
|
40
|
-
"@unchainedshop/events": "^2.0.0-
|
|
41
|
-
"@unchainedshop/logger": "^2.0.0-
|
|
42
|
-
"@unchainedshop/roles": "^2.0.0-
|
|
43
|
-
"@unchainedshop/utils": "^2.0.0-
|
|
52
|
+
"@unchainedshop/core": "^2.0.0-beta9",
|
|
53
|
+
"@unchainedshop/events": "^2.0.0-beta9",
|
|
54
|
+
"@unchainedshop/logger": "^2.0.0-beta9",
|
|
55
|
+
"@unchainedshop/roles": "^2.0.0-beta9",
|
|
56
|
+
"@unchainedshop/utils": "^2.0.0-beta9",
|
|
44
57
|
"accounting": "0.4.1",
|
|
45
58
|
"dataloader": "^2.1.0",
|
|
46
59
|
"graphql-scalars": "^1.20.1",
|
|
@@ -52,11 +65,12 @@
|
|
|
52
65
|
"devDependencies": {
|
|
53
66
|
"@types/graphql-upload": "^8.0.12",
|
|
54
67
|
"@types/locale": "^0.1.1",
|
|
55
|
-
"@types/node": "^18.11.
|
|
56
|
-
"@unchainedshop/types": "^2.0.0-
|
|
68
|
+
"@types/node": "^18.11.12",
|
|
69
|
+
"@unchainedshop/types": "^2.0.0-beta9",
|
|
70
|
+
"express": "^4.18.2",
|
|
57
71
|
"graphql": "^16.6.0",
|
|
58
72
|
"jest": "^29.3.1",
|
|
59
73
|
"ts-jest": "^29.0.3",
|
|
60
|
-
"typescript": "^4.
|
|
74
|
+
"typescript": "^4.9.4"
|
|
61
75
|
}
|
|
62
76
|
}
|
package/src/acl.ts
CHANGED
|
@@ -10,13 +10,13 @@ const defaultOptions = {
|
|
|
10
10
|
const emptyObject = {};
|
|
11
11
|
const emptyArray: CheckPermissionArgs = [];
|
|
12
12
|
|
|
13
|
-
const ensureActionExists = (action, userOptions) => {
|
|
13
|
+
export const ensureActionExists = (action, userOptions) => {
|
|
14
14
|
if (!action) {
|
|
15
15
|
throw new PermissionSystemError({ userOptions });
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
const ensureIsFunction = (fn, action, options, key) => {
|
|
19
|
+
export const ensureIsFunction = (fn, action, options, key) => {
|
|
20
20
|
if (typeof fn !== 'function') {
|
|
21
21
|
throw new PermissionSystemError({
|
|
22
22
|
action,
|
package/src/api-index.ts
CHANGED
|
@@ -2,19 +2,18 @@ import { UnchainedServerOptions } from '@unchainedshop/types/api';
|
|
|
2
2
|
import type { ApolloServer } from '@apollo/server';
|
|
3
3
|
import fs from 'fs';
|
|
4
4
|
import path from 'path';
|
|
5
|
-
import createBulkImportServer from './createBulkImportServer';
|
|
6
5
|
import createGraphQLServer from './createGraphQLServer';
|
|
7
|
-
import { createContextResolver,
|
|
8
|
-
import createERCMetadataServer from './createERCMetadataServer';
|
|
6
|
+
import { createContextResolver, setCurrentContextResolver, getCurrentContextResolver } from './context';
|
|
9
7
|
|
|
10
8
|
export * from './context';
|
|
11
9
|
export * as acl from './acl';
|
|
12
10
|
export * as errors from './errors';
|
|
11
|
+
export * as express from './express';
|
|
13
12
|
export { hashPassword } from './hashPassword';
|
|
14
13
|
export * as roles from './roles';
|
|
15
14
|
export { createContextResolver, getCurrentContextResolver, setCurrentContextResolver };
|
|
16
15
|
|
|
17
|
-
const loadJSON = (filename) => {
|
|
16
|
+
export const loadJSON = (filename) => {
|
|
18
17
|
try {
|
|
19
18
|
const base = typeof __filename !== 'undefined' && __filename;
|
|
20
19
|
if (!base)
|
|
@@ -32,20 +31,8 @@ const packageJson = loadJSON('../package.json');
|
|
|
32
31
|
|
|
33
32
|
const UNCHAINED_API_VERSION = process.env.UNCHAINED_API_VERSION || packageJson?.version || '1.2.x';
|
|
34
33
|
|
|
35
|
-
export const startAPIServer = async (
|
|
36
|
-
|
|
37
|
-
): Promise<{
|
|
38
|
-
apolloGraphQLServer: ApolloServer;
|
|
39
|
-
bulkImportServer: any;
|
|
40
|
-
ercMetadataServer: any;
|
|
41
|
-
}> => {
|
|
42
|
-
const {
|
|
43
|
-
unchainedAPI,
|
|
44
|
-
roles,
|
|
45
|
-
expressApp,
|
|
46
|
-
context: customContext,
|
|
47
|
-
...apolloServerOptions
|
|
48
|
-
} = options || {};
|
|
34
|
+
export const startAPIServer = async (options: UnchainedServerOptions): Promise<ApolloServer> => {
|
|
35
|
+
const { unchainedAPI, roles, context: customContext, ...apolloServerOptions } = options || {};
|
|
49
36
|
|
|
50
37
|
const contextResolver = createContextResolver(unchainedAPI, roles, UNCHAINED_API_VERSION);
|
|
51
38
|
|
|
@@ -57,13 +44,5 @@ export const startAPIServer = async (
|
|
|
57
44
|
: contextResolver,
|
|
58
45
|
);
|
|
59
46
|
|
|
60
|
-
|
|
61
|
-
const bulkImportServer = createBulkImportServer(expressApp);
|
|
62
|
-
const ercMetadataServer = createERCMetadataServer(expressApp);
|
|
63
|
-
|
|
64
|
-
return {
|
|
65
|
-
apolloGraphQLServer,
|
|
66
|
-
bulkImportServer,
|
|
67
|
-
ercMetadataServer,
|
|
68
|
-
};
|
|
47
|
+
return createGraphQLServer(apolloServerOptions);
|
|
69
48
|
};
|
package/src/context.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { UnchainedContextResolver } from '@unchainedshop/types/api';
|
|
2
2
|
import { UnchainedCore } from '@unchainedshop/types/core';
|
|
3
|
-
import { IncomingMessage, OutgoingMessage } from 'http';
|
|
4
3
|
import instantiateLoaders from './loaders';
|
|
5
4
|
import { getLocaleContext } from './locale-context';
|
|
6
5
|
import { getUserContext } from './user-context';
|
|
@@ -32,20 +31,3 @@ export const createContextResolver =
|
|
|
32
31
|
version,
|
|
33
32
|
};
|
|
34
33
|
};
|
|
35
|
-
|
|
36
|
-
export const useMiddlewareWithCurrentContext = (expressApp, path, ...middleware) => {
|
|
37
|
-
const addContext = async function middlewareWithContext(
|
|
38
|
-
req: IncomingMessage & { unchainedContext?: UnchainedCore },
|
|
39
|
-
res: OutgoingMessage,
|
|
40
|
-
next,
|
|
41
|
-
) {
|
|
42
|
-
try {
|
|
43
|
-
req.unchainedContext = await context({ req, res });
|
|
44
|
-
next();
|
|
45
|
-
} catch (error) {
|
|
46
|
-
next(error);
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
expressApp.use(path, addContext, ...middleware);
|
|
51
|
-
};
|
|
@@ -1,66 +1,47 @@
|
|
|
1
1
|
import { ApolloServer } from '@apollo/server';
|
|
2
|
-
import { expressMiddleware } from '@apollo/server/express4';
|
|
3
|
-
import { GraphQLError } from 'graphql';
|
|
4
|
-
import graphqlUploadExpress from 'graphql-upload/graphqlUploadExpress.mjs';
|
|
5
2
|
import { log, LogLevel } from '@unchainedshop/logger';
|
|
6
|
-
import
|
|
7
|
-
import bodyParser from 'body-parser';
|
|
3
|
+
import { GraphQLFormattedError } from 'graphql';
|
|
8
4
|
import typeDefs from './schema';
|
|
9
5
|
import resolvers from './resolvers';
|
|
10
|
-
import { getCurrentContextResolver } from './context';
|
|
11
6
|
|
|
12
7
|
const { APOLLO_ENGINE_KEY } = process.env;
|
|
13
8
|
|
|
14
|
-
const logGraphQLServerError = (error) => {
|
|
9
|
+
const logGraphQLServerError = (error: GraphQLFormattedError) => {
|
|
15
10
|
try {
|
|
16
11
|
const {
|
|
17
12
|
message,
|
|
18
|
-
extensions: {
|
|
19
|
-
exception: { stacktrace, ...parameters },
|
|
20
|
-
...extensions
|
|
21
|
-
},
|
|
13
|
+
extensions: { stacktrace, ...parameters },
|
|
22
14
|
...rest
|
|
23
15
|
} = error;
|
|
24
|
-
log(`${message} ${
|
|
16
|
+
log(`${message} ${parameters && parameters.code}`, {
|
|
25
17
|
level: LogLevel.Error,
|
|
26
|
-
...
|
|
18
|
+
...parameters,
|
|
27
19
|
...rest,
|
|
28
20
|
});
|
|
29
|
-
|
|
21
|
+
if (stacktrace && process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test') {
|
|
22
|
+
const nativeError = new Error(message);
|
|
23
|
+
nativeError.stack = (stacktrace as string[]).join('\n');
|
|
24
|
+
nativeError.name = parameters.code as string;
|
|
25
|
+
// eslint-disable-next-line
|
|
26
|
+
console.error(nativeError);
|
|
27
|
+
}
|
|
30
28
|
} catch (e) {} // eslint-disable-line
|
|
31
29
|
};
|
|
32
30
|
|
|
33
|
-
export default async (
|
|
31
|
+
export default async (options) => {
|
|
34
32
|
const {
|
|
35
|
-
corsOrigins = null, // no cookie handling
|
|
36
33
|
typeDefs: additionalTypeDefs = [],
|
|
37
34
|
resolvers: additionalResolvers = [],
|
|
38
35
|
engine = {},
|
|
39
36
|
...apolloServerOptions
|
|
40
37
|
} = options || {};
|
|
41
38
|
|
|
42
|
-
const context = getCurrentContextResolver();
|
|
43
|
-
|
|
44
39
|
const server = new ApolloServer({
|
|
45
40
|
typeDefs: [...typeDefs, ...additionalTypeDefs],
|
|
46
41
|
resolvers: [resolvers, ...additionalResolvers],
|
|
47
42
|
formatError: (error) => {
|
|
48
43
|
logGraphQLServerError(error);
|
|
49
|
-
|
|
50
|
-
message,
|
|
51
|
-
path,
|
|
52
|
-
extensions: { exception, code, ...extensions }, // eslint-disable-line
|
|
53
|
-
} = error;
|
|
54
|
-
const apolloError = new GraphQLError(message, {
|
|
55
|
-
extensions: {
|
|
56
|
-
code,
|
|
57
|
-
...extensions,
|
|
58
|
-
},
|
|
59
|
-
});
|
|
60
|
-
// eslint-disable-next-line
|
|
61
|
-
// @ts-ignore
|
|
62
|
-
apolloError.path = path;
|
|
63
|
-
return apolloError;
|
|
44
|
+
return error;
|
|
64
45
|
},
|
|
65
46
|
apollo: APOLLO_ENGINE_KEY
|
|
66
47
|
? {
|
|
@@ -74,40 +55,5 @@ export default async (expressApp, options) => {
|
|
|
74
55
|
|
|
75
56
|
await server.start();
|
|
76
57
|
|
|
77
|
-
const originFn =
|
|
78
|
-
corsOrigins && Array.isArray(corsOrigins)
|
|
79
|
-
? (origin, callback) => {
|
|
80
|
-
if (corsOrigins.length === 0 || !origin) {
|
|
81
|
-
callback(null, true);
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
if (corsOrigins.indexOf(origin) !== -1) {
|
|
85
|
-
callback(null, true);
|
|
86
|
-
} else {
|
|
87
|
-
callback(new Error('Not allowed by CORS'));
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
: corsOrigins;
|
|
91
|
-
|
|
92
|
-
expressApp.use(
|
|
93
|
-
'/graphql',
|
|
94
|
-
cors(
|
|
95
|
-
!originFn
|
|
96
|
-
? undefined
|
|
97
|
-
: {
|
|
98
|
-
origin: originFn,
|
|
99
|
-
credentials: true,
|
|
100
|
-
},
|
|
101
|
-
),
|
|
102
|
-
bodyParser.json(),
|
|
103
|
-
graphqlUploadExpress(),
|
|
104
|
-
expressMiddleware(server, {
|
|
105
|
-
context,
|
|
106
|
-
}),
|
|
107
|
-
);
|
|
108
|
-
|
|
109
|
-
// expressApp.use(handleUploads({ maxFileSize: 10000000, maxFiles: 10 }));
|
|
110
|
-
// expressApp.use(middleware);
|
|
111
|
-
|
|
112
58
|
return server;
|
|
113
59
|
};
|
package/src/errors.ts
CHANGED
|
@@ -202,3 +202,88 @@ export const TokenWrongStatusError = createError(
|
|
|
202
202
|
'TokenWrongStatusError',
|
|
203
203
|
'The current status of the token does not allow this operation',
|
|
204
204
|
);
|
|
205
|
+
|
|
206
|
+
export const CyclicAssortmentLinkNotSupportedError = createError(
|
|
207
|
+
'CyclicAssortmentLinkNotSupported',
|
|
208
|
+
'Cyclic assortment link detected, make sure child assortment is not assigned as a parent on the assortment graph',
|
|
209
|
+
);
|
|
210
|
+
|
|
211
|
+
export const EmailAlreadyExistsError = createError(
|
|
212
|
+
'EmailAlreadyExists',
|
|
213
|
+
'Email already exist in the database',
|
|
214
|
+
);
|
|
215
|
+
|
|
216
|
+
export const UsernameAlreadyExistsError = createError(
|
|
217
|
+
'UsernameAlreadyExists',
|
|
218
|
+
'Username already exist in the database',
|
|
219
|
+
);
|
|
220
|
+
|
|
221
|
+
export const UsernameOrEmailRequiredError = createError(
|
|
222
|
+
'UsernameOrEmailRequired',
|
|
223
|
+
'No username or email is provided.',
|
|
224
|
+
);
|
|
225
|
+
|
|
226
|
+
export const TwoFactorCodeDidNotMatchError = createError(
|
|
227
|
+
'TwoFactorCodeDidNotMatch',
|
|
228
|
+
"2FA code didn't match",
|
|
229
|
+
);
|
|
230
|
+
|
|
231
|
+
export const TwoFactorCodeRequiredError = createError('TwoFactorCodeRequired', '2FA code required');
|
|
232
|
+
|
|
233
|
+
export const TwoFactorAlreadySetError = createError('TwoFactorAlreadySet', '2FA already set for user');
|
|
234
|
+
|
|
235
|
+
export const TwoFactorNotSetError = createError('TwoFactorNotSet', '2FA not set for user');
|
|
236
|
+
|
|
237
|
+
export const InvalidCredentialsError = createError(
|
|
238
|
+
'InvalidCredentials',
|
|
239
|
+
'Incorrect credential provided',
|
|
240
|
+
);
|
|
241
|
+
|
|
242
|
+
export const InvalidResetTokenError = createError('InvalidResetTokenError', 'Token validation failed');
|
|
243
|
+
|
|
244
|
+
export const NoEmailSetError = createError('NoEmailSet', 'User has no email set');
|
|
245
|
+
|
|
246
|
+
export const ResetPasswordLinkExpiredError = createError(
|
|
247
|
+
'ResetPasswordLinkExpired',
|
|
248
|
+
'Token does not exist or is expired',
|
|
249
|
+
);
|
|
250
|
+
|
|
251
|
+
export const ResetPasswordLinkUnknownAddressError = createError(
|
|
252
|
+
'ResetPasswordLinkUnknownAddress',
|
|
253
|
+
'Valid token but no email address found for the entry',
|
|
254
|
+
);
|
|
255
|
+
|
|
256
|
+
export const AuthenticationFailedError = createError(
|
|
257
|
+
'AuthenticationFailed',
|
|
258
|
+
'Failed to authenticate the user',
|
|
259
|
+
);
|
|
260
|
+
|
|
261
|
+
export const UserDeactivatedError = createError(
|
|
262
|
+
'UserDeactivatedError',
|
|
263
|
+
'User is deactivated, so not allowed to login',
|
|
264
|
+
);
|
|
265
|
+
|
|
266
|
+
export const AuthOperationFailedError = createError(
|
|
267
|
+
'AuthOperationFailed',
|
|
268
|
+
'Operation failed, please make sure you have provided all required parameters',
|
|
269
|
+
);
|
|
270
|
+
|
|
271
|
+
export const ProductLinkedToActiveVariationError = createError(
|
|
272
|
+
'ProductLinkedToActiveVariation',
|
|
273
|
+
'Product is part of a active variation, remove it from any active/draft variation before deleting',
|
|
274
|
+
);
|
|
275
|
+
|
|
276
|
+
export const ProductLinkedToActiveBundleError = createError(
|
|
277
|
+
'ProductLinkedToActiveBundle',
|
|
278
|
+
'Product is part of a active/draft bundle item, remove it from any active/draft bundle item before deleting',
|
|
279
|
+
);
|
|
280
|
+
|
|
281
|
+
export const ProductLinkedToEnrollmentError = createError(
|
|
282
|
+
'ProductLinkedToEnrollment',
|
|
283
|
+
'Product is part of a active/paused subscriptions item, remove it from any active/paused subscriptions item before deleting',
|
|
284
|
+
);
|
|
285
|
+
|
|
286
|
+
export const ProductLinkedToQuotationError = createError(
|
|
287
|
+
'ProductLinkedToQuotation',
|
|
288
|
+
'Product is part of a requested/proposed quotations item, remove it from any requested/proposed quotations item before deleting',
|
|
289
|
+
);
|