@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.
Files changed (208) hide show
  1. package/lib/delivery/pick-mup.js +1 -1
  2. package/lib/delivery/pick-mup.js.map +1 -1
  3. package/lib/files/gridfs/gridfs-webhook.d.ts +1 -1
  4. package/lib/files/gridfs/gridfs-webhook.d.ts.map +1 -1
  5. package/lib/filters/local-search.d.ts +1 -1
  6. package/lib/filters/local-search.d.ts.map +1 -1
  7. package/lib/filters/local-search.js.map +1 -1
  8. package/lib/payment/apple-iap/db/AppleTransactionsCollection.d.ts +1 -1
  9. package/lib/payment/apple-iap/db/AppleTransactionsCollection.d.ts.map +1 -1
  10. package/lib/payment/cryptopay/db/CryptopayTransactions.d.ts +1 -1
  11. package/lib/payment/cryptopay/db/CryptopayTransactions.d.ts.map +1 -1
  12. package/lib/payment/cryptopay/plugin.d.ts +1 -1
  13. package/lib/payment/cryptopay/plugin.d.ts.map +1 -1
  14. package/lib/payment/datatrans-v2/index.js +2 -2
  15. package/lib/payment/datatrans-v2/index.js.map +1 -1
  16. package/lib/payment/datatrans-v2/roundedAmountFromOrder.d.ts +2 -2
  17. package/lib/payment/datatrans-v2/roundedAmountFromOrder.d.ts.map +1 -1
  18. package/lib/payment/paypal-checkout.js +7 -1
  19. package/lib/payment/paypal-checkout.js.map +1 -1
  20. package/lib/payment/postfinance-checkout/api.js +3 -3
  21. package/lib/payment/postfinance-checkout/api.js.map +1 -1
  22. package/lib/payment/postfinance-checkout/utils.d.ts +1 -1
  23. package/lib/payment/postfinance-checkout/utils.d.ts.map +1 -1
  24. package/lib/payment/saferpay/adapter.d.ts +1 -1
  25. package/lib/payment/saferpay/adapter.d.ts.map +1 -1
  26. package/lib/payment/saferpay/api/api/SaferpayClient.d.ts +1 -1
  27. package/lib/payment/saferpay/api/api/SaferpayClient.d.ts.map +1 -1
  28. package/lib/payment/saferpay/db/SaferpayTransactionsCollection.d.ts +1 -1
  29. package/lib/payment/saferpay/db/SaferpayTransactionsCollection.d.ts.map +1 -1
  30. package/lib/payment/stripe/middleware.d.ts.map +1 -1
  31. package/lib/payment/stripe/middleware.js +0 -3
  32. package/lib/payment/stripe/middleware.js.map +1 -1
  33. package/lib/payment/stripe/stripe.d.ts +3 -3
  34. package/lib/payment/stripe/stripe.d.ts.map +1 -1
  35. package/lib/payment/stripe/stripe.js +2 -2
  36. package/lib/payment/stripe/stripe.js.map +1 -1
  37. package/lib/plugins-index.d.ts +2 -31
  38. package/lib/plugins-index.d.ts.map +1 -1
  39. package/lib/plugins-index.js +10 -61
  40. package/lib/plugins-index.js.map +1 -1
  41. package/lib/presets/base-express.d.ts +3 -0
  42. package/lib/presets/base-express.d.ts.map +1 -0
  43. package/lib/presets/base-express.js +6 -0
  44. package/lib/presets/base-express.js.map +1 -0
  45. package/lib/presets/base-modules.d.ts +29 -0
  46. package/lib/presets/base-modules.d.ts.map +1 -0
  47. package/lib/presets/base-modules.js +40 -0
  48. package/lib/presets/base-modules.js.map +1 -0
  49. package/lib/presets/countries/ch.d.ts +4 -0
  50. package/lib/presets/countries/ch.d.ts.map +1 -0
  51. package/lib/presets/countries/ch.js +4 -0
  52. package/lib/presets/countries/ch.js.map +1 -0
  53. package/lib/presets/crypto-express.d.ts +4 -0
  54. package/lib/presets/crypto-express.d.ts.map +1 -0
  55. package/lib/presets/crypto-express.js +9 -0
  56. package/lib/presets/crypto-express.js.map +1 -0
  57. package/lib/presets/crypto-modules.d.ts +11 -0
  58. package/lib/presets/crypto-modules.d.ts.map +1 -0
  59. package/lib/presets/crypto-modules.js +14 -0
  60. package/lib/presets/crypto-modules.js.map +1 -0
  61. package/lib/pricing/delivery-swiss-tax.d.ts +1 -1
  62. package/lib/pricing/delivery-swiss-tax.d.ts.map +1 -1
  63. package/lib/pricing/delivery-swiss-tax.js +1 -1
  64. package/lib/pricing/delivery-swiss-tax.js.map +1 -1
  65. package/lib/pricing/discount-100-off.d.ts +1 -1
  66. package/lib/pricing/discount-100-off.d.ts.map +1 -1
  67. package/lib/pricing/discount-half-price-manual.d.ts +1 -1
  68. package/lib/pricing/discount-half-price-manual.d.ts.map +1 -1
  69. package/lib/pricing/discount-half-price.d.ts +1 -1
  70. package/lib/pricing/discount-half-price.d.ts.map +1 -1
  71. package/lib/pricing/free-delivery.d.ts +1 -1
  72. package/lib/pricing/free-delivery.d.ts.map +1 -1
  73. package/lib/pricing/free-delivery.js +1 -1
  74. package/lib/pricing/free-delivery.js.map +1 -1
  75. package/lib/pricing/free-payment.d.ts +1 -1
  76. package/lib/pricing/free-payment.d.ts.map +1 -1
  77. package/lib/pricing/free-payment.js +1 -1
  78. package/lib/pricing/free-payment.js.map +1 -1
  79. package/lib/pricing/order-delivery.d.ts +1 -1
  80. package/lib/pricing/order-delivery.d.ts.map +1 -1
  81. package/lib/pricing/order-discount.d.ts +1 -1
  82. package/lib/pricing/order-discount.d.ts.map +1 -1
  83. package/lib/pricing/order-discount.js +1 -1
  84. package/lib/pricing/order-discount.js.map +1 -1
  85. package/lib/pricing/order-items-discount.js +1 -1
  86. package/lib/pricing/order-items-discount.js.map +1 -1
  87. package/lib/pricing/order-round.d.ts +1 -1
  88. package/lib/pricing/order-round.d.ts.map +1 -1
  89. package/lib/pricing/order-round.js +1 -1
  90. package/lib/pricing/order-round.js.map +1 -1
  91. package/lib/pricing/product-catalog-price.d.ts +1 -1
  92. package/lib/pricing/product-catalog-price.d.ts.map +1 -1
  93. package/lib/pricing/product-discount.js +1 -1
  94. package/lib/pricing/product-discount.js.map +1 -1
  95. package/lib/pricing/product-price-rateconversion.d.ts +1 -1
  96. package/lib/pricing/product-price-rateconversion.d.ts.map +1 -1
  97. package/lib/pricing/product-round.d.ts +1 -1
  98. package/lib/pricing/product-round.d.ts.map +1 -1
  99. package/lib/pricing/product-swiss-tax.d.ts +4 -12
  100. package/lib/pricing/product-swiss-tax.d.ts.map +1 -1
  101. package/lib/pricing/product-swiss-tax.js +3 -3
  102. package/lib/pricing/product-swiss-tax.js.map +1 -1
  103. package/lib/warehousing/eth-minter.js +4 -3
  104. package/lib/warehousing/eth-minter.js.map +1 -1
  105. package/lib/worker/bulk-import.d.ts +1 -1
  106. package/lib/worker/bulk-import.d.ts.map +1 -1
  107. package/lib/worker/bulk-import.js.map +1 -1
  108. package/lib/worker/error-notifications.d.ts +1 -1
  109. package/lib/worker/error-notifications.d.ts.map +1 -1
  110. package/lib/worker/error-notifications.js +1 -1
  111. package/lib/worker/error-notifications.js.map +1 -1
  112. package/lib/worker/export-token.d.ts +2 -2
  113. package/lib/worker/export-token.d.ts.map +1 -1
  114. package/lib/worker/export-token.js +1 -1
  115. package/lib/worker/export-token.js.map +1 -1
  116. package/lib/worker/external.d.ts +1 -1
  117. package/lib/worker/external.d.ts.map +1 -1
  118. package/lib/worker/http-request.d.ts +1 -1
  119. package/lib/worker/http-request.d.ts.map +1 -1
  120. package/lib/worker/message.d.ts +1 -1
  121. package/lib/worker/message.d.ts.map +1 -1
  122. package/lib/worker/message.js.map +1 -1
  123. package/lib/worker/update-coinbase-rates.js +1 -1
  124. package/lib/worker/update-coinbase-rates.js.map +1 -1
  125. package/lib/worker/update-ecb-rates.js +1 -1
  126. package/lib/worker/update-ecb-rates.js.map +1 -1
  127. package/lib/worker/update-token-ownership.d.ts +1 -1
  128. package/lib/worker/update-token-ownership.d.ts.map +1 -1
  129. package/lib/worker/zombie-killer.d.ts +1 -1
  130. package/lib/worker/zombie-killer.d.ts.map +1 -1
  131. package/package.json +28 -26
  132. package/src/delivery/pick-mup.ts +1 -1
  133. package/src/delivery/post.ts +1 -1
  134. package/src/delivery/send-message.ts +1 -1
  135. package/src/delivery/stores.ts +1 -1
  136. package/src/enrollments/licensed.ts +1 -1
  137. package/src/files/gridfs/gridfs-adapter.ts +1 -1
  138. package/src/files/gridfs/gridfs-webhook.ts +1 -1
  139. package/src/files/minio/minio-adapter.ts +1 -1
  140. package/src/filters/local-search.ts +4 -4
  141. package/src/filters/strict-equal.ts +1 -1
  142. package/src/payment/apple-iap/adapter.ts +3 -3
  143. package/src/payment/apple-iap/db/AppleTransactionsCollection.ts +1 -1
  144. package/src/payment/braintree.ts +1 -1
  145. package/src/payment/cryptopay/db/CryptopayTransactions.ts +1 -1
  146. package/src/payment/cryptopay/middleware.ts +3 -3
  147. package/src/payment/cryptopay/plugin.ts +2 -2
  148. package/src/payment/datatrans-v2/index.ts +3 -3
  149. package/src/payment/datatrans-v2/middleware.ts +1 -1
  150. package/src/payment/datatrans-v2/roundedAmountFromOrder.ts +2 -2
  151. package/src/payment/invoice-prepaid.ts +1 -1
  152. package/src/payment/invoice.ts +1 -1
  153. package/src/payment/paypal-checkout.ts +8 -2
  154. package/src/payment/payrexx/index.ts +1 -1
  155. package/src/payment/payrexx/middleware.ts +1 -1
  156. package/src/payment/postfinance-checkout/api.ts +3 -3
  157. package/src/payment/postfinance-checkout/index.ts +1 -1
  158. package/src/payment/postfinance-checkout/middleware.ts +1 -1
  159. package/src/payment/postfinance-checkout/utils.ts +1 -1
  160. package/src/payment/saferpay/adapter.ts +2 -2
  161. package/src/payment/saferpay/api/api/SaferpayClient.ts +1 -1
  162. package/src/payment/saferpay/db/SaferpayTransactionsCollection.ts +1 -1
  163. package/src/payment/saferpay/middleware.ts +1 -1
  164. package/src/payment/stripe/index.ts +1 -1
  165. package/src/payment/stripe/middleware.ts +1 -4
  166. package/src/payment/stripe/stripe.ts +5 -5
  167. package/src/plugins-index.ts +13 -70
  168. package/src/presets/base-express.ts +7 -0
  169. package/src/presets/base-modules.ts +56 -0
  170. package/src/presets/countries/ch.ts +3 -0
  171. package/src/presets/crypto-express.ts +12 -0
  172. package/src/presets/crypto-modules.ts +23 -0
  173. package/src/pricing/delivery-swiss-tax.ts +3 -6
  174. package/src/pricing/discount-100-off.ts +1 -1
  175. package/src/pricing/discount-half-price-manual.ts +1 -1
  176. package/src/pricing/discount-half-price.ts +1 -1
  177. package/src/pricing/free-delivery.ts +5 -2
  178. package/src/pricing/free-payment.ts +5 -2
  179. package/src/pricing/order-delivery.ts +1 -1
  180. package/src/pricing/order-discount.ts +1 -1
  181. package/src/pricing/order-items-discount.ts +1 -1
  182. package/src/pricing/order-items.ts +1 -1
  183. package/src/pricing/order-payment.ts +1 -1
  184. package/src/pricing/order-round.ts +1 -1
  185. package/src/pricing/product-catalog-price.ts +1 -1
  186. package/src/pricing/product-discount.ts +2 -5
  187. package/src/pricing/product-price-rateconversion.ts +1 -1
  188. package/src/pricing/product-round.ts +1 -1
  189. package/src/pricing/product-swiss-tax.test.ts +1 -0
  190. package/src/pricing/product-swiss-tax.ts +11 -8
  191. package/src/quotations/manual.ts +1 -1
  192. package/src/warehousing/eth-minter.ts +8 -6
  193. package/src/warehousing/store.ts +1 -1
  194. package/src/worker/bulk-import.ts +2 -2
  195. package/src/worker/email.ts +1 -1
  196. package/src/worker/enrollment-order-generator.ts +5 -5
  197. package/src/worker/error-notifications.ts +1 -1
  198. package/src/worker/export-token.ts +8 -3
  199. package/src/worker/external.ts +1 -1
  200. package/src/worker/heartbeat.ts +1 -1
  201. package/src/worker/http-request.ts +1 -1
  202. package/src/worker/message.ts +1 -2
  203. package/src/worker/push-notification.ts +1 -1
  204. package/src/worker/sms.ts +1 -1
  205. package/src/worker/update-coinbase-rates.ts +3 -3
  206. package/src/worker/update-ecb-rates.ts +3 -3
  207. package/src/worker/update-token-ownership.ts +1 -1
  208. package/src/worker/zombie-killer.ts +1 -1
@@ -1,13 +1,12 @@
1
- import { ProductPricingDirector, ProductPricingAdapter } from '@unchainedshop/core-products';
2
1
  import {
3
- IProductPricingAdapter,
4
- ProductPricingRowCategory,
5
- } from '@unchainedshop/types/products.pricing.js';
6
- import { Product } from '@unchainedshop/types/products.js';
7
- import { Order } from '@unchainedshop/types/orders.js';
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: { product: Product; order?: Order }) => {
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 ({ order, country, modules }) => {
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) {
@@ -1,4 +1,4 @@
1
- import { IQuotationAdapter } from '@unchainedshop/types/quotations.js';
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, ProductType } from '@unchainedshop/types/products.js';
6
+ import { ProductContractStandard } from '@unchainedshop/core-products';
7
7
  import {
8
8
  IWarehousingAdapter,
9
9
  WarehousingContext,
10
10
  WarehousingError,
11
- } from '@unchainedshop/types/warehousing.js';
11
+ } from '@unchainedshop/core-warehousing';
12
12
  import { systemLocale } from '@unchainedshop/utils';
13
13
  import { generateDbObjectId } from '@unchainedshop/mongodb';
14
- import { Context } from '@unchainedshop/types/api.js';
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 & Context;
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 === ProductType.TokenizedProduct;
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?.normalized || systemLocale.normalized,
121
+ locale: locale?.baseName || systemLocale.baseName,
120
122
  });
121
123
 
122
124
  const name = `${text.title} #${chainTokenId}`;
@@ -3,7 +3,7 @@ import {
3
3
  WarehousingAdapter,
4
4
  WarehousingProviderType,
5
5
  } from '@unchainedshop/core-warehousing';
6
- import { IWarehousingAdapter } from '@unchainedshop/types/warehousing.js';
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/types/core.js';
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
 
@@ -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/types/worker.js';
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/types/enrollments.js';
2
- import { OrderPosition } from '@unchainedshop/types/orders.positions.js';
3
- import { Product } from '@unchainedshop/types/products.js';
4
- import { IWorkerAdapter } from '@unchainedshop/types/worker.js';
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/types/core.js';
11
+ import { UnchainedCore } from '@unchainedshop/core';
12
12
 
13
13
  const generateOrder = async (
14
14
  enrollment: Enrollment,
@@ -1,4 +1,4 @@
1
- import { IWorkerAdapter, WorkStatus } from '@unchainedshop/types/worker.js';
1
+ import { IWorkerAdapter, WorkStatus } from '@unchainedshop/core-worker';
2
2
  import { WorkerDirector, WorkerAdapter } from '@unchainedshop/core-worker';
3
3
  import later from '@breejs/later';
4
4
 
@@ -1,6 +1,11 @@
1
- import { IWorkerAdapter, Work } from '@unchainedshop/types/worker.js';
2
- import { WorkerDirector, WorkerAdapter, WorkerEventTypes } from '@unchainedshop/core-worker';
3
- import { UnchainedCore } from '@unchainedshop/types/core.js';
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> = {
@@ -1,4 +1,4 @@
1
- import { IWorkerAdapter } from '@unchainedshop/types/worker.js';
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> = {
@@ -1,4 +1,4 @@
1
- import { IWorkerAdapter } from '@unchainedshop/types/worker.js';
1
+ import { IWorkerAdapter } from '@unchainedshop/core-worker';
2
2
  import { WorkerDirector, WorkerAdapter } from '@unchainedshop/core-worker';
3
3
 
4
4
  const wait = async (time: number) => {
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="dom" />
2
- import { IWorkerAdapter } from '@unchainedshop/types/worker.js';
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
 
@@ -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/types/worker.js';
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/types/worker.js';
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/types/worker.js';
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/types/products.pricing.js';
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 (e) {
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/types/worker.js';
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/types/products.pricing.js';
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 (e) {
77
+ } catch {
78
78
  return {
79
79
  success: false,
80
80
  error: {
@@ -1,4 +1,4 @@
1
- import { IWorkerAdapter } from '@unchainedshop/types/worker.js';
1
+ import { IWorkerAdapter } from '@unchainedshop/core-worker';
2
2
  import { WorkerDirector, WorkerAdapter } from '@unchainedshop/core-worker';
3
3
  import later from '@breejs/later';
4
4
 
@@ -1,4 +1,4 @@
1
- import { IWorkerAdapter } from '@unchainedshop/types/worker.js';
1
+ import { IWorkerAdapter } from '@unchainedshop/core-worker';
2
2
  import { WorkerDirector, WorkerAdapter } from '@unchainedshop/core-worker';
3
3
  import { createLogger } from '@unchainedshop/logger';
4
4