@mapvx/web-js 4.0.2 → 4.0.3-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (339) hide show
  1. package/README.md +7 -7
  2. package/dist/cjs/index.js +4 -2
  3. package/dist/es/assets/icons.d.ts +0 -1
  4. package/dist/es/assets/icons.js +0 -50
  5. package/dist/es/config/draco.d.ts +0 -1
  6. package/dist/es/config/draco.js +0 -10
  7. package/dist/es/config/sdkConfig.d.ts +0 -1
  8. package/dist/es/config/sdkConfig.js +0 -1
  9. package/dist/es/controllers/markerLayoutController.d.ts +0 -1
  10. package/dist/es/controllers/markerLayoutController.js +0 -103
  11. package/dist/es/controllers/routeController.d.ts +0 -1
  12. package/dist/es/controllers/routeController.js +1 -473
  13. package/dist/es/domain/models/_internal.d.ts +0 -1
  14. package/dist/es/domain/models/_internal.js +0 -8
  15. package/dist/es/domain/models/animation.d.ts +0 -1
  16. package/dist/es/domain/models/animation.js +0 -6
  17. package/dist/es/domain/models/banner.d.ts +0 -1
  18. package/dist/es/domain/models/banner.js +0 -10
  19. package/dist/es/domain/models/campaign.d.ts +0 -1
  20. package/dist/es/domain/models/campaign.js +0 -29
  21. package/dist/es/domain/models/categories.d.ts +0 -1
  22. package/dist/es/domain/models/categories.js +0 -20
  23. package/dist/es/domain/models/circle.d.ts +0 -1
  24. package/dist/es/domain/models/circle.js +0 -118
  25. package/dist/es/domain/models/cityFilterOption.d.ts +0 -1
  26. package/dist/es/domain/models/cityFilterOption.js +0 -1
  27. package/dist/es/domain/models/configuration.d.ts +0 -1
  28. package/dist/es/domain/models/configuration.js +0 -1
  29. package/dist/es/domain/models/cssCustomization.d.ts +0 -1
  30. package/dist/es/domain/models/cssCustomization.js +0 -1
  31. package/dist/es/domain/models/fitOptions.d.ts +0 -1
  32. package/dist/es/domain/models/fitOptions.js +0 -1
  33. package/dist/es/domain/models/innerFloors.d.ts +0 -1
  34. package/dist/es/domain/models/innerFloors.js +0 -1
  35. package/dist/es/domain/models/institution.d.ts +0 -1
  36. package/dist/es/domain/models/institution.js +0 -26
  37. package/dist/es/domain/models/latLng.d.ts +0 -1
  38. package/dist/es/domain/models/latLng.js +0 -1
  39. package/dist/es/domain/models/location.d.ts +0 -1
  40. package/dist/es/domain/models/location.js +0 -1
  41. package/dist/es/domain/models/loggeable.d.ts +0 -1
  42. package/dist/es/domain/models/loggeable.js +0 -24
  43. package/dist/es/domain/models/mapCamera.d.ts +0 -1
  44. package/dist/es/domain/models/mapCamera.js +0 -1
  45. package/dist/es/domain/models/mapConfig.d.ts +0 -1
  46. package/dist/es/domain/models/mapConfig.js +1 -17
  47. package/dist/es/domain/models/marker.d.ts +0 -1
  48. package/dist/es/domain/models/marker.js +0 -292
  49. package/dist/es/domain/models/multilanguage.d.ts +0 -1
  50. package/dist/es/domain/models/multilanguage.js +0 -10
  51. package/dist/es/domain/models/openingHours.d.ts +0 -1
  52. package/dist/es/domain/models/openingHours.js +0 -1
  53. package/dist/es/domain/models/place.d.ts +0 -1
  54. package/dist/es/domain/models/place.js +0 -68
  55. package/dist/es/domain/models/platform.d.ts +0 -1
  56. package/dist/es/domain/models/platform.js +0 -1
  57. package/dist/es/domain/models/popover.d.ts +0 -1
  58. package/dist/es/domain/models/popover.js +0 -1
  59. package/dist/es/domain/models/product.d.ts +0 -1
  60. package/dist/es/domain/models/product.js +0 -1
  61. package/dist/es/domain/models/property.d.ts +0 -1
  62. package/dist/es/domain/models/property.js +0 -16
  63. package/dist/es/domain/models/route.d.ts +0 -1
  64. package/dist/es/domain/models/route.js +0 -71
  65. package/dist/es/domain/models/routeConfiguration.d.ts +0 -1
  66. package/dist/es/domain/models/routeConfiguration.js +0 -36
  67. package/dist/es/domain/models/routeInstance.d.ts +0 -1
  68. package/dist/es/domain/models/routeInstance.js +0 -8
  69. package/dist/es/domain/models/routeStyle.d.ts +0 -1
  70. package/dist/es/domain/models/routeStyle.js +0 -1
  71. package/dist/es/domain/models/scene3D.d.ts +0 -1
  72. package/dist/es/domain/models/scene3D.js +0 -1
  73. package/dist/es/domain/models/transport.d.ts +0 -1
  74. package/dist/es/domain/models/transport.js +0 -12
  75. package/dist/es/domain/ports/ICache.d.ts +0 -1
  76. package/dist/es/domain/ports/ICache.js +0 -1
  77. package/dist/es/domain/ports/IHttpClient.d.ts +0 -1
  78. package/dist/es/domain/ports/IHttpClient.js +0 -1
  79. package/dist/es/domain/ports/ILogger.d.ts +0 -1
  80. package/dist/es/domain/ports/ILogger.js +0 -9
  81. package/dist/es/domain/ports/index.d.ts +0 -1
  82. package/dist/es/domain/ports/index.js +0 -5
  83. package/dist/es/index.d.ts +0 -1
  84. package/dist/es/index.js +1 -28
  85. package/dist/es/infrastructure/cache/CacheManager.d.ts +0 -1
  86. package/dist/es/infrastructure/cache/CacheManager.js +0 -94
  87. package/dist/es/infrastructure/cache/LRUCache.d.ts +0 -1
  88. package/dist/es/infrastructure/cache/LRUCache.js +0 -57
  89. package/dist/es/infrastructure/cache/PersistentCache.d.ts +0 -1
  90. package/dist/es/infrastructure/cache/PersistentCache.js +0 -51
  91. package/dist/es/infrastructure/cache/cacheConfig.d.ts +0 -1
  92. package/dist/es/infrastructure/cache/cacheConfig.js +8 -27
  93. package/dist/es/infrastructure/http/FetchHttpClient.d.ts +0 -1
  94. package/dist/es/infrastructure/http/FetchHttpClient.js +0 -36
  95. package/dist/es/infrastructure/logging/MVXLogger.d.ts +0 -1
  96. package/dist/es/infrastructure/logging/MVXLogger.js +0 -37
  97. package/dist/es/interfaces/cache.d.ts +0 -1
  98. package/dist/es/interfaces/cache.js +0 -1
  99. package/dist/es/interfaces/healthResponse.d.ts +0 -1
  100. package/dist/es/interfaces/healthResponse.js +0 -1
  101. package/dist/es/interfaces/institutionResponse.d.ts +0 -1
  102. package/dist/es/interfaces/institutionResponse.js +0 -1
  103. package/dist/es/interfaces/metadata.d.ts +0 -1
  104. package/dist/es/interfaces/metadata.js +0 -1
  105. package/dist/es/interfaces/placeResponse.d.ts +0 -1
  106. package/dist/es/interfaces/placeResponse.js +0 -1
  107. package/dist/es/interfaces/routeCacheResponse.d.ts +0 -1
  108. package/dist/es/interfaces/routeCacheResponse.js +0 -1
  109. package/dist/es/interfaces/routeResponse.d.ts +0 -1
  110. package/dist/es/interfaces/routeResponse.js +0 -1
  111. package/dist/es/interfaces/styleResponse.d.ts +0 -1
  112. package/dist/es/interfaces/styleResponse.js +0 -1
  113. package/dist/es/logger/logger.d.ts +0 -1
  114. package/dist/es/logger/logger.js +0 -10
  115. package/dist/es/logger/sentry.d.ts +0 -1
  116. package/dist/es/logger/sentry.js +1 -39
  117. package/dist/es/map/fitCamera.d.ts +0 -1
  118. package/dist/es/map/fitCamera.js +0 -44
  119. package/dist/es/map/generated/maplibreWorkerSource.d.ts +0 -1
  120. package/dist/es/map/generated/maplibreWorkerSource.js +0 -12
  121. package/dist/es/map/installMapLibreWorker.d.ts +0 -1
  122. package/dist/es/map/installMapLibreWorker.js +0 -100
  123. package/dist/es/map/liveMapFitTransform.d.ts +0 -1
  124. package/dist/es/map/liveMapFitTransform.js +0 -82
  125. package/dist/es/map/map.d.ts +0 -1
  126. package/dist/es/map/map.js +4 -681
  127. package/dist/es/map/mapInteractionOptions.d.ts +0 -1
  128. package/dist/es/map/mapInteractionOptions.js +0 -35
  129. package/dist/es/map/scene3DController.d.ts +0 -1
  130. package/dist/es/map/scene3DController.js +0 -221
  131. package/dist/es/repository/repository.d.ts +0 -1
  132. package/dist/es/repository/repository.js +0 -56
  133. package/dist/es/repository/requester.d.ts +0 -1
  134. package/dist/es/repository/requester.js +0 -233
  135. package/dist/es/sdk.d.ts +0 -1
  136. package/dist/es/sdk.js +0 -35
  137. package/dist/es/utils/3d.d.ts +0 -1
  138. package/dist/es/utils/3d.js +0 -79
  139. package/dist/es/utils/deckLayers.d.ts +0 -1
  140. package/dist/es/utils/deckLayers.js +1 -27
  141. package/dist/es/utils/error.d.ts +0 -1
  142. package/dist/es/utils/error.js +0 -7
  143. package/dist/es/utils/images.d.ts +0 -1
  144. package/dist/es/utils/images.js +0 -7
  145. package/dist/es/utils/loadGlb.d.ts +0 -1
  146. package/dist/es/utils/loadGlb.js +2 -96
  147. package/dist/es/utils/mapvxHostname.d.ts +0 -1
  148. package/dist/es/utils/mapvxHostname.js +0 -11
  149. package/dist/es/utils/nav-functions.d.ts +0 -1
  150. package/dist/es/utils/nav-functions.js +0 -82
  151. package/dist/es/utils/opening-hours-helper.d.ts +0 -1
  152. package/dist/es/utils/opening-hours-helper.js +6 -382
  153. package/dist/es/utils/preconnect.d.ts +0 -1
  154. package/dist/es/utils/preconnect.js +0 -61
  155. package/dist/es/utils/route-utils.d.ts +0 -1
  156. package/dist/es/utils/route-utils.js +0 -25
  157. package/dist/es/utils/semaphore.d.ts +0 -1
  158. package/dist/es/utils/semaphore.js +0 -78
  159. package/dist/es/utils/three.d.ts +0 -1
  160. package/dist/es/utils/three.js +0 -43
  161. package/dist/es/utils/threeScene.d.ts +0 -1
  162. package/dist/es/utils/threeScene.js +0 -38
  163. package/dist/es/utils/update-css.d.ts +0 -1
  164. package/dist/es/utils/update-css.js +0 -26
  165. package/dist/es/utils/utils.d.ts +0 -1
  166. package/dist/es/utils/utils.js +0 -53
  167. package/dist/umd/index.js +4 -29240
  168. package/dist/umd/index.js.LICENSE.txt +1 -0
  169. package/dist/umd/styles.css +0 -1
  170. package/dist/umd/styles.js +3 -32
  171. package/package.json +12 -6
  172. package/dist/cjs/index.js.map +0 -1
  173. package/dist/es/assets/icons.d.ts.map +0 -1
  174. package/dist/es/assets/icons.js.map +0 -1
  175. package/dist/es/config/draco.d.ts.map +0 -1
  176. package/dist/es/config/draco.js.map +0 -1
  177. package/dist/es/config/sdkConfig.d.ts.map +0 -1
  178. package/dist/es/config/sdkConfig.js.map +0 -1
  179. package/dist/es/controllers/markerLayoutController.d.ts.map +0 -1
  180. package/dist/es/controllers/markerLayoutController.js.map +0 -1
  181. package/dist/es/controllers/routeController.d.ts.map +0 -1
  182. package/dist/es/controllers/routeController.js.map +0 -1
  183. package/dist/es/domain/models/_internal.d.ts.map +0 -1
  184. package/dist/es/domain/models/_internal.js.map +0 -1
  185. package/dist/es/domain/models/animation.d.ts.map +0 -1
  186. package/dist/es/domain/models/animation.js.map +0 -1
  187. package/dist/es/domain/models/banner.d.ts.map +0 -1
  188. package/dist/es/domain/models/banner.js.map +0 -1
  189. package/dist/es/domain/models/campaign.d.ts.map +0 -1
  190. package/dist/es/domain/models/campaign.js.map +0 -1
  191. package/dist/es/domain/models/categories.d.ts.map +0 -1
  192. package/dist/es/domain/models/categories.js.map +0 -1
  193. package/dist/es/domain/models/circle.d.ts.map +0 -1
  194. package/dist/es/domain/models/circle.js.map +0 -1
  195. package/dist/es/domain/models/cityFilterOption.d.ts.map +0 -1
  196. package/dist/es/domain/models/cityFilterOption.js.map +0 -1
  197. package/dist/es/domain/models/configuration.d.ts.map +0 -1
  198. package/dist/es/domain/models/configuration.js.map +0 -1
  199. package/dist/es/domain/models/cssCustomization.d.ts.map +0 -1
  200. package/dist/es/domain/models/cssCustomization.js.map +0 -1
  201. package/dist/es/domain/models/fitOptions.d.ts.map +0 -1
  202. package/dist/es/domain/models/fitOptions.js.map +0 -1
  203. package/dist/es/domain/models/innerFloors.d.ts.map +0 -1
  204. package/dist/es/domain/models/innerFloors.js.map +0 -1
  205. package/dist/es/domain/models/institution.d.ts.map +0 -1
  206. package/dist/es/domain/models/institution.js.map +0 -1
  207. package/dist/es/domain/models/latLng.d.ts.map +0 -1
  208. package/dist/es/domain/models/latLng.js.map +0 -1
  209. package/dist/es/domain/models/location.d.ts.map +0 -1
  210. package/dist/es/domain/models/location.js.map +0 -1
  211. package/dist/es/domain/models/loggeable.d.ts.map +0 -1
  212. package/dist/es/domain/models/loggeable.js.map +0 -1
  213. package/dist/es/domain/models/mapCamera.d.ts.map +0 -1
  214. package/dist/es/domain/models/mapCamera.js.map +0 -1
  215. package/dist/es/domain/models/mapConfig.d.ts.map +0 -1
  216. package/dist/es/domain/models/mapConfig.js.map +0 -1
  217. package/dist/es/domain/models/marker.d.ts.map +0 -1
  218. package/dist/es/domain/models/marker.js.map +0 -1
  219. package/dist/es/domain/models/multilanguage.d.ts.map +0 -1
  220. package/dist/es/domain/models/multilanguage.js.map +0 -1
  221. package/dist/es/domain/models/openingHours.d.ts.map +0 -1
  222. package/dist/es/domain/models/openingHours.js.map +0 -1
  223. package/dist/es/domain/models/place.d.ts.map +0 -1
  224. package/dist/es/domain/models/place.js.map +0 -1
  225. package/dist/es/domain/models/platform.d.ts.map +0 -1
  226. package/dist/es/domain/models/platform.js.map +0 -1
  227. package/dist/es/domain/models/popover.d.ts.map +0 -1
  228. package/dist/es/domain/models/popover.js.map +0 -1
  229. package/dist/es/domain/models/product.d.ts.map +0 -1
  230. package/dist/es/domain/models/product.js.map +0 -1
  231. package/dist/es/domain/models/property.d.ts.map +0 -1
  232. package/dist/es/domain/models/property.js.map +0 -1
  233. package/dist/es/domain/models/route.d.ts.map +0 -1
  234. package/dist/es/domain/models/route.js.map +0 -1
  235. package/dist/es/domain/models/routeConfiguration.d.ts.map +0 -1
  236. package/dist/es/domain/models/routeConfiguration.js.map +0 -1
  237. package/dist/es/domain/models/routeInstance.d.ts.map +0 -1
  238. package/dist/es/domain/models/routeInstance.js.map +0 -1
  239. package/dist/es/domain/models/routeStyle.d.ts.map +0 -1
  240. package/dist/es/domain/models/routeStyle.js.map +0 -1
  241. package/dist/es/domain/models/scene3D.d.ts.map +0 -1
  242. package/dist/es/domain/models/scene3D.js.map +0 -1
  243. package/dist/es/domain/models/transport.d.ts.map +0 -1
  244. package/dist/es/domain/models/transport.js.map +0 -1
  245. package/dist/es/domain/ports/ICache.d.ts.map +0 -1
  246. package/dist/es/domain/ports/ICache.js.map +0 -1
  247. package/dist/es/domain/ports/IHttpClient.d.ts.map +0 -1
  248. package/dist/es/domain/ports/IHttpClient.js.map +0 -1
  249. package/dist/es/domain/ports/ILogger.d.ts.map +0 -1
  250. package/dist/es/domain/ports/ILogger.js.map +0 -1
  251. package/dist/es/domain/ports/index.d.ts.map +0 -1
  252. package/dist/es/domain/ports/index.js.map +0 -1
  253. package/dist/es/index.d.ts.map +0 -1
  254. package/dist/es/index.js.map +0 -1
  255. package/dist/es/infrastructure/cache/CacheManager.d.ts.map +0 -1
  256. package/dist/es/infrastructure/cache/CacheManager.js.map +0 -1
  257. package/dist/es/infrastructure/cache/LRUCache.d.ts.map +0 -1
  258. package/dist/es/infrastructure/cache/LRUCache.js.map +0 -1
  259. package/dist/es/infrastructure/cache/PersistentCache.d.ts.map +0 -1
  260. package/dist/es/infrastructure/cache/PersistentCache.js.map +0 -1
  261. package/dist/es/infrastructure/cache/cacheConfig.d.ts.map +0 -1
  262. package/dist/es/infrastructure/cache/cacheConfig.js.map +0 -1
  263. package/dist/es/infrastructure/http/FetchHttpClient.d.ts.map +0 -1
  264. package/dist/es/infrastructure/http/FetchHttpClient.js.map +0 -1
  265. package/dist/es/infrastructure/logging/MVXLogger.d.ts.map +0 -1
  266. package/dist/es/infrastructure/logging/MVXLogger.js.map +0 -1
  267. package/dist/es/interfaces/cache.d.ts.map +0 -1
  268. package/dist/es/interfaces/cache.js.map +0 -1
  269. package/dist/es/interfaces/healthResponse.d.ts.map +0 -1
  270. package/dist/es/interfaces/healthResponse.js.map +0 -1
  271. package/dist/es/interfaces/institutionResponse.d.ts.map +0 -1
  272. package/dist/es/interfaces/institutionResponse.js.map +0 -1
  273. package/dist/es/interfaces/metadata.d.ts.map +0 -1
  274. package/dist/es/interfaces/metadata.js.map +0 -1
  275. package/dist/es/interfaces/placeResponse.d.ts.map +0 -1
  276. package/dist/es/interfaces/placeResponse.js.map +0 -1
  277. package/dist/es/interfaces/routeCacheResponse.d.ts.map +0 -1
  278. package/dist/es/interfaces/routeCacheResponse.js.map +0 -1
  279. package/dist/es/interfaces/routeResponse.d.ts.map +0 -1
  280. package/dist/es/interfaces/routeResponse.js.map +0 -1
  281. package/dist/es/interfaces/styleResponse.d.ts.map +0 -1
  282. package/dist/es/interfaces/styleResponse.js.map +0 -1
  283. package/dist/es/logger/logger.d.ts.map +0 -1
  284. package/dist/es/logger/logger.js.map +0 -1
  285. package/dist/es/logger/sentry.d.ts.map +0 -1
  286. package/dist/es/logger/sentry.js.map +0 -1
  287. package/dist/es/map/fitCamera.d.ts.map +0 -1
  288. package/dist/es/map/fitCamera.js.map +0 -1
  289. package/dist/es/map/generated/maplibreWorkerSource.d.ts.map +0 -1
  290. package/dist/es/map/generated/maplibreWorkerSource.js.map +0 -1
  291. package/dist/es/map/installMapLibreWorker.d.ts.map +0 -1
  292. package/dist/es/map/installMapLibreWorker.js.map +0 -1
  293. package/dist/es/map/liveMapFitTransform.d.ts.map +0 -1
  294. package/dist/es/map/liveMapFitTransform.js.map +0 -1
  295. package/dist/es/map/map.d.ts.map +0 -1
  296. package/dist/es/map/map.js.map +0 -1
  297. package/dist/es/map/mapInteractionOptions.d.ts.map +0 -1
  298. package/dist/es/map/mapInteractionOptions.js.map +0 -1
  299. package/dist/es/map/scene3DController.d.ts.map +0 -1
  300. package/dist/es/map/scene3DController.js.map +0 -1
  301. package/dist/es/repository/repository.d.ts.map +0 -1
  302. package/dist/es/repository/repository.js.map +0 -1
  303. package/dist/es/repository/requester.d.ts.map +0 -1
  304. package/dist/es/repository/requester.js.map +0 -1
  305. package/dist/es/sdk.d.ts.map +0 -1
  306. package/dist/es/sdk.js.map +0 -1
  307. package/dist/es/utils/3d.d.ts.map +0 -1
  308. package/dist/es/utils/3d.js.map +0 -1
  309. package/dist/es/utils/deckLayers.d.ts.map +0 -1
  310. package/dist/es/utils/deckLayers.js.map +0 -1
  311. package/dist/es/utils/error.d.ts.map +0 -1
  312. package/dist/es/utils/error.js.map +0 -1
  313. package/dist/es/utils/images.d.ts.map +0 -1
  314. package/dist/es/utils/images.js.map +0 -1
  315. package/dist/es/utils/loadGlb.d.ts.map +0 -1
  316. package/dist/es/utils/loadGlb.js.map +0 -1
  317. package/dist/es/utils/mapvxHostname.d.ts.map +0 -1
  318. package/dist/es/utils/mapvxHostname.js.map +0 -1
  319. package/dist/es/utils/nav-functions.d.ts.map +0 -1
  320. package/dist/es/utils/nav-functions.js.map +0 -1
  321. package/dist/es/utils/opening-hours-helper.d.ts.map +0 -1
  322. package/dist/es/utils/opening-hours-helper.js.map +0 -1
  323. package/dist/es/utils/preconnect.d.ts.map +0 -1
  324. package/dist/es/utils/preconnect.js.map +0 -1
  325. package/dist/es/utils/route-utils.d.ts.map +0 -1
  326. package/dist/es/utils/route-utils.js.map +0 -1
  327. package/dist/es/utils/semaphore.d.ts.map +0 -1
  328. package/dist/es/utils/semaphore.js.map +0 -1
  329. package/dist/es/utils/three.d.ts.map +0 -1
  330. package/dist/es/utils/three.js.map +0 -1
  331. package/dist/es/utils/threeScene.d.ts.map +0 -1
  332. package/dist/es/utils/threeScene.js.map +0 -1
  333. package/dist/es/utils/update-css.d.ts.map +0 -1
  334. package/dist/es/utils/update-css.js.map +0 -1
  335. package/dist/es/utils/utils.d.ts.map +0 -1
  336. package/dist/es/utils/utils.js.map +0 -1
  337. package/dist/umd/index.js.map +0 -1
  338. package/dist/umd/styles.css.map +0 -1
  339. package/dist/umd/styles.js.map +0 -1
@@ -1,63 +1,30 @@
1
- /**
2
- * LRU (Least Recently Used) Cache implementation
3
- * Implements the ICache interface with:
4
- * - Configurable capacity limits
5
- * - TTL-based expiration
6
- * - LRU eviction policy
7
- * - Hit rate tracking
8
- *
9
- * @typeParam T - The type of values stored in the cache
10
- * @group Configuration
11
- *
12
- * @example
13
- * ```typescript
14
- * const cache = new LRUCache<string>({ maxItems: 100, ttlMs: 60000 })
15
- * cache.set("key1", "value1")
16
- * const value = cache.get("key1") // "value1"
17
- * ```
18
- */
19
1
  export class LRUCache {
20
2
  constructor(config) {
21
- // Hit rate tracking
22
3
  this.hits = 0;
23
4
  this.misses = 0;
24
- // Monotonic counter for LRU ordering (avoids issues with same-millisecond operations)
25
5
  this.accessCounter = 0;
26
6
  this.cache = new Map();
27
7
  this.maxItems = config.maxItems;
28
8
  this.ttlMs = config.ttlMs;
29
9
  }
30
- /**
31
- * Retrieves a value from the cache
32
- * Updates access time for LRU tracking
33
- * Returns undefined if key doesn't exist or is expired
34
- */
35
10
  get(key) {
36
11
  const entry = this.cache.get(key);
37
12
  if (!entry) {
38
13
  this.misses++;
39
14
  return undefined;
40
15
  }
41
- // Check TTL expiration (skip if ttlMs is 0)
42
16
  if (this.ttlMs > 0 && this.isExpired(entry)) {
43
17
  this.cache.delete(key);
44
18
  this.misses++;
45
19
  return undefined;
46
20
  }
47
- // Update access time for LRU (using monotonic counter)
48
21
  entry.accessTime = ++this.accessCounter;
49
22
  this.hits++;
50
23
  return entry.value;
51
24
  }
52
- /**
53
- * Stores a value in the cache
54
- * Evicts LRU item if at capacity
55
- * Refreshes TTL for existing keys
56
- */
57
25
  set(key, value) {
58
26
  const now = Date.now();
59
27
  const accessTime = ++this.accessCounter;
60
- // If key already exists, update it (no eviction needed)
61
28
  if (this.cache.has(key)) {
62
29
  this.cache.set(key, {
63
30
  value,
@@ -66,7 +33,6 @@ export class LRUCache {
66
33
  });
67
34
  return;
68
35
  }
69
- // Evict if at capacity
70
36
  if (this.cache.size >= this.maxItems) {
71
37
  this.evictLRU();
72
38
  }
@@ -76,44 +42,28 @@ export class LRUCache {
76
42
  accessTime,
77
43
  });
78
44
  }
79
- /**
80
- * Checks if a key exists and is not expired
81
- */
82
45
  has(key) {
83
46
  const entry = this.cache.get(key);
84
47
  if (!entry) {
85
48
  return false;
86
49
  }
87
- // Check TTL expiration
88
50
  if (this.ttlMs > 0 && this.isExpired(entry)) {
89
51
  this.cache.delete(key);
90
52
  return false;
91
53
  }
92
54
  return true;
93
55
  }
94
- /**
95
- * Removes a specific key from the cache
96
- */
97
56
  delete(key) {
98
57
  return this.cache.delete(key);
99
58
  }
100
- /**
101
- * Removes all entries from the cache
102
- */
103
59
  clear() {
104
60
  this.cache.clear();
105
61
  this.hits = 0;
106
62
  this.misses = 0;
107
63
  }
108
- /**
109
- * Returns all keys in the cache
110
- */
111
64
  keys() {
112
65
  return Array.from(this.cache.keys());
113
66
  }
114
- /**
115
- * Returns cache statistics
116
- */
117
67
  getStats() {
118
68
  const totalRequests = this.hits + this.misses;
119
69
  const hitRate = totalRequests > 0 ? (this.hits / totalRequests) * 100 : undefined;
@@ -123,15 +73,9 @@ export class LRUCache {
123
73
  hitRate,
124
74
  };
125
75
  }
126
- /**
127
- * Checks if an entry has expired based on TTL
128
- */
129
76
  isExpired(entry) {
130
77
  return Date.now() - entry.timestamp > this.ttlMs;
131
78
  }
132
- /**
133
- * Evicts the least recently used item from the cache
134
- */
135
79
  evictLRU() {
136
80
  let oldestKey = null;
137
81
  let oldestAccessTime = Infinity;
@@ -146,4 +90,3 @@ export class LRUCache {
146
90
  }
147
91
  }
148
92
  }
149
- //# sourceMappingURL=LRUCache.js.map
@@ -63,4 +63,3 @@ export declare class PersistentCache<T> implements ICache<T> {
63
63
  */
64
64
  private isStorageAvailable;
65
65
  }
66
- //# sourceMappingURL=PersistentCache.d.ts.map
@@ -1,37 +1,6 @@
1
1
  import { DEFAULT_MAX_STORAGE_BYTES } from "./cacheConfig";
2
2
  import { LRUCache } from "./LRUCache";
3
- /**
4
- * Persistent Cache implementation (Decorator pattern)
5
- * Wraps LRUCache with localStorage persistence.
6
- *
7
- * Features:
8
- * - Automatic save to localStorage on modifications
9
- * - Hydration from localStorage on initialization
10
- * - Graceful degradation when localStorage unavailable
11
- * - Storage quota management
12
- * - Expired items filtered during hydration
13
- *
14
- * @typeParam T - The type of values stored in the cache
15
- * @group Configuration
16
- *
17
- * @example
18
- * ```typescript
19
- * const cache = new PersistentCache<string>({
20
- * maxItems: 100,
21
- * ttlMs: 60000,
22
- * persistenceKey: "my_cache"
23
- * })
24
- * cache.set("key1", "value1") // Saved to memory and localStorage
25
- * ```
26
- */
27
3
  export class PersistentCache {
28
- /**
29
- * @param config - Cache configuration (limits, TTL, persistence key).
30
- * @param maxStorageBytes - Optional per-cache localStorage budget.
31
- * @param deserialize - Optional reviver applied to each value read back from
32
- * localStorage. `JSON.parse` strips class prototypes, so values that carry
33
- * methods (e.g. `MVXPlace`) must be rebuilt here; plain-data caches omit it.
34
- */
35
4
  constructor(config, maxStorageBytes, deserialize) {
36
5
  this.storageAvailable = true;
37
6
  this.lruCache = new LRUCache(config);
@@ -68,9 +37,6 @@ export class PersistentCache {
68
37
  getStats() {
69
38
  return this.lruCache.getStats();
70
39
  }
71
- /**
72
- * Loads cache data from localStorage on initialization
73
- */
74
40
  hydrate() {
75
41
  if (!this.isStorageAvailable()) {
76
42
  this.storageAvailable = false;
@@ -86,22 +52,16 @@ export class PersistentCache {
86
52
  }
87
53
  const now = Date.now();
88
54
  for (const entry of data.entries) {
89
- // Skip expired entries (if TTL is configured)
90
55
  if (this.ttlMs > 0 && now - entry.timestamp > this.ttlMs) {
91
56
  continue;
92
57
  }
93
- // Restore to LRU cache, reviving class prototypes stripped by JSON when needed.
94
58
  this.lruCache.set(entry.key, this.deserialize ? this.deserialize(entry.value) : entry.value);
95
59
  }
96
60
  }
97
61
  catch (_a) {
98
- // Corrupted data or storage error - start with empty cache
99
62
  this.storageAvailable = this.isStorageAvailable();
100
63
  }
101
64
  }
102
- /**
103
- * Saves current cache state to localStorage
104
- */
105
65
  persist() {
106
66
  if (!this.storageAvailable)
107
67
  return;
@@ -121,21 +81,15 @@ export class PersistentCache {
121
81
  }
122
82
  const data = { entries };
123
83
  const serialized = JSON.stringify(data);
124
- // Check storage quota
125
84
  if (serialized.length > this.maxStorageBytes) {
126
- // Skip persistence if too large
127
85
  return;
128
86
  }
129
87
  localStorage.setItem(this.persistenceKey, serialized);
130
88
  }
131
89
  catch (_a) {
132
- // Storage quota exceeded or other error
133
90
  this.storageAvailable = false;
134
91
  }
135
92
  }
136
- /**
137
- * Removes cache data from localStorage
138
- */
139
93
  removeFromStorage() {
140
94
  if (!this.storageAvailable)
141
95
  return;
@@ -143,12 +97,8 @@ export class PersistentCache {
143
97
  localStorage.removeItem(this.persistenceKey);
144
98
  }
145
99
  catch (_a) {
146
- // Ignore errors
147
100
  }
148
101
  }
149
- /**
150
- * Checks if localStorage is available
151
- */
152
102
  isStorageAvailable() {
153
103
  try {
154
104
  const testKey = "__storage_test__";
@@ -161,4 +111,3 @@ export class PersistentCache {
161
111
  }
162
112
  }
163
113
  }
164
- //# sourceMappingURL=PersistentCache.js.map
@@ -48,4 +48,3 @@ export declare const DEFAULT_CACHE_CONFIGS: Record<CacheType, CacheConfig>;
48
48
  * @returns Complete cache configuration
49
49
  */
50
50
  export declare function getCacheConfig(cacheType: CacheType, userConfig?: Partial<CacheConfig>): CacheConfig;
51
- //# sourceMappingURL=cacheConfig.d.ts.map
@@ -1,66 +1,47 @@
1
- /**
2
- * Cache configuration types and defaults
3
- * Defines the configuration options for the caching system
4
- * @module cacheConfig
5
- */
6
- /**
7
- * Default maximum storage size: 5MB
8
- */
9
1
  export const DEFAULT_MAX_STORAGE_BYTES = 5 * 1024 * 1024;
10
- /**
11
- * Default cache configurations per type
12
- * These values balance memory usage with performance
13
- */
14
2
  export const DEFAULT_CACHE_CONFIGS = {
15
3
  places: {
16
4
  maxItems: 500,
17
- ttlMs: 30 * 60 * 1000, // 30 minutes
5
+ ttlMs: 30 * 60 * 1000,
18
6
  persistenceKey: "mvx_places",
19
7
  },
20
8
  routes: {
21
9
  maxItems: 100,
22
- ttlMs: 5 * 60 * 1000, // 5 minutes
10
+ ttlMs: 5 * 60 * 1000,
23
11
  persistenceKey: "mvx_routes",
24
12
  },
25
13
  accessibleRoutes: {
26
14
  maxItems: 100,
27
- ttlMs: 5 * 60 * 1000, // 5 minutes
15
+ ttlMs: 5 * 60 * 1000,
28
16
  persistenceKey: "mvx_accessible_routes",
29
17
  },
30
18
  configurations: {
31
19
  maxItems: 10,
32
- ttlMs: 60 * 60 * 1000, // 1 hour
20
+ ttlMs: 60 * 60 * 1000,
33
21
  persistenceKey: "mvx_configurations",
34
22
  },
35
23
  categories: {
36
24
  maxItems: 20,
37
- ttlMs: 60 * 60 * 1000, // 1 hour
25
+ ttlMs: 60 * 60 * 1000,
38
26
  persistenceKey: "mvx_categories",
39
27
  },
40
28
  vehicles: {
41
29
  maxItems: 50,
42
- ttlMs: 60 * 1000, // 1 minute
30
+ ttlMs: 60 * 1000,
43
31
  persistenceKey: "mvx_vehicles",
44
32
  },
45
33
  stops: {
46
34
  maxItems: 100,
47
- ttlMs: 60 * 1000, // 1 minute
35
+ ttlMs: 60 * 1000,
48
36
  persistenceKey: "mvx_stops",
49
37
  },
50
38
  subPlaces: {
51
39
  maxItems: 200,
52
- ttlMs: 15 * 60 * 1000, // 15 minutes
40
+ ttlMs: 15 * 60 * 1000,
53
41
  persistenceKey: "mvx_subplaces",
54
42
  },
55
43
  };
56
- /**
57
- * Merges user config with defaults for a specific cache type
58
- * @param cacheType - The type of cache
59
- * @param userConfig - Optional user-provided configuration
60
- * @returns Complete cache configuration
61
- */
62
44
  export function getCacheConfig(cacheType, userConfig) {
63
45
  const defaultConfig = DEFAULT_CACHE_CONFIGS[cacheType];
64
46
  return Object.assign(Object.assign({}, defaultConfig), userConfig);
65
47
  }
66
- //# sourceMappingURL=cacheConfig.js.map
@@ -38,4 +38,3 @@ export declare class FetchHttpClient implements IHttpClient {
38
38
  */
39
39
  private request;
40
40
  }
41
- //# sourceMappingURL=FetchHttpClient.d.ts.map
@@ -1,51 +1,18 @@
1
- /**
2
- * HTTP Client implementation using the Fetch API
3
- *
4
- * Implements the IHttpClient interface providing HTTP operations
5
- * with consistent response handling and JSON serialization.
6
- *
7
- * @group Utils
8
- *
9
- * @example
10
- * ```typescript
11
- * const client = new FetchHttpClient()
12
- * const response = await client.get<User>('https://api.example.com/users/1')
13
- * if (response.ok) {
14
- * console.log(response.data.name)
15
- * }
16
- * ```
17
- */
18
1
  export class FetchHttpClient {
19
- /**
20
- * Performs a GET request
21
- */
22
2
  async get(url, options) {
23
3
  return this.request(url, "GET", undefined, options);
24
4
  }
25
- /**
26
- * Performs a POST request
27
- */
28
5
  async post(url, body, options) {
29
6
  return this.request(url, "POST", body, options);
30
7
  }
31
- /**
32
- * Performs a PUT request
33
- */
34
8
  async put(url, body, options) {
35
9
  return this.request(url, "PUT", body, options);
36
10
  }
37
- /**
38
- * Performs a DELETE request
39
- */
40
11
  async delete(url, options) {
41
12
  return this.request(url, "DELETE", undefined, options);
42
13
  }
43
- /**
44
- * Internal request method that handles all HTTP methods
45
- */
46
14
  async request(url, method, body, options) {
47
15
  const headers = Object.assign({}, options === null || options === void 0 ? void 0 : options.headers);
48
- // Add Content-Type for requests with body
49
16
  if (body !== undefined && !headers["Content-Type"]) {
50
17
  headers["Content-Type"] = "application/json";
51
18
  }
@@ -53,12 +20,10 @@ export class FetchHttpClient {
53
20
  method,
54
21
  headers,
55
22
  };
56
- // Add body for POST/PUT requests
57
23
  if (body !== undefined) {
58
24
  fetchOptions.body = JSON.stringify(body);
59
25
  }
60
26
  const response = await fetch(url, fetchOptions);
61
- // Parse JSON response
62
27
  const data = await response.json();
63
28
  return {
64
29
  ok: response.ok,
@@ -68,4 +33,3 @@ export class FetchHttpClient {
68
33
  };
69
34
  }
70
35
  }
71
- //# sourceMappingURL=FetchHttpClient.js.map
@@ -46,4 +46,3 @@ export declare class MVXLogger implements ILogger {
46
46
  */
47
47
  private enrichSegmentation;
48
48
  }
49
- //# sourceMappingURL=MVXLogger.d.ts.map
@@ -1,36 +1,12 @@
1
1
  import { Logger } from "../../logger/logger";
2
- /**
3
- * MapVX Logger Adapter
4
- *
5
- * Default {@link ILogger} implementation for the SDK. Provider-agnostic by name
6
- * so the underlying error-tracking backend can change without affecting the
7
- * public API. It wraps the internal Logger singleton: errors are captured as
8
- * exceptions and events/warnings are recorded as breadcrumbs (currently backed
9
- * by Sentry).
10
- *
11
- * @group Utils
12
- *
13
- * @example
14
- * ```typescript
15
- * const logger: ILogger = new MVXLogger()
16
- * logger.logEvent("user_action", { action: "click" })
17
- * logger.logError(new Error("Something failed"))
18
- * ```
19
- */
20
2
  export class MVXLogger {
21
3
  constructor() {
22
4
  this.logger = Logger.getInstance();
23
5
  }
24
- /**
25
- * Records an analytics-style event as a Sentry breadcrumb.
26
- */
27
6
  logEvent(eventName, segmentation) {
28
7
  const enrichedSegmentation = this.enrichSegmentation(segmentation);
29
8
  this.logger.logEvent(eventName, enrichedSegmentation);
30
9
  }
31
- /**
32
- * Captures an error as a Sentry exception.
33
- */
34
10
  logError(error, context) {
35
11
  if (error instanceof Error) {
36
12
  this.logger.logError(error, context);
@@ -39,9 +15,6 @@ export class MVXLogger {
39
15
  this.logger.logError(String(error), context);
40
16
  }
41
17
  }
42
- /**
43
- * Records a warning as a Sentry breadcrumb.
44
- */
45
18
  logWarning(error, context) {
46
19
  if (error instanceof Error) {
47
20
  this.logger.logWarning(error, context);
@@ -50,21 +23,12 @@ export class MVXLogger {
50
23
  this.logger.logWarning(String(error), context);
51
24
  }
52
25
  }
53
- /**
54
- * Logs debug information (only in debug mode)
55
- */
56
26
  logDebug(...args) {
57
27
  this.logger.debugLog(...args);
58
28
  }
59
- /**
60
- * Sets the API token used to enrich event segmentation.
61
- */
62
29
  setToken(token) {
63
30
  this.token = token;
64
31
  }
65
- /**
66
- * Enriches segmentation with token if available
67
- */
68
32
  enrichSegmentation(segmentation) {
69
33
  const base = segmentation !== null && segmentation !== void 0 ? segmentation : {};
70
34
  if (this.token) {
@@ -73,4 +37,3 @@ export class MVXLogger {
73
37
  return base;
74
38
  }
75
39
  }
76
- //# sourceMappingURL=MVXLogger.js.map
@@ -2,4 +2,3 @@ export interface DataSnapshot<T> {
2
2
  timestamp: number;
3
3
  data: T;
4
4
  }
5
- //# sourceMappingURL=cache.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=cache.js.map
@@ -14,4 +14,3 @@ export interface HealthResponse {
14
14
  host: string;
15
15
  referer: string;
16
16
  }
17
- //# sourceMappingURL=healthResponse.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=healthResponse.js.map
@@ -10,4 +10,3 @@ export interface InstitutionResponse {
10
10
  city?: string;
11
11
  properties?: PropertyResponse[];
12
12
  }
13
- //# sourceMappingURL=institutionResponse.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=institutionResponse.js.map
@@ -4,4 +4,3 @@ export interface Metadata {
4
4
  logo?: string;
5
5
  tags?: string[];
6
6
  }
7
- //# sourceMappingURL=metadata.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=metadata.js.map
@@ -47,4 +47,3 @@ export interface PlaceResponse {
47
47
  metadata?: Metadata;
48
48
  visibility?: "public" | "protected" | "hidden";
49
49
  }
50
- //# sourceMappingURL=placeResponse.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=placeResponse.js.map
@@ -10,4 +10,3 @@ export interface RouteCacheResponse {
10
10
  export interface CacheTimestampResponse {
11
11
  lastUpdate: number;
12
12
  }
13
- //# sourceMappingURL=routeCacheResponse.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=routeCacheResponse.js.map
@@ -39,4 +39,3 @@ export interface RoutePolylineResponse {
39
39
  points_lat_lng?: LatLng[];
40
40
  overview_points?: LatLng[];
41
41
  }
42
- //# sourceMappingURL=routeResponse.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=routeResponse.js.map
@@ -2,4 +2,3 @@ import { type StyleSpecification } from "maplibre-gl";
2
2
  export interface StyleResponse {
3
3
  style: string | StyleSpecification;
4
4
  }
5
- //# sourceMappingURL=styleResponse.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=styleResponse.js.map
@@ -9,4 +9,3 @@ export declare class Logger {
9
9
  logError(...args: unknown[]): void;
10
10
  debugLog(...args: unknown[]): void;
11
11
  }
12
- //# sourceMappingURL=logger.d.ts.map
@@ -1,8 +1,4 @@
1
1
  import { createSentryScope, stringifyLogArgument } from "./sentry";
2
- // DEBUG is a webpack DefinePlugin constant, substituted only in the UMD bundle.
3
- // The tsc-built ES/CJS outputs keep it as a bare global, so reading it directly
4
- // throws ReferenceError in consumers of those builds. The typeof guard makes
5
- // the lookup safe everywhere.
6
2
  const IS_DEBUG = typeof DEBUG !== "undefined" ? DEBUG : false;
7
3
  export class Logger {
8
4
  constructor() {
@@ -24,9 +20,6 @@ export class Logger {
24
20
  console.log(eventName, eventSegmentation);
25
21
  }
26
22
  else {
27
- // Sentry is an error-tracking service, not an analytics platform, so the
28
- // former Countly analytics events are recorded as breadcrumbs. They carry
29
- // no value on their own but add context to the next captured error.
30
23
  (_a = this.sentry) === null || _a === void 0 ? void 0 : _a.addBreadcrumb({
31
24
  category: "event",
32
25
  message: eventName,
@@ -46,8 +39,6 @@ export class Logger {
46
39
  console.warn(...args);
47
40
  }
48
41
  else {
49
- // Warnings are not reported to Sentry on their own (matching the previous
50
- // error-only report level) but are kept as breadcrumbs for context.
51
42
  (_a = this.sentry) === null || _a === void 0 ? void 0 : _a.addBreadcrumb({
52
43
  category: "warning",
53
44
  level: "warning",
@@ -71,4 +62,3 @@ export class Logger {
71
62
  console.log(...args);
72
63
  }
73
64
  }
74
- //# sourceMappingURL=logger.js.map
@@ -16,4 +16,3 @@ export declare function createSentryScope(): Scope;
16
16
  * error messages.
17
17
  */
18
18
  export declare function stringifyLogArgument(arg: unknown): string;
19
- //# sourceMappingURL=sentry.d.ts.map