@licensespring/node-sdk 1.4.8-alpha → 1.4.10

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