itd-api 0.11.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/events/index.cjs +3 -3
- package/dist/events/index.d.cts +2 -2
- package/dist/events/index.d.ts +2 -2
- package/dist/events/index.js +3 -3
- package/dist/index.cjs +28 -48
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -19
- package/dist/index.d.ts +23 -19
- package/dist/index.js +26 -49
- package/dist/index.js.map +1 -1
- package/dist/node/index.cjs +2 -2
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +7 -8
- package/dist/node/index.d.ts +7 -8
- package/dist/node/index.js +2 -2
- package/dist/node/index.js.map +1 -1
- package/dist/rest/index.cjs +7 -4
- package/dist/rest/index.cjs.map +1 -1
- package/dist/rest/index.d.cts +5 -5
- package/dist/rest/index.d.ts +5 -5
- package/dist/rest/index.js +5 -5
- package/dist/rest/index.js.map +1 -1
- package/dist/shared/{events-CAb9G7Sf.d.ts → events-9215JDDd.d.ts} +2 -2
- package/dist/shared/{events-C6tmj8aW.cjs → events-BKyxZQNw.cjs} +246 -56
- package/dist/shared/events-BKyxZQNw.cjs.map +1 -0
- package/dist/shared/{events-Sc75x6rT.d.cts → events-FaXfdle0.d.cts} +2 -2
- package/dist/shared/{events-MWNcnfrq.js → events-_iYo8EP5.js} +246 -56
- package/dist/shared/events-_iYo8EP5.js.map +1 -0
- package/dist/shared/key-value-store-DYSPsqwq.cjs.map +1 -1
- package/dist/shared/key-value-store-w1Dn5Pjb.js.map +1 -1
- package/dist/shared/{multi-storage-C7-Gz6Z7.cjs → multi-storage-7Y3KCseI.cjs} +2 -2
- package/dist/shared/multi-storage-7Y3KCseI.cjs.map +1 -0
- package/dist/shared/{multi-storage-BLBrGN9Q.js → multi-storage-DiBSx64p.js} +2 -2
- package/dist/shared/multi-storage-DiBSx64p.js.map +1 -0
- package/dist/shared/{options-5tywTYId.cjs → options-D5ttspWk.cjs} +2 -2
- package/dist/shared/{options-5tywTYId.cjs.map → options-D5ttspWk.cjs.map} +1 -1
- package/dist/shared/{options-BerKicCs.js → options-DLlaETn_.js} +2 -2
- package/dist/shared/{options-BerKicCs.js.map → options-DLlaETn_.js.map} +1 -1
- package/dist/shared/{redact-DoC7lSsp.cjs → redact-BbhtA9o-.cjs} +13 -3
- package/dist/shared/redact-BbhtA9o-.cjs.map +1 -0
- package/dist/shared/{redact-C5oxIvcc.js → redact-DSfdmeY7.js} +13 -3
- package/dist/shared/redact-DSfdmeY7.js.map +1 -0
- package/dist/shared/{render-Dnc84B4M.cjs → render-BQvC5UxF.cjs} +134 -49
- package/dist/shared/render-BQvC5UxF.cjs.map +1 -0
- package/dist/shared/{render-CBroJPcV.d.ts → render-BS09ygcy.d.ts} +84 -70
- package/dist/shared/{render-DRh5_aRe.js → render-CFoF2WaH.js} +134 -49
- package/dist/shared/render-CFoF2WaH.js.map +1 -0
- package/dist/shared/{render-DM7AhTZW.d.cts → render-X2JCo1JS.d.cts} +84 -70
- package/dist/shared/storage-86wiHeXD.js.map +1 -1
- package/dist/shared/storage-CIjejZDt.cjs.map +1 -1
- package/dist/shared/{url-Bg61sk_Y.js → url-CdT4lMxQ.js} +25 -12
- package/dist/shared/url-CdT4lMxQ.js.map +1 -0
- package/dist/shared/{url-BOi-_mJT.d.ts → url-_R0oJ7gE.d.cts} +102 -53
- package/dist/shared/{url-BOi-_mJT.d.cts → url-_R0oJ7gE.d.ts} +102 -53
- package/dist/shared/{url-DTgkCWv5.cjs → url-ioIaywDi.cjs} +42 -11
- package/dist/shared/url-ioIaywDi.cjs.map +1 -0
- package/dist/web/index.cjs.map +1 -1
- package/dist/web/index.d.cts +4 -5
- package/dist/web/index.d.ts +4 -5
- package/dist/web/index.js.map +1 -1
- package/package.json +11 -11
- package/dist/shared/events-C6tmj8aW.cjs.map +0 -1
- package/dist/shared/events-MWNcnfrq.js.map +0 -1
- package/dist/shared/multi-storage-BLBrGN9Q.js.map +0 -1
- package/dist/shared/multi-storage-C7-Gz6Z7.cjs.map +0 -1
- package/dist/shared/redact-C5oxIvcc.js.map +0 -1
- package/dist/shared/redact-DoC7lSsp.cjs.map +0 -1
- package/dist/shared/render-DRh5_aRe.js.map +0 -1
- package/dist/shared/render-Dnc84B4M.cjs.map +0 -1
- package/dist/shared/url-Bg61sk_Y.js.map +0 -1
- package/dist/shared/url-DTgkCWv5.cjs.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { $ as ShopConsentContext, $n as
|
|
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-
|
|
1
|
+
import { $ as isItdNotFoundError, $t as isBuiltInOperationId, A as ItdConfigError, An as SpanType, At as RawRequestOptions, B as ItdPhoneVerificationError, Bt as QueryValue, C as UserSummary, Cn as Loose, Ct as ClientHooks, D as ItdApiErrorInit, Dn as ReportReason, Dt as RateLimitBucketContext, E as ItdApiError, En as QrLocationPrecision, Et as PaginationOptions, F as ItdFileError, Ft as RetryContext, G as ItdValidationError, Gt as Logger, H as ItdServerError, Ht as RateLimitPacing, I as ItdFileErrorReason, It as RetryDecisionContext, J as isItdAuthError, Jt as BuiltInOperationId, K as TimeoutBudget, Kt as ItdClock, L as ItdForbiddenError, Lt as RetryOptions, M as ItdError, Mn as ViewReason, Mt as RequestExtensions, N as ItdErrorKind, Nn as ViewSource, Nt as RequestOptions, O as ItdApiErrorKind, On as ReportTargetType, Ot as RateLimitBucketOverride, P as ItdFieldErrors, Pn as WallAccess, Pt as ResponseContext, Q as isItdForbiddenError, Qt as OperationId, R as ItdNetworkError, Rt as RuntimeOptions, S as UserBase, Sn as LikesVisibility, St as RetrySafety, T as ItdAbortError, Tn as NotificationType, Tt as OperationRequestOptions, U as ItdStateError, Ut as RuntimeMode, V as ItdRateLimitError, Vt as ServiceDefinition, W as ItdTimeoutError, Wt as LogLevel, X as isItdError, Xt as ItdOperationDefinition, Y as isItdConflictError, Yt as CustomOperationId, Z as isItdFileError, Zt as OPERATIONS, _ as PinsResult, _n as FeedTab, _t as FeatureOperationId, a as NotificationEvent, an as RateLimitBucket, at as Emitter, b as PublicProfile, bn as ItdErrorCode, bt as OperationMetadata, c as NotificationSettings, cn as UserId, ct as ClientConnection, d as AuthUser, dn as AttachmentType, en as operationBucket, et as isItdPhoneVerificationError, f as Author, fn as CaptchaChoice, g as Pin, gn as EventChannelStatus, gt as LIBRARY_VERSION, h as MyProfile, hn as CommentSort, ht as STATUS_SERVICE, i as formatNotificationText, in as DEFAULT_RATE_LIMIT_BUCKET, it as isItdValidationError, j as ItdConflictError, jn as UsernameUnavailableReason, jt as RequestContext, k as ItdAuthError, kn as ServiceState, kt as RateLimitOptions, l as Actor, ln as UserRef, lt as AuthIdentity, m as LastSeen, mn as CaptchaType, mt as DEFAULT_BASE_URL, n as canonicalNotificationType, nn as operationRetrySafety, nt as isItdServerError, o as normalizeNotification, on as IsoDate, ot as Listener, p as FollowResult, pn as CaptchaField, q as isItdApiError, qt as systemClock, r as isKnownNotificationType, rn as BUCKET_LIMITS, rt as isItdStateError, s as Notification, sn as Span, st as Unsubscribe, t as resolveNotificationUrl, tn as operationMethod, tt as isItdRateLimitError, u as AuthState, un as AccessType, ut as AuthProvider, v as PrivacySettings, vn as IncidentKind, vt as OperationAnnotations, w as UsernameAvailability, wn as MessageAccess, wt as ErrorContextHook, x as SubscriptionState, xn as LastSeenUnit, xt as OperationMethod, y as Profile, yn as InteractionType, z as ItdNotFoundError, zt as QueryParams } from "./shared/url-_R0oJ7gE.cjs";
|
|
2
|
+
import { $ as ShopConsentContext, $n as NotificationListParams, $t as autoSpans, A as DwellEntry, An as Poll, Ar as PreparedStreamSource, At as ReportInput, B as ViewTrackerInput, Bn as comment, Bt as post, C as fromStream, Cn as Comment, Cr as FeatureInstallation, Ct as ShopRecipient, D as UpdateProfileInput, Dn as LikeResult, Dr as FileResolver, Dt as SearchResult, E as UpdatePrivacyInput, En as Hashtag, Er as ManagedClientResource, Et as SearchResource, F as TelemetryClock, Fn as PostStats, Ft as UserPostsParams, G as ShopConsentsResource, Gn as CreatePollInput, Gt as parseHtml, H as SubscriptionResource, Hn as ItdBuilder, Ht as PollInput, I as TelemetryOptions, In as PostUpdateResult, It as CreatePostInput, J as ShopOrdersResource, Jn as UpdatePostInput, Jt as MarkupBuilder, K as ShopDeliveryResource, Kn as CreatePostData, Kt as parseMarkdown, L as TelemetryResource, Ln as UpdateResultBase, Lt as PostBuilder, M as PhotoOpenInput, Mn as Post, Mr as ResolveFileOptions, Mt as CommentsParams, N as TelemetryBatch, Nn as PostBase, Nr as HttpClient, Nt as FeedParams, O as UserListParams, On as OriginalPost, Or as PreparedBufferSource, Ot as ReportsResource, P as TelemetryBatchOptions, Pn as PostCounters, Pr as CookieJar, Pt as PostsResource, Q as ShopConsent, Qn as Subscription, Qt as TextMarkup, R as VideoProgressInput, Rn as CommentBuilder, Rt as PostInput, S as VideoMimeType, Sn as Attachment, Sr as FeatureContext, St as ShopProductStatus, T as VerificationResource, Tn as CommentUpdateResult, Tr as FeatureRequestOptions, Tt as ShopSizeChartRow, U as CreateShopOrderOptions, Un as isBuilder, Ut as poll, V as ViewTrackerOptions, Vn as BuilderInput, Vt as PollBuilder, W as PayShopOrderOptions, Wn as CreateCommentInput, Wt as ParseMarkupOptions, X as ShopResource, Xn as QrLoginTarget, Xt as MarkupInput, Y as ShopProductsResource, Yn as PaymentMethod, Yt as MarkupContent, Z as CreateShopOrderInput, Zn as Session, Zt as MarkupSpan, _ as AllowedMimeType, _n as FilesResource, _r as OperationTransformer, _t as ShopPayment, a as ShopFeatureOptions, an as ServiceStatus, ar as PaginationMode, at as ShopDeliveryDestination, b as ImageMimeType, bn as CommentsResource, br as ClientFeature, bt as ShopProductColor, c as ShopOrderAccessStorage, cn as Announcement, cr as mapPage, ct as ShopOrderAccessSession, d as statusDays, dn as Clan, dr as AttemptExtensions, dt as ShopOrderDelivery, en as markup, er as NotificationsResource, et as ShopConsentKind, f as isMyProfile, fn as Portal, fr as AttemptInterceptor, ft as ShopOrderItem, g as AUDIO_MIME_TYPES, gn as HashtagsResource, gr as OperationTransformContext, gt as ShopOrderSupport, h as ALLOWED_MIME_TYPES, hn as HashtagPostsParams, hr as OperationExtensions, ht as ShopOrderSummary, i as ShopFeatureApi, in as PlatformStatus, ir as PageState, it as ShopDeliveryCountry, j as InteractionEntry, jn as PollOption, jr as ResolveFileContext, jt as report, k as UsersResource, kn as PinPostResult, kr as PreparedFileSource, kt as ReportBuilder, l as ShopOrderAccessStorageAdapterOptions, ln as AnnouncementButton, lr as RateLimitBucketState, lt as ShopOrderAccessVerification, m as utcStampToIso, mn as VerificationStatus, mr as ClientPlugin, mt as ShopOrderStatus, n as SpanRenderFormat, nn as PlatformResource, nr as BaseResource, nt as ShopDeliveryCalculation, o as createShopFeature, on as StatusDay, or as Paginator, ot as ShopDeliveryPoint, p as toDate, pn as Report, pr as AttemptNext, pt as ShopOrderItemInput, q as ShopOrderRequestOptions, qn as CreateReportInput, qt as AutoSpansOptions, r as renderSpans, rn as PlatformVersions, rr as Page, rt as ShopDeliveryCity, s as MemoryShopOrderAccessStorage, sn as StatusIncidentLine, sr as PaginatorOptions, st as ShopOrder, t as RenderSpansOptions, tn as PlatformClientVersion, tr as UpdateNotificationSettingsInput, tt as ShopCreatedOrder, u as createShopOrderAccessStorage, un as ChangelogEntry, ur as AttemptContext, ut as ShopOrderBase, v as AudioMimeType, vn as UploadOptions, vr as PluginApi, vt as ShopProduct, w as fromUrl, wn as CommentReplyTo, wr as FeatureOperationDefinition, wt as ShopSizeChart, x as VIDEO_MIME_TYPES, xn as RepliesParams, xr as FeatureBucketDefinition, xt as ShopProductSpec, y as IMAGE_MIME_TYPES, yn as UploadedFile, yr as PluginTeardown, yt as ShopProductCategory, z as ViewTracker, zn as CommentInput, zt as PostUpdateInput } from "./shared/render-X2JCo1JS.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-FaXfdle0.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";
|
|
@@ -14,11 +14,11 @@ interface NotificationsApi extends NotificationsResource {
|
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/operations/auth.d.ts
|
|
16
16
|
/** Чем закончился запрос входа. */
|
|
17
|
-
declare const SignInStatus: Readonly<{
|
|
17
|
+
export declare const SignInStatus: Readonly<{
|
|
18
18
|
readonly Authenticated: "authenticated";
|
|
19
19
|
readonly OtpRequired: "otp_required";
|
|
20
20
|
}>;
|
|
21
|
-
type SignInStatus = (typeof SignInStatus)[keyof typeof SignInStatus];
|
|
21
|
+
export type SignInStatus = (typeof SignInStatus)[keyof typeof SignInStatus];
|
|
22
22
|
/** Результат входа: готовый токен либо продолжение через код подтверждения. */
|
|
23
23
|
type SignInResult = {
|
|
24
24
|
status: 'authenticated';
|
|
@@ -62,7 +62,7 @@ interface CaptchaToken {
|
|
|
62
62
|
*
|
|
63
63
|
* Используется, когда провайдера не спрашивали. Ответ `captchaProvider()` важнее этой таблицы.
|
|
64
64
|
*/
|
|
65
|
-
declare const CAPTCHA_FIELDS: Readonly<{
|
|
65
|
+
export declare const CAPTCHA_FIELDS: Readonly<{
|
|
66
66
|
readonly itd: "token";
|
|
67
67
|
readonly cloudflare: "turnstileToken";
|
|
68
68
|
}>;
|
|
@@ -75,14 +75,14 @@ interface QrLoginStart {
|
|
|
75
75
|
captchaRequired: boolean;
|
|
76
76
|
}
|
|
77
77
|
/** Состояния, которые может вернуть проверка QR-входа. */
|
|
78
|
-
declare const QrLoginStatus: Readonly<{
|
|
78
|
+
export declare const QrLoginStatus: Readonly<{
|
|
79
79
|
readonly Pending: "pending";
|
|
80
80
|
readonly Scanned: "scanned";
|
|
81
81
|
readonly CaptchaRequired: "captcha_required";
|
|
82
82
|
readonly Authorized: "authorized";
|
|
83
83
|
readonly Rejected: "rejected";
|
|
84
84
|
}>;
|
|
85
|
-
type QrLoginStatus = (typeof QrLoginStatus)[keyof typeof QrLoginStatus];
|
|
85
|
+
export type QrLoginStatus = (typeof QrLoginStatus)[keyof typeof QrLoginStatus];
|
|
86
86
|
/** Результат проверки QR-входа. */
|
|
87
87
|
type QrLoginClaim = {
|
|
88
88
|
status: 'authorized';
|
|
@@ -93,13 +93,13 @@ type QrLoginClaim = {
|
|
|
93
93
|
expiresIn?: number;
|
|
94
94
|
};
|
|
95
95
|
/** Состояния, приходящие из потокового наблюдения за QR-входом. */
|
|
96
|
-
declare const QrLoginStreamStatus: Readonly<{
|
|
96
|
+
export declare const QrLoginStreamStatus: Readonly<{
|
|
97
97
|
readonly Pending: "pending";
|
|
98
98
|
readonly Scanned: "scanned";
|
|
99
99
|
readonly Approved: "approved";
|
|
100
100
|
readonly Rejected: "rejected";
|
|
101
101
|
}>;
|
|
102
|
-
type QrLoginStreamStatus = (typeof QrLoginStreamStatus)[keyof typeof QrLoginStreamStatus];
|
|
102
|
+
export type QrLoginStreamStatus = (typeof QrLoginStreamStatus)[keyof typeof QrLoginStreamStatus];
|
|
103
103
|
/** Одно событие `POST /api/v1/auth/qr/stream`. */
|
|
104
104
|
interface QrLoginStreamEvent {
|
|
105
105
|
status: QrLoginStreamStatus;
|
|
@@ -293,7 +293,7 @@ interface SessionConfig {
|
|
|
293
293
|
* });
|
|
294
294
|
* ```
|
|
295
295
|
*/
|
|
296
|
-
declare const TURNSTILE_SITE_KEY = "0x4AAAAAACHhxczw6fJGwPBg";
|
|
296
|
+
export declare const TURNSTILE_SITE_KEY = "0x4AAAAAACHhxczw6fJGwPBg";
|
|
297
297
|
/** События слоя авторизации. */
|
|
298
298
|
interface AuthEvents {
|
|
299
299
|
/** Токен получен или обновлён. */
|
|
@@ -540,14 +540,18 @@ declare class AuthResource extends BaseResource {
|
|
|
540
540
|
*
|
|
541
541
|
* Сервер может переключить провайдера или переименовать поле без выпуска новой версии SDK.
|
|
542
542
|
* Автоматическому входу этот вызов не нужен — клиент делает его сам.
|
|
543
|
+
*
|
|
544
|
+
* @deprecated Сервер отвечает `404`; метод возвращает Cloudflare Turnstile.
|
|
543
545
|
*/
|
|
544
|
-
captchaProvider(
|
|
546
|
+
captchaProvider(_options?: RequestOptions): Promise<CaptchaProvider>;
|
|
545
547
|
/**
|
|
546
548
|
* Узнаёт активного провайдера капчи вместе с адресом страницы виджета.
|
|
547
549
|
*
|
|
548
550
|
* То же, что {@link captchaProvider}, плюс `url` — готовая страница на домене итд.com,
|
|
549
551
|
* где ключ виджета действителен. Пригодится встроенному браузеру: открыть её и забрать
|
|
550
552
|
* токен, ничего не собирая самому.
|
|
553
|
+
*
|
|
554
|
+
* @deprecated Сервер отвечает `404`; метод возвращает Cloudflare Turnstile на домене итд.com.
|
|
551
555
|
*/
|
|
552
556
|
captchaPage(options?: RequestOptions): Promise<CaptchaPage>;
|
|
553
557
|
/** Создаёт короткоживущую сессию QR-входа. */
|
|
@@ -771,7 +775,7 @@ declare class AuthResource extends BaseResource {
|
|
|
771
775
|
* }
|
|
772
776
|
* ```
|
|
773
777
|
*/
|
|
774
|
-
declare class ItdClient {
|
|
778
|
+
export declare class ItdClient {
|
|
775
779
|
#private;
|
|
776
780
|
/** Авторизация, сессии и пароли. */
|
|
777
781
|
get auth(): AuthResource;
|
|
@@ -1007,17 +1011,17 @@ declare class ItdClient {
|
|
|
1007
1011
|
* const itd = createClient({ auth: token });
|
|
1008
1012
|
* ```
|
|
1009
1013
|
*/
|
|
1010
|
-
declare function createClient(options?: ItdClientOptions): ItdClient;
|
|
1014
|
+
export declare function createClient(options?: ItdClientOptions): ItdClient;
|
|
1011
1015
|
//#endregion
|
|
1012
1016
|
//#region src/accounts.d.ts
|
|
1013
1017
|
/** Как аккаунты делят между собой очередь запросов. */
|
|
1014
|
-
declare const RateLimitScope: Readonly<{
|
|
1018
|
+
export declare const RateLimitScope: Readonly<{
|
|
1015
1019
|
/** У каждого аккаунта своя очередь. */
|
|
1016
1020
|
readonly Account: "account";
|
|
1017
1021
|
/** Одна очередь на всех — умолчание. */
|
|
1018
1022
|
readonly Shared: "shared";
|
|
1019
1023
|
}>;
|
|
1020
|
-
type RateLimitScope = (typeof RateLimitScope)[keyof typeof RateLimitScope];
|
|
1024
|
+
export type RateLimitScope = (typeof RateLimitScope)[keyof typeof RateLimitScope];
|
|
1021
1025
|
/**
|
|
1022
1026
|
* Фабрика подключаемого модуля для клиентов {@link ItdAccounts}.
|
|
1023
1027
|
*
|
|
@@ -1136,7 +1140,7 @@ interface AccountEvents {
|
|
|
1136
1140
|
* }
|
|
1137
1141
|
* ```
|
|
1138
1142
|
*/
|
|
1139
|
-
declare class ItdAccounts {
|
|
1143
|
+
export declare class ItdAccounts {
|
|
1140
1144
|
#private;
|
|
1141
1145
|
constructor(options?: ItdAccountsOptions);
|
|
1142
1146
|
/** Общее хранилище сессий — то же, что передано опцией `storage`. */
|
|
@@ -1279,7 +1283,7 @@ declare class ItdAccounts {
|
|
|
1279
1283
|
*
|
|
1280
1284
|
* То же, что `new ItdAccounts(options)`, — для тех, кому привычнее фабрика.
|
|
1281
1285
|
*/
|
|
1282
|
-
declare function createAccounts(options?: ItdAccountsOptions): ItdAccounts;
|
|
1286
|
+
export declare function createAccounts(options?: ItdAccountsOptions): ItdAccounts;
|
|
1283
1287
|
//#endregion
|
|
1284
|
-
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,
|
|
1288
|
+
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, CaptchaChoice, CaptchaField, type CaptchaPage, type CaptchaProvider, type CaptchaSolveContext, 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, type ItdAccountsOptions, ItdApiError, type ItdApiErrorInit, ItdApiErrorKind, ItdAuthError, type ItdBuilder, 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 LastSeen, LastSeenUnit, type LazyFile, type LikeResult, LikesVisibility, type Listener, LogLevel, type Logger, type Loose, type ManagedClientResource, type MarkupBuilder, type MarkupContent, type MarkupInput, type MarkupSpan, MemoryKeyValueStore, MemoryMultiTokenStorage, MemoryShopOrderAccessStorage, MemoryTokenStorage, MessageAccess, 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, OperationMethod, type OperationRequestOptions, type OperationTransformContext, type OperationTransformer, type OriginalPost, 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 PostBase, type PostBuilder, type PostCounters, 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, type QrLoginStreamEvent, type QrLoginStreamInput, type QrLoginStreamListener, type QrLoginStreamOptions, type QrLoginTarget, type QueryParams, type QueryValue, type RateLimitBucket, type RateLimitBucketContext, type RateLimitBucketOverride, type RateLimitBucketState, type RateLimitOptions, RateLimitPacing, 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 ShopOrderBase, 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, type Span, SpanRenderFormat, SpanType, type StatusDay, type StatusIncidentLine, type StreamFile, type Subscription, type SubscriptionResource, type SubscriptionState, type TelemetryBatch, type TelemetryBatchOptions, type TelemetryClock, type TelemetryOptions, type TelemetryResource, type TextMarkup, TimeoutBudget, type TokenStorage, type TokenStorageAdapterOptions, UnauthorizedStreamError, type UnknownNotificationUpdate, type UnreadCountUpdate, type Unsubscribe, type UpdateNotificationSettingsInput, type UpdatePostInput, type UpdatePrivacyInput, type UpdateProfileInput, type UpdateResultBase, type UploadOptions, type UploadedFile, type UrlFile, type UrlFileOptions, type UserBase, type UserId, type UserListParams, type UserPostsParams, type UserRef, type UserSummary, type UsernameAvailability, UsernameUnavailableReason, 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, 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 };
|
|
1285
1289
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { $ as ShopConsentContext, $n as
|
|
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-
|
|
1
|
+
import { $ as isItdNotFoundError, $t as isBuiltInOperationId, A as ItdConfigError, An as SpanType, At as RawRequestOptions, B as ItdPhoneVerificationError, Bt as QueryValue, C as UserSummary, Cn as Loose, Ct as ClientHooks, D as ItdApiErrorInit, Dn as ReportReason, Dt as RateLimitBucketContext, E as ItdApiError, En as QrLocationPrecision, Et as PaginationOptions, F as ItdFileError, Ft as RetryContext, G as ItdValidationError, Gt as Logger, H as ItdServerError, Ht as RateLimitPacing, I as ItdFileErrorReason, It as RetryDecisionContext, J as isItdAuthError, Jt as BuiltInOperationId, K as TimeoutBudget, Kt as ItdClock, L as ItdForbiddenError, Lt as RetryOptions, M as ItdError, Mn as ViewReason, Mt as RequestExtensions, N as ItdErrorKind, Nn as ViewSource, Nt as RequestOptions, O as ItdApiErrorKind, On as ReportTargetType, Ot as RateLimitBucketOverride, P as ItdFieldErrors, Pn as WallAccess, Pt as ResponseContext, Q as isItdForbiddenError, Qt as OperationId, R as ItdNetworkError, Rt as RuntimeOptions, S as UserBase, Sn as LikesVisibility, St as RetrySafety, T as ItdAbortError, Tn as NotificationType, Tt as OperationRequestOptions, U as ItdStateError, Ut as RuntimeMode, V as ItdRateLimitError, Vt as ServiceDefinition, W as ItdTimeoutError, Wt as LogLevel, X as isItdError, Xt as ItdOperationDefinition, Y as isItdConflictError, Yt as CustomOperationId, Z as isItdFileError, Zt as OPERATIONS, _ as PinsResult, _n as FeedTab, _t as FeatureOperationId, a as NotificationEvent, an as RateLimitBucket, at as Emitter, b as PublicProfile, bn as ItdErrorCode, bt as OperationMetadata, c as NotificationSettings, cn as UserId, ct as ClientConnection, d as AuthUser, dn as AttachmentType, en as operationBucket, et as isItdPhoneVerificationError, f as Author, fn as CaptchaChoice, g as Pin, gn as EventChannelStatus, gt as LIBRARY_VERSION, h as MyProfile, hn as CommentSort, ht as STATUS_SERVICE, i as formatNotificationText, in as DEFAULT_RATE_LIMIT_BUCKET, it as isItdValidationError, j as ItdConflictError, jn as UsernameUnavailableReason, jt as RequestContext, k as ItdAuthError, kn as ServiceState, kt as RateLimitOptions, l as Actor, ln as UserRef, lt as AuthIdentity, m as LastSeen, mn as CaptchaType, mt as DEFAULT_BASE_URL, n as canonicalNotificationType, nn as operationRetrySafety, nt as isItdServerError, o as normalizeNotification, on as IsoDate, ot as Listener, p as FollowResult, pn as CaptchaField, q as isItdApiError, qt as systemClock, r as isKnownNotificationType, rn as BUCKET_LIMITS, rt as isItdStateError, s as Notification, sn as Span, st as Unsubscribe, t as resolveNotificationUrl, tn as operationMethod, tt as isItdRateLimitError, u as AuthState, un as AccessType, ut as AuthProvider, v as PrivacySettings, vn as IncidentKind, vt as OperationAnnotations, w as UsernameAvailability, wn as MessageAccess, wt as ErrorContextHook, x as SubscriptionState, xn as LastSeenUnit, xt as OperationMethod, y as Profile, yn as InteractionType, z as ItdNotFoundError, zt as QueryParams } from "./shared/url-_R0oJ7gE.js";
|
|
2
|
+
import { $ as ShopConsentContext, $n as NotificationListParams, $t as autoSpans, A as DwellEntry, An as Poll, Ar as PreparedStreamSource, At as ReportInput, B as ViewTrackerInput, Bn as comment, Bt as post, C as fromStream, Cn as Comment, Cr as FeatureInstallation, Ct as ShopRecipient, D as UpdateProfileInput, Dn as LikeResult, Dr as FileResolver, Dt as SearchResult, E as UpdatePrivacyInput, En as Hashtag, Er as ManagedClientResource, Et as SearchResource, F as TelemetryClock, Fn as PostStats, Ft as UserPostsParams, G as ShopConsentsResource, Gn as CreatePollInput, Gt as parseHtml, H as SubscriptionResource, Hn as ItdBuilder, Ht as PollInput, I as TelemetryOptions, In as PostUpdateResult, It as CreatePostInput, J as ShopOrdersResource, Jn as UpdatePostInput, Jt as MarkupBuilder, K as ShopDeliveryResource, Kn as CreatePostData, Kt as parseMarkdown, L as TelemetryResource, Ln as UpdateResultBase, Lt as PostBuilder, M as PhotoOpenInput, Mn as Post, Mr as ResolveFileOptions, Mt as CommentsParams, N as TelemetryBatch, Nn as PostBase, Nr as HttpClient, Nt as FeedParams, O as UserListParams, On as OriginalPost, Or as PreparedBufferSource, Ot as ReportsResource, P as TelemetryBatchOptions, Pn as PostCounters, Pr as CookieJar, Pt as PostsResource, Q as ShopConsent, Qn as Subscription, Qt as TextMarkup, R as VideoProgressInput, Rn as CommentBuilder, Rt as PostInput, S as VideoMimeType, Sn as Attachment, Sr as FeatureContext, St as ShopProductStatus, T as VerificationResource, Tn as CommentUpdateResult, Tr as FeatureRequestOptions, Tt as ShopSizeChartRow, U as CreateShopOrderOptions, Un as isBuilder, Ut as poll, V as ViewTrackerOptions, Vn as BuilderInput, Vt as PollBuilder, W as PayShopOrderOptions, Wn as CreateCommentInput, Wt as ParseMarkupOptions, X as ShopResource, Xn as QrLoginTarget, Xt as MarkupInput, Y as ShopProductsResource, Yn as PaymentMethod, Yt as MarkupContent, Z as CreateShopOrderInput, Zn as Session, Zt as MarkupSpan, _ as AllowedMimeType, _n as FilesResource, _r as OperationTransformer, _t as ShopPayment, a as ShopFeatureOptions, an as ServiceStatus, ar as PaginationMode, at as ShopDeliveryDestination, b as ImageMimeType, bn as CommentsResource, br as ClientFeature, bt as ShopProductColor, c as ShopOrderAccessStorage, cn as Announcement, cr as mapPage, ct as ShopOrderAccessSession, d as statusDays, dn as Clan, dr as AttemptExtensions, dt as ShopOrderDelivery, en as markup, er as NotificationsResource, et as ShopConsentKind, f as isMyProfile, fn as Portal, fr as AttemptInterceptor, ft as ShopOrderItem, g as AUDIO_MIME_TYPES, gn as HashtagsResource, gr as OperationTransformContext, gt as ShopOrderSupport, h as ALLOWED_MIME_TYPES, hn as HashtagPostsParams, hr as OperationExtensions, ht as ShopOrderSummary, i as ShopFeatureApi, in as PlatformStatus, ir as PageState, it as ShopDeliveryCountry, j as InteractionEntry, jn as PollOption, jr as ResolveFileContext, jt as report, k as UsersResource, kn as PinPostResult, kr as PreparedFileSource, kt as ReportBuilder, l as ShopOrderAccessStorageAdapterOptions, ln as AnnouncementButton, lr as RateLimitBucketState, lt as ShopOrderAccessVerification, m as utcStampToIso, mn as VerificationStatus, mr as ClientPlugin, mt as ShopOrderStatus, n as SpanRenderFormat, nn as PlatformResource, nr as BaseResource, nt as ShopDeliveryCalculation, o as createShopFeature, on as StatusDay, or as Paginator, ot as ShopDeliveryPoint, p as toDate, pn as Report, pr as AttemptNext, pt as ShopOrderItemInput, q as ShopOrderRequestOptions, qn as CreateReportInput, qt as AutoSpansOptions, r as renderSpans, rn as PlatformVersions, rr as Page, rt as ShopDeliveryCity, s as MemoryShopOrderAccessStorage, sn as StatusIncidentLine, sr as PaginatorOptions, st as ShopOrder, t as RenderSpansOptions, tn as PlatformClientVersion, tr as UpdateNotificationSettingsInput, tt as ShopCreatedOrder, u as createShopOrderAccessStorage, un as ChangelogEntry, ur as AttemptContext, ut as ShopOrderBase, v as AudioMimeType, vn as UploadOptions, vr as PluginApi, vt as ShopProduct, w as fromUrl, wn as CommentReplyTo, wr as FeatureOperationDefinition, wt as ShopSizeChart, x as VIDEO_MIME_TYPES, xn as RepliesParams, xr as FeatureBucketDefinition, xt as ShopProductSpec, y as IMAGE_MIME_TYPES, yn as UploadedFile, yr as PluginTeardown, yt as ShopProductCategory, z as ViewTracker, zn as CommentInput, zt as PostUpdateInput } from "./shared/render-BS09ygcy.js";
|
|
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-9215JDDd.js";
|
|
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.js";
|
|
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.js";
|
|
6
6
|
import { a as createTokenStorage, i as TokenStorageAdapterOptions, n as MemoryTokenStorage, r as TokenStorage, t as ItdSession } from "./shared/storage-CTRGT5wF.js";
|
|
@@ -14,11 +14,11 @@ interface NotificationsApi extends NotificationsResource {
|
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/operations/auth.d.ts
|
|
16
16
|
/** Чем закончился запрос входа. */
|
|
17
|
-
declare const SignInStatus: Readonly<{
|
|
17
|
+
export declare const SignInStatus: Readonly<{
|
|
18
18
|
readonly Authenticated: "authenticated";
|
|
19
19
|
readonly OtpRequired: "otp_required";
|
|
20
20
|
}>;
|
|
21
|
-
type SignInStatus = (typeof SignInStatus)[keyof typeof SignInStatus];
|
|
21
|
+
export type SignInStatus = (typeof SignInStatus)[keyof typeof SignInStatus];
|
|
22
22
|
/** Результат входа: готовый токен либо продолжение через код подтверждения. */
|
|
23
23
|
type SignInResult = {
|
|
24
24
|
status: 'authenticated';
|
|
@@ -62,7 +62,7 @@ interface CaptchaToken {
|
|
|
62
62
|
*
|
|
63
63
|
* Используется, когда провайдера не спрашивали. Ответ `captchaProvider()` важнее этой таблицы.
|
|
64
64
|
*/
|
|
65
|
-
declare const CAPTCHA_FIELDS: Readonly<{
|
|
65
|
+
export declare const CAPTCHA_FIELDS: Readonly<{
|
|
66
66
|
readonly itd: "token";
|
|
67
67
|
readonly cloudflare: "turnstileToken";
|
|
68
68
|
}>;
|
|
@@ -75,14 +75,14 @@ interface QrLoginStart {
|
|
|
75
75
|
captchaRequired: boolean;
|
|
76
76
|
}
|
|
77
77
|
/** Состояния, которые может вернуть проверка QR-входа. */
|
|
78
|
-
declare const QrLoginStatus: Readonly<{
|
|
78
|
+
export declare const QrLoginStatus: Readonly<{
|
|
79
79
|
readonly Pending: "pending";
|
|
80
80
|
readonly Scanned: "scanned";
|
|
81
81
|
readonly CaptchaRequired: "captcha_required";
|
|
82
82
|
readonly Authorized: "authorized";
|
|
83
83
|
readonly Rejected: "rejected";
|
|
84
84
|
}>;
|
|
85
|
-
type QrLoginStatus = (typeof QrLoginStatus)[keyof typeof QrLoginStatus];
|
|
85
|
+
export type QrLoginStatus = (typeof QrLoginStatus)[keyof typeof QrLoginStatus];
|
|
86
86
|
/** Результат проверки QR-входа. */
|
|
87
87
|
type QrLoginClaim = {
|
|
88
88
|
status: 'authorized';
|
|
@@ -93,13 +93,13 @@ type QrLoginClaim = {
|
|
|
93
93
|
expiresIn?: number;
|
|
94
94
|
};
|
|
95
95
|
/** Состояния, приходящие из потокового наблюдения за QR-входом. */
|
|
96
|
-
declare const QrLoginStreamStatus: Readonly<{
|
|
96
|
+
export declare const QrLoginStreamStatus: Readonly<{
|
|
97
97
|
readonly Pending: "pending";
|
|
98
98
|
readonly Scanned: "scanned";
|
|
99
99
|
readonly Approved: "approved";
|
|
100
100
|
readonly Rejected: "rejected";
|
|
101
101
|
}>;
|
|
102
|
-
type QrLoginStreamStatus = (typeof QrLoginStreamStatus)[keyof typeof QrLoginStreamStatus];
|
|
102
|
+
export type QrLoginStreamStatus = (typeof QrLoginStreamStatus)[keyof typeof QrLoginStreamStatus];
|
|
103
103
|
/** Одно событие `POST /api/v1/auth/qr/stream`. */
|
|
104
104
|
interface QrLoginStreamEvent {
|
|
105
105
|
status: QrLoginStreamStatus;
|
|
@@ -293,7 +293,7 @@ interface SessionConfig {
|
|
|
293
293
|
* });
|
|
294
294
|
* ```
|
|
295
295
|
*/
|
|
296
|
-
declare const TURNSTILE_SITE_KEY = "0x4AAAAAACHhxczw6fJGwPBg";
|
|
296
|
+
export declare const TURNSTILE_SITE_KEY = "0x4AAAAAACHhxczw6fJGwPBg";
|
|
297
297
|
/** События слоя авторизации. */
|
|
298
298
|
interface AuthEvents {
|
|
299
299
|
/** Токен получен или обновлён. */
|
|
@@ -540,14 +540,18 @@ declare class AuthResource extends BaseResource {
|
|
|
540
540
|
*
|
|
541
541
|
* Сервер может переключить провайдера или переименовать поле без выпуска новой версии SDK.
|
|
542
542
|
* Автоматическому входу этот вызов не нужен — клиент делает его сам.
|
|
543
|
+
*
|
|
544
|
+
* @deprecated Сервер отвечает `404`; метод возвращает Cloudflare Turnstile.
|
|
543
545
|
*/
|
|
544
|
-
captchaProvider(
|
|
546
|
+
captchaProvider(_options?: RequestOptions): Promise<CaptchaProvider>;
|
|
545
547
|
/**
|
|
546
548
|
* Узнаёт активного провайдера капчи вместе с адресом страницы виджета.
|
|
547
549
|
*
|
|
548
550
|
* То же, что {@link captchaProvider}, плюс `url` — готовая страница на домене итд.com,
|
|
549
551
|
* где ключ виджета действителен. Пригодится встроенному браузеру: открыть её и забрать
|
|
550
552
|
* токен, ничего не собирая самому.
|
|
553
|
+
*
|
|
554
|
+
* @deprecated Сервер отвечает `404`; метод возвращает Cloudflare Turnstile на домене итд.com.
|
|
551
555
|
*/
|
|
552
556
|
captchaPage(options?: RequestOptions): Promise<CaptchaPage>;
|
|
553
557
|
/** Создаёт короткоживущую сессию QR-входа. */
|
|
@@ -771,7 +775,7 @@ declare class AuthResource extends BaseResource {
|
|
|
771
775
|
* }
|
|
772
776
|
* ```
|
|
773
777
|
*/
|
|
774
|
-
declare class ItdClient {
|
|
778
|
+
export declare class ItdClient {
|
|
775
779
|
#private;
|
|
776
780
|
/** Авторизация, сессии и пароли. */
|
|
777
781
|
get auth(): AuthResource;
|
|
@@ -1007,17 +1011,17 @@ declare class ItdClient {
|
|
|
1007
1011
|
* const itd = createClient({ auth: token });
|
|
1008
1012
|
* ```
|
|
1009
1013
|
*/
|
|
1010
|
-
declare function createClient(options?: ItdClientOptions): ItdClient;
|
|
1014
|
+
export declare function createClient(options?: ItdClientOptions): ItdClient;
|
|
1011
1015
|
//#endregion
|
|
1012
1016
|
//#region src/accounts.d.ts
|
|
1013
1017
|
/** Как аккаунты делят между собой очередь запросов. */
|
|
1014
|
-
declare const RateLimitScope: Readonly<{
|
|
1018
|
+
export declare const RateLimitScope: Readonly<{
|
|
1015
1019
|
/** У каждого аккаунта своя очередь. */
|
|
1016
1020
|
readonly Account: "account";
|
|
1017
1021
|
/** Одна очередь на всех — умолчание. */
|
|
1018
1022
|
readonly Shared: "shared";
|
|
1019
1023
|
}>;
|
|
1020
|
-
type RateLimitScope = (typeof RateLimitScope)[keyof typeof RateLimitScope];
|
|
1024
|
+
export type RateLimitScope = (typeof RateLimitScope)[keyof typeof RateLimitScope];
|
|
1021
1025
|
/**
|
|
1022
1026
|
* Фабрика подключаемого модуля для клиентов {@link ItdAccounts}.
|
|
1023
1027
|
*
|
|
@@ -1136,7 +1140,7 @@ interface AccountEvents {
|
|
|
1136
1140
|
* }
|
|
1137
1141
|
* ```
|
|
1138
1142
|
*/
|
|
1139
|
-
declare class ItdAccounts {
|
|
1143
|
+
export declare class ItdAccounts {
|
|
1140
1144
|
#private;
|
|
1141
1145
|
constructor(options?: ItdAccountsOptions);
|
|
1142
1146
|
/** Общее хранилище сессий — то же, что передано опцией `storage`. */
|
|
@@ -1279,7 +1283,7 @@ declare class ItdAccounts {
|
|
|
1279
1283
|
*
|
|
1280
1284
|
* То же, что `new ItdAccounts(options)`, — для тех, кому привычнее фабрика.
|
|
1281
1285
|
*/
|
|
1282
|
-
declare function createAccounts(options?: ItdAccountsOptions): ItdAccounts;
|
|
1286
|
+
export declare function createAccounts(options?: ItdAccountsOptions): ItdAccounts;
|
|
1283
1287
|
//#endregion
|
|
1284
|
-
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,
|
|
1288
|
+
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, CaptchaChoice, CaptchaField, type CaptchaPage, type CaptchaProvider, type CaptchaSolveContext, 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, type ItdAccountsOptions, ItdApiError, type ItdApiErrorInit, ItdApiErrorKind, ItdAuthError, type ItdBuilder, 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 LastSeen, LastSeenUnit, type LazyFile, type LikeResult, LikesVisibility, type Listener, LogLevel, type Logger, type Loose, type ManagedClientResource, type MarkupBuilder, type MarkupContent, type MarkupInput, type MarkupSpan, MemoryKeyValueStore, MemoryMultiTokenStorage, MemoryShopOrderAccessStorage, MemoryTokenStorage, MessageAccess, 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, OperationMethod, type OperationRequestOptions, type OperationTransformContext, type OperationTransformer, type OriginalPost, 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 PostBase, type PostBuilder, type PostCounters, 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, type QrLoginStreamEvent, type QrLoginStreamInput, type QrLoginStreamListener, type QrLoginStreamOptions, type QrLoginTarget, type QueryParams, type QueryValue, type RateLimitBucket, type RateLimitBucketContext, type RateLimitBucketOverride, type RateLimitBucketState, type RateLimitOptions, RateLimitPacing, 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 ShopOrderBase, 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, type Span, SpanRenderFormat, SpanType, type StatusDay, type StatusIncidentLine, type StreamFile, type Subscription, type SubscriptionResource, type SubscriptionState, type TelemetryBatch, type TelemetryBatchOptions, type TelemetryClock, type TelemetryOptions, type TelemetryResource, type TextMarkup, TimeoutBudget, type TokenStorage, type TokenStorageAdapterOptions, UnauthorizedStreamError, type UnknownNotificationUpdate, type UnreadCountUpdate, type Unsubscribe, type UpdateNotificationSettingsInput, type UpdatePostInput, type UpdatePrivacyInput, type UpdateProfileInput, type UpdateResultBase, type UploadOptions, type UploadedFile, type UrlFile, type UrlFileOptions, type UserBase, type UserId, type UserListParams, type UserPostsParams, type UserRef, type UserSummary, type UsernameAvailability, UsernameUnavailableReason, 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, 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 };
|
|
1285
1289
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { $ as OperationMethod, A as ReportTargetType, B as isBuiltInOperationId, C as ItdErrorCode, D as NotificationType, E as MessageAccess, F as ViewSource, G as DEFAULT_RATE_LIMIT_BUCKET, H as operationMethod, I as WallAccess, J as pickArray, K as createClientRuntime, L as ITD_CATALOG, M as SpanType, N as UsernameUnavailableReason, O as QrLocationPrecision, P as ViewReason, Q as pickString, R as OPERATIONS, S as InteractionType, T as LikesVisibility, U as operationRetrySafety, V as operationBucket, W as BUCKET_LIMITS, _ as CaptchaType, _t as systemClock, at as requestAbortError, b as FeedTab, c as normalizeNotification, ct as assertPluginRemovable, d as canonicalNotificationType, et as RetrySafety, f as isKnownNotificationType, ft as STATUS_SERVICE, g as CaptchaField, h as CaptchaChoice, ht as RateLimitPacing, it as createRequestAbortScope, j as ServiceState, k as ReportReason, lt as orderPluginDefinitions, m as AttachmentType, mt as LIBRARY_VERSION, n as formatNotificationText, o as passthroughOperation, p as AccessType, pt as resolveRateLimit, q as createApiError, s as voidOperation, st as RequestQueuePool, t as resolveNotificationUrl, ut as DEFAULT_BASE_URL, v as CommentSort, vt as installAsyncDisposeFallback, w as LastSeenUnit, x as IncidentKind, y as EventChannelStatus, z as defineBuiltInOperation } from "./shared/url-CdT4lMxQ.js";
|
|
2
2
|
import { A as isItdForbiddenError, C as ItdValidationError, D as isItdConflictError, E as isItdAuthError, F as isItdStateError, I as isItdValidationError, M as isItdPhoneVerificationError, N as isItdRateLimitError, O as isItdError, P as isItdServerError, S as ItdTimeoutError, T as isItdApiError, _ as ItdNotFoundError, a as ItdAbortError, b as ItdServerError, c as ItdAuthError, d as ItdError, f as ItdErrorKind, g as ItdNetworkError, h as ItdForbiddenError, i as requireOptionalBoolean, j as isItdNotFoundError, k as isItdFileError, l as ItdConfigError, m as ItdFileErrorReason, n as isRecord, o as ItdApiError, p as ItdFileError, s as ItdApiErrorKind, t as isObjectLike, u as ItdConflictError, v as ItdPhoneVerificationError, w as TimeoutBudget, x as ItdStateError, y as ItdRateLimitError } from "./shared/validate-D7_kq3g5.js";
|
|
3
|
-
import { D as fallbackLogger, E as LogLevel, c as REFRESH_COOKIE, h as joinUrl, k as resolveLogger, l as REFRESH_COOKIE_PATH, s as CookieJar, u as isSerializedCookieEntry, v as RuntimeMode, y as createDeviceId } from "./shared/redact-
|
|
4
|
-
import { A as utcStampToIso, C as AUDIO_MIME_TYPES, D as isBuilder, E as comment, F as mapPage, I as createFeatureHost, L as ExtensibleOperationCatalog, M as BaseResource, N as PaginationMode, O as createStatusFeature, P as Paginator, S as ALLOWED_MIME_TYPES, T as VIDEO_MIME_TYPES, _ as poll, a as createShopOrderAccessStorage, b as parseHtml, c as ShopOrderStatus, d as isMyProfile, f as fromStream, g as post, h as report, i as MemoryShopOrderAccessStorage, j as NotificationsResource, k as toDate, l as ShopProductCategory, m as createResources, n as renderSpans, o as statusDays, p as fromUrl, r as createShopFeature, s as ShopConsentKind, t as SpanRenderFormat, u as ShopProductStatus, v as autoSpans, w as IMAGE_MIME_TYPES, x as parseMarkdown, y as markup } from "./shared/render-
|
|
5
|
-
import { c as FileTransferMode } from "./shared/options-
|
|
6
|
-
import { _ as Emitter, a as WebSocketTransport, c as NotificationEventsTransport, d as NotificationUpdateOrigin, f as NotificationUpdateType, g as runEventMiddleware, h as UnauthorizedStreamError, i as createNotificationEventsClient, l as resolveNotificationEventsOptions, m as EventChannel, n as EventRouter, o as EVENT_OPERATIONS, p as createParser, r as NotificationEventsClient, s as NotificationEvents, t as EventComposer, u as setNotificationEventsConnectGuard, v as reportListenerError } from "./shared/events-
|
|
3
|
+
import { D as fallbackLogger, E as LogLevel, c as REFRESH_COOKIE, h as joinUrl, k as resolveLogger, l as REFRESH_COOKIE_PATH, s as CookieJar, u as isSerializedCookieEntry, v as RuntimeMode, y as createDeviceId } from "./shared/redact-DSfdmeY7.js";
|
|
4
|
+
import { A as utcStampToIso, C as AUDIO_MIME_TYPES, D as isBuilder, E as comment, F as mapPage, I as createFeatureHost, L as ExtensibleOperationCatalog, M as BaseResource, N as PaginationMode, O as createStatusFeature, P as Paginator, S as ALLOWED_MIME_TYPES, T as VIDEO_MIME_TYPES, _ as poll, a as createShopOrderAccessStorage, b as parseHtml, c as ShopOrderStatus, d as isMyProfile, f as fromStream, g as post, h as report, i as MemoryShopOrderAccessStorage, j as NotificationsResource, k as toDate, l as ShopProductCategory, m as createResources, n as renderSpans, o as statusDays, p as fromUrl, r as createShopFeature, s as ShopConsentKind, t as SpanRenderFormat, u as ShopProductStatus, v as autoSpans, w as IMAGE_MIME_TYPES, x as parseMarkdown, y as markup } from "./shared/render-CFoF2WaH.js";
|
|
5
|
+
import { c as FileTransferMode } from "./shared/options-DLlaETn_.js";
|
|
6
|
+
import { _ as Emitter, a as WebSocketTransport, c as NotificationEventsTransport, d as NotificationUpdateOrigin, f as NotificationUpdateType, g as runEventMiddleware, h as UnauthorizedStreamError, i as createNotificationEventsClient, l as resolveNotificationEventsOptions, m as EventChannel, n as EventRouter, o as EVENT_OPERATIONS, p as createParser, r as NotificationEventsClient, s as NotificationEvents, t as EventComposer, u as setNotificationEventsConnectGuard, v as reportListenerError } from "./shared/events-_iYo8EP5.js";
|
|
7
7
|
import { a as isEnumerableKeyValueStore, i as createRecordKeyValueStore, o as withCodec, r as createKeyValueStore, s as withNamespace, t as MemoryKeyValueStore } from "./shared/key-value-store-w1Dn5Pjb.js";
|
|
8
8
|
import { n as copySession, r as createTokenStorage, t as MemoryTokenStorage } from "./shared/storage-86wiHeXD.js";
|
|
9
|
-
import { a as scopedTokenStorage, i as isRestorableSession, n as controlledTokenStorage, r as createMultiTokenStorage, t as MemoryMultiTokenStorage } from "./shared/multi-storage-
|
|
9
|
+
import { a as scopedTokenStorage, i as isRestorableSession, n as controlledTokenStorage, r as createMultiTokenStorage, t as MemoryMultiTokenStorage } from "./shared/multi-storage-DiBSx64p.js";
|
|
10
10
|
//#region src/notifications-api.ts
|
|
11
11
|
var ClientNotifications = class extends NotificationsResource {
|
|
12
12
|
#createEvents;
|
|
@@ -61,8 +61,8 @@ function requireString(body, key, message) {
|
|
|
61
61
|
return value;
|
|
62
62
|
}
|
|
63
63
|
const AUTH_CHECK = passthroughOperation("auth.check");
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
passthroughOperation("auth.captchaProvider");
|
|
65
|
+
passthroughOperation("auth.captchaPage");
|
|
66
66
|
const AUTH_SIGN_UP = defineBuiltInOperation("auth.signUp", (body) => requireString(body, "flowToken", "Сервер не вернул flowToken при регистрации"));
|
|
67
67
|
const AUTH_SIGN_IN = defineBuiltInOperation("auth.signIn", (body) => {
|
|
68
68
|
const accessToken = pickString(body, "accessToken");
|
|
@@ -126,17 +126,6 @@ function validateCaptchaToken(captcha, path) {
|
|
|
126
126
|
if (typeof type !== "string" || type.trim() === "") throw new ItdConfigError(`${path}.type должен быть непустой строкой`);
|
|
127
127
|
requireCaptchaText(field, `${path}.field`);
|
|
128
128
|
}
|
|
129
|
-
/** Разбирает ответ `GET /api/v1/auth/captcha/provider` для автоматического входа. */
|
|
130
|
-
function readCaptchaProvider(body) {
|
|
131
|
-
const config = isRecord(body) ? body : void 0;
|
|
132
|
-
const provider = config?.provider;
|
|
133
|
-
const field = config?.field;
|
|
134
|
-
if (typeof provider !== "string" || provider.trim() === "" || typeof field !== "string" || field.trim() === "") throw new ItdConfigError("Сервер вернул неподдерживаемую конфигурацию капчи");
|
|
135
|
-
return {
|
|
136
|
-
provider,
|
|
137
|
-
field
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
129
|
/** Куда класть токен: настройка, иначе умолчание провайдера. */
|
|
141
130
|
function resolveField(type, configured) {
|
|
142
131
|
const field = configured ?? CAPTCHA_FIELDS[type];
|
|
@@ -1022,22 +1011,10 @@ var AuthManager = class {
|
|
|
1022
1011
|
}
|
|
1023
1012
|
/** Спрашивает у сервера активного провайдера и поле, в котором он ждёт токен. */
|
|
1024
1013
|
async #resolveCaptchaProvider() {
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
skipAuthRefresh: true
|
|
1030
|
-
}));
|
|
1031
|
-
} catch (error) {
|
|
1032
|
-
if (isItdApiError(error) && error.status === 404 && error.code === ItdErrorCode.NOT_FOUND) {
|
|
1033
|
-
this.#config.logger?.warn("Сервер отключил определение провайдера капчи; используется Cloudflare Turnstile");
|
|
1034
|
-
return {
|
|
1035
|
-
provider: CaptchaType.Cloudflare,
|
|
1036
|
-
field: CaptchaField.Cloudflare
|
|
1037
|
-
};
|
|
1038
|
-
}
|
|
1039
|
-
throw error;
|
|
1040
|
-
}
|
|
1014
|
+
return {
|
|
1015
|
+
provider: CaptchaType.Cloudflare,
|
|
1016
|
+
field: CaptchaField.Cloudflare
|
|
1017
|
+
};
|
|
1041
1018
|
}
|
|
1042
1019
|
async #performSignIn(credentials, revision) {
|
|
1043
1020
|
const captcha = await this.captchaBody();
|
|
@@ -1255,13 +1232,13 @@ var AuthResource = class extends BaseResource {
|
|
|
1255
1232
|
*
|
|
1256
1233
|
* Сервер может переключить провайдера или переименовать поле без выпуска новой версии SDK.
|
|
1257
1234
|
* Автоматическому входу этот вызов не нужен — клиент делает его сам.
|
|
1235
|
+
*
|
|
1236
|
+
* @deprecated Сервер отвечает `404`; метод возвращает Cloudflare Turnstile.
|
|
1258
1237
|
*/
|
|
1259
|
-
captchaProvider(
|
|
1260
|
-
return
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
skipAuthRefresh: true,
|
|
1264
|
-
...options
|
|
1238
|
+
captchaProvider(_options = {}) {
|
|
1239
|
+
return Promise.resolve({
|
|
1240
|
+
provider: CaptchaType.Cloudflare,
|
|
1241
|
+
field: CAPTCHA_FIELDS[CaptchaType.Cloudflare]
|
|
1265
1242
|
});
|
|
1266
1243
|
}
|
|
1267
1244
|
/**
|
|
@@ -1270,14 +1247,14 @@ var AuthResource = class extends BaseResource {
|
|
|
1270
1247
|
* То же, что {@link captchaProvider}, плюс `url` — готовая страница на домене итд.com,
|
|
1271
1248
|
* где ключ виджета действителен. Пригодится встроенному браузеру: открыть её и забрать
|
|
1272
1249
|
* токен, ничего не собирая самому.
|
|
1250
|
+
*
|
|
1251
|
+
* @deprecated Сервер отвечает `404`; метод возвращает Cloudflare Turnstile на домене итд.com.
|
|
1273
1252
|
*/
|
|
1274
|
-
captchaPage(options = {}) {
|
|
1275
|
-
return
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
...options
|
|
1280
|
-
});
|
|
1253
|
+
async captchaPage(options = {}) {
|
|
1254
|
+
return {
|
|
1255
|
+
...await this.captchaProvider(options),
|
|
1256
|
+
url: DEFAULT_BASE_URL
|
|
1257
|
+
};
|
|
1281
1258
|
}
|
|
1282
1259
|
/** Создаёт короткоживущую сессию QR-входа. */
|
|
1283
1260
|
async startQrLogin(options = {}) {
|
|
@@ -2650,6 +2627,6 @@ function createAccounts(options = {}) {
|
|
|
2650
2627
|
return new ItdAccounts(options);
|
|
2651
2628
|
}
|
|
2652
2629
|
//#endregion
|
|
2653
|
-
export { ALLOWED_MIME_TYPES, AUDIO_MIME_TYPES, AccessType, AttachmentType, BUCKET_LIMITS, CAPTCHA_FIELDS, CaptchaChoice, CaptchaField, CaptchaType, CommentSort, DEFAULT_BASE_URL, DEFAULT_RATE_LIMIT_BUCKET, EventChannel, EventChannelStatus, EventComposer, EventRouter, FeedTab, FileTransferMode, IMAGE_MIME_TYPES, IncidentKind, InteractionType, ItdAbortError, ItdAccounts, ItdApiError, ItdApiErrorKind, ItdAuthError, ItdClient, ItdConfigError, ItdConflictError, ItdError, ItdErrorCode, ItdErrorKind, ItdFileError, ItdFileErrorReason, ItdForbiddenError, ItdNetworkError, ItdNotFoundError, ItdPhoneVerificationError, ItdRateLimitError, ItdServerError, ItdStateError, ItdTimeoutError, ItdValidationError, LIBRARY_VERSION, LikesVisibility, LogLevel, MemoryKeyValueStore, MemoryMultiTokenStorage, MemoryShopOrderAccessStorage, MemoryTokenStorage, NotificationEvents, NotificationEventsClient, NotificationEventsTransport, NotificationType, NotificationUpdateOrigin, NotificationUpdateType, OPERATIONS, OperationMethod, PaginationMode, Paginator, QrLocationPrecision, QrLoginStatus, QrLoginStreamStatus, RateLimitPacing, RateLimitScope, ReportReason, ReportTargetType, RetrySafety, RuntimeMode, STATUS_SERVICE, ServiceState, ShopConsentKind, ShopOrderStatus, ShopProductCategory, ShopProductStatus, SignInStatus, SpanRenderFormat, SpanType, TURNSTILE_SITE_KEY, TimeoutBudget, UnauthorizedStreamError, VIDEO_MIME_TYPES, ViewReason, ViewSource, WallAccess, WebSocketTransport, 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 };
|
|
2630
|
+
export { ALLOWED_MIME_TYPES, AUDIO_MIME_TYPES, AccessType, AttachmentType, BUCKET_LIMITS, CAPTCHA_FIELDS, CaptchaChoice, CaptchaField, CaptchaType, CommentSort, DEFAULT_BASE_URL, DEFAULT_RATE_LIMIT_BUCKET, EventChannel, EventChannelStatus, EventComposer, EventRouter, FeedTab, FileTransferMode, IMAGE_MIME_TYPES, IncidentKind, InteractionType, ItdAbortError, ItdAccounts, ItdApiError, ItdApiErrorKind, ItdAuthError, ItdClient, ItdConfigError, ItdConflictError, ItdError, ItdErrorCode, ItdErrorKind, ItdFileError, ItdFileErrorReason, ItdForbiddenError, ItdNetworkError, ItdNotFoundError, ItdPhoneVerificationError, ItdRateLimitError, ItdServerError, ItdStateError, ItdTimeoutError, ItdValidationError, LIBRARY_VERSION, LastSeenUnit, LikesVisibility, LogLevel, MemoryKeyValueStore, MemoryMultiTokenStorage, MemoryShopOrderAccessStorage, MemoryTokenStorage, MessageAccess, NotificationEvents, NotificationEventsClient, NotificationEventsTransport, NotificationType, NotificationUpdateOrigin, NotificationUpdateType, OPERATIONS, OperationMethod, PaginationMode, Paginator, QrLocationPrecision, QrLoginStatus, QrLoginStreamStatus, RateLimitPacing, RateLimitScope, ReportReason, ReportTargetType, RetrySafety, RuntimeMode, STATUS_SERVICE, ServiceState, ShopConsentKind, ShopOrderStatus, ShopProductCategory, ShopProductStatus, SignInStatus, SpanRenderFormat, SpanType, TURNSTILE_SITE_KEY, TimeoutBudget, UnauthorizedStreamError, UsernameUnavailableReason, VIDEO_MIME_TYPES, ViewReason, ViewSource, WallAccess, WebSocketTransport, 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 };
|
|
2654
2631
|
|
|
2655
2632
|
//# sourceMappingURL=index.js.map
|