@atomic-solutions/woocommerce-api-client 0.6.0 → 0.7.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.
@@ -1,5 +1,5 @@
1
- import { W as WooCommerceConfig, a as WooCommerceClient } from '../types-Cbf1-EhK.mjs';
2
- export { l as AddItemsResult, p as CartAPI, C as CartHeadersAdapter, u as CheckoutAPI, J as JwtTokenAdapter, x as OrdersAPI, I as ProductsAPI } from '../types-Cbf1-EhK.mjs';
1
+ import { W as WooCommerceConfig, a as WooCommerceClient } from '../types-Tf-Yd0qB.mjs';
2
+ export { l as AddItemsResult, p as CartAPI, C as CartHeadersAdapter, v as CheckoutAPI, J as JwtTokenAdapter, y as OrdersAPI, K as ProductsAPI } from '../types-Tf-Yd0qB.mjs';
3
3
  import 'axios';
4
4
  import '@atomic-solutions/errors';
5
5
  import 'zod';
@@ -1,5 +1,5 @@
1
- import { W as WooCommerceConfig, a as WooCommerceClient } from '../types-Cbf1-EhK.js';
2
- export { l as AddItemsResult, p as CartAPI, C as CartHeadersAdapter, u as CheckoutAPI, J as JwtTokenAdapter, x as OrdersAPI, I as ProductsAPI } from '../types-Cbf1-EhK.js';
1
+ import { W as WooCommerceConfig, a as WooCommerceClient } from '../types-Tf-Yd0qB.js';
2
+ export { l as AddItemsResult, p as CartAPI, C as CartHeadersAdapter, v as CheckoutAPI, J as JwtTokenAdapter, y as OrdersAPI, K as ProductsAPI } from '../types-Tf-Yd0qB.js';
3
3
  import 'axios';
4
4
  import '@atomic-solutions/errors';
5
5
  import 'zod';
@@ -1036,6 +1036,10 @@ zod.z.object({
1036
1036
  zod.z.object({
1037
1037
  code: zod.z.string().min(1)
1038
1038
  });
1039
+ zod.z.object({
1040
+ namespace: zod.z.string().min(1),
1041
+ data: zod.z.record(zod.z.string(), zod.z.unknown())
1042
+ });
1039
1043
  zod.z.object({
1040
1044
  billing_address: billingAddressSchemaMandatory.partial(),
1041
1045
  shipping_address: addressSchema.partial()
@@ -1475,6 +1479,11 @@ var createCartAPI = (client, endpoints, options) => ({
1475
1479
  const response = await client.post(endpoints.removeCoupon, input);
1476
1480
  return handleApiResponse(response, cartSchema, options);
1477
1481
  },
1482
+ // Same request headers (Nonce / Cart-Token / Bearer) as every cart POST.
1483
+ updateExtensions: async (input) => {
1484
+ const response = await client.post(endpoints.updateExtensions, input);
1485
+ return handleApiResponse(response, cartSchema, options);
1486
+ },
1478
1487
  updateCustomer: async (input) => {
1479
1488
  const response = await client.post(endpoints.updateCustomer, input);
1480
1489
  return handleApiResponse(response, cartSchema, options);
@@ -1556,6 +1565,8 @@ var createEndpoints = (version = "legacy") => {
1556
1565
  removeItem: `${prefix}/cart/remove-item`,
1557
1566
  applyCoupon: `${prefix}/cart/apply-coupon`,
1558
1567
  removeCoupon: `${prefix}/cart/remove-coupon`,
1568
+ // Plugins change the cart through this one route (e.g. points discounts).
1569
+ updateExtensions: `${prefix}/cart/extensions`,
1559
1570
  updateCustomer: `${prefix}/cart/update-customer`,
1560
1571
  selectShippingRate: `${prefix}/cart/select-shipping-rate`,
1561
1572
  // Batch