@kizlo/woocommerce 0.12.0 → 0.13.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/README.md CHANGED
@@ -100,7 +100,9 @@ Address `bindings.billing` and `bindings.shipping` are relative to the address o
100
100
 
101
101
  Upgrade the matching plugin and SDK together and regenerate the consumer contract. The field-map/location-list response is replaced by the field array. Kit's group resolvers transform these definitions into form metadata and complete validation schemas; applications decide where and how to render them. Cart-dependent plugin rules remain a separate integration concern; this response does not contain a field document or shopper/session data.
102
102
 
103
- The response is cached in WordPress per locale. Changing a WooCommerce setting clears it and sends the `settings.woocommerce.updated` webhook event.
103
+ `checkout.localPickup.methodIds` classifies shipping methods supporting local pickup, including plugin methods. An empty list is known empty; `null` means older or malformed producer metadata. See [checkout condition data](./docs/checkout-conditions.md) for the complete client document mapping and Kit handoff.
104
+
105
+ The response is cached in WordPress per locale. Changing a WooCommerce setting clears it and sends the `settings.woocommerce.updated` webhook event; plugin activation/deactivation also invalidates it.
104
106
 
105
107
  ## License
106
108
 
package/dist/index.d.ts CHANGED
@@ -3900,6 +3900,7 @@ declare const StorefrontCheckout: z$2.ZodObject<{
3900
3900
  enabled: z$2.ZodBoolean;
3901
3901
  title: z$2.ZodString;
3902
3902
  cost: z$2.ZodString;
3903
+ methodIds: z$2.ZodNullable<z$2.ZodArray<z$2.ZodString>>;
3903
3904
  }, z$2.core.$strip>;
3904
3905
  }, z$2.core.$strip>;
3905
3906
  type StorefrontCheckout = z$2.infer<typeof StorefrontCheckout>;
@@ -3993,6 +3994,7 @@ declare const Storefront: z$2.ZodObject<{
3993
3994
  enabled: z$2.ZodBoolean;
3994
3995
  title: z$2.ZodString;
3995
3996
  cost: z$2.ZodString;
3997
+ methodIds: z$2.ZodNullable<z$2.ZodArray<z$2.ZodString>>;
3996
3998
  }, z$2.core.$strip>;
3997
3999
  }, z$2.core.$strip>;
3998
4000
  pricing: z$2.ZodObject<{
@@ -8388,6 +8390,7 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
8388
8390
  enabled: boolean;
8389
8391
  title: string;
8390
8392
  cost: string;
8393
+ methodIds: string[] | null;
8391
8394
  };
8392
8395
  };
8393
8396
  pricing: {
package/dist/index.js CHANGED
@@ -2602,7 +2602,8 @@ const StorefrontCheckout = z$2.object({
2602
2602
  localPickup: z$2.object({
2603
2603
  enabled: z$2.boolean(),
2604
2604
  title: z$2.string(),
2605
- cost: z$2.string()
2605
+ cost: z$2.string(),
2606
+ methodIds: z$2.array(z$2.string()).nullable()
2606
2607
  })
2607
2608
  });
2608
2609
  const StorefrontPricing = z$2.object({
@@ -2634,6 +2635,7 @@ const Storefront = z$2.object({
2634
2635
  //#region src/storefront/utils.ts
2635
2636
  function deserializeStorefront(data) {
2636
2637
  const { address, checkout, pricing, catalog } = data;
2638
+ const pickup = checkout.local_pickup;
2637
2639
  return {
2638
2640
  address: {
2639
2641
  countries: address.countries.map(deserializeCountry),
@@ -2650,7 +2652,12 @@ function deserializeStorefront(data) {
2650
2652
  displayCartPricesIncludingTax: checkout.display_cart_prices_including_tax,
2651
2653
  displayItemizedTaxes: checkout.display_itemized_taxes,
2652
2654
  shippingEnabled: checkout.shipping_enabled,
2653
- localPickup: checkout.local_pickup
2655
+ localPickup: {
2656
+ enabled: pickup.enabled,
2657
+ title: pickup.title,
2658
+ cost: pickup.cost,
2659
+ methodIds: deserializeMethodIds(pickup.method_ids)
2660
+ }
2654
2661
  },
2655
2662
  pricing: {
2656
2663
  currency: deserializeCurrencyFormat(pricing.currency),
@@ -2672,6 +2679,9 @@ function deserializeStorefront(data) {
2672
2679
  }
2673
2680
  };
2674
2681
  }
2682
+ function deserializeMethodIds(value) {
2683
+ return Array.isArray(value) && Array.from(value).every((id) => typeof id === "string") ? [...value] : null;
2684
+ }
2675
2685
  function deserializeCountry(country) {
2676
2686
  return {
2677
2687
  code: country.code,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kizlo/woocommerce",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "WooCommerce integration for Kizlo.",