@zyacreatives/shared 2.0.43 → 2.0.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,3 +35,16 @@ export declare const CreateChatOutputSchema: z.ZodObject<{
35
35
  export declare const ChatIdSchema: z.ZodObject<{
36
36
  chatId: z.ZodCUID2;
37
37
  }, z.core.$strip>;
38
+ export declare const GetChatsOutputSchema: z.ZodArray<z.ZodObject<{
39
+ id: z.ZodCUID2;
40
+ senderId: z.ZodCUID2;
41
+ receiverId: z.ZodCUID2;
42
+ createdAt: z.ZodCoercedDate<unknown>;
43
+ updatedAt: z.ZodCoercedDate<unknown>;
44
+ deletedAt: z.ZodCoercedDate<unknown>;
45
+ senderImgUrl: z.ZodOptional<z.ZodString>;
46
+ senderName: z.ZodString;
47
+ receiverImgUrl: z.ZodOptional<z.ZodString>;
48
+ receiverName: z.ZodString;
49
+ lastMessageSent: z.ZodOptional<z.ZodString>;
50
+ }, z.core.$strip>>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ChatIdSchema = exports.CreateChatOutputSchema = exports.CreateChatInputSchema = exports.ChatEntitySchema = exports.BaseChatEntitySchema = void 0;
3
+ exports.GetChatsOutputSchema = exports.ChatIdSchema = exports.CreateChatOutputSchema = exports.CreateChatInputSchema = exports.ChatEntitySchema = exports.BaseChatEntitySchema = void 0;
4
4
  const zod_openapi_1 = require("@hono/zod-openapi");
5
5
  exports.BaseChatEntitySchema = zod_openapi_1.z.object({
6
6
  id: zod_openapi_1.z.cuid2(),
@@ -25,3 +25,4 @@ exports.CreateChatOutputSchema = exports.BaseChatEntitySchema;
25
25
  exports.ChatIdSchema = zod_openapi_1.z.object({
26
26
  chatId: zod_openapi_1.z.cuid2(),
27
27
  });
28
+ exports.GetChatsOutputSchema = zod_openapi_1.z.array(exports.ChatEntitySchema);
@@ -128,3 +128,9 @@ export declare const CreateMessageOutputSchema: z.ZodObject<{
128
128
  updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
129
129
  deletedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
130
130
  }, z.core.$strip>;
131
+ export declare const GetMessagesOutputSchema: z.ZodArray<z.ZodObject<{
132
+ id: z.ZodString;
133
+ messageId: z.ZodString;
134
+ fileId: z.ZodString;
135
+ order: z.ZodNumber;
136
+ }, z.core.$strip>>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CreateMessageOutputSchema = exports.CreateMessageInputSchema = exports.MessageWithFilesEntitySchema = exports.MessageFileEntitySchema = exports.MessageEntitySchema = void 0;
3
+ exports.GetMessagesOutputSchema = exports.CreateMessageOutputSchema = exports.CreateMessageInputSchema = exports.MessageWithFilesEntitySchema = exports.MessageFileEntitySchema = exports.MessageEntitySchema = void 0;
4
4
  const zod_openapi_1 = require("@hono/zod-openapi");
5
5
  const constants_1 = require("../constants");
6
6
  const file_1 = require("./file");
@@ -102,3 +102,4 @@ exports.CreateMessageInputSchema = zod_openapi_1.z.object({
102
102
  }),
103
103
  });
104
104
  exports.CreateMessageOutputSchema = exports.MessageEntitySchema;
105
+ exports.GetMessagesOutputSchema = zod_openapi_1.z.array(exports.MessageFileEntitySchema);
@@ -1,7 +1,8 @@
1
1
  import z from "zod";
2
- import { BaseChatEntitySchema, ChatEntitySchema, ChatIdSchema, CreateChatInputSchema, CreateChatOutputSchema } from "../schemas/chat";
2
+ import { BaseChatEntitySchema, ChatEntitySchema, ChatIdSchema, CreateChatInputSchema, CreateChatOutputSchema, GetChatsOutputSchema } from "../schemas/chat";
3
3
  export type BaseChatEntity = z.infer<typeof BaseChatEntitySchema>;
4
4
  export type ChatEntity = z.infer<typeof ChatEntitySchema>;
5
5
  export type CreateChatInput = z.infer<typeof CreateChatInputSchema>;
6
6
  export type CreateChatOutput = z.infer<typeof CreateChatOutputSchema>;
7
7
  export type ChatIdInput = z.infer<typeof ChatIdSchema>;
8
+ export type GetChatsOutput = z.infer<typeof GetChatsOutputSchema>;
@@ -1,7 +1,8 @@
1
1
  import z from "zod";
2
- import { CreateMessageInputSchema, CreateMessageOutputSchema, MessageEntitySchema, MessageFileEntitySchema, MessageWithFilesEntitySchema } from "../schemas/message";
2
+ import { CreateMessageInputSchema, CreateMessageOutputSchema, GetMessagesOutputSchema, MessageEntitySchema, MessageFileEntitySchema, MessageWithFilesEntitySchema } from "../schemas/message";
3
3
  export type MessageEntity = z.infer<typeof MessageEntitySchema>;
4
4
  export type MessageFileEntity = z.infer<typeof MessageFileEntitySchema>;
5
5
  export type MessageWithFilesEntity = z.infer<typeof MessageWithFilesEntitySchema>;
6
6
  export type CreateMessageInput = z.infer<typeof CreateMessageInputSchema>;
7
7
  export type CreateMessageOutput = z.infer<typeof CreateMessageOutputSchema>;
8
+ export type GetMessagesOutput = z.infer<typeof GetMessagesOutputSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "2.0.43",
3
+ "version": "2.0.45",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -27,3 +27,5 @@ export const CreateChatOutputSchema = BaseChatEntitySchema;
27
27
  export const ChatIdSchema = z.object({
28
28
  chatId: z.cuid2(),
29
29
  });
30
+
31
+ export const GetChatsOutputSchema = z.array(ChatEntitySchema);
@@ -108,3 +108,5 @@ export const CreateMessageInputSchema = z.object({
108
108
  });
109
109
 
110
110
  export const CreateMessageOutputSchema = MessageEntitySchema;
111
+
112
+ export const GetMessagesOutputSchema = z.array(MessageFileEntitySchema);
package/src/types/chat.ts CHANGED
@@ -5,6 +5,7 @@ import {
5
5
  ChatIdSchema,
6
6
  CreateChatInputSchema,
7
7
  CreateChatOutputSchema,
8
+ GetChatsOutputSchema,
8
9
  } from "../schemas/chat";
9
10
 
10
11
  export type BaseChatEntity = z.infer<typeof BaseChatEntitySchema>;
@@ -16,3 +17,5 @@ export type CreateChatInput = z.infer<typeof CreateChatInputSchema>;
16
17
  export type CreateChatOutput = z.infer<typeof CreateChatOutputSchema>;
17
18
 
18
19
  export type ChatIdInput = z.infer<typeof ChatIdSchema>;
20
+
21
+ export type GetChatsOutput = z.infer<typeof GetChatsOutputSchema>;
@@ -2,6 +2,7 @@ import z from "zod";
2
2
  import {
3
3
  CreateMessageInputSchema,
4
4
  CreateMessageOutputSchema,
5
+ GetMessagesOutputSchema,
5
6
  MessageEntitySchema,
6
7
  MessageFileEntitySchema,
7
8
  MessageWithFilesEntitySchema,
@@ -18,3 +19,5 @@ export type MessageWithFilesEntity = z.infer<
18
19
  export type CreateMessageInput = z.infer<typeof CreateMessageInputSchema>;
19
20
 
20
21
  export type CreateMessageOutput = z.infer<typeof CreateMessageOutputSchema>;
22
+
23
+ export type GetMessagesOutput = z.infer<typeof GetMessagesOutputSchema>;