@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/client/index.d.mts +2 -2
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js +11 -0
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs +11 -0
- package/dist/client/index.mjs.map +1 -1
- package/dist/http/index.d.mts +2 -2
- package/dist/http/index.d.ts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -1
- package/dist/index.mjs.map +1 -1
- package/dist/testing/index.d.mts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +11 -0
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/index.mjs +11 -0
- package/dist/testing/index.mjs.map +1 -1
- package/dist/{types-Cbf1-EhK.d.mts → types-Tf-Yd0qB.d.mts} +13 -1
- package/dist/{types-Cbf1-EhK.d.ts → types-Tf-Yd0qB.d.ts} +13 -1
- package/dist/utils/index.d.mts +2 -2
- package/dist/utils/index.d.ts +2 -2
- package/package.json +1 -1
package/dist/client/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { W as WooCommerceConfig, a as WooCommerceClient } from '../types-
|
|
2
|
-
export { l as AddItemsResult, p as CartAPI, C as CartHeadersAdapter,
|
|
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';
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { W as WooCommerceConfig, a as WooCommerceClient } from '../types-
|
|
2
|
-
export { l as AddItemsResult, p as CartAPI, C as CartHeadersAdapter,
|
|
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';
|
package/dist/client/index.js
CHANGED
|
@@ -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
|