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.
Files changed (71) hide show
  1. package/dist/events/index.cjs +3 -3
  2. package/dist/events/index.d.cts +2 -2
  3. package/dist/events/index.d.ts +2 -2
  4. package/dist/events/index.js +3 -3
  5. package/dist/index.cjs +28 -48
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.cts +23 -19
  8. package/dist/index.d.ts +23 -19
  9. package/dist/index.js +26 -49
  10. package/dist/index.js.map +1 -1
  11. package/dist/node/index.cjs +2 -2
  12. package/dist/node/index.cjs.map +1 -1
  13. package/dist/node/index.d.cts +7 -8
  14. package/dist/node/index.d.ts +7 -8
  15. package/dist/node/index.js +2 -2
  16. package/dist/node/index.js.map +1 -1
  17. package/dist/rest/index.cjs +7 -4
  18. package/dist/rest/index.cjs.map +1 -1
  19. package/dist/rest/index.d.cts +5 -5
  20. package/dist/rest/index.d.ts +5 -5
  21. package/dist/rest/index.js +5 -5
  22. package/dist/rest/index.js.map +1 -1
  23. package/dist/shared/{events-CAb9G7Sf.d.ts → events-9215JDDd.d.ts} +2 -2
  24. package/dist/shared/{events-C6tmj8aW.cjs → events-BKyxZQNw.cjs} +246 -56
  25. package/dist/shared/events-BKyxZQNw.cjs.map +1 -0
  26. package/dist/shared/{events-Sc75x6rT.d.cts → events-FaXfdle0.d.cts} +2 -2
  27. package/dist/shared/{events-MWNcnfrq.js → events-_iYo8EP5.js} +246 -56
  28. package/dist/shared/events-_iYo8EP5.js.map +1 -0
  29. package/dist/shared/key-value-store-DYSPsqwq.cjs.map +1 -1
  30. package/dist/shared/key-value-store-w1Dn5Pjb.js.map +1 -1
  31. package/dist/shared/{multi-storage-C7-Gz6Z7.cjs → multi-storage-7Y3KCseI.cjs} +2 -2
  32. package/dist/shared/multi-storage-7Y3KCseI.cjs.map +1 -0
  33. package/dist/shared/{multi-storage-BLBrGN9Q.js → multi-storage-DiBSx64p.js} +2 -2
  34. package/dist/shared/multi-storage-DiBSx64p.js.map +1 -0
  35. package/dist/shared/{options-5tywTYId.cjs → options-D5ttspWk.cjs} +2 -2
  36. package/dist/shared/{options-5tywTYId.cjs.map → options-D5ttspWk.cjs.map} +1 -1
  37. package/dist/shared/{options-BerKicCs.js → options-DLlaETn_.js} +2 -2
  38. package/dist/shared/{options-BerKicCs.js.map → options-DLlaETn_.js.map} +1 -1
  39. package/dist/shared/{redact-DoC7lSsp.cjs → redact-BbhtA9o-.cjs} +13 -3
  40. package/dist/shared/redact-BbhtA9o-.cjs.map +1 -0
  41. package/dist/shared/{redact-C5oxIvcc.js → redact-DSfdmeY7.js} +13 -3
  42. package/dist/shared/redact-DSfdmeY7.js.map +1 -0
  43. package/dist/shared/{render-Dnc84B4M.cjs → render-BQvC5UxF.cjs} +134 -49
  44. package/dist/shared/render-BQvC5UxF.cjs.map +1 -0
  45. package/dist/shared/{render-CBroJPcV.d.ts → render-BS09ygcy.d.ts} +84 -70
  46. package/dist/shared/{render-DRh5_aRe.js → render-CFoF2WaH.js} +134 -49
  47. package/dist/shared/render-CFoF2WaH.js.map +1 -0
  48. package/dist/shared/{render-DM7AhTZW.d.cts → render-X2JCo1JS.d.cts} +84 -70
  49. package/dist/shared/storage-86wiHeXD.js.map +1 -1
  50. package/dist/shared/storage-CIjejZDt.cjs.map +1 -1
  51. package/dist/shared/{url-Bg61sk_Y.js → url-CdT4lMxQ.js} +25 -12
  52. package/dist/shared/url-CdT4lMxQ.js.map +1 -0
  53. package/dist/shared/{url-BOi-_mJT.d.ts → url-_R0oJ7gE.d.cts} +102 -53
  54. package/dist/shared/{url-BOi-_mJT.d.cts → url-_R0oJ7gE.d.ts} +102 -53
  55. package/dist/shared/{url-DTgkCWv5.cjs → url-ioIaywDi.cjs} +42 -11
  56. package/dist/shared/url-ioIaywDi.cjs.map +1 -0
  57. package/dist/web/index.cjs.map +1 -1
  58. package/dist/web/index.d.cts +4 -5
  59. package/dist/web/index.d.ts +4 -5
  60. package/dist/web/index.js.map +1 -1
  61. package/package.json +11 -11
  62. package/dist/shared/events-C6tmj8aW.cjs.map +0 -1
  63. package/dist/shared/events-MWNcnfrq.js.map +0 -1
  64. package/dist/shared/multi-storage-BLBrGN9Q.js.map +0 -1
  65. package/dist/shared/multi-storage-C7-Gz6Z7.cjs.map +0 -1
  66. package/dist/shared/redact-C5oxIvcc.js.map +0 -1
  67. package/dist/shared/redact-DoC7lSsp.cjs.map +0 -1
  68. package/dist/shared/render-DRh5_aRe.js.map +0 -1
  69. package/dist/shared/render-Dnc84B4M.cjs.map +0 -1
  70. package/dist/shared/url-Bg61sk_Y.js.map +0 -1
  71. package/dist/shared/url-DTgkCWv5.cjs.map +0 -1
@@ -1,5 +1,5 @@
1
- import { $ as isItdServerError, $t as operationRetrySafety, A as ItdErrorKind, At as RequestOptions, B as ItdStateError, Bt as RuntimeMode, C as ItdApiError, Cn as ReportTargetType, Ct as PaginationOptions, D as ItdConfigError, Dn as ViewSource, Dt as RawRequestOptions, E as ItdAuthError, En as ViewReason, Et as RateLimitOptions, F as ItdNetworkError, Ft as RuntimeOptions, G as isItdAuthError, Gt as BuiltInOperationId, H as ItdValidationError, Ht as Logger, I as ItdNotFoundError, It as QueryParams, J as isItdFileError, Jt as OPERATIONS, K as isItdConflictError, Kt as CustomOperationId, L as ItdPhoneVerificationError, Lt as QueryValue, M as ItdFileError, Mt as RetryContext, N as ItdFileErrorReason, Nt as RetryDecisionContext, O as ItdConflictError, On as WallAccess, Ot as RequestContext, P as ItdForbiddenError, Pt as RetryOptions, Q as isItdRateLimitError, Qt as operationMethod, R as ItdRateLimitError, Rt as ServiceDefinition, S as ItdAbortError, Sn as ReportReason, St as OperationRequestOptions, T as ItdApiErrorKind, Tn as SpanType, Tt as RateLimitBucketOverride, U as TimeoutBudget, Ut as ItdClock, V as ItdTimeoutError, Vt as LogLevel, W as isItdApiError, Wt as systemClock, X as isItdNotFoundError, Xt as isBuiltInOperationId, Y as isItdForbiddenError, Yt as OperationId, Z as isItdPhoneVerificationError, Zt as operationBucket, _ as PrivacySettings, _n as ItdErrorCode, _t as OperationMetadata, a as NotificationEvent, an as UserId, at as ClientConnection, b as SubscriptionState, bn as NotificationType, bt as ClientHooks, c as NotificationSettings, cn as AttachmentType, ct as anonymousAuth, d as AuthUser, dt as DEFAULT_BASE_URL, en as BUCKET_LIMITS, et as isItdStateError, f as Author, fn as CommentSort, ft as STATUS_SERVICE, g as PinsResult, gn as InteractionType, h as Pin, hn as IncidentKind, ht as OperationAnnotations, i as formatNotificationText, in as Span, it as Unsubscribe, j as ItdFieldErrors, jt as ResponseContext, k as ItdError, kt as RequestExtensions, l as Actor, lt as bearerToken, m as MyProfile, mn as FeedTab, mt as FeatureOperationId, n as canonicalNotificationType, nn as RateLimitBucket, o as normalizeNotification, on as UserRef, p as FollowResult, pt as LIBRARY_VERSION, q as isItdError, qt as ItdOperationDefinition, r as isKnownNotificationType, rn as IsoDate, rt as Listener, s as Notification, sn as AccessType, st as AuthProvider, t as resolveNotificationUrl, tn as DEFAULT_RATE_LIMIT_BUCKET, tt as isItdValidationError, u as AuthState, ut as tokenProvider, v as Profile, vn as LikesVisibility, vt as OperationMethod, w as ItdApiErrorInit, wn as ServiceState, wt as RateLimitBucketContext, x as UserSummary, xt as ErrorContextHook, y as PublicProfile, yn as Loose, yt as RetrySafety, z as ItdServerError, zt as RateLimitPacing } from "../shared/url-BOi-_mJT.js";
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 PreparedBufferSource, Ct as ShopSizeChart, D as UpdateProfileInput, Dn as PinPostResult, Dr as ResolveFileOptions, Dt as ReportsResource, E as UpdatePrivacyInput, En as LikeResult, Er as ResolveFileContext, Et as SearchResult, F as TelemetryClock, Fn as comment, Ft as CreatePostInput, G as ShopConsentsResource, 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, 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 FileResolver, St as ShopRecipient, T as VerificationResource, Tn as Hashtag, Tr as PreparedStreamSource, 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, Zt as TextMarkup, _ as AllowedMimeType, _n as UploadOptions, _r as FeatureContext, _t as ShopProduct, a as ShopFeatureOptions, an as StatusDay, ar as AttemptContext, at as ShopDeliveryDestination, b as ImageMimeType, bn as RepliesParams, br as FeatureRequestOptions, bt as ShopProductSpec, c as ShopOrderAccessStorage, cn as AnnouncementButton, cr as AttemptNext, ct as ShopOrderAccessSession, d as statusDays, dn as Portal, dr as OperationTransformContext, dt as ShopOrderItem, en as PlatformClientVersion, er as PaginationMode, et as ShopConsentKind, f as isMyProfile, fn as Report, fr as OperationTransformer, ft as ShopOrderItemInput, g as AUDIO_MIME_TYPES, gn as FilesResource, gr as FeatureBucketDefinition, gt as ShopPayment, h as ALLOWED_MIME_TYPES, hn as HashtagsResource, hr as ClientFeature, 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, kt as ReportInput, l as ShopOrderAccessStorageAdapterOptions, ln as ChangelogEntry, lr as ClientPlugin, lt as ShopOrderAccessVerification, m as utcStampToIso, mn as HashtagPostsParams, mr as PluginTeardown, mt as ShopOrderSummary, n as SpanRenderFormat, nn as PlatformVersions, nr as PaginatorOptions, nt as ShopDeliveryCalculation, o as createShopFeature, on as StatusIncidentLine, or as AttemptExtensions, ot as ShopDeliveryPoint, p as toDate, pn as VerificationStatus, pr as PluginApi, 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 AttemptInterceptor, st as ShopOrder, t as RenderSpansOptions, tn as PlatformResource, tr as Paginator, tt as ShopCreatedOrder, u as createShopOrderAccessStorage, un as Clan, ur as OperationExtensions, ut as ShopOrderDelivery, v as AudioMimeType, vn as UploadedFile, vr as FeatureInstallation, vt as ShopProductCategory, w as fromUrl, wn as CommentUpdateResult, wr as PreparedFileSource, wt as ShopSizeChartRow, x as VIDEO_MIME_TYPES, xn as Attachment, xr as ManagedClientResource, xt as ShopProductStatus, y as IMAGE_MIME_TYPES, yn as CommentsResource, yr as FeatureOperationDefinition, yt as ShopProductColor, z as ViewTracker, zn as CreateCommentInput, zt as post } from "../shared/render-CBroJPcV.js";
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, 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, b as PublicProfile, bn as ItdErrorCode, bt as OperationMetadata, c as NotificationSettings, cn as UserId, ct as ClientConnection, d as AuthUser, dn as AttachmentType, dt as anonymousAuth, en as operationBucket, et as isItdPhoneVerificationError, f as Author, ft as bearerToken, g as Pin, 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, m as LastSeen, 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, pt as tokenProvider, 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, Nt as FeedParams, O as UserListParams, On as OriginalPost, Or as PreparedBufferSource, Ot as ReportsResource, P as TelemetryBatchOptions, Pn as PostCounters, 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, 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, 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
3
  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";
4
4
  //#region src/rest/client.d.ts
5
5
  /** Опции конструктора {@link ItdRestClient}. */
@@ -29,7 +29,7 @@ interface RestClientOptions extends RuntimeOptions {
29
29
  * const feed = await api.posts.list({ tab: 'popular' });
30
30
  * ```
31
31
  */
32
- declare class ItdRestClient {
32
+ export declare class ItdRestClient {
33
33
  #private;
34
34
  /** Профили, подписки, блокировки, приватность. */
35
35
  get users(): UsersResource;
@@ -142,7 +142,7 @@ declare class ItdRestClient {
142
142
  * const api = createRestClient({ auth: token, rateLimit: { concurrency: 4 } });
143
143
  * ```
144
144
  */
145
- declare function createRestClient(options?: RestClientOptions): ItdRestClient;
145
+ export declare function createRestClient(options?: RestClientOptions): ItdRestClient;
146
146
  //#endregion
147
- export { ALLOWED_MIME_TYPES, AUDIO_MIME_TYPES, AccessType, type Actor, type AllowedMimeType, type Announcement, type AnnouncementButton, type Attachment, AttachmentType, type AttemptContext, type AttemptExtensions, type AttemptInterceptor, type AttemptNext, type AudioMimeType, type AuthProvider, type AuthState, type AuthUser, type Author, type AutoSpansOptions, BUCKET_LIMITS, type BuilderInput, type BuiltInOperationId, 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 CustomOperationId, DEFAULT_BASE_URL, DEFAULT_RATE_LIMIT_BUCKET, type DwellEntry, type ErrorContextHook, 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 FromStreamOptions, type Hashtag, type HashtagPostsParams, type HashtagsResource, IMAGE_MIME_TYPES, type ImageMimeType, IncidentKind, type InteractionEntry, InteractionType, type IsoDate, ItdAbortError, ItdApiError, type ItdApiErrorInit, ItdApiErrorKind, ItdAuthError, type ItdBuilder, type ItdClock, ItdConfigError, ItdConflictError, ItdError, ItdErrorCode, ItdErrorKind, type ItdFieldErrors, ItdFileError, ItdFileErrorReason, ItdForbiddenError, ItdNetworkError, ItdNotFoundError, ItdPhoneVerificationError, ItdRateLimitError, ItdRestClient, ItdServerError, ItdStateError, ItdTimeoutError, ItdValidationError, LIBRARY_VERSION, type LazyFile, type LikeResult, LikesVisibility, type Listener, LogLevel, type Logger, type Loose, type ManagedClientResource, type MarkupBuilder, type MarkupContent, type MarkupInput, type MarkupSpan, MemoryShopOrderAccessStorage, type MyProfile, type Notification, type NotificationEvent, type NotificationListParams, type NotificationSettings, NotificationType, type NotificationsResource, OPERATIONS, type OperationAnnotations, type ItdOperationDefinition as OperationDefinition, type OperationExtensions, type OperationId, type OperationMetadata, 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 QueryParams, type QueryValue, type RateLimitBucket, type RateLimitBucketContext, type RateLimitBucketOverride, type RateLimitBucketState, type RateLimitOptions, RateLimitPacing, type RawRequestOptions, type RenderSpansOptions, type RepliesParams, type Report, type ReportBuilder, type ReportInput, ReportReason, ReportTargetType, type ReportsResource, type RequestContext, type RequestExtensions, type RequestOptions, type ResolveFileContext, type ResolveFileOptions, type ResponseContext, type RestClientOptions, type RetryContext, type RetryDecisionContext, type RetryOptions, RetrySafety, RuntimeMode, type RuntimeOptions, STATUS_SERVICE, type SearchResource, type SearchResult, type ServiceDefinition, ServiceState, type ServiceStatus, type Session, 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 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 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, anonymousAuth, autoSpans, bearerToken, canonicalNotificationType, comment, createRestClient, createShopFeature, createShopOrderAccessStorage, formatNotificationText, fromStream, fromUrl, isBuilder, isBuiltInOperationId, 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, statusDays, systemClock, toDate, tokenProvider, utcStampToIso };
147
+ export { ALLOWED_MIME_TYPES, AUDIO_MIME_TYPES, AccessType, type Actor, type AllowedMimeType, type Announcement, type AnnouncementButton, type Attachment, AttachmentType, type AttemptContext, type AttemptExtensions, type AttemptInterceptor, type AttemptNext, type AudioMimeType, type AuthProvider, type AuthState, type AuthUser, type Author, type AutoSpansOptions, BUCKET_LIMITS, type BuilderInput, type BuiltInOperationId, 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 CustomOperationId, DEFAULT_BASE_URL, DEFAULT_RATE_LIMIT_BUCKET, type DwellEntry, type ErrorContextHook, 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 FromStreamOptions, type Hashtag, type HashtagPostsParams, type HashtagsResource, IMAGE_MIME_TYPES, type ImageMimeType, IncidentKind, type InteractionEntry, InteractionType, type IsoDate, ItdAbortError, ItdApiError, type ItdApiErrorInit, ItdApiErrorKind, ItdAuthError, type ItdBuilder, type ItdClock, ItdConfigError, ItdConflictError, ItdError, ItdErrorCode, ItdErrorKind, type ItdFieldErrors, ItdFileError, ItdFileErrorReason, ItdForbiddenError, ItdNetworkError, ItdNotFoundError, ItdPhoneVerificationError, ItdRateLimitError, ItdServerError, ItdStateError, ItdTimeoutError, ItdValidationError, 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, MemoryShopOrderAccessStorage, MessageAccess, type MyProfile, type Notification, type NotificationEvent, type NotificationListParams, type NotificationSettings, NotificationType, 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, type QueryParams, type QueryValue, type RateLimitBucket, type RateLimitBucketContext, type RateLimitBucketOverride, type RateLimitBucketState, type RateLimitOptions, RateLimitPacing, type RawRequestOptions, type RenderSpansOptions, type RepliesParams, type Report, type ReportBuilder, type ReportInput, ReportReason, ReportTargetType, type ReportsResource, type RequestContext, type RequestExtensions, type RequestOptions, type ResolveFileContext, type ResolveFileOptions, type ResponseContext, type RestClientOptions, type RetryContext, type RetryDecisionContext, type RetryOptions, RetrySafety, RuntimeMode, type RuntimeOptions, STATUS_SERVICE, type SearchResource, type SearchResult, type ServiceDefinition, ServiceState, type ServiceStatus, type Session, 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 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 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, anonymousAuth, autoSpans, bearerToken, canonicalNotificationType, comment, createShopFeature, createShopOrderAccessStorage, formatNotificationText, fromStream, fromUrl, isBuilder, isBuiltInOperationId, 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, statusDays, systemClock, toDate, tokenProvider, utcStampToIso };
148
148
  //# sourceMappingURL=index.d.ts.map
@@ -1,8 +1,8 @@
1
- import { A as SpanType, B as operationRetrySafety, C as ItdErrorCode, D as ReportReason, F as OPERATIONS, H as DEFAULT_RATE_LIMIT_BUCKET, L as isBuiltInOperationId, M as ViewSource, N as WallAccess, O as ReportTargetType, P as ITD_CATALOG, R as operationBucket, S as InteractionType, T as NotificationType, U as createClientRuntime, V as BUCKET_LIMITS, X as OperationMethod, Z as RetrySafety, a as tokenProvider, b as FeedTab, c as normalizeNotification, d as canonicalNotificationType, dt as LIBRARY_VERSION, f as isKnownNotificationType, ft as RateLimitPacing, ht as installAsyncDisposeFallback, i as bearerToken, j as ViewReason, k as ServiceState, lt as STATUS_SERVICE, m as AttachmentType, mt as systemClock, n as formatNotificationText, p as AccessType, r as anonymousAuth, st as DEFAULT_BASE_URL, t as resolveNotificationUrl, v as CommentSort, w as LikesVisibility, x as IncidentKind, z as operationMethod } from "../shared/url-Bg61sk_Y.js";
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, K as createClientRuntime, L as ITD_CATALOG, M as SpanType, N as UsernameUnavailableReason, P as ViewReason, R as OPERATIONS, S as InteractionType, T as LikesVisibility, U as operationRetrySafety, V as operationBucket, W as BUCKET_LIMITS, _t as systemClock, a as tokenProvider, b as FeedTab, c as normalizeNotification, d as canonicalNotificationType, et as RetrySafety, f as isKnownNotificationType, ft as STATUS_SERVICE, ht as RateLimitPacing, i as bearerToken, j as ServiceState, k as ReportReason, m as AttachmentType, mt as LIBRARY_VERSION, n as formatNotificationText, p as AccessType, r as anonymousAuth, t as resolveNotificationUrl, ut as DEFAULT_BASE_URL, v as CommentSort, vt as installAsyncDisposeFallback, w as LastSeenUnit, x as IncidentKind } 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, j as isItdNotFoundError, k as isItdFileError, l as ItdConfigError, m as ItdFileErrorReason, o as ItdApiError, p as ItdFileError, s as ItdApiErrorKind, u as ItdConflictError, v as ItdPhoneVerificationError, w as TimeoutBudget, x as ItdStateError, y as ItdRateLimitError } from "../shared/validate-D7_kq3g5.js";
3
- import { E as LogLevel, v as RuntimeMode } from "../shared/redact-C5oxIvcc.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, 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-DRh5_aRe.js";
5
- import { c as FileTransferMode } from "../shared/options-BerKicCs.js";
3
+ import { E as LogLevel, v as RuntimeMode } 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, 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
6
  //#region src/rest/client.ts
7
7
  /**
8
8
  * Минимальный клиент REST API итд.com.
@@ -295,6 +295,6 @@ function createRestClient(options = {}) {
295
295
  return new ItdRestClient(options);
296
296
  }
297
297
  //#endregion
298
- export { ALLOWED_MIME_TYPES, AUDIO_MIME_TYPES, AccessType, AttachmentType, BUCKET_LIMITS, CommentSort, DEFAULT_BASE_URL, DEFAULT_RATE_LIMIT_BUCKET, FeedTab, FileTransferMode, IMAGE_MIME_TYPES, IncidentKind, InteractionType, ItdAbortError, ItdApiError, ItdApiErrorKind, ItdAuthError, ItdConfigError, ItdConflictError, ItdError, ItdErrorCode, ItdErrorKind, ItdFileError, ItdFileErrorReason, ItdForbiddenError, ItdNetworkError, ItdNotFoundError, ItdPhoneVerificationError, ItdRateLimitError, ItdRestClient, ItdServerError, ItdStateError, ItdTimeoutError, ItdValidationError, LIBRARY_VERSION, LikesVisibility, LogLevel, MemoryShopOrderAccessStorage, NotificationType, OPERATIONS, OperationMethod, PaginationMode, Paginator, RateLimitPacing, ReportReason, ReportTargetType, RetrySafety, RuntimeMode, STATUS_SERVICE, ServiceState, ShopConsentKind, ShopOrderStatus, ShopProductCategory, ShopProductStatus, SpanRenderFormat, SpanType, TimeoutBudget, VIDEO_MIME_TYPES, ViewReason, ViewSource, WallAccess, anonymousAuth, autoSpans, bearerToken, canonicalNotificationType, comment, createRestClient, createShopFeature, createShopOrderAccessStorage, formatNotificationText, fromStream, fromUrl, isBuilder, isBuiltInOperationId, 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, statusDays, systemClock, toDate, tokenProvider, utcStampToIso };
298
+ export { ALLOWED_MIME_TYPES, AUDIO_MIME_TYPES, AccessType, AttachmentType, BUCKET_LIMITS, CommentSort, DEFAULT_BASE_URL, DEFAULT_RATE_LIMIT_BUCKET, FeedTab, FileTransferMode, IMAGE_MIME_TYPES, IncidentKind, InteractionType, ItdAbortError, ItdApiError, ItdApiErrorKind, ItdAuthError, ItdConfigError, ItdConflictError, ItdError, ItdErrorCode, ItdErrorKind, ItdFileError, ItdFileErrorReason, ItdForbiddenError, ItdNetworkError, ItdNotFoundError, ItdPhoneVerificationError, ItdRateLimitError, ItdRestClient, ItdServerError, ItdStateError, ItdTimeoutError, ItdValidationError, LIBRARY_VERSION, LastSeenUnit, LikesVisibility, LogLevel, MemoryShopOrderAccessStorage, MessageAccess, NotificationType, OPERATIONS, OperationMethod, PaginationMode, Paginator, RateLimitPacing, ReportReason, ReportTargetType, RetrySafety, RuntimeMode, STATUS_SERVICE, ServiceState, ShopConsentKind, ShopOrderStatus, ShopProductCategory, ShopProductStatus, SpanRenderFormat, SpanType, TimeoutBudget, UsernameUnavailableReason, VIDEO_MIME_TYPES, ViewReason, ViewSource, WallAccess, anonymousAuth, autoSpans, bearerToken, canonicalNotificationType, comment, createRestClient, createShopFeature, createShopOrderAccessStorage, formatNotificationText, fromStream, fromUrl, isBuilder, isBuiltInOperationId, 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, statusDays, systemClock, toDate, tokenProvider, utcStampToIso };
299
299
 
300
300
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["#runtime","#features","#resources","#assertActive","#disposed","#disposePromise","#dispose"],"sources":["../../src/rest/client.ts"],"sourcesContent":["import { installAsyncDisposeFallback } from '../core/async-dispose.js';\nimport { type AuthProvider, anonymousAuth, bearerToken } from '../core/auth-provider.js';\nimport { ItdConfigError, ItdStateError } from '../core/errors.js';\nimport { type ClientRuntime, createClientRuntime } from '../core/execution/client-runtime.js';\nimport { ExtensibleOperationCatalog } from '../core/feature-catalog.js';\nimport { type ClientFeatureHost, createFeatureHost } from '../core/feature-host.js';\nimport type { ClientFeature } from '../core/features.js';\nimport type { RawRequestOptions, RuntimeOptions } from '../core/options.js';\nimport type { ClientPlugin } from '../core/plugins/contracts.js';\nimport type { RateLimitBucketState } from '../core/scheduling/rate-limit.js';\nimport type { ServiceDefinition } from '../core/services.js';\nimport { ITD_CATALOG } from '../domain/catalog.js';\nimport type { CommentsResource } from '../resources/comments.js';\nimport type { FilesResource } from '../resources/files.js';\nimport type { HashtagsResource } from '../resources/hashtags.js';\nimport { NotificationsResource } from '../resources/notifications.js';\nimport type { PlatformResource } from '../resources/platform.js';\nimport type { PostsResource } from '../resources/posts.js';\nimport type { ReportsResource } from '../resources/reports.js';\nimport type { SearchResource } from '../resources/search.js';\nimport type { ShopResource } from '../resources/shop.js';\nimport { createStatusFeature } from '../resources/status.js';\nimport type { SubscriptionResource } from '../resources/subscription.js';\nimport type { TelemetryResource } from '../resources/telemetry.js';\nimport type { UsersResource } from '../resources/users.js';\nimport type { VerificationResource } from '../resources/verification.js';\nimport { createResources, type RestResources } from './resources.js';\n\n/** Опции конструктора {@link ItdRestClient}. */\nexport interface RestClientOptions extends RuntimeOptions {\n /**\n * Авторизация. Строка — сокращение для {@link bearerToken}.\n *\n * Без неё доступны только публичные эндпоинты. Токен здесь считается готовым: продлевать\n * его клиент не умеет и на `401` отвечает ошибкой. Сессия, которая входит по паролю\n * и продлевает себя сама, живёт в полном `ItdClient`.\n */\n auth?: string | AuthProvider | undefined;\n}\n\n/**\n * Минимальный клиент REST API итд.com.\n *\n * Тот же конвейер запросов, что и у полного клиента, — с повторами, очередью, плагинами\n * и типизированными ошибками, — но без сессии, потока событий и нескольких аккаунтов.\n * Нужен там, где токен уже есть, а размер поставки важен: серверные интеграции, воркеры,\n * браузерные приложения.\n *\n * @example\n * ```ts\n * import { createRestClient } from 'itd-api/rest';\n *\n * const api = createRestClient({ auth: process.env.ITD_TOKEN });\n * const feed = await api.posts.list({ tab: 'popular' });\n * ```\n */\nexport class ItdRestClient {\n readonly #runtime: ClientRuntime;\n readonly #features: ClientFeatureHost;\n readonly #resources: RestResources;\n /** Общий результат терминальной очистки для идемпотентных повторных вызовов. */\n #disposePromise: Promise<void> | undefined;\n #disposed = false;\n\n /** Профили, подписки, блокировки, приватность. */\n get users(): UsersResource {\n return this.#resources.users;\n }\n\n /** Лента, публикация, реакции, репосты, комментарии к постам. */\n get posts(): PostsResource {\n return this.#resources.posts;\n }\n\n /** Ответы на комментарии и действия над ними. */\n get comments(): CommentsResource {\n return this.#resources.comments;\n }\n\n /** Загрузка файлов и медиа. */\n get files(): FilesResource {\n return this.#resources.files;\n }\n\n /** Уведомления: список, счётчик, отметки о прочтении, настройки. */\n get notifications(): NotificationsResource {\n return this.#resources.notifications;\n }\n\n /** Хэштеги и посты по ним. */\n get hashtags(): HashtagsResource {\n return this.#resources.hashtags;\n }\n\n /** Глобальный поиск по пользователям и хэштегам. */\n get search(): SearchResource {\n return this.#resources.search;\n }\n\n /** Каталог, доставка и заказы магазина ИТД. */\n get shop(): ShopResource {\n return this.#resources.shop;\n }\n\n /** Жалобы на контент и пользователей. */\n get reports(): ReportsResource {\n return this.#resources.reports;\n }\n\n /** Верификация профиля. */\n get verification(): VerificationResource {\n return this.#resources.verification;\n }\n\n /** Подписка и способы оплаты. */\n get subscription(): SubscriptionResource {\n return this.#resources.subscription;\n }\n\n /** Сведения о платформе: версии приложений, изменения, анонсы, баннер события. */\n get platform(): PlatformResource {\n return this.#resources.platform;\n }\n\n /** Телеметрия просмотров. */\n get telemetry(): TelemetryResource {\n return this.#resources.telemetry;\n }\n\n constructor(options: RestClientOptions = {}) {\n const { auth, ...runtimeOptions } = options;\n const catalog = new ExtensibleOperationCatalog(ITD_CATALOG);\n\n this.#runtime = createClientRuntime(runtimeOptions, {\n catalog,\n assertActive: (action) => this.#assertActive(action),\n auth: () => resolveAuthProvider(auth),\n });\n this.#features = createFeatureHost(this.#runtime, {\n catalog,\n assertActive: (action) => this.#assertActive(action),\n });\n const status = this.#features.install(createStatusFeature());\n this.#resources = createResources({\n http: this.#runtime.http,\n files: this.#features.files,\n status,\n createNotifications: (http) => new NotificationsResource(http),\n });\n }\n\n #assertActive(action: string): void {\n if (!this.#disposed) return;\n throw new ItdStateError(\n `Клиент уже окончательно освобождён через dispose(); нельзя ${action}. Создайте новый клиент`,\n );\n }\n\n /** Базовый URL, к которому обращается клиент. */\n get baseUrl(): string {\n return this.#runtime.config.baseUrl;\n }\n\n /**\n * Выполняет произвольный запрос к API.\n *\n * Запасной путь для случаев, когда нужного метода ещё нет или ответ сервера разошёлся\n * с документацией. Проходит через ту же авторизацию, очередь и обработку ошибок.\n *\n * @throws {ItdStateError} если клиент уже освобождён через {@link dispose}\n */\n request<T = unknown>(options: RawRequestOptions): Promise<T> {\n return this.#runtime.http.request<T>({\n ...options,\n operationId: options.operationId ?? 'raw',\n });\n }\n\n /**\n * Остаток серверных лимитов по бакетам, через которые уже проходили запросы.\n *\n * Пустой массив при `rateLimit: false`.\n */\n rateLimitState(): RateLimitBucketState[] {\n return this.#runtime.rateLimitState();\n }\n\n /** Устанавливает REST-модуль с общей обработкой запросов клиента. */\n install<TApi>(feature: ClientFeature<TApi>): TApi {\n return this.#features.install(feature);\n }\n\n /** Устанавливает REST-модуль и добавляет его API в свойство только для чтения. */\n withFeature<const K extends string, TApi>(\n key: K,\n feature: ClientFeature<TApi>,\n ): this & { readonly [P in K]: TApi } {\n this.#assertActive('установить feature');\n if (typeof key !== 'string' || key.trim() === '' || key !== key.trim()) {\n throw new ItdConfigError('Свойство feature должно иметь непустое имя без краевых пробелов');\n }\n if (key === 'then' || key in this) {\n throw new ItdConfigError(`Свойство клиента «${key}» уже занято или зарезервировано`);\n }\n if (!Object.isExtensible(this)) {\n throw new ItdConfigError('Нельзя опубликовать feature на нерасширяемом клиенте');\n }\n\n const api = this.install(feature);\n Object.defineProperty(this, key, {\n value: api,\n enumerable: true,\n configurable: false,\n writable: false,\n });\n return this as this & { readonly [P in K]: TApi };\n }\n\n /** Имена установленных модулей в порядке установки. */\n featureNames(): string[] {\n return this.#features.names();\n }\n\n /** Установлен ли модуль с таким именем. */\n hasFeature(name: string): boolean {\n return this.#features.has(name);\n }\n\n /**\n * Подключает плагин.\n *\n * Сессионная идентичность плагину не передаётся: у клиента с готовым токеном её нет.\n * Плагинам, которые изолируют состояние по аккаунту, нужен полный `ItdClient`.\n *\n * @throws {ItdConfigError} если плагин задан неверно или уже подключён\n * @throws {ItdStateError} если клиент уже освобождён через {@link dispose}\n */\n use(plugin: ClientPlugin): this {\n this.#assertActive('подключить плагин');\n this.#runtime.plugins.add(plugin, {\n baseUrl: this.#runtime.config.baseUrl,\n logger: this.#runtime.config.logger,\n });\n return this;\n }\n\n /**\n * Отключает плагин и освобождает заведённые им ресурсы.\n *\n * @returns `false`, если такого плагина не было\n * @throws {ItdConfigError} если от плагина зависит другой подключённый плагин\n */\n unuse(name: string): Promise<boolean> {\n return this.#runtime.plugins.remove(name);\n }\n\n /** Имена подключённых плагинов в фактическом порядке выполнения обёрток. */\n pluginNames(): string[] {\n return this.#runtime.plugins.names();\n }\n\n /** Подключён ли плагин с таким именем. */\n hasPlugin(name: string): boolean {\n return this.#runtime.plugins.has(name);\n }\n\n /**\n * Регистрирует сервис платформы — домен, отличный от основного.\n *\n * @throws {ItdConfigError} если определение неверно или имя уже занято\n * @throws {ItdStateError} если клиент уже освобождён через {@link dispose}\n */\n defineService(definition: ServiceDefinition): this {\n this.#assertActive('зарегистрировать сервис');\n this.#runtime.services.define(definition);\n return this;\n }\n\n /**\n * Отправляет открытые накопители {@link telemetry} и останавливает очередь запросов.\n *\n * После вызова клиентом можно пользоваться снова. Терминальное освобождение —\n * это {@link dispose}.\n */\n async close(): Promise<void> {\n const errors: unknown[] = [];\n try {\n try {\n await this.#features.close();\n } catch (error) {\n errors.push(error);\n }\n try {\n await this.#resources.closeTelemetry(false);\n } catch (error) {\n errors.push(error);\n }\n } finally {\n this.#runtime.close();\n }\n if (errors.length === 1) throw errors[0];\n if (errors.length > 1) throw new AggregateError(errors, 'Не удалось закрыть клиент');\n }\n\n /**\n * Окончательно освобождает клиент: выполняет {@link close}, отменяет незавершённые\n * запросы и отключает все плагины.\n *\n * Терминальное состояние устанавливается сразу при первом вызове; повторные вызовы\n * возвращают тот же результат очистки.\n *\n * @example\n * ```ts\n * await using api = createRestClient({ auth: token });\n * ```\n */\n dispose(): Promise<void> {\n if (this.#disposePromise) return this.#disposePromise;\n this.#disposed = true;\n this.#disposePromise = this.#dispose();\n return this.#disposePromise;\n }\n\n async #dispose(): Promise<void> {\n const errors: unknown[] = [];\n // Телеметрия уходит через ещё установленные плагины и мимо проверки состояния.\n this.#resources.prepareTelemetryClose();\n try {\n await this.#features.close();\n } catch (error) {\n errors.push(error);\n }\n try {\n await this.#resources.closeTelemetry(true);\n } catch (error) {\n errors.push(error);\n }\n try {\n await this.#features.dispose();\n } catch (error) {\n errors.push(error);\n }\n try {\n this.#runtime.close();\n await this.#runtime.dispose();\n } catch (error) {\n errors.push(error);\n }\n if (errors.length > 0) throw new AggregateError(errors, 'Не удалось освободить клиент');\n }\n\n /** Позволяет использовать клиент с `await using`. */\n [Symbol.asyncDispose](): Promise<void> {\n return this.dispose();\n }\n\n static {\n installAsyncDisposeFallback(ItdRestClient);\n }\n}\n\n/** Приводит опцию `auth` к провайдеру конвейера. */\nfunction resolveAuthProvider(auth: RestClientOptions['auth']): AuthProvider {\n if (auth === undefined) return anonymousAuth();\n return typeof auth === 'string' ? bearerToken(auth) : auth;\n}\n\n/**\n * Создаёт минимальный клиент REST API. Равнозначно конструктору {@link ItdRestClient}.\n *\n * @example\n * ```ts\n * const api = createRestClient({ auth: token, rateLimit: { concurrency: 4 } });\n * ```\n */\nexport function createRestClient(options: RestClientOptions = {}): ItdRestClient {\n return new ItdRestClient(options);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwDA,IAAa,gBAAb,MAAa,cAAc;CACzB;CACA;CACA;;CAEA;CACA,YAAY;;CAGZ,IAAI,QAAuB;EACzB,OAAO,KAAKE,WAAW;CACzB;;CAGA,IAAI,QAAuB;EACzB,OAAO,KAAKA,WAAW;CACzB;;CAGA,IAAI,WAA6B;EAC/B,OAAO,KAAKA,WAAW;CACzB;;CAGA,IAAI,QAAuB;EACzB,OAAO,KAAKA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AC1E,IAAI,SAAS,KAAA,GAAW,OAAO,cAAc;CAC7C,OAAO,OAAO,SAAS,WAAW,YAAY,IAAI,IAAI;AACxD;;;;;;;;;AAUA,SAAgB,iBAAiB,UAA6B,CAAC,GAAkB;CAC/E,OAAO,IAAI,cAAc,OAAO;AAClC"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/rest/client.ts"],"sourcesContent":["import { installAsyncDisposeFallback } from '../core/async-dispose.js';\nimport { type AuthProvider, anonymousAuth, bearerToken } from '../core/auth-provider.js';\nimport { ItdConfigError, ItdStateError } from '../core/errors.js';\nimport { type ClientRuntime, createClientRuntime } from '../core/execution/client-runtime.js';\nimport { ExtensibleOperationCatalog } from '../core/feature-catalog.js';\nimport { type ClientFeatureHost, createFeatureHost } from '../core/feature-host.js';\nimport type { ClientFeature } from '../core/features.js';\nimport type { RawRequestOptions, RuntimeOptions } from '../core/options.js';\nimport type { ClientPlugin } from '../core/plugins/contracts.js';\nimport type { RateLimitBucketState } from '../core/scheduling/rate-limit.js';\nimport type { ServiceDefinition } from '../core/services.js';\nimport { ITD_CATALOG } from '../domain/catalog.js';\nimport type { CommentsResource } from '../resources/comments.js';\nimport type { FilesResource } from '../resources/files.js';\nimport type { HashtagsResource } from '../resources/hashtags.js';\nimport { NotificationsResource } from '../resources/notifications.js';\nimport type { PlatformResource } from '../resources/platform.js';\nimport type { PostsResource } from '../resources/posts.js';\nimport type { ReportsResource } from '../resources/reports.js';\nimport type { SearchResource } from '../resources/search.js';\nimport type { ShopResource } from '../resources/shop.js';\nimport { createStatusFeature } from '../resources/status.js';\nimport type { SubscriptionResource } from '../resources/subscription.js';\nimport type { TelemetryResource } from '../resources/telemetry.js';\nimport type { UsersResource } from '../resources/users.js';\nimport type { VerificationResource } from '../resources/verification.js';\nimport { createResources, type RestResources } from './resources.js';\n\n/** Опции конструктора {@link ItdRestClient}. */\nexport interface RestClientOptions extends RuntimeOptions {\n /**\n * Авторизация. Строка — сокращение для {@link bearerToken}.\n *\n * Без неё доступны только публичные эндпоинты. Токен здесь считается готовым: продлевать\n * его клиент не умеет и на `401` отвечает ошибкой. Сессия, которая входит по паролю\n * и продлевает себя сама, живёт в полном `ItdClient`.\n */\n auth?: string | AuthProvider | undefined;\n}\n\n/**\n * Минимальный клиент REST API итд.com.\n *\n * Тот же конвейер запросов, что и у полного клиента, — с повторами, очередью, плагинами\n * и типизированными ошибками, — но без сессии, потока событий и нескольких аккаунтов.\n * Нужен там, где токен уже есть, а размер поставки важен: серверные интеграции, воркеры,\n * браузерные приложения.\n *\n * @example\n * ```ts\n * import { createRestClient } from 'itd-api/rest';\n *\n * const api = createRestClient({ auth: process.env.ITD_TOKEN });\n * const feed = await api.posts.list({ tab: 'popular' });\n * ```\n */\nexport class ItdRestClient {\n readonly #runtime: ClientRuntime;\n readonly #features: ClientFeatureHost;\n readonly #resources: RestResources;\n /** Общий результат терминальной очистки для идемпотентных повторных вызовов. */\n #disposePromise: Promise<void> | undefined;\n #disposed = false;\n\n /** Профили, подписки, блокировки, приватность. */\n get users(): UsersResource {\n return this.#resources.users;\n }\n\n /** Лента, публикация, реакции, репосты, комментарии к постам. */\n get posts(): PostsResource {\n return this.#resources.posts;\n }\n\n /** Ответы на комментарии и действия над ними. */\n get comments(): CommentsResource {\n return this.#resources.comments;\n }\n\n /** Загрузка файлов и медиа. */\n get files(): FilesResource {\n return this.#resources.files;\n }\n\n /** Уведомления: список, счётчик, отметки о прочтении, настройки. */\n get notifications(): NotificationsResource {\n return this.#resources.notifications;\n }\n\n /** Хэштеги и посты по ним. */\n get hashtags(): HashtagsResource {\n return this.#resources.hashtags;\n }\n\n /** Глобальный поиск по пользователям и хэштегам. */\n get search(): SearchResource {\n return this.#resources.search;\n }\n\n /** Каталог, доставка и заказы магазина ИТД. */\n get shop(): ShopResource {\n return this.#resources.shop;\n }\n\n /** Жалобы на контент и пользователей. */\n get reports(): ReportsResource {\n return this.#resources.reports;\n }\n\n /** Верификация профиля. */\n get verification(): VerificationResource {\n return this.#resources.verification;\n }\n\n /** Подписка и способы оплаты. */\n get subscription(): SubscriptionResource {\n return this.#resources.subscription;\n }\n\n /** Сведения о платформе: версии приложений, изменения, анонсы, баннер события. */\n get platform(): PlatformResource {\n return this.#resources.platform;\n }\n\n /** Телеметрия просмотров. */\n get telemetry(): TelemetryResource {\n return this.#resources.telemetry;\n }\n\n constructor(options: RestClientOptions = {}) {\n const { auth, ...runtimeOptions } = options;\n const catalog = new ExtensibleOperationCatalog(ITD_CATALOG);\n\n this.#runtime = createClientRuntime(runtimeOptions, {\n catalog,\n assertActive: (action) => this.#assertActive(action),\n auth: () => resolveAuthProvider(auth),\n });\n this.#features = createFeatureHost(this.#runtime, {\n catalog,\n assertActive: (action) => this.#assertActive(action),\n });\n const status = this.#features.install(createStatusFeature());\n this.#resources = createResources({\n http: this.#runtime.http,\n files: this.#features.files,\n status,\n createNotifications: (http) => new NotificationsResource(http),\n });\n }\n\n #assertActive(action: string): void {\n if (!this.#disposed) return;\n throw new ItdStateError(\n `Клиент уже окончательно освобождён через dispose(); нельзя ${action}. Создайте новый клиент`,\n );\n }\n\n /** Базовый URL, к которому обращается клиент. */\n get baseUrl(): string {\n return this.#runtime.config.baseUrl;\n }\n\n /**\n * Выполняет произвольный запрос к API.\n *\n * Запасной путь для случаев, когда нужного метода ещё нет или ответ сервера разошёлся\n * с документацией. Проходит через ту же авторизацию, очередь и обработку ошибок.\n *\n * @throws {ItdStateError} если клиент уже освобождён через {@link dispose}\n */\n request<T = unknown>(options: RawRequestOptions): Promise<T> {\n return this.#runtime.http.request<T>({\n ...options,\n operationId: options.operationId ?? 'raw',\n });\n }\n\n /**\n * Остаток серверных лимитов по бакетам, через которые уже проходили запросы.\n *\n * Пустой массив при `rateLimit: false`.\n */\n rateLimitState(): RateLimitBucketState[] {\n return this.#runtime.rateLimitState();\n }\n\n /** Устанавливает REST-модуль с общей обработкой запросов клиента. */\n install<TApi>(feature: ClientFeature<TApi>): TApi {\n return this.#features.install(feature);\n }\n\n /** Устанавливает REST-модуль и добавляет его API в свойство только для чтения. */\n withFeature<const K extends string, TApi>(\n key: K,\n feature: ClientFeature<TApi>,\n ): this & { readonly [P in K]: TApi } {\n this.#assertActive('установить feature');\n if (typeof key !== 'string' || key.trim() === '' || key !== key.trim()) {\n throw new ItdConfigError('Свойство feature должно иметь непустое имя без краевых пробелов');\n }\n if (key === 'then' || key in this) {\n throw new ItdConfigError(`Свойство клиента «${key}» уже занято или зарезервировано`);\n }\n if (!Object.isExtensible(this)) {\n throw new ItdConfigError('Нельзя опубликовать feature на нерасширяемом клиенте');\n }\n\n const api = this.install(feature);\n Object.defineProperty(this, key, {\n value: api,\n enumerable: true,\n configurable: false,\n writable: false,\n });\n return this as this & { readonly [P in K]: TApi };\n }\n\n /** Имена установленных модулей в порядке установки. */\n featureNames(): string[] {\n return this.#features.names();\n }\n\n /** Установлен ли модуль с таким именем. */\n hasFeature(name: string): boolean {\n return this.#features.has(name);\n }\n\n /**\n * Подключает плагин.\n *\n * Сессионная идентичность плагину не передаётся: у клиента с готовым токеном её нет.\n * Плагинам, которые изолируют состояние по аккаунту, нужен полный `ItdClient`.\n *\n * @throws {ItdConfigError} если плагин задан неверно или уже подключён\n * @throws {ItdStateError} если клиент уже освобождён через {@link dispose}\n */\n use(plugin: ClientPlugin): this {\n this.#assertActive('подключить плагин');\n this.#runtime.plugins.add(plugin, {\n baseUrl: this.#runtime.config.baseUrl,\n logger: this.#runtime.config.logger,\n });\n return this;\n }\n\n /**\n * Отключает плагин и освобождает заведённые им ресурсы.\n *\n * @returns `false`, если такого плагина не было\n * @throws {ItdConfigError} если от плагина зависит другой подключённый плагин\n */\n unuse(name: string): Promise<boolean> {\n return this.#runtime.plugins.remove(name);\n }\n\n /** Имена подключённых плагинов в фактическом порядке выполнения обёрток. */\n pluginNames(): string[] {\n return this.#runtime.plugins.names();\n }\n\n /** Подключён ли плагин с таким именем. */\n hasPlugin(name: string): boolean {\n return this.#runtime.plugins.has(name);\n }\n\n /**\n * Регистрирует сервис платформы — домен, отличный от основного.\n *\n * @throws {ItdConfigError} если определение неверно или имя уже занято\n * @throws {ItdStateError} если клиент уже освобождён через {@link dispose}\n */\n defineService(definition: ServiceDefinition): this {\n this.#assertActive('зарегистрировать сервис');\n this.#runtime.services.define(definition);\n return this;\n }\n\n /**\n * Отправляет открытые накопители {@link telemetry} и останавливает очередь запросов.\n *\n * После вызова клиентом можно пользоваться снова. Терминальное освобождение —\n * это {@link dispose}.\n */\n async close(): Promise<void> {\n const errors: unknown[] = [];\n try {\n try {\n await this.#features.close();\n } catch (error) {\n errors.push(error);\n }\n try {\n await this.#resources.closeTelemetry(false);\n } catch (error) {\n errors.push(error);\n }\n } finally {\n this.#runtime.close();\n }\n if (errors.length === 1) throw errors[0];\n if (errors.length > 1) throw new AggregateError(errors, 'Не удалось закрыть клиент');\n }\n\n /**\n * Окончательно освобождает клиент: выполняет {@link close}, отменяет незавершённые\n * запросы и отключает все плагины.\n *\n * Терминальное состояние устанавливается сразу при первом вызове; повторные вызовы\n * возвращают тот же результат очистки.\n *\n * @example\n * ```ts\n * await using api = createRestClient({ auth: token });\n * ```\n */\n dispose(): Promise<void> {\n if (this.#disposePromise) return this.#disposePromise;\n this.#disposed = true;\n this.#disposePromise = this.#dispose();\n return this.#disposePromise;\n }\n\n async #dispose(): Promise<void> {\n const errors: unknown[] = [];\n // Телеметрия уходит через ещё установленные плагины и мимо проверки состояния.\n this.#resources.prepareTelemetryClose();\n try {\n await this.#features.close();\n } catch (error) {\n errors.push(error);\n }\n try {\n await this.#resources.closeTelemetry(true);\n } catch (error) {\n errors.push(error);\n }\n try {\n await this.#features.dispose();\n } catch (error) {\n errors.push(error);\n }\n try {\n this.#runtime.close();\n await this.#runtime.dispose();\n } catch (error) {\n errors.push(error);\n }\n if (errors.length > 0) throw new AggregateError(errors, 'Не удалось освободить клиент');\n }\n\n /** Позволяет использовать клиент с `await using`. */\n [Symbol.asyncDispose](): Promise<void> {\n return this.dispose();\n }\n\n static {\n installAsyncDisposeFallback(ItdRestClient);\n }\n}\n\n/** Приводит опцию `auth` к провайдеру конвейера. */\nfunction resolveAuthProvider(auth: RestClientOptions['auth']): AuthProvider {\n if (auth === undefined) return anonymousAuth();\n return typeof auth === 'string' ? bearerToken(auth) : auth;\n}\n\n/**\n * Создаёт минимальный клиент REST API. Равнозначно конструктору {@link ItdRestClient}.\n *\n * @example\n * ```ts\n * const api = createRestClient({ auth: token, rateLimit: { concurrency: 4 } });\n * ```\n */\nexport function createRestClient(options: RestClientOptions = {}): ItdRestClient {\n return new ItdRestClient(options);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwDA,IAAa,gBAAb,MAAa,cAAc;CACzB;CACA;CACA;;CAEA;CACA,YAAY;;CAGZ,IAAI,QAAuB;EACzB,OAAO,KAAK,WAAW;CACzB;;CAGA,IAAI,QAAuB;EACzB,OAAO,KAAK,WAAW;CACzB;;CAGA,IAAI,WAA6B;EAC/B,OAAO,KAAK,WAAW;CACzB;;CAGA,IAAI,QAAuB;EACzB,OAAO,KAAK,WAAW;CACzB;;CAGA,IAAI,gBAAuC;EACzC,OAAO,KAAK,WAAW;CACzB;;CAGA,IAAI,WAA6B;EAC/B,OAAO,KAAK,WAAW;CACzB;;CAGA,IAAI,SAAyB;EAC3B,OAAO,KAAK,WAAW;CACzB;;CAGA,IAAI,OAAqB;EACvB,OAAO,KAAK,WAAW;CACzB;;CAGA,IAAI,UAA2B;EAC7B,OAAO,KAAK,WAAW;CACzB;;CAGA,IAAI,eAAqC;EACvC,OAAO,KAAK,WAAW;CACzB;;CAGA,IAAI,eAAqC;EACvC,OAAO,KAAK,WAAW;CACzB;;CAGA,IAAI,WAA6B;EAC/B,OAAO,KAAK,WAAW;CACzB;;CAGA,IAAI,YAA+B;EACjC,OAAO,KAAK,WAAW;CACzB;CAEA,YAAY,UAA6B,CAAC,GAAG;EAC3C,MAAM,EAAE,MAAM,GAAG,mBAAmB;EACpC,MAAM,UAAU,IAAI,2BAA2B,WAAW;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AsB;EACtC,IAAI;GACF,MAAM,KAAK,UAAU,MAAM;EAC7B,SAAS,OAAO;GACd,OAAO,KAAK,KAAK;EACnB;EACA,IAAI;GACF,MAAM,KAAK,WAAW,eAAe,IAAI;EAC3C,SAAS,OAAO;GACd,OAAO,KAAK,KAAK;EACnB;EACA,IAAI;GACF,MAAM,KAAK,UAAU,QAAQ;EAC/B,SAAS,OAAO;GACd,OAAO,KAAK,KAAK;EACnB;EACA,IAAI;GACF,KAAK,SAAS,MAAM;GACpB,MAAM,KAAK,SAAS,QAAQ;EAC9B,SAAS,OAAO;GACd,OAAO,KAAK,KAAK;EACnB;EACA,IAAI,OAAO,SAAS,GAAG,MAAM,IAAI,eAAe,QAAQ,8BAA8B;CACxF;;CAGA,CAAC,OAAO,gBAA+B;EACrC,OAAO,KAAK,QAAQ;CACtB;CAEA;EACE,4BAA4B,aAAa;CAC3C;AACF;;AAGA,SAAS,oBAAoB,MAA+C;CAC1E,IAAI,SAAS,KAAA,GAAW,OAAO,cAAc;CAC7C,OAAO,OAAO,SAAS,WAAW,YAAY,IAAI,IAAI;AACxD;;;;;;;;;AAUA,SAAgB,iBAAiB,UAA6B,CAAC,GAAkB;CAC/E,OAAO,IAAI,cAAc,OAAO;AAClC"}
@@ -1,4 +1,4 @@
1
- import { Ft as RuntimeOptions, Ht as Logger, It as QueryParams, Ut as ItdClock, a as NotificationEvent, at as ClientConnection, bn as NotificationType, it as Unsubscribe, ot as AuthIdentity, pn as EventChannelStatus, rt as Listener, s as Notification, st as AuthProvider } from "./url-BOi-_mJT.js";
1
+ import { Gt as Logger, Kt as ItdClock, Rt as RuntimeOptions, Tn as NotificationType, a as NotificationEvent, ct as ClientConnection, gn as EventChannelStatus, lt as AuthIdentity, ot as Listener, s as Notification, st as Unsubscribe, ut as AuthProvider, zt as QueryParams } from "./url-_R0oJ7gE.js";
2
2
  //#region src/events/transports/transport.d.ts
3
3
  /** Идентификаторы операций транспорта уведомлений. */
4
4
  type EventOperationId = 'events.notifications.poll.updates' | 'events.notifications.poll.unread';
@@ -693,4 +693,4 @@ declare class WebSocketTransport implements EventTransport {
693
693
  }
694
694
  //#endregion
695
695
  export { EventTransportContext as $, EventHandler as A, NotificationEventContext as B, EventChannelDeps as C, EventSession as D, EventEnqueueOptions as E, EventSequentializer as F, NotificationOfType as G, NotificationEventOfType as H, EventTypeGuard as I, NotificationUpdateOrigin as J, NotificationUpdate as K, runEventMiddleware as L, EventMiddlewareObject as M, EventNext as N, EventSyncReason as O, EventPredicate as P, EventTransport as Q, EventContext as R, EventChannel as S, EventChannelOptions as T, NotificationEventSelector as U, NotificationEventFilter as V, NotificationEventsUpdate as W, UnknownNotificationUpdate as X, NotificationUpdateType as Y, UnreadCountUpdate as Z, createNotificationEventsClient as _, WebSocketTransportOptions as a, NotificationEventsOptions as b, EventErrorContext as c, EventMiddlewareLike as d, EventTransportFrame as et, EventRouteTable as f, NotificationEventsClientOptions as g, NotificationEventsClient as h, WebSocketTransport as i, EventMiddleware as j, ReconnectOptions as k, EventFilter as l, EventRouter as m, WebSocketLike as n, EventComposer as o, EventRouteSelector as p, NotificationUpdateOfType as q, WebSocketOpenFailureClassifier as r, EventErrorBoundary as s, WebSocketImplementationOptions as t, UnauthorizedStreamError as tt, EventMiddlewareGroup as u, NotificationEvents as v, EventChannelEvents as w, NotificationEventsTransport as x, NotificationEventsMap as y, NotificationContext as z };
696
- //# sourceMappingURL=events-CAb9G7Sf.d.ts.map
696
+ //# sourceMappingURL=events-9215JDDd.d.ts.map