itd-api 0.10.1 → 0.10.3

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 (33) hide show
  1. package/dist/events/index.cjs +2 -2
  2. package/dist/events/index.d.cts +2 -2
  3. package/dist/events/index.d.ts +2 -2
  4. package/dist/events/index.js +2 -2
  5. package/dist/index.cjs +89 -9
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.cts +60 -4
  8. package/dist/index.d.ts +60 -4
  9. package/dist/index.js +89 -10
  10. package/dist/index.js.map +1 -1
  11. package/dist/rest/index.cjs +2 -2
  12. package/dist/rest/index.d.cts +2 -2
  13. package/dist/rest/index.d.ts +2 -2
  14. package/dist/rest/index.js +2 -2
  15. package/dist/shared/{events-MtRNe_TF.cjs → events-BVfqWyBw.cjs} +2 -2
  16. package/dist/shared/{events-MtRNe_TF.cjs.map → events-BVfqWyBw.cjs.map} +1 -1
  17. package/dist/shared/{events-D3CSlpXR.d.ts → events-Cp7ITueA.d.ts} +2 -2
  18. package/dist/shared/{events-Cipe-Fm9.js → events-Cwj7UPAa.js} +2 -2
  19. package/dist/shared/{events-Cipe-Fm9.js.map → events-Cwj7UPAa.js.map} +1 -1
  20. package/dist/shared/{events-CZXU16qU.d.cts → events-D0Wtt-If.d.cts} +2 -2
  21. package/dist/shared/{render-CubTTof_.js → render-BT74nC1l.js} +2 -2
  22. package/dist/shared/{render-CubTTof_.js.map → render-BT74nC1l.js.map} +1 -1
  23. package/dist/shared/{render-bZwOk3CC.d.cts → render-CJO_L2CD.d.cts} +29 -3
  24. package/dist/shared/{render-dscKp9CC.cjs → render-CYJSDypQ.cjs} +2 -2
  25. package/dist/shared/{render-dscKp9CC.cjs.map → render-CYJSDypQ.cjs.map} +1 -1
  26. package/dist/shared/{render-Cs6AOXbD.d.ts → render-DRmuHoEy.d.ts} +29 -3
  27. package/dist/shared/{url-Dum7r_FT.d.cts → url-BLnX-LYt.d.cts} +38 -5
  28. package/dist/shared/{url-Dum7r_FT.d.ts → url-BLnX-LYt.d.ts} +38 -5
  29. package/dist/shared/{url-DgTYZN_v.cjs → url-BnO1aWsd.cjs} +42 -4
  30. package/dist/shared/{url-DgTYZN_v.cjs.map → url-BnO1aWsd.cjs.map} +1 -1
  31. package/dist/shared/{url-CntTEAxu.js → url-DS0-lrl-.js} +37 -5
  32. package/dist/shared/{url-CntTEAxu.js.map → url-DS0-lrl-.js.map} +1 -1
  33. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_url = require("../shared/url-DgTYZN_v.cjs");
2
+ const require_url = require("../shared/url-BnO1aWsd.cjs");
3
3
  const require_errors = require("../shared/errors-BmP3TKoW.cjs");
4
4
  const require_redact = require("../shared/redact-lAmck1Z6.cjs");
5
- const require_events = require("../shared/events-MtRNe_TF.cjs");
5
+ const require_events = require("../shared/events-BVfqWyBw.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 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, _n as Loose, a as NotificationEvent, at as bearerToken, c as NotificationSettings, ct as Listener, dn as EventChannelStatus, et as isItdValidationError, ft as LIBRARY_VERSION, i as formatNotificationText, it as anonymousAuth, k as ItdError, lt as Unsubscribe, 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, vn as NotificationType, xt as Logger, yt as ClientHooks, z as ItdServerError } from "../shared/url-Dum7r_FT.cjs";
2
- 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-CZXU16qU.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, _n as Loose, a as NotificationEvent, at as bearerToken, c as NotificationSettings, ct as Listener, dn as EventChannelStatus, et as isItdValidationError, ft as LIBRARY_VERSION, i as formatNotificationText, it as anonymousAuth, k as ItdError, lt as Unsubscribe, 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, vn as NotificationType, xt as Logger, yt as ClientHooks, z as ItdServerError } from "../shared/url-BLnX-LYt.cjs";
2
+ 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-D0Wtt-If.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, resolveNotificationUrl, runEventMiddleware, systemClock, tokenProvider };
@@ -1,3 +1,3 @@
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, _n as Loose, a as NotificationEvent, at as bearerToken, c as NotificationSettings, ct as Listener, dn as EventChannelStatus, et as isItdValidationError, ft as LIBRARY_VERSION, i as formatNotificationText, it as anonymousAuth, k as ItdError, lt as Unsubscribe, 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, vn as NotificationType, xt as Logger, yt as ClientHooks, z as ItdServerError } from "../shared/url-Dum7r_FT.js";
2
- 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-D3CSlpXR.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, _n as Loose, a as NotificationEvent, at as bearerToken, c as NotificationSettings, ct as Listener, dn as EventChannelStatus, et as isItdValidationError, ft as LIBRARY_VERSION, i as formatNotificationText, it as anonymousAuth, k as ItdError, lt as Unsubscribe, 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, vn as NotificationType, xt as Logger, yt as ClientHooks, z as ItdServerError } from "../shared/url-BLnX-LYt.js";
2
+ 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-Cp7ITueA.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, resolveNotificationUrl, runEventMiddleware, systemClock, tokenProvider };
@@ -1,5 +1,5 @@
1
- import { T as NotificationType, a as tokenProvider, c as normalizeNotification, d as canonicalNotificationType, f as isKnownNotificationType, ht as systemClock, i as bearerToken, n as formatNotificationText, ot as DEFAULT_BASE_URL, r as anonymousAuth, t as resolveNotificationUrl, ut as LIBRARY_VERSION, y as EventChannelStatus } from "../shared/url-CntTEAxu.js";
1
+ import { T as NotificationType, a as tokenProvider, c as normalizeNotification, d as canonicalNotificationType, dt as LIBRARY_VERSION, f as isKnownNotificationType, gt as systemClock, i as bearerToken, n as formatNotificationText, r as anonymousAuth, st as DEFAULT_BASE_URL, t as resolveNotificationUrl, y as EventChannelStatus } from "../shared/url-DS0-lrl-.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
3
  import { v as RuntimeMode } from "../shared/redact-DJV0XM3n.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 EventChannel, n as EventRouter, r as NotificationEventsClient, s as NotificationEvents, t as EventComposer } from "../shared/events-Cipe-Fm9.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 EventChannel, n as EventRouter, r as NotificationEventsClient, s as NotificationEvents, t as EventComposer } from "../shared/events-Cwj7UPAa.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, resolveNotificationUrl, runEventMiddleware, systemClock, tokenProvider };
package/dist/index.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_url = require("./shared/url-DgTYZN_v.cjs");
2
+ const require_url = require("./shared/url-BnO1aWsd.cjs");
3
3
  const require_errors = require("./shared/errors-BmP3TKoW.cjs");
4
4
  const require_redact = require("./shared/redact-lAmck1Z6.cjs");
5
- const require_render = require("./shared/render-dscKp9CC.cjs");
5
+ const require_render = require("./shared/render-CYJSDypQ.cjs");
6
6
  const require_options = require("./shared/options-DjEtbVaf.cjs");
7
- const require_events = require("./shared/events-MtRNe_TF.cjs");
7
+ const require_events = require("./shared/events-BVfqWyBw.cjs");
8
8
  const require_key_value_store = require("./shared/key-value-store-B5GYVEYZ.cjs");
9
9
  const require_storage = require("./shared/storage-CZJZoaz9.cjs");
10
10
  const require_multi_storage = require("./shared/multi-storage-s-fPtjoy.cjs");
@@ -63,6 +63,7 @@ function requireString(body, key, message) {
63
63
  }
64
64
  const AUTH_CHECK = require_url.passthroughOperation("auth.check");
65
65
  const AUTH_CAPTCHA_PROVIDER = require_url.passthroughOperation("auth.captchaProvider");
66
+ const AUTH_CAPTCHA_PAGE = require_url.passthroughOperation("auth.captchaPage");
66
67
  const AUTH_SIGN_UP = require_url.defineBuiltInOperation("auth.signUp", (body) => requireString(body, "flowToken", "Сервер не вернул flowToken при регистрации"));
67
68
  const AUTH_SIGN_IN = require_url.defineBuiltInOperation("auth.signIn", (body) => {
68
69
  const accessToken = require_url.pickString(body, "accessToken");
@@ -86,6 +87,9 @@ const AUTH_REVOKE_SESSION = require_url.voidOperation("auth.revokeSession");
86
87
  const AUTH_REVOKE_OTHER_SESSIONS = require_url.voidOperation("auth.revokeOtherSessions");
87
88
  const AUTH_QR_START = require_url.passthroughOperation("auth.qrStart");
88
89
  const AUTH_QR_CLAIM = require_url.passthroughOperation("auth.qrClaim");
90
+ const AUTH_QR_SCAN = require_url.passthroughOperation("auth.qrScan");
91
+ const AUTH_QR_APPROVE = require_url.voidOperation("auth.qrApprove");
92
+ const AUTH_QR_REJECT = require_url.voidOperation("auth.qrReject");
89
93
  //#endregion
90
94
  //#region src/session/captcha.ts
91
95
  function requireCaptchaText(value, field) {
@@ -298,6 +302,7 @@ function createItdAuth(options, deps) {
298
302
  /** Пути эндпоинтов авторизации. */
299
303
  const AUTH_PATHS = {
300
304
  captchaProvider: "/api/v1/auth/captcha/provider",
305
+ captchaPage: "/api/v1/auth/captcha/page",
301
306
  signUp: "/api/v1/auth/sign-up",
302
307
  signIn: "/api/v1/auth/sign-in",
303
308
  verifyOtp: "/api/v1/auth/verify-otp",
@@ -310,7 +315,10 @@ const AUTH_PATHS = {
310
315
  sessions: "/api/v1/auth/sessions",
311
316
  qrStart: "/api/v1/auth/qr/start",
312
317
  qrClaim: "/api/v1/auth/qr/claim",
313
- qrStream: "/api/v1/auth/qr/stream"
318
+ qrStream: "/api/v1/auth/qr/stream",
319
+ qrScan: "/api/v1/auth/qr/scan",
320
+ qrApprove: "/api/v1/auth/qr/approve",
321
+ qrReject: "/api/v1/auth/qr/reject"
314
322
  };
315
323
  /**
316
324
  * Публичный ключ Cloudflare Turnstile платформы итд.com.
@@ -1009,11 +1017,22 @@ var AuthManager = class {
1009
1017
  }
1010
1018
  /** Спрашивает у сервера активного провайдера и поле, в котором он ждёт токен. */
1011
1019
  async #resolveCaptchaProvider() {
1012
- return readCaptchaProvider(await this.#http.execute(AUTH_CAPTCHA_PROVIDER, {
1013
- path: AUTH_PATHS.captchaProvider,
1014
- skipAuth: true,
1015
- skipAuthRefresh: true
1016
- }));
1020
+ try {
1021
+ return readCaptchaProvider(await this.#http.execute(AUTH_CAPTCHA_PROVIDER, {
1022
+ path: AUTH_PATHS.captchaProvider,
1023
+ skipAuth: true,
1024
+ skipAuthRefresh: true
1025
+ }));
1026
+ } catch (error) {
1027
+ if (require_errors.isItdApiError(error) && error.status === 404 && error.code === require_url.ItdErrorCode.NOT_FOUND) {
1028
+ this.#config.logger?.warn("Сервер отключил определение провайдера капчи; используется Cloudflare Turnstile");
1029
+ return {
1030
+ provider: require_url.CaptchaType.Cloudflare,
1031
+ field: require_url.CaptchaField.Cloudflare
1032
+ };
1033
+ }
1034
+ throw error;
1035
+ }
1017
1036
  }
1018
1037
  async #performSignIn(credentials, revision) {
1019
1038
  const captcha = await this.captchaBody();
@@ -1236,6 +1255,21 @@ var AuthResource = class extends require_render.BaseResource {
1236
1255
  ...options
1237
1256
  });
1238
1257
  }
1258
+ /**
1259
+ * Узнаёт активного провайдера капчи вместе с адресом страницы виджета.
1260
+ *
1261
+ * То же, что {@link captchaProvider}, плюс `url` — готовая страница на домене итд.com,
1262
+ * где ключ виджета действителен. Пригодится встроенному браузеру: открыть её и забрать
1263
+ * токен, ничего не собирая самому.
1264
+ */
1265
+ captchaPage(options = {}) {
1266
+ return this.http.execute(AUTH_CAPTCHA_PAGE, {
1267
+ path: AUTH_PATHS.captchaPage,
1268
+ skipAuth: true,
1269
+ skipAuthRefresh: true,
1270
+ ...options
1271
+ });
1272
+ }
1239
1273
  /** Создаёт короткоживущую сессию QR-входа. */
1240
1274
  async startQrLogin(options = {}) {
1241
1275
  const cookies = this.#auth.createCookieFlow(false);
@@ -1314,6 +1348,51 @@ var AuthResource = class extends require_render.BaseResource {
1314
1348
  }
1315
1349
  }
1316
1350
  /**
1351
+ * Отмечает QR-код отсканированным и узнаёт, кого впускают.
1352
+ *
1353
+ * Обратная сторона QR-входа: этот и два соседних метода вызывает устройство, где сессия
1354
+ * уже есть. Показывающая сторона увидит статус `scanned`, но вход ещё не состоится —
1355
+ * его завершают {@link approveQrLogin} или {@link rejectQrLogin}.
1356
+ *
1357
+ * Сервер принимает только сессию, созданную мобильным клиентом. Обычный web access token
1358
+ * отклоняется с кодом `QR_APPROVER_NOT_ALLOWED`, даже если добавить мобильные заголовки
1359
+ * уже после выдачи токена.
1360
+ *
1361
+ * @param input секреты из отсканированного кода — см. {@link QrLoginSecrets}
1362
+ * @returns описание устройства, которое просит вход
1363
+ */
1364
+ scanQrLogin(input, options = {}) {
1365
+ return this.http.execute(AUTH_QR_SCAN, {
1366
+ path: AUTH_PATHS.qrScan,
1367
+ body: input,
1368
+ ...options
1369
+ });
1370
+ }
1371
+ /**
1372
+ * Подтверждает вход по QR-коду: показавшее код устройство получит access token.
1373
+ *
1374
+ * Осмысленно после {@link scanQrLogin} — человек должен увидеть, что подтверждает.
1375
+ * Требует мобильную сессию, как и `scanQrLogin()`.
1376
+ */
1377
+ approveQrLogin(input, options = {}) {
1378
+ return this.voidOperation(AUTH_QR_APPROVE, {
1379
+ path: AUTH_PATHS.qrApprove,
1380
+ body: input,
1381
+ ...options
1382
+ });
1383
+ }
1384
+ /**
1385
+ * Отклоняет вход по QR-коду: показавшее код устройство получит статус `rejected`.
1386
+ * Требует мобильную сессию, как и `scanQrLogin()`.
1387
+ */
1388
+ rejectQrLogin(input, options = {}) {
1389
+ return this.voidOperation(AUTH_QR_REJECT, {
1390
+ path: AUTH_PATHS.qrReject,
1391
+ body: input,
1392
+ ...options
1393
+ });
1394
+ }
1395
+ /**
1317
1396
  * Регистрирует аккаунт и запускает подтверждение по коду.
1318
1397
  *
1319
1398
  * @returns `flowToken`, который нужно передать в {@link verifyOtp}
@@ -2614,6 +2693,7 @@ exports.NotificationUpdateType = require_events.NotificationUpdateType;
2614
2693
  exports.OPERATIONS = require_url.OPERATIONS;
2615
2694
  exports.PaginationMode = require_render.PaginationMode;
2616
2695
  exports.Paginator = require_render.Paginator;
2696
+ exports.QrLocationPrecision = require_url.QrLocationPrecision;
2617
2697
  exports.QrLoginStatus = QrLoginStatus;
2618
2698
  exports.QrLoginStreamStatus = QrLoginStreamStatus;
2619
2699
  exports.RateLimitPacing = require_url.RateLimitPacing;