@lyxa.ai/core 1.2.53 → 1.2.55
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.
- package/dist/libraries/mongo/models/message.model.d.ts +1 -1
- package/dist/libraries/mongo/models/message.model.js +3 -3
- package/dist/libraries/mongo/models/message.model.js.map +1 -1
- package/dist/libraries/socket/core/socket-event-registry.map.d.ts +16 -16
- package/dist/libraries/socket/events/chatroom-message-send.socket.event.d.ts +32 -32
- package/dist/libraries/socket/events/chatroom-message-send.socket.event.js +3 -3
- package/dist/libraries/socket/events/chatroom-message-send.socket.event.js.map +1 -1
- package/dist/types/README.md +1 -1
- package/dist/types/package.json +1 -1
- package/package.json +1 -1
|
@@ -48,7 +48,7 @@ let Message = class Message extends defaultClasses_1.TimeStamps {
|
|
|
48
48
|
senderType;
|
|
49
49
|
media;
|
|
50
50
|
sender;
|
|
51
|
-
|
|
51
|
+
location;
|
|
52
52
|
isDelivered;
|
|
53
53
|
deliveredAt;
|
|
54
54
|
};
|
|
@@ -81,9 +81,9 @@ __decorate([
|
|
|
81
81
|
__metadata("design:type", Object)
|
|
82
82
|
], Message.prototype, "sender", void 0);
|
|
83
83
|
__decorate([
|
|
84
|
-
(0, typegoose_1.prop)({ required:
|
|
84
|
+
(0, typegoose_1.prop)({ required: false, type: () => [Number] }),
|
|
85
85
|
__metadata("design:type", Array)
|
|
86
|
-
], Message.prototype, "
|
|
86
|
+
], Message.prototype, "location", void 0);
|
|
87
87
|
__decorate([
|
|
88
88
|
(0, typegoose_1.prop)({ type: Boolean, default: false }),
|
|
89
89
|
__metadata("design:type", Boolean)
|
|
@@ -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,KAAK;IAEV,QAAQ,CAAU;IA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AAC;kBA9Bd,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,CA+BnB","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({ required: false, type: () => [Number] })\n\tpublic location?: [number, number]; // [longitude, latitude]\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isDelivered?: boolean;\n\n\t@prop({ type: Date })\n\tpublic deliveredAt?: Date;\n}\n"]}
|
|
@@ -50,23 +50,19 @@ export declare const REGISTRY: {
|
|
|
50
50
|
name?: string | undefined;
|
|
51
51
|
thumbnailUrl?: string | undefined;
|
|
52
52
|
}>, "many">;
|
|
53
|
-
location: import("zod").ZodObject<{
|
|
54
|
-
longitude: import("zod").ZodNumber
|
|
55
|
-
latitude: import("zod").ZodNumber
|
|
53
|
+
location: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
54
|
+
longitude: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
55
|
+
latitude: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
56
56
|
}, "strip", import("zod").ZodTypeAny, {
|
|
57
|
-
latitude
|
|
58
|
-
longitude
|
|
57
|
+
latitude?: number | undefined;
|
|
58
|
+
longitude?: number | undefined;
|
|
59
59
|
}, {
|
|
60
|
-
latitude
|
|
61
|
-
longitude
|
|
62
|
-
}
|
|
60
|
+
latitude?: number | undefined;
|
|
61
|
+
longitude?: number | undefined;
|
|
62
|
+
}>>;
|
|
63
63
|
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>>;
|
|
64
64
|
createdAt: import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodDate, Date, Date>, Date, Date>;
|
|
65
65
|
}, "strip", import("zod").ZodTypeAny, {
|
|
66
|
-
location: {
|
|
67
|
-
latitude: number;
|
|
68
|
-
longitude: number;
|
|
69
|
-
};
|
|
70
66
|
media: {
|
|
71
67
|
mediaType: import("../../../utilities/enum").MediaType;
|
|
72
68
|
mediaUrl: string;
|
|
@@ -82,13 +78,13 @@ export declare const REGISTRY: {
|
|
|
82
78
|
};
|
|
83
79
|
senderType: import("../../../utilities/enum").UserRef;
|
|
84
80
|
senderId: import("mongoose").Types.ObjectId;
|
|
81
|
+
location?: {
|
|
82
|
+
latitude?: number | undefined;
|
|
83
|
+
longitude?: number | undefined;
|
|
84
|
+
} | undefined;
|
|
85
85
|
content?: string | undefined;
|
|
86
86
|
chatroomId?: import("mongoose").Types.ObjectId | undefined;
|
|
87
87
|
}, {
|
|
88
|
-
location: {
|
|
89
|
-
latitude: number;
|
|
90
|
-
longitude: number;
|
|
91
|
-
};
|
|
92
88
|
media: {
|
|
93
89
|
mediaType: import("../../../utilities/enum").MediaType;
|
|
94
90
|
mediaUrl: string;
|
|
@@ -104,6 +100,10 @@ export declare const REGISTRY: {
|
|
|
104
100
|
};
|
|
105
101
|
senderType: import("../../../utilities/enum").UserRef;
|
|
106
102
|
senderId: import("mongoose").Types.ObjectId;
|
|
103
|
+
location?: {
|
|
104
|
+
latitude?: number | undefined;
|
|
105
|
+
longitude?: number | undefined;
|
|
106
|
+
} | undefined;
|
|
107
107
|
content?: string | undefined;
|
|
108
108
|
chatroomId?: import("mongoose").Types.ObjectId | undefined;
|
|
109
109
|
}>;
|
|
@@ -44,23 +44,19 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
|
|
|
44
44
|
name?: string | undefined;
|
|
45
45
|
thumbnailUrl?: string | undefined;
|
|
46
46
|
}>, "many">;
|
|
47
|
-
location: z.ZodObject<{
|
|
48
|
-
longitude: z.ZodNumber
|
|
49
|
-
latitude: z.ZodNumber
|
|
47
|
+
location: z.ZodOptional<z.ZodObject<{
|
|
48
|
+
longitude: z.ZodOptional<z.ZodNumber>;
|
|
49
|
+
latitude: z.ZodOptional<z.ZodNumber>;
|
|
50
50
|
}, "strip", z.ZodTypeAny, {
|
|
51
|
-
latitude
|
|
52
|
-
longitude
|
|
51
|
+
latitude?: number | undefined;
|
|
52
|
+
longitude?: number | undefined;
|
|
53
53
|
}, {
|
|
54
|
-
latitude
|
|
55
|
-
longitude
|
|
56
|
-
}
|
|
54
|
+
latitude?: number | undefined;
|
|
55
|
+
longitude?: number | undefined;
|
|
56
|
+
}>>;
|
|
57
57
|
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>>;
|
|
58
58
|
createdAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
|
|
59
59
|
}, "strip", z.ZodTypeAny, {
|
|
60
|
-
location: {
|
|
61
|
-
latitude: number;
|
|
62
|
-
longitude: number;
|
|
63
|
-
};
|
|
64
60
|
media: {
|
|
65
61
|
mediaType: MediaType;
|
|
66
62
|
mediaUrl: string;
|
|
@@ -76,13 +72,13 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
|
|
|
76
72
|
};
|
|
77
73
|
senderType: UserRef;
|
|
78
74
|
senderId: import("mongoose").Types.ObjectId;
|
|
75
|
+
location?: {
|
|
76
|
+
latitude?: number | undefined;
|
|
77
|
+
longitude?: number | undefined;
|
|
78
|
+
} | undefined;
|
|
79
79
|
content?: string | undefined;
|
|
80
80
|
chatroomId?: import("mongoose").Types.ObjectId | undefined;
|
|
81
81
|
}, {
|
|
82
|
-
location: {
|
|
83
|
-
latitude: number;
|
|
84
|
-
longitude: number;
|
|
85
|
-
};
|
|
86
82
|
media: {
|
|
87
83
|
mediaType: MediaType;
|
|
88
84
|
mediaUrl: string;
|
|
@@ -98,6 +94,10 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
|
|
|
98
94
|
};
|
|
99
95
|
senderType: UserRef;
|
|
100
96
|
senderId: import("mongoose").Types.ObjectId;
|
|
97
|
+
location?: {
|
|
98
|
+
latitude?: number | undefined;
|
|
99
|
+
longitude?: number | undefined;
|
|
100
|
+
} | undefined;
|
|
101
101
|
content?: string | undefined;
|
|
102
102
|
chatroomId?: import("mongoose").Types.ObjectId | undefined;
|
|
103
103
|
}>;
|
|
@@ -146,23 +146,19 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
|
|
|
146
146
|
name?: string | undefined;
|
|
147
147
|
thumbnailUrl?: string | undefined;
|
|
148
148
|
}>, "many">;
|
|
149
|
-
location: z.ZodObject<{
|
|
150
|
-
longitude: z.ZodNumber
|
|
151
|
-
latitude: z.ZodNumber
|
|
149
|
+
location: z.ZodOptional<z.ZodObject<{
|
|
150
|
+
longitude: z.ZodOptional<z.ZodNumber>;
|
|
151
|
+
latitude: z.ZodOptional<z.ZodNumber>;
|
|
152
152
|
}, "strip", z.ZodTypeAny, {
|
|
153
|
-
latitude
|
|
154
|
-
longitude
|
|
153
|
+
latitude?: number | undefined;
|
|
154
|
+
longitude?: number | undefined;
|
|
155
155
|
}, {
|
|
156
|
-
latitude
|
|
157
|
-
longitude
|
|
158
|
-
}
|
|
156
|
+
latitude?: number | undefined;
|
|
157
|
+
longitude?: number | undefined;
|
|
158
|
+
}>>;
|
|
159
159
|
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>>;
|
|
160
160
|
createdAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
|
|
161
161
|
}, "strip", z.ZodTypeAny, {
|
|
162
|
-
location: {
|
|
163
|
-
latitude: number;
|
|
164
|
-
longitude: number;
|
|
165
|
-
};
|
|
166
162
|
media: {
|
|
167
163
|
mediaType: MediaType;
|
|
168
164
|
mediaUrl: string;
|
|
@@ -178,13 +174,13 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
|
|
|
178
174
|
};
|
|
179
175
|
senderType: UserRef;
|
|
180
176
|
senderId: import("mongoose").Types.ObjectId;
|
|
177
|
+
location?: {
|
|
178
|
+
latitude?: number | undefined;
|
|
179
|
+
longitude?: number | undefined;
|
|
180
|
+
} | undefined;
|
|
181
181
|
content?: string | undefined;
|
|
182
182
|
chatroomId?: import("mongoose").Types.ObjectId | undefined;
|
|
183
183
|
}, {
|
|
184
|
-
location: {
|
|
185
|
-
latitude: number;
|
|
186
|
-
longitude: number;
|
|
187
|
-
};
|
|
188
184
|
media: {
|
|
189
185
|
mediaType: MediaType;
|
|
190
186
|
mediaUrl: string;
|
|
@@ -200,6 +196,10 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
|
|
|
200
196
|
};
|
|
201
197
|
senderType: UserRef;
|
|
202
198
|
senderId: import("mongoose").Types.ObjectId;
|
|
199
|
+
location?: {
|
|
200
|
+
latitude?: number | undefined;
|
|
201
|
+
longitude?: number | undefined;
|
|
202
|
+
} | undefined;
|
|
203
203
|
content?: string | undefined;
|
|
204
204
|
chatroomId?: import("mongoose").Types.ObjectId | undefined;
|
|
205
205
|
}>;
|
|
@@ -29,9 +29,9 @@ exports.ChatroomMessageSendOutputSchema = zod_1.default.object({
|
|
|
29
29
|
name: validation_1.ZodValidation.string('name').optional(),
|
|
30
30
|
})),
|
|
31
31
|
location: zod_1.default.object({
|
|
32
|
-
longitude: validation_1.ZodValidation.coerce.number('longitude'),
|
|
33
|
-
latitude: validation_1.ZodValidation.coerce.number('latitude'),
|
|
34
|
-
}),
|
|
32
|
+
longitude: validation_1.ZodValidation.coerce.number('longitude').optional(),
|
|
33
|
+
latitude: validation_1.ZodValidation.coerce.number('latitude').optional(),
|
|
34
|
+
}).optional(),
|
|
35
35
|
chatroomId: validation_1.ZodValidation.coerce.objectId('chatroomId').optional(),
|
|
36
36
|
createdAt: validation_1.ZodValidation.coerce.date(),
|
|
37
37
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatroom-message-send.socket.event.js","sourceRoot":"/","sources":["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C,QAAQ,EAAE;KAC7C,CAAC,CACF;IACD,QAAQ,EAAE,aAAC,CAAC,MAAM,CAAC;QAClB,SAAS,EAAE,0BAAa,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,QAAQ,EAAE;QAC9D,QAAQ,EAAE,0BAAa,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE;KAC5D,CAAC,CAAC,QAAQ,EAAE;IACb,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;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;;AAnBF,wEAoBC","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';\nimport { Chatroom } from '../../mongo/models';\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').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\tlocation: z.object({\n\t\tlongitude: ZodValidation.coerce.number('longitude').optional(),\n\t\tlatitude: ZodValidation.coerce.number('latitude').optional(),\n\t}).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\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"]}
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED