@lyxa.ai/core 1.3.126 → 1.3.127
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/terms-and-conditions.model.d.ts +5 -5
- package/dist/libraries/mongo/models/terms-and-conditions.model.js +5 -5
- package/dist/libraries/mongo/models/terms-and-conditions.model.js.map +1 -1
- package/dist/libraries/socket/PushNotificationEvent.d.ts +1 -0
- package/dist/libraries/socket/PushNotificationEvent.js.map +1 -1
- package/dist/libraries/socket/events/chatroom-message-send.socket.event.d.ts +11 -0
- package/dist/libraries/socket/events/chatroom-message-send.socket.event.js +7 -0
- 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/dist/types/utilities/validation/common-validation.d.ts +12 -12
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
|
|
2
2
|
export declare class TermsAndConditions extends TimeStamps {
|
|
3
|
-
privacyMessage
|
|
4
|
-
userTermsAndConditions
|
|
5
|
-
shopTermsAndConditions
|
|
6
|
-
riderTermsAndConditions
|
|
7
|
-
lyxaPlusTermsAndConditions
|
|
3
|
+
privacyMessage?: string;
|
|
4
|
+
userTermsAndConditions?: string;
|
|
5
|
+
shopTermsAndConditions?: string;
|
|
6
|
+
riderTermsAndConditions?: string;
|
|
7
|
+
lyxaPlusTermsAndConditions?: string;
|
|
8
8
|
}
|
|
@@ -21,23 +21,23 @@ let TermsAndConditions = class TermsAndConditions extends defaultClasses_1.TimeS
|
|
|
21
21
|
};
|
|
22
22
|
exports.TermsAndConditions = TermsAndConditions;
|
|
23
23
|
__decorate([
|
|
24
|
-
(0, typegoose_1.prop)({ default: '' }),
|
|
24
|
+
(0, typegoose_1.prop)({ type: String, default: '' }),
|
|
25
25
|
__metadata("design:type", String)
|
|
26
26
|
], TermsAndConditions.prototype, "privacyMessage", void 0);
|
|
27
27
|
__decorate([
|
|
28
|
-
(0, typegoose_1.prop)({ default: '' }),
|
|
28
|
+
(0, typegoose_1.prop)({ type: String, default: '' }),
|
|
29
29
|
__metadata("design:type", String)
|
|
30
30
|
], TermsAndConditions.prototype, "userTermsAndConditions", void 0);
|
|
31
31
|
__decorate([
|
|
32
|
-
(0, typegoose_1.prop)({ default: '' }),
|
|
32
|
+
(0, typegoose_1.prop)({ type: String, default: '' }),
|
|
33
33
|
__metadata("design:type", String)
|
|
34
34
|
], TermsAndConditions.prototype, "shopTermsAndConditions", void 0);
|
|
35
35
|
__decorate([
|
|
36
|
-
(0, typegoose_1.prop)({ default: '' }),
|
|
36
|
+
(0, typegoose_1.prop)({ type: String, default: '' }),
|
|
37
37
|
__metadata("design:type", String)
|
|
38
38
|
], TermsAndConditions.prototype, "riderTermsAndConditions", void 0);
|
|
39
39
|
__decorate([
|
|
40
|
-
(0, typegoose_1.prop)({ default: '' }),
|
|
40
|
+
(0, typegoose_1.prop)({ type: String, default: '' }),
|
|
41
41
|
__metadata("design:type", String)
|
|
42
42
|
], TermsAndConditions.prototype, "lyxaPlusTermsAndConditions", void 0);
|
|
43
43
|
exports.TermsAndConditions = TermsAndConditions = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terms-and-conditions.model.js","sourceRoot":"/","sources":["libraries/mongo/models/terms-and-conditions.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA0D;AAC1D,4EAAqE;AAQ9D,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,2BAAU;IAE1C,cAAc,
|
|
1
|
+
{"version":3,"file":"terms-and-conditions.model.js","sourceRoot":"/","sources":["libraries/mongo/models/terms-and-conditions.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA0D;AAC1D,4EAAqE;AAQ9D,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,2BAAU;IAE1C,cAAc,CAAU;IAGxB,sBAAsB,CAAU;IAGhC,sBAAsB,CAAU;IAGhC,uBAAuB,CAAU;IAGjC,0BAA0B,CAAU;CAC3C,CAAA;AAfY,gDAAkB;AAEvB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;0DACL;AAGxB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;kEACG;AAGhC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;kEACG;AAGhC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;mEACI;AAGjC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;sEACO;6BAd/B,kBAAkB;IAN9B,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE;YACd,UAAU,EAAE,sBAAsB;YAClC,UAAU,EAAE,IAAI;SAChB;KACD,CAAC;GACW,kBAAkB,CAe9B","sourcesContent":["import { modelOptions, prop } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\n\n@modelOptions({\n\tschemaOptions: {\n\t\tcollection: 'terms-and-conditions',\n\t\ttimestamps: true,\n\t},\n})\nexport class TermsAndConditions extends TimeStamps {\n\t@prop({ type: String, default: '' })\n\tpublic privacyMessage?: string;\n\n\t@prop({ type: String, default: '' })\n\tpublic userTermsAndConditions?: string;\n\n\t@prop({ type: String, default: '' })\n\tpublic shopTermsAndConditions?: string;\n\n\t@prop({ type: String, default: '' })\n\tpublic riderTermsAndConditions?: string;\n\n\t@prop({ type: String, default: '' })\n\tpublic lyxaPlusTermsAndConditions?: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PushNotificationEvent.js","sourceRoot":"/","sources":["libraries/socket/PushNotificationEvent.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAA+C;AAE/C,2DAA6D;AAC7D,oDAAwD;
|
|
1
|
+
{"version":3,"file":"PushNotificationEvent.js","sourceRoot":"/","sources":["libraries/socket/PushNotificationEvent.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAA+C;AAE/C,2DAA6D;AAC7D,oDAAwD;AAkCjD,IAAM,qBAAqB,GAA3B,MAAM,qBAAmE,SAAQ,qBAEvF;IACA,YACC,SAAY,EACZ,IAA4B,EAC5B,UAAgC,EAChC,QAA8B;QAE9B,MAAM,OAAO,GAAG,IAAI,CAAC;QACrB,KAAK,CAAC,8BAAiB,CAAC,8BAA8B,EAAE;YACvD,SAAS;YACT,UAAU;YACV,OAAO;YACP,oBAAoB,EAAE,QAAQ;SACE,CAAC,CAAC;IACpC,CAAC;IAED,IAAI,IAAI;QACP,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;IAC/B,CAAC;IAED,IAAI,UAAU;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;IAChC,CAAC;IAED,UAAU;QACT,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;IAC7B,CAAC;CACD,CAAA;AA7BY,sDAAqB;gCAArB,qBAAqB;IALjC,IAAA,wBAAa,EAAC,mBAAmB,EAAE;QACnC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,iBAAiB,EAAE;QAC9C,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,sBAAsB,EAAE;QACpD,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE;KAChC,CAAC;;GACW,qBAAqB,CA6BjC","sourcesContent":["import { BaseEvent } from '../event/BaseEvent';\nimport { ClickType, SocketEventType } from '../../utilities/enum';\nimport { EventMetadata } from '../event/decorators/metadata';\nimport { PublishEventEnums } from '../event/EventEnums';\nimport { REGISTRY } from './core/socket-event-registry.map';\nimport { EntitySubscription } from './connections';\n\n// Extract payload types from the registry - use pushNotificationOutput when available, otherwise output\ntype SocketEventPayloads = {\n\t[K in SocketEventType]: (typeof REGISTRY)[K] extends { schemas: { pushNotificationOutput: any } }\n\t\t? import('zod').infer<(typeof REGISTRY)[K]['schemas']['pushNotificationOutput']>\n\t\t: (typeof REGISTRY)[K] extends { schemas: { output: any } }\n\t\t\t? import('zod').infer<(typeof REGISTRY)[K]['schemas']['output']>\n\t\t\t: any;\n};\n\nexport type NotificationSettings =\n\t| { isPushNotification: false }\n\t| {\n\t\t\tisPushNotification: true;\n\t\t\tisClickable: boolean;\n\t\t\tclickType: ClickType;\n\t\t\ttitle?: string | 'new ';\n\t };\n\nexport type PushNotificationEventData<T extends SocketEventType = SocketEventType> = {\n\teventName: T;\n\trecipients: EntitySubscription[];\n\tpayload: SocketEventPayloads[T];\n\tnotificationSettings: NotificationSettings;\n};\n\n@EventMetadata('notification.push', [\n\t{ name: 'eventName', type: 'SocketEventType' },\n\t{ name: 'recipients', type: 'EntitySubscription[]' },\n\t{ name: 'payload', type: 'any' },\n])\nexport class PushNotificationEvent<T extends SocketEventType = SocketEventType> extends BaseEvent<\n\tPushNotificationEventData<T>\n> {\n\tconstructor(\n\t\teventName: T,\n\t\tdata: SocketEventPayloads[T],\n\t\trecipients: EntitySubscription[],\n\t\tsettings: NotificationSettings\n\t) {\n\t\tconst payload = data;\n\t\tsuper(PublishEventEnums.SOCKET_PUSH_NOTIFICATION_EVENT, {\n\t\t\teventName,\n\t\t\trecipients,\n\t\t\tpayload,\n\t\t\tnotificationSettings: settings,\n\t\t} as PushNotificationEventData<T>);\n\t}\n\n\tget type(): T {\n\t\treturn this.payload.eventName;\n\t}\n\n\tget recipients(): EntitySubscription[] {\n\t\treturn this.payload.recipients;\n\t}\n\n\tgetPayload(): SocketEventPayloads[T] {\n\t\treturn this.payload.payload;\n\t}\n}\n"]}
|
|
@@ -17,11 +17,14 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
|
|
|
17
17
|
senderType: z.ZodNativeEnum<typeof UserRef>;
|
|
18
18
|
sender: z.ZodObject<{
|
|
19
19
|
id: z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
|
|
20
|
+
name: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
20
21
|
type: z.ZodNativeEnum<typeof UserRef>;
|
|
21
22
|
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
name: string;
|
|
22
24
|
type: UserRef;
|
|
23
25
|
id: import("mongoose").Types.ObjectId;
|
|
24
26
|
}, {
|
|
27
|
+
name: string;
|
|
25
28
|
type: UserRef;
|
|
26
29
|
id: import("mongoose").Types.ObjectId;
|
|
27
30
|
}>;
|
|
@@ -68,6 +71,7 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
|
|
|
68
71
|
_id: import("mongoose").Types.ObjectId;
|
|
69
72
|
createdAt: Date;
|
|
70
73
|
sender: {
|
|
74
|
+
name: string;
|
|
71
75
|
type: UserRef;
|
|
72
76
|
id: import("mongoose").Types.ObjectId;
|
|
73
77
|
};
|
|
@@ -91,6 +95,7 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
|
|
|
91
95
|
_id: import("mongoose").Types.ObjectId;
|
|
92
96
|
createdAt: Date;
|
|
93
97
|
sender: {
|
|
98
|
+
name: string;
|
|
94
99
|
type: UserRef;
|
|
95
100
|
id: import("mongoose").Types.ObjectId;
|
|
96
101
|
};
|
|
@@ -136,11 +141,14 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
|
|
|
136
141
|
senderType: z.ZodNativeEnum<typeof UserRef>;
|
|
137
142
|
sender: z.ZodObject<{
|
|
138
143
|
id: z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
|
|
144
|
+
name: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
139
145
|
type: z.ZodNativeEnum<typeof UserRef>;
|
|
140
146
|
}, "strip", z.ZodTypeAny, {
|
|
147
|
+
name: string;
|
|
141
148
|
type: UserRef;
|
|
142
149
|
id: import("mongoose").Types.ObjectId;
|
|
143
150
|
}, {
|
|
151
|
+
name: string;
|
|
144
152
|
type: UserRef;
|
|
145
153
|
id: import("mongoose").Types.ObjectId;
|
|
146
154
|
}>;
|
|
@@ -187,6 +195,7 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
|
|
|
187
195
|
_id: import("mongoose").Types.ObjectId;
|
|
188
196
|
createdAt: Date;
|
|
189
197
|
sender: {
|
|
198
|
+
name: string;
|
|
190
199
|
type: UserRef;
|
|
191
200
|
id: import("mongoose").Types.ObjectId;
|
|
192
201
|
};
|
|
@@ -210,6 +219,7 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
|
|
|
210
219
|
_id: import("mongoose").Types.ObjectId;
|
|
211
220
|
createdAt: Date;
|
|
212
221
|
sender: {
|
|
222
|
+
name: string;
|
|
213
223
|
type: UserRef;
|
|
214
224
|
id: import("mongoose").Types.ObjectId;
|
|
215
225
|
};
|
|
@@ -239,6 +249,7 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
|
|
|
239
249
|
};
|
|
240
250
|
get notificationSettings(): NotificationSettings | undefined;
|
|
241
251
|
constructor(payload: ChatroomMessageSendSocketOutputDTO);
|
|
252
|
+
private getTitle;
|
|
242
253
|
static identifier(input: z.infer<typeof ChatroomMessageSendSocketInputSchema>): string;
|
|
243
254
|
getPushNotificationPayload(): {
|
|
244
255
|
type: ChatroomType;
|
|
@@ -19,6 +19,7 @@ exports.ChatroomMessageSendOutputSchema = zod_1.default.object({
|
|
|
19
19
|
senderType: validation_1.ZodValidation.enumType(enum_1.UserRef, 'senderType'),
|
|
20
20
|
sender: zod_1.default.object({
|
|
21
21
|
id: validation_1.ZodValidation.coerce.objectId('sender.id'),
|
|
22
|
+
name: validation_1.ZodValidation.string('senderName'),
|
|
22
23
|
type: validation_1.ZodValidation.enumType(enum_1.UserRef, 'sender.type'),
|
|
23
24
|
}),
|
|
24
25
|
content: validation_1.ZodValidation.string('content').optional(),
|
|
@@ -54,6 +55,7 @@ class ChatroomMessageSendSocketEvent extends BaseSocketEvent_1.BaseSocketEvent {
|
|
|
54
55
|
isPushNotification: true,
|
|
55
56
|
isClickable: true,
|
|
56
57
|
clickType: enum_1.ClickType.CLICKABLE_MESSAGE,
|
|
58
|
+
title: this.getTitle(),
|
|
57
59
|
};
|
|
58
60
|
}
|
|
59
61
|
constructor(payload) {
|
|
@@ -69,6 +71,11 @@ class ChatroomMessageSendSocketEvent extends BaseSocketEvent_1.BaseSocketEvent {
|
|
|
69
71
|
});
|
|
70
72
|
super(enum_1.SocketEventType.CHATROOM_MESSAGE_SEND, ChatroomMessageSendSocketEvent.schemas, payload, pushPayload, socketNotificationEvent);
|
|
71
73
|
}
|
|
74
|
+
getTitle() {
|
|
75
|
+
return this.payload().senderType === enum_1.UserRef.RIDER
|
|
76
|
+
? this.payload().sender.name
|
|
77
|
+
: 'New message from support';
|
|
78
|
+
}
|
|
72
79
|
static identifier(input) {
|
|
73
80
|
return input.chatroomId.toString();
|
|
74
81
|
}
|
|
@@ -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,kDAAuG;AACvG,8DAA6E;AAC7E,wDAAqD;AAErD,kCAAuC;AAE1B,QAAA,oCAAoC,GAAG,aAAC,CAAC,MAAM,CAAC;IAC5D,UAAU,EAAE,qBAAQ;CACpB,CAAC,CAAC;AAEU,QAAA,+BAA+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EAAE;IACZ,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;AAEU,QAAA,mCAAmC,GAAG,aAAC,CAAC,MAAM,CAAC;IAC3D,WAAW,EAAE,0BAAa,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,QAAQ,EAAE;IAC3D,UAAU,EAAE,0BAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE;IAClE,IAAI,EAAE,0BAAa,CAAC,QAAQ,CAAC,mBAAY,EAAE,MAAM,CAAC;CAClD,CAAC,CAAC;AAOH,MAAa,8BAA+B,SAAQ,iCAInD;IACA,MAAM,CAAU,OAAO,GAAG;QACzB,KAAK,EAAE,4CAAoC;QAC3C,MAAM,EAAE,uCAA+B;QACvC,sBAAsB,EAAE,2CAAmC;KAC3D,CAAC;IAEF,IAAW,oBAAoB;QAC9B,OAAO;YACN,kBAAkB,EAAE,IAAI;YACxB,WAAW,EAAE,IAAI;YACjB,SAAS,EAAE,gBAAS,CAAC,iBAAiB;
|
|
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,kDAAuG;AACvG,8DAA6E;AAC7E,wDAAqD;AAErD,kCAAuC;AAE1B,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,YAAY,EAAE,0BAAa,CAAC,QAAQ,CAAC,mBAAY,EAAE,cAAc,CAAC;IAClE,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AE,CAAC,UAAU,KAAK,cAAO,CAAC,KAAK;YACjD,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,IAAI;YAC5B,CAAC,CAAC,0BAA0B,CAAC;IAC/B,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,KAA2D;QAC5E,OAAO,KAAK,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;IACpC,CAAC;IAEM,0BAA0B;QAChC,OAAO,IAAI,CAAC,oBAAoB,CAAC;IAClC,CAAC;IAES,aAAa;QACtB,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,EAAE,IAAI,SAAS,CAAC;IACtD,CAAC;;AA1DF,wEA2DC","sourcesContent":["import z from 'zod';\nimport { ChatroomType, ClickType, MediaType, SocketEventType, UserRef } from '../../../utilities/enum';\nimport { DTO, IdSchema, ZodValidation } from '../../../utilities/validation';\nimport { BaseSocketEvent } from '../BaseSocketEvent';\nimport { NotificationSettings } from '../PushNotificationEvent';\nimport { EventFactory } from '../core';\n\nexport const ChatroomMessageSendSocketInputSchema = z.object({\n\tchatroomId: IdSchema,\n});\n\nexport const ChatroomMessageSendOutputSchema = z.object({\n\t_id: ZodValidation.coerce.objectId('_id'),\n\tchatroomType: ZodValidation.enumType(ChatroomType, 'chatroomType'),\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\tname: ZodValidation.string('senderName'),\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\n\t\t.object({\n\t\t\tlongitude: ZodValidation.coerce.number('longitude').optional(),\n\t\t\tlatitude: ZodValidation.coerce.number('latitude').optional(),\n\t\t})\n\t\t.optional(),\n\tchatroomId: ZodValidation.coerce.objectId('chatroomId').optional(),\n\tcreatedAt: ZodValidation.coerce.date(),\n});\n\nexport const ChatroomMessageSendPushOutputSchema = z.object({\n\tlastMessage: ZodValidation.string('lastMessage').optional(),\n\tchatroomId: ZodValidation.coerce.objectId('chatroomId').optional(),\n\ttype: ZodValidation.enumType(ChatroomType, 'type'),\n});\n\nexport type ChatlistMessageSendPushOutputDTO = DTO<typeof ChatroomMessageSendPushOutputSchema>;\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\ttypeof ChatroomMessageSendPushOutputSchema\n> {\n\tstatic readonly schemas = {\n\t\tinput: ChatroomMessageSendSocketInputSchema,\n\t\toutput: ChatroomMessageSendOutputSchema,\n\t\tpushNotificationOutput: ChatroomMessageSendPushOutputSchema,\n\t};\n\n\tpublic get notificationSettings(): NotificationSettings | undefined {\n\t\treturn {\n\t\t\tisPushNotification: true,\n\t\t\tisClickable: true,\n\t\t\tclickType: ClickType.CLICKABLE_MESSAGE,\n\t\t\ttitle: this.getTitle(),\n\t\t};\n\t}\n\n\tconstructor(payload: ChatroomMessageSendSocketOutputDTO) {\n\t\tconst pushPayload: ChatlistMessageSendPushOutputDTO = {\n\t\t\tlastMessage: payload.content,\n\t\t\tchatroomId: payload.chatroomId,\n\t\t\ttype: payload.chatroomType,\n\t\t};\n\n\t\tconst socketNotificationEvent = EventFactory.createEvent(SocketEventType.NOTIFICATION, {\n\t\t\tmessage: 'New message!',\n\t\t\tnotificationType: SocketEventType.CHATROOM_MESSAGE_SEND,\n\t\t\t_id: payload._id,\n\t\t});\n\n\t\tsuper(\n\t\t\tSocketEventType.CHATROOM_MESSAGE_SEND,\n\t\t\tChatroomMessageSendSocketEvent.schemas,\n\t\t\tpayload,\n\t\t\tpushPayload,\n\t\t\tsocketNotificationEvent\n\t\t);\n\t}\n\n\tprivate getTitle(): string {\n\t\treturn this.payload().senderType === UserRef.RIDER\n\t\t\t? this.payload().sender.name\n\t\t\t: 'New message from support';\n\t}\n\n\tstatic identifier(input: z.infer<typeof ChatroomMessageSendSocketInputSchema>): string {\n\t\treturn input.chatroomId.toString();\n\t}\n\n\tpublic getPushNotificationPayload() {\n\t\treturn this.pushNotificationData;\n\t}\n\n\tprotected getIdentifier(): string {\n\t\treturn this.data.chatroomId?.toString() ?? 'default';\n\t}\n}\n"]}
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED
|
@@ -26,8 +26,8 @@ export declare const FilterSchema: z.ZodOptional<z.ZodObject<{
|
|
|
26
26
|
searchFields?: string[] | undefined;
|
|
27
27
|
} | undefined;
|
|
28
28
|
sort?: Record<string, 1 | -1> | undefined;
|
|
29
|
-
populate?: any;
|
|
30
29
|
select?: Record<string, 0 | 1> | undefined;
|
|
30
|
+
populate?: any;
|
|
31
31
|
query?: Record<string, any> | undefined;
|
|
32
32
|
}, {
|
|
33
33
|
search?: {
|
|
@@ -36,8 +36,8 @@ export declare const FilterSchema: z.ZodOptional<z.ZodObject<{
|
|
|
36
36
|
} | undefined;
|
|
37
37
|
sort?: Record<string, 1 | -1> | undefined;
|
|
38
38
|
size?: number | undefined;
|
|
39
|
-
populate?: any;
|
|
40
39
|
select?: Record<string, 0 | 1> | undefined;
|
|
40
|
+
populate?: any;
|
|
41
41
|
query?: Record<string, any> | undefined;
|
|
42
42
|
page?: number | undefined;
|
|
43
43
|
}>>;
|
|
@@ -733,12 +733,12 @@ export declare const GetByIdInputSchema: z.ZodObject<{
|
|
|
733
733
|
populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
|
|
734
734
|
}, "strip", z.ZodTypeAny, {
|
|
735
735
|
_id: import("mongoose").Types.ObjectId;
|
|
736
|
-
populate?: any;
|
|
737
736
|
select?: Record<string, 0 | 1> | undefined;
|
|
737
|
+
populate?: any;
|
|
738
738
|
}, {
|
|
739
739
|
_id: string | import("mongoose").Types.ObjectId;
|
|
740
|
-
populate?: any;
|
|
741
740
|
select?: Record<string, 0 | 1> | undefined;
|
|
741
|
+
populate?: any;
|
|
742
742
|
}>;
|
|
743
743
|
export type GetByIdInputDTO = DTO<typeof GetByIdInputSchema>;
|
|
744
744
|
export declare const GetProductByIdInputSchema: z.ZodObject<{
|
|
@@ -751,12 +751,12 @@ export declare const GetProductByIdInputSchema: z.ZodObject<{
|
|
|
751
751
|
_id: import("mongoose").Types.ObjectId;
|
|
752
752
|
withAttributeHiddenItems: boolean;
|
|
753
753
|
withAddonsHiddenItems: boolean;
|
|
754
|
-
populate?: any;
|
|
755
754
|
select?: Record<string, 0 | 1> | undefined;
|
|
755
|
+
populate?: any;
|
|
756
756
|
}, {
|
|
757
757
|
_id: string | import("mongoose").Types.ObjectId;
|
|
758
|
-
populate?: any;
|
|
759
758
|
select?: Record<string, 0 | 1> | undefined;
|
|
759
|
+
populate?: any;
|
|
760
760
|
withAttributeHiddenItems?: boolean | undefined;
|
|
761
761
|
withAddonsHiddenItems?: boolean | undefined;
|
|
762
762
|
}>;
|
|
@@ -768,13 +768,13 @@ export declare const GetOrderByIdInputSchema: z.ZodObject<{
|
|
|
768
768
|
userOrderCompletionScope: z.ZodOptional<z.ZodNativeEnum<typeof UserOrderCompletionScope>>;
|
|
769
769
|
}, "strip", z.ZodTypeAny, {
|
|
770
770
|
_id: import("mongoose").Types.ObjectId;
|
|
771
|
-
populate?: any;
|
|
772
771
|
select?: Record<string, 0 | 1> | undefined;
|
|
772
|
+
populate?: any;
|
|
773
773
|
userOrderCompletionScope?: UserOrderCompletionScope | undefined;
|
|
774
774
|
}, {
|
|
775
775
|
_id: string | import("mongoose").Types.ObjectId;
|
|
776
|
-
populate?: any;
|
|
777
776
|
select?: Record<string, 0 | 1> | undefined;
|
|
777
|
+
populate?: any;
|
|
778
778
|
userOrderCompletionScope?: UserOrderCompletionScope | undefined;
|
|
779
779
|
}>;
|
|
780
780
|
export type GetOrderByIdInputDTO = DTO<typeof GetOrderByIdInputSchema>;
|
|
@@ -782,11 +782,11 @@ export declare const GetByTokenInputSchema: z.ZodOptional<z.ZodObject<{
|
|
|
782
782
|
select: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>>>;
|
|
783
783
|
populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
|
|
784
784
|
}, "strip", z.ZodTypeAny, {
|
|
785
|
-
populate?: any;
|
|
786
785
|
select?: Record<string, 0 | 1> | undefined;
|
|
787
|
-
}, {
|
|
788
786
|
populate?: any;
|
|
787
|
+
}, {
|
|
789
788
|
select?: Record<string, 0 | 1> | undefined;
|
|
789
|
+
populate?: any;
|
|
790
790
|
}>>;
|
|
791
791
|
export type GetByTokenInputDTO = DTO<typeof GetByTokenInputSchema>;
|
|
792
792
|
export declare const GetOneQuerySchema: z.ZodObject<{
|
|
@@ -794,12 +794,12 @@ export declare const GetOneQuerySchema: z.ZodObject<{
|
|
|
794
794
|
select: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>>>;
|
|
795
795
|
populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
|
|
796
796
|
}, "strip", z.ZodTypeAny, {
|
|
797
|
-
populate?: any;
|
|
798
797
|
select?: Record<string, 0 | 1> | undefined;
|
|
798
|
+
populate?: any;
|
|
799
799
|
query?: Record<string, any> | undefined;
|
|
800
800
|
}, {
|
|
801
|
-
populate?: any;
|
|
802
801
|
select?: Record<string, 0 | 1> | undefined;
|
|
802
|
+
populate?: any;
|
|
803
803
|
query?: Record<string, any> | undefined;
|
|
804
804
|
}>;
|
|
805
805
|
export type GetOneQueryDTO = DTO<typeof GetOneQuerySchema>;
|