@atomic-solutions/woocommerce-api-client 0.1.0 → 0.1.2

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.
Files changed (45) hide show
  1. package/dist/client/index.d.mts +3 -3
  2. package/dist/client/index.d.ts +3 -3
  3. package/dist/client/index.js +155 -11
  4. package/dist/client/index.js.map +1 -1
  5. package/dist/client/index.mjs +155 -11
  6. package/dist/client/index.mjs.map +1 -1
  7. package/dist/http/index.d.mts +3 -3
  8. package/dist/http/index.d.ts +3 -3
  9. package/dist/http/index.js +4 -3
  10. package/dist/http/index.js.map +1 -1
  11. package/dist/http/index.mjs +4 -3
  12. package/dist/http/index.mjs.map +1 -1
  13. package/dist/index.d.mts +5 -5
  14. package/dist/index.d.ts +5 -5
  15. package/dist/index.js +42 -29
  16. package/dist/index.js.map +1 -1
  17. package/dist/index.mjs +41 -28
  18. package/dist/index.mjs.map +1 -1
  19. package/dist/{types-qKWtrw7A.d.ts → types-DuA0wOpm.d.mts} +1 -1
  20. package/dist/{types-B-zy1xrP.d.mts → types-DuA0wOpm.d.ts} +1 -1
  21. package/dist/utils/index.d.mts +3 -3
  22. package/dist/utils/index.d.ts +3 -3
  23. package/package.json +4 -19
  24. package/dist/pagination.schema-CdjWGZJr.d.mts +0 -190
  25. package/dist/pagination.schema-CdjWGZJr.d.ts +0 -190
  26. package/dist/products-Cxl54crz.d.mts +0 -3412
  27. package/dist/products-Cxl54crz.d.ts +0 -3412
  28. package/dist/schemas/admin-api/index.d.mts +0 -5340
  29. package/dist/schemas/admin-api/index.d.ts +0 -5340
  30. package/dist/schemas/admin-api/index.js +0 -584
  31. package/dist/schemas/admin-api/index.js.map +0 -1
  32. package/dist/schemas/admin-api/index.mjs +0 -545
  33. package/dist/schemas/admin-api/index.mjs.map +0 -1
  34. package/dist/schemas/index.d.mts +0 -4
  35. package/dist/schemas/index.d.ts +0 -4
  36. package/dist/schemas/index.js +0 -887
  37. package/dist/schemas/index.js.map +0 -1
  38. package/dist/schemas/index.mjs +0 -844
  39. package/dist/schemas/index.mjs.map +0 -1
  40. package/dist/schemas/store-api/index.d.mts +0 -1076
  41. package/dist/schemas/store-api/index.d.ts +0 -1076
  42. package/dist/schemas/store-api/index.js +0 -887
  43. package/dist/schemas/store-api/index.js.map +0 -1
  44. package/dist/schemas/store-api/index.mjs +0 -844
  45. package/dist/schemas/store-api/index.mjs.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { AxiosResponse, AxiosInstance, InternalAxiosRequestConfig } from 'axios';
2
2
  import { ZodError, ZodSchema } from 'zod';
3
- import { C as Cart, A as AddToCartInput, U as UpdateCartItemInput, R as RemoveCartItemInput, e as CouponInput, j as UpdateCustomerInput, S as SelectShippingRateInput, c as Checkout, d as CheckoutInput, i as StoreApiOrder, h as ProductParams, P as Product, f as ProductCategory } from './products-Cxl54crz.js';
3
+ import { Cart, AddToCartInput, UpdateCartItemInput, RemoveCartItemInput, CouponInput, UpdateCustomerInput, SelectShippingRateInput, Checkout, CheckoutInput, StoreApiOrder, ProductParams, Product, ProductCategory } from '@atomic-solutions/schemas/woocommerce/store-api';
4
4
 
5
5
  type WooCommerceApiErrorCode = 'cart_empty' | 'invalid_coupon' | 'missing_nonce' | 'invalid_nonce' | 'invalid_params' | 'product_not_found' | 'out_of_stock' | 'insufficient_stock' | 'invalid_payment_method' | 'checkout_error' | 'network_error' | 'unknown_error';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { AxiosResponse, AxiosInstance, InternalAxiosRequestConfig } from 'axios';
2
2
  import { ZodError, ZodSchema } from 'zod';
3
- import { C as Cart, A as AddToCartInput, U as UpdateCartItemInput, R as RemoveCartItemInput, e as CouponInput, j as UpdateCustomerInput, S as SelectShippingRateInput, c as Checkout, d as CheckoutInput, i as StoreApiOrder, h as ProductParams, P as Product, f as ProductCategory } from './products-Cxl54crz.mjs';
3
+ import { Cart, AddToCartInput, UpdateCartItemInput, RemoveCartItemInput, CouponInput, UpdateCustomerInput, SelectShippingRateInput, Checkout, CheckoutInput, StoreApiOrder, ProductParams, Product, ProductCategory } from '@atomic-solutions/schemas/woocommerce/store-api';
4
4
 
5
5
  type WooCommerceApiErrorCode = 'cart_empty' | 'invalid_coupon' | 'missing_nonce' | 'invalid_nonce' | 'invalid_params' | 'product_not_found' | 'out_of_stock' | 'insufficient_stock' | 'invalid_payment_method' | 'checkout_error' | 'network_error' | 'unknown_error';
6
6
 
@@ -1,8 +1,8 @@
1
- import { b as CartHeadersAdapter } from '../types-B-zy1xrP.mjs';
2
- export { P as PaginatedResponse, m as Pagination, R as ResponseOptions, i as ValidationMode, n as calculatePagination, j as handleApiResponse, k as handlePaginatedApiResponse, l as isZodError } from '../types-B-zy1xrP.mjs';
1
+ import { b as CartHeadersAdapter } from '../types-DuA0wOpm.mjs';
2
+ export { P as PaginatedResponse, m as Pagination, R as ResponseOptions, i as ValidationMode, n as calculatePagination, j as handleApiResponse, k as handlePaginatedApiResponse, l as isZodError } from '../types-DuA0wOpm.mjs';
3
3
  import { AxiosResponse, AxiosInstance } from 'axios';
4
4
  import 'zod';
5
- import '../products-Cxl54crz.mjs';
5
+ import '@atomic-solutions/schemas/woocommerce/store-api';
6
6
 
7
7
  interface PaginationMeta {
8
8
  total: number;
@@ -1,8 +1,8 @@
1
- import { b as CartHeadersAdapter } from '../types-qKWtrw7A.js';
2
- export { P as PaginatedResponse, m as Pagination, R as ResponseOptions, i as ValidationMode, n as calculatePagination, j as handleApiResponse, k as handlePaginatedApiResponse, l as isZodError } from '../types-qKWtrw7A.js';
1
+ import { b as CartHeadersAdapter } from '../types-DuA0wOpm.js';
2
+ export { P as PaginatedResponse, m as Pagination, R as ResponseOptions, i as ValidationMode, n as calculatePagination, j as handleApiResponse, k as handlePaginatedApiResponse, l as isZodError } from '../types-DuA0wOpm.js';
3
3
  import { AxiosResponse, AxiosInstance } from 'axios';
4
4
  import 'zod';
5
- import '../products-Cxl54crz.js';
5
+ import '@atomic-solutions/schemas/woocommerce/store-api';
6
6
 
7
7
  interface PaginationMeta {
8
8
  total: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atomic-solutions/woocommerce-api-client",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Type-safe WooCommerce API client (framework-agnostic)",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -16,21 +16,6 @@
16
16
  "import": "./dist/client/index.mjs",
17
17
  "require": "./dist/client/index.js"
18
18
  },
19
- "./schemas": {
20
- "types": "./dist/schemas/index.d.ts",
21
- "import": "./dist/schemas/index.mjs",
22
- "require": "./dist/schemas/index.js"
23
- },
24
- "./schemas/store-api": {
25
- "types": "./dist/schemas/store-api/index.d.ts",
26
- "import": "./dist/schemas/store-api/index.mjs",
27
- "require": "./dist/schemas/store-api/index.js"
28
- },
29
- "./schemas/admin-api": {
30
- "types": "./dist/schemas/admin-api/index.d.ts",
31
- "import": "./dist/schemas/admin-api/index.mjs",
32
- "require": "./dist/schemas/admin-api/index.js"
33
- },
34
19
  "./http": {
35
20
  "types": "./dist/http/index.d.ts",
36
21
  "import": "./dist/http/index.mjs",
@@ -67,6 +52,9 @@
67
52
  "publishConfig": {
68
53
  "access": "public"
69
54
  },
55
+ "dependencies": {
56
+ "@atomic-solutions/schemas": "0.1.0"
57
+ },
70
58
  "peerDependencies": {
71
59
  "axios": ">=1.7.0",
72
60
  "zod": ">=3.0.0"
@@ -99,9 +87,6 @@
99
87
  "zod": "^3.23.0"
100
88
  },
101
89
  "sideEffects": false,
102
- "dependencies": {
103
- "@typescript-eslint/eslint-plugin": "^8.47.0"
104
- },
105
90
  "scripts": {
106
91
  "build": "tsup",
107
92
  "dev": "tsup --watch",
@@ -1,190 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- declare const addressSchema: z.ZodObject<{
4
- first_name: z.ZodString;
5
- last_name: z.ZodString;
6
- company: z.ZodString;
7
- address_1: z.ZodString;
8
- address_2: z.ZodString;
9
- city: z.ZodString;
10
- state: z.ZodString;
11
- postcode: z.ZodString;
12
- country: z.ZodString;
13
- phone: z.ZodString;
14
- }, "strip", z.ZodTypeAny, {
15
- first_name: string;
16
- last_name: string;
17
- company: string;
18
- address_1: string;
19
- address_2: string;
20
- city: string;
21
- state: string;
22
- postcode: string;
23
- country: string;
24
- phone: string;
25
- }, {
26
- first_name: string;
27
- last_name: string;
28
- company: string;
29
- address_1: string;
30
- address_2: string;
31
- city: string;
32
- state: string;
33
- postcode: string;
34
- country: string;
35
- phone: string;
36
- }>;
37
- declare const addressSchemaNonMandatory: z.ZodObject<{
38
- first_name: z.ZodString;
39
- last_name: z.ZodString;
40
- company: z.ZodString;
41
- address_1: z.ZodString;
42
- address_2: z.ZodString;
43
- city: z.ZodString;
44
- state: z.ZodString;
45
- postcode: z.ZodString;
46
- country: z.ZodString;
47
- phone: z.ZodString;
48
- }, "strip", z.ZodTypeAny, {
49
- first_name: string;
50
- last_name: string;
51
- company: string;
52
- address_1: string;
53
- address_2: string;
54
- city: string;
55
- state: string;
56
- postcode: string;
57
- country: string;
58
- phone: string;
59
- }, {
60
- first_name: string;
61
- last_name: string;
62
- company: string;
63
- address_1: string;
64
- address_2: string;
65
- city: string;
66
- state: string;
67
- postcode: string;
68
- country: string;
69
- phone: string;
70
- }>;
71
- declare const billingAddressSchemaMandatory: z.ZodObject<{
72
- first_name: z.ZodString;
73
- last_name: z.ZodString;
74
- company: z.ZodString;
75
- address_1: z.ZodString;
76
- address_2: z.ZodString;
77
- city: z.ZodString;
78
- state: z.ZodString;
79
- postcode: z.ZodString;
80
- country: z.ZodString;
81
- phone: z.ZodString;
82
- } & {
83
- email: z.ZodString;
84
- }, "strip", z.ZodTypeAny, {
85
- first_name: string;
86
- last_name: string;
87
- company: string;
88
- address_1: string;
89
- address_2: string;
90
- city: string;
91
- state: string;
92
- postcode: string;
93
- country: string;
94
- phone: string;
95
- email: string;
96
- }, {
97
- first_name: string;
98
- last_name: string;
99
- company: string;
100
- address_1: string;
101
- address_2: string;
102
- city: string;
103
- state: string;
104
- postcode: string;
105
- country: string;
106
- phone: string;
107
- email: string;
108
- }>;
109
- declare const billingAddressSchemaNonMandatory: z.ZodObject<{
110
- first_name: z.ZodString;
111
- last_name: z.ZodString;
112
- company: z.ZodString;
113
- address_1: z.ZodString;
114
- address_2: z.ZodString;
115
- city: z.ZodString;
116
- state: z.ZodString;
117
- postcode: z.ZodString;
118
- country: z.ZodString;
119
- phone: z.ZodString;
120
- } & {
121
- email: z.ZodNullable<z.ZodString>;
122
- }, "strip", z.ZodTypeAny, {
123
- first_name: string;
124
- last_name: string;
125
- company: string;
126
- address_1: string;
127
- address_2: string;
128
- city: string;
129
- state: string;
130
- postcode: string;
131
- country: string;
132
- phone: string;
133
- email: string | null;
134
- }, {
135
- first_name: string;
136
- last_name: string;
137
- company: string;
138
- address_1: string;
139
- address_2: string;
140
- city: string;
141
- state: string;
142
- postcode: string;
143
- country: string;
144
- phone: string;
145
- email: string | null;
146
- }>;
147
- type Address = z.infer<typeof addressSchema>;
148
- type BillingAddress = z.infer<typeof billingAddressSchemaMandatory>;
149
- type AddressNonOptional = z.infer<typeof addressSchemaNonMandatory>;
150
- type BillingAddressNonOptional = z.infer<typeof billingAddressSchemaNonMandatory>;
151
-
152
- declare const paginationParamsSchema: z.ZodObject<{
153
- page: z.ZodOptional<z.ZodNumber>;
154
- per_page: z.ZodOptional<z.ZodNumber>;
155
- offset: z.ZodOptional<z.ZodNumber>;
156
- order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
157
- orderby: z.ZodOptional<z.ZodString>;
158
- }, "strip", z.ZodTypeAny, {
159
- page?: number | undefined;
160
- per_page?: number | undefined;
161
- offset?: number | undefined;
162
- order?: "asc" | "desc" | undefined;
163
- orderby?: string | undefined;
164
- }, {
165
- page?: number | undefined;
166
- per_page?: number | undefined;
167
- offset?: number | undefined;
168
- order?: "asc" | "desc" | undefined;
169
- orderby?: string | undefined;
170
- }>;
171
- declare const paginationMetaSchema: z.ZodObject<{
172
- total: z.ZodNumber;
173
- totalPages: z.ZodNumber;
174
- currentPage: z.ZodNumber;
175
- perPage: z.ZodNumber;
176
- }, "strip", z.ZodTypeAny, {
177
- total: number;
178
- perPage: number;
179
- totalPages: number;
180
- currentPage: number;
181
- }, {
182
- total: number;
183
- perPage: number;
184
- totalPages: number;
185
- currentPage: number;
186
- }>;
187
- type PaginationParams = z.infer<typeof paginationParamsSchema>;
188
- type PaginationMeta = z.infer<typeof paginationMetaSchema>;
189
-
190
- export { type Address as A, type BillingAddress as B, type PaginationMeta as P, type PaginationParams as a, addressSchema as b, billingAddressSchemaMandatory as c, paginationParamsSchema as d, type AddressNonOptional as e, type BillingAddressNonOptional as f, addressSchemaNonMandatory as g, billingAddressSchemaNonMandatory as h, paginationMetaSchema as p };
@@ -1,190 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- declare const addressSchema: z.ZodObject<{
4
- first_name: z.ZodString;
5
- last_name: z.ZodString;
6
- company: z.ZodString;
7
- address_1: z.ZodString;
8
- address_2: z.ZodString;
9
- city: z.ZodString;
10
- state: z.ZodString;
11
- postcode: z.ZodString;
12
- country: z.ZodString;
13
- phone: z.ZodString;
14
- }, "strip", z.ZodTypeAny, {
15
- first_name: string;
16
- last_name: string;
17
- company: string;
18
- address_1: string;
19
- address_2: string;
20
- city: string;
21
- state: string;
22
- postcode: string;
23
- country: string;
24
- phone: string;
25
- }, {
26
- first_name: string;
27
- last_name: string;
28
- company: string;
29
- address_1: string;
30
- address_2: string;
31
- city: string;
32
- state: string;
33
- postcode: string;
34
- country: string;
35
- phone: string;
36
- }>;
37
- declare const addressSchemaNonMandatory: z.ZodObject<{
38
- first_name: z.ZodString;
39
- last_name: z.ZodString;
40
- company: z.ZodString;
41
- address_1: z.ZodString;
42
- address_2: z.ZodString;
43
- city: z.ZodString;
44
- state: z.ZodString;
45
- postcode: z.ZodString;
46
- country: z.ZodString;
47
- phone: z.ZodString;
48
- }, "strip", z.ZodTypeAny, {
49
- first_name: string;
50
- last_name: string;
51
- company: string;
52
- address_1: string;
53
- address_2: string;
54
- city: string;
55
- state: string;
56
- postcode: string;
57
- country: string;
58
- phone: string;
59
- }, {
60
- first_name: string;
61
- last_name: string;
62
- company: string;
63
- address_1: string;
64
- address_2: string;
65
- city: string;
66
- state: string;
67
- postcode: string;
68
- country: string;
69
- phone: string;
70
- }>;
71
- declare const billingAddressSchemaMandatory: z.ZodObject<{
72
- first_name: z.ZodString;
73
- last_name: z.ZodString;
74
- company: z.ZodString;
75
- address_1: z.ZodString;
76
- address_2: z.ZodString;
77
- city: z.ZodString;
78
- state: z.ZodString;
79
- postcode: z.ZodString;
80
- country: z.ZodString;
81
- phone: z.ZodString;
82
- } & {
83
- email: z.ZodString;
84
- }, "strip", z.ZodTypeAny, {
85
- first_name: string;
86
- last_name: string;
87
- company: string;
88
- address_1: string;
89
- address_2: string;
90
- city: string;
91
- state: string;
92
- postcode: string;
93
- country: string;
94
- phone: string;
95
- email: string;
96
- }, {
97
- first_name: string;
98
- last_name: string;
99
- company: string;
100
- address_1: string;
101
- address_2: string;
102
- city: string;
103
- state: string;
104
- postcode: string;
105
- country: string;
106
- phone: string;
107
- email: string;
108
- }>;
109
- declare const billingAddressSchemaNonMandatory: z.ZodObject<{
110
- first_name: z.ZodString;
111
- last_name: z.ZodString;
112
- company: z.ZodString;
113
- address_1: z.ZodString;
114
- address_2: z.ZodString;
115
- city: z.ZodString;
116
- state: z.ZodString;
117
- postcode: z.ZodString;
118
- country: z.ZodString;
119
- phone: z.ZodString;
120
- } & {
121
- email: z.ZodNullable<z.ZodString>;
122
- }, "strip", z.ZodTypeAny, {
123
- first_name: string;
124
- last_name: string;
125
- company: string;
126
- address_1: string;
127
- address_2: string;
128
- city: string;
129
- state: string;
130
- postcode: string;
131
- country: string;
132
- phone: string;
133
- email: string | null;
134
- }, {
135
- first_name: string;
136
- last_name: string;
137
- company: string;
138
- address_1: string;
139
- address_2: string;
140
- city: string;
141
- state: string;
142
- postcode: string;
143
- country: string;
144
- phone: string;
145
- email: string | null;
146
- }>;
147
- type Address = z.infer<typeof addressSchema>;
148
- type BillingAddress = z.infer<typeof billingAddressSchemaMandatory>;
149
- type AddressNonOptional = z.infer<typeof addressSchemaNonMandatory>;
150
- type BillingAddressNonOptional = z.infer<typeof billingAddressSchemaNonMandatory>;
151
-
152
- declare const paginationParamsSchema: z.ZodObject<{
153
- page: z.ZodOptional<z.ZodNumber>;
154
- per_page: z.ZodOptional<z.ZodNumber>;
155
- offset: z.ZodOptional<z.ZodNumber>;
156
- order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
157
- orderby: z.ZodOptional<z.ZodString>;
158
- }, "strip", z.ZodTypeAny, {
159
- page?: number | undefined;
160
- per_page?: number | undefined;
161
- offset?: number | undefined;
162
- order?: "asc" | "desc" | undefined;
163
- orderby?: string | undefined;
164
- }, {
165
- page?: number | undefined;
166
- per_page?: number | undefined;
167
- offset?: number | undefined;
168
- order?: "asc" | "desc" | undefined;
169
- orderby?: string | undefined;
170
- }>;
171
- declare const paginationMetaSchema: z.ZodObject<{
172
- total: z.ZodNumber;
173
- totalPages: z.ZodNumber;
174
- currentPage: z.ZodNumber;
175
- perPage: z.ZodNumber;
176
- }, "strip", z.ZodTypeAny, {
177
- total: number;
178
- perPage: number;
179
- totalPages: number;
180
- currentPage: number;
181
- }, {
182
- total: number;
183
- perPage: number;
184
- totalPages: number;
185
- currentPage: number;
186
- }>;
187
- type PaginationParams = z.infer<typeof paginationParamsSchema>;
188
- type PaginationMeta = z.infer<typeof paginationMetaSchema>;
189
-
190
- export { type Address as A, type BillingAddress as B, type PaginationMeta as P, type PaginationParams as a, addressSchema as b, billingAddressSchemaMandatory as c, paginationParamsSchema as d, type AddressNonOptional as e, type BillingAddressNonOptional as f, addressSchemaNonMandatory as g, billingAddressSchemaNonMandatory as h, paginationMetaSchema as p };