@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,45 @@
1
+ {
2
+ "name": "@microwiseai/license-utils",
3
+ "version": "0.1.0",
4
+ "description": "Utility functions for license verification (date, masking, machine identification)",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "scripts": {
18
+ "build": "tsc",
19
+ "dev": "tsc --watch",
20
+ "test": "vitest run",
21
+ "test:watch": "vitest",
22
+ "test:coverage": "vitest run --coverage",
23
+ "typecheck": "tsc --noEmit",
24
+ "clean": "rm -rf dist",
25
+ "prepublishOnly": "npm run build"
26
+ },
27
+ "keywords": [
28
+ "license",
29
+ "utilities",
30
+ "masking",
31
+ "machine-id",
32
+ "date-utils"
33
+ ],
34
+ "author": "MicrowiseAI",
35
+ "license": "MIT",
36
+ "engines": {
37
+ "node": ">=18.0.0"
38
+ },
39
+ "dependencies": {},
40
+ "devDependencies": {
41
+ "@types/node": "^20.11.0",
42
+ "typescript": "^5.3.3",
43
+ "vitest": "^2.0.0"
44
+ }
45
+ }
@@ -0,0 +1,86 @@
1
+ # @microwiseai/telemetry
2
+
3
+ Generic telemetry module for usage reporting.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @microwiseai/telemetry
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```typescript
14
+ import { createTelemetryManager } from '@microwiseai/telemetry';
15
+
16
+ // Create manager
17
+ const telemetry = createTelemetryManager({
18
+ endpoint: 'https://telemetry.example.com/collect',
19
+ enabled: true,
20
+ autoReport: true,
21
+ });
22
+
23
+ // Set base options for all payloads
24
+ telemetry.setBaseOptions({
25
+ machineId: 'unique-machine-id',
26
+ instanceName: 'my-server-01',
27
+ appName: 'my-app',
28
+ appVersion: '1.0.0',
29
+ });
30
+
31
+ // Report events
32
+ await telemetry.report('startup');
33
+ await telemetry.report('action', { userId: '123', action: 'login' });
34
+
35
+ // Auto-reporting with status callback
36
+ telemetry.setStatusCallback(() => 'active');
37
+ telemetry.startAutoReport();
38
+
39
+ // Cleanup on shutdown
40
+ telemetry.destroy();
41
+ ```
42
+
43
+ ## API
44
+
45
+ ### TelemetryConfig
46
+
47
+ | Option | Type | Default | Description |
48
+ |--------|------|---------|-------------|
49
+ | `endpoint` | `string` | required | URL to send telemetry data |
50
+ | `enabled` | `boolean` | `true` | Enable/disable telemetry |
51
+ | `autoReportDelay` | `number` | `10000` | Initial delay before auto-report (ms) |
52
+ | `autoReportInterval` | `number` | `1800000` | Interval between auto-reports (ms) |
53
+ | `timeout` | `number` | `5000` | Request timeout (ms) |
54
+
55
+ ### TelemetryManager Methods
56
+
57
+ - `setBaseOptions(options)` - Set base options for all payloads
58
+ - `setStatusCallback(callback)` - Set callback for auto-reporting
59
+ - `report(event, metadata?)` - Report an event
60
+ - `send(payload)` - Send raw payload
61
+ - `startAutoReport()` - Start automatic reporting
62
+ - `stopAutoReport()` - Stop automatic reporting
63
+ - `enable()` / `disable()` - Toggle telemetry
64
+ - `isEnabled()` - Check if enabled
65
+ - `destroy()` - Cleanup resources
66
+
67
+ ## Payload Structure
68
+
69
+ ```typescript
70
+ interface TelemetryPayload {
71
+ machineId: string;
72
+ instanceName: string;
73
+ appName: string;
74
+ appVersion?: string;
75
+ sdkVersion: string;
76
+ event: string;
77
+ timestamp: string;
78
+ platform: string;
79
+ nodeVersion: string;
80
+ metadata?: Record<string, unknown>;
81
+ }
82
+ ```
83
+
84
+ ## License
85
+
86
+ MIT
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @microwiseai/telemetry
3
+ * Generic telemetry module for usage reporting
4
+ */
5
+ export type { TelemetryConfig, TelemetryPayload, PayloadOptions, StatusCallback, } from './types.js';
6
+ export { DEFAULTS } from './types.js';
7
+ export { TelemetryManager, createTelemetryManager } from './manager.js';
8
+ export { buildPayload, mergeMetadata } from './payload.js';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAGxE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @microwiseai/telemetry
3
+ * Generic telemetry module for usage reporting
4
+ */
5
+ export { DEFAULTS } from './types.js';
6
+ // Manager
7
+ export { TelemetryManager, createTelemetryManager } from './manager.js';
8
+ // Payload utilities
9
+ export { buildPayload, mergeMetadata } from './payload.js';
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,UAAU;AACV,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAExE,oBAAoB;AACpB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Telemetry manager
3
+ * Handles opt-in/opt-out and periodic reporting
4
+ */
5
+ import type { TelemetryConfig, TelemetryPayload, PayloadOptions, StatusCallback } from './types.js';
6
+ /**
7
+ * Telemetry manager class
8
+ */
9
+ export declare class TelemetryManager {
10
+ private enabled;
11
+ private config;
12
+ private intervalId?;
13
+ private timeoutId?;
14
+ private statusCallback?;
15
+ private baseOptions?;
16
+ constructor(config: TelemetryConfig);
17
+ /**
18
+ * Set base options for all payloads
19
+ */
20
+ setBaseOptions(options: Omit<PayloadOptions, 'event'>): void;
21
+ /**
22
+ * Set status callback for auto-reporting
23
+ */
24
+ setStatusCallback(callback: StatusCallback): void;
25
+ /**
26
+ * Report event to telemetry server
27
+ * Fire-and-forget, silent failure
28
+ */
29
+ report(event: string, metadata?: Record<string, unknown>): Promise<void>;
30
+ /**
31
+ * Send raw payload to telemetry server
32
+ */
33
+ send(payload: TelemetryPayload): Promise<void>;
34
+ /**
35
+ * Start automatic telemetry reporting
36
+ */
37
+ startAutoReport(): void;
38
+ /**
39
+ * Stop automatic telemetry reporting
40
+ */
41
+ stopAutoReport(): void;
42
+ /**
43
+ * Report current status using callback
44
+ */
45
+ private reportCurrentStatus;
46
+ /**
47
+ * Disable telemetry
48
+ */
49
+ disable(): void;
50
+ /**
51
+ * Enable telemetry
52
+ */
53
+ enable(): void;
54
+ /**
55
+ * Check if telemetry is enabled
56
+ */
57
+ isEnabled(): boolean;
58
+ /**
59
+ * Get the configured endpoint
60
+ */
61
+ getEndpoint(): string;
62
+ /**
63
+ * Cleanup (call on shutdown)
64
+ */
65
+ destroy(): void;
66
+ }
67
+ /**
68
+ * Create telemetry manager
69
+ */
70
+ export declare function createTelemetryManager(config: TelemetryConfig): TelemetryManager;
71
+ //# sourceMappingURL=manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../src/manager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAIpG;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,MAAM,CAA4D;IAC1E,OAAO,CAAC,UAAU,CAAC,CAAiC;IACpD,OAAO,CAAC,SAAS,CAAC,CAAgC;IAClD,OAAO,CAAC,cAAc,CAAC,CAAiB;IACxC,OAAO,CAAC,WAAW,CAAC,CAAgC;gBAExC,MAAM,EAAE,eAAe;IAUnC;;OAEG;IACH,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,GAAG,IAAI;IAI5D;;OAEG;IACH,iBAAiB,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IAIjD;;;OAGG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAqB9E;;OAEG;IACG,IAAI,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAsBpD;;OAEG;IACH,eAAe,IAAI,IAAI;IAqBvB;;OAEG;IACH,cAAc,IAAI,IAAI;IAWtB;;OAEG;YACW,mBAAmB;IAajC;;OAEG;IACH,OAAO,IAAI,IAAI;IAKf;;OAEG;IACH,MAAM,IAAI,IAAI;IAId;;OAEG;IACH,SAAS,IAAI,OAAO;IAIpB;;OAEG;IACH,WAAW,IAAI,MAAM;IAIrB;;OAEG;IACH,OAAO,IAAI,IAAI;CAGhB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,eAAe,GAAG,gBAAgB,CAEhF"}
@@ -0,0 +1,171 @@
1
+ /**
2
+ * Telemetry manager
3
+ * Handles opt-in/opt-out and periodic reporting
4
+ */
5
+ import { DEFAULTS } from './types.js';
6
+ import { buildPayload } from './payload.js';
7
+ /**
8
+ * Telemetry manager class
9
+ */
10
+ export class TelemetryManager {
11
+ enabled;
12
+ config;
13
+ intervalId;
14
+ timeoutId;
15
+ statusCallback;
16
+ baseOptions;
17
+ constructor(config) {
18
+ this.enabled = config.enabled ?? true;
19
+ this.config = {
20
+ endpoint: config.endpoint,
21
+ autoReportDelay: config.autoReportDelay ?? DEFAULTS.AUTO_REPORT_DELAY,
22
+ autoReportInterval: config.autoReportInterval ?? DEFAULTS.AUTO_REPORT_INTERVAL,
23
+ timeout: config.timeout ?? DEFAULTS.TIMEOUT,
24
+ };
25
+ }
26
+ /**
27
+ * Set base options for all payloads
28
+ */
29
+ setBaseOptions(options) {
30
+ this.baseOptions = options;
31
+ }
32
+ /**
33
+ * Set status callback for auto-reporting
34
+ */
35
+ setStatusCallback(callback) {
36
+ this.statusCallback = callback;
37
+ }
38
+ /**
39
+ * Report event to telemetry server
40
+ * Fire-and-forget, silent failure
41
+ */
42
+ async report(event, metadata) {
43
+ if (!this.enabled || !this.baseOptions) {
44
+ return;
45
+ }
46
+ try {
47
+ const payload = buildPayload({
48
+ ...this.baseOptions,
49
+ event,
50
+ metadata: {
51
+ ...this.baseOptions.metadata,
52
+ ...metadata,
53
+ },
54
+ });
55
+ await this.send(payload);
56
+ }
57
+ catch {
58
+ // Silent - never throw
59
+ }
60
+ }
61
+ /**
62
+ * Send raw payload to telemetry server
63
+ */
64
+ async send(payload) {
65
+ if (!this.enabled) {
66
+ return;
67
+ }
68
+ try {
69
+ // Fire and forget
70
+ fetch(this.config.endpoint, {
71
+ method: 'POST',
72
+ headers: {
73
+ 'Content-Type': 'application/json',
74
+ },
75
+ body: JSON.stringify(payload),
76
+ signal: AbortSignal.timeout(this.config.timeout),
77
+ }).catch(() => {
78
+ // Silent - never throw
79
+ });
80
+ }
81
+ catch {
82
+ // Silent - never throw
83
+ }
84
+ }
85
+ /**
86
+ * Start automatic telemetry reporting
87
+ */
88
+ startAutoReport() {
89
+ if (!this.enabled || !this.statusCallback) {
90
+ return;
91
+ }
92
+ // Prevent duplicate
93
+ if (this.intervalId) {
94
+ return;
95
+ }
96
+ // First report after delay
97
+ this.timeoutId = setTimeout(() => {
98
+ void this.reportCurrentStatus();
99
+ }, this.config.autoReportDelay);
100
+ // Periodic reports
101
+ this.intervalId = setInterval(() => {
102
+ void this.reportCurrentStatus();
103
+ }, this.config.autoReportInterval);
104
+ }
105
+ /**
106
+ * Stop automatic telemetry reporting
107
+ */
108
+ stopAutoReport() {
109
+ if (this.timeoutId) {
110
+ clearTimeout(this.timeoutId);
111
+ this.timeoutId = undefined;
112
+ }
113
+ if (this.intervalId) {
114
+ clearInterval(this.intervalId);
115
+ this.intervalId = undefined;
116
+ }
117
+ }
118
+ /**
119
+ * Report current status using callback
120
+ */
121
+ async reportCurrentStatus() {
122
+ if (!this.statusCallback) {
123
+ return;
124
+ }
125
+ try {
126
+ const status = await this.statusCallback();
127
+ await this.report(status);
128
+ }
129
+ catch {
130
+ // Silent - never throw
131
+ }
132
+ }
133
+ /**
134
+ * Disable telemetry
135
+ */
136
+ disable() {
137
+ this.enabled = false;
138
+ this.stopAutoReport();
139
+ }
140
+ /**
141
+ * Enable telemetry
142
+ */
143
+ enable() {
144
+ this.enabled = true;
145
+ }
146
+ /**
147
+ * Check if telemetry is enabled
148
+ */
149
+ isEnabled() {
150
+ return this.enabled;
151
+ }
152
+ /**
153
+ * Get the configured endpoint
154
+ */
155
+ getEndpoint() {
156
+ return this.config.endpoint;
157
+ }
158
+ /**
159
+ * Cleanup (call on shutdown)
160
+ */
161
+ destroy() {
162
+ this.stopAutoReport();
163
+ }
164
+ }
165
+ /**
166
+ * Create telemetry manager
167
+ */
168
+ export function createTelemetryManager(config) {
169
+ return new TelemetryManager(config);
170
+ }
171
+ //# sourceMappingURL=manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manager.js","sourceRoot":"","sources":["../src/manager.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Telemetry payload builder
3
+ */
4
+ import type { TelemetryPayload, PayloadOptions } from './types.js';
5
+ /**
6
+ * Build telemetry payload
7
+ */
8
+ export declare function buildPayload(options: PayloadOptions): TelemetryPayload;
9
+ /**
10
+ * Merge custom metadata into payload
11
+ */
12
+ export declare function mergeMetadata(payload: TelemetryPayload, metadata: Record<string, unknown>): TelemetryPayload;
13
+ //# sourceMappingURL=payload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../src/payload.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAGnE;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,cAAc,GAAG,gBAAgB,CAatE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,gBAAgB,EACzB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,gBAAgB,CAQlB"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Telemetry payload builder
3
+ */
4
+ import * as os from 'os';
5
+ import { DEFAULTS } from './types.js';
6
+ /**
7
+ * Build telemetry payload
8
+ */
9
+ export function buildPayload(options) {
10
+ return {
11
+ machineId: options.machineId,
12
+ instanceName: options.instanceName,
13
+ appName: options.appName,
14
+ appVersion: options.appVersion,
15
+ sdkVersion: DEFAULTS.SDK_VERSION,
16
+ event: options.event,
17
+ timestamp: new Date().toISOString(),
18
+ platform: os.platform(),
19
+ nodeVersion: process.version,
20
+ metadata: options.metadata,
21
+ };
22
+ }
23
+ /**
24
+ * Merge custom metadata into payload
25
+ */
26
+ export function mergeMetadata(payload, metadata) {
27
+ return {
28
+ ...payload,
29
+ metadata: {
30
+ ...payload.metadata,
31
+ ...metadata,
32
+ },
33
+ };
34
+ }
35
+ //# sourceMappingURL=payload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payload.js","sourceRoot":"","sources":["../src/payload.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAEzB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,OAAuB;IAClD,OAAO;QACL,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,YAAY,EAAE,OAAO,CAAC,YAAY;QAClC,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,UAAU,EAAE,QAAQ,CAAC,WAAW;QAChC,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACnC,QAAQ,EAAE,EAAE,CAAC,QAAQ,EAAE;QACvB,WAAW,EAAE,OAAO,CAAC,OAAO;QAC5B,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC3B,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAC3B,OAAyB,EACzB,QAAiC;IAEjC,OAAO;QACL,GAAG,OAAO;QACV,QAAQ,EAAE;YACR,GAAG,OAAO,CAAC,QAAQ;YACnB,GAAG,QAAQ;SACZ;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Telemetry type definitions
3
+ */
4
+ /**
5
+ * Telemetry configuration options
6
+ */
7
+ export interface TelemetryConfig {
8
+ /** Endpoint URL to send telemetry data */
9
+ endpoint: string;
10
+ /** Whether telemetry is enabled */
11
+ enabled?: boolean;
12
+ /** Whether to start auto-reporting */
13
+ autoReport?: boolean;
14
+ /** Initial delay before first auto-report (ms) */
15
+ autoReportDelay?: number;
16
+ /** Interval between auto-reports (ms) */
17
+ autoReportInterval?: number;
18
+ /** Request timeout (ms) */
19
+ timeout?: number;
20
+ }
21
+ /**
22
+ * Base telemetry payload
23
+ */
24
+ export interface TelemetryPayload {
25
+ /** Unique machine identifier */
26
+ machineId: string;
27
+ /** Instance name (hostname) */
28
+ instanceName: string;
29
+ /** Application or service name */
30
+ appName: string;
31
+ /** Application version */
32
+ appVersion?: string;
33
+ /** SDK version */
34
+ sdkVersion: string;
35
+ /** Event type or status */
36
+ event: string;
37
+ /** ISO 8601 timestamp */
38
+ timestamp: string;
39
+ /** Operating system platform */
40
+ platform: string;
41
+ /** Node.js version */
42
+ nodeVersion: string;
43
+ /** Additional custom metadata */
44
+ metadata?: Record<string, unknown>;
45
+ }
46
+ /**
47
+ * Options for building payload
48
+ */
49
+ export interface PayloadOptions {
50
+ /** Machine identifier */
51
+ machineId: string;
52
+ /** Instance name */
53
+ instanceName: string;
54
+ /** Application name */
55
+ appName: string;
56
+ /** Application version */
57
+ appVersion?: string;
58
+ /** Event type or status */
59
+ event: string;
60
+ /** Additional custom metadata */
61
+ metadata?: Record<string, unknown>;
62
+ }
63
+ /**
64
+ * Callback to get current status for auto-reporting
65
+ */
66
+ export type StatusCallback = () => string | Promise<string>;
67
+ /**
68
+ * Default configuration values
69
+ */
70
+ export declare const DEFAULTS: {
71
+ readonly TIMEOUT: 5000;
72
+ readonly AUTO_REPORT_DELAY: 10000;
73
+ readonly AUTO_REPORT_INTERVAL: number;
74
+ readonly SDK_VERSION: "0.1.0";
75
+ };
76
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,mCAAmC;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sCAAsC;IACtC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kDAAkD;IAClD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yCAAyC;IACzC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,2BAA2B;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,gCAAgC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,+BAA+B;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,0BAA0B;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,yBAAyB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,sBAAsB;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,yBAAyB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,0BAA0B;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAE5D;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;;CAKX,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Telemetry type definitions
3
+ */
4
+ /**
5
+ * Default configuration values
6
+ */
7
+ export const DEFAULTS = {
8
+ TIMEOUT: 5000,
9
+ AUTO_REPORT_DELAY: 10000,
10
+ AUTO_REPORT_INTERVAL: 30 * 60 * 1000, // 30 minutes
11
+ SDK_VERSION: '0.1.0',
12
+ };
13
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAqEH;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,OAAO,EAAE,IAAI;IACb,iBAAiB,EAAE,KAAK;IACxB,oBAAoB,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,aAAa;IACnD,WAAW,EAAE,OAAO;CACZ,CAAC"}
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@microwiseai/telemetry",
3
+ "version": "0.1.0",
4
+ "description": "Generic telemetry module for usage reporting",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "scripts": {
18
+ "build": "tsc",
19
+ "dev": "tsc --watch",
20
+ "test": "vitest run",
21
+ "test:watch": "vitest",
22
+ "test:coverage": "vitest run --coverage",
23
+ "typecheck": "tsc --noEmit",
24
+ "clean": "rm -rf dist",
25
+ "prepublishOnly": "npm run build"
26
+ },
27
+ "keywords": [
28
+ "telemetry",
29
+ "analytics",
30
+ "usage-tracking"
31
+ ],
32
+ "author": "MicrowiseAI",
33
+ "license": "MIT",
34
+ "engines": {
35
+ "node": ">=18.0.0"
36
+ },
37
+ "dependencies": {},
38
+ "devDependencies": {
39
+ "@types/node": "^20.11.0",
40
+ "typescript": "^5.3.3",
41
+ "vitest": "^2.0.0"
42
+ }
43
+ }
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.