@unchainedshop/plugins 2.0.0-beta3 → 2.0.0-beta5

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 (173) hide show
  1. package/lib/delivery/pick-mup.js +2 -2
  2. package/lib/delivery/pick-mup.js.map +1 -1
  3. package/lib/delivery/post.js +2 -2
  4. package/lib/delivery/post.js.map +1 -1
  5. package/lib/delivery/send-message.js +2 -2
  6. package/lib/delivery/send-message.js.map +1 -1
  7. package/lib/delivery/stores.js +2 -2
  8. package/lib/delivery/stores.js.map +1 -1
  9. package/lib/enrollments/licensed.js +1 -1
  10. package/lib/enrollments/licensed.js.map +1 -1
  11. package/lib/files/gridfs/gridfs-adapter.js +1 -1
  12. package/lib/files/gridfs/gridfs-adapter.js.map +1 -1
  13. package/lib/files/minio/minio-adapter.js +1 -1
  14. package/lib/files/minio/minio-adapter.js.map +1 -1
  15. package/lib/filters/local-search.js +1 -1
  16. package/lib/filters/local-search.js.map +1 -1
  17. package/lib/filters/strict-equal.js +1 -1
  18. package/lib/filters/strict-equal.js.map +1 -1
  19. package/lib/payment/apple-iap/adapter.js +1 -1
  20. package/lib/payment/apple-iap/adapter.js.map +1 -1
  21. package/lib/payment/bity/adapter.js +1 -1
  22. package/lib/payment/bity/adapter.js.map +1 -1
  23. package/lib/payment/braintree.js +1 -1
  24. package/lib/payment/braintree.js.map +1 -1
  25. package/lib/payment/cryptopay/plugin.js +1 -1
  26. package/lib/payment/cryptopay/plugin.js.map +1 -1
  27. package/lib/payment/datatrans-v2/index.js +1 -1
  28. package/lib/payment/datatrans-v2/index.js.map +1 -1
  29. package/lib/payment/invoice-prepaid.js +2 -2
  30. package/lib/payment/invoice-prepaid.js.map +1 -1
  31. package/lib/payment/invoice.js +2 -2
  32. package/lib/payment/invoice.js.map +1 -1
  33. package/lib/payment/paypal-checkout.js +2 -2
  34. package/lib/payment/paypal-checkout.js.map +1 -1
  35. package/lib/payment/postfinance-checkout/index.js +1 -1
  36. package/lib/payment/postfinance-checkout/index.js.map +1 -1
  37. package/lib/payment/stripe.js +1 -1
  38. package/lib/payment/stripe.js.map +1 -1
  39. package/lib/payment/worldline-saferpay/index.js +1 -1
  40. package/lib/payment/worldline-saferpay/index.js.map +1 -1
  41. package/lib/pricing/delivery-swiss-tax.js +1 -1
  42. package/lib/pricing/delivery-swiss-tax.js.map +1 -1
  43. package/lib/pricing/discount-100-off.js +1 -1
  44. package/lib/pricing/discount-100-off.js.map +1 -1
  45. package/lib/pricing/discount-half-price-manual.js +2 -2
  46. package/lib/pricing/discount-half-price-manual.js.map +1 -1
  47. package/lib/pricing/discount-half-price.js +1 -1
  48. package/lib/pricing/discount-half-price.js.map +1 -1
  49. package/lib/pricing/free-delivery.js +1 -1
  50. package/lib/pricing/free-delivery.js.map +1 -1
  51. package/lib/pricing/free-payment.js +1 -1
  52. package/lib/pricing/free-payment.js.map +1 -1
  53. package/lib/pricing/order-delivery.js +1 -1
  54. package/lib/pricing/order-delivery.js.map +1 -1
  55. package/lib/pricing/order-discount.js +1 -1
  56. package/lib/pricing/order-discount.js.map +1 -1
  57. package/lib/pricing/order-items-discount.js +1 -1
  58. package/lib/pricing/order-items-discount.js.map +1 -1
  59. package/lib/pricing/order-items.js +1 -1
  60. package/lib/pricing/order-items.js.map +1 -1
  61. package/lib/pricing/order-payment.js +1 -1
  62. package/lib/pricing/order-payment.js.map +1 -1
  63. package/lib/pricing/product-catalog-price.js +1 -1
  64. package/lib/pricing/product-catalog-price.js.map +1 -1
  65. package/lib/pricing/product-discount.js +1 -1
  66. package/lib/pricing/product-discount.js.map +1 -1
  67. package/lib/pricing/product-price-rateconversion.js +1 -1
  68. package/lib/pricing/product-price-rateconversion.js.map +1 -1
  69. package/lib/pricing/product-price-round.js +1 -1
  70. package/lib/pricing/product-price-round.js.map +1 -1
  71. package/lib/pricing/product-swiss-tax.js +1 -1
  72. package/lib/pricing/product-swiss-tax.js.map +1 -1
  73. package/lib/quotations/manual.js +1 -1
  74. package/lib/quotations/manual.js.map +1 -1
  75. package/lib/warehousing/{infinite-minter.d.ts → eth-minter.d.ts} +0 -0
  76. package/lib/warehousing/eth-minter.js +124 -0
  77. package/lib/warehousing/eth-minter.js.map +1 -0
  78. package/lib/warehousing/google-sheets.js +1 -1
  79. package/lib/warehousing/google-sheets.js.map +1 -1
  80. package/lib/warehousing/store.js +1 -1
  81. package/lib/warehousing/store.js.map +1 -1
  82. package/lib/worker/{BulkImportWorker.d.ts → bulk-import.d.ts} +0 -0
  83. package/lib/worker/{BulkImportWorker.js → bulk-import.js} +2 -2
  84. package/lib/worker/bulk-import.js.map +1 -0
  85. package/lib/worker/email.js +1 -1
  86. package/lib/worker/email.js.map +1 -1
  87. package/lib/worker/{GenerateOrderWorker.d.ts → enrollment-order-generator.d.ts} +0 -0
  88. package/lib/worker/{GenerateOrderWorker.js → enrollment-order-generator.js} +2 -2
  89. package/lib/worker/enrollment-order-generator.js.map +1 -0
  90. package/lib/worker/export-token.js +1 -1
  91. package/lib/worker/export-token.js.map +1 -1
  92. package/lib/worker/external.js +1 -1
  93. package/lib/worker/external.js.map +1 -1
  94. package/lib/worker/heartbeat.js +1 -1
  95. package/lib/worker/heartbeat.js.map +1 -1
  96. package/lib/worker/http-request.js +1 -1
  97. package/lib/worker/http-request.js.map +1 -1
  98. package/lib/worker/{MessageWorker.d.ts → message.d.ts} +0 -0
  99. package/lib/worker/{MessageWorker.js → message.js} +2 -2
  100. package/lib/worker/message.js.map +1 -0
  101. package/lib/worker/sms.js +1 -1
  102. package/lib/worker/sms.js.map +1 -1
  103. package/lib/worker/update-coinbase-rates.js +1 -1
  104. package/lib/worker/update-coinbase-rates.js.map +1 -1
  105. package/lib/worker/update-ecb-rates.js +1 -1
  106. package/lib/worker/update-ecb-rates.js.map +1 -1
  107. package/lib/worker/update-token-ownership.js +2 -2
  108. package/lib/worker/update-token-ownership.js.map +1 -1
  109. package/lib/worker/{ZombieKillerWorker.d.ts → zombie-killer.d.ts} +0 -0
  110. package/lib/worker/{ZombieKillerWorker.js → zombie-killer.js} +2 -2
  111. package/lib/worker/zombie-killer.js.map +1 -0
  112. package/package.json +27 -20
  113. package/src/delivery/pick-mup.ts +2 -2
  114. package/src/delivery/post.ts +2 -2
  115. package/src/delivery/send-message.ts +2 -2
  116. package/src/delivery/stores.ts +2 -2
  117. package/src/enrollments/licensed.ts +1 -1
  118. package/src/files/gridfs/gridfs-adapter.ts +1 -1
  119. package/src/files/minio/minio-adapter.ts +1 -1
  120. package/src/filters/local-search.ts +1 -1
  121. package/src/filters/strict-equal.ts +1 -1
  122. package/src/payment/apple-iap/adapter.ts +1 -1
  123. package/src/payment/bity/adapter.ts +1 -1
  124. package/src/payment/braintree.ts +1 -1
  125. package/src/payment/cryptopay/module/configureCryptopayModule.ts +1 -1
  126. package/src/payment/cryptopay/plugin.ts +1 -1
  127. package/src/payment/datatrans-v2/index.ts +1 -1
  128. package/src/payment/invoice-prepaid.ts +2 -2
  129. package/src/payment/invoice.ts +2 -2
  130. package/src/payment/paypal-checkout.ts +2 -2
  131. package/src/payment/postfinance-checkout/index.ts +1 -1
  132. package/src/payment/stripe.ts +1 -1
  133. package/src/payment/worldline-saferpay/index.ts +1 -1
  134. package/src/pricing/delivery-swiss-tax.ts +1 -1
  135. package/src/pricing/discount-100-off.ts +1 -1
  136. package/src/pricing/discount-half-price-manual.ts +2 -2
  137. package/src/pricing/discount-half-price.ts +1 -1
  138. package/src/pricing/free-delivery.ts +1 -1
  139. package/src/pricing/free-payment.ts +1 -1
  140. package/src/pricing/order-delivery.ts +1 -1
  141. package/src/pricing/order-discount.ts +1 -1
  142. package/src/pricing/order-items-discount.ts +1 -1
  143. package/src/pricing/order-items.ts +1 -1
  144. package/src/pricing/order-payment.ts +1 -1
  145. package/src/pricing/product-catalog-price.ts +1 -1
  146. package/src/pricing/product-discount.ts +1 -1
  147. package/src/pricing/product-price-rateconversion.ts +1 -1
  148. package/src/pricing/product-price-round.ts +1 -1
  149. package/src/pricing/product-swiss-tax.ts +1 -1
  150. package/src/quotations/manual.ts +1 -1
  151. package/src/warehousing/eth-minter.ts +153 -0
  152. package/src/warehousing/google-sheets.ts +1 -1
  153. package/src/warehousing/store.ts +1 -1
  154. package/src/worker/{BulkImportWorker.ts → bulk-import.ts} +1 -1
  155. package/src/worker/email.ts +1 -1
  156. package/src/worker/{GenerateOrderWorker.ts → enrollment-order-generator.ts} +1 -1
  157. package/src/worker/export-token.ts +1 -1
  158. package/src/worker/external.ts +1 -1
  159. package/src/worker/heartbeat.ts +1 -1
  160. package/src/worker/http-request.ts +1 -1
  161. package/src/worker/{MessageWorker.ts → message.ts} +1 -1
  162. package/src/worker/sms.ts +1 -1
  163. package/src/worker/update-coinbase-rates.ts +1 -1
  164. package/src/worker/update-ecb-rates.ts +1 -1
  165. package/src/worker/update-token-ownership.ts +2 -2
  166. package/src/worker/{ZombieKillerWorker.ts → zombie-killer.ts} +1 -1
  167. package/lib/warehousing/infinite-minter.js +0 -50
  168. package/lib/warehousing/infinite-minter.js.map +0 -1
  169. package/lib/worker/BulkImportWorker.js.map +0 -1
  170. package/lib/worker/GenerateOrderWorker.js.map +0 -1
  171. package/lib/worker/MessageWorker.js.map +0 -1
  172. package/lib/worker/ZombieKillerWorker.js.map +0 -1
  173. package/src/warehousing/infinite-minter.ts +0 -66
@@ -5,8 +5,8 @@ const SendMessage: IDeliveryAdapter = {
5
5
  ...DeliveryAdapter,
6
6
 
7
7
  key: 'shop.unchained.delivery.send-message',
8
- label: 'Forward Delivery via Messaging',
9
- version: '1.0',
8
+ label: 'Forward via Messaging',
9
+ version: '1.0.0',
10
10
 
11
11
  initialConfiguration: [
12
12
  { key: 'from', value: '' },
@@ -5,8 +5,8 @@ const PickMup: IDeliveryAdapter = {
5
5
  ...DeliveryAdapter,
6
6
 
7
7
  key: 'shop.unchained.stores',
8
- label: 'Manual Pickup',
9
- version: '1.0',
8
+ label: 'Pre-configured Stores',
9
+ version: '1.0.0',
10
10
 
11
11
  typeSupported: (type) => {
12
12
  return type === DeliveryProviderType.PICKUP;
@@ -14,7 +14,7 @@ const LicensedEnrollments: IEnrollmentAdapter = {
14
14
  ...EnrollmentAdapter,
15
15
 
16
16
  key: 'shop.unchained.enrollments.licensed',
17
- version: '1.0',
17
+ version: '1.0.0',
18
18
  label: 'Simple Licensed Enrollments',
19
19
 
20
20
  isActivatedFor: (productPlan) => {
@@ -25,7 +25,7 @@ const bufferToStream = (buffer: any) => {
25
25
  export const GridFSAdapter: IFileAdapter = {
26
26
  key: 'shop.unchained.file-upload-plugin.gridfs',
27
27
  label: 'Uploads files to Database using GridFS',
28
- version: '1.0',
28
+ version: '1.0.0',
29
29
 
30
30
  ...FileAdapter,
31
31
 
@@ -109,7 +109,7 @@ const getExpiryDate = () => new Date(new Date().getTime() + PUT_URL_EXPIRY);
109
109
  export const MinioAdapter: IFileAdapter = {
110
110
  key: 'shop.unchained.file-upload-plugin.minio',
111
111
  label: 'Uploads files into an S3 bucket using minio',
112
- version: '1.0',
112
+ version: '1.0.0',
113
113
 
114
114
  ...FileAdapter,
115
115
 
@@ -9,7 +9,7 @@ const LocalSearch: IFilterAdapter = {
9
9
 
10
10
  key: 'shop.unchained.filters.local-search',
11
11
  label: 'Simple Fulltext search with MongoDB',
12
- version: '0.1',
12
+ version: '1.0.0',
13
13
  orderIndex: 1,
14
14
 
15
15
  actions: (params) => {
@@ -6,7 +6,7 @@ const StrictQualFilter: IFilterAdapter = {
6
6
 
7
7
  key: 'shop.unchained.filters.strict-qual',
8
8
  label: 'Simple Strict Equal DB Filter',
9
- version: '0.1',
9
+ version: '1.0.0',
10
10
  orderIndex: 0,
11
11
 
12
12
  actions: (params) => {
@@ -233,7 +233,7 @@ const AppleIAP: IPaymentAdapter = {
233
233
 
234
234
  key: 'shop.unchained.apple-iap',
235
235
  label: 'Apple In-App-Purchase',
236
- version: '1.0',
236
+ version: '1.0.0',
237
237
  initialConfiguration: [],
238
238
 
239
239
  typeSupported: (type) => {
@@ -262,7 +262,7 @@ const Bity: IPaymentAdapter = {
262
262
 
263
263
  key: 'shop.unchained.payment.bity',
264
264
  label: 'Bity',
265
- version: '1.0',
265
+ version: '1.0.0',
266
266
 
267
267
  initialConfiguration: [],
268
268
 
@@ -11,7 +11,7 @@ const BraintreeDirect: IPaymentAdapter = {
11
11
 
12
12
  key: 'shop.unchained.braintree-direct',
13
13
  label: 'Braintree Direct',
14
- version: '1.0',
14
+ version: '1.0.0',
15
15
 
16
16
  initialConfiguration: [
17
17
  {
@@ -20,7 +20,7 @@ export interface CryptopayModule {
20
20
  currency: string;
21
21
  orderPaymentId: string;
22
22
  }) => Promise<CryptopayTransaction>;
23
- getNextDerivationNumber: (currency: string) => Promise<number>
23
+ getNextDerivationNumber: (currency: string) => Promise<number>;
24
24
  }
25
25
 
26
26
  export const configureCryptopayModule = ({ db }: { db: Db }): CryptopayModule => {
@@ -49,7 +49,7 @@ const Cryptopay: IPaymentAdapter = {
49
49
 
50
50
  key: 'shop.unchained.payment.cryptopay',
51
51
  label: 'Cryptopay',
52
- version: '1.1',
52
+ version: '1.0.0',
53
53
 
54
54
  typeSupported(type) {
55
55
  return type === 'GENERIC';
@@ -39,7 +39,7 @@ const Datatrans: IPaymentAdapter = {
39
39
  ...PaymentAdapter,
40
40
 
41
41
  key: 'shop.unchained.datatrans',
42
- label: 'Datatrans (https://docs.datatrans.ch)',
42
+ label: 'Datatrans',
43
43
  version: '2.0.0',
44
44
 
45
45
  initialConfiguration: [
@@ -5,8 +5,8 @@ const InvoicePrepaid: IPaymentAdapter = {
5
5
  ...PaymentAdapter,
6
6
 
7
7
  key: 'shop.unchained.invoice-prepaid',
8
- label: 'Invoice Prepaid (manually)',
9
- version: '1.0',
8
+ label: 'Invoice pre-paid',
9
+ version: '1.0.0',
10
10
 
11
11
  initialConfiguration: [],
12
12
 
@@ -5,8 +5,8 @@ const Invoice: IPaymentAdapter = {
5
5
  ...PaymentAdapter,
6
6
 
7
7
  key: 'shop.unchained.invoice',
8
- label: 'Invoice (manually)',
9
- version: '1.0',
8
+ label: 'Invoice',
9
+ version: '1.0.0',
10
10
 
11
11
  initialConfiguration: [],
12
12
 
@@ -27,8 +27,8 @@ const PaypalCheckout: IPaymentAdapter = {
27
27
  ...PaymentAdapter,
28
28
 
29
29
  key: 'com.paypal.checkout',
30
- label: 'Paypal (Checkout / Native)',
31
- version: '1.0',
30
+ label: 'Paypal',
31
+ version: '1.0.0',
32
32
 
33
33
  initialConfiguration: [],
34
34
 
@@ -47,7 +47,7 @@ const PostfinanceCheckout: IPaymentAdapter = {
47
47
 
48
48
  key: 'shop.unchained.payment.postfinance-checkout',
49
49
  label: 'Postfinance Checkout',
50
- version: '1.0',
50
+ version: '1.0.0',
51
51
 
52
52
  typeSupported(type) {
53
53
  return type === 'GENERIC';
@@ -153,7 +153,7 @@ const Stripe: IPaymentAdapter = {
153
153
 
154
154
  key: 'shop.unchained.payment.stripe',
155
155
  label: 'Stripe',
156
- version: '2.0',
156
+ version: '2.0.0',
157
157
 
158
158
  typeSupported(type) {
159
159
  return type === 'GENERIC';
@@ -16,7 +16,7 @@ const WordlineSaferpay: IPaymentAdapter = {
16
16
 
17
17
  key: 'shop.unchained.payment.worldline-saferpay',
18
18
  label: 'Worldline Saferpay',
19
- version: '1.0',
19
+ version: '1.0.0',
20
20
 
21
21
  typeSupported(type) {
22
22
  return type === 'GENERIC';
@@ -56,7 +56,7 @@ export const DeliverySwissTax: IDeliveryPricingAdapter = {
56
56
  ...DeliveryPricingAdapter,
57
57
 
58
58
  key: 'shop.unchained.pricing.delivery-swiss-tax',
59
- version: '1.0',
59
+ version: '1.0.0',
60
60
  label: 'Apply Swiss Tax on Delivery Fees',
61
61
  orderIndex: 20,
62
62
 
@@ -6,7 +6,7 @@ const HundredOff: IDiscountAdapter = {
6
6
 
7
7
  key: 'shop.unchained.discount.100-off',
8
8
  label: '100 Off',
9
- version: '1.0',
9
+ version: '1.0.0',
10
10
  orderIndex: 1,
11
11
 
12
12
  // return true if a discount is allowed to get added manually by a user
@@ -5,8 +5,8 @@ const HalfPriceManual: IDiscountAdapter = {
5
5
  ...OrderDiscountAdapter,
6
6
 
7
7
  key: 'shop.unchained.discount.half-price-manual',
8
- label: 'Half Price',
9
- version: '1.0',
8
+ label: 'Half Price Manual',
9
+ version: '1.0.0',
10
10
  orderIndex: 2,
11
11
 
12
12
  // return true if a discount is allowed to get added manually by a user
@@ -6,7 +6,7 @@ const HalfPrice: IDiscountAdapter = {
6
6
 
7
7
  key: 'shop.unchained.discount.half-price',
8
8
  label: 'Half Price',
9
- version: '1.0',
9
+ version: '1.0.0',
10
10
  orderIndex: 3,
11
11
 
12
12
  // return true if a discount is allowed to get added manually by a user
@@ -5,8 +5,8 @@ export const DeliveryFreePrice: IDeliveryPricingAdapter = {
5
5
  ...DeliveryPricingAdapter,
6
6
 
7
7
  key: 'shop.unchained.pricing.delivery-free',
8
- version: '1.0',
9
8
  label: 'Free Delivery',
9
+ version: '1.0.0',
10
10
  orderIndex: 0,
11
11
 
12
12
  isActivatedFor: () => {
@@ -5,8 +5,8 @@ export const PaymentFreePrice: IPaymentPricingAdapter = {
5
5
  ...PaymentPricingAdapter,
6
6
 
7
7
  key: 'shop.unchained.pricing.payment-free',
8
- version: '1.0',
9
8
  label: 'Free Payment',
9
+ version: '1.0.0',
10
10
  orderIndex: 0,
11
11
 
12
12
  isActivatedFor: () => {
@@ -5,7 +5,7 @@ const OrderDelivery: IOrderPricingAdapter = {
5
5
  ...OrderPricingAdapter,
6
6
 
7
7
  key: 'shop.unchained.pricing.order-delivery',
8
- version: '1.0',
8
+ version: '1.0.0',
9
9
  label: 'Add Delivery Fees to Order',
10
10
  orderIndex: 10,
11
11
 
@@ -51,7 +51,7 @@ const OrderDiscount: IOrderPricingAdapter = {
51
51
  ...OrderPricingAdapter,
52
52
 
53
53
  key: 'shop.unchained.pricing.order-discount',
54
- version: '1.0',
54
+ version: '1.0.0',
55
55
  label: 'Apply Discounts on Total Order Value',
56
56
  orderIndex: 90,
57
57
 
@@ -44,7 +44,7 @@ const OrderItemsDiscount: IOrderPricingAdapter = {
44
44
  ...OrderPricingAdapter,
45
45
 
46
46
  key: 'shop.unchained.pricing.order-items-discount',
47
- version: '1.0',
47
+ version: '1.0.0',
48
48
  label: 'Apply Discounts on Total Value Of Goods',
49
49
  orderIndex: 89,
50
50
 
@@ -5,7 +5,7 @@ const OrderItems: IOrderPricingAdapter = {
5
5
  ...OrderPricingAdapter,
6
6
 
7
7
  key: 'shop.unchained.pricing.order-items',
8
- version: '1.0',
8
+ version: '1.0.0',
9
9
  label: 'Add Total Value Of Goods to Order',
10
10
  orderIndex: 0,
11
11
 
@@ -5,7 +5,7 @@ const OrderPayment: IOrderPricingAdapter = {
5
5
  ...OrderPricingAdapter,
6
6
 
7
7
  key: 'shop.unchained.pricing.order-payment',
8
- version: '1.0',
8
+ version: '1.0.0',
9
9
  label: 'Add Payment Fees to Order',
10
10
  orderIndex: 20,
11
11
 
@@ -5,7 +5,7 @@ const ProductPrice: IProductPricingAdapter = {
5
5
  ...ProductPricingAdapter,
6
6
 
7
7
  key: 'shop.unchained.pricing.product-price',
8
- version: '1.0',
8
+ version: '1.0.0',
9
9
  label: 'Add Gross Price to Product',
10
10
  orderIndex: 0,
11
11
 
@@ -13,7 +13,7 @@ const ProductDiscount: IProductPricingAdapter = {
13
13
  ...ProductPricingAdapter,
14
14
 
15
15
  key: 'shop.unchained.pricing.product-discount',
16
- version: '1.0',
16
+ version: '1.0.0',
17
17
  label: 'Apply Discounts on Product Price',
18
18
  orderIndex: 10,
19
19
 
@@ -5,7 +5,7 @@ const ProductPriceRateConversion: IProductPricingAdapter = {
5
5
  ...ProductPricingAdapter,
6
6
 
7
7
  key: 'shop.unchained.pricing.rate-conversion',
8
- version: '1.0',
8
+ version: '1.0.0',
9
9
  label: 'Generic rate conversion plugin that converts between rates if entry in DB exists.',
10
10
  orderIndex: 1,
11
11
 
@@ -32,7 +32,7 @@ export const ProductPriceRound: IProductPricingAdapter & {
32
32
  ...ProductPricingAdapter,
33
33
 
34
34
  key: 'shop.unchained.pricing.price-round',
35
- version: '1.0',
35
+ version: '1.0.0',
36
36
  label: 'Round product price to the next precision number',
37
37
  orderIndex: 2,
38
38
 
@@ -57,7 +57,7 @@ const ProductSwissTax: IProductPricingAdapter = {
57
57
  ...ProductPricingAdapter,
58
58
 
59
59
  key: 'shop.unchained.pricing.product-swiss-tax',
60
- version: '1.0',
60
+ version: '1.0.0',
61
61
  label: 'Apply Swiss Tax on Product',
62
62
  orderIndex: 20,
63
63
 
@@ -5,7 +5,7 @@ const ManualOffering: IQuotationAdapter = {
5
5
  ...QuotationAdapter,
6
6
 
7
7
  key: 'shop.unchained.quotations.manual',
8
- version: '1.0',
8
+ version: '1.0.0',
9
9
  label: 'Manual Offerings',
10
10
  orderIndex: 0,
11
11
 
@@ -0,0 +1,153 @@
1
+ import {
2
+ WarehousingDirector,
3
+ WarehousingAdapter,
4
+ WarehousingProviderType,
5
+ } from '@unchainedshop/core-warehousing';
6
+ import { ProductType, ProductContractStandard } from '@unchainedshop/types/products';
7
+ import { IWarehousingAdapter, WarehousingError } from '@unchainedshop/types/warehousing';
8
+ import { generateDbObjectId, systemLocale } from '@unchainedshop/utils';
9
+
10
+ const { MINTER_TOKEN_OFFSET = '0' } = process.env;
11
+
12
+ const ETHMinter: IWarehousingAdapter = {
13
+ ...WarehousingAdapter,
14
+
15
+ key: 'shop.unchained.warehousing.infinite-minter',
16
+ version: '1.0',
17
+ label: 'Infinite Minter',
18
+ orderIndex: 0,
19
+
20
+ initialConfiguration: [{ key: 'chainId', value: '0' }],
21
+
22
+ typeSupported: (type) => {
23
+ return type === WarehousingProviderType.VIRTUAL;
24
+ },
25
+
26
+ actions: (configuration, context) => {
27
+ const { product, orderPosition, token, modules, localeContext } = context;
28
+ return {
29
+ ...WarehousingAdapter.actions(configuration, context),
30
+
31
+ isActive() {
32
+ return product?.type === ProductType.TokenizedProduct;
33
+ },
34
+
35
+ configurationError() {
36
+ return null as any as WarehousingError;
37
+ },
38
+
39
+ stock: async () => {
40
+ const existingTokens = await modules.warehousing.findTokens(
41
+ product.tokenization.contractStandard === 'ERC721'
42
+ ? { contractAddress: product.tokenization.contractAddress }
43
+ : {
44
+ contractAddress: product.tokenization.contractAddress,
45
+ chainTokenId: product.tokenization.tokenId,
46
+ },
47
+ );
48
+ const tokensCreated = existingTokens.reduce((acc, curToken) => {
49
+ return acc + curToken.quantity;
50
+ }, 0);
51
+
52
+ return product?.tokenization?.supply ? product.tokenization.supply - tokensCreated : 0;
53
+ },
54
+
55
+ tokenize: async () => {
56
+ // Upload Image to IPFS
57
+ // Upload Metadata to IPFS
58
+ // Prepare metadata
59
+
60
+ const chainId = configuration.find(({ key }) => key === 'chainId')?.value || undefined;
61
+ const { contractAddress, contractStandard, tokenId } = product?.tokenization || {};
62
+ const _id = generateDbObjectId();
63
+ const meta = { contractStandard };
64
+
65
+ const existingTokens = await modules.warehousing.findTokens(
66
+ product.tokenization.contractStandard === 'ERC721'
67
+ ? { contractAddress: product.tokenization.contractAddress }
68
+ : {
69
+ contractAddress: product.tokenization.contractAddress,
70
+ chainTokenId: product.tokenization.tokenId,
71
+ },
72
+ );
73
+ const tokensCreated = existingTokens.reduce((acc, curToken) => {
74
+ return acc + curToken.quantity;
75
+ }, 0);
76
+
77
+ if (contractStandard === 'ERC721') {
78
+ // ERC721 is non-fungible, thus every _id unique!
79
+ return new Array(orderPosition?.quantity).fill(null).map((_, i) => ({
80
+ _id,
81
+ chainTokenId: Number(parseInt(MINTER_TOKEN_OFFSET, 10) + tokensCreated + (i + 1)).toString(),
82
+ contractAddress,
83
+ quantity: 1,
84
+ chainId,
85
+ meta,
86
+ }));
87
+ }
88
+ // ERC1155 is fungible, allow the same tokenId
89
+ return [
90
+ {
91
+ _id,
92
+ chainTokenId: tokenId,
93
+ contractAddress,
94
+ quantity: orderPosition?.quantity,
95
+ chainId,
96
+ meta,
97
+ },
98
+ ];
99
+ },
100
+
101
+ tokenMetadata: async () => {
102
+ // if ERC721 -> tokenUri
103
+ // if ERC1155 -> uri
104
+ // -> use the contract to get the correct metadata uri from tokenId
105
+
106
+ // depending on the ERC, build the correct metadata json schema
107
+ // https://eips.ethereum.org/EIPS/eip-1155
108
+ // https://eips.ethereum.org/EIPS/eip-721
109
+
110
+ const allLanguages = await modules.languages.findLanguages({
111
+ includeInactive: false,
112
+ });
113
+
114
+ const [firstMedia] = await modules.products.media.findProductMedias({
115
+ productId: product._id,
116
+ limit: 1,
117
+ });
118
+ const file = firstMedia && (await modules.files.findFile({ fileId: firstMedia.mediaId }));
119
+ const url = file && (await modules.files.getUrl(file, {}));
120
+ const text = await modules.products.texts.findLocalizedText({
121
+ productId: product._id,
122
+ locale: localeContext.normalized,
123
+ });
124
+
125
+ if (product.tokenization.contractStandard === ProductContractStandard.ERC1155) {
126
+ const isDefaultLanguageActive = localeContext.language === systemLocale.language;
127
+ const localization = isDefaultLanguageActive
128
+ ? {
129
+ uri: `${process.env.ROOT_URL}/erc-metadata/${product._id}/{locale}/${product.tokenization.tokenId}.json`,
130
+ default: systemLocale.language,
131
+ locales: allLanguages.map((lang) => lang.isoCode),
132
+ }
133
+ : undefined;
134
+
135
+ return {
136
+ name: `${text.title} #${token.chainTokenId}`,
137
+ description: text.description,
138
+ image: url,
139
+ properties: product.meta,
140
+ localization,
141
+ };
142
+ }
143
+ return {
144
+ name: text.title,
145
+ description: text.description,
146
+ image: url,
147
+ };
148
+ },
149
+ };
150
+ },
151
+ };
152
+
153
+ WarehousingDirector.registerAdapter(ETHMinter);
@@ -109,8 +109,8 @@ const GoogleSheets: IWarehousingAdapter = {
109
109
  ...WarehousingAdapter,
110
110
 
111
111
  key: 'shop.unchained.warehousing.google-sheets',
112
- version: '1.0',
113
112
  label: 'Google Sheets',
113
+ version: '1.0.0',
114
114
  orderIndex: 0,
115
115
 
116
116
  typeSupported: (type) => {
@@ -9,8 +9,8 @@ const Store: IWarehousingAdapter = {
9
9
  ...WarehousingAdapter,
10
10
 
11
11
  key: 'shop.unchained.warehousing.store',
12
- version: '1.0',
13
12
  label: 'Store',
13
+ version: '1.0.0',
14
14
  orderIndex: 0,
15
15
 
16
16
  initialConfiguration: [{ key: 'name', value: 'Flagship Store' }],
@@ -51,7 +51,7 @@ export const BulkImportWorker: IWorkerAdapter<any, Record<string, unknown>> = {
51
51
 
52
52
  key: 'shop.unchained.worker-plugin.bulk-import',
53
53
  label: 'Bulk Import',
54
- version: '1.0',
54
+ version: '1.0.0',
55
55
  type: 'BULK_IMPORT',
56
56
 
57
57
  doWork: async (rawPayload, unchainedAPI) => {
@@ -66,7 +66,7 @@ const EmailWorkerPlugin: IWorkerAdapter<
66
66
 
67
67
  key: 'shop.unchained.worker-plugin.email',
68
68
  label: 'Send a Mail through Nodemailer',
69
- version: '1.0',
69
+ version: '1.0.0',
70
70
  type: 'EMAIL',
71
71
 
72
72
  doWork: async ({ from, to, subject, ...rest }) => {
@@ -83,7 +83,7 @@ const GenerateOrderWorker: IWorkerAdapter<any, any> = {
83
83
 
84
84
  key: 'shop.unchained.worker-plugin.generate-enrollment-orders',
85
85
  label: 'Generates new Orders from Enrollments',
86
- version: '1.0',
86
+ version: '1.0.0',
87
87
  type: 'ENROLLMENT_ORDER_GENERATOR',
88
88
 
89
89
  doWork: async (input, requestContext) => {
@@ -7,7 +7,7 @@ export const ExportTokenWorker: IWorkerAdapter<void, void> = {
7
7
 
8
8
  key: 'shop.unchained.worker-plugin.export-token',
9
9
  label: 'External worker to hold the state of the minting/export process of tokens',
10
- version: '1.0',
10
+ version: '1.0.0',
11
11
  type: 'EXPORT_TOKEN',
12
12
  external: true,
13
13
 
@@ -6,7 +6,7 @@ export const ExternalWorkerPlugin: IWorkerAdapter<void, void> = {
6
6
 
7
7
  key: 'shop.unchained.worker-plugin.external',
8
8
  label: 'External plugin as a placeholder for workers who interact with the system only via GraphQL',
9
- version: '1.0',
9
+ version: '1.0.0',
10
10
  type: 'EXTERNAL',
11
11
  external: true,
12
12
 
@@ -21,7 +21,7 @@ const Heartbeat: IWorkerAdapter<Arg, Result> = {
21
21
 
22
22
  key: 'shop.unchained.worker-plugin.heartbeat',
23
23
  label: 'Heartbeat plugin to check if workers are working',
24
- version: '1.0',
24
+ version: '1.0.0',
25
25
 
26
26
  type: 'HEARTBEAT',
27
27
 
@@ -26,7 +26,7 @@ const HttpRequestWorkerPlugin: IWorkerAdapter<
26
26
 
27
27
  key: 'shop.unchained.worker-plugin.http-request',
28
28
  label: 'Request a resource via http request. 200 = success',
29
- version: '1.0',
29
+ version: '1.0.0',
30
30
  type: 'HTTP_REQUEST',
31
31
 
32
32
  async doWork({ url, data = {}, headers, method = 'POST' } = { method: 'POST' }) {
@@ -14,7 +14,7 @@ export const MessageWorker: IWorkerAdapter<
14
14
 
15
15
  key: 'shop.unchained.worker-plugin.message',
16
16
  label: 'Send Message by combining payload with a template and start concrete jobs',
17
- version: '1.0',
17
+ version: '1.0.0',
18
18
  type: 'MESSAGE',
19
19
 
20
20
  doWork: async ({ template, ...payload }, requestContext, workId) => {
package/src/worker/sms.ts CHANGED
@@ -19,7 +19,7 @@ const SmsWorkerPlugin: IWorkerAdapter<
19
19
 
20
20
  key: 'shop.unchained.worker-plugin.sms',
21
21
  label: 'Send a SMS through Twilio',
22
- version: '1.0',
22
+ version: '1.0.0',
23
23
 
24
24
  type: 'SMS',
25
25