@unchainedshop/plugins 4.3.4 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +137 -0
- package/lib/delivery/post.d.ts +0 -1
- package/lib/delivery/post.js +0 -1
- package/lib/delivery/send-message.d.ts +0 -1
- package/lib/delivery/send-message.js +0 -1
- package/lib/delivery/stores.d.ts +0 -1
- package/lib/delivery/stores.js +0 -1
- package/lib/enrollments/licensed.d.ts +0 -1
- package/lib/enrollments/licensed.js +0 -1
- package/lib/events/aws-eventbridge.d.ts +0 -1
- package/lib/events/aws-eventbridge.js +0 -3
- package/lib/events/node-event-emitter.d.ts +0 -1
- package/lib/events/node-event-emitter.js +0 -1
- package/lib/events/redis.d.ts +0 -1
- package/lib/events/redis.js +0 -1
- package/lib/files/gridfs/adapter.d.ts +3 -4
- package/lib/files/gridfs/adapter.js +6 -6
- package/lib/files/gridfs/handler-express.d.ts +2 -3
- package/lib/files/gridfs/handler-express.js +6 -9
- package/lib/files/gridfs/handler-fastify.d.ts +1 -2
- package/lib/files/gridfs/handler-fastify.js +6 -9
- package/lib/files/gridfs/index.d.ts +2 -3
- package/lib/files/gridfs/index.js +2 -3
- package/lib/files/gridfs/module.d.ts +0 -1
- package/lib/files/gridfs/module.js +7 -2
- package/lib/files/gridfs/sign.d.ts +0 -1
- package/lib/files/gridfs/sign.js +0 -1
- package/lib/files/minio/handler-express.d.ts +0 -1
- package/lib/files/minio/handler-express.js +0 -1
- package/lib/files/minio/handler-fastify.d.ts +1 -2
- package/lib/files/minio/handler-fastify.js +2 -1
- package/lib/files/minio/index.d.ts +1 -2
- package/lib/files/minio/index.js +1 -5
- package/lib/filters/local-search.d.ts +1 -2
- package/lib/filters/local-search.js +3 -6
- package/lib/filters/strict-equal.d.ts +0 -1
- package/lib/filters/strict-equal.js +0 -1
- package/lib/payment/apple-iap/adapter.d.ts +0 -1
- package/lib/payment/apple-iap/adapter.js +3 -5
- package/lib/payment/apple-iap/db/AppleTransactionsCollection.d.ts +1 -2
- package/lib/payment/apple-iap/db/AppleTransactionsCollection.js +2 -1
- package/lib/payment/apple-iap/fix-periods.d.ts +1 -2
- package/lib/payment/apple-iap/fix-periods.js +1 -1
- package/lib/payment/apple-iap/handler-express.d.ts +0 -1
- package/lib/payment/apple-iap/handler-express.js +2 -5
- package/lib/payment/apple-iap/handler-fastify.d.ts +1 -2
- package/lib/payment/apple-iap/handler-fastify.js +4 -5
- package/lib/payment/apple-iap/index.d.ts +2 -3
- package/lib/payment/apple-iap/index.js +2 -3
- package/lib/payment/apple-iap/module.d.ts +1 -2
- package/lib/payment/apple-iap/module.js +1 -2
- package/lib/payment/apple-iap/verify-receipt.d.ts +0 -1
- package/lib/payment/apple-iap/verify-receipt.js +0 -4
- package/lib/payment/braintree.d.ts +0 -1
- package/lib/payment/braintree.js +0 -5
- package/lib/payment/cryptopay/db/CryptopayTransactions.d.ts +1 -2
- package/lib/payment/cryptopay/db/CryptopayTransactions.js +2 -1
- package/lib/payment/cryptopay/denote-amount.d.ts +0 -24
- package/lib/payment/cryptopay/denote-amount.js +2 -26
- package/lib/payment/cryptopay/derive-btc-address.d.ts +0 -1
- package/lib/payment/cryptopay/derive-btc-address.js +4 -14
- package/lib/payment/cryptopay/derive-eth-address.d.ts +0 -1
- package/lib/payment/cryptopay/derive-eth-address.js +1 -3
- package/lib/payment/cryptopay/handle-webhook.d.ts +2 -3
- package/lib/payment/cryptopay/handle-webhook.js +3 -3
- package/lib/payment/cryptopay/handler-express.d.ts +0 -1
- package/lib/payment/cryptopay/handler-express.js +1 -2
- package/lib/payment/cryptopay/handler-fastify.d.ts +1 -2
- package/lib/payment/cryptopay/handler-fastify.js +2 -2
- package/lib/payment/cryptopay/index.d.ts +2 -3
- package/lib/payment/cryptopay/index.js +2 -3
- package/lib/payment/cryptopay/module.d.ts +1 -2
- package/lib/payment/cryptopay/module.js +2 -3
- package/lib/payment/cryptopay/plugin.d.ts +1 -2
- package/lib/payment/cryptopay/plugin.js +8 -37
- package/lib/payment/datatrans-v2/api/authorize.d.ts +1 -2
- package/lib/payment/datatrans-v2/api/authorize.js +0 -2
- package/lib/payment/datatrans-v2/api/authorizeAuthenticated.d.ts +1 -2
- package/lib/payment/datatrans-v2/api/authorizeAuthenticated.js +0 -1
- package/lib/payment/datatrans-v2/api/cancel.d.ts +1 -2
- package/lib/payment/datatrans-v2/api/cancel.js +0 -1
- package/lib/payment/datatrans-v2/api/index.d.ts +8 -9
- package/lib/payment/datatrans-v2/api/index.js +9 -10
- package/lib/payment/datatrans-v2/api/init.d.ts +1 -2
- package/lib/payment/datatrans-v2/api/init.js +2 -4
- package/lib/payment/datatrans-v2/api/makeFetcher.d.ts +0 -1
- package/lib/payment/datatrans-v2/api/makeFetcher.js +0 -3
- package/lib/payment/datatrans-v2/api/secureFields.d.ts +1 -2
- package/lib/payment/datatrans-v2/api/secureFields.js +1 -3
- package/lib/payment/datatrans-v2/api/settle.d.ts +1 -2
- package/lib/payment/datatrans-v2/api/settle.js +0 -1
- package/lib/payment/datatrans-v2/api/status.d.ts +1 -2
- package/lib/payment/datatrans-v2/api/status.js +0 -1
- package/lib/payment/datatrans-v2/api/types.d.ts +0 -1
- package/lib/payment/datatrans-v2/api/types.js +0 -1
- package/lib/payment/datatrans-v2/api/validate.d.ts +1 -2
- package/lib/payment/datatrans-v2/api/validate.js +0 -1
- package/lib/payment/datatrans-v2/generateSignature.d.ts +0 -1
- package/lib/payment/datatrans-v2/generateSignature.js +0 -2
- package/lib/payment/datatrans-v2/getPaths.d.ts +0 -1
- package/lib/payment/datatrans-v2/getPaths.js +0 -1
- package/lib/payment/datatrans-v2/handler-express.d.ts +0 -1
- package/lib/payment/datatrans-v2/handler-express.js +1 -2
- package/lib/payment/datatrans-v2/handler-fastify.d.ts +1 -2
- package/lib/payment/datatrans-v2/handler-fastify.js +1 -2
- package/lib/payment/datatrans-v2/index.d.ts +0 -1
- package/lib/payment/datatrans-v2/index.js +3 -14
- package/lib/payment/datatrans-v2/parseRegistrationData.d.ts +4 -5
- package/lib/payment/datatrans-v2/parseRegistrationData.js +1 -2
- package/lib/payment/datatrans-v2/roundedAmountFromOrder.d.ts +1 -2
- package/lib/payment/datatrans-v2/roundedAmountFromOrder.js +0 -1
- package/lib/payment/datatrans-v2/splitProperties.d.ts +0 -1
- package/lib/payment/datatrans-v2/splitProperties.js +0 -2
- package/lib/payment/invoice-prepaid.d.ts +0 -1
- package/lib/payment/invoice-prepaid.js +0 -1
- package/lib/payment/invoice.d.ts +0 -1
- package/lib/payment/invoice.js +0 -1
- package/lib/payment/paypal-checkout.d.ts +0 -1
- package/lib/payment/paypal-checkout.js +0 -11
- package/lib/payment/payrexx/api/index.d.ts +15 -15
- package/lib/payment/payrexx/api/index.js +15 -27
- package/lib/payment/payrexx/api/makeFetcher.d.ts +0 -1
- package/lib/payment/payrexx/api/makeFetcher.js +0 -1
- package/lib/payment/payrexx/handler-express.d.ts +0 -1
- package/lib/payment/payrexx/handler-express.js +0 -4
- package/lib/payment/payrexx/handler-fastify.d.ts +1 -2
- package/lib/payment/payrexx/handler-fastify.js +0 -4
- package/lib/payment/payrexx/index.d.ts +0 -1
- package/lib/payment/payrexx/index.js +9 -35
- package/lib/payment/payrexx/payrexx.d.ts +0 -1
- package/lib/payment/payrexx/payrexx.js +0 -1
- package/lib/payment/postfinance-checkout/api-client.d.ts +0 -1
- package/lib/payment/postfinance-checkout/api-client.js +0 -6
- package/lib/payment/postfinance-checkout/api-types.d.ts +49 -44
- package/lib/payment/postfinance-checkout/api-types.js +43 -51
- package/lib/payment/postfinance-checkout/api.d.ts +1 -2
- package/lib/payment/postfinance-checkout/api.js +2 -3
- package/lib/payment/postfinance-checkout/handler-express.d.ts +0 -1
- package/lib/payment/postfinance-checkout/handler-express.js +1 -2
- package/lib/payment/postfinance-checkout/handler-fastify.d.ts +1 -2
- package/lib/payment/postfinance-checkout/handler-fastify.js +1 -2
- package/lib/payment/postfinance-checkout/index.d.ts +2 -3
- package/lib/payment/postfinance-checkout/index.js +7 -10
- package/lib/payment/postfinance-checkout/types.d.ts +11 -10
- package/lib/payment/postfinance-checkout/types.js +9 -12
- package/lib/payment/postfinance-checkout/utils.d.ts +2 -3
- package/lib/payment/postfinance-checkout/utils.js +1 -2
- package/lib/payment/saferpay/adapter.d.ts +1 -2
- package/lib/payment/saferpay/adapter.js +2 -5
- package/lib/payment/saferpay/api/api/SaferpayClient.d.ts +6 -7
- package/lib/payment/saferpay/api/api/SaferpayClient.js +2 -2
- package/lib/payment/saferpay/api/api/SaferpayConnection.d.ts +0 -1
- package/lib/payment/saferpay/api/api/SaferpayConnection.js +0 -1
- package/lib/payment/saferpay/api/index.d.ts +4 -5
- package/lib/payment/saferpay/api/index.js +1 -2
- package/lib/payment/saferpay/api/models/PaymentMethods.d.ts +0 -1
- package/lib/payment/saferpay/api/models/PaymentMethods.js +0 -1
- package/lib/payment/saferpay/api/models/PaymentPageAssert.d.ts +4 -5
- package/lib/payment/saferpay/api/models/PaymentPageAssert.js +0 -1
- package/lib/payment/saferpay/api/models/PaymentPageInitialize.d.ts +4 -5
- package/lib/payment/saferpay/api/models/PaymentPageInitialize.js +0 -1
- package/lib/payment/saferpay/api/models/Request.d.ts +0 -1
- package/lib/payment/saferpay/api/models/Request.js +0 -1
- package/lib/payment/saferpay/api/models/Response.d.ts +0 -1
- package/lib/payment/saferpay/api/models/Response.js +0 -1
- package/lib/payment/saferpay/api/models/Transaction.d.ts +0 -1
- package/lib/payment/saferpay/api/models/Transaction.js +0 -1
- package/lib/payment/saferpay/api/models/TransactionCancel.d.ts +2 -3
- package/lib/payment/saferpay/api/models/TransactionCancel.js +0 -1
- package/lib/payment/saferpay/api/models/TransactionCapture.d.ts +3 -4
- package/lib/payment/saferpay/api/models/TransactionCapture.js +0 -1
- package/lib/payment/saferpay/buildSignature.d.ts +0 -1
- package/lib/payment/saferpay/buildSignature.js +0 -1
- package/lib/payment/saferpay/db/SaferpayTransactionsCollection.d.ts +1 -2
- package/lib/payment/saferpay/db/SaferpayTransactionsCollection.js +1 -1
- package/lib/payment/saferpay/getReturnPath.d.ts +0 -1
- package/lib/payment/saferpay/getReturnPath.js +0 -1
- package/lib/payment/saferpay/handler-express.d.ts +0 -1
- package/lib/payment/saferpay/handler-express.js +1 -2
- package/lib/payment/saferpay/handler-fastify.d.ts +1 -2
- package/lib/payment/saferpay/handler-fastify.js +1 -2
- package/lib/payment/saferpay/index.d.ts +2 -3
- package/lib/payment/saferpay/index.js +2 -3
- package/lib/payment/saferpay/module.d.ts +2 -3
- package/lib/payment/saferpay/module.js +2 -2
- package/lib/payment/stripe/handler-express.d.ts +0 -1
- package/lib/payment/stripe/handler-express.js +1 -2
- package/lib/payment/stripe/handler-fastify.d.ts +1 -2
- package/lib/payment/stripe/handler-fastify.js +1 -2
- package/lib/payment/stripe/index.d.ts +0 -1
- package/lib/payment/stripe/index.js +1 -4
- package/lib/payment/stripe/stripe.d.ts +1 -2
- package/lib/payment/stripe/stripe.js +1 -2
- package/lib/presets/all-express.d.ts +1 -2
- package/lib/presets/all-express.js +9 -10
- package/lib/presets/all-fastify.d.ts +2 -3
- package/lib/presets/all-fastify.js +9 -10
- package/lib/presets/all.d.ts +23 -24
- package/lib/presets/all.js +20 -25
- package/lib/presets/base-express.d.ts +0 -1
- package/lib/presets/base-express.js +1 -2
- package/lib/presets/base-fastify.d.ts +1 -2
- package/lib/presets/base-fastify.js +1 -3
- package/lib/presets/base.d.ts +23 -24
- package/lib/presets/base.js +23 -33
- package/lib/presets/countries/ch.d.ts +2 -3
- package/lib/presets/countries/ch.js +2 -3
- package/lib/presets/crypto-express.d.ts +1 -2
- package/lib/presets/crypto-express.js +2 -3
- package/lib/presets/crypto-fastify.d.ts +1 -2
- package/lib/presets/crypto-fastify.js +2 -3
- package/lib/presets/crypto.d.ts +6 -7
- package/lib/presets/crypto.js +6 -8
- package/lib/pricing/delivery-swiss-tax.d.ts +1 -2
- package/lib/pricing/delivery-swiss-tax.js +2 -3
- package/lib/pricing/discount-100-off.d.ts +1 -2
- package/lib/pricing/discount-100-off.js +0 -4
- package/lib/pricing/discount-half-price-manual.d.ts +1 -2
- package/lib/pricing/discount-half-price-manual.js +0 -4
- package/lib/pricing/discount-half-price.d.ts +1 -2
- package/lib/pricing/discount-half-price.js +0 -4
- package/lib/pricing/free-delivery.d.ts +1 -2
- package/lib/pricing/free-delivery.js +0 -1
- package/lib/pricing/free-payment.d.ts +1 -2
- package/lib/pricing/free-payment.js +0 -1
- package/lib/pricing/order-delivery.d.ts +1 -2
- package/lib/pricing/order-delivery.js +0 -2
- package/lib/pricing/order-discount.d.ts +1 -2
- package/lib/pricing/order-discount.js +0 -4
- package/lib/pricing/order-items-discount.d.ts +0 -1
- package/lib/pricing/order-items-discount.js +0 -5
- package/lib/pricing/order-items.d.ts +0 -1
- package/lib/pricing/order-items.js +0 -2
- package/lib/pricing/order-payment.d.ts +0 -1
- package/lib/pricing/order-payment.js +0 -2
- package/lib/pricing/order-round.d.ts +1 -2
- package/lib/pricing/order-round.js +0 -6
- package/lib/pricing/product-catalog-price-options.d.ts +0 -1
- package/lib/pricing/product-catalog-price-options.js +0 -1
- package/lib/pricing/product-catalog-price.d.ts +1 -2
- package/lib/pricing/product-catalog-price.js +2 -3
- package/lib/pricing/product-discount.d.ts +0 -1
- package/lib/pricing/product-discount.js +0 -1
- package/lib/pricing/product-price-rateconversion.d.ts +1 -2
- package/lib/pricing/product-price-rateconversion.js +0 -4
- package/lib/pricing/product-round.d.ts +1 -2
- package/lib/pricing/product-round.js +0 -1
- package/lib/pricing/product-swiss-tax.d.ts +1 -2
- package/lib/pricing/product-swiss-tax.js +2 -5
- package/lib/pricing/tax/ch.d.ts +2 -3
- package/lib/pricing/tax/ch.js +0 -1
- package/lib/pricing/utils/isDeliveryAddressInCountry.d.ts +1 -2
- package/lib/pricing/utils/isDeliveryAddressInCountry.js +0 -1
- package/lib/quotations/manual.d.ts +0 -1
- package/lib/quotations/manual.js +0 -1
- package/lib/warehousing/eth-minter.d.ts +0 -1
- package/lib/warehousing/eth-minter.js +2 -11
- package/lib/warehousing/store.d.ts +0 -1
- package/lib/warehousing/store.js +0 -1
- package/lib/worker/budgetsms.d.ts +0 -1
- package/lib/worker/budgetsms.js +4 -52
- package/lib/worker/bulk-import.d.ts +1 -2
- package/lib/worker/bulk-import.js +1 -3
- package/lib/worker/bulkgate.d.ts +0 -1
- package/lib/worker/bulkgate.js +7 -20
- package/lib/worker/email.d.ts +0 -1
- package/lib/worker/email.js +0 -3
- package/lib/worker/enrollment-order-generator.d.ts +0 -1
- package/lib/worker/enrollment-order-generator.js +1 -2
- package/lib/worker/error-notifications.d.ts +1 -2
- package/lib/worker/error-notifications.js +0 -1
- package/lib/worker/export-token.d.ts +1 -2
- package/lib/worker/export-token.js +1 -2
- package/lib/worker/external.d.ts +1 -2
- package/lib/worker/external.js +0 -1
- package/lib/worker/heartbeat.d.ts +0 -1
- package/lib/worker/heartbeat.js +0 -1
- package/lib/worker/http-request.d.ts +1 -2
- package/lib/worker/http-request.js +0 -3
- package/lib/worker/message.d.ts +2 -3
- package/lib/worker/message.js +2 -3
- package/lib/worker/push-notification.d.ts +0 -1
- package/lib/worker/push-notification.js +0 -1
- package/lib/worker/twilio.d.ts +0 -1
- package/lib/worker/twilio.js +1 -2
- package/lib/worker/update-coinbase-rates.d.ts +0 -1
- package/lib/worker/update-coinbase-rates.js +1 -3
- package/lib/worker/update-ecb-rates.d.ts +0 -1
- package/lib/worker/update-ecb-rates.js +0 -3
- package/lib/worker/update-token-ownership.d.ts +1 -2
- package/lib/worker/update-token-ownership.js +0 -1
- package/lib/worker/zombie-killer.d.ts +1 -2
- package/lib/worker/zombie-killer.js +0 -7
- package/package.json +20 -19
- package/lib/delivery/post.d.ts.map +0 -1
- package/lib/delivery/post.js.map +0 -1
- package/lib/delivery/send-message.d.ts.map +0 -1
- package/lib/delivery/send-message.js.map +0 -1
- package/lib/delivery/stores.d.ts.map +0 -1
- package/lib/delivery/stores.js.map +0 -1
- package/lib/enrollments/licensed.d.ts.map +0 -1
- package/lib/enrollments/licensed.js.map +0 -1
- package/lib/events/aws-eventbridge.d.ts.map +0 -1
- package/lib/events/aws-eventbridge.js.map +0 -1
- package/lib/events/node-event-emitter.d.ts.map +0 -1
- package/lib/events/node-event-emitter.js.map +0 -1
- package/lib/events/redis.d.ts.map +0 -1
- package/lib/events/redis.js.map +0 -1
- package/lib/files/gridfs/adapter.d.ts.map +0 -1
- package/lib/files/gridfs/adapter.js.map +0 -1
- package/lib/files/gridfs/handler-express.d.ts.map +0 -1
- package/lib/files/gridfs/handler-express.js.map +0 -1
- package/lib/files/gridfs/handler-fastify.d.ts.map +0 -1
- package/lib/files/gridfs/handler-fastify.js.map +0 -1
- package/lib/files/gridfs/index.d.ts.map +0 -1
- package/lib/files/gridfs/index.js.map +0 -1
- package/lib/files/gridfs/module.d.ts.map +0 -1
- package/lib/files/gridfs/module.js.map +0 -1
- package/lib/files/gridfs/sign.d.ts.map +0 -1
- package/lib/files/gridfs/sign.js.map +0 -1
- package/lib/files/minio/handler-express.d.ts.map +0 -1
- package/lib/files/minio/handler-express.js.map +0 -1
- package/lib/files/minio/handler-fastify.d.ts.map +0 -1
- package/lib/files/minio/handler-fastify.js.map +0 -1
- package/lib/files/minio/index.d.ts.map +0 -1
- package/lib/files/minio/index.js.map +0 -1
- package/lib/filters/local-search.d.ts.map +0 -1
- package/lib/filters/local-search.js.map +0 -1
- package/lib/filters/strict-equal.d.ts.map +0 -1
- package/lib/filters/strict-equal.js.map +0 -1
- package/lib/payment/apple-iap/adapter.d.ts.map +0 -1
- package/lib/payment/apple-iap/adapter.js.map +0 -1
- package/lib/payment/apple-iap/db/AppleTransactionsCollection.d.ts.map +0 -1
- package/lib/payment/apple-iap/db/AppleTransactionsCollection.js.map +0 -1
- package/lib/payment/apple-iap/fix-periods.d.ts.map +0 -1
- package/lib/payment/apple-iap/fix-periods.js.map +0 -1
- package/lib/payment/apple-iap/handler-express.d.ts.map +0 -1
- package/lib/payment/apple-iap/handler-express.js.map +0 -1
- package/lib/payment/apple-iap/handler-fastify.d.ts.map +0 -1
- package/lib/payment/apple-iap/handler-fastify.js.map +0 -1
- package/lib/payment/apple-iap/index.d.ts.map +0 -1
- package/lib/payment/apple-iap/index.js.map +0 -1
- package/lib/payment/apple-iap/module.d.ts.map +0 -1
- package/lib/payment/apple-iap/module.js.map +0 -1
- package/lib/payment/apple-iap/verify-receipt.d.ts.map +0 -1
- package/lib/payment/apple-iap/verify-receipt.js.map +0 -1
- package/lib/payment/braintree.d.ts.map +0 -1
- package/lib/payment/braintree.js.map +0 -1
- package/lib/payment/cryptopay/db/CryptopayTransactions.d.ts.map +0 -1
- package/lib/payment/cryptopay/db/CryptopayTransactions.js.map +0 -1
- package/lib/payment/cryptopay/denote-amount.d.ts.map +0 -1
- package/lib/payment/cryptopay/denote-amount.js.map +0 -1
- package/lib/payment/cryptopay/derive-btc-address.d.ts.map +0 -1
- package/lib/payment/cryptopay/derive-btc-address.js.map +0 -1
- package/lib/payment/cryptopay/derive-eth-address.d.ts.map +0 -1
- package/lib/payment/cryptopay/derive-eth-address.js.map +0 -1
- package/lib/payment/cryptopay/handle-webhook.d.ts.map +0 -1
- package/lib/payment/cryptopay/handle-webhook.js.map +0 -1
- package/lib/payment/cryptopay/handler-express.d.ts.map +0 -1
- package/lib/payment/cryptopay/handler-express.js.map +0 -1
- package/lib/payment/cryptopay/handler-fastify.d.ts.map +0 -1
- package/lib/payment/cryptopay/handler-fastify.js.map +0 -1
- package/lib/payment/cryptopay/index.d.ts.map +0 -1
- package/lib/payment/cryptopay/index.js.map +0 -1
- package/lib/payment/cryptopay/module.d.ts.map +0 -1
- package/lib/payment/cryptopay/module.js.map +0 -1
- package/lib/payment/cryptopay/plugin.d.ts.map +0 -1
- package/lib/payment/cryptopay/plugin.js.map +0 -1
- package/lib/payment/datatrans-v2/api/authorize.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/api/authorize.js.map +0 -1
- package/lib/payment/datatrans-v2/api/authorizeAuthenticated.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/api/authorizeAuthenticated.js.map +0 -1
- package/lib/payment/datatrans-v2/api/cancel.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/api/cancel.js.map +0 -1
- package/lib/payment/datatrans-v2/api/index.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/api/index.js.map +0 -1
- package/lib/payment/datatrans-v2/api/init.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/api/init.js.map +0 -1
- package/lib/payment/datatrans-v2/api/makeFetcher.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/api/makeFetcher.js.map +0 -1
- package/lib/payment/datatrans-v2/api/secureFields.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/api/secureFields.js.map +0 -1
- package/lib/payment/datatrans-v2/api/settle.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/api/settle.js.map +0 -1
- package/lib/payment/datatrans-v2/api/status.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/api/status.js.map +0 -1
- package/lib/payment/datatrans-v2/api/types.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/api/types.js.map +0 -1
- package/lib/payment/datatrans-v2/api/validate.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/api/validate.js.map +0 -1
- package/lib/payment/datatrans-v2/generateSignature.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/generateSignature.js.map +0 -1
- package/lib/payment/datatrans-v2/getPaths.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/getPaths.js.map +0 -1
- package/lib/payment/datatrans-v2/handler-express.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/handler-express.js.map +0 -1
- package/lib/payment/datatrans-v2/handler-fastify.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/handler-fastify.js.map +0 -1
- package/lib/payment/datatrans-v2/index.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/index.js.map +0 -1
- package/lib/payment/datatrans-v2/parseRegistrationData.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/parseRegistrationData.js.map +0 -1
- package/lib/payment/datatrans-v2/roundedAmountFromOrder.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/roundedAmountFromOrder.js.map +0 -1
- package/lib/payment/datatrans-v2/splitProperties.d.ts.map +0 -1
- package/lib/payment/datatrans-v2/splitProperties.js.map +0 -1
- package/lib/payment/invoice-prepaid.d.ts.map +0 -1
- package/lib/payment/invoice-prepaid.js.map +0 -1
- package/lib/payment/invoice.d.ts.map +0 -1
- package/lib/payment/invoice.js.map +0 -1
- package/lib/payment/paypal-checkout.d.ts.map +0 -1
- package/lib/payment/paypal-checkout.js.map +0 -1
- package/lib/payment/payrexx/api/index.d.ts.map +0 -1
- package/lib/payment/payrexx/api/index.js.map +0 -1
- package/lib/payment/payrexx/api/makeFetcher.d.ts.map +0 -1
- package/lib/payment/payrexx/api/makeFetcher.js.map +0 -1
- package/lib/payment/payrexx/handler-express.d.ts.map +0 -1
- package/lib/payment/payrexx/handler-express.js.map +0 -1
- package/lib/payment/payrexx/handler-fastify.d.ts.map +0 -1
- package/lib/payment/payrexx/handler-fastify.js.map +0 -1
- package/lib/payment/payrexx/index.d.ts.map +0 -1
- package/lib/payment/payrexx/index.js.map +0 -1
- package/lib/payment/payrexx/payrexx.d.ts.map +0 -1
- package/lib/payment/payrexx/payrexx.js.map +0 -1
- package/lib/payment/postfinance-checkout/api-client.d.ts.map +0 -1
- package/lib/payment/postfinance-checkout/api-client.js.map +0 -1
- package/lib/payment/postfinance-checkout/api-types.d.ts.map +0 -1
- package/lib/payment/postfinance-checkout/api-types.js.map +0 -1
- package/lib/payment/postfinance-checkout/api.d.ts.map +0 -1
- package/lib/payment/postfinance-checkout/api.js.map +0 -1
- package/lib/payment/postfinance-checkout/handler-express.d.ts.map +0 -1
- package/lib/payment/postfinance-checkout/handler-express.js.map +0 -1
- package/lib/payment/postfinance-checkout/handler-fastify.d.ts.map +0 -1
- package/lib/payment/postfinance-checkout/handler-fastify.js.map +0 -1
- package/lib/payment/postfinance-checkout/index.d.ts.map +0 -1
- package/lib/payment/postfinance-checkout/index.js.map +0 -1
- package/lib/payment/postfinance-checkout/types.d.ts.map +0 -1
- package/lib/payment/postfinance-checkout/types.js.map +0 -1
- package/lib/payment/postfinance-checkout/utils.d.ts.map +0 -1
- package/lib/payment/postfinance-checkout/utils.js.map +0 -1
- package/lib/payment/saferpay/adapter.d.ts.map +0 -1
- package/lib/payment/saferpay/adapter.js.map +0 -1
- package/lib/payment/saferpay/api/api/SaferpayClient.d.ts.map +0 -1
- package/lib/payment/saferpay/api/api/SaferpayClient.js.map +0 -1
- package/lib/payment/saferpay/api/api/SaferpayConnection.d.ts.map +0 -1
- package/lib/payment/saferpay/api/api/SaferpayConnection.js.map +0 -1
- package/lib/payment/saferpay/api/index.d.ts.map +0 -1
- package/lib/payment/saferpay/api/index.js.map +0 -1
- package/lib/payment/saferpay/api/models/PaymentMethods.d.ts.map +0 -1
- package/lib/payment/saferpay/api/models/PaymentMethods.js.map +0 -1
- package/lib/payment/saferpay/api/models/PaymentPageAssert.d.ts.map +0 -1
- package/lib/payment/saferpay/api/models/PaymentPageAssert.js.map +0 -1
- package/lib/payment/saferpay/api/models/PaymentPageInitialize.d.ts.map +0 -1
- package/lib/payment/saferpay/api/models/PaymentPageInitialize.js.map +0 -1
- package/lib/payment/saferpay/api/models/Request.d.ts.map +0 -1
- package/lib/payment/saferpay/api/models/Request.js.map +0 -1
- package/lib/payment/saferpay/api/models/Response.d.ts.map +0 -1
- package/lib/payment/saferpay/api/models/Response.js.map +0 -1
- package/lib/payment/saferpay/api/models/Transaction.d.ts.map +0 -1
- package/lib/payment/saferpay/api/models/Transaction.js.map +0 -1
- package/lib/payment/saferpay/api/models/TransactionCancel.d.ts.map +0 -1
- package/lib/payment/saferpay/api/models/TransactionCancel.js.map +0 -1
- package/lib/payment/saferpay/api/models/TransactionCapture.d.ts.map +0 -1
- package/lib/payment/saferpay/api/models/TransactionCapture.js.map +0 -1
- package/lib/payment/saferpay/buildSignature.d.ts.map +0 -1
- package/lib/payment/saferpay/buildSignature.js.map +0 -1
- package/lib/payment/saferpay/db/SaferpayTransactionsCollection.d.ts.map +0 -1
- package/lib/payment/saferpay/db/SaferpayTransactionsCollection.js.map +0 -1
- package/lib/payment/saferpay/getReturnPath.d.ts.map +0 -1
- package/lib/payment/saferpay/getReturnPath.js.map +0 -1
- package/lib/payment/saferpay/handler-express.d.ts.map +0 -1
- package/lib/payment/saferpay/handler-express.js.map +0 -1
- package/lib/payment/saferpay/handler-fastify.d.ts.map +0 -1
- package/lib/payment/saferpay/handler-fastify.js.map +0 -1
- package/lib/payment/saferpay/index.d.ts.map +0 -1
- package/lib/payment/saferpay/index.js.map +0 -1
- package/lib/payment/saferpay/module.d.ts.map +0 -1
- package/lib/payment/saferpay/module.js.map +0 -1
- package/lib/payment/stripe/handler-express.d.ts.map +0 -1
- package/lib/payment/stripe/handler-express.js.map +0 -1
- package/lib/payment/stripe/handler-fastify.d.ts.map +0 -1
- package/lib/payment/stripe/handler-fastify.js.map +0 -1
- package/lib/payment/stripe/index.d.ts.map +0 -1
- package/lib/payment/stripe/index.js.map +0 -1
- package/lib/payment/stripe/stripe.d.ts.map +0 -1
- package/lib/payment/stripe/stripe.js.map +0 -1
- package/lib/presets/all-express.d.ts.map +0 -1
- package/lib/presets/all-express.js.map +0 -1
- package/lib/presets/all-fastify.d.ts.map +0 -1
- package/lib/presets/all-fastify.js.map +0 -1
- package/lib/presets/all.d.ts.map +0 -1
- package/lib/presets/all.js.map +0 -1
- package/lib/presets/base-express.d.ts.map +0 -1
- package/lib/presets/base-express.js.map +0 -1
- package/lib/presets/base-fastify.d.ts.map +0 -1
- package/lib/presets/base-fastify.js.map +0 -1
- package/lib/presets/base.d.ts.map +0 -1
- package/lib/presets/base.js.map +0 -1
- package/lib/presets/countries/ch.d.ts.map +0 -1
- package/lib/presets/countries/ch.js.map +0 -1
- package/lib/presets/crypto-express.d.ts.map +0 -1
- package/lib/presets/crypto-express.js.map +0 -1
- package/lib/presets/crypto-fastify.d.ts.map +0 -1
- package/lib/presets/crypto-fastify.js.map +0 -1
- package/lib/presets/crypto.d.ts.map +0 -1
- package/lib/presets/crypto.js.map +0 -1
- package/lib/pricing/delivery-swiss-tax.d.ts.map +0 -1
- package/lib/pricing/delivery-swiss-tax.js.map +0 -1
- package/lib/pricing/discount-100-off.d.ts.map +0 -1
- package/lib/pricing/discount-100-off.js.map +0 -1
- package/lib/pricing/discount-half-price-manual.d.ts.map +0 -1
- package/lib/pricing/discount-half-price-manual.js.map +0 -1
- package/lib/pricing/discount-half-price.d.ts.map +0 -1
- package/lib/pricing/discount-half-price.js.map +0 -1
- package/lib/pricing/free-delivery.d.ts.map +0 -1
- package/lib/pricing/free-delivery.js.map +0 -1
- package/lib/pricing/free-payment.d.ts.map +0 -1
- package/lib/pricing/free-payment.js.map +0 -1
- package/lib/pricing/order-delivery.d.ts.map +0 -1
- package/lib/pricing/order-delivery.js.map +0 -1
- package/lib/pricing/order-discount.d.ts.map +0 -1
- package/lib/pricing/order-discount.js.map +0 -1
- package/lib/pricing/order-items-discount.d.ts.map +0 -1
- package/lib/pricing/order-items-discount.js.map +0 -1
- package/lib/pricing/order-items.d.ts.map +0 -1
- package/lib/pricing/order-items.js.map +0 -1
- package/lib/pricing/order-payment.d.ts.map +0 -1
- package/lib/pricing/order-payment.js.map +0 -1
- package/lib/pricing/order-round.d.ts.map +0 -1
- package/lib/pricing/order-round.js.map +0 -1
- package/lib/pricing/product-catalog-price-options.d.ts.map +0 -1
- package/lib/pricing/product-catalog-price-options.js.map +0 -1
- package/lib/pricing/product-catalog-price.d.ts.map +0 -1
- package/lib/pricing/product-catalog-price.js.map +0 -1
- package/lib/pricing/product-discount.d.ts.map +0 -1
- package/lib/pricing/product-discount.js.map +0 -1
- package/lib/pricing/product-price-rateconversion.d.ts.map +0 -1
- package/lib/pricing/product-price-rateconversion.js.map +0 -1
- package/lib/pricing/product-round.d.ts.map +0 -1
- package/lib/pricing/product-round.js.map +0 -1
- package/lib/pricing/product-swiss-tax.d.ts.map +0 -1
- package/lib/pricing/product-swiss-tax.js.map +0 -1
- package/lib/pricing/tax/ch.d.ts.map +0 -1
- package/lib/pricing/tax/ch.js.map +0 -1
- package/lib/pricing/utils/isDeliveryAddressInCountry.d.ts.map +0 -1
- package/lib/pricing/utils/isDeliveryAddressInCountry.js.map +0 -1
- package/lib/quotations/manual.d.ts.map +0 -1
- package/lib/quotations/manual.js.map +0 -1
- package/lib/warehousing/eth-minter.d.ts.map +0 -1
- package/lib/warehousing/eth-minter.js.map +0 -1
- package/lib/warehousing/store.d.ts.map +0 -1
- package/lib/warehousing/store.js.map +0 -1
- package/lib/worker/budgetsms.d.ts.map +0 -1
- package/lib/worker/budgetsms.js.map +0 -1
- package/lib/worker/bulk-import.d.ts.map +0 -1
- package/lib/worker/bulk-import.js.map +0 -1
- package/lib/worker/bulkgate.d.ts.map +0 -1
- package/lib/worker/bulkgate.js.map +0 -1
- package/lib/worker/email.d.ts.map +0 -1
- package/lib/worker/email.js.map +0 -1
- package/lib/worker/enrollment-order-generator.d.ts.map +0 -1
- package/lib/worker/enrollment-order-generator.js.map +0 -1
- package/lib/worker/error-notifications.d.ts.map +0 -1
- package/lib/worker/error-notifications.js.map +0 -1
- package/lib/worker/export-token.d.ts.map +0 -1
- package/lib/worker/export-token.js.map +0 -1
- package/lib/worker/external.d.ts.map +0 -1
- package/lib/worker/external.js.map +0 -1
- package/lib/worker/heartbeat.d.ts.map +0 -1
- package/lib/worker/heartbeat.js.map +0 -1
- package/lib/worker/http-request.d.ts.map +0 -1
- package/lib/worker/http-request.js.map +0 -1
- package/lib/worker/message.d.ts.map +0 -1
- package/lib/worker/message.js.map +0 -1
- package/lib/worker/push-notification.d.ts.map +0 -1
- package/lib/worker/push-notification.js.map +0 -1
- package/lib/worker/twilio.d.ts.map +0 -1
- package/lib/worker/twilio.js.map +0 -1
- package/lib/worker/update-coinbase-rates.d.ts.map +0 -1
- package/lib/worker/update-coinbase-rates.js.map +0 -1
- package/lib/worker/update-ecb-rates.d.ts.map +0 -1
- package/lib/worker/update-ecb-rates.js.map +0 -1
- package/lib/worker/update-token-ownership.d.ts.map +0 -1
- package/lib/worker/update-token-ownership.js.map +0 -1
- package/lib/worker/zombie-killer.d.ts.map +0 -1
- package/lib/worker/zombie-killer.js.map +0 -1
- package/readme.md +0 -5
- package/src/delivery/post.ts +0 -30
- package/src/delivery/send-message.ts +0 -50
- package/src/delivery/stores.ts +0 -53
- package/src/enrollments/licensed.ts +0 -61
- package/src/events/aws-eventbridge.ts +0 -45
- package/src/events/node-event-emitter.ts +0 -18
- package/src/events/redis.ts +0 -34
- package/src/files/gridfs/adapter.ts +0 -176
- package/src/files/gridfs/handler-express.ts +0 -145
- package/src/files/gridfs/handler-fastify.ts +0 -177
- package/src/files/gridfs/index.ts +0 -6
- package/src/files/gridfs/module.ts +0 -44
- package/src/files/gridfs/sign.ts +0 -28
- package/src/files/minio/handler-express.ts +0 -35
- package/src/files/minio/handler-fastify.ts +0 -44
- package/src/files/minio/index.ts +0 -232
- package/src/filters/local-search.ts +0 -101
- package/src/filters/strict-equal.ts +0 -30
- package/src/payment/apple-iap/adapter.ts +0 -153
- package/src/payment/apple-iap/db/AppleTransactionsCollection.ts +0 -14
- package/src/payment/apple-iap/fix-periods.ts +0 -31
- package/src/payment/apple-iap/handler-express.ts +0 -140
- package/src/payment/apple-iap/handler-fastify.ts +0 -147
- package/src/payment/apple-iap/index.ts +0 -6
- package/src/payment/apple-iap/module.ts +0 -34
- package/src/payment/apple-iap/verify-receipt.ts +0 -27
- package/src/payment/braintree.ts +0 -167
- package/src/payment/cryptopay/db/CryptopayTransactions.ts +0 -16
- package/src/payment/cryptopay/denote-amount.test.ts +0 -28
- package/src/payment/cryptopay/denote-amount.ts +0 -29
- package/src/payment/cryptopay/derive-btc-address.test.ts +0 -22
- package/src/payment/cryptopay/derive-btc-address.ts +0 -46
- package/src/payment/cryptopay/derive-eth-address.test.ts +0 -22
- package/src/payment/cryptopay/derive-eth-address.ts +0 -40
- package/src/payment/cryptopay/handle-webhook.ts +0 -103
- package/src/payment/cryptopay/handler-express.ts +0 -21
- package/src/payment/cryptopay/handler-fastify.ts +0 -24
- package/src/payment/cryptopay/index.ts +0 -7
- package/src/payment/cryptopay/module.ts +0 -138
- package/src/payment/cryptopay/plugin.ts +0 -282
- package/src/payment/cryptopay/readme.md +0 -23
- package/src/payment/datatrans-v2/api/authorize.ts +0 -17
- package/src/payment/datatrans-v2/api/authorizeAuthenticated.ts +0 -20
- package/src/payment/datatrans-v2/api/cancel.ts +0 -13
- package/src/payment/datatrans-v2/api/index.ts +0 -24
- package/src/payment/datatrans-v2/api/init.ts +0 -43
- package/src/payment/datatrans-v2/api/makeFetcher.ts +0 -52
- package/src/payment/datatrans-v2/api/secureFields.ts +0 -19
- package/src/payment/datatrans-v2/api/settle.ts +0 -13
- package/src/payment/datatrans-v2/api/status.ts +0 -8
- package/src/payment/datatrans-v2/api/types.ts +0 -378
- package/src/payment/datatrans-v2/api/validate.ts +0 -13
- package/src/payment/datatrans-v2/generateSignature.test.ts +0 -18
- package/src/payment/datatrans-v2/generateSignature.ts +0 -36
- package/src/payment/datatrans-v2/getPaths.ts +0 -25
- package/src/payment/datatrans-v2/handler-express.ts +0 -91
- package/src/payment/datatrans-v2/handler-fastify.ts +0 -97
- package/src/payment/datatrans-v2/index.ts +0 -524
- package/src/payment/datatrans-v2/parseRegistrationData.ts +0 -34
- package/src/payment/datatrans-v2/roundedAmountFromOrder.ts +0 -16
- package/src/payment/datatrans-v2/splitProperties.ts +0 -58
- package/src/payment/invoice-prepaid.ts +0 -40
- package/src/payment/invoice.ts +0 -36
- package/src/payment/paypal-checkout.ts +0 -127
- package/src/payment/payrexx/api/index.ts +0 -84
- package/src/payment/payrexx/api/makeFetcher.ts +0 -83
- package/src/payment/payrexx/handler-express.ts +0 -93
- package/src/payment/payrexx/handler-fastify.ts +0 -105
- package/src/payment/payrexx/index.ts +0 -248
- package/src/payment/payrexx/payrexx.ts +0 -65
- package/src/payment/payrexx/readme.md +0 -4
- package/src/payment/postfinance-checkout/api-client.ts +0 -111
- package/src/payment/postfinance-checkout/api-types.ts +0 -111
- package/src/payment/postfinance-checkout/api.ts +0 -114
- package/src/payment/postfinance-checkout/handler-express.ts +0 -44
- package/src/payment/postfinance-checkout/handler-fastify.ts +0 -53
- package/src/payment/postfinance-checkout/index.ts +0 -271
- package/src/payment/postfinance-checkout/types.ts +0 -27
- package/src/payment/postfinance-checkout/utils.ts +0 -39
- package/src/payment/saferpay/adapter.ts +0 -273
- package/src/payment/saferpay/api/api/SaferpayClient.ts +0 -79
- package/src/payment/saferpay/api/api/SaferpayConnection.ts +0 -36
- package/src/payment/saferpay/api/index.ts +0 -8
- package/src/payment/saferpay/api/models/PaymentMethods.ts +0 -26
- package/src/payment/saferpay/api/models/PaymentPageAssert.ts +0 -75
- package/src/payment/saferpay/api/models/PaymentPageInitialize.ts +0 -58
- package/src/payment/saferpay/api/models/Request.ts +0 -14
- package/src/payment/saferpay/api/models/Response.ts +0 -9
- package/src/payment/saferpay/api/models/Transaction.ts +0 -6
- package/src/payment/saferpay/api/models/TransactionCancel.ts +0 -15
- package/src/payment/saferpay/api/models/TransactionCapture.ts +0 -20
- package/src/payment/saferpay/buildSignature.ts +0 -9
- package/src/payment/saferpay/db/SaferpayTransactionsCollection.ts +0 -13
- package/src/payment/saferpay/getReturnPath.ts +0 -10
- package/src/payment/saferpay/handler-express.ts +0 -71
- package/src/payment/saferpay/handler-fastify.ts +0 -80
- package/src/payment/saferpay/index.ts +0 -6
- package/src/payment/saferpay/module.ts +0 -41
- package/src/payment/stripe/handler-express.ts +0 -135
- package/src/payment/stripe/handler-fastify.ts +0 -151
- package/src/payment/stripe/index.ts +0 -163
- package/src/payment/stripe/readme.md +0 -12
- package/src/payment/stripe/stripe.ts +0 -137
- package/src/presets/all-express.ts +0 -51
- package/src/presets/all-fastify.ts +0 -72
- package/src/presets/all.ts +0 -37
- package/src/presets/base-express.ts +0 -7
- package/src/presets/base-fastify.ts +0 -20
- package/src/presets/base.ts +0 -42
- package/src/presets/countries/ch.ts +0 -2
- package/src/presets/crypto-express.ts +0 -12
- package/src/presets/crypto-fastify.ts +0 -15
- package/src/presets/crypto.ts +0 -11
- package/src/pricing/delivery-swiss-tax.ts +0 -78
- package/src/pricing/discount-100-off.test.ts +0 -41
- package/src/pricing/discount-100-off.ts +0 -48
- package/src/pricing/discount-half-price-manual.test.ts +0 -52
- package/src/pricing/discount-half-price-manual.ts +0 -47
- package/src/pricing/discount-half-price.test.ts +0 -52
- package/src/pricing/discount-half-price.ts +0 -50
- package/src/pricing/free-delivery.test.ts +0 -10
- package/src/pricing/free-delivery.ts +0 -36
- package/src/pricing/free-payment.ts +0 -37
- package/src/pricing/licenced-enrollment.test.ts +0 -38
- package/src/pricing/order-delivery.test.ts +0 -9
- package/src/pricing/order-delivery.ts +0 -47
- package/src/pricing/order-discount.test.ts +0 -10
- package/src/pricing/order-discount.ts +0 -123
- package/src/pricing/order-items-discount.ts +0 -86
- package/src/pricing/order-items.ts +0 -61
- package/src/pricing/order-payment.ts +0 -48
- package/src/pricing/order-round.ts +0 -174
- package/src/pricing/plugins-index.test.ts +0 -5
- package/src/pricing/product-catalog-price-options.ts +0 -67
- package/src/pricing/product-catalog-price.ts +0 -71
- package/src/pricing/product-discount.ts +0 -97
- package/src/pricing/product-price-rateconversion.ts +0 -74
- package/src/pricing/product-round.ts +0 -66
- package/src/pricing/product-swiss-tax.ts +0 -102
- package/src/pricing/tax/ch.test.ts +0 -20
- package/src/pricing/tax/ch.ts +0 -65
- package/src/pricing/utils/isDeliveryAddressInCountry.test.ts +0 -106
- package/src/pricing/utils/isDeliveryAddressInCountry.ts +0 -26
- package/src/quotations/manual.ts +0 -26
- package/src/warehousing/eth-minter.ts +0 -167
- package/src/warehousing/store.ts +0 -45
- package/src/worker/budgetsms.ts +0 -268
- package/src/worker/bulk-import.ts +0 -77
- package/src/worker/bulkgate.ts +0 -138
- package/src/worker/email.ts +0 -165
- package/src/worker/enrollment-order-generator.ts +0 -94
- package/src/worker/error-notifications.ts +0 -83
- package/src/worker/export-token.ts +0 -32
- package/src/worker/external.ts +0 -17
- package/src/worker/heartbeat.ts +0 -37
- package/src/worker/http-request.ts +0 -71
- package/src/worker/message.ts +0 -56
- package/src/worker/push-notification.ts +0 -121
- package/src/worker/twilio.ts +0 -78
- package/src/worker/update-coinbase-rates.ts +0 -76
- package/src/worker/update-ecb-rates.ts +0 -115
- package/src/worker/update-token-ownership.ts +0 -70
- package/src/worker/zombie-killer.ts +0 -139
- package/tests/mock/datatrans/v1/secure-fields.json +0 -4
- package/tests/mock/datatrans/v1/transactions/authorize.json +0 -48
- package/tests/mock/datatrans/v1/transactions/card_check_authorized.json +0 -47
- package/tests/mock/datatrans/v1/transactions/payment_alias_authorized/settle.json +0 -1
- package/tests/mock/datatrans/v1/transactions/payment_alias_authorized.json +0 -48
- package/tests/mock/datatrans/v1/transactions/payment_authorized/cancel.json +0 -1
- package/tests/mock/datatrans/v1/transactions/payment_authorized/settle.json +0 -1
- package/tests/mock/datatrans/v1/transactions/payment_authorized.json +0 -48
- package/tests/mock/datatrans/v1/transactions/payment_authorized_low_amount/cancel.json +0 -1
- package/tests/mock/datatrans/v1/transactions/payment_authorized_low_amount.json +0 -48
- package/tests/mock/datatrans/v1/transactions/validate.json +0 -1
- package/tests/mock/datatrans/v1/transactions.json +0 -4
- package/tests/mock/payrexx/Gateway/1000001.json +0 -106
- package/tests/mock/payrexx/Gateway.json +0 -24
- package/tests/mock/payrexx/transaction_example1.json +0 -65
- package/tests/mock/payrexx/transaction_example2.json +0 -65
- package/tests/mock/payrexx/transaction_example3.json +0 -94
- package/tsconfig.json +0 -9
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { IWorkerAdapter, WorkerAdapter, WorkerDirector } from '@unchainedshop/core';
|
|
2
|
-
import { createLogger } from '@unchainedshop/logger';
|
|
3
|
-
|
|
4
|
-
const logger = createLogger('unchained:worker:push-notification');
|
|
5
|
-
|
|
6
|
-
let webPush;
|
|
7
|
-
try {
|
|
8
|
-
const module = await import('web-push');
|
|
9
|
-
webPush = module.default;
|
|
10
|
-
} catch {
|
|
11
|
-
logger.warn(`optional peer npm package 'web-push' not installed, push notifications will not work`);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const { PUSH_NOTIFICATION_PUBLIC_KEY, PUSH_NOTIFICATION_PRIVATE_KEY } = process.env;
|
|
15
|
-
|
|
16
|
-
interface NotificationOptions {
|
|
17
|
-
vapidDetails: {
|
|
18
|
-
subject: string;
|
|
19
|
-
publicKey: string;
|
|
20
|
-
privateKey: string;
|
|
21
|
-
};
|
|
22
|
-
TTL: number;
|
|
23
|
-
urgency?: 'very-low' | 'low' | 'normal' | 'high';
|
|
24
|
-
topic?: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const PushNotificationWorkerPlugin: IWorkerAdapter<
|
|
28
|
-
{
|
|
29
|
-
subscription: any;
|
|
30
|
-
payload: string;
|
|
31
|
-
subject: string;
|
|
32
|
-
urgency?: 'very-low' | 'low' | 'normal' | 'high';
|
|
33
|
-
topic?: string;
|
|
34
|
-
},
|
|
35
|
-
any
|
|
36
|
-
> = {
|
|
37
|
-
...WorkerAdapter,
|
|
38
|
-
|
|
39
|
-
key: 'shop.unchained.worker-plugin.push-notification',
|
|
40
|
-
label: 'Push Notification',
|
|
41
|
-
|
|
42
|
-
version: '1.0',
|
|
43
|
-
|
|
44
|
-
type: 'PUSH',
|
|
45
|
-
|
|
46
|
-
doWork: async ({ subscription, subject, payload, urgency = null, topic = null }) => {
|
|
47
|
-
if (!webPush) {
|
|
48
|
-
return {
|
|
49
|
-
success: false,
|
|
50
|
-
error: {
|
|
51
|
-
name: 'WEB_PUSH_NOT_INSTALLED',
|
|
52
|
-
message: 'npm dependency web-push is not installed, please install it to use this worker',
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
if (!PUSH_NOTIFICATION_PUBLIC_KEY)
|
|
58
|
-
return {
|
|
59
|
-
success: false,
|
|
60
|
-
error: {
|
|
61
|
-
name: 'VAPID_PUBLIC_KEY_REQUIRED',
|
|
62
|
-
message: 'vapidPublicKey key required to send push notifications',
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
if (!PUSH_NOTIFICATION_PRIVATE_KEY)
|
|
66
|
-
return {
|
|
67
|
-
success: false,
|
|
68
|
-
error: {
|
|
69
|
-
name: 'VAPID_PRIVATE_KEY_REQUIRED',
|
|
70
|
-
message: 'vapidPrivateKey key are required to send push notifications',
|
|
71
|
-
},
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
if (!subscription) {
|
|
75
|
-
return {
|
|
76
|
-
success: false,
|
|
77
|
-
error: {
|
|
78
|
-
name: 'USER_SUBSCRIPTION_OBJECT_REQUIRED',
|
|
79
|
-
message: 'PUSH service subscription required',
|
|
80
|
-
},
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
const options: NotificationOptions = {
|
|
85
|
-
vapidDetails: {
|
|
86
|
-
subject,
|
|
87
|
-
publicKey: PUSH_NOTIFICATION_PUBLIC_KEY,
|
|
88
|
-
privateKey: PUSH_NOTIFICATION_PRIVATE_KEY,
|
|
89
|
-
},
|
|
90
|
-
TTL: 60,
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
if (urgency) {
|
|
94
|
-
options.urgency = urgency;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
if (topic) {
|
|
98
|
-
options.topic = topic;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
try {
|
|
102
|
-
await webPush.sendNotification(subscription, payload, options);
|
|
103
|
-
|
|
104
|
-
return {
|
|
105
|
-
success: true,
|
|
106
|
-
error: null,
|
|
107
|
-
};
|
|
108
|
-
} catch (err) {
|
|
109
|
-
return {
|
|
110
|
-
success: false,
|
|
111
|
-
error: {
|
|
112
|
-
name: err.name,
|
|
113
|
-
message: err.message,
|
|
114
|
-
stack: err.stack,
|
|
115
|
-
},
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
WorkerDirector.registerAdapter(PushNotificationWorkerPlugin);
|
package/src/worker/twilio.ts
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { IWorkerAdapter, WorkerAdapter, WorkerDirector } from '@unchainedshop/core';
|
|
2
|
-
|
|
3
|
-
const { TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, TWILIO_SMS_FROM } = process.env;
|
|
4
|
-
|
|
5
|
-
const SmsWorkerPlugin: IWorkerAdapter<
|
|
6
|
-
{
|
|
7
|
-
from?: string;
|
|
8
|
-
to: string;
|
|
9
|
-
text: string;
|
|
10
|
-
[key: string]: any; // Allow additional parameters
|
|
11
|
-
},
|
|
12
|
-
any
|
|
13
|
-
> = {
|
|
14
|
-
...WorkerAdapter,
|
|
15
|
-
|
|
16
|
-
key: 'shop.unchained.worker-plugin.twilio',
|
|
17
|
-
label: 'Send Messages through Twilio',
|
|
18
|
-
version: '1.0.0',
|
|
19
|
-
|
|
20
|
-
type: 'TWILIO',
|
|
21
|
-
|
|
22
|
-
doWork: async ({ from, to, text, ...params }) => {
|
|
23
|
-
try {
|
|
24
|
-
if (!TWILIO_SMS_FROM && !from)
|
|
25
|
-
throw new Error(
|
|
26
|
-
'Missing Twilio "from" number. Set TWILIO_SMS_FROM env var or provide "from" in input',
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
if (!to) throw new Error('Missing "to" in input');
|
|
30
|
-
|
|
31
|
-
const url = `https://api.twilio.com/2010-04-01/Accounts/${TWILIO_ACCOUNT_SID}/Messages.json`;
|
|
32
|
-
const response = await fetch(url, {
|
|
33
|
-
method: 'POST',
|
|
34
|
-
headers: {
|
|
35
|
-
Authorization: `Basic ${Buffer.from(`${TWILIO_ACCOUNT_SID}:${TWILIO_AUTH_TOKEN}`).toString('base64')}`,
|
|
36
|
-
'Content-Type': 'application/x-www-form-urlencoded',
|
|
37
|
-
},
|
|
38
|
-
body: new URLSearchParams({
|
|
39
|
-
Body: text || '',
|
|
40
|
-
From: from || TWILIO_SMS_FROM!,
|
|
41
|
-
To: to,
|
|
42
|
-
...params, // Include any additional parameters passed
|
|
43
|
-
}),
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
const data = await response.json();
|
|
47
|
-
|
|
48
|
-
if (!response.ok) {
|
|
49
|
-
return {
|
|
50
|
-
success: false,
|
|
51
|
-
error: {
|
|
52
|
-
name: 'TWILIO_ERROR',
|
|
53
|
-
message: data.message || 'Failed to send SMS',
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return {
|
|
59
|
-
success: true,
|
|
60
|
-
result: {
|
|
61
|
-
sid: data.sid,
|
|
62
|
-
},
|
|
63
|
-
error: null,
|
|
64
|
-
};
|
|
65
|
-
} catch (err) {
|
|
66
|
-
return {
|
|
67
|
-
success: false,
|
|
68
|
-
error: {
|
|
69
|
-
name: err.name,
|
|
70
|
-
message: err.message,
|
|
71
|
-
stack: err.stack,
|
|
72
|
-
},
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
WorkerDirector.registerAdapter(SmsWorkerPlugin);
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { IWorkerAdapter, WorkerAdapter, WorkerDirector } from '@unchainedshop/core';
|
|
2
|
-
import later from '@breejs/later';
|
|
3
|
-
import { ProductPriceRate } from '@unchainedshop/core-products';
|
|
4
|
-
import { resolveBestCurrency } from '@unchainedshop/utils';
|
|
5
|
-
|
|
6
|
-
const getExchangeRates = async (base): Promise<{ currency: string; rates: Record<string, string> }> => {
|
|
7
|
-
return fetch(`https://api.coinbase.com/v2/exchange-rates?currency=${base}`, {
|
|
8
|
-
method: 'GET',
|
|
9
|
-
})
|
|
10
|
-
.then((res) => res.json())
|
|
11
|
-
.then((r) => r?.data);
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const everyMinute = later.parse.cron('* * * * *');
|
|
15
|
-
|
|
16
|
-
const UpdateCoinbaseRates: IWorkerAdapter<any, any> = {
|
|
17
|
-
...WorkerAdapter,
|
|
18
|
-
|
|
19
|
-
key: 'shop.unchained.worker.update-coinbase-rates',
|
|
20
|
-
label: 'Update Coinbase Rates',
|
|
21
|
-
version: '1.0.0',
|
|
22
|
-
type: 'UPDATE_COINBASE_RATES',
|
|
23
|
-
|
|
24
|
-
doWork: async (input, unchainedAPI) => {
|
|
25
|
-
try {
|
|
26
|
-
const currencies = await unchainedAPI.modules.currencies.findCurrencies({ includeInactive: true });
|
|
27
|
-
const currencyCode = resolveBestCurrency(null, currencies); // Get fallback currency
|
|
28
|
-
|
|
29
|
-
const currencyCodes = currencies.map((currency) => currency.isoCode);
|
|
30
|
-
|
|
31
|
-
const { currency: baseCurrency, rates: pairs } = await getExchangeRates(currencyCode);
|
|
32
|
-
const timestamp = new Date();
|
|
33
|
-
|
|
34
|
-
// five minutes
|
|
35
|
-
const expiresAt = new Date(new Date().getTime() + 5 * 60 * 1000);
|
|
36
|
-
|
|
37
|
-
const rates: ProductPriceRate[] = Object.entries(pairs)
|
|
38
|
-
.map(([quoteCurrency, rate]) => {
|
|
39
|
-
return {
|
|
40
|
-
baseCurrency,
|
|
41
|
-
quoteCurrency,
|
|
42
|
-
rate: parseFloat(rate),
|
|
43
|
-
timestamp,
|
|
44
|
-
expiresAt,
|
|
45
|
-
};
|
|
46
|
-
})
|
|
47
|
-
.filter(
|
|
48
|
-
(rate) =>
|
|
49
|
-
currencyCodes.includes(rate.quoteCurrency) && rate.quoteCurrency !== rate.baseCurrency,
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
const success = await unchainedAPI.modules.products.prices.rates.updateRates(rates);
|
|
53
|
-
return {
|
|
54
|
-
success,
|
|
55
|
-
result: {
|
|
56
|
-
ratesUpdated: rates.length,
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
} catch {
|
|
60
|
-
return {
|
|
61
|
-
success: false,
|
|
62
|
-
error: {
|
|
63
|
-
name: 'UPDATE_COINBASE_RATES_FAILED',
|
|
64
|
-
message: 'Updating Coinbase Rates failed',
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
WorkerDirector.registerAdapter(UpdateCoinbaseRates);
|
|
72
|
-
|
|
73
|
-
WorkerDirector.configureAutoscheduling({
|
|
74
|
-
type: UpdateCoinbaseRates.type,
|
|
75
|
-
schedule: everyMinute,
|
|
76
|
-
});
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { IWorkerAdapter, WorkerAdapter, WorkerDirector } from '@unchainedshop/core';
|
|
2
|
-
import { ProductPriceRate } from '@unchainedshop/core-products';
|
|
3
|
-
import later from '@breejs/later';
|
|
4
|
-
import { createLogger } from '@unchainedshop/logger';
|
|
5
|
-
|
|
6
|
-
const logger = createLogger('unchained:worker:update-ecb-rates');
|
|
7
|
-
|
|
8
|
-
let xml2json;
|
|
9
|
-
try {
|
|
10
|
-
const module = await import('xml-js');
|
|
11
|
-
xml2json = module.xml2json;
|
|
12
|
-
} catch {
|
|
13
|
-
logger.warn(`optional peer npm package 'xml-js' not installed, skipped ECB rate updates`);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const getExchangeRates = async (): Promise<{ currency: string; rate: string }[]> => {
|
|
17
|
-
return fetch(`https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml`, {
|
|
18
|
-
method: 'GET',
|
|
19
|
-
})
|
|
20
|
-
.then((res) => res.text())
|
|
21
|
-
.then((text) => JSON.parse(xml2json(text)))
|
|
22
|
-
.then((json) =>
|
|
23
|
-
json.elements?.[0]?.elements
|
|
24
|
-
.filter((e) => e.name.toLowerCase() === 'cube')[0]
|
|
25
|
-
?.elements[0]?.elements.map((element) => element.attributes),
|
|
26
|
-
);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
// https://www.ecb.europa.eu/stats/policy_and_exchange_rates/euro_reference_exchange_rates/html/index.en.html
|
|
30
|
-
// CET = UTC + 1
|
|
31
|
-
const everyDayAtFour = later.parse.cron('0 15 * * *');
|
|
32
|
-
|
|
33
|
-
const baseCurrency = 'EUR';
|
|
34
|
-
|
|
35
|
-
const UpdateECBRates: IWorkerAdapter<any, any> = {
|
|
36
|
-
...WorkerAdapter,
|
|
37
|
-
|
|
38
|
-
key: 'shop.unchained.worker.update-ecb-rates',
|
|
39
|
-
label: 'Update ECB Rates',
|
|
40
|
-
version: '1.0.0',
|
|
41
|
-
type: 'UPDATE_ECB_RATES',
|
|
42
|
-
|
|
43
|
-
doWork: async (input, unchainedAPI) => {
|
|
44
|
-
const { modules } = unchainedAPI;
|
|
45
|
-
|
|
46
|
-
if (!xml2json) {
|
|
47
|
-
return {
|
|
48
|
-
success: false,
|
|
49
|
-
error: {
|
|
50
|
-
name: 'XML2JSON_NOT_INSTALLED',
|
|
51
|
-
message: 'npm dependency xml2json is not installed, please install it to use this worker',
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
try {
|
|
57
|
-
const data = await getExchangeRates();
|
|
58
|
-
const timestamp = new Date();
|
|
59
|
-
const expiresAt = new Date(new Date().getTime() + 24 * 60 * 60 * 1000);
|
|
60
|
-
|
|
61
|
-
const currencies = await modules.currencies.findCurrencies({ includeInactive: true });
|
|
62
|
-
const currencyCodes = currencies.map((currency) => currency.isoCode);
|
|
63
|
-
|
|
64
|
-
if (!currencyCodes.includes(baseCurrency))
|
|
65
|
-
return {
|
|
66
|
-
success: true,
|
|
67
|
-
result: {
|
|
68
|
-
ratesUpdated: 0,
|
|
69
|
-
info: 'EUR not enabled',
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
const rates: ProductPriceRate[] = data
|
|
74
|
-
.map((d) => {
|
|
75
|
-
return {
|
|
76
|
-
baseCurrency,
|
|
77
|
-
quoteCurrency: d.currency,
|
|
78
|
-
rate: parseFloat(d.rate),
|
|
79
|
-
timestamp,
|
|
80
|
-
expiresAt,
|
|
81
|
-
};
|
|
82
|
-
})
|
|
83
|
-
.filter(
|
|
84
|
-
(rate) =>
|
|
85
|
-
currencyCodes.includes(rate.quoteCurrency) && rate.quoteCurrency !== rate.baseCurrency,
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
const success = await modules.products.prices.rates.updateRates(rates);
|
|
89
|
-
return {
|
|
90
|
-
success,
|
|
91
|
-
result: {
|
|
92
|
-
ratesUpdated: rates.length,
|
|
93
|
-
},
|
|
94
|
-
};
|
|
95
|
-
} catch {
|
|
96
|
-
return {
|
|
97
|
-
success: false,
|
|
98
|
-
error: {
|
|
99
|
-
name: 'UPDATE_ECB_RATES_FAILED',
|
|
100
|
-
message: 'Updating ECB Rates failed',
|
|
101
|
-
},
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
WorkerDirector.registerAdapter(UpdateECBRates);
|
|
108
|
-
|
|
109
|
-
if (xml2json) {
|
|
110
|
-
WorkerDirector.configureAutoscheduling({
|
|
111
|
-
type: UpdateECBRates.type,
|
|
112
|
-
schedule: everyDayAtFour,
|
|
113
|
-
retries: 5,
|
|
114
|
-
});
|
|
115
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { IWorkerAdapter, WorkerAdapter, WorkerDirector } from '@unchainedshop/core';
|
|
2
|
-
import later from '@breejs/later';
|
|
3
|
-
|
|
4
|
-
const everyMinute = later.parse.cron('* * * * *');
|
|
5
|
-
|
|
6
|
-
export const UpdateTokenOwnership: IWorkerAdapter<void, void> = {
|
|
7
|
-
...WorkerAdapter,
|
|
8
|
-
|
|
9
|
-
key: 'shop.unchained.worker-plugin.update-token-ownership',
|
|
10
|
-
label: 'External worker to update ownership of provided tokens',
|
|
11
|
-
version: '1.0.0',
|
|
12
|
-
type: 'UPDATE_TOKEN_OWNERSHIP',
|
|
13
|
-
external: true,
|
|
14
|
-
|
|
15
|
-
async doWork() {
|
|
16
|
-
throw new Error('Cannot do work for external workers');
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export const RefreshTokens: IWorkerAdapter<void, any> = {
|
|
21
|
-
...WorkerAdapter,
|
|
22
|
-
|
|
23
|
-
key: 'shop.unchained.worker-plugin.refresh-tokens',
|
|
24
|
-
label: 'Worker to refresh tokens for accounts',
|
|
25
|
-
version: '1.0.0',
|
|
26
|
-
type: 'REFRESH_TOKENS',
|
|
27
|
-
external: false,
|
|
28
|
-
|
|
29
|
-
async doWork(input, unchainedAPI) {
|
|
30
|
-
const { modules } = unchainedAPI;
|
|
31
|
-
|
|
32
|
-
const tokens = await modules.warehousing.findTokens({ walletAddress: { $exists: true } });
|
|
33
|
-
const users = await modules.users.findUsers({ includeGuests: true, 'services.web3.verified': true });
|
|
34
|
-
const accounts = users.flatMap((user) => {
|
|
35
|
-
return user?.services?.web3?.flatMap((service) => {
|
|
36
|
-
if (service.verified) return [service.address];
|
|
37
|
-
return [];
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
tokens.forEach((token) => {
|
|
42
|
-
accounts.push(token.walletAddress);
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
if (!tokens?.length) {
|
|
46
|
-
return { success: true, result: {} };
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const forked = await modules.worker.addWork({
|
|
50
|
-
type: 'UPDATE_TOKEN_OWNERSHIP',
|
|
51
|
-
retries: 0,
|
|
52
|
-
input: {
|
|
53
|
-
filter: {
|
|
54
|
-
tokens,
|
|
55
|
-
accounts: [...new Set(accounts)],
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
return { success: true, result: { forked } };
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
WorkerDirector.registerAdapter(RefreshTokens);
|
|
64
|
-
WorkerDirector.registerAdapter(UpdateTokenOwnership);
|
|
65
|
-
|
|
66
|
-
WorkerDirector.configureAutoscheduling({
|
|
67
|
-
type: RefreshTokens.type,
|
|
68
|
-
schedule: everyMinute,
|
|
69
|
-
retries: 0,
|
|
70
|
-
});
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import { IWorkerAdapter, WorkerAdapter, WorkerDirector } from '@unchainedshop/core';
|
|
2
|
-
|
|
3
|
-
export const ZombieKillerWorker: IWorkerAdapter<
|
|
4
|
-
{ bulkImportMaxAgeInDays: number },
|
|
5
|
-
{
|
|
6
|
-
deletedProductMediaCount: number;
|
|
7
|
-
deletedAssortmentMediaCount: number;
|
|
8
|
-
deletedFilesCount: number;
|
|
9
|
-
deletedFilterTextsCount: number;
|
|
10
|
-
deletedProductTextsCount: number;
|
|
11
|
-
deletedProductVariationsCount: number;
|
|
12
|
-
deletedAssortmentTextsCount: number;
|
|
13
|
-
}
|
|
14
|
-
> = {
|
|
15
|
-
...WorkerAdapter,
|
|
16
|
-
|
|
17
|
-
key: 'shop.unchained.worker-plugin.zombie-killer',
|
|
18
|
-
label: 'Zombie Killer',
|
|
19
|
-
version: '1.0.0',
|
|
20
|
-
type: 'ZOMBIE_KILLER',
|
|
21
|
-
|
|
22
|
-
doWork: async ({ bulkImportMaxAgeInDays } = { bulkImportMaxAgeInDays: 5 }, unchainedAPI) => {
|
|
23
|
-
const { modules, services } = unchainedAPI;
|
|
24
|
-
|
|
25
|
-
try {
|
|
26
|
-
const error = false;
|
|
27
|
-
|
|
28
|
-
// Remove unreferenced filter entities
|
|
29
|
-
const filters = await modules.filters.findFilters(
|
|
30
|
-
{ includeInactive: true },
|
|
31
|
-
{ projection: { _id: 1 } },
|
|
32
|
-
);
|
|
33
|
-
const filterIds = filters.map((a) => a._id);
|
|
34
|
-
const deletedFilterTextsCount = await modules.filters.texts.deleteMany({
|
|
35
|
-
excludedFilterIds: filterIds,
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
// Remove unreferenced assortment entities
|
|
39
|
-
const assortments = await modules.assortments.findAssortments({
|
|
40
|
-
includeInactive: true,
|
|
41
|
-
includeLeaves: true,
|
|
42
|
-
});
|
|
43
|
-
const assortmentIds = assortments.map((a) => a._id);
|
|
44
|
-
const deletedAssortmentTextsCount = await modules.assortments.texts.deleteMany({
|
|
45
|
-
excludedAssortmentIds: assortmentIds,
|
|
46
|
-
});
|
|
47
|
-
const deletedAssortmentMediaCount = await modules.assortments.media.deleteMediaFiles({
|
|
48
|
-
excludedAssortmentIds: assortmentIds,
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
// Remove unreferenced product entities
|
|
52
|
-
const productIds = await modules.products.findProductIds({ includeDrafts: true });
|
|
53
|
-
const deletedProductTextsCount = await modules.products.texts.deleteMany({
|
|
54
|
-
excludedProductIds: productIds,
|
|
55
|
-
});
|
|
56
|
-
const deletedProductVariationsCount = await modules.products.variations.deleteVariations({
|
|
57
|
-
excludedProductIds: productIds,
|
|
58
|
-
});
|
|
59
|
-
const deletedProductMediaCount = await modules.products.media.deleteMediaFiles({
|
|
60
|
-
excludedProductIds: productIds,
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
// Remove unreferenced files
|
|
64
|
-
const productMedia = await modules.products.media.findProductMedias(
|
|
65
|
-
{},
|
|
66
|
-
{ projection: { mediaId: 1 } },
|
|
67
|
-
);
|
|
68
|
-
const assortmentMedia = await modules.assortments.media.findAssortmentMedias(
|
|
69
|
-
{},
|
|
70
|
-
{ projection: { mediaId: 1 } },
|
|
71
|
-
);
|
|
72
|
-
|
|
73
|
-
const allFileIdsLinked = [...productMedia, ...assortmentMedia].map((l) => l?.mediaId);
|
|
74
|
-
const allFileIdsRelevant = (
|
|
75
|
-
await modules.files.findFiles(
|
|
76
|
-
{ path: { $in: ['product-media', 'assortment-media'] } },
|
|
77
|
-
{ projection: { _id: 1 } },
|
|
78
|
-
)
|
|
79
|
-
).map((a) => a._id);
|
|
80
|
-
|
|
81
|
-
const fileIdsToRemove =
|
|
82
|
-
allFileIdsRelevant.filter((fileId) => {
|
|
83
|
-
return !allFileIdsLinked.includes(fileId);
|
|
84
|
-
}) || [];
|
|
85
|
-
|
|
86
|
-
// Remove bulk import streams older than X days
|
|
87
|
-
const bulkImportMedia = await await modules.files.findFiles({
|
|
88
|
-
path: 'bulk-import-streams',
|
|
89
|
-
created: { $lt: new Date(Date.now() - 1000 * 60 * 60 * 24 * bulkImportMaxAgeInDays) },
|
|
90
|
-
});
|
|
91
|
-
bulkImportMedia.forEach(async (media) => {
|
|
92
|
-
fileIdsToRemove.push(media._id);
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
const deletedFilesCount =
|
|
96
|
-
fileIdsToRemove.length > 0
|
|
97
|
-
? await services.files.removeFiles({
|
|
98
|
-
fileIds: fileIdsToRemove,
|
|
99
|
-
})
|
|
100
|
-
: 0;
|
|
101
|
-
|
|
102
|
-
// Return delete count
|
|
103
|
-
const result = {
|
|
104
|
-
deletedFilterTextsCount,
|
|
105
|
-
deletedProductMediaCount,
|
|
106
|
-
deletedProductTextsCount,
|
|
107
|
-
deletedProductVariationsCount,
|
|
108
|
-
deletedAssortmentMediaCount,
|
|
109
|
-
deletedAssortmentTextsCount,
|
|
110
|
-
deletedFilesCount,
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
if (error) {
|
|
114
|
-
return {
|
|
115
|
-
success: false,
|
|
116
|
-
result,
|
|
117
|
-
error,
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
return {
|
|
121
|
-
success: true,
|
|
122
|
-
result,
|
|
123
|
-
};
|
|
124
|
-
} catch (err) {
|
|
125
|
-
return {
|
|
126
|
-
success: false,
|
|
127
|
-
error: {
|
|
128
|
-
name: err.name,
|
|
129
|
-
message: err.message,
|
|
130
|
-
stack: err.stack,
|
|
131
|
-
},
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
export default ZombieKillerWorker;
|
|
138
|
-
|
|
139
|
-
WorkerDirector.registerAdapter(ZombieKillerWorker);
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"transactionId": "payment_alias_authorized",
|
|
3
|
-
"type": "payment",
|
|
4
|
-
"status": "authorized",
|
|
5
|
-
"currency": "CHF",
|
|
6
|
-
"refno": "MTExMTExMjIyMjI=",
|
|
7
|
-
"refno2": "user",
|
|
8
|
-
"paymentMethod": "VIS",
|
|
9
|
-
"detail": {
|
|
10
|
-
"authorize": {
|
|
11
|
-
"amount": 30000,
|
|
12
|
-
"acquirerAuthorizationCode": "131704"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
"language": "de",
|
|
16
|
-
"card": {
|
|
17
|
-
"alias": "70119122433810042",
|
|
18
|
-
"masked": "424242xxxxxx4242",
|
|
19
|
-
"expiryMonth": "12",
|
|
20
|
-
"expiryYear": "21",
|
|
21
|
-
"info": {
|
|
22
|
-
"brand": "VISA CREDIT",
|
|
23
|
-
"type": "credit",
|
|
24
|
-
"usage": "consumer",
|
|
25
|
-
"country": "GB",
|
|
26
|
-
"issuer": "DATATRANS"
|
|
27
|
-
},
|
|
28
|
-
"3D": {
|
|
29
|
-
"authenticationResponse": "D"
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"history": [
|
|
33
|
-
{
|
|
34
|
-
"action": "init",
|
|
35
|
-
"source": "api",
|
|
36
|
-
"date": "2021-09-03T11:16:50Z",
|
|
37
|
-
"success": true,
|
|
38
|
-
"ip": "212.232.234.26"
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"action": "authorize",
|
|
42
|
-
"source": "redirect",
|
|
43
|
-
"date": "2021-09-03T11:17:04Z",
|
|
44
|
-
"success": true,
|
|
45
|
-
"ip": "212.232.234.26"
|
|
46
|
-
}
|
|
47
|
-
]
|
|
48
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"transactionId": "card_check_authorized",
|
|
3
|
-
"type": "card_check",
|
|
4
|
-
"status": "authorized",
|
|
5
|
-
"currency": "CHF",
|
|
6
|
-
"refno": "ZDRkNGQ0ZDRkNA==",
|
|
7
|
-
"refno2": "user",
|
|
8
|
-
"paymentMethod": "VIS",
|
|
9
|
-
"detail": {
|
|
10
|
-
"authorize": {
|
|
11
|
-
"acquirerAuthorizationCode": "131704"
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
"language": "de",
|
|
15
|
-
"card": {
|
|
16
|
-
"alias": "70119122433810042",
|
|
17
|
-
"masked": "424242xxxxxx4242",
|
|
18
|
-
"expiryMonth": "12",
|
|
19
|
-
"expiryYear": "21",
|
|
20
|
-
"info": {
|
|
21
|
-
"brand": "VISA CREDIT",
|
|
22
|
-
"type": "credit",
|
|
23
|
-
"usage": "consumer",
|
|
24
|
-
"country": "GB",
|
|
25
|
-
"issuer": "DATATRANS"
|
|
26
|
-
},
|
|
27
|
-
"3D": {
|
|
28
|
-
"authenticationResponse": "D"
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
"history": [
|
|
32
|
-
{
|
|
33
|
-
"action": "init",
|
|
34
|
-
"source": "api",
|
|
35
|
-
"date": "2021-09-03T11:16:50Z",
|
|
36
|
-
"success": true,
|
|
37
|
-
"ip": "212.232.234.26"
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"action": "authorize",
|
|
41
|
-
"source": "redirect",
|
|
42
|
-
"date": "2021-09-03T11:17:04Z",
|
|
43
|
-
"success": true,
|
|
44
|
-
"ip": "212.232.234.26"
|
|
45
|
-
}
|
|
46
|
-
]
|
|
47
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|