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.
Files changed (63) hide show
  1. package/dist/events/index.cjs +3 -4
  2. package/dist/events/index.d.cts +3 -3
  3. package/dist/events/index.d.ts +3 -3
  4. package/dist/events/index.js +4 -4
  5. package/dist/index.cjs +198 -39
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.cts +11 -65
  8. package/dist/index.d.ts +11 -65
  9. package/dist/index.js +199 -39
  10. package/dist/index.js.map +1 -1
  11. package/dist/node/index.cjs +3 -3
  12. package/dist/node/index.js +3 -3
  13. package/dist/rest/index.cjs +4 -5
  14. package/dist/rest/index.d.cts +3 -3
  15. package/dist/rest/index.d.ts +3 -3
  16. package/dist/rest/index.js +5 -5
  17. package/dist/shared/{events-BDdJyH2p.d.ts → events-BCn5LRnT.d.cts} +3 -5
  18. package/dist/shared/{events-D6y0Hxyz.js → events-BIBO2Jif.js} +4 -4
  19. package/dist/shared/{events-D6y0Hxyz.js.map → events-BIBO2Jif.js.map} +1 -1
  20. package/dist/shared/{events-BqFkwwTw.cjs → events-BsRm_Fba.cjs} +3 -9
  21. package/dist/shared/{events-BqFkwwTw.cjs.map → events-BsRm_Fba.cjs.map} +1 -1
  22. package/dist/shared/{events-BQyH5-S0.d.cts → events-t1uGgpkf.d.ts} +3 -5
  23. package/dist/shared/{multi-storage-SoW05uzO.js → multi-storage-C3Ngtop1.js} +13 -8
  24. package/dist/shared/multi-storage-C3Ngtop1.js.map +1 -0
  25. package/dist/shared/{multi-storage-CDKLa956.cjs → multi-storage-s-fPtjoy.cjs} +13 -8
  26. package/dist/shared/multi-storage-s-fPtjoy.cjs.map +1 -0
  27. package/dist/shared/{options-DOJYtoti.cjs → options-DjEtbVaf.cjs} +2 -2
  28. package/dist/shared/{options-DOJYtoti.cjs.map → options-DjEtbVaf.cjs.map} +1 -1
  29. package/dist/shared/{options-DhgGg7Ms.js → options-i4LrKfqx.js} +2 -2
  30. package/dist/shared/{options-DhgGg7Ms.js.map → options-i4LrKfqx.js.map} +1 -1
  31. package/dist/shared/{redact-Ba5iSVYZ.js → redact-DJV0XM3n.js} +40 -15
  32. package/dist/shared/redact-DJV0XM3n.js.map +1 -0
  33. package/dist/shared/{redact-BP00URmQ.cjs → redact-lAmck1Z6.cjs} +45 -14
  34. package/dist/shared/redact-lAmck1Z6.cjs.map +1 -0
  35. package/dist/shared/{render-sb1VJhUA.js → render--ZXmYEf-.js} +127 -96
  36. package/dist/shared/render--ZXmYEf-.js.map +1 -0
  37. package/dist/shared/{render-CZ_-F2Tl.d.ts → render-BdnBV-aT.d.ts} +82 -7
  38. package/dist/shared/{render-BU1_wex8.d.cts → render-DA83gS0f.d.cts} +82 -7
  39. package/dist/shared/{render-DAEeCMk9.cjs → render-DqVzx68r.cjs} +125 -100
  40. package/dist/shared/render-DqVzx68r.cjs.map +1 -0
  41. package/dist/shared/{storage-QNVxzpDB.cjs → storage-CZJZoaz9.cjs} +4 -2
  42. package/dist/shared/storage-CZJZoaz9.cjs.map +1 -0
  43. package/dist/shared/{storage-CfHKzVHf.js → storage-DiDe0PZM.js} +4 -2
  44. package/dist/shared/storage-DiDe0PZM.js.map +1 -0
  45. package/dist/shared/{url-CZZcyPI0.d.ts → url-Dbj6V6fk.d.cts} +4 -2
  46. package/dist/shared/{url-CZZcyPI0.d.cts → url-Dbj6V6fk.d.ts} +4 -2
  47. package/dist/shared/{url-CzHqE-Fg.cjs → url-Doc0XXW_.cjs} +274 -86
  48. package/dist/shared/url-Doc0XXW_.cjs.map +1 -0
  49. package/dist/shared/{url-Dsr4c5r5.js → url-i2f-X1hX.js} +274 -86
  50. package/dist/shared/url-i2f-X1hX.js.map +1 -0
  51. package/dist/web/index.cjs +1 -1
  52. package/dist/web/index.js +1 -1
  53. package/package.json +4 -4
  54. package/dist/shared/multi-storage-CDKLa956.cjs.map +0 -1
  55. package/dist/shared/multi-storage-SoW05uzO.js.map +0 -1
  56. package/dist/shared/redact-BP00URmQ.cjs.map +0 -1
  57. package/dist/shared/redact-Ba5iSVYZ.js.map +0 -1
  58. package/dist/shared/render-DAEeCMk9.cjs.map +0 -1
  59. package/dist/shared/render-sb1VJhUA.js.map +0 -1
  60. package/dist/shared/storage-CfHKzVHf.js.map +0 -1
  61. package/dist/shared/storage-QNVxzpDB.cjs.map +0 -1
  62. package/dist/shared/url-CzHqE-Fg.cjs.map +0 -1
  63. 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-CZZcyPI0.js";
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>) => 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>): 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 { ShopConsent as $, PageState as $n, autoSpans as $t, UsersResource as A, PollOption as An, ReportInput as At, ViewTracker as B, CreateCommentInput as Bn, post as Bt, VideoMimeType as C, Comment as Cn, ClientPlugin as Cr, ShopRecipient as Ct, UpdatePrivacyInput as D, LikeResult as Dn, PluginTeardown as Dr, SearchResult as Dt, VerificationResource as E, Hashtag as En, PluginApi as Er, SearchResource as Et, TelemetryBatchOptions as F, CommentInput as Fn, UserPostsParams as Ft, PayShopOrderOptions as G, PaymentMethod as Gn, parseHtml as Gt, ViewTrackerOptions as H, CreatePostData as Hn, PollInput as Ht, TelemetryClock as I, comment as In, CreatePostInput as It, ShopOrderRequestOptions as J, NotificationListParams as Jn, MarkupBuilder as Jt, ShopConsentsResource as K, Session as Kn, parseMarkdown as Kt, TelemetryOptions as L, BuilderInput as Ln, PostBuilder as Lt, InteractionEntry as M, PostStats as Mn, CommentsParams as Mt, PhotoOpenInput as N, PostUpdateResult as Nn, FeedParams as Nt, UpdateProfileInput as O, PinPostResult as On, ReportsResource as Ot, TelemetryBatch as P, CommentBuilder as Pn, PostsResource as Pt, CreateShopOrderInput as Q, Page as Qn, TextMarkup as Qt, TelemetryResource as R, ItdBuilder as Rn, PostInput as Rt, VIDEO_MIME_TYPES as S, Attachment as Sn, AttemptNext as Sr, ShopProductStatus as St, fromUrl as T, CommentUpdateResult as Tn, OperationTransformer as Tr, ShopSizeChartRow as Tt, SubscriptionResource as U, CreateReportInput as Un, poll as Ut, ViewTrackerInput as V, CreatePollInput as Vn, PollBuilder as Vt, CreateShopOrderOptions as W, UpdatePostInput as Wn, ParseMarkupOptions as Wt, ShopProductsResource as X, UpdateNotificationSettingsInput as Xn, MarkupInput as Xt, ShopOrdersResource as Y, NotificationsResource as Yn, MarkupContent as Yt, ShopResource as Z, BaseResource as Zn, MarkupSpan as Zt, AUDIO_MIME_TYPES as _, FilesResource as _n, ResolveFileOptions as _r, ShopPayment as _t, ShopFeatureOptions as a, ServiceStatus as an, ClientFeature as ar, ShopDeliveryCountry as at, IMAGE_MIME_TYPES as b, CommentsResource as bn, AttemptExtensions as br, ShopProductColor as bt, ShopOrderAccessStorage as c, Announcement as cn, FeatureInstallation as cr, ShopOrder as ct, createShopOrderAccessStorage as d, Clan as dn, ManagedClientResource as dr, ShopOrderDelivery as dt, markup as en, PaginationMode as er, ShopConsentContext as et, statusDays as f, Portal as fn, FileResolver as fr, ShopOrderItem as ft, ALLOWED_MIME_TYPES as g, HashtagsResource as gn, ResolveFileContext as gr, ShopOrderSupport as gt, utcStampToIso as h, HashtagPostsParams as hn, PreparedStreamSource as hr, ShopOrderSummary as ht, ShopFeatureApi as i, PlatformStatus as in, RateLimitBucketState as ir, ShopDeliveryCity as it, DwellEntry as j, Post as jn, report as jt, UserListParams as k, Poll as kn, ReportBuilder as kt, ShopOrderAccessStorageAdapterOptions as l, AnnouncementButton as ln, FeatureOperationDefinition as lr, ShopOrderAccessSession as lt, toDate as m, VerificationStatus as mn, PreparedFileSource as mr, ShopOrderStatus as mt, SpanRenderFormat as n, PlatformResource as nn, PaginatorOptions as nr, ShopCreatedOrder as nt, createShopFeature as o, StatusDay as on, FeatureBucketDefinition as or, ShopDeliveryDestination as ot, isMyProfile as p, Report as pn, PreparedBufferSource as pr, ShopOrderItemInput as pt, ShopDeliveryResource as q, Subscription as qn, AutoSpansOptions as qt, renderSpans as r, PlatformVersions as rn, mapPage as rr, ShopDeliveryCalculation as rt, MemoryShopOrderAccessStorage as s, StatusIncidentLine as sn, FeatureContext as sr, ShopDeliveryPoint as st, RenderSpansOptions as t, PlatformClientVersion as tn, Paginator as tr, ShopConsentKind as tt, createMemoryShopOrderAccessStorage as u, ChangelogEntry as un, FeatureRequestOptions as ur, ShopOrderAccessVerification as ut, AllowedMimeType as v, UploadOptions as vn, HttpClient as vr, ShopProduct as vt, fromStream as w, CommentReplyTo as wn, OperationExtensions as wr, ShopSizeChart as wt, ImageMimeType as x, RepliesParams as xn, AttemptInterceptor as xr, ShopProductSpec as xt, AudioMimeType as y, UploadedFile as yn, AttemptContext as yr, ShopProductCategory as yt, VideoProgressInput as z, isBuilder as zn, PostUpdateInput as zt };
2794
- //# sourceMappingURL=render-CZ_-F2Tl.d.ts.map
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-CZZcyPI0.cjs";
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>) => 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>): 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 { ShopConsent as $, PageState as $n, autoSpans as $t, UsersResource as A, PollOption as An, ReportInput as At, ViewTracker as B, CreateCommentInput as Bn, post as Bt, VideoMimeType as C, Comment as Cn, ClientPlugin as Cr, ShopRecipient as Ct, UpdatePrivacyInput as D, LikeResult as Dn, PluginTeardown as Dr, SearchResult as Dt, VerificationResource as E, Hashtag as En, PluginApi as Er, SearchResource as Et, TelemetryBatchOptions as F, CommentInput as Fn, UserPostsParams as Ft, PayShopOrderOptions as G, PaymentMethod as Gn, parseHtml as Gt, ViewTrackerOptions as H, CreatePostData as Hn, PollInput as Ht, TelemetryClock as I, comment as In, CreatePostInput as It, ShopOrderRequestOptions as J, NotificationListParams as Jn, MarkupBuilder as Jt, ShopConsentsResource as K, Session as Kn, parseMarkdown as Kt, TelemetryOptions as L, BuilderInput as Ln, PostBuilder as Lt, InteractionEntry as M, PostStats as Mn, CommentsParams as Mt, PhotoOpenInput as N, PostUpdateResult as Nn, FeedParams as Nt, UpdateProfileInput as O, PinPostResult as On, ReportsResource as Ot, TelemetryBatch as P, CommentBuilder as Pn, PostsResource as Pt, CreateShopOrderInput as Q, Page as Qn, TextMarkup as Qt, TelemetryResource as R, ItdBuilder as Rn, PostInput as Rt, VIDEO_MIME_TYPES as S, Attachment as Sn, AttemptNext as Sr, ShopProductStatus as St, fromUrl as T, CommentUpdateResult as Tn, OperationTransformer as Tr, ShopSizeChartRow as Tt, SubscriptionResource as U, CreateReportInput as Un, poll as Ut, ViewTrackerInput as V, CreatePollInput as Vn, PollBuilder as Vt, CreateShopOrderOptions as W, UpdatePostInput as Wn, ParseMarkupOptions as Wt, ShopProductsResource as X, UpdateNotificationSettingsInput as Xn, MarkupInput as Xt, ShopOrdersResource as Y, NotificationsResource as Yn, MarkupContent as Yt, ShopResource as Z, BaseResource as Zn, MarkupSpan as Zt, AUDIO_MIME_TYPES as _, FilesResource as _n, ResolveFileOptions as _r, ShopPayment as _t, ShopFeatureOptions as a, ServiceStatus as an, ClientFeature as ar, ShopDeliveryCountry as at, IMAGE_MIME_TYPES as b, CommentsResource as bn, AttemptExtensions as br, ShopProductColor as bt, ShopOrderAccessStorage as c, Announcement as cn, FeatureInstallation as cr, ShopOrder as ct, createShopOrderAccessStorage as d, Clan as dn, ManagedClientResource as dr, ShopOrderDelivery as dt, markup as en, PaginationMode as er, ShopConsentContext as et, statusDays as f, Portal as fn, FileResolver as fr, ShopOrderItem as ft, ALLOWED_MIME_TYPES as g, HashtagsResource as gn, ResolveFileContext as gr, ShopOrderSupport as gt, utcStampToIso as h, HashtagPostsParams as hn, PreparedStreamSource as hr, ShopOrderSummary as ht, ShopFeatureApi as i, PlatformStatus as in, RateLimitBucketState as ir, ShopDeliveryCity as it, DwellEntry as j, Post as jn, report as jt, UserListParams as k, Poll as kn, ReportBuilder as kt, ShopOrderAccessStorageAdapterOptions as l, AnnouncementButton as ln, FeatureOperationDefinition as lr, ShopOrderAccessSession as lt, toDate as m, VerificationStatus as mn, PreparedFileSource as mr, ShopOrderStatus as mt, SpanRenderFormat as n, PlatformResource as nn, PaginatorOptions as nr, ShopCreatedOrder as nt, createShopFeature as o, StatusDay as on, FeatureBucketDefinition as or, ShopDeliveryDestination as ot, isMyProfile as p, Report as pn, PreparedBufferSource as pr, ShopOrderItemInput as pt, ShopDeliveryResource as q, Subscription as qn, AutoSpansOptions as qt, renderSpans as r, PlatformVersions as rn, mapPage as rr, ShopDeliveryCalculation as rt, MemoryShopOrderAccessStorage as s, StatusIncidentLine as sn, FeatureContext as sr, ShopDeliveryPoint as st, RenderSpansOptions as t, PlatformClientVersion as tn, Paginator as tr, ShopConsentKind as tt, createMemoryShopOrderAccessStorage as u, ChangelogEntry as un, FeatureRequestOptions as ur, ShopOrderAccessVerification as ut, AllowedMimeType as v, UploadOptions as vn, HttpClient as vr, ShopProduct as vt, fromStream as w, CommentReplyTo as wn, OperationExtensions as wr, ShopSizeChart as wt, ImageMimeType as x, RepliesParams as xn, AttemptInterceptor as xr, ShopProductSpec as xt, AudioMimeType as y, UploadedFile as yn, AttemptContext as yr, ShopProductCategory as yt, VideoProgressInput as z, isBuilder as zn, PostUpdateInput as zt };
2794
- //# sourceMappingURL=render-BU1_wex8.d.cts.map
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