@kizlo/woocommerce 0.16.0 → 0.17.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 -3
- package/dist/checkout-validation.d.ts +1 -1
- package/dist/index.d.ts +128 -86
- package/dist/index.js +17 -12
- package/dist/{schema-CWDJjtW7.d.ts → schema-ScTHhVY4.d.ts} +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -65,23 +65,43 @@ const commerce = woocommerce({ allowGuest: false })
|
|
|
65
65
|
|
|
66
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
67
|
|
|
68
|
+
## Submit partial checkout addresses
|
|
69
|
+
|
|
70
|
+
Confirm and retry accept optional core address fields, including billing email. Send only the fields you collect. The billing address object is required; shipping is optional. Each supplied address must include `additionalFields`, with any registered required answers (or `{}` when none are required).
|
|
71
|
+
|
|
72
|
+
```ts
|
|
73
|
+
const billingAddress = {
|
|
74
|
+
firstName: "Ada", lastName: "Lovelace",
|
|
75
|
+
address1: "1 Store Street", city: "London", postcode: "SW1A 1AA", country: "GB",
|
|
76
|
+
email: "ada@example.com", additionalFields: {},
|
|
77
|
+
}
|
|
78
|
+
await kizlo.woocommerce.checkout.confirm.call({ body: { billingAddress, paymentMethod: "bacs" } })
|
|
79
|
+
// For an existing unpaid order:
|
|
80
|
+
await kizlo.woocommerce.checkout.retry.call({
|
|
81
|
+
params: { orderId },
|
|
82
|
+
body: { key: orderKey, billingAddress, paymentMethod: "bacs" },
|
|
83
|
+
})
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Omitted fields produce no wire keys; explicit empty strings request clearing where WooCommerce permits it. WooCommerce validates the resulting address against its live rules through the existing checkout errors. Full-address callers remain valid. See [Billing Tax IDs](#billing-tax-ids) for Tax ID omission and [additional checkout fields](https://kizlo.io/docs/concepts/additional-checkout-fields) for registered answer contracts and native billing-to-shipping mirroring.
|
|
87
|
+
|
|
68
88
|
## Billing Tax IDs
|
|
69
89
|
|
|
70
90
|
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.
|
|
71
91
|
|
|
72
92
|
```ts
|
|
73
|
-
await kizlo.woocommerce.cart.
|
|
93
|
+
await kizlo.woocommerce.cart.updateAddress.call({
|
|
74
94
|
body: { billingAddress: { taxId: "GB123456789" } },
|
|
75
95
|
})
|
|
76
96
|
```
|
|
77
97
|
|
|
78
98
|
Store administrators can make the field mandatory from **WooCommerce → Settings → Accounts & Privacy → Checkout → Require Tax ID at checkout**. It remains optional by default.
|
|
79
99
|
|
|
80
|
-
The native value maps to the official registered `kizlo/tax-id` address field. For example, `{ billingAddress: { taxId: "GB123" } }` becomes `{ billing_address: { "kizlo/tax-id": "GB123" } }` on the Store API wire.
|
|
100
|
+
The native value maps to the official registered `kizlo/tax-id` address field. For example, `{ billingAddress: { taxId: "GB123" } }` becomes `{ billing_address: { "kizlo/tax-id": "GB123" } }` on the Store API wire. Cart/customer-address updates and checkout confirm/retry omit the key when `taxId` is omitted, preserving the saved value. Send `taxId: ""` to clear it explicitly. WooCommerce owns sanitization and contextual requiredness.
|
|
81
101
|
|
|
82
102
|
Raw introspection preserves `kizlo/tax-id` in both address schemas. Normalized billing `additionalFields` omits it from types and values: use the native property. Raw billing inputs using that key are rejected even when a duplicate equals `taxId`; there is no raw-only compatibility alias. Other registered and compatible unknown response extras retain their usual buckets.
|
|
83
103
|
|
|
84
|
-
Registered billing extras retain their named enum and scalar types in reads, partial cart updates, and
|
|
104
|
+
Registered billing extras retain their named enum and scalar types in reads, partial cart updates, and confirmation/retry inputs, including registrations with a scalar string index. Confirmation and retry require the registered answers and reject values outside their enums; partial cart updates allow omitted answers. These are compile-time guarantees from the consumer's registered contract. WooCommerce continues to validate against its live registry at runtime.
|
|
85
105
|
|
|
86
106
|
Customer reads use the grouped `billing.additional_fields` adapter backed by public CheckoutFields helpers. Orders read their own snapshot, never the current profile. Storage remains `_wc_billing/kizlo/tax-id`, so existing saved values need no migration. Order admin edits set/replace/clear the order alone; profile edits affect later cart hydration. The retry validation/persistence bridge and shipping cleanup remain required on WooCommerce 11.0.1.
|
|
87
107
|
|
|
@@ -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-ScTHhVY4.js";
|
|
2
2
|
export { CheckoutRegisteredFieldReference, CheckoutValidationData, CheckoutValidationIssue, type StorefrontField };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as StorefrontCountry, c as StorefrontFieldOverride, d as StorefrontPricing, f as CheckoutRegisteredFieldReference, i as StorefrontCheckout, l as StorefrontFieldRule, m as CheckoutValidationIssue, n as StorefrontAddress, o as StorefrontField, p as CheckoutValidationData, r as StorefrontCatalog, s as StorefrontFieldOption, t as Storefront, u as StorefrontFieldSchema } from "./schema-
|
|
1
|
+
import { a as StorefrontCountry, c as StorefrontFieldOverride, d as StorefrontPricing, f as CheckoutRegisteredFieldReference, i as StorefrontCheckout, l as StorefrontFieldRule, m as CheckoutValidationIssue, n as StorefrontAddress, o as StorefrontField, p as CheckoutValidationData, r as StorefrontCatalog, s as StorefrontFieldOption, t as Storefront, u as StorefrontFieldSchema } from "./schema-ScTHhVY4.js";
|
|
2
2
|
import * as kizlo0 from "kizlo";
|
|
3
3
|
import { WP_CustomFields, WP_Schema } from "kizlo";
|
|
4
4
|
import * as _kizlo_shared0 from "@kizlo/shared";
|
|
@@ -5178,7 +5178,7 @@ declare const SelectCartShippingRateInput: z$1.ZodObject<{
|
|
|
5178
5178
|
packageId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodUnion<readonly [z$1.ZodNumber, z$1.ZodString]>>>;
|
|
5179
5179
|
}, z$1.core.$strip>;
|
|
5180
5180
|
type SelectCartShippingRateInput = z$1.infer<typeof SelectCartShippingRateInput>;
|
|
5181
|
-
declare const
|
|
5181
|
+
declare const UpdateCartAddressInput: z$1.ZodObject<{
|
|
5182
5182
|
shippingAddress: z$1.ZodOptional<z$1.ZodObject<{
|
|
5183
5183
|
firstName: z$1.ZodOptional<z$1.ZodString>;
|
|
5184
5184
|
lastName: z$1.ZodOptional<z$1.ZodString>;
|
|
@@ -5222,7 +5222,7 @@ type CartBillingAddressInput = Omit<z$1.input<typeof CartBillingAddress>, "addit
|
|
|
5222
5222
|
type CartShippingAddressInput = Omit<z$1.input<typeof CartShippingAddress>, "additionalFields"> & {
|
|
5223
5223
|
additionalFields: AddressAdditionalFieldsSubmission;
|
|
5224
5224
|
};
|
|
5225
|
-
type
|
|
5225
|
+
type UpdateCartAddressInput = {
|
|
5226
5226
|
billingAddress?: Partial<Omit<CartBillingAddressInput, "additionalFields">> & {
|
|
5227
5227
|
additionalFields?: BillingAdditionalFieldsInput;
|
|
5228
5228
|
};
|
|
@@ -5337,33 +5337,75 @@ declare const UpdateCheckoutInput: z$2.ZodObject<{
|
|
|
5337
5337
|
type UpdateCheckoutInput = Omit<z$2.input<typeof UpdateCheckoutInput>, "additionalFields"> & {
|
|
5338
5338
|
additionalFields?: CheckoutAdditionalFieldsInput;
|
|
5339
5339
|
};
|
|
5340
|
+
declare const CheckoutBillingAddressInput: z$2.ZodObject<{
|
|
5341
|
+
email: z$2.ZodOptional<z$2.ZodString>;
|
|
5342
|
+
firstName: z$2.ZodOptional<z$2.ZodString>;
|
|
5343
|
+
lastName: z$2.ZodOptional<z$2.ZodString>;
|
|
5344
|
+
company: z$2.ZodOptional<z$2.ZodString>;
|
|
5345
|
+
address1: z$2.ZodOptional<z$2.ZodString>;
|
|
5346
|
+
address2: z$2.ZodOptional<z$2.ZodString>;
|
|
5347
|
+
city: z$2.ZodOptional<z$2.ZodString>;
|
|
5348
|
+
state: z$2.ZodOptional<z$2.ZodString>;
|
|
5349
|
+
postcode: z$2.ZodOptional<z$2.ZodString>;
|
|
5350
|
+
country: z$2.ZodOptional<z$2.ZodString>;
|
|
5351
|
+
phone: z$2.ZodOptional<z$2.ZodString>;
|
|
5352
|
+
additionalFields: z$2.ZodType<BillingAdditionalFields, BillingAdditionalFieldsSubmission, z$2.core.$ZodTypeInternals<BillingAdditionalFields, BillingAdditionalFieldsSubmission>>;
|
|
5353
|
+
taxId: z$2.ZodOptional<z$2.ZodString>;
|
|
5354
|
+
}, z$2.core.$strip>;
|
|
5355
|
+
type CheckoutBillingAddressInput = Omit<z$2.input<typeof CheckoutBillingAddressInput>, "additionalFields"> & {
|
|
5356
|
+
additionalFields: BillingAdditionalFieldsSubmission;
|
|
5357
|
+
};
|
|
5358
|
+
declare const CheckoutShippingAddressInput: z$2.ZodObject<{
|
|
5359
|
+
firstName: z$2.ZodOptional<z$2.ZodString>;
|
|
5360
|
+
lastName: z$2.ZodOptional<z$2.ZodString>;
|
|
5361
|
+
company: z$2.ZodOptional<z$2.ZodString>;
|
|
5362
|
+
address1: z$2.ZodOptional<z$2.ZodString>;
|
|
5363
|
+
address2: z$2.ZodOptional<z$2.ZodString>;
|
|
5364
|
+
city: z$2.ZodOptional<z$2.ZodString>;
|
|
5365
|
+
state: z$2.ZodOptional<z$2.ZodString>;
|
|
5366
|
+
postcode: z$2.ZodOptional<z$2.ZodString>;
|
|
5367
|
+
country: z$2.ZodOptional<z$2.ZodString>;
|
|
5368
|
+
phone: z$2.ZodOptional<z$2.ZodString>;
|
|
5369
|
+
additionalFields: z$2.ZodType<{
|
|
5370
|
+
[x: string]: string | boolean | undefined;
|
|
5371
|
+
}, {
|
|
5372
|
+
[x: string]: string | boolean | undefined;
|
|
5373
|
+
}, z$2.core.$ZodTypeInternals<{
|
|
5374
|
+
[x: string]: string | boolean | undefined;
|
|
5375
|
+
}, {
|
|
5376
|
+
[x: string]: string | boolean | undefined;
|
|
5377
|
+
}>>;
|
|
5378
|
+
}, z$2.core.$strip>;
|
|
5379
|
+
type CheckoutShippingAddressInput = Omit<z$2.input<typeof CheckoutShippingAddressInput>, "additionalFields"> & {
|
|
5380
|
+
additionalFields: AddressAdditionalFieldsSubmission;
|
|
5381
|
+
};
|
|
5340
5382
|
declare const ConfirmCheckoutInput: z$2.ZodObject<{
|
|
5341
5383
|
billingAddress: z$2.ZodObject<{
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
|
|
5345
|
-
|
|
5346
|
-
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
|
|
5351
|
-
|
|
5352
|
-
|
|
5353
|
-
phone: z$2.ZodString;
|
|
5384
|
+
email: z$2.ZodOptional<z$2.ZodString>;
|
|
5385
|
+
firstName: z$2.ZodOptional<z$2.ZodString>;
|
|
5386
|
+
lastName: z$2.ZodOptional<z$2.ZodString>;
|
|
5387
|
+
company: z$2.ZodOptional<z$2.ZodString>;
|
|
5388
|
+
address1: z$2.ZodOptional<z$2.ZodString>;
|
|
5389
|
+
address2: z$2.ZodOptional<z$2.ZodString>;
|
|
5390
|
+
city: z$2.ZodOptional<z$2.ZodString>;
|
|
5391
|
+
state: z$2.ZodOptional<z$2.ZodString>;
|
|
5392
|
+
postcode: z$2.ZodOptional<z$2.ZodString>;
|
|
5393
|
+
country: z$2.ZodOptional<z$2.ZodString>;
|
|
5394
|
+
phone: z$2.ZodOptional<z$2.ZodString>;
|
|
5354
5395
|
additionalFields: z$2.ZodType<BillingAdditionalFields, BillingAdditionalFieldsSubmission, z$2.core.$ZodTypeInternals<BillingAdditionalFields, BillingAdditionalFieldsSubmission>>;
|
|
5396
|
+
taxId: z$2.ZodOptional<z$2.ZodString>;
|
|
5355
5397
|
}, z$2.core.$strip>;
|
|
5356
5398
|
shippingAddress: z$2.ZodOptional<z$2.ZodObject<{
|
|
5357
|
-
firstName: z$2.ZodString
|
|
5358
|
-
lastName: z$2.ZodString
|
|
5359
|
-
company: z$2.ZodString
|
|
5360
|
-
address1: z$2.ZodString
|
|
5361
|
-
address2: z$2.ZodString
|
|
5362
|
-
city: z$2.ZodString
|
|
5363
|
-
state: z$2.ZodString
|
|
5364
|
-
postcode: z$2.ZodString
|
|
5365
|
-
country: z$2.ZodString
|
|
5366
|
-
phone: z$2.ZodString
|
|
5399
|
+
firstName: z$2.ZodOptional<z$2.ZodString>;
|
|
5400
|
+
lastName: z$2.ZodOptional<z$2.ZodString>;
|
|
5401
|
+
company: z$2.ZodOptional<z$2.ZodString>;
|
|
5402
|
+
address1: z$2.ZodOptional<z$2.ZodString>;
|
|
5403
|
+
address2: z$2.ZodOptional<z$2.ZodString>;
|
|
5404
|
+
city: z$2.ZodOptional<z$2.ZodString>;
|
|
5405
|
+
state: z$2.ZodOptional<z$2.ZodString>;
|
|
5406
|
+
postcode: z$2.ZodOptional<z$2.ZodString>;
|
|
5407
|
+
country: z$2.ZodOptional<z$2.ZodString>;
|
|
5408
|
+
phone: z$2.ZodOptional<z$2.ZodString>;
|
|
5367
5409
|
additionalFields: z$2.ZodType<{
|
|
5368
5410
|
[x: string]: string | boolean | undefined;
|
|
5369
5411
|
}, {
|
|
@@ -5398,8 +5440,8 @@ declare const ConfirmCheckoutInput: z$2.ZodObject<{
|
|
|
5398
5440
|
}, z$2.core.$strip>;
|
|
5399
5441
|
type ConfirmCheckoutInput = Omit<z$2.input<typeof ConfirmCheckoutInput>, "additionalFields" | "billingAddress" | "shippingAddress"> & {
|
|
5400
5442
|
additionalFields?: CheckoutAdditionalFieldsSubmission;
|
|
5401
|
-
billingAddress:
|
|
5402
|
-
shippingAddress?:
|
|
5443
|
+
billingAddress: CheckoutBillingAddressInput;
|
|
5444
|
+
shippingAddress?: CheckoutShippingAddressInput;
|
|
5403
5445
|
};
|
|
5404
5446
|
declare const RetryCheckoutInput: z$2.ZodObject<{
|
|
5405
5447
|
key: z$2.ZodString;
|
|
@@ -5407,35 +5449,35 @@ declare const RetryCheckoutInput: z$2.ZodObject<{
|
|
|
5407
5449
|
paymentMethod: z$2.ZodString;
|
|
5408
5450
|
billingEmail: z$2.ZodOptional<z$2.ZodEmail>;
|
|
5409
5451
|
billingAddress: z$2.ZodObject<{
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
|
|
5421
|
-
phone: z$2.ZodString;
|
|
5452
|
+
email: z$2.ZodOptional<z$2.ZodString>;
|
|
5453
|
+
firstName: z$2.ZodOptional<z$2.ZodString>;
|
|
5454
|
+
lastName: z$2.ZodOptional<z$2.ZodString>;
|
|
5455
|
+
company: z$2.ZodOptional<z$2.ZodString>;
|
|
5456
|
+
address1: z$2.ZodOptional<z$2.ZodString>;
|
|
5457
|
+
address2: z$2.ZodOptional<z$2.ZodString>;
|
|
5458
|
+
city: z$2.ZodOptional<z$2.ZodString>;
|
|
5459
|
+
state: z$2.ZodOptional<z$2.ZodString>;
|
|
5460
|
+
postcode: z$2.ZodOptional<z$2.ZodString>;
|
|
5461
|
+
country: z$2.ZodOptional<z$2.ZodString>;
|
|
5462
|
+
phone: z$2.ZodOptional<z$2.ZodString>;
|
|
5422
5463
|
additionalFields: z$2.ZodType<BillingAdditionalFields, BillingAdditionalFieldsSubmission, z$2.core.$ZodTypeInternals<BillingAdditionalFields, BillingAdditionalFieldsSubmission>>;
|
|
5464
|
+
taxId: z$2.ZodOptional<z$2.ZodString>;
|
|
5423
5465
|
}, z$2.core.$strip>;
|
|
5424
5466
|
paymentData: z$2.ZodOptional<z$2.ZodArray<z$2.ZodObject<{
|
|
5425
5467
|
key: z$2.ZodString;
|
|
5426
5468
|
value: z$2.ZodUnion<readonly [z$2.ZodString, z$2.ZodBoolean]>;
|
|
5427
5469
|
}, z$2.core.$strip>>>;
|
|
5428
5470
|
shippingAddress: z$2.ZodOptional<z$2.ZodObject<{
|
|
5429
|
-
firstName: z$2.ZodString
|
|
5430
|
-
lastName: z$2.ZodString
|
|
5431
|
-
company: z$2.ZodString
|
|
5432
|
-
address1: z$2.ZodString
|
|
5433
|
-
address2: z$2.ZodString
|
|
5434
|
-
city: z$2.ZodString
|
|
5435
|
-
state: z$2.ZodString
|
|
5436
|
-
postcode: z$2.ZodString
|
|
5437
|
-
country: z$2.ZodString
|
|
5438
|
-
phone: z$2.ZodString
|
|
5471
|
+
firstName: z$2.ZodOptional<z$2.ZodString>;
|
|
5472
|
+
lastName: z$2.ZodOptional<z$2.ZodString>;
|
|
5473
|
+
company: z$2.ZodOptional<z$2.ZodString>;
|
|
5474
|
+
address1: z$2.ZodOptional<z$2.ZodString>;
|
|
5475
|
+
address2: z$2.ZodOptional<z$2.ZodString>;
|
|
5476
|
+
city: z$2.ZodOptional<z$2.ZodString>;
|
|
5477
|
+
state: z$2.ZodOptional<z$2.ZodString>;
|
|
5478
|
+
postcode: z$2.ZodOptional<z$2.ZodString>;
|
|
5479
|
+
country: z$2.ZodOptional<z$2.ZodString>;
|
|
5480
|
+
phone: z$2.ZodOptional<z$2.ZodString>;
|
|
5439
5481
|
additionalFields: z$2.ZodType<{
|
|
5440
5482
|
[x: string]: string | boolean | undefined;
|
|
5441
5483
|
}, {
|
|
@@ -5462,8 +5504,8 @@ declare const RetryCheckoutInput: z$2.ZodObject<{
|
|
|
5462
5504
|
}, z$2.core.$strip>;
|
|
5463
5505
|
type RetryCheckoutInput = Omit<z$2.input<typeof RetryCheckoutInput>, "additionalFields" | "billingAddress" | "shippingAddress"> & {
|
|
5464
5506
|
additionalFields?: CheckoutAdditionalFieldsSubmission;
|
|
5465
|
-
billingAddress:
|
|
5466
|
-
shippingAddress?:
|
|
5507
|
+
billingAddress: CheckoutBillingAddressInput;
|
|
5508
|
+
shippingAddress?: CheckoutShippingAddressInput;
|
|
5467
5509
|
};
|
|
5468
5510
|
//#endregion
|
|
5469
5511
|
//#region src/order/schema.d.ts
|
|
@@ -5775,9 +5817,9 @@ declare const SwatchType: z.ZodEnum<{
|
|
|
5775
5817
|
type SwatchType = z.infer<typeof SwatchType>;
|
|
5776
5818
|
declare const PRODUCT_TYPES: readonly ["simple", "grouped", "external", "variable", "variation"];
|
|
5777
5819
|
declare const ProductType: z.ZodEnum<{
|
|
5820
|
+
external: "external";
|
|
5778
5821
|
simple: "simple";
|
|
5779
5822
|
grouped: "grouped";
|
|
5780
|
-
external: "external";
|
|
5781
5823
|
variable: "variable";
|
|
5782
5824
|
variation: "variation";
|
|
5783
5825
|
}>;
|
|
@@ -7339,11 +7381,11 @@ declare const RetrieveProductInput: z.ZodObject<{
|
|
|
7339
7381
|
}, z.core.$strip>;
|
|
7340
7382
|
type RetrieveProductInput = z.input<typeof RetrieveProductInput>;
|
|
7341
7383
|
declare const ProductOrderBy: z.ZodEnum<{
|
|
7384
|
+
slug: "slug";
|
|
7342
7385
|
date: "date";
|
|
7386
|
+
price: "price";
|
|
7343
7387
|
id: "id";
|
|
7344
7388
|
title: "title";
|
|
7345
|
-
slug: "slug";
|
|
7346
|
-
price: "price";
|
|
7347
7389
|
modified: "modified";
|
|
7348
7390
|
include: "include";
|
|
7349
7391
|
popularity: "popularity";
|
|
@@ -7355,8 +7397,8 @@ type ProductOrderBy = z.infer<typeof ProductOrderBy>;
|
|
|
7355
7397
|
declare const PRODUCT_DATE_COLUMNS: readonly ["date", "date_gmt", "modified", "modified_gmt"];
|
|
7356
7398
|
declare const ProductDateColumn: z.ZodEnum<{
|
|
7357
7399
|
date: "date";
|
|
7358
|
-
modified: "modified";
|
|
7359
7400
|
date_gmt: "date_gmt";
|
|
7401
|
+
modified: "modified";
|
|
7360
7402
|
modified_gmt: "modified_gmt";
|
|
7361
7403
|
}>;
|
|
7362
7404
|
type ProductDateColumn = z.infer<typeof ProductDateColumn>;
|
|
@@ -7381,11 +7423,11 @@ declare const ProductStockStatus: z.ZodEnum<{
|
|
|
7381
7423
|
type ProductStockStatus = z.infer<typeof ProductStockStatus>;
|
|
7382
7424
|
declare const PRODUCT_CATALOG_VISIBILITIES: readonly ["any", "visible", "catalog", "search", "hidden"];
|
|
7383
7425
|
declare const ProductCatalogVisibility: z.ZodEnum<{
|
|
7384
|
-
search: "search";
|
|
7385
7426
|
any: "any";
|
|
7386
|
-
|
|
7387
|
-
catalog: "catalog";
|
|
7427
|
+
search: "search";
|
|
7388
7428
|
visible: "visible";
|
|
7429
|
+
catalog: "catalog";
|
|
7430
|
+
hidden: "hidden";
|
|
7389
7431
|
}>;
|
|
7390
7432
|
type ProductCatalogVisibility = z.infer<typeof ProductCatalogVisibility>;
|
|
7391
7433
|
declare const PRODUCT_RATINGS: readonly [1, 2, 3, 4, 5];
|
|
@@ -7423,8 +7465,8 @@ declare const ListProductInput: z.ZodObject<{
|
|
|
7423
7465
|
before: z.ZodOptional<z.ZodString>;
|
|
7424
7466
|
dateColumn: z.ZodOptional<z.ZodEnum<{
|
|
7425
7467
|
date: "date";
|
|
7426
|
-
modified: "modified";
|
|
7427
7468
|
date_gmt: "date_gmt";
|
|
7469
|
+
modified: "modified";
|
|
7428
7470
|
modified_gmt: "modified_gmt";
|
|
7429
7471
|
}>>;
|
|
7430
7472
|
exclude: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>, z.ZodArray<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>>]>>;
|
|
@@ -7435,11 +7477,11 @@ declare const ListProductInput: z.ZodObject<{
|
|
|
7435
7477
|
desc: "desc";
|
|
7436
7478
|
}>>;
|
|
7437
7479
|
orderBy: z.ZodOptional<z.ZodEnum<{
|
|
7480
|
+
slug: "slug";
|
|
7438
7481
|
date: "date";
|
|
7482
|
+
price: "price";
|
|
7439
7483
|
id: "id";
|
|
7440
7484
|
title: "title";
|
|
7441
|
-
slug: "slug";
|
|
7442
|
-
price: "price";
|
|
7443
7485
|
modified: "modified";
|
|
7444
7486
|
include: "include";
|
|
7445
7487
|
popularity: "popularity";
|
|
@@ -7497,11 +7539,11 @@ declare const ListProductInput: z.ZodObject<{
|
|
|
7497
7539
|
and: "and";
|
|
7498
7540
|
}>>;
|
|
7499
7541
|
catalogVisibility: z.ZodOptional<z.ZodEnum<{
|
|
7500
|
-
search: "search";
|
|
7501
7542
|
any: "any";
|
|
7502
|
-
|
|
7503
|
-
catalog: "catalog";
|
|
7543
|
+
search: "search";
|
|
7504
7544
|
visible: "visible";
|
|
7545
|
+
catalog: "catalog";
|
|
7546
|
+
hidden: "hidden";
|
|
7505
7547
|
}>>;
|
|
7506
7548
|
rating: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>, z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>>, z.ZodArray<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>, z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>>>]>>;
|
|
7507
7549
|
related: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>>;
|
|
@@ -7666,10 +7708,15 @@ declare const ProductAttributeCount: z.ZodObject<{
|
|
|
7666
7708
|
}, z.core.$strip>;
|
|
7667
7709
|
type ProductAttributeCount = z.input<typeof ProductAttributeCount>;
|
|
7668
7710
|
declare const RetrieveProductFiltersInput: z.ZodObject<{
|
|
7669
|
-
|
|
7670
|
-
|
|
7671
|
-
|
|
7672
|
-
|
|
7711
|
+
type: z.ZodOptional<z.ZodString>;
|
|
7712
|
+
sku: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
7713
|
+
slug: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
7714
|
+
catalogVisibility: z.ZodOptional<z.ZodEnum<{
|
|
7715
|
+
any: "any";
|
|
7716
|
+
search: "search";
|
|
7717
|
+
visible: "visible";
|
|
7718
|
+
catalog: "catalog";
|
|
7719
|
+
hidden: "hidden";
|
|
7673
7720
|
}>>;
|
|
7674
7721
|
attributes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
7675
7722
|
taxonomy: z.ZodString;
|
|
@@ -7681,30 +7728,33 @@ declare const RetrieveProductFiltersInput: z.ZodObject<{
|
|
|
7681
7728
|
and: "and";
|
|
7682
7729
|
}>>;
|
|
7683
7730
|
}, z.core.$strip>>>;
|
|
7684
|
-
|
|
7685
|
-
|
|
7686
|
-
|
|
7731
|
+
order: z.ZodOptional<z.ZodEnum<{
|
|
7732
|
+
asc: "asc";
|
|
7733
|
+
desc: "desc";
|
|
7734
|
+
}>>;
|
|
7735
|
+
search: z.ZodOptional<z.ZodString>;
|
|
7687
7736
|
related: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>>;
|
|
7688
|
-
|
|
7689
|
-
rating: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>, z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>>, z.ZodArray<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>, z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>>>]>>;
|
|
7737
|
+
parent: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>, z.ZodArray<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>>]>>;
|
|
7690
7738
|
page: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>>;
|
|
7691
7739
|
perPage: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>>;
|
|
7692
7740
|
after: z.ZodOptional<z.ZodString>;
|
|
7693
7741
|
before: z.ZodOptional<z.ZodString>;
|
|
7694
7742
|
dateColumn: z.ZodOptional<z.ZodEnum<{
|
|
7695
7743
|
date: "date";
|
|
7696
|
-
modified: "modified";
|
|
7697
7744
|
date_gmt: "date_gmt";
|
|
7745
|
+
modified: "modified";
|
|
7698
7746
|
modified_gmt: "modified_gmt";
|
|
7699
7747
|
}>>;
|
|
7700
7748
|
exclude: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>, z.ZodArray<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>>]>>;
|
|
7749
|
+
include: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>, z.ZodArray<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>>]>>;
|
|
7701
7750
|
offset: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>>;
|
|
7751
|
+
rating: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>, z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>>, z.ZodArray<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>, z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>>>]>>;
|
|
7702
7752
|
orderBy: z.ZodOptional<z.ZodEnum<{
|
|
7753
|
+
slug: "slug";
|
|
7703
7754
|
date: "date";
|
|
7755
|
+
price: "price";
|
|
7704
7756
|
id: "id";
|
|
7705
7757
|
title: "title";
|
|
7706
|
-
slug: "slug";
|
|
7707
|
-
price: "price";
|
|
7708
7758
|
modified: "modified";
|
|
7709
7759
|
include: "include";
|
|
7710
7760
|
popularity: "popularity";
|
|
@@ -7712,7 +7762,6 @@ declare const RetrieveProductFiltersInput: z.ZodObject<{
|
|
|
7712
7762
|
menu_order: "menu_order";
|
|
7713
7763
|
comment_count: "comment_count";
|
|
7714
7764
|
}>>;
|
|
7715
|
-
parent: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>, z.ZodArray<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>>]>>;
|
|
7716
7765
|
parentExclude: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>, z.ZodArray<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>>]>>;
|
|
7717
7766
|
featured: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodCodec<z.ZodString, z.ZodBoolean>]>>;
|
|
7718
7767
|
category: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>, z.ZodString]>, z.ZodArray<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>, z.ZodString]>>]>>;
|
|
@@ -7749,13 +7798,6 @@ declare const RetrieveProductFiltersInput: z.ZodObject<{
|
|
|
7749
7798
|
in: "in";
|
|
7750
7799
|
and: "and";
|
|
7751
7800
|
}>>;
|
|
7752
|
-
catalogVisibility: z.ZodOptional<z.ZodEnum<{
|
|
7753
|
-
search: "search";
|
|
7754
|
-
any: "any";
|
|
7755
|
-
hidden: "hidden";
|
|
7756
|
-
catalog: "catalog";
|
|
7757
|
-
visible: "visible";
|
|
7758
|
-
}>>;
|
|
7759
7801
|
taxonomies: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
7760
7802
|
taxonomy: z.ZodString;
|
|
7761
7803
|
termIds: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>, z.ZodArray<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>>]>>;
|
|
@@ -7788,7 +7830,7 @@ interface WooCommerceOptions {
|
|
|
7788
7830
|
declare function woocommerce(options?: WooCommerceOptions): kizlo0.Integration<"woocommerce", {
|
|
7789
7831
|
cart: {
|
|
7790
7832
|
get: kizlo0.Procedure<"api", {}, Cart, {}>;
|
|
7791
|
-
|
|
7833
|
+
updateAddress: kizlo0.Procedure<"api", {
|
|
7792
7834
|
body: {
|
|
7793
7835
|
billingAddress?: (Partial<Omit<CartBillingAddressInput, "additionalFields">> & {
|
|
7794
7836
|
additionalFields?: BillingAdditionalFieldsInput;
|
|
@@ -8250,4 +8292,4 @@ declare function woocommerce(options?: WooCommerceOptions): kizlo0.Integration<"
|
|
|
8250
8292
|
};
|
|
8251
8293
|
}>;
|
|
8252
8294
|
//#endregion
|
|
8253
|
-
export { AddCartItemInput, type AddressAdditionalFields, type AddressAdditionalFieldsInput, ApplyCouponInput, type BillingAdditionalFields, type BillingAdditionalFieldsInput, BillingFieldProjections, Cart, CartAdditionalFields, CartBillingAddress, CartBillingAddressInput, CartBillingAddressSubmission, CartCoupon, CartCouponTotals, CartError, CartFee, CartFeeTotals, CartItem, CartItemData, CartItemQuantityLimits, CartItemTotals, CartPaymentMethod, CartSelectedAttribute, CartShippingAddress, CartShippingAddressInput, CartShippingAddressSubmission, CartShippingDestination, CartShippingItem, CartShippingPackage, CartShippingRate, CartShippingRateMetadata, CartTaxLine, CartTotals, Checkout, CheckoutAdditionalFields, type CheckoutAdditionalFieldsInput, CheckoutExtensions, CheckoutPaymentData, CheckoutPaymentResult, CheckoutRegisteredFieldReference, CheckoutValidationData, CheckoutValidationIssue, ConfirmCheckoutInput, type ContactAdditionalFields, GetOrderInput, ListProductInput, ListProductInputOut, Order, OrderFee, OrderItem, OrderItemProduct, OrderTotals, PRODUCT_ATTRIBUTE_RELATIONS, PRODUCT_CATALOG_VISIBILITIES, PRODUCT_DATE_COLUMNS, PRODUCT_RATINGS, PRODUCT_STOCK_STATUSES, PRODUCT_TYPES, Product, ProductAddToCart, ProductAttributeCount, ProductAttributeFilter, ProductAttributeRelation, ProductAttributeSummary, ProductAttributeTermSummary, ProductBrandSummary, ProductCatalogVisibility, ProductCategorySummary, ProductCustomFieldsSchema, ProductDateColumn, ProductDimensions, ProductExtensions, ProductFilters, ProductFiltersAttributeTerm, ProductFiltersPriceRange, ProductFiltersRatingCount, ProductFiltersStockStatus, ProductFiltersTaxonomyTerm, ProductFiltersTerm, ProductList, ProductOrderBy, ProductPriceRange, ProductPrices, ProductRating, ProductRecommendations, ProductStockAvailability, ProductStockStatus, ProductSummary, ProductTagSummary, ProductTaxonomyFilter, ProductTaxonomyOperator, ProductTermSummary, ProductType, ProductVariationAttributeSummary, ProductVariationSummary, type RegisteredFieldGroup, type RegisteredFieldLocations, type RegisteredFieldTarget, RemoveCartItemInput, RemoveCouponInput, RetrieveProductFiltersInput, RetrieveProductFiltersInputOut, RetrieveProductInput, RetryCheckoutInput, SWATCH_TYPES, SelectCartShippingRateInput, Storefront, StorefrontAddress, StorefrontCatalog, StorefrontCheckout, StorefrontCountry, StorefrontField, StorefrontFieldOption, StorefrontFieldOverride, StorefrontFieldRule, StorefrontFieldSchema, StorefrontPricing, SwatchType,
|
|
8295
|
+
export { AddCartItemInput, type AddressAdditionalFields, type AddressAdditionalFieldsInput, ApplyCouponInput, type BillingAdditionalFields, type BillingAdditionalFieldsInput, BillingFieldProjections, Cart, CartAdditionalFields, CartBillingAddress, CartBillingAddressInput, CartBillingAddressSubmission, CartCoupon, CartCouponTotals, CartError, CartFee, CartFeeTotals, CartItem, CartItemData, CartItemQuantityLimits, CartItemTotals, CartPaymentMethod, CartSelectedAttribute, CartShippingAddress, CartShippingAddressInput, CartShippingAddressSubmission, CartShippingDestination, CartShippingItem, CartShippingPackage, CartShippingRate, CartShippingRateMetadata, CartTaxLine, CartTotals, Checkout, CheckoutAdditionalFields, type CheckoutAdditionalFieldsInput, CheckoutBillingAddressInput, CheckoutExtensions, CheckoutPaymentData, CheckoutPaymentResult, CheckoutRegisteredFieldReference, CheckoutShippingAddressInput, CheckoutValidationData, CheckoutValidationIssue, ConfirmCheckoutInput, type ContactAdditionalFields, GetOrderInput, ListProductInput, ListProductInputOut, Order, OrderFee, OrderItem, OrderItemProduct, OrderTotals, PRODUCT_ATTRIBUTE_RELATIONS, PRODUCT_CATALOG_VISIBILITIES, PRODUCT_DATE_COLUMNS, PRODUCT_RATINGS, PRODUCT_STOCK_STATUSES, PRODUCT_TYPES, Product, ProductAddToCart, ProductAttributeCount, ProductAttributeFilter, ProductAttributeRelation, ProductAttributeSummary, ProductAttributeTermSummary, ProductBrandSummary, ProductCatalogVisibility, ProductCategorySummary, ProductCustomFieldsSchema, ProductDateColumn, ProductDimensions, ProductExtensions, ProductFilters, ProductFiltersAttributeTerm, ProductFiltersPriceRange, ProductFiltersRatingCount, ProductFiltersStockStatus, ProductFiltersTaxonomyTerm, ProductFiltersTerm, ProductList, ProductOrderBy, ProductPriceRange, ProductPrices, ProductRating, ProductRecommendations, ProductStockAvailability, ProductStockStatus, ProductSummary, ProductTagSummary, ProductTaxonomyFilter, ProductTaxonomyOperator, ProductTermSummary, ProductType, ProductVariationAttributeSummary, ProductVariationSummary, type RegisteredFieldGroup, type RegisteredFieldLocations, type RegisteredFieldTarget, RemoveCartItemInput, RemoveCouponInput, RetrieveProductFiltersInput, RetrieveProductFiltersInputOut, RetrieveProductInput, RetryCheckoutInput, SWATCH_TYPES, SelectCartShippingRateInput, Storefront, StorefrontAddress, StorefrontCatalog, StorefrontCheckout, StorefrontCountry, StorefrontField, StorefrontFieldOption, StorefrontFieldOverride, StorefrontFieldRule, StorefrontFieldSchema, StorefrontPricing, SwatchType, UpdateCartAddressInput, UpdateCartItemInput, UpdateCheckoutInput, WooCommerceOptions, resolveRegisteredFieldTarget, woocommerce };
|
package/dist/index.js
CHANGED
|
@@ -100,7 +100,7 @@ function sessionMiddleware(options) {
|
|
|
100
100
|
//#endregion
|
|
101
101
|
//#region src/cart/error.ts
|
|
102
102
|
const GET_CART_ERROR_MAP = defineErrorMap({});
|
|
103
|
-
const
|
|
103
|
+
const UPDATE_CART_ADDRESS_ERROR_MAP = defineErrorMap({ CART_ADDRESS_INVALID: {
|
|
104
104
|
status: 400,
|
|
105
105
|
message: "The cart address is invalid."
|
|
106
106
|
} });
|
|
@@ -710,7 +710,7 @@ const SelectCartShippingRateInput = z$1.object({
|
|
|
710
710
|
});
|
|
711
711
|
const CartShippingAddressInput = z$1.object(CartAddressFields).partial();
|
|
712
712
|
const CartBillingAddressInput = CartBillingAddress.partial().extend(BillingNativeInputFields);
|
|
713
|
-
const
|
|
713
|
+
const UpdateCartAddressInput = z$1.object({
|
|
714
714
|
shippingAddress: CartShippingAddressInput.optional(),
|
|
715
715
|
billingAddress: CartBillingAddressInput.optional()
|
|
716
716
|
});
|
|
@@ -1171,7 +1171,7 @@ const BILLING_ADDRESS_KEYS = new Set([...SHIPPING_ADDRESS_KEYS, "email"]);
|
|
|
1171
1171
|
function additionalAddressFields(address, standardKeys) {
|
|
1172
1172
|
return additionalFieldValues(Object.fromEntries(Object.entries(address).filter((entry) => !standardKeys.has(entry[0]) && (typeof entry[1] === "string" || typeof entry[1] === "boolean"))));
|
|
1173
1173
|
}
|
|
1174
|
-
function
|
|
1174
|
+
function serializeCartAddressInput(input) {
|
|
1175
1175
|
return {
|
|
1176
1176
|
...input.billingAddress !== void 0 && { billing_address: serializeCartBillingAddress(input.billingAddress) },
|
|
1177
1177
|
...input.shippingAddress !== void 0 && { shipping_address: serializeCartShippingAddress(input.shippingAddress) }
|
|
@@ -1216,16 +1216,16 @@ const CART_PROCEDURES = {
|
|
|
1216
1216
|
}
|
|
1217
1217
|
return deserializeCart(response.data);
|
|
1218
1218
|
}),
|
|
1219
|
-
|
|
1219
|
+
updateAddress: createProcedure({
|
|
1220
1220
|
scope: "api",
|
|
1221
1221
|
method: "PUT",
|
|
1222
1222
|
path: "/cart",
|
|
1223
1223
|
output: schemaType(Cart),
|
|
1224
|
-
body: schemaType(
|
|
1225
|
-
errors:
|
|
1224
|
+
body: schemaType(UpdateCartAddressInput),
|
|
1225
|
+
errors: UPDATE_CART_ADDRESS_ERROR_MAP,
|
|
1226
1226
|
middlewares: [sessionMiddleware({ transitionGuestCart: true })]
|
|
1227
1227
|
}, async ({ context, input: { body: input }, errors }) => {
|
|
1228
|
-
const response = await context.wordpress.woocommerce.store.cart.updateCustomer.create({ body:
|
|
1228
|
+
const response = await context.wordpress.woocommerce.store.cart.updateCustomer.create({ body: serializeCartAddressInput(input) }, { headers: context.sessionHeaders });
|
|
1229
1229
|
if (response.error) switch (response.error.code) {
|
|
1230
1230
|
case "rest_invalid_param":
|
|
1231
1231
|
case "woocommerce_rest_invalid_address":
|
|
@@ -1618,9 +1618,14 @@ const UpdateCheckoutInput = z$2.object({
|
|
|
1618
1618
|
additionalFields: CheckoutAdditionalFields.optional(),
|
|
1619
1619
|
extensions: CheckoutExtensions.optional()
|
|
1620
1620
|
});
|
|
1621
|
+
const CheckoutBillingAddressInput = CartBillingAddressSubmission.partial().extend({
|
|
1622
|
+
...BillingNativeInputFields,
|
|
1623
|
+
additionalFields: CartBillingAddressSubmission.shape.additionalFields
|
|
1624
|
+
});
|
|
1625
|
+
const CheckoutShippingAddressInput = CartShippingAddressSubmission.partial().extend({ additionalFields: CartShippingAddressSubmission.shape.additionalFields });
|
|
1621
1626
|
const ConfirmCheckoutInput = z$2.object({
|
|
1622
|
-
billingAddress:
|
|
1623
|
-
shippingAddress:
|
|
1627
|
+
billingAddress: CheckoutBillingAddressInput,
|
|
1628
|
+
shippingAddress: CheckoutShippingAddressInput.optional(),
|
|
1624
1629
|
paymentMethod: z$2.string(),
|
|
1625
1630
|
expectedTotal: z$2.string().regex(/^[0-9]+$/).optional(),
|
|
1626
1631
|
customerNote: z$2.string().optional(),
|
|
@@ -1637,9 +1642,9 @@ const RetryCheckoutInput = z$2.object({
|
|
|
1637
1642
|
orderId: NumberLike,
|
|
1638
1643
|
paymentMethod: z$2.string(),
|
|
1639
1644
|
billingEmail: z$2.email().optional(),
|
|
1640
|
-
billingAddress:
|
|
1645
|
+
billingAddress: CheckoutBillingAddressInput,
|
|
1641
1646
|
paymentData: CheckoutPaymentData.optional(),
|
|
1642
|
-
shippingAddress:
|
|
1647
|
+
shippingAddress: CheckoutShippingAddressInput.optional(),
|
|
1643
1648
|
customerNote: z$2.string().optional(),
|
|
1644
1649
|
additionalFields: CheckoutAdditionalFieldsSubmissionSchema.optional(),
|
|
1645
1650
|
extensions: CheckoutExtensions.optional(),
|
|
@@ -2716,4 +2721,4 @@ function woocommerce(options = {}) {
|
|
|
2716
2721
|
}
|
|
2717
2722
|
|
|
2718
2723
|
//#endregion
|
|
2719
|
-
export { AddCartItemInput, ApplyCouponInput, BillingFieldProjections, Cart, CartAdditionalFields, CartBillingAddress, CartBillingAddressSubmission, CartCoupon, CartCouponTotals, CartError, CartFee, CartFeeTotals, CartItem, CartItemData, CartItemQuantityLimits, CartItemTotals, CartPaymentMethod, CartSelectedAttribute, CartShippingAddress, CartShippingAddressSubmission, CartShippingDestination, CartShippingItem, CartShippingPackage, CartShippingRate, CartShippingRateMetadata, CartTaxLine, CartTotals, Checkout, CheckoutAdditionalFields, CheckoutExtensions, CheckoutPaymentData, CheckoutPaymentResult, CheckoutRegisteredFieldReference, CheckoutValidationData, CheckoutValidationIssue, ConfirmCheckoutInput, GetOrderInput, ListProductInput, Order, OrderFee, OrderItem, OrderItemProduct, OrderTotals, PRODUCT_ATTRIBUTE_RELATIONS, PRODUCT_CATALOG_VISIBILITIES, PRODUCT_DATE_COLUMNS, PRODUCT_RATINGS, PRODUCT_STOCK_STATUSES, PRODUCT_TYPES, Product, ProductAddToCart, ProductAttributeCount, ProductAttributeFilter, ProductAttributeRelation, ProductAttributeSummary, ProductAttributeTermSummary, ProductBrandSummary, ProductCatalogVisibility, ProductCategorySummary, ProductCustomFieldsSchema, ProductDateColumn, ProductDimensions, ProductExtensions, ProductFilters, ProductFiltersAttributeTerm, ProductFiltersPriceRange, ProductFiltersRatingCount, ProductFiltersStockStatus, ProductFiltersTaxonomyTerm, ProductFiltersTerm, ProductList, ProductOrderBy, ProductPriceRange, ProductPrices, ProductRating, ProductRecommendations, ProductStockAvailability, ProductStockStatus, ProductSummary, ProductTagSummary, ProductTaxonomyFilter, ProductTaxonomyOperator, ProductTermSummary, ProductType, ProductVariationAttributeSummary, ProductVariationSummary, RemoveCartItemInput, RemoveCouponInput, RetrieveProductFiltersInput, RetrieveProductInput, RetryCheckoutInput, SWATCH_TYPES, SelectCartShippingRateInput, Storefront, StorefrontAddress, StorefrontCatalog, StorefrontCheckout, StorefrontCountry, StorefrontField, StorefrontFieldOption, StorefrontFieldOverride, StorefrontFieldRule, StorefrontFieldSchema, StorefrontPricing, SwatchType,
|
|
2724
|
+
export { AddCartItemInput, ApplyCouponInput, BillingFieldProjections, Cart, CartAdditionalFields, CartBillingAddress, CartBillingAddressSubmission, CartCoupon, CartCouponTotals, CartError, CartFee, CartFeeTotals, CartItem, CartItemData, CartItemQuantityLimits, CartItemTotals, CartPaymentMethod, CartSelectedAttribute, CartShippingAddress, CartShippingAddressSubmission, CartShippingDestination, CartShippingItem, CartShippingPackage, CartShippingRate, CartShippingRateMetadata, CartTaxLine, CartTotals, Checkout, CheckoutAdditionalFields, CheckoutBillingAddressInput, CheckoutExtensions, CheckoutPaymentData, CheckoutPaymentResult, CheckoutRegisteredFieldReference, CheckoutShippingAddressInput, CheckoutValidationData, CheckoutValidationIssue, ConfirmCheckoutInput, GetOrderInput, ListProductInput, Order, OrderFee, OrderItem, OrderItemProduct, OrderTotals, PRODUCT_ATTRIBUTE_RELATIONS, PRODUCT_CATALOG_VISIBILITIES, PRODUCT_DATE_COLUMNS, PRODUCT_RATINGS, PRODUCT_STOCK_STATUSES, PRODUCT_TYPES, Product, ProductAddToCart, ProductAttributeCount, ProductAttributeFilter, ProductAttributeRelation, ProductAttributeSummary, ProductAttributeTermSummary, ProductBrandSummary, ProductCatalogVisibility, ProductCategorySummary, ProductCustomFieldsSchema, ProductDateColumn, ProductDimensions, ProductExtensions, ProductFilters, ProductFiltersAttributeTerm, ProductFiltersPriceRange, ProductFiltersRatingCount, ProductFiltersStockStatus, ProductFiltersTaxonomyTerm, ProductFiltersTerm, ProductList, ProductOrderBy, ProductPriceRange, ProductPrices, ProductRating, ProductRecommendations, ProductStockAvailability, ProductStockStatus, ProductSummary, ProductTagSummary, ProductTaxonomyFilter, ProductTaxonomyOperator, ProductTermSummary, ProductType, ProductVariationAttributeSummary, ProductVariationSummary, RemoveCartItemInput, RemoveCouponInput, RetrieveProductFiltersInput, RetrieveProductInput, RetryCheckoutInput, SWATCH_TYPES, SelectCartShippingRateInput, Storefront, StorefrontAddress, StorefrontCatalog, StorefrontCheckout, StorefrontCountry, StorefrontField, StorefrontFieldOption, StorefrontFieldOverride, StorefrontFieldRule, StorefrontFieldSchema, StorefrontPricing, SwatchType, UpdateCartAddressInput, UpdateCartItemInput, UpdateCheckoutInput, resolveRegisteredFieldTarget, woocommerce };
|
|
@@ -127,8 +127,8 @@ declare const StorefrontField: z$2.ZodObject<{
|
|
|
127
127
|
id: z$2.ZodString;
|
|
128
128
|
location: z$2.ZodEnum<{
|
|
129
129
|
address: "address";
|
|
130
|
-
contact: "contact";
|
|
131
130
|
order: "order";
|
|
131
|
+
contact: "contact";
|
|
132
132
|
}>;
|
|
133
133
|
attributes: z$2.ZodRecord<z$2.ZodString, z$2.ZodUnknown>;
|
|
134
134
|
schema: z$2.ZodUnion<readonly [z$2.ZodBoolean, z$2.ZodRecord<z$2.ZodString, z$2.ZodUnknown>]>;
|
|
@@ -200,8 +200,8 @@ declare const StorefrontAddress: z$2.ZodObject<{
|
|
|
200
200
|
id: z$2.ZodString;
|
|
201
201
|
location: z$2.ZodEnum<{
|
|
202
202
|
address: "address";
|
|
203
|
-
contact: "contact";
|
|
204
203
|
order: "order";
|
|
204
|
+
contact: "contact";
|
|
205
205
|
}>;
|
|
206
206
|
attributes: z$2.ZodRecord<z$2.ZodString, z$2.ZodUnknown>;
|
|
207
207
|
schema: z$2.ZodUnion<readonly [z$2.ZodBoolean, z$2.ZodRecord<z$2.ZodString, z$2.ZodUnknown>]>;
|
|
@@ -295,8 +295,8 @@ declare const Storefront: z$2.ZodObject<{
|
|
|
295
295
|
id: z$2.ZodString;
|
|
296
296
|
location: z$2.ZodEnum<{
|
|
297
297
|
address: "address";
|
|
298
|
-
contact: "contact";
|
|
299
298
|
order: "order";
|
|
299
|
+
contact: "contact";
|
|
300
300
|
}>;
|
|
301
301
|
attributes: z$2.ZodRecord<z$2.ZodString, z$2.ZodUnknown>;
|
|
302
302
|
schema: z$2.ZodUnion<readonly [z$2.ZodBoolean, z$2.ZodRecord<z$2.ZodString, z$2.ZodUnknown>]>;
|