@lyxa.ai/core 1.1.6 → 1.1.7
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/embedded/chat-participant.model.d.ts +0 -2
- package/dist/libraries/mongo/models/embedded/chat-participant.model.js +0 -6
- package/dist/libraries/mongo/models/embedded/chat-participant.model.js.map +1 -1
- package/dist/types/README.md +1 -1
- package/dist/types/package.json +1 -1
- package/package.json +1 -1
- package/dist/libraries/mongo/models/shared/entity-ref.model.d.ts +0 -23
- package/dist/libraries/mongo/models/shared/entity-ref.model.js +0 -102
- package/dist/libraries/mongo/models/shared/entity-ref.model.js.map +0 -1
|
@@ -5,11 +5,9 @@ import { Shop } from '../shop.model';
|
|
|
5
5
|
import { Rider } from '../rider.model';
|
|
6
6
|
import { UserRef } from '../../../../utilities/enum';
|
|
7
7
|
import { Message } from '../message.model';
|
|
8
|
-
import { EntityRef } from '../shared/entity-ref.model';
|
|
9
8
|
export declare class ChatParticipant {
|
|
10
9
|
ref: Ref<User | Admin | Shop | Rider>;
|
|
11
10
|
type: UserRef;
|
|
12
|
-
entity: EntityRef;
|
|
13
11
|
joinedAt?: Date;
|
|
14
12
|
lastReadAt?: Date;
|
|
15
13
|
isActive?: boolean;
|
|
@@ -13,11 +13,9 @@ exports.ChatParticipant = void 0;
|
|
|
13
13
|
const typegoose_1 = require("@typegoose/typegoose");
|
|
14
14
|
const enum_1 = require("../../../../utilities/enum");
|
|
15
15
|
const message_model_1 = require("../message.model");
|
|
16
|
-
const entity_ref_model_1 = require("../shared/entity-ref.model");
|
|
17
16
|
class ChatParticipant {
|
|
18
17
|
ref;
|
|
19
18
|
type;
|
|
20
|
-
entity;
|
|
21
19
|
joinedAt;
|
|
22
20
|
lastReadAt;
|
|
23
21
|
isActive;
|
|
@@ -35,10 +33,6 @@ __decorate([
|
|
|
35
33
|
(0, typegoose_1.prop)({ required: true, enum: enum_1.UserRef }),
|
|
36
34
|
__metadata("design:type", String)
|
|
37
35
|
], ChatParticipant.prototype, "type", void 0);
|
|
38
|
-
__decorate([
|
|
39
|
-
(0, typegoose_1.prop)({ required: true, type: () => entity_ref_model_1.EntityRef }),
|
|
40
|
-
__metadata("design:type", entity_ref_model_1.EntityRef)
|
|
41
|
-
], ChatParticipant.prototype, "entity", void 0);
|
|
42
36
|
__decorate([
|
|
43
37
|
(0, typegoose_1.prop)({ type: Date, default: () => new Date() }),
|
|
44
38
|
__metadata("design:type", Date)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-participant.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/chat-participant.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AAKjD,qDAAqD;AACrD,oDAA2C;
|
|
1
|
+
{"version":3,"file":"chat-participant.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/chat-participant.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AAKjD,qDAAqD;AACrD,oDAA2C;AAE3C,MAAa,eAAe;IAE3B,GAAG,CAAoC;IAGvC,IAAI,CAAW;IAGf,QAAQ,CAAQ;IAGhB,UAAU,CAAQ;IAGlB,QAAQ,CAAW;IAGnB,eAAe,CAAgB;IAG/B,iBAAiB,CAAQ;IAGzB,WAAW,CAAU;IAGrB,MAAM,CAAQ;CACd;AA3BD,0CA2BC;AAzBA;IADC,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;;4CACH;AAGvC;IADC,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,cAAO,EAAE,CAAC;;6CACzB;AAGf;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC;8BACrC,IAAI;iDAAC;AAGhB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACR,IAAI;mDAAC;AAGlB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;iDACpB;AAGnB;IADC,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,uBAAO,EAAE,CAAC;;wDACE;AAG/B;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACD,IAAI;0DAAC;AAGzB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;oDACd;AAGrB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACZ,IAAI;+CAAC","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { User } from '../user.model';\nimport { Admin } from '../admin.model';\nimport { Shop } from '../shop.model';\nimport { Rider } from '../rider.model';\nimport { UserRef } from '../../../../utilities/enum';\nimport { Message } from '../message.model';\n\nexport class ChatParticipant {\n\t@prop({ required: true, refPath: 'type' })\n\tref!: Ref<User | Admin | Shop | Rider>;\n\n\t@prop({ required: true, enum: UserRef })\n\ttype!: UserRef;\n\n\t@prop({ type: Date, default: () => new Date() })\n\tjoinedAt?: Date;\n\n\t@prop({ type: Date })\n\tlastReadAt?: Date;\n\n\t@prop({ type: Boolean, default: true })\n\tisActive?: boolean;\n\n\t@prop({ ref: () => Message })\n\tlastReadMessage?: Ref<Message>;\n\n\t@prop({ type: Date })\n\tlastReadMessageAt?: Date;\n\n\t@prop({ type: Number, default: 0 })\n\tunreadCount?: number;\n\n\t@prop({ type: Date })\n\tleftAt?: Date;\n}\n"]}
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { DocumentType, Ref } from '@typegoose/typegoose';
|
|
2
|
-
import { Admin } from '../admin.model';
|
|
3
|
-
import { Shop } from '../shop.model';
|
|
4
|
-
import { User } from '../user.model';
|
|
5
|
-
import { Rider } from '../rider.model';
|
|
6
|
-
import { UserRef } from '../../../../utilities/enum';
|
|
7
|
-
import { Types } from 'mongoose';
|
|
8
|
-
type RefModel = User | Admin | Shop | Rider;
|
|
9
|
-
export interface EntityData {
|
|
10
|
-
id: Types.ObjectId;
|
|
11
|
-
type: UserRef;
|
|
12
|
-
name: string;
|
|
13
|
-
profilePicture?: string;
|
|
14
|
-
email?: string;
|
|
15
|
-
phone?: string;
|
|
16
|
-
}
|
|
17
|
-
export declare class EntityRef {
|
|
18
|
-
ref: Ref<RefModel>;
|
|
19
|
-
type: UserRef;
|
|
20
|
-
getProfile(this: DocumentType<EntityRef>): Promise<EntityData | null>;
|
|
21
|
-
static mapToProfile(entity: DocumentType<RefModel>, type: UserRef): EntityData;
|
|
22
|
-
}
|
|
23
|
-
export {};
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.EntityRef = void 0;
|
|
13
|
-
const typegoose_1 = require("@typegoose/typegoose");
|
|
14
|
-
const enum_1 = require("../../../../utilities/enum");
|
|
15
|
-
class EntityRef {
|
|
16
|
-
ref;
|
|
17
|
-
type;
|
|
18
|
-
async getProfile() {
|
|
19
|
-
if (!this.populated('ref')) {
|
|
20
|
-
await this.populate('ref');
|
|
21
|
-
}
|
|
22
|
-
const entity = this.ref;
|
|
23
|
-
if (!entity)
|
|
24
|
-
return null;
|
|
25
|
-
if (this.type === enum_1.UserRef.USER) {
|
|
26
|
-
const user = entity;
|
|
27
|
-
if (user.coreUser && !user.populated('coreUser')) {
|
|
28
|
-
await user.populate('coreUser');
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
if (this.type === enum_1.UserRef.ADMIN) {
|
|
32
|
-
const admin = entity;
|
|
33
|
-
if (admin.accessControl && !admin.populated('accessControl')) {
|
|
34
|
-
await admin.populate('accessControl');
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return EntityRef.mapToProfile(entity, this.type);
|
|
38
|
-
}
|
|
39
|
-
static mapToProfile(entity, type) {
|
|
40
|
-
const mappers = {
|
|
41
|
-
[enum_1.UserRef.USER]: (e) => ({
|
|
42
|
-
id: e._id,
|
|
43
|
-
name: e.coreUser?.name || 'Unknown User',
|
|
44
|
-
profilePicture: e.coreUser?.profilePhoto,
|
|
45
|
-
email: e.coreUser?.email,
|
|
46
|
-
phone: e.phoneNumber,
|
|
47
|
-
type: enum_1.UserRef.USER,
|
|
48
|
-
}),
|
|
49
|
-
[enum_1.UserRef.ADMIN]: (e) => ({
|
|
50
|
-
id: e._id,
|
|
51
|
-
name: e.name,
|
|
52
|
-
profilePicture: e.profilePhoto,
|
|
53
|
-
email: e.accessControl.email,
|
|
54
|
-
phone: e.phoneNumber,
|
|
55
|
-
type: enum_1.UserRef.ADMIN,
|
|
56
|
-
}),
|
|
57
|
-
[enum_1.UserRef.SHOP]: (e) => ({
|
|
58
|
-
id: e._id,
|
|
59
|
-
name: e.name,
|
|
60
|
-
profilePicture: e.logo,
|
|
61
|
-
email: e.email,
|
|
62
|
-
phone: e.phoneNumber,
|
|
63
|
-
type: enum_1.UserRef.SHOP,
|
|
64
|
-
}),
|
|
65
|
-
[enum_1.UserRef.RIDER]: (e) => ({
|
|
66
|
-
id: e._id,
|
|
67
|
-
name: e.name,
|
|
68
|
-
profilePicture: e.image,
|
|
69
|
-
email: e.email,
|
|
70
|
-
phone: e.number,
|
|
71
|
-
type: enum_1.UserRef.RIDER,
|
|
72
|
-
}),
|
|
73
|
-
[enum_1.UserRef.VENDOR]: (e) => ({
|
|
74
|
-
id: e._id,
|
|
75
|
-
name: e.name,
|
|
76
|
-
profilePicture: e.logo,
|
|
77
|
-
email: e.email,
|
|
78
|
-
phone: e.phoneNumber,
|
|
79
|
-
type: enum_1.UserRef.VENDOR,
|
|
80
|
-
}),
|
|
81
|
-
[enum_1.UserRef.PROFESSIONAL]: (e) => ({
|
|
82
|
-
id: e._id,
|
|
83
|
-
name: e.name,
|
|
84
|
-
profilePicture: e.image,
|
|
85
|
-
email: e.email,
|
|
86
|
-
phone: e.phoneNumber,
|
|
87
|
-
type: enum_1.UserRef.PROFESSIONAL,
|
|
88
|
-
}),
|
|
89
|
-
};
|
|
90
|
-
return mappers[type](entity);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
exports.EntityRef = EntityRef;
|
|
94
|
-
__decorate([
|
|
95
|
-
(0, typegoose_1.prop)({ required: true, refPath: 'type' }),
|
|
96
|
-
__metadata("design:type", Object)
|
|
97
|
-
], EntityRef.prototype, "ref", void 0);
|
|
98
|
-
__decorate([
|
|
99
|
-
(0, typegoose_1.prop)({ required: true, enum: enum_1.UserRef }),
|
|
100
|
-
__metadata("design:type", String)
|
|
101
|
-
], EntityRef.prototype, "type", void 0);
|
|
102
|
-
//# sourceMappingURL=entity-ref.model.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entity-ref.model.js","sourceRoot":"/","sources":["libraries/mongo/models/shared/entity-ref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AuB,EAAE,EAAE,CAAC,CAAC;gBAC/C,EAAE,EAAE,CAAC,CAAC,GAAG;gBACT,IAAI,EAAE,CAAC,CAAC,IAAI;gBACZ,cAAc,EAAE,CAAC,CAAC,IAAI;gBACtB,KAAK,EAAE,CAAC,CAAC,KAAK;gBACd,KAAK,EAAE,CAAC,CAAC,WAAW;gBACpB,IAAI,EAAE,cAAO,CAAC,MAAM;aACpB,CAAC;YAEF,CAAC,cAAO,CAAC,YAAY,CAAC,EAAE,CAAC,CAA6B,EAAE,EAAE,CAAC,CAAC;gBAC3D,EAAE,EAAE,CAAC,CAAC,GAAG;gBACT,IAAI,EAAE,CAAC,CAAC,IAAI;gBACZ,cAAc,EAAE,CAAC,CAAC,KAAK;gBACvB,KAAK,EAAE,CAAC,CAAC,KAAK;gBACd,KAAK,EAAE,CAAC,CAAC,WAAW;gBACpB,IAAI,EAAE,cAAO,CAAC,YAAY;aAC1B,CAAC;SACF,CAAC;QAEF,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,MAAa,CAAC,CAAC;IACrC,CAAC;CACD;AA3FD,8BA2FC;AAzFA;IADC,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;;sCACtB;AAGpB;IADC,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,cAAO,EAAE,CAAC;;uCACzB","sourcesContent":["import { DocumentType, prop, Ref } from '@typegoose/typegoose';\nimport { Admin } from '../admin.model';\nimport { Shop } from '../shop.model';\nimport { User } from '../user.model';\nimport { Rider } from '../rider.model';\nimport { CoreUser } from '../core-user.model';\nimport { UserRef } from '../../../../utilities/enum';\nimport { AdminAccessControl } from '../admin-access-control.model';\nimport { Vendor } from '../vendor.model';\nimport { Professional } from '../professional.model';\nimport { Types } from 'mongoose';\n\ntype RefModel = User | Admin | Shop | Rider;\ntype PopulatedUser = User & { coreUser: DocumentType<CoreUser> };\ntype PopulatedAdmin = Admin & { accessControl: DocumentType<AdminAccessControl> };\n\nexport interface EntityData {\n\tid: Types.ObjectId;\n\ttype: UserRef;\n\tname: string;\n\tprofilePicture?: string;\n\temail?: string;\n\tphone?: string;\n}\n\nexport class EntityRef {\n\t@prop({ required: true, refPath: 'type' })\n\tref!: Ref<RefModel>;\n\n\t@prop({ required: true, enum: UserRef })\n\ttype!: UserRef;\n\n\tasync getProfile(this: DocumentType<EntityRef>): Promise<EntityData | null> {\n\t\tif (!this.populated('ref')) {\n\t\t\tawait this.populate('ref');\n\t\t}\n\n\t\tconst entity = this.ref as DocumentType<RefModel>;\n\t\tif (!entity) return null;\n\n\t\tif (this.type === UserRef.USER) {\n\t\t\tconst user = entity as DocumentType<User>;\n\t\t\tif (user.coreUser && !user.populated('coreUser')) {\n\t\t\t\tawait user.populate('coreUser');\n\t\t\t}\n\t\t}\n\n\t\tif (this.type === UserRef.ADMIN) {\n\t\t\tconst admin = entity as DocumentType<Admin>;\n\t\t\tif (admin.accessControl && !admin.populated('accessControl')) {\n\t\t\t\tawait admin.populate('accessControl');\n\t\t\t}\n\t\t}\n\n\t\treturn EntityRef.mapToProfile(entity, this.type);\n\t}\n\n\tstatic mapToProfile(entity: DocumentType<RefModel>, type: UserRef): EntityData {\n\t\tconst mappers: Record<UserRef, (e: any) => EntityData> = {\n\t\t\t[UserRef.USER]: (e: DocumentType<PopulatedUser>) => ({\n\t\t\t\tid: e._id,\n\t\t\t\tname: e.coreUser?.name || 'Unknown User',\n\t\t\t\tprofilePicture: e.coreUser?.profilePhoto,\n\t\t\t\temail: e.coreUser?.email,\n\t\t\t\tphone: e.phoneNumber,\n\t\t\t\ttype: UserRef.USER,\n\t\t\t}),\n\n\t\t\t[UserRef.ADMIN]: (e: DocumentType<PopulatedAdmin>) => ({\n\t\t\t\tid: e._id,\n\t\t\t\tname: e.name,\n\t\t\t\tprofilePicture: e.profilePhoto,\n\t\t\t\temail: e.accessControl.email,\n\t\t\t\tphone: e.phoneNumber,\n\t\t\t\ttype: UserRef.ADMIN,\n\t\t\t}),\n\n\t\t\t[UserRef.SHOP]: (e: DocumentType<Shop>) => ({\n\t\t\t\tid: e._id,\n\t\t\t\tname: e.name,\n\t\t\t\tprofilePicture: e.logo,\n\t\t\t\temail: e.email,\n\t\t\t\tphone: e.phoneNumber,\n\t\t\t\ttype: UserRef.SHOP,\n\t\t\t}),\n\n\t\t\t[UserRef.RIDER]: (e: DocumentType<Rider>) => ({\n\t\t\t\tid: e._id,\n\t\t\t\tname: e.name,\n\t\t\t\tprofilePicture: e.image,\n\t\t\t\temail: e.email,\n\t\t\t\tphone: e.number,\n\t\t\t\ttype: UserRef.RIDER,\n\t\t\t}),\n\n\t\t\t[UserRef.VENDOR]: (e: DocumentType<Vendor>) => ({\n\t\t\t\tid: e._id,\n\t\t\t\tname: e.name,\n\t\t\t\tprofilePicture: e.logo,\n\t\t\t\temail: e.email,\n\t\t\t\tphone: e.phoneNumber,\n\t\t\t\ttype: UserRef.VENDOR,\n\t\t\t}),\n\n\t\t\t[UserRef.PROFESSIONAL]: (e: DocumentType<Professional>) => ({\n\t\t\t\tid: e._id,\n\t\t\t\tname: e.name,\n\t\t\t\tprofilePicture: e.image,\n\t\t\t\temail: e.email,\n\t\t\t\tphone: e.phoneNumber,\n\t\t\t\ttype: UserRef.PROFESSIONAL,\n\t\t\t}),\n\t\t};\n\n\t\treturn mappers[type](entity as any);\n\t}\n}\n"]}
|