@microwiseai/snapshot 0.3.6 → 0.3.27

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 (312) hide show
  1. package/dist/commands/install.d.ts +13 -0
  2. package/dist/commands/install.d.ts.map +1 -1
  3. package/dist/commands/install.js +526 -49
  4. package/dist/commands/install.js.map +1 -1
  5. package/dist/commands/license.d.ts +21 -0
  6. package/dist/commands/license.d.ts.map +1 -0
  7. package/dist/commands/license.js +120 -0
  8. package/dist/commands/license.js.map +1 -0
  9. package/dist/index.js +46 -6
  10. package/dist/index.js.map +1 -1
  11. package/dist/lib/config.d.ts +32 -0
  12. package/dist/lib/config.d.ts.map +1 -1
  13. package/dist/lib/config.js +89 -0
  14. package/dist/lib/config.js.map +1 -1
  15. package/dist/lib/gitlab.d.ts +26 -20
  16. package/dist/lib/gitlab.d.ts.map +1 -1
  17. package/dist/lib/gitlab.js +100 -153
  18. package/dist/lib/gitlab.js.map +1 -1
  19. package/dist/lib/package-resolver.d.ts +48 -0
  20. package/dist/lib/package-resolver.d.ts.map +1 -0
  21. package/dist/lib/package-resolver.js +178 -0
  22. package/dist/lib/package-resolver.js.map +1 -0
  23. package/dist/lib/skit-adapter.d.ts +56 -0
  24. package/dist/lib/skit-adapter.d.ts.map +1 -0
  25. package/dist/lib/skit-adapter.js +166 -0
  26. package/dist/lib/skit-adapter.js.map +1 -0
  27. package/dist/lib/transitive-resolver.d.ts +86 -0
  28. package/dist/lib/transitive-resolver.d.ts.map +1 -0
  29. package/dist/lib/transitive-resolver.js +431 -0
  30. package/dist/lib/transitive-resolver.js.map +1 -0
  31. package/dist/lib/types.d.ts +6 -0
  32. package/dist/lib/types.d.ts.map +1 -1
  33. package/dist/lib.d.ts +59 -0
  34. package/dist/lib.d.ts.map +1 -0
  35. package/dist/lib.js +134 -0
  36. package/dist/lib.js.map +1 -0
  37. package/dist/tools/snapshot-to-license.d.ts +13 -0
  38. package/dist/tools/snapshot-to-license.d.ts.map +1 -0
  39. package/dist/tools/snapshot-to-license.js +105 -0
  40. package/dist/tools/snapshot-to-license.js.map +1 -0
  41. package/node_modules/@microwiseai/cache/README.md +143 -0
  42. package/node_modules/@microwiseai/cache/dist/file.d.ts +97 -0
  43. package/node_modules/@microwiseai/cache/dist/file.d.ts.map +1 -0
  44. package/node_modules/@microwiseai/cache/dist/file.js +256 -0
  45. package/node_modules/@microwiseai/cache/dist/file.js.map +1 -0
  46. package/node_modules/@microwiseai/cache/dist/index.d.ts +10 -0
  47. package/node_modules/@microwiseai/cache/dist/index.d.ts.map +1 -0
  48. package/node_modules/@microwiseai/cache/dist/index.js +11 -0
  49. package/node_modules/@microwiseai/cache/dist/index.js.map +1 -0
  50. package/node_modules/@microwiseai/cache/dist/memory.d.ts +69 -0
  51. package/node_modules/@microwiseai/cache/dist/memory.d.ts.map +1 -0
  52. package/node_modules/@microwiseai/cache/dist/memory.js +152 -0
  53. package/node_modules/@microwiseai/cache/dist/memory.js.map +1 -0
  54. package/node_modules/@microwiseai/cache/dist/types.d.ts +76 -0
  55. package/node_modules/@microwiseai/cache/dist/types.d.ts.map +1 -0
  56. package/node_modules/@microwiseai/cache/dist/types.js +5 -0
  57. package/node_modules/@microwiseai/cache/dist/types.js.map +1 -0
  58. package/node_modules/@microwiseai/cache/package.json +40 -0
  59. package/node_modules/@microwiseai/import-telemetry/dist/__tests__/detector.test.d.ts +7 -0
  60. package/node_modules/@microwiseai/import-telemetry/dist/__tests__/detector.test.d.ts.map +1 -0
  61. package/node_modules/@microwiseai/import-telemetry/dist/__tests__/detector.test.js +139 -0
  62. package/node_modules/@microwiseai/import-telemetry/dist/__tests__/detector.test.js.map +1 -0
  63. package/node_modules/@microwiseai/import-telemetry/dist/__tests__/reporter.test.d.ts +8 -0
  64. package/node_modules/@microwiseai/import-telemetry/dist/__tests__/reporter.test.d.ts.map +1 -0
  65. package/node_modules/@microwiseai/import-telemetry/dist/__tests__/reporter.test.js +195 -0
  66. package/node_modules/@microwiseai/import-telemetry/dist/__tests__/reporter.test.js.map +1 -0
  67. package/node_modules/@microwiseai/import-telemetry/dist/__tests__/types.test.d.ts +8 -0
  68. package/node_modules/@microwiseai/import-telemetry/dist/__tests__/types.test.d.ts.map +1 -0
  69. package/node_modules/@microwiseai/import-telemetry/dist/__tests__/types.test.js +97 -0
  70. package/node_modules/@microwiseai/import-telemetry/dist/__tests__/types.test.js.map +1 -0
  71. package/node_modules/@microwiseai/import-telemetry/dist/detector.d.ts +16 -0
  72. package/node_modules/@microwiseai/import-telemetry/dist/detector.d.ts.map +1 -0
  73. package/node_modules/@microwiseai/import-telemetry/dist/detector.js +103 -0
  74. package/node_modules/@microwiseai/import-telemetry/dist/detector.js.map +1 -0
  75. package/node_modules/@microwiseai/import-telemetry/dist/index.d.ts +48 -0
  76. package/node_modules/@microwiseai/import-telemetry/dist/index.d.ts.map +1 -0
  77. package/node_modules/@microwiseai/import-telemetry/dist/index.js +56 -0
  78. package/node_modules/@microwiseai/import-telemetry/dist/index.js.map +1 -0
  79. package/node_modules/@microwiseai/import-telemetry/dist/reporter.d.ts +16 -0
  80. package/node_modules/@microwiseai/import-telemetry/dist/reporter.d.ts.map +1 -0
  81. package/node_modules/@microwiseai/import-telemetry/dist/reporter.js +147 -0
  82. package/node_modules/@microwiseai/import-telemetry/dist/reporter.js.map +1 -0
  83. package/node_modules/@microwiseai/import-telemetry/dist/types.d.ts +75 -0
  84. package/node_modules/@microwiseai/import-telemetry/dist/types.d.ts.map +1 -0
  85. package/node_modules/@microwiseai/import-telemetry/dist/types.js +23 -0
  86. package/node_modules/@microwiseai/import-telemetry/dist/types.js.map +1 -0
  87. package/node_modules/@microwiseai/import-telemetry/package.json +40 -0
  88. package/node_modules/@microwiseai/license/README.md +157 -0
  89. package/node_modules/@microwiseai/license/dist/api/client.d.ts +37 -0
  90. package/node_modules/@microwiseai/license/dist/api/client.d.ts.map +1 -0
  91. package/node_modules/@microwiseai/license/dist/api/client.js +95 -0
  92. package/node_modules/@microwiseai/license/dist/api/client.js.map +1 -0
  93. package/node_modules/@microwiseai/license/dist/api/endpoints.d.ts +25 -0
  94. package/node_modules/@microwiseai/license/dist/api/endpoints.d.ts.map +1 -0
  95. package/node_modules/@microwiseai/license/dist/api/endpoints.js +101 -0
  96. package/node_modules/@microwiseai/license/dist/api/endpoints.js.map +1 -0
  97. package/node_modules/@microwiseai/license/dist/api/index.d.ts +7 -0
  98. package/node_modules/@microwiseai/license/dist/api/index.d.ts.map +1 -0
  99. package/node_modules/@microwiseai/license/dist/api/index.js +8 -0
  100. package/node_modules/@microwiseai/license/dist/api/index.js.map +1 -0
  101. package/node_modules/@microwiseai/license/dist/cache/file.d.ts +38 -0
  102. package/node_modules/@microwiseai/license/dist/cache/file.d.ts.map +1 -0
  103. package/node_modules/@microwiseai/license/dist/cache/file.js +140 -0
  104. package/node_modules/@microwiseai/license/dist/cache/file.js.map +1 -0
  105. package/node_modules/@microwiseai/license/dist/cache/index.d.ts +7 -0
  106. package/node_modules/@microwiseai/license/dist/cache/index.d.ts.map +1 -0
  107. package/node_modules/@microwiseai/license/dist/cache/index.js +10 -0
  108. package/node_modules/@microwiseai/license/dist/cache/index.js.map +1 -0
  109. package/node_modules/@microwiseai/license/dist/cache/memory.d.ts +35 -0
  110. package/node_modules/@microwiseai/license/dist/cache/memory.d.ts.map +1 -0
  111. package/node_modules/@microwiseai/license/dist/cache/memory.js +77 -0
  112. package/node_modules/@microwiseai/license/dist/cache/memory.js.map +1 -0
  113. package/node_modules/@microwiseai/license/dist/cache/offline.d.ts +29 -0
  114. package/node_modules/@microwiseai/license/dist/cache/offline.d.ts.map +1 -0
  115. package/node_modules/@microwiseai/license/dist/cache/offline.js +58 -0
  116. package/node_modules/@microwiseai/license/dist/cache/offline.js.map +1 -0
  117. package/node_modules/@microwiseai/license/dist/client.d.ts +42 -0
  118. package/node_modules/@microwiseai/license/dist/client.d.ts.map +1 -0
  119. package/node_modules/@microwiseai/license/dist/client.js +83 -0
  120. package/node_modules/@microwiseai/license/dist/client.js.map +1 -0
  121. package/node_modules/@microwiseai/license/dist/config.d.ts +27 -0
  122. package/node_modules/@microwiseai/license/dist/config.d.ts.map +1 -0
  123. package/node_modules/@microwiseai/license/dist/config.js +52 -0
  124. package/node_modules/@microwiseai/license/dist/config.js.map +1 -0
  125. package/node_modules/@microwiseai/license/dist/core/activate.d.ts +21 -0
  126. package/node_modules/@microwiseai/license/dist/core/activate.d.ts.map +1 -0
  127. package/node_modules/@microwiseai/license/dist/core/activate.js +72 -0
  128. package/node_modules/@microwiseai/license/dist/core/activate.js.map +1 -0
  129. package/node_modules/@microwiseai/license/dist/core/check.d.ts +19 -0
  130. package/node_modules/@microwiseai/license/dist/core/check.d.ts.map +1 -0
  131. package/node_modules/@microwiseai/license/dist/core/check.js +244 -0
  132. package/node_modules/@microwiseai/license/dist/core/check.js.map +1 -0
  133. package/node_modules/@microwiseai/license/dist/core/index.d.ts +7 -0
  134. package/node_modules/@microwiseai/license/dist/core/index.d.ts.map +1 -0
  135. package/node_modules/@microwiseai/license/dist/core/index.js +10 -0
  136. package/node_modules/@microwiseai/license/dist/core/index.js.map +1 -0
  137. package/node_modules/@microwiseai/license/dist/core/verify.d.ts +39 -0
  138. package/node_modules/@microwiseai/license/dist/core/verify.d.ts.map +1 -0
  139. package/node_modules/@microwiseai/license/dist/core/verify.js +188 -0
  140. package/node_modules/@microwiseai/license/dist/core/verify.js.map +1 -0
  141. package/node_modules/@microwiseai/license/dist/env.d.ts +33 -0
  142. package/node_modules/@microwiseai/license/dist/env.d.ts.map +1 -0
  143. package/node_modules/@microwiseai/license/dist/env.js +69 -0
  144. package/node_modules/@microwiseai/license/dist/env.js.map +1 -0
  145. package/node_modules/@microwiseai/license/dist/helpers/cache.d.ts +97 -0
  146. package/node_modules/@microwiseai/license/dist/helpers/cache.d.ts.map +1 -0
  147. package/node_modules/@microwiseai/license/dist/helpers/cache.js +198 -0
  148. package/node_modules/@microwiseai/license/dist/helpers/cache.js.map +1 -0
  149. package/node_modules/@microwiseai/license/dist/helpers/index.d.ts +7 -0
  150. package/node_modules/@microwiseai/license/dist/helpers/index.d.ts.map +1 -0
  151. package/node_modules/@microwiseai/license/dist/helpers/index.js +9 -0
  152. package/node_modules/@microwiseai/license/dist/helpers/index.js.map +1 -0
  153. package/node_modules/@microwiseai/license/dist/helpers/telemetry.d.ts +68 -0
  154. package/node_modules/@microwiseai/license/dist/helpers/telemetry.d.ts.map +1 -0
  155. package/node_modules/@microwiseai/license/dist/helpers/telemetry.js +119 -0
  156. package/node_modules/@microwiseai/license/dist/helpers/telemetry.js.map +1 -0
  157. package/node_modules/@microwiseai/license/dist/index.d.ts +34 -0
  158. package/node_modules/@microwiseai/license/dist/index.d.ts.map +1 -0
  159. package/node_modules/@microwiseai/license/dist/index.js +48 -0
  160. package/node_modules/@microwiseai/license/dist/index.js.map +1 -0
  161. package/node_modules/@microwiseai/license/dist/machine/id.d.ts +19 -0
  162. package/node_modules/@microwiseai/license/dist/machine/id.d.ts.map +1 -0
  163. package/node_modules/@microwiseai/license/dist/machine/id.js +83 -0
  164. package/node_modules/@microwiseai/license/dist/machine/id.js.map +1 -0
  165. package/node_modules/@microwiseai/license/dist/machine/index.d.ts +6 -0
  166. package/node_modules/@microwiseai/license/dist/machine/index.d.ts.map +1 -0
  167. package/node_modules/@microwiseai/license/dist/machine/index.js +6 -0
  168. package/node_modules/@microwiseai/license/dist/machine/index.js.map +1 -0
  169. package/node_modules/@microwiseai/license/dist/machine/instance.d.ts +23 -0
  170. package/node_modules/@microwiseai/license/dist/machine/instance.d.ts.map +1 -0
  171. package/node_modules/@microwiseai/license/dist/machine/instance.js +52 -0
  172. package/node_modules/@microwiseai/license/dist/machine/instance.js.map +1 -0
  173. package/node_modules/@microwiseai/license/dist/telemetry/index.d.ts +6 -0
  174. package/node_modules/@microwiseai/license/dist/telemetry/index.d.ts.map +1 -0
  175. package/node_modules/@microwiseai/license/dist/telemetry/index.js +6 -0
  176. package/node_modules/@microwiseai/license/dist/telemetry/index.js.map +1 -0
  177. package/node_modules/@microwiseai/license/dist/telemetry/manager.d.ts +53 -0
  178. package/node_modules/@microwiseai/license/dist/telemetry/manager.d.ts.map +1 -0
  179. package/node_modules/@microwiseai/license/dist/telemetry/manager.js +125 -0
  180. package/node_modules/@microwiseai/license/dist/telemetry/manager.js.map +1 -0
  181. package/node_modules/@microwiseai/license/dist/telemetry/payload.d.ts +17 -0
  182. package/node_modules/@microwiseai/license/dist/telemetry/payload.d.ts.map +1 -0
  183. package/node_modules/@microwiseai/license/dist/telemetry/payload.js +65 -0
  184. package/node_modules/@microwiseai/license/dist/telemetry/payload.js.map +1 -0
  185. package/node_modules/@microwiseai/license/dist/types/api.d.ts +120 -0
  186. package/node_modules/@microwiseai/license/dist/types/api.d.ts.map +1 -0
  187. package/node_modules/@microwiseai/license/dist/types/api.js +5 -0
  188. package/node_modules/@microwiseai/license/dist/types/api.js.map +1 -0
  189. package/node_modules/@microwiseai/license/dist/types/config.d.ts +80 -0
  190. package/node_modules/@microwiseai/license/dist/types/config.d.ts.map +1 -0
  191. package/node_modules/@microwiseai/license/dist/types/config.js +12 -0
  192. package/node_modules/@microwiseai/license/dist/types/config.js.map +1 -0
  193. package/node_modules/@microwiseai/license/dist/types/errors.d.ts +93 -0
  194. package/node_modules/@microwiseai/license/dist/types/errors.d.ts.map +1 -0
  195. package/node_modules/@microwiseai/license/dist/types/errors.js +144 -0
  196. package/node_modules/@microwiseai/license/dist/types/errors.js.map +1 -0
  197. package/node_modules/@microwiseai/license/dist/types/index.d.ts +10 -0
  198. package/node_modules/@microwiseai/license/dist/types/index.d.ts.map +1 -0
  199. package/node_modules/@microwiseai/license/dist/types/index.js +6 -0
  200. package/node_modules/@microwiseai/license/dist/types/index.js.map +1 -0
  201. package/node_modules/@microwiseai/license/dist/types/license.d.ts +113 -0
  202. package/node_modules/@microwiseai/license/dist/types/license.d.ts.map +1 -0
  203. package/node_modules/@microwiseai/license/dist/types/license.js +5 -0
  204. package/node_modules/@microwiseai/license/dist/types/license.js.map +1 -0
  205. package/node_modules/@microwiseai/license/dist/utils/date.d.ts +45 -0
  206. package/node_modules/@microwiseai/license/dist/utils/date.d.ts.map +1 -0
  207. package/node_modules/@microwiseai/license/dist/utils/date.js +95 -0
  208. package/node_modules/@microwiseai/license/dist/utils/date.js.map +1 -0
  209. package/node_modules/@microwiseai/license/dist/utils/env.d.ts +41 -0
  210. package/node_modules/@microwiseai/license/dist/utils/env.d.ts.map +1 -0
  211. package/node_modules/@microwiseai/license/dist/utils/env.js +80 -0
  212. package/node_modules/@microwiseai/license/dist/utils/env.js.map +1 -0
  213. package/node_modules/@microwiseai/license/dist/utils/index.d.ts +7 -0
  214. package/node_modules/@microwiseai/license/dist/utils/index.d.ts.map +1 -0
  215. package/node_modules/@microwiseai/license/dist/utils/index.js +7 -0
  216. package/node_modules/@microwiseai/license/dist/utils/index.js.map +1 -0
  217. package/node_modules/@microwiseai/license/dist/utils/mask.d.ts +27 -0
  218. package/node_modules/@microwiseai/license/dist/utils/mask.d.ts.map +1 -0
  219. package/node_modules/@microwiseai/license/dist/utils/mask.js +67 -0
  220. package/node_modules/@microwiseai/license/dist/utils/mask.js.map +1 -0
  221. package/node_modules/@microwiseai/license/package.json +52 -0
  222. package/node_modules/@microwiseai/license-types/README.md +84 -0
  223. package/node_modules/@microwiseai/license-types/dist/api.d.ts +120 -0
  224. package/node_modules/@microwiseai/license-types/dist/api.d.ts.map +1 -0
  225. package/node_modules/@microwiseai/license-types/dist/api.js +5 -0
  226. package/node_modules/@microwiseai/license-types/dist/api.js.map +1 -0
  227. package/node_modules/@microwiseai/license-types/dist/config.d.ts +80 -0
  228. package/node_modules/@microwiseai/license-types/dist/config.d.ts.map +1 -0
  229. package/node_modules/@microwiseai/license-types/dist/config.js +12 -0
  230. package/node_modules/@microwiseai/license-types/dist/config.js.map +1 -0
  231. package/node_modules/@microwiseai/license-types/dist/errors.d.ts +93 -0
  232. package/node_modules/@microwiseai/license-types/dist/errors.d.ts.map +1 -0
  233. package/node_modules/@microwiseai/license-types/dist/errors.js +144 -0
  234. package/node_modules/@microwiseai/license-types/dist/errors.js.map +1 -0
  235. package/node_modules/@microwiseai/license-types/dist/index.d.ts +10 -0
  236. package/node_modules/@microwiseai/license-types/dist/index.d.ts.map +1 -0
  237. package/node_modules/@microwiseai/license-types/dist/index.js +6 -0
  238. package/node_modules/@microwiseai/license-types/dist/index.js.map +1 -0
  239. package/node_modules/@microwiseai/license-types/dist/license.d.ts +113 -0
  240. package/node_modules/@microwiseai/license-types/dist/license.d.ts.map +1 -0
  241. package/node_modules/@microwiseai/license-types/dist/license.js +5 -0
  242. package/node_modules/@microwiseai/license-types/dist/license.js.map +1 -0
  243. package/node_modules/@microwiseai/license-types/package.json +38 -0
  244. package/node_modules/@microwiseai/license-utils/README.md +82 -0
  245. package/node_modules/@microwiseai/license-utils/dist/__tests__/machine.test.d.ts +2 -0
  246. package/node_modules/@microwiseai/license-utils/dist/__tests__/machine.test.d.ts.map +1 -0
  247. package/node_modules/@microwiseai/license-utils/dist/__tests__/machine.test.js +124 -0
  248. package/node_modules/@microwiseai/license-utils/dist/__tests__/machine.test.js.map +1 -0
  249. package/node_modules/@microwiseai/license-utils/dist/index.d.ts +7 -0
  250. package/node_modules/@microwiseai/license-utils/dist/index.d.ts.map +1 -0
  251. package/node_modules/@microwiseai/license-utils/dist/index.js +15 -0
  252. package/node_modules/@microwiseai/license-utils/dist/index.js.map +1 -0
  253. package/node_modules/@microwiseai/license-utils/dist/machine/id.d.ts +19 -0
  254. package/node_modules/@microwiseai/license-utils/dist/machine/id.d.ts.map +1 -0
  255. package/node_modules/@microwiseai/license-utils/dist/machine/id.js +83 -0
  256. package/node_modules/@microwiseai/license-utils/dist/machine/id.js.map +1 -0
  257. package/node_modules/@microwiseai/license-utils/dist/machine/index.d.ts +6 -0
  258. package/node_modules/@microwiseai/license-utils/dist/machine/index.d.ts.map +1 -0
  259. package/node_modules/@microwiseai/license-utils/dist/machine/index.js +6 -0
  260. package/node_modules/@microwiseai/license-utils/dist/machine/index.js.map +1 -0
  261. package/node_modules/@microwiseai/license-utils/dist/machine/instance.d.ts +23 -0
  262. package/node_modules/@microwiseai/license-utils/dist/machine/instance.d.ts.map +1 -0
  263. package/node_modules/@microwiseai/license-utils/dist/machine/instance.js +52 -0
  264. package/node_modules/@microwiseai/license-utils/dist/machine/instance.js.map +1 -0
  265. package/node_modules/@microwiseai/license-utils/dist/utils/date.d.ts +45 -0
  266. package/node_modules/@microwiseai/license-utils/dist/utils/date.d.ts.map +1 -0
  267. package/node_modules/@microwiseai/license-utils/dist/utils/date.js +95 -0
  268. package/node_modules/@microwiseai/license-utils/dist/utils/date.js.map +1 -0
  269. package/node_modules/@microwiseai/license-utils/dist/utils/env.d.ts +16 -0
  270. package/node_modules/@microwiseai/license-utils/dist/utils/env.d.ts.map +1 -0
  271. package/node_modules/@microwiseai/license-utils/dist/utils/env.js +22 -0
  272. package/node_modules/@microwiseai/license-utils/dist/utils/env.js.map +1 -0
  273. package/node_modules/@microwiseai/license-utils/dist/utils/index.d.ts +7 -0
  274. package/node_modules/@microwiseai/license-utils/dist/utils/index.d.ts.map +1 -0
  275. package/node_modules/@microwiseai/license-utils/dist/utils/index.js +7 -0
  276. package/node_modules/@microwiseai/license-utils/dist/utils/index.js.map +1 -0
  277. package/node_modules/@microwiseai/license-utils/dist/utils/mask.d.ts +27 -0
  278. package/node_modules/@microwiseai/license-utils/dist/utils/mask.d.ts.map +1 -0
  279. package/node_modules/@microwiseai/license-utils/dist/utils/mask.js +67 -0
  280. package/node_modules/@microwiseai/license-utils/dist/utils/mask.js.map +1 -0
  281. package/node_modules/@microwiseai/license-utils/package.json +45 -0
  282. package/node_modules/@microwiseai/telemetry/README.md +86 -0
  283. package/node_modules/@microwiseai/telemetry/dist/index.d.ts +9 -0
  284. package/node_modules/@microwiseai/telemetry/dist/index.d.ts.map +1 -0
  285. package/node_modules/@microwiseai/telemetry/dist/index.js +10 -0
  286. package/node_modules/@microwiseai/telemetry/dist/index.js.map +1 -0
  287. package/node_modules/@microwiseai/telemetry/dist/manager.d.ts +71 -0
  288. package/node_modules/@microwiseai/telemetry/dist/manager.d.ts.map +1 -0
  289. package/node_modules/@microwiseai/telemetry/dist/manager.js +171 -0
  290. package/node_modules/@microwiseai/telemetry/dist/manager.js.map +1 -0
  291. package/node_modules/@microwiseai/telemetry/dist/payload.d.ts +13 -0
  292. package/node_modules/@microwiseai/telemetry/dist/payload.d.ts.map +1 -0
  293. package/node_modules/@microwiseai/telemetry/dist/payload.js +35 -0
  294. package/node_modules/@microwiseai/telemetry/dist/payload.js.map +1 -0
  295. package/node_modules/@microwiseai/telemetry/dist/types.d.ts +76 -0
  296. package/node_modules/@microwiseai/telemetry/dist/types.d.ts.map +1 -0
  297. package/node_modules/@microwiseai/telemetry/dist/types.js +13 -0
  298. package/node_modules/@microwiseai/telemetry/dist/types.js.map +1 -0
  299. package/node_modules/@microwiseai/telemetry/package.json +43 -0
  300. package/node_modules/chalk/license +9 -0
  301. package/node_modules/chalk/package.json +83 -0
  302. package/node_modules/chalk/readme.md +297 -0
  303. package/node_modules/chalk/source/index.d.ts +325 -0
  304. package/node_modules/chalk/source/index.js +225 -0
  305. package/node_modules/chalk/source/utilities.js +33 -0
  306. package/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +236 -0
  307. package/node_modules/chalk/source/vendor/ansi-styles/index.js +223 -0
  308. package/node_modules/chalk/source/vendor/supports-color/browser.d.ts +1 -0
  309. package/node_modules/chalk/source/vendor/supports-color/browser.js +34 -0
  310. package/node_modules/chalk/source/vendor/supports-color/index.d.ts +55 -0
  311. package/node_modules/chalk/source/vendor/supports-color/index.js +190 -0
  312. package/package.json +26 -2
@@ -0,0 +1,95 @@
1
+ /**
2
+ * HTTP client for license API calls
3
+ * Uses Node.js 18+ built-in fetch
4
+ */
5
+ import { getApiUrl } from '../env.js';
6
+ const DEFAULT_TIMEOUT = 10000; // 10 seconds
7
+ /**
8
+ * Make a POST request to the API
9
+ */
10
+ export async function post(config, endpoint, body, options) {
11
+ const baseUrl = getApiUrl(config);
12
+ const url = `${baseUrl}${endpoint}`;
13
+ const timeout = options?.timeout ?? DEFAULT_TIMEOUT;
14
+ try {
15
+ const response = await fetch(url, {
16
+ method: 'POST',
17
+ headers: {
18
+ 'Content-Type': 'application/json',
19
+ Accept: 'application/json',
20
+ },
21
+ body: JSON.stringify(body),
22
+ signal: AbortSignal.timeout(timeout),
23
+ });
24
+ // Try to parse response as JSON
25
+ let data;
26
+ let errorMessage;
27
+ try {
28
+ const json = await response.json();
29
+ // Unwrap data field if response has { success, data: {...} } structure
30
+ const unwrapped = json && typeof json === 'object' && 'data' in json ? json.data : json;
31
+ if (response.ok) {
32
+ data = unwrapped;
33
+ }
34
+ else {
35
+ // Error response
36
+ errorMessage =
37
+ unwrapped.error ?? `API Error: ${response.status}`;
38
+ data = unwrapped;
39
+ }
40
+ }
41
+ catch {
42
+ // Non-JSON response
43
+ if (!response.ok) {
44
+ errorMessage = `API Error: ${response.status} ${response.statusText}`;
45
+ }
46
+ }
47
+ return {
48
+ ok: response.ok,
49
+ status: response.status,
50
+ data,
51
+ error: errorMessage,
52
+ };
53
+ }
54
+ catch (error) {
55
+ // Network error or timeout
56
+ if (error instanceof Error) {
57
+ if (error.name === 'TimeoutError' || error.name === 'AbortError') {
58
+ return {
59
+ ok: false,
60
+ status: 0,
61
+ error: 'Request timeout',
62
+ };
63
+ }
64
+ return {
65
+ ok: false,
66
+ status: 0,
67
+ error: error.message,
68
+ };
69
+ }
70
+ return {
71
+ ok: false,
72
+ status: 0,
73
+ error: 'Network error',
74
+ };
75
+ }
76
+ }
77
+ /**
78
+ * Check if error is a network error (for offline handling)
79
+ */
80
+ export function isNetworkError(response) {
81
+ return response.status === 0;
82
+ }
83
+ /**
84
+ * Check if response indicates server error
85
+ */
86
+ export function isServerError(response) {
87
+ return response.status >= 500 && response.status < 600;
88
+ }
89
+ /**
90
+ * Check if response indicates client error
91
+ */
92
+ export function isClientError(response) {
93
+ return response.status >= 400 && response.status < 500;
94
+ }
95
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,eAAe,GAAG,KAAK,CAAC,CAAC,aAAa;AAmB5C;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CACxB,MAAqB,EACrB,QAAgB,EAChB,IAAc,EACd,OAA0B;IAE1B,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;IAClC,MAAM,GAAG,GAAG,GAAG,OAAO,GAAG,QAAQ,EAAE,CAAC;IACpC,MAAM,OAAO,GAAG,OAAO,EAAE,OAAO,IAAI,eAAe,CAAC;IAEpD,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;YAChC,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,MAAM,EAAE,kBAAkB;aAC3B;YACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;YAC1B,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC;SACrC,CAAC,CAAC;QAEH,gCAAgC;QAChC,IAAI,IAA2B,CAAC;QAChC,IAAI,YAAgC,CAAC;QAErC,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YACnC,uEAAuE;YACvE,MAAM,SAAS,GACb,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;YACxE,IAAI,QAAQ,CAAC,EAAE,EAAE,CAAC;gBAChB,IAAI,GAAG,SAAsB,CAAC;YAChC,CAAC;iBAAM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AAC,MAAM,GAAG,GAAG,CAAC;AACzD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,QAA8B;IAC1D,OAAO,QAAQ,CAAC,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,MAAM,GAAG,GAAG,CAAC;AACzD,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * License API endpoint functions
3
+ */
4
+ import type { LicenseConfig, VerifyResponse, DeactivateResponse, ActivationResult } from '@microwiseai/license-types';
5
+ /**
6
+ * Verify license with the API server
7
+ */
8
+ export declare function verifyLicense(config: LicenseConfig, licenseKey: string, options?: {
9
+ productId?: string;
10
+ productGroup?: string;
11
+ }): Promise<VerifyResponse>;
12
+ /**
13
+ * Activate license on this machine
14
+ */
15
+ export declare function activateLicense(config: LicenseConfig, licenseKey: string, options?: {
16
+ instanceName?: string;
17
+ }): Promise<ActivationResult>;
18
+ /**
19
+ * Deactivate license on this machine
20
+ */
21
+ export declare function deactivateLicense(config: LicenseConfig, licenseKey: string, options?: {
22
+ activationId?: string;
23
+ deactivateAll?: boolean;
24
+ }): Promise<DeactivateResponse>;
25
+ //# sourceMappingURL=endpoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../src/api/endpoints.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,aAAa,EAEb,cAAc,EAId,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,4BAA4B,CAAC;AAWpC;;GAEG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE;IACR,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GACA,OAAO,CAAC,cAAc,CAAC,CA2BzB;AAED;;GAEG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE;IACR,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GACA,OAAO,CAAC,gBAAgB,CAAC,CAkC3B;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE;IACR,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,GACA,OAAO,CAAC,kBAAkB,CAAC,CA+B7B"}
@@ -0,0 +1,101 @@
1
+ /**
2
+ * License API endpoint functions
3
+ */
4
+ import { getMachineId, getInstanceName, getOrCreateInstanceName } from '@microwiseai/license-utils';
5
+ import { post, isNetworkError } from './client.js';
6
+ // API endpoints
7
+ const ENDPOINTS = {
8
+ verify: '/api/licenses/verify',
9
+ activate: '/api/licenses/activate',
10
+ deactivate: '/api/licenses/deactivate',
11
+ };
12
+ /**
13
+ * Verify license with the API server
14
+ */
15
+ export async function verifyLicense(config, licenseKey, options) {
16
+ const machineId = getMachineId(config.vendorName);
17
+ const request = {
18
+ licenseKey,
19
+ machineId,
20
+ productId: options?.productId,
21
+ productGroup: options?.productGroup,
22
+ };
23
+ const response = await post(config, ENDPOINTS.verify, request);
24
+ // Network error - throw for offline handling
25
+ if (isNetworkError(response)) {
26
+ throw new Error(response.error ?? 'Network error during license verification');
27
+ }
28
+ // Return API response (valid or invalid)
29
+ if (response.data) {
30
+ return response.data;
31
+ }
32
+ // Unexpected error
33
+ return {
34
+ valid: false,
35
+ error: response.error ?? 'Unknown error',
36
+ };
37
+ }
38
+ /**
39
+ * Activate license on this machine
40
+ */
41
+ export async function activateLicense(config, licenseKey, options) {
42
+ const machineId = getMachineId(config.vendorName);
43
+ const instanceName = getOrCreateInstanceName(options?.instanceName);
44
+ const request = {
45
+ licenseKey,
46
+ machineId,
47
+ instanceName,
48
+ };
49
+ const response = await post(config, ENDPOINTS.activate, request);
50
+ // Network error
51
+ if (isNetworkError(response)) {
52
+ return {
53
+ success: false,
54
+ instanceName,
55
+ error: response.error ?? 'Network error during activation',
56
+ };
57
+ }
58
+ // Return API response with instanceName
59
+ if (response.data) {
60
+ return {
61
+ ...response.data,
62
+ instanceName: 'instanceName' in response.data ? response.data.instanceName : instanceName,
63
+ };
64
+ }
65
+ return {
66
+ success: false,
67
+ instanceName,
68
+ error: response.error ?? 'Activation failed',
69
+ };
70
+ }
71
+ /**
72
+ * Deactivate license on this machine
73
+ */
74
+ export async function deactivateLicense(config, licenseKey, options) {
75
+ const machineId = getMachineId(config.vendorName);
76
+ const instanceName = getInstanceName();
77
+ const request = {
78
+ licenseKey,
79
+ machineId,
80
+ instanceName,
81
+ activationId: options?.activationId,
82
+ deactivateAll: options?.deactivateAll,
83
+ };
84
+ const response = await post(config, ENDPOINTS.deactivate, request);
85
+ // Network error
86
+ if (isNetworkError(response)) {
87
+ return {
88
+ success: false,
89
+ error: response.error ?? 'Network error during deactivation',
90
+ };
91
+ }
92
+ // Return API response
93
+ if (response.data) {
94
+ return response.data;
95
+ }
96
+ return {
97
+ success: false,
98
+ error: response.error ?? 'Deactivation failed',
99
+ };
100
+ }
101
+ //# sourceMappingURL=endpoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../../src/api/endpoints.ts"],"names":[],"mappings":"AAAA;;GAEG;AAYH,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACpG,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEnD,gBAAgB;AAChB,MAAM,SAAS,GAAG;IAChB,MAAM,EAAE,sBAAsB;IAC9B,QAAQ,EAAE,wBAAwB;IAClC,UAAU,EAAE,0BAA0B;CAC9B,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,MAAqB,EACrB,UAAkB,EAClB,OAGC;IAED,MAAM,SAAS,GAAG,YAAY,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* API module exports
3
+ */
4
+ export { post, isNetworkError, isServerError, isClientError } from './client.js';
5
+ export type { ApiClientOptions, ApiResponse } from './client.js';
6
+ export { verifyLicense, activateLicense, deactivateLicense } from './endpoints.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjF,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAGjE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * API module exports
3
+ */
4
+ // HTTP client
5
+ export { post, isNetworkError, isServerError, isClientError } from './client.js';
6
+ // Endpoints
7
+ export { verifyLicense, activateLicense, deactivateLicense } from './endpoints.js';
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc;AACd,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjF,YAAY;AACZ,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * File-based cache management
3
+ * Stores license data and cache metadata in ~/.{vendorName}/
4
+ */
5
+ import type { LicenseData, LicenseCacheData, LicenseConfig } from '@microwiseai/license-types';
6
+ /**
7
+ * Read license data from local file
8
+ */
9
+ export declare function readLicense(vendorName: string): LicenseData | null;
10
+ /**
11
+ * Write license data to local file
12
+ */
13
+ export declare function writeLicense(vendorName: string, data: LicenseData): void;
14
+ /**
15
+ * Delete license file and cache
16
+ */
17
+ export declare function deleteLicense(vendorName: string): void;
18
+ /**
19
+ * Read cache data
20
+ */
21
+ export declare function readCache(vendorName: string): LicenseCacheData | null;
22
+ /**
23
+ * Write cache data
24
+ */
25
+ export declare function writeCache(config: LicenseConfig, valid: boolean, lastServerResponse?: LicenseCacheData['lastServerResponse']): void;
26
+ /**
27
+ * Delete cache file only
28
+ */
29
+ export declare function deleteCache(vendorName: string): void;
30
+ /**
31
+ * Check if file cache is still valid
32
+ */
33
+ export declare function isFileCacheValid(vendorName: string): boolean;
34
+ /**
35
+ * Get storage directory path
36
+ */
37
+ export { getStorageDir } from '@microwiseai/license-utils';
38
+ //# sourceMappingURL=file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/cache/file.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAgC/F;;GAEG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAWlE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,CAIxE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CActD;AAMD;;GAEG;AACH,wBAAgB,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAWrE;AAED;;GAEG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,OAAO,EACd,kBAAkB,CAAC,EAAE,gBAAgB,CAAC,oBAAoB,CAAC,GAC1D,IAAI,CAgBN;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CASpD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAQ5D;AAED;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,140 @@
1
+ /**
2
+ * File-based cache management
3
+ * Stores license data and cache metadata in ~/.{vendorName}/
4
+ */
5
+ import * as fs from 'fs';
6
+ import * as path from 'path';
7
+ import { getStorageDir, addSeconds, addDays, nowISO } from '@microwiseai/license-utils';
8
+ import { getCacheTTL, getOfflineGraceDays } from '../env.js';
9
+ /**
10
+ * Get license file path
11
+ */
12
+ function getLicenseFilePath(vendorName) {
13
+ return path.join(getStorageDir(vendorName), 'license.json');
14
+ }
15
+ /**
16
+ * Get cache file path
17
+ */
18
+ function getCacheFilePath(vendorName) {
19
+ return path.join(getStorageDir(vendorName), 'license-cache.json');
20
+ }
21
+ /**
22
+ * Ensure storage directory exists
23
+ */
24
+ function ensureStorageDir(vendorName) {
25
+ const dir = getStorageDir(vendorName);
26
+ if (!fs.existsSync(dir)) {
27
+ fs.mkdirSync(dir, { recursive: true });
28
+ }
29
+ }
30
+ // ============================================================
31
+ // License Data (license.json)
32
+ // ============================================================
33
+ /**
34
+ * Read license data from local file
35
+ */
36
+ export function readLicense(vendorName) {
37
+ try {
38
+ const filePath = getLicenseFilePath(vendorName);
39
+ if (!fs.existsSync(filePath)) {
40
+ return null;
41
+ }
42
+ const content = fs.readFileSync(filePath, 'utf-8');
43
+ return JSON.parse(content);
44
+ }
45
+ catch {
46
+ return null;
47
+ }
48
+ }
49
+ /**
50
+ * Write license data to local file
51
+ */
52
+ export function writeLicense(vendorName, data) {
53
+ ensureStorageDir(vendorName);
54
+ const filePath = getLicenseFilePath(vendorName);
55
+ fs.writeFileSync(filePath, JSON.stringify(data, null, 2), 'utf-8');
56
+ }
57
+ /**
58
+ * Delete license file and cache
59
+ */
60
+ export function deleteLicense(vendorName) {
61
+ try {
62
+ const licenseFile = getLicenseFilePath(vendorName);
63
+ const cacheFile = getCacheFilePath(vendorName);
64
+ if (fs.existsSync(licenseFile)) {
65
+ fs.unlinkSync(licenseFile);
66
+ }
67
+ if (fs.existsSync(cacheFile)) {
68
+ fs.unlinkSync(cacheFile);
69
+ }
70
+ }
71
+ catch {
72
+ // Ignore deletion errors
73
+ }
74
+ }
75
+ // ============================================================
76
+ // Cache Data (license-cache.json)
77
+ // ============================================================
78
+ /**
79
+ * Read cache data
80
+ */
81
+ export function readCache(vendorName) {
82
+ try {
83
+ const filePath = getCacheFilePath(vendorName);
84
+ if (!fs.existsSync(filePath)) {
85
+ return null;
86
+ }
87
+ const content = fs.readFileSync(filePath, 'utf-8');
88
+ return JSON.parse(content);
89
+ }
90
+ catch {
91
+ return null;
92
+ }
93
+ }
94
+ /**
95
+ * Write cache data
96
+ */
97
+ export function writeCache(config, valid, lastServerResponse) {
98
+ ensureStorageDir(config.vendorName);
99
+ const cacheTTL = getCacheTTL(config);
100
+ const offlineGraceDays = getOfflineGraceDays(config);
101
+ const cacheData = {
102
+ valid,
103
+ verifiedAt: nowISO(),
104
+ cacheExpiresAt: addSeconds(cacheTTL),
105
+ offlineGraceUntil: addDays(offlineGraceDays),
106
+ lastServerResponse,
107
+ };
108
+ const filePath = getCacheFilePath(config.vendorName);
109
+ fs.writeFileSync(filePath, JSON.stringify(cacheData, null, 2), 'utf-8');
110
+ }
111
+ /**
112
+ * Delete cache file only
113
+ */
114
+ export function deleteCache(vendorName) {
115
+ try {
116
+ const cacheFile = getCacheFilePath(vendorName);
117
+ if (fs.existsSync(cacheFile)) {
118
+ fs.unlinkSync(cacheFile);
119
+ }
120
+ }
121
+ catch {
122
+ // Ignore deletion errors
123
+ }
124
+ }
125
+ /**
126
+ * Check if file cache is still valid
127
+ */
128
+ export function isFileCacheValid(vendorName) {
129
+ const cache = readCache(vendorName);
130
+ if (!cache) {
131
+ return false;
132
+ }
133
+ const cacheExpires = new Date(cache.cacheExpiresAt);
134
+ return cache.valid && cacheExpires > new Date();
135
+ }
136
+ /**
137
+ * Get storage directory path
138
+ */
139
+ export { getStorageDir } from '@microwiseai/license-utils';
140
+ //# sourceMappingURL=file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file.js","sourceRoot":"","sources":["../../src/cache/file.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAE7D;;GAEG;AACH,SAAS,kBAAkB,CAAC,UAAkB;IAC5C,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE,cAAc,CAAC,CAAC;AAC9D,CAAC;AAED;;GAEG;AACH,SAAS,gBAAgB,CAAC,UAAkB;IAC1C,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE,oBAAoB,CAAC,CAAC;AACpE,CAAC;AAED;;GAEG;AACH,SAAS,gBAAgB,CAAC,UAAkB;IAC1C,MAAM,GAAG,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;IACtC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACxB,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACzC,CAAC;AACH,CAAC;AAED,+DAA+D;AAC/D,8BAA8B;AAC9B,+DAA+D;AAE/D;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,UAAkB;IAC5C,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;QAChD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC7B,OAAO,IAAI,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AAM,UAAU,gBAAgB,CAAC,UAAkB;IACjD,MAAM,KAAK,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC;IACpC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,YAAY,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IACpD,OAAO,KAAK,CAAC,KAAK,IAAI,YAAY,GAAG,IAAI,IAAI,EAAE,CAAC;AAClD,CAAC;AAED;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Cache module exports
3
+ */
4
+ export { getMemoryCache, setMemoryCache, clearMemoryCache, clearAllMemoryCache, isMemoryCacheValid, getMemoryCacheStats, } from './memory.js';
5
+ export { readLicense, writeLicense, deleteLicense, readCache, writeCache, deleteCache, isFileCacheValid, getStorageDir, } from './file.js';
6
+ export { isWithinOfflineGrace, getOfflineGraceDaysRemaining, getOfflineGraceStatus, getLastServerResponse, } from './offline.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cache/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EACL,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,WAAW,EACX,YAAY,EACZ,aAAa,EACb,SAAS,EACT,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,aAAa,GACd,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,cAAc,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Cache module exports
3
+ */
4
+ // Memory cache
5
+ export { getMemoryCache, setMemoryCache, clearMemoryCache, clearAllMemoryCache, isMemoryCacheValid, getMemoryCacheStats, } from './memory.js';
6
+ // File cache
7
+ export { readLicense, writeLicense, deleteLicense, readCache, writeCache, deleteCache, isFileCacheValid, getStorageDir, } from './file.js';
8
+ // Offline grace
9
+ export { isWithinOfflineGrace, getOfflineGraceDaysRemaining, getOfflineGraceStatus, getLastServerResponse, } from './offline.js';
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cache/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAe;AACf,OAAO,EACL,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,aAAa,CAAC;AAErB,aAAa;AACb,OAAO,EACL,WAAW,EACX,YAAY,EACZ,aAAa,EACb,SAAS,EACT,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,aAAa,GACd,MAAM,WAAW,CAAC;AAEnB,gBAAgB;AAChB,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,cAAc,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Memory cache for license results
3
+ * TTL: 5 minutes (prevents repeated API calls in same process)
4
+ */
5
+ import type { LicenseResult } from '@microwiseai/license-types';
6
+ /**
7
+ * Get cached result from memory
8
+ */
9
+ export declare function getMemoryCache(vendorName: string): LicenseResult | null;
10
+ /**
11
+ * Set result in memory cache
12
+ */
13
+ export declare function setMemoryCache(vendorName: string, result: LicenseResult): void;
14
+ /**
15
+ * Clear memory cache for a vendor
16
+ */
17
+ export declare function clearMemoryCache(vendorName: string): void;
18
+ /**
19
+ * Clear all memory cache
20
+ */
21
+ export declare function clearAllMemoryCache(): void;
22
+ /**
23
+ * Check if memory cache is valid
24
+ */
25
+ export declare function isMemoryCacheValid(vendorName: string): boolean;
26
+ /**
27
+ * Get memory cache stats (for debugging)
28
+ */
29
+ export declare function getMemoryCacheStats(vendorName: string): {
30
+ exists: boolean;
31
+ cachedAt?: Date;
32
+ expiresAt?: Date;
33
+ remainingMs?: number;
34
+ };
35
+ //# sourceMappingURL=memory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/cache/memory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAoBhE;;GAEG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAevE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI,CAS9E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAGzD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAE9D;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG;IACvD,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAcA"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Memory cache for license results
3
+ * TTL: 5 minutes (prevents repeated API calls in same process)
4
+ */
5
+ const MEMORY_CACHE_TTL = 5 * 60 * 1000; // 5 minutes in ms
6
+ // Module-level cache (per vendor)
7
+ const cacheStore = new Map();
8
+ /**
9
+ * Get cache key for a vendor
10
+ */
11
+ function getCacheKey(vendorName) {
12
+ return `license:${vendorName}`;
13
+ }
14
+ /**
15
+ * Get cached result from memory
16
+ */
17
+ export function getMemoryCache(vendorName) {
18
+ const key = getCacheKey(vendorName);
19
+ const entry = cacheStore.get(key);
20
+ if (!entry) {
21
+ return null;
22
+ }
23
+ // Check if expired
24
+ if (Date.now() > entry.expiresAt) {
25
+ cacheStore.delete(key);
26
+ return null;
27
+ }
28
+ return entry.result;
29
+ }
30
+ /**
31
+ * Set result in memory cache
32
+ */
33
+ export function setMemoryCache(vendorName, result) {
34
+ const key = getCacheKey(vendorName);
35
+ const now = Date.now();
36
+ cacheStore.set(key, {
37
+ result,
38
+ cachedAt: now,
39
+ expiresAt: now + MEMORY_CACHE_TTL,
40
+ });
41
+ }
42
+ /**
43
+ * Clear memory cache for a vendor
44
+ */
45
+ export function clearMemoryCache(vendorName) {
46
+ const key = getCacheKey(vendorName);
47
+ cacheStore.delete(key);
48
+ }
49
+ /**
50
+ * Clear all memory cache
51
+ */
52
+ export function clearAllMemoryCache() {
53
+ cacheStore.clear();
54
+ }
55
+ /**
56
+ * Check if memory cache is valid
57
+ */
58
+ export function isMemoryCacheValid(vendorName) {
59
+ return getMemoryCache(vendorName) !== null;
60
+ }
61
+ /**
62
+ * Get memory cache stats (for debugging)
63
+ */
64
+ export function getMemoryCacheStats(vendorName) {
65
+ const key = getCacheKey(vendorName);
66
+ const entry = cacheStore.get(key);
67
+ if (!entry) {
68
+ return { exists: false };
69
+ }
70
+ return {
71
+ exists: true,
72
+ cachedAt: new Date(entry.cachedAt),
73
+ expiresAt: new Date(entry.expiresAt),
74
+ remainingMs: Math.max(0, entry.expiresAt - Date.now()),
75
+ };
76
+ }
77
+ //# sourceMappingURL=memory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory.js","sourceRoot":"","sources":["../../src/cache/memory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,gBAAgB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,kBAAkB;AAQ1D,kCAAkC;AAClC,MAAM,UAAU,GAAG,IAAI,GAAG,EAA4B,CAAC;AAEvD;;GAEG;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,MAAM,UAAU,mBAAmB,CAAC,UAAkB;IAMpD,MAAM,GAAG,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;IACpC,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAElC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAC3B,CAAC;IAED,OAAO;QACL,MAAM,EAAE,IAAI;QACZ,QAAQ,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;QAClC,SAAS,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;QACpC,WAAW,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;KACvD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Offline grace period management
3
+ */
4
+ /**
5
+ * Check if still within offline grace period
6
+ */
7
+ export declare function isWithinOfflineGrace(vendorName: string): boolean;
8
+ /**
9
+ * Get days remaining in offline grace period
10
+ */
11
+ export declare function getOfflineGraceDaysRemaining(vendorName: string): number;
12
+ /**
13
+ * Get offline grace status
14
+ */
15
+ export declare function getOfflineGraceStatus(vendorName: string): {
16
+ withinGrace: boolean;
17
+ daysRemaining: number;
18
+ graceUntil?: Date;
19
+ lastVerified?: Date;
20
+ };
21
+ /**
22
+ * Get last server response from cache (for offline mode)
23
+ */
24
+ export declare function getLastServerResponse(vendorName: string): {
25
+ type?: string;
26
+ status?: string;
27
+ expiresAt?: string;
28
+ } | null;
29
+ //# sourceMappingURL=offline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"offline.d.ts","sourceRoot":"","sources":["../../src/cache/offline.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAahE;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAOvE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG;IACzD,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,IAAI,CAAC;IAClB,YAAY,CAAC,EAAE,IAAI,CAAC;CACrB,CAmBA;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG;IACzD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,IAAI,CAGP"}