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.
- package/dist/events/index.cjs +3 -3
- package/dist/events/index.d.cts +2 -2
- package/dist/events/index.d.ts +2 -2
- package/dist/events/index.js +3 -3
- package/dist/index.cjs +28 -48
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -19
- package/dist/index.d.ts +23 -19
- package/dist/index.js +26 -49
- package/dist/index.js.map +1 -1
- package/dist/node/index.cjs +2 -2
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +7 -8
- package/dist/node/index.d.ts +7 -8
- package/dist/node/index.js +2 -2
- package/dist/node/index.js.map +1 -1
- package/dist/rest/index.cjs +7 -4
- package/dist/rest/index.cjs.map +1 -1
- package/dist/rest/index.d.cts +5 -5
- package/dist/rest/index.d.ts +5 -5
- package/dist/rest/index.js +5 -5
- package/dist/rest/index.js.map +1 -1
- package/dist/shared/{events-Sc75x6rT.d.cts → events-9L0Fonak.d.cts} +2 -2
- package/dist/shared/{events-CAb9G7Sf.d.ts → events-BpLAIiMj.d.ts} +2 -2
- package/dist/shared/{events-C6tmj8aW.cjs → events-C2DJZyI0.cjs} +246 -56
- package/dist/shared/events-C2DJZyI0.cjs.map +1 -0
- package/dist/shared/{events-MWNcnfrq.js → events-D1BfefBT.js} +246 -56
- package/dist/shared/events-D1BfefBT.js.map +1 -0
- package/dist/shared/key-value-store-DYSPsqwq.cjs.map +1 -1
- package/dist/shared/key-value-store-w1Dn5Pjb.js.map +1 -1
- package/dist/shared/{multi-storage-C7-Gz6Z7.cjs → multi-storage-7Y3KCseI.cjs} +2 -2
- package/dist/shared/multi-storage-7Y3KCseI.cjs.map +1 -0
- package/dist/shared/{multi-storage-BLBrGN9Q.js → multi-storage-DiBSx64p.js} +2 -2
- package/dist/shared/multi-storage-DiBSx64p.js.map +1 -0
- package/dist/shared/{options-5tywTYId.cjs → options-D5ttspWk.cjs} +2 -2
- package/dist/shared/{options-5tywTYId.cjs.map → options-D5ttspWk.cjs.map} +1 -1
- package/dist/shared/{options-BerKicCs.js → options-DLlaETn_.js} +2 -2
- package/dist/shared/{options-BerKicCs.js.map → options-DLlaETn_.js.map} +1 -1
- package/dist/shared/{redact-DoC7lSsp.cjs → redact-BbhtA9o-.cjs} +13 -3
- package/dist/shared/redact-BbhtA9o-.cjs.map +1 -0
- package/dist/shared/{redact-C5oxIvcc.js → redact-DSfdmeY7.js} +13 -3
- package/dist/shared/redact-DSfdmeY7.js.map +1 -0
- package/dist/shared/{render-Dnc84B4M.cjs → render-CrGXcj6L.cjs} +116 -47
- package/dist/shared/render-CrGXcj6L.cjs.map +1 -0
- package/dist/shared/{render-DRh5_aRe.js → render-D3vSEbLL.js} +116 -47
- package/dist/shared/render-D3vSEbLL.js.map +1 -0
- package/dist/shared/{render-DM7AhTZW.d.cts → render-Dzw3KeN5.d.cts} +61 -29
- package/dist/shared/{render-CBroJPcV.d.ts → render-UsQ1hb2U.d.ts} +61 -29
- package/dist/shared/storage-86wiHeXD.js.map +1 -1
- package/dist/shared/storage-CIjejZDt.cjs.map +1 -1
- package/dist/shared/{url-DTgkCWv5.cjs → url-B21Bdmw_.cjs} +42 -11
- package/dist/shared/url-B21Bdmw_.cjs.map +1 -0
- package/dist/shared/{url-BOi-_mJT.d.cts → url-C9YADYNg.d.cts} +81 -27
- package/dist/shared/{url-BOi-_mJT.d.ts → url-C9YADYNg.d.ts} +81 -27
- package/dist/shared/{url-Bg61sk_Y.js → url-Dg1u29cu.js} +25 -12
- package/dist/shared/url-Dg1u29cu.js.map +1 -0
- package/dist/web/index.cjs.map +1 -1
- package/dist/web/index.d.cts +4 -5
- package/dist/web/index.d.ts +4 -5
- package/dist/web/index.js.map +1 -1
- package/package.json +11 -11
- package/dist/shared/events-C6tmj8aW.cjs.map +0 -1
- package/dist/shared/events-MWNcnfrq.js.map +0 -1
- package/dist/shared/multi-storage-BLBrGN9Q.js.map +0 -1
- package/dist/shared/multi-storage-C7-Gz6Z7.cjs.map +0 -1
- package/dist/shared/redact-C5oxIvcc.js.map +0 -1
- package/dist/shared/redact-DoC7lSsp.cjs.map +0 -1
- package/dist/shared/render-DRh5_aRe.js.map +0 -1
- package/dist/shared/render-Dnc84B4M.cjs.map +0 -1
- package/dist/shared/url-Bg61sk_Y.js.map +0 -1
- package/dist/shared/url-DTgkCWv5.cjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as OperationMethod, A as ReportTargetType, J as pickArray, M as SpanType, Q as pickString, S as InteractionType, X as pickNumber, Y as pickBoolean, Z as pickObject, c as normalizeNotification, dt as DEFAULT_STATUS_BASE_URL, et as RetrySafety, ft as STATUS_SERVICE, gt as createDeadline, k as ReportReason, nt as identityResult, o as passthroughOperation, ot as mergeService, rt as voidResult, s as voidOperation, tt as defineOperation, z as defineBuiltInOperation } from "./url-Dg1u29cu.js";
|
|
2
2
|
import { T as isItdApiError, a as ItdAbortError, d as ItdError, l as ItdConfigError, m as ItdFileErrorReason, n as isRecord, p as ItdFileError, x as ItdStateError } from "./validate-D7_kq3g5.js";
|
|
3
|
-
import { a as redactUrl, b as isBlob, f as encodePathSegment, r as redactErrorCause, x as isFile, y as createDeviceId } from "./redact-
|
|
4
|
-
import { a as fileTooLarge, c as FileTransferMode, i as isReadableByteStream, n as boundedFileStream, o as optionalBytes, r as isBoundedFileStream, s as DEFAULT_URL_FILE_MAX_BYTES, t as resolveFileStreamOptions } from "./options-
|
|
3
|
+
import { a as redactUrl, b as isBlob, f as encodePathSegment, r as redactErrorCause, x as isFile, y as createDeviceId } from "./redact-DSfdmeY7.js";
|
|
4
|
+
import { a as fileTooLarge, c as FileTransferMode, i as isReadableByteStream, n as boundedFileStream, o as optionalBytes, r as isBoundedFileStream, s as DEFAULT_URL_FILE_MAX_BYTES, t as resolveFileStreamOptions } from "./options-DLlaETn_.js";
|
|
5
5
|
import { r as createKeyValueStore } from "./key-value-store-w1Dn5Pjb.js";
|
|
6
6
|
//#region src/core/feature-catalog.ts
|
|
7
7
|
/**
|
|
@@ -1110,6 +1110,7 @@ const NOTIFICATIONS_UPDATE_SETTINGS = defineBuiltInOperation("notifications.upda
|
|
|
1110
1110
|
const NOTIFICATION_SETTING_KEYS = [
|
|
1111
1111
|
"enabled",
|
|
1112
1112
|
"sound",
|
|
1113
|
+
"messages",
|
|
1113
1114
|
"follows",
|
|
1114
1115
|
"wallPosts",
|
|
1115
1116
|
"likes",
|
|
@@ -1125,8 +1126,8 @@ const READ_BATCH_SIZE = 20;
|
|
|
1125
1126
|
/**
|
|
1126
1127
|
* Читает настройки уведомлений.
|
|
1127
1128
|
*
|
|
1128
|
-
* Сервер отдаёт плоский объект: `enabled`, `sound`, `
|
|
1129
|
-
* `comments`, `mentions`. Отсутствующая настройка считается включённой — так же
|
|
1129
|
+
* Сервер отдаёт плоский объект: `enabled`, `sound`, `messages`, `follows`, `wallPosts`,
|
|
1130
|
+
* `likes`, `comments`, `mentions`. Отсутствующая настройка считается включённой — так же
|
|
1130
1131
|
* ведёт себя сайт итд.com.
|
|
1131
1132
|
*/
|
|
1132
1133
|
function readSettings(body) {
|
|
@@ -1249,23 +1250,42 @@ var NotificationsResource = class extends BaseResource {
|
|
|
1249
1250
|
};
|
|
1250
1251
|
//#endregion
|
|
1251
1252
|
//#region src/domain/time.ts
|
|
1252
|
-
const NAIVE_STAMP = /^(\d{4}-\d{2}-\d{2}) (\d{2}:\d{2}:\d{2}(?:\.\d+)?)$/;
|
|
1253
1253
|
/**
|
|
1254
|
-
*
|
|
1254
|
+
* Отметка времени PostgreSQL: `2026-07-23 23:14:25`, возможно с долями секунды и смещением
|
|
1255
|
+
* пояса (`+03`, `+05:30`).
|
|
1256
|
+
*/
|
|
1257
|
+
const PG_STAMP = /^(\d{4}-\d{2}-\d{2}) (\d{2}:\d{2}:\d{2})(\.\d+)?(?:([+-]\d{2})(?::?(\d{2}))?)?$/;
|
|
1258
|
+
/** Существует ли дата `ГГГГ-ММ-ДД` в календаре: `Date.parse` молча переносит `02-30` на март. */
|
|
1259
|
+
function isCalendarDate(date) {
|
|
1260
|
+
const [year = 0, month = 0, day = 0] = date.split("-").map(Number);
|
|
1261
|
+
const parsed = new Date(Date.UTC(year, month - 1, day));
|
|
1262
|
+
return parsed.getUTCMonth() === month - 1 && parsed.getUTCDate() === day;
|
|
1263
|
+
}
|
|
1264
|
+
/**
|
|
1265
|
+
* Приводит отметку времени PostgreSQL к ISO-8601 в UTC.
|
|
1255
1266
|
*
|
|
1256
|
-
*
|
|
1267
|
+
* Отметку без пояса считает временем UTC и сохраняет её доли секунды. Отметку со смещением
|
|
1268
|
+
* переводит в UTC с точностью до миллисекунд. Строку другого вида возвращает нетронутой.
|
|
1257
1269
|
*
|
|
1258
1270
|
* @example
|
|
1259
1271
|
* ```ts
|
|
1260
|
-
* utcStampToIso('2026-07-23 23:14:25');
|
|
1261
|
-
* utcStampToIso('2026-
|
|
1272
|
+
* utcStampToIso('2026-07-23 23:14:25'); // '2026-07-23T23:14:25Z'
|
|
1273
|
+
* utcStampToIso('2026-10-04 22:32:04.381097+03'); // '2026-10-04T19:32:04.381Z'
|
|
1274
|
+
* utcStampToIso('2026-07-23T23:14:25Z'); // без изменений
|
|
1262
1275
|
* ```
|
|
1263
1276
|
*/
|
|
1264
1277
|
function utcStampToIso(value) {
|
|
1265
|
-
const match = typeof value === "string" ?
|
|
1278
|
+
const match = typeof value === "string" ? PG_STAMP.exec(value) : null;
|
|
1266
1279
|
if (!match) return value;
|
|
1267
|
-
const
|
|
1268
|
-
|
|
1280
|
+
const [, date = "", time, fraction = "", offsetHours, offsetMinutes = "00"] = match;
|
|
1281
|
+
if (!isCalendarDate(date)) return value;
|
|
1282
|
+
if (offsetHours === void 0) {
|
|
1283
|
+
const iso = `${date}T${time}${fraction}Z`;
|
|
1284
|
+
return Number.isFinite(Date.parse(iso)) ? iso : value;
|
|
1285
|
+
}
|
|
1286
|
+
const millis = fraction ? `.${fraction.slice(1, 4).padEnd(3, "0")}` : "";
|
|
1287
|
+
const parsed = Date.parse(`${date}T${time}${millis}${offsetHours}:${offsetMinutes}`);
|
|
1288
|
+
return Number.isFinite(parsed) ? new Date(parsed).toISOString() : value;
|
|
1269
1289
|
}
|
|
1270
1290
|
/**
|
|
1271
1291
|
* Разбирает дату API в объект `Date`.
|
|
@@ -1485,9 +1505,55 @@ function resolveComment(input, allowReplyTo = false) {
|
|
|
1485
1505
|
return resolved;
|
|
1486
1506
|
}
|
|
1487
1507
|
//#endregion
|
|
1508
|
+
//#region src/domain/content.ts
|
|
1509
|
+
/** Поле с датой, приведённой к ISO-8601; без строкового значения поле не появляется. */
|
|
1510
|
+
function isoField(key, value) {
|
|
1511
|
+
return typeof value === "string" ? { [key]: utcStampToIso(value) } : {};
|
|
1512
|
+
}
|
|
1513
|
+
/** Приводит даты комментария и его ответов к ISO-8601. */
|
|
1514
|
+
function normalizeComment(comment) {
|
|
1515
|
+
if (typeof comment !== "object" || comment === null) return comment;
|
|
1516
|
+
return {
|
|
1517
|
+
...comment,
|
|
1518
|
+
...isoField("createdAt", comment.createdAt),
|
|
1519
|
+
...Array.isArray(comment.replies) ? { replies: comment.replies.map(normalizeComment) } : {}
|
|
1520
|
+
};
|
|
1521
|
+
}
|
|
1522
|
+
function normalizeOriginalPost(post) {
|
|
1523
|
+
return {
|
|
1524
|
+
...post,
|
|
1525
|
+
...isoField("createdAt", post.createdAt)
|
|
1526
|
+
};
|
|
1527
|
+
}
|
|
1528
|
+
/** Приводит даты поста, исходного поста репоста и вложенных комментариев к ISO-8601. */
|
|
1529
|
+
function normalizePost(post) {
|
|
1530
|
+
if (typeof post !== "object" || post === null) return post;
|
|
1531
|
+
return {
|
|
1532
|
+
...post,
|
|
1533
|
+
...isoField("createdAt", post.createdAt),
|
|
1534
|
+
...isoField("editedAt", post.editedAt),
|
|
1535
|
+
...post.originalPost ? { originalPost: normalizeOriginalPost(post.originalPost) } : {},
|
|
1536
|
+
...Array.isArray(post.comments) ? { comments: post.comments.map(normalizeComment) } : {}
|
|
1537
|
+
};
|
|
1538
|
+
}
|
|
1539
|
+
//#endregion
|
|
1540
|
+
//#region src/resources/content-operations.ts
|
|
1541
|
+
/** Операция, которая возвращает один пост. */
|
|
1542
|
+
function postOperation(id) {
|
|
1543
|
+
return defineBuiltInOperation(id, (body) => normalizePost(body));
|
|
1544
|
+
}
|
|
1545
|
+
/** Операция, которая возвращает курсорную страницу постов из поля `posts`. */
|
|
1546
|
+
function postPageOperation(id) {
|
|
1547
|
+
return pageOperation(id, (body) => mapPage(readCursorPage(body, "posts"), normalizePost));
|
|
1548
|
+
}
|
|
1549
|
+
/** Операция, которая возвращает один комментарий. */
|
|
1550
|
+
function commentOperation(id) {
|
|
1551
|
+
return defineBuiltInOperation(id, (body) => normalizeComment(body));
|
|
1552
|
+
}
|
|
1553
|
+
//#endregion
|
|
1488
1554
|
//#region src/resources/comments.ts
|
|
1489
|
-
const COMMENTS_REPLIES = pageOperation("comments.replies", (body) => readPagedPage(body, "replies"));
|
|
1490
|
-
const COMMENTS_REPLY =
|
|
1555
|
+
const COMMENTS_REPLIES = pageOperation("comments.replies", (body) => mapPage(readPagedPage(body, "replies"), normalizeComment));
|
|
1556
|
+
const COMMENTS_REPLY = commentOperation("comments.reply");
|
|
1491
1557
|
const COMMENTS_UPDATE = passthroughOperation("comments.update");
|
|
1492
1558
|
const COMMENTS_RESTORE = voidOperation("comments.restore");
|
|
1493
1559
|
const COMMENTS_LIKE = passthroughOperation("comments.like");
|
|
@@ -1732,7 +1798,6 @@ function assertAllowedMime(mimeType, filename) {
|
|
|
1732
1798
|
//#endregion
|
|
1733
1799
|
//#region src/resources/files.ts
|
|
1734
1800
|
const FILES_UPLOAD = passthroughOperation("files.upload");
|
|
1735
|
-
const FILES_GET = passthroughOperation("files.get");
|
|
1736
1801
|
const FILES_REMOVE = voidOperation("files.remove");
|
|
1737
1802
|
/** Файлы и медиа. */
|
|
1738
1803
|
var FilesResource = class extends BaseResource {
|
|
@@ -1762,17 +1827,6 @@ var FilesResource = class extends BaseResource {
|
|
|
1762
1827
|
for (const file of files) ids.push((await this.upload(file, uploadOptions, requestOptions)).id);
|
|
1763
1828
|
return ids;
|
|
1764
1829
|
}
|
|
1765
|
-
/**
|
|
1766
|
-
* Загружает сведения о файле.
|
|
1767
|
-
*
|
|
1768
|
-
* Для ещё не прикреплённого файла сервер может ответить `404`.
|
|
1769
|
-
*/
|
|
1770
|
-
get(fileId, options = {}) {
|
|
1771
|
-
return this.http.execute(FILES_GET, {
|
|
1772
|
-
path: `/api/files/${encodePathSegment(fileId, "fileId")}`,
|
|
1773
|
-
...options
|
|
1774
|
-
});
|
|
1775
|
-
}
|
|
1776
1830
|
/** Удаляет загруженный файл. */
|
|
1777
1831
|
remove(fileId, options = {}) {
|
|
1778
1832
|
return this.voidOperation(FILES_REMOVE, {
|
|
@@ -1846,7 +1900,7 @@ var FilesResource = class extends BaseResource {
|
|
|
1846
1900
|
};
|
|
1847
1901
|
//#endregion
|
|
1848
1902
|
//#region src/resources/hashtags.ts
|
|
1849
|
-
const HASHTAG_POSTS =
|
|
1903
|
+
const HASHTAG_POSTS = postPageOperation("hashtags.posts");
|
|
1850
1904
|
const HASHTAGS_TRENDING = defineBuiltInOperation("hashtags.trending", (body) => pickArray(body, "hashtags"));
|
|
1851
1905
|
/**
|
|
1852
1906
|
* Хэштеги.
|
|
@@ -3060,22 +3114,22 @@ function resolvePostUpdate(input) {
|
|
|
3060
3114
|
}
|
|
3061
3115
|
//#endregion
|
|
3062
3116
|
//#region src/resources/posts.ts
|
|
3063
|
-
const POSTS_LIST =
|
|
3064
|
-
const POSTS_BY_USER =
|
|
3065
|
-
const POSTS_LIKED_BY_USER =
|
|
3066
|
-
const POSTS_COMMENTS = pageOperation("posts.comments", (body) => readFlatCursorPage(body, "comments"));
|
|
3117
|
+
const POSTS_LIST = postPageOperation("posts.list");
|
|
3118
|
+
const POSTS_BY_USER = postPageOperation("posts.byUser");
|
|
3119
|
+
const POSTS_LIKED_BY_USER = postPageOperation("posts.likedByUser");
|
|
3120
|
+
const POSTS_COMMENTS = pageOperation("posts.comments", (body) => mapPage(readFlatCursorPage(body, "comments"), normalizeComment));
|
|
3067
3121
|
const POSTS_STATS = defineBuiltInOperation("posts.stats", (body) => pickArray(body, "posts"));
|
|
3068
|
-
const POSTS_CREATE =
|
|
3069
|
-
const POSTS_GET =
|
|
3122
|
+
const POSTS_CREATE = postOperation("posts.create");
|
|
3123
|
+
const POSTS_GET = postOperation("posts.get");
|
|
3070
3124
|
const POSTS_UPDATE = passthroughOperation("posts.update");
|
|
3071
3125
|
const POSTS_RESTORE = voidOperation("posts.restore");
|
|
3072
3126
|
const POSTS_LIKE = passthroughOperation("posts.like");
|
|
3073
3127
|
const POSTS_UNLIKE = passthroughOperation("posts.unlike");
|
|
3074
|
-
const POSTS_REPOST =
|
|
3128
|
+
const POSTS_REPOST = postOperation("posts.repost");
|
|
3075
3129
|
const POSTS_PIN = passthroughOperation("posts.pin");
|
|
3076
3130
|
const POSTS_UNPIN = passthroughOperation("posts.unpin");
|
|
3077
3131
|
const POSTS_VOTE = passthroughOperation("posts.vote");
|
|
3078
|
-
const POSTS_COMMENT =
|
|
3132
|
+
const POSTS_COMMENT = commentOperation("posts.comment");
|
|
3079
3133
|
const POSTS_REMOVE = voidOperation("posts.remove");
|
|
3080
3134
|
const POSTS_UNREPOST = voidOperation("posts.unrepost");
|
|
3081
3135
|
/** Курсорная позиция из параметров: если курсор задан — с него, иначе с начала. */
|
|
@@ -4132,7 +4186,13 @@ const USER_LIST_OPERATIONS = {
|
|
|
4132
4186
|
"users.following": userListOperation("users.following"),
|
|
4133
4187
|
"users.blocked": userListOperation("users.blocked")
|
|
4134
4188
|
};
|
|
4135
|
-
const USERS_CHECK_USERNAME = defineBuiltInOperation("users.checkUsername", (body) =>
|
|
4189
|
+
const USERS_CHECK_USERNAME = defineBuiltInOperation("users.checkUsername", (body) => {
|
|
4190
|
+
const reason = pickString(body, "reason");
|
|
4191
|
+
return {
|
|
4192
|
+
available: pickBoolean(body, "available"),
|
|
4193
|
+
...reason ? { reason } : {}
|
|
4194
|
+
};
|
|
4195
|
+
});
|
|
4136
4196
|
const USERS_WHO_TO_FOLLOW = defineBuiltInOperation("users.whoToFollow", (body) => pickArray(body, "users"));
|
|
4137
4197
|
const USERS_TOP_CLANS = defineBuiltInOperation("users.topClans", (body) => pickArray(body, "clans"));
|
|
4138
4198
|
const USERS_PINS = defineBuiltInOperation("users.pins", (body) => ({
|
|
@@ -4253,7 +4313,15 @@ var UsersResource = class extends BaseResource {
|
|
|
4253
4313
|
...options
|
|
4254
4314
|
});
|
|
4255
4315
|
}
|
|
4256
|
-
/**
|
|
4316
|
+
/**
|
|
4317
|
+
* Проверяет, свободно ли имя пользователя.
|
|
4318
|
+
*
|
|
4319
|
+
* @example
|
|
4320
|
+
* ```ts
|
|
4321
|
+
* const { available, reason } = await itd.users.checkUsername('new_name');
|
|
4322
|
+
* if (reason === UsernameUnavailableReason.InvalidFormat) console.log('Неверный формат');
|
|
4323
|
+
* ```
|
|
4324
|
+
*/
|
|
4257
4325
|
checkUsername(username, options = {}) {
|
|
4258
4326
|
return this.http.execute(USERS_CHECK_USERNAME, {
|
|
4259
4327
|
path: "/api/users/check-username",
|
|
@@ -4297,10 +4365,11 @@ var UsersResource = class extends BaseResource {
|
|
|
4297
4365
|
/**
|
|
4298
4366
|
* Загружает подписчиков пользователя.
|
|
4299
4367
|
*
|
|
4300
|
-
*
|
|
4368
|
+
* Свои подписчики листаются обычным образом: `page`, `limit` до 20, `hasMore` и `total`.
|
|
4369
|
+
*
|
|
4370
|
+
* ⚠️ **Чужой список сервер не листает.** Возвращаются первые 20 записей и только они:
|
|
4301
4371
|
* параметр `page` игнорируется (любая страница отдаёт те же записи и `pagination.page: 1`),
|
|
4302
|
-
* `limit` больше 20 молча уменьшается, а `hasMore` всегда `false`.
|
|
4303
|
-
* получить продолжение нечем.
|
|
4372
|
+
* `limit` больше 20 молча уменьшается, а `hasMore` всегда `false`.
|
|
4304
4373
|
*
|
|
4305
4374
|
* Числу `total` доверять тоже не стоит: оно расходится с `followersCount` из профиля —
|
|
4306
4375
|
* на проверенных аккаунтах занижено примерно на 1–4%.
|
|
@@ -4311,8 +4380,8 @@ var UsersResource = class extends BaseResource {
|
|
|
4311
4380
|
/**
|
|
4312
4381
|
* Перебирает подписчиков.
|
|
4313
4382
|
*
|
|
4314
|
-
*
|
|
4315
|
-
* см. {@link followers}.
|
|
4383
|
+
* Свой список перебирается целиком. Перебор чужого закончится после первых 20 записей:
|
|
4384
|
+
* сервер его не листает — см. {@link followers}.
|
|
4316
4385
|
*/
|
|
4317
4386
|
iterateFollowers(user, params = {}, options = {}) {
|
|
4318
4387
|
return this.#userPaginator("users.followers", `/api/users/${encodePathSegment(user, "user")}/followers`, params, options);
|
|
@@ -4321,7 +4390,7 @@ var UsersResource = class extends BaseResource {
|
|
|
4321
4390
|
following(user, params = {}, options = {}) {
|
|
4322
4391
|
return this.#userPage("users.following", `/api/users/${encodePathSegment(user, "user")}/following`, params, options);
|
|
4323
4392
|
}
|
|
4324
|
-
/** Перебирает подписки.
|
|
4393
|
+
/** Перебирает подписки. Чужой список закончится после первых 20 записей — см. {@link followers}. */
|
|
4325
4394
|
iterateFollowing(user, params = {}, options = {}) {
|
|
4326
4395
|
return this.#userPaginator("users.following", `/api/users/${encodePathSegment(user, "user")}/following`, params, options);
|
|
4327
4396
|
}
|
|
@@ -4358,11 +4427,11 @@ var UsersResource = class extends BaseResource {
|
|
|
4358
4427
|
...options
|
|
4359
4428
|
});
|
|
4360
4429
|
}
|
|
4361
|
-
/** Загружает заблокированных пользователей.
|
|
4430
|
+
/** Загружает заблокированных пользователей. Параметры — как у {@link followers}. */
|
|
4362
4431
|
blocked(params = {}, options = {}) {
|
|
4363
4432
|
return this.#userPage("users.blocked", "/api/users/me/blocked", params, options);
|
|
4364
4433
|
}
|
|
4365
|
-
/** Перебирает заблокированных.
|
|
4434
|
+
/** Перебирает заблокированных. Параметры — как у {@link followers}. */
|
|
4366
4435
|
iterateBlocked(params = {}, options = {}) {
|
|
4367
4436
|
return this.#userPaginator("users.blocked", "/api/users/me/blocked", params, options);
|
|
4368
4437
|
}
|
|
@@ -5030,4 +5099,4 @@ function renderSpans(content, spans = [], options = {}) {
|
|
|
5030
5099
|
//#endregion
|
|
5031
5100
|
export { utcStampToIso as A, AUDIO_MIME_TYPES as C, isBuilder as D, comment as E, mapPage as F, createFeatureHost as I, ExtensibleOperationCatalog as L, BaseResource as M, PaginationMode as N, createStatusFeature as O, Paginator as P, ALLOWED_MIME_TYPES as S, VIDEO_MIME_TYPES as T, poll as _, createShopOrderAccessStorage as a, parseHtml as b, ShopOrderStatus as c, isMyProfile as d, fromStream as f, post as g, report as h, MemoryShopOrderAccessStorage as i, NotificationsResource as j, toDate as k, ShopProductCategory as l, createResources as m, renderSpans as n, statusDays as o, fromUrl as p, createShopFeature as r, ShopConsentKind as s, SpanRenderFormat as t, ShopProductStatus as u, autoSpans as v, IMAGE_MIME_TYPES as w, parseMarkdown as x, markup as y };
|
|
5032
5101
|
|
|
5033
|
-
//# sourceMappingURL=render-
|
|
5102
|
+
//# sourceMappingURL=render-D3vSEbLL.js.map
|