itd-api 0.8.0 → 0.9.1

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 (80) hide show
  1. package/README.md +66 -21
  2. package/dist/events/index.cjs +3 -3
  3. package/dist/events/index.d.cts +2 -2
  4. package/dist/events/index.d.ts +2 -2
  5. package/dist/events/index.js +3 -3
  6. package/dist/index.cjs +26 -13
  7. package/dist/index.cjs.map +1 -1
  8. package/dist/index.d.cts +9 -6
  9. package/dist/index.d.ts +9 -6
  10. package/dist/index.js +13 -8
  11. package/dist/index.js.map +1 -1
  12. package/dist/node/index.cjs +5 -4
  13. package/dist/node/index.cjs.map +1 -1
  14. package/dist/node/index.d.cts +2 -2
  15. package/dist/node/index.d.ts +2 -2
  16. package/dist/node/index.js +4 -3
  17. package/dist/node/index.js.map +1 -1
  18. package/dist/rest/index.cjs +16 -4
  19. package/dist/rest/index.cjs.map +1 -1
  20. package/dist/rest/index.d.cts +5 -3
  21. package/dist/rest/index.d.ts +5 -3
  22. package/dist/rest/index.js +9 -5
  23. package/dist/rest/index.js.map +1 -1
  24. package/dist/shared/{events-QyhQZrnC.d.ts → events-BDdJyH2p.d.ts} +2 -2
  25. package/dist/shared/{events-Br2r7coi.d.cts → events-BQyH5-S0.d.cts} +2 -2
  26. package/dist/shared/{events-iTteVsd_.cjs → events-BqFkwwTw.cjs} +3 -3
  27. package/dist/shared/{events-iTteVsd_.cjs.map → events-BqFkwwTw.cjs.map} +1 -1
  28. package/dist/shared/{events-TfhKh26b.js → events-D6y0Hxyz.js} +3 -3
  29. package/dist/shared/{events-TfhKh26b.js.map → events-D6y0Hxyz.js.map} +1 -1
  30. package/dist/shared/{storage-BLmXmzKF.cjs → key-value-store-B5GYVEYZ.cjs} +1 -85
  31. package/dist/shared/key-value-store-B5GYVEYZ.cjs.map +1 -0
  32. package/dist/shared/{storage-CCxn0Kkv.js → key-value-store-Bt2PSMxY.js} +2 -68
  33. package/dist/shared/key-value-store-Bt2PSMxY.js.map +1 -0
  34. package/dist/shared/key-value-store-COZaNHZS.d.cts +69 -0
  35. package/dist/shared/key-value-store-COZaNHZS.d.ts +69 -0
  36. package/dist/shared/{multi-storage-DccjD7Ww.d.ts → multi-storage-BEL7tcKn.d.cts} +3 -2
  37. package/dist/shared/{multi-storage-CCUgkqvI.cjs → multi-storage-CDKLa956.cjs} +8 -7
  38. package/dist/shared/{multi-storage-CCUgkqvI.cjs.map → multi-storage-CDKLa956.cjs.map} +1 -1
  39. package/dist/shared/{multi-storage-CjAPB5Kq.d.cts → multi-storage-LkljOSzA.d.ts} +3 -2
  40. package/dist/shared/{multi-storage-1AEZTczk.js → multi-storage-SoW05uzO.js} +4 -3
  41. package/dist/shared/{multi-storage-1AEZTczk.js.map → multi-storage-SoW05uzO.js.map} +1 -1
  42. package/dist/shared/{options-BUfoHE9G.cjs → options-DOJYtoti.cjs} +2 -2
  43. package/dist/shared/{options-BUfoHE9G.cjs.map → options-DOJYtoti.cjs.map} +1 -1
  44. package/dist/shared/{options-BNP633A5.js → options-DhgGg7Ms.js} +2 -2
  45. package/dist/shared/{options-BNP633A5.js.map → options-DhgGg7Ms.js.map} +1 -1
  46. package/dist/shared/{redact-DB9EMGJx.cjs → redact-BP00URmQ.cjs} +15 -4
  47. package/dist/shared/{redact-DB9EMGJx.cjs.map → redact-BP00URmQ.cjs.map} +1 -1
  48. package/dist/shared/{redact-FNK29Fv-.js → redact-Ba5iSVYZ.js} +15 -4
  49. package/dist/shared/{redact-FNK29Fv-.js.map → redact-Ba5iSVYZ.js.map} +1 -1
  50. package/dist/shared/{render-BszcKF7S.d.cts → render-BU1_wex8.d.cts} +378 -12
  51. package/dist/shared/{render-DVB7T8pm.d.ts → render-CZ_-F2Tl.d.ts} +378 -12
  52. package/dist/shared/{render-DNTESBSl.cjs → render-DAEeCMk9.cjs} +461 -8
  53. package/dist/shared/render-DAEeCMk9.cjs.map +1 -0
  54. package/dist/shared/{render-CiL1VS0b.js → render-sb1VJhUA.js} +415 -10
  55. package/dist/shared/render-sb1VJhUA.js.map +1 -0
  56. package/dist/shared/storage-BQrtKon9.d.cts +86 -0
  57. package/dist/shared/storage-CTRGT5wF.d.ts +86 -0
  58. package/dist/shared/storage-CfHKzVHf.js +71 -0
  59. package/dist/shared/storage-CfHKzVHf.js.map +1 -0
  60. package/dist/shared/storage-QNVxzpDB.cjs +88 -0
  61. package/dist/shared/storage-QNVxzpDB.cjs.map +1 -0
  62. package/dist/shared/{url-Be9jlWRv.d.ts → url-CZZcyPI0.d.cts} +92 -5
  63. package/dist/shared/{url-Be9jlWRv.d.cts → url-CZZcyPI0.d.ts} +92 -5
  64. package/dist/shared/{url-CFN1sT9S.cjs → url-CzHqE-Fg.cjs} +83 -4
  65. package/dist/shared/{url-CFN1sT9S.cjs.map → url-CzHqE-Fg.cjs.map} +1 -1
  66. package/dist/shared/{url-B3ocFlHj.js → url-Dsr4c5r5.js} +78 -5
  67. package/dist/shared/{url-B3ocFlHj.js.map → url-Dsr4c5r5.js.map} +1 -1
  68. package/dist/web/index.cjs +4 -3
  69. package/dist/web/index.cjs.map +1 -1
  70. package/dist/web/index.d.cts +1 -1
  71. package/dist/web/index.d.ts +1 -1
  72. package/dist/web/index.js +2 -1
  73. package/dist/web/index.js.map +1 -1
  74. package/package.json +1 -1
  75. package/dist/shared/render-CiL1VS0b.js.map +0 -1
  76. package/dist/shared/render-DNTESBSl.cjs.map +0 -1
  77. package/dist/shared/storage-BLmXmzKF.cjs.map +0 -1
  78. package/dist/shared/storage-CCxn0Kkv.js.map +0 -1
  79. package/dist/shared/storage-C_eICCep.d.cts +0 -152
  80. package/dist/shared/storage-C_eICCep.d.ts +0 -152
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
- <p align="center">
1
+ <div align="center">
2
2
  <picture>
3
3
  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/KiowDev/itd-api/main/guides/web/public/logos/itd-api-logo-horizontal-dark.svg">
4
4
  <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/KiowDev/itd-api/main/guides/web/public/logos/itd-api-logo-horizontal.svg">
5
- <img alt="itd-api" src="https://raw.githubusercontent.com/KiowDev/itd-api/main/guides/web/public/logos/itd-api-logo-horizontal.svg" width="560">
5
+ <img alt="itd-api" src="https://raw.githubusercontent.com/KiowDev/itd-api/main/guides/web/public/logos/itd-api-logo-horizontal.svg">
6
6
  </picture>
7
- </p>
7
+ </div>
8
8
 
9
- # itd-api
9
+ # SDK для работы с API ИТД
10
10
 
11
11
  [![npm version](https://img.shields.io/npm/v/itd-api.svg)](https://www.npmjs.com/package/itd-api)
12
12
  [![npm downloads](https://img.shields.io/npm/dm/itd-api.svg)](https://www.npmjs.com/package/itd-api)
@@ -14,10 +14,10 @@
14
14
  [![Node.js](https://img.shields.io/node/v/itd-api.svg)](https://www.npmjs.com/package/itd-api)
15
15
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.0%2B-3178c6.svg)](./tsconfig.json)
16
16
  [![license](https://img.shields.io/npm/l/itd-api.svg)](./LICENSE)
17
- [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/KiowDev/itd-api)
18
17
 
19
- Полнофункциональный TypeScript SDK для социальной сети **итд.com**.
20
- Проект не является официальным SDK и не аффилирован с итд.com.
18
+ JavaScript/TypeScript SDK для социальной сети **итд.com**: авторизация, работа с
19
+ пользователями и публикациями, события, пагинация и расширения через плагины.
20
+ Проект не является официальным и не аффилирован с итд.com.
21
21
 
22
22
  [Документация](https://kiowdev.github.io/itd-api/) ·
23
23
  [Быстрый старт](https://kiowdev.github.io/itd-api/quickstart/) ·
@@ -27,33 +27,63 @@
27
27
  [Сеть и доверие](#сеть-и-доверие) ·
28
28
  [Пакеты проекта](#пакеты-проекта)
29
29
 
30
+ ## Требования
31
+
32
+ Для Node.js требуется версия 18+. Поддерживаются JavaScript, TypeScript 5.0+,
33
+ ESM и CommonJS; остальные среды перечислены в разделе [«Совместимость»](#совместимость).
34
+
30
35
  ## Установка
31
36
 
32
37
  ```bash
33
38
  npm install itd-api
34
39
  ```
35
40
 
36
- Передайте access token и запросите посты со стены пользователя:
41
+ ## Быстрый старт
37
42
 
38
- ```ts
39
- import { ItdClient } from 'itd-api';
43
+ Получите access token по [руководству по авторизации](https://kiowdev.github.io/itd-api/authentication/)
44
+ и сохраните его в переменной окружения `ITD_ACCESS_TOKEN`.
45
+
46
+ > [!WARNING]
47
+ > Не храните access token в исходном коде и не публикуйте его в репозитории.
48
+
49
+ Создайте файл `index.js` и запросите посты со стены пользователя:
40
50
 
41
- const itd = new ItdClient({ auth: '<accessToken>' });
42
- const page = await itd.posts.byUser('nowkie', { limit: 10 });
51
+ ```js
52
+ const { ItdClient } = require('itd-api');
43
53
 
44
- for (const post of page.items) {
45
- console.log(post.author.username, post.content);
54
+ async function main() {
55
+ const accessToken = process.env.ITD_ACCESS_TOKEN;
56
+ if (!accessToken) {
57
+ throw new Error('Переменная окружения ITD_ACCESS_TOKEN не задана');
58
+ }
59
+
60
+ const itd = new ItdClient({ auth: accessToken });
61
+ const page = await itd.posts.byUser('nowkie', { limit: 10 });
62
+
63
+ for (const post of page.items) {
64
+ console.log(post.author.username, post.content);
65
+ }
46
66
  }
67
+
68
+ main().catch(console.error);
47
69
  ```
48
70
 
49
- Для долгоживущего приложения восстановите сохранённую сессию или настройте вход по
50
- [руководству по авторизации](https://kiowdev.github.io/itd-api/authentication/).
71
+ Запустите его командой `node index.js`.
72
+
73
+ В TypeScript или JavaScript с ES modules используйте ESM-импорт:
74
+
75
+ ```ts
76
+ import { ItdClient } from 'itd-api';
77
+ ```
78
+
79
+ Для долгоживущего приложения восстановите сохранённую сессию или настройте вход
80
+ по руководству по авторизации.
51
81
 
52
82
  ## Возможности
53
83
 
54
84
  | Область | Что поддерживается |
55
85
  |---|---|
56
- | REST API | пользователи, посты, комментарии, файлы, уведомления, поиск, жалобы, верификация и подписка |
86
+ | REST API | пользователи, посты, комментарии, файлы, уведомления, поиск, жалобы, верификация, подписка и магазин |
57
87
  | Авторизация | access/refresh token, автоматическое обновление, OTP, хранение сессии и несколько аккаунтов |
58
88
  | События | SSE и резервный опрос, промежуточные обработчики, типизированные фильтры и маршрутизация |
59
89
  | Пагинация | разные серверные схемы через единый `for await` |
@@ -107,7 +137,13 @@ TypeScript 5.0+. Пакет проверяется в Node.js 18, 20, 22, 24 и
107
137
 
108
138
  ## Сеть и доверие
109
139
 
110
- По умолчанию основной пакет обращается ровно к двум хостам:
140
+ По умолчанию SDK соединяется только с API итд.com и публичным сервисом статуса.
141
+ Bearer-токен автоматически передаётся только основному API.
142
+
143
+ <details>
144
+ <summary>Подробности о сетевых подключениях и передаче токена</summary>
145
+
146
+ Основной пакет обращается к двум хостам:
111
147
 
112
148
  | Хост | Назначение | Автоматическая передача Bearer-токена |
113
149
  |---|---|---|
@@ -129,11 +165,20 @@ TypeScript 5.0+. Пакет проверяется в Node.js 18, 20, 22, 24 и
129
165
  | `defineService({ auth: true })` | явно разрешает отправлять Bearer-токен на хост этого сервиса |
130
166
  | `request({ baseUrl })` | внешний хост не получает Bearer автоматически; `skipAuth: false` явно разрешает его передачу |
131
167
 
168
+ </details>
169
+
132
170
  Уязвимости следует отправлять приватно по
133
171
  [политике безопасности](./.github/SECURITY.md).
134
172
 
135
173
  ## Известные ограничения платформы
136
174
 
175
+ Ограничения зависят от маршрута и среды выполнения. Полная матрица известных
176
+ маршрутов, протоколов и статуса поддержки находится в
177
+ [справочнике методов API](https://kiowdev.github.io/itd-api/reference/endpoints).
178
+
179
+ <details>
180
+ <summary>Показать известные ограничения</summary>
181
+
137
182
  | Ограничение | Что учитывать |
138
183
  |---|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|
139
184
  | CORS основного API | браузерному приложению нужен собственный серверный proxy; [подробнее](https://kiowdev.github.io/itd-api/integrations/#браузер-и-cors) |
@@ -141,12 +186,12 @@ TypeScript 5.0+. Пакет проверяется в Node.js 18, 20, 22, 24 и
141
186
  | Посты пользователя | `posts.byUser()` возвращает стену, включая чужие публикации на ней; [подробнее](https://kiowdev.github.io/itd-api/reference/posts) |
142
187
  | Ограничения частоты | маршруты разбиты на бакеты, у каждого свой лимит запросов в минуту, считается по IP; [таблица бакетов](https://kiowdev.github.io/itd-api/reference/rate-limits) |
143
188
 
144
- Матрица известных маршрутов, протоколов и статуса поддержки находится в
145
- [справочнике методов API](https://kiowdev.github.io/itd-api/reference/endpoints).
189
+ </details>
146
190
 
147
191
  ## Проект
148
192
 
149
- - [DeepWiki по исходному коду](https://deepwiki.com/KiowDev/itd-api) — можно задать любые вопросы нейронке
193
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/KiowDev/itd-api)
194
+
150
195
  - [CI](https://github.com/KiowDev/itd-api/actions/workflows/ci.yml)
151
196
  - [История релизов](https://github.com/KiowDev/itd-api/releases)
152
197
  - [Как внести вклад](./.github/CONTRIBUTING.md)
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_url = require("../shared/url-CFN1sT9S.cjs");
2
+ const require_url = require("../shared/url-CzHqE-Fg.cjs");
3
3
  const require_errors = require("../shared/errors-BmP3TKoW.cjs");
4
- const require_redact = require("../shared/redact-DB9EMGJx.cjs");
5
- const require_events = require("../shared/events-iTteVsd_.cjs");
4
+ const require_redact = require("../shared/redact-BP00URmQ.cjs");
5
+ const require_events = require("../shared/events-BqFkwwTw.cjs");
6
6
  exports.DEFAULT_BASE_URL = require_url.DEFAULT_BASE_URL;
7
7
  exports.EventChannel = require_events.EventChannel;
8
8
  exports.EventChannelStatus = require_url.EventChannelStatus;
@@ -1,3 +1,3 @@
1
- import { $ as isItdValidationError, B as ItdTimeoutError, Bt as ItdClock, E as ItdConfigError, F as ItdNotFoundError, G as isItdError, H as isItdApiError, L as ItdRateLimitError, N as ItdForbiddenError, O as ItdError, P as ItdNetworkError, Pt as RuntimeOptions, Q as isItdStateError, R as ItdServerError, S as ItdApiError, T as ItdAuthError, U as isItdAuthError, V as ItdValidationError, Vt as systemClock, X as isItdRateLimitError, a as NotificationEvent, at as tokenProvider, bt as Logger, c as NotificationSettings, ct as Unsubscribe, dt as LIBRARY_VERSION, et as ClientConnection, i as formatNotificationText, it as bearerToken, k as ItdErrorKind, lt as DEFAULT_BASE_URL, mn as NotificationType, n as canonicalNotificationType, nt as AuthProvider, o as normalizeNotification, pn as Loose, r as isKnownNotificationType, rt as anonymousAuth, s as Notification, sn as EventChannelStatus, st as Listener, t as resolveNotificationUrl, tt as AuthIdentity, vt as ClientHooks, w as ItdApiErrorKind, x as ItdAbortError, z as ItdStateError, zt as RuntimeMode } from "../shared/url-Be9jlWRv.cjs";
2
- import { $ as EventTransport, A as ReconnectOptions, B as NotificationContext, C as EventChannelDeps, D as EventSession, E as EventEnqueueOptions, F as EventPredicate, G as NotificationEventsUpdate, H as NotificationEventFilter, I as EventSequentializer, J as NotificationUpdateOfType, K as NotificationOfType, L as EventTypeGuard, M as EventMiddleware, N as EventMiddlewareObject, O as EventSyncReason, P as EventNext, Q as UnreadCountUpdate, R as runEventMiddleware, S as EventChannel, T as EventChannelOptions, U as NotificationEventOfType, V as NotificationEventContext, W as NotificationEventSelector, X as NotificationUpdateType, Y as NotificationUpdateOrigin, Z as UnknownNotificationUpdate, _ as createNotificationEventsClient, a as WebSocketTransportOptions, b as NotificationEventsOptions, c as EventErrorContext, d as EventMiddlewareLike, et as EventTransportContext, f as EventRouteTable, g as NotificationEventsClientOptions, h as NotificationEventsClient, i as WebSocketTransport, j as EventHandler, k as resolveEventChannelOptions, l as EventFilter, m as EventRouter, n as WebSocketLike, nt as UnauthorizedStreamError, o as EventComposer, p as EventRouteSelector, q as NotificationUpdate, r as WebSocketOpenFailureClassifier, s as EventErrorBoundary, t as WebSocketImplementationOptions, tt as EventTransportFrame, u as EventMiddlewareGroup, v as NotificationEvents, w as EventChannelEvents, x as NotificationEventsTransport, y as NotificationEventsMap, z as EventContext } from "../shared/events-Br2r7coi.cjs";
1
+ import { $ as isItdStateError, A as ItdErrorKind, B as ItdStateError, Bt as RuntimeMode, C as ItdApiError, D as ItdConfigError, E as ItdAuthError, F as ItdNetworkError, Ft as RuntimeOptions, H as ItdValidationError, Ht as systemClock, I as ItdNotFoundError, K as isItdError, P as ItdForbiddenError, R as ItdRateLimitError, S as ItdAbortError, T as ItdApiErrorKind, U as isItdApiError, V as ItdTimeoutError, Vt as ItdClock, W as isItdAuthError, Z as isItdRateLimitError, a as NotificationEvent, at as bearerToken, c as NotificationSettings, cn as EventChannelStatus, ct as Listener, et as isItdValidationError, ft as LIBRARY_VERSION, hn as NotificationType, i as formatNotificationText, it as anonymousAuth, k as ItdError, lt as Unsubscribe, mn as Loose, n as canonicalNotificationType, nt as AuthIdentity, o as normalizeNotification, ot as tokenProvider, r as isKnownNotificationType, rt as AuthProvider, s as Notification, t as resolveNotificationUrl, tt as ClientConnection, ut as DEFAULT_BASE_URL, xt as Logger, yt as ClientHooks, z as ItdServerError } from "../shared/url-CZZcyPI0.cjs";
2
+ import { $ as EventTransport, A as ReconnectOptions, B as NotificationContext, C as EventChannelDeps, D as EventSession, E as EventEnqueueOptions, F as EventPredicate, G as NotificationEventsUpdate, H as NotificationEventFilter, I as EventSequentializer, J as NotificationUpdateOfType, K as NotificationOfType, L as EventTypeGuard, M as EventMiddleware, N as EventMiddlewareObject, O as EventSyncReason, P as EventNext, Q as UnreadCountUpdate, R as runEventMiddleware, S as EventChannel, T as EventChannelOptions, U as NotificationEventOfType, V as NotificationEventContext, W as NotificationEventSelector, X as NotificationUpdateType, Y as NotificationUpdateOrigin, Z as UnknownNotificationUpdate, _ as createNotificationEventsClient, a as WebSocketTransportOptions, b as NotificationEventsOptions, c as EventErrorContext, d as EventMiddlewareLike, et as EventTransportContext, f as EventRouteTable, g as NotificationEventsClientOptions, h as NotificationEventsClient, i as WebSocketTransport, j as EventHandler, k as resolveEventChannelOptions, l as EventFilter, m as EventRouter, n as WebSocketLike, nt as UnauthorizedStreamError, o as EventComposer, p as EventRouteSelector, q as NotificationUpdate, r as WebSocketOpenFailureClassifier, s as EventErrorBoundary, t as WebSocketImplementationOptions, tt as EventTransportFrame, u as EventMiddlewareGroup, v as NotificationEvents, w as EventChannelEvents, x as NotificationEventsTransport, y as NotificationEventsMap, z as EventContext } from "../shared/events-BQyH5-S0.cjs";
3
3
  export { type AuthIdentity, type AuthProvider, type ClientConnection, type ClientHooks, DEFAULT_BASE_URL, EventChannel, type EventChannelDeps, type EventChannelEvents, type EventChannelOptions, EventChannelStatus, EventComposer, type EventContext, type EventEnqueueOptions, type EventErrorBoundary, type EventErrorContext, type EventFilter, type EventHandler, type EventMiddleware, type EventMiddlewareGroup, type EventMiddlewareLike, type EventMiddlewareObject, type EventNext, type EventPredicate, type EventRouteSelector, type EventRouteTable, EventRouter, type EventSequentializer, type EventSession, type EventSyncReason, type EventTransport, type EventTransportContext, type EventTransportFrame, type EventTypeGuard, ItdAbortError, ItdApiError, ItdApiErrorKind, ItdAuthError, type ItdClock, ItdConfigError, ItdError, ItdErrorKind, ItdForbiddenError, ItdNetworkError, ItdNotFoundError, ItdRateLimitError, ItdServerError, ItdStateError, ItdTimeoutError, ItdValidationError, LIBRARY_VERSION, type Listener, type Logger, type Loose, type Notification, type NotificationContext, type NotificationEvent, type NotificationEventContext, type NotificationEventFilter, type NotificationEventOfType, type NotificationEventSelector, NotificationEvents, NotificationEventsClient, type NotificationEventsClientOptions, type NotificationEventsMap, type NotificationEventsOptions, NotificationEventsTransport, type NotificationEventsUpdate, type NotificationOfType, type NotificationSettings, NotificationType, type NotificationUpdate, type NotificationUpdateOfType, NotificationUpdateOrigin, NotificationUpdateType, type ReconnectOptions, RuntimeMode, type RuntimeOptions, UnauthorizedStreamError, type UnknownNotificationUpdate, type UnreadCountUpdate, type Unsubscribe, type WebSocketImplementationOptions, type WebSocketLike, type WebSocketOpenFailureClassifier, WebSocketTransport, type WebSocketTransportOptions, anonymousAuth, bearerToken, canonicalNotificationType, createNotificationEventsClient, formatNotificationText, isItdApiError, isItdAuthError, isItdError, isItdRateLimitError, isItdStateError, isItdValidationError, isKnownNotificationType, normalizeNotification, resolveEventChannelOptions, resolveNotificationUrl, runEventMiddleware, systemClock, tokenProvider };
@@ -1,3 +1,3 @@
1
- import { $ as isItdValidationError, B as ItdTimeoutError, Bt as ItdClock, E as ItdConfigError, F as ItdNotFoundError, G as isItdError, H as isItdApiError, L as ItdRateLimitError, N as ItdForbiddenError, O as ItdError, P as ItdNetworkError, Pt as RuntimeOptions, Q as isItdStateError, R as ItdServerError, S as ItdApiError, T as ItdAuthError, U as isItdAuthError, V as ItdValidationError, Vt as systemClock, X as isItdRateLimitError, a as NotificationEvent, at as tokenProvider, bt as Logger, c as NotificationSettings, ct as Unsubscribe, dt as LIBRARY_VERSION, et as ClientConnection, i as formatNotificationText, it as bearerToken, k as ItdErrorKind, lt as DEFAULT_BASE_URL, mn as NotificationType, n as canonicalNotificationType, nt as AuthProvider, o as normalizeNotification, pn as Loose, r as isKnownNotificationType, rt as anonymousAuth, s as Notification, sn as EventChannelStatus, st as Listener, t as resolveNotificationUrl, tt as AuthIdentity, vt as ClientHooks, w as ItdApiErrorKind, x as ItdAbortError, z as ItdStateError, zt as RuntimeMode } from "../shared/url-Be9jlWRv.js";
2
- import { $ as EventTransport, A as ReconnectOptions, B as NotificationContext, C as EventChannelDeps, D as EventSession, E as EventEnqueueOptions, F as EventPredicate, G as NotificationEventsUpdate, H as NotificationEventFilter, I as EventSequentializer, J as NotificationUpdateOfType, K as NotificationOfType, L as EventTypeGuard, M as EventMiddleware, N as EventMiddlewareObject, O as EventSyncReason, P as EventNext, Q as UnreadCountUpdate, R as runEventMiddleware, S as EventChannel, T as EventChannelOptions, U as NotificationEventOfType, V as NotificationEventContext, W as NotificationEventSelector, X as NotificationUpdateType, Y as NotificationUpdateOrigin, Z as UnknownNotificationUpdate, _ as createNotificationEventsClient, a as WebSocketTransportOptions, b as NotificationEventsOptions, c as EventErrorContext, d as EventMiddlewareLike, et as EventTransportContext, f as EventRouteTable, g as NotificationEventsClientOptions, h as NotificationEventsClient, i as WebSocketTransport, j as EventHandler, k as resolveEventChannelOptions, l as EventFilter, m as EventRouter, n as WebSocketLike, nt as UnauthorizedStreamError, o as EventComposer, p as EventRouteSelector, q as NotificationUpdate, r as WebSocketOpenFailureClassifier, s as EventErrorBoundary, t as WebSocketImplementationOptions, tt as EventTransportFrame, u as EventMiddlewareGroup, v as NotificationEvents, w as EventChannelEvents, x as NotificationEventsTransport, y as NotificationEventsMap, z as EventContext } from "../shared/events-QyhQZrnC.js";
1
+ import { $ as isItdStateError, A as ItdErrorKind, B as ItdStateError, Bt as RuntimeMode, C as ItdApiError, D as ItdConfigError, E as ItdAuthError, F as ItdNetworkError, Ft as RuntimeOptions, H as ItdValidationError, Ht as systemClock, I as ItdNotFoundError, K as isItdError, P as ItdForbiddenError, R as ItdRateLimitError, S as ItdAbortError, T as ItdApiErrorKind, U as isItdApiError, V as ItdTimeoutError, Vt as ItdClock, W as isItdAuthError, Z as isItdRateLimitError, a as NotificationEvent, at as bearerToken, c as NotificationSettings, cn as EventChannelStatus, ct as Listener, et as isItdValidationError, ft as LIBRARY_VERSION, hn as NotificationType, i as formatNotificationText, it as anonymousAuth, k as ItdError, lt as Unsubscribe, mn as Loose, n as canonicalNotificationType, nt as AuthIdentity, o as normalizeNotification, ot as tokenProvider, r as isKnownNotificationType, rt as AuthProvider, s as Notification, t as resolveNotificationUrl, tt as ClientConnection, ut as DEFAULT_BASE_URL, xt as Logger, yt as ClientHooks, z as ItdServerError } from "../shared/url-CZZcyPI0.js";
2
+ import { $ as EventTransport, A as ReconnectOptions, B as NotificationContext, C as EventChannelDeps, D as EventSession, E as EventEnqueueOptions, F as EventPredicate, G as NotificationEventsUpdate, H as NotificationEventFilter, I as EventSequentializer, J as NotificationUpdateOfType, K as NotificationOfType, L as EventTypeGuard, M as EventMiddleware, N as EventMiddlewareObject, O as EventSyncReason, P as EventNext, Q as UnreadCountUpdate, R as runEventMiddleware, S as EventChannel, T as EventChannelOptions, U as NotificationEventOfType, V as NotificationEventContext, W as NotificationEventSelector, X as NotificationUpdateType, Y as NotificationUpdateOrigin, Z as UnknownNotificationUpdate, _ as createNotificationEventsClient, a as WebSocketTransportOptions, b as NotificationEventsOptions, c as EventErrorContext, d as EventMiddlewareLike, et as EventTransportContext, f as EventRouteTable, g as NotificationEventsClientOptions, h as NotificationEventsClient, i as WebSocketTransport, j as EventHandler, k as resolveEventChannelOptions, l as EventFilter, m as EventRouter, n as WebSocketLike, nt as UnauthorizedStreamError, o as EventComposer, p as EventRouteSelector, q as NotificationUpdate, r as WebSocketOpenFailureClassifier, s as EventErrorBoundary, t as WebSocketImplementationOptions, tt as EventTransportFrame, u as EventMiddlewareGroup, v as NotificationEvents, w as EventChannelEvents, x as NotificationEventsTransport, y as NotificationEventsMap, z as EventContext } from "../shared/events-BDdJyH2p.js";
3
3
  export { type AuthIdentity, type AuthProvider, type ClientConnection, type ClientHooks, DEFAULT_BASE_URL, EventChannel, type EventChannelDeps, type EventChannelEvents, type EventChannelOptions, EventChannelStatus, EventComposer, type EventContext, type EventEnqueueOptions, type EventErrorBoundary, type EventErrorContext, type EventFilter, type EventHandler, type EventMiddleware, type EventMiddlewareGroup, type EventMiddlewareLike, type EventMiddlewareObject, type EventNext, type EventPredicate, type EventRouteSelector, type EventRouteTable, EventRouter, type EventSequentializer, type EventSession, type EventSyncReason, type EventTransport, type EventTransportContext, type EventTransportFrame, type EventTypeGuard, ItdAbortError, ItdApiError, ItdApiErrorKind, ItdAuthError, type ItdClock, ItdConfigError, ItdError, ItdErrorKind, ItdForbiddenError, ItdNetworkError, ItdNotFoundError, ItdRateLimitError, ItdServerError, ItdStateError, ItdTimeoutError, ItdValidationError, LIBRARY_VERSION, type Listener, type Logger, type Loose, type Notification, type NotificationContext, type NotificationEvent, type NotificationEventContext, type NotificationEventFilter, type NotificationEventOfType, type NotificationEventSelector, NotificationEvents, NotificationEventsClient, type NotificationEventsClientOptions, type NotificationEventsMap, type NotificationEventsOptions, NotificationEventsTransport, type NotificationEventsUpdate, type NotificationOfType, type NotificationSettings, NotificationType, type NotificationUpdate, type NotificationUpdateOfType, NotificationUpdateOrigin, NotificationUpdateType, type ReconnectOptions, RuntimeMode, type RuntimeOptions, UnauthorizedStreamError, type UnknownNotificationUpdate, type UnreadCountUpdate, type Unsubscribe, type WebSocketImplementationOptions, type WebSocketLike, type WebSocketOpenFailureClassifier, WebSocketTransport, type WebSocketTransportOptions, anonymousAuth, bearerToken, canonicalNotificationType, createNotificationEventsClient, formatNotificationText, isItdApiError, isItdAuthError, isItdError, isItdRateLimitError, isItdStateError, isItdValidationError, isKnownNotificationType, normalizeNotification, resolveEventChannelOptions, resolveNotificationUrl, runEventMiddleware, systemClock, tokenProvider };
@@ -1,5 +1,5 @@
1
- import { $ as DEFAULT_BASE_URL, S as NotificationType, a as tokenProvider, c as normalizeNotification, ct as systemClock, d as canonicalNotificationType, f as isKnownNotificationType, g as EventChannelStatus, i as bearerToken, n as formatNotificationText, r as anonymousAuth, rt as LIBRARY_VERSION, t as resolveNotificationUrl } from "../shared/url-B3ocFlHj.js";
1
+ import { S as NotificationType, a as tokenProvider, c as normalizeNotification, d as canonicalNotificationType, et as DEFAULT_BASE_URL, f as isKnownNotificationType, g as EventChannelStatus, i as bearerToken, it as LIBRARY_VERSION, lt as systemClock, n as formatNotificationText, r as anonymousAuth, t as resolveNotificationUrl } from "../shared/url-Dsr4c5r5.js";
2
2
  import { A as isItdStateError, C as isItdError, O as isItdRateLimitError, _ as ItdStateError, a as ItdConfigError, b as isItdApiError, c as ItdErrorKind, d as ItdForbiddenError, f as ItdNetworkError, g as ItdServerError, h as ItdRateLimitError, i as ItdAuthError, j as isItdValidationError, n as ItdApiError, p as ItdNotFoundError, r as ItdApiErrorKind, s as ItdError, t as ItdAbortError, v as ItdTimeoutError, x as isItdAuthError, y as ItdValidationError } from "../shared/errors-GI10kZxk.js";
3
- import { _ as RuntimeMode } from "../shared/redact-FNK29Fv-.js";
4
- import { a as WebSocketTransport, c as NotificationEventsTransport, d as NotificationUpdateOrigin, f as NotificationUpdateType, g as runEventMiddleware, h as UnauthorizedStreamError, i as createNotificationEventsClient, m as resolveEventChannelOptions, n as EventRouter, p as EventChannel, r as NotificationEventsClient, s as NotificationEvents, t as EventComposer } from "../shared/events-TfhKh26b.js";
3
+ import { _ as RuntimeMode } from "../shared/redact-Ba5iSVYZ.js";
4
+ import { a as WebSocketTransport, c as NotificationEventsTransport, d as NotificationUpdateOrigin, f as NotificationUpdateType, g as runEventMiddleware, h as UnauthorizedStreamError, i as createNotificationEventsClient, m as resolveEventChannelOptions, n as EventRouter, p as EventChannel, r as NotificationEventsClient, s as NotificationEvents, t as EventComposer } from "../shared/events-D6y0Hxyz.js";
5
5
  export { DEFAULT_BASE_URL, EventChannel, EventChannelStatus, EventComposer, EventRouter, ItdAbortError, ItdApiError, ItdApiErrorKind, ItdAuthError, ItdConfigError, ItdError, ItdErrorKind, ItdForbiddenError, ItdNetworkError, ItdNotFoundError, ItdRateLimitError, ItdServerError, ItdStateError, ItdTimeoutError, ItdValidationError, LIBRARY_VERSION, NotificationEvents, NotificationEventsClient, NotificationEventsTransport, NotificationType, NotificationUpdateOrigin, NotificationUpdateType, RuntimeMode, UnauthorizedStreamError, WebSocketTransport, anonymousAuth, bearerToken, canonicalNotificationType, createNotificationEventsClient, formatNotificationText, isItdApiError, isItdAuthError, isItdError, isItdRateLimitError, isItdStateError, isItdValidationError, isKnownNotificationType, normalizeNotification, resolveEventChannelOptions, resolveNotificationUrl, runEventMiddleware, systemClock, tokenProvider };
package/dist/index.cjs CHANGED
@@ -1,12 +1,13 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_url = require("./shared/url-CFN1sT9S.cjs");
2
+ const require_url = require("./shared/url-CzHqE-Fg.cjs");
3
3
  const require_errors = require("./shared/errors-BmP3TKoW.cjs");
4
- const require_redact = require("./shared/redact-DB9EMGJx.cjs");
5
- const require_render = require("./shared/render-DNTESBSl.cjs");
6
- const require_options = require("./shared/options-BUfoHE9G.cjs");
7
- const require_events = require("./shared/events-iTteVsd_.cjs");
8
- const require_storage = require("./shared/storage-BLmXmzKF.cjs");
9
- const require_multi_storage = require("./shared/multi-storage-CCUgkqvI.cjs");
4
+ const require_redact = require("./shared/redact-BP00URmQ.cjs");
5
+ const require_render = require("./shared/render-DAEeCMk9.cjs");
6
+ const require_options = require("./shared/options-DOJYtoti.cjs");
7
+ const require_events = require("./shared/events-BqFkwwTw.cjs");
8
+ const require_key_value_store = require("./shared/key-value-store-B5GYVEYZ.cjs");
9
+ const require_storage = require("./shared/storage-QNVxzpDB.cjs");
10
+ const require_multi_storage = require("./shared/multi-storage-CDKLa956.cjs");
10
11
  //#region src/notifications-api.ts
11
12
  var ClientNotifications = class extends require_render.NotificationsResource {
12
13
  #createEvents;
@@ -1099,6 +1100,10 @@ var ItdClient = class ItdClient {
1099
1100
  get telemetry() {
1100
1101
  return this.#resources.telemetry;
1101
1102
  }
1103
+ /** Каталог, доставка и заказы магазина ИТД. */
1104
+ get shop() {
1105
+ return this.#resources.shop;
1106
+ }
1102
1107
  constructor(options = {}) {
1103
1108
  const notificationEventsOptions = require_events.resolveNotificationEventsOptions(options.events?.notifications);
1104
1109
  const internals = CLIENT_INTERNALS.get(options) ?? {};
@@ -1994,8 +1999,9 @@ exports.ItdTimeoutError = require_errors.ItdTimeoutError;
1994
1999
  exports.ItdValidationError = require_errors.ItdValidationError;
1995
2000
  exports.LIBRARY_VERSION = require_url.LIBRARY_VERSION;
1996
2001
  exports.LikesVisibility = require_url.LikesVisibility;
1997
- exports.MemoryKeyValueStore = require_storage.MemoryKeyValueStore;
2002
+ exports.MemoryKeyValueStore = require_key_value_store.MemoryKeyValueStore;
1998
2003
  exports.MemoryMultiTokenStorage = require_multi_storage.MemoryMultiTokenStorage;
2004
+ exports.MemoryShopOrderAccessStorage = require_render.MemoryShopOrderAccessStorage;
1999
2005
  exports.MemoryTokenStorage = require_storage.MemoryTokenStorage;
2000
2006
  exports.NotificationEvents = require_events.NotificationEvents;
2001
2007
  exports.NotificationEventsClient = require_events.NotificationEventsClient;
@@ -2013,6 +2019,10 @@ exports.RetrySafety = require_url.RetrySafety;
2013
2019
  exports.RuntimeMode = require_redact.RuntimeMode;
2014
2020
  exports.STATUS_SERVICE = require_url.STATUS_SERVICE;
2015
2021
  exports.ServiceState = require_url.ServiceState;
2022
+ exports.ShopConsentKind = require_render.ShopConsentKind;
2023
+ exports.ShopOrderStatus = require_render.ShopOrderStatus;
2024
+ exports.ShopProductCategory = require_render.ShopProductCategory;
2025
+ exports.ShopProductStatus = require_render.ShopProductStatus;
2016
2026
  exports.SignInStatus = SignInStatus;
2017
2027
  exports.SpanRenderFormat = require_render.SpanRenderFormat;
2018
2028
  exports.SpanType = require_url.SpanType;
@@ -2028,17 +2038,20 @@ exports.canonicalNotificationType = require_url.canonicalNotificationType;
2028
2038
  exports.comment = require_render.comment;
2029
2039
  exports.createAccounts = createAccounts;
2030
2040
  exports.createClient = createClient;
2031
- exports.createKeyValueStore = require_storage.createKeyValueStore;
2041
+ exports.createKeyValueStore = require_key_value_store.createKeyValueStore;
2042
+ exports.createMemoryShopOrderAccessStorage = require_render.createMemoryShopOrderAccessStorage;
2032
2043
  exports.createMultiTokenStorage = require_multi_storage.createMultiTokenStorage;
2033
2044
  exports.createNotificationEventsClient = require_events.createNotificationEventsClient;
2034
- exports.createRecordKeyValueStore = require_storage.createRecordKeyValueStore;
2045
+ exports.createRecordKeyValueStore = require_key_value_store.createRecordKeyValueStore;
2046
+ exports.createShopFeature = require_render.createShopFeature;
2047
+ exports.createShopOrderAccessStorage = require_render.createShopOrderAccessStorage;
2035
2048
  exports.createTokenStorage = require_storage.createTokenStorage;
2036
2049
  exports.formatNotificationText = require_url.formatNotificationText;
2037
2050
  exports.fromStream = require_render.fromStream;
2038
2051
  exports.fromUrl = require_render.fromUrl;
2039
2052
  exports.isBuilder = require_render.isBuilder;
2040
2053
  exports.isBuiltInOperationId = require_url.isBuiltInOperationId;
2041
- exports.isEnumerableKeyValueStore = require_storage.isEnumerableKeyValueStore;
2054
+ exports.isEnumerableKeyValueStore = require_key_value_store.isEnumerableKeyValueStore;
2042
2055
  exports.isItdApiError = require_errors.isItdApiError;
2043
2056
  exports.isItdAuthError = require_errors.isItdAuthError;
2044
2057
  exports.isItdConflictError = require_errors.isItdConflictError;
@@ -2072,7 +2085,7 @@ exports.statusDays = require_render.statusDays;
2072
2085
  exports.systemClock = require_url.systemClock;
2073
2086
  exports.toDate = require_render.toDate;
2074
2087
  exports.utcStampToIso = require_render.utcStampToIso;
2075
- exports.withCodec = require_storage.withCodec;
2076
- exports.withNamespace = require_storage.withNamespace;
2088
+ exports.withCodec = require_key_value_store.withCodec;
2089
+ exports.withNamespace = require_key_value_store.withNamespace;
2077
2090
 
2078
2091
  //# sourceMappingURL=index.cjs.map