From e44f20588b74ffe1a98d906213f78208c5ad938d Mon Sep 17 00:00:00 2001 From: Aleksandr Lapuskin Date: Wed, 6 Nov 2024 14:11:33 +0200 Subject: [PATCH] chore(message-client): update client with new spec --- clients/message-client/package.json | 2 +- .../message-client/src/openapi-runtime.json | 76 ++++++ clients/message-client/src/openapi.d.ts | 243 +++++++++++++++--- clients/message-client/src/openapi.json | 208 ++++++++++++++- 4 files changed, 484 insertions(+), 45 deletions(-) diff --git a/clients/message-client/package.json b/clients/message-client/package.json index b62b1fb4..feadd518 100644 --- a/clients/message-client/package.json +++ b/clients/message-client/package.json @@ -1,6 +1,6 @@ { "name": "@epilot/message-client", - "version": "1.15.1", + "version": "1.15.2", "description": "API Client for epilot Message API", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/clients/message-client/src/openapi-runtime.json b/clients/message-client/src/openapi-runtime.json index d6e53a5d..30ab3741 100644 --- a/clients/message-client/src/openapi-runtime.json +++ b/clients/message-client/src/openapi-runtime.json @@ -89,6 +89,25 @@ "responses": {} } }, + "/v2/message/messages/{id}/read": { + "post": { + "operationId": "markReadMessageV2", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": {} + } + }, + "responses": {} + } + }, "/v1/message/messages/{id}/unread": { "post": { "operationId": "markUnreadMessage", @@ -102,6 +121,25 @@ "responses": {} } }, + "/v2/message/messages/{id}/unread": { + "post": { + "operationId": "markUnreadMessageV2", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": {} + } + }, + "responses": {} + } + }, "/v1/message/threads:search": { "post": { "operationId": "searchThreads", @@ -171,6 +209,25 @@ "responses": {} } }, + "/v2/message/threads/{id}/read": { + "post": { + "operationId": "markReadThreadV2", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": {} + } + }, + "responses": {} + } + }, "/v1/message/threads/{id}/unread": { "post": { "operationId": "markUnreadThread", @@ -184,6 +241,25 @@ "responses": {} } }, + "/v2/message/threads/{id}/unread": { + "post": { + "operationId": "markUnreadThreadV2", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": {} + } + }, + "responses": {} + } + }, "/v1/message/threads/{id}/assign": { "post": { "operationId": "assignThread", diff --git a/clients/message-client/src/openapi.d.ts b/clients/message-client/src/openapi.d.ts index 4129ae12..c657d36b 100644 --- a/clients/message-client/src/openapi.d.ts +++ b/clients/message-client/src/openapi.d.ts @@ -62,7 +62,7 @@ declare namespace Components { */ _title: string; /** - * Ivy Organization ID the entity belongs to + * Organization ID the entity belongs to * example: * 206801 */ @@ -112,6 +112,10 @@ declare namespace Components { * To indicate this file relation is message attachment. If false then this file will not be sent and simply kept as a file relation. */ is_message_attachment?: boolean; + /** + * To indicate this file relation may be signature attachment. If true then this file will be sent as signature attachment and not related to any entity. + */ + may_be_signature_attachment?: boolean; /** * Content ID (for inline) * example: @@ -137,7 +141,7 @@ declare namespace Components { */ message_id?: string; /** - * Ivy User ID of user sends the message. + * User ID of user sends the message. * example: * 206801 */ @@ -190,11 +194,11 @@ declare namespace Components { */ in_reply_to?: string; /** - * Ivy User ID of user read the message. + * User ID of user read the message. */ user_read_message?: string[]; /** - * Ivy Organization ID of organization read the message. + * Organization ID of organization read the message. */ org_read_message?: string[]; /** @@ -234,7 +238,7 @@ declare namespace Components { */ topic: string; /** - * Ivy User ID of who the message is assigned to. Default is the user who sends message. + * User ID of who the message is assigned to. Default is the user who sends message. */ assigned_to?: string[]; }; @@ -297,7 +301,7 @@ declare namespace Components { */ _title: string; /** - * Ivy Organization ID the entity belongs to + * Organization ID the entity belongs to * example: * 206801 */ @@ -336,7 +340,7 @@ declare namespace Components { */ message_id?: string; /** - * Ivy User ID of user sends the message. + * User ID of user sends the message. * example: * 206801 */ @@ -389,11 +393,11 @@ declare namespace Components { */ in_reply_to?: string; /** - * Ivy User ID of user read the message. + * User ID of user read the message. */ user_read_message?: string[]; /** - * Ivy Organization ID of organization read the message. + * Organization ID of organization read the message. */ org_read_message?: string[]; /** @@ -422,6 +426,21 @@ declare namespace Components { */ html_download_url?: string; } + export interface ReadMessagePayload { + /** + * The scopes to be used when marking an item as read or unread. The read status will be synced for all provided scopes. + * example: + * [ + * "organization", + * "user" + * ] + */ + scopes: /* Who is marking an item as read or unread. */ ReadingScope[]; + } + /** + * Who is marking an item as read or unread. + */ + export type ReadingScope = "organization" | "user"; export interface SearchParams { /** * Lucene query syntax supported with ElasticSearch @@ -443,11 +462,11 @@ declare namespace Components { */ topic: string; /** - * Ivy User ID of who the message is assigned to. Default is the user who sends message. + * User ID of who the message is assigned to. Default is the user who sends message. */ assigned_to?: string[]; /** - * Ivy Organization ID of organization read the message. + * Organization ID of organization read the message. */ org_read_message?: string[]; /** @@ -543,7 +562,7 @@ declare namespace Paths { */ _title: string; /** - * Ivy Organization ID the entity belongs to + * Organization ID the entity belongs to * example: * 206801 */ @@ -582,7 +601,7 @@ declare namespace Paths { */ message_id?: string; /** - * Ivy User ID of user sends the message. + * User ID of user sends the message. * example: * 206801 */ @@ -635,11 +654,11 @@ declare namespace Paths { */ in_reply_to?: string; /** - * Ivy User ID of user read the message. + * User ID of user read the message. */ user_read_message?: string[]; /** - * Ivy Organization ID of organization read the message. + * Organization ID of organization read the message. */ org_read_message?: string[]; /** @@ -718,7 +737,7 @@ declare namespace Paths { */ _title: string; /** - * Ivy Organization ID the entity belongs to + * Organization ID the entity belongs to * example: * 206801 */ @@ -757,7 +776,7 @@ declare namespace Paths { */ message_id?: string; /** - * Ivy User ID of user sends the message. + * User ID of user sends the message. * example: * 206801 */ @@ -810,11 +829,11 @@ declare namespace Paths { */ in_reply_to?: string; /** - * Ivy User ID of user read the message. + * User ID of user read the message. */ user_read_message?: string[]; /** - * Ivy Organization ID of organization read the message. + * Organization ID of organization read the message. */ org_read_message?: string[]; /** @@ -867,7 +886,7 @@ declare namespace Paths { */ _title: string; /** - * Ivy Organization ID the entity belongs to + * Organization ID the entity belongs to * example: * 206801 */ @@ -906,7 +925,7 @@ declare namespace Paths { */ message_id?: string; /** - * Ivy User ID of user sends the message. + * User ID of user sends the message. * example: * 206801 */ @@ -959,11 +978,11 @@ declare namespace Paths { */ in_reply_to?: string; /** - * Ivy User ID of user read the message. + * User ID of user read the message. */ user_read_message?: string[]; /** - * Ivy Organization ID of organization read the message. + * Organization ID of organization read the message. */ org_read_message?: string[]; /** @@ -1010,6 +1029,21 @@ declare namespace Paths { } } } + namespace MarkReadMessageV2 { + namespace Parameters { + export type Id = string; + } + export interface PathParameters { + id: Parameters.Id; + } + export type RequestBody = Components.Schemas.ReadMessagePayload; + namespace Responses { + export interface $204 { + } + export interface $403 { + } + } + } namespace MarkReadThread { namespace Parameters { export type Id = string; @@ -1024,6 +1058,21 @@ declare namespace Paths { } } } + namespace MarkReadThreadV2 { + namespace Parameters { + export type Id = string; + } + export interface PathParameters { + id: Parameters.Id; + } + export type RequestBody = Components.Schemas.ReadMessagePayload; + namespace Responses { + export interface $204 { + } + export interface $403 { + } + } + } namespace MarkUnreadMessage { namespace Parameters { export type Id = string; @@ -1038,6 +1087,21 @@ declare namespace Paths { } } } + namespace MarkUnreadMessageV2 { + namespace Parameters { + export type Id = string; + } + export interface PathParameters { + id: Parameters.Id; + } + export type RequestBody = Components.Schemas.ReadMessagePayload; + namespace Responses { + export interface $204 { + } + export interface $403 { + } + } + } namespace MarkUnreadThread { namespace Parameters { export type Id = string; @@ -1052,6 +1116,21 @@ declare namespace Paths { } } } + namespace MarkUnreadThreadV2 { + namespace Parameters { + export type Id = string; + } + export interface PathParameters { + id: Parameters.Id; + } + export type RequestBody = Components.Schemas.ReadMessagePayload; + namespace Responses { + export interface $204 { + } + export interface $403 { + } + } + } namespace SearchThreads { export type RequestBody = Components.Schemas.SearchParams; namespace Responses { @@ -1077,7 +1156,7 @@ declare namespace Paths { */ _title: string; /** - * Ivy Organization ID the entity belongs to + * Organization ID the entity belongs to * example: * 206801 */ @@ -1116,11 +1195,11 @@ declare namespace Paths { */ topic: string; /** - * Ivy User ID of who the message is assigned to. Default is the user who sends message. + * User ID of who the message is assigned to. Default is the user who sends message. */ assigned_to?: string[]; /** - * Ivy Organization ID of organization read the message. + * Organization ID of organization read the message. */ org_read_message?: string[]; latest_message?: Components.Schemas.Message; @@ -1151,7 +1230,7 @@ declare namespace Paths { */ _title: string; /** - * Ivy Organization ID the entity belongs to + * Organization ID the entity belongs to * example: * 206801 */ @@ -1190,7 +1269,7 @@ declare namespace Paths { */ message_id?: string; /** - * Ivy User ID of user sends the message. + * User ID of user sends the message. * example: * 206801 */ @@ -1243,11 +1322,11 @@ declare namespace Paths { */ in_reply_to?: string; /** - * Ivy User ID of user read the message. + * User ID of user read the message. */ user_read_message?: string[]; /** - * Ivy Organization ID of organization read the message. + * Organization ID of organization read the message. */ org_read_message?: string[]; /** @@ -1385,7 +1464,7 @@ declare namespace Paths { */ _title: string; /** - * Ivy Organization ID the entity belongs to + * Organization ID the entity belongs to * example: * 206801 */ @@ -1424,7 +1503,7 @@ declare namespace Paths { */ message_id?: string; /** - * Ivy User ID of user sends the message. + * User ID of user sends the message. * example: * 206801 */ @@ -1477,11 +1556,11 @@ declare namespace Paths { */ in_reply_to?: string; /** - * Ivy User ID of user read the message. + * User ID of user read the message. */ user_read_message?: string[]; /** - * Ivy Organization ID of organization read the message. + * Organization ID of organization read the message. */ org_read_message?: string[]; /** @@ -1521,7 +1600,7 @@ declare namespace Paths { */ _title: string; /** - * Ivy Organization ID the entity belongs to + * Organization ID the entity belongs to * example: * 206801 */ @@ -1560,11 +1639,11 @@ declare namespace Paths { */ topic: string; /** - * Ivy User ID of who the message is assigned to. Default is the user who sends message. + * User ID of who the message is assigned to. Default is the user who sends message. */ assigned_to?: string[]; /** - * Ivy Organization ID of organization read the message. + * Organization ID of organization read the message. */ org_read_message?: string[]; latest_message?: Components.Schemas.Message; @@ -1653,6 +1732,16 @@ export interface OperationMethods { data?: any, config?: AxiosRequestConfig ): OperationResponse + /** + * markReadMessageV2 - markReadMessageV2 + * + * Mark message as read within a scope + */ + 'markReadMessageV2'( + parameters?: Parameters | null, + data?: Paths.MarkReadMessageV2.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse /** * markUnreadMessage - markUnreadMessage * @@ -1663,6 +1752,16 @@ export interface OperationMethods { data?: any, config?: AxiosRequestConfig ): OperationResponse + /** + * markUnreadMessageV2 - markUnreadMessageV2 + * + * Mark message as unread within a scope + */ + 'markUnreadMessageV2'( + parameters?: Parameters | null, + data?: Paths.MarkUnreadMessageV2.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse /** * searchThreads - searchThreads * @@ -1728,6 +1827,16 @@ export interface OperationMethods { data?: any, config?: AxiosRequestConfig ): OperationResponse + /** + * markReadThreadV2 - markReadThreadV2 + * + * Mark thread as read within a scope + */ + 'markReadThreadV2'( + parameters?: Parameters | null, + data?: Paths.MarkReadThreadV2.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse /** * markUnreadThread - markUnreadThread * @@ -1738,6 +1847,16 @@ export interface OperationMethods { data?: any, config?: AxiosRequestConfig ): OperationResponse + /** + * markUnreadThreadV2 - markUnreadThreadV2 + * + * Mark thread as unread within a scope + */ + 'markUnreadThreadV2'( + parameters?: Parameters | null, + data?: Paths.MarkUnreadThreadV2.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse /** * assignThread - assignThread * @@ -1893,6 +2012,18 @@ export interface PathsDictionary { config?: AxiosRequestConfig ): OperationResponse } + ['/v2/message/messages/{id}/read']: { + /** + * markReadMessageV2 - markReadMessageV2 + * + * Mark message as read within a scope + */ + 'post'( + parameters?: Parameters | null, + data?: Paths.MarkReadMessageV2.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + } ['/v1/message/messages/{id}/unread']: { /** * markUnreadMessage - markUnreadMessage @@ -1905,6 +2036,18 @@ export interface PathsDictionary { config?: AxiosRequestConfig ): OperationResponse } + ['/v2/message/messages/{id}/unread']: { + /** + * markUnreadMessageV2 - markUnreadMessageV2 + * + * Mark message as unread within a scope + */ + 'post'( + parameters?: Parameters | null, + data?: Paths.MarkUnreadMessageV2.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + } ['/v1/message/threads:search']: { /** * searchThreads - searchThreads @@ -1982,6 +2125,18 @@ export interface PathsDictionary { config?: AxiosRequestConfig ): OperationResponse } + ['/v2/message/threads/{id}/read']: { + /** + * markReadThreadV2 - markReadThreadV2 + * + * Mark thread as read within a scope + */ + 'post'( + parameters?: Parameters | null, + data?: Paths.MarkReadThreadV2.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + } ['/v1/message/threads/{id}/unread']: { /** * markUnreadThread - markUnreadThread @@ -1994,6 +2149,18 @@ export interface PathsDictionary { config?: AxiosRequestConfig ): OperationResponse } + ['/v2/message/threads/{id}/unread']: { + /** + * markUnreadThreadV2 - markUnreadThreadV2 + * + * Mark thread as unread within a scope + */ + 'post'( + parameters?: Parameters | null, + data?: Paths.MarkUnreadThreadV2.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + } ['/v1/message/threads/{id}/assign']: { /** * assignThread - assignThread @@ -2089,5 +2256,7 @@ export type File = Components.Schemas.File; export type Message = Components.Schemas.Message; export type MessageRequestParams = Components.Schemas.MessageRequestParams; export type MessageV2 = Components.Schemas.MessageV2; +export type ReadMessagePayload = Components.Schemas.ReadMessagePayload; +export type ReadingScope = Components.Schemas.ReadingScope; export type SearchParams = Components.Schemas.SearchParams; export type Thread = Components.Schemas.Thread; diff --git a/clients/message-client/src/openapi.json b/clients/message-client/src/openapi.json index e0960633..33921799 100644 --- a/clients/message-client/src/openapi.json +++ b/clients/message-client/src/openapi.json @@ -270,6 +270,45 @@ } } }, + "/v2/message/messages/{id}/read": { + "post": { + "operationId": "markReadMessageV2", + "summary": "markReadMessageV2", + "description": "Mark message as read within a scope", + "tags": [ + "Messages" + ], + "parameters": [ + { + "name": "id", + "description": "Message ID", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReadMessagePayload" + } + } + } + }, + "responses": { + "204": { + "description": "Success" + }, + "403": { + "description": "Forbidden" + } + } + } + }, "/v1/message/messages/{id}/unread": { "post": { "operationId": "markUnreadMessage", @@ -299,6 +338,45 @@ } } }, + "/v2/message/messages/{id}/unread": { + "post": { + "operationId": "markUnreadMessageV2", + "summary": "markUnreadMessageV2", + "description": "Mark message as unread within a scope", + "tags": [ + "Messages" + ], + "parameters": [ + { + "name": "id", + "description": "Message ID", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReadMessagePayload" + } + } + } + }, + "responses": { + "204": { + "description": "Success" + }, + "403": { + "description": "Forbidden" + } + } + } + }, "/v1/message/threads:search": { "post": { "operationId": "searchThreads", @@ -506,6 +584,45 @@ } } }, + "/v2/message/threads/{id}/read": { + "post": { + "operationId": "markReadThreadV2", + "summary": "markReadThreadV2", + "description": "Mark thread as read within a scope", + "tags": [ + "Threads" + ], + "parameters": [ + { + "name": "id", + "description": "Thread ID", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReadMessagePayload" + } + } + } + }, + "responses": { + "204": { + "description": "Success" + }, + "403": { + "description": "Forbidden" + } + } + } + }, "/v1/message/threads/{id}/unread": { "post": { "operationId": "markUnreadThread", @@ -535,6 +652,45 @@ } } }, + "/v2/message/threads/{id}/unread": { + "post": { + "operationId": "markUnreadThreadV2", + "summary": "markUnreadThreadV2", + "description": "Mark thread as unread within a scope", + "tags": [ + "Threads" + ], + "parameters": [ + { + "name": "id", + "description": "Thread ID", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReadMessagePayload" + } + } + } + }, + "responses": { + "204": { + "description": "Success" + }, + "403": { + "description": "Forbidden" + } + } + } + }, "/v1/message/threads/{id}/assign": { "post": { "operationId": "assignThread", @@ -853,7 +1009,7 @@ }, "_org": { "type": "string", - "description": "Ivy Organization ID the entity belongs to", + "description": "Organization ID the entity belongs to", "example": "206801" }, "_schema": { @@ -899,7 +1055,7 @@ }, "assigned_to": { "type": "array", - "description": "Ivy User ID of who the message is assigned to. Default is the user who sends message.", + "description": "User ID of who the message is assigned to. Default is the user who sends message.", "items": { "type": "string", "example": [ @@ -910,7 +1066,7 @@ }, "org_read_message": { "type": "array", - "description": "Ivy Organization ID of organization read the message.", + "description": "Organization ID of organization read the message.", "items": { "type": "string", "example": [ @@ -950,7 +1106,7 @@ }, "sender": { "type": "string", - "description": "Ivy User ID of user sends the message.", + "description": "User ID of user sends the message.", "example": "206801" }, "subject": { @@ -1010,7 +1166,7 @@ }, "user_read_message": { "type": "array", - "description": "Ivy User ID of user read the message.", + "description": "User ID of user read the message.", "items": { "type": "string", "example": [ @@ -1021,7 +1177,7 @@ }, "org_read_message": { "type": "array", - "description": "Ivy Organization ID of organization read the message.", + "description": "Organization ID of organization read the message.", "items": { "type": "string", "example": [ @@ -1159,6 +1315,10 @@ "type": "boolean", "description": "To indicate this file relation is message attachment. If false then this file will not be sent and simply kept as a file relation." }, + "may_be_signature_attachment": { + "type": "boolean", + "description": "To indicate this file relation may be signature attachment. If true then this file will be sent as signature attachment and not related to any entity." + }, "cid": { "type": "string", "description": "Content ID (for inline)", @@ -1196,7 +1356,7 @@ }, "assigned_to": { "type": "array", - "description": "Ivy User ID of who the message is assigned to. Default is the user who sends message.", + "description": "User ID of who the message is assigned to. Default is the user who sends message.", "items": { "type": "string" } @@ -1290,10 +1450,44 @@ "default": 10 } } + }, + "ReadMessagePayload": { + "type": "object", + "required": [ + "scopes" + ], + "properties": { + "scopes": { + "description": "The scopes to be used when marking an item as read or unread. The read status will be synced for all provided scopes.", + "example": [ + "organization", + "user" + ], + "type": "array", + "default": [ + "organization", + "user" + ], + "items": { + "$ref": "#/components/schemas/ReadingScope" + } + } + } + }, + "ReadingScope": { + "description": "Who is marking an item as read or unread.", + "type": "string", + "enum": [ + "organization", + "user" + ] } } }, "servers": [ + { + "url": "https://message.sls.epilot.io" + }, { "url": "https://message.sls.epilot.io" }