daytona-wildberries-typescript-sdk 3.9.3 → 3.10.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/README.md CHANGED
@@ -25,30 +25,36 @@
25
25
 
26
26
  # English Version
27
27
 
28
- Transform 11 OpenAPI specifications into a production-ready SDK with 13 modules, complete type safety, automatic rate limiting, retry mechanisms, and comprehensive error handling. Reduce integration time from weeks to hours.
28
+ Transform 11 OpenAPI specifications into a production-ready SDK with 14 modules, complete type safety, automatic rate limiting, retry mechanisms, and comprehensive error handling. Reduce integration time from weeks to hours.
29
29
 
30
30
  ## ✨ Features
31
31
 
32
- - **🔐 Complete Type Safety** - Auto-generated TypeScript types from OpenAPI specifications for all 13 API modules
32
+ - **🔐 Complete Type Safety** - Auto-generated TypeScript types from OpenAPI specifications for all 14 API modules
33
33
  - **⚡ Automatic Rate Limiting** - Built-in enforcement of per-endpoint rate limits with intelligent queuing and Basic/Test token multipliers
34
34
  - **🔄 Smart Retry Logic** - Exponential backoff retry mechanism for transient failures with per-request timeout support
35
35
  - **🛡️ Rich Error Handling** - Typed error hierarchy with detailed recovery guidance
36
36
  - **📦 Tree-Shakeable** - Dual ESM/CommonJS builds, import only what you need (<100KB gzipped)
37
- - **✅ Battle-Tested** - 2,169 tests passing across all modules
37
+ - **✅ Battle-Tested** - 2,207 tests passing across all modules
38
38
  - **🎯 100% API Coverage** - All YAML endpoints implemented including v1 Finance Reports and Acquiring Reports
39
39
  - **📚 Comprehensive Documentation** - Complete API reference, 44 guides, tutorials, and working examples in English and Russian
40
40
  - **🔧 Zero Configuration** - Works out of the box with sensible defaults, configurable for advanced use
41
41
  - **💰 Finance v1 Reports** - Sales Reports and Acquiring Reports with `parseMoneyAmount()` helper and field union types for autocomplete
42
42
  - **🔔 Deprecation Utilities** - `warnOnce()` and `resetDeprecationWarnings()` for clean migration workflows
43
43
 
44
- ## 🆕 What's New in v3.9.3
44
+ ## What's New (v3.10.0) — May 2026
45
45
 
46
- - **`classifyReturnReason(reason)`** -- pure helper mapping free-text Russian return reasons to standardized `ReturnReasonCode` enum (`damage`, `defect`, `wrong_size`, `wrong_item`, `customer_refused`, `expired`, `not_as_described`, `other`)
47
- - **`enrichReturnsWithType(fboReturns, fbsReturns?)`** -- combines FBO returns from `getAnalyticsGoodsReturn()` with optional FBS returns into unified `WbReturn[]` with explicit `orderType: 'fbo' | 'fbs'`, `reasonCode`, `quantity`
48
- - **`reconcileBuyoutsAndReturns(buyouts, returns, options?)`** -- per-nmId reconciliation with anomaly detection (`return_without_buyout`, `orphan_buyout`)
49
- - **New types** -- `WbReturn`, `FbsReturnInput`, `BuyoutInput`, `ReconciliationResult`, `ReconciliationAnomaly`, `ReconcileOptions`, `ReturnReasonCode` exported from main SDK
50
- - **New guide** -- EN+RU [Buyout & Return Reconciliation](https://salacoste.github.io/daytona-wildberries-typescript-sdk/guides/buyout-return-reconciliation) with end-to-end example
51
- - **2169 tests** passing (+24 new)
46
+ 🆕 **`sdk.returns` aggregator module** single source of truth for return analytics. Combines FBO + FBS + Finance sources via `Promise.allSettled` with srid-based deduplication and per-source telemetry. Three methods:
47
+ - `sdk.returns.getReturns({ dateFrom, dateTo, ... })` primary aggregator with partial-failure tolerance
48
+ - `sdk.returns.getReturnByOrderId(orderId, ...)` single-record lookup
49
+ - `sdk.returns.getReturnStats({ groupBy: 'nmId' | 'category' | 'orderType' })` aggregation buckets
50
+
51
+ 🆕 **`classifyFbsReturnCategory()`** heuristic FBS status history → return category enum
52
+
53
+ 📚 **New EN+RU guide**: [Returns Module](https://salacoste.github.io/daytona-wildberries-typescript-sdk/guides/returns-module) with Mermaid diagram, limitations table, and 4 copy-paste recipes
54
+
55
+ ✅ **2207 tests passing**, 25 code review findings fixed (all severities)
56
+
57
+ - **v3.9.3** -- `classifyReturnReason()`, `enrichReturnsWithType()`, `reconcileBuyoutsAndReturns()` helpers + new guide
52
58
  - **v3.9.2** -- `isVariable` field + `validateMergedCardVariants()` helper
53
59
  - **v3.9.1** -- `validateRequiredCharacteristics()` helper for required-field pre-flight checks
54
60
  - **v3.9.0** -- Mandatory product characteristics support (`isRequiredForCreate`), characteristic input/output types, DRY refactor
@@ -162,7 +168,7 @@ const reportFile = await longTimeoutSdk.analytics.getDownloadsFile(downloadId);
162
168
 
163
169
  ## 📊 Project Status & Development
164
170
 
165
- **Current Status:** 🟢 Production Ready | **SDK Version:** 3.9.2
171
+ **Current Status:** 🟢 Production Ready | **SDK Version:** 3.10.0
166
172
 
167
173
  **📖 [Project Status Summary](PROJECT_STATUS_SUMMARY.md)** — Comprehensive overview of all epics, stories, and implementation status.
168
174
 
@@ -170,9 +176,9 @@ const reportFile = await longTimeoutSdk.analytics.getDownloadsFile(downloadId);
170
176
 
171
177
  | Metric | Value |
172
178
  |--------|-------|
173
- | **API Modules** | 13 (100%) |
179
+ | **API Modules** | 14 (100%) |
174
180
  | **API Endpoints** | 240+ implemented |
175
- | **Test Suite** | 2,169 tests passing (100%) |
181
+ | **Test Suite** | 2,207 tests passing (100%) |
176
182
  | **Documentation** | 44 guides, 22 examples |
177
183
  | **Bundle Size** | ~91KB gzipped (ESM) |
178
184
 
@@ -197,7 +203,7 @@ const reportFile = await longTimeoutSdk.analytics.getDownloadsFile(downloadId);
197
203
 
198
204
  ## 🎯 Supported API Modules
199
205
 
200
- All 13 Wildberries API modules are fully supported with 100% API coverage:
206
+ All 14 Wildberries API modules are fully supported with 100% API coverage:
201
207
 
202
208
  | Module | Description |
203
209
  |--------|-------------|
@@ -214,6 +220,7 @@ All 13 Wildberries API modules are fully supported with 100% API coverage:
214
220
  | **Tariffs** | Commission rates, fee schedules |
215
221
  | **In-Store Pickup** | Pickup point orders and management |
216
222
  | **User Management** | Seller profile user management |
223
+ | **Returns** | Unified return analytics aggregator (FBO + FBS + Finance), `getReturns()`, `getReturnByOrderId()`, `getReturnStats()` |
217
224
 
218
225
  ## 📄 License
219
226
 
@@ -256,30 +263,36 @@ This is an unofficial SDK. It is not affiliated with, officially maintained by,
256
263
 
257
264
  # Русская Версия
258
265
 
259
- Преобразуйте 11 OpenAPI спецификаций в production-готовый SDK с 13 модулями, полной типобезопасностью, автоматическими лимитами запросов, механизмами повторных попыток и комплексной обработкой ошибок. Сократите время интеграции с недель до часов.
266
+ Преобразуйте 11 OpenAPI спецификаций в production-готовый SDK с 14 модулями, полной типобезопасностью, автоматическими лимитами запросов, механизмами повторных попыток и комплексной обработкой ошибок. Сократите время интеграции с недель до часов.
260
267
 
261
268
  ## ✨ Возможности
262
269
 
263
- - **🔐 Полная Типобезопасность** - Автоматически генерируемые TypeScript типы из OpenAPI для всех 13 модулей
270
+ - **🔐 Полная Типобезопасность** - Автоматически генерируемые TypeScript типы из OpenAPI для всех 14 модулей
264
271
  - **⚡ Автоматические Лимиты Запросов** - Встроенное соблюдение лимитов для каждой конечной точки с умной очередью и множителями для Basic/Test токенов
265
272
  - **🔄 Умная Логика Повторов** - Экспоненциальная задержка для временных сбоев с поддержкой таймаута для каждого запроса
266
273
  - **🛡️ Богатая Обработка Ошибок** - Типизированная иерархия ошибок с подробными рекомендациями
267
274
  - **📦 Tree-Shakeable** - Двойная сборка ESM/CommonJS, импортируйте только то, что нужно (<100KB gzip)
268
- - **✅ Проверено в Бою** - 2,169 тестов для всех модулей
275
+ - **✅ Проверено в Бою** - 2,207 тестов для всех модулей
269
276
  - **🎯 100% Покрытие API** - Все эндпоинты YAML реализованы, включая Финансовые Отчеты v1 и Эквайринг
270
277
  - **📚 Полная Документация** - Справочник API, 44 руководства, примеры на английском и русском
271
278
  - **🔧 Без Настройки** - Работает из коробки с разумными значениями по умолчанию
272
279
  - **💰 Финансовые Отчеты v1** - Отчеты о продажах и эквайринге с хелпером `parseMoneyAmount()` и union-типами полей для автодополнения
273
280
  - **🔔 Утилиты Для Устаревших Методов** - `warnOnce()` и `resetDeprecationWarnings()` для удобной миграции
274
281
 
275
- ## 🆕 Что Нового в v3.9.3
282
+ ## Что Нового (v3.10.0) — Май 2026
283
+
284
+ 🆕 **Агрегаторный модуль `sdk.returns`** — единый источник истины для аналитики возвратов. Объединяет источники FBO + FBS + Finance через `Promise.allSettled` с дедупликацией по srid и телеметрией по каждому источнику. Три метода:
285
+ - `sdk.returns.getReturns({ dateFrom, dateTo, ... })` — основной агрегатор с устойчивостью к частичным сбоям
286
+ - `sdk.returns.getReturnByOrderId(orderId, ...)` — поиск одной записи
287
+ - `sdk.returns.getReturnStats({ groupBy: 'nmId' | 'category' | 'orderType' })` — агрегация по группам
288
+
289
+ 🆕 **`classifyFbsReturnCategory()`** — эвристический хелпер: история статусов FBS → enum категории возврата
290
+
291
+ 📚 **Новое руководство EN+RU**: [Модуль Returns](https://salacoste.github.io/daytona-wildberries-typescript-sdk/ru/guides/returns-module) с диаграммой Mermaid, таблицей ограничений и 4 готовыми рецептами
292
+
293
+ ✅ **2207 тестов проходят**, исправлено 25 замечаний по code review (все уровни серьёзности)
276
294
 
277
- - **`classifyReturnReason(reason)`** -- чистый хелпер для перевода свободного текста причин возврата (на русском) в стандартизированный enum `ReturnReasonCode` (`damage`, `defect`, `wrong_size`, `wrong_item`, `customer_refused`, `expired`, `not_as_described`, `other`)
278
- - **`enrichReturnsWithType(fboReturns, fbsReturns?)`** -- объединяет FBO-возвраты из `getAnalyticsGoodsReturn()` с необязательными FBS-возвратами в единый `WbReturn[]` с явным `orderType: 'fbo' | 'fbs'`, `reasonCode`, `quantity`
279
- - **`reconcileBuyoutsAndReturns(buyouts, returns, options?)`** -- сверка по nmId с обнаружением аномалий (`return_without_buyout`, `orphan_buyout`)
280
- - **Новые типы** -- `WbReturn`, `FbsReturnInput`, `BuyoutInput`, `ReconciliationResult`, `ReconciliationAnomaly`, `ReconcileOptions`, `ReturnReasonCode` экспортируются из основного SDK
281
- - **Новое руководство** -- EN+RU [Сверка Выкупов и Возвратов](https://salacoste.github.io/daytona-wildberries-typescript-sdk/ru/guides/buyout-return-reconciliation) с примером от начала до конца
282
- - **2169 тестов** проходят (+24 новых)
295
+ - **v3.9.3** -- хелперы `classifyReturnReason()`, `enrichReturnsWithType()`, `reconcileBuyoutsAndReturns()` + новое руководство
283
296
  - **v3.9.2** -- поле `isVariable` + хелпер `validateMergedCardVariants()`
284
297
  - **v3.9.1** -- хелпер `validateRequiredCharacteristics()` для предварительной проверки обязательных полей
285
298
  - **v3.9.0** -- поддержка обязательных характеристик товаров (`isRequiredForCreate`), типы ввода/вывода характеристик, DRY-рефакторинг
@@ -393,7 +406,7 @@ const reportFile = await longTimeoutSdk.analytics.getDownloadsFile(downloadId);
393
406
 
394
407
  ## 📊 Статус Проекта и Разработка
395
408
 
396
- **Текущий Статус:** 🟢 Production Ready | **Версия SDK:** 3.9.2
409
+ **Текущий Статус:** 🟢 Production Ready | **Версия SDK:** 3.10.0
397
410
 
398
411
  **📖 [Project Status Summary](PROJECT_STATUS_SUMMARY.md)** — Комплексный обзор всех эпиков, историй и статуса реализации.
399
412
 
@@ -401,9 +414,9 @@ const reportFile = await longTimeoutSdk.analytics.getDownloadsFile(downloadId);
401
414
 
402
415
  | Метрика | Значение |
403
416
  |---------|----------|
404
- | **API модули** | 13 (100%) |
417
+ | **API модули** | 14 (100%) |
405
418
  | **API эндпоинты** | 240+ реализовано |
406
- | **Тесты** | 2,169 тестов проходят (100%) |
419
+ | **Тесты** | 2,207 тестов проходят (100%) |
407
420
  | **Документация** | 44 руководства, 22 примера |
408
421
  | **Размер бандла** | ~91KB gzipped (ESM) |
409
422
 
@@ -428,7 +441,7 @@ const reportFile = await longTimeoutSdk.analytics.getDownloadsFile(downloadId);
428
441
 
429
442
  ## 🎯 Поддерживаемые Модули API
430
443
 
431
- Все 13 модулей Wildberries API полностью поддерживаются со 100% покрытием API:
444
+ Все 14 модулей Wildberries API полностью поддерживаются со 100% покрытием API:
432
445
 
433
446
  | Модуль | Описание |
434
447
  |--------|----------|
@@ -445,6 +458,7 @@ const reportFile = await longTimeoutSdk.analytics.getDownloadsFile(downloadId);
445
458
  | **Tariffs** | Ставки комиссий, тарифные планы |
446
459
  | **In-Store Pickup** | Заказы с самовывозом и управление |
447
460
  | **User Management** | Управление пользователями профиля продавца |
461
+ | **Returns** | Агрегатор возвратов (FBO + FBS + Finance), `getReturns()`, `getReturnByOrderId()`, `getReturnStats()` |
448
462
 
449
463
  ## 📄 Лицензия
450
464