@lyxa.ai/core 1.1.64 → 1.1.66

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.
@@ -6,9 +6,10 @@ import { Shop } from './shop.model';
6
6
  import { MediaType, UserRef } from '../../../utilities/enum';
7
7
  import { Rider } from './rider.model';
8
8
  import { Chatroom } from './chat-room.model';
9
- export declare class Media extends TimeStamps {
10
- url: string;
9
+ export declare class Media {
10
+ mediaUrl: string;
11
11
  mediaType: MediaType;
12
+ mimeType: string;
12
13
  thumbnailUrl?: string;
13
14
  name?: string;
14
15
  }
@@ -14,9 +14,10 @@ const typegoose_1 = require("@typegoose/typegoose");
14
14
  const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
15
15
  const enum_1 = require("../../../utilities/enum");
16
16
  const chat_room_model_1 = require("./chat-room.model");
17
- class Media extends defaultClasses_1.TimeStamps {
18
- url;
17
+ class Media {
18
+ mediaUrl;
19
19
  mediaType;
20
+ mimeType;
20
21
  thumbnailUrl;
21
22
  name;
22
23
  }
@@ -24,11 +25,15 @@ exports.Media = Media;
24
25
  __decorate([
25
26
  (0, typegoose_1.prop)({ required: true }),
26
27
  __metadata("design:type", String)
27
- ], Media.prototype, "url", void 0);
28
+ ], Media.prototype, "mediaUrl", void 0);
28
29
  __decorate([
29
30
  (0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.MediaType }),
30
31
  __metadata("design:type", String)
31
32
  ], Media.prototype, "mediaType", void 0);
33
+ __decorate([
34
+ (0, typegoose_1.prop)({ required: true }),
35
+ __metadata("design:type", String)
36
+ ], Media.prototype, "mimeType", void 0);
32
37
  __decorate([
33
38
  (0, typegoose_1.prop)(),
34
39
  __metadata("design:type", String)
@@ -52,7 +57,7 @@ __decorate([
52
57
  __metadata("design:type", Object)
53
58
  ], Message.prototype, "chatroom", void 0);
54
59
  __decorate([
55
- (0, typegoose_1.prop)({ required: true, type: String }),
60
+ (0, typegoose_1.prop)({ type: String }),
56
61
  __metadata("design:type", String)
57
62
  ], Message.prototype, "content", void 0);
58
63
  __decorate([
@@ -60,7 +65,14 @@ __decorate([
60
65
  __metadata("design:type", String)
61
66
  ], Message.prototype, "senderType", void 0);
62
67
  __decorate([
63
- (0, typegoose_1.prop)({ type: () => [Media], default: [] }),
68
+ (0, typegoose_1.prop)({
69
+ type: () => [Media],
70
+ default: [],
71
+ validate: {
72
+ validator: (v) => v.length <= 4,
73
+ message: 'Maximum 4 media items per message',
74
+ },
75
+ }),
64
76
  __metadata("design:type", Array)
65
77
  ], Message.prototype, "media", void 0);
66
78
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"message.model.js","sourceRoot":"/","sources":["libraries/mongo/models/message.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsE;AACtE,4EAAqE;AAIrE,kDAA6D;AAE7D,uDAA6C;AAE7C,MAAa,KAAM,SAAQ,2BAAU;IAE7B,GAAG,CAAU;IAGb,SAAS,CAAY;IAGrB,YAAY,CAAU;IAGtB,IAAI,CAAU;CACrB;AAZD,sBAYC;AAVO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kCACL;AAGb;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAS,EAAE,CAAC;;wCAC5B;AAGrB;IADN,IAAA,gBAAI,GAAE;;2CACsB;AAGtB;IADN,IAAA,gBAAI,GAAE;;mCACc;AAWf,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,2BAAU;IAE/B,QAAQ,CAAiB;IAGzB,OAAO,CAAU;IAGjB,UAAU,CAAW;IAGrB,KAAK,CAAW;IAGhB,MAAM,CAAoC;IAG1C,WAAW,CAAW;IAGtB,WAAW,CAAQ;CAC1B,CAAA;AArBY,0BAAO;AAEZ;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,0BAAQ,EAAE,CAAC;;yCACd;AAGzB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;wCACf;AAGjB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,cAAO,EAAE,CAAC;;2CAC1B;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;sCACpB;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;;uCACiB;AAG1C;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;4CACX;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACA,IAAI;4CAAC;kBApBd,OAAO;IARnB,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE;YACd,UAAU,EAAE,UAAU;SACtB;KACD,CAAC;IACD,IAAA,iBAAK,EAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC;IACrC,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;IACnC,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;GACrB,OAAO,CAqBnB","sourcesContent":["import { index, modelOptions, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { User } from './user.model';\nimport { Admin } from './admin.model';\nimport { Shop } from './shop.model';\nimport { MediaType, UserRef } from '../../../utilities/enum';\nimport { Rider } from './rider.model';\nimport { Chatroom } from './chat-room.model';\n\nexport class Media extends TimeStamps {\n\t@prop({ required: true })\n\tpublic url!: string;\n\n\t@prop({ required: true, type: String, enum: MediaType })\n\tpublic mediaType: MediaType;\n\n\t@prop()\n\tpublic thumbnailUrl?: string;\n\n\t@prop()\n\tpublic name?: string;\n}\n\n@modelOptions({\n\tschemaOptions: {\n\t\tcollection: 'messages',\n\t},\n})\n@index({ chatroom: 1, createdAt: -1 })\n@index({ sender: 1, senderType: 1 })\n@index({ isRead: 1, chatroom: 1 })\nexport class Message extends TimeStamps {\n\t@prop({ required: true, ref: () => Chatroom })\n\tpublic chatroom!: Ref<Chatroom>;\n\n\t@prop({ required: true, type: String })\n\tpublic content?: string;\n\n\t@prop({ required: true, type: String, enum: UserRef })\n\tpublic senderType!: UserRef;\n\n\t@prop({ type: () => [Media], default: [] })\n\tpublic media!: Media[];\n\n\t@prop({ refPath: 'senderType' })\n\tpublic sender!: Ref<User | Admin | Shop | Rider>;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isDelivered?: boolean;\n\n\t@prop({ type: Date })\n\tpublic deliveredAt?: Date;\n}\n"]}
1
+ {"version":3,"file":"message.model.js","sourceRoot":"/","sources":["libraries/mongo/models/message.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsE;AACtE,4EAAqE;AAIrE,kDAA6D;AAE7D,uDAA6C;AAE7C,MAAa,KAAK;IAEV,QAAQ,CAAU;IAGlB,SAAS,CAAY;IAGrB,QAAQ,CAAS;IAGjB,YAAY,CAAU;IAGtB,IAAI,CAAU;CACrB;AAfD,sBAeC;AAbO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uCACA;AAGlB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAS,EAAE,CAAC;;wCAC5B;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uCACD;AAGjB;IADN,IAAA,gBAAI,GAAE;;2CACsB;AAGtB;IADN,IAAA,gBAAI,GAAE;;mCACc;AAWf,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,2BAAU;IAE/B,QAAQ,CAAiB;IAGzB,OAAO,CAAU;IAGjB,UAAU,CAAW;IAUrB,KAAK,CAAW;IAGhB,MAAM,CAAoC;IAG1C,WAAW,CAAW;IAGtB,WAAW,CAAQ;CAC1B,CAAA;AA5BY,0BAAO;AAEZ;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,0BAAQ,EAAE,CAAC;;yCACd;AAGzB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;wCACC;AAGjB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,cAAO,EAAE,CAAC;;2CAC1B;AAUrB;IARN,IAAA,gBAAI,EAAC;QACL,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC;QACnB,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE;YACT,SAAS,EAAE,CAAC,CAAU,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC;YACxC,OAAO,EAAE,mCAAmC;SAC5C;KACD,CAAC;;sCACqB;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;;uCACiB;AAG1C;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;4CACX;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACA,IAAI;4CAAC;kBA3Bd,OAAO;IARnB,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE;YACd,UAAU,EAAE,UAAU;SACtB;KACD,CAAC;IACD,IAAA,iBAAK,EAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC;IACrC,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;IACnC,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;GACrB,OAAO,CA4BnB","sourcesContent":["import { index, modelOptions, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { User } from './user.model';\nimport { Admin } from './admin.model';\nimport { Shop } from './shop.model';\nimport { MediaType, UserRef } from '../../../utilities/enum';\nimport { Rider } from './rider.model';\nimport { Chatroom } from './chat-room.model';\n\nexport class Media {\n\t@prop({ required: true })\n\tpublic mediaUrl!: string;\n\n\t@prop({ required: true, type: String, enum: MediaType })\n\tpublic mediaType: MediaType;\n\n\t@prop({ required: true })\n\tpublic mimeType: string;\n\n\t@prop()\n\tpublic thumbnailUrl?: string;\n\n\t@prop()\n\tpublic name?: string;\n}\n\n@modelOptions({\n\tschemaOptions: {\n\t\tcollection: 'messages',\n\t},\n})\n@index({ chatroom: 1, createdAt: -1 })\n@index({ sender: 1, senderType: 1 })\n@index({ isRead: 1, chatroom: 1 })\nexport class Message extends TimeStamps {\n\t@prop({ required: true, ref: () => Chatroom })\n\tpublic chatroom!: Ref<Chatroom>;\n\n\t@prop({ type: String })\n\tpublic content?: string;\n\n\t@prop({ required: true, type: String, enum: UserRef })\n\tpublic senderType!: UserRef;\n\n\t@prop({\n\t\ttype: () => [Media],\n\t\tdefault: [],\n\t\tvalidate: {\n\t\t\tvalidator: (v: Media[]) => v.length <= 4,\n\t\t\tmessage: 'Maximum 4 media items per message',\n\t\t},\n\t})\n\tpublic media!: Media[];\n\n\t@prop({ refPath: 'senderType' })\n\tpublic sender!: Ref<User | Admin | Shop | Rider>;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isDelivered?: boolean;\n\n\t@prop({ type: Date })\n\tpublic deliveredAt?: Date;\n}\n"]}
@@ -29,10 +29,35 @@ export declare const REGISTRY: {
29
29
  id: import("mongoose").Types.ObjectId;
30
30
  }>;
31
31
  content: import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodOptional<import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>>;
32
- imageUrl: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString | import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>, "many">>;
32
+ media: import("zod").ZodArray<import("zod").ZodObject<{
33
+ mimeType: import("zod").ZodString | import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>;
34
+ mediaType: import("zod").ZodNativeEnum<typeof import("../../../utilities/enum").MediaType>;
35
+ mediaUrl: import("zod").ZodString | import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>;
36
+ thumbnailUrl: import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodOptional<import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>>;
37
+ name: import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodOptional<import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>>;
38
+ }, "strip", import("zod").ZodTypeAny, {
39
+ mediaType: import("../../../utilities/enum").MediaType;
40
+ mediaUrl: string;
41
+ mimeType: string;
42
+ name?: string | undefined;
43
+ thumbnailUrl?: string | undefined;
44
+ }, {
45
+ mediaType: import("../../../utilities/enum").MediaType;
46
+ mediaUrl: string;
47
+ mimeType: string;
48
+ name?: string | undefined;
49
+ thumbnailUrl?: string | undefined;
50
+ }>, "many">;
33
51
  chatroomId: import("zod").ZodOptional<import("zod").ZodEffects<import("zod").ZodType<import("mongoose").Types.ObjectId, import("zod").ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>>;
34
52
  createdAt: import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodDate, Date, Date>, Date, Date>;
35
53
  }, "strip", import("zod").ZodTypeAny, {
54
+ media: {
55
+ mediaType: import("../../../utilities/enum").MediaType;
56
+ mediaUrl: string;
57
+ mimeType: string;
58
+ name?: string | undefined;
59
+ thumbnailUrl?: string | undefined;
60
+ }[];
36
61
  _id: import("mongoose").Types.ObjectId;
37
62
  createdAt: Date;
38
63
  sender: {
@@ -43,8 +68,14 @@ export declare const REGISTRY: {
43
68
  senderId: import("mongoose").Types.ObjectId;
44
69
  content?: string | undefined;
45
70
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
46
- imageUrl?: string[] | undefined;
47
71
  }, {
72
+ media: {
73
+ mediaType: import("../../../utilities/enum").MediaType;
74
+ mediaUrl: string;
75
+ mimeType: string;
76
+ name?: string | undefined;
77
+ thumbnailUrl?: string | undefined;
78
+ }[];
48
79
  _id: import("mongoose").Types.ObjectId;
49
80
  createdAt: Date;
50
81
  sender: {
@@ -55,7 +86,6 @@ export declare const REGISTRY: {
55
86
  senderId: import("mongoose").Types.ObjectId;
56
87
  content?: string | undefined;
57
88
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
58
- imageUrl?: string[] | undefined;
59
89
  }>;
60
90
  };
61
91
  readonly identifier: typeof ChatroomMessageSendSocketEvent.identifier;
@@ -76,8 +106,22 @@ export declare const REGISTRY: {
76
106
  content: string;
77
107
  createdAt: Date;
78
108
  }>;
109
+ media: import("zod").ZodArray<import("zod").ZodObject<{
110
+ mimeType: import("zod").ZodString | import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>;
111
+ mediaType: import("zod").ZodNativeEnum<typeof import("../../../utilities/enum").MediaType>;
112
+ }, "strip", import("zod").ZodTypeAny, {
113
+ mediaType: import("../../../utilities/enum").MediaType;
114
+ mimeType: string;
115
+ }, {
116
+ mediaType: import("../../../utilities/enum").MediaType;
117
+ mimeType: string;
118
+ }>, "many">;
79
119
  unreadCount: import("zod").ZodNumber;
80
120
  }, "strip", import("zod").ZodTypeAny, {
121
+ media: {
122
+ mediaType: import("../../../utilities/enum").MediaType;
123
+ mimeType: string;
124
+ }[];
81
125
  lastMessage: {
82
126
  content: string;
83
127
  createdAt: Date;
@@ -85,6 +129,10 @@ export declare const REGISTRY: {
85
129
  unreadCount: number;
86
130
  chatroomId: import("mongoose").Types.ObjectId;
87
131
  }, {
132
+ media: {
133
+ mediaType: import("../../../utilities/enum").MediaType;
134
+ mimeType: string;
135
+ }[];
88
136
  lastMessage: {
89
137
  content: string;
90
138
  createdAt: Date;
@@ -1,4 +1,5 @@
1
1
  import z from 'zod';
2
+ import { MediaType } from '../../../utilities/enum';
2
3
  import { DTO } from '../../../utilities/validation';
3
4
  import { BaseSocketEvent } from '../BaseSocketEvent';
4
5
  export declare const ChatlistMessageSendSocketInputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
@@ -14,8 +15,22 @@ export declare const ChatlistMessageSendSocketOutputSchema: z.ZodObject<{
14
15
  content: string;
15
16
  createdAt: Date;
16
17
  }>;
18
+ media: z.ZodArray<z.ZodObject<{
19
+ mimeType: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
20
+ mediaType: z.ZodNativeEnum<typeof MediaType>;
21
+ }, "strip", z.ZodTypeAny, {
22
+ mediaType: MediaType;
23
+ mimeType: string;
24
+ }, {
25
+ mediaType: MediaType;
26
+ mimeType: string;
27
+ }>, "many">;
17
28
  unreadCount: z.ZodNumber;
18
29
  }, "strip", z.ZodTypeAny, {
30
+ media: {
31
+ mediaType: MediaType;
32
+ mimeType: string;
33
+ }[];
19
34
  lastMessage: {
20
35
  content: string;
21
36
  createdAt: Date;
@@ -23,6 +38,10 @@ export declare const ChatlistMessageSendSocketOutputSchema: z.ZodObject<{
23
38
  unreadCount: number;
24
39
  chatroomId: import("mongoose").Types.ObjectId;
25
40
  }, {
41
+ media: {
42
+ mediaType: MediaType;
43
+ mimeType: string;
44
+ }[];
26
45
  lastMessage: {
27
46
  content: string;
28
47
  createdAt: Date;
@@ -46,8 +65,22 @@ export declare class ChatlistMessageSendSocketEvent extends BaseSocketEvent<type
46
65
  content: string;
47
66
  createdAt: Date;
48
67
  }>;
68
+ media: z.ZodArray<z.ZodObject<{
69
+ mimeType: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
70
+ mediaType: z.ZodNativeEnum<typeof MediaType>;
71
+ }, "strip", z.ZodTypeAny, {
72
+ mediaType: MediaType;
73
+ mimeType: string;
74
+ }, {
75
+ mediaType: MediaType;
76
+ mimeType: string;
77
+ }>, "many">;
49
78
  unreadCount: z.ZodNumber;
50
79
  }, "strip", z.ZodTypeAny, {
80
+ media: {
81
+ mediaType: MediaType;
82
+ mimeType: string;
83
+ }[];
51
84
  lastMessage: {
52
85
  content: string;
53
86
  createdAt: Date;
@@ -55,6 +88,10 @@ export declare class ChatlistMessageSendSocketEvent extends BaseSocketEvent<type
55
88
  unreadCount: number;
56
89
  chatroomId: import("mongoose").Types.ObjectId;
57
90
  }, {
91
+ media: {
92
+ mediaType: MediaType;
93
+ mimeType: string;
94
+ }[];
58
95
  lastMessage: {
59
96
  content: string;
60
97
  createdAt: Date;
@@ -15,6 +15,10 @@ exports.ChatlistMessageSendSocketOutputSchema = zod_1.default.object({
15
15
  content: validation_1.ZodValidation.string(),
16
16
  createdAt: validation_1.ZodValidation.coerce.date(),
17
17
  }),
18
+ media: zod_1.default.array(zod_1.default.object({
19
+ mimeType: validation_1.ZodValidation.string('mimeType'),
20
+ mediaType: validation_1.ZodValidation.enumType(enum_1.MediaType, 'mediaType'),
21
+ })),
18
22
  unreadCount: validation_1.ZodValidation.number(),
19
23
  });
20
24
  class ChatlistMessageSendSocketEvent extends BaseSocketEvent_1.BaseSocketEvent {
@@ -1 +1 @@
1
- {"version":3,"file":"chatlist-message-send.socket.event.js","sourceRoot":"/","sources":["libraries/socket/events/chatlist-message-send.socket.event.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAoB;AACpB,kDAAqF;AACrF,8DAAmE;AACnE,wDAAqD;AAExC,QAAA,oCAAoC,GAAG,aAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AACpD,QAAA,qCAAqC,GAAG,aAAC,CAAC,MAAM,CAAC;IAC7D,UAAU,EAAE,0BAAa,CAAC,MAAM,CAAC,QAAQ,EAAE;IAC3C,WAAW,EAAE,aAAC,CAAC,MAAM,CAAC;QACrB,OAAO,EAAE,0BAAa,CAAC,MAAM,EAAE;QAC/B,SAAS,EAAE,0BAAa,CAAC,MAAM,CAAC,IAAI,EAAE;KACtC,CAAC;IACF,WAAW,EAAE,0BAAa,CAAC,MAAM,EAAE;CACnC,CAAC,CAAC;AAIH,MAAa,8BAA+B,SAAQ,iCAGnD;IACA,MAAM,CAAU,OAAO,GAAG;QACzB,KAAK,EAAE,4CAAoC;QAC3C,MAAM,EAAE,6CAAqC;KAC7C,CAAC;IAEF,YAAY,OAA2C;QACtD,KAAK,CAAC,sBAAe,CAAC,yBAAyB,EAAE,8BAA8B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACnG,CAAC;;AAXF,wEAYC","sourcesContent":["import z from 'zod';\nimport { PushNotificationEventType, SocketEventType } from '../../../utilities/enum';\nimport { DTO, ZodValidation } from '../../../utilities/validation';\nimport { BaseSocketEvent } from '../BaseSocketEvent';\n\nexport const ChatlistMessageSendSocketInputSchema = z.object({});\nexport const ChatlistMessageSendSocketOutputSchema = z.object({\n\tchatroomId: ZodValidation.coerce.objectId(),\n\tlastMessage: z.object({\n\t\tcontent: ZodValidation.string(),\n\t\tcreatedAt: ZodValidation.coerce.date(),\n\t}),\n\tunreadCount: ZodValidation.number(),\n});\n\nexport type ChatlistMessageSendSocketOutputDTO = DTO<typeof ChatlistMessageSendSocketOutputSchema>;\n\nexport class ChatlistMessageSendSocketEvent extends BaseSocketEvent<\n\ttypeof ChatlistMessageSendSocketInputSchema,\n\ttypeof ChatlistMessageSendSocketOutputSchema\n> {\n\tstatic readonly schemas = {\n\t\tinput: ChatlistMessageSendSocketInputSchema,\n\t\toutput: ChatlistMessageSendSocketOutputSchema,\n\t};\n\n\tconstructor(payload: ChatlistMessageSendSocketOutputDTO) {\n\t\tsuper(SocketEventType.CHATLIST_MESSAGE_RECEIVED, ChatlistMessageSendSocketEvent.schemas, payload);\n\t}\n}\n"]}
1
+ {"version":3,"file":"chatlist-message-send.socket.event.js","sourceRoot":"/","sources":["libraries/socket/events/chatlist-message-send.socket.event.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAoB;AACpB,kDAAqE;AACrE,8DAAmE;AACnE,wDAAqD;AAExC,QAAA,oCAAoC,GAAG,aAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AACpD,QAAA,qCAAqC,GAAG,aAAC,CAAC,MAAM,CAAC;IAC7D,UAAU,EAAE,0BAAa,CAAC,MAAM,CAAC,QAAQ,EAAE;IAC3C,WAAW,EAAE,aAAC,CAAC,MAAM,CAAC;QACrB,OAAO,EAAE,0BAAa,CAAC,MAAM,EAAE;QAC/B,SAAS,EAAE,0BAAa,CAAC,MAAM,CAAC,IAAI,EAAE;KACtC,CAAC;IACF,KAAK,EAAE,aAAC,CAAC,KAAK,CACb,aAAC,CAAC,MAAM,CAAC;QACR,QAAQ,EAAE,0BAAa,CAAC,MAAM,CAAC,UAAU,CAAC;QAC1C,SAAS,EAAE,0BAAa,CAAC,QAAQ,CAAC,gBAAS,EAAE,WAAW,CAAC;KACzD,CAAC,CACF;IACD,WAAW,EAAE,0BAAa,CAAC,MAAM,EAAE;CACnC,CAAC,CAAC;AAIH,MAAa,8BAA+B,SAAQ,iCAGnD;IACA,MAAM,CAAU,OAAO,GAAG;QACzB,KAAK,EAAE,4CAAoC;QAC3C,MAAM,EAAE,6CAAqC;KAC7C,CAAC;IAEF,YAAY,OAA2C;QACtD,KAAK,CAAC,sBAAe,CAAC,yBAAyB,EAAE,8BAA8B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACnG,CAAC;;AAXF,wEAYC","sourcesContent":["import z from 'zod';\nimport { MediaType, SocketEventType } from '../../../utilities/enum';\nimport { DTO, ZodValidation } from '../../../utilities/validation';\nimport { BaseSocketEvent } from '../BaseSocketEvent';\n\nexport const ChatlistMessageSendSocketInputSchema = z.object({});\nexport const ChatlistMessageSendSocketOutputSchema = z.object({\n\tchatroomId: ZodValidation.coerce.objectId(),\n\tlastMessage: z.object({\n\t\tcontent: ZodValidation.string(),\n\t\tcreatedAt: ZodValidation.coerce.date(),\n\t}),\n\tmedia: z.array(\n\t\tz.object({\n\t\t\tmimeType: ZodValidation.string('mimeType'),\n\t\t\tmediaType: ZodValidation.enumType(MediaType, 'mediaType'),\n\t\t})\n\t),\n\tunreadCount: ZodValidation.number(),\n});\n\nexport type ChatlistMessageSendSocketOutputDTO = DTO<typeof ChatlistMessageSendSocketOutputSchema>;\n\nexport class ChatlistMessageSendSocketEvent extends BaseSocketEvent<\n\ttypeof ChatlistMessageSendSocketInputSchema,\n\ttypeof ChatlistMessageSendSocketOutputSchema\n> {\n\tstatic readonly schemas = {\n\t\tinput: ChatlistMessageSendSocketInputSchema,\n\t\toutput: ChatlistMessageSendSocketOutputSchema,\n\t};\n\n\tconstructor(payload: ChatlistMessageSendSocketOutputDTO) {\n\t\tsuper(SocketEventType.CHATLIST_MESSAGE_RECEIVED, ChatlistMessageSendSocketEvent.schemas, payload);\n\t}\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import z from 'zod';
2
- import { UserRef } from '../../../utilities/enum';
2
+ import { MediaType, UserRef } from '../../../utilities/enum';
3
3
  import { DTO } from '../../../utilities/validation';
4
4
  import { BaseSocketEvent } from '../BaseSocketEvent';
5
5
  import { NotificationSocketEvent } from './notification.socket.event';
@@ -25,10 +25,35 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
25
25
  id: import("mongoose").Types.ObjectId;
26
26
  }>;
27
27
  content: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
28
- imageUrl: z.ZodOptional<z.ZodArray<z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">>;
28
+ media: z.ZodArray<z.ZodObject<{
29
+ mimeType: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
30
+ mediaType: z.ZodNativeEnum<typeof MediaType>;
31
+ mediaUrl: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
32
+ thumbnailUrl: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
33
+ name: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
34
+ }, "strip", z.ZodTypeAny, {
35
+ mediaType: MediaType;
36
+ mediaUrl: string;
37
+ mimeType: string;
38
+ name?: string | undefined;
39
+ thumbnailUrl?: string | undefined;
40
+ }, {
41
+ mediaType: MediaType;
42
+ mediaUrl: string;
43
+ mimeType: string;
44
+ name?: string | undefined;
45
+ thumbnailUrl?: string | undefined;
46
+ }>, "many">;
29
47
  chatroomId: z.ZodOptional<z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>>;
30
48
  createdAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
31
49
  }, "strip", z.ZodTypeAny, {
50
+ media: {
51
+ mediaType: MediaType;
52
+ mediaUrl: string;
53
+ mimeType: string;
54
+ name?: string | undefined;
55
+ thumbnailUrl?: string | undefined;
56
+ }[];
32
57
  _id: import("mongoose").Types.ObjectId;
33
58
  createdAt: Date;
34
59
  sender: {
@@ -39,8 +64,14 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
39
64
  senderId: import("mongoose").Types.ObjectId;
40
65
  content?: string | undefined;
41
66
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
42
- imageUrl?: string[] | undefined;
43
67
  }, {
68
+ media: {
69
+ mediaType: MediaType;
70
+ mediaUrl: string;
71
+ mimeType: string;
72
+ name?: string | undefined;
73
+ thumbnailUrl?: string | undefined;
74
+ }[];
44
75
  _id: import("mongoose").Types.ObjectId;
45
76
  createdAt: Date;
46
77
  sender: {
@@ -51,7 +82,6 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
51
82
  senderId: import("mongoose").Types.ObjectId;
52
83
  content?: string | undefined;
53
84
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
54
- imageUrl?: string[] | undefined;
55
85
  }>;
56
86
  export type ChatroomMessageSendSocketOutputDTO = DTO<typeof ChatroomMessageSendOutputSchema>;
57
87
  export type ChatroomMessageSendSocketInputDTO = DTO<typeof ChatroomMessageSendSocketInputSchema>;
@@ -79,10 +109,35 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
79
109
  id: import("mongoose").Types.ObjectId;
80
110
  }>;
81
111
  content: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
82
- imageUrl: z.ZodOptional<z.ZodArray<z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">>;
112
+ media: z.ZodArray<z.ZodObject<{
113
+ mimeType: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
114
+ mediaType: z.ZodNativeEnum<typeof MediaType>;
115
+ mediaUrl: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
116
+ thumbnailUrl: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
117
+ name: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
118
+ }, "strip", z.ZodTypeAny, {
119
+ mediaType: MediaType;
120
+ mediaUrl: string;
121
+ mimeType: string;
122
+ name?: string | undefined;
123
+ thumbnailUrl?: string | undefined;
124
+ }, {
125
+ mediaType: MediaType;
126
+ mediaUrl: string;
127
+ mimeType: string;
128
+ name?: string | undefined;
129
+ thumbnailUrl?: string | undefined;
130
+ }>, "many">;
83
131
  chatroomId: z.ZodOptional<z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>>;
84
132
  createdAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
85
133
  }, "strip", z.ZodTypeAny, {
134
+ media: {
135
+ mediaType: MediaType;
136
+ mediaUrl: string;
137
+ mimeType: string;
138
+ name?: string | undefined;
139
+ thumbnailUrl?: string | undefined;
140
+ }[];
86
141
  _id: import("mongoose").Types.ObjectId;
87
142
  createdAt: Date;
88
143
  sender: {
@@ -93,8 +148,14 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
93
148
  senderId: import("mongoose").Types.ObjectId;
94
149
  content?: string | undefined;
95
150
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
96
- imageUrl?: string[] | undefined;
97
151
  }, {
152
+ media: {
153
+ mediaType: MediaType;
154
+ mediaUrl: string;
155
+ mimeType: string;
156
+ name?: string | undefined;
157
+ thumbnailUrl?: string | undefined;
158
+ }[];
98
159
  _id: import("mongoose").Types.ObjectId;
99
160
  createdAt: Date;
100
161
  sender: {
@@ -105,7 +166,6 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
105
166
  senderId: import("mongoose").Types.ObjectId;
106
167
  content?: string | undefined;
107
168
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
108
- imageUrl?: string[] | undefined;
109
169
  }>;
110
170
  };
111
171
  notification(): NotificationSocketEvent | null;
@@ -21,7 +21,13 @@ exports.ChatroomMessageSendOutputSchema = zod_1.default.object({
21
21
  type: validation_1.ZodValidation.enumType(enum_1.UserRef, 'sender.type'),
22
22
  }),
23
23
  content: validation_1.ZodValidation.string('content', { minLength: 1, maxLength: 1000 }).optional(),
24
- imageUrl: zod_1.default.array(validation_1.ZodValidation.string('imageUrl')).optional(),
24
+ media: zod_1.default.array(zod_1.default.object({
25
+ mimeType: validation_1.ZodValidation.string('mimeType'),
26
+ mediaType: validation_1.ZodValidation.enumType(enum_1.MediaType, 'mediaType'),
27
+ mediaUrl: validation_1.ZodValidation.string('url'),
28
+ thumbnailUrl: validation_1.ZodValidation.string('thumbnailUrl').optional(),
29
+ name: validation_1.ZodValidation.string('name').optional(),
30
+ })),
25
31
  chatroomId: validation_1.ZodValidation.coerce.objectId('chatroomId').optional(),
26
32
  createdAt: validation_1.ZodValidation.coerce.date(),
27
33
  });
@@ -1 +1 @@
1
- {"version":3,"file":"chatroom-message-send.socket.event.js","sourceRoot":"/","sources":["libraries/socket/events/chatroom-message-send.socket.event.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAoB;AACpB,kDAAmE;AACnE,8DAA6E;AAC7E,wDAAqD;AACrD,2EAAsE;AAEzD,QAAA,oCAAoC,GAAG,aAAC,CAAC,MAAM,CAAC;IAC5D,UAAU,EAAE,qBAAQ;CACpB,CAAC,CAAC;AAEU,QAAA,+BAA+B,GAAG,aAAC,CAAC,MAAM,CAAC;IACvD,GAAG,EAAE,0BAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;IACzC,QAAQ,EAAE,0BAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC;IACnD,UAAU,EAAE,0BAAa,CAAC,QAAQ,CAAC,cAAO,EAAE,YAAY,CAAC;IACzD,MAAM,EAAE,aAAC,CAAC,MAAM,CAAC;QAChB,EAAE,EAAE,0BAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC;QAC9C,IAAI,EAAE,0BAAa,CAAC,QAAQ,CAAC,cAAO,EAAE,aAAa,CAAC;KACpD,CAAC;IACF,OAAO,EAAE,0BAAa,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE;IACtF,QAAQ,EAAE,aAAC,CAAC,KAAK,CAAC,0BAAa,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC9D,UAAU,EAAE,0BAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE;IAClE,SAAS,EAAE,0BAAa,CAAC,MAAM,CAAC,IAAI,EAAE;CACtC,CAAC,CAAC;AAKH,MAAa,8BAA+B,SAAQ,iCAGnD;IACA,MAAM,CAAU,OAAO,GAAG;QACzB,KAAK,EAAE,4CAAoC;QAC3C,MAAM,EAAE,uCAA+B;KACvC,CAAC;IAEK,YAAY;QAClB,OAAO,IAAI,mDAAuB,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,CAAC;IAChE,CAAC;IAEM,gBAAgB;QACtB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,YAAY,OAA2C;QACtD,KAAK,CAAC,sBAAe,CAAC,qBAAqB,EAAE,8BAA8B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC/F,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,KAA2D;QAC5E,OAAO,KAAK,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;IACpC,CAAC;;AAvBF,wEAwBC","sourcesContent":["import z from 'zod';\nimport { SocketEventType, UserRef } from '../../../utilities/enum';\nimport { DTO, IdSchema, ZodValidation } from '../../../utilities/validation';\nimport { BaseSocketEvent } from '../BaseSocketEvent';\nimport { NotificationSocketEvent } from './notification.socket.event';\n\nexport const ChatroomMessageSendSocketInputSchema = z.object({\n\tchatroomId: IdSchema,\n});\n\nexport const ChatroomMessageSendOutputSchema = z.object({\n\t_id: ZodValidation.coerce.objectId('_id'),\n\tsenderId: ZodValidation.coerce.objectId('senderId'), // DEPRECATED\n\tsenderType: ZodValidation.enumType(UserRef, 'senderType'), // DEPRECATED\n\tsender: z.object({\n\t\tid: ZodValidation.coerce.objectId('sender.id'),\n\t\ttype: ZodValidation.enumType(UserRef, 'sender.type'),\n\t}),\n\tcontent: ZodValidation.string('content', { minLength: 1, maxLength: 1000 }).optional(),\n\timageUrl: z.array(ZodValidation.string('imageUrl')).optional(),\n\tchatroomId: ZodValidation.coerce.objectId('chatroomId').optional(),\n\tcreatedAt: ZodValidation.coerce.date(),\n});\n\nexport type ChatroomMessageSendSocketOutputDTO = DTO<typeof ChatroomMessageSendOutputSchema>;\nexport type ChatroomMessageSendSocketInputDTO = DTO<typeof ChatroomMessageSendSocketInputSchema>;\n\nexport class ChatroomMessageSendSocketEvent extends BaseSocketEvent<\n\ttypeof ChatroomMessageSendSocketInputSchema,\n\ttypeof ChatroomMessageSendOutputSchema\n> {\n\tstatic readonly schemas = {\n\t\tinput: ChatroomMessageSendSocketInputSchema,\n\t\toutput: ChatroomMessageSendOutputSchema,\n\t};\n\n\tpublic notification(): NotificationSocketEvent | null {\n\t\treturn new NotificationSocketEvent({ message: `New message` });\n\t}\n\n\tpublic pushNotification(): NotificationSocketEvent | null {\n\t\treturn null;\n\t}\n\n\tconstructor(payload: ChatroomMessageSendSocketOutputDTO) {\n\t\tsuper(SocketEventType.CHATROOM_MESSAGE_SEND, ChatroomMessageSendSocketEvent.schemas, payload);\n\t}\n\n\tstatic identifier(input: z.infer<typeof ChatroomMessageSendSocketInputSchema>): string {\n\t\treturn input.chatroomId.toString();\n\t}\n}\n"]}
1
+ {"version":3,"file":"chatroom-message-send.socket.event.js","sourceRoot":"/","sources":["libraries/socket/events/chatroom-message-send.socket.event.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAoB;AACpB,kDAA8E;AAC9E,8DAA6E;AAC7E,wDAAqD;AACrD,2EAAsE;AAEzD,QAAA,oCAAoC,GAAG,aAAC,CAAC,MAAM,CAAC;IAC5D,UAAU,EAAE,qBAAQ;CACpB,CAAC,CAAC;AAEU,QAAA,+BAA+B,GAAG,aAAC,CAAC,MAAM,CAAC;IACvD,GAAG,EAAE,0BAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;IACzC,QAAQ,EAAE,0BAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC;IACnD,UAAU,EAAE,0BAAa,CAAC,QAAQ,CAAC,cAAO,EAAE,YAAY,CAAC;IACzD,MAAM,EAAE,aAAC,CAAC,MAAM,CAAC;QAChB,EAAE,EAAE,0BAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC;QAC9C,IAAI,EAAE,0BAAa,CAAC,QAAQ,CAAC,cAAO,EAAE,aAAa,CAAC;KACpD,CAAC;IACF,OAAO,EAAE,0BAAa,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE;IACtF,KAAK,EAAE,aAAC,CAAC,KAAK,CACb,aAAC,CAAC,MAAM,CAAC;QACR,QAAQ,EAAE,0BAAa,CAAC,MAAM,CAAC,UAAU,CAAC;QAC1C,SAAS,EAAE,0BAAa,CAAC,QAAQ,CAAC,gBAAS,EAAE,WAAW,CAAC;QACzD,QAAQ,EAAE,0BAAa,CAAC,MAAM,CAAC,KAAK,CAAC;QACrC,YAAY,EAAE,0BAAa,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE;QAC7D,IAAI,EAAE,0BAAa,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;KAC7C,CAAC,CACF;IACD,UAAU,EAAE,0BAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE;IAClE,SAAS,EAAE,0BAAa,CAAC,MAAM,CAAC,IAAI,EAAE;CACtC,CAAC,CAAC;AAKH,MAAa,8BAA+B,SAAQ,iCAGnD;IACA,MAAM,CAAU,OAAO,GAAG;QACzB,KAAK,EAAE,4CAAoC;QAC3C,MAAM,EAAE,uCAA+B;KACvC,CAAC;IAEK,YAAY;QAClB,OAAO,IAAI,mDAAuB,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,CAAC;IAChE,CAAC;IAEM,gBAAgB;QACtB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,YAAY,OAA2C;QACtD,KAAK,CAAC,sBAAe,CAAC,qBAAqB,EAAE,8BAA8B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC/F,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,KAA2D;QAC5E,OAAO,KAAK,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;IACpC,CAAC;;AAvBF,wEAwBC","sourcesContent":["import z from 'zod';\nimport { MediaType, SocketEventType, UserRef } from '../../../utilities/enum';\nimport { DTO, IdSchema, ZodValidation } from '../../../utilities/validation';\nimport { BaseSocketEvent } from '../BaseSocketEvent';\nimport { NotificationSocketEvent } from './notification.socket.event';\n\nexport const ChatroomMessageSendSocketInputSchema = z.object({\n\tchatroomId: IdSchema,\n});\n\nexport const ChatroomMessageSendOutputSchema = z.object({\n\t_id: ZodValidation.coerce.objectId('_id'),\n\tsenderId: ZodValidation.coerce.objectId('senderId'), // DEPRECATED\n\tsenderType: ZodValidation.enumType(UserRef, 'senderType'), // DEPRECATED\n\tsender: z.object({\n\t\tid: ZodValidation.coerce.objectId('sender.id'),\n\t\ttype: ZodValidation.enumType(UserRef, 'sender.type'),\n\t}),\n\tcontent: ZodValidation.string('content', { minLength: 1, maxLength: 1000 }).optional(),\n\tmedia: z.array(\n\t\tz.object({\n\t\t\tmimeType: ZodValidation.string('mimeType'),\n\t\t\tmediaType: ZodValidation.enumType(MediaType, 'mediaType'),\n\t\t\tmediaUrl: ZodValidation.string('url'),\n\t\t\tthumbnailUrl: ZodValidation.string('thumbnailUrl').optional(),\n\t\t\tname: ZodValidation.string('name').optional(),\n\t\t})\n\t),\n\tchatroomId: ZodValidation.coerce.objectId('chatroomId').optional(),\n\tcreatedAt: ZodValidation.coerce.date(),\n});\n\nexport type ChatroomMessageSendSocketOutputDTO = DTO<typeof ChatroomMessageSendOutputSchema>;\nexport type ChatroomMessageSendSocketInputDTO = DTO<typeof ChatroomMessageSendSocketInputSchema>;\n\nexport class ChatroomMessageSendSocketEvent extends BaseSocketEvent<\n\ttypeof ChatroomMessageSendSocketInputSchema,\n\ttypeof ChatroomMessageSendOutputSchema\n> {\n\tstatic readonly schemas = {\n\t\tinput: ChatroomMessageSendSocketInputSchema,\n\t\toutput: ChatroomMessageSendOutputSchema,\n\t};\n\n\tpublic notification(): NotificationSocketEvent | null {\n\t\treturn new NotificationSocketEvent({ message: `New message` });\n\t}\n\n\tpublic pushNotification(): NotificationSocketEvent | null {\n\t\treturn null;\n\t}\n\n\tconstructor(payload: ChatroomMessageSendSocketOutputDTO) {\n\t\tsuper(SocketEventType.CHATROOM_MESSAGE_SEND, ChatroomMessageSendSocketEvent.schemas, payload);\n\t}\n\n\tstatic identifier(input: z.infer<typeof ChatroomMessageSendSocketInputSchema>): string {\n\t\treturn input.chatroomId.toString();\n\t}\n}\n"]}
@@ -22,7 +22,7 @@ Perfect for sharing types between frontend and backend applications.
22
22
 
23
23
  ## Version
24
24
 
25
- Version: 1.1.64
25
+ Version: 1.1.66
26
26
 
27
27
  ## Dependencies
28
28
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/types",
3
- "version": "1.1.64",
3
+ "version": "1.1.66",
4
4
  "description": "Lyxa type definitions and validation schemas for both frontend and backend",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/core",
3
- "version": "1.1.64",
3
+ "version": "1.1.66",
4
4
  "description": "The Core system of the Lyxa services.",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",