@zyacreatives/shared 2.2.68 → 2.2.69
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,14 @@ 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
51
|
deletedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
52
52
|
}, z.core.$strip>;
|
|
53
|
+
export declare const DeleteMessagesInputSchema: z.ZodObject<{
|
|
54
|
+
messageIds: z.ZodArray<z.ZodCUID2>;
|
|
55
|
+
deleteForEveryone: z.ZodDefault<z.ZodBoolean>;
|
|
56
|
+
}, z.core.$strip>;
|
|
53
57
|
export declare const MessageFileEntitySchema: z.ZodObject<{
|
|
54
58
|
id: z.ZodCUID2;
|
|
55
59
|
messageId: z.ZodCUID2;
|
|
@@ -98,8 +102,8 @@ export declare const MessageWithFilesEntitySchema: z.ZodObject<{
|
|
|
98
102
|
}, z.core.$strip>>;
|
|
99
103
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
100
104
|
updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
101
|
-
deletedBySender: z.
|
|
102
|
-
deletedByReceiver: z.
|
|
105
|
+
deletedBySender: z.ZodDefault<z.ZodBoolean>;
|
|
106
|
+
deletedByReceiver: z.ZodDefault<z.ZodBoolean>;
|
|
103
107
|
deletedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
104
108
|
messageFiles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
105
109
|
id: z.ZodCUID2;
|
|
@@ -180,8 +184,8 @@ export declare const GetMessagesOutputSchema: z.ZodObject<{
|
|
|
180
184
|
}, z.core.$strip>>;
|
|
181
185
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
182
186
|
updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
183
|
-
deletedBySender: z.
|
|
184
|
-
deletedByReceiver: z.
|
|
187
|
+
deletedBySender: z.ZodDefault<z.ZodBoolean>;
|
|
188
|
+
deletedByReceiver: z.ZodDefault<z.ZodBoolean>;
|
|
185
189
|
deletedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
186
190
|
messageFiles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
187
191
|
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,14 @@ 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
37
|
deletedAt: zod_openapi_1.z.coerce.date().optional(),
|
|
38
38
|
});
|
|
39
|
+
exports.DeleteMessagesInputSchema = zod_openapi_1.z.object({
|
|
40
|
+
messageIds: zod_openapi_1.z.array(zod_openapi_1.z.cuid2()),
|
|
41
|
+
deleteForEveryone: zod_openapi_1.z.boolean().default(false),
|
|
42
|
+
});
|
|
39
43
|
exports.MessageFileEntitySchema = zod_openapi_1.z.object({
|
|
40
44
|
id: zod_openapi_1.z.cuid2(),
|
|
41
45
|
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,17 @@ 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
40
|
deletedAt: z.coerce.date().optional(),
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
+
|
|
44
|
+
export const DeleteMessagesInputSchema = z.object({
|
|
45
|
+
messageIds: z.array(z.cuid2()),
|
|
46
|
+
deleteForEveryone: z.boolean().default(false),
|
|
47
|
+
});
|
|
48
|
+
|
|
43
49
|
export const MessageFileEntitySchema = z.object({
|
|
44
50
|
id: z.cuid2(),
|
|
45
51
|
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>;
|