@kizlo/woocommerce 0.15.0 → 0.16.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 +23 -0
- package/dist/checkout-validation.d.ts +1 -1
- package/dist/index.d.ts +1790 -2098
- package/dist/index.js +23 -13
- package/dist/{schema-ScTHhVY4.d.ts → schema-CWDJjtW7.d.ts} +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -42,6 +42,29 @@ pnpm add @kizlo/woocommerce
|
|
|
42
42
|
|
|
43
43
|
See the [docs](https://kizlo.io/docs) for setup and usage.
|
|
44
44
|
|
|
45
|
+
## Read cart separately from checkout
|
|
46
|
+
|
|
47
|
+
Checkout get, update, confirm, and retry responses no longer include `cart`. Replace reads of `checkout.cart` with `cart.get`, or use the cart returned by a cart mutation:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
const checkout = await kizlo.woocommerce.checkout.get.call()
|
|
51
|
+
const cart = await kizlo.woocommerce.cart.get.call()
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Refresh cart separately after checkout changes when your UI needs current totals or items. Checkout conflict errors still carry `data.cart` evidence; see [reviewed total protection](#protect-a-reviewed-checkout-total). Update consumers before deploying the companion plugin update.
|
|
55
|
+
|
|
56
|
+
## Require login for checkout
|
|
57
|
+
|
|
58
|
+
Set `allowGuest: false` to require a session from your configured Kizlo auth adapter for `checkout.get`, `checkout.update`, `checkout.confirm`, and `checkout.retry`. Anonymous calls return `UNAUTHORIZED` (401) before changing guest cookies or contacting WooCommerce. Register the integration alongside your auth integration in `createKizlo`; commerce hooks need no auth-provider client state.
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
import { woocommerce } from "@kizlo/woocommerce"
|
|
62
|
+
|
|
63
|
+
const commerce = woocommerce({ allowGuest: false })
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
`allowGuest` defaults to `true`, permitting logged-out checkout subject to WooCommerce's own guest-checkout settings and validation. Customer APIs such as `customers.get` always require login. Guest carts, product/storefront reads, and order ownership/key checks (including guest receipts) keep their existing behavior. After installing a release containing this option, replace your application checkout-auth wrapper with `woocommerce({ allowGuest: false })`; procedure inputs, outputs, and hooks stay the same.
|
|
67
|
+
|
|
45
68
|
## Billing Tax IDs
|
|
46
69
|
|
|
47
70
|
Billing addresses expose `taxId` on customers, carts, checkout responses, and orders. The field is always a string on output and defaults to `""` when it has not been set. Billing address inputs accept an optional `taxId`; shipping addresses have no native `taxId`, and Kizlo discards managed shipping copies independently of the hidden UI rule.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { f as CheckoutRegisteredFieldReference, m as CheckoutValidationIssue, o as StorefrontField, p as CheckoutValidationData } from "./schema-
|
|
1
|
+
import { f as CheckoutRegisteredFieldReference, m as CheckoutValidationIssue, o as StorefrontField, p as CheckoutValidationData } from "./schema-CWDJjtW7.js";
|
|
2
2
|
export { CheckoutRegisteredFieldReference, CheckoutValidationData, CheckoutValidationIssue, type StorefrontField };
|