itd-api 0.11.0 → 0.12.0

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-Sc75x6rT.d.cts → events-9L0Fonak.d.cts} +2 -2
  24. package/dist/shared/{events-CAb9G7Sf.d.ts → events-BpLAIiMj.d.ts} +2 -2
  25. package/dist/shared/{events-C6tmj8aW.cjs → events-C2DJZyI0.cjs} +246 -56
  26. package/dist/shared/events-C2DJZyI0.cjs.map +1 -0
  27. package/dist/shared/{events-MWNcnfrq.js → events-D1BfefBT.js} +246 -56
  28. package/dist/shared/events-D1BfefBT.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-CrGXcj6L.cjs} +116 -47
  44. package/dist/shared/render-CrGXcj6L.cjs.map +1 -0
  45. package/dist/shared/{render-DRh5_aRe.js → render-D3vSEbLL.js} +116 -47
  46. package/dist/shared/render-D3vSEbLL.js.map +1 -0
  47. package/dist/shared/{render-DM7AhTZW.d.cts → render-Dzw3KeN5.d.cts} +61 -29
  48. package/dist/shared/{render-CBroJPcV.d.ts → render-UsQ1hb2U.d.ts} +61 -29
  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-DTgkCWv5.cjs → url-B21Bdmw_.cjs} +42 -11
  52. package/dist/shared/url-B21Bdmw_.cjs.map +1 -0
  53. package/dist/shared/{url-BOi-_mJT.d.cts → url-C9YADYNg.d.cts} +81 -27
  54. package/dist/shared/{url-BOi-_mJT.d.ts → url-C9YADYNg.d.ts} +81 -27
  55. package/dist/shared/{url-Bg61sk_Y.js → url-Dg1u29cu.js} +25 -12
  56. package/dist/shared/url-Dg1u29cu.js.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
@@ -38,7 +38,7 @@ type Loose<T extends string> = T | (string & {});
38
38
  * Множество закрытое: неизвестное значение сервер отвергнет.
39
39
  */
40
40
  declare const FeedTab: Readonly<{
41
- /** Популярное. Курсор здесь — номер страницы в виде строки (`"2"`, `"6"`…). */
41
+ /** Популярное. Курсор здесь — числовая строка (`"40"`, `"60"`…), а не номер страницы. */
42
42
  readonly Popular: "popular";
43
43
  /** Записи тех, на кого вы подписаны. Курсор — отметка времени последнего поста. */
44
44
  readonly Following: "following";
@@ -193,7 +193,8 @@ type IncidentKind = Loose<(typeof IncidentKind)[keyof typeof IncidentKind]>;
193
193
  /**
194
194
  * Уровень доступа к разделу профиля.
195
195
  *
196
- * Общий набор значений для полей `wallAccess` и `likesVisibility` настроек приватности.
196
+ * Общий набор значений для полей `wallAccess`, `likesVisibility` и `messageAccess` настроек
197
+ * приватности.
197
198
  * Тип открытый: сервер может прислать значение вне этого перечня.
198
199
  */
199
200
  declare const AccessType: Readonly<{
@@ -231,6 +232,33 @@ declare const LikesVisibility: Readonly<{
231
232
  readonly Everyone: "everyone";
232
233
  }>;
233
234
  type LikesVisibility = AccessType;
235
+ /** Почему имя пользователя нельзя занять. Тип открытый: сервер может прислать другую причину. */
236
+ declare const UsernameUnavailableReason: Readonly<{
237
+ /**
238
+ * Имя не подходит под правила: от 3 до 20 латинских букв, цифр и `_`, начинается с буквы,
239
+ * без `_` в конце и двух `_` подряд.
240
+ */
241
+ readonly InvalidFormat: "INVALID_FORMAT";
242
+ }>;
243
+ type UsernameUnavailableReason = Loose<(typeof UsernameUnavailableReason)[keyof typeof UsernameUnavailableReason]>;
244
+ /** Единица времени в {@link LastSeen}. Тип открытый: сервер может прислать другую единицу. */
245
+ declare const LastSeenUnit: Readonly<{
246
+ readonly Minutes: "minutes";
247
+ readonly Hours: "hours";
248
+ }>;
249
+ type LastSeenUnit = Loose<(typeof LastSeenUnit)[keyof typeof LastSeenUnit]>;
250
+ /** Кто может писать пользователю личные сообщения. Псевдоним {@link AccessType}. */
251
+ declare const MessageAccess: Readonly<{
252
+ /** Никто. */
253
+ readonly Nobody: "nobody";
254
+ /** Только взаимные подписки. */
255
+ readonly Mutual: "mutual";
256
+ /** Подписчики. */
257
+ readonly Followers: "followers";
258
+ /** Все. */
259
+ readonly Everyone: "everyone";
260
+ }>;
261
+ type MessageAccess = AccessType;
234
262
  /**
235
263
  * Канонический тип уведомления (новое поколение имён).
236
264
  *
@@ -370,6 +398,7 @@ declare const ItdErrorCode: Readonly<{
370
398
  readonly QR_APPROVER_NOT_ALLOWED: "QR_APPROVER_NOT_ALLOWED";
371
399
  readonly USER_INACTIVE: "USER_INACTIVE";
372
400
  readonly TOO_MANY_REQUESTS: "TOO_MANY_REQUESTS";
401
+ readonly USERNAME_TAKEN: "USERNAME_TAKEN";
373
402
  readonly PROFILE_USERNAME_TAKEN: "PROFILE_USERNAME_TAKEN";
374
403
  readonly PROFILE_USERNAME_RESERVED: "PROFILE_USERNAME_RESERVED";
375
404
  readonly PROFILE_RESTRICTION_ACTIVE: "PROFILE_RESTRICTION_ACTIVE";
@@ -447,7 +476,6 @@ declare const BUCKET_LIMITS: Readonly<{
447
476
  readonly hashtags: 50;
448
477
  readonly users: 40;
449
478
  readonly notifications: 40;
450
- readonly 'files.get': 40;
451
479
  readonly auth: 35;
452
480
  readonly 'auth.refresh': 25;
453
481
  readonly 'auth.qr': 40;
@@ -808,11 +836,6 @@ declare const OPERATIONS: Readonly<{
808
836
  readonly retrySafety: "unsafe";
809
837
  readonly bucket: "files.upload";
810
838
  }>;
811
- readonly 'files.get': Readonly<{
812
- readonly method: "GET";
813
- readonly retrySafety: "safe";
814
- readonly bucket: "files.get";
815
- }>;
816
839
  readonly 'files.remove': Readonly<{
817
840
  readonly method: "DELETE";
818
841
  readonly retrySafety: "unsafe";
@@ -1493,7 +1516,7 @@ interface OperationDefinition extends OperationMetadata {
1493
1516
  //#endregion
1494
1517
  //#region src/core/version.d.ts
1495
1518
  /** Версия библиотеки. Попадает в `User-Agent`. */
1496
- declare const LIBRARY_VERSION = "0.11.0";
1519
+ declare const LIBRARY_VERSION = "0.12.0";
1497
1520
  //#endregion
1498
1521
  //#region src/core/config.d.ts
1499
1522
  /** Базовый URL API итд.com. Домен записан в punycode: `итд.com`. */
@@ -2038,10 +2061,10 @@ interface Author {
2038
2061
  username: string;
2039
2062
  displayName: string;
2040
2063
  /**
2041
- * **Эмодзи, а не картинка.**
2064
+ * Аватар: обычно эмодзи — символ клана (`🩵`, `🦎`), который отрисовывают как текст.
2042
2065
  *
2043
- * На итд.com аватар — это символ клана (`🩵`, `🦎`), а не адрес изображения.
2044
- * Отрисовывать его нужно как текст.
2066
+ * Может быть и адресом изображения. Клан пользователя в этом случае хранится отдельно,
2067
+ * в `clanAvatar` профиля.
2045
2068
  */
2046
2069
  avatar: string;
2047
2070
  /** Пройдена ли верификация. */
@@ -2060,7 +2083,7 @@ interface Actor {
2060
2083
  id: UserId;
2061
2084
  username: string;
2062
2085
  displayName: string;
2063
- /** Эмодзи-аватар, см. {@link Author.avatar}. */
2086
+ /** Аватар: эмодзи или адрес изображения, см. {@link Author.avatar}. */
2064
2087
  avatar: string;
2065
2088
  /** Подписаны ли вы на этого пользователя. */
2066
2089
  isFollowing?: boolean;
@@ -2078,7 +2101,7 @@ interface UserSummary {
2078
2101
  id: UserId;
2079
2102
  username: string;
2080
2103
  displayName: string;
2081
- /** Эмодзи-аватар, см. {@link Author.avatar}. */
2104
+ /** Аватар: эмодзи или адрес изображения, см. {@link Author.avatar}. */
2082
2105
  avatar: string;
2083
2106
  verified: boolean;
2084
2107
  /** Подписаны ли вы. Приходит в списках подписчиков и подписок. */
@@ -2093,8 +2116,13 @@ interface ProfileBase {
2093
2116
  id: UserId;
2094
2117
  username: string;
2095
2118
  displayName: string;
2096
- /** Эмодзи-аватар, см. {@link Author.avatar}. */
2119
+ /** Аватар: эмодзи или адрес изображения, см. {@link Author.avatar}. */
2097
2120
  avatar: string;
2121
+ /**
2122
+ * Эмодзи клана. Совпадает с `avatar`, пока аватар — эмодзи; при аватаре-картинке остаётся
2123
+ * символом клана.
2124
+ */
2125
+ clanAvatar?: string;
2098
2126
  /** URL изображения баннера либо `null`. */
2099
2127
  banner: string | null;
2100
2128
  /** Описание профиля. */
@@ -2140,8 +2168,10 @@ interface AuthUser {
2140
2168
  id: UserId;
2141
2169
  username: string;
2142
2170
  displayName: string;
2143
- /** Эмодзи-аватар, см. {@link Author.avatar}. */
2171
+ /** Аватар: эмодзи или адрес изображения, см. {@link Author.avatar}. */
2144
2172
  avatar: string;
2173
+ /** Эмодзи клана. Совпадает с `avatar`, пока аватар — эмодзи. */
2174
+ clanAvatar?: string;
2145
2175
  bio: string;
2146
2176
  verified: boolean;
2147
2177
  isPhoneVerified: boolean;
@@ -2173,17 +2203,39 @@ interface PublicProfile extends ProfileBase {
2173
2203
  canMessage: boolean;
2174
2204
  /** Сейчас ли пользователь в сети. */
2175
2205
  online: boolean;
2176
- /** Когда был в сети. `null`, если скрыто настройками приватности. */
2177
- lastSeen: IsoDate | null;
2206
+ /** Сколько времени назад был в сети. `null` — пользователь в сети либо скрыл это время. */
2207
+ lastSeen: LastSeen | null;
2208
+ }
2209
+ /**
2210
+ * Время с последнего визита: число и единица, например `{ value: 5, unit: 'minutes' }`.
2211
+ *
2212
+ * @example
2213
+ * ```ts
2214
+ * const { lastSeen } = await itd.users.get('kiow');
2215
+ * if (lastSeen?.unit === LastSeenUnit.Minutes) console.log(`был ${lastSeen.value} мин назад`);
2216
+ * ```
2217
+ */
2218
+ interface LastSeen {
2219
+ value: number;
2220
+ unit: LastSeenUnit;
2178
2221
  }
2179
2222
  /** Профиль: свой либо чужой. Различаются функцией `isMyProfile()`. */
2180
2223
  type Profile = MyProfile | PublicProfile;
2224
+ /** Результат проверки имени пользователя. */
2225
+ interface UsernameAvailability {
2226
+ /** Свободно ли имя. Своё текущее имя сервер считает занятым. */
2227
+ available: boolean;
2228
+ /** Причина, если имя не подходит по формату. У занятого имени причины нет. */
2229
+ reason?: UsernameUnavailableReason;
2230
+ }
2181
2231
  /** Настройки приватности профиля. */
2182
2232
  interface PrivacySettings {
2183
2233
  /** Закрыт ли профиль: подписка требует одобрения. */
2184
2234
  isPrivate: boolean;
2185
2235
  wallAccess: WallAccess;
2186
2236
  likesVisibility: LikesVisibility;
2237
+ /** Кто может писать личные сообщения. */
2238
+ messageAccess: MessageAccess;
2187
2239
  /** Показывать ли время последнего посещения. */
2188
2240
  showLastSeen: boolean;
2189
2241
  }
@@ -2242,24 +2294,26 @@ interface Notification {
2242
2294
  preview: string | null;
2243
2295
  /** Ссылка перехода, предложенная сервером. Обычно точнее её `resolveNotificationUrl()`. */
2244
2296
  clickUrl?: string;
2297
+ /** Заголовок уведомления, если сервер его задал, иначе `null`. */
2298
+ title: string | null;
2299
+ /** Ивент, к которому относится уведомление, иначе `null`. */
2300
+ eventId: string | null;
2301
+ /** До какого момента уведомление актуально, иначе `null`. */
2302
+ expiresAt: IsoDate | null;
2245
2303
  createdAt: IsoDate;
2246
2304
  /** Когда уведомление изменилось — например было прочитано. */
2247
2305
  updatedAt: IsoDate;
2248
2306
  /** Исходный объект как он пришёл от сервера. */
2249
2307
  raw: unknown;
2250
2308
  }
2251
- /**
2252
- * Настройки уведомлений.
2253
- *
2254
- * Сервер отдаёт плоский объект, но исторически знает два набора имён для одних и тех же
2255
- * настроек (`likes` и `reactions`, `comments` и `replies`). При сохранении библиотека
2256
- * отправляет оба, при чтении принимает любой.
2257
- */
2309
+ /** Настройки уведомлений. Сервер отдаёт их плоским объектом. */
2258
2310
  interface NotificationSettings {
2259
2311
  /** Общий выключатель доставки. */
2260
2312
  enabled: boolean;
2261
2313
  /** Звук уведомления. */
2262
2314
  sound: boolean;
2315
+ /** Личные сообщения. */
2316
+ messages: boolean;
2263
2317
  /** Новые подписчики. */
2264
2318
  follows: boolean;
2265
2319
  /** Записи на вашей стене. */
@@ -2362,5 +2416,5 @@ declare function isKnownNotificationType(type: string): boolean;
2362
2416
  */
2363
2417
  declare function resolveNotificationUrl(notification: Notification): string;
2364
2418
  //#endregion
2365
- export { isItdServerError as $, operationRetrySafety as $t, ItdErrorKind as A, RequestOptions as At, ItdStateError as B, RuntimeMode as Bt, ItdApiError as C, ReportTargetType as Cn, PaginationOptions as Ct, ItdConfigError as D, ViewSource as Dn, RawRequestOptions as Dt, ItdAuthError as E, ViewReason as En, RateLimitOptions as Et, ItdNetworkError as F, RuntimeOptions as Ft, isItdAuthError as G, BuiltInOperationId as Gt, ItdValidationError as H, Logger as Ht, ItdNotFoundError as I, QueryParams as It, isItdFileError as J, OPERATIONS as Jt, isItdConflictError as K, CustomOperationId as Kt, ItdPhoneVerificationError as L, QueryValue as Lt, ItdFileError as M, RetryContext as Mt, ItdFileErrorReason as N, RetryDecisionContext as Nt, ItdConflictError as O, WallAccess as On, RequestContext as Ot, ItdForbiddenError as P, RetryOptions as Pt, isItdRateLimitError as Q, operationMethod as Qt, ItdRateLimitError as R, ServiceDefinition as Rt, ItdAbortError as S, ReportReason as Sn, OperationRequestOptions as St, ItdApiErrorKind as T, SpanType as Tn, RateLimitBucketOverride as Tt, TimeoutBudget as U, ItdClock as Ut, ItdTimeoutError as V, LogLevel as Vt, isItdApiError as W, systemClock as Wt, isItdNotFoundError as X, isBuiltInOperationId as Xt, isItdForbiddenError as Y, OperationId as Yt, isItdPhoneVerificationError as Z, operationBucket as Zt, PrivacySettings as _, ItdErrorCode as _n, OperationMetadata as _t, NotificationEvent as a, UserId as an, ClientConnection as at, SubscriptionState as b, NotificationType as bn, ClientHooks as bt, NotificationSettings as c, AttachmentType as cn, anonymousAuth as ct, AuthUser as d, CaptchaType as dn, DEFAULT_BASE_URL as dt, BUCKET_LIMITS as en, isItdStateError as et, Author as f, CommentSort as fn, STATUS_SERVICE as ft, PinsResult as g, InteractionType as gn, OperationContract as gt, Pin as h, IncidentKind as hn, OperationAnnotations as ht, formatNotificationText as i, Span as in, Unsubscribe as it, ItdFieldErrors as j, ResponseContext as jt, ItdError as k, RequestExtensions as kt, Actor as l, CaptchaChoice as ln, bearerToken as lt, MyProfile as m, FeedTab as mn, FeatureOperationId as mt, canonicalNotificationType as n, RateLimitBucket as nn, Emitter as nt, normalizeNotification as o, UserRef as on, AuthIdentity as ot, FollowResult as p, EventChannelStatus as pn, LIBRARY_VERSION as pt, isItdError as q, ItdOperationDefinition as qt, isKnownNotificationType as r, IsoDate as rn, Listener as rt, Notification as s, AccessType as sn, AuthProvider as st, resolveNotificationUrl as t, DEFAULT_RATE_LIMIT_BUCKET as tn, isItdValidationError as tt, AuthState as u, CaptchaField as un, tokenProvider as ut, Profile as v, LikesVisibility as vn, OperationMethod as vt, ItdApiErrorInit as w, ServiceState as wn, RateLimitBucketContext as wt, UserSummary as x, QrLocationPrecision as xn, ErrorContextHook as xt, PublicProfile as y, Loose as yn, RetrySafety as yt, ItdServerError as z, RateLimitPacing as zt };
2366
- //# sourceMappingURL=url-BOi-_mJT.d.cts.map
2419
+ export { isItdPhoneVerificationError as $, operationBucket as $t, ItdConflictError as A, UsernameUnavailableReason as An, RequestContext as At, ItdRateLimitError as B, ServiceDefinition as Bt, UsernameAvailability as C, MessageAccess as Cn, ErrorContextHook as Ct, ItdApiErrorKind as D, ReportTargetType as Dn, RateLimitBucketOverride as Dt, ItdApiErrorInit as E, ReportReason as En, RateLimitBucketContext as Et, ItdFileErrorReason as F, RetryDecisionContext as Ft, TimeoutBudget as G, ItdClock as Gt, ItdStateError as H, RuntimeMode as Ht, ItdForbiddenError as I, RetryOptions as It, isItdConflictError as J, CustomOperationId as Jt, isItdApiError as K, systemClock as Kt, ItdNetworkError as L, RuntimeOptions as Lt, ItdErrorKind as M, ViewSource as Mn, RequestOptions as Mt, ItdFieldErrors as N, WallAccess as Nn, ResponseContext as Nt, ItdAuthError as O, ServiceState as On, RateLimitOptions as Ot, ItdFileError as P, RetryContext as Pt, isItdNotFoundError as Q, isBuiltInOperationId as Qt, ItdNotFoundError as R, QueryParams as Rt, UserSummary as S, Loose as Sn, ClientHooks as St, ItdApiError as T, QrLocationPrecision as Tn, PaginationOptions as Tt, ItdTimeoutError as U, LogLevel as Ut, ItdServerError as V, RateLimitPacing as Vt, ItdValidationError as W, Logger as Wt, isItdFileError as X, OPERATIONS as Xt, isItdError as Y, ItdOperationDefinition as Yt, isItdForbiddenError as Z, OperationId as Zt, PinsResult as _, IncidentKind as _n, OperationAnnotations as _t, NotificationEvent as a, IsoDate as an, Listener as at, PublicProfile as b, LastSeenUnit as bn, OperationMethod as bt, NotificationSettings as c, UserRef as cn, AuthIdentity as ct, AuthUser as d, CaptchaChoice as dn, bearerToken as dt, operationMethod as en, isItdRateLimitError as et, Author as f, CaptchaField as fn, tokenProvider as ft, Pin as g, FeedTab as gn, FeatureOperationId as gt, MyProfile as h, EventChannelStatus as hn, LIBRARY_VERSION as ht, formatNotificationText as i, RateLimitBucket as in, Emitter as it, ItdError as j, ViewReason as jn, RequestExtensions as jt, ItdConfigError as k, SpanType as kn, RawRequestOptions as kt, Actor as l, AccessType as ln, AuthProvider as lt, LastSeen as m, CommentSort as mn, STATUS_SERVICE as mt, canonicalNotificationType as n, BUCKET_LIMITS as nn, isItdStateError as nt, normalizeNotification as o, Span as on, Unsubscribe as ot, FollowResult as p, CaptchaType as pn, DEFAULT_BASE_URL as pt, isItdAuthError as q, BuiltInOperationId as qt, isKnownNotificationType as r, DEFAULT_RATE_LIMIT_BUCKET as rn, isItdValidationError as rt, Notification as s, UserId as sn, ClientConnection as st, resolveNotificationUrl as t, operationRetrySafety as tn, isItdServerError as tt, AuthState as u, AttachmentType as un, anonymousAuth as ut, PrivacySettings as v, InteractionType as vn, OperationContract as vt, ItdAbortError as w, NotificationType as wn, OperationRequestOptions as wt, SubscriptionState as x, LikesVisibility as xn, RetrySafety as xt, Profile as y, ItdErrorCode as yn, OperationMetadata as yt, ItdPhoneVerificationError as z, QueryValue as zt };
2420
+ //# sourceMappingURL=url-C9YADYNg.d.cts.map
@@ -38,7 +38,7 @@ type Loose<T extends string> = T | (string & {});
38
38
  * Множество закрытое: неизвестное значение сервер отвергнет.
39
39
  */
40
40
  declare const FeedTab: Readonly<{
41
- /** Популярное. Курсор здесь — номер страницы в виде строки (`"2"`, `"6"`…). */
41
+ /** Популярное. Курсор здесь — числовая строка (`"40"`, `"60"`…), а не номер страницы. */
42
42
  readonly Popular: "popular";
43
43
  /** Записи тех, на кого вы подписаны. Курсор — отметка времени последнего поста. */
44
44
  readonly Following: "following";
@@ -193,7 +193,8 @@ type IncidentKind = Loose<(typeof IncidentKind)[keyof typeof IncidentKind]>;
193
193
  /**
194
194
  * Уровень доступа к разделу профиля.
195
195
  *
196
- * Общий набор значений для полей `wallAccess` и `likesVisibility` настроек приватности.
196
+ * Общий набор значений для полей `wallAccess`, `likesVisibility` и `messageAccess` настроек
197
+ * приватности.
197
198
  * Тип открытый: сервер может прислать значение вне этого перечня.
198
199
  */
199
200
  declare const AccessType: Readonly<{
@@ -231,6 +232,33 @@ declare const LikesVisibility: Readonly<{
231
232
  readonly Everyone: "everyone";
232
233
  }>;
233
234
  type LikesVisibility = AccessType;
235
+ /** Почему имя пользователя нельзя занять. Тип открытый: сервер может прислать другую причину. */
236
+ declare const UsernameUnavailableReason: Readonly<{
237
+ /**
238
+ * Имя не подходит под правила: от 3 до 20 латинских букв, цифр и `_`, начинается с буквы,
239
+ * без `_` в конце и двух `_` подряд.
240
+ */
241
+ readonly InvalidFormat: "INVALID_FORMAT";
242
+ }>;
243
+ type UsernameUnavailableReason = Loose<(typeof UsernameUnavailableReason)[keyof typeof UsernameUnavailableReason]>;
244
+ /** Единица времени в {@link LastSeen}. Тип открытый: сервер может прислать другую единицу. */
245
+ declare const LastSeenUnit: Readonly<{
246
+ readonly Minutes: "minutes";
247
+ readonly Hours: "hours";
248
+ }>;
249
+ type LastSeenUnit = Loose<(typeof LastSeenUnit)[keyof typeof LastSeenUnit]>;
250
+ /** Кто может писать пользователю личные сообщения. Псевдоним {@link AccessType}. */
251
+ declare const MessageAccess: Readonly<{
252
+ /** Никто. */
253
+ readonly Nobody: "nobody";
254
+ /** Только взаимные подписки. */
255
+ readonly Mutual: "mutual";
256
+ /** Подписчики. */
257
+ readonly Followers: "followers";
258
+ /** Все. */
259
+ readonly Everyone: "everyone";
260
+ }>;
261
+ type MessageAccess = AccessType;
234
262
  /**
235
263
  * Канонический тип уведомления (новое поколение имён).
236
264
  *
@@ -370,6 +398,7 @@ declare const ItdErrorCode: Readonly<{
370
398
  readonly QR_APPROVER_NOT_ALLOWED: "QR_APPROVER_NOT_ALLOWED";
371
399
  readonly USER_INACTIVE: "USER_INACTIVE";
372
400
  readonly TOO_MANY_REQUESTS: "TOO_MANY_REQUESTS";
401
+ readonly USERNAME_TAKEN: "USERNAME_TAKEN";
373
402
  readonly PROFILE_USERNAME_TAKEN: "PROFILE_USERNAME_TAKEN";
374
403
  readonly PROFILE_USERNAME_RESERVED: "PROFILE_USERNAME_RESERVED";
375
404
  readonly PROFILE_RESTRICTION_ACTIVE: "PROFILE_RESTRICTION_ACTIVE";
@@ -447,7 +476,6 @@ declare const BUCKET_LIMITS: Readonly<{
447
476
  readonly hashtags: 50;
448
477
  readonly users: 40;
449
478
  readonly notifications: 40;
450
- readonly 'files.get': 40;
451
479
  readonly auth: 35;
452
480
  readonly 'auth.refresh': 25;
453
481
  readonly 'auth.qr': 40;
@@ -808,11 +836,6 @@ declare const OPERATIONS: Readonly<{
808
836
  readonly retrySafety: "unsafe";
809
837
  readonly bucket: "files.upload";
810
838
  }>;
811
- readonly 'files.get': Readonly<{
812
- readonly method: "GET";
813
- readonly retrySafety: "safe";
814
- readonly bucket: "files.get";
815
- }>;
816
839
  readonly 'files.remove': Readonly<{
817
840
  readonly method: "DELETE";
818
841
  readonly retrySafety: "unsafe";
@@ -1493,7 +1516,7 @@ interface OperationDefinition extends OperationMetadata {
1493
1516
  //#endregion
1494
1517
  //#region src/core/version.d.ts
1495
1518
  /** Версия библиотеки. Попадает в `User-Agent`. */
1496
- declare const LIBRARY_VERSION = "0.11.0";
1519
+ declare const LIBRARY_VERSION = "0.12.0";
1497
1520
  //#endregion
1498
1521
  //#region src/core/config.d.ts
1499
1522
  /** Базовый URL API итд.com. Домен записан в punycode: `итд.com`. */
@@ -2038,10 +2061,10 @@ interface Author {
2038
2061
  username: string;
2039
2062
  displayName: string;
2040
2063
  /**
2041
- * **Эмодзи, а не картинка.**
2064
+ * Аватар: обычно эмодзи — символ клана (`🩵`, `🦎`), который отрисовывают как текст.
2042
2065
  *
2043
- * На итд.com аватар — это символ клана (`🩵`, `🦎`), а не адрес изображения.
2044
- * Отрисовывать его нужно как текст.
2066
+ * Может быть и адресом изображения. Клан пользователя в этом случае хранится отдельно,
2067
+ * в `clanAvatar` профиля.
2045
2068
  */
2046
2069
  avatar: string;
2047
2070
  /** Пройдена ли верификация. */
@@ -2060,7 +2083,7 @@ interface Actor {
2060
2083
  id: UserId;
2061
2084
  username: string;
2062
2085
  displayName: string;
2063
- /** Эмодзи-аватар, см. {@link Author.avatar}. */
2086
+ /** Аватар: эмодзи или адрес изображения, см. {@link Author.avatar}. */
2064
2087
  avatar: string;
2065
2088
  /** Подписаны ли вы на этого пользователя. */
2066
2089
  isFollowing?: boolean;
@@ -2078,7 +2101,7 @@ interface UserSummary {
2078
2101
  id: UserId;
2079
2102
  username: string;
2080
2103
  displayName: string;
2081
- /** Эмодзи-аватар, см. {@link Author.avatar}. */
2104
+ /** Аватар: эмодзи или адрес изображения, см. {@link Author.avatar}. */
2082
2105
  avatar: string;
2083
2106
  verified: boolean;
2084
2107
  /** Подписаны ли вы. Приходит в списках подписчиков и подписок. */
@@ -2093,8 +2116,13 @@ interface ProfileBase {
2093
2116
  id: UserId;
2094
2117
  username: string;
2095
2118
  displayName: string;
2096
- /** Эмодзи-аватар, см. {@link Author.avatar}. */
2119
+ /** Аватар: эмодзи или адрес изображения, см. {@link Author.avatar}. */
2097
2120
  avatar: string;
2121
+ /**
2122
+ * Эмодзи клана. Совпадает с `avatar`, пока аватар — эмодзи; при аватаре-картинке остаётся
2123
+ * символом клана.
2124
+ */
2125
+ clanAvatar?: string;
2098
2126
  /** URL изображения баннера либо `null`. */
2099
2127
  banner: string | null;
2100
2128
  /** Описание профиля. */
@@ -2140,8 +2168,10 @@ interface AuthUser {
2140
2168
  id: UserId;
2141
2169
  username: string;
2142
2170
  displayName: string;
2143
- /** Эмодзи-аватар, см. {@link Author.avatar}. */
2171
+ /** Аватар: эмодзи или адрес изображения, см. {@link Author.avatar}. */
2144
2172
  avatar: string;
2173
+ /** Эмодзи клана. Совпадает с `avatar`, пока аватар — эмодзи. */
2174
+ clanAvatar?: string;
2145
2175
  bio: string;
2146
2176
  verified: boolean;
2147
2177
  isPhoneVerified: boolean;
@@ -2173,17 +2203,39 @@ interface PublicProfile extends ProfileBase {
2173
2203
  canMessage: boolean;
2174
2204
  /** Сейчас ли пользователь в сети. */
2175
2205
  online: boolean;
2176
- /** Когда был в сети. `null`, если скрыто настройками приватности. */
2177
- lastSeen: IsoDate | null;
2206
+ /** Сколько времени назад был в сети. `null` — пользователь в сети либо скрыл это время. */
2207
+ lastSeen: LastSeen | null;
2208
+ }
2209
+ /**
2210
+ * Время с последнего визита: число и единица, например `{ value: 5, unit: 'minutes' }`.
2211
+ *
2212
+ * @example
2213
+ * ```ts
2214
+ * const { lastSeen } = await itd.users.get('kiow');
2215
+ * if (lastSeen?.unit === LastSeenUnit.Minutes) console.log(`был ${lastSeen.value} мин назад`);
2216
+ * ```
2217
+ */
2218
+ interface LastSeen {
2219
+ value: number;
2220
+ unit: LastSeenUnit;
2178
2221
  }
2179
2222
  /** Профиль: свой либо чужой. Различаются функцией `isMyProfile()`. */
2180
2223
  type Profile = MyProfile | PublicProfile;
2224
+ /** Результат проверки имени пользователя. */
2225
+ interface UsernameAvailability {
2226
+ /** Свободно ли имя. Своё текущее имя сервер считает занятым. */
2227
+ available: boolean;
2228
+ /** Причина, если имя не подходит по формату. У занятого имени причины нет. */
2229
+ reason?: UsernameUnavailableReason;
2230
+ }
2181
2231
  /** Настройки приватности профиля. */
2182
2232
  interface PrivacySettings {
2183
2233
  /** Закрыт ли профиль: подписка требует одобрения. */
2184
2234
  isPrivate: boolean;
2185
2235
  wallAccess: WallAccess;
2186
2236
  likesVisibility: LikesVisibility;
2237
+ /** Кто может писать личные сообщения. */
2238
+ messageAccess: MessageAccess;
2187
2239
  /** Показывать ли время последнего посещения. */
2188
2240
  showLastSeen: boolean;
2189
2241
  }
@@ -2242,24 +2294,26 @@ interface Notification {
2242
2294
  preview: string | null;
2243
2295
  /** Ссылка перехода, предложенная сервером. Обычно точнее её `resolveNotificationUrl()`. */
2244
2296
  clickUrl?: string;
2297
+ /** Заголовок уведомления, если сервер его задал, иначе `null`. */
2298
+ title: string | null;
2299
+ /** Ивент, к которому относится уведомление, иначе `null`. */
2300
+ eventId: string | null;
2301
+ /** До какого момента уведомление актуально, иначе `null`. */
2302
+ expiresAt: IsoDate | null;
2245
2303
  createdAt: IsoDate;
2246
2304
  /** Когда уведомление изменилось — например было прочитано. */
2247
2305
  updatedAt: IsoDate;
2248
2306
  /** Исходный объект как он пришёл от сервера. */
2249
2307
  raw: unknown;
2250
2308
  }
2251
- /**
2252
- * Настройки уведомлений.
2253
- *
2254
- * Сервер отдаёт плоский объект, но исторически знает два набора имён для одних и тех же
2255
- * настроек (`likes` и `reactions`, `comments` и `replies`). При сохранении библиотека
2256
- * отправляет оба, при чтении принимает любой.
2257
- */
2309
+ /** Настройки уведомлений. Сервер отдаёт их плоским объектом. */
2258
2310
  interface NotificationSettings {
2259
2311
  /** Общий выключатель доставки. */
2260
2312
  enabled: boolean;
2261
2313
  /** Звук уведомления. */
2262
2314
  sound: boolean;
2315
+ /** Личные сообщения. */
2316
+ messages: boolean;
2263
2317
  /** Новые подписчики. */
2264
2318
  follows: boolean;
2265
2319
  /** Записи на вашей стене. */
@@ -2362,5 +2416,5 @@ declare function isKnownNotificationType(type: string): boolean;
2362
2416
  */
2363
2417
  declare function resolveNotificationUrl(notification: Notification): string;
2364
2418
  //#endregion
2365
- export { isItdServerError as $, operationRetrySafety as $t, ItdErrorKind as A, RequestOptions as At, ItdStateError as B, RuntimeMode as Bt, ItdApiError as C, ReportTargetType as Cn, PaginationOptions as Ct, ItdConfigError as D, ViewSource as Dn, RawRequestOptions as Dt, ItdAuthError as E, ViewReason as En, RateLimitOptions as Et, ItdNetworkError as F, RuntimeOptions as Ft, isItdAuthError as G, BuiltInOperationId as Gt, ItdValidationError as H, Logger as Ht, ItdNotFoundError as I, QueryParams as It, isItdFileError as J, OPERATIONS as Jt, isItdConflictError as K, CustomOperationId as Kt, ItdPhoneVerificationError as L, QueryValue as Lt, ItdFileError as M, RetryContext as Mt, ItdFileErrorReason as N, RetryDecisionContext as Nt, ItdConflictError as O, WallAccess as On, RequestContext as Ot, ItdForbiddenError as P, RetryOptions as Pt, isItdRateLimitError as Q, operationMethod as Qt, ItdRateLimitError as R, ServiceDefinition as Rt, ItdAbortError as S, ReportReason as Sn, OperationRequestOptions as St, ItdApiErrorKind as T, SpanType as Tn, RateLimitBucketOverride as Tt, TimeoutBudget as U, ItdClock as Ut, ItdTimeoutError as V, LogLevel as Vt, isItdApiError as W, systemClock as Wt, isItdNotFoundError as X, isBuiltInOperationId as Xt, isItdForbiddenError as Y, OperationId as Yt, isItdPhoneVerificationError as Z, operationBucket as Zt, PrivacySettings as _, ItdErrorCode as _n, OperationMetadata as _t, NotificationEvent as a, UserId as an, ClientConnection as at, SubscriptionState as b, NotificationType as bn, ClientHooks as bt, NotificationSettings as c, AttachmentType as cn, anonymousAuth as ct, AuthUser as d, CaptchaType as dn, DEFAULT_BASE_URL as dt, BUCKET_LIMITS as en, isItdStateError as et, Author as f, CommentSort as fn, STATUS_SERVICE as ft, PinsResult as g, InteractionType as gn, OperationContract as gt, Pin as h, IncidentKind as hn, OperationAnnotations as ht, formatNotificationText as i, Span as in, Unsubscribe as it, ItdFieldErrors as j, ResponseContext as jt, ItdError as k, RequestExtensions as kt, Actor as l, CaptchaChoice as ln, bearerToken as lt, MyProfile as m, FeedTab as mn, FeatureOperationId as mt, canonicalNotificationType as n, RateLimitBucket as nn, Emitter as nt, normalizeNotification as o, UserRef as on, AuthIdentity as ot, FollowResult as p, EventChannelStatus as pn, LIBRARY_VERSION as pt, isItdError as q, ItdOperationDefinition as qt, isKnownNotificationType as r, IsoDate as rn, Listener as rt, Notification as s, AccessType as sn, AuthProvider as st, resolveNotificationUrl as t, DEFAULT_RATE_LIMIT_BUCKET as tn, isItdValidationError as tt, AuthState as u, CaptchaField as un, tokenProvider as ut, Profile as v, LikesVisibility as vn, OperationMethod as vt, ItdApiErrorInit as w, ServiceState as wn, RateLimitBucketContext as wt, UserSummary as x, QrLocationPrecision as xn, ErrorContextHook as xt, PublicProfile as y, Loose as yn, RetrySafety as yt, ItdServerError as z, RateLimitPacing as zt };
2366
- //# sourceMappingURL=url-BOi-_mJT.d.ts.map
2419
+ export { isItdPhoneVerificationError as $, operationBucket as $t, ItdConflictError as A, UsernameUnavailableReason as An, RequestContext as At, ItdRateLimitError as B, ServiceDefinition as Bt, UsernameAvailability as C, MessageAccess as Cn, ErrorContextHook as Ct, ItdApiErrorKind as D, ReportTargetType as Dn, RateLimitBucketOverride as Dt, ItdApiErrorInit as E, ReportReason as En, RateLimitBucketContext as Et, ItdFileErrorReason as F, RetryDecisionContext as Ft, TimeoutBudget as G, ItdClock as Gt, ItdStateError as H, RuntimeMode as Ht, ItdForbiddenError as I, RetryOptions as It, isItdConflictError as J, CustomOperationId as Jt, isItdApiError as K, systemClock as Kt, ItdNetworkError as L, RuntimeOptions as Lt, ItdErrorKind as M, ViewSource as Mn, RequestOptions as Mt, ItdFieldErrors as N, WallAccess as Nn, ResponseContext as Nt, ItdAuthError as O, ServiceState as On, RateLimitOptions as Ot, ItdFileError as P, RetryContext as Pt, isItdNotFoundError as Q, isBuiltInOperationId as Qt, ItdNotFoundError as R, QueryParams as Rt, UserSummary as S, Loose as Sn, ClientHooks as St, ItdApiError as T, QrLocationPrecision as Tn, PaginationOptions as Tt, ItdTimeoutError as U, LogLevel as Ut, ItdServerError as V, RateLimitPacing as Vt, ItdValidationError as W, Logger as Wt, isItdFileError as X, OPERATIONS as Xt, isItdError as Y, ItdOperationDefinition as Yt, isItdForbiddenError as Z, OperationId as Zt, PinsResult as _, IncidentKind as _n, OperationAnnotations as _t, NotificationEvent as a, IsoDate as an, Listener as at, PublicProfile as b, LastSeenUnit as bn, OperationMethod as bt, NotificationSettings as c, UserRef as cn, AuthIdentity as ct, AuthUser as d, CaptchaChoice as dn, bearerToken as dt, operationMethod as en, isItdRateLimitError as et, Author as f, CaptchaField as fn, tokenProvider as ft, Pin as g, FeedTab as gn, FeatureOperationId as gt, MyProfile as h, EventChannelStatus as hn, LIBRARY_VERSION as ht, formatNotificationText as i, RateLimitBucket as in, Emitter as it, ItdError as j, ViewReason as jn, RequestExtensions as jt, ItdConfigError as k, SpanType as kn, RawRequestOptions as kt, Actor as l, AccessType as ln, AuthProvider as lt, LastSeen as m, CommentSort as mn, STATUS_SERVICE as mt, canonicalNotificationType as n, BUCKET_LIMITS as nn, isItdStateError as nt, normalizeNotification as o, Span as on, Unsubscribe as ot, FollowResult as p, CaptchaType as pn, DEFAULT_BASE_URL as pt, isItdAuthError as q, BuiltInOperationId as qt, isKnownNotificationType as r, DEFAULT_RATE_LIMIT_BUCKET as rn, isItdValidationError as rt, Notification as s, UserId as sn, ClientConnection as st, resolveNotificationUrl as t, operationRetrySafety as tn, isItdServerError as tt, AuthState as u, AttachmentType as un, anonymousAuth as ut, PrivacySettings as v, InteractionType as vn, OperationContract as vt, ItdAbortError as w, NotificationType as wn, OperationRequestOptions as wt, SubscriptionState as x, LikesVisibility as xn, RetrySafety as xt, Profile as y, ItdErrorCode as yn, OperationMetadata as yt, ItdPhoneVerificationError as z, QueryValue as zt };
2420
+ //# sourceMappingURL=url-C9YADYNg.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { C as ItdValidationError, N as isItdRateLimitError, S as ItdTimeoutError, T as isItdApiError, _ as ItdNotFoundError, a as ItdAbortError, b as ItdServerError, c as ItdAuthError, d as ItdError, g as ItdNetworkError, h as ItdForbiddenError, i as requireOptionalBoolean, l as ItdConfigError, n as isRecord, o as ItdApiError, p as ItdFileError, r as requireNonNegative, t as isObjectLike, u as ItdConflictError, v as ItdPhoneVerificationError, w as TimeoutBudget, x as ItdStateError, y as ItdRateLimitError } from "./validate-D7_kq3g5.js";
2
- import { C as shouldSendCredentials, E as LogLevel, O as isLevelEnabled, S as resolveFetch, _ as originOf, b as isBlob, d as buildQuery, g as normalizeBaseUrl, h as joinUrl, i as redactHeaders, k as resolveLogger, m as isSameSite, n as redactBody, p as hostOf, s as CookieJar, v as RuntimeMode, w as shouldUseCookieJar, y as createDeviceId } from "./redact-C5oxIvcc.js";
2
+ import { C as shouldSendCredentials, E as LogLevel, O as isLevelEnabled, S as resolveFetch, _ as originOf, b as isBlob, d as buildQuery, g as normalizeBaseUrl, h as joinUrl, i as redactHeaders, k as resolveLogger, m as isSameSite, n as redactBody, p as hostOf, s as CookieJar, v as RuntimeMode, w as shouldUseCookieJar, y as createDeviceId } from "./redact-DSfdmeY7.js";
3
3
  //#region src/core/async-dispose.ts
4
4
  /**
5
5
  * Подставляет метод `await using` там, где `Symbol.asyncDispose` отсутствует.
@@ -64,7 +64,7 @@ const RateLimitPacing = Object.freeze({
64
64
  //#endregion
65
65
  //#region src/core/version.ts
66
66
  /** Версия библиотеки. Попадает в `User-Agent`. */
67
- const LIBRARY_VERSION = "0.11.0";
67
+ const LIBRARY_VERSION = "0.12.0";
68
68
  //#endregion
69
69
  //#region src/core/config.ts
70
70
  /** Базовый URL API итд.com. Домен записан в punycode: `итд.com`. */
@@ -2952,7 +2952,6 @@ const BUCKET_LIMITS = Object.freeze({
2952
2952
  hashtags: 50,
2953
2953
  users: 40,
2954
2954
  notifications: 40,
2955
- "files.get": 40,
2956
2955
  auth: 35,
2957
2956
  "auth.refresh": 25,
2958
2957
  "auth.qr": 40,
@@ -3322,11 +3321,6 @@ const OPERATIONS = freezeOperations({
3322
3321
  retrySafety: RetrySafety.Unsafe,
3323
3322
  bucket: "files.upload"
3324
3323
  },
3325
- "files.get": {
3326
- method: "GET",
3327
- retrySafety: RetrySafety.Safe,
3328
- bucket: "files.get"
3329
- },
3330
3324
  "files.remove": {
3331
3325
  method: "DELETE",
3332
3326
  retrySafety: RetrySafety.Unsafe,
@@ -3577,7 +3571,7 @@ const ITD_CATALOG = Object.freeze({
3577
3571
  * Множество закрытое: неизвестное значение сервер отвергнет.
3578
3572
  */
3579
3573
  const FeedTab = Object.freeze({
3580
- /** Популярное. Курсор здесь — номер страницы в виде строки (`"2"`, `"6"`…). */
3574
+ /** Популярное. Курсор здесь — числовая строка (`"40"`, `"60"`…), а не номер страницы. */
3581
3575
  Popular: "popular",
3582
3576
  /** Записи тех, на кого вы подписаны. Курсор — отметка времени последнего поста. */
3583
3577
  Following: "following",
@@ -3719,7 +3713,8 @@ const IncidentKind = Object.freeze({
3719
3713
  /**
3720
3714
  * Уровень доступа к разделу профиля.
3721
3715
  *
3722
- * Общий набор значений для полей `wallAccess` и `likesVisibility` настроек приватности.
3716
+ * Общий набор значений для полей `wallAccess`, `likesVisibility` и `messageAccess` настроек
3717
+ * приватности.
3723
3718
  * Тип открытый: сервер может прислать значение вне этого перечня.
3724
3719
  */
3725
3720
  const AccessType = Object.freeze({
@@ -3736,6 +3731,20 @@ const AccessType = Object.freeze({
3736
3731
  const WallAccess = AccessType;
3737
3732
  /** Кто видит реакции пользователя. Псевдоним {@link AccessType}. */
3738
3733
  const LikesVisibility = AccessType;
3734
+ /** Почему имя пользователя нельзя занять. Тип открытый: сервер может прислать другую причину. */
3735
+ const UsernameUnavailableReason = Object.freeze({
3736
+ /**
3737
+ * Имя не подходит под правила: от 3 до 20 латинских букв, цифр и `_`, начинается с буквы,
3738
+ * без `_` в конце и двух `_` подряд.
3739
+ */
3740
+ InvalidFormat: "INVALID_FORMAT" });
3741
+ /** Единица времени в {@link LastSeen}. Тип открытый: сервер может прислать другую единицу. */
3742
+ const LastSeenUnit = Object.freeze({
3743
+ Minutes: "minutes",
3744
+ Hours: "hours"
3745
+ });
3746
+ /** Кто может писать пользователю личные сообщения. Псевдоним {@link AccessType}. */
3747
+ const MessageAccess = AccessType;
3739
3748
  /**
3740
3749
  * Канонический тип уведомления (новое поколение имён).
3741
3750
  *
@@ -3871,6 +3880,7 @@ const ItdErrorCode = Object.freeze({
3871
3880
  QR_APPROVER_NOT_ALLOWED: "QR_APPROVER_NOT_ALLOWED",
3872
3881
  USER_INACTIVE: "USER_INACTIVE",
3873
3882
  TOO_MANY_REQUESTS: "TOO_MANY_REQUESTS",
3883
+ USERNAME_TAKEN: "USERNAME_TAKEN",
3874
3884
  PROFILE_USERNAME_TAKEN: "PROFILE_USERNAME_TAKEN",
3875
3885
  PROFILE_USERNAME_RESERVED: "PROFILE_USERNAME_RESERVED",
3876
3886
  PROFILE_RESTRICTION_ACTIVE: "PROFILE_RESTRICTION_ACTIVE",
@@ -3992,6 +4002,9 @@ function normalizeNotification(input) {
3992
4002
  count: typeof payload.count === "number" && payload.count > 0 ? payload.count : 1,
3993
4003
  preview: asString(payload.entityPreview) ?? asString(payload.preview) ?? null,
3994
4004
  ...clickUrl ? { clickUrl } : {},
4005
+ title: asString(payload.title) ?? null,
4006
+ eventId: asString(payload.eventId) ?? null,
4007
+ expiresAt: asString(payload.expiresAt) ?? null,
3995
4008
  createdAt,
3996
4009
  updatedAt: asString(payload.updatedAt) ?? readAt ?? createdAt,
3997
4010
  raw: input
@@ -4249,6 +4262,6 @@ function resolveNotificationUrl(notification) {
4249
4262
  return clickUrl || "/notifications";
4250
4263
  }
4251
4264
  //#endregion
4252
- export { identityResult as $, SpanType as A, operationRetrySafety as B, ItdErrorCode as C, ReportReason as D, QrLocationPrecision as E, OPERATIONS as F, pickArray as G, DEFAULT_RATE_LIMIT_BUCKET as H, defineBuiltInOperation as I, pickObject as J, pickBoolean as K, isBuiltInOperationId as L, ViewSource as M, WallAccess as N, ReportTargetType as O, ITD_CATALOG as P, defineOperation as Q, operationBucket as R, InteractionType as S, NotificationType as T, createClientRuntime as U, BUCKET_LIMITS as V, createApiError as W, OperationMethod as X, pickString as Y, RetrySafety as Z, CaptchaType as _, tokenProvider as a, assertPluginRemovable as at, FeedTab as b, normalizeNotification as c, DEFAULT_STATUS_BASE_URL as ct, canonicalNotificationType as d, LIBRARY_VERSION as dt, voidResult as et, isKnownNotificationType as f, RateLimitPacing as ft, CaptchaField as g, CaptchaChoice as h, installAsyncDisposeFallback as ht, bearerToken as i, RequestQueuePool as it, ViewReason as j, ServiceState as k, readNotificationEvent as l, STATUS_SERVICE as lt, AttachmentType as m, systemClock as mt, formatNotificationText as n, requestAbortError as nt, passthroughOperation as o, orderPluginDefinitions as ot, AccessType as p, createDeadline as pt, pickNumber as q, anonymousAuth as r, mergeService as rt, voidOperation as s, DEFAULT_BASE_URL as st, resolveNotificationUrl as t, createRequestAbortScope as tt, readUnreadCountEvent as u, resolveRateLimit as ut, CommentSort as v, LikesVisibility as w, IncidentKind as x, EventChannelStatus as y, operationMethod as z };
4265
+ export { OperationMethod as $, ReportTargetType as A, isBuiltInOperationId as B, ItdErrorCode as C, NotificationType as D, MessageAccess as E, ViewSource as F, DEFAULT_RATE_LIMIT_BUCKET as G, operationMethod as H, WallAccess as I, pickArray as J, createClientRuntime as K, ITD_CATALOG as L, SpanType as M, UsernameUnavailableReason as N, QrLocationPrecision as O, ViewReason as P, pickString as Q, OPERATIONS as R, InteractionType as S, LikesVisibility as T, operationRetrySafety as U, operationBucket as V, BUCKET_LIMITS as W, pickNumber as X, pickBoolean as Y, pickObject as Z, CaptchaType as _, systemClock as _t, tokenProvider as a, requestAbortError as at, FeedTab as b, normalizeNotification as c, assertPluginRemovable as ct, canonicalNotificationType as d, DEFAULT_STATUS_BASE_URL as dt, RetrySafety as et, isKnownNotificationType as f, STATUS_SERVICE as ft, CaptchaField as g, createDeadline as gt, CaptchaChoice as h, RateLimitPacing as ht, bearerToken as i, createRequestAbortScope as it, ServiceState as j, ReportReason as k, readNotificationEvent as l, orderPluginDefinitions as lt, AttachmentType as m, LIBRARY_VERSION as mt, formatNotificationText as n, identityResult as nt, passthroughOperation as o, mergeService as ot, AccessType as p, resolveRateLimit as pt, createApiError as q, anonymousAuth as r, voidResult as rt, voidOperation as s, RequestQueuePool as st, resolveNotificationUrl as t, defineOperation as tt, readUnreadCountEvent as u, DEFAULT_BASE_URL as ut, CommentSort as v, installAsyncDisposeFallback as vt, LastSeenUnit as w, IncidentKind as x, EventChannelStatus as y, defineBuiltInOperation as z };
4253
4266
 
4254
- //# sourceMappingURL=url-Bg61sk_Y.js.map
4267
+ //# sourceMappingURL=url-Dg1u29cu.js.map