@lyxa.ai/core 1.1.74 → 1.1.76
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/chat-room.model.d.ts +1 -1
- package/dist/libraries/mongo/models/chat-room.model.js.map +1 -1
- package/dist/libraries/mongo/models/rider.model.js +1 -1
- package/dist/libraries/mongo/models/rider.model.js.map +1 -1
- package/dist/libraries/mongo/models/user.model.d.ts +1 -1
- package/dist/libraries/socket/core/socket-event-registry.js.map +1 -1
- package/dist/libraries/socket/core/socket-event-registry.map.d.ts +17 -27
- package/dist/libraries/socket/core/socket-event-registry.map.js +5 -0
- package/dist/libraries/socket/core/socket-event-registry.map.js.map +1 -1
- package/dist/libraries/socket/events/chatlist-message-send.socket.event.d.ts +18 -55
- package/dist/libraries/socket/events/chatlist-message-send.socket.event.js +4 -6
- package/dist/libraries/socket/events/chatlist-message-send.socket.event.js.map +1 -1
- package/dist/libraries/socket/events/chatroom-message-send.socket.event.js +1 -1
- package/dist/libraries/socket/events/chatroom-message-send.socket.event.js.map +1 -1
- package/dist/libraries/socket/events/rider-connect.socket.event.d.ts +12 -0
- package/dist/libraries/socket/events/rider-connect.socket.event.js +19 -0
- package/dist/libraries/socket/events/rider-connect.socket.event.js.map +1 -0
- package/dist/types/README.md +1 -1
- package/dist/types/package.json +1 -1
- package/dist/types/utilities/enum.d.ts +2 -1
- package/dist/types/utilities/enum.js +1 -0
- package/dist/types/utilities/enum.js.map +1 -1
- package/dist/types/utilities/validation/common-validation.d.ts +78 -2
- package/dist/types/utilities/validation/global-validation.d.ts +38 -14
- package/dist/utilities/enum.d.ts +2 -1
- package/dist/utilities/enum.js +1 -0
- package/dist/utilities/enum.js.map +1 -1
- package/dist/utilities/validation/common-validation.d.ts +78 -2
- package/dist/utilities/validation/global-validation.d.ts +38 -14
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-room.model.js","sourceRoot":"/","sources":["libraries/mongo/models/chat-room.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsE;AACtE,4EAAqE;AACrE,8EAAoE;AACpE,kDAAgE;AAKhE,uCAAiC;AACjC,+CAAsC;AAEtC,MAAM,WAAY,SAAQ,2BAAU;IAE5B,GAAG,CAAkB;IAGrB,OAAO,CAAU;IAGjB,UAAU,CAAW;IAGrB,MAAM,CAAoC;CACjD;AAVO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,gBAAK,CAAC,QAAQ,EAAE,CAAC;8BAClB,gBAAK,CAAC,QAAQ;wCAAC;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4CACf;AAGjB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,cAAO,EAAE,CAAC;;+CAC1B;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;;2CACiB;AAe3C,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,2BAAU;IAEvC,IAAI,CAAgB;IAGpB,YAAY,CAAqB;IAGjC,WAAW,CAAe;IAG1B,QAAQ,
|
|
1
|
+
{"version":3,"file":"chat-room.model.js","sourceRoot":"/","sources":["libraries/mongo/models/chat-room.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsE;AACtE,4EAAqE;AACrE,8EAAoE;AACpE,kDAAgE;AAKhE,uCAAiC;AACjC,+CAAsC;AAEtC,MAAM,WAAY,SAAQ,2BAAU;IAE5B,GAAG,CAAkB;IAGrB,OAAO,CAAU;IAGjB,UAAU,CAAW;IAGrB,MAAM,CAAoC;CACjD;AAVO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,gBAAK,CAAC,QAAQ,EAAE,CAAC;8BAClB,gBAAK,CAAC,QAAQ;wCA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AQ;IAZpB,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE;YACd,UAAU,EAAE,WAAW;YACvB,UAAU,EAAE,IAAI;SAChB;KACD,CAAC;IACD,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;IAC/B,IAAA,iBAAK,EAAC,EAAE,kBAAkB,EAAE,CAAC,EAAE,mBAAmB,EAAE,CAAC,EAAE,CAAC;IACxD,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IACpB,IAAA,iBAAK,EAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC;IACxB,IAAA,iBAAK,EAAC,EAAE,YAAY,EAAE,CAAC,CAAC,EAAE,CAAC;IAC3B,IAAA,iBAAK,EAAC,EAAE,gCAAgC,EAAE,CAAC,EAAE,CAAC;GAClC,QAAQ,CAqBpB","sourcesContent":["import { index, modelOptions, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ChatParticipant } from './embedded/chat-participant.model';\nimport { ChatroomType, UserRef } from '../../../utilities/enum';\nimport { User } from './user.model';\nimport { Shop } from './shop.model';\nimport { Admin } from './admin.model';\nimport { Rider } from './rider.model';\nimport { Types } from 'mongoose';\nimport { Order } from './order.model';\n\nclass LastMessage extends TimeStamps {\n\t@prop({ type: Types.ObjectId })\n\tpublic _id!: Types.ObjectId;\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({ refPath: 'senderType' })\n\tpublic sender!: Ref<User | Admin | Shop | Rider>;\n}\n\n@modelOptions({\n\tschemaOptions: {\n\t\tcollection: 'chatrooms',\n\t\ttimestamps: true,\n\t},\n})\n@index({ type: 1, isActive: 1 })\n@index({ 'participants.ref': 1, 'participants.type': 1 })\n@index({ ticket: 1 })\n@index({ createdAt: -1 })\n@index({ messageCount: -1 })\n@index({ 'participants.lastReadMessageAt': 1 })\nexport class Chatroom extends TimeStamps {\n\t@prop({ enum: ChatroomType, required: true })\n\ttype!: ChatroomType;\n\n\t@prop({ type: () => [ChatParticipant], required: true })\n\tparticipants!: ChatParticipant[];\n\n\t@prop({ type: LastMessage })\n\tlastMessage?: LastMessage;\n\n\t@prop({ type: Boolean, default: true })\n\tisActive: boolean;\n\n\t@prop({ type: Date })\n\tlastMessageAt?: Date;\n\n\t@prop({ ref: () => Order })\n\tpublic order?: Ref<Order>;\n\n\t@prop({ type: Number, default: 0 })\n\tmessageCount?: number;\n}\n"]}
|
|
@@ -207,7 +207,7 @@ __decorate([
|
|
|
207
207
|
__metadata("design:type", Number)
|
|
208
208
|
], Rider.prototype, "avgRating", void 0);
|
|
209
209
|
__decorate([
|
|
210
|
-
(0, typegoose_1.prop)({ type:
|
|
210
|
+
(0, typegoose_1.prop)({ type: [String], enum: enum_1.ShiftType, default: [] }),
|
|
211
211
|
__metadata("design:type", Array)
|
|
212
212
|
], Rider.prototype, "shifts", void 0);
|
|
213
213
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rider.model.js","sourceRoot":"/","sources":["libraries/mongo/models/rider.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2E;AAC3E,4EAAqE;AACrE,oEAA0D;AAC1D,6CAAoC;AACpC,6CAAoC;AACpC,kDAAwH;AACxH,4EAAkE;AAElE,0DAA2D;AAC3D,uEAA6D;AAC7D,kEAA6D;AAC7D,wBAAiC;AAEjC,MAAa,UAAU;IAEf,MAAM,CAAU;IAGhB,eAAe,CAAU;CAChC;AAND,gCAMC;AAJO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;0CACZ;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,C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,CAAC,CAAC;QACvE,CAAC;IACF,CAAC,CAAC;IAED,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;IAC3E,IAAA,iBAAK,EAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;IAC/B,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;GACrF,KAAK,CA6IjB","sourcesContent":["import { index, modelOptions, pre, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { GeoLocation } from './shared/geo-location.model';\nimport { Zone } from './zone.model';\nimport { Shop } from './shop.model';\nimport { CounterType, CreatedBy, Language, LiveStatus, RiderBagSize, ShiftType, Status } from '../../../utilities/enum';\nimport { RiderEquipment } from './embedded/rider-equipment.model';\nimport { Query } from 'mongoose';\nimport { hashPassword } from '../../../utilities/password';\nimport { RiderReview } from './providers/rider-review.model';\nimport { generateId } from '../../../utilities/id-generator';\nimport { CounterModel } from '.';\n\nexport class CashInHand {\n\t@prop({ type: Number, default: 0 })\n\tpublic amount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic secondaryAmount?: number;\n}\n\n@pre<Rider>('save', async function (next) {\n\tif (this.isModified('password')) {\n\t\tthis.password = await hashPassword(this.password);\n\t}\n\tnext();\n})\n@pre<Query<any, Rider>>('findOneAndUpdate', async function (next) {\n\tconst update = this.getUpdate() as Record<string, any>;\n\tif (update?.password) {\n\t\tupdate.password = await hashPassword(update.password);\n\t\tthis.setUpdate(update);\n\t}\n\tnext();\n})\n@pre<Rider>('save',async function(){\n\tif(this.isNew){\n this.riderId = await generateId(CounterModel,CounterType.RIDER);\n\t}\n})\n\n@modelOptions({ schemaOptions: { collection: 'riders', timestamps: true } })\n@index({ location: '2dsphere' })\n@index({ status: 1, createdAt: 1, location: 1 }, { partialFilterExpression: { deletedAt: null } })\nexport class Rider extends TimeStamps {\n\t@prop({ type: String, required: true })\n\tpublic name!: string;\n\n\t@prop({type: String,unique: true})\n\tpublic riderId: string\n\n\t@prop({ type: String })\n\tpublic image?: string;\n\n\t@prop({ type: String, required: true })\n\tpublic email!: string;\n\n\t@prop({ type: String })\n\tpublic password!: string;\n\n\t@prop({ type: String })\n\tpublic countryCode?: string;\n\n\t@prop({ type: String, enum: Language, default: Language.EN })\n\tpublic language?: Language;\n\n\t@prop({ type: String })\n\tpublic number?: string;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status?: Status;\n\n\t@prop({ type: Date })\n\tpublic dob?: Date;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic totalOrder?: number;\n\n\t@prop({ type: String, enum: LiveStatus, default: LiveStatus.OFFLINE })\n\tpublic liveStatus?: LiveStatus;\n\n\t@prop({ type: () => String })\n\tpublic fcmToken?: string;\n\n\t@prop({ type: Date })\n\tpublic lastLogin?: Date;\n\n\t@prop({ type: Date })\n\tpublic lastOnline?: Date;\n\n\t@prop({ type: Date })\n\tpublic lastActive?: Date;\n\n\t@prop({ type: String })\n\tpublic nationalIdDocument?: string;\n\n\t@prop({ type: String })\n\tpublic vehicleRegistrationDocument?: string;\n\n\t@prop({ type: String })\n\tpublic vehicleType?: string;\n\n\t@prop({ type: String })\n\tpublic vehicleNumber?: string;\n\n\t@prop({ type: String })\n\tpublic address?: string;\n\n\t@prop({ type: GeoLocation })\n\tpublic location?: GeoLocation;\n\n\t@prop({ type: String })\n\tpublic forgetToken?: string;\n\n\t@prop({ type: Date })\n\tpublic forgetExpired?: Date;\n\n\t@prop({ type: Date })\n\tpublic lastLocationUpdateAt?: Date;\n\n\t@prop({ type: String })\n\tpublic contractImage?: string;\n\n\t@prop({ type: String, enum: CreatedBy, default: CreatedBy.ADMIN })\n\tpublic createdBy?: CreatedBy;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isLogin?: boolean;\n\n\t@prop({ type: String })\n\tpublic lastLoginDeviceId?: string;\n\n\t@prop({ type: () => [String], ref: () => RiderReview, default: [] })\n\tpublic reviews?: Ref<RiderReview>[];\n\n\t@prop({ type: Number, default: 0 })\n\tpublic avgRating?: number;\n\n\t@prop({ type: () => [ShiftType], default: [] })\n\tpublic shifts?: ShiftType[];\n\n\t@prop({ type: Boolean, default: false })\n\tpublic fullTimeEmployee: boolean;\n\n\t@prop({ ref: () => Zone })\n\tpublic zone?: Ref<Zone>;\n\n\t@prop({ type: String, enum: RiderBagSize, default: RiderBagSize.REGULAR })\n\tpublic bagSize?: RiderBagSize;\n\n\t@prop({ type: String, ref: () => Shop })\n\tpublic shop?: Ref<Shop>;\n\n\t@prop({ type: String })\n\tpublic riderNationality?: string;\n\n\t@prop({\n\t\ttype: CashInHand,\n\t\tdefault: () => ({\n\t\t\tamount: 0,\n\t\t\tsecondaryAmount: 0,\n\t\t}),\n\t})\n\tpublic cashInHand?: CashInHand;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isCashSettlementLimitReached?: boolean;\n\n\t@prop({ type: String })\n\tpublic cashSettlementReference?: string;\n\n\t@prop({ type: Date, default: null })\n\tpublic firstActiveAt?: Date | null;\n\n\t@prop({ type: () => [RiderEquipment], default: [] })\n\tpublic riderEquipments?: RiderEquipment[];\n\n\t@prop({ type: String })\n\tpublic insurance?: string;\n\n\t@prop({ type: String })\n\tpublic powerOfAttorney?: string;\n\n\t@prop({ type: String })\n\tpublic proofOfResidence?: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"rider.model.js","sourceRoot":"/","sources":["libraries/mongo/models/rider.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2E;AAC3E,4EAAqE;AACrE,oEAA0D;AAC1D,6CAAoC;AACpC,6CAAoC;AACpC,kDAAwH;AACxH,4EAAkE;AAElE,0DAA2D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A,uBAAY,EAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YACtD,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACxB,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;IACD,IAAA,eAAG,EAAQ,MAAM,EAAC,KAAK;QACvB,IAAG,IAAI,CAAC,KAAK,EAAC,CAAC;YACR,IAAI,CAAC,OAAO,GAAG,MAAM,IAAA,yBAAU,EAAC,eAAY,EAAC,kBAAW,CAAC,KAAK,CAAC,CAAC;QACvE,CAAC;IACF,CAAC,CAAC;IAED,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;IAC3E,IAAA,iBAAK,EAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;IAC/B,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;GACrF,KAAK,CA6IjB","sourcesContent":["import { index, modelOptions, pre, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { GeoLocation } from './shared/geo-location.model';\nimport { Zone } from './zone.model';\nimport { Shop } from './shop.model';\nimport { CounterType, CreatedBy, Language, LiveStatus, RiderBagSize, ShiftType, Status } from '../../../utilities/enum';\nimport { RiderEquipment } from './embedded/rider-equipment.model';\nimport { Query } from 'mongoose';\nimport { hashPassword } from '../../../utilities/password';\nimport { RiderReview } from './providers/rider-review.model';\nimport { generateId } from '../../../utilities/id-generator';\nimport { CounterModel } from '.';\n\nexport class CashInHand {\n\t@prop({ type: Number, default: 0 })\n\tpublic amount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic secondaryAmount?: number;\n}\n\n@pre<Rider>('save', async function (next) {\n\tif (this.isModified('password')) {\n\t\tthis.password = await hashPassword(this.password);\n\t}\n\tnext();\n})\n@pre<Query<any, Rider>>('findOneAndUpdate', async function (next) {\n\tconst update = this.getUpdate() as Record<string, any>;\n\tif (update?.password) {\n\t\tupdate.password = await hashPassword(update.password);\n\t\tthis.setUpdate(update);\n\t}\n\tnext();\n})\n@pre<Rider>('save',async function(){\n\tif(this.isNew){\n this.riderId = await generateId(CounterModel,CounterType.RIDER);\n\t}\n})\n\n@modelOptions({ schemaOptions: { collection: 'riders', timestamps: true } })\n@index({ location: '2dsphere' })\n@index({ status: 1, createdAt: 1, location: 1 }, { partialFilterExpression: { deletedAt: null } })\nexport class Rider extends TimeStamps {\n\t@prop({ type: String, required: true })\n\tpublic name!: string;\n\n\t@prop({type: String,unique: true})\n\tpublic riderId: string\n\n\t@prop({ type: String })\n\tpublic image?: string;\n\n\t@prop({ type: String, required: true })\n\tpublic email!: string;\n\n\t@prop({ type: String })\n\tpublic password!: string;\n\n\t@prop({ type: String })\n\tpublic countryCode?: string;\n\n\t@prop({ type: String, enum: Language, default: Language.EN })\n\tpublic language?: Language;\n\n\t@prop({ type: String })\n\tpublic number?: string;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status?: Status;\n\n\t@prop({ type: Date })\n\tpublic dob?: Date;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic totalOrder?: number;\n\n\t@prop({ type: String, enum: LiveStatus, default: LiveStatus.OFFLINE })\n\tpublic liveStatus?: LiveStatus;\n\n\t@prop({ type: () => String })\n\tpublic fcmToken?: string;\n\n\t@prop({ type: Date })\n\tpublic lastLogin?: Date;\n\n\t@prop({ type: Date })\n\tpublic lastOnline?: Date;\n\n\t@prop({ type: Date })\n\tpublic lastActive?: Date;\n\n\t@prop({ type: String })\n\tpublic nationalIdDocument?: string;\n\n\t@prop({ type: String })\n\tpublic vehicleRegistrationDocument?: string;\n\n\t@prop({ type: String })\n\tpublic vehicleType?: string;\n\n\t@prop({ type: String })\n\tpublic vehicleNumber?: string;\n\n\t@prop({ type: String })\n\tpublic address?: string;\n\n\t@prop({ type: GeoLocation })\n\tpublic location?: GeoLocation;\n\n\t@prop({ type: String })\n\tpublic forgetToken?: string;\n\n\t@prop({ type: Date })\n\tpublic forgetExpired?: Date;\n\n\t@prop({ type: Date })\n\tpublic lastLocationUpdateAt?: Date;\n\n\t@prop({ type: String })\n\tpublic contractImage?: string;\n\n\t@prop({ type: String, enum: CreatedBy, default: CreatedBy.ADMIN })\n\tpublic createdBy?: CreatedBy;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isLogin?: boolean;\n\n\t@prop({ type: String })\n\tpublic lastLoginDeviceId?: string;\n\n\t@prop({ type: () => [String], ref: () => RiderReview, default: [] })\n\tpublic reviews?: Ref<RiderReview>[];\n\n\t@prop({ type: Number, default: 0 })\n\tpublic avgRating?: number;\n\n\t@prop({ type: [String], enum: ShiftType, default: [] })\n\tpublic shifts?: ShiftType[];\n\n\t@prop({ type: Boolean, default: false })\n\tpublic fullTimeEmployee: boolean;\n\n\t@prop({ ref: () => Zone })\n\tpublic zone?: Ref<Zone>;\n\n\t@prop({ type: String, enum: RiderBagSize, default: RiderBagSize.REGULAR })\n\tpublic bagSize?: RiderBagSize;\n\n\t@prop({ type: String, ref: () => Shop })\n\tpublic shop?: Ref<Shop>;\n\n\t@prop({ type: String })\n\tpublic riderNationality?: string;\n\n\t@prop({\n\t\ttype: CashInHand,\n\t\tdefault: () => ({\n\t\t\tamount: 0,\n\t\t\tsecondaryAmount: 0,\n\t\t}),\n\t})\n\tpublic cashInHand?: CashInHand;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isCashSettlementLimitReached?: boolean;\n\n\t@prop({ type: String })\n\tpublic cashSettlementReference?: string;\n\n\t@prop({ type: Date, default: null })\n\tpublic firstActiveAt?: Date | null;\n\n\t@prop({ type: () => [RiderEquipment], default: [] })\n\tpublic riderEquipments?: RiderEquipment[];\n\n\t@prop({ type: String })\n\tpublic insurance?: string;\n\n\t@prop({ type: String })\n\tpublic powerOfAttorney?: string;\n\n\t@prop({ type: String })\n\tpublic proofOfResidence?: string;\n}\n"]}
|
|
@@ -32,7 +32,7 @@ export declare class User extends TimeStamps {
|
|
|
32
32
|
isPhoneVerified?: boolean;
|
|
33
33
|
onlineStatus?: OnlineStatus;
|
|
34
34
|
fcmTokens?: string[];
|
|
35
|
-
static updateWallet(this: ReturnModelType<typeof User>, userId: string, amount: number): Promise<(import("mongoose").Document<unknown, import("@typegoose/typegoose/lib/types").BeAnObject, User, import("@typegoose/typegoose/lib/types").BeAnyObject
|
|
35
|
+
static updateWallet(this: ReturnModelType<typeof User>, userId: string, amount: number): Promise<(import("mongoose").Document<unknown, import("@typegoose/typegoose/lib/types").BeAnObject, User, import("@typegoose/typegoose/lib/types").BeAnyObject> & Omit<User & {
|
|
36
36
|
_id: import("mongoose").Types.ObjectId;
|
|
37
37
|
} & {
|
|
38
38
|
__v: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"socket-event-registry.js","sourceRoot":"/","sources":["libraries/socket/core/socket-event-registry.ts"],"names":[],"mappings":";;;AAGA,
|
|
1
|
+
{"version":3,"file":"socket-event-registry.js","sourceRoot":"/","sources":["libraries/socket/core/socket-event-registry.ts"],"names":[],"mappings":";;;AAGA,2EAAiE;AAYjE,MAAa,YAAY;IACxB,MAAM,CAAC,eAAe,CAA4B,SAAY;QAC7D,OAAO,oCAAQ,CAAC,SAAS,CAAgB,CAAC;IAC3C,CAAC;IAED,MAAM,CAAC,kBAAkB,CAA4B,eAAkB,EAAE,KAAkB;QAC1F,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,eAAe,CAAC,eAAe,CAAC,CAAC;QACtE,MAAM,cAAc,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAClD,MAAM,GAAG,GAAG,UAAU,EAAE,CAAC,cAAc,CAAC,IAAI,SAAS,CAAC;QACtD,OAAO,GAAG,eAAe,IAAI,GAAG,EAAE,CAAC;IACpC,CAAC;IAEM,MAAM,CAAC,WAAW,CAA4B,eAAkB,EAAE,IAAkB;QAC1F,MAAM,EAAE,IAAI,EAAE,GAAG,oCAAQ,CAAC,eAAe,CAAC,CAAC;QAC3C,OAAO,IAAI,IAAI,CAAC,IAAI,CAAgB,CAAC;IACtC,CAAC;CACD;AAhBD,oCAgBC","sourcesContent":["import { z } from 'zod';\nimport { SocketEventType } from '../../../utilities/enum';\nimport { BaseSocketEvent } from '../BaseSocketEvent';\nimport { Registry, REGISTRY } from './socket-event-registry.map';\n\ninterface EventRegistration<TEvent extends BaseSocketEvent<any, any>> {\n\tctor: new (payload: z.input<TEvent['outputSchema']>) => TEvent;\n\tschemas: { input: TEvent['inputSchema']; output: TEvent['outputSchema'] };\n\tidentifier?: (input: z.infer<TEvent['inputSchema']>) => string;\n}\n\ntype InputFor<T extends SocketEventType> = z.infer<Registry[T]['schemas']['input']>;\ntype OutputFor<T extends SocketEventType> = z.infer<Registry[T]['schemas']['output']>;\ntype EventFor<T extends SocketEventType> = InstanceType<Registry[T]['ctor']>;\n\nexport class EventFactory {\n\tstatic getRegistration<T extends SocketEventType>(eventType: T) {\n\t\treturn REGISTRY[eventType] as Registry[T];\n\t}\n\n\tstatic getSubscriptionKey<T extends SocketEventType>(SocketEventType: T, input: InputFor<T>) {\n\t\tconst { identifier, schemas } = this.getRegistration(SocketEventType);\n\t\tconst validatedInput = schemas.input.parse(input);\n\t\tconst key = identifier?.(validatedInput) ?? 'default';\n\t\treturn `${SocketEventType}:${key}`;\n\t}\n\n\tpublic static createEvent<T extends SocketEventType>(SocketEventType: T, data: OutputFor<T>): EventFor<T> {\n\t\tconst { ctor } = REGISTRY[SocketEventType];\n\t\treturn new ctor(data) as EventFor<T>;\n\t}\n}\n\nexport type { Registry, EventFor, InputFor, OutputFor, EventRegistration };\n"]}
|
|
@@ -3,6 +3,7 @@ import { TicketAssignEvent } from '../events/ticket-assign.socket.event';
|
|
|
3
3
|
import { TicketUnassignEvent } from '../events/ticket-unassign.socket.event';
|
|
4
4
|
import { EventRegistration } from './index';
|
|
5
5
|
import { NotificationSocketEvent } from '../events/notification.socket.event';
|
|
6
|
+
import { RiderConnectSocketEvent } from '../events/rider-connect.socket.event';
|
|
6
7
|
export declare const REGISTRY: {
|
|
7
8
|
readonly CHATROOM_MESSAGE_SEND: {
|
|
8
9
|
readonly ctor: typeof ChatroomMessageSendSocketEvent;
|
|
@@ -96,7 +97,7 @@ export declare const REGISTRY: {
|
|
|
96
97
|
input: import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>;
|
|
97
98
|
output: import("zod").ZodObject<{
|
|
98
99
|
chatroomId: 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>;
|
|
99
|
-
lastMessage: import("zod").ZodObject<{
|
|
100
|
+
lastMessage: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
100
101
|
content: import("zod").ZodString | import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>;
|
|
101
102
|
createdAt: import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodDate, Date, Date>, Date, Date>;
|
|
102
103
|
}, "strip", import("zod").ZodTypeAny, {
|
|
@@ -105,40 +106,22 @@ export declare const REGISTRY: {
|
|
|
105
106
|
}, {
|
|
106
107
|
content: string;
|
|
107
108
|
createdAt: Date;
|
|
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">;
|
|
109
|
+
}>>;
|
|
119
110
|
unreadCount: import("zod").ZodNumber;
|
|
120
111
|
}, "strip", import("zod").ZodTypeAny, {
|
|
121
|
-
media: {
|
|
122
|
-
mediaType: import("../../../utilities/enum").MediaType;
|
|
123
|
-
mimeType: string;
|
|
124
|
-
}[];
|
|
125
|
-
lastMessage: {
|
|
126
|
-
content: string;
|
|
127
|
-
createdAt: Date;
|
|
128
|
-
};
|
|
129
112
|
unreadCount: number;
|
|
130
113
|
chatroomId: import("mongoose").Types.ObjectId;
|
|
131
|
-
|
|
132
|
-
media: {
|
|
133
|
-
mediaType: import("../../../utilities/enum").MediaType;
|
|
134
|
-
mimeType: string;
|
|
135
|
-
}[];
|
|
136
|
-
lastMessage: {
|
|
114
|
+
lastMessage?: {
|
|
137
115
|
content: string;
|
|
138
116
|
createdAt: Date;
|
|
139
|
-
};
|
|
117
|
+
} | undefined;
|
|
118
|
+
}, {
|
|
140
119
|
unreadCount: number;
|
|
141
120
|
chatroomId: import("mongoose").Types.ObjectId;
|
|
121
|
+
lastMessage?: {
|
|
122
|
+
content: string;
|
|
123
|
+
createdAt: Date;
|
|
124
|
+
} | undefined;
|
|
142
125
|
}>;
|
|
143
126
|
};
|
|
144
127
|
};
|
|
@@ -249,6 +232,13 @@ export declare const REGISTRY: {
|
|
|
249
232
|
}>;
|
|
250
233
|
};
|
|
251
234
|
};
|
|
235
|
+
readonly RIDER_CONNECT: {
|
|
236
|
+
readonly ctor: typeof RiderConnectSocketEvent;
|
|
237
|
+
readonly schemas: {
|
|
238
|
+
input: import("zod").ZodUndefined;
|
|
239
|
+
output: import("zod").ZodAny;
|
|
240
|
+
};
|
|
241
|
+
};
|
|
252
242
|
};
|
|
253
243
|
export type Registry = {
|
|
254
244
|
[K in keyof typeof REGISTRY]: (typeof REGISTRY)[K] extends EventRegistration<any> ? (typeof REGISTRY)[K] : never;
|
|
@@ -6,6 +6,7 @@ const events_1 = require("../events");
|
|
|
6
6
|
const ticket_assign_socket_event_1 = require("../events/ticket-assign.socket.event");
|
|
7
7
|
const ticket_unassign_socket_event_1 = require("../events/ticket-unassign.socket.event");
|
|
8
8
|
const notification_socket_event_1 = require("../events/notification.socket.event");
|
|
9
|
+
const rider_connect_socket_event_1 = require("../events/rider-connect.socket.event");
|
|
9
10
|
exports.REGISTRY = {
|
|
10
11
|
[enum_1.SocketEventType.CHATROOM_MESSAGE_SEND]: {
|
|
11
12
|
ctor: events_1.ChatroomMessageSendSocketEvent,
|
|
@@ -29,5 +30,9 @@ exports.REGISTRY = {
|
|
|
29
30
|
ctor: notification_socket_event_1.NotificationSocketEvent,
|
|
30
31
|
schemas: notification_socket_event_1.NotificationSocketEvent.schemas,
|
|
31
32
|
},
|
|
33
|
+
[enum_1.SocketEventType.RIDER_CONNECT]: {
|
|
34
|
+
ctor: rider_connect_socket_event_1.RiderConnectSocketEvent,
|
|
35
|
+
schemas: rider_connect_socket_event_1.RiderConnectSocketEvent.schemas,
|
|
36
|
+
},
|
|
32
37
|
};
|
|
33
38
|
//# sourceMappingURL=socket-event-registry.map.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"socket-event-registry.map.js","sourceRoot":"/","sources":["libraries/socket/core/socket-event-registry.map.ts"],"names":[],"mappings":";;;AAAA,kDAA0D;AAC1D,sCAA2F;AAC3F,qFAAyE;AACzE,yFAA6E;AAE7E,mFAA8E;
|
|
1
|
+
{"version":3,"file":"socket-event-registry.map.js","sourceRoot":"/","sources":["libraries/socket/core/socket-event-registry.map.ts"],"names":[],"mappings":";;;AAAA,kDAA0D;AAC1D,sCAA2F;AAC3F,qFAAyE;AACzE,yFAA6E;AAE7E,mFAA8E;AAC9E,qFAA+E;AAElE,QAAA,QAAQ,GAAG;IACvB,CAAC,sBAAe,CAAC,qBAAqB,CAAC,EAAE;QACxC,IAAI,EAAE,uCAA8B;QACpC,OAAO,EAAE,uCAA8B,CAAC,OAAO;QAC/C,UAAU,EAAE,uCAA8B,CAAC,UAAU;KACrD;IACD,CAAC,sBAAe,CAAC,yBAAyB,CAAC,EAAE;QAC5C,IAAI,EAAE,uCAA8B;QACpC,OAAO,EAAE,uCAA8B,CAAC,OAAO;KAC/C;IACD,CAAC,sBAAe,CAAC,aAAa,CAAC,EAAE;QAChC,IAAI,EAAE,8CAAiB;QACvB,OAAO,EAAE,8CAAiB,CAAC,OAAO;KAClC;IACD,CAAC,sBAAe,CAAC,eAAe,CAAC,EAAE;QAClC,IAAI,EAAE,kDAAmB;QACzB,OAAO,EAAE,kDAAmB,CAAC,OAAO;QACpC,UAAU,EAAE,kDAAmB,CAAC,UAAU;KAC1C;IACD,CAAC,sBAAe,CAAC,YAAY,CAAC,EAAE;QAC/B,IAAI,EAAE,mDAAuB;QAC7B,OAAO,EAAE,mDAAuB,CAAC,OAAO;KACxC;IACD,CAAC,sBAAe,CAAC,aAAa,CAAC,EAAE;QAChC,IAAI,EAAE,oDAAuB;QAC7B,OAAO,EAAE,oDAAuB,CAAC,OAAO;KACxC;CACQ,CAAC","sourcesContent":["import { SocketEventType } from '../../../utilities/enum';\nimport { ChatlistMessageSendSocketEvent, ChatroomMessageSendSocketEvent } from '../events';\nimport { TicketAssignEvent } from '../events/ticket-assign.socket.event';\nimport { TicketUnassignEvent } from '../events/ticket-unassign.socket.event';\nimport { EventRegistration } from './index';\nimport { NotificationSocketEvent } from '../events/notification.socket.event';\nimport { RiderConnectSocketEvent } from '../events/rider-connect.socket.event';\n\nexport const REGISTRY = {\n\t[SocketEventType.CHATROOM_MESSAGE_SEND]: {\n\t\tctor: ChatroomMessageSendSocketEvent,\n\t\tschemas: ChatroomMessageSendSocketEvent.schemas,\n\t\tidentifier: ChatroomMessageSendSocketEvent.identifier,\n\t},\n\t[SocketEventType.CHATLIST_MESSAGE_RECEIVED]: {\n\t\tctor: ChatlistMessageSendSocketEvent,\n\t\tschemas: ChatlistMessageSendSocketEvent.schemas,\n\t},\n\t[SocketEventType.TICKET_ASSIGN]: {\n\t\tctor: TicketAssignEvent,\n\t\tschemas: TicketAssignEvent.schemas,\n\t},\n\t[SocketEventType.TICKET_UNASSIGN]: {\n\t\tctor: TicketUnassignEvent,\n\t\tschemas: TicketUnassignEvent.schemas,\n\t\tidentifier: TicketUnassignEvent.identifier,\n\t},\n\t[SocketEventType.NOTIFICATION]: {\n\t\tctor: NotificationSocketEvent,\n\t\tschemas: NotificationSocketEvent.schemas,\n\t},\n\t[SocketEventType.RIDER_CONNECT]: {\n\t\tctor: RiderConnectSocketEvent,\n\t\tschemas: RiderConnectSocketEvent.schemas,\n\t},\n} as const;\n\nexport type Registry = {\n\t[K in keyof typeof REGISTRY]: (typeof REGISTRY)[K] extends EventRegistration<any>\n\t\t? (typeof REGISTRY)[K]\n\t\t: never;\n};\n"]}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
|
-
import { MediaType } from '../../../utilities/enum';
|
|
3
2
|
import { DTO } from '../../../utilities/validation';
|
|
4
3
|
import { BaseSocketEvent } from '../BaseSocketEvent';
|
|
5
4
|
export declare const ChatlistMessageSendSocketInputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
6
5
|
export declare const ChatlistMessageSendSocketOutputSchema: z.ZodObject<{
|
|
7
6
|
chatroomId: z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
|
|
8
|
-
lastMessage: z.ZodObject<{
|
|
7
|
+
lastMessage: z.ZodOptional<z.ZodObject<{
|
|
9
8
|
content: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
10
9
|
createdAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
|
|
11
10
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -14,40 +13,22 @@ export declare const ChatlistMessageSendSocketOutputSchema: z.ZodObject<{
|
|
|
14
13
|
}, {
|
|
15
14
|
content: string;
|
|
16
15
|
createdAt: Date;
|
|
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">;
|
|
16
|
+
}>>;
|
|
28
17
|
unreadCount: z.ZodNumber;
|
|
29
18
|
}, "strip", z.ZodTypeAny, {
|
|
30
|
-
media: {
|
|
31
|
-
mediaType: MediaType;
|
|
32
|
-
mimeType: string;
|
|
33
|
-
}[];
|
|
34
|
-
lastMessage: {
|
|
35
|
-
content: string;
|
|
36
|
-
createdAt: Date;
|
|
37
|
-
};
|
|
38
19
|
unreadCount: number;
|
|
39
20
|
chatroomId: import("mongoose").Types.ObjectId;
|
|
40
|
-
|
|
41
|
-
media: {
|
|
42
|
-
mediaType: MediaType;
|
|
43
|
-
mimeType: string;
|
|
44
|
-
}[];
|
|
45
|
-
lastMessage: {
|
|
21
|
+
lastMessage?: {
|
|
46
22
|
content: string;
|
|
47
23
|
createdAt: Date;
|
|
48
|
-
};
|
|
24
|
+
} | undefined;
|
|
25
|
+
}, {
|
|
49
26
|
unreadCount: number;
|
|
50
27
|
chatroomId: import("mongoose").Types.ObjectId;
|
|
28
|
+
lastMessage?: {
|
|
29
|
+
content: string;
|
|
30
|
+
createdAt: Date;
|
|
31
|
+
} | undefined;
|
|
51
32
|
}>;
|
|
52
33
|
export type ChatlistMessageSendSocketOutputDTO = DTO<typeof ChatlistMessageSendSocketOutputSchema>;
|
|
53
34
|
export declare class ChatlistMessageSendSocketEvent extends BaseSocketEvent<typeof ChatlistMessageSendSocketInputSchema, typeof ChatlistMessageSendSocketOutputSchema> {
|
|
@@ -55,7 +36,7 @@ export declare class ChatlistMessageSendSocketEvent extends BaseSocketEvent<type
|
|
|
55
36
|
input: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
56
37
|
output: z.ZodObject<{
|
|
57
38
|
chatroomId: z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
|
|
58
|
-
lastMessage: z.ZodObject<{
|
|
39
|
+
lastMessage: z.ZodOptional<z.ZodObject<{
|
|
59
40
|
content: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
60
41
|
createdAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
|
|
61
42
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -64,40 +45,22 @@ export declare class ChatlistMessageSendSocketEvent extends BaseSocketEvent<type
|
|
|
64
45
|
}, {
|
|
65
46
|
content: string;
|
|
66
47
|
createdAt: Date;
|
|
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">;
|
|
48
|
+
}>>;
|
|
78
49
|
unreadCount: z.ZodNumber;
|
|
79
50
|
}, "strip", z.ZodTypeAny, {
|
|
80
|
-
media: {
|
|
81
|
-
mediaType: MediaType;
|
|
82
|
-
mimeType: string;
|
|
83
|
-
}[];
|
|
84
|
-
lastMessage: {
|
|
85
|
-
content: string;
|
|
86
|
-
createdAt: Date;
|
|
87
|
-
};
|
|
88
51
|
unreadCount: number;
|
|
89
52
|
chatroomId: import("mongoose").Types.ObjectId;
|
|
90
|
-
|
|
91
|
-
media: {
|
|
92
|
-
mediaType: MediaType;
|
|
93
|
-
mimeType: string;
|
|
94
|
-
}[];
|
|
95
|
-
lastMessage: {
|
|
53
|
+
lastMessage?: {
|
|
96
54
|
content: string;
|
|
97
55
|
createdAt: Date;
|
|
98
|
-
};
|
|
56
|
+
} | undefined;
|
|
57
|
+
}, {
|
|
99
58
|
unreadCount: number;
|
|
100
59
|
chatroomId: import("mongoose").Types.ObjectId;
|
|
60
|
+
lastMessage?: {
|
|
61
|
+
content: string;
|
|
62
|
+
createdAt: Date;
|
|
63
|
+
} | undefined;
|
|
101
64
|
}>;
|
|
102
65
|
};
|
|
103
66
|
constructor(payload: ChatlistMessageSendSocketOutputDTO);
|
|
@@ -11,14 +11,12 @@ const BaseSocketEvent_1 = require("../BaseSocketEvent");
|
|
|
11
11
|
exports.ChatlistMessageSendSocketInputSchema = zod_1.default.object({});
|
|
12
12
|
exports.ChatlistMessageSendSocketOutputSchema = zod_1.default.object({
|
|
13
13
|
chatroomId: validation_1.ZodValidation.coerce.objectId(),
|
|
14
|
-
lastMessage: zod_1.default
|
|
14
|
+
lastMessage: zod_1.default
|
|
15
|
+
.object({
|
|
15
16
|
content: validation_1.ZodValidation.string(),
|
|
16
17
|
createdAt: validation_1.ZodValidation.coerce.date(),
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
mimeType: validation_1.ZodValidation.string('mimeType'),
|
|
20
|
-
mediaType: validation_1.ZodValidation.enumType(enum_1.MediaType, 'mediaType'),
|
|
21
|
-
})),
|
|
18
|
+
})
|
|
19
|
+
.optional(),
|
|
22
20
|
unreadCount: validation_1.ZodValidation.number(),
|
|
23
21
|
});
|
|
24
22
|
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,
|
|
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,kDAA0D;AAC1D,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;SACZ,MAAM,CAAC;QACP,OAAO,EAAE,0BAAa,CAAC,MAAM,EAAE;QAC/B,SAAS,EAAE,0BAAa,CAAC,MAAM,CAAC,IAAI,EAAE;KACtC,CAAC;SACD,QAAQ,EAAE;IACZ,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 { 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\n\t\t.object({\n\t\t\tcontent: ZodValidation.string(),\n\t\t\tcreatedAt: ZodValidation.coerce.date(),\n\t\t})\n\t\t.optional(),\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"]}
|
|
@@ -20,7 +20,7 @@ exports.ChatroomMessageSendOutputSchema = zod_1.default.object({
|
|
|
20
20
|
id: validation_1.ZodValidation.coerce.objectId('sender.id'),
|
|
21
21
|
type: validation_1.ZodValidation.enumType(enum_1.UserRef, 'sender.type'),
|
|
22
22
|
}),
|
|
23
|
-
content: validation_1.ZodValidation.string('content'
|
|
23
|
+
content: validation_1.ZodValidation.string('content').optional(),
|
|
24
24
|
media: zod_1.default.array(zod_1.default.object({
|
|
25
25
|
mimeType: validation_1.ZodValidation.string('mimeType'),
|
|
26
26
|
mediaType: validation_1.ZodValidation.enumType(enum_1.MediaType, 'mediaType'),
|
|
@@ -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,kDAA8E;AAC9E,8DAA6E;AAC7E,wDAAqD;AACrD,2EAAsE;AAEzD,QAAA,oCAAoC,GAAG,aAA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EAwBC","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').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"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BaseSocketEvent } from '../BaseSocketEvent';
|
|
3
|
+
export declare const RiderConnectionSocketInputSchema: z.ZodUndefined;
|
|
4
|
+
export declare const RiderConnectionSocketOutputSchema: z.ZodAny;
|
|
5
|
+
export type RiderConnectionSocketOutputDTO = void;
|
|
6
|
+
export declare class RiderConnectSocketEvent extends BaseSocketEvent<typeof RiderConnectionSocketInputSchema, typeof RiderConnectionSocketOutputSchema> {
|
|
7
|
+
static readonly schemas: {
|
|
8
|
+
input: z.ZodUndefined;
|
|
9
|
+
output: z.ZodAny;
|
|
10
|
+
};
|
|
11
|
+
constructor(payload: RiderConnectionSocketOutputDTO);
|
|
12
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RiderConnectSocketEvent = exports.RiderConnectionSocketOutputSchema = exports.RiderConnectionSocketInputSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const BaseSocketEvent_1 = require("../BaseSocketEvent");
|
|
6
|
+
const enum_1 = require("../../../utilities/enum");
|
|
7
|
+
exports.RiderConnectionSocketInputSchema = zod_1.z.undefined();
|
|
8
|
+
exports.RiderConnectionSocketOutputSchema = zod_1.z.any();
|
|
9
|
+
class RiderConnectSocketEvent extends BaseSocketEvent_1.BaseSocketEvent {
|
|
10
|
+
static schemas = {
|
|
11
|
+
input: exports.RiderConnectionSocketInputSchema,
|
|
12
|
+
output: exports.RiderConnectionSocketOutputSchema,
|
|
13
|
+
};
|
|
14
|
+
constructor(payload) {
|
|
15
|
+
super(enum_1.SocketEventType.RIDER_CONNECT, RiderConnectSocketEvent.schemas, payload);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.RiderConnectSocketEvent = RiderConnectSocketEvent;
|
|
19
|
+
//# sourceMappingURL=rider-connect.socket.event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rider-connect.socket.event.js","sourceRoot":"/","sources":["libraries/socket/events/rider-connect.socket.event.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,wDAAqD;AACrD,kDAA0D;AAE7C,QAAA,gCAAgC,GAAG,OAAC,CAAC,SAAS,EAAE,CAAC;AACjD,QAAA,iCAAiC,GAAG,OAAC,CAAC,GAAG,EAAE,CAAC;AAIzD,MAAa,uBAAwB,SAAQ,iCAG5C;IACA,MAAM,CAAU,OAAO,GAAG;QACzB,KAAK,EAAE,wCAAgC;QACvC,MAAM,EAAE,yCAAiC;KACzC,CAAC;IAEF,YAAY,OAAuC;QAClD,KAAK,CAAC,sBAAe,CAAC,aAAa,EAAE,uBAAuB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAChF,CAAC;;AAXF,0DAYC","sourcesContent":["import { z } from 'zod';\nimport { BaseSocketEvent } from '../BaseSocketEvent';\nimport { SocketEventType } from '../../../utilities/enum';\n\nexport const RiderConnectionSocketInputSchema = z.undefined();\nexport const RiderConnectionSocketOutputSchema = z.any();\n\nexport type RiderConnectionSocketOutputDTO = void;\n\nexport class RiderConnectSocketEvent extends BaseSocketEvent<\n\ttypeof RiderConnectionSocketInputSchema,\n\ttypeof RiderConnectionSocketOutputSchema\n> {\n\tstatic readonly schemas = {\n\t\tinput: RiderConnectionSocketInputSchema,\n\t\toutput: RiderConnectionSocketOutputSchema,\n\t};\n\n\tconstructor(payload: RiderConnectionSocketOutputDTO) {\n\t\tsuper(SocketEventType.RIDER_CONNECT, RiderConnectSocketEvent.schemas, payload);\n\t}\n}\n"]}
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED
|
@@ -765,7 +765,8 @@ export declare enum SocketEventType {
|
|
|
765
765
|
CHATLIST_MESSAGE_RECEIVED = "CHATLIST_MESSAGE_RECEIVED",
|
|
766
766
|
TICKET_ASSIGN = "TICKET_ASSIGN",
|
|
767
767
|
TICKET_UNASSIGN = "TICKET_UNASSIGN",
|
|
768
|
-
NOTIFICATION = "NOTIFICATION"
|
|
768
|
+
NOTIFICATION = "NOTIFICATION",
|
|
769
|
+
RIDER_CONNECT = "RIDER_CONNECT"
|
|
769
770
|
}
|
|
770
771
|
export declare enum PushNotificationEventType {
|
|
771
772
|
CHATROOM_MESSAGE_SEND = "CHATROOM_MESSAGE_SEND"
|
|
@@ -886,6 +886,7 @@ var SocketEventType;
|
|
|
886
886
|
SocketEventType["TICKET_ASSIGN"] = "TICKET_ASSIGN";
|
|
887
887
|
SocketEventType["TICKET_UNASSIGN"] = "TICKET_UNASSIGN";
|
|
888
888
|
SocketEventType["NOTIFICATION"] = "NOTIFICATION";
|
|
889
|
+
SocketEventType["RIDER_CONNECT"] = "RIDER_CONNECT";
|
|
889
890
|
})(SocketEventType || (exports.SocketEventType = SocketEventType = {}));
|
|
890
891
|
var PushNotificationEventType;
|
|
891
892
|
(function (PushNotificationEventType) {
|