@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.
@@ -1030,6 +1030,10 @@ z.object({
1030
1030
  z.object({
1031
1031
  code: z.string().min(1)
1032
1032
  });
1033
+ z.object({
1034
+ namespace: z.string().min(1),
1035
+ data: z.record(z.string(), z.unknown())
1036
+ });
1033
1037
  z.object({
1034
1038
  billing_address: billingAddressSchemaMandatory.partial(),
1035
1039
  shipping_address: addressSchema.partial()
@@ -1469,6 +1473,11 @@ var createCartAPI = (client, endpoints, options) => ({
1469
1473
  const response = await client.post(endpoints.removeCoupon, input);
1470
1474
  return handleApiResponse(response, cartSchema, options);
1471
1475
  },
1476
+ // Same request headers (Nonce / Cart-Token / Bearer) as every cart POST.
1477
+ updateExtensions: async (input) => {
1478
+ const response = await client.post(endpoints.updateExtensions, input);
1479
+ return handleApiResponse(response, cartSchema, options);
1480
+ },
1472
1481
  updateCustomer: async (input) => {
1473
1482
  const response = await client.post(endpoints.updateCustomer, input);
1474
1483
  return handleApiResponse(response, cartSchema, options);
@@ -1550,6 +1559,8 @@ var createEndpoints = (version = "legacy") => {
1550
1559
  removeItem: `${prefix}/cart/remove-item`,
1551
1560
  applyCoupon: `${prefix}/cart/apply-coupon`,
1552
1561
  removeCoupon: `${prefix}/cart/remove-coupon`,
1562
+ // Plugins change the cart through this one route (e.g. points discounts).
1563
+ updateExtensions: `${prefix}/cart/extensions`,
1553
1564
  updateCustomer: `${prefix}/cart/update-customer`,
1554
1565
  selectShippingRate: `${prefix}/cart/select-shipping-rate`,
1555
1566
  // Batch