@atomic-solutions/woocommerce-api-client 0.5.1 → 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.
@@ -1729,6 +1729,16 @@ declare const couponInputSchema: z.ZodObject<{
1729
1729
  }, {
1730
1730
  code: string;
1731
1731
  }>;
1732
+ declare const cartExtensionsInputSchema: z.ZodObject<{
1733
+ namespace: z.ZodString;
1734
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1735
+ }, "strip", z.ZodTypeAny, {
1736
+ data: Record<string, unknown>;
1737
+ namespace: string;
1738
+ }, {
1739
+ data: Record<string, unknown>;
1740
+ namespace: string;
1741
+ }>;
1732
1742
  declare const updateCustomerInputSchema: z.ZodObject<{
1733
1743
  billing_address: z.ZodOptional<z.ZodObject<{
1734
1744
  first_name: z.ZodOptional<z.ZodString>;
@@ -1872,6 +1882,7 @@ type BatchResponse = z.infer<typeof batchResponseSchema>;
1872
1882
  type UpdateCartItemInput = z.infer<typeof updateCartItemInputSchema>;
1873
1883
  type RemoveCartItemInput = z.infer<typeof removeCartItemInputSchema>;
1874
1884
  type CouponInput = z.infer<typeof couponInputSchema>;
1885
+ type CartExtensionsInput = z.infer<typeof cartExtensionsInputSchema>;
1875
1886
  type UpdateCustomerInput = z.infer<typeof updateCustomerInputSchema>;
1876
1887
  type SelectShippingRateInput = z.infer<typeof selectShippingRateInputSchema>;
1877
1888
 
@@ -2636,7 +2647,7 @@ declare const checkoutSchema: z.ZodObject<{
2636
2647
  phone: string;
2637
2648
  }>;
2638
2649
  payment_method: z.ZodString;
2639
- payment_result: z.ZodObject<{
2650
+ payment_result: z.ZodNullable<z.ZodObject<{
2640
2651
  payment_status: z.ZodString;
2641
2652
  payment_details: z.ZodArray<z.ZodUnknown, "many">;
2642
2653
  redirect_url: z.ZodString;
@@ -2648,7 +2659,7 @@ declare const checkoutSchema: z.ZodObject<{
2648
2659
  payment_status: string;
2649
2660
  payment_details: unknown[];
2650
2661
  redirect_url: string;
2651
- }>;
2662
+ }>>;
2652
2663
  }, "strip", z.ZodTypeAny, {
2653
2664
  status: string;
2654
2665
  shipping_address: {
@@ -2685,7 +2696,7 @@ declare const checkoutSchema: z.ZodObject<{
2685
2696
  payment_status: string;
2686
2697
  payment_details: unknown[];
2687
2698
  redirect_url: string;
2688
- };
2699
+ } | null;
2689
2700
  }, {
2690
2701
  status: string;
2691
2702
  shipping_address: {
@@ -2722,7 +2733,7 @@ declare const checkoutSchema: z.ZodObject<{
2722
2733
  payment_status: string;
2723
2734
  payment_details: unknown[];
2724
2735
  redirect_url: string;
2725
- };
2736
+ } | null;
2726
2737
  }>;
2727
2738
  declare const checkoutInputSchema: z.ZodObject<{
2728
2739
  payment_method: z.ZodString;
@@ -3476,6 +3487,24 @@ type ProductCategory = z.infer<typeof productCategorySchema>;
3476
3487
  type ProductImage = z.infer<typeof productImageSchema>;
3477
3488
  type ProductParams = z.infer<typeof storeProductsSearchParamsSchema>;
3478
3489
 
3490
+ declare const productTagSchema: z.ZodObject<{
3491
+ id: z.ZodNumber;
3492
+ name: z.ZodString;
3493
+ slug: z.ZodString;
3494
+ }, "strip", z.ZodTypeAny, {
3495
+ id: number;
3496
+ name: string;
3497
+ slug: string;
3498
+ }, {
3499
+ id: number;
3500
+ name: string;
3501
+ slug: string;
3502
+ }>;
3503
+ type ProductTag = z.infer<typeof productTagSchema>;
3504
+ type ProductTagsParams = {
3505
+ include?: number[];
3506
+ };
3507
+
3479
3508
  declare const orderAttributionSchema: z.ZodObject<{
3480
3509
  source_type: z.ZodString;
3481
3510
  utm_source: z.ZodString;
@@ -3530,6 +3559,7 @@ interface ProductsAPI {
3530
3559
  list: (params?: ProductParams) => Promise<PaginatedResponse<Product>>;
3531
3560
  get: (id: number) => Promise<Product>;
3532
3561
  categories: () => Promise<ProductCategory[]>;
3562
+ tags: (params?: ProductTagsParams) => Promise<ProductTag[]>;
3533
3563
  }
3534
3564
  interface AddItemsResult {
3535
3565
  cart: Cart;
@@ -3548,6 +3578,7 @@ interface CartAPI {
3548
3578
  removeItem: (input: RemoveCartItemInput) => Promise<Cart>;
3549
3579
  applyCoupon: (input: CouponInput) => Promise<Cart>;
3550
3580
  removeCoupon: (input: CouponInput) => Promise<Cart>;
3581
+ updateExtensions: (input: CartExtensionsInput) => Promise<Cart>;
3551
3582
  updateCustomer: (input: UpdateCustomerInput) => Promise<Cart>;
3552
3583
  selectShippingRate: (input: SelectShippingRateInput) => Promise<Cart>;
3553
3584
  }
@@ -3572,4 +3603,4 @@ interface WooCommerceClient {
3572
3603
  orders: OrdersAPI;
3573
3604
  }
3574
3605
 
3575
- export { checkoutSchema as $, type AddItemsInput as A, type BaseErrorOptions as B, type CartHeadersAdapter as C, type ProductImage as D, type ProductParams as E, type ProductsAPI as F, type GetOrderInput as G, type RemoveCartItemInput as H, type SelectShippingRateInput as I, type JwtTokenAdapter as J, type StoreApiOrder as K, type UpdateCustomerInput as L, WooCommerceApiError as M, type WooCommerceApiErrorOptions as N, type OrderStatus as O, type PaginatedResponse as P, addItemsInputSchema as Q, type ResponseOptions as R, type StoreApiVersion as S, addToCartInputSchema as T, type UpdateCartItemInput as U, type ValidationMode as V, type WooCommerceConfig as W, batchResponseSchema as X, cartItemImageSchema as Y, cartSchema as Z, checkoutInputSchema as _, type WooCommerceClient as a, couponInputSchema as a0, productCategorySchema as a1, productImageSchema as a2, productSchema as a3, removeCartItemInputSchema as a4, storeProductsSearchParamsSchema as a5, selectShippingRateInputSchema as a6, storeApiOrderSchema as a7, updateCartItemInputSchema as a8, updateCustomerInputSchema as a9, handleApiResponse as b, handlePaginatedApiResponse as c, type Pagination as d, calculatePagination as e, type WooCommerceApiErrorCode as f, type BaseReportableData as g, handleApiData as h, isZodError as i, type ValidationReportableData as j, type WooCommerceDataValidationErrorOptions as k, type AddItemsResult as l, type AddToCartInput as m, type BatchResponse as n, type Cart as o, type CartAPI as p, type CartItem as q, type CartItemImage as r, setupErrorInterceptor as s, type Checkout as t, type CheckoutAPI as u, type CheckoutInput as v, type CouponInput as w, type OrdersAPI as x, type Product as y, type ProductCategory as z };
3606
+ export { cartExtensionsInputSchema as $, type AddItemsInput as A, type BaseErrorOptions as B, type CartHeadersAdapter as C, type ProductCategory as D, type ProductImage as E, type ProductParams as F, type GetOrderInput as G, type ProductTag as H, type ProductTagsParams as I, type JwtTokenAdapter as J, type ProductsAPI as K, type RemoveCartItemInput as L, type SelectShippingRateInput as M, type StoreApiOrder as N, type OrderStatus as O, type PaginatedResponse as P, type UpdateCustomerInput as Q, type ResponseOptions as R, type StoreApiVersion as S, WooCommerceApiError as T, type UpdateCartItemInput as U, type ValidationMode as V, type WooCommerceConfig as W, type WooCommerceApiErrorOptions as X, addItemsInputSchema as Y, addToCartInputSchema as Z, batchResponseSchema as _, type WooCommerceClient as a, cartItemImageSchema as a0, cartSchema as a1, checkoutInputSchema as a2, checkoutSchema as a3, couponInputSchema as a4, productCategorySchema as a5, productImageSchema as a6, productSchema as a7, removeCartItemInputSchema as a8, storeProductsSearchParamsSchema as a9, selectShippingRateInputSchema as aa, storeApiOrderSchema as ab, updateCartItemInputSchema as ac, updateCustomerInputSchema as ad, handleApiResponse as b, handlePaginatedApiResponse as c, type Pagination as d, calculatePagination as e, type WooCommerceApiErrorCode as f, type BaseReportableData as g, handleApiData as h, isZodError as i, type ValidationReportableData as j, type WooCommerceDataValidationErrorOptions as k, type AddItemsResult as l, type AddToCartInput as m, type BatchResponse as n, type Cart as o, type CartAPI as p, type CartExtensionsInput as q, type CartItem as r, setupErrorInterceptor as s, type CartItemImage as t, type Checkout as u, type CheckoutAPI as v, type CheckoutInput as w, type CouponInput as x, type OrdersAPI as y, type Product as z };
@@ -1729,6 +1729,16 @@ declare const couponInputSchema: z.ZodObject<{
1729
1729
  }, {
1730
1730
  code: string;
1731
1731
  }>;
1732
+ declare const cartExtensionsInputSchema: z.ZodObject<{
1733
+ namespace: z.ZodString;
1734
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1735
+ }, "strip", z.ZodTypeAny, {
1736
+ data: Record<string, unknown>;
1737
+ namespace: string;
1738
+ }, {
1739
+ data: Record<string, unknown>;
1740
+ namespace: string;
1741
+ }>;
1732
1742
  declare const updateCustomerInputSchema: z.ZodObject<{
1733
1743
  billing_address: z.ZodOptional<z.ZodObject<{
1734
1744
  first_name: z.ZodOptional<z.ZodString>;
@@ -1872,6 +1882,7 @@ type BatchResponse = z.infer<typeof batchResponseSchema>;
1872
1882
  type UpdateCartItemInput = z.infer<typeof updateCartItemInputSchema>;
1873
1883
  type RemoveCartItemInput = z.infer<typeof removeCartItemInputSchema>;
1874
1884
  type CouponInput = z.infer<typeof couponInputSchema>;
1885
+ type CartExtensionsInput = z.infer<typeof cartExtensionsInputSchema>;
1875
1886
  type UpdateCustomerInput = z.infer<typeof updateCustomerInputSchema>;
1876
1887
  type SelectShippingRateInput = z.infer<typeof selectShippingRateInputSchema>;
1877
1888
 
@@ -2636,7 +2647,7 @@ declare const checkoutSchema: z.ZodObject<{
2636
2647
  phone: string;
2637
2648
  }>;
2638
2649
  payment_method: z.ZodString;
2639
- payment_result: z.ZodObject<{
2650
+ payment_result: z.ZodNullable<z.ZodObject<{
2640
2651
  payment_status: z.ZodString;
2641
2652
  payment_details: z.ZodArray<z.ZodUnknown, "many">;
2642
2653
  redirect_url: z.ZodString;
@@ -2648,7 +2659,7 @@ declare const checkoutSchema: z.ZodObject<{
2648
2659
  payment_status: string;
2649
2660
  payment_details: unknown[];
2650
2661
  redirect_url: string;
2651
- }>;
2662
+ }>>;
2652
2663
  }, "strip", z.ZodTypeAny, {
2653
2664
  status: string;
2654
2665
  shipping_address: {
@@ -2685,7 +2696,7 @@ declare const checkoutSchema: z.ZodObject<{
2685
2696
  payment_status: string;
2686
2697
  payment_details: unknown[];
2687
2698
  redirect_url: string;
2688
- };
2699
+ } | null;
2689
2700
  }, {
2690
2701
  status: string;
2691
2702
  shipping_address: {
@@ -2722,7 +2733,7 @@ declare const checkoutSchema: z.ZodObject<{
2722
2733
  payment_status: string;
2723
2734
  payment_details: unknown[];
2724
2735
  redirect_url: string;
2725
- };
2736
+ } | null;
2726
2737
  }>;
2727
2738
  declare const checkoutInputSchema: z.ZodObject<{
2728
2739
  payment_method: z.ZodString;
@@ -3476,6 +3487,24 @@ type ProductCategory = z.infer<typeof productCategorySchema>;
3476
3487
  type ProductImage = z.infer<typeof productImageSchema>;
3477
3488
  type ProductParams = z.infer<typeof storeProductsSearchParamsSchema>;
3478
3489
 
3490
+ declare const productTagSchema: z.ZodObject<{
3491
+ id: z.ZodNumber;
3492
+ name: z.ZodString;
3493
+ slug: z.ZodString;
3494
+ }, "strip", z.ZodTypeAny, {
3495
+ id: number;
3496
+ name: string;
3497
+ slug: string;
3498
+ }, {
3499
+ id: number;
3500
+ name: string;
3501
+ slug: string;
3502
+ }>;
3503
+ type ProductTag = z.infer<typeof productTagSchema>;
3504
+ type ProductTagsParams = {
3505
+ include?: number[];
3506
+ };
3507
+
3479
3508
  declare const orderAttributionSchema: z.ZodObject<{
3480
3509
  source_type: z.ZodString;
3481
3510
  utm_source: z.ZodString;
@@ -3530,6 +3559,7 @@ interface ProductsAPI {
3530
3559
  list: (params?: ProductParams) => Promise<PaginatedResponse<Product>>;
3531
3560
  get: (id: number) => Promise<Product>;
3532
3561
  categories: () => Promise<ProductCategory[]>;
3562
+ tags: (params?: ProductTagsParams) => Promise<ProductTag[]>;
3533
3563
  }
3534
3564
  interface AddItemsResult {
3535
3565
  cart: Cart;
@@ -3548,6 +3578,7 @@ interface CartAPI {
3548
3578
  removeItem: (input: RemoveCartItemInput) => Promise<Cart>;
3549
3579
  applyCoupon: (input: CouponInput) => Promise<Cart>;
3550
3580
  removeCoupon: (input: CouponInput) => Promise<Cart>;
3581
+ updateExtensions: (input: CartExtensionsInput) => Promise<Cart>;
3551
3582
  updateCustomer: (input: UpdateCustomerInput) => Promise<Cart>;
3552
3583
  selectShippingRate: (input: SelectShippingRateInput) => Promise<Cart>;
3553
3584
  }
@@ -3572,4 +3603,4 @@ interface WooCommerceClient {
3572
3603
  orders: OrdersAPI;
3573
3604
  }
3574
3605
 
3575
- export { checkoutSchema as $, type AddItemsInput as A, type BaseErrorOptions as B, type CartHeadersAdapter as C, type ProductImage as D, type ProductParams as E, type ProductsAPI as F, type GetOrderInput as G, type RemoveCartItemInput as H, type SelectShippingRateInput as I, type JwtTokenAdapter as J, type StoreApiOrder as K, type UpdateCustomerInput as L, WooCommerceApiError as M, type WooCommerceApiErrorOptions as N, type OrderStatus as O, type PaginatedResponse as P, addItemsInputSchema as Q, type ResponseOptions as R, type StoreApiVersion as S, addToCartInputSchema as T, type UpdateCartItemInput as U, type ValidationMode as V, type WooCommerceConfig as W, batchResponseSchema as X, cartItemImageSchema as Y, cartSchema as Z, checkoutInputSchema as _, type WooCommerceClient as a, couponInputSchema as a0, productCategorySchema as a1, productImageSchema as a2, productSchema as a3, removeCartItemInputSchema as a4, storeProductsSearchParamsSchema as a5, selectShippingRateInputSchema as a6, storeApiOrderSchema as a7, updateCartItemInputSchema as a8, updateCustomerInputSchema as a9, handleApiResponse as b, handlePaginatedApiResponse as c, type Pagination as d, calculatePagination as e, type WooCommerceApiErrorCode as f, type BaseReportableData as g, handleApiData as h, isZodError as i, type ValidationReportableData as j, type WooCommerceDataValidationErrorOptions as k, type AddItemsResult as l, type AddToCartInput as m, type BatchResponse as n, type Cart as o, type CartAPI as p, type CartItem as q, type CartItemImage as r, setupErrorInterceptor as s, type Checkout as t, type CheckoutAPI as u, type CheckoutInput as v, type CouponInput as w, type OrdersAPI as x, type Product as y, type ProductCategory as z };
3606
+ export { cartExtensionsInputSchema as $, type AddItemsInput as A, type BaseErrorOptions as B, type CartHeadersAdapter as C, type ProductCategory as D, type ProductImage as E, type ProductParams as F, type GetOrderInput as G, type ProductTag as H, type ProductTagsParams as I, type JwtTokenAdapter as J, type ProductsAPI as K, type RemoveCartItemInput as L, type SelectShippingRateInput as M, type StoreApiOrder as N, type OrderStatus as O, type PaginatedResponse as P, type UpdateCustomerInput as Q, type ResponseOptions as R, type StoreApiVersion as S, WooCommerceApiError as T, type UpdateCartItemInput as U, type ValidationMode as V, type WooCommerceConfig as W, type WooCommerceApiErrorOptions as X, addItemsInputSchema as Y, addToCartInputSchema as Z, batchResponseSchema as _, type WooCommerceClient as a, cartItemImageSchema as a0, cartSchema as a1, checkoutInputSchema as a2, checkoutSchema as a3, couponInputSchema as a4, productCategorySchema as a5, productImageSchema as a6, productSchema as a7, removeCartItemInputSchema as a8, storeProductsSearchParamsSchema as a9, selectShippingRateInputSchema as aa, storeApiOrderSchema as ab, updateCartItemInputSchema as ac, updateCustomerInputSchema as ad, handleApiResponse as b, handlePaginatedApiResponse as c, type Pagination as d, calculatePagination as e, type WooCommerceApiErrorCode as f, type BaseReportableData as g, handleApiData as h, isZodError as i, type ValidationReportableData as j, type WooCommerceDataValidationErrorOptions as k, type AddItemsResult as l, type AddToCartInput as m, type BatchResponse as n, type Cart as o, type CartAPI as p, type CartExtensionsInput as q, type CartItem as r, setupErrorInterceptor as s, type CartItemImage as t, type Checkout as u, type CheckoutAPI as v, type CheckoutInput as w, type CouponInput as x, type OrdersAPI as y, type Product as z };
@@ -1,5 +1,5 @@
1
- import { C as CartHeadersAdapter } from '../types-9I6oS_83.mjs';
2
- export { P as PaginatedResponse, d as Pagination, R as ResponseOptions, V as ValidationMode, e as calculatePagination, b as handleApiResponse, c as handlePaginatedApiResponse, i as isZodError } from '../types-9I6oS_83.mjs';
1
+ import { C as CartHeadersAdapter } from '../types-Tf-Yd0qB.mjs';
2
+ export { P as PaginatedResponse, d as Pagination, R as ResponseOptions, V as ValidationMode, e as calculatePagination, b as handleApiResponse, c as handlePaginatedApiResponse, i as isZodError } from '../types-Tf-Yd0qB.mjs';
3
3
  import { AxiosResponse, AxiosInstance } from 'axios';
4
4
  import '@atomic-solutions/errors';
5
5
  import 'zod';
@@ -1,5 +1,5 @@
1
- import { C as CartHeadersAdapter } from '../types-9I6oS_83.js';
2
- export { P as PaginatedResponse, d as Pagination, R as ResponseOptions, V as ValidationMode, e as calculatePagination, b as handleApiResponse, c as handlePaginatedApiResponse, i as isZodError } from '../types-9I6oS_83.js';
1
+ import { C as CartHeadersAdapter } from '../types-Tf-Yd0qB.js';
2
+ export { P as PaginatedResponse, d as Pagination, R as ResponseOptions, V as ValidationMode, e as calculatePagination, b as handleApiResponse, c as handlePaginatedApiResponse, i as isZodError } from '../types-Tf-Yd0qB.js';
3
3
  import { AxiosResponse, AxiosInstance } from 'axios';
4
4
  import '@atomic-solutions/errors';
5
5
  import 'zod';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atomic-solutions/woocommerce-api-client",
3
- "version": "0.5.1",
3
+ "version": "0.7.0",
4
4
  "description": "Type-safe WooCommerce API client (framework-agnostic)",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./dist/index.js",