@licensespring/node-sdk 1.3.11 → 1.3.12-alpha

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 (39) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/index.js +29 -0
  3. package/dist/index.js.map +1 -0
  4. package/dist/package.json +4 -5
  5. package/dist/src/abstract-manager.js +20 -360
  6. package/dist/src/abstract-manager.js.map +1 -1
  7. package/dist/src/api.js +454 -3988
  8. package/dist/src/api.js.map +1 -1
  9. package/dist/src/assert-object-type.d.ts +1 -0
  10. package/dist/src/assert-object-type.js +7 -0
  11. package/dist/src/assert-object-type.js.map +1 -0
  12. package/dist/src/assert-object-type.transformer.d.ts +2 -0
  13. package/dist/src/assert-object-type.transformer.js +154 -0
  14. package/dist/src/assert-object-type.transformer.js.map +1 -0
  15. package/dist/src/assert-type.transformer.d.ts +4 -0
  16. package/dist/src/assert-type.transformer.js +73 -0
  17. package/dist/src/assert-type.transformer.js.map +1 -0
  18. package/dist/src/bundle-manager.js +28 -76
  19. package/dist/src/bundle-manager.js.map +1 -1
  20. package/dist/src/floating-api.js +0 -8
  21. package/dist/src/floating-api.js.map +1 -1
  22. package/dist/src/floating.js +19 -70
  23. package/dist/src/floating.js.map +1 -1
  24. package/dist/src/license-manager.js +52 -468
  25. package/dist/src/license-manager.js.map +1 -1
  26. package/dist/src/object-assert-runtime.d.ts +24 -0
  27. package/dist/src/object-assert-runtime.js +97 -0
  28. package/dist/src/object-assert-runtime.js.map +1 -0
  29. package/dist/src/storage-file.js +3 -210
  30. package/dist/src/storage-file.js.map +1 -1
  31. package/dist/src/test/bundle-manager.test.d.ts +1 -0
  32. package/dist/src/test/bundle-manager.test.js +3062 -2
  33. package/dist/src/test/bundle-manager.test.js.map +1 -1
  34. package/dist/src/test/license-manager.test.js +208 -0
  35. package/dist/src/test/license-manager.test.js.map +1 -1
  36. package/dist/src/typeguard.d.ts +2 -0
  37. package/dist/src/typeguard.js +52 -0
  38. package/dist/src/typeguard.js.map +1 -0
  39. package/package.json +4 -5
@@ -73,6 +73,7 @@ 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 __v = __importStar(require("./object-assert-runtime"));
76
77
  const abstract_manager_1 = require("./abstract-manager");
77
78
  const logger_1 = require("./logger");
78
79
  const common_1 = require("./common");
@@ -80,7 +81,7 @@ const watchdog_1 = require("./watchdog");
80
81
  const fs = __importStar(require("node:fs"));
81
82
  const license_1 = __importDefault(require("./license"));
82
83
  const license_file_1 = __importDefault(require("./license-file"));
83
- const typia_1 = __importDefault(require("typia"));
84
+ const assert_object_type_1 = require("./assert-object-type");
84
85
  let LicenseManager = (() => {
85
86
  let _classDecorators = [logger_1.LogAllCalls];
86
87
  let _classDescriptor;
@@ -100,77 +101,22 @@ let LicenseManager = (() => {
100
101
  }
101
102
  checkLicense(payload) {
102
103
  return __awaiter(this, void 0, void 0, function* () {
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) => {
160
- if (false === __is(input)) {
161
- _errorFactory = errorFactory;
162
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
163
- path: _path + "",
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; } | { ...; }>",
165
- value: input
166
- }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
167
- path: _path + "",
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; } | { ...; }>",
169
- value: input
170
- }, _errorFactory))(input, "$input", true);
171
- }
172
- return input;
173
- }; })()(payload);
104
+ __v.assert(payload, { "t": "object", "props": {
105
+ "license_key": { "s": { "t": "string" }, "opt": true },
106
+ "username": { "s": { "t": "string" }, "opt": true },
107
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
108
+ "env": { "s": { "t": "string" }, "opt": true },
109
+ "license_id": { "s": { "t": "number" }, "opt": true },
110
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
111
+ "app_ver": { "s": { "t": "string" }, "opt": true },
112
+ "hostname": { "s": { "t": "string" }, "opt": true },
113
+ "os_hostname": { "s": { "t": "string" }, "opt": true },
114
+ "ip_local": { "s": { "t": "string" }, "opt": true },
115
+ "mac_address": { "s": { "t": "string" }, "opt": true },
116
+ "ip": { "s": { "t": "string" }, "opt": true },
117
+ "os_ver": { "s": { "t": "string" }, "opt": true },
118
+ "channel": { "s": { "t": "string" }, "opt": true }
119
+ } });
174
120
  try {
175
121
  const response = yield this.licenseAPI.checkLicense(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
176
122
  this.checkLicenseStatus(response);
@@ -200,31 +146,7 @@ let LicenseManager = (() => {
200
146
  ;
201
147
  activateLicense(payload) {
202
148
  return __awaiter(this, void 0, void 0, function* () {
203
- (() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
204
- const value = input[key];
205
- if (undefined === value)
206
- return true;
207
- return true;
208
- }); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
209
- const value = input[key];
210
- if (undefined === value)
211
- return true;
212
- return true;
213
- }); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
214
- if (false === __is(input)) {
215
- _errorFactory = errorFactory;
216
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
217
- path: _path + "",
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; } | { ...; } | { ...; } | { ...; }>",
219
- value: input
220
- }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
221
- path: _path + "",
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; } | { ...; } | { ...; } | { ...; }>",
223
- value: input
224
- }, _errorFactory))(input, "$input", true);
225
- }
226
- return input;
227
- }; })()(payload);
149
+ __v.assert(payload, { "t": "object", "props": {}, "index": { "key": "string", "s": { "t": "unknown" } } });
228
150
  const response = yield this.licenseAPI.activateLicense(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
229
151
  this.licenseFile.licenseDataCache[this.config.productCode].updateActivationData(response);
230
152
  this.licenseFile.saveLicenseFile();
@@ -234,33 +156,11 @@ let LicenseManager = (() => {
234
156
  ;
235
157
  deactivateLicense(payload) {
236
158
  return __awaiter(this, void 0, void 0, function* () {
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) => {
250
- if (false === __is(input)) {
251
- _errorFactory = errorFactory;
252
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
253
- path: _path + "",
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; }>",
255
- value: input
256
- }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
257
- path: _path + "",
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; }>",
259
- value: input
260
- }, _errorFactory))(input, "$input", true);
261
- }
262
- return input;
263
- }; })()(payload);
159
+ __v.assert(payload, { "t": "object", "props": {
160
+ "license_key": { "s": { "t": "string" }, "opt": true },
161
+ "username": { "s": { "t": "string" }, "opt": true },
162
+ "bundle_code": { "s": { "t": "string" }, "opt": true }
163
+ } });
264
164
  const response = yield this.licenseAPI.deactivateLicense(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
265
165
  this.licenseFile.licenseDataCache[this.config.productCode].deactivate();
266
166
  this.licenseFile.saveLicenseFile();
@@ -282,31 +182,7 @@ let LicenseManager = (() => {
282
182
  ;
283
183
  getTrialKey(payload) {
284
184
  return __awaiter(this, void 0, void 0, function* () {
285
- (() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
286
- const value = input[key];
287
- if (undefined === value)
288
- return true;
289
- return true;
290
- }); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
291
- const value = input[key];
292
- if (undefined === value)
293
- return true;
294
- return true;
295
- }); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
296
- if (false === __is(input)) {
297
- _errorFactory = errorFactory;
298
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
299
- path: _path + "",
300
- expected: "Managed<__type>",
301
- value: input
302
- }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
303
- path: _path + "",
304
- expected: "Managed<__type>",
305
- value: input
306
- }, _errorFactory))(input, "$input", true);
307
- }
308
- return input;
309
- }; })()(payload);
185
+ __v.assert(payload, { "t": "object", "props": {}, "index": { "key": "string", "s": { "t": "unknown" } } });
310
186
  const response = yield this.licenseAPI.getTrialKey(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
311
187
  this.licenseFile.licenseDataCache[this.config.productCode].updateActivationData(response);
312
188
  this.licenseFile.saveLicenseFile();
@@ -316,124 +192,28 @@ let LicenseManager = (() => {
316
192
  ;
317
193
  getUserLicenses(payload) {
318
194
  return __awaiter(this, void 0, void 0, function* () {
319
- (() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
320
- const value = input[key];
321
- if (undefined === value)
322
- return true;
323
- return true;
324
- }); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
325
- const value = input[key];
326
- if (undefined === value)
327
- return true;
328
- return true;
329
- }); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
330
- if (false === __is(input)) {
331
- _errorFactory = errorFactory;
332
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
333
- path: _path + "",
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; } | { ...; } | { ...; }>",
335
- value: input
336
- }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
337
- path: _path + "",
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; } | { ...; } | { ...; }>",
339
- value: input
340
- }, _errorFactory))(input, "$input", true);
341
- }
342
- return input;
343
- }; })()(payload);
195
+ __v.assert(payload, { "t": "object", "props": {}, "index": { "key": "string", "s": { "t": "unknown" } } });
344
196
  return yield this.licenseAPI.getUserLicenses(Object.assign(Object.assign({}, payload), { product: this.config.productCode }));
345
197
  });
346
198
  }
347
199
  ;
348
200
  getCustomerLicenseUsers(payload) {
349
201
  return __awaiter(this, void 0, void 0, function* () {
350
- (() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
351
- const value = input[key];
352
- if (undefined === value)
353
- return true;
354
- return true;
355
- }); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
356
- const value = input[key];
357
- if (undefined === value)
358
- return true;
359
- return true;
360
- }); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
361
- if (false === __is(input)) {
362
- _errorFactory = errorFactory;
363
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
364
- path: _path + "",
365
- expected: "Managed<__type>",
366
- value: input
367
- }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
368
- path: _path + "",
369
- expected: "Managed<__type>",
370
- value: input
371
- }, _errorFactory))(input, "$input", true);
372
- }
373
- return input;
374
- }; })()(payload);
202
+ __v.assert(payload, { "t": "object", "props": {}, "index": { "key": "string", "s": { "t": "unknown" } } });
375
203
  return yield this.licenseAPI.getCustomerLicenseUsers(Object.assign(Object.assign({}, payload), { product: this.config.productCode }));
376
204
  });
377
205
  }
378
206
  ;
379
207
  checkLicenseFeature(payload) {
380
208
  return __awaiter(this, void 0, void 0, function* () {
381
- (() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
382
- const value = input[key];
383
- if (undefined === value)
384
- return true;
385
- return true;
386
- }); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
387
- const value = input[key];
388
- if (undefined === value)
389
- return true;
390
- return true;
391
- }); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
392
- if (false === __is(input)) {
393
- _errorFactory = errorFactory;
394
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
395
- path: _path + "",
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; } | { ...; }>",
397
- value: input
398
- }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
399
- path: _path + "",
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; } | { ...; }>",
401
- value: input
402
- }, _errorFactory))(input, "$input", true);
403
- }
404
- return input;
405
- }; })()(payload);
209
+ __v.assert(payload, { "t": "object", "props": {}, "index": { "key": "string", "s": { "t": "unknown" } } });
406
210
  return yield this.licenseAPI.checkLicenseFeature(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
407
211
  });
408
212
  }
409
213
  ;
410
214
  addConsumption(payload) {
411
215
  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) => {
423
- if (false === __is(input)) {
424
- _errorFactory = errorFactory;
425
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
426
- path: _path + "",
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; } | { ...; }>",
428
- value: input
429
- }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
430
- path: _path + "",
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; } | { ...; }>",
432
- value: input
433
- }, _errorFactory))(input, "$input", true);
434
- }
435
- return input;
436
- }; })()(payload);
216
+ __v.assert(payload, { "t": "object", "props": {}, "index": { "key": "string", "s": { "t": "unknown" } } });
437
217
  const response = yield this.licenseAPI.addConsumption(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
438
218
  this.licenseFile.licenseDataCache[this.config.productCode].updateLocalConsumptionsData(response);
439
219
  this.licenseFile.saveLicenseFile();
@@ -443,61 +223,16 @@ let LicenseManager = (() => {
443
223
  ;
444
224
  addFeatureConsumption(payload) {
445
225
  return __awaiter(this, void 0, void 0, function* () {
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) => {
487
- if (false === __is(input)) {
488
- _errorFactory = errorFactory;
489
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
490
- path: _path + "",
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; } | { ...; }>",
492
- value: input
493
- }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
494
- path: _path + "",
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; } | { ...; }>",
496
- value: input
497
- }, _errorFactory))(input, "$input", true);
498
- }
499
- return input;
500
- }; })()(payload);
226
+ __v.assert(payload, { "t": "object", "props": {
227
+ "license_key": { "s": { "t": "string" }, "opt": true },
228
+ "username": { "s": { "t": "string" }, "opt": true },
229
+ "feature": { "s": { "t": "string" }, "opt": false },
230
+ "consumptions": { "s": { "t": "number" }, "opt": false },
231
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
232
+ "license_id": { "s": { "t": "number" }, "opt": true },
233
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
234
+ "event": { "s": { "t": "array", "items": { "t": "union", "anyOf": [{ "t": "literal", "v": "consumption_add" }, { "t": "literal", "v": "offline_floating_consumptions_sync" }] } }, "opt": true }
235
+ } });
501
236
  const response = yield this.licenseAPI.addFeatureConsumption(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
502
237
  this.licenseFile.licenseDataCache[this.config.productCode].updateFeatureData(response, payload.feature);
503
238
  this.licenseFile.saveLicenseFile();
@@ -507,45 +242,14 @@ let LicenseManager = (() => {
507
242
  ;
508
243
  featureRelease(payload) {
509
244
  return __awaiter(this, void 0, void 0, function* () {
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) => {
535
- if (false === __is(input)) {
536
- _errorFactory = errorFactory;
537
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
538
- path: _path + "",
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; } | { ...; }>",
540
- value: input
541
- }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
542
- path: _path + "",
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; } | { ...; }>",
544
- value: input
545
- }, _errorFactory))(input, "$input", true);
546
- }
547
- return input;
548
- }; })()(payload);
245
+ __v.assert(payload, { "t": "object", "props": {
246
+ "license_key": { "s": { "t": "string" }, "opt": true },
247
+ "username": { "s": { "t": "string" }, "opt": true },
248
+ "feature": { "s": { "t": "string" }, "opt": false },
249
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
250
+ "license_id": { "s": { "t": "number" }, "opt": true },
251
+ "sdk_ver": { "s": { "t": "string" }, "opt": true }
252
+ } });
549
253
  const response = yield this.licenseAPI.featureRelease(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
550
254
  this.licenseFile.saveLicenseFile();
551
255
  return response;
@@ -554,31 +258,7 @@ let LicenseManager = (() => {
554
258
  ;
555
259
  getProductDetails(payload) {
556
260
  return __awaiter(this, void 0, void 0, function* () {
557
- (() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
558
- const value = input[key];
559
- if (undefined === value)
560
- return true;
561
- return true;
562
- }); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
563
- const value = input[key];
564
- if (undefined === value)
565
- return true;
566
- return true;
567
- }); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
568
- if (false === __is(input)) {
569
- _errorFactory = errorFactory;
570
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
571
- path: _path + "",
572
- expected: "Managed<__type>",
573
- value: input
574
- }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
575
- path: _path + "",
576
- expected: "Managed<__type>",
577
- value: input
578
- }, _errorFactory))(input, "$input", true);
579
- }
580
- return input;
581
- }; })()(payload);
261
+ __v.assert(payload, { "t": "object", "props": {}, "index": { "key": "string", "s": { "t": "unknown" } } });
582
262
  const response = yield this.licenseAPI.getProductDetails(Object.assign(Object.assign({}, payload), { product: this.config.productCode }));
583
263
  this.licenseFile.licenseDataCache[this.config.productCode].updateResponseData({ product_details: response });
584
264
  this.licenseFile.saveLicenseFile();
@@ -588,31 +268,7 @@ let LicenseManager = (() => {
588
268
  ;
589
269
  getDeviceVariables(payload) {
590
270
  return __awaiter(this, void 0, void 0, function* () {
591
- (() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
592
- const value = input[key];
593
- if (undefined === value)
594
- return true;
595
- return true;
596
- }); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
597
- const value = input[key];
598
- if (undefined === value)
599
- return true;
600
- return true;
601
- }); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
602
- if (false === __is(input)) {
603
- _errorFactory = errorFactory;
604
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
605
- path: _path + "",
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; } | { ...; }>",
607
- value: input
608
- }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
609
- path: _path + "",
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; } | { ...; }>",
611
- value: input
612
- }, _errorFactory))(input, "$input", true);
613
- }
614
- return input;
615
- }; })()(payload);
271
+ __v.assert(payload, { "t": "object", "props": {}, "index": { "key": "string", "s": { "t": "unknown" } } });
616
272
  const response = yield this.licenseAPI.getDeviceVariables(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
617
273
  this.licenseFile.licenseDataCache[this.config.productCode].updateResponseData({ variables: response });
618
274
  this.licenseFile.saveLicenseFile();
@@ -622,31 +278,7 @@ let LicenseManager = (() => {
622
278
  ;
623
279
  trackDeviceVariables(payload) {
624
280
  return __awaiter(this, void 0, void 0, function* () {
625
- (() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
626
- const value = input[key];
627
- if (undefined === value)
628
- return true;
629
- return true;
630
- }); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
631
- const value = input[key];
632
- if (undefined === value)
633
- return true;
634
- return true;
635
- }); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
636
- if (false === __is(input)) {
637
- _errorFactory = errorFactory;
638
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
639
- path: _path + "",
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; } | { ...; }>",
641
- value: input
642
- }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
643
- path: _path + "",
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; } | { ...; }>",
645
- value: input
646
- }, _errorFactory))(input, "$input", true);
647
- }
648
- return input;
649
- }; })()(payload);
281
+ __v.assert(payload, { "t": "object", "props": {}, "index": { "key": "string", "s": { "t": "unknown" } } });
650
282
  const response = yield this.licenseAPI.trackDeviceVariables(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
651
283
  this.licenseFile.licenseDataCache[this.config.productCode].updateResponseData({ variables: response });
652
284
  this.licenseFile.saveLicenseFile();
@@ -656,62 +288,14 @@ let LicenseManager = (() => {
656
288
  ;
657
289
  floatingBorrow(payload) {
658
290
  return __awaiter(this, void 0, void 0, function* () {
659
- (() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
660
- const value = input[key];
661
- if (undefined === value)
662
- return true;
663
- return true;
664
- }); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
665
- const value = input[key];
666
- if (undefined === value)
667
- return true;
668
- return true;
669
- }); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
670
- if (false === __is(input)) {
671
- _errorFactory = errorFactory;
672
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
673
- path: _path + "",
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; } | { ...; }>",
675
- value: input
676
- }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
677
- path: _path + "",
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; } | { ...; }>",
679
- value: input
680
- }, _errorFactory))(input, "$input", true);
681
- }
682
- return input;
683
- }; })()(payload);
291
+ __v.assert(payload, { "t": "object", "props": {}, "index": { "key": "string", "s": { "t": "unknown" } } });
684
292
  return yield this.licenseAPI.floatingBorrow(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
685
293
  });
686
294
  }
687
295
  ;
688
296
  floatingRelease(payload) {
689
297
  return __awaiter(this, void 0, void 0, function* () {
690
- (() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
691
- const value = input[key];
692
- if (undefined === value)
693
- return true;
694
- return true;
695
- }); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
696
- const value = input[key];
697
- if (undefined === value)
698
- return true;
699
- return true;
700
- }); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
701
- if (false === __is(input)) {
702
- _errorFactory = errorFactory;
703
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
704
- path: _path + "",
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; } | { ...; }>",
706
- value: input
707
- }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
708
- path: _path + "",
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; } | { ...; }>",
710
- value: input
711
- }, _errorFactory))(input, "$input", true);
712
- }
713
- return input;
714
- }; })()(payload);
298
+ __v.assert(payload, { "t": "object", "props": {}, "index": { "key": "string", "s": { "t": "unknown" } } });
715
299
  return yield this.licenseAPI.floatingRelease(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
716
300
  });
717
301
  }