@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.
package/dist/index.mjs CHANGED
@@ -1080,6 +1080,10 @@ var removeCartItemInputSchema = z.object({
1080
1080
  var couponInputSchema = z.object({
1081
1081
  code: z.string().min(1)
1082
1082
  });
1083
+ var cartExtensionsInputSchema = z.object({
1084
+ namespace: z.string().min(1),
1085
+ data: z.record(z.string(), z.unknown())
1086
+ });
1083
1087
  var updateCustomerInputSchema = z.object({
1084
1088
  billing_address: billingAddressSchemaMandatory.partial(),
1085
1089
  shipping_address: addressSchema.partial()
@@ -1620,6 +1624,11 @@ var createCartAPI = (client, endpoints, options) => ({
1620
1624
  const response = await client.post(endpoints.removeCoupon, input);
1621
1625
  return handleApiResponse(response, cartSchema, options);
1622
1626
  },
1627
+ // Same request headers (Nonce / Cart-Token / Bearer) as every cart POST.
1628
+ updateExtensions: async (input) => {
1629
+ const response = await client.post(endpoints.updateExtensions, input);
1630
+ return handleApiResponse(response, cartSchema, options);
1631
+ },
1623
1632
  updateCustomer: async (input) => {
1624
1633
  const response = await client.post(endpoints.updateCustomer, input);
1625
1634
  return handleApiResponse(response, cartSchema, options);
@@ -1701,6 +1710,8 @@ var createEndpoints = (version = "legacy") => {
1701
1710
  removeItem: `${prefix}/cart/remove-item`,
1702
1711
  applyCoupon: `${prefix}/cart/apply-coupon`,
1703
1712
  removeCoupon: `${prefix}/cart/remove-coupon`,
1713
+ // Plugins change the cart through this one route (e.g. points discounts).
1714
+ updateExtensions: `${prefix}/cart/extensions`,
1704
1715
  updateCustomer: `${prefix}/cart/update-customer`,
1705
1716
  selectShippingRate: `${prefix}/cart/select-shipping-rate`,
1706
1717
  // Batch
@@ -2291,6 +2302,6 @@ var schemas = {
2291
2302
  }
2292
2303
  };
2293
2304
 
2294
- export { WooCommerceApiError, WooCommerceDataValidationError, addItemsInputSchema, addToCartInputSchema, addressSchema, categoryFilterSchema as adminCategoryFilterSchema, couponFilterSchema as adminCouponFilterSchema, couponSchema as adminCouponSchema, orderFilterSchema as adminOrderFilterSchema, orderSchema as adminOrderSchema, productCategorySchema2 as adminProductCategorySchema, productFilterSchema as adminProductFilterSchema, productSchema2 as adminProductSchema, batchResponseSchema, billingAddressSchemaMandatory as billingAddressSchema, cartItemImageSchema, cartSchema, checkoutInputSchema, checkoutSchema, couponInputSchema, createCategorySchema, createClient, createCouponSchema, createCustomerSchema, createPaginatedSchema, customerFilterSchema, customerSchema, getAppEnumRaw, getAppEnumZod, makeAddressFormSchema, makeBillingAddressFormSchema, mapWooCommerceCode, paginationMetaSchema, paginationParamsSchema, paymentMethodFilterSchema, paymentMethodSchema, productCategorySchema, productImageSchema, productSchema, removeCartItemInputSchema, schemas, storeProductsSearchParamsSchema as searchParamsSchema, selectShippingRateInputSchema, storeApiOrderSchema, updateCartItemInputSchema, updateCustomerInputSchema, updateCustomerSchema, wcBaseParamsSchema, wcErrorResponseSchema, wcPaginationMetaSchema };
2305
+ export { WooCommerceApiError, WooCommerceDataValidationError, addItemsInputSchema, addToCartInputSchema, addressSchema, categoryFilterSchema as adminCategoryFilterSchema, couponFilterSchema as adminCouponFilterSchema, couponSchema as adminCouponSchema, orderFilterSchema as adminOrderFilterSchema, orderSchema as adminOrderSchema, productCategorySchema2 as adminProductCategorySchema, productFilterSchema as adminProductFilterSchema, productSchema2 as adminProductSchema, batchResponseSchema, billingAddressSchemaMandatory as billingAddressSchema, cartExtensionsInputSchema, cartItemImageSchema, cartSchema, checkoutInputSchema, checkoutSchema, couponInputSchema, createCategorySchema, createClient, createCouponSchema, createCustomerSchema, createPaginatedSchema, customerFilterSchema, customerSchema, getAppEnumRaw, getAppEnumZod, makeAddressFormSchema, makeBillingAddressFormSchema, mapWooCommerceCode, paginationMetaSchema, paginationParamsSchema, paymentMethodFilterSchema, paymentMethodSchema, productCategorySchema, productImageSchema, productSchema, removeCartItemInputSchema, schemas, storeProductsSearchParamsSchema as searchParamsSchema, selectShippingRateInputSchema, storeApiOrderSchema, updateCartItemInputSchema, updateCustomerInputSchema, updateCustomerSchema, wcBaseParamsSchema, wcErrorResponseSchema, wcPaginationMetaSchema };
2295
2306
  //# sourceMappingURL=index.mjs.map
2296
2307
  //# sourceMappingURL=index.mjs.map