@unchainedshop/plugins 4.6.1 → 4.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -2
- package/lib/delivery/post/adapter.d.ts +2 -0
- package/lib/delivery/{post.js → post/adapter.js} +2 -3
- package/lib/delivery/post/index.d.ts +4 -0
- package/lib/delivery/post/index.js +10 -0
- package/lib/delivery/send-message/adapter.d.ts +2 -0
- package/lib/delivery/{send-message.js → send-message/adapter.js} +2 -3
- package/lib/delivery/send-message/index.d.ts +4 -0
- package/lib/delivery/send-message/index.js +10 -0
- package/lib/delivery/stores/adapter.d.ts +2 -0
- package/lib/delivery/{stores.js → stores/adapter.js} +2 -3
- package/lib/delivery/stores/index.d.ts +4 -0
- package/lib/delivery/stores/index.js +10 -0
- package/lib/enrollments/licensed/adapter.d.ts +6 -0
- package/lib/enrollments/{licensed.js → licensed/adapter.js} +2 -3
- package/lib/enrollments/licensed/index.d.ts +4 -0
- package/lib/enrollments/licensed/index.js +10 -0
- package/lib/events/node-event-emitter.d.ts +3 -1
- package/lib/events/node-event-emitter.js +3 -3
- package/lib/files/gridfs/adapter.d.ts +2 -2
- package/lib/files/gridfs/adapter.js +2 -5
- package/lib/files/gridfs/api.d.ts +7 -0
- package/lib/files/gridfs/api.js +163 -0
- package/lib/files/gridfs/index.d.ts +5 -4
- package/lib/files/gridfs/index.js +30 -3
- package/lib/files/minio/adapter.d.ts +4 -0
- package/lib/files/minio/adapter.js +160 -0
- package/lib/files/minio/api.d.ts +2 -0
- package/lib/files/minio/api.js +41 -0
- package/lib/files/minio/index.d.ts +4 -5
- package/lib/files/minio/index.js +18 -157
- package/lib/files/temp-upload/api.d.ts +6 -0
- package/lib/files/temp-upload/api.js +49 -0
- package/lib/files/temp-upload/index.d.ts +3 -0
- package/lib/files/temp-upload/index.js +15 -0
- package/lib/filters/local-search/adapter.d.ts +2 -0
- package/lib/filters/{local-search.js → local-search/adapter.js} +2 -12
- package/lib/filters/local-search/index.d.ts +4 -0
- package/lib/filters/local-search/index.js +16 -0
- package/lib/filters/strict-equal/adapter.d.ts +2 -0
- package/lib/filters/{strict-equal.js → strict-equal/adapter.js} +2 -3
- package/lib/filters/strict-equal/index.d.ts +4 -0
- package/lib/filters/strict-equal/index.js +10 -0
- package/lib/payment/apple-iap/adapter.d.ts +2 -1
- package/lib/payment/apple-iap/adapter.js +2 -3
- package/lib/payment/apple-iap/api.d.ts +2 -0
- package/lib/payment/apple-iap/{handler-fastify.js → api.js} +47 -30
- package/lib/payment/apple-iap/index.d.ts +6 -4
- package/lib/payment/apple-iap/index.js +28 -3
- package/lib/payment/cryptopay/adapter.d.ts +2 -0
- package/lib/payment/cryptopay/{plugin.js → adapter.js} +2 -4
- package/lib/payment/cryptopay/api.d.ts +2 -0
- package/lib/payment/cryptopay/api.js +23 -0
- package/lib/payment/cryptopay/index.d.ts +5 -4
- package/lib/payment/cryptopay/index.js +31 -3
- package/lib/payment/datatrans-v2/adapter.d.ts +2 -0
- package/lib/payment/datatrans-v2/adapter.js +406 -0
- package/lib/payment/datatrans-v2/api.d.ts +2 -0
- package/lib/payment/datatrans-v2/api.js +108 -0
- package/lib/payment/datatrans-v2/index.d.ts +4 -1
- package/lib/payment/datatrans-v2/index.js +17 -400
- package/lib/payment/invoice/adapter.d.ts +2 -0
- package/lib/payment/{invoice.js → invoice/adapter.js} +2 -3
- package/lib/payment/invoice/index.d.ts +4 -0
- package/lib/payment/invoice/index.js +10 -0
- package/lib/payment/invoice-prepaid/adapter.d.ts +2 -0
- package/lib/payment/{invoice-prepaid.js → invoice-prepaid/adapter.js} +2 -3
- package/lib/payment/invoice-prepaid/index.d.ts +4 -0
- package/lib/payment/invoice-prepaid/index.js +10 -0
- package/lib/payment/payrexx/adapter.d.ts +2 -0
- package/lib/payment/payrexx/adapter.js +161 -0
- package/lib/payment/payrexx/api.d.ts +2 -0
- package/lib/payment/payrexx/api.js +97 -0
- package/lib/payment/payrexx/index.d.ts +4 -1
- package/lib/payment/payrexx/index.js +19 -158
- package/lib/payment/postfinance-checkout/adapter.d.ts +2 -0
- package/lib/payment/postfinance-checkout/adapter.js +189 -0
- package/lib/payment/postfinance-checkout/index.d.ts +5 -0
- package/lib/payment/postfinance-checkout/index.js +25 -186
- package/lib/payment/postfinance-checkout/webhook.d.ts +2 -0
- package/lib/payment/postfinance-checkout/webhook.js +48 -0
- package/lib/payment/saferpay/adapter.js +1 -2
- package/lib/payment/saferpay/index.d.ts +5 -4
- package/lib/payment/saferpay/index.js +29 -3
- package/lib/payment/saferpay/webhook.d.ts +2 -0
- package/lib/payment/saferpay/webhook.js +64 -0
- package/lib/payment/stripe/adapter.d.ts +2 -0
- package/lib/payment/stripe/adapter.js +121 -0
- package/lib/payment/stripe/api.d.ts +6 -0
- package/lib/payment/stripe/api.js +165 -0
- package/lib/payment/stripe/index.d.ts +4 -1
- package/lib/payment/stripe/index.js +22 -116
- package/lib/payment/stripe/stripe.js +2 -5
- package/lib/presets/all.d.ts +1 -70
- package/lib/presets/all.js +41 -27
- package/lib/presets/base.d.ts +1 -25
- package/lib/presets/base.js +56 -25
- package/lib/presets/countries/ch.d.ts +1 -2
- package/lib/presets/countries/ch.js +7 -2
- package/lib/presets/crypto.d.ts +3 -7
- package/lib/presets/crypto.js +18 -7
- package/lib/pricing/{delivery-swiss-tax.d.ts → delivery-swiss-tax/adapter.d.ts} +1 -0
- package/lib/pricing/{delivery-swiss-tax.js → delivery-swiss-tax/adapter.js} +4 -4
- package/lib/pricing/delivery-swiss-tax/index.d.ts +4 -0
- package/lib/pricing/delivery-swiss-tax/index.js +10 -0
- package/lib/pricing/{discount-100-off.d.ts → discount-100-off/adapter.d.ts} +1 -0
- package/lib/pricing/{discount-100-off.js → discount-100-off/adapter.js} +2 -2
- package/lib/pricing/discount-100-off/index.d.ts +4 -0
- package/lib/pricing/discount-100-off/index.js +10 -0
- package/lib/pricing/{discount-half-price-manual.d.ts → discount-half-price-manual/adapter.d.ts} +1 -0
- package/lib/pricing/{discount-half-price-manual.js → discount-half-price-manual/adapter.js} +2 -2
- package/lib/pricing/discount-half-price-manual/index.d.ts +4 -0
- package/lib/pricing/discount-half-price-manual/index.js +10 -0
- package/lib/pricing/{free-delivery.d.ts → free-delivery/adapter.d.ts} +1 -0
- package/lib/pricing/{free-delivery.js → free-delivery/adapter.js} +2 -2
- package/lib/pricing/free-delivery/index.d.ts +4 -0
- package/lib/pricing/free-delivery/index.js +10 -0
- package/lib/pricing/{free-payment.d.ts → free-payment/adapter.d.ts} +1 -0
- package/lib/pricing/{free-payment.js → free-payment/adapter.js} +2 -2
- package/lib/pricing/free-payment/index.d.ts +4 -0
- package/lib/pricing/free-payment/index.js +10 -0
- package/lib/pricing/{order-delivery.d.ts → order-delivery/adapter.d.ts} +1 -0
- package/lib/pricing/{order-delivery.js → order-delivery/adapter.js} +2 -2
- package/lib/pricing/order-delivery/index.d.ts +4 -0
- package/lib/pricing/order-delivery/index.js +10 -0
- package/lib/pricing/{order-discount.d.ts → order-discount/adapter.d.ts} +1 -0
- package/lib/pricing/{order-discount.js → order-discount/adapter.js} +2 -2
- package/lib/pricing/order-discount/index.d.ts +4 -0
- package/lib/pricing/order-discount/index.js +10 -0
- package/lib/pricing/{order-items.d.ts → order-items/adapter.d.ts} +1 -0
- package/lib/pricing/{order-items.js → order-items/adapter.js} +2 -2
- package/lib/pricing/order-items/index.d.ts +4 -0
- package/lib/pricing/order-items/index.js +10 -0
- package/lib/pricing/{order-payment.d.ts → order-payment/adapter.d.ts} +1 -0
- package/lib/pricing/{order-payment.js → order-payment/adapter.js} +2 -2
- package/lib/pricing/order-payment/index.d.ts +4 -0
- package/lib/pricing/order-payment/index.js +10 -0
- package/lib/pricing/{product-catalog-price.d.ts → product-catalog-price/adapter.d.ts} +1 -0
- package/lib/pricing/{product-catalog-price.js → product-catalog-price/adapter.js} +2 -2
- package/lib/pricing/product-catalog-price/index.d.ts +4 -0
- package/lib/pricing/product-catalog-price/index.js +10 -0
- package/lib/pricing/{product-discount.d.ts → product-discount/adapter.d.ts} +1 -0
- package/lib/pricing/{product-discount.js → product-discount/adapter.js} +2 -2
- package/lib/pricing/product-discount/index.d.ts +4 -0
- package/lib/pricing/product-discount/index.js +10 -0
- package/lib/pricing/{product-price-rateconversion.d.ts → product-price-rateconversion/adapter.d.ts} +1 -0
- package/lib/pricing/{product-price-rateconversion.js → product-price-rateconversion/adapter.js} +2 -2
- package/lib/pricing/product-price-rateconversion/index.d.ts +4 -0
- package/lib/pricing/product-price-rateconversion/index.js +10 -0
- package/lib/pricing/{product-swiss-tax.d.ts → product-swiss-tax/adapter.d.ts} +1 -0
- package/lib/pricing/{product-swiss-tax.js → product-swiss-tax/adapter.js} +4 -4
- package/lib/pricing/product-swiss-tax/index.d.ts +4 -0
- package/lib/pricing/product-swiss-tax/index.js +10 -0
- package/lib/quotations/manual/adapter.d.ts +2 -0
- package/lib/quotations/{manual.js → manual/adapter.js} +2 -3
- package/lib/quotations/manual/index.d.ts +4 -0
- package/lib/quotations/manual/index.js +10 -0
- package/lib/warehousing/erc-metadata/api.d.ts +12 -0
- package/lib/warehousing/erc-metadata/api.js +43 -0
- package/lib/warehousing/erc-metadata/index.d.ts +3 -0
- package/lib/warehousing/erc-metadata/index.js +15 -0
- package/lib/warehousing/eth-minter/adapter.d.ts +2 -0
- package/lib/warehousing/{eth-minter.js → eth-minter/adapter.js} +3 -4
- package/lib/warehousing/eth-minter/index.d.ts +4 -0
- package/lib/warehousing/eth-minter/index.js +10 -0
- package/lib/warehousing/store/adapter.d.ts +2 -0
- package/lib/warehousing/{store.js → store/adapter.js} +2 -3
- package/lib/warehousing/store/index.d.ts +4 -0
- package/lib/warehousing/store/index.js +10 -0
- package/lib/worker/budgetsms/adapter.d.ts +22 -0
- package/lib/worker/{budgetsms.js → budgetsms/adapter.js} +3 -3
- package/lib/worker/budgetsms/index.d.ts +4 -0
- package/lib/worker/budgetsms/index.js +10 -0
- package/lib/worker/bulk-export/adapter.d.ts +3 -0
- package/lib/worker/{bulk-export.js → bulk-export/adapter.js} +3 -3
- package/lib/worker/bulk-export/index.d.ts +4 -0
- package/lib/worker/bulk-export/index.js +10 -0
- package/lib/worker/{bulk-import.d.ts → bulk-import/adapter.d.ts} +1 -0
- package/lib/worker/{bulk-import.js → bulk-import/adapter.js} +2 -2
- package/lib/worker/bulk-import/api.d.ts +7 -0
- package/lib/worker/bulk-import/api.js +53 -0
- package/lib/worker/bulk-import/index.d.ts +4 -0
- package/lib/worker/bulk-import/index.js +18 -0
- package/lib/worker/bulkgate/adapter.d.ts +12 -0
- package/lib/worker/{bulkgate.js → bulkgate/adapter.js} +3 -3
- package/lib/worker/bulkgate/index.d.ts +4 -0
- package/lib/worker/bulkgate/index.js +10 -0
- package/lib/worker/email/adapter.d.ts +9 -0
- package/lib/worker/{email.js → email/adapter.js} +27 -13
- package/lib/worker/email/index.d.ts +4 -0
- package/lib/worker/email/index.js +10 -0
- package/lib/worker/enrollment-order-generator/adapter.d.ts +4 -0
- package/lib/worker/{enrollment-order-generator.js → enrollment-order-generator/adapter.js} +2 -2
- package/lib/worker/enrollment-order-generator/index.d.ts +4 -0
- package/lib/worker/enrollment-order-generator/index.js +13 -0
- package/lib/worker/{error-notifications.d.ts → error-notifications/adapter.d.ts} +1 -0
- package/lib/worker/{error-notifications.js → error-notifications/adapter.js} +9 -8
- package/lib/worker/error-notifications/index.d.ts +4 -0
- package/lib/worker/error-notifications/index.js +13 -0
- package/lib/worker/{export-token.d.ts → export-token/adapter.d.ts} +1 -1
- package/lib/worker/{export-token.js → export-token/adapter.js} +2 -3
- package/lib/worker/export-token/index.d.ts +4 -0
- package/lib/worker/export-token/index.js +13 -0
- package/lib/worker/{external.d.ts → external/adapter.d.ts} +1 -0
- package/lib/worker/{external.js → external/adapter.js} +2 -2
- package/lib/worker/external/index.d.ts +4 -0
- package/lib/worker/external/index.js +10 -0
- package/lib/worker/heartbeat/adapter.d.ts +8 -0
- package/lib/worker/{heartbeat.js → heartbeat/adapter.js} +3 -3
- package/lib/worker/heartbeat/index.d.ts +4 -0
- package/lib/worker/heartbeat/index.js +10 -0
- package/lib/worker/{http-request.d.ts → http-request/adapter.d.ts} +1 -1
- package/lib/worker/{http-request.js → http-request/adapter.js} +2 -3
- package/lib/worker/http-request/index.d.ts +4 -0
- package/lib/worker/http-request/index.js +10 -0
- package/lib/worker/{message.d.ts → message/adapter.d.ts} +1 -0
- package/lib/worker/{message.js → message/adapter.js} +2 -2
- package/lib/worker/message/index.d.ts +4 -0
- package/lib/worker/message/index.js +10 -0
- package/lib/worker/push-notification/adapter.d.ts +9 -0
- package/lib/worker/{push-notification.js → push-notification/adapter.js} +3 -3
- package/lib/worker/push-notification/index.d.ts +4 -0
- package/lib/worker/push-notification/index.js +10 -0
- package/lib/worker/twilio/adapter.d.ts +8 -0
- package/lib/worker/{twilio.js → twilio/adapter.js} +3 -3
- package/lib/worker/twilio/index.d.ts +4 -0
- package/lib/worker/twilio/index.js +10 -0
- package/lib/worker/update-coinbase-rates/adapter.d.ts +4 -0
- package/lib/worker/{update-coinbase-rates.js → update-coinbase-rates/adapter.js} +8 -6
- package/lib/worker/update-coinbase-rates/index.d.ts +4 -0
- package/lib/worker/update-coinbase-rates/index.js +13 -0
- package/lib/worker/update-ecb-rates/adapter.d.ts +4 -0
- package/lib/worker/{update-ecb-rates.js → update-ecb-rates/adapter.js} +11 -9
- package/lib/worker/update-ecb-rates/index.d.ts +4 -0
- package/lib/worker/update-ecb-rates/index.js +13 -0
- package/lib/worker/{update-token-ownership.d.ts → update-token-ownership/adapter.d.ts} +2 -0
- package/lib/worker/{update-token-ownership.js → update-token-ownership/adapter.js} +8 -7
- package/lib/worker/update-token-ownership/index.d.ts +4 -0
- package/lib/worker/update-token-ownership/index.js +13 -0
- package/lib/worker/{zombie-killer.js → zombie-killer/adapter.js} +1 -2
- package/lib/worker/zombie-killer/index.d.ts +4 -0
- package/lib/worker/zombie-killer/index.js +10 -0
- package/package.json +15 -10
- package/lib/delivery/post.d.ts +0 -1
- package/lib/delivery/send-message.d.ts +0 -1
- package/lib/delivery/stores.d.ts +0 -1
- package/lib/enrollments/licensed.d.ts +0 -4
- package/lib/files/gridfs/handler-express.d.ts +0 -9
- package/lib/files/gridfs/handler-express.js +0 -110
- package/lib/files/gridfs/handler-fastify.d.ts +0 -3
- package/lib/files/gridfs/handler-fastify.js +0 -138
- package/lib/files/minio/handler-express.d.ts +0 -2
- package/lib/files/minio/handler-express.js +0 -36
- package/lib/files/minio/handler-fastify.d.ts +0 -3
- package/lib/files/minio/handler-fastify.js +0 -40
- package/lib/filters/local-search.d.ts +0 -3
- package/lib/filters/strict-equal.d.ts +0 -1
- package/lib/payment/apple-iap/handler-express.d.ts +0 -2
- package/lib/payment/apple-iap/handler-express.js +0 -103
- package/lib/payment/apple-iap/handler-fastify.d.ts +0 -3
- package/lib/payment/braintree.d.ts +0 -1
- package/lib/payment/braintree.js +0 -138
- package/lib/payment/cryptopay/handler-express.d.ts +0 -2
- package/lib/payment/cryptopay/handler-express.js +0 -19
- package/lib/payment/cryptopay/handler-fastify.d.ts +0 -3
- package/lib/payment/cryptopay/handler-fastify.js +0 -17
- package/lib/payment/cryptopay/plugin.d.ts +0 -3
- package/lib/payment/datatrans-v2/handler-express.d.ts +0 -1
- package/lib/payment/datatrans-v2/handler-express.js +0 -71
- package/lib/payment/datatrans-v2/handler-fastify.d.ts +0 -2
- package/lib/payment/datatrans-v2/handler-fastify.js +0 -71
- package/lib/payment/invoice-prepaid.d.ts +0 -1
- package/lib/payment/invoice.d.ts +0 -1
- package/lib/payment/paypal-checkout.d.ts +0 -1
- package/lib/payment/paypal-checkout.js +0 -87
- package/lib/payment/payrexx/handler-express.d.ts +0 -1
- package/lib/payment/payrexx/handler-express.js +0 -85
- package/lib/payment/payrexx/handler-fastify.d.ts +0 -2
- package/lib/payment/payrexx/handler-fastify.js +0 -91
- package/lib/payment/postfinance-checkout/handler-express.d.ts +0 -1
- package/lib/payment/postfinance-checkout/handler-express.js +0 -37
- package/lib/payment/postfinance-checkout/handler-fastify.d.ts +0 -2
- package/lib/payment/postfinance-checkout/handler-fastify.js +0 -40
- package/lib/payment/saferpay/handler-express.d.ts +0 -1
- package/lib/payment/saferpay/handler-express.js +0 -59
- package/lib/payment/saferpay/handler-fastify.d.ts +0 -2
- package/lib/payment/saferpay/handler-fastify.js +0 -62
- package/lib/payment/stripe/handler-express.d.ts +0 -5
- package/lib/payment/stripe/handler-express.js +0 -121
- package/lib/payment/stripe/handler-fastify.d.ts +0 -6
- package/lib/payment/stripe/handler-fastify.js +0 -131
- package/lib/presets/all-express.d.ts +0 -6
- package/lib/presets/all-express.js +0 -26
- package/lib/presets/all-fastify.d.ts +0 -6
- package/lib/presets/all-fastify.js +0 -49
- package/lib/presets/base-express.d.ts +0 -2
- package/lib/presets/base-express.js +0 -5
- package/lib/presets/base-fastify.d.ts +0 -3
- package/lib/presets/base-fastify.js +0 -16
- package/lib/presets/crypto-express.d.ts +0 -3
- package/lib/presets/crypto-express.js +0 -8
- package/lib/presets/crypto-fastify.d.ts +0 -3
- package/lib/presets/crypto-fastify.js +0 -11
- package/lib/pricing/discount-half-price.d.ts +0 -2
- package/lib/pricing/discount-half-price.js +0 -33
- package/lib/pricing/order-items-discount.d.ts +0 -2
- package/lib/pricing/order-items-discount.js +0 -50
- package/lib/pricing/order-round.d.ts +0 -10
- package/lib/pricing/order-round.js +0 -135
- package/lib/pricing/product-catalog-price-options.d.ts +0 -2
- package/lib/pricing/product-catalog-price-options.js +0 -51
- package/lib/pricing/product-round.d.ts +0 -10
- package/lib/pricing/product-round.js +0 -44
- package/lib/quotations/manual.d.ts +0 -1
- package/lib/warehousing/eth-minter.d.ts +0 -1
- package/lib/warehousing/store.d.ts +0 -1
- package/lib/worker/budgetsms.d.ts +0 -9
- package/lib/worker/bulk-export.d.ts +0 -2
- package/lib/worker/bulkgate.d.ts +0 -1
- package/lib/worker/email.d.ts +0 -1
- package/lib/worker/enrollment-order-generator.d.ts +0 -1
- package/lib/worker/heartbeat.d.ts +0 -1
- package/lib/worker/push-notification.d.ts +0 -1
- package/lib/worker/twilio.d.ts +0 -1
- package/lib/worker/update-coinbase-rates.d.ts +0 -1
- package/lib/worker/update-ecb-rates.d.ts +0 -1
- /package/lib/worker/{zombie-killer.d.ts → zombie-killer/adapter.d.ts} +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {} from '@unchainedshop/core';
|
|
2
|
+
import { ETHMinter } from "./adapter.js";
|
|
3
|
+
export const ETHMinterPlugin = {
|
|
4
|
+
key: 'shop.unchained.warehousing.infinite-minter',
|
|
5
|
+
label: 'ETH Infinite Minter Warehousing Plugin',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
adapters: [ETHMinter],
|
|
8
|
+
};
|
|
9
|
+
export default ETHMinterPlugin;
|
|
10
|
+
export { ETHMinter } from "./adapter.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WarehousingAdapter } from '@unchainedshop/core';
|
|
2
2
|
import { WarehousingProviderType } from '@unchainedshop/core-warehousing';
|
|
3
|
-
const Store = {
|
|
3
|
+
export const Store = {
|
|
4
4
|
...WarehousingAdapter,
|
|
5
5
|
key: 'shop.unchained.warehousing.store',
|
|
6
6
|
label: 'Store',
|
|
@@ -31,4 +31,3 @@ const Store = {
|
|
|
31
31
|
};
|
|
32
32
|
},
|
|
33
33
|
};
|
|
34
|
-
WarehousingDirector.registerAdapter(Store);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {} from '@unchainedshop/core';
|
|
2
|
+
import { Store } from "./adapter.js";
|
|
3
|
+
export const StorePlugin = {
|
|
4
|
+
key: 'shop.unchained.warehousing.store',
|
|
5
|
+
label: 'Store Warehousing Plugin',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
adapters: [Store],
|
|
8
|
+
};
|
|
9
|
+
export default StorePlugin;
|
|
10
|
+
export { Store } from "./adapter.js";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type IWorkerAdapter } from '@unchainedshop/core';
|
|
2
|
+
export declare const BudgetSMSWorker: IWorkerAdapter<{
|
|
3
|
+
from?: string;
|
|
4
|
+
to: string;
|
|
5
|
+
text?: string;
|
|
6
|
+
test?: boolean;
|
|
7
|
+
customid?: string;
|
|
8
|
+
price?: boolean;
|
|
9
|
+
mccmnc?: boolean;
|
|
10
|
+
credit?: boolean;
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}, any>;
|
|
13
|
+
export declare function checkBudgetSmsCredentials(): Promise<{
|
|
14
|
+
success: boolean;
|
|
15
|
+
credit: number;
|
|
16
|
+
error?: undefined;
|
|
17
|
+
} | {
|
|
18
|
+
error: any;
|
|
19
|
+
success?: undefined;
|
|
20
|
+
credit?: undefined;
|
|
21
|
+
}>;
|
|
22
|
+
export default BudgetSMSWorker;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { WorkerAdapter
|
|
1
|
+
import { WorkerAdapter } from '@unchainedshop/core';
|
|
2
2
|
const { BUDGETSMS_USERNAME, BUDGETSMS_USERID, BUDGETSMS_HANDLE } = process.env;
|
|
3
|
-
const BudgetSMSWorker = {
|
|
3
|
+
export const BudgetSMSWorker = {
|
|
4
4
|
...WorkerAdapter,
|
|
5
5
|
key: 'shop.unchained.worker-plugin.budgetsms',
|
|
6
6
|
label: 'Send Messages through BudgetSMS',
|
|
@@ -139,7 +139,6 @@ const BudgetSMSWorker = {
|
|
|
139
139
|
}
|
|
140
140
|
},
|
|
141
141
|
};
|
|
142
|
-
WorkerDirector.registerAdapter(BudgetSMSWorker);
|
|
143
142
|
export async function checkBudgetSmsCredentials() {
|
|
144
143
|
const url = 'https://api.budgetsms.net/checkcredit/';
|
|
145
144
|
const username = process.env.BUDGETSMS_USERNAME?.trim();
|
|
@@ -167,3 +166,4 @@ export async function checkBudgetSmsCredentials() {
|
|
|
167
166
|
return { error: err.message };
|
|
168
167
|
}
|
|
169
168
|
}
|
|
169
|
+
export default BudgetSMSWorker;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {} from '@unchainedshop/core';
|
|
2
|
+
import { BudgetSMSWorker } from "./adapter.js";
|
|
3
|
+
export const BudgetSMSPlugin = {
|
|
4
|
+
key: 'shop.unchained.worker-plugin.budgetsms',
|
|
5
|
+
label: 'Budget SMS Worker Plugin',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
adapters: [BudgetSMSWorker],
|
|
8
|
+
};
|
|
9
|
+
export default BudgetSMSPlugin;
|
|
10
|
+
export { BudgetSMSWorker, checkBudgetSmsCredentials } from "./adapter.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WorkerAdapter } from '@unchainedshop/core';
|
|
2
2
|
import { createLogger } from '@unchainedshop/logger';
|
|
3
3
|
const isSupportedLocale = (locale) => {
|
|
4
4
|
try {
|
|
@@ -24,7 +24,7 @@ const createLanguageDialectList = (languages, countries) => {
|
|
|
24
24
|
return Array.from(result);
|
|
25
25
|
};
|
|
26
26
|
const logger = createLogger('unchained:bulk-export');
|
|
27
|
-
export const
|
|
27
|
+
export const BulkExport = {
|
|
28
28
|
...WorkerAdapter,
|
|
29
29
|
key: 'shop.unchained.worker-plugin.bulk-export',
|
|
30
30
|
label: 'Bulk Export',
|
|
@@ -61,4 +61,4 @@ export const BulkExportWorker = {
|
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
};
|
|
64
|
-
|
|
64
|
+
export default BulkExport;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {} from '@unchainedshop/core';
|
|
2
|
+
import { BulkExport } from "./adapter.js";
|
|
3
|
+
export const BulkExportPlugin = {
|
|
4
|
+
key: 'shop.unchained.worker-plugin.bulk-export',
|
|
5
|
+
label: 'Bulk Export Worker Plugin',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
adapters: [BulkExport],
|
|
8
|
+
};
|
|
9
|
+
export default BulkExportPlugin;
|
|
10
|
+
export { BulkExport } from "./adapter.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WorkerAdapter } from '@unchainedshop/core';
|
|
2
2
|
import { createLogger } from '@unchainedshop/logger';
|
|
3
3
|
const logger = createLogger('unchained:bulk-import');
|
|
4
4
|
export const BulkImportWorker = {
|
|
@@ -62,4 +62,4 @@ export const BulkImportWorker = {
|
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
};
|
|
65
|
-
|
|
65
|
+
export default BulkImportWorker;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { createLogger } from '@unchainedshop/logger';
|
|
2
|
+
import { Roles } from '@unchainedshop/roles';
|
|
3
|
+
const logger = createLogger('unchained:bulk-import');
|
|
4
|
+
export async function bulkImportHandler(request, context) {
|
|
5
|
+
try {
|
|
6
|
+
const hasPermission = await Roles.userHasPermission(context, 'bulkImport', []);
|
|
7
|
+
if (!hasPermission) {
|
|
8
|
+
return Response.json({ error: 'Permission denied', message: 'User does not have bulkImport permission' }, { status: 403 });
|
|
9
|
+
}
|
|
10
|
+
const url = new URL(request.url);
|
|
11
|
+
const input = {
|
|
12
|
+
createShouldUpsertIfIDExists: url.searchParams.get('createShouldUpsertIfIDExists') === 'true',
|
|
13
|
+
updateShouldUpsertIfIDNotExists: url.searchParams.get('updateShouldUpsertIfIDNotExists') === 'true',
|
|
14
|
+
skipCacheInvalidation: url.searchParams.get('skipCacheInvalidation') === 'true',
|
|
15
|
+
remoteAddress: context.remoteAddress,
|
|
16
|
+
};
|
|
17
|
+
const date = new Date().toISOString();
|
|
18
|
+
const stream = context.rawRequest;
|
|
19
|
+
if (!stream) {
|
|
20
|
+
return Response.json({ error: 'No request stream available' }, { status: 400 });
|
|
21
|
+
}
|
|
22
|
+
const file = await context.services.files.uploadFileFromStream({
|
|
23
|
+
directoryName: 'bulk-import-streams',
|
|
24
|
+
rawFile: Promise.resolve({
|
|
25
|
+
filename: `${date}.json`,
|
|
26
|
+
createReadStream: () => stream,
|
|
27
|
+
}),
|
|
28
|
+
chunkSizeBytes: 1024 * 1024 * 5,
|
|
29
|
+
meta: {},
|
|
30
|
+
});
|
|
31
|
+
const validationStream = await context.services.files.createDownloadStream({
|
|
32
|
+
fileId: file._id,
|
|
33
|
+
});
|
|
34
|
+
if (!validationStream) {
|
|
35
|
+
throw new Error('Could not create download stream from uploaded file');
|
|
36
|
+
}
|
|
37
|
+
await context.bulkImporter.validateEventStream(validationStream);
|
|
38
|
+
input.payloadId = file._id;
|
|
39
|
+
input.payloadSize = file.size;
|
|
40
|
+
const purgedInput = Object.fromEntries(Object.entries(input).filter(([, value]) => Boolean(value)));
|
|
41
|
+
const work = await context.modules.worker.addWork({
|
|
42
|
+
type: 'BULK_IMPORT',
|
|
43
|
+
input: purgedInput,
|
|
44
|
+
retries: 0,
|
|
45
|
+
priority: 10,
|
|
46
|
+
});
|
|
47
|
+
return Response.json(work, { status: 200 });
|
|
48
|
+
}
|
|
49
|
+
catch (e) {
|
|
50
|
+
logger.error(e);
|
|
51
|
+
return Response.json({ name: e.name, code: e.code, message: e.message }, { status: 503 });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BulkImportWorker } from "./adapter.js";
|
|
2
|
+
import { bulkImportHandler } from "./api.js";
|
|
3
|
+
const { BULK_IMPORT_API_PATH = '/bulk-import' } = process.env;
|
|
4
|
+
export const BulkImportPlugin = {
|
|
5
|
+
key: 'shop.unchained.worker-plugin.bulk-import',
|
|
6
|
+
label: 'Bulk Import Worker Plugin',
|
|
7
|
+
version: '1.0.0',
|
|
8
|
+
adapters: [BulkImportWorker],
|
|
9
|
+
routes: [
|
|
10
|
+
{
|
|
11
|
+
path: BULK_IMPORT_API_PATH,
|
|
12
|
+
method: 'POST',
|
|
13
|
+
handler: bulkImportHandler,
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
};
|
|
17
|
+
export default BulkImportPlugin;
|
|
18
|
+
export { BulkImportWorker } from "./adapter.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type IWorkerAdapter } from '@unchainedshop/core';
|
|
2
|
+
export declare const BulkGateWorker: IWorkerAdapter<{
|
|
3
|
+
from?: string;
|
|
4
|
+
to?: string;
|
|
5
|
+
text?: string;
|
|
6
|
+
unicode?: boolean;
|
|
7
|
+
country?: string;
|
|
8
|
+
schedule?: string | number;
|
|
9
|
+
promotional?: boolean;
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}, any>;
|
|
12
|
+
export default BulkGateWorker;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { WorkerAdapter
|
|
1
|
+
import { WorkerAdapter } from '@unchainedshop/core';
|
|
2
2
|
const { BULKGATE_APPLICATION_ID, BULKGATE_APPLICATION_TOKEN } = process.env;
|
|
3
|
-
const BulkGateWorker = {
|
|
3
|
+
export const BulkGateWorker = {
|
|
4
4
|
...WorkerAdapter,
|
|
5
5
|
key: 'shop.unchained.worker-plugin.bulkgate',
|
|
6
6
|
label: 'Send SMS through BulkGate',
|
|
@@ -88,4 +88,4 @@ const BulkGateWorker = {
|
|
|
88
88
|
}
|
|
89
89
|
},
|
|
90
90
|
};
|
|
91
|
-
|
|
91
|
+
export default BulkGateWorker;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {} from '@unchainedshop/core';
|
|
2
|
+
import { BulkGateWorker } from "./adapter.js";
|
|
3
|
+
export const BulkGatePlugin = {
|
|
4
|
+
key: 'shop.unchained.worker-plugin.bulkgate',
|
|
5
|
+
label: 'BulkGate SMS Worker Plugin',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
adapters: [BulkGateWorker],
|
|
8
|
+
};
|
|
9
|
+
export default BulkGatePlugin;
|
|
10
|
+
export { BulkGateWorker } from "./adapter.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type IWorkerAdapter } from '@unchainedshop/core';
|
|
2
|
+
export declare const checkEmailInterceptionEnabled: () => boolean;
|
|
3
|
+
export declare const EmailWorkerPlugin: IWorkerAdapter<{
|
|
4
|
+
from?: string;
|
|
5
|
+
to?: string;
|
|
6
|
+
subject?: string;
|
|
7
|
+
[x: string]: any;
|
|
8
|
+
}, any>;
|
|
9
|
+
export default EmailWorkerPlugin;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WorkerAdapter } from '@unchainedshop/core';
|
|
2
2
|
import { spawn } from 'node:child_process';
|
|
3
3
|
import { writeFile, mkdtemp } from 'node:fs/promises';
|
|
4
4
|
import { tmpdir } from 'node:os';
|
|
@@ -8,15 +8,29 @@ const logger = createLogger('unchained:worker:email');
|
|
|
8
8
|
export const checkEmailInterceptionEnabled = () => {
|
|
9
9
|
return process.env.NODE_ENV !== 'production' && !process.env.UNCHAINED_DISABLE_EMAIL_INTERCEPTION;
|
|
10
10
|
};
|
|
11
|
+
const escapeHtml = (str) => {
|
|
12
|
+
if (!str)
|
|
13
|
+
return '';
|
|
14
|
+
return str
|
|
15
|
+
.replace(/&/g, '&')
|
|
16
|
+
.replace(/</g, '<')
|
|
17
|
+
.replace(/>/g, '>')
|
|
18
|
+
.replace(/"/g, '"')
|
|
19
|
+
.replace(/'/g, ''');
|
|
20
|
+
};
|
|
11
21
|
const buildLink = async ({ filename, content, href, contentType, encoding, path }) => {
|
|
22
|
+
const safeFilename = escapeHtml(filename);
|
|
12
23
|
if (path) {
|
|
13
|
-
|
|
24
|
+
const safePath = escapeHtml(path.startsWith('/') ? path : `${process.cwd()}/${path}`);
|
|
25
|
+
return `<a href="file:/${safePath}">${safeFilename}</a>`;
|
|
14
26
|
}
|
|
15
27
|
if (href) {
|
|
16
|
-
|
|
28
|
+
const safeHref = escapeHtml(href);
|
|
29
|
+
return `<a href="${safeHref}">${safeFilename}</a>`;
|
|
17
30
|
}
|
|
18
31
|
if (content && encoding === 'base64') {
|
|
19
|
-
|
|
32
|
+
const safeContentType = escapeHtml(contentType);
|
|
33
|
+
return `<a target="_blank" href="${`data:${safeContentType};base64,${content}`}">${safeFilename}</a>`;
|
|
20
34
|
}
|
|
21
35
|
return '';
|
|
22
36
|
};
|
|
@@ -37,7 +51,7 @@ const openInBrowser = async (options) => {
|
|
|
37
51
|
if (!command) {
|
|
38
52
|
return false;
|
|
39
53
|
}
|
|
40
|
-
const messageBody = options.html || options.text
|
|
54
|
+
const messageBody = options.html || escapeHtml(options.text)?.replace(/(\r\n|\n|\r)/gm, '<br/>');
|
|
41
55
|
const attachmentLinks = await Promise.all((options.attachments || []).map(buildLink));
|
|
42
56
|
const content = `
|
|
43
57
|
<!DOCTYPE html>
|
|
@@ -47,13 +61,13 @@ const openInBrowser = async (options) => {
|
|
|
47
61
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
48
62
|
</head>
|
|
49
63
|
<body>
|
|
50
|
-
<b>From: </b>${options.from}<br/>
|
|
51
|
-
<b>To: </b>${options.to}<br/>
|
|
52
|
-
<b>Cc: </b>${options.cc}<br/>
|
|
53
|
-
<b>Bcc: </b>${options.bcc}<br/>
|
|
54
|
-
<b>Reply-To: </b>${options.replyTo}<br/>
|
|
64
|
+
<b>From: </b>${escapeHtml(options.from)}<br/>
|
|
65
|
+
<b>To: </b>${escapeHtml(options.to)}<br/>
|
|
66
|
+
<b>Cc: </b>${escapeHtml(options.cc)}<br/>
|
|
67
|
+
<b>Bcc: </b>${escapeHtml(options.bcc)}<br/>
|
|
68
|
+
<b>Reply-To: </b>${escapeHtml(options.replyTo)}<br/>
|
|
55
69
|
<br/>
|
|
56
|
-
<b>subject: </b>${options.subject}<br/>
|
|
70
|
+
<b>subject: </b>${escapeHtml(options.subject)}<br/>
|
|
57
71
|
<b>attachments: </b>${attachmentLinks.join(', ')}<br/>
|
|
58
72
|
<hr/>
|
|
59
73
|
${messageBody}
|
|
@@ -71,7 +85,7 @@ const openInBrowser = async (options) => {
|
|
|
71
85
|
resolve(true);
|
|
72
86
|
});
|
|
73
87
|
};
|
|
74
|
-
const EmailWorkerPlugin = {
|
|
88
|
+
export const EmailWorkerPlugin = {
|
|
75
89
|
...WorkerAdapter,
|
|
76
90
|
key: 'shop.unchained.worker-plugin.email',
|
|
77
91
|
label: 'Send a Mail through Nodemailer',
|
|
@@ -133,4 +147,4 @@ const EmailWorkerPlugin = {
|
|
|
133
147
|
}
|
|
134
148
|
},
|
|
135
149
|
};
|
|
136
|
-
|
|
150
|
+
export default EmailWorkerPlugin;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {} from '@unchainedshop/core';
|
|
2
|
+
import { EmailWorkerPlugin as EmailWorker } from "./adapter.js";
|
|
3
|
+
export const EmailPlugin = {
|
|
4
|
+
key: 'shop.unchained.worker-plugin.email',
|
|
5
|
+
label: 'Email Worker Plugin',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
adapters: [EmailWorker],
|
|
8
|
+
};
|
|
9
|
+
export default EmailPlugin;
|
|
10
|
+
export { EmailWorkerPlugin, checkEmailInterceptionEnabled } from "./adapter.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { enrollmentsSettings, EnrollmentStatus } from '@unchainedshop/core-enrollments';
|
|
2
2
|
import { EnrollmentDirector, WorkerDirector, WorkerAdapter, } from '@unchainedshop/core';
|
|
3
|
-
const GenerateOrderWorker = {
|
|
3
|
+
export const GenerateOrderWorker = {
|
|
4
4
|
...WorkerAdapter,
|
|
5
5
|
key: 'shop.unchained.worker-plugin.generate-enrollment-orders',
|
|
6
6
|
label: 'Generates new Orders from Enrollments',
|
|
@@ -65,7 +65,6 @@ const GenerateOrderWorker = {
|
|
|
65
65
|
};
|
|
66
66
|
},
|
|
67
67
|
};
|
|
68
|
-
WorkerDirector.registerAdapter(GenerateOrderWorker);
|
|
69
68
|
export const configureGenerateOrderAutoscheduling = () => {
|
|
70
69
|
if (enrollmentsSettings.autoSchedulingSchedule) {
|
|
71
70
|
WorkerDirector.configureAutoscheduling({
|
|
@@ -75,3 +74,4 @@ export const configureGenerateOrderAutoscheduling = () => {
|
|
|
75
74
|
});
|
|
76
75
|
}
|
|
77
76
|
};
|
|
77
|
+
export default GenerateOrderWorker;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {} from '@unchainedshop/core';
|
|
2
|
+
import { GenerateOrderWorker, configureGenerateOrderAutoscheduling } from "./adapter.js";
|
|
3
|
+
export const EnrollmentOrderGeneratorPlugin = {
|
|
4
|
+
key: 'shop.unchained.worker.enrollment-order-generator',
|
|
5
|
+
label: 'Enrollment Order Generator Worker Plugin',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
adapters: [GenerateOrderWorker],
|
|
8
|
+
onRegister: () => {
|
|
9
|
+
configureGenerateOrderAutoscheduling();
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
export default EnrollmentOrderGeneratorPlugin;
|
|
13
|
+
export { GenerateOrderWorker, configureGenerateOrderAutoscheduling } from "./adapter.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WorkStatus } from '@unchainedshop/core-worker';
|
|
2
|
-
import {
|
|
2
|
+
import { WorkerAdapter, WorkerDirector, schedule } from '@unchainedshop/core';
|
|
3
3
|
const everyDayAtFourInTheNight = schedule.parse.cron('0 3 * * *');
|
|
4
4
|
export const ErrorNotifications = {
|
|
5
5
|
...WorkerAdapter,
|
|
@@ -50,12 +50,13 @@ export const ErrorNotifications = {
|
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
52
|
};
|
|
53
|
-
WorkerDirector.registerAdapter(ErrorNotifications);
|
|
54
53
|
export default ErrorNotifications;
|
|
55
54
|
const ONE_DAY_IN_SECONDS = 24 * 60 * 60;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
export const configureErrorNotificationsAutoscheduling = () => {
|
|
56
|
+
WorkerDirector.configureAutoscheduling({
|
|
57
|
+
type: ErrorNotifications.type,
|
|
58
|
+
schedule: everyDayAtFourInTheNight,
|
|
59
|
+
input: async () => ({ secondsPassed: ONE_DAY_IN_SECONDS }),
|
|
60
|
+
retries: 0,
|
|
61
|
+
});
|
|
62
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {} from '@unchainedshop/core';
|
|
2
|
+
import { ErrorNotifications, configureErrorNotificationsAutoscheduling } from "./adapter.js";
|
|
3
|
+
export const ErrorNotificationsPlugin = {
|
|
4
|
+
key: 'shop.unchained.worker.error-notifications',
|
|
5
|
+
label: 'Error Notifications Worker Plugin',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
adapters: [ErrorNotifications],
|
|
8
|
+
onRegister: () => {
|
|
9
|
+
configureErrorNotificationsAutoscheduling();
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
export default ErrorNotificationsPlugin;
|
|
13
|
+
export * from "./adapter.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type IWorkerAdapter, type UnchainedCore } from '@unchainedshop/core';
|
|
2
2
|
export declare const ExportTokenWorker: IWorkerAdapter<void, void>;
|
|
3
3
|
export declare const configureExportToken: (unchainedAPI: UnchainedCore) => void;
|
|
4
|
-
export default
|
|
4
|
+
export default ExportTokenWorker;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WorkerEventTypes } from '@unchainedshop/core-worker';
|
|
2
|
-
import { WorkerAdapter
|
|
2
|
+
import { WorkerAdapter } from '@unchainedshop/core';
|
|
3
3
|
import { subscribe } from '@unchainedshop/events';
|
|
4
4
|
export const ExportTokenWorker = {
|
|
5
5
|
...WorkerAdapter,
|
|
@@ -22,5 +22,4 @@ export const configureExportToken = (unchainedAPI) => {
|
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
|
-
export default
|
|
26
|
-
WorkerDirector.registerAdapter(ExportTokenWorker);
|
|
25
|
+
export default ExportTokenWorker;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {} from '@unchainedshop/core';
|
|
2
|
+
import { ExportTokenWorker, configureExportToken } from "./adapter.js";
|
|
3
|
+
export const ExportTokenPlugin = {
|
|
4
|
+
key: 'shop.unchained.worker.export-token',
|
|
5
|
+
label: 'Export Token Worker Plugin',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
adapters: [ExportTokenWorker],
|
|
8
|
+
onRegister: (unchainedAPI) => {
|
|
9
|
+
configureExportToken(unchainedAPI);
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
export default ExportTokenPlugin;
|
|
13
|
+
export { ExportTokenWorker, configureExportToken } from "./adapter.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WorkerAdapter
|
|
1
|
+
import { WorkerAdapter } from '@unchainedshop/core';
|
|
2
2
|
export const ExternalWorkerPlugin = {
|
|
3
3
|
...WorkerAdapter,
|
|
4
4
|
key: 'shop.unchained.worker-plugin.external',
|
|
@@ -10,4 +10,4 @@ export const ExternalWorkerPlugin = {
|
|
|
10
10
|
throw new Error('Cannot do work for external workers');
|
|
11
11
|
},
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
export default ExternalWorkerPlugin;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {} from '@unchainedshop/core';
|
|
2
|
+
import { ExternalWorkerPlugin as ExternalWorker } from "./adapter.js";
|
|
3
|
+
export const ExternalPlugin = {
|
|
4
|
+
key: 'shop.unchained.worker-plugin.external',
|
|
5
|
+
label: 'External Worker Plugin',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
adapters: [ExternalWorker],
|
|
8
|
+
};
|
|
9
|
+
export default ExternalPlugin;
|
|
10
|
+
export { ExternalWorkerPlugin } from "./adapter.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { WorkerAdapter
|
|
1
|
+
import { WorkerAdapter } from '@unchainedshop/core';
|
|
2
2
|
import { setTimeout } from 'node:timers/promises';
|
|
3
|
-
const Heartbeat = {
|
|
3
|
+
export const Heartbeat = {
|
|
4
4
|
...WorkerAdapter,
|
|
5
5
|
key: 'shop.unchained.worker-plugin.heartbeat',
|
|
6
6
|
label: 'Heartbeat plugin to check if workers are working',
|
|
@@ -23,4 +23,4 @@ const Heartbeat = {
|
|
|
23
23
|
};
|
|
24
24
|
},
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
export default Heartbeat;
|