@zuplo/cli 7.6.9 → 7.6.10

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 (220) hide show
  1. package/node_modules/@inquirer/checkbox/package.json +3 -3
  2. package/node_modules/@inquirer/confirm/dist/index.js +1 -1
  3. package/node_modules/@inquirer/confirm/package.json +3 -3
  4. package/node_modules/@inquirer/core/dist/lib/create-prompt.js +66 -47
  5. package/node_modules/@inquirer/core/package.json +2 -2
  6. package/node_modules/@inquirer/editor/package.json +3 -3
  7. package/node_modules/@inquirer/expand/package.json +3 -3
  8. package/node_modules/@inquirer/input/package.json +3 -3
  9. package/node_modules/@inquirer/number/package.json +3 -3
  10. package/node_modules/@inquirer/password/package.json +3 -3
  11. package/node_modules/@inquirer/rawlist/package.json +3 -3
  12. package/node_modules/@inquirer/search/package.json +3 -3
  13. package/node_modules/@inquirer/select/package.json +3 -3
  14. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/index.d.ts +1 -2
  15. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +7 -11
  16. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +13 -16
  17. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +7 -11
  18. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +16 -19
  19. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +10 -16
  20. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +18 -21
  21. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwk/embedded.d.ts +3 -1
  22. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwk/thumbprint.d.ts +4 -6
  23. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwks/local.d.ts +5 -4
  24. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwks/remote.d.ts +20 -21
  25. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jws/compact/sign.d.ts +4 -4
  26. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jws/compact/verify.d.ts +8 -11
  27. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jws/flattened/sign.d.ts +5 -5
  28. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jws/flattened/verify.d.ts +8 -11
  29. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jws/general/sign.d.ts +10 -14
  30. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jws/general/verify.d.ts +11 -17
  31. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwt/decrypt.d.ts +14 -11
  32. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwt/encrypt.d.ts +24 -22
  33. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwt/sign.d.ts +3 -7
  34. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwt/unsecured.d.ts +2 -6
  35. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwt/verify.d.ts +13 -6
  36. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/key/export.d.ts +6 -6
  37. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/key/generate_key_pair.d.ts +9 -14
  38. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/key/generate_secret.d.ts +10 -10
  39. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/key/import.d.ts +19 -18
  40. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/types.d.ts +152 -247
  41. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/util/base64url.d.ts +7 -7
  42. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/util/decode_jwt.d.ts +6 -1
  43. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/util/decode_protected_header.d.ts +4 -3
  44. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/util/errors.d.ts +29 -40
  45. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +1 -2
  46. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +9 -26
  47. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +3 -3
  48. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +11 -30
  49. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwe/general/decrypt.js +6 -6
  50. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwe/general/encrypt.js +33 -57
  51. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwk/embedded.js +3 -4
  52. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwk/thumbprint.js +3 -6
  53. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwks/local.js +16 -10
  54. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwks/remote.js +2 -2
  55. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jws/compact/sign.js +2 -4
  56. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jws/compact/verify.js +2 -2
  57. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jws/flattened/sign.js +8 -15
  58. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jws/flattened/verify.js +4 -14
  59. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jws/general/sign.js +4 -11
  60. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jws/general/verify.js +5 -7
  61. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwt/decrypt.js +2 -3
  62. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwt/encrypt.js +11 -25
  63. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwt/sign.js +1 -1
  64. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwt/unsecured.js +1 -2
  65. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwt/verify.js +4 -4
  66. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/key/export.js +12 -16
  67. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/key/generate_key_pair.js +4 -13
  68. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/key/generate_secret.js +1 -1
  69. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/key/import.js +5 -9
  70. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/asn1.js +2 -4
  71. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/buffer_utils.js +35 -0
  72. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/content_encryption.js +21 -29
  73. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/deflate.js +9 -19
  74. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jwe_algorithms.js +0 -4
  75. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +21 -54
  76. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +26 -59
  77. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jws_sign.js +29 -43
  78. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jws_verify.js +37 -45
  79. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +1 -1
  80. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/key.js +119 -59
  81. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/key_management.js +45 -80
  82. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/{options.js → validate.js} +64 -3
  83. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/util/base64url.js +5 -19
  84. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/util/decode_jwt.js +1 -1
  85. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/util/decode_protected_header.js +1 -1
  86. package/node_modules/@modelcontextprotocol/client/node_modules/jose/package.json +1 -1
  87. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/index.d.ts +1 -2
  88. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +7 -11
  89. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +13 -16
  90. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +7 -11
  91. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +16 -19
  92. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +10 -16
  93. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +18 -21
  94. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwk/embedded.d.ts +3 -1
  95. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwk/thumbprint.d.ts +4 -6
  96. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwks/local.d.ts +5 -4
  97. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwks/remote.d.ts +20 -21
  98. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/compact/sign.d.ts +4 -4
  99. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/compact/verify.d.ts +8 -11
  100. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/flattened/sign.d.ts +5 -5
  101. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/flattened/verify.d.ts +8 -11
  102. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/general/sign.d.ts +10 -14
  103. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/general/verify.d.ts +11 -17
  104. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/decrypt.d.ts +14 -11
  105. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/encrypt.d.ts +24 -22
  106. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/sign.d.ts +3 -7
  107. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/unsecured.d.ts +2 -6
  108. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/verify.d.ts +13 -6
  109. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/key/export.d.ts +6 -6
  110. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/key/generate_key_pair.d.ts +9 -14
  111. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/key/generate_secret.d.ts +10 -10
  112. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/key/import.d.ts +19 -18
  113. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/types.d.ts +152 -247
  114. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/util/base64url.d.ts +7 -7
  115. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/util/decode_jwt.d.ts +6 -1
  116. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/util/decode_protected_header.d.ts +4 -3
  117. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/util/errors.d.ts +29 -40
  118. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +1 -2
  119. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +9 -26
  120. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +3 -3
  121. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +11 -30
  122. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/general/decrypt.js +6 -6
  123. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/general/encrypt.js +33 -57
  124. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwk/embedded.js +3 -4
  125. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwk/thumbprint.js +3 -6
  126. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwks/local.js +16 -10
  127. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwks/remote.js +2 -2
  128. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/compact/sign.js +2 -4
  129. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/compact/verify.js +2 -2
  130. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/flattened/sign.js +8 -15
  131. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/flattened/verify.js +4 -14
  132. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/general/sign.js +4 -11
  133. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/general/verify.js +5 -7
  134. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/decrypt.js +2 -3
  135. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/encrypt.js +11 -25
  136. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/sign.js +1 -1
  137. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/unsecured.js +1 -2
  138. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/verify.js +4 -4
  139. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/key/export.js +12 -16
  140. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/key/generate_key_pair.js +4 -13
  141. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/key/generate_secret.js +1 -1
  142. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/key/import.js +5 -9
  143. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/asn1.js +2 -4
  144. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/buffer_utils.js +35 -0
  145. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/content_encryption.js +21 -29
  146. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/deflate.js +9 -19
  147. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwe_algorithms.js +0 -4
  148. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +21 -54
  149. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +26 -59
  150. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jws_sign.js +29 -43
  151. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jws_verify.js +37 -45
  152. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +1 -1
  153. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/key.js +119 -59
  154. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/key_management.js +45 -80
  155. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/{options.js → validate.js} +64 -3
  156. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/util/base64url.js +5 -19
  157. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/util/decode_jwt.js +1 -1
  158. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/util/decode_protected_header.js +1 -1
  159. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/package.json +1 -1
  160. package/node_modules/@posthog/core/dist/posthog-core.d.ts +14 -0
  161. package/node_modules/@posthog/core/dist/posthog-core.d.ts.map +1 -1
  162. package/node_modules/@posthog/core/dist/types.d.ts +1 -0
  163. package/node_modules/@posthog/core/dist/types.d.ts.map +1 -1
  164. package/node_modules/@posthog/core/dist/utils/index.d.ts +1 -0
  165. package/node_modules/@posthog/core/dist/utils/index.d.ts.map +1 -1
  166. package/node_modules/@posthog/core/dist/utils/index.js +26 -0
  167. package/node_modules/@posthog/core/dist/utils/index.mjs +1 -0
  168. package/node_modules/@posthog/core/dist/utils/webview-app-utils.d.ts +12 -0
  169. package/node_modules/@posthog/core/dist/utils/webview-app-utils.d.ts.map +1 -0
  170. package/node_modules/@posthog/core/dist/utils/webview-app-utils.js +132 -0
  171. package/node_modules/@posthog/core/dist/utils/webview-app-utils.mjs +94 -0
  172. package/node_modules/@posthog/core/package.json +2 -2
  173. package/node_modules/@posthog/core/src/featureFlagLocalEvaluation.ts +1 -1
  174. package/node_modules/@posthog/core/src/posthog-core.ts +14 -0
  175. package/node_modules/@posthog/core/src/types.ts +1 -0
  176. package/node_modules/@posthog/core/src/utils/index.ts +1 -0
  177. package/node_modules/@posthog/core/src/utils/otlp-any-value.spec.ts +1 -1
  178. package/node_modules/@posthog/core/src/utils/type-utils.ts +4 -4
  179. package/node_modules/@posthog/core/src/utils/webview-app-utils.spec.ts +118 -0
  180. package/node_modules/@posthog/core/src/utils/webview-app-utils.ts +49 -0
  181. package/node_modules/@posthog/types/dist/feature-flags.d.ts +1 -1
  182. package/node_modules/@posthog/types/dist/feature-flags.d.ts.map +1 -1
  183. package/node_modules/@posthog/types/dist/posthog-config.d.ts +7 -1
  184. package/node_modules/@posthog/types/dist/posthog-config.d.ts.map +1 -1
  185. package/node_modules/@posthog/types/package.json +1 -1
  186. package/node_modules/@posthog/types/src/feature-flags.ts +1 -1
  187. package/node_modules/@posthog/types/src/posthog-config.ts +7 -1
  188. package/node_modules/@posthog/types/src/tree-shakeable.ts +1 -1
  189. package/node_modules/@zuplo/core/package.json +1 -1
  190. package/node_modules/@zuplo/graphql/package.json +1 -1
  191. package/node_modules/@zuplo/openapi-tools/package.json +1 -1
  192. package/node_modules/@zuplo/otel/package.json +1 -1
  193. package/node_modules/@zuplo/runtime/out/esm/{chunk-Z3IKCP3N.js → chunk-R4PTES5B.js} +93 -93
  194. package/node_modules/@zuplo/runtime/out/esm/chunk-R4PTES5B.js.map +1 -0
  195. package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
  196. package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +1 -1
  197. package/node_modules/@zuplo/runtime/package.json +1 -1
  198. package/package.json +11 -11
  199. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/base64.js +0 -20
  200. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/crypto_key.js +0 -27
  201. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/helpers.js +0 -45
  202. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/invalid_key_input.js +0 -12
  203. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/is_key_like.js +0 -19
  204. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jwk_metadata.js +0 -19
  205. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jwk_to_key.js +0 -10
  206. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/key_options.js +0 -8
  207. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/signing.js +0 -22
  208. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/type_checks.js +0 -30
  209. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/base64.js +0 -20
  210. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/crypto_key.js +0 -27
  211. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/helpers.js +0 -45
  212. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/invalid_key_input.js +0 -12
  213. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/is_key_like.js +0 -19
  214. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwk_metadata.js +0 -19
  215. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwk_to_key.js +0 -10
  216. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/key_options.js +0 -8
  217. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/signing.js +0 -22
  218. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/type_checks.js +0 -30
  219. package/node_modules/@zuplo/runtime/out/esm/chunk-Z3IKCP3N.js.map +0 -1
  220. /package/node_modules/@zuplo/runtime/out/esm/{chunk-Z3IKCP3N.js.LEGAL.txt → chunk-R4PTES5B.js.LEGAL.txt} +0 -0
@@ -1,9 +1,6 @@
1
- import { withAlg as invalidKeyInput } from "./invalid_key_input.js";
2
- import { isKeyLike, isCryptoKey } from "./is_key_like.js";
3
- import { isObject } from "./type_checks.js";
1
+ import { isObject } from "./validate.js";
4
2
  import { decode } from "../util/base64url.js";
5
- import { jwkToKey } from "./jwk_to_key.js";
6
- import { normalizeJwk } from "./jwk_metadata.js";
3
+ import { JOSENotSupported } from "../util/errors.js";
7
4
  const tag = (key) => key[Symbol.toStringTag], jwkMatchesOp = (entry, key, usage) => {
8
5
  const { alg } = entry;
9
6
  if (key.use !== void 0) {
@@ -19,35 +16,44 @@ const tag = (key) => key[Symbol.toStringTag], jwkMatchesOp = (entry, key, usage)
19
16
  throw new TypeError(`Invalid key for this operation, its "key_ops" must include "${expectedKeyOp}" when present`);
20
17
  }
21
18
  };
22
- function checkKeyType(entry, key, usage) {
19
+ async function prepareKey(entry, key, usage) {
23
20
  const { alg, secret } = entry, privateKey = usage === "decrypt" || usage === "sign";
24
21
  if (secret && key instanceof Uint8Array)
25
- return [BYTES, key];
22
+ return key;
23
+ let normalized, keyObject;
26
24
  if (isObject(key)) {
27
- const normalized = normalizeJwk(key);
28
- if (typeof normalized.kty != "string")
29
- throw new TypeError(secret ? invalidKeyInput(alg, key, "CryptoKey", "KeyObject", "JSON Web Key", "Uint8Array") : invalidKeyInput(alg, key, "CryptoKey", "KeyObject", "JSON Web Key"));
25
+ if (normalized = normalizeJwk(key), typeof normalized.kty != "string")
26
+ throw invalidKeyType(alg, key, secret);
30
27
  if (!(secret ? normalized.kty === "oct" && typeof normalized.k == "string" : normalized.kty !== "oct" && (privateKey ? normalized.kty === "AKP" && typeof normalized.priv == "string" || typeof normalized.d == "string" : normalized.d === void 0 && normalized.priv === void 0)))
31
28
  throw new TypeError(secret ? 'JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present' : `JSON Web Key for this operation must be a ${privateKey ? "private" : "public"} JWK`);
32
- return jwkMatchesOp(entry, normalized, usage), [JWK, key, normalized];
33
- }
34
- if (!isKeyLike(key))
35
- throw new TypeError(secret ? invalidKeyInput(alg, key, "CryptoKey", "KeyObject", "JSON Web Key", "Uint8Array") : invalidKeyInput(alg, key, "CryptoKey", "KeyObject", "JSON Web Key"));
36
- if (secret) {
37
- if (key.type !== "secret")
38
- throw new TypeError(`${tag(key)} instances for symmetric algorithms must be of type "secret"`);
39
- } else {
40
- if (key.type === "secret")
41
- throw new TypeError(`${tag(key)} instances for asymmetric algorithms must not be of type "secret"`);
42
- const expectedType = privateKey ? "private" : "public";
43
- if ((key.type === "public" || key.type === "private") && key.type !== expectedType) {
44
- const operation = usage === "sign" ? "signing" : usage === "verify" ? "verifying" : `${usage.slice(0, -1)}tion`;
45
- throw new TypeError(`${tag(key)} instances for asymmetric algorithm ${operation} must be of type "${expectedType}"`);
29
+ if (jwkMatchesOp(entry, normalized, usage), normalized.kty === "oct")
30
+ return decode(normalized.k);
31
+ if (!Object.isFrozen(key)) {
32
+ const { key_ops } = key;
33
+ Array.isArray(key_ops) && Object.freeze(key_ops), Object.freeze(key);
46
34
  }
35
+ } else {
36
+ if (!isKeyLike(key))
37
+ throw invalidKeyType(alg, key, secret);
38
+ const expectedType = secret ? "secret" : privateKey ? "private" : "public";
39
+ if (key.type !== expectedType && (secret || ["secret", "public", "private"].includes(key.type)))
40
+ throw new TypeError(`${tag(key)} instances must be of type "${expectedType}" for the ${alg} algorithm`);
41
+ if (isCryptoKey(key))
42
+ return key;
43
+ if (keyObject = key, keyObject.type === "secret")
44
+ return keyObject.export();
45
+ }
46
+ cache ||= /* @__PURE__ */ new WeakMap();
47
+ const cacheKey = key;
48
+ let cached = cache.get(cacheKey);
49
+ if (cached?.[alg])
50
+ return cached[alg];
51
+ if (cached || cache.set(cacheKey, cached = {}), keyObject && typeof keyObject.toCryptoKey == "function") {
52
+ const isPublic = keyObject.type === "public", crv = nist[keyObject.asymmetricKeyDetails?.namedCurve], params = entry.resolve?.({ crv, asymmetricKeyType: keyObject.asymmetricKeyType }) ?? entry.subtle;
53
+ return cached[alg] = keyObject.toCryptoKey(params, isPublic, entry.usages[isPublic ? 0 : 1]);
47
54
  }
48
- return isCryptoKey(key) ? [CRYPTO, key] : [KEYOBJECT, key];
55
+ return normalized ??= keyObject.export({ format: "jwk" }), normalized.alg = alg, cached[alg] = await jwkToKey(entry, normalized);
49
56
  }
50
- const BYTES = 0, CRYPTO = 1, KEYOBJECT = 2, JWK = 3;
51
57
  let cache;
52
58
  const nist = {
53
59
  __proto__: null,
@@ -55,41 +61,95 @@ const nist = {
55
61
  secp384r1: "P-384",
56
62
  secp521r1: "P-521"
57
63
  };
58
- function cached(key, alg, value) {
59
- cache ||= /* @__PURE__ */ new WeakMap();
60
- const entry = cache.get(key);
61
- return value && (entry ? entry[alg] = value : cache.set(key, { [alg]: value })), value ?? entry?.[alg];
64
+ function assertCryptoKey(key) {
65
+ if (!isCryptoKey(key))
66
+ throw new Error("CryptoKey instance expected");
62
67
  }
63
- const handleJWK = async (key, jwk, entry) => cached(key, entry.alg) ?? cached(key, entry.alg, await jwkToKey(entry, { ...jwk, alg: entry.alg })), handleKeyObject = (keyObject, entry) => {
64
- const hit = cached(keyObject, entry.alg);
65
- if (hit)
66
- return hit;
67
- const isPublic = keyObject.type === "public", usages = entry.usages[isPublic ? 0 : 1], { asymmetricKeyType } = keyObject, crv = nist[keyObject.asymmetricKeyDetails?.namedCurve], params = entry.resolve?.({ crv, asymmetricKeyType }) ?? entry.subtle;
68
- return cached(keyObject, entry.alg, keyObject.toCryptoKey(params, isPublic, usages));
69
- };
70
- async function prepareKey(entry, key, usage) {
71
- const tagged = checkKeyType(entry, key, usage);
72
- switch (tagged[0]) {
73
- case BYTES:
74
- case CRYPTO:
75
- return tagged[1];
76
- case JWK: {
77
- const key2 = tagged[1], normalized = tagged[2];
78
- if (normalized.kty === "oct")
79
- return decode(normalized.k);
80
- if (!Object.isFrozen(key2)) {
81
- const { key_ops } = key2;
82
- Array.isArray(key_ops) && Object.freeze(key_ops), Object.freeze(key2);
83
- }
84
- return handleJWK(key2, normalized, entry);
85
- }
86
- case KEYOBJECT: {
87
- const keyObject = tagged[1];
88
- return keyObject.type === "secret" ? keyObject.export() : "toCryptoKey" in keyObject && typeof keyObject.toCryptoKey == "function" ? handleKeyObject(keyObject, entry) : handleJWK(keyObject, keyObject.export({ format: "jwk" }), entry);
89
- }
68
+ const isCryptoKey = (key) => {
69
+ if (key?.[Symbol.toStringTag] === "CryptoKey")
70
+ return !0;
71
+ try {
72
+ return key instanceof CryptoKey;
73
+ } catch {
74
+ return !1;
90
75
  }
76
+ }, isKeyObject = (key) => key?.[Symbol.toStringTag] === "KeyObject", isKeyLike = (key) => isCryptoKey(key) || isKeyObject(key);
77
+ function message(msg, actual, ...types) {
78
+ if (types.length > 2) {
79
+ const last = types.pop();
80
+ msg += `one of type ${types.join(", ")}, or ${last}.`;
81
+ } else types.length === 2 ? msg += `one of type ${types[0]} or ${types[1]}.` : msg += `of type ${types[0]}.`;
82
+ return actual == null ? msg += ` Received ${actual}` : typeof actual == "function" && actual.name ? msg += ` Received function ${actual.name}` : typeof actual == "object" && actual != null && actual.constructor?.name && (msg += ` Received an instance of ${actual.constructor.name}`), msg;
83
+ }
84
+ const invalidKeyInput = (actual, ...types) => message("Key must be ", actual, ...types);
85
+ function invalidKeyType(alg, actual, secret) {
86
+ const types = ["CryptoKey", "KeyObject", "JSON Web Key"];
87
+ return secret && types.push("Uint8Array"), new TypeError(message(`Key for the ${alg} algorithm must be `, actual, ...types));
88
+ }
89
+ const unusable = (name, prop = "algorithm.name") => new TypeError(`CryptoKey does not support this operation, its ${prop} must be ${name}`);
90
+ function checkUsage(key, usage) {
91
+ if (usage && !key.usages.includes(usage))
92
+ throw new TypeError(`CryptoKey does not support this operation, its usages must include ${usage}.`);
93
+ }
94
+ function checkModulusLength(alg, key) {
95
+ const { modulusLength } = key.algorithm;
96
+ if (typeof modulusLength != "number" || modulusLength < 2048)
97
+ throw new TypeError(`${alg} requires key modulusLength to be 2048 bits or larger`);
98
+ }
99
+ function checkCryptoKey(key, expected, usage) {
100
+ const algorithm = key.algorithm;
101
+ if (algorithm.name !== expected.name)
102
+ throw unusable(expected.name);
103
+ if (expected.hash && algorithm.hash?.name !== expected.hash)
104
+ throw unusable(expected.hash, "algorithm.hash");
105
+ if (expected.namedCurve && algorithm.namedCurve !== expected.namedCurve)
106
+ throw unusable(expected.namedCurve, "algorithm.namedCurve");
107
+ if (expected.length !== void 0 && algorithm.length !== expected.length)
108
+ throw unusable(expected.length, "algorithm.length");
109
+ checkUsage(key, usage);
110
+ }
111
+ function snapshotJwk(jwk) {
112
+ return { __proto__: null, ...jwk };
113
+ }
114
+ function normalizeJwk(jwk) {
115
+ const normalized = snapshotJwk(jwk);
116
+ if (normalized.ext !== void 0 && typeof normalized.ext != "boolean")
117
+ throw new TypeError('"ext" (Extractable) Parameter must be a boolean');
118
+ if (normalized.key_ops !== void 0) {
119
+ const value = normalized.key_ops, keyOps = Array.isArray(value) ? [...value] : void 0;
120
+ if (!keyOps || keyOps.some((operation) => typeof operation != "string") || new Set(keyOps).size !== keyOps.length)
121
+ throw new TypeError('"key_ops" (Key Operations) Parameter must be an array of unique strings');
122
+ normalized.key_ops = keyOps;
123
+ }
124
+ return normalized;
125
+ }
126
+ function validateExtractableOption(extractable) {
127
+ if (extractable !== void 0 && typeof extractable != "boolean")
128
+ throw new TypeError('"extractable" option must be a boolean');
129
+ return extractable;
130
+ }
131
+ async function jwkToKey(entry, jwk, extractable) {
132
+ if (!entry.kty.includes(jwk.kty))
133
+ throw new JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
134
+ const algorithm = entry.resolve?.({ kty: jwk.kty, crv: jwk.crv }) ?? entry.subtle, isPrivate = !!(jwk.d || jwk.priv), keyData = { ...jwk, ext: extractable ?? jwk.ext };
135
+ return keyData.kty !== "AKP" && delete keyData.alg, delete keyData.use, crypto.subtle.importKey("jwk", keyData, algorithm, keyData.ext ?? !isPrivate, jwk.key_ops ?? entry.usages[isPrivate ? 1 : 0]);
136
+ }
137
+ async function rawKey(key, expected, usage, extractable = !1) {
138
+ return key instanceof Uint8Array && (key = await crypto.subtle.importKey("raw", key, expected, extractable, [usage])), checkCryptoKey(key, expected, usage), key;
91
139
  }
92
140
  export {
93
- checkKeyType,
94
- prepareKey
141
+ assertCryptoKey,
142
+ checkCryptoKey,
143
+ checkModulusLength,
144
+ checkUsage,
145
+ invalidKeyInput,
146
+ isCryptoKey,
147
+ isKeyLike,
148
+ isKeyObject,
149
+ jwkToKey,
150
+ normalizeJwk,
151
+ prepareKey,
152
+ rawKey,
153
+ snapshotJwk,
154
+ validateExtractableOption
95
155
  };
@@ -1,41 +1,26 @@
1
1
  import { encode as b64u } from "../util/base64url.js";
2
- import { prepareKey } from "./key.js";
3
- import { jwkToKey } from "./jwk_to_key.js";
4
- import { jweAlgorithm, jweEncryption } from "./jwe_algorithms.js";
2
+ import { prepareKey, rawKey, jwkToKey, checkCryptoKey, checkModulusLength, checkUsage, assertCryptoKey } from "./key.js";
3
+ import { jweAlgorithm, jweEncryption, isJWECEKTransport } from "./jwe_algorithms.js";
5
4
  import { JOSENotSupported, JWEInvalid } from "../util/errors.js";
6
- import { decodeBase64url, digest } from "./helpers.js";
7
- import { generateCek, encrypt, decrypt } from "./content_encryption.js";
8
- import { assertUint8Array, isObject } from "./type_checks.js";
9
- import { checkCryptoKey, checkModulusLength, checkUsage } from "./crypto_key.js";
10
- import { concat, encode, uint32be } from "./buffer_utils.js";
11
- import { assertCryptoKey } from "./is_key_like.js";
5
+ import { decodeBase64url, assertUint8Array, isObject } from "./validate.js";
6
+ import { digest, concat, encode, uint32be } from "./buffer_utils.js";
7
+ import { checkCekLength, generateCek, encrypt, decrypt } from "./content_encryption.js";
12
8
  function checkEcdhCryptoKey(key, usage) {
13
9
  if (key.algorithm.name !== "ECDH" && key.algorithm.name !== "X25519")
14
10
  throw new TypeError("CryptoKey does not support this operation, its algorithm.name must be ECDH or X25519");
15
11
  checkUsage(key, usage);
16
12
  }
17
- async function aeskwCryptoKey(key, alg, usage) {
18
- const expected = jweAlgorithm(alg).subtle, cryptoKey = key instanceof Uint8Array ? await crypto.subtle.importKey("raw", key, "AES-KW", !0, [
19
- usage
20
- ]) : key;
21
- return checkCryptoKey(cryptoKey, expected, usage), cryptoKey;
22
- }
23
13
  async function aeskwWrap(alg, key, cek) {
24
- const cryptoKey = await aeskwCryptoKey(key, alg, "wrapKey"), cryptoKeyCek = await crypto.subtle.importKey("raw", cek, { hash: "SHA-256", name: "HMAC" }, !0, ["sign"]);
14
+ const cryptoKey = await rawKey(key, jweAlgorithm(alg).subtle, "wrapKey", !0), cryptoKeyCek = await crypto.subtle.importKey("raw", cek, { hash: "SHA-256", name: "HMAC" }, !0, ["sign"]);
25
15
  return new Uint8Array(await crypto.subtle.wrapKey("raw", cryptoKeyCek, cryptoKey, "AES-KW"));
26
16
  }
27
17
  async function aeskwUnwrap(alg, key, encryptedKey) {
28
- const cryptoKey = await aeskwCryptoKey(key, alg, "unwrapKey"), cryptoKeyCek = await crypto.subtle.unwrapKey("raw", encryptedKey, cryptoKey, "AES-KW", { hash: "SHA-256", name: "HMAC" }, !0, ["sign"]);
18
+ const cryptoKey = await rawKey(key, jweAlgorithm(alg).subtle, "unwrapKey", !0), cryptoKeyCek = await crypto.subtle.unwrapKey("raw", encryptedKey, cryptoKey, "AES-KW", { hash: "SHA-256", name: "HMAC" }, !0, ["sign"]);
29
19
  return new Uint8Array(await crypto.subtle.exportKey("raw", cryptoKeyCek));
30
20
  }
31
21
  function checkRsaKey(alg, key, usage) {
32
22
  checkCryptoKey(key, jweAlgorithm(alg).subtle, usage), checkModulusLength(alg, key);
33
23
  }
34
- function pbes2CryptoKey(key, alg) {
35
- return key instanceof Uint8Array ? crypto.subtle.importKey("raw", key, "PBKDF2", !1, [
36
- "deriveBits"
37
- ]) : (checkCryptoKey(key, jweAlgorithm(alg).subtle, "deriveBits"), key);
38
- }
39
24
  async function deriveKey(p2s, alg, p2c, key) {
40
25
  if (!(p2s instanceof Uint8Array) || p2s.length < 8)
41
26
  throw new JWEInvalid("PBES2 Salt Input must be 8 or more octets");
@@ -46,7 +31,7 @@ async function deriveKey(p2s, alg, p2c, key) {
46
31
  iterations: p2c,
47
32
  name: "PBKDF2",
48
33
  salt
49
- }, cryptoKey = await pbes2CryptoKey(key, alg);
34
+ }, cryptoKey = await rawKey(key, jweAlgorithm(alg).subtle, "deriveBits");
50
35
  return new Uint8Array(await crypto.subtle.deriveBits(subtleAlg, cryptoKey, keylen));
51
36
  }
52
37
  function lengthAndInput(input) {
@@ -104,19 +89,11 @@ function validateMaxPBES2Count(value) {
104
89
  }
105
90
  async function decryptKeyManagement(entry, enc, key, encryptedKey, joseHeader, maxPBES2Count) {
106
91
  const { alg } = entry, mode = entry.mode;
107
- switch (mode) {
108
- case "direct-encryption":
109
- return assertNoEncryptedKey(encryptedKey), key;
110
- case "direct-key-agreement":
111
- case "key-wrapping":
112
- case "key-encryption":
113
- case "key-agreement-with-key-wrapping":
114
- break;
115
- }
116
- switch (entry.subtle.name) {
92
+ if (mode === "direct-encryption")
93
+ return assertNoEncryptedKey(encryptedKey), key;
94
+ const direct = mode === "direct-key-agreement";
95
+ switch (direct ? assertNoEncryptedKey(encryptedKey) : assertEncryptedKey(encryptedKey), entry.subtle.name) {
117
96
  case "ECDH": {
118
- const direct = mode === "direct-key-agreement";
119
- direct && assertNoEncryptedKey(encryptedKey);
120
97
  const { epk } = joseHeader;
121
98
  if (!isObject(epk) || ["d", "k", "p", "q", "dp", "dq", "qi", "oth", "priv"].some((parameter) => Object.hasOwn(epk, parameter)))
122
99
  throw new JWEInvalid('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');
@@ -124,12 +101,15 @@ async function decryptKeyManagement(entry, enc, key, encryptedKey, joseHeader, m
124
101
  const ephemeralPublicKey = await jwkToKey(entry, epk), partyUInfo = partyInfo(joseHeader, "apu"), partyVInfo = partyInfo(joseHeader, "apv");
125
102
  checkPartyInfo(partyUInfo, partyVInfo);
126
103
  const sharedSecret = await ecdhesDeriveKey(ephemeralPublicKey, key, direct ? enc.alg : alg, direct ? enc.cekBits : parseInt(alg.slice(-5, -2), 10), partyUInfo, partyVInfo);
127
- return direct ? sharedSecret : (assertEncryptedKey(encryptedKey), aeskwUnwrap(alg.slice(-6), sharedSecret, encryptedKey));
104
+ if (direct)
105
+ return sharedSecret;
106
+ key = sharedSecret;
107
+ break;
128
108
  }
129
109
  case "RSA-OAEP":
130
- return assertEncryptedKey(encryptedKey), assertCryptoKey(key), checkRsaKey(alg, key, "decrypt"), new Uint8Array(await crypto.subtle.decrypt("RSA-OAEP", key, encryptedKey));
110
+ return assertCryptoKey(key), checkRsaKey(alg, key, "decrypt"), new Uint8Array(await crypto.subtle.decrypt("RSA-OAEP", key, encryptedKey));
131
111
  case "PBKDF2": {
132
- if (assertEncryptedKey(encryptedKey), typeof joseHeader.p2c != "number")
112
+ if (typeof joseHeader.p2c != "number")
133
113
  throw new JWEInvalid('JOSE Header "p2c" (PBES2 Count) missing or invalid');
134
114
  validateMaxPBES2Count(maxPBES2Count);
135
115
  const p2cLimit = maxPBES2Count ?? 1e4;
@@ -137,39 +117,35 @@ async function decryptKeyManagement(entry, enc, key, encryptedKey, joseHeader, m
137
117
  throw new JWEInvalid('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');
138
118
  if (typeof joseHeader.p2s != "string")
139
119
  throw new JWEInvalid('JOSE Header "p2s" (PBES2 Salt) missing or invalid');
140
- const p2s = decodeBase64url(joseHeader.p2s, "p2s", JWEInvalid), derived = await deriveKey(p2s, alg, joseHeader.p2c, key);
141
- return aeskwUnwrap(alg.slice(-6), derived, encryptedKey);
120
+ const p2s = decodeBase64url(joseHeader.p2s, "p2s", JWEInvalid);
121
+ key = await deriveKey(p2s, alg, joseHeader.p2c, key);
122
+ break;
142
123
  }
143
- case "AES-KW":
144
- return assertEncryptedKey(encryptedKey), aeskwUnwrap(alg, key, encryptedKey);
145
124
  case "AES-GCM": {
146
- if (assertEncryptedKey(encryptedKey), typeof joseHeader.iv != "string")
125
+ if (typeof joseHeader.iv != "string")
147
126
  throw new JWEInvalid('JOSE Header "iv" (Initialization Vector) missing or invalid');
148
127
  if (typeof joseHeader.tag != "string")
149
128
  throw new JWEInvalid('JOSE Header "tag" (Authentication Tag) missing or invalid');
150
- let iv;
151
- iv = decodeBase64url(joseHeader.iv, "iv", JWEInvalid);
152
- let tag;
153
- if (tag = decodeBase64url(joseHeader.tag, "tag", JWEInvalid), iv.byteLength !== 12)
129
+ const iv = decodeBase64url(joseHeader.iv, "iv", JWEInvalid), tag = decodeBase64url(joseHeader.tag, "tag", JWEInvalid);
130
+ if (iv.byteLength !== 12)
154
131
  throw new JWEInvalid("Invalid Initialization Vector length");
155
132
  if (tag.byteLength !== 16)
156
133
  throw new JWEInvalid("Invalid Authentication Tag length");
157
134
  return decrypt(jweEncryption(alg.slice(0, -2)), key, encryptedKey, iv, tag, new Uint8Array());
158
135
  }
159
136
  }
160
- }
161
- async function encryptKeyManagement(entry, enc, key, joseHeader, providedCek, providedParameters = {}) {
162
- let encryptedKey, parameters, cek;
163
- const { alg } = entry, mode = entry.mode;
164
- switch (mode) {
165
- case "direct-encryption":
166
- return [key, void 0, void 0];
167
- case "direct-key-agreement":
168
- case "key-wrapping":
169
- case "key-encryption":
170
- case "key-agreement-with-key-wrapping":
171
- break;
172
- }
137
+ return aeskwUnwrap(alg.slice(-6), key, encryptedKey);
138
+ }
139
+ async function encryptKeyManagement(entry, enc, inputKey, joseHeader, providedCek, providedParameters = {}) {
140
+ const { alg, mode } = entry, transport = isJWECEKTransport(entry);
141
+ if (providedCek !== void 0 && !transport)
142
+ throw new TypeError(`setContentEncryptionKey cannot be called with JWE "alg" (Algorithm) Header ${alg}`);
143
+ let key = await prepareKey(mode === "direct-encryption" ? enc : entry, inputKey, "encrypt");
144
+ if (mode === "direct-encryption")
145
+ return [key, void 0, void 0];
146
+ const cek = transport ? providedCek ?? generateCek(enc) : void 0;
147
+ cek && checkCekLength(cek, enc.cekBits);
148
+ let encryptedKey, parameters;
173
149
  switch (entry.subtle.name) {
174
150
  case "ECDH": {
175
151
  assertEcdhKey(key);
@@ -186,42 +162,31 @@ async function encryptKeyManagement(entry, enc, key, joseHeader, providedCek, pr
186
162
  throw new TypeError('CryptoKey for "epk" must be extractable');
187
163
  exportableEpk = await subtle.getPublicKey(ephemeralKey, []);
188
164
  }
189
- const { x, y, crv, kty } = await subtle.exportKey("jwk", exportableEpk), direct = mode === "direct-key-agreement", sharedSecret = await ecdhesDeriveKey(key, ephemeralKey, direct ? enc.alg : alg, direct ? enc.cekBits : parseInt(alg.slice(-5, -2), 10), apu, apv);
190
- if (parameters = { epk: { x, crv, kty } }, kty === "EC" && (parameters.epk.y = y), providedApu !== void 0 && (parameters.apu = b64u(providedApu)), providedApv !== void 0 && (parameters.apv = b64u(providedApv)), direct) {
191
- cek = sharedSecret;
192
- break;
193
- }
194
- cek = providedCek ?? generateCek(enc);
195
- const kwAlg = alg.slice(-6);
196
- encryptedKey = await aeskwWrap(kwAlg, sharedSecret, cek);
165
+ const { x, y, crv, kty } = await subtle.exportKey("jwk", exportableEpk), direct = mode === "direct-key-agreement", sharedSecret = await ecdhesDeriveKey(key, ephemeralKey, direct ? enc.alg : alg, direct ? enc.cekBits : parseInt(alg.slice(-5, -2), 10), apu, apv), epk = { x, crv, kty };
166
+ if (kty === "EC" && (epk.y = y), parameters = { epk }, providedApu !== void 0 && (parameters.apu = b64u(providedApu)), providedApv !== void 0 && (parameters.apv = b64u(providedApv)), direct)
167
+ return [sharedSecret, void 0, parameters];
168
+ key = sharedSecret;
197
169
  break;
198
170
  }
199
171
  case "RSA-OAEP": {
200
- cek = providedCek ?? generateCek(enc), assertCryptoKey(key), checkRsaKey(alg, key, "encrypt"), encryptedKey = new Uint8Array(await crypto.subtle.encrypt("RSA-OAEP", key, cek));
172
+ assertCryptoKey(key), checkRsaKey(alg, key, "encrypt"), encryptedKey = new Uint8Array(await crypto.subtle.encrypt("RSA-OAEP", key, cek));
201
173
  break;
202
174
  }
203
175
  case "PBKDF2": {
204
- cek = providedCek ?? generateCek(enc);
205
- const { p2c = 2048, p2s = crypto.getRandomValues(new Uint8Array(16)) } = providedParameters, derived = await deriveKey(p2s, alg, p2c, key);
206
- encryptedKey = await aeskwWrap(alg.slice(-6), derived, cek), parameters = { p2c, p2s: b64u(p2s) };
207
- break;
208
- }
209
- case "AES-KW": {
210
- cek = providedCek ?? generateCek(enc), encryptedKey = await aeskwWrap(alg, key, cek);
176
+ const { p2c = 2048, p2s = crypto.getRandomValues(new Uint8Array(16)) } = providedParameters;
177
+ key = await deriveKey(p2s, alg, p2c, key), parameters = { p2c, p2s: b64u(p2s) };
211
178
  break;
212
179
  }
213
180
  case "AES-GCM": {
214
- cek = providedCek ?? generateCek(enc);
215
181
  const iv = providedParameters.iv === void 0 ? crypto.getRandomValues(new Uint8Array(12)) : providedParameters.iv;
216
182
  if (!(iv instanceof Uint8Array))
217
183
  throw new TypeError('"iv" must be an instance of Uint8Array');
218
184
  const wrapped = await encrypt(jweEncryption(alg.slice(0, -2)), cek, key, iv, new Uint8Array());
219
185
  encryptedKey = wrapped.ciphertext, parameters = { iv: b64u(wrapped.iv), tag: b64u(wrapped.tag) };
220
- break;
221
186
  }
222
187
  }
223
- if (cek === void 0)
224
- throw new TypeError("Invalid JWE key management algorithm");
188
+ if (encryptedKey ??= await aeskwWrap(alg.slice(-6), key, cek), !(encryptedKey instanceof Uint8Array) || !encryptedKey.byteLength)
189
+ throw new TypeError("JWE key management algorithm did not produce an Encrypted Key");
225
190
  return [cek, encryptedKey, parameters];
226
191
  }
227
192
  export {
@@ -1,11 +1,64 @@
1
1
  import { JOSENotSupported, JWSInvalid } from "../util/errors.js";
2
- import { isObject } from "./type_checks.js";
2
+ import { decode } from "../util/base64url.js";
3
+ import { encode, strictDecoder } from "./buffer_utils.js";
4
+ function assertUint8Array(input, label) {
5
+ if (!(input instanceof Uint8Array))
6
+ throw new TypeError(`${label} must be an instance of Uint8Array`);
7
+ }
8
+ function isObject(input) {
9
+ if (typeof input != "object" || input === null || Object.prototype.toString.call(input) !== "[object Object]")
10
+ return !1;
11
+ const prototype = Object.getPrototypeOf(input);
12
+ return prototype === null || Object.getPrototypeOf(prototype) === null;
13
+ }
14
+ function isJwkSet(input) {
15
+ return isObject(input) && Array.isArray(input.keys) && Array.from(input.keys).every(isObject);
16
+ }
17
+ function isDisjoint(...headers) {
18
+ const parameters = /* @__PURE__ */ new Set();
19
+ for (const header of headers)
20
+ if (header)
21
+ for (const parameter of Object.keys(header)) {
22
+ if (parameters.has(parameter))
23
+ return !1;
24
+ parameters.add(parameter);
25
+ }
26
+ return !0;
27
+ }
28
+ function assertNotSet(value, name) {
29
+ if (value !== void 0)
30
+ throw new TypeError(`${name} can only be called once`);
31
+ }
32
+ function decodeBase64url(value, label, ErrorClass) {
33
+ try {
34
+ return decode(value);
35
+ } catch {
36
+ throw new ErrorClass(`Failed to base64url decode the ${label}`);
37
+ }
38
+ }
39
+ function encodeBase64url(value, label, ErrorClass) {
40
+ try {
41
+ return encode(value);
42
+ } catch {
43
+ throw new ErrorClass(`The ${label} is not a valid base64url string`);
44
+ }
45
+ }
46
+ function parseJoseHeader(b64, ErrorClass, message) {
47
+ let parsed;
48
+ try {
49
+ parsed = JSON.parse(strictDecoder.decode(decode(b64)));
50
+ } catch {
51
+ throw new ErrorClass(message);
52
+ }
53
+ if (!isObject(parsed))
54
+ throw new ErrorClass(message);
55
+ return parsed;
56
+ }
3
57
  const JWS_RECOGNIZED = { __proto__: null, b64: !0 }, JWE_RECOGNIZED = { __proto__: null };
4
58
  function validateAlgorithms(option, algorithms) {
5
59
  if (algorithms !== void 0 && (!Array.isArray(algorithms) || algorithms.some((s) => typeof s != "string")))
6
60
  throw new TypeError(`"${option}" option must be an array of strings`);
7
- if (algorithms)
8
- return new Set(algorithms);
61
+ return algorithms === void 0 ? void 0 : new Set(algorithms);
9
62
  }
10
63
  function validateCritDuplicates(Err, protectedHeader) {
11
64
  const { crit } = protectedHeader ?? {};
@@ -53,6 +106,14 @@ function serializeJoseHeader(Err, header) {
53
106
  export {
54
107
  JWE_RECOGNIZED,
55
108
  JWS_RECOGNIZED,
109
+ assertNotSet,
110
+ assertUint8Array,
111
+ decodeBase64url,
112
+ encodeBase64url,
113
+ isDisjoint,
114
+ isJwkSet,
115
+ isObject,
116
+ parseJoseHeader,
56
117
  serializeJoseHeader,
57
118
  validateAlgorithms,
58
119
  validateB64,
@@ -1,28 +1,14 @@
1
- import { encoder, decoder } from "../lib/buffer_utils.js";
2
- import { encodeBase64, decodeBase64 } from "../lib/base64.js";
1
+ import { encoder, decoder, encodeBase64, decodeBase64 } from "../lib/buffer_utils.js";
3
2
  const invalid = "The input to be decoded is not correctly encoded.";
4
3
  function decode(input) {
5
- if (Uint8Array.fromBase64)
6
- try {
7
- return Uint8Array.fromBase64(typeof input == "string" ? input : decoder.decode(input), {
8
- alphabet: "base64url"
9
- });
10
- } catch (cause) {
11
- throw new TypeError(invalid, { cause });
12
- }
13
- let encoded = input;
14
- if (encoded instanceof Uint8Array && (encoded = decoder.decode(encoded)), encoded.includes("+") || encoded.includes("/"))
15
- throw new TypeError(invalid);
16
- encoded = encoded.replace(/-/g, "+").replace(/_/g, "/");
17
4
  try {
18
- return decodeBase64(encoded);
19
- } catch {
20
- throw new TypeError(invalid);
5
+ return decodeBase64(typeof input == "string" ? input : decoder.decode(input), !0);
6
+ } catch (cause) {
7
+ throw new TypeError(invalid, { cause });
21
8
  }
22
9
  }
23
10
  function encode(input) {
24
- let unencoded = input;
25
- return typeof unencoded == "string" && (unencoded = encoder.encode(unencoded)), Uint8Array.prototype.toBase64 ? unencoded.toBase64({ alphabet: "base64url", omitPadding: !0 }) : encodeBase64(unencoded).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
11
+ return encodeBase64(typeof input == "string" ? encoder.encode(input) : input, !0);
26
12
  }
27
13
  export {
28
14
  decode,
@@ -1,6 +1,6 @@
1
1
  import { decode as b64u } from "./base64url.js";
2
2
  import { strictDecoder } from "../lib/buffer_utils.js";
3
- import { isObject } from "../lib/type_checks.js";
3
+ import { isObject } from "../lib/validate.js";
4
4
  import { JWTInvalid } from "./errors.js";
5
5
  function decodeJwt(jwt) {
6
6
  if (typeof jwt != "string")
@@ -1,4 +1,4 @@
1
- import { parseJoseHeader } from "../lib/helpers.js";
1
+ import { parseJoseHeader } from "../lib/validate.js";
2
2
  function decodeProtectedHeader(token) {
3
3
  let protectedB64u;
4
4
  if (typeof token == "string") {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jose",
3
- "version": "6.2.11",
3
+ "version": "6.2.12",
4
4
  "description": "JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other Web-interoperable runtimes",
5
5
  "keywords": [
6
6
  "akp",
@@ -136,6 +136,10 @@ export declare abstract class PostHogCore extends PostHogCoreStateless {
136
136
  private setBootstrappedFeatureFlagDetails;
137
137
  private getBootstrappedFeatureFlags;
138
138
  private getBootstrappedFeatureFlagPayloads;
139
+ /**
140
+ * Returns the current evaluation result for a feature flag. `enabled: false` is a conclusive
141
+ * off result; `undefined` means no evaluation is available for the key.
142
+ */
139
143
  getFeatureFlagResult(key: string, options?: FeatureFlagResultOptions): FeatureFlagResult | undefined;
140
144
  /**
141
145
  * Returns all currently cached feature flags as `FeatureFlagResult`s. This is a synchronous read of
@@ -156,6 +160,11 @@ export declare abstract class PostHogCore extends PostHogCoreStateless {
156
160
  */
157
161
  missingFlagBehavior?: 'getFeatureFlag' | 'getFeatureFlagPayload';
158
162
  }): FeatureFlagResult | undefined;
163
+ /**
164
+ * Returns the current feature flag value. For backwards compatibility, a missing key can resolve
165
+ * to `false` once a non-empty flag response has been stored. Use `getFeatureFlagResult()` when
166
+ * code must distinguish a conclusive off result from an unavailable key.
167
+ */
159
168
  getFeatureFlag(key: string, options?: FeatureFlagResultOptions): FeatureFlagValue | undefined;
160
169
  /**
161
170
  * @deprecated Use `getFeatureFlagResult()` instead, which returns the flag value and payload from a single evaluation.
@@ -168,6 +177,11 @@ export declare abstract class PostHogCore extends PostHogCoreStateless {
168
177
  flags: PostHogFlagsResponse['featureFlags'] | undefined;
169
178
  payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;
170
179
  };
180
+ /**
181
+ * Returns whether the current feature flag value is enabled. When no evaluation is available,
182
+ * `defaultValue` is returned if provided; without one, the legacy missing-key behavior of
183
+ * `getFeatureFlag()` applies.
184
+ */
171
185
  isFeatureEnabled(key: string, options: IsFeatureEnabledOptions & {
172
186
  defaultValue: boolean;
173
187
  }): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"posthog-core.d.ts","sourceRoot":"","sources":["../src/posthog-core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,oBAAoB,EACpB,2BAA2B,EAC3B,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,QAAQ,EACR,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,wBAAwB,EACxB,uBAAuB,EAGvB,yBAAyB,EAKzB,sBAAsB,EAGvB,MAAM,SAAS,CAAA;AAahB,OAAO,EAAiC,wBAAwB,EAAE,MAAM,SAAS,CAAA;AACjF,OAAO,EAGL,oBAAoB,EAErB,MAAM,0BAA0B,CAAA;AAGjC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAG5C,UAAU,iBAAiB;IACzB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC;AAUD,8BAAsB,WAAY,SAAQ,oBAAoB;IAE5D,OAAO,CAAC,oBAAoB,CAAS;IACrC,OAAO,CAAC,yBAAyB,CAAS;IAC1C,OAAO,CAAC,gBAAgB,CAA2D;IACnF,OAAO,CAAC,WAAW,CAAC,CAA+B;IAGnD,SAAS,CAAC,qBAAqB,CAAC,EAAE,OAAO,CAAC,2BAA2B,GAAG,SAAS,CAAC,CAAA;IAClF,SAAS,CAAC,6BAA6B,EAAE,MAAM,CAAA;IAC/C,OAAO,CAAC,wBAAwB,CAAuB;IACvD,SAAS,CAAC,YAAY,EAAE,sBAAsB,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B;IAI9C;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,oBAAoB,IAAI,OAAO;IAmBzC;;;;;;;;;OASG;IACH,SAAS,CAAC,wBAAwB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO;IAWjE;;;;;;;;OAQG;IACH,mBAAmB,IAAI,IAAI;IAa3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACH,mBAAmB,CACjB,mBAAmB,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAA;KAAE,EACjD,uBAAuB,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAA;KAAE,EACrD,kBAAkB,UAAO,GACxB,IAAI;IAkCP;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,qBAAqB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,kBAAkB,UAAO,GAAG,IAAI;IAmCxF;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,oBAAoB,CAAC,OAAO,EAAE,sBAAsB,GAAG,sBAAsB,GAAG,IAAI;IA+C9F;;;;;;OAMG;IACH,OAAO,CAAC,cAAc;CAuBvB"}
@@ -389,6 +389,7 @@ export type FeatureFlagValue = string | boolean;
389
389
  */
390
390
  export type FeatureFlagResult = {
391
391
  readonly key: string;
392
+ /** Whether the returned feature flag evaluation is enabled. `false` is a conclusive off result. */
392
393
  readonly enabled: boolean;
393
394
  readonly variant?: string;
394
395
  readonly payload?: JsonType;