@unchainedshop/plugins 2.14.2 → 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 (220) 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/cryptopay/plugin.js +3 -3
  15. package/lib/payment/cryptopay/plugin.js.map +1 -1
  16. package/lib/payment/datatrans-v2/index.js +1 -1
  17. package/lib/payment/datatrans-v2/index.js.map +1 -1
  18. package/lib/payment/datatrans-v2/roundedAmountFromOrder.d.ts +2 -2
  19. package/lib/payment/datatrans-v2/roundedAmountFromOrder.d.ts.map +1 -1
  20. package/lib/payment/paypal-checkout.js +7 -1
  21. package/lib/payment/paypal-checkout.js.map +1 -1
  22. package/lib/payment/payrexx/index.js +0 -1
  23. package/lib/payment/payrexx/index.js.map +1 -1
  24. package/lib/payment/postfinance-checkout/utils.d.ts +1 -1
  25. package/lib/payment/postfinance-checkout/utils.d.ts.map +1 -1
  26. package/lib/payment/saferpay/adapter.d.ts +1 -1
  27. package/lib/payment/saferpay/adapter.d.ts.map +1 -1
  28. package/lib/payment/saferpay/api/api/SaferpayClient.d.ts +1 -1
  29. package/lib/payment/saferpay/api/api/SaferpayClient.d.ts.map +1 -1
  30. package/lib/payment/saferpay/db/SaferpayTransactionsCollection.d.ts +1 -1
  31. package/lib/payment/saferpay/db/SaferpayTransactionsCollection.d.ts.map +1 -1
  32. package/lib/payment/stripe/stripe.d.ts +3 -3
  33. package/lib/payment/stripe/stripe.d.ts.map +1 -1
  34. package/lib/payment/stripe/stripe.js +1 -1
  35. package/lib/plugins-index.d.ts +2 -33
  36. package/lib/plugins-index.d.ts.map +1 -1
  37. package/lib/plugins-index.js +16 -71
  38. package/lib/plugins-index.js.map +1 -1
  39. package/lib/presets/base-express.d.ts +3 -0
  40. package/lib/presets/base-express.d.ts.map +1 -0
  41. package/lib/presets/base-express.js +6 -0
  42. package/lib/presets/base-express.js.map +1 -0
  43. package/lib/presets/base-modules.d.ts +29 -0
  44. package/lib/presets/base-modules.d.ts.map +1 -0
  45. package/lib/presets/base-modules.js +40 -0
  46. package/lib/presets/base-modules.js.map +1 -0
  47. package/lib/presets/countries/ch.d.ts +4 -0
  48. package/lib/presets/countries/ch.d.ts.map +1 -0
  49. package/lib/presets/countries/ch.js +4 -0
  50. package/lib/presets/countries/ch.js.map +1 -0
  51. package/lib/presets/crypto-express.d.ts +4 -0
  52. package/lib/presets/crypto-express.d.ts.map +1 -0
  53. package/lib/presets/crypto-express.js +9 -0
  54. package/lib/presets/crypto-express.js.map +1 -0
  55. package/lib/presets/crypto-modules.d.ts +11 -0
  56. package/lib/presets/crypto-modules.d.ts.map +1 -0
  57. package/lib/presets/crypto-modules.js +14 -0
  58. package/lib/presets/crypto-modules.js.map +1 -0
  59. package/lib/pricing/delivery-swiss-tax.d.ts +1 -1
  60. package/lib/pricing/delivery-swiss-tax.d.ts.map +1 -1
  61. package/lib/pricing/delivery-swiss-tax.js +1 -1
  62. package/lib/pricing/delivery-swiss-tax.js.map +1 -1
  63. package/lib/pricing/discount-100-off.d.ts +1 -1
  64. package/lib/pricing/discount-100-off.d.ts.map +1 -1
  65. package/lib/pricing/discount-half-price-manual.d.ts +1 -1
  66. package/lib/pricing/discount-half-price-manual.d.ts.map +1 -1
  67. package/lib/pricing/discount-half-price.d.ts +1 -1
  68. package/lib/pricing/discount-half-price.d.ts.map +1 -1
  69. package/lib/pricing/free-delivery.d.ts +1 -1
  70. package/lib/pricing/free-delivery.d.ts.map +1 -1
  71. package/lib/pricing/free-delivery.js +1 -1
  72. package/lib/pricing/free-delivery.js.map +1 -1
  73. package/lib/pricing/free-payment.d.ts +1 -1
  74. package/lib/pricing/free-payment.d.ts.map +1 -1
  75. package/lib/pricing/free-payment.js +1 -1
  76. package/lib/pricing/free-payment.js.map +1 -1
  77. package/lib/pricing/order-delivery.d.ts +1 -1
  78. package/lib/pricing/order-delivery.d.ts.map +1 -1
  79. package/lib/pricing/order-discount.d.ts +1 -1
  80. package/lib/pricing/order-discount.d.ts.map +1 -1
  81. package/lib/pricing/order-discount.js +1 -1
  82. package/lib/pricing/order-discount.js.map +1 -1
  83. package/lib/pricing/order-items-discount.js +1 -1
  84. package/lib/pricing/order-items-discount.js.map +1 -1
  85. package/lib/pricing/order-round.d.ts +1 -1
  86. package/lib/pricing/order-round.d.ts.map +1 -1
  87. package/lib/pricing/order-round.js +1 -1
  88. package/lib/pricing/order-round.js.map +1 -1
  89. package/lib/pricing/product-catalog-price.d.ts +2 -1
  90. package/lib/pricing/product-catalog-price.d.ts.map +1 -1
  91. package/lib/pricing/product-catalog-price.js +17 -4
  92. package/lib/pricing/product-catalog-price.js.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-price-rateconversion.js +1 -1
  98. package/lib/pricing/product-price-rateconversion.js.map +1 -1
  99. package/lib/pricing/product-round.d.ts +1 -1
  100. package/lib/pricing/product-round.d.ts.map +1 -1
  101. package/lib/pricing/product-swiss-tax.d.ts +4 -12
  102. package/lib/pricing/product-swiss-tax.d.ts.map +1 -1
  103. package/lib/pricing/product-swiss-tax.js +3 -3
  104. package/lib/pricing/product-swiss-tax.js.map +1 -1
  105. package/lib/warehousing/eth-minter.js +4 -3
  106. package/lib/warehousing/eth-minter.js.map +1 -1
  107. package/lib/worker/bulk-import.d.ts +1 -1
  108. package/lib/worker/bulk-import.d.ts.map +1 -1
  109. package/lib/worker/bulk-import.js.map +1 -1
  110. package/lib/worker/enrollment-order-generator.d.ts.map +1 -1
  111. package/lib/worker/enrollment-order-generator.js +1 -0
  112. package/lib/worker/enrollment-order-generator.js.map +1 -1
  113. package/lib/worker/error-notifications.d.ts +1 -1
  114. package/lib/worker/error-notifications.d.ts.map +1 -1
  115. package/lib/worker/error-notifications.js +1 -1
  116. package/lib/worker/error-notifications.js.map +1 -1
  117. package/lib/worker/export-token.d.ts +2 -2
  118. package/lib/worker/export-token.d.ts.map +1 -1
  119. package/lib/worker/export-token.js +1 -1
  120. package/lib/worker/export-token.js.map +1 -1
  121. package/lib/worker/external.d.ts +1 -1
  122. package/lib/worker/external.d.ts.map +1 -1
  123. package/lib/worker/http-request.d.ts +1 -1
  124. package/lib/worker/http-request.d.ts.map +1 -1
  125. package/lib/worker/message.d.ts +1 -1
  126. package/lib/worker/message.d.ts.map +1 -1
  127. package/lib/worker/message.js.map +1 -1
  128. package/lib/worker/update-ecb-rates.js +2 -2
  129. package/lib/worker/update-ecb-rates.js.map +1 -1
  130. package/lib/worker/update-token-ownership.d.ts +1 -1
  131. package/lib/worker/update-token-ownership.d.ts.map +1 -1
  132. package/lib/worker/zombie-killer.d.ts +1 -1
  133. package/lib/worker/zombie-killer.d.ts.map +1 -1
  134. package/package.json +23 -21
  135. package/src/delivery/pick-mup.ts +1 -1
  136. package/src/delivery/post.ts +1 -1
  137. package/src/delivery/send-message.ts +1 -1
  138. package/src/delivery/stores.ts +1 -1
  139. package/src/enrollments/licensed.ts +1 -1
  140. package/src/files/gridfs/gridfs-adapter.ts +1 -1
  141. package/src/files/gridfs/gridfs-webhook.ts +1 -1
  142. package/src/files/minio/minio-adapter.ts +1 -1
  143. package/src/filters/local-search.ts +4 -4
  144. package/src/filters/strict-equal.ts +1 -1
  145. package/src/payment/apple-iap/adapter.ts +3 -3
  146. package/src/payment/apple-iap/db/AppleTransactionsCollection.ts +1 -1
  147. package/src/payment/braintree.ts +1 -1
  148. package/src/payment/cryptopay/db/CryptopayTransactions.ts +1 -1
  149. package/src/payment/cryptopay/middleware.ts +3 -3
  150. package/src/payment/cryptopay/plugin.ts +5 -5
  151. package/src/payment/datatrans-v2/index.ts +2 -2
  152. package/src/payment/datatrans-v2/middleware.ts +1 -1
  153. package/src/payment/datatrans-v2/roundedAmountFromOrder.ts +2 -2
  154. package/src/payment/invoice-prepaid.ts +1 -1
  155. package/src/payment/invoice.ts +1 -1
  156. package/src/payment/paypal-checkout.ts +8 -2
  157. package/src/payment/payrexx/index.ts +1 -2
  158. package/src/payment/payrexx/middleware.ts +1 -1
  159. package/src/payment/postfinance-checkout/index.ts +1 -1
  160. package/src/payment/postfinance-checkout/middleware.ts +1 -1
  161. package/src/payment/postfinance-checkout/utils.ts +1 -1
  162. package/src/payment/saferpay/adapter.ts +2 -2
  163. package/src/payment/saferpay/api/api/SaferpayClient.ts +1 -1
  164. package/src/payment/saferpay/db/SaferpayTransactionsCollection.ts +1 -1
  165. package/src/payment/saferpay/middleware.ts +1 -1
  166. package/src/payment/stripe/index.ts +1 -1
  167. package/src/payment/stripe/middleware.ts +1 -1
  168. package/src/payment/stripe/stripe.ts +4 -4
  169. package/src/plugins-index.ts +18 -101
  170. package/src/presets/base-express.ts +7 -0
  171. package/src/presets/base-modules.ts +56 -0
  172. package/src/presets/countries/ch.ts +3 -0
  173. package/src/presets/crypto-express.ts +12 -0
  174. package/src/presets/crypto-modules.ts +23 -0
  175. package/src/pricing/delivery-swiss-tax.ts +3 -6
  176. package/src/pricing/discount-100-off.ts +1 -1
  177. package/src/pricing/discount-half-price-manual.ts +1 -1
  178. package/src/pricing/discount-half-price.ts +1 -1
  179. package/src/pricing/free-delivery.ts +5 -2
  180. package/src/pricing/free-payment.ts +5 -2
  181. package/src/pricing/order-delivery.ts +1 -1
  182. package/src/pricing/order-discount.ts +1 -1
  183. package/src/pricing/order-items-discount.ts +1 -1
  184. package/src/pricing/order-items.ts +1 -1
  185. package/src/pricing/order-payment.ts +1 -1
  186. package/src/pricing/order-round.ts +1 -1
  187. package/src/pricing/product-catalog-price.ts +24 -7
  188. package/src/pricing/product-discount.ts +2 -5
  189. package/src/pricing/product-price-rateconversion.ts +3 -2
  190. package/src/pricing/product-round.ts +1 -1
  191. package/src/pricing/product-swiss-tax.test.ts +1 -0
  192. package/src/pricing/product-swiss-tax.ts +11 -8
  193. package/src/quotations/manual.ts +1 -1
  194. package/src/warehousing/eth-minter.ts +8 -6
  195. package/src/warehousing/store.ts +1 -1
  196. package/src/worker/bulk-import.ts +2 -2
  197. package/src/worker/email.ts +1 -1
  198. package/src/worker/enrollment-order-generator.ts +8 -6
  199. package/src/worker/error-notifications.ts +1 -1
  200. package/src/worker/export-token.ts +8 -3
  201. package/src/worker/external.ts +1 -1
  202. package/src/worker/heartbeat.ts +1 -1
  203. package/src/worker/http-request.ts +1 -1
  204. package/src/worker/message.ts +1 -2
  205. package/src/worker/push-notification.ts +1 -1
  206. package/src/worker/sms.ts +1 -1
  207. package/src/worker/update-coinbase-rates.ts +2 -2
  208. package/src/worker/update-ecb-rates.ts +4 -4
  209. package/src/worker/update-token-ownership.ts +1 -1
  210. package/src/worker/zombie-killer.ts +1 -1
  211. package/lib/accounts/google-oauth.d.ts +0 -4
  212. package/lib/accounts/google-oauth.d.ts.map +0 -1
  213. package/lib/accounts/google-oauth.js +0 -145
  214. package/lib/accounts/google-oauth.js.map +0 -1
  215. package/lib/accounts/linkedin-oauth.d.ts +0 -4
  216. package/lib/accounts/linkedin-oauth.d.ts.map +0 -1
  217. package/lib/accounts/linkedin-oauth.js +0 -82
  218. package/lib/accounts/linkedin-oauth.js.map +0 -1
  219. package/src/accounts/google-oauth.ts +0 -181
  220. package/src/accounts/linkedin-oauth.ts +0 -103
@@ -1,4 +1,4 @@
1
- import { IDiscountAdapter } from '@unchainedshop/types/discount.js';
1
+ import { IDiscountAdapter } from '@unchainedshop/utils';
2
2
  import {
3
3
  OrderDiscountDirector,
4
4
  OrderDiscountAdapter,
@@ -1,4 +1,4 @@
1
- import { IDiscountAdapter } from '@unchainedshop/types/discount.js';
1
+ import { IDiscountAdapter } from '@unchainedshop/utils';
2
2
  import { OrderDiscountDirector, OrderDiscountAdapter } from '@unchainedshop/core-orders';
3
3
  import { ProductDiscountConfiguration } from '@unchainedshop/core-products';
4
4
 
@@ -1,4 +1,4 @@
1
- import { IDiscountAdapter } from '@unchainedshop/types/discount.js';
1
+ import { IDiscountAdapter } from '@unchainedshop/utils';
2
2
  import { OrderDiscountDirector, OrderDiscountAdapter } from '@unchainedshop/core-orders';
3
3
  import { ProductDiscountConfiguration } from '@unchainedshop/core-products';
4
4
 
@@ -1,5 +1,8 @@
1
- import { DeliveryPricingAdapter, DeliveryPricingDirector } from '@unchainedshop/core-delivery';
2
- import { IDeliveryPricingAdapter } from '@unchainedshop/types/delivery.pricing.js';
1
+ import {
2
+ DeliveryPricingAdapter,
3
+ DeliveryPricingDirector,
4
+ IDeliveryPricingAdapter,
5
+ } from '@unchainedshop/core-delivery';
3
6
 
4
7
  export const DeliveryFreePrice: IDeliveryPricingAdapter = {
5
8
  ...DeliveryPricingAdapter,
@@ -1,5 +1,8 @@
1
- import { PaymentPricingAdapter, PaymentPricingDirector } from '@unchainedshop/core-payment';
2
- import { IPaymentPricingAdapter } from '@unchainedshop/types/payments.pricing.js';
1
+ import {
2
+ PaymentPricingAdapter,
3
+ PaymentPricingDirector,
4
+ IPaymentPricingAdapter,
5
+ } from '@unchainedshop/core-payment';
3
6
 
4
7
  export const PaymentFreePrice: IPaymentPricingAdapter = {
5
8
  ...PaymentPricingAdapter,
@@ -1,4 +1,4 @@
1
- import { IOrderPricingAdapter } from '@unchainedshop/types/orders.pricing.js';
1
+ import { IOrderPricingAdapter } from '@unchainedshop/core-orders';
2
2
  import { OrderPricingDirector, OrderPricingAdapter } from '@unchainedshop/core-orders';
3
3
 
4
4
  export const OrderDelivery: IOrderPricingAdapter = {
@@ -1,4 +1,4 @@
1
- import { IOrderPricingAdapter, OrderPricingRowCategory } from '@unchainedshop/types/orders.pricing.js';
1
+ import { IOrderPricingAdapter, OrderPricingRowCategory } from '@unchainedshop/core-orders';
2
2
  import {
3
3
  OrderPricingDirector,
4
4
  OrderPricingAdapter,
@@ -1,4 +1,4 @@
1
- import { IOrderPricingAdapter, OrderPricingRowCategory } from '@unchainedshop/types/orders.pricing.js';
1
+ import { IOrderPricingAdapter, OrderPricingRowCategory } from '@unchainedshop/core-orders';
2
2
  import {
3
3
  OrderPricingDirector,
4
4
  OrderPricingAdapter,
@@ -1,4 +1,4 @@
1
- import { IOrderPricingAdapter } from '@unchainedshop/types/orders.pricing.js';
1
+ import { IOrderPricingAdapter } from '@unchainedshop/core-orders';
2
2
  import { OrderPricingDirector, OrderPricingAdapter } from '@unchainedshop/core-orders';
3
3
 
4
4
  const OrderItems: IOrderPricingAdapter = {
@@ -1,4 +1,4 @@
1
- import { IOrderPricingAdapter } from '@unchainedshop/types/orders.pricing.js';
1
+ import { IOrderPricingAdapter } from '@unchainedshop/core-orders';
2
2
  import { OrderPricingDirector, OrderPricingAdapter } from '@unchainedshop/core-orders';
3
3
 
4
4
  const OrderPayment: IOrderPricingAdapter = {
@@ -1,5 +1,5 @@
1
1
  import { OrderPricingAdapter, OrderPricingDirector } from '@unchainedshop/core-orders';
2
- import { IOrderPricingAdapter, OrderPricingRowCategory } from '@unchainedshop/types/orders.pricing.js';
2
+ import { IOrderPricingAdapter, OrderPricingRowCategory } from '@unchainedshop/core-orders';
3
3
 
4
4
  interface PriceRoundSettings {
5
5
  defaultPrecision: number;
@@ -1,6 +1,27 @@
1
- import { IProductPricingAdapter } from '@unchainedshop/types/products.pricing.js';
1
+ import { IProductPricingAdapter } from '@unchainedshop/core-products';
2
2
  import { ProductPricingDirector, ProductPricingAdapter } from '@unchainedshop/core-products';
3
3
  import { resolveBestCurrency } from '@unchainedshop/utils';
4
+ import memoizee from 'memoizee';
5
+
6
+ const { NODE_ENV } = process.env;
7
+
8
+ export const resolveCurrency = memoizee(
9
+ async (context) => {
10
+ const { country, currency: forcedCurrency, modules } = context;
11
+ const countryObject = await modules.countries.findCountry({ isoCode: country });
12
+ const currencies = await modules.currencies.findCurrencies({ includeInactive: false });
13
+ const currency =
14
+ forcedCurrency || resolveBestCurrency(countryObject.defaultCurrencyCode, currencies);
15
+ return currency;
16
+ },
17
+ {
18
+ maxAge: NODE_ENV === 'production' ? 1000 * 60 : 100, // minute or 100ms
19
+ promise: true,
20
+ normalizer(args) {
21
+ return `${args[0].currency}-${args[0].country}`;
22
+ },
23
+ },
24
+ );
4
25
 
5
26
  export const ProductPrice: IProductPricingAdapter = {
6
27
  ...ProductPricingAdapter,
@@ -21,12 +42,8 @@ export const ProductPrice: IProductPricingAdapter = {
21
42
  ...pricingAdapter,
22
43
 
23
44
  calculate: async () => {
24
- const { product, country, currency: forcedCurrency, quantity, modules } = params.context;
25
- const countryObject = await modules.countries.findCountry({ isoCode: country });
26
- const currencies = await modules.currencies.findCurrencies({ includeInactive: false });
27
- const currency =
28
- forcedCurrency || resolveBestCurrency(countryObject.defaultCurrencyCode, currencies);
29
-
45
+ const { product, country, quantity, modules } = params.context;
46
+ const currency = await resolveCurrency(params.context);
30
47
  const price = await modules.products.prices.price(product, { country, currency, quantity });
31
48
  if (price) {
32
49
  const itemTotal = price.amount * quantity;
@@ -1,8 +1,5 @@
1
- import type { Discount } from '@unchainedshop/types/discount.js';
2
- import {
3
- IProductPricingAdapter,
4
- ProductPricingRowCategory,
5
- } from '@unchainedshop/types/products.pricing.js';
1
+ import type { Discount } from '@unchainedshop/utils';
2
+ import { IProductPricingAdapter, ProductPricingRowCategory } from '@unchainedshop/core-products';
6
3
  import {
7
4
  ProductPricingDirector,
8
5
  ProductPricingAdapter,
@@ -1,4 +1,4 @@
1
- import { IProductPricingAdapter } from '@unchainedshop/types/products.pricing.js';
1
+ import { IProductPricingAdapter } from '@unchainedshop/core-products';
2
2
  import { ProductPricingDirector, ProductPricingAdapter } from '@unchainedshop/core-products';
3
3
 
4
4
  export const ProductPriceRateConversion: IProductPricingAdapter = {
@@ -46,7 +46,8 @@ export const ProductPriceRateConversion: IProductPricingAdapter = {
46
46
  isoCode: targetCurrency,
47
47
  });
48
48
 
49
- if (!targetCurrencyObj?.isActive) return pricingAdapter.calculate();
49
+ if (!targetCurrencyObj?.isActive || !fromCurrencyObj?.isActive)
50
+ return pricingAdapter.calculate();
50
51
 
51
52
  const rateData = await modules.products.prices.rates.getRate(fromCurrencyObj, targetCurrencyObj);
52
53
 
@@ -1,4 +1,4 @@
1
- import { IProductPricingAdapter } from '@unchainedshop/types/products.pricing.js';
1
+ import { IProductPricingAdapter } from '@unchainedshop/core-products';
2
2
  import { ProductPricingAdapter, ProductPricingDirector } from '@unchainedshop/core-products';
3
3
 
4
4
  interface PriceRoundSettings {
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck
1
2
  import { getTaxRate, isDeliveryAddressInSwitzerland } from './product-swiss-tax.js';
2
3
 
3
4
  describe("ProductSwissTax", () => {
@@ -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,
@@ -53,15 +53,17 @@ const generateOrder = async (
53
53
  }
54
54
 
55
55
  const { paymentProviderId, context: paymentContext } = enrollment.payment;
56
-
57
56
  if (paymentProviderId) {
58
57
  await modules.orders.setPaymentProvider(orderId, paymentProviderId, unchainedAPI);
59
58
  }
59
+
60
60
  const { deliveryProviderId, context: deliveryContext } = enrollment.delivery;
61
61
  if (deliveryProviderId) {
62
62
  await modules.orders.setDeliveryProvider(orderId, deliveryProviderId, unchainedAPI);
63
63
  }
64
64
 
65
+ await modules.orders.updateCalculation(orderId, unchainedAPI);
66
+
65
67
  order = await modules.orders.checkout(
66
68
  order._id,
67
69
  {
@@ -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) => {
@@ -1,16 +1,16 @@
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 xmlJs from 'xml-js';
6
- import { ProductPriceRate } from '@unchainedshop/types/products.pricing.js';
5
+ import { xml2json } from 'xml-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`, {
10
10
  method: 'GET',
11
11
  })
12
12
  .then((res) => res.text())
13
- .then((text) => JSON.parse(xmlJs.xml2json(text)))
13
+ .then((text) => JSON.parse(xml2json(text)))
14
14
  .then((json) =>
15
15
  json.elements?.[0]?.elements
16
16
  .filter((e) => e.name.toLowerCase() === 'cube')[0]
@@ -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
 
@@ -1,4 +0,0 @@
1
- import { IOAuth2Adapter } from '@unchainedshop/types/accounts.js';
2
- declare const GoogleOAuth2Adapter: IOAuth2Adapter;
3
- export default GoogleOAuth2Adapter;
4
- //# sourceMappingURL=google-oauth.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"google-oauth.d.ts","sourceRoot":"","sources":["../../src/accounts/google-oauth.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAmFlE,QAAA,MAAM,mBAAmB,EAAE,cA4F1B,CAAC;AAIF,eAAe,mBAAmB,CAAC"}
@@ -1,145 +0,0 @@
1
- import { OAuth2Director, OAuth2Adapter } from '@unchainedshop/core-accountsjs';
2
- const { GOOGLE_OAUTH_CLIENT_ID, GOOGLE_OAUTH_CLIENT_SECRET } = process.env;
3
- const getGoggleAuthorizationCode = async ({ code, redirectUri, clientId, clientSecret, }) => {
4
- const response = await fetch('https://oauth2.googleapis.com/token', {
5
- method: 'POST',
6
- headers: {
7
- 'Content-Type': 'application/json',
8
- },
9
- // eslint-disable-next-line
10
- // @ts-ignore
11
- duplex: 'half',
12
- body: JSON.stringify({
13
- code,
14
- client_id: clientId,
15
- grant_type: 'authorization_code',
16
- client_secret: clientSecret,
17
- redirect_uri: redirectUri,
18
- access_type: 'offline',
19
- }),
20
- });
21
- return response.json();
22
- };
23
- const normalizeProfileData = (data) => {
24
- const { names = [], genders = [], addresses = [], emailAddresses = [], phoneNumbers = [], birthdays = [], photos = [], } = data;
25
- const [name] = names;
26
- const [gender] = genders;
27
- const [email] = emailAddresses;
28
- const [birthday] = birthdays;
29
- const [phone] = phoneNumbers;
30
- const [address] = addresses;
31
- const [photo] = photos;
32
- return {
33
- id: data.sub,
34
- firstName: name?.givenName,
35
- lastName: name?.familyName,
36
- displayName: name?.displayName,
37
- gender: gender?.value,
38
- email: email?.value,
39
- birthDate: birthday?.date
40
- ? new Date(birthday?.date?.year ?? 0, birthdays?.date?.month ?? 0, birthday?.date?.day ?? 0)
41
- : undefined,
42
- phoneNumber: phone?.canonicalForm,
43
- address: address?.formattedValue,
44
- avatarUrl: photo?.url,
45
- };
46
- };
47
- const parseGoogleIdToken = (idToken) => {
48
- const [, base64UserInfo] = idToken.split('.');
49
- const buff = Buffer.from(base64UserInfo, 'base64');
50
- const data = JSON.parse(buff.toString());
51
- return {
52
- id: data.sub,
53
- email: data?.email,
54
- firstName: data?.given_name,
55
- lastName: data?.family_name,
56
- avatarUrl: data?.picture,
57
- fullName: data?.name,
58
- exp: data?.exp,
59
- ...data,
60
- };
61
- };
62
- const GoogleOAuth2Adapter = {
63
- ...OAuth2Adapter,
64
- key: 'google-oauth2',
65
- label: 'Google Oauth',
66
- version: '1',
67
- provider: 'google',
68
- config: {
69
- clientId: GOOGLE_OAUTH_CLIENT_ID,
70
- scopes: [
71
- 'genders',
72
- 'emailAddresses',
73
- 'phoneNumbers',
74
- 'addresses',
75
- 'birthdays',
76
- 'metadata',
77
- 'names',
78
- 'photos',
79
- 'locations',
80
- ],
81
- },
82
- actions: () => {
83
- return {
84
- ...OAuth2Adapter.actions(null),
85
- configurationError: () => {
86
- return '';
87
- },
88
- isActive: () => {
89
- return Boolean(GOOGLE_OAUTH_CLIENT_ID && GOOGLE_OAUTH_CLIENT_SECRET);
90
- },
91
- getAuthorizationToken: async (authorizationCode, redirectUrl) => {
92
- return getGoggleAuthorizationCode({
93
- code: authorizationCode,
94
- clientId: GoogleOAuth2Adapter.config.clientId,
95
- redirectUri: redirectUrl,
96
- clientSecret: GOOGLE_OAUTH_CLIENT_SECRET,
97
- });
98
- },
99
- getAccountData: async ({ access_token, id_token }) => {
100
- const response = await fetch(`https://people.googleapis.com/v1/people/me?personFields=${GoogleOAuth2Adapter.config.scopes.join(',')}`, {
101
- headers: {
102
- Authorization: `Bearer ${access_token}`,
103
- },
104
- });
105
- if (response.status === 403)
106
- return parseGoogleIdToken(id_token);
107
- const profileInfoJSON = await response.json();
108
- if (profileInfoJSON?.error)
109
- throw new Error(profileInfoJSON?.error.message);
110
- return normalizeProfileData(profileInfoJSON);
111
- },
112
- isTokenValid: async (accessToken) => {
113
- const response = await fetch(`https://oauth2.googleapis.com/tokeninfo?id_token=${accessToken?.id_token}`);
114
- const tokenInfo = await response.json();
115
- if (tokenInfo.error) {
116
- return false;
117
- }
118
- return true;
119
- },
120
- refreshToken: async ({ refresh_token }) => {
121
- const response = await fetch('https://oauth2.googleapis.com/token', {
122
- method: 'POST',
123
- // eslint-disable-next-line
124
- // @ts-ignore
125
- duplex: 'half',
126
- headers: {
127
- 'Content-Type': 'application/json',
128
- },
129
- body: JSON.stringify({
130
- client_id: GoogleOAuth2Adapter.config.clientId,
131
- grant_type: 'refresh_token',
132
- client_secret: GOOGLE_OAUTH_CLIENT_SECRET,
133
- refresh_token,
134
- access_type: 'offline',
135
- }),
136
- });
137
- const refreshedAccessToken = await response.json();
138
- return refreshedAccessToken;
139
- },
140
- };
141
- },
142
- };
143
- OAuth2Director.registerAdapter(GoogleOAuth2Adapter);
144
- export default GoogleOAuth2Adapter;
145
- //# sourceMappingURL=google-oauth.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"google-oauth.js","sourceRoot":"","sources":["../../src/accounts/google-oauth.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/E,MAAM,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;AAE3E,MAAM,0BAA0B,GAAG,KAAK,EAAE,EACxC,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,YAAY,GACb,EAAgB,EAAE;IACjB,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,qCAAqC,EAAE;QAClE,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;SACnC;QACD,2BAA2B;QAC3B,aAAa;QACb,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACnB,IAAI;YACJ,SAAS,EAAE,QAAQ;YACnB,UAAU,EAAE,oBAAoB;YAChC,aAAa,EAAE,YAAY;YAC3B,YAAY,EAAE,WAAW;YACzB,WAAW,EAAE,SAAS;SACvB,CAAC;KACH,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;AACzB,CAAC,CAAC;AAEF,MAAM,oBAAoB,GAAG,CAAC,IAAI,EAAE,EAAE;IACpC,MAAM,EACJ,KAAK,GAAG,EAAE,EACV,OAAO,GAAG,EAAE,EACZ,SAAS,GAAG,EAAE,EACd,cAAc,GAAG,EAAE,EACnB,YAAY,GAAG,EAAE,EACjB,SAAS,GAAG,EAAE,EACd,MAAM,GAAG,EAAE,GACZ,GAAG,IAAI,CAAC;IACT,MAAM,CAA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Aa,EAAE,0BAA0B;wBACzC,aAAa;wBACb,WAAW,EAAE,SAAS;qBACvB,CAAC;iBACH,CAAC,CAAC;gBAEH,MAAM,oBAAoB,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;gBAEnD,OAAO,oBAAoB,CAAC;YAC9B,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,cAAc,CAAC,eAAe,CAAC,mBAAmB,CAAC,CAAC;AAEpD,eAAe,mBAAmB,CAAC"}
@@ -1,4 +0,0 @@
1
- import { IOAuth2Adapter } from '@unchainedshop/types/accounts.js';
2
- declare const LinkedInOAuthAdapter: IOAuth2Adapter;
3
- export default LinkedInOAuthAdapter;
4
- //# sourceMappingURL=linkedin-oauth.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"linkedin-oauth.d.ts","sourceRoot":"","sources":["../../src/accounts/linkedin-oauth.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AA2ClE,QAAA,MAAM,oBAAoB,EAAE,cAsD3B,CAAC;AAIF,eAAe,oBAAoB,CAAC"}