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