@inkress/admin-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.
package/dist/index.js ADDED
@@ -0,0 +1,527 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var fetch = require('cross-fetch');
6
+
7
+ class HttpClient {
8
+ constructor(config) {
9
+ this.config = {
10
+ endpoint: 'https://api.inkress.com',
11
+ apiVersion: 'v1',
12
+ clientId: '',
13
+ timeout: 30000,
14
+ retries: 0,
15
+ headers: {},
16
+ ...config,
17
+ };
18
+ }
19
+ getBaseUrl() {
20
+ const { endpoint, apiVersion } = this.config;
21
+ return `${endpoint}/api/${apiVersion}`;
22
+ }
23
+ getHeaders(additionalHeaders = {}) {
24
+ const headers = {
25
+ 'Content-Type': 'application/json',
26
+ 'Authorization': `Bearer ${this.config.bearerToken}`,
27
+ ...this.config.headers,
28
+ ...additionalHeaders,
29
+ };
30
+ // Add Client-Id header if provided
31
+ if (this.config.clientId) {
32
+ headers['Client-Id'] = this.config.clientId;
33
+ }
34
+ return headers;
35
+ }
36
+ async makeRequest(path, options = {}) {
37
+ const url = `${this.getBaseUrl()}${path}`;
38
+ const { method = 'GET', body, headers: requestHeaders, timeout } = options;
39
+ const headers = this.getHeaders(requestHeaders);
40
+ const requestTimeout = timeout || this.config.timeout;
41
+ const requestInit = {
42
+ method,
43
+ headers,
44
+ };
45
+ if (body && method !== 'GET') {
46
+ requestInit.body = typeof body === 'string' ? body : JSON.stringify(body);
47
+ }
48
+ // Create timeout promise
49
+ const timeoutPromise = new Promise((_, reject) => {
50
+ setTimeout(() => reject(new Error('Request timeout')), requestTimeout);
51
+ });
52
+ try {
53
+ const response = await Promise.race([
54
+ fetch(url, requestInit),
55
+ timeoutPromise,
56
+ ]);
57
+ if (!response.ok) {
58
+ const errorText = await response.text();
59
+ let errorData;
60
+ try {
61
+ errorData = JSON.parse(errorText);
62
+ }
63
+ catch (_a) {
64
+ errorData = { message: errorText || `HTTP ${response.status}` };
65
+ }
66
+ throw new InkressApiError(errorData.message || `HTTP ${response.status}`, response.status, errorData);
67
+ }
68
+ const responseText = await response.text();
69
+ if (!responseText) {
70
+ return { state: 'ok', data: undefined };
71
+ }
72
+ const data = JSON.parse(responseText);
73
+ return data;
74
+ }
75
+ catch (error) {
76
+ if (error instanceof InkressApiError) {
77
+ throw error;
78
+ }
79
+ throw new InkressApiError(error instanceof Error ? error.message : 'Unknown error', 0, { error });
80
+ }
81
+ }
82
+ async retryRequest(path, options = {}, retries = this.config.retries) {
83
+ try {
84
+ return await this.makeRequest(path, options);
85
+ }
86
+ catch (error) {
87
+ if (retries > 0 && this.shouldRetry(error)) {
88
+ await this.delay(1000 * (this.config.retries - retries + 1));
89
+ return this.retryRequest(path, options, retries - 1);
90
+ }
91
+ throw error;
92
+ }
93
+ }
94
+ shouldRetry(error) {
95
+ if (error instanceof InkressApiError) {
96
+ // Retry on 5xx errors and timeouts
97
+ return error.status >= 500 || error.status === 0;
98
+ }
99
+ return false;
100
+ }
101
+ delay(ms) {
102
+ return new Promise(resolve => setTimeout(resolve, ms));
103
+ }
104
+ async get(path, params) {
105
+ let url = path;
106
+ if (params) {
107
+ const searchParams = new URLSearchParams();
108
+ Object.entries(params).forEach(([key, value]) => {
109
+ if (value !== undefined && value !== null) {
110
+ searchParams.append(key, String(value));
111
+ }
112
+ });
113
+ const queryString = searchParams.toString();
114
+ if (queryString) {
115
+ url += `?${queryString}`;
116
+ }
117
+ }
118
+ return this.retryRequest(url, { method: 'GET' });
119
+ }
120
+ async post(path, body) {
121
+ return this.retryRequest(path, { method: 'POST', body });
122
+ }
123
+ async put(path, body) {
124
+ return this.retryRequest(path, { method: 'PUT', body });
125
+ }
126
+ async delete(path) {
127
+ return this.retryRequest(path, { method: 'DELETE' });
128
+ }
129
+ async patch(path, body) {
130
+ return this.retryRequest(path, { method: 'PATCH', body });
131
+ }
132
+ // Update configuration
133
+ updateConfig(newConfig) {
134
+ this.config = { ...this.config, ...newConfig };
135
+ }
136
+ // Get current configuration (without sensitive data)
137
+ getConfig() {
138
+ const { bearerToken, ...config } = this.config;
139
+ return config;
140
+ }
141
+ }
142
+ class InkressApiError extends Error {
143
+ constructor(message, status, data) {
144
+ super(message);
145
+ this.name = 'InkressApiError';
146
+ this.status = status;
147
+ this.data = data;
148
+ }
149
+ }
150
+
151
+ class MerchantsResource {
152
+ constructor(client) {
153
+ this.client = client;
154
+ }
155
+ /**
156
+ * List merchants with pagination and filtering
157
+ */
158
+ async list(params) {
159
+ return this.client.get('/merchants', params);
160
+ }
161
+ /**
162
+ * Get a specific merchant by ID
163
+ */
164
+ async get(id) {
165
+ return this.client.get(`/merchants/${id}`);
166
+ }
167
+ /**
168
+ * Create a new merchant
169
+ */
170
+ async create(data) {
171
+ return this.client.post('/merchants', data);
172
+ }
173
+ /**
174
+ * Update an existing merchant
175
+ */
176
+ async update(id, data) {
177
+ return this.client.put(`/merchants/${id}`, data);
178
+ }
179
+ }
180
+
181
+ class CategoriesResource {
182
+ constructor(client) {
183
+ this.client = client;
184
+ }
185
+ /**
186
+ * List categories with pagination and filtering
187
+ * Requires Client-Id header to be set in the configuration
188
+ */
189
+ async list(params) {
190
+ return this.client.get('/categories', params);
191
+ }
192
+ /**
193
+ * Get a specific category by ID
194
+ * Requires Client-Id header to be set in the configuration
195
+ */
196
+ async get(id) {
197
+ return this.client.get(`/categories/${id}`);
198
+ }
199
+ /**
200
+ * Create a new category
201
+ * Requires Client-Id header to be set in the configuration
202
+ */
203
+ async create(data) {
204
+ return this.client.post('/categories', data);
205
+ }
206
+ /**
207
+ * Update an existing category
208
+ * Requires Client-Id header to be set in the configuration
209
+ * Note: parent_id is immutable and cannot be changed after creation
210
+ */
211
+ async update(id, data) {
212
+ return this.client.put(`/categories/${id}`, data);
213
+ }
214
+ /**
215
+ * Delete a category
216
+ * Requires Client-Id header to be set in the configuration
217
+ * Note: Categories with assigned products or child categories cannot be deleted
218
+ */
219
+ async delete(id) {
220
+ return this.client.delete(`/categories/${id}`);
221
+ }
222
+ }
223
+
224
+ class OrdersResource {
225
+ constructor(client) {
226
+ this.client = client;
227
+ }
228
+ /**
229
+ * Create a new order
230
+ * Requires Client-Id header to be set in the configuration
231
+ */
232
+ async create(data) {
233
+ return this.client.post('/orders', data);
234
+ }
235
+ /**
236
+ * Get order details by ID
237
+ * Requires Client-Id header to be set in the configuration
238
+ */
239
+ async get(id) {
240
+ return this.client.get(`/orders/${id}`);
241
+ }
242
+ /**
243
+ * Update order status
244
+ * Requires Client-Id header to be set in the configuration
245
+ */
246
+ async update(id, data) {
247
+ return this.client.put(`/orders/${id}`, data);
248
+ }
249
+ /**
250
+ * Get order status (public endpoint - no auth required)
251
+ */
252
+ async getStatus(id) {
253
+ return this.client.get(`/orders/status/${id}`);
254
+ }
255
+ /**
256
+ * Get order list with pagination and filtering
257
+ * Supports filtering by status, kind, customer email, and date range
258
+ * Requires Client-Id header to be set in the configuration
259
+ */
260
+ async list() {
261
+ return this.client.get('/orders');
262
+ }
263
+ }
264
+
265
+ class ProductsResource {
266
+ constructor(client) {
267
+ this.client = client;
268
+ }
269
+ /**
270
+ * List products with pagination and filtering
271
+ * Requires Client-Id header to be set in the configuration
272
+ */
273
+ async list(params) {
274
+ return this.client.get('/products', params);
275
+ }
276
+ /**
277
+ * Get a specific product by ID
278
+ * Requires Client-Id header to be set in the configuration
279
+ */
280
+ async get(id) {
281
+ return this.client.get(`/products/${id}`);
282
+ }
283
+ /**
284
+ * Create a new product
285
+ * Requires Client-Id header to be set in the configuration
286
+ */
287
+ async create(data) {
288
+ return this.client.post('/products', data);
289
+ }
290
+ /**
291
+ * Update an existing product
292
+ * Requires Client-Id header to be set in the configuration
293
+ */
294
+ async update(id, data) {
295
+ return this.client.put(`/products/${id}`, data);
296
+ }
297
+ /**
298
+ * Delete a product
299
+ * Requires Client-Id header to be set in the configuration
300
+ */
301
+ async delete(id) {
302
+ return this.client.delete(`/products/${id}`);
303
+ }
304
+ }
305
+
306
+ class BillingPlansResource {
307
+ constructor(client) {
308
+ this.client = client;
309
+ }
310
+ /**
311
+ * List billing plans with pagination and filtering
312
+ * Requires Client-Id header to be set in the configuration
313
+ */
314
+ async list(params) {
315
+ return this.client.get('/billing_plans', params);
316
+ }
317
+ /**
318
+ * Get a specific billing plan by ID
319
+ * Requires Client-Id header to be set in the configuration
320
+ */
321
+ async get(id) {
322
+ return this.client.get(`/billing_plans/${id}`);
323
+ }
324
+ /**
325
+ * Create a new billing plan
326
+ * Requires Client-Id header to be set in the configuration
327
+ */
328
+ async create(data) {
329
+ return this.client.post('/billing_plans', data);
330
+ }
331
+ /**
332
+ * Update an existing billing plan
333
+ * Requires Client-Id header to be set in the configuration
334
+ */
335
+ async update(id, data) {
336
+ return this.client.put(`/billing_plans/${id}`, data);
337
+ }
338
+ /**
339
+ * Delete a billing plan
340
+ * Requires Client-Id header to be set in the configuration
341
+ */
342
+ async delete(id) {
343
+ return this.client.delete(`/billing_plans/${id}`);
344
+ }
345
+ }
346
+
347
+ class SubscriptionsResource {
348
+ constructor(client) {
349
+ this.client = client;
350
+ }
351
+ /**
352
+ * List billing subscriptions with pagination and filtering
353
+ * Requires Client-Id header to be set in the configuration
354
+ */
355
+ async list(params) {
356
+ return this.client.get('/billing_subscriptions', params);
357
+ }
358
+ /**
359
+ * Create a subscription payment link
360
+ * Requires Client-Id header to be set in the configuration
361
+ */
362
+ async createLink(data) {
363
+ return this.client.post('/billing_subscriptions/link', data);
364
+ }
365
+ /**
366
+ * Charge an existing subscription
367
+ * Requires Client-Id header to be set in the configuration
368
+ */
369
+ async charge(uid, data) {
370
+ return this.client.post(`/billing_subscriptions/${uid}/charge`, data);
371
+ }
372
+ /**
373
+ * Get subscription billing periods
374
+ * Requires Client-Id header to be set in the configuration
375
+ */
376
+ async getPeriods(uid, params) {
377
+ return this.client.get(`/billing_subscriptions/${uid}/periods`, params);
378
+ }
379
+ /**
380
+ * Cancel a subscription
381
+ * Requires Client-Id header to be set in the configuration
382
+ */
383
+ async cancel(uid, code) {
384
+ return this.client.post(`/billing_subscriptions/${uid}/cancel/${code}`);
385
+ }
386
+ }
387
+
388
+ class UsersResource {
389
+ constructor(client) {
390
+ this.client = client;
391
+ }
392
+ /**
393
+ * List users with pagination and filtering
394
+ * Requires Client-Id header to be set in the configuration
395
+ */
396
+ async list(params) {
397
+ return this.client.get('/users', params);
398
+ }
399
+ /**
400
+ * Get a specific user by ID
401
+ * Requires Client-Id header to be set in the configuration
402
+ */
403
+ async get(id) {
404
+ return this.client.get(`/users/${id}`);
405
+ }
406
+ /**
407
+ * Create a new user
408
+ * Requires Client-Id header to be set in the configuration
409
+ */
410
+ async create(data) {
411
+ return this.client.post('/users', data);
412
+ }
413
+ /**
414
+ * Update an existing user
415
+ * Requires Client-Id header to be set in the configuration
416
+ */
417
+ async update(id, data) {
418
+ return this.client.put(`/users/${id}`, data);
419
+ }
420
+ /**
421
+ * Delete a user
422
+ * Requires Client-Id header to be set in the configuration
423
+ */
424
+ async delete(id) {
425
+ return this.client.delete(`/users/${id}`);
426
+ }
427
+ }
428
+
429
+ class PublicResource {
430
+ constructor(client) {
431
+ this.client = client;
432
+ }
433
+ /**
434
+ * Get public information about a merchant by username or cname
435
+ */
436
+ async getMerchant(params) {
437
+ return this.client.get(`/public/m`, params);
438
+ }
439
+ /**
440
+ * Get merchant fees (public endpoint - no auth required)
441
+ */
442
+ async getMerchantFees(merchantUsername, params) {
443
+ return this.client.get(`/public/m/${merchantUsername}/fees`, params);
444
+ }
445
+ /**
446
+ * Get merchant products (public endpoint - no auth required)
447
+ */
448
+ async getMerchantProducts(merchantUsername, params) {
449
+ return this.client.get(`/public/m/${merchantUsername}/products`, params);
450
+ }
451
+ }
452
+
453
+ /**
454
+ * Main Inkress Commerce API SDK class
455
+ *
456
+ * @example
457
+ * ```typescript
458
+ * import { InkressSDK } from '@inkress/admin-sdk';
459
+ *
460
+ * const inkress = new InkressSDK({
461
+ * bearerToken: 'your-jwt-token',
462
+ * clientId: 'm-merchant-username', // Required for merchant-specific endpoints
463
+ * endpoint: 'https://api.inkress.com', // Optional, defaults to production
464
+ * apiVersion: 'v1', // Optional, defaults to v1
465
+ * });
466
+ *
467
+ * // List merchants
468
+ * const merchants = await inkress.merchants.list();
469
+ *
470
+ * // Get public merchant information (no auth required)
471
+ * const publicMerchant = await inkress.public.getMerchant({ username: 'merchant-username' });
472
+ *
473
+ * // List categories
474
+ * const categories = await inkress.categories.list();
475
+ *
476
+ * // Create a category
477
+ * const category = await inkress.categories.create({
478
+ * name: 'Electronics',
479
+ * description: 'Electronic devices and accessories',
480
+ * kind: 1
481
+ * });
482
+ *
483
+ * // Create an order
484
+ * const order = await inkress.orders.create({
485
+ * currency_code: 'USD',
486
+ * customer: {
487
+ * email: 'customer@example.com',
488
+ * first_name: 'John',
489
+ * last_name: 'Doe'
490
+ * },
491
+ * total: 29.99,
492
+ * reference_id: 'order-123'
493
+ * });
494
+ * ```
495
+ */
496
+ class InkressSDK {
497
+ constructor(config) {
498
+ this.client = new HttpClient(config);
499
+ // Initialize resources
500
+ this.merchants = new MerchantsResource(this.client);
501
+ this.categories = new CategoriesResource(this.client);
502
+ this.orders = new OrdersResource(this.client);
503
+ this.products = new ProductsResource(this.client);
504
+ this.billingPlans = new BillingPlansResource(this.client);
505
+ this.subscriptions = new SubscriptionsResource(this.client);
506
+ this.users = new UsersResource(this.client);
507
+ this.public = new PublicResource(this.client);
508
+ }
509
+ /**
510
+ * Update the SDK configuration
511
+ */
512
+ updateConfig(newConfig) {
513
+ this.client.updateConfig(newConfig);
514
+ }
515
+ /**
516
+ * Get current configuration (without sensitive data)
517
+ */
518
+ getConfig() {
519
+ return this.client.getConfig();
520
+ }
521
+ }
522
+
523
+ exports.HttpClient = HttpClient;
524
+ exports.InkressApiError = InkressApiError;
525
+ exports.InkressSDK = InkressSDK;
526
+ exports.default = InkressSDK;
527
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/client.ts","../src/resources/merchants.ts","../src/resources/categories.ts","../src/resources/orders.ts","../src/resources/products.ts","../src/resources/billing-plans.ts","../src/resources/subscriptions.ts","../src/resources/users.ts","../src/resources/public.ts","../src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null],"names":[],"mappings":";;;;;;MAUa,UAAU,CAAA;AAGrB,IAAA,WAAA,CAAY,MAAqB,EAAA;QAC/B,IAAI,CAAC,MAAM,GAAG;AACZ,YAAA,QAAQ,EAAE,yBAAyB;AACnC,YAAA,UAAU,EAAE,IAAI;AAChB,YAAA,QAAQ,EAAE,EAAE;AACZ,YAAA,OAAO,EAAE,KAAK;AACd,YAAA,OAAO,EAAE,CAAC;AACV,YAAA,OAAO,EAAE,EAAE;AACX,YAAA,GAAG,MAAM;SACV;;IAGK,UAAU,GAAA;QAChB,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,MAAM;AAC5C,QAAA,OAAO,CAAA,EAAG,QAAQ,CAAA,KAAA,EAAQ,UAAU,EAAE;;IAGhC,UAAU,CAAC,oBAA4C,EAAE,EAAA;AAC/D,QAAA,MAAM,OAAO,GAA2B;AACtC,YAAA,cAAc,EAAE,kBAAkB;AAClC,YAAA,eAAe,EAAE,CAAA,OAAA,EAAU,IAAI,CAAC,MAAM,CAAC,WAAW,CAAA,CAAE;AACpD,YAAA,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO;AACtB,YAAA,GAAG,iBAAiB;SACrB;;AAGD,QAAA,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;YACxB,OAAO,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ;;AAG7C,QAAA,OAAO,OAAO;;AAGR,IAAA,MAAM,WAAW,CACvB,IAAY,EACZ,UAA0B,EAAE,EAAA;QAE5B,MAAM,GAAG,GAAG,CAAA,EAAG,IAAI,CAAC,UAAU,EAAE,CAAA,EAAG,IAAI,CAAA,CAAE;A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kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC;QACrD,IAAI,CAAC,MAAM,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC;QAC7C,IAAI,CAAC,QAAQ,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC;QACjD,IAAI,CAAC,YAAY,GAAG,IAAI,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC;QACzD,IAAI,CAAC,aAAa,GAAG,IAAI,qBAAqB,CAAC,IAAI,CAAC,MAAM,CAAC;QAC3D,IAAI,CAAC,KAAK,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC;QAC3C,IAAI,CAAC,MAAM,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC;;AAG/C;;AAEG;AACH,IAAA,YAAY,CAAC,SAAiC,EAAA;AAC5C,QAAA,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC;;AAGrC;;AAEG;IACH,SAAS,GAAA;AACP,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;;AAEjC;;;;;;;"}
@@ -0,0 +1,46 @@
1
+ import { HttpClient } from '../client';
2
+ import { BillingPlan, CreateBillingPlanData, UpdateBillingPlanData, ApiResponse, PaginationParams } from '../types';
3
+ export interface BillingPlanListParams extends PaginationParams {
4
+ status?: number;
5
+ kind?: number;
6
+ limit?: number;
7
+ }
8
+ export interface BillingPlanListResponse {
9
+ entries: BillingPlan[];
10
+ page_info: {
11
+ current_page: number;
12
+ total_pages: number;
13
+ total_entries: number;
14
+ page_size: number;
15
+ };
16
+ }
17
+ export declare class BillingPlansResource {
18
+ private client;
19
+ constructor(client: HttpClient);
20
+ /**
21
+ * List billing plans with pagination and filtering
22
+ * Requires Client-Id header to be set in the configuration
23
+ */
24
+ list(params?: BillingPlanListParams): Promise<ApiResponse<BillingPlanListResponse>>;
25
+ /**
26
+ * Get a specific billing plan by ID
27
+ * Requires Client-Id header to be set in the configuration
28
+ */
29
+ get(id: number): Promise<ApiResponse<BillingPlan>>;
30
+ /**
31
+ * Create a new billing plan
32
+ * Requires Client-Id header to be set in the configuration
33
+ */
34
+ create(data: CreateBillingPlanData): Promise<ApiResponse<BillingPlan>>;
35
+ /**
36
+ * Update an existing billing plan
37
+ * Requires Client-Id header to be set in the configuration
38
+ */
39
+ update(id: number, data: UpdateBillingPlanData): Promise<ApiResponse<BillingPlan>>;
40
+ /**
41
+ * Delete a billing plan
42
+ * Requires Client-Id header to be set in the configuration
43
+ */
44
+ delete(id: number): Promise<ApiResponse<void>>;
45
+ }
46
+ //# sourceMappingURL=billing-plans.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing-plans.d.ts","sourceRoot":"","sources":["../../src/resources/billing-plans.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EACL,WAAW,EACX,qBAAqB,EACrB,qBAAqB,EACrB,WAAW,EACX,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,SAAS,EAAE;QACT,YAAY,EAAE,MAAM,CAAC;QACrB,WAAW,EAAE,MAAM,CAAC;QACpB,aAAa,EAAE,MAAM,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAED,qBAAa,oBAAoB;IACnB,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC;;;OAGG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,WAAW,CAAC,uBAAuB,CAAC,CAAC;IAIzF;;;OAGG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAIxD;;;OAGG;IACG,MAAM,CAAC,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAI5E;;;OAGG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAIxF;;;OAGG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;CAGrD"}
@@ -0,0 +1,49 @@
1
+ import { HttpClient } from '../client';
2
+ import { Category, CreateCategoryData, UpdateCategoryData, ApiResponse, PaginationParams } from '../types';
3
+ export interface CategoryListParams extends PaginationParams {
4
+ search?: string;
5
+ kind?: number;
6
+ parent_id?: number;
7
+ limit?: number;
8
+ }
9
+ export interface CategoryListResponse {
10
+ entries: Category[];
11
+ page_info: {
12
+ current_page: number;
13
+ total_pages: number;
14
+ total_entries: number;
15
+ page_size: number;
16
+ };
17
+ }
18
+ export declare class CategoriesResource {
19
+ private client;
20
+ constructor(client: HttpClient);
21
+ /**
22
+ * List categories with pagination and filtering
23
+ * Requires Client-Id header to be set in the configuration
24
+ */
25
+ list(params?: CategoryListParams): Promise<ApiResponse<CategoryListResponse>>;
26
+ /**
27
+ * Get a specific category by ID
28
+ * Requires Client-Id header to be set in the configuration
29
+ */
30
+ get(id: number): Promise<ApiResponse<Category>>;
31
+ /**
32
+ * Create a new category
33
+ * Requires Client-Id header to be set in the configuration
34
+ */
35
+ create(data: CreateCategoryData): Promise<ApiResponse<Category>>;
36
+ /**
37
+ * Update an existing category
38
+ * Requires Client-Id header to be set in the configuration
39
+ * Note: parent_id is immutable and cannot be changed after creation
40
+ */
41
+ update(id: number, data: UpdateCategoryData): Promise<ApiResponse<Category>>;
42
+ /**
43
+ * Delete a category
44
+ * Requires Client-Id header to be set in the configuration
45
+ * Note: Categories with assigned products or child categories cannot be deleted
46
+ */
47
+ delete(id: number): Promise<ApiResponse<void>>;
48
+ }
49
+ //# sourceMappingURL=categories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"categories.d.ts","sourceRoot":"","sources":["../../src/resources/categories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EACL,QAAQ,EACR,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,EACX,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,QAAQ,EAAE,CAAC;IACpB,SAAS,EAAE;QACT,YAAY,EAAE,MAAM,CAAC;QACrB,WAAW,EAAE,MAAM,CAAC;QACpB,aAAa,EAAE,MAAM,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAED,qBAAa,kBAAkB;IACjB,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC;;;OAGG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;IAInF;;;OAGG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAIrD;;;OAGG;IACG,MAAM,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAItE;;;;OAIG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAIlF;;;;OAIG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;CAGrD"}
@@ -0,0 +1,37 @@
1
+ import { HttpClient } from '../client';
2
+ import { Merchant, CreateMerchantData, UpdateMerchantData, ApiResponse, PaginationParams } from '../types';
3
+ export interface MerchantListParams extends PaginationParams {
4
+ search?: string;
5
+ status?: number;
6
+ limit?: number;
7
+ }
8
+ export interface MerchantListResponse {
9
+ entries: Merchant[];
10
+ page_info: {
11
+ current_page: number;
12
+ total_pages: number;
13
+ total_entries: number;
14
+ page_size: number;
15
+ };
16
+ }
17
+ export declare class MerchantsResource {
18
+ private client;
19
+ constructor(client: HttpClient);
20
+ /**
21
+ * List merchants with pagination and filtering
22
+ */
23
+ list(params?: MerchantListParams): Promise<ApiResponse<MerchantListResponse>>;
24
+ /**
25
+ * Get a specific merchant by ID
26
+ */
27
+ get(id: number): Promise<ApiResponse<Merchant>>;
28
+ /**
29
+ * Create a new merchant
30
+ */
31
+ create(data: CreateMerchantData): Promise<ApiResponse<Merchant>>;
32
+ /**
33
+ * Update an existing merchant
34
+ */
35
+ update(id: number, data: UpdateMerchantData): Promise<ApiResponse<Merchant>>;
36
+ }
37
+ //# sourceMappingURL=merchants.d.ts.map