@zyacreatives/shared 2.2.71 → 2.2.72
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.
|
@@ -132,7 +132,6 @@ export declare const CreateMessageInputSchema: z.ZodObject<{
|
|
|
132
132
|
}>>;
|
|
133
133
|
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
134
134
|
replyToMessageId: z.ZodOptional<z.ZodCUID2>;
|
|
135
|
-
isEdited: z.ZodDefault<z.ZodBoolean>;
|
|
136
135
|
linkMeta: z.ZodOptional<z.ZodObject<{
|
|
137
136
|
url: z.ZodURL;
|
|
138
137
|
title: z.ZodOptional<z.ZodString>;
|
|
@@ -145,6 +144,14 @@ export declare const CreateMessageInputSchema: z.ZodObject<{
|
|
|
145
144
|
order: z.ZodNumber;
|
|
146
145
|
}, z.core.$strip>>>;
|
|
147
146
|
}, z.core.$strip>;
|
|
147
|
+
export declare const EditMessageInputSchema: z.ZodObject<{
|
|
148
|
+
id: z.ZodCUID2;
|
|
149
|
+
chatId: z.ZodCUID2;
|
|
150
|
+
senderId: z.ZodCUID2;
|
|
151
|
+
receiverId: z.ZodCUID2;
|
|
152
|
+
content: z.ZodOptional<z.ZodString>;
|
|
153
|
+
isEdited: boolean;
|
|
154
|
+
}, z.core.$strip>;
|
|
148
155
|
export declare const GetMessagesOutputSchema: z.ZodObject<{
|
|
149
156
|
messages: z.ZodArray<z.ZodObject<{
|
|
150
157
|
id: z.ZodCUID2;
|
package/dist/schemas/message.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ChatIdParamSchema = exports.MessageIdSchema = exports.GetMessagesOutputSchema = exports.CreateMessageInputSchema = exports.MessageWithFilesEntitySchema = exports.MessageFileEntitySchema = exports.DeleteMessagesInputSchema = exports.MessageEntitySchema = exports.LinkMetaSchema = void 0;
|
|
3
|
+
exports.ChatIdParamSchema = exports.MessageIdSchema = exports.GetMessagesOutputSchema = exports.EditMessageInputSchema = exports.CreateMessageInputSchema = exports.MessageWithFilesEntitySchema = exports.MessageFileEntitySchema = exports.DeleteMessagesInputSchema = exports.MessageEntitySchema = exports.LinkMetaSchema = 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");
|
|
@@ -61,12 +61,19 @@ exports.CreateMessageInputSchema = zod_openapi_1.z.object({
|
|
|
61
61
|
messageType: zod_openapi_1.z.enum(constants_1.MESSAGE_TYPES).default("DEFAULT_MESSAGE"),
|
|
62
62
|
parentId: zod_openapi_1.z.cuid2().optional(),
|
|
63
63
|
replyToMessageId: zod_openapi_1.z.cuid2().optional(),
|
|
64
|
-
isEdited: zod_openapi_1.z.boolean().default(false),
|
|
65
64
|
linkMeta: exports.LinkMetaSchema.optional(),
|
|
66
65
|
files: zod_openapi_1.z
|
|
67
66
|
.array(file_1.CreateFileInputSchema.extend({ order: zod_openapi_1.z.number().int() }))
|
|
68
67
|
.optional(),
|
|
69
68
|
});
|
|
69
|
+
exports.EditMessageInputSchema = zod_openapi_1.z.object({
|
|
70
|
+
id: zod_openapi_1.z.cuid2(),
|
|
71
|
+
chatId: zod_openapi_1.z.cuid2(),
|
|
72
|
+
senderId: zod_openapi_1.z.cuid2(),
|
|
73
|
+
receiverId: zod_openapi_1.z.cuid2(),
|
|
74
|
+
content: zod_openapi_1.z.string().optional(),
|
|
75
|
+
isEdited: true,
|
|
76
|
+
});
|
|
70
77
|
exports.GetMessagesOutputSchema = zod_openapi_1.z.object({
|
|
71
78
|
messages: zod_openapi_1.z.array(exports.MessageWithFilesEntitySchema),
|
|
72
79
|
nextCursor: zod_openapi_1.z.string().nullable(),
|
package/dist/types/message.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
|
-
import { CreateMessageInputSchema, DeleteMessagesInputSchema, GetMessagesOutputSchema, MessageEntitySchema, MessageFileEntitySchema, MessageWithFilesEntitySchema } from "../schemas/message";
|
|
2
|
+
import { CreateMessageInputSchema, DeleteMessagesInputSchema, EditMessageInputSchema, 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 GetMessagesOutput = z.infer<typeof GetMessagesOutputSchema>;
|
|
8
8
|
export type DeleteMessagesInput = z.infer<typeof DeleteMessagesInputSchema>;
|
|
9
|
+
export type EditMessageInput = z.infer<typeof EditMessageInputSchema>;
|
package/package.json
CHANGED
package/src/schemas/message.ts
CHANGED
|
@@ -41,7 +41,6 @@ export const MessageEntitySchema = z.object({
|
|
|
41
41
|
deletedAt: z.coerce.date().optional(),
|
|
42
42
|
});
|
|
43
43
|
|
|
44
|
-
|
|
45
44
|
export const DeleteMessagesInputSchema = z.object({
|
|
46
45
|
messageIds: z.array(z.cuid2()),
|
|
47
46
|
deleteForEveryone: z.boolean().default(false),
|
|
@@ -71,13 +70,22 @@ export const CreateMessageInputSchema = z.object({
|
|
|
71
70
|
|
|
72
71
|
parentId: z.cuid2().optional(),
|
|
73
72
|
replyToMessageId: z.cuid2().optional(),
|
|
74
|
-
|
|
73
|
+
|
|
75
74
|
linkMeta: LinkMetaSchema.optional(),
|
|
76
75
|
files: z
|
|
77
76
|
.array(CreateFileInputSchema.extend({ order: z.number().int() }))
|
|
78
77
|
.optional(),
|
|
79
78
|
});
|
|
80
79
|
|
|
80
|
+
export const EditMessageInputSchema = z.object({
|
|
81
|
+
id: z.cuid2(),
|
|
82
|
+
chatId: z.cuid2(),
|
|
83
|
+
senderId: z.cuid2(),
|
|
84
|
+
receiverId: z.cuid2(),
|
|
85
|
+
content: z.string().optional(),
|
|
86
|
+
isEdited: true,
|
|
87
|
+
});
|
|
88
|
+
|
|
81
89
|
export const GetMessagesOutputSchema = z.object({
|
|
82
90
|
messages: z.array(MessageWithFilesEntitySchema),
|
|
83
91
|
nextCursor: z.string().nullable(),
|
package/src/types/message.ts
CHANGED
|
@@ -2,6 +2,7 @@ import z from "zod";
|
|
|
2
2
|
import {
|
|
3
3
|
CreateMessageInputSchema,
|
|
4
4
|
DeleteMessagesInputSchema,
|
|
5
|
+
EditMessageInputSchema,
|
|
5
6
|
GetMessagesOutputSchema,
|
|
6
7
|
MessageEntitySchema,
|
|
7
8
|
MessageFileEntitySchema,
|
|
@@ -21,3 +22,5 @@ export type CreateMessageInput = z.infer<typeof CreateMessageInputSchema>;
|
|
|
21
22
|
export type GetMessagesOutput = z.infer<typeof GetMessagesOutputSchema>;
|
|
22
23
|
|
|
23
24
|
export type DeleteMessagesInput = z.infer<typeof DeleteMessagesInputSchema>;
|
|
25
|
+
|
|
26
|
+
export type EditMessageInput = z.infer<typeof EditMessageInputSchema>;
|