itd-api 0.14.4 → 0.14.6

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 (65) hide show
  1. package/dist/events/index.cjs +4 -4
  2. package/dist/events/index.d.cts +2 -2
  3. package/dist/events/index.d.ts +2 -2
  4. package/dist/events/index.js +4 -4
  5. package/dist/index.cjs +61 -57
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.cts +16 -35
  8. package/dist/index.d.ts +16 -35
  9. package/dist/index.js +60 -56
  10. package/dist/index.js.map +1 -1
  11. package/dist/node/index.cjs +5 -5
  12. package/dist/node/index.js +5 -5
  13. package/dist/rest/index.cjs +5 -5
  14. package/dist/rest/index.d.cts +2 -2
  15. package/dist/rest/index.d.ts +2 -2
  16. package/dist/rest/index.js +5 -5
  17. package/dist/shared/{cookies-BLmvIZBD.cjs → cookies-Dv5LQp55.cjs} +2 -2
  18. package/dist/shared/{cookies-BLmvIZBD.cjs.map → cookies-Dv5LQp55.cjs.map} +1 -1
  19. package/dist/shared/{cookies-lIXHWhOd.js → cookies-mDZE19_j.js} +2 -2
  20. package/dist/shared/{cookies-lIXHWhOd.js.map → cookies-mDZE19_j.js.map} +1 -1
  21. package/dist/shared/{events-BSotWa3Z.d.cts → events-BsmLCdog.d.cts} +1 -1
  22. package/dist/shared/{events-B18vQGEH.d.ts → events-By7baZfE.d.ts} +1 -1
  23. package/dist/shared/{events-9dRKcUPZ.cjs → events-DFQSN5H6.cjs} +4 -4
  24. package/dist/shared/{events-9dRKcUPZ.cjs.map → events-DFQSN5H6.cjs.map} +1 -1
  25. package/dist/shared/{events-C7MJnuJw.js → events-DorlX-Xd.js} +4 -4
  26. package/dist/shared/{events-C7MJnuJw.js.map → events-DorlX-Xd.js.map} +1 -1
  27. package/dist/shared/{key-value-store-BJdmlzkM.js → key-value-store-BDvrZ-GQ.js} +2 -2
  28. package/dist/shared/{key-value-store-BJdmlzkM.js.map → key-value-store-BDvrZ-GQ.js.map} +1 -1
  29. package/dist/shared/{key-value-store-Bxt33ZF3.cjs → key-value-store-CeiDXFAC.cjs} +2 -2
  30. package/dist/shared/{key-value-store-Bxt33ZF3.cjs.map → key-value-store-CeiDXFAC.cjs.map} +1 -1
  31. package/dist/shared/{multi-storage-CPiHgcXH.js → multi-storage-CLPyg8_T.js} +5 -5
  32. package/dist/shared/{multi-storage-CPiHgcXH.js.map → multi-storage-CLPyg8_T.js.map} +1 -1
  33. package/dist/shared/{multi-storage-lwn-cmG6.cjs → multi-storage-DXBY9ceK.cjs} +5 -5
  34. package/dist/shared/{multi-storage-lwn-cmG6.cjs.map → multi-storage-DXBY9ceK.cjs.map} +1 -1
  35. package/dist/shared/{options-DorH4keX.js → options-Dana2yeL.js} +3 -3
  36. package/dist/shared/{options-DorH4keX.js.map → options-Dana2yeL.js.map} +1 -1
  37. package/dist/shared/{options-DYeE1hFt.cjs → options-eaq9yK8b.cjs} +3 -3
  38. package/dist/shared/{options-DYeE1hFt.cjs.map → options-eaq9yK8b.cjs.map} +1 -1
  39. package/dist/shared/{render-CWiDhdKI.d.cts → render-CZoSZHnh.d.cts} +92 -67
  40. package/dist/shared/{render-DOLkOCVs.cjs → render-CklT-3gT.cjs} +19 -14
  41. package/dist/shared/{render-DOLkOCVs.cjs.map → render-CklT-3gT.cjs.map} +1 -1
  42. package/dist/shared/{render-DFhMFt1f.js → render-DBt-OBbC.js} +19 -14
  43. package/dist/shared/{render-DFhMFt1f.js.map → render-DBt-OBbC.js.map} +1 -1
  44. package/dist/shared/{render-C5G2o3yL.d.ts → render-DOxbtUga.d.ts} +119 -68
  45. package/dist/shared/{storage-xximVWs_.cjs → storage-Bj7GKkEQ.cjs} +3 -3
  46. package/dist/shared/{storage-xximVWs_.cjs.map → storage-Bj7GKkEQ.cjs.map} +1 -1
  47. package/dist/shared/{storage-8oAVzQmF.js → storage-ChR4KC8V.js} +3 -3
  48. package/dist/shared/{storage-8oAVzQmF.js.map → storage-ChR4KC8V.js.map} +1 -1
  49. package/dist/shared/{url-vXQWF--L.cjs → url-CStw2h1g.cjs} +962 -519
  50. package/dist/shared/url-CStw2h1g.cjs.map +1 -0
  51. package/dist/shared/{url-DcjNue8i.js → url-DTDqkKpf.js} +950 -519
  52. package/dist/shared/url-DTDqkKpf.js.map +1 -0
  53. package/dist/shared/{url-ZRjcpC__.d.cts → url-Ls6HGxZl.d.cts} +881 -803
  54. package/dist/shared/{url-C49-l_KW.d.ts → url-U1Q7c-SD.d.ts} +502 -450
  55. package/dist/shared/{validate-oLSGiGwQ.js → validate-CCgIq5u0.js} +5 -4
  56. package/dist/shared/validate-CCgIq5u0.js.map +1 -0
  57. package/dist/shared/{validate-CbM3k811.cjs → validate-DQrtiCtV.cjs} +5 -4
  58. package/dist/shared/validate-DQrtiCtV.cjs.map +1 -0
  59. package/dist/web/index.cjs +3 -3
  60. package/dist/web/index.js +3 -3
  61. package/package.json +1 -1
  62. package/dist/shared/url-DcjNue8i.js.map +0 -1
  63. package/dist/shared/url-vXQWF--L.cjs.map +0 -1
  64. package/dist/shared/validate-CbM3k811.cjs.map +0 -1
  65. package/dist/shared/validate-oLSGiGwQ.js.map +0 -1
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_validate = require("../shared/validate-CbM3k811.cjs");
3
- const require_url = require("../shared/url-vXQWF--L.cjs");
4
- const require_cookies = require("../shared/cookies-BLmvIZBD.cjs");
5
- const require_events = require("../shared/events-9dRKcUPZ.cjs");
2
+ const require_validate = require("../shared/validate-DQrtiCtV.cjs");
3
+ const require_url = require("../shared/url-CStw2h1g.cjs");
4
+ const require_cookies = require("../shared/cookies-Dv5LQp55.cjs");
5
+ const require_events = require("../shared/events-DFQSN5H6.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;
@@ -3,6 +3,6 @@
3
3
  *
4
4
  * @packageDocumentation
5
5
  */
6
- import { $t as ItdClock, A as ClientConnection, An as Loose, Cn as EventChannelStatus, F as tokenProvider, G as ItdError, H as ItdAuthError, K as ItdErrorKind, M as AuthProvider, Mn as NotificationType, N as anonymousAuth, O as Listener, P as bearerToken, Q as ItdNotFoundError, Qt as Logger, R as ItdAbortError, St as LIBRARY_VERSION, U as ItdConfigError, V as ItdApiErrorKind, Wt as RuntimeOptions, X as ItdForbiddenError, Yt as RuntimeMode, Z as ItdNetworkError, Zt as LogLevel, _t as isItdStateError, a as NotificationEvent, bt as DEFAULT_BASE_URL, c as NotificationSettings, ct as isItdAuthError, en as systemClock, et as ItdRateLimitError, ht as isItdRateLimitError, i as formatNotificationText, it as ItdValidationError, j as AuthIdentity, k as Unsubscribe, kt as ClientHooks, n as canonicalNotificationType, nt as ItdStateError, o as normalizeNotification, ot as TimeoutBudget, r as isKnownNotificationType, rt as ItdTimeoutError, s as Notification, st as isItdApiError, t as resolveNotificationUrl, tt as ItdServerError, ut as isItdError, vt as isItdValidationError, z as ItdApiError } from "../shared/url-ZRjcpC__.cjs";
7
- import { $ as EventTransportFrame, A as EventSequentializer, B as NotificationOfType, C as EventSession, D as EventMiddlewareObject, E as EventMiddleware, F as NotificationEventContext, G as UnknownNotificationUpdate, H as NotificationUpdateOfType, I as NotificationEventFilter, J as NotificationEventsMap, K as UnreadCountUpdate, L as NotificationEventOfType, M as runEventMiddleware, N as EventContext, O as EventNext, P as NotificationContext, Q as EventTransportContext, R as NotificationEventSelector, S as EventEnqueueOptions, T as EventHandler, U as NotificationUpdateOrigin, V as NotificationUpdate, W as NotificationUpdateType, X as NotificationEventsTransport, Y as NotificationEventsOptions, Z as EventTransport, _ as WebSocketTransportOptions, a as EventMiddlewareGroup, b as EventChannelEvents, c as EventRouteSelector, d as NotificationEventsClientOptions, et as UnauthorizedStreamError, f as createNotificationEventsClient, g as WebSocketTransport, h as WebSocketOpenFailureClassifier, i as EventFilter, j as EventTypeGuard, k as EventPredicate, l as EventRouter, m as WebSocketLike, n as EventErrorBoundary, o as EventMiddlewareLike, p as WebSocketImplementationOptions, q as NotificationEvents, r as EventErrorContext, s as EventRouteTable, t as EventComposer, tt as ReconnectOptions, u as NotificationEventsClient, v as EventChannel, w as EventSyncReason, x as EventChannelOptions, y as EventChannelDeps, z as NotificationEventsUpdate } from "../shared/events-BSotWa3Z.cjs";
6
+ import { $t as ItdValidationError, A as ClientConnection, B as DEFAULT_BASE_URL, Bt as ItdError, F as tokenProvider, Gt as ItdForbiddenError, H as LIBRARY_VERSION, It as ItdApiErrorKind, Kt as ItdNetworkError, Lt as ItdAuthError, M as AuthProvider, N as anonymousAuth, Nn as NotificationType, Nt as ItdAbortError, O as Listener, P as bearerToken, Pt as ItdApiError, Qt as ItdTimeoutError, Rt as ItdConfigError, Vt as ItdErrorKind, Xt as ItdServerError, Y as ClientHooks, Yt as ItdRateLimitError, Zt as ItdStateError, _t as LogLevel, a as NotificationEvent, an as isItdError, bt as systemClock, c as NotificationSettings, fn as isItdStateError, ht as RuntimeMode, i as formatNotificationText, j as AuthIdentity, jn as Loose, k as Unsubscribe, n as canonicalNotificationType, nn as isItdApiError, o as normalizeNotification, pn as isItdValidationError, qt as ItdNotFoundError, r as isKnownNotificationType, rn as isItdAuthError, s as Notification, t as resolveNotificationUrl, tn as TimeoutBudget, un as isItdRateLimitError, ut as RuntimeOptions, vt as Logger, wn as EventChannelStatus, yt as ItdClock } from "../shared/url-Ls6HGxZl.cjs";
7
+ import { $ as EventTransportFrame, A as EventSequentializer, B as NotificationOfType, C as EventSession, D as EventMiddlewareObject, E as EventMiddleware, F as NotificationEventContext, G as UnknownNotificationUpdate, H as NotificationUpdateOfType, I as NotificationEventFilter, J as NotificationEventsMap, K as UnreadCountUpdate, L as NotificationEventOfType, M as runEventMiddleware, N as EventContext, O as EventNext, P as NotificationContext, Q as EventTransportContext, R as NotificationEventSelector, S as EventEnqueueOptions, T as EventHandler, U as NotificationUpdateOrigin, V as NotificationUpdate, W as NotificationUpdateType, X as NotificationEventsTransport, Y as NotificationEventsOptions, Z as EventTransport, _ as WebSocketTransportOptions, a as EventMiddlewareGroup, b as EventChannelEvents, c as EventRouteSelector, d as NotificationEventsClientOptions, et as UnauthorizedStreamError, f as createNotificationEventsClient, g as WebSocketTransport, h as WebSocketOpenFailureClassifier, i as EventFilter, j as EventTypeGuard, k as EventPredicate, l as EventRouter, m as WebSocketLike, n as EventErrorBoundary, o as EventMiddlewareLike, p as WebSocketImplementationOptions, q as NotificationEvents, r as EventErrorContext, s as EventRouteTable, t as EventComposer, tt as ReconnectOptions, u as NotificationEventsClient, v as EventChannel, w as EventSyncReason, x as EventChannelOptions, y as EventChannelDeps, z as NotificationEventsUpdate } from "../shared/events-BsmLCdog.cjs";
8
8
  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, LogLevel, 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, TimeoutBudget, 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, resolveNotificationUrl, runEventMiddleware, systemClock, tokenProvider };
@@ -3,6 +3,6 @@
3
3
  *
4
4
  * @packageDocumentation
5
5
  */
6
- import { $ as ItdServerError, A as ClientConnection, B as ItdAuthError, Dn as Loose, Et as ClientHooks, F as tokenProvider, I as ItdAbortError, J as ItdForbiddenError, Jt as LogLevel, Kt as RuntimeMode, L as ItdApiError, M as AuthProvider, N as anonymousAuth, O as Listener, P as bearerToken, Q as ItdRateLimitError, U as ItdError, V as ItdConfigError, Vt as RuntimeOptions, W as ItdErrorKind, X as ItdNotFoundError, Xt as ItdClock, Y as ItdNetworkError, Yt as Logger, Zt as systemClock, _t as DEFAULT_BASE_URL, a as NotificationEvent, at as isItdApiError, bn as EventChannelStatus, c as NotificationSettings, ct as isItdError, et as ItdStateError, gt as isItdValidationError, ht as isItdStateError, i as formatNotificationText, it as TimeoutBudget, j as AuthIdentity, k as Unsubscribe, kn as NotificationType, n as canonicalNotificationType, nt as ItdValidationError, o as normalizeNotification, ot as isItdAuthError, pt as isItdRateLimitError, r as isKnownNotificationType, s as Notification, t as resolveNotificationUrl, tt as ItdTimeoutError, yt as LIBRARY_VERSION, z as ItdApiErrorKind } from "../shared/url-C49-l_KW.js";
7
- import { $ as EventTransportContext, A as EventHandler, B as NotificationEventContext, C as EventChannelDeps, D as EventSession, E as EventEnqueueOptions, F as EventSequentializer, G as NotificationOfType, H as NotificationEventOfType, I as EventTypeGuard, J as NotificationUpdateOrigin, K as NotificationUpdate, L as runEventMiddleware, M as EventMiddlewareObject, N as EventNext, O as EventSyncReason, P as EventPredicate, Q as EventTransport, R as EventContext, S as EventChannel, T as EventChannelOptions, U as NotificationEventSelector, V as NotificationEventFilter, W as NotificationEventsUpdate, X as UnknownNotificationUpdate, Y as NotificationUpdateType, Z as UnreadCountUpdate, _ as createNotificationEventsClient, a as WebSocketTransportOptions, b as NotificationEventsOptions, c as EventErrorContext, d as EventMiddlewareLike, et as EventTransportFrame, f as EventRouteTable, g as NotificationEventsClientOptions, h as NotificationEventsClient, i as WebSocketTransport, j as EventMiddleware, k as ReconnectOptions, l as EventFilter, m as EventRouter, n as WebSocketLike, o as EventComposer, p as EventRouteSelector, q as NotificationUpdateOfType, r as WebSocketOpenFailureClassifier, s as EventErrorBoundary, t as WebSocketImplementationOptions, tt as UnauthorizedStreamError, u as EventMiddlewareGroup, v as NotificationEvents, w as EventChannelEvents, x as NotificationEventsTransport, y as NotificationEventsMap, z as NotificationContext } from "../shared/events-B18vQGEH.js";
6
+ import { $t as isItdAuthError, A as ClientConnection, At as ItdApiError, Dn as Loose, F as tokenProvider, G as ClientHooks, Gt as ItdRateLimitError, Ht as ItdNetworkError, I as DEFAULT_BASE_URL, It as ItdError, Jt as ItdTimeoutError, Kt as ItdServerError, Lt as ItdErrorKind, M as AuthProvider, Mt as ItdApiErrorKind, N as anonymousAuth, Nt as ItdAuthError, O as Listener, P as bearerToken, Pt as ItdConfigError, Qt as isItdApiError, R as LIBRARY_VERSION, Ut as ItdNotFoundError, Vt as ItdForbiddenError, Yt as ItdValidationError, Zt as TimeoutBudget, a as NotificationEvent, bn as EventChannelStatus, c as NotificationSettings, cn as isItdStateError, dt as RuntimeMode, gt as systemClock, ht as ItdClock, i as formatNotificationText, j as AuthIdentity, k as Unsubscribe, kn as NotificationType, kt as ItdAbortError, ln as isItdValidationError, mt as Logger, n as canonicalNotificationType, o as normalizeNotification, on as isItdRateLimitError, ot as RuntimeOptions, pt as LogLevel, qt as ItdStateError, r as isKnownNotificationType, s as Notification, t as resolveNotificationUrl, tn as isItdError } from "../shared/url-U1Q7c-SD.js";
7
+ import { $ as EventTransportContext, A as EventHandler, B as NotificationEventContext, C as EventChannelDeps, D as EventSession, E as EventEnqueueOptions, F as EventSequentializer, G as NotificationOfType, H as NotificationEventOfType, I as EventTypeGuard, J as NotificationUpdateOrigin, K as NotificationUpdate, L as runEventMiddleware, M as EventMiddlewareObject, N as EventNext, O as EventSyncReason, P as EventPredicate, Q as EventTransport, R as EventContext, S as EventChannel, T as EventChannelOptions, U as NotificationEventSelector, V as NotificationEventFilter, W as NotificationEventsUpdate, X as UnknownNotificationUpdate, Y as NotificationUpdateType, Z as UnreadCountUpdate, _ as createNotificationEventsClient, a as WebSocketTransportOptions, b as NotificationEventsOptions, c as EventErrorContext, d as EventMiddlewareLike, et as EventTransportFrame, f as EventRouteTable, g as NotificationEventsClientOptions, h as NotificationEventsClient, i as WebSocketTransport, j as EventMiddleware, k as ReconnectOptions, l as EventFilter, m as EventRouter, n as WebSocketLike, o as EventComposer, p as EventRouteSelector, q as NotificationUpdateOfType, r as WebSocketOpenFailureClassifier, s as EventErrorBoundary, t as WebSocketImplementationOptions, tt as UnauthorizedStreamError, u as EventMiddlewareGroup, v as NotificationEvents, w as EventChannelEvents, x as NotificationEventsTransport, y as NotificationEventsMap, z as NotificationContext } from "../shared/events-By7baZfE.js";
8
8
  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, LogLevel, 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, TimeoutBudget, 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, resolveNotificationUrl, runEventMiddleware, systemClock, tokenProvider };
@@ -1,5 +1,5 @@
1
- import { C as ItdValidationError, D as isItdAuthError, E as isItdApiError, I as isItdStateError, L as isItdValidationError, P as isItdRateLimitError, S as ItdTimeoutError, T as TimeoutBudget, _ as ItdNotFoundError, a as ItdAbortError, b as ItdServerError, c as ItdAuthError, d as ItdError, f as ItdErrorKind, g as ItdNetworkError, h as ItdForbiddenError, k as isItdError, l as ItdConfigError, o as ItdApiError, s as ItdApiErrorKind, x as ItdStateError, y as ItdRateLimitError } from "../shared/validate-oLSGiGwQ.js";
2
- import { S as LIBRARY_VERSION, a as tokenProvider, ct as NotificationType, et as EventChannelStatus, i as bearerToken, l as canonicalNotificationType, n as formatNotificationText, o as normalizeNotification, r as anonymousAuth, t as resolveNotificationUrl, u as isKnownNotificationType, v as DEFAULT_BASE_URL, yt as systemClock } from "../shared/url-DcjNue8i.js";
3
- import { E as LogLevel, v as RuntimeMode } from "../shared/cookies-lIXHWhOd.js";
4
- import { d as NotificationUpdateType, g as runEventMiddleware, h as UnauthorizedStreamError, i as createNotificationEventsClient, m as EventChannel, n as EventRouter, o as NotificationEvents, p as WebSocketTransport, r as NotificationEventsClient, s as NotificationEventsTransport, t as EventComposer, u as NotificationUpdateOrigin } from "../shared/events-C7MJnuJw.js";
1
+ import { C as ItdValidationError, D as isItdAuthError, E as isItdApiError, I as isItdStateError, L as isItdValidationError, P as isItdRateLimitError, S as ItdTimeoutError, T as TimeoutBudget, _ as ItdNotFoundError, a as ItdAbortError, b as ItdServerError, c as ItdAuthError, d as ItdError, f as ItdErrorKind, g as ItdNetworkError, h as ItdForbiddenError, k as isItdError, l as ItdConfigError, o as ItdApiError, s as ItdApiErrorKind, x as ItdStateError, y as ItdRateLimitError } from "../shared/validate-CCgIq5u0.js";
2
+ import { S as bearerToken, h as DEFAULT_BASE_URL, n as formatNotificationText, nt as EventChannelStatus, o as canonicalNotificationType, r as normalizeNotification, s as isKnownNotificationType, t as resolveNotificationUrl, ut as NotificationType, w as tokenProvider, x as anonymousAuth, xt as systemClock, y as LIBRARY_VERSION } from "../shared/url-DTDqkKpf.js";
3
+ import { E as LogLevel, v as RuntimeMode } from "../shared/cookies-mDZE19_j.js";
4
+ import { d as NotificationUpdateType, g as runEventMiddleware, h as UnauthorizedStreamError, i as createNotificationEventsClient, m as EventChannel, n as EventRouter, o as NotificationEvents, p as WebSocketTransport, r as NotificationEventsClient, s as NotificationEventsTransport, t as EventComposer, u as NotificationUpdateOrigin } from "../shared/events-DorlX-Xd.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, LogLevel, NotificationEvents, NotificationEventsClient, NotificationEventsTransport, NotificationType, NotificationUpdateOrigin, NotificationUpdateType, RuntimeMode, TimeoutBudget, UnauthorizedStreamError, WebSocketTransport, anonymousAuth, bearerToken, canonicalNotificationType, createNotificationEventsClient, formatNotificationText, isItdApiError, isItdAuthError, isItdError, isItdRateLimitError, isItdStateError, isItdValidationError, isKnownNotificationType, normalizeNotification, resolveNotificationUrl, runEventMiddleware, systemClock, tokenProvider };
package/dist/index.cjs CHANGED
@@ -1,13 +1,13 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_validate = require("./shared/validate-CbM3k811.cjs");
3
- const require_render = require("./shared/render-DOLkOCVs.cjs");
4
- const require_events = require("./shared/events-9dRKcUPZ.cjs");
5
- const require_url = require("./shared/url-vXQWF--L.cjs");
6
- const require_cookies = require("./shared/cookies-BLmvIZBD.cjs");
7
- const require_storage = require("./shared/storage-xximVWs_.cjs");
8
- const require_multi_storage = require("./shared/multi-storage-lwn-cmG6.cjs");
9
- const require_options = require("./shared/options-DYeE1hFt.cjs");
10
- const require_key_value_store = require("./shared/key-value-store-Bxt33ZF3.cjs");
2
+ const require_validate = require("./shared/validate-DQrtiCtV.cjs");
3
+ const require_render = require("./shared/render-CklT-3gT.cjs");
4
+ const require_events = require("./shared/events-DFQSN5H6.cjs");
5
+ const require_url = require("./shared/url-CStw2h1g.cjs");
6
+ const require_cookies = require("./shared/cookies-Dv5LQp55.cjs");
7
+ const require_storage = require("./shared/storage-Bj7GKkEQ.cjs");
8
+ const require_multi_storage = require("./shared/multi-storage-DXBY9ceK.cjs");
9
+ const require_options = require("./shared/options-eaq9yK8b.cjs");
10
+ const require_key_value_store = require("./shared/key-value-store-CeiDXFAC.cjs");
11
11
  // src/events/chats.ts
12
12
  /** Канал событий чатов. Доступен как `itd.chats.events` в полном клиенте. */
13
13
  var ChatEvents = class {
@@ -194,6 +194,8 @@ function createNotificationsApi(http, createEvents) {
194
194
  }
195
195
  // src/operations/account.ts
196
196
  const ACCOUNT_GET_INFO = require_url.passthroughOperation("account.getInfo");
197
+ const ACCOUNT_TERMS_ACCEPTANCE = require_url.passthroughOperation("account.termsAcceptance");
198
+ const ACCOUNT_ACCEPT_TERMS = require_url.voidOperation("account.acceptTerms");
197
199
  const ACCOUNT_PASSWORD_SET = require_url.voidOperation("account.password.set");
198
200
  const ACCOUNT_PASSWORD_CHANGE = require_url.voidOperation("account.password.change");
199
201
  // src/operations/account/changes.ts
@@ -276,7 +278,8 @@ const PhoneDeliveryChannel = Object.freeze({
276
278
  MissedCall: "missed_call",
277
279
  VoiceCall: "voice_call",
278
280
  Sms: "sms",
279
- Push: "push"
281
+ Push: "push",
282
+ Message: "message"
280
283
  });
281
284
  /** Подтверждение входящим кодом либо исходящим звонком пользователя. */
282
285
  const PhoneVerificationMethod = Object.freeze({
@@ -355,7 +358,7 @@ var AccountEmailResource = class extends require_render.BaseResource {
355
358
  }
356
359
  /** Повторно отправляет код на тот же адрес. Передайте `flowToken` из первого запроса. */
357
360
  resendOtp(input, options = {}) {
358
- return requestAccount(this.http, ACCOUNT_EMAIL_RESEND_OTP, "/resend-otp", input, options);
361
+ return requestAccount(this.http, ACCOUNT_EMAIL_RESEND_OTP, "/email/resend-otp", input, options);
359
362
  }
360
363
  };
361
364
  // src/resources/account/password.ts
@@ -581,6 +584,21 @@ var AccountResource = class extends require_render.AccountLifecycleResource {
581
584
  getInfo(options = {}) {
582
585
  return requestAccount(this.http, ACCOUNT_GET_INFO, "/methods", void 0, options);
583
586
  }
587
+ /** Возвращает текущую редакцию условий и контекст, если аккаунту требуется согласие. */
588
+ termsAcceptance(options = {}) {
589
+ return requestAccount(this.http, ACCOUNT_TERMS_ACCEPTANCE, "/terms-acceptance", void 0, options);
590
+ }
591
+ /**
592
+ * Записывает согласие текущего аккаунта с редакцией условий.
593
+ *
594
+ * @param contextToken токен из контекста согласия, полученного через {@link termsAcceptance}
595
+ */
596
+ acceptTerms(contextToken, options = {}) {
597
+ return requestAccount(this.http, ACCOUNT_ACCEPT_TERMS, "/terms-acceptance", {
598
+ accepted: true,
599
+ contextToken
600
+ }, options);
601
+ }
584
602
  };
585
603
  // src/operations/auth.ts
586
604
  /** Чем закончился запрос входа. */
@@ -727,45 +745,6 @@ async function solveCaptchaToken(solver, askProvider, context) {
727
745
  function captchaBody(captcha) {
728
746
  return { [resolveField(captcha.type, captcha.field)]: captcha.token };
729
747
  }
730
- // src/session/jwt.ts
731
- /**
732
- * Разбирает строку base64url.
733
- *
734
- * `atob` понимает только обычный base64, поэтому алфавит приводится к нему, а недостающее
735
- * выравнивание добивается. Результат декодируется как UTF-8: в полезной нагрузке токена
736
- * может оказаться кириллица, и «бинарная» строка из `atob` сломала бы `JSON.parse`.
737
- */
738
- function decodeBase64Url(segment) {
739
- const base64 = segment.replace(/-/g, "+").replace(/_/g, "/");
740
- const padded = base64.padEnd(base64.length + (4 - base64.length % 4) % 4, "=");
741
- const binary = atob(padded);
742
- const bytes = Uint8Array.from(binary, (char) => char.charCodeAt(0));
743
- return new TextDecoder().decode(bytes);
744
- }
745
- /** Читает полезную нагрузку JWT без проверки подписи. */
746
- function readTokenPayload(token) {
747
- try {
748
- const payload = token.split(".")[1];
749
- if (!payload) return void 0;
750
- const parsed = JSON.parse(decodeBase64Url(payload));
751
- if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) return void 0;
752
- return parsed;
753
- } catch {
754
- return;
755
- }
756
- }
757
- /** Читает используемые клиентом поля JWT за один раз. */
758
- function readTokenMetadata(token) {
759
- const payload = readTokenPayload(token);
760
- if (!payload) return {};
761
- const { sub, sid, exp } = payload;
762
- const expiresAt = typeof exp === "number" && Number.isFinite(exp) ? exp * 1e3 : void 0;
763
- return {
764
- ...typeof sub === "string" && sub.length > 0 ? { subject: sub } : {},
765
- ...typeof sid === "string" && sid.length > 0 ? { sessionId: sid } : {},
766
- ...expiresAt !== void 0 && Number.isFinite(expiresAt) ? { expiresAt } : {}
767
- };
768
- }
769
748
  // src/session/auth.ts
770
749
  /** Запас до истечения токена на очередь и выполнение запроса. */
771
750
  const ACCESS_TOKEN_REFRESH_LEEWAY_MS = 3e4;
@@ -853,7 +832,7 @@ const AUTH_PATHS = {
853
832
  signUp: "/api/v1/auth/sign-up",
854
833
  signIn: "/api/v1/auth/sign-in",
855
834
  verifyOtp: "/api/v1/auth/verify-otp",
856
- resendOtp: "/api/v1/auth/resend-otp",
835
+ resendOtp: "/api/v1/auth/email/resend-otp",
857
836
  refresh: "/api/v1/auth/refresh",
858
837
  logout: "/api/v1/auth/logout",
859
838
  forgotPassword: "/api/v1/auth/forgot-password",
@@ -1014,6 +993,16 @@ var AuthManager = class {
1014
993
  this.#jar = jar;
1015
994
  this.#hooks = hooks;
1016
995
  this.#emitter = new require_events.Emitter((error) => require_events.reportListenerError(config.logger, "авторизации", error));
996
+ const auth = config.auth;
997
+ if (hooks.onAccountChange && typeof auth === "object" && "getToken" in auth) require_url.setQueuedAuthPreparation(this, { prepare: async () => {
998
+ const token = await this.#prepareAccessToken();
999
+ return () => {
1000
+ const current = this.#session?.accessToken ?? this.#externalToken ?? null;
1001
+ if (token === current) return true;
1002
+ const { userId } = this.#identityForToken(token ?? void 0);
1003
+ return userId !== void 0 && userId === this.getCurrentAuthIdentity().userId;
1004
+ };
1005
+ } });
1017
1006
  }
1018
1007
  /** Подписка на события авторизации. */
1019
1008
  get on() {
@@ -1108,7 +1097,7 @@ var AuthManager = class {
1108
1097
  return {};
1109
1098
  }
1110
1099
  if (this.#tokenMetadata?.accessToken === accessToken) return this.#tokenMetadata.value;
1111
- const value = readTokenMetadata(accessToken);
1100
+ const value = require_url.readTokenMetadata(accessToken);
1112
1101
  this.#tokenMetadata = {
1113
1102
  accessToken,
1114
1103
  value
@@ -1184,10 +1173,16 @@ var AuthManager = class {
1184
1173
  }
1185
1174
  /** Перед каждой попыткой перечитывает внешний источник токена. */
1186
1175
  async prepare() {
1176
+ await this.#prepareAccessToken();
1177
+ }
1178
+ /** Возвращает токен, прочитанный при подготовке этой попытки. */
1179
+ async #prepareAccessToken() {
1187
1180
  this.#assertActive();
1188
- if ((await this.#loadSession())?.accessToken) return;
1181
+ const session = await this.#loadSession();
1182
+ if (session?.accessToken) return session.accessToken;
1189
1183
  const auth = this.#config.auth;
1190
- if (typeof auth === "object" && auth !== null && "getToken" in auth) await this.#readExternalToken(() => auth.getToken());
1184
+ if (typeof auth === "object" && auth !== null && "getToken" in auth) return this.#readExternalToken(() => auth.getToken());
1185
+ return null;
1191
1186
  }
1192
1187
  /**
1193
1188
  * Заголовки уже подготовленной авторизации без чтения storage или вызова внешнего источника.
@@ -1799,7 +1794,13 @@ var PhoneAuthResource = class extends require_render.BaseResource {
1799
1794
  }
1800
1795
  /** Разрешённые регионы, примеры номеров и доступные способы подтверждения. */
1801
1796
  config(options = {}) {
1802
- return this.#request(AUTH_PHONE_CONFIG, "/phone/config", void 0, options);
1797
+ return this.#request(AUTH_PHONE_CONFIG, "/phone/config", void 0, {
1798
+ ...options,
1799
+ headers: {
1800
+ ...options.headers,
1801
+ "X-ITD-Phone-Message": "1"
1802
+ }
1803
+ });
1803
1804
  }
1804
1805
  /**
1805
1806
  * Загружает контекст phone_entry вместе с текстом и редакциями документов.
@@ -1833,7 +1834,7 @@ var PhoneAuthResource = class extends require_render.BaseResource {
1833
1834
  ...options,
1834
1835
  headers: {
1835
1836
  ...options.headers,
1836
- ...input.method === PhoneVerificationMethod.Reverse ? { "X-ITD-Phone-Method": PhoneVerificationMethod.Reverse } : {}
1837
+ ...input.method === PhoneVerificationMethod.Reverse ? { "X-ITD-Phone-Method": PhoneVerificationMethod.Reverse } : { "X-ITD-Phone-Message": "1" }
1837
1838
  }
1838
1839
  });
1839
1840
  }
@@ -2554,7 +2555,10 @@ var ItdClient = class ItdClient {
2554
2555
  assertActive: (action) => assertClientActive(this, action),
2555
2556
  auth: (deps) => createItdAuth(options, {
2556
2557
  ...deps,
2557
- onAccountChange: () => featureHost?.stop()
2558
+ onAccountChange: () => {
2559
+ deps.onAccountChange?.();
2560
+ featureHost?.stop();
2561
+ }
2558
2562
  })
2559
2563
  });
2560
2564
  this.#features = featureHost = require_render.createFeatureHost(this.#runtime, {