Updated the License.ts model
This commit is contained in:
parent
f77ff6f03f
commit
69b5c129b7
@ -19,6 +19,8 @@ export interface ILicense {
|
||||
groups?: string[],
|
||||
permissions?: string[],
|
||||
meta?: ILicenseMeta[],
|
||||
maxUses: number,
|
||||
currentUses: number,
|
||||
expirationDate?: Date
|
||||
}
|
||||
|
||||
@ -34,6 +36,14 @@ const LicenseSchema = new Schema<ILicense>({
|
||||
groups: [String],
|
||||
permissions: [String],
|
||||
meta: [Array],
|
||||
maxUses: {
|
||||
type: Number,
|
||||
default: -1
|
||||
},
|
||||
currentUses: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
expirationDate: {
|
||||
type: Date,
|
||||
default: Date.now
|
||||
@ -41,7 +51,7 @@ const LicenseSchema = new Schema<ILicense>({
|
||||
});
|
||||
|
||||
LicenseSchema.plugin(fieldEncryption, {
|
||||
fields: ["projectId", "key", "groups", "permissions", "meta", "expirationDate"],
|
||||
fields: ["projectId", "key", "groups", "permissions", "meta", "maxUses", "currentUses", "expirationDate"],
|
||||
secret: process.env.ENC_KEY,
|
||||
saltGenerator: () => process.env.SIG_KEY
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user