daytona-wildberries-typescript-sdk 3.9.2 → 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,28 +25,37 @@
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,129 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.2
44
+ ## What's New (v3.10.0) — May 2026
45
45
 
46
- - **`isVariable` field on `SubjectCharacteristic`** -- indicates whether merged card variants can differ on this characteristic (returned by `getObjectCharc()`)
47
- - **`validateMergedCardVariants()` helper** -- pure client-side validator detecting divergent fixed characteristics, identical variable characteristics, and duplicate variants before submission
48
- - **New types** -- `MergedCardVariant`, `MergedCardValidationResult` exported from main SDK
49
- - **Updated guides** -- EN+RU "Mandatory Product Characteristics" and "Product Card Merging" guides with new variable/fixed section and pre-flight check examples
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
58
+ - **v3.9.2** -- `isVariable` field + `validateMergedCardVariants()` helper
50
59
  - **v3.9.1** -- `validateRequiredCharacteristics()` helper for required-field pre-flight checks
51
60
  - **v3.9.0** -- Mandatory product characteristics support (`isRequiredForCreate`), characteristic input/output types, DRY refactor
52
61
 
@@ -159,7 +168,7 @@ const reportFile = await longTimeoutSdk.analytics.getDownloadsFile(downloadId);
159
168
 
160
169
  ## 📊 Project Status & Development
161
170
 
162
- **Current Status:** 🟢 Production Ready | **SDK Version:** 3.9.2
171
+ **Current Status:** 🟢 Production Ready | **SDK Version:** 3.10.0
163
172
 
164
173
  **📖 [Project Status Summary](PROJECT_STATUS_SUMMARY.md)** — Comprehensive overview of all epics, stories, and implementation status.
165
174
 
@@ -167,9 +176,9 @@ const reportFile = await longTimeoutSdk.analytics.getDownloadsFile(downloadId);
167
176
 
168
177
  | Metric | Value |
169
178
  |--------|-------|
170
- | **API Modules** | 13 (100%) |
179
+ | **API Modules** | 14 (100%) |
171
180
  | **API Endpoints** | 240+ implemented |
172
- | **Test Suite** | 2,129 tests passing (100%) |
181
+ | **Test Suite** | 2,207 tests passing (100%) |
173
182
  | **Documentation** | 44 guides, 22 examples |
174
183
  | **Bundle Size** | ~91KB gzipped (ESM) |
175
184
 
@@ -194,7 +203,7 @@ const reportFile = await longTimeoutSdk.analytics.getDownloadsFile(downloadId);
194
203
 
195
204
  ## 🎯 Supported API Modules
196
205
 
197
- 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:
198
207
 
199
208
  | Module | Description |
200
209
  |--------|-------------|
@@ -211,6 +220,7 @@ All 13 Wildberries API modules are fully supported with 100% API coverage:
211
220
  | **Tariffs** | Commission rates, fee schedules |
212
221
  | **In-Store Pickup** | Pickup point orders and management |
213
222
  | **User Management** | Seller profile user management |
223
+ | **Returns** | Unified return analytics aggregator (FBO + FBS + Finance), `getReturns()`, `getReturnByOrderId()`, `getReturnStats()` |
214
224
 
215
225
  ## 📄 License
216
226
 
@@ -253,28 +263,37 @@ This is an unofficial SDK. It is not affiliated with, officially maintained by,
253
263
 
254
264
  # Русская Версия
255
265
 
256
- Преобразуйте 11 OpenAPI спецификаций в production-готовый SDK с 13 модулями, полной типобезопасностью, автоматическими лимитами запросов, механизмами повторных попыток и комплексной обработкой ошибок. Сократите время интеграции с недель до часов.
266
+ Преобразуйте 11 OpenAPI спецификаций в production-готовый SDK с 14 модулями, полной типобезопасностью, автоматическими лимитами запросов, механизмами повторных попыток и комплексной обработкой ошибок. Сократите время интеграции с недель до часов.
257
267
 
258
268
  ## ✨ Возможности
259
269
 
260
- - **🔐 Полная Типобезопасность** - Автоматически генерируемые TypeScript типы из OpenAPI для всех 13 модулей
270
+ - **🔐 Полная Типобезопасность** - Автоматически генерируемые TypeScript типы из OpenAPI для всех 14 модулей
261
271
  - **⚡ Автоматические Лимиты Запросов** - Встроенное соблюдение лимитов для каждой конечной точки с умной очередью и множителями для Basic/Test токенов
262
272
  - **🔄 Умная Логика Повторов** - Экспоненциальная задержка для временных сбоев с поддержкой таймаута для каждого запроса
263
273
  - **🛡️ Богатая Обработка Ошибок** - Типизированная иерархия ошибок с подробными рекомендациями
264
274
  - **📦 Tree-Shakeable** - Двойная сборка ESM/CommonJS, импортируйте только то, что нужно (<100KB gzip)
265
- - **✅ Проверено в Бою** - 2,129 тестов для всех модулей
275
+ - **✅ Проверено в Бою** - 2,207 тестов для всех модулей
266
276
  - **🎯 100% Покрытие API** - Все эндпоинты YAML реализованы, включая Финансовые Отчеты v1 и Эквайринг
267
277
  - **📚 Полная Документация** - Справочник API, 44 руководства, примеры на английском и русском
268
278
  - **🔧 Без Настройки** - Работает из коробки с разумными значениями по умолчанию
269
279
  - **💰 Финансовые Отчеты v1** - Отчеты о продажах и эквайринге с хелпером `parseMoneyAmount()` и union-типами полей для автодополнения
270
280
  - **🔔 Утилиты Для Устаревших Методов** - `warnOnce()` и `resetDeprecationWarnings()` для удобной миграции
271
281
 
272
- ## 🆕 Что Нового в v3.9.2
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 (все уровни серьёзности)
273
294
 
274
- - **Поле `isVariable` в `SubjectCharacteristic`** -- указывает, могут ли варианты объединённой карточки отличаться по этой характеристике (возвращается `getObjectCharc()`)
275
- - **Хелпер `validateMergedCardVariants()`** -- клиентская валидация вариантов объединённой карточки: обнаруживает расходящиеся фиксированные характеристики, одинаковые вариативные и дублирующиеся варианты до отправки
276
- - **Новые типы** -- `MergedCardVariant`, `MergedCardValidationResult` экспортируются из основного SDK
277
- - **Обновлённые руководства** -- EN+RU "Обязательные характеристики товаров" и "Объединение карточек товаров" с новыми разделами о переменных/фиксированных характеристиках и примером предполётной проверки
295
+ - **v3.9.3** -- хелперы `classifyReturnReason()`, `enrichReturnsWithType()`, `reconcileBuyoutsAndReturns()` + новое руководство
296
+ - **v3.9.2** -- поле `isVariable` + хелпер `validateMergedCardVariants()`
278
297
  - **v3.9.1** -- хелпер `validateRequiredCharacteristics()` для предварительной проверки обязательных полей
279
298
  - **v3.9.0** -- поддержка обязательных характеристик товаров (`isRequiredForCreate`), типы ввода/вывода характеристик, DRY-рефакторинг
280
299
 
@@ -387,7 +406,7 @@ const reportFile = await longTimeoutSdk.analytics.getDownloadsFile(downloadId);
387
406
 
388
407
  ## 📊 Статус Проекта и Разработка
389
408
 
390
- **Текущий Статус:** 🟢 Production Ready | **Версия SDK:** 3.9.2
409
+ **Текущий Статус:** 🟢 Production Ready | **Версия SDK:** 3.10.0
391
410
 
392
411
  **📖 [Project Status Summary](PROJECT_STATUS_SUMMARY.md)** — Комплексный обзор всех эпиков, историй и статуса реализации.
393
412
 
@@ -395,9 +414,9 @@ const reportFile = await longTimeoutSdk.analytics.getDownloadsFile(downloadId);
395
414
 
396
415
  | Метрика | Значение |
397
416
  |---------|----------|
398
- | **API модули** | 13 (100%) |
417
+ | **API модули** | 14 (100%) |
399
418
  | **API эндпоинты** | 240+ реализовано |
400
- | **Тесты** | 2,129 тестов проходят (100%) |
419
+ | **Тесты** | 2,207 тестов проходят (100%) |
401
420
  | **Документация** | 44 руководства, 22 примера |
402
421
  | **Размер бандла** | ~91KB gzipped (ESM) |
403
422
 
@@ -422,7 +441,7 @@ const reportFile = await longTimeoutSdk.analytics.getDownloadsFile(downloadId);
422
441
 
423
442
  ## 🎯 Поддерживаемые Модули API
424
443
 
425
- Все 13 модулей Wildberries API полностью поддерживаются со 100% покрытием API:
444
+ Все 14 модулей Wildberries API полностью поддерживаются со 100% покрытием API:
426
445
 
427
446
  | Модуль | Описание |
428
447
  |--------|----------|
@@ -439,6 +458,7 @@ const reportFile = await longTimeoutSdk.analytics.getDownloadsFile(downloadId);
439
458
  | **Tariffs** | Ставки комиссий, тарифные планы |
440
459
  | **In-Store Pickup** | Заказы с самовывозом и управление |
441
460
  | **User Management** | Управление пользователями профиля продавца |
461
+ | **Returns** | Агрегатор возвратов (FBO + FBS + Finance), `getReturns()`, `getReturnByOrderId()`, `getReturnStats()` |
442
462
 
443
463
  ## 📄 Лицензия
444
464