@unchainedshop/plugins 4.6.1 → 4.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (327) hide show
  1. package/README.md +0 -2
  2. package/lib/delivery/post/adapter.d.ts +2 -0
  3. package/lib/delivery/{post.js → post/adapter.js} +2 -3
  4. package/lib/delivery/post/index.d.ts +4 -0
  5. package/lib/delivery/post/index.js +10 -0
  6. package/lib/delivery/send-message/adapter.d.ts +2 -0
  7. package/lib/delivery/{send-message.js → send-message/adapter.js} +2 -3
  8. package/lib/delivery/send-message/index.d.ts +4 -0
  9. package/lib/delivery/send-message/index.js +10 -0
  10. package/lib/delivery/stores/adapter.d.ts +2 -0
  11. package/lib/delivery/{stores.js → stores/adapter.js} +2 -3
  12. package/lib/delivery/stores/index.d.ts +4 -0
  13. package/lib/delivery/stores/index.js +10 -0
  14. package/lib/enrollments/licensed/adapter.d.ts +6 -0
  15. package/lib/enrollments/{licensed.js → licensed/adapter.js} +2 -3
  16. package/lib/enrollments/licensed/index.d.ts +4 -0
  17. package/lib/enrollments/licensed/index.js +10 -0
  18. package/lib/events/node-event-emitter.d.ts +3 -1
  19. package/lib/events/node-event-emitter.js +3 -3
  20. package/lib/files/gridfs/adapter.d.ts +2 -2
  21. package/lib/files/gridfs/adapter.js +2 -5
  22. package/lib/files/gridfs/api.d.ts +7 -0
  23. package/lib/files/gridfs/api.js +163 -0
  24. package/lib/files/gridfs/index.d.ts +5 -4
  25. package/lib/files/gridfs/index.js +30 -3
  26. package/lib/files/minio/adapter.d.ts +4 -0
  27. package/lib/files/minio/adapter.js +160 -0
  28. package/lib/files/minio/api.d.ts +2 -0
  29. package/lib/files/minio/api.js +41 -0
  30. package/lib/files/minio/index.d.ts +4 -5
  31. package/lib/files/minio/index.js +18 -157
  32. package/lib/files/temp-upload/api.d.ts +6 -0
  33. package/lib/files/temp-upload/api.js +49 -0
  34. package/lib/files/temp-upload/index.d.ts +3 -0
  35. package/lib/files/temp-upload/index.js +15 -0
  36. package/lib/filters/local-search/adapter.d.ts +2 -0
  37. package/lib/filters/{local-search.js → local-search/adapter.js} +2 -12
  38. package/lib/filters/local-search/index.d.ts +4 -0
  39. package/lib/filters/local-search/index.js +16 -0
  40. package/lib/filters/strict-equal/adapter.d.ts +2 -0
  41. package/lib/filters/{strict-equal.js → strict-equal/adapter.js} +2 -3
  42. package/lib/filters/strict-equal/index.d.ts +4 -0
  43. package/lib/filters/strict-equal/index.js +10 -0
  44. package/lib/payment/apple-iap/adapter.d.ts +2 -1
  45. package/lib/payment/apple-iap/adapter.js +2 -3
  46. package/lib/payment/apple-iap/api.d.ts +2 -0
  47. package/lib/payment/apple-iap/{handler-fastify.js → api.js} +47 -30
  48. package/lib/payment/apple-iap/index.d.ts +6 -4
  49. package/lib/payment/apple-iap/index.js +28 -3
  50. package/lib/payment/cryptopay/adapter.d.ts +2 -0
  51. package/lib/payment/cryptopay/{plugin.js → adapter.js} +2 -4
  52. package/lib/payment/cryptopay/api.d.ts +2 -0
  53. package/lib/payment/cryptopay/api.js +23 -0
  54. package/lib/payment/cryptopay/index.d.ts +5 -4
  55. package/lib/payment/cryptopay/index.js +31 -3
  56. package/lib/payment/datatrans-v2/adapter.d.ts +2 -0
  57. package/lib/payment/datatrans-v2/adapter.js +406 -0
  58. package/lib/payment/datatrans-v2/api.d.ts +2 -0
  59. package/lib/payment/datatrans-v2/api.js +108 -0
  60. package/lib/payment/datatrans-v2/index.d.ts +4 -1
  61. package/lib/payment/datatrans-v2/index.js +17 -400
  62. package/lib/payment/invoice/adapter.d.ts +2 -0
  63. package/lib/payment/{invoice.js → invoice/adapter.js} +2 -3
  64. package/lib/payment/invoice/index.d.ts +4 -0
  65. package/lib/payment/invoice/index.js +10 -0
  66. package/lib/payment/invoice-prepaid/adapter.d.ts +2 -0
  67. package/lib/payment/{invoice-prepaid.js → invoice-prepaid/adapter.js} +2 -3
  68. package/lib/payment/invoice-prepaid/index.d.ts +4 -0
  69. package/lib/payment/invoice-prepaid/index.js +10 -0
  70. package/lib/payment/payrexx/adapter.d.ts +2 -0
  71. package/lib/payment/payrexx/adapter.js +161 -0
  72. package/lib/payment/payrexx/api.d.ts +2 -0
  73. package/lib/payment/payrexx/api.js +97 -0
  74. package/lib/payment/payrexx/index.d.ts +4 -1
  75. package/lib/payment/payrexx/index.js +19 -158
  76. package/lib/payment/postfinance-checkout/adapter.d.ts +2 -0
  77. package/lib/payment/postfinance-checkout/adapter.js +189 -0
  78. package/lib/payment/postfinance-checkout/index.d.ts +5 -0
  79. package/lib/payment/postfinance-checkout/index.js +25 -186
  80. package/lib/payment/postfinance-checkout/webhook.d.ts +2 -0
  81. package/lib/payment/postfinance-checkout/webhook.js +48 -0
  82. package/lib/payment/saferpay/adapter.js +1 -2
  83. package/lib/payment/saferpay/index.d.ts +5 -4
  84. package/lib/payment/saferpay/index.js +29 -3
  85. package/lib/payment/saferpay/webhook.d.ts +2 -0
  86. package/lib/payment/saferpay/webhook.js +64 -0
  87. package/lib/payment/stripe/adapter.d.ts +2 -0
  88. package/lib/payment/stripe/adapter.js +121 -0
  89. package/lib/payment/stripe/api.d.ts +6 -0
  90. package/lib/payment/stripe/api.js +165 -0
  91. package/lib/payment/stripe/index.d.ts +4 -1
  92. package/lib/payment/stripe/index.js +22 -116
  93. package/lib/payment/stripe/stripe.js +2 -5
  94. package/lib/presets/all.d.ts +1 -70
  95. package/lib/presets/all.js +41 -27
  96. package/lib/presets/base.d.ts +1 -25
  97. package/lib/presets/base.js +56 -25
  98. package/lib/presets/countries/ch.d.ts +1 -2
  99. package/lib/presets/countries/ch.js +7 -2
  100. package/lib/presets/crypto.d.ts +3 -7
  101. package/lib/presets/crypto.js +18 -7
  102. package/lib/pricing/{delivery-swiss-tax.d.ts → delivery-swiss-tax/adapter.d.ts} +1 -0
  103. package/lib/pricing/{delivery-swiss-tax.js → delivery-swiss-tax/adapter.js} +4 -4
  104. package/lib/pricing/delivery-swiss-tax/index.d.ts +4 -0
  105. package/lib/pricing/delivery-swiss-tax/index.js +10 -0
  106. package/lib/pricing/{discount-100-off.d.ts → discount-100-off/adapter.d.ts} +1 -0
  107. package/lib/pricing/{discount-100-off.js → discount-100-off/adapter.js} +2 -2
  108. package/lib/pricing/discount-100-off/index.d.ts +4 -0
  109. package/lib/pricing/discount-100-off/index.js +10 -0
  110. package/lib/pricing/{discount-half-price-manual.d.ts → discount-half-price-manual/adapter.d.ts} +1 -0
  111. package/lib/pricing/{discount-half-price-manual.js → discount-half-price-manual/adapter.js} +2 -2
  112. package/lib/pricing/discount-half-price-manual/index.d.ts +4 -0
  113. package/lib/pricing/discount-half-price-manual/index.js +10 -0
  114. package/lib/pricing/{free-delivery.d.ts → free-delivery/adapter.d.ts} +1 -0
  115. package/lib/pricing/{free-delivery.js → free-delivery/adapter.js} +2 -2
  116. package/lib/pricing/free-delivery/index.d.ts +4 -0
  117. package/lib/pricing/free-delivery/index.js +10 -0
  118. package/lib/pricing/{free-payment.d.ts → free-payment/adapter.d.ts} +1 -0
  119. package/lib/pricing/{free-payment.js → free-payment/adapter.js} +2 -2
  120. package/lib/pricing/free-payment/index.d.ts +4 -0
  121. package/lib/pricing/free-payment/index.js +10 -0
  122. package/lib/pricing/{order-delivery.d.ts → order-delivery/adapter.d.ts} +1 -0
  123. package/lib/pricing/{order-delivery.js → order-delivery/adapter.js} +2 -2
  124. package/lib/pricing/order-delivery/index.d.ts +4 -0
  125. package/lib/pricing/order-delivery/index.js +10 -0
  126. package/lib/pricing/{order-discount.d.ts → order-discount/adapter.d.ts} +1 -0
  127. package/lib/pricing/{order-discount.js → order-discount/adapter.js} +2 -2
  128. package/lib/pricing/order-discount/index.d.ts +4 -0
  129. package/lib/pricing/order-discount/index.js +10 -0
  130. package/lib/pricing/{order-items.d.ts → order-items/adapter.d.ts} +1 -0
  131. package/lib/pricing/{order-items.js → order-items/adapter.js} +2 -2
  132. package/lib/pricing/order-items/index.d.ts +4 -0
  133. package/lib/pricing/order-items/index.js +10 -0
  134. package/lib/pricing/{order-payment.d.ts → order-payment/adapter.d.ts} +1 -0
  135. package/lib/pricing/{order-payment.js → order-payment/adapter.js} +2 -2
  136. package/lib/pricing/order-payment/index.d.ts +4 -0
  137. package/lib/pricing/order-payment/index.js +10 -0
  138. package/lib/pricing/{product-catalog-price.d.ts → product-catalog-price/adapter.d.ts} +1 -0
  139. package/lib/pricing/{product-catalog-price.js → product-catalog-price/adapter.js} +2 -2
  140. package/lib/pricing/product-catalog-price/index.d.ts +4 -0
  141. package/lib/pricing/product-catalog-price/index.js +10 -0
  142. package/lib/pricing/{product-discount.d.ts → product-discount/adapter.d.ts} +1 -0
  143. package/lib/pricing/{product-discount.js → product-discount/adapter.js} +2 -2
  144. package/lib/pricing/product-discount/index.d.ts +4 -0
  145. package/lib/pricing/product-discount/index.js +10 -0
  146. package/lib/pricing/{product-price-rateconversion.d.ts → product-price-rateconversion/adapter.d.ts} +1 -0
  147. package/lib/pricing/{product-price-rateconversion.js → product-price-rateconversion/adapter.js} +2 -2
  148. package/lib/pricing/product-price-rateconversion/index.d.ts +4 -0
  149. package/lib/pricing/product-price-rateconversion/index.js +10 -0
  150. package/lib/pricing/{product-swiss-tax.d.ts → product-swiss-tax/adapter.d.ts} +1 -0
  151. package/lib/pricing/{product-swiss-tax.js → product-swiss-tax/adapter.js} +4 -4
  152. package/lib/pricing/product-swiss-tax/index.d.ts +4 -0
  153. package/lib/pricing/product-swiss-tax/index.js +10 -0
  154. package/lib/quotations/manual/adapter.d.ts +2 -0
  155. package/lib/quotations/{manual.js → manual/adapter.js} +2 -3
  156. package/lib/quotations/manual/index.d.ts +4 -0
  157. package/lib/quotations/manual/index.js +10 -0
  158. package/lib/warehousing/erc-metadata/api.d.ts +12 -0
  159. package/lib/warehousing/erc-metadata/api.js +43 -0
  160. package/lib/warehousing/erc-metadata/index.d.ts +3 -0
  161. package/lib/warehousing/erc-metadata/index.js +15 -0
  162. package/lib/warehousing/eth-minter/adapter.d.ts +2 -0
  163. package/lib/warehousing/{eth-minter.js → eth-minter/adapter.js} +3 -4
  164. package/lib/warehousing/eth-minter/index.d.ts +4 -0
  165. package/lib/warehousing/eth-minter/index.js +10 -0
  166. package/lib/warehousing/store/adapter.d.ts +2 -0
  167. package/lib/warehousing/{store.js → store/adapter.js} +2 -3
  168. package/lib/warehousing/store/index.d.ts +4 -0
  169. package/lib/warehousing/store/index.js +10 -0
  170. package/lib/worker/budgetsms/adapter.d.ts +22 -0
  171. package/lib/worker/{budgetsms.js → budgetsms/adapter.js} +3 -3
  172. package/lib/worker/budgetsms/index.d.ts +4 -0
  173. package/lib/worker/budgetsms/index.js +10 -0
  174. package/lib/worker/bulk-export/adapter.d.ts +3 -0
  175. package/lib/worker/{bulk-export.js → bulk-export/adapter.js} +3 -3
  176. package/lib/worker/bulk-export/index.d.ts +4 -0
  177. package/lib/worker/bulk-export/index.js +10 -0
  178. package/lib/worker/{bulk-import.d.ts → bulk-import/adapter.d.ts} +1 -0
  179. package/lib/worker/{bulk-import.js → bulk-import/adapter.js} +2 -2
  180. package/lib/worker/bulk-import/api.d.ts +7 -0
  181. package/lib/worker/bulk-import/api.js +53 -0
  182. package/lib/worker/bulk-import/index.d.ts +4 -0
  183. package/lib/worker/bulk-import/index.js +18 -0
  184. package/lib/worker/bulkgate/adapter.d.ts +12 -0
  185. package/lib/worker/{bulkgate.js → bulkgate/adapter.js} +3 -3
  186. package/lib/worker/bulkgate/index.d.ts +4 -0
  187. package/lib/worker/bulkgate/index.js +10 -0
  188. package/lib/worker/email/adapter.d.ts +9 -0
  189. package/lib/worker/{email.js → email/adapter.js} +27 -13
  190. package/lib/worker/email/index.d.ts +4 -0
  191. package/lib/worker/email/index.js +10 -0
  192. package/lib/worker/enrollment-order-generator/adapter.d.ts +4 -0
  193. package/lib/worker/{enrollment-order-generator.js → enrollment-order-generator/adapter.js} +2 -2
  194. package/lib/worker/enrollment-order-generator/index.d.ts +4 -0
  195. package/lib/worker/enrollment-order-generator/index.js +13 -0
  196. package/lib/worker/{error-notifications.d.ts → error-notifications/adapter.d.ts} +1 -0
  197. package/lib/worker/{error-notifications.js → error-notifications/adapter.js} +9 -8
  198. package/lib/worker/error-notifications/index.d.ts +4 -0
  199. package/lib/worker/error-notifications/index.js +13 -0
  200. package/lib/worker/{export-token.d.ts → export-token/adapter.d.ts} +1 -1
  201. package/lib/worker/{export-token.js → export-token/adapter.js} +2 -3
  202. package/lib/worker/export-token/index.d.ts +4 -0
  203. package/lib/worker/export-token/index.js +13 -0
  204. package/lib/worker/{external.d.ts → external/adapter.d.ts} +1 -0
  205. package/lib/worker/{external.js → external/adapter.js} +2 -2
  206. package/lib/worker/external/index.d.ts +4 -0
  207. package/lib/worker/external/index.js +10 -0
  208. package/lib/worker/heartbeat/adapter.d.ts +8 -0
  209. package/lib/worker/{heartbeat.js → heartbeat/adapter.js} +3 -3
  210. package/lib/worker/heartbeat/index.d.ts +4 -0
  211. package/lib/worker/heartbeat/index.js +10 -0
  212. package/lib/worker/{http-request.d.ts → http-request/adapter.d.ts} +1 -1
  213. package/lib/worker/{http-request.js → http-request/adapter.js} +2 -3
  214. package/lib/worker/http-request/index.d.ts +4 -0
  215. package/lib/worker/http-request/index.js +10 -0
  216. package/lib/worker/{message.d.ts → message/adapter.d.ts} +1 -0
  217. package/lib/worker/{message.js → message/adapter.js} +2 -2
  218. package/lib/worker/message/index.d.ts +4 -0
  219. package/lib/worker/message/index.js +10 -0
  220. package/lib/worker/push-notification/adapter.d.ts +9 -0
  221. package/lib/worker/{push-notification.js → push-notification/adapter.js} +3 -3
  222. package/lib/worker/push-notification/index.d.ts +4 -0
  223. package/lib/worker/push-notification/index.js +10 -0
  224. package/lib/worker/twilio/adapter.d.ts +8 -0
  225. package/lib/worker/{twilio.js → twilio/adapter.js} +3 -3
  226. package/lib/worker/twilio/index.d.ts +4 -0
  227. package/lib/worker/twilio/index.js +10 -0
  228. package/lib/worker/update-coinbase-rates/adapter.d.ts +4 -0
  229. package/lib/worker/{update-coinbase-rates.js → update-coinbase-rates/adapter.js} +8 -6
  230. package/lib/worker/update-coinbase-rates/index.d.ts +4 -0
  231. package/lib/worker/update-coinbase-rates/index.js +13 -0
  232. package/lib/worker/update-ecb-rates/adapter.d.ts +4 -0
  233. package/lib/worker/{update-ecb-rates.js → update-ecb-rates/adapter.js} +11 -9
  234. package/lib/worker/update-ecb-rates/index.d.ts +4 -0
  235. package/lib/worker/update-ecb-rates/index.js +13 -0
  236. package/lib/worker/{update-token-ownership.d.ts → update-token-ownership/adapter.d.ts} +2 -0
  237. package/lib/worker/{update-token-ownership.js → update-token-ownership/adapter.js} +8 -7
  238. package/lib/worker/update-token-ownership/index.d.ts +4 -0
  239. package/lib/worker/update-token-ownership/index.js +13 -0
  240. package/lib/worker/{zombie-killer.js → zombie-killer/adapter.js} +1 -2
  241. package/lib/worker/zombie-killer/index.d.ts +4 -0
  242. package/lib/worker/zombie-killer/index.js +10 -0
  243. package/package.json +15 -10
  244. package/lib/delivery/post.d.ts +0 -1
  245. package/lib/delivery/send-message.d.ts +0 -1
  246. package/lib/delivery/stores.d.ts +0 -1
  247. package/lib/enrollments/licensed.d.ts +0 -4
  248. package/lib/files/gridfs/handler-express.d.ts +0 -9
  249. package/lib/files/gridfs/handler-express.js +0 -110
  250. package/lib/files/gridfs/handler-fastify.d.ts +0 -3
  251. package/lib/files/gridfs/handler-fastify.js +0 -138
  252. package/lib/files/minio/handler-express.d.ts +0 -2
  253. package/lib/files/minio/handler-express.js +0 -36
  254. package/lib/files/minio/handler-fastify.d.ts +0 -3
  255. package/lib/files/minio/handler-fastify.js +0 -40
  256. package/lib/filters/local-search.d.ts +0 -3
  257. package/lib/filters/strict-equal.d.ts +0 -1
  258. package/lib/payment/apple-iap/handler-express.d.ts +0 -2
  259. package/lib/payment/apple-iap/handler-express.js +0 -103
  260. package/lib/payment/apple-iap/handler-fastify.d.ts +0 -3
  261. package/lib/payment/braintree.d.ts +0 -1
  262. package/lib/payment/braintree.js +0 -138
  263. package/lib/payment/cryptopay/handler-express.d.ts +0 -2
  264. package/lib/payment/cryptopay/handler-express.js +0 -19
  265. package/lib/payment/cryptopay/handler-fastify.d.ts +0 -3
  266. package/lib/payment/cryptopay/handler-fastify.js +0 -17
  267. package/lib/payment/cryptopay/plugin.d.ts +0 -3
  268. package/lib/payment/datatrans-v2/handler-express.d.ts +0 -1
  269. package/lib/payment/datatrans-v2/handler-express.js +0 -71
  270. package/lib/payment/datatrans-v2/handler-fastify.d.ts +0 -2
  271. package/lib/payment/datatrans-v2/handler-fastify.js +0 -71
  272. package/lib/payment/invoice-prepaid.d.ts +0 -1
  273. package/lib/payment/invoice.d.ts +0 -1
  274. package/lib/payment/paypal-checkout.d.ts +0 -1
  275. package/lib/payment/paypal-checkout.js +0 -87
  276. package/lib/payment/payrexx/handler-express.d.ts +0 -1
  277. package/lib/payment/payrexx/handler-express.js +0 -85
  278. package/lib/payment/payrexx/handler-fastify.d.ts +0 -2
  279. package/lib/payment/payrexx/handler-fastify.js +0 -91
  280. package/lib/payment/postfinance-checkout/handler-express.d.ts +0 -1
  281. package/lib/payment/postfinance-checkout/handler-express.js +0 -37
  282. package/lib/payment/postfinance-checkout/handler-fastify.d.ts +0 -2
  283. package/lib/payment/postfinance-checkout/handler-fastify.js +0 -40
  284. package/lib/payment/saferpay/handler-express.d.ts +0 -1
  285. package/lib/payment/saferpay/handler-express.js +0 -59
  286. package/lib/payment/saferpay/handler-fastify.d.ts +0 -2
  287. package/lib/payment/saferpay/handler-fastify.js +0 -62
  288. package/lib/payment/stripe/handler-express.d.ts +0 -5
  289. package/lib/payment/stripe/handler-express.js +0 -121
  290. package/lib/payment/stripe/handler-fastify.d.ts +0 -6
  291. package/lib/payment/stripe/handler-fastify.js +0 -131
  292. package/lib/presets/all-express.d.ts +0 -6
  293. package/lib/presets/all-express.js +0 -26
  294. package/lib/presets/all-fastify.d.ts +0 -6
  295. package/lib/presets/all-fastify.js +0 -49
  296. package/lib/presets/base-express.d.ts +0 -2
  297. package/lib/presets/base-express.js +0 -5
  298. package/lib/presets/base-fastify.d.ts +0 -3
  299. package/lib/presets/base-fastify.js +0 -16
  300. package/lib/presets/crypto-express.d.ts +0 -3
  301. package/lib/presets/crypto-express.js +0 -8
  302. package/lib/presets/crypto-fastify.d.ts +0 -3
  303. package/lib/presets/crypto-fastify.js +0 -11
  304. package/lib/pricing/discount-half-price.d.ts +0 -2
  305. package/lib/pricing/discount-half-price.js +0 -33
  306. package/lib/pricing/order-items-discount.d.ts +0 -2
  307. package/lib/pricing/order-items-discount.js +0 -50
  308. package/lib/pricing/order-round.d.ts +0 -10
  309. package/lib/pricing/order-round.js +0 -135
  310. package/lib/pricing/product-catalog-price-options.d.ts +0 -2
  311. package/lib/pricing/product-catalog-price-options.js +0 -51
  312. package/lib/pricing/product-round.d.ts +0 -10
  313. package/lib/pricing/product-round.js +0 -44
  314. package/lib/quotations/manual.d.ts +0 -1
  315. package/lib/warehousing/eth-minter.d.ts +0 -1
  316. package/lib/warehousing/store.d.ts +0 -1
  317. package/lib/worker/budgetsms.d.ts +0 -9
  318. package/lib/worker/bulk-export.d.ts +0 -2
  319. package/lib/worker/bulkgate.d.ts +0 -1
  320. package/lib/worker/email.d.ts +0 -1
  321. package/lib/worker/enrollment-order-generator.d.ts +0 -1
  322. package/lib/worker/heartbeat.d.ts +0 -1
  323. package/lib/worker/push-notification.d.ts +0 -1
  324. package/lib/worker/twilio.d.ts +0 -1
  325. package/lib/worker/update-coinbase-rates.d.ts +0 -1
  326. package/lib/worker/update-ecb-rates.d.ts +0 -1
  327. /package/lib/worker/{zombie-killer.d.ts → zombie-killer/adapter.d.ts} +0 -0
@@ -1,6 +1,6 @@
1
- import { DeliveryPricingRowCategory, DeliveryPricingAdapter, DeliveryPricingDirector, } from '@unchainedshop/core';
2
- import { resolveTaxCategoryFromDeliveryProvider, SwissTaxCategories } from "./tax/ch.js";
3
- import isDeliveryAddressInCountry from "./utils/isDeliveryAddressInCountry.js";
1
+ import { DeliveryPricingRowCategory, DeliveryPricingAdapter, } from '@unchainedshop/core';
2
+ import { resolveTaxCategoryFromDeliveryProvider, SwissTaxCategories } from "../tax/ch.js";
3
+ import isDeliveryAddressInCountry from "../utils/isDeliveryAddressInCountry.js";
4
4
  export const DeliverySwissTax = {
5
5
  ...DeliveryPricingAdapter,
6
6
  key: 'shop.unchained.pricing.delivery-swiss-tax',
@@ -59,4 +59,4 @@ export const DeliverySwissTax = {
59
59
  };
60
60
  },
61
61
  };
62
- DeliveryPricingDirector.registerAdapter(DeliverySwissTax);
62
+ export default DeliverySwissTax;
@@ -0,0 +1,4 @@
1
+ import { type IPlugin } from '@unchainedshop/core';
2
+ export declare const DeliverySwissTaxPlugin: IPlugin;
3
+ export default DeliverySwissTaxPlugin;
4
+ export { DeliverySwissTax } from './adapter.ts';
@@ -0,0 +1,10 @@
1
+ import {} from '@unchainedshop/core';
2
+ import { DeliverySwissTax } from "./adapter.js";
3
+ export const DeliverySwissTaxPlugin = {
4
+ key: 'shop.unchained.pricing.delivery-swiss-tax',
5
+ label: 'Delivery Swiss Tax Plugin',
6
+ version: '1.0.0',
7
+ adapters: [DeliverySwissTax],
8
+ };
9
+ export default DeliverySwissTaxPlugin;
10
+ export { DeliverySwissTax } from "./adapter.js";
@@ -1,2 +1,3 @@
1
1
  import { type OrderDiscountConfiguration, type IDiscountAdapter } from '@unchainedshop/core';
2
2
  export declare const HundredOff: IDiscountAdapter<OrderDiscountConfiguration>;
3
+ export default HundredOff;
@@ -1,4 +1,4 @@
1
- import { OrderDiscountDirector, OrderDiscountAdapter, } from '@unchainedshop/core';
1
+ import { OrderDiscountAdapter, } from '@unchainedshop/core';
2
2
  export const HundredOff = {
3
3
  ...OrderDiscountAdapter,
4
4
  key: 'shop.unchained.discount.100-off',
@@ -27,4 +27,4 @@ export const HundredOff = {
27
27
  },
28
28
  }),
29
29
  };
30
- OrderDiscountDirector.registerAdapter(HundredOff);
30
+ export default HundredOff;
@@ -0,0 +1,4 @@
1
+ import { type IPlugin } from '@unchainedshop/core';
2
+ export declare const HundredOffPlugin: IPlugin;
3
+ export default HundredOffPlugin;
4
+ export { HundredOff } from './adapter.ts';
@@ -0,0 +1,10 @@
1
+ import {} from '@unchainedshop/core';
2
+ import { HundredOff } from "./adapter.js";
3
+ export const HundredOffPlugin = {
4
+ key: 'shop.unchained.discount.100-off',
5
+ label: '100 Off Discount Plugin',
6
+ version: '1.0.0',
7
+ adapters: [HundredOff],
8
+ };
9
+ export default HundredOffPlugin;
10
+ export { HundredOff } from "./adapter.js";
@@ -1,2 +1,3 @@
1
1
  import { type ProductDiscountConfiguration, type IDiscountAdapter } from '@unchainedshop/core';
2
2
  export declare const HalfPriceManual: IDiscountAdapter<ProductDiscountConfiguration>;
3
+ export default HalfPriceManual;
@@ -1,4 +1,4 @@
1
- import { OrderDiscountDirector, OrderDiscountAdapter, } from '@unchainedshop/core';
1
+ import { OrderDiscountAdapter, } from '@unchainedshop/core';
2
2
  export const HalfPriceManual = {
3
3
  ...OrderDiscountAdapter,
4
4
  key: 'shop.unchained.discount.half-price-manual',
@@ -27,4 +27,4 @@ export const HalfPriceManual = {
27
27
  },
28
28
  }),
29
29
  };
30
- OrderDiscountDirector.registerAdapter(HalfPriceManual);
30
+ export default HalfPriceManual;
@@ -0,0 +1,4 @@
1
+ import { type IPlugin } from '@unchainedshop/core';
2
+ export declare const HalfPriceManualPlugin: IPlugin;
3
+ export default HalfPriceManualPlugin;
4
+ export { HalfPriceManual } from './adapter.ts';
@@ -0,0 +1,10 @@
1
+ import {} from '@unchainedshop/core';
2
+ import { HalfPriceManual } from "./adapter.js";
3
+ export const HalfPriceManualPlugin = {
4
+ key: 'shop.unchained.discount.half-price-manual',
5
+ label: 'Half Price Manual Discount Plugin',
6
+ version: '1.0.0',
7
+ adapters: [HalfPriceManual],
8
+ };
9
+ export default HalfPriceManualPlugin;
10
+ export { HalfPriceManual } from "./adapter.js";
@@ -1,2 +1,3 @@
1
1
  import { type IDeliveryPricingAdapter } from '@unchainedshop/core';
2
2
  export declare const DeliveryFreePrice: IDeliveryPricingAdapter;
3
+ export default DeliveryFreePrice;
@@ -1,4 +1,4 @@
1
- import { DeliveryPricingAdapter, DeliveryPricingDirector, } from '@unchainedshop/core';
1
+ import { DeliveryPricingAdapter } from '@unchainedshop/core';
2
2
  export const DeliveryFreePrice = {
3
3
  ...DeliveryPricingAdapter,
4
4
  key: 'shop.unchained.pricing.delivery-free',
@@ -24,4 +24,4 @@ export const DeliveryFreePrice = {
24
24
  };
25
25
  },
26
26
  };
27
- DeliveryPricingDirector.registerAdapter(DeliveryFreePrice);
27
+ export default DeliveryFreePrice;
@@ -0,0 +1,4 @@
1
+ import { type IPlugin } from '@unchainedshop/core';
2
+ export declare const DeliveryFreePricePlugin: IPlugin;
3
+ export default DeliveryFreePricePlugin;
4
+ export { DeliveryFreePrice } from './adapter.ts';
@@ -0,0 +1,10 @@
1
+ import {} from '@unchainedshop/core';
2
+ import { DeliveryFreePrice } from "./adapter.js";
3
+ export const DeliveryFreePricePlugin = {
4
+ key: 'shop.unchained.pricing.delivery-free',
5
+ label: 'Free Delivery Pricing Plugin',
6
+ version: '1.0.0',
7
+ adapters: [DeliveryFreePrice],
8
+ };
9
+ export default DeliveryFreePricePlugin;
10
+ export { DeliveryFreePrice } from "./adapter.js";
@@ -1,2 +1,3 @@
1
1
  import { type IPaymentPricingAdapter } from '@unchainedshop/core';
2
2
  export declare const PaymentFreePrice: IPaymentPricingAdapter;
3
+ export default PaymentFreePrice;
@@ -1,4 +1,4 @@
1
- import { PaymentPricingAdapter, PaymentPricingDirector, } from '@unchainedshop/core';
1
+ import { PaymentPricingAdapter } from '@unchainedshop/core';
2
2
  export const PaymentFreePrice = {
3
3
  ...PaymentPricingAdapter,
4
4
  key: 'shop.unchained.pricing.payment-free',
@@ -24,4 +24,4 @@ export const PaymentFreePrice = {
24
24
  };
25
25
  },
26
26
  };
27
- PaymentPricingDirector.registerAdapter(PaymentFreePrice);
27
+ export default PaymentFreePrice;
@@ -0,0 +1,4 @@
1
+ import { type IPlugin } from '@unchainedshop/core';
2
+ export declare const PaymentFreePricePlugin: IPlugin;
3
+ export default PaymentFreePricePlugin;
4
+ export { PaymentFreePrice } from './adapter.ts';
@@ -0,0 +1,10 @@
1
+ import {} from '@unchainedshop/core';
2
+ import { PaymentFreePrice } from "./adapter.js";
3
+ export const PaymentFreePricePlugin = {
4
+ key: 'shop.unchained.pricing.payment-free',
5
+ label: 'Free Payment Pricing Plugin',
6
+ version: '1.0.0',
7
+ adapters: [PaymentFreePrice],
8
+ };
9
+ export default PaymentFreePricePlugin;
10
+ export { PaymentFreePrice } from "./adapter.js";
@@ -1,2 +1,3 @@
1
1
  import { type IOrderPricingAdapter } from '@unchainedshop/core';
2
2
  export declare const OrderDelivery: IOrderPricingAdapter;
3
+ export default OrderDelivery;
@@ -1,4 +1,4 @@
1
- import { OrderPricingDirector, OrderPricingAdapter, DeliveryPricingSheet, } from '@unchainedshop/core';
1
+ import { OrderPricingAdapter, DeliveryPricingSheet, } from '@unchainedshop/core';
2
2
  export const OrderDelivery = {
3
3
  ...OrderPricingAdapter,
4
4
  key: 'shop.unchained.pricing.order-delivery',
@@ -30,4 +30,4 @@ export const OrderDelivery = {
30
30
  };
31
31
  },
32
32
  };
33
- OrderPricingDirector.registerAdapter(OrderDelivery);
33
+ export default OrderDelivery;
@@ -0,0 +1,4 @@
1
+ import { type IPlugin } from '@unchainedshop/core';
2
+ export declare const OrderDeliveryPlugin: IPlugin;
3
+ export default OrderDeliveryPlugin;
4
+ export { OrderDelivery } from './adapter.ts';
@@ -0,0 +1,10 @@
1
+ import {} from '@unchainedshop/core';
2
+ import { OrderDelivery } from "./adapter.js";
3
+ export const OrderDeliveryPlugin = {
4
+ key: 'shop.unchained.pricing.order-delivery',
5
+ label: 'Order Delivery Pricing Plugin',
6
+ version: '1.0.0',
7
+ adapters: [OrderDelivery],
8
+ };
9
+ export default OrderDeliveryPlugin;
10
+ export { OrderDelivery } from "./adapter.js";
@@ -1,2 +1,3 @@
1
1
  import { type IOrderPricingAdapter, type OrderDiscountConfiguration } from '@unchainedshop/core';
2
2
  export declare const OrderDiscount: IOrderPricingAdapter<OrderDiscountConfiguration>;
3
+ export default OrderDiscount;
@@ -1,4 +1,4 @@
1
- import { OrderPricingRowCategory, OrderPricingDirector, OrderPricingAdapter, DeliveryPricingSheet, PaymentPricingSheet, ProductPricingSheet, resolveRatioAndTaxDivisorForPricingSheet, } from '@unchainedshop/core';
1
+ import { OrderPricingRowCategory, OrderPricingAdapter, DeliveryPricingSheet, PaymentPricingSheet, ProductPricingSheet, resolveRatioAndTaxDivisorForPricingSheet, } from '@unchainedshop/core';
2
2
  import { calculation as calcUtils } from '@unchainedshop/utils';
3
3
  export const OrderDiscount = {
4
4
  ...OrderPricingAdapter,
@@ -71,4 +71,4 @@ export const OrderDiscount = {
71
71
  };
72
72
  },
73
73
  };
74
- OrderPricingDirector.registerAdapter(OrderDiscount);
74
+ export default OrderDiscount;
@@ -0,0 +1,4 @@
1
+ import { type IPlugin } from '@unchainedshop/core';
2
+ export declare const OrderDiscountPlugin: IPlugin;
3
+ export default OrderDiscountPlugin;
4
+ export { OrderDiscount } from './adapter.ts';
@@ -0,0 +1,10 @@
1
+ import {} from '@unchainedshop/core';
2
+ import { OrderDiscount } from "./adapter.js";
3
+ export const OrderDiscountPlugin = {
4
+ key: 'shop.unchained.pricing.order-discount',
5
+ label: 'Order Discount Pricing Plugin',
6
+ version: '1.0.0',
7
+ adapters: [OrderDiscount],
8
+ };
9
+ export default OrderDiscountPlugin;
10
+ export { OrderDiscount } from "./adapter.js";
@@ -1,2 +1,3 @@
1
1
  import { type IOrderPricingAdapter } from '@unchainedshop/core';
2
2
  export declare const OrderItems: IOrderPricingAdapter;
3
+ export default OrderItems;
@@ -1,4 +1,4 @@
1
- import { OrderPricingDirector, OrderPricingAdapter, ProductPricingSheet, } from '@unchainedshop/core';
1
+ import { OrderPricingAdapter, ProductPricingSheet, } from '@unchainedshop/core';
2
2
  export const OrderItems = {
3
3
  ...OrderPricingAdapter,
4
4
  key: 'shop.unchained.pricing.order-items',
@@ -40,4 +40,4 @@ export const OrderItems = {
40
40
  };
41
41
  },
42
42
  };
43
- OrderPricingDirector.registerAdapter(OrderItems);
43
+ export default OrderItems;
@@ -0,0 +1,4 @@
1
+ import { type IPlugin } from '@unchainedshop/core';
2
+ export declare const OrderItemsPlugin: IPlugin;
3
+ export default OrderItemsPlugin;
4
+ export { OrderItems } from './adapter.ts';
@@ -0,0 +1,10 @@
1
+ import {} from '@unchainedshop/core';
2
+ import { OrderItems } from "./adapter.js";
3
+ export const OrderItemsPlugin = {
4
+ key: 'shop.unchained.pricing.order-items',
5
+ label: 'Order Items Pricing Plugin',
6
+ version: '1.0.0',
7
+ adapters: [OrderItems],
8
+ };
9
+ export default OrderItemsPlugin;
10
+ export { OrderItems } from "./adapter.js";
@@ -1,2 +1,3 @@
1
1
  import { type IOrderPricingAdapter } from '@unchainedshop/core';
2
2
  export declare const OrderPayment: IOrderPricingAdapter;
3
+ export default OrderPayment;
@@ -1,4 +1,4 @@
1
- import { OrderPricingDirector, OrderPricingAdapter, PaymentPricingSheet, } from '@unchainedshop/core';
1
+ import { OrderPricingAdapter, PaymentPricingSheet, } from '@unchainedshop/core';
2
2
  export const OrderPayment = {
3
3
  ...OrderPricingAdapter,
4
4
  key: 'shop.unchained.pricing.order-payment',
@@ -30,4 +30,4 @@ export const OrderPayment = {
30
30
  };
31
31
  },
32
32
  };
33
- OrderPricingDirector.registerAdapter(OrderPayment);
33
+ export default OrderPayment;
@@ -0,0 +1,4 @@
1
+ import { type IPlugin } from '@unchainedshop/core';
2
+ export declare const OrderPaymentPlugin: IPlugin;
3
+ export default OrderPaymentPlugin;
4
+ export { OrderPayment } from './adapter.ts';
@@ -0,0 +1,10 @@
1
+ import {} from '@unchainedshop/core';
2
+ import { OrderPayment } from "./adapter.js";
3
+ export const OrderPaymentPlugin = {
4
+ key: 'shop.unchained.pricing.order-payment',
5
+ label: 'Order Payment Pricing Plugin',
6
+ version: '1.0.0',
7
+ adapters: [OrderPayment],
8
+ };
9
+ export default OrderPaymentPlugin;
10
+ export { OrderPayment } from "./adapter.js";
@@ -1,2 +1,3 @@
1
1
  import { type IProductPricingAdapter } from '@unchainedshop/core';
2
2
  export declare const ProductPrice: IProductPricingAdapter;
3
+ export default ProductPrice;
@@ -1,4 +1,4 @@
1
- import { ProductPricingDirector, ProductPricingAdapter, } from '@unchainedshop/core';
1
+ import { ProductPricingAdapter } from '@unchainedshop/core';
2
2
  import { ProductType } from '@unchainedshop/core-products';
3
3
  export const ProductPrice = {
4
4
  ...ProductPricingAdapter,
@@ -57,4 +57,4 @@ export const ProductPrice = {
57
57
  };
58
58
  },
59
59
  };
60
- ProductPricingDirector.registerAdapter(ProductPrice);
60
+ export default ProductPrice;
@@ -0,0 +1,4 @@
1
+ import { type IPlugin } from '@unchainedshop/core';
2
+ export declare const ProductPricePlugin: IPlugin;
3
+ export default ProductPricePlugin;
4
+ export { ProductPrice } from './adapter.ts';
@@ -0,0 +1,10 @@
1
+ import {} from '@unchainedshop/core';
2
+ import { ProductPrice } from "./adapter.js";
3
+ export const ProductPricePlugin = {
4
+ key: 'shop.unchained.pricing.product-catalog',
5
+ label: 'Product Catalog Price Plugin',
6
+ version: '1.0.0',
7
+ adapters: [ProductPrice],
8
+ };
9
+ export default ProductPricePlugin;
10
+ export { ProductPrice } from "./adapter.js";
@@ -1,2 +1,3 @@
1
1
  import { type ProductDiscountConfiguration, type IProductPricingAdapter } from '@unchainedshop/core';
2
2
  export declare const ProductDiscount: IProductPricingAdapter<ProductDiscountConfiguration>;
3
+ export default ProductDiscount;
@@ -1,5 +1,5 @@
1
1
  import { calculation as calcUtils } from '@unchainedshop/utils';
2
- import { ProductPricingDirector, ProductPricingAdapter, ProductPricingRowCategory, } from '@unchainedshop/core';
2
+ import { ProductPricingAdapter, ProductPricingRowCategory, } from '@unchainedshop/core';
3
3
  export const ProductDiscount = {
4
4
  ...ProductPricingAdapter,
5
5
  key: 'shop.unchained.pricing.product-discount',
@@ -66,4 +66,4 @@ export const ProductDiscount = {
66
66
  };
67
67
  },
68
68
  };
69
- ProductPricingDirector.registerAdapter(ProductDiscount);
69
+ export default ProductDiscount;
@@ -0,0 +1,4 @@
1
+ import { type IPlugin } from '@unchainedshop/core';
2
+ export declare const ProductDiscountPlugin: IPlugin;
3
+ export default ProductDiscountPlugin;
4
+ export { ProductDiscount } from './adapter.ts';
@@ -0,0 +1,10 @@
1
+ import {} from '@unchainedshop/core';
2
+ import { ProductDiscount } from "./adapter.js";
3
+ export const ProductDiscountPlugin = {
4
+ key: 'shop.unchained.pricing.product-discount',
5
+ label: 'Product Discount Pricing Plugin',
6
+ version: '1.0.0',
7
+ adapters: [ProductDiscount],
8
+ };
9
+ export default ProductDiscountPlugin;
10
+ export { ProductDiscount } from "./adapter.js";
@@ -1,2 +1,3 @@
1
1
  import { type IProductPricingAdapter } from '@unchainedshop/core';
2
2
  export declare const ProductPriceRateConversion: IProductPricingAdapter;
3
+ export default ProductPriceRateConversion;
@@ -1,4 +1,4 @@
1
- import { ProductPricingDirector, ProductPricingAdapter, } from '@unchainedshop/core';
1
+ import { ProductPricingAdapter } from '@unchainedshop/core';
2
2
  export const ProductPriceRateConversion = {
3
3
  ...ProductPricingAdapter,
4
4
  key: 'shop.unchained.pricing.rate-conversion',
@@ -50,4 +50,4 @@ export const ProductPriceRateConversion = {
50
50
  };
51
51
  },
52
52
  };
53
- ProductPricingDirector.registerAdapter(ProductPriceRateConversion);
53
+ export default ProductPriceRateConversion;
@@ -0,0 +1,4 @@
1
+ import { type IPlugin } from '@unchainedshop/core';
2
+ export declare const ProductPriceRateConversionPlugin: IPlugin;
3
+ export default ProductPriceRateConversionPlugin;
4
+ export { ProductPriceRateConversion } from './adapter.ts';
@@ -0,0 +1,10 @@
1
+ import {} from '@unchainedshop/core';
2
+ import { ProductPriceRateConversion } from "./adapter.js";
3
+ export const ProductPriceRateConversionPlugin = {
4
+ key: 'shop.unchained.pricing.rate-conversion',
5
+ label: 'Product Price Rate Conversion Plugin',
6
+ version: '1.0.0',
7
+ adapters: [ProductPriceRateConversion],
8
+ };
9
+ export default ProductPriceRateConversionPlugin;
10
+ export { ProductPriceRateConversion } from "./adapter.js";
@@ -1,2 +1,3 @@
1
1
  import { type IProductPricingAdapter } from '@unchainedshop/core';
2
2
  export declare const ProductSwissTax: IProductPricingAdapter;
3
+ export default ProductSwissTax;
@@ -1,6 +1,6 @@
1
- import { ProductPricingDirector, ProductPricingAdapter, ProductPricingRowCategory, } from '@unchainedshop/core';
2
- import { resolveTaxCategoryFromDeliveryProvider, resolveTaxCategoryFromProduct, SwissTaxCategories, } from "./tax/ch.js";
3
- import isDeliveryAddressInCountry from "./utils/isDeliveryAddressInCountry.js";
1
+ import { ProductPricingAdapter, ProductPricingRowCategory, } from '@unchainedshop/core';
2
+ import { resolveTaxCategoryFromDeliveryProvider, resolveTaxCategoryFromProduct, SwissTaxCategories, } from "../tax/ch.js";
3
+ import isDeliveryAddressInCountry from "../utils/isDeliveryAddressInCountry.js";
4
4
  export const ProductSwissTax = {
5
5
  ...ProductPricingAdapter,
6
6
  key: 'shop.unchained.pricing.product-swiss-tax',
@@ -73,4 +73,4 @@ export const ProductSwissTax = {
73
73
  };
74
74
  },
75
75
  };
76
- ProductPricingDirector.registerAdapter(ProductSwissTax);
76
+ export default ProductSwissTax;
@@ -0,0 +1,4 @@
1
+ import { type IPlugin } from '@unchainedshop/core';
2
+ export declare const ProductSwissTaxPlugin: IPlugin;
3
+ export default ProductSwissTaxPlugin;
4
+ export { ProductSwissTax } from './adapter.ts';
@@ -0,0 +1,10 @@
1
+ import {} from '@unchainedshop/core';
2
+ import { ProductSwissTax } from "./adapter.js";
3
+ export const ProductSwissTaxPlugin = {
4
+ key: 'shop.unchained.pricing.product-swiss-tax',
5
+ label: 'Product Swiss Tax Plugin',
6
+ version: '1.0.0',
7
+ adapters: [ProductSwissTax],
8
+ };
9
+ export default ProductSwissTaxPlugin;
10
+ export { ProductSwissTax } from "./adapter.js";
@@ -0,0 +1,2 @@
1
+ import { type IQuotationAdapter } from '@unchainedshop/core';
2
+ export declare const ManualOffering: IQuotationAdapter;
@@ -1,5 +1,5 @@
1
- import { QuotationDirector, QuotationAdapter } from '@unchainedshop/core';
2
- const ManualOffering = {
1
+ import { QuotationAdapter } from '@unchainedshop/core';
2
+ export const ManualOffering = {
3
3
  ...QuotationAdapter,
4
4
  key: 'shop.unchained.quotations.manual',
5
5
  version: '1.0.0',
@@ -17,4 +17,3 @@ const ManualOffering = {
17
17
  };
18
18
  },
19
19
  };
20
- QuotationDirector.registerAdapter(ManualOffering);
@@ -0,0 +1,4 @@
1
+ import { type IPlugin } from '@unchainedshop/core';
2
+ export declare const ManualOfferingPlugin: IPlugin;
3
+ export default ManualOfferingPlugin;
4
+ export { ManualOffering } from './adapter.ts';
@@ -0,0 +1,10 @@
1
+ import {} from '@unchainedshop/core';
2
+ import { ManualOffering } from "./adapter.js";
3
+ export const ManualOfferingPlugin = {
4
+ key: 'shop.unchained.quotations.manual',
5
+ label: 'Manual Offering Quotation Plugin',
6
+ version: '1.0.0',
7
+ adapters: [ManualOffering],
8
+ };
9
+ export default ManualOfferingPlugin;
10
+ export { ManualOffering } from "./adapter.js";
@@ -0,0 +1,12 @@
1
+ import type { UnchainedCore } from '@unchainedshop/core';
2
+ export declare function ercMetadataHandler(request: Request, context: UnchainedCore & {
3
+ params: Record<string, string>;
4
+ locale?: Intl.Locale;
5
+ loaders?: {
6
+ productLoader: {
7
+ load: (params: {
8
+ productId: string;
9
+ }) => Promise<any>;
10
+ };
11
+ };
12
+ }): Promise<Response>;
@@ -0,0 +1,43 @@
1
+ import { createLogger } from '@unchainedshop/logger';
2
+ import { ProductContractStandard } from '@unchainedshop/core-products';
3
+ import { systemLocale } from '@unchainedshop/utils';
4
+ const logger = createLogger('unchained:erc-metadata');
5
+ export async function ercMetadataHandler(request, context) {
6
+ try {
7
+ const { ROOT_URL = 'http://localhost:4010' } = process.env;
8
+ const { services, modules, locale, loaders, params } = context;
9
+ const url = new URL(request.url, ROOT_URL);
10
+ if (!url.pathname.toLowerCase().endsWith('.json')) {
11
+ throw new Error('Invalid ERC Metadata URI');
12
+ }
13
+ const { productId, localeOrTokenFilename, tokenFileName } = params;
14
+ const product = loaders
15
+ ? await loaders.productLoader.load({ productId })
16
+ : await modules.products.findProduct({ productId });
17
+ const tokenSelector = {
18
+ contractAddress: product?.tokenization?.contractAddress,
19
+ };
20
+ if (product?.tokenization?.contractStandard !== ProductContractStandard.ERC721) {
21
+ tokenSelector.tokenSerialNumber = (tokenFileName || localeOrTokenFilename)
22
+ .toLowerCase()
23
+ .replace('.json', '');
24
+ }
25
+ const [token] = await modules.warehousing.findTokens(tokenSelector);
26
+ const resolvedLocale = tokenFileName
27
+ ? new Intl.Locale(localeOrTokenFilename)
28
+ : locale || systemLocale;
29
+ const ercMetadata = await services.warehousing.ercMetadata({
30
+ product,
31
+ token,
32
+ locale: resolvedLocale,
33
+ });
34
+ if (!ercMetadata) {
35
+ return new Response(null, { status: 404 });
36
+ }
37
+ return Response.json(ercMetadata, { status: 200 });
38
+ }
39
+ catch (e) {
40
+ logger.error(e);
41
+ return Response.json({ name: e.name, code: e.code, message: e.message }, { status: 503 });
42
+ }
43
+ }
@@ -0,0 +1,3 @@
1
+ import type { IPlugin } from '@unchainedshop/core';
2
+ export declare const ERCMetadataPlugin: IPlugin;
3
+ export default ERCMetadataPlugin;
@@ -0,0 +1,15 @@
1
+ import { ercMetadataHandler } from "./api.js";
2
+ const { ERC_METADATA_API_PATH = '/erc-metadata' } = process.env;
3
+ export const ERCMetadataPlugin = {
4
+ key: 'shop.unchained.warehousing.erc-metadata',
5
+ label: 'ERC Metadata Plugin',
6
+ version: '1.0.0',
7
+ routes: [
8
+ {
9
+ path: `${ERC_METADATA_API_PATH}/:productId/:localeOrTokenFilename{/:tokenFileName}`,
10
+ method: 'GET',
11
+ handler: ercMetadataHandler,
12
+ },
13
+ ],
14
+ };
15
+ export default ERCMetadataPlugin;
@@ -0,0 +1,2 @@
1
+ import { type IWarehousingAdapter } from '@unchainedshop/core';
2
+ export declare const ETHMinter: IWarehousingAdapter;
@@ -1,12 +1,12 @@
1
- import { WarehousingError, WarehousingDirector, WarehousingAdapter, } from '@unchainedshop/core';
1
+ import { WarehousingError, WarehousingAdapter, } from '@unchainedshop/core';
2
2
  import { WarehousingProviderType } from '@unchainedshop/core-warehousing';
3
3
  import { ProductContractStandard, ProductType } from '@unchainedshop/core-products';
4
4
  import { systemLocale } from '@unchainedshop/utils';
5
5
  import { generateDbObjectId } from '@unchainedshop/mongodb';
6
- import { getFileAdapter } from '@unchainedshop/core-files';
6
+ import { getFileAdapter } from '@unchainedshop/core';
7
7
  import { createLogger } from '@unchainedshop/logger';
8
8
  const logger = createLogger('unchained:eth-minter');
9
- const ETHMinter = {
9
+ export const ETHMinter = {
10
10
  ...WarehousingAdapter,
11
11
  key: 'shop.unchained.warehousing.infinite-minter',
12
12
  version: '1.0',
@@ -117,4 +117,3 @@ const ETHMinter = {
117
117
  };
118
118
  },
119
119
  };
120
- WarehousingDirector.registerAdapter(ETHMinter);
@@ -0,0 +1,4 @@
1
+ import { type IPlugin } from '@unchainedshop/core';
2
+ export declare const ETHMinterPlugin: IPlugin;
3
+ export default ETHMinterPlugin;
4
+ export { ETHMinter } from './adapter.ts';