@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
|
@@ -15,6 +15,40 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
19
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
20
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
21
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
22
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
23
|
+
var _, done = false;
|
|
24
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
25
|
+
var context = {};
|
|
26
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
27
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
28
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
29
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
30
|
+
if (kind === "accessor") {
|
|
31
|
+
if (result === void 0) continue;
|
|
32
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
33
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
34
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
35
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
36
|
+
}
|
|
37
|
+
else if (_ = accept(result)) {
|
|
38
|
+
if (kind === "field") initializers.unshift(_);
|
|
39
|
+
else descriptor[key] = _;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
43
|
+
done = true;
|
|
44
|
+
};
|
|
45
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
46
|
+
var useValue = arguments.length > 2;
|
|
47
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
48
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
49
|
+
}
|
|
50
|
+
return useValue ? value : void 0;
|
|
51
|
+
};
|
|
18
52
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
53
|
if (mod && mod.__esModule) return mod;
|
|
20
54
|
var result = {};
|
|
@@ -31,6 +65,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
31
65
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
66
|
});
|
|
33
67
|
};
|
|
68
|
+
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
69
|
+
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
70
|
+
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
71
|
+
};
|
|
34
72
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
73
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
74
|
};
|
|
@@ -46,745 +84,763 @@ dayjs_1.default.extend(utc_js_1.default);
|
|
|
46
84
|
dayjs_1.default.extend(isSameOrAfter_js_1.default);
|
|
47
85
|
const dotenv = __importStar(require("dotenv"));
|
|
48
86
|
const license_1 = __importDefault(require("./license"));
|
|
87
|
+
const logger_1 = require("./logger");
|
|
49
88
|
dotenv.config({ path: path.join(__dirname, `../.env.${process.env.NODE_ENV || 'prod'}`) });
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
89
|
+
let LicenseManager = (() => {
|
|
90
|
+
let _classDecorators = [logger_1.LogAllCalls];
|
|
91
|
+
let _classDescriptor;
|
|
92
|
+
let _classExtraInitializers = [];
|
|
93
|
+
let _classThis;
|
|
94
|
+
let _classSuper = abstract_manager_1.default;
|
|
95
|
+
var LicenseManager = _classThis = class extends _classSuper {
|
|
96
|
+
checkLicenseStatus(license) {
|
|
97
|
+
if (!license.license_enabled) {
|
|
98
|
+
throw { status: 400, code: 'license_not_enabled', message: 'The license is not enabled' };
|
|
99
|
+
}
|
|
100
|
+
if (!license.license_active) {
|
|
101
|
+
throw { status: 400, code: 'license_not_active', message: 'The license is not active' };
|
|
102
|
+
}
|
|
103
|
+
if (license.validity_period) {
|
|
104
|
+
if ((0, dayjs_1.default)().utc().startOf('day').isSameOrAfter(license.validity_period)) {
|
|
105
|
+
throw { status: 400, code: 'license_expired', message: 'The license is expired' };
|
|
106
|
+
}
|
|
61
107
|
}
|
|
62
108
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
109
|
+
isValid(license) {
|
|
110
|
+
if (!license.license_enabled) {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
if (!license.license_active) {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
if (license.validity_period) {
|
|
117
|
+
if ((0, dayjs_1.default)().utc().startOf('day').isSameOrAfter(license.validity_period)) {
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return true;
|
|
67
122
|
}
|
|
68
|
-
|
|
69
|
-
|
|
123
|
+
maintenanceDaysRemaining(license) {
|
|
124
|
+
if (license.enable_maintenance_period) {
|
|
125
|
+
return (0, dayjs_1.default)(license.maintenance_period).utc().endOf('day').diff((0, dayjs_1.default)().utc().startOf('day'), 'day');
|
|
126
|
+
}
|
|
127
|
+
return null;
|
|
70
128
|
}
|
|
71
|
-
|
|
72
|
-
if (
|
|
73
|
-
return
|
|
129
|
+
daysRemaining(license) {
|
|
130
|
+
if (license.validity_period) {
|
|
131
|
+
return (0, dayjs_1.default)(license.validity_period).utc().add(license.grace_period || 0, 'hours').endOf('day').diff((0, dayjs_1.default)().utc().startOf('day'), 'day');
|
|
74
132
|
}
|
|
75
133
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
134
|
+
checkLicense(payload) {
|
|
135
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
136
|
+
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
137
|
+
const value = input[key];
|
|
138
|
+
if (undefined === value)
|
|
139
|
+
return true;
|
|
140
|
+
return true;
|
|
141
|
+
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
142
|
+
const value = input[key];
|
|
143
|
+
if (undefined === value)
|
|
144
|
+
return true;
|
|
145
|
+
return true;
|
|
146
|
+
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
147
|
+
if (false === __is(input)) {
|
|
148
|
+
_errorFactory = errorFactory;
|
|
149
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
150
|
+
path: _path + "",
|
|
151
|
+
expected: "Managed<{ [x: string]: unknown; channel?: string | undefined; username?: string | undefined; env?: string | undefined; hostname?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; ... 9 more ...; license_key: string; } | { ...; }>",
|
|
152
|
+
value: input
|
|
153
|
+
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
154
|
+
path: _path + "",
|
|
155
|
+
expected: "Managed<{ [x: string]: unknown; channel?: string | undefined; username?: string | undefined; env?: string | undefined; hostname?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; ... 9 more ...; license_key: string; } | { ...; }>",
|
|
156
|
+
value: input
|
|
157
|
+
}, _errorFactory))(input, "$input", true);
|
|
158
|
+
}
|
|
159
|
+
return input;
|
|
160
|
+
}; })()(payload);
|
|
161
|
+
const response = yield this.licenseAPI.checkLicense(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
|
|
162
|
+
this.checkLicenseStatus(response);
|
|
163
|
+
this.licenseFile.licenseDataCache.updateCache('check_license', response);
|
|
164
|
+
this.licenseFile.saveLicenseFile();
|
|
165
|
+
return response;
|
|
166
|
+
});
|
|
81
167
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
168
|
+
;
|
|
169
|
+
activateLicense(payload) {
|
|
170
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
171
|
+
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
172
|
+
const value = input[key];
|
|
173
|
+
if (undefined === value)
|
|
174
|
+
return true;
|
|
175
|
+
return true;
|
|
176
|
+
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
177
|
+
const value = input[key];
|
|
178
|
+
if (undefined === value)
|
|
179
|
+
return true;
|
|
180
|
+
return true;
|
|
181
|
+
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
182
|
+
if (false === __is(input)) {
|
|
183
|
+
_errorFactory = errorFactory;
|
|
184
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
185
|
+
path: _path + "",
|
|
186
|
+
expected: "Managed<{ [x: string]: unknown; code?: string | undefined; username?: string | undefined; password?: string | undefined; id_token?: string | undefined; customer_account_code?: string | undefined; ... 4 more ...; license_key: string; } | { ...; } | { ...; } | { ...; }>",
|
|
187
|
+
value: input
|
|
188
|
+
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
189
|
+
path: _path + "",
|
|
190
|
+
expected: "Managed<{ [x: string]: unknown; code?: string | undefined; username?: string | undefined; password?: string | undefined; id_token?: string | undefined; customer_account_code?: string | undefined; ... 4 more ...; license_key: string; } | { ...; } | { ...; } | { ...; }>",
|
|
191
|
+
value: input
|
|
192
|
+
}, _errorFactory))(input, "$input", true);
|
|
193
|
+
}
|
|
194
|
+
return input;
|
|
195
|
+
}; })()(payload);
|
|
196
|
+
const response = yield this.licenseAPI.activateLicense(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
|
|
197
|
+
this.licenseFile.licenseDataCache.updateCache('activate_license', response);
|
|
198
|
+
this.licenseFile.saveLicenseFile();
|
|
199
|
+
return response;
|
|
200
|
+
});
|
|
87
201
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
127
|
-
const value = input[key];
|
|
128
|
-
if (undefined === value)
|
|
129
|
-
return true;
|
|
130
|
-
return true;
|
|
131
|
-
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
132
|
-
const value = input[key];
|
|
133
|
-
if (undefined === value)
|
|
134
|
-
return true;
|
|
135
|
-
return true;
|
|
136
|
-
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
137
|
-
if (false === __is(input)) {
|
|
138
|
-
_errorFactory = errorFactory;
|
|
139
|
-
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
140
|
-
path: _path + "",
|
|
141
|
-
expected: "Managed<{ [x: string]: unknown; code?: string | undefined; username?: string | undefined; password?: string | undefined; id_token?: string | undefined; customer_account_code?: string | undefined; ... 4 more ...; license_key: string; } | { ...; } | { ...; } | { ...; }>",
|
|
142
|
-
value: input
|
|
143
|
-
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
144
|
-
path: _path + "",
|
|
145
|
-
expected: "Managed<{ [x: string]: unknown; code?: string | undefined; username?: string | undefined; password?: string | undefined; id_token?: string | undefined; customer_account_code?: string | undefined; ... 4 more ...; license_key: string; } | { ...; } | { ...; } | { ...; }>",
|
|
146
|
-
value: input
|
|
147
|
-
}, _errorFactory))(input, "$input", true);
|
|
148
|
-
}
|
|
149
|
-
return input;
|
|
150
|
-
}; })()(payload);
|
|
151
|
-
const response = yield this.licenseAPI.activateLicense(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
|
|
152
|
-
this.licenseFile.licenseDataCache.updateCache('activate_license', response);
|
|
202
|
+
;
|
|
203
|
+
deactivateLicense(payload) {
|
|
204
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
205
|
+
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
206
|
+
const value = input[key];
|
|
207
|
+
if (undefined === value)
|
|
208
|
+
return true;
|
|
209
|
+
return true;
|
|
210
|
+
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
211
|
+
const value = input[key];
|
|
212
|
+
if (undefined === value)
|
|
213
|
+
return true;
|
|
214
|
+
return true;
|
|
215
|
+
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
216
|
+
if (false === __is(input)) {
|
|
217
|
+
_errorFactory = errorFactory;
|
|
218
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
219
|
+
path: _path + "",
|
|
220
|
+
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; product: string; hardware_id: string; license_key: string; } | { [x: string]: unknown; license_key?: string | undefined; bundle_code?: string | undefined; product: string; username: string; hardware_id: string; }>",
|
|
221
|
+
value: input
|
|
222
|
+
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
223
|
+
path: _path + "",
|
|
224
|
+
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; product: string; hardware_id: string; license_key: string; } | { [x: string]: unknown; license_key?: string | undefined; bundle_code?: string | undefined; product: string; username: string; hardware_id: string; }>",
|
|
225
|
+
value: input
|
|
226
|
+
}, _errorFactory))(input, "$input", true);
|
|
227
|
+
}
|
|
228
|
+
return input;
|
|
229
|
+
}; })()(payload);
|
|
230
|
+
const response = yield this.licenseAPI.deactivateLicense(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
|
|
231
|
+
this.licenseFile.licenseDataCache.deactivate();
|
|
232
|
+
this.licenseFile.saveLicenseFile();
|
|
233
|
+
return response;
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
;
|
|
237
|
+
activateOffline(payload) {
|
|
238
|
+
const response = this.licenseAPI.checkOfflineActivationResponse(payload);
|
|
239
|
+
this.licenseFile.licenseDataCache.updateCache('activate_license_offline', response);
|
|
153
240
|
this.licenseFile.saveLicenseFile();
|
|
154
241
|
return response;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
deactivateLicense(payload) {
|
|
159
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
160
|
-
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
161
|
-
const value = input[key];
|
|
162
|
-
if (undefined === value)
|
|
163
|
-
return true;
|
|
164
|
-
return true;
|
|
165
|
-
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
166
|
-
const value = input[key];
|
|
167
|
-
if (undefined === value)
|
|
168
|
-
return true;
|
|
169
|
-
return true;
|
|
170
|
-
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
171
|
-
if (false === __is(input)) {
|
|
172
|
-
_errorFactory = errorFactory;
|
|
173
|
-
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
174
|
-
path: _path + "",
|
|
175
|
-
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; product: string; hardware_id: string; license_key: string; } | { [x: string]: unknown; license_key?: string | undefined; bundle_code?: string | undefined; product: string; username: string; hardware_id: string; }>",
|
|
176
|
-
value: input
|
|
177
|
-
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
178
|
-
path: _path + "",
|
|
179
|
-
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; product: string; hardware_id: string; license_key: string; } | { [x: string]: unknown; license_key?: string | undefined; bundle_code?: string | undefined; product: string; username: string; hardware_id: string; }>",
|
|
180
|
-
value: input
|
|
181
|
-
}, _errorFactory))(input, "$input", true);
|
|
182
|
-
}
|
|
183
|
-
return input;
|
|
184
|
-
}; })()(payload);
|
|
185
|
-
const response = yield this.licenseAPI.deactivateLicense(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
|
|
242
|
+
}
|
|
243
|
+
;
|
|
244
|
+
deactivateOffline() {
|
|
186
245
|
this.licenseFile.licenseDataCache.deactivate();
|
|
187
246
|
this.licenseFile.saveLicenseFile();
|
|
247
|
+
}
|
|
248
|
+
;
|
|
249
|
+
getTrialKey(payload) {
|
|
250
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
251
|
+
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
252
|
+
const value = input[key];
|
|
253
|
+
if (undefined === value)
|
|
254
|
+
return true;
|
|
255
|
+
return true;
|
|
256
|
+
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
257
|
+
const value = input[key];
|
|
258
|
+
if (undefined === value)
|
|
259
|
+
return true;
|
|
260
|
+
return true;
|
|
261
|
+
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
262
|
+
if (false === __is(input)) {
|
|
263
|
+
_errorFactory = errorFactory;
|
|
264
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
265
|
+
path: _path + "",
|
|
266
|
+
expected: "Managed<__type>",
|
|
267
|
+
value: input
|
|
268
|
+
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
269
|
+
path: _path + "",
|
|
270
|
+
expected: "Managed<__type>",
|
|
271
|
+
value: input
|
|
272
|
+
}, _errorFactory))(input, "$input", true);
|
|
273
|
+
}
|
|
274
|
+
return input;
|
|
275
|
+
}; })()(payload);
|
|
276
|
+
const response = yield this.licenseAPI.getTrialKey(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
|
|
277
|
+
this.licenseFile.licenseDataCache.updateCache('activate_license', response);
|
|
278
|
+
this.licenseFile.saveLicenseFile();
|
|
279
|
+
return response;
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
;
|
|
283
|
+
getUserLicenses(payload) {
|
|
284
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
285
|
+
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
286
|
+
const value = input[key];
|
|
287
|
+
if (undefined === value)
|
|
288
|
+
return true;
|
|
289
|
+
return true;
|
|
290
|
+
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
291
|
+
const value = input[key];
|
|
292
|
+
if (undefined === value)
|
|
293
|
+
return true;
|
|
294
|
+
return true;
|
|
295
|
+
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
296
|
+
if (false === __is(input)) {
|
|
297
|
+
_errorFactory = errorFactory;
|
|
298
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
299
|
+
path: _path + "",
|
|
300
|
+
expected: "Managed<{ [x: string]: unknown; code?: string | undefined; product?: string | undefined; id_token?: string | undefined; customer_account_code?: string | undefined; username: string; password: string; } | { ...; } | { ...; }>",
|
|
301
|
+
value: input
|
|
302
|
+
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
303
|
+
path: _path + "",
|
|
304
|
+
expected: "Managed<{ [x: string]: unknown; code?: string | undefined; product?: string | undefined; id_token?: string | undefined; customer_account_code?: string | undefined; username: string; password: string; } | { ...; } | { ...; }>",
|
|
305
|
+
value: input
|
|
306
|
+
}, _errorFactory))(input, "$input", true);
|
|
307
|
+
}
|
|
308
|
+
return input;
|
|
309
|
+
}; })()(payload);
|
|
310
|
+
return yield this.licenseAPI.getUserLicenses(Object.assign(Object.assign({}, payload), { product: this.config.productCode }));
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
;
|
|
314
|
+
getCustomerLicenseUsers(payload) {
|
|
315
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
316
|
+
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
317
|
+
const value = input[key];
|
|
318
|
+
if (undefined === value)
|
|
319
|
+
return true;
|
|
320
|
+
return true;
|
|
321
|
+
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
322
|
+
const value = input[key];
|
|
323
|
+
if (undefined === value)
|
|
324
|
+
return true;
|
|
325
|
+
return true;
|
|
326
|
+
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
327
|
+
if (false === __is(input)) {
|
|
328
|
+
_errorFactory = errorFactory;
|
|
329
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
330
|
+
path: _path + "",
|
|
331
|
+
expected: "Managed<__type>",
|
|
332
|
+
value: input
|
|
333
|
+
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
334
|
+
path: _path + "",
|
|
335
|
+
expected: "Managed<__type>",
|
|
336
|
+
value: input
|
|
337
|
+
}, _errorFactory))(input, "$input", true);
|
|
338
|
+
}
|
|
339
|
+
return input;
|
|
340
|
+
}; })()(payload);
|
|
341
|
+
return yield this.licenseAPI.getCustomerLicenseUsers(Object.assign(Object.assign({}, payload), { product: this.config.productCode }));
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
;
|
|
345
|
+
checkLicenseFeature(payload) {
|
|
346
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
347
|
+
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
348
|
+
const value = input[key];
|
|
349
|
+
if (undefined === value)
|
|
350
|
+
return true;
|
|
351
|
+
return true;
|
|
352
|
+
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
353
|
+
const value = input[key];
|
|
354
|
+
if (undefined === value)
|
|
355
|
+
return true;
|
|
356
|
+
return true;
|
|
357
|
+
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
358
|
+
if (false === __is(input)) {
|
|
359
|
+
_errorFactory = errorFactory;
|
|
360
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
361
|
+
path: _path + "",
|
|
362
|
+
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; include_metadata_string?: boolean | undefined; product: string; hardware_id: string; license_key: string; feature: string; } | { ...; }>",
|
|
363
|
+
value: input
|
|
364
|
+
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
365
|
+
path: _path + "",
|
|
366
|
+
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; include_metadata_string?: boolean | undefined; product: string; hardware_id: string; license_key: string; feature: string; } | { ...; }>",
|
|
367
|
+
value: input
|
|
368
|
+
}, _errorFactory))(input, "$input", true);
|
|
369
|
+
}
|
|
370
|
+
return input;
|
|
371
|
+
}; })()(payload);
|
|
372
|
+
return yield this.licenseAPI.checkLicenseFeature(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
;
|
|
376
|
+
addConsumption(payload) {
|
|
377
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
378
|
+
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
379
|
+
const value = input[key];
|
|
380
|
+
if (undefined === value)
|
|
381
|
+
return true;
|
|
382
|
+
return true;
|
|
383
|
+
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
384
|
+
const value = input[key];
|
|
385
|
+
if (undefined === value)
|
|
386
|
+
return true;
|
|
387
|
+
return true;
|
|
388
|
+
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
389
|
+
if (false === __is(input)) {
|
|
390
|
+
_errorFactory = errorFactory;
|
|
391
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
392
|
+
path: _path + "",
|
|
393
|
+
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; event?: (\"consumption_add\" | \"offline_floating_consumptions_sync\")[] | undefined; allow_overages?: boolean | undefined; max_overages?: number | undefined; ... 7 more ...; consumptions: number; } | { ...; }>",
|
|
394
|
+
value: input
|
|
395
|
+
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
396
|
+
path: _path + "",
|
|
397
|
+
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; event?: (\"consumption_add\" | \"offline_floating_consumptions_sync\")[] | undefined; allow_overages?: boolean | undefined; max_overages?: number | undefined; ... 7 more ...; consumptions: number; } | { ...; }>",
|
|
398
|
+
value: input
|
|
399
|
+
}, _errorFactory))(input, "$input", true);
|
|
400
|
+
}
|
|
401
|
+
return input;
|
|
402
|
+
}; })()(payload);
|
|
403
|
+
const response = yield this.licenseAPI.addConsumption(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
|
|
404
|
+
this.licenseFile.licenseDataCache.updateCache('license_consumption', response);
|
|
405
|
+
this.licenseFile.saveLicenseFile();
|
|
406
|
+
return response;
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
;
|
|
410
|
+
addFeatureConsumption(payload) {
|
|
411
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
412
|
+
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
413
|
+
const value = input[key];
|
|
414
|
+
if (undefined === value)
|
|
415
|
+
return true;
|
|
416
|
+
return true;
|
|
417
|
+
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
418
|
+
const value = input[key];
|
|
419
|
+
if (undefined === value)
|
|
420
|
+
return true;
|
|
421
|
+
return true;
|
|
422
|
+
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
423
|
+
if (false === __is(input)) {
|
|
424
|
+
_errorFactory = errorFactory;
|
|
425
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
426
|
+
path: _path + "",
|
|
427
|
+
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; event?: (\"consumption_add\" | \"offline_floating_consumptions_sync\")[] | undefined; bundle_code?: string | undefined; license_id?: number | undefined; ... 5 more ...; consumptions: number; } | { ...; }>",
|
|
428
|
+
value: input
|
|
429
|
+
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
430
|
+
path: _path + "",
|
|
431
|
+
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; event?: (\"consumption_add\" | \"offline_floating_consumptions_sync\")[] | undefined; bundle_code?: string | undefined; license_id?: number | undefined; ... 5 more ...; consumptions: number; } | { ...; }>",
|
|
432
|
+
value: input
|
|
433
|
+
}, _errorFactory))(input, "$input", true);
|
|
434
|
+
}
|
|
435
|
+
return input;
|
|
436
|
+
}; })()(payload);
|
|
437
|
+
const response = yield this.licenseAPI.addFeatureConsumption(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
|
|
438
|
+
this.licenseFile.licenseDataCache.updateCache('feature_consumption', response);
|
|
439
|
+
this.licenseFile.saveLicenseFile();
|
|
440
|
+
return response;
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
;
|
|
444
|
+
featureRelease(payload) {
|
|
445
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
446
|
+
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
447
|
+
const value = input[key];
|
|
448
|
+
if (undefined === value)
|
|
449
|
+
return true;
|
|
450
|
+
return true;
|
|
451
|
+
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
452
|
+
const value = input[key];
|
|
453
|
+
if (undefined === value)
|
|
454
|
+
return true;
|
|
455
|
+
return true;
|
|
456
|
+
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
457
|
+
if (false === __is(input)) {
|
|
458
|
+
_errorFactory = errorFactory;
|
|
459
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
460
|
+
path: _path + "",
|
|
461
|
+
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; product: string; hardware_id: string; license_key: string; feature: string; } | { ...; }>",
|
|
462
|
+
value: input
|
|
463
|
+
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
464
|
+
path: _path + "",
|
|
465
|
+
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; product: string; hardware_id: string; license_key: string; feature: string; } | { ...; }>",
|
|
466
|
+
value: input
|
|
467
|
+
}, _errorFactory))(input, "$input", true);
|
|
468
|
+
}
|
|
469
|
+
return input;
|
|
470
|
+
}; })()(payload);
|
|
471
|
+
const response = yield this.licenseAPI.featureRelease(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
|
|
472
|
+
this.licenseFile.licenseDataCache.updateCache('feature_consumption', response);
|
|
473
|
+
this.licenseFile.saveLicenseFile();
|
|
474
|
+
return response;
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
;
|
|
478
|
+
getProductDetails(payload) {
|
|
479
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
480
|
+
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
481
|
+
const value = input[key];
|
|
482
|
+
if (undefined === value)
|
|
483
|
+
return true;
|
|
484
|
+
return true;
|
|
485
|
+
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
486
|
+
const value = input[key];
|
|
487
|
+
if (undefined === value)
|
|
488
|
+
return true;
|
|
489
|
+
return true;
|
|
490
|
+
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
491
|
+
if (false === __is(input)) {
|
|
492
|
+
_errorFactory = errorFactory;
|
|
493
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
494
|
+
path: _path + "",
|
|
495
|
+
expected: "Managed<__type>",
|
|
496
|
+
value: input
|
|
497
|
+
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
498
|
+
path: _path + "",
|
|
499
|
+
expected: "Managed<__type>",
|
|
500
|
+
value: input
|
|
501
|
+
}, _errorFactory))(input, "$input", true);
|
|
502
|
+
}
|
|
503
|
+
return input;
|
|
504
|
+
}; })()(payload);
|
|
505
|
+
const response = yield this.licenseAPI.getProductDetails(Object.assign(Object.assign({}, payload), { product: this.config.productCode }));
|
|
506
|
+
this.licenseFile.licenseDataCache.updateCache('product_details', response);
|
|
507
|
+
this.licenseFile.saveLicenseFile();
|
|
508
|
+
return response;
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
;
|
|
512
|
+
getDeviceVariables(payload) {
|
|
513
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
514
|
+
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
515
|
+
const value = input[key];
|
|
516
|
+
if (undefined === value)
|
|
517
|
+
return true;
|
|
518
|
+
return true;
|
|
519
|
+
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
520
|
+
const value = input[key];
|
|
521
|
+
if (undefined === value)
|
|
522
|
+
return true;
|
|
523
|
+
return true;
|
|
524
|
+
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
525
|
+
if (false === __is(input)) {
|
|
526
|
+
_errorFactory = errorFactory;
|
|
527
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
528
|
+
path: _path + "",
|
|
529
|
+
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; product: string; hardware_id: string; license_key: string; } | { ...; }>",
|
|
530
|
+
value: input
|
|
531
|
+
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
532
|
+
path: _path + "",
|
|
533
|
+
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; product: string; hardware_id: string; license_key: string; } | { ...; }>",
|
|
534
|
+
value: input
|
|
535
|
+
}, _errorFactory))(input, "$input", true);
|
|
536
|
+
}
|
|
537
|
+
return input;
|
|
538
|
+
}; })()(payload);
|
|
539
|
+
const response = yield this.licenseAPI.getDeviceVariables(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
|
|
540
|
+
this.licenseFile.licenseDataCache.updateCache('device_variables', response);
|
|
541
|
+
this.licenseFile.saveLicenseFile();
|
|
542
|
+
return response;
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
;
|
|
546
|
+
trackDeviceVariables(payload) {
|
|
547
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
548
|
+
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
549
|
+
const value = input[key];
|
|
550
|
+
if (undefined === value)
|
|
551
|
+
return true;
|
|
552
|
+
return true;
|
|
553
|
+
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
554
|
+
const value = input[key];
|
|
555
|
+
if (undefined === value)
|
|
556
|
+
return true;
|
|
557
|
+
return true;
|
|
558
|
+
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
559
|
+
if (false === __is(input)) {
|
|
560
|
+
_errorFactory = errorFactory;
|
|
561
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
562
|
+
path: _path + "",
|
|
563
|
+
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; variables?: { [x: string]: unknown; } | undefined; product: string; hardware_id: string; license_key: string; } | { ...; }>",
|
|
564
|
+
value: input
|
|
565
|
+
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
566
|
+
path: _path + "",
|
|
567
|
+
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; variables?: { [x: string]: unknown; } | undefined; product: string; hardware_id: string; license_key: string; } | { ...; }>",
|
|
568
|
+
value: input
|
|
569
|
+
}, _errorFactory))(input, "$input", true);
|
|
570
|
+
}
|
|
571
|
+
return input;
|
|
572
|
+
}; })()(payload);
|
|
573
|
+
const response = yield this.licenseAPI.trackDeviceVariables(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
|
|
574
|
+
this.licenseFile.licenseDataCache.updateCache('device_variables', response);
|
|
575
|
+
this.licenseFile.saveLicenseFile();
|
|
576
|
+
return response;
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
;
|
|
580
|
+
floatingBorrow(payload) {
|
|
581
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
582
|
+
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
583
|
+
const value = input[key];
|
|
584
|
+
if (undefined === value)
|
|
585
|
+
return true;
|
|
586
|
+
return true;
|
|
587
|
+
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
588
|
+
const value = input[key];
|
|
589
|
+
if (undefined === value)
|
|
590
|
+
return true;
|
|
591
|
+
return true;
|
|
592
|
+
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
593
|
+
if (false === __is(input)) {
|
|
594
|
+
_errorFactory = errorFactory;
|
|
595
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
596
|
+
path: _path + "",
|
|
597
|
+
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; password?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; product: string; hardware_id: string; license_key: string; borrowed_until: string | null; } | { ...; }>",
|
|
598
|
+
value: input
|
|
599
|
+
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
600
|
+
path: _path + "",
|
|
601
|
+
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; password?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; product: string; hardware_id: string; license_key: string; borrowed_until: string | null; } | { ...; }>",
|
|
602
|
+
value: input
|
|
603
|
+
}, _errorFactory))(input, "$input", true);
|
|
604
|
+
}
|
|
605
|
+
return input;
|
|
606
|
+
}; })()(payload);
|
|
607
|
+
return yield this.licenseAPI.floatingBorrow(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
;
|
|
611
|
+
floatingRelease(payload) {
|
|
612
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
613
|
+
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
614
|
+
const value = input[key];
|
|
615
|
+
if (undefined === value)
|
|
616
|
+
return true;
|
|
617
|
+
return true;
|
|
618
|
+
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
619
|
+
const value = input[key];
|
|
620
|
+
if (undefined === value)
|
|
621
|
+
return true;
|
|
622
|
+
return true;
|
|
623
|
+
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
624
|
+
if (false === __is(input)) {
|
|
625
|
+
_errorFactory = errorFactory;
|
|
626
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
627
|
+
path: _path + "",
|
|
628
|
+
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; product: string; hardware_id: string; license_key: string; } | { ...; }>",
|
|
629
|
+
value: input
|
|
630
|
+
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
631
|
+
path: _path + "",
|
|
632
|
+
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; product: string; hardware_id: string; license_key: string; } | { ...; }>",
|
|
633
|
+
value: input
|
|
634
|
+
}, _errorFactory))(input, "$input", true);
|
|
635
|
+
}
|
|
636
|
+
return input;
|
|
637
|
+
}; })()(payload);
|
|
638
|
+
return yield this.licenseAPI.floatingRelease(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
|
|
639
|
+
});
|
|
640
|
+
}
|
|
641
|
+
;
|
|
642
|
+
changePassword(payload) {
|
|
643
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
644
|
+
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => "string" === typeof input.username && "string" === typeof input.password && "string" === typeof input.new_password && Object.keys(input).every(key => {
|
|
645
|
+
if (["username", "password", "new_password"].some(prop => key === prop))
|
|
646
|
+
return true;
|
|
647
|
+
const value = input[key];
|
|
648
|
+
if (undefined === value)
|
|
649
|
+
return true;
|
|
650
|
+
return true;
|
|
651
|
+
}); const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.username || $guard(_exceptionable, {
|
|
652
|
+
path: _path + ".username",
|
|
653
|
+
expected: "string",
|
|
654
|
+
value: input.username
|
|
655
|
+
}, _errorFactory)) && ("string" === typeof input.password || $guard(_exceptionable, {
|
|
656
|
+
path: _path + ".password",
|
|
657
|
+
expected: "string",
|
|
658
|
+
value: input.password
|
|
659
|
+
}, _errorFactory)) && ("string" === typeof input.new_password || $guard(_exceptionable, {
|
|
660
|
+
path: _path + ".new_password",
|
|
661
|
+
expected: "string",
|
|
662
|
+
value: input.new_password
|
|
663
|
+
}, _errorFactory)) && (false === _exceptionable || Object.keys(input).every(key => {
|
|
664
|
+
if (["username", "password", "new_password"].some(prop => key === prop))
|
|
665
|
+
return true;
|
|
666
|
+
const value = input[key];
|
|
667
|
+
if (undefined === value)
|
|
668
|
+
return true;
|
|
669
|
+
return true;
|
|
670
|
+
})); const __is = input => "object" === typeof input && null !== input && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
671
|
+
if (false === __is(input)) {
|
|
672
|
+
_errorFactory = errorFactory;
|
|
673
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
|
|
674
|
+
path: _path + "",
|
|
675
|
+
expected: "__type",
|
|
676
|
+
value: input
|
|
677
|
+
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
678
|
+
path: _path + "",
|
|
679
|
+
expected: "__type",
|
|
680
|
+
value: input
|
|
681
|
+
}, _errorFactory))(input, "$input", true);
|
|
682
|
+
}
|
|
683
|
+
return input;
|
|
684
|
+
}; })()(payload);
|
|
685
|
+
return yield this.licenseAPI.changePassword(payload);
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
;
|
|
689
|
+
getVersions(payload) {
|
|
690
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
691
|
+
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
692
|
+
const value = input[key];
|
|
693
|
+
if (undefined === value)
|
|
694
|
+
return true;
|
|
695
|
+
return true;
|
|
696
|
+
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
697
|
+
const value = input[key];
|
|
698
|
+
if (undefined === value)
|
|
699
|
+
return true;
|
|
700
|
+
return true;
|
|
701
|
+
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
702
|
+
if (false === __is(input)) {
|
|
703
|
+
_errorFactory = errorFactory;
|
|
704
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
705
|
+
path: _path + "",
|
|
706
|
+
expected: "Managed<{ [x: string]: unknown; channel?: string | undefined; username?: string | undefined; env?: string | undefined; bundle_code?: string | undefined; sdk_ver?: string | undefined; product: string; hardware_id: string; license_key: string; } | { ...; }>",
|
|
707
|
+
value: input
|
|
708
|
+
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
709
|
+
path: _path + "",
|
|
710
|
+
expected: "Managed<{ [x: string]: unknown; channel?: string | undefined; username?: string | undefined; env?: string | undefined; bundle_code?: string | undefined; sdk_ver?: string | undefined; product: string; hardware_id: string; license_key: string; } | { ...; }>",
|
|
711
|
+
value: input
|
|
712
|
+
}, _errorFactory))(input, "$input", true);
|
|
713
|
+
}
|
|
714
|
+
return input;
|
|
715
|
+
}; })()(payload);
|
|
716
|
+
return yield this.licenseAPI.getVersions(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
|
|
717
|
+
});
|
|
718
|
+
}
|
|
719
|
+
;
|
|
720
|
+
getInstallationFile(payload) {
|
|
721
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
722
|
+
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
723
|
+
const value = input[key];
|
|
724
|
+
if (undefined === value)
|
|
725
|
+
return true;
|
|
726
|
+
return true;
|
|
727
|
+
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
728
|
+
const value = input[key];
|
|
729
|
+
if (undefined === value)
|
|
730
|
+
return true;
|
|
731
|
+
return true;
|
|
732
|
+
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
733
|
+
if (false === __is(input)) {
|
|
734
|
+
_errorFactory = errorFactory;
|
|
735
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
736
|
+
path: _path + "",
|
|
737
|
+
expected: "Managed<{ [x: string]: unknown; channel?: string | undefined; username?: string | undefined; env?: string | undefined; bundle_code?: string | undefined; sdk_ver?: string | undefined; version?: string | undefined; product: string; hardware_id: string; license_key: string; } | { ...; }>",
|
|
738
|
+
value: input
|
|
739
|
+
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
740
|
+
path: _path + "",
|
|
741
|
+
expected: "Managed<{ [x: string]: unknown; channel?: string | undefined; username?: string | undefined; env?: string | undefined; bundle_code?: string | undefined; sdk_ver?: string | undefined; version?: string | undefined; product: string; hardware_id: string; license_key: string; } | { ...; }>",
|
|
742
|
+
value: input
|
|
743
|
+
}, _errorFactory))(input, "$input", true);
|
|
744
|
+
}
|
|
745
|
+
return input;
|
|
746
|
+
}; })()(payload);
|
|
747
|
+
return yield this.licenseAPI.getInstallationFile(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
|
|
748
|
+
});
|
|
749
|
+
}
|
|
750
|
+
;
|
|
751
|
+
getSSOUrl(payload) {
|
|
752
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
753
|
+
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.response_type || "string" === typeof input.response_type) && "string" === typeof input.product && "string" === typeof input.customer_account_code && Object.keys(input).every(key => {
|
|
754
|
+
if (["bundle_code", "response_type", "product", "customer_account_code"].some(prop => key === prop))
|
|
755
|
+
return true;
|
|
756
|
+
const value = input[key];
|
|
757
|
+
if (undefined === value)
|
|
758
|
+
return true;
|
|
759
|
+
return true;
|
|
760
|
+
}); const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
|
|
761
|
+
path: _path + ".bundle_code",
|
|
762
|
+
expected: "(string | undefined)",
|
|
763
|
+
value: input.bundle_code
|
|
764
|
+
}, _errorFactory)) && (undefined === input.response_type || "string" === typeof input.response_type || $guard(_exceptionable, {
|
|
765
|
+
path: _path + ".response_type",
|
|
766
|
+
expected: "(string | undefined)",
|
|
767
|
+
value: input.response_type
|
|
768
|
+
}, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
|
|
769
|
+
path: _path + ".product",
|
|
770
|
+
expected: "string",
|
|
771
|
+
value: input.product
|
|
772
|
+
}, _errorFactory)) && ("string" === typeof input.customer_account_code || $guard(_exceptionable, {
|
|
773
|
+
path: _path + ".customer_account_code",
|
|
774
|
+
expected: "string",
|
|
775
|
+
value: input.customer_account_code
|
|
776
|
+
}, _errorFactory)) && (false === _exceptionable || Object.keys(input).every(key => {
|
|
777
|
+
if (["bundle_code", "response_type", "product", "customer_account_code"].some(prop => key === prop))
|
|
778
|
+
return true;
|
|
779
|
+
const value = input[key];
|
|
780
|
+
if (undefined === value)
|
|
781
|
+
return true;
|
|
782
|
+
return true;
|
|
783
|
+
})); const __is = input => "object" === typeof input && null !== input && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
784
|
+
if (false === __is(input)) {
|
|
785
|
+
_errorFactory = errorFactory;
|
|
786
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
|
|
787
|
+
path: _path + "",
|
|
788
|
+
expected: "__type",
|
|
789
|
+
value: input
|
|
790
|
+
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
791
|
+
path: _path + "",
|
|
792
|
+
expected: "__type",
|
|
793
|
+
value: input
|
|
794
|
+
}, _errorFactory))(input, "$input", true);
|
|
795
|
+
}
|
|
796
|
+
return input;
|
|
797
|
+
}; })()(payload);
|
|
798
|
+
return yield this.licenseAPI.getSSOUrl(payload);
|
|
799
|
+
});
|
|
800
|
+
}
|
|
801
|
+
;
|
|
802
|
+
getAirGapActivationCode(initializationCode, licenseKey) {
|
|
803
|
+
const response = this.licenseAPI.getAirGapActivationCode(initializationCode, licenseKey);
|
|
804
|
+
const guardFile = this.licenseAPI.createActivationGuard(licenseKey);
|
|
805
|
+
this.licenseFile.saveGuardFile(guardFile);
|
|
188
806
|
return response;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
}, _errorFactory))(input, "$input", true);
|
|
228
|
-
}
|
|
229
|
-
return input;
|
|
230
|
-
}; })()(payload);
|
|
231
|
-
const response = yield this.licenseAPI.getTrialKey(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
|
|
232
|
-
this.licenseFile.licenseDataCache.updateCache('activate_license', response);
|
|
233
|
-
this.licenseFile.saveLicenseFile();
|
|
234
|
-
return response;
|
|
235
|
-
});
|
|
236
|
-
}
|
|
237
|
-
;
|
|
238
|
-
getUserLicenses(payload) {
|
|
239
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
240
|
-
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
241
|
-
const value = input[key];
|
|
242
|
-
if (undefined === value)
|
|
243
|
-
return true;
|
|
244
|
-
return true;
|
|
245
|
-
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
246
|
-
const value = input[key];
|
|
247
|
-
if (undefined === value)
|
|
248
|
-
return true;
|
|
249
|
-
return true;
|
|
250
|
-
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
251
|
-
if (false === __is(input)) {
|
|
252
|
-
_errorFactory = errorFactory;
|
|
253
|
-
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
254
|
-
path: _path + "",
|
|
255
|
-
expected: "Managed<{ [x: string]: unknown; code?: string | undefined; product?: string | undefined; id_token?: string | undefined; customer_account_code?: string | undefined; username: string; password: string; } | { ...; } | { ...; }>",
|
|
256
|
-
value: input
|
|
257
|
-
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
258
|
-
path: _path + "",
|
|
259
|
-
expected: "Managed<{ [x: string]: unknown; code?: string | undefined; product?: string | undefined; id_token?: string | undefined; customer_account_code?: string | undefined; username: string; password: string; } | { ...; } | { ...; }>",
|
|
260
|
-
value: input
|
|
261
|
-
}, _errorFactory))(input, "$input", true);
|
|
262
|
-
}
|
|
263
|
-
return input;
|
|
264
|
-
}; })()(payload);
|
|
265
|
-
return yield this.licenseAPI.getUserLicenses(Object.assign(Object.assign({}, payload), { product: this.config.productCode }));
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
;
|
|
269
|
-
getCustomerLicenseUsers(payload) {
|
|
270
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
271
|
-
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
272
|
-
const value = input[key];
|
|
273
|
-
if (undefined === value)
|
|
274
|
-
return true;
|
|
275
|
-
return true;
|
|
276
|
-
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
277
|
-
const value = input[key];
|
|
278
|
-
if (undefined === value)
|
|
279
|
-
return true;
|
|
280
|
-
return true;
|
|
281
|
-
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
282
|
-
if (false === __is(input)) {
|
|
283
|
-
_errorFactory = errorFactory;
|
|
284
|
-
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
285
|
-
path: _path + "",
|
|
286
|
-
expected: "Managed<__type>",
|
|
287
|
-
value: input
|
|
288
|
-
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
289
|
-
path: _path + "",
|
|
290
|
-
expected: "Managed<__type>",
|
|
291
|
-
value: input
|
|
292
|
-
}, _errorFactory))(input, "$input", true);
|
|
293
|
-
}
|
|
294
|
-
return input;
|
|
295
|
-
}; })()(payload);
|
|
296
|
-
return yield this.licenseAPI.getCustomerLicenseUsers(Object.assign(Object.assign({}, payload), { product: this.config.productCode }));
|
|
297
|
-
});
|
|
298
|
-
}
|
|
299
|
-
;
|
|
300
|
-
checkLicenseFeature(payload) {
|
|
301
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
302
|
-
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
303
|
-
const value = input[key];
|
|
304
|
-
if (undefined === value)
|
|
305
|
-
return true;
|
|
306
|
-
return true;
|
|
307
|
-
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
308
|
-
const value = input[key];
|
|
309
|
-
if (undefined === value)
|
|
310
|
-
return true;
|
|
311
|
-
return true;
|
|
312
|
-
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
313
|
-
if (false === __is(input)) {
|
|
314
|
-
_errorFactory = errorFactory;
|
|
315
|
-
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
316
|
-
path: _path + "",
|
|
317
|
-
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; include_metadata_string?: boolean | undefined; product: string; hardware_id: string; license_key: string; feature: string; } | { ...; }>",
|
|
318
|
-
value: input
|
|
319
|
-
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
320
|
-
path: _path + "",
|
|
321
|
-
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; include_metadata_string?: boolean | undefined; product: string; hardware_id: string; license_key: string; feature: string; } | { ...; }>",
|
|
322
|
-
value: input
|
|
323
|
-
}, _errorFactory))(input, "$input", true);
|
|
324
|
-
}
|
|
325
|
-
return input;
|
|
326
|
-
}; })()(payload);
|
|
327
|
-
return yield this.licenseAPI.checkLicenseFeature(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
|
|
328
|
-
});
|
|
329
|
-
}
|
|
330
|
-
;
|
|
331
|
-
addConsumption(payload) {
|
|
332
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
333
|
-
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
334
|
-
const value = input[key];
|
|
335
|
-
if (undefined === value)
|
|
336
|
-
return true;
|
|
337
|
-
return true;
|
|
338
|
-
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
339
|
-
const value = input[key];
|
|
340
|
-
if (undefined === value)
|
|
341
|
-
return true;
|
|
342
|
-
return true;
|
|
343
|
-
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
344
|
-
if (false === __is(input)) {
|
|
345
|
-
_errorFactory = errorFactory;
|
|
346
|
-
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
347
|
-
path: _path + "",
|
|
348
|
-
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; event?: (\"consumption_add\" | \"offline_floating_consumptions_sync\")[] | undefined; allow_overages?: boolean | undefined; max_overages?: number | undefined; ... 7 more ...; consumptions: number; } | { ...; }>",
|
|
349
|
-
value: input
|
|
350
|
-
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
351
|
-
path: _path + "",
|
|
352
|
-
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; event?: (\"consumption_add\" | \"offline_floating_consumptions_sync\")[] | undefined; allow_overages?: boolean | undefined; max_overages?: number | undefined; ... 7 more ...; consumptions: number; } | { ...; }>",
|
|
353
|
-
value: input
|
|
354
|
-
}, _errorFactory))(input, "$input", true);
|
|
355
|
-
}
|
|
356
|
-
return input;
|
|
357
|
-
}; })()(payload);
|
|
358
|
-
const response = yield this.licenseAPI.addConsumption(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
|
|
359
|
-
this.licenseFile.licenseDataCache.updateCache('license_consumption', response);
|
|
360
|
-
this.licenseFile.saveLicenseFile();
|
|
361
|
-
return response;
|
|
362
|
-
});
|
|
363
|
-
}
|
|
364
|
-
;
|
|
365
|
-
addFeatureConsumption(payload) {
|
|
366
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
367
|
-
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
368
|
-
const value = input[key];
|
|
369
|
-
if (undefined === value)
|
|
370
|
-
return true;
|
|
371
|
-
return true;
|
|
372
|
-
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
373
|
-
const value = input[key];
|
|
374
|
-
if (undefined === value)
|
|
375
|
-
return true;
|
|
376
|
-
return true;
|
|
377
|
-
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
378
|
-
if (false === __is(input)) {
|
|
379
|
-
_errorFactory = errorFactory;
|
|
380
|
-
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
381
|
-
path: _path + "",
|
|
382
|
-
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; event?: (\"consumption_add\" | \"offline_floating_consumptions_sync\")[] | undefined; bundle_code?: string | undefined; license_id?: number | undefined; ... 5 more ...; consumptions: number; } | { ...; }>",
|
|
383
|
-
value: input
|
|
384
|
-
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
385
|
-
path: _path + "",
|
|
386
|
-
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; event?: (\"consumption_add\" | \"offline_floating_consumptions_sync\")[] | undefined; bundle_code?: string | undefined; license_id?: number | undefined; ... 5 more ...; consumptions: number; } | { ...; }>",
|
|
387
|
-
value: input
|
|
388
|
-
}, _errorFactory))(input, "$input", true);
|
|
389
|
-
}
|
|
390
|
-
return input;
|
|
391
|
-
}; })()(payload);
|
|
392
|
-
const response = yield this.licenseAPI.addFeatureConsumption(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
|
|
393
|
-
this.licenseFile.licenseDataCache.updateCache('feature_consumption', response);
|
|
394
|
-
this.licenseFile.saveLicenseFile();
|
|
395
|
-
return response;
|
|
396
|
-
});
|
|
397
|
-
}
|
|
398
|
-
;
|
|
399
|
-
featureRelease(payload) {
|
|
400
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
401
|
-
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
402
|
-
const value = input[key];
|
|
403
|
-
if (undefined === value)
|
|
404
|
-
return true;
|
|
405
|
-
return true;
|
|
406
|
-
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
407
|
-
const value = input[key];
|
|
408
|
-
if (undefined === value)
|
|
409
|
-
return true;
|
|
410
|
-
return true;
|
|
411
|
-
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
412
|
-
if (false === __is(input)) {
|
|
413
|
-
_errorFactory = errorFactory;
|
|
414
|
-
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
415
|
-
path: _path + "",
|
|
416
|
-
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; product: string; hardware_id: string; license_key: string; feature: string; } | { ...; }>",
|
|
417
|
-
value: input
|
|
418
|
-
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
419
|
-
path: _path + "",
|
|
420
|
-
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; product: string; hardware_id: string; license_key: string; feature: string; } | { ...; }>",
|
|
421
|
-
value: input
|
|
422
|
-
}, _errorFactory))(input, "$input", true);
|
|
423
|
-
}
|
|
424
|
-
return input;
|
|
425
|
-
}; })()(payload);
|
|
426
|
-
const response = yield this.licenseAPI.featureRelease(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
|
|
427
|
-
this.licenseFile.licenseDataCache.updateCache('feature_consumption', response);
|
|
428
|
-
this.licenseFile.saveLicenseFile();
|
|
429
|
-
return response;
|
|
430
|
-
});
|
|
431
|
-
}
|
|
432
|
-
;
|
|
433
|
-
getProductDetails(payload) {
|
|
434
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
435
|
-
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
436
|
-
const value = input[key];
|
|
437
|
-
if (undefined === value)
|
|
438
|
-
return true;
|
|
439
|
-
return true;
|
|
440
|
-
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
441
|
-
const value = input[key];
|
|
442
|
-
if (undefined === value)
|
|
443
|
-
return true;
|
|
444
|
-
return true;
|
|
445
|
-
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
446
|
-
if (false === __is(input)) {
|
|
447
|
-
_errorFactory = errorFactory;
|
|
448
|
-
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
449
|
-
path: _path + "",
|
|
450
|
-
expected: "Managed<__type>",
|
|
451
|
-
value: input
|
|
452
|
-
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
453
|
-
path: _path + "",
|
|
454
|
-
expected: "Managed<__type>",
|
|
455
|
-
value: input
|
|
456
|
-
}, _errorFactory))(input, "$input", true);
|
|
457
|
-
}
|
|
458
|
-
return input;
|
|
459
|
-
}; })()(payload);
|
|
460
|
-
const response = yield this.licenseAPI.getProductDetails(Object.assign(Object.assign({}, payload), { product: this.config.productCode }));
|
|
461
|
-
this.licenseFile.licenseDataCache.updateCache('product_details', response);
|
|
462
|
-
this.licenseFile.saveLicenseFile();
|
|
463
|
-
return response;
|
|
464
|
-
});
|
|
465
|
-
}
|
|
466
|
-
;
|
|
467
|
-
getDeviceVariables(payload) {
|
|
468
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
469
|
-
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
470
|
-
const value = input[key];
|
|
471
|
-
if (undefined === value)
|
|
472
|
-
return true;
|
|
473
|
-
return true;
|
|
474
|
-
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
475
|
-
const value = input[key];
|
|
476
|
-
if (undefined === value)
|
|
477
|
-
return true;
|
|
478
|
-
return true;
|
|
479
|
-
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
480
|
-
if (false === __is(input)) {
|
|
481
|
-
_errorFactory = errorFactory;
|
|
482
|
-
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
483
|
-
path: _path + "",
|
|
484
|
-
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; product: string; hardware_id: string; license_key: string; } | { ...; }>",
|
|
485
|
-
value: input
|
|
486
|
-
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
487
|
-
path: _path + "",
|
|
488
|
-
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; product: string; hardware_id: string; license_key: string; } | { ...; }>",
|
|
489
|
-
value: input
|
|
490
|
-
}, _errorFactory))(input, "$input", true);
|
|
491
|
-
}
|
|
492
|
-
return input;
|
|
493
|
-
}; })()(payload);
|
|
494
|
-
const response = yield this.licenseAPI.getDeviceVariables(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
|
|
495
|
-
this.licenseFile.licenseDataCache.updateCache('device_variables', response);
|
|
496
|
-
this.licenseFile.saveLicenseFile();
|
|
497
|
-
return response;
|
|
498
|
-
});
|
|
499
|
-
}
|
|
500
|
-
;
|
|
501
|
-
trackDeviceVariables(payload) {
|
|
502
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
503
|
-
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
504
|
-
const value = input[key];
|
|
505
|
-
if (undefined === value)
|
|
506
|
-
return true;
|
|
507
|
-
return true;
|
|
508
|
-
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
509
|
-
const value = input[key];
|
|
510
|
-
if (undefined === value)
|
|
511
|
-
return true;
|
|
512
|
-
return true;
|
|
513
|
-
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
514
|
-
if (false === __is(input)) {
|
|
515
|
-
_errorFactory = errorFactory;
|
|
516
|
-
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
517
|
-
path: _path + "",
|
|
518
|
-
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; variables?: { [x: string]: unknown; } | undefined; product: string; hardware_id: string; license_key: string; } | { ...; }>",
|
|
519
|
-
value: input
|
|
520
|
-
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
521
|
-
path: _path + "",
|
|
522
|
-
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; variables?: { [x: string]: unknown; } | undefined; product: string; hardware_id: string; license_key: string; } | { ...; }>",
|
|
523
|
-
value: input
|
|
524
|
-
}, _errorFactory))(input, "$input", true);
|
|
525
|
-
}
|
|
526
|
-
return input;
|
|
527
|
-
}; })()(payload);
|
|
528
|
-
const response = yield this.licenseAPI.trackDeviceVariables(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
|
|
529
|
-
this.licenseFile.licenseDataCache.updateCache('device_variables', response);
|
|
530
|
-
this.licenseFile.saveLicenseFile();
|
|
531
|
-
return response;
|
|
532
|
-
});
|
|
533
|
-
}
|
|
534
|
-
;
|
|
535
|
-
floatingBorrow(payload) {
|
|
536
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
537
|
-
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
538
|
-
const value = input[key];
|
|
539
|
-
if (undefined === value)
|
|
540
|
-
return true;
|
|
541
|
-
return true;
|
|
542
|
-
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
543
|
-
const value = input[key];
|
|
544
|
-
if (undefined === value)
|
|
545
|
-
return true;
|
|
546
|
-
return true;
|
|
547
|
-
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
548
|
-
if (false === __is(input)) {
|
|
549
|
-
_errorFactory = errorFactory;
|
|
550
|
-
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
551
|
-
path: _path + "",
|
|
552
|
-
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; password?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; product: string; hardware_id: string; license_key: string; borrowed_until: string | null; } | { ...; }>",
|
|
553
|
-
value: input
|
|
554
|
-
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
555
|
-
path: _path + "",
|
|
556
|
-
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; password?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; product: string; hardware_id: string; license_key: string; borrowed_until: string | null; } | { ...; }>",
|
|
557
|
-
value: input
|
|
558
|
-
}, _errorFactory))(input, "$input", true);
|
|
559
|
-
}
|
|
560
|
-
return input;
|
|
561
|
-
}; })()(payload);
|
|
562
|
-
return yield this.licenseAPI.floatingBorrow(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
|
|
563
|
-
});
|
|
564
|
-
}
|
|
565
|
-
;
|
|
566
|
-
floatingRelease(payload) {
|
|
567
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
568
|
-
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
569
|
-
const value = input[key];
|
|
570
|
-
if (undefined === value)
|
|
571
|
-
return true;
|
|
572
|
-
return true;
|
|
573
|
-
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
574
|
-
const value = input[key];
|
|
575
|
-
if (undefined === value)
|
|
576
|
-
return true;
|
|
577
|
-
return true;
|
|
578
|
-
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
579
|
-
if (false === __is(input)) {
|
|
580
|
-
_errorFactory = errorFactory;
|
|
581
|
-
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
582
|
-
path: _path + "",
|
|
583
|
-
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; product: string; hardware_id: string; license_key: string; } | { ...; }>",
|
|
584
|
-
value: input
|
|
585
|
-
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
586
|
-
path: _path + "",
|
|
587
|
-
expected: "Managed<{ [x: string]: unknown; username?: string | undefined; bundle_code?: string | undefined; license_id?: number | undefined; sdk_ver?: string | undefined; product: string; hardware_id: string; license_key: string; } | { ...; }>",
|
|
588
|
-
value: input
|
|
589
|
-
}, _errorFactory))(input, "$input", true);
|
|
590
|
-
}
|
|
591
|
-
return input;
|
|
592
|
-
}; })()(payload);
|
|
593
|
-
return yield this.licenseAPI.floatingRelease(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
|
|
594
|
-
});
|
|
595
|
-
}
|
|
596
|
-
;
|
|
597
|
-
changePassword(payload) {
|
|
598
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
599
|
-
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => "string" === typeof input.username && "string" === typeof input.password && "string" === typeof input.new_password && Object.keys(input).every(key => {
|
|
600
|
-
if (["username", "password", "new_password"].some(prop => key === prop))
|
|
601
|
-
return true;
|
|
602
|
-
const value = input[key];
|
|
603
|
-
if (undefined === value)
|
|
604
|
-
return true;
|
|
605
|
-
return true;
|
|
606
|
-
}); const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.username || $guard(_exceptionable, {
|
|
607
|
-
path: _path + ".username",
|
|
608
|
-
expected: "string",
|
|
609
|
-
value: input.username
|
|
610
|
-
}, _errorFactory)) && ("string" === typeof input.password || $guard(_exceptionable, {
|
|
611
|
-
path: _path + ".password",
|
|
612
|
-
expected: "string",
|
|
613
|
-
value: input.password
|
|
614
|
-
}, _errorFactory)) && ("string" === typeof input.new_password || $guard(_exceptionable, {
|
|
615
|
-
path: _path + ".new_password",
|
|
616
|
-
expected: "string",
|
|
617
|
-
value: input.new_password
|
|
618
|
-
}, _errorFactory)) && (false === _exceptionable || Object.keys(input).every(key => {
|
|
619
|
-
if (["username", "password", "new_password"].some(prop => key === prop))
|
|
620
|
-
return true;
|
|
621
|
-
const value = input[key];
|
|
622
|
-
if (undefined === value)
|
|
623
|
-
return true;
|
|
624
|
-
return true;
|
|
625
|
-
})); const __is = input => "object" === typeof input && null !== input && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
626
|
-
if (false === __is(input)) {
|
|
627
|
-
_errorFactory = errorFactory;
|
|
628
|
-
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
|
|
629
|
-
path: _path + "",
|
|
630
|
-
expected: "__type",
|
|
631
|
-
value: input
|
|
632
|
-
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
633
|
-
path: _path + "",
|
|
634
|
-
expected: "__type",
|
|
635
|
-
value: input
|
|
636
|
-
}, _errorFactory))(input, "$input", true);
|
|
637
|
-
}
|
|
638
|
-
return input;
|
|
639
|
-
}; })()(payload);
|
|
640
|
-
return yield this.licenseAPI.changePassword(payload);
|
|
641
|
-
});
|
|
642
|
-
}
|
|
643
|
-
;
|
|
644
|
-
getVersions(payload) {
|
|
645
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
646
|
-
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
647
|
-
const value = input[key];
|
|
648
|
-
if (undefined === value)
|
|
649
|
-
return true;
|
|
650
|
-
return true;
|
|
651
|
-
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
652
|
-
const value = input[key];
|
|
653
|
-
if (undefined === value)
|
|
654
|
-
return true;
|
|
655
|
-
return true;
|
|
656
|
-
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
657
|
-
if (false === __is(input)) {
|
|
658
|
-
_errorFactory = errorFactory;
|
|
659
|
-
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
660
|
-
path: _path + "",
|
|
661
|
-
expected: "Managed<{ [x: string]: unknown; channel?: string | undefined; username?: string | undefined; env?: string | undefined; bundle_code?: string | undefined; sdk_ver?: string | undefined; product: string; hardware_id: string; license_key: string; } | { ...; }>",
|
|
662
|
-
value: input
|
|
663
|
-
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
664
|
-
path: _path + "",
|
|
665
|
-
expected: "Managed<{ [x: string]: unknown; channel?: string | undefined; username?: string | undefined; env?: string | undefined; bundle_code?: string | undefined; sdk_ver?: string | undefined; product: string; hardware_id: string; license_key: string; } | { ...; }>",
|
|
666
|
-
value: input
|
|
667
|
-
}, _errorFactory))(input, "$input", true);
|
|
668
|
-
}
|
|
669
|
-
return input;
|
|
670
|
-
}; })()(payload);
|
|
671
|
-
return yield this.licenseAPI.getVersions(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
|
|
672
|
-
});
|
|
673
|
-
}
|
|
674
|
-
;
|
|
675
|
-
getInstallationFile(payload) {
|
|
676
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
677
|
-
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => Object.keys(input).every(key => {
|
|
678
|
-
const value = input[key];
|
|
679
|
-
if (undefined === value)
|
|
680
|
-
return true;
|
|
681
|
-
return true;
|
|
682
|
-
}); const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
683
|
-
const value = input[key];
|
|
684
|
-
if (undefined === value)
|
|
685
|
-
return true;
|
|
686
|
-
return true;
|
|
687
|
-
}); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
688
|
-
if (false === __is(input)) {
|
|
689
|
-
_errorFactory = errorFactory;
|
|
690
|
-
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
|
|
691
|
-
path: _path + "",
|
|
692
|
-
expected: "Managed<{ [x: string]: unknown; channel?: string | undefined; username?: string | undefined; env?: string | undefined; bundle_code?: string | undefined; sdk_ver?: string | undefined; version?: string | undefined; product: string; hardware_id: string; license_key: string; } | { ...; }>",
|
|
693
|
-
value: input
|
|
694
|
-
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
695
|
-
path: _path + "",
|
|
696
|
-
expected: "Managed<{ [x: string]: unknown; channel?: string | undefined; username?: string | undefined; env?: string | undefined; bundle_code?: string | undefined; sdk_ver?: string | undefined; version?: string | undefined; product: string; hardware_id: string; license_key: string; } | { ...; }>",
|
|
697
|
-
value: input
|
|
698
|
-
}, _errorFactory))(input, "$input", true);
|
|
699
|
-
}
|
|
700
|
-
return input;
|
|
701
|
-
}; })()(payload);
|
|
702
|
-
return yield this.licenseAPI.getInstallationFile(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
|
|
703
|
-
});
|
|
704
|
-
}
|
|
705
|
-
;
|
|
706
|
-
getSSOUrl(payload) {
|
|
707
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
708
|
-
(() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.response_type || "string" === typeof input.response_type) && "string" === typeof input.product && "string" === typeof input.customer_account_code && Object.keys(input).every(key => {
|
|
709
|
-
if (["bundle_code", "response_type", "product", "customer_account_code"].some(prop => key === prop))
|
|
710
|
-
return true;
|
|
711
|
-
const value = input[key];
|
|
712
|
-
if (undefined === value)
|
|
713
|
-
return true;
|
|
714
|
-
return true;
|
|
715
|
-
}); const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
|
|
716
|
-
path: _path + ".bundle_code",
|
|
717
|
-
expected: "(string | undefined)",
|
|
718
|
-
value: input.bundle_code
|
|
719
|
-
}, _errorFactory)) && (undefined === input.response_type || "string" === typeof input.response_type || $guard(_exceptionable, {
|
|
720
|
-
path: _path + ".response_type",
|
|
721
|
-
expected: "(string | undefined)",
|
|
722
|
-
value: input.response_type
|
|
723
|
-
}, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
|
|
724
|
-
path: _path + ".product",
|
|
725
|
-
expected: "string",
|
|
726
|
-
value: input.product
|
|
727
|
-
}, _errorFactory)) && ("string" === typeof input.customer_account_code || $guard(_exceptionable, {
|
|
728
|
-
path: _path + ".customer_account_code",
|
|
729
|
-
expected: "string",
|
|
730
|
-
value: input.customer_account_code
|
|
731
|
-
}, _errorFactory)) && (false === _exceptionable || Object.keys(input).every(key => {
|
|
732
|
-
if (["bundle_code", "response_type", "product", "customer_account_code"].some(prop => key === prop))
|
|
733
|
-
return true;
|
|
734
|
-
const value = input[key];
|
|
735
|
-
if (undefined === value)
|
|
736
|
-
return true;
|
|
737
|
-
return true;
|
|
738
|
-
})); const __is = input => "object" === typeof input && null !== input && $io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
739
|
-
if (false === __is(input)) {
|
|
740
|
-
_errorFactory = errorFactory;
|
|
741
|
-
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
|
|
742
|
-
path: _path + "",
|
|
743
|
-
expected: "__type",
|
|
744
|
-
value: input
|
|
745
|
-
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
746
|
-
path: _path + "",
|
|
747
|
-
expected: "__type",
|
|
748
|
-
value: input
|
|
749
|
-
}, _errorFactory))(input, "$input", true);
|
|
750
|
-
}
|
|
751
|
-
return input;
|
|
752
|
-
}; })()(payload);
|
|
753
|
-
return yield this.licenseAPI.getSSOUrl(payload);
|
|
754
|
-
});
|
|
755
|
-
}
|
|
756
|
-
;
|
|
757
|
-
getAirGapActivationCode(initializationCode, licenseKey) {
|
|
758
|
-
const response = this.licenseAPI.getAirGapActivationCode(initializationCode, licenseKey);
|
|
759
|
-
const guardFile = this.licenseAPI.createActivationGuard(licenseKey);
|
|
760
|
-
this.licenseFile.saveGuardFile(guardFile);
|
|
761
|
-
return response;
|
|
762
|
-
}
|
|
763
|
-
activateAirGapLicense(confirmationCode, licenseKey, policyFilePath, policyID) {
|
|
764
|
-
if (!this.licenseAPI.verifyConfirmationCode(confirmationCode, licenseKey, policyID)) {
|
|
765
|
-
throw { status: 400, code: 'air_gap_activation_error', message: 'Air gap activation error: incorrect confirmation code' };
|
|
766
|
-
}
|
|
767
|
-
if (!policyFilePath || !fs.existsSync(policyFilePath)) {
|
|
768
|
-
throw { status: 400, code: 'policy_file_not_found', message: 'Incorrect policyFilePath' };
|
|
769
|
-
}
|
|
770
|
-
const policyFileData = this.licenseFile.loadOfflineResponse(policyFilePath);
|
|
771
|
-
const response = this.licenseAPI.activateAirgappedLicense(policyFileData, licenseKey, policyID);
|
|
772
|
-
this.licenseFile.licenseDataCache.fromJSON(response);
|
|
773
|
-
const license = new license_1.default(this.config.productCode, this.licenseAPI, this.licenseFile, this.floatingAPI);
|
|
774
|
-
return license;
|
|
775
|
-
}
|
|
776
|
-
createOfflineActivationPayload(payload) {
|
|
777
|
-
return this.licenseAPI.createOfflineActivationPayload(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
|
|
778
|
-
}
|
|
779
|
-
createOfflineDeactivationPayload(payload) {
|
|
780
|
-
return this.licenseAPI.createOfflineDeactivationPayload(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
|
|
781
|
-
}
|
|
782
|
-
decodeOfflineActivationPayload(payload) {
|
|
783
|
-
return this.licenseAPI.decodeOfflineActivationPayload(payload);
|
|
784
|
-
}
|
|
785
|
-
decodeOfflineDeactivationPayload(payload) {
|
|
786
|
-
return this.licenseAPI.decodeOfflineDeactivationPayload(payload);
|
|
787
|
-
}
|
|
788
|
-
}
|
|
807
|
+
}
|
|
808
|
+
activateAirGapLicense(confirmationCode, licenseKey, policyFilePath, policyID) {
|
|
809
|
+
if (!this.licenseAPI.verifyConfirmationCode(confirmationCode, licenseKey, policyID)) {
|
|
810
|
+
throw { status: 400, code: 'air_gap_activation_error', message: 'Air gap activation error: incorrect confirmation code' };
|
|
811
|
+
}
|
|
812
|
+
if (!policyFilePath || !fs.existsSync(policyFilePath)) {
|
|
813
|
+
throw { status: 400, code: 'policy_file_not_found', message: 'Incorrect policyFilePath' };
|
|
814
|
+
}
|
|
815
|
+
const policyFileData = this.licenseFile.loadOfflineResponse(policyFilePath);
|
|
816
|
+
const response = this.licenseAPI.activateAirgappedLicense(policyFileData, licenseKey, policyID);
|
|
817
|
+
this.licenseFile.licenseDataCache.fromJSON(response);
|
|
818
|
+
const license = new license_1.default(this.config.productCode, this.licenseAPI, this.licenseFile, this.floatingAPI);
|
|
819
|
+
return license;
|
|
820
|
+
}
|
|
821
|
+
createOfflineActivationPayload(payload) {
|
|
822
|
+
return this.licenseAPI.createOfflineActivationPayload(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
|
|
823
|
+
}
|
|
824
|
+
createOfflineDeactivationPayload(payload) {
|
|
825
|
+
return this.licenseAPI.createOfflineDeactivationPayload(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
|
|
826
|
+
}
|
|
827
|
+
decodeOfflineActivationPayload(payload) {
|
|
828
|
+
return this.licenseAPI.decodeOfflineActivationPayload(payload);
|
|
829
|
+
}
|
|
830
|
+
decodeOfflineDeactivationPayload(payload) {
|
|
831
|
+
return this.licenseAPI.decodeOfflineDeactivationPayload(payload);
|
|
832
|
+
}
|
|
833
|
+
};
|
|
834
|
+
__setFunctionName(_classThis, "LicenseManager");
|
|
835
|
+
(() => {
|
|
836
|
+
var _a;
|
|
837
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create((_a = _classSuper[Symbol.metadata]) !== null && _a !== void 0 ? _a : null) : void 0;
|
|
838
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
839
|
+
LicenseManager = _classThis = _classDescriptor.value;
|
|
840
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
841
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
842
|
+
})();
|
|
843
|
+
return LicenseManager = _classThis;
|
|
844
|
+
})();
|
|
789
845
|
exports.default = LicenseManager;
|
|
790
846
|
//# sourceMappingURL=license-manager.js.map
|