itd-api 0.9.1 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/events/index.cjs +3 -4
- package/dist/events/index.d.cts +3 -3
- package/dist/events/index.d.ts +3 -3
- package/dist/events/index.js +4 -4
- package/dist/index.cjs +198 -39
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -65
- package/dist/index.d.ts +11 -65
- package/dist/index.js +199 -39
- package/dist/index.js.map +1 -1
- package/dist/node/index.cjs +3 -3
- package/dist/node/index.js +3 -3
- package/dist/rest/index.cjs +4 -5
- package/dist/rest/index.d.cts +3 -3
- package/dist/rest/index.d.ts +3 -3
- package/dist/rest/index.js +5 -5
- package/dist/shared/{events-BDdJyH2p.d.ts → events-BCn5LRnT.d.cts} +3 -5
- package/dist/shared/{events-D6y0Hxyz.js → events-BIBO2Jif.js} +4 -4
- package/dist/shared/{events-D6y0Hxyz.js.map → events-BIBO2Jif.js.map} +1 -1
- package/dist/shared/{events-BqFkwwTw.cjs → events-BsRm_Fba.cjs} +3 -9
- package/dist/shared/{events-BqFkwwTw.cjs.map → events-BsRm_Fba.cjs.map} +1 -1
- package/dist/shared/{events-BQyH5-S0.d.cts → events-t1uGgpkf.d.ts} +3 -5
- package/dist/shared/{multi-storage-SoW05uzO.js → multi-storage-C3Ngtop1.js} +13 -8
- package/dist/shared/multi-storage-C3Ngtop1.js.map +1 -0
- package/dist/shared/{multi-storage-CDKLa956.cjs → multi-storage-s-fPtjoy.cjs} +13 -8
- package/dist/shared/multi-storage-s-fPtjoy.cjs.map +1 -0
- package/dist/shared/{options-DOJYtoti.cjs → options-DjEtbVaf.cjs} +2 -2
- package/dist/shared/{options-DOJYtoti.cjs.map → options-DjEtbVaf.cjs.map} +1 -1
- package/dist/shared/{options-DhgGg7Ms.js → options-i4LrKfqx.js} +2 -2
- package/dist/shared/{options-DhgGg7Ms.js.map → options-i4LrKfqx.js.map} +1 -1
- package/dist/shared/{redact-Ba5iSVYZ.js → redact-DJV0XM3n.js} +40 -15
- package/dist/shared/redact-DJV0XM3n.js.map +1 -0
- package/dist/shared/{redact-BP00URmQ.cjs → redact-lAmck1Z6.cjs} +45 -14
- package/dist/shared/redact-lAmck1Z6.cjs.map +1 -0
- package/dist/shared/{render-sb1VJhUA.js → render--ZXmYEf-.js} +127 -96
- package/dist/shared/render--ZXmYEf-.js.map +1 -0
- package/dist/shared/{render-CZ_-F2Tl.d.ts → render-BdnBV-aT.d.ts} +82 -7
- package/dist/shared/{render-BU1_wex8.d.cts → render-DA83gS0f.d.cts} +82 -7
- package/dist/shared/{render-DAEeCMk9.cjs → render-DqVzx68r.cjs} +125 -100
- package/dist/shared/render-DqVzx68r.cjs.map +1 -0
- package/dist/shared/{storage-QNVxzpDB.cjs → storage-CZJZoaz9.cjs} +4 -2
- package/dist/shared/storage-CZJZoaz9.cjs.map +1 -0
- package/dist/shared/{storage-CfHKzVHf.js → storage-DiDe0PZM.js} +4 -2
- package/dist/shared/storage-DiDe0PZM.js.map +1 -0
- package/dist/shared/{url-CZZcyPI0.d.ts → url-Dbj6V6fk.d.cts} +4 -2
- package/dist/shared/{url-CZZcyPI0.d.cts → url-Dbj6V6fk.d.ts} +4 -2
- package/dist/shared/{url-CzHqE-Fg.cjs → url-Doc0XXW_.cjs} +274 -86
- package/dist/shared/url-Doc0XXW_.cjs.map +1 -0
- package/dist/shared/{url-Dsr4c5r5.js → url-i2f-X1hX.js} +274 -86
- package/dist/shared/url-i2f-X1hX.js.map +1 -0
- package/dist/web/index.cjs +1 -1
- package/dist/web/index.js +1 -1
- package/package.json +4 -4
- package/dist/shared/multi-storage-CDKLa956.cjs.map +0 -1
- package/dist/shared/multi-storage-SoW05uzO.js.map +0 -1
- package/dist/shared/redact-BP00URmQ.cjs.map +0 -1
- package/dist/shared/redact-Ba5iSVYZ.js.map +0 -1
- package/dist/shared/render-DAEeCMk9.cjs.map +0 -1
- package/dist/shared/render-sb1VJhUA.js.map +0 -1
- package/dist/shared/storage-CfHKzVHf.js.map +0 -1
- package/dist/shared/storage-QNVxzpDB.cjs.map +0 -1
- package/dist/shared/url-CzHqE-Fg.cjs.map +0 -1
- package/dist/shared/url-Dsr4c5r5.js.map +0 -1
|
@@ -1,6 +1,70 @@
|
|
|
1
|
-
import { At as RequestOptions, Ct as PaginationOptions, Dt as RawRequestOptions, It as QueryParams, Rt as ServiceDefinition, St as OperationRequestOptions, Tt as RateLimitBucketOverride, Ut as BuiltInOperationId, Vt as ItdClock, _ as PrivacySettings, _n as ReportTargetType, _t as OperationMethod, bn as ViewReason, c as NotificationSettings, dn as InteractionType, f as Author, g as PinsResult, gn as ReportReason, gt as OperationMetadata, ht as OperationContract, in as UserRef, ln as FeedTab, lt as Unsubscribe, m as MyProfile, mn as Loose, mt as OperationAnnotations, nn as Span, nt as AuthIdentity, on as AttachmentType, p as FollowResult, qt as OperationId, rn as UserId, s as Notification, sn as CommentSort, tn as IsoDate, tt as ClientConnection, un as IncidentKind, v as Profile, vn as ServiceState, vt as RetrySafety, x as UserSummary, xn as ViewSource, xt as Logger, y as PublicProfile } from "./url-
|
|
1
|
+
import { At as RequestOptions, Ct as PaginationOptions, Dt as RawRequestOptions, It as QueryParams, Rt as ServiceDefinition, St as OperationRequestOptions, Tt as RateLimitBucketOverride, Ut as BuiltInOperationId, Vt as ItdClock, _ as PrivacySettings, _n as ReportTargetType, _t as OperationMethod, bn as ViewReason, c as NotificationSettings, dn as InteractionType, f as Author, g as PinsResult, gn as ReportReason, gt as OperationMetadata, ht as OperationContract, in as UserRef, ln as FeedTab, lt as Unsubscribe, m as MyProfile, mn as Loose, mt as OperationAnnotations, nn as Span, nt as AuthIdentity, on as AttachmentType, p as FollowResult, qt as OperationId, rn as UserId, s as Notification, sn as CommentSort, tn as IsoDate, tt as ClientConnection, un as IncidentKind, v as Profile, vn as ServiceState, vt as RetrySafety, x as UserSummary, xn as ViewSource, xt as Logger, y as PublicProfile, yt as ClientHooks } from "./url-Dbj6V6fk.js";
|
|
2
2
|
import { c as LazyFile, d as UrlFileOptions, i as FileStreamContent, l as StreamFile, n as FileContext, o as FileTransferMode, r as FileInput, s as FromStreamOptions } from "./contracts-BoT7msmq.js";
|
|
3
3
|
import { r as KeyValueStore } from "./key-value-store-COZaNHZS.js";
|
|
4
|
+
//#region src/core/cookies.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Минимальное хранилище cookie для сред без своего.
|
|
7
|
+
*
|
|
8
|
+
* Refresh-токен итд.com приходит в `Set-Cookie`, а `fetch` вне браузера cookie не хранит —
|
|
9
|
+
* без jar сессию не продлить. В браузере и React Native не используется: там cookie ведёт
|
|
10
|
+
* сама среда.
|
|
11
|
+
*
|
|
12
|
+
* Реализована практическая часть RFC 6265: origin, путь, срок жизни, флаг `Secure`.
|
|
13
|
+
* Доменные cookie для поддоменов намеренно не поддерживаются — API работает с одного хоста.
|
|
14
|
+
*/
|
|
15
|
+
declare class CookieJar {
|
|
16
|
+
#private;
|
|
17
|
+
/** Независимая копия для auth-flow, который ещё не получил право на commit. */
|
|
18
|
+
clone(): CookieJar;
|
|
19
|
+
/** Атомарно с точки зрения синхронных читателей заменяет содержимое снимком другого jar. */
|
|
20
|
+
replaceWith(source: CookieJar): void;
|
|
21
|
+
/**
|
|
22
|
+
* Забирает `Set-Cookie` из ответа.
|
|
23
|
+
*
|
|
24
|
+
* Использует `Headers.getSetCookie()`, где он есть (Node 20+, undici). В остальных средах
|
|
25
|
+
* заголовки склеены в одну строку, и её нельзя резать по запятой напрямую: запятая есть
|
|
26
|
+
* внутри `Expires=Wed, 09 Jun 2027 …`. Разделением занимается `set-cookie-parser`.
|
|
27
|
+
*/
|
|
28
|
+
setFromResponse(url: string, response: Response): void;
|
|
29
|
+
/**
|
|
30
|
+
* Кладёт cookie напрямую, минуя `Set-Cookie`.
|
|
31
|
+
*
|
|
32
|
+
* Нужно ровно в одном случае: пользователь передал refresh-токен строкой, а сервер читает
|
|
33
|
+
* его только из cookie. Значение не кодируется — оно уходит в заголовок как есть.
|
|
34
|
+
*/
|
|
35
|
+
set(url: string, name: string, value: string, path?: string): void;
|
|
36
|
+
/** Сохраняет cookie из готовых строк `Set-Cookie`. */
|
|
37
|
+
setFromStrings(url: string, setCookieStrings: string[]): void;
|
|
38
|
+
/**
|
|
39
|
+
* Собирает значение заголовка `Cookie` для запроса.
|
|
40
|
+
*
|
|
41
|
+
* @returns строка вида `a=1; b=2` либо `undefined`, если подходящих cookie нет
|
|
42
|
+
*/
|
|
43
|
+
getHeader(url: string): string | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Значение действующей cookie.
|
|
46
|
+
*
|
|
47
|
+
* Нужно, чтобы забрать обновлённый refresh-токен: сервер ротирует его при каждом
|
|
48
|
+
* продлении сессии, и сохранять надо именно новое значение.
|
|
49
|
+
*
|
|
50
|
+
* @param url если указан, учитываются origin, путь и флаг `Secure`
|
|
51
|
+
*/
|
|
52
|
+
getValue(name: string, url?: string): string | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Есть ли действующая cookie с таким именем.
|
|
55
|
+
*
|
|
56
|
+
* Используется для проверки флага {@link AUTH_FLAG_COOKIE} перед запросом обновления
|
|
57
|
+
* токена: у анонима refresh-сессии нет, и дёргать API незачем.
|
|
58
|
+
*/
|
|
59
|
+
has(name: string, url?: string): boolean;
|
|
60
|
+
/** Сохраняет содержимое jar для записи в {@link TokenStorage}. */
|
|
61
|
+
serialize(): string[];
|
|
62
|
+
/** Восстанавливает jar из результата {@link serialize}. Некорректные записи молча пропускаются. */
|
|
63
|
+
deserialize(entries: readonly string[] | undefined): void;
|
|
64
|
+
/** Удаляет все cookie. */
|
|
65
|
+
clear(): void;
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
4
68
|
//#region src/core/plugins/contracts.d.ts
|
|
5
69
|
/**
|
|
6
70
|
* Обёртка одной логической операции.
|
|
@@ -13,6 +77,7 @@ import { r as KeyValueStore } from "./key-value-store-COZaNHZS.js";
|
|
|
13
77
|
* @param next следующая обёртка либо выполнение операции
|
|
14
78
|
* `next()` возвращает результат публичного метода. Если обёртка не вызывает `next`, её
|
|
15
79
|
* собственный результат считается готовым и повторно не нормализуется.
|
|
80
|
+
* @param context общий lifecycle операции; его signal учитывает timeout и `dispose()` клиента
|
|
16
81
|
*
|
|
17
82
|
* @returns результат в том виде, в котором его получит вызывающий код
|
|
18
83
|
*
|
|
@@ -22,7 +87,12 @@ import { r as KeyValueStore } from "./key-value-store-COZaNHZS.js";
|
|
|
22
87
|
* next({ ...request, headers: { ...request.headers, 'X-Trace': trace() } });
|
|
23
88
|
* ```
|
|
24
89
|
*/
|
|
25
|
-
type OperationTransformer = (request: OperationRequestOptions, next: (request: OperationRequestOptions) => Promise<unknown
|
|
90
|
+
type OperationTransformer = (request: OperationRequestOptions, next: (request: OperationRequestOptions) => Promise<unknown>, context: OperationTransformContext) => Promise<unknown>;
|
|
91
|
+
/** Состояние времени жизни логической операции, не влияющее на её семантические параметры. */
|
|
92
|
+
interface OperationTransformContext {
|
|
93
|
+
/** Общий сигнал пользовательской отмены, timeout и освобождения клиента. */
|
|
94
|
+
readonly signal: AbortSignal;
|
|
95
|
+
}
|
|
26
96
|
/** Финальные данные одной транспортной попытки. */
|
|
27
97
|
interface AttemptContext {
|
|
28
98
|
/** Постоянный идентификатор операции. */
|
|
@@ -224,7 +294,7 @@ declare class PluginRegistry {
|
|
|
224
294
|
*
|
|
225
295
|
* @param execute выполнение логической операции, вызываемое самым внутренним transformer
|
|
226
296
|
*/
|
|
227
|
-
run(request: OperationRequestOptions, execute: (request: OperationRequestOptions) => Promise<unknown
|
|
297
|
+
run(request: OperationRequestOptions, execute: (request: OperationRequestOptions) => Promise<unknown>, signal: AbortSignal): Promise<unknown>;
|
|
228
298
|
}
|
|
229
299
|
//#endregion
|
|
230
300
|
//#region src/core/execution/pipeline.d.ts
|
|
@@ -252,6 +322,8 @@ type RequestBodyFactory = (context: RequestBodyContext) => PreparedRequestBody |
|
|
|
252
322
|
* `Authorization`, заданный вызывающим кодом вручную.
|
|
253
323
|
*/
|
|
254
324
|
interface PipelineRequest extends OperationRequestOptions {
|
|
325
|
+
/** Изолированный cookie jar конкретного auth-flow. @internal */
|
|
326
|
+
cookieJar?: CookieJar | undefined;
|
|
255
327
|
/** Повторяемое тело. Используется внутренними ресурсами вместо `body`. @internal */
|
|
256
328
|
bodyFactory?: RequestBodyFactory | undefined;
|
|
257
329
|
/**
|
|
@@ -283,6 +355,11 @@ interface HttpClientDeps {
|
|
|
283
355
|
handler: RequestHandler;
|
|
284
356
|
plugins: PluginRegistry;
|
|
285
357
|
baseUrl: string;
|
|
358
|
+
timeout: number;
|
|
359
|
+
clock: ItdClock;
|
|
360
|
+
lifetimeSignal?: AbortSignal | undefined;
|
|
361
|
+
hooks: ClientHooks;
|
|
362
|
+
assertActive?: (() => void) | undefined;
|
|
286
363
|
}
|
|
287
364
|
/** Параметры операции без ID и метода, заданных её контрактом. @internal */
|
|
288
365
|
type HttpOperationOptions = Omit<PipelineRequest, 'operationId' | 'method'>;
|
|
@@ -2728,8 +2805,6 @@ interface ShopOrderAccessStorageAdapterOptions {
|
|
|
2728
2805
|
}
|
|
2729
2806
|
/** Создаёт хранилище доступа к заказам поверх `KeyValueStore`. */
|
|
2730
2807
|
declare function createShopOrderAccessStorage(store: KeyValueStore<ShopOrderAccessSession>, options?: ShopOrderAccessStorageAdapterOptions): ShopOrderAccessStorage;
|
|
2731
|
-
/** Создаёт независимое хранилище доступа к заказам в памяти. */
|
|
2732
|
-
declare function createMemoryShopOrderAccessStorage(): ShopOrderAccessStorage;
|
|
2733
2808
|
//#endregion
|
|
2734
2809
|
//#region src/shop/feature.d.ts
|
|
2735
2810
|
/** Настройки подключаемого модуля доступа к заказам по коду из письма. */
|
|
@@ -2790,5 +2865,5 @@ interface RenderSpansOptions {
|
|
|
2790
2865
|
*/
|
|
2791
2866
|
declare function renderSpans(content: string, spans?: readonly Span[] | null | undefined, options?: RenderSpansOptions): string;
|
|
2792
2867
|
//#endregion
|
|
2793
|
-
export {
|
|
2794
|
-
//# sourceMappingURL=render-
|
|
2868
|
+
export { ShopConsentContext as $, PaginationMode as $n, markup as $t, DwellEntry as A, Post as An, report as At, ViewTrackerInput as B, CreatePollInput as Bn, PollBuilder as Bt, fromStream as C, CommentReplyTo as Cn, OperationExtensions as Cr, ShopSizeChart as Ct, UpdateProfileInput as D, PinPostResult as Dn, PluginTeardown as Dr, ReportsResource as Dt, UpdatePrivacyInput as E, LikeResult as En, PluginApi as Er, SearchResult as Et, TelemetryClock as F, comment as Fn, CreatePostInput as Ft, ShopConsentsResource as G, Session as Gn, parseMarkdown as Gt, SubscriptionResource as H, CreateReportInput as Hn, poll as Ht, TelemetryOptions as I, BuilderInput as In, PostBuilder as It, ShopOrdersResource as J, NotificationsResource as Jn, MarkupContent as Jt, ShopDeliveryResource as K, Subscription as Kn, AutoSpansOptions as Kt, TelemetryResource as L, ItdBuilder as Ln, PostInput as Lt, PhotoOpenInput as M, PostUpdateResult as Mn, FeedParams as Mt, TelemetryBatch as N, CommentBuilder as Nn, PostsResource as Nt, UserListParams as O, Poll as On, CookieJar as Or, ReportBuilder as Ot, TelemetryBatchOptions as P, CommentInput as Pn, UserPostsParams as Pt, ShopConsent as Q, PageState as Qn, autoSpans as Qt, VideoProgressInput as R, isBuilder as Rn, PostUpdateInput as Rt, VideoMimeType as S, Comment as Sn, ClientPlugin as Sr, ShopRecipient as St, VerificationResource as T, Hashtag as Tn, OperationTransformer as Tr, SearchResource as Tt, CreateShopOrderOptions as U, UpdatePostInput as Un, ParseMarkupOptions as Ut, ViewTrackerOptions as V, CreatePostData as Vn, PollInput as Vt, PayShopOrderOptions as W, PaymentMethod as Wn, parseHtml as Wt, ShopResource as X, BaseResource as Xn, MarkupSpan as Xt, ShopProductsResource as Y, UpdateNotificationSettingsInput as Yn, MarkupInput as Yt, CreateShopOrderInput as Z, Page as Zn, TextMarkup as Zt, AllowedMimeType as _, UploadOptions as _n, HttpClient as _r, ShopProduct as _t, ShopFeatureOptions as a, StatusDay as an, FeatureBucketDefinition as ar, ShopDeliveryDestination as at, ImageMimeType as b, RepliesParams as bn, AttemptInterceptor as br, ShopProductSpec as bt, ShopOrderAccessStorage as c, AnnouncementButton as cn, FeatureOperationDefinition as cr, ShopOrderAccessSession as ct, statusDays as d, Portal as dn, FileResolver as dr, ShopOrderItem as dt, PlatformClientVersion as en, Paginator as er, ShopConsentKind as et, isMyProfile as f, Report as fn, PreparedBufferSource as fr, ShopOrderItemInput as ft, AUDIO_MIME_TYPES as g, FilesResource as gn, ResolveFileOptions as gr, ShopPayment as gt, ALLOWED_MIME_TYPES as h, HashtagsResource as hn, ResolveFileContext as hr, ShopOrderSupport as ht, ShopFeatureApi as i, ServiceStatus as in, ClientFeature as ir, ShopDeliveryCountry as it, InteractionEntry as j, PostStats as jn, CommentsParams as jt, UsersResource as k, PollOption as kn, ReportInput as kt, ShopOrderAccessStorageAdapterOptions as l, ChangelogEntry as ln, FeatureRequestOptions as lr, ShopOrderAccessVerification as lt, utcStampToIso as m, HashtagPostsParams as mn, PreparedStreamSource as mr, ShopOrderSummary as mt, SpanRenderFormat as n, PlatformVersions as nn, mapPage as nr, ShopDeliveryCalculation as nt, createShopFeature as o, StatusIncidentLine as on, FeatureContext as or, ShopDeliveryPoint as ot, toDate as p, VerificationStatus as pn, PreparedFileSource as pr, ShopOrderStatus as pt, ShopOrderRequestOptions as q, NotificationListParams as qn, MarkupBuilder as qt, renderSpans as r, PlatformStatus as rn, RateLimitBucketState as rr, ShopDeliveryCity as rt, MemoryShopOrderAccessStorage as s, Announcement as sn, FeatureInstallation as sr, ShopOrder as st, RenderSpansOptions as t, PlatformResource as tn, PaginatorOptions as tr, ShopCreatedOrder as tt, createShopOrderAccessStorage as u, Clan as un, ManagedClientResource as ur, ShopOrderDelivery as ut, AudioMimeType as v, UploadedFile as vn, AttemptContext as vr, ShopProductCategory as vt, fromUrl as w, CommentUpdateResult as wn, OperationTransformContext as wr, ShopSizeChartRow as wt, VIDEO_MIME_TYPES as x, Attachment as xn, AttemptNext as xr, ShopProductStatus as xt, IMAGE_MIME_TYPES as y, CommentsResource as yn, AttemptExtensions as yr, ShopProductColor as yt, ViewTracker as z, CreateCommentInput as zn, post as zt };
|
|
2869
|
+
//# sourceMappingURL=render-BdnBV-aT.d.ts.map
|
|
@@ -1,6 +1,70 @@
|
|
|
1
|
-
import { At as RequestOptions, Ct as PaginationOptions, Dt as RawRequestOptions, It as QueryParams, Rt as ServiceDefinition, St as OperationRequestOptions, Tt as RateLimitBucketOverride, Ut as BuiltInOperationId, Vt as ItdClock, _ as PrivacySettings, _n as ReportTargetType, _t as OperationMethod, bn as ViewReason, c as NotificationSettings, dn as InteractionType, f as Author, g as PinsResult, gn as ReportReason, gt as OperationMetadata, ht as OperationContract, in as UserRef, ln as FeedTab, lt as Unsubscribe, m as MyProfile, mn as Loose, mt as OperationAnnotations, nn as Span, nt as AuthIdentity, on as AttachmentType, p as FollowResult, qt as OperationId, rn as UserId, s as Notification, sn as CommentSort, tn as IsoDate, tt as ClientConnection, un as IncidentKind, v as Profile, vn as ServiceState, vt as RetrySafety, x as UserSummary, xn as ViewSource, xt as Logger, y as PublicProfile } from "./url-
|
|
1
|
+
import { At as RequestOptions, Ct as PaginationOptions, Dt as RawRequestOptions, It as QueryParams, Rt as ServiceDefinition, St as OperationRequestOptions, Tt as RateLimitBucketOverride, Ut as BuiltInOperationId, Vt as ItdClock, _ as PrivacySettings, _n as ReportTargetType, _t as OperationMethod, bn as ViewReason, c as NotificationSettings, dn as InteractionType, f as Author, g as PinsResult, gn as ReportReason, gt as OperationMetadata, ht as OperationContract, in as UserRef, ln as FeedTab, lt as Unsubscribe, m as MyProfile, mn as Loose, mt as OperationAnnotations, nn as Span, nt as AuthIdentity, on as AttachmentType, p as FollowResult, qt as OperationId, rn as UserId, s as Notification, sn as CommentSort, tn as IsoDate, tt as ClientConnection, un as IncidentKind, v as Profile, vn as ServiceState, vt as RetrySafety, x as UserSummary, xn as ViewSource, xt as Logger, y as PublicProfile, yt as ClientHooks } from "./url-Dbj6V6fk.cjs";
|
|
2
2
|
import { c as LazyFile, d as UrlFileOptions, i as FileStreamContent, l as StreamFile, n as FileContext, o as FileTransferMode, r as FileInput, s as FromStreamOptions } from "./contracts-BoT7msmq.cjs";
|
|
3
3
|
import { r as KeyValueStore } from "./key-value-store-COZaNHZS.cjs";
|
|
4
|
+
//#region src/core/cookies.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Минимальное хранилище cookie для сред без своего.
|
|
7
|
+
*
|
|
8
|
+
* Refresh-токен итд.com приходит в `Set-Cookie`, а `fetch` вне браузера cookie не хранит —
|
|
9
|
+
* без jar сессию не продлить. В браузере и React Native не используется: там cookie ведёт
|
|
10
|
+
* сама среда.
|
|
11
|
+
*
|
|
12
|
+
* Реализована практическая часть RFC 6265: origin, путь, срок жизни, флаг `Secure`.
|
|
13
|
+
* Доменные cookie для поддоменов намеренно не поддерживаются — API работает с одного хоста.
|
|
14
|
+
*/
|
|
15
|
+
declare class CookieJar {
|
|
16
|
+
#private;
|
|
17
|
+
/** Независимая копия для auth-flow, который ещё не получил право на commit. */
|
|
18
|
+
clone(): CookieJar;
|
|
19
|
+
/** Атомарно с точки зрения синхронных читателей заменяет содержимое снимком другого jar. */
|
|
20
|
+
replaceWith(source: CookieJar): void;
|
|
21
|
+
/**
|
|
22
|
+
* Забирает `Set-Cookie` из ответа.
|
|
23
|
+
*
|
|
24
|
+
* Использует `Headers.getSetCookie()`, где он есть (Node 20+, undici). В остальных средах
|
|
25
|
+
* заголовки склеены в одну строку, и её нельзя резать по запятой напрямую: запятая есть
|
|
26
|
+
* внутри `Expires=Wed, 09 Jun 2027 …`. Разделением занимается `set-cookie-parser`.
|
|
27
|
+
*/
|
|
28
|
+
setFromResponse(url: string, response: Response): void;
|
|
29
|
+
/**
|
|
30
|
+
* Кладёт cookie напрямую, минуя `Set-Cookie`.
|
|
31
|
+
*
|
|
32
|
+
* Нужно ровно в одном случае: пользователь передал refresh-токен строкой, а сервер читает
|
|
33
|
+
* его только из cookie. Значение не кодируется — оно уходит в заголовок как есть.
|
|
34
|
+
*/
|
|
35
|
+
set(url: string, name: string, value: string, path?: string): void;
|
|
36
|
+
/** Сохраняет cookie из готовых строк `Set-Cookie`. */
|
|
37
|
+
setFromStrings(url: string, setCookieStrings: string[]): void;
|
|
38
|
+
/**
|
|
39
|
+
* Собирает значение заголовка `Cookie` для запроса.
|
|
40
|
+
*
|
|
41
|
+
* @returns строка вида `a=1; b=2` либо `undefined`, если подходящих cookie нет
|
|
42
|
+
*/
|
|
43
|
+
getHeader(url: string): string | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Значение действующей cookie.
|
|
46
|
+
*
|
|
47
|
+
* Нужно, чтобы забрать обновлённый refresh-токен: сервер ротирует его при каждом
|
|
48
|
+
* продлении сессии, и сохранять надо именно новое значение.
|
|
49
|
+
*
|
|
50
|
+
* @param url если указан, учитываются origin, путь и флаг `Secure`
|
|
51
|
+
*/
|
|
52
|
+
getValue(name: string, url?: string): string | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Есть ли действующая cookie с таким именем.
|
|
55
|
+
*
|
|
56
|
+
* Используется для проверки флага {@link AUTH_FLAG_COOKIE} перед запросом обновления
|
|
57
|
+
* токена: у анонима refresh-сессии нет, и дёргать API незачем.
|
|
58
|
+
*/
|
|
59
|
+
has(name: string, url?: string): boolean;
|
|
60
|
+
/** Сохраняет содержимое jar для записи в {@link TokenStorage}. */
|
|
61
|
+
serialize(): string[];
|
|
62
|
+
/** Восстанавливает jar из результата {@link serialize}. Некорректные записи молча пропускаются. */
|
|
63
|
+
deserialize(entries: readonly string[] | undefined): void;
|
|
64
|
+
/** Удаляет все cookie. */
|
|
65
|
+
clear(): void;
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
4
68
|
//#region src/core/plugins/contracts.d.ts
|
|
5
69
|
/**
|
|
6
70
|
* Обёртка одной логической операции.
|
|
@@ -13,6 +77,7 @@ import { r as KeyValueStore } from "./key-value-store-COZaNHZS.cjs";
|
|
|
13
77
|
* @param next следующая обёртка либо выполнение операции
|
|
14
78
|
* `next()` возвращает результат публичного метода. Если обёртка не вызывает `next`, её
|
|
15
79
|
* собственный результат считается готовым и повторно не нормализуется.
|
|
80
|
+
* @param context общий lifecycle операции; его signal учитывает timeout и `dispose()` клиента
|
|
16
81
|
*
|
|
17
82
|
* @returns результат в том виде, в котором его получит вызывающий код
|
|
18
83
|
*
|
|
@@ -22,7 +87,12 @@ import { r as KeyValueStore } from "./key-value-store-COZaNHZS.cjs";
|
|
|
22
87
|
* next({ ...request, headers: { ...request.headers, 'X-Trace': trace() } });
|
|
23
88
|
* ```
|
|
24
89
|
*/
|
|
25
|
-
type OperationTransformer = (request: OperationRequestOptions, next: (request: OperationRequestOptions) => Promise<unknown
|
|
90
|
+
type OperationTransformer = (request: OperationRequestOptions, next: (request: OperationRequestOptions) => Promise<unknown>, context: OperationTransformContext) => Promise<unknown>;
|
|
91
|
+
/** Состояние времени жизни логической операции, не влияющее на её семантические параметры. */
|
|
92
|
+
interface OperationTransformContext {
|
|
93
|
+
/** Общий сигнал пользовательской отмены, timeout и освобождения клиента. */
|
|
94
|
+
readonly signal: AbortSignal;
|
|
95
|
+
}
|
|
26
96
|
/** Финальные данные одной транспортной попытки. */
|
|
27
97
|
interface AttemptContext {
|
|
28
98
|
/** Постоянный идентификатор операции. */
|
|
@@ -224,7 +294,7 @@ declare class PluginRegistry {
|
|
|
224
294
|
*
|
|
225
295
|
* @param execute выполнение логической операции, вызываемое самым внутренним transformer
|
|
226
296
|
*/
|
|
227
|
-
run(request: OperationRequestOptions, execute: (request: OperationRequestOptions) => Promise<unknown
|
|
297
|
+
run(request: OperationRequestOptions, execute: (request: OperationRequestOptions) => Promise<unknown>, signal: AbortSignal): Promise<unknown>;
|
|
228
298
|
}
|
|
229
299
|
//#endregion
|
|
230
300
|
//#region src/core/execution/pipeline.d.ts
|
|
@@ -252,6 +322,8 @@ type RequestBodyFactory = (context: RequestBodyContext) => PreparedRequestBody |
|
|
|
252
322
|
* `Authorization`, заданный вызывающим кодом вручную.
|
|
253
323
|
*/
|
|
254
324
|
interface PipelineRequest extends OperationRequestOptions {
|
|
325
|
+
/** Изолированный cookie jar конкретного auth-flow. @internal */
|
|
326
|
+
cookieJar?: CookieJar | undefined;
|
|
255
327
|
/** Повторяемое тело. Используется внутренними ресурсами вместо `body`. @internal */
|
|
256
328
|
bodyFactory?: RequestBodyFactory | undefined;
|
|
257
329
|
/**
|
|
@@ -283,6 +355,11 @@ interface HttpClientDeps {
|
|
|
283
355
|
handler: RequestHandler;
|
|
284
356
|
plugins: PluginRegistry;
|
|
285
357
|
baseUrl: string;
|
|
358
|
+
timeout: number;
|
|
359
|
+
clock: ItdClock;
|
|
360
|
+
lifetimeSignal?: AbortSignal | undefined;
|
|
361
|
+
hooks: ClientHooks;
|
|
362
|
+
assertActive?: (() => void) | undefined;
|
|
286
363
|
}
|
|
287
364
|
/** Параметры операции без ID и метода, заданных её контрактом. @internal */
|
|
288
365
|
type HttpOperationOptions = Omit<PipelineRequest, 'operationId' | 'method'>;
|
|
@@ -2728,8 +2805,6 @@ interface ShopOrderAccessStorageAdapterOptions {
|
|
|
2728
2805
|
}
|
|
2729
2806
|
/** Создаёт хранилище доступа к заказам поверх `KeyValueStore`. */
|
|
2730
2807
|
declare function createShopOrderAccessStorage(store: KeyValueStore<ShopOrderAccessSession>, options?: ShopOrderAccessStorageAdapterOptions): ShopOrderAccessStorage;
|
|
2731
|
-
/** Создаёт независимое хранилище доступа к заказам в памяти. */
|
|
2732
|
-
declare function createMemoryShopOrderAccessStorage(): ShopOrderAccessStorage;
|
|
2733
2808
|
//#endregion
|
|
2734
2809
|
//#region src/shop/feature.d.ts
|
|
2735
2810
|
/** Настройки подключаемого модуля доступа к заказам по коду из письма. */
|
|
@@ -2790,5 +2865,5 @@ interface RenderSpansOptions {
|
|
|
2790
2865
|
*/
|
|
2791
2866
|
declare function renderSpans(content: string, spans?: readonly Span[] | null | undefined, options?: RenderSpansOptions): string;
|
|
2792
2867
|
//#endregion
|
|
2793
|
-
export {
|
|
2794
|
-
//# sourceMappingURL=render-
|
|
2868
|
+
export { ShopConsentContext as $, PaginationMode as $n, markup as $t, DwellEntry as A, Post as An, report as At, ViewTrackerInput as B, CreatePollInput as Bn, PollBuilder as Bt, fromStream as C, CommentReplyTo as Cn, OperationExtensions as Cr, ShopSizeChart as Ct, UpdateProfileInput as D, PinPostResult as Dn, PluginTeardown as Dr, ReportsResource as Dt, UpdatePrivacyInput as E, LikeResult as En, PluginApi as Er, SearchResult as Et, TelemetryClock as F, comment as Fn, CreatePostInput as Ft, ShopConsentsResource as G, Session as Gn, parseMarkdown as Gt, SubscriptionResource as H, CreateReportInput as Hn, poll as Ht, TelemetryOptions as I, BuilderInput as In, PostBuilder as It, ShopOrdersResource as J, NotificationsResource as Jn, MarkupContent as Jt, ShopDeliveryResource as K, Subscription as Kn, AutoSpansOptions as Kt, TelemetryResource as L, ItdBuilder as Ln, PostInput as Lt, PhotoOpenInput as M, PostUpdateResult as Mn, FeedParams as Mt, TelemetryBatch as N, CommentBuilder as Nn, PostsResource as Nt, UserListParams as O, Poll as On, CookieJar as Or, ReportBuilder as Ot, TelemetryBatchOptions as P, CommentInput as Pn, UserPostsParams as Pt, ShopConsent as Q, PageState as Qn, autoSpans as Qt, VideoProgressInput as R, isBuilder as Rn, PostUpdateInput as Rt, VideoMimeType as S, Comment as Sn, ClientPlugin as Sr, ShopRecipient as St, VerificationResource as T, Hashtag as Tn, OperationTransformer as Tr, SearchResource as Tt, CreateShopOrderOptions as U, UpdatePostInput as Un, ParseMarkupOptions as Ut, ViewTrackerOptions as V, CreatePostData as Vn, PollInput as Vt, PayShopOrderOptions as W, PaymentMethod as Wn, parseHtml as Wt, ShopResource as X, BaseResource as Xn, MarkupSpan as Xt, ShopProductsResource as Y, UpdateNotificationSettingsInput as Yn, MarkupInput as Yt, CreateShopOrderInput as Z, Page as Zn, TextMarkup as Zt, AllowedMimeType as _, UploadOptions as _n, HttpClient as _r, ShopProduct as _t, ShopFeatureOptions as a, StatusDay as an, FeatureBucketDefinition as ar, ShopDeliveryDestination as at, ImageMimeType as b, RepliesParams as bn, AttemptInterceptor as br, ShopProductSpec as bt, ShopOrderAccessStorage as c, AnnouncementButton as cn, FeatureOperationDefinition as cr, ShopOrderAccessSession as ct, statusDays as d, Portal as dn, FileResolver as dr, ShopOrderItem as dt, PlatformClientVersion as en, Paginator as er, ShopConsentKind as et, isMyProfile as f, Report as fn, PreparedBufferSource as fr, ShopOrderItemInput as ft, AUDIO_MIME_TYPES as g, FilesResource as gn, ResolveFileOptions as gr, ShopPayment as gt, ALLOWED_MIME_TYPES as h, HashtagsResource as hn, ResolveFileContext as hr, ShopOrderSupport as ht, ShopFeatureApi as i, ServiceStatus as in, ClientFeature as ir, ShopDeliveryCountry as it, InteractionEntry as j, PostStats as jn, CommentsParams as jt, UsersResource as k, PollOption as kn, ReportInput as kt, ShopOrderAccessStorageAdapterOptions as l, ChangelogEntry as ln, FeatureRequestOptions as lr, ShopOrderAccessVerification as lt, utcStampToIso as m, HashtagPostsParams as mn, PreparedStreamSource as mr, ShopOrderSummary as mt, SpanRenderFormat as n, PlatformVersions as nn, mapPage as nr, ShopDeliveryCalculation as nt, createShopFeature as o, StatusIncidentLine as on, FeatureContext as or, ShopDeliveryPoint as ot, toDate as p, VerificationStatus as pn, PreparedFileSource as pr, ShopOrderStatus as pt, ShopOrderRequestOptions as q, NotificationListParams as qn, MarkupBuilder as qt, renderSpans as r, PlatformStatus as rn, RateLimitBucketState as rr, ShopDeliveryCity as rt, MemoryShopOrderAccessStorage as s, Announcement as sn, FeatureInstallation as sr, ShopOrder as st, RenderSpansOptions as t, PlatformResource as tn, PaginatorOptions as tr, ShopCreatedOrder as tt, createShopOrderAccessStorage as u, Clan as un, ManagedClientResource as ur, ShopOrderDelivery as ut, AudioMimeType as v, UploadedFile as vn, AttemptContext as vr, ShopProductCategory as vt, fromUrl as w, CommentUpdateResult as wn, OperationTransformContext as wr, ShopSizeChartRow as wt, VIDEO_MIME_TYPES as x, Attachment as xn, AttemptNext as xr, ShopProductStatus as xt, IMAGE_MIME_TYPES as y, CommentsResource as yn, AttemptExtensions as yr, ShopProductColor as yt, ViewTracker as z, CreateCommentInput as zn, post as zt };
|
|
2869
|
+
//# sourceMappingURL=render-DA83gS0f.d.cts.map
|