Files
ozon-seller-typescript/dist/apis/ChatAPI.js
2026-08-21 12:19:50 +00:00

166 lines
12 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"use strict";
/* tslint:disable */
/* eslint-disable */
/**
* Документация Ozon Seller API
* По вопросам работы с Seller API обращайтесь в поддержку через личный кабинет. <aside class=\"warning\">Обновляем корневой TLS/SSL-сертификат GlobalSign — вместо него будем использовать <a href=\"https://app.harica.gr/\">HARICA</a>.<br><a href=\"https://dev.ozon.ru/news/775-Izmeneniia-v-Ozon-API-migratsiia-kornevogo-sertifikata-UTs-Ozon/\">Подробнее о переходе на HARICA на платформе разработчиков Ozon for dev</a></aside> > [Инструкции по работе с маркетплейсом](https://seller-edu.ozon.ru) > [Информационная платформа и сообщество разработчиков Ozon for dev](https://dev.ozon.ru/)
*
* The version of the OpenAPI document: 2.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChatAPI = void 0;
const runtime = require("../runtime");
const index_1 = require("../models/index");
/**
*
*/
class ChatAPI extends runtime.BaseAPI {
/**
* Возвращает историю сообщений чата. По умолчанию от самого нового сообщения к старым. <br><br> Получите список чатов с покупателем `chats.chat.chat_type=\"Buyer_Seller\"` в ответе метода [/v3/chat/list](#operation/ChatAPI_ChatListV3).
* История чата
*/
chatAPIChatHistoryV3Raw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters['clientId'] == null) {
throw new runtime.RequiredError('clientId', 'Required parameter "clientId" was null or undefined when calling chatAPIChatHistoryV3().');
}
if (requestParameters['apiKey'] == null) {
throw new runtime.RequiredError('apiKey', 'Required parameter "apiKey" was null or undefined when calling chatAPIChatHistoryV3().');
}
if (requestParameters['v3ChatHistoryRequest'] == null) {
throw new runtime.RequiredError('v3ChatHistoryRequest', 'Required parameter "v3ChatHistoryRequest" was null or undefined when calling chatAPIChatHistoryV3().');
}
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (requestParameters['clientId'] != null) {
headerParameters['Client-Id'] = String(requestParameters['clientId']);
}
if (requestParameters['apiKey'] != null) {
headerParameters['Api-Key'] = String(requestParameters['apiKey']);
}
const response = yield this.request({
path: `/v3/chat/history`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.V3ChatHistoryRequestToJSON)(requestParameters['v3ChatHistoryRequest']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.V3ChatHistoryResponseFromJSON)(jsonValue));
});
}
/**
* Возвращает историю сообщений чата. По умолчанию от самого нового сообщения к старым. <br><br> Получите список чатов с покупателем `chats.chat.chat_type=\"Buyer_Seller\"` в ответе метода [/v3/chat/list](#operation/ChatAPI_ChatListV3).
* История чата
*/
chatAPIChatHistoryV3(clientId, apiKey, v3ChatHistoryRequest, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.chatAPIChatHistoryV3Raw({ clientId: clientId, apiKey: apiKey, v3ChatHistoryRequest: v3ChatHistoryRequest }, initOverrides);
return yield response.value();
});
}
/**
* Возвращает информацию о чатах по указанным фильтрам.
* Список чатов
*/
chatAPIChatListV3Raw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters['clientId'] == null) {
throw new runtime.RequiredError('clientId', 'Required parameter "clientId" was null or undefined when calling chatAPIChatListV3().');
}
if (requestParameters['apiKey'] == null) {
throw new runtime.RequiredError('apiKey', 'Required parameter "apiKey" was null or undefined when calling chatAPIChatListV3().');
}
if (requestParameters['v3ChatList'] == null) {
throw new runtime.RequiredError('v3ChatList', 'Required parameter "v3ChatList" was null or undefined when calling chatAPIChatListV3().');
}
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (requestParameters['clientId'] != null) {
headerParameters['Client-Id'] = String(requestParameters['clientId']);
}
if (requestParameters['apiKey'] != null) {
headerParameters['Api-Key'] = String(requestParameters['apiKey']);
}
const response = yield this.request({
path: `/v3/chat/list`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.V3ChatListToJSON)(requestParameters['v3ChatList']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.V3ChatListResponseFromJSON)(jsonValue));
});
}
/**
* Возвращает информацию о чатах по указанным фильтрам.
* Список чатов
*/
chatAPIChatListV3(clientId, apiKey, v3ChatList, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.chatAPIChatListV3Raw({ clientId: clientId, apiKey: apiKey, v3ChatList: v3ChatList }, initOverrides);
return yield response.value();
});
}
/**
* Отправляет файл в существующий чат по его идентификатору. <br><br> Отправить файл в чат с покупателем могут только продавцы с подпиской [Premium Plus](https://seller-edu.ozon.ru/seller-rating/about-rating/subscription-premium-plus) или [Premium Pro](https://seller-edu.ozon.ru/seller-rating/about-rating/podpiska-premium-pro). Получите список чатов с покупателем `chats.chat.chat_type=\"Buyer_Seller\"` в ответе метода [/v3/chat/list](#operation/ChatAPI_ChatListV3). Для отправлений: - FBO — вы можете отправить файл в течение 48 часов с момента получения последнего сообщения от покупателя. - FBS или rFBS — вы можете отправить файл покупателю после оплаты и в течение 72 часов после доставки отправления. После этого вы можете только отвечать на сообщения в течение 48 часов с момента получения последнего сообщения от покупателя.
* Отправить файл
*/
chatAPIChatSendFileRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters['clientId'] == null) {
throw new runtime.RequiredError('clientId', 'Required parameter "clientId" was null or undefined when calling chatAPIChatSendFile().');
}
if (requestParameters['apiKey'] == null) {
throw new runtime.RequiredError('apiKey', 'Required parameter "apiKey" was null or undefined when calling chatAPIChatSendFile().');
}
if (requestParameters['chatChatSendFileRequest'] == null) {
throw new runtime.RequiredError('chatChatSendFileRequest', 'Required parameter "chatChatSendFileRequest" was null or undefined when calling chatAPIChatSendFile().');
}
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (requestParameters['clientId'] != null) {
headerParameters['Client-Id'] = String(requestParameters['clientId']);
}
if (requestParameters['apiKey'] != null) {
headerParameters['Api-Key'] = String(requestParameters['apiKey']);
}
const response = yield this.request({
path: `/v1/chat/send/file`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.ChatChatSendFileRequestToJSON)(requestParameters['chatChatSendFileRequest']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ChatChatSendFileResponseFromJSON)(jsonValue));
});
}
/**
* Отправляет файл в существующий чат по его идентификатору. <br><br> Отправить файл в чат с покупателем могут только продавцы с подпиской [Premium Plus](https://seller-edu.ozon.ru/seller-rating/about-rating/subscription-premium-plus) или [Premium Pro](https://seller-edu.ozon.ru/seller-rating/about-rating/podpiska-premium-pro). Получите список чатов с покупателем `chats.chat.chat_type=\"Buyer_Seller\"` в ответе метода [/v3/chat/list](#operation/ChatAPI_ChatListV3). Для отправлений: - FBO — вы можете отправить файл в течение 48 часов с момента получения последнего сообщения от покупателя. - FBS или rFBS — вы можете отправить файл покупателю после оплаты и в течение 72 часов после доставки отправления. После этого вы можете только отвечать на сообщения в течение 48 часов с момента получения последнего сообщения от покупателя.
* Отправить файл
*/
chatAPIChatSendFile(clientId, apiKey, chatChatSendFileRequest, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.chatAPIChatSendFileRaw({ clientId: clientId, apiKey: apiKey, chatChatSendFileRequest: chatChatSendFileRequest }, initOverrides);
return yield response.value();
});
}
}
exports.ChatAPI = ChatAPI;