@licensespring/node-sdk 1.1.18 → 1.2.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.
Files changed (66) hide show
  1. package/License.key +1 -0
  2. package/dist/package.json +16 -9
  3. package/dist/src/abstract-manager.d.ts +42 -15
  4. package/dist/src/abstract-manager.js +248 -22
  5. package/dist/src/abstract-manager.js.map +1 -1
  6. package/dist/src/api.d.ts +25 -4978
  7. package/dist/src/api.js +1596 -4511
  8. package/dist/src/api.js.map +1 -1
  9. package/dist/src/bundle-file.d.ts +11 -0
  10. package/dist/src/bundle-file.js +110 -0
  11. package/dist/src/bundle-file.js.map +1 -0
  12. package/dist/src/bundle-manager.d.ts +17 -0
  13. package/dist/src/bundle-manager.js +252 -0
  14. package/dist/src/bundle-manager.js.map +1 -0
  15. package/dist/src/common.d.ts +1 -0
  16. package/dist/src/common.js +5 -1
  17. package/dist/src/common.js.map +1 -1
  18. package/dist/src/index.d.ts +2 -1
  19. package/dist/src/index.js +3 -1
  20. package/dist/src/index.js.map +1 -1
  21. package/dist/src/license-data.d.ts +13 -7
  22. package/dist/src/license-data.js +66 -71
  23. package/dist/src/license-data.js.map +1 -1
  24. package/dist/src/license-file.d.ts +8 -19
  25. package/dist/src/license-file.js +38 -315
  26. package/dist/src/license-file.js.map +1 -1
  27. package/dist/src/license-manager.d.ts +23 -32
  28. package/dist/src/license-manager.js +213 -313
  29. package/dist/src/license-manager.js.map +1 -1
  30. package/dist/src/license.d.ts +16 -15
  31. package/dist/src/license.js +145 -142
  32. package/dist/src/license.js.map +1 -1
  33. package/dist/src/logger.d.ts +1 -0
  34. package/dist/src/logger.js +28 -5
  35. package/dist/src/logger.js.map +1 -1
  36. package/dist/src/offline-activation.d.ts +2 -1
  37. package/dist/src/offline-activation.js.map +1 -1
  38. package/dist/src/response-types.d.ts +489 -0
  39. package/dist/src/response-types.js +12 -0
  40. package/dist/src/response-types.js.map +1 -0
  41. package/dist/src/schema.d.ts +4 -2
  42. package/dist/src/schema.js +6 -2
  43. package/dist/src/schema.js.map +1 -1
  44. package/dist/src/storage-file.d.ts +24 -0
  45. package/dist/src/storage-file.js +354 -0
  46. package/dist/src/storage-file.js.map +1 -0
  47. package/dist/src/test/api-response-mock.d.ts +1435 -0
  48. package/dist/src/test/api-response-mock.js +1966 -0
  49. package/dist/src/test/api-response-mock.js.map +1 -0
  50. package/dist/src/test/api.test.d.ts +1 -0
  51. package/dist/src/test/api.test.js +228 -0
  52. package/dist/src/test/api.test.js.map +1 -0
  53. package/dist/src/test/bundle-manager.test.d.ts +0 -0
  54. package/dist/src/test/bundle-manager.test.js +15 -0
  55. package/dist/src/test/bundle-manager.test.js.map +1 -0
  56. package/dist/src/test/jest.setup.d.ts +1 -0
  57. package/dist/src/test/jest.setup.js +17 -0
  58. package/dist/src/test/jest.setup.js.map +1 -0
  59. package/dist/src/test/license-manager.test.d.ts +1 -0
  60. package/dist/src/test/license-manager.test.js +1011 -0
  61. package/dist/src/test/license-manager.test.js.map +1 -0
  62. package/dist/src/types.d.ts +35 -219
  63. package/dist/src/types.js.map +1 -1
  64. package/dist/src/watchdog.js +1 -1
  65. package/dist/src/watchdog.js.map +1 -1
  66. package/package.json +16 -9
@@ -73,96 +73,128 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
73
73
  return (mod && mod.__esModule) ? mod : { "default": mod };
74
74
  };
75
75
  Object.defineProperty(exports, "__esModule", { value: true });
76
- const typia_1 = __importDefault(require("typia"));
77
- const dayjs_1 = __importDefault(require("dayjs"));
78
- const utc_js_1 = __importDefault(require("dayjs/plugin/utc.js"));
79
- const isSameOrAfter_js_1 = __importDefault(require("dayjs/plugin/isSameOrAfter.js"));
80
- const abstract_manager_1 = __importDefault(require("./abstract-manager"));
81
- const path = __importStar(require("node:path"));
76
+ const abstract_manager_1 = require("./abstract-manager");
77
+ const logger_1 = require("./logger");
78
+ const common_1 = require("./common");
79
+ const watchdog_1 = require("./watchdog");
82
80
  const fs = __importStar(require("node:fs"));
83
- dayjs_1.default.extend(utc_js_1.default);
84
- dayjs_1.default.extend(isSameOrAfter_js_1.default);
85
- const dotenv = __importStar(require("dotenv"));
86
81
  const license_1 = __importDefault(require("./license"));
87
- const logger_1 = require("./logger");
88
- dotenv.config({ path: path.join(__dirname, `../.env.${process.env.NODE_ENV || 'prod'}`) });
82
+ const license_file_1 = __importDefault(require("./license-file"));
83
+ const typia_1 = __importDefault(require("typia"));
89
84
  let LicenseManager = (() => {
90
85
  let _classDecorators = [logger_1.LogAllCalls];
91
86
  let _classDescriptor;
92
87
  let _classExtraInitializers = [];
93
88
  let _classThis;
94
- let _classSuper = abstract_manager_1.default;
89
+ let _classSuper = abstract_manager_1.AbstractManager;
95
90
  var LicenseManager = _classThis = class extends _classSuper {
96
- checkLicenseStatus(license) {
97
- if (!license.license_enabled) {
98
- throw { status: 400, code: 'license_not_enabled', message: 'The license is not enabled' };
99
- }
100
- if (!license.license_active) {
101
- throw { status: 400, code: 'license_not_active', message: 'The license is not active' };
102
- }
103
- if (license.validity_period) {
104
- if ((0, dayjs_1.default)().utc().startOf('day').isSameOrAfter(license.validity_period)) {
105
- throw { status: 400, code: 'license_expired', message: 'The license is expired' };
106
- }
107
- }
108
- }
109
- isValid(license) {
110
- if (!license.license_enabled) {
111
- return false;
112
- }
113
- if (!license.license_active) {
114
- return false;
115
- }
116
- if (license.validity_period) {
117
- if ((0, dayjs_1.default)().utc().startOf('day').isSameOrAfter(license.validity_period)) {
118
- return false;
119
- }
120
- }
121
- return true;
122
- }
123
- maintenanceDaysRemaining(license) {
124
- if (license.enable_maintenance_period) {
125
- return (0, dayjs_1.default)(license.maintenance_period).utc().endOf('day').diff((0, dayjs_1.default)().utc().startOf('day'), 'day');
126
- }
127
- return null;
91
+ constructor(config, hardwareIDMethod = 0) {
92
+ super(config, hardwareIDMethod);
93
+ this.hardwareIDMethod = hardwareIDMethod;
94
+ this.licenseFile = new license_file_1.default(this.config, this.licenseAPI.getHardwareID(hardwareIDMethod));
95
+ this.watchdog = new watchdog_1.Watchdog(new license_1.default(this.config.productCode, this.licenseAPI, this.licenseFile, this.floatingAPI));
128
96
  }
129
- daysRemaining(license) {
130
- if (license.validity_period) {
131
- return (0, dayjs_1.default)(license.validity_period).utc().add(license.grace_period || 0, 'hours').endOf('day').diff((0, dayjs_1.default)().utc().startOf('day'), 'day');
132
- }
97
+ loadLicense() {
98
+ this.licenseFile.loadLicenseFile();
99
+ return new license_1.default(this.config.productCode, this.licenseAPI, this.licenseFile, this.floatingAPI);
133
100
  }
134
101
  checkLicense(payload) {
135
102
  return __awaiter(this, void 0, void 0, function* () {
136
- (() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
137
- const value = input[key];
138
- if (undefined === value)
139
- return true;
140
- return true;
141
- }); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
142
- const value = input[key];
143
- if (undefined === value)
144
- return true;
145
- return true;
146
- }); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
103
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => (undefined === input.license_key || "string" === typeof input.license_key) && (undefined === input.username || "string" === typeof input.username) && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.env || "string" === typeof input.env) && (undefined === input.license_id || "number" === typeof input.license_id) && (undefined === input.sdk_ver || "string" === typeof input.sdk_ver) && (undefined === input.app_ver || "string" === typeof input.app_ver) && (undefined === input.hostname || "string" === typeof input.hostname) && (undefined === input.os_hostname || "string" === typeof input.os_hostname) && (undefined === input.ip_local || "string" === typeof input.ip_local) && (undefined === input.mac_address || "string" === typeof input.mac_address) && (undefined === input.ip || "string" === typeof input.ip) && (undefined === input.os_ver || "string" === typeof input.os_ver) && (undefined === input.channel || "string" === typeof input.channel); const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.license_key || "string" === typeof input.license_key || $guard(_exceptionable, {
104
+ path: _path + ".license_key",
105
+ expected: "(string | undefined)",
106
+ value: input.license_key
107
+ }, _errorFactory)) && (undefined === input.username || "string" === typeof input.username || $guard(_exceptionable, {
108
+ path: _path + ".username",
109
+ expected: "(string | undefined)",
110
+ value: input.username
111
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
112
+ path: _path + ".bundle_code",
113
+ expected: "(string | undefined)",
114
+ value: input.bundle_code
115
+ }, _errorFactory)) && (undefined === input.env || "string" === typeof input.env || $guard(_exceptionable, {
116
+ path: _path + ".env",
117
+ expected: "(string | undefined)",
118
+ value: input.env
119
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
120
+ path: _path + ".license_id",
121
+ expected: "(number | undefined)",
122
+ value: input.license_id
123
+ }, _errorFactory)) && (undefined === input.sdk_ver || "string" === typeof input.sdk_ver || $guard(_exceptionable, {
124
+ path: _path + ".sdk_ver",
125
+ expected: "(string | undefined)",
126
+ value: input.sdk_ver
127
+ }, _errorFactory)) && (undefined === input.app_ver || "string" === typeof input.app_ver || $guard(_exceptionable, {
128
+ path: _path + ".app_ver",
129
+ expected: "(string | undefined)",
130
+ value: input.app_ver
131
+ }, _errorFactory)) && (undefined === input.hostname || "string" === typeof input.hostname || $guard(_exceptionable, {
132
+ path: _path + ".hostname",
133
+ expected: "(string | undefined)",
134
+ value: input.hostname
135
+ }, _errorFactory)) && (undefined === input.os_hostname || "string" === typeof input.os_hostname || $guard(_exceptionable, {
136
+ path: _path + ".os_hostname",
137
+ expected: "(string | undefined)",
138
+ value: input.os_hostname
139
+ }, _errorFactory)) && (undefined === input.ip_local || "string" === typeof input.ip_local || $guard(_exceptionable, {
140
+ path: _path + ".ip_local",
141
+ expected: "(string | undefined)",
142
+ value: input.ip_local
143
+ }, _errorFactory)) && (undefined === input.mac_address || "string" === typeof input.mac_address || $guard(_exceptionable, {
144
+ path: _path + ".mac_address",
145
+ expected: "(string | undefined)",
146
+ value: input.mac_address
147
+ }, _errorFactory)) && (undefined === input.ip || "string" === typeof input.ip || $guard(_exceptionable, {
148
+ path: _path + ".ip",
149
+ expected: "(string | undefined)",
150
+ value: input.ip
151
+ }, _errorFactory)) && (undefined === input.os_ver || "string" === typeof input.os_ver || $guard(_exceptionable, {
152
+ path: _path + ".os_ver",
153
+ expected: "(string | undefined)",
154
+ value: input.os_ver
155
+ }, _errorFactory)) && (undefined === input.channel || "string" === typeof input.channel || $guard(_exceptionable, {
156
+ path: _path + ".channel",
157
+ expected: "(string | undefined)",
158
+ value: input.channel
159
+ }, _errorFactory)); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
147
160
  if (false === __is(input)) {
148
161
  _errorFactory = errorFactory;
149
162
  ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
150
163
  path: _path + "",
151
- expected: "Managed<{ [x: string]: unknown; channel?: string | undefined; username?: string | undefined; env?: string | undefined; hostname?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; ... 9 more ...; license_key: string; } | { ...; }>",
164
+ expected: "Managed<{ username?: string | undefined; bundle_code?: string | undefined; env?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; app_ver?: string | undefined; ... 9 more ...; product: string; } | { ...; }>",
152
165
  value: input
153
166
  }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
154
167
  path: _path + "",
155
- expected: "Managed<{ [x: string]: unknown; channel?: string | undefined; username?: string | undefined; env?: string | undefined; hostname?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; ... 9 more ...; license_key: string; } | { ...; }>",
168
+ expected: "Managed<{ username?: string | undefined; bundle_code?: string | undefined; env?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; app_ver?: string | undefined; ... 9 more ...; product: string; } | { ...; }>",
156
169
  value: input
157
170
  }, _errorFactory))(input, "$input", true);
158
171
  }
159
172
  return input;
160
173
  }; })()(payload);
161
- const response = yield this.licenseAPI.checkLicense(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
162
- this.checkLicenseStatus(response);
163
- this.licenseFile.licenseDataCache.updateCache('check_license', response);
164
- this.licenseFile.saveLicenseFile();
165
- return response;
174
+ try {
175
+ const response = yield this.licenseAPI.checkLicense(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
176
+ this.checkLicenseStatus(response);
177
+ this.licenseFile.licenseDataCache[this.config.productCode].updateCheckData(response);
178
+ this.licenseFile.saveLicenseFile();
179
+ return response;
180
+ }
181
+ catch (error) {
182
+ if ((0, common_1.unknownHasProperty)(error, 'code')) {
183
+ const response = {};
184
+ if (error.code == 'license_not_enabled') {
185
+ response.license_enabled = false;
186
+ }
187
+ else if (error.code == 'license_not_active') {
188
+ response.license_active = false;
189
+ }
190
+ else if (error.code == 'license_expired') {
191
+ response.is_expired = true;
192
+ }
193
+ this.licenseFile.licenseDataCache[this.config.productCode].updateCheckData(response);
194
+ this.licenseFile.saveLicenseFile();
195
+ }
196
+ throw error;
197
+ }
166
198
  });
167
199
  }
168
200
  ;
@@ -183,18 +215,18 @@ let LicenseManager = (() => {
183
215
  _errorFactory = errorFactory;
184
216
  ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
185
217
  path: _path + "",
186
- expected: "Managed<{ [x: string]: unknown; code?: string | undefined; username?: string | undefined; password?: string | undefined; id_token?: string | undefined; customer_account_code?: string | undefined; ... 4 more ...; license_key: string; } | { ...; } | { ...; } | { ...; }>",
218
+ expected: "Managed<{ [x: string]: unknown; username?: string | undefined; password?: string | undefined; id_token?: string | undefined; code?: string | undefined; customer_account_code?: string | undefined; ... 4 more ...; product: string; } | { ...; } | { ...; } | { ...; }>",
187
219
  value: input
188
220
  }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
189
221
  path: _path + "",
190
- expected: "Managed<{ [x: string]: unknown; code?: string | undefined; username?: string | undefined; password?: string | undefined; id_token?: string | undefined; customer_account_code?: string | undefined; ... 4 more ...; license_key: string; } | { ...; } | { ...; } | { ...; }>",
222
+ expected: "Managed<{ [x: string]: unknown; username?: string | undefined; password?: string | undefined; id_token?: string | undefined; code?: string | undefined; customer_account_code?: string | undefined; ... 4 more ...; product: string; } | { ...; } | { ...; } | { ...; }>",
191
223
  value: input
192
224
  }, _errorFactory))(input, "$input", true);
193
225
  }
194
226
  return input;
195
227
  }; })()(payload);
196
228
  const response = yield this.licenseAPI.activateLicense(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
197
- this.licenseFile.licenseDataCache.updateCache('activate_license', response);
229
+ this.licenseFile.licenseDataCache[this.config.productCode].updateActivationData(response);
198
230
  this.licenseFile.saveLicenseFile();
199
231
  return response;
200
232
  });
@@ -202,33 +234,35 @@ let LicenseManager = (() => {
202
234
  ;
203
235
  deactivateLicense(payload) {
204
236
  return __awaiter(this, void 0, void 0, function* () {
205
- (() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
206
- const value = input[key];
207
- if (undefined === value)
208
- return true;
209
- return true;
210
- }); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
211
- const value = input[key];
212
- if (undefined === value)
213
- return true;
214
- return true;
215
- }); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
237
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => (undefined === input.license_key || "string" === typeof input.license_key) && (undefined === input.username || "string" === typeof input.username) && (undefined === input.bundle_code || "string" === typeof input.bundle_code); const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.license_key || "string" === typeof input.license_key || $guard(_exceptionable, {
238
+ path: _path + ".license_key",
239
+ expected: "(string | undefined)",
240
+ value: input.license_key
241
+ }, _errorFactory)) && (undefined === input.username || "string" === typeof input.username || $guard(_exceptionable, {
242
+ path: _path + ".username",
243
+ expected: "(string | undefined)",
244
+ value: input.username
245
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
246
+ path: _path + ".bundle_code",
247
+ expected: "(string | undefined)",
248
+ value: input.bundle_code
249
+ }, _errorFactory)); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
216
250
  if (false === __is(input)) {
217
251
  _errorFactory = errorFactory;
218
252
  ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
219
253
  path: _path + "",
220
- expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; product: string; hardware_id: string; license_key: string; } | { [x: string]: unknown; license_key?: string | undefined; bundle_code?: string | undefined; product: string; username: string; hardware_id: string; }>",
254
+ expected: "Managed<{ username?: string | undefined; bundle_code?: string | undefined; license_key: string; hardware_id: string; product: string; } | { license_key?: string | undefined; bundle_code?: string | undefined; username: string; hardware_id: string; product: string; }>",
221
255
  value: input
222
256
  }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
223
257
  path: _path + "",
224
- expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; product: string; hardware_id: string; license_key: string; } | { [x: string]: unknown; license_key?: string | undefined; bundle_code?: string | undefined; product: string; username: string; hardware_id: string; }>",
258
+ expected: "Managed<{ username?: string | undefined; bundle_code?: string | undefined; license_key: string; hardware_id: string; product: string; } | { license_key?: string | undefined; bundle_code?: string | undefined; username: string; hardware_id: string; product: string; }>",
225
259
  value: input
226
260
  }, _errorFactory))(input, "$input", true);
227
261
  }
228
262
  return input;
229
263
  }; })()(payload);
230
264
  const response = yield this.licenseAPI.deactivateLicense(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
231
- this.licenseFile.licenseDataCache.deactivate();
265
+ this.licenseFile.licenseDataCache[this.config.productCode].deactivate();
232
266
  this.licenseFile.saveLicenseFile();
233
267
  return response;
234
268
  });
@@ -236,13 +270,13 @@ let LicenseManager = (() => {
236
270
  ;
237
271
  activateOffline(payload) {
238
272
  const response = this.licenseAPI.checkOfflineActivationResponse(payload);
239
- this.licenseFile.licenseDataCache.updateCache('activate_license_offline', response);
273
+ this.licenseFile.licenseDataCache[this.config.productCode].updateActivationData(response);
240
274
  this.licenseFile.saveLicenseFile();
241
275
  return response;
242
276
  }
243
277
  ;
244
278
  deactivateOffline() {
245
- this.licenseFile.licenseDataCache.deactivate();
279
+ this.licenseFile.licenseDataCache[this.config.productCode].deactivate();
246
280
  this.licenseFile.saveLicenseFile();
247
281
  }
248
282
  ;
@@ -274,7 +308,7 @@ let LicenseManager = (() => {
274
308
  return input;
275
309
  }; })()(payload);
276
310
  const response = yield this.licenseAPI.getTrialKey(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
277
- this.licenseFile.licenseDataCache.updateCache('activate_license', response);
311
+ this.licenseFile.licenseDataCache[this.config.productCode].updateActivationData(response);
278
312
  this.licenseFile.saveLicenseFile();
279
313
  return response;
280
314
  });
@@ -297,11 +331,11 @@ let LicenseManager = (() => {
297
331
  _errorFactory = errorFactory;
298
332
  ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
299
333
  path: _path + "",
300
- expected: "Managed<{ [x: string]: unknown; code?: string | undefined; product?: string | undefined; id_token?: string | undefined; customer_account_code?: string | undefined; username: string; password: string; } | { ...; } | { ...; }>",
334
+ expected: "Managed<{ [x: string]: unknown; product?: string | undefined; id_token?: string | undefined; code?: string | undefined; customer_account_code?: string | undefined; username: string; password: string; } | { ...; } | { ...; }>",
301
335
  value: input
302
336
  }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
303
337
  path: _path + "",
304
- expected: "Managed<{ [x: string]: unknown; code?: string | undefined; product?: string | undefined; id_token?: string | undefined; customer_account_code?: string | undefined; username: string; password: string; } | { ...; } | { ...; }>",
338
+ expected: "Managed<{ [x: string]: unknown; product?: string | undefined; id_token?: string | undefined; code?: string | undefined; customer_account_code?: string | undefined; username: string; password: string; } | { ...; } | { ...; }>",
305
339
  value: input
306
340
  }, _errorFactory))(input, "$input", true);
307
341
  }
@@ -359,11 +393,11 @@ let LicenseManager = (() => {
359
393
  _errorFactory = errorFactory;
360
394
  ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
361
395
  path: _path + "",
362
- expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; include_metadata_string?: boolean | undefined; product: string; hardware_id: string; license_key: string; feature: string; } | { ...; }>",
396
+ expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; include_metadata_string?: boolean | undefined; license_key: string; hardware_id: string; product: string; feature: string; } | { ...; }>",
363
397
  value: input
364
398
  }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
365
399
  path: _path + "",
366
- expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; include_metadata_string?: boolean | undefined; product: string; hardware_id: string; license_key: string; feature: string; } | { ...; }>",
400
+ expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; include_metadata_string?: boolean | undefined; license_key: string; hardware_id: string; product: string; feature: string; } | { ...; }>",
367
401
  value: input
368
402
  }, _errorFactory))(input, "$input", true);
369
403
  }
@@ -390,18 +424,18 @@ let LicenseManager = (() => {
390
424
  _errorFactory = errorFactory;
391
425
  ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
392
426
  path: _path + "",
393
- expected: "Managed<{ [x: string]: unknown; username?: string | undefined; event?: (\"consumption_add\" | \"offline_floating_consumptions_sync\")[] | undefined; allow_overages?: boolean | undefined; max_overages?: number | undefined; ... 7 more ...; consumptions: number; } | { ...; }>",
427
+ expected: "Managed<{ [x: string]: unknown; username?: string | undefined; allow_overages?: boolean | undefined; max_overages?: number | undefined; bundle_code?: string | undefined; license_id?: number | undefined; ... 6 more ...; consumptions: number; } | { ...; }>",
394
428
  value: input
395
429
  }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
396
430
  path: _path + "",
397
- expected: "Managed<{ [x: string]: unknown; username?: string | undefined; event?: (\"consumption_add\" | \"offline_floating_consumptions_sync\")[] | undefined; allow_overages?: boolean | undefined; max_overages?: number | undefined; ... 7 more ...; consumptions: number; } | { ...; }>",
431
+ expected: "Managed<{ [x: string]: unknown; username?: string | undefined; allow_overages?: boolean | undefined; max_overages?: number | undefined; bundle_code?: string | undefined; license_id?: number | undefined; ... 6 more ...; consumptions: number; } | { ...; }>",
398
432
  value: input
399
433
  }, _errorFactory))(input, "$input", true);
400
434
  }
401
435
  return input;
402
436
  }; })()(payload);
403
437
  const response = yield this.licenseAPI.addConsumption(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
404
- this.licenseFile.licenseDataCache.updateCache('license_consumption', response);
438
+ this.licenseFile.licenseDataCache[this.config.productCode].updateLocalConsumptionsData(response);
405
439
  this.licenseFile.saveLicenseFile();
406
440
  return response;
407
441
  });
@@ -409,33 +443,63 @@ let LicenseManager = (() => {
409
443
  ;
410
444
  addFeatureConsumption(payload) {
411
445
  return __awaiter(this, void 0, void 0, function* () {
412
- (() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
413
- const value = input[key];
414
- if (undefined === value)
415
- return true;
416
- return true;
417
- }); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
418
- const value = input[key];
419
- if (undefined === value)
420
- return true;
421
- return true;
422
- }); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
446
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => (undefined === input.license_key || "string" === typeof input.license_key) && (undefined === input.username || "string" === typeof input.username) && "string" === typeof input.feature && "number" === typeof input.consumptions && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id) && (undefined === input.sdk_ver || "string" === typeof input.sdk_ver) && (undefined === input.event || Array.isArray(input.event) && input.event.every(elem => "consumption_add" === elem || "offline_floating_consumptions_sync" === elem)); const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.license_key || "string" === typeof input.license_key || $guard(_exceptionable, {
447
+ path: _path + ".license_key",
448
+ expected: "(string | undefined)",
449
+ value: input.license_key
450
+ }, _errorFactory)) && (undefined === input.username || "string" === typeof input.username || $guard(_exceptionable, {
451
+ path: _path + ".username",
452
+ expected: "(string | undefined)",
453
+ value: input.username
454
+ }, _errorFactory)) && ("string" === typeof input.feature || $guard(_exceptionable, {
455
+ path: _path + ".feature",
456
+ expected: "string",
457
+ value: input.feature
458
+ }, _errorFactory)) && ("number" === typeof input.consumptions || $guard(_exceptionable, {
459
+ path: _path + ".consumptions",
460
+ expected: "number",
461
+ value: input.consumptions
462
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
463
+ path: _path + ".bundle_code",
464
+ expected: "(string | undefined)",
465
+ value: input.bundle_code
466
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
467
+ path: _path + ".license_id",
468
+ expected: "(number | undefined)",
469
+ value: input.license_id
470
+ }, _errorFactory)) && (undefined === input.sdk_ver || "string" === typeof input.sdk_ver || $guard(_exceptionable, {
471
+ path: _path + ".sdk_ver",
472
+ expected: "(string | undefined)",
473
+ value: input.sdk_ver
474
+ }, _errorFactory)) && (undefined === input.event || (Array.isArray(input.event) || $guard(_exceptionable, {
475
+ path: _path + ".event",
476
+ expected: "(Array<\"consumption_add\" | \"offline_floating_consumptions_sync\"> | undefined)",
477
+ value: input.event
478
+ }, _errorFactory)) && input.event.every((elem, _index2) => "consumption_add" === elem || "offline_floating_consumptions_sync" === elem || $guard(_exceptionable, {
479
+ path: _path + ".event[" + _index2 + "]",
480
+ expected: "(\"consumption_add\" | \"offline_floating_consumptions_sync\")",
481
+ value: elem
482
+ }, _errorFactory)) || $guard(_exceptionable, {
483
+ path: _path + ".event",
484
+ expected: "(Array<\"consumption_add\" | \"offline_floating_consumptions_sync\"> | undefined)",
485
+ value: input.event
486
+ }, _errorFactory)); const __is = input => "object" === typeof input && null !== input && $io0(input); let _errorFactory; return (input, errorFactory) => {
423
487
  if (false === __is(input)) {
424
488
  _errorFactory = errorFactory;
425
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
489
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
426
490
  path: _path + "",
427
- expected: "Managed<{ [x: string]: unknown; username?: string | undefined; event?: (\"consumption_add\" | \"offline_floating_consumptions_sync\")[] | undefined; bundle_code?: string | undefined; license_id?: number | undefined; ... 5 more ...; consumptions: number; } | { ...; }>",
491
+ expected: "Managed<{ username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; event?: (\"consumption_add\" | \"offline_floating_consumptions_sync\")[] | undefined; ... 4 more ...; consumptions: number; } | { ...; }>",
428
492
  value: input
429
493
  }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
430
494
  path: _path + "",
431
- expected: "Managed<{ [x: string]: unknown; username?: string | undefined; event?: (\"consumption_add\" | \"offline_floating_consumptions_sync\")[] | undefined; bundle_code?: string | undefined; license_id?: number | undefined; ... 5 more ...; consumptions: number; } | { ...; }>",
495
+ expected: "Managed<{ username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; event?: (\"consumption_add\" | \"offline_floating_consumptions_sync\")[] | undefined; ... 4 more ...; consumptions: number; } | { ...; }>",
432
496
  value: input
433
497
  }, _errorFactory))(input, "$input", true);
434
498
  }
435
499
  return input;
436
500
  }; })()(payload);
437
501
  const response = yield this.licenseAPI.addFeatureConsumption(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
438
- this.licenseFile.licenseDataCache.updateCache('feature_consumption', response);
502
+ this.licenseFile.licenseDataCache[this.config.productCode].updateFeatureData(response, payload.feature);
439
503
  this.licenseFile.saveLicenseFile();
440
504
  return response;
441
505
  });
@@ -443,33 +507,46 @@ let LicenseManager = (() => {
443
507
  ;
444
508
  featureRelease(payload) {
445
509
  return __awaiter(this, void 0, void 0, function* () {
446
- (() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
447
- const value = input[key];
448
- if (undefined === value)
449
- return true;
450
- return true;
451
- }); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
452
- const value = input[key];
453
- if (undefined === value)
454
- return true;
455
- return true;
456
- }); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
510
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => (undefined === input.license_key || "string" === typeof input.license_key) && (undefined === input.username || "string" === typeof input.username) && "string" === typeof input.feature && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id) && (undefined === input.sdk_ver || "string" === typeof input.sdk_ver); const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.license_key || "string" === typeof input.license_key || $guard(_exceptionable, {
511
+ path: _path + ".license_key",
512
+ expected: "(string | undefined)",
513
+ value: input.license_key
514
+ }, _errorFactory)) && (undefined === input.username || "string" === typeof input.username || $guard(_exceptionable, {
515
+ path: _path + ".username",
516
+ expected: "(string | undefined)",
517
+ value: input.username
518
+ }, _errorFactory)) && ("string" === typeof input.feature || $guard(_exceptionable, {
519
+ path: _path + ".feature",
520
+ expected: "string",
521
+ value: input.feature
522
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
523
+ path: _path + ".bundle_code",
524
+ expected: "(string | undefined)",
525
+ value: input.bundle_code
526
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
527
+ path: _path + ".license_id",
528
+ expected: "(number | undefined)",
529
+ value: input.license_id
530
+ }, _errorFactory)) && (undefined === input.sdk_ver || "string" === typeof input.sdk_ver || $guard(_exceptionable, {
531
+ path: _path + ".sdk_ver",
532
+ expected: "(string | undefined)",
533
+ value: input.sdk_ver
534
+ }, _errorFactory)); const __is = input => "object" === typeof input && null !== input && $io0(input); let _errorFactory; return (input, errorFactory) => {
457
535
  if (false === __is(input)) {
458
536
  _errorFactory = errorFactory;
459
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
537
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
460
538
  path: _path + "",
461
- expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; product: string; hardware_id: string; license_key: string; feature: string; } | { ...; }>",
539
+ expected: "Managed<{ username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; license_key: string; hardware_id: string; product: string; feature: string; } | { ...; }>",
462
540
  value: input
463
541
  }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
464
542
  path: _path + "",
465
- expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; product: string; hardware_id: string; license_key: string; feature: string; } | { ...; }>",
543
+ expected: "Managed<{ username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; license_key: string; hardware_id: string; product: string; feature: string; } | { ...; }>",
466
544
  value: input
467
545
  }, _errorFactory))(input, "$input", true);
468
546
  }
469
547
  return input;
470
548
  }; })()(payload);
471
549
  const response = yield this.licenseAPI.featureRelease(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
472
- this.licenseFile.licenseDataCache.updateCache('feature_consumption', response);
473
550
  this.licenseFile.saveLicenseFile();
474
551
  return response;
475
552
  });
@@ -503,7 +580,7 @@ let LicenseManager = (() => {
503
580
  return input;
504
581
  }; })()(payload);
505
582
  const response = yield this.licenseAPI.getProductDetails(Object.assign(Object.assign({}, payload), { product: this.config.productCode }));
506
- this.licenseFile.licenseDataCache.updateCache('product_details', response);
583
+ this.licenseFile.licenseDataCache[this.config.productCode].updateResponseData({ product_details: response });
507
584
  this.licenseFile.saveLicenseFile();
508
585
  return response;
509
586
  });
@@ -526,18 +603,18 @@ let LicenseManager = (() => {
526
603
  _errorFactory = errorFactory;
527
604
  ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
528
605
  path: _path + "",
529
- expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; product: string; hardware_id: string; license_key: string; } | { ...; }>",
606
+ expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; license_key: string; hardware_id: string; product: string; } | { ...; }>",
530
607
  value: input
531
608
  }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
532
609
  path: _path + "",
533
- expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; product: string; hardware_id: string; license_key: string; } | { ...; }>",
610
+ expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; license_key: string; hardware_id: string; product: string; } | { ...; }>",
534
611
  value: input
535
612
  }, _errorFactory))(input, "$input", true);
536
613
  }
537
614
  return input;
538
615
  }; })()(payload);
539
616
  const response = yield this.licenseAPI.getDeviceVariables(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
540
- this.licenseFile.licenseDataCache.updateCache('device_variables', response);
617
+ this.licenseFile.licenseDataCache[this.config.productCode].updateResponseData({ variables: response });
541
618
  this.licenseFile.saveLicenseFile();
542
619
  return response;
543
620
  });
@@ -560,18 +637,18 @@ let LicenseManager = (() => {
560
637
  _errorFactory = errorFactory;
561
638
  ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
562
639
  path: _path + "",
563
- expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; variables?: { [x: string]: unknown; } | undefined; product: string; hardware_id: string; license_key: string; } | { ...; }>",
640
+ expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; variables?: { [x: string]: unknown; } | undefined; license_key: string; hardware_id: string; product: string; } | { ...; }>",
564
641
  value: input
565
642
  }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
566
643
  path: _path + "",
567
- expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; variables?: { [x: string]: unknown; } | undefined; product: string; hardware_id: string; license_key: string; } | { ...; }>",
644
+ expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; variables?: { [x: string]: unknown; } | undefined; license_key: string; hardware_id: string; product: string; } | { ...; }>",
568
645
  value: input
569
646
  }, _errorFactory))(input, "$input", true);
570
647
  }
571
648
  return input;
572
649
  }; })()(payload);
573
650
  const response = yield this.licenseAPI.trackDeviceVariables(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
574
- this.licenseFile.licenseDataCache.updateCache('device_variables', response);
651
+ this.licenseFile.licenseDataCache[this.config.productCode].updateResponseData({ variables: response });
575
652
  this.licenseFile.saveLicenseFile();
576
653
  return response;
577
654
  });
@@ -594,11 +671,11 @@ let LicenseManager = (() => {
594
671
  _errorFactory = errorFactory;
595
672
  ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
596
673
  path: _path + "",
597
- expected: "Managed<{ [x: string]: unknown; username?: string | undefined; password?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; product: string; hardware_id: string; license_key: string; borrowed_until: string | null; } | { ...; }>",
674
+ expected: "Managed<{ [x: string]: unknown; username?: string | undefined; password?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; license_key: string; hardware_id: string; product: string; borrowed_until: string | null; } | { ...; }>",
598
675
  value: input
599
676
  }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
600
677
  path: _path + "",
601
- expected: "Managed<{ [x: string]: unknown; username?: string | undefined; password?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; product: string; hardware_id: string; license_key: string; borrowed_until: string | null; } | { ...; }>",
678
+ expected: "Managed<{ [x: string]: unknown; username?: string | undefined; password?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; license_key: string; hardware_id: string; product: string; borrowed_until: string | null; } | { ...; }>",
602
679
  value: input
603
680
  }, _errorFactory))(input, "$input", true);
604
681
  }
@@ -625,11 +702,11 @@ let LicenseManager = (() => {
625
702
  _errorFactory = errorFactory;
626
703
  ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
627
704
  path: _path + "",
628
- expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; product: string; hardware_id: string; license_key: string; } | { ...; }>",
705
+ expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; license_key: string; hardware_id: string; product: string; } | { ...; }>",
629
706
  value: input
630
707
  }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
631
708
  path: _path + "",
632
- expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; product: string; hardware_id: string; license_key: string; } | { ...; }>",
709
+ expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; license_key: string; hardware_id: string; product: string; } | { ...; }>",
633
710
  value: input
634
711
  }, _errorFactory))(input, "$input", true);
635
712
  }
@@ -639,172 +716,6 @@ let LicenseManager = (() => {
639
716
  });
640
717
  }
641
718
  ;
642
- changePassword(payload) {
643
- return __awaiter(this, void 0, void 0, function* () {
644
- (() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => "string" === typeof input.username && "string" === typeof input.password && "string" === typeof input.new_password && Object.keys(input).every(key => {
645
- if (["username", "password", "new_password"].some(prop => key === prop))
646
- return true;
647
- const value = input[key];
648
- if (undefined === value)
649
- return true;
650
- return true;
651
- }); const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.username || $guard(_exceptionable, {
652
- path: _path + ".username",
653
- expected: "string",
654
- value: input.username
655
- }, _errorFactory)) && ("string" === typeof input.password || $guard(_exceptionable, {
656
- path: _path + ".password",
657
- expected: "string",
658
- value: input.password
659
- }, _errorFactory)) && ("string" === typeof input.new_password || $guard(_exceptionable, {
660
- path: _path + ".new_password",
661
- expected: "string",
662
- value: input.new_password
663
- }, _errorFactory)) && (false === _exceptionable || Object.keys(input).every(key => {
664
- if (["username", "password", "new_password"].some(prop => key === prop))
665
- return true;
666
- const value = input[key];
667
- if (undefined === value)
668
- return true;
669
- return true;
670
- })); const __is = input => "object" === typeof input && null !== input && $io0(input); let _errorFactory; return (input, errorFactory) => {
671
- if (false === __is(input)) {
672
- _errorFactory = errorFactory;
673
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
674
- path: _path + "",
675
- expected: "__type",
676
- value: input
677
- }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
678
- path: _path + "",
679
- expected: "__type",
680
- value: input
681
- }, _errorFactory))(input, "$input", true);
682
- }
683
- return input;
684
- }; })()(payload);
685
- return yield this.licenseAPI.changePassword(payload);
686
- });
687
- }
688
- ;
689
- getVersions(payload) {
690
- return __awaiter(this, void 0, void 0, function* () {
691
- (() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
692
- const value = input[key];
693
- if (undefined === value)
694
- return true;
695
- return true;
696
- }); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
697
- const value = input[key];
698
- if (undefined === value)
699
- return true;
700
- return true;
701
- }); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
702
- if (false === __is(input)) {
703
- _errorFactory = errorFactory;
704
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
705
- path: _path + "",
706
- expected: "Managed<{ [x: string]: unknown; channel?: string | undefined; username?: string | undefined; env?: string | undefined; bundle_code?: string | undefined; sdk_ver?: string | undefined; product: string; hardware_id: string; license_key: string; } | { ...; }>",
707
- value: input
708
- }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
709
- path: _path + "",
710
- expected: "Managed<{ [x: string]: unknown; channel?: string | undefined; username?: string | undefined; env?: string | undefined; bundle_code?: string | undefined; sdk_ver?: string | undefined; product: string; hardware_id: string; license_key: string; } | { ...; }>",
711
- value: input
712
- }, _errorFactory))(input, "$input", true);
713
- }
714
- return input;
715
- }; })()(payload);
716
- return yield this.licenseAPI.getVersions(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
717
- });
718
- }
719
- ;
720
- getInstallationFile(payload) {
721
- return __awaiter(this, void 0, void 0, function* () {
722
- (() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
723
- const value = input[key];
724
- if (undefined === value)
725
- return true;
726
- return true;
727
- }); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
728
- const value = input[key];
729
- if (undefined === value)
730
- return true;
731
- return true;
732
- }); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
733
- if (false === __is(input)) {
734
- _errorFactory = errorFactory;
735
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
736
- path: _path + "",
737
- expected: "Managed<{ [x: string]: unknown; channel?: string | undefined; username?: string | undefined; env?: string | undefined; bundle_code?: string | undefined; sdk_ver?: string | undefined; version?: string | undefined; product: string; hardware_id: string; license_key: string; } | { ...; }>",
738
- value: input
739
- }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
740
- path: _path + "",
741
- expected: "Managed<{ [x: string]: unknown; channel?: string | undefined; username?: string | undefined; env?: string | undefined; bundle_code?: string | undefined; sdk_ver?: string | undefined; version?: string | undefined; product: string; hardware_id: string; license_key: string; } | { ...; }>",
742
- value: input
743
- }, _errorFactory))(input, "$input", true);
744
- }
745
- return input;
746
- }; })()(payload);
747
- return yield this.licenseAPI.getInstallationFile(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
748
- });
749
- }
750
- ;
751
- getSSOUrl(payload) {
752
- return __awaiter(this, void 0, void 0, function* () {
753
- (() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.response_type || "string" === typeof input.response_type) && "string" === typeof input.product && "string" === typeof input.customer_account_code && Object.keys(input).every(key => {
754
- if (["bundle_code", "response_type", "product", "customer_account_code"].some(prop => key === prop))
755
- return true;
756
- const value = input[key];
757
- if (undefined === value)
758
- return true;
759
- return true;
760
- }); const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
761
- path: _path + ".bundle_code",
762
- expected: "(string | undefined)",
763
- value: input.bundle_code
764
- }, _errorFactory)) && (undefined === input.response_type || "string" === typeof input.response_type || $guard(_exceptionable, {
765
- path: _path + ".response_type",
766
- expected: "(string | undefined)",
767
- value: input.response_type
768
- }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
769
- path: _path + ".product",
770
- expected: "string",
771
- value: input.product
772
- }, _errorFactory)) && ("string" === typeof input.customer_account_code || $guard(_exceptionable, {
773
- path: _path + ".customer_account_code",
774
- expected: "string",
775
- value: input.customer_account_code
776
- }, _errorFactory)) && (false === _exceptionable || Object.keys(input).every(key => {
777
- if (["bundle_code", "response_type", "product", "customer_account_code"].some(prop => key === prop))
778
- return true;
779
- const value = input[key];
780
- if (undefined === value)
781
- return true;
782
- return true;
783
- })); const __is = input => "object" === typeof input && null !== input && $io0(input); let _errorFactory; return (input, errorFactory) => {
784
- if (false === __is(input)) {
785
- _errorFactory = errorFactory;
786
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
787
- path: _path + "",
788
- expected: "__type",
789
- value: input
790
- }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
791
- path: _path + "",
792
- expected: "__type",
793
- value: input
794
- }, _errorFactory))(input, "$input", true);
795
- }
796
- return input;
797
- }; })()(payload);
798
- return yield this.licenseAPI.getSSOUrl(payload);
799
- });
800
- }
801
- ;
802
- getAirGapActivationCode(initializationCode, licenseKey) {
803
- const response = this.licenseAPI.getAirGapActivationCode(initializationCode, licenseKey);
804
- const guardFile = this.licenseAPI.createActivationGuard(licenseKey);
805
- this.licenseFile.saveGuardFile(guardFile);
806
- return response;
807
- }
808
719
  activateAirGapLicense(confirmationCode, licenseKey, policyFilePath, policyID) {
809
720
  if (!this.licenseAPI.verifyConfirmationCode(confirmationCode, licenseKey, policyID)) {
810
721
  throw { status: 400, code: 'air_gap_activation_error', message: 'Air gap activation error: incorrect confirmation code' };
@@ -814,22 +725,11 @@ let LicenseManager = (() => {
814
725
  }
815
726
  const policyFileData = this.licenseFile.loadOfflineResponse(policyFilePath);
816
727
  const response = this.licenseAPI.activateAirgappedLicense(policyFileData, licenseKey, policyID);
817
- this.licenseFile.licenseDataCache.fromJSON(response);
728
+ this.licenseFile.licenseDataCache[this.config.productCode].fromJSON(response);
729
+ this.licenseFile.licenseDataCache[this.config.productCode].policyId = policyID;
818
730
  const license = new license_1.default(this.config.productCode, this.licenseAPI, this.licenseFile, this.floatingAPI);
819
731
  return license;
820
732
  }
821
- createOfflineActivationPayload(payload) {
822
- return this.licenseAPI.createOfflineActivationPayload(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
823
- }
824
- createOfflineDeactivationPayload(payload) {
825
- return this.licenseAPI.createOfflineDeactivationPayload(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
826
- }
827
- decodeOfflineActivationPayload(payload) {
828
- return this.licenseAPI.decodeOfflineActivationPayload(payload);
829
- }
830
- decodeOfflineDeactivationPayload(payload) {
831
- return this.licenseAPI.decodeOfflineDeactivationPayload(payload);
832
- }
833
733
  };
834
734
  __setFunctionName(_classThis, "LicenseManager");
835
735
  (() => {