@zyacreatives/shared 2.2.68 → 2.2.70
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.
|
@@ -46,10 +46,15 @@ export declare const MessageEntitySchema: z.ZodObject<{
|
|
|
46
46
|
}, z.core.$strip>>;
|
|
47
47
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
48
48
|
updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
49
|
-
deletedBySender: z.
|
|
50
|
-
deletedByReceiver: z.
|
|
49
|
+
deletedBySender: z.ZodDefault<z.ZodBoolean>;
|
|
50
|
+
deletedByReceiver: z.ZodDefault<z.ZodBoolean>;
|
|
51
|
+
isEdited: z.ZodDefault<z.ZodBoolean>;
|
|
51
52
|
deletedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
52
53
|
}, z.core.$strip>;
|
|
54
|
+
export declare const DeleteMessagesInputSchema: z.ZodObject<{
|
|
55
|
+
messageIds: z.ZodArray<z.ZodCUID2>;
|
|
56
|
+
deleteForEveryone: z.ZodDefault<z.ZodBoolean>;
|
|
57
|
+
}, z.core.$strip>;
|
|
53
58
|
export declare const MessageFileEntitySchema: z.ZodObject<{
|
|
54
59
|
id: z.ZodCUID2;
|
|
55
60
|
messageId: z.ZodCUID2;
|
|
@@ -98,8 +103,9 @@ export declare const MessageWithFilesEntitySchema: z.ZodObject<{
|
|
|
98
103
|
}, z.core.$strip>>;
|
|
99
104
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
100
105
|
updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
101
|
-
deletedBySender: z.
|
|
102
|
-
deletedByReceiver: z.
|
|
106
|
+
deletedBySender: z.ZodDefault<z.ZodBoolean>;
|
|
107
|
+
deletedByReceiver: z.ZodDefault<z.ZodBoolean>;
|
|
108
|
+
isEdited: z.ZodDefault<z.ZodBoolean>;
|
|
103
109
|
deletedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
104
110
|
messageFiles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
105
111
|
id: z.ZodCUID2;
|
|
@@ -180,8 +186,9 @@ export declare const GetMessagesOutputSchema: z.ZodObject<{
|
|
|
180
186
|
}, z.core.$strip>>;
|
|
181
187
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
182
188
|
updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
183
|
-
deletedBySender: z.
|
|
184
|
-
deletedByReceiver: z.
|
|
189
|
+
deletedBySender: z.ZodDefault<z.ZodBoolean>;
|
|
190
|
+
deletedByReceiver: z.ZodDefault<z.ZodBoolean>;
|
|
191
|
+
isEdited: z.ZodDefault<z.ZodBoolean>;
|
|
185
192
|
deletedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
186
193
|
messageFiles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
187
194
|
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.MessageEntitySchema = exports.LinkMetaSchema = void 0;
|
|
3
|
+
exports.ChatIdParamSchema = exports.MessageIdSchema = exports.GetMessagesOutputSchema = 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");
|
|
@@ -32,10 +32,15 @@ exports.MessageEntitySchema = zod_openapi_1.z.object({
|
|
|
32
32
|
linkMeta: exports.LinkMetaSchema.optional(),
|
|
33
33
|
createdAt: zod_openapi_1.z.coerce.date(),
|
|
34
34
|
updatedAt: zod_openapi_1.z.coerce.date().optional(),
|
|
35
|
-
deletedBySender: zod_openapi_1.z.
|
|
36
|
-
deletedByReceiver: zod_openapi_1.z.
|
|
35
|
+
deletedBySender: zod_openapi_1.z.boolean().default(false),
|
|
36
|
+
deletedByReceiver: zod_openapi_1.z.boolean().default(false),
|
|
37
|
+
isEdited: zod_openapi_1.z.boolean().default(false),
|
|
37
38
|
deletedAt: zod_openapi_1.z.coerce.date().optional(),
|
|
38
39
|
});
|
|
40
|
+
exports.DeleteMessagesInputSchema = zod_openapi_1.z.object({
|
|
41
|
+
messageIds: zod_openapi_1.z.array(zod_openapi_1.z.cuid2()),
|
|
42
|
+
deleteForEveryone: zod_openapi_1.z.boolean().default(false),
|
|
43
|
+
});
|
|
39
44
|
exports.MessageFileEntitySchema = zod_openapi_1.z.object({
|
|
40
45
|
id: zod_openapi_1.z.cuid2(),
|
|
41
46
|
messageId: zod_openapi_1.z.cuid2(),
|
package/dist/types/message.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
|
-
import { CreateMessageInputSchema, GetMessagesOutputSchema, MessageEntitySchema, MessageFileEntitySchema, MessageWithFilesEntitySchema } from "../schemas/message";
|
|
2
|
+
import { CreateMessageInputSchema, DeleteMessagesInputSchema, 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
|
+
export type DeleteMessagesInput = z.infer<typeof DeleteMessagesInputSchema>;
|
package/package.json
CHANGED
package/src/schemas/message.ts
CHANGED
|
@@ -35,11 +35,18 @@ export const MessageEntitySchema = z.object({
|
|
|
35
35
|
linkMeta: LinkMetaSchema.optional(),
|
|
36
36
|
createdAt: z.coerce.date(),
|
|
37
37
|
updatedAt: z.coerce.date().optional(),
|
|
38
|
-
deletedBySender: z.
|
|
39
|
-
deletedByReceiver: z.
|
|
38
|
+
deletedBySender: z.boolean().default(false),
|
|
39
|
+
deletedByReceiver: z.boolean().default(false),
|
|
40
|
+
isEdited: z.boolean().default(false),
|
|
40
41
|
deletedAt: z.coerce.date().optional(),
|
|
41
42
|
});
|
|
42
43
|
|
|
44
|
+
|
|
45
|
+
export const DeleteMessagesInputSchema = z.object({
|
|
46
|
+
messageIds: z.array(z.cuid2()),
|
|
47
|
+
deleteForEveryone: z.boolean().default(false),
|
|
48
|
+
});
|
|
49
|
+
|
|
43
50
|
export const MessageFileEntitySchema = z.object({
|
|
44
51
|
id: z.cuid2(),
|
|
45
52
|
messageId: z.cuid2(),
|
package/src/types/message.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
2
|
import {
|
|
3
3
|
CreateMessageInputSchema,
|
|
4
|
+
DeleteMessagesInputSchema,
|
|
4
5
|
GetMessagesOutputSchema,
|
|
5
6
|
MessageEntitySchema,
|
|
6
7
|
MessageFileEntitySchema,
|
|
@@ -18,3 +19,5 @@ export type MessageWithFilesEntity = z.infer<
|
|
|
18
19
|
export type CreateMessageInput = z.infer<typeof CreateMessageInputSchema>;
|
|
19
20
|
|
|
20
21
|
export type GetMessagesOutput = z.infer<typeof GetMessagesOutputSchema>;
|
|
22
|
+
|
|
23
|
+
export type DeleteMessagesInput = z.infer<typeof DeleteMessagesInputSchema>;
|