xypriss 1.0.0 → 1.0.1

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 (788) hide show
  1. package/README.md +2 -0
  2. package/dist/cjs/ServerFactory.js +195 -0
  3. package/dist/cjs/ServerFactory.js.map +1 -0
  4. package/dist/cjs/cache/CacheFactory.js +406 -0
  5. package/dist/cjs/cache/CacheFactory.js.map +1 -0
  6. package/dist/cjs/cache/SecureCacheAdapter.js +1227 -0
  7. package/dist/cjs/cache/SecureCacheAdapter.js.map +1 -0
  8. package/dist/cjs/cluster/cluster-manager.js +1011 -0
  9. package/dist/cjs/cluster/cluster-manager.js.map +1 -0
  10. package/dist/cjs/cluster/index.js +343 -0
  11. package/dist/cjs/cluster/index.js.map +1 -0
  12. package/dist/cjs/cluster/modules/AutoScaler.js +532 -0
  13. package/dist/cjs/cluster/modules/AutoScaler.js.map +1 -0
  14. package/dist/cjs/cluster/modules/ClusterFactory.js +518 -0
  15. package/dist/cjs/cluster/modules/ClusterFactory.js.map +1 -0
  16. package/dist/cjs/cluster/modules/ClusterPersistenceManager.js +436 -0
  17. package/dist/cjs/cluster/modules/ClusterPersistenceManager.js.map +1 -0
  18. package/dist/cjs/cluster/modules/HealthMonitor.js +461 -0
  19. package/dist/cjs/cluster/modules/HealthMonitor.js.map +1 -0
  20. package/dist/cjs/cluster/modules/IPCManager.js +781 -0
  21. package/dist/cjs/cluster/modules/IPCManager.js.map +1 -0
  22. package/dist/cjs/cluster/modules/LoadBalancer.js +1123 -0
  23. package/dist/cjs/cluster/modules/LoadBalancer.js.map +1 -0
  24. package/dist/cjs/cluster/modules/MetricsCollector.js +559 -0
  25. package/dist/cjs/cluster/modules/MetricsCollector.js.map +1 -0
  26. package/dist/cjs/cluster/modules/WorkerManager.js +1187 -0
  27. package/dist/cjs/cluster/modules/WorkerManager.js.map +1 -0
  28. package/dist/cjs/encryption/EncryptionService.js +399 -0
  29. package/dist/cjs/encryption/EncryptionService.js.map +1 -0
  30. package/dist/cjs/index.js.map +1 -0
  31. package/dist/cjs/middleware/safe-json-middleware.js +159 -0
  32. package/dist/cjs/middleware/safe-json-middleware.js.map +1 -0
  33. package/dist/cjs/mods/toolkit/src/algorithms/hash-algorithms.js +727 -0
  34. package/dist/cjs/mods/toolkit/src/algorithms/hash-algorithms.js.map +1 -0
  35. package/dist/cjs/mods/toolkit/src/algorithms/registry.js +83 -0
  36. package/dist/cjs/mods/toolkit/src/algorithms/registry.js.map +1 -0
  37. package/dist/cjs/mods/toolkit/src/components/attestation.js +1065 -0
  38. package/dist/cjs/mods/toolkit/src/components/attestation.js.map +1 -0
  39. package/dist/cjs/mods/toolkit/src/components/cache/FastLRU.js +323 -0
  40. package/dist/cjs/mods/toolkit/src/components/cache/FastLRU.js.map +1 -0
  41. package/dist/cjs/mods/toolkit/src/components/cache/UFSIMC.js +1131 -0
  42. package/dist/cjs/mods/toolkit/src/components/cache/UFSIMC.js.map +1 -0
  43. package/dist/cjs/mods/toolkit/src/components/cache/cacheSys.js +624 -0
  44. package/dist/cjs/mods/toolkit/src/components/cache/cacheSys.js.map +1 -0
  45. package/dist/cjs/mods/toolkit/src/components/cache/cacheSys.utils.js +136 -0
  46. package/dist/cjs/mods/toolkit/src/components/cache/cacheSys.utils.js.map +1 -0
  47. package/dist/cjs/mods/toolkit/src/components/cache/config/cache.config.js +39 -0
  48. package/dist/cjs/mods/toolkit/src/components/cache/config/cache.config.js.map +1 -0
  49. package/dist/cjs/mods/toolkit/src/components/cache/index.js +459 -0
  50. package/dist/cjs/mods/toolkit/src/components/cache/index.js.map +1 -0
  51. package/dist/cjs/mods/toolkit/src/components/cache/useCache.js +243 -0
  52. package/dist/cjs/mods/toolkit/src/components/cache/useCache.js.map +1 -0
  53. package/dist/cjs/mods/toolkit/src/components/canary-tokens.js +351 -0
  54. package/dist/cjs/mods/toolkit/src/components/canary-tokens.js.map +1 -0
  55. package/dist/cjs/mods/toolkit/src/components/entropy-augmentation.js +478 -0
  56. package/dist/cjs/mods/toolkit/src/components/entropy-augmentation.js.map +1 -0
  57. package/dist/cjs/mods/toolkit/src/components/fortified-function/UFA/ultra-fast-allocator.js +338 -0
  58. package/dist/cjs/mods/toolkit/src/components/fortified-function/UFA/ultra-fast-allocator.js.map +1 -0
  59. package/dist/cjs/mods/toolkit/src/components/fortified-function/UFA/ultra-fast-cache.js +536 -0
  60. package/dist/cjs/mods/toolkit/src/components/fortified-function/UFA/ultra-fast-cache.js.map +1 -0
  61. package/dist/cjs/mods/toolkit/src/components/fortified-function/UFA/ultra-fast-engine.js +631 -0
  62. package/dist/cjs/mods/toolkit/src/components/fortified-function/UFA/ultra-fast-engine.js.map +1 -0
  63. package/dist/cjs/mods/toolkit/src/components/fortified-function/const/exec.const.js +18 -0
  64. package/dist/cjs/mods/toolkit/src/components/fortified-function/const/exec.const.js.map +1 -0
  65. package/dist/cjs/mods/toolkit/src/components/fortified-function/core/fortified-config.js +356 -0
  66. package/dist/cjs/mods/toolkit/src/components/fortified-function/core/fortified-config.js.map +1 -0
  67. package/dist/cjs/mods/toolkit/src/components/fortified-function/core/fortified-function-core.js +520 -0
  68. package/dist/cjs/mods/toolkit/src/components/fortified-function/core/fortified-function-core.js.map +1 -0
  69. package/dist/cjs/mods/toolkit/src/components/fortified-function/core/fortified-logger.js +246 -0
  70. package/dist/cjs/mods/toolkit/src/components/fortified-function/core/fortified-logger.js.map +1 -0
  71. package/dist/cjs/mods/toolkit/src/components/fortified-function/core/mods/api-manager.js +189 -0
  72. package/dist/cjs/mods/toolkit/src/components/fortified-function/core/mods/api-manager.js.map +1 -0
  73. package/dist/cjs/mods/toolkit/src/components/fortified-function/core/mods/cache-manager.js +107 -0
  74. package/dist/cjs/mods/toolkit/src/components/fortified-function/core/mods/cache-manager.js.map +1 -0
  75. package/dist/cjs/mods/toolkit/src/components/fortified-function/core/mods/execution-context.js +105 -0
  76. package/dist/cjs/mods/toolkit/src/components/fortified-function/core/mods/execution-context.js.map +1 -0
  77. package/dist/cjs/mods/toolkit/src/components/fortified-function/core/mods/execution-engine.js +127 -0
  78. package/dist/cjs/mods/toolkit/src/components/fortified-function/core/mods/execution-engine.js.map +1 -0
  79. package/dist/cjs/mods/toolkit/src/components/fortified-function/core/mods/execution-router.js +93 -0
  80. package/dist/cjs/mods/toolkit/src/components/fortified-function/core/mods/execution-router.js.map +1 -0
  81. package/dist/cjs/mods/toolkit/src/components/fortified-function/core/mods/memory-manager.js +147 -0
  82. package/dist/cjs/mods/toolkit/src/components/fortified-function/core/mods/memory-manager.js.map +1 -0
  83. package/dist/cjs/mods/toolkit/src/components/fortified-function/core/mods/security-manager.js +102 -0
  84. package/dist/cjs/mods/toolkit/src/components/fortified-function/core/mods/security-manager.js.map +1 -0
  85. package/dist/cjs/mods/toolkit/src/components/fortified-function/core/mods/stats-manager.js +159 -0
  86. package/dist/cjs/mods/toolkit/src/components/fortified-function/core/mods/stats-manager.js.map +1 -0
  87. package/dist/cjs/mods/toolkit/src/components/fortified-function/core/mods/timing-manager.js +125 -0
  88. package/dist/cjs/mods/toolkit/src/components/fortified-function/core/mods/timing-manager.js.map +1 -0
  89. package/dist/cjs/mods/toolkit/src/components/fortified-function/engines/analytics-engine.js +370 -0
  90. package/dist/cjs/mods/toolkit/src/components/fortified-function/engines/analytics-engine.js.map +1 -0
  91. package/dist/cjs/mods/toolkit/src/components/fortified-function/engines/execution-engine.js +402 -0
  92. package/dist/cjs/mods/toolkit/src/components/fortified-function/engines/execution-engine.js.map +1 -0
  93. package/dist/cjs/mods/toolkit/src/components/fortified-function/index.js +172 -0
  94. package/dist/cjs/mods/toolkit/src/components/fortified-function/index.js.map +1 -0
  95. package/dist/cjs/mods/toolkit/src/components/fortified-function/performance/performance-monitor.js +240 -0
  96. package/dist/cjs/mods/toolkit/src/components/fortified-function/performance/performance-monitor.js.map +1 -0
  97. package/dist/cjs/mods/toolkit/src/components/fortified-function/performance/performance-timer.js +188 -0
  98. package/dist/cjs/mods/toolkit/src/components/fortified-function/performance/performance-timer.js.map +1 -0
  99. package/dist/cjs/mods/toolkit/src/components/fortified-function/security/security-handler.js +253 -0
  100. package/dist/cjs/mods/toolkit/src/components/fortified-function/security/security-handler.js.map +1 -0
  101. package/dist/cjs/mods/toolkit/src/components/fortified-function/serializer/safe-serializer.js +350 -0
  102. package/dist/cjs/mods/toolkit/src/components/fortified-function/serializer/safe-serializer.js.map +1 -0
  103. package/dist/cjs/mods/toolkit/src/components/fortified-function/smart-cache.js +693 -0
  104. package/dist/cjs/mods/toolkit/src/components/fortified-function/smart-cache.js.map +1 -0
  105. package/dist/cjs/mods/toolkit/src/components/fortified-function/types/types.js +16 -0
  106. package/dist/cjs/mods/toolkit/src/components/fortified-function/types/types.js.map +1 -0
  107. package/dist/cjs/mods/toolkit/src/components/fortified-function/utils/utils.js +68 -0
  108. package/dist/cjs/mods/toolkit/src/components/fortified-function/utils/utils.js.map +1 -0
  109. package/dist/cjs/mods/toolkit/src/components/memory-hard.js +922 -0
  110. package/dist/cjs/mods/toolkit/src/components/memory-hard.js.map +1 -0
  111. package/dist/cjs/mods/toolkit/src/components/post-quantum.js +323 -0
  112. package/dist/cjs/mods/toolkit/src/components/post-quantum.js.map +1 -0
  113. package/dist/cjs/mods/toolkit/src/components/runtime-verification.js +645 -0
  114. package/dist/cjs/mods/toolkit/src/components/runtime-verification.js.map +1 -0
  115. package/dist/cjs/mods/toolkit/src/components/secure-array/core/secure-array-core.js +1572 -0
  116. package/dist/cjs/mods/toolkit/src/components/secure-array/core/secure-array-core.js.map +1 -0
  117. package/dist/cjs/mods/toolkit/src/components/secure-array/crypto/ArrayCryptoHandler.js +330 -0
  118. package/dist/cjs/mods/toolkit/src/components/secure-array/crypto/ArrayCryptoHandler.js.map +1 -0
  119. package/dist/cjs/mods/toolkit/src/components/secure-array/events/event-manager.js +270 -0
  120. package/dist/cjs/mods/toolkit/src/components/secure-array/events/event-manager.js.map +1 -0
  121. package/dist/cjs/mods/toolkit/src/components/secure-array/index.js +66 -0
  122. package/dist/cjs/mods/toolkit/src/components/secure-array/index.js.map +1 -0
  123. package/dist/cjs/mods/toolkit/src/components/secure-array/metadata/metadata-manager.js +331 -0
  124. package/dist/cjs/mods/toolkit/src/components/secure-array/metadata/metadata-manager.js.map +1 -0
  125. package/dist/cjs/mods/toolkit/src/components/secure-array/serialization/ArraySerializationHandler.js +390 -0
  126. package/dist/cjs/mods/toolkit/src/components/secure-array/serialization/ArraySerializationHandler.js.map +1 -0
  127. package/dist/cjs/mods/toolkit/src/components/secure-array/types/index.js +87 -0
  128. package/dist/cjs/mods/toolkit/src/components/secure-array/types/index.js.map +1 -0
  129. package/dist/cjs/mods/toolkit/src/components/secure-array/utils/id-generator.js +80 -0
  130. package/dist/cjs/mods/toolkit/src/components/secure-array/utils/id-generator.js.map +1 -0
  131. package/dist/cjs/mods/toolkit/src/components/secure-array/utils/validation.js +275 -0
  132. package/dist/cjs/mods/toolkit/src/components/secure-array/utils/validation.js.map +1 -0
  133. package/dist/cjs/mods/toolkit/src/components/secure-memory.js +906 -0
  134. package/dist/cjs/mods/toolkit/src/components/secure-memory.js.map +1 -0
  135. package/dist/cjs/mods/toolkit/src/components/secure-object/core/secure-object-core.js +1605 -0
  136. package/dist/cjs/mods/toolkit/src/components/secure-object/core/secure-object-core.js.map +1 -0
  137. package/dist/cjs/mods/toolkit/src/components/secure-object/encryption/crypto-handler.js +362 -0
  138. package/dist/cjs/mods/toolkit/src/components/secure-object/encryption/crypto-handler.js.map +1 -0
  139. package/dist/cjs/mods/toolkit/src/components/secure-object/encryption/sensitive-keys.js +206 -0
  140. package/dist/cjs/mods/toolkit/src/components/secure-object/encryption/sensitive-keys.js.map +1 -0
  141. package/dist/cjs/mods/toolkit/src/components/secure-object/events/event-manager.js +197 -0
  142. package/dist/cjs/mods/toolkit/src/components/secure-object/events/event-manager.js.map +1 -0
  143. package/dist/cjs/mods/toolkit/src/components/secure-object/index.js +67 -0
  144. package/dist/cjs/mods/toolkit/src/components/secure-object/index.js.map +1 -0
  145. package/dist/cjs/mods/toolkit/src/components/secure-object/metadata/metadata-manager.js +183 -0
  146. package/dist/cjs/mods/toolkit/src/components/secure-object/metadata/metadata-manager.js.map +1 -0
  147. package/dist/cjs/mods/toolkit/src/components/secure-object/serialization/serialization-handler.js +197 -0
  148. package/dist/cjs/mods/toolkit/src/components/secure-object/serialization/serialization-handler.js.map +1 -0
  149. package/dist/cjs/mods/toolkit/src/components/secure-object/utils/id-generator.js +64 -0
  150. package/dist/cjs/mods/toolkit/src/components/secure-object/utils/id-generator.js.map +1 -0
  151. package/dist/cjs/mods/toolkit/src/components/secure-object/utils/validation.js +239 -0
  152. package/dist/cjs/mods/toolkit/src/components/secure-object/utils/validation.js.map +1 -0
  153. package/dist/cjs/mods/toolkit/src/components/secure-serialization.js +772 -0
  154. package/dist/cjs/mods/toolkit/src/components/secure-serialization.js.map +1 -0
  155. package/dist/cjs/mods/toolkit/src/components/secure-string/advanced/entropy-analyzer.js +308 -0
  156. package/dist/cjs/mods/toolkit/src/components/secure-string/advanced/entropy-analyzer.js.map +1 -0
  157. package/dist/cjs/mods/toolkit/src/components/secure-string/advanced/performance-monitor.js +335 -0
  158. package/dist/cjs/mods/toolkit/src/components/secure-string/advanced/performance-monitor.js.map +1 -0
  159. package/dist/cjs/mods/toolkit/src/components/secure-string/advanced/quantum-safe.js +245 -0
  160. package/dist/cjs/mods/toolkit/src/components/secure-string/advanced/quantum-safe.js.map +1 -0
  161. package/dist/cjs/mods/toolkit/src/components/secure-string/buffer/buffer-manager.js +205 -0
  162. package/dist/cjs/mods/toolkit/src/components/secure-string/buffer/buffer-manager.js.map +1 -0
  163. package/dist/cjs/mods/toolkit/src/components/secure-string/core/secure-string-core.js +788 -0
  164. package/dist/cjs/mods/toolkit/src/components/secure-string/core/secure-string-core.js.map +1 -0
  165. package/dist/cjs/mods/toolkit/src/components/secure-string/crypto/crypto-operations.js +319 -0
  166. package/dist/cjs/mods/toolkit/src/components/secure-string/crypto/crypto-operations.js.map +1 -0
  167. package/dist/cjs/mods/toolkit/src/components/secure-string/operations/comparison-operations.js +221 -0
  168. package/dist/cjs/mods/toolkit/src/components/secure-string/operations/comparison-operations.js.map +1 -0
  169. package/dist/cjs/mods/toolkit/src/components/secure-string/operations/string-operations.js +234 -0
  170. package/dist/cjs/mods/toolkit/src/components/secure-string/operations/string-operations.js.map +1 -0
  171. package/dist/cjs/mods/toolkit/src/components/secure-string/types/index.js +41 -0
  172. package/dist/cjs/mods/toolkit/src/components/secure-string/types/index.js.map +1 -0
  173. package/dist/cjs/mods/toolkit/src/components/secure-string/validation/string-validator.js +334 -0
  174. package/dist/cjs/mods/toolkit/src/components/secure-string/validation/string-validator.js.map +1 -0
  175. package/dist/cjs/mods/toolkit/src/components/side-channel.js +146 -0
  176. package/dist/cjs/mods/toolkit/src/components/side-channel.js.map +1 -0
  177. package/dist/cjs/mods/toolkit/src/components/tamper-evident-logging.js +391 -0
  178. package/dist/cjs/mods/toolkit/src/components/tamper-evident-logging.js.map +1 -0
  179. package/dist/cjs/mods/toolkit/src/const/buffer.const.js +15 -0
  180. package/dist/cjs/mods/toolkit/src/const/buffer.const.js.map +1 -0
  181. package/dist/cjs/mods/toolkit/src/core/crypto.js +722 -0
  182. package/dist/cjs/mods/toolkit/src/core/crypto.js.map +1 -0
  183. package/dist/cjs/mods/toolkit/src/core/hash/hash-advanced.js +388 -0
  184. package/dist/cjs/mods/toolkit/src/core/hash/hash-advanced.js.map +1 -0
  185. package/dist/cjs/mods/toolkit/src/core/hash/hash-core.js +376 -0
  186. package/dist/cjs/mods/toolkit/src/core/hash/hash-core.js.map +1 -0
  187. package/dist/cjs/mods/toolkit/src/core/hash/hash-entropy.js +307 -0
  188. package/dist/cjs/mods/toolkit/src/core/hash/hash-entropy.js.map +1 -0
  189. package/dist/cjs/mods/toolkit/src/core/hash/hash-security.js +372 -0
  190. package/dist/cjs/mods/toolkit/src/core/hash/hash-security.js.map +1 -0
  191. package/dist/cjs/mods/toolkit/src/core/hash/hash-types.js +16 -0
  192. package/dist/cjs/mods/toolkit/src/core/hash/hash-types.js.map +1 -0
  193. package/dist/cjs/mods/toolkit/src/core/hash/hash-utils.js +328 -0
  194. package/dist/cjs/mods/toolkit/src/core/hash/hash-utils.js.map +1 -0
  195. package/dist/cjs/mods/toolkit/src/core/hash/hash-validator.js +312 -0
  196. package/dist/cjs/mods/toolkit/src/core/hash/hash-validator.js.map +1 -0
  197. package/dist/cjs/mods/toolkit/src/core/hash.js +25 -0
  198. package/dist/cjs/mods/toolkit/src/core/hash.js.map +1 -0
  199. package/dist/cjs/mods/toolkit/src/core/keys/algorithms/mods/Argon2Algo.js +135 -0
  200. package/dist/cjs/mods/toolkit/src/core/keys/algorithms/mods/Argon2Algo.js.map +1 -0
  201. package/dist/cjs/mods/toolkit/src/core/keys/algorithms/mods/PBKDF2Algo.js +293 -0
  202. package/dist/cjs/mods/toolkit/src/core/keys/algorithms/mods/PBKDF2Algo.js.map +1 -0
  203. package/dist/cjs/mods/toolkit/src/core/keys/algorithms/mods/ScryptAlgo.js +317 -0
  204. package/dist/cjs/mods/toolkit/src/core/keys/algorithms/mods/ScryptAlgo.js.map +1 -0
  205. package/dist/cjs/mods/toolkit/src/core/keys/keys-core.js +201 -0
  206. package/dist/cjs/mods/toolkit/src/core/keys/keys-core.js.map +1 -0
  207. package/dist/cjs/mods/toolkit/src/core/keys/keys-logger.js +234 -0
  208. package/dist/cjs/mods/toolkit/src/core/keys/keys-logger.js.map +1 -0
  209. package/dist/cjs/mods/toolkit/src/core/keys/keys-types.js +65 -0
  210. package/dist/cjs/mods/toolkit/src/core/keys/keys-types.js.map +1 -0
  211. package/dist/cjs/mods/toolkit/src/core/keys/keys-utils.js +322 -0
  212. package/dist/cjs/mods/toolkit/src/core/keys/keys-utils.js.map +1 -0
  213. package/dist/cjs/mods/toolkit/src/core/keys.js +136 -0
  214. package/dist/cjs/mods/toolkit/src/core/keys.js.map +1 -0
  215. package/dist/cjs/mods/toolkit/src/core/password/index.js +122 -0
  216. package/dist/cjs/mods/toolkit/src/core/password/index.js.map +1 -0
  217. package/dist/cjs/mods/toolkit/src/core/password/password-algorithms.js +397 -0
  218. package/dist/cjs/mods/toolkit/src/core/password/password-algorithms.js.map +1 -0
  219. package/dist/cjs/mods/toolkit/src/core/password/password-core.js +294 -0
  220. package/dist/cjs/mods/toolkit/src/core/password/password-core.js.map +1 -0
  221. package/dist/cjs/mods/toolkit/src/core/password/password-generator.js +365 -0
  222. package/dist/cjs/mods/toolkit/src/core/password/password-generator.js.map +1 -0
  223. package/dist/cjs/mods/toolkit/src/core/password/password-migration.js +237 -0
  224. package/dist/cjs/mods/toolkit/src/core/password/password-migration.js.map +1 -0
  225. package/dist/cjs/mods/toolkit/src/core/password/password-security.js +534 -0
  226. package/dist/cjs/mods/toolkit/src/core/password/password-security.js.map +1 -0
  227. package/dist/cjs/mods/toolkit/src/core/password/password-types.js +39 -0
  228. package/dist/cjs/mods/toolkit/src/core/password/password-types.js.map +1 -0
  229. package/dist/cjs/mods/toolkit/src/core/password/password-utils.js +651 -0
  230. package/dist/cjs/mods/toolkit/src/core/password/password-utils.js.map +1 -0
  231. package/dist/cjs/mods/toolkit/src/core/password/swlist.js +1122 -0
  232. package/dist/cjs/mods/toolkit/src/core/password/swlist.js.map +1 -0
  233. package/dist/cjs/mods/toolkit/src/core/random/random-core.js +328 -0
  234. package/dist/cjs/mods/toolkit/src/core/random/random-core.js.map +1 -0
  235. package/dist/cjs/mods/toolkit/src/core/random/random-crypto.js +339 -0
  236. package/dist/cjs/mods/toolkit/src/core/random/random-crypto.js.map +1 -0
  237. package/dist/cjs/mods/toolkit/src/core/random/random-entropy.js +388 -0
  238. package/dist/cjs/mods/toolkit/src/core/random/random-entropy.js.map +1 -0
  239. package/dist/cjs/mods/toolkit/src/core/random/random-generators.js +344 -0
  240. package/dist/cjs/mods/toolkit/src/core/random/random-generators.js.map +1 -0
  241. package/dist/cjs/mods/toolkit/src/core/random/random-sources.js +426 -0
  242. package/dist/cjs/mods/toolkit/src/core/random/random-sources.js.map +1 -0
  243. package/dist/cjs/mods/toolkit/src/core/random/random-tokens.js +309 -0
  244. package/dist/cjs/mods/toolkit/src/core/random/random-tokens.js.map +1 -0
  245. package/dist/cjs/mods/toolkit/src/core/random/random-types.js +36 -0
  246. package/dist/cjs/mods/toolkit/src/core/random/random-types.js.map +1 -0
  247. package/dist/cjs/mods/toolkit/src/core/validators.js +200 -0
  248. package/dist/cjs/mods/toolkit/src/core/validators.js.map +1 -0
  249. package/dist/cjs/mods/toolkit/src/helpers/Uint8Array.js +335 -0
  250. package/dist/cjs/mods/toolkit/src/helpers/Uint8Array.js.map +1 -0
  251. package/dist/cjs/mods/toolkit/src/helpers/createEnu.js +27 -0
  252. package/dist/cjs/mods/toolkit/src/helpers/createEnu.js.map +1 -0
  253. package/dist/cjs/mods/toolkit/src/index.js +417 -0
  254. package/dist/cjs/mods/toolkit/src/index.js.map +1 -0
  255. package/dist/cjs/mods/toolkit/src/types/global.js +51 -0
  256. package/dist/cjs/mods/toolkit/src/types/global.js.map +1 -0
  257. package/dist/cjs/mods/toolkit/src/types/secure-mem.type.js +100 -0
  258. package/dist/cjs/mods/toolkit/src/types/secure-mem.type.js.map +1 -0
  259. package/dist/cjs/mods/toolkit/src/types/secure-memory.js +20 -0
  260. package/dist/cjs/mods/toolkit/src/types/secure-memory.js.map +1 -0
  261. package/dist/cjs/mods/toolkit/src/types.js +63 -0
  262. package/dist/cjs/mods/toolkit/src/types.js.map +1 -0
  263. package/dist/cjs/mods/toolkit/src/utils/CryptoAlgorithmUtils.js +71 -0
  264. package/dist/cjs/mods/toolkit/src/utils/CryptoAlgorithmUtils.js.map +1 -0
  265. package/dist/cjs/mods/toolkit/src/utils/constants.js +111 -0
  266. package/dist/cjs/mods/toolkit/src/utils/constants.js.map +1 -0
  267. package/dist/cjs/mods/toolkit/src/utils/dataConverter.js +74 -0
  268. package/dist/cjs/mods/toolkit/src/utils/dataConverter.js.map +1 -0
  269. package/dist/cjs/mods/toolkit/src/utils/encoding.js +290 -0
  270. package/dist/cjs/mods/toolkit/src/utils/encoding.js.map +1 -0
  271. package/dist/cjs/mods/toolkit/src/utils/errorHandler.js +140 -0
  272. package/dist/cjs/mods/toolkit/src/utils/errorHandler.js.map +1 -0
  273. package/dist/cjs/mods/toolkit/src/utils/memory/config-manager.js +282 -0
  274. package/dist/cjs/mods/toolkit/src/utils/memory/config-manager.js.map +1 -0
  275. package/dist/cjs/mods/toolkit/src/utils/memory/event-manager.js +277 -0
  276. package/dist/cjs/mods/toolkit/src/utils/memory/event-manager.js.map +1 -0
  277. package/dist/cjs/mods/toolkit/src/utils/memory/index.js +162 -0
  278. package/dist/cjs/mods/toolkit/src/utils/memory/index.js.map +1 -0
  279. package/dist/cjs/mods/toolkit/src/utils/memory/memory-manager.js +888 -0
  280. package/dist/cjs/mods/toolkit/src/utils/memory/memory-manager.js.map +1 -0
  281. package/dist/cjs/mods/toolkit/src/utils/memory/memory-pool.js +356 -0
  282. package/dist/cjs/mods/toolkit/src/utils/memory/memory-pool.js.map +1 -0
  283. package/dist/cjs/mods/toolkit/src/utils/memory/reference-tracker.js +376 -0
  284. package/dist/cjs/mods/toolkit/src/utils/memory/reference-tracker.js.map +1 -0
  285. package/dist/cjs/mods/toolkit/src/utils/memory/types.js +56 -0
  286. package/dist/cjs/mods/toolkit/src/utils/memory/types.js.map +1 -0
  287. package/dist/cjs/mods/toolkit/src/utils/patterns.js +127 -0
  288. package/dist/cjs/mods/toolkit/src/utils/patterns.js.map +1 -0
  289. package/dist/cjs/mods/toolkit/src/utils/performanceMonitor.js +249 -0
  290. package/dist/cjs/mods/toolkit/src/utils/performanceMonitor.js.map +1 -0
  291. package/dist/cjs/mods/toolkit/src/utils/stats.js +182 -0
  292. package/dist/cjs/mods/toolkit/src/utils/stats.js.map +1 -0
  293. package/dist/cjs/performance-monitor.js +162 -0
  294. package/dist/cjs/performance-monitor.js.map +1 -0
  295. package/dist/cjs/plugins/plugin-manager.js +151 -0
  296. package/dist/cjs/plugins/plugin-manager.js.map +1 -0
  297. package/dist/cjs/plugins/route-optimization-plugin.js +413 -0
  298. package/dist/cjs/plugins/route-optimization-plugin.js.map +1 -0
  299. package/dist/cjs/plugins/server-maintenance-plugin.js +510 -0
  300. package/dist/cjs/plugins/server-maintenance-plugin.js.map +1 -0
  301. package/dist/cjs/quick-start.js +47 -0
  302. package/dist/cjs/quick-start.js.map +1 -0
  303. package/dist/cjs/security-middleware.js +415 -0
  304. package/dist/cjs/security-middleware.js.map +1 -0
  305. package/dist/cjs/server/FastServer.js +988 -0
  306. package/dist/cjs/server/FastServer.js.map +1 -0
  307. package/dist/cjs/server/components/fastapi/CacheManager.js +245 -0
  308. package/dist/cjs/server/components/fastapi/CacheManager.js.map +1 -0
  309. package/dist/cjs/server/components/fastapi/ClusterManagerComponent.js +327 -0
  310. package/dist/cjs/server/components/fastapi/ClusterManagerComponent.js.map +1 -0
  311. package/dist/cjs/server/components/fastapi/FileWatcherManager.js +493 -0
  312. package/dist/cjs/server/components/fastapi/FileWatcherManager.js.map +1 -0
  313. package/dist/cjs/server/components/fastapi/MonitoringManager.js +307 -0
  314. package/dist/cjs/server/components/fastapi/MonitoringManager.js.map +1 -0
  315. package/dist/cjs/server/components/fastapi/PerformanceManager.js +297 -0
  316. package/dist/cjs/server/components/fastapi/PerformanceManager.js.map +1 -0
  317. package/dist/cjs/server/components/fastapi/PluginManager.js +312 -0
  318. package/dist/cjs/server/components/fastapi/PluginManager.js.map +1 -0
  319. package/dist/cjs/server/components/fastapi/RedirectManager.js +492 -0
  320. package/dist/cjs/server/components/fastapi/RedirectManager.js.map +1 -0
  321. package/dist/cjs/server/components/fastapi/RequestProcessor.js +213 -0
  322. package/dist/cjs/server/components/fastapi/RequestProcessor.js.map +1 -0
  323. package/dist/cjs/server/components/fastapi/RouteManager.js +272 -0
  324. package/dist/cjs/server/components/fastapi/RouteManager.js.map +1 -0
  325. package/dist/cjs/server/components/fastapi/UltraFastRequestProcessor.js +668 -0
  326. package/dist/cjs/server/components/fastapi/UltraFastRequestProcessor.js.map +1 -0
  327. package/dist/cjs/server/components/fastapi/console/ConsoleInterceptor.js +812 -0
  328. package/dist/cjs/server/components/fastapi/console/ConsoleInterceptor.js.map +1 -0
  329. package/dist/cjs/server/components/fastapi/console/encryption/ConsoleEncryption.js +216 -0
  330. package/dist/cjs/server/components/fastapi/console/encryption/ConsoleEncryption.js.map +1 -0
  331. package/dist/cjs/server/components/fastapi/console/types.js +163 -0
  332. package/dist/cjs/server/components/fastapi/console/types.js.map +1 -0
  333. package/dist/cjs/server/components/fastapi/middlewares/MiddlewareAPI.js +347 -0
  334. package/dist/cjs/server/components/fastapi/middlewares/MiddlewareAPI.js.map +1 -0
  335. package/dist/cjs/server/components/fastapi/middlewares/MiddlewareMethodsManager.js +204 -0
  336. package/dist/cjs/server/components/fastapi/middlewares/MiddlewareMethodsManager.js.map +1 -0
  337. package/dist/cjs/server/components/fastapi/middlewares/middlewareManager.js +953 -0
  338. package/dist/cjs/server/components/fastapi/middlewares/middlewareManager.js.map +1 -0
  339. package/dist/cjs/server/components/fastapi/modules/UFRP/WorkerPool.js +56 -0
  340. package/dist/cjs/server/components/fastapi/modules/UFRP/WorkerPool.js.map +1 -0
  341. package/dist/cjs/server/components/fastapi/templates/redirectTemp.js +101 -0
  342. package/dist/cjs/server/components/fastapi/templates/redirectTemp.js.map +1 -0
  343. package/dist/cjs/server/components/fastapi/typescript/TypeScriptChecker.js +373 -0
  344. package/dist/cjs/server/components/fastapi/typescript/TypeScriptChecker.js.map +1 -0
  345. package/dist/cjs/server/const/Cluster.config.js +72 -0
  346. package/dist/cjs/server/const/Cluster.config.js.map +1 -0
  347. package/dist/cjs/server/const/ExecutionPredictor_EP.const.js +73 -0
  348. package/dist/cjs/server/const/ExecutionPredictor_EP.const.js.map +1 -0
  349. package/dist/cjs/server/const/FileWatcher.config.js +98 -0
  350. package/dist/cjs/server/const/FileWatcher.config.js.map +1 -0
  351. package/dist/cjs/server/const/default.js +122 -0
  352. package/dist/cjs/server/const/default.js.map +1 -0
  353. package/dist/cjs/server/optimization/ExecutionPredictor.js +218 -0
  354. package/dist/cjs/server/optimization/ExecutionPredictor.js.map +1 -0
  355. package/dist/cjs/server/optimization/PerformanceProfiler.js +234 -0
  356. package/dist/cjs/server/optimization/PerformanceProfiler.js.map +1 -0
  357. package/dist/cjs/server/optimization/RequestPreCompiler.js +708 -0
  358. package/dist/cjs/server/optimization/RequestPreCompiler.js.map +1 -0
  359. package/dist/cjs/server/optimization/UltraFastOptimizer.js +400 -0
  360. package/dist/cjs/server/optimization/UltraFastOptimizer.js.map +1 -0
  361. package/dist/cjs/server/plugins/PluginEngine.js +378 -0
  362. package/dist/cjs/server/plugins/PluginEngine.js.map +1 -0
  363. package/dist/cjs/server/plugins/PluginRegistry.js +339 -0
  364. package/dist/cjs/server/plugins/PluginRegistry.js.map +1 -0
  365. package/dist/cjs/server/plugins/builtin/JWTAuthPlugin.js +591 -0
  366. package/dist/cjs/server/plugins/builtin/JWTAuthPlugin.js.map +1 -0
  367. package/dist/cjs/server/plugins/builtin/ResponseTimePlugin.js +413 -0
  368. package/dist/cjs/server/plugins/builtin/ResponseTimePlugin.js.map +1 -0
  369. package/dist/cjs/server/plugins/builtin/SmartCachePlugin.js +843 -0
  370. package/dist/cjs/server/plugins/builtin/SmartCachePlugin.js.map +1 -0
  371. package/dist/cjs/server/plugins/core/CachePlugin.js +1975 -0
  372. package/dist/cjs/server/plugins/core/CachePlugin.js.map +1 -0
  373. package/dist/cjs/server/plugins/core/PerformancePlugin.js +894 -0
  374. package/dist/cjs/server/plugins/core/PerformancePlugin.js.map +1 -0
  375. package/dist/cjs/server/plugins/core/SecurityPlugin.js +799 -0
  376. package/dist/cjs/server/plugins/core/SecurityPlugin.js.map +1 -0
  377. package/dist/cjs/server/plugins/types/PluginTypes.js +47 -0
  378. package/dist/cjs/server/plugins/types/PluginTypes.js.map +1 -0
  379. package/dist/cjs/server/service/Reload/FileWatcher.js +756 -0
  380. package/dist/cjs/server/service/Reload/FileWatcher.js.map +1 -0
  381. package/dist/cjs/server/service/Reload/HotReloader.js +738 -0
  382. package/dist/cjs/server/service/Reload/HotReloader.js.map +1 -0
  383. package/dist/cjs/server/service/Reload/exec/TypeScriptExecutor.js +342 -0
  384. package/dist/cjs/server/service/Reload/exec/TypeScriptExecutor.js.map +1 -0
  385. package/dist/cjs/server/utils/ConfigLoader.js +209 -0
  386. package/dist/cjs/server/utils/ConfigLoader.js.map +1 -0
  387. package/dist/cjs/server/utils/Logger.js +238 -0
  388. package/dist/cjs/server/utils/Logger.js.map +1 -0
  389. package/dist/cjs/server/utils/PortManager.js +157 -0
  390. package/dist/cjs/server/utils/PortManager.js.map +1 -0
  391. package/dist/cjs/server/utils/forceClosePort.js +126 -0
  392. package/dist/cjs/server/utils/forceClosePort.js.map +1 -0
  393. package/dist/cjs/smart-routes.js +347 -0
  394. package/dist/cjs/smart-routes.js.map +1 -0
  395. package/dist/esm/ServerFactory.js +184 -0
  396. package/dist/esm/ServerFactory.js.map +1 -0
  397. package/dist/esm/cache/CacheFactory.js +402 -0
  398. package/dist/esm/cache/CacheFactory.js.map +1 -0
  399. package/dist/esm/cache/SecureCacheAdapter.js +1225 -0
  400. package/dist/esm/cache/SecureCacheAdapter.js.map +1 -0
  401. package/dist/esm/cluster/cluster-manager.js +990 -0
  402. package/dist/esm/cluster/cluster-manager.js.map +1 -0
  403. package/dist/esm/cluster/index.js +321 -0
  404. package/dist/esm/cluster/index.js.map +1 -0
  405. package/dist/esm/cluster/modules/AutoScaler.js +530 -0
  406. package/dist/esm/cluster/modules/AutoScaler.js.map +1 -0
  407. package/dist/esm/cluster/modules/ClusterFactory.js +490 -0
  408. package/dist/esm/cluster/modules/ClusterFactory.js.map +1 -0
  409. package/dist/esm/cluster/modules/ClusterPersistenceManager.js +434 -0
  410. package/dist/esm/cluster/modules/ClusterPersistenceManager.js.map +1 -0
  411. package/dist/esm/cluster/modules/HealthMonitor.js +440 -0
  412. package/dist/esm/cluster/modules/HealthMonitor.js.map +1 -0
  413. package/dist/esm/cluster/modules/IPCManager.js +759 -0
  414. package/dist/esm/cluster/modules/IPCManager.js.map +1 -0
  415. package/dist/esm/cluster/modules/LoadBalancer.js +1102 -0
  416. package/dist/esm/cluster/modules/LoadBalancer.js.map +1 -0
  417. package/dist/esm/cluster/modules/MetricsCollector.js +538 -0
  418. package/dist/esm/cluster/modules/MetricsCollector.js.map +1 -0
  419. package/dist/esm/cluster/modules/WorkerManager.js +1165 -0
  420. package/dist/esm/cluster/modules/WorkerManager.js.map +1 -0
  421. package/dist/esm/encryption/EncryptionService.js +378 -0
  422. package/dist/esm/encryption/EncryptionService.js.map +1 -0
  423. package/dist/esm/index.js.map +1 -0
  424. package/dist/esm/middleware/safe-json-middleware.js +153 -0
  425. package/dist/esm/middleware/safe-json-middleware.js.map +1 -0
  426. package/dist/esm/mods/toolkit/src/algorithms/hash-algorithms.js +705 -0
  427. package/dist/esm/mods/toolkit/src/algorithms/hash-algorithms.js.map +1 -0
  428. package/dist/esm/mods/toolkit/src/algorithms/registry.js +81 -0
  429. package/dist/esm/mods/toolkit/src/algorithms/registry.js.map +1 -0
  430. package/dist/esm/mods/toolkit/src/components/attestation.js +1059 -0
  431. package/dist/esm/mods/toolkit/src/components/attestation.js.map +1 -0
  432. package/dist/esm/mods/toolkit/src/components/cache/FastLRU.js +320 -0
  433. package/dist/esm/mods/toolkit/src/components/cache/FastLRU.js.map +1 -0
  434. package/dist/esm/mods/toolkit/src/components/cache/UFSIMC.js +1109 -0
  435. package/dist/esm/mods/toolkit/src/components/cache/UFSIMC.js.map +1 -0
  436. package/dist/esm/mods/toolkit/src/components/cache/cacheSys.js +622 -0
  437. package/dist/esm/mods/toolkit/src/components/cache/cacheSys.js.map +1 -0
  438. package/dist/esm/mods/toolkit/src/components/cache/cacheSys.utils.js +111 -0
  439. package/dist/esm/mods/toolkit/src/components/cache/cacheSys.utils.js.map +1 -0
  440. package/dist/esm/mods/toolkit/src/components/cache/config/cache.config.js +36 -0
  441. package/dist/esm/mods/toolkit/src/components/cache/config/cache.config.js.map +1 -0
  442. package/dist/esm/mods/toolkit/src/components/cache/index.js +449 -0
  443. package/dist/esm/mods/toolkit/src/components/cache/index.js.map +1 -0
  444. package/dist/esm/mods/toolkit/src/components/cache/useCache.js +240 -0
  445. package/dist/esm/mods/toolkit/src/components/cache/useCache.js.map +1 -0
  446. package/dist/esm/mods/toolkit/src/components/canary-tokens.js +346 -0
  447. package/dist/esm/mods/toolkit/src/components/canary-tokens.js.map +1 -0
  448. package/dist/esm/mods/toolkit/src/components/entropy-augmentation.js +476 -0
  449. package/dist/esm/mods/toolkit/src/components/entropy-augmentation.js.map +1 -0
  450. package/dist/esm/mods/toolkit/src/components/fortified-function/UFA/ultra-fast-allocator.js +336 -0
  451. package/dist/esm/mods/toolkit/src/components/fortified-function/UFA/ultra-fast-allocator.js.map +1 -0
  452. package/dist/esm/mods/toolkit/src/components/fortified-function/UFA/ultra-fast-cache.js +534 -0
  453. package/dist/esm/mods/toolkit/src/components/fortified-function/UFA/ultra-fast-cache.js.map +1 -0
  454. package/dist/esm/mods/toolkit/src/components/fortified-function/UFA/ultra-fast-engine.js +629 -0
  455. package/dist/esm/mods/toolkit/src/components/fortified-function/UFA/ultra-fast-engine.js.map +1 -0
  456. package/dist/esm/mods/toolkit/src/components/fortified-function/const/exec.const.js +11 -0
  457. package/dist/esm/mods/toolkit/src/components/fortified-function/const/exec.const.js.map +1 -0
  458. package/dist/esm/mods/toolkit/src/components/fortified-function/core/fortified-config.js +351 -0
  459. package/dist/esm/mods/toolkit/src/components/fortified-function/core/fortified-config.js.map +1 -0
  460. package/dist/esm/mods/toolkit/src/components/fortified-function/core/fortified-function-core.js +518 -0
  461. package/dist/esm/mods/toolkit/src/components/fortified-function/core/fortified-function-core.js.map +1 -0
  462. package/dist/esm/mods/toolkit/src/components/fortified-function/core/fortified-logger.js +243 -0
  463. package/dist/esm/mods/toolkit/src/components/fortified-function/core/fortified-logger.js.map +1 -0
  464. package/dist/esm/mods/toolkit/src/components/fortified-function/core/mods/api-manager.js +187 -0
  465. package/dist/esm/mods/toolkit/src/components/fortified-function/core/mods/api-manager.js.map +1 -0
  466. package/dist/esm/mods/toolkit/src/components/fortified-function/core/mods/cache-manager.js +105 -0
  467. package/dist/esm/mods/toolkit/src/components/fortified-function/core/mods/cache-manager.js.map +1 -0
  468. package/dist/esm/mods/toolkit/src/components/fortified-function/core/mods/execution-context.js +103 -0
  469. package/dist/esm/mods/toolkit/src/components/fortified-function/core/mods/execution-context.js.map +1 -0
  470. package/dist/esm/mods/toolkit/src/components/fortified-function/core/mods/execution-engine.js +125 -0
  471. package/dist/esm/mods/toolkit/src/components/fortified-function/core/mods/execution-engine.js.map +1 -0
  472. package/dist/esm/mods/toolkit/src/components/fortified-function/core/mods/execution-router.js +91 -0
  473. package/dist/esm/mods/toolkit/src/components/fortified-function/core/mods/execution-router.js.map +1 -0
  474. package/dist/esm/mods/toolkit/src/components/fortified-function/core/mods/memory-manager.js +145 -0
  475. package/dist/esm/mods/toolkit/src/components/fortified-function/core/mods/memory-manager.js.map +1 -0
  476. package/dist/esm/mods/toolkit/src/components/fortified-function/core/mods/security-manager.js +100 -0
  477. package/dist/esm/mods/toolkit/src/components/fortified-function/core/mods/security-manager.js.map +1 -0
  478. package/dist/esm/mods/toolkit/src/components/fortified-function/core/mods/stats-manager.js +157 -0
  479. package/dist/esm/mods/toolkit/src/components/fortified-function/core/mods/stats-manager.js.map +1 -0
  480. package/dist/esm/mods/toolkit/src/components/fortified-function/core/mods/timing-manager.js +123 -0
  481. package/dist/esm/mods/toolkit/src/components/fortified-function/core/mods/timing-manager.js.map +1 -0
  482. package/dist/esm/mods/toolkit/src/components/fortified-function/engines/analytics-engine.js +368 -0
  483. package/dist/esm/mods/toolkit/src/components/fortified-function/engines/analytics-engine.js.map +1 -0
  484. package/dist/esm/mods/toolkit/src/components/fortified-function/engines/execution-engine.js +400 -0
  485. package/dist/esm/mods/toolkit/src/components/fortified-function/engines/execution-engine.js.map +1 -0
  486. package/dist/esm/mods/toolkit/src/components/fortified-function/index.js +165 -0
  487. package/dist/esm/mods/toolkit/src/components/fortified-function/index.js.map +1 -0
  488. package/dist/esm/mods/toolkit/src/components/fortified-function/performance/performance-monitor.js +238 -0
  489. package/dist/esm/mods/toolkit/src/components/fortified-function/performance/performance-monitor.js.map +1 -0
  490. package/dist/esm/mods/toolkit/src/components/fortified-function/performance/performance-timer.js +186 -0
  491. package/dist/esm/mods/toolkit/src/components/fortified-function/performance/performance-timer.js.map +1 -0
  492. package/dist/esm/mods/toolkit/src/components/fortified-function/security/security-handler.js +251 -0
  493. package/dist/esm/mods/toolkit/src/components/fortified-function/security/security-handler.js.map +1 -0
  494. package/dist/esm/mods/toolkit/src/components/fortified-function/serializer/safe-serializer.js +344 -0
  495. package/dist/esm/mods/toolkit/src/components/fortified-function/serializer/safe-serializer.js.map +1 -0
  496. package/dist/esm/mods/toolkit/src/components/fortified-function/smart-cache.js +691 -0
  497. package/dist/esm/mods/toolkit/src/components/fortified-function/smart-cache.js.map +1 -0
  498. package/dist/esm/mods/toolkit/src/components/fortified-function/types/types.js +14 -0
  499. package/dist/esm/mods/toolkit/src/components/fortified-function/types/types.js.map +1 -0
  500. package/dist/esm/mods/toolkit/src/components/fortified-function/utils/utils.js +66 -0
  501. package/dist/esm/mods/toolkit/src/components/fortified-function/utils/utils.js.map +1 -0
  502. package/dist/esm/mods/toolkit/src/components/memory-hard.js +919 -0
  503. package/dist/esm/mods/toolkit/src/components/memory-hard.js.map +1 -0
  504. package/dist/esm/mods/toolkit/src/components/post-quantum.js +316 -0
  505. package/dist/esm/mods/toolkit/src/components/post-quantum.js.map +1 -0
  506. package/dist/esm/mods/toolkit/src/components/runtime-verification.js +643 -0
  507. package/dist/esm/mods/toolkit/src/components/runtime-verification.js.map +1 -0
  508. package/dist/esm/mods/toolkit/src/components/secure-array/core/secure-array-core.js +1570 -0
  509. package/dist/esm/mods/toolkit/src/components/secure-array/core/secure-array-core.js.map +1 -0
  510. package/dist/esm/mods/toolkit/src/components/secure-array/crypto/ArrayCryptoHandler.js +328 -0
  511. package/dist/esm/mods/toolkit/src/components/secure-array/crypto/ArrayCryptoHandler.js.map +1 -0
  512. package/dist/esm/mods/toolkit/src/components/secure-array/events/event-manager.js +268 -0
  513. package/dist/esm/mods/toolkit/src/components/secure-array/events/event-manager.js.map +1 -0
  514. package/dist/esm/mods/toolkit/src/components/secure-array/index.js +61 -0
  515. package/dist/esm/mods/toolkit/src/components/secure-array/index.js.map +1 -0
  516. package/dist/esm/mods/toolkit/src/components/secure-array/metadata/metadata-manager.js +329 -0
  517. package/dist/esm/mods/toolkit/src/components/secure-array/metadata/metadata-manager.js.map +1 -0
  518. package/dist/esm/mods/toolkit/src/components/secure-array/serialization/ArraySerializationHandler.js +388 -0
  519. package/dist/esm/mods/toolkit/src/components/secure-array/serialization/ArraySerializationHandler.js.map +1 -0
  520. package/dist/esm/mods/toolkit/src/components/secure-array/types/index.js +84 -0
  521. package/dist/esm/mods/toolkit/src/components/secure-array/types/index.js.map +1 -0
  522. package/dist/esm/mods/toolkit/src/components/secure-array/utils/id-generator.js +78 -0
  523. package/dist/esm/mods/toolkit/src/components/secure-array/utils/id-generator.js.map +1 -0
  524. package/dist/esm/mods/toolkit/src/components/secure-array/utils/validation.js +273 -0
  525. package/dist/esm/mods/toolkit/src/components/secure-array/utils/validation.js.map +1 -0
  526. package/dist/esm/mods/toolkit/src/components/secure-memory.js +884 -0
  527. package/dist/esm/mods/toolkit/src/components/secure-memory.js.map +1 -0
  528. package/dist/esm/mods/toolkit/src/components/secure-object/core/secure-object-core.js +1603 -0
  529. package/dist/esm/mods/toolkit/src/components/secure-object/core/secure-object-core.js.map +1 -0
  530. package/dist/esm/mods/toolkit/src/components/secure-object/encryption/crypto-handler.js +360 -0
  531. package/dist/esm/mods/toolkit/src/components/secure-object/encryption/crypto-handler.js.map +1 -0
  532. package/dist/esm/mods/toolkit/src/components/secure-object/encryption/sensitive-keys.js +203 -0
  533. package/dist/esm/mods/toolkit/src/components/secure-object/encryption/sensitive-keys.js.map +1 -0
  534. package/dist/esm/mods/toolkit/src/components/secure-object/events/event-manager.js +195 -0
  535. package/dist/esm/mods/toolkit/src/components/secure-object/events/event-manager.js.map +1 -0
  536. package/dist/esm/mods/toolkit/src/components/secure-object/index.js +63 -0
  537. package/dist/esm/mods/toolkit/src/components/secure-object/index.js.map +1 -0
  538. package/dist/esm/mods/toolkit/src/components/secure-object/metadata/metadata-manager.js +181 -0
  539. package/dist/esm/mods/toolkit/src/components/secure-object/metadata/metadata-manager.js.map +1 -0
  540. package/dist/esm/mods/toolkit/src/components/secure-object/serialization/serialization-handler.js +195 -0
  541. package/dist/esm/mods/toolkit/src/components/secure-object/serialization/serialization-handler.js.map +1 -0
  542. package/dist/esm/mods/toolkit/src/components/secure-object/utils/id-generator.js +62 -0
  543. package/dist/esm/mods/toolkit/src/components/secure-object/utils/id-generator.js.map +1 -0
  544. package/dist/esm/mods/toolkit/src/components/secure-object/utils/validation.js +237 -0
  545. package/dist/esm/mods/toolkit/src/components/secure-object/utils/validation.js.map +1 -0
  546. package/dist/esm/mods/toolkit/src/components/secure-serialization.js +769 -0
  547. package/dist/esm/mods/toolkit/src/components/secure-serialization.js.map +1 -0
  548. package/dist/esm/mods/toolkit/src/components/secure-string/advanced/entropy-analyzer.js +306 -0
  549. package/dist/esm/mods/toolkit/src/components/secure-string/advanced/entropy-analyzer.js.map +1 -0
  550. package/dist/esm/mods/toolkit/src/components/secure-string/advanced/performance-monitor.js +333 -0
  551. package/dist/esm/mods/toolkit/src/components/secure-string/advanced/performance-monitor.js.map +1 -0
  552. package/dist/esm/mods/toolkit/src/components/secure-string/advanced/quantum-safe.js +243 -0
  553. package/dist/esm/mods/toolkit/src/components/secure-string/advanced/quantum-safe.js.map +1 -0
  554. package/dist/esm/mods/toolkit/src/components/secure-string/buffer/buffer-manager.js +203 -0
  555. package/dist/esm/mods/toolkit/src/components/secure-string/buffer/buffer-manager.js.map +1 -0
  556. package/dist/esm/mods/toolkit/src/components/secure-string/core/secure-string-core.js +786 -0
  557. package/dist/esm/mods/toolkit/src/components/secure-string/core/secure-string-core.js.map +1 -0
  558. package/dist/esm/mods/toolkit/src/components/secure-string/crypto/crypto-operations.js +298 -0
  559. package/dist/esm/mods/toolkit/src/components/secure-string/crypto/crypto-operations.js.map +1 -0
  560. package/dist/esm/mods/toolkit/src/components/secure-string/operations/comparison-operations.js +219 -0
  561. package/dist/esm/mods/toolkit/src/components/secure-string/operations/comparison-operations.js.map +1 -0
  562. package/dist/esm/mods/toolkit/src/components/secure-string/operations/string-operations.js +232 -0
  563. package/dist/esm/mods/toolkit/src/components/secure-string/operations/string-operations.js.map +1 -0
  564. package/dist/esm/mods/toolkit/src/components/secure-string/types/index.js +37 -0
  565. package/dist/esm/mods/toolkit/src/components/secure-string/types/index.js.map +1 -0
  566. package/dist/esm/mods/toolkit/src/components/secure-string/validation/string-validator.js +332 -0
  567. package/dist/esm/mods/toolkit/src/components/secure-string/validation/string-validator.js.map +1 -0
  568. package/dist/esm/mods/toolkit/src/components/side-channel.js +142 -0
  569. package/dist/esm/mods/toolkit/src/components/side-channel.js.map +1 -0
  570. package/dist/esm/mods/toolkit/src/components/tamper-evident-logging.js +389 -0
  571. package/dist/esm/mods/toolkit/src/components/tamper-evident-logging.js.map +1 -0
  572. package/dist/esm/mods/toolkit/src/const/buffer.const.js +13 -0
  573. package/dist/esm/mods/toolkit/src/const/buffer.const.js.map +1 -0
  574. package/dist/esm/mods/toolkit/src/core/crypto.js +720 -0
  575. package/dist/esm/mods/toolkit/src/core/crypto.js.map +1 -0
  576. package/dist/esm/mods/toolkit/src/core/hash/hash-advanced.js +367 -0
  577. package/dist/esm/mods/toolkit/src/core/hash/hash-advanced.js.map +1 -0
  578. package/dist/esm/mods/toolkit/src/core/hash/hash-core.js +355 -0
  579. package/dist/esm/mods/toolkit/src/core/hash/hash-core.js.map +1 -0
  580. package/dist/esm/mods/toolkit/src/core/hash/hash-entropy.js +286 -0
  581. package/dist/esm/mods/toolkit/src/core/hash/hash-entropy.js.map +1 -0
  582. package/dist/esm/mods/toolkit/src/core/hash/hash-security.js +351 -0
  583. package/dist/esm/mods/toolkit/src/core/hash/hash-security.js.map +1 -0
  584. package/dist/esm/mods/toolkit/src/core/hash/hash-types.js +16 -0
  585. package/dist/esm/mods/toolkit/src/core/hash/hash-types.js.map +1 -0
  586. package/dist/esm/mods/toolkit/src/core/hash/hash-utils.js +307 -0
  587. package/dist/esm/mods/toolkit/src/core/hash/hash-utils.js.map +1 -0
  588. package/dist/esm/mods/toolkit/src/core/hash/hash-validator.js +310 -0
  589. package/dist/esm/mods/toolkit/src/core/hash/hash-validator.js.map +1 -0
  590. package/dist/esm/mods/toolkit/src/core/hash.js +9 -0
  591. package/dist/esm/mods/toolkit/src/core/hash.js.map +1 -0
  592. package/dist/esm/mods/toolkit/src/core/keys/algorithms/mods/Argon2Algo.js +133 -0
  593. package/dist/esm/mods/toolkit/src/core/keys/algorithms/mods/Argon2Algo.js.map +1 -0
  594. package/dist/esm/mods/toolkit/src/core/keys/algorithms/mods/PBKDF2Algo.js +272 -0
  595. package/dist/esm/mods/toolkit/src/core/keys/algorithms/mods/PBKDF2Algo.js.map +1 -0
  596. package/dist/esm/mods/toolkit/src/core/keys/algorithms/mods/ScryptAlgo.js +296 -0
  597. package/dist/esm/mods/toolkit/src/core/keys/algorithms/mods/ScryptAlgo.js.map +1 -0
  598. package/dist/esm/mods/toolkit/src/core/keys/keys-core.js +199 -0
  599. package/dist/esm/mods/toolkit/src/core/keys/keys-core.js.map +1 -0
  600. package/dist/esm/mods/toolkit/src/core/keys/keys-logger.js +231 -0
  601. package/dist/esm/mods/toolkit/src/core/keys/keys-logger.js.map +1 -0
  602. package/dist/esm/mods/toolkit/src/core/keys/keys-types.js +63 -0
  603. package/dist/esm/mods/toolkit/src/core/keys/keys-types.js.map +1 -0
  604. package/dist/esm/mods/toolkit/src/core/keys/keys-utils.js +316 -0
  605. package/dist/esm/mods/toolkit/src/core/keys/keys-utils.js.map +1 -0
  606. package/dist/esm/mods/toolkit/src/core/keys.js +134 -0
  607. package/dist/esm/mods/toolkit/src/core/keys.js.map +1 -0
  608. package/dist/esm/mods/toolkit/src/core/password/index.js +110 -0
  609. package/dist/esm/mods/toolkit/src/core/password/index.js.map +1 -0
  610. package/dist/esm/mods/toolkit/src/core/password/password-algorithms.js +395 -0
  611. package/dist/esm/mods/toolkit/src/core/password/password-algorithms.js.map +1 -0
  612. package/dist/esm/mods/toolkit/src/core/password/password-core.js +292 -0
  613. package/dist/esm/mods/toolkit/src/core/password/password-core.js.map +1 -0
  614. package/dist/esm/mods/toolkit/src/core/password/password-generator.js +363 -0
  615. package/dist/esm/mods/toolkit/src/core/password/password-generator.js.map +1 -0
  616. package/dist/esm/mods/toolkit/src/core/password/password-migration.js +235 -0
  617. package/dist/esm/mods/toolkit/src/core/password/password-migration.js.map +1 -0
  618. package/dist/esm/mods/toolkit/src/core/password/password-security.js +532 -0
  619. package/dist/esm/mods/toolkit/src/core/password/password-security.js.map +1 -0
  620. package/dist/esm/mods/toolkit/src/core/password/password-types.js +34 -0
  621. package/dist/esm/mods/toolkit/src/core/password/password-types.js.map +1 -0
  622. package/dist/esm/mods/toolkit/src/core/password/password-utils.js +630 -0
  623. package/dist/esm/mods/toolkit/src/core/password/password-utils.js.map +1 -0
  624. package/dist/esm/mods/toolkit/src/core/password/swlist.js +1120 -0
  625. package/dist/esm/mods/toolkit/src/core/password/swlist.js.map +1 -0
  626. package/dist/esm/mods/toolkit/src/core/random/random-core.js +326 -0
  627. package/dist/esm/mods/toolkit/src/core/random/random-core.js.map +1 -0
  628. package/dist/esm/mods/toolkit/src/core/random/random-crypto.js +337 -0
  629. package/dist/esm/mods/toolkit/src/core/random/random-crypto.js.map +1 -0
  630. package/dist/esm/mods/toolkit/src/core/random/random-entropy.js +367 -0
  631. package/dist/esm/mods/toolkit/src/core/random/random-entropy.js.map +1 -0
  632. package/dist/esm/mods/toolkit/src/core/random/random-generators.js +323 -0
  633. package/dist/esm/mods/toolkit/src/core/random/random-generators.js.map +1 -0
  634. package/dist/esm/mods/toolkit/src/core/random/random-sources.js +405 -0
  635. package/dist/esm/mods/toolkit/src/core/random/random-sources.js.map +1 -0
  636. package/dist/esm/mods/toolkit/src/core/random/random-tokens.js +307 -0
  637. package/dist/esm/mods/toolkit/src/core/random/random-tokens.js.map +1 -0
  638. package/dist/esm/mods/toolkit/src/core/random/random-types.js +27 -0
  639. package/dist/esm/mods/toolkit/src/core/random/random-types.js.map +1 -0
  640. package/dist/esm/mods/toolkit/src/core/validators.js +198 -0
  641. package/dist/esm/mods/toolkit/src/core/validators.js.map +1 -0
  642. package/dist/esm/mods/toolkit/src/helpers/Uint8Array.js +333 -0
  643. package/dist/esm/mods/toolkit/src/helpers/Uint8Array.js.map +1 -0
  644. package/dist/esm/mods/toolkit/src/helpers/createEnu.js +25 -0
  645. package/dist/esm/mods/toolkit/src/helpers/createEnu.js.map +1 -0
  646. package/dist/esm/mods/toolkit/src/index.js +373 -0
  647. package/dist/esm/mods/toolkit/src/index.js.map +1 -0
  648. package/dist/esm/mods/toolkit/src/types/global.js +49 -0
  649. package/dist/esm/mods/toolkit/src/types/global.js.map +1 -0
  650. package/dist/esm/mods/toolkit/src/types/secure-mem.type.js +96 -0
  651. package/dist/esm/mods/toolkit/src/types/secure-mem.type.js.map +1 -0
  652. package/dist/esm/mods/toolkit/src/types/secure-memory.js +20 -0
  653. package/dist/esm/mods/toolkit/src/types/secure-memory.js.map +1 -0
  654. package/dist/esm/mods/toolkit/src/types.js +63 -0
  655. package/dist/esm/mods/toolkit/src/types.js.map +1 -0
  656. package/dist/esm/mods/toolkit/src/utils/CryptoAlgorithmUtils.js +69 -0
  657. package/dist/esm/mods/toolkit/src/utils/CryptoAlgorithmUtils.js.map +1 -0
  658. package/dist/esm/mods/toolkit/src/utils/constants.js +105 -0
  659. package/dist/esm/mods/toolkit/src/utils/constants.js.map +1 -0
  660. package/dist/esm/mods/toolkit/src/utils/dataConverter.js +72 -0
  661. package/dist/esm/mods/toolkit/src/utils/dataConverter.js.map +1 -0
  662. package/dist/esm/mods/toolkit/src/utils/encoding.js +279 -0
  663. package/dist/esm/mods/toolkit/src/utils/encoding.js.map +1 -0
  664. package/dist/esm/mods/toolkit/src/utils/errorHandler.js +137 -0
  665. package/dist/esm/mods/toolkit/src/utils/errorHandler.js.map +1 -0
  666. package/dist/esm/mods/toolkit/src/utils/memory/config-manager.js +280 -0
  667. package/dist/esm/mods/toolkit/src/utils/memory/config-manager.js.map +1 -0
  668. package/dist/esm/mods/toolkit/src/utils/memory/event-manager.js +275 -0
  669. package/dist/esm/mods/toolkit/src/utils/memory/event-manager.js.map +1 -0
  670. package/dist/esm/mods/toolkit/src/utils/memory/index.js +141 -0
  671. package/dist/esm/mods/toolkit/src/utils/memory/index.js.map +1 -0
  672. package/dist/esm/mods/toolkit/src/utils/memory/memory-manager.js +886 -0
  673. package/dist/esm/mods/toolkit/src/utils/memory/memory-manager.js.map +1 -0
  674. package/dist/esm/mods/toolkit/src/utils/memory/memory-pool.js +354 -0
  675. package/dist/esm/mods/toolkit/src/utils/memory/memory-pool.js.map +1 -0
  676. package/dist/esm/mods/toolkit/src/utils/memory/reference-tracker.js +374 -0
  677. package/dist/esm/mods/toolkit/src/utils/memory/reference-tracker.js.map +1 -0
  678. package/dist/esm/mods/toolkit/src/utils/memory/types.js +56 -0
  679. package/dist/esm/mods/toolkit/src/utils/memory/types.js.map +1 -0
  680. package/dist/esm/mods/toolkit/src/utils/patterns.js +124 -0
  681. package/dist/esm/mods/toolkit/src/utils/patterns.js.map +1 -0
  682. package/dist/esm/mods/toolkit/src/utils/performanceMonitor.js +246 -0
  683. package/dist/esm/mods/toolkit/src/utils/performanceMonitor.js.map +1 -0
  684. package/dist/esm/mods/toolkit/src/utils/stats.js +180 -0
  685. package/dist/esm/mods/toolkit/src/utils/stats.js.map +1 -0
  686. package/dist/esm/performance-monitor.js +160 -0
  687. package/dist/esm/performance-monitor.js.map +1 -0
  688. package/dist/esm/plugins/plugin-manager.js +149 -0
  689. package/dist/esm/plugins/plugin-manager.js.map +1 -0
  690. package/dist/esm/plugins/route-optimization-plugin.js +411 -0
  691. package/dist/esm/plugins/route-optimization-plugin.js.map +1 -0
  692. package/dist/esm/plugins/server-maintenance-plugin.js +488 -0
  693. package/dist/esm/plugins/server-maintenance-plugin.js.map +1 -0
  694. package/dist/esm/quick-start.js +45 -0
  695. package/dist/esm/quick-start.js.map +1 -0
  696. package/dist/esm/security-middleware.js +413 -0
  697. package/dist/esm/security-middleware.js.map +1 -0
  698. package/dist/esm/server/FastServer.js +985 -0
  699. package/dist/esm/server/FastServer.js.map +1 -0
  700. package/dist/esm/server/components/fastapi/CacheManager.js +243 -0
  701. package/dist/esm/server/components/fastapi/CacheManager.js.map +1 -0
  702. package/dist/esm/server/components/fastapi/ClusterManagerComponent.js +325 -0
  703. package/dist/esm/server/components/fastapi/ClusterManagerComponent.js.map +1 -0
  704. package/dist/esm/server/components/fastapi/FileWatcherManager.js +491 -0
  705. package/dist/esm/server/components/fastapi/FileWatcherManager.js.map +1 -0
  706. package/dist/esm/server/components/fastapi/MonitoringManager.js +305 -0
  707. package/dist/esm/server/components/fastapi/MonitoringManager.js.map +1 -0
  708. package/dist/esm/server/components/fastapi/PerformanceManager.js +295 -0
  709. package/dist/esm/server/components/fastapi/PerformanceManager.js.map +1 -0
  710. package/dist/esm/server/components/fastapi/PluginManager.js +310 -0
  711. package/dist/esm/server/components/fastapi/PluginManager.js.map +1 -0
  712. package/dist/esm/server/components/fastapi/RedirectManager.js +490 -0
  713. package/dist/esm/server/components/fastapi/RedirectManager.js.map +1 -0
  714. package/dist/esm/server/components/fastapi/RequestProcessor.js +211 -0
  715. package/dist/esm/server/components/fastapi/RequestProcessor.js.map +1 -0
  716. package/dist/esm/server/components/fastapi/RouteManager.js +270 -0
  717. package/dist/esm/server/components/fastapi/RouteManager.js.map +1 -0
  718. package/dist/esm/server/components/fastapi/UltraFastRequestProcessor.js +647 -0
  719. package/dist/esm/server/components/fastapi/UltraFastRequestProcessor.js.map +1 -0
  720. package/dist/esm/server/components/fastapi/console/ConsoleInterceptor.js +810 -0
  721. package/dist/esm/server/components/fastapi/console/ConsoleInterceptor.js.map +1 -0
  722. package/dist/esm/server/components/fastapi/console/encryption/ConsoleEncryption.js +214 -0
  723. package/dist/esm/server/components/fastapi/console/encryption/ConsoleEncryption.js.map +1 -0
  724. package/dist/esm/server/components/fastapi/console/types.js +160 -0
  725. package/dist/esm/server/components/fastapi/console/types.js.map +1 -0
  726. package/dist/esm/server/components/fastapi/middlewares/MiddlewareAPI.js +345 -0
  727. package/dist/esm/server/components/fastapi/middlewares/MiddlewareAPI.js.map +1 -0
  728. package/dist/esm/server/components/fastapi/middlewares/MiddlewareMethodsManager.js +202 -0
  729. package/dist/esm/server/components/fastapi/middlewares/MiddlewareMethodsManager.js.map +1 -0
  730. package/dist/esm/server/components/fastapi/middlewares/middlewareManager.js +951 -0
  731. package/dist/esm/server/components/fastapi/middlewares/middlewareManager.js.map +1 -0
  732. package/dist/esm/server/components/fastapi/modules/UFRP/WorkerPool.js +54 -0
  733. package/dist/esm/server/components/fastapi/modules/UFRP/WorkerPool.js.map +1 -0
  734. package/dist/esm/server/components/fastapi/templates/redirectTemp.js +99 -0
  735. package/dist/esm/server/components/fastapi/templates/redirectTemp.js.map +1 -0
  736. package/dist/esm/server/components/fastapi/typescript/TypeScriptChecker.js +351 -0
  737. package/dist/esm/server/components/fastapi/typescript/TypeScriptChecker.js.map +1 -0
  738. package/dist/esm/server/const/Cluster.config.js +70 -0
  739. package/dist/esm/server/const/Cluster.config.js.map +1 -0
  740. package/dist/esm/server/const/ExecutionPredictor_EP.const.js +62 -0
  741. package/dist/esm/server/const/ExecutionPredictor_EP.const.js.map +1 -0
  742. package/dist/esm/server/const/FileWatcher.config.js +96 -0
  743. package/dist/esm/server/const/FileWatcher.config.js.map +1 -0
  744. package/dist/esm/server/const/default.js +120 -0
  745. package/dist/esm/server/const/default.js.map +1 -0
  746. package/dist/esm/server/optimization/ExecutionPredictor.js +216 -0
  747. package/dist/esm/server/optimization/ExecutionPredictor.js.map +1 -0
  748. package/dist/esm/server/optimization/PerformanceProfiler.js +232 -0
  749. package/dist/esm/server/optimization/PerformanceProfiler.js.map +1 -0
  750. package/dist/esm/server/optimization/RequestPreCompiler.js +706 -0
  751. package/dist/esm/server/optimization/RequestPreCompiler.js.map +1 -0
  752. package/dist/esm/server/optimization/UltraFastOptimizer.js +398 -0
  753. package/dist/esm/server/optimization/UltraFastOptimizer.js.map +1 -0
  754. package/dist/esm/server/plugins/PluginEngine.js +376 -0
  755. package/dist/esm/server/plugins/PluginEngine.js.map +1 -0
  756. package/dist/esm/server/plugins/PluginRegistry.js +337 -0
  757. package/dist/esm/server/plugins/PluginRegistry.js.map +1 -0
  758. package/dist/esm/server/plugins/builtin/JWTAuthPlugin.js +589 -0
  759. package/dist/esm/server/plugins/builtin/JWTAuthPlugin.js.map +1 -0
  760. package/dist/esm/server/plugins/builtin/ResponseTimePlugin.js +411 -0
  761. package/dist/esm/server/plugins/builtin/ResponseTimePlugin.js.map +1 -0
  762. package/dist/esm/server/plugins/builtin/SmartCachePlugin.js +841 -0
  763. package/dist/esm/server/plugins/builtin/SmartCachePlugin.js.map +1 -0
  764. package/dist/esm/server/plugins/core/CachePlugin.js +1973 -0
  765. package/dist/esm/server/plugins/core/CachePlugin.js.map +1 -0
  766. package/dist/esm/server/plugins/core/PerformancePlugin.js +872 -0
  767. package/dist/esm/server/plugins/core/PerformancePlugin.js.map +1 -0
  768. package/dist/esm/server/plugins/core/SecurityPlugin.js +797 -0
  769. package/dist/esm/server/plugins/core/SecurityPlugin.js.map +1 -0
  770. package/dist/esm/server/plugins/types/PluginTypes.js +47 -0
  771. package/dist/esm/server/plugins/types/PluginTypes.js.map +1 -0
  772. package/dist/esm/server/service/Reload/FileWatcher.js +734 -0
  773. package/dist/esm/server/service/Reload/FileWatcher.js.map +1 -0
  774. package/dist/esm/server/service/Reload/HotReloader.js +735 -0
  775. package/dist/esm/server/service/Reload/HotReloader.js.map +1 -0
  776. package/dist/esm/server/service/Reload/exec/TypeScriptExecutor.js +339 -0
  777. package/dist/esm/server/service/Reload/exec/TypeScriptExecutor.js.map +1 -0
  778. package/dist/esm/server/utils/ConfigLoader.js +207 -0
  779. package/dist/esm/server/utils/ConfigLoader.js.map +1 -0
  780. package/dist/esm/server/utils/Logger.js +234 -0
  781. package/dist/esm/server/utils/Logger.js.map +1 -0
  782. package/dist/esm/server/utils/PortManager.js +155 -0
  783. package/dist/esm/server/utils/PortManager.js.map +1 -0
  784. package/dist/esm/server/utils/forceClosePort.js +124 -0
  785. package/dist/esm/server/utils/forceClosePort.js.map +1 -0
  786. package/dist/esm/smart-routes.js +345 -0
  787. package/dist/esm/smart-routes.js.map +1 -0
  788. package/package.json +5 -6
@@ -0,0 +1,1109 @@
1
+ import * as crypto from 'crypto';
2
+ import { promisify } from 'util';
3
+ import zlib from 'zlib';
4
+ import { EventEmitter } from 'events';
5
+ import { SecureRandom } from '../../core/random/random-core.js';
6
+ import '../../core/random/random-types.js';
7
+ import '../../core/random/random-sources.js';
8
+ import 'nehonix-uri-processor';
9
+ import '../../utils/memory/index.js';
10
+ import '../../types.js';
11
+ import { CONFIG } from './config/cache.config.js';
12
+ import { FastLRU } from './FastLRU.js';
13
+
14
+ /**
15
+ * Ultra-Fast Secure In-Memory Cache System (UFSIMC)
16
+ * Enhanced version with extreme performance optimizations, advanced security, and user-friendly features
17
+ */
18
+ /**
19
+ * Ultra-Fast Secure In-Memory Cache (UFSIMC)
20
+ * Extends SIMC with extreme performance optimizations and advanced features
21
+ */
22
+ class UFSIMC extends EventEmitter {
23
+ constructor(maxEntries = CONFIG.MAX_ENTRIES, logger) {
24
+ super();
25
+ this.keyHashMap = new Map(); // Original key -> hashed key mapping
26
+ this.tagIndex = new Map(); // Tag -> keys mapping
27
+ this.priorityQueues = new Array(11)
28
+ .fill(null)
29
+ .map(() => new Set());
30
+ this.stats = {
31
+ hits: 0,
32
+ misses: 0,
33
+ evictions: 0,
34
+ totalSize: 0,
35
+ entryCount: 0,
36
+ hitRate: 0,
37
+ memoryUsage: {
38
+ used: 0,
39
+ limit: CONFIG.MAX_CACHE_SIZE_MB * 1024 * 1024,
40
+ percentage: 0,
41
+ },
42
+ totalAccesses: 0,
43
+ size: 0,
44
+ capacity: CONFIG.MAX_ENTRIES,
45
+ averageAccessTime: 0,
46
+ compressionRatio: 0,
47
+ encryptionOverhead: 0,
48
+ hotKeys: [],
49
+ coldKeys: [],
50
+ tagStats: new Map(),
51
+ };
52
+ this.encryptionKey = Buffer.alloc(0);
53
+ // Performance optimizations
54
+ this.encryptionPool = [];
55
+ this.accessTimes = [];
56
+ // Security enhancements
57
+ this.accessPatterns = new Map();
58
+ this.rateLimiter = new Map();
59
+ this.integrityCheck = true;
60
+ this.anomalyThreshold = 1000;
61
+ this.logger = logger;
62
+ this.lru = new FastLRU(maxEntries);
63
+ this.initializeEncryption();
64
+ this.startMaintenanceTasks();
65
+ this.warmUpPools();
66
+ this.startPerformanceMonitoring();
67
+ }
68
+ /**
69
+ * Warm up cipher pools for better performance
70
+ */
71
+ warmUpPools() {
72
+ // Pre-create cipher instances
73
+ for (let i = 0; i < 10; i++) {
74
+ try {
75
+ const iv = crypto.randomBytes(16);
76
+ this.encryptionPool.push(crypto.createCipheriv(CONFIG.ALGORITHM, this.encryptionKey, iv));
77
+ }
78
+ catch (error) {
79
+ // Pool will be created on-demand
80
+ }
81
+ }
82
+ }
83
+ /**
84
+ * Start performance monitoring
85
+ */
86
+ startPerformanceMonitoring() {
87
+ this.performanceTimer = setInterval(() => {
88
+ this.updatePerformanceMetrics();
89
+ this.optimizeHotness();
90
+ }, 5000); // Every 5 seconds
91
+ this.hotnessDecayTimer = setInterval(() => {
92
+ this.decayHotness();
93
+ }, 60000); // Every minute
94
+ }
95
+ /**
96
+ * Enhanced encryption initialization with key derivation
97
+ */
98
+ initializeEncryption() {
99
+ try {
100
+ if (process.env.ENC_SECRET_KEY) {
101
+ this.encryptionKey = Buffer.from(process.env.ENC_SECRET_KEY, CONFIG.ENCODING);
102
+ }
103
+ else if (process.env.ENC_SECRET_SEED &&
104
+ process.env.ENC_SECRET_SALT) {
105
+ this.encryptionKey = crypto.pbkdf2Sync(process.env.ENC_SECRET_SEED, process.env.ENC_SECRET_SALT, CONFIG.KEY_ITERATIONS, CONFIG.KEY_LENGTH, "sha256");
106
+ }
107
+ else {
108
+ const warningMsg = "UFSIMC-WARNING: Using generated key. For production, set ENV variables: ENC_SECRET_KEY or (ENC_SECRET_SEED and ENC_SECRET_SALT)";
109
+ if (this.logger) {
110
+ this.logger.securityWarning(warningMsg);
111
+ }
112
+ else {
113
+ console.warn(warningMsg);
114
+ }
115
+ this.encryptionKey = SecureRandom.getRandomBytes(CONFIG.KEY_LENGTH).getBuffer();
116
+ }
117
+ this.emit("key_rotation", {
118
+ timestamp: Date.now(),
119
+ reason: "initialization",
120
+ });
121
+ }
122
+ catch (error) {
123
+ console.error("Failed to initialize encryption:", error);
124
+ throw new Error("Cache initialization failed");
125
+ }
126
+ }
127
+ /**
128
+ * Ultra-fast key validation and hashing
129
+ */
130
+ validateAndHashKey(key) {
131
+ if (!key || typeof key !== "string") {
132
+ throw new Error("Cache key must be a non-empty string");
133
+ }
134
+ if (key.length > CONFIG.MAX_KEY_LENGTH) {
135
+ throw new Error(`Cache key too long (max ${CONFIG.MAX_KEY_LENGTH} chars)`);
136
+ }
137
+ // Use cached hash if available
138
+ let hashedKey = this.keyHashMap.get(key);
139
+ if (!hashedKey) {
140
+ const salt = process.env.ENC_SECRET_SALT || "default-salt";
141
+ hashedKey = crypto
142
+ .pbkdf2Sync(key, salt, 1000, 32, "sha256")
143
+ .toString(CONFIG.ENCODING);
144
+ this.keyHashMap.set(key, hashedKey);
145
+ }
146
+ return hashedKey;
147
+ }
148
+ /**
149
+ * High-performance compression with adaptive algorithms
150
+ */
151
+ async smartCompress(data) {
152
+ if (data.length < CONFIG.COMPRESSION_THRESHOLD_BYTES) {
153
+ return { data, compressed: false, ratio: 1 };
154
+ }
155
+ try {
156
+ const originalSize = data.length;
157
+ // Try different compression based on data characteristics
158
+ let compressed;
159
+ if (data.includes("{") || data.includes("[")) {
160
+ // JSON-like data - use deflate
161
+ compressed = await promisify(zlib.deflate)(Buffer.from(data, "utf8"));
162
+ }
163
+ else {
164
+ // Text data - use gzip
165
+ compressed = await promisify(zlib.gzip)(Buffer.from(data, "utf8"));
166
+ }
167
+ const compressedString = compressed.toString(CONFIG.ENCODING);
168
+ const ratio = originalSize / compressedString.length;
169
+ if (ratio > 1.1) {
170
+ // At least 10% compression
171
+ return { data: compressedString, compressed: true, ratio };
172
+ }
173
+ }
174
+ catch (error) {
175
+ if (this.logger) {
176
+ this.logger.warn("cache", "Compression failed:", error);
177
+ }
178
+ else {
179
+ console.warn("Compression failed:", error);
180
+ }
181
+ }
182
+ return { data, compressed: false, ratio: 1 };
183
+ }
184
+ /**
185
+ * Smart decompression
186
+ */
187
+ async smartDecompress(data, compressed) {
188
+ if (!compressed)
189
+ return data;
190
+ try {
191
+ const buffer = Buffer.from(data, CONFIG.ENCODING);
192
+ // Try gzip first, then deflate
193
+ try {
194
+ const decompressed = await promisify(zlib.gunzip)(buffer);
195
+ return decompressed.toString("utf8");
196
+ }
197
+ catch {
198
+ const decompressed = await promisify(zlib.inflate)(buffer);
199
+ return decompressed.toString("utf8");
200
+ }
201
+ }
202
+ catch (error) {
203
+ console.error("Decompression failed:", error);
204
+ throw new Error("Data decompression failed");
205
+ }
206
+ }
207
+ /**
208
+ * High-performance encryption with pooling
209
+ */
210
+ fastEncrypt(data) {
211
+ try {
212
+ const iv = crypto.randomBytes(16);
213
+ const cipher = crypto.createCipheriv(CONFIG.ALGORITHM, this.encryptionKey, iv);
214
+ let encrypted = cipher.update(data, "utf8", CONFIG.ENCODING);
215
+ encrypted += cipher.final(CONFIG.ENCODING);
216
+ const authTag = cipher.getAuthTag().toString(CONFIG.ENCODING);
217
+ return {
218
+ encrypted,
219
+ iv: iv.toString(CONFIG.ENCODING),
220
+ authTag,
221
+ };
222
+ }
223
+ catch (error) {
224
+ this.emit("encryption_failure", {
225
+ error: error.message,
226
+ timestamp: Date.now(),
227
+ });
228
+ throw new Error("Encryption failed");
229
+ }
230
+ }
231
+ /**
232
+ * High-performance decryption
233
+ */
234
+ fastDecrypt(encrypted, iv, authTag) {
235
+ try {
236
+ const ivBuffer = Buffer.from(iv, CONFIG.ENCODING);
237
+ const authTagBuffer = Buffer.from(authTag, CONFIG.ENCODING);
238
+ const decipher = crypto.createDecipheriv(CONFIG.ALGORITHM, this.encryptionKey, ivBuffer);
239
+ decipher.setAuthTag(authTagBuffer);
240
+ let decrypted = decipher.update(encrypted, CONFIG.ENCODING, "utf8");
241
+ decrypted += decipher.final("utf8");
242
+ return decrypted;
243
+ }
244
+ catch (error) {
245
+ throw new Error("Decryption failed - data may be corrupted");
246
+ }
247
+ }
248
+ /**
249
+ * Calculate data checksum for integrity
250
+ */
251
+ calculateChecksum(data) {
252
+ return crypto
253
+ .createHash("sha256")
254
+ .update(data)
255
+ .digest("hex")
256
+ .substring(0, 16);
257
+ }
258
+ /**
259
+ * Rate limiting check
260
+ */
261
+ checkRateLimit(key) {
262
+ const now = Date.now();
263
+ const limit = this.rateLimiter.get(key);
264
+ if (!limit || now > limit.resetTime) {
265
+ this.rateLimiter.set(key, { count: 1, resetTime: now + 60000 }); // 1 minute window
266
+ return true;
267
+ }
268
+ if (limit.count >= 10000) {
269
+ // 10k requests per minute max
270
+ return false;
271
+ }
272
+ limit.count++;
273
+ return true;
274
+ }
275
+ /**
276
+ * Ultra-fast SET operation with advanced features
277
+ */
278
+ async set(key, value, options = {}) {
279
+ const startTime = process.hrtime.bigint();
280
+ try {
281
+ // Rate limiting
282
+ if (!this.checkRateLimit(key)) {
283
+ throw new Error("Rate limit exceeded");
284
+ }
285
+ const hashedKey = this.validateAndHashKey(key);
286
+ const serialized = JSON.stringify(value);
287
+ // Size validation
288
+ if (serialized.length > CONFIG.MAX_VALUE_SIZE_MB * 1024 * 1024) {
289
+ throw new Error(`Value too large (max ${CONFIG.MAX_VALUE_SIZE_MB}MB)`);
290
+ }
291
+ // Smart compression
292
+ const { data: processedData, compressed } = options.skipCompression
293
+ ? { data: serialized, compressed: false }
294
+ : await this.smartCompress(serialized);
295
+ // Conditional encryption
296
+ let encrypted, iv, authTag, checksum;
297
+ if (options.skipEncryption) {
298
+ encrypted = processedData;
299
+ iv = "";
300
+ authTag = "";
301
+ }
302
+ else {
303
+ const encResult = this.fastEncrypt(processedData);
304
+ encrypted = encResult.encrypted;
305
+ iv = encResult.iv;
306
+ authTag = encResult.authTag;
307
+ }
308
+ checksum = this.integrityCheck
309
+ ? this.calculateChecksum(serialized)
310
+ : "";
311
+ const now = Date.now();
312
+ const ttl = options.ttl || CONFIG.CACHE_EXPIRY_MS;
313
+ const priority = Math.max(1, Math.min(10, options.priority || 5));
314
+ const entry = {
315
+ data: encrypted,
316
+ iv,
317
+ authTag,
318
+ timestamp: now,
319
+ expiresAt: now + ttl,
320
+ accessCount: 0,
321
+ lastAccessed: now,
322
+ compressed,
323
+ size: encrypted.length + iv.length + authTag.length + 200,
324
+ version: 1,
325
+ hotness: 0,
326
+ priority,
327
+ tags: new Set(options.tags || []),
328
+ metadata: options.metadata || {},
329
+ checksum,
330
+ };
331
+ // Handle eviction with callback
332
+ const evictedEntry = this.lru.put(hashedKey, entry);
333
+ if (evictedEntry && options.onEvict) {
334
+ try {
335
+ const evictedData = await this.decryptAndDecompress(evictedEntry);
336
+ // Find the original key for the evicted entry
337
+ const originalKey = this.findOriginalKey(hashedKey);
338
+ if (originalKey) {
339
+ options.onEvict(originalKey, JSON.parse(evictedData));
340
+ }
341
+ }
342
+ catch (error) {
343
+ if (this.logger) {
344
+ this.logger.warn("cache", "Eviction callback failed:", error);
345
+ }
346
+ else {
347
+ console.warn("Eviction callback failed:", error);
348
+ }
349
+ }
350
+ }
351
+ // Update indexes - ensure priority is within valid range
352
+ if (priority >= 0 && priority < this.priorityQueues.length) {
353
+ this.priorityQueues[priority].add(hashedKey);
354
+ }
355
+ if (options.tags) {
356
+ options.tags.forEach((tag) => {
357
+ if (!this.tagIndex.has(tag)) {
358
+ this.tagIndex.set(tag, new Set());
359
+ }
360
+ this.tagIndex.get(tag).add(hashedKey);
361
+ });
362
+ }
363
+ // Update stats
364
+ this.updateStatsAfterSet(entry.size, evictedEntry ? 1 : 0);
365
+ this.recordAccessTime(startTime);
366
+ return true;
367
+ }
368
+ catch (error) {
369
+ console.error("Ultra cache set error:", error);
370
+ return false;
371
+ }
372
+ }
373
+ /**
374
+ * Ultra-fast GET operation with hotness tracking
375
+ */
376
+ async get(key) {
377
+ const startTime = process.hrtime.bigint();
378
+ try {
379
+ const hashedKey = this.validateAndHashKey(key);
380
+ const node = this.lru.getNode(hashedKey);
381
+ if (!node?.entry) {
382
+ this.stats.misses++;
383
+ this.recordAccessTime(startTime);
384
+ return null;
385
+ }
386
+ const entry = node.entry;
387
+ const now = Date.now();
388
+ // Check expiration
389
+ if (now > entry.expiresAt) {
390
+ this.lru.delete(hashedKey);
391
+ this.cleanupIndexes(hashedKey, entry);
392
+ this.stats.misses++;
393
+ this.stats.entryCount--;
394
+ this.recordAccessTime(startTime);
395
+ return null;
396
+ }
397
+ // Update access patterns and hotness
398
+ entry.accessCount++;
399
+ entry.lastAccessed = now;
400
+ entry.hotness = Math.min(100, entry.hotness + 1);
401
+ // Security monitoring
402
+ this.trackAccess(hashedKey);
403
+ // Decrypt and decompress
404
+ const decryptedData = await this.decryptAndDecompress(entry);
405
+ // Integrity check - compare against original serialized data
406
+ if (this.integrityCheck && entry.checksum) {
407
+ const currentChecksum = this.calculateChecksum(decryptedData);
408
+ if (currentChecksum !== entry.checksum) {
409
+ this.emit("integrity_violation", { key, timestamp: now });
410
+ throw new Error("Data integrity check failed");
411
+ }
412
+ }
413
+ this.stats.hits++;
414
+ this.recordAccessTime(startTime);
415
+ return JSON.parse(decryptedData);
416
+ }
417
+ catch (error) {
418
+ console.error("Ultra cache get error:", error);
419
+ this.stats.misses++;
420
+ this.recordAccessTime(startTime);
421
+ return null;
422
+ }
423
+ }
424
+ /**
425
+ * Helper method for decryption and decompression
426
+ */
427
+ async decryptAndDecompress(entry) {
428
+ let decrypted;
429
+ if (entry.iv && entry.authTag) {
430
+ decrypted = this.fastDecrypt(entry.data, entry.iv, entry.authTag);
431
+ }
432
+ else {
433
+ decrypted = entry.data; // Unencrypted data
434
+ }
435
+ return await this.smartDecompress(decrypted, entry.compressed);
436
+ }
437
+ /**
438
+ * Batch GET operation for multiple keys
439
+ */
440
+ async getMultiple(keys) {
441
+ const results = new Map();
442
+ // Process in parallel batches
443
+ const batchSize = 50;
444
+ for (let i = 0; i < keys.length; i += batchSize) {
445
+ const batch = keys.slice(i, i + batchSize);
446
+ const promises = batch.map(async (key) => {
447
+ const value = await this.get(key);
448
+ return { key, value };
449
+ });
450
+ const batchResults = await Promise.all(promises);
451
+ batchResults.forEach(({ key, value }) => {
452
+ results.set(key, value);
453
+ });
454
+ }
455
+ return results;
456
+ }
457
+ /**
458
+ * Set multiple key-value pairs
459
+ */
460
+ async setMultiple(entries) {
461
+ const promises = entries.map(({ key, value, options }) => this.set(key, value, options));
462
+ return Promise.all(promises);
463
+ }
464
+ /**
465
+ * Delete by tag
466
+ */
467
+ async deleteByTag(tag) {
468
+ const keys = this.tagIndex.get(tag);
469
+ if (!keys)
470
+ return 0;
471
+ let deleted = 0;
472
+ for (const hashedKey of keys) {
473
+ if (this.lru.delete(hashedKey)) {
474
+ deleted++;
475
+ }
476
+ }
477
+ this.tagIndex.delete(tag);
478
+ this.stats.entryCount -= deleted;
479
+ return deleted;
480
+ }
481
+ /**
482
+ * Get keys by tag
483
+ */
484
+ getKeysByTag(tag) {
485
+ const hashedKeys = this.tagIndex.get(tag);
486
+ if (!hashedKeys)
487
+ return [];
488
+ const originalKeys = [];
489
+ for (const [originalKey, hashedKey] of this.keyHashMap.entries()) {
490
+ if (hashedKeys.has(hashedKey)) {
491
+ originalKeys.push(originalKey);
492
+ }
493
+ }
494
+ return originalKeys;
495
+ }
496
+ /**
497
+ * Advanced cache statistics
498
+ */
499
+ get getUltraStats() {
500
+ this.updatePerformanceMetrics();
501
+ return { ...this.stats };
502
+ }
503
+ /**
504
+ * Export cache data for backup
505
+ */
506
+ async exportData() {
507
+ const data = {};
508
+ const keys = this.lru.getKeys();
509
+ for (const hashedKey of keys) {
510
+ const node = this.lru.getNode(hashedKey);
511
+ if (node?.entry) {
512
+ try {
513
+ const decrypted = await this.decryptAndDecompress(node.entry);
514
+ const originalKey = this.findOriginalKey(hashedKey);
515
+ if (originalKey) {
516
+ data[originalKey] = {
517
+ value: JSON.parse(decrypted),
518
+ metadata: node.entry
519
+ .metadata,
520
+ tags: Array.from(node.entry.tags),
521
+ expiresAt: node.entry
522
+ .expiresAt,
523
+ };
524
+ }
525
+ }
526
+ catch (error) {
527
+ if (this.logger) {
528
+ this.logger.warn("cache", `Failed to export key ${hashedKey}:`, error);
529
+ }
530
+ else {
531
+ console.warn(`Failed to export key ${hashedKey}:`, error);
532
+ }
533
+ }
534
+ }
535
+ }
536
+ return data;
537
+ }
538
+ /**
539
+ * Import cache data from backup
540
+ */
541
+ async importData(data) {
542
+ try {
543
+ for (const [key, info] of Object.entries(data)) {
544
+ const { value, metadata, tags, expiresAt } = info;
545
+ const ttl = Math.max(0, expiresAt - Date.now());
546
+ if (ttl > 0) {
547
+ await this.set(key, value, {
548
+ ttl,
549
+ metadata,
550
+ tags,
551
+ });
552
+ }
553
+ }
554
+ return true;
555
+ }
556
+ catch (error) {
557
+ console.error("Import failed:", error);
558
+ return false;
559
+ }
560
+ }
561
+ /**
562
+ * Performance and maintenance methods
563
+ */
564
+ updatePerformanceMetrics() {
565
+ // Calculate average access time
566
+ if (this.accessTimes.length > 0) {
567
+ this.stats.averageAccessTime =
568
+ this.accessTimes.reduce((a, b) => a + b, 0) /
569
+ this.accessTimes.length;
570
+ this.accessTimes = this.accessTimes.slice(-1000); // Keep last 1000 measurements
571
+ }
572
+ // Update memory stats
573
+ this.stats.entryCount = this.lru.getSize();
574
+ this.stats.memoryUsage.used = this.stats.totalSize;
575
+ this.stats.memoryUsage.percentage =
576
+ (this.stats.totalSize / this.stats.memoryUsage.limit) * 100;
577
+ this.stats.hitRate =
578
+ this.stats.hits / Math.max(1, this.stats.hits + this.stats.misses);
579
+ // Update hot/cold keys
580
+ this.updateHotColdKeys();
581
+ }
582
+ updateHotColdKeys() {
583
+ const keys = this.lru.getKeys();
584
+ const keyHotness = [];
585
+ for (const hashedKey of keys) {
586
+ const node = this.lru.getNode(hashedKey);
587
+ if (node?.entry) {
588
+ const entry = node.entry;
589
+ const originalKey = this.findOriginalKey(hashedKey);
590
+ if (originalKey) {
591
+ keyHotness.push({
592
+ key: originalKey,
593
+ hotness: entry.hotness,
594
+ });
595
+ }
596
+ }
597
+ }
598
+ keyHotness.sort((a, b) => b.hotness - a.hotness);
599
+ this.stats.hotKeys = keyHotness.slice(0, 10).map((k) => k.key);
600
+ this.stats.coldKeys = keyHotness.slice(-10).map((k) => k.key);
601
+ }
602
+ optimizeHotness() {
603
+ // Move hot items to higher priority
604
+ const keys = this.lru.getKeys();
605
+ for (const hashedKey of keys) {
606
+ const node = this.lru.getNode(hashedKey);
607
+ if (node?.entry) {
608
+ const entry = node.entry;
609
+ if (entry.hotness > 50 && entry.priority < 8) {
610
+ entry.priority = Math.min(10, entry.priority + 1);
611
+ }
612
+ }
613
+ }
614
+ }
615
+ decayHotness() {
616
+ // Gradually reduce hotness to identify truly hot vs temporarily hot items
617
+ const keys = this.lru.getKeys();
618
+ for (const hashedKey of keys) {
619
+ const node = this.lru.getNode(hashedKey);
620
+ if (node?.entry) {
621
+ const entry = node.entry;
622
+ entry.hotness = Math.max(0, entry.hotness * 0.9);
623
+ }
624
+ }
625
+ }
626
+ recordAccessTime(startTime) {
627
+ const endTime = process.hrtime.bigint();
628
+ const durationNs = Number(endTime - startTime);
629
+ const durationMs = durationNs / 1000000;
630
+ this.accessTimes.push(durationMs);
631
+ }
632
+ updateStatsAfterSet(size, evictions) {
633
+ this.stats.totalSize += size;
634
+ this.stats.entryCount++;
635
+ this.stats.evictions += evictions;
636
+ }
637
+ trackAccess(key) {
638
+ const now = Date.now();
639
+ if (!this.accessPatterns.has(key)) {
640
+ this.accessPatterns.set(key, []);
641
+ }
642
+ const accesses = this.accessPatterns.get(key);
643
+ accesses.push(now);
644
+ // Keep only recent accesses
645
+ const oneHourAgo = now - 60 * 60 * 1000;
646
+ const recentAccesses = accesses.filter((time) => time > oneHourAgo);
647
+ this.accessPatterns.set(key, recentAccesses);
648
+ // Detect anomalies
649
+ if (recentAccesses.length > this.anomalyThreshold) {
650
+ this.emit("suspicious_access", {
651
+ key,
652
+ count: recentAccesses.length,
653
+ timestamp: now,
654
+ });
655
+ }
656
+ }
657
+ cleanupIndexes(hashedKey, entry) {
658
+ // Remove from priority queues - ensure priority is within valid range
659
+ if (entry.priority >= 0 &&
660
+ entry.priority < this.priorityQueues.length) {
661
+ this.priorityQueues[entry.priority].delete(hashedKey);
662
+ }
663
+ // Remove from tag indexes
664
+ for (const tag of entry.tags) {
665
+ const tagKeys = this.tagIndex.get(tag);
666
+ if (tagKeys) {
667
+ tagKeys.delete(hashedKey);
668
+ if (tagKeys.size === 0) {
669
+ this.tagIndex.delete(tag);
670
+ }
671
+ }
672
+ }
673
+ }
674
+ findOriginalKey(hashedKey) {
675
+ for (const [originalKey, hash] of this.keyHashMap.entries()) {
676
+ if (hash === hashedKey) {
677
+ return originalKey;
678
+ }
679
+ }
680
+ return undefined;
681
+ }
682
+ startMaintenanceTasks() {
683
+ this.cleanupTimer = setInterval(() => {
684
+ this.cleanup();
685
+ }, CONFIG.CLEANUP_INTERVAL_MS);
686
+ this.keyRotationTimer = setInterval(() => {
687
+ this.rotateEncryptionKey();
688
+ }, CONFIG.KEY_ROTATION_MS);
689
+ this.securityTimer = setInterval(() => {
690
+ this.performSecurityChecks();
691
+ }, CONFIG.SECURITY_CHECK_INTERVAL_MS);
692
+ }
693
+ cleanup() {
694
+ const now = Date.now();
695
+ const keys = this.lru.getKeys();
696
+ let cleaned = 0;
697
+ for (const hashedKey of keys) {
698
+ const node = this.lru.getNode(hashedKey);
699
+ if (node?.entry &&
700
+ now > node.entry.expiresAt) {
701
+ const entry = node.entry;
702
+ this.lru.delete(hashedKey);
703
+ this.cleanupIndexes(hashedKey, entry);
704
+ this.stats.totalSize -= entry.size;
705
+ cleaned++;
706
+ }
707
+ }
708
+ if (cleaned > 0) {
709
+ this.stats.entryCount -= cleaned;
710
+ this.emit("cleanup_completed", { cleaned, timestamp: now });
711
+ }
712
+ }
713
+ async rotateEncryptionKey() {
714
+ try {
715
+ const newKey = crypto.randomBytes(CONFIG.KEY_LENGTH);
716
+ const oldKey = this.encryptionKey;
717
+ const keys = this.lru.getKeys();
718
+ let processed = 0;
719
+ for (const hashedKey of keys) {
720
+ const node = this.lru.getNode(hashedKey);
721
+ if (!node?.entry)
722
+ continue;
723
+ const entry = node.entry;
724
+ // Skip unencrypted entries
725
+ if (!entry.iv || !entry.authTag)
726
+ continue;
727
+ try {
728
+ // Decrypt with old key
729
+ this.encryptionKey = oldKey;
730
+ const decrypted = this.fastDecrypt(entry.data, entry.iv, entry.authTag);
731
+ // Re-encrypt with new key
732
+ this.encryptionKey = newKey;
733
+ const { encrypted, iv, authTag } = this.fastEncrypt(decrypted);
734
+ // Update entry
735
+ entry.data = encrypted;
736
+ entry.iv = iv;
737
+ entry.authTag = authTag;
738
+ processed++;
739
+ }
740
+ catch (error) {
741
+ console.error(`Failed to re-encrypt entry ${hashedKey}:`, error);
742
+ // Remove corrupted entry
743
+ this.lru.delete(hashedKey);
744
+ this.cleanupIndexes(hashedKey, entry);
745
+ this.stats.totalSize -= entry.size;
746
+ this.stats.entryCount--;
747
+ }
748
+ }
749
+ this.encryptionKey = newKey;
750
+ this.emit("key_rotation", {
751
+ timestamp: Date.now(),
752
+ reason: "scheduled",
753
+ entriesProcessed: processed,
754
+ });
755
+ }
756
+ catch (error) {
757
+ console.error("Key rotation failed:", error);
758
+ }
759
+ }
760
+ performSecurityChecks() {
761
+ // Memory pressure check
762
+ if (this.stats.memoryUsage.percentage > 90) {
763
+ this.emit("memory_pressure", {
764
+ usage: this.stats.memoryUsage,
765
+ timestamp: Date.now(),
766
+ });
767
+ // Emergency cleanup
768
+ this.emergencyCleanup();
769
+ }
770
+ // Check for potential DoS attacks
771
+ if (this.lru.getSize() > CONFIG.MAX_ENTRIES * 0.95) {
772
+ this.emit("cache_overflow", {
773
+ entries: this.lru.getSize(),
774
+ limit: CONFIG.MAX_ENTRIES,
775
+ timestamp: Date.now(),
776
+ });
777
+ }
778
+ // Analyze access patterns for anomalies
779
+ this.detectAnomalies();
780
+ }
781
+ emergencyCleanup() {
782
+ const targetSize = this.stats.memoryUsage.limit * 0.6; // Clear to 60%
783
+ const keys = this.lru.getKeys();
784
+ let cleaned = 0;
785
+ // Remove expired entries first
786
+ this.cleanup();
787
+ // If still over limit, remove coldest entries
788
+ if (this.stats.totalSize > targetSize) {
789
+ for (const hashedKey of keys) {
790
+ if (this.stats.totalSize <= targetSize)
791
+ break;
792
+ const node = this.lru.getNode(hashedKey);
793
+ if (node?.entry) {
794
+ const entry = node.entry;
795
+ if (entry.hotness < 10) {
796
+ // Remove cold entries
797
+ this.lru.delete(hashedKey);
798
+ this.cleanupIndexes(hashedKey, entry);
799
+ this.stats.totalSize -= entry.size;
800
+ cleaned++;
801
+ }
802
+ }
803
+ }
804
+ }
805
+ this.stats.entryCount -= cleaned;
806
+ this.stats.evictions += cleaned;
807
+ this.emit("emergency_cleanup", { cleaned, timestamp: Date.now() });
808
+ }
809
+ detectAnomalies() {
810
+ const now = Date.now();
811
+ const suspiciousPatterns = [];
812
+ for (const [key, accesses] of this.accessPatterns.entries()) {
813
+ if (accesses.length > this.anomalyThreshold) {
814
+ suspiciousPatterns.push(key);
815
+ }
816
+ }
817
+ if (suspiciousPatterns.length > 0) {
818
+ this.emit("anomaly_detected", {
819
+ patterns: suspiciousPatterns,
820
+ timestamp: now,
821
+ });
822
+ }
823
+ }
824
+ // ==================Advanced methods (usefull in some case)
825
+ /**
826
+ * Get cache health report
827
+ */
828
+ getHealthReport() {
829
+ const issues = [];
830
+ const recommendations = [];
831
+ let status = "healthy";
832
+ const stats = this.getUltraStats;
833
+ // Check hit rate
834
+ if (stats.hitRate < 0.5) {
835
+ issues.push("Low hit rate (< 50%)");
836
+ recommendations.push("Consider increasing cache size or TTL values");
837
+ status = "warning";
838
+ }
839
+ // Check memory usage
840
+ if (stats.memoryUsage.percentage > 90) {
841
+ issues.push("High memory usage (> 90%)");
842
+ recommendations.push("Increase cache size limit or reduce entry count");
843
+ status = "critical";
844
+ }
845
+ // Check access time
846
+ if (stats.averageAccessTime > 10) {
847
+ issues.push("Slow access times (> 10ms)");
848
+ recommendations.push("Consider optimizing data size or disabling encryption for performance-critical data");
849
+ if (status === "healthy")
850
+ status = "warning";
851
+ }
852
+ // Check eviction rate
853
+ const evictionRate = stats.evictions / Math.max(1, stats.entryCount);
854
+ if (evictionRate > 0.1) {
855
+ issues.push("High eviction rate (> 10%)");
856
+ recommendations.push("Increase cache size or adjust TTL values");
857
+ if (status === "healthy")
858
+ status = "warning";
859
+ }
860
+ return { status, issues, recommendations, metrics: stats };
861
+ }
862
+ /**
863
+ * Optimize cache configuration automatically
864
+ */
865
+ autoOptimize() {
866
+ const stats = this.getUltraStats;
867
+ // Adjust anomaly threshold based on usage patterns
868
+ const avgAccesses = Array.from(this.accessPatterns.values()).reduce((sum, accesses) => sum + accesses.length, 0) / Math.max(1, this.accessPatterns.size);
869
+ this.anomalyThreshold = Math.max(1000, avgAccesses * 10);
870
+ // Adjust cleanup frequency based on expiration patterns
871
+ if (stats.memoryUsage.percentage > 70) {
872
+ // More frequent cleanup
873
+ if (this.cleanupTimer) {
874
+ clearInterval(this.cleanupTimer);
875
+ this.cleanupTimer = setInterval(() => this.cleanup(), CONFIG.CLEANUP_INTERVAL_MS / 2);
876
+ }
877
+ }
878
+ this.emit("auto_optimization", {
879
+ anomalyThreshold: this.anomalyThreshold,
880
+ timestamp: Date.now(),
881
+ });
882
+ }
883
+ /**
884
+ * Prefetch data based on access patterns
885
+ */
886
+ async prefetch(predictor) {
887
+ let prefetched = 0;
888
+ const keys = this.lru.getKeys();
889
+ for (const hashedKey of keys) {
890
+ const node = this.lru.getNode(hashedKey);
891
+ if (!node?.entry)
892
+ continue;
893
+ const entry = node.entry;
894
+ const originalKey = this.findOriginalKey(hashedKey);
895
+ if (originalKey && entry.hotness > 20) {
896
+ try {
897
+ const predictedData = await predictor(originalKey, entry.metadata);
898
+ if (predictedData) {
899
+ const prefetchKey = `${originalKey}_prefetch_${Date.now()}`;
900
+ await this.set(prefetchKey, predictedData, {
901
+ ttl: entry.expiresAt - Date.now(),
902
+ priority: Math.min(10, entry.priority + 1),
903
+ });
904
+ prefetched++;
905
+ }
906
+ }
907
+ catch (error) {
908
+ if (this.logger) {
909
+ this.logger.warn("cache", `Prefetch failed for ${originalKey}:`, error);
910
+ }
911
+ else {
912
+ console.warn(`Prefetch failed for ${originalKey}:`, error);
913
+ }
914
+ }
915
+ }
916
+ }
917
+ return prefetched;
918
+ }
919
+ /**
920
+ * Create a cache snapshot for debugging
921
+ */
922
+ createSnapshot() {
923
+ const snapshot = {
924
+ timestamp: Date.now(),
925
+ stats: this.getUltraStats,
926
+ entries: [],
927
+ hotKeys: this.stats.hotKeys,
928
+ coldKeys: this.stats.coldKeys,
929
+ tagStats: Object.fromEntries(this.stats.tagStats),
930
+ };
931
+ const keys = this.lru.getKeys().slice(0, 100); // Sample first 100 entries
932
+ for (const hashedKey of keys) {
933
+ const node = this.lru.getNode(hashedKey);
934
+ if (node?.entry) {
935
+ const entry = node.entry;
936
+ const originalKey = this.findOriginalKey(hashedKey);
937
+ snapshot.entries.push({
938
+ key: originalKey,
939
+ size: entry.size,
940
+ accessCount: entry.accessCount,
941
+ hotness: entry.hotness,
942
+ priority: entry.priority,
943
+ tags: Array.from(entry.tags),
944
+ compressed: entry.compressed,
945
+ encrypted: !!(entry.iv && entry.authTag),
946
+ expiresIn: Math.max(0, entry.expiresAt - Date.now()),
947
+ });
948
+ }
949
+ }
950
+ return snapshot;
951
+ }
952
+ /**
953
+ * Validate cache integrity
954
+ */
955
+ async validateIntegrity() {
956
+ const result = { valid: 0, invalid: 0, errors: [] };
957
+ const keys = this.lru.getKeys();
958
+ for (const hashedKey of keys) {
959
+ const node = this.lru.getNode(hashedKey);
960
+ if (!node?.entry)
961
+ continue;
962
+ const entry = node.entry;
963
+ const originalKey = this.findOriginalKey(hashedKey);
964
+ try {
965
+ // Try to decrypt and decompress
966
+ await this.decryptAndDecompress(entry);
967
+ result.valid++;
968
+ }
969
+ catch (error) {
970
+ result.invalid++;
971
+ result.errors.push(`${originalKey}: ${error}`);
972
+ // Remove corrupted entry
973
+ this.lru.delete(hashedKey);
974
+ this.cleanupIndexes(hashedKey, entry);
975
+ this.stats.totalSize -= entry.size;
976
+ this.stats.entryCount--;
977
+ }
978
+ }
979
+ return result;
980
+ }
981
+ /**
982
+ * Enhanced delete with pattern matching
983
+ */
984
+ delete(key) {
985
+ try {
986
+ const hashedKey = this.validateAndHashKey(key);
987
+ const node = this.lru.getNode(hashedKey);
988
+ if (node?.entry) {
989
+ const entry = node.entry;
990
+ this.lru.delete(hashedKey);
991
+ this.cleanupIndexes(hashedKey, entry);
992
+ this.stats.totalSize -= entry.size;
993
+ this.stats.entryCount--;
994
+ this.keyHashMap.delete(key);
995
+ return true;
996
+ }
997
+ return false;
998
+ }
999
+ catch (error) {
1000
+ console.error("Delete error:", error);
1001
+ return false;
1002
+ }
1003
+ }
1004
+ /**
1005
+ * Delete with pattern (supports wildcards)
1006
+ */
1007
+ deletePattern(pattern) {
1008
+ const regex = new RegExp(pattern.replace(/\*/g, ".*"));
1009
+ let deleted = 0;
1010
+ for (const [originalKey] of this.keyHashMap.entries()) {
1011
+ if (regex.test(originalKey)) {
1012
+ if (this.delete(originalKey)) {
1013
+ deleted++;
1014
+ }
1015
+ }
1016
+ }
1017
+ return deleted;
1018
+ }
1019
+ /**
1020
+ * Check if key exists
1021
+ */
1022
+ has(key) {
1023
+ try {
1024
+ const hashedKey = this.validateAndHashKey(key);
1025
+ const node = this.lru.getNode(hashedKey);
1026
+ if (!node?.entry)
1027
+ return false;
1028
+ if (Date.now() > node.entry.expiresAt) {
1029
+ this.delete(key);
1030
+ return false;
1031
+ }
1032
+ return true;
1033
+ }
1034
+ catch (error) {
1035
+ return false;
1036
+ }
1037
+ }
1038
+ /**
1039
+ * Clear all entries
1040
+ */
1041
+ clear() {
1042
+ this.lru.clear();
1043
+ this.keyHashMap.clear();
1044
+ this.tagIndex.clear();
1045
+ this.accessPatterns.clear();
1046
+ this.rateLimiter.clear();
1047
+ this.priorityQueues.forEach((queue) => queue.clear());
1048
+ this.stats = {
1049
+ hits: 0,
1050
+ misses: 0,
1051
+ evictions: 0,
1052
+ totalSize: 0,
1053
+ entryCount: 0,
1054
+ hitRate: 0,
1055
+ memoryUsage: {
1056
+ used: 0,
1057
+ limit: CONFIG.MAX_CACHE_SIZE_MB * 1024 * 1024,
1058
+ percentage: 0,
1059
+ },
1060
+ totalAccesses: 0,
1061
+ size: 0,
1062
+ capacity: CONFIG.MAX_ENTRIES,
1063
+ averageAccessTime: 0,
1064
+ compressionRatio: 0,
1065
+ encryptionOverhead: 0,
1066
+ hotKeys: [],
1067
+ coldKeys: [],
1068
+ tagStats: new Map(),
1069
+ };
1070
+ }
1071
+ /**
1072
+ * Get cache size
1073
+ */
1074
+ get size() {
1075
+ return {
1076
+ entries: this.lru.getSize(),
1077
+ bytes: this.stats.totalSize,
1078
+ };
1079
+ }
1080
+ /**
1081
+ * Graceful shutdown
1082
+ */
1083
+ async shutdown() {
1084
+ // Clear all timers
1085
+ if (this.cleanupTimer)
1086
+ clearInterval(this.cleanupTimer);
1087
+ if (this.keyRotationTimer)
1088
+ clearInterval(this.keyRotationTimer);
1089
+ if (this.securityTimer)
1090
+ clearInterval(this.securityTimer);
1091
+ if (this.performanceTimer)
1092
+ clearInterval(this.performanceTimer);
1093
+ if (this.hotnessDecayTimer)
1094
+ clearInterval(this.hotnessDecayTimer);
1095
+ // Final cleanup
1096
+ this.cleanup();
1097
+ // Export data if needed (for persistence)
1098
+ this.emit("shutdown", {
1099
+ timestamp: Date.now(),
1100
+ finalStats: this.getUltraStats,
1101
+ });
1102
+ // Clear all data
1103
+ this.clear();
1104
+ this.removeAllListeners();
1105
+ }
1106
+ }
1107
+
1108
+ export { UFSIMC as UltraFastSecureInMemoryCache, UFSIMC as default };
1109
+ //# sourceMappingURL=UFSIMC.js.map