@unchainedshop/plugins 4.8.25 → 4.8.26

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 (251) hide show
  1. package/lib/pricing/tax/ch-tax-rates.json +1 -1
  2. package/lib/pricing/tax/eraRates.d.ts +3 -2
  3. package/lib/pricing/tax/eraRates.js +34 -8
  4. package/lib/pricing/tax/eu-tax-rates.json +33 -1
  5. package/lib/pricing/tax/eu.js +1 -1
  6. package/lib/pricing/tax/uk-tax-rates.json +1 -1
  7. package/lib/pricing/tax/us-tax-rates.json +63 -3
  8. package/lib/pricing/tax/us.js +1 -1
  9. package/package.json +1 -1
  10. package/lib/delivery/post/adapter.d.ts +0 -2
  11. package/lib/delivery/post/adapter.js +0 -22
  12. package/lib/delivery/post/index.d.ts +0 -4
  13. package/lib/delivery/post/index.js +0 -10
  14. package/lib/delivery/send-message/adapter.d.ts +0 -2
  15. package/lib/delivery/send-message/adapter.js +0 -39
  16. package/lib/delivery/send-message/index.d.ts +0 -4
  17. package/lib/delivery/send-message/index.js +0 -10
  18. package/lib/delivery/stores/adapter.d.ts +0 -2
  19. package/lib/delivery/stores/adapter.js +0 -42
  20. package/lib/delivery/stores/index.d.ts +0 -4
  21. package/lib/delivery/stores/index.js +0 -10
  22. package/lib/enrollments/licensed/adapter.d.ts +0 -6
  23. package/lib/enrollments/licensed/adapter.js +0 -51
  24. package/lib/enrollments/licensed/index.d.ts +0 -4
  25. package/lib/enrollments/licensed/index.js +0 -10
  26. package/lib/files/gridfs/api.d.ts +0 -7
  27. package/lib/files/gridfs/api.js +0 -163
  28. package/lib/files/minio/adapter.d.ts +0 -4
  29. package/lib/files/minio/adapter.js +0 -160
  30. package/lib/files/minio/api.d.ts +0 -2
  31. package/lib/files/minio/api.js +0 -40
  32. package/lib/files/temp-upload/api.d.ts +0 -8
  33. package/lib/files/temp-upload/api.js +0 -48
  34. package/lib/files/temp-upload/index.d.ts +0 -3
  35. package/lib/files/temp-upload/index.js +0 -15
  36. package/lib/filters/local-search/adapter.d.ts +0 -2
  37. package/lib/filters/local-search/adapter.js +0 -56
  38. package/lib/filters/local-search/index.d.ts +0 -4
  39. package/lib/filters/local-search/index.js +0 -10
  40. package/lib/filters/strict-equal/adapter.d.ts +0 -2
  41. package/lib/filters/strict-equal/adapter.js +0 -23
  42. package/lib/filters/strict-equal/index.d.ts +0 -4
  43. package/lib/filters/strict-equal/index.js +0 -10
  44. package/lib/payment/apple-iap/api.d.ts +0 -2
  45. package/lib/payment/apple-iap/api.js +0 -119
  46. package/lib/payment/cryptopay/adapter.d.ts +0 -2
  47. package/lib/payment/cryptopay/adapter.js +0 -157
  48. package/lib/payment/cryptopay/api.d.ts +0 -2
  49. package/lib/payment/cryptopay/api.js +0 -23
  50. package/lib/payment/datatrans-v2/adapter.d.ts +0 -2
  51. package/lib/payment/datatrans-v2/adapter.js +0 -417
  52. package/lib/payment/datatrans-v2/api.d.ts +0 -2
  53. package/lib/payment/datatrans-v2/api.js +0 -108
  54. package/lib/payment/invoice/adapter.d.ts +0 -2
  55. package/lib/payment/invoice/adapter.js +0 -26
  56. package/lib/payment/invoice/index.d.ts +0 -4
  57. package/lib/payment/invoice/index.js +0 -10
  58. package/lib/payment/invoice-prepaid/adapter.d.ts +0 -2
  59. package/lib/payment/invoice-prepaid/adapter.js +0 -29
  60. package/lib/payment/invoice-prepaid/index.d.ts +0 -4
  61. package/lib/payment/invoice-prepaid/index.js +0 -10
  62. package/lib/payment/payrexx/adapter.d.ts +0 -2
  63. package/lib/payment/payrexx/adapter.js +0 -161
  64. package/lib/payment/payrexx/api.d.ts +0 -2
  65. package/lib/payment/payrexx/api.js +0 -97
  66. package/lib/payment/postfinance-checkout/adapter.d.ts +0 -2
  67. package/lib/payment/postfinance-checkout/adapter.js +0 -189
  68. package/lib/payment/postfinance-checkout/webhook.d.ts +0 -2
  69. package/lib/payment/postfinance-checkout/webhook.js +0 -48
  70. package/lib/payment/saferpay/webhook.d.ts +0 -2
  71. package/lib/payment/saferpay/webhook.js +0 -64
  72. package/lib/payment/stripe/adapter.d.ts +0 -2
  73. package/lib/payment/stripe/adapter.js +0 -121
  74. package/lib/payment/stripe/api.d.ts +0 -6
  75. package/lib/payment/stripe/api.js +0 -165
  76. package/lib/pricing/delivery-eu-tax/adapter.d.ts +0 -3
  77. package/lib/pricing/delivery-eu-tax/adapter.js +0 -55
  78. package/lib/pricing/delivery-eu-tax/index.d.ts +0 -4
  79. package/lib/pricing/delivery-eu-tax/index.js +0 -10
  80. package/lib/pricing/delivery-swiss-tax/adapter.d.ts +0 -3
  81. package/lib/pricing/delivery-swiss-tax/adapter.js +0 -43
  82. package/lib/pricing/delivery-swiss-tax/index.d.ts +0 -4
  83. package/lib/pricing/delivery-swiss-tax/index.js +0 -10
  84. package/lib/pricing/delivery-uk-tax/adapter.d.ts +0 -3
  85. package/lib/pricing/delivery-uk-tax/adapter.js +0 -43
  86. package/lib/pricing/delivery-uk-tax/index.d.ts +0 -4
  87. package/lib/pricing/delivery-uk-tax/index.js +0 -10
  88. package/lib/pricing/delivery-us-sales-tax/adapter.d.ts +0 -3
  89. package/lib/pricing/delivery-us-sales-tax/adapter.js +0 -58
  90. package/lib/pricing/delivery-us-sales-tax/index.d.ts +0 -4
  91. package/lib/pricing/delivery-us-sales-tax/index.js +0 -10
  92. package/lib/pricing/discount-100-off/adapter.d.ts +0 -3
  93. package/lib/pricing/discount-100-off/adapter.js +0 -30
  94. package/lib/pricing/discount-100-off/index.d.ts +0 -4
  95. package/lib/pricing/discount-100-off/index.js +0 -10
  96. package/lib/pricing/discount-half-price-manual/adapter.d.ts +0 -3
  97. package/lib/pricing/discount-half-price-manual/adapter.js +0 -30
  98. package/lib/pricing/discount-half-price-manual/index.d.ts +0 -4
  99. package/lib/pricing/discount-half-price-manual/index.js +0 -10
  100. package/lib/pricing/free-delivery/adapter.d.ts +0 -3
  101. package/lib/pricing/free-delivery/adapter.js +0 -27
  102. package/lib/pricing/free-delivery/index.d.ts +0 -4
  103. package/lib/pricing/free-delivery/index.js +0 -10
  104. package/lib/pricing/free-payment/adapter.d.ts +0 -3
  105. package/lib/pricing/free-payment/adapter.js +0 -27
  106. package/lib/pricing/free-payment/index.d.ts +0 -4
  107. package/lib/pricing/free-payment/index.js +0 -10
  108. package/lib/pricing/order-delivery/adapter.d.ts +0 -3
  109. package/lib/pricing/order-delivery/adapter.js +0 -33
  110. package/lib/pricing/order-delivery/index.d.ts +0 -4
  111. package/lib/pricing/order-delivery/index.js +0 -10
  112. package/lib/pricing/order-discount/adapter.d.ts +0 -3
  113. package/lib/pricing/order-discount/adapter.js +0 -74
  114. package/lib/pricing/order-discount/index.d.ts +0 -4
  115. package/lib/pricing/order-discount/index.js +0 -10
  116. package/lib/pricing/order-items/adapter.d.ts +0 -3
  117. package/lib/pricing/order-items/adapter.js +0 -43
  118. package/lib/pricing/order-items/index.d.ts +0 -4
  119. package/lib/pricing/order-items/index.js +0 -10
  120. package/lib/pricing/order-payment/adapter.d.ts +0 -3
  121. package/lib/pricing/order-payment/adapter.js +0 -33
  122. package/lib/pricing/order-payment/index.d.ts +0 -4
  123. package/lib/pricing/order-payment/index.js +0 -10
  124. package/lib/pricing/product-catalog-price/adapter.d.ts +0 -3
  125. package/lib/pricing/product-catalog-price/adapter.js +0 -60
  126. package/lib/pricing/product-catalog-price/index.d.ts +0 -4
  127. package/lib/pricing/product-catalog-price/index.js +0 -10
  128. package/lib/pricing/product-discount/adapter.d.ts +0 -3
  129. package/lib/pricing/product-discount/adapter.js +0 -69
  130. package/lib/pricing/product-discount/index.d.ts +0 -4
  131. package/lib/pricing/product-discount/index.js +0 -10
  132. package/lib/pricing/product-eu-tax/adapter.d.ts +0 -3
  133. package/lib/pricing/product-eu-tax/adapter.js +0 -56
  134. package/lib/pricing/product-eu-tax/index.d.ts +0 -4
  135. package/lib/pricing/product-eu-tax/index.js +0 -10
  136. package/lib/pricing/product-price-rateconversion/adapter.d.ts +0 -3
  137. package/lib/pricing/product-price-rateconversion/adapter.js +0 -53
  138. package/lib/pricing/product-price-rateconversion/index.d.ts +0 -4
  139. package/lib/pricing/product-price-rateconversion/index.js +0 -10
  140. package/lib/pricing/product-quotation-price.d.ts +0 -2
  141. package/lib/pricing/product-quotation-price.js +0 -40
  142. package/lib/pricing/product-swiss-tax/adapter.d.ts +0 -3
  143. package/lib/pricing/product-swiss-tax/adapter.js +0 -57
  144. package/lib/pricing/product-swiss-tax/index.d.ts +0 -4
  145. package/lib/pricing/product-swiss-tax/index.js +0 -10
  146. package/lib/pricing/product-uk-tax/adapter.d.ts +0 -3
  147. package/lib/pricing/product-uk-tax/adapter.js +0 -57
  148. package/lib/pricing/product-uk-tax/index.d.ts +0 -4
  149. package/lib/pricing/product-uk-tax/index.js +0 -10
  150. package/lib/pricing/product-us-sales-tax/adapter.d.ts +0 -3
  151. package/lib/pricing/product-us-sales-tax/adapter.js +0 -52
  152. package/lib/pricing/product-us-sales-tax/index.d.ts +0 -4
  153. package/lib/pricing/product-us-sales-tax/index.js +0 -10
  154. package/lib/quotations/manual/adapter.d.ts +0 -2
  155. package/lib/quotations/manual/adapter.js +0 -24
  156. package/lib/quotations/manual/index.d.ts +0 -4
  157. package/lib/quotations/manual/index.js +0 -10
  158. package/lib/warehousing/erc-metadata/api.d.ts +0 -12
  159. package/lib/warehousing/erc-metadata/api.js +0 -43
  160. package/lib/warehousing/erc-metadata/index.d.ts +0 -3
  161. package/lib/warehousing/erc-metadata/index.js +0 -15
  162. package/lib/warehousing/eth-minter/adapter.d.ts +0 -2
  163. package/lib/warehousing/eth-minter/adapter.js +0 -119
  164. package/lib/warehousing/eth-minter/index.d.ts +0 -4
  165. package/lib/warehousing/eth-minter/index.js +0 -10
  166. package/lib/warehousing/store/adapter.d.ts +0 -2
  167. package/lib/warehousing/store/adapter.js +0 -33
  168. package/lib/warehousing/store/index.d.ts +0 -4
  169. package/lib/warehousing/store/index.js +0 -10
  170. package/lib/worker/budgetsms/adapter.d.ts +0 -22
  171. package/lib/worker/budgetsms/adapter.js +0 -169
  172. package/lib/worker/budgetsms/index.d.ts +0 -4
  173. package/lib/worker/budgetsms/index.js +0 -10
  174. package/lib/worker/bulk-export/adapter.d.ts +0 -3
  175. package/lib/worker/bulk-export/adapter.js +0 -64
  176. package/lib/worker/bulk-export/index.d.ts +0 -4
  177. package/lib/worker/bulk-export/index.js +0 -10
  178. package/lib/worker/bulk-import/adapter.d.ts +0 -3
  179. package/lib/worker/bulk-import/adapter.js +0 -65
  180. package/lib/worker/bulk-import/api.d.ts +0 -9
  181. package/lib/worker/bulk-import/api.js +0 -52
  182. package/lib/worker/bulk-import/index.d.ts +0 -4
  183. package/lib/worker/bulk-import/index.js +0 -18
  184. package/lib/worker/bulkgate/adapter.d.ts +0 -12
  185. package/lib/worker/bulkgate/adapter.js +0 -91
  186. package/lib/worker/bulkgate/index.d.ts +0 -4
  187. package/lib/worker/bulkgate/index.js +0 -10
  188. package/lib/worker/email/adapter.d.ts +0 -9
  189. package/lib/worker/email/adapter.js +0 -150
  190. package/lib/worker/email/index.d.ts +0 -4
  191. package/lib/worker/email/index.js +0 -10
  192. package/lib/worker/enrollment-order-generator/adapter.d.ts +0 -4
  193. package/lib/worker/enrollment-order-generator/adapter.js +0 -77
  194. package/lib/worker/enrollment-order-generator/index.d.ts +0 -4
  195. package/lib/worker/enrollment-order-generator/index.js +0 -13
  196. package/lib/worker/error-notifications/adapter.d.ts +0 -10
  197. package/lib/worker/error-notifications/adapter.js +0 -62
  198. package/lib/worker/error-notifications/index.d.ts +0 -4
  199. package/lib/worker/error-notifications/index.js +0 -13
  200. package/lib/worker/export-token/adapter.d.ts +0 -4
  201. package/lib/worker/export-token/adapter.js +0 -25
  202. package/lib/worker/export-token/index.d.ts +0 -4
  203. package/lib/worker/export-token/index.js +0 -13
  204. package/lib/worker/external/adapter.d.ts +0 -3
  205. package/lib/worker/external/adapter.js +0 -13
  206. package/lib/worker/external/index.d.ts +0 -4
  207. package/lib/worker/external/index.js +0 -10
  208. package/lib/worker/gc-guests/adapter.d.ts +0 -9
  209. package/lib/worker/gc-guests/adapter.js +0 -56
  210. package/lib/worker/gc-guests/index.d.ts +0 -4
  211. package/lib/worker/gc-guests/index.js +0 -13
  212. package/lib/worker/heartbeat/adapter.d.ts +0 -8
  213. package/lib/worker/heartbeat/adapter.js +0 -26
  214. package/lib/worker/heartbeat/index.d.ts +0 -4
  215. package/lib/worker/heartbeat/index.js +0 -10
  216. package/lib/worker/http-request/adapter.d.ts +0 -8
  217. package/lib/worker/http-request/adapter.js +0 -55
  218. package/lib/worker/http-request/index.d.ts +0 -4
  219. package/lib/worker/http-request/index.js +0 -10
  220. package/lib/worker/invalidate-carts/adapter.d.ts +0 -9
  221. package/lib/worker/invalidate-carts/adapter.js +0 -52
  222. package/lib/worker/invalidate-carts/index.d.ts +0 -4
  223. package/lib/worker/invalidate-carts/index.js +0 -13
  224. package/lib/worker/message/adapter.d.ts +0 -11
  225. package/lib/worker/message/adapter.js +0 -42
  226. package/lib/worker/message/index.d.ts +0 -4
  227. package/lib/worker/message/index.js +0 -10
  228. package/lib/worker/push-notification/adapter.d.ts +0 -9
  229. package/lib/worker/push-notification/adapter.js +0 -87
  230. package/lib/worker/push-notification/index.d.ts +0 -4
  231. package/lib/worker/push-notification/index.js +0 -10
  232. package/lib/worker/twilio/adapter.d.ts +0 -8
  233. package/lib/worker/twilio/adapter.js +0 -59
  234. package/lib/worker/twilio/index.d.ts +0 -4
  235. package/lib/worker/twilio/index.js +0 -10
  236. package/lib/worker/update-coinbase-rates/adapter.d.ts +0 -4
  237. package/lib/worker/update-coinbase-rates/adapter.js +0 -59
  238. package/lib/worker/update-coinbase-rates/index.d.ts +0 -4
  239. package/lib/worker/update-coinbase-rates/index.js +0 -13
  240. package/lib/worker/update-ecb-rates/adapter.d.ts +0 -4
  241. package/lib/worker/update-ecb-rates/adapter.js +0 -94
  242. package/lib/worker/update-ecb-rates/index.d.ts +0 -4
  243. package/lib/worker/update-ecb-rates/index.js +0 -13
  244. package/lib/worker/update-token-ownership/adapter.d.ts +0 -5
  245. package/lib/worker/update-token-ownership/adapter.js +0 -58
  246. package/lib/worker/update-token-ownership/index.d.ts +0 -4
  247. package/lib/worker/update-token-ownership/index.js +0 -13
  248. package/lib/worker/zombie-killer/adapter.d.ts +0 -15
  249. package/lib/worker/zombie-killer/adapter.js +0 -113
  250. package/lib/worker/zombie-killer/index.d.ts +0 -4
  251. package/lib/worker/zombie-killer/index.js +0 -13
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "source": "https://www.estv.admin.ch/estv/en/home/value-added-tax/vat-rates-switzerland.html",
3
3
  "verifiedAt": "2026-08-20",
4
- "timezone": "+01:00",
4
+ "timezone": "Europe/Zurich",
5
5
  "categories": {
6
6
  "default": [
7
7
  { "validFrom": "2001-01-01", "rate": 0.076 },
@@ -3,8 +3,9 @@ export interface TaxRateEra {
3
3
  rate: number;
4
4
  }
5
5
  export interface CompiledTaxRateEra {
6
- validFrom: number;
6
+ validFrom: string;
7
7
  rate: number;
8
+ timeZone: string;
8
9
  }
9
- export declare const compileEraRates: (eras: TaxRateEra[], utcOffset: string) => CompiledTaxRateEra[];
10
+ export declare const compileEraRates: (eras: TaxRateEra[], timeZone: string) => CompiledTaxRateEra[];
10
11
  export declare const rateForDate: (eras: CompiledTaxRateEra[]) => (referenceDate?: Date) => number;
@@ -1,14 +1,40 @@
1
- export const compileEraRates = (eras, utcOffset) => eras
2
- .map(({ validFrom, rate }) => ({
3
- validFrom: new Date(`${validFrom}T00:00:00.000${utcOffset}`).getTime(),
4
- rate,
5
- }))
6
- .sort((left, right) => left.validFrom - right.validFrom);
1
+ const formatDateInTimeZone = (date, timeZone) => {
2
+ const parts = new Intl.DateTimeFormat('en-US', {
3
+ timeZone,
4
+ year: 'numeric',
5
+ month: '2-digit',
6
+ day: '2-digit',
7
+ }).formatToParts(date);
8
+ const value = (type) => parts.find((part) => part.type === type)?.value;
9
+ return `${value('year')}-${value('month')}-${value('day')}`;
10
+ };
11
+ const isIsoDate = (value) => {
12
+ if (!/^\d{4}-\d{2}-\d{2}$/.test(value))
13
+ return false;
14
+ const [year, month, day] = value.split('-').map(Number);
15
+ const parsed = new Date(Date.UTC(year, month - 1, day));
16
+ return (parsed.getUTCFullYear() === year && parsed.getUTCMonth() === month - 1 && parsed.getUTCDate() === day);
17
+ };
18
+ export const compileEraRates = (eras, timeZone) => {
19
+ new Intl.DateTimeFormat('en-US', { timeZone });
20
+ return eras
21
+ .map(({ validFrom, rate }) => {
22
+ if (!isIsoDate(validFrom)) {
23
+ throw new TypeError(`Invalid tax era date '${validFrom}'`);
24
+ }
25
+ return { validFrom, rate, timeZone };
26
+ })
27
+ .sort((left, right) => left.validFrom.localeCompare(right.validFrom));
28
+ };
7
29
  export const rateForDate = (eras) => (referenceDate = new Date()) => {
8
- const time = referenceDate.getTime();
30
+ if (!eras.length)
31
+ throw new TypeError('Cannot resolve a tax rate from an empty era list');
32
+ if (!Number.isFinite(referenceDate.getTime()))
33
+ throw new TypeError('Invalid tax reference date');
34
+ const localDate = formatDateInTimeZone(referenceDate, eras[0].timeZone);
9
35
  let applicable = eras[0];
10
36
  for (const era of eras) {
11
- if (era.validFrom <= time)
37
+ if (era.validFrom <= localDate)
12
38
  applicable = era;
13
39
  }
14
40
  return applicable.rate;
@@ -1,7 +1,35 @@
1
1
  {
2
2
  "source": "https://ec.europa.eu/taxation_customs/tedb/#/vat-search",
3
3
  "verifiedAt": "2026-08-20",
4
- "timezone": "+01:00",
4
+ "timezones": {
5
+ "AT": "Europe/Vienna",
6
+ "BE": "Europe/Brussels",
7
+ "BG": "Europe/Sofia",
8
+ "CY": "Asia/Nicosia",
9
+ "CZ": "Europe/Prague",
10
+ "DE": "Europe/Berlin",
11
+ "DK": "Europe/Copenhagen",
12
+ "EE": "Europe/Tallinn",
13
+ "ES": "Europe/Madrid",
14
+ "FI": "Europe/Helsinki",
15
+ "FR": "Europe/Paris",
16
+ "GR": "Europe/Athens",
17
+ "HR": "Europe/Zagreb",
18
+ "HU": "Europe/Budapest",
19
+ "IE": "Europe/Dublin",
20
+ "IT": "Europe/Rome",
21
+ "LT": "Europe/Vilnius",
22
+ "LU": "Europe/Luxembourg",
23
+ "LV": "Europe/Riga",
24
+ "MT": "Europe/Malta",
25
+ "NL": "Europe/Amsterdam",
26
+ "PL": "Europe/Warsaw",
27
+ "PT": "Europe/Lisbon",
28
+ "RO": "Europe/Bucharest",
29
+ "SE": "Europe/Stockholm",
30
+ "SI": "Europe/Ljubljana",
31
+ "SK": "Europe/Bratislava"
32
+ },
5
33
  "countries": {
6
34
  "AT": {
7
35
  "standard": [
@@ -213,6 +241,10 @@
213
241
  }
214
242
  ],
215
243
  "reduced2": [
244
+ {
245
+ "validFrom": "2009-01-01",
246
+ "rate": 0.09
247
+ },
216
248
  {
217
249
  "validFrom": "2025-01-01",
218
250
  "rate": 0.13
@@ -6,7 +6,7 @@ const countryRates = Object.fromEntries(Object.entries(euTaxRates.countries).map
6
6
  countryCode,
7
7
  Object.fromEntries(Object.entries(categories).map(([category, eras]) => [
8
8
  category,
9
- rateForDate(compileEraRates(eras, euTaxRates.timezone)),
9
+ rateForDate(compileEraRates(eras, euTaxRates.timezones[countryCode])),
10
10
  ])),
11
11
  ]));
12
12
  const normalizeCountryCode = (countryCode) => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "source": "https://www.gov.uk/vat-rates",
3
3
  "verifiedAt": "2026-08-20",
4
- "timezone": "+00:00",
4
+ "timezone": "Europe/London",
5
5
  "categories": {
6
6
  "standard": [
7
7
  { "validFrom": "1991-04-01", "rate": 0.175 },
@@ -1,7 +1,59 @@
1
1
  {
2
2
  "source": "https://taxfoundation.org/data/all/state/2026-sales-tax-rates-midyear/",
3
3
  "verifiedAt": "2026-08-20",
4
- "timezone": "-06:00",
4
+ "timezones": {
5
+ "AK": "America/Anchorage",
6
+ "AL": "America/Chicago",
7
+ "AR": "America/Chicago",
8
+ "AZ": "America/Phoenix",
9
+ "CA": "America/Los_Angeles",
10
+ "CO": "America/Denver",
11
+ "CT": "America/New_York",
12
+ "DC": "America/New_York",
13
+ "DE": "America/New_York",
14
+ "FL": "America/New_York",
15
+ "GA": "America/New_York",
16
+ "HI": "Pacific/Honolulu",
17
+ "IA": "America/Chicago",
18
+ "ID": "America/Boise",
19
+ "IL": "America/Chicago",
20
+ "IN": "America/Indiana/Indianapolis",
21
+ "KS": "America/Chicago",
22
+ "KY": "America/New_York",
23
+ "LA": "America/Chicago",
24
+ "MA": "America/New_York",
25
+ "MD": "America/New_York",
26
+ "ME": "America/New_York",
27
+ "MI": "America/Detroit",
28
+ "MN": "America/Chicago",
29
+ "MO": "America/Chicago",
30
+ "MS": "America/Chicago",
31
+ "MT": "America/Denver",
32
+ "NC": "America/New_York",
33
+ "ND": "America/Chicago",
34
+ "NE": "America/Chicago",
35
+ "NH": "America/New_York",
36
+ "NJ": "America/New_York",
37
+ "NM": "America/Denver",
38
+ "NV": "America/Los_Angeles",
39
+ "NY": "America/New_York",
40
+ "OH": "America/New_York",
41
+ "OK": "America/Chicago",
42
+ "OR": "America/Los_Angeles",
43
+ "PA": "America/New_York",
44
+ "RI": "America/New_York",
45
+ "SC": "America/New_York",
46
+ "SD": "America/Chicago",
47
+ "TN": "America/Chicago",
48
+ "TX": "America/Chicago",
49
+ "UT": "America/Denver",
50
+ "VA": "America/New_York",
51
+ "VT": "America/New_York",
52
+ "WA": "America/Los_Angeles",
53
+ "WI": "America/Chicago",
54
+ "WV": "America/New_York",
55
+ "WY": "America/Denver"
56
+ },
5
57
  "states": {
6
58
  "AK": [
7
59
  {
@@ -268,10 +320,18 @@
268
320
  }
269
321
  ],
270
322
  "SD": [
323
+ {
324
+ "validFrom": "2016-06-01",
325
+ "rate": 0.045
326
+ },
271
327
  {
272
328
  "validFrom": "2023-07-01",
273
- "rate": 0.042,
274
- "note": "HB 1137 temporary cut; reverts to 4.5% on 2027-07-01 unless extended"
329
+ "rate": 0.042
330
+ },
331
+ {
332
+ "validFrom": "2027-07-01",
333
+ "rate": 0.045,
334
+ "note": "HB 1137 temporary cut expires after 2027-06-30"
275
335
  }
276
336
  ],
277
337
  "TN": [
@@ -4,7 +4,7 @@ export const US_COUNTRY_CODE = 'US';
4
4
  export const US_SALES_TAX_EXEMPT_VALUE = 'exempt';
5
5
  const stateRates = Object.fromEntries(Object.entries(usTaxRates.states).map(([stateCode, eras]) => [
6
6
  stateCode,
7
- rateForDate(compileEraRates(eras, usTaxRates.timezone)),
7
+ rateForDate(compileEraRates(eras, usTaxRates.timezones[stateCode])),
8
8
  ]));
9
9
  export const US_STATE_CODES = Object.keys(stateRates);
10
10
  export const resolveUsSalesTaxRate = ({ regionCode, referenceDate, }) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unchainedshop/plugins",
3
3
  "description": "Official plugin collection for the Unchained Engine with payment, delivery, and pricing adapters",
4
- "version": "4.8.25",
4
+ "version": "4.8.26",
5
5
  "main": "lib/plugins-index.js",
6
6
  "types": "lib/plugins-index.d.ts",
7
7
  "exports": {
@@ -1,2 +0,0 @@
1
- import { type IDeliveryAdapter } from '@unchainedshop/core';
2
- export declare const Post: IDeliveryAdapter;
@@ -1,22 +0,0 @@
1
- import { DeliveryAdapter } from '@unchainedshop/core';
2
- import { DeliveryProviderType } from '@unchainedshop/core-delivery';
3
- export const Post = {
4
- ...DeliveryAdapter,
5
- key: 'shop.unchained.post',
6
- label: 'Manual',
7
- version: '1.0.0',
8
- typeSupported: (type) => {
9
- return type === DeliveryProviderType.SHIPPING;
10
- },
11
- actions: (config, context) => {
12
- return {
13
- ...DeliveryAdapter.actions(config, context),
14
- isActive: () => {
15
- return true;
16
- },
17
- configurationError: () => {
18
- return null;
19
- },
20
- };
21
- },
22
- };
@@ -1,4 +0,0 @@
1
- import { type IPlugin } from '@unchainedshop/core';
2
- export declare const PostPlugin: IPlugin;
3
- export default PostPlugin;
4
- export { Post } from './adapter.ts';
@@ -1,10 +0,0 @@
1
- import {} from '@unchainedshop/core';
2
- import { Post } from "./adapter.js";
3
- export const PostPlugin = {
4
- key: 'shop.unchained.post',
5
- label: 'Post Delivery Plugin',
6
- version: '1.0.0',
7
- adapters: [Post],
8
- };
9
- export default PostPlugin;
10
- export { Post } from "./adapter.js";
@@ -1,2 +0,0 @@
1
- import { type IDeliveryAdapter } from '@unchainedshop/core';
2
- export declare const SendMessage: IDeliveryAdapter;
@@ -1,39 +0,0 @@
1
- import { DeliveryAdapter } from '@unchainedshop/core';
2
- import { DeliveryProviderType } from '@unchainedshop/core-delivery';
3
- export const SendMessage = {
4
- ...DeliveryAdapter,
5
- key: 'shop.unchained.delivery.send-message',
6
- label: 'Forward via Messaging',
7
- version: '1.0.0',
8
- initialConfiguration: [
9
- { key: 'from', value: '' },
10
- { key: 'to', value: '' },
11
- { key: 'cc', value: '' },
12
- ],
13
- typeSupported: (type) => {
14
- return type === DeliveryProviderType.SHIPPING;
15
- },
16
- actions: (config, context) => {
17
- return {
18
- ...DeliveryAdapter.actions(config, context),
19
- isActive: () => {
20
- return true;
21
- },
22
- configurationError: () => {
23
- return null;
24
- },
25
- send: async () => {
26
- const { modules, order } = context;
27
- return modules.worker.addWork({
28
- type: 'MESSAGE',
29
- retries: 0,
30
- input: {
31
- template: 'DELIVERY',
32
- orderId: order._id,
33
- config,
34
- },
35
- });
36
- },
37
- };
38
- },
39
- };
@@ -1,4 +0,0 @@
1
- import { type IPlugin } from '@unchainedshop/core';
2
- export declare const SendMessagePlugin: IPlugin;
3
- export default SendMessagePlugin;
4
- export { SendMessage } from './adapter.ts';
@@ -1,10 +0,0 @@
1
- import {} from '@unchainedshop/core';
2
- import { SendMessage } from "./adapter.js";
3
- export const SendMessagePlugin = {
4
- key: 'shop.unchained.delivery.send-message',
5
- label: 'Send Message Delivery Plugin',
6
- version: '1.0.0',
7
- adapters: [SendMessage],
8
- };
9
- export default SendMessagePlugin;
10
- export { SendMessage } from "./adapter.js";
@@ -1,2 +0,0 @@
1
- import { type IDeliveryAdapter } from '@unchainedshop/core';
2
- export declare const PickMup: IDeliveryAdapter;
@@ -1,42 +0,0 @@
1
- import { DeliveryAdapter } from '@unchainedshop/core';
2
- import { DeliveryProviderType } from '@unchainedshop/core-delivery';
3
- export const PickMup = {
4
- ...DeliveryAdapter,
5
- key: 'shop.unchained.stores',
6
- label: 'Pre-configured Stores',
7
- version: '1.0.0',
8
- typeSupported: (type) => {
9
- return type === DeliveryProviderType.PICKUP;
10
- },
11
- actions: (config, context) => {
12
- const getStores = () => {
13
- const storesItem = config.find((item) => item.key === 'stores');
14
- if (!storesItem)
15
- return [];
16
- try {
17
- return typeof storesItem.value === 'string' ? JSON.parse(storesItem.value) : storesItem.value;
18
- }
19
- catch {
20
- return storesItem?.value ?? [];
21
- }
22
- };
23
- return {
24
- ...DeliveryAdapter.actions(config, context),
25
- isActive() {
26
- return true;
27
- },
28
- isAutoReleaseAllowed() {
29
- return false;
30
- },
31
- configurationError() {
32
- return null;
33
- },
34
- pickUpLocationById: async (id) => {
35
- return getStores().find((store) => store._id === id);
36
- },
37
- pickUpLocations: async () => {
38
- return getStores();
39
- },
40
- };
41
- },
42
- };
@@ -1,4 +0,0 @@
1
- import { type IPlugin } from '@unchainedshop/core';
2
- export declare const PickMupPlugin: IPlugin;
3
- export default PickMupPlugin;
4
- export { PickMup } from './adapter.ts';
@@ -1,10 +0,0 @@
1
- import {} from '@unchainedshop/core';
2
- import { PickMup } from "./adapter.js";
3
- export const PickMupPlugin = {
4
- key: 'shop.unchained.stores',
5
- label: 'Pick-up Stores Delivery Plugin',
6
- version: '1.0.0',
7
- adapters: [PickMup],
8
- };
9
- export default PickMupPlugin;
10
- export { PickMup } from "./adapter.js";
@@ -1,6 +0,0 @@
1
- import { type IEnrollmentAdapter } from '@unchainedshop/core';
2
- export declare const rangeMatcher: (date?: Date) => ({ start, end }: {
3
- start: any;
4
- end: any;
5
- }) => boolean;
6
- export declare const LicensedEnrollments: IEnrollmentAdapter;
@@ -1,51 +0,0 @@
1
- import { EnrollmentAdapter } from '@unchainedshop/core';
2
- export const rangeMatcher = (date = new Date()) => {
3
- const timestamp = date.getTime();
4
- return ({ start, end }) => {
5
- const startTimestamp = new Date(start).getTime();
6
- const endTimestamp = new Date(end).getTime();
7
- return startTimestamp <= timestamp && endTimestamp >= timestamp;
8
- };
9
- };
10
- export const LicensedEnrollments = {
11
- ...EnrollmentAdapter,
12
- key: 'shop.unchained.enrollments.licensed',
13
- version: '1.0.0',
14
- label: 'Simple Licensed Enrollments',
15
- isActivatedFor: (productPlan) => {
16
- return productPlan?.usageCalculationType === 'LICENSED';
17
- },
18
- actions: (params) => {
19
- const { enrollment } = params;
20
- return {
21
- ...EnrollmentAdapter.actions(params),
22
- isValidForActivation: async () => {
23
- const periods = enrollment?.periods || [];
24
- return periods.findIndex(rangeMatcher()) !== -1;
25
- },
26
- isOverdue: async () => {
27
- return false;
28
- },
29
- configurationForOrder: async (context) => {
30
- const { period } = context;
31
- const beginningOfPeriod = period.start.getTime() <= new Date().getTime();
32
- if (!enrollment)
33
- throw new Error('Enrollment missing in context');
34
- if (beginningOfPeriod) {
35
- return {
36
- period,
37
- orderContext: {},
38
- orderPositionTemplates: [
39
- {
40
- quantity: 1,
41
- productId: enrollment.productId,
42
- originalProductId: enrollment.productId,
43
- },
44
- ],
45
- };
46
- }
47
- return null;
48
- },
49
- };
50
- },
51
- };
@@ -1,4 +0,0 @@
1
- import { type IPlugin } from '@unchainedshop/core';
2
- export declare const LicensedEnrollmentsPlugin: IPlugin;
3
- export default LicensedEnrollmentsPlugin;
4
- export { LicensedEnrollments, rangeMatcher } from './adapter.ts';
@@ -1,10 +0,0 @@
1
- import {} from '@unchainedshop/core';
2
- import { LicensedEnrollments } from "./adapter.js";
3
- export const LicensedEnrollmentsPlugin = {
4
- key: 'shop.unchained.enrollments.licensed',
5
- label: 'Licensed Enrollments Plugin',
6
- version: '1.0.0',
7
- adapters: [LicensedEnrollments],
8
- };
9
- export default LicensedEnrollmentsPlugin;
10
- export { LicensedEnrollments, rangeMatcher } from "./adapter.js";
@@ -1,7 +0,0 @@
1
- import { type UnchainedCore } from '@unchainedshop/core';
2
- import type { GridFSFileUploadsModule } from './module.ts';
3
- export declare const gridfsRouteHandler: (request: Request, context: UnchainedCore & {
4
- params: Record<string, string>;
5
- modules: GridFSFileUploadsModule;
6
- rawRequest?: any;
7
- }) => Promise<Response>;