@zuplo/cli 7.6.8 → 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 (390) 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 +12 -25
  16. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +18 -32
  17. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +12 -25
  18. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +24 -50
  19. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +15 -30
  20. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +29 -52
  21. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwk/embedded.d.ts +5 -8
  22. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwk/thumbprint.d.ts +7 -9
  23. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwks/local.d.ts +10 -13
  24. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwks/remote.d.ts +29 -41
  25. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jws/compact/sign.d.ts +8 -13
  26. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jws/compact/verify.d.ts +14 -26
  27. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jws/flattened/sign.d.ts +10 -19
  28. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jws/flattened/verify.d.ts +14 -26
  29. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jws/general/sign.d.ts +19 -33
  30. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jws/general/verify.d.ts +17 -32
  31. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwt/decrypt.d.ts +20 -27
  32. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwt/encrypt.d.ts +30 -35
  33. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwt/sign.d.ts +8 -13
  34. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwt/unsecured.d.ts +10 -19
  35. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwt/verify.d.ts +19 -22
  36. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/key/export.d.ts +10 -10
  37. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/key/generate_key_pair.d.ts +15 -22
  38. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/key/generate_secret.d.ts +12 -19
  39. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/key/import.d.ts +25 -31
  40. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/types.d.ts +184 -319
  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 +5 -7
  43. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/util/decode_protected_header.d.ts +6 -5
  44. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/util/errors.d.ts +50 -88
  45. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/index.js +70 -32
  46. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +6 -8
  47. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +25 -48
  48. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +14 -14
  49. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +34 -64
  50. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwe/general/decrypt.js +38 -49
  51. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwe/general/encrypt.js +100 -172
  52. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwk/embedded.js +29 -32
  53. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwk/thumbprint.js +51 -70
  54. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwks/local.js +53 -64
  55. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwks/remote.js +88 -136
  56. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jws/compact/sign.js +19 -21
  57. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jws/compact/verify.js +7 -8
  58. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jws/flattened/sign.js +22 -31
  59. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jws/flattened/verify.js +11 -24
  60. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jws/general/sign.js +55 -73
  61. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jws/general/verify.js +43 -69
  62. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwt/decrypt.js +12 -20
  63. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwt/encrypt.js +43 -70
  64. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwt/sign.js +17 -16
  65. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwt/unsecured.js +31 -40
  66. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwt/verify.js +12 -14
  67. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/key/export.js +32 -41
  68. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/key/generate_key_pair.js +32 -49
  69. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/key/generate_secret.js +35 -40
  70. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/key/import.js +48 -56
  71. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/asn1.js +128 -169
  72. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/buffer_utils.js +72 -41
  73. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/content_encryption.js +75 -119
  74. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/deflate.js +35 -47
  75. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jwe_algorithms.js +102 -93
  76. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +178 -234
  77. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +71 -138
  78. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jws_algorithms.js +62 -61
  79. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jws_sign.js +43 -82
  80. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jws_verify.js +78 -131
  81. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +123 -209
  82. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/key.js +147 -139
  83. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/key_algorithm.js +13 -8
  84. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/key_descriptor.js +8 -6
  85. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/key_management.js +169 -235
  86. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/validate.js +122 -0
  87. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/util/base64url.js +14 -37
  88. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/util/decode_jwt.js +32 -31
  89. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/util/decode_protected_header.js +18 -23
  90. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/util/errors.js +94 -84
  91. package/node_modules/@modelcontextprotocol/client/node_modules/jose/package.json +17 -81
  92. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/index.d.ts +1 -2
  93. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +12 -25
  94. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +18 -32
  95. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +12 -25
  96. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +24 -50
  97. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +15 -30
  98. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +29 -52
  99. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwk/embedded.d.ts +5 -8
  100. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwk/thumbprint.d.ts +7 -9
  101. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwks/local.d.ts +10 -13
  102. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwks/remote.d.ts +29 -41
  103. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/compact/sign.d.ts +8 -13
  104. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/compact/verify.d.ts +14 -26
  105. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/flattened/sign.d.ts +10 -19
  106. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/flattened/verify.d.ts +14 -26
  107. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/general/sign.d.ts +19 -33
  108. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/general/verify.d.ts +17 -32
  109. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/decrypt.d.ts +20 -27
  110. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/encrypt.d.ts +30 -35
  111. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/sign.d.ts +8 -13
  112. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/unsecured.d.ts +10 -19
  113. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/verify.d.ts +19 -22
  114. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/key/export.d.ts +10 -10
  115. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/key/generate_key_pair.d.ts +15 -22
  116. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/key/generate_secret.d.ts +12 -19
  117. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/key/import.d.ts +25 -31
  118. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/types.d.ts +184 -319
  119. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/util/base64url.d.ts +7 -7
  120. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/util/decode_jwt.d.ts +5 -7
  121. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/util/decode_protected_header.d.ts +6 -5
  122. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/util/errors.d.ts +50 -88
  123. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/index.js +70 -32
  124. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +6 -8
  125. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +25 -48
  126. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +14 -14
  127. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +34 -64
  128. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/general/decrypt.js +38 -49
  129. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/general/encrypt.js +100 -172
  130. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwk/embedded.js +29 -32
  131. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwk/thumbprint.js +51 -70
  132. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwks/local.js +53 -64
  133. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwks/remote.js +88 -136
  134. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/compact/sign.js +19 -21
  135. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/compact/verify.js +7 -8
  136. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/flattened/sign.js +22 -31
  137. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/flattened/verify.js +11 -24
  138. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/general/sign.js +55 -73
  139. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/general/verify.js +43 -69
  140. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/decrypt.js +12 -20
  141. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/encrypt.js +43 -70
  142. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/sign.js +17 -16
  143. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/unsecured.js +31 -40
  144. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/verify.js +12 -14
  145. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/key/export.js +32 -41
  146. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/key/generate_key_pair.js +32 -49
  147. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/key/generate_secret.js +35 -40
  148. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/key/import.js +48 -56
  149. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/asn1.js +128 -169
  150. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/buffer_utils.js +72 -41
  151. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/content_encryption.js +75 -119
  152. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/deflate.js +35 -47
  153. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwe_algorithms.js +102 -93
  154. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +178 -234
  155. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +71 -138
  156. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jws_algorithms.js +62 -61
  157. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jws_sign.js +43 -82
  158. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jws_verify.js +78 -131
  159. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +123 -209
  160. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/key.js +147 -139
  161. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/key_algorithm.js +13 -8
  162. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/key_descriptor.js +8 -6
  163. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/key_management.js +169 -235
  164. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/validate.js +122 -0
  165. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/util/base64url.js +14 -37
  166. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/util/decode_jwt.js +32 -31
  167. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/util/decode_protected_header.js +18 -23
  168. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/util/errors.js +94 -84
  169. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/package.json +17 -81
  170. package/node_modules/@posthog/core/dist/cookie.js +17 -13
  171. package/node_modules/@posthog/core/dist/error-tracking/chunk-ids.js +15 -11
  172. package/node_modules/@posthog/core/dist/error-tracking/coercers/dom-exception-coercer.js +12 -8
  173. package/node_modules/@posthog/core/dist/error-tracking/coercers/error-coercer.js +12 -8
  174. package/node_modules/@posthog/core/dist/error-tracking/coercers/error-event-coercer.js +12 -9
  175. package/node_modules/@posthog/core/dist/error-tracking/coercers/error-event-coercer.mjs +0 -1
  176. package/node_modules/@posthog/core/dist/error-tracking/coercers/event-coercer.js +12 -8
  177. package/node_modules/@posthog/core/dist/error-tracking/coercers/index.js +51 -63
  178. package/node_modules/@posthog/core/dist/error-tracking/coercers/object-coercer.js +12 -8
  179. package/node_modules/@posthog/core/dist/error-tracking/coercers/primitive-coercer.js +12 -8
  180. package/node_modules/@posthog/core/dist/error-tracking/coercers/promise-rejection-event.js +12 -8
  181. package/node_modules/@posthog/core/dist/error-tracking/coercers/string-coercer.js +15 -11
  182. package/node_modules/@posthog/core/dist/error-tracking/coercers/utils.js +16 -12
  183. package/node_modules/@posthog/core/dist/error-tracking/error-properties-builder.js +12 -8
  184. package/node_modules/@posthog/core/dist/error-tracking/exception-steps.js +18 -14
  185. package/node_modules/@posthog/core/dist/error-tracking/exception-steps.mjs +2 -2
  186. package/node_modules/@posthog/core/dist/error-tracking/index.js +41 -49
  187. package/node_modules/@posthog/core/dist/error-tracking/parsers/base.d.ts.map +1 -1
  188. package/node_modules/@posthog/core/dist/error-tracking/parsers/base.js +13 -9
  189. package/node_modules/@posthog/core/dist/error-tracking/parsers/base.mjs +1 -1
  190. package/node_modules/@posthog/core/dist/error-tracking/parsers/chrome.js +12 -8
  191. package/node_modules/@posthog/core/dist/error-tracking/parsers/gecko.js +12 -8
  192. package/node_modules/@posthog/core/dist/error-tracking/parsers/index.js +17 -13
  193. package/node_modules/@posthog/core/dist/error-tracking/parsers/index.mjs +4 -4
  194. package/node_modules/@posthog/core/dist/error-tracking/parsers/node.js +12 -8
  195. package/node_modules/@posthog/core/dist/error-tracking/parsers/opera.js +14 -10
  196. package/node_modules/@posthog/core/dist/error-tracking/parsers/safari.js +12 -8
  197. package/node_modules/@posthog/core/dist/error-tracking/parsers/winjs.js +12 -8
  198. package/node_modules/@posthog/core/dist/error-tracking/release.js +15 -11
  199. package/node_modules/@posthog/core/dist/error-tracking/types.js +15 -11
  200. package/node_modules/@posthog/core/dist/error-tracking/utils.js +15 -11
  201. package/node_modules/@posthog/core/dist/eventemitter.js +15 -11
  202. package/node_modules/@posthog/core/dist/featureFlagLocalEvaluation.js +18 -14
  203. package/node_modules/@posthog/core/dist/featureFlagLocalEvaluation.mjs +1 -1
  204. package/node_modules/@posthog/core/dist/featureFlagUtils.js +30 -25
  205. package/node_modules/@posthog/core/dist/featureFlagUtils.mjs +2 -2
  206. package/node_modules/@posthog/core/dist/gzip.js +16 -12
  207. package/node_modules/@posthog/core/dist/index.js +302 -310
  208. package/node_modules/@posthog/core/dist/index.mjs +12 -12
  209. package/node_modules/@posthog/core/dist/logs/index.js +13 -9
  210. package/node_modules/@posthog/core/dist/logs/index.mjs +1 -1
  211. package/node_modules/@posthog/core/dist/logs/logs-utils.js +16 -12
  212. package/node_modules/@posthog/core/dist/logs/types.js +2 -2
  213. package/node_modules/@posthog/core/dist/logs/types.mjs +1 -0
  214. package/node_modules/@posthog/core/dist/metrics/config.js +15 -11
  215. package/node_modules/@posthog/core/dist/metrics/index.js +15 -11
  216. package/node_modules/@posthog/core/dist/metrics/index.mjs +2 -2
  217. package/node_modules/@posthog/core/dist/metrics/metrics-utils.js +14 -10
  218. package/node_modules/@posthog/core/dist/metrics/types.js +2 -2
  219. package/node_modules/@posthog/core/dist/metrics/types.mjs +1 -0
  220. package/node_modules/@posthog/core/dist/posthog-core-stateless.js +16 -12
  221. package/node_modules/@posthog/core/dist/posthog-core-stateless.mjs +1 -1
  222. package/node_modules/@posthog/core/dist/posthog-core.d.ts +14 -0
  223. package/node_modules/@posthog/core/dist/posthog-core.d.ts.map +1 -1
  224. package/node_modules/@posthog/core/dist/posthog-core.js +12 -8
  225. package/node_modules/@posthog/core/dist/surveys/activation.js +14 -10
  226. package/node_modules/@posthog/core/dist/surveys/events.js +14 -10
  227. package/node_modules/@posthog/core/dist/surveys/index.js +30 -26
  228. package/node_modules/@posthog/core/dist/surveys/index.mjs +6 -7
  229. package/node_modules/@posthog/core/dist/surveys/keys.js +16 -12
  230. package/node_modules/@posthog/core/dist/surveys/property-matching.js +19 -14
  231. package/node_modules/@posthog/core/dist/surveys/translations.js +16 -12
  232. package/node_modules/@posthog/core/dist/surveys/validation.js +13 -9
  233. package/node_modules/@posthog/core/dist/testing/PostHogCoreTestClient.d.ts +3 -3
  234. package/node_modules/@posthog/core/dist/testing/PostHogCoreTestClient.d.ts.map +1 -1
  235. package/node_modules/@posthog/core/dist/testing/PostHogCoreTestClient.js +15 -11
  236. package/node_modules/@posthog/core/dist/testing/PostHogCoreTestClient.mjs +3 -3
  237. package/node_modules/@posthog/core/dist/testing/index.js +21 -21
  238. package/node_modules/@posthog/core/dist/testing/test-utils.d.ts.map +1 -1
  239. package/node_modules/@posthog/core/dist/testing/test-utils.js +19 -18
  240. package/node_modules/@posthog/core/dist/testing/test-utils.mjs +7 -10
  241. package/node_modules/@posthog/core/dist/tracing-headers.js +12 -8
  242. package/node_modules/@posthog/core/dist/types.d.ts +1 -0
  243. package/node_modules/@posthog/core/dist/types.d.ts.map +1 -1
  244. package/node_modules/@posthog/core/dist/types.js +31 -26
  245. package/node_modules/@posthog/core/dist/types.mjs +1 -1
  246. package/node_modules/@posthog/core/dist/utils/bot-detection.js +16 -12
  247. package/node_modules/@posthog/core/dist/utils/browser-utils.js +12 -8
  248. package/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.js +14 -10
  249. package/node_modules/@posthog/core/dist/utils/index.d.ts +1 -0
  250. package/node_modules/@posthog/core/dist/utils/index.d.ts.map +1 -1
  251. package/node_modules/@posthog/core/dist/utils/index.js +205 -192
  252. package/node_modules/@posthog/core/dist/utils/index.mjs +4 -3
  253. package/node_modules/@posthog/core/dist/utils/json-utils.js +24 -19
  254. package/node_modules/@posthog/core/dist/utils/logger.js +17 -12
  255. package/node_modules/@posthog/core/dist/utils/number-utils.d.ts.map +1 -1
  256. package/node_modules/@posthog/core/dist/utils/number-utils.js +14 -10
  257. package/node_modules/@posthog/core/dist/utils/number-utils.mjs +1 -1
  258. package/node_modules/@posthog/core/dist/utils/otlp-any-value.js +15 -11
  259. package/node_modules/@posthog/core/dist/utils/otlp-any-value.mjs +1 -1
  260. package/node_modules/@posthog/core/dist/utils/otlp-resource.js +17 -13
  261. package/node_modules/@posthog/core/dist/utils/promise-queue.js +12 -8
  262. package/node_modules/@posthog/core/dist/utils/string-utils.js +21 -16
  263. package/node_modules/@posthog/core/dist/utils/type-utils.js +31 -27
  264. package/node_modules/@posthog/core/dist/utils/type-utils.mjs +2 -2
  265. package/node_modules/@posthog/core/dist/utils/user-agent-utils.js +16 -12
  266. package/node_modules/@posthog/core/dist/utils/webview-app-utils.d.ts +12 -0
  267. package/node_modules/@posthog/core/dist/utils/webview-app-utils.d.ts.map +1 -0
  268. package/node_modules/@posthog/core/dist/utils/webview-app-utils.js +132 -0
  269. package/node_modules/@posthog/core/dist/utils/webview-app-utils.mjs +94 -0
  270. package/node_modules/@posthog/core/dist/vendor/uuidv7.js +22 -17
  271. package/node_modules/@posthog/core/dist/vendor/uuidv7.mjs +1 -1
  272. package/node_modules/@posthog/core/package.json +8 -8
  273. package/node_modules/@posthog/core/src/error-tracking/coercers/promise-rejection-event.spec.ts +4 -4
  274. package/node_modules/@posthog/core/src/error-tracking/error-properties-builder.parse.spec.ts +1 -1
  275. package/node_modules/@posthog/core/src/error-tracking/parsers/base.spec.ts +21 -2
  276. package/node_modules/@posthog/core/src/error-tracking/parsers/base.ts +6 -2
  277. package/node_modules/@posthog/core/src/featureFlagLocalEvaluation.ts +1 -1
  278. package/node_modules/@posthog/core/src/featureFlagUtils.ts +4 -4
  279. package/node_modules/@posthog/core/src/logs/index.spec.ts +89 -89
  280. package/node_modules/@posthog/core/src/metrics/index.spec.ts +24 -24
  281. package/node_modules/@posthog/core/src/posthog-core.ts +14 -1
  282. package/node_modules/@posthog/core/src/surveys/activation.spec.ts +1 -1
  283. package/node_modules/@posthog/core/src/surveys/events.spec.ts +1 -1
  284. package/node_modules/@posthog/core/src/surveys/keys.spec.ts +1 -1
  285. package/node_modules/@posthog/core/src/surveys/translations.spec.ts +8 -8
  286. package/node_modules/@posthog/core/src/testing/PostHogCoreTestClient.ts +6 -6
  287. package/node_modules/@posthog/core/src/testing/test-utils.ts +7 -12
  288. package/node_modules/@posthog/core/src/types.ts +1 -0
  289. package/node_modules/@posthog/core/src/utils/bucketed-rate-limiter.spec.ts +13 -13
  290. package/node_modules/@posthog/core/src/utils/index.ts +1 -0
  291. package/node_modules/@posthog/core/src/utils/json-utils.spec.ts +5 -5
  292. package/node_modules/@posthog/core/src/utils/number-utils.spec.ts +20 -0
  293. package/node_modules/@posthog/core/src/utils/number-utils.ts +3 -1
  294. package/node_modules/@posthog/core/src/utils/otlp-any-value.spec.ts +4 -4
  295. package/node_modules/@posthog/core/src/utils/promise-queue.spec.ts +3 -3
  296. package/node_modules/@posthog/core/src/utils/type-utils.ts +4 -4
  297. package/node_modules/@posthog/core/src/utils/webview-app-utils.spec.ts +118 -0
  298. package/node_modules/@posthog/core/src/utils/webview-app-utils.ts +49 -0
  299. package/node_modules/@posthog/types/dist/capture-log.js +2 -2
  300. package/node_modules/@posthog/types/dist/capture-log.mjs +1 -0
  301. package/node_modules/@posthog/types/dist/capture-metric.js +15 -11
  302. package/node_modules/@posthog/types/dist/capture.js +2 -2
  303. package/node_modules/@posthog/types/dist/capture.mjs +1 -0
  304. package/node_modules/@posthog/types/dist/common.js +2 -2
  305. package/node_modules/@posthog/types/dist/common.mjs +1 -0
  306. package/node_modules/@posthog/types/dist/feature-flags.d.ts +1 -1
  307. package/node_modules/@posthog/types/dist/feature-flags.d.ts.map +1 -1
  308. package/node_modules/@posthog/types/dist/feature-flags.js +2 -2
  309. package/node_modules/@posthog/types/dist/feature-flags.mjs +1 -0
  310. package/node_modules/@posthog/types/dist/index.js +12 -8
  311. package/node_modules/@posthog/types/dist/index.mjs +1 -2
  312. package/node_modules/@posthog/types/dist/posthog-config.d.ts +15 -1
  313. package/node_modules/@posthog/types/dist/posthog-config.d.ts.map +1 -1
  314. package/node_modules/@posthog/types/dist/posthog-config.js +2 -2
  315. package/node_modules/@posthog/types/dist/posthog-config.mjs +1 -0
  316. package/node_modules/@posthog/types/dist/posthog.d.ts +2 -2
  317. package/node_modules/@posthog/types/dist/posthog.d.ts.map +1 -1
  318. package/node_modules/@posthog/types/dist/posthog.js +2 -2
  319. package/node_modules/@posthog/types/dist/posthog.mjs +1 -0
  320. package/node_modules/@posthog/types/dist/request.js +2 -2
  321. package/node_modules/@posthog/types/dist/request.mjs +1 -0
  322. package/node_modules/@posthog/types/dist/segment.js +2 -2
  323. package/node_modules/@posthog/types/dist/segment.mjs +1 -0
  324. package/node_modules/@posthog/types/dist/session-recording.js +2 -2
  325. package/node_modules/@posthog/types/dist/session-recording.mjs +1 -0
  326. package/node_modules/@posthog/types/dist/survey.js +2 -2
  327. package/node_modules/@posthog/types/dist/survey.mjs +1 -0
  328. package/node_modules/@posthog/types/dist/toolbar.js +2 -2
  329. package/node_modules/@posthog/types/dist/toolbar.mjs +1 -0
  330. package/node_modules/@posthog/types/dist/tree-shakeable.js +2 -2
  331. package/node_modules/@posthog/types/dist/tree-shakeable.mjs +1 -0
  332. package/node_modules/@posthog/types/package.json +4 -6
  333. package/node_modules/@posthog/types/src/feature-flags.ts +1 -1
  334. package/node_modules/@posthog/types/src/posthog-config.ts +16 -1
  335. package/node_modules/@posthog/types/src/posthog.ts +2 -2
  336. package/node_modules/@posthog/types/src/tree-shakeable.ts +1 -1
  337. package/node_modules/@zuplo/core/package.json +1 -1
  338. package/node_modules/@zuplo/graphql/package.json +1 -1
  339. package/node_modules/@zuplo/openapi-tools/package.json +1 -1
  340. package/node_modules/@zuplo/otel/package.json +1 -1
  341. package/node_modules/@zuplo/runtime/out/esm/{chunk-ZZCZZHOD.js → chunk-R4PTES5B.js} +104 -104
  342. package/node_modules/@zuplo/runtime/out/esm/chunk-R4PTES5B.js.map +1 -0
  343. package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
  344. package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +1 -1
  345. package/node_modules/@zuplo/runtime/out/types/index.d.ts +59 -9
  346. package/node_modules/@zuplo/runtime/package.json +1 -1
  347. package/node_modules/hono/dist/cjs/client/client.js +4 -4
  348. package/node_modules/hono/dist/cjs/hono-base.js +7 -6
  349. package/node_modules/hono/dist/cjs/jsx/base.js +18 -1
  350. package/node_modules/hono/dist/cjs/jsx/components.js +25 -26
  351. package/node_modules/hono/dist/cjs/jsx/context.js +5 -5
  352. package/node_modules/hono/dist/cjs/jsx/dom/server.js +5 -1
  353. package/node_modules/hono/dist/cjs/jsx/intrinsic-element/components.js +2 -2
  354. package/node_modules/hono/dist/cjs/jsx/streaming.js +4 -5
  355. package/node_modules/hono/dist/client/client.js +4 -4
  356. package/node_modules/hono/dist/hono-base.js +7 -6
  357. package/node_modules/hono/dist/jsx/base.js +15 -1
  358. package/node_modules/hono/dist/jsx/components.js +26 -27
  359. package/node_modules/hono/dist/jsx/context.js +6 -6
  360. package/node_modules/hono/dist/jsx/dom/server.js +5 -1
  361. package/node_modules/hono/dist/jsx/intrinsic-element/components.js +3 -3
  362. package/node_modules/hono/dist/jsx/streaming.js +5 -6
  363. package/node_modules/hono/dist/types/context.d.ts +2 -2
  364. package/node_modules/hono/dist/types/jsx/base.d.ts +3 -0
  365. package/node_modules/hono/package.json +2 -2
  366. package/package.json +11 -11
  367. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/base64.js +0 -22
  368. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/crypto_key.js +0 -28
  369. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/helpers.js +0 -42
  370. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/invalid_key_input.js +0 -26
  371. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/is_key_like.js +0 -17
  372. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jwk_metadata.js +0 -20
  373. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jwk_to_key.js +0 -17
  374. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/key_options.js +0 -6
  375. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/options.js +0 -74
  376. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/signing.js +0 -26
  377. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/type_checks.js +0 -33
  378. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/base64.js +0 -22
  379. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/crypto_key.js +0 -28
  380. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/helpers.js +0 -42
  381. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/invalid_key_input.js +0 -26
  382. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/is_key_like.js +0 -17
  383. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwk_metadata.js +0 -20
  384. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwk_to_key.js +0 -17
  385. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/key_options.js +0 -6
  386. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/options.js +0 -74
  387. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/signing.js +0 -26
  388. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/type_checks.js +0 -33
  389. package/node_modules/@zuplo/runtime/out/esm/chunk-ZZCZZHOD.js.map +0 -1
  390. /package/node_modules/@zuplo/runtime/out/esm/{chunk-ZZCZZHOD.js.LEGAL.txt → chunk-R4PTES5B.js.LEGAL.txt} +0 -0
@@ -1,70 +1,59 @@
1
- import { jwkToKey } from '../lib/jwk_to_key.js';
2
- import { JWS } from '../lib/jws_algorithms.js';
3
- import { JWKSInvalid, JOSENotSupported, JWKSNoMatchingKey, JWKSMultipleMatchingKeys, } from '../util/errors.js';
4
- import { isJwkSet } from '../lib/type_checks.js';
5
- import { snapshotJwk } from '../lib/jwk_metadata.js';
1
+ import { jwkToKey, snapshotJwk } from "../lib/key.js";
2
+ import { JWS } from "../lib/jws_algorithms.js";
3
+ import { JWKSInvalid, JOSENotSupported, JWKSNoMatchingKey, JWKSMultipleMatchingKeys } from "../util/errors.js";
4
+ import { isJwkSet } from "../lib/validate.js";
6
5
  function isUsableJWK(jwk, entry, alg, kid) {
7
- const { kty, key_ops, ext, kid: jwkKid, alg: jwkAlg, use, crv } = snapshotJwk(jwk);
8
- const keyOps = Array.isArray(key_ops) ? [...key_ops] : key_ops;
9
- return ((ext === undefined || typeof ext === 'boolean') &&
10
- (keyOps === undefined ||
11
- (Array.isArray(keyOps) &&
12
- keyOps.every((operation, index) => typeof operation === 'string' && keyOps.indexOf(operation) === index) &&
13
- keyOps.includes('verify'))) &&
14
- entry.kty.includes(kty) &&
15
- (kid === undefined || (typeof kid === 'string' && kid === jwkKid)) &&
16
- (jwkAlg === undefined ? kty !== 'AKP' : alg === jwkAlg) &&
17
- (use === undefined || use === 'sig') &&
18
- (!entry.crv || crv === entry.crv));
6
+ const { kty, key_ops: keyOps, ext, kid: jwkKid, alg: jwkAlg, use, crv } = jwk;
7
+ return (ext === void 0 || typeof ext == "boolean") && (keyOps === void 0 || Array.isArray(keyOps) && keyOps.every((operation, index) => typeof operation == "string" && keyOps.indexOf(operation) === index) && keyOps.includes("verify")) && entry.kty.includes(kty) && (kid === void 0 || typeof kid == "string" && kid === jwkKid) && (jwkAlg === void 0 ? kty !== "AKP" : alg === jwkAlg) && (use === void 0 || use === "sig") && (!entry.crv || crv === entry.crv);
19
8
  }
20
9
  async function importWithAlgCache(cache, jwk, entry) {
21
- const cached = cache.get(jwk) || cache.set(jwk, {}).get(jwk);
22
- const { alg } = entry;
23
- if (cached[alg] === undefined) {
24
- const key = await jwkToKey(entry, { ...jwk, alg, ext: true });
25
- if (key.type !== 'public') {
26
- throw new JWKSInvalid('JSON Web Key Set members must be public keys');
27
- }
28
- cached[alg] = key;
29
- }
30
- return cached[alg];
10
+ const cached = cache.get(jwk) || cache.set(jwk, {}).get(jwk), { alg } = entry;
11
+ if (cached[alg] === void 0) {
12
+ const pending = jwkToKey(entry, jwk, !0).then((key) => {
13
+ if (key.type !== "public")
14
+ throw new JWKSInvalid("JSON Web Key Set members must be public keys");
15
+ return cached[alg] = key, key;
16
+ }).catch((error) => {
17
+ throw cached[alg] === pending && delete cached[alg], error;
18
+ });
19
+ cached[alg] = pending;
20
+ }
21
+ return cached[alg];
31
22
  }
32
- export function createLocalJWKSet(jwks) {
33
- let snapshot;
34
- try {
35
- snapshot = structuredClone(jwks);
23
+ function createLocalJWKSet(jwks) {
24
+ let snapshot;
25
+ try {
26
+ snapshot = structuredClone(jwks);
27
+ } catch {
28
+ }
29
+ if (!isJwkSet(snapshot))
30
+ throw new JWKSInvalid("JSON Web Key Set malformed");
31
+ const metadata = snapshot.keys.map((jwk) => {
32
+ const normalized = snapshotJwk(jwk);
33
+ return Array.isArray(normalized.key_ops) && (normalized.key_ops = [...normalized.key_ops]), normalized;
34
+ }), cached = /* @__PURE__ */ new WeakMap();
35
+ return Object.defineProperty(async (protectedHeader, token) => {
36
+ const { alg, kid } = { ...protectedHeader, ...token?.header }, entry = typeof alg == "string" ? JWS[alg] : void 0;
37
+ if (!entry || entry.secret)
38
+ throw new JOSENotSupported('Unsupported "alg" value for a JSON Web Key Set');
39
+ const candidates = snapshot.keys.filter((_, index) => isUsableJWK(metadata[index], entry, alg, kid)), { 0: jwk, length } = candidates;
40
+ if (!length)
41
+ throw new JWKSNoMatchingKey();
42
+ if (length !== 1) {
43
+ const error = new JWKSMultipleMatchingKeys();
44
+ throw error[Symbol.asyncIterator] = async function* () {
45
+ for (const jwk2 of candidates)
46
+ try {
47
+ yield await importWithAlgCache(cached, jwk2, entry);
48
+ } catch {
49
+ }
50
+ }, error;
36
51
  }
37
- catch { }
38
- if (!isJwkSet(snapshot)) {
39
- throw new JWKSInvalid('JSON Web Key Set malformed');
40
- }
41
- const cached = new WeakMap();
42
- const localJWKSet = async (protectedHeader, token) => {
43
- const { alg, kid } = { ...protectedHeader, ...token?.header };
44
- const entry = typeof alg === 'string' ? JWS[alg] : undefined;
45
- if (!entry || entry.secret) {
46
- throw new JOSENotSupported('Unsupported "alg" value for a JSON Web Key Set');
47
- }
48
- const candidates = snapshot.keys.filter((jwk) => isUsableJWK(jwk, entry, alg, kid));
49
- const { 0: jwk, length } = candidates;
50
- if (!length) {
51
- throw new JWKSNoMatchingKey();
52
- }
53
- if (length !== 1) {
54
- const error = new JWKSMultipleMatchingKeys();
55
- error[Symbol.asyncIterator] = async function* () {
56
- for (const jwk of candidates) {
57
- try {
58
- yield await importWithAlgCache(cached, jwk, entry);
59
- }
60
- catch { }
61
- }
62
- };
63
- throw error;
64
- }
65
- return importWithAlgCache(cached, jwk, entry);
66
- };
67
- return Object.defineProperty(localJWKSet, 'jwks', {
68
- value: () => structuredClone(snapshot),
69
- });
52
+ return importWithAlgCache(cached, jwk, entry);
53
+ }, "jwks", {
54
+ value: () => structuredClone(snapshot)
55
+ });
70
56
  }
57
+ export {
58
+ createLocalJWKSet
59
+ };
@@ -1,149 +1,101 @@
1
- import { JOSEError, JWKSNoMatchingKey, JWKSTimeout } from '../util/errors.js';
2
- import { createLocalJWKSet } from './local.js';
3
- import { isJwkSet } from '../lib/type_checks.js';
1
+ import { JOSEError, JWKSNoMatchingKey, JWKSTimeout } from "../util/errors.js";
2
+ import { createLocalJWKSet } from "./local.js";
3
+ import { isJwkSet } from "../lib/validate.js";
4
4
  function isCloudflareWorkers() {
5
- return (typeof WebSocketPair !== 'undefined' ||
6
- (typeof navigator !== 'undefined' && navigator.userAgent === 'Cloudflare-Workers') ||
7
- (typeof EdgeRuntime !== 'undefined' && EdgeRuntime === 'vercel'));
5
+ return typeof WebSocketPair < "u" || typeof navigator < "u" && navigator.userAgent === "Cloudflare-Workers" || typeof EdgeRuntime < "u" && EdgeRuntime === "vercel";
8
6
  }
9
7
  let USER_AGENT;
10
- if (typeof navigator === 'undefined' || !navigator.userAgent?.startsWith?.('Mozilla/5.0 ')) {
11
- const NAME = 'jose';
12
- const VERSION = 'v6.2.10';
13
- USER_AGENT = `${NAME}/${VERSION}`;
14
- }
15
- export const customFetch = Symbol();
8
+ (typeof navigator > "u" || !navigator.userAgent?.startsWith?.("Mozilla/5.0 ")) && (USER_AGENT = "jose/v6.2.12");
9
+ const customFetch = /* @__PURE__ */ Symbol();
16
10
  async function fetchJwks(url, headers, signal, fetchImpl = fetch) {
17
- const response = await fetchImpl(url, {
18
- method: 'GET',
19
- signal,
20
- redirect: 'manual',
21
- headers,
22
- }).catch((err) => {
23
- if (err.name === 'TimeoutError') {
24
- throw new JWKSTimeout();
25
- }
26
- throw err;
27
- });
28
- if (response.status !== 200) {
29
- throw new JOSEError('Expected 200 OK from the JSON Web Key Set HTTP response');
30
- }
31
- try {
32
- return await response.json();
33
- }
34
- catch {
35
- throw new JOSEError('Failed to parse the JSON Web Key Set HTTP response as JSON');
36
- }
11
+ const response = await fetchImpl(url, {
12
+ method: "GET",
13
+ signal,
14
+ redirect: "manual",
15
+ headers
16
+ }).catch((err) => {
17
+ throw err.name === "TimeoutError" ? new JWKSTimeout() : err;
18
+ });
19
+ if (response.status !== 200)
20
+ throw new JOSEError("Expected 200 OK from the JSON Web Key Set HTTP response");
21
+ try {
22
+ return await response.json();
23
+ } catch {
24
+ throw new JOSEError("Failed to parse the JSON Web Key Set HTTP response as JSON");
25
+ }
37
26
  }
38
- export const jwksCache = Symbol();
27
+ const jwksCache = /* @__PURE__ */ Symbol();
39
28
  function isFreshFor(timestamp, duration) {
40
- return Number.isFinite(timestamp) && Date.now() < timestamp + duration;
29
+ return Number.isFinite(timestamp) && Date.now() < timestamp + duration;
41
30
  }
42
31
  function validateDuration(value, fallback, option) {
43
- if (Number.isNaN(value)) {
44
- throw new TypeError(`"${option}" option must not be NaN`);
45
- }
46
- return typeof value === 'number' ? value : fallback;
32
+ if (Number.isNaN(value))
33
+ throw new TypeError(`"${option}" option must not be NaN`);
34
+ return typeof value == "number" ? value : fallback;
47
35
  }
48
- export function createRemoteJWKSet(url, options) {
49
- if (!(url instanceof URL)) {
50
- throw new TypeError('url must be an instance of URL');
51
- }
52
- const href = new URL(url.href).href;
53
- const opts = options ?? {};
54
- const timeoutOption = opts.timeoutDuration;
55
- if (typeof timeoutOption === 'number' &&
56
- (!Number.isInteger(timeoutOption) || timeoutOption < 0)) {
57
- throw new TypeError('"timeoutDuration" option must be a non-negative integer');
36
+ function createRemoteJWKSet(url, options) {
37
+ if (!(url instanceof URL))
38
+ throw new TypeError("url must be an instance of URL");
39
+ const href = new URL(url.href).href, opts = options ?? {}, timeoutOption = opts.timeoutDuration;
40
+ if (typeof timeoutOption == "number" && (!Number.isInteger(timeoutOption) || timeoutOption < 0))
41
+ throw new TypeError('"timeoutDuration" option must be a non-negative integer');
42
+ const timeoutDuration = typeof timeoutOption == "number" ? timeoutOption : 5e3, cooldownDuration = validateDuration(opts.cooldownDuration, 3e4, "cooldownDuration"), cacheMaxAge = validateDuration(opts.cacheMaxAge, 6e5, "cacheMaxAge"), headers = new Headers(opts.headers);
43
+ USER_AGENT && !headers.has("User-Agent") && headers.set("User-Agent", USER_AGENT), headers.has("accept") || headers.set("accept", "application/json, application/jwk-set+json");
44
+ const fetchImpl = opts[customFetch], cache = opts[jwksCache];
45
+ let jwksTimestamp, pendingFetch, reloadSequence = 0, appliedSequence = 0, local;
46
+ if (cache && typeof cache == "object") {
47
+ const { uat, jwks } = cache;
48
+ isFreshFor(uat, cacheMaxAge) && isJwkSet(jwks) && (jwksTimestamp = uat, local = createLocalJWKSet(jwks));
49
+ }
50
+ const reload = async () => {
51
+ if (pendingFetch && isCloudflareWorkers() && (pendingFetch = void 0), !pendingFetch) {
52
+ const sequence = ++reloadSequence, current = pendingFetch = fetchJwks(href, headers, AbortSignal.timeout(timeoutDuration), fetchImpl).then((json) => {
53
+ const next = createLocalJWKSet(json);
54
+ if (sequence <= appliedSequence)
55
+ return;
56
+ local = next;
57
+ const updatedAt = Date.now();
58
+ cache && (cache.uat = updatedAt, cache.jwks = json), jwksTimestamp = updatedAt, appliedSequence = sequence;
59
+ }).finally(() => {
60
+ pendingFetch === current && (pendingFetch = void 0);
61
+ });
58
62
  }
59
- const timeoutDuration = typeof timeoutOption === 'number' ? timeoutOption : 5000;
60
- const cooldownDuration = validateDuration(opts.cooldownDuration, 30000, 'cooldownDuration');
61
- const cacheMaxAge = validateDuration(opts.cacheMaxAge, 600000, 'cacheMaxAge');
62
- const headers = new Headers(opts.headers);
63
- if (USER_AGENT && !headers.has('User-Agent')) {
64
- headers.set('User-Agent', USER_AGENT);
65
- }
66
- if (!headers.has('accept')) {
67
- headers.set('accept', 'application/json, application/jwk-set+json');
63
+ await pendingFetch;
64
+ };
65
+ return Object.defineProperties(async (protectedHeader, token) => {
66
+ (!local || !isFreshFor(jwksTimestamp, cacheMaxAge)) && await reload();
67
+ try {
68
+ return await local(protectedHeader, token);
69
+ } catch (err) {
70
+ if (err instanceof JWKSNoMatchingKey && !isFreshFor(jwksTimestamp, cooldownDuration))
71
+ return await reload(), local(protectedHeader, token);
72
+ throw err;
68
73
  }
69
- const fetchImpl = opts[customFetch];
70
- const cache = opts[jwksCache];
71
- let jwksTimestamp;
72
- let pendingFetch;
73
- let reloadSequence = 0;
74
- let appliedSequence = 0;
75
- let local;
76
- if (cache && typeof cache === 'object') {
77
- const { uat, jwks } = cache;
78
- if (isFreshFor(uat, cacheMaxAge) && isJwkSet(jwks)) {
79
- jwksTimestamp = uat;
80
- local = createLocalJWKSet(jwks);
81
- }
74
+ }, {
75
+ coolingDown: {
76
+ get: () => isFreshFor(jwksTimestamp, cooldownDuration),
77
+ enumerable: !0
78
+ },
79
+ fresh: {
80
+ get: () => isFreshFor(jwksTimestamp, cacheMaxAge),
81
+ enumerable: !0
82
+ },
83
+ reload: {
84
+ value: reload,
85
+ enumerable: !0
86
+ },
87
+ reloading: {
88
+ get: () => !!pendingFetch,
89
+ enumerable: !0
90
+ },
91
+ jwks: {
92
+ value: () => local?.jwks(),
93
+ enumerable: !0
82
94
  }
83
- const reload = async () => {
84
- if (pendingFetch && isCloudflareWorkers()) {
85
- pendingFetch = undefined;
86
- }
87
- if (!pendingFetch) {
88
- const sequence = ++reloadSequence;
89
- const current = (pendingFetch = fetchJwks(href, headers, AbortSignal.timeout(timeoutDuration), fetchImpl)
90
- .then((json) => {
91
- const next = createLocalJWKSet(json);
92
- if (sequence <= appliedSequence) {
93
- return;
94
- }
95
- local = next;
96
- const updatedAt = Date.now();
97
- if (cache) {
98
- cache.uat = updatedAt;
99
- cache.jwks = json;
100
- }
101
- jwksTimestamp = updatedAt;
102
- appliedSequence = sequence;
103
- })
104
- .finally(() => {
105
- if (pendingFetch === current) {
106
- pendingFetch = undefined;
107
- }
108
- }));
109
- }
110
- await pendingFetch;
111
- };
112
- const remoteJWKSet = async (protectedHeader, token) => {
113
- if (!local || !isFreshFor(jwksTimestamp, cacheMaxAge)) {
114
- await reload();
115
- }
116
- try {
117
- return await local(protectedHeader, token);
118
- }
119
- catch (err) {
120
- if (err instanceof JWKSNoMatchingKey && !isFreshFor(jwksTimestamp, cooldownDuration)) {
121
- await reload();
122
- return local(protectedHeader, token);
123
- }
124
- throw err;
125
- }
126
- };
127
- return Object.defineProperties(remoteJWKSet, {
128
- coolingDown: {
129
- get: () => isFreshFor(jwksTimestamp, cooldownDuration),
130
- enumerable: true,
131
- },
132
- fresh: {
133
- get: () => isFreshFor(jwksTimestamp, cacheMaxAge),
134
- enumerable: true,
135
- },
136
- reload: {
137
- value: reload,
138
- enumerable: true,
139
- },
140
- reloading: {
141
- get: () => !!pendingFetch,
142
- enumerable: true,
143
- },
144
- jwks: {
145
- value: () => local?.jwks(),
146
- enumerable: true,
147
- },
148
- });
95
+ });
149
96
  }
97
+ export {
98
+ createRemoteJWKSet,
99
+ customFetch,
100
+ jwksCache
101
+ };
@@ -1,22 +1,20 @@
1
- import { createCompactSignature } from '../../lib/jws_sign.js';
2
- import { assertNotSet } from '../../lib/helpers.js';
3
- export class CompactSign {
4
- #payload;
5
- #protectedHeader;
6
- constructor(payload) {
7
- if (!(payload instanceof Uint8Array)) {
8
- throw new TypeError('payload must be an instance of Uint8Array');
9
- }
10
- this.#payload = payload;
11
- }
12
- setProtectedHeader(protectedHeader) {
13
- assertNotSet(this.#protectedHeader, 'setProtectedHeader');
14
- this.#protectedHeader = protectedHeader;
15
- return this;
16
- }
17
- async sign(key, options) {
18
- return createCompactSignature(this.#payload, this.#protectedHeader, options?.crit, key, () => {
19
- throw new TypeError('use the flattened module for creating JWS with b64: false');
20
- });
21
- }
1
+ import { createCompactSignature } from "../../lib/jws_sign.js";
2
+ import { assertNotSet, assertUint8Array } from "../../lib/validate.js";
3
+ class CompactSign {
4
+ #payload;
5
+ #protectedHeader;
6
+ constructor(payload) {
7
+ assertUint8Array(payload, "payload"), this.#payload = payload;
8
+ }
9
+ setProtectedHeader(protectedHeader) {
10
+ return assertNotSet(this.#protectedHeader, "setProtectedHeader"), this.#protectedHeader = protectedHeader, this;
11
+ }
12
+ async sign(key, options) {
13
+ return createCompactSignature(this.#payload, this.#protectedHeader, options?.crit, key, () => {
14
+ throw new TypeError("use the flattened module for creating JWS with b64: false");
15
+ });
16
+ }
22
17
  }
18
+ export {
19
+ CompactSign
20
+ };
@@ -1,9 +1,8 @@
1
- import { prepareVerify, verifyCompact } from '../../lib/jws_verify.js';
2
- export async function compactVerify(jws, key, options) {
3
- const verified = await verifyCompact(jws, prepareVerify(options), key);
4
- const result = { payload: verified[0], protectedHeader: verified[1] };
5
- if (typeof key === 'function') {
6
- return { ...result, key: verified[3] };
7
- }
8
- return result;
1
+ import { prepareVerify, verifyCompact } from "../../lib/jws_verify.js";
2
+ async function compactVerify(jws, key, options) {
3
+ const [result] = await verifyCompact(jws, prepareVerify(options), key);
4
+ return result;
9
5
  }
6
+ export {
7
+ compactVerify
8
+ };
@@ -1,32 +1,23 @@
1
- import { createSignature } from '../../lib/jws_sign.js';
2
- import { assertNotSet } from '../../lib/helpers.js';
3
- export class FlattenedSign {
4
- #payload;
5
- #protectedHeader;
6
- #unprotectedHeader;
7
- constructor(payload) {
8
- if (!(payload instanceof Uint8Array)) {
9
- throw new TypeError('payload must be an instance of Uint8Array');
10
- }
11
- this.#payload = payload;
12
- }
13
- setProtectedHeader(protectedHeader) {
14
- assertNotSet(this.#protectedHeader, 'setProtectedHeader');
15
- this.#protectedHeader = protectedHeader;
16
- return this;
17
- }
18
- setUnprotectedHeader(unprotectedHeader) {
19
- assertNotSet(this.#unprotectedHeader, 'setUnprotectedHeader');
20
- this.#unprotectedHeader = unprotectedHeader;
21
- return this;
22
- }
23
- async sign(key, options) {
24
- const [jws] = await createSignature({
25
- payload: this.#payload,
26
- protectedHeader: this.#protectedHeader,
27
- unprotectedHeader: this.#unprotectedHeader,
28
- crit: options?.crit,
29
- }, key);
30
- return jws;
31
- }
1
+ import { createSignature } from "../../lib/jws_sign.js";
2
+ import { assertNotSet, assertUint8Array } from "../../lib/validate.js";
3
+ class FlattenedSign {
4
+ #input;
5
+ constructor(payload) {
6
+ assertUint8Array(payload, "payload"), this.#input = [payload];
7
+ }
8
+ setProtectedHeader(protectedHeader) {
9
+ return assertNotSet(this.#input[1], "setProtectedHeader"), this.#input[1] = protectedHeader, this;
10
+ }
11
+ setUnprotectedHeader(unprotectedHeader) {
12
+ return assertNotSet(this.#input[2], "setUnprotectedHeader"), this.#input[2] = unprotectedHeader, this;
13
+ }
14
+ async sign(key, options) {
15
+ const input = [...this.#input];
16
+ input[3] = options?.crit;
17
+ const [jws] = await createSignature(input, key);
18
+ return jws;
19
+ }
32
20
  }
21
+ export {
22
+ FlattenedSign
23
+ };
@@ -1,25 +1,12 @@
1
- import { JWSInvalid } from '../../util/errors.js';
2
- import { isObject } from '../../lib/type_checks.js';
3
- import { encodeJsonUnencodedPayload, prepareVerify, snapshotJws, verifySignature, verifyResult, } from '../../lib/jws_verify.js';
4
- export async function flattenedVerify(jws, key, options) {
5
- if (!isObject(jws)) {
6
- throw new JWSInvalid('Flattened JWS must be an object');
7
- }
8
- const snapshot = snapshotJws(jws);
9
- if (snapshot.protected === undefined && snapshot.header === undefined) {
10
- throw new JWSInvalid('Flattened JWS must have either of the "protected" or "header" members');
11
- }
12
- if (snapshot.protected !== undefined && typeof snapshot.protected !== 'string') {
13
- throw new JWSInvalid('JWS Protected Header incorrect type');
14
- }
15
- if (snapshot.payload === undefined) {
16
- throw new JWSInvalid('JWS Payload missing');
17
- }
18
- if (typeof snapshot.signature !== 'string') {
19
- throw new JWSInvalid('JWS Signature missing or incorrect type');
20
- }
21
- if (snapshot.header !== undefined && !isObject(snapshot.header)) {
22
- throw new JWSInvalid('JWS Unprotected Header incorrect type');
23
- }
24
- return verifyResult(snapshot, await verifySignature(snapshot, prepareVerify(options), key, encodeJsonUnencodedPayload));
1
+ import { JWSInvalid } from "../../util/errors.js";
2
+ import { isObject } from "../../lib/validate.js";
3
+ import { encodeJsonUnencodedPayload, prepareVerify, snapshotJws, verifySignature } from "../../lib/jws_verify.js";
4
+ async function flattenedVerify(jws, key, options) {
5
+ if (!isObject(jws))
6
+ throw new JWSInvalid("Flattened JWS must be an object");
7
+ const snapshot = snapshotJws(jws), [result] = await verifySignature(snapshot, prepareVerify(options), key, encodeJsonUnencodedPayload);
8
+ return result;
25
9
  }
10
+ export {
11
+ flattenedVerify
12
+ };
@@ -1,76 +1,58 @@
1
- import { createSignature } from '../../lib/jws_sign.js';
2
- import { JWSInvalid } from '../../util/errors.js';
3
- import { assertNotSet } from '../../lib/helpers.js';
1
+ import { createSignature } from "../../lib/jws_sign.js";
2
+ import { JWSInvalid } from "../../util/errors.js";
3
+ import { assertNotSet, assertUint8Array } from "../../lib/validate.js";
4
4
  class IndividualSignature {
5
- #parent;
6
- state;
7
- constructor(sig, key, options) {
8
- this.#parent = sig;
9
- this.state = [undefined, undefined, key, options?.crit];
10
- }
11
- setProtectedHeader(protectedHeader) {
12
- assertNotSet(this.state[0], 'setProtectedHeader');
13
- this.state[0] = protectedHeader;
14
- return this;
15
- }
16
- setUnprotectedHeader(unprotectedHeader) {
17
- assertNotSet(this.state[1], 'setUnprotectedHeader');
18
- this.state[1] = unprotectedHeader;
19
- return this;
20
- }
21
- addSignature(...args) {
22
- return this.#parent.addSignature(...args);
23
- }
24
- sign(...args) {
25
- return this.#parent.sign(...args);
26
- }
27
- done() {
28
- return this.#parent;
29
- }
5
+ #parent;
6
+ state;
7
+ constructor(sig, key, options) {
8
+ this.#parent = sig, this.state = [void 0, void 0, key, options?.crit];
9
+ }
10
+ setProtectedHeader(protectedHeader) {
11
+ return assertNotSet(this.state[0], "setProtectedHeader"), this.state[0] = protectedHeader, this;
12
+ }
13
+ setUnprotectedHeader(unprotectedHeader) {
14
+ return assertNotSet(this.state[1], "setUnprotectedHeader"), this.state[1] = unprotectedHeader, this;
15
+ }
16
+ addSignature(...args) {
17
+ return this.#parent.addSignature(...args);
18
+ }
19
+ sign(...args) {
20
+ return this.#parent.sign(...args);
21
+ }
22
+ done() {
23
+ return this.#parent;
24
+ }
30
25
  }
31
- export class GeneralSign {
32
- #payload;
33
- #signatures = [];
34
- constructor(payload) {
35
- this.#payload = payload;
36
- }
37
- addSignature(key, options) {
38
- const signature = new IndividualSignature(this, key, options);
39
- this.#signatures.push(signature);
40
- return signature;
41
- }
42
- async sign() {
43
- if (!this.#signatures.length) {
44
- throw new JWSInvalid('at least one signature must be added');
45
- }
46
- if (!(this.#payload instanceof Uint8Array)) {
47
- throw new TypeError('payload must be an instance of Uint8Array');
48
- }
49
- const jws = {
50
- signatures: [],
51
- payload: '',
52
- };
53
- const encoded = [];
54
- let b64;
55
- for (let i = 0; i < this.#signatures.length; i++) {
56
- const signature = this.#signatures[i];
57
- const [protectedHeader, unprotectedHeader, key, crit] = signature.state;
58
- const [{ payload, ...rest }, signatureB64] = await createSignature({
59
- payload: this.#payload,
60
- protectedHeader,
61
- unprotectedHeader,
62
- crit,
63
- encoded,
64
- }, key);
65
- if (b64 === undefined) {
66
- b64 = signatureB64;
67
- jws.payload = payload;
68
- }
69
- else if (b64 !== signatureB64) {
70
- throw new JWSInvalid('inconsistent use of JWS Unencoded Payload (RFC7797)');
71
- }
72
- jws.signatures.push(rest);
73
- }
74
- return jws;
75
- }
26
+ class GeneralSign {
27
+ #payload;
28
+ #signatures = [];
29
+ constructor(payload) {
30
+ this.#payload = payload;
31
+ }
32
+ addSignature(key, options) {
33
+ const signature = new IndividualSignature(this, key, options);
34
+ return this.#signatures.push(signature), signature;
35
+ }
36
+ async sign() {
37
+ if (!this.#signatures.length)
38
+ throw new JWSInvalid("at least one signature must be added");
39
+ assertUint8Array(this.#payload, "payload");
40
+ const jws = {
41
+ signatures: [],
42
+ payload: ""
43
+ }, encoded = [];
44
+ let b64;
45
+ for (const signature of this.#signatures) {
46
+ const [protectedHeader, unprotectedHeader, key, crit] = signature.state, [{ payload, ...rest }, signatureB64] = await createSignature([this.#payload, protectedHeader, unprotectedHeader, crit, encoded], key);
47
+ if (b64 === void 0)
48
+ b64 = signatureB64, jws.payload = payload;
49
+ else if (b64 !== signatureB64)
50
+ throw new JWSInvalid("inconsistent use of JWS Unencoded Payload (RFC7797)");
51
+ jws.signatures.push(rest);
52
+ }
53
+ return jws;
54
+ }
76
55
  }
56
+ export {
57
+ GeneralSign
58
+ };