@windrun-huaiin/backend-core 12.0.0 → 13.0.0

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 (270) hide show
  1. package/dist/_virtual/_commonjs-dynamic-modules.js +7 -0
  2. package/dist/_virtual/_commonjs-dynamic-modules.mjs +5 -0
  3. package/dist/_virtual/_commonjsHelpers.js +10 -0
  4. package/dist/_virtual/_commonjsHelpers.mjs +7 -0
  5. package/dist/_virtual/aes.js +5 -0
  6. package/dist/_virtual/aes.mjs +3 -0
  7. package/dist/_virtual/blowfish.js +5 -0
  8. package/dist/_virtual/blowfish.mjs +3 -0
  9. package/dist/_virtual/cipher-core.js +5 -0
  10. package/dist/_virtual/cipher-core.mjs +3 -0
  11. package/dist/_virtual/core.js +5 -0
  12. package/dist/_virtual/core.mjs +3 -0
  13. package/dist/_virtual/enc-base64.js +5 -0
  14. package/dist/_virtual/enc-base64.mjs +3 -0
  15. package/dist/_virtual/enc-base64url.js +5 -0
  16. package/dist/_virtual/enc-base64url.mjs +3 -0
  17. package/dist/_virtual/enc-utf16.js +5 -0
  18. package/dist/_virtual/enc-utf16.mjs +3 -0
  19. package/dist/_virtual/evpkdf.js +5 -0
  20. package/dist/_virtual/evpkdf.mjs +3 -0
  21. package/dist/_virtual/format-hex.js +5 -0
  22. package/dist/_virtual/format-hex.mjs +3 -0
  23. package/dist/_virtual/hmac.js +5 -0
  24. package/dist/_virtual/hmac.mjs +3 -0
  25. package/dist/_virtual/index.js +7 -0
  26. package/dist/_virtual/index.mjs +5 -0
  27. package/dist/_virtual/index2.js +9 -0
  28. package/dist/_virtual/index2.mjs +7 -0
  29. package/dist/_virtual/index3.js +5 -0
  30. package/dist/_virtual/index3.mjs +3 -0
  31. package/dist/_virtual/lib-typedarrays.js +5 -0
  32. package/dist/_virtual/lib-typedarrays.mjs +3 -0
  33. package/dist/_virtual/md5.js +5 -0
  34. package/dist/_virtual/md5.mjs +3 -0
  35. package/dist/_virtual/mode-cfb.js +5 -0
  36. package/dist/_virtual/mode-cfb.mjs +3 -0
  37. package/dist/_virtual/mode-ctr-gladman.js +5 -0
  38. package/dist/_virtual/mode-ctr-gladman.mjs +3 -0
  39. package/dist/_virtual/mode-ctr.js +5 -0
  40. package/dist/_virtual/mode-ctr.mjs +3 -0
  41. package/dist/_virtual/mode-ecb.js +5 -0
  42. package/dist/_virtual/mode-ecb.mjs +3 -0
  43. package/dist/_virtual/mode-ofb.js +5 -0
  44. package/dist/_virtual/mode-ofb.mjs +3 -0
  45. package/dist/_virtual/pad-ansix923.js +5 -0
  46. package/dist/_virtual/pad-ansix923.mjs +3 -0
  47. package/dist/_virtual/pad-iso10126.js +5 -0
  48. package/dist/_virtual/pad-iso10126.mjs +3 -0
  49. package/dist/_virtual/pad-iso97971.js +5 -0
  50. package/dist/_virtual/pad-iso97971.mjs +3 -0
  51. package/dist/_virtual/pad-nopadding.js +5 -0
  52. package/dist/_virtual/pad-nopadding.mjs +3 -0
  53. package/dist/_virtual/pad-zeropadding.js +5 -0
  54. package/dist/_virtual/pad-zeropadding.mjs +3 -0
  55. package/dist/_virtual/pbkdf2.js +5 -0
  56. package/dist/_virtual/pbkdf2.mjs +3 -0
  57. package/dist/_virtual/rabbit-legacy.js +5 -0
  58. package/dist/_virtual/rabbit-legacy.mjs +3 -0
  59. package/dist/_virtual/rabbit.js +5 -0
  60. package/dist/_virtual/rabbit.mjs +3 -0
  61. package/dist/_virtual/rc4.js +5 -0
  62. package/dist/_virtual/rc4.mjs +3 -0
  63. package/dist/_virtual/ripemd160.js +5 -0
  64. package/dist/_virtual/ripemd160.mjs +3 -0
  65. package/dist/_virtual/sha1.js +5 -0
  66. package/dist/_virtual/sha1.mjs +3 -0
  67. package/dist/_virtual/sha224.js +5 -0
  68. package/dist/_virtual/sha224.mjs +3 -0
  69. package/dist/_virtual/sha256.js +5 -0
  70. package/dist/_virtual/sha256.mjs +3 -0
  71. package/dist/_virtual/sha3.js +5 -0
  72. package/dist/_virtual/sha3.mjs +3 -0
  73. package/dist/_virtual/sha384.js +5 -0
  74. package/dist/_virtual/sha384.mjs +3 -0
  75. package/dist/_virtual/sha512.js +5 -0
  76. package/dist/_virtual/sha512.mjs +3 -0
  77. package/dist/_virtual/tripledes.js +5 -0
  78. package/dist/_virtual/tripledes.mjs +3 -0
  79. package/dist/_virtual/x64-core.js +5 -0
  80. package/dist/_virtual/x64-core.mjs +3 -0
  81. package/dist/index.js +46 -0
  82. package/dist/index.mjs +7 -0
  83. package/dist/lib/index.d.ts +2 -0
  84. package/dist/lib/index.d.ts.map +1 -1
  85. package/dist/lib/index.js +46 -0
  86. package/dist/lib/index.mjs +7 -0
  87. package/dist/lib/upstash/index.d.ts +7 -0
  88. package/dist/lib/upstash/index.d.ts.map +1 -0
  89. package/dist/lib/upstash/qstash.d.ts +36 -0
  90. package/dist/lib/upstash/qstash.d.ts.map +1 -0
  91. package/dist/lib/upstash/qstash.js +130 -0
  92. package/dist/lib/upstash/qstash.mjs +124 -0
  93. package/dist/lib/upstash/redis-counter.d.ts +17 -0
  94. package/dist/lib/upstash/redis-counter.d.ts.map +1 -0
  95. package/dist/lib/upstash/redis-counter.js +55 -0
  96. package/dist/lib/upstash/redis-counter.mjs +50 -0
  97. package/dist/lib/upstash/redis-favorite.d.ts +21 -0
  98. package/dist/lib/upstash/redis-favorite.d.ts.map +1 -0
  99. package/dist/lib/upstash/redis-favorite.js +74 -0
  100. package/dist/lib/upstash/redis-favorite.mjs +68 -0
  101. package/dist/lib/upstash/redis-like.d.ts +21 -0
  102. package/dist/lib/upstash/redis-like.d.ts.map +1 -0
  103. package/dist/lib/upstash/redis-like.js +74 -0
  104. package/dist/lib/upstash/redis-like.mjs +68 -0
  105. package/dist/lib/upstash/redis-lock.d.ts +13 -0
  106. package/dist/lib/upstash/redis-lock.d.ts.map +1 -0
  107. package/dist/lib/upstash/redis-lock.js +75 -0
  108. package/dist/lib/upstash/redis-lock.mjs +71 -0
  109. package/dist/lib/upstash/redis-structures.d.ts +63 -0
  110. package/dist/lib/upstash/redis-structures.d.ts.map +1 -0
  111. package/dist/lib/upstash/redis-structures.js +211 -0
  112. package/dist/lib/upstash/redis-structures.mjs +195 -0
  113. package/dist/lib/upstash-config.d.ts +11 -0
  114. package/dist/lib/upstash-config.d.ts.map +1 -0
  115. package/dist/lib/upstash-config.js +53 -0
  116. package/dist/lib/upstash-config.mjs +50 -0
  117. package/dist/node_modules/.pnpm/@upstash_lock@0.2.1_typescript@5.9.3/node_modules/@upstash/lock/dist/index.js +191 -0
  118. package/dist/node_modules/.pnpm/@upstash_lock@0.2.1_typescript@5.9.3/node_modules/@upstash/lock/dist/index.mjs +189 -0
  119. package/dist/node_modules/.pnpm/@upstash_qstash@2.8.4/node_modules/@upstash/qstash/chunk-RQPZUJXG.js +1419 -0
  120. package/dist/node_modules/.pnpm/@upstash_qstash@2.8.4/node_modules/@upstash/qstash/chunk-RQPZUJXG.mjs +1403 -0
  121. package/dist/node_modules/.pnpm/@upstash_redis@1.36.1/node_modules/@upstash/redis/chunk-LLI2WIYN.js +4691 -0
  122. package/dist/node_modules/.pnpm/@upstash_redis@1.36.1/node_modules/@upstash/redis/chunk-LLI2WIYN.mjs +4686 -0
  123. package/dist/node_modules/.pnpm/@upstash_redis@1.36.1/node_modules/@upstash/redis/nodejs.js +115 -0
  124. package/dist/node_modules/.pnpm/@upstash_redis@1.36.1/node_modules/@upstash/redis/nodejs.mjs +113 -0
  125. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js +248 -0
  126. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.mjs +246 -0
  127. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/blowfish.js +485 -0
  128. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/blowfish.mjs +483 -0
  129. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/cipher-core.js +906 -0
  130. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/cipher-core.mjs +904 -0
  131. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/core.js +818 -0
  132. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/core.mjs +816 -0
  133. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-base64.js +146 -0
  134. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-base64.mjs +144 -0
  135. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-base64url.js +158 -0
  136. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-base64url.mjs +156 -0
  137. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf16.js +159 -0
  138. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf16.mjs +157 -0
  139. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/evpkdf.js +146 -0
  140. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/evpkdf.mjs +144 -0
  141. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/format-hex.js +77 -0
  142. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/format-hex.mjs +75 -0
  143. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/hmac.js +153 -0
  144. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/hmac.mjs +151 -0
  145. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/index.js +62 -0
  146. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/index.mjs +60 -0
  147. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/lib-typedarrays.js +86 -0
  148. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/lib-typedarrays.mjs +84 -0
  149. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/md5.js +278 -0
  150. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/md5.mjs +276 -0
  151. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-cfb.js +91 -0
  152. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-cfb.mjs +89 -0
  153. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ctr-gladman.js +127 -0
  154. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ctr-gladman.mjs +125 -0
  155. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ctr.js +69 -0
  156. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ctr.mjs +67 -0
  157. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js +51 -0
  158. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.mjs +49 -0
  159. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ofb.js +65 -0
  160. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ofb.mjs +63 -0
  161. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-ansix923.js +60 -0
  162. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-ansix923.mjs +58 -0
  163. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-iso10126.js +55 -0
  164. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-iso10126.mjs +53 -0
  165. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-iso97971.js +51 -0
  166. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-iso97971.mjs +49 -0
  167. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-nopadding.js +41 -0
  168. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-nopadding.mjs +39 -0
  169. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-zeropadding.js +58 -0
  170. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-zeropadding.mjs +56 -0
  171. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pbkdf2.js +157 -0
  172. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pbkdf2.mjs +155 -0
  173. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/rabbit-legacy.js +204 -0
  174. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/rabbit-legacy.mjs +202 -0
  175. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/rabbit.js +206 -0
  176. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/rabbit.mjs +204 -0
  177. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/rc4.js +153 -0
  178. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/rc4.mjs +151 -0
  179. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/ripemd160.js +277 -0
  180. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/ripemd160.mjs +275 -0
  181. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha1.js +160 -0
  182. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha1.mjs +158 -0
  183. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha224.js +91 -0
  184. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha224.mjs +89 -0
  185. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha256.js +209 -0
  186. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha256.mjs +207 -0
  187. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha3.js +337 -0
  188. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha3.mjs +335 -0
  189. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha384.js +95 -0
  190. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha384.mjs +93 -0
  191. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha512.js +337 -0
  192. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha512.mjs +335 -0
  193. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/tripledes.js +793 -0
  194. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/tripledes.mjs +791 -0
  195. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/x64-core.js +314 -0
  196. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/x64-core.mjs +312 -0
  197. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/jws/compact/verify.js +26 -0
  198. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/jws/compact/verify.mjs +24 -0
  199. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/jws/flattened/verify.js +127 -0
  200. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/jws/flattened/verify.mjs +125 -0
  201. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/jwt/verify.js +20 -0
  202. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/jwt/verify.mjs +18 -0
  203. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/key/import.js +31 -0
  204. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/key/import.mjs +29 -0
  205. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/buffer_utils.js +18 -0
  206. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/buffer_utils.mjs +14 -0
  207. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/check_key_type.js +82 -0
  208. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/check_key_type.mjs +80 -0
  209. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/crypto_key.js +103 -0
  210. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/crypto_key.mjs +101 -0
  211. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/epoch.js +5 -0
  212. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/epoch.mjs +3 -0
  213. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/invalid_key_input.js +38 -0
  214. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/invalid_key_input.mjs +33 -0
  215. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/is_disjoint.js +25 -0
  216. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/is_disjoint.mjs +23 -0
  217. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/is_jwk.js +21 -0
  218. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/is_jwk.mjs +16 -0
  219. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/is_object.js +20 -0
  220. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/is_object.mjs +18 -0
  221. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/jwt_claims_set.js +109 -0
  222. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/jwt_claims_set.mjs +107 -0
  223. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/secs.js +59 -0
  224. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/secs.mjs +57 -0
  225. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/validate_algorithms.js +14 -0
  226. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/validate_algorithms.mjs +12 -0
  227. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/validate_crit.js +38 -0
  228. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/validate_crit.mjs +36 -0
  229. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/base64url.js +15 -0
  230. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/base64url.mjs +13 -0
  231. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/check_key_length.js +21 -0
  232. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/check_key_length.mjs +19 -0
  233. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/dsa_digest.js +28 -0
  234. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/dsa_digest.mjs +26 -0
  235. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/get_named_curve.js +58 -0
  236. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/get_named_curve.mjs +56 -0
  237. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/get_sign_verify_key.js +33 -0
  238. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/get_sign_verify_key.mjs +31 -0
  239. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/hmac_digest.js +18 -0
  240. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/hmac_digest.mjs +16 -0
  241. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/is_key_like.js +15 -0
  242. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/is_key_like.mjs +10 -0
  243. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/is_key_object.js +26 -0
  244. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/is_key_object.mjs +5 -0
  245. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/jwk_to_key.js +12 -0
  246. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/jwk_to_key.mjs +10 -0
  247. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/node_key.js +113 -0
  248. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/node_key.mjs +111 -0
  249. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/sign.js +40 -0
  250. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/sign.mjs +19 -0
  251. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/verify.js +52 -0
  252. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/verify.mjs +31 -0
  253. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/webcrypto.js +32 -0
  254. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/webcrypto.mjs +7 -0
  255. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/util/errors.js +69 -0
  256. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/util/errors.mjs +60 -0
  257. package/dist/node_modules/.pnpm/neverthrow@7.2.0/node_modules/neverthrow/dist/index.es.js +422 -0
  258. package/dist/node_modules/.pnpm/neverthrow@7.2.0/node_modules/neverthrow/dist/index.es.mjs +415 -0
  259. package/dist/node_modules/.pnpm/uncrypto@0.1.3/node_modules/uncrypto/dist/crypto.web.js +6 -0
  260. package/dist/node_modules/.pnpm/uncrypto@0.1.3/node_modules/uncrypto/dist/crypto.web.mjs +4 -0
  261. package/package.json +14 -11
  262. package/src/lib/index.ts +2 -0
  263. package/src/lib/upstash/index.ts +6 -0
  264. package/src/lib/upstash/qstash.ts +157 -0
  265. package/src/lib/upstash/redis-counter.ts +51 -0
  266. package/src/lib/upstash/redis-favorite.ts +75 -0
  267. package/src/lib/upstash/redis-like.ts +75 -0
  268. package/src/lib/upstash/redis-lock.ts +85 -0
  269. package/src/lib/upstash/redis-structures.ts +249 -0
  270. package/src/lib/upstash-config.ts +54 -0
@@ -0,0 +1,904 @@
1
+ import { __module as cipherCore$1 } from '../../../../../_virtual/cipher-core.mjs';
2
+ import { __require as requireCore } from './core.mjs';
3
+ import { __require as requireEvpkdf } from './evpkdf.mjs';
4
+
5
+ var cipherCore = cipherCore$1.exports;
6
+
7
+ var hasRequiredCipherCore;
8
+
9
+ function requireCipherCore () {
10
+ if (hasRequiredCipherCore) return cipherCore$1.exports;
11
+ hasRequiredCipherCore = 1;
12
+ (function (module, exports) {
13
+ (function (root, factory, undef) {
14
+ {
15
+ // CommonJS
16
+ module.exports = factory(requireCore(), requireEvpkdf());
17
+ }
18
+ }(cipherCore, function (CryptoJS) {
19
+
20
+ /**
21
+ * Cipher core components.
22
+ */
23
+ CryptoJS.lib.Cipher || (function (undefined$1) {
24
+ // Shortcuts
25
+ var C = CryptoJS;
26
+ var C_lib = C.lib;
27
+ var Base = C_lib.Base;
28
+ var WordArray = C_lib.WordArray;
29
+ var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm;
30
+ var C_enc = C.enc;
31
+ C_enc.Utf8;
32
+ var Base64 = C_enc.Base64;
33
+ var C_algo = C.algo;
34
+ var EvpKDF = C_algo.EvpKDF;
35
+
36
+ /**
37
+ * Abstract base cipher template.
38
+ *
39
+ * @property {number} keySize This cipher's key size. Default: 4 (128 bits)
40
+ * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits)
41
+ * @property {number} _ENC_XFORM_MODE A constant representing encryption mode.
42
+ * @property {number} _DEC_XFORM_MODE A constant representing decryption mode.
43
+ */
44
+ var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({
45
+ /**
46
+ * Configuration options.
47
+ *
48
+ * @property {WordArray} iv The IV to use for this operation.
49
+ */
50
+ cfg: Base.extend(),
51
+
52
+ /**
53
+ * Creates this cipher in encryption mode.
54
+ *
55
+ * @param {WordArray} key The key.
56
+ * @param {Object} cfg (Optional) The configuration options to use for this operation.
57
+ *
58
+ * @return {Cipher} A cipher instance.
59
+ *
60
+ * @static
61
+ *
62
+ * @example
63
+ *
64
+ * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray });
65
+ */
66
+ createEncryptor: function (key, cfg) {
67
+ return this.create(this._ENC_XFORM_MODE, key, cfg);
68
+ },
69
+
70
+ /**
71
+ * Creates this cipher in decryption mode.
72
+ *
73
+ * @param {WordArray} key The key.
74
+ * @param {Object} cfg (Optional) The configuration options to use for this operation.
75
+ *
76
+ * @return {Cipher} A cipher instance.
77
+ *
78
+ * @static
79
+ *
80
+ * @example
81
+ *
82
+ * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray });
83
+ */
84
+ createDecryptor: function (key, cfg) {
85
+ return this.create(this._DEC_XFORM_MODE, key, cfg);
86
+ },
87
+
88
+ /**
89
+ * Initializes a newly created cipher.
90
+ *
91
+ * @param {number} xformMode Either the encryption or decryption transormation mode constant.
92
+ * @param {WordArray} key The key.
93
+ * @param {Object} cfg (Optional) The configuration options to use for this operation.
94
+ *
95
+ * @example
96
+ *
97
+ * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray });
98
+ */
99
+ init: function (xformMode, key, cfg) {
100
+ // Apply config defaults
101
+ this.cfg = this.cfg.extend(cfg);
102
+
103
+ // Store transform mode and key
104
+ this._xformMode = xformMode;
105
+ this._key = key;
106
+
107
+ // Set initial values
108
+ this.reset();
109
+ },
110
+
111
+ /**
112
+ * Resets this cipher to its initial state.
113
+ *
114
+ * @example
115
+ *
116
+ * cipher.reset();
117
+ */
118
+ reset: function () {
119
+ // Reset data buffer
120
+ BufferedBlockAlgorithm.reset.call(this);
121
+
122
+ // Perform concrete-cipher logic
123
+ this._doReset();
124
+ },
125
+
126
+ /**
127
+ * Adds data to be encrypted or decrypted.
128
+ *
129
+ * @param {WordArray|string} dataUpdate The data to encrypt or decrypt.
130
+ *
131
+ * @return {WordArray} The data after processing.
132
+ *
133
+ * @example
134
+ *
135
+ * var encrypted = cipher.process('data');
136
+ * var encrypted = cipher.process(wordArray);
137
+ */
138
+ process: function (dataUpdate) {
139
+ // Append
140
+ this._append(dataUpdate);
141
+
142
+ // Process available blocks
143
+ return this._process();
144
+ },
145
+
146
+ /**
147
+ * Finalizes the encryption or decryption process.
148
+ * Note that the finalize operation is effectively a destructive, read-once operation.
149
+ *
150
+ * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt.
151
+ *
152
+ * @return {WordArray} The data after final processing.
153
+ *
154
+ * @example
155
+ *
156
+ * var encrypted = cipher.finalize();
157
+ * var encrypted = cipher.finalize('data');
158
+ * var encrypted = cipher.finalize(wordArray);
159
+ */
160
+ finalize: function (dataUpdate) {
161
+ // Final data update
162
+ if (dataUpdate) {
163
+ this._append(dataUpdate);
164
+ }
165
+
166
+ // Perform concrete-cipher logic
167
+ var finalProcessedData = this._doFinalize();
168
+
169
+ return finalProcessedData;
170
+ },
171
+
172
+ keySize: 128/32,
173
+
174
+ ivSize: 128/32,
175
+
176
+ _ENC_XFORM_MODE: 1,
177
+
178
+ _DEC_XFORM_MODE: 2,
179
+
180
+ /**
181
+ * Creates shortcut functions to a cipher's object interface.
182
+ *
183
+ * @param {Cipher} cipher The cipher to create a helper for.
184
+ *
185
+ * @return {Object} An object with encrypt and decrypt shortcut functions.
186
+ *
187
+ * @static
188
+ *
189
+ * @example
190
+ *
191
+ * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES);
192
+ */
193
+ _createHelper: (function () {
194
+ function selectCipherStrategy(key) {
195
+ if (typeof key == 'string') {
196
+ return PasswordBasedCipher;
197
+ } else {
198
+ return SerializableCipher;
199
+ }
200
+ }
201
+
202
+ return function (cipher) {
203
+ return {
204
+ encrypt: function (message, key, cfg) {
205
+ return selectCipherStrategy(key).encrypt(cipher, message, key, cfg);
206
+ },
207
+
208
+ decrypt: function (ciphertext, key, cfg) {
209
+ return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg);
210
+ }
211
+ };
212
+ };
213
+ }())
214
+ });
215
+
216
+ /**
217
+ * Abstract base stream cipher template.
218
+ *
219
+ * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits)
220
+ */
221
+ C_lib.StreamCipher = Cipher.extend({
222
+ _doFinalize: function () {
223
+ // Process partial blocks
224
+ var finalProcessedBlocks = this._process(true);
225
+
226
+ return finalProcessedBlocks;
227
+ },
228
+
229
+ blockSize: 1
230
+ });
231
+
232
+ /**
233
+ * Mode namespace.
234
+ */
235
+ var C_mode = C.mode = {};
236
+
237
+ /**
238
+ * Abstract base block cipher mode template.
239
+ */
240
+ var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({
241
+ /**
242
+ * Creates this mode for encryption.
243
+ *
244
+ * @param {Cipher} cipher A block cipher instance.
245
+ * @param {Array} iv The IV words.
246
+ *
247
+ * @static
248
+ *
249
+ * @example
250
+ *
251
+ * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words);
252
+ */
253
+ createEncryptor: function (cipher, iv) {
254
+ return this.Encryptor.create(cipher, iv);
255
+ },
256
+
257
+ /**
258
+ * Creates this mode for decryption.
259
+ *
260
+ * @param {Cipher} cipher A block cipher instance.
261
+ * @param {Array} iv The IV words.
262
+ *
263
+ * @static
264
+ *
265
+ * @example
266
+ *
267
+ * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words);
268
+ */
269
+ createDecryptor: function (cipher, iv) {
270
+ return this.Decryptor.create(cipher, iv);
271
+ },
272
+
273
+ /**
274
+ * Initializes a newly created mode.
275
+ *
276
+ * @param {Cipher} cipher A block cipher instance.
277
+ * @param {Array} iv The IV words.
278
+ *
279
+ * @example
280
+ *
281
+ * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words);
282
+ */
283
+ init: function (cipher, iv) {
284
+ this._cipher = cipher;
285
+ this._iv = iv;
286
+ }
287
+ });
288
+
289
+ /**
290
+ * Cipher Block Chaining mode.
291
+ */
292
+ var CBC = C_mode.CBC = (function () {
293
+ /**
294
+ * Abstract base CBC mode.
295
+ */
296
+ var CBC = BlockCipherMode.extend();
297
+
298
+ /**
299
+ * CBC encryptor.
300
+ */
301
+ CBC.Encryptor = CBC.extend({
302
+ /**
303
+ * Processes the data block at offset.
304
+ *
305
+ * @param {Array} words The data words to operate on.
306
+ * @param {number} offset The offset where the block starts.
307
+ *
308
+ * @example
309
+ *
310
+ * mode.processBlock(data.words, offset);
311
+ */
312
+ processBlock: function (words, offset) {
313
+ // Shortcuts
314
+ var cipher = this._cipher;
315
+ var blockSize = cipher.blockSize;
316
+
317
+ // XOR and encrypt
318
+ xorBlock.call(this, words, offset, blockSize);
319
+ cipher.encryptBlock(words, offset);
320
+
321
+ // Remember this block to use with next block
322
+ this._prevBlock = words.slice(offset, offset + blockSize);
323
+ }
324
+ });
325
+
326
+ /**
327
+ * CBC decryptor.
328
+ */
329
+ CBC.Decryptor = CBC.extend({
330
+ /**
331
+ * Processes the data block at offset.
332
+ *
333
+ * @param {Array} words The data words to operate on.
334
+ * @param {number} offset The offset where the block starts.
335
+ *
336
+ * @example
337
+ *
338
+ * mode.processBlock(data.words, offset);
339
+ */
340
+ processBlock: function (words, offset) {
341
+ // Shortcuts
342
+ var cipher = this._cipher;
343
+ var blockSize = cipher.blockSize;
344
+
345
+ // Remember this block to use with next block
346
+ var thisBlock = words.slice(offset, offset + blockSize);
347
+
348
+ // Decrypt and XOR
349
+ cipher.decryptBlock(words, offset);
350
+ xorBlock.call(this, words, offset, blockSize);
351
+
352
+ // This block becomes the previous block
353
+ this._prevBlock = thisBlock;
354
+ }
355
+ });
356
+
357
+ function xorBlock(words, offset, blockSize) {
358
+ var block;
359
+
360
+ // Shortcut
361
+ var iv = this._iv;
362
+
363
+ // Choose mixing block
364
+ if (iv) {
365
+ block = iv;
366
+
367
+ // Remove IV for subsequent blocks
368
+ this._iv = undefined$1;
369
+ } else {
370
+ block = this._prevBlock;
371
+ }
372
+
373
+ // XOR blocks
374
+ for (var i = 0; i < blockSize; i++) {
375
+ words[offset + i] ^= block[i];
376
+ }
377
+ }
378
+
379
+ return CBC;
380
+ }());
381
+
382
+ /**
383
+ * Padding namespace.
384
+ */
385
+ var C_pad = C.pad = {};
386
+
387
+ /**
388
+ * PKCS #5/7 padding strategy.
389
+ */
390
+ var Pkcs7 = C_pad.Pkcs7 = {
391
+ /**
392
+ * Pads data using the algorithm defined in PKCS #5/7.
393
+ *
394
+ * @param {WordArray} data The data to pad.
395
+ * @param {number} blockSize The multiple that the data should be padded to.
396
+ *
397
+ * @static
398
+ *
399
+ * @example
400
+ *
401
+ * CryptoJS.pad.Pkcs7.pad(wordArray, 4);
402
+ */
403
+ pad: function (data, blockSize) {
404
+ // Shortcut
405
+ var blockSizeBytes = blockSize * 4;
406
+
407
+ // Count padding bytes
408
+ var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
409
+
410
+ // Create padding word
411
+ var paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes;
412
+
413
+ // Create padding
414
+ var paddingWords = [];
415
+ for (var i = 0; i < nPaddingBytes; i += 4) {
416
+ paddingWords.push(paddingWord);
417
+ }
418
+ var padding = WordArray.create(paddingWords, nPaddingBytes);
419
+
420
+ // Add padding
421
+ data.concat(padding);
422
+ },
423
+
424
+ /**
425
+ * Unpads data that had been padded using the algorithm defined in PKCS #5/7.
426
+ *
427
+ * @param {WordArray} data The data to unpad.
428
+ *
429
+ * @static
430
+ *
431
+ * @example
432
+ *
433
+ * CryptoJS.pad.Pkcs7.unpad(wordArray);
434
+ */
435
+ unpad: function (data) {
436
+ // Get number of padding bytes from last byte
437
+ var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
438
+
439
+ // Remove padding
440
+ data.sigBytes -= nPaddingBytes;
441
+ }
442
+ };
443
+
444
+ /**
445
+ * Abstract base block cipher template.
446
+ *
447
+ * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits)
448
+ */
449
+ C_lib.BlockCipher = Cipher.extend({
450
+ /**
451
+ * Configuration options.
452
+ *
453
+ * @property {Mode} mode The block mode to use. Default: CBC
454
+ * @property {Padding} padding The padding strategy to use. Default: Pkcs7
455
+ */
456
+ cfg: Cipher.cfg.extend({
457
+ mode: CBC,
458
+ padding: Pkcs7
459
+ }),
460
+
461
+ reset: function () {
462
+ var modeCreator;
463
+
464
+ // Reset cipher
465
+ Cipher.reset.call(this);
466
+
467
+ // Shortcuts
468
+ var cfg = this.cfg;
469
+ var iv = cfg.iv;
470
+ var mode = cfg.mode;
471
+
472
+ // Reset block mode
473
+ if (this._xformMode == this._ENC_XFORM_MODE) {
474
+ modeCreator = mode.createEncryptor;
475
+ } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {
476
+ modeCreator = mode.createDecryptor;
477
+ // Keep at least one block in the buffer for unpadding
478
+ this._minBufferSize = 1;
479
+ }
480
+
481
+ if (this._mode && this._mode.__creator == modeCreator) {
482
+ this._mode.init(this, iv && iv.words);
483
+ } else {
484
+ this._mode = modeCreator.call(mode, this, iv && iv.words);
485
+ this._mode.__creator = modeCreator;
486
+ }
487
+ },
488
+
489
+ _doProcessBlock: function (words, offset) {
490
+ this._mode.processBlock(words, offset);
491
+ },
492
+
493
+ _doFinalize: function () {
494
+ var finalProcessedBlocks;
495
+
496
+ // Shortcut
497
+ var padding = this.cfg.padding;
498
+
499
+ // Finalize
500
+ if (this._xformMode == this._ENC_XFORM_MODE) {
501
+ // Pad data
502
+ padding.pad(this._data, this.blockSize);
503
+
504
+ // Process final blocks
505
+ finalProcessedBlocks = this._process(true);
506
+ } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {
507
+ // Process final blocks
508
+ finalProcessedBlocks = this._process(true);
509
+
510
+ // Unpad data
511
+ padding.unpad(finalProcessedBlocks);
512
+ }
513
+
514
+ return finalProcessedBlocks;
515
+ },
516
+
517
+ blockSize: 128/32
518
+ });
519
+
520
+ /**
521
+ * A collection of cipher parameters.
522
+ *
523
+ * @property {WordArray} ciphertext The raw ciphertext.
524
+ * @property {WordArray} key The key to this ciphertext.
525
+ * @property {WordArray} iv The IV used in the ciphering operation.
526
+ * @property {WordArray} salt The salt used with a key derivation function.
527
+ * @property {Cipher} algorithm The cipher algorithm.
528
+ * @property {Mode} mode The block mode used in the ciphering operation.
529
+ * @property {Padding} padding The padding scheme used in the ciphering operation.
530
+ * @property {number} blockSize The block size of the cipher.
531
+ * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string.
532
+ */
533
+ var CipherParams = C_lib.CipherParams = Base.extend({
534
+ /**
535
+ * Initializes a newly created cipher params object.
536
+ *
537
+ * @param {Object} cipherParams An object with any of the possible cipher parameters.
538
+ *
539
+ * @example
540
+ *
541
+ * var cipherParams = CryptoJS.lib.CipherParams.create({
542
+ * ciphertext: ciphertextWordArray,
543
+ * key: keyWordArray,
544
+ * iv: ivWordArray,
545
+ * salt: saltWordArray,
546
+ * algorithm: CryptoJS.algo.AES,
547
+ * mode: CryptoJS.mode.CBC,
548
+ * padding: CryptoJS.pad.PKCS7,
549
+ * blockSize: 4,
550
+ * formatter: CryptoJS.format.OpenSSL
551
+ * });
552
+ */
553
+ init: function (cipherParams) {
554
+ this.mixIn(cipherParams);
555
+ },
556
+
557
+ /**
558
+ * Converts this cipher params object to a string.
559
+ *
560
+ * @param {Format} formatter (Optional) The formatting strategy to use.
561
+ *
562
+ * @return {string} The stringified cipher params.
563
+ *
564
+ * @throws Error If neither the formatter nor the default formatter is set.
565
+ *
566
+ * @example
567
+ *
568
+ * var string = cipherParams + '';
569
+ * var string = cipherParams.toString();
570
+ * var string = cipherParams.toString(CryptoJS.format.OpenSSL);
571
+ */
572
+ toString: function (formatter) {
573
+ return (formatter || this.formatter).stringify(this);
574
+ }
575
+ });
576
+
577
+ /**
578
+ * Format namespace.
579
+ */
580
+ var C_format = C.format = {};
581
+
582
+ /**
583
+ * OpenSSL formatting strategy.
584
+ */
585
+ var OpenSSLFormatter = C_format.OpenSSL = {
586
+ /**
587
+ * Converts a cipher params object to an OpenSSL-compatible string.
588
+ *
589
+ * @param {CipherParams} cipherParams The cipher params object.
590
+ *
591
+ * @return {string} The OpenSSL-compatible string.
592
+ *
593
+ * @static
594
+ *
595
+ * @example
596
+ *
597
+ * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams);
598
+ */
599
+ stringify: function (cipherParams) {
600
+ var wordArray;
601
+
602
+ // Shortcuts
603
+ var ciphertext = cipherParams.ciphertext;
604
+ var salt = cipherParams.salt;
605
+
606
+ // Format
607
+ if (salt) {
608
+ wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext);
609
+ } else {
610
+ wordArray = ciphertext;
611
+ }
612
+
613
+ return wordArray.toString(Base64);
614
+ },
615
+
616
+ /**
617
+ * Converts an OpenSSL-compatible string to a cipher params object.
618
+ *
619
+ * @param {string} openSSLStr The OpenSSL-compatible string.
620
+ *
621
+ * @return {CipherParams} The cipher params object.
622
+ *
623
+ * @static
624
+ *
625
+ * @example
626
+ *
627
+ * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString);
628
+ */
629
+ parse: function (openSSLStr) {
630
+ var salt;
631
+
632
+ // Parse base64
633
+ var ciphertext = Base64.parse(openSSLStr);
634
+
635
+ // Shortcut
636
+ var ciphertextWords = ciphertext.words;
637
+
638
+ // Test for salt
639
+ if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) {
640
+ // Extract salt
641
+ salt = WordArray.create(ciphertextWords.slice(2, 4));
642
+
643
+ // Remove salt from ciphertext
644
+ ciphertextWords.splice(0, 4);
645
+ ciphertext.sigBytes -= 16;
646
+ }
647
+
648
+ return CipherParams.create({ ciphertext: ciphertext, salt: salt });
649
+ }
650
+ };
651
+
652
+ /**
653
+ * A cipher wrapper that returns ciphertext as a serializable cipher params object.
654
+ */
655
+ var SerializableCipher = C_lib.SerializableCipher = Base.extend({
656
+ /**
657
+ * Configuration options.
658
+ *
659
+ * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL
660
+ */
661
+ cfg: Base.extend({
662
+ format: OpenSSLFormatter
663
+ }),
664
+
665
+ /**
666
+ * Encrypts a message.
667
+ *
668
+ * @param {Cipher} cipher The cipher algorithm to use.
669
+ * @param {WordArray|string} message The message to encrypt.
670
+ * @param {WordArray} key The key.
671
+ * @param {Object} cfg (Optional) The configuration options to use for this operation.
672
+ *
673
+ * @return {CipherParams} A cipher params object.
674
+ *
675
+ * @static
676
+ *
677
+ * @example
678
+ *
679
+ * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key);
680
+ * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv });
681
+ * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL });
682
+ */
683
+ encrypt: function (cipher, message, key, cfg) {
684
+ // Apply config defaults
685
+ cfg = this.cfg.extend(cfg);
686
+
687
+ // Encrypt
688
+ var encryptor = cipher.createEncryptor(key, cfg);
689
+ var ciphertext = encryptor.finalize(message);
690
+
691
+ // Shortcut
692
+ var cipherCfg = encryptor.cfg;
693
+
694
+ // Create and return serializable cipher params
695
+ return CipherParams.create({
696
+ ciphertext: ciphertext,
697
+ key: key,
698
+ iv: cipherCfg.iv,
699
+ algorithm: cipher,
700
+ mode: cipherCfg.mode,
701
+ padding: cipherCfg.padding,
702
+ blockSize: cipher.blockSize,
703
+ formatter: cfg.format
704
+ });
705
+ },
706
+
707
+ /**
708
+ * Decrypts serialized ciphertext.
709
+ *
710
+ * @param {Cipher} cipher The cipher algorithm to use.
711
+ * @param {CipherParams|string} ciphertext The ciphertext to decrypt.
712
+ * @param {WordArray} key The key.
713
+ * @param {Object} cfg (Optional) The configuration options to use for this operation.
714
+ *
715
+ * @return {WordArray} The plaintext.
716
+ *
717
+ * @static
718
+ *
719
+ * @example
720
+ *
721
+ * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL });
722
+ * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL });
723
+ */
724
+ decrypt: function (cipher, ciphertext, key, cfg) {
725
+ // Apply config defaults
726
+ cfg = this.cfg.extend(cfg);
727
+
728
+ // Convert string to CipherParams
729
+ ciphertext = this._parse(ciphertext, cfg.format);
730
+
731
+ // Decrypt
732
+ var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext);
733
+
734
+ return plaintext;
735
+ },
736
+
737
+ /**
738
+ * Converts serialized ciphertext to CipherParams,
739
+ * else assumed CipherParams already and returns ciphertext unchanged.
740
+ *
741
+ * @param {CipherParams|string} ciphertext The ciphertext.
742
+ * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext.
743
+ *
744
+ * @return {CipherParams} The unserialized ciphertext.
745
+ *
746
+ * @static
747
+ *
748
+ * @example
749
+ *
750
+ * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format);
751
+ */
752
+ _parse: function (ciphertext, format) {
753
+ if (typeof ciphertext == 'string') {
754
+ return format.parse(ciphertext, this);
755
+ } else {
756
+ return ciphertext;
757
+ }
758
+ }
759
+ });
760
+
761
+ /**
762
+ * Key derivation function namespace.
763
+ */
764
+ var C_kdf = C.kdf = {};
765
+
766
+ /**
767
+ * OpenSSL key derivation function.
768
+ */
769
+ var OpenSSLKdf = C_kdf.OpenSSL = {
770
+ /**
771
+ * Derives a key and IV from a password.
772
+ *
773
+ * @param {string} password The password to derive from.
774
+ * @param {number} keySize The size in words of the key to generate.
775
+ * @param {number} ivSize The size in words of the IV to generate.
776
+ * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly.
777
+ *
778
+ * @return {CipherParams} A cipher params object with the key, IV, and salt.
779
+ *
780
+ * @static
781
+ *
782
+ * @example
783
+ *
784
+ * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32);
785
+ * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt');
786
+ */
787
+ execute: function (password, keySize, ivSize, salt, hasher) {
788
+ // Generate random salt
789
+ if (!salt) {
790
+ salt = WordArray.random(64/8);
791
+ }
792
+
793
+ // Derive key and IV
794
+ if (!hasher) {
795
+ var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt);
796
+ } else {
797
+ var key = EvpKDF.create({ keySize: keySize + ivSize, hasher: hasher }).compute(password, salt);
798
+ }
799
+
800
+
801
+ // Separate key and IV
802
+ var iv = WordArray.create(key.words.slice(keySize), ivSize * 4);
803
+ key.sigBytes = keySize * 4;
804
+
805
+ // Return params
806
+ return CipherParams.create({ key: key, iv: iv, salt: salt });
807
+ }
808
+ };
809
+
810
+ /**
811
+ * A serializable cipher wrapper that derives the key from a password,
812
+ * and returns ciphertext as a serializable cipher params object.
813
+ */
814
+ var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({
815
+ /**
816
+ * Configuration options.
817
+ *
818
+ * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL
819
+ */
820
+ cfg: SerializableCipher.cfg.extend({
821
+ kdf: OpenSSLKdf
822
+ }),
823
+
824
+ /**
825
+ * Encrypts a message using a password.
826
+ *
827
+ * @param {Cipher} cipher The cipher algorithm to use.
828
+ * @param {WordArray|string} message The message to encrypt.
829
+ * @param {string} password The password.
830
+ * @param {Object} cfg (Optional) The configuration options to use for this operation.
831
+ *
832
+ * @return {CipherParams} A cipher params object.
833
+ *
834
+ * @static
835
+ *
836
+ * @example
837
+ *
838
+ * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password');
839
+ * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL });
840
+ */
841
+ encrypt: function (cipher, message, password, cfg) {
842
+ // Apply config defaults
843
+ cfg = this.cfg.extend(cfg);
844
+
845
+ // Derive key and other params
846
+ var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, cfg.salt, cfg.hasher);
847
+
848
+ // Add IV to config
849
+ cfg.iv = derivedParams.iv;
850
+
851
+ // Encrypt
852
+ var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg);
853
+
854
+ // Mix in derived params
855
+ ciphertext.mixIn(derivedParams);
856
+
857
+ return ciphertext;
858
+ },
859
+
860
+ /**
861
+ * Decrypts serialized ciphertext using a password.
862
+ *
863
+ * @param {Cipher} cipher The cipher algorithm to use.
864
+ * @param {CipherParams|string} ciphertext The ciphertext to decrypt.
865
+ * @param {string} password The password.
866
+ * @param {Object} cfg (Optional) The configuration options to use for this operation.
867
+ *
868
+ * @return {WordArray} The plaintext.
869
+ *
870
+ * @static
871
+ *
872
+ * @example
873
+ *
874
+ * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL });
875
+ * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL });
876
+ */
877
+ decrypt: function (cipher, ciphertext, password, cfg) {
878
+ // Apply config defaults
879
+ cfg = this.cfg.extend(cfg);
880
+
881
+ // Convert string to CipherParams
882
+ ciphertext = this._parse(ciphertext, cfg.format);
883
+
884
+ // Derive key and other params
885
+ var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt, cfg.hasher);
886
+
887
+ // Add IV to config
888
+ cfg.iv = derivedParams.iv;
889
+
890
+ // Decrypt
891
+ var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg);
892
+
893
+ return plaintext;
894
+ }
895
+ });
896
+ }());
897
+
898
+
899
+ }));
900
+ } (cipherCore$1));
901
+ return cipherCore$1.exports;
902
+ }
903
+
904
+ export { requireCipherCore as __require };