@unchainedshop/core 4.3.6 → 4.4.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 +9 -10
- package/lib/core-index.js +9 -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 +2 -5
- 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 +6 -7
- package/lib/directors/DeliveryPricingAdapter.js +2 -3
- package/lib/directors/DeliveryPricingDirector.d.ts +3 -4
- 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 +2 -3
- package/lib/directors/IntervalWorker.js +3 -5
- 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 +6 -7
- package/lib/directors/PaymentPricingAdapter.js +2 -3
- package/lib/directors/PaymentPricingDirector.d.ts +4 -5
- 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/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/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/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 +48 -49
- package/lib/services/index.js +47 -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/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/removeFiles.d.ts +1 -2
- package/lib/services/removeFiles.js +0 -2
- package/lib/services/removeProduct.d.ts +1 -2
- package/lib/services/removeProduct.js +1 -4
- 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/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 +1 -3
- 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/package.json +27 -26
- 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
package/lib/core-index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { mongodb, MigrationRepository, ModuleInput } from '@unchainedshop/mongodb';
|
|
2
|
-
import { CustomServices, Services } from './services/index.
|
|
3
|
-
import { Modules, ModuleOptions } from './modules.
|
|
4
|
-
import { BulkImporter, BulkImportHandler } from './bulk-importer/index.
|
|
5
|
-
import { IBaseAdapter } from '@unchainedshop/utils';
|
|
6
|
-
export * from './bulk-importer/index.
|
|
7
|
-
export * from './services/index.
|
|
8
|
-
export * from './directors/index.
|
|
9
|
-
export * from './factory/index.
|
|
1
|
+
import { type mongodb, type MigrationRepository, type ModuleInput } from '@unchainedshop/mongodb';
|
|
2
|
+
import { type CustomServices, type Services } from './services/index.ts';
|
|
3
|
+
import { type Modules, type ModuleOptions } from './modules.ts';
|
|
4
|
+
import { type BulkImporter, type BulkImportHandler } from './bulk-importer/index.ts';
|
|
5
|
+
import type { IBaseAdapter } from '@unchainedshop/utils';
|
|
6
|
+
export * from './bulk-importer/index.ts';
|
|
7
|
+
export * from './services/index.ts';
|
|
8
|
+
export * from './directors/index.ts';
|
|
9
|
+
export * from './factory/index.ts';
|
|
10
10
|
export interface UnchainedCoreOptions {
|
|
11
11
|
db: mongodb.Db;
|
|
12
12
|
migrationRepository: MigrationRepository<UnchainedCore>;
|
|
@@ -27,4 +27,3 @@ export interface UnchainedCore {
|
|
|
27
27
|
}
|
|
28
28
|
export declare const initCore: ({ db, migrationRepository, bulkImporter: bulkImporterOptions, modules: customModules, services: customServices, options, }: UnchainedCoreOptions) => Promise<UnchainedCore>;
|
|
29
29
|
export declare const getAllAdapters: () => IBaseAdapter[];
|
|
30
|
-
//# sourceMappingURL=core-index.d.ts.map
|
package/lib/core-index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
1
|
+
import {} from '@unchainedshop/mongodb';
|
|
2
|
+
import initServices, {} from "./services/index.js";
|
|
3
|
+
import initModules, {} from "./modules.js";
|
|
4
|
+
import createBulkImporterFactory, {} from "./bulk-importer/index.js";
|
|
5
|
+
import { WorkerDirector, DeliveryDirector, DeliveryPricingDirector, EnrollmentDirector, FilterDirector, OrderDiscountDirector, OrderPricingDirector, PaymentDirector, PaymentPricingDirector, ProductDiscountDirector, ProductPricingDirector, QuotationDirector, WarehousingDirector, } from "./directors/index.js";
|
|
6
|
+
export * from "./bulk-importer/index.js";
|
|
7
|
+
export * from "./services/index.js";
|
|
8
|
+
export * from "./directors/index.js";
|
|
9
|
+
export * from "./factory/index.js";
|
|
9
10
|
export const initCore = async ({ db, migrationRepository, bulkImporter: bulkImporterOptions = {}, modules: customModules = {}, services: customServices = {}, options = {}, }) => {
|
|
10
|
-
// Configure custom modules
|
|
11
11
|
const bulkImporter = createBulkImporterFactory(db, bulkImporterOptions);
|
|
12
12
|
const modules = await initModules({ db, migrationRepository, options }, customModules);
|
|
13
13
|
const services = initServices(modules, customServices);
|
|
@@ -34,4 +34,3 @@ export const getAllAdapters = () => {
|
|
|
34
34
|
const warehousing = WarehousingDirector.getAdapters();
|
|
35
35
|
return [].concat(worker, delivery, deliveryPricing, enrollment, filter, orderDiscount, orderPricing, payment, paymentPricing, productDiscount, productPricing, quotation, warehousing);
|
|
36
36
|
};
|
|
37
|
-
//# sourceMappingURL=core-index.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { IBaseAdapter } from '@unchainedshop/utils';
|
|
2
|
-
import { IPricingSheet } from './BasePricingSheet.
|
|
3
|
-
import { PricingCalculation } from '@unchainedshop/utils';
|
|
4
|
-
import { Order, OrderDiscount } from '@unchainedshop/core-orders';
|
|
5
|
-
import { Modules } from '../modules.
|
|
1
|
+
import { type IBaseAdapter } from '@unchainedshop/utils';
|
|
2
|
+
import type { IPricingSheet } from './BasePricingSheet.ts';
|
|
3
|
+
import type { PricingCalculation } from '@unchainedshop/utils';
|
|
4
|
+
import type { Order, OrderDiscount } from '@unchainedshop/core-orders';
|
|
5
|
+
import type { Modules } from '../modules.ts';
|
|
6
6
|
export interface DiscountContext {
|
|
7
7
|
code?: string;
|
|
8
8
|
orderDiscount?: OrderDiscount;
|
|
@@ -33,4 +33,3 @@ export interface DiscountAdapterActions<DiscountConfiguration> {
|
|
|
33
33
|
release: () => Promise<void>;
|
|
34
34
|
}
|
|
35
35
|
export declare const BaseDiscountAdapter: Omit<IDiscountAdapter<unknown>, 'key' | 'label' | 'version'>;
|
|
36
|
-
//# sourceMappingURL=BaseDiscountAdapter.d.ts.map
|
|
@@ -5,41 +5,24 @@ export const BaseDiscountAdapter = {
|
|
|
5
5
|
isManualAdditionAllowed: async () => {
|
|
6
6
|
return false;
|
|
7
7
|
},
|
|
8
|
-
// return true if a discount is allowed to get removed manually by a user
|
|
9
8
|
isManualRemovalAllowed: async () => {
|
|
10
9
|
return false;
|
|
11
10
|
},
|
|
12
11
|
actions: async () => ({
|
|
13
|
-
// return true if a discount is valid to be part of the order
|
|
14
|
-
// without input of a user. that could be a time based global discount
|
|
15
|
-
// like a 10% discount day
|
|
16
|
-
// if you return false, this discount will
|
|
17
|
-
// get removed from the order before any price calculation
|
|
18
|
-
// takes place.
|
|
19
12
|
isValidForSystemTriggering: async () => {
|
|
20
13
|
return false;
|
|
21
14
|
},
|
|
22
|
-
// return an arbitrary JSON serializable object with reservation data
|
|
23
|
-
// this method is called when a discount is added through a manual code and let's
|
|
24
|
-
// you manually deduct expendable discounts (coupon balances for ex.) before checkout
|
|
25
15
|
reserve: async () => {
|
|
26
16
|
return {};
|
|
27
17
|
},
|
|
28
|
-
// return void, allows you to free up any reservations in backend systems
|
|
29
18
|
release: async () => {
|
|
30
19
|
return;
|
|
31
20
|
},
|
|
32
|
-
// return true if a discount is valid to be part of the order.
|
|
33
|
-
// if you return false, this discount will
|
|
34
|
-
// get removed from the order before any price calculation
|
|
35
|
-
// takes place.
|
|
36
21
|
isValidForCodeTriggering: async () => {
|
|
37
22
|
return false;
|
|
38
23
|
},
|
|
39
|
-
// returns the appropriate discount context for a calculation adapter
|
|
40
24
|
discountForPricingAdapterKey() {
|
|
41
25
|
return null;
|
|
42
26
|
},
|
|
43
27
|
}),
|
|
44
28
|
};
|
|
45
|
-
//# sourceMappingURL=BaseDiscountAdapter.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IBaseDirector } from '@unchainedshop/utils';
|
|
2
|
-
import { DiscountContext, IDiscountAdapter } from './BaseDiscountAdapter.
|
|
3
|
-
import { Modules } from '../modules.
|
|
1
|
+
import { type IBaseDirector } from '@unchainedshop/utils';
|
|
2
|
+
import type { DiscountContext, IDiscountAdapter } from './BaseDiscountAdapter.ts';
|
|
3
|
+
import type { Modules } from '../modules.ts';
|
|
4
4
|
export type IDiscountDirector<DiscountConfiguration> = IBaseDirector<IDiscountAdapter<DiscountConfiguration>> & {
|
|
5
5
|
actions: (discountContext: DiscountContext, unchainedAPI: {
|
|
6
6
|
modules: Modules;
|
|
@@ -12,4 +12,3 @@ export type IDiscountDirector<DiscountConfiguration> = IBaseDirector<IDiscountAd
|
|
|
12
12
|
}>;
|
|
13
13
|
};
|
|
14
14
|
export declare const BaseDiscountDirector: <DiscountConfigurationType>(directorName: string) => IDiscountDirector<DiscountConfigurationType>;
|
|
15
|
-
//# sourceMappingURL=BaseDiscountDirector.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IPricingSheet } from './BasePricingSheet.
|
|
2
|
-
import { IBaseAdapter, PricingCalculation } from '@unchainedshop/utils';
|
|
3
|
-
import { Discount } from './BasePricingDirector.
|
|
4
|
-
import { Order, OrderDiscount } from '@unchainedshop/core-orders';
|
|
1
|
+
import type { IPricingSheet } from './BasePricingSheet.ts';
|
|
2
|
+
import { type IBaseAdapter, type PricingCalculation } from '@unchainedshop/utils';
|
|
3
|
+
import type { Discount } from './BasePricingDirector.ts';
|
|
4
|
+
import type { Order, OrderDiscount } from '@unchainedshop/core-orders';
|
|
5
5
|
interface IDiscountableItem {
|
|
6
6
|
_id: string;
|
|
7
7
|
orderId?: string;
|
|
@@ -31,4 +31,3 @@ export type IPricingAdapter<PricingAdapterContext extends BasePricingAdapterCont
|
|
|
31
31
|
};
|
|
32
32
|
export declare const BasePricingAdapter: <PricingAdapterContext extends BasePricingAdapterContext, Calculation extends PricingCalculation>() => IPricingAdapter<PricingAdapterContext, Calculation, IPricingSheet<Calculation>>;
|
|
33
33
|
export {};
|
|
34
|
-
//# sourceMappingURL=BasePricingAdapter.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IBaseDirector, PricingCalculation } from '@unchainedshop/utils';
|
|
2
|
-
import { BasePricingAdapterContext, BasePricingContext, IPricingAdapter } from './BasePricingAdapter.
|
|
3
|
-
import { IPricingSheet } from './BasePricingSheet.
|
|
4
|
-
import { Modules } from '../modules.
|
|
1
|
+
import { type IBaseDirector, type PricingCalculation } from '@unchainedshop/utils';
|
|
2
|
+
import type { BasePricingAdapterContext, BasePricingContext, IPricingAdapter } from './BasePricingAdapter.ts';
|
|
3
|
+
import type { IPricingSheet } from './BasePricingSheet.ts';
|
|
4
|
+
import type { Modules } from '../modules.ts';
|
|
5
5
|
export interface Discount<DiscountConfiguration> {
|
|
6
6
|
discountId: string;
|
|
7
7
|
configuration: DiscountConfiguration;
|
|
@@ -14,4 +14,3 @@ export type IPricingDirector<PricingContext extends BasePricingContext, Calculat
|
|
|
14
14
|
calculationSheet: (pricingContext: PricingContext, calculation: Calculation[]) => PricingAdapterSheet;
|
|
15
15
|
};
|
|
16
16
|
export declare const BasePricingDirector: <DirectorContext extends BasePricingContext, AdapterContext extends BasePricingAdapterContext, Calculation extends PricingCalculation, PricingAdapter extends IPricingAdapter<AdapterContext, Calculation, IPricingSheet<Calculation>>>(directorName: string) => IPricingDirector<DirectorContext, Calculation, AdapterContext, IPricingSheet<Calculation>, PricingAdapter>;
|
|
17
|
-
//# sourceMappingURL=BasePricingDirector.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseDirector } from '@unchainedshop/utils';
|
|
2
|
-
import { OrderDiscountDirector } from
|
|
2
|
+
import { OrderDiscountDirector } from "./OrderDiscountDirector.js";
|
|
3
3
|
import { createLogger } from '@unchainedshop/logger';
|
|
4
4
|
const logger = createLogger('unchained:core');
|
|
5
5
|
export const BasePricingDirector = (directorName) => {
|
|
@@ -27,10 +27,6 @@ export const BasePricingDirector = (directorName) => {
|
|
|
27
27
|
if (!resolvedCalculation)
|
|
28
28
|
return null;
|
|
29
29
|
const discounts = await Promise.all(context.discounts.map(async (orderDiscount) => {
|
|
30
|
-
// TODO: We shouldn't need to fetch this here, most probably we already have an order in context
|
|
31
|
-
// 1. it should propably be required to pass an order
|
|
32
|
-
// 2. we should pass the order in the pricing context or pricing adapter context
|
|
33
|
-
// 3. it can't be different orders for different discounts in the same calculation rebuild
|
|
34
30
|
const order = await unchainedAPI.modules.orders.findOrder({
|
|
35
31
|
orderId: orderDiscount.orderId,
|
|
36
32
|
});
|
|
@@ -71,4 +67,3 @@ export const BasePricingDirector = (directorName) => {
|
|
|
71
67
|
};
|
|
72
68
|
return director;
|
|
73
69
|
};
|
|
74
|
-
//# sourceMappingURL=BasePricingDirector.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PricingCalculation } from '@unchainedshop/utils';
|
|
1
|
+
import type { PricingCalculation } from '@unchainedshop/utils';
|
|
2
2
|
export interface PricingDiscount {
|
|
3
3
|
discountId: string;
|
|
4
4
|
amount: number;
|
|
@@ -43,4 +43,3 @@ export declare const resolveRatioAndTaxDivisorForPricingSheet: (pricing: IBasePr
|
|
|
43
43
|
ratio: number;
|
|
44
44
|
taxDivisor: number;
|
|
45
45
|
};
|
|
46
|
-
//# sourceMappingURL=BasePricingSheet.d.ts.map
|
|
@@ -18,17 +18,14 @@ export const BasePricingSheet = (params) => {
|
|
|
18
18
|
return 0;
|
|
19
19
|
},
|
|
20
20
|
gross() {
|
|
21
|
-
// Sum contains taxes, thus it's gross when just suming everything
|
|
22
21
|
return this.sum();
|
|
23
22
|
},
|
|
24
23
|
net() {
|
|
25
|
-
// Remove all taxes from gross to get net
|
|
26
24
|
return this.sum() - this.taxSum();
|
|
27
25
|
},
|
|
28
26
|
total({ category, useNetPrice, discountId } = { useNetPrice: false }) {
|
|
29
27
|
const amount = this.sum({ category, discountId });
|
|
30
28
|
const taxAmountForCategory = this.taxSum({ baseCategory: category, discountId });
|
|
31
|
-
// Sum does not contain taxes when filtering by category, it's net in that case and gross if there is no category
|
|
32
29
|
const netAmount = !category ? amount - taxAmountForCategory : amount;
|
|
33
30
|
return {
|
|
34
31
|
amount: Math.round(useNetPrice ? netAmount : netAmount + taxAmountForCategory),
|
|
@@ -71,4 +68,3 @@ export const resolveRatioAndTaxDivisorForPricingSheet = (pricing, total) => {
|
|
|
71
68
|
taxDivisor: gross / (gross - tax),
|
|
72
69
|
};
|
|
73
70
|
};
|
|
74
|
-
//# sourceMappingURL=BasePricingSheet.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Work } from '@unchainedshop/core-worker';
|
|
1
|
+
import type { Work } from '@unchainedshop/core-worker';
|
|
2
2
|
export interface IWorker<P extends {
|
|
3
3
|
workerId?: string;
|
|
4
4
|
}> {
|
|
@@ -27,4 +27,3 @@ interface WorkerParams {
|
|
|
27
27
|
}
|
|
28
28
|
export declare const BaseWorker: IWorker<WorkerParams>;
|
|
29
29
|
export {};
|
|
30
|
-
//# sourceMappingURL=BaseWorker.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import later from '@breejs/later';
|
|
2
|
-
import { WorkerDirector } from
|
|
2
|
+
import { WorkerDirector } from "./WorkerDirector.js";
|
|
3
3
|
export const BaseWorker = {
|
|
4
4
|
key: 'shop.unchained.worker.base',
|
|
5
5
|
label: 'Base worker. Do not use this directly.',
|
|
@@ -36,7 +36,7 @@ export const BaseWorker = {
|
|
|
36
36
|
return null;
|
|
37
37
|
}
|
|
38
38
|
const fixedSchedule = { ...workConfig.schedule };
|
|
39
|
-
fixedSchedule.schedules[0].s = [0];
|
|
39
|
+
fixedSchedule.schedules[0].s = [0];
|
|
40
40
|
const nextDate = later.schedule(fixedSchedule).next(1, referenceDate);
|
|
41
41
|
nextDate.setMilliseconds(0);
|
|
42
42
|
const workData = {
|
|
@@ -49,8 +49,6 @@ export const BaseWorker = {
|
|
|
49
49
|
};
|
|
50
50
|
if (workConfig.input) {
|
|
51
51
|
workData.input = (await workConfig.input(workData)) || {};
|
|
52
|
-
// A work input fn can skip auto scheduling a new record
|
|
53
|
-
// when it explicitly returns a falsish input instead of a dictionary
|
|
54
52
|
if (!workData.input)
|
|
55
53
|
return null;
|
|
56
54
|
}
|
|
@@ -76,4 +74,3 @@ export const BaseWorker = {
|
|
|
76
74
|
return workerActions;
|
|
77
75
|
},
|
|
78
76
|
};
|
|
79
|
-
//# sourceMappingURL=BaseWorker.js.map
|
|
@@ -5,13 +5,14 @@ import type { WarehousingProvider } from '@unchainedshop/core-warehousing';
|
|
|
5
5
|
import type { Work } from '@unchainedshop/core-worker';
|
|
6
6
|
import type { User } from '@unchainedshop/core-users';
|
|
7
7
|
import type { DeliveryConfiguration, DeliveryLocation, DeliveryProvider, DeliveryProviderType } from '@unchainedshop/core-delivery';
|
|
8
|
-
import type { Modules } from '../modules.
|
|
9
|
-
export declare
|
|
10
|
-
ADAPTER_NOT_FOUND
|
|
11
|
-
NOT_IMPLEMENTED
|
|
12
|
-
INCOMPLETE_CONFIGURATION
|
|
13
|
-
WRONG_CREDENTIALS
|
|
14
|
-
}
|
|
8
|
+
import type { Modules } from '../modules.ts';
|
|
9
|
+
export declare const DeliveryError: {
|
|
10
|
+
readonly ADAPTER_NOT_FOUND: "ADAPTER_NOT_FOUND";
|
|
11
|
+
readonly NOT_IMPLEMENTED: "NOT_IMPLEMENTED";
|
|
12
|
+
readonly INCOMPLETE_CONFIGURATION: "INCOMPLETE_CONFIGURATION";
|
|
13
|
+
readonly WRONG_CREDENTIALS: "WRONG_CREDENTIALS";
|
|
14
|
+
};
|
|
15
|
+
export type DeliveryError = (typeof DeliveryError)[keyof typeof DeliveryError];
|
|
15
16
|
export interface DeliveryAdapterActions {
|
|
16
17
|
configurationError: (transactionContext?: any) => DeliveryError | null;
|
|
17
18
|
estimatedDeliveryThroughput: (warehousingThroughputTime: number) => Promise<number | null>;
|
|
@@ -43,4 +44,3 @@ export type IDeliveryAdapter = IBaseAdapter & {
|
|
|
43
44
|
}) => DeliveryAdapterActions;
|
|
44
45
|
};
|
|
45
46
|
export declare const DeliveryAdapter: Omit<IDeliveryAdapter, 'key' | 'label' | 'version'>;
|
|
46
|
-
//# sourceMappingURL=DeliveryAdapter.d.ts.map
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { BaseAdapter } from '@unchainedshop/utils';
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
})(DeliveryError || (DeliveryError = {}));
|
|
2
|
+
export const DeliveryError = {
|
|
3
|
+
ADAPTER_NOT_FOUND: 'ADAPTER_NOT_FOUND',
|
|
4
|
+
NOT_IMPLEMENTED: 'NOT_IMPLEMENTED',
|
|
5
|
+
INCOMPLETE_CONFIGURATION: 'INCOMPLETE_CONFIGURATION',
|
|
6
|
+
WRONG_CREDENTIALS: 'WRONG_CREDENTIALS',
|
|
7
|
+
};
|
|
9
8
|
export const DeliveryAdapter = {
|
|
10
9
|
...BaseAdapter,
|
|
11
10
|
initialConfiguration: [],
|
|
@@ -24,16 +23,9 @@ export const DeliveryAdapter = {
|
|
|
24
23
|
return false;
|
|
25
24
|
},
|
|
26
25
|
isAutoReleaseAllowed: () => {
|
|
27
|
-
// if you return false here,
|
|
28
|
-
// the order will need manual confirmation before
|
|
29
|
-
// unchained will try to invoke send()
|
|
30
26
|
return true;
|
|
31
27
|
},
|
|
32
28
|
send: async () => {
|
|
33
|
-
// if you return true, the status will be changed to DELIVERED
|
|
34
|
-
// if you return false, the order delivery status stays the
|
|
35
|
-
// same but the order status might change
|
|
36
|
-
// if you throw an error, you cancel the whole checkout process
|
|
37
29
|
return false;
|
|
38
30
|
},
|
|
39
31
|
pickUpLocationById: async () => {
|
|
@@ -45,4 +37,3 @@ export const DeliveryAdapter = {
|
|
|
45
37
|
};
|
|
46
38
|
},
|
|
47
39
|
};
|
|
48
|
-
//# sourceMappingURL=DeliveryAdapter.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { IBaseDirector } from '@unchainedshop/utils';
|
|
2
|
-
import { DeliveryAdapterActions, DeliveryContext, IDeliveryAdapter } from './DeliveryAdapter.
|
|
3
|
-
import { DeliveryProvider } from '@unchainedshop/core-delivery';
|
|
4
|
-
import { Order } from '@unchainedshop/core-orders';
|
|
5
|
-
import { Modules } from '../modules.
|
|
1
|
+
import { type IBaseDirector } from '@unchainedshop/utils';
|
|
2
|
+
import { type DeliveryAdapterActions, type DeliveryContext, type IDeliveryAdapter } from './DeliveryAdapter.ts';
|
|
3
|
+
import type { DeliveryProvider } from '@unchainedshop/core-delivery';
|
|
4
|
+
import { type Order } from '@unchainedshop/core-orders';
|
|
5
|
+
import type { Modules } from '../modules.ts';
|
|
6
6
|
export type IDeliveryDirector = IBaseDirector<IDeliveryAdapter> & {
|
|
7
7
|
sendOrderDelivery: (order: Order, transactionContext: Record<string, any>, unchainedAPI: {
|
|
8
8
|
modules: Modules;
|
|
@@ -12,4 +12,3 @@ export type IDeliveryDirector = IBaseDirector<IDeliveryAdapter> & {
|
|
|
12
12
|
}) => Promise<DeliveryAdapterActions>;
|
|
13
13
|
};
|
|
14
14
|
export declare const DeliveryDirector: IDeliveryDirector;
|
|
15
|
-
//# sourceMappingURL=DeliveryDirector.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseDirector } from '@unchainedshop/utils';
|
|
2
|
-
import { DeliveryError, } from
|
|
2
|
+
import { DeliveryError, } from "./DeliveryAdapter.js";
|
|
3
3
|
import { OrderDeliveryStatus } from '@unchainedshop/core-orders';
|
|
4
4
|
import { createLogger } from '@unchainedshop/logger';
|
|
5
5
|
const logger = createLogger('unchained:core');
|
|
@@ -104,4 +104,3 @@ export const DeliveryDirector = {
|
|
|
104
104
|
}
|
|
105
105
|
},
|
|
106
106
|
};
|
|
107
|
-
//# sourceMappingURL=DeliveryDirector.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { BasePricingAdapterContext, IPricingAdapter, IPricingSheet } from '../directors/index.
|
|
2
|
-
import { DeliveryProvider } from '@unchainedshop/core-delivery';
|
|
3
|
-
import { PricingCalculation } from '@unchainedshop/utils';
|
|
4
|
-
import { OrderDelivery, OrderDiscount, Order } from '@unchainedshop/core-orders';
|
|
5
|
-
import { User } from '@unchainedshop/core-users';
|
|
6
|
-
import { Modules } from '../modules.
|
|
1
|
+
import { type BasePricingAdapterContext, type IPricingAdapter, type IPricingSheet } from '../directors/index.ts';
|
|
2
|
+
import type { DeliveryProvider } from '@unchainedshop/core-delivery';
|
|
3
|
+
import type { PricingCalculation } from '@unchainedshop/utils';
|
|
4
|
+
import type { OrderDelivery, OrderDiscount, Order } from '@unchainedshop/core-orders';
|
|
5
|
+
import type { User } from '@unchainedshop/core-users';
|
|
6
|
+
import type { Modules } from '../modules.ts';
|
|
7
7
|
export interface DeliveryPricingCalculation extends PricingCalculation {
|
|
8
8
|
discountId?: string;
|
|
9
9
|
isNetPrice: boolean;
|
|
@@ -46,4 +46,3 @@ export type IDeliveryPricingAdapter<DiscountConfiguration = unknown> = IPricingA
|
|
|
46
46
|
modules: Modules;
|
|
47
47
|
}, DeliveryPricingCalculation, IDeliveryPricingSheet, DiscountConfiguration>;
|
|
48
48
|
export declare const DeliveryPricingAdapter: IDeliveryPricingAdapter;
|
|
49
|
-
//# sourceMappingURL=DeliveryPricingAdapter.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DeliveryPricingSheet } from
|
|
2
|
-
import { BasePricingAdapter, } from
|
|
1
|
+
import { DeliveryPricingSheet } from "./DeliveryPricingSheet.js";
|
|
2
|
+
import { BasePricingAdapter, } from "../directors/index.js";
|
|
3
3
|
const basePricingAdapter = BasePricingAdapter();
|
|
4
4
|
export const DeliveryPricingAdapter = {
|
|
5
5
|
...basePricingAdapter,
|
|
@@ -22,4 +22,3 @@ export const DeliveryPricingAdapter = {
|
|
|
22
22
|
};
|
|
23
23
|
},
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=DeliveryPricingAdapter.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IPricingDirector } from '../directors/index.
|
|
2
|
-
import { DeliveryPricingAdapterContext, DeliveryPricingCalculation, IDeliveryPricingAdapter, IDeliveryPricingSheet } from './DeliveryPricingAdapter.
|
|
3
|
-
import { DeliveryProvider } from '@unchainedshop/core-delivery';
|
|
1
|
+
import { type IPricingDirector } from '../directors/index.ts';
|
|
2
|
+
import { type DeliveryPricingAdapterContext, type DeliveryPricingCalculation, type IDeliveryPricingAdapter, type IDeliveryPricingSheet } from './DeliveryPricingAdapter.ts';
|
|
3
|
+
import type { DeliveryProvider } from '@unchainedshop/core-delivery';
|
|
4
4
|
import type { Order } from '@unchainedshop/core-orders';
|
|
5
5
|
import type { User } from '@unchainedshop/core-users';
|
|
6
6
|
import type { OrderDelivery } from '@unchainedshop/core-orders';
|
|
@@ -17,4 +17,3 @@ export type DeliveryPricingContext = {
|
|
|
17
17
|
};
|
|
18
18
|
export type IDeliveryPricingDirector<DiscountConfiguration = unknown> = IPricingDirector<DeliveryPricingContext, DeliveryPricingCalculation, DeliveryPricingAdapterContext, IDeliveryPricingSheet, IDeliveryPricingAdapter<DiscountConfiguration>>;
|
|
19
19
|
export declare const DeliveryPricingDirector: IDeliveryPricingDirector<any>;
|
|
20
|
-
//# sourceMappingURL=DeliveryPricingDirector.d.ts.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { DeliveryPricingSheet, BasePricingDirector } from
|
|
1
|
+
import { DeliveryPricingSheet, BasePricingDirector } from "../directors/index.js";
|
|
2
|
+
import {} from "./DeliveryPricingAdapter.js";
|
|
2
3
|
const baseDirector = BasePricingDirector('DeliveryPricingDirector');
|
|
3
4
|
export const DeliveryPricingDirector = {
|
|
4
5
|
...baseDirector,
|
|
@@ -46,4 +47,3 @@ export const DeliveryPricingDirector = {
|
|
|
46
47
|
});
|
|
47
48
|
},
|
|
48
49
|
};
|
|
49
|
-
//# sourceMappingURL=DeliveryPricingDirector.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { PricingSheetParams } from '../directors/index.
|
|
2
|
-
import { DeliveryPricingCalculation, IDeliveryPricingSheet } from './DeliveryPricingAdapter.
|
|
3
|
-
export declare
|
|
4
|
-
Delivery
|
|
5
|
-
Discount
|
|
6
|
-
Tax
|
|
7
|
-
Item
|
|
8
|
-
}
|
|
1
|
+
import { type PricingSheetParams } from '../directors/index.ts';
|
|
2
|
+
import type { DeliveryPricingCalculation, IDeliveryPricingSheet } from './DeliveryPricingAdapter.ts';
|
|
3
|
+
export declare const DeliveryPricingRowCategory: {
|
|
4
|
+
readonly Delivery: "DELIVERY";
|
|
5
|
+
readonly Discount: "DISCOUNT";
|
|
6
|
+
readonly Tax: "TAX";
|
|
7
|
+
readonly Item: "ITEM";
|
|
8
|
+
};
|
|
9
|
+
export type DeliveryPricingRowCategory = (typeof DeliveryPricingRowCategory)[keyof typeof DeliveryPricingRowCategory];
|
|
9
10
|
export declare const DeliveryPricingSheet: (params: PricingSheetParams<DeliveryPricingCalculation>) => IDeliveryPricingSheet;
|
|
10
|
-
//# sourceMappingURL=DeliveryPricingSheet.d.ts.map
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { BasePricingSheet } from
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
})(DeliveryPricingRowCategory || (DeliveryPricingRowCategory = {}));
|
|
1
|
+
import { BasePricingSheet, } from "../directors/index.js";
|
|
2
|
+
export const DeliveryPricingRowCategory = {
|
|
3
|
+
Delivery: 'DELIVERY',
|
|
4
|
+
Discount: 'DISCOUNT',
|
|
5
|
+
Tax: 'TAX',
|
|
6
|
+
Item: 'ITEM',
|
|
7
|
+
};
|
|
9
8
|
export const DeliveryPricingSheet = (params) => {
|
|
10
9
|
const basePricingSheet = BasePricingSheet(params);
|
|
11
10
|
const pricingSheet = {
|
|
@@ -73,4 +72,3 @@ export const DeliveryPricingSheet = (params) => {
|
|
|
73
72
|
};
|
|
74
73
|
return pricingSheet;
|
|
75
74
|
};
|
|
76
|
-
//# sourceMappingURL=DeliveryPricingSheet.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IBaseAdapter } from '@unchainedshop/utils';
|
|
2
|
-
import { Enrollment, EnrollmentOrderPositionTemplate, EnrollmentPeriod, EnrollmentPlan } from '@unchainedshop/core-enrollments';
|
|
1
|
+
import { type IBaseAdapter } from '@unchainedshop/utils';
|
|
2
|
+
import { type Enrollment, type EnrollmentOrderPositionTemplate, type EnrollmentPeriod, type EnrollmentPlan } from '@unchainedshop/core-enrollments';
|
|
3
3
|
import type { Product, ProductPlan } from '@unchainedshop/core-products';
|
|
4
4
|
import type { OrderPosition } from '@unchainedshop/core-orders';
|
|
5
5
|
export interface EnrollmentContext {
|
|
@@ -27,4 +27,3 @@ export declare const periodForReferenceDate: (referenceDate: Date, intervalCount
|
|
|
27
27
|
end: any;
|
|
28
28
|
};
|
|
29
29
|
export declare const EnrollmentAdapter: Omit<IEnrollmentAdapter, 'key' | 'label' | 'version'>;
|
|
30
|
-
//# sourceMappingURL=EnrollmentAdapter.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { IBaseDirector } from '@unchainedshop/utils';
|
|
2
|
-
import { EnrollmentAdapterActions, EnrollmentContext, IEnrollmentAdapter } from './EnrollmentAdapter.
|
|
1
|
+
import { type IBaseDirector } from '@unchainedshop/utils';
|
|
2
|
+
import type { EnrollmentAdapterActions, EnrollmentContext, IEnrollmentAdapter } from './EnrollmentAdapter.ts';
|
|
3
3
|
import type { OrderPosition } from '@unchainedshop/core-orders';
|
|
4
4
|
import type { Product } from '@unchainedshop/core-products';
|
|
5
|
-
import { Enrollment } from '@unchainedshop/core-enrollments';
|
|
5
|
+
import type { Enrollment } from '@unchainedshop/core-enrollments';
|
|
6
6
|
export type IEnrollmentDirector = IBaseDirector<IEnrollmentAdapter> & {
|
|
7
7
|
transformOrderItemToEnrollment: (item: {
|
|
8
8
|
orderPosition: OrderPosition;
|
|
@@ -11,4 +11,3 @@ export type IEnrollmentDirector = IBaseDirector<IEnrollmentAdapter> & {
|
|
|
11
11
|
actions: (enrollmentContext: EnrollmentContext, unchainedAPI: any) => Promise<EnrollmentAdapterActions>;
|
|
12
12
|
};
|
|
13
13
|
export declare const EnrollmentDirector: IEnrollmentDirector;
|
|
14
|
-
//# sourceMappingURL=EnrollmentDirector.d.ts.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { IWorker } from './BaseWorker.
|
|
1
|
+
import { type IWorker } from './BaseWorker.ts';
|
|
2
2
|
export interface EventListenerWorkerParams {
|
|
3
3
|
workerId?: string;
|
|
4
4
|
}
|
|
5
5
|
export declare const EventListenerWorker: IWorker<EventListenerWorkerParams>;
|
|
6
|
-
//# sourceMappingURL=EventListenerWorker.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { subscribe } from '@unchainedshop/events';
|
|
2
|
-
import { BaseWorker } from
|
|
2
|
+
import { BaseWorker } from "./BaseWorker.js";
|
|
3
3
|
import { WorkerEventTypes } from '@unchainedshop/core-worker';
|
|
4
4
|
import { setTimeout } from 'node:timers/promises';
|
|
5
5
|
import { createLogger } from '@unchainedshop/logger';
|
|
@@ -7,26 +7,20 @@ const logger = createLogger('unchained:worker:event-listener');
|
|
|
7
7
|
function debounce(func, wait) {
|
|
8
8
|
let abortController = null;
|
|
9
9
|
const debounced = (async (...args) => {
|
|
10
|
-
// Cancel any pending execution
|
|
11
10
|
if (abortController) {
|
|
12
11
|
abortController.abort();
|
|
13
12
|
}
|
|
14
|
-
// Create new abort controller for this execution
|
|
15
13
|
abortController = new AbortController();
|
|
16
14
|
try {
|
|
17
|
-
// Wait for the debounce period
|
|
18
15
|
await setTimeout(wait, undefined, { signal: abortController.signal });
|
|
19
|
-
// If we reach here, the timeout completed without being aborted
|
|
20
16
|
const result = await func(...args);
|
|
21
17
|
abortController = null;
|
|
22
18
|
return result;
|
|
23
19
|
}
|
|
24
20
|
catch (error) {
|
|
25
|
-
// If the operation was aborted, don't execute the function
|
|
26
21
|
if (error.name === 'AbortError') {
|
|
27
22
|
return;
|
|
28
23
|
}
|
|
29
|
-
// Re-throw any other errors
|
|
30
24
|
throw error;
|
|
31
25
|
}
|
|
32
26
|
});
|
|
@@ -46,16 +40,14 @@ export const EventListenerWorker = {
|
|
|
46
40
|
type: 'EVENT_LISTENER',
|
|
47
41
|
actions: ({ workerId }, unchainedAPI) => {
|
|
48
42
|
const baseWorkerActions = BaseWorker.actions({ workerId, worker: EventListenerWorker }, unchainedAPI);
|
|
49
|
-
// Debounce in the event of many work queue events conflicting with each other
|
|
50
43
|
const processWorkQueue = debounce(async () => {
|
|
51
44
|
try {
|
|
52
45
|
await baseWorkerActions.process({
|
|
53
|
-
maxWorkItemCount: 1,
|
|
46
|
+
maxWorkItemCount: 1,
|
|
54
47
|
referenceDate: EventListenerWorker.getFloorDate(),
|
|
55
48
|
});
|
|
56
49
|
}
|
|
57
50
|
catch (error) {
|
|
58
|
-
// Log error but don't crash the worker
|
|
59
51
|
logger.error(error);
|
|
60
52
|
}
|
|
61
53
|
}, 300);
|
|
@@ -75,4 +67,3 @@ export const EventListenerWorker = {
|
|
|
75
67
|
};
|
|
76
68
|
},
|
|
77
69
|
};
|
|
78
|
-
//# sourceMappingURL=EventListenerWorker.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Work, WorkData } from '@unchainedshop/core-worker';
|
|
1
|
+
import { type Work, type WorkData } from '@unchainedshop/core-worker';
|
|
2
2
|
export interface FailedReschedulerParams {
|
|
3
3
|
transformRetry?: (workData: WorkData, lastFailedWork: Work) => Promise<WorkData | null>;
|
|
4
4
|
}
|
|
@@ -12,4 +12,3 @@ export interface IScheduler<P> {
|
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
export declare const FailedRescheduler: IScheduler<FailedReschedulerParams>;
|
|
15
|
-
//# sourceMappingURL=FailedRescheduler.d.ts.map
|