@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/http/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { W as WooCommerceConfig, a as WooCommerceClient } from '../types-
|
|
2
|
-
export { P as PaginatedResponse, R as ResponseOptions, V as ValidationMode, h as handleApiData, b as handleApiResponse, c as handlePaginatedApiResponse, i as isZodError, s as setupErrorInterceptor } from '../types-
|
|
1
|
+
import { W as WooCommerceConfig, a as WooCommerceClient } from '../types-Tf-Yd0qB.mjs';
|
|
2
|
+
export { P as PaginatedResponse, R as ResponseOptions, V as ValidationMode, h as handleApiData, b as handleApiResponse, c as handlePaginatedApiResponse, i as isZodError, s as setupErrorInterceptor } from '../types-Tf-Yd0qB.mjs';
|
|
3
3
|
import { AxiosInstance } from 'axios';
|
|
4
4
|
import '@atomic-solutions/errors';
|
|
5
5
|
import 'zod';
|
package/dist/http/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { W as WooCommerceConfig, a as WooCommerceClient } from '../types-
|
|
2
|
-
export { P as PaginatedResponse, R as ResponseOptions, V as ValidationMode, h as handleApiData, b as handleApiResponse, c as handlePaginatedApiResponse, i as isZodError, s as setupErrorInterceptor } from '../types-
|
|
1
|
+
import { W as WooCommerceConfig, a as WooCommerceClient } from '../types-Tf-Yd0qB.js';
|
|
2
|
+
export { P as PaginatedResponse, R as ResponseOptions, V as ValidationMode, h as handleApiData, b as handleApiResponse, c as handlePaginatedApiResponse, i as isZodError, s as setupErrorInterceptor } from '../types-Tf-Yd0qB.js';
|
|
3
3
|
import { AxiosInstance } from 'axios';
|
|
4
4
|
import '@atomic-solutions/errors';
|
|
5
5
|
import 'zod';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { createClient } from './client/index.mjs';
|
|
2
|
-
import { f as WooCommerceApiErrorCode, B as BaseErrorOptions, g as BaseReportableData, j as ValidationReportableData, k as WooCommerceDataValidationErrorOptions } from './types-
|
|
3
|
-
export { A as AddItemsInput, l as AddItemsResult, m as AddToCartInput, n as BatchResponse, o as Cart, p as CartAPI, C as CartHeadersAdapter,
|
|
2
|
+
import { f as WooCommerceApiErrorCode, B as BaseErrorOptions, g as BaseReportableData, j as ValidationReportableData, k as WooCommerceDataValidationErrorOptions } from './types-Tf-Yd0qB.mjs';
|
|
3
|
+
export { A as AddItemsInput, l as AddItemsResult, m as AddToCartInput, n as BatchResponse, o as Cart, p as CartAPI, q as CartExtensionsInput, C as CartHeadersAdapter, r as CartItem, t as CartItemImage, u as Checkout, v as CheckoutAPI, w as CheckoutInput, x as CouponInput, G as GetOrderInput, J as JwtTokenAdapter, O as OrderStatus, y as OrdersAPI, P as PaginatedResponse, z as Product, D as ProductCategory, E as ProductImage, F as ProductParams, H as ProductTag, I as ProductTagsParams, K as ProductsAPI, L as RemoveCartItemInput, M as SelectShippingRateInput, N as StoreApiOrder, U as UpdateCartItemInput, Q as UpdateCustomerInput, T as WooCommerceApiError, X as WooCommerceApiErrorOptions, a as WooCommerceClient, W as WooCommerceConfig, Y as addItemsInputSchema, Z as addToCartInputSchema, _ as batchResponseSchema, $ as cartExtensionsInputSchema, a0 as cartItemImageSchema, a1 as cartSchema, a2 as checkoutInputSchema, a3 as checkoutSchema, a4 as couponInputSchema, a5 as productCategorySchema, a6 as productImageSchema, a7 as productSchema, a8 as removeCartItemInputSchema, a9 as searchParamsSchema, aa as selectShippingRateInputSchema, ab as storeApiOrderSchema, ac as updateCartItemInputSchema, ad as updateCustomerInputSchema } from './types-Tf-Yd0qB.mjs';
|
|
4
4
|
import * as zod from 'zod';
|
|
5
5
|
import { ZodError, z } from 'zod';
|
|
6
6
|
import 'axios';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { createClient } from './client/index.js';
|
|
2
|
-
import { f as WooCommerceApiErrorCode, B as BaseErrorOptions, g as BaseReportableData, j as ValidationReportableData, k as WooCommerceDataValidationErrorOptions } from './types-
|
|
3
|
-
export { A as AddItemsInput, l as AddItemsResult, m as AddToCartInput, n as BatchResponse, o as Cart, p as CartAPI, C as CartHeadersAdapter,
|
|
2
|
+
import { f as WooCommerceApiErrorCode, B as BaseErrorOptions, g as BaseReportableData, j as ValidationReportableData, k as WooCommerceDataValidationErrorOptions } from './types-Tf-Yd0qB.js';
|
|
3
|
+
export { A as AddItemsInput, l as AddItemsResult, m as AddToCartInput, n as BatchResponse, o as Cart, p as CartAPI, q as CartExtensionsInput, C as CartHeadersAdapter, r as CartItem, t as CartItemImage, u as Checkout, v as CheckoutAPI, w as CheckoutInput, x as CouponInput, G as GetOrderInput, J as JwtTokenAdapter, O as OrderStatus, y as OrdersAPI, P as PaginatedResponse, z as Product, D as ProductCategory, E as ProductImage, F as ProductParams, H as ProductTag, I as ProductTagsParams, K as ProductsAPI, L as RemoveCartItemInput, M as SelectShippingRateInput, N as StoreApiOrder, U as UpdateCartItemInput, Q as UpdateCustomerInput, T as WooCommerceApiError, X as WooCommerceApiErrorOptions, a as WooCommerceClient, W as WooCommerceConfig, Y as addItemsInputSchema, Z as addToCartInputSchema, _ as batchResponseSchema, $ as cartExtensionsInputSchema, a0 as cartItemImageSchema, a1 as cartSchema, a2 as checkoutInputSchema, a3 as checkoutSchema, a4 as couponInputSchema, a5 as productCategorySchema, a6 as productImageSchema, a7 as productSchema, a8 as removeCartItemInputSchema, a9 as searchParamsSchema, aa as selectShippingRateInputSchema, ab as storeApiOrderSchema, ac as updateCartItemInputSchema, ad as updateCustomerInputSchema } from './types-Tf-Yd0qB.js';
|
|
4
4
|
import * as zod from 'zod';
|
|
5
5
|
import { ZodError, z } from 'zod';
|
|
6
6
|
import 'axios';
|
package/dist/index.js
CHANGED
|
@@ -1086,6 +1086,10 @@ var removeCartItemInputSchema = zod.z.object({
|
|
|
1086
1086
|
var couponInputSchema = zod.z.object({
|
|
1087
1087
|
code: zod.z.string().min(1)
|
|
1088
1088
|
});
|
|
1089
|
+
var cartExtensionsInputSchema = zod.z.object({
|
|
1090
|
+
namespace: zod.z.string().min(1),
|
|
1091
|
+
data: zod.z.record(zod.z.string(), zod.z.unknown())
|
|
1092
|
+
});
|
|
1089
1093
|
var updateCustomerInputSchema = zod.z.object({
|
|
1090
1094
|
billing_address: billingAddressSchemaMandatory.partial(),
|
|
1091
1095
|
shipping_address: addressSchema.partial()
|
|
@@ -1626,6 +1630,11 @@ var createCartAPI = (client, endpoints, options) => ({
|
|
|
1626
1630
|
const response = await client.post(endpoints.removeCoupon, input);
|
|
1627
1631
|
return handleApiResponse(response, cartSchema, options);
|
|
1628
1632
|
},
|
|
1633
|
+
// Same request headers (Nonce / Cart-Token / Bearer) as every cart POST.
|
|
1634
|
+
updateExtensions: async (input) => {
|
|
1635
|
+
const response = await client.post(endpoints.updateExtensions, input);
|
|
1636
|
+
return handleApiResponse(response, cartSchema, options);
|
|
1637
|
+
},
|
|
1629
1638
|
updateCustomer: async (input) => {
|
|
1630
1639
|
const response = await client.post(endpoints.updateCustomer, input);
|
|
1631
1640
|
return handleApiResponse(response, cartSchema, options);
|
|
@@ -1707,6 +1716,8 @@ var createEndpoints = (version = "legacy") => {
|
|
|
1707
1716
|
removeItem: `${prefix}/cart/remove-item`,
|
|
1708
1717
|
applyCoupon: `${prefix}/cart/apply-coupon`,
|
|
1709
1718
|
removeCoupon: `${prefix}/cart/remove-coupon`,
|
|
1719
|
+
// Plugins change the cart through this one route (e.g. points discounts).
|
|
1720
|
+
updateExtensions: `${prefix}/cart/extensions`,
|
|
1710
1721
|
updateCustomer: `${prefix}/cart/update-customer`,
|
|
1711
1722
|
selectShippingRate: `${prefix}/cart/select-shipping-rate`,
|
|
1712
1723
|
// Batch
|
|
@@ -2312,6 +2323,7 @@ exports.adminProductFilterSchema = productFilterSchema;
|
|
|
2312
2323
|
exports.adminProductSchema = productSchema2;
|
|
2313
2324
|
exports.batchResponseSchema = batchResponseSchema;
|
|
2314
2325
|
exports.billingAddressSchema = billingAddressSchemaMandatory;
|
|
2326
|
+
exports.cartExtensionsInputSchema = cartExtensionsInputSchema;
|
|
2315
2327
|
exports.cartItemImageSchema = cartItemImageSchema;
|
|
2316
2328
|
exports.cartSchema = cartSchema;
|
|
2317
2329
|
exports.checkoutInputSchema = checkoutInputSchema;
|