@unchainedshop/plugins 3.0.0-alpha2 → 3.0.0-alpha3
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/lib/delivery/pick-mup.js +1 -1
- package/lib/delivery/pick-mup.js.map +1 -1
- package/lib/files/gridfs/gridfs-webhook.d.ts +1 -1
- package/lib/files/gridfs/gridfs-webhook.d.ts.map +1 -1
- package/lib/filters/local-search.d.ts +1 -1
- package/lib/filters/local-search.d.ts.map +1 -1
- package/lib/filters/local-search.js.map +1 -1
- package/lib/payment/apple-iap/db/AppleTransactionsCollection.d.ts +1 -1
- package/lib/payment/apple-iap/db/AppleTransactionsCollection.d.ts.map +1 -1
- package/lib/payment/cryptopay/db/CryptopayTransactions.d.ts +1 -1
- package/lib/payment/cryptopay/db/CryptopayTransactions.d.ts.map +1 -1
- package/lib/payment/cryptopay/plugin.d.ts +1 -1
- package/lib/payment/cryptopay/plugin.d.ts.map +1 -1
- package/lib/payment/datatrans-v2/index.js +2 -2
- package/lib/payment/datatrans-v2/index.js.map +1 -1
- package/lib/payment/datatrans-v2/roundedAmountFromOrder.d.ts +2 -2
- package/lib/payment/datatrans-v2/roundedAmountFromOrder.d.ts.map +1 -1
- package/lib/payment/paypal-checkout.js +7 -1
- package/lib/payment/paypal-checkout.js.map +1 -1
- package/lib/payment/postfinance-checkout/api.js +3 -3
- package/lib/payment/postfinance-checkout/api.js.map +1 -1
- package/lib/payment/postfinance-checkout/utils.d.ts +1 -1
- package/lib/payment/postfinance-checkout/utils.d.ts.map +1 -1
- package/lib/payment/saferpay/adapter.d.ts +1 -1
- package/lib/payment/saferpay/adapter.d.ts.map +1 -1
- package/lib/payment/saferpay/api/api/SaferpayClient.d.ts +1 -1
- package/lib/payment/saferpay/api/api/SaferpayClient.d.ts.map +1 -1
- package/lib/payment/saferpay/db/SaferpayTransactionsCollection.d.ts +1 -1
- package/lib/payment/saferpay/db/SaferpayTransactionsCollection.d.ts.map +1 -1
- package/lib/payment/stripe/middleware.d.ts.map +1 -1
- package/lib/payment/stripe/middleware.js +0 -3
- package/lib/payment/stripe/middleware.js.map +1 -1
- package/lib/payment/stripe/stripe.d.ts +3 -3
- package/lib/payment/stripe/stripe.d.ts.map +1 -1
- package/lib/payment/stripe/stripe.js +2 -2
- package/lib/payment/stripe/stripe.js.map +1 -1
- package/lib/plugins-index.d.ts +2 -31
- package/lib/plugins-index.d.ts.map +1 -1
- package/lib/plugins-index.js +10 -61
- package/lib/plugins-index.js.map +1 -1
- package/lib/presets/base-express.d.ts +3 -0
- package/lib/presets/base-express.d.ts.map +1 -0
- package/lib/presets/base-express.js +6 -0
- package/lib/presets/base-express.js.map +1 -0
- package/lib/presets/base-modules.d.ts +29 -0
- package/lib/presets/base-modules.d.ts.map +1 -0
- package/lib/presets/base-modules.js +40 -0
- package/lib/presets/base-modules.js.map +1 -0
- package/lib/presets/countries/ch.d.ts +4 -0
- package/lib/presets/countries/ch.d.ts.map +1 -0
- package/lib/presets/countries/ch.js +4 -0
- package/lib/presets/countries/ch.js.map +1 -0
- package/lib/presets/crypto-express.d.ts +4 -0
- package/lib/presets/crypto-express.d.ts.map +1 -0
- package/lib/presets/crypto-express.js +9 -0
- package/lib/presets/crypto-express.js.map +1 -0
- package/lib/presets/crypto-modules.d.ts +11 -0
- package/lib/presets/crypto-modules.d.ts.map +1 -0
- package/lib/presets/crypto-modules.js +14 -0
- package/lib/presets/crypto-modules.js.map +1 -0
- package/lib/pricing/delivery-swiss-tax.d.ts +1 -1
- package/lib/pricing/delivery-swiss-tax.d.ts.map +1 -1
- package/lib/pricing/delivery-swiss-tax.js +1 -1
- package/lib/pricing/delivery-swiss-tax.js.map +1 -1
- package/lib/pricing/discount-100-off.d.ts +1 -1
- package/lib/pricing/discount-100-off.d.ts.map +1 -1
- package/lib/pricing/discount-half-price-manual.d.ts +1 -1
- package/lib/pricing/discount-half-price-manual.d.ts.map +1 -1
- package/lib/pricing/discount-half-price.d.ts +1 -1
- package/lib/pricing/discount-half-price.d.ts.map +1 -1
- package/lib/pricing/free-delivery.d.ts +1 -1
- package/lib/pricing/free-delivery.d.ts.map +1 -1
- package/lib/pricing/free-delivery.js +1 -1
- package/lib/pricing/free-delivery.js.map +1 -1
- package/lib/pricing/free-payment.d.ts +1 -1
- package/lib/pricing/free-payment.d.ts.map +1 -1
- package/lib/pricing/free-payment.js +1 -1
- package/lib/pricing/free-payment.js.map +1 -1
- package/lib/pricing/order-delivery.d.ts +1 -1
- package/lib/pricing/order-delivery.d.ts.map +1 -1
- package/lib/pricing/order-discount.d.ts +1 -1
- package/lib/pricing/order-discount.d.ts.map +1 -1
- package/lib/pricing/order-discount.js +1 -1
- package/lib/pricing/order-discount.js.map +1 -1
- package/lib/pricing/order-items-discount.js +1 -1
- package/lib/pricing/order-items-discount.js.map +1 -1
- package/lib/pricing/order-round.d.ts +1 -1
- package/lib/pricing/order-round.d.ts.map +1 -1
- package/lib/pricing/order-round.js +1 -1
- package/lib/pricing/order-round.js.map +1 -1
- package/lib/pricing/product-catalog-price.d.ts +1 -1
- package/lib/pricing/product-catalog-price.d.ts.map +1 -1
- package/lib/pricing/product-discount.js +1 -1
- package/lib/pricing/product-discount.js.map +1 -1
- package/lib/pricing/product-price-rateconversion.d.ts +1 -1
- package/lib/pricing/product-price-rateconversion.d.ts.map +1 -1
- package/lib/pricing/product-round.d.ts +1 -1
- package/lib/pricing/product-round.d.ts.map +1 -1
- package/lib/pricing/product-swiss-tax.d.ts +4 -12
- package/lib/pricing/product-swiss-tax.d.ts.map +1 -1
- package/lib/pricing/product-swiss-tax.js +3 -3
- package/lib/pricing/product-swiss-tax.js.map +1 -1
- package/lib/warehousing/eth-minter.js +4 -3
- package/lib/warehousing/eth-minter.js.map +1 -1
- package/lib/worker/bulk-import.d.ts +1 -1
- package/lib/worker/bulk-import.d.ts.map +1 -1
- package/lib/worker/bulk-import.js.map +1 -1
- package/lib/worker/error-notifications.d.ts +1 -1
- package/lib/worker/error-notifications.d.ts.map +1 -1
- package/lib/worker/error-notifications.js +1 -1
- package/lib/worker/error-notifications.js.map +1 -1
- package/lib/worker/export-token.d.ts +2 -2
- package/lib/worker/export-token.d.ts.map +1 -1
- package/lib/worker/export-token.js +1 -1
- package/lib/worker/export-token.js.map +1 -1
- package/lib/worker/external.d.ts +1 -1
- package/lib/worker/external.d.ts.map +1 -1
- package/lib/worker/http-request.d.ts +1 -1
- package/lib/worker/http-request.d.ts.map +1 -1
- package/lib/worker/message.d.ts +1 -1
- package/lib/worker/message.d.ts.map +1 -1
- package/lib/worker/message.js.map +1 -1
- package/lib/worker/update-coinbase-rates.js +1 -1
- package/lib/worker/update-coinbase-rates.js.map +1 -1
- package/lib/worker/update-ecb-rates.js +1 -1
- package/lib/worker/update-ecb-rates.js.map +1 -1
- package/lib/worker/update-token-ownership.d.ts +1 -1
- package/lib/worker/update-token-ownership.d.ts.map +1 -1
- package/lib/worker/zombie-killer.d.ts +1 -1
- package/lib/worker/zombie-killer.d.ts.map +1 -1
- package/package.json +28 -26
- package/src/delivery/pick-mup.ts +1 -1
- package/src/delivery/post.ts +1 -1
- package/src/delivery/send-message.ts +1 -1
- package/src/delivery/stores.ts +1 -1
- package/src/enrollments/licensed.ts +1 -1
- package/src/files/gridfs/gridfs-adapter.ts +1 -1
- package/src/files/gridfs/gridfs-webhook.ts +1 -1
- package/src/files/minio/minio-adapter.ts +1 -1
- package/src/filters/local-search.ts +4 -4
- package/src/filters/strict-equal.ts +1 -1
- package/src/payment/apple-iap/adapter.ts +3 -3
- package/src/payment/apple-iap/db/AppleTransactionsCollection.ts +1 -1
- package/src/payment/braintree.ts +1 -1
- package/src/payment/cryptopay/db/CryptopayTransactions.ts +1 -1
- package/src/payment/cryptopay/middleware.ts +3 -3
- package/src/payment/cryptopay/plugin.ts +2 -2
- package/src/payment/datatrans-v2/index.ts +3 -3
- package/src/payment/datatrans-v2/middleware.ts +1 -1
- package/src/payment/datatrans-v2/roundedAmountFromOrder.ts +2 -2
- package/src/payment/invoice-prepaid.ts +1 -1
- package/src/payment/invoice.ts +1 -1
- package/src/payment/paypal-checkout.ts +8 -2
- package/src/payment/payrexx/index.ts +1 -1
- package/src/payment/payrexx/middleware.ts +1 -1
- package/src/payment/postfinance-checkout/api.ts +3 -3
- package/src/payment/postfinance-checkout/index.ts +1 -1
- package/src/payment/postfinance-checkout/middleware.ts +1 -1
- package/src/payment/postfinance-checkout/utils.ts +1 -1
- package/src/payment/saferpay/adapter.ts +2 -2
- package/src/payment/saferpay/api/api/SaferpayClient.ts +1 -1
- package/src/payment/saferpay/db/SaferpayTransactionsCollection.ts +1 -1
- package/src/payment/saferpay/middleware.ts +1 -1
- package/src/payment/stripe/index.ts +1 -1
- package/src/payment/stripe/middleware.ts +1 -4
- package/src/payment/stripe/stripe.ts +5 -5
- package/src/plugins-index.ts +13 -70
- package/src/presets/base-express.ts +7 -0
- package/src/presets/base-modules.ts +56 -0
- package/src/presets/countries/ch.ts +3 -0
- package/src/presets/crypto-express.ts +12 -0
- package/src/presets/crypto-modules.ts +23 -0
- package/src/pricing/delivery-swiss-tax.ts +3 -6
- package/src/pricing/discount-100-off.ts +1 -1
- package/src/pricing/discount-half-price-manual.ts +1 -1
- package/src/pricing/discount-half-price.ts +1 -1
- package/src/pricing/free-delivery.ts +5 -2
- package/src/pricing/free-payment.ts +5 -2
- package/src/pricing/order-delivery.ts +1 -1
- package/src/pricing/order-discount.ts +1 -1
- package/src/pricing/order-items-discount.ts +1 -1
- package/src/pricing/order-items.ts +1 -1
- package/src/pricing/order-payment.ts +1 -1
- package/src/pricing/order-round.ts +1 -1
- package/src/pricing/product-catalog-price.ts +1 -1
- package/src/pricing/product-discount.ts +2 -5
- package/src/pricing/product-price-rateconversion.ts +1 -1
- package/src/pricing/product-round.ts +1 -1
- package/src/pricing/product-swiss-tax.test.ts +1 -0
- package/src/pricing/product-swiss-tax.ts +11 -8
- package/src/quotations/manual.ts +1 -1
- package/src/warehousing/eth-minter.ts +8 -6
- package/src/warehousing/store.ts +1 -1
- package/src/worker/bulk-import.ts +2 -2
- package/src/worker/email.ts +1 -1
- package/src/worker/enrollment-order-generator.ts +5 -5
- package/src/worker/error-notifications.ts +1 -1
- package/src/worker/export-token.ts +8 -3
- package/src/worker/external.ts +1 -1
- package/src/worker/heartbeat.ts +1 -1
- package/src/worker/http-request.ts +1 -1
- package/src/worker/message.ts +1 -2
- package/src/worker/push-notification.ts +1 -1
- package/src/worker/sms.ts +1 -1
- package/src/worker/update-coinbase-rates.ts +3 -3
- package/src/worker/update-ecb-rates.ts +3 -3
- package/src/worker/update-token-ownership.ts +1 -1
- package/src/worker/zombie-killer.ts +1 -1
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { ProductPricingDirector, ProductPricingAdapter } from '@unchainedshop/core-products';
|
|
2
1
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import {
|
|
2
|
+
ProductPricingDirector,
|
|
3
|
+
ProductPricingAdapter,
|
|
4
|
+
ProductPricingAdapterContext,
|
|
5
|
+
} from '@unchainedshop/core-products';
|
|
6
|
+
import { IProductPricingAdapter, ProductPricingRowCategory } from '@unchainedshop/core-products';
|
|
8
7
|
import { SwissTaxCategories } from './tax/ch.js';
|
|
9
8
|
|
|
10
|
-
export const getTaxRate = (context:
|
|
9
|
+
export const getTaxRate = (context: ProductPricingAdapterContext) => {
|
|
11
10
|
const { product, order } = context;
|
|
12
11
|
|
|
13
12
|
const productSpecialTaxTag = product.tags?.find((tag) =>
|
|
@@ -21,7 +20,11 @@ export const getTaxRate = (context: { product: Product; order?: Order }) => {
|
|
|
21
20
|
return taxCategory.rate(order?.ordered);
|
|
22
21
|
};
|
|
23
22
|
|
|
24
|
-
export const isDeliveryAddressInSwitzerland = async ({
|
|
23
|
+
export const isDeliveryAddressInSwitzerland = async ({
|
|
24
|
+
order,
|
|
25
|
+
country,
|
|
26
|
+
modules,
|
|
27
|
+
}: ProductPricingAdapterContext) => {
|
|
25
28
|
let countryCode = country?.toUpperCase().trim();
|
|
26
29
|
|
|
27
30
|
if (order) {
|
package/src/quotations/manual.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IQuotationAdapter } from '@unchainedshop/
|
|
1
|
+
import { IQuotationAdapter } from '@unchainedshop/core-quotations';
|
|
2
2
|
import { QuotationDirector, QuotationAdapter } from '@unchainedshop/core-quotations';
|
|
3
3
|
|
|
4
4
|
const ManualOffering: IQuotationAdapter = {
|
|
@@ -3,15 +3,16 @@ import {
|
|
|
3
3
|
WarehousingAdapter,
|
|
4
4
|
WarehousingProviderType,
|
|
5
5
|
} from '@unchainedshop/core-warehousing';
|
|
6
|
-
import { ProductContractStandard
|
|
6
|
+
import { ProductContractStandard } from '@unchainedshop/core-products';
|
|
7
7
|
import {
|
|
8
8
|
IWarehousingAdapter,
|
|
9
9
|
WarehousingContext,
|
|
10
10
|
WarehousingError,
|
|
11
|
-
} from '@unchainedshop/
|
|
11
|
+
} from '@unchainedshop/core-warehousing';
|
|
12
12
|
import { systemLocale } from '@unchainedshop/utils';
|
|
13
13
|
import { generateDbObjectId } from '@unchainedshop/mongodb';
|
|
14
|
-
import {
|
|
14
|
+
import { UnchainedCore } from '@unchainedshop/core';
|
|
15
|
+
import { ProductTypes } from '@unchainedshop/core-products';
|
|
15
16
|
|
|
16
17
|
const { MINTER_TOKEN_OFFSET = '0' } = process.env;
|
|
17
18
|
|
|
@@ -30,7 +31,8 @@ const ETHMinter: IWarehousingAdapter = {
|
|
|
30
31
|
},
|
|
31
32
|
|
|
32
33
|
actions: (configuration, context) => {
|
|
33
|
-
const { product, orderPosition, token, modules, locale } = context as WarehousingContext &
|
|
34
|
+
const { product, orderPosition, token, modules, locale } = context as WarehousingContext &
|
|
35
|
+
UnchainedCore;
|
|
34
36
|
const { contractAddress, contractStandard, tokenId, supply, ercMetadataProperties } =
|
|
35
37
|
product?.tokenization || {};
|
|
36
38
|
|
|
@@ -53,7 +55,7 @@ const ETHMinter: IWarehousingAdapter = {
|
|
|
53
55
|
...WarehousingAdapter.actions(configuration, context),
|
|
54
56
|
|
|
55
57
|
isActive() {
|
|
56
|
-
return product?.type ===
|
|
58
|
+
return product?.type === ProductTypes.TokenizedProduct;
|
|
57
59
|
},
|
|
58
60
|
|
|
59
61
|
configurationError() {
|
|
@@ -116,7 +118,7 @@ const ETHMinter: IWarehousingAdapter = {
|
|
|
116
118
|
const url = file && (await modules.files.getUrl(file, {}));
|
|
117
119
|
const text = await modules.products.texts.findLocalizedText({
|
|
118
120
|
productId: product._id,
|
|
119
|
-
locale: locale?.
|
|
121
|
+
locale: locale?.baseName || systemLocale.baseName,
|
|
120
122
|
});
|
|
121
123
|
|
|
122
124
|
const name = `${text.title} #${chainTokenId}`;
|
package/src/warehousing/store.ts
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
WarehousingAdapter,
|
|
4
4
|
WarehousingProviderType,
|
|
5
5
|
} from '@unchainedshop/core-warehousing';
|
|
6
|
-
import { IWarehousingAdapter } from '@unchainedshop/
|
|
6
|
+
import { IWarehousingAdapter } from '@unchainedshop/core-warehousing';
|
|
7
7
|
|
|
8
8
|
const Store: IWarehousingAdapter = {
|
|
9
9
|
...WarehousingAdapter,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { IWorkerAdapter } from '@unchainedshop/types/worker.js';
|
|
2
1
|
import { WorkerDirector, WorkerAdapter } from '@unchainedshop/core-worker';
|
|
3
2
|
import { createLogger, LogLevel } from '@unchainedshop/logger';
|
|
4
3
|
import JSONStream from 'JSONStream';
|
|
5
4
|
import { EventIterator } from 'event-iterator';
|
|
6
|
-
import { UnchainedCore } from '@unchainedshop/
|
|
5
|
+
import { UnchainedCore } from '@unchainedshop/core';
|
|
6
|
+
import { IWorkerAdapter } from '@unchainedshop/core-worker';
|
|
7
7
|
|
|
8
8
|
const logger = createLogger('unchained:platform:bulk-import');
|
|
9
9
|
|
package/src/worker/email.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { join, isAbsolute } from 'path';
|
|
|
3
3
|
import { tmpdir } from 'os';
|
|
4
4
|
import { WorkerDirector, WorkerAdapter } from '@unchainedshop/core-worker';
|
|
5
5
|
import { createLogger } from '@unchainedshop/logger';
|
|
6
|
-
import { IWorkerAdapter } from '@unchainedshop/
|
|
6
|
+
import { IWorkerAdapter } from '@unchainedshop/core-worker';
|
|
7
7
|
import open from 'open';
|
|
8
8
|
import nodemailer from 'nodemailer';
|
|
9
9
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Enrollment } from '@unchainedshop/
|
|
2
|
-
import { OrderPosition } from '@unchainedshop/
|
|
3
|
-
import { Product } from '@unchainedshop/
|
|
4
|
-
import { IWorkerAdapter } from '@unchainedshop/
|
|
1
|
+
import { Enrollment } from '@unchainedshop/core-enrollments';
|
|
2
|
+
import { OrderPosition } from '@unchainedshop/core-orders';
|
|
3
|
+
import { Product } from '@unchainedshop/core-products';
|
|
4
|
+
import { IWorkerAdapter } from '@unchainedshop/core-worker';
|
|
5
5
|
import {
|
|
6
6
|
EnrollmentDirector,
|
|
7
7
|
enrollmentsSettings,
|
|
8
8
|
EnrollmentStatus,
|
|
9
9
|
} from '@unchainedshop/core-enrollments';
|
|
10
10
|
import { WorkerAdapter, WorkerDirector } from '@unchainedshop/core-worker';
|
|
11
|
-
import { UnchainedCore } from '@unchainedshop/
|
|
11
|
+
import { UnchainedCore } from '@unchainedshop/core';
|
|
12
12
|
|
|
13
13
|
const generateOrder = async (
|
|
14
14
|
enrollment: Enrollment,
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import {
|
|
2
|
+
WorkerDirector,
|
|
3
|
+
WorkerAdapter,
|
|
4
|
+
WorkerEventTypes,
|
|
5
|
+
Work,
|
|
6
|
+
IWorkerAdapter,
|
|
7
|
+
} from '@unchainedshop/core-worker';
|
|
8
|
+
import { UnchainedCore } from '@unchainedshop/core';
|
|
4
9
|
import { subscribe } from '@unchainedshop/events';
|
|
5
10
|
|
|
6
11
|
export const ExportTokenWorker: IWorkerAdapter<void, void> = {
|
package/src/worker/external.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IWorkerAdapter } from '@unchainedshop/
|
|
1
|
+
import { IWorkerAdapter } from '@unchainedshop/core-worker';
|
|
2
2
|
import { WorkerDirector, WorkerAdapter } from '@unchainedshop/core-worker';
|
|
3
3
|
|
|
4
4
|
export const ExternalWorkerPlugin: IWorkerAdapter<void, void> = {
|
package/src/worker/heartbeat.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="dom" />
|
|
2
|
-
import { IWorkerAdapter } from '@unchainedshop/
|
|
2
|
+
import { IWorkerAdapter } from '@unchainedshop/core-worker';
|
|
3
3
|
import { WorkerDirector, WorkerAdapter } from '@unchainedshop/core-worker';
|
|
4
4
|
import { log, LogLevel } from '@unchainedshop/logger';
|
|
5
5
|
|
package/src/worker/message.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { IWorkerAdapter, Work } from '@unchainedshop/types/worker.js';
|
|
2
1
|
import { MessagingDirector } from '@unchainedshop/core-messaging';
|
|
3
|
-
import { WorkerAdapter, WorkerDirector } from '@unchainedshop/core-worker';
|
|
2
|
+
import { WorkerAdapter, WorkerDirector, IWorkerAdapter, Work } from '@unchainedshop/core-worker';
|
|
4
3
|
import { createLogger } from '@unchainedshop/logger';
|
|
5
4
|
|
|
6
5
|
export const messagingLogger = createLogger('unchained:core-messaging');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WorkerDirector, WorkerAdapter } from '@unchainedshop/core-worker';
|
|
2
2
|
import { createLogger } from '@unchainedshop/logger';
|
|
3
|
-
import { IWorkerAdapter } from '@unchainedshop/
|
|
3
|
+
import { IWorkerAdapter } from '@unchainedshop/core-worker';
|
|
4
4
|
import webPush from 'web-push';
|
|
5
5
|
|
|
6
6
|
const { PUSH_NOTIFICATION_PUBLIC_KEY, PUSH_NOTIFICATION_PRIVATE_KEY } = process.env;
|
package/src/worker/sms.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WorkerDirector, WorkerAdapter } from '@unchainedshop/core-worker';
|
|
2
2
|
import { createLogger } from '@unchainedshop/logger';
|
|
3
|
-
import { IWorkerAdapter } from '@unchainedshop/
|
|
3
|
+
import { IWorkerAdapter } from '@unchainedshop/core-worker';
|
|
4
4
|
import Twilio from 'twilio';
|
|
5
5
|
|
|
6
6
|
const { TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, TWILIO_SMS_FROM } = process.env;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference lib="dom" />
|
|
2
|
-
import { IWorkerAdapter } from '@unchainedshop/
|
|
2
|
+
import { IWorkerAdapter } from '@unchainedshop/core-worker';
|
|
3
3
|
import { WorkerAdapter, WorkerDirector } from '@unchainedshop/core-worker';
|
|
4
4
|
import later from '@breejs/later';
|
|
5
|
-
import { ProductPriceRate } from '@unchainedshop/
|
|
5
|
+
import { ProductPriceRate } from '@unchainedshop/core-products';
|
|
6
6
|
import { resolveBestCurrency } from '@unchainedshop/utils';
|
|
7
7
|
|
|
8
8
|
const getExchangeRates = async (base) => {
|
|
@@ -61,7 +61,7 @@ const UpdateCoinbaseRates: IWorkerAdapter<any, any> = {
|
|
|
61
61
|
ratesUpdated: rates.length,
|
|
62
62
|
},
|
|
63
63
|
};
|
|
64
|
-
} catch
|
|
64
|
+
} catch {
|
|
65
65
|
return {
|
|
66
66
|
success: false,
|
|
67
67
|
error: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference lib="dom" />
|
|
2
|
-
import { IWorkerAdapter } from '@unchainedshop/
|
|
2
|
+
import { IWorkerAdapter } from '@unchainedshop/core-worker';
|
|
3
3
|
import { WorkerAdapter, WorkerDirector } from '@unchainedshop/core-worker';
|
|
4
4
|
import later from '@breejs/later';
|
|
5
5
|
import { xml2json } from 'xml-js';
|
|
6
|
-
import { ProductPriceRate } from '@unchainedshop/
|
|
6
|
+
import { ProductPriceRate } from '@unchainedshop/core-products';
|
|
7
7
|
|
|
8
8
|
const getExchangeRates = async () => {
|
|
9
9
|
return fetch(`https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml`, {
|
|
@@ -74,7 +74,7 @@ const UpdateECBRates: IWorkerAdapter<any, any> = {
|
|
|
74
74
|
ratesUpdated: rates.length,
|
|
75
75
|
},
|
|
76
76
|
};
|
|
77
|
-
} catch
|
|
77
|
+
} catch {
|
|
78
78
|
return {
|
|
79
79
|
success: false,
|
|
80
80
|
error: {
|