Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

chore(channels): add thread replies handler to swagger (#1666)

teoebabef004156
diff --git a/js/app/packages/service-clients/service-storage/generated/zod.ts b/js/app/packages/service-clients/service-storage/generated/zod.ts
index f4f7b3c8c8..dd6f078944 100644
--- a/js/app/packages/service-clients/service-storage/generated/zod.ts
+++ b/js/app/packages/service-clients/service-storage/generated/zod.ts
@@ -1029,6 +1029,66 @@ export const getChannelMessagesResponse = zod
})
.describe('Paginated response of channel messages.');
+/**
+ * @summary Handler for `GET /channels/:channel_id/messages/:message_id/replies`.
+ */
+export const getThreadRepliesParams = zod.object({
+ channel_id: zod.string().uuid().describe('Channel ID'),
+ message_id: zod
+ .string()
+ .uuid()
+ .describe('Message ID (thread parent or reply id)'),
+});
+
+export const getThreadRepliesResponseItem = zod
+ .object({
+ attachments: zod
+ .array(
+ zod
+ .object({
+ created_at: zod
+ .string()
+ .datetime({})
+ .describe('When the attachment was created.'),
+ entity_id: zod.string().describe('Entity id.'),
+ entity_type: zod.string().describe('Type of entity.'),
+ id: zod.string().uuid().describe('Attachment id.'),
+ })
+ .describe('An attachment on a message.')
+ )
+ .describe('Attachments on this reply.'),
+ content: zod.string().describe('Reply content.'),
+ created_at: zod
+ .string()
+ .datetime({})
+ .describe('When the reply was created.'),
+ edited_at: zod
+ .string()
+ .datetime({})
+ .nullish()
+ .describe('When the reply was edited.'),
+ id: zod.string().uuid().describe('Reply id.'),
+ reactions: zod
+ .array(
+ zod
+ .object({
+ emoji: zod.string().describe('The emoji string.'),
+ users: zod
+ .array(zod.string())
+ .describe('User ids who added this reaction.'),
+ })
+ .describe('A reaction with emoji and user list.')
+ )
+ .describe('Reactions on this reply.'),
+ sender_id: zod.string().describe('Sender user id.'),
+ updated_at: zod
+ .string()
+ .datetime({})
+ .describe('When the reply was last updated.'),
+ })
+ .describe('A thread reply shown in preview.');
+export const getThreadRepliesResponse = zod.array(getThreadRepliesResponseItem);
+
/**
* @summary Handler for `GET /channels/:channel_id/participants`.
*/
diff --git a/js/app/packages/service-clients/service-storage/openapi.json b/js/app/packages/service-clients/service-storage/openapi.json
index 2363377923..122d7dd6c4 100644
--- a/js/app/packages/service-clients/service-storage/openapi.json
+++ b/js/app/packages/service-clients/service-storage/openapi.json
@@ -759,6 +759,70 @@
}
}
},
+ "/channels/{channel_id}/messages/{message_id}/replies": {
+ "get": {
+ "tags": ["channels::inbound::axum_router"],
+ "summary": "Handler for `GET /channels/:channel_id/messages/:message_id/replies`.",
+ "operationId": "get_thread_replies",
+ "parameters": [
+ {
+ "name": "channel_id",
+ "in": "path",
+ "description": "Channel ID",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "format": "uuid"
+ }
+ },
+ {
+ "name": "message_id",
+ "in": "path",
+ "description": "Message ID (thread parent or reply id)",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "format": "uuid"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/ApiThreadReply"
+ }
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ErrorResponse"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ErrorResponse"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
"/channels/{channel_id}/participants": {
"get": {
"tags": ["channels::inbound::axum_router"],
diff --git a/rust/cloud-storage/document_storage_service/src/api/swagger.rs b/rust/cloud-storage/document_storage_service/src/api/swagger.rs
index f7e180fe27..e0cafbf987 100644
--- a/rust/cloud-storage/document_storage_service/src/api/swagger.rs
+++ b/rust/cloud-storage/document_storage_service/src/api/swagger.rs
@@ -186,6 +186,7 @@ use utoipa::OpenApi;
// channels
channels::inbound::axum_router::get_channel_messages_handler,
+ channels::inbound::axum_router::get_thread_replies_handler,
channels::inbound::axum_router::get_channel_attachments_handler,
channels::inbound::axum_router::get_channel_participants_handler,