@sales-planner/http-client 0.17.0 → 0.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -50,7 +50,7 @@ Query parameters:
|
|
|
50
50
|
- `limit` - Number of items per page (1-1000, default: 100)
|
|
51
51
|
- `offset` - Number of items to skip (default: 0)
|
|
52
52
|
|
|
53
|
-
Sales history also
|
|
53
|
+
Sales history, leftovers, and competitor sales also support period filtering:
|
|
54
54
|
```typescript
|
|
55
55
|
const { items, total } = await client.salesHistory.getAll(ctx, {
|
|
56
56
|
period_from: '2024-01',
|
|
@@ -58,14 +58,20 @@ const { items, total } = await client.salesHistory.getAll(ctx, {
|
|
|
58
58
|
limit: 50,
|
|
59
59
|
offset: 0,
|
|
60
60
|
});
|
|
61
|
+
|
|
62
|
+
// Same for leftovers and competitor sales
|
|
63
|
+
const { items: leftovers } = await client.leftovers.getAll(ctx, {
|
|
64
|
+
period_from: '2024-01',
|
|
65
|
+
period_to: '2024-12',
|
|
66
|
+
});
|
|
61
67
|
```
|
|
62
68
|
|
|
63
69
|
## API
|
|
64
70
|
|
|
65
|
-
All shop-scoped clients (`skus`, `brands`, `categories`, `groups`, `statuses`, `suppliers`, `warehouses`, `marketplaces`, `salesHistory`) share these methods:
|
|
71
|
+
All shop-scoped clients (`skus`, `brands`, `categories`, `groups`, `statuses`, `suppliers`, `warehouses`, `marketplaces`, `salesHistory`, `leftovers`, `seasonalCoefficients`, `skuCompetitorMappings`, `competitorProducts`, `competitorSales`) share these methods:
|
|
66
72
|
|
|
67
73
|
- `getAll(ctx, query?)` → `PaginatedResponse<T>`
|
|
68
|
-
- `getById(ctx, id)`, `getByCode(ctx, code)`
|
|
74
|
+
- `getById(ctx, id)`, `getByCode(ctx, code)` (where applicable)
|
|
69
75
|
- `create(ctx, req)`, `update(ctx, id, req)`, `delete(ctx, id)`
|
|
70
76
|
- `importJson(ctx, items)`, `importCsv(ctx, csv)`, `exportJson(ctx)`, `exportCsv(ctx)`
|
|
71
77
|
- `getExampleJson()`, `getExampleCsv()` (no auth)
|
|
@@ -83,7 +89,11 @@ const { items: apiKeys } = await client.apiKeys.getAll();
|
|
|
83
89
|
|
|
84
90
|
// Delete all shop data (SKUs, sales history, brands, categories, etc.)
|
|
85
91
|
const result = await client.shops.deleteData(shopId);
|
|
86
|
-
console.log(result);
|
|
92
|
+
console.log(result);
|
|
93
|
+
// { skusDeleted, salesHistoryDeleted, brandsDeleted, categoriesDeleted,
|
|
94
|
+
// groupsDeleted, statusesDeleted, suppliersDeleted, warehousesDeleted,
|
|
95
|
+
// leftoversDeleted, seasonalCoefficientsDeleted, skuCompetitorMappingsDeleted,
|
|
96
|
+
// competitorProductsDeleted, competitorSalesDeleted }
|
|
87
97
|
```
|
|
88
98
|
|
|
89
99
|
Other system clients:
|
|
@@ -112,14 +122,280 @@ try {
|
|
|
112
122
|
|
|
113
123
|
## Types
|
|
114
124
|
|
|
115
|
-
|
|
125
|
+
### Query & Context Types
|
|
126
|
+
|
|
127
|
+
```typescript
|
|
128
|
+
// Required for all shop-scoped operations
|
|
129
|
+
interface ShopContextParams {
|
|
130
|
+
shop_id: number;
|
|
131
|
+
tenant_id: number;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Pagination (all getAll methods support this)
|
|
135
|
+
interface PaginationQuery {
|
|
136
|
+
limit?: number; // 1-1000, default: 100
|
|
137
|
+
offset?: number; // default: 0
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Period filtering (sales history, leftovers, competitor sales)
|
|
141
|
+
interface PeriodQuery {
|
|
142
|
+
period_from?: string; // YYYY-MM format
|
|
143
|
+
period_to?: string; // YYYY-MM format
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// Paginated response (returned by all getAll methods)
|
|
147
|
+
interface PaginatedResponse<T> {
|
|
148
|
+
items: T[];
|
|
149
|
+
total: number;
|
|
150
|
+
limit: number;
|
|
151
|
+
offset: number;
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Entity Types
|
|
156
|
+
|
|
157
|
+
All entities extend base interfaces:
|
|
158
|
+
|
|
159
|
+
```typescript
|
|
160
|
+
// Base for shop-scoped entities without code (e.g., SalesHistory)
|
|
161
|
+
interface ShopScopedBaseEntity {
|
|
162
|
+
id: number;
|
|
163
|
+
shop_id: number;
|
|
164
|
+
tenant_id: number;
|
|
165
|
+
created_at: Date;
|
|
166
|
+
updated_at: Date;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// Base for coded entities (e.g., SKUs, Brands, Categories)
|
|
170
|
+
interface CodedShopScopedEntity extends ShopScopedBaseEntity {
|
|
171
|
+
code: string;
|
|
172
|
+
title: string;
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
#### System Entities
|
|
177
|
+
|
|
178
|
+
```typescript
|
|
179
|
+
interface User {
|
|
180
|
+
id: number;
|
|
181
|
+
email: string;
|
|
182
|
+
name: string;
|
|
183
|
+
default_shop_id: number | null;
|
|
184
|
+
created_at: Date;
|
|
185
|
+
updated_at: Date;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
interface Tenant {
|
|
189
|
+
id: number;
|
|
190
|
+
title: string;
|
|
191
|
+
owner_id: number | null;
|
|
192
|
+
created_by: number;
|
|
193
|
+
created_at: Date;
|
|
194
|
+
updated_at: Date;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
interface Shop {
|
|
198
|
+
id: number;
|
|
199
|
+
title: string;
|
|
200
|
+
tenant_id: number;
|
|
201
|
+
created_at: Date;
|
|
202
|
+
updated_at: Date;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
interface Role {
|
|
206
|
+
id: number;
|
|
207
|
+
name: string;
|
|
208
|
+
description: string | null;
|
|
209
|
+
created_at: Date;
|
|
210
|
+
updated_at: Date;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
interface ApiKey {
|
|
214
|
+
id: number;
|
|
215
|
+
user_id: number;
|
|
216
|
+
key: string;
|
|
217
|
+
name: string | null;
|
|
218
|
+
expires_at: Date | null;
|
|
219
|
+
last_used_at: Date | null;
|
|
220
|
+
created_at: Date;
|
|
221
|
+
updated_at: Date;
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
#### Shop Data Entities
|
|
226
|
+
|
|
227
|
+
Coded entities (`Sku`, `Brand`, `Category`, `Group`, `Status`, `Supplier`, `Warehouse`, `Marketplace`) extend `CodedShopScopedEntity`:
|
|
228
|
+
|
|
229
|
+
```typescript
|
|
230
|
+
interface Sku extends CodedShopScopedEntity {
|
|
231
|
+
title2?: string | null;
|
|
232
|
+
category_id?: number | null;
|
|
233
|
+
group_id?: number | null;
|
|
234
|
+
status_id?: number | null;
|
|
235
|
+
supplier_id?: number | null;
|
|
236
|
+
}
|
|
237
|
+
// Brand, Category, Group, Status, Supplier, Warehouse, Marketplace
|
|
238
|
+
// all have just: id, code, title, shop_id, tenant_id, created_at, updated_at
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
#### Time-Series Entities
|
|
242
|
+
|
|
243
|
+
```typescript
|
|
244
|
+
interface SalesHistory {
|
|
245
|
+
id: number;
|
|
246
|
+
sku_id: number;
|
|
247
|
+
marketplace_id: number;
|
|
248
|
+
period: string; // YYYY-MM format
|
|
249
|
+
quantity: number;
|
|
250
|
+
shop_id: number;
|
|
251
|
+
tenant_id: number;
|
|
252
|
+
created_at: Date;
|
|
253
|
+
updated_at: Date;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
interface Leftover {
|
|
257
|
+
id: number;
|
|
258
|
+
sku_id: number;
|
|
259
|
+
warehouse_id: number;
|
|
260
|
+
period: string; // YYYY-MM format
|
|
261
|
+
quantity: number;
|
|
262
|
+
shop_id: number;
|
|
263
|
+
tenant_id: number;
|
|
264
|
+
created_at: Date;
|
|
265
|
+
updated_at: Date;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
interface SeasonalCoefficient {
|
|
269
|
+
id: number;
|
|
270
|
+
group_id: number;
|
|
271
|
+
month: number; // 1-12
|
|
272
|
+
coefficient: number;
|
|
273
|
+
shop_id: number;
|
|
274
|
+
tenant_id: number;
|
|
275
|
+
created_at: Date;
|
|
276
|
+
updated_at: Date;
|
|
277
|
+
}
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
#### Competitor Entities
|
|
281
|
+
|
|
282
|
+
```typescript
|
|
283
|
+
interface CompetitorProduct {
|
|
284
|
+
id: number;
|
|
285
|
+
marketplace_id: number;
|
|
286
|
+
marketplace_product_id: string; // BIGINT as string
|
|
287
|
+
title: string | null;
|
|
288
|
+
brand: string | null;
|
|
289
|
+
shop_id: number;
|
|
290
|
+
tenant_id: number;
|
|
291
|
+
created_at: Date;
|
|
292
|
+
updated_at: Date;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
interface CompetitorSale {
|
|
296
|
+
id: number;
|
|
297
|
+
competitor_product_id: number;
|
|
298
|
+
period: string; // YYYY-MM format
|
|
299
|
+
quantity: number;
|
|
300
|
+
shop_id: number;
|
|
301
|
+
tenant_id: number;
|
|
302
|
+
created_at: Date;
|
|
303
|
+
updated_at: Date;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
interface SkuCompetitorMapping {
|
|
307
|
+
id: number;
|
|
308
|
+
sku_id: number;
|
|
309
|
+
competitor_product_id: number;
|
|
310
|
+
shop_id: number;
|
|
311
|
+
tenant_id: number;
|
|
312
|
+
created_at: Date;
|
|
313
|
+
updated_at: Date;
|
|
314
|
+
}
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
Available entity types summary:
|
|
318
|
+
- `User`, `Tenant`, `Shop`, `Role`, `ApiKey` - system entities
|
|
319
|
+
- `Sku`, `Brand`, `Category`, `Group`, `Status`, `Supplier`, `Warehouse`, `Marketplace` - shop data
|
|
320
|
+
- `SalesHistory`, `Leftover`, `SeasonalCoefficient` - time-series data
|
|
321
|
+
- `CompetitorProduct`, `CompetitorSale`, `SkuCompetitorMapping` - competitor data
|
|
322
|
+
|
|
323
|
+
### Import/Export Types
|
|
324
|
+
|
|
325
|
+
Import items use string codes for references (auto-resolved to IDs):
|
|
326
|
+
|
|
327
|
+
```typescript
|
|
328
|
+
interface ImportSkuItem {
|
|
329
|
+
code: string;
|
|
330
|
+
title: string;
|
|
331
|
+
title2?: string;
|
|
332
|
+
category?: string; // category code, auto-resolved
|
|
333
|
+
group?: string; // group code, auto-resolved
|
|
334
|
+
status?: string; // status code, auto-resolved
|
|
335
|
+
supplier?: string; // supplier code, auto-resolved
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// Import results include auto-creation counts
|
|
339
|
+
interface SkuImportResult extends ImportResult {
|
|
340
|
+
created: number;
|
|
341
|
+
updated: number;
|
|
342
|
+
errors: string[];
|
|
343
|
+
categories_created: number;
|
|
344
|
+
groups_created: number;
|
|
345
|
+
statuses_created: number;
|
|
346
|
+
suppliers_created: number;
|
|
347
|
+
}
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
### All Exported Types
|
|
116
351
|
|
|
117
352
|
```typescript
|
|
118
353
|
import type {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
354
|
+
// Query & Response
|
|
355
|
+
ShopContextParams, PaginationQuery, PaginatedResponse, PeriodQuery,
|
|
356
|
+
SalesHistoryQuery, LeftoverQuery, CompetitorSaleQuery, GetUserRolesQuery,
|
|
357
|
+
|
|
358
|
+
// System Entities
|
|
359
|
+
User, Tenant, Shop, Role, ApiKey, UserRoleResponse,
|
|
360
|
+
|
|
361
|
+
// Shop Data Entities
|
|
362
|
+
Sku, Brand, Category, Group, Status, Supplier, Warehouse, Marketplace,
|
|
363
|
+
|
|
364
|
+
// Time-Series Entities
|
|
365
|
+
SalesHistory, Leftover, SeasonalCoefficient,
|
|
366
|
+
|
|
367
|
+
// Competitor Entities
|
|
368
|
+
CompetitorProduct, CompetitorSale, SkuCompetitorMapping,
|
|
369
|
+
|
|
370
|
+
// User/Me Response Types
|
|
371
|
+
UserWithRolesAndTenants, UserRole, TenantInfo, ShopInfo,
|
|
372
|
+
|
|
373
|
+
// Create/Update Requests
|
|
374
|
+
CreateSkuRequest, UpdateSkuRequest,
|
|
375
|
+
CreateUserRequest, UpdateUserRequest,
|
|
376
|
+
CreateTenantRequest, UpdateTenantRequest,
|
|
377
|
+
CreateShopRequest, UpdateShopRequest,
|
|
378
|
+
CreateApiKeyRequest,
|
|
379
|
+
|
|
380
|
+
// Import Items (use string codes, auto-resolved)
|
|
381
|
+
ImportSkuItem, ImportSalesHistoryItem, ImportLeftoverItem,
|
|
382
|
+
ImportSeasonalCoefficientItem, ImportSkuCompetitorMappingItem,
|
|
383
|
+
ImportCompetitorProductItem, ImportCompetitorSaleItem,
|
|
384
|
+
ImportBrandItem, ImportCategoryItem, ImportGroupItem,
|
|
385
|
+
ImportStatusItem, ImportSupplierItem, ImportWarehouseItem, ImportMarketplaceItem,
|
|
386
|
+
|
|
387
|
+
// Export Items
|
|
388
|
+
SkuExportItem, SalesHistoryExportItem, LeftoverExportItem,
|
|
389
|
+
SeasonalCoefficientExportItem, SkuCompetitorMappingExportItem,
|
|
390
|
+
CompetitorProductExportItem, CompetitorSaleExportItem,
|
|
391
|
+
BrandExportItem, CategoryExportItem, GroupExportItem,
|
|
392
|
+
StatusExportItem, SupplierExportItem, WarehouseExportItem, MarketplaceExportItem,
|
|
393
|
+
|
|
394
|
+
// Results
|
|
395
|
+
ImportResult, SkuImportResult, SalesHistoryImportResult, DeleteDataResult,
|
|
396
|
+
|
|
397
|
+
// Metadata (for UI documentation)
|
|
398
|
+
EntitiesMetadata, EntityMetadata, EntityFieldMetadata, FieldType,
|
|
123
399
|
} from '@sales-planner/http-client';
|
|
124
400
|
```
|
|
125
401
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Brand, CreateBrandRequest, UpdateBrandRequest, ImportBrandItem, BrandExportItem, Category, CreateCategoryRequest, UpdateCategoryRequest, ImportCategoryItem, CategoryExportItem, Group, CreateGroupRequest, UpdateGroupRequest, ImportGroupItem, GroupExportItem, Status, CreateStatusRequest, UpdateStatusRequest, ImportStatusItem, StatusExportItem, Supplier, CreateSupplierRequest, UpdateSupplierRequest, ImportSupplierItem, SupplierExportItem, Warehouse, CreateWarehouseRequest, UpdateWarehouseRequest, ImportWarehouseItem, WarehouseExportItem, Marketplace, CreateMarketplaceRequest, UpdateMarketplaceRequest, ImportMarketplaceItem, MarketplaceExportItem, Role, CreateRoleRequest, UpdateRoleRequest, SalesHistory, CreateSalesHistoryRequest, UpdateSalesHistoryRequest, ImportSalesHistoryItem, SalesHistoryExportItem, SalesHistoryImportResult, SalesHistoryQuery } from '@sales-planner/shared';
|
|
1
|
+
import type { Brand, CreateBrandRequest, UpdateBrandRequest, ImportBrandItem, BrandExportItem, Category, CreateCategoryRequest, UpdateCategoryRequest, ImportCategoryItem, CategoryExportItem, CompetitorProduct, CreateCompetitorProductRequest, UpdateCompetitorProductRequest, ImportCompetitorProductItem, CompetitorProductExportItem, CompetitorSale, CreateCompetitorSaleRequest, UpdateCompetitorSaleRequest, ImportCompetitorSaleItem, CompetitorSaleExportItem, CompetitorSaleQuery, Group, CreateGroupRequest, UpdateGroupRequest, ImportGroupItem, GroupExportItem, Leftover, CreateLeftoverRequest, UpdateLeftoverRequest, ImportLeftoverItem, LeftoverExportItem, LeftoverQuery, Status, CreateStatusRequest, UpdateStatusRequest, ImportStatusItem, StatusExportItem, Supplier, CreateSupplierRequest, UpdateSupplierRequest, ImportSupplierItem, SupplierExportItem, SeasonalCoefficient, CreateSeasonalCoefficientRequest, UpdateSeasonalCoefficientRequest, ImportSeasonalCoefficientItem, SeasonalCoefficientExportItem, SkuCompetitorMapping, CreateSkuCompetitorMappingRequest, UpdateSkuCompetitorMappingRequest, ImportSkuCompetitorMappingItem, SkuCompetitorMappingExportItem, Warehouse, CreateWarehouseRequest, UpdateWarehouseRequest, ImportWarehouseItem, WarehouseExportItem, Marketplace, CreateMarketplaceRequest, UpdateMarketplaceRequest, ImportMarketplaceItem, MarketplaceExportItem, Role, CreateRoleRequest, UpdateRoleRequest, SalesHistory, CreateSalesHistoryRequest, UpdateSalesHistoryRequest, ImportSalesHistoryItem, SalesHistoryExportItem, SalesHistoryImportResult, SalesHistoryQuery, ImportResult } from '@sales-planner/shared';
|
|
2
2
|
import type { ClientConfig } from './base-client.js';
|
|
3
3
|
import { CodedEntityClient } from './coded-entity-client.js';
|
|
4
4
|
import { CrudClient } from './crud-client.js';
|
|
@@ -27,6 +27,11 @@ export declare class SalesPlannerClient {
|
|
|
27
27
|
readonly warehouses: CodedEntityClient<Warehouse, CreateWarehouseRequest, UpdateWarehouseRequest, ImportWarehouseItem, WarehouseExportItem>;
|
|
28
28
|
readonly marketplaces: CodedEntityClient<Marketplace, CreateMarketplaceRequest, UpdateMarketplaceRequest, ImportMarketplaceItem, MarketplaceExportItem>;
|
|
29
29
|
readonly salesHistory: ShopScopedClient<SalesHistory, CreateSalesHistoryRequest, UpdateSalesHistoryRequest, ImportSalesHistoryItem, SalesHistoryExportItem, SalesHistoryImportResult, SalesHistoryQuery>;
|
|
30
|
+
readonly leftovers: ShopScopedClient<Leftover, CreateLeftoverRequest, UpdateLeftoverRequest, ImportLeftoverItem, LeftoverExportItem, ImportResult, LeftoverQuery>;
|
|
31
|
+
readonly seasonalCoefficients: ShopScopedClient<SeasonalCoefficient, CreateSeasonalCoefficientRequest, UpdateSeasonalCoefficientRequest, ImportSeasonalCoefficientItem, SeasonalCoefficientExportItem, ImportResult, Record<string, never>>;
|
|
32
|
+
readonly skuCompetitorMappings: ShopScopedClient<SkuCompetitorMapping, CreateSkuCompetitorMappingRequest, UpdateSkuCompetitorMappingRequest, ImportSkuCompetitorMappingItem, SkuCompetitorMappingExportItem, ImportResult, Record<string, never>>;
|
|
33
|
+
readonly competitorProducts: ShopScopedClient<CompetitorProduct, CreateCompetitorProductRequest, UpdateCompetitorProductRequest, ImportCompetitorProductItem, CompetitorProductExportItem, ImportResult, Record<string, never>>;
|
|
34
|
+
readonly competitorSales: ShopScopedClient<CompetitorSale, CreateCompetitorSaleRequest, UpdateCompetitorSaleRequest, ImportCompetitorSaleItem, CompetitorSaleExportItem, ImportResult, CompetitorSaleQuery>;
|
|
30
35
|
readonly roles: CrudClient<Role, CreateRoleRequest, UpdateRoleRequest>;
|
|
31
36
|
readonly userRoles: UserRolesClient;
|
|
32
37
|
readonly apiKeys: ApiKeysClient;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sales-planner-client.d.ts","sourceRoot":"","sources":["../../src/clients/sales-planner-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,QAAQ,EACR,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,EACL,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,MAAM,EACN,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,QAAQ,EACR,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,SAAS,EACT,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,wBAAwB,EACxB,wBAAwB,EACxB,qBAAqB,EACrB,qBAAqB,EACrB,IAAI,EACJ,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"sales-planner-client.d.ts","sourceRoot":"","sources":["../../src/clients/sales-planner-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,QAAQ,EACR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EACZ,mBAAmB,CACpB,CAAC;IACF,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC,IAAI,EAAE,iBAAiB,EAAE,iBAAiB,CAAC,CAAC;IACvE,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;gBAEpB,MAAM,EAAE,YAAY;IA2B1B,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC;IAQ1B,SAAS,IAAI,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAOhE"}
|
|
@@ -27,6 +27,11 @@ export class SalesPlannerClient {
|
|
|
27
27
|
warehouses;
|
|
28
28
|
marketplaces;
|
|
29
29
|
salesHistory;
|
|
30
|
+
leftovers;
|
|
31
|
+
seasonalCoefficients;
|
|
32
|
+
skuCompetitorMappings;
|
|
33
|
+
competitorProducts;
|
|
34
|
+
competitorSales;
|
|
30
35
|
roles;
|
|
31
36
|
userRoles;
|
|
32
37
|
apiKeys;
|
|
@@ -46,6 +51,11 @@ export class SalesPlannerClient {
|
|
|
46
51
|
this.warehouses = new CodedEntityClient(config, 'warehouses');
|
|
47
52
|
this.marketplaces = new CodedEntityClient(config, 'marketplaces');
|
|
48
53
|
this.salesHistory = new ShopScopedClient(config, 'sales-history');
|
|
54
|
+
this.leftovers = new ShopScopedClient(config, 'leftovers');
|
|
55
|
+
this.seasonalCoefficients = new ShopScopedClient(config, 'seasonal-coefficients');
|
|
56
|
+
this.skuCompetitorMappings = new ShopScopedClient(config, 'sku-competitor-mappings');
|
|
57
|
+
this.competitorProducts = new ShopScopedClient(config, 'competitor-products');
|
|
58
|
+
this.competitorSales = new ShopScopedClient(config, 'competitor-sales');
|
|
49
59
|
this.roles = new CrudClient(config, 'roles');
|
|
50
60
|
this.userRoles = new UserRolesClient(config);
|
|
51
61
|
this.apiKeys = new ApiKeysClient(config);
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { SalesPlannerClient, ApiError } from './clients/index.js';
|
|
2
2
|
export type { ClientConfig } from './clients/index.js';
|
|
3
|
-
export type { User, Tenant, Shop, Sku, SalesHistory, Role, UserRole, ApiKey, Marketplace, CreateUserDto, CreateTenantDto, CreateTenantWithShopDto, CreateShopDto, CreateSkuDto, CreateSkuRequest, UpdateSkuDto, UpdateSkuRequest, ImportSkuItem, CreateSalesHistoryDto, CreateSalesHistoryRequest, UpdateSalesHistoryDto, ImportSalesHistoryItem, CreateApiKeyDto, CreateRoleDto, CreateUserRoleDto, CreateMarketplaceDto, CreateMarketplaceRequest, ShopContextParams, PeriodQuery, UserWithRolesAndTenants, TenantWithShopAndApiKey, ImportResult, DeleteDataResult, SkuExportItem, SalesHistoryExportItem, EntityFieldMetadata, EntityMetadata, EntitiesMetadata, FieldType, } from '@sales-planner/shared';
|
|
3
|
+
export type { User, Tenant, Shop, Sku, SalesHistory, Role, UserRole, ApiKey, Marketplace, Leftover, SeasonalCoefficient, SkuCompetitorMapping, CompetitorProduct, CompetitorSale, CreateUserDto, CreateTenantDto, CreateTenantWithShopDto, CreateShopDto, CreateSkuDto, CreateSkuRequest, UpdateSkuDto, UpdateSkuRequest, ImportSkuItem, CreateSalesHistoryDto, CreateSalesHistoryRequest, UpdateSalesHistoryDto, ImportSalesHistoryItem, CreateLeftoverDto, CreateLeftoverRequest, UpdateLeftoverDto, ImportLeftoverItem, CreateSeasonalCoefficientDto, CreateSeasonalCoefficientRequest, UpdateSeasonalCoefficientDto, ImportSeasonalCoefficientItem, CreateSkuCompetitorMappingDto, CreateSkuCompetitorMappingRequest, UpdateSkuCompetitorMappingDto, ImportSkuCompetitorMappingItem, CreateCompetitorProductDto, CreateCompetitorProductRequest, UpdateCompetitorProductDto, ImportCompetitorProductItem, CreateCompetitorSaleDto, CreateCompetitorSaleRequest, UpdateCompetitorSaleDto, ImportCompetitorSaleItem, CreateApiKeyDto, CreateRoleDto, CreateUserRoleDto, CreateMarketplaceDto, CreateMarketplaceRequest, ShopContextParams, PeriodQuery, LeftoverQuery, CompetitorSaleQuery, UserWithRolesAndTenants, TenantWithShopAndApiKey, ImportResult, DeleteDataResult, SkuExportItem, SalesHistoryExportItem, LeftoverExportItem, SeasonalCoefficientExportItem, SkuCompetitorMappingExportItem, CompetitorProductExportItem, CompetitorSaleExportItem, EntityFieldMetadata, EntityMetadata, EntitiesMetadata, FieldType, } from '@sales-planner/shared';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAClE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD,YAAY,EAEV,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,GAAG,EACH,YAAY,EACZ,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAClE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD,YAAY,EAEV,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,GAAG,EACH,YAAY,EACZ,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,WAAW,EACX,QAAQ,EACR,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,cAAc,EAEd,aAAa,EACb,eAAe,EACf,uBAAuB,EACvB,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,4BAA4B,EAC5B,gCAAgC,EAChC,4BAA4B,EAC5B,6BAA6B,EAC7B,6BAA6B,EAC7B,iCAAiC,EACjC,6BAA6B,EAC7B,8BAA8B,EAC9B,0BAA0B,EAC1B,8BAA8B,EAC9B,0BAA0B,EAC1B,2BAA2B,EAC3B,uBAAuB,EACvB,2BAA2B,EAC3B,uBAAuB,EACvB,wBAAwB,EACxB,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,oBAAoB,EACpB,wBAAwB,EAExB,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,mBAAmB,EAEnB,uBAAuB,EACvB,uBAAuB,EACvB,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,sBAAsB,EACtB,kBAAkB,EAClB,6BAA6B,EAC7B,8BAA8B,EAC9B,2BAA2B,EAC3B,wBAAwB,EAExB,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,SAAS,GACV,MAAM,uBAAuB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sales-planner/http-client",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.2",
|
|
4
4
|
"description": "HTTP client for Sales Planner API",
|
|
5
5
|
"author": "Damir Manapov",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,17 +23,17 @@
|
|
|
23
23
|
"dist",
|
|
24
24
|
"README.md"
|
|
25
25
|
],
|
|
26
|
-
"dependencies": {
|
|
27
|
-
"@sales-planner/shared": "0.15.0"
|
|
28
|
-
},
|
|
29
|
-
"devDependencies": {
|
|
30
|
-
"typescript": "^5.7.3"
|
|
31
|
-
},
|
|
32
26
|
"scripts": {
|
|
33
27
|
"build": "tsc",
|
|
34
28
|
"typecheck": "tsc --noEmit",
|
|
35
29
|
"lint": "biome lint --error-on-warnings src",
|
|
36
30
|
"format": "biome format --write src",
|
|
37
31
|
"format:check": "biome format src"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@sales-planner/shared": "workspace:*"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"typescript": "^5.7.3"
|
|
38
38
|
}
|
|
39
|
-
}
|
|
39
|
+
}
|