@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
package/src/quotations/manual.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { IQuotationAdapter, QuotationDirector, QuotationAdapter } from '@unchainedshop/core';
|
|
2
|
-
|
|
3
|
-
const ManualOffering: IQuotationAdapter = {
|
|
4
|
-
...QuotationAdapter,
|
|
5
|
-
|
|
6
|
-
key: 'shop.unchained.quotations.manual',
|
|
7
|
-
version: '1.0.0',
|
|
8
|
-
label: 'Manual Offerings',
|
|
9
|
-
orderIndex: 0,
|
|
10
|
-
|
|
11
|
-
isActivatedFor: () => true,
|
|
12
|
-
|
|
13
|
-
actions: (params) => {
|
|
14
|
-
return {
|
|
15
|
-
...QuotationAdapter.actions(params),
|
|
16
|
-
|
|
17
|
-
quote: async () => {
|
|
18
|
-
return {
|
|
19
|
-
expires: new Date(new Date().getTime() + 3600 * 1000),
|
|
20
|
-
};
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
QuotationDirector.registerAdapter(ManualOffering);
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
UnchainedCore,
|
|
3
|
-
IWarehousingAdapter,
|
|
4
|
-
WarehousingContext,
|
|
5
|
-
WarehousingError,
|
|
6
|
-
WarehousingDirector,
|
|
7
|
-
WarehousingAdapter,
|
|
8
|
-
} from '@unchainedshop/core';
|
|
9
|
-
import { WarehousingProviderType } from '@unchainedshop/core-warehousing';
|
|
10
|
-
import { ProductContractStandard, ProductTypes } from '@unchainedshop/core-products';
|
|
11
|
-
import { systemLocale } from '@unchainedshop/utils';
|
|
12
|
-
import { generateDbObjectId } from '@unchainedshop/mongodb';
|
|
13
|
-
import { getFileAdapter } from '@unchainedshop/core-files';
|
|
14
|
-
import { createLogger } from '@unchainedshop/logger';
|
|
15
|
-
|
|
16
|
-
const { MINTER_TOKEN_OFFSET = '0', ROOT_URL = 'http://localhost:4010' } = process.env;
|
|
17
|
-
|
|
18
|
-
const logger = createLogger('unchained:eth-minter');
|
|
19
|
-
|
|
20
|
-
const ETHMinter: IWarehousingAdapter = {
|
|
21
|
-
...WarehousingAdapter,
|
|
22
|
-
|
|
23
|
-
key: 'shop.unchained.warehousing.infinite-minter',
|
|
24
|
-
version: '1.0',
|
|
25
|
-
label: 'Infinite Minter',
|
|
26
|
-
orderIndex: 0,
|
|
27
|
-
|
|
28
|
-
initialConfiguration: [{ key: 'chainId', value: '0' }],
|
|
29
|
-
|
|
30
|
-
typeSupported: (type) => {
|
|
31
|
-
return type === WarehousingProviderType.VIRTUAL;
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
actions: (configuration, context) => {
|
|
35
|
-
const { product, orderPosition, token, modules, locale } = context as WarehousingContext &
|
|
36
|
-
UnchainedCore;
|
|
37
|
-
const { contractAddress, contractStandard, tokenId, supply, ercMetadataProperties } =
|
|
38
|
-
product?.tokenization || {};
|
|
39
|
-
const getTokensCreated = async () => {
|
|
40
|
-
const existingTokens = await modules.warehousing.findTokens(
|
|
41
|
-
contractStandard === ProductContractStandard.ERC721
|
|
42
|
-
? { contractAddress: contractStandard }
|
|
43
|
-
: {
|
|
44
|
-
contractAddress: contractStandard,
|
|
45
|
-
tokenSerialNumber: tokenId,
|
|
46
|
-
},
|
|
47
|
-
);
|
|
48
|
-
const tokensCreated = existingTokens.reduce((acc, curToken) => {
|
|
49
|
-
return acc + curToken.quantity;
|
|
50
|
-
}, 0);
|
|
51
|
-
return tokensCreated;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
return {
|
|
55
|
-
...WarehousingAdapter.actions(configuration, context),
|
|
56
|
-
|
|
57
|
-
isActive() {
|
|
58
|
-
return product?.type === ProductTypes.TokenizedProduct;
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
configurationError() {
|
|
62
|
-
if (contractStandard === 'ERC1155' && !tokenId) {
|
|
63
|
-
logger.error(
|
|
64
|
-
`Token ID is required for ERC1155 contract standard (productId: ${product!._id})`,
|
|
65
|
-
);
|
|
66
|
-
return WarehousingError.INCOMPLETE_CONFIGURATION;
|
|
67
|
-
}
|
|
68
|
-
return null;
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
stock: async () => {
|
|
72
|
-
const tokensCreated = await getTokensCreated();
|
|
73
|
-
return supply ? supply - tokensCreated : 0;
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
tokenize: async () => {
|
|
77
|
-
// Upload Image to IPFS
|
|
78
|
-
// Upload Metadata to IPFS
|
|
79
|
-
// Prepare metadata
|
|
80
|
-
|
|
81
|
-
const chainId = configuration.find(({ key }) => key === 'chainId')?.value || undefined;
|
|
82
|
-
const meta = { contractStandard };
|
|
83
|
-
const tokensCreated = await getTokensCreated();
|
|
84
|
-
|
|
85
|
-
if (!orderPosition) {
|
|
86
|
-
throw new Error('Order position not found in context');
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
if (contractStandard === 'ERC721') {
|
|
90
|
-
// ERC721 is non-fungible, thus every tokenSerialNumber unique!
|
|
91
|
-
const items = new Array(orderPosition.quantity).fill(null).map((_, i) => ({
|
|
92
|
-
_id: generateDbObjectId(),
|
|
93
|
-
tokenSerialNumber: Number(
|
|
94
|
-
parseInt(MINTER_TOKEN_OFFSET, 10) + tokensCreated + (i + 1),
|
|
95
|
-
).toString(),
|
|
96
|
-
contractAddress,
|
|
97
|
-
quantity: 1,
|
|
98
|
-
chainId,
|
|
99
|
-
meta,
|
|
100
|
-
}));
|
|
101
|
-
return items;
|
|
102
|
-
}
|
|
103
|
-
// ERC1155 is fungible, allow the same tokenId
|
|
104
|
-
return [
|
|
105
|
-
{
|
|
106
|
-
_id: generateDbObjectId(),
|
|
107
|
-
tokenSerialNumber: tokenId!,
|
|
108
|
-
contractAddress,
|
|
109
|
-
quantity: orderPosition.quantity,
|
|
110
|
-
chainId,
|
|
111
|
-
meta,
|
|
112
|
-
},
|
|
113
|
-
];
|
|
114
|
-
},
|
|
115
|
-
|
|
116
|
-
tokenMetadata: async (tokenSerialNumber) => {
|
|
117
|
-
// Metadata standards supported
|
|
118
|
-
// https://eips.ethereum.org/EIPS/eip-1155 (backward compatible with 721)
|
|
119
|
-
// https://eips.ethereum.org/EIPS/eip-721
|
|
120
|
-
|
|
121
|
-
if (!product) {
|
|
122
|
-
throw new Error('Product not found in context');
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
const allLanguages = await modules.languages.findLanguages({
|
|
126
|
-
includeInactive: false,
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
const [firstMedia] = await modules.products.media.findProductMedias({
|
|
130
|
-
productId: product._id,
|
|
131
|
-
limit: 1,
|
|
132
|
-
});
|
|
133
|
-
const file = firstMedia && (await modules.files.findFile({ fileId: firstMedia.mediaId }));
|
|
134
|
-
|
|
135
|
-
const fileAdapter = file && getFileAdapter();
|
|
136
|
-
const signedUrl = await fileAdapter?.createDownloadURL(file!);
|
|
137
|
-
const url = signedUrl && (await modules.files.normalizeUrl(signedUrl, {}));
|
|
138
|
-
const text = await modules.products.texts.findLocalizedText({
|
|
139
|
-
productId: product._id,
|
|
140
|
-
locale: locale || systemLocale,
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
const name = `${text.title} #${tokenSerialNumber}`;
|
|
144
|
-
|
|
145
|
-
const isDefaultLanguageActive = locale ? locale.language === systemLocale.language : true;
|
|
146
|
-
const localization = isDefaultLanguageActive
|
|
147
|
-
? {
|
|
148
|
-
uri: `${ROOT_URL}/erc-metadata/${product._id}/${locale}/${tokenId}.json`,
|
|
149
|
-
default: systemLocale.language,
|
|
150
|
-
locales: allLanguages.map((lang) => lang.isoCode),
|
|
151
|
-
}
|
|
152
|
-
: undefined;
|
|
153
|
-
|
|
154
|
-
return {
|
|
155
|
-
name,
|
|
156
|
-
description: text.description,
|
|
157
|
-
image: url,
|
|
158
|
-
properties: ercMetadataProperties,
|
|
159
|
-
localization,
|
|
160
|
-
...(token?.meta || {}),
|
|
161
|
-
};
|
|
162
|
-
},
|
|
163
|
-
};
|
|
164
|
-
},
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
WarehousingDirector.registerAdapter(ETHMinter);
|
package/src/warehousing/store.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { WarehousingDirector, WarehousingAdapter, IWarehousingAdapter } from '@unchainedshop/core';
|
|
2
|
-
import { WarehousingProviderType } from '@unchainedshop/core-warehousing';
|
|
3
|
-
|
|
4
|
-
const Store: IWarehousingAdapter = {
|
|
5
|
-
...WarehousingAdapter,
|
|
6
|
-
|
|
7
|
-
key: 'shop.unchained.warehousing.store',
|
|
8
|
-
label: 'Store',
|
|
9
|
-
version: '1.0.0',
|
|
10
|
-
orderIndex: 0,
|
|
11
|
-
|
|
12
|
-
initialConfiguration: [{ key: 'name', value: 'Flagship Store' }],
|
|
13
|
-
|
|
14
|
-
typeSupported: (type) => {
|
|
15
|
-
return type === WarehousingProviderType.PHYSICAL;
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
actions: (configuration, context) => {
|
|
19
|
-
return {
|
|
20
|
-
...WarehousingAdapter.actions(configuration, context),
|
|
21
|
-
|
|
22
|
-
isActive() {
|
|
23
|
-
return true;
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
configurationError() {
|
|
27
|
-
return null;
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
stock: async () => {
|
|
31
|
-
return 99999;
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
productionTime: async () => {
|
|
35
|
-
return 0;
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
commissioningTime: async () => {
|
|
39
|
-
return 0;
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
WarehousingDirector.registerAdapter(Store);
|
package/src/worker/budgetsms.ts
DELETED
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
import { IWorkerAdapter, WorkerAdapter, WorkerDirector } from '@unchainedshop/core';
|
|
2
|
-
|
|
3
|
-
const { BUDGETSMS_USERNAME, BUDGETSMS_USERID, BUDGETSMS_HANDLE } = process.env;
|
|
4
|
-
|
|
5
|
-
// BudgetSMS Plugin - Verified against official API documentation
|
|
6
|
-
// Note: BudgetSMS API has a quirk where it returns error 1001 (authentication failed)
|
|
7
|
-
// when you have insufficient credit, instead of the correct error 1003.
|
|
8
|
-
const BudgetSMSWorker: IWorkerAdapter<
|
|
9
|
-
{
|
|
10
|
-
from?: string;
|
|
11
|
-
to: string;
|
|
12
|
-
text?: string;
|
|
13
|
-
test?: boolean; // If true, uses test endpoint (no credit deducted)
|
|
14
|
-
customid?: string;
|
|
15
|
-
price?: boolean; // Include price info in response
|
|
16
|
-
mccmnc?: boolean; // Include carrier info in response
|
|
17
|
-
credit?: boolean; // Include remaining credit in response
|
|
18
|
-
[key: string]: any;
|
|
19
|
-
},
|
|
20
|
-
any
|
|
21
|
-
> = {
|
|
22
|
-
...WorkerAdapter,
|
|
23
|
-
|
|
24
|
-
key: 'shop.unchained.worker-plugin.budgetsms',
|
|
25
|
-
label: 'Send Messages through BudgetSMS',
|
|
26
|
-
version: '1.0.0',
|
|
27
|
-
|
|
28
|
-
type: 'BUDGETSMS',
|
|
29
|
-
|
|
30
|
-
doWork: async ({
|
|
31
|
-
from,
|
|
32
|
-
to,
|
|
33
|
-
text,
|
|
34
|
-
test = false,
|
|
35
|
-
customid,
|
|
36
|
-
price = false,
|
|
37
|
-
mccmnc = false,
|
|
38
|
-
credit = false,
|
|
39
|
-
...params
|
|
40
|
-
}) => {
|
|
41
|
-
try {
|
|
42
|
-
// Validate credentials
|
|
43
|
-
if (!BUDGETSMS_USERNAME || !BUDGETSMS_USERID || !BUDGETSMS_HANDLE) {
|
|
44
|
-
throw new Error(
|
|
45
|
-
'Missing BudgetSMS credentials. Please set BUDGETSMS_USERNAME, BUDGETSMS_USERID, and BUDGETSMS_HANDLE',
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// Trim credentials to remove any whitespace
|
|
50
|
-
const username = BUDGETSMS_USERNAME.trim();
|
|
51
|
-
const userid = BUDGETSMS_USERID.trim();
|
|
52
|
-
const handle = BUDGETSMS_HANDLE.trim();
|
|
53
|
-
|
|
54
|
-
// Validate userid is numeric only
|
|
55
|
-
if (!/^\d+$/.test(userid)) {
|
|
56
|
-
throw new Error('BUDGETSMS_USERID must be numeric only. Found: ' + userid);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// Choose endpoint based on test mode
|
|
60
|
-
const url = test ? 'https://api.budgetsms.net/testsms/' : 'https://api.budgetsms.net/sendsms/';
|
|
61
|
-
|
|
62
|
-
// Format phone number according to E.164 (no + or 00, no spaces/dashes)
|
|
63
|
-
const formattedTo = to.replace(/^\+|^00/, '').replace(/[\s-]/g, '');
|
|
64
|
-
|
|
65
|
-
// Build query parameters
|
|
66
|
-
const queryParams = new URLSearchParams({
|
|
67
|
-
username: username,
|
|
68
|
-
userid: userid,
|
|
69
|
-
handle: handle,
|
|
70
|
-
msg: text || '', // Note: parameter is 'msg' not 'text'
|
|
71
|
-
from: from || '',
|
|
72
|
-
to: formattedTo,
|
|
73
|
-
...(customid && { customid }),
|
|
74
|
-
...(!test && price && { price: '1' }), // Price info only for real sends
|
|
75
|
-
...(!test && mccmnc && { mccmnc: '1' }), // Carrier info only for real sends
|
|
76
|
-
...(!test && credit && { credit: '1' }), // Credit info only for real sends
|
|
77
|
-
...params,
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
// Make GET request
|
|
81
|
-
const fullUrl = `${url}?${queryParams.toString()}`;
|
|
82
|
-
|
|
83
|
-
const response = await fetch(fullUrl, {
|
|
84
|
-
method: 'GET',
|
|
85
|
-
headers: {
|
|
86
|
-
Accept: 'text/plain',
|
|
87
|
-
'User-Agent': 'Unchained/BudgetSMS-Plugin',
|
|
88
|
-
},
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
const responseText = await response.text().then((text) => text.trim());
|
|
92
|
-
|
|
93
|
-
// Parse response: "OK <smsid> [price] [parts] [mccmnc] [credit]" or "ERR <errorcode>"
|
|
94
|
-
if (responseText.startsWith('OK')) {
|
|
95
|
-
const parts = responseText.split(' ');
|
|
96
|
-
const result: any = {
|
|
97
|
-
sms_id: parts[1] || null,
|
|
98
|
-
status: test ? 'test_successful' : 'sent',
|
|
99
|
-
test_mode: test,
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
if (test) {
|
|
103
|
-
result.message = 'Test SMS validated successfully (no credit deducted)';
|
|
104
|
-
} else {
|
|
105
|
-
// Parse additional info based on parameters used
|
|
106
|
-
let index = 2;
|
|
107
|
-
if (price && parts[index] && parts[index + 1]) {
|
|
108
|
-
result.price = parseFloat(parts[index]);
|
|
109
|
-
result.parts = parseInt(parts[index + 1]);
|
|
110
|
-
index += 2;
|
|
111
|
-
}
|
|
112
|
-
if (mccmnc && parts[index]) {
|
|
113
|
-
result.mccmnc = parts[index];
|
|
114
|
-
index += 1;
|
|
115
|
-
}
|
|
116
|
-
if (credit && parts[index]) {
|
|
117
|
-
result.remaining_credit = parseFloat(parts[index]);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
return {
|
|
122
|
-
success: true,
|
|
123
|
-
result,
|
|
124
|
-
error: null,
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
if (responseText.startsWith('ERR')) {
|
|
129
|
-
const parts = responseText.split(' ');
|
|
130
|
-
const errorCode = parts[1] || 'UNKNOWN';
|
|
131
|
-
|
|
132
|
-
// Error code mappings from documentation
|
|
133
|
-
const errorMessages: Record<string, string> = {
|
|
134
|
-
'1001': 'Authentication failed OR insufficient credit (BudgetSMS returns 1001 for both)',
|
|
135
|
-
'1002': 'Account not active',
|
|
136
|
-
'1003': 'Insufficient credit',
|
|
137
|
-
'1004': 'No access to this API',
|
|
138
|
-
'1005': 'No handle provided',
|
|
139
|
-
'1006': 'No UserID provided',
|
|
140
|
-
'1007': 'No Username provided',
|
|
141
|
-
'2001': 'SMS message text is empty',
|
|
142
|
-
'2002': 'SMS numeric senderid can be max. 16 numbers',
|
|
143
|
-
'2003': 'SMS alphanumeric sender can be max. 11 characters',
|
|
144
|
-
'2004': 'SMS senderid is empty or invalid',
|
|
145
|
-
'2005': 'Destination number is too short',
|
|
146
|
-
'2006': 'Destination is not numeric',
|
|
147
|
-
'2007': 'Destination is empty',
|
|
148
|
-
'2008': 'SMS text is not OK (check encoding?)',
|
|
149
|
-
'2009': 'Parameter issue',
|
|
150
|
-
'2010': 'Destination number is invalidly formatted',
|
|
151
|
-
'2011': 'Destination is invalid',
|
|
152
|
-
'2012': 'SMS message text is too long',
|
|
153
|
-
'2013': 'SMS message is invalid',
|
|
154
|
-
'2014': 'SMS CustomID is used before',
|
|
155
|
-
'2015': 'Charset problem',
|
|
156
|
-
'2016': 'Invalid UTF-8 encoding',
|
|
157
|
-
'3001': 'No route to destination',
|
|
158
|
-
'3002': 'No routes are setup',
|
|
159
|
-
'3003': 'Invalid destination',
|
|
160
|
-
'4001': 'System error, related to customid',
|
|
161
|
-
'4002': 'System error, temporary issue',
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
// Special handling for 1001 error
|
|
165
|
-
let message = errorMessages[errorCode] || `Unknown error code: ${errorCode}`;
|
|
166
|
-
if (errorCode === '1001') {
|
|
167
|
-
message += '. Note: Check your account balance - BudgetSMS may return 1001 when credit is 0.';
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
return {
|
|
171
|
-
success: false,
|
|
172
|
-
error: {
|
|
173
|
-
name: 'BUDGETSMS_ERROR',
|
|
174
|
-
code: errorCode,
|
|
175
|
-
message,
|
|
176
|
-
},
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
// Unexpected response
|
|
181
|
-
return {
|
|
182
|
-
success: false,
|
|
183
|
-
error: {
|
|
184
|
-
name: 'BUDGETSMS_ERROR',
|
|
185
|
-
message: 'Unexpected response format from BudgetSMS API',
|
|
186
|
-
response: responseText,
|
|
187
|
-
},
|
|
188
|
-
};
|
|
189
|
-
} catch (err) {
|
|
190
|
-
return {
|
|
191
|
-
success: false,
|
|
192
|
-
error: {
|
|
193
|
-
name: err.name,
|
|
194
|
-
message: err.message,
|
|
195
|
-
stack: err.stack,
|
|
196
|
-
},
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
},
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
WorkerDirector.registerAdapter(BudgetSMSWorker);
|
|
203
|
-
|
|
204
|
-
// Environment variables needed:
|
|
205
|
-
// BUDGETSMS_USERNAME=your_username (alphanumeric)
|
|
206
|
-
// BUDGETSMS_USERID=your_userid (NUMERIC ONLY - found in BudgetSMS control panel)
|
|
207
|
-
// BUDGETSMS_HANDLE=your_api_handle (alphanumeric - found in BudgetSMS control panel)
|
|
208
|
-
|
|
209
|
-
// IMPORTANT: The userid MUST be numeric only. You can find it in the BudgetSMS control panel after login.
|
|
210
|
-
// Example: BUDGETSMS_USERID=12345 (NOT "user12345" or any non-numeric value)
|
|
211
|
-
|
|
212
|
-
// Usage examples:
|
|
213
|
-
//
|
|
214
|
-
// Send real SMS (requires credits):
|
|
215
|
-
// await WorkerDirector.doWork({
|
|
216
|
-
// type: 'BUDGETSMS',
|
|
217
|
-
// from: 'YourCompany',
|
|
218
|
-
// to: '+41791234567',
|
|
219
|
-
// text: 'Your message here',
|
|
220
|
-
// price: true, // Get price info
|
|
221
|
-
// credit: true, // Get remaining credit
|
|
222
|
-
// });
|
|
223
|
-
//
|
|
224
|
-
// Test SMS (no credit deducted):
|
|
225
|
-
// await WorkerDirector.doWork({
|
|
226
|
-
// type: 'BUDGETSMS',
|
|
227
|
-
// test: true,
|
|
228
|
-
// from: 'YourCompany',
|
|
229
|
-
// to: '+41791234567',
|
|
230
|
-
// text: 'Test message',
|
|
231
|
-
// });
|
|
232
|
-
//
|
|
233
|
-
// IMPORTANT: If you get error 1001, it could mean either:
|
|
234
|
-
// 1. Authentication failed (wrong credentials)
|
|
235
|
-
// 2. Insufficient credit (0 balance)
|
|
236
|
-
// Use the checkBudgetSmsCredentials() helper to verify which one it is.
|
|
237
|
-
|
|
238
|
-
// Helper function to check credentials and balance
|
|
239
|
-
export async function checkBudgetSmsCredentials() {
|
|
240
|
-
const url = 'https://api.budgetsms.net/checkcredit/';
|
|
241
|
-
const username = process.env.BUDGETSMS_USERNAME?.trim();
|
|
242
|
-
const userid = process.env.BUDGETSMS_USERID?.trim();
|
|
243
|
-
const handle = process.env.BUDGETSMS_HANDLE?.trim();
|
|
244
|
-
|
|
245
|
-
if (!username || !userid || !handle) {
|
|
246
|
-
return { error: 'Missing credentials' };
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
if (!/^\d+$/.test(userid)) {
|
|
250
|
-
return { error: 'UserID must be numeric only' };
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
const queryParams = new URLSearchParams({ username, userid, handle });
|
|
254
|
-
|
|
255
|
-
try {
|
|
256
|
-
const response = await fetch(`${url}?${queryParams.toString()}`, { method: 'GET' });
|
|
257
|
-
const text = await response.text();
|
|
258
|
-
|
|
259
|
-
if (text.startsWith('OK')) {
|
|
260
|
-
const credit = parseFloat(text.split(' ')[1]) || 0;
|
|
261
|
-
return { success: true, credit };
|
|
262
|
-
} else {
|
|
263
|
-
return { error: text };
|
|
264
|
-
}
|
|
265
|
-
} catch (err) {
|
|
266
|
-
return { error: err.message };
|
|
267
|
-
}
|
|
268
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { WorkerDirector, WorkerAdapter, IWorkerAdapter } from '@unchainedshop/core';
|
|
2
|
-
import { createLogger } from '@unchainedshop/logger';
|
|
3
|
-
|
|
4
|
-
const logger = createLogger('unchained:bulk-import');
|
|
5
|
-
|
|
6
|
-
export const BulkImportWorker: IWorkerAdapter<any, Record<string, any>> = {
|
|
7
|
-
...WorkerAdapter,
|
|
8
|
-
|
|
9
|
-
key: 'shop.unchained.worker-plugin.bulk-import',
|
|
10
|
-
label: 'Bulk Import',
|
|
11
|
-
version: '1.0.0',
|
|
12
|
-
type: 'BULK_IMPORT',
|
|
13
|
-
maxParallelAllocations: 1, // Only ever process 1 BULK_IMPORT at a time!
|
|
14
|
-
|
|
15
|
-
doWork: async (rawPayload, unchainedAPI) => {
|
|
16
|
-
try {
|
|
17
|
-
const {
|
|
18
|
-
createShouldUpsertIfIDExists = false,
|
|
19
|
-
skipCacheInvalidation = false,
|
|
20
|
-
updateShouldUpsertIfIDNotExists = false,
|
|
21
|
-
} = rawPayload;
|
|
22
|
-
|
|
23
|
-
const bulkImporter = unchainedAPI.bulkImporter.createBulkImporter({
|
|
24
|
-
createShouldUpsertIfIDExists,
|
|
25
|
-
updateShouldUpsertIfIDNotExists,
|
|
26
|
-
skipCacheInvalidation,
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
if (rawPayload.payloadId) {
|
|
30
|
-
// stream payload from gridfs
|
|
31
|
-
const readStream = await unchainedAPI.services.files.createDownloadStream({
|
|
32
|
-
fileId: rawPayload.payloadId,
|
|
33
|
-
});
|
|
34
|
-
if (!readStream) {
|
|
35
|
-
throw new Error('Could not create download stream from uploaded file');
|
|
36
|
-
}
|
|
37
|
-
await unchainedAPI.bulkImporter.pipeEventStream(readStream, bulkImporter, unchainedAPI);
|
|
38
|
-
} else {
|
|
39
|
-
const { events } = rawPayload;
|
|
40
|
-
if (!events?.length) throw new Error('No events submitted');
|
|
41
|
-
|
|
42
|
-
await events.reduce(async (currentEventPromise, nextEvent) => {
|
|
43
|
-
await currentEventPromise;
|
|
44
|
-
await bulkImporter.validate(nextEvent);
|
|
45
|
-
return bulkImporter.prepare(nextEvent, unchainedAPI);
|
|
46
|
-
}, Promise.resolve());
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const [result, error] = await bulkImporter.execute();
|
|
50
|
-
await bulkImporter.invalidateCaches(unchainedAPI);
|
|
51
|
-
|
|
52
|
-
if (error) {
|
|
53
|
-
return {
|
|
54
|
-
success: false,
|
|
55
|
-
result: result!,
|
|
56
|
-
error,
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
return {
|
|
60
|
-
success: true,
|
|
61
|
-
result: result!,
|
|
62
|
-
};
|
|
63
|
-
} catch (err) {
|
|
64
|
-
logger.error(err);
|
|
65
|
-
return {
|
|
66
|
-
success: false,
|
|
67
|
-
error: {
|
|
68
|
-
name: err.name,
|
|
69
|
-
message: err.message,
|
|
70
|
-
stack: err.stack,
|
|
71
|
-
},
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
WorkerDirector.registerAdapter(BulkImportWorker);
|