@zyacreatives/shared 2.2.67 → 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,8 +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.ZodDefault<z.ZodBoolean>;
50
+ deletedByReceiver: z.ZodDefault<z.ZodBoolean>;
49
51
  deletedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
50
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>;
51
57
  export declare const MessageFileEntitySchema: z.ZodObject<{
52
58
  id: z.ZodCUID2;
53
59
  messageId: z.ZodCUID2;
@@ -96,6 +102,8 @@ export declare const MessageWithFilesEntitySchema: z.ZodObject<{
96
102
  }, z.core.$strip>>;
97
103
  createdAt: z.ZodCoercedDate<unknown>;
98
104
  updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
105
+ deletedBySender: z.ZodDefault<z.ZodBoolean>;
106
+ deletedByReceiver: z.ZodDefault<z.ZodBoolean>;
99
107
  deletedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
100
108
  messageFiles: z.ZodDefault<z.ZodArray<z.ZodObject<{
101
109
  id: z.ZodCUID2;
@@ -176,6 +184,8 @@ export declare const GetMessagesOutputSchema: z.ZodObject<{
176
184
  }, z.core.$strip>>;
177
185
  createdAt: z.ZodCoercedDate<unknown>;
178
186
  updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
187
+ deletedBySender: z.ZodDefault<z.ZodBoolean>;
188
+ deletedByReceiver: z.ZodDefault<z.ZodBoolean>;
179
189
  deletedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
180
190
  messageFiles: z.ZodDefault<z.ZodArray<z.ZodObject<{
181
191
  id: z.ZodCUID2;
@@ -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,8 +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.boolean().default(false),
36
+ deletedByReceiver: zod_openapi_1.z.boolean().default(false),
35
37
  deletedAt: zod_openapi_1.z.coerce.date().optional(),
36
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
+ });
37
43
  exports.MessageFileEntitySchema = zod_openapi_1.z.object({
38
44
  id: zod_openapi_1.z.cuid2(),
39
45
  messageId: zod_openapi_1.z.cuid2(),
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "2.2.67",
3
+ "version": "2.2.69",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -35,9 +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.boolean().default(false),
39
+ deletedByReceiver: z.boolean().default(false),
38
40
  deletedAt: z.coerce.date().optional(),
39
41
  });
40
42
 
43
+
44
+ export const DeleteMessagesInputSchema = z.object({
45
+ messageIds: z.array(z.cuid2()),
46
+ deleteForEveryone: z.boolean().default(false),
47
+ });
48
+
41
49
  export const MessageFileEntitySchema = z.object({
42
50
  id: z.cuid2(),
43
51
  messageId: z.cuid2(),
@@ -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>;