@typewoo/sdk 3.0.0-alpha.0 → 3.0.0-alpha.1

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/README.md CHANGED
@@ -1,18 +1,18 @@
1
- # TypeWoo for WooCommerce
2
-
3
- A modern, TypeScript-first SDK for integrating with the **WooCommerce Store API**.
4
- This library provides typed client utilities and convenient abstractions to simplify working with WooCommerce headless or decoupled storefronts.
5
-
6
- ## ✨ Features
7
-
8
- - 📦 Easy-to-use API for WooCommerce Store endpoints
9
- - 🔐 Supports both guest and authenticated users
10
- - 🧩 Modular design — import only what you need
11
- - 🛠️ Type-safe responses powered by TypeScript
12
- - ⚙️ Built with modern tooling (NX, Vitest)
13
-
14
- ## 📦 Installation
15
-
16
- ```bash
17
- npm install @typewoo/core
18
- ```
1
+ # TypeWoo for WooCommerce
2
+
3
+ A modern, TypeScript-first SDK for integrating with the **WooCommerce Store API**.
4
+ This library provides typed client utilities and convenient abstractions to simplify working with WooCommerce headless or decoupled storefronts.
5
+
6
+ ## ✨ Features
7
+
8
+ - 📦 Easy-to-use API for WooCommerce Store endpoints
9
+ - 🔐 Supports both guest and authenticated users
10
+ - 🧩 Modular design — import only what you need
11
+ - 🛠️ Type-safe responses powered by TypeScript
12
+ - ⚙️ Built with modern tooling (NX, Vitest)
13
+
14
+ ## 📦 Installation
15
+
16
+ ```bash
17
+ npm install @typewoo/core
18
+ ```
@@ -111,8 +111,8 @@ export declare const AdminProductAttributeTermQueryParamsSchema: z.ZodObject<{
111
111
  description: "description";
112
112
  slug: "slug";
113
113
  include: "include";
114
- term_group: "term_group";
115
114
  count: "count";
115
+ term_group: "term_group";
116
116
  }>>;
117
117
  hide_empty: z.ZodOptional<z.ZodBoolean>;
118
118
  parent: z.ZodOptional<z.ZodNumber>;
@@ -110,12 +110,12 @@ export declare const AdminCouponQueryParamsSchema: z.ZodObject<{
110
110
  desc: "desc";
111
111
  }>>;
112
112
  orderby: z.ZodOptional<z.ZodEnum<{
113
- id: "id";
114
113
  date: "date";
115
- title: "title";
114
+ id: "id";
116
115
  slug: "slug";
117
- include: "include";
118
116
  modified: "modified";
117
+ include: "include";
118
+ title: "title";
119
119
  }>>;
120
120
  code: z.ZodOptional<z.ZodString>;
121
121
  }, z.core.$strip>;
@@ -120,11 +120,11 @@ export declare const AdminCustomerQueryParamsSchema: z.ZodObject<{
120
120
  }>>;
121
121
  email: z.ZodOptional<z.ZodString>;
122
122
  role: z.ZodOptional<z.ZodEnum<{
123
- all: "all";
124
123
  customer: "customer";
124
+ author: "author";
125
+ all: "all";
125
126
  administrator: "administrator";
126
127
  editor: "editor";
127
- author: "author";
128
128
  contributor: "contributor";
129
129
  subscriber: "subscriber";
130
130
  shop_manager: "shop_manager";
@@ -549,18 +549,17 @@ export declare const AdminOrderQueryParamsSchema: z.ZodObject<{
549
549
  desc: "desc";
550
550
  }>>;
551
551
  orderby: z.ZodOptional<z.ZodEnum<{
552
- id: "id";
553
552
  date: "date";
554
- title: "title";
553
+ id: "id";
555
554
  slug: "slug";
556
- include: "include";
557
555
  modified: "modified";
556
+ include: "include";
557
+ title: "title";
558
558
  }>>;
559
559
  parent: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
560
560
  parent_exclude: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
561
561
  status: z.ZodOptional<z.ZodEnum<{
562
562
  any: "any";
563
- trash: "trash";
564
563
  pending: "pending";
565
564
  processing: "processing";
566
565
  "on-hold": "on-hold";
@@ -569,6 +568,7 @@ export declare const AdminOrderQueryParamsSchema: z.ZodObject<{
569
568
  refunded: "refunded";
570
569
  failed: "failed";
571
570
  "checkout-draft": "checkout-draft";
571
+ trash: "trash";
572
572
  }>>;
573
573
  customer: z.ZodOptional<z.ZodNumber>;
574
574
  product: z.ZodOptional<z.ZodNumber>;
@@ -80,8 +80,8 @@ export declare const AdminBrandQueryParamsSchema: z.ZodObject<{
80
80
  description: "description";
81
81
  slug: "slug";
82
82
  include: "include";
83
- term_group: "term_group";
84
83
  count: "count";
84
+ term_group: "term_group";
85
85
  }>>;
86
86
  hide_empty: z.ZodOptional<z.ZodBoolean>;
87
87
  parent: z.ZodOptional<z.ZodNumber>;
@@ -7,11 +7,11 @@ export declare const AdminProductReviewSchema: z.ZodObject<{
7
7
  product_name: z.ZodString;
8
8
  product_permalink: z.ZodString;
9
9
  status: z.ZodEnum<{
10
+ trash: "trash";
10
11
  approved: "approved";
11
12
  hold: "hold";
12
13
  spam: "spam";
13
14
  unspam: "unspam";
14
- trash: "trash";
15
15
  untrash: "untrash";
16
16
  }>;
17
17
  reviewer: z.ZodString;
@@ -41,11 +41,11 @@ export declare const AdminProductReviewRequestSchema: z.ZodObject<{
41
41
  product_id: z.ZodOptional<z.ZodNumber>;
42
42
  product_name: z.ZodOptional<z.ZodString>;
43
43
  status: z.ZodOptional<z.ZodEnum<{
44
+ trash: "trash";
44
45
  approved: "approved";
45
46
  hold: "hold";
46
47
  spam: "spam";
47
48
  unspam: "unspam";
48
- trash: "trash";
49
49
  untrash: "untrash";
50
50
  }>>;
51
51
  reviewer: z.ZodOptional<z.ZodString>;
@@ -72,11 +72,11 @@ export declare const AdminProductReviewQueryParamsSchema: z.ZodObject<{
72
72
  desc: "desc";
73
73
  }>>;
74
74
  orderby: z.ZodOptional<z.ZodEnum<{
75
- id: "id";
76
75
  date: "date";
77
- product: "product";
78
- include: "include";
76
+ id: "id";
79
77
  date_gmt: "date_gmt";
78
+ include: "include";
79
+ product: "product";
80
80
  }>>;
81
81
  reviewer: z.ZodOptional<z.ZodArray<z.ZodString>>;
82
82
  reviewer_exclude: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
@@ -75,8 +75,8 @@ export declare const AdminProductSchema: z.ZodObject<{
75
75
  variable: "variable";
76
76
  }>;
77
77
  status: z.ZodEnum<{
78
- pending: "pending";
79
78
  draft: "draft";
79
+ pending: "pending";
80
80
  private: "private";
81
81
  publish: "publish";
82
82
  }>;
@@ -113,8 +113,8 @@ export declare const AdminProductSchema: z.ZodObject<{
113
113
  external_url: z.ZodString;
114
114
  button_text: z.ZodString;
115
115
  tax_status: z.ZodEnum<{
116
- shipping: "shipping";
117
116
  taxable: "taxable";
117
+ shipping: "shipping";
118
118
  none: "none";
119
119
  }>;
120
120
  tax_class: z.ZodString;
@@ -244,8 +244,8 @@ export declare const AdminProductVariationSchema: z.ZodObject<{
244
244
  download_limit: z.ZodNumber;
245
245
  download_expiry: z.ZodNumber;
246
246
  tax_status: z.ZodEnum<{
247
- shipping: "shipping";
248
247
  taxable: "taxable";
248
+ shipping: "shipping";
249
249
  none: "none";
250
250
  }>;
251
251
  tax_class: z.ZodString;
@@ -316,8 +316,8 @@ export declare const AdminProductRequestSchema: z.ZodObject<{
316
316
  variable: "variable";
317
317
  }>>;
318
318
  status: z.ZodOptional<z.ZodEnum<{
319
- pending: "pending";
320
319
  draft: "draft";
320
+ pending: "pending";
321
321
  private: "private";
322
322
  publish: "publish";
323
323
  }>>;
@@ -349,8 +349,8 @@ export declare const AdminProductRequestSchema: z.ZodObject<{
349
349
  external_url: z.ZodOptional<z.ZodString>;
350
350
  button_text: z.ZodOptional<z.ZodString>;
351
351
  tax_status: z.ZodOptional<z.ZodEnum<{
352
- shipping: "shipping";
353
352
  taxable: "taxable";
353
+ shipping: "shipping";
354
354
  none: "none";
355
355
  }>>;
356
356
  tax_class: z.ZodOptional<z.ZodString>;
@@ -444,12 +444,12 @@ export declare const AdminProductQueryParamsSchema: z.ZodObject<{
444
444
  desc: "desc";
445
445
  }>>;
446
446
  orderby: z.ZodOptional<z.ZodEnum<{
447
- id: "id";
448
447
  date: "date";
449
- title: "title";
448
+ id: "id";
450
449
  slug: "slug";
451
- include: "include";
452
450
  modified: "modified";
451
+ include: "include";
452
+ title: "title";
453
453
  menu_order: "menu_order";
454
454
  }>>;
455
455
  parent: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
@@ -457,12 +457,12 @@ export declare const AdminProductQueryParamsSchema: z.ZodObject<{
457
457
  slug: z.ZodOptional<z.ZodString>;
458
458
  status: z.ZodOptional<z.ZodEnum<{
459
459
  any: "any";
460
- trash: "trash";
461
- pending: "pending";
462
- future: "future";
463
460
  draft: "draft";
461
+ pending: "pending";
464
462
  private: "private";
465
463
  publish: "publish";
464
+ future: "future";
465
+ trash: "trash";
466
466
  }>>;
467
467
  type: z.ZodOptional<z.ZodEnum<{
468
468
  simple: "simple";
@@ -204,12 +204,12 @@ export declare const AdminRefundQueryParamsSchema: z.ZodObject<{
204
204
  desc: "desc";
205
205
  }>>;
206
206
  orderby: z.ZodOptional<z.ZodEnum<{
207
- id: "id";
208
207
  date: "date";
209
- title: "title";
208
+ id: "id";
210
209
  slug: "slug";
211
- include: "include";
212
210
  modified: "modified";
211
+ include: "include";
212
+ title: "title";
213
213
  }>>;
214
214
  parent: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
215
215
  parent_exclude: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
@@ -7,8 +7,8 @@ export declare const AdminSettingSchema: z.ZodObject<{
7
7
  number: "number";
8
8
  email: "email";
9
9
  text: "text";
10
- color: "color";
11
10
  password: "password";
11
+ color: "color";
12
12
  textarea: "textarea";
13
13
  select: "select";
14
14
  multiselect: "multiselect";
@@ -62,8 +62,8 @@ export declare const AdminTaxQueryParamsSchema: z.ZodObject<{
62
62
  }>>;
63
63
  orderby: z.ZodOptional<z.ZodEnum<{
64
64
  id: "id";
65
- priority: "priority";
66
65
  order: "order";
66
+ priority: "priority";
67
67
  }>>;
68
68
  class: z.ZodOptional<z.ZodEnum<{
69
69
  standard: "standard";
@@ -100,8 +100,8 @@ export declare const AdminTaxonomyCategoryQueryParamsSchema: z.ZodObject<{
100
100
  description: "description";
101
101
  slug: "slug";
102
102
  include: "include";
103
- term_group: "term_group";
104
103
  count: "count";
104
+ term_group: "term_group";
105
105
  }>>;
106
106
  hide_empty: z.ZodOptional<z.ZodBoolean>;
107
107
  parent: z.ZodOptional<z.ZodNumber>;
@@ -161,8 +161,8 @@ export declare const AdminTaxonomyTagQueryParamsSchema: z.ZodObject<{
161
161
  description: "description";
162
162
  slug: "slug";
163
163
  include: "include";
164
- term_group: "term_group";
165
164
  count: "count";
165
+ term_group: "term_group";
166
166
  }>>;
167
167
  hide_empty: z.ZodOptional<z.ZodBoolean>;
168
168
  parent: z.ZodOptional<z.ZodNumber>;
@@ -222,8 +222,8 @@ export declare const AdminShippingClassQueryParamsSchema: z.ZodObject<{
222
222
  description: "description";
223
223
  slug: "slug";
224
224
  include: "include";
225
- term_group: "term_group";
226
225
  count: "count";
226
+ term_group: "term_group";
227
227
  }>>;
228
228
  hide_empty: z.ZodOptional<z.ZodBoolean>;
229
229
  parent: z.ZodOptional<z.ZodNumber>;
@@ -57,8 +57,8 @@ export declare const AdminWebhookQueryParamsSchema: z.ZodObject<{
57
57
  desc: "desc";
58
58
  }>>;
59
59
  orderby: z.ZodOptional<z.ZodEnum<{
60
- id: "id";
61
60
  date: "date";
61
+ id: "id";
62
62
  title: "title";
63
63
  }>>;
64
64
  status: z.ZodOptional<z.ZodEnum<{
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { CartResponseSchema } from './store';
2
+ import { CartResponseSchema } from './store/index.js';
3
3
  export const SdkStateSchema = z.object({
4
4
  cart: CartResponseSchema.optional(),
5
5
  nonce: z.string().optional(),
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.state.js","sourceRoot":"","sources":["../../../src/lib/types/sdk.state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,IAAI,EAAE,kBAAkB,CAAC,QAAQ,EAAE;IACnC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACtC,CAAC,CAAC"}
1
+ {"version":3,"file":"sdk.state.js","sourceRoot":"","sources":["../../../src/lib/types/sdk.state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,IAAI,EAAE,kBAAkB,CAAC,QAAQ,EAAE;IACnC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACtC,CAAC,CAAC"}
@@ -1,10 +1,10 @@
1
1
  import { z } from 'zod';
2
2
  export declare const BatchRequestItemSchema: z.ZodObject<{
3
3
  method: z.ZodEnum<{
4
- DELETE: "DELETE";
5
4
  POST: "POST";
6
5
  PUT: "PUT";
7
6
  PATCH: "PATCH";
7
+ DELETE: "DELETE";
8
8
  }>;
9
9
  path: z.ZodString;
10
10
  body: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -18,10 +18,10 @@ export declare const BatchRequestSchema: z.ZodObject<{
18
18
  }>>;
19
19
  requests: z.ZodArray<z.ZodObject<{
20
20
  method: z.ZodEnum<{
21
- DELETE: "DELETE";
22
21
  POST: "POST";
23
22
  PUT: "PUT";
24
23
  PATCH: "PATCH";
24
+ DELETE: "DELETE";
25
25
  }>;
26
26
  path: z.ZodString;
27
27
  body: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -8,8 +8,8 @@ export declare const ProductRequestSchema: z.ZodObject<{
8
8
  before: z.ZodOptional<z.ZodString>;
9
9
  date_column: z.ZodOptional<z.ZodEnum<{
10
10
  date: "date";
11
- modified: "modified";
12
11
  date_gmt: "date_gmt";
12
+ modified: "modified";
13
13
  modified_gmt: "modified_gmt";
14
14
  }>>;
15
15
  exclude: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
@@ -20,16 +20,16 @@ export declare const ProductRequestSchema: z.ZodObject<{
20
20
  desc: "desc";
21
21
  }>>;
22
22
  orderby: z.ZodOptional<z.ZodEnum<{
23
- id: "id";
24
23
  date: "date";
24
+ id: "id";
25
25
  price: "price";
26
- title: "title";
27
26
  slug: "slug";
28
- include: "include";
29
27
  modified: "modified";
28
+ include: "include";
29
+ title: "title";
30
+ popularity: "popularity";
30
31
  rating: "rating";
31
32
  menu_order: "menu_order";
32
- popularity: "popularity";
33
33
  comment_count: "comment_count";
34
34
  }>>;
35
35
  parent: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
@@ -9,9 +9,9 @@ export declare const ProductAttributeTermRequestSchema: z.ZodObject<{
9
9
  id: "id";
10
10
  name: "name";
11
11
  slug: "slug";
12
- count: "count";
13
12
  menu_order: "menu_order";
14
13
  name_num: "name_num";
14
+ count: "count";
15
15
  }>;
16
16
  }, z.core.$strip>;
17
17
  export type ProductAttributeTermRequest = z.infer<typeof ProductAttributeTermRequestSchema>;
@@ -8,11 +8,11 @@ export declare const ProductReviewRequestSchema: z.ZodObject<{
8
8
  desc: "desc";
9
9
  }>>;
10
10
  orderby: z.ZodOptional<z.ZodEnum<{
11
- id: "id";
12
11
  date: "date";
13
- product: "product";
12
+ id: "id";
14
13
  date_gmt: "date_gmt";
15
14
  rating: "rating";
15
+ product: "product";
16
16
  }>>;
17
17
  category_id: z.ZodOptional<z.ZodString>;
18
18
  product_id: z.ZodOptional<z.ZodString>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typewoo/sdk",
3
- "version": "3.0.0-alpha.0",
3
+ "version": "3.0.0-alpha.1",
4
4
  "repository": {
5
5
  "url": "https://github.com/typewoo/sdk",
6
6
  "directory": ""