@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.
- package/dist/client/index.d.mts +2 -2
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js +32 -4
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs +32 -4
- 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/http/index.js +8 -1
- package/dist/http/index.js.map +1 -1
- package/dist/http/index.mjs +8 -1
- package/dist/http/index.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +32 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +32 -4
- package/dist/index.mjs.map +1 -1
- package/dist/{types-B09FKPkT.d.mts → types-CgTmmyIP.d.mts} +19 -1
- package/dist/{types-B09FKPkT.d.ts → types-CgTmmyIP.d.ts} +19 -1
- package/dist/utils/index.d.mts +2 -2
- package/dist/utils/index.d.ts +2 -2
- package/package.json +2 -2
|
@@ -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 {
|
|
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 {
|
|
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 };
|
package/dist/utils/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CartHeadersAdapter } from '../types-
|
|
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-
|
|
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
|
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CartHeadersAdapter } from '../types-
|
|
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-
|
|
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.
|
|
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.
|
|
85
|
+
"@atomic-solutions/schemas": "^0.1.2"
|
|
86
86
|
},
|
|
87
87
|
"sideEffects": false,
|
|
88
88
|
"scripts": {
|