feat: creating chats for cards and clients, sending and deleting text messages
This commit is contained in:
@@ -31,6 +31,7 @@ export type { BaseCardTagSchema } from './models/BaseCardTagSchema';
|
||||
export type { BaseEnumListSchema } from './models/BaseEnumListSchema';
|
||||
export type { BaseEnumSchema } from './models/BaseEnumSchema';
|
||||
export type { BaseMarketplaceSchema } from './models/BaseMarketplaceSchema';
|
||||
export type { BaseMessageSchema } from './models/BaseMessageSchema';
|
||||
export type { BaseProjectSchema } from './models/BaseProjectSchema';
|
||||
export type { BaseShippingWarehouseSchema } from './models/BaseShippingWarehouseSchema';
|
||||
export type { BaseStatusSchema } from './models/BaseStatusSchema';
|
||||
@@ -114,6 +115,7 @@ export type { CardUpdateServiceQuantityRequest } from './models/CardUpdateServic
|
||||
export type { CardUpdateServiceQuantityResponse } from './models/CardUpdateServiceQuantityResponse';
|
||||
export type { CardUpdateServiceRequest } from './models/CardUpdateServiceRequest';
|
||||
export type { CardUpdateServiceResponse } from './models/CardUpdateServiceResponse';
|
||||
export type { ChatSchema } from './models/ChatSchema';
|
||||
export type { CityBreakdownFromExcelSchema } from './models/CityBreakdownFromExcelSchema';
|
||||
export type { ClientCreateRequest } from './models/ClientCreateRequest';
|
||||
export type { ClientCreateResponse } from './models/ClientCreateResponse';
|
||||
@@ -142,6 +144,8 @@ export type { CreateCardBillResponse } from './models/CreateCardBillResponse';
|
||||
export type { CreateCardGroupRequest } from './models/CreateCardGroupRequest';
|
||||
export type { CreateCardsFromExcelRequest } from './models/CreateCardsFromExcelRequest';
|
||||
export type { CreateCardsFromExcelResponse } from './models/CreateCardsFromExcelResponse';
|
||||
export type { CreateChatRequest } from './models/CreateChatRequest';
|
||||
export type { CreateChatResponse } from './models/CreateChatResponse';
|
||||
export type { CreateDepartmentRequest } from './models/CreateDepartmentRequest';
|
||||
export type { CreateDepartmentResponse } from './models/CreateDepartmentResponse';
|
||||
export type { CreateDepartmentSectionRequest } from './models/CreateDepartmentSectionRequest';
|
||||
@@ -185,6 +189,7 @@ export type { DeleteDepartmentResponse } from './models/DeleteDepartmentResponse
|
||||
export type { DeleteDepartmentSectionResponse } from './models/DeleteDepartmentSectionResponse';
|
||||
export type { DeleteMarketplaceRequest } from './models/DeleteMarketplaceRequest';
|
||||
export type { DeleteMarketplaceResponse } from './models/DeleteMarketplaceResponse';
|
||||
export type { DeleteMessageResponse } from './models/DeleteMessageResponse';
|
||||
export type { DeletePalletResponse } from './models/DeletePalletResponse';
|
||||
export type { DeletePaymentRecordRequest } from './models/DeletePaymentRecordRequest';
|
||||
export type { DeletePaymentRecordResponse } from './models/DeletePaymentRecordResponse';
|
||||
@@ -243,11 +248,15 @@ export type { GetBoardsResponse } from './models/GetBoardsResponse';
|
||||
export type { GetCardBillById } from './models/GetCardBillById';
|
||||
export type { GetCardProductsBarcodesPdfRequest } from './models/GetCardProductsBarcodesPdfRequest';
|
||||
export type { GetCardProductsBarcodesPdfResponse } from './models/GetCardProductsBarcodesPdfResponse';
|
||||
export type { GetChatRequest } from './models/GetChatRequest';
|
||||
export type { GetChatResponse } from './models/GetChatResponse';
|
||||
export type { GetClientMarketplacesRequest } from './models/GetClientMarketplacesRequest';
|
||||
export type { GetClientMarketplacesResponse } from './models/GetClientMarketplacesResponse';
|
||||
export type { GetDepartmentSectionsResponse } from './models/GetDepartmentSectionsResponse';
|
||||
export type { GetDepartmentsResponse } from './models/GetDepartmentsResponse';
|
||||
export type { GetManagersResponse } from './models/GetManagersResponse';
|
||||
export type { GetMessagesRequest } from './models/GetMessagesRequest';
|
||||
export type { GetMessagesResponse } from './models/GetMessagesResponse';
|
||||
export type { GetPaymentRecordsResponse } from './models/GetPaymentRecordsResponse';
|
||||
export type { GetPlannedWorkShiftsResponse } from './models/GetPlannedWorkShiftsResponse';
|
||||
export type { GetProductBarcodePdfRequest } from './models/GetProductBarcodePdfRequest';
|
||||
@@ -276,6 +285,7 @@ export type { ManageEmployeeRequest } from './models/ManageEmployeeRequest';
|
||||
export type { ManageEmployeeResponse } from './models/ManageEmployeeResponse';
|
||||
export type { MarketplaceCreateSchema } from './models/MarketplaceCreateSchema';
|
||||
export type { MarketplaceSchema } from './models/MarketplaceSchema';
|
||||
export type { MessageSchema } from './models/MessageSchema';
|
||||
export type { ModuleSchema } from './models/ModuleSchema';
|
||||
export type { NotificationChannel } from './models/NotificationChannel';
|
||||
export type { OptionalShippingWarehouseSchema } from './models/OptionalShippingWarehouseSchema';
|
||||
@@ -328,6 +338,8 @@ export type { ResidualBoxSchema } from './models/ResidualBoxSchema';
|
||||
export type { ResidualPalletSchema } from './models/ResidualPalletSchema';
|
||||
export type { ResidualProductSchema } from './models/ResidualProductSchema';
|
||||
export type { RoleSchema } from './models/RoleSchema';
|
||||
export type { SendMessageRequest } from './models/SendMessageRequest';
|
||||
export type { SendMessageResponse } from './models/SendMessageResponse';
|
||||
export type { ServiceCategoryReorderRequest } from './models/ServiceCategoryReorderRequest';
|
||||
export type { ServiceCategoryReorderResponse } from './models/ServiceCategoryReorderResponse';
|
||||
export type { ServiceCategorySchema } from './models/ServiceCategorySchema';
|
||||
@@ -359,6 +371,8 @@ export type { SwitchTagRequest } from './models/SwitchTagRequest';
|
||||
export type { SwitchTagResponse } from './models/SwitchTagResponse';
|
||||
export type { SynchronizeMarketplaceRequest } from './models/SynchronizeMarketplaceRequest';
|
||||
export type { TaskInfoResponse } from './models/TaskInfoResponse';
|
||||
export type { TgGroupSchema } from './models/TgGroupSchema';
|
||||
export type { TgUserSchema } from './models/TgUserSchema';
|
||||
export type { TimeTrackingData } from './models/TimeTrackingData';
|
||||
export type { TimeTrackingRecord } from './models/TimeTrackingRecord';
|
||||
export type { TransactionSchemaBase } from './models/TransactionSchemaBase';
|
||||
@@ -435,6 +449,7 @@ export { BoardService } from './services/BoardService';
|
||||
export { CardService } from './services/CardService';
|
||||
export { CardGroupService } from './services/CardGroupService';
|
||||
export { CardTagService } from './services/CardTagService';
|
||||
export { ChatService } from './services/ChatService';
|
||||
export { ClientService } from './services/ClientService';
|
||||
export { DepartmentService } from './services/DepartmentService';
|
||||
export { MarketplaceService } from './services/MarketplaceService';
|
||||
|
||||
9
src/client/models/BaseMessageSchema.ts
Normal file
9
src/client/models/BaseMessageSchema.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type BaseMessageSchema = {
|
||||
text: string;
|
||||
chatId: number;
|
||||
};
|
||||
|
||||
@@ -12,6 +12,7 @@ import type { CardProductSchema } from './CardProductSchema';
|
||||
import type { CardServiceSchema } from './CardServiceSchema';
|
||||
import type { CardStatusHistorySchema } from './CardStatusHistorySchema';
|
||||
import type { CardTagSchema } from './CardTagSchema';
|
||||
import type { ChatSchema } from './ChatSchema';
|
||||
import type { ClientSchema } from './ClientSchema';
|
||||
import type { PalletSchema } from './PalletSchema';
|
||||
import type { ShippingWarehouseSchema } from './ShippingWarehouseSchema';
|
||||
@@ -42,5 +43,6 @@ export type CardSchema = {
|
||||
employees?: Array<CardEmployeesSchema>;
|
||||
tags?: Array<CardTagSchema>;
|
||||
attributes: Array<CardAttributeSchema>;
|
||||
chat: (ChatSchema | null);
|
||||
};
|
||||
|
||||
|
||||
12
src/client/models/ChatSchema.ts
Normal file
12
src/client/models/ChatSchema.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { TgGroupSchema } from './TgGroupSchema';
|
||||
export type ChatSchema = {
|
||||
id: number;
|
||||
clientId: (number | null);
|
||||
cardId: (number | null);
|
||||
tgGroup: (TgGroupSchema | null);
|
||||
};
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { BarcodeTemplateSchema } from './BarcodeTemplateSchema';
|
||||
import type { ChatSchema } from './ChatSchema';
|
||||
import type { ClientDetailsSchema } from './ClientDetailsSchema';
|
||||
import type { ResidualBoxSchema } from './ResidualBoxSchema';
|
||||
import type { ResidualPalletSchema } from './ResidualPalletSchema';
|
||||
@@ -13,6 +14,7 @@ export type ClientDetailedSchema = {
|
||||
barcodeTemplate?: (BarcodeTemplateSchema | null);
|
||||
comment?: (string | null);
|
||||
details?: (ClientDetailsSchema | null);
|
||||
chat?: (ChatSchema | null);
|
||||
pallets?: Array<ResidualPalletSchema>;
|
||||
boxes?: Array<ResidualBoxSchema>;
|
||||
};
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { BarcodeTemplateSchema } from './BarcodeTemplateSchema';
|
||||
import type { ChatSchema } from './ChatSchema';
|
||||
import type { ClientDetailsSchema } from './ClientDetailsSchema';
|
||||
export type ClientSchema = {
|
||||
id: number;
|
||||
@@ -11,5 +12,6 @@ export type ClientSchema = {
|
||||
barcodeTemplate?: (BarcodeTemplateSchema | null);
|
||||
comment?: (string | null);
|
||||
details?: (ClientDetailsSchema | null);
|
||||
chat?: (ChatSchema | null);
|
||||
};
|
||||
|
||||
|
||||
9
src/client/models/CreateChatRequest.ts
Normal file
9
src/client/models/CreateChatRequest.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type CreateChatRequest = {
|
||||
clientId: number;
|
||||
cardId: (number | null);
|
||||
};
|
||||
|
||||
9
src/client/models/CreateChatResponse.ts
Normal file
9
src/client/models/CreateChatResponse.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type CreateChatResponse = {
|
||||
ok: boolean;
|
||||
message: string;
|
||||
};
|
||||
|
||||
9
src/client/models/DeleteMessageResponse.ts
Normal file
9
src/client/models/DeleteMessageResponse.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type DeleteMessageResponse = {
|
||||
ok: boolean;
|
||||
message: string;
|
||||
};
|
||||
|
||||
9
src/client/models/GetChatRequest.ts
Normal file
9
src/client/models/GetChatRequest.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type GetChatRequest = {
|
||||
clientId: number;
|
||||
cardId: (number | null);
|
||||
};
|
||||
|
||||
9
src/client/models/GetChatResponse.ts
Normal file
9
src/client/models/GetChatResponse.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { ChatSchema } from './ChatSchema';
|
||||
export type GetChatResponse = {
|
||||
chat: (ChatSchema | null);
|
||||
};
|
||||
|
||||
10
src/client/models/GetMessagesRequest.ts
Normal file
10
src/client/models/GetMessagesRequest.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type GetMessagesRequest = {
|
||||
chatId: number;
|
||||
offset: number;
|
||||
limit: number;
|
||||
};
|
||||
|
||||
9
src/client/models/GetMessagesResponse.ts
Normal file
9
src/client/models/GetMessagesResponse.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { MessageSchema } from './MessageSchema';
|
||||
export type GetMessagesResponse = {
|
||||
messages: Array<MessageSchema>;
|
||||
};
|
||||
|
||||
14
src/client/models/MessageSchema.ts
Normal file
14
src/client/models/MessageSchema.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { TgUserSchema } from './TgUserSchema';
|
||||
export type MessageSchema = {
|
||||
text: string;
|
||||
chatId: number;
|
||||
id: number;
|
||||
createdAt: string;
|
||||
tgSender: (TgUserSchema | null);
|
||||
status: string;
|
||||
};
|
||||
|
||||
9
src/client/models/SendMessageRequest.ts
Normal file
9
src/client/models/SendMessageRequest.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { BaseMessageSchema } from './BaseMessageSchema';
|
||||
export type SendMessageRequest = {
|
||||
message: BaseMessageSchema;
|
||||
};
|
||||
|
||||
9
src/client/models/SendMessageResponse.ts
Normal file
9
src/client/models/SendMessageResponse.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type SendMessageResponse = {
|
||||
ok: boolean;
|
||||
message: string;
|
||||
};
|
||||
|
||||
9
src/client/models/TgGroupSchema.ts
Normal file
9
src/client/models/TgGroupSchema.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type TgGroupSchema = {
|
||||
tgGroupId: number;
|
||||
tgInviteLink: string;
|
||||
};
|
||||
|
||||
11
src/client/models/TgUserSchema.ts
Normal file
11
src/client/models/TgUserSchema.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type TgUserSchema = {
|
||||
id: number;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
username: string;
|
||||
};
|
||||
|
||||
119
src/client/services/ChatService.ts
Normal file
119
src/client/services/ChatService.ts
Normal file
@@ -0,0 +1,119 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { CreateChatRequest } from '../models/CreateChatRequest';
|
||||
import type { CreateChatResponse } from '../models/CreateChatResponse';
|
||||
import type { DeleteMessageResponse } from '../models/DeleteMessageResponse';
|
||||
import type { GetChatRequest } from '../models/GetChatRequest';
|
||||
import type { GetChatResponse } from '../models/GetChatResponse';
|
||||
import type { GetMessagesRequest } from '../models/GetMessagesRequest';
|
||||
import type { GetMessagesResponse } from '../models/GetMessagesResponse';
|
||||
import type { SendMessageRequest } from '../models/SendMessageRequest';
|
||||
import type { SendMessageResponse } from '../models/SendMessageResponse';
|
||||
import type { CancelablePromise } from '../core/CancelablePromise';
|
||||
import { OpenAPI } from '../core/OpenAPI';
|
||||
import { request as __request } from '../core/request';
|
||||
export class ChatService {
|
||||
/**
|
||||
* Send Message
|
||||
* @returns SendMessageResponse Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static sendMessage({
|
||||
requestBody,
|
||||
}: {
|
||||
requestBody: SendMessageRequest,
|
||||
}): CancelablePromise<SendMessageResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/chat/message',
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Delete Message
|
||||
* @returns DeleteMessageResponse Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static deleteMessage({
|
||||
messageId,
|
||||
}: {
|
||||
messageId: number,
|
||||
}): CancelablePromise<DeleteMessageResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'DELETE',
|
||||
url: '/chat/message/{message_id}',
|
||||
path: {
|
||||
'message_id': messageId,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Get Chat
|
||||
* @returns GetChatResponse Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getChat({
|
||||
requestBody,
|
||||
}: {
|
||||
requestBody: GetChatRequest,
|
||||
}): CancelablePromise<GetChatResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/chat/',
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Create Chat
|
||||
* @returns CreateChatResponse Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static createChat({
|
||||
requestBody,
|
||||
}: {
|
||||
requestBody: CreateChatRequest,
|
||||
}): CancelablePromise<CreateChatResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/chat/create',
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Get Messages
|
||||
* @returns GetMessagesResponse Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getMessages({
|
||||
requestBody,
|
||||
}: {
|
||||
requestBody: GetMessagesRequest,
|
||||
}): CancelablePromise<GetMessagesResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/chat/messages',
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user