@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,2533 @@
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 common_1 = require("./common");
39
+ const service_1 = __importDefault(require("./service"));
40
+ const hwid_1 = require("../hwid");
41
+ const typia_1 = __importDefault(require("typia"));
42
+ const version_1 = __importDefault(require("./version"));
43
+ const elliptic = __importStar(require("elliptic"));
44
+ const crypto = __importStar(require("node:crypto"));
45
+ const dayjs_1 = __importDefault(require("dayjs"));
46
+ const utc_js_1 = __importDefault(require("dayjs/plugin/utc.js"));
47
+ const path = __importStar(require("node:path"));
48
+ const hash_js_1 = require("hash.js");
49
+ dayjs_1.default.extend(utc_js_1.default);
50
+ const dotenv = __importStar(require("dotenv"));
51
+ dotenv.config({ path: path.join(__dirname, `../.env.${process.env.NODE_ENV || 'prod'}`) });
52
+ class LicenseAPI {
53
+ constructor(config) {
54
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
55
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => "string" === typeof input.apiKey && "string" === typeof input.sharedKey && "string" === typeof input.appName && "string" === typeof input.appVersion && (undefined === input.airGapKey || "string" === typeof input.airGapKey) && (undefined === input.apiPath || "string" === typeof input.apiPath) && (undefined === input.publicKey || "string" === typeof input.publicKey) && (undefined === input.filename || "string" === typeof input.filename) && (undefined === input.filePath || "string" === typeof input.filePath) && (undefined === input.gracePeriod || "number" === typeof input.gracePeriod) && (undefined === input.fileKey || "string" === typeof input.fileKey) && (undefined === input.isGuardFileEnabled || "boolean" === typeof input.isGuardFileEnabled) && (undefined === input.hardwareIDMethod || "number" === typeof input.hardwareIDMethod); const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.apiKey || $guard(_exceptionable, {
56
+ path: _path + ".apiKey",
57
+ expected: "string",
58
+ value: input.apiKey
59
+ }, _errorFactory)) && ("string" === typeof input.sharedKey || $guard(_exceptionable, {
60
+ path: _path + ".sharedKey",
61
+ expected: "string",
62
+ value: input.sharedKey
63
+ }, _errorFactory)) && ("string" === typeof input.appName || $guard(_exceptionable, {
64
+ path: _path + ".appName",
65
+ expected: "string",
66
+ value: input.appName
67
+ }, _errorFactory)) && ("string" === typeof input.appVersion || $guard(_exceptionable, {
68
+ path: _path + ".appVersion",
69
+ expected: "string",
70
+ value: input.appVersion
71
+ }, _errorFactory)) && (undefined === input.airGapKey || "string" === typeof input.airGapKey || $guard(_exceptionable, {
72
+ path: _path + ".airGapKey",
73
+ expected: "(string | undefined)",
74
+ value: input.airGapKey
75
+ }, _errorFactory)) && (undefined === input.apiPath || "string" === typeof input.apiPath || $guard(_exceptionable, {
76
+ path: _path + ".apiPath",
77
+ expected: "(string | undefined)",
78
+ value: input.apiPath
79
+ }, _errorFactory)) && (undefined === input.publicKey || "string" === typeof input.publicKey || $guard(_exceptionable, {
80
+ path: _path + ".publicKey",
81
+ expected: "(string | undefined)",
82
+ value: input.publicKey
83
+ }, _errorFactory)) && (undefined === input.filename || "string" === typeof input.filename || $guard(_exceptionable, {
84
+ path: _path + ".filename",
85
+ expected: "(string | undefined)",
86
+ value: input.filename
87
+ }, _errorFactory)) && (undefined === input.filePath || "string" === typeof input.filePath || $guard(_exceptionable, {
88
+ path: _path + ".filePath",
89
+ expected: "(string | undefined)",
90
+ value: input.filePath
91
+ }, _errorFactory)) && (undefined === input.gracePeriod || "number" === typeof input.gracePeriod || $guard(_exceptionable, {
92
+ path: _path + ".gracePeriod",
93
+ expected: "(number | undefined)",
94
+ value: input.gracePeriod
95
+ }, _errorFactory)) && (undefined === input.fileKey || "string" === typeof input.fileKey || $guard(_exceptionable, {
96
+ path: _path + ".fileKey",
97
+ expected: "(string | undefined)",
98
+ value: input.fileKey
99
+ }, _errorFactory)) && (undefined === input.isGuardFileEnabled || "boolean" === typeof input.isGuardFileEnabled || $guard(_exceptionable, {
100
+ path: _path + ".isGuardFileEnabled",
101
+ expected: "(boolean | undefined)",
102
+ value: input.isGuardFileEnabled
103
+ }, _errorFactory)) && (undefined === input.hardwareIDMethod || "number" === typeof input.hardwareIDMethod || $guard(_exceptionable, {
104
+ path: _path + ".hardwareIDMethod",
105
+ expected: "(number | undefined)",
106
+ value: input.hardwareIDMethod
107
+ }, _errorFactory)); const __is = input => "object" === typeof input && null !== 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 || $guard(true, {
111
+ path: _path + "",
112
+ expected: "LicensespringAPIConfigDef",
113
+ value: input
114
+ }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
115
+ path: _path + "",
116
+ expected: "LicensespringAPIConfigDef",
117
+ value: input
118
+ }, _errorFactory))(input, "$input", true);
119
+ }
120
+ return input;
121
+ }; })()(config);
122
+ const _config = Object.assign(Object.assign({}, config), { apiPath: (_a = config.apiPath) !== null && _a !== void 0 ? _a : process.env.API_PATH, publicKey: (_b = config.publicKey) !== null && _b !== void 0 ? _b : process.env.PUBLIC_KEY, filename: (_c = config.filename) !== null && _c !== void 0 ? _c : process.env.FILENAME, filePath: (_d = config.filePath) !== null && _d !== void 0 ? _d : process.env.FILE_PATH, gracePeriod: (_e = config.gracePeriod) !== null && _e !== void 0 ? _e : 24, fileKey: (_f = config.fileKey) !== null && _f !== void 0 ? _f : process.env.LICENSE_FILE_KEY, isGuardFileEnabled: (_h = (_g = config.isGuardFileEnabled) !== null && _g !== void 0 ? _g : !!process.env.GUARD_FILE_ENABLED) !== null && _h !== void 0 ? _h : false, hardwareIDMethod: (_j = config.hardwareIDMethod) !== null && _j !== void 0 ? _j : 0, airGapKey: (_k = config.airGapKey) !== null && _k !== void 0 ? _k : process.env.AIR_GAP_KEY, sdkVersion: version_1.default });
123
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => "string" === typeof input.filename && "string" === typeof input.apiKey && "string" === typeof input.sharedKey && "string" === typeof input.apiPath && "string" === typeof input.publicKey && "string" === typeof input.appName && "string" === typeof input.appVersion && "string" === typeof input.filePath && "number" === typeof input.gracePeriod && "string" === typeof input.fileKey && (undefined === input.airGapKey || "string" === typeof input.airGapKey) && "boolean" === typeof input.isGuardFileEnabled && "number" === typeof input.hardwareIDMethod && "string" === typeof input.sdkVersion; const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.filename || $guard(_exceptionable, {
124
+ path: _path + ".filename",
125
+ expected: "string",
126
+ value: input.filename
127
+ }, _errorFactory)) && ("string" === typeof input.apiKey || $guard(_exceptionable, {
128
+ path: _path + ".apiKey",
129
+ expected: "string",
130
+ value: input.apiKey
131
+ }, _errorFactory)) && ("string" === typeof input.sharedKey || $guard(_exceptionable, {
132
+ path: _path + ".sharedKey",
133
+ expected: "string",
134
+ value: input.sharedKey
135
+ }, _errorFactory)) && ("string" === typeof input.apiPath || $guard(_exceptionable, {
136
+ path: _path + ".apiPath",
137
+ expected: "string",
138
+ value: input.apiPath
139
+ }, _errorFactory)) && ("string" === typeof input.publicKey || $guard(_exceptionable, {
140
+ path: _path + ".publicKey",
141
+ expected: "string",
142
+ value: input.publicKey
143
+ }, _errorFactory)) && ("string" === typeof input.appName || $guard(_exceptionable, {
144
+ path: _path + ".appName",
145
+ expected: "string",
146
+ value: input.appName
147
+ }, _errorFactory)) && ("string" === typeof input.appVersion || $guard(_exceptionable, {
148
+ path: _path + ".appVersion",
149
+ expected: "string",
150
+ value: input.appVersion
151
+ }, _errorFactory)) && ("string" === typeof input.filePath || $guard(_exceptionable, {
152
+ path: _path + ".filePath",
153
+ expected: "string",
154
+ value: input.filePath
155
+ }, _errorFactory)) && ("number" === typeof input.gracePeriod || $guard(_exceptionable, {
156
+ path: _path + ".gracePeriod",
157
+ expected: "number",
158
+ value: input.gracePeriod
159
+ }, _errorFactory)) && ("string" === typeof input.fileKey || $guard(_exceptionable, {
160
+ path: _path + ".fileKey",
161
+ expected: "string",
162
+ value: input.fileKey
163
+ }, _errorFactory)) && (undefined === input.airGapKey || "string" === typeof input.airGapKey || $guard(_exceptionable, {
164
+ path: _path + ".airGapKey",
165
+ expected: "(string | undefined)",
166
+ value: input.airGapKey
167
+ }, _errorFactory)) && ("boolean" === typeof input.isGuardFileEnabled || $guard(_exceptionable, {
168
+ path: _path + ".isGuardFileEnabled",
169
+ expected: "boolean",
170
+ value: input.isGuardFileEnabled
171
+ }, _errorFactory)) && ("number" === typeof input.hardwareIDMethod || $guard(_exceptionable, {
172
+ path: _path + ".hardwareIDMethod",
173
+ expected: "number",
174
+ value: input.hardwareIDMethod
175
+ }, _errorFactory)) && ("string" === typeof input.sdkVersion || $guard(_exceptionable, {
176
+ path: _path + ".sdkVersion",
177
+ expected: "string",
178
+ value: input.sdkVersion
179
+ }, _errorFactory)); const __is = input => "object" === typeof input && null !== input && $io0(input); let _errorFactory; return (input, errorFactory) => {
180
+ if (false === __is(input)) {
181
+ _errorFactory = errorFactory;
182
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
183
+ path: _path + "",
184
+ expected: "LicensespringAPIConfig",
185
+ value: input
186
+ }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
187
+ path: _path + "",
188
+ expected: "LicensespringAPIConfig",
189
+ value: input
190
+ }, _errorFactory))(input, "$input", true);
191
+ }
192
+ return input;
193
+ }; })()(_config);
194
+ this.config = _config;
195
+ this.service = new service_1.default(this.config);
196
+ }
197
+ getHardwareID(algorithm) {
198
+ var _a;
199
+ if (algorithm === void 0) { algorithm = (_a = this.config.hardwareIDMethod) !== null && _a !== void 0 ? _a : 0; }
200
+ return String((0, hwid_1.getHardwareId)(algorithm));
201
+ }
202
+ checkLicense(payload_1) {
203
+ return __awaiter(this, arguments, void 0, function* (payload, includeExpiredFeatures = false) {
204
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => null !== input.username && undefined === input.username && "string" === typeof input.license_key && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id); const $io1 = input => null !== input.license_key && undefined === input.license_key && "string" === typeof input.username && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id); const $iu0 = input => (() => {
205
+ if ("string" === typeof input.username)
206
+ return $io1(input);
207
+ else if ("string" === typeof input.license_key)
208
+ return $io0(input);
209
+ else
210
+ return false;
211
+ })(); const $ao0 = (input, _path, _exceptionable = true) => (null !== input.username || $guard(_exceptionable, {
212
+ path: _path + ".username",
213
+ expected: "undefined",
214
+ value: input.username
215
+ }, _errorFactory)) && (undefined === input.username || $guard(_exceptionable, {
216
+ path: _path + ".username",
217
+ expected: "undefined",
218
+ value: input.username
219
+ }, _errorFactory)) && ("string" === typeof input.license_key || $guard(_exceptionable, {
220
+ path: _path + ".license_key",
221
+ expected: "string",
222
+ value: input.license_key
223
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
224
+ path: _path + ".hardware_id",
225
+ expected: "string",
226
+ value: input.hardware_id
227
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
228
+ path: _path + ".product",
229
+ expected: "string",
230
+ value: input.product
231
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
232
+ path: _path + ".bundle_code",
233
+ expected: "(string | undefined)",
234
+ value: input.bundle_code
235
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
236
+ path: _path + ".license_id",
237
+ expected: "(number | undefined)",
238
+ value: input.license_id
239
+ }, _errorFactory)); const $ao1 = (input, _path, _exceptionable = true) => (null !== input.license_key || $guard(_exceptionable, {
240
+ path: _path + ".license_key",
241
+ expected: "undefined",
242
+ value: input.license_key
243
+ }, _errorFactory)) && (undefined === input.license_key || $guard(_exceptionable, {
244
+ path: _path + ".license_key",
245
+ expected: "undefined",
246
+ value: input.license_key
247
+ }, _errorFactory)) && ("string" === typeof input.username || $guard(_exceptionable, {
248
+ path: _path + ".username",
249
+ expected: "string",
250
+ value: input.username
251
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
252
+ path: _path + ".hardware_id",
253
+ expected: "string",
254
+ value: input.hardware_id
255
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
256
+ path: _path + ".product",
257
+ expected: "string",
258
+ value: input.product
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.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
264
+ path: _path + ".license_id",
265
+ expected: "(number | undefined)",
266
+ value: input.license_id
267
+ }, _errorFactory)); const $au0 = (input, _path, _exceptionable = true) => (() => {
268
+ if ("string" === typeof input.username)
269
+ return $ao1(input, _path, true && _exceptionable);
270
+ else if ("string" === typeof input.license_key)
271
+ return $ao0(input, _path, true && _exceptionable);
272
+ else
273
+ return $guard(_exceptionable, {
274
+ path: _path,
275
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired)",
276
+ value: input
277
+ }, _errorFactory);
278
+ })(); const __is = input => "object" === typeof input && null !== input && $iu0(input); let _errorFactory; return (input, errorFactory) => {
279
+ if (false === __is(input)) {
280
+ _errorFactory = errorFactory;
281
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
282
+ path: _path + "",
283
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired)",
284
+ value: input
285
+ }, _errorFactory)) && $au0(input, _path + "", true) || $guard(true, {
286
+ path: _path + "",
287
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired)",
288
+ value: input
289
+ }, _errorFactory))(input, "$input", true);
290
+ }
291
+ return input;
292
+ }; })()(payload);
293
+ const { headers, response } = yield this.service.getRequest('check_license', Object.assign(Object.assign({}, payload), { include_expired_features: includeExpiredFeatures }));
294
+ (0, common_1.checkSignatureV1)(this.config.publicKey, response, payload);
295
+ (0, common_1.checkSignatureV2)(this.config.publicKey, response, (0, common_1.getHeaderString)(headers, 'LicenseSignature'));
296
+ return response;
297
+ });
298
+ }
299
+ ;
300
+ activateLicense(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 => null !== input.username && undefined === input.username && (null !== input.password && undefined === input.password) && (null !== input.customer_account_code && undefined === input.customer_account_code) && "string" === typeof input.license_key && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id) && (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 => {
303
+ const value = input[key];
304
+ if (undefined === value)
305
+ return true;
306
+ return "string" === typeof value;
307
+ }); const $io2 = input => null !== input.customer_account_code && undefined === input.customer_account_code && (null !== input.license_key && undefined === input.license_key) && "string" === typeof input.username && "string" === typeof input.password && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id) && (undefined === input.variables || "object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) && $io1(input.variables)); const $io3 = input => null !== input.username && undefined === input.username && (null !== input.password && undefined === input.password) && (null !== input.license_key && undefined === input.license_key) && "string" === typeof input.id_token && "string" === typeof input.customer_account_code && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id) && (undefined === input.variables || "object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) && $io1(input.variables)); const $io4 = input => null !== input.username && undefined === input.username && (null !== input.password && undefined === input.password) && (null !== input.license_key && undefined === input.license_key) && "string" === typeof input.code && "string" === typeof input.customer_account_code && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id) && (undefined === input.variables || "object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) && $io1(input.variables)); const $iu0 = input => (() => {
308
+ if ("string" === typeof input.username)
309
+ return $io2(input);
310
+ else if ("string" === typeof input.license_key)
311
+ return $io0(input);
312
+ else if (undefined !== input.id_token)
313
+ return $io3(input);
314
+ else if (undefined !== input.code)
315
+ return $io4(input);
316
+ else
317
+ return false;
318
+ })(); const $ao0 = (input, _path, _exceptionable = true) => (null !== input.username || $guard(_exceptionable, {
319
+ path: _path + ".username",
320
+ expected: "undefined",
321
+ value: input.username
322
+ }, _errorFactory)) && (undefined === input.username || $guard(_exceptionable, {
323
+ path: _path + ".username",
324
+ expected: "undefined",
325
+ value: input.username
326
+ }, _errorFactory)) && ((null !== input.password || $guard(_exceptionable, {
327
+ path: _path + ".password",
328
+ expected: "undefined",
329
+ value: input.password
330
+ }, _errorFactory)) && (undefined === input.password || $guard(_exceptionable, {
331
+ path: _path + ".password",
332
+ expected: "undefined",
333
+ value: input.password
334
+ }, _errorFactory))) && ((null !== input.customer_account_code || $guard(_exceptionable, {
335
+ path: _path + ".customer_account_code",
336
+ expected: "undefined",
337
+ value: input.customer_account_code
338
+ }, _errorFactory)) && (undefined === input.customer_account_code || $guard(_exceptionable, {
339
+ path: _path + ".customer_account_code",
340
+ expected: "undefined",
341
+ value: input.customer_account_code
342
+ }, _errorFactory))) && ("string" === typeof input.license_key || $guard(_exceptionable, {
343
+ path: _path + ".license_key",
344
+ expected: "string",
345
+ value: input.license_key
346
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
347
+ path: _path + ".hardware_id",
348
+ expected: "string",
349
+ value: input.hardware_id
350
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
351
+ path: _path + ".product",
352
+ expected: "string",
353
+ value: input.product
354
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
355
+ path: _path + ".bundle_code",
356
+ expected: "(string | undefined)",
357
+ value: input.bundle_code
358
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
359
+ path: _path + ".license_id",
360
+ expected: "(number | undefined)",
361
+ value: input.license_id
362
+ }, _errorFactory)) && (undefined === input.variables || ("object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) || $guard(_exceptionable, {
363
+ path: _path + ".variables",
364
+ expected: "(Dictionary<string> | undefined)",
365
+ value: input.variables
366
+ }, _errorFactory)) && $ao1(input.variables, _path + ".variables", true && _exceptionable) || $guard(_exceptionable, {
367
+ path: _path + ".variables",
368
+ expected: "(Dictionary<string> | undefined)",
369
+ value: input.variables
370
+ }, _errorFactory)); const $ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
371
+ const value = input[key];
372
+ if (undefined === value)
373
+ return true;
374
+ return "string" === typeof value || $guard(_exceptionable, {
375
+ path: _path + $join(key),
376
+ expected: "string",
377
+ value: value
378
+ }, _errorFactory);
379
+ }); const $ao2 = (input, _path, _exceptionable = true) => (null !== input.customer_account_code || $guard(_exceptionable, {
380
+ path: _path + ".customer_account_code",
381
+ expected: "undefined",
382
+ value: input.customer_account_code
383
+ }, _errorFactory)) && (undefined === input.customer_account_code || $guard(_exceptionable, {
384
+ path: _path + ".customer_account_code",
385
+ expected: "undefined",
386
+ value: input.customer_account_code
387
+ }, _errorFactory)) && ((null !== input.license_key || $guard(_exceptionable, {
388
+ path: _path + ".license_key",
389
+ expected: "undefined",
390
+ value: input.license_key
391
+ }, _errorFactory)) && (undefined === input.license_key || $guard(_exceptionable, {
392
+ path: _path + ".license_key",
393
+ expected: "undefined",
394
+ value: input.license_key
395
+ }, _errorFactory))) && ("string" === typeof input.username || $guard(_exceptionable, {
396
+ path: _path + ".username",
397
+ expected: "string",
398
+ value: input.username
399
+ }, _errorFactory)) && ("string" === typeof input.password || $guard(_exceptionable, {
400
+ path: _path + ".password",
401
+ expected: "string",
402
+ value: input.password
403
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
404
+ path: _path + ".hardware_id",
405
+ expected: "string",
406
+ value: input.hardware_id
407
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
408
+ path: _path + ".product",
409
+ expected: "string",
410
+ value: input.product
411
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
412
+ path: _path + ".bundle_code",
413
+ expected: "(string | undefined)",
414
+ value: input.bundle_code
415
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
416
+ path: _path + ".license_id",
417
+ expected: "(number | undefined)",
418
+ value: input.license_id
419
+ }, _errorFactory)) && (undefined === input.variables || ("object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) || $guard(_exceptionable, {
420
+ path: _path + ".variables",
421
+ expected: "(Dictionary<string> | undefined)",
422
+ value: input.variables
423
+ }, _errorFactory)) && $ao1(input.variables, _path + ".variables", true && _exceptionable) || $guard(_exceptionable, {
424
+ path: _path + ".variables",
425
+ expected: "(Dictionary<string> | undefined)",
426
+ value: input.variables
427
+ }, _errorFactory)); const $ao3 = (input, _path, _exceptionable = true) => (null !== input.username || $guard(_exceptionable, {
428
+ path: _path + ".username",
429
+ expected: "undefined",
430
+ value: input.username
431
+ }, _errorFactory)) && (undefined === input.username || $guard(_exceptionable, {
432
+ path: _path + ".username",
433
+ expected: "undefined",
434
+ value: input.username
435
+ }, _errorFactory)) && ((null !== input.password || $guard(_exceptionable, {
436
+ path: _path + ".password",
437
+ expected: "undefined",
438
+ value: input.password
439
+ }, _errorFactory)) && (undefined === input.password || $guard(_exceptionable, {
440
+ path: _path + ".password",
441
+ expected: "undefined",
442
+ value: input.password
443
+ }, _errorFactory))) && ((null !== input.license_key || $guard(_exceptionable, {
444
+ path: _path + ".license_key",
445
+ expected: "undefined",
446
+ value: input.license_key
447
+ }, _errorFactory)) && (undefined === input.license_key || $guard(_exceptionable, {
448
+ path: _path + ".license_key",
449
+ expected: "undefined",
450
+ value: input.license_key
451
+ }, _errorFactory))) && ("string" === typeof input.id_token || $guard(_exceptionable, {
452
+ path: _path + ".id_token",
453
+ expected: "string",
454
+ value: input.id_token
455
+ }, _errorFactory)) && ("string" === typeof input.customer_account_code || $guard(_exceptionable, {
456
+ path: _path + ".customer_account_code",
457
+ expected: "string",
458
+ value: input.customer_account_code
459
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
460
+ path: _path + ".hardware_id",
461
+ expected: "string",
462
+ value: input.hardware_id
463
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
464
+ path: _path + ".product",
465
+ expected: "string",
466
+ value: input.product
467
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
468
+ path: _path + ".bundle_code",
469
+ expected: "(string | undefined)",
470
+ value: input.bundle_code
471
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
472
+ path: _path + ".license_id",
473
+ expected: "(number | undefined)",
474
+ value: input.license_id
475
+ }, _errorFactory)) && (undefined === input.variables || ("object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) || $guard(_exceptionable, {
476
+ path: _path + ".variables",
477
+ expected: "(Dictionary<string> | undefined)",
478
+ value: input.variables
479
+ }, _errorFactory)) && $ao1(input.variables, _path + ".variables", true && _exceptionable) || $guard(_exceptionable, {
480
+ path: _path + ".variables",
481
+ expected: "(Dictionary<string> | undefined)",
482
+ value: input.variables
483
+ }, _errorFactory)); const $ao4 = (input, _path, _exceptionable = true) => (null !== input.username || $guard(_exceptionable, {
484
+ path: _path + ".username",
485
+ expected: "undefined",
486
+ value: input.username
487
+ }, _errorFactory)) && (undefined === input.username || $guard(_exceptionable, {
488
+ path: _path + ".username",
489
+ expected: "undefined",
490
+ value: input.username
491
+ }, _errorFactory)) && ((null !== input.password || $guard(_exceptionable, {
492
+ path: _path + ".password",
493
+ expected: "undefined",
494
+ value: input.password
495
+ }, _errorFactory)) && (undefined === input.password || $guard(_exceptionable, {
496
+ path: _path + ".password",
497
+ expected: "undefined",
498
+ value: input.password
499
+ }, _errorFactory))) && ((null !== input.license_key || $guard(_exceptionable, {
500
+ path: _path + ".license_key",
501
+ expected: "undefined",
502
+ value: input.license_key
503
+ }, _errorFactory)) && (undefined === input.license_key || $guard(_exceptionable, {
504
+ path: _path + ".license_key",
505
+ expected: "undefined",
506
+ value: input.license_key
507
+ }, _errorFactory))) && ("string" === typeof input.code || $guard(_exceptionable, {
508
+ path: _path + ".code",
509
+ expected: "string",
510
+ value: input.code
511
+ }, _errorFactory)) && ("string" === typeof input.customer_account_code || $guard(_exceptionable, {
512
+ path: _path + ".customer_account_code",
513
+ expected: "string",
514
+ value: input.customer_account_code
515
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
516
+ path: _path + ".hardware_id",
517
+ expected: "string",
518
+ value: input.hardware_id
519
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
520
+ path: _path + ".product",
521
+ expected: "string",
522
+ value: input.product
523
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
524
+ path: _path + ".bundle_code",
525
+ expected: "(string | undefined)",
526
+ value: input.bundle_code
527
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
528
+ path: _path + ".license_id",
529
+ expected: "(number | undefined)",
530
+ value: input.license_id
531
+ }, _errorFactory)) && (undefined === input.variables || ("object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) || $guard(_exceptionable, {
532
+ path: _path + ".variables",
533
+ expected: "(Dictionary<string> | undefined)",
534
+ value: input.variables
535
+ }, _errorFactory)) && $ao1(input.variables, _path + ".variables", true && _exceptionable) || $guard(_exceptionable, {
536
+ path: _path + ".variables",
537
+ expected: "(Dictionary<string> | undefined)",
538
+ value: input.variables
539
+ }, _errorFactory)); const $au0 = (input, _path, _exceptionable = true) => (() => {
540
+ if ("string" === typeof input.username)
541
+ return $ao2(input, _path, true && _exceptionable);
542
+ else if ("string" === typeof input.license_key)
543
+ return $ao0(input, _path, true && _exceptionable);
544
+ else if (undefined !== input.id_token)
545
+ return $ao3(input, _path, true && _exceptionable);
546
+ else if (undefined !== input.code)
547
+ return $ao4(input, _path, true && _exceptionable);
548
+ else
549
+ return $guard(_exceptionable, {
550
+ path: _path,
551
+ expected: "({ customer_account_code?: undefined; license_key?: undefined; username: string; password: string; } & LicenseIdentificatiorRequired & { variables?: Dictionary<...> | undefined; } | { username?: undefined; password?: undefined; customer_account_code?: undefined; license_key: string; } & LicenseIdentificatiorRequired & { variables?: Dictionary<...> | undefined; } | { username?: undefined; password?: undefined; license_key?: undefined; id_token: string; customer_account_code: string; } & LicenseIdentificatiorRequired & { ...; } | { username?: undefined; password?: undefined; license_key?: undefined; code: string; customer_account_code: string; } & LicenseIdentificatiorRequired & { ...; })",
552
+ value: input
553
+ }, _errorFactory);
554
+ })(); const __is = input => "object" === typeof input && null !== input && $iu0(input); let _errorFactory; return (input, errorFactory) => {
555
+ if (false === __is(input)) {
556
+ _errorFactory = errorFactory;
557
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
558
+ path: _path + "",
559
+ expected: "({ customer_account_code?: undefined; license_key?: undefined; username: string; password: string; } & LicenseIdentificatiorRequired & { variables?: Dictionary<...> | undefined; } | { username?: undefined; password?: undefined; customer_account_code?: undefined; license_key: string; } & LicenseIdentificatiorRequired & { variables?: Dictionary<...> | undefined; } | { username?: undefined; password?: undefined; license_key?: undefined; code: string; customer_account_code: string; } & LicenseIdentificatiorRequired & { ...; } | { username?: undefined; password?: undefined; license_key?: undefined; id_token: string; customer_account_code: string; } & LicenseIdentificatiorRequired & { ...; })",
560
+ value: input
561
+ }, _errorFactory)) && $au0(input, _path + "", true) || $guard(true, {
562
+ path: _path + "",
563
+ expected: "({ customer_account_code?: undefined; license_key?: undefined; username: string; password: string; } & LicenseIdentificatiorRequired & { variables?: Dictionary<...> | undefined; } | { username?: undefined; password?: undefined; customer_account_code?: undefined; license_key: string; } & LicenseIdentificatiorRequired & { variables?: Dictionary<...> | undefined; } | { username?: undefined; password?: undefined; license_key?: undefined; code: string; customer_account_code: string; } & LicenseIdentificatiorRequired & { ...; } | { username?: undefined; password?: undefined; license_key?: undefined; id_token: string; customer_account_code: string; } & LicenseIdentificatiorRequired & { ...; })",
564
+ value: input
565
+ }, _errorFactory))(input, "$input", true);
566
+ }
567
+ return input;
568
+ }; })()(payload);
569
+ const { headers, response } = yield this.service.postRequest('activate_license', payload);
570
+ (0, common_1.checkSignatureV1)(this.config.publicKey, response, payload);
571
+ (0, common_1.checkSignatureV2)(this.config.publicKey, response, (0, common_1.getHeaderString)(headers, 'LicenseSignature'));
572
+ return response;
573
+ });
574
+ }
575
+ ;
576
+ deactivateLicense(payload) {
577
+ return __awaiter(this, void 0, void 0, function* () {
578
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => null !== input.username && undefined === input.username && "string" === typeof input.license_key && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id); const $io1 = input => null !== input.license_key && undefined === input.license_key && "string" === typeof input.username && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id); const $iu0 = input => (() => {
579
+ if ("string" === typeof input.username)
580
+ return $io1(input);
581
+ else if ("string" === typeof input.license_key)
582
+ return $io0(input);
583
+ else
584
+ return false;
585
+ })(); const $ao0 = (input, _path, _exceptionable = true) => (null !== input.username || $guard(_exceptionable, {
586
+ path: _path + ".username",
587
+ expected: "undefined",
588
+ value: input.username
589
+ }, _errorFactory)) && (undefined === input.username || $guard(_exceptionable, {
590
+ path: _path + ".username",
591
+ expected: "undefined",
592
+ value: input.username
593
+ }, _errorFactory)) && ("string" === typeof input.license_key || $guard(_exceptionable, {
594
+ path: _path + ".license_key",
595
+ expected: "string",
596
+ value: input.license_key
597
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
598
+ path: _path + ".hardware_id",
599
+ expected: "string",
600
+ value: input.hardware_id
601
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
602
+ path: _path + ".product",
603
+ expected: "string",
604
+ value: input.product
605
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
606
+ path: _path + ".bundle_code",
607
+ expected: "(string | undefined)",
608
+ value: input.bundle_code
609
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
610
+ path: _path + ".license_id",
611
+ expected: "(number | undefined)",
612
+ value: input.license_id
613
+ }, _errorFactory)); const $ao1 = (input, _path, _exceptionable = true) => (null !== input.license_key || $guard(_exceptionable, {
614
+ path: _path + ".license_key",
615
+ expected: "undefined",
616
+ value: input.license_key
617
+ }, _errorFactory)) && (undefined === input.license_key || $guard(_exceptionable, {
618
+ path: _path + ".license_key",
619
+ expected: "undefined",
620
+ value: input.license_key
621
+ }, _errorFactory)) && ("string" === typeof input.username || $guard(_exceptionable, {
622
+ path: _path + ".username",
623
+ expected: "string",
624
+ value: input.username
625
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
626
+ path: _path + ".hardware_id",
627
+ expected: "string",
628
+ value: input.hardware_id
629
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
630
+ path: _path + ".product",
631
+ expected: "string",
632
+ value: input.product
633
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
634
+ path: _path + ".bundle_code",
635
+ expected: "(string | undefined)",
636
+ value: input.bundle_code
637
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
638
+ path: _path + ".license_id",
639
+ expected: "(number | undefined)",
640
+ value: input.license_id
641
+ }, _errorFactory)); const $au0 = (input, _path, _exceptionable = true) => (() => {
642
+ if ("string" === typeof input.username)
643
+ return $ao1(input, _path, true && _exceptionable);
644
+ else if ("string" === typeof input.license_key)
645
+ return $ao0(input, _path, true && _exceptionable);
646
+ else
647
+ return $guard(_exceptionable, {
648
+ path: _path,
649
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired)",
650
+ value: input
651
+ }, _errorFactory);
652
+ })(); const __is = input => "object" === typeof input && null !== input && $iu0(input); let _errorFactory; return (input, errorFactory) => {
653
+ if (false === __is(input)) {
654
+ _errorFactory = errorFactory;
655
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
656
+ path: _path + "",
657
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired)",
658
+ value: input
659
+ }, _errorFactory)) && $au0(input, _path + "", true) || $guard(true, {
660
+ path: _path + "",
661
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired)",
662
+ value: input
663
+ }, _errorFactory))(input, "$input", true);
664
+ }
665
+ return input;
666
+ }; })()(payload);
667
+ const { response } = yield this.service.postRequest('deactivate_license', payload);
668
+ return (0, common_1.assertResponseString)(response, 'license_deactivated');
669
+ });
670
+ }
671
+ ;
672
+ activateOffline(payload) {
673
+ return __awaiter(this, void 0, void 0, function* () {
674
+ (() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => null !== input.username && undefined === input.username && (null !== input.password && undefined === input.password) && (null !== input.customer_account_code && undefined === input.customer_account_code) && "string" === typeof input.license_key && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id) && (undefined === input.prefix || "string" === typeof input.prefix) && (undefined === input.os_ver || "string" === typeof input.os_ver) && (undefined === input.sdk_build_version || "string" === typeof input.sdk_build_version) && (undefined === input.hostname || "string" === typeof input.hostname) && (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) && (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 => {
675
+ const value = input[key];
676
+ if (undefined === value)
677
+ return true;
678
+ return "string" === typeof value;
679
+ }); const $io2 = input => null !== input.customer_account_code && undefined === input.customer_account_code && (null !== input.license_key && undefined === input.license_key) && "string" === typeof input.username && "string" === typeof input.password && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id) && (undefined === input.prefix || "string" === typeof input.prefix) && (undefined === input.os_ver || "string" === typeof input.os_ver) && (undefined === input.sdk_build_version || "string" === typeof input.sdk_build_version) && (undefined === input.hostname || "string" === typeof input.hostname) && (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) && (undefined === input.variables || "object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) && $io1(input.variables)); const $io3 = input => null !== input.username && undefined === input.username && (null !== input.password && undefined === input.password) && (null !== input.license_key && undefined === input.license_key) && "string" === typeof input.id_token && "string" === typeof input.customer_account_code && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id) && (undefined === input.prefix || "string" === typeof input.prefix) && (undefined === input.os_ver || "string" === typeof input.os_ver) && (undefined === input.sdk_build_version || "string" === typeof input.sdk_build_version) && (undefined === input.hostname || "string" === typeof input.hostname) && (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) && (undefined === input.variables || "object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) && $io1(input.variables)); const $io4 = input => null !== input.username && undefined === input.username && (null !== input.password && undefined === input.password) && (null !== input.license_key && undefined === input.license_key) && "string" === typeof input.code && "string" === typeof input.customer_account_code && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id) && (undefined === input.prefix || "string" === typeof input.prefix) && (undefined === input.os_ver || "string" === typeof input.os_ver) && (undefined === input.sdk_build_version || "string" === typeof input.sdk_build_version) && (undefined === input.hostname || "string" === typeof input.hostname) && (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) && (undefined === input.variables || "object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) && $io1(input.variables)); const $iu0 = input => (() => {
680
+ if ("string" === typeof input.username)
681
+ return $io2(input);
682
+ else if ("string" === typeof input.license_key)
683
+ return $io0(input);
684
+ else if (undefined !== input.id_token)
685
+ return $io3(input);
686
+ else if (undefined !== input.code)
687
+ return $io4(input);
688
+ else
689
+ return false;
690
+ })(); const $ao0 = (input, _path, _exceptionable = true) => (null !== input.username || $guard(_exceptionable, {
691
+ path: _path + ".username",
692
+ expected: "undefined",
693
+ value: input.username
694
+ }, _errorFactory)) && (undefined === input.username || $guard(_exceptionable, {
695
+ path: _path + ".username",
696
+ expected: "undefined",
697
+ value: input.username
698
+ }, _errorFactory)) && ((null !== input.password || $guard(_exceptionable, {
699
+ path: _path + ".password",
700
+ expected: "undefined",
701
+ value: input.password
702
+ }, _errorFactory)) && (undefined === input.password || $guard(_exceptionable, {
703
+ path: _path + ".password",
704
+ expected: "undefined",
705
+ value: input.password
706
+ }, _errorFactory))) && ((null !== input.customer_account_code || $guard(_exceptionable, {
707
+ path: _path + ".customer_account_code",
708
+ expected: "undefined",
709
+ value: input.customer_account_code
710
+ }, _errorFactory)) && (undefined === input.customer_account_code || $guard(_exceptionable, {
711
+ path: _path + ".customer_account_code",
712
+ expected: "undefined",
713
+ value: input.customer_account_code
714
+ }, _errorFactory))) && ("string" === typeof input.license_key || $guard(_exceptionable, {
715
+ path: _path + ".license_key",
716
+ expected: "string",
717
+ value: input.license_key
718
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
719
+ path: _path + ".hardware_id",
720
+ expected: "string",
721
+ value: input.hardware_id
722
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
723
+ path: _path + ".product",
724
+ expected: "string",
725
+ value: input.product
726
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
727
+ path: _path + ".bundle_code",
728
+ expected: "(string | undefined)",
729
+ value: input.bundle_code
730
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
731
+ path: _path + ".license_id",
732
+ expected: "(number | undefined)",
733
+ value: input.license_id
734
+ }, _errorFactory)) && (undefined === input.prefix || "string" === typeof input.prefix || $guard(_exceptionable, {
735
+ path: _path + ".prefix",
736
+ expected: "(string | undefined)",
737
+ value: input.prefix
738
+ }, _errorFactory)) && (undefined === input.os_ver || "string" === typeof input.os_ver || $guard(_exceptionable, {
739
+ path: _path + ".os_ver",
740
+ expected: "(string | undefined)",
741
+ value: input.os_ver
742
+ }, _errorFactory)) && (undefined === input.sdk_build_version || "string" === typeof input.sdk_build_version || $guard(_exceptionable, {
743
+ path: _path + ".sdk_build_version",
744
+ expected: "(string | undefined)",
745
+ value: input.sdk_build_version
746
+ }, _errorFactory)) && (undefined === input.hostname || "string" === typeof input.hostname || $guard(_exceptionable, {
747
+ path: _path + ".hostname",
748
+ expected: "(string | undefined)",
749
+ value: input.hostname
750
+ }, _errorFactory)) && (undefined === input.ip || "string" === typeof input.ip || $guard(_exceptionable, {
751
+ path: _path + ".ip",
752
+ expected: "(string | undefined)",
753
+ value: input.ip
754
+ }, _errorFactory)) && (undefined === input.external_ip || "string" === typeof input.external_ip || $guard(_exceptionable, {
755
+ path: _path + ".external_ip",
756
+ expected: "(string | undefined)",
757
+ value: input.external_ip
758
+ }, _errorFactory)) && (undefined === input.app_ver || "string" === typeof input.app_ver || $guard(_exceptionable, {
759
+ path: _path + ".app_ver",
760
+ expected: "(string | undefined)",
761
+ value: input.app_ver
762
+ }, _errorFactory)) && (undefined === input.mac_address || "string" === typeof input.mac_address || $guard(_exceptionable, {
763
+ path: _path + ".mac_address",
764
+ expected: "(string | undefined)",
765
+ value: input.mac_address
766
+ }, _errorFactory)) && (undefined === input.variables || ("object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) || $guard(_exceptionable, {
767
+ path: _path + ".variables",
768
+ expected: "(Dictionary<string> | undefined)",
769
+ value: input.variables
770
+ }, _errorFactory)) && $ao1(input.variables, _path + ".variables", true && _exceptionable) || $guard(_exceptionable, {
771
+ path: _path + ".variables",
772
+ expected: "(Dictionary<string> | undefined)",
773
+ value: input.variables
774
+ }, _errorFactory)); const $ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
775
+ const value = input[key];
776
+ if (undefined === value)
777
+ return true;
778
+ return "string" === typeof value || $guard(_exceptionable, {
779
+ path: _path + $join(key),
780
+ expected: "string",
781
+ value: value
782
+ }, _errorFactory);
783
+ }); const $ao2 = (input, _path, _exceptionable = true) => (null !== input.customer_account_code || $guard(_exceptionable, {
784
+ path: _path + ".customer_account_code",
785
+ expected: "undefined",
786
+ value: input.customer_account_code
787
+ }, _errorFactory)) && (undefined === input.customer_account_code || $guard(_exceptionable, {
788
+ path: _path + ".customer_account_code",
789
+ expected: "undefined",
790
+ value: input.customer_account_code
791
+ }, _errorFactory)) && ((null !== input.license_key || $guard(_exceptionable, {
792
+ path: _path + ".license_key",
793
+ expected: "undefined",
794
+ value: input.license_key
795
+ }, _errorFactory)) && (undefined === input.license_key || $guard(_exceptionable, {
796
+ path: _path + ".license_key",
797
+ expected: "undefined",
798
+ value: input.license_key
799
+ }, _errorFactory))) && ("string" === typeof input.username || $guard(_exceptionable, {
800
+ path: _path + ".username",
801
+ expected: "string",
802
+ value: input.username
803
+ }, _errorFactory)) && ("string" === typeof input.password || $guard(_exceptionable, {
804
+ path: _path + ".password",
805
+ expected: "string",
806
+ value: input.password
807
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
808
+ path: _path + ".hardware_id",
809
+ expected: "string",
810
+ value: input.hardware_id
811
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
812
+ path: _path + ".product",
813
+ expected: "string",
814
+ value: input.product
815
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
816
+ path: _path + ".bundle_code",
817
+ expected: "(string | undefined)",
818
+ value: input.bundle_code
819
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
820
+ path: _path + ".license_id",
821
+ expected: "(number | undefined)",
822
+ value: input.license_id
823
+ }, _errorFactory)) && (undefined === input.prefix || "string" === typeof input.prefix || $guard(_exceptionable, {
824
+ path: _path + ".prefix",
825
+ expected: "(string | undefined)",
826
+ value: input.prefix
827
+ }, _errorFactory)) && (undefined === input.os_ver || "string" === typeof input.os_ver || $guard(_exceptionable, {
828
+ path: _path + ".os_ver",
829
+ expected: "(string | undefined)",
830
+ value: input.os_ver
831
+ }, _errorFactory)) && (undefined === input.sdk_build_version || "string" === typeof input.sdk_build_version || $guard(_exceptionable, {
832
+ path: _path + ".sdk_build_version",
833
+ expected: "(string | undefined)",
834
+ value: input.sdk_build_version
835
+ }, _errorFactory)) && (undefined === input.hostname || "string" === typeof input.hostname || $guard(_exceptionable, {
836
+ path: _path + ".hostname",
837
+ expected: "(string | undefined)",
838
+ value: input.hostname
839
+ }, _errorFactory)) && (undefined === input.ip || "string" === typeof input.ip || $guard(_exceptionable, {
840
+ path: _path + ".ip",
841
+ expected: "(string | undefined)",
842
+ value: input.ip
843
+ }, _errorFactory)) && (undefined === input.external_ip || "string" === typeof input.external_ip || $guard(_exceptionable, {
844
+ path: _path + ".external_ip",
845
+ expected: "(string | undefined)",
846
+ value: input.external_ip
847
+ }, _errorFactory)) && (undefined === input.app_ver || "string" === typeof input.app_ver || $guard(_exceptionable, {
848
+ path: _path + ".app_ver",
849
+ expected: "(string | undefined)",
850
+ value: input.app_ver
851
+ }, _errorFactory)) && (undefined === input.mac_address || "string" === typeof input.mac_address || $guard(_exceptionable, {
852
+ path: _path + ".mac_address",
853
+ expected: "(string | undefined)",
854
+ value: input.mac_address
855
+ }, _errorFactory)) && (undefined === input.variables || ("object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) || $guard(_exceptionable, {
856
+ path: _path + ".variables",
857
+ expected: "(Dictionary<string> | undefined)",
858
+ value: input.variables
859
+ }, _errorFactory)) && $ao1(input.variables, _path + ".variables", true && _exceptionable) || $guard(_exceptionable, {
860
+ path: _path + ".variables",
861
+ expected: "(Dictionary<string> | undefined)",
862
+ value: input.variables
863
+ }, _errorFactory)); const $ao3 = (input, _path, _exceptionable = true) => (null !== input.username || $guard(_exceptionable, {
864
+ path: _path + ".username",
865
+ expected: "undefined",
866
+ value: input.username
867
+ }, _errorFactory)) && (undefined === input.username || $guard(_exceptionable, {
868
+ path: _path + ".username",
869
+ expected: "undefined",
870
+ value: input.username
871
+ }, _errorFactory)) && ((null !== input.password || $guard(_exceptionable, {
872
+ path: _path + ".password",
873
+ expected: "undefined",
874
+ value: input.password
875
+ }, _errorFactory)) && (undefined === input.password || $guard(_exceptionable, {
876
+ path: _path + ".password",
877
+ expected: "undefined",
878
+ value: input.password
879
+ }, _errorFactory))) && ((null !== input.license_key || $guard(_exceptionable, {
880
+ path: _path + ".license_key",
881
+ expected: "undefined",
882
+ value: input.license_key
883
+ }, _errorFactory)) && (undefined === input.license_key || $guard(_exceptionable, {
884
+ path: _path + ".license_key",
885
+ expected: "undefined",
886
+ value: input.license_key
887
+ }, _errorFactory))) && ("string" === typeof input.id_token || $guard(_exceptionable, {
888
+ path: _path + ".id_token",
889
+ expected: "string",
890
+ value: input.id_token
891
+ }, _errorFactory)) && ("string" === typeof input.customer_account_code || $guard(_exceptionable, {
892
+ path: _path + ".customer_account_code",
893
+ expected: "string",
894
+ value: input.customer_account_code
895
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
896
+ path: _path + ".hardware_id",
897
+ expected: "string",
898
+ value: input.hardware_id
899
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
900
+ path: _path + ".product",
901
+ expected: "string",
902
+ value: input.product
903
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
904
+ path: _path + ".bundle_code",
905
+ expected: "(string | undefined)",
906
+ value: input.bundle_code
907
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
908
+ path: _path + ".license_id",
909
+ expected: "(number | undefined)",
910
+ value: input.license_id
911
+ }, _errorFactory)) && (undefined === input.prefix || "string" === typeof input.prefix || $guard(_exceptionable, {
912
+ path: _path + ".prefix",
913
+ expected: "(string | undefined)",
914
+ value: input.prefix
915
+ }, _errorFactory)) && (undefined === input.os_ver || "string" === typeof input.os_ver || $guard(_exceptionable, {
916
+ path: _path + ".os_ver",
917
+ expected: "(string | undefined)",
918
+ value: input.os_ver
919
+ }, _errorFactory)) && (undefined === input.sdk_build_version || "string" === typeof input.sdk_build_version || $guard(_exceptionable, {
920
+ path: _path + ".sdk_build_version",
921
+ expected: "(string | undefined)",
922
+ value: input.sdk_build_version
923
+ }, _errorFactory)) && (undefined === input.hostname || "string" === typeof input.hostname || $guard(_exceptionable, {
924
+ path: _path + ".hostname",
925
+ expected: "(string | undefined)",
926
+ value: input.hostname
927
+ }, _errorFactory)) && (undefined === input.ip || "string" === typeof input.ip || $guard(_exceptionable, {
928
+ path: _path + ".ip",
929
+ expected: "(string | undefined)",
930
+ value: input.ip
931
+ }, _errorFactory)) && (undefined === input.external_ip || "string" === typeof input.external_ip || $guard(_exceptionable, {
932
+ path: _path + ".external_ip",
933
+ expected: "(string | undefined)",
934
+ value: input.external_ip
935
+ }, _errorFactory)) && (undefined === input.app_ver || "string" === typeof input.app_ver || $guard(_exceptionable, {
936
+ path: _path + ".app_ver",
937
+ expected: "(string | undefined)",
938
+ value: input.app_ver
939
+ }, _errorFactory)) && (undefined === input.mac_address || "string" === typeof input.mac_address || $guard(_exceptionable, {
940
+ path: _path + ".mac_address",
941
+ expected: "(string | undefined)",
942
+ value: input.mac_address
943
+ }, _errorFactory)) && (undefined === input.variables || ("object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) || $guard(_exceptionable, {
944
+ path: _path + ".variables",
945
+ expected: "(Dictionary<string> | undefined)",
946
+ value: input.variables
947
+ }, _errorFactory)) && $ao1(input.variables, _path + ".variables", true && _exceptionable) || $guard(_exceptionable, {
948
+ path: _path + ".variables",
949
+ expected: "(Dictionary<string> | undefined)",
950
+ value: input.variables
951
+ }, _errorFactory)); const $ao4 = (input, _path, _exceptionable = true) => (null !== input.username || $guard(_exceptionable, {
952
+ path: _path + ".username",
953
+ expected: "undefined",
954
+ value: input.username
955
+ }, _errorFactory)) && (undefined === input.username || $guard(_exceptionable, {
956
+ path: _path + ".username",
957
+ expected: "undefined",
958
+ value: input.username
959
+ }, _errorFactory)) && ((null !== input.password || $guard(_exceptionable, {
960
+ path: _path + ".password",
961
+ expected: "undefined",
962
+ value: input.password
963
+ }, _errorFactory)) && (undefined === input.password || $guard(_exceptionable, {
964
+ path: _path + ".password",
965
+ expected: "undefined",
966
+ value: input.password
967
+ }, _errorFactory))) && ((null !== input.license_key || $guard(_exceptionable, {
968
+ path: _path + ".license_key",
969
+ expected: "undefined",
970
+ value: input.license_key
971
+ }, _errorFactory)) && (undefined === input.license_key || $guard(_exceptionable, {
972
+ path: _path + ".license_key",
973
+ expected: "undefined",
974
+ value: input.license_key
975
+ }, _errorFactory))) && ("string" === typeof input.code || $guard(_exceptionable, {
976
+ path: _path + ".code",
977
+ expected: "string",
978
+ value: input.code
979
+ }, _errorFactory)) && ("string" === typeof input.customer_account_code || $guard(_exceptionable, {
980
+ path: _path + ".customer_account_code",
981
+ expected: "string",
982
+ value: input.customer_account_code
983
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
984
+ path: _path + ".hardware_id",
985
+ expected: "string",
986
+ value: input.hardware_id
987
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
988
+ path: _path + ".product",
989
+ expected: "string",
990
+ value: input.product
991
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
992
+ path: _path + ".bundle_code",
993
+ expected: "(string | undefined)",
994
+ value: input.bundle_code
995
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
996
+ path: _path + ".license_id",
997
+ expected: "(number | undefined)",
998
+ value: input.license_id
999
+ }, _errorFactory)) && (undefined === input.prefix || "string" === typeof input.prefix || $guard(_exceptionable, {
1000
+ path: _path + ".prefix",
1001
+ expected: "(string | undefined)",
1002
+ value: input.prefix
1003
+ }, _errorFactory)) && (undefined === input.os_ver || "string" === typeof input.os_ver || $guard(_exceptionable, {
1004
+ path: _path + ".os_ver",
1005
+ expected: "(string | undefined)",
1006
+ value: input.os_ver
1007
+ }, _errorFactory)) && (undefined === input.sdk_build_version || "string" === typeof input.sdk_build_version || $guard(_exceptionable, {
1008
+ path: _path + ".sdk_build_version",
1009
+ expected: "(string | undefined)",
1010
+ value: input.sdk_build_version
1011
+ }, _errorFactory)) && (undefined === input.hostname || "string" === typeof input.hostname || $guard(_exceptionable, {
1012
+ path: _path + ".hostname",
1013
+ expected: "(string | undefined)",
1014
+ value: input.hostname
1015
+ }, _errorFactory)) && (undefined === input.ip || "string" === typeof input.ip || $guard(_exceptionable, {
1016
+ path: _path + ".ip",
1017
+ expected: "(string | undefined)",
1018
+ value: input.ip
1019
+ }, _errorFactory)) && (undefined === input.external_ip || "string" === typeof input.external_ip || $guard(_exceptionable, {
1020
+ path: _path + ".external_ip",
1021
+ expected: "(string | undefined)",
1022
+ value: input.external_ip
1023
+ }, _errorFactory)) && (undefined === input.app_ver || "string" === typeof input.app_ver || $guard(_exceptionable, {
1024
+ path: _path + ".app_ver",
1025
+ expected: "(string | undefined)",
1026
+ value: input.app_ver
1027
+ }, _errorFactory)) && (undefined === input.mac_address || "string" === typeof input.mac_address || $guard(_exceptionable, {
1028
+ path: _path + ".mac_address",
1029
+ expected: "(string | undefined)",
1030
+ value: input.mac_address
1031
+ }, _errorFactory)) && (undefined === input.variables || ("object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) || $guard(_exceptionable, {
1032
+ path: _path + ".variables",
1033
+ expected: "(Dictionary<string> | undefined)",
1034
+ value: input.variables
1035
+ }, _errorFactory)) && $ao1(input.variables, _path + ".variables", true && _exceptionable) || $guard(_exceptionable, {
1036
+ path: _path + ".variables",
1037
+ expected: "(Dictionary<string> | undefined)",
1038
+ value: input.variables
1039
+ }, _errorFactory)); const $au0 = (input, _path, _exceptionable = true) => (() => {
1040
+ if ("string" === typeof input.username)
1041
+ return $ao2(input, _path, true && _exceptionable);
1042
+ else if ("string" === typeof input.license_key)
1043
+ return $ao0(input, _path, true && _exceptionable);
1044
+ else if (undefined !== input.id_token)
1045
+ return $ao3(input, _path, true && _exceptionable);
1046
+ else if (undefined !== input.code)
1047
+ return $ao4(input, _path, true && _exceptionable);
1048
+ else
1049
+ return $guard(_exceptionable, {
1050
+ path: _path,
1051
+ expected: "({ customer_account_code?: undefined; license_key?: undefined; username: string; password: string; } & LicenseIdentificatiorRequired & OfflineActivationRequest & { ...; } | { username?: undefined; password?: undefined; customer_account_code?: undefined; license_key: string; } & LicenseIdentificatiorRequired & OfflineActivationRequest & { ...; } | { username?: undefined; password?: undefined; license_key?: undefined; id_token: string; customer_account_code: string; } & LicenseIdentificatiorRequired & OfflineActivationRequest & { ...; } | { username?: undefined; password?: undefined; license_key?: undefined; code: string; customer_account_code: string; } & LicenseIdentificatiorRequired & OfflineActivationRequest & { ...; })",
1052
+ value: input
1053
+ }, _errorFactory);
1054
+ })(); const __is = input => "object" === typeof input && null !== input && $iu0(input); let _errorFactory; return (input, errorFactory) => {
1055
+ if (false === __is(input)) {
1056
+ _errorFactory = errorFactory;
1057
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
1058
+ path: _path + "",
1059
+ expected: "({ customer_account_code?: undefined; license_key?: undefined; username: string; password: string; } & LicenseIdentificatiorRequired & OfflineActivationRequest & { ...; } | { username?: undefined; password?: undefined; customer_account_code?: undefined; license_key: string; } & LicenseIdentificatiorRequired & OfflineActivationRequest & { ...; } | { username?: undefined; password?: undefined; license_key?: undefined; code: string; customer_account_code: string; } & LicenseIdentificatiorRequired & OfflineActivationRequest & { ...; } | { username?: undefined; password?: undefined; license_key?: undefined; id_token: string; customer_account_code: string; } & LicenseIdentificatiorRequired & OfflineActivationRequest & { ...; })",
1060
+ value: input
1061
+ }, _errorFactory)) && $au0(input, _path + "", true) || $guard(true, {
1062
+ path: _path + "",
1063
+ expected: "({ customer_account_code?: undefined; license_key?: undefined; username: string; password: string; } & LicenseIdentificatiorRequired & OfflineActivationRequest & { ...; } | { username?: undefined; password?: undefined; customer_account_code?: undefined; license_key: string; } & LicenseIdentificatiorRequired & OfflineActivationRequest & { ...; } | { username?: undefined; password?: undefined; license_key?: undefined; code: string; customer_account_code: string; } & LicenseIdentificatiorRequired & OfflineActivationRequest & { ...; } | { username?: undefined; password?: undefined; license_key?: undefined; id_token: string; customer_account_code: string; } & LicenseIdentificatiorRequired & OfflineActivationRequest & { ...; })",
1064
+ value: input
1065
+ }, _errorFactory))(input, "$input", true);
1066
+ }
1067
+ return input;
1068
+ }; })()(payload);
1069
+ const { date, offlineSignature } = (0, common_1.createOfflineSignature)(this.config.apiKey, this.config.sharedKey, payload);
1070
+ const offlinePayload = payload;
1071
+ offlinePayload.date = date;
1072
+ offlinePayload.signature = offlineSignature;
1073
+ offlinePayload.api_key = this.config.apiKey;
1074
+ const { response } = yield this.service.postRequest('activate_offline', Buffer.from(JSON.stringify(offlinePayload)).toString('base64'), { 'Content-Type': 'text/plain' });
1075
+ (0, common_1.checkSignatureV1)(this.config.publicKey, response, offlinePayload);
1076
+ const responsePartial = response;
1077
+ const signatureV2 = response.license_signature_v2;
1078
+ delete responsePartial.license_signature;
1079
+ delete responsePartial.license_signature_v2;
1080
+ (0, common_1.checkSignatureV2)(this.config.publicKey, responsePartial, signatureV2);
1081
+ return response;
1082
+ });
1083
+ }
1084
+ ;
1085
+ deactivateOffline(payload) {
1086
+ return __awaiter(this, void 0, void 0, function* () {
1087
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => null !== input.username && undefined === input.username && "string" === typeof input.license_key && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id); const $io1 = input => null !== input.license_key && undefined === input.license_key && "string" === typeof input.username && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id); const $iu0 = input => (() => {
1088
+ if ("string" === typeof input.username)
1089
+ return $io1(input);
1090
+ else if ("string" === typeof input.license_key)
1091
+ return $io0(input);
1092
+ else
1093
+ return false;
1094
+ })(); const $ao0 = (input, _path, _exceptionable = true) => (null !== input.username || $guard(_exceptionable, {
1095
+ path: _path + ".username",
1096
+ expected: "undefined",
1097
+ value: input.username
1098
+ }, _errorFactory)) && (undefined === input.username || $guard(_exceptionable, {
1099
+ path: _path + ".username",
1100
+ expected: "undefined",
1101
+ value: input.username
1102
+ }, _errorFactory)) && ("string" === typeof input.license_key || $guard(_exceptionable, {
1103
+ path: _path + ".license_key",
1104
+ expected: "string",
1105
+ value: input.license_key
1106
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
1107
+ path: _path + ".hardware_id",
1108
+ expected: "string",
1109
+ value: input.hardware_id
1110
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
1111
+ path: _path + ".product",
1112
+ expected: "string",
1113
+ value: input.product
1114
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
1115
+ path: _path + ".bundle_code",
1116
+ expected: "(string | undefined)",
1117
+ value: input.bundle_code
1118
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
1119
+ path: _path + ".license_id",
1120
+ expected: "(number | undefined)",
1121
+ value: input.license_id
1122
+ }, _errorFactory)); const $ao1 = (input, _path, _exceptionable = true) => (null !== input.license_key || $guard(_exceptionable, {
1123
+ path: _path + ".license_key",
1124
+ expected: "undefined",
1125
+ value: input.license_key
1126
+ }, _errorFactory)) && (undefined === input.license_key || $guard(_exceptionable, {
1127
+ path: _path + ".license_key",
1128
+ expected: "undefined",
1129
+ value: input.license_key
1130
+ }, _errorFactory)) && ("string" === typeof input.username || $guard(_exceptionable, {
1131
+ path: _path + ".username",
1132
+ expected: "string",
1133
+ value: input.username
1134
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
1135
+ path: _path + ".hardware_id",
1136
+ expected: "string",
1137
+ value: input.hardware_id
1138
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
1139
+ path: _path + ".product",
1140
+ expected: "string",
1141
+ value: input.product
1142
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
1143
+ path: _path + ".bundle_code",
1144
+ expected: "(string | undefined)",
1145
+ value: input.bundle_code
1146
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
1147
+ path: _path + ".license_id",
1148
+ expected: "(number | undefined)",
1149
+ value: input.license_id
1150
+ }, _errorFactory)); const $au0 = (input, _path, _exceptionable = true) => (() => {
1151
+ if ("string" === typeof input.username)
1152
+ return $ao1(input, _path, true && _exceptionable);
1153
+ else if ("string" === typeof input.license_key)
1154
+ return $ao0(input, _path, true && _exceptionable);
1155
+ else
1156
+ return $guard(_exceptionable, {
1157
+ path: _path,
1158
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired)",
1159
+ value: input
1160
+ }, _errorFactory);
1161
+ })(); const __is = input => "object" === typeof input && null !== input && $iu0(input); let _errorFactory; return (input, errorFactory) => {
1162
+ if (false === __is(input)) {
1163
+ _errorFactory = errorFactory;
1164
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
1165
+ path: _path + "",
1166
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired)",
1167
+ value: input
1168
+ }, _errorFactory)) && $au0(input, _path + "", true) || $guard(true, {
1169
+ path: _path + "",
1170
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired)",
1171
+ value: input
1172
+ }, _errorFactory))(input, "$input", true);
1173
+ }
1174
+ return input;
1175
+ }; })()(payload);
1176
+ const { date, offlineSignature } = (0, common_1.createOfflineSignature)(this.config.apiKey, this.config.sharedKey, payload);
1177
+ const offlinePayload = payload;
1178
+ offlinePayload.date = date;
1179
+ offlinePayload.signature = offlineSignature;
1180
+ offlinePayload.api_key = this.config.apiKey;
1181
+ const { response } = yield this.service.postRequest('deactivate_offline', Buffer.from(JSON.stringify(offlinePayload)).toString('base64'), { 'Content-Type': 'text/plain' });
1182
+ return (0, common_1.assertResponseString)(response, 'license_deactivated');
1183
+ });
1184
+ }
1185
+ ;
1186
+ checkLicenseOffline(payloadBase64) {
1187
+ let payloadObject;
1188
+ try {
1189
+ const payloadString = Buffer.from(payloadBase64.trim(), 'base64').toString();
1190
+ payloadObject = JSON.parse(payloadString);
1191
+ if (!payloadObject)
1192
+ throw new Error();
1193
+ }
1194
+ catch (e) {
1195
+ throw new Error('Invalid License File contents');
1196
+ }
1197
+ (0, common_1.checkSignatureV1)(this.config.publicKey, payloadObject, payloadObject);
1198
+ const payloadPartial = payloadObject;
1199
+ const signatureV2 = payloadObject.license_signature_v2;
1200
+ delete payloadPartial.license_signature_v2;
1201
+ (0, common_1.checkSignatureV2)(this.config.publicKey, payloadPartial, signatureV2);
1202
+ (0, common_1.checkOfflineSignature)(this.config.apiKey, this.config.sharedKey, payloadObject, payloadObject.offline_signature);
1203
+ return payloadObject;
1204
+ }
1205
+ ;
1206
+ getTrialKey(payload) {
1207
+ return __awaiter(this, void 0, void 0, function* () {
1208
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => "string" === typeof input.email && "string" === typeof input.product && "string" === typeof input.hardware_id; const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.email || $guard(_exceptionable, {
1209
+ path: _path + ".email",
1210
+ expected: "string",
1211
+ value: input.email
1212
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
1213
+ path: _path + ".product",
1214
+ expected: "string",
1215
+ value: input.product
1216
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
1217
+ path: _path + ".hardware_id",
1218
+ expected: "string",
1219
+ value: input.hardware_id
1220
+ }, _errorFactory)); const __is = input => "object" === typeof input && null !== input && $io0(input); let _errorFactory; return (input, errorFactory) => {
1221
+ if (false === __is(input)) {
1222
+ _errorFactory = errorFactory;
1223
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
1224
+ path: _path + "",
1225
+ expected: "TrialKeyPayload",
1226
+ value: input
1227
+ }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
1228
+ path: _path + "",
1229
+ expected: "TrialKeyPayload",
1230
+ value: input
1231
+ }, _errorFactory))(input, "$input", true);
1232
+ }
1233
+ return input;
1234
+ }; })()(payload);
1235
+ const { headers, response } = yield this.service.getRequest('trial_key', payload);
1236
+ (0, common_1.checkSignatureV2)(this.config.publicKey, response, (0, common_1.getHeaderString)(headers, 'LicenseSignature'));
1237
+ return response;
1238
+ });
1239
+ }
1240
+ ;
1241
+ getUserLicenses(payload) {
1242
+ return __awaiter(this, void 0, void 0, function* () {
1243
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => "string" === typeof input.username && "string" === typeof input.password && "string" === typeof input.product; const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.username || $guard(_exceptionable, {
1244
+ path: _path + ".username",
1245
+ expected: "string",
1246
+ value: input.username
1247
+ }, _errorFactory)) && ("string" === typeof input.password || $guard(_exceptionable, {
1248
+ path: _path + ".password",
1249
+ expected: "string",
1250
+ value: input.password
1251
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
1252
+ path: _path + ".product",
1253
+ expected: "string",
1254
+ value: input.product
1255
+ }, _errorFactory)); const __is = input => "object" === typeof input && null !== input && $io0(input); let _errorFactory; return (input, errorFactory) => {
1256
+ if (false === __is(input)) {
1257
+ _errorFactory = errorFactory;
1258
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
1259
+ path: _path + "",
1260
+ expected: "GetUserLicensesPayload",
1261
+ value: input
1262
+ }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
1263
+ path: _path + "",
1264
+ expected: "GetUserLicensesPayload",
1265
+ value: input
1266
+ }, _errorFactory))(input, "$input", true);
1267
+ }
1268
+ return input;
1269
+ }; })()(payload);
1270
+ const { headers, response } = yield this.service.getRequest('user_licenses', payload);
1271
+ (0, common_1.checkSignatureV2)(this.config.publicKey, response, (0, common_1.getHeaderString)(headers, 'LicenseSignature'));
1272
+ return response;
1273
+ });
1274
+ }
1275
+ ;
1276
+ getCustomerLicenseUsers(payload) {
1277
+ return __awaiter(this, void 0, void 0, function* () {
1278
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => "string" === typeof input.customer && "string" === typeof input.product; const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.customer || $guard(_exceptionable, {
1279
+ path: _path + ".customer",
1280
+ expected: "string",
1281
+ value: input.customer
1282
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
1283
+ path: _path + ".product",
1284
+ expected: "string",
1285
+ value: input.product
1286
+ }, _errorFactory)); const __is = input => "object" === typeof input && null !== input && $io0(input); let _errorFactory; return (input, errorFactory) => {
1287
+ if (false === __is(input)) {
1288
+ _errorFactory = errorFactory;
1289
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
1290
+ path: _path + "",
1291
+ expected: "GetCustomerLicensesPayload",
1292
+ value: input
1293
+ }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
1294
+ path: _path + "",
1295
+ expected: "GetCustomerLicensesPayload",
1296
+ value: input
1297
+ }, _errorFactory))(input, "$input", true);
1298
+ }
1299
+ return input;
1300
+ }; })()(payload);
1301
+ const { headers, response } = yield this.service.getRequest('customer_license_users', payload);
1302
+ (0, common_1.checkSignatureV2)(this.config.publicKey, response, (0, common_1.getHeaderString)(headers, 'LicenseSignature'));
1303
+ return response;
1304
+ });
1305
+ }
1306
+ ;
1307
+ checkLicenseFeature(payload) {
1308
+ return __awaiter(this, void 0, void 0, function* () {
1309
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => null !== input.username && undefined === input.username && "string" === typeof input.license_key && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id) && "string" === typeof input.feature; const $io1 = input => null !== input.license_key && undefined === input.license_key && "string" === typeof input.username && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id) && "string" === typeof input.feature; const $iu0 = input => (() => {
1310
+ if ("string" === typeof input.username)
1311
+ return $io1(input);
1312
+ else if ("string" === typeof input.license_key)
1313
+ return $io0(input);
1314
+ else
1315
+ return false;
1316
+ })(); const $ao0 = (input, _path, _exceptionable = true) => (null !== input.username || $guard(_exceptionable, {
1317
+ path: _path + ".username",
1318
+ expected: "undefined",
1319
+ value: input.username
1320
+ }, _errorFactory)) && (undefined === input.username || $guard(_exceptionable, {
1321
+ path: _path + ".username",
1322
+ expected: "undefined",
1323
+ value: input.username
1324
+ }, _errorFactory)) && ("string" === typeof input.license_key || $guard(_exceptionable, {
1325
+ path: _path + ".license_key",
1326
+ expected: "string",
1327
+ value: input.license_key
1328
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
1329
+ path: _path + ".hardware_id",
1330
+ expected: "string",
1331
+ value: input.hardware_id
1332
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
1333
+ path: _path + ".product",
1334
+ expected: "string",
1335
+ value: input.product
1336
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
1337
+ path: _path + ".bundle_code",
1338
+ expected: "(string | undefined)",
1339
+ value: input.bundle_code
1340
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
1341
+ path: _path + ".license_id",
1342
+ expected: "(number | undefined)",
1343
+ value: input.license_id
1344
+ }, _errorFactory)) && ("string" === typeof input.feature || $guard(_exceptionable, {
1345
+ path: _path + ".feature",
1346
+ expected: "string",
1347
+ value: input.feature
1348
+ }, _errorFactory)); const $ao1 = (input, _path, _exceptionable = true) => (null !== input.license_key || $guard(_exceptionable, {
1349
+ path: _path + ".license_key",
1350
+ expected: "undefined",
1351
+ value: input.license_key
1352
+ }, _errorFactory)) && (undefined === input.license_key || $guard(_exceptionable, {
1353
+ path: _path + ".license_key",
1354
+ expected: "undefined",
1355
+ value: input.license_key
1356
+ }, _errorFactory)) && ("string" === typeof input.username || $guard(_exceptionable, {
1357
+ path: _path + ".username",
1358
+ expected: "string",
1359
+ value: input.username
1360
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
1361
+ path: _path + ".hardware_id",
1362
+ expected: "string",
1363
+ value: input.hardware_id
1364
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
1365
+ path: _path + ".product",
1366
+ expected: "string",
1367
+ value: input.product
1368
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
1369
+ path: _path + ".bundle_code",
1370
+ expected: "(string | undefined)",
1371
+ value: input.bundle_code
1372
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
1373
+ path: _path + ".license_id",
1374
+ expected: "(number | undefined)",
1375
+ value: input.license_id
1376
+ }, _errorFactory)) && ("string" === typeof input.feature || $guard(_exceptionable, {
1377
+ path: _path + ".feature",
1378
+ expected: "string",
1379
+ value: input.feature
1380
+ }, _errorFactory)); const $au0 = (input, _path, _exceptionable = true) => (() => {
1381
+ if ("string" === typeof input.username)
1382
+ return $ao1(input, _path, true && _exceptionable);
1383
+ else if ("string" === typeof input.license_key)
1384
+ return $ao0(input, _path, true && _exceptionable);
1385
+ else
1386
+ return $guard(_exceptionable, {
1387
+ path: _path,
1388
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired & { feature: string; } | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired & { feature: string; })",
1389
+ value: input
1390
+ }, _errorFactory);
1391
+ })(); const __is = input => "object" === typeof input && null !== input && $iu0(input); let _errorFactory; return (input, errorFactory) => {
1392
+ if (false === __is(input)) {
1393
+ _errorFactory = errorFactory;
1394
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
1395
+ path: _path + "",
1396
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired & { feature: string; } | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired & { feature: string; })",
1397
+ value: input
1398
+ }, _errorFactory)) && $au0(input, _path + "", true) || $guard(true, {
1399
+ path: _path + "",
1400
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired & { feature: string; } | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired & { feature: string; })",
1401
+ value: input
1402
+ }, _errorFactory))(input, "$input", true);
1403
+ }
1404
+ return input;
1405
+ }; })()(payload);
1406
+ const { headers, response } = yield this.service.getRequest('check_license_feature', payload);
1407
+ (0, common_1.checkSignatureV2)(this.config.publicKey, response, (0, common_1.getHeaderString)(headers, 'LicenseSignature'));
1408
+ return response;
1409
+ });
1410
+ }
1411
+ ;
1412
+ addConsumption(payload) {
1413
+ return __awaiter(this, void 0, void 0, function* () {
1414
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => null !== input.username && undefined === input.username && "string" === typeof input.license_key && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id) && "number" === typeof input.consumptions; const $io1 = input => null !== input.license_key && undefined === input.license_key && "string" === typeof input.username && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id) && "number" === typeof input.consumptions; const $iu0 = input => (() => {
1415
+ if ("string" === typeof input.username)
1416
+ return $io1(input);
1417
+ else if ("string" === typeof input.license_key)
1418
+ return $io0(input);
1419
+ else
1420
+ return false;
1421
+ })(); const $ao0 = (input, _path, _exceptionable = true) => (null !== input.username || $guard(_exceptionable, {
1422
+ path: _path + ".username",
1423
+ expected: "undefined",
1424
+ value: input.username
1425
+ }, _errorFactory)) && (undefined === input.username || $guard(_exceptionable, {
1426
+ path: _path + ".username",
1427
+ expected: "undefined",
1428
+ value: input.username
1429
+ }, _errorFactory)) && ("string" === typeof input.license_key || $guard(_exceptionable, {
1430
+ path: _path + ".license_key",
1431
+ expected: "string",
1432
+ value: input.license_key
1433
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
1434
+ path: _path + ".hardware_id",
1435
+ expected: "string",
1436
+ value: input.hardware_id
1437
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
1438
+ path: _path + ".product",
1439
+ expected: "string",
1440
+ value: input.product
1441
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
1442
+ path: _path + ".bundle_code",
1443
+ expected: "(string | undefined)",
1444
+ value: input.bundle_code
1445
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
1446
+ path: _path + ".license_id",
1447
+ expected: "(number | undefined)",
1448
+ value: input.license_id
1449
+ }, _errorFactory)) && ("number" === typeof input.consumptions || $guard(_exceptionable, {
1450
+ path: _path + ".consumptions",
1451
+ expected: "number",
1452
+ value: input.consumptions
1453
+ }, _errorFactory)); const $ao1 = (input, _path, _exceptionable = true) => (null !== input.license_key || $guard(_exceptionable, {
1454
+ path: _path + ".license_key",
1455
+ expected: "undefined",
1456
+ value: input.license_key
1457
+ }, _errorFactory)) && (undefined === input.license_key || $guard(_exceptionable, {
1458
+ path: _path + ".license_key",
1459
+ expected: "undefined",
1460
+ value: input.license_key
1461
+ }, _errorFactory)) && ("string" === typeof input.username || $guard(_exceptionable, {
1462
+ path: _path + ".username",
1463
+ expected: "string",
1464
+ value: input.username
1465
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
1466
+ path: _path + ".hardware_id",
1467
+ expected: "string",
1468
+ value: input.hardware_id
1469
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
1470
+ path: _path + ".product",
1471
+ expected: "string",
1472
+ value: input.product
1473
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
1474
+ path: _path + ".bundle_code",
1475
+ expected: "(string | undefined)",
1476
+ value: input.bundle_code
1477
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
1478
+ path: _path + ".license_id",
1479
+ expected: "(number | undefined)",
1480
+ value: input.license_id
1481
+ }, _errorFactory)) && ("number" === typeof input.consumptions || $guard(_exceptionable, {
1482
+ path: _path + ".consumptions",
1483
+ expected: "number",
1484
+ value: input.consumptions
1485
+ }, _errorFactory)); const $au0 = (input, _path, _exceptionable = true) => (() => {
1486
+ if ("string" === typeof input.username)
1487
+ return $ao1(input, _path, true && _exceptionable);
1488
+ else if ("string" === typeof input.license_key)
1489
+ return $ao0(input, _path, true && _exceptionable);
1490
+ else
1491
+ return $guard(_exceptionable, {
1492
+ path: _path,
1493
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired & { consumptions: number; } | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired & { consumptions: number; })",
1494
+ value: input
1495
+ }, _errorFactory);
1496
+ })(); const __is = input => "object" === typeof input && null !== input && $iu0(input); let _errorFactory; return (input, errorFactory) => {
1497
+ if (false === __is(input)) {
1498
+ _errorFactory = errorFactory;
1499
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
1500
+ path: _path + "",
1501
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired & { consumptions: number; } | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired & { consumptions: number; })",
1502
+ value: input
1503
+ }, _errorFactory)) && $au0(input, _path + "", true) || $guard(true, {
1504
+ path: _path + "",
1505
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired & { consumptions: number; } | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired & { consumptions: number; })",
1506
+ value: input
1507
+ }, _errorFactory))(input, "$input", true);
1508
+ }
1509
+ return input;
1510
+ }; })()(payload);
1511
+ const { headers, response } = yield this.service.postRequest('add_consumption', payload);
1512
+ (0, common_1.checkSignatureV2)(this.config.publicKey, response, (0, common_1.getHeaderString)(headers, 'LicenseSignature'));
1513
+ return response;
1514
+ });
1515
+ }
1516
+ ;
1517
+ addFeatureConsumption(payload) {
1518
+ return __awaiter(this, void 0, void 0, function* () {
1519
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => null !== input.username && undefined === input.username && "string" === typeof input.license_key && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id) && "string" === typeof input.feature && "number" === typeof input.consumptions; const $io1 = input => null !== input.license_key && undefined === input.license_key && "string" === typeof input.username && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id) && "string" === typeof input.feature && "number" === typeof input.consumptions; const $iu0 = input => (() => {
1520
+ if ("string" === typeof input.username)
1521
+ return $io1(input);
1522
+ else if ("string" === typeof input.license_key)
1523
+ return $io0(input);
1524
+ else
1525
+ return false;
1526
+ })(); const $ao0 = (input, _path, _exceptionable = true) => (null !== input.username || $guard(_exceptionable, {
1527
+ path: _path + ".username",
1528
+ expected: "undefined",
1529
+ value: input.username
1530
+ }, _errorFactory)) && (undefined === input.username || $guard(_exceptionable, {
1531
+ path: _path + ".username",
1532
+ expected: "undefined",
1533
+ value: input.username
1534
+ }, _errorFactory)) && ("string" === typeof input.license_key || $guard(_exceptionable, {
1535
+ path: _path + ".license_key",
1536
+ expected: "string",
1537
+ value: input.license_key
1538
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
1539
+ path: _path + ".hardware_id",
1540
+ expected: "string",
1541
+ value: input.hardware_id
1542
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
1543
+ path: _path + ".product",
1544
+ expected: "string",
1545
+ value: input.product
1546
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
1547
+ path: _path + ".bundle_code",
1548
+ expected: "(string | undefined)",
1549
+ value: input.bundle_code
1550
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
1551
+ path: _path + ".license_id",
1552
+ expected: "(number | undefined)",
1553
+ value: input.license_id
1554
+ }, _errorFactory)) && ("string" === typeof input.feature || $guard(_exceptionable, {
1555
+ path: _path + ".feature",
1556
+ expected: "string",
1557
+ value: input.feature
1558
+ }, _errorFactory)) && ("number" === typeof input.consumptions || $guard(_exceptionable, {
1559
+ path: _path + ".consumptions",
1560
+ expected: "number",
1561
+ value: input.consumptions
1562
+ }, _errorFactory)); const $ao1 = (input, _path, _exceptionable = true) => (null !== input.license_key || $guard(_exceptionable, {
1563
+ path: _path + ".license_key",
1564
+ expected: "undefined",
1565
+ value: input.license_key
1566
+ }, _errorFactory)) && (undefined === input.license_key || $guard(_exceptionable, {
1567
+ path: _path + ".license_key",
1568
+ expected: "undefined",
1569
+ value: input.license_key
1570
+ }, _errorFactory)) && ("string" === typeof input.username || $guard(_exceptionable, {
1571
+ path: _path + ".username",
1572
+ expected: "string",
1573
+ value: input.username
1574
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
1575
+ path: _path + ".hardware_id",
1576
+ expected: "string",
1577
+ value: input.hardware_id
1578
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
1579
+ path: _path + ".product",
1580
+ expected: "string",
1581
+ value: input.product
1582
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
1583
+ path: _path + ".bundle_code",
1584
+ expected: "(string | undefined)",
1585
+ value: input.bundle_code
1586
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
1587
+ path: _path + ".license_id",
1588
+ expected: "(number | undefined)",
1589
+ value: input.license_id
1590
+ }, _errorFactory)) && ("string" === typeof input.feature || $guard(_exceptionable, {
1591
+ path: _path + ".feature",
1592
+ expected: "string",
1593
+ value: input.feature
1594
+ }, _errorFactory)) && ("number" === typeof input.consumptions || $guard(_exceptionable, {
1595
+ path: _path + ".consumptions",
1596
+ expected: "number",
1597
+ value: input.consumptions
1598
+ }, _errorFactory)); const $au0 = (input, _path, _exceptionable = true) => (() => {
1599
+ if ("string" === typeof input.username)
1600
+ return $ao1(input, _path, true && _exceptionable);
1601
+ else if ("string" === typeof input.license_key)
1602
+ return $ao0(input, _path, true && _exceptionable);
1603
+ else
1604
+ return $guard(_exceptionable, {
1605
+ path: _path,
1606
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired & { feature: string; consumptions: number; } | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired & { feature: string; consumptions: number; })",
1607
+ value: input
1608
+ }, _errorFactory);
1609
+ })(); const __is = input => "object" === typeof input && null !== input && $iu0(input); let _errorFactory; return (input, errorFactory) => {
1610
+ if (false === __is(input)) {
1611
+ _errorFactory = errorFactory;
1612
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
1613
+ path: _path + "",
1614
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired & { feature: string; consumptions: number; } | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired & { feature: string; consumptions: number; })",
1615
+ value: input
1616
+ }, _errorFactory)) && $au0(input, _path + "", true) || $guard(true, {
1617
+ path: _path + "",
1618
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired & { feature: string; consumptions: number; } | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired & { feature: string; consumptions: number; })",
1619
+ value: input
1620
+ }, _errorFactory))(input, "$input", true);
1621
+ }
1622
+ return input;
1623
+ }; })()(payload);
1624
+ const { headers, response } = yield this.service.postRequest('add_feature_consumption', payload);
1625
+ (0, common_1.checkSignatureV2)(this.config.publicKey, response, (0, common_1.getHeaderString)(headers, 'LicenseSignature'));
1626
+ return response;
1627
+ });
1628
+ }
1629
+ ;
1630
+ featureRelease(payload) {
1631
+ return __awaiter(this, void 0, void 0, function* () {
1632
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => null !== input.username && undefined === input.username && "string" === typeof input.license_key && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id) && "string" === typeof input.feature; const $io1 = input => null !== input.license_key && undefined === input.license_key && "string" === typeof input.username && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id) && "string" === typeof input.feature; const $iu0 = input => (() => {
1633
+ if ("string" === typeof input.username)
1634
+ return $io1(input);
1635
+ else if ("string" === typeof input.license_key)
1636
+ return $io0(input);
1637
+ else
1638
+ return false;
1639
+ })(); const $ao0 = (input, _path, _exceptionable = true) => (null !== input.username || $guard(_exceptionable, {
1640
+ path: _path + ".username",
1641
+ expected: "undefined",
1642
+ value: input.username
1643
+ }, _errorFactory)) && (undefined === input.username || $guard(_exceptionable, {
1644
+ path: _path + ".username",
1645
+ expected: "undefined",
1646
+ value: input.username
1647
+ }, _errorFactory)) && ("string" === typeof input.license_key || $guard(_exceptionable, {
1648
+ path: _path + ".license_key",
1649
+ expected: "string",
1650
+ value: input.license_key
1651
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
1652
+ path: _path + ".hardware_id",
1653
+ expected: "string",
1654
+ value: input.hardware_id
1655
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
1656
+ path: _path + ".product",
1657
+ expected: "string",
1658
+ value: input.product
1659
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
1660
+ path: _path + ".bundle_code",
1661
+ expected: "(string | undefined)",
1662
+ value: input.bundle_code
1663
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
1664
+ path: _path + ".license_id",
1665
+ expected: "(number | undefined)",
1666
+ value: input.license_id
1667
+ }, _errorFactory)) && ("string" === typeof input.feature || $guard(_exceptionable, {
1668
+ path: _path + ".feature",
1669
+ expected: "string",
1670
+ value: input.feature
1671
+ }, _errorFactory)); const $ao1 = (input, _path, _exceptionable = true) => (null !== input.license_key || $guard(_exceptionable, {
1672
+ path: _path + ".license_key",
1673
+ expected: "undefined",
1674
+ value: input.license_key
1675
+ }, _errorFactory)) && (undefined === input.license_key || $guard(_exceptionable, {
1676
+ path: _path + ".license_key",
1677
+ expected: "undefined",
1678
+ value: input.license_key
1679
+ }, _errorFactory)) && ("string" === typeof input.username || $guard(_exceptionable, {
1680
+ path: _path + ".username",
1681
+ expected: "string",
1682
+ value: input.username
1683
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
1684
+ path: _path + ".hardware_id",
1685
+ expected: "string",
1686
+ value: input.hardware_id
1687
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
1688
+ path: _path + ".product",
1689
+ expected: "string",
1690
+ value: input.product
1691
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
1692
+ path: _path + ".bundle_code",
1693
+ expected: "(string | undefined)",
1694
+ value: input.bundle_code
1695
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
1696
+ path: _path + ".license_id",
1697
+ expected: "(number | undefined)",
1698
+ value: input.license_id
1699
+ }, _errorFactory)) && ("string" === typeof input.feature || $guard(_exceptionable, {
1700
+ path: _path + ".feature",
1701
+ expected: "string",
1702
+ value: input.feature
1703
+ }, _errorFactory)); const $au0 = (input, _path, _exceptionable = true) => (() => {
1704
+ if ("string" === typeof input.username)
1705
+ return $ao1(input, _path, true && _exceptionable);
1706
+ else if ("string" === typeof input.license_key)
1707
+ return $ao0(input, _path, true && _exceptionable);
1708
+ else
1709
+ return $guard(_exceptionable, {
1710
+ path: _path,
1711
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired & { feature: string; } | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired & { feature: string; })",
1712
+ value: input
1713
+ }, _errorFactory);
1714
+ })(); const __is = input => "object" === typeof input && null !== input && $iu0(input); let _errorFactory; return (input, errorFactory) => {
1715
+ if (false === __is(input)) {
1716
+ _errorFactory = errorFactory;
1717
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
1718
+ path: _path + "",
1719
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired & { feature: string; } | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired & { feature: string; })",
1720
+ value: input
1721
+ }, _errorFactory)) && $au0(input, _path + "", true) || $guard(true, {
1722
+ path: _path + "",
1723
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired & { feature: string; } | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired & { feature: string; })",
1724
+ value: input
1725
+ }, _errorFactory))(input, "$input", true);
1726
+ }
1727
+ return input;
1728
+ }; })()(payload);
1729
+ const { response } = yield this.service.postRequest('feature_release', payload);
1730
+ return (0, common_1.assertResponseString)(response, '');
1731
+ });
1732
+ }
1733
+ ;
1734
+ getProductDetails(payload) {
1735
+ return __awaiter(this, void 0, void 0, function* () {
1736
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => "string" === typeof input.product && (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) => ("string" === typeof input.product || $guard(_exceptionable, {
1737
+ path: _path + ".product",
1738
+ expected: "string",
1739
+ value: input.product
1740
+ }, _errorFactory)) && (undefined === input.include_expired_features || "boolean" === typeof input.include_expired_features || $guard(_exceptionable, {
1741
+ path: _path + ".include_expired_features",
1742
+ expected: "(boolean | undefined)",
1743
+ value: input.include_expired_features
1744
+ }, _errorFactory)) && (undefined === input.include_latest_version || "boolean" === typeof input.include_latest_version || $guard(_exceptionable, {
1745
+ path: _path + ".include_latest_version",
1746
+ expected: "(boolean | undefined)",
1747
+ value: input.include_latest_version
1748
+ }, _errorFactory)) && (undefined === input.include_custom_fields || "boolean" === typeof input.include_custom_fields || $guard(_exceptionable, {
1749
+ path: _path + ".include_custom_fields",
1750
+ expected: "(boolean | undefined)",
1751
+ value: input.include_custom_fields
1752
+ }, _errorFactory)); const __is = input => "object" === typeof input && null !== input && $io0(input); let _errorFactory; return (input, errorFactory) => {
1753
+ if (false === __is(input)) {
1754
+ _errorFactory = errorFactory;
1755
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
1756
+ path: _path + "",
1757
+ expected: "ProductDetailsPayload",
1758
+ value: input
1759
+ }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
1760
+ path: _path + "",
1761
+ expected: "ProductDetailsPayload",
1762
+ value: input
1763
+ }, _errorFactory))(input, "$input", true);
1764
+ }
1765
+ return input;
1766
+ }; })()(payload);
1767
+ const { headers, response } = yield this.service.getRequest('product_details', payload);
1768
+ (0, common_1.checkSignatureV2)(this.config.publicKey, response, (0, common_1.getHeaderString)(headers, 'LicenseSignature'));
1769
+ return response;
1770
+ });
1771
+ }
1772
+ ;
1773
+ getDeviceVariables(payload) {
1774
+ return __awaiter(this, void 0, void 0, function* () {
1775
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => null !== input.username && undefined === input.username && "string" === typeof input.license_key && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id); const $io1 = input => null !== input.license_key && undefined === input.license_key && "string" === typeof input.username && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id); const $iu0 = input => (() => {
1776
+ if ("string" === typeof input.username)
1777
+ return $io1(input);
1778
+ else if ("string" === typeof input.license_key)
1779
+ return $io0(input);
1780
+ else
1781
+ return false;
1782
+ })(); const $ao0 = (input, _path, _exceptionable = true) => (null !== input.username || $guard(_exceptionable, {
1783
+ path: _path + ".username",
1784
+ expected: "undefined",
1785
+ value: input.username
1786
+ }, _errorFactory)) && (undefined === input.username || $guard(_exceptionable, {
1787
+ path: _path + ".username",
1788
+ expected: "undefined",
1789
+ value: input.username
1790
+ }, _errorFactory)) && ("string" === typeof input.license_key || $guard(_exceptionable, {
1791
+ path: _path + ".license_key",
1792
+ expected: "string",
1793
+ value: input.license_key
1794
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
1795
+ path: _path + ".hardware_id",
1796
+ expected: "string",
1797
+ value: input.hardware_id
1798
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
1799
+ path: _path + ".product",
1800
+ expected: "string",
1801
+ value: input.product
1802
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
1803
+ path: _path + ".bundle_code",
1804
+ expected: "(string | undefined)",
1805
+ value: input.bundle_code
1806
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
1807
+ path: _path + ".license_id",
1808
+ expected: "(number | undefined)",
1809
+ value: input.license_id
1810
+ }, _errorFactory)); const $ao1 = (input, _path, _exceptionable = true) => (null !== input.license_key || $guard(_exceptionable, {
1811
+ path: _path + ".license_key",
1812
+ expected: "undefined",
1813
+ value: input.license_key
1814
+ }, _errorFactory)) && (undefined === input.license_key || $guard(_exceptionable, {
1815
+ path: _path + ".license_key",
1816
+ expected: "undefined",
1817
+ value: input.license_key
1818
+ }, _errorFactory)) && ("string" === typeof input.username || $guard(_exceptionable, {
1819
+ path: _path + ".username",
1820
+ expected: "string",
1821
+ value: input.username
1822
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
1823
+ path: _path + ".hardware_id",
1824
+ expected: "string",
1825
+ value: input.hardware_id
1826
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
1827
+ path: _path + ".product",
1828
+ expected: "string",
1829
+ value: input.product
1830
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
1831
+ path: _path + ".bundle_code",
1832
+ expected: "(string | undefined)",
1833
+ value: input.bundle_code
1834
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
1835
+ path: _path + ".license_id",
1836
+ expected: "(number | undefined)",
1837
+ value: input.license_id
1838
+ }, _errorFactory)); const $au0 = (input, _path, _exceptionable = true) => (() => {
1839
+ if ("string" === typeof input.username)
1840
+ return $ao1(input, _path, true && _exceptionable);
1841
+ else if ("string" === typeof input.license_key)
1842
+ return $ao0(input, _path, true && _exceptionable);
1843
+ else
1844
+ return $guard(_exceptionable, {
1845
+ path: _path,
1846
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired)",
1847
+ value: input
1848
+ }, _errorFactory);
1849
+ })(); const __is = input => "object" === typeof input && null !== input && $iu0(input); let _errorFactory; return (input, errorFactory) => {
1850
+ if (false === __is(input)) {
1851
+ _errorFactory = errorFactory;
1852
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
1853
+ path: _path + "",
1854
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired)",
1855
+ value: input
1856
+ }, _errorFactory)) && $au0(input, _path + "", true) || $guard(true, {
1857
+ path: _path + "",
1858
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired)",
1859
+ value: input
1860
+ }, _errorFactory))(input, "$input", true);
1861
+ }
1862
+ return input;
1863
+ }; })()(payload);
1864
+ const { headers, response } = yield this.service.getRequest('get_device_variables', payload);
1865
+ (0, common_1.checkSignatureV2)(this.config.publicKey, response, (0, common_1.getHeaderString)(headers, 'LicenseSignature'));
1866
+ return response;
1867
+ });
1868
+ }
1869
+ ;
1870
+ trackDeviceVariables(payload) {
1871
+ return __awaiter(this, void 0, void 0, function* () {
1872
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => null !== input.username && undefined === input.username && "string" === typeof input.license_key && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id); const $io1 = input => null !== input.license_key && undefined === input.license_key && "string" === typeof input.username && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id); const $iu0 = input => (() => {
1873
+ if ("string" === typeof input.username)
1874
+ return $io1(input);
1875
+ else if ("string" === typeof input.license_key)
1876
+ return $io0(input);
1877
+ else
1878
+ return false;
1879
+ })(); const $ao0 = (input, _path, _exceptionable = true) => (null !== input.username || $guard(_exceptionable, {
1880
+ path: _path + ".username",
1881
+ expected: "undefined",
1882
+ value: input.username
1883
+ }, _errorFactory)) && (undefined === input.username || $guard(_exceptionable, {
1884
+ path: _path + ".username",
1885
+ expected: "undefined",
1886
+ value: input.username
1887
+ }, _errorFactory)) && ("string" === typeof input.license_key || $guard(_exceptionable, {
1888
+ path: _path + ".license_key",
1889
+ expected: "string",
1890
+ value: input.license_key
1891
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
1892
+ path: _path + ".hardware_id",
1893
+ expected: "string",
1894
+ value: input.hardware_id
1895
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
1896
+ path: _path + ".product",
1897
+ expected: "string",
1898
+ value: input.product
1899
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
1900
+ path: _path + ".bundle_code",
1901
+ expected: "(string | undefined)",
1902
+ value: input.bundle_code
1903
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
1904
+ path: _path + ".license_id",
1905
+ expected: "(number | undefined)",
1906
+ value: input.license_id
1907
+ }, _errorFactory)); const $ao1 = (input, _path, _exceptionable = true) => (null !== input.license_key || $guard(_exceptionable, {
1908
+ path: _path + ".license_key",
1909
+ expected: "undefined",
1910
+ value: input.license_key
1911
+ }, _errorFactory)) && (undefined === input.license_key || $guard(_exceptionable, {
1912
+ path: _path + ".license_key",
1913
+ expected: "undefined",
1914
+ value: input.license_key
1915
+ }, _errorFactory)) && ("string" === typeof input.username || $guard(_exceptionable, {
1916
+ path: _path + ".username",
1917
+ expected: "string",
1918
+ value: input.username
1919
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
1920
+ path: _path + ".hardware_id",
1921
+ expected: "string",
1922
+ value: input.hardware_id
1923
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
1924
+ path: _path + ".product",
1925
+ expected: "string",
1926
+ value: input.product
1927
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
1928
+ path: _path + ".bundle_code",
1929
+ expected: "(string | undefined)",
1930
+ value: input.bundle_code
1931
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
1932
+ path: _path + ".license_id",
1933
+ expected: "(number | undefined)",
1934
+ value: input.license_id
1935
+ }, _errorFactory)); const $au0 = (input, _path, _exceptionable = true) => (() => {
1936
+ if ("string" === typeof input.username)
1937
+ return $ao1(input, _path, true && _exceptionable);
1938
+ else if ("string" === typeof input.license_key)
1939
+ return $ao0(input, _path, true && _exceptionable);
1940
+ else
1941
+ return $guard(_exceptionable, {
1942
+ path: _path,
1943
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired)",
1944
+ value: input
1945
+ }, _errorFactory);
1946
+ })(); const __is = input => "object" === typeof input && null !== input && $iu0(input); let _errorFactory; return (input, errorFactory) => {
1947
+ if (false === __is(input)) {
1948
+ _errorFactory = errorFactory;
1949
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
1950
+ path: _path + "",
1951
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired)",
1952
+ value: input
1953
+ }, _errorFactory)) && $au0(input, _path + "", true) || $guard(true, {
1954
+ path: _path + "",
1955
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired)",
1956
+ value: input
1957
+ }, _errorFactory))(input, "$input", true);
1958
+ }
1959
+ return input;
1960
+ }; })()(payload);
1961
+ const { headers, response } = yield this.service.postRequest('track_device_variables', payload);
1962
+ (0, common_1.checkSignatureV2)(this.config.publicKey, response, (0, common_1.getHeaderString)(headers, 'LicenseSignature'));
1963
+ return response;
1964
+ });
1965
+ }
1966
+ ;
1967
+ floatingBorrow(payload) {
1968
+ return __awaiter(this, void 0, void 0, function* () {
1969
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => null !== input.username && undefined === input.username && "string" === typeof input.license_key && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id) && "string" === typeof input.borrowed_until; const $io1 = input => null !== input.license_key && undefined === input.license_key && "string" === typeof input.username && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id) && "string" === typeof input.borrowed_until; const $iu0 = input => (() => {
1970
+ if ("string" === typeof input.username)
1971
+ return $io1(input);
1972
+ else if ("string" === typeof input.license_key)
1973
+ return $io0(input);
1974
+ else
1975
+ return false;
1976
+ })(); const $ao0 = (input, _path, _exceptionable = true) => (null !== input.username || $guard(_exceptionable, {
1977
+ path: _path + ".username",
1978
+ expected: "undefined",
1979
+ value: input.username
1980
+ }, _errorFactory)) && (undefined === input.username || $guard(_exceptionable, {
1981
+ path: _path + ".username",
1982
+ expected: "undefined",
1983
+ value: input.username
1984
+ }, _errorFactory)) && ("string" === typeof input.license_key || $guard(_exceptionable, {
1985
+ path: _path + ".license_key",
1986
+ expected: "string",
1987
+ value: input.license_key
1988
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
1989
+ path: _path + ".hardware_id",
1990
+ expected: "string",
1991
+ value: input.hardware_id
1992
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
1993
+ path: _path + ".product",
1994
+ expected: "string",
1995
+ value: input.product
1996
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
1997
+ path: _path + ".bundle_code",
1998
+ expected: "(string | undefined)",
1999
+ value: input.bundle_code
2000
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
2001
+ path: _path + ".license_id",
2002
+ expected: "(number | undefined)",
2003
+ value: input.license_id
2004
+ }, _errorFactory)) && ("string" === typeof input.borrowed_until || $guard(_exceptionable, {
2005
+ path: _path + ".borrowed_until",
2006
+ expected: "string",
2007
+ value: input.borrowed_until
2008
+ }, _errorFactory)); const $ao1 = (input, _path, _exceptionable = true) => (null !== input.license_key || $guard(_exceptionable, {
2009
+ path: _path + ".license_key",
2010
+ expected: "undefined",
2011
+ value: input.license_key
2012
+ }, _errorFactory)) && (undefined === input.license_key || $guard(_exceptionable, {
2013
+ path: _path + ".license_key",
2014
+ expected: "undefined",
2015
+ value: input.license_key
2016
+ }, _errorFactory)) && ("string" === typeof input.username || $guard(_exceptionable, {
2017
+ path: _path + ".username",
2018
+ expected: "string",
2019
+ value: input.username
2020
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
2021
+ path: _path + ".hardware_id",
2022
+ expected: "string",
2023
+ value: input.hardware_id
2024
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
2025
+ path: _path + ".product",
2026
+ expected: "string",
2027
+ value: input.product
2028
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
2029
+ path: _path + ".bundle_code",
2030
+ expected: "(string | undefined)",
2031
+ value: input.bundle_code
2032
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
2033
+ path: _path + ".license_id",
2034
+ expected: "(number | undefined)",
2035
+ value: input.license_id
2036
+ }, _errorFactory)) && ("string" === typeof input.borrowed_until || $guard(_exceptionable, {
2037
+ path: _path + ".borrowed_until",
2038
+ expected: "string",
2039
+ value: input.borrowed_until
2040
+ }, _errorFactory)); const $au0 = (input, _path, _exceptionable = true) => (() => {
2041
+ if ("string" === typeof input.username)
2042
+ return $ao1(input, _path, true && _exceptionable);
2043
+ else if ("string" === typeof input.license_key)
2044
+ return $ao0(input, _path, true && _exceptionable);
2045
+ else
2046
+ return $guard(_exceptionable, {
2047
+ path: _path,
2048
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired & { borrowed_until: string; } | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired & { borrowed_until: string; })",
2049
+ value: input
2050
+ }, _errorFactory);
2051
+ })(); const __is = input => "object" === typeof input && null !== input && $iu0(input); let _errorFactory; return (input, errorFactory) => {
2052
+ if (false === __is(input)) {
2053
+ _errorFactory = errorFactory;
2054
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
2055
+ path: _path + "",
2056
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired & { borrowed_until: string; } | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired & { borrowed_until: string; })",
2057
+ value: input
2058
+ }, _errorFactory)) && $au0(input, _path + "", true) || $guard(true, {
2059
+ path: _path + "",
2060
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired & { borrowed_until: string; } | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired & { borrowed_until: string; })",
2061
+ value: input
2062
+ }, _errorFactory))(input, "$input", true);
2063
+ }
2064
+ return input;
2065
+ }; })()(payload);
2066
+ const { headers, response } = yield this.service.postRequest('floating/borrow', payload);
2067
+ (0, common_1.checkSignatureV2)(this.config.publicKey, response, (0, common_1.getHeaderString)(headers, 'LicenseSignature'));
2068
+ return response;
2069
+ });
2070
+ }
2071
+ ;
2072
+ floatingRelease(payload) {
2073
+ return __awaiter(this, void 0, void 0, function* () {
2074
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => null !== input.username && undefined === input.username && "string" === typeof input.license_key && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id); const $io1 = input => null !== input.license_key && undefined === input.license_key && "string" === typeof input.username && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id); const $iu0 = input => (() => {
2075
+ if ("string" === typeof input.username)
2076
+ return $io1(input);
2077
+ else if ("string" === typeof input.license_key)
2078
+ return $io0(input);
2079
+ else
2080
+ return false;
2081
+ })(); const $ao0 = (input, _path, _exceptionable = true) => (null !== input.username || $guard(_exceptionable, {
2082
+ path: _path + ".username",
2083
+ expected: "undefined",
2084
+ value: input.username
2085
+ }, _errorFactory)) && (undefined === input.username || $guard(_exceptionable, {
2086
+ path: _path + ".username",
2087
+ expected: "undefined",
2088
+ value: input.username
2089
+ }, _errorFactory)) && ("string" === typeof input.license_key || $guard(_exceptionable, {
2090
+ path: _path + ".license_key",
2091
+ expected: "string",
2092
+ value: input.license_key
2093
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
2094
+ path: _path + ".hardware_id",
2095
+ expected: "string",
2096
+ value: input.hardware_id
2097
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
2098
+ path: _path + ".product",
2099
+ expected: "string",
2100
+ value: input.product
2101
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
2102
+ path: _path + ".bundle_code",
2103
+ expected: "(string | undefined)",
2104
+ value: input.bundle_code
2105
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
2106
+ path: _path + ".license_id",
2107
+ expected: "(number | undefined)",
2108
+ value: input.license_id
2109
+ }, _errorFactory)); const $ao1 = (input, _path, _exceptionable = true) => (null !== input.license_key || $guard(_exceptionable, {
2110
+ path: _path + ".license_key",
2111
+ expected: "undefined",
2112
+ value: input.license_key
2113
+ }, _errorFactory)) && (undefined === input.license_key || $guard(_exceptionable, {
2114
+ path: _path + ".license_key",
2115
+ expected: "undefined",
2116
+ value: input.license_key
2117
+ }, _errorFactory)) && ("string" === typeof input.username || $guard(_exceptionable, {
2118
+ path: _path + ".username",
2119
+ expected: "string",
2120
+ value: input.username
2121
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
2122
+ path: _path + ".hardware_id",
2123
+ expected: "string",
2124
+ value: input.hardware_id
2125
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
2126
+ path: _path + ".product",
2127
+ expected: "string",
2128
+ value: input.product
2129
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
2130
+ path: _path + ".bundle_code",
2131
+ expected: "(string | undefined)",
2132
+ value: input.bundle_code
2133
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
2134
+ path: _path + ".license_id",
2135
+ expected: "(number | undefined)",
2136
+ value: input.license_id
2137
+ }, _errorFactory)); const $au0 = (input, _path, _exceptionable = true) => (() => {
2138
+ if ("string" === typeof input.username)
2139
+ return $ao1(input, _path, true && _exceptionable);
2140
+ else if ("string" === typeof input.license_key)
2141
+ return $ao0(input, _path, true && _exceptionable);
2142
+ else
2143
+ return $guard(_exceptionable, {
2144
+ path: _path,
2145
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired)",
2146
+ value: input
2147
+ }, _errorFactory);
2148
+ })(); const __is = input => "object" === typeof input && null !== input && $iu0(input); let _errorFactory; return (input, errorFactory) => {
2149
+ if (false === __is(input)) {
2150
+ _errorFactory = errorFactory;
2151
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
2152
+ path: _path + "",
2153
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired)",
2154
+ value: input
2155
+ }, _errorFactory)) && $au0(input, _path + "", true) || $guard(true, {
2156
+ path: _path + "",
2157
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired)",
2158
+ value: input
2159
+ }, _errorFactory))(input, "$input", true);
2160
+ }
2161
+ return input;
2162
+ }; })()(payload);
2163
+ const { response } = yield this.service.postRequest('floating/release', payload);
2164
+ return (0, common_1.assertResponseString)(response, '');
2165
+ });
2166
+ }
2167
+ ;
2168
+ changePassword(payload) {
2169
+ return __awaiter(this, void 0, void 0, function* () {
2170
+ (() => { 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, {
2171
+ path: _path + ".username",
2172
+ expected: "string",
2173
+ value: input.username
2174
+ }, _errorFactory)) && ("string" === typeof input.password || $guard(_exceptionable, {
2175
+ path: _path + ".password",
2176
+ expected: "string",
2177
+ value: input.password
2178
+ }, _errorFactory)) && ("string" === typeof input.new_password || $guard(_exceptionable, {
2179
+ path: _path + ".new_password",
2180
+ expected: "string",
2181
+ value: input.new_password
2182
+ }, _errorFactory)); const __is = input => "object" === typeof input && null !== input && $io0(input); let _errorFactory; return (input, errorFactory) => {
2183
+ if (false === __is(input)) {
2184
+ _errorFactory = errorFactory;
2185
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
2186
+ path: _path + "",
2187
+ expected: "PasswordChangePayload",
2188
+ value: input
2189
+ }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
2190
+ path: _path + "",
2191
+ expected: "PasswordChangePayload",
2192
+ value: input
2193
+ }, _errorFactory))(input, "$input", true);
2194
+ }
2195
+ return input;
2196
+ }; })()(payload);
2197
+ const { response } = yield this.service.postRequest('change_password', payload);
2198
+ return (0, common_1.assertResponseString)(response, 'password_changed');
2199
+ });
2200
+ }
2201
+ ;
2202
+ getVersions(payload) {
2203
+ return __awaiter(this, void 0, void 0, function* () {
2204
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => null !== input.username && undefined === input.username && "string" === typeof input.license_key && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id); const $io1 = input => null !== input.license_key && undefined === input.license_key && "string" === typeof input.username && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id); const $iu0 = input => (() => {
2205
+ if ("string" === typeof input.username)
2206
+ return $io1(input);
2207
+ else if ("string" === typeof input.license_key)
2208
+ return $io0(input);
2209
+ else
2210
+ return false;
2211
+ })(); const $ao0 = (input, _path, _exceptionable = true) => (null !== input.username || $guard(_exceptionable, {
2212
+ path: _path + ".username",
2213
+ expected: "undefined",
2214
+ value: input.username
2215
+ }, _errorFactory)) && (undefined === input.username || $guard(_exceptionable, {
2216
+ path: _path + ".username",
2217
+ expected: "undefined",
2218
+ value: input.username
2219
+ }, _errorFactory)) && ("string" === typeof input.license_key || $guard(_exceptionable, {
2220
+ path: _path + ".license_key",
2221
+ expected: "string",
2222
+ value: input.license_key
2223
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
2224
+ path: _path + ".hardware_id",
2225
+ expected: "string",
2226
+ value: input.hardware_id
2227
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
2228
+ path: _path + ".product",
2229
+ expected: "string",
2230
+ value: input.product
2231
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
2232
+ path: _path + ".bundle_code",
2233
+ expected: "(string | undefined)",
2234
+ value: input.bundle_code
2235
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
2236
+ path: _path + ".license_id",
2237
+ expected: "(number | undefined)",
2238
+ value: input.license_id
2239
+ }, _errorFactory)); const $ao1 = (input, _path, _exceptionable = true) => (null !== input.license_key || $guard(_exceptionable, {
2240
+ path: _path + ".license_key",
2241
+ expected: "undefined",
2242
+ value: input.license_key
2243
+ }, _errorFactory)) && (undefined === input.license_key || $guard(_exceptionable, {
2244
+ path: _path + ".license_key",
2245
+ expected: "undefined",
2246
+ value: input.license_key
2247
+ }, _errorFactory)) && ("string" === typeof input.username || $guard(_exceptionable, {
2248
+ path: _path + ".username",
2249
+ expected: "string",
2250
+ value: input.username
2251
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
2252
+ path: _path + ".hardware_id",
2253
+ expected: "string",
2254
+ value: input.hardware_id
2255
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
2256
+ path: _path + ".product",
2257
+ expected: "string",
2258
+ value: input.product
2259
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
2260
+ path: _path + ".bundle_code",
2261
+ expected: "(string | undefined)",
2262
+ value: input.bundle_code
2263
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
2264
+ path: _path + ".license_id",
2265
+ expected: "(number | undefined)",
2266
+ value: input.license_id
2267
+ }, _errorFactory)); const $au0 = (input, _path, _exceptionable = true) => (() => {
2268
+ if ("string" === typeof input.username)
2269
+ return $ao1(input, _path, true && _exceptionable);
2270
+ else if ("string" === typeof input.license_key)
2271
+ return $ao0(input, _path, true && _exceptionable);
2272
+ else
2273
+ return $guard(_exceptionable, {
2274
+ path: _path,
2275
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired)",
2276
+ value: input
2277
+ }, _errorFactory);
2278
+ })(); const __is = input => "object" === typeof input && null !== input && $iu0(input); let _errorFactory; return (input, errorFactory) => {
2279
+ if (false === __is(input)) {
2280
+ _errorFactory = errorFactory;
2281
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
2282
+ path: _path + "",
2283
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired)",
2284
+ value: input
2285
+ }, _errorFactory)) && $au0(input, _path + "", true) || $guard(true, {
2286
+ path: _path + "",
2287
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired)",
2288
+ value: input
2289
+ }, _errorFactory))(input, "$input", true);
2290
+ }
2291
+ return input;
2292
+ }; })()(payload);
2293
+ const { headers, response } = yield this.service.getRequest('versions', payload);
2294
+ (0, common_1.checkSignatureV2)(this.config.publicKey, response, (0, common_1.getHeaderString)(headers, 'LicenseSignature'));
2295
+ return response;
2296
+ });
2297
+ }
2298
+ ;
2299
+ getInstallationFile(payload) {
2300
+ return __awaiter(this, void 0, void 0, function* () {
2301
+ (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => null !== input.username && undefined === input.username && "string" === typeof input.license_key && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id) && "string" === typeof input.env && "string" === typeof input.channel && "string" === typeof input.version; const $io1 = input => null !== input.license_key && undefined === input.license_key && "string" === typeof input.username && "string" === typeof input.hardware_id && "string" === typeof input.product && (undefined === input.bundle_code || "string" === typeof input.bundle_code) && (undefined === input.license_id || "number" === typeof input.license_id) && "string" === typeof input.env && "string" === typeof input.channel && "string" === typeof input.version; const $iu0 = input => (() => {
2302
+ if ("string" === typeof input.username)
2303
+ return $io1(input);
2304
+ else if ("string" === typeof input.license_key)
2305
+ return $io0(input);
2306
+ else
2307
+ return false;
2308
+ })(); const $ao0 = (input, _path, _exceptionable = true) => (null !== input.username || $guard(_exceptionable, {
2309
+ path: _path + ".username",
2310
+ expected: "undefined",
2311
+ value: input.username
2312
+ }, _errorFactory)) && (undefined === input.username || $guard(_exceptionable, {
2313
+ path: _path + ".username",
2314
+ expected: "undefined",
2315
+ value: input.username
2316
+ }, _errorFactory)) && ("string" === typeof input.license_key || $guard(_exceptionable, {
2317
+ path: _path + ".license_key",
2318
+ expected: "string",
2319
+ value: input.license_key
2320
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
2321
+ path: _path + ".hardware_id",
2322
+ expected: "string",
2323
+ value: input.hardware_id
2324
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
2325
+ path: _path + ".product",
2326
+ expected: "string",
2327
+ value: input.product
2328
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
2329
+ path: _path + ".bundle_code",
2330
+ expected: "(string | undefined)",
2331
+ value: input.bundle_code
2332
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
2333
+ path: _path + ".license_id",
2334
+ expected: "(number | undefined)",
2335
+ value: input.license_id
2336
+ }, _errorFactory)) && ("string" === typeof input.env || $guard(_exceptionable, {
2337
+ path: _path + ".env",
2338
+ expected: "string",
2339
+ value: input.env
2340
+ }, _errorFactory)) && ("string" === typeof input.channel || $guard(_exceptionable, {
2341
+ path: _path + ".channel",
2342
+ expected: "string",
2343
+ value: input.channel
2344
+ }, _errorFactory)) && ("string" === typeof input.version || $guard(_exceptionable, {
2345
+ path: _path + ".version",
2346
+ expected: "string",
2347
+ value: input.version
2348
+ }, _errorFactory)); const $ao1 = (input, _path, _exceptionable = true) => (null !== input.license_key || $guard(_exceptionable, {
2349
+ path: _path + ".license_key",
2350
+ expected: "undefined",
2351
+ value: input.license_key
2352
+ }, _errorFactory)) && (undefined === input.license_key || $guard(_exceptionable, {
2353
+ path: _path + ".license_key",
2354
+ expected: "undefined",
2355
+ value: input.license_key
2356
+ }, _errorFactory)) && ("string" === typeof input.username || $guard(_exceptionable, {
2357
+ path: _path + ".username",
2358
+ expected: "string",
2359
+ value: input.username
2360
+ }, _errorFactory)) && ("string" === typeof input.hardware_id || $guard(_exceptionable, {
2361
+ path: _path + ".hardware_id",
2362
+ expected: "string",
2363
+ value: input.hardware_id
2364
+ }, _errorFactory)) && ("string" === typeof input.product || $guard(_exceptionable, {
2365
+ path: _path + ".product",
2366
+ expected: "string",
2367
+ value: input.product
2368
+ }, _errorFactory)) && (undefined === input.bundle_code || "string" === typeof input.bundle_code || $guard(_exceptionable, {
2369
+ path: _path + ".bundle_code",
2370
+ expected: "(string | undefined)",
2371
+ value: input.bundle_code
2372
+ }, _errorFactory)) && (undefined === input.license_id || "number" === typeof input.license_id || $guard(_exceptionable, {
2373
+ path: _path + ".license_id",
2374
+ expected: "(number | undefined)",
2375
+ value: input.license_id
2376
+ }, _errorFactory)) && ("string" === typeof input.env || $guard(_exceptionable, {
2377
+ path: _path + ".env",
2378
+ expected: "string",
2379
+ value: input.env
2380
+ }, _errorFactory)) && ("string" === typeof input.channel || $guard(_exceptionable, {
2381
+ path: _path + ".channel",
2382
+ expected: "string",
2383
+ value: input.channel
2384
+ }, _errorFactory)) && ("string" === typeof input.version || $guard(_exceptionable, {
2385
+ path: _path + ".version",
2386
+ expected: "string",
2387
+ value: input.version
2388
+ }, _errorFactory)); const $au0 = (input, _path, _exceptionable = true) => (() => {
2389
+ if ("string" === typeof input.username)
2390
+ return $ao1(input, _path, true && _exceptionable);
2391
+ else if ("string" === typeof input.license_key)
2392
+ return $ao0(input, _path, true && _exceptionable);
2393
+ else
2394
+ return $guard(_exceptionable, {
2395
+ path: _path,
2396
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired & { env: string; channel: string; version: string; } | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired & { env: string; channel: string; version: string; })",
2397
+ value: input
2398
+ }, _errorFactory);
2399
+ })(); const __is = input => "object" === typeof input && null !== input && $iu0(input); let _errorFactory; return (input, errorFactory) => {
2400
+ if (false === __is(input)) {
2401
+ _errorFactory = errorFactory;
2402
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
2403
+ path: _path + "",
2404
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired & { env: string; channel: string; version: string; } | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired & { env: string; channel: string; version: string; })",
2405
+ value: input
2406
+ }, _errorFactory)) && $au0(input, _path + "", true) || $guard(true, {
2407
+ path: _path + "",
2408
+ expected: "({ license_key?: undefined; username: string; } & LicenseIdentificatiorRequired & { env: string; channel: string; version: string; } | { username?: undefined; license_key: string; } & LicenseIdentificatiorRequired & { env: string; channel: string; version: string; })",
2409
+ value: input
2410
+ }, _errorFactory))(input, "$input", true);
2411
+ }
2412
+ return input;
2413
+ }; })()(payload);
2414
+ const { headers, response } = yield this.service.getRequest('installation_file', payload);
2415
+ (0, common_1.checkSignatureV2)(this.config.publicKey, response, (0, common_1.getHeaderString)(headers, 'LicenseSignature'));
2416
+ return response;
2417
+ });
2418
+ }
2419
+ ;
2420
+ getSSOUrl(payload) {
2421
+ return __awaiter(this, void 0, void 0, function* () {
2422
+ (() => { 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, {
2423
+ path: _path + ".product",
2424
+ expected: "string",
2425
+ value: input.product
2426
+ }, _errorFactory)) && ("code" === input.type || "token" === input.type || $guard(_exceptionable, {
2427
+ path: _path + ".type",
2428
+ expected: "(\"code\" | \"token\")",
2429
+ value: input.type
2430
+ }, _errorFactory)); const __is = input => "object" === typeof input && null !== input && $io0(input); let _errorFactory; return (input, errorFactory) => {
2431
+ if (false === __is(input)) {
2432
+ _errorFactory = errorFactory;
2433
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
2434
+ path: _path + "",
2435
+ expected: "SSOURLParams",
2436
+ value: input
2437
+ }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
2438
+ path: _path + "",
2439
+ expected: "SSOURLParams",
2440
+ value: input
2441
+ }, _errorFactory))(input, "$input", true);
2442
+ }
2443
+ return input;
2444
+ }; })()(payload);
2445
+ const { headers, response } = yield this.service.getRequest('sso_url', payload);
2446
+ (0, common_1.checkSignatureV2)(this.config.publicKey, response, (0, common_1.getHeaderString)(headers, 'LicenseSignature'));
2447
+ return response;
2448
+ });
2449
+ }
2450
+ ;
2451
+ getAirGapActivationCode(initializationCode, licenseKey) {
2452
+ const message = String(this.getHardwareID()) + licenseKey;
2453
+ const decodedKey = Buffer.from(initializationCode, 'base64');
2454
+ const oldHash = elliptic.curves.p256.hash;
2455
+ elliptic.curves.p256.hash = hash_js_1.sha1;
2456
+ const ec = new elliptic.ec('p256');
2457
+ const privateKey = decodedKey.toString('hex');
2458
+ const keyPair = ec.keyFromPrivate(privateKey);
2459
+ const hash = crypto.createHash('sha1').update(message).digest();
2460
+ const signature = keyPair.sign(hash, { canonical: false });
2461
+ const { r, s } = signature;
2462
+ const degree = ec.curve.n.bitLength();
2463
+ const bnLen = Math.ceil(degree / 8);
2464
+ const rBytes = r.toArrayLike(Buffer, 'be', bnLen);
2465
+ const sBytes = s.toArrayLike(Buffer, 'be', bnLen);
2466
+ const buffer = Buffer.concat([Buffer.from(rBytes), Buffer.from(sBytes)]);
2467
+ elliptic.curves.p256.hash = oldHash;
2468
+ return buffer.toString('base64');
2469
+ }
2470
+ verifyConfirmationCode(confirmationCode, licenseKey, policyId) {
2471
+ var _a;
2472
+ const message = `${this.getHardwareID()}${licenseKey}${policyId !== null && policyId !== void 0 ? policyId : ''}`;
2473
+ const decodedKey = Buffer.from((_a = this.config.airGapKey) !== null && _a !== void 0 ? _a : '', 'base64');
2474
+ const hexKey = decodedKey.toString('hex');
2475
+ const gx = hexKey.slice(0, 64);
2476
+ const gy = hexKey.slice(64);
2477
+ const oldHash = elliptic.curves.p256.hash;
2478
+ elliptic.curves.p256.hash = hash_js_1.sha256;
2479
+ const ec = new elliptic.ec('p256');
2480
+ const key = ec.keyFromPublic({ x: gx, y: gy }, 'hex');
2481
+ const decodedSignature = Buffer.from(confirmationCode, 'base64');
2482
+ const r = decodedSignature.subarray(0, 32).toString('hex');
2483
+ const s = decodedSignature.subarray(32, 64).toString('hex');
2484
+ const digest = crypto.createHash('sha256').update(message).digest();
2485
+ const signatureObj = { r: r, s: s };
2486
+ const isValid = key.verify(digest, signatureObj);
2487
+ elliptic.curves.p256.hash = oldHash;
2488
+ return isValid;
2489
+ }
2490
+ checkGuard(offlineData, licenseKey) {
2491
+ if ((0, dayjs_1.default)(offlineData.guard.date_created).utc().isAfter((0, dayjs_1.default)().utc())) {
2492
+ throw { status: 500, code: 'offline_activation_error', message: 'Activation data invalid date' };
2493
+ }
2494
+ if (offlineData.guard.id != licenseKey) {
2495
+ throw { status: 500, code: 'offline_activation_error', message: 'Activation data invalid ID' };
2496
+ }
2497
+ if (offlineData.guard.device_id != this.getHardwareID()) {
2498
+ throw { status: 500, code: 'offline_activation_error', message: 'Activation data invalid hardware ID' };
2499
+ }
2500
+ return true;
2501
+ }
2502
+ activateAirgappedLicense(activationPayload, licenseKey, policyId) {
2503
+ const payloadString = Buffer.from(activationPayload.data.trim(), 'base64').toString();
2504
+ const payloadObject = JSON.parse(payloadString);
2505
+ if (payloadObject.id != policyId) {
2506
+ throw { status: 400, code: 'air_gap_activation_error', message: 'Policy file ID mismatch' };
2507
+ }
2508
+ if (activationPayload.isGuardFileEnabled) {
2509
+ this.checkGuard(activationPayload.data, licenseKey);
2510
+ }
2511
+ payloadObject.license_key = licenseKey;
2512
+ payloadObject.license_type = payloadObject.default_license_type;
2513
+ payloadObject.policy_id = payloadObject.id;
2514
+ delete payloadObject.default_license_type;
2515
+ delete payloadObject.product;
2516
+ return payloadObject;
2517
+ }
2518
+ createActivationGuard(licenseKey) {
2519
+ const payload = {
2520
+ isActivation: false,
2521
+ isGuardFileEnabled: false,
2522
+ guard: {},
2523
+ data: {
2524
+ id: licenseKey,
2525
+ device_id: this.getHardwareID(),
2526
+ date_created: (0, dayjs_1.default)().utc(),
2527
+ }
2528
+ };
2529
+ return payload;
2530
+ }
2531
+ }
2532
+ exports.default = LicenseAPI;
2533
+ //# sourceMappingURL=api.js.map