daytona-wildberries-typescript-sdk 3.9.3 → 3.10.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 +50 -28
- package/dist/cjs/index.cjs +13 -13
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.d.ts +29 -2
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +990 -638
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/modules/orders-dbs/index.d.ts +4 -1
- package/dist/esm/modules/orders-dbs/index.d.ts.map +1 -1
- package/dist/esm/modules/returns/index.d.ts +133 -0
- package/dist/esm/modules/returns/index.d.ts.map +1 -0
- package/dist/esm/types/orders-dbs.types.d.ts +21 -0
- package/dist/esm/types/orders-dbs.types.d.ts.map +1 -1
- package/dist/esm/types/orders-fbs.types.d.ts +20 -0
- package/dist/esm/types/orders-fbs.types.d.ts.map +1 -1
- package/dist/esm/types/products.types.d.ts +33 -0
- package/dist/esm/types/products.types.d.ts.map +1 -1
- package/dist/esm/types/returns.types.d.ts +220 -0
- package/dist/esm/types/returns.types.d.ts.map +1 -0
- package/dist/esm/utils/classifyFbsReturnCategory.d.ts +48 -0
- package/dist/esm/utils/classifyFbsReturnCategory.d.ts.map +1 -0
- package/dist/esm/utils/index.d.ts +1 -0
- package/dist/esm/utils/index.d.ts.map +1 -1
- package/dist/esm/utils/validateMergedCardVariants.d.ts +30 -6
- package/dist/esm/utils/validateMergedCardVariants.d.ts.map +1 -1
- package/dist/esm/utils/validateRequiredCharacteristics.d.ts +25 -3
- package/dist/esm/utils/validateRequiredCharacteristics.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,30 +25,40 @@
|
|
|
25
25
|
|
|
26
26
|
# English Version
|
|
27
27
|
|
|
28
|
-
Transform 11 OpenAPI specifications into a production-ready SDK with
|
|
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
|
|
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,
|
|
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
|
-
##
|
|
44
|
+
## What's New (v3.10.2 hotfix)
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
-
|
|
46
|
+
🔧 **Bug fix**: `validateRequiredCharacteristics` and `validateMergedCardVariants` now correctly handle `existNamedField:true` characteristics (brand, height, length, etc.). See CHANGELOG v3.10.2 for migration details.
|
|
47
|
+
|
|
48
|
+
## What's New (v3.10.0) — May 2026
|
|
49
|
+
|
|
50
|
+
🆕 **`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:
|
|
51
|
+
- `sdk.returns.getReturns({ dateFrom, dateTo, ... })` — primary aggregator with partial-failure tolerance
|
|
52
|
+
- `sdk.returns.getReturnByOrderId(orderId, ...)` — single-record lookup
|
|
53
|
+
- `sdk.returns.getReturnStats({ groupBy: 'nmId' | 'category' | 'orderType' })` — aggregation buckets
|
|
54
|
+
|
|
55
|
+
🆕 **`classifyFbsReturnCategory()`** — heuristic FBS status history → return category enum
|
|
56
|
+
|
|
57
|
+
📚 **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
|
|
58
|
+
|
|
59
|
+
✅ **2207 tests passing**, 25 code review findings fixed (all severities)
|
|
60
|
+
|
|
61
|
+
- **v3.9.3** -- `classifyReturnReason()`, `enrichReturnsWithType()`, `reconcileBuyoutsAndReturns()` helpers + new guide
|
|
52
62
|
- **v3.9.2** -- `isVariable` field + `validateMergedCardVariants()` helper
|
|
53
63
|
- **v3.9.1** -- `validateRequiredCharacteristics()` helper for required-field pre-flight checks
|
|
54
64
|
- **v3.9.0** -- Mandatory product characteristics support (`isRequiredForCreate`), characteristic input/output types, DRY refactor
|
|
@@ -162,7 +172,7 @@ const reportFile = await longTimeoutSdk.analytics.getDownloadsFile(downloadId);
|
|
|
162
172
|
|
|
163
173
|
## 📊 Project Status & Development
|
|
164
174
|
|
|
165
|
-
**Current Status:** 🟢 Production Ready | **SDK Version:** 3.
|
|
175
|
+
**Current Status:** 🟢 Production Ready | **SDK Version:** 3.10.0
|
|
166
176
|
|
|
167
177
|
**📖 [Project Status Summary](PROJECT_STATUS_SUMMARY.md)** — Comprehensive overview of all epics, stories, and implementation status.
|
|
168
178
|
|
|
@@ -170,9 +180,9 @@ const reportFile = await longTimeoutSdk.analytics.getDownloadsFile(downloadId);
|
|
|
170
180
|
|
|
171
181
|
| Metric | Value |
|
|
172
182
|
|--------|-------|
|
|
173
|
-
| **API Modules** |
|
|
183
|
+
| **API Modules** | 14 (100%) |
|
|
174
184
|
| **API Endpoints** | 240+ implemented |
|
|
175
|
-
| **Test Suite** | 2,
|
|
185
|
+
| **Test Suite** | 2,207 tests passing (100%) |
|
|
176
186
|
| **Documentation** | 44 guides, 22 examples |
|
|
177
187
|
| **Bundle Size** | ~91KB gzipped (ESM) |
|
|
178
188
|
|
|
@@ -197,7 +207,7 @@ const reportFile = await longTimeoutSdk.analytics.getDownloadsFile(downloadId);
|
|
|
197
207
|
|
|
198
208
|
## 🎯 Supported API Modules
|
|
199
209
|
|
|
200
|
-
All
|
|
210
|
+
All 14 Wildberries API modules are fully supported with 100% API coverage:
|
|
201
211
|
|
|
202
212
|
| Module | Description |
|
|
203
213
|
|--------|-------------|
|
|
@@ -214,6 +224,7 @@ All 13 Wildberries API modules are fully supported with 100% API coverage:
|
|
|
214
224
|
| **Tariffs** | Commission rates, fee schedules |
|
|
215
225
|
| **In-Store Pickup** | Pickup point orders and management |
|
|
216
226
|
| **User Management** | Seller profile user management |
|
|
227
|
+
| **Returns** | Unified return analytics aggregator (FBO + FBS + Finance), `getReturns()`, `getReturnByOrderId()`, `getReturnStats()` |
|
|
217
228
|
|
|
218
229
|
## 📄 License
|
|
219
230
|
|
|
@@ -256,30 +267,40 @@ This is an unofficial SDK. It is not affiliated with, officially maintained by,
|
|
|
256
267
|
|
|
257
268
|
# Русская Версия
|
|
258
269
|
|
|
259
|
-
Преобразуйте 11 OpenAPI спецификаций в production-готовый SDK с
|
|
270
|
+
Преобразуйте 11 OpenAPI спецификаций в production-готовый SDK с 14 модулями, полной типобезопасностью, автоматическими лимитами запросов, механизмами повторных попыток и комплексной обработкой ошибок. Сократите время интеграции с недель до часов.
|
|
260
271
|
|
|
261
272
|
## ✨ Возможности
|
|
262
273
|
|
|
263
|
-
- **🔐 Полная Типобезопасность** - Автоматически генерируемые TypeScript типы из OpenAPI для всех
|
|
274
|
+
- **🔐 Полная Типобезопасность** - Автоматически генерируемые TypeScript типы из OpenAPI для всех 14 модулей
|
|
264
275
|
- **⚡ Автоматические Лимиты Запросов** - Встроенное соблюдение лимитов для каждой конечной точки с умной очередью и множителями для Basic/Test токенов
|
|
265
276
|
- **🔄 Умная Логика Повторов** - Экспоненциальная задержка для временных сбоев с поддержкой таймаута для каждого запроса
|
|
266
277
|
- **🛡️ Богатая Обработка Ошибок** - Типизированная иерархия ошибок с подробными рекомендациями
|
|
267
278
|
- **📦 Tree-Shakeable** - Двойная сборка ESM/CommonJS, импортируйте только то, что нужно (<100KB gzip)
|
|
268
|
-
- **✅ Проверено в Бою** - 2,
|
|
279
|
+
- **✅ Проверено в Бою** - 2,207 тестов для всех модулей
|
|
269
280
|
- **🎯 100% Покрытие API** - Все эндпоинты YAML реализованы, включая Финансовые Отчеты v1 и Эквайринг
|
|
270
281
|
- **📚 Полная Документация** - Справочник API, 44 руководства, примеры на английском и русском
|
|
271
282
|
- **🔧 Без Настройки** - Работает из коробки с разумными значениями по умолчанию
|
|
272
283
|
- **💰 Финансовые Отчеты v1** - Отчеты о продажах и эквайринге с хелпером `parseMoneyAmount()` и union-типами полей для автодополнения
|
|
273
284
|
- **🔔 Утилиты Для Устаревших Методов** - `warnOnce()` и `resetDeprecationWarnings()` для удобной миграции
|
|
274
285
|
|
|
275
|
-
##
|
|
286
|
+
## Что нового (v3.10.2 hotfix)
|
|
287
|
+
|
|
288
|
+
🔧 **Исправление**: `validateRequiredCharacteristics` и `validateMergedCardVariants` теперь корректно обрабатывают характеристики с `existNamedField:true` (бренд, высота, длина и т.д.). Подробности миграции — в CHANGELOG v3.10.2.
|
|
289
|
+
|
|
290
|
+
## Что Нового (v3.10.0) — Май 2026
|
|
291
|
+
|
|
292
|
+
🆕 **Агрегаторный модуль `sdk.returns`** — единый источник истины для аналитики возвратов. Объединяет источники FBO + FBS + Finance через `Promise.allSettled` с дедупликацией по srid и телеметрией по каждому источнику. Три метода:
|
|
293
|
+
- `sdk.returns.getReturns({ dateFrom, dateTo, ... })` — основной агрегатор с устойчивостью к частичным сбоям
|
|
294
|
+
- `sdk.returns.getReturnByOrderId(orderId, ...)` — поиск одной записи
|
|
295
|
+
- `sdk.returns.getReturnStats({ groupBy: 'nmId' | 'category' | 'orderType' })` — агрегация по группам
|
|
296
|
+
|
|
297
|
+
🆕 **`classifyFbsReturnCategory()`** — эвристический хелпер: история статусов FBS → enum категории возврата
|
|
298
|
+
|
|
299
|
+
📚 **Новое руководство EN+RU**: [Модуль Returns](https://salacoste.github.io/daytona-wildberries-typescript-sdk/ru/guides/returns-module) с диаграммой Mermaid, таблицей ограничений и 4 готовыми рецептами
|
|
300
|
+
|
|
301
|
+
✅ **2207 тестов проходят**, исправлено 25 замечаний по code review (все уровни серьёзности)
|
|
276
302
|
|
|
277
|
-
-
|
|
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 новых)
|
|
303
|
+
- **v3.9.3** -- хелперы `classifyReturnReason()`, `enrichReturnsWithType()`, `reconcileBuyoutsAndReturns()` + новое руководство
|
|
283
304
|
- **v3.9.2** -- поле `isVariable` + хелпер `validateMergedCardVariants()`
|
|
284
305
|
- **v3.9.1** -- хелпер `validateRequiredCharacteristics()` для предварительной проверки обязательных полей
|
|
285
306
|
- **v3.9.0** -- поддержка обязательных характеристик товаров (`isRequiredForCreate`), типы ввода/вывода характеристик, DRY-рефакторинг
|
|
@@ -393,7 +414,7 @@ const reportFile = await longTimeoutSdk.analytics.getDownloadsFile(downloadId);
|
|
|
393
414
|
|
|
394
415
|
## 📊 Статус Проекта и Разработка
|
|
395
416
|
|
|
396
|
-
**Текущий Статус:** 🟢 Production Ready | **Версия SDK:** 3.
|
|
417
|
+
**Текущий Статус:** 🟢 Production Ready | **Версия SDK:** 3.10.0
|
|
397
418
|
|
|
398
419
|
**📖 [Project Status Summary](PROJECT_STATUS_SUMMARY.md)** — Комплексный обзор всех эпиков, историй и статуса реализации.
|
|
399
420
|
|
|
@@ -401,9 +422,9 @@ const reportFile = await longTimeoutSdk.analytics.getDownloadsFile(downloadId);
|
|
|
401
422
|
|
|
402
423
|
| Метрика | Значение |
|
|
403
424
|
|---------|----------|
|
|
404
|
-
| **API модули** |
|
|
425
|
+
| **API модули** | 14 (100%) |
|
|
405
426
|
| **API эндпоинты** | 240+ реализовано |
|
|
406
|
-
| **Тесты** | 2,
|
|
427
|
+
| **Тесты** | 2,207 тестов проходят (100%) |
|
|
407
428
|
| **Документация** | 44 руководства, 22 примера |
|
|
408
429
|
| **Размер бандла** | ~91KB gzipped (ESM) |
|
|
409
430
|
|
|
@@ -428,7 +449,7 @@ const reportFile = await longTimeoutSdk.analytics.getDownloadsFile(downloadId);
|
|
|
428
449
|
|
|
429
450
|
## 🎯 Поддерживаемые Модули API
|
|
430
451
|
|
|
431
|
-
Все
|
|
452
|
+
Все 14 модулей Wildberries API полностью поддерживаются со 100% покрытием API:
|
|
432
453
|
|
|
433
454
|
| Модуль | Описание |
|
|
434
455
|
|--------|----------|
|
|
@@ -445,6 +466,7 @@ const reportFile = await longTimeoutSdk.analytics.getDownloadsFile(downloadId);
|
|
|
445
466
|
| **Tariffs** | Ставки комиссий, тарифные планы |
|
|
446
467
|
| **In-Store Pickup** | Заказы с самовывозом и управление |
|
|
447
468
|
| **User Management** | Управление пользователями профиля продавца |
|
|
469
|
+
| **Returns** | Агрегатор возвратов (FBO + FBS + Finance), `getReturns()`, `getReturnByOrderId()`, `getReturnStats()` |
|
|
448
470
|
|
|
449
471
|
## 📄 Лицензия
|
|
450
472
|
|