@lyxa.ai/core 1.3.18 → 1.3.20
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/shop.model.d.ts +1 -0
- package/dist/libraries/mongo/models/shop.model.js +5 -0
- package/dist/libraries/mongo/models/shop.model.js.map +1 -1
- package/dist/libraries/socket/events/chatroom-message-send.socket.event.d.ts +13 -1
- package/dist/libraries/socket/events/chatroom-message-send.socket.event.js +3 -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/package.json +1 -1
|
@@ -47,6 +47,7 @@ export declare class Shop extends TimeStamps {
|
|
|
47
47
|
isRiderNoteVisible?: boolean;
|
|
48
48
|
riderNote?: string;
|
|
49
49
|
defaultPreparationTime?: number;
|
|
50
|
+
averagePreparationTime?: number;
|
|
50
51
|
exchangeRate?: number;
|
|
51
52
|
bestSellerCategory?: BestSellerCategory;
|
|
52
53
|
favouritesCategory?: FavouritesCategory;
|
|
@@ -62,6 +62,7 @@ let Shop = class Shop extends defaultClasses_1.TimeStamps {
|
|
|
62
62
|
isRiderNoteVisible;
|
|
63
63
|
riderNote;
|
|
64
64
|
defaultPreparationTime;
|
|
65
|
+
averagePreparationTime;
|
|
65
66
|
exchangeRate;
|
|
66
67
|
bestSellerCategory;
|
|
67
68
|
favouritesCategory;
|
|
@@ -222,6 +223,10 @@ __decorate([
|
|
|
222
223
|
(0, typegoose_1.prop)({ type: Number, default: 10 }),
|
|
223
224
|
__metadata("design:type", Number)
|
|
224
225
|
], Shop.prototype, "defaultPreparationTime", void 0);
|
|
226
|
+
__decorate([
|
|
227
|
+
(0, typegoose_1.prop)({ type: Number, default: 0 }),
|
|
228
|
+
__metadata("design:type", Number)
|
|
229
|
+
], Shop.prototype, "averagePreparationTime", void 0);
|
|
225
230
|
__decorate([
|
|
226
231
|
(0, typegoose_1.prop)({ type: Number, default: 0 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AAE,OAAO,EAAE,KAAK,EAAE,CAAC;;wDACI;eAhJhC,IAAI;IAjBhB,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE;QACtC,OAAO,EAAE,EAAE,UAAU,EAAE,oBAAQ,CAAC,KAAK,EAAE;KACvC,CAAC;IACD,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IAC/F,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE,EAAE,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IACrG,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IACrF,IAAA,eAAG,EAAO,MAAM,EAAE,KAAK,WAAW,IAAI;QACtC,MAAM,8BAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEnC,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;IACD,IAAA,eAAG,EAAO,MAAM,EAAE,KAAK;QACvB,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,GAAG,MAAM,IAAA,yBAAU,EAAC,eAAY,EAAE,kBAAW,CAAC,IAAI,CAAC,CAAC;QAChE,CAAC;IACF,CAAC,CAAC;GACW,IAAI,CAiJhB","sourcesContent":["import { CounterModel } from '.';\nimport { Tag } from './tag.model';\nimport { Brand } from './brand.model';\nimport { Parent } from './parent.model';\nimport { Address } from './shared/address.model';\nimport { handleShopPreSave } from '../utilities/shop.hooks';\nimport { generateId } from '../../../utilities/id-generator';\nimport { ShopDocument } from './embedded/shop-document.model';\nimport { DeliveryInfo } from './embedded/delivery-info.model';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ShopSearchFields } from './embedded/shop-search-fields.model';\nimport { StartEndTime, WorkHourSetting } from './shared/work-hour.model';\nimport { modelOptions, prop, Ref, Severity, index, pre } from '@typegoose/typegoose';\nimport { CounterType, ItemType, ShopOnlineStatus, Status } from '../../../utilities/enum';\nimport { BestSellerCategory, FavouritesCategory } from './embedded/shop-default-category.model';\n\n@modelOptions({\n\tschemaOptions: { collection: 'shops' },\n\toptions: { allowMixed: Severity.ALLOW },\n})\n@index({ name: 1, itemType: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@index({ parent: 1, status: 1, isVisibleToUser: 1 }, { partialFilterExpression: { deletedAt: null } })\n@index({ status: 1, createdAt: -1 }, { partialFilterExpression: { deletedAt: null } })\n@pre<Shop>('save', async function (next) {\n\tawait handleShopPreSave.call(this);\n \n\tnext();\n})\n@pre<Shop>('save', async function () {\n\tif (this.isNew) {\n\t\tthis.shopId = await generateId(CounterModel, CounterType.SHOP);\n\t}\n})\nexport class Shop extends TimeStamps {\n\t@prop({ type: String, unique: true, index: true })\n\tpublic shopId: string;\n\n\t@prop({ required: true, type: String })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic ownerName!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic email!: string;\n\n\t@prop({ required: true, ref: () => Parent })\n\tpublic parent: Ref<Parent>;\n\n\t@prop({ required: true, type: String, enum: ItemType })\n\tpublic itemType!: ItemType;\n\n\t@prop({ required: true, type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status!: Status;\n\n\t@prop({ required: true, ref: () => Brand })\n\tpublic brand: Ref<Brand>;\n\n\t@prop({ type: Number, default: 1, min: 1, max: 4 })\n\tpublic priceRange?: number;\n\n\t@prop({ required: true, type: String })\n\tpublic phoneNumber!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic userPhoneNumber!: string;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic additionalPhoneNumbers?: string[];\n\n\t@prop({ type: String, maxlength: 100 })\n\tpublic bobContactName?: string;\n\n\t@prop({ type: String, maxlength: 15 })\n\tpublic bobContactPhoneNumber?: string;\n\n\t@prop({ required: true, type: Address })\n\tpublic address!: Address;\n\n\t@prop({ type: String })\n\tpublic logo?: string;\n\n\t@prop({ type: String })\n\tpublic banner?: string;\n\n\t@prop({ type: ShopDocument })\n\tpublic document?: ShopDocument;\n\n\t@prop({\n\t\ttype: String,\n\t\tenum: ShopOnlineStatus,\n\t\tdefault: ShopOnlineStatus.OFFLINE,\n\t})\n\tpublic onlineStatus?: ShopOnlineStatus;\n\n\t@prop({ type: WorkHourSetting })\n\tpublic workHourSetting?: WorkHourSetting;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic dietaries?: string[];\n\n\t@prop({ ref: () => Tag, default: [] })\n\tpublic tags?: Ref<Tag>[];\n\n\t@prop({ required: true, type: Boolean })\n\tpublic isBeirutAuthentic!: boolean;\n\n\t@prop({ required: true, type: Boolean })\n\tpublic isVisibleToUser!: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isShopDelivery?: boolean;\n\n\t@prop({ type: Number })\n\tpublic deliveryFee?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic minimumOrderAmount?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic orderCapacityEnabled?: boolean;\n\n\t@prop({ type: Number })\n\tpublic orderCapacity?: number;\n\n\t@prop({ type: () => [StartEndTime], default: [] })\n\tpublic shopActiveTimingsOfCurrentDate?: StartEndTime[];\n\n\t@prop({ type: DeliveryInfo })\n\tpublic deliveryInfo?: DeliveryInfo;\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n\n\t// Setting\n\t@prop({ type: Boolean, default: false })\n\tpublic allowSpecialInstructions?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isRiderNoteVisible?: boolean;\n\n\t@prop({ type: String })\n\tpublic riderNote?: string;\n\n\t@prop({ type: Number, default: 10 })\n\tpublic defaultPreparationTime?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic exchangeRate?: number;\n\n\t// Best seller category\n\t@prop({ type: BestSellerCategory })\n\tpublic bestSellerCategory?: BestSellerCategory;\n\n\t// Favourites category\n\t@prop({ type: FavouritesCategory })\n\tpublic favouritesCategory?: FavouritesCategory;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic avgRating?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic ordersCount?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic customersCount?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic vat_reg_number?: number;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic fcmTokens?: string[];\n\n\t@prop({ type: ShopSearchFields })\n\tpublic searchFields?: ShopSearchFields;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isMenuDietaryFilterEnabled?: boolean;\n}"]}
|
|
1
|
+
{"version":3,"file":"shop.model.js","sourceRoot":"/","sources":["libraries/mongo/models/shop.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wBAAiC;AACjC,2CAAkC;AAClC,+CAAsC;AACtC,iDAAwC;AACxC,0DAAiD;AACjD,wDAA4D;AAC5D,kEAA6D;AAC7D,wEAA8D;AAC9D,wEAA8D;AAC9D,4EAAqE;AACrE,kFAAuE;AACvE,8DAAyE;AACzE,oDAAqF;AACrF,kDAA0F;AAC1F,wFAAgG;AAmBzF,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,2BAAU;IAE5B,MAAM,CAAS;IAGf,IAAI,CAAU;IAGd,SAAS,CAAU;IAGnB,KAAK,CAAU;IAGf,MAAM,CAAc;IAGpB,QAAQ,CAAY;IAGpB,MAAM,CAAU;IAGhB,KAAK,CAAa;IAGlB,UAAU,CAAU;IAGpB,WAAW,CAAU;IAGrB,eAAe,CAA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SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IACrG,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IACrF,IAAA,eAAG,EAAO,MAAM,EAAE,KAAK,WAAW,IAAI;QACtC,MAAM,8BAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEnC,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;IACD,IAAA,eAAG,EAAO,MAAM,EAAE,KAAK;QACvB,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,GAAG,MAAM,IAAA,yBAAU,EAAC,eAAY,EAAE,kBAAW,CAAC,IAAI,CAAC,CAAC;QAChE,CAAC;IACF,CAAC,CAAC;GACW,IAAI,CAoJhB","sourcesContent":["import { CounterModel } from '.';\nimport { Tag } from './tag.model';\nimport { Brand } from './brand.model';\nimport { Parent } from './parent.model';\nimport { Address } from './shared/address.model';\nimport { handleShopPreSave } from '../utilities/shop.hooks';\nimport { generateId } from '../../../utilities/id-generator';\nimport { ShopDocument } from './embedded/shop-document.model';\nimport { DeliveryInfo } from './embedded/delivery-info.model';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ShopSearchFields } from './embedded/shop-search-fields.model';\nimport { StartEndTime, WorkHourSetting } from './shared/work-hour.model';\nimport { modelOptions, prop, Ref, Severity, index, pre } from '@typegoose/typegoose';\nimport { CounterType, ItemType, ShopOnlineStatus, Status } from '../../../utilities/enum';\nimport { BestSellerCategory, FavouritesCategory } from './embedded/shop-default-category.model';\n\n@modelOptions({\n\tschemaOptions: { collection: 'shops' },\n\toptions: { allowMixed: Severity.ALLOW },\n})\n@index({ name: 1, itemType: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@index({ parent: 1, status: 1, isVisibleToUser: 1 }, { partialFilterExpression: { deletedAt: null } })\n@index({ status: 1, createdAt: -1 }, { partialFilterExpression: { deletedAt: null } })\n@pre<Shop>('save', async function (next) {\n\tawait handleShopPreSave.call(this);\n \n\tnext();\n})\n@pre<Shop>('save', async function () {\n\tif (this.isNew) {\n\t\tthis.shopId = await generateId(CounterModel, CounterType.SHOP);\n\t}\n})\nexport class Shop extends TimeStamps {\n\t@prop({ type: String, unique: true, index: true })\n\tpublic shopId: string;\n\n\t@prop({ required: true, type: String })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic ownerName!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic email!: string;\n\n\t@prop({ required: true, ref: () => Parent })\n\tpublic parent: Ref<Parent>;\n\n\t@prop({ required: true, type: String, enum: ItemType })\n\tpublic itemType!: ItemType;\n\n\t@prop({ required: true, type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status!: Status;\n\n\t@prop({ required: true, ref: () => Brand })\n\tpublic brand: Ref<Brand>;\n\n\t@prop({ type: Number, default: 1, min: 1, max: 4 })\n\tpublic priceRange?: number;\n\n\t@prop({ required: true, type: String })\n\tpublic phoneNumber!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic userPhoneNumber!: string;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic additionalPhoneNumbers?: string[];\n\n\t@prop({ type: String, maxlength: 100 })\n\tpublic bobContactName?: string;\n\n\t@prop({ type: String, maxlength: 15 })\n\tpublic bobContactPhoneNumber?: string;\n\n\t@prop({ required: true, type: Address })\n\tpublic address!: Address;\n\n\t@prop({ type: String })\n\tpublic logo?: string;\n\n\t@prop({ type: String })\n\tpublic banner?: string;\n\n\t@prop({ type: ShopDocument })\n\tpublic document?: ShopDocument;\n\n\t@prop({\n\t\ttype: String,\n\t\tenum: ShopOnlineStatus,\n\t\tdefault: ShopOnlineStatus.OFFLINE,\n\t})\n\tpublic onlineStatus?: ShopOnlineStatus;\n\n\t@prop({ type: WorkHourSetting })\n\tpublic workHourSetting?: WorkHourSetting;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic dietaries?: string[];\n\n\t@prop({ ref: () => Tag, default: [] })\n\tpublic tags?: Ref<Tag>[];\n\n\t@prop({ required: true, type: Boolean })\n\tpublic isBeirutAuthentic!: boolean;\n\n\t@prop({ required: true, type: Boolean })\n\tpublic isVisibleToUser!: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isShopDelivery?: boolean;\n\n\t@prop({ type: Number })\n\tpublic deliveryFee?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic minimumOrderAmount?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic orderCapacityEnabled?: boolean;\n\n\t@prop({ type: Number })\n\tpublic orderCapacity?: number;\n\n\t@prop({ type: () => [StartEndTime], default: [] })\n\tpublic shopActiveTimingsOfCurrentDate?: StartEndTime[];\n\n\t@prop({ type: DeliveryInfo })\n\tpublic deliveryInfo?: DeliveryInfo;\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n\n\t// Setting\n\t@prop({ type: Boolean, default: false })\n\tpublic allowSpecialInstructions?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isRiderNoteVisible?: boolean;\n\n\t@prop({ type: String })\n\tpublic riderNote?: string;\n\n\t@prop({ type: Number, default: 10 })\n\tpublic defaultPreparationTime?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic averagePreparationTime?: number; // based on order prep time in mins\n\n\t@prop({ type: Number, default: 0 })\n\tpublic exchangeRate?: number;\n\n\t// Best seller category\n\t@prop({ type: BestSellerCategory })\n\tpublic bestSellerCategory?: BestSellerCategory;\n\n\t// Favourites category\n\t@prop({ type: FavouritesCategory })\n\tpublic favouritesCategory?: FavouritesCategory;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic avgRating?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic ordersCount?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic customersCount?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic vat_reg_number?: number;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic fcmTokens?: string[];\n\n\t@prop({ type: ShopSearchFields })\n\tpublic searchFields?: ShopSearchFields;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isMenuDietaryFilterEnabled?: boolean;\n}"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
|
-
import { MediaType, UserRef } from '../../../utilities/enum';
|
|
2
|
+
import { ChatroomType, MediaType, UserRef } from '../../../utilities/enum';
|
|
3
3
|
import { DTO } from '../../../utilities/validation';
|
|
4
4
|
import { BaseSocketEvent } from '../BaseSocketEvent';
|
|
5
5
|
import { NotificationSettings } from '../PushNotificationEvent';
|
|
@@ -12,6 +12,7 @@ export declare const ChatroomMessageSendSocketInputSchema: z.ZodObject<{
|
|
|
12
12
|
}>;
|
|
13
13
|
export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
|
|
14
14
|
_id: z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
|
|
15
|
+
chatroomType: z.ZodNativeEnum<typeof ChatroomType>;
|
|
15
16
|
senderId: z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
|
|
16
17
|
senderType: z.ZodNativeEnum<typeof UserRef>;
|
|
17
18
|
sender: z.ZodObject<{
|
|
@@ -71,6 +72,7 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
|
|
|
71
72
|
id: import("mongoose").Types.ObjectId;
|
|
72
73
|
};
|
|
73
74
|
senderType: UserRef;
|
|
75
|
+
chatroomType: ChatroomType;
|
|
74
76
|
senderId: import("mongoose").Types.ObjectId;
|
|
75
77
|
location?: {
|
|
76
78
|
latitude?: number | undefined;
|
|
@@ -93,6 +95,7 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
|
|
|
93
95
|
id: import("mongoose").Types.ObjectId;
|
|
94
96
|
};
|
|
95
97
|
senderType: UserRef;
|
|
98
|
+
chatroomType: ChatroomType;
|
|
96
99
|
senderId: import("mongoose").Types.ObjectId;
|
|
97
100
|
location?: {
|
|
98
101
|
latitude?: number | undefined;
|
|
@@ -104,10 +107,13 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
|
|
|
104
107
|
export declare const ChatroomMessageSendPushOutputSchema: z.ZodObject<{
|
|
105
108
|
lastMessage: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
106
109
|
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>>;
|
|
110
|
+
type: z.ZodNativeEnum<typeof ChatroomType>;
|
|
107
111
|
}, "strip", z.ZodTypeAny, {
|
|
112
|
+
type: ChatroomType;
|
|
108
113
|
lastMessage?: string | undefined;
|
|
109
114
|
chatroomId?: import("mongoose").Types.ObjectId | undefined;
|
|
110
115
|
}, {
|
|
116
|
+
type: ChatroomType;
|
|
111
117
|
lastMessage?: string | undefined;
|
|
112
118
|
chatroomId?: import("mongoose").Types.ObjectId | undefined;
|
|
113
119
|
}>;
|
|
@@ -125,6 +131,7 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
|
|
|
125
131
|
}>;
|
|
126
132
|
output: z.ZodObject<{
|
|
127
133
|
_id: z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
|
|
134
|
+
chatroomType: z.ZodNativeEnum<typeof ChatroomType>;
|
|
128
135
|
senderId: z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
|
|
129
136
|
senderType: z.ZodNativeEnum<typeof UserRef>;
|
|
130
137
|
sender: z.ZodObject<{
|
|
@@ -184,6 +191,7 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
|
|
|
184
191
|
id: import("mongoose").Types.ObjectId;
|
|
185
192
|
};
|
|
186
193
|
senderType: UserRef;
|
|
194
|
+
chatroomType: ChatroomType;
|
|
187
195
|
senderId: import("mongoose").Types.ObjectId;
|
|
188
196
|
location?: {
|
|
189
197
|
latitude?: number | undefined;
|
|
@@ -206,6 +214,7 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
|
|
|
206
214
|
id: import("mongoose").Types.ObjectId;
|
|
207
215
|
};
|
|
208
216
|
senderType: UserRef;
|
|
217
|
+
chatroomType: ChatroomType;
|
|
209
218
|
senderId: import("mongoose").Types.ObjectId;
|
|
210
219
|
location?: {
|
|
211
220
|
latitude?: number | undefined;
|
|
@@ -217,10 +226,13 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
|
|
|
217
226
|
pushNotificationOutput: z.ZodObject<{
|
|
218
227
|
lastMessage: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
219
228
|
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>>;
|
|
229
|
+
type: z.ZodNativeEnum<typeof ChatroomType>;
|
|
220
230
|
}, "strip", z.ZodTypeAny, {
|
|
231
|
+
type: ChatroomType;
|
|
221
232
|
lastMessage?: string | undefined;
|
|
222
233
|
chatroomId?: import("mongoose").Types.ObjectId | undefined;
|
|
223
234
|
}, {
|
|
235
|
+
type: ChatroomType;
|
|
224
236
|
lastMessage?: string | undefined;
|
|
225
237
|
chatroomId?: import("mongoose").Types.ObjectId | undefined;
|
|
226
238
|
}>;
|
|
@@ -13,6 +13,7 @@ exports.ChatroomMessageSendSocketInputSchema = zod_1.default.object({
|
|
|
13
13
|
});
|
|
14
14
|
exports.ChatroomMessageSendOutputSchema = zod_1.default.object({
|
|
15
15
|
_id: validation_1.ZodValidation.coerce.objectId('_id'),
|
|
16
|
+
chatroomType: validation_1.ZodValidation.enumType(enum_1.ChatroomType, 'chatroomType'),
|
|
16
17
|
senderId: validation_1.ZodValidation.coerce.objectId('senderId'),
|
|
17
18
|
senderType: validation_1.ZodValidation.enumType(enum_1.UserRef, 'senderType'),
|
|
18
19
|
sender: zod_1.default.object({
|
|
@@ -39,6 +40,7 @@ exports.ChatroomMessageSendOutputSchema = zod_1.default.object({
|
|
|
39
40
|
exports.ChatroomMessageSendPushOutputSchema = zod_1.default.object({
|
|
40
41
|
lastMessage: validation_1.ZodValidation.string('lastMessage').optional(),
|
|
41
42
|
chatroomId: validation_1.ZodValidation.coerce.objectId('chatroomId').optional(),
|
|
43
|
+
type: validation_1.ZodValidation.enumType(enum_1.ChatroomType, 'type'),
|
|
42
44
|
});
|
|
43
45
|
class ChatroomMessageSendSocketEvent extends BaseSocketEvent_1.BaseSocketEvent {
|
|
44
46
|
static schemas = {
|
|
@@ -57,6 +59,7 @@ class ChatroomMessageSendSocketEvent extends BaseSocketEvent_1.BaseSocketEvent {
|
|
|
57
59
|
const pushPayload = {
|
|
58
60
|
lastMessage: payload.content,
|
|
59
61
|
chatroomId: payload.chatroomId,
|
|
62
|
+
type: payload.chatroomType,
|
|
60
63
|
};
|
|
61
64
|
super(enum_1.SocketEventType.CHATROOM_MESSAGE_SEND, ChatroomMessageSendSocketEvent.schemas, payload, pushPayload);
|
|
62
65
|
}
|
|
@@ -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,
|
|
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;AAGxC,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,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,CAAC,CAAC,QAAQ,EAAE;IACnD,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;QAC7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AI,EAAE,OAAO,CAAC,YAAY;SAC1B,CAAC;QAEF,KAAK,CACJ,sBAAe,CAAC,qBAAqB,EACrC,8BAA8B,CAAC,OAAO,EACtC,OAAO,EACP,WAAW,CACX,CAAC;IACH,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,KAA2D;QAC5E,OAAO,KAAK,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;IACpC,CAAC;IAES,aAAa;QACtB,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,EAAE,IAAI,SAAS,CAAC;IACtD,CAAC;;AAxCF,wEAyCC","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';\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\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};\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\tsuper(\n\t\t\tSocketEventType.CHATROOM_MESSAGE_SEND,\n\t\t\tChatroomMessageSendSocketEvent.schemas,\n\t\t\tpayload,\n\t\t\tpushPayload\n\t\t);\n\t}\n\n\tstatic identifier(input: z.infer<typeof ChatroomMessageSendSocketInputSchema>): string {\n\t\treturn input.chatroomId.toString();\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