@tallyui/connector-woocommerce 3.16.0 → 3.18.0

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.
package/dist/index.js CHANGED
@@ -1463,6 +1463,21 @@ async function wooStoreSettings(context) {
1463
1463
  })));
1464
1464
  if (rows2.length < 100) break;
1465
1465
  }
1466
+ settings.allTaxRates = rates.map((rate) => ({
1467
+ id: String(rate.id),
1468
+ name: rate.name,
1469
+ rate: rate.rate,
1470
+ location: {
1471
+ ...rate.country ? { country: rate.country } : {},
1472
+ ...rate.state ? { region: rate.state } : {},
1473
+ ...rate.postcodes.length > 0 ? { postcodes: rate.postcodes } : {},
1474
+ ...rate.cities.length > 0 ? { cities: rate.cities } : {}
1475
+ },
1476
+ taxClass: woocommerceTax.normalizeTaxClass(rate.class),
1477
+ priority: rate.priority,
1478
+ compound: rate.compound,
1479
+ shipping: rate.shipping
1480
+ }));
1466
1481
  const taxAddress = store.tax_address;
1467
1482
  let address = taxAddress && typeof taxAddress === "object" && typeof taxAddress.country === "string" && taxAddress.country.length > 0 ? taxAddress : { country: store.store_country, state: store.store_state, postcode: store.store_postcode, city: store.store_city };
1468
1483
  if (!address.country) {
@@ -1552,7 +1567,7 @@ async function readWooCapabilities(context) {
1552
1567
  }
1553
1568
 
1554
1569
  // package.json
1555
- var version = "3.16.0";
1570
+ var version = "3.18.0";
1556
1571
 
1557
1572
  // src/index.ts
1558
1573
  import { ConnectorUnauthorizedError as ConnectorUnauthorizedError4 } from "@tallyui/core";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tallyui/connector-woocommerce",
3
- "version": "3.16.0",
3
+ "version": "3.18.0",
4
4
  "type": "module",
5
5
  "description": "WooCommerce connector for Tally UI",
6
6
  "main": "./dist/index.js",
@@ -27,10 +27,10 @@
27
27
  "directory": "connectors/woocommerce"
28
28
  },
29
29
  "peerDependencies": {
30
- "@tallyui/core": "^3.16.0"
30
+ "@tallyui/core": "^3.18.0"
31
31
  },
32
32
  "devDependencies": {
33
- "@tallyui/database": "3.16.0",
33
+ "@tallyui/database": "3.18.0",
34
34
  "rxdb": "17.5.0"
35
35
  },
36
36
  "scripts": {
@@ -76,6 +76,22 @@ export async function wooStoreSettings(context: SyncContext): Promise<StoreSetti
76
76
  })));
77
77
  if (rows.length < 100) break;
78
78
  }
79
+ // Every rate, unfiltered, for an app's "all tax rates" table (#669); WooCommerce's empty country, state or list means any.
80
+ settings.allTaxRates = rates.map((rate) => ({
81
+ id: String(rate.id),
82
+ name: rate.name,
83
+ rate: rate.rate,
84
+ location: {
85
+ ...(rate.country ? { country: rate.country } : {}),
86
+ ...(rate.state ? { region: rate.state } : {}),
87
+ ...(rate.postcodes.length > 0 ? { postcodes: rate.postcodes } : {}),
88
+ ...(rate.cities.length > 0 ? { cities: rate.cities } : {}),
89
+ },
90
+ taxClass: woocommerceTax.normalizeTaxClass(rate.class),
91
+ priority: rate.priority,
92
+ compound: rate.compound,
93
+ shipping: rate.shipping,
94
+ }));
79
95
 
80
96
  const taxAddress = store.tax_address;
81
97
  let address = taxAddress && typeof taxAddress === 'object' && typeof taxAddress.country === 'string' && taxAddress.country.length > 0