@whatalo/plugin-sdk 1.0.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.
Files changed (55) hide show
  1. package/dist/adapters/express.cjs +87 -0
  2. package/dist/adapters/express.cjs.map +1 -0
  3. package/dist/adapters/express.d.cts +17 -0
  4. package/dist/adapters/express.d.ts +17 -0
  5. package/dist/adapters/express.mjs +60 -0
  6. package/dist/adapters/express.mjs.map +1 -0
  7. package/dist/adapters/hono.cjs +79 -0
  8. package/dist/adapters/hono.cjs.map +1 -0
  9. package/dist/adapters/hono.d.cts +15 -0
  10. package/dist/adapters/hono.d.ts +15 -0
  11. package/dist/adapters/hono.mjs +52 -0
  12. package/dist/adapters/hono.mjs.map +1 -0
  13. package/dist/adapters/nextjs.cjs +79 -0
  14. package/dist/adapters/nextjs.cjs.map +1 -0
  15. package/dist/adapters/nextjs.d.cts +7 -0
  16. package/dist/adapters/nextjs.d.ts +7 -0
  17. package/dist/adapters/nextjs.mjs +52 -0
  18. package/dist/adapters/nextjs.mjs.map +1 -0
  19. package/dist/bridge/index.cjs +290 -0
  20. package/dist/bridge/index.cjs.map +1 -0
  21. package/dist/bridge/index.d.cts +236 -0
  22. package/dist/bridge/index.d.ts +236 -0
  23. package/dist/bridge/index.mjs +260 -0
  24. package/dist/bridge/index.mjs.map +1 -0
  25. package/dist/client/index.cjs +423 -0
  26. package/dist/client/index.cjs.map +1 -0
  27. package/dist/client/index.d.cts +131 -0
  28. package/dist/client/index.d.ts +131 -0
  29. package/dist/client/index.mjs +396 -0
  30. package/dist/client/index.mjs.map +1 -0
  31. package/dist/index.cjs +843 -0
  32. package/dist/index.cjs.map +1 -0
  33. package/dist/index.d.cts +57 -0
  34. package/dist/index.d.ts +57 -0
  35. package/dist/index.mjs +801 -0
  36. package/dist/index.mjs.map +1 -0
  37. package/dist/manifest/index.cjs +145 -0
  38. package/dist/manifest/index.cjs.map +1 -0
  39. package/dist/manifest/index.d.cts +78 -0
  40. package/dist/manifest/index.d.ts +78 -0
  41. package/dist/manifest/index.mjs +117 -0
  42. package/dist/manifest/index.mjs.map +1 -0
  43. package/dist/types-D2Efg3EG.d.ts +19 -0
  44. package/dist/types-DZ659i6f.d.ts +68 -0
  45. package/dist/types-Db_BeRCj.d.cts +19 -0
  46. package/dist/types-DdqKKyqX.d.cts +68 -0
  47. package/dist/types-M1eLMz6w.d.cts +279 -0
  48. package/dist/types-M1eLMz6w.d.ts +279 -0
  49. package/dist/webhooks/index.cjs +50 -0
  50. package/dist/webhooks/index.cjs.map +1 -0
  51. package/dist/webhooks/index.d.cts +18 -0
  52. package/dist/webhooks/index.d.ts +18 -0
  53. package/dist/webhooks/index.mjs +23 -0
  54. package/dist/webhooks/index.mjs.map +1 -0
  55. package/package.json +94 -0
@@ -0,0 +1,68 @@
1
+ import { O as Order, a as Product, d as Customer } from './types-M1eLMz6w.js';
2
+
3
+ /** All supported webhook event types */
4
+ type WebhookEvent = "order.created" | "order.updated" | "order.status_changed" | "order.cancelled" | "product.created" | "product.updated" | "product.deleted" | "customer.created" | "customer.updated" | "inventory.low" | "inventory.adjusted" | "app.installed" | "app.uninstalled";
5
+ /** Map of webhook events to their payload data shapes */
6
+ interface WebhookEventData {
7
+ "order.created": {
8
+ order: Order;
9
+ };
10
+ "order.updated": {
11
+ order: Order;
12
+ changes: string[];
13
+ };
14
+ "order.status_changed": {
15
+ orderId: string;
16
+ previousStatus: string;
17
+ newStatus: string;
18
+ };
19
+ "order.cancelled": {
20
+ orderId: string;
21
+ reason?: string;
22
+ };
23
+ "product.created": {
24
+ product: Product;
25
+ };
26
+ "product.updated": {
27
+ product: Product;
28
+ changes: string[];
29
+ };
30
+ "product.deleted": {
31
+ productId: string;
32
+ };
33
+ "customer.created": {
34
+ customer: Customer;
35
+ };
36
+ "customer.updated": {
37
+ customer: Customer;
38
+ changes: string[];
39
+ };
40
+ "inventory.low": {
41
+ productId: string;
42
+ currentQuantity: number;
43
+ threshold: number;
44
+ };
45
+ "inventory.adjusted": {
46
+ productId: string;
47
+ previousQuantity: number;
48
+ newQuantity: number;
49
+ reason: string;
50
+ };
51
+ "app.installed": {
52
+ storeId: string;
53
+ installedAt: string;
54
+ };
55
+ "app.uninstalled": {
56
+ storeId: string;
57
+ uninstalledAt: string;
58
+ };
59
+ }
60
+ /** Typed webhook payload delivered to subscriber endpoints */
61
+ interface WebhookPayload<E extends WebhookEvent = WebhookEvent> {
62
+ event: E;
63
+ timestamp: string;
64
+ storeId: string;
65
+ data: WebhookEventData[E];
66
+ }
67
+
68
+ export type { WebhookEvent as W, WebhookPayload as a, WebhookEventData as b };
@@ -0,0 +1,19 @@
1
+ import { W as WebhookEvent, a as WebhookPayload } from './types-DdqKKyqX.cjs';
2
+
3
+ /** Handler function for a specific webhook event */
4
+ type WebhookEventHandler<E extends WebhookEvent> = (payload: WebhookPayload<E>) => Promise<void> | void;
5
+ /** Map of event names to handler functions */
6
+ type WebhookHandlers = {
7
+ [E in WebhookEvent]?: WebhookEventHandler<E>;
8
+ };
9
+ /** Options for creating a webhook handler */
10
+ interface WebhookHandlerOptions {
11
+ /** The webhook signing secret */
12
+ secret: string;
13
+ /** Event handler map */
14
+ handlers: WebhookHandlers;
15
+ /** Called when an event has no registered handler */
16
+ onUnhandledEvent?: (event: string, payload: WebhookPayload) => Promise<void> | void;
17
+ }
18
+
19
+ export type { WebhookHandlerOptions as W };
@@ -0,0 +1,68 @@
1
+ import { O as Order, a as Product, d as Customer } from './types-M1eLMz6w.cjs';
2
+
3
+ /** All supported webhook event types */
4
+ type WebhookEvent = "order.created" | "order.updated" | "order.status_changed" | "order.cancelled" | "product.created" | "product.updated" | "product.deleted" | "customer.created" | "customer.updated" | "inventory.low" | "inventory.adjusted" | "app.installed" | "app.uninstalled";
5
+ /** Map of webhook events to their payload data shapes */
6
+ interface WebhookEventData {
7
+ "order.created": {
8
+ order: Order;
9
+ };
10
+ "order.updated": {
11
+ order: Order;
12
+ changes: string[];
13
+ };
14
+ "order.status_changed": {
15
+ orderId: string;
16
+ previousStatus: string;
17
+ newStatus: string;
18
+ };
19
+ "order.cancelled": {
20
+ orderId: string;
21
+ reason?: string;
22
+ };
23
+ "product.created": {
24
+ product: Product;
25
+ };
26
+ "product.updated": {
27
+ product: Product;
28
+ changes: string[];
29
+ };
30
+ "product.deleted": {
31
+ productId: string;
32
+ };
33
+ "customer.created": {
34
+ customer: Customer;
35
+ };
36
+ "customer.updated": {
37
+ customer: Customer;
38
+ changes: string[];
39
+ };
40
+ "inventory.low": {
41
+ productId: string;
42
+ currentQuantity: number;
43
+ threshold: number;
44
+ };
45
+ "inventory.adjusted": {
46
+ productId: string;
47
+ previousQuantity: number;
48
+ newQuantity: number;
49
+ reason: string;
50
+ };
51
+ "app.installed": {
52
+ storeId: string;
53
+ installedAt: string;
54
+ };
55
+ "app.uninstalled": {
56
+ storeId: string;
57
+ uninstalledAt: string;
58
+ };
59
+ }
60
+ /** Typed webhook payload delivered to subscriber endpoints */
61
+ interface WebhookPayload<E extends WebhookEvent = WebhookEvent> {
62
+ event: E;
63
+ timestamp: string;
64
+ storeId: string;
65
+ data: WebhookEventData[E];
66
+ }
67
+
68
+ export type { WebhookEvent as W, WebhookPayload as a, WebhookEventData as b };
@@ -0,0 +1,279 @@
1
+ /** Options for initializing the WhataloClient */
2
+ interface WhataloClientOptions {
3
+ /** Store-scoped API key (wk_live_* or wk_test_*) */
4
+ apiKey: string;
5
+ /** API base URL. Defaults to https://api.whatalo.com/v1 */
6
+ baseUrl?: string;
7
+ /** Request timeout in milliseconds. Defaults to 30000 */
8
+ timeout?: number;
9
+ /** Number of automatic retries on 5xx errors. Defaults to 0 */
10
+ retries?: number;
11
+ /** Custom fetch implementation for testing or custom environments */
12
+ fetch?: typeof globalThis.fetch;
13
+ /** Hook fired before each request attempt */
14
+ onRequest?: (url: string, init: RequestInit) => void;
15
+ /** Hook fired after each received response */
16
+ onResponse?: (response: Response, durationMs: number) => void;
17
+ }
18
+ /** Rate limit info from the latest API response */
19
+ interface RateLimitInfo {
20
+ limit: number;
21
+ remaining: number;
22
+ reset: number;
23
+ }
24
+ /** Standard paginated response from list endpoints */
25
+ interface PaginatedResponse<T> {
26
+ data: T[];
27
+ pagination: {
28
+ page: number;
29
+ per_page: number;
30
+ total: number;
31
+ total_pages: number;
32
+ };
33
+ }
34
+ /** Single resource response */
35
+ interface SingleResponse<T> {
36
+ data: T;
37
+ }
38
+ /** Product resource from the API */
39
+ interface Product {
40
+ id: string;
41
+ name: string;
42
+ slug: string;
43
+ description: string | null;
44
+ price: number;
45
+ compare_price: number | null;
46
+ main_image: string | null;
47
+ gallery: string[];
48
+ is_active: boolean;
49
+ is_featured: boolean;
50
+ sku: string | null;
51
+ track_inventory: boolean;
52
+ stock_quantity: number;
53
+ condition: string;
54
+ is_purchasable: boolean;
55
+ has_discount: boolean;
56
+ discount_percentage: number;
57
+ created_at: string;
58
+ updated_at: string;
59
+ }
60
+ /** Order resource from the API */
61
+ interface Order {
62
+ id: string;
63
+ status: string;
64
+ total: number;
65
+ currency: string;
66
+ customer_name: string;
67
+ customer_phone: string;
68
+ items_count: number;
69
+ created_at: string;
70
+ updated_at: string;
71
+ }
72
+ /** Customer resource from the API */
73
+ interface Customer {
74
+ id: string;
75
+ name: string;
76
+ phone: string;
77
+ email: string | null;
78
+ orders_count: number;
79
+ total_spent: number;
80
+ created_at: string;
81
+ }
82
+ /** Category resource from the API */
83
+ interface Category {
84
+ id: string;
85
+ name: string;
86
+ slug: string;
87
+ description: string | null;
88
+ image: string | null;
89
+ products_count: number;
90
+ is_active: boolean;
91
+ position: number;
92
+ created_at: string;
93
+ updated_at: string;
94
+ }
95
+ /** Discount resource from the API */
96
+ interface Discount {
97
+ id: string;
98
+ name: string;
99
+ code: string;
100
+ type: "percentage" | "fixed";
101
+ value: number;
102
+ min_order_amount: number | null;
103
+ max_uses: number | null;
104
+ used_count: number;
105
+ starts_at: string | null;
106
+ ends_at: string | null;
107
+ is_active: boolean;
108
+ created_at: string;
109
+ }
110
+ /** Store resource from the API */
111
+ interface Store {
112
+ id: string;
113
+ name: string;
114
+ slug: string;
115
+ domain: string | null;
116
+ logo: string | null;
117
+ description: string | null;
118
+ currency: string;
119
+ country: string;
120
+ timezone: string;
121
+ is_active: boolean;
122
+ created_at: string;
123
+ }
124
+ /** Inventory details for a product */
125
+ interface InventoryItem {
126
+ product_id: string;
127
+ sku: string | null;
128
+ stock_quantity: number;
129
+ track_inventory: boolean;
130
+ low_stock_threshold: number | null;
131
+ }
132
+ /** Webhook resource from the API */
133
+ interface Webhook {
134
+ id: string;
135
+ url: string;
136
+ events: string[];
137
+ is_active: boolean;
138
+ created_at: string;
139
+ }
140
+ /** Params for listing products */
141
+ interface ListProductsParams {
142
+ page?: number;
143
+ per_page?: number;
144
+ sort?: "name" | "price" | "created_at" | "updated_at";
145
+ order?: "asc" | "desc";
146
+ search?: string;
147
+ status?: "active" | "inactive" | "all";
148
+ category_id?: string;
149
+ is_featured?: boolean;
150
+ }
151
+ /** Params for creating a product */
152
+ interface CreateProductParams {
153
+ name: string;
154
+ slug?: string;
155
+ description?: string;
156
+ price: number;
157
+ compare_price?: number | null;
158
+ category_id?: string;
159
+ main_image?: string;
160
+ gallery?: string[];
161
+ is_active?: boolean;
162
+ is_featured?: boolean;
163
+ sku?: string;
164
+ track_inventory?: boolean;
165
+ stock_quantity?: number;
166
+ condition?: "new" | "original" | "used_like_new";
167
+ }
168
+ /** Params for updating a product */
169
+ interface UpdateProductParams {
170
+ name?: string;
171
+ slug?: string;
172
+ description?: string;
173
+ price?: number;
174
+ compare_price?: number | null;
175
+ main_image?: string | null;
176
+ gallery?: string[];
177
+ is_active?: boolean;
178
+ is_featured?: boolean;
179
+ sku?: string | null;
180
+ track_inventory?: boolean;
181
+ stock_quantity?: number;
182
+ condition?: "new" | "original" | "used_like_new";
183
+ }
184
+ /** Params for listing orders */
185
+ interface ListOrdersParams {
186
+ page?: number;
187
+ per_page?: number;
188
+ sort?: string;
189
+ order?: "asc" | "desc";
190
+ status?: string;
191
+ date_from?: string;
192
+ date_to?: string;
193
+ customer_id?: string;
194
+ }
195
+ /** Params for listing customers */
196
+ interface ListCustomersParams {
197
+ page?: number;
198
+ per_page?: number;
199
+ search?: string;
200
+ }
201
+ /** Params for listing categories */
202
+ interface ListCategoriesParams {
203
+ page?: number;
204
+ per_page?: number;
205
+ sort?: "name" | "position" | "created_at" | "updated_at";
206
+ order?: "asc" | "desc";
207
+ search?: string;
208
+ status?: "active" | "inactive" | "all";
209
+ }
210
+ /** Params for creating a category */
211
+ interface CreateCategoryParams {
212
+ name: string;
213
+ slug?: string;
214
+ description?: string;
215
+ image?: string;
216
+ is_active?: boolean;
217
+ position?: number;
218
+ }
219
+ /** Params for updating a category */
220
+ interface UpdateCategoryParams {
221
+ name?: string;
222
+ slug?: string;
223
+ description?: string | null;
224
+ image?: string | null;
225
+ is_active?: boolean;
226
+ position?: number;
227
+ }
228
+ /** Params for listing discounts */
229
+ interface ListDiscountsParams {
230
+ page?: number;
231
+ per_page?: number;
232
+ sort?: "name" | "code" | "created_at" | "starts_at" | "ends_at";
233
+ order?: "asc" | "desc";
234
+ search?: string;
235
+ status?: "active" | "inactive" | "all";
236
+ type?: "percentage" | "fixed";
237
+ }
238
+ /** Params for creating a discount */
239
+ interface CreateDiscountParams {
240
+ name: string;
241
+ code: string;
242
+ type: "percentage" | "fixed";
243
+ value: number;
244
+ min_order_amount?: number | null;
245
+ max_uses?: number | null;
246
+ starts_at?: string | null;
247
+ ends_at?: string | null;
248
+ is_active?: boolean;
249
+ }
250
+ /** Params for updating a discount */
251
+ interface UpdateDiscountParams {
252
+ name?: string;
253
+ code?: string;
254
+ type?: "percentage" | "fixed";
255
+ value?: number;
256
+ min_order_amount?: number | null;
257
+ max_uses?: number | null;
258
+ starts_at?: string | null;
259
+ ends_at?: string | null;
260
+ is_active?: boolean;
261
+ }
262
+ /** Params for creating/updating webhooks */
263
+ interface UpsertWebhookParams {
264
+ url: string;
265
+ events: string[];
266
+ secret?: string;
267
+ }
268
+ /** Params for updating an existing webhook */
269
+ interface UpdateWebhookParams {
270
+ url?: string;
271
+ events?: string[];
272
+ }
273
+ /** Params for adjusting product inventory */
274
+ interface AdjustInventoryParams {
275
+ quantity: number;
276
+ reason: string;
277
+ }
278
+
279
+ export type { AdjustInventoryParams as A, CreateProductParams as C, Discount as D, InventoryItem as I, ListProductsParams as L, Order as O, PaginatedResponse as P, RateLimitInfo as R, SingleResponse as S, UpdateProductParams as U, Webhook as W, Product as a, ListOrdersParams as b, ListCustomersParams as c, Customer as d, ListCategoriesParams as e, Category as f, CreateCategoryParams as g, UpdateCategoryParams as h, ListDiscountsParams as i, CreateDiscountParams as j, UpdateDiscountParams as k, Store as l, UpsertWebhookParams as m, UpdateWebhookParams as n, WhataloClientOptions as o };
@@ -0,0 +1,279 @@
1
+ /** Options for initializing the WhataloClient */
2
+ interface WhataloClientOptions {
3
+ /** Store-scoped API key (wk_live_* or wk_test_*) */
4
+ apiKey: string;
5
+ /** API base URL. Defaults to https://api.whatalo.com/v1 */
6
+ baseUrl?: string;
7
+ /** Request timeout in milliseconds. Defaults to 30000 */
8
+ timeout?: number;
9
+ /** Number of automatic retries on 5xx errors. Defaults to 0 */
10
+ retries?: number;
11
+ /** Custom fetch implementation for testing or custom environments */
12
+ fetch?: typeof globalThis.fetch;
13
+ /** Hook fired before each request attempt */
14
+ onRequest?: (url: string, init: RequestInit) => void;
15
+ /** Hook fired after each received response */
16
+ onResponse?: (response: Response, durationMs: number) => void;
17
+ }
18
+ /** Rate limit info from the latest API response */
19
+ interface RateLimitInfo {
20
+ limit: number;
21
+ remaining: number;
22
+ reset: number;
23
+ }
24
+ /** Standard paginated response from list endpoints */
25
+ interface PaginatedResponse<T> {
26
+ data: T[];
27
+ pagination: {
28
+ page: number;
29
+ per_page: number;
30
+ total: number;
31
+ total_pages: number;
32
+ };
33
+ }
34
+ /** Single resource response */
35
+ interface SingleResponse<T> {
36
+ data: T;
37
+ }
38
+ /** Product resource from the API */
39
+ interface Product {
40
+ id: string;
41
+ name: string;
42
+ slug: string;
43
+ description: string | null;
44
+ price: number;
45
+ compare_price: number | null;
46
+ main_image: string | null;
47
+ gallery: string[];
48
+ is_active: boolean;
49
+ is_featured: boolean;
50
+ sku: string | null;
51
+ track_inventory: boolean;
52
+ stock_quantity: number;
53
+ condition: string;
54
+ is_purchasable: boolean;
55
+ has_discount: boolean;
56
+ discount_percentage: number;
57
+ created_at: string;
58
+ updated_at: string;
59
+ }
60
+ /** Order resource from the API */
61
+ interface Order {
62
+ id: string;
63
+ status: string;
64
+ total: number;
65
+ currency: string;
66
+ customer_name: string;
67
+ customer_phone: string;
68
+ items_count: number;
69
+ created_at: string;
70
+ updated_at: string;
71
+ }
72
+ /** Customer resource from the API */
73
+ interface Customer {
74
+ id: string;
75
+ name: string;
76
+ phone: string;
77
+ email: string | null;
78
+ orders_count: number;
79
+ total_spent: number;
80
+ created_at: string;
81
+ }
82
+ /** Category resource from the API */
83
+ interface Category {
84
+ id: string;
85
+ name: string;
86
+ slug: string;
87
+ description: string | null;
88
+ image: string | null;
89
+ products_count: number;
90
+ is_active: boolean;
91
+ position: number;
92
+ created_at: string;
93
+ updated_at: string;
94
+ }
95
+ /** Discount resource from the API */
96
+ interface Discount {
97
+ id: string;
98
+ name: string;
99
+ code: string;
100
+ type: "percentage" | "fixed";
101
+ value: number;
102
+ min_order_amount: number | null;
103
+ max_uses: number | null;
104
+ used_count: number;
105
+ starts_at: string | null;
106
+ ends_at: string | null;
107
+ is_active: boolean;
108
+ created_at: string;
109
+ }
110
+ /** Store resource from the API */
111
+ interface Store {
112
+ id: string;
113
+ name: string;
114
+ slug: string;
115
+ domain: string | null;
116
+ logo: string | null;
117
+ description: string | null;
118
+ currency: string;
119
+ country: string;
120
+ timezone: string;
121
+ is_active: boolean;
122
+ created_at: string;
123
+ }
124
+ /** Inventory details for a product */
125
+ interface InventoryItem {
126
+ product_id: string;
127
+ sku: string | null;
128
+ stock_quantity: number;
129
+ track_inventory: boolean;
130
+ low_stock_threshold: number | null;
131
+ }
132
+ /** Webhook resource from the API */
133
+ interface Webhook {
134
+ id: string;
135
+ url: string;
136
+ events: string[];
137
+ is_active: boolean;
138
+ created_at: string;
139
+ }
140
+ /** Params for listing products */
141
+ interface ListProductsParams {
142
+ page?: number;
143
+ per_page?: number;
144
+ sort?: "name" | "price" | "created_at" | "updated_at";
145
+ order?: "asc" | "desc";
146
+ search?: string;
147
+ status?: "active" | "inactive" | "all";
148
+ category_id?: string;
149
+ is_featured?: boolean;
150
+ }
151
+ /** Params for creating a product */
152
+ interface CreateProductParams {
153
+ name: string;
154
+ slug?: string;
155
+ description?: string;
156
+ price: number;
157
+ compare_price?: number | null;
158
+ category_id?: string;
159
+ main_image?: string;
160
+ gallery?: string[];
161
+ is_active?: boolean;
162
+ is_featured?: boolean;
163
+ sku?: string;
164
+ track_inventory?: boolean;
165
+ stock_quantity?: number;
166
+ condition?: "new" | "original" | "used_like_new";
167
+ }
168
+ /** Params for updating a product */
169
+ interface UpdateProductParams {
170
+ name?: string;
171
+ slug?: string;
172
+ description?: string;
173
+ price?: number;
174
+ compare_price?: number | null;
175
+ main_image?: string | null;
176
+ gallery?: string[];
177
+ is_active?: boolean;
178
+ is_featured?: boolean;
179
+ sku?: string | null;
180
+ track_inventory?: boolean;
181
+ stock_quantity?: number;
182
+ condition?: "new" | "original" | "used_like_new";
183
+ }
184
+ /** Params for listing orders */
185
+ interface ListOrdersParams {
186
+ page?: number;
187
+ per_page?: number;
188
+ sort?: string;
189
+ order?: "asc" | "desc";
190
+ status?: string;
191
+ date_from?: string;
192
+ date_to?: string;
193
+ customer_id?: string;
194
+ }
195
+ /** Params for listing customers */
196
+ interface ListCustomersParams {
197
+ page?: number;
198
+ per_page?: number;
199
+ search?: string;
200
+ }
201
+ /** Params for listing categories */
202
+ interface ListCategoriesParams {
203
+ page?: number;
204
+ per_page?: number;
205
+ sort?: "name" | "position" | "created_at" | "updated_at";
206
+ order?: "asc" | "desc";
207
+ search?: string;
208
+ status?: "active" | "inactive" | "all";
209
+ }
210
+ /** Params for creating a category */
211
+ interface CreateCategoryParams {
212
+ name: string;
213
+ slug?: string;
214
+ description?: string;
215
+ image?: string;
216
+ is_active?: boolean;
217
+ position?: number;
218
+ }
219
+ /** Params for updating a category */
220
+ interface UpdateCategoryParams {
221
+ name?: string;
222
+ slug?: string;
223
+ description?: string | null;
224
+ image?: string | null;
225
+ is_active?: boolean;
226
+ position?: number;
227
+ }
228
+ /** Params for listing discounts */
229
+ interface ListDiscountsParams {
230
+ page?: number;
231
+ per_page?: number;
232
+ sort?: "name" | "code" | "created_at" | "starts_at" | "ends_at";
233
+ order?: "asc" | "desc";
234
+ search?: string;
235
+ status?: "active" | "inactive" | "all";
236
+ type?: "percentage" | "fixed";
237
+ }
238
+ /** Params for creating a discount */
239
+ interface CreateDiscountParams {
240
+ name: string;
241
+ code: string;
242
+ type: "percentage" | "fixed";
243
+ value: number;
244
+ min_order_amount?: number | null;
245
+ max_uses?: number | null;
246
+ starts_at?: string | null;
247
+ ends_at?: string | null;
248
+ is_active?: boolean;
249
+ }
250
+ /** Params for updating a discount */
251
+ interface UpdateDiscountParams {
252
+ name?: string;
253
+ code?: string;
254
+ type?: "percentage" | "fixed";
255
+ value?: number;
256
+ min_order_amount?: number | null;
257
+ max_uses?: number | null;
258
+ starts_at?: string | null;
259
+ ends_at?: string | null;
260
+ is_active?: boolean;
261
+ }
262
+ /** Params for creating/updating webhooks */
263
+ interface UpsertWebhookParams {
264
+ url: string;
265
+ events: string[];
266
+ secret?: string;
267
+ }
268
+ /** Params for updating an existing webhook */
269
+ interface UpdateWebhookParams {
270
+ url?: string;
271
+ events?: string[];
272
+ }
273
+ /** Params for adjusting product inventory */
274
+ interface AdjustInventoryParams {
275
+ quantity: number;
276
+ reason: string;
277
+ }
278
+
279
+ export type { AdjustInventoryParams as A, CreateProductParams as C, Discount as D, InventoryItem as I, ListProductsParams as L, Order as O, PaginatedResponse as P, RateLimitInfo as R, SingleResponse as S, UpdateProductParams as U, Webhook as W, Product as a, ListOrdersParams as b, ListCustomersParams as c, Customer as d, ListCategoriesParams as e, Category as f, CreateCategoryParams as g, UpdateCategoryParams as h, ListDiscountsParams as i, CreateDiscountParams as j, UpdateDiscountParams as k, Store as l, UpsertWebhookParams as m, UpdateWebhookParams as n, WhataloClientOptions as o };