@licensespring/node-sdk 1.0.2

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.
Files changed (187) hide show
  1. package/README.md +1 -0
  2. package/dist/.env.prod +22 -0
  3. package/dist/hwid/hardware_id_generator/CHANGELOG.md +4 -0
  4. package/dist/hwid/hardware_id_generator/bin/linux/aarch64/glibc/libhardware_id_generator.so +0 -0
  5. package/dist/hwid/hardware_id_generator/bin/linux/aarch64/musl/libhardware_id_generator.so +0 -0
  6. package/dist/hwid/hardware_id_generator/bin/linux/arm/glibc/libhardware_id_generator.so +0 -0
  7. package/dist/hwid/hardware_id_generator/bin/linux/arm/musl/libhardware_id_generator.so +0 -0
  8. package/dist/hwid/hardware_id_generator/bin/linux/i686/glibc/libhardware_id_generator.so +0 -0
  9. package/dist/hwid/hardware_id_generator/bin/linux/i686/musl/libhardware_id_generator.so +0 -0
  10. package/dist/hwid/hardware_id_generator/bin/linux/ppc64le/glibc/libhardware_id_generator.so +0 -0
  11. package/dist/hwid/hardware_id_generator/bin/linux/ppc64le/musl/libhardware_id_generator.so +0 -0
  12. package/dist/hwid/hardware_id_generator/bin/linux/riscv64/glibc/libhardware_id_generator.so +0 -0
  13. package/dist/hwid/hardware_id_generator/bin/linux/riscv64/musl/libhardware_id_generator.so +0 -0
  14. package/dist/hwid/hardware_id_generator/bin/linux/s390x/glibc/libhardware_id_generator.so +0 -0
  15. package/dist/hwid/hardware_id_generator/bin/linux/s390x/musl/libhardware_id_generator.so +0 -0
  16. package/dist/hwid/hardware_id_generator/bin/linux/x86_64/glibc/libhardware_id_generator.so +0 -0
  17. package/dist/hwid/hardware_id_generator/bin/linux/x86_64/musl/libhardware_id_generator.so +0 -0
  18. package/dist/hwid/hardware_id_generator/bin/macos/arm64/libhardware_id_generator.so +0 -0
  19. package/dist/hwid/hardware_id_generator/bin/macos/x86_64/libhardware_id_generator.so +0 -0
  20. package/dist/hwid/hardware_id_generator/bin/windows/arm/hardware_id_generator.dll +0 -0
  21. package/dist/hwid/hardware_id_generator/bin/windows/arm64/hardware_id_generator.dll +0 -0
  22. package/dist/hwid/hardware_id_generator/bin/windows/x64/hardware_id_generator.dll +0 -0
  23. package/dist/hwid/hardware_id_generator/bin/windows/x86/hardware_id_generator.dll +0 -0
  24. package/dist/hwid/hardware_id_generator/documentation/Documentation.html +1 -0
  25. package/dist/hwid/hardware_id_generator/documentation/README.md +25 -0
  26. package/dist/hwid/hardware_id_generator/documentation/html/annotated.html +115 -0
  27. package/dist/hwid/hardware_id_generator/documentation/html/annotated_dup.js +10 -0
  28. package/dist/hwid/hardware_id_generator/documentation/html/bc_s.png +0 -0
  29. package/dist/hwid/hardware_id_generator/documentation/html/bc_sd.png +0 -0
  30. package/dist/hwid/hardware_id_generator/documentation/html/classLicenseSpring_1_1HardwareIdProvider-members.html +114 -0
  31. package/dist/hwid/hardware_id_generator/documentation/html/classLicenseSpring_1_1HardwareIdProvider.html +338 -0
  32. package/dist/hwid/hardware_id_generator/documentation/html/classLicenseSpring_1_1HardwareIdProvider.js +5 -0
  33. package/dist/hwid/hardware_id_generator/documentation/html/classLicenseSpring_1_1HardwareIdProvider.png +0 -0
  34. package/dist/hwid/hardware_id_generator/documentation/html/classLicenseSpring_1_1HardwareIdProviderCloud-members.html +114 -0
  35. package/dist/hwid/hardware_id_generator/documentation/html/classLicenseSpring_1_1HardwareIdProviderCloud.html +184 -0
  36. package/dist/hwid/hardware_id_generator/documentation/html/classLicenseSpring_1_1HardwareIdProviderCloud.js +4 -0
  37. package/dist/hwid/hardware_id_generator/documentation/html/classLicenseSpring_1_1HardwareIdProviderCloud.png +0 -0
  38. package/dist/hwid/hardware_id_generator/documentation/html/classLicenseSpring_1_1HardwareIdProviderLinux-members.html +114 -0
  39. package/dist/hwid/hardware_id_generator/documentation/html/classLicenseSpring_1_1HardwareIdProviderLinux.html +184 -0
  40. package/dist/hwid/hardware_id_generator/documentation/html/classLicenseSpring_1_1HardwareIdProviderLinux.js +4 -0
  41. package/dist/hwid/hardware_id_generator/documentation/html/classLicenseSpring_1_1HardwareIdProviderLinux.png +0 -0
  42. package/dist/hwid/hardware_id_generator/documentation/html/classLicenseSpring_1_1HardwareIdProviderMacos-members.html +114 -0
  43. package/dist/hwid/hardware_id_generator/documentation/html/classLicenseSpring_1_1HardwareIdProviderMacos.html +184 -0
  44. package/dist/hwid/hardware_id_generator/documentation/html/classLicenseSpring_1_1HardwareIdProviderMacos.js +4 -0
  45. package/dist/hwid/hardware_id_generator/documentation/html/classLicenseSpring_1_1HardwareIdProviderMacos.png +0 -0
  46. package/dist/hwid/hardware_id_generator/documentation/html/classLicenseSpring_1_1HardwareIdProviderWindows-members.html +114 -0
  47. package/dist/hwid/hardware_id_generator/documentation/html/classLicenseSpring_1_1HardwareIdProviderWindows.html +192 -0
  48. package/dist/hwid/hardware_id_generator/documentation/html/classLicenseSpring_1_1HardwareIdProviderWindows.js +4 -0
  49. package/dist/hwid/hardware_id_generator/documentation/html/classLicenseSpring_1_1HardwareIdProviderWindows.png +0 -0
  50. package/dist/hwid/hardware_id_generator/documentation/html/classes.html +111 -0
  51. package/dist/hwid/hardware_id_generator/documentation/html/closed.png +0 -0
  52. package/dist/hwid/hardware_id_generator/documentation/html/dir_a49c68042076af89c9be520540c36a5a.html +106 -0
  53. package/dist/hwid/hardware_id_generator/documentation/html/dir_d44c64559bbebec7f509842c48db8b23.html +122 -0
  54. package/dist/hwid/hardware_id_generator/documentation/html/dir_d44c64559bbebec7f509842c48db8b23.js +9 -0
  55. package/dist/hwid/hardware_id_generator/documentation/html/doc.svg +12 -0
  56. package/dist/hwid/hardware_id_generator/documentation/html/docd.svg +12 -0
  57. package/dist/hwid/hardware_id_generator/documentation/html/doxygen.css +2045 -0
  58. package/dist/hwid/hardware_id_generator/documentation/html/doxygen.svg +28 -0
  59. package/dist/hwid/hardware_id_generator/documentation/html/dynsections.js +192 -0
  60. package/dist/hwid/hardware_id_generator/documentation/html/exports_8h_source.html +137 -0
  61. package/dist/hwid/hardware_id_generator/documentation/html/files.html +116 -0
  62. package/dist/hwid/hardware_id_generator/documentation/html/files_dup.js +4 -0
  63. package/dist/hwid/hardware_id_generator/documentation/html/folderclosed.svg +11 -0
  64. package/dist/hwid/hardware_id_generator/documentation/html/folderclosedd.svg +11 -0
  65. package/dist/hwid/hardware_id_generator/documentation/html/folderopen.svg +17 -0
  66. package/dist/hwid/hardware_id_generator/documentation/html/folderopend.svg +12 -0
  67. package/dist/hwid/hardware_id_generator/documentation/html/functions.html +110 -0
  68. package/dist/hwid/hardware_id_generator/documentation/html/functions_func.html +110 -0
  69. package/dist/hwid/hardware_id_generator/documentation/html/hardware__id__provider_8h_source.html +161 -0
  70. package/dist/hwid/hardware_id_generator/documentation/html/hardware__id__provider__cloud_8h_source.html +142 -0
  71. package/dist/hwid/hardware_id_generator/documentation/html/hardware__id__provider__linux_8h_source.html +131 -0
  72. package/dist/hwid/hardware_id_generator/documentation/html/hardware__id__provider__macos_8h_source.html +131 -0
  73. package/dist/hwid/hardware_id_generator/documentation/html/hardware__id__provider__windows_8h_source.html +149 -0
  74. package/dist/hwid/hardware_id_generator/documentation/html/hierarchy.html +114 -0
  75. package/dist/hwid/hardware_id_generator/documentation/html/hierarchy.js +9 -0
  76. package/dist/hwid/hardware_id_generator/documentation/html/index.html +132 -0
  77. package/dist/hwid/hardware_id_generator/documentation/html/index.js +4 -0
  78. package/dist/hwid/hardware_id_generator/documentation/html/jquery.js +34 -0
  79. package/dist/hwid/hardware_id_generator/documentation/html/logo_small.png +0 -0
  80. package/dist/hwid/hardware_id_generator/documentation/html/menu.js +136 -0
  81. package/dist/hwid/hardware_id_generator/documentation/html/menudata.js +35 -0
  82. package/dist/hwid/hardware_id_generator/documentation/html/minus.svg +8 -0
  83. package/dist/hwid/hardware_id_generator/documentation/html/minusd.svg +8 -0
  84. package/dist/hwid/hardware_id_generator/documentation/html/nav_f.png +0 -0
  85. package/dist/hwid/hardware_id_generator/documentation/html/nav_fd.png +0 -0
  86. package/dist/hwid/hardware_id_generator/documentation/html/nav_g.png +0 -0
  87. package/dist/hwid/hardware_id_generator/documentation/html/nav_h.png +0 -0
  88. package/dist/hwid/hardware_id_generator/documentation/html/nav_hd.png +0 -0
  89. package/dist/hwid/hardware_id_generator/documentation/html/navtree.css +149 -0
  90. package/dist/hwid/hardware_id_generator/documentation/html/navtree.js +559 -0
  91. package/dist/hwid/hardware_id_generator/documentation/html/navtreedata.js +50 -0
  92. package/dist/hwid/hardware_id_generator/documentation/html/navtreeindex0.js +31 -0
  93. package/dist/hwid/hardware_id_generator/documentation/html/open.png +0 -0
  94. package/dist/hwid/hardware_id_generator/documentation/html/plus.svg +9 -0
  95. package/dist/hwid/hardware_id_generator/documentation/html/plusd.svg +9 -0
  96. package/dist/hwid/hardware_id_generator/documentation/html/resize.js +155 -0
  97. package/dist/hwid/hardware_id_generator/documentation/html/search/all_0.js +4 -0
  98. package/dist/hwid/hardware_id_generator/documentation/html/search/all_1.js +4 -0
  99. package/dist/hwid/hardware_id_generator/documentation/html/search/all_2.js +6 -0
  100. package/dist/hwid/hardware_id_generator/documentation/html/search/all_3.js +9 -0
  101. package/dist/hwid/hardware_id_generator/documentation/html/search/all_4.js +4 -0
  102. package/dist/hwid/hardware_id_generator/documentation/html/search/all_5.js +5 -0
  103. package/dist/hwid/hardware_id_generator/documentation/html/search/all_6.js +4 -0
  104. package/dist/hwid/hardware_id_generator/documentation/html/search/all_7.js +4 -0
  105. package/dist/hwid/hardware_id_generator/documentation/html/search/all_8.js +4 -0
  106. package/dist/hwid/hardware_id_generator/documentation/html/search/all_9.js +4 -0
  107. package/dist/hwid/hardware_id_generator/documentation/html/search/classes_0.js +8 -0
  108. package/dist/hwid/hardware_id_generator/documentation/html/search/close.svg +18 -0
  109. package/dist/hwid/hardware_id_generator/documentation/html/search/functions_0.js +4 -0
  110. package/dist/hwid/hardware_id_generator/documentation/html/search/functions_1.js +4 -0
  111. package/dist/hwid/hardware_id_generator/documentation/html/search/functions_2.js +6 -0
  112. package/dist/hwid/hardware_id_generator/documentation/html/search/functions_3.js +4 -0
  113. package/dist/hwid/hardware_id_generator/documentation/html/search/mag.svg +24 -0
  114. package/dist/hwid/hardware_id_generator/documentation/html/search/mag_d.svg +24 -0
  115. package/dist/hwid/hardware_id_generator/documentation/html/search/mag_sel.svg +31 -0
  116. package/dist/hwid/hardware_id_generator/documentation/html/search/mag_seld.svg +31 -0
  117. package/dist/hwid/hardware_id_generator/documentation/html/search/pages_0.js +4 -0
  118. package/dist/hwid/hardware_id_generator/documentation/html/search/pages_1.js +4 -0
  119. package/dist/hwid/hardware_id_generator/documentation/html/search/pages_2.js +4 -0
  120. package/dist/hwid/hardware_id_generator/documentation/html/search/pages_3.js +4 -0
  121. package/dist/hwid/hardware_id_generator/documentation/html/search/search.css +291 -0
  122. package/dist/hwid/hardware_id_generator/documentation/html/search/search.js +840 -0
  123. package/dist/hwid/hardware_id_generator/documentation/html/search/searchdata.js +24 -0
  124. package/dist/hwid/hardware_id_generator/documentation/html/splitbar.png +0 -0
  125. package/dist/hwid/hardware_id_generator/documentation/html/splitbard.png +0 -0
  126. package/dist/hwid/hardware_id_generator/documentation/html/sync_off.png +0 -0
  127. package/dist/hwid/hardware_id_generator/documentation/html/sync_on.png +0 -0
  128. package/dist/hwid/hardware_id_generator/documentation/html/tab_a.png +0 -0
  129. package/dist/hwid/hardware_id_generator/documentation/html/tab_ad.png +0 -0
  130. package/dist/hwid/hardware_id_generator/documentation/html/tab_b.png +0 -0
  131. package/dist/hwid/hardware_id_generator/documentation/html/tab_bd.png +0 -0
  132. package/dist/hwid/hardware_id_generator/documentation/html/tab_h.png +0 -0
  133. package/dist/hwid/hardware_id_generator/documentation/html/tab_hd.png +0 -0
  134. package/dist/hwid/hardware_id_generator/documentation/html/tab_s.png +0 -0
  135. package/dist/hwid/hardware_id_generator/documentation/html/tab_sd.png +0 -0
  136. package/dist/hwid/hardware_id_generator/documentation/html/tabs.css +1 -0
  137. package/dist/hwid/hardware_id_generator/documentation/licenses/curl/LICENSE.txt +11 -0
  138. package/dist/hwid/hardware_id_generator/documentation/licenses/openssl/LICENSE.txt +177 -0
  139. package/dist/hwid/index.d.ts +12 -0
  140. package/dist/hwid/index.js +82 -0
  141. package/dist/hwid/index.js.map +1 -0
  142. package/dist/hwid/install.d.ts +1 -0
  143. package/dist/hwid/install.js +49 -0
  144. package/dist/hwid/install.js.map +1 -0
  145. package/dist/src/abstract-manager.d.ts +21 -0
  146. package/dist/src/abstract-manager.js +170 -0
  147. package/dist/src/abstract-manager.js.map +1 -0
  148. package/dist/src/api.d.ts +2765 -0
  149. package/dist/src/api.js +2533 -0
  150. package/dist/src/api.js.map +1 -0
  151. package/dist/src/common.d.ts +11 -0
  152. package/dist/src/common.js +87 -0
  153. package/dist/src/common.js.map +1 -0
  154. package/dist/src/floating.d.ts +46 -0
  155. package/dist/src/floating.js +273 -0
  156. package/dist/src/floating.js.map +1 -0
  157. package/dist/src/index.d.ts +4 -0
  158. package/dist/src/index.js +13 -0
  159. package/dist/src/index.js.map +1 -0
  160. package/dist/src/license-data.d.ts +52 -0
  161. package/dist/src/license-data.js +214 -0
  162. package/dist/src/license-data.js.map +1 -0
  163. package/dist/src/license-file.d.ts +23 -0
  164. package/dist/src/license-file.js +238 -0
  165. package/dist/src/license-file.js.map +1 -0
  166. package/dist/src/license-manager.d.ts +34 -0
  167. package/dist/src/license-manager.js +1010 -0
  168. package/dist/src/license-manager.js.map +1 -0
  169. package/dist/src/license.d.ts +644 -0
  170. package/dist/src/license.js +630 -0
  171. package/dist/src/license.js.map +1 -0
  172. package/dist/src/offline-activation.d.ts +6 -0
  173. package/dist/src/offline-activation.js +10 -0
  174. package/dist/src/offline-activation.js.map +1 -0
  175. package/dist/src/service.d.ts +21 -0
  176. package/dist/src/service.js +100 -0
  177. package/dist/src/service.js.map +1 -0
  178. package/dist/src/types.d.ts +513 -0
  179. package/dist/src/types.js +14 -0
  180. package/dist/src/types.js.map +1 -0
  181. package/dist/src/version.d.ts +2 -0
  182. package/dist/src/version.js +5 -0
  183. package/dist/src/version.js.map +1 -0
  184. package/dist/src/watchdog.d.ts +18 -0
  185. package/dist/src/watchdog.js +80 -0
  186. package/dist/src/watchdog.js.map +1 -0
  187. package/package.json +45 -0
@@ -0,0 +1,1010 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
+ return new (P || (P = Promise))(function (resolve, reject) {
28
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
32
+ });
33
+ };
34
+ var __importDefault = (this && this.__importDefault) || function (mod) {
35
+ return (mod && mod.__esModule) ? mod : { "default": mod };
36
+ };
37
+ Object.defineProperty(exports, "__esModule", { value: true });
38
+ const typia_1 = __importDefault(require("typia"));
39
+ const dayjs_1 = __importDefault(require("dayjs"));
40
+ const utc_js_1 = __importDefault(require("dayjs/plugin/utc.js"));
41
+ const isSameOrAfter_js_1 = __importDefault(require("dayjs/plugin/isSameOrAfter.js"));
42
+ const abstract_manager_1 = __importDefault(require("./abstract-manager"));
43
+ const path = __importStar(require("node:path"));
44
+ const fs = __importStar(require("node:fs"));
45
+ dayjs_1.default.extend(utc_js_1.default);
46
+ dayjs_1.default.extend(isSameOrAfter_js_1.default);
47
+ const dotenv = __importStar(require("dotenv"));
48
+ const license_1 = __importDefault(require("./license"));
49
+ dotenv.config({ path: path.join(__dirname, `../.env.${process.env.NODE_ENV || 'prod'}`) });
50
+ class LicenseManager extends abstract_manager_1.default {
51
+ checkLicenseStatus(license) {
52
+ if (!license.license_enabled) {
53
+ throw { status: 400, code: 'license_not_enabled', message: 'The license is not enabled' };
54
+ }
55
+ if (!license.license_active) {
56
+ throw { status: 400, code: 'license_not_active', message: 'The license is not active' };
57
+ }
58
+ if (license.validity_period) {
59
+ if ((0, dayjs_1.default)().utc().startOf('day').isSameOrAfter(license.validity_period)) {
60
+ throw { status: 400, code: 'license_expired', message: 'The license is expired' };
61
+ }
62
+ }
63
+ }
64
+ isValid(license) {
65
+ if (!license.license_enabled) {
66
+ return false;
67
+ }
68
+ if (!license.license_active) {
69
+ return false;
70
+ }
71
+ if (license.validity_period) {
72
+ if ((0, dayjs_1.default)().utc().startOf('day').isSameOrAfter(license.validity_period)) {
73
+ return false;
74
+ }
75
+ }
76
+ return true;
77
+ }
78
+ maintenanceDaysRemaining(license) {
79
+ if (license.enable_maintenance_period) {
80
+ return (0, dayjs_1.default)(license.maintenance_period).utc().endOf('day').diff((0, dayjs_1.default)().utc().startOf('day'), 'day');
81
+ }
82
+ return null;
83
+ }
84
+ daysRemaining(license) {
85
+ if (license.validity_period) {
86
+ 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');
87
+ }
88
+ }
89
+ checkLicense(payload) {
90
+ return __awaiter(this, void 0, void 0, function* () {
91
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => (undefined === input.username || "string" === typeof input.username) && (undefined === input.license_key || "string" === typeof input.license_key) && (undefined === input.license_id || "number" === typeof input.license_id) && (undefined === input.bundle_code || "string" === typeof input.bundle_code); const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.username || "string" === typeof input.username || $guard(_exceptionable, {
92
+ path: _path + ".username",
93
+ expected: "(string | undefined)",
94
+ value: input.username
95
+ }, _errorFactory)) && (undefined === input.license_key || "string" === typeof input.license_key || $guard(_exceptionable, {
96
+ path: _path + ".license_key",
97
+ expected: "(string | undefined)",
98
+ value: input.license_key
99
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
100
+ path: _path + ".license_id",
101
+ expected: "(number | undefined)",
102
+ value: input.license_id
103
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
104
+ path: _path + ".bundle_code",
105
+ expected: "(string | undefined)",
106
+ value: input.bundle_code
107
+ }, _errorFactory)); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
108
+ if (false === __is(input)) {
109
+ _errorFactory = errorFactory;
110
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
111
+ path: _path + "",
112
+ expected: "Managed<LicenseIdentificator>",
113
+ value: input
114
+ }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
115
+ path: _path + "",
116
+ expected: "Managed<LicenseIdentificator>",
117
+ value: input
118
+ }, _errorFactory))(input, "$input", true);
119
+ }
120
+ return input;
121
+ }; })()(payload);
122
+ const response = yield this.licenseAPI.checkLicense(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
123
+ this.checkLicenseStatus(response);
124
+ this.licenseFile.licenseDataCache.updateCache('check_license', response);
125
+ this.licenseFile.saveLicenseFile();
126
+ return response;
127
+ });
128
+ }
129
+ ;
130
+ activateLicense(payload) {
131
+ return __awaiter(this, void 0, void 0, function* () {
132
+ (() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => (undefined === input.username || "string" === typeof input.username) && (undefined === input.license_key || "string" === typeof input.license_key) && (undefined === input.license_id || "number" === typeof input.license_id) && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.variables || "object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) && $io1(input.variables)); const $io1 = input => Object.keys(input).every(key => {
133
+ const value = input[key];
134
+ if (undefined === value)
135
+ return true;
136
+ return "string" === typeof value;
137
+ }); const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.username || "string" === typeof input.username || $guard(_exceptionable, {
138
+ path: _path + ".username",
139
+ expected: "(string | undefined)",
140
+ value: input.username
141
+ }, _errorFactory)) && (undefined === input.license_key || "string" === typeof input.license_key || $guard(_exceptionable, {
142
+ path: _path + ".license_key",
143
+ expected: "(string | undefined)",
144
+ value: input.license_key
145
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
146
+ path: _path + ".license_id",
147
+ expected: "(number | undefined)",
148
+ value: input.license_id
149
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
150
+ path: _path + ".bundle_code",
151
+ expected: "(string | undefined)",
152
+ value: input.bundle_code
153
+ }, _errorFactory)) && (undefined === input.variables || ("object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) || $guard(_exceptionable, {
154
+ path: _path + ".variables",
155
+ expected: "(Dictionary<string> | undefined)",
156
+ value: input.variables
157
+ }, _errorFactory)) && $ao1(input.variables, _path + ".variables", true && _exceptionable) || $guard(_exceptionable, {
158
+ path: _path + ".variables",
159
+ expected: "(Dictionary<string> | undefined)",
160
+ value: input.variables
161
+ }, _errorFactory)); const $ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
162
+ const value = input[key];
163
+ if (undefined === value)
164
+ return true;
165
+ return "string" === typeof value || $guard(_exceptionable, {
166
+ path: _path + $join(key),
167
+ expected: "string",
168
+ value: value
169
+ }, _errorFactory);
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<LicenseIdentificatorWithVariables>",
176
+ value: input
177
+ }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
178
+ path: _path + "",
179
+ expected: "Managed<LicenseIdentificatorWithVariables>",
180
+ value: input
181
+ }, _errorFactory))(input, "$input", true);
182
+ }
183
+ return input;
184
+ }; })()(payload);
185
+ const response = yield this.licenseAPI.activateLicense(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
186
+ this.licenseFile.licenseDataCache.updateCache('activate_license', response);
187
+ this.licenseFile.saveLicenseFile();
188
+ return response;
189
+ });
190
+ }
191
+ ;
192
+ deactivateLicense(payload) {
193
+ return __awaiter(this, void 0, void 0, function* () {
194
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => (undefined === input.username || "string" === typeof input.username) && (undefined === input.license_key || "string" === typeof input.license_key) && (undefined === input.license_id || "number" === typeof input.license_id) && (undefined === input.bundle_code || "string" === typeof input.bundle_code); const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.username || "string" === typeof input.username || $guard(_exceptionable, {
195
+ path: _path + ".username",
196
+ expected: "(string | undefined)",
197
+ value: input.username
198
+ }, _errorFactory)) && (undefined === input.license_key || "string" === typeof input.license_key || $guard(_exceptionable, {
199
+ path: _path + ".license_key",
200
+ expected: "(string | undefined)",
201
+ value: input.license_key
202
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
203
+ path: _path + ".license_id",
204
+ expected: "(number | undefined)",
205
+ value: input.license_id
206
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
207
+ path: _path + ".bundle_code",
208
+ expected: "(string | undefined)",
209
+ value: input.bundle_code
210
+ }, _errorFactory)); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
211
+ if (false === __is(input)) {
212
+ _errorFactory = errorFactory;
213
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
214
+ path: _path + "",
215
+ expected: "Managed<LicenseIdentificator>",
216
+ value: input
217
+ }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
218
+ path: _path + "",
219
+ expected: "Managed<LicenseIdentificator>",
220
+ value: input
221
+ }, _errorFactory))(input, "$input", true);
222
+ }
223
+ return input;
224
+ }; })()(payload);
225
+ const response = yield this.licenseAPI.deactivateLicense(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
226
+ this.licenseFile.licenseDataCache.deactivate();
227
+ this.licenseFile.saveLicenseFile();
228
+ return response;
229
+ });
230
+ }
231
+ ;
232
+ activateOffline(payload) {
233
+ return __awaiter(this, void 0, void 0, function* () {
234
+ (() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => (undefined === input.prefix || "string" === typeof input.prefix) && (undefined === input.username || "string" === typeof input.username) && (undefined === input.license_key || "string" === typeof input.license_key) && (undefined === input.hostname || "string" === typeof input.hostname) && (undefined === input.license_id || "number" === typeof input.license_id) && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.variables || "object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) && $io1(input.variables)) && (undefined === input.os_ver || "string" === typeof input.os_ver) && (undefined === input.sdk_build_version || "string" === typeof input.sdk_build_version) && (undefined === input.ip || "string" === typeof input.ip) && (undefined === input.external_ip || "string" === typeof input.external_ip) && (undefined === input.app_ver || "string" === typeof input.app_ver) && (undefined === input.mac_address || "string" === typeof input.mac_address); const $io1 = input => Object.keys(input).every(key => {
235
+ const value = input[key];
236
+ if (undefined === value)
237
+ return true;
238
+ return "string" === typeof value;
239
+ }); const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.prefix || "string" === typeof input.prefix || $guard(_exceptionable, {
240
+ path: _path + ".prefix",
241
+ expected: "(string | undefined)",
242
+ value: input.prefix
243
+ }, _errorFactory)) && (undefined === input.username || "string" === typeof input.username || $guard(_exceptionable, {
244
+ path: _path + ".username",
245
+ expected: "(string | undefined)",
246
+ value: input.username
247
+ }, _errorFactory)) && (undefined === input.license_key || "string" === typeof input.license_key || $guard(_exceptionable, {
248
+ path: _path + ".license_key",
249
+ expected: "(string | undefined)",
250
+ value: input.license_key
251
+ }, _errorFactory)) && (undefined === input.hostname || "string" === typeof input.hostname || $guard(_exceptionable, {
252
+ path: _path + ".hostname",
253
+ expected: "(string | undefined)",
254
+ value: input.hostname
255
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
256
+ path: _path + ".license_id",
257
+ expected: "(number | undefined)",
258
+ value: input.license_id
259
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
260
+ path: _path + ".bundle_code",
261
+ expected: "(string | undefined)",
262
+ value: input.bundle_code
263
+ }, _errorFactory)) && (undefined === input.variables || ("object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) || $guard(_exceptionable, {
264
+ path: _path + ".variables",
265
+ expected: "(Dictionary<string> | undefined)",
266
+ value: input.variables
267
+ }, _errorFactory)) && $ao1(input.variables, _path + ".variables", true && _exceptionable) || $guard(_exceptionable, {
268
+ path: _path + ".variables",
269
+ expected: "(Dictionary<string> | undefined)",
270
+ value: input.variables
271
+ }, _errorFactory)) && (undefined === input.os_ver || "string" === typeof input.os_ver || $guard(_exceptionable, {
272
+ path: _path + ".os_ver",
273
+ expected: "(string | undefined)",
274
+ value: input.os_ver
275
+ }, _errorFactory)) && (undefined === input.sdk_build_version || "string" === typeof input.sdk_build_version || $guard(_exceptionable, {
276
+ path: _path + ".sdk_build_version",
277
+ expected: "(string | undefined)",
278
+ value: input.sdk_build_version
279
+ }, _errorFactory)) && (undefined === input.ip || "string" === typeof input.ip || $guard(_exceptionable, {
280
+ path: _path + ".ip",
281
+ expected: "(string | undefined)",
282
+ value: input.ip
283
+ }, _errorFactory)) && (undefined === input.external_ip || "string" === typeof input.external_ip || $guard(_exceptionable, {
284
+ path: _path + ".external_ip",
285
+ expected: "(string | undefined)",
286
+ value: input.external_ip
287
+ }, _errorFactory)) && (undefined === input.app_ver || "string" === typeof input.app_ver || $guard(_exceptionable, {
288
+ path: _path + ".app_ver",
289
+ expected: "(string | undefined)",
290
+ value: input.app_ver
291
+ }, _errorFactory)) && (undefined === input.mac_address || "string" === typeof input.mac_address || $guard(_exceptionable, {
292
+ path: _path + ".mac_address",
293
+ expected: "(string | undefined)",
294
+ value: input.mac_address
295
+ }, _errorFactory)); const $ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
296
+ const value = input[key];
297
+ if (undefined === value)
298
+ return true;
299
+ return "string" === typeof value || $guard(_exceptionable, {
300
+ path: _path + $join(key),
301
+ expected: "string",
302
+ value: value
303
+ }, _errorFactory);
304
+ }); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
305
+ if (false === __is(input)) {
306
+ _errorFactory = errorFactory;
307
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
308
+ path: _path + "",
309
+ expected: "Managed<LicenseIdentificatorOfflineWithVariables>",
310
+ value: input
311
+ }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
312
+ path: _path + "",
313
+ expected: "Managed<LicenseIdentificatorOfflineWithVariables>",
314
+ value: input
315
+ }, _errorFactory))(input, "$input", true);
316
+ }
317
+ return input;
318
+ }; })()(payload);
319
+ const response = yield this.licenseAPI.activateOffline(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
320
+ this.licenseFile.licenseDataCache.updateCache('activate_license_offline', response);
321
+ this.licenseFile.saveLicenseFile();
322
+ return response;
323
+ });
324
+ }
325
+ ;
326
+ deactivateOffline(payload) {
327
+ return __awaiter(this, void 0, void 0, function* () {
328
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => (undefined === input.username || "string" === typeof input.username) && (undefined === input.license_key || "string" === typeof input.license_key) && (undefined === input.license_id || "number" === typeof input.license_id) && (undefined === input.bundle_code || "string" === typeof input.bundle_code); const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.username || "string" === typeof input.username || $guard(_exceptionable, {
329
+ path: _path + ".username",
330
+ expected: "(string | undefined)",
331
+ value: input.username
332
+ }, _errorFactory)) && (undefined === input.license_key || "string" === typeof input.license_key || $guard(_exceptionable, {
333
+ path: _path + ".license_key",
334
+ expected: "(string | undefined)",
335
+ value: input.license_key
336
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
337
+ path: _path + ".license_id",
338
+ expected: "(number | undefined)",
339
+ value: input.license_id
340
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
341
+ path: _path + ".bundle_code",
342
+ expected: "(string | undefined)",
343
+ value: input.bundle_code
344
+ }, _errorFactory)); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
345
+ if (false === __is(input)) {
346
+ _errorFactory = errorFactory;
347
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
348
+ path: _path + "",
349
+ expected: "Managed<LicenseIdentificator>",
350
+ value: input
351
+ }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
352
+ path: _path + "",
353
+ expected: "Managed<LicenseIdentificator>",
354
+ value: input
355
+ }, _errorFactory))(input, "$input", true);
356
+ }
357
+ return input;
358
+ }; })()(payload);
359
+ const response = yield this.licenseAPI.deactivateOffline(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
360
+ this.licenseFile.licenseDataCache.deactivate();
361
+ this.licenseFile.saveLicenseFile();
362
+ return response;
363
+ });
364
+ }
365
+ ;
366
+ getTrialKey(payload) {
367
+ return __awaiter(this, void 0, void 0, function* () {
368
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => "string" === typeof input.email; const $ao0 = (input, _path, _exceptionable = true) => "string" === typeof input.email || $guard(_exceptionable, {
369
+ path: _path + ".email",
370
+ expected: "string",
371
+ value: input.email
372
+ }, _errorFactory); const __is = input => "object" === typeof input && null !== input && $io0(input); let _errorFactory; return (input, errorFactory) => {
373
+ if (false === __is(input)) {
374
+ _errorFactory = errorFactory;
375
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
376
+ path: _path + "",
377
+ expected: "Managed<TrialKeyPayload>",
378
+ value: input
379
+ }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
380
+ path: _path + "",
381
+ expected: "Managed<TrialKeyPayload>",
382
+ value: input
383
+ }, _errorFactory))(input, "$input", true);
384
+ }
385
+ return input;
386
+ }; })()(payload);
387
+ const response = yield this.licenseAPI.getTrialKey(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
388
+ this.licenseFile.licenseDataCache.updateCache('activate_license', response);
389
+ this.licenseFile.saveLicenseFile();
390
+ return response;
391
+ });
392
+ }
393
+ ;
394
+ getUserLicenses(payload) {
395
+ return __awaiter(this, void 0, void 0, function* () {
396
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => "string" === typeof input.username && "string" === typeof input.password; const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.username || $guard(_exceptionable, {
397
+ path: _path + ".username",
398
+ expected: "string",
399
+ value: input.username
400
+ }, _errorFactory)) && ("string" === typeof input.password || $guard(_exceptionable, {
401
+ path: _path + ".password",
402
+ expected: "string",
403
+ value: input.password
404
+ }, _errorFactory)); const __is = input => "object" === typeof input && null !== input && $io0(input); let _errorFactory; return (input, errorFactory) => {
405
+ if (false === __is(input)) {
406
+ _errorFactory = errorFactory;
407
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
408
+ path: _path + "",
409
+ expected: "Managed<GetUserLicensesPayload>",
410
+ value: input
411
+ }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
412
+ path: _path + "",
413
+ expected: "Managed<GetUserLicensesPayload>",
414
+ value: input
415
+ }, _errorFactory))(input, "$input", true);
416
+ }
417
+ return input;
418
+ }; })()(payload);
419
+ return yield this.licenseAPI.getUserLicenses(Object.assign(Object.assign({}, payload), { product: this.config.productCode }));
420
+ });
421
+ }
422
+ ;
423
+ getCustomerLicenseUsers(payload) {
424
+ return __awaiter(this, void 0, void 0, function* () {
425
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => "string" === typeof input.customer; const $ao0 = (input, _path, _exceptionable = true) => "string" === typeof input.customer || $guard(_exceptionable, {
426
+ path: _path + ".customer",
427
+ expected: "string",
428
+ value: input.customer
429
+ }, _errorFactory); const __is = input => "object" === typeof input && null !== input && $io0(input); let _errorFactory; return (input, errorFactory) => {
430
+ if (false === __is(input)) {
431
+ _errorFactory = errorFactory;
432
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
433
+ path: _path + "",
434
+ expected: "Managed<GetCustomerLicensesPayload>",
435
+ value: input
436
+ }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
437
+ path: _path + "",
438
+ expected: "Managed<GetCustomerLicensesPayload>",
439
+ value: input
440
+ }, _errorFactory))(input, "$input", true);
441
+ }
442
+ return input;
443
+ }; })()(payload);
444
+ return yield this.licenseAPI.getCustomerLicenseUsers(Object.assign(Object.assign({}, payload), { product: this.config.productCode }));
445
+ });
446
+ }
447
+ ;
448
+ checkLicenseFeature(payload) {
449
+ return __awaiter(this, void 0, void 0, function* () {
450
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => (undefined === input.username || "string" === typeof input.username) && (undefined === input.license_key || "string" === typeof input.license_key) && (undefined === input.license_id || "number" === typeof input.license_id) && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && "string" === typeof input.feature; const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.username || "string" === typeof input.username || $guard(_exceptionable, {
451
+ path: _path + ".username",
452
+ expected: "(string | undefined)",
453
+ value: input.username
454
+ }, _errorFactory)) && (undefined === input.license_key || "string" === typeof input.license_key || $guard(_exceptionable, {
455
+ path: _path + ".license_key",
456
+ expected: "(string | undefined)",
457
+ value: input.license_key
458
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
459
+ path: _path + ".license_id",
460
+ expected: "(number | undefined)",
461
+ value: input.license_id
462
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
463
+ path: _path + ".bundle_code",
464
+ expected: "(string | undefined)",
465
+ value: input.bundle_code
466
+ }, _errorFactory)) && ("string" === typeof input.feature || $guard(_exceptionable, {
467
+ path: _path + ".feature",
468
+ expected: "string",
469
+ value: input.feature
470
+ }, _errorFactory)); const __is = input => "object" === typeof input && null !== input && $io0(input); let _errorFactory; return (input, errorFactory) => {
471
+ if (false === __is(input)) {
472
+ _errorFactory = errorFactory;
473
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
474
+ path: _path + "",
475
+ expected: "Managed<LicenseIdentificatorAndFeature>",
476
+ value: input
477
+ }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
478
+ path: _path + "",
479
+ expected: "Managed<LicenseIdentificatorAndFeature>",
480
+ value: input
481
+ }, _errorFactory))(input, "$input", true);
482
+ }
483
+ return input;
484
+ }; })()(payload);
485
+ return yield this.licenseAPI.checkLicenseFeature(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
486
+ });
487
+ }
488
+ ;
489
+ addConsumption(payload) {
490
+ return __awaiter(this, void 0, void 0, function* () {
491
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => (undefined === input.username || "string" === typeof input.username) && (undefined === input.license_key || "string" === typeof input.license_key) && (undefined === input.license_id || "number" === typeof input.license_id) && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && "number" === typeof input.consumptions; const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.username || "string" === typeof input.username || $guard(_exceptionable, {
492
+ path: _path + ".username",
493
+ expected: "(string | undefined)",
494
+ value: input.username
495
+ }, _errorFactory)) && (undefined === input.license_key || "string" === typeof input.license_key || $guard(_exceptionable, {
496
+ path: _path + ".license_key",
497
+ expected: "(string | undefined)",
498
+ value: input.license_key
499
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
500
+ path: _path + ".license_id",
501
+ expected: "(number | undefined)",
502
+ value: input.license_id
503
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
504
+ path: _path + ".bundle_code",
505
+ expected: "(string | undefined)",
506
+ value: input.bundle_code
507
+ }, _errorFactory)) && ("number" === typeof input.consumptions || $guard(_exceptionable, {
508
+ path: _path + ".consumptions",
509
+ expected: "number",
510
+ value: input.consumptions
511
+ }, _errorFactory)); const __is = input => "object" === typeof input && null !== input && $io0(input); let _errorFactory; return (input, errorFactory) => {
512
+ if (false === __is(input)) {
513
+ _errorFactory = errorFactory;
514
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
515
+ path: _path + "",
516
+ expected: "Managed<LicenseIdentificatorAddConsumptions>",
517
+ value: input
518
+ }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
519
+ path: _path + "",
520
+ expected: "Managed<LicenseIdentificatorAddConsumptions>",
521
+ value: input
522
+ }, _errorFactory))(input, "$input", true);
523
+ }
524
+ return input;
525
+ }; })()(payload);
526
+ const response = yield this.licenseAPI.addConsumption(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
527
+ this.licenseFile.licenseDataCache.updateCache('license_consumption', response);
528
+ this.licenseFile.saveLicenseFile();
529
+ return response;
530
+ });
531
+ }
532
+ ;
533
+ addFeatureConsumption(payload) {
534
+ return __awaiter(this, void 0, void 0, function* () {
535
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => (undefined === input.username || "string" === typeof input.username) && (undefined === input.license_key || "string" === typeof input.license_key) && (undefined === input.license_id || "number" === typeof input.license_id) && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && "string" === typeof input.feature && "number" === typeof input.consumptions; const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.username || "string" === typeof input.username || $guard(_exceptionable, {
536
+ path: _path + ".username",
537
+ expected: "(string | undefined)",
538
+ value: input.username
539
+ }, _errorFactory)) && (undefined === input.license_key || "string" === typeof input.license_key || $guard(_exceptionable, {
540
+ path: _path + ".license_key",
541
+ expected: "(string | undefined)",
542
+ value: input.license_key
543
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
544
+ path: _path + ".license_id",
545
+ expected: "(number | undefined)",
546
+ value: input.license_id
547
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
548
+ path: _path + ".bundle_code",
549
+ expected: "(string | undefined)",
550
+ value: input.bundle_code
551
+ }, _errorFactory)) && ("string" === typeof input.feature || $guard(_exceptionable, {
552
+ path: _path + ".feature",
553
+ expected: "string",
554
+ value: input.feature
555
+ }, _errorFactory)) && ("number" === typeof input.consumptions || $guard(_exceptionable, {
556
+ path: _path + ".consumptions",
557
+ expected: "number",
558
+ value: input.consumptions
559
+ }, _errorFactory)); const __is = input => "object" === typeof input && null !== input && $io0(input); let _errorFactory; return (input, errorFactory) => {
560
+ if (false === __is(input)) {
561
+ _errorFactory = errorFactory;
562
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
563
+ path: _path + "",
564
+ expected: "Managed<LicenseIdentificatorAddFeatureConsumptions>",
565
+ value: input
566
+ }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
567
+ path: _path + "",
568
+ expected: "Managed<LicenseIdentificatorAddFeatureConsumptions>",
569
+ value: input
570
+ }, _errorFactory))(input, "$input", true);
571
+ }
572
+ return input;
573
+ }; })()(payload);
574
+ const response = yield this.licenseAPI.addFeatureConsumption(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
575
+ this.licenseFile.licenseDataCache.updateCache('feature_consumption', response);
576
+ this.licenseFile.saveLicenseFile();
577
+ return response;
578
+ });
579
+ }
580
+ ;
581
+ featureRelease(payload) {
582
+ return __awaiter(this, void 0, void 0, function* () {
583
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => (undefined === input.username || "string" === typeof input.username) && (undefined === input.license_key || "string" === typeof input.license_key) && (undefined === input.license_id || "number" === typeof input.license_id) && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && "string" === typeof input.feature; const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.username || "string" === typeof input.username || $guard(_exceptionable, {
584
+ path: _path + ".username",
585
+ expected: "(string | undefined)",
586
+ value: input.username
587
+ }, _errorFactory)) && (undefined === input.license_key || "string" === typeof input.license_key || $guard(_exceptionable, {
588
+ path: _path + ".license_key",
589
+ expected: "(string | undefined)",
590
+ value: input.license_key
591
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
592
+ path: _path + ".license_id",
593
+ expected: "(number | undefined)",
594
+ value: input.license_id
595
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
596
+ path: _path + ".bundle_code",
597
+ expected: "(string | undefined)",
598
+ value: input.bundle_code
599
+ }, _errorFactory)) && ("string" === typeof input.feature || $guard(_exceptionable, {
600
+ path: _path + ".feature",
601
+ expected: "string",
602
+ value: input.feature
603
+ }, _errorFactory)); const __is = input => "object" === typeof input && null !== input && $io0(input); let _errorFactory; return (input, errorFactory) => {
604
+ if (false === __is(input)) {
605
+ _errorFactory = errorFactory;
606
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
607
+ path: _path + "",
608
+ expected: "Managed<LicenseIdentificatorAndFeature>",
609
+ value: input
610
+ }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
611
+ path: _path + "",
612
+ expected: "Managed<LicenseIdentificatorAndFeature>",
613
+ value: input
614
+ }, _errorFactory))(input, "$input", true);
615
+ }
616
+ return input;
617
+ }; })()(payload);
618
+ const response = yield this.licenseAPI.featureRelease(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
619
+ this.licenseFile.licenseDataCache.updateCache('feature_consumption', response);
620
+ this.licenseFile.saveLicenseFile();
621
+ return response;
622
+ });
623
+ }
624
+ ;
625
+ getProductDetails(payload) {
626
+ return __awaiter(this, void 0, void 0, function* () {
627
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => (undefined === input.include_expired_features || "boolean" === typeof input.include_expired_features) && (undefined === input.include_latest_version || "boolean" === typeof input.include_latest_version) && (undefined === input.include_custom_fields || "boolean" === typeof input.include_custom_fields); const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.include_expired_features || "boolean" === typeof input.include_expired_features || $guard(_exceptionable, {
628
+ path: _path + ".include_expired_features",
629
+ expected: "(boolean | undefined)",
630
+ value: input.include_expired_features
631
+ }, _errorFactory)) && (undefined === input.include_latest_version || "boolean" === typeof input.include_latest_version || $guard(_exceptionable, {
632
+ path: _path + ".include_latest_version",
633
+ expected: "(boolean | undefined)",
634
+ value: input.include_latest_version
635
+ }, _errorFactory)) && (undefined === input.include_custom_fields || "boolean" === typeof input.include_custom_fields || $guard(_exceptionable, {
636
+ path: _path + ".include_custom_fields",
637
+ expected: "(boolean | undefined)",
638
+ value: input.include_custom_fields
639
+ }, _errorFactory)); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
640
+ if (false === __is(input)) {
641
+ _errorFactory = errorFactory;
642
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
643
+ path: _path + "",
644
+ expected: "Managed<ProductDetailsPayload>",
645
+ value: input
646
+ }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
647
+ path: _path + "",
648
+ expected: "Managed<ProductDetailsPayload>",
649
+ value: input
650
+ }, _errorFactory))(input, "$input", true);
651
+ }
652
+ return input;
653
+ }; })()(payload);
654
+ const response = yield this.licenseAPI.getProductDetails(Object.assign(Object.assign({}, payload), { product: this.config.productCode }));
655
+ this.licenseFile.licenseDataCache.updateCache('product_details', response);
656
+ this.licenseFile.saveLicenseFile();
657
+ return response;
658
+ });
659
+ }
660
+ ;
661
+ getDeviceVariables(payload) {
662
+ return __awaiter(this, void 0, void 0, function* () {
663
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => (undefined === input.username || "string" === typeof input.username) && (undefined === input.license_key || "string" === typeof input.license_key) && (undefined === input.license_id || "number" === typeof input.license_id) && (undefined === input.bundle_code || "string" === typeof input.bundle_code); const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.username || "string" === typeof input.username || $guard(_exceptionable, {
664
+ path: _path + ".username",
665
+ expected: "(string | undefined)",
666
+ value: input.username
667
+ }, _errorFactory)) && (undefined === input.license_key || "string" === typeof input.license_key || $guard(_exceptionable, {
668
+ path: _path + ".license_key",
669
+ expected: "(string | undefined)",
670
+ value: input.license_key
671
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
672
+ path: _path + ".license_id",
673
+ expected: "(number | undefined)",
674
+ value: input.license_id
675
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
676
+ path: _path + ".bundle_code",
677
+ expected: "(string | undefined)",
678
+ value: input.bundle_code
679
+ }, _errorFactory)); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
680
+ if (false === __is(input)) {
681
+ _errorFactory = errorFactory;
682
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
683
+ path: _path + "",
684
+ expected: "Managed<LicenseIdentificator>",
685
+ value: input
686
+ }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
687
+ path: _path + "",
688
+ expected: "Managed<LicenseIdentificator>",
689
+ value: input
690
+ }, _errorFactory))(input, "$input", true);
691
+ }
692
+ return input;
693
+ }; })()(payload);
694
+ const response = yield this.licenseAPI.getDeviceVariables(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
695
+ this.licenseFile.licenseDataCache.updateCache('device_variables', response);
696
+ this.licenseFile.saveLicenseFile();
697
+ return response;
698
+ });
699
+ }
700
+ ;
701
+ trackDeviceVariables(payload) {
702
+ return __awaiter(this, void 0, void 0, function* () {
703
+ (() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => (undefined === input.username || "string" === typeof input.username) && (undefined === input.license_key || "string" === typeof input.license_key) && (undefined === input.license_id || "number" === typeof input.license_id) && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.variables || "object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) && $io1(input.variables)); const $io1 = input => Object.keys(input).every(key => {
704
+ const value = input[key];
705
+ if (undefined === value)
706
+ return true;
707
+ return "string" === typeof value;
708
+ }); const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.username || "string" === typeof input.username || $guard(_exceptionable, {
709
+ path: _path + ".username",
710
+ expected: "(string | undefined)",
711
+ value: input.username
712
+ }, _errorFactory)) && (undefined === input.license_key || "string" === typeof input.license_key || $guard(_exceptionable, {
713
+ path: _path + ".license_key",
714
+ expected: "(string | undefined)",
715
+ value: input.license_key
716
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
717
+ path: _path + ".license_id",
718
+ expected: "(number | undefined)",
719
+ value: input.license_id
720
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
721
+ path: _path + ".bundle_code",
722
+ expected: "(string | undefined)",
723
+ value: input.bundle_code
724
+ }, _errorFactory)) && (undefined === input.variables || ("object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) || $guard(_exceptionable, {
725
+ path: _path + ".variables",
726
+ expected: "(Dictionary<string> | undefined)",
727
+ value: input.variables
728
+ }, _errorFactory)) && $ao1(input.variables, _path + ".variables", true && _exceptionable) || $guard(_exceptionable, {
729
+ path: _path + ".variables",
730
+ expected: "(Dictionary<string> | undefined)",
731
+ value: input.variables
732
+ }, _errorFactory)); const $ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
733
+ const value = input[key];
734
+ if (undefined === value)
735
+ return true;
736
+ return "string" === typeof value || $guard(_exceptionable, {
737
+ path: _path + $join(key),
738
+ expected: "string",
739
+ value: value
740
+ }, _errorFactory);
741
+ }); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
742
+ if (false === __is(input)) {
743
+ _errorFactory = errorFactory;
744
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
745
+ path: _path + "",
746
+ expected: "Managed<LicenseIdentificatorWithVariables>",
747
+ value: input
748
+ }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
749
+ path: _path + "",
750
+ expected: "Managed<LicenseIdentificatorWithVariables>",
751
+ value: input
752
+ }, _errorFactory))(input, "$input", true);
753
+ }
754
+ return input;
755
+ }; })()(payload);
756
+ const response = yield this.licenseAPI.trackDeviceVariables(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
757
+ this.licenseFile.licenseDataCache.updateCache('device_variables', response);
758
+ this.licenseFile.saveLicenseFile();
759
+ return response;
760
+ });
761
+ }
762
+ ;
763
+ floatingBorrow(payload) {
764
+ return __awaiter(this, void 0, void 0, function* () {
765
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => (undefined === input.username || "string" === typeof input.username) && (undefined === input.license_key || "string" === typeof input.license_key) && "string" === typeof input.borrowed_until && (undefined === input.license_id || "number" === typeof input.license_id) && (undefined === input.bundle_code || "string" === typeof input.bundle_code); const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.username || "string" === typeof input.username || $guard(_exceptionable, {
766
+ path: _path + ".username",
767
+ expected: "(string | undefined)",
768
+ value: input.username
769
+ }, _errorFactory)) && (undefined === input.license_key || "string" === typeof input.license_key || $guard(_exceptionable, {
770
+ path: _path + ".license_key",
771
+ expected: "(string | undefined)",
772
+ value: input.license_key
773
+ }, _errorFactory)) && ("string" === typeof input.borrowed_until || $guard(_exceptionable, {
774
+ path: _path + ".borrowed_until",
775
+ expected: "string",
776
+ value: input.borrowed_until
777
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
778
+ path: _path + ".license_id",
779
+ expected: "(number | undefined)",
780
+ value: input.license_id
781
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
782
+ path: _path + ".bundle_code",
783
+ expected: "(string | undefined)",
784
+ value: input.bundle_code
785
+ }, _errorFactory)); const __is = input => "object" === typeof input && null !== input && $io0(input); let _errorFactory; return (input, errorFactory) => {
786
+ if (false === __is(input)) {
787
+ _errorFactory = errorFactory;
788
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
789
+ path: _path + "",
790
+ expected: "Managed<LicenseIdentificatorWithBorrowedUntil>",
791
+ value: input
792
+ }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
793
+ path: _path + "",
794
+ expected: "Managed<LicenseIdentificatorWithBorrowedUntil>",
795
+ value: input
796
+ }, _errorFactory))(input, "$input", true);
797
+ }
798
+ return input;
799
+ }; })()(payload);
800
+ return yield this.licenseAPI.floatingBorrow(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
801
+ });
802
+ }
803
+ ;
804
+ floatingRelease(payload) {
805
+ return __awaiter(this, void 0, void 0, function* () {
806
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => (undefined === input.username || "string" === typeof input.username) && (undefined === input.license_key || "string" === typeof input.license_key) && (undefined === input.license_id || "number" === typeof input.license_id) && (undefined === input.bundle_code || "string" === typeof input.bundle_code); const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.username || "string" === typeof input.username || $guard(_exceptionable, {
807
+ path: _path + ".username",
808
+ expected: "(string | undefined)",
809
+ value: input.username
810
+ }, _errorFactory)) && (undefined === input.license_key || "string" === typeof input.license_key || $guard(_exceptionable, {
811
+ path: _path + ".license_key",
812
+ expected: "(string | undefined)",
813
+ value: input.license_key
814
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
815
+ path: _path + ".license_id",
816
+ expected: "(number | undefined)",
817
+ value: input.license_id
818
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
819
+ path: _path + ".bundle_code",
820
+ expected: "(string | undefined)",
821
+ value: input.bundle_code
822
+ }, _errorFactory)); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
823
+ if (false === __is(input)) {
824
+ _errorFactory = errorFactory;
825
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
826
+ path: _path + "",
827
+ expected: "Managed<LicenseIdentificator>",
828
+ value: input
829
+ }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
830
+ path: _path + "",
831
+ expected: "Managed<LicenseIdentificator>",
832
+ value: input
833
+ }, _errorFactory))(input, "$input", true);
834
+ }
835
+ return input;
836
+ }; })()(payload);
837
+ return yield this.licenseAPI.floatingRelease(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
838
+ });
839
+ }
840
+ ;
841
+ changePassword(payload) {
842
+ return __awaiter(this, void 0, void 0, function* () {
843
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => "string" === typeof input.username && "string" === typeof input.password && "string" === typeof input.new_password; const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.username || $guard(_exceptionable, {
844
+ path: _path + ".username",
845
+ expected: "string",
846
+ value: input.username
847
+ }, _errorFactory)) && ("string" === typeof input.password || $guard(_exceptionable, {
848
+ path: _path + ".password",
849
+ expected: "string",
850
+ value: input.password
851
+ }, _errorFactory)) && ("string" === typeof input.new_password || $guard(_exceptionable, {
852
+ path: _path + ".new_password",
853
+ expected: "string",
854
+ value: input.new_password
855
+ }, _errorFactory)); const __is = input => "object" === typeof input && null !== input && $io0(input); let _errorFactory; return (input, errorFactory) => {
856
+ if (false === __is(input)) {
857
+ _errorFactory = errorFactory;
858
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
859
+ path: _path + "",
860
+ expected: "PasswordChangePayload",
861
+ value: input
862
+ }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
863
+ path: _path + "",
864
+ expected: "PasswordChangePayload",
865
+ value: input
866
+ }, _errorFactory))(input, "$input", true);
867
+ }
868
+ return input;
869
+ }; })()(payload);
870
+ return yield this.licenseAPI.changePassword(payload);
871
+ });
872
+ }
873
+ ;
874
+ getVersions(payload) {
875
+ return __awaiter(this, void 0, void 0, function* () {
876
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => (undefined === input.username || "string" === typeof input.username) && (undefined === input.license_key || "string" === typeof input.license_key) && (undefined === input.license_id || "number" === typeof input.license_id) && (undefined === input.bundle_code || "string" === typeof input.bundle_code); const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.username || "string" === typeof input.username || $guard(_exceptionable, {
877
+ path: _path + ".username",
878
+ expected: "(string | undefined)",
879
+ value: input.username
880
+ }, _errorFactory)) && (undefined === input.license_key || "string" === typeof input.license_key || $guard(_exceptionable, {
881
+ path: _path + ".license_key",
882
+ expected: "(string | undefined)",
883
+ value: input.license_key
884
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
885
+ path: _path + ".license_id",
886
+ expected: "(number | undefined)",
887
+ value: input.license_id
888
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
889
+ path: _path + ".bundle_code",
890
+ expected: "(string | undefined)",
891
+ value: input.bundle_code
892
+ }, _errorFactory)); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let _errorFactory; return (input, errorFactory) => {
893
+ if (false === __is(input)) {
894
+ _errorFactory = errorFactory;
895
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
896
+ path: _path + "",
897
+ expected: "Managed<LicenseIdentificator>",
898
+ value: input
899
+ }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
900
+ path: _path + "",
901
+ expected: "Managed<LicenseIdentificator>",
902
+ value: input
903
+ }, _errorFactory))(input, "$input", true);
904
+ }
905
+ return input;
906
+ }; })()(payload);
907
+ return yield this.licenseAPI.getVersions(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
908
+ });
909
+ }
910
+ ;
911
+ getInstallationFile(payload) {
912
+ return __awaiter(this, void 0, void 0, function* () {
913
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => "string" === typeof input.channel && (undefined === input.username || "string" === typeof input.username) && "string" === typeof input.env && (undefined === input.license_key || "string" === typeof input.license_key) && "string" === typeof input.version && (undefined === input.license_id || "number" === typeof input.license_id) && (undefined === input.bundle_code || "string" === typeof input.bundle_code); const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.channel || $guard(_exceptionable, {
914
+ path: _path + ".channel",
915
+ expected: "string",
916
+ value: input.channel
917
+ }, _errorFactory)) && (undefined === input.username || "string" === typeof input.username || $guard(_exceptionable, {
918
+ path: _path + ".username",
919
+ expected: "(string | undefined)",
920
+ value: input.username
921
+ }, _errorFactory)) && ("string" === typeof input.env || $guard(_exceptionable, {
922
+ path: _path + ".env",
923
+ expected: "string",
924
+ value: input.env
925
+ }, _errorFactory)) && (undefined === input.license_key || "string" === typeof input.license_key || $guard(_exceptionable, {
926
+ path: _path + ".license_key",
927
+ expected: "(string | undefined)",
928
+ value: input.license_key
929
+ }, _errorFactory)) && ("string" === typeof input.version || $guard(_exceptionable, {
930
+ path: _path + ".version",
931
+ expected: "string",
932
+ value: input.version
933
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
934
+ path: _path + ".license_id",
935
+ expected: "(number | undefined)",
936
+ value: input.license_id
937
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
938
+ path: _path + ".bundle_code",
939
+ expected: "(string | undefined)",
940
+ value: input.bundle_code
941
+ }, _errorFactory)); const __is = input => "object" === typeof input && null !== input && $io0(input); let _errorFactory; return (input, errorFactory) => {
942
+ if (false === __is(input)) {
943
+ _errorFactory = errorFactory;
944
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
945
+ path: _path + "",
946
+ expected: "Managed<LicenseIdentificatorWithInstallation>",
947
+ value: input
948
+ }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
949
+ path: _path + "",
950
+ expected: "Managed<LicenseIdentificatorWithInstallation>",
951
+ value: input
952
+ }, _errorFactory))(input, "$input", true);
953
+ }
954
+ return input;
955
+ }; })()(payload);
956
+ return yield this.licenseAPI.getInstallationFile(Object.assign(Object.assign({}, payload), { product: this.config.productCode, hardware_id: this.getHardwareID() }));
957
+ });
958
+ }
959
+ ;
960
+ getSSOUrl(payload) {
961
+ return __awaiter(this, void 0, void 0, function* () {
962
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => "string" === typeof input.product && ("code" === input.type || "token" === input.type); const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.product || $guard(_exceptionable, {
963
+ path: _path + ".product",
964
+ expected: "string",
965
+ value: input.product
966
+ }, _errorFactory)) && ("code" === input.type || "token" === input.type || $guard(_exceptionable, {
967
+ path: _path + ".type",
968
+ expected: "(\"code\" | \"token\")",
969
+ value: input.type
970
+ }, _errorFactory)); const __is = input => "object" === typeof input && null !== input && $io0(input); let _errorFactory; return (input, errorFactory) => {
971
+ if (false === __is(input)) {
972
+ _errorFactory = errorFactory;
973
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
974
+ path: _path + "",
975
+ expected: "SSOURLParams",
976
+ value: input
977
+ }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
978
+ path: _path + "",
979
+ expected: "SSOURLParams",
980
+ value: input
981
+ }, _errorFactory))(input, "$input", true);
982
+ }
983
+ return input;
984
+ }; })()(payload);
985
+ return yield this.licenseAPI.getSSOUrl(payload);
986
+ });
987
+ }
988
+ ;
989
+ getAirGapActivationCode(initializationCode, licenseKey) {
990
+ const response = this.licenseAPI.getAirGapActivationCode(initializationCode, licenseKey);
991
+ const guardFile = this.licenseAPI.createActivationGuard(licenseKey);
992
+ this.licenseFile.saveGuardFile(guardFile);
993
+ return response;
994
+ }
995
+ activateAirGapLicense(confirmationCode, licenseKey, policyFilePath, policyID) {
996
+ if (!this.licenseAPI.verifyConfirmationCode(confirmationCode, licenseKey, policyID)) {
997
+ throw { status: 400, code: 'air_gap_activation_error', message: 'Air gap activation error: incorrect confirmation code' };
998
+ }
999
+ if (!policyFilePath || !fs.existsSync(policyFilePath)) {
1000
+ throw { status: 400, code: 'policy_file_not_found', message: 'Incorrect policyFilePath' };
1001
+ }
1002
+ const policyFileData = this.licenseFile.loadOfflineResponse(policyFilePath);
1003
+ const response = this.licenseAPI.activateAirgappedLicense(policyFileData, licenseKey, policyID);
1004
+ this.licenseFile.licenseDataCache.fromJSON(response);
1005
+ const license = new license_1.default(this.config.productCode, this.licenseAPI, this.licenseFile, this.floatingAPI);
1006
+ return license;
1007
+ }
1008
+ }
1009
+ exports.default = LicenseManager;
1010
+ //# sourceMappingURL=license-manager.js.map