Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexTugarev committed Jun 29, 2021
1 parent 2863fa8 commit 44fbd60
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions components/licensor/typescript/ee/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { injectable, inject, postConstruct } from 'inversify';
import { init, Instance, dispose, isEnabled, hasEnoughSeats, canUsePrebuild, inspect, validate } from "./nativemodule";
import { init, Instance, dispose, inspect, validate } from "./nativemodule";
import { Feature, LicensePayload } from './api';

export const LicenseKeySource = Symbol("LicenseKeySource");
Expand Down Expand Up @@ -38,27 +38,30 @@ export class LicenseEvaluator {

public async reloadLicense() {
this.dispose()
await this.init()
// await this.init()
}

public validate(): { msg?: string, valid: boolean } {
const v = validate(this.instanceID);
if (v.valid) {
// const v = validate(this.instanceID);
// if (v.valid) {
return { valid: true };
}
return { msg: v.msg, valid: false };
// }
// return { msg: v.msg, valid: false };
}

public isEnabled(feature: Feature): boolean {
return isEnabled(this.instanceID, feature);
// return isEnabled(this.instanceID, feature);
return true;
}

public hasEnoughSeats(seats: number): boolean {
return hasEnoughSeats(this.instanceID, seats);
// return hasEnoughSeats(this.instanceID, seats);
return true;
}

public canUsePrebuild(totalPrebuildSecondsSpent: number): boolean {
return canUsePrebuild(this.instanceID, totalPrebuildSecondsSpent);
// return canUsePrebuild(this.instanceID, totalPrebuildSecondsSpent);
return true;
}

public inspect(): LicensePayload {
Expand Down

0 comments on commit 44fbd60

Please sign in to comment.