@unchainedshop/plugins 4.6.1 → 4.7.2
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 +0 -2
- package/lib/delivery/post/adapter.d.ts +2 -0
- package/lib/delivery/{post.js → post/adapter.js} +2 -3
- package/lib/delivery/post/index.d.ts +4 -0
- package/lib/delivery/post/index.js +10 -0
- package/lib/delivery/send-message/adapter.d.ts +2 -0
- package/lib/delivery/{send-message.js → send-message/adapter.js} +2 -3
- package/lib/delivery/send-message/index.d.ts +4 -0
- package/lib/delivery/send-message/index.js +10 -0
- package/lib/delivery/stores/adapter.d.ts +2 -0
- package/lib/delivery/{stores.js → stores/adapter.js} +2 -3
- package/lib/delivery/stores/index.d.ts +4 -0
- package/lib/delivery/stores/index.js +10 -0
- package/lib/enrollments/licensed/adapter.d.ts +6 -0
- package/lib/enrollments/{licensed.js → licensed/adapter.js} +2 -3
- package/lib/enrollments/licensed/index.d.ts +4 -0
- package/lib/enrollments/licensed/index.js +10 -0
- package/lib/events/node-event-emitter.d.ts +3 -1
- package/lib/events/node-event-emitter.js +3 -3
- package/lib/files/gridfs/adapter.d.ts +2 -2
- package/lib/files/gridfs/adapter.js +2 -5
- package/lib/files/gridfs/api.d.ts +7 -0
- package/lib/files/gridfs/api.js +163 -0
- package/lib/files/gridfs/index.d.ts +5 -4
- package/lib/files/gridfs/index.js +30 -3
- package/lib/files/minio/adapter.d.ts +4 -0
- package/lib/files/minio/adapter.js +160 -0
- package/lib/files/minio/api.d.ts +2 -0
- package/lib/files/minio/api.js +41 -0
- package/lib/files/minio/index.d.ts +4 -5
- package/lib/files/minio/index.js +18 -157
- package/lib/files/temp-upload/api.d.ts +6 -0
- package/lib/files/temp-upload/api.js +49 -0
- package/lib/files/temp-upload/index.d.ts +3 -0
- package/lib/files/temp-upload/index.js +15 -0
- package/lib/filters/local-search/adapter.d.ts +2 -0
- package/lib/filters/{local-search.js → local-search/adapter.js} +2 -12
- package/lib/filters/local-search/index.d.ts +4 -0
- package/lib/filters/local-search/index.js +16 -0
- package/lib/filters/strict-equal/adapter.d.ts +2 -0
- package/lib/filters/{strict-equal.js → strict-equal/adapter.js} +2 -3
- package/lib/filters/strict-equal/index.d.ts +4 -0
- package/lib/filters/strict-equal/index.js +10 -0
- package/lib/payment/apple-iap/adapter.d.ts +2 -1
- package/lib/payment/apple-iap/adapter.js +2 -3
- package/lib/payment/apple-iap/api.d.ts +2 -0
- package/lib/payment/apple-iap/{handler-fastify.js → api.js} +47 -30
- package/lib/payment/apple-iap/index.d.ts +6 -4
- package/lib/payment/apple-iap/index.js +28 -3
- package/lib/payment/cryptopay/adapter.d.ts +2 -0
- package/lib/payment/cryptopay/{plugin.js → adapter.js} +2 -4
- package/lib/payment/cryptopay/api.d.ts +2 -0
- package/lib/payment/cryptopay/api.js +23 -0
- package/lib/payment/cryptopay/index.d.ts +5 -4
- package/lib/payment/cryptopay/index.js +31 -3
- package/lib/payment/datatrans-v2/adapter.d.ts +2 -0
- package/lib/payment/datatrans-v2/adapter.js +406 -0
- package/lib/payment/datatrans-v2/api.d.ts +2 -0
- package/lib/payment/datatrans-v2/api.js +108 -0
- package/lib/payment/datatrans-v2/index.d.ts +4 -1
- package/lib/payment/datatrans-v2/index.js +17 -400
- package/lib/payment/invoice/adapter.d.ts +2 -0
- package/lib/payment/{invoice.js → invoice/adapter.js} +2 -3
- package/lib/payment/invoice/index.d.ts +4 -0
- package/lib/payment/invoice/index.js +10 -0
- package/lib/payment/invoice-prepaid/adapter.d.ts +2 -0
- package/lib/payment/{invoice-prepaid.js → invoice-prepaid/adapter.js} +2 -3
- package/lib/payment/invoice-prepaid/index.d.ts +4 -0
- package/lib/payment/invoice-prepaid/index.js +10 -0
- package/lib/payment/payrexx/adapter.d.ts +2 -0
- package/lib/payment/payrexx/adapter.js +161 -0
- package/lib/payment/payrexx/api.d.ts +2 -0
- package/lib/payment/payrexx/api.js +97 -0
- package/lib/payment/payrexx/index.d.ts +4 -1
- package/lib/payment/payrexx/index.js +19 -158
- package/lib/payment/postfinance-checkout/adapter.d.ts +2 -0
- package/lib/payment/postfinance-checkout/adapter.js +189 -0
- package/lib/payment/postfinance-checkout/index.d.ts +5 -0
- package/lib/payment/postfinance-checkout/index.js +25 -186
- package/lib/payment/postfinance-checkout/webhook.d.ts +2 -0
- package/lib/payment/postfinance-checkout/webhook.js +48 -0
- package/lib/payment/saferpay/adapter.js +1 -2
- package/lib/payment/saferpay/index.d.ts +5 -4
- package/lib/payment/saferpay/index.js +29 -3
- package/lib/payment/saferpay/webhook.d.ts +2 -0
- package/lib/payment/saferpay/webhook.js +64 -0
- package/lib/payment/stripe/adapter.d.ts +2 -0
- package/lib/payment/stripe/adapter.js +121 -0
- package/lib/payment/stripe/api.d.ts +6 -0
- package/lib/payment/stripe/api.js +165 -0
- package/lib/payment/stripe/index.d.ts +4 -1
- package/lib/payment/stripe/index.js +22 -116
- package/lib/payment/stripe/stripe.js +2 -5
- package/lib/presets/all.d.ts +1 -70
- package/lib/presets/all.js +41 -27
- package/lib/presets/base.d.ts +1 -25
- package/lib/presets/base.js +56 -25
- package/lib/presets/countries/ch.d.ts +1 -2
- package/lib/presets/countries/ch.js +7 -2
- package/lib/presets/crypto.d.ts +3 -7
- package/lib/presets/crypto.js +18 -7
- package/lib/pricing/{delivery-swiss-tax.d.ts → delivery-swiss-tax/adapter.d.ts} +1 -0
- package/lib/pricing/{delivery-swiss-tax.js → delivery-swiss-tax/adapter.js} +4 -4
- package/lib/pricing/delivery-swiss-tax/index.d.ts +4 -0
- package/lib/pricing/delivery-swiss-tax/index.js +10 -0
- package/lib/pricing/{discount-100-off.d.ts → discount-100-off/adapter.d.ts} +1 -0
- package/lib/pricing/{discount-100-off.js → discount-100-off/adapter.js} +2 -2
- package/lib/pricing/discount-100-off/index.d.ts +4 -0
- package/lib/pricing/discount-100-off/index.js +10 -0
- package/lib/pricing/{discount-half-price-manual.d.ts → discount-half-price-manual/adapter.d.ts} +1 -0
- package/lib/pricing/{discount-half-price-manual.js → discount-half-price-manual/adapter.js} +2 -2
- package/lib/pricing/discount-half-price-manual/index.d.ts +4 -0
- package/lib/pricing/discount-half-price-manual/index.js +10 -0
- package/lib/pricing/{free-delivery.d.ts → free-delivery/adapter.d.ts} +1 -0
- package/lib/pricing/{free-delivery.js → free-delivery/adapter.js} +2 -2
- package/lib/pricing/free-delivery/index.d.ts +4 -0
- package/lib/pricing/free-delivery/index.js +10 -0
- package/lib/pricing/{free-payment.d.ts → free-payment/adapter.d.ts} +1 -0
- package/lib/pricing/{free-payment.js → free-payment/adapter.js} +2 -2
- package/lib/pricing/free-payment/index.d.ts +4 -0
- package/lib/pricing/free-payment/index.js +10 -0
- package/lib/pricing/{order-delivery.d.ts → order-delivery/adapter.d.ts} +1 -0
- package/lib/pricing/{order-delivery.js → order-delivery/adapter.js} +2 -2
- package/lib/pricing/order-delivery/index.d.ts +4 -0
- package/lib/pricing/order-delivery/index.js +10 -0
- package/lib/pricing/{order-discount.d.ts → order-discount/adapter.d.ts} +1 -0
- package/lib/pricing/{order-discount.js → order-discount/adapter.js} +2 -2
- package/lib/pricing/order-discount/index.d.ts +4 -0
- package/lib/pricing/order-discount/index.js +10 -0
- package/lib/pricing/{order-items.d.ts → order-items/adapter.d.ts} +1 -0
- package/lib/pricing/{order-items.js → order-items/adapter.js} +2 -2
- package/lib/pricing/order-items/index.d.ts +4 -0
- package/lib/pricing/order-items/index.js +10 -0
- package/lib/pricing/{order-payment.d.ts → order-payment/adapter.d.ts} +1 -0
- package/lib/pricing/{order-payment.js → order-payment/adapter.js} +2 -2
- package/lib/pricing/order-payment/index.d.ts +4 -0
- package/lib/pricing/order-payment/index.js +10 -0
- package/lib/pricing/{product-catalog-price.d.ts → product-catalog-price/adapter.d.ts} +1 -0
- package/lib/pricing/{product-catalog-price.js → product-catalog-price/adapter.js} +2 -2
- package/lib/pricing/product-catalog-price/index.d.ts +4 -0
- package/lib/pricing/product-catalog-price/index.js +10 -0
- package/lib/pricing/{product-discount.d.ts → product-discount/adapter.d.ts} +1 -0
- package/lib/pricing/{product-discount.js → product-discount/adapter.js} +2 -2
- package/lib/pricing/product-discount/index.d.ts +4 -0
- package/lib/pricing/product-discount/index.js +10 -0
- package/lib/pricing/{product-price-rateconversion.d.ts → product-price-rateconversion/adapter.d.ts} +1 -0
- package/lib/pricing/{product-price-rateconversion.js → product-price-rateconversion/adapter.js} +2 -2
- package/lib/pricing/product-price-rateconversion/index.d.ts +4 -0
- package/lib/pricing/product-price-rateconversion/index.js +10 -0
- package/lib/pricing/{product-swiss-tax.d.ts → product-swiss-tax/adapter.d.ts} +1 -0
- package/lib/pricing/{product-swiss-tax.js → product-swiss-tax/adapter.js} +4 -4
- package/lib/pricing/product-swiss-tax/index.d.ts +4 -0
- package/lib/pricing/product-swiss-tax/index.js +10 -0
- package/lib/quotations/manual/adapter.d.ts +2 -0
- package/lib/quotations/{manual.js → manual/adapter.js} +2 -3
- package/lib/quotations/manual/index.d.ts +4 -0
- package/lib/quotations/manual/index.js +10 -0
- package/lib/warehousing/erc-metadata/api.d.ts +12 -0
- package/lib/warehousing/erc-metadata/api.js +43 -0
- package/lib/warehousing/erc-metadata/index.d.ts +3 -0
- package/lib/warehousing/erc-metadata/index.js +15 -0
- package/lib/warehousing/eth-minter/adapter.d.ts +2 -0
- package/lib/warehousing/{eth-minter.js → eth-minter/adapter.js} +3 -4
- package/lib/warehousing/eth-minter/index.d.ts +4 -0
- package/lib/warehousing/eth-minter/index.js +10 -0
- package/lib/warehousing/store/adapter.d.ts +2 -0
- package/lib/warehousing/{store.js → store/adapter.js} +2 -3
- package/lib/warehousing/store/index.d.ts +4 -0
- package/lib/warehousing/store/index.js +10 -0
- package/lib/worker/budgetsms/adapter.d.ts +22 -0
- package/lib/worker/{budgetsms.js → budgetsms/adapter.js} +3 -3
- package/lib/worker/budgetsms/index.d.ts +4 -0
- package/lib/worker/budgetsms/index.js +10 -0
- package/lib/worker/bulk-export/adapter.d.ts +3 -0
- package/lib/worker/{bulk-export.js → bulk-export/adapter.js} +3 -3
- package/lib/worker/bulk-export/index.d.ts +4 -0
- package/lib/worker/bulk-export/index.js +10 -0
- package/lib/worker/{bulk-import.d.ts → bulk-import/adapter.d.ts} +1 -0
- package/lib/worker/{bulk-import.js → bulk-import/adapter.js} +2 -2
- package/lib/worker/bulk-import/api.d.ts +7 -0
- package/lib/worker/bulk-import/api.js +53 -0
- package/lib/worker/bulk-import/index.d.ts +4 -0
- package/lib/worker/bulk-import/index.js +18 -0
- package/lib/worker/bulkgate/adapter.d.ts +12 -0
- package/lib/worker/{bulkgate.js → bulkgate/adapter.js} +3 -3
- package/lib/worker/bulkgate/index.d.ts +4 -0
- package/lib/worker/bulkgate/index.js +10 -0
- package/lib/worker/email/adapter.d.ts +9 -0
- package/lib/worker/{email.js → email/adapter.js} +27 -13
- package/lib/worker/email/index.d.ts +4 -0
- package/lib/worker/email/index.js +10 -0
- package/lib/worker/enrollment-order-generator/adapter.d.ts +4 -0
- package/lib/worker/{enrollment-order-generator.js → enrollment-order-generator/adapter.js} +2 -2
- package/lib/worker/enrollment-order-generator/index.d.ts +4 -0
- package/lib/worker/enrollment-order-generator/index.js +13 -0
- package/lib/worker/{error-notifications.d.ts → error-notifications/adapter.d.ts} +1 -0
- package/lib/worker/{error-notifications.js → error-notifications/adapter.js} +9 -8
- package/lib/worker/error-notifications/index.d.ts +4 -0
- package/lib/worker/error-notifications/index.js +13 -0
- package/lib/worker/{export-token.d.ts → export-token/adapter.d.ts} +1 -1
- package/lib/worker/{export-token.js → export-token/adapter.js} +2 -3
- package/lib/worker/export-token/index.d.ts +4 -0
- package/lib/worker/export-token/index.js +13 -0
- package/lib/worker/{external.d.ts → external/adapter.d.ts} +1 -0
- package/lib/worker/{external.js → external/adapter.js} +2 -2
- package/lib/worker/external/index.d.ts +4 -0
- package/lib/worker/external/index.js +10 -0
- package/lib/worker/heartbeat/adapter.d.ts +8 -0
- package/lib/worker/{heartbeat.js → heartbeat/adapter.js} +3 -3
- package/lib/worker/heartbeat/index.d.ts +4 -0
- package/lib/worker/heartbeat/index.js +10 -0
- package/lib/worker/{http-request.d.ts → http-request/adapter.d.ts} +1 -1
- package/lib/worker/{http-request.js → http-request/adapter.js} +2 -3
- package/lib/worker/http-request/index.d.ts +4 -0
- package/lib/worker/http-request/index.js +10 -0
- package/lib/worker/{message.d.ts → message/adapter.d.ts} +1 -0
- package/lib/worker/{message.js → message/adapter.js} +2 -2
- package/lib/worker/message/index.d.ts +4 -0
- package/lib/worker/message/index.js +10 -0
- package/lib/worker/push-notification/adapter.d.ts +9 -0
- package/lib/worker/{push-notification.js → push-notification/adapter.js} +3 -3
- package/lib/worker/push-notification/index.d.ts +4 -0
- package/lib/worker/push-notification/index.js +10 -0
- package/lib/worker/twilio/adapter.d.ts +8 -0
- package/lib/worker/{twilio.js → twilio/adapter.js} +3 -3
- package/lib/worker/twilio/index.d.ts +4 -0
- package/lib/worker/twilio/index.js +10 -0
- package/lib/worker/update-coinbase-rates/adapter.d.ts +4 -0
- package/lib/worker/{update-coinbase-rates.js → update-coinbase-rates/adapter.js} +8 -6
- package/lib/worker/update-coinbase-rates/index.d.ts +4 -0
- package/lib/worker/update-coinbase-rates/index.js +13 -0
- package/lib/worker/update-ecb-rates/adapter.d.ts +4 -0
- package/lib/worker/{update-ecb-rates.js → update-ecb-rates/adapter.js} +11 -9
- package/lib/worker/update-ecb-rates/index.d.ts +4 -0
- package/lib/worker/update-ecb-rates/index.js +13 -0
- package/lib/worker/{update-token-ownership.d.ts → update-token-ownership/adapter.d.ts} +2 -0
- package/lib/worker/{update-token-ownership.js → update-token-ownership/adapter.js} +8 -7
- package/lib/worker/update-token-ownership/index.d.ts +4 -0
- package/lib/worker/update-token-ownership/index.js +13 -0
- package/lib/worker/{zombie-killer.js → zombie-killer/adapter.js} +1 -2
- package/lib/worker/zombie-killer/index.d.ts +4 -0
- package/lib/worker/zombie-killer/index.js +10 -0
- package/package.json +15 -10
- package/lib/delivery/post.d.ts +0 -1
- package/lib/delivery/send-message.d.ts +0 -1
- package/lib/delivery/stores.d.ts +0 -1
- package/lib/enrollments/licensed.d.ts +0 -4
- package/lib/files/gridfs/handler-express.d.ts +0 -9
- package/lib/files/gridfs/handler-express.js +0 -110
- package/lib/files/gridfs/handler-fastify.d.ts +0 -3
- package/lib/files/gridfs/handler-fastify.js +0 -138
- package/lib/files/minio/handler-express.d.ts +0 -2
- package/lib/files/minio/handler-express.js +0 -36
- package/lib/files/minio/handler-fastify.d.ts +0 -3
- package/lib/files/minio/handler-fastify.js +0 -40
- package/lib/filters/local-search.d.ts +0 -3
- package/lib/filters/strict-equal.d.ts +0 -1
- package/lib/payment/apple-iap/handler-express.d.ts +0 -2
- package/lib/payment/apple-iap/handler-express.js +0 -103
- package/lib/payment/apple-iap/handler-fastify.d.ts +0 -3
- package/lib/payment/braintree.d.ts +0 -1
- package/lib/payment/braintree.js +0 -138
- package/lib/payment/cryptopay/handler-express.d.ts +0 -2
- package/lib/payment/cryptopay/handler-express.js +0 -19
- package/lib/payment/cryptopay/handler-fastify.d.ts +0 -3
- package/lib/payment/cryptopay/handler-fastify.js +0 -17
- package/lib/payment/cryptopay/plugin.d.ts +0 -3
- package/lib/payment/datatrans-v2/handler-express.d.ts +0 -1
- package/lib/payment/datatrans-v2/handler-express.js +0 -71
- package/lib/payment/datatrans-v2/handler-fastify.d.ts +0 -2
- package/lib/payment/datatrans-v2/handler-fastify.js +0 -71
- package/lib/payment/invoice-prepaid.d.ts +0 -1
- package/lib/payment/invoice.d.ts +0 -1
- package/lib/payment/paypal-checkout.d.ts +0 -1
- package/lib/payment/paypal-checkout.js +0 -87
- package/lib/payment/payrexx/handler-express.d.ts +0 -1
- package/lib/payment/payrexx/handler-express.js +0 -85
- package/lib/payment/payrexx/handler-fastify.d.ts +0 -2
- package/lib/payment/payrexx/handler-fastify.js +0 -91
- package/lib/payment/postfinance-checkout/handler-express.d.ts +0 -1
- package/lib/payment/postfinance-checkout/handler-express.js +0 -37
- package/lib/payment/postfinance-checkout/handler-fastify.d.ts +0 -2
- package/lib/payment/postfinance-checkout/handler-fastify.js +0 -40
- package/lib/payment/saferpay/handler-express.d.ts +0 -1
- package/lib/payment/saferpay/handler-express.js +0 -59
- package/lib/payment/saferpay/handler-fastify.d.ts +0 -2
- package/lib/payment/saferpay/handler-fastify.js +0 -62
- package/lib/payment/stripe/handler-express.d.ts +0 -5
- package/lib/payment/stripe/handler-express.js +0 -121
- package/lib/payment/stripe/handler-fastify.d.ts +0 -6
- package/lib/payment/stripe/handler-fastify.js +0 -131
- package/lib/presets/all-express.d.ts +0 -6
- package/lib/presets/all-express.js +0 -26
- package/lib/presets/all-fastify.d.ts +0 -6
- package/lib/presets/all-fastify.js +0 -49
- package/lib/presets/base-express.d.ts +0 -2
- package/lib/presets/base-express.js +0 -5
- package/lib/presets/base-fastify.d.ts +0 -3
- package/lib/presets/base-fastify.js +0 -16
- package/lib/presets/crypto-express.d.ts +0 -3
- package/lib/presets/crypto-express.js +0 -8
- package/lib/presets/crypto-fastify.d.ts +0 -3
- package/lib/presets/crypto-fastify.js +0 -11
- package/lib/pricing/discount-half-price.d.ts +0 -2
- package/lib/pricing/discount-half-price.js +0 -33
- package/lib/pricing/order-items-discount.d.ts +0 -2
- package/lib/pricing/order-items-discount.js +0 -50
- package/lib/pricing/order-round.d.ts +0 -10
- package/lib/pricing/order-round.js +0 -135
- package/lib/pricing/product-catalog-price-options.d.ts +0 -2
- package/lib/pricing/product-catalog-price-options.js +0 -51
- package/lib/pricing/product-round.d.ts +0 -10
- package/lib/pricing/product-round.js +0 -44
- package/lib/quotations/manual.d.ts +0 -1
- package/lib/warehousing/eth-minter.d.ts +0 -1
- package/lib/warehousing/store.d.ts +0 -1
- package/lib/worker/budgetsms.d.ts +0 -9
- package/lib/worker/bulk-export.d.ts +0 -2
- package/lib/worker/bulkgate.d.ts +0 -1
- package/lib/worker/email.d.ts +0 -1
- package/lib/worker/enrollment-order-generator.d.ts +0 -1
- package/lib/worker/heartbeat.d.ts +0 -1
- package/lib/worker/push-notification.d.ts +0 -1
- package/lib/worker/twilio.d.ts +0 -1
- package/lib/worker/update-coinbase-rates.d.ts +0 -1
- package/lib/worker/update-ecb-rates.d.ts +0 -1
- /package/lib/worker/{zombie-killer.d.ts → zombie-killer/adapter.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DeliveryPricingRowCategory, DeliveryPricingAdapter,
|
|
2
|
-
import { resolveTaxCategoryFromDeliveryProvider, SwissTaxCategories } from "
|
|
3
|
-
import isDeliveryAddressInCountry from "
|
|
1
|
+
import { DeliveryPricingRowCategory, DeliveryPricingAdapter, } from '@unchainedshop/core';
|
|
2
|
+
import { resolveTaxCategoryFromDeliveryProvider, SwissTaxCategories } from "../tax/ch.js";
|
|
3
|
+
import isDeliveryAddressInCountry from "../utils/isDeliveryAddressInCountry.js";
|
|
4
4
|
export const DeliverySwissTax = {
|
|
5
5
|
...DeliveryPricingAdapter,
|
|
6
6
|
key: 'shop.unchained.pricing.delivery-swiss-tax',
|
|
@@ -59,4 +59,4 @@ export const DeliverySwissTax = {
|
|
|
59
59
|
};
|
|
60
60
|
},
|
|
61
61
|
};
|
|
62
|
-
|
|
62
|
+
export default DeliverySwissTax;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {} from '@unchainedshop/core';
|
|
2
|
+
import { DeliverySwissTax } from "./adapter.js";
|
|
3
|
+
export const DeliverySwissTaxPlugin = {
|
|
4
|
+
key: 'shop.unchained.pricing.delivery-swiss-tax',
|
|
5
|
+
label: 'Delivery Swiss Tax Plugin',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
adapters: [DeliverySwissTax],
|
|
8
|
+
};
|
|
9
|
+
export default DeliverySwissTaxPlugin;
|
|
10
|
+
export { DeliverySwissTax } from "./adapter.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OrderDiscountAdapter, } from '@unchainedshop/core';
|
|
2
2
|
export const HundredOff = {
|
|
3
3
|
...OrderDiscountAdapter,
|
|
4
4
|
key: 'shop.unchained.discount.100-off',
|
|
@@ -27,4 +27,4 @@ export const HundredOff = {
|
|
|
27
27
|
},
|
|
28
28
|
}),
|
|
29
29
|
};
|
|
30
|
-
|
|
30
|
+
export default HundredOff;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {} from '@unchainedshop/core';
|
|
2
|
+
import { HundredOff } from "./adapter.js";
|
|
3
|
+
export const HundredOffPlugin = {
|
|
4
|
+
key: 'shop.unchained.discount.100-off',
|
|
5
|
+
label: '100 Off Discount Plugin',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
adapters: [HundredOff],
|
|
8
|
+
};
|
|
9
|
+
export default HundredOffPlugin;
|
|
10
|
+
export { HundredOff } from "./adapter.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OrderDiscountAdapter, } from '@unchainedshop/core';
|
|
2
2
|
export const HalfPriceManual = {
|
|
3
3
|
...OrderDiscountAdapter,
|
|
4
4
|
key: 'shop.unchained.discount.half-price-manual',
|
|
@@ -27,4 +27,4 @@ export const HalfPriceManual = {
|
|
|
27
27
|
},
|
|
28
28
|
}),
|
|
29
29
|
};
|
|
30
|
-
|
|
30
|
+
export default HalfPriceManual;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {} from '@unchainedshop/core';
|
|
2
|
+
import { HalfPriceManual } from "./adapter.js";
|
|
3
|
+
export const HalfPriceManualPlugin = {
|
|
4
|
+
key: 'shop.unchained.discount.half-price-manual',
|
|
5
|
+
label: 'Half Price Manual Discount Plugin',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
adapters: [HalfPriceManual],
|
|
8
|
+
};
|
|
9
|
+
export default HalfPriceManualPlugin;
|
|
10
|
+
export { HalfPriceManual } from "./adapter.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DeliveryPricingAdapter
|
|
1
|
+
import { DeliveryPricingAdapter } from '@unchainedshop/core';
|
|
2
2
|
export const DeliveryFreePrice = {
|
|
3
3
|
...DeliveryPricingAdapter,
|
|
4
4
|
key: 'shop.unchained.pricing.delivery-free',
|
|
@@ -24,4 +24,4 @@ export const DeliveryFreePrice = {
|
|
|
24
24
|
};
|
|
25
25
|
},
|
|
26
26
|
};
|
|
27
|
-
|
|
27
|
+
export default DeliveryFreePrice;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {} from '@unchainedshop/core';
|
|
2
|
+
import { DeliveryFreePrice } from "./adapter.js";
|
|
3
|
+
export const DeliveryFreePricePlugin = {
|
|
4
|
+
key: 'shop.unchained.pricing.delivery-free',
|
|
5
|
+
label: 'Free Delivery Pricing Plugin',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
adapters: [DeliveryFreePrice],
|
|
8
|
+
};
|
|
9
|
+
export default DeliveryFreePricePlugin;
|
|
10
|
+
export { DeliveryFreePrice } from "./adapter.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PaymentPricingAdapter
|
|
1
|
+
import { PaymentPricingAdapter } from '@unchainedshop/core';
|
|
2
2
|
export const PaymentFreePrice = {
|
|
3
3
|
...PaymentPricingAdapter,
|
|
4
4
|
key: 'shop.unchained.pricing.payment-free',
|
|
@@ -24,4 +24,4 @@ export const PaymentFreePrice = {
|
|
|
24
24
|
};
|
|
25
25
|
},
|
|
26
26
|
};
|
|
27
|
-
|
|
27
|
+
export default PaymentFreePrice;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {} from '@unchainedshop/core';
|
|
2
|
+
import { PaymentFreePrice } from "./adapter.js";
|
|
3
|
+
export const PaymentFreePricePlugin = {
|
|
4
|
+
key: 'shop.unchained.pricing.payment-free',
|
|
5
|
+
label: 'Free Payment Pricing Plugin',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
adapters: [PaymentFreePrice],
|
|
8
|
+
};
|
|
9
|
+
export default PaymentFreePricePlugin;
|
|
10
|
+
export { PaymentFreePrice } from "./adapter.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OrderPricingAdapter, DeliveryPricingSheet, } from '@unchainedshop/core';
|
|
2
2
|
export const OrderDelivery = {
|
|
3
3
|
...OrderPricingAdapter,
|
|
4
4
|
key: 'shop.unchained.pricing.order-delivery',
|
|
@@ -30,4 +30,4 @@ export const OrderDelivery = {
|
|
|
30
30
|
};
|
|
31
31
|
},
|
|
32
32
|
};
|
|
33
|
-
|
|
33
|
+
export default OrderDelivery;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {} from '@unchainedshop/core';
|
|
2
|
+
import { OrderDelivery } from "./adapter.js";
|
|
3
|
+
export const OrderDeliveryPlugin = {
|
|
4
|
+
key: 'shop.unchained.pricing.order-delivery',
|
|
5
|
+
label: 'Order Delivery Pricing Plugin',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
adapters: [OrderDelivery],
|
|
8
|
+
};
|
|
9
|
+
export default OrderDeliveryPlugin;
|
|
10
|
+
export { OrderDelivery } from "./adapter.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OrderPricingRowCategory,
|
|
1
|
+
import { OrderPricingRowCategory, OrderPricingAdapter, DeliveryPricingSheet, PaymentPricingSheet, ProductPricingSheet, resolveRatioAndTaxDivisorForPricingSheet, } from '@unchainedshop/core';
|
|
2
2
|
import { calculation as calcUtils } from '@unchainedshop/utils';
|
|
3
3
|
export const OrderDiscount = {
|
|
4
4
|
...OrderPricingAdapter,
|
|
@@ -71,4 +71,4 @@ export const OrderDiscount = {
|
|
|
71
71
|
};
|
|
72
72
|
},
|
|
73
73
|
};
|
|
74
|
-
|
|
74
|
+
export default OrderDiscount;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {} from '@unchainedshop/core';
|
|
2
|
+
import { OrderDiscount } from "./adapter.js";
|
|
3
|
+
export const OrderDiscountPlugin = {
|
|
4
|
+
key: 'shop.unchained.pricing.order-discount',
|
|
5
|
+
label: 'Order Discount Pricing Plugin',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
adapters: [OrderDiscount],
|
|
8
|
+
};
|
|
9
|
+
export default OrderDiscountPlugin;
|
|
10
|
+
export { OrderDiscount } from "./adapter.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OrderPricingAdapter, ProductPricingSheet, } from '@unchainedshop/core';
|
|
2
2
|
export const OrderItems = {
|
|
3
3
|
...OrderPricingAdapter,
|
|
4
4
|
key: 'shop.unchained.pricing.order-items',
|
|
@@ -40,4 +40,4 @@ export const OrderItems = {
|
|
|
40
40
|
};
|
|
41
41
|
},
|
|
42
42
|
};
|
|
43
|
-
|
|
43
|
+
export default OrderItems;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {} from '@unchainedshop/core';
|
|
2
|
+
import { OrderItems } from "./adapter.js";
|
|
3
|
+
export const OrderItemsPlugin = {
|
|
4
|
+
key: 'shop.unchained.pricing.order-items',
|
|
5
|
+
label: 'Order Items Pricing Plugin',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
adapters: [OrderItems],
|
|
8
|
+
};
|
|
9
|
+
export default OrderItemsPlugin;
|
|
10
|
+
export { OrderItems } from "./adapter.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OrderPricingAdapter, PaymentPricingSheet, } from '@unchainedshop/core';
|
|
2
2
|
export const OrderPayment = {
|
|
3
3
|
...OrderPricingAdapter,
|
|
4
4
|
key: 'shop.unchained.pricing.order-payment',
|
|
@@ -30,4 +30,4 @@ export const OrderPayment = {
|
|
|
30
30
|
};
|
|
31
31
|
},
|
|
32
32
|
};
|
|
33
|
-
|
|
33
|
+
export default OrderPayment;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {} from '@unchainedshop/core';
|
|
2
|
+
import { OrderPayment } from "./adapter.js";
|
|
3
|
+
export const OrderPaymentPlugin = {
|
|
4
|
+
key: 'shop.unchained.pricing.order-payment',
|
|
5
|
+
label: 'Order Payment Pricing Plugin',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
adapters: [OrderPayment],
|
|
8
|
+
};
|
|
9
|
+
export default OrderPaymentPlugin;
|
|
10
|
+
export { OrderPayment } from "./adapter.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ProductPricingAdapter } from '@unchainedshop/core';
|
|
2
2
|
import { ProductType } from '@unchainedshop/core-products';
|
|
3
3
|
export const ProductPrice = {
|
|
4
4
|
...ProductPricingAdapter,
|
|
@@ -57,4 +57,4 @@ export const ProductPrice = {
|
|
|
57
57
|
};
|
|
58
58
|
},
|
|
59
59
|
};
|
|
60
|
-
|
|
60
|
+
export default ProductPrice;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {} from '@unchainedshop/core';
|
|
2
|
+
import { ProductPrice } from "./adapter.js";
|
|
3
|
+
export const ProductPricePlugin = {
|
|
4
|
+
key: 'shop.unchained.pricing.product-catalog',
|
|
5
|
+
label: 'Product Catalog Price Plugin',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
adapters: [ProductPrice],
|
|
8
|
+
};
|
|
9
|
+
export default ProductPricePlugin;
|
|
10
|
+
export { ProductPrice } from "./adapter.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { calculation as calcUtils } from '@unchainedshop/utils';
|
|
2
|
-
import {
|
|
2
|
+
import { ProductPricingAdapter, ProductPricingRowCategory, } from '@unchainedshop/core';
|
|
3
3
|
export const ProductDiscount = {
|
|
4
4
|
...ProductPricingAdapter,
|
|
5
5
|
key: 'shop.unchained.pricing.product-discount',
|
|
@@ -66,4 +66,4 @@ export const ProductDiscount = {
|
|
|
66
66
|
};
|
|
67
67
|
},
|
|
68
68
|
};
|
|
69
|
-
|
|
69
|
+
export default ProductDiscount;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {} from '@unchainedshop/core';
|
|
2
|
+
import { ProductDiscount } from "./adapter.js";
|
|
3
|
+
export const ProductDiscountPlugin = {
|
|
4
|
+
key: 'shop.unchained.pricing.product-discount',
|
|
5
|
+
label: 'Product Discount Pricing Plugin',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
adapters: [ProductDiscount],
|
|
8
|
+
};
|
|
9
|
+
export default ProductDiscountPlugin;
|
|
10
|
+
export { ProductDiscount } from "./adapter.js";
|
package/lib/pricing/{product-price-rateconversion.js → product-price-rateconversion/adapter.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ProductPricingAdapter } from '@unchainedshop/core';
|
|
2
2
|
export const ProductPriceRateConversion = {
|
|
3
3
|
...ProductPricingAdapter,
|
|
4
4
|
key: 'shop.unchained.pricing.rate-conversion',
|
|
@@ -50,4 +50,4 @@ export const ProductPriceRateConversion = {
|
|
|
50
50
|
};
|
|
51
51
|
},
|
|
52
52
|
};
|
|
53
|
-
|
|
53
|
+
export default ProductPriceRateConversion;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {} from '@unchainedshop/core';
|
|
2
|
+
import { ProductPriceRateConversion } from "./adapter.js";
|
|
3
|
+
export const ProductPriceRateConversionPlugin = {
|
|
4
|
+
key: 'shop.unchained.pricing.rate-conversion',
|
|
5
|
+
label: 'Product Price Rate Conversion Plugin',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
adapters: [ProductPriceRateConversion],
|
|
8
|
+
};
|
|
9
|
+
export default ProductPriceRateConversionPlugin;
|
|
10
|
+
export { ProductPriceRateConversion } from "./adapter.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { resolveTaxCategoryFromDeliveryProvider, resolveTaxCategoryFromProduct, SwissTaxCategories, } from "
|
|
3
|
-
import isDeliveryAddressInCountry from "
|
|
1
|
+
import { ProductPricingAdapter, ProductPricingRowCategory, } from '@unchainedshop/core';
|
|
2
|
+
import { resolveTaxCategoryFromDeliveryProvider, resolveTaxCategoryFromProduct, SwissTaxCategories, } from "../tax/ch.js";
|
|
3
|
+
import isDeliveryAddressInCountry from "../utils/isDeliveryAddressInCountry.js";
|
|
4
4
|
export const ProductSwissTax = {
|
|
5
5
|
...ProductPricingAdapter,
|
|
6
6
|
key: 'shop.unchained.pricing.product-swiss-tax',
|
|
@@ -73,4 +73,4 @@ export const ProductSwissTax = {
|
|
|
73
73
|
};
|
|
74
74
|
},
|
|
75
75
|
};
|
|
76
|
-
|
|
76
|
+
export default ProductSwissTax;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {} from '@unchainedshop/core';
|
|
2
|
+
import { ProductSwissTax } from "./adapter.js";
|
|
3
|
+
export const ProductSwissTaxPlugin = {
|
|
4
|
+
key: 'shop.unchained.pricing.product-swiss-tax',
|
|
5
|
+
label: 'Product Swiss Tax Plugin',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
adapters: [ProductSwissTax],
|
|
8
|
+
};
|
|
9
|
+
export default ProductSwissTaxPlugin;
|
|
10
|
+
export { ProductSwissTax } from "./adapter.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const ManualOffering = {
|
|
1
|
+
import { QuotationAdapter } from '@unchainedshop/core';
|
|
2
|
+
export const ManualOffering = {
|
|
3
3
|
...QuotationAdapter,
|
|
4
4
|
key: 'shop.unchained.quotations.manual',
|
|
5
5
|
version: '1.0.0',
|
|
@@ -17,4 +17,3 @@ const ManualOffering = {
|
|
|
17
17
|
};
|
|
18
18
|
},
|
|
19
19
|
};
|
|
20
|
-
QuotationDirector.registerAdapter(ManualOffering);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {} from '@unchainedshop/core';
|
|
2
|
+
import { ManualOffering } from "./adapter.js";
|
|
3
|
+
export const ManualOfferingPlugin = {
|
|
4
|
+
key: 'shop.unchained.quotations.manual',
|
|
5
|
+
label: 'Manual Offering Quotation Plugin',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
adapters: [ManualOffering],
|
|
8
|
+
};
|
|
9
|
+
export default ManualOfferingPlugin;
|
|
10
|
+
export { ManualOffering } from "./adapter.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { UnchainedCore } from '@unchainedshop/core';
|
|
2
|
+
export declare function ercMetadataHandler(request: Request, context: UnchainedCore & {
|
|
3
|
+
params: Record<string, string>;
|
|
4
|
+
locale?: Intl.Locale;
|
|
5
|
+
loaders?: {
|
|
6
|
+
productLoader: {
|
|
7
|
+
load: (params: {
|
|
8
|
+
productId: string;
|
|
9
|
+
}) => Promise<any>;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
}): Promise<Response>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { createLogger } from '@unchainedshop/logger';
|
|
2
|
+
import { ProductContractStandard } from '@unchainedshop/core-products';
|
|
3
|
+
import { systemLocale } from '@unchainedshop/utils';
|
|
4
|
+
const logger = createLogger('unchained:erc-metadata');
|
|
5
|
+
export async function ercMetadataHandler(request, context) {
|
|
6
|
+
try {
|
|
7
|
+
const { ROOT_URL = 'http://localhost:4010' } = process.env;
|
|
8
|
+
const { services, modules, locale, loaders, params } = context;
|
|
9
|
+
const url = new URL(request.url, ROOT_URL);
|
|
10
|
+
if (!url.pathname.toLowerCase().endsWith('.json')) {
|
|
11
|
+
throw new Error('Invalid ERC Metadata URI');
|
|
12
|
+
}
|
|
13
|
+
const { productId, localeOrTokenFilename, tokenFileName } = params;
|
|
14
|
+
const product = loaders
|
|
15
|
+
? await loaders.productLoader.load({ productId })
|
|
16
|
+
: await modules.products.findProduct({ productId });
|
|
17
|
+
const tokenSelector = {
|
|
18
|
+
contractAddress: product?.tokenization?.contractAddress,
|
|
19
|
+
};
|
|
20
|
+
if (product?.tokenization?.contractStandard !== ProductContractStandard.ERC721) {
|
|
21
|
+
tokenSelector.tokenSerialNumber = (tokenFileName || localeOrTokenFilename)
|
|
22
|
+
.toLowerCase()
|
|
23
|
+
.replace('.json', '');
|
|
24
|
+
}
|
|
25
|
+
const [token] = await modules.warehousing.findTokens(tokenSelector);
|
|
26
|
+
const resolvedLocale = tokenFileName
|
|
27
|
+
? new Intl.Locale(localeOrTokenFilename)
|
|
28
|
+
: locale || systemLocale;
|
|
29
|
+
const ercMetadata = await services.warehousing.ercMetadata({
|
|
30
|
+
product,
|
|
31
|
+
token,
|
|
32
|
+
locale: resolvedLocale,
|
|
33
|
+
});
|
|
34
|
+
if (!ercMetadata) {
|
|
35
|
+
return new Response(null, { status: 404 });
|
|
36
|
+
}
|
|
37
|
+
return Response.json(ercMetadata, { status: 200 });
|
|
38
|
+
}
|
|
39
|
+
catch (e) {
|
|
40
|
+
logger.error(e);
|
|
41
|
+
return Response.json({ name: e.name, code: e.code, message: e.message }, { status: 503 });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ercMetadataHandler } from "./api.js";
|
|
2
|
+
const { ERC_METADATA_API_PATH = '/erc-metadata' } = process.env;
|
|
3
|
+
export const ERCMetadataPlugin = {
|
|
4
|
+
key: 'shop.unchained.warehousing.erc-metadata',
|
|
5
|
+
label: 'ERC Metadata Plugin',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
routes: [
|
|
8
|
+
{
|
|
9
|
+
path: `${ERC_METADATA_API_PATH}/:productId/:localeOrTokenFilename{/:tokenFileName}`,
|
|
10
|
+
method: 'GET',
|
|
11
|
+
handler: ercMetadataHandler,
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
};
|
|
15
|
+
export default ERCMetadataPlugin;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { WarehousingError,
|
|
1
|
+
import { WarehousingError, WarehousingAdapter, } from '@unchainedshop/core';
|
|
2
2
|
import { WarehousingProviderType } from '@unchainedshop/core-warehousing';
|
|
3
3
|
import { ProductContractStandard, ProductType } from '@unchainedshop/core-products';
|
|
4
4
|
import { systemLocale } from '@unchainedshop/utils';
|
|
5
5
|
import { generateDbObjectId } from '@unchainedshop/mongodb';
|
|
6
|
-
import { getFileAdapter } from '@unchainedshop/core
|
|
6
|
+
import { getFileAdapter } from '@unchainedshop/core';
|
|
7
7
|
import { createLogger } from '@unchainedshop/logger';
|
|
8
8
|
const logger = createLogger('unchained:eth-minter');
|
|
9
|
-
const ETHMinter = {
|
|
9
|
+
export const ETHMinter = {
|
|
10
10
|
...WarehousingAdapter,
|
|
11
11
|
key: 'shop.unchained.warehousing.infinite-minter',
|
|
12
12
|
version: '1.0',
|
|
@@ -117,4 +117,3 @@ const ETHMinter = {
|
|
|
117
117
|
};
|
|
118
118
|
},
|
|
119
119
|
};
|
|
120
|
-
WarehousingDirector.registerAdapter(ETHMinter);
|