@licensespring/node-sdk 1.4.13-alpha → 1.4.15-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.
package/dist/src/api.js CHANGED
@@ -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 common_1 = require("./common");
77
78
  const service_1 = __importDefault(require("./service"));
78
79
  const hwid_1 = require("../hwid");
@@ -81,14 +82,13 @@ const elliptic = __importStar(require("elliptic"));
81
82
  const crypto = __importStar(require("node:crypto"));
82
83
  const dayjs_1 = __importDefault(require("dayjs"));
83
84
  const utc_js_1 = __importDefault(require("dayjs/plugin/utc.js"));
84
- const path = __importStar(require("node:path"));
85
85
  const hash_js_1 = require("hash.js");
86
86
  const uuid_1 = require("uuid");
87
87
  const logger_1 = require("./logger");
88
88
  dayjs_1.default.extend(utc_js_1.default);
89
89
  const dotenv = __importStar(require("dotenv"));
90
90
  const assert_object_type_1 = require("./assert-object-type");
91
- const envFilePath = path.join(__dirname, `../.env.${!!process.env.NODE_ENV ? process.env.NODE_ENV : 'prod'}`);
91
+ const envFilePath = (0, common_1.getEnvFilePath)();
92
92
  const envConfig = dotenv.config({ path: envFilePath });
93
93
  if (envConfig.error) {
94
94
  console.warn(`Configuration Warning: env file not found: ${envFilePath}, skipping.`);
@@ -101,12 +101,12 @@ let LicenseAPI = (() => {
101
101
  var LicenseAPI = _classThis = class {
102
102
  constructor(config) {
103
103
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
104
- (0, assert_object_type_1.assertObjectType)(config);
104
+ __v.assert(config, { "t": "union", "anyOf": [{ "t": "unknown" }, { "t": "unknown" }] });
105
105
  const _config = Object.assign(Object.assign({}, config), { apiPath: (_a = config.apiPath) !== null && _a !== void 0 ? _a : process.env.API_PATH, publicKey: (_b = config.publicKey) !== null && _b !== void 0 ? _b : process.env.PUBLIC_KEY, filename: (_c = config.filename) !== null && _c !== void 0 ? _c : process.env.FILENAME, filePath: (_d = config.filePath) !== null && _d !== void 0 ? _d : process.env.FILE_PATH, gracePeriod: (_e = config.gracePeriod) !== null && _e !== void 0 ? _e : 24, fileKey: (_f = config.fileKey) !== null && _f !== void 0 ? _f : process.env.LICENSE_FILE_KEY, isGuardFileEnabled: (_g = config.isGuardFileEnabled) !== null && _g !== void 0 ? _g : !!process.env.GUARD_FILE_ENABLED, hardwareIDMethod: (_h = config.hardwareIDMethod) !== null && _h !== void 0 ? _h : 0, airGapKey: (_j = config.airGapKey) !== null && _j !== void 0 ? _j : process.env.AIR_GAP_KEY, sdkVersion: version_1.default, proxy: config.proxy, tokenUrl: (_k = ('tokenUrl' in config ? config.tokenUrl : process.env.TOKEN_URL)) !== null && _k !== void 0 ? _k : '' });
106
106
  if ((_l = config.hardwareID) === null || _l === void 0 ? void 0 : _l.length) {
107
107
  this.hardwareIDmanual = config.hardwareID;
108
108
  }
109
- (0, assert_object_type_1.assertObjectType)(_config);
109
+ __v.assert(_config, { "t": "union", "anyOf": [{ "t": "unknown" }, { "t": "unknown" }] });
110
110
  this.setLogLevel((_m = config.logLevel) !== null && _m !== void 0 ? _m : 'off');
111
111
  this.config = _config;
112
112
  this.service = new service_1.default(this.config);
@@ -125,7 +125,41 @@ let LicenseAPI = (() => {
125
125
  }
126
126
  checkLicense(payload_1) {
127
127
  return __awaiter(this, arguments, void 0, function* (payload, includeExpiredFeatures = false) {
128
- (0, assert_object_type_1.assertObjectType)(payload);
128
+ __v.assert(payload, { "t": "union", "anyOf": [{ "t": "object", "props": {
129
+ "username": { "s": { "t": "string" }, "opt": true },
130
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
131
+ "env": { "s": { "t": "string" }, "opt": true },
132
+ "license_id": { "s": { "t": "number" }, "opt": true },
133
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
134
+ "app_ver": { "s": { "t": "string" }, "opt": true },
135
+ "hostname": { "s": { "t": "string" }, "opt": true },
136
+ "os_hostname": { "s": { "t": "string" }, "opt": true },
137
+ "ip_local": { "s": { "t": "string" }, "opt": true },
138
+ "mac_address": { "s": { "t": "string" }, "opt": true },
139
+ "ip": { "s": { "t": "string" }, "opt": true },
140
+ "os_ver": { "s": { "t": "string" }, "opt": true },
141
+ "channel": { "s": { "t": "string" }, "opt": true },
142
+ "license_key": { "s": { "t": "string" }, "opt": false },
143
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
144
+ "product": { "s": { "t": "string" }, "opt": false }
145
+ } }, { "t": "object", "props": {
146
+ "license_key": { "s": { "t": "string" }, "opt": true },
147
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
148
+ "env": { "s": { "t": "string" }, "opt": true },
149
+ "license_id": { "s": { "t": "number" }, "opt": true },
150
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
151
+ "app_ver": { "s": { "t": "string" }, "opt": true },
152
+ "hostname": { "s": { "t": "string" }, "opt": true },
153
+ "os_hostname": { "s": { "t": "string" }, "opt": true },
154
+ "ip_local": { "s": { "t": "string" }, "opt": true },
155
+ "mac_address": { "s": { "t": "string" }, "opt": true },
156
+ "ip": { "s": { "t": "string" }, "opt": true },
157
+ "os_ver": { "s": { "t": "string" }, "opt": true },
158
+ "channel": { "s": { "t": "string" }, "opt": true },
159
+ "username": { "s": { "t": "string" }, "opt": false },
160
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
161
+ "product": { "s": { "t": "string" }, "opt": false }
162
+ } }] });
129
163
  const { headers, response } = yield this.service.getRequest('check_license', Object.assign(Object.assign({}, payload), { include_expired_features: includeExpiredFeatures }));
130
164
  (0, common_1.checkSignatureV1)(this.config.publicKey, response, payload);
131
165
  (0, common_1.checkSignatureV2)(this.config.publicKey, response, (0, common_1.getHeaderString)(headers, 'LicenseSignature'));
@@ -135,7 +169,39 @@ let LicenseAPI = (() => {
135
169
  ;
136
170
  checkBundle(payload_1) {
137
171
  return __awaiter(this, arguments, void 0, function* (payload, includeExpiredFeatures = false) {
138
- (0, assert_object_type_1.assertObjectType)(payload);
172
+ __v.assert(payload, { "t": "union", "anyOf": [{ "t": "object", "props": {
173
+ "username": { "s": { "t": "string" }, "opt": true },
174
+ "env": { "s": { "t": "string" }, "opt": true },
175
+ "license_id": { "s": { "t": "number" }, "opt": true },
176
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
177
+ "app_ver": { "s": { "t": "string" }, "opt": true },
178
+ "hostname": { "s": { "t": "string" }, "opt": true },
179
+ "os_hostname": { "s": { "t": "string" }, "opt": true },
180
+ "ip_local": { "s": { "t": "string" }, "opt": true },
181
+ "mac_address": { "s": { "t": "string" }, "opt": true },
182
+ "ip": { "s": { "t": "string" }, "opt": true },
183
+ "os_ver": { "s": { "t": "string" }, "opt": true },
184
+ "channel": { "s": { "t": "string" }, "opt": true },
185
+ "license_key": { "s": { "t": "string" }, "opt": false },
186
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
187
+ "product": { "s": { "t": "string" }, "opt": false }
188
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }, { "t": "object", "props": {
189
+ "license_key": { "s": { "t": "string" }, "opt": true },
190
+ "env": { "s": { "t": "string" }, "opt": true },
191
+ "license_id": { "s": { "t": "number" }, "opt": true },
192
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
193
+ "app_ver": { "s": { "t": "string" }, "opt": true },
194
+ "hostname": { "s": { "t": "string" }, "opt": true },
195
+ "os_hostname": { "s": { "t": "string" }, "opt": true },
196
+ "ip_local": { "s": { "t": "string" }, "opt": true },
197
+ "mac_address": { "s": { "t": "string" }, "opt": true },
198
+ "ip": { "s": { "t": "string" }, "opt": true },
199
+ "os_ver": { "s": { "t": "string" }, "opt": true },
200
+ "channel": { "s": { "t": "string" }, "opt": true },
201
+ "username": { "s": { "t": "string" }, "opt": false },
202
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
203
+ "product": { "s": { "t": "string" }, "opt": false }
204
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }] });
139
205
  const { headers, response } = yield this.service.getRequest('check_bundle', Object.assign(Object.assign({}, payload), { include_expired_features: includeExpiredFeatures }));
140
206
  for (const license of response) {
141
207
  (0, common_1.checkSignatureV1)(this.config.publicKey, license, payload);
@@ -147,7 +213,55 @@ let LicenseAPI = (() => {
147
213
  ;
148
214
  activateLicense(payload) {
149
215
  return __awaiter(this, void 0, void 0, function* () {
150
- (0, assert_object_type_1.assertObjectType)(payload);
216
+ __v.assert(payload, { "t": "union", "anyOf": [{ "t": "object", "props": {
217
+ "username": { "s": { "t": "string" }, "opt": true },
218
+ "password": { "s": { "t": "string" }, "opt": true },
219
+ "id_token": { "s": { "t": "string" }, "opt": true },
220
+ "code": { "s": { "t": "string" }, "opt": true },
221
+ "customer_account_code": { "s": { "t": "string" }, "opt": true },
222
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
223
+ "redirect_uri": { "s": { "t": "string" }, "opt": true },
224
+ "variables": { "s": { "t": "object", "props": {}, "index": { "key": "string", "s": { "t": "unknown" } } }, "opt": true },
225
+ "license_key": { "s": { "t": "string" }, "opt": false },
226
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
227
+ "product": { "s": { "t": "string" }, "opt": false }
228
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }, { "t": "object", "props": {
229
+ "license_key": { "s": { "t": "string" }, "opt": true },
230
+ "id_token": { "s": { "t": "string" }, "opt": true },
231
+ "code": { "s": { "t": "string" }, "opt": true },
232
+ "customer_account_code": { "s": { "t": "string" }, "opt": true },
233
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
234
+ "redirect_uri": { "s": { "t": "string" }, "opt": true },
235
+ "variables": { "s": { "t": "object", "props": {}, "index": { "key": "string", "s": { "t": "unknown" } } }, "opt": true },
236
+ "username": { "s": { "t": "string" }, "opt": false },
237
+ "password": { "s": { "t": "string" }, "opt": false },
238
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
239
+ "product": { "s": { "t": "string" }, "opt": false }
240
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }, { "t": "object", "props": {
241
+ "license_key": { "s": { "t": "string" }, "opt": true },
242
+ "username": { "s": { "t": "string" }, "opt": true },
243
+ "password": { "s": { "t": "string" }, "opt": true },
244
+ "code": { "s": { "t": "string" }, "opt": true },
245
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
246
+ "redirect_uri": { "s": { "t": "string" }, "opt": true },
247
+ "variables": { "s": { "t": "object", "props": {}, "index": { "key": "string", "s": { "t": "unknown" } } }, "opt": true },
248
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
249
+ "product": { "s": { "t": "string" }, "opt": false },
250
+ "id_token": { "s": { "t": "string" }, "opt": false },
251
+ "customer_account_code": { "s": { "t": "string" }, "opt": false }
252
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }, { "t": "object", "props": {
253
+ "license_key": { "s": { "t": "string" }, "opt": true },
254
+ "username": { "s": { "t": "string" }, "opt": true },
255
+ "password": { "s": { "t": "string" }, "opt": true },
256
+ "id_token": { "s": { "t": "string" }, "opt": true },
257
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
258
+ "redirect_uri": { "s": { "t": "string" }, "opt": true },
259
+ "variables": { "s": { "t": "object", "props": {}, "index": { "key": "string", "s": { "t": "unknown" } } }, "opt": true },
260
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
261
+ "product": { "s": { "t": "string" }, "opt": false },
262
+ "code": { "s": { "t": "string" }, "opt": false },
263
+ "customer_account_code": { "s": { "t": "string" }, "opt": false }
264
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }] });
151
265
  const { headers, response } = yield this.service.postRequest('activate_license', payload);
152
266
  (0, common_1.checkSignatureV1)(this.config.publicKey, response, payload);
153
267
  (0, common_1.checkSignatureV2)(this.config.publicKey, response, (0, common_1.getHeaderString)(headers, 'LicenseSignature'));
@@ -157,7 +271,51 @@ let LicenseAPI = (() => {
157
271
  ;
158
272
  activateBundle(payload) {
159
273
  return __awaiter(this, void 0, void 0, function* () {
160
- (0, assert_object_type_1.assertObjectType)(payload);
274
+ __v.assert(payload, { "t": "union", "anyOf": [{ "t": "object", "props": {
275
+ "username": { "s": { "t": "string" }, "opt": true },
276
+ "password": { "s": { "t": "string" }, "opt": true },
277
+ "id_token": { "s": { "t": "string" }, "opt": true },
278
+ "code": { "s": { "t": "string" }, "opt": true },
279
+ "customer_account_code": { "s": { "t": "string" }, "opt": true },
280
+ "redirect_uri": { "s": { "t": "string" }, "opt": true },
281
+ "variables": { "s": { "t": "object", "props": {}, "index": { "key": "string", "s": { "t": "unknown" } } }, "opt": true },
282
+ "license_key": { "s": { "t": "string" }, "opt": false },
283
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
284
+ "product": { "s": { "t": "string" }, "opt": false }
285
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }, { "t": "object", "props": {
286
+ "license_key": { "s": { "t": "string" }, "opt": true },
287
+ "id_token": { "s": { "t": "string" }, "opt": true },
288
+ "code": { "s": { "t": "string" }, "opt": true },
289
+ "customer_account_code": { "s": { "t": "string" }, "opt": true },
290
+ "redirect_uri": { "s": { "t": "string" }, "opt": true },
291
+ "variables": { "s": { "t": "object", "props": {}, "index": { "key": "string", "s": { "t": "unknown" } } }, "opt": true },
292
+ "username": { "s": { "t": "string" }, "opt": false },
293
+ "password": { "s": { "t": "string" }, "opt": false },
294
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
295
+ "product": { "s": { "t": "string" }, "opt": false }
296
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }, { "t": "object", "props": {
297
+ "license_key": { "s": { "t": "string" }, "opt": true },
298
+ "username": { "s": { "t": "string" }, "opt": true },
299
+ "password": { "s": { "t": "string" }, "opt": true },
300
+ "code": { "s": { "t": "string" }, "opt": true },
301
+ "redirect_uri": { "s": { "t": "string" }, "opt": true },
302
+ "variables": { "s": { "t": "object", "props": {}, "index": { "key": "string", "s": { "t": "unknown" } } }, "opt": true },
303
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
304
+ "product": { "s": { "t": "string" }, "opt": false },
305
+ "id_token": { "s": { "t": "string" }, "opt": false },
306
+ "customer_account_code": { "s": { "t": "string" }, "opt": false }
307
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }, { "t": "object", "props": {
308
+ "license_key": { "s": { "t": "string" }, "opt": true },
309
+ "username": { "s": { "t": "string" }, "opt": true },
310
+ "password": { "s": { "t": "string" }, "opt": true },
311
+ "id_token": { "s": { "t": "string" }, "opt": true },
312
+ "redirect_uri": { "s": { "t": "string" }, "opt": true },
313
+ "variables": { "s": { "t": "object", "props": {}, "index": { "key": "string", "s": { "t": "unknown" } } }, "opt": true },
314
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
315
+ "product": { "s": { "t": "string" }, "opt": false },
316
+ "code": { "s": { "t": "string" }, "opt": false },
317
+ "customer_account_code": { "s": { "t": "string" }, "opt": false }
318
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }] });
161
319
  const { headers, response } = yield this.service.postRequest('activate_bundle', payload);
162
320
  for (const license of response) {
163
321
  (0, common_1.checkSignatureV1)(this.config.publicKey, license, payload);
@@ -169,7 +327,21 @@ let LicenseAPI = (() => {
169
327
  ;
170
328
  deactivateLicense(payload) {
171
329
  return __awaiter(this, void 0, void 0, function* () {
172
- (0, assert_object_type_1.assertObjectType)(payload);
330
+ __v.assert(payload, { "t": "union", "anyOf": [{ "t": "object", "props": {
331
+ "username": { "s": { "t": "string" }, "opt": true },
332
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
333
+ "variables": { "s": { "t": "object", "props": {}, "index": { "key": "string", "s": { "t": "unknown" } } }, "opt": true },
334
+ "license_key": { "s": { "t": "string" }, "opt": false },
335
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
336
+ "product": { "s": { "t": "string" }, "opt": false }
337
+ } }, { "t": "object", "props": {
338
+ "license_key": { "s": { "t": "string" }, "opt": true },
339
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
340
+ "variables": { "s": { "t": "object", "props": {}, "index": { "key": "string", "s": { "t": "unknown" } } }, "opt": true },
341
+ "username": { "s": { "t": "string" }, "opt": false },
342
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
343
+ "product": { "s": { "t": "string" }, "opt": false }
344
+ } }] });
173
345
  const { response } = yield this.service.postRequest('deactivate_license', payload);
174
346
  return (0, common_1.assertResponseString)(response, 'license_deactivated');
175
347
  });
@@ -177,7 +349,21 @@ let LicenseAPI = (() => {
177
349
  ;
178
350
  deactivateBundle(payload) {
179
351
  return __awaiter(this, void 0, void 0, function* () {
180
- (0, assert_object_type_1.assertObjectType)(payload);
352
+ __v.assert(payload, { "t": "union", "anyOf": [{ "t": "object", "props": {
353
+ "username": { "s": { "t": "string" }, "opt": true },
354
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
355
+ "variables": { "s": { "t": "object", "props": {}, "index": { "key": "string", "s": { "t": "unknown" } } }, "opt": true },
356
+ "license_key": { "s": { "t": "string" }, "opt": false },
357
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
358
+ "product": { "s": { "t": "string" }, "opt": false }
359
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }, { "t": "object", "props": {
360
+ "license_key": { "s": { "t": "string" }, "opt": true },
361
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
362
+ "variables": { "s": { "t": "object", "props": {}, "index": { "key": "string", "s": { "t": "unknown" } } }, "opt": true },
363
+ "username": { "s": { "t": "string" }, "opt": false },
364
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
365
+ "product": { "s": { "t": "string" }, "opt": false }
366
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }] });
181
367
  const { response } = yield this.service.postRequest('deactivate_bundle', payload);
182
368
  return (0, common_1.assertResponseString)(response, 'license_deactivated');
183
369
  });
@@ -185,7 +371,7 @@ let LicenseAPI = (() => {
185
371
  ;
186
372
  activateOffline(payload) {
187
373
  return __awaiter(this, void 0, void 0, function* () {
188
- (0, assert_object_type_1.assertObjectType)(payload);
374
+ __v.assert(payload, { "t": "string" });
189
375
  const { response } = yield this.service.postRequest('activate_offline', payload, { 'Content-Type': 'text/plain' });
190
376
  (0, common_1.checkSignatureV1)(this.config.publicKey, response, this.decodeOfflineActivationPayload(payload));
191
377
  const responsePartial = response;
@@ -199,7 +385,7 @@ let LicenseAPI = (() => {
199
385
  ;
200
386
  deactivateOffline(payload) {
201
387
  return __awaiter(this, void 0, void 0, function* () {
202
- (0, assert_object_type_1.assertObjectType)(payload);
388
+ __v.assert(payload, { "t": "string" });
203
389
  const { response } = yield this.service.postRequest('deactivate_offline', payload, { 'Content-Type': 'text/plain' });
204
390
  return (0, common_1.assertResponseString)(response, 'license_deactivated');
205
391
  });
@@ -245,7 +431,23 @@ let LicenseAPI = (() => {
245
431
  ;
246
432
  getTrialKey(payload) {
247
433
  return __awaiter(this, void 0, void 0, function* () {
248
- (0, assert_object_type_1.assertObjectType)(payload);
434
+ __v.assert(payload, { "t": "object", "props": {
435
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
436
+ "email": { "s": { "t": "string" }, "opt": true },
437
+ "license_policy": { "s": { "t": "string" }, "opt": true },
438
+ "first_name": { "s": { "t": "string" }, "opt": true },
439
+ "last_name": { "s": { "t": "string" }, "opt": true },
440
+ "phone": { "s": { "t": "string" }, "opt": true },
441
+ "address": { "s": { "t": "string" }, "opt": true },
442
+ "postcode": { "s": { "t": "string" }, "opt": true },
443
+ "state": { "s": { "t": "string" }, "opt": true },
444
+ "country": { "s": { "t": "string" }, "opt": true },
445
+ "city": { "s": { "t": "string" }, "opt": true },
446
+ "reference": { "s": { "t": "string" }, "opt": true },
447
+ "company_name": { "s": { "t": "string" }, "opt": true },
448
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
449
+ "product": { "s": { "t": "string" }, "opt": false }
450
+ }, "index": { "key": "string", "s": { "t": "unknown" } } });
249
451
  const { headers, response } = yield this.service.getRequest('trial_key', payload);
250
452
  (0, common_1.checkSignatureV2)(this.config.publicKey, response, (0, common_1.getHeaderString)(headers, 'LicenseSignature'));
251
453
  return response;
@@ -254,7 +456,31 @@ let LicenseAPI = (() => {
254
456
  ;
255
457
  getUserLicenses(payload) {
256
458
  return __awaiter(this, void 0, void 0, function* () {
257
- (0, assert_object_type_1.assertObjectType)(payload);
459
+ __v.assert(payload, { "t": "union", "anyOf": [{ "t": "object", "props": {
460
+ "product": { "s": { "t": "string" }, "opt": true },
461
+ "id_token": { "s": { "t": "string" }, "opt": true },
462
+ "code": { "s": { "t": "string" }, "opt": true },
463
+ "customer_account_code": { "s": { "t": "string" }, "opt": true },
464
+ "redirect_uri": { "s": { "t": "string" }, "opt": true },
465
+ "username": { "s": { "t": "string" }, "opt": false },
466
+ "password": { "s": { "t": "string" }, "opt": false }
467
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }, { "t": "object", "props": {
468
+ "username": { "s": { "t": "string" }, "opt": true },
469
+ "password": { "s": { "t": "string" }, "opt": true },
470
+ "product": { "s": { "t": "string" }, "opt": true },
471
+ "code": { "s": { "t": "string" }, "opt": true },
472
+ "customer_account_code": { "s": { "t": "string" }, "opt": true },
473
+ "redirect_uri": { "s": { "t": "string" }, "opt": true },
474
+ "id_token": { "s": { "t": "string" }, "opt": false }
475
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }, { "t": "object", "props": {
476
+ "username": { "s": { "t": "string" }, "opt": true },
477
+ "password": { "s": { "t": "string" }, "opt": true },
478
+ "product": { "s": { "t": "string" }, "opt": true },
479
+ "id_token": { "s": { "t": "string" }, "opt": true },
480
+ "customer_account_code": { "s": { "t": "string" }, "opt": true },
481
+ "redirect_uri": { "s": { "t": "string" }, "opt": true },
482
+ "code": { "s": { "t": "string" }, "opt": false }
483
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }] });
258
484
  const { headers, response } = yield this.service.getRequest('user_licenses', payload);
259
485
  (0, common_1.checkSignatureV2)(this.config.publicKey, response, (0, common_1.getHeaderString)(headers, 'LicenseSignature'));
260
486
  return response;
@@ -263,7 +489,11 @@ let LicenseAPI = (() => {
263
489
  ;
264
490
  getCustomerLicenseUsers(payload) {
265
491
  return __awaiter(this, void 0, void 0, function* () {
266
- (0, assert_object_type_1.assertObjectType)(payload);
492
+ __v.assert(payload, { "t": "object", "props": {
493
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
494
+ "product": { "s": { "t": "string" }, "opt": false },
495
+ "customer": { "s": { "t": "string" }, "opt": false }
496
+ }, "index": { "key": "string", "s": { "t": "unknown" } } });
267
497
  const { headers, response } = yield this.service.getRequest('customer_license_users', payload);
268
498
  (0, common_1.checkSignatureV2)(this.config.publicKey, response, (0, common_1.getHeaderString)(headers, 'LicenseSignature'));
269
499
  return response;
@@ -272,7 +502,27 @@ let LicenseAPI = (() => {
272
502
  ;
273
503
  checkLicenseFeature(payload) {
274
504
  return __awaiter(this, void 0, void 0, function* () {
275
- (0, assert_object_type_1.assertObjectType)(payload);
505
+ __v.assert(payload, { "t": "union", "anyOf": [{ "t": "object", "props": {
506
+ "username": { "s": { "t": "string" }, "opt": true },
507
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
508
+ "license_id": { "s": { "t": "number" }, "opt": true },
509
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
510
+ "include_metadata_string": { "s": { "t": "union", "anyOf": [{ "t": "literal", "v": false }, { "t": "literal", "v": true }] }, "opt": true },
511
+ "license_key": { "s": { "t": "string" }, "opt": false },
512
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
513
+ "product": { "s": { "t": "string" }, "opt": false },
514
+ "feature": { "s": { "t": "string" }, "opt": false }
515
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }, { "t": "object", "props": {
516
+ "license_key": { "s": { "t": "string" }, "opt": true },
517
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
518
+ "license_id": { "s": { "t": "number" }, "opt": true },
519
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
520
+ "include_metadata_string": { "s": { "t": "union", "anyOf": [{ "t": "literal", "v": false }, { "t": "literal", "v": true }] }, "opt": true },
521
+ "username": { "s": { "t": "string" }, "opt": false },
522
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
523
+ "product": { "s": { "t": "string" }, "opt": false },
524
+ "feature": { "s": { "t": "string" }, "opt": false }
525
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }] });
276
526
  const { headers, response } = yield this.service.getRequest('check_license_feature', payload);
277
527
  (0, common_1.checkSignatureV2)(this.config.publicKey, response, (0, common_1.getHeaderString)(headers, 'LicenseSignature'));
278
528
  return response;
@@ -281,7 +531,33 @@ let LicenseAPI = (() => {
281
531
  ;
282
532
  addConsumption(payload) {
283
533
  return __awaiter(this, void 0, void 0, function* () {
284
- (0, assert_object_type_1.assertObjectType)(payload);
534
+ __v.assert(payload, { "t": "union", "anyOf": [{ "t": "object", "props": {
535
+ "username": { "s": { "t": "string" }, "opt": true },
536
+ "allow_overages": { "s": { "t": "union", "anyOf": [{ "t": "literal", "v": false }, { "t": "literal", "v": true }] }, "opt": true },
537
+ "max_overages": { "s": { "t": "number" }, "opt": true },
538
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
539
+ "license_id": { "s": { "t": "number" }, "opt": true },
540
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
541
+ "ignore_events": { "s": { "t": "union", "anyOf": [{ "t": "literal", "v": false }, { "t": "literal", "v": true }] }, "opt": true },
542
+ "event": { "s": { "t": "array", "items": { "t": "union", "anyOf": [{ "t": "literal", "v": "consumption_add" }, { "t": "literal", "v": "offline_floating_consumptions_sync" }] } }, "opt": true },
543
+ "license_key": { "s": { "t": "string" }, "opt": false },
544
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
545
+ "product": { "s": { "t": "string" }, "opt": false },
546
+ "consumptions": { "s": { "t": "number" }, "opt": false }
547
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }, { "t": "object", "props": {
548
+ "license_key": { "s": { "t": "string" }, "opt": true },
549
+ "allow_overages": { "s": { "t": "union", "anyOf": [{ "t": "literal", "v": false }, { "t": "literal", "v": true }] }, "opt": true },
550
+ "max_overages": { "s": { "t": "number" }, "opt": true },
551
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
552
+ "license_id": { "s": { "t": "number" }, "opt": true },
553
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
554
+ "ignore_events": { "s": { "t": "union", "anyOf": [{ "t": "literal", "v": false }, { "t": "literal", "v": true }] }, "opt": true },
555
+ "event": { "s": { "t": "array", "items": { "t": "union", "anyOf": [{ "t": "literal", "v": "consumption_add" }, { "t": "literal", "v": "offline_floating_consumptions_sync" }] } }, "opt": true },
556
+ "username": { "s": { "t": "string" }, "opt": false },
557
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
558
+ "product": { "s": { "t": "string" }, "opt": false },
559
+ "consumptions": { "s": { "t": "number" }, "opt": false }
560
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }] });
285
561
  const { headers, response } = yield this.service.postRequest('add_consumption', payload);
286
562
  (0, common_1.checkSignatureV2)(this.config.publicKey, response, (0, common_1.getHeaderString)(headers, 'LicenseSignature'));
287
563
  return response;
@@ -290,7 +566,29 @@ let LicenseAPI = (() => {
290
566
  ;
291
567
  addFeatureConsumption(payload) {
292
568
  return __awaiter(this, void 0, void 0, function* () {
293
- (0, assert_object_type_1.assertObjectType)(payload);
569
+ __v.assert(payload, { "t": "union", "anyOf": [{ "t": "object", "props": {
570
+ "username": { "s": { "t": "string" }, "opt": true },
571
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
572
+ "license_id": { "s": { "t": "number" }, "opt": true },
573
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
574
+ "event": { "s": { "t": "array", "items": { "t": "union", "anyOf": [{ "t": "literal", "v": "consumption_add" }, { "t": "literal", "v": "offline_floating_consumptions_sync" }] } }, "opt": true },
575
+ "license_key": { "s": { "t": "string" }, "opt": false },
576
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
577
+ "product": { "s": { "t": "string" }, "opt": false },
578
+ "feature": { "s": { "t": "string" }, "opt": false },
579
+ "consumptions": { "s": { "t": "number" }, "opt": false }
580
+ } }, { "t": "object", "props": {
581
+ "license_key": { "s": { "t": "string" }, "opt": true },
582
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
583
+ "license_id": { "s": { "t": "number" }, "opt": true },
584
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
585
+ "event": { "s": { "t": "array", "items": { "t": "union", "anyOf": [{ "t": "literal", "v": "consumption_add" }, { "t": "literal", "v": "offline_floating_consumptions_sync" }] } }, "opt": true },
586
+ "username": { "s": { "t": "string" }, "opt": false },
587
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
588
+ "product": { "s": { "t": "string" }, "opt": false },
589
+ "feature": { "s": { "t": "string" }, "opt": false },
590
+ "consumptions": { "s": { "t": "number" }, "opt": false }
591
+ } }] });
294
592
  const { headers, response } = yield this.service.postRequest('add_feature_consumption', payload);
295
593
  (0, common_1.checkSignatureV2)(this.config.publicKey, response, (0, common_1.getHeaderString)(headers, 'LicenseSignature'));
296
594
  return response;
@@ -299,7 +597,12 @@ let LicenseAPI = (() => {
299
597
  ;
300
598
  getProductDetails(payload) {
301
599
  return __awaiter(this, void 0, void 0, function* () {
302
- (0, assert_object_type_1.assertObjectType)(payload);
600
+ __v.assert(payload, { "t": "object", "props": {
601
+ "env": { "s": { "t": "string" }, "opt": true },
602
+ "include_latest_version": { "s": { "t": "union", "anyOf": [{ "t": "literal", "v": false }, { "t": "literal", "v": true }] }, "opt": true },
603
+ "include_custom_fields": { "s": { "t": "union", "anyOf": [{ "t": "literal", "v": false }, { "t": "literal", "v": true }] }, "opt": true },
604
+ "product": { "s": { "t": "string" }, "opt": false }
605
+ }, "index": { "key": "string", "s": { "t": "unknown" } } });
303
606
  const { headers, response } = yield this.service
304
607
  .getRequest('product_details', Object.assign({}, payload));
305
608
  (0, common_1.checkSignatureV2)(this.config.publicKey, response, (0, common_1.getHeaderString)(headers, 'LicenseSignature'));
@@ -309,7 +612,23 @@ let LicenseAPI = (() => {
309
612
  ;
310
613
  getDeviceVariables(payload) {
311
614
  return __awaiter(this, void 0, void 0, function* () {
312
- (0, assert_object_type_1.assertObjectType)(payload);
615
+ __v.assert(payload, { "t": "union", "anyOf": [{ "t": "object", "props": {
616
+ "username": { "s": { "t": "string" }, "opt": true },
617
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
618
+ "license_id": { "s": { "t": "number" }, "opt": true },
619
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
620
+ "license_key": { "s": { "t": "string" }, "opt": false },
621
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
622
+ "product": { "s": { "t": "string" }, "opt": false }
623
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }, { "t": "object", "props": {
624
+ "license_key": { "s": { "t": "string" }, "opt": true },
625
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
626
+ "license_id": { "s": { "t": "number" }, "opt": true },
627
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
628
+ "username": { "s": { "t": "string" }, "opt": false },
629
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
630
+ "product": { "s": { "t": "string" }, "opt": false }
631
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }] });
313
632
  const { headers, response } = yield this.service.getRequest('get_device_variables', payload);
314
633
  (0, common_1.checkSignatureV2)(this.config.publicKey, response, (0, common_1.getHeaderString)(headers, 'LicenseSignature'));
315
634
  return response;
@@ -318,7 +637,25 @@ let LicenseAPI = (() => {
318
637
  ;
319
638
  trackDeviceVariables(payload) {
320
639
  return __awaiter(this, void 0, void 0, function* () {
321
- (0, assert_object_type_1.assertObjectType)(payload);
640
+ __v.assert(payload, { "t": "union", "anyOf": [{ "t": "object", "props": {
641
+ "username": { "s": { "t": "string" }, "opt": true },
642
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
643
+ "license_id": { "s": { "t": "number" }, "opt": true },
644
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
645
+ "variables": { "s": { "t": "object", "props": {}, "index": { "key": "string", "s": { "t": "unknown" } } }, "opt": true },
646
+ "license_key": { "s": { "t": "string" }, "opt": false },
647
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
648
+ "product": { "s": { "t": "string" }, "opt": false }
649
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }, { "t": "object", "props": {
650
+ "license_key": { "s": { "t": "string" }, "opt": true },
651
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
652
+ "license_id": { "s": { "t": "number" }, "opt": true },
653
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
654
+ "variables": { "s": { "t": "object", "props": {}, "index": { "key": "string", "s": { "t": "unknown" } } }, "opt": true },
655
+ "username": { "s": { "t": "string" }, "opt": false },
656
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
657
+ "product": { "s": { "t": "string" }, "opt": false }
658
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }] });
322
659
  const { headers, response } = yield this.service.postRequest('track_device_variables', payload);
323
660
  (0, common_1.checkSignatureV2)(this.config.publicKey, response, (0, common_1.getHeaderString)(headers, 'LicenseSignature'));
324
661
  return response;
@@ -327,7 +664,63 @@ let LicenseAPI = (() => {
327
664
  ;
328
665
  floatingBorrow(payload) {
329
666
  return __awaiter(this, void 0, void 0, function* () {
330
- (0, assert_object_type_1.assertObjectType)(payload);
667
+ __v.assert(payload, { "t": "union", "anyOf": [{ "t": "object", "props": {
668
+ "username": { "s": { "t": "string" }, "opt": true },
669
+ "password": { "s": { "t": "string" }, "opt": true },
670
+ "id_token": { "s": { "t": "string" }, "opt": true },
671
+ "code": { "s": { "t": "string" }, "opt": true },
672
+ "customer_account_code": { "s": { "t": "string" }, "opt": true },
673
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
674
+ "license_id": { "s": { "t": "number" }, "opt": true },
675
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
676
+ "redirect_uri": { "s": { "t": "string" }, "opt": true },
677
+ "license_key": { "s": { "t": "string" }, "opt": false },
678
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
679
+ "product": { "s": { "t": "string" }, "opt": false },
680
+ "borrowed_until": { "s": { "t": "union", "anyOf": [{ "t": "null" }, { "t": "string" }] }, "opt": false }
681
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }, { "t": "object", "props": {
682
+ "license_key": { "s": { "t": "string" }, "opt": true },
683
+ "id_token": { "s": { "t": "string" }, "opt": true },
684
+ "code": { "s": { "t": "string" }, "opt": true },
685
+ "customer_account_code": { "s": { "t": "string" }, "opt": true },
686
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
687
+ "license_id": { "s": { "t": "number" }, "opt": true },
688
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
689
+ "redirect_uri": { "s": { "t": "string" }, "opt": true },
690
+ "username": { "s": { "t": "string" }, "opt": false },
691
+ "password": { "s": { "t": "string" }, "opt": false },
692
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
693
+ "product": { "s": { "t": "string" }, "opt": false },
694
+ "borrowed_until": { "s": { "t": "union", "anyOf": [{ "t": "null" }, { "t": "string" }] }, "opt": false }
695
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }, { "t": "object", "props": {
696
+ "license_key": { "s": { "t": "string" }, "opt": true },
697
+ "username": { "s": { "t": "string" }, "opt": true },
698
+ "password": { "s": { "t": "string" }, "opt": true },
699
+ "code": { "s": { "t": "string" }, "opt": true },
700
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
701
+ "license_id": { "s": { "t": "number" }, "opt": true },
702
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
703
+ "redirect_uri": { "s": { "t": "string" }, "opt": true },
704
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
705
+ "product": { "s": { "t": "string" }, "opt": false },
706
+ "id_token": { "s": { "t": "string" }, "opt": false },
707
+ "customer_account_code": { "s": { "t": "string" }, "opt": false },
708
+ "borrowed_until": { "s": { "t": "union", "anyOf": [{ "t": "null" }, { "t": "string" }] }, "opt": false }
709
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }, { "t": "object", "props": {
710
+ "license_key": { "s": { "t": "string" }, "opt": true },
711
+ "username": { "s": { "t": "string" }, "opt": true },
712
+ "password": { "s": { "t": "string" }, "opt": true },
713
+ "id_token": { "s": { "t": "string" }, "opt": true },
714
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
715
+ "license_id": { "s": { "t": "number" }, "opt": true },
716
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
717
+ "redirect_uri": { "s": { "t": "string" }, "opt": true },
718
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
719
+ "product": { "s": { "t": "string" }, "opt": false },
720
+ "code": { "s": { "t": "string" }, "opt": false },
721
+ "customer_account_code": { "s": { "t": "string" }, "opt": false },
722
+ "borrowed_until": { "s": { "t": "union", "anyOf": [{ "t": "null" }, { "t": "string" }] }, "opt": false }
723
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }] });
331
724
  const { headers, response } = yield this.service.postRequest('floating/borrow', payload);
332
725
  (0, common_1.checkSignatureV2)(this.config.publicKey, response, (0, common_1.getHeaderString)(headers, 'LicenseSignature'));
333
726
  return response;
@@ -336,7 +729,23 @@ let LicenseAPI = (() => {
336
729
  ;
337
730
  floatingRelease(payload) {
338
731
  return __awaiter(this, void 0, void 0, function* () {
339
- (0, assert_object_type_1.assertObjectType)(payload);
732
+ __v.assert(payload, { "t": "union", "anyOf": [{ "t": "object", "props": {
733
+ "username": { "s": { "t": "string" }, "opt": true },
734
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
735
+ "license_id": { "s": { "t": "number" }, "opt": true },
736
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
737
+ "license_key": { "s": { "t": "string" }, "opt": false },
738
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
739
+ "product": { "s": { "t": "string" }, "opt": false }
740
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }, { "t": "object", "props": {
741
+ "license_key": { "s": { "t": "string" }, "opt": true },
742
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
743
+ "license_id": { "s": { "t": "number" }, "opt": true },
744
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
745
+ "username": { "s": { "t": "string" }, "opt": false },
746
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
747
+ "product": { "s": { "t": "string" }, "opt": false }
748
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }] });
340
749
  yield this.service.postRequest('floating/release', payload);
341
750
  return true;
342
751
  });
@@ -344,7 +753,67 @@ let LicenseAPI = (() => {
344
753
  ;
345
754
  featureBorrow(payload) {
346
755
  return __awaiter(this, void 0, void 0, function* () {
347
- (0, assert_object_type_1.assertObjectType)(payload);
756
+ __v.assert(payload, { "t": "union", "anyOf": [{ "t": "object", "props": {
757
+ "username": { "s": { "t": "string" }, "opt": true },
758
+ "password": { "s": { "t": "string" }, "opt": true },
759
+ "id_token": { "s": { "t": "string" }, "opt": true },
760
+ "code": { "s": { "t": "string" }, "opt": true },
761
+ "customer_account_code": { "s": { "t": "string" }, "opt": true },
762
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
763
+ "license_id": { "s": { "t": "number" }, "opt": true },
764
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
765
+ "redirect_uri": { "s": { "t": "string" }, "opt": true },
766
+ "license_key": { "s": { "t": "string" }, "opt": false },
767
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
768
+ "product": { "s": { "t": "string" }, "opt": false },
769
+ "feature": { "s": { "t": "string" }, "opt": false },
770
+ "borrowed_until": { "s": { "t": "union", "anyOf": [{ "t": "null" }, { "t": "string" }] }, "opt": false }
771
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }, { "t": "object", "props": {
772
+ "license_key": { "s": { "t": "string" }, "opt": true },
773
+ "id_token": { "s": { "t": "string" }, "opt": true },
774
+ "code": { "s": { "t": "string" }, "opt": true },
775
+ "customer_account_code": { "s": { "t": "string" }, "opt": true },
776
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
777
+ "license_id": { "s": { "t": "number" }, "opt": true },
778
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
779
+ "redirect_uri": { "s": { "t": "string" }, "opt": true },
780
+ "username": { "s": { "t": "string" }, "opt": false },
781
+ "password": { "s": { "t": "string" }, "opt": false },
782
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
783
+ "product": { "s": { "t": "string" }, "opt": false },
784
+ "feature": { "s": { "t": "string" }, "opt": false },
785
+ "borrowed_until": { "s": { "t": "union", "anyOf": [{ "t": "null" }, { "t": "string" }] }, "opt": false }
786
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }, { "t": "object", "props": {
787
+ "license_key": { "s": { "t": "string" }, "opt": true },
788
+ "username": { "s": { "t": "string" }, "opt": true },
789
+ "password": { "s": { "t": "string" }, "opt": true },
790
+ "code": { "s": { "t": "string" }, "opt": true },
791
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
792
+ "license_id": { "s": { "t": "number" }, "opt": true },
793
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
794
+ "redirect_uri": { "s": { "t": "string" }, "opt": true },
795
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
796
+ "product": { "s": { "t": "string" }, "opt": false },
797
+ "id_token": { "s": { "t": "string" }, "opt": false },
798
+ "customer_account_code": { "s": { "t": "string" }, "opt": false },
799
+ "feature": { "s": { "t": "string" }, "opt": false },
800
+ "borrowed_until": { "s": { "t": "union", "anyOf": [{ "t": "null" }, { "t": "string" }] }, "opt": false }
801
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }, { "t": "object", "props": {
802
+ "license_key": { "s": { "t": "string" }, "opt": true },
803
+ "username": { "s": { "t": "string" }, "opt": true },
804
+ "password": { "s": { "t": "string" }, "opt": true },
805
+ "id_token": { "s": { "t": "string" }, "opt": true },
806
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
807
+ "license_id": { "s": { "t": "number" }, "opt": true },
808
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
809
+ "redirect_uri": { "s": { "t": "string" }, "opt": true },
810
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
811
+ "product": { "s": { "t": "string" }, "opt": false },
812
+ "code": { "s": { "t": "string" }, "opt": false },
813
+ "customer_account_code": { "s": { "t": "string" }, "opt": false },
814
+ "feature": { "s": { "t": "string" }, "opt": false },
815
+ "borrowed_until": { "s": { "t": "union", "anyOf": [{ "t": "null" }, { "t": "string" }] }, "opt": false }
816
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }] });
348
817
  const { headers, response } = yield this.service.postRequest('floating/feature_borrow', payload);
349
818
  (0, common_1.checkSignatureV2)(this.config.publicKey, response, (0, common_1.getHeaderString)(headers, 'LicenseSignature'));
350
819
  return response;
@@ -353,7 +822,25 @@ let LicenseAPI = (() => {
353
822
  ;
354
823
  featureRelease(payload) {
355
824
  return __awaiter(this, void 0, void 0, function* () {
356
- (0, assert_object_type_1.assertObjectType)(payload);
825
+ __v.assert(payload, { "t": "union", "anyOf": [{ "t": "object", "props": {
826
+ "username": { "s": { "t": "string" }, "opt": true },
827
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
828
+ "license_id": { "s": { "t": "number" }, "opt": true },
829
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
830
+ "license_key": { "s": { "t": "string" }, "opt": false },
831
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
832
+ "product": { "s": { "t": "string" }, "opt": false },
833
+ "feature": { "s": { "t": "string" }, "opt": false }
834
+ } }, { "t": "object", "props": {
835
+ "license_key": { "s": { "t": "string" }, "opt": true },
836
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
837
+ "license_id": { "s": { "t": "number" }, "opt": true },
838
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
839
+ "username": { "s": { "t": "string" }, "opt": false },
840
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
841
+ "product": { "s": { "t": "string" }, "opt": false },
842
+ "feature": { "s": { "t": "string" }, "opt": false }
843
+ } }] });
357
844
  yield this.service.postRequest('floating/feature_release', payload);
358
845
  return true;
359
846
  });
@@ -361,7 +848,11 @@ let LicenseAPI = (() => {
361
848
  ;
362
849
  changePassword(payload) {
363
850
  return __awaiter(this, void 0, void 0, function* () {
364
- (0, assert_object_type_1.assertObjectType)(payload);
851
+ __v.assert(payload, { "t": "object", "props": {
852
+ "username": { "s": { "t": "string" }, "opt": false },
853
+ "password": { "s": { "t": "string" }, "opt": false },
854
+ "new_password": { "s": { "t": "string" }, "opt": false }
855
+ }, "index": { "key": "string", "s": { "t": "unknown" } } });
365
856
  const { response } = yield this.service.postRequest('change_password', payload);
366
857
  return (0, common_1.assertResponseString)(response, 'password_changed');
367
858
  });
@@ -369,7 +860,25 @@ let LicenseAPI = (() => {
369
860
  ;
370
861
  getVersions(payload) {
371
862
  return __awaiter(this, void 0, void 0, function* () {
372
- (0, assert_object_type_1.assertObjectType)(payload);
863
+ __v.assert(payload, { "t": "union", "anyOf": [{ "t": "object", "props": {
864
+ "username": { "s": { "t": "string" }, "opt": true },
865
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
866
+ "env": { "s": { "t": "string" }, "opt": true },
867
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
868
+ "channel": { "s": { "t": "string" }, "opt": true },
869
+ "license_key": { "s": { "t": "string" }, "opt": false },
870
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
871
+ "product": { "s": { "t": "string" }, "opt": false }
872
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }, { "t": "object", "props": {
873
+ "license_key": { "s": { "t": "string" }, "opt": true },
874
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
875
+ "env": { "s": { "t": "string" }, "opt": true },
876
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
877
+ "channel": { "s": { "t": "string" }, "opt": true },
878
+ "username": { "s": { "t": "string" }, "opt": false },
879
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
880
+ "product": { "s": { "t": "string" }, "opt": false }
881
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }] });
373
882
  const { headers, response } = yield this.service.getRequest('versions', payload);
374
883
  (0, common_1.checkSignatureV2)(this.config.publicKey, response, (0, common_1.getHeaderString)(headers, 'LicenseSignature'));
375
884
  return response;
@@ -378,7 +887,27 @@ let LicenseAPI = (() => {
378
887
  ;
379
888
  getInstallationFile(payload) {
380
889
  return __awaiter(this, void 0, void 0, function* () {
381
- (0, assert_object_type_1.assertObjectType)(payload);
890
+ __v.assert(payload, { "t": "union", "anyOf": [{ "t": "object", "props": {
891
+ "username": { "s": { "t": "string" }, "opt": true },
892
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
893
+ "env": { "s": { "t": "string" }, "opt": true },
894
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
895
+ "channel": { "s": { "t": "string" }, "opt": true },
896
+ "version": { "s": { "t": "string" }, "opt": true },
897
+ "license_key": { "s": { "t": "string" }, "opt": false },
898
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
899
+ "product": { "s": { "t": "string" }, "opt": false }
900
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }, { "t": "object", "props": {
901
+ "license_key": { "s": { "t": "string" }, "opt": true },
902
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
903
+ "env": { "s": { "t": "string" }, "opt": true },
904
+ "sdk_ver": { "s": { "t": "string" }, "opt": true },
905
+ "channel": { "s": { "t": "string" }, "opt": true },
906
+ "version": { "s": { "t": "string" }, "opt": true },
907
+ "username": { "s": { "t": "string" }, "opt": false },
908
+ "hardware_id": { "s": { "t": "string" }, "opt": false },
909
+ "product": { "s": { "t": "string" }, "opt": false }
910
+ }, "index": { "key": "string", "s": { "t": "unknown" } } }] });
382
911
  const { headers, response } = yield this.service.getRequest('installation_file', payload);
383
912
  (0, common_1.checkSignatureV2)(this.config.publicKey, response, (0, common_1.getHeaderString)(headers, 'LicenseSignature'));
384
913
  return response;
@@ -387,7 +916,13 @@ let LicenseAPI = (() => {
387
916
  ;
388
917
  getSSOUrl(payload) {
389
918
  return __awaiter(this, void 0, void 0, function* () {
390
- (0, assert_object_type_1.assertObjectType)(payload);
919
+ __v.assert(payload, { "t": "object", "props": {
920
+ "bundle_code": { "s": { "t": "string" }, "opt": true },
921
+ "redirect_uri": { "s": { "t": "string" }, "opt": true },
922
+ "response_type": { "s": { "t": "union", "anyOf": [{ "t": "literal", "v": "code" }, { "t": "literal", "v": "token" }] }, "opt": true },
923
+ "product": { "s": { "t": "string" }, "opt": false },
924
+ "customer_account_code": { "s": { "t": "string" }, "opt": false }
925
+ } });
391
926
  const { headers, response } = yield this.service.getRequest('sso_url', payload);
392
927
  (0, common_1.checkSignatureV2)(this.config.publicKey, response, (0, common_1.getHeaderString)(headers, 'LicenseSignature'));
393
928
  return response;
@@ -461,7 +996,7 @@ let LicenseAPI = (() => {
461
996
  return payloadObject;
462
997
  }
463
998
  createOfflineActivationPayload(payload) {
464
- (0, assert_object_type_1.assertObjectType)(payload);
999
+ __v.assert(payload, { "t": "union", "anyOf": [{ "t": "unknown" }, { "t": "unknown" }] });
465
1000
  const fullPayload = Object.assign(Object.assign({}, payload), { sdk_ver: version_1.default, app_name: this.config.appName, app_ver: this.config.appVersion, request_id: (0, uuid_1.v4)(), request: 'activation', schema_version: 2 });
466
1001
  if ('apiKey' in this.config) {
467
1002
  fullPayload.api_key = this.config.apiKey;
@@ -472,7 +1007,7 @@ let LicenseAPI = (() => {
472
1007
  return Buffer.from(JSON.stringify(this.wrapSignOfflinePayload(fullPayload))).toString('base64');
473
1008
  }
474
1009
  createOfflineDeactivationPayload(payload) {
475
- (0, assert_object_type_1.assertObjectType)(payload);
1010
+ __v.assert(payload, { "t": "union", "anyOf": [{ "t": "unknown" }, { "t": "unknown" }] });
476
1011
  const fullPayload = Object.assign(Object.assign({}, payload), { sdk_ver: version_1.default, app_name: this.config.appName, app_ver: this.config.appVersion, request_id: (0, uuid_1.v4)(), request: 'deactivation', schema_version: 2 });
477
1012
  if ('apiKey' in this.config) {
478
1013
  fullPayload.api_key = this.config.apiKey;
@@ -520,7 +1055,7 @@ let LicenseAPI = (() => {
520
1055
  throw new Error('Invalid activation data');
521
1056
  }
522
1057
  decodedPayload = this.getOfflinePayload(decodedPayload);
523
- (0, assert_object_type_1.assertObjectType)(decodedPayload);
1058
+ __v.assert(decodedPayload, { "t": "unknown" });
524
1059
  (0, common_1.checkSignatureV1)(this.config.publicKey, decodedPayload, decodedPayload);
525
1060
  const responsePartial = decodedPayload;
526
1061
  const signatureV2 = decodedPayload.license_signature_v2;