@licensespring/node-sdk 1.1.14 → 1.1.16-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/README.md +62 -2
- package/dist/.env.prod +2 -0
- package/dist/hwid/lib/linux/aarch64/glibc/libhardware_id_generator.so +0 -0
- package/dist/hwid/lib/linux/aarch64/musl/libhardware_id_generator.so +0 -0
- package/dist/hwid/lib/linux/arm/glibc/libhardware_id_generator.so +0 -0
- package/dist/hwid/lib/linux/arm/musl/libhardware_id_generator.so +0 -0
- package/dist/hwid/lib/linux/i686/glibc/libhardware_id_generator.so +0 -0
- package/dist/hwid/lib/linux/i686/musl/libhardware_id_generator.so +0 -0
- package/dist/hwid/lib/linux/ppc64le/glibc/libhardware_id_generator.so +0 -0
- package/dist/hwid/lib/linux/ppc64le/musl/libhardware_id_generator.so +0 -0
- package/dist/hwid/lib/linux/riscv64/glibc/libhardware_id_generator.so +0 -0
- package/dist/hwid/lib/linux/riscv64/musl/libhardware_id_generator.so +0 -0
- package/dist/hwid/lib/linux/s390x/glibc/libhardware_id_generator.so +0 -0
- package/dist/hwid/lib/linux/s390x/musl/libhardware_id_generator.so +0 -0
- package/dist/hwid/lib/linux/x86_64/glibc/libhardware_id_generator.so +0 -0
- package/dist/hwid/lib/linux/x86_64/musl/libhardware_id_generator.so +0 -0
- package/dist/hwid/lib/macos/arm64/libhardware_id_generator.so +0 -0
- package/dist/hwid/lib/macos/x86_64/libhardware_id_generator.so +0 -0
- package/dist/hwid/lib/windows/arm/hardware_id_generator.dll +0 -0
- package/dist/hwid/lib/windows/arm64/hardware_id_generator.dll +0 -0
- package/dist/hwid/lib/windows/x64/hardware_id_generator.dll +0 -0
- package/dist/hwid/lib/windows/x86/hardware_id_generator.dll +0 -0
- package/dist/package.json +2 -2
- package/dist/src/abstract-manager.d.ts +2 -1
- package/dist/src/abstract-manager.js +108 -6
- package/dist/src/abstract-manager.js.map +1 -1
- package/dist/src/api.d.ts +2 -1
- package/dist/src/api.js +7031 -6777
- package/dist/src/api.js.map +1 -1
- package/dist/src/common.d.ts +3 -2
- package/dist/src/common.js +10 -6
- package/dist/src/common.js.map +1 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.js +3 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/license-file.js +103 -5
- package/dist/src/license-file.js.map +1 -1
- package/dist/src/license-manager.js +782 -726
- package/dist/src/license-manager.js.map +1 -1
- package/dist/src/license.js +1 -1
- package/dist/src/license.js.map +1 -1
- package/dist/src/logger.d.ts +16 -0
- package/dist/src/logger.js +93 -0
- package/dist/src/logger.js.map +1 -0
- package/dist/src/service.d.ts +10 -2
- package/dist/src/service.js +47 -11
- package/dist/src/service.js.map +1 -1
- package/dist/src/types.d.ts +14 -4
- package/dist/src/types.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -35,10 +35,16 @@ const licenseAPI = new LicenseAPI({
|
|
|
35
35
|
The constructor takes the a single argument of the following type:
|
|
36
36
|
```typescript
|
|
37
37
|
{
|
|
38
|
-
/** your Licensespring API key */
|
|
38
|
+
/** your Licensespring API key - required if using API key-based authentication */
|
|
39
39
|
apiKey: string,
|
|
40
|
-
/** your Licensespring API Shared key **/
|
|
40
|
+
/** your Licensespring API Shared key - required if using API key-based authentication **/
|
|
41
41
|
sharedKey: string,
|
|
42
|
+
/** your OAuth client ID - required if using OAuth API authentication */
|
|
43
|
+
clientID: string,
|
|
44
|
+
/** your OAuth client secret - required if using OAuth API authentication */
|
|
45
|
+
clientSecret: string,
|
|
46
|
+
/** optional override for OAuth token url */
|
|
47
|
+
tokenUrl?: string,
|
|
42
48
|
/** custom name for your application */
|
|
43
49
|
appName: string,
|
|
44
50
|
/** custom version string for your application */
|
|
@@ -1008,6 +1014,60 @@ export enum HardwareIdAlgorithm {
|
|
|
1008
1014
|
|
|
1009
1015
|
```
|
|
1010
1016
|
|
|
1017
|
+
## Logging
|
|
1018
|
+
|
|
1019
|
+
The `Logger` class provides static properties which can be set to log events in the SDK. On the lowest level (`debug`), all function calls, function returns and exceptions are logged. You can also invoke logging functions manually. By default, all values are logged to both the js `console` and the log file. The log file is rotated after 5MB, with the last 5 files kept on disk. These values can be overriden by setting static properties on the `Logger` class.
|
|
1020
|
+
|
|
1021
|
+
The following is a list of the exposed static properties of the Logger, with their default values:
|
|
1022
|
+
```typescript
|
|
1023
|
+
/**
|
|
1024
|
+
* Sets the minimum logged level. Valid values are: 'off', 'debug', 'info', 'warn', 'error'
|
|
1025
|
+
*/
|
|
1026
|
+
static level: LogLevel = 'off';
|
|
1027
|
+
/**
|
|
1028
|
+
* Determines whether logged events are written to console
|
|
1029
|
+
*/
|
|
1030
|
+
static consoleLog: boolean = true;
|
|
1031
|
+
/**
|
|
1032
|
+
* Determines whether logged events are written to the log file
|
|
1033
|
+
*/
|
|
1034
|
+
static fileLog: boolean = true;
|
|
1035
|
+
/**
|
|
1036
|
+
* Path to the log file
|
|
1037
|
+
*/
|
|
1038
|
+
static logPath: string = resolve(process.cwd(), 'node_sdk.log');
|
|
1039
|
+
/**
|
|
1040
|
+
* Log file maximum size, for rotation purposes. When rotated, older log filenames will be appended with a sequential number, e.g. node_sdk.1.log
|
|
1041
|
+
*/
|
|
1042
|
+
static maxLogSize: number = 5 * 1024 * 1024;
|
|
1043
|
+
/**
|
|
1044
|
+
* Maximum number of old log files to keep
|
|
1045
|
+
*/
|
|
1046
|
+
static maxLogFiles: number = 5;
|
|
1047
|
+
```
|
|
1048
|
+
|
|
1049
|
+
The Logger provides the following static functions for manual logging:
|
|
1050
|
+
```typescript
|
|
1051
|
+
static debug(...args: any[]): void;
|
|
1052
|
+
static info(...args: any[]): void;
|
|
1053
|
+
static warn(...args: any[]): void;
|
|
1054
|
+
static error(...args: any[]): void;
|
|
1055
|
+
```
|
|
1056
|
+
|
|
1057
|
+
Example usage:
|
|
1058
|
+
|
|
1059
|
+
```typescript
|
|
1060
|
+
const { Logger } = require('@licensespring/node-sdk');
|
|
1061
|
+
|
|
1062
|
+
Logger.level = 'error';
|
|
1063
|
+
Logger.consoleLog = false;
|
|
1064
|
+
Logger.logPath = resolve(process.cwd(), 'my_log_file.log');
|
|
1065
|
+
|
|
1066
|
+
Logger.info('my custom logged value', { some_data: 123 });
|
|
1067
|
+
Logger.warn('my custom warning', 456);
|
|
1068
|
+
|
|
1069
|
+
```
|
|
1070
|
+
|
|
1011
1071
|
## License
|
|
1012
1072
|
|
|
1013
1073
|
* node.js SDK license: [LicenseSpring SDK Source Code License](LICENSE.md)
|
package/dist/.env.prod
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@licensespring/node-sdk",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.15-alpha",
|
|
4
4
|
"main": "dist/src/index.js",
|
|
5
5
|
"modules": "dist/src/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@types/elliptic": "^6.4.18",
|
|
22
22
|
"@types/eslint__js": "^8.42.3",
|
|
23
23
|
"@types/jest": "^29.5.13",
|
|
24
|
-
"cpx": "^1.5.0",
|
|
24
|
+
"@deboxsoft/cpx": "^1.5.0",
|
|
25
25
|
"eslint": "^9.11.1",
|
|
26
26
|
"jest": "^29.7.0",
|
|
27
27
|
"json-schema-to-ts": "^3.1.1",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import LicenseAPI from './api';
|
|
2
|
-
import { HardwareIdAlgorithm, LicensespringConfigDef } from './types';
|
|
2
|
+
import { HardwareIdAlgorithm, LicensespringConfigDef, LogLevel } from './types';
|
|
3
3
|
import LicenseFile from './license-file';
|
|
4
4
|
import License from './license';
|
|
5
5
|
import FloatingAPI from './floating';
|
|
@@ -13,6 +13,7 @@ export default class AbstractManager {
|
|
|
13
13
|
protected licenseFile: LicenseFile;
|
|
14
14
|
watchdog: Watchdog;
|
|
15
15
|
constructor(config: LicensespringConfigDef, hardwareIDMethod?: number);
|
|
16
|
+
setLogLevel(level: LogLevel): void;
|
|
16
17
|
setProxy(proxy: AxiosProxyConfig | null): void;
|
|
17
18
|
getHardwareID(algorithm?: HardwareIdAlgorithm): string;
|
|
18
19
|
loadLicense(): License;
|
|
@@ -42,11 +42,18 @@ const floating_1 = __importDefault(require("./floating"));
|
|
|
42
42
|
const watchdog_1 = require("./watchdog");
|
|
43
43
|
class AbstractManager {
|
|
44
44
|
constructor(config, hardwareIDMethod = 0) {
|
|
45
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
45
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
46
46
|
this.config = config;
|
|
47
47
|
this.hardwareIDMethod = hardwareIDMethod;
|
|
48
48
|
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: (_h = (_g = config.isGuardFileEnabled) !== null && _g !== void 0 ? _g : !!process.env.GUARD_FILE_ENABLED) !== null && _h !== void 0 ? _h : false, hardwareIDMethod: (_j = hardwareIDMethod !== null && hardwareIDMethod !== void 0 ? hardwareIDMethod : config.hardwareIDMethod) !== null && _j !== void 0 ? _j : 0, sdkVersion: version_1.default, proxy: config.proxy });
|
|
49
|
-
(() => { const $guard = typia_1.default.assert.guard; const $io0 = input => "string" === typeof input.apiKey && "string" === typeof input.sharedKey && "string" === typeof input.apiPath && "string" === typeof input.publicKey && "string" === typeof input.productCode && "string" === typeof input.appName && "string" === typeof input.appVersion && "string" === typeof input.filePath && "string" === typeof input.filename && "number" === typeof input.gracePeriod && "string" === typeof input.fileKey && (undefined === input.airGapKey || "string" === typeof input.airGapKey) && "boolean" === typeof input.isGuardFileEnabled && "number" === typeof input.hardwareIDMethod && "string" === typeof input.sdkVersion && (undefined === input.proxy || "object" === typeof input.proxy && null !== input.proxy && $io1(input.proxy)); const $io1 = input => "string" === typeof input.host && "number" === typeof input.port && (undefined === input.auth || "object" === typeof input.auth && null !== input.auth && $io2(input.auth)) && (undefined === input.protocol || "string" === typeof input.protocol); const $io2 = input => "string" === typeof input.username && "string" === typeof input.password; const $
|
|
49
|
+
(() => { const $guard = typia_1.default.assert.guard; const $io0 = input => "string" === typeof input.apiKey && "string" === typeof input.sharedKey && "string" === typeof input.apiPath && "string" === typeof input.publicKey && "string" === typeof input.productCode && "string" === typeof input.appName && "string" === typeof input.appVersion && "string" === typeof input.filePath && "string" === typeof input.filename && "number" === typeof input.gracePeriod && "string" === typeof input.fileKey && (undefined === input.airGapKey || "string" === typeof input.airGapKey) && "boolean" === typeof input.isGuardFileEnabled && "number" === typeof input.hardwareIDMethod && "string" === typeof input.sdkVersion && (undefined === input.proxy || "object" === typeof input.proxy && null !== input.proxy && $io1(input.proxy)) && (undefined === input.logLevel || "error" === input.logLevel || "off" === input.logLevel || "debug" === input.logLevel || "info" === input.logLevel || "warn" === input.logLevel); const $io1 = input => "string" === typeof input.host && "number" === typeof input.port && (undefined === input.auth || "object" === typeof input.auth && null !== input.auth && $io2(input.auth)) && (undefined === input.protocol || "string" === typeof input.protocol); const $io2 = input => "string" === typeof input.username && "string" === typeof input.password; const $io3 = input => "string" === typeof input.clientID && "string" === typeof input.clientSecret && "string" === typeof input.tokenUrl && "string" === typeof input.apiPath && "string" === typeof input.publicKey && "string" === typeof input.productCode && "string" === typeof input.appName && "string" === typeof input.appVersion && "string" === typeof input.filePath && "string" === typeof input.filename && "number" === typeof input.gracePeriod && "string" === typeof input.fileKey && (undefined === input.airGapKey || "string" === typeof input.airGapKey) && "boolean" === typeof input.isGuardFileEnabled && "number" === typeof input.hardwareIDMethod && "string" === typeof input.sdkVersion && (undefined === input.proxy || "object" === typeof input.proxy && null !== input.proxy && $io1(input.proxy)) && (undefined === input.logLevel || "error" === input.logLevel || "off" === input.logLevel || "debug" === input.logLevel || "info" === input.logLevel || "warn" === input.logLevel); const $iu0 = input => (() => {
|
|
50
|
+
if (undefined !== input.apiKey)
|
|
51
|
+
return $io0(input);
|
|
52
|
+
else if (undefined !== input.clientID)
|
|
53
|
+
return $io3(input);
|
|
54
|
+
else
|
|
55
|
+
return false;
|
|
56
|
+
})(); const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.apiKey || $guard(_exceptionable, {
|
|
50
57
|
path: _path + ".apiKey",
|
|
51
58
|
expected: "string",
|
|
52
59
|
value: input.apiKey
|
|
@@ -114,6 +121,10 @@ class AbstractManager {
|
|
|
114
121
|
path: _path + ".proxy",
|
|
115
122
|
expected: "(AxiosProxyConfig | undefined)",
|
|
116
123
|
value: input.proxy
|
|
124
|
+
}, _errorFactory)) && (undefined === input.logLevel || "error" === input.logLevel || "off" === input.logLevel || "debug" === input.logLevel || "info" === input.logLevel || "warn" === input.logLevel || $guard(_exceptionable, {
|
|
125
|
+
path: _path + ".logLevel",
|
|
126
|
+
expected: "(\"debug\" | \"error\" | \"info\" | \"off\" | \"warn\" | undefined)",
|
|
127
|
+
value: input.logLevel
|
|
117
128
|
}, _errorFactory)); const $ao1 = (input, _path, _exceptionable = true) => ("string" === typeof input.host || $guard(_exceptionable, {
|
|
118
129
|
path: _path + ".host",
|
|
119
130
|
expected: "string",
|
|
@@ -142,16 +153,103 @@ class AbstractManager {
|
|
|
142
153
|
path: _path + ".password",
|
|
143
154
|
expected: "string",
|
|
144
155
|
value: input.password
|
|
145
|
-
}, _errorFactory)); const
|
|
156
|
+
}, _errorFactory)); const $ao3 = (input, _path, _exceptionable = true) => ("string" === typeof input.clientID || $guard(_exceptionable, {
|
|
157
|
+
path: _path + ".clientID",
|
|
158
|
+
expected: "string",
|
|
159
|
+
value: input.clientID
|
|
160
|
+
}, _errorFactory)) && ("string" === typeof input.clientSecret || $guard(_exceptionable, {
|
|
161
|
+
path: _path + ".clientSecret",
|
|
162
|
+
expected: "string",
|
|
163
|
+
value: input.clientSecret
|
|
164
|
+
}, _errorFactory)) && ("string" === typeof input.tokenUrl || $guard(_exceptionable, {
|
|
165
|
+
path: _path + ".tokenUrl",
|
|
166
|
+
expected: "string",
|
|
167
|
+
value: input.tokenUrl
|
|
168
|
+
}, _errorFactory)) && ("string" === typeof input.apiPath || $guard(_exceptionable, {
|
|
169
|
+
path: _path + ".apiPath",
|
|
170
|
+
expected: "string",
|
|
171
|
+
value: input.apiPath
|
|
172
|
+
}, _errorFactory)) && ("string" === typeof input.publicKey || $guard(_exceptionable, {
|
|
173
|
+
path: _path + ".publicKey",
|
|
174
|
+
expected: "string",
|
|
175
|
+
value: input.publicKey
|
|
176
|
+
}, _errorFactory)) && ("string" === typeof input.productCode || $guard(_exceptionable, {
|
|
177
|
+
path: _path + ".productCode",
|
|
178
|
+
expected: "string",
|
|
179
|
+
value: input.productCode
|
|
180
|
+
}, _errorFactory)) && ("string" === typeof input.appName || $guard(_exceptionable, {
|
|
181
|
+
path: _path + ".appName",
|
|
182
|
+
expected: "string",
|
|
183
|
+
value: input.appName
|
|
184
|
+
}, _errorFactory)) && ("string" === typeof input.appVersion || $guard(_exceptionable, {
|
|
185
|
+
path: _path + ".appVersion",
|
|
186
|
+
expected: "string",
|
|
187
|
+
value: input.appVersion
|
|
188
|
+
}, _errorFactory)) && ("string" === typeof input.filePath || $guard(_exceptionable, {
|
|
189
|
+
path: _path + ".filePath",
|
|
190
|
+
expected: "string",
|
|
191
|
+
value: input.filePath
|
|
192
|
+
}, _errorFactory)) && ("string" === typeof input.filename || $guard(_exceptionable, {
|
|
193
|
+
path: _path + ".filename",
|
|
194
|
+
expected: "string",
|
|
195
|
+
value: input.filename
|
|
196
|
+
}, _errorFactory)) && ("number" === typeof input.gracePeriod || $guard(_exceptionable, {
|
|
197
|
+
path: _path + ".gracePeriod",
|
|
198
|
+
expected: "number",
|
|
199
|
+
value: input.gracePeriod
|
|
200
|
+
}, _errorFactory)) && ("string" === typeof input.fileKey || $guard(_exceptionable, {
|
|
201
|
+
path: _path + ".fileKey",
|
|
202
|
+
expected: "string",
|
|
203
|
+
value: input.fileKey
|
|
204
|
+
}, _errorFactory)) && (undefined === input.airGapKey || "string" === typeof input.airGapKey || $guard(_exceptionable, {
|
|
205
|
+
path: _path + ".airGapKey",
|
|
206
|
+
expected: "(string | undefined)",
|
|
207
|
+
value: input.airGapKey
|
|
208
|
+
}, _errorFactory)) && ("boolean" === typeof input.isGuardFileEnabled || $guard(_exceptionable, {
|
|
209
|
+
path: _path + ".isGuardFileEnabled",
|
|
210
|
+
expected: "boolean",
|
|
211
|
+
value: input.isGuardFileEnabled
|
|
212
|
+
}, _errorFactory)) && ("number" === typeof input.hardwareIDMethod || $guard(_exceptionable, {
|
|
213
|
+
path: _path + ".hardwareIDMethod",
|
|
214
|
+
expected: "number",
|
|
215
|
+
value: input.hardwareIDMethod
|
|
216
|
+
}, _errorFactory)) && ("string" === typeof input.sdkVersion || $guard(_exceptionable, {
|
|
217
|
+
path: _path + ".sdkVersion",
|
|
218
|
+
expected: "string",
|
|
219
|
+
value: input.sdkVersion
|
|
220
|
+
}, _errorFactory)) && (undefined === input.proxy || ("object" === typeof input.proxy && null !== input.proxy || $guard(_exceptionable, {
|
|
221
|
+
path: _path + ".proxy",
|
|
222
|
+
expected: "(AxiosProxyConfig | undefined)",
|
|
223
|
+
value: input.proxy
|
|
224
|
+
}, _errorFactory)) && $ao1(input.proxy, _path + ".proxy", true && _exceptionable) || $guard(_exceptionable, {
|
|
225
|
+
path: _path + ".proxy",
|
|
226
|
+
expected: "(AxiosProxyConfig | undefined)",
|
|
227
|
+
value: input.proxy
|
|
228
|
+
}, _errorFactory)) && (undefined === input.logLevel || "error" === input.logLevel || "off" === input.logLevel || "debug" === input.logLevel || "info" === input.logLevel || "warn" === input.logLevel || $guard(_exceptionable, {
|
|
229
|
+
path: _path + ".logLevel",
|
|
230
|
+
expected: "(\"debug\" | \"error\" | \"info\" | \"off\" | \"warn\" | undefined)",
|
|
231
|
+
value: input.logLevel
|
|
232
|
+
}, _errorFactory)); const $au0 = (input, _path, _exceptionable = true) => (() => {
|
|
233
|
+
if (undefined !== input.apiKey)
|
|
234
|
+
return $ao0(input, _path, true && _exceptionable);
|
|
235
|
+
else if (undefined !== input.clientID)
|
|
236
|
+
return $ao3(input, _path, true && _exceptionable);
|
|
237
|
+
else
|
|
238
|
+
return $guard(_exceptionable, {
|
|
239
|
+
path: _path,
|
|
240
|
+
expected: "({ apiKey: string; sharedKey: string; } & { apiPath: string; publicKey: string; productCode: string; appName: string; appVersion: string; filePath: string; filename: string; gracePeriod: number; ... 6 more ...; logLevel?: LogLevel | undefined; } | { clientID: string; clientSecret: string; tokenUrl: string; } & { apiPath: string; publicKey: string; productCode: string; appName: string; appVersion: string; filePath: string; filename: string; ... 7 more ...; logLevel?: LogLevel | undefined; })",
|
|
241
|
+
value: input
|
|
242
|
+
}, _errorFactory);
|
|
243
|
+
})(); const __is = input => "object" === typeof input && null !== input && $iu0(input); let _errorFactory; return (input, errorFactory) => {
|
|
146
244
|
if (false === __is(input)) {
|
|
147
245
|
_errorFactory = errorFactory;
|
|
148
246
|
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
|
|
149
247
|
path: _path + "",
|
|
150
|
-
expected: "
|
|
248
|
+
expected: "({ apiKey: string; sharedKey: string; } & { apiPath: string; publicKey: string; productCode: string; appName: string; appVersion: string; filePath: string; filename: string; gracePeriod: number; ... 6 more ...; logLevel?: LogLevel | undefined; } | { clientID: string; clientSecret: string; tokenUrl: string; } & { apiPath: string; publicKey: string; productCode: string; appName: string; appVersion: string; filePath: string; filename: string; ... 7 more ...; logLevel?: LogLevel | undefined; })",
|
|
151
249
|
value: input
|
|
152
|
-
}, _errorFactory)) && $
|
|
250
|
+
}, _errorFactory)) && $au0(input, _path + "", true) || $guard(true, {
|
|
153
251
|
path: _path + "",
|
|
154
|
-
expected: "
|
|
252
|
+
expected: "({ apiKey: string; sharedKey: string; } & { apiPath: string; publicKey: string; productCode: string; appName: string; appVersion: string; filePath: string; filename: string; gracePeriod: number; ... 6 more ...; logLevel?: LogLevel | undefined; } | { clientID: string; clientSecret: string; tokenUrl: string; } & { apiPath: string; publicKey: string; productCode: string; appName: string; appVersion: string; filePath: string; filename: string; ... 7 more ...; logLevel?: LogLevel | undefined; })",
|
|
155
253
|
value: input
|
|
156
254
|
}, _errorFactory))(input, "$input", true);
|
|
157
255
|
}
|
|
@@ -173,6 +271,10 @@ class AbstractManager {
|
|
|
173
271
|
this.floatingAPI = new floating_1.default(_config, this.config.productCode);
|
|
174
272
|
this.watchdog = new watchdog_1.Watchdog(new license_1.default(this.config.productCode, this.licenseAPI, this.licenseFile, this.floatingAPI));
|
|
175
273
|
this.config = _config;
|
|
274
|
+
this.setLogLevel((_k = config.logLevel) !== null && _k !== void 0 ? _k : 'off');
|
|
275
|
+
}
|
|
276
|
+
setLogLevel(level) {
|
|
277
|
+
this.licenseAPI.setLogLevel(level);
|
|
176
278
|
}
|
|
177
279
|
setProxy(proxy) {
|
|
178
280
|
this.config.proxy = proxy !== null && proxy !== void 0 ? proxy : undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-manager.js","sourceRoot":"","sources":["../../src/abstract-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA+B;AAE/B,k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AED,IAAW,eAAe;QACxB,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;IAC9B,CAAC;CACF;AA3ED,kCA2EC"}
|
package/dist/src/api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreateOfflineActivationRequestPayload, CreateOfflineDeactivationRequestPayload, CustomerLicenseUsersResponse, DeviceVariable, HardwareIdAlgorithm, InstallationFileResponse, LicenseBorrowResponse, LicenseConsumptionsResponse, LicenseFeatureConsumptionResponse, LicenseFeatureResponse, LicenseTrialResponse, LicensespringAPIConfig, LicensespringAPIConfigDef, ProductDetailsResponse, VersionsResponse } from './types';
|
|
1
|
+
import { CreateOfflineActivationRequestPayload, CreateOfflineDeactivationRequestPayload, CustomerLicenseUsersResponse, DeviceVariable, HardwareIdAlgorithm, InstallationFileResponse, LicenseBorrowResponse, LicenseConsumptionsResponse, LicenseFeatureConsumptionResponse, LicenseFeatureResponse, LicenseTrialResponse, LicensespringAPIConfig, LicensespringAPIConfigDef, LogLevel, ProductDetailsResponse, VersionsResponse } from './types';
|
|
2
2
|
import OfflineActivation from './offline-activation';
|
|
3
3
|
import { FromSchema } from 'json-schema-to-ts';
|
|
4
4
|
import { AxiosProxyConfig } from 'axios';
|
|
@@ -9,6 +9,7 @@ export default class LicenseAPI {
|
|
|
9
9
|
constructor(config: LicensespringAPIConfigDef);
|
|
10
10
|
getHardwareID(algorithm?: HardwareIdAlgorithm): string;
|
|
11
11
|
setProxy(proxy: AxiosProxyConfig | null): void;
|
|
12
|
+
setLogLevel(level: LogLevel): void;
|
|
12
13
|
checkLicense(payload: FromSchema<(typeof checkLicense)['querystring']>, includeExpiredFeatures?: boolean): Promise<({
|
|
13
14
|
id: number;
|
|
14
15
|
allow_grace_period: boolean;
|