@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.
@@ -1,8 +1,8 @@
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";
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"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CAAC,QAAQ,CAAC,CAAA;QACrD,CAAC;QACD,IAAI,EAAE,CAAA;IACV,CAAC,CAAC;IACD,IAAA,eAAG,EAAkC,kBAAkB,EAAE,KAAK,WAAW,IAAI;QAC1E,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAyB,CAAA;QACtD,IAAG,MAAM,EAAE,QAAQ,EAAE,CAAC;YAClB,MAAM,CAAC,QAAQ,GAAG,MAAM,IAAA,uBAAY,EAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;YACrD,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;QAC1B,CAAC;QACD,IAAI,EAAE,CAAA;IACV,CAAC,CAAC;IACD,IAAA,iBAAK,EAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAC,CAAC;IAClF,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,sBAAsB,EAAC,EAAC,CAAC;GACzD,mBAAmB,CAkB/B","sourcesContent":["import { index, modelOptions, pre, prop, Ref } from \"@typegoose/typegoose\";\nimport { TimeStamps } from \"@typegoose/typegoose/lib/defaultClasses\";\nimport { Vendor } from \"./vendor.model\";\nimport { 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 if (this.isModified('password')) {\n this.password = await hashPassword(this.password)\n }\n next()\n})\n@pre<Query<any, VendorAccessControl>>('findOneAndUpdate', async function (next) {\n const update = this.getUpdate() as Record<string, any>\n if(update?.password) {\n update.password = await hashPassword(update.password)\n this.setUpdate(update)\n }\n next()\n})\n@index({ email: 1 }, { unique: true, partialFilterExpression: { deletedAt: null }})\n@modelOptions({ schemaOptions: { collection: 'vendorAccessControls'}})\nexport class VendorAccessControl extends TimeStamps {\n @prop({ required: true, type: String, maxlength: 50})\n public name!: string\n\n @prop({ required: true, type: String })\n public email!: string\n\n @prop({ required: true, type: String, minlength: 8 })\n public password!: string\n\n @prop({ required: true, ref: () => VendorParent })\n public parent?: Ref<VendorParent>\n\n @prop({ ref: () => Vendor, default: []})\n public vendors?: Ref<Vendor>[]\n\n @prop({ required: true, type: String, enum: VendorRole }) \n public role!: VendorRole\n}"]}
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;AAGlB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,kCAAY,EAAE,CAAC;;mDAChB;AAG3B;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,qBAAM,EAAE,OAAO,E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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"]}
@@ -22,7 +22,7 @@ Perfect for sharing types between frontend and backend applications.
22
22
 
23
23
  ## Version
24
24
 
25
- Version: 1.4.11
25
+ Version: 1.4.12
26
26
 
27
27
  ## Dependencies
28
28
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/types",
3
- "version": "1.4.11",
3
+ "version": "1.4.12",
4
4
  "description": "Lyxa type definitions and validation schemas for both frontend and backend",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/core",
3
- "version": "1.4.11",
3
+ "version": "1.4.12",
4
4
  "description": "The Core system of the Lyxa services.",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",