itd-api 0.8.0 → 0.9.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 +66 -21
- package/dist/events/index.cjs +3 -3
- package/dist/events/index.d.cts +2 -2
- package/dist/events/index.d.ts +2 -2
- package/dist/events/index.js +3 -3
- package/dist/index.cjs +26 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -6
- package/dist/index.d.ts +9 -6
- package/dist/index.js +13 -8
- package/dist/index.js.map +1 -1
- package/dist/node/index.cjs +5 -4
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +2 -2
- package/dist/node/index.d.ts +2 -2
- package/dist/node/index.js +4 -3
- package/dist/node/index.js.map +1 -1
- package/dist/rest/index.cjs +16 -4
- 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 +9 -5
- package/dist/rest/index.js.map +1 -1
- package/dist/shared/{events-QyhQZrnC.d.ts → events-BDdJyH2p.d.ts} +2 -2
- package/dist/shared/{events-Br2r7coi.d.cts → events-BQyH5-S0.d.cts} +2 -2
- package/dist/shared/{events-iTteVsd_.cjs → events-BqFkwwTw.cjs} +3 -3
- package/dist/shared/{events-iTteVsd_.cjs.map → events-BqFkwwTw.cjs.map} +1 -1
- package/dist/shared/{events-TfhKh26b.js → events-D6y0Hxyz.js} +3 -3
- package/dist/shared/{events-TfhKh26b.js.map → events-D6y0Hxyz.js.map} +1 -1
- package/dist/shared/{storage-BLmXmzKF.cjs → key-value-store-B5GYVEYZ.cjs} +1 -85
- package/dist/shared/key-value-store-B5GYVEYZ.cjs.map +1 -0
- package/dist/shared/{storage-CCxn0Kkv.js → key-value-store-Bt2PSMxY.js} +2 -68
- package/dist/shared/key-value-store-Bt2PSMxY.js.map +1 -0
- package/dist/shared/key-value-store-COZaNHZS.d.cts +69 -0
- package/dist/shared/key-value-store-COZaNHZS.d.ts +69 -0
- package/dist/shared/{multi-storage-DccjD7Ww.d.ts → multi-storage-BEL7tcKn.d.cts} +3 -2
- package/dist/shared/{multi-storage-CCUgkqvI.cjs → multi-storage-CDKLa956.cjs} +8 -7
- package/dist/shared/{multi-storage-CCUgkqvI.cjs.map → multi-storage-CDKLa956.cjs.map} +1 -1
- package/dist/shared/{multi-storage-CjAPB5Kq.d.cts → multi-storage-LkljOSzA.d.ts} +3 -2
- package/dist/shared/{multi-storage-1AEZTczk.js → multi-storage-SoW05uzO.js} +4 -3
- package/dist/shared/{multi-storage-1AEZTczk.js.map → multi-storage-SoW05uzO.js.map} +1 -1
- package/dist/shared/{options-BUfoHE9G.cjs → options-DOJYtoti.cjs} +2 -2
- package/dist/shared/{options-BUfoHE9G.cjs.map → options-DOJYtoti.cjs.map} +1 -1
- package/dist/shared/{options-BNP633A5.js → options-DhgGg7Ms.js} +2 -2
- package/dist/shared/{options-BNP633A5.js.map → options-DhgGg7Ms.js.map} +1 -1
- package/dist/shared/{redact-DB9EMGJx.cjs → redact-BP00URmQ.cjs} +15 -4
- package/dist/shared/{redact-DB9EMGJx.cjs.map → redact-BP00URmQ.cjs.map} +1 -1
- package/dist/shared/{redact-FNK29Fv-.js → redact-Ba5iSVYZ.js} +15 -4
- package/dist/shared/{redact-FNK29Fv-.js.map → redact-Ba5iSVYZ.js.map} +1 -1
- package/dist/shared/{render-BszcKF7S.d.cts → render-BU1_wex8.d.cts} +378 -12
- package/dist/shared/{render-DVB7T8pm.d.ts → render-CZ_-F2Tl.d.ts} +378 -12
- package/dist/shared/{render-DNTESBSl.cjs → render-DAEeCMk9.cjs} +461 -8
- package/dist/shared/render-DAEeCMk9.cjs.map +1 -0
- package/dist/shared/{render-CiL1VS0b.js → render-sb1VJhUA.js} +415 -10
- package/dist/shared/render-sb1VJhUA.js.map +1 -0
- package/dist/shared/storage-BQrtKon9.d.cts +86 -0
- package/dist/shared/storage-CTRGT5wF.d.ts +86 -0
- package/dist/shared/storage-CfHKzVHf.js +71 -0
- package/dist/shared/storage-CfHKzVHf.js.map +1 -0
- package/dist/shared/storage-QNVxzpDB.cjs +88 -0
- package/dist/shared/storage-QNVxzpDB.cjs.map +1 -0
- package/dist/shared/{url-Be9jlWRv.d.ts → url-CZZcyPI0.d.cts} +92 -5
- package/dist/shared/{url-Be9jlWRv.d.cts → url-CZZcyPI0.d.ts} +92 -5
- package/dist/shared/{url-CFN1sT9S.cjs → url-CzHqE-Fg.cjs} +83 -4
- package/dist/shared/{url-CFN1sT9S.cjs.map → url-CzHqE-Fg.cjs.map} +1 -1
- package/dist/shared/{url-B3ocFlHj.js → url-Dsr4c5r5.js} +78 -5
- package/dist/shared/{url-B3ocFlHj.js.map → url-Dsr4c5r5.js.map} +1 -1
- package/dist/web/index.cjs +4 -3
- package/dist/web/index.cjs.map +1 -1
- package/dist/web/index.d.cts +1 -1
- package/dist/web/index.d.ts +1 -1
- package/dist/web/index.js +2 -1
- package/dist/web/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/shared/render-CiL1VS0b.js.map +0 -1
- package/dist/shared/render-DNTESBSl.cjs.map +0 -1
- package/dist/shared/storage-BLmXmzKF.cjs.map +0 -1
- package/dist/shared/storage-CCxn0Kkv.js.map +0 -1
- package/dist/shared/storage-C_eICCep.d.cts +0 -152
- package/dist/shared/storage-C_eICCep.d.ts +0 -152
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
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";
|
|
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
|
+
import { r as KeyValueStore } from "./key-value-store-COZaNHZS.js";
|
|
3
4
|
//#region src/core/plugins/contracts.d.ts
|
|
4
5
|
/**
|
|
5
6
|
* Обёртка одной логической операции.
|
|
@@ -948,7 +949,8 @@ interface Attachment {
|
|
|
948
949
|
width?: number;
|
|
949
950
|
/** Высота изображения или видео в пикселях. */
|
|
950
951
|
height?: number;
|
|
951
|
-
|
|
952
|
+
/** MIME-тип. Может отсутствовать в `GET /api/posts/{id}`. */
|
|
953
|
+
mimeType?: string;
|
|
952
954
|
/** Исходное имя файла. Приходит не всегда. */
|
|
953
955
|
filename?: string;
|
|
954
956
|
/** Размер в байтах. Приходит не всегда. */
|
|
@@ -1004,7 +1006,7 @@ interface Post {
|
|
|
1004
1006
|
/** Делали ли вы репост. */
|
|
1005
1007
|
isReposted: boolean;
|
|
1006
1008
|
/** Засчитан ли просмотр. */
|
|
1007
|
-
isViewed
|
|
1009
|
+
isViewed?: boolean;
|
|
1008
1010
|
/** Ваш ли это пост. */
|
|
1009
1011
|
isOwner: boolean;
|
|
1010
1012
|
/** Исходный пост, если это репост. */
|
|
@@ -1013,7 +1015,7 @@ interface Post {
|
|
|
1013
1015
|
/** Преобладающая реакция — эмодзи либо `null`. */
|
|
1014
1016
|
dominantEmoji?: string | null;
|
|
1015
1017
|
/** Когда пост отредактировали. `null`, если не редактировали. */
|
|
1016
|
-
editedAt
|
|
1018
|
+
editedAt?: IsoDate | null;
|
|
1017
1019
|
createdAt: IsoDate;
|
|
1018
1020
|
/**
|
|
1019
1021
|
* Служебная метка показа для телеметрии.
|
|
@@ -1049,7 +1051,8 @@ interface Comment {
|
|
|
1049
1051
|
spans?: Span[];
|
|
1050
1052
|
author: Author;
|
|
1051
1053
|
likesCount: number;
|
|
1052
|
-
|
|
1054
|
+
/** Может отсутствовать у ответа, созданного через `comments.reply()`. */
|
|
1055
|
+
repliesCount?: number;
|
|
1053
1056
|
isLiked: boolean;
|
|
1054
1057
|
createdAt: IsoDate;
|
|
1055
1058
|
/** Вложения. У голосового — одно аудио с `mimeType: 'audio/ogg'`. */
|
|
@@ -1057,7 +1060,20 @@ interface Comment {
|
|
|
1057
1060
|
/** Вложенные ответы. В списках приходит превью, полный список — через `itd.comments.replies()`. */
|
|
1058
1061
|
replies?: Comment[];
|
|
1059
1062
|
/** Заполнено только у ответов. */
|
|
1060
|
-
replyTo?: CommentReplyTo;
|
|
1063
|
+
replyTo?: CommentReplyTo | null;
|
|
1064
|
+
}
|
|
1065
|
+
/** Компактный ответ редактирования поста. */
|
|
1066
|
+
interface PostUpdateResult {
|
|
1067
|
+
id: string;
|
|
1068
|
+
content: string;
|
|
1069
|
+
spans: Span[];
|
|
1070
|
+
updatedAt: IsoDate;
|
|
1071
|
+
}
|
|
1072
|
+
/** Компактный ответ редактирования комментария. */
|
|
1073
|
+
interface CommentUpdateResult {
|
|
1074
|
+
id: string;
|
|
1075
|
+
content: string;
|
|
1076
|
+
editedAt: IsoDate;
|
|
1061
1077
|
}
|
|
1062
1078
|
/** Хэштег. */
|
|
1063
1079
|
interface Hashtag {
|
|
@@ -1124,11 +1140,11 @@ declare class CommentsResource extends BaseResource {
|
|
|
1124
1140
|
*/
|
|
1125
1141
|
reply(commentId: string, input: CommentInput | string, options?: RequestOptions): Promise<Comment>;
|
|
1126
1142
|
/** Редактирует текст комментария. */
|
|
1127
|
-
update(commentId: string, content: string, options?: RequestOptions): Promise<
|
|
1143
|
+
update(commentId: string, content: string, options?: RequestOptions): Promise<CommentUpdateResult>;
|
|
1128
1144
|
/** Удаляет комментарий. Восстановить его можно через {@link restore}. */
|
|
1129
1145
|
remove(commentId: string, options?: RequestOptions): Promise<void>;
|
|
1130
1146
|
/** Восстанавливает удалённый комментарий. */
|
|
1131
|
-
restore(commentId: string, options?: RequestOptions): Promise<
|
|
1147
|
+
restore(commentId: string, options?: RequestOptions): Promise<void>;
|
|
1132
1148
|
/** Ставит реакцию на комментарий. */
|
|
1133
1149
|
like(commentId: string, options?: RequestOptions): Promise<LikeResult>;
|
|
1134
1150
|
/** Убирает реакцию с комментария. */
|
|
@@ -1142,6 +1158,12 @@ interface UploadedFile {
|
|
|
1142
1158
|
id: string;
|
|
1143
1159
|
/** Адрес файла на CDN. */
|
|
1144
1160
|
url: string;
|
|
1161
|
+
/** Исходное имя файла, если сервер его вернул. */
|
|
1162
|
+
filename?: string;
|
|
1163
|
+
/** Определённый сервером MIME-тип. */
|
|
1164
|
+
mimeType?: string;
|
|
1165
|
+
/** Размер файла в байтах. */
|
|
1166
|
+
size?: number;
|
|
1145
1167
|
}
|
|
1146
1168
|
/** Настройки загрузки. */
|
|
1147
1169
|
interface UploadOptions {
|
|
@@ -1776,11 +1798,11 @@ declare class PostsResource extends BaseResource {
|
|
|
1776
1798
|
* функцию-настройщик. Поля создания поста, которые update endpoint не поддерживает
|
|
1777
1799
|
* (вложения, опрос и стена), отвергаются до запроса.
|
|
1778
1800
|
*/
|
|
1779
|
-
update(postId: string, input: PostUpdateInput, options?: RequestOptions): Promise<
|
|
1801
|
+
update(postId: string, input: PostUpdateInput, options?: RequestOptions): Promise<PostUpdateResult>;
|
|
1780
1802
|
/** Удаляет пост. Восстановить его можно через {@link restore}. */
|
|
1781
1803
|
remove(postId: string, options?: RequestOptions): Promise<void>;
|
|
1782
1804
|
/** Восстанавливает удалённый пост. */
|
|
1783
|
-
restore(postId: string, options?: RequestOptions): Promise<
|
|
1805
|
+
restore(postId: string, options?: RequestOptions): Promise<void>;
|
|
1784
1806
|
/** Ставит реакцию на пост. */
|
|
1785
1807
|
like(postId: string, options?: RequestOptions): Promise<LikeResult>;
|
|
1786
1808
|
/** Убирает реакцию с поста. */
|
|
@@ -1948,6 +1970,297 @@ declare class SearchResource extends BaseResource {
|
|
|
1948
1970
|
all(query: string, options?: RequestOptions): Promise<SearchResult>;
|
|
1949
1971
|
}
|
|
1950
1972
|
//#endregion
|
|
1973
|
+
//#region src/models/shop.d.ts
|
|
1974
|
+
/** Категория товара магазина. */
|
|
1975
|
+
declare const ShopProductCategory: Readonly<{
|
|
1976
|
+
readonly Apparel: "apparel";
|
|
1977
|
+
readonly Accessories: "accessories";
|
|
1978
|
+
readonly Print: "print";
|
|
1979
|
+
}>;
|
|
1980
|
+
type ShopProductCategory = Loose<(typeof ShopProductCategory)[keyof typeof ShopProductCategory]>;
|
|
1981
|
+
/** Состояние товара в каталоге. */
|
|
1982
|
+
declare const ShopProductStatus: Readonly<{
|
|
1983
|
+
readonly Available: "available";
|
|
1984
|
+
readonly Preorder: "preorder";
|
|
1985
|
+
readonly SoldOut: "soldout";
|
|
1986
|
+
}>;
|
|
1987
|
+
type ShopProductStatus = Loose<(typeof ShopProductStatus)[keyof typeof ShopProductStatus]>;
|
|
1988
|
+
/** Вариант цвета товара. */
|
|
1989
|
+
interface ShopProductColor {
|
|
1990
|
+
id: string;
|
|
1991
|
+
label: string;
|
|
1992
|
+
hex: string;
|
|
1993
|
+
images: string[];
|
|
1994
|
+
}
|
|
1995
|
+
/** Характеристика товара. */
|
|
1996
|
+
interface ShopProductSpec {
|
|
1997
|
+
label: string;
|
|
1998
|
+
value: string;
|
|
1999
|
+
}
|
|
2000
|
+
/** Строка таблицы размеров. */
|
|
2001
|
+
interface ShopSizeChartRow {
|
|
2002
|
+
size: string;
|
|
2003
|
+
values: string[];
|
|
2004
|
+
}
|
|
2005
|
+
/** Таблица размеров товара. */
|
|
2006
|
+
interface ShopSizeChart {
|
|
2007
|
+
columns: string[];
|
|
2008
|
+
rows: ShopSizeChartRow[];
|
|
2009
|
+
note?: string | undefined;
|
|
2010
|
+
}
|
|
2011
|
+
/** Товар магазина. Цены указаны в рублях. */
|
|
2012
|
+
interface ShopProduct {
|
|
2013
|
+
id: string;
|
|
2014
|
+
title: string;
|
|
2015
|
+
category: ShopProductCategory;
|
|
2016
|
+
price: number;
|
|
2017
|
+
images: string[];
|
|
2018
|
+
sizes: string[];
|
|
2019
|
+
colors: ShopProductColor[];
|
|
2020
|
+
description: string;
|
|
2021
|
+
specs: ShopProductSpec[];
|
|
2022
|
+
sizeChart?: ShopSizeChart | null | undefined;
|
|
2023
|
+
status: ShopProductStatus;
|
|
2024
|
+
stockLeft: number | null;
|
|
2025
|
+
}
|
|
2026
|
+
/** Позиция для расчёта доставки или создания заказа. */
|
|
2027
|
+
interface ShopOrderItemInput {
|
|
2028
|
+
productId: string;
|
|
2029
|
+
size: string | null;
|
|
2030
|
+
color: string | null;
|
|
2031
|
+
qty: number;
|
|
2032
|
+
}
|
|
2033
|
+
/** Страна, в которую доступна доставка. */
|
|
2034
|
+
interface ShopDeliveryCountry {
|
|
2035
|
+
code: string;
|
|
2036
|
+
name: string;
|
|
2037
|
+
}
|
|
2038
|
+
/** Город из подсказок службы доставки. */
|
|
2039
|
+
interface ShopDeliveryCity {
|
|
2040
|
+
code: number;
|
|
2041
|
+
name: string;
|
|
2042
|
+
countryCode: string;
|
|
2043
|
+
}
|
|
2044
|
+
/** Пункт выдачи заказа. */
|
|
2045
|
+
interface ShopDeliveryPoint {
|
|
2046
|
+
code: string;
|
|
2047
|
+
name: string;
|
|
2048
|
+
city: string;
|
|
2049
|
+
cityCode: number;
|
|
2050
|
+
countryCode: string;
|
|
2051
|
+
postalCode: string;
|
|
2052
|
+
address: string;
|
|
2053
|
+
latitude: number;
|
|
2054
|
+
longitude: number;
|
|
2055
|
+
workTime?: string | undefined;
|
|
2056
|
+
metro?: string | undefined;
|
|
2057
|
+
note?: string | undefined;
|
|
2058
|
+
dressingRoom: boolean;
|
|
2059
|
+
card: boolean;
|
|
2060
|
+
cash: boolean;
|
|
2061
|
+
}
|
|
2062
|
+
/** Направление для расчёта доставки. */
|
|
2063
|
+
interface ShopDeliveryDestination {
|
|
2064
|
+
code: number;
|
|
2065
|
+
countryCode: string;
|
|
2066
|
+
}
|
|
2067
|
+
/** Стоимость и ожидаемый срок доставки. */
|
|
2068
|
+
interface ShopDeliveryCalculation {
|
|
2069
|
+
/** Стоимость доставки в копейках. */
|
|
2070
|
+
costKopecks: number;
|
|
2071
|
+
/** Стоимость доставки в рублях. */
|
|
2072
|
+
cost: number;
|
|
2073
|
+
periodMin: number;
|
|
2074
|
+
periodMax: number;
|
|
2075
|
+
tariffCode: number;
|
|
2076
|
+
tariffName: string;
|
|
2077
|
+
weightGrams: number;
|
|
2078
|
+
}
|
|
2079
|
+
/** Данные получателя заказа. */
|
|
2080
|
+
interface ShopRecipient {
|
|
2081
|
+
name: string;
|
|
2082
|
+
phone: string;
|
|
2083
|
+
email: string;
|
|
2084
|
+
country: string;
|
|
2085
|
+
city: string;
|
|
2086
|
+
address: string;
|
|
2087
|
+
cityCode: number | null;
|
|
2088
|
+
deliveryPoint: string;
|
|
2089
|
+
comment: string;
|
|
2090
|
+
}
|
|
2091
|
+
/** Вид согласия, которое принимает покупатель. */
|
|
2092
|
+
declare const ShopConsentKind: Readonly<{
|
|
2093
|
+
readonly Offer: "offer";
|
|
2094
|
+
readonly PersonalData: "personal_data";
|
|
2095
|
+
readonly Cookie: "cookie";
|
|
2096
|
+
}>;
|
|
2097
|
+
type ShopConsentKind = (typeof ShopConsentKind)[keyof typeof ShopConsentKind];
|
|
2098
|
+
/** Принятое или отклонённое условие магазина. */
|
|
2099
|
+
interface ShopConsent {
|
|
2100
|
+
kind: ShopConsentKind;
|
|
2101
|
+
accepted: boolean;
|
|
2102
|
+
docSlug: string;
|
|
2103
|
+
docVersion: string;
|
|
2104
|
+
}
|
|
2105
|
+
/** Место, в котором было получено согласие. */
|
|
2106
|
+
interface ShopConsentContext {
|
|
2107
|
+
form: string;
|
|
2108
|
+
page: string;
|
|
2109
|
+
visitorId: string;
|
|
2110
|
+
}
|
|
2111
|
+
/** Данные для создания заказа. */
|
|
2112
|
+
interface CreateShopOrderInput {
|
|
2113
|
+
items: ShopOrderItemInput[];
|
|
2114
|
+
recipient: ShopRecipient;
|
|
2115
|
+
consents: ShopConsent[];
|
|
2116
|
+
consentContext: ShopConsentContext;
|
|
2117
|
+
}
|
|
2118
|
+
/** Результат создания заказа. */
|
|
2119
|
+
interface ShopCreatedOrder {
|
|
2120
|
+
number: string;
|
|
2121
|
+
/** Токен для открытия только что созданного гостевого заказа. */
|
|
2122
|
+
pass?: string | undefined;
|
|
2123
|
+
}
|
|
2124
|
+
/** Состояние заказа. */
|
|
2125
|
+
declare const ShopOrderStatus: Readonly<{
|
|
2126
|
+
readonly New: "new";
|
|
2127
|
+
readonly Paid: "paid";
|
|
2128
|
+
readonly Shipping: "ship";
|
|
2129
|
+
readonly Done: "done";
|
|
2130
|
+
readonly Cancelled: "cancelled";
|
|
2131
|
+
readonly Refunded: "refunded";
|
|
2132
|
+
readonly Expired: "expired";
|
|
2133
|
+
}>;
|
|
2134
|
+
type ShopOrderStatus = Loose<(typeof ShopOrderStatus)[keyof typeof ShopOrderStatus]>;
|
|
2135
|
+
/** Заказ в списке заказов. */
|
|
2136
|
+
interface ShopOrderSummary {
|
|
2137
|
+
number: string;
|
|
2138
|
+
titles: string[];
|
|
2139
|
+
status: ShopOrderStatus;
|
|
2140
|
+
total: number;
|
|
2141
|
+
createdAt: IsoDate;
|
|
2142
|
+
}
|
|
2143
|
+
/** Товар в оформленном заказе. */
|
|
2144
|
+
interface ShopOrderItem {
|
|
2145
|
+
slug: string;
|
|
2146
|
+
title: string;
|
|
2147
|
+
color?: string | null | undefined;
|
|
2148
|
+
size?: string | null | undefined;
|
|
2149
|
+
qty: number;
|
|
2150
|
+
sum: number;
|
|
2151
|
+
}
|
|
2152
|
+
/** Адрес доставки оформленного заказа. */
|
|
2153
|
+
interface ShopOrderDelivery {
|
|
2154
|
+
city: string;
|
|
2155
|
+
address: string;
|
|
2156
|
+
point?: string | null | undefined;
|
|
2157
|
+
}
|
|
2158
|
+
/** Контакты поддержки магазина. */
|
|
2159
|
+
interface ShopOrderSupport {
|
|
2160
|
+
email: string;
|
|
2161
|
+
telegram?: string | undefined;
|
|
2162
|
+
}
|
|
2163
|
+
/** Оформленный заказ. */
|
|
2164
|
+
interface ShopOrder {
|
|
2165
|
+
number: string;
|
|
2166
|
+
status: ShopOrderStatus;
|
|
2167
|
+
createdAt: IsoDate;
|
|
2168
|
+
payment: {
|
|
2169
|
+
pending: boolean;
|
|
2170
|
+
};
|
|
2171
|
+
items: ShopOrderItem[];
|
|
2172
|
+
itemsTotal: number;
|
|
2173
|
+
shipping: number;
|
|
2174
|
+
total: number;
|
|
2175
|
+
delivery: ShopOrderDelivery;
|
|
2176
|
+
track?: string | null | undefined;
|
|
2177
|
+
comment?: string | null | undefined;
|
|
2178
|
+
support?: ShopOrderSupport | null | undefined;
|
|
2179
|
+
}
|
|
2180
|
+
/** Ссылка на страницу оплаты. */
|
|
2181
|
+
interface ShopPayment {
|
|
2182
|
+
url: string;
|
|
2183
|
+
}
|
|
2184
|
+
/** Временный доступ к гостевым заказам. */
|
|
2185
|
+
interface ShopOrderAccessSession {
|
|
2186
|
+
email: string;
|
|
2187
|
+
token: string;
|
|
2188
|
+
expiresAt: number;
|
|
2189
|
+
}
|
|
2190
|
+
/** Ответ проверки кода из письма. */
|
|
2191
|
+
interface ShopOrderAccessVerification {
|
|
2192
|
+
token: string;
|
|
2193
|
+
expiresInSec: number;
|
|
2194
|
+
}
|
|
2195
|
+
//#endregion
|
|
2196
|
+
//#region src/resources/shop.d.ts
|
|
2197
|
+
/** Параметры запроса, который может использовать токен доступа к заказам. */
|
|
2198
|
+
interface ShopOrderRequestOptions extends RequestOptions {
|
|
2199
|
+
/** Временный токен из проверки кода или `pass` созданного заказа. */
|
|
2200
|
+
orderAccessToken?: string | undefined;
|
|
2201
|
+
/** `false` запрещает отправлять Bearer-токен ИТД. По умолчанию используется авторизация клиента. */
|
|
2202
|
+
useItdAuth?: boolean | undefined;
|
|
2203
|
+
}
|
|
2204
|
+
/** Параметры создания заказа. */
|
|
2205
|
+
interface CreateShopOrderOptions extends RequestOptions {
|
|
2206
|
+
/** Ключ защиты от повторного создания заказа. По умолчанию создаётся автоматически. */
|
|
2207
|
+
idempotencyKey?: string | undefined;
|
|
2208
|
+
}
|
|
2209
|
+
/** Параметры перехода к оплате. */
|
|
2210
|
+
interface PayShopOrderOptions extends ShopOrderRequestOptions {
|
|
2211
|
+
/** Адрес возврата после оплаты. */
|
|
2212
|
+
returnUrl: string;
|
|
2213
|
+
}
|
|
2214
|
+
/** Каталог товаров магазина. */
|
|
2215
|
+
declare class ShopProductsResource extends BaseResource {
|
|
2216
|
+
/** Загружает все товары. */
|
|
2217
|
+
list(options?: RequestOptions): Promise<ShopProduct[]>;
|
|
2218
|
+
/** Загружает товар по идентификатору. */
|
|
2219
|
+
get(productId: string, options?: RequestOptions): Promise<ShopProduct | null>;
|
|
2220
|
+
}
|
|
2221
|
+
/** Расчёт и выбор доставки. */
|
|
2222
|
+
declare class ShopDeliveryResource extends BaseResource {
|
|
2223
|
+
/** Загружает страны, в которые доступна доставка. */
|
|
2224
|
+
countries(options?: RequestOptions): Promise<ShopDeliveryCountry[]>;
|
|
2225
|
+
/** Ищет города службы доставки. */
|
|
2226
|
+
cities(query: string, countryCode?: string, options?: RequestOptions): Promise<ShopDeliveryCity[]>;
|
|
2227
|
+
/** Загружает пункты выдачи в городе. */
|
|
2228
|
+
points(cityCode: number, options?: RequestOptions): Promise<ShopDeliveryPoint[]>;
|
|
2229
|
+
/** Рассчитывает стоимость и срок доставки. */
|
|
2230
|
+
calculate(items: ShopOrderItemInput[], destination: ShopDeliveryDestination, options?: RequestOptions): Promise<ShopDeliveryCalculation>;
|
|
2231
|
+
}
|
|
2232
|
+
/** Создание, просмотр и оплата заказов. */
|
|
2233
|
+
declare class ShopOrdersResource extends BaseResource {
|
|
2234
|
+
/** Создаёт заказ. */
|
|
2235
|
+
create(input: CreateShopOrderInput, options?: CreateShopOrderOptions): Promise<ShopCreatedOrder>;
|
|
2236
|
+
/** Загружает заказы аккаунта ИТД или владельца временного токена. */
|
|
2237
|
+
list(options?: ShopOrderRequestOptions): Promise<{
|
|
2238
|
+
items: ShopOrderSummary[];
|
|
2239
|
+
}>;
|
|
2240
|
+
/** Загружает заказ по номеру. */
|
|
2241
|
+
get(orderNumber: string, options?: ShopOrderRequestOptions): Promise<ShopOrder | null>;
|
|
2242
|
+
/** Создаёт ссылку на оплату заказа. */
|
|
2243
|
+
pay(orderNumber: string, options: PayShopOrderOptions): Promise<ShopPayment>;
|
|
2244
|
+
/** Отправляет на почту код доступа к гостевым заказам. */
|
|
2245
|
+
requestAccessCode(email: string, options?: RequestOptions): Promise<void>;
|
|
2246
|
+
/** Проверяет код из письма и возвращает временный токен заказов. */
|
|
2247
|
+
verifyAccessCode(email: string, code: string, options?: RequestOptions): Promise<ShopOrderAccessVerification>;
|
|
2248
|
+
}
|
|
2249
|
+
/** Запись согласий магазина. */
|
|
2250
|
+
declare class ShopConsentsResource extends BaseResource {
|
|
2251
|
+
/** Записывает согласия покупателя. */
|
|
2252
|
+
record(consents: ShopConsent[], consentContext: ShopConsentContext, options?: RequestOptions): Promise<void>;
|
|
2253
|
+
}
|
|
2254
|
+
/** Магазин ИТД. */
|
|
2255
|
+
declare class ShopResource {
|
|
2256
|
+
readonly products: ShopProductsResource;
|
|
2257
|
+
readonly delivery: ShopDeliveryResource;
|
|
2258
|
+
readonly orders: ShopOrdersResource;
|
|
2259
|
+
readonly consents: ShopConsentsResource;
|
|
2260
|
+
/** @internal */
|
|
2261
|
+
constructor(http: ConstructorParameters<typeof BaseResource>[0]);
|
|
2262
|
+
}
|
|
2263
|
+
//#endregion
|
|
1951
2264
|
//#region src/resources/subscription.d.ts
|
|
1952
2265
|
/**
|
|
1953
2266
|
* Подписка и способы оплаты.
|
|
@@ -2393,6 +2706,59 @@ declare function isMyProfile(profile: Profile): profile is MyProfile;
|
|
|
2393
2706
|
*/
|
|
2394
2707
|
declare function statusDays(service: ServiceStatus): (StatusDay | null)[];
|
|
2395
2708
|
//#endregion
|
|
2709
|
+
//#region src/shop/order-access.d.ts
|
|
2710
|
+
/** Хранилище временного доступа к гостевым заказам. */
|
|
2711
|
+
interface ShopOrderAccessStorage {
|
|
2712
|
+
get(): ShopOrderAccessSession | null | Promise<ShopOrderAccessSession | null>;
|
|
2713
|
+
set(session: ShopOrderAccessSession): void | Promise<void>;
|
|
2714
|
+
clear(): void | Promise<void>;
|
|
2715
|
+
}
|
|
2716
|
+
/** Хранилище доступа к заказам в памяти процесса. */
|
|
2717
|
+
declare class MemoryShopOrderAccessStorage implements ShopOrderAccessStorage {
|
|
2718
|
+
#private;
|
|
2719
|
+
constructor(initial?: ShopOrderAccessSession | null);
|
|
2720
|
+
get(): ShopOrderAccessSession | null;
|
|
2721
|
+
set(session: ShopOrderAccessSession): void;
|
|
2722
|
+
clear(): void;
|
|
2723
|
+
}
|
|
2724
|
+
/** Настройки хранилища доступа к заказам. */
|
|
2725
|
+
interface ShopOrderAccessStorageAdapterOptions {
|
|
2726
|
+
/** Ключ записи. По умолчанию `shop-order-access`. */
|
|
2727
|
+
key?: string | undefined;
|
|
2728
|
+
}
|
|
2729
|
+
/** Создаёт хранилище доступа к заказам поверх `KeyValueStore`. */
|
|
2730
|
+
declare function createShopOrderAccessStorage(store: KeyValueStore<ShopOrderAccessSession>, options?: ShopOrderAccessStorageAdapterOptions): ShopOrderAccessStorage;
|
|
2731
|
+
/** Создаёт независимое хранилище доступа к заказам в памяти. */
|
|
2732
|
+
declare function createMemoryShopOrderAccessStorage(): ShopOrderAccessStorage;
|
|
2733
|
+
//#endregion
|
|
2734
|
+
//#region src/shop/feature.d.ts
|
|
2735
|
+
/** Настройки подключаемого модуля доступа к заказам по коду из письма. */
|
|
2736
|
+
interface ShopFeatureOptions {
|
|
2737
|
+
/** Отдельное хранилище токена заказов. По умолчанию используется память процесса. */
|
|
2738
|
+
storage?: ShopOrderAccessStorage | undefined;
|
|
2739
|
+
}
|
|
2740
|
+
/** API гостевого доступа к заказам по коду из письма. */
|
|
2741
|
+
interface ShopFeatureApi {
|
|
2742
|
+
/** Отправляет код и запоминает адрес до проверки. */
|
|
2743
|
+
requestCode(email: string, options?: RequestOptions): Promise<void>;
|
|
2744
|
+
/** Проверяет код для адреса, переданного в {@link requestCode}. */
|
|
2745
|
+
verifyCode(code: string, options?: RequestOptions): Promise<ShopOrderAccessSession>;
|
|
2746
|
+
/** Возвращает действующий доступ или `null`. */
|
|
2747
|
+
session(): Promise<ShopOrderAccessSession | null>;
|
|
2748
|
+
/** Удаляет сохранённый доступ. */
|
|
2749
|
+
clear(): Promise<void>;
|
|
2750
|
+
/** Загружает гостевые заказы сохранённого адреса. */
|
|
2751
|
+
list(options?: RequestOptions): Promise<{
|
|
2752
|
+
items: ShopOrderSummary[];
|
|
2753
|
+
}>;
|
|
2754
|
+
/** Загружает гостевой заказ. */
|
|
2755
|
+
get(orderNumber: string, options?: RequestOptions): Promise<ShopOrder | null>;
|
|
2756
|
+
/** Создаёт ссылку на оплату гостевого заказа. */
|
|
2757
|
+
pay(orderNumber: string, returnUrl: string, options?: RequestOptions): Promise<ShopPayment>;
|
|
2758
|
+
}
|
|
2759
|
+
/** Создаёт подключаемый модуль для доступа к заказам по коду из письма. */
|
|
2760
|
+
declare function createShopFeature(options?: ShopFeatureOptions): ClientFeature<ShopFeatureApi>;
|
|
2761
|
+
//#endregion
|
|
2396
2762
|
//#region src/spans/render.d.ts
|
|
2397
2763
|
/** Формат результата {@link renderSpans}. */
|
|
2398
2764
|
declare const SpanRenderFormat: Readonly<{
|
|
@@ -2424,5 +2790,5 @@ interface RenderSpansOptions {
|
|
|
2424
2790
|
*/
|
|
2425
2791
|
declare function renderSpans(content: string, spans?: readonly Span[] | null | undefined, options?: RenderSpansOptions): string;
|
|
2426
2792
|
//#endregion
|
|
2427
|
-
export {
|
|
2428
|
-
//# sourceMappingURL=render-
|
|
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
|