@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,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
|
|
@@ -10,7 +10,6 @@ export const FailedRescheduler = {
|
|
|
10
10
|
if (!work.success && work.retries > 0) {
|
|
11
11
|
const now = new Date();
|
|
12
12
|
const workDelayMs = work.scheduled.getTime() - work.created.getTime();
|
|
13
|
-
// In short: Double the delay of the old work or delay for 5 seconds
|
|
14
13
|
const scheduled = workDelayMs > 1000
|
|
15
14
|
? new Date(now.getTime() + workDelayMs * 2)
|
|
16
15
|
: new Date(now.setSeconds(now.getSeconds() + 5));
|
|
@@ -32,9 +31,7 @@ export const FailedRescheduler = {
|
|
|
32
31
|
subscribe(WorkerEventTypes.FINISHED, handleFinishedWork);
|
|
33
32
|
},
|
|
34
33
|
stop() {
|
|
35
|
-
/* */
|
|
36
34
|
},
|
|
37
35
|
};
|
|
38
36
|
},
|
|
39
37
|
};
|
|
40
|
-
//# sourceMappingURL=FailedRescheduler.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Assortment } from '@unchainedshop/core-assortments';
|
|
1
|
+
import type { Assortment } from '@unchainedshop/core-assortments';
|
|
2
2
|
import { mongodb } from '@unchainedshop/mongodb';
|
|
3
|
-
import { IBaseAdapter } from '@unchainedshop/utils';
|
|
4
|
-
import { Product } from '@unchainedshop/core-products';
|
|
5
|
-
import { Filter, SearchConfiguration, SearchQuery } from '@unchainedshop/core-filters';
|
|
6
|
-
import { Modules } from '../modules.
|
|
3
|
+
import { type IBaseAdapter } from '@unchainedshop/utils';
|
|
4
|
+
import type { Product } from '@unchainedshop/core-products';
|
|
5
|
+
import type { Filter, SearchConfiguration, SearchQuery } from '@unchainedshop/core-filters';
|
|
6
|
+
import type { Modules } from '../modules.ts';
|
|
7
7
|
export interface FilterInputText {
|
|
8
8
|
locale: string;
|
|
9
9
|
title: string;
|
|
@@ -46,4 +46,3 @@ export type IFilterAdapter = IBaseAdapter & {
|
|
|
46
46
|
}) => FilterAdapterActions;
|
|
47
47
|
};
|
|
48
48
|
export declare const FilterAdapter: Omit<IFilterAdapter, 'key' | 'label' | 'version'>;
|
|
49
|
-
//# sourceMappingURL=FilterAdapter.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { mongodb } from '@unchainedshop/mongodb';
|
|
1
2
|
import { BaseAdapter } from '@unchainedshop/utils';
|
|
2
3
|
export const FilterAdapter = {
|
|
3
4
|
...BaseAdapter,
|
|
4
5
|
orderIndex: 0,
|
|
5
6
|
actions: () => {
|
|
6
7
|
return {
|
|
7
|
-
// This function is called to check if a filter actually matches a certain productId
|
|
8
8
|
aggregateProductIds: ({ productIds }) => {
|
|
9
9
|
return productIds;
|
|
10
10
|
},
|
|
@@ -17,16 +17,12 @@ export const FilterAdapter = {
|
|
|
17
17
|
transformSortStage: async (lastStage) => {
|
|
18
18
|
return lastStage;
|
|
19
19
|
},
|
|
20
|
-
// return a selector that is applied to Products.find to find relevant products
|
|
21
|
-
// if no key is provided, it expects either null for all products or a list of products that are relevant
|
|
22
20
|
transformProductSelector: async (lastSelector) => {
|
|
23
21
|
return lastSelector;
|
|
24
22
|
},
|
|
25
|
-
// return a selector that is applied to Filters.find to find relevant filters
|
|
26
23
|
transformFilterSelector: async (lastSelector) => {
|
|
27
24
|
return lastSelector;
|
|
28
25
|
},
|
|
29
26
|
};
|
|
30
27
|
},
|
|
31
28
|
};
|
|
32
|
-
//# sourceMappingURL=FilterAdapter.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IBaseDirector } from '@unchainedshop/utils';
|
|
2
|
-
import { FilterAdapterActions, FilterContext, IFilterAdapter } from './FilterAdapter.
|
|
3
|
-
import { Filter, SearchConfiguration, SearchFilterQuery, SearchQuery } from '@unchainedshop/core-filters';
|
|
4
|
-
import { Modules } from '../modules.
|
|
1
|
+
import { type IBaseDirector } from '@unchainedshop/utils';
|
|
2
|
+
import type { FilterAdapterActions, FilterContext, IFilterAdapter } from './FilterAdapter.ts';
|
|
3
|
+
import { type Filter, type SearchConfiguration, type SearchFilterQuery, type SearchQuery } from '@unchainedshop/core-filters';
|
|
4
|
+
import type { Modules } from '../modules.ts';
|
|
5
5
|
export declare const parseQueryArray: (query?: SearchFilterQuery) => Record<string, string[]>;
|
|
6
6
|
export type IFilterDirector = IBaseDirector<IFilterAdapter> & {
|
|
7
7
|
actions: (filterContext: FilterContext, unchainedAPI: {
|
|
@@ -41,4 +41,3 @@ export type IFilterDirector = IBaseDirector<IFilterAdapter> & {
|
|
|
41
41
|
}) => Promise<string[]>;
|
|
42
42
|
};
|
|
43
43
|
export declare const FilterDirector: IFilterDirector;
|
|
44
|
-
//# sourceMappingURL=FilterDirector.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { mongodb } from '@unchainedshop/mongodb';
|
|
1
2
|
import { BaseDirector } from '@unchainedshop/utils';
|
|
2
3
|
import { filtersSettings, FilterType, } from '@unchainedshop/core-filters';
|
|
3
4
|
export const parseQueryArray = (query) => (query || []).reduce((accumulator, { key, value }) => ({
|
|
@@ -128,21 +129,12 @@ export const FilterDirector = {
|
|
|
128
129
|
async filterFacets(filter, params, unchainedAPI) {
|
|
129
130
|
const { allProductIdSet, searchQuery, forceLiveCollection, otherFilters } = params;
|
|
130
131
|
const filterQueryParsed = parseQueryArray(searchQuery.filterQuery);
|
|
131
|
-
// The examinedProductIdSet is a set of product id's that:
|
|
132
|
-
// - Fit this filter generally
|
|
133
|
-
// - Are part of the preselected product id array
|
|
134
132
|
const filteredProductIds = await this.filterProductIds(filter, {
|
|
135
133
|
values: [undefined],
|
|
136
134
|
forceLiveCollection,
|
|
137
135
|
}, unchainedAPI);
|
|
138
|
-
// Optimize: Create Set from allProductIds, iterate through smaller filteredProductIds
|
|
139
136
|
const examinedProductIdSet = allProductIdSet.intersection(filteredProductIds);
|
|
140
137
|
const values = filterQueryParsed[filter.key];
|
|
141
|
-
// The filteredProductIds is a set of product id's that:
|
|
142
|
-
// - Are filtered by all other filters
|
|
143
|
-
// - Are filtered by the currently selected value of this filter
|
|
144
|
-
// or if there is no currently selected value:
|
|
145
|
-
// - Is the same like examinedProductIdSet
|
|
146
138
|
const filteredByOtherFiltersSet = await otherFilters
|
|
147
139
|
.filter((otherFilter) => otherFilter.key !== filter.key)
|
|
148
140
|
.reduce(async (productIdSetPromise, otherFilter) => {
|
|
@@ -176,4 +168,3 @@ export const FilterDirector = {
|
|
|
176
168
|
await filtersSettings.setCachedProductIds(filter._id, productIds, productIdMap);
|
|
177
169
|
},
|
|
178
170
|
};
|
|
179
|
-
//# sourceMappingURL=FilterDirector.js.map
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { ScheduleData } from '
|
|
2
|
-
import { IWorker } from './BaseWorker.
|
|
1
|
+
import { type ScheduleData } from '../utils/schedule.ts';
|
|
2
|
+
import { type IWorker } from './BaseWorker.ts';
|
|
3
3
|
export interface IntervalWorkerParams {
|
|
4
4
|
workerId?: string;
|
|
5
5
|
batchCount?: number;
|
|
6
6
|
schedule?: ScheduleData;
|
|
7
7
|
}
|
|
8
|
-
export declare const scheduleToInterval: (
|
|
8
|
+
export declare const scheduleToInterval: (scheduleData: ScheduleData) => number;
|
|
9
9
|
export declare const IntervalWorker: IWorker<IntervalWorkerParams>;
|
|
10
|
-
//# sourceMappingURL=IntervalWorker.d.ts.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { BaseWorker } from
|
|
1
|
+
import schedule, {} from "../utils/schedule.js";
|
|
2
|
+
import { BaseWorker } from "./BaseWorker.js";
|
|
3
3
|
import { createLogger } from '@unchainedshop/logger';
|
|
4
4
|
const { NODE_ENV } = process.env;
|
|
5
5
|
const logger = createLogger('unchained:worker:interval');
|
|
6
|
-
const defaultSchedule =
|
|
7
|
-
export const scheduleToInterval = (
|
|
6
|
+
const defaultSchedule = schedule.parse.text(NODE_ENV !== 'production' ? 'every 2 seconds' : 'every 30 seconds');
|
|
7
|
+
export const scheduleToInterval = (scheduleData) => {
|
|
8
8
|
const referenceDate = new Date(1000);
|
|
9
|
-
const nextDates =
|
|
9
|
+
const nextDates = schedule.schedule(scheduleData).next(2, referenceDate);
|
|
10
10
|
if (!nextDates || nextDates.length < 2) {
|
|
11
11
|
throw new Error('Schedule must produce at least 2 consecutive dates');
|
|
12
12
|
}
|
|
13
13
|
const [one, two] = nextDates;
|
|
14
14
|
const diff = new Date(two).getTime() - new Date(one).getTime();
|
|
15
|
-
return Math.min(1000 * 60 * 60, diff);
|
|
15
|
+
return Math.min(1000 * 60 * 60, diff);
|
|
16
16
|
};
|
|
17
17
|
export const IntervalWorker = {
|
|
18
18
|
...BaseWorker,
|
|
@@ -27,7 +27,6 @@ export const IntervalWorker = {
|
|
|
27
27
|
return {
|
|
28
28
|
...baseWorkerActions,
|
|
29
29
|
start() {
|
|
30
|
-
// Prevent multiple intervals from running
|
|
31
30
|
if (intervalHandle) {
|
|
32
31
|
return;
|
|
33
32
|
}
|
|
@@ -52,4 +51,3 @@ export const IntervalWorker = {
|
|
|
52
51
|
};
|
|
53
52
|
},
|
|
54
53
|
};
|
|
55
|
-
//# sourceMappingURL=IntervalWorker.js.map
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { IDiscountAdapter, OrderDiscountConfiguration } from '../directors/index.
|
|
1
|
+
import { type IDiscountAdapter, type OrderDiscountConfiguration } from '../directors/index.ts';
|
|
2
2
|
export declare const OrderDiscountAdapter: Omit<IDiscountAdapter<OrderDiscountConfiguration>, "key" | "label" | "version">;
|
|
3
|
-
//# sourceMappingURL=OrderDiscountAdapter.d.ts.map
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { OrderDiscountConfiguration } from './OrderDiscountConfiguration.
|
|
2
|
-
export declare const OrderDiscountDirector: import("./BaseDiscountDirector.
|
|
3
|
-
//# sourceMappingURL=OrderDiscountDirector.d.ts.map
|
|
1
|
+
import type { OrderDiscountConfiguration } from './OrderDiscountConfiguration.ts';
|
|
2
|
+
export declare const OrderDiscountDirector: import("./BaseDiscountDirector.ts").IDiscountDirector<OrderDiscountConfiguration>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IOrderPricingSheet, OrderPricingCalculation, IPricingAdapter, BasePricingAdapterContext } from '../directors/index.
|
|
2
|
-
import { Order, OrderDelivery, OrderDiscount, OrderPayment, OrderPosition } from '@unchainedshop/core-orders';
|
|
3
|
-
import { User } from '@unchainedshop/core-users';
|
|
4
|
-
import { Modules } from '../modules.
|
|
1
|
+
import { type IOrderPricingSheet, type OrderPricingCalculation, type IPricingAdapter, type BasePricingAdapterContext } from '../directors/index.ts';
|
|
2
|
+
import type { Order, OrderDelivery, OrderDiscount, OrderPayment, OrderPosition } from '@unchainedshop/core-orders';
|
|
3
|
+
import type { User } from '@unchainedshop/core-users';
|
|
4
|
+
import type { Modules } from '../modules.ts';
|
|
5
5
|
export interface OrderPricingAdapterContext extends BasePricingAdapterContext {
|
|
6
6
|
currencyCode?: string;
|
|
7
7
|
discounts: OrderDiscount[];
|
|
@@ -15,4 +15,3 @@ export type IOrderPricingAdapter<DiscountConfiguration = unknown> = IPricingAdap
|
|
|
15
15
|
modules: Modules;
|
|
16
16
|
}, OrderPricingCalculation, IOrderPricingSheet, DiscountConfiguration>;
|
|
17
17
|
export declare const OrderPricingAdapter: IOrderPricingAdapter;
|
|
18
|
-
//# sourceMappingURL=OrderPricingAdapter.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OrderPricingSheet, BasePricingAdapter, } from
|
|
1
|
+
import { OrderPricingSheet, BasePricingAdapter, } from "../directors/index.js";
|
|
2
2
|
const basePricingAdapter = BasePricingAdapter();
|
|
3
3
|
export const OrderPricingAdapter = {
|
|
4
4
|
...basePricingAdapter,
|
|
@@ -21,4 +21,3 @@ export const OrderPricingAdapter = {
|
|
|
21
21
|
};
|
|
22
22
|
},
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=OrderPricingAdapter.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IOrderPricingSheet, OrderPricingCalculation, IOrderPricingAdapter, OrderPricingAdapterContext, PricingDiscount, IPricingDirector } from '../directors/index.
|
|
2
|
-
import { Order, OrderDelivery, OrderPayment, OrderPosition } from '@unchainedshop/core-orders';
|
|
1
|
+
import { type IOrderPricingSheet, type OrderPricingCalculation, type IOrderPricingAdapter, type OrderPricingAdapterContext, type PricingDiscount, type IPricingDirector } from '../directors/index.ts';
|
|
2
|
+
import type { Order, OrderDelivery, OrderPayment, OrderPosition } from '@unchainedshop/core-orders';
|
|
3
3
|
export interface OrderPricingContext {
|
|
4
4
|
currencyCode: string;
|
|
5
5
|
order: Order;
|
|
@@ -15,4 +15,3 @@ export type OrderPricingDiscount = PricingDiscount & {
|
|
|
15
15
|
};
|
|
16
16
|
export type IOrderPricingDirector<DiscountConfiguration = unknown> = IPricingDirector<OrderPricingContext, OrderPricingCalculation, OrderPricingAdapterContext, IOrderPricingSheet, IOrderPricingAdapter<DiscountConfiguration>>;
|
|
17
17
|
export declare const OrderPricingDirector: IOrderPricingDirector<any>;
|
|
18
|
-
//# sourceMappingURL=OrderPricingDirector.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OrderPricingSheet, BasePricingDirector, } from
|
|
1
|
+
import { OrderPricingSheet, BasePricingDirector, } from "../directors/index.js";
|
|
2
2
|
const baseDirector = BasePricingDirector('OrderPricingDirector');
|
|
3
3
|
export const OrderPricingDirector = {
|
|
4
4
|
...baseDirector,
|
|
@@ -28,4 +28,3 @@ export const OrderPricingDirector = {
|
|
|
28
28
|
});
|
|
29
29
|
},
|
|
30
30
|
};
|
|
31
|
-
//# sourceMappingURL=OrderPricingDirector.js.map
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { PricingCalculation } from '@unchainedshop/utils';
|
|
2
|
-
import { IPricingSheet, PricingSheetParams } from '../directors/index.
|
|
1
|
+
import type { PricingCalculation } from '@unchainedshop/utils';
|
|
2
|
+
import { type IPricingSheet, type PricingSheetParams } from '../directors/index.ts';
|
|
3
3
|
export interface OrderPricingCalculation extends PricingCalculation {
|
|
4
4
|
discountId?: string;
|
|
5
5
|
}
|
|
6
|
-
export declare
|
|
7
|
-
Items
|
|
8
|
-
Discounts
|
|
9
|
-
Taxes
|
|
10
|
-
Delivery
|
|
11
|
-
Payment
|
|
12
|
-
}
|
|
6
|
+
export declare const OrderPricingRowCategory: {
|
|
7
|
+
readonly Items: "ITEMS";
|
|
8
|
+
readonly Discounts: "DISCOUNTS";
|
|
9
|
+
readonly Taxes: "TAXES";
|
|
10
|
+
readonly Delivery: "DELIVERY";
|
|
11
|
+
readonly Payment: "PAYMENT";
|
|
12
|
+
};
|
|
13
|
+
export type OrderPricingRowCategory = (typeof OrderPricingRowCategory)[keyof typeof OrderPricingRowCategory];
|
|
13
14
|
export interface IOrderPricingSheet extends IPricingSheet<OrderPricingCalculation> {
|
|
14
15
|
addDelivery: (params: {
|
|
15
16
|
amount: number;
|
|
@@ -34,4 +35,3 @@ export interface IOrderPricingSheet extends IPricingSheet<OrderPricingCalculatio
|
|
|
34
35
|
}) => void;
|
|
35
36
|
}
|
|
36
37
|
export declare const OrderPricingSheet: (params: PricingSheetParams<OrderPricingCalculation>) => IOrderPricingSheet;
|
|
37
|
-
//# sourceMappingURL=OrderPricingSheet.d.ts.map
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { BasePricingSheet, } from
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})(OrderPricingRowCategory || (OrderPricingRowCategory = {}));
|
|
1
|
+
import { BasePricingSheet, } from "../directors/index.js";
|
|
2
|
+
export const OrderPricingRowCategory = {
|
|
3
|
+
Items: 'ITEMS',
|
|
4
|
+
Discounts: 'DISCOUNTS',
|
|
5
|
+
Taxes: 'TAXES',
|
|
6
|
+
Delivery: 'DELIVERY',
|
|
7
|
+
Payment: 'PAYMENT',
|
|
8
|
+
};
|
|
10
9
|
export const OrderPricingSheet = (params) => {
|
|
11
10
|
const basePricingSheet = BasePricingSheet(params);
|
|
12
11
|
const addTaxIfAvailabile = (category, taxAmount, meta, discountId) => {
|
|
@@ -62,7 +61,6 @@ export const OrderPricingSheet = (params) => {
|
|
|
62
61
|
});
|
|
63
62
|
},
|
|
64
63
|
gross() {
|
|
65
|
-
// tax is included 2 times, this is only true for Order Pricing!
|
|
66
64
|
return basePricingSheet.sum() - this.taxSum();
|
|
67
65
|
},
|
|
68
66
|
net() {
|
|
@@ -71,7 +69,6 @@ export const OrderPricingSheet = (params) => {
|
|
|
71
69
|
total({ category, useNetPrice, discountId } = { useNetPrice: false }) {
|
|
72
70
|
const taxAmount = this.taxSum({ baseCategory: category, discountId });
|
|
73
71
|
const amount = this.sum({ category, discountId }) - taxAmount;
|
|
74
|
-
// Sum does not contain taxes when filtering by category, it's net in that case and gross if there is no category
|
|
75
72
|
const netAmount = !category ? amount - taxAmount : amount;
|
|
76
73
|
return {
|
|
77
74
|
amount: Math.round(useNetPrice ? netAmount : netAmount + taxAmount),
|
|
@@ -106,4 +103,3 @@ export const OrderPricingSheet = (params) => {
|
|
|
106
103
|
};
|
|
107
104
|
return pricingSheet;
|
|
108
105
|
};
|
|
109
|
-
//# sourceMappingURL=OrderPricingSheet.js.map
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import type { IBaseAdapter } from '@unchainedshop/utils';
|
|
2
2
|
import type { Order, OrderPayment } from '@unchainedshop/core-orders';
|
|
3
3
|
import type { PaymentConfiguration, PaymentProvider, PaymentProviderType } from '@unchainedshop/core-payment';
|
|
4
|
-
import type { Modules } from '../modules.
|
|
5
|
-
export declare
|
|
6
|
-
ADAPTER_NOT_FOUND
|
|
7
|
-
NOT_IMPLEMENTED
|
|
8
|
-
INCOMPLETE_CONFIGURATION
|
|
9
|
-
WRONG_CREDENTIALS
|
|
10
|
-
}
|
|
4
|
+
import type { Modules } from '../modules.ts';
|
|
5
|
+
export declare const PaymentError: {
|
|
6
|
+
readonly ADAPTER_NOT_FOUND: "ADAPTER_NOT_FOUND";
|
|
7
|
+
readonly NOT_IMPLEMENTED: "NOT_IMPLEMENTED";
|
|
8
|
+
readonly INCOMPLETE_CONFIGURATION: "INCOMPLETE_CONFIGURATION";
|
|
9
|
+
readonly WRONG_CREDENTIALS: "WRONG_CREDENTIALS";
|
|
10
|
+
};
|
|
11
|
+
export type PaymentError = (typeof PaymentError)[keyof typeof PaymentError];
|
|
11
12
|
export interface ChargeResult {
|
|
12
13
|
transactionId?: string;
|
|
13
14
|
[key: string]: any;
|
|
@@ -46,4 +47,3 @@ export type IPaymentAdapter = IBaseAdapter & {
|
|
|
46
47
|
}) => IPaymentActions;
|
|
47
48
|
};
|
|
48
49
|
export declare const PaymentAdapter: Omit<IPaymentAdapter, 'key' | 'label' | 'version'>;
|
|
49
|
-
//# sourceMappingURL=PaymentAdapter.d.ts.map
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { BaseAdapter } from '@unchainedshop/utils';
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
})(PaymentError || (PaymentError = {}));
|
|
2
|
+
export const PaymentError = {
|
|
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 PaymentAdapter = {
|
|
10
9
|
...BaseAdapter,
|
|
11
10
|
initialConfiguration: [],
|
|
@@ -24,10 +23,6 @@ export const PaymentAdapter = {
|
|
|
24
23
|
return false;
|
|
25
24
|
},
|
|
26
25
|
charge: async () => {
|
|
27
|
-
// if you return true, the status will be changed to PAID
|
|
28
|
-
// if you return false, the order payment status stays the
|
|
29
|
-
// same but the order status might change
|
|
30
|
-
// if you throw an error, you cancel the checkout process
|
|
31
26
|
return false;
|
|
32
27
|
},
|
|
33
28
|
register: async () => {
|
|
@@ -50,4 +45,3 @@ export const PaymentAdapter = {
|
|
|
50
45
|
};
|
|
51
46
|
},
|
|
52
47
|
};
|
|
53
|
-
//# sourceMappingURL=PaymentAdapter.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IBaseDirector } from '@unchainedshop/utils';
|
|
2
|
-
import { IPaymentActions, IPaymentAdapter, PaymentContext } from './PaymentAdapter.
|
|
3
|
-
import { PaymentProvider } from '@unchainedshop/core-payment';
|
|
4
|
-
import { Order, OrderPayment } from '@unchainedshop/core-orders';
|
|
1
|
+
import { type IBaseDirector } from '@unchainedshop/utils';
|
|
2
|
+
import { type IPaymentActions, type IPaymentAdapter, type PaymentContext } from './PaymentAdapter.ts';
|
|
3
|
+
import type { PaymentProvider } from '@unchainedshop/core-payment';
|
|
4
|
+
import { type Order, type OrderPayment } from '@unchainedshop/core-orders';
|
|
5
5
|
export type IPaymentDirector = IBaseDirector<IPaymentAdapter> & {
|
|
6
6
|
confirmOrderPayment: (order: Order, paymentContext: {
|
|
7
7
|
transactionContext: any;
|
|
@@ -18,4 +18,3 @@ export type IPaymentDirector = IBaseDirector<IPaymentAdapter> & {
|
|
|
18
18
|
actions: (paymentProvider: PaymentProvider, paymentContext: PaymentContext, unchainedAPI: any) => Promise<IPaymentActions>;
|
|
19
19
|
};
|
|
20
20
|
export declare const PaymentDirector: IPaymentDirector;
|
|
21
|
-
//# sourceMappingURL=PaymentDirector.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseDirector } from '@unchainedshop/utils';
|
|
2
2
|
import { createLogger } from '@unchainedshop/logger';
|
|
3
|
-
import { PaymentError } from
|
|
3
|
+
import { PaymentError, } from "./PaymentAdapter.js";
|
|
4
4
|
import { OrderPaymentStatus } from '@unchainedshop/core-orders';
|
|
5
5
|
const buildPaymentProviderActionsContext = (orderPayment, { transactionContext, ...rest }) => ({
|
|
6
6
|
...rest,
|
|
@@ -181,4 +181,3 @@ export const PaymentDirector = {
|
|
|
181
181
|
return orderPayment;
|
|
182
182
|
},
|
|
183
183
|
};
|
|
184
|
-
//# sourceMappingURL=PaymentDirector.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { PricingCalculation } from '@unchainedshop/utils';
|
|
2
|
-
import { BasePricingAdapterContext, IPricingAdapter, IPricingSheet } from '../directors/index.
|
|
3
|
-
import { PaymentProvider } from '@unchainedshop/core-payment';
|
|
4
|
-
import { OrderDiscount, OrderPayment, Order } from '@unchainedshop/core-orders';
|
|
5
|
-
import { User } from '@unchainedshop/core-users';
|
|
6
|
-
import { Modules } from '../modules.
|
|
1
|
+
import type { PricingCalculation } from '@unchainedshop/utils';
|
|
2
|
+
import { type BasePricingAdapterContext, type IPricingAdapter, type IPricingSheet } from '../directors/index.ts';
|
|
3
|
+
import type { PaymentProvider } from '@unchainedshop/core-payment';
|
|
4
|
+
import type { OrderDiscount, OrderPayment, Order } from '@unchainedshop/core-orders';
|
|
5
|
+
import type { User } from '@unchainedshop/core-users';
|
|
6
|
+
import type { Modules } from '../modules.ts';
|
|
7
7
|
export interface PaymentPricingCalculation extends PricingCalculation {
|
|
8
8
|
discountId?: string;
|
|
9
9
|
isTaxable: boolean;
|
|
@@ -12,10 +12,10 @@ export interface PaymentPricingCalculation extends PricingCalculation {
|
|
|
12
12
|
}
|
|
13
13
|
export interface PaymentPricingAdapterContext extends BasePricingAdapterContext {
|
|
14
14
|
countryCode?: string;
|
|
15
|
-
|
|
15
|
+
currencyCode?: string;
|
|
16
16
|
user: User | null;
|
|
17
17
|
orderPayment?: OrderPayment;
|
|
18
|
-
order
|
|
18
|
+
order?: Order;
|
|
19
19
|
provider: PaymentProvider;
|
|
20
20
|
discounts: OrderDiscount[];
|
|
21
21
|
}
|
|
@@ -45,4 +45,3 @@ export type IPaymentPricingAdapter<DiscountConfiguration = unknown> = IPricingAd
|
|
|
45
45
|
modules: Modules;
|
|
46
46
|
}, PaymentPricingCalculation, IPaymentPricingSheet, DiscountConfiguration>;
|
|
47
47
|
export declare const PaymentPricingAdapter: IPricingAdapter<PaymentPricingAdapterContext, PaymentPricingCalculation, IPaymentPricingSheet>;
|
|
48
|
-
//# sourceMappingURL=PaymentPricingAdapter.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BasePricingAdapter, } from
|
|
2
|
-
import { PaymentPricingSheet } from
|
|
1
|
+
import { BasePricingAdapter, } from "../directors/index.js";
|
|
2
|
+
import { PaymentPricingSheet } from "./PaymentPricingSheet.js";
|
|
3
3
|
const basePricingAdapter = BasePricingAdapter();
|
|
4
4
|
export const PaymentPricingAdapter = {
|
|
5
5
|
...basePricingAdapter,
|
|
@@ -8,7 +8,7 @@ export const PaymentPricingAdapter = {
|
|
|
8
8
|
},
|
|
9
9
|
actions: (params) => {
|
|
10
10
|
const { context } = params;
|
|
11
|
-
const
|
|
11
|
+
const currencyCode = context.currencyCode || context.order?.currencyCode;
|
|
12
12
|
const baseActions = basePricingAdapter.actions(params);
|
|
13
13
|
const resultSheet = PaymentPricingSheet({ currencyCode });
|
|
14
14
|
return {
|
|
@@ -22,4 +22,3 @@ export const PaymentPricingAdapter = {
|
|
|
22
22
|
};
|
|
23
23
|
},
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=PaymentPricingAdapter.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { IPricingDirector, IPaymentPricingAdapter, IPaymentPricingSheet, PaymentPricingAdapterContext, PaymentPricingCalculation } from '../directors/index.
|
|
2
|
-
import { PaymentProvider } from '@unchainedshop/core-payment';
|
|
3
|
-
import { OrderPayment, Order } from '@unchainedshop/core-orders';
|
|
4
|
-
import { User } from '@unchainedshop/core-users';
|
|
1
|
+
import { type IPricingDirector, type IPaymentPricingAdapter, type IPaymentPricingSheet, type PaymentPricingAdapterContext, type PaymentPricingCalculation } from '../directors/index.ts';
|
|
2
|
+
import type { PaymentProvider } from '@unchainedshop/core-payment';
|
|
3
|
+
import type { OrderPayment, Order } from '@unchainedshop/core-orders';
|
|
4
|
+
import type { User } from '@unchainedshop/core-users';
|
|
5
5
|
export type PaymentPricingContext = {
|
|
6
6
|
countryCode?: string;
|
|
7
7
|
currencyCode?: string;
|
|
8
8
|
user?: User;
|
|
9
|
-
order
|
|
9
|
+
order?: Order;
|
|
10
10
|
provider: PaymentProvider;
|
|
11
11
|
providerContext?: any;
|
|
12
12
|
} | {
|
|
@@ -15,4 +15,3 @@ export type PaymentPricingContext = {
|
|
|
15
15
|
};
|
|
16
16
|
export type IPaymentPricingDirector<DiscountConfiguration = unknown> = IPricingDirector<PaymentPricingContext, PaymentPricingCalculation, PaymentPricingAdapterContext, IPaymentPricingSheet, IPaymentPricingAdapter<DiscountConfiguration>>;
|
|
17
17
|
export declare const PaymentPricingDirector: IPaymentPricingDirector<any>;
|
|
18
|
-
//# sourceMappingURL=PaymentPricingDirector.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BasePricingDirector, } from
|
|
2
|
-
import { PaymentPricingSheet } from
|
|
1
|
+
import { BasePricingDirector, } from "../directors/index.js";
|
|
2
|
+
import { PaymentPricingSheet } from "./PaymentPricingSheet.js";
|
|
3
3
|
const baseDirector = BasePricingDirector('PaymentPricingDirector');
|
|
4
4
|
export const PaymentPricingDirector = {
|
|
5
5
|
...baseDirector,
|
|
@@ -46,4 +46,3 @@ export const PaymentPricingDirector = {
|
|
|
46
46
|
});
|
|
47
47
|
},
|
|
48
48
|
};
|
|
49
|
-
//# sourceMappingURL=PaymentPricingDirector.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { PaymentPricingCalculation, IPaymentPricingSheet, PricingSheetParams } from '../directors/index.
|
|
2
|
-
export declare
|
|
3
|
-
Item
|
|
4
|
-
Payment
|
|
5
|
-
Discount
|
|
6
|
-
Tax
|
|
7
|
-
}
|
|
1
|
+
import { type PaymentPricingCalculation, type IPaymentPricingSheet, type PricingSheetParams } from '../directors/index.ts';
|
|
2
|
+
export declare const PaymentPricingRowCategory: {
|
|
3
|
+
readonly Item: "ITEM";
|
|
4
|
+
readonly Payment: "PAYMENT";
|
|
5
|
+
readonly Discount: "DISCOUNT";
|
|
6
|
+
readonly Tax: "TAX";
|
|
7
|
+
};
|
|
8
|
+
export type PaymentPricingRowCategory = (typeof PaymentPricingRowCategory)[keyof typeof PaymentPricingRowCategory];
|
|
8
9
|
export declare const PaymentPricingSheet: (params: PricingSheetParams<PaymentPricingCalculation>) => IPaymentPricingSheet;
|
|
9
|
-
//# sourceMappingURL=PaymentPricingSheet.d.ts.map
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { BasePricingSheet, } from
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
})(PaymentPricingRowCategory || (PaymentPricingRowCategory = {}));
|
|
1
|
+
import { BasePricingSheet, } from "../directors/index.js";
|
|
2
|
+
export const PaymentPricingRowCategory = {
|
|
3
|
+
Item: 'ITEM',
|
|
4
|
+
Payment: 'PAYMENT',
|
|
5
|
+
Discount: 'DISCOUNT',
|
|
6
|
+
Tax: 'TAX',
|
|
7
|
+
};
|
|
9
8
|
export const PaymentPricingSheet = (params) => {
|
|
10
9
|
const basePricingSheet = BasePricingSheet(params);
|
|
11
10
|
const pricingSheet = {
|
|
@@ -73,4 +72,3 @@ export const PaymentPricingSheet = (params) => {
|
|
|
73
72
|
};
|
|
74
73
|
return pricingSheet;
|
|
75
74
|
};
|
|
76
|
-
//# sourceMappingURL=PaymentPricingSheet.js.map
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { IDiscountAdapter, ProductDiscountConfiguration } from '../directors/index.
|
|
1
|
+
import { type IDiscountAdapter, type ProductDiscountConfiguration } from '../directors/index.ts';
|
|
2
2
|
export declare const ProductDiscountAdapter: Omit<IDiscountAdapter<ProductDiscountConfiguration>, "key" | "label" | "version">;
|
|
3
|
-
//# sourceMappingURL=ProductDiscountAdapter.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Product, ProductConfiguration } from '@unchainedshop/core-products';
|
|
1
|
+
import type { Product, ProductConfiguration } from '@unchainedshop/core-products';
|
|
2
2
|
type ResolvedConfiguration = {
|
|
3
3
|
fixedRate?: number;
|
|
4
4
|
rate?: number;
|
|
@@ -10,4 +10,3 @@ export interface ProductDiscountConfiguration extends ResolvedConfiguration {
|
|
|
10
10
|
customPriceConfigurationResolver?: PriceConfigurationResolver;
|
|
11
11
|
}
|
|
12
12
|
export {};
|
|
13
|
-
//# sourceMappingURL=ProductDiscountConfiguration.d.ts.map
|