@lyxa.ai/core 1.0.15-debug-0.7 → 1.0.15-debug-0.8
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.
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ReturnModelType, Ref } from '@typegoose/typegoose';
|
|
2
2
|
import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
|
|
3
3
|
import { AdminRole } from '../../../utilities/enum';
|
|
4
|
+
import { Admin } from './admin.model';
|
|
4
5
|
export declare class AdminAccessControl extends TimeStamps {
|
|
5
6
|
email: string;
|
|
6
7
|
password: string;
|
|
7
|
-
admin: Ref<
|
|
8
|
+
admin: Ref<Admin>;
|
|
8
9
|
role: AdminRole;
|
|
9
10
|
}
|
|
10
11
|
export declare const AdminAccessControlModel: ReturnModelType<typeof AdminAccessControl>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-access-control.model.js","sourceRoot":"/","sources":["libraries/mongo/models/admin-access-control.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAAuG;AACvG,4EAAqE;AACrE,wDAA8B;AAC9B,kDAAoD;
|
|
1
|
+
{"version":3,"file":"admin-access-control.model.js","sourceRoot":"/","sources":["libraries/mongo/models/admin-access-control.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAAuG;AACvG,4EAAqE;AACrE,wDAA8B;AAC9B,kDAAoD;AAW7C,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,2BAAU;IAE1C,KAAK,CAAU;IAGf,QAAQ,CAAU;IAGlB,KAAK,CAAc;IAGnB,IAAI,CAAa;CACxB,CAAA;AAZY,gDAAkB;AAEvB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;iDAC/B;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oDACd;AAGlB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;;iDACpB;AAGnB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAS,EAAE,CAAC;;gDAChC;6BAXZ,kBAAkB;IAR9B,IAAA,eAAG,EAAqB,MAAM,EAAE,KAAK,WAAW,IAAI;QACpD,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YACjC,MAAM,IAAI,GAAG,MAAM,kBAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YACtC,IAAI,CAAC,QAAQ,GAAG,MAAM,kBAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACxD,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;IACD,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,qBAAqB,EAAE,EAAE,CAAC;GAC1D,kBAAkB,CAY9B;AAEY,QAAA,uBAAuB,GACnC,IAAA,4BAAgB,EAAC,kBAAkB,CAAC,CAAC","sourcesContent":["import { modelOptions, prop, getModelForClass, pre, ReturnModelType, Ref } from '@typegoose/typegoose';\r\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\r\nimport bcrypt from 'bcryptjs';\r\nimport { AdminRole } from '../../../utilities/enum';\r\nimport { Admin } from './admin.model';\r\n\r\n@pre<AdminAccessControl>('save', async function (next) {\r\n\tif (this.isModified('password')) {\r\n\t\tconst salt = await bcrypt.genSalt(10);\r\n\t\tthis.password = await bcrypt.hash(this.password, salt);\r\n\t}\r\n\tnext();\r\n})\r\n@modelOptions({ schemaOptions: { collection: 'adminAccessControls' } })\r\nexport class AdminAccessControl extends TimeStamps {\r\n\t@prop({ required: true, type: String, unique: true })\r\n\tpublic email!: string;\r\n\r\n\t@prop({ required: true, type: String })\r\n\tpublic password!: string;\r\n\r\n\t@prop({ required: true, ref: () => 'admins' })\r\n\tpublic admin!: Ref<Admin>;\r\n\r\n\t@prop({ required: true, type: String, enum: AdminRole })\r\n\tpublic role!: AdminRole;\r\n}\r\n\r\nexport const AdminAccessControlModel: ReturnModelType<typeof AdminAccessControl> =\r\n\tgetModelForClass(AdminAccessControl);\r\n"]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ReturnModelType, Ref } from "@typegoose/typegoose";
|
|
2
2
|
import { TimeStamps } from "@typegoose/typegoose/lib/defaultClasses";
|
|
3
|
+
import { AdminAccessControl } from "./admin-access-control.model";
|
|
3
4
|
export declare class Admin extends TimeStamps {
|
|
4
5
|
name: string;
|
|
5
6
|
profilePhoto?: string;
|
|
6
7
|
phoneNumber: string;
|
|
7
8
|
status?: string;
|
|
8
|
-
accessControl: Ref<
|
|
9
|
+
accessControl: Ref<AdminAccessControl>;
|
|
9
10
|
}
|
|
10
11
|
export declare const AdminModel: ReturnModelType<typeof Admin>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.model.js","sourceRoot":"/","sources":["libraries/mongo/models/admin.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAM8B;AAC9B,4EAAqE;AACrE,kDAAiD;
|
|
1
|
+
{"version":3,"file":"admin.model.js","sourceRoot":"/","sources":["libraries/mongo/models/admin.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAM8B;AAC9B,4EAAqE;AACrE,kDAAiD;AAU1C,IAAM,KAAK,GAAX,MAAM,KAAM,SAAQ,2BAAU;IAE5B,IAAI,CAAU;IAGd,YAAY,CAAU;IAGtB,WAAW,CAAU;IAGrB,MAAM,CAAU;IAQhB,aAAa,CAA0B;CAC/C,CAAA;AApBY,sBAAK;AAET;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;mCAClB;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2CACM;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;0CACX;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAM,EAAE,OAAO,EAAE,aAAM,CAAC,MAAM,EAAE,CAAC;;qCACtC;AAQhB;IANN,IAAA,gBAAI,EAAC;QACJ,GAAG,EAAE,GAAG,EAAE,CAAC,qBAAqB;QAChC,YAAY,EAAE,OAAO;QACrB,UAAU,EAAE,KAAK;QACjB,OAAO,EAAE,IAAI;KACd,CAAC;;4CAC4C;gBAnBnC,KAAK;IAPjB,IAAA,wBAAY,EAAC;QACZ,aAAa,EAAE;YACb,UAAU,EAAE,QAAQ;YACpB,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC1B,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;SAC7B;KACF,CAAC;GACW,KAAK,CAoBjB;AAEY,QAAA,UAAU,GACrB,IAAA,4BAAgB,EAAC,KAAK,CAAC,CAAC","sourcesContent":["import {\r\n modelOptions,\r\n prop,\r\n getModelForClass,\r\n ReturnModelType,\r\n Ref,\r\n} from \"@typegoose/typegoose\";\r\nimport { TimeStamps } from \"@typegoose/typegoose/lib/defaultClasses\";\r\nimport { Status } from \"../../../utilities/enum\";\r\nimport { AdminAccessControl } from \"./admin-access-control.model\";\r\n\r\n@modelOptions({\r\n schemaOptions: {\r\n collection: \"admins\",\r\n toJSON: { virtuals: true },\r\n toObject: { virtuals: true },\r\n },\r\n})\r\nexport class Admin extends TimeStamps {\r\n @prop({ required: true, type: String })\r\n public name!: string;\r\n\r\n @prop({ type: String })\r\n public profilePhoto?: string;\r\n\r\n @prop({ required: true, type: String })\r\n public phoneNumber!: string;\r\n\r\n @prop({ type: String, enum: Status, default: Status.ACTIVE })\r\n public status?: string;\r\n\r\n @prop({\r\n ref: () => 'adminAccessControls',\r\n foreignField: \"admin\",\r\n localField: \"_id\",\r\n justOne: true, \r\n })\r\n public accessControl: Ref<AdminAccessControl>;\r\n}\r\n\r\nexport const AdminModel: ReturnModelType<typeof Admin> =\r\n getModelForClass(Admin);\r\n"]}
|
package/package.json
CHANGED