@unchainedshop/core 4.3.6 → 4.5.0
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 +614 -2
- package/lib/bulk-importer/createBulkImporter.d.ts +5 -6
- package/lib/bulk-importer/createBulkImporter.js +6 -5
- package/lib/bulk-importer/handlers/assortment/create.d.ts +2 -3
- package/lib/bulk-importer/handlers/assortment/create.js +6 -8
- package/lib/bulk-importer/handlers/assortment/index.d.ts +3 -4
- package/lib/bulk-importer/handlers/assortment/index.js +3 -4
- package/lib/bulk-importer/handlers/assortment/remove.d.ts +1 -2
- package/lib/bulk-importer/handlers/assortment/remove.js +0 -1
- package/lib/bulk-importer/handlers/assortment/update.d.ts +2 -3
- package/lib/bulk-importer/handlers/assortment/update.js +7 -9
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentChildren.d.ts +1 -2
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentChildren.js +1 -2
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentFilters.d.ts +1 -2
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentFilters.js +1 -2
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentProducts.d.ts +1 -2
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentProducts.js +1 -2
- package/lib/bulk-importer/handlers/assortment/upsertMedia.d.ts +2 -3
- package/lib/bulk-importer/handlers/assortment/upsertMedia.js +2 -4
- package/lib/bulk-importer/handlers/filter/create.d.ts +7 -3
- package/lib/bulk-importer/handlers/filter/create.js +3 -4
- package/lib/bulk-importer/handlers/filter/index.d.ts +3 -4
- package/lib/bulk-importer/handlers/filter/index.js +3 -4
- package/lib/bulk-importer/handlers/filter/remove.d.ts +1 -2
- package/lib/bulk-importer/handlers/filter/remove.js +0 -1
- package/lib/bulk-importer/handlers/filter/update.d.ts +1 -2
- package/lib/bulk-importer/handlers/filter/update.js +2 -4
- package/lib/bulk-importer/handlers/product/create.d.ts +23 -6
- package/lib/bulk-importer/handlers/product/create.js +10 -12
- package/lib/bulk-importer/handlers/product/index.d.ts +3 -4
- package/lib/bulk-importer/handlers/product/index.js +3 -4
- package/lib/bulk-importer/handlers/product/remove.d.ts +2 -3
- package/lib/bulk-importer/handlers/product/remove.js +0 -1
- package/lib/bulk-importer/handlers/product/update.d.ts +2 -3
- package/lib/bulk-importer/handlers/product/update.js +8 -11
- package/lib/bulk-importer/handlers/product/upsertMedia.d.ts +2 -3
- package/lib/bulk-importer/handlers/product/upsertMedia.js +3 -5
- package/lib/bulk-importer/handlers/product/upsertVariations.d.ts +1 -2
- package/lib/bulk-importer/handlers/product/upsertVariations.js +2 -5
- package/lib/bulk-importer/handlers/utils/convertTagsToLowerCase.d.ts +0 -1
- package/lib/bulk-importer/handlers/utils/convertTagsToLowerCase.js +0 -1
- package/lib/bulk-importer/index.d.ts +2 -3
- package/lib/bulk-importer/index.js +2 -3
- package/lib/bulk-importer/upsertAsset.d.ts +3 -4
- package/lib/bulk-importer/upsertAsset.js +1 -3
- package/lib/core-index.d.ts +10 -10
- package/lib/core-index.js +10 -10
- package/lib/directors/BaseDiscountAdapter.d.ts +5 -6
- package/lib/directors/BaseDiscountAdapter.js +0 -17
- package/lib/directors/BaseDiscountDirector.d.ts +3 -4
- package/lib/directors/BaseDiscountDirector.js +0 -1
- package/lib/directors/BasePricingAdapter.d.ts +4 -5
- package/lib/directors/BasePricingAdapter.js +1 -2
- package/lib/directors/BasePricingDirector.d.ts +4 -5
- package/lib/directors/BasePricingDirector.js +1 -6
- package/lib/directors/BasePricingSheet.d.ts +1 -2
- package/lib/directors/BasePricingSheet.js +0 -4
- package/lib/directors/BaseWorker.d.ts +1 -2
- package/lib/directors/BaseWorker.js +4 -7
- package/lib/directors/DeliveryAdapter.d.ts +8 -8
- package/lib/directors/DeliveryAdapter.js +6 -15
- package/lib/directors/DeliveryDirector.d.ts +5 -6
- package/lib/directors/DeliveryDirector.js +1 -2
- package/lib/directors/DeliveryPricingAdapter.d.ts +7 -8
- package/lib/directors/DeliveryPricingAdapter.js +2 -3
- package/lib/directors/DeliveryPricingDirector.d.ts +4 -5
- package/lib/directors/DeliveryPricingDirector.js +2 -2
- package/lib/directors/DeliveryPricingSheet.d.ts +9 -9
- package/lib/directors/DeliveryPricingSheet.js +7 -9
- package/lib/directors/EnrollmentAdapter.d.ts +2 -3
- package/lib/directors/EnrollmentAdapter.js +0 -1
- package/lib/directors/EnrollmentDirector.d.ts +3 -4
- package/lib/directors/EnrollmentDirector.js +0 -1
- package/lib/directors/EventListenerWorker.d.ts +1 -2
- package/lib/directors/EventListenerWorker.js +2 -11
- package/lib/directors/FailedRescheduler.d.ts +1 -2
- package/lib/directors/FailedRescheduler.js +0 -3
- package/lib/directors/FilterAdapter.d.ts +5 -6
- package/lib/directors/FilterAdapter.js +1 -5
- package/lib/directors/FilterDirector.d.ts +4 -5
- package/lib/directors/FilterDirector.js +1 -10
- package/lib/directors/IntervalWorker.d.ts +3 -4
- package/lib/directors/IntervalWorker.js +6 -8
- package/lib/directors/MessagingDirector.d.ts +0 -1
- package/lib/directors/MessagingDirector.js +0 -1
- package/lib/directors/OrderDiscountAdapter.d.ts +1 -2
- package/lib/directors/OrderDiscountAdapter.js +1 -2
- package/lib/directors/OrderDiscountConfiguration.d.ts +0 -1
- package/lib/directors/OrderDiscountConfiguration.js +0 -1
- package/lib/directors/OrderDiscountDirector.d.ts +2 -3
- package/lib/directors/OrderDiscountDirector.js +1 -2
- package/lib/directors/OrderPricingAdapter.d.ts +4 -5
- package/lib/directors/OrderPricingAdapter.js +1 -2
- package/lib/directors/OrderPricingDirector.d.ts +2 -3
- package/lib/directors/OrderPricingDirector.js +1 -2
- package/lib/directors/OrderPricingSheet.d.ts +10 -10
- package/lib/directors/OrderPricingSheet.js +8 -12
- package/lib/directors/PaymentAdapter.d.ts +8 -8
- package/lib/directors/PaymentAdapter.js +6 -12
- package/lib/directors/PaymentDirector.d.ts +4 -5
- package/lib/directors/PaymentDirector.js +1 -2
- package/lib/directors/PaymentPricingAdapter.d.ts +8 -9
- package/lib/directors/PaymentPricingAdapter.js +3 -4
- package/lib/directors/PaymentPricingDirector.d.ts +5 -6
- package/lib/directors/PaymentPricingDirector.js +2 -3
- package/lib/directors/PaymentPricingSheet.d.ts +8 -8
- package/lib/directors/PaymentPricingSheet.js +7 -9
- package/lib/directors/ProductDiscountAdapter.d.ts +1 -2
- package/lib/directors/ProductDiscountAdapter.js +1 -2
- package/lib/directors/ProductDiscountConfiguration.d.ts +1 -2
- package/lib/directors/ProductDiscountConfiguration.js +0 -1
- package/lib/directors/ProductDiscountDirector.d.ts +2 -3
- package/lib/directors/ProductDiscountDirector.js +1 -2
- package/lib/directors/ProductPricingAdapter.d.ts +5 -6
- package/lib/directors/ProductPricingAdapter.js +1 -2
- package/lib/directors/ProductPricingDirector.d.ts +4 -5
- package/lib/directors/ProductPricingDirector.js +1 -2
- package/lib/directors/ProductPricingSheet.d.ts +8 -8
- package/lib/directors/ProductPricingSheet.js +6 -8
- package/lib/directors/QuotationAdapter.d.ts +9 -9
- package/lib/directors/QuotationAdapter.js +6 -8
- package/lib/directors/QuotationDirector.d.ts +2 -3
- package/lib/directors/QuotationDirector.js +1 -2
- package/lib/directors/WarehousingAdapter.d.ts +12 -12
- package/lib/directors/WarehousingAdapter.js +6 -8
- package/lib/directors/WarehousingDirector.d.ts +4 -5
- package/lib/directors/WarehousingDirector.js +1 -4
- package/lib/directors/WorkerAdapter.d.ts +5 -6
- package/lib/directors/WorkerAdapter.js +0 -1
- package/lib/directors/WorkerDirector.d.ts +5 -6
- package/lib/directors/WorkerDirector.js +0 -3
- package/lib/directors/index.d.ts +42 -43
- package/lib/directors/index.js +42 -43
- package/lib/factory/index.d.ts +9 -10
- package/lib/factory/index.js +9 -10
- package/lib/factory/registerAssortmentSearchFilter.d.ts +1 -2
- package/lib/factory/registerAssortmentSearchFilter.js +1 -2
- package/lib/factory/registerInvoicePayment.d.ts +2 -3
- package/lib/factory/registerInvoicePayment.js +1 -2
- package/lib/factory/registerPhysicalWarehousing.d.ts +2 -3
- package/lib/factory/registerPhysicalWarehousing.js +1 -2
- package/lib/factory/registerPickUpDelivery.d.ts +3 -4
- package/lib/factory/registerPickUpDelivery.js +1 -2
- package/lib/factory/registerProductDiscoverabilityFilter.d.ts +0 -1
- package/lib/factory/registerProductDiscoverabilityFilter.js +1 -2
- package/lib/factory/registerProductSearchFilter.d.ts +1 -2
- package/lib/factory/registerProductSearchFilter.js +1 -2
- package/lib/factory/registerShippingDelivery.d.ts +3 -4
- package/lib/factory/registerShippingDelivery.js +1 -2
- package/lib/factory/registerVirtualWarehousing.d.ts +2 -3
- package/lib/factory/registerVirtualWarehousing.js +1 -2
- package/lib/factory/registerWorker.d.ts +0 -1
- package/lib/factory/registerWorker.js +1 -2
- package/lib/modules.d.ts +18 -19
- package/lib/modules.js +5 -5
- package/lib/services/activateEnrollment.d.ts +2 -3
- package/lib/services/activateEnrollment.js +2 -3
- package/lib/services/addMessage.d.ts +2 -3
- package/lib/services/addMessage.js +2 -3
- package/lib/services/addMultipleCartProducts.d.ts +18 -0
- package/lib/services/addMultipleCartProducts.js +25 -0
- package/lib/services/calculateDiscountTotal.d.ts +2 -3
- package/lib/services/calculateDiscountTotal.js +1 -6
- package/lib/services/checkoutOrder.d.ts +1 -2
- package/lib/services/checkoutOrder.js +4 -6
- package/lib/services/confirmOrder.d.ts +2 -3
- package/lib/services/confirmOrder.js +1 -2
- package/lib/services/createDownloadStream.d.ts +2 -3
- package/lib/services/createDownloadStream.js +0 -1
- package/lib/services/createEnrollmentFromCheckout.d.ts +4 -5
- package/lib/services/createEnrollmentFromCheckout.js +2 -3
- package/lib/services/createFileDownloadURL.d.ts +7 -0
- package/lib/services/createFileDownloadURL.js +10 -0
- package/lib/services/createManualOrderDiscount.d.ts +2 -3
- package/lib/services/createManualOrderDiscount.js +1 -3
- package/lib/services/createSignedURL.d.ts +2 -3
- package/lib/services/createSignedURL.js +0 -1
- package/lib/services/deleteUser.d.ts +1 -2
- package/lib/services/deleteUser.js +0 -1
- package/lib/services/discountedEntities.d.ts +3 -4
- package/lib/services/discountedEntities.js +1 -7
- package/lib/services/ercMetadata.d.ts +3 -4
- package/lib/services/ercMetadata.js +1 -2
- package/lib/services/findOrInitCart.d.ts +2 -3
- package/lib/services/findOrInitCart.js +1 -2
- package/lib/services/findProductSiblings.d.ts +9 -0
- package/lib/services/findProductSiblings.js +18 -0
- package/lib/services/fullfillQuotation.d.ts +2 -3
- package/lib/services/fullfillQuotation.js +1 -2
- package/lib/services/generateOrderFromEnrollment.d.ts +2 -3
- package/lib/services/generateOrderFromEnrollment.js +2 -3
- package/lib/services/index.d.ts +74 -49
- package/lib/services/index.js +73 -51
- package/lib/services/initCartProviders.d.ts +2 -3
- package/lib/services/initCartProviders.js +2 -5
- package/lib/services/initializeEnrollment.d.ts +2 -3
- package/lib/services/initializeEnrollment.js +3 -4
- package/lib/services/invalidateFilterCache.d.ts +1 -2
- package/lib/services/invalidateFilterCache.js +1 -2
- package/lib/services/isTokenInvalidateable.d.ts +5 -0
- package/lib/services/isTokenInvalidateable.js +15 -0
- package/lib/services/linkFileService.d.ts +1 -2
- package/lib/services/linkFileService.js +0 -1
- package/lib/services/loadFilterOptions.d.ts +2 -3
- package/lib/services/loadFilterOptions.js +1 -2
- package/lib/services/loadFilters.d.ts +2 -3
- package/lib/services/loadFilters.js +1 -2
- package/lib/services/migrateBookmarks.d.ts +1 -2
- package/lib/services/migrateBookmarks.js +0 -2
- package/lib/services/migrateOrderCart.d.ts +1 -2
- package/lib/services/migrateOrderCart.js +1 -7
- package/lib/services/migrateUserData.d.ts +0 -1
- package/lib/services/migrateUserData.js +2 -3
- package/lib/services/nextUserCart.d.ts +2 -3
- package/lib/services/nextUserCart.js +1 -2
- package/lib/services/processEnrollment.d.ts +2 -3
- package/lib/services/processEnrollment.js +1 -5
- package/lib/services/processOrder.d.ts +2 -3
- package/lib/services/processOrder.js +7 -27
- package/lib/services/processQuotation.d.ts +2 -3
- package/lib/services/processQuotation.js +2 -3
- package/lib/services/proposeQuotation.d.ts +2 -3
- package/lib/services/proposeQuotation.js +1 -2
- package/lib/services/registerPaymentCredentials.d.ts +2 -3
- package/lib/services/registerPaymentCredentials.js +1 -2
- package/lib/services/rejectOrder.d.ts +2 -3
- package/lib/services/rejectOrder.js +1 -2
- package/lib/services/rejectQuotation.d.ts +2 -3
- package/lib/services/rejectQuotation.js +1 -2
- package/lib/services/removeCartDiscount.d.ts +10 -0
- package/lib/services/removeCartDiscount.js +14 -0
- package/lib/services/removeFiles.d.ts +1 -2
- package/lib/services/removeFiles.js +1 -3
- package/lib/services/removeFilter.d.ts +5 -0
- package/lib/services/removeFilter.js +5 -0
- package/lib/services/removeProduct.d.ts +1 -2
- package/lib/services/removeProduct.js +1 -4
- package/lib/services/resolveOrderItemDispatches.d.ts +19 -0
- package/lib/services/resolveOrderItemDispatches.js +38 -0
- package/lib/services/resolveTokenStatus.d.ts +5 -0
- package/lib/services/resolveTokenStatus.js +15 -0
- package/lib/services/searchAssortments.d.ts +3 -4
- package/lib/services/searchAssortments.js +1 -2
- package/lib/services/searchProducts.d.ts +3 -4
- package/lib/services/searchProducts.js +1 -4
- package/lib/services/simulateConfigurablePriceRange.d.ts +13 -0
- package/lib/services/simulateConfigurablePriceRange.js +39 -0
- package/lib/services/simulateDeliveryPricing.d.ts +21 -0
- package/lib/services/simulateDeliveryPricing.js +23 -0
- package/lib/services/simulatePaymentPricing.d.ts +21 -0
- package/lib/services/simulatePaymentPricing.js +23 -0
- package/lib/services/simulateProductDispatching.d.ts +5 -6
- package/lib/services/simulateProductDispatching.js +2 -3
- package/lib/services/simulateProductInventory.d.ts +4 -5
- package/lib/services/simulateProductInventory.js +2 -3
- package/lib/services/simulateProductPricing.d.ts +5 -6
- package/lib/services/simulateProductPricing.js +1 -2
- package/lib/services/supportedDeliveryProviders.d.ts +3 -4
- package/lib/services/supportedDeliveryProviders.js +1 -2
- package/lib/services/supportedPaymentProviders.d.ts +3 -4
- package/lib/services/supportedPaymentProviders.js +1 -2
- package/lib/services/supportedWarehousingProviders.d.ts +3 -4
- package/lib/services/supportedWarehousingProviders.js +1 -2
- package/lib/services/terminateEnrollment.d.ts +1 -2
- package/lib/services/terminateEnrollment.js +2 -3
- package/lib/services/updateCalculation.d.ts +2 -3
- package/lib/services/updateCalculation.js +3 -20
- package/lib/services/updateScheduling.d.ts +2 -3
- package/lib/services/updateScheduling.js +2 -4
- package/lib/services/updateUserAvatarAfterUpload.d.ts +2 -3
- package/lib/services/updateUserAvatarAfterUpload.js +3 -5
- package/lib/services/uploadFileFromStream.d.ts +2 -3
- package/lib/services/uploadFileFromStream.js +0 -1
- package/lib/services/uploadFileFromURL.d.ts +1 -2
- package/lib/services/uploadFileFromURL.js +0 -1
- package/lib/services/validateOrder.d.ts +2 -3
- package/lib/services/validateOrder.js +0 -1
- package/lib/services/verifyQuotation.d.ts +2 -3
- package/lib/services/verifyQuotation.js +1 -2
- package/lib/utils/schedule.d.ts +22 -0
- package/lib/utils/schedule.js +148 -0
- package/package.json +28 -28
- package/lib/bulk-importer/createBulkImporter.d.ts.map +0 -1
- package/lib/bulk-importer/createBulkImporter.js.map +0 -1
- package/lib/bulk-importer/handlers/assortment/create.d.ts.map +0 -1
- package/lib/bulk-importer/handlers/assortment/create.js.map +0 -1
- package/lib/bulk-importer/handlers/assortment/index.d.ts.map +0 -1
- package/lib/bulk-importer/handlers/assortment/index.js.map +0 -1
- package/lib/bulk-importer/handlers/assortment/remove.d.ts.map +0 -1
- package/lib/bulk-importer/handlers/assortment/remove.js.map +0 -1
- package/lib/bulk-importer/handlers/assortment/update.d.ts.map +0 -1
- package/lib/bulk-importer/handlers/assortment/update.js.map +0 -1
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentChildren.d.ts.map +0 -1
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentChildren.js.map +0 -1
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentFilters.d.ts.map +0 -1
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentFilters.js.map +0 -1
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentProducts.d.ts.map +0 -1
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentProducts.js.map +0 -1
- package/lib/bulk-importer/handlers/assortment/upsertMedia.d.ts.map +0 -1
- package/lib/bulk-importer/handlers/assortment/upsertMedia.js.map +0 -1
- package/lib/bulk-importer/handlers/filter/create.d.ts.map +0 -1
- package/lib/bulk-importer/handlers/filter/create.js.map +0 -1
- package/lib/bulk-importer/handlers/filter/index.d.ts.map +0 -1
- package/lib/bulk-importer/handlers/filter/index.js.map +0 -1
- package/lib/bulk-importer/handlers/filter/remove.d.ts.map +0 -1
- package/lib/bulk-importer/handlers/filter/remove.js.map +0 -1
- package/lib/bulk-importer/handlers/filter/update.d.ts.map +0 -1
- package/lib/bulk-importer/handlers/filter/update.js.map +0 -1
- package/lib/bulk-importer/handlers/product/create.d.ts.map +0 -1
- package/lib/bulk-importer/handlers/product/create.js.map +0 -1
- package/lib/bulk-importer/handlers/product/index.d.ts.map +0 -1
- package/lib/bulk-importer/handlers/product/index.js.map +0 -1
- package/lib/bulk-importer/handlers/product/remove.d.ts.map +0 -1
- package/lib/bulk-importer/handlers/product/remove.js.map +0 -1
- package/lib/bulk-importer/handlers/product/update.d.ts.map +0 -1
- package/lib/bulk-importer/handlers/product/update.js.map +0 -1
- package/lib/bulk-importer/handlers/product/upsertMedia.d.ts.map +0 -1
- package/lib/bulk-importer/handlers/product/upsertMedia.js.map +0 -1
- package/lib/bulk-importer/handlers/product/upsertVariations.d.ts.map +0 -1
- package/lib/bulk-importer/handlers/product/upsertVariations.js.map +0 -1
- package/lib/bulk-importer/handlers/utils/convertTagsToLowerCase.d.ts.map +0 -1
- package/lib/bulk-importer/handlers/utils/convertTagsToLowerCase.js.map +0 -1
- package/lib/bulk-importer/index.d.ts.map +0 -1
- package/lib/bulk-importer/index.js.map +0 -1
- package/lib/bulk-importer/upsertAsset.d.ts.map +0 -1
- package/lib/bulk-importer/upsertAsset.js.map +0 -1
- package/lib/core-index.d.ts.map +0 -1
- package/lib/core-index.js.map +0 -1
- package/lib/directors/BaseDiscountAdapter.d.ts.map +0 -1
- package/lib/directors/BaseDiscountAdapter.js.map +0 -1
- package/lib/directors/BaseDiscountDirector.d.ts.map +0 -1
- package/lib/directors/BaseDiscountDirector.js.map +0 -1
- package/lib/directors/BasePricingAdapter.d.ts.map +0 -1
- package/lib/directors/BasePricingAdapter.js.map +0 -1
- package/lib/directors/BasePricingDirector.d.ts.map +0 -1
- package/lib/directors/BasePricingDirector.js.map +0 -1
- package/lib/directors/BasePricingSheet.d.ts.map +0 -1
- package/lib/directors/BasePricingSheet.js.map +0 -1
- package/lib/directors/BaseWorker.d.ts.map +0 -1
- package/lib/directors/BaseWorker.js.map +0 -1
- package/lib/directors/DeliveryAdapter.d.ts.map +0 -1
- package/lib/directors/DeliveryAdapter.js.map +0 -1
- package/lib/directors/DeliveryDirector.d.ts.map +0 -1
- package/lib/directors/DeliveryDirector.js.map +0 -1
- package/lib/directors/DeliveryPricingAdapter.d.ts.map +0 -1
- package/lib/directors/DeliveryPricingAdapter.js.map +0 -1
- package/lib/directors/DeliveryPricingDirector.d.ts.map +0 -1
- package/lib/directors/DeliveryPricingDirector.js.map +0 -1
- package/lib/directors/DeliveryPricingSheet.d.ts.map +0 -1
- package/lib/directors/DeliveryPricingSheet.js.map +0 -1
- package/lib/directors/EnrollmentAdapter.d.ts.map +0 -1
- package/lib/directors/EnrollmentAdapter.js.map +0 -1
- package/lib/directors/EnrollmentDirector.d.ts.map +0 -1
- package/lib/directors/EnrollmentDirector.js.map +0 -1
- package/lib/directors/EventListenerWorker.d.ts.map +0 -1
- package/lib/directors/EventListenerWorker.js.map +0 -1
- package/lib/directors/FailedRescheduler.d.ts.map +0 -1
- package/lib/directors/FailedRescheduler.js.map +0 -1
- package/lib/directors/FilterAdapter.d.ts.map +0 -1
- package/lib/directors/FilterAdapter.js.map +0 -1
- package/lib/directors/FilterDirector.d.ts.map +0 -1
- package/lib/directors/FilterDirector.js.map +0 -1
- package/lib/directors/IntervalWorker.d.ts.map +0 -1
- package/lib/directors/IntervalWorker.js.map +0 -1
- package/lib/directors/MessagingDirector.d.ts.map +0 -1
- package/lib/directors/MessagingDirector.js.map +0 -1
- package/lib/directors/OrderDiscountAdapter.d.ts.map +0 -1
- package/lib/directors/OrderDiscountAdapter.js.map +0 -1
- package/lib/directors/OrderDiscountConfiguration.d.ts.map +0 -1
- package/lib/directors/OrderDiscountConfiguration.js.map +0 -1
- package/lib/directors/OrderDiscountDirector.d.ts.map +0 -1
- package/lib/directors/OrderDiscountDirector.js.map +0 -1
- package/lib/directors/OrderPricingAdapter.d.ts.map +0 -1
- package/lib/directors/OrderPricingAdapter.js.map +0 -1
- package/lib/directors/OrderPricingDirector.d.ts.map +0 -1
- package/lib/directors/OrderPricingDirector.js.map +0 -1
- package/lib/directors/OrderPricingSheet.d.ts.map +0 -1
- package/lib/directors/OrderPricingSheet.js.map +0 -1
- package/lib/directors/PaymentAdapter.d.ts.map +0 -1
- package/lib/directors/PaymentAdapter.js.map +0 -1
- package/lib/directors/PaymentDirector.d.ts.map +0 -1
- package/lib/directors/PaymentDirector.js.map +0 -1
- package/lib/directors/PaymentPricingAdapter.d.ts.map +0 -1
- package/lib/directors/PaymentPricingAdapter.js.map +0 -1
- package/lib/directors/PaymentPricingDirector.d.ts.map +0 -1
- package/lib/directors/PaymentPricingDirector.js.map +0 -1
- package/lib/directors/PaymentPricingSheet.d.ts.map +0 -1
- package/lib/directors/PaymentPricingSheet.js.map +0 -1
- package/lib/directors/ProductDiscountAdapter.d.ts.map +0 -1
- package/lib/directors/ProductDiscountAdapter.js.map +0 -1
- package/lib/directors/ProductDiscountConfiguration.d.ts.map +0 -1
- package/lib/directors/ProductDiscountConfiguration.js.map +0 -1
- package/lib/directors/ProductDiscountDirector.d.ts.map +0 -1
- package/lib/directors/ProductDiscountDirector.js.map +0 -1
- package/lib/directors/ProductPricingAdapter.d.ts.map +0 -1
- package/lib/directors/ProductPricingAdapter.js.map +0 -1
- package/lib/directors/ProductPricingDirector.d.ts.map +0 -1
- package/lib/directors/ProductPricingDirector.js.map +0 -1
- package/lib/directors/ProductPricingSheet.d.ts.map +0 -1
- package/lib/directors/ProductPricingSheet.js.map +0 -1
- package/lib/directors/QuotationAdapter.d.ts.map +0 -1
- package/lib/directors/QuotationAdapter.js.map +0 -1
- package/lib/directors/QuotationDirector.d.ts.map +0 -1
- package/lib/directors/QuotationDirector.js.map +0 -1
- package/lib/directors/WarehousingAdapter.d.ts.map +0 -1
- package/lib/directors/WarehousingAdapter.js.map +0 -1
- package/lib/directors/WarehousingDirector.d.ts.map +0 -1
- package/lib/directors/WarehousingDirector.js.map +0 -1
- package/lib/directors/WorkerAdapter.d.ts.map +0 -1
- package/lib/directors/WorkerAdapter.js.map +0 -1
- package/lib/directors/WorkerDirector.d.ts.map +0 -1
- package/lib/directors/WorkerDirector.js.map +0 -1
- package/lib/directors/index.d.ts.map +0 -1
- package/lib/directors/index.js.map +0 -1
- package/lib/factory/index.d.ts.map +0 -1
- package/lib/factory/index.js.map +0 -1
- package/lib/factory/registerAssortmentSearchFilter.d.ts.map +0 -1
- package/lib/factory/registerAssortmentSearchFilter.js.map +0 -1
- package/lib/factory/registerInvoicePayment.d.ts.map +0 -1
- package/lib/factory/registerInvoicePayment.js.map +0 -1
- package/lib/factory/registerPhysicalWarehousing.d.ts.map +0 -1
- package/lib/factory/registerPhysicalWarehousing.js.map +0 -1
- package/lib/factory/registerPickUpDelivery.d.ts.map +0 -1
- package/lib/factory/registerPickUpDelivery.js.map +0 -1
- package/lib/factory/registerProductDiscoverabilityFilter.d.ts.map +0 -1
- package/lib/factory/registerProductDiscoverabilityFilter.js.map +0 -1
- package/lib/factory/registerProductSearchFilter.d.ts.map +0 -1
- package/lib/factory/registerProductSearchFilter.js.map +0 -1
- package/lib/factory/registerShippingDelivery.d.ts.map +0 -1
- package/lib/factory/registerShippingDelivery.js.map +0 -1
- package/lib/factory/registerVirtualWarehousing.d.ts.map +0 -1
- package/lib/factory/registerVirtualWarehousing.js.map +0 -1
- package/lib/factory/registerWorker.d.ts.map +0 -1
- package/lib/factory/registerWorker.js.map +0 -1
- package/lib/modules.d.ts.map +0 -1
- package/lib/modules.js.map +0 -1
- package/lib/services/activateEnrollment.d.ts.map +0 -1
- package/lib/services/activateEnrollment.js.map +0 -1
- package/lib/services/addMessage.d.ts.map +0 -1
- package/lib/services/addMessage.js.map +0 -1
- package/lib/services/calculateDiscountTotal.d.ts.map +0 -1
- package/lib/services/calculateDiscountTotal.js.map +0 -1
- package/lib/services/checkoutOrder.d.ts.map +0 -1
- package/lib/services/checkoutOrder.js.map +0 -1
- package/lib/services/confirmOrder.d.ts.map +0 -1
- package/lib/services/confirmOrder.js.map +0 -1
- package/lib/services/createDownloadStream.d.ts.map +0 -1
- package/lib/services/createDownloadStream.js.map +0 -1
- package/lib/services/createEnrollmentFromCheckout.d.ts.map +0 -1
- package/lib/services/createEnrollmentFromCheckout.js.map +0 -1
- package/lib/services/createManualOrderDiscount.d.ts.map +0 -1
- package/lib/services/createManualOrderDiscount.js.map +0 -1
- package/lib/services/createSignedURL.d.ts.map +0 -1
- package/lib/services/createSignedURL.js.map +0 -1
- package/lib/services/deleteUser.d.ts.map +0 -1
- package/lib/services/deleteUser.js.map +0 -1
- package/lib/services/discountedEntities.d.ts.map +0 -1
- package/lib/services/discountedEntities.js.map +0 -1
- package/lib/services/ercMetadata.d.ts.map +0 -1
- package/lib/services/ercMetadata.js.map +0 -1
- package/lib/services/findOrInitCart.d.ts.map +0 -1
- package/lib/services/findOrInitCart.js.map +0 -1
- package/lib/services/fullfillQuotation.d.ts.map +0 -1
- package/lib/services/fullfillQuotation.js.map +0 -1
- package/lib/services/generateOrderFromEnrollment.d.ts.map +0 -1
- package/lib/services/generateOrderFromEnrollment.js.map +0 -1
- package/lib/services/index.d.ts.map +0 -1
- package/lib/services/index.js.map +0 -1
- package/lib/services/initCartProviders.d.ts.map +0 -1
- package/lib/services/initCartProviders.js.map +0 -1
- package/lib/services/initializeEnrollment.d.ts.map +0 -1
- package/lib/services/initializeEnrollment.js.map +0 -1
- package/lib/services/invalidateFilterCache.d.ts.map +0 -1
- package/lib/services/invalidateFilterCache.js.map +0 -1
- package/lib/services/linkFileService.d.ts.map +0 -1
- package/lib/services/linkFileService.js.map +0 -1
- package/lib/services/loadFilterOptions.d.ts.map +0 -1
- package/lib/services/loadFilterOptions.js.map +0 -1
- package/lib/services/loadFilters.d.ts.map +0 -1
- package/lib/services/loadFilters.js.map +0 -1
- package/lib/services/migrateBookmarks.d.ts.map +0 -1
- package/lib/services/migrateBookmarks.js.map +0 -1
- package/lib/services/migrateOrderCart.d.ts.map +0 -1
- package/lib/services/migrateOrderCart.js.map +0 -1
- package/lib/services/migrateUserData.d.ts.map +0 -1
- package/lib/services/migrateUserData.js.map +0 -1
- package/lib/services/nextUserCart.d.ts.map +0 -1
- package/lib/services/nextUserCart.js.map +0 -1
- package/lib/services/processEnrollment.d.ts.map +0 -1
- package/lib/services/processEnrollment.js.map +0 -1
- package/lib/services/processOrder.d.ts.map +0 -1
- package/lib/services/processOrder.js.map +0 -1
- package/lib/services/processQuotation.d.ts.map +0 -1
- package/lib/services/processQuotation.js.map +0 -1
- package/lib/services/proposeQuotation.d.ts.map +0 -1
- package/lib/services/proposeQuotation.js.map +0 -1
- package/lib/services/registerPaymentCredentials.d.ts.map +0 -1
- package/lib/services/registerPaymentCredentials.js.map +0 -1
- package/lib/services/rejectOrder.d.ts.map +0 -1
- package/lib/services/rejectOrder.js.map +0 -1
- package/lib/services/rejectQuotation.d.ts.map +0 -1
- package/lib/services/rejectQuotation.js.map +0 -1
- package/lib/services/removeFiles.d.ts.map +0 -1
- package/lib/services/removeFiles.js.map +0 -1
- package/lib/services/removeProduct.d.ts.map +0 -1
- package/lib/services/removeProduct.js.map +0 -1
- package/lib/services/searchAssortments.d.ts.map +0 -1
- package/lib/services/searchAssortments.js.map +0 -1
- package/lib/services/searchProducts.d.ts.map +0 -1
- package/lib/services/searchProducts.js.map +0 -1
- package/lib/services/simulateProductDispatching.d.ts.map +0 -1
- package/lib/services/simulateProductDispatching.js.map +0 -1
- package/lib/services/simulateProductInventory.d.ts.map +0 -1
- package/lib/services/simulateProductInventory.js.map +0 -1
- package/lib/services/simulateProductPricing.d.ts.map +0 -1
- package/lib/services/simulateProductPricing.js.map +0 -1
- package/lib/services/supportedDeliveryProviders.d.ts.map +0 -1
- package/lib/services/supportedDeliveryProviders.js.map +0 -1
- package/lib/services/supportedPaymentProviders.d.ts.map +0 -1
- package/lib/services/supportedPaymentProviders.js.map +0 -1
- package/lib/services/supportedWarehousingProviders.d.ts.map +0 -1
- package/lib/services/supportedWarehousingProviders.js.map +0 -1
- package/lib/services/terminateEnrollment.d.ts.map +0 -1
- package/lib/services/terminateEnrollment.js.map +0 -1
- package/lib/services/updateCalculation.d.ts.map +0 -1
- package/lib/services/updateCalculation.js.map +0 -1
- package/lib/services/updateScheduling.d.ts.map +0 -1
- package/lib/services/updateScheduling.js.map +0 -1
- package/lib/services/updateUserAvatarAfterUpload.d.ts.map +0 -1
- package/lib/services/updateUserAvatarAfterUpload.js.map +0 -1
- package/lib/services/uploadFileFromStream.d.ts.map +0 -1
- package/lib/services/uploadFileFromStream.js.map +0 -1
- package/lib/services/uploadFileFromURL.d.ts.map +0 -1
- package/lib/services/uploadFileFromURL.js.map +0 -1
- package/lib/services/validateOrder.d.ts.map +0 -1
- package/lib/services/validateOrder.js.map +0 -1
- package/lib/services/verifyQuotation.d.ts.map +0 -1
- package/lib/services/verifyQuotation.js.map +0 -1
- package/src/bulk-importer/createBulkImporter.ts +0 -205
- package/src/bulk-importer/handlers/assortment/create.ts +0 -118
- package/src/bulk-importer/handlers/assortment/index.ts +0 -3
- package/src/bulk-importer/handlers/assortment/remove.ts +0 -26
- package/src/bulk-importer/handlers/assortment/update.ts +0 -133
- package/src/bulk-importer/handlers/assortment/upsertAssortmentChildren.ts +0 -77
- package/src/bulk-importer/handlers/assortment/upsertAssortmentFilters.ts +0 -70
- package/src/bulk-importer/handlers/assortment/upsertAssortmentProducts.ts +0 -76
- package/src/bulk-importer/handlers/assortment/upsertMedia.ts +0 -76
- package/src/bulk-importer/handlers/filter/create.ts +0 -104
- package/src/bulk-importer/handlers/filter/index.ts +0 -3
- package/src/bulk-importer/handlers/filter/remove.ts +0 -25
- package/src/bulk-importer/handlers/filter/update.ts +0 -94
- package/src/bulk-importer/handlers/product/create.ts +0 -170
- package/src/bulk-importer/handlers/product/index.ts +0 -3
- package/src/bulk-importer/handlers/product/remove.ts +0 -27
- package/src/bulk-importer/handlers/product/update.ts +0 -175
- package/src/bulk-importer/handlers/product/upsertMedia.ts +0 -81
- package/src/bulk-importer/handlers/product/upsertVariations.ts +0 -110
- package/src/bulk-importer/handlers/utils/convertTagsToLowerCase.ts +0 -4
- package/src/bulk-importer/index.ts +0 -3
- package/src/bulk-importer/upsertAsset.ts +0 -53
- package/src/core-index.ts +0 -103
- package/src/directors/BaseDiscountAdapter.test.ts +0 -52
- package/src/directors/BaseDiscountAdapter.ts +0 -86
- package/src/directors/BaseDiscountDirector.ts +0 -73
- package/src/directors/BasePricingAdapter.ts +0 -74
- package/src/directors/BasePricingDirector.ts +0 -136
- package/src/directors/BasePricingSheet.test.ts +0 -45
- package/src/directors/BasePricingSheet.ts +0 -141
- package/src/directors/BaseWorker.ts +0 -117
- package/src/directors/DeliveryAdapter.ts +0 -106
- package/src/directors/DeliveryDirector.ts +0 -143
- package/src/directors/DeliveryPricingAdapter.ts +0 -87
- package/src/directors/DeliveryPricingDirector.ts +0 -91
- package/src/directors/DeliveryPricingSheet.ts +0 -87
- package/src/directors/EnrollmentAdapter.ts +0 -108
- package/src/directors/EnrollmentDirector.ts +0 -71
- package/src/directors/EventListenerWorker.ts +0 -101
- package/src/directors/FailedRescheduler.ts +0 -73
- package/src/directors/FilterAdapter.ts +0 -106
- package/src/directors/FilterDirector.ts +0 -314
- package/src/directors/IntervalWorker.ts +0 -75
- package/src/directors/MessagingDirector.test.ts +0 -8
- package/src/directors/MessagingDirector.ts +0 -52
- package/src/directors/OrderDiscountAdapter.ts +0 -10
- package/src/directors/OrderDiscountConfiguration.ts +0 -5
- package/src/directors/OrderDiscountDirector.ts +0 -5
- package/src/directors/OrderPricingAdapter.ts +0 -63
- package/src/directors/OrderPricingDirector.ts +0 -74
- package/src/directors/OrderPricingSheet.ts +0 -148
- package/src/directors/PaymentAdapter.ts +0 -118
- package/src/directors/PaymentDirector.ts +0 -297
- package/src/directors/PaymentPricingAdapter.ts +0 -86
- package/src/directors/PaymentPricingDirector.ts +0 -92
- package/src/directors/PaymentPricingSheet.ts +0 -92
- package/src/directors/ProductDiscountAdapter.ts +0 -10
- package/src/directors/ProductDiscountConfiguration.ts +0 -18
- package/src/directors/ProductDiscountDirector.ts +0 -4
- package/src/directors/ProductPricingAdapter.ts +0 -58
- package/src/directors/ProductPricingDirector.ts +0 -100
- package/src/directors/ProductPricingSheet.test.ts +0 -140
- package/src/directors/ProductPricingSheet.ts +0 -125
- package/src/directors/QuotationAdapter.ts +0 -82
- package/src/directors/QuotationDirector.ts +0 -105
- package/src/directors/WarehousingAdapter.ts +0 -77
- package/src/directors/WarehousingDirector.ts +0 -233
- package/src/directors/WorkerAdapter.ts +0 -31
- package/src/directors/WorkerDirector.ts +0 -149
- package/src/directors/index.ts +0 -53
- package/src/directors/periodForReferenceDate.test.ts +0 -25
- package/src/factory/index.ts +0 -21
- package/src/factory/registerAssortmentSearchFilter.ts +0 -36
- package/src/factory/registerInvoicePayment.ts +0 -61
- package/src/factory/registerPhysicalWarehousing.ts +0 -92
- package/src/factory/registerPickUpDelivery.ts +0 -81
- package/src/factory/registerProductDiscoverabilityFilter.ts +0 -36
- package/src/factory/registerProductSearchFilter.ts +0 -36
- package/src/factory/registerShippingDelivery.ts +0 -65
- package/src/factory/registerVirtualWarehousing.ts +0 -100
- package/src/factory/registerWorker.ts +0 -46
- package/src/modules.ts +0 -207
- package/src/services/activateEnrollment.ts +0 -26
- package/src/services/addMessage.ts +0 -20
- package/src/services/calculateDiscountTotal.ts +0 -71
- package/src/services/checkoutOrder.ts +0 -48
- package/src/services/confirmOrder.ts +0 -26
- package/src/services/createDownloadStream.ts +0 -17
- package/src/services/createEnrollmentFromCheckout.ts +0 -68
- package/src/services/createManualOrderDiscount.ts +0 -56
- package/src/services/createSignedURL.ts +0 -21
- package/src/services/deleteUser.ts +0 -48
- package/src/services/discountedEntities.ts +0 -81
- package/src/services/ercMetadata.ts +0 -25
- package/src/services/findOrInitCart.ts +0 -28
- package/src/services/fullfillQuotation.ts +0 -14
- package/src/services/generateOrderFromEnrollment.ts +0 -54
- package/src/services/index.ts +0 -173
- package/src/services/initCartProviders.ts +0 -84
- package/src/services/initializeEnrollment.ts +0 -41
- package/src/services/invalidateFilterCache.ts +0 -16
- package/src/services/linkFileService.ts +0 -24
- package/src/services/loadFilterOptions.ts +0 -49
- package/src/services/loadFilters.ts +0 -62
- package/src/services/migrateBookmarks.ts +0 -39
- package/src/services/migrateOrderCart.ts +0 -52
- package/src/services/migrateUserData.ts +0 -22
- package/src/services/nextUserCart.ts +0 -52
- package/src/services/processEnrollment.ts +0 -49
- package/src/services/processOrder.ts +0 -243
- package/src/services/processQuotation.ts +0 -71
- package/src/services/proposeQuotation.ts +0 -18
- package/src/services/registerPaymentCredentials.ts +0 -28
- package/src/services/rejectOrder.ts +0 -26
- package/src/services/rejectQuotation.ts +0 -18
- package/src/services/removeFiles.ts +0 -25
- package/src/services/removeProduct.ts +0 -39
- package/src/services/searchAssortments.ts +0 -57
- package/src/services/searchProducts.ts +0 -71
- package/src/services/simulateProductDispatching.ts +0 -58
- package/src/services/simulateProductInventory.ts +0 -59
- package/src/services/simulateProductPricing.ts +0 -23
- package/src/services/supportedDeliveryProviders.ts +0 -24
- package/src/services/supportedPaymentProviders.ts +0 -25
- package/src/services/supportedWarehousingProviders.ts +0 -18
- package/src/services/terminateEnrollment.ts +0 -25
- package/src/services/updateCalculation.ts +0 -159
- package/src/services/updateScheduling.ts +0 -63
- package/src/services/updateUserAvatarAfterUpload.ts +0 -33
- package/src/services/uploadFileFromStream.ts +0 -27
- package/src/services/uploadFileFromURL.ts +0 -29
- package/src/services/validateOrder.ts +0 -49
- package/src/services/verifyQuotation.ts +0 -18
- package/tsconfig.json +0 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Filter, SearchQuery } from '@unchainedshop/core-filters';
|
|
2
|
-
import { Modules } from '../modules.
|
|
1
|
+
import { type Filter, type SearchQuery } from '@unchainedshop/core-filters';
|
|
2
|
+
import type { Modules } from '../modules.ts';
|
|
3
3
|
export declare function loadFilterOptionsService(this: Modules, filter: Filter, params: {
|
|
4
4
|
searchQuery: SearchQuery;
|
|
5
5
|
forceLiveCollection: boolean;
|
|
@@ -11,4 +11,3 @@ export declare function loadFilterOptionsService(this: Modules, filter: Filter,
|
|
|
11
11
|
filter: Filter;
|
|
12
12
|
isSelected: boolean;
|
|
13
13
|
} | null)[]>;
|
|
14
|
-
//# sourceMappingURL=loadFilterOptions.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FilterType } from '@unchainedshop/core-filters';
|
|
2
|
-
import { FilterDirector, parseQueryArray } from
|
|
2
|
+
import { FilterDirector, parseQueryArray } from "../directors/FilterDirector.js";
|
|
3
3
|
export async function loadFilterOptionsService(filter, params) {
|
|
4
4
|
const { forceLiveCollection, productIdSet, searchQuery } = params;
|
|
5
5
|
const filterQueryParsed = parseQueryArray(searchQuery?.filterQuery);
|
|
@@ -26,4 +26,3 @@ export async function loadFilterOptionsService(filter, params) {
|
|
|
26
26
|
}));
|
|
27
27
|
return mappedOptions.filter(Boolean);
|
|
28
28
|
}
|
|
29
|
-
//# sourceMappingURL=loadFilterOptions.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SearchQuery } from '@unchainedshop/core-filters';
|
|
2
|
-
import { Modules } from '../modules.
|
|
1
|
+
import { type SearchQuery } from '@unchainedshop/core-filters';
|
|
2
|
+
import type { Modules } from '../modules.ts';
|
|
3
3
|
export declare function loadFiltersService(this: Modules, searchQuery: SearchQuery, options: {
|
|
4
4
|
productIds: string[];
|
|
5
5
|
forceLiveCollection?: boolean;
|
|
@@ -13,4 +13,3 @@ export declare function loadFiltersService(this: Modules, searchQuery: SearchQue
|
|
|
13
13
|
filteredByOtherFiltersSet: Set<string>;
|
|
14
14
|
filteredByThisFilterSet: Set<string>;
|
|
15
15
|
}[]>;
|
|
16
|
-
//# sourceMappingURL=loadFilters.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defaultFilterSelector } from '@unchainedshop/core-filters';
|
|
2
|
-
import { FilterDirector } from
|
|
2
|
+
import { FilterDirector } from "../directors/FilterDirector.js";
|
|
3
3
|
export async function loadFiltersService(searchQuery, options) {
|
|
4
4
|
const filterActions = await FilterDirector.actions({ searchQuery }, { modules: this });
|
|
5
5
|
const filterSelector = await filterActions.transformFilterSelector(defaultFilterSelector(searchQuery), options);
|
|
@@ -34,4 +34,3 @@ export async function loadFiltersService(searchQuery, options) {
|
|
|
34
34
|
};
|
|
35
35
|
}));
|
|
36
36
|
}
|
|
37
|
-
//# sourceMappingURL=loadFilters.js.map
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Modules } from '../modules.
|
|
1
|
+
import type { Modules } from '../modules.ts';
|
|
2
2
|
export declare function migrateBookmarksService(this: Modules, { fromUserId, toUserId, shouldMerge, }: {
|
|
3
3
|
fromUserId: string;
|
|
4
4
|
toUserId: string;
|
|
5
5
|
shouldMerge: boolean;
|
|
6
6
|
countryCode: string;
|
|
7
7
|
}): Promise<void>;
|
|
8
|
-
//# sourceMappingURL=migrateBookmarks.d.ts.map
|
|
@@ -4,7 +4,6 @@ const hashBookmark = (bookmark) => {
|
|
|
4
4
|
export async function migrateBookmarksService({ fromUserId, toUserId, shouldMerge, }) {
|
|
5
5
|
const fromBookmarks = await this.bookmarks.findBookmarks({ userId: fromUserId });
|
|
6
6
|
if (!fromBookmarks) {
|
|
7
|
-
// No bookmarks no copy needed
|
|
8
7
|
return;
|
|
9
8
|
}
|
|
10
9
|
if (!shouldMerge) {
|
|
@@ -23,4 +22,3 @@ export async function migrateBookmarksService({ fromUserId, toUserId, shouldMerg
|
|
|
23
22
|
await this.bookmarks.replaceUserId(fromUserId, toUserId, newBookmarkIds);
|
|
24
23
|
}
|
|
25
24
|
}
|
|
26
|
-
//# sourceMappingURL=migrateBookmarks.js.map
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Modules } from '../modules.
|
|
1
|
+
import type { Modules } from '../modules.ts';
|
|
2
2
|
export declare function migrateOrderCartsService(this: Modules, { fromUserId, toUserId, shouldMerge, countryCode, }: {
|
|
3
3
|
fromUserId: string;
|
|
4
4
|
toUserId: string;
|
|
5
5
|
shouldMerge: boolean;
|
|
6
6
|
countryCode: string;
|
|
7
7
|
}): Promise<import("@unchainedshop/core-orders").Order | null>;
|
|
8
|
-
//# sourceMappingURL=migrateOrderCart.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { updateCalculationService } from
|
|
1
|
+
import { updateCalculationService } from "./updateCalculation.js";
|
|
2
2
|
export async function migrateOrderCartsService({ fromUserId, toUserId, shouldMerge, countryCode, }) {
|
|
3
3
|
const fromCart = await this.orders.cart({
|
|
4
4
|
countryCode,
|
|
@@ -9,24 +9,18 @@ export async function migrateOrderCartsService({ fromUserId, toUserId, shouldMer
|
|
|
9
9
|
userId: toUserId,
|
|
10
10
|
});
|
|
11
11
|
if (!fromCart) {
|
|
12
|
-
// No cart, don't copy
|
|
13
12
|
return toCart;
|
|
14
13
|
}
|
|
15
14
|
if (!toCart || !shouldMerge) {
|
|
16
|
-
// No destination cart, move whole cart
|
|
17
15
|
this.orders.setCartOwner({ orderId: fromCart._id, userId: toUserId });
|
|
18
16
|
return updateCalculationService.bind(this)(fromCart._id);
|
|
19
17
|
}
|
|
20
|
-
// Move positions
|
|
21
18
|
this.orders.moveCartPositions({ fromOrderId: fromCart._id, toOrderId: toCart._id });
|
|
22
|
-
// Move billing address if target order has none
|
|
23
19
|
if (fromCart.billingAddress && !toCart.billingAddress) {
|
|
24
20
|
await this.orders.updateBillingAddress(toCart._id, fromCart.billingAddress);
|
|
25
21
|
}
|
|
26
|
-
// Move contact data if target order has none
|
|
27
22
|
if (fromCart.contact && !toCart.contact) {
|
|
28
23
|
await this.orders.updateContact(toCart._id, fromCart.contact);
|
|
29
24
|
}
|
|
30
25
|
return updateCalculationService.bind(this)(toCart._id);
|
|
31
26
|
}
|
|
32
|
-
//# sourceMappingURL=migrateOrderCart.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { userSettings } from '@unchainedshop/core-users';
|
|
2
|
-
import { migrateBookmarksService } from
|
|
3
|
-
import { migrateOrderCartsService } from
|
|
2
|
+
import { migrateBookmarksService } from "./migrateBookmarks.js";
|
|
3
|
+
import { migrateOrderCartsService } from "./migrateOrderCart.js";
|
|
4
4
|
export async function migrateUserDataService(userIdBeforeLogin, userId) {
|
|
5
5
|
const user = await this.users.findUserById(userId);
|
|
6
6
|
const userBeforeLogin = await this.users.findUserById(userIdBeforeLogin);
|
|
@@ -17,4 +17,3 @@ export async function migrateUserDataService(userIdBeforeLogin, userId) {
|
|
|
17
17
|
countryCode: userBeforeLogin?.lastLogin?.countryCode || user?.lastLogin?.countryCode,
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
//# sourceMappingURL=migrateUserData.js.map
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { User } from '@unchainedshop/core-users';
|
|
2
|
-
import { Modules } from '../modules.
|
|
1
|
+
import type { User } from '@unchainedshop/core-users';
|
|
2
|
+
import type { Modules } from '../modules.ts';
|
|
3
3
|
export declare function nextUserCartService(this: Modules, { user, orderNumber, countryCode, forceCartCreation, }: {
|
|
4
4
|
user: User;
|
|
5
5
|
orderNumber?: string;
|
|
6
6
|
countryCode: string;
|
|
7
7
|
forceCartCreation?: boolean;
|
|
8
8
|
}): Promise<import("@unchainedshop/core-orders").Order | null>;
|
|
9
|
-
//# sourceMappingURL=nextUserCart.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveBestCurrency } from '@unchainedshop/utils';
|
|
2
2
|
import { ordersSettings } from '@unchainedshop/core-orders';
|
|
3
|
-
import { initCartProvidersService } from
|
|
3
|
+
import { initCartProvidersService } from "./initCartProviders.js";
|
|
4
4
|
export async function nextUserCartService({ user, orderNumber, countryCode, forceCartCreation, }) {
|
|
5
5
|
const cart = await this.orders.cart({
|
|
6
6
|
countryCode,
|
|
@@ -31,4 +31,3 @@ export async function nextUserCartService({ user, orderNumber, countryCode, forc
|
|
|
31
31
|
});
|
|
32
32
|
return initCartProvidersService.bind(this)(order);
|
|
33
33
|
}
|
|
34
|
-
//# sourceMappingURL=nextUserCart.js.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Enrollment } from '@unchainedshop/core-enrollments';
|
|
2
|
-
import { Modules } from '../modules.
|
|
1
|
+
import { type Enrollment } from '@unchainedshop/core-enrollments';
|
|
2
|
+
import type { Modules } from '../modules.ts';
|
|
3
3
|
export declare function processEnrollmentService(this: Modules, enrollment: Enrollment): Promise<Enrollment>;
|
|
4
|
-
//# sourceMappingURL=processEnrollment.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EnrollmentStatus } from '@unchainedshop/core-enrollments';
|
|
2
|
-
import { EnrollmentDirector } from
|
|
2
|
+
import { EnrollmentDirector } from "../core-index.js";
|
|
3
3
|
const findNextStatus = async (enrollment, modules) => {
|
|
4
4
|
let status = enrollment.status;
|
|
5
5
|
const product = await modules.products.findProduct({
|
|
@@ -26,9 +26,6 @@ const findNextStatus = async (enrollment, modules) => {
|
|
|
26
26
|
export async function processEnrollmentService(enrollment) {
|
|
27
27
|
const status = await findNextStatus(enrollment, this);
|
|
28
28
|
if (status === EnrollmentStatus.ACTIVE) {
|
|
29
|
-
// const nextEnrollment = await reactivateEnrollment(enrollment);
|
|
30
|
-
// TODO: Reactivate!
|
|
31
|
-
// status = await findNextStatus(nextEnrollment, unchainedAPI);
|
|
32
29
|
}
|
|
33
30
|
if (status) {
|
|
34
31
|
return this.enrollments.updateStatus(enrollment._id, {
|
|
@@ -38,4 +35,3 @@ export async function processEnrollmentService(enrollment) {
|
|
|
38
35
|
}
|
|
39
36
|
return enrollment;
|
|
40
37
|
}
|
|
41
|
-
//# sourceMappingURL=processEnrollment.js.map
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { Order, OrderStatus } from '@unchainedshop/core-orders';
|
|
2
|
-
import { Modules } from '../modules.
|
|
1
|
+
import { type Order, OrderStatus } from '@unchainedshop/core-orders';
|
|
2
|
+
import type { Modules } from '../modules.ts';
|
|
3
3
|
export declare function processOrderService(this: Modules, initialOrder: Order, orderTransactionContext: {
|
|
4
4
|
paymentContext?: any;
|
|
5
5
|
deliveryContext?: any;
|
|
6
6
|
comment?: string;
|
|
7
7
|
nextStatus?: OrderStatus;
|
|
8
8
|
}): Promise<Order>;
|
|
9
|
-
//# sourceMappingURL=processOrder.d.ts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { OrderDeliveryStatus, OrderPaymentStatus, OrderStatus, } from '@unchainedshop/core-orders';
|
|
2
|
-
import { createEnrollmentFromCheckoutService } from
|
|
3
|
-
import {
|
|
2
|
+
import { createEnrollmentFromCheckoutService } from "./createEnrollmentFromCheckout.js";
|
|
3
|
+
import { ProductType } from '@unchainedshop/core-products';
|
|
4
4
|
import { WarehousingProviderType } from '@unchainedshop/core-warehousing';
|
|
5
|
-
import { WarehousingDirector, DeliveryDirector, PaymentDirector } from
|
|
6
|
-
import { fullfillQuotationService } from
|
|
5
|
+
import { WarehousingDirector, DeliveryDirector, PaymentDirector } from "../directors/index.js";
|
|
6
|
+
import { fullfillQuotationService } from "./fullfillQuotation.js";
|
|
7
7
|
const isAutoConfirmationEnabled = async ({ orderPayment, orderDelivery, }, modules) => {
|
|
8
8
|
if (orderPayment.status !== OrderPaymentStatus.PAID) {
|
|
9
9
|
const paymentProvider = await modules.payment.paymentProviders.findProvider({
|
|
@@ -32,7 +32,6 @@ const findNextStatus = async (status, order, modules) => {
|
|
|
32
32
|
return OrderStatus.PENDING;
|
|
33
33
|
}
|
|
34
34
|
if (status === OrderStatus.FULLFILLED || status === OrderStatus.REJECTED) {
|
|
35
|
-
// Final!
|
|
36
35
|
return status;
|
|
37
36
|
}
|
|
38
37
|
const orderPayment = order.paymentId &&
|
|
@@ -47,8 +46,6 @@ const findNextStatus = async (status, order, modules) => {
|
|
|
47
46
|
}));
|
|
48
47
|
if (!orderDelivery)
|
|
49
48
|
return status;
|
|
50
|
-
// Ok, we have a payment and a delivery and the correct status,
|
|
51
|
-
// let's check if we can auto-confirm or auto-fulfill
|
|
52
49
|
if (status === OrderStatus.PENDING) {
|
|
53
50
|
if (await isAutoConfirmationEnabled({ orderPayment, orderDelivery }, modules)) {
|
|
54
51
|
return OrderStatus.CONFIRMED;
|
|
@@ -69,29 +66,19 @@ export async function processOrderService(initialOrder, orderTransactionContext)
|
|
|
69
66
|
let order = initialOrder;
|
|
70
67
|
let nextStatus = forceNextStatus || (await findNextStatus(initialOrder.status, order, this));
|
|
71
68
|
if (nextStatus === OrderStatus.PENDING) {
|
|
72
|
-
// auto charge during transition to pending
|
|
73
69
|
await PaymentDirector.chargeOrderPayment(order, { userId: order.userId, transactionContext: paymentContext }, { modules: this });
|
|
74
70
|
nextStatus = await findNextStatus(nextStatus, order, this);
|
|
75
71
|
}
|
|
76
72
|
if (nextStatus === OrderStatus.REJECTED) {
|
|
77
|
-
// auto cancel during transition to rejected
|
|
78
73
|
await PaymentDirector.cancelOrderPayment(order, { userId: order.userId, transactionContext: paymentContext }, { modules: this });
|
|
79
74
|
}
|
|
80
75
|
if (nextStatus === OrderStatus.CONFIRMED) {
|
|
81
|
-
// confirm pre-authorized payments
|
|
82
76
|
await PaymentDirector.confirmOrderPayment(order, { userId: order.userId, transactionContext: paymentContext }, { modules: this });
|
|
83
77
|
if (order.status !== OrderStatus.CONFIRMED) {
|
|
84
|
-
// we have to stop here shortly to complete the confirmation
|
|
85
|
-
// before auto delivery is started, else we have no chance to create
|
|
86
|
-
// numbers that are needed for delivery
|
|
87
78
|
order = (await this.orders.updateStatus(orderId, {
|
|
88
79
|
status: OrderStatus.CONFIRMED,
|
|
89
80
|
info: comment,
|
|
90
81
|
}));
|
|
91
|
-
// TODO: What happens if this THROWS?
|
|
92
|
-
// Tokenization would be skipped?
|
|
93
|
-
// Enrollments will not be there?
|
|
94
|
-
// Quotations would not fulfil?
|
|
95
82
|
await DeliveryDirector.sendOrderDelivery(order, deliveryContext, { modules: this });
|
|
96
83
|
const orderPositions = await this.orders.positions.findOrderPositions({ orderId });
|
|
97
84
|
const mappedProductOrderPositions = await Promise.all(orderPositions.map(async (orderPosition) => {
|
|
@@ -103,13 +90,9 @@ export async function processOrderService(initialOrder, orderTransactionContext)
|
|
|
103
90
|
product,
|
|
104
91
|
};
|
|
105
92
|
}));
|
|
106
|
-
const tokenizedItems = mappedProductOrderPositions.filter((item) => item.product?.type ===
|
|
93
|
+
const tokenizedItems = mappedProductOrderPositions.filter((item) => item.product?.type === ProductType.TOKENIZED_PRODUCT);
|
|
107
94
|
if (tokenizedItems.length > 0) {
|
|
108
|
-
// Give virtual warehouse a chance to instantiate new virtual objects
|
|
109
95
|
const virtualProviders = (await this.warehousing.allProviders()).filter(({ type }) => type === WarehousingProviderType.VIRTUAL);
|
|
110
|
-
// It's very important to do this in a series and not in Promise.all
|
|
111
|
-
// TODO: Actually, only createTokens should decide on the unique tokenSerialNumber
|
|
112
|
-
// and the tokens should be created with a distributed Lock to not assign the same id multiple times!
|
|
113
96
|
for (const { orderPosition, product } of tokenizedItems) {
|
|
114
97
|
for (const virtualProvider of virtualProviders) {
|
|
115
98
|
const adapterActions = await WarehousingDirector.actions(virtualProvider, {
|
|
@@ -127,8 +110,7 @@ export async function processOrderService(initialOrder, orderTransactionContext)
|
|
|
127
110
|
}
|
|
128
111
|
}
|
|
129
112
|
}
|
|
130
|
-
|
|
131
|
-
const planItems = mappedProductOrderPositions.filter((item) => item.product?.type === ProductTypes.PlanProduct && !order.originEnrollmentId);
|
|
113
|
+
const planItems = mappedProductOrderPositions.filter((item) => item.product?.type === ProductType.PLAN_PRODUCT && !order.originEnrollmentId);
|
|
132
114
|
if (planItems.length > 0) {
|
|
133
115
|
await createEnrollmentFromCheckoutService.bind(this)(order, {
|
|
134
116
|
items: planItems,
|
|
@@ -138,14 +120,13 @@ export async function processOrderService(initialOrder, orderTransactionContext)
|
|
|
138
120
|
},
|
|
139
121
|
});
|
|
140
122
|
}
|
|
141
|
-
// Quotations: If we came here, the checkout succeeded, so we can fullfill underlying quotations
|
|
142
123
|
const quotationItems = mappedProductOrderPositions.filter((item) => item.orderPosition.quotationId);
|
|
143
124
|
await Promise.all(quotationItems.map(async ({ orderPosition }) => {
|
|
144
125
|
const quotation = await this.quotations.findQuotation({
|
|
145
126
|
quotationId: orderPosition.quotationId,
|
|
146
127
|
});
|
|
147
128
|
if (!quotation)
|
|
148
|
-
return;
|
|
129
|
+
return;
|
|
149
130
|
await fullfillQuotationService.bind(this)(quotation, {
|
|
150
131
|
orderId,
|
|
151
132
|
orderPositionId: orderPosition._id,
|
|
@@ -156,4 +137,3 @@ export async function processOrderService(initialOrder, orderTransactionContext)
|
|
|
156
137
|
}
|
|
157
138
|
return (await this.orders.updateStatus(order._id, { status: nextStatus, info: comment }));
|
|
158
139
|
}
|
|
159
|
-
//# sourceMappingURL=processOrder.js.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Quotation } from '@unchainedshop/core-quotations';
|
|
2
|
-
import { Modules } from '../modules.
|
|
1
|
+
import { type Quotation } from '@unchainedshop/core-quotations';
|
|
2
|
+
import type { Modules } from '../modules.ts';
|
|
3
3
|
export declare function processQuotationService(this: Modules, initialQuotation: Quotation, params: {
|
|
4
4
|
quotationContext?: any;
|
|
5
5
|
}): Promise<Quotation>;
|
|
6
|
-
//# sourceMappingURL=processQuotation.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { QuotationStatus } from '@unchainedshop/core-quotations';
|
|
2
|
-
import { QuotationDirector } from
|
|
3
|
-
import { addMessageService } from
|
|
2
|
+
import { QuotationDirector } from "../core-index.js";
|
|
3
|
+
import { addMessageService } from "./addMessage.js";
|
|
4
4
|
const findNextStatus = async (quotation, modules) => {
|
|
5
5
|
let status = quotation.status;
|
|
6
6
|
const director = await QuotationDirector.actions({ quotation }, { modules });
|
|
@@ -53,4 +53,3 @@ export async function processQuotationService(initialQuotation, params) {
|
|
|
53
53
|
});
|
|
54
54
|
return updatedQuotation;
|
|
55
55
|
}
|
|
56
|
-
//# sourceMappingURL=processQuotation.js.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Quotation } from '@unchainedshop/core-quotations';
|
|
2
|
-
import { Modules } from '../modules.
|
|
1
|
+
import { type Quotation } from '@unchainedshop/core-quotations';
|
|
2
|
+
import type { Modules } from '../modules.ts';
|
|
3
3
|
export declare function proposeQuotationService(this: Modules, quotation: Quotation, { quotationContext }: {
|
|
4
4
|
quotationContext?: any;
|
|
5
5
|
}): Promise<Quotation>;
|
|
6
|
-
//# sourceMappingURL=proposeQuotation.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { QuotationStatus } from '@unchainedshop/core-quotations';
|
|
2
|
-
import { processQuotationService } from
|
|
2
|
+
import { processQuotationService } from "./processQuotation.js";
|
|
3
3
|
export async function proposeQuotationService(quotation, { quotationContext }) {
|
|
4
4
|
if (quotation.status !== QuotationStatus.PROCESSING)
|
|
5
5
|
return quotation;
|
|
@@ -9,4 +9,3 @@ export async function proposeQuotationService(quotation, { quotationContext }) {
|
|
|
9
9
|
}));
|
|
10
10
|
return processQuotationService.bind(this)(updatedQuotation, { quotationContext });
|
|
11
11
|
}
|
|
12
|
-
//# sourceMappingURL=proposeQuotation.js.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { PaymentContext } from '../directors/PaymentAdapter.
|
|
2
|
-
import { Modules } from '../modules.
|
|
1
|
+
import type { PaymentContext } from '../directors/PaymentAdapter.ts';
|
|
2
|
+
import type { Modules } from '../modules.ts';
|
|
3
3
|
export declare function registerPaymentCredentialsService(this: Modules, paymentProviderId: string, paymentContext: PaymentContext): Promise<import("@unchainedshop/core-payment").PaymentCredentials | null>;
|
|
4
|
-
//# sourceMappingURL=registerPaymentCredentials.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PaymentDirector } from
|
|
1
|
+
import { PaymentDirector } from "../directors/PaymentDirector.js";
|
|
2
2
|
export async function registerPaymentCredentialsService(paymentProviderId, paymentContext) {
|
|
3
3
|
const paymentProvider = await this.payment.paymentProviders.findProvider({
|
|
4
4
|
paymentProviderId,
|
|
@@ -16,4 +16,3 @@ export async function registerPaymentCredentialsService(paymentProviderId, payme
|
|
|
16
16
|
});
|
|
17
17
|
return paymentCredentials;
|
|
18
18
|
}
|
|
19
|
-
//# sourceMappingURL=registerPaymentCredentials.js.map
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { Order, OrderStatus } from '@unchainedshop/core-orders';
|
|
2
|
-
import { Modules } from '../modules.
|
|
1
|
+
import { type Order, OrderStatus } from '@unchainedshop/core-orders';
|
|
2
|
+
import type { Modules } from '../modules.ts';
|
|
3
3
|
export declare function rejectOrderService(this: Modules, order: Order, transactionContext: {
|
|
4
4
|
paymentContext?: any;
|
|
5
5
|
deliveryContext?: any;
|
|
6
6
|
comment?: string;
|
|
7
7
|
nextStatus?: OrderStatus;
|
|
8
8
|
}): Promise<Order>;
|
|
9
|
-
//# sourceMappingURL=rejectOrder.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OrderStatus } from '@unchainedshop/core-orders';
|
|
2
|
-
import { processOrderService } from
|
|
2
|
+
import { processOrderService } from "./processOrder.js";
|
|
3
3
|
export async function rejectOrderService(order, transactionContext) {
|
|
4
4
|
if (order.status !== OrderStatus.PENDING)
|
|
5
5
|
return order;
|
|
@@ -14,4 +14,3 @@ export async function rejectOrderService(order, transactionContext) {
|
|
|
14
14
|
await lock.release();
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
//# sourceMappingURL=rejectOrder.js.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Quotation } from '@unchainedshop/core-quotations';
|
|
2
|
-
import { Modules } from '../modules.
|
|
1
|
+
import { type Quotation } from '@unchainedshop/core-quotations';
|
|
2
|
+
import type { Modules } from '../modules.ts';
|
|
3
3
|
export declare function rejectQuotationService(this: Modules, quotation: Quotation, { quotationContext }: {
|
|
4
4
|
quotationContext?: any;
|
|
5
5
|
}): Promise<Quotation>;
|
|
6
|
-
//# sourceMappingURL=rejectQuotation.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { QuotationStatus } from '@unchainedshop/core-quotations';
|
|
2
|
-
import { processQuotationService } from
|
|
2
|
+
import { processQuotationService } from "./processQuotation.js";
|
|
3
3
|
export async function rejectQuotationService(quotation, { quotationContext }) {
|
|
4
4
|
if (quotation.status === QuotationStatus.FULLFILLED)
|
|
5
5
|
return quotation;
|
|
@@ -9,4 +9,3 @@ export async function rejectQuotationService(quotation, { quotationContext }) {
|
|
|
9
9
|
}));
|
|
10
10
|
return processQuotationService.bind(this)(updatedQuotation, { quotationContext });
|
|
11
11
|
}
|
|
12
|
-
//# sourceMappingURL=rejectQuotation.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Modules } from '../modules.ts';
|
|
2
|
+
import { type Order, type OrderDiscount } from '@unchainedshop/core-orders';
|
|
3
|
+
export declare function removeCartDiscountService(this: Modules, { order, orderDiscount, requestContext, }: {
|
|
4
|
+
order: Order;
|
|
5
|
+
orderDiscount: OrderDiscount;
|
|
6
|
+
requestContext: {
|
|
7
|
+
localeContext: Intl.Locale;
|
|
8
|
+
userId?: string;
|
|
9
|
+
};
|
|
10
|
+
}): Promise<OrderDiscount | null>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { OrderDiscountDirector } from "../directors/index.js";
|
|
2
|
+
import { OrderDiscountTrigger } from '@unchainedshop/core-orders';
|
|
3
|
+
export async function removeCartDiscountService({ order, orderDiscount, requestContext, }) {
|
|
4
|
+
if (orderDiscount.trigger === OrderDiscountTrigger.USER) {
|
|
5
|
+
const Adapter = OrderDiscountDirector.getAdapter(orderDiscount.discountKey);
|
|
6
|
+
if (Adapter) {
|
|
7
|
+
const adapter = await Adapter.actions({
|
|
8
|
+
context: { order, orderDiscount, code: orderDiscount.code, modules: this, ...requestContext },
|
|
9
|
+
});
|
|
10
|
+
await adapter.release();
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return this.orders.discounts.delete(orderDiscount._id);
|
|
14
|
+
}
|
|
@@ -4,16 +4,14 @@ export async function removeFilesService({ fileIds }) {
|
|
|
4
4
|
throw Error('Media id/s to be removed not provided as a string or array');
|
|
5
5
|
const fileUploadAdapter = getFileAdapter();
|
|
6
6
|
const fileObjects = await this.files.findFiles({
|
|
7
|
-
|
|
7
|
+
fileIds,
|
|
8
8
|
});
|
|
9
9
|
try {
|
|
10
10
|
await fileUploadAdapter.removeFiles(fileObjects, { modules: this });
|
|
11
11
|
}
|
|
12
12
|
catch {
|
|
13
|
-
/**/
|
|
14
13
|
}
|
|
15
14
|
const fileIdsToDelete = fileObjects.map((f) => f._id).filter(Boolean);
|
|
16
15
|
await this.files.deleteMany(fileIdsToDelete);
|
|
17
16
|
return fileIdsToDelete.length;
|
|
18
17
|
}
|
|
19
|
-
//# sourceMappingURL=removeFiles.js.map
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { ProductStatus } from '@unchainedshop/core-products';
|
|
2
|
-
import { updateCalculationService } from
|
|
2
|
+
import { updateCalculationService } from "./updateCalculation.js";
|
|
3
3
|
export async function removeProductService({ productId }) {
|
|
4
4
|
const product = await this.products.findProduct({ productId });
|
|
5
5
|
switch (product?.status) {
|
|
6
6
|
case ProductStatus.ACTIVE:
|
|
7
7
|
await this.products.unpublish(product);
|
|
8
|
-
// falls through
|
|
9
8
|
case null:
|
|
10
9
|
case ProductStatus.DRAFT:
|
|
11
10
|
{
|
|
@@ -20,11 +19,9 @@ export async function removeProductService({ productId }) {
|
|
|
20
19
|
}
|
|
21
20
|
break;
|
|
22
21
|
case ProductStatus.DELETED:
|
|
23
|
-
// Already deleted
|
|
24
22
|
return false;
|
|
25
23
|
default:
|
|
26
24
|
throw new Error(`Invalid status: ${product?.status}`);
|
|
27
25
|
}
|
|
28
26
|
return true;
|
|
29
27
|
}
|
|
30
|
-
//# sourceMappingURL=removeProduct.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { DeliveryProvider } from '@unchainedshop/core-delivery';
|
|
2
|
+
import type { OrderPosition } from '@unchainedshop/core-orders';
|
|
3
|
+
import type { Product } from '@unchainedshop/core-products';
|
|
4
|
+
import type { WarehousingProvider } from '@unchainedshop/core-warehousing';
|
|
5
|
+
import type { Modules } from '../modules.ts';
|
|
6
|
+
export interface OrderItemDispatch {
|
|
7
|
+
_id: string;
|
|
8
|
+
deliveryProvider: DeliveryProvider;
|
|
9
|
+
warehousingProvider: WarehousingProvider;
|
|
10
|
+
product: Product;
|
|
11
|
+
quantity: number;
|
|
12
|
+
countryCode: string;
|
|
13
|
+
userId: string;
|
|
14
|
+
shipping: Date;
|
|
15
|
+
earliestDelivery: Date;
|
|
16
|
+
}
|
|
17
|
+
export declare function resolveOrderItemDispatchesService(this: Modules, { orderPosition, }: {
|
|
18
|
+
orderPosition: OrderPosition;
|
|
19
|
+
}): Promise<OrderItemDispatch[] | null>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export async function resolveOrderItemDispatchesService({ orderPosition, }) {
|
|
2
|
+
const scheduling = orderPosition.scheduling || [];
|
|
3
|
+
if (!scheduling.length)
|
|
4
|
+
return [];
|
|
5
|
+
const order = await this.orders.findOrder({ orderId: orderPosition.orderId });
|
|
6
|
+
if (!order)
|
|
7
|
+
return null;
|
|
8
|
+
const { countryCode, userId, deliveryId } = order;
|
|
9
|
+
if (!deliveryId)
|
|
10
|
+
return null;
|
|
11
|
+
const orderDelivery = await this.orders.deliveries.findDelivery({
|
|
12
|
+
orderDeliveryId: deliveryId,
|
|
13
|
+
});
|
|
14
|
+
if (!orderDelivery)
|
|
15
|
+
return null;
|
|
16
|
+
const deliveryProvider = await this.delivery.findProvider({
|
|
17
|
+
deliveryProviderId: orderDelivery.deliveryProviderId,
|
|
18
|
+
});
|
|
19
|
+
if (!deliveryProvider)
|
|
20
|
+
return null;
|
|
21
|
+
const product = await this.products.findProduct({ productId: orderPosition.productId });
|
|
22
|
+
if (!product)
|
|
23
|
+
return null;
|
|
24
|
+
return Promise.all(scheduling.map(async (schedule) => {
|
|
25
|
+
const warehousingProvider = await this.warehousing.findProvider({
|
|
26
|
+
warehousingProviderId: schedule.warehousingProviderId,
|
|
27
|
+
});
|
|
28
|
+
return {
|
|
29
|
+
warehousingProvider,
|
|
30
|
+
deliveryProvider,
|
|
31
|
+
product,
|
|
32
|
+
quantity: orderPosition.quantity,
|
|
33
|
+
countryCode,
|
|
34
|
+
userId,
|
|
35
|
+
...schedule,
|
|
36
|
+
};
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { TokenSurrogate, TokenStatus as TokenStatusType } from '@unchainedshop/core-warehousing';
|
|
2
|
+
import type { Modules } from '../modules.ts';
|
|
3
|
+
export declare function resolveTokenStatusService(this: Modules, { token, }: {
|
|
4
|
+
token: TokenSurrogate;
|
|
5
|
+
}): Promise<TokenStatusType>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TokenStatus } from '@unchainedshop/core-warehousing';
|
|
2
|
+
import { WorkStatus } from '@unchainedshop/core-worker';
|
|
3
|
+
export async function resolveTokenStatusService({ token, }) {
|
|
4
|
+
if (token.walletAddress && !token.userId) {
|
|
5
|
+
return TokenStatus.DECENTRALIZED;
|
|
6
|
+
}
|
|
7
|
+
const workItems = await this.worker.findWorkQueue({
|
|
8
|
+
types: ['EXPORT_TOKEN'],
|
|
9
|
+
status: [WorkStatus.NEW, WorkStatus.ALLOCATED],
|
|
10
|
+
});
|
|
11
|
+
if (workItems.find((item) => item.input?.token?._id === token._id)) {
|
|
12
|
+
return TokenStatus.EXPORTING;
|
|
13
|
+
}
|
|
14
|
+
return TokenStatus.CENTRALIZED;
|
|
15
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SearchQuery } from '@unchainedshop/core-filters';
|
|
2
|
-
import { Modules } from '../modules.
|
|
3
|
-
import { SearchAssortmentsOptions } from '../directors/index.
|
|
1
|
+
import { type SearchQuery } from '@unchainedshop/core-filters';
|
|
2
|
+
import type { Modules } from '../modules.ts';
|
|
3
|
+
import { type SearchAssortmentsOptions } from '../directors/index.ts';
|
|
4
4
|
export declare function searchAssortmentsService(this: Modules, searchQuery: SearchQuery, options: {
|
|
5
5
|
forceLiveCollection?: boolean;
|
|
6
6
|
locale: Intl.Locale;
|
|
@@ -14,4 +14,3 @@ export declare function searchAssortmentsService(this: Modules, searchQuery: Sea
|
|
|
14
14
|
limit: any;
|
|
15
15
|
}) => Promise<import("@unchainedshop/core-assortments").Assortment[]>;
|
|
16
16
|
}>;
|
|
17
|
-
//# sourceMappingURL=searchAssortments.d.ts.map
|