/** * Generated by orval v8.19.0 🍺 * Do not edit manually. * Webitel API * OpenAPI spec version: 24.04.0 */ import axios from '@aliasedDeps/api-services/axios'; import type { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios'; import type { CatalogGetCustomersParams, CatalogGetDialogsParams, CatalogGetHistory2Params, CatalogGetHistoryParams, CatalogGetMembersParams, WebitelChatBroadcastMessageRequest, WebitelChatBroadcastMessageResponse, WebitelChatChatCustomers, WebitelChatChatDialogs, WebitelChatChatMembers, WebitelChatChatMessages, } from '../_models'; // --- header start // export const // --- title start getMessages = // --- title end (axiosInstance: AxiosInstance = axios) => { // --- header end /** * @summary Broadcast message send message from via to peer recipients. */ const messagesServiceBroadcastMessage = ( webitelChatBroadcastMessageRequest: WebitelChatBroadcastMessageRequest, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.post( `/chat/broadcast`, webitelChatBroadcastMessageRequest, options, ); }; /** * @summary Query of external chat customers */ const catalogGetCustomers = ( params?: CatalogGetCustomersParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/chat/customers`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Query of chat conversations */ const catalogGetDialogs = ( params?: CatalogGetDialogsParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/chat/dialogs`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Query of chat participants */ const catalogGetMembers = ( chatId: string, params?: CatalogGetMembersParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/chat/dialogs/${chatId}/members`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Query of the chat history */ const catalogGetHistory = ( chatId: string, params?: CatalogGetHistoryParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/chat/dialogs/${chatId}/messages`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Query of the chat history */ const catalogGetHistory2 = ( params?: CatalogGetHistory2Params, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/chat/peer.type}/peer.id}/messages`, { ...options, params: { ...params, ...options?.params, }, }); }; // --- footer start return { messagesServiceBroadcastMessage, catalogGetCustomers, catalogGetDialogs, catalogGetMembers, catalogGetHistory, catalogGetHistory2, }; }; export type MessagesServiceBroadcastMessageResult = AxiosResponse; export type CatalogGetCustomersResult = AxiosResponse; export type CatalogGetDialogsResult = AxiosResponse; export type CatalogGetMembersResult = AxiosResponse; export type CatalogGetHistoryResult = AxiosResponse; export type CatalogGetHistory2Result = AxiosResponse; // --- footer end