@suveren/gateway 0.7.4 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (264) hide show
  1. package/content/integrations/mollie.json +103 -28
  2. package/dist/control-plane/index.mjs +248 -58
  3. package/dist/mcp-server/http.mjs +577 -124
  4. package/dist/ui/assets/index-BFnSVa9N.js +110 -0
  5. package/dist/ui/assets/{index-CkWaRck1.css → index-BYVb_0oG.css} +1 -1
  6. package/dist/ui/index.html +2 -2
  7. package/node_modules/@hap/core/dist/index.d.mts +285 -13
  8. package/node_modules/@hap/core/dist/index.d.ts +285 -13
  9. package/node_modules/@hap/core/dist/index.js +281 -13
  10. package/node_modules/@hap/core/dist/index.mjs +266 -12
  11. package/node_modules/@hap/core/package.json +4 -2
  12. package/node_modules/@hap/core/src/did-key.ts +126 -0
  13. package/node_modules/@hap/core/src/frame.ts +115 -14
  14. package/node_modules/@hap/core/src/gatekeeper.ts +26 -0
  15. package/node_modules/@hap/core/src/identity.ts +21 -5
  16. package/node_modules/@hap/core/src/index.ts +3 -0
  17. package/node_modules/@hap/core/src/mandate.ts +207 -0
  18. package/node_modules/@hap/core/src/receipt.ts +74 -0
  19. package/node_modules/@hap/core/src/types.ts +87 -5
  20. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/lib/accept.js +54 -0
  21. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/lib/charset.js +10 -34
  22. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/lib/encoding.js +9 -30
  23. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/lib/language.js +15 -36
  24. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/lib/mediaType.js +16 -134
  25. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/node_modules/content-type/LICENSE +22 -0
  26. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/node_modules/content-type/README.md +71 -0
  27. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/node_modules/content-type/dist/index.d.ts +46 -0
  28. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/node_modules/content-type/dist/index.js +176 -0
  29. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/node_modules/content-type/dist/index.js.map +1 -0
  30. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/node_modules/content-type/package.json +52 -0
  31. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/package.json +16 -10
  32. package/node_modules/@types/node/README.md +1 -1
  33. package/node_modules/@types/node/buffer.buffer.d.ts +10 -5
  34. package/node_modules/@types/node/crypto.d.ts +2 -4
  35. package/node_modules/@types/node/dgram.d.ts +119 -4
  36. package/node_modules/@types/node/ffi.d.ts +1 -1
  37. package/node_modules/@types/node/fs/promises.d.ts +61 -65
  38. package/node_modules/@types/node/fs.d.ts +86 -76
  39. package/node_modules/@types/node/http.d.ts +17 -1
  40. package/node_modules/@types/node/http2.d.ts +12 -4
  41. package/node_modules/@types/node/index.d.ts +1 -0
  42. package/node_modules/@types/node/inspector.d.ts +2 -1
  43. package/node_modules/@types/node/net.d.ts +108 -16
  44. package/node_modules/@types/node/package.json +2 -2
  45. package/node_modules/@types/node/process.d.ts +52 -0
  46. package/node_modules/@types/node/quic.d.ts +246 -38
  47. package/node_modules/@types/node/sqlite.d.ts +6 -2
  48. package/node_modules/@types/node/stream/iter.d.ts +4 -4
  49. package/node_modules/@types/node/test.d.ts +36 -0
  50. package/node_modules/@types/node/tls.d.ts +24 -0
  51. package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +5 -0
  52. package/node_modules/@types/node/ts5.6/index.d.ts +1 -0
  53. package/node_modules/@types/node/ts5.7/index.d.ts +1 -0
  54. package/node_modules/@types/node/tty.d.ts +4 -3
  55. package/node_modules/@types/node/vfs.d.ts +210 -0
  56. package/node_modules/@types/node/vm.d.ts +1 -1
  57. package/node_modules/express-rate-limit/dist/index.cjs +6 -3
  58. package/node_modules/express-rate-limit/dist/index.d.cts +11 -0
  59. package/node_modules/express-rate-limit/dist/index.d.mts +11 -0
  60. package/node_modules/express-rate-limit/dist/index.d.ts +11 -0
  61. package/node_modules/express-rate-limit/dist/index.mjs +6 -3
  62. package/node_modules/express-rate-limit/{license.md → license} +7 -6
  63. package/node_modules/express-rate-limit/package.json +5 -5
  64. package/node_modules/express-rate-limit/readme.md +1 -0
  65. package/node_modules/fast-uri/index.js +215 -47
  66. package/node_modules/fast-uri/lib/schemes.js +9 -4
  67. package/node_modules/fast-uri/lib/utils.js +396 -92
  68. package/node_modules/fast-uri/package.json +1 -1
  69. package/node_modules/fast-uri/test/component-safe-serialization.test.js +163 -0
  70. package/node_modules/fast-uri/test/equal.test.js +31 -3
  71. package/node_modules/fast-uri/test/fixtures/uri-js-parse.json +2 -0
  72. package/node_modules/fast-uri/test/ipv6-canonical.test.js +34 -0
  73. package/node_modules/fast-uri/test/ipv6-validation.test.js +124 -0
  74. package/node_modules/fast-uri/test/malformed-percent.test.js +77 -0
  75. package/node_modules/fast-uri/test/malformed-urn.test.js +61 -0
  76. package/node_modules/fast-uri/test/parse.test.js +7 -3
  77. package/node_modules/fast-uri/test/query-fragment-normalization.test.js +33 -0
  78. package/node_modules/fast-uri/test/reserved-path-normalization.test.js +109 -0
  79. package/node_modules/fast-uri/test/scheme-validation.test.js +124 -0
  80. package/node_modules/fast-uri/test/security-normalization.test.js +101 -0
  81. package/node_modules/fast-uri/test/security.test.js +75 -3
  82. package/node_modules/fast-uri/test/urn-full-input.test.js +29 -0
  83. package/node_modules/fast-uri/test/websocket-query-preservation.test.js +24 -0
  84. package/node_modules/hono/dist/cjs/client/client.js +25 -11
  85. package/node_modules/hono/dist/cjs/client/utils.js +4 -1
  86. package/node_modules/hono/dist/cjs/context.js +4 -0
  87. package/node_modules/hono/dist/cjs/helper/accepts/accepts.js +36 -2
  88. package/node_modules/hono/dist/cjs/helper/ssg/ssg.js +1 -1
  89. package/node_modules/hono/dist/cjs/helper/ssg/utils.js +30 -10
  90. package/node_modules/hono/dist/cjs/jsx/dom/render.js +2 -0
  91. package/node_modules/hono/dist/cjs/middleware/cache/index.js +1 -1
  92. package/node_modules/hono/dist/cjs/middleware/cors/index.js +1 -1
  93. package/node_modules/hono/dist/cjs/middleware/csrf/index.js +1 -1
  94. package/node_modules/hono/dist/cjs/middleware/etag/digest.js +1 -1
  95. package/node_modules/hono/dist/cjs/middleware/etag/index.js +3 -3
  96. package/node_modules/hono/dist/cjs/middleware/pretty-json/index.js +3 -1
  97. package/node_modules/hono/dist/cjs/request.js +8 -4
  98. package/node_modules/hono/dist/cjs/router/linear-router/router.js +7 -2
  99. package/node_modules/hono/dist/cjs/router/pattern-router/router.js +3 -9
  100. package/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +10 -3
  101. package/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +47 -83
  102. package/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +2 -1
  103. package/node_modules/hono/dist/cjs/router/trie-router/node.js +46 -69
  104. package/node_modules/hono/dist/cjs/router/trie-router/router.js +3 -11
  105. package/node_modules/hono/dist/cjs/router/utils.js +27 -0
  106. package/node_modules/hono/dist/cjs/utils/body.js +15 -3
  107. package/node_modules/hono/dist/cjs/utils/cookie.js +1 -1
  108. package/node_modules/hono/dist/cjs/utils/ipaddr.js +5 -3
  109. package/node_modules/hono/dist/cjs/utils/stream.js +7 -1
  110. package/node_modules/hono/dist/cjs/utils/url.js +9 -1
  111. package/node_modules/hono/dist/client/client.js +25 -11
  112. package/node_modules/hono/dist/client/utils.js +4 -1
  113. package/node_modules/hono/dist/context.js +4 -0
  114. package/node_modules/hono/dist/helper/accepts/accepts.js +36 -2
  115. package/node_modules/hono/dist/helper/ssg/ssg.js +1 -1
  116. package/node_modules/hono/dist/helper/ssg/utils.js +30 -10
  117. package/node_modules/hono/dist/jsx/dom/render.js +2 -0
  118. package/node_modules/hono/dist/middleware/cache/index.js +1 -1
  119. package/node_modules/hono/dist/middleware/cors/index.js +1 -1
  120. package/node_modules/hono/dist/middleware/csrf/index.js +1 -1
  121. package/node_modules/hono/dist/middleware/etag/digest.js +1 -1
  122. package/node_modules/hono/dist/middleware/etag/index.js +3 -3
  123. package/node_modules/hono/dist/middleware/pretty-json/index.js +3 -1
  124. package/node_modules/hono/dist/request.js +8 -4
  125. package/node_modules/hono/dist/router/linear-router/router.js +7 -2
  126. package/node_modules/hono/dist/router/pattern-router/router.js +3 -9
  127. package/node_modules/hono/dist/router/reg-exp-router/node.js +6 -2
  128. package/node_modules/hono/dist/router/reg-exp-router/router.js +53 -84
  129. package/node_modules/hono/dist/router/reg-exp-router/trie.js +2 -1
  130. package/node_modules/hono/dist/router/trie-router/node.js +46 -69
  131. package/node_modules/hono/dist/router/trie-router/router.js +3 -11
  132. package/node_modules/hono/dist/router/utils.js +5 -0
  133. package/node_modules/hono/dist/types/context.d.ts +4 -0
  134. package/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +3 -0
  135. package/node_modules/hono/dist/types/router/trie-router/node.d.ts +1 -2
  136. package/node_modules/hono/dist/types/router/trie-router/router.d.ts +0 -1
  137. package/node_modules/hono/dist/types/router/utils.d.ts +1 -0
  138. package/node_modules/hono/dist/types/utils/url.d.ts +4 -0
  139. package/node_modules/hono/dist/utils/body.js +15 -3
  140. package/node_modules/hono/dist/utils/cookie.js +1 -1
  141. package/node_modules/hono/dist/utils/ipaddr.js +5 -3
  142. package/node_modules/hono/dist/utils/stream.js +7 -1
  143. package/node_modules/hono/dist/utils/url.js +9 -1
  144. package/node_modules/hono/package.json +1 -1
  145. package/node_modules/ip-address/README.md +92 -82
  146. package/node_modules/ip-address/dist/common.d.ts +20 -0
  147. package/node_modules/ip-address/dist/common.js +36 -0
  148. package/node_modules/ip-address/dist/common.js.map +1 -1
  149. package/node_modules/ip-address/dist/ipv4.d.ts +50 -0
  150. package/node_modules/ip-address/dist/ipv4.js +75 -0
  151. package/node_modules/ip-address/dist/ipv4.js.map +1 -1
  152. package/node_modules/ip-address/dist/ipv6.d.ts +79 -10
  153. package/node_modules/ip-address/dist/ipv6.js +120 -30
  154. package/node_modules/ip-address/dist/ipv6.js.map +1 -1
  155. package/node_modules/ip-address/dist/v4/constants.d.ts +12 -0
  156. package/node_modules/ip-address/dist/v4/constants.js +40 -1
  157. package/node_modules/ip-address/dist/v4/constants.js.map +1 -1
  158. package/node_modules/ip-address/dist/v6/constants.d.ts +14 -0
  159. package/node_modules/ip-address/dist/v6/constants.js +47 -1
  160. package/node_modules/ip-address/dist/v6/constants.js.map +1 -1
  161. package/node_modules/ip-address/package.json +1 -1
  162. package/node_modules/is-plain-object/README.md +39 -95
  163. package/node_modules/is-plain-object/dist/is-plain-object.js +0 -2
  164. package/node_modules/is-plain-object/is-plain-object.d.ts +6 -1
  165. package/node_modules/is-plain-object/package.json +8 -34
  166. package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +7 -16
  167. package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +10 -20
  168. package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +7 -16
  169. package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +16 -38
  170. package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +7 -16
  171. package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +19 -38
  172. package/node_modules/jose/dist/types/jwk/embedded.d.ts +3 -8
  173. package/node_modules/jose/dist/types/jwk/thumbprint.d.ts +5 -5
  174. package/node_modules/jose/dist/types/jwks/local.d.ts +6 -10
  175. package/node_modules/jose/dist/types/jwks/remote.d.ts +17 -28
  176. package/node_modules/jose/dist/types/jws/compact/sign.d.ts +5 -10
  177. package/node_modules/jose/dist/types/jws/compact/verify.d.ts +9 -18
  178. package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +7 -16
  179. package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +9 -18
  180. package/node_modules/jose/dist/types/jws/general/sign.d.ts +11 -21
  181. package/node_modules/jose/dist/types/jws/general/verify.d.ts +12 -21
  182. package/node_modules/jose/dist/types/jwt/decrypt.d.ts +10 -20
  183. package/node_modules/jose/dist/types/jwt/encrypt.d.ts +17 -29
  184. package/node_modules/jose/dist/types/jwt/sign.d.ts +12 -19
  185. package/node_modules/jose/dist/types/jwt/unsecured.d.ts +17 -28
  186. package/node_modules/jose/dist/types/jwt/verify.d.ts +9 -19
  187. package/node_modules/jose/dist/types/key/export.d.ts +4 -4
  188. package/node_modules/jose/dist/types/key/generate_key_pair.d.ts +6 -8
  189. package/node_modules/jose/dist/types/key/generate_secret.d.ts +4 -11
  190. package/node_modules/jose/dist/types/key/import.d.ts +10 -17
  191. package/node_modules/jose/dist/types/types.d.ts +48 -86
  192. package/node_modules/jose/dist/types/util/base64url.d.ts +2 -2
  193. package/node_modules/jose/dist/types/util/decode_jwt.d.ts +3 -10
  194. package/node_modules/jose/dist/types/util/decode_protected_header.d.ts +4 -4
  195. package/node_modules/jose/dist/types/util/errors.d.ts +26 -53
  196. package/node_modules/jose/dist/webapi/index.js +70 -32
  197. package/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +7 -8
  198. package/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +42 -26
  199. package/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +14 -10
  200. package/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +53 -71
  201. package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +38 -49
  202. package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +121 -158
  203. package/node_modules/jose/dist/webapi/jwk/embedded.js +30 -18
  204. package/node_modules/jose/dist/webapi/jwk/thumbprint.js +54 -64
  205. package/node_modules/jose/dist/webapi/jwks/local.js +49 -74
  206. package/node_modules/jose/dist/webapi/jwks/remote.js +91 -160
  207. package/node_modules/jose/dist/webapi/jws/compact/sign.js +21 -20
  208. package/node_modules/jose/dist/webapi/jws/compact/verify.js +7 -8
  209. package/node_modules/jose/dist/webapi/jws/flattened/sign.js +29 -30
  210. package/node_modules/jose/dist/webapi/jws/flattened/verify.js +21 -23
  211. package/node_modules/jose/dist/webapi/jws/general/sign.js +61 -70
  212. package/node_modules/jose/dist/webapi/jws/general/verify.js +47 -41
  213. package/node_modules/jose/dist/webapi/jwt/decrypt.js +13 -22
  214. package/node_modules/jose/dist/webapi/jwt/encrypt.js +58 -100
  215. package/node_modules/jose/dist/webapi/jwt/sign.js +18 -50
  216. package/node_modules/jose/dist/webapi/jwt/unsecured.js +34 -63
  217. package/node_modules/jose/dist/webapi/jwt/verify.js +12 -14
  218. package/node_modules/jose/dist/webapi/key/export.js +32 -37
  219. package/node_modules/jose/dist/webapi/key/generate_key_pair.js +40 -44
  220. package/node_modules/jose/dist/webapi/key/generate_secret.js +35 -39
  221. package/node_modules/jose/dist/webapi/key/import.js +52 -52
  222. package/node_modules/jose/dist/webapi/lib/asn1.js +130 -164
  223. package/node_modules/jose/dist/webapi/lib/base64.js +18 -20
  224. package/node_modules/jose/dist/webapi/lib/buffer_utils.js +34 -38
  225. package/node_modules/jose/dist/webapi/lib/content_encryption.js +79 -123
  226. package/node_modules/jose/dist/webapi/lib/crypto_key.js +24 -25
  227. package/node_modules/jose/dist/webapi/lib/deflate.js +46 -40
  228. package/node_modules/jose/dist/webapi/lib/helpers.js +40 -37
  229. package/node_modules/jose/dist/webapi/lib/invalid_key_input.js +10 -24
  230. package/node_modules/jose/dist/webapi/lib/is_key_like.js +17 -15
  231. package/node_modules/jose/dist/webapi/lib/jwe_algorithms.js +106 -93
  232. package/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +210 -176
  233. package/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +105 -107
  234. package/node_modules/jose/dist/webapi/lib/jwk_metadata.js +19 -0
  235. package/node_modules/jose/dist/webapi/lib/jwk_to_key.js +9 -16
  236. package/node_modules/jose/dist/webapi/lib/jws_algorithms.js +62 -61
  237. package/node_modules/jose/dist/webapi/lib/jws_sign.js +58 -72
  238. package/node_modules/jose/dist/webapi/lib/jws_verify.js +90 -103
  239. package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +134 -185
  240. package/node_modules/jose/dist/webapi/lib/key.js +84 -121
  241. package/node_modules/jose/dist/webapi/lib/key_algorithm.js +13 -8
  242. package/node_modules/jose/dist/webapi/lib/key_descriptor.js +8 -6
  243. package/node_modules/jose/dist/webapi/lib/key_management.js +200 -225
  244. package/node_modules/jose/dist/webapi/lib/key_options.js +8 -0
  245. package/node_modules/jose/dist/webapi/lib/options.js +57 -44
  246. package/node_modules/jose/dist/webapi/lib/signing.js +18 -22
  247. package/node_modules/jose/dist/webapi/lib/type_checks.js +28 -33
  248. package/node_modules/jose/dist/webapi/util/base64url.js +26 -35
  249. package/node_modules/jose/dist/webapi/util/decode_jwt.js +32 -31
  250. package/node_modules/jose/dist/webapi/util/decode_protected_header.js +18 -23
  251. package/node_modules/jose/dist/webapi/util/errors.js +94 -84
  252. package/node_modules/jose/package.json +17 -81
  253. package/package.json +2 -2
  254. package/profiles/calendar/0.5.profile.json +190 -0
  255. package/profiles/charge/0.5.profile.json +210 -0
  256. package/profiles/customers/0.7.profile.json +157 -0
  257. package/profiles/deploy/0.9.profile.json +176 -0
  258. package/profiles/email/0.6.profile.json +208 -0
  259. package/profiles/index.json +9 -1
  260. package/profiles/publish/0.5.profile.json +186 -0
  261. package/profiles/purchase/0.5.profile.json +231 -0
  262. package/profiles/records/0.5.profile.json +117 -0
  263. package/dist/ui/assets/index-0Q2eNytX.js +0 -110
  264. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/HISTORY.md +0 -114
@@ -1,35 +1,30 @@
1
- export function isObject(input) {
2
- if (typeof input !== 'object' ||
3
- input === null ||
4
- Object.prototype.toString.call(input) !== '[object Object]') {
5
- return false;
6
- }
7
- const prototype = Object.getPrototypeOf(input);
8
- if (prototype === null) {
9
- return true;
10
- }
11
- let proto = prototype;
12
- while (Object.getPrototypeOf(proto) !== null) {
13
- proto = Object.getPrototypeOf(proto);
14
- }
15
- return prototype === proto;
1
+ function assertUint8Array(input, label) {
2
+ if (!(input instanceof Uint8Array))
3
+ throw new TypeError(`${label} must be an instance of Uint8Array`);
16
4
  }
17
- export function isDisjoint(...headers) {
18
- const parameters = new Set();
19
- for (const header of headers) {
20
- if (!header)
21
- continue;
22
- for (const parameter of Object.keys(header)) {
23
- if (parameters.has(parameter)) {
24
- return false;
25
- }
26
- parameters.add(parameter);
27
- }
28
- }
29
- return true;
5
+ function isObject(input) {
6
+ if (typeof input != "object" || input === null || Object.prototype.toString.call(input) !== "[object Object]")
7
+ return !1;
8
+ const prototype = Object.getPrototypeOf(input);
9
+ return prototype === null || Object.getPrototypeOf(prototype) === null;
30
10
  }
31
- export const isJWK = (key) => isObject(key) && typeof key.kty === 'string';
32
- export const isPrivateJWK = (key) => key.kty !== 'oct' &&
33
- ((key.kty === 'AKP' && typeof key.priv === 'string') || typeof key.d === 'string');
34
- export const isPublicJWK = (key) => key.kty !== 'oct' && key.d === undefined && key.priv === undefined;
35
- export const isSecretJWK = (key) => key.kty === 'oct' && typeof key.k === 'string';
11
+ function isJwkSet(input) {
12
+ return isObject(input) && Array.isArray(input.keys) && Array.from(input.keys).every(isObject);
13
+ }
14
+ function isDisjoint(...headers) {
15
+ const parameters = /* @__PURE__ */ new Set();
16
+ for (const header of headers)
17
+ if (header)
18
+ for (const parameter of Object.keys(header)) {
19
+ if (parameters.has(parameter))
20
+ return !1;
21
+ parameters.add(parameter);
22
+ }
23
+ return !0;
24
+ }
25
+ export {
26
+ assertUint8Array,
27
+ isDisjoint,
28
+ isJwkSet,
29
+ isObject
30
+ };
@@ -1,39 +1,30 @@
1
- import { encoder, decoder } from '../lib/buffer_utils.js';
2
- import { encodeBase64, decodeBase64 } from '../lib/base64.js';
3
- const invalid = 'The input to be decoded is not correctly encoded.';
4
- export 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
- }
11
- catch (cause) {
12
- throw new TypeError(invalid, { cause });
13
- }
14
- }
15
- let encoded = input;
16
- if (encoded instanceof Uint8Array) {
17
- encoded = decoder.decode(encoded);
18
- }
19
- if (encoded.includes('+') || encoded.includes('/')) {
20
- throw new TypeError(invalid);
21
- }
22
- encoded = encoded.replace(/-/g, '+').replace(/_/g, '/');
1
+ import { encoder, decoder } from "../lib/buffer_utils.js";
2
+ import { encodeBase64, decodeBase64 } from "../lib/base64.js";
3
+ const invalid = "The input to be decoded is not correctly encoded.";
4
+ function decode(input) {
5
+ if (Uint8Array.fromBase64)
23
6
  try {
24
- return decodeBase64(encoded);
25
- }
26
- catch {
27
- throw new TypeError(invalid);
7
+ return Uint8Array.fromBase64(typeof input == "string" ? input : decoder.decode(input), {
8
+ alphabet: "base64url"
9
+ });
10
+ } catch (cause) {
11
+ throw new TypeError(invalid, { cause });
28
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
+ try {
18
+ return decodeBase64(encoded);
19
+ } catch {
20
+ throw new TypeError(invalid);
21
+ }
29
22
  }
30
- export function encode(input) {
31
- let unencoded = input;
32
- if (typeof unencoded === 'string') {
33
- unencoded = encoder.encode(unencoded);
34
- }
35
- if (Uint8Array.prototype.toBase64) {
36
- return unencoded.toBase64({ alphabet: 'base64url', omitPadding: true });
37
- }
38
- return encodeBase64(unencoded).replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_');
23
+ 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, "_");
39
26
  }
27
+ export {
28
+ decode,
29
+ encode
30
+ };
@@ -1,32 +1,33 @@
1
- import { decode as b64u } from './base64url.js';
2
- import { strictDecoder } from '../lib/buffer_utils.js';
3
- import { isObject } from '../lib/type_checks.js';
4
- import { JWTInvalid } from './errors.js';
5
- export function decodeJwt(jwt) {
6
- if (typeof jwt !== 'string')
7
- throw new JWTInvalid('JWTs must use Compact JWS serialization, JWT must be a string');
8
- const { 1: payload, length } = jwt.split('.');
9
- if (length === 5)
10
- throw new JWTInvalid('Only JWTs using Compact JWS serialization can be decoded');
11
- if (length !== 3)
12
- throw new JWTInvalid('Invalid JWT');
13
- if (!payload)
14
- throw new JWTInvalid('JWTs must contain a payload');
15
- let decoded;
16
- try {
17
- decoded = b64u(payload);
18
- }
19
- catch {
20
- throw new JWTInvalid('Failed to base64url decode the payload');
21
- }
22
- let result;
23
- try {
24
- result = JSON.parse(strictDecoder.decode(decoded));
25
- }
26
- catch {
27
- throw new JWTInvalid('Failed to parse the decoded payload as JSON');
28
- }
29
- if (!isObject(result))
30
- throw new JWTInvalid('Invalid JWT Claims Set');
31
- return result;
1
+ import { decode as b64u } from "./base64url.js";
2
+ import { strictDecoder } from "../lib/buffer_utils.js";
3
+ import { isObject } from "../lib/type_checks.js";
4
+ import { JWTInvalid } from "./errors.js";
5
+ function decodeJwt(jwt) {
6
+ if (typeof jwt != "string")
7
+ throw new JWTInvalid("JWTs must use Compact JWS serialization, JWT must be a string");
8
+ const { 1: payload, length } = jwt.split(".");
9
+ if (length === 5)
10
+ throw new JWTInvalid("Only JWTs using Compact JWS serialization can be decoded");
11
+ if (length !== 3)
12
+ throw new JWTInvalid("Invalid JWT");
13
+ if (!payload)
14
+ throw new JWTInvalid("JWTs must contain a payload");
15
+ let decoded;
16
+ try {
17
+ decoded = b64u(payload);
18
+ } catch {
19
+ throw new JWTInvalid("Failed to base64url decode the payload");
20
+ }
21
+ let result;
22
+ try {
23
+ result = JSON.parse(strictDecoder.decode(decoded));
24
+ } catch {
25
+ throw new JWTInvalid("Failed to parse the decoded payload as JSON");
26
+ }
27
+ if (!isObject(result))
28
+ throw new JWTInvalid("Invalid JWT Claims Set");
29
+ return result;
32
30
  }
31
+ export {
32
+ decodeJwt
33
+ };
@@ -1,24 +1,19 @@
1
- import { parseJoseHeader } from '../lib/helpers.js';
2
- export function decodeProtectedHeader(token) {
3
- let protectedB64u;
4
- if (typeof token === 'string') {
5
- const parts = token.split('.');
6
- if (parts.length === 3 || parts.length === 5) {
7
- ;
8
- [protectedB64u] = parts;
9
- }
10
- }
11
- else if (typeof token === 'object' && token) {
12
- if ('protected' in token) {
13
- protectedB64u = token.protected;
14
- }
15
- else {
16
- throw new TypeError('Token does not contain a Protected Header');
17
- }
18
- }
19
- const invalid = 'Invalid Token or Protected Header formatting';
20
- if (typeof protectedB64u !== 'string' || !protectedB64u) {
21
- throw new TypeError(invalid);
22
- }
23
- return parseJoseHeader(protectedB64u, TypeError, invalid);
1
+ import { parseJoseHeader } from "../lib/helpers.js";
2
+ function decodeProtectedHeader(token) {
3
+ let protectedB64u;
4
+ if (typeof token == "string") {
5
+ const parts = token.split(".");
6
+ (parts.length === 3 || parts.length === 5) && ([protectedB64u] = parts);
7
+ } else if (typeof token == "object" && token)
8
+ if ("protected" in token)
9
+ protectedB64u = token.protected;
10
+ else
11
+ throw new TypeError("Token does not contain a Protected Header");
12
+ const invalid = "Invalid Token or Protected Header formatting";
13
+ if (typeof protectedB64u != "string" || !protectedB64u)
14
+ throw new TypeError(invalid);
15
+ return parseJoseHeader(protectedB64u, TypeError, invalid);
24
16
  }
17
+ export {
18
+ decodeProtectedHeader
19
+ };
@@ -1,99 +1,109 @@
1
- export class JOSEError extends Error {
2
- static code = 'ERR_JOSE_GENERIC';
3
- code = 'ERR_JOSE_GENERIC';
4
- constructor(message, options) {
5
- super(message, options);
6
- this.name = this.constructor.name;
7
- Error.captureStackTrace?.(this, this.constructor);
8
- }
1
+ class JOSEError extends Error {
2
+ static code = "ERR_JOSE_GENERIC";
3
+ code = "ERR_JOSE_GENERIC";
4
+ constructor(message, options) {
5
+ super(message, options), this.name = this.constructor.name, Error.captureStackTrace?.(this, this.constructor);
6
+ }
9
7
  }
10
- export class JWTClaimValidationFailed extends JOSEError {
11
- static code = 'ERR_JWT_CLAIM_VALIDATION_FAILED';
12
- code = 'ERR_JWT_CLAIM_VALIDATION_FAILED';
13
- claim;
14
- reason;
15
- payload;
16
- constructor(message, payload, claim = 'unspecified', reason = 'unspecified') {
17
- super(message, { cause: { claim, reason, payload } });
18
- this.claim = claim;
19
- this.reason = reason;
20
- this.payload = payload;
21
- }
8
+ class JWTClaimValidationFailed extends JOSEError {
9
+ static code = "ERR_JWT_CLAIM_VALIDATION_FAILED";
10
+ code = "ERR_JWT_CLAIM_VALIDATION_FAILED";
11
+ claim;
12
+ reason;
13
+ payload;
14
+ constructor(message, payload, claim = "unspecified", reason = "unspecified") {
15
+ super(message, { cause: { claim, reason, payload } }), this.claim = claim, this.reason = reason, this.payload = payload;
16
+ }
22
17
  }
23
- export class JWTExpired extends JOSEError {
24
- static code = 'ERR_JWT_EXPIRED';
25
- code = 'ERR_JWT_EXPIRED';
26
- claim;
27
- reason;
28
- payload;
29
- constructor(message, payload, claim = 'unspecified', reason = 'unspecified') {
30
- super(message, { cause: { claim, reason, payload } });
31
- this.claim = claim;
32
- this.reason = reason;
33
- this.payload = payload;
34
- }
18
+ class JWTExpired extends JOSEError {
19
+ static code = "ERR_JWT_EXPIRED";
20
+ code = "ERR_JWT_EXPIRED";
21
+ claim;
22
+ reason;
23
+ payload;
24
+ constructor(message, payload, claim = "unspecified", reason = "unspecified") {
25
+ super(message, { cause: { claim, reason, payload } }), this.claim = claim, this.reason = reason, this.payload = payload;
26
+ }
35
27
  }
36
- export class JOSEAlgNotAllowed extends JOSEError {
37
- static code = 'ERR_JOSE_ALG_NOT_ALLOWED';
38
- code = 'ERR_JOSE_ALG_NOT_ALLOWED';
28
+ class JOSEAlgNotAllowed extends JOSEError {
29
+ static code = "ERR_JOSE_ALG_NOT_ALLOWED";
30
+ code = "ERR_JOSE_ALG_NOT_ALLOWED";
39
31
  }
40
- export class JOSENotSupported extends JOSEError {
41
- static code = 'ERR_JOSE_NOT_SUPPORTED';
42
- code = 'ERR_JOSE_NOT_SUPPORTED';
32
+ class JOSENotSupported extends JOSEError {
33
+ static code = "ERR_JOSE_NOT_SUPPORTED";
34
+ code = "ERR_JOSE_NOT_SUPPORTED";
43
35
  }
44
- export class JWEDecryptionFailed extends JOSEError {
45
- static code = 'ERR_JWE_DECRYPTION_FAILED';
46
- code = 'ERR_JWE_DECRYPTION_FAILED';
47
- constructor(message = 'decryption operation failed', options) {
48
- super(message, options);
49
- }
36
+ class JWEDecryptionFailed extends JOSEError {
37
+ static code = "ERR_JWE_DECRYPTION_FAILED";
38
+ code = "ERR_JWE_DECRYPTION_FAILED";
39
+ constructor(message = "decryption operation failed", options) {
40
+ super(message, options);
41
+ }
50
42
  }
51
- export class JWEInvalid extends JOSEError {
52
- static code = 'ERR_JWE_INVALID';
53
- code = 'ERR_JWE_INVALID';
43
+ class JWEInvalid extends JOSEError {
44
+ static code = "ERR_JWE_INVALID";
45
+ code = "ERR_JWE_INVALID";
54
46
  }
55
- export class JWSInvalid extends JOSEError {
56
- static code = 'ERR_JWS_INVALID';
57
- code = 'ERR_JWS_INVALID';
47
+ class JWSInvalid extends JOSEError {
48
+ static code = "ERR_JWS_INVALID";
49
+ code = "ERR_JWS_INVALID";
58
50
  }
59
- export class JWTInvalid extends JOSEError {
60
- static code = 'ERR_JWT_INVALID';
61
- code = 'ERR_JWT_INVALID';
51
+ class JWTInvalid extends JOSEError {
52
+ static code = "ERR_JWT_INVALID";
53
+ code = "ERR_JWT_INVALID";
62
54
  }
63
- export class JWKInvalid extends JOSEError {
64
- static code = 'ERR_JWK_INVALID';
65
- code = 'ERR_JWK_INVALID';
55
+ class JWKInvalid extends JOSEError {
56
+ static code = "ERR_JWK_INVALID";
57
+ code = "ERR_JWK_INVALID";
66
58
  }
67
- export class JWKSInvalid extends JOSEError {
68
- static code = 'ERR_JWKS_INVALID';
69
- code = 'ERR_JWKS_INVALID';
59
+ class JWKSInvalid extends JOSEError {
60
+ static code = "ERR_JWKS_INVALID";
61
+ code = "ERR_JWKS_INVALID";
70
62
  }
71
- export class JWKSNoMatchingKey extends JOSEError {
72
- static code = 'ERR_JWKS_NO_MATCHING_KEY';
73
- code = 'ERR_JWKS_NO_MATCHING_KEY';
74
- constructor(message = 'no applicable key found in the JSON Web Key Set', options) {
75
- super(message, options);
76
- }
63
+ class JWKSNoMatchingKey extends JOSEError {
64
+ static code = "ERR_JWKS_NO_MATCHING_KEY";
65
+ code = "ERR_JWKS_NO_MATCHING_KEY";
66
+ constructor(message = "no applicable key found in the JSON Web Key Set", options) {
67
+ super(message, options);
68
+ }
77
69
  }
78
- export class JWKSMultipleMatchingKeys extends JOSEError {
79
- [Symbol.asyncIterator] = async function* () { };
80
- static code = 'ERR_JWKS_MULTIPLE_MATCHING_KEYS';
81
- code = 'ERR_JWKS_MULTIPLE_MATCHING_KEYS';
82
- constructor(message = 'multiple matching keys found in the JSON Web Key Set', options) {
83
- super(message, options);
84
- }
70
+ class JWKSMultipleMatchingKeys extends JOSEError {
71
+ [Symbol.asyncIterator] = async function* () {
72
+ };
73
+ static code = "ERR_JWKS_MULTIPLE_MATCHING_KEYS";
74
+ code = "ERR_JWKS_MULTIPLE_MATCHING_KEYS";
75
+ constructor(message = "multiple matching keys found in the JSON Web Key Set", options) {
76
+ super(message, options);
77
+ }
85
78
  }
86
- export class JWKSTimeout extends JOSEError {
87
- static code = 'ERR_JWKS_TIMEOUT';
88
- code = 'ERR_JWKS_TIMEOUT';
89
- constructor(message = 'request timed out', options) {
90
- super(message, options);
91
- }
79
+ class JWKSTimeout extends JOSEError {
80
+ static code = "ERR_JWKS_TIMEOUT";
81
+ code = "ERR_JWKS_TIMEOUT";
82
+ constructor(message = "request timed out", options) {
83
+ super(message, options);
84
+ }
92
85
  }
93
- export class JWSSignatureVerificationFailed extends JOSEError {
94
- static code = 'ERR_JWS_SIGNATURE_VERIFICATION_FAILED';
95
- code = 'ERR_JWS_SIGNATURE_VERIFICATION_FAILED';
96
- constructor(message = 'signature verification failed', options) {
97
- super(message, options);
98
- }
86
+ class JWSSignatureVerificationFailed extends JOSEError {
87
+ static code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED";
88
+ code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED";
89
+ constructor(message = "signature verification failed", options) {
90
+ super(message, options);
91
+ }
99
92
  }
93
+ export {
94
+ JOSEAlgNotAllowed,
95
+ JOSEError,
96
+ JOSENotSupported,
97
+ JWEDecryptionFailed,
98
+ JWEInvalid,
99
+ JWKInvalid,
100
+ JWKSInvalid,
101
+ JWKSMultipleMatchingKeys,
102
+ JWKSNoMatchingKey,
103
+ JWKSTimeout,
104
+ JWSInvalid,
105
+ JWSSignatureVerificationFailed,
106
+ JWTClaimValidationFailed,
107
+ JWTExpired,
108
+ JWTInvalid
109
+ };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jose",
3
- "version": "6.2.8",
3
+ "version": "6.2.11",
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",
@@ -67,13 +67,9 @@
67
67
  "types": "./dist/types/index.d.ts",
68
68
  "default": "./dist/webapi/index.js"
69
69
  },
70
- "./jwk/embedded": {
71
- "types": "./dist/types/jwk/embedded.d.ts",
72
- "default": "./dist/webapi/jwk/embedded.js"
73
- },
74
- "./jwk/thumbprint": {
75
- "types": "./dist/types/jwk/thumbprint.d.ts",
76
- "default": "./dist/webapi/jwk/thumbprint.js"
70
+ "./jwk/*": {
71
+ "types": "./dist/types/jwk/*.d.ts",
72
+ "default": "./dist/webapi/jwk/*.js"
77
73
  },
78
74
  "./key/import": {
79
75
  "types": "./dist/types/key/import.d.ts",
@@ -91,89 +87,29 @@
91
87
  "types": "./dist/types/key/generate_secret.d.ts",
92
88
  "default": "./dist/webapi/key/generate_secret.js"
93
89
  },
94
- "./jwks/remote": {
95
- "types": "./dist/types/jwks/remote.d.ts",
96
- "default": "./dist/webapi/jwks/remote.js"
97
- },
98
- "./jwks/local": {
99
- "types": "./dist/types/jwks/local.d.ts",
100
- "default": "./dist/webapi/jwks/local.js"
101
- },
102
- "./jwt/sign": {
103
- "types": "./dist/types/jwt/sign.d.ts",
104
- "default": "./dist/webapi/jwt/sign.js"
105
- },
106
- "./jwt/verify": {
107
- "types": "./dist/types/jwt/verify.d.ts",
108
- "default": "./dist/webapi/jwt/verify.js"
109
- },
110
- "./jwt/encrypt": {
111
- "types": "./dist/types/jwt/encrypt.d.ts",
112
- "default": "./dist/webapi/jwt/encrypt.js"
113
- },
114
- "./jwt/decrypt": {
115
- "types": "./dist/types/jwt/decrypt.d.ts",
116
- "default": "./dist/webapi/jwt/decrypt.js"
117
- },
118
- "./jwt/unsecured": {
119
- "types": "./dist/types/jwt/unsecured.d.ts",
120
- "default": "./dist/webapi/jwt/unsecured.js"
90
+ "./jwks/*": {
91
+ "types": "./dist/types/jwks/*.d.ts",
92
+ "default": "./dist/webapi/jwks/*.js"
121
93
  },
122
94
  "./jwt/decode": {
123
95
  "types": "./dist/types/util/decode_jwt.d.ts",
124
96
  "default": "./dist/webapi/util/decode_jwt.js"
125
97
  },
98
+ "./jwt/*": {
99
+ "types": "./dist/types/jwt/*.d.ts",
100
+ "default": "./dist/webapi/jwt/*.js"
101
+ },
126
102
  "./decode/protected_header": {
127
103
  "types": "./dist/types/util/decode_protected_header.d.ts",
128
104
  "default": "./dist/webapi/util/decode_protected_header.js"
129
105
  },
130
- "./jws/compact/sign": {
131
- "types": "./dist/types/jws/compact/sign.d.ts",
132
- "default": "./dist/webapi/jws/compact/sign.js"
133
- },
134
- "./jws/compact/verify": {
135
- "types": "./dist/types/jws/compact/verify.d.ts",
136
- "default": "./dist/webapi/jws/compact/verify.js"
137
- },
138
- "./jws/flattened/sign": {
139
- "types": "./dist/types/jws/flattened/sign.d.ts",
140
- "default": "./dist/webapi/jws/flattened/sign.js"
141
- },
142
- "./jws/flattened/verify": {
143
- "types": "./dist/types/jws/flattened/verify.d.ts",
144
- "default": "./dist/webapi/jws/flattened/verify.js"
145
- },
146
- "./jws/general/sign": {
147
- "types": "./dist/types/jws/general/sign.d.ts",
148
- "default": "./dist/webapi/jws/general/sign.js"
149
- },
150
- "./jws/general/verify": {
151
- "types": "./dist/types/jws/general/verify.d.ts",
152
- "default": "./dist/webapi/jws/general/verify.js"
153
- },
154
- "./jwe/compact/encrypt": {
155
- "types": "./dist/types/jwe/compact/encrypt.d.ts",
156
- "default": "./dist/webapi/jwe/compact/encrypt.js"
157
- },
158
- "./jwe/compact/decrypt": {
159
- "types": "./dist/types/jwe/compact/decrypt.d.ts",
160
- "default": "./dist/webapi/jwe/compact/decrypt.js"
161
- },
162
- "./jwe/flattened/encrypt": {
163
- "types": "./dist/types/jwe/flattened/encrypt.d.ts",
164
- "default": "./dist/webapi/jwe/flattened/encrypt.js"
165
- },
166
- "./jwe/flattened/decrypt": {
167
- "types": "./dist/types/jwe/flattened/decrypt.d.ts",
168
- "default": "./dist/webapi/jwe/flattened/decrypt.js"
169
- },
170
- "./jwe/general/encrypt": {
171
- "types": "./dist/types/jwe/general/encrypt.d.ts",
172
- "default": "./dist/webapi/jwe/general/encrypt.js"
106
+ "./jws/*": {
107
+ "types": "./dist/types/jws/*.d.ts",
108
+ "default": "./dist/webapi/jws/*.js"
173
109
  },
174
- "./jwe/general/decrypt": {
175
- "types": "./dist/types/jwe/general/decrypt.d.ts",
176
- "default": "./dist/webapi/jwe/general/decrypt.js"
110
+ "./jwe/*": {
111
+ "types": "./dist/types/jwe/*.d.ts",
112
+ "default": "./dist/webapi/jwe/*.js"
177
113
  },
178
114
  "./errors": {
179
115
  "types": "./dist/types/util/errors.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suveren/gateway",
3
- "version": "0.7.4",
3
+ "version": "0.8.0",
4
4
  "description": "Suveren gateway — local agent gateway built in compliance with the Human Agency Protocol (HAP). Runs the UI, control plane, and MCP server in one Node process.",
5
5
  "type": "module",
6
6
  "main": "server.js",
@@ -24,7 +24,7 @@
24
24
  "node": ">=20"
25
25
  },
26
26
  "dependencies": {
27
- "@hap/core": "npm:@humanagencyp/hap-core@^0.8.4",
27
+ "@hap/core": "npm:@humanagencyp/hap-core@^0.10.0",
28
28
  "@hpke/core": "^1.9.0",
29
29
  "express": "^4.18.0",
30
30
  "http-proxy-middleware": "^3.0.0",