@lyxa.ai/core 1.4.11 → 1.4.12
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/vendor-access-control.model.d.ts +6 -5
- package/dist/libraries/mongo/models/vendor-access-control.model.js +5 -0
- package/dist/libraries/mongo/models/vendor-access-control.model.js.map +1 -1
- package/dist/types/README.md +1 -1
- package/dist/types/package.json +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Ref } from
|
|
2
|
-
import { TimeStamps } from
|
|
3
|
-
import { Vendor } from
|
|
4
|
-
import { VendorRole } from
|
|
5
|
-
import { VendorParent } from
|
|
1
|
+
import { Ref } from '@typegoose/typegoose';
|
|
2
|
+
import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
|
|
3
|
+
import { Vendor } from './vendor.model';
|
|
4
|
+
import { VendorRole } from '../../../utilities/enum';
|
|
5
|
+
import { VendorParent } from './vendor-parent.model';
|
|
6
6
|
export declare class VendorAccessControl extends TimeStamps {
|
|
7
7
|
name: string;
|
|
8
8
|
email: string;
|
|
@@ -10,4 +10,5 @@ export declare class VendorAccessControl extends TimeStamps {
|
|
|
10
10
|
parent?: Ref<VendorParent>;
|
|
11
11
|
vendors?: Ref<Vendor>[];
|
|
12
12
|
role: VendorRole;
|
|
13
|
+
status?: string;
|
|
13
14
|
}
|
|
@@ -23,6 +23,7 @@ let VendorAccessControl = class VendorAccessControl extends defaultClasses_1.Tim
|
|
|
23
23
|
parent;
|
|
24
24
|
vendors;
|
|
25
25
|
role;
|
|
26
|
+
status;
|
|
26
27
|
};
|
|
27
28
|
exports.VendorAccessControl = VendorAccessControl;
|
|
28
29
|
__decorate([
|
|
@@ -49,6 +50,10 @@ __decorate([
|
|
|
49
50
|
(0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.VendorRole }),
|
|
50
51
|
__metadata("design:type", String)
|
|
51
52
|
], VendorAccessControl.prototype, "role", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typegoose_1.prop)({ type: String, enum: enum_1.Status, default: enum_1.Status.ACTIVE }),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], VendorAccessControl.prototype, "status", void 0);
|
|
52
57
|
exports.VendorAccessControl = VendorAccessControl = __decorate([
|
|
53
58
|
(0, typegoose_1.pre)('save', async function (next) {
|
|
54
59
|
if (this.isModified('password')) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vendor-access-control.model.js","sourceRoot":"/","sources":["libraries/mongo/models/vendor-access-control.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2E;AAC3E,4EAAqE;AACrE,iDAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"vendor-access-control.model.js","sourceRoot":"/","sources":["libraries/mongo/models/vendor-access-control.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2E;AAC3E,4EAAqE;AACrE,iDAAwC;AACxC,kDAA6D;AAC7D,0DAA2D;AAE3D,+DAAqD;AAkB9C,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,2BAAU;IAE3C,IAAI,CAAU;IAGd,KAAK,CAAU;IAGf,QAAQ,CAAU;IAGlB,MAAM,CAAqB;IAG3B,OAAO,CAAiB;IAGxB,IAAI,CAAc;IAGlB,MAAM,CAAU;CACvB,CAAA;AArBY,kDAAmB;AAExB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;;iDACjC;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;kDACjB;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;;qDAC5B;AA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EAAE,IAAI,EAAE,EAAE,CAAC;IACnF,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,sBAAsB,EAAE,EAAE,CAAC;GAC3D,mBAAmB,CAqB/B","sourcesContent":["import { index, modelOptions, pre, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { Vendor } from './vendor.model';\nimport { Status, VendorRole } from '../../../utilities/enum';\nimport { hashPassword } from '../../../utilities/password';\nimport { Query } from 'mongoose';\nimport { VendorParent } from './vendor-parent.model';\n\n@pre<VendorAccessControl>('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, VendorAccessControl>>('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@index({ email: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@modelOptions({ schemaOptions: { collection: 'vendorAccessControls' } })\nexport class VendorAccessControl extends TimeStamps {\n\t@prop({ required: true, type: String, maxlength: 50 })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic email!: string;\n\n\t@prop({ required: true, type: String, minlength: 8 })\n\tpublic password!: string;\n\n\t@prop({ required: true, ref: () => VendorParent })\n\tpublic parent?: Ref<VendorParent>;\n\n\t@prop({ ref: () => Vendor, default: [] })\n\tpublic vendors?: Ref<Vendor>[];\n\n\t@prop({ required: true, type: String, enum: VendorRole })\n\tpublic role!: VendorRole;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status?: string;\n}\n"]}
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED