@sales-planner/http-client 0.11.0 → 0.12.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 (32) hide show
  1. package/README.md +112 -116
  2. package/dist/clients/brands-client.d.ts +7 -6
  3. package/dist/clients/brands-client.d.ts.map +1 -1
  4. package/dist/clients/brands-client.js +9 -6
  5. package/dist/clients/categories-client.d.ts +7 -6
  6. package/dist/clients/categories-client.d.ts.map +1 -1
  7. package/dist/clients/categories-client.js +9 -6
  8. package/dist/clients/groups-client.d.ts +7 -6
  9. package/dist/clients/groups-client.d.ts.map +1 -1
  10. package/dist/clients/groups-client.js +9 -6
  11. package/dist/clients/marketplaces-client.d.ts +7 -6
  12. package/dist/clients/marketplaces-client.d.ts.map +1 -1
  13. package/dist/clients/marketplaces-client.js +9 -6
  14. package/dist/clients/sales-history-client.d.ts +7 -7
  15. package/dist/clients/sales-history-client.d.ts.map +1 -1
  16. package/dist/clients/sales-history-client.js +6 -6
  17. package/dist/clients/sales-planner-client.d.ts +50 -33
  18. package/dist/clients/sales-planner-client.d.ts.map +1 -1
  19. package/dist/clients/sales-planner-client.js +57 -40
  20. package/dist/clients/skus-client.d.ts +8 -7
  21. package/dist/clients/skus-client.d.ts.map +1 -1
  22. package/dist/clients/skus-client.js +9 -6
  23. package/dist/clients/statuses-client.d.ts +7 -6
  24. package/dist/clients/statuses-client.d.ts.map +1 -1
  25. package/dist/clients/statuses-client.js +9 -6
  26. package/dist/clients/suppliers-client.d.ts +10 -8
  27. package/dist/clients/suppliers-client.d.ts.map +1 -1
  28. package/dist/clients/suppliers-client.js +10 -7
  29. package/dist/clients/user-roles-client.d.ts +4 -2
  30. package/dist/clients/user-roles-client.d.ts.map +1 -1
  31. package/dist/clients/user-roles-client.js +14 -0
  32. package/package.json +1 -1
package/README.md CHANGED
@@ -25,11 +25,7 @@ const health = await client.getHealth();
25
25
  console.log(health); // { status: 'ok', version: '1.0.0' }
26
26
  ```
27
27
 
28
- ### API Styles
29
-
30
- The client supports two complementary API styles:
31
-
32
- #### 1. **Namespaced API** (Recommended)
28
+ ### Namespaced Sub-Clients
33
29
 
34
30
  Access resources through domain-specific sub-clients:
35
31
 
@@ -44,25 +40,30 @@ const shops = await client.shops.getShops(tenantId);
44
40
 
45
41
  // SKUs with import/export
46
42
  const skus = await client.skus.getSkus({ tenantId, shopId });
47
- await client.skus.importSkusJson(items, { tenantId, shopId });
48
- const csv = await client.skus.exportSkusCsv({ tenantId, shopId });
43
+ await client.skus.importJson(items, { tenantId, shopId });
44
+ const csv = await client.skus.exportCsv({ tenantId, shopId });
49
45
 
50
46
  // Brands with import/export
51
47
  const brands = await client.brands.getBrands({ tenantId, shopId });
52
- await client.brands.importBrandsJson(items, { tenantId, shopId });
53
- const brandsCsv = await client.brands.exportBrandsCsv({ tenantId, shopId });
48
+ await client.brands.importJson(items, { tenantId, shopId });
49
+ const brandsCsv = await client.brands.exportCsv({ tenantId, shopId });
54
50
 
55
51
  // Categories with import/export
56
52
  const categories = await client.categories.getCategories({ tenantId, shopId });
57
- await client.categories.importCategoriesJson(items, { tenantId, shopId });
53
+ await client.categories.importJson(items, { tenantId, shopId });
58
54
 
59
55
  // Groups with import/export
60
56
  const groups = await client.groups.getGroups({ tenantId, shopId });
61
- await client.groups.importGroupsJson(items, { tenantId, shopId });
57
+ await client.groups.importJson(items, { tenantId, shopId });
62
58
 
63
59
  // Statuses with import/export
64
60
  const statuses = await client.statuses.getStatuses({ tenantId, shopId });
65
- await client.statuses.importStatusesJson(items, { tenantId, shopId });
61
+ await client.statuses.importJson(items, { tenantId, shopId });
62
+
63
+ // Suppliers with import/export
64
+ const suppliers = await client.suppliers.getSuppliers({ tenantId, shopId });
65
+ await client.suppliers.importJson(items, { tenantId, shopId });
66
+ const suppliersCsv = await client.suppliers.exportCsv({ tenantId, shopId });
66
67
 
67
68
  // Sales History
68
69
  const history = await client.salesHistory.getSalesHistory(
@@ -75,67 +76,51 @@ const marketplaces = await client.marketplaces.getMarketplaces({ tenantId });
75
76
 
76
77
  // Entity Metadata (for UI documentation)
77
78
  const metadata = await client.metadata.getEntitiesMetadata();
78
- // Returns field definitions for brands, categories, groups, statuses, marketplaces, skus, sales history
79
- ```
80
-
81
- **Benefits:**
82
- - Clear domain separation
83
- - IDE autocomplete by domain
84
- - Easier to discover related methods
85
-
86
- #### 2. **Flat API** (Backward Compatible)
87
-
88
- Access all methods directly on the client:
89
-
90
- ```typescript
91
- // Backward compatible with existing code
92
- const users = await client.getUsers();
93
- const user = await client.getUser(1);
94
- const skus = await client.getSkus({ tenantId, shopId });
79
+ // Returns field definitions for brands, categories, groups, statuses, suppliers, marketplaces, skus, sales history
95
80
  ```
96
81
 
97
82
  ## Import/Export Pattern
98
83
 
99
- Resources that support bulk operations (SKUs, Brands, Categories, Groups, Statuses, Sales History, Marketplaces) follow a consistent pattern:
84
+ Resources that support bulk operations (SKUs, Brands, Categories, Groups, Statuses, Suppliers, Sales History, Marketplaces) follow a consistent pattern:
100
85
 
101
86
  ```typescript
102
87
  // Import from JSON
103
- const result = await client.skus.importSkusJson(
88
+ const result = await client.skus.importJson(
104
89
  [
105
90
  { code: 'SKU-001', title: 'Product 1' },
106
91
  { code: 'SKU-002', title: 'Product 2' },
107
92
  ],
108
93
  { tenantId, shopId }
109
94
  );
110
- // Returns: { inserted: 2, updated: 0, errors: [] }
95
+ // Returns: { created: 2, updated: 0, errors: [] }
111
96
 
112
97
  // Import from CSV file
113
98
  const csvContent = await fs.readFile('skus.csv', 'utf-8');
114
- const result = await client.skus.importSkusCsv(csvContent, { tenantId, shopId });
99
+ const result = await client.skus.importCsv(csvContent, { tenantId, shopId });
115
100
 
116
101
  // Export to CSV
117
- const csv = await client.skus.exportSkusCsv({ tenantId, shopId });
102
+ const csv = await client.skus.exportCsv({ tenantId, shopId });
118
103
 
119
104
  // Get example templates (no auth required)
120
- const exampleCsv = await client.skus.getSkusExampleCsv();
105
+ const exampleCsv = await client.skus.getExampleCsv();
121
106
 
122
107
  // Same pattern works for brands, categories, groups, statuses
123
- const brandResult = await client.brands.importBrandsJson(
108
+ const brandResult = await client.brands.importJson(
124
109
  [{ code: 'apple', title: 'Apple' }],
125
110
  { tenantId, shopId }
126
111
  );
127
112
 
128
- const categoryResult = await client.categories.importCategoriesJson(
113
+ const categoryResult = await client.categories.importJson(
129
114
  [{ code: 'electronics', title: 'Electronics' }],
130
115
  { tenantId, shopId }
131
116
  );
132
117
 
133
- const groupResult = await client.groups.importGroupsJson(
118
+ const groupResult = await client.groups.importJson(
134
119
  [{ code: 'smartphones', title: 'Smartphones' }],
135
120
  { tenantId, shopId }
136
121
  );
137
122
 
138
- const statusResult = await client.statuses.importStatusesJson(
123
+ const statusResult = await client.statuses.importJson(
139
124
  [{ code: 'active', title: 'Active' }],
140
125
  { tenantId, shopId }
141
126
  );
@@ -193,6 +178,16 @@ const statusResult = await client.statuses.importStatusesJson(
193
178
  - `code` (optional): String, 1-100 characters
194
179
  - `title` (optional): String, 1-200 characters
195
180
 
181
+ ### Suppliers
182
+
183
+ **Create/Import:**
184
+ - `code` (required): String, 1-100 characters, unique per shop
185
+ - `title` (required): String, 1-200 characters
186
+
187
+ **Update:**
188
+ - `code` (optional): String, 1-100 characters
189
+ - `title` (optional): String, 1-200 characters
190
+
196
191
  ### Sales History
197
192
 
198
193
  **Create:**
@@ -256,108 +251,95 @@ Note: Import endpoints accept marketplace codes for convenience, but the API int
256
251
  - `code` (optional): String, 1-100 characters
257
252
  - `title` (optional): String, 1-200 characters
258
253
 
259
- ## Error Handling
254
+ ## Available Sub-Clients
260
255
 
261
- ```typescript
262
- import { ApiError } from '@sales-planner/http-client';
256
+ Each sub-client is accessed via `client.<subClient>.<method>()`.
263
257
 
264
- try {
265
- await client.users.getUser(999);
266
- } catch (error) {
267
- if (error instanceof ApiError) {
268
- console.error(`API Error ${error.status}: ${error.message}`);
269
- }
270
- }
271
- ```
272
-
273
- Common HTTP status codes:
274
- - `409 Conflict` - Duplicate resource (email, SKU code, sales period)
275
- - `404 Not Found` - Resource not found
276
- - `403 Forbidden` - Insufficient permissions
277
- - `400 Bad Request` - Validation error
278
-
279
- ```typescript
280
- try {
281
- await client.createUser({ email: 'user@example.com', name: 'John' });
282
- } catch (error) {
283
- if (error.response?.status === 409) {
284
- console.error('User with this email already exists');
285
- }
286
- }
287
- ```
288
-
289
- ## Available Methods
290
-
291
- ### Authentication
258
+ ### `client.me`
292
259
  - `getMe()` - Get current user with roles and tenants
293
260
 
294
- ### Users
261
+ ### `client.users`
295
262
  - `getUsers()`, `getUser(id)` - System admin or tenant admin (filtered by their tenants)
296
263
  - `createUser(dto)`, `deleteUser(id)` - Tenant admin or higher
297
264
 
298
- ### Tenants
265
+ ### `client.tenants`
299
266
  - `getTenants()`, `getTenant(id)` - All authenticated users
300
267
  - `createTenant(dto)` - System admin only
301
268
  - `updateTenant(id, dto)`, `deleteTenant(id)` - Authenticated users (validation happens server-side)
302
269
  - `createTenantWithShopAndUser(dto)` - System admin only
303
270
 
304
- ### Shops
271
+ ### `client.shops`
305
272
  - `getShops(tenantId?)`, `getShop(id)`, `createShop(dto)`, `updateShop(id, dto)`, `deleteShop(id)` - Requires tenant access
306
273
  - `deleteShopData(id)` - Delete all data (SKUs, sales history) for a shop
307
274
 
308
- ### SKUs
309
- - `getSkus(ctx)`, `getSku(id, ctx)` - Requires read access (viewer or higher)
275
+ ### `client.skus`
276
+ - `getSkus(ctx)`, `getSku(id, ctx)`, `getSkuByCode(code, ctx)` - Requires read access (viewer or higher)
310
277
  - `createSku(dto, ctx)`, `updateSku(id, dto, ctx)`, `deleteSku(id, ctx)` - Requires write access (editor or higher)
311
- - `importSkusJson(items, ctx)`, `importSkusCsv(csvContent, ctx)` - Requires write access
312
- - `exportSkusJson(ctx)`, `exportSkusCsv(ctx)` - Requires read access
313
- - `getSkusExampleJson()`, `getSkusExampleCsv()` - Get import format examples (no auth required)
278
+ - `importJson(items, ctx)`, `importCsv(csvContent, ctx)` - Requires write access
279
+ - `exportJson(ctx)`, `exportCsv(ctx)` - Requires read access
280
+ - `getExampleJson()`, `getExampleCsv()` - Get import format examples (no auth required)
314
281
 
315
- ### Brands
316
- - `getBrands(ctx)`, `getBrand(id, ctx)` - Requires read access (viewer or higher)
282
+ ### `client.brands`
283
+ - `getBrands(ctx)`, `getBrand(id, ctx)`, `getBrandByCode(code, ctx)` - Requires read access (viewer or higher)
317
284
  - `createBrand(dto, ctx)`, `updateBrand(id, dto, ctx)`, `deleteBrand(id, ctx)` - Requires write access (editor or higher)
318
- - `importBrandsJson(items, ctx)`, `importBrandsCsv(csvContent, ctx)` - Requires write access (bulk upsert by code)
319
- - `exportBrandsJson(ctx)`, `exportBrandsCsv(ctx)` - Requires read access
320
- - `getBrandsExampleJson()`, `getBrandsExampleCsv()` - Get import format examples (no auth required)
285
+ - `importJson(items, ctx)`, `importCsv(csvContent, ctx)` - Requires write access (bulk upsert by code)
286
+ - `exportJson(ctx)`, `exportCsv(ctx)` - Requires read access
287
+ - `getExampleJson()`, `getExampleCsv()` - Get import format examples (no auth required)
321
288
 
322
- ### Categories
323
- - `getCategories(ctx)`, `getCategory(id, ctx)` - Requires read access (viewer or higher)
289
+ ### `client.categories`
290
+ - `getCategories(ctx)`, `getCategory(id, ctx)`, `getCategoryByCode(code, ctx)` - Requires read access (viewer or higher)
324
291
  - `createCategory(dto, ctx)`, `updateCategory(id, dto, ctx)`, `deleteCategory(id, ctx)` - Requires write access (editor or higher)
325
- - `importCategoriesJson(items, ctx)`, `importCategoriesCsv(csvContent, ctx)` - Requires write access (bulk upsert by code)
326
- - `exportCategoriesJson(ctx)`, `exportCategoriesCsv(ctx)` - Requires read access
327
- - `getExampleCategoriesJson()`, `getExampleCategoriesCsv()` - Get import format examples (no auth required)
292
+ - `importJson(items, ctx)`, `importCsv(csvContent, ctx)` - Requires write access (bulk upsert by code)
293
+ - `exportJson(ctx)`, `exportCsv(ctx)` - Requires read access
294
+ - `getExampleJson()`, `getExampleCsv()` - Get import format examples (no auth required)
328
295
 
329
- ### Groups
330
- - `getGroups(ctx)`, `getGroup(id, ctx)` - Requires read access (viewer or higher)
296
+ ### `client.groups`
297
+ - `getGroups(ctx)`, `getGroup(id, ctx)`, `getGroupByCode(code, ctx)` - Requires read access (viewer or higher)
331
298
  - `createGroup(dto, ctx)`, `updateGroup(id, dto, ctx)`, `deleteGroup(id, ctx)` - Requires write access (editor or higher)
332
- - `importGroupsJson(items, ctx)`, `importGroupsCsv(csvContent, ctx)` - Requires write access (bulk upsert by code)
333
- - `exportGroupsJson(ctx)`, `exportGroupsCsv(ctx)` - Requires read access
334
- - `getExampleGroupsJson()`, `getExampleGroupsCsv()` - Get import format examples (no auth required)
299
+ - `importJson(items, ctx)`, `importCsv(csvContent, ctx)` - Requires write access (bulk upsert by code)
300
+ - `exportJson(ctx)`, `exportCsv(ctx)` - Requires read access
301
+ - `getExampleJson()`, `getExampleCsv()` - Get import format examples (no auth required)
335
302
 
336
- ### Statuses
337
- - `getStatuses(ctx)`, `getStatus(id, ctx)` - Requires read access (viewer or higher)
303
+ ### `client.statuses`
304
+ - `getStatuses(ctx)`, `getStatus(id, ctx)`, `getStatusByCode(code, ctx)` - Requires read access (viewer or higher)
338
305
  - `createStatus(dto, ctx)`, `updateStatus(id, dto, ctx)`, `deleteStatus(id, ctx)` - Requires write access (editor or higher)
339
- - `importStatusesJson(items, ctx)`, `importStatusesCsv(csvContent, ctx)` - Requires write access (bulk upsert by code)
340
- - `exportStatusesJson(ctx)`, `exportStatusesCsv(ctx)` - Requires read access
341
- - `getExampleStatusesJson()`, `getExampleStatusesCsv()` - Get import format examples (no auth required)
342
-
343
- ### Sales History
306
+ - `importJson(items, ctx)`, `importCsv(csvContent, ctx)` - Requires write access (bulk upsert by code)
307
+ - `exportJson(ctx)`, `exportCsv(ctx)` - Requires read access
308
+ - `getExampleJson()`, `getExampleCsv()` - Get import format examples (no auth required)
309
+
310
+ ### `client.suppliers`
311
+ - `getSuppliers(ctx)`, `getSupplier(id, ctx)`, `getSupplierByCode(code, ctx)` - Requires read access (viewer or higher)
312
+ - `createSupplier(dto, ctx)`, `updateSupplier(id, dto, ctx)`, `deleteSupplier(id, ctx)` - Requires write access (editor or higher)
313
+ - `importJson(items, ctx)`, `importCsv(csvContent, ctx)` - Requires write access (bulk upsert by code)
314
+ - `exportJson(ctx)`, `exportCsv(ctx)` - Requires read access
315
+ - `getExampleJson()`, `getExampleCsv()` - Get import format examples (no auth required)
316
+
317
+ ### `client.salesHistory`
344
318
  - `getSalesHistory(ctx, query?)`, `getSalesHistoryItem(id, ctx)` - Requires read access (viewer or higher)
345
319
  - `createSalesHistory(dto, ctx)`, `updateSalesHistory(id, dto, ctx)`, `deleteSalesHistory(id, ctx)` - Requires write access (editor or higher)
346
- - `importSalesHistoryJson(items, ctx)`, `importSalesHistoryCsv(csvContent, ctx)` - Requires write access
347
- - `exportSalesHistoryJson(ctx, query?)`, `exportSalesHistoryCsv(ctx, query?)` - Requires read access
348
- - `getSalesHistoryExampleJson()`, `getSalesHistoryExampleCsv()` - Get import format examples (no auth required)
320
+ - `importJson(items, ctx)`, `importCsv(csvContent, ctx)` - Requires write access
321
+ - `exportJson(ctx, query?)`, `exportCsv(ctx, query?)` - Requires read access
322
+ - `getExampleJson()`, `getExampleCsv()` - Get import format examples (no auth required)
349
323
 
350
- ### Roles & User Roles
324
+ ### `client.roles`
351
325
  - `getRoles()`, `getRole(id)` - System admin only
352
326
  - `createRole(dto)`, `updateRole(id, dto)`, `deleteRole(id)` - System admin only
327
+
328
+ ### `client.userRoles`
329
+ - `getUserRoles(query)`, `getUserRole(id)` - View roles for tenant
353
330
  - `createUserRole(dto)`, `deleteUserRole(id)` - Tenant admin or higher for their tenant
354
331
 
355
- ### API Keys
332
+ ### `client.apiKeys`
356
333
  - `getApiKeys()`, `createApiKey(dto)`, `deleteApiKey(id)` - System admin only
357
334
 
358
- ### Marketplaces
359
- - `getMarketplaces()`, `getMarketplace(id)` - All authenticated users
360
- - `createMarketplace(dto)`, `updateMarketplace(id, dto)`, `deleteMarketplace(id)` - Requires write access (editor or higher)
335
+ ### `client.marketplaces`
336
+ - `getMarketplaces(ctx)`, `getMarketplace(id, ctx)`, `getMarketplaceByCode(code, ctx)` - Requires read access
337
+ - `createMarketplace(dto, ctx)`, `updateMarketplace(id, dto, ctx)`, `deleteMarketplace(id, ctx)` - Requires write access (editor or higher)
338
+ - `importJson(items, ctx)`, `importCsv(csvContent, ctx)` - Requires write access
339
+ - `exportJson(ctx)`, `exportCsv(ctx)` - Requires read access
340
+
341
+ ### `client.metadata`
342
+ - `getEntitiesMetadata()` - Get field definitions for all entities (no auth required)
361
343
 
362
344
  ## Error Handling
363
345
 
@@ -365,7 +347,7 @@ try {
365
347
  import { SalesPlannerClient, ApiError } from '@sales-planner/http-client';
366
348
 
367
349
  try {
368
- const user = await client.getUser(999);
350
+ const user = await client.users.getUser(999);
369
351
  } catch (error) {
370
352
  if (error instanceof ApiError) {
371
353
  console.log(error.status); // 404
@@ -374,21 +356,35 @@ try {
374
356
  }
375
357
  ```
376
358
 
359
+ Common HTTP status codes:
360
+ - `409 Conflict` - Duplicate resource (email, SKU code, sales period)
361
+ - `404 Not Found` - Resource not found
362
+ - `403 Forbidden` - Insufficient permissions
363
+ - `400 Bad Request` - Validation error
364
+
377
365
  ## Types
378
366
 
379
- All entity types, DTOs, and response types are exported:
367
+ Common types are re-exported from `@sales-planner/shared` for convenience:
380
368
 
381
369
  ```typescript
382
370
  import type {
383
- User, Tenant, Shop, Sku, Brand, Category, Group, Status, SalesHistory,
371
+ // Entities
372
+ User, Tenant, Shop, Sku, SalesHistory, Role, UserRole, ApiKey, Marketplace,
373
+ // DTOs
384
374
  CreateUserDto, CreateTenantDto, CreateShopDto,
385
- CreateSkuRequest, CreateBrandRequest, CreateCategoryRequest,
386
- CreateGroupRequest, CreateStatusRequest,
375
+ CreateSkuDto, CreateSkuRequest, CreateSalesHistoryDto, CreateSalesHistoryRequest,
376
+ CreateMarketplaceDto, CreateMarketplaceRequest,
377
+ // Query types
387
378
  ShopContextParams, PeriodQuery,
388
- UserWithRolesAndTenants, ImportResult,
389
- SkuExportItem, BrandExportItem, CategoryExportItem,
390
- GroupExportItem, StatusExportItem
379
+ // Response types
380
+ UserWithRolesAndTenants, TenantWithShopAndApiKey,
381
+ ImportResult, DeleteDataResult,
382
+ SkuExportItem, SalesHistoryExportItem,
391
383
  } from '@sales-planner/http-client';
384
+
385
+ // For additional types (Brand, Category, Group, Status, Supplier, etc.)
386
+ // import directly from @sales-planner/shared
387
+ import type { Brand, Category, Group, Status, Supplier } from '@sales-planner/shared';
392
388
  ```
393
389
 
394
390
  ## License
@@ -3,14 +3,15 @@ import { ImportExportBaseClient } from './import-export-base-client.js';
3
3
  export declare class BrandsClient extends ImportExportBaseClient {
4
4
  getBrands(ctx: ShopContextParams): Promise<Brand[]>;
5
5
  getBrand(id: number, ctx: ShopContextParams): Promise<Brand>;
6
+ getBrandByCode(code: string, ctx: ShopContextParams): Promise<Brand>;
6
7
  createBrand(dto: CreateBrandRequest, ctx: ShopContextParams): Promise<Brand>;
7
8
  updateBrand(id: number, dto: UpdateBrandDto, ctx: ShopContextParams): Promise<Brand>;
8
9
  deleteBrand(id: number, ctx: ShopContextParams): Promise<void>;
9
- importBrandsJson(items: ImportBrandItem[], ctx: ShopContextParams): Promise<ImportResult>;
10
- importBrandsCsv(csvContent: string, ctx: ShopContextParams): Promise<ImportResult>;
11
- exportBrandsJson(ctx: ShopContextParams): Promise<BrandExportItem[]>;
12
- exportBrandsCsv(ctx: ShopContextParams): Promise<string>;
13
- getBrandsExampleJson(): Promise<ImportBrandItem[]>;
14
- getBrandsExampleCsv(): Promise<string>;
10
+ importJson(items: ImportBrandItem[], ctx: ShopContextParams): Promise<ImportResult>;
11
+ importCsv(csvContent: string, ctx: ShopContextParams): Promise<ImportResult>;
12
+ exportJson(ctx: ShopContextParams): Promise<BrandExportItem[]>;
13
+ exportCsv(ctx: ShopContextParams): Promise<string>;
14
+ getExampleJson(): Promise<ImportBrandItem[]>;
15
+ getExampleCsv(): Promise<string>;
15
16
  }
16
17
  //# sourceMappingURL=brands-client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"brands-client.d.ts","sourceRoot":"","sources":["../../src/clients/brands-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,eAAe,EACf,YAAY,EACZ,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAExE,qBAAa,YAAa,SAAQ,sBAAsB;IAChD,SAAS,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAInD,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,KAAK,CAAC;IAI5D,WAAW,CAAC,GAAG,EAAE,kBAAkB,EAAE,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,KAAK,CAAC;IAI5E,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,KAAK,CAAC;IAIpF,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9D,gBAAgB,CAAC,KAAK,EAAE,eAAe,EAAE,EAAE,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC;IAIzF,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC;IAIlF,gBAAgB,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAIpE,eAAe,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC;IAIxD,oBAAoB,IAAI,OAAO,CAA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,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC;IAIlD,cAAc,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IAI5C,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;CAGvC"}
@@ -6,6 +6,9 @@ export class BrandsClient extends ImportExportBaseClient {
6
6
  async getBrand(id, ctx) {
7
7
  return this.request('GET', `/brands/${id}`, { params: ctx });
8
8
  }
9
+ async getBrandByCode(code, ctx) {
10
+ return this.request('GET', `/brands/code/${encodeURIComponent(code)}`, { params: ctx });
11
+ }
9
12
  async createBrand(dto, ctx) {
10
13
  return this.request('POST', '/brands', { body: dto, params: ctx });
11
14
  }
@@ -15,22 +18,22 @@ export class BrandsClient extends ImportExportBaseClient {
15
18
  async deleteBrand(id, ctx) {
16
19
  return this.request('DELETE', `/brands/${id}`, { params: ctx });
17
20
  }
18
- async importBrandsJson(items, ctx) {
21
+ async importJson(items, ctx) {
19
22
  return this.request('POST', '/brands/import/json', { body: items, params: ctx });
20
23
  }
21
- async importBrandsCsv(csvContent, ctx) {
24
+ async importCsv(csvContent, ctx) {
22
25
  return this.uploadCsv('/brands/import/csv', csvContent, ctx);
23
26
  }
24
- async exportBrandsJson(ctx) {
27
+ async exportJson(ctx) {
25
28
  return this.request('GET', '/brands/export/json', { params: ctx });
26
29
  }
27
- async exportBrandsCsv(ctx) {
30
+ async exportCsv(ctx) {
28
31
  return this.requestText('GET', '/brands/export/csv', { params: ctx });
29
32
  }
30
- async getBrandsExampleJson() {
33
+ async getExampleJson() {
31
34
  return this.requestPublic('GET', '/brands/examples/json');
32
35
  }
33
- async getBrandsExampleCsv() {
36
+ async getExampleCsv() {
34
37
  return this.requestTextPublic('GET', '/brands/examples/csv');
35
38
  }
36
39
  }
@@ -3,14 +3,15 @@ import { ImportExportBaseClient } from './import-export-base-client.js';
3
3
  export declare class CategoriesClient extends ImportExportBaseClient {
4
4
  getCategories(ctx: ShopContextParams): Promise<Category[]>;
5
5
  getCategory(id: number, ctx: ShopContextParams): Promise<Category>;
6
+ getCategoryByCode(code: string, ctx: ShopContextParams): Promise<Category>;
6
7
  createCategory(dto: CreateCategoryRequest, ctx: ShopContextParams): Promise<Category>;
7
8
  updateCategory(id: number, dto: UpdateCategoryDto, ctx: ShopContextParams): Promise<Category>;
8
9
  deleteCategory(id: number, ctx: ShopContextParams): Promise<void>;
9
- importCategoriesJson(items: ImportCategoryItem[], ctx: ShopContextParams): Promise<ImportResult>;
10
- importCategoriesCsv(csvContent: string, ctx: ShopContextParams): Promise<ImportResult>;
11
- exportCategoriesJson(ctx: ShopContextParams): Promise<CategoryExportItem[]>;
12
- exportCategoriesCsv(ctx: ShopContextParams): Promise<string>;
13
- getExampleCategoriesJson(ctx: ShopContextParams): Promise<CategoryExportItem[]>;
14
- getExampleCategoriesCsv(ctx: ShopContextParams): Promise<string>;
10
+ importJson(items: ImportCategoryItem[], ctx: ShopContextParams): Promise<ImportResult>;
11
+ importCsv(csvContent: string, ctx: ShopContextParams): Promise<ImportResult>;
12
+ exportJson(ctx: ShopContextParams): Promise<CategoryExportItem[]>;
13
+ exportCsv(ctx: ShopContextParams): Promise<string>;
14
+ getExampleJson(): Promise<CategoryExportItem[]>;
15
+ getExampleCsv(): Promise<string>;
15
16
  }
16
17
  //# sourceMappingURL=categories-client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"categories-client.d.ts","sourceRoot":"","sources":["../../src/clients/categories-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAExE,qBAAa,gBAAiB,SAAQ,sBAAsB;IACpD,aAAa,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAI1D,WAAW,CAAC,EAAE,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AAE,iBAAiB,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAI1D,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAIlE,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAI1E,cAAc,CAAC,GAAG,EAAE,qBAAqB,EAAE,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAIrF,cAAc,CAClB,EAAE,EAAE,MAAM,EACV,GAAG,EAAE,iBAAiB,EACtB,GAAG,EAAE,iBAAiB,GACrB,OAAO,CAAC,QAAQ,CAAC;IAId,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAKjE,UAAU,CAAC,KAAK,EAAE,kBAAkB,EAAE,EAAE,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC;IAItF,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC;IAI5E,UAAU,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAIjE,SAAS,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC;IAIlD,cAAc,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAI/C,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;CAGvC"}
@@ -6,6 +6,9 @@ export class CategoriesClient extends ImportExportBaseClient {
6
6
  async getCategory(id, ctx) {
7
7
  return this.request('GET', `/categories/${id}`, { params: ctx });
8
8
  }
9
+ async getCategoryByCode(code, ctx) {
10
+ return this.request('GET', `/categories/code/${encodeURIComponent(code)}`, { params: ctx });
11
+ }
9
12
  async createCategory(dto, ctx) {
10
13
  return this.request('POST', '/categories', { body: dto, params: ctx });
11
14
  }
@@ -16,22 +19,22 @@ export class CategoriesClient extends ImportExportBaseClient {
16
19
  return this.request('DELETE', `/categories/${id}`, { params: ctx });
17
20
  }
18
21
  // Import/Export methods
19
- async importCategoriesJson(items, ctx) {
22
+ async importJson(items, ctx) {
20
23
  return this.request('POST', '/categories/import/json', { body: items, params: ctx });
21
24
  }
22
- async importCategoriesCsv(csvContent, ctx) {
25
+ async importCsv(csvContent, ctx) {
23
26
  return this.uploadCsv('/categories/import/csv', csvContent, ctx);
24
27
  }
25
- async exportCategoriesJson(ctx) {
28
+ async exportJson(ctx) {
26
29
  return this.request('GET', '/categories/export/json', { params: ctx });
27
30
  }
28
- async exportCategoriesCsv(ctx) {
31
+ async exportCsv(ctx) {
29
32
  return this.requestText('GET', '/categories/export/csv', { params: ctx });
30
33
  }
31
- async getExampleCategoriesJson(ctx) {
34
+ async getExampleJson() {
32
35
  return this.requestPublic('GET', '/categories/examples/json');
33
36
  }
34
- async getExampleCategoriesCsv(ctx) {
37
+ async getExampleCsv() {
35
38
  return this.requestTextPublic('GET', '/categories/examples/csv');
36
39
  }
37
40
  }
@@ -3,14 +3,15 @@ import { ImportExportBaseClient } from './import-export-base-client.js';
3
3
  export declare class GroupsClient extends ImportExportBaseClient {
4
4
  getGroups(ctx: ShopContextParams): Promise<Group[]>;
5
5
  getGroup(id: number, ctx: ShopContextParams): Promise<Group>;
6
+ getGroupByCode(code: string, ctx: ShopContextParams): Promise<Group>;
6
7
  createGroup(dto: CreateGroupRequest, ctx: ShopContextParams): Promise<Group>;
7
8
  updateGroup(id: number, dto: UpdateGroupDto, ctx: ShopContextParams): Promise<Group>;
8
9
  deleteGroup(id: number, ctx: ShopContextParams): Promise<void>;
9
- importGroupsJson(items: ImportGroupItem[], ctx: ShopContextParams): Promise<ImportResult>;
10
- importGroupsCsv(csvContent: string, ctx: ShopContextParams): Promise<ImportResult>;
11
- exportGroupsJson(ctx: ShopContextParams): Promise<GroupExportItem[]>;
12
- exportGroupsCsv(ctx: ShopContextParams): Promise<string>;
13
- getExampleGroupsJson(ctx: ShopContextParams): Promise<GroupExportItem[]>;
14
- getExampleGroupsCsv(ctx: ShopContextParams): Promise<string>;
10
+ importJson(items: ImportGroupItem[], ctx: ShopContextParams): Promise<ImportResult>;
11
+ importCsv(csvContent: string, ctx: ShopContextParams): Promise<ImportResult>;
12
+ exportJson(ctx: ShopContextParams): Promise<GroupExportItem[]>;
13
+ exportCsv(ctx: ShopContextParams): Promise<string>;
14
+ getExampleJson(): Promise<GroupExportItem[]>;
15
+ getExampleCsv(): Promise<string>;
15
16
  }
16
17
  //# sourceMappingURL=groups-client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"groups-client.d.ts","sourceRoot":"","sources":["../../src/clients/groups-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,eAAe,EACf,YAAY,EACZ,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAExE,qBAAa,YAAa,SAAQ,sBAAsB;IAChD,SAAS,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAInD,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,KAAK,CAAC;IAI5D,WAAW,CAAC,GAAG,EAAE,kBAAkB,EAAE,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,KAAK,CAAC;IAI5E,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,KAAK,CAAC;IAIpF,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAK9D,gBAAgB,CACpB,KAAK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AC,KAAK,CAAC;IAIpF,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAK9D,UAAU,CAAC,KAAK,EAAE,eAAe,EAAE,EAAE,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC;IAInF,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC;IAI5E,UAAU,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAI9D,SAAS,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC;IAIlD,cAAc,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IAI5C,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;CAGvC"}
@@ -6,6 +6,9 @@ export class GroupsClient extends ImportExportBaseClient {
6
6
  async getGroup(id, ctx) {
7
7
  return this.request('GET', `/groups/${id}`, { params: ctx });
8
8
  }
9
+ async getGroupByCode(code, ctx) {
10
+ return this.request('GET', `/groups/code/${encodeURIComponent(code)}`, { params: ctx });
11
+ }
9
12
  async createGroup(dto, ctx) {
10
13
  return this.request('POST', '/groups', { body: dto, params: ctx });
11
14
  }
@@ -16,22 +19,22 @@ export class GroupsClient extends ImportExportBaseClient {
16
19
  return this.request('DELETE', `/groups/${id}`, { params: ctx });
17
20
  }
18
21
  // Import/Export methods
19
- async importGroupsJson(items, ctx) {
22
+ async importJson(items, ctx) {
20
23
  return this.request('POST', '/groups/import/json', { body: items, params: ctx });
21
24
  }
22
- async importGroupsCsv(csvContent, ctx) {
25
+ async importCsv(csvContent, ctx) {
23
26
  return this.uploadCsv('/groups/import/csv', csvContent, ctx);
24
27
  }
25
- async exportGroupsJson(ctx) {
28
+ async exportJson(ctx) {
26
29
  return this.request('GET', '/groups/export/json', { params: ctx });
27
30
  }
28
- async exportGroupsCsv(ctx) {
31
+ async exportCsv(ctx) {
29
32
  return this.requestText('GET', '/groups/export/csv', { params: ctx });
30
33
  }
31
- async getExampleGroupsJson(ctx) {
34
+ async getExampleJson() {
32
35
  return this.requestPublic('GET', '/groups/examples/json');
33
36
  }
34
- async getExampleGroupsCsv(ctx) {
37
+ async getExampleCsv() {
35
38
  return this.requestTextPublic('GET', '/groups/examples/csv');
36
39
  }
37
40
  }
@@ -3,14 +3,15 @@ import { ImportExportBaseClient } from './import-export-base-client.js';
3
3
  export declare class MarketplacesClient extends ImportExportBaseClient {
4
4
  getMarketplaces(ctx: ShopContextParams): Promise<Marketplace[]>;
5
5
  getMarketplace(id: number, ctx: ShopContextParams): Promise<Marketplace>;
6
+ getMarketplaceByCode(code: string, ctx: ShopContextParams): Promise<Marketplace>;
6
7
  createMarketplace(dto: CreateMarketplaceRequest, ctx: ShopContextParams): Promise<Marketplace>;
7
8
  updateMarketplace(id: number, dto: Partial<CreateMarketplaceRequest>, ctx: ShopContextParams): Promise<Marketplace>;
8
9
  deleteMarketplace(id: number, ctx: ShopContextParams): Promise<void>;
9
- importMarketplacesJson(items: ImportMarketplaceItem[], ctx: ShopContextParams): Promise<ImportResult>;
10
- importMarketplacesCsv(csvContent: string, ctx: ShopContextParams): Promise<ImportResult>;
11
- exportMarketplacesJson(ctx: ShopContextParams): Promise<MarketplaceExportItem[]>;
12
- exportMarketplacesCsv(ctx: ShopContextParams): Promise<string>;
13
- getMarketplaceExamplesJson(): Promise<ImportMarketplaceItem[]>;
14
- getMarketplaceExamplesCsv(): Promise<string>;
10
+ importJson(items: ImportMarketplaceItem[], ctx: ShopContextParams): Promise<ImportResult>;
11
+ importCsv(csvContent: string, ctx: ShopContextParams): Promise<ImportResult>;
12
+ exportJson(ctx: ShopContextParams): Promise<MarketplaceExportItem[]>;
13
+ exportCsv(ctx: ShopContextParams): Promise<string>;
14
+ getExampleJson(): Promise<ImportMarketplaceItem[]>;
15
+ getExampleCsv(): Promise<string>;
15
16
  }
16
17
  //# sourceMappingURL=marketplaces-client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"marketplaces-client.d.ts","sourceRoot":"","sources":["../../src/clients/marketplaces-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,wBAAwB,EACxB,qBAAqB,EACrB,qBAAqB,EACrB,YAAY,EACZ,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAExE,qBAAa,kBAAmB,SAAQ,sBAAsB;IACtD,eAAe,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAI/D,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,WAAW,CAAC;IAIxE,iBAAiB,CACrB,GAAG,EAAE,wBAAwB,EAC7B,GAAG,EAAE,iBAAiB,GACrB,OAAO,CAAC,WAAW,CAAC;IAIjB,iBAAiB,CACrB,EAAE,EAAE,MAAM,EACV,GAAG,EAAE,OAAO,CAAC,wBAAwB,CAAC,EACtC,GAAG,EAAE,iBAAiB,GACrB,OAAO,CAAC,WAAW,CAAC;IAIjB,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpE,sBAAsB,CAC1B,KAAK,EAAE,qBAAqB,EAAE,EAC9B,GAAG,EAAE,iBAAiB,GACrB,OAAO,CAAC,YAAY,CAAC;IAIlB,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC;IAIxF,sBAAsB,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAIhF,qBAAqB,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC;IAI9D,0BAA0B,IAAI,OAAO,C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