itd-api 0.13.1 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/events/index.cjs +5 -5
- 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 +201 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +64 -4
- package/dist/index.d.ts +64 -4
- package/dist/index.js +177 -8
- package/dist/index.js.map +1 -1
- package/dist/node/index.cjs +2 -2
- package/dist/node/index.js +2 -2
- package/dist/rest/index.cjs +25 -8
- package/dist/rest/index.cjs.map +1 -1
- package/dist/rest/index.d.cts +5 -3
- package/dist/rest/index.d.ts +5 -3
- package/dist/rest/index.js +12 -7
- package/dist/rest/index.js.map +1 -1
- package/dist/shared/{redact-BCmucE19.js → cookies-YP0m72v2.js} +125 -124
- package/dist/shared/cookies-YP0m72v2.js.map +1 -0
- package/dist/shared/{redact-BuXRKC1G.cjs → cookies-u2hXCcpR.cjs} +124 -123
- package/dist/shared/cookies-u2hXCcpR.cjs.map +1 -0
- package/dist/shared/{events-Bip3qvCc.d.cts → events-BmYzFrRC.d.cts} +213 -198
- package/dist/shared/{events-DRbBDq9p.js → events-BnL_gckg.js} +567 -530
- package/dist/shared/events-BnL_gckg.js.map +1 -0
- package/dist/shared/{events-DF1elRzZ.d.ts → events-Bw7VaSDs.d.ts} +18 -3
- package/dist/shared/{events-DcxmyPTX.cjs → events-DUFuPzVO.cjs} +582 -545
- package/dist/shared/events-DUFuPzVO.cjs.map +1 -0
- package/dist/shared/{multi-storage-Dp5x6OOl.cjs → multi-storage-BIeeBDV6.cjs} +5 -5
- package/dist/shared/{multi-storage-Dp5x6OOl.cjs.map → multi-storage-BIeeBDV6.cjs.map} +1 -1
- package/dist/shared/{multi-storage-DffEAzdc.js → multi-storage-DmUOaXbC.js} +2 -2
- package/dist/shared/{multi-storage-DffEAzdc.js.map → multi-storage-DmUOaXbC.js.map} +1 -1
- package/dist/shared/{options-Ddyc5qec.js → options-D-8h06B_.js} +2 -2
- package/dist/shared/{options-Ddyc5qec.js.map → options-D-8h06B_.js.map} +1 -1
- package/dist/shared/{options-DsmQRyx4.cjs → options-hZolLxgs.cjs} +5 -5
- package/dist/shared/{options-DsmQRyx4.cjs.map → options-hZolLxgs.cjs.map} +1 -1
- package/dist/shared/{render-DJKZqv9O.js → render-CgSQp84V.js} +2990 -1692
- package/dist/shared/render-CgSQp84V.js.map +1 -0
- package/dist/shared/{render-Bvv1V5Tp.d.ts → render-DPXlBr5L.d.ts} +1394 -441
- package/dist/shared/{render-D83t9ckd.d.cts → render-DcIXTSuo.d.cts} +1311 -369
- package/dist/shared/{render-C1lmsu1i.cjs → render-dKMV-872.cjs} +3071 -1695
- package/dist/shared/render-dKMV-872.cjs.map +1 -0
- package/dist/shared/{url-V4bCae35.d.ts → url-B_TELARK.d.ts} +372 -168
- package/dist/shared/{url-CXRaoR_w.cjs → url-CQbNqbJX.cjs} +3472 -3257
- package/dist/shared/url-CQbNqbJX.cjs.map +1 -0
- package/dist/shared/{url-n_h2pvHA.d.cts → url-D7U9qjXD.d.cts} +1809 -1594
- package/dist/shared/{url-aw_NZdVY.js → url-DYGRJqxh.js} +3463 -3254
- package/dist/shared/url-DYGRJqxh.js.map +1 -0
- package/package.json +5 -2
- package/dist/shared/events-DRbBDq9p.js.map +0 -1
- package/dist/shared/events-DcxmyPTX.cjs.map +0 -1
- package/dist/shared/redact-BCmucE19.js.map +0 -1
- package/dist/shared/redact-BuXRKC1G.cjs.map +0 -1
- package/dist/shared/render-C1lmsu1i.cjs.map +0 -1
- package/dist/shared/render-DJKZqv9O.js.map +0 -1
- package/dist/shared/url-CXRaoR_w.cjs.map +0 -1
- package/dist/shared/url-aw_NZdVY.js.map +0 -1
package/dist/node/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_options = require("../shared/options-
|
|
2
|
+
const require_options = require("../shared/options-hZolLxgs.cjs");
|
|
3
3
|
const require_validate = require("../shared/validate-BHKy_YMv.cjs");
|
|
4
4
|
const require_key_value_store = require("../shared/key-value-store-CmnIjuE4.cjs");
|
|
5
|
-
const require_multi_storage = require("../shared/multi-storage-
|
|
5
|
+
const require_multi_storage = require("../shared/multi-storage-BIeeBDV6.cjs");
|
|
6
6
|
const require_storage = require("../shared/storage-e2xYL6ro.cjs");
|
|
7
7
|
// src/node.ts
|
|
8
8
|
/**
|
package/dist/node/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as FileTransferMode, n as boundedFileStream, t as resolveFileStreamOptions } from "../shared/options-
|
|
1
|
+
import { c as FileTransferMode, n as boundedFileStream, t as resolveFileStreamOptions } from "../shared/options-D-8h06B_.js";
|
|
2
2
|
import { l as ItdConfigError, m as ItdFileErrorReason, p as ItdFileError } from "../shared/validate-BQzL_oJ4.js";
|
|
3
3
|
import { i as createRecordKeyValueStore } from "../shared/key-value-store-BwXlaoD4.js";
|
|
4
|
-
import { r as createMultiTokenStorage } from "../shared/multi-storage-
|
|
4
|
+
import { r as createMultiTokenStorage } from "../shared/multi-storage-DmUOaXbC.js";
|
|
5
5
|
import { r as createTokenStorage } from "../shared/storage-Bc4lWtSj.js";
|
|
6
6
|
// src/node.ts
|
|
7
7
|
/**
|
package/dist/rest/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_render = require("../shared/render-
|
|
3
|
-
const require_options = require("../shared/options-
|
|
4
|
-
const require_url = require("../shared/url-
|
|
2
|
+
const require_render = require("../shared/render-dKMV-872.cjs");
|
|
3
|
+
const require_options = require("../shared/options-hZolLxgs.cjs");
|
|
4
|
+
const require_url = require("../shared/url-CQbNqbJX.cjs");
|
|
5
5
|
const require_validate = require("../shared/validate-BHKy_YMv.cjs");
|
|
6
|
-
const
|
|
6
|
+
const require_cookies = require("../shared/cookies-u2hXCcpR.cjs");
|
|
7
7
|
// src/rest/client.ts
|
|
8
8
|
/**
|
|
9
9
|
* Минимальный клиент REST API итд.com.
|
|
@@ -54,6 +54,10 @@ var ItdRestClient = class ItdRestClient {
|
|
|
54
54
|
get notifications() {
|
|
55
55
|
return this.#resources.notifications;
|
|
56
56
|
}
|
|
57
|
+
/** Чаты и сообщения текущего пользователя. */
|
|
58
|
+
get chats() {
|
|
59
|
+
return this.#resources.chats;
|
|
60
|
+
}
|
|
57
61
|
/** Хэштеги и посты по ним. */
|
|
58
62
|
get hashtags() {
|
|
59
63
|
return this.#resources.hashtags;
|
|
@@ -105,9 +109,10 @@ var ItdRestClient = class ItdRestClient {
|
|
|
105
109
|
const status = this.#features.install(require_render.createStatusFeature());
|
|
106
110
|
this.#resources = require_render.createResources({
|
|
107
111
|
http: this.#runtime.http,
|
|
108
|
-
|
|
112
|
+
host: this.#features,
|
|
109
113
|
status,
|
|
110
|
-
createNotifications: (http) => new require_render.NotificationsResource(http)
|
|
114
|
+
createNotifications: (http) => new require_render.NotificationsResource(http),
|
|
115
|
+
createChats: () => new require_render.ChatsResource(this.#runtime.http, this.#features)
|
|
111
116
|
});
|
|
112
117
|
}
|
|
113
118
|
#assertActive(action) {
|
|
@@ -311,6 +316,11 @@ exports.AccessType = require_url.AccessType;
|
|
|
311
316
|
exports.AttachmentType = require_url.AttachmentType;
|
|
312
317
|
exports.BUCKET_LIMITS = require_url.BUCKET_LIMITS;
|
|
313
318
|
exports.BannerDrawingTool = require_render.BannerDrawingTool;
|
|
319
|
+
exports.ChatActionType = require_render.ChatActionType;
|
|
320
|
+
exports.ChatMediaCategory = require_render.ChatMediaCategory;
|
|
321
|
+
exports.ChatReactionType = require_render.ChatReactionType;
|
|
322
|
+
exports.ChatUpdateType = require_render.ChatUpdateType;
|
|
323
|
+
exports.ChatsResource = require_render.ChatsResource;
|
|
314
324
|
exports.CommentSort = require_url.CommentSort;
|
|
315
325
|
exports.DEFAULT_BASE_URL = require_url.DEFAULT_BASE_URL;
|
|
316
326
|
exports.DEFAULT_RATE_LIMIT_BUCKET = require_url.DEFAULT_RATE_LIMIT_BUCKET;
|
|
@@ -319,6 +329,7 @@ exports.FileTransferMode = require_options.FileTransferMode;
|
|
|
319
329
|
exports.IMAGE_MIME_TYPES = require_render.IMAGE_MIME_TYPES;
|
|
320
330
|
exports.IncidentKind = require_url.IncidentKind;
|
|
321
331
|
exports.InteractionType = require_url.InteractionType;
|
|
332
|
+
exports.InternationalSubscriptionCheckoutMode = require_render.InternationalSubscriptionCheckoutMode;
|
|
322
333
|
exports.ItdAbortError = require_validate.ItdAbortError;
|
|
323
334
|
exports.ItdApiError = require_validate.ItdApiError;
|
|
324
335
|
exports.ItdApiErrorKind = require_validate.ItdApiErrorKind;
|
|
@@ -345,7 +356,7 @@ exports.LastSeenUnit = require_url.LastSeenUnit;
|
|
|
345
356
|
exports.LegalDocumentBlockType = require_render.LegalDocumentBlockType;
|
|
346
357
|
exports.LegalDocumentScope = require_render.LegalDocumentScope;
|
|
347
358
|
exports.LikesVisibility = require_url.LikesVisibility;
|
|
348
|
-
exports.LogLevel =
|
|
359
|
+
exports.LogLevel = require_cookies.LogLevel;
|
|
349
360
|
exports.MemoryShopOrderAccessStorage = require_render.MemoryShopOrderAccessStorage;
|
|
350
361
|
exports.MessageAccess = require_url.MessageAccess;
|
|
351
362
|
exports.NotificationType = require_url.NotificationType;
|
|
@@ -353,11 +364,12 @@ exports.OPERATIONS = require_url.OPERATIONS;
|
|
|
353
364
|
exports.OperationMethod = require_url.OperationMethod;
|
|
354
365
|
exports.PaginationMode = require_render.PaginationMode;
|
|
355
366
|
exports.Paginator = require_render.Paginator;
|
|
367
|
+
exports.PaymentMethodType = require_render.PaymentMethodType;
|
|
356
368
|
exports.RateLimitPacing = require_url.RateLimitPacing;
|
|
357
369
|
exports.ReportReason = require_url.ReportReason;
|
|
358
370
|
exports.ReportTargetType = require_url.ReportTargetType;
|
|
359
371
|
exports.RetrySafety = require_url.RetrySafety;
|
|
360
|
-
exports.RuntimeMode =
|
|
372
|
+
exports.RuntimeMode = require_cookies.RuntimeMode;
|
|
361
373
|
exports.STATUS_SERVICE = require_url.STATUS_SERVICE;
|
|
362
374
|
exports.ServiceState = require_url.ServiceState;
|
|
363
375
|
exports.ShopConsentKind = require_render.ShopConsentKind;
|
|
@@ -366,6 +378,9 @@ exports.ShopProductCategory = require_render.ShopProductCategory;
|
|
|
366
378
|
exports.ShopProductStatus = require_render.ShopProductStatus;
|
|
367
379
|
exports.SpanRenderFormat = require_render.SpanRenderFormat;
|
|
368
380
|
exports.SpanType = require_url.SpanType;
|
|
381
|
+
exports.SubscriptionCheckoutKind = require_render.SubscriptionCheckoutKind;
|
|
382
|
+
exports.SubscriptionCheckoutStatus = require_render.SubscriptionCheckoutStatus;
|
|
383
|
+
exports.SubscriptionPaymentProvider = require_render.SubscriptionPaymentProvider;
|
|
369
384
|
exports.TimeoutBudget = require_validate.TimeoutBudget;
|
|
370
385
|
exports.UsernameUnavailableReason = require_url.UsernameUnavailableReason;
|
|
371
386
|
exports.VIDEO_MIME_TYPES = require_render.VIDEO_MIME_TYPES;
|
|
@@ -401,6 +416,8 @@ exports.isKnownNotificationType = require_url.isKnownNotificationType;
|
|
|
401
416
|
exports.isMyProfile = require_render.isMyProfile;
|
|
402
417
|
exports.mapPage = require_render.mapPage;
|
|
403
418
|
exports.markup = require_render.markup;
|
|
419
|
+
exports.message = require_render.message;
|
|
420
|
+
exports.messageMarkup = require_render.messageMarkup;
|
|
404
421
|
exports.normalizeNotification = require_url.normalizeNotification;
|
|
405
422
|
exports.operationBucket = require_url.operationBucket;
|
|
406
423
|
exports.operationMethod = require_url.operationMethod;
|
package/dist/rest/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["AccountLifecycleResource","ExtensibleOperationCatalog","ITD_CATALOG","createClientRuntime","createFeatureHost","createStatusFeature","createResources","NotificationsResource","ItdStateError","ItdConfigError","installAsyncDisposeFallback","anonymousAuth","bearerToken"],"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 { AccountLifecycleResource } from '../resources/account/lifecycle.js';\nimport type { CommentsResource } from '../resources/comments.js';\nimport type { FilesResource } from '../resources/files.js';\nimport type { HashtagsResource } from '../resources/hashtags.js';\nimport type { LegalResource } from '../resources/legal.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 #account: AccountLifecycleResource | undefined;\n\n /** Деактивация и восстановление текущего аккаунта. */\n get account(): AccountLifecycleResource {\n this.#account ??= new AccountLifecycleResource(this.#runtime.http);\n return this.#account;\n }\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 legal(): LegalResource {\n return this.#resources.legal;\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":";;;;;;;;;;;;;;;;;;;;;;;AA0DA,IAAa,gBAAb,MAAa,cAAc;CAChB;CACA;CACA;;CAET;CACA,YAAY;CACZ;;CAGA,IAAI,UAAoC;EACtC,KAAK,aAAa,IAAIA,eAAAA,yBAAyB,KAAK,SAAS,IAAI;EACjE,OAAO,KAAK;CACd;;CAGA,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;E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ource","ExtensibleOperationCatalog","ITD_CATALOG","createClientRuntime","createFeatureHost","createStatusFeature","createResources","NotificationsResource","ChatsResource","ItdStateError","ItdConfigError","installAsyncDisposeFallback","anonymousAuth","bearerToken"],"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 { AccountLifecycleResource } from '../resources/account/lifecycle.js';\nimport { ChatsResource } from '../resources/chats.js';\nimport type { CommentsResource } from '../resources/comments.js';\nimport type { FilesResource } from '../resources/files.js';\nimport type { HashtagsResource } from '../resources/hashtags.js';\nimport type { LegalResource } from '../resources/legal.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 #account: AccountLifecycleResource | undefined;\n\n /** Деактивация и восстановление текущего аккаунта. */\n get account(): AccountLifecycleResource {\n this.#account ??= new AccountLifecycleResource(this.#runtime.http);\n return this.#account;\n }\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 chats(): ChatsResource {\n return this.#resources.chats;\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 legal(): LegalResource {\n return this.#resources.legal;\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 host: this.#features,\n status,\n createNotifications: (http) => new NotificationsResource(http),\n createChats: () => new ChatsResource(this.#runtime.http, this.#features),\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":";;;;;;;;;;;;;;;;;;;;;;;AA2DA,IAAa,gBAAb,MAAa,cAAc;CAChB;CACA;CACA;;CAET;CACA,YAAY;CACZ;;CAGA,IAAI,UAAoC;EACtC,KAAK,aAAa,IAAIA,eAAAA,yBAAyB,KAAK,SAAS,IAAI;EACjE,OAAO,KAAK;CACd;;CAGA,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,QAAuB;EACzB,OAAO,KAAK,WAAW;CACzB;;CAGA,IAAI,WAA6B;EAC/B,OAAO,KAAK,WAAW;CACzB;;CAGA,IAA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AAS,oBAAoB,MAA+C;CAC1E,IAAI,SAAS,KAAA,GAAW,OAAOC,YAAAA,cAAc;CAC7C,OAAO,OAAO,SAAS,WAAWC,YAAAA,YAAY,IAAI,IAAI;AACxD;;;;;;;;;AAUA,SAAgB,iBAAiB,UAA6B,CAAC,GAAkB;CAC/E,OAAO,IAAI,cAAc,OAAO;AAClC"}
|
package/dist/rest/index.d.cts
CHANGED
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
*
|
|
19
19
|
* @packageDocumentation
|
|
20
20
|
*/
|
|
21
|
-
import { $ as
|
|
21
|
+
import { $ as InternationalSubscriptionCheckoutMode, $i as AttemptContext, $n as CommentReplyTo, $r as CreateReportInput, $t as ReportsResource, A as UsersResource, Ai as ChatSentMessage, An as Report, Ar as Paginator, At as ShopDeliveryDestination, B as ViewTracker, Bi as FeatureBucketDefinition, Bn as HashtagsResource, Br as messageMarkup, Bt as ShopOrderSummary, C as fromStream, Ci as ChatReaction, Cn as StatusDay, Cr as ChatsResource, Ct as ShopConsent, D as UpdatePrivacyInput, Di as ChatReadCursor, Dn as ChangelogEntry, Dr as Page, Dt as ShopDeliveryCalculation, E as MessageAllowlistParams, Ei as ChatReactionType, En as AnnouncementButton, Et as ShopCreatedOrder, F as TelemetryBatchOptions, Fi as ChatUpdateType, Fn as LegalDocumentBlockType, Fr as message, Ft as ShopOrderBase, G as SubscriptionCheckoutReleaseInput, Gi as ManagedClientResource, Gn as BannerDrawingOperation, Gr as MarkupSpan, Gt as ShopProductColor, H as ViewTrackerOptions, Hi as FeatureInstallation, Hn as UploadOptions, Hr as MarkupBuilder, Ht as ShopPayment, I as TelemetryClock, Ii as ChatUpdatesPage, In as LegalDocumentScope, Ir as MessageMarkup, It as ShopOrderDelivery, J as SubscriptionPayOptions, Ji as PreparedFileSource, Jn as UploadedBannerDrawing, Jr as markup, Jt as ShopRecipient, K as SubscriptionCheckoutTerms, Ki as FileResolver, Kn as BannerDrawingPoint, Kr as TextMarkup, Kt as ShopProductSpec, L as TelemetryOptions, Li as ChatUploadOptions, Ln as LegalDocumentSummary, Lr as MessageMarkupBuilder, Lt as ShopOrderItem, M as InteractionEntry, Mi as ChatTextEntity, Mn as LegalResource, Mr as mapPage, Mt as ShopOrder, N as PhotoOpenInput, Ni as ChatUnreadState, Nn as LegalDocument, Nr as MessageBuilder, Nt as ShopOrderAccessSession, O as UpdateProfileInput, Oi as ChatReadResult, On as Clan, Or as PageState, Ot as ShopDeliveryCity, P as TelemetryBatch, Pi as ChatUpdate, Pn as LegalDocumentBlock, Pr as MessageInput, Pt as ShopOrderAccessVerification, Q as InternationalSubscriptionCheckout, Qi as RateLimitBucketState, Qn as Comment, Qr as CreatePostData, Qt as SearchResult, R as TelemetryResource, Ri as ChatUploadedFile, Rn as LegalDocumentVersion, Rr as MessageMarkupContent, Rt as ShopOrderItemInput, S as VideoMimeType, Si as ChatPreview, Sn as ServiceStatus, Sr as ChatListParams, St as CreateShopOrderInput, T as VerificationResource, Ti as ChatReactionCount, Tn as Announcement, Tr as SetChatReactionsInput, Tt as ShopConsentKind, U as SubscriptionBindCardOptions, Ui as FeatureOperationDefinition, Un as UploadedFile, Ur as MarkupContent, Ut as ShopProduct, V as ViewTrackerInput, Vi as FeatureContext, Vn as FilesResource, Vr as AutoSpansOptions, Vt as ShopOrderSupport, W as SubscriptionCheckoutInput, Wi as FeatureRequestOptions, Wn as BannerDrawing, Wr as MarkupInput, Wt as ShopProductCategory, X as SubscriptionResource, Xi as ResolveFileContext, Xn as RepliesParams, Xr as CreateCommentInput, Xt as ShopSizeChartRow, Y as SubscriptionPaymentInput, Yi as PreparedStreamSource, Yn as CommentsResource, Yr as ChatMessageContent, Yt as ShopSizeChart, Z as InternationalSubscriptionCapability, Zi as ResolveFileOptions, Zn as Attachment, Zr as CreatePollInput, Zt as SearchResource, _ as AllowedMimeType, _i as ChatMediaItem, _n as parseMarkdown, _t as ShopDeliveryResource, a as ShopFeatureOptions, aa as OperationTransformContext, ai as ChatActionType, an as PostsResource, ar as Poll, at as SubscriptionCheckoutState, b as ImageMimeType, bi as ChatMessageReactions, bn as PlatformVersions, br as NotificationsResource, bt as ShopProductsResource, c as ShopOrderAccessStorage, ca as PluginTeardown, ci as ChatDeletedMessages, cn as PostBuilder, cr as PostBase, ct as SubscriptionGift, d as statusDays, di as ChatFileLink, dn as post, dr as PostUpdateResult, dt as SubscriptionPaymentProvider, ea as AttemptExtensions, ei as SendChatMessageInput, en as ReportBuilder, er as CommentUpdateResult, et as InternationalSubscriptionOffer, f as isMyProfile, fi as ChatFirstMessage, fn as PollBuilder, fr as UpdateResultBase, ft as SubscriptionQuote, g as AUDIO_MIME_TYPES, gi as ChatMediaCategory, gn as parseHtml, gr as AccountLifecycleResource, gt as ShopConsentsResource, h as ALLOWED_MIME_TYPES, hi as ChatListPage, hn as ParseMarkupOptions, hr as comment, ht as PayShopOrderOptions, i as ShopFeatureApi, ia as OperationExtensions, ii as isBuilder, in as FeedParams, ir as PinPostResult, it as SubscriptionCheckoutKind, j as DwellEntry, ji as ChatSummary, jn as VerificationStatus, jr as PaginatorOptions, jt as ShopDeliveryPoint, k as UserListParams, ki as ChatReply, kn as Portal, kr as PaginationMode, kt as ShopDeliveryCountry, l as ShopOrderAccessStorageAdapterOptions, li as ChatDirectResult, ln as PostInput, lr as PostCounters, lt as SubscriptionOffer, m as utcStampToIso, mi as ChatHistoryPage, mn as poll, mr as CommentInput, mt as CreateShopOrderOptions, n as SpanRenderFormat, na as AttemptNext, ni as BuilderInput, nn as report, nr as LikeResult, nt as PaymentMethodType, o as createShopFeature, oa as OperationTransformer, oi as ChatAttachment, on as UserPostsParams, or as PollOption, ot as SubscriptionCheckoutStatus, p as toDate, pi as ChatForwardedMessages, pn as PollInput, pr as CommentBuilder, pt as SubscriptionRenewalAgreement, q as SubscriptionGiftInput, qi as PreparedBufferSource, qn as BannerDrawingTool, qr as autoSpans, qt as ShopProductStatus, r as renderSpans, ra as ClientPlugin, ri as ItdBuilder, rn as CommentsParams, rr as OriginalPost, rt as Subscription, s as MemoryShopOrderAccessStorage, sa as PluginApi, si as ChatChange, sn as CreatePostInput, sr as Post, st as SubscriptionCheckoutSubject, t as RenderSpansOptions, ta as AttemptInterceptor, ti as UpdatePostInput, tn as ReportInput, tr as Hashtag, tt as PaymentMethod, u as createShopOrderAccessStorage, ui as ChatEditedMessage, un as PostUpdateInput, ur as PostStats, ut as SubscriptionPayment, v as AudioMimeType, vi as ChatMediaPage, vn as PlatformClientVersion, vr as Session, vt as ShopOrderRequestOptions, w as fromUrl, wi as ChatReactionCatalog, wn as StatusIncidentLine, wr as ForwardChatMessagesInput, wt as ShopConsentContext, x as VIDEO_MIME_TYPES, xi as ChatPresence, xn as PlatformStatus, xr as UpdateNotificationSettingsInput, xt as ShopResource, y as IMAGE_MIME_TYPES, yi as ChatMessage, yn as PlatformResource, yr as NotificationListParams, yt as ShopOrdersResource, z as VideoProgressInput, zi as ClientFeature, zn as HashtagPostsParams, zr as MessageMarkupInput, zt as ShopOrderStatus } from "../shared/render-DcIXTSuo.cjs";
|
|
22
22
|
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-DEbkC0cB.cjs";
|
|
23
|
-
import { $ as
|
|
23
|
+
import { $ as ItdPhoneVerificationError, $t as BuiltInOperationId, A as ClientConnection, An as NotificationType, At as OperationRequestOptions, B as ItdApiErrorInit, Bt as RetryContext, C as SubscriptionState, Cn as IncidentKind, Ct as OperationAnnotations, Dn as LikesVisibility, Dt as RetrySafety, E as UsernameAvailability, En as LastSeenUnit, Et as OperationMethod, F as tokenProvider, Fn as SpanType, Ft as RawRequestOptions, G as ItdError, Gt as QueryValue, H as ItdAuthError, Ht as RetryOptions, In as UsernameUnavailableReason, It as RequestContext, J as ItdFileError, Jt as RuntimeMode, K as ItdErrorKind, Kt as ServiceDefinition, Ln as ViewReason, Lt as RequestExtensions, M as AuthProvider, Mn as ReportReason, Mt as RateLimitBucketContext, N as anonymousAuth, Nn as ReportTargetType, Nt as RateLimitBucketOverride, O as Listener, On as Loose, Ot as ClientHooks, P as bearerToken, Pn as ServiceState, Pt as RateLimitOptions, Q as ItdNotFoundError, Qt as systemClock, R as ItdAbortError, Rn as ViewSource, Rt as RequestOptions, S as PublicProfile, Sn as FeedTab, St as FeatureOperationId, T as UserSummary, Tn as ItdErrorCode, Tt as OperationMetadata, U as ItdConfigError, Ut as RuntimeOptions, V as ItdApiErrorKind, Vt as RetryDecisionContext, W as ItdConflictError, Wt as QueryParams, X as ItdForbiddenError, Xt as Logger, Y as ItdFileErrorReason, Yt as LogLevel, Z as ItdNetworkError, Zt as ItdClock, _ as MyProfile, _t as isItdValidationError, a as NotificationEvent, an as operationBucket, at as TimeoutBudget, b as PrivacySettings, bn as CommentSort, bt as STATUS_SERVICE, c as NotificationSettings, cn as BUCKET_LIMITS, ct as isItdConflictError, d as AuthUser, dn as IsoDate, dt as isItdForbiddenError, en as CustomOperationId, et as ItdRateLimitError, f as Author, fn as Span, ft as isItdNotFoundError, g as MessageAllowlistUser, gn as AttachmentType, gt as isItdStateError, h as MessageAllowlistMembership, hn as AccessType, ht as isItdServerError, i as formatNotificationText, in as isBuiltInOperationId, it as ItdValidationError, jt as PaginationOptions, k as Unsubscribe, kn as MessageAccess, kt as ErrorContextHook, l as Actor, ln as DEFAULT_RATE_LIMIT_BUCKET, lt as isItdError, m as LastSeen, mn as UserRef, mt as isItdRateLimitError, n as canonicalNotificationType, nn as OPERATIONS, nt as ItdStateError, o as normalizeNotification, on as operationMethod, ot as isItdApiError, p as FollowResult, pn as UserId, pt as isItdPhoneVerificationError, q as ItdFieldErrors, qt as RateLimitPacing, r as isKnownNotificationType, rn as OperationId, rt as ItdTimeoutError, s as Notification, sn as operationRetrySafety, st as isItdAuthError, t as resolveNotificationUrl, tn as ItdOperationDefinition, tt as ItdServerError, u as AuthState, un as RateLimitBucket, ut as isItdFileError, v as Pin, w as UserBase, wn as InteractionType, x as Profile, xt as LIBRARY_VERSION, y as PinsResult, yt as DEFAULT_BASE_URL, z as ItdApiError, zn as WallAccess, zt as ResponseContext } from "../shared/url-D7U9qjXD.cjs";
|
|
24
24
|
/** Опции конструктора {@link ItdRestClient}. */
|
|
25
25
|
interface RestClientOptions extends RuntimeOptions {
|
|
26
26
|
/**
|
|
@@ -62,6 +62,8 @@ export declare class ItdRestClient {
|
|
|
62
62
|
get files(): FilesResource;
|
|
63
63
|
/** Уведомления: список, счётчик, отметки о прочтении, настройки. */
|
|
64
64
|
get notifications(): NotificationsResource;
|
|
65
|
+
/** Чаты и сообщения текущего пользователя. */
|
|
66
|
+
get chats(): ChatsResource;
|
|
65
67
|
/** Хэштеги и посты по ним. */
|
|
66
68
|
get hashtags(): HashtagsResource;
|
|
67
69
|
/** Глобальный поиск по пользователям и хэштегам. */
|
|
@@ -166,4 +168,4 @@ export declare class ItdRestClient {
|
|
|
166
168
|
* ```
|
|
167
169
|
*/
|
|
168
170
|
export declare function createRestClient(options?: RestClientOptions): ItdRestClient;
|
|
169
|
-
export { ALLOWED_MIME_TYPES, AUDIO_MIME_TYPES, AccessType, type AccountLifecycleResource, 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 BannerDrawing, type BannerDrawingOperation, type BannerDrawingPoint, BannerDrawingTool, 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 LegalDocument, type LegalDocumentBlock, LegalDocumentBlockType, LegalDocumentScope, type LegalDocumentSummary, type LegalDocumentVersion, type LegalResource, 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 UploadedBannerDrawing, 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 };
|
|
171
|
+
export { ALLOWED_MIME_TYPES, AUDIO_MIME_TYPES, AccessType, type AccountLifecycleResource, 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 BannerDrawing, type BannerDrawingOperation, type BannerDrawingPoint, BannerDrawingTool, type BuilderInput, type BuiltInOperationId, type ChangelogEntry, ChatActionType, type ChatAttachment, type ChatChange, type ChatDeletedMessages, type ChatDirectResult, type ChatEditedMessage, type ChatFileLink, type ChatFirstMessage, type ChatForwardedMessages, type ChatHistoryPage, type ChatListPage, type ChatListParams, ChatMediaCategory, type ChatMediaItem, type ChatMediaPage, type ChatMessage, type ChatMessageContent, type ChatMessageReactions, type ChatPresence, type ChatPreview, type ChatReaction, type ChatReactionCatalog, type ChatReactionCount, ChatReactionType, type ChatReadCursor, type ChatReadResult, type ChatReply, type ChatSentMessage, type ChatSummary, type ChatTextEntity, type ChatUnreadState, type ChatUpdate, ChatUpdateType, type ChatUpdatesPage, type ChatUploadOptions, type ChatUploadedFile, ChatsResource, 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 ForwardChatMessagesInput, type FromStreamOptions, type Hashtag, type HashtagPostsParams, type HashtagsResource, IMAGE_MIME_TYPES, type ImageMimeType, IncidentKind, type InteractionEntry, InteractionType, type InternationalSubscriptionCapability, type InternationalSubscriptionCheckout, InternationalSubscriptionCheckoutMode, type InternationalSubscriptionOffer, 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 LegalDocument, type LegalDocumentBlock, LegalDocumentBlockType, LegalDocumentScope, type LegalDocumentSummary, type LegalDocumentVersion, type LegalResource, type LikeResult, LikesVisibility, type Listener, LogLevel, type Logger, type Loose, type ManagedClientResource, type MarkupBuilder, type MarkupContent, type MarkupInput, type MarkupSpan, MemoryShopOrderAccessStorage, MessageAccess, type MessageAllowlistMembership, type MessageAllowlistParams, type MessageAllowlistUser, type MessageBuilder, type MessageInput, type MessageMarkup, type MessageMarkupBuilder, type MessageMarkupContent, type MessageMarkupInput, 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, PaymentMethodType, 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 SendChatMessageInput, type ServiceDefinition, ServiceState, type ServiceStatus, type Session, type SetChatReactionsInput, 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 SubscriptionBindCardOptions, type SubscriptionCheckoutInput, SubscriptionCheckoutKind, type SubscriptionCheckoutReleaseInput, type SubscriptionCheckoutState, SubscriptionCheckoutStatus, type SubscriptionCheckoutSubject, type SubscriptionCheckoutTerms, type SubscriptionGift, type SubscriptionGiftInput, type SubscriptionOffer, type SubscriptionPayOptions, type SubscriptionPayment, type SubscriptionPaymentInput, SubscriptionPaymentProvider, type SubscriptionQuote, type SubscriptionRenewalAgreement, 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 UploadedBannerDrawing, 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, message, messageMarkup, normalizeNotification, operationBucket, operationMethod, operationRetrySafety, parseHtml, parseMarkdown, poll, post, renderSpans, report, resolveNotificationUrl, statusDays, systemClock, toDate, tokenProvider, utcStampToIso };
|
package/dist/rest/index.d.ts
CHANGED
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
*
|
|
19
19
|
* @packageDocumentation
|
|
20
20
|
*/
|
|
21
|
-
import { $ as
|
|
21
|
+
import { $ as InternationalSubscriptionCheckoutMode, $i as AttemptContext, $n as CommentReplyTo, $r as CreateReportInput, $t as ReportsResource, A as UsersResource, Ai as ChatSentMessage, An as Report, Ar as Paginator, At as ShopDeliveryDestination, B as ViewTracker, Bi as FeatureBucketDefinition, Bn as HashtagsResource, Br as messageMarkup, Bt as ShopOrderSummary, C as fromStream, Ci as ChatReaction, Cn as StatusDay, Cr as ChatsResource, Ct as ShopConsent, D as UpdatePrivacyInput, Di as ChatReadCursor, Dn as ChangelogEntry, Dr as Page, Dt as ShopDeliveryCalculation, E as MessageAllowlistParams, Ei as ChatReactionType, En as AnnouncementButton, Et as ShopCreatedOrder, F as TelemetryBatchOptions, Fi as ChatUpdateType, Fn as LegalDocumentBlockType, Fr as message, Ft as ShopOrderBase, G as SubscriptionCheckoutReleaseInput, Gi as ManagedClientResource, Gn as BannerDrawingOperation, Gr as MarkupSpan, Gt as ShopProductColor, H as ViewTrackerOptions, Hi as FeatureInstallation, Hn as UploadOptions, Hr as MarkupBuilder, Ht as ShopPayment, I as TelemetryClock, Ii as ChatUpdatesPage, In as LegalDocumentScope, Ir as MessageMarkup, It as ShopOrderDelivery, J as SubscriptionPayOptions, Ji as PreparedFileSource, Jn as UploadedBannerDrawing, Jr as markup, Jt as ShopRecipient, K as SubscriptionCheckoutTerms, Ki as FileResolver, Kn as BannerDrawingPoint, Kr as TextMarkup, Kt as ShopProductSpec, L as TelemetryOptions, Li as ChatUploadOptions, Ln as LegalDocumentSummary, Lr as MessageMarkupBuilder, Lt as ShopOrderItem, M as InteractionEntry, Mi as ChatTextEntity, Mn as LegalResource, Mr as mapPage, Mt as ShopOrder, N as PhotoOpenInput, Ni as ChatUnreadState, Nn as LegalDocument, Nr as MessageBuilder, Nt as ShopOrderAccessSession, O as UpdateProfileInput, Oi as ChatReadResult, On as Clan, Or as PageState, Ot as ShopDeliveryCity, P as TelemetryBatch, Pi as ChatUpdate, Pn as LegalDocumentBlock, Pr as MessageInput, Pt as ShopOrderAccessVerification, Q as InternationalSubscriptionCheckout, Qi as RateLimitBucketState, Qn as Comment, Qr as CreatePostData, Qt as SearchResult, R as TelemetryResource, Ri as ChatUploadedFile, Rn as LegalDocumentVersion, Rr as MessageMarkupContent, Rt as ShopOrderItemInput, S as VideoMimeType, Si as ChatPreview, Sn as ServiceStatus, Sr as ChatListParams, St as CreateShopOrderInput, T as VerificationResource, Ti as ChatReactionCount, Tn as Announcement, Tr as SetChatReactionsInput, Tt as ShopConsentKind, U as SubscriptionBindCardOptions, Ui as FeatureOperationDefinition, Un as UploadedFile, Ur as MarkupContent, Ut as ShopProduct, V as ViewTrackerInput, Vi as FeatureContext, Vn as FilesResource, Vr as AutoSpansOptions, Vt as ShopOrderSupport, W as SubscriptionCheckoutInput, Wi as FeatureRequestOptions, Wn as BannerDrawing, Wr as MarkupInput, Wt as ShopProductCategory, X as SubscriptionResource, Xi as ResolveFileContext, Xn as RepliesParams, Xr as CreateCommentInput, Xt as ShopSizeChartRow, Y as SubscriptionPaymentInput, Yi as PreparedStreamSource, Yn as CommentsResource, Yr as ChatMessageContent, Yt as ShopSizeChart, Z as InternationalSubscriptionCapability, Zi as ResolveFileOptions, Zn as Attachment, Zr as CreatePollInput, Zt as SearchResource, _ as AllowedMimeType, _i as ChatMediaItem, _n as parseMarkdown, _t as ShopDeliveryResource, a as ShopFeatureOptions, aa as OperationTransformContext, ai as ChatActionType, an as PostsResource, ar as Poll, at as SubscriptionCheckoutState, b as ImageMimeType, bi as ChatMessageReactions, bn as PlatformVersions, br as NotificationsResource, bt as ShopProductsResource, c as ShopOrderAccessStorage, ca as PluginTeardown, ci as ChatDeletedMessages, cn as PostBuilder, cr as PostBase, ct as SubscriptionGift, d as statusDays, di as ChatFileLink, dn as post, dr as PostUpdateResult, dt as SubscriptionPaymentProvider, ea as AttemptExtensions, ei as SendChatMessageInput, en as ReportBuilder, er as CommentUpdateResult, et as InternationalSubscriptionOffer, f as isMyProfile, fi as ChatFirstMessage, fn as PollBuilder, fr as UpdateResultBase, ft as SubscriptionQuote, g as AUDIO_MIME_TYPES, gi as ChatMediaCategory, gn as parseHtml, gr as AccountLifecycleResource, gt as ShopConsentsResource, h as ALLOWED_MIME_TYPES, hi as ChatListPage, hn as ParseMarkupOptions, hr as comment, ht as PayShopOrderOptions, i as ShopFeatureApi, ia as OperationExtensions, ii as isBuilder, in as FeedParams, ir as PinPostResult, it as SubscriptionCheckoutKind, j as DwellEntry, ji as ChatSummary, jn as VerificationStatus, jr as PaginatorOptions, jt as ShopDeliveryPoint, k as UserListParams, ki as ChatReply, kn as Portal, kr as PaginationMode, kt as ShopDeliveryCountry, l as ShopOrderAccessStorageAdapterOptions, li as ChatDirectResult, ln as PostInput, lr as PostCounters, lt as SubscriptionOffer, m as utcStampToIso, mi as ChatHistoryPage, mn as poll, mr as CommentInput, mt as CreateShopOrderOptions, n as SpanRenderFormat, na as AttemptNext, ni as BuilderInput, nn as report, nr as LikeResult, nt as PaymentMethodType, o as createShopFeature, oa as OperationTransformer, oi as ChatAttachment, on as UserPostsParams, or as PollOption, ot as SubscriptionCheckoutStatus, p as toDate, pi as ChatForwardedMessages, pn as PollInput, pr as CommentBuilder, pt as SubscriptionRenewalAgreement, q as SubscriptionGiftInput, qi as PreparedBufferSource, qn as BannerDrawingTool, qr as autoSpans, qt as ShopProductStatus, r as renderSpans, ra as ClientPlugin, ri as ItdBuilder, rn as CommentsParams, rr as OriginalPost, rt as Subscription, s as MemoryShopOrderAccessStorage, sa as PluginApi, si as ChatChange, sn as CreatePostInput, sr as Post, st as SubscriptionCheckoutSubject, t as RenderSpansOptions, ta as AttemptInterceptor, ti as UpdatePostInput, tn as ReportInput, tr as Hashtag, tt as PaymentMethod, u as createShopOrderAccessStorage, ui as ChatEditedMessage, un as PostUpdateInput, ur as PostStats, ut as SubscriptionPayment, v as AudioMimeType, vi as ChatMediaPage, vn as PlatformClientVersion, vr as Session, vt as ShopOrderRequestOptions, w as fromUrl, wi as ChatReactionCatalog, wn as StatusIncidentLine, wr as ForwardChatMessagesInput, wt as ShopConsentContext, x as VIDEO_MIME_TYPES, xi as ChatPresence, xn as PlatformStatus, xr as UpdateNotificationSettingsInput, xt as ShopResource, y as IMAGE_MIME_TYPES, yi as ChatMessage, yn as PlatformResource, yr as NotificationListParams, yt as ShopOrdersResource, z as VideoProgressInput, zi as ClientFeature, zn as HashtagPostsParams, zr as MessageMarkupInput, zt as ShopOrderStatus } from "../shared/render-DPXlBr5L.js";
|
|
22
22
|
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-pxnDIsQP.js";
|
|
23
|
-
import { $ as
|
|
23
|
+
import { $ as ItdServerError, $t as OPERATIONS, A as ClientConnection, An as ReportTargetType, At as RateLimitBucketOverride, B as ItdAuthError, Bt as RuntimeOptions, C as SubscriptionState, Cn as LastSeenUnit, Ct as OperationMethod, Dn as NotificationType, Dt as OperationRequestOptions, E as UsernameAvailability, En as MessageAccess, Et as ErrorContextHook, F as tokenProvider, Fn as ViewSource, Ft as RequestOptions, G as ItdFieldErrors, Gt as RuntimeMode, H as ItdConflictError, Ht as QueryValue, I as ItdAbortError, In as WallAccess, It as ResponseContext, J as ItdForbiddenError, Jt as ItdClock, K as ItdFileError, Kt as LogLevel, L as ItdApiError, Lt as RetryContext, M as AuthProvider, Mn as SpanType, Mt as RawRequestOptions, N as anonymousAuth, Nn as UsernameUnavailableReason, Nt as RequestContext, O as Listener, Ot as PaginationOptions, P as bearerToken, Pn as ViewReason, Pt as RequestExtensions, Q as ItdRateLimitError, Qt as ItdOperationDefinition, R as ItdApiErrorInit, Rt as RetryDecisionContext, S as PublicProfile, Sn as ItdErrorCode, St as OperationMetadata, T as UserSummary, Tn as Loose, Tt as ClientHooks, U as ItdError, Ut as ServiceDefinition, V as ItdConfigError, Vt as QueryParams, W as ItdErrorKind, Wt as RateLimitPacing, X as ItdNotFoundError, Xt as BuiltInOperationId, Y as ItdNetworkError, Yt as systemClock, Z as ItdPhoneVerificationError, Zt as CustomOperationId, _ as MyProfile, _n as CommentSort, _t as STATUS_SERVICE, a as NotificationEvent, an as BUCKET_LIMITS, at as isItdAuthError, b as PrivacySettings, bn as IncidentKind, bt as OperationAnnotations, c as NotificationSettings, cn as IsoDate, ct as isItdFileError, d as AuthUser, dn as UserRef, dt as isItdPhoneVerificationError, en as OperationId, et as ItdStateError, f as Author, fn as AccessType, ft as isItdRateLimitError, g as MessageAllowlistUser, gt as DEFAULT_BASE_URL, h as MessageAllowlistMembership, ht as isItdValidationError, i as formatNotificationText, in as operationRetrySafety, it as isItdApiError, jn as ServiceState, jt as RateLimitOptions, k as Unsubscribe, kn as ReportReason, kt as RateLimitBucketContext, l as Actor, ln as Span, lt as isItdForbiddenError, m as LastSeen, mt as isItdStateError, n as canonicalNotificationType, nn as operationBucket, nt as ItdValidationError, o as normalizeNotification, on as DEFAULT_RATE_LIMIT_BUCKET, ot as isItdConflictError, p as FollowResult, pn as AttachmentType, pt as isItdServerError, q as ItdFileErrorReason, qt as Logger, r as isKnownNotificationType, rn as operationMethod, rt as TimeoutBudget, s as Notification, sn as RateLimitBucket, st as isItdError, t as resolveNotificationUrl, tn as isBuiltInOperationId, tt as ItdTimeoutError, u as AuthState, un as UserId, ut as isItdNotFoundError, v as Pin, vt as LIBRARY_VERSION, w as UserBase, wn as LikesVisibility, wt as RetrySafety, x as Profile, xn as InteractionType, y as PinsResult, yn as FeedTab, yt as FeatureOperationId, z as ItdApiErrorKind, zt as RetryOptions } from "../shared/url-B_TELARK.js";
|
|
24
24
|
/** Опции конструктора {@link ItdRestClient}. */
|
|
25
25
|
interface RestClientOptions extends RuntimeOptions {
|
|
26
26
|
/**
|
|
@@ -62,6 +62,8 @@ export declare class ItdRestClient {
|
|
|
62
62
|
get files(): FilesResource;
|
|
63
63
|
/** Уведомления: список, счётчик, отметки о прочтении, настройки. */
|
|
64
64
|
get notifications(): NotificationsResource;
|
|
65
|
+
/** Чаты и сообщения текущего пользователя. */
|
|
66
|
+
get chats(): ChatsResource;
|
|
65
67
|
/** Хэштеги и посты по ним. */
|
|
66
68
|
get hashtags(): HashtagsResource;
|
|
67
69
|
/** Глобальный поиск по пользователям и хэштегам. */
|
|
@@ -166,4 +168,4 @@ export declare class ItdRestClient {
|
|
|
166
168
|
* ```
|
|
167
169
|
*/
|
|
168
170
|
export declare function createRestClient(options?: RestClientOptions): ItdRestClient;
|
|
169
|
-
export { ALLOWED_MIME_TYPES, AUDIO_MIME_TYPES, AccessType, type AccountLifecycleResource, 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 BannerDrawing, type BannerDrawingOperation, type BannerDrawingPoint, BannerDrawingTool, 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 LegalDocument, type LegalDocumentBlock, LegalDocumentBlockType, LegalDocumentScope, type LegalDocumentSummary, type LegalDocumentVersion, type LegalResource, 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 UploadedBannerDrawing, 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 };
|
|
171
|
+
export { ALLOWED_MIME_TYPES, AUDIO_MIME_TYPES, AccessType, type AccountLifecycleResource, 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 BannerDrawing, type BannerDrawingOperation, type BannerDrawingPoint, BannerDrawingTool, type BuilderInput, type BuiltInOperationId, type ChangelogEntry, ChatActionType, type ChatAttachment, type ChatChange, type ChatDeletedMessages, type ChatDirectResult, type ChatEditedMessage, type ChatFileLink, type ChatFirstMessage, type ChatForwardedMessages, type ChatHistoryPage, type ChatListPage, type ChatListParams, ChatMediaCategory, type ChatMediaItem, type ChatMediaPage, type ChatMessage, type ChatMessageContent, type ChatMessageReactions, type ChatPresence, type ChatPreview, type ChatReaction, type ChatReactionCatalog, type ChatReactionCount, ChatReactionType, type ChatReadCursor, type ChatReadResult, type ChatReply, type ChatSentMessage, type ChatSummary, type ChatTextEntity, type ChatUnreadState, type ChatUpdate, ChatUpdateType, type ChatUpdatesPage, type ChatUploadOptions, type ChatUploadedFile, ChatsResource, 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 ForwardChatMessagesInput, type FromStreamOptions, type Hashtag, type HashtagPostsParams, type HashtagsResource, IMAGE_MIME_TYPES, type ImageMimeType, IncidentKind, type InteractionEntry, InteractionType, type InternationalSubscriptionCapability, type InternationalSubscriptionCheckout, InternationalSubscriptionCheckoutMode, type InternationalSubscriptionOffer, 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 LegalDocument, type LegalDocumentBlock, LegalDocumentBlockType, LegalDocumentScope, type LegalDocumentSummary, type LegalDocumentVersion, type LegalResource, type LikeResult, LikesVisibility, type Listener, LogLevel, type Logger, type Loose, type ManagedClientResource, type MarkupBuilder, type MarkupContent, type MarkupInput, type MarkupSpan, MemoryShopOrderAccessStorage, MessageAccess, type MessageAllowlistMembership, type MessageAllowlistParams, type MessageAllowlistUser, type MessageBuilder, type MessageInput, type MessageMarkup, type MessageMarkupBuilder, type MessageMarkupContent, type MessageMarkupInput, 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, PaymentMethodType, 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 SendChatMessageInput, type ServiceDefinition, ServiceState, type ServiceStatus, type Session, type SetChatReactionsInput, 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 SubscriptionBindCardOptions, type SubscriptionCheckoutInput, SubscriptionCheckoutKind, type SubscriptionCheckoutReleaseInput, type SubscriptionCheckoutState, SubscriptionCheckoutStatus, type SubscriptionCheckoutSubject, type SubscriptionCheckoutTerms, type SubscriptionGift, type SubscriptionGiftInput, type SubscriptionOffer, type SubscriptionPayOptions, type SubscriptionPayment, type SubscriptionPaymentInput, SubscriptionPaymentProvider, type SubscriptionQuote, type SubscriptionRenewalAgreement, 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 UploadedBannerDrawing, 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, message, messageMarkup, normalizeNotification, operationBucket, operationMethod, operationRetrySafety, parseHtml, parseMarkdown, poll, post, renderSpans, report, resolveNotificationUrl, statusDays, systemClock, toDate, tokenProvider, utcStampToIso };
|
package/dist/rest/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { c as FileTransferMode } from "../shared/options-
|
|
3
|
-
import { $ as
|
|
1
|
+
import { $ as ChatReactionType, A as AccountLifecycleResource, B as AUDIO_MIME_TYPES, C as poll, D as LegalDocumentScope, E as LegalDocumentBlockType, G as autoSpans, H as VIDEO_MIME_TYPES, I as PaginationMode, K as markup, L as Paginator, M as createFeatureHost, N as ExtensibleOperationCatalog, O as comment, P as ChatsResource, Q as ChatMediaCategory, R as mapPage, S as post, T as parseMarkdown, U as message, V as IMAGE_MIME_TYPES, W as messageMarkup, X as utcStampToIso, Y as toDate, Z as ChatActionType, _ as PaymentMethodType, a as createShopOrderAccessStorage, b as SubscriptionPaymentProvider, c as ShopOrderStatus, d as isMyProfile, et as ChatUpdateType, f as BannerDrawingTool, g as InternationalSubscriptionCheckoutMode, h as createResources, i as MemoryShopOrderAccessStorage, j as NotificationsResource, k as createStatusFeature, l as ShopProductCategory, m as fromUrl, n as renderSpans, o as statusDays, p as fromStream, q as isBuilder, r as createShopFeature, s as ShopConsentKind, t as SpanRenderFormat, u as ShopProductStatus, v as SubscriptionCheckoutKind, w as parseHtml, x as report, y as SubscriptionCheckoutStatus, z as ALLOWED_MIME_TYPES } from "../shared/render-CgSQp84V.js";
|
|
2
|
+
import { c as FileTransferMode } from "../shared/options-D-8h06B_.js";
|
|
3
|
+
import { $ as CommentSort, B as OperationMethod, C as RateLimitPacing, F as operationBucket, I as operationMethod, J as AccessType, L as operationRetrySafety, M as OPERATIONS, P as isBuiltInOperationId, R as BUCKET_LIMITS, S as LIBRARY_VERSION, V as RetrySafety, Y as AttachmentType, _t as WallAccess, a as tokenProvider, at as LastSeenUnit, b as STATUS_SERVICE, ct as NotificationType, d as ITD_CATALOG, dt as ReportTargetType, f as createClientRuntime, ft as ServiceState, gt as ViewSource, ht as ViewReason, i as bearerToken, it as ItdErrorCode, l as canonicalNotificationType, mt as UsernameUnavailableReason, n as formatNotificationText, nt as IncidentKind, o as normalizeNotification, ot as LikesVisibility, pt as SpanType, r as anonymousAuth, rt as InteractionType, st as MessageAccess, t as resolveNotificationUrl, tt as FeedTab, u as isKnownNotificationType, ut as ReportReason, v as DEFAULT_BASE_URL, w as installAsyncDisposeFallback, yt as systemClock, z as DEFAULT_RATE_LIMIT_BUCKET } from "../shared/url-DYGRJqxh.js";
|
|
4
4
|
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-BQzL_oJ4.js";
|
|
5
|
-
import { E as LogLevel, v as RuntimeMode } from "../shared/
|
|
5
|
+
import { E as LogLevel, v as RuntimeMode } from "../shared/cookies-YP0m72v2.js";
|
|
6
6
|
// src/rest/client.ts
|
|
7
7
|
/**
|
|
8
8
|
* Минимальный клиент REST API итд.com.
|
|
@@ -53,6 +53,10 @@ var ItdRestClient = class ItdRestClient {
|
|
|
53
53
|
get notifications() {
|
|
54
54
|
return this.#resources.notifications;
|
|
55
55
|
}
|
|
56
|
+
/** Чаты и сообщения текущего пользователя. */
|
|
57
|
+
get chats() {
|
|
58
|
+
return this.#resources.chats;
|
|
59
|
+
}
|
|
56
60
|
/** Хэштеги и посты по ним. */
|
|
57
61
|
get hashtags() {
|
|
58
62
|
return this.#resources.hashtags;
|
|
@@ -104,9 +108,10 @@ var ItdRestClient = class ItdRestClient {
|
|
|
104
108
|
const status = this.#features.install(createStatusFeature());
|
|
105
109
|
this.#resources = createResources({
|
|
106
110
|
http: this.#runtime.http,
|
|
107
|
-
|
|
111
|
+
host: this.#features,
|
|
108
112
|
status,
|
|
109
|
-
createNotifications: (http) => new NotificationsResource(http)
|
|
113
|
+
createNotifications: (http) => new NotificationsResource(http),
|
|
114
|
+
createChats: () => new ChatsResource(this.#runtime.http, this.#features)
|
|
110
115
|
});
|
|
111
116
|
}
|
|
112
117
|
#assertActive(action) {
|
|
@@ -304,6 +309,6 @@ function resolveAuthProvider(auth) {
|
|
|
304
309
|
function createRestClient(options = {}) {
|
|
305
310
|
return new ItdRestClient(options);
|
|
306
311
|
}
|
|
307
|
-
export { ALLOWED_MIME_TYPES, AUDIO_MIME_TYPES, AccessType, AttachmentType, BUCKET_LIMITS, BannerDrawingTool, 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, LegalDocumentBlockType, LegalDocumentScope, 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 };
|
|
312
|
+
export { ALLOWED_MIME_TYPES, AUDIO_MIME_TYPES, AccessType, AttachmentType, BUCKET_LIMITS, BannerDrawingTool, ChatActionType, ChatMediaCategory, ChatReactionType, ChatUpdateType, ChatsResource, CommentSort, DEFAULT_BASE_URL, DEFAULT_RATE_LIMIT_BUCKET, FeedTab, FileTransferMode, IMAGE_MIME_TYPES, IncidentKind, InteractionType, InternationalSubscriptionCheckoutMode, ItdAbortError, ItdApiError, ItdApiErrorKind, ItdAuthError, ItdConfigError, ItdConflictError, ItdError, ItdErrorCode, ItdErrorKind, ItdFileError, ItdFileErrorReason, ItdForbiddenError, ItdNetworkError, ItdNotFoundError, ItdPhoneVerificationError, ItdRateLimitError, ItdRestClient, ItdServerError, ItdStateError, ItdTimeoutError, ItdValidationError, LIBRARY_VERSION, LastSeenUnit, LegalDocumentBlockType, LegalDocumentScope, LikesVisibility, LogLevel, MemoryShopOrderAccessStorage, MessageAccess, NotificationType, OPERATIONS, OperationMethod, PaginationMode, Paginator, PaymentMethodType, RateLimitPacing, ReportReason, ReportTargetType, RetrySafety, RuntimeMode, STATUS_SERVICE, ServiceState, ShopConsentKind, ShopOrderStatus, ShopProductCategory, ShopProductStatus, SpanRenderFormat, SpanType, SubscriptionCheckoutKind, SubscriptionCheckoutStatus, SubscriptionPaymentProvider, 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, message, messageMarkup, normalizeNotification, operationBucket, operationMethod, operationRetrySafety, parseHtml, parseMarkdown, poll, post, renderSpans, report, resolveNotificationUrl, statusDays, systemClock, toDate, tokenProvider, utcStampToIso };
|
|
308
313
|
|
|
309
314
|
//# sourceMappingURL=index.js.map
|