itd-api 0.10.3 → 0.10.4

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 (33) hide show
  1. package/dist/events/index.cjs +2 -2
  2. package/dist/events/index.d.cts +2 -2
  3. package/dist/events/index.d.ts +2 -2
  4. package/dist/events/index.js +2 -2
  5. package/dist/index.cjs +3 -3
  6. package/dist/index.d.cts +3 -3
  7. package/dist/index.d.ts +3 -3
  8. package/dist/index.js +3 -3
  9. package/dist/rest/index.cjs +2 -2
  10. package/dist/rest/index.d.cts +2 -2
  11. package/dist/rest/index.d.ts +2 -2
  12. package/dist/rest/index.js +2 -2
  13. package/dist/shared/{events-BVfqWyBw.cjs → events-B8cjz_Ed.cjs} +2 -2
  14. package/dist/shared/{events-BVfqWyBw.cjs.map → events-B8cjz_Ed.cjs.map} +1 -1
  15. package/dist/shared/{events-D0Wtt-If.d.cts → events-CK3zHntT.d.cts} +2 -2
  16. package/dist/shared/{events-Cwj7UPAa.js → events-D2n7Yu1P.js} +2 -2
  17. package/dist/shared/{events-Cwj7UPAa.js.map → events-D2n7Yu1P.js.map} +1 -1
  18. package/dist/shared/{events-Cp7ITueA.d.ts → events-DGdU8q1X.d.ts} +2 -2
  19. package/dist/shared/{render-CJO_L2CD.d.cts → render-9F_kR6sq.d.cts} +2 -2
  20. package/dist/shared/{render-CYJSDypQ.cjs → render-BrrZOSV5.cjs} +2 -2
  21. package/dist/shared/{render-CYJSDypQ.cjs.map → render-BrrZOSV5.cjs.map} +1 -1
  22. package/dist/shared/{render-BT74nC1l.js → render-C6CJ343E.js} +2 -2
  23. package/dist/shared/{render-BT74nC1l.js.map → render-C6CJ343E.js.map} +1 -1
  24. package/dist/shared/{render-DRmuHoEy.d.ts → render-UsOGMRzS.d.ts} +2 -2
  25. package/dist/shared/{url-BnO1aWsd.cjs → url-BNTKqBMB.cjs} +20 -10
  26. package/dist/shared/url-BNTKqBMB.cjs.map +1 -0
  27. package/dist/shared/{url-DS0-lrl-.js → url-Dc7wLikf.js} +20 -10
  28. package/dist/shared/url-Dc7wLikf.js.map +1 -0
  29. package/dist/shared/{url-BLnX-LYt.d.cts → url-yB6T_H_-.d.cts} +2 -2
  30. package/dist/shared/{url-BLnX-LYt.d.ts → url-yB6T_H_-.d.ts} +2 -2
  31. package/package.json +1 -1
  32. package/dist/shared/url-BnO1aWsd.cjs.map +0 -1
  33. package/dist/shared/url-DS0-lrl-.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { At as RequestOptions, Ct as PaginationOptions, Dt as RawRequestOptions, It as QueryParams, Rt as ServiceDefinition, Sn as ServiceState, St as OperationRequestOptions, Tn as ViewSource, Tt as RateLimitBucketOverride, Ut as BuiltInOperationId, Vt as ItdClock, _ as PrivacySettings, _n as Loose, _t as OperationMethod, bn as ReportReason, c as NotificationSettings, f as Author, fn as FeedTab, g as PinsResult, gt as OperationMetadata, ht as OperationContract, in as UserRef, lt as Unsubscribe, m as MyProfile, mn as InteractionType, mt as OperationAnnotations, nn as Span, nt as AuthIdentity, on as AttachmentType, p as FollowResult, pn as IncidentKind, qt as OperationId, rn as UserId, s as Notification, tn as IsoDate, tt as ClientConnection, un as CommentSort, v as Profile, vt as RetrySafety, wn as ViewReason, x as UserSummary, xn as ReportTargetType, xt as Logger, y as PublicProfile, yn as QrLocationPrecision, yt as ClientHooks } from "./url-BLnX-LYt.js";
1
+ import { At as RequestOptions, Ct as PaginationOptions, Dt as RawRequestOptions, It as QueryParams, Rt as ServiceDefinition, Sn as ServiceState, St as OperationRequestOptions, Tn as ViewSource, Tt as RateLimitBucketOverride, Ut as BuiltInOperationId, Vt as ItdClock, _ as PrivacySettings, _n as Loose, _t as OperationMethod, bn as ReportReason, c as NotificationSettings, f as Author, fn as FeedTab, g as PinsResult, gt as OperationMetadata, ht as OperationContract, in as UserRef, lt as Unsubscribe, m as MyProfile, mn as InteractionType, mt as OperationAnnotations, nn as Span, nt as AuthIdentity, on as AttachmentType, p as FollowResult, pn as IncidentKind, qt as OperationId, rn as UserId, s as Notification, tn as IsoDate, tt as ClientConnection, un as CommentSort, v as Profile, vt as RetrySafety, wn as ViewReason, x as UserSummary, xn as ReportTargetType, xt as Logger, y as PublicProfile, yn as QrLocationPrecision, yt as ClientHooks } from "./url-yB6T_H_-.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
4
  //#region src/core/cookies.d.ts
@@ -2880,4 +2880,4 @@ interface RenderSpansOptions {
2880
2880
  declare function renderSpans(content: string, spans?: readonly Span[] | null | undefined, options?: RenderSpansOptions): string;
2881
2881
  //#endregion
2882
2882
  export { ShopConsentContext as $, PageState 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, ClientPlugin as Cr, ShopSizeChart as Ct, UpdateProfileInput as D, PinPostResult as Dn, PluginApi as Dr, ReportsResource as Dt, UpdatePrivacyInput as E, LikeResult as En, OperationTransformer as Er, SearchResult as Et, TelemetryClock as F, comment as Fn, CreatePostInput as Ft, ShopConsentsResource as G, QrLoginTarget 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, NotificationListParams as Jn, MarkupContent as Jt, ShopDeliveryResource as K, Session 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, PluginTeardown as Or, ReportBuilder as Ot, TelemetryBatchOptions as P, CommentInput as Pn, UserPostsParams as Pt, ShopConsent as Q, Page as Qn, autoSpans as Qt, VideoProgressInput as R, isBuilder as Rn, PostUpdateInput as Rt, VideoMimeType as S, Comment as Sn, AttemptNext as Sr, ShopRecipient as St, VerificationResource as T, Hashtag as Tn, OperationTransformContext 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, UpdateNotificationSettingsInput as Xn, MarkupSpan as Xt, ShopProductsResource as Y, NotificationsResource as Yn, MarkupInput as Yt, CreateShopOrderInput as Z, BaseResource as Zn, TextMarkup as Zt, AllowedMimeType as _, UploadOptions as _n, ResolveFileOptions as _r, ShopProduct as _t, ShopFeatureOptions as a, StatusDay as an, ClientFeature as ar, ShopDeliveryDestination as at, ImageMimeType as b, RepliesParams as bn, AttemptExtensions as br, ShopProductSpec as bt, ShopOrderAccessStorage as c, AnnouncementButton as cn, FeatureInstallation as cr, ShopOrderAccessSession as ct, statusDays as d, Portal as dn, ManagedClientResource as dr, ShopOrderItem as dt, PlatformClientVersion as en, PaginationMode as er, ShopConsentKind as et, isMyProfile as f, Report as fn, FileResolver as fr, ShopOrderItemInput as ft, AUDIO_MIME_TYPES as g, FilesResource as gn, ResolveFileContext as gr, ShopPayment as gt, ALLOWED_MIME_TYPES as h, HashtagsResource as hn, PreparedStreamSource as hr, ShopOrderSupport as ht, ShopFeatureApi as i, ServiceStatus as in, RateLimitBucketState as ir, ShopDeliveryCountry as it, InteractionEntry as j, PostStats as jn, CommentsParams as jt, UsersResource as k, PollOption as kn, CookieJar as kr, ReportInput as kt, ShopOrderAccessStorageAdapterOptions as l, ChangelogEntry as ln, FeatureOperationDefinition as lr, ShopOrderAccessVerification as lt, utcStampToIso as m, HashtagPostsParams as mn, PreparedFileSource as mr, ShopOrderSummary as mt, SpanRenderFormat as n, PlatformVersions as nn, PaginatorOptions as nr, ShopDeliveryCalculation as nt, createShopFeature as o, StatusIncidentLine as on, FeatureBucketDefinition as or, ShopDeliveryPoint as ot, toDate as p, VerificationStatus as pn, PreparedBufferSource as pr, ShopOrderStatus as pt, ShopOrderRequestOptions as q, Subscription as qn, MarkupBuilder as qt, renderSpans as r, PlatformStatus as rn, mapPage as rr, ShopDeliveryCity as rt, MemoryShopOrderAccessStorage as s, Announcement as sn, FeatureContext as sr, ShopOrder as st, RenderSpansOptions as t, PlatformResource as tn, Paginator as tr, ShopCreatedOrder as tt, createShopOrderAccessStorage as u, Clan as un, FeatureRequestOptions as ur, ShopOrderDelivery as ut, AudioMimeType as v, UploadedFile as vn, HttpClient as vr, ShopProductCategory as vt, fromUrl as w, CommentUpdateResult as wn, OperationExtensions as wr, ShopSizeChartRow as wt, VIDEO_MIME_TYPES as x, Attachment as xn, AttemptInterceptor as xr, ShopProductStatus as xt, IMAGE_MIME_TYPES as y, CommentsResource as yn, AttemptContext as yr, ShopProductColor as yt, ViewTracker as z, CreateCommentInput as zn, post as zt };
2883
- //# sourceMappingURL=render-DRmuHoEy.d.ts.map
2883
+ //# sourceMappingURL=render-UsOGMRzS.d.ts.map
@@ -85,7 +85,7 @@ function requireOptionalBoolean(value, name) {
85
85
  //#endregion
86
86
  //#region src/core/version.ts
87
87
  /** Версия библиотеки. Попадает в `User-Agent`. */
88
- const LIBRARY_VERSION = "0.10.3";
88
+ const LIBRARY_VERSION = "0.10.4";
89
89
  //#endregion
90
90
  //#region src/core/config.ts
91
91
  /** Базовый URL API итд.com. Домен записан в punycode: `итд.com`. */
@@ -2031,6 +2031,13 @@ function pickString(source, field) {
2031
2031
  //#endregion
2032
2032
  //#region src/core/error-factory.ts
2033
2033
  /**
2034
+ * Отличает строковый машинный код (`NOT_FOUND`) от обычного текста и HTML страницы прокси.
2035
+ * Ограничение длины не даёт случайно принять большое служебное тело за код ошибки.
2036
+ */
2037
+ function readPlainTextErrorCode(value) {
2038
+ return value.length <= 128 && /^[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)*$/.test(value) ? value : void 0;
2039
+ }
2040
+ /**
2034
2041
  * Сводит ошибки по полям к единой форме `{ поле: [сообщения] }`.
2035
2042
  *
2036
2043
  * Понимает две документированные формы:
@@ -2070,14 +2077,17 @@ function collectFieldErrors(source) {
2070
2077
  */
2071
2078
  function parseErrorBody(body, status, statusText = "") {
2072
2079
  const fallbackMessage = statusText ? `HTTP ${status} ${statusText}` : `HTTP ${status}`;
2073
- if (typeof body === "string") return {
2074
- code: "UNKNOWN_ERROR",
2075
- message: asString(body.trim()) ?? fallbackMessage,
2076
- detail: void 0,
2077
- title: void 0,
2078
- fieldErrors: {},
2079
- userId: void 0
2080
- };
2080
+ if (typeof body === "string") {
2081
+ const message = asString(body.trim()) ?? fallbackMessage;
2082
+ return {
2083
+ code: readPlainTextErrorCode(message) ?? "UNKNOWN_ERROR",
2084
+ message,
2085
+ detail: void 0,
2086
+ title: void 0,
2087
+ fieldErrors: {},
2088
+ userId: void 0
2089
+ };
2090
+ }
2081
2091
  if (!isRecord(body)) return {
2082
2092
  code: "UNKNOWN_ERROR",
2083
2093
  message: fallbackMessage,
@@ -4533,4 +4543,4 @@ Object.defineProperty(exports, "voidResult", {
4533
4543
  }
4534
4544
  });
4535
4545
 
4536
- //# sourceMappingURL=url-BnO1aWsd.cjs.map
4546
+ //# sourceMappingURL=url-BNTKqBMB.cjs.map