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