@sdux-vault/engine 0.2.0 → 0.4.0

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.
@@ -11,7 +11,7 @@ import { EventBus, initDevtoolsWidget } from '@sdux-vault/devtools';
11
11
  // cmd+alt+j (see .vscode/keybindings.json)
12
12
  // --- END AI MODEL FILE PATH ---
13
13
  const SDUX_PACKAGE = '@sdux-vault/engine';
14
- const SDUX_VERSION = '0.2.0';
14
+ const SDUX_VERSION = '0.4.0';
15
15
  registerVersion(SDUX_PACKAGE, SDUX_VERSION);
16
16
 
17
17
  /**
@@ -1584,6 +1584,7 @@ class VaultCoreInstance {
1584
1584
  #validaionSub;
1585
1585
  #licenseMap = new Map();
1586
1586
  #terminalStatus = new Map();
1587
+ #bypassLicensing = true;
1587
1588
  #licenseTimeoutMs;
1588
1589
  // eslint-disable-next-line
1589
1590
  #licenseTimers = new Map();
@@ -1622,6 +1623,7 @@ class VaultCoreInstance {
1622
1623
  this.#vaultConfig = Object.freeze(vaultConfig);
1623
1624
  DevMode.setDevMode(this.#vaultConfig.devMode);
1624
1625
  setVaultLogLevel(this.#vaultConfig.logLevel);
1626
+ this.#bypassLicensing = config.devMode ? (config.bypassLicensing ?? true) : false;
1625
1627
  this.#licenseTimeoutMs = config.licenseTimeoutMs ?? 15_000;
1626
1628
  this.#warnIfAccidentalDevMode();
1627
1629
  }
@@ -1658,6 +1660,9 @@ class VaultCoreInstance {
1658
1660
  getLicensePayload(licenseId) {
1659
1661
  return this.#licenseMap.get(licenseId);
1660
1662
  }
1663
+ isBypassLicensing() {
1664
+ return this.#bypassLicensing;
1665
+ }
1661
1666
  isAuthorizedKey(key) {
1662
1667
  return KNOWN_VAULT_KEYS.has(key);
1663
1668
  }
@@ -1678,7 +1683,7 @@ class VaultCoreInstance {
1678
1683
  #registerEntities(entities) {
1679
1684
  return new Map(entities.map((entity) => {
1680
1685
  let needsLicense;
1681
- if (DevMode.active) {
1686
+ if (this.#bypassLicensing) {
1682
1687
  needsLicense = false;
1683
1688
  }
1684
1689
  else {
@@ -2011,14 +2016,14 @@ function getVaultRegistryForTests() {
2011
2016
  function isAuthorizedKey(key) {
2012
2017
  if (!instance)
2013
2018
  return false;
2014
- if (DevMode.active)
2019
+ if (instance.isBypassLicensing())
2015
2020
  return true;
2016
2021
  return instance.isAuthorizedKey(key);
2017
2022
  }
2018
2023
  function hasVaultLicense() {
2019
2024
  if (!instance)
2020
2025
  return false;
2021
- if (DevMode.active)
2026
+ if (instance.isBypassLicensing())
2022
2027
  return true;
2023
2028
  return instance.hasVaultLicense();
2024
2029
  }
@@ -4200,5 +4205,5 @@ function resetFeatureCellToken() {
4200
4205
  * Generated bundle index. Do not edit.
4201
4206
  */
4202
4207
 
4203
- export { Conductor, FeatureCellClass, LicensingAbstract, VAULT_LICENSE_ID, VaultCore, createFeatureCellToken, getFeatureCellToken, getLicensePayload, getVaultRegistryForTests, hasVaultLicense, isAuthorizedKey, isPipelineTerminal, registerFeatureCell, registerVaultSettled, resetFeatureCellRegistry, resetVaultForTests, vaultAllSettled, vaultSettled };
4208
+ export { Conductor, FeatureCellClass, LicensingAbstract, VAULT_LICENSE_ID, VaultCore, createFeatureCellToken, getFeatureCellToken, getLicensePayload, getVaultRegistryForTests, hasVaultLicense, isAuthorizedKey, registerFeatureCell, registerVaultSettled, resetFeatureCellRegistry, resetVaultForTests, vaultAllSettled, vaultSettled };
4204
4209
  //# sourceMappingURL=sdux-vault-engine.mjs.map