itd-api 0.10.0 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +175 -59
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.cts +216 -132
  8. package/dist/index.d.ts +216 -132
  9. package/dist/index.js +175 -60
  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-B0Wtn4cF.js → events-0I_Pixnq.js} +2 -2
  16. package/dist/shared/{events-B0Wtn4cF.js.map → events-0I_Pixnq.js.map} +1 -1
  17. package/dist/shared/{events-BB791aPk.cjs → events-8OLqvKwQ.cjs} +2 -2
  18. package/dist/shared/{events-BB791aPk.cjs.map → events-8OLqvKwQ.cjs.map} +1 -1
  19. package/dist/shared/{events-BNGjJVI3.d.cts → events-Cr1Mc2Gl.d.cts} +2 -2
  20. package/dist/shared/{events-CJO6q93Z.d.ts → events-DXooQkyB.d.ts} +2 -2
  21. package/dist/shared/{render-C1A57W-5.d.cts → render-BxPM234w.d.cts} +29 -3
  22. package/dist/shared/{render-BimHjOhw.cjs → render-CnpKoGO8.cjs} +2 -2
  23. package/dist/shared/{render-BimHjOhw.cjs.map → render-CnpKoGO8.cjs.map} +1 -1
  24. package/dist/shared/{render-DC5nvqcP.d.ts → render-D69bOsxu.d.ts} +29 -3
  25. package/dist/shared/{render-CkhvH_yh.js → render-GQw5m1-o.js} +2 -2
  26. package/dist/shared/{render-CkhvH_yh.js.map → render-GQw5m1-o.js.map} +1 -1
  27. package/dist/shared/{url-CDVgMIq5.cjs → url-BnaioEsz.cjs} +44 -6
  28. package/dist/shared/{url-CDVgMIq5.cjs.map → url-BnaioEsz.cjs.map} +1 -1
  29. package/dist/shared/{url-BA5hEwj2.js → url-D0KJ5pws.js} +39 -7
  30. package/dist/shared/{url-BA5hEwj2.js.map → url-D0KJ5pws.js.map} +1 -1
  31. package/dist/shared/{url-DkMueFAT.d.ts → url-Qv7smwHP.d.cts} +40 -7
  32. package/dist/shared/{url-DkMueFAT.d.cts → url-Qv7smwHP.d.ts} +40 -7
  33. package/package.json +1 -1
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
- import { $ as isItdStateError, $t as DEFAULT_RATE_LIMIT_BUCKET, A as ItdErrorKind, At as RequestOptions, B as ItdStateError, Bt as RuntimeMode, C as ItdApiError, Cn as ViewReason, Ct as PaginationOptions, D as ItdConfigError, Dt as RawRequestOptions, E as ItdAuthError, Et as RateLimitOptions, F as ItdNetworkError, Ft as RuntimeOptions, G as isItdConflictError, Gt as ItdOperationDefinition, H as ItdValidationError, Ht as systemClock, I as ItdNotFoundError, It as QueryParams, J as isItdForbiddenError, Jt as isBuiltInOperationId, K as isItdError, Kt as OPERATIONS, L as ItdPhoneVerificationError, Lt as QueryValue, M as ItdFileError, Mt as RetryContext, N as ItdFileErrorReason, Nt as RetryDecisionContext, O as ItdConflictError, Ot as RequestContext, P as ItdForbiddenError, Pt as RetryOptions, Q as isItdServerError, Qt as BUCKET_LIMITS, R as ItdRateLimitError, Rt as ServiceDefinition, S as ItdAbortError, Sn as SpanType, St as OperationRequestOptions, T as ItdApiErrorKind, Tn as WallAccess, Tt as RateLimitBucketOverride, U as isItdApiError, Ut as BuiltInOperationId, V as ItdTimeoutError, Vt as ItdClock, W as isItdAuthError, Wt as CustomOperationId, X as isItdPhoneVerificationError, Xt as operationMethod, Y as isItdNotFoundError, Yt as operationBucket, Z as isItdRateLimitError, Zt as operationRetrySafety, _ as PrivacySettings, _n as Loose, _t as OperationMethod, a as NotificationEvent, an as AccessType, b as SubscriptionState, bn as ReportTargetType, bt as ErrorContextHook, c as NotificationSettings, cn as CaptchaField, ct as Listener, d as AuthUser, dn as EventChannelStatus, dt as STATUS_SERVICE, en as RateLimitBucket, et as isItdValidationError, f as Author, fn as FeedTab, ft as LIBRARY_VERSION, g as PinsResult, gn as LikesVisibility, gt as OperationMetadata, h as Pin, hn as ItdErrorCode, i as formatNotificationText, in as UserRef, j as ItdFieldErrors, jt as ResponseContext, k as ItdError, kt as RequestExtensions, l as Actor, ln as CaptchaType, lt as Unsubscribe, m as MyProfile, mn as InteractionType, mt as OperationAnnotations, n as canonicalNotificationType, nn as Span, nt as AuthIdentity, o as normalizeNotification, on as AttachmentType, p as FollowResult, pn as IncidentKind, pt as FeatureOperationId, q as isItdFileError, qt as OperationId, r as isKnownNotificationType, rn as UserId, rt as AuthProvider, s as Notification, sn as CaptchaChoice, st as Emitter, t as resolveNotificationUrl, tn as IsoDate, tt as ClientConnection, u as AuthState, un as CommentSort, ut as DEFAULT_BASE_URL, v as Profile, vn as NotificationType, vt as RetrySafety, w as ItdApiErrorInit, wn as ViewSource, wt as RateLimitBucketContext, x as UserSummary, xn as ServiceState, xt as Logger, y as PublicProfile, yn as ReportReason, yt as ClientHooks, z as ItdServerError, zt as RateLimitPacing } from "./shared/url-DkMueFAT.cjs";
2
- import { $ as ShopConsentContext, $n as PaginationMode, $t as markup, A as DwellEntry, An as Post, At as report, B as ViewTrackerInput, Bn as CreatePollInput, Bt as PollBuilder, C as fromStream, Cn as CommentReplyTo, Cr as OperationExtensions, Ct as ShopSizeChart, D as UpdateProfileInput, Dn as PinPostResult, Dr as PluginTeardown, Dt as ReportsResource, E as UpdatePrivacyInput, En as LikeResult, Er as PluginApi, Et as SearchResult, F as TelemetryClock, Fn as comment, Ft as CreatePostInput, G as ShopConsentsResource, Gn as Session, Gt as parseMarkdown, H as SubscriptionResource, Hn as CreateReportInput, Ht as poll, I as TelemetryOptions, In as BuilderInput, It as PostBuilder, J as ShopOrdersResource, Jn as NotificationsResource, Jt as MarkupContent, K as ShopDeliveryResource, Kn as Subscription, Kt as AutoSpansOptions, L as TelemetryResource, Ln as ItdBuilder, Lt as PostInput, M as PhotoOpenInput, Mn as PostUpdateResult, Mt as FeedParams, N as TelemetryBatch, Nn as CommentBuilder, Nt as PostsResource, O as UserListParams, On as Poll, Or as CookieJar, Ot as ReportBuilder, P as TelemetryBatchOptions, Pn as CommentInput, Pt as UserPostsParams, Q as ShopConsent, Qn as PageState, Qt as autoSpans, R as VideoProgressInput, Rn as isBuilder, Rt as PostUpdateInput, S as VideoMimeType, Sn as Comment, Sr as ClientPlugin, St as ShopRecipient, T as VerificationResource, Tn as Hashtag, Tr as OperationTransformer, Tt as SearchResource, U as CreateShopOrderOptions, Un as UpdatePostInput, Ut as ParseMarkupOptions, V as ViewTrackerOptions, Vn as CreatePostData, Vt as PollInput, W as PayShopOrderOptions, Wn as PaymentMethod, Wt as parseHtml, X as ShopResource, Xn as BaseResource, Xt as MarkupSpan, Y as ShopProductsResource, Yn as UpdateNotificationSettingsInput, Yt as MarkupInput, Z as CreateShopOrderInput, Zn as Page, Zt as TextMarkup, _ as AllowedMimeType, _n as UploadOptions, _r as HttpClient, _t as ShopProduct, a as ShopFeatureOptions, an as StatusDay, ar as FeatureBucketDefinition, at as ShopDeliveryDestination, b as ImageMimeType, bn as RepliesParams, br as AttemptInterceptor, bt as ShopProductSpec, c as ShopOrderAccessStorage, cn as AnnouncementButton, cr as FeatureOperationDefinition, ct as ShopOrderAccessSession, d as statusDays, dn as Portal, dr as FileResolver, dt as ShopOrderItem, en as PlatformClientVersion, er as Paginator, et as ShopConsentKind, f as isMyProfile, fn as Report, fr as PreparedBufferSource, ft as ShopOrderItemInput, g as AUDIO_MIME_TYPES, gn as FilesResource, gr as ResolveFileOptions, gt as ShopPayment, h as ALLOWED_MIME_TYPES, hn as HashtagsResource, hr as ResolveFileContext, ht as ShopOrderSupport, i as ShopFeatureApi, in as ServiceStatus, ir as ClientFeature, it as ShopDeliveryCountry, j as InteractionEntry, jn as PostStats, jt as CommentsParams, k as UsersResource, kn as PollOption, kt as ReportInput, l as ShopOrderAccessStorageAdapterOptions, ln as ChangelogEntry, lr as FeatureRequestOptions, lt as ShopOrderAccessVerification, m as utcStampToIso, mn as HashtagPostsParams, mr as PreparedStreamSource, mt as ShopOrderSummary, n as SpanRenderFormat, nn as PlatformVersions, nr as mapPage, nt as ShopDeliveryCalculation, o as createShopFeature, on as StatusIncidentLine, or as FeatureContext, ot as ShopDeliveryPoint, p as toDate, pn as VerificationStatus, pr as PreparedFileSource, pt as ShopOrderStatus, q as ShopOrderRequestOptions, qn as NotificationListParams, qt as MarkupBuilder, r as renderSpans, rn as PlatformStatus, rr as RateLimitBucketState, rt as ShopDeliveryCity, s as MemoryShopOrderAccessStorage, sn as Announcement, sr as FeatureInstallation, st as ShopOrder, t as RenderSpansOptions, tn as PlatformResource, tr as PaginatorOptions, tt as ShopCreatedOrder, u as createShopOrderAccessStorage, un as Clan, ur as ManagedClientResource, ut as ShopOrderDelivery, v as AudioMimeType, vn as UploadedFile, vr as AttemptContext, vt as ShopProductCategory, w as fromUrl, wn as CommentUpdateResult, wr as OperationTransformContext, wt as ShopSizeChartRow, x as VIDEO_MIME_TYPES, xn as Attachment, xr as AttemptNext, xt as ShopProductStatus, y as IMAGE_MIME_TYPES, yn as CommentsResource, yr as AttemptExtensions, yt as ShopProductColor, z as ViewTracker, zn as CreateCommentInput, zt as post } from "./shared/render-C1A57W-5.cjs";
3
- 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-BNGjJVI3.cjs";
1
+ import { $ as isItdStateError, $t as DEFAULT_RATE_LIMIT_BUCKET, A as ItdErrorKind, At as RequestOptions, B as ItdStateError, Bt as RuntimeMode, C as ItdApiError, Cn as SpanType, Ct as PaginationOptions, D as ItdConfigError, Dt as RawRequestOptions, E as ItdAuthError, En as WallAccess, Et as RateLimitOptions, F as ItdNetworkError, Ft as RuntimeOptions, G as isItdConflictError, Gt as ItdOperationDefinition, H as ItdValidationError, Ht as systemClock, I as ItdNotFoundError, It as QueryParams, J as isItdForbiddenError, Jt as isBuiltInOperationId, K as isItdError, Kt as OPERATIONS, L as ItdPhoneVerificationError, Lt as QueryValue, M as ItdFileError, Mt as RetryContext, N as ItdFileErrorReason, Nt as RetryDecisionContext, O as ItdConflictError, Ot as RequestContext, P as ItdForbiddenError, Pt as RetryOptions, Q as isItdServerError, Qt as BUCKET_LIMITS, R as ItdRateLimitError, Rt as ServiceDefinition, S as ItdAbortError, Sn as ServiceState, St as OperationRequestOptions, T as ItdApiErrorKind, Tn as ViewSource, Tt as RateLimitBucketOverride, U as isItdApiError, Ut as BuiltInOperationId, V as ItdTimeoutError, Vt as ItdClock, W as isItdAuthError, Wt as CustomOperationId, X as isItdPhoneVerificationError, Xt as operationMethod, Y as isItdNotFoundError, Yt as operationBucket, Z as isItdRateLimitError, Zt as operationRetrySafety, _ as PrivacySettings, _n as Loose, _t as OperationMethod, a as NotificationEvent, an as AccessType, b as SubscriptionState, bn as ReportReason, bt as ErrorContextHook, c as NotificationSettings, cn as CaptchaField, ct as Listener, d as AuthUser, dn as EventChannelStatus, dt as STATUS_SERVICE, en as RateLimitBucket, et as isItdValidationError, f as Author, fn as FeedTab, ft as LIBRARY_VERSION, g as PinsResult, gn as LikesVisibility, gt as OperationMetadata, h as Pin, hn as ItdErrorCode, i as formatNotificationText, in as UserRef, j as ItdFieldErrors, jt as ResponseContext, k as ItdError, kt as RequestExtensions, l as Actor, ln as CaptchaType, lt as Unsubscribe, m as MyProfile, mn as InteractionType, mt as OperationAnnotations, n as canonicalNotificationType, nn as Span, nt as AuthIdentity, o as normalizeNotification, on as AttachmentType, p as FollowResult, pn as IncidentKind, pt as FeatureOperationId, q as isItdFileError, qt as OperationId, r as isKnownNotificationType, rn as UserId, rt as AuthProvider, s as Notification, sn as CaptchaChoice, st as Emitter, t as resolveNotificationUrl, tn as IsoDate, tt as ClientConnection, u as AuthState, un as CommentSort, ut as DEFAULT_BASE_URL, v as Profile, vn as NotificationType, vt as RetrySafety, w as ItdApiErrorInit, wn as ViewReason, wt as RateLimitBucketContext, x as UserSummary, xn as ReportTargetType, xt as Logger, y as PublicProfile, yn as QrLocationPrecision, yt as ClientHooks, z as ItdServerError, zt as RateLimitPacing } from "./shared/url-Qv7smwHP.cjs";
2
+ import { $ as ShopConsentContext, $n as PageState, $t as markup, A as DwellEntry, An as Post, At as report, B as ViewTrackerInput, Bn as CreatePollInput, Bt as PollBuilder, C as fromStream, Cn as CommentReplyTo, Cr as ClientPlugin, Ct as ShopSizeChart, D as UpdateProfileInput, Dn as PinPostResult, Dr as PluginApi, Dt as ReportsResource, E as UpdatePrivacyInput, En as LikeResult, Er as OperationTransformer, Et as SearchResult, F as TelemetryClock, Fn as comment, Ft as CreatePostInput, G as ShopConsentsResource, Gn as QrLoginTarget, Gt as parseMarkdown, H as SubscriptionResource, Hn as CreateReportInput, Ht as poll, I as TelemetryOptions, In as BuilderInput, It as PostBuilder, J as ShopOrdersResource, Jn as NotificationListParams, Jt as MarkupContent, K as ShopDeliveryResource, Kn as Session, Kt as AutoSpansOptions, L as TelemetryResource, Ln as ItdBuilder, Lt as PostInput, M as PhotoOpenInput, Mn as PostUpdateResult, Mt as FeedParams, N as TelemetryBatch, Nn as CommentBuilder, Nt as PostsResource, O as UserListParams, On as Poll, Or as PluginTeardown, Ot as ReportBuilder, P as TelemetryBatchOptions, Pn as CommentInput, Pt as UserPostsParams, Q as ShopConsent, Qn as Page, Qt as autoSpans, R as VideoProgressInput, Rn as isBuilder, Rt as PostUpdateInput, S as VideoMimeType, Sn as Comment, Sr as AttemptNext, St as ShopRecipient, T as VerificationResource, Tn as Hashtag, Tr as OperationTransformContext, Tt as SearchResource, U as CreateShopOrderOptions, Un as UpdatePostInput, Ut as ParseMarkupOptions, V as ViewTrackerOptions, Vn as CreatePostData, Vt as PollInput, W as PayShopOrderOptions, Wn as PaymentMethod, Wt as parseHtml, X as ShopResource, Xn as UpdateNotificationSettingsInput, Xt as MarkupSpan, Y as ShopProductsResource, Yn as NotificationsResource, Yt as MarkupInput, Z as CreateShopOrderInput, Zn as BaseResource, Zt as TextMarkup, _ as AllowedMimeType, _n as UploadOptions, _r as ResolveFileOptions, _t as ShopProduct, a as ShopFeatureOptions, an as StatusDay, ar as ClientFeature, at as ShopDeliveryDestination, b as ImageMimeType, bn as RepliesParams, br as AttemptExtensions, bt as ShopProductSpec, c as ShopOrderAccessStorage, cn as AnnouncementButton, cr as FeatureInstallation, ct as ShopOrderAccessSession, d as statusDays, dn as Portal, dr as ManagedClientResource, dt as ShopOrderItem, en as PlatformClientVersion, er as PaginationMode, et as ShopConsentKind, f as isMyProfile, fn as Report, fr as FileResolver, ft as ShopOrderItemInput, g as AUDIO_MIME_TYPES, gn as FilesResource, gr as ResolveFileContext, gt as ShopPayment, h as ALLOWED_MIME_TYPES, hn as HashtagsResource, hr as PreparedStreamSource, ht as ShopOrderSupport, i as ShopFeatureApi, in as ServiceStatus, ir as RateLimitBucketState, it as ShopDeliveryCountry, j as InteractionEntry, jn as PostStats, jt as CommentsParams, k as UsersResource, kn as PollOption, kr as CookieJar, kt as ReportInput, l as ShopOrderAccessStorageAdapterOptions, ln as ChangelogEntry, lr as FeatureOperationDefinition, lt as ShopOrderAccessVerification, m as utcStampToIso, mn as HashtagPostsParams, mr as PreparedFileSource, mt as ShopOrderSummary, n as SpanRenderFormat, nn as PlatformVersions, nr as PaginatorOptions, nt as ShopDeliveryCalculation, o as createShopFeature, on as StatusIncidentLine, or as FeatureBucketDefinition, ot as ShopDeliveryPoint, p as toDate, pn as VerificationStatus, pr as PreparedBufferSource, pt as ShopOrderStatus, q as ShopOrderRequestOptions, qn as Subscription, qt as MarkupBuilder, r as renderSpans, rn as PlatformStatus, rr as mapPage, rt as ShopDeliveryCity, s as MemoryShopOrderAccessStorage, sn as Announcement, sr as FeatureContext, st as ShopOrder, t as RenderSpansOptions, tn as PlatformResource, tr as Paginator, tt as ShopCreatedOrder, u as createShopOrderAccessStorage, un as Clan, ur as FeatureRequestOptions, ut as ShopOrderDelivery, v as AudioMimeType, vn as UploadedFile, vr as HttpClient, vt as ShopProductCategory, w as fromUrl, wn as CommentUpdateResult, wr as OperationExtensions, wt as ShopSizeChartRow, x as VIDEO_MIME_TYPES, xn as Attachment, xr as AttemptInterceptor, xt as ShopProductStatus, y as IMAGE_MIME_TYPES, yn as CommentsResource, yr as AttemptContext, yt as ShopProductColor, z as ViewTracker, zn as CreateCommentInput, zt as post } from "./shared/render-BxPM234w.cjs";
3
+ 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-Cr1Mc2Gl.cjs";
4
4
  import { a as FileStreamOptions, c as LazyFile, d as UrlFileOptions, i as FileStreamContent, l as StreamFile, n as FileContext, o as FileTransferMode, r as FileInput, s as FromStreamOptions, t as FileContent, u as UrlFile } from "./shared/contracts-BoT7msmq.cjs";
5
5
  import { a as KeyValueStoreResult, c as createKeyValueStore, d as withCodec, f as withNamespace, i as KeyValueStoreKeys, l as createRecordKeyValueStore, n as KeyValueCodec, o as MemoryKeyValueStore, r as KeyValueStore, s as RecordKeyValueStoreSource, t as EnumerableKeyValueStore, u as isEnumerableKeyValueStore } from "./shared/key-value-store-COZaNHZS.cjs";
6
6
  import { a as createTokenStorage, i as TokenStorageAdapterOptions, n as MemoryTokenStorage, r as TokenStorage, t as ItdSession } from "./shared/storage-BQrtKon9.cjs";
@@ -12,49 +12,144 @@ interface NotificationsApi extends NotificationsResource {
12
12
  readonly events: NotificationEvents;
13
13
  }
14
14
  //#endregion
15
+ //#region src/operations/auth.d.ts
16
+ /** Чем закончился запрос входа. */
17
+ declare const SignInStatus: Readonly<{
18
+ readonly Authenticated: "authenticated";
19
+ readonly OtpRequired: "otp_required";
20
+ }>;
21
+ type SignInStatus = (typeof SignInStatus)[keyof typeof SignInStatus];
22
+ /** Результат входа: готовый токен либо продолжение через код подтверждения. */
23
+ type SignInResult = {
24
+ status: 'authenticated';
25
+ accessToken: string;
26
+ } | {
27
+ status: 'otp_required';
28
+ flowToken: string | undefined;
29
+ };
30
+ /**
31
+ * Активный провайдер капчи и поле запроса, в котором сервер ждёт токен.
32
+ *
33
+ * Оба значения открытые: провайдер может появиться новый, а имя поля сервер вправе сменить.
34
+ */
35
+ interface CaptchaProvider {
36
+ provider: CaptchaType;
37
+ field: CaptchaField;
38
+ }
39
+ /**
40
+ * Активный провайдер капчи вместе с адресом готовой страницы виджета.
41
+ *
42
+ * Страница собрана на домене итд.com, поэтому ключ виджета на ней действителен: её открывают
43
+ * во встроенном браузере и забирают токен оттуда.
44
+ */
45
+ interface CaptchaPage extends CaptchaProvider {
46
+ url: string;
47
+ }
48
+ /**
49
+ * Доказательство прохождения капчи: токен и его провайдер.
50
+ *
51
+ * Имя поля тела запроса SDK подставляет сам — из {@link CaptchaToken.field}, иначе
52
+ * из {@link CAPTCHA_FIELDS}.
53
+ */
54
+ interface CaptchaToken {
55
+ type: CaptchaType;
56
+ token: string;
57
+ /** Поле тела запроса. Нужно, только если сервер переименовал его. */
58
+ field?: CaptchaField | undefined;
59
+ }
60
+ /**
61
+ * Поле тела запроса по умолчанию для известных провайдеров.
62
+ *
63
+ * Используется, когда провайдера не спрашивали. Ответ `captchaProvider()` важнее этой таблицы.
64
+ */
65
+ declare const CAPTCHA_FIELDS: Readonly<{
66
+ readonly itd: "token";
67
+ readonly cloudflare: "turnstileToken";
68
+ }>;
69
+ /** Данные, из которых клиент строит QR-код входа. */
70
+ interface QrLoginStart {
71
+ qrId: string;
72
+ claimToken: string;
73
+ payload: string;
74
+ expiresIn: number;
75
+ captchaRequired: boolean;
76
+ }
77
+ /** Состояния, которые может вернуть проверка QR-входа. */
78
+ declare const QrLoginStatus: Readonly<{
79
+ readonly Pending: "pending";
80
+ readonly Scanned: "scanned";
81
+ readonly CaptchaRequired: "captcha_required";
82
+ readonly Authorized: "authorized";
83
+ readonly Rejected: "rejected";
84
+ }>;
85
+ type QrLoginStatus = (typeof QrLoginStatus)[keyof typeof QrLoginStatus];
86
+ /** Результат проверки QR-входа. */
87
+ type QrLoginClaim = {
88
+ status: 'authorized';
89
+ accessToken: string;
90
+ expiresIn?: number;
91
+ } | {
92
+ status: 'pending' | 'scanned' | 'captcha_required' | 'rejected';
93
+ expiresIn?: number;
94
+ };
95
+ /** Состояния, приходящие из потокового наблюдения за QR-входом. */
96
+ declare const QrLoginStreamStatus: Readonly<{
97
+ readonly Pending: "pending";
98
+ readonly Scanned: "scanned";
99
+ readonly Approved: "approved";
100
+ readonly Rejected: "rejected";
101
+ }>;
102
+ type QrLoginStreamStatus = (typeof QrLoginStreamStatus)[keyof typeof QrLoginStreamStatus];
103
+ /** Одно событие `POST /api/v1/auth/qr/stream`. */
104
+ interface QrLoginStreamEvent {
105
+ status: QrLoginStreamStatus;
106
+ expiresIn?: number;
107
+ }
108
+ //#endregion
15
109
  //#region src/session/options.d.ts
16
110
  /**
17
- * Как проходить капчу при входе по логину и паролю.
111
+ * Источник токенов капчи.
18
112
  *
19
113
  * Токен одноразовый и живёт несколько минут, поэтому долгоживущему клиенту нужен не готовый
20
- * токен, а его источник: {@link CaptchaOptions.getToken} спрашивается перед каждым входом.
114
+ * токен, а источник: он спрашивается перед каждым запросом, которому нужна капча.
21
115
  * В Node источником служит `@itd-api/captcha` — `captcha: createCaptchaSolver()`.
22
116
  */
23
- interface CaptchaOptions {
117
+ interface CaptchaSolver {
118
+ /** Получает имя провайдера, чью капчу нужно пройти, и возвращает токен. */
119
+ getToken(type: CaptchaType): string | Promise<string>;
24
120
  /**
25
- * Какую капчу решать. По умолчанию `CaptchaChoice.Auto` — провайдера называет сервер.
121
+ * Какую капчу проходить. По умолчанию `CaptchaChoice.Auto` — провайдера называет сервер.
26
122
  *
27
- * Явно названный провайдер экономит запрос `captcha/provider` перед каждым входом, но
28
- * перестаёт работать, если сервер переключится на другой виджет.
123
+ * Явно названный провайдер экономит запрос `captcha/provider`, но перестаёт работать,
124
+ * если сервер откажется от этого виджета.
29
125
  */
30
126
  type?: CaptchaChoice | undefined;
31
- /** Разовый токен. Для повторного входа после истечения сессии не подойдёт. */
32
- token?: string | undefined;
33
- /**
34
- * Источник свежего токена. Спрашивается перед каждым входом.
35
- *
36
- * Получает имя провайдера, чью капчу нужно решить, и возвращает токен.
37
- */
38
- getToken?: ((type: CaptchaType) => string | Promise<string>) | undefined;
39
127
  /**
40
128
  * Поле тела запроса, в котором сервер ждёт токен.
41
129
  *
42
- * Учитывается только при явно названном {@link CaptchaOptions.type}: при
130
+ * Учитывается только при явно названном {@link CaptchaSolver.type}: при
43
131
  * `CaptchaChoice.Auto` поле называет сам сервер, и его слово точнее. Пригодится,
44
132
  * если сервер переименовал поле, а версия SDK об этом ещё не знает.
45
133
  */
46
134
  field?: CaptchaField | undefined;
47
135
  }
136
+ /** Источник токенов капчи: объект с `getToken` либо сама функция. */
137
+ type CaptchaSolverInput = CaptchaSolver | ((type: CaptchaType) => string | Promise<string>);
48
138
  /**
49
139
  * Вход по логину и паролю.
50
140
  *
51
- * Вход требует токен капчи см. {@link CaptchaOptions}.
141
+ * Капчу, если сервер её потребует, пройдёт {@link SessionOptions.captcha}.
52
142
  */
53
143
  interface CredentialsAuth {
54
144
  email: string;
55
145
  password: string;
56
- /** Как проходить капчу. Без неё вход по паролю не начнётся. */
57
- captcha?: CaptchaOptions | undefined;
146
+ /**
147
+ * Готовый токен капчи на первый вход.
148
+ *
149
+ * Расходуется ровно однажды: повторный вход и восстановление сессии пойдут уже
150
+ * к {@link SessionOptions.captcha}.
151
+ */
152
+ captcha?: CaptchaToken | undefined;
58
153
  }
59
154
  /**
60
155
  * Как клиент получает доступ к API.
@@ -70,7 +165,7 @@ interface CredentialsAuth {
70
165
  * ```ts
71
166
  * new ItdClient({ auth: '<accessToken>' }); // разовый вызов
72
167
  * new ItdClient({ auth: { accessToken, refreshToken } }); // восстановить сессию
73
- * new ItdClient({ auth: { email, password, captcha: createCaptchaSolver() } }); // вход по паролю
168
+ * new ItdClient({ auth: { email, password }, captcha: createCaptchaSolver() }); // вход по паролю
74
169
  * new ItdClient({ auth: { getToken: () => vault.read() } }); // токен из внешнего источника
75
170
  * ```
76
171
  */
@@ -90,6 +185,13 @@ type AuthInput = string | {
90
185
  interface SessionOptions {
91
186
  /** Авторизация. Без неё доступны только публичные эндпоинты. */
92
187
  auth?: AuthInput | undefined;
188
+ /**
189
+ * Откуда брать токен капчи, когда сервер её потребует: при входе по паролю, регистрации,
190
+ * запросе письма для сброса пароля и подтверждении QR-входа.
191
+ *
192
+ * С этой опцией токен можно не передавать в сами методы — клиент получит его сам.
193
+ */
194
+ captcha?: CaptchaSolverInput | undefined;
93
195
  /** Где хранить сессию. По умолчанию {@link MemoryTokenStorage}. */
94
196
  storage?: TokenStorage | undefined;
95
197
  /**
@@ -128,8 +230,9 @@ interface SessionOptions {
128
230
  * @example
129
231
  * ```ts
130
232
  * const itd = new ItdClient({
131
- * auth: { email, password, captcha: createCaptchaSolver() }, // SessionOptions
132
- * rateLimit: { concurrency: 4, rps: 8 }, // RuntimeOptions
233
+ * auth: { email, password }, // SessionOptions
234
+ * captcha: createCaptchaSolver(), // SessionOptions
235
+ * rateLimit: { concurrency: 4, rps: 8 }, // RuntimeOptions
133
236
  * });
134
237
  * ```
135
238
  */
@@ -141,90 +244,10 @@ interface ItdClientOptions extends RuntimeOptions, SessionOptions {
141
244
  } | undefined;
142
245
  }
143
246
  //#endregion
144
- //#region src/operations/auth.d.ts
145
- /** Чем закончился запрос входа. */
146
- declare const SignInStatus: Readonly<{
147
- readonly Authenticated: "authenticated";
148
- readonly OtpRequired: "otp_required";
149
- }>;
150
- type SignInStatus = (typeof SignInStatus)[keyof typeof SignInStatus];
151
- /** Результат входа: готовый токен либо продолжение через код подтверждения. */
152
- type SignInResult = {
153
- status: 'authenticated';
154
- accessToken: string;
155
- } | {
156
- status: 'otp_required';
157
- flowToken: string | undefined;
158
- };
159
- /**
160
- * Активный провайдер капчи и поле запроса, в котором сервер ждёт токен.
161
- *
162
- * Оба значения открытые: провайдер может появиться новый, а имя поля сервер вправе сменить.
163
- */
164
- interface CaptchaProvider {
165
- provider: CaptchaType;
166
- field: CaptchaField;
167
- }
168
- /**
169
- * Доказательство прохождения капчи: токен и его провайдер.
170
- *
171
- * Имя поля тела запроса SDK подставляет сам — из {@link CaptchaToken.field}, иначе
172
- * из {@link CAPTCHA_FIELDS}.
173
- */
174
- interface CaptchaToken {
175
- type: CaptchaType;
176
- token: string;
177
- /** Поле тела запроса. Нужно, только если сервер переименовал его. */
178
- field?: CaptchaField | undefined;
179
- }
180
- /**
181
- * Поле тела запроса по умолчанию для известных провайдеров.
182
- *
183
- * Используется, когда провайдера не спрашивали. Ответ `captchaProvider()` важнее этой таблицы.
184
- */
185
- declare const CAPTCHA_FIELDS: Readonly<{
186
- readonly itd: "token";
187
- readonly cloudflare: "turnstileToken";
188
- }>;
189
- /** Данные, из которых клиент строит QR-код входа. */
190
- interface QrLoginStart {
191
- qrId: string;
192
- claimToken: string;
193
- payload: string;
194
- expiresIn: number;
195
- captchaRequired: boolean;
196
- }
197
- /** Состояния, которые может вернуть проверка QR-входа. */
198
- declare const QrLoginStatus: Readonly<{
199
- readonly Pending: "pending";
200
- readonly Scanned: "scanned";
201
- readonly CaptchaRequired: "captcha_required";
202
- readonly Authorized: "authorized";
203
- readonly Rejected: "rejected";
204
- }>;
205
- type QrLoginStatus = (typeof QrLoginStatus)[keyof typeof QrLoginStatus];
206
- /** Результат проверки QR-входа. */
207
- type QrLoginClaim = {
208
- status: 'authorized';
209
- accessToken: string;
210
- expiresIn?: number;
211
- } | {
212
- status: 'pending' | 'scanned' | 'captcha_required' | 'rejected';
213
- expiresIn?: number;
214
- };
215
- /** Состояния, приходящие из потокового наблюдения за QR-входом. */
216
- declare const QrLoginStreamStatus: Readonly<{
217
- readonly Pending: "pending";
218
- readonly Scanned: "scanned";
219
- readonly Approved: "approved";
220
- readonly Rejected: "rejected";
221
- }>;
222
- type QrLoginStreamStatus = (typeof QrLoginStreamStatus)[keyof typeof QrLoginStreamStatus];
223
- /** Одно событие `POST /api/v1/auth/qr/stream`. */
224
- interface QrLoginStreamEvent {
225
- status: QrLoginStreamStatus;
226
- expiresIn?: number;
227
- }
247
+ //#region src/session/captcha.d.ts
248
+ /** Капча запросов, которые её требуют: входа, регистрации, сброса пароля и QR-подтверждения. */
249
+ /** Готовый фрагмент тела запроса: имя поля и токен в нём. */
250
+ type CaptchaBody = Record<string, string>;
228
251
  //#endregion
229
252
  //#region src/session/auth.d.ts
230
253
  /**
@@ -239,6 +262,7 @@ interface SessionConfig {
239
262
  useCookieJar: boolean;
240
263
  logger: Logger | undefined;
241
264
  auth: AuthInput | undefined;
265
+ captcha: CaptchaSolver | undefined;
242
266
  storage: TokenStorage;
243
267
  deviceId: string | undefined;
244
268
  autoRefresh: boolean;
@@ -400,6 +424,17 @@ declare class AuthManager implements AuthProvider {
400
424
  * новую запись в списке сессий.
401
425
  */
402
426
  clear(): Promise<void>;
427
+ /**
428
+ * Готовит фрагмент тела с токеном капчи для запроса, который её требует.
429
+ *
430
+ * Источники в порядке убывания приоритета: токен, переданный в сам вызов; разовый токен
431
+ * из `auth.captcha`; опция `captcha`. Когда ни одного нет, фрагмент пустой: нужна ли
432
+ * капча этому запросу, решает сервер.
433
+ *
434
+ * @param explicit готовый токен, переданный в вызов
435
+ * @throws {ItdConfigError} если токен неполный или источник его не вернул
436
+ */
437
+ captchaBody(explicit?: CaptchaToken | undefined): Promise<CaptchaBody>;
403
438
  }
404
439
  //#endregion
405
440
  //#region src/resources/auth.d.ts
@@ -409,10 +444,11 @@ interface Credentials {
409
444
  password: string;
410
445
  }
411
446
  /**
412
- * Учётные данные вместе с доказательством капчи.
447
+ * Учётные данные вместе с токеном капчи.
413
448
  *
414
- * Какой виджет сейчас требует сервер, сообщает {@link AuthResource.captchaProvider};
415
- * в Node токен получает `@itd-api/captcha`. Токен одноразовый и живёт несколько минут.
449
+ * Токен нужен, только когда у клиента не задана опция `captcha`: с ней клиент получает его
450
+ * сам. Какой виджет сейчас требует сервер, сообщает {@link AuthResource.captchaProvider};
451
+ * в Node токен добывает `@itd-api/captcha`. Токен одноразовый и живёт несколько минут.
416
452
  *
417
453
  * @example
418
454
  * ```ts
@@ -422,15 +458,15 @@ interface Credentials {
422
458
  * await itd.auth.signIn({ email, password, captcha: { type: provider, token, field } });
423
459
  * ```
424
460
  */
425
- type CaptchaCredentials = Credentials & {
426
- captcha: CaptchaToken;
461
+ type CredentialsWithCaptcha = Credentials & {
462
+ captcha?: CaptchaToken | undefined;
427
463
  };
428
464
  /** Запрос письма для сброса пароля. Капча обязательна, как и при входе. */
429
465
  interface ForgotPasswordInput {
430
466
  email: string;
431
- captcha: CaptchaToken;
467
+ captcha?: CaptchaToken | undefined;
432
468
  }
433
- /** Секреты QR-сессии и необязательная капча для завершения входа. */
469
+ /** Секреты QR-сессии и капча для завершения входа. */
434
470
  interface QrLoginClaimInput {
435
471
  qrId: string;
436
472
  claimToken: string;
@@ -441,6 +477,18 @@ interface QrLoginStreamInput {
441
477
  qrId: string;
442
478
  claimToken: string;
443
479
  }
480
+ /**
481
+ * Секреты QR-кода со стороны сканирующего устройства.
482
+ *
483
+ * Оба значения лежат во fragment {@link QrLoginStart.payload} — ссылки вида
484
+ * `https://итд.com/qr#i=<qrId>&s=<secret>`, которую и кодирует QR-код. `secret` — не то же
485
+ * самое, что `claimToken`: этот секрет предъявляет тот, кто сканирует, а `claimToken` — тот,
486
+ * кто код показывает.
487
+ */
488
+ interface QrLoginSecrets {
489
+ qrId: string;
490
+ secret: string;
491
+ }
444
492
  /** Управление временем жизни потокового запроса. */
445
493
  interface QrLoginStreamOptions {
446
494
  signal?: AbortSignal | undefined;
@@ -489,14 +537,22 @@ declare class AuthResource extends BaseResource {
489
537
  * Автоматическому входу этот вызов не нужен — клиент делает его сам.
490
538
  */
491
539
  captchaProvider(options?: RequestOptions): Promise<CaptchaProvider>;
540
+ /**
541
+ * Узнаёт активного провайдера капчи вместе с адресом страницы виджета.
542
+ *
543
+ * То же, что {@link captchaProvider}, плюс `url` — готовая страница на домене итд.com,
544
+ * где ключ виджета действителен. Пригодится встроенному браузеру: открыть её и забрать
545
+ * токен, ничего не собирая самому.
546
+ */
547
+ captchaPage(options?: RequestOptions): Promise<CaptchaPage>;
492
548
  /** Создаёт короткоживущую сессию QR-входа. */
493
549
  startQrLogin(options?: RequestOptions): Promise<QrLoginStart>;
494
550
  /**
495
551
  * Проверяет QR-сессию и завершает вход после подтверждения на другом устройстве.
496
552
  *
497
- * До подтверждения возвращает промежуточный статус. Если сервер потребовал капчу,
498
- * повторите вызов с `captcha` тип берётся из {@link captchaProvider}.
499
- * Полученный `accessToken` автоматически сохраняется в клиенте.
553
+ * До подтверждения возвращает промежуточный статус. Токен капчи добывается, только когда
554
+ * сервер о ней попросил — статусом `captcha_required` на прошлой проверке, либо когда
555
+ * передан в сам вызов. Полученный `accessToken` автоматически сохраняется в клиенте.
500
556
  */
501
557
  claimQrLogin(input: QrLoginClaimInput, options?: RequestOptions): Promise<QrLoginClaim>;
502
558
  /**
@@ -506,12 +562,39 @@ declare class AuthResource extends BaseResource {
506
562
  * {@link claimQrLogin}, чтобы получить и сохранить access token.
507
563
  */
508
564
  streamQrLogin(input: QrLoginStreamInput, onEvent: QrLoginStreamListener, options?: QrLoginStreamOptions): Promise<void>;
565
+ /**
566
+ * Отмечает QR-код отсканированным и узнаёт, кого впускают.
567
+ *
568
+ * Обратная сторона QR-входа: этот и два соседних метода вызывает устройство, где сессия
569
+ * уже есть. Показывающая сторона увидит статус `scanned`, но вход ещё не состоится —
570
+ * его завершают {@link approveQrLogin} или {@link rejectQrLogin}.
571
+ *
572
+ * Сервер принимает только сессию, созданную мобильным клиентом. Обычный web access token
573
+ * отклоняется с кодом `QR_APPROVER_NOT_ALLOWED`, даже если добавить мобильные заголовки
574
+ * уже после выдачи токена.
575
+ *
576
+ * @param input секреты из отсканированного кода — см. {@link QrLoginSecrets}
577
+ * @returns описание устройства, которое просит вход
578
+ */
579
+ scanQrLogin(input: QrLoginSecrets, options?: RequestOptions): Promise<QrLoginTarget>;
580
+ /**
581
+ * Подтверждает вход по QR-коду: показавшее код устройство получит access token.
582
+ *
583
+ * Осмысленно после {@link scanQrLogin} — человек должен увидеть, что подтверждает.
584
+ * Требует мобильную сессию, как и `scanQrLogin()`.
585
+ */
586
+ approveQrLogin(input: QrLoginSecrets, options?: RequestOptions): Promise<void>;
587
+ /**
588
+ * Отклоняет вход по QR-коду: показавшее код устройство получит статус `rejected`.
589
+ * Требует мобильную сессию, как и `scanQrLogin()`.
590
+ */
591
+ rejectQrLogin(input: QrLoginSecrets, options?: RequestOptions): Promise<void>;
509
592
  /**
510
593
  * Регистрирует аккаунт и запускает подтверждение по коду.
511
594
  *
512
595
  * @returns `flowToken`, который нужно передать в {@link verifyOtp}
513
596
  */
514
- signUp(credentials: CaptchaCredentials, options?: RequestOptions): Promise<string>;
597
+ signUp(credentials: CredentialsWithCaptcha, options?: RequestOptions): Promise<string>;
515
598
  /**
516
599
  * Выполняет вход.
517
600
  *
@@ -520,9 +603,9 @@ declare class AuthResource extends BaseResource {
520
603
  *
521
604
  * При успешном входе токен сохраняется в клиенте автоматически.
522
605
  *
523
- * @param credentials email, пароль и обязательный токен капчи — см. {@link CaptchaCredentials}
606
+ * @param credentials email, пароль и токен капчи — см. {@link CredentialsWithCaptcha}
524
607
  */
525
- signIn(credentials: CaptchaCredentials, options?: RequestOptions): Promise<SignInResult>;
608
+ signIn(credentials: CredentialsWithCaptcha, options?: RequestOptions): Promise<SignInResult>;
526
609
  /**
527
610
  * Подтверждает вход кодом из письма.
528
611
  *
@@ -555,7 +638,7 @@ declare class AuthResource extends BaseResource {
555
638
  * });
556
639
  * ```
557
640
  */
558
- signInWithOtp(input: CaptchaCredentials & {
641
+ signInWithOtp(input: CredentialsWithCaptcha & {
559
642
  getOtp: () => string | Promise<string>;
560
643
  }, options?: RequestOptions): Promise<string>;
561
644
  /**
@@ -671,8 +754,9 @@ declare class AuthResource extends BaseResource {
671
754
  * const itd = new ItdClient({
672
755
  * // `auth` не обязателен: когда хранилище уже содержит сессию, токен берётся оттуда,
673
756
  * // а истёкший продлевается сам. Здесь он нужен на первый запуск.
674
- * // Вход по паролю требует токена капчи — см. CaptchaOptions.
675
- * auth: { email, password, captcha: createCaptchaSolver() },
757
+ * auth: { email, password },
758
+ * // Капчу входа решает пакет @itd-api/captcha см. CaptchaSolver.
759
+ * captcha: createCaptchaSolver(),
676
760
  * storage: new FileTokenStorage('./.itd-session.json'),
677
761
  * rateLimit: { concurrency: 4, rps: 8 },
678
762
  * });
@@ -937,7 +1021,9 @@ interface AccountFeature<TApi = unknown> {
937
1021
  * Опции конструктора {@link ItdAccounts}.
938
1022
  *
939
1023
  * Всё, что понимает `ItdClient`, кроме `auth` и `deviceId`: они у каждого аккаунта свои
940
- * и задаются в {@link ItdAccounts.addAccount}. Обычный `TokenStorage` клиента здесь заменён
1024
+ * и задаются в {@link ItdAccounts.addAccount}. Остальное достаётся каждому клиенту
1025
+ * источник токена капчи, заданный здесь, работает для всех аккаунтов. Обычный `TokenStorage`
1026
+ * клиента здесь заменён
941
1027
  * общей опцией {@link ItdAccountsOptions.storage} типа {@link MultiTokenStorage}; контейнер
942
1028
  * сам выдаёт каждому клиенту изолированный срез по имени. Общий `deviceId` особенно вреден —
943
1029
  * сервер различает по нему записи в списке сессий, и один на всех сложил бы все аккаунты
@@ -1020,6 +1106,8 @@ interface AccountEvents {
1020
1106
  *
1021
1107
  * await using accounts = new ItdAccounts({
1022
1108
  * storage: new FileMultiTokenStorage('./.itd-sessions.json'),
1109
+ * // Общие опции достаются каждому аккаунту: один источник токена капчи на всех.
1110
+ * captcha: createCaptchaSolver(),
1023
1111
  * rateLimit: { concurrency: 4 },
1024
1112
  * });
1025
1113
  *
@@ -1027,9 +1115,7 @@ interface AccountEvents {
1027
1115
  * await accounts.restore();
1028
1116
  *
1029
1117
  * if (!accounts.has('kiow')) {
1030
- * accounts.addAccount('kiow', {
1031
- * auth: { email, password, captcha: createCaptchaSolver() },
1032
- * });
1118
+ * accounts.addAccount('kiow', { auth: { email, password } });
1033
1119
  * }
1034
1120
  *
1035
1121
  * await accounts.account('kiow').posts.create({ content: 'привет' });
@@ -1063,9 +1149,7 @@ declare class ItdAccounts {
1063
1149
  *
1064
1150
  * @example
1065
1151
  * ```ts
1066
- * accounts.addAccount('bot', {
1067
- * auth: { email, password, captcha: createCaptchaSolver() },
1068
- * });
1152
+ * accounts.addAccount('bot', { auth: { email, password } });
1069
1153
  * accounts.addAccount('reader', { auth: '<accessToken>' });
1070
1154
  * accounts.addAccount('через-прокси', { fetch: proxyFetch('socks5://…') });
1071
1155
  * ```
@@ -1186,5 +1270,5 @@ declare class ItdAccounts {
1186
1270
  */
1187
1271
  declare function createAccounts(options?: ItdAccountsOptions): ItdAccounts;
1188
1272
  //#endregion
1189
- export { ALLOWED_MIME_TYPES, AUDIO_MIME_TYPES, AccessType, type AccountEvents, type AccountFeature, type Actor, type AddAccountOptions, type AllowedMimeType, type Announcement, type AnnouncementButton, type Attachment, AttachmentType, type AttemptContext, type AttemptExtensions, type AttemptInterceptor, type AttemptNext, type AudioMimeType, type AuthEvents, type AuthIdentity, type AuthInput, type AuthProvider, type AuthResource, type AuthState, type AuthUser, type Author, type AutoSpansOptions, BUCKET_LIMITS, type BuilderInput, type BuiltInOperationId, CAPTCHA_FIELDS, CaptchaChoice, type CaptchaCredentials, CaptchaField, type CaptchaOptions, type CaptchaProvider, type CaptchaToken, CaptchaType, type ChangelogEntry, type Clan, type ClientConnection, type ClientFeature, type ClientHooks, type ClientPlugin, type Comment, type CommentBuilder, type CommentInput, type CommentReplyTo, CommentSort, type CommentUpdateResult, type CommentsParams, type CommentsResource, type CreateCommentInput, type CreatePollInput, type CreatePostData, type CreatePostInput, type CreateReportInput, type CreateShopOrderInput, type CreateShopOrderOptions, type Credentials, type CredentialsAuth, type CustomOperationId, DEFAULT_BASE_URL, DEFAULT_RATE_LIMIT_BUCKET, type DwellEntry, type EnumerableKeyValueStore, type ErrorContextHook, 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, type FeatureBucketDefinition, type FeatureContext, type FeatureInstallation, type FeatureOperationDefinition, type FeatureOperationId, type FeatureRequestOptions, type FeedParams, FeedTab, type FileContent, type FileContext, type FileInput, type FileResolver, type FileStreamContent, type FileStreamOptions, FileTransferMode, type FilesResource, type FollowResult, type ForgotPasswordInput, type FromStreamOptions, type Hashtag, type HashtagPostsParams, type HashtagsResource, IMAGE_MIME_TYPES, type ImageMimeType, IncidentKind, type InteractionEntry, InteractionType, type IsoDate, ItdAbortError, ItdAccounts, type ItdAccountsOptions, ItdApiError, type ItdApiErrorInit, ItdApiErrorKind, ItdAuthError, type ItdBuilder, ItdClient, type ItdClientOptions, type ItdClock, ItdConfigError, ItdConflictError, ItdError, ItdErrorCode, ItdErrorKind, type ItdFieldErrors, ItdFileError, ItdFileErrorReason, ItdForbiddenError, ItdNetworkError, ItdNotFoundError, ItdPhoneVerificationError, ItdRateLimitError, ItdServerError, type ItdSession, ItdStateError, ItdTimeoutError, ItdValidationError, type KeyValueCodec, type KeyValueStore, type KeyValueStoreKeys, type KeyValueStoreResult, LIBRARY_VERSION, type LazyFile, type LikeResult, LikesVisibility, type Listener, type Logger, type Loose, type ManagedClientResource, type MarkupBuilder, type MarkupContent, type MarkupInput, type MarkupSpan, MemoryKeyValueStore, MemoryMultiTokenStorage, MemoryShopOrderAccessStorage, MemoryTokenStorage, type MultiTokenStorage, type MultiTokenStorageAdapterOptions, type MyProfile, 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 NotificationListParams, type NotificationOfType, type NotificationSettings, NotificationType, type NotificationUpdate, type NotificationUpdateOfType, NotificationUpdateOrigin, NotificationUpdateType, type NotificationsApi, type NotificationsResource, OPERATIONS, type OperationAnnotations, type ItdOperationDefinition as OperationDefinition, type OperationExtensions, type OperationId, type OperationMetadata, type OperationMethod, type OperationRequestOptions, type OperationTransformContext, type OperationTransformer, type Page, type PageState, PaginationMode, type PaginationOptions, Paginator, type PaginatorOptions, type ParseMarkupOptions, type PayShopOrderOptions, type PaymentMethod, type PhotoOpenInput, type Pin, type PinPostResult, type PinsResult, type PlatformClientVersion, type PlatformResource, type PlatformStatus, type PlatformVersions, type PluginApi, type PluginTeardown, type Poll, type PollBuilder, type PollInput, type PollOption, type Portal, type Post, type PostBuilder, type PostInput, type PostStats, type PostUpdateInput, type PostUpdateResult, type PostsResource, type PreparedBufferSource, type PreparedFileSource, type PreparedStreamSource, type PrivacySettings, type Profile, type PublicProfile, type QrLoginClaim, type QrLoginClaimInput, type QrLoginStart, QrLoginStatus, type QrLoginStreamEvent, type QrLoginStreamInput, type QrLoginStreamListener, type QrLoginStreamOptions, QrLoginStreamStatus, type QueryParams, type QueryValue, type RateLimitBucket, type RateLimitBucketContext, type RateLimitBucketOverride, type RateLimitBucketState, type RateLimitOptions, RateLimitPacing, type RateLimitScope, type RawRequestOptions, type ReconnectOptions, type RecordKeyValueStoreSource, type RemoveAccountOptions, type RenderSpansOptions, type RepliesParams, type Report, type ReportBuilder, type ReportInput, ReportReason, ReportTargetType, type ReportsResource, type RequestContext, type RequestExtensions, type RequestOptions, type ResetPasswordInput, type ResolveFileContext, type ResolveFileOptions, type ResponseContext, type RetryContext, type RetryDecisionContext, type RetryOptions, RetrySafety, RuntimeMode, type RuntimeOptions, STATUS_SERVICE, type SearchResource, type SearchResult, type ServiceDefinition, ServiceState, type ServiceStatus, type Session, type SessionOptions, type ShopConsent, type ShopConsentContext, ShopConsentKind, type ShopConsentsResource, type ShopCreatedOrder, type ShopDeliveryCalculation, type ShopDeliveryCity, type ShopDeliveryCountry, type ShopDeliveryDestination, type ShopDeliveryPoint, type ShopDeliveryResource, type ShopFeatureApi, type ShopFeatureOptions, type ShopOrder, type ShopOrderAccessSession, type ShopOrderAccessStorage, type ShopOrderAccessStorageAdapterOptions, type ShopOrderAccessVerification, type ShopOrderDelivery, type ShopOrderItem, type ShopOrderItemInput, type ShopOrderRequestOptions, ShopOrderStatus, type ShopOrderSummary, type ShopOrderSupport, type ShopOrdersResource, type ShopPayment, type ShopProduct, ShopProductCategory, type ShopProductColor, type ShopProductSpec, ShopProductStatus, type ShopProductsResource, type ShopRecipient, type ShopResource, type ShopSizeChart, type ShopSizeChartRow, type SignInResult, SignInStatus, type Span, SpanRenderFormat, SpanType, type StatusDay, type StatusIncidentLine, type StreamFile, type Subscription, type SubscriptionResource, type SubscriptionState, TURNSTILE_SITE_KEY, type TelemetryBatch, type TelemetryBatchOptions, type TelemetryClock, type TelemetryOptions, type TelemetryResource, type TextMarkup, type TokenStorage, type TokenStorageAdapterOptions, UnauthorizedStreamError, type UnknownNotificationUpdate, type UnreadCountUpdate, type Unsubscribe, type UpdateNotificationSettingsInput, type UpdatePostInput, type UpdatePrivacyInput, type UpdateProfileInput, type UploadOptions, type UploadedFile, type UrlFile, type UrlFileOptions, type UserId, type UserListParams, type UserPostsParams, type UserRef, type UserSummary, type UsersResource, VIDEO_MIME_TYPES, type VerificationResource, type VerificationStatus, type VideoMimeType, type VideoProgressInput, ViewReason, ViewSource, type ViewTracker, type ViewTrackerInput, type ViewTrackerOptions, WallAccess, type WebSocketImplementationOptions, type WebSocketLike, type WebSocketOpenFailureClassifier, WebSocketTransport, type WebSocketTransportOptions, autoSpans, canonicalNotificationType, comment, createAccounts, createClient, createKeyValueStore, createMultiTokenStorage, createNotificationEventsClient, createRecordKeyValueStore, createShopFeature, createShopOrderAccessStorage, createTokenStorage, formatNotificationText, fromStream, fromUrl, isBuilder, isBuiltInOperationId, isEnumerableKeyValueStore, isItdApiError, isItdAuthError, isItdConflictError, isItdError, isItdFileError, isItdForbiddenError, isItdNotFoundError, isItdPhoneVerificationError, isItdRateLimitError, isItdServerError, isItdStateError, isItdValidationError, isKnownNotificationType, isMyProfile, mapPage, markup, normalizeNotification, operationBucket, operationMethod, operationRetrySafety, parseHtml, parseMarkdown, poll, post, renderSpans, report, resolveNotificationUrl, runEventMiddleware, scopedTokenStorage, statusDays, systemClock, toDate, utcStampToIso, withCodec, withNamespace };
1273
+ export { ALLOWED_MIME_TYPES, AUDIO_MIME_TYPES, AccessType, type AccountEvents, type AccountFeature, type Actor, type AddAccountOptions, type AllowedMimeType, type Announcement, type AnnouncementButton, type Attachment, AttachmentType, type AttemptContext, type AttemptExtensions, type AttemptInterceptor, type AttemptNext, type AudioMimeType, type AuthEvents, type AuthIdentity, type AuthInput, type AuthProvider, type AuthResource, type AuthState, type AuthUser, type Author, type AutoSpansOptions, BUCKET_LIMITS, type BuilderInput, type BuiltInOperationId, CAPTCHA_FIELDS, CaptchaChoice, CaptchaField, type CaptchaPage, type CaptchaProvider, type CaptchaSolver, type CaptchaSolverInput, type CaptchaToken, CaptchaType, type ChangelogEntry, type Clan, type ClientConnection, type ClientFeature, type ClientHooks, type ClientPlugin, type Comment, type CommentBuilder, type CommentInput, type CommentReplyTo, CommentSort, type CommentUpdateResult, type CommentsParams, type CommentsResource, type CreateCommentInput, type CreatePollInput, type CreatePostData, type CreatePostInput, type CreateReportInput, type CreateShopOrderInput, type CreateShopOrderOptions, type Credentials, type CredentialsAuth, type CredentialsWithCaptcha, type CustomOperationId, DEFAULT_BASE_URL, DEFAULT_RATE_LIMIT_BUCKET, type DwellEntry, type EnumerableKeyValueStore, type ErrorContextHook, 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, type FeatureBucketDefinition, type FeatureContext, type FeatureInstallation, type FeatureOperationDefinition, type FeatureOperationId, type FeatureRequestOptions, type FeedParams, FeedTab, type FileContent, type FileContext, type FileInput, type FileResolver, type FileStreamContent, type FileStreamOptions, FileTransferMode, type FilesResource, type FollowResult, type ForgotPasswordInput, type FromStreamOptions, type Hashtag, type HashtagPostsParams, type HashtagsResource, IMAGE_MIME_TYPES, type ImageMimeType, IncidentKind, type InteractionEntry, InteractionType, type IsoDate, ItdAbortError, ItdAccounts, type ItdAccountsOptions, ItdApiError, type ItdApiErrorInit, ItdApiErrorKind, ItdAuthError, type ItdBuilder, ItdClient, type ItdClientOptions, type ItdClock, ItdConfigError, ItdConflictError, ItdError, ItdErrorCode, ItdErrorKind, type ItdFieldErrors, ItdFileError, ItdFileErrorReason, ItdForbiddenError, ItdNetworkError, ItdNotFoundError, ItdPhoneVerificationError, ItdRateLimitError, ItdServerError, type ItdSession, ItdStateError, ItdTimeoutError, ItdValidationError, type KeyValueCodec, type KeyValueStore, type KeyValueStoreKeys, type KeyValueStoreResult, LIBRARY_VERSION, type LazyFile, type LikeResult, LikesVisibility, type Listener, type Logger, type Loose, type ManagedClientResource, type MarkupBuilder, type MarkupContent, type MarkupInput, type MarkupSpan, MemoryKeyValueStore, MemoryMultiTokenStorage, MemoryShopOrderAccessStorage, MemoryTokenStorage, type MultiTokenStorage, type MultiTokenStorageAdapterOptions, type MyProfile, 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 NotificationListParams, type NotificationOfType, type NotificationSettings, NotificationType, type NotificationUpdate, type NotificationUpdateOfType, NotificationUpdateOrigin, NotificationUpdateType, type NotificationsApi, type NotificationsResource, OPERATIONS, type OperationAnnotations, type ItdOperationDefinition as OperationDefinition, type OperationExtensions, type OperationId, type OperationMetadata, type OperationMethod, type OperationRequestOptions, type OperationTransformContext, type OperationTransformer, type Page, type PageState, PaginationMode, type PaginationOptions, Paginator, type PaginatorOptions, type ParseMarkupOptions, type PayShopOrderOptions, type PaymentMethod, type PhotoOpenInput, type Pin, type PinPostResult, type PinsResult, type PlatformClientVersion, type PlatformResource, type PlatformStatus, type PlatformVersions, type PluginApi, type PluginTeardown, type Poll, type PollBuilder, type PollInput, type PollOption, type Portal, type Post, type PostBuilder, type PostInput, type PostStats, type PostUpdateInput, type PostUpdateResult, type PostsResource, type PreparedBufferSource, type PreparedFileSource, type PreparedStreamSource, type PrivacySettings, type Profile, type PublicProfile, QrLocationPrecision, type QrLoginClaim, type QrLoginClaimInput, type QrLoginSecrets, type QrLoginStart, QrLoginStatus, type QrLoginStreamEvent, type QrLoginStreamInput, type QrLoginStreamListener, type QrLoginStreamOptions, QrLoginStreamStatus, type QrLoginTarget, type QueryParams, type QueryValue, type RateLimitBucket, type RateLimitBucketContext, type RateLimitBucketOverride, type RateLimitBucketState, type RateLimitOptions, RateLimitPacing, type RateLimitScope, type RawRequestOptions, type ReconnectOptions, type RecordKeyValueStoreSource, type RemoveAccountOptions, type RenderSpansOptions, type RepliesParams, type Report, type ReportBuilder, type ReportInput, ReportReason, ReportTargetType, type ReportsResource, type RequestContext, type RequestExtensions, type RequestOptions, type ResetPasswordInput, type ResolveFileContext, type ResolveFileOptions, type ResponseContext, type RetryContext, type RetryDecisionContext, type RetryOptions, RetrySafety, RuntimeMode, type RuntimeOptions, STATUS_SERVICE, type SearchResource, type SearchResult, type ServiceDefinition, ServiceState, type ServiceStatus, type Session, type SessionOptions, type ShopConsent, type ShopConsentContext, ShopConsentKind, type ShopConsentsResource, type ShopCreatedOrder, type ShopDeliveryCalculation, type ShopDeliveryCity, type ShopDeliveryCountry, type ShopDeliveryDestination, type ShopDeliveryPoint, type ShopDeliveryResource, type ShopFeatureApi, type ShopFeatureOptions, type ShopOrder, type ShopOrderAccessSession, type ShopOrderAccessStorage, type ShopOrderAccessStorageAdapterOptions, type ShopOrderAccessVerification, type ShopOrderDelivery, type ShopOrderItem, type ShopOrderItemInput, type ShopOrderRequestOptions, ShopOrderStatus, type ShopOrderSummary, type ShopOrderSupport, type ShopOrdersResource, type ShopPayment, type ShopProduct, ShopProductCategory, type ShopProductColor, type ShopProductSpec, ShopProductStatus, type ShopProductsResource, type ShopRecipient, type ShopResource, type ShopSizeChart, type ShopSizeChartRow, type SignInResult, SignInStatus, type Span, SpanRenderFormat, SpanType, type StatusDay, type StatusIncidentLine, type StreamFile, type Subscription, type SubscriptionResource, type SubscriptionState, TURNSTILE_SITE_KEY, type TelemetryBatch, type TelemetryBatchOptions, type TelemetryClock, type TelemetryOptions, type TelemetryResource, type TextMarkup, type TokenStorage, type TokenStorageAdapterOptions, UnauthorizedStreamError, type UnknownNotificationUpdate, type UnreadCountUpdate, type Unsubscribe, type UpdateNotificationSettingsInput, type UpdatePostInput, type UpdatePrivacyInput, type UpdateProfileInput, type UploadOptions, type UploadedFile, type UrlFile, type UrlFileOptions, type UserId, type UserListParams, type UserPostsParams, type UserRef, type UserSummary, type UsersResource, VIDEO_MIME_TYPES, type VerificationResource, type VerificationStatus, type VideoMimeType, type VideoProgressInput, ViewReason, ViewSource, type ViewTracker, type ViewTrackerInput, type ViewTrackerOptions, WallAccess, type WebSocketImplementationOptions, type WebSocketLike, type WebSocketOpenFailureClassifier, WebSocketTransport, type WebSocketTransportOptions, autoSpans, canonicalNotificationType, comment, createAccounts, createClient, createKeyValueStore, createMultiTokenStorage, createNotificationEventsClient, createRecordKeyValueStore, createShopFeature, createShopOrderAccessStorage, createTokenStorage, formatNotificationText, fromStream, fromUrl, isBuilder, isBuiltInOperationId, isEnumerableKeyValueStore, isItdApiError, isItdAuthError, isItdConflictError, isItdError, isItdFileError, isItdForbiddenError, isItdNotFoundError, isItdPhoneVerificationError, isItdRateLimitError, isItdServerError, isItdStateError, isItdValidationError, isKnownNotificationType, isMyProfile, mapPage, markup, normalizeNotification, operationBucket, operationMethod, operationRetrySafety, parseHtml, parseMarkdown, poll, post, renderSpans, report, resolveNotificationUrl, runEventMiddleware, scopedTokenStorage, statusDays, systemClock, toDate, utcStampToIso, withCodec, withNamespace };
1190
1274
  //# sourceMappingURL=index.d.cts.map