@atomic-solutions/woocommerce-api-client 0.1.4 → 0.2.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.
@@ -1809,6 +1809,7 @@ type CouponInput = z.infer<typeof couponInputSchema>;
1809
1809
  type UpdateCustomerInput = z.infer<typeof updateCustomerInputSchema>;
1810
1810
  type SelectShippingRateInput = z.infer<typeof selectShippingRateInputSchema>;
1811
1811
 
1812
+ declare const orderStatusEnum: z.ZodEnum<["pending", "processing", "on-hold", "completed", "cancelled", "refunded", "failed"]>;
1812
1813
  declare const storeApiOrderSchema: z.ZodObject<{
1813
1814
  id: z.ZodNumber;
1814
1815
  status: z.ZodEnum<["pending", "processing", "on-hold", "completed", "cancelled", "refunded", "failed"]>;
@@ -2487,6 +2488,7 @@ declare const storeApiOrderSchema: z.ZodObject<{
2487
2488
  payment_method?: string | undefined;
2488
2489
  payment_method_title?: string | undefined;
2489
2490
  }>;
2491
+ type OrderStatus = z.infer<typeof orderStatusEnum>;
2490
2492
  type StoreApiOrder = z.infer<typeof storeApiOrderSchema>;
2491
2493
 
2492
2494
  declare const checkoutSchema: z.ZodObject<{
@@ -3402,6 +3404,21 @@ type ProductCategory = z.infer<typeof productCategorySchema>;
3402
3404
  type ProductImage = z.infer<typeof productImageSchema>;
3403
3405
  type ProductParams = z.infer<typeof storeProductsSearchParamsSchema>;
3404
3406
 
3407
+ declare const orderAttributionSchema: z.ZodObject<{
3408
+ source_type: z.ZodString;
3409
+ utm_source: z.ZodString;
3410
+ device_type: z.ZodString;
3411
+ }, "strip", z.ZodTypeAny, {
3412
+ source_type: string;
3413
+ utm_source: string;
3414
+ device_type: string;
3415
+ }, {
3416
+ source_type: string;
3417
+ utm_source: string;
3418
+ device_type: string;
3419
+ }>;
3420
+ type OrderAttribution = z.infer<typeof orderAttributionSchema>;
3421
+
3405
3422
  interface ErrorReporter {
3406
3423
  report: (error: Error) => void;
3407
3424
  }
@@ -3435,6 +3452,7 @@ interface WooCommerceConfig {
3435
3452
  onAuthError?: (error: WooCommerceApiError, client: WooCommerceClient) => Promise<boolean> | boolean;
3436
3453
  timeout?: number;
3437
3454
  headers?: Record<string, string>;
3455
+ orderAttribution?: OrderAttribution;
3438
3456
  }
3439
3457
  interface ProductsAPI {
3440
3458
  list: (params?: ProductParams) => Promise<PaginatedResponse<Product>>;
@@ -3472,4 +3490,4 @@ interface WooCommerceClient {
3472
3490
  orders: OrdersAPI;
3473
3491
  }
3474
3492
 
3475
- export { updateCartItemInputSchema as $, type AddToCartInput as A, BaseError as B, type CartHeadersAdapter as C, WooCommerceApiError as D, type WooCommerceApiErrorOptions as E, addToCartInputSchema as F, type GetOrderInput as G, cartItemImageSchema as H, cartSchema as I, type JwtTokenAdapter as J, checkoutInputSchema as K, checkoutSchema as L, couponInputSchema as M, productCategorySchema as N, type OrdersAPI as O, type PaginatedResponse as P, productImageSchema as Q, type ResponseOptions as R, type SelectShippingRateInput as S, productSchema as T, type UpdateCartItemInput as U, type ValidationMode as V, type WooCommerceConfig as W, removeCartItemInputSchema as X, storeProductsSearchParamsSchema as Y, selectShippingRateInputSchema as Z, storeApiOrderSchema as _, type WooCommerceClient as a, updateCustomerInputSchema as a0, handlePaginatedApiResponse as b, type Pagination as c, calculatePagination as d, type BaseErrorOptions as e, type ValidationReportableData as f, type WooCommerceDataValidationErrorOptions as g, handleApiResponse as h, isZodError as i, type Cart as j, type CartAPI as k, type CartItem as l, type CartItemImage as m, type Checkout as n, type CheckoutAPI as o, type CheckoutInput as p, type CouponInput as q, type Product as r, setupErrorInterceptor as s, type ProductCategory as t, type ProductImage as u, type ProductParams as v, type ProductsAPI as w, type RemoveCartItemInput as x, type StoreApiOrder as y, type UpdateCustomerInput as z };
3493
+ export { storeApiOrderSchema as $, type AddToCartInput as A, BaseError as B, type CartHeadersAdapter as C, type UpdateCustomerInput as D, WooCommerceApiError as E, type WooCommerceApiErrorOptions as F, type GetOrderInput as G, addToCartInputSchema as H, cartItemImageSchema as I, type JwtTokenAdapter as J, cartSchema as K, checkoutInputSchema as L, checkoutSchema as M, couponInputSchema as N, type OrderStatus as O, type PaginatedResponse as P, productCategorySchema as Q, type ResponseOptions as R, type SelectShippingRateInput as S, productImageSchema as T, type UpdateCartItemInput as U, type ValidationMode as V, type WooCommerceConfig as W, productSchema as X, removeCartItemInputSchema as Y, storeProductsSearchParamsSchema as Z, selectShippingRateInputSchema as _, type WooCommerceClient as a, updateCartItemInputSchema as a0, updateCustomerInputSchema as a1, handlePaginatedApiResponse as b, type Pagination as c, calculatePagination as d, type BaseErrorOptions as e, type ValidationReportableData as f, type WooCommerceDataValidationErrorOptions as g, handleApiResponse as h, isZodError as i, type Cart as j, type CartAPI as k, type CartItem as l, type CartItemImage as m, type Checkout as n, type CheckoutAPI as o, type CheckoutInput as p, type CouponInput as q, type OrdersAPI as r, setupErrorInterceptor as s, type Product as t, type ProductCategory as u, type ProductImage as v, type ProductParams as w, type ProductsAPI as x, type RemoveCartItemInput as y, type StoreApiOrder as z };
@@ -1809,6 +1809,7 @@ type CouponInput = z.infer<typeof couponInputSchema>;
1809
1809
  type UpdateCustomerInput = z.infer<typeof updateCustomerInputSchema>;
1810
1810
  type SelectShippingRateInput = z.infer<typeof selectShippingRateInputSchema>;
1811
1811
 
1812
+ declare const orderStatusEnum: z.ZodEnum<["pending", "processing", "on-hold", "completed", "cancelled", "refunded", "failed"]>;
1812
1813
  declare const storeApiOrderSchema: z.ZodObject<{
1813
1814
  id: z.ZodNumber;
1814
1815
  status: z.ZodEnum<["pending", "processing", "on-hold", "completed", "cancelled", "refunded", "failed"]>;
@@ -2487,6 +2488,7 @@ declare const storeApiOrderSchema: z.ZodObject<{
2487
2488
  payment_method?: string | undefined;
2488
2489
  payment_method_title?: string | undefined;
2489
2490
  }>;
2491
+ type OrderStatus = z.infer<typeof orderStatusEnum>;
2490
2492
  type StoreApiOrder = z.infer<typeof storeApiOrderSchema>;
2491
2493
 
2492
2494
  declare const checkoutSchema: z.ZodObject<{
@@ -3402,6 +3404,21 @@ type ProductCategory = z.infer<typeof productCategorySchema>;
3402
3404
  type ProductImage = z.infer<typeof productImageSchema>;
3403
3405
  type ProductParams = z.infer<typeof storeProductsSearchParamsSchema>;
3404
3406
 
3407
+ declare const orderAttributionSchema: z.ZodObject<{
3408
+ source_type: z.ZodString;
3409
+ utm_source: z.ZodString;
3410
+ device_type: z.ZodString;
3411
+ }, "strip", z.ZodTypeAny, {
3412
+ source_type: string;
3413
+ utm_source: string;
3414
+ device_type: string;
3415
+ }, {
3416
+ source_type: string;
3417
+ utm_source: string;
3418
+ device_type: string;
3419
+ }>;
3420
+ type OrderAttribution = z.infer<typeof orderAttributionSchema>;
3421
+
3405
3422
  interface ErrorReporter {
3406
3423
  report: (error: Error) => void;
3407
3424
  }
@@ -3435,6 +3452,7 @@ interface WooCommerceConfig {
3435
3452
  onAuthError?: (error: WooCommerceApiError, client: WooCommerceClient) => Promise<boolean> | boolean;
3436
3453
  timeout?: number;
3437
3454
  headers?: Record<string, string>;
3455
+ orderAttribution?: OrderAttribution;
3438
3456
  }
3439
3457
  interface ProductsAPI {
3440
3458
  list: (params?: ProductParams) => Promise<PaginatedResponse<Product>>;
@@ -3472,4 +3490,4 @@ interface WooCommerceClient {
3472
3490
  orders: OrdersAPI;
3473
3491
  }
3474
3492
 
3475
- export { updateCartItemInputSchema as $, type AddToCartInput as A, BaseError as B, type CartHeadersAdapter as C, WooCommerceApiError as D, type WooCommerceApiErrorOptions as E, addToCartInputSchema as F, type GetOrderInput as G, cartItemImageSchema as H, cartSchema as I, type JwtTokenAdapter as J, checkoutInputSchema as K, checkoutSchema as L, couponInputSchema as M, productCategorySchema as N, type OrdersAPI as O, type PaginatedResponse as P, productImageSchema as Q, type ResponseOptions as R, type SelectShippingRateInput as S, productSchema as T, type UpdateCartItemInput as U, type ValidationMode as V, type WooCommerceConfig as W, removeCartItemInputSchema as X, storeProductsSearchParamsSchema as Y, selectShippingRateInputSchema as Z, storeApiOrderSchema as _, type WooCommerceClient as a, updateCustomerInputSchema as a0, handlePaginatedApiResponse as b, type Pagination as c, calculatePagination as d, type BaseErrorOptions as e, type ValidationReportableData as f, type WooCommerceDataValidationErrorOptions as g, handleApiResponse as h, isZodError as i, type Cart as j, type CartAPI as k, type CartItem as l, type CartItemImage as m, type Checkout as n, type CheckoutAPI as o, type CheckoutInput as p, type CouponInput as q, type Product as r, setupErrorInterceptor as s, type ProductCategory as t, type ProductImage as u, type ProductParams as v, type ProductsAPI as w, type RemoveCartItemInput as x, type StoreApiOrder as y, type UpdateCustomerInput as z };
3493
+ export { storeApiOrderSchema as $, type AddToCartInput as A, BaseError as B, type CartHeadersAdapter as C, type UpdateCustomerInput as D, WooCommerceApiError as E, type WooCommerceApiErrorOptions as F, type GetOrderInput as G, addToCartInputSchema as H, cartItemImageSchema as I, type JwtTokenAdapter as J, cartSchema as K, checkoutInputSchema as L, checkoutSchema as M, couponInputSchema as N, type OrderStatus as O, type PaginatedResponse as P, productCategorySchema as Q, type ResponseOptions as R, type SelectShippingRateInput as S, productImageSchema as T, type UpdateCartItemInput as U, type ValidationMode as V, type WooCommerceConfig as W, productSchema as X, removeCartItemInputSchema as Y, storeProductsSearchParamsSchema as Z, selectShippingRateInputSchema as _, type WooCommerceClient as a, updateCartItemInputSchema as a0, updateCustomerInputSchema as a1, handlePaginatedApiResponse as b, type Pagination as c, calculatePagination as d, type BaseErrorOptions as e, type ValidationReportableData as f, type WooCommerceDataValidationErrorOptions as g, handleApiResponse as h, isZodError as i, type Cart as j, type CartAPI as k, type CartItem as l, type CartItemImage as m, type Checkout as n, type CheckoutAPI as o, type CheckoutInput as p, type CouponInput as q, type OrdersAPI as r, setupErrorInterceptor as s, type Product as t, type ProductCategory as u, type ProductImage as v, type ProductParams as w, type ProductsAPI as x, type RemoveCartItemInput as y, type StoreApiOrder as z };
@@ -1,5 +1,5 @@
1
- import { C as CartHeadersAdapter } from '../types-B09FKPkT.mjs';
2
- export { P as PaginatedResponse, c as Pagination, R as ResponseOptions, V as ValidationMode, d as calculatePagination, h as handleApiResponse, b as handlePaginatedApiResponse, i as isZodError } from '../types-B09FKPkT.mjs';
1
+ import { C as CartHeadersAdapter } from '../types-CgTmmyIP.mjs';
2
+ export { P as PaginatedResponse, c as Pagination, R as ResponseOptions, V as ValidationMode, d as calculatePagination, h as handleApiResponse, b as handlePaginatedApiResponse, i as isZodError } from '../types-CgTmmyIP.mjs';
3
3
  import { AxiosResponse, AxiosInstance } from 'axios';
4
4
  import 'zod';
5
5
 
@@ -1,5 +1,5 @@
1
- import { C as CartHeadersAdapter } from '../types-B09FKPkT.js';
2
- export { P as PaginatedResponse, c as Pagination, R as ResponseOptions, V as ValidationMode, d as calculatePagination, h as handleApiResponse, b as handlePaginatedApiResponse, i as isZodError } from '../types-B09FKPkT.js';
1
+ import { C as CartHeadersAdapter } from '../types-CgTmmyIP.js';
2
+ export { P as PaginatedResponse, c as Pagination, R as ResponseOptions, V as ValidationMode, d as calculatePagination, h as handleApiResponse, b as handlePaginatedApiResponse, i as isZodError } from '../types-CgTmmyIP.js';
3
3
  import { AxiosResponse, AxiosInstance } from 'axios';
4
4
  import 'zod';
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atomic-solutions/woocommerce-api-client",
3
- "version": "0.1.4",
3
+ "version": "0.2.0",
4
4
  "description": "Type-safe WooCommerce API client (framework-agnostic)",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -82,7 +82,7 @@
82
82
  "typescript": "^5.9.0",
83
83
  "vitest": "^2.0.0",
84
84
  "zod": "^3.23.0",
85
- "@atomic-solutions/schemas": "^0.1.0"
85
+ "@atomic-solutions/schemas": "^0.1.2"
86
86
  },
87
87
  "sideEffects": false,
88
88
  "scripts": {