@abtnode/blocklet-services 1.16.43-beta-20250422-042711-c40bec75 → 1.16.43-beta-20250425-130658-8da18f4d

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 (241) hide show
  1. package/api/routes/mcp.js +60 -26
  2. package/api/routes/user-session.js +5 -5
  3. package/api/routes/user.js +2 -2
  4. package/api/services/auth/session.js +27 -36
  5. package/api/services/mcp/server.js +7 -6
  6. package/api/services/notification/queue.js +25 -4
  7. package/api/services/oauth/server.js +1 -1
  8. package/api/socket/channel/did.js +13 -7
  9. package/api/util/attach-shared-utils.js +8 -3
  10. package/dist/assets/{AdapterDayjs-DcprbhsV.js → AdapterDayjs-6a0bjomM.js} +1 -1
  11. package/dist/assets/{ArrowDropDown-BHNhtNqo.js → ArrowDropDown-DiAXbLgf.js} +1 -1
  12. package/dist/assets/{CheckCircle-C7lAzkFm.js → CheckCircle-BOBzbtP2.js} +1 -1
  13. package/dist/assets/{ChevronLeft-fcaEvvT2.js → ChevronLeft-JDNo_7RB.js} +1 -1
  14. package/dist/assets/{ChevronRight-BWcj-otI.js → ChevronRight-Cfe-QLJe.js} +1 -1
  15. package/dist/assets/{Community-BXFIKoZW.js → Community-DZCTPNMP.js} +1 -1
  16. package/dist/assets/{DeleteOutline-CMgoFNHT.js → DeleteOutline-DW9Kk9LF.js} +1 -1
  17. package/dist/assets/{Done-CkkNExgL.js → Done-CAPpWSLt.js} +1 -1
  18. package/dist/assets/{Download-B1KcU2Zd.js → Download-BFPjDYTH.js} +1 -1
  19. package/dist/assets/{Edit-C-ChSGAK.js → Edit-D6qkTeBz.js} +1 -1
  20. package/dist/assets/{EditIcon-BRKobKzh.js → EditIcon-Bi2cR-_u.js} +1 -1
  21. package/dist/assets/{Email-7cDhevM1.js → Email-Dz2Eyqu0.js} +1 -1
  22. package/dist/assets/{Error-Du9QXuYs.js → Error-SwROBcf8.js} +1 -1
  23. package/dist/assets/{ExpandLess-Cdn0T-U2.js → ExpandLess-BpA2naWp.js} +1 -1
  24. package/dist/assets/{Google-3Ox3gIL3.js → Google-C5jm8HrI.js} +1 -1
  25. package/dist/assets/{Holiday-BtexoPxk.js → Holiday-Lc6woG1j.js} +1 -1
  26. package/dist/assets/{InfoOutlined-ZIQMeu0p.js → InfoOutlined-B-fGWta1.js} +1 -1
  27. package/dist/assets/{Launch-qJWNGQwX.js → Launch-GqtcaQf1.js} +1 -1
  28. package/dist/assets/{LaunchOutlined-BVUDVgft.js → LaunchOutlined-D7W2P0hG.js} +1 -1
  29. package/dist/assets/{Location-BF9BwrVf.js → Location-B8EOY3d0.js} +1 -1
  30. package/dist/assets/{LockIcon-L5QI4AoC.js → LockIcon-fuTfhB_G.js} +1 -1
  31. package/dist/assets/{Meeting-gc3Ts6jN.js → Meeting-Epdyx36z.js} +1 -1
  32. package/dist/assets/{MoreHoriz-ByNTWUxY.js → MoreHoriz-3W8Fr_ZL.js} +1 -1
  33. package/dist/assets/{OffSick-_EZgqU01.js → OffSick-VYgugWxu.js} +1 -1
  34. package/dist/assets/{Phone-oJLFEdfI.js → Phone-KP65huHK.js} +1 -1
  35. package/dist/assets/{PlayArrow-rSzT1Thf.js → PlayArrow-Cja7S4vv.js} +1 -1
  36. package/dist/assets/{QuestionMarkCircle-Cw7EtCDd.js → QuestionMarkCircle-p6m3avKp.js} +1 -1
  37. package/dist/assets/{ServerLogo-zdbLsMaw.js → ServerLogo-Bssx1Eou.js} +1 -1
  38. package/dist/assets/{Timezone-BtCtoEo9.js → Timezone-Ce4E1Xey.js} +1 -1
  39. package/dist/assets/{TuneOutlined-BnxAi8kP.js → TuneOutlined-B3W8vgdw.js} +1 -1
  40. package/dist/assets/{ViewList-DbzNMeex.js → ViewList-BRsEAVjL.js} +1 -1
  41. package/dist/assets/{WorkingRemotely-YBya8rZT.js → WorkingRemotely-CXFJ6pz8.js} +1 -1
  42. package/dist/assets/{access-control-q2DA79L8.js → access-control-hoDAWTTL.js} +1 -1
  43. package/dist/assets/{actions-J8MFA_6y.js → actions-BPVh6JdI.js} +1 -1
  44. package/dist/assets/{add-component-core-IYRc9eac.js → add-component-core-BXXPrLkI.js} +1 -1
  45. package/dist/assets/add-resource-DSoZMbAG.js +1 -0
  46. package/dist/assets/{addon-BQEpbqTR.js → addon-CY4PNd8X.js} +1 -1
  47. package/dist/assets/{advanced-CX8tZItX.js → advanced-BV9dnonO.js} +1 -1
  48. package/dist/assets/{appearance-C5895lZP.js → appearance-DbKPqE0i.js} +1 -1
  49. package/dist/assets/ar-CmhpkjwX.js +1 -0
  50. package/dist/assets/{ar-DRtGxecv.js → ar-mN5tHF4O.js} +1 -1
  51. package/dist/assets/{audit-logs-DukS3LSM.js → audit-logs-CY7CyxpG.js} +1 -1
  52. package/dist/assets/authorize-CLUD6O4F.js +1 -0
  53. package/dist/assets/{base32--dljmFCF.js → base32-bFQC4m_a.js} +1 -1
  54. package/dist/assets/{branding-Abk6CVlX.js → branding-LKt9TBDZ.js} +1 -1
  55. package/dist/assets/{branding-Cczews7F.js → branding-psyKu6rz.js} +2 -2
  56. package/dist/assets/{bundle-avatar-DFwyxj9P.js → bundle-avatar-CNkSW5-i.js} +1 -1
  57. package/dist/assets/button-BXbVAdLT.js +1 -0
  58. package/dist/assets/{click-to-copy-CbKZyfyr.js → click-to-copy-CSwrPBKm.js} +1 -1
  59. package/dist/assets/{complete-ejUOC1cY.js → complete-B8igFASe.js} +1 -1
  60. package/dist/assets/{component-BOLQzzEI.js → component-RJz0SwId.js} +2 -2
  61. package/dist/assets/{config-Bv0DcfgY.js → config-C2EcTJzj.js} +1 -1
  62. package/dist/assets/{config-efFznM9P.js → config-CqUiFvo_.js} +1 -1
  63. package/dist/assets/{config-navigation-1cuUaRsL.js → config-navigation-D8u4Wwi0.js} +6 -6
  64. package/dist/assets/{config-space-DEku2tJv.js → config-space-BytYjhBd.js} +1 -1
  65. package/dist/assets/{confirm-miQS3Z1c.js → confirm-qekNSA6N.js} +1 -1
  66. package/dist/assets/{connect-OYujfpaQ.js → connect-BPW0KY4c.js} +1 -1
  67. package/dist/assets/connect-DZqNlu4F.js +5 -0
  68. package/dist/assets/{connect-to-C-vFK0ym.js → connect-to-BcxM4POV.js} +1 -1
  69. package/dist/assets/{content-layout-JixQ7owc.js → content-layout-BPaAeaMQ.js} +1 -1
  70. package/dist/assets/{dashboard-C9tAGBV0.js → dashboard-DrtJT0zg.js} +3 -3
  71. package/dist/assets/de-BP5gdcKp.js +7 -0
  72. package/dist/assets/de-Doy9B4I7.js +1 -0
  73. package/dist/assets/delete-confirm-DEV7zNkl.js +1 -0
  74. package/dist/assets/{did-address-DNf_-NM-.js → did-address-DZ4aPkg2.js} +1 -1
  75. package/dist/assets/domain-CcBq0Tmt.js +9 -0
  76. package/dist/assets/domain-action-card-B5PD8_Bw.js +24 -0
  77. package/dist/assets/domains-CGsSPrGB.js +1 -0
  78. package/dist/assets/dot-BE1YP292.js +7 -0
  79. package/dist/assets/{email-CBFKGDtB.js → email-BWcxSNWH.js} +1 -1
  80. package/dist/assets/{empty-spinner-Rr_2DR73.js → empty-spinner-DmDm8XzF.js} +1 -1
  81. package/dist/assets/es-CBFvWN06.js +7 -0
  82. package/dist/assets/es-CruF8tDk.js +1 -0
  83. package/dist/assets/{exchange-passport-2U7cUaM-.js → exchange-passport-Bw0lAjY5.js} +1 -1
  84. package/dist/assets/fr-Bajh_D8H.js +1 -0
  85. package/dist/assets/fr-CmHa1dCv.js +7 -0
  86. package/dist/assets/{fuel-Ctl6kh4M.js → fuel-DBFO1voi.js} +1 -1
  87. package/dist/assets/gen-access-key-BW8kZ1Xs.js +2 -0
  88. package/dist/assets/{get-safe-url-BXaepgsm.js → get-safe-url-BZgGKuU5.js} +1 -1
  89. package/dist/assets/{get-safe-url-MZ-ksvtD.js → get-safe-url-C0AtthsC.js} +1 -1
  90. package/dist/assets/hi-CWyDCXYI.js +5 -0
  91. package/dist/assets/hi-DOsApYK0.js +1 -0
  92. package/dist/assets/{home-C2Bgs4zS.js → home-CTPoo1SY.js} +1 -1
  93. package/dist/assets/id-3xH3q-wr.js +7 -0
  94. package/dist/assets/id-BderyGO5.js +1 -0
  95. package/dist/assets/{iframe-oHkt22fl.js → iframe--qNemH7W.js} +1 -1
  96. package/dist/assets/{index-DhGZEbPZ.js → index-BT0GBmWF.js} +1 -1
  97. package/dist/assets/index-BUb5Yjs_.js +224 -0
  98. package/dist/assets/{index-Hl4sXXdc.js → index-BoJFRi1m.js} +1 -1
  99. package/dist/assets/index-BtWj67HV.js +99 -0
  100. package/dist/assets/{index-DGPhY8xp.js → index-BvQykj-W.js} +2 -2
  101. package/dist/assets/{index-qcSTfn8X.js → index-C5yNf__V.js} +1 -1
  102. package/dist/assets/{index-BWx6ivvZ.js → index-CGJUebpH.js} +23 -23
  103. package/dist/assets/{index-DQc29-JM.js → index-CHbpkZwO.js} +1 -1
  104. package/dist/assets/{index-51ncOoae.js → index-COd4R-rR.js} +1 -1
  105. package/dist/assets/{index-CNpN35y4.js → index-CXuahOvP.js} +1 -1
  106. package/dist/assets/{index-BT3gX_Gs.js → index-CY6pLbAD.js} +1 -1
  107. package/dist/assets/{index-C7UL-KG1.js → index-Ci9HJ6Iv.js} +1 -1
  108. package/dist/assets/{index-GJgyTjK2.js → index-CnjT4Zv0.js} +1 -1
  109. package/dist/assets/index-D5iB7faJ.js +10 -0
  110. package/dist/assets/{index-C3XAI9I7.js → index-DKhrYmrN.js} +1 -1
  111. package/dist/assets/{index-BRXM9-_y.js → index-DLBv7Dtg.js} +1 -1
  112. package/dist/assets/{index-DHdYd4nT.js → index-DS-sLY6b.js} +3 -3
  113. package/dist/assets/{index-DHjPgdgK.js → index-Dv_p9rOk.js} +1 -1
  114. package/dist/assets/{index-ILkKQT7G.js → index-SDdS_qt8.js} +1 -1
  115. package/dist/assets/index-d728JwfZ.js +346 -0
  116. package/dist/assets/{index-B1EwWGHW.js → index-eeIdp1fF.js} +2 -2
  117. package/dist/assets/{index-CzzLOOSx.js → index-lI6b97z3.js} +2 -2
  118. package/dist/assets/{index-BiIKWZTs.js → index-u9S0L-Rf.js} +4 -4
  119. package/dist/assets/{invitation-CPSru_8S.js → invitation-DRfkSNu9.js} +5 -5
  120. package/dist/assets/{invite-DquuAqEb.js → invite-t5XgIivH.js} +1 -1
  121. package/dist/assets/{issue-passport-DW27M9Fi.js → issue-passport-Cn04_O-m.js} +1 -1
  122. package/dist/assets/{item-CdEFLc19.js → item-cpKk__48.js} +2 -2
  123. package/dist/assets/ja-99RIjwwl.js +1 -0
  124. package/dist/assets/ja-Dlm9gbED.js +7 -0
  125. package/dist/assets/ko-8oFi6wHH.js +1 -0
  126. package/dist/assets/ko-JYKwx9PY.js +7 -0
  127. package/dist/assets/{landing-page-DPD1zNWJ.js → landing-page-CaOceQxT.js} +1 -1
  128. package/dist/assets/{launch-result-message-yorrVgpQ.js → launch-result-message-C9huWJUf.js} +1 -1
  129. package/dist/assets/{layout-DBsOgAhr.js → layout-DTFm6q61.js} +1 -1
  130. package/dist/assets/{list-BNd4p4TF.js → list-CMmXasDM.js} +1 -1
  131. package/dist/assets/{list-header-BTUducS9.js → list-header-CgF1S4js.js} +1 -1
  132. package/dist/assets/localization-Bp5pyrsz.js +1 -0
  133. package/dist/assets/{log-R8TIkchf.js → log-CYW8Ap44.js} +1 -1
  134. package/dist/assets/{logger-d2Lh_KCF.js → logger-BbYYsfRo.js} +1 -1
  135. package/dist/assets/{login-Dgvm6HMJ.js → login-GHsnMk-9.js} +1 -1
  136. package/dist/assets/{login-oauth-callback-rmUYgE44.js → login-oauth-callback-B2HyhVt7.js} +1 -1
  137. package/dist/assets/{logo-uploader-Bv2ZSxJV.js → logo-uploader-ly-3UjHj.js} +3 -3
  138. package/dist/assets/{lost-passport-CiVM9B2L.js → lost-passport-BduGI9L4.js} +1 -1
  139. package/dist/assets/{open-window-D2wkW326.js → open-window-Cw3Ugf66.js} +1 -1
  140. package/dist/assets/{overview-C_fDcPQA.js → overview-C101Lhxl.js} +1 -1
  141. package/dist/assets/{page-header-C86YQnHE.js → page-header-Bk-0dymm.js} +1 -1
  142. package/dist/assets/{passport-item-C4X2VZeo.js → passport-item-BUfjEppi.js} +1 -1
  143. package/dist/assets/{permission-CbDCh9eS.js → permission-C_VicyW0.js} +1 -1
  144. package/dist/assets/{preferences-Cdzon7pe.js → preferences-C_nxZvVu.js} +1 -1
  145. package/dist/assets/{profile-embed-Dr2ZxkvM.js → profile-embed-CgXxt11D.js} +1 -1
  146. package/dist/assets/pt-BgyGyT44.js +5 -0
  147. package/dist/assets/pt-ChXuTrrd.js +1 -0
  148. package/dist/assets/publish-resource-DBfSpWOt.js +1 -0
  149. package/dist/assets/{react-beautiful-dnd.esm-kcYalw4r.js → react-beautiful-dnd.esm-kaYRX6nt.js} +1 -1
  150. package/dist/assets/{relative-time-Dkz5qmEb.js → relative-time-CuIhVa08.js} +1 -1
  151. package/dist/assets/ru-CEVWIKf9.js +5 -0
  152. package/dist/assets/ru-IkTTTY0K.js +1 -0
  153. package/dist/assets/{runtime-HBzWjxDb.js → runtime-Pqx3AapT.js} +1 -1
  154. package/dist/assets/sdk-guHRt_DC.js +1 -0
  155. package/dist/assets/{security-BFBpBlQy.js → security-BSs6l8nY.js} +4 -4
  156. package/dist/assets/{session-CdQbSkeB.js → session-BoLXmmdy.js} +1 -1
  157. package/dist/assets/setup-BK8QRxSP.js +19 -0
  158. package/dist/assets/{shorten-label-Dz7RgJfj.js → shorten-label-DFzv9EKX.js} +1 -1
  159. package/dist/assets/{simple-select-BlUQXxNL.js → simple-select-DlrdVbaI.js} +1 -1
  160. package/dist/assets/{slicedToArray-lOWXD6Th.js → slicedToArray-CPl5_eGD.js} +1 -1
  161. package/dist/assets/{spaces-CcTi9vap.js → spaces-FInvGagn.js} +1 -1
  162. package/dist/assets/{start-BitVK7fH.js → start-e5k6uJu1.js} +1 -1
  163. package/dist/assets/{status-F7OR8ZWk.js → status-uX3_TUfC.js} +1 -1
  164. package/dist/assets/{step-actions-Cmh5n2jE.js → step-actions-5JhpbsMf.js} +1 -1
  165. package/dist/assets/{studio-CW2bLcBh.js → studio-gQoPFCFH.js} +1 -1
  166. package/dist/assets/{switch-control-BjOmRKBW.js → switch-control-1DAS0xgi.js} +1 -1
  167. package/dist/assets/th-OF8xr--T.js +1 -0
  168. package/dist/assets/th-y94pKVk7.js +5 -0
  169. package/dist/assets/{traffic-CcfffSvS.js → traffic-CLSnYOIK.js} +1 -1
  170. package/dist/assets/{transfer-DHcMO-R4.js → transfer-Dh9v20QV.js} +1 -1
  171. package/dist/assets/{unsubscribe-DnPmucfC.js → unsubscribe-BiCDicGU.js} +1 -1
  172. package/dist/assets/{use-app-logo-DnfizCGM.js → use-app-logo-Cc5WhrJy.js} +1 -1
  173. package/dist/assets/{use-mobile-Bgy7gTTP.js → use-mobile-C_flBrm-.js} +1 -1
  174. package/dist/assets/{use-mobile-CcdVxg80.js → use-mobile-DlKplWTG.js} +1 -1
  175. package/dist/assets/useAsync-CGW40D2-.js +1 -0
  176. package/dist/assets/{useLocalStorage-BJb7uGDO.js → useLocalStorage-BxIzITf9.js} +1 -1
  177. package/dist/assets/{user-center-u43jJYr4.js → user-center-1qavaXbB.js} +1 -1
  178. package/dist/assets/{util-CJbxj6IE.js → util-BrciyiqD.js} +1 -1
  179. package/dist/assets/util-Ce3AQBfV.js +1 -0
  180. package/dist/assets/{vendor-arcblock-CWji6U03.js → vendor-arcblock-BUng-RXZ.js} +5 -5
  181. package/dist/assets/{vendor-mui-core-CfA4EdRA.js → vendor-mui-core-CQ38ohp2.js} +22 -22
  182. package/dist/assets/{vendor-mui-x-DSNWmGVo.js → vendor-mui-x-B0hsmEJ3.js} +1 -1
  183. package/dist/assets/{vendor-ux-did-connect-zBIy2ulO.js → vendor-ux-did-connect-CsNUdA6Y.js} +5 -5
  184. package/dist/assets/vi-DCBJBc4G.js +1 -0
  185. package/dist/assets/vi-Dw7W2UPp.js +5 -0
  186. package/dist/assets/wrap-locale-Bc5OA7-R.js +1 -0
  187. package/dist/assets/{zh-_GYrLCB8.js → zh-BRAYg0sY.js} +1 -1
  188. package/dist/assets/{zh-CY9wasmC.js → zh-Dag6w2Z7.js} +1 -1
  189. package/dist/assets/zh-tw-CMYkmBeh.js +7 -0
  190. package/dist/assets/zh-tw-D5-DkgwC.js +1 -0
  191. package/dist/index.html +4 -4
  192. package/dist/service-worker.js +1 -1
  193. package/package.json +45 -45
  194. package/dist/assets/LoadingButton-D_tuQuaP.js +0 -1
  195. package/dist/assets/add-resource-8w2aCwfA.js +0 -1
  196. package/dist/assets/ar-BUQWR0Zu.js +0 -1
  197. package/dist/assets/authorize-CEHLfOxJ.js +0 -1
  198. package/dist/assets/button-CJk6Iiza.js +0 -1
  199. package/dist/assets/connect-0B3z_kZV.js +0 -5
  200. package/dist/assets/de-BZDWXY3K.js +0 -7
  201. package/dist/assets/de-_X0eQXZu.js +0 -1
  202. package/dist/assets/delete-confirm-kKb8VxbQ.js +0 -1
  203. package/dist/assets/domain-RAN90v9n.js +0 -9
  204. package/dist/assets/domain-action-card-BNybk5kq.js +0 -25
  205. package/dist/assets/domains-B51g2OQM.js +0 -1
  206. package/dist/assets/dot-xwsgXXMo.js +0 -7
  207. package/dist/assets/es-kQ6jQG-H.js +0 -7
  208. package/dist/assets/es-yHIDSG5r.js +0 -1
  209. package/dist/assets/fr-Bf3jz4q5.js +0 -7
  210. package/dist/assets/fr-D6i3bCqR.js +0 -1
  211. package/dist/assets/gen-access-key-CIrRotRy.js +0 -2
  212. package/dist/assets/hi-ChVLDWm_.js +0 -1
  213. package/dist/assets/hi-DPdbGXyy.js +0 -5
  214. package/dist/assets/id-BqmT-cL5.js +0 -7
  215. package/dist/assets/id-D6XXuY_a.js +0 -1
  216. package/dist/assets/index-B1-S-x6B.js +0 -346
  217. package/dist/assets/index-BaU0U5xc.js +0 -224
  218. package/dist/assets/index-CILVFQJH.js +0 -92
  219. package/dist/assets/index-Ds7z-vG7.js +0 -10
  220. package/dist/assets/ja-CyUU4_H1.js +0 -7
  221. package/dist/assets/ja-DKZCt8Yp.js +0 -1
  222. package/dist/assets/ko-B0uE9AyQ.js +0 -1
  223. package/dist/assets/ko-DWTxutv1.js +0 -7
  224. package/dist/assets/localization-CS7BsCef.js +0 -1
  225. package/dist/assets/pt-BcsDG9H6.js +0 -5
  226. package/dist/assets/pt-DCzE4kPq.js +0 -1
  227. package/dist/assets/publish-resource-DumHfLtC.js +0 -1
  228. package/dist/assets/ru-B9yj9TuE.js +0 -1
  229. package/dist/assets/ru-BwH1q1F1.js +0 -5
  230. package/dist/assets/sdk-DuZx5LYY.js +0 -1
  231. package/dist/assets/setup-BSfklNq4.js +0 -19
  232. package/dist/assets/th-CNztcQMJ.js +0 -5
  233. package/dist/assets/th-et0IV3ES.js +0 -1
  234. package/dist/assets/useAsync-70zHrUMr.js +0 -1
  235. package/dist/assets/useAsync-BquSRC77.js +0 -1
  236. package/dist/assets/util-BYLEVYA_.js +0 -1
  237. package/dist/assets/vi-Bpl5HEj4.js +0 -5
  238. package/dist/assets/vi-LBvVt_pj.js +0 -1
  239. package/dist/assets/wrap-locale-BSYWBgCo.js +0 -1
  240. package/dist/assets/zh-tw-D6qZTlL3.js +0 -7
  241. package/dist/assets/zh-tw-l3XXo5aT.js +0 -1
package/api/routes/mcp.js CHANGED
@@ -4,16 +4,28 @@ const get = require('lodash/get');
4
4
  const getBlockletInfo = require('@blocklet/meta/lib/info');
5
5
  const { checkPublicAccess } = require('@blocklet/meta/lib/util');
6
6
  // eslint-disable-next-line import/no-unresolved
7
- const { SSEServerTransport } = require('@blocklet/mcp/server/sse.js');
7
+ const { StreamableHTTPServerTransport } = require('@blocklet/mcp/server/streamableHttp.js');
8
8
 
9
9
  const { initMcpServer } = require('../services/mcp/server');
10
10
  const logger = require('../libs/logger')('mcp:server:routes');
11
11
 
12
12
  const isMCPSupported = (b) => get(b.meta, 'capabilities.mcp', false);
13
13
 
14
+ const transport = new StreamableHTTPServerTransport({
15
+ sessionIdGenerator: undefined, // set to undefined for stateless servers
16
+ });
17
+
14
18
  module.exports = {
15
19
  init(server, node) {
16
20
  const mcpServer = initMcpServer(node);
21
+ mcpServer
22
+ .connect(transport)
23
+ .then(() => {
24
+ logger.info('MCP server connected to streamableHttp transport');
25
+ })
26
+ .catch((err) => {
27
+ logger.error('Failed to connect MCP server to streamableHttp transport', err);
28
+ });
17
29
 
18
30
  // Return all MCP servers
19
31
  server.get(joinURL(WELLKNOWN_SERVICE_PATH_PREFIX, '/mcp/servers'), async (req, res) => {
@@ -30,7 +42,7 @@ module.exports = {
30
42
  did: blocklet.appDid,
31
43
  name: info.name,
32
44
  description: info.description,
33
- endpoint: joinURL(info.appUrl, WELLKNOWN_SERVICE_PATH_PREFIX, '/mcp/sse'),
45
+ endpoint: joinURL(info.appUrl, WELLKNOWN_SERVICE_PATH_PREFIX, '/mcp'),
34
46
  protected: !checkPublicAccess(securityConfig),
35
47
  version: info.version,
36
48
  logo: joinURL(baseUrl, '/logo'),
@@ -44,7 +56,7 @@ module.exports = {
44
56
  did: `${blocklet.appDid}/${x.meta.did}`,
45
57
  name: x.meta.title,
46
58
  description: x.meta.description,
47
- endpoint: joinURL(info.appUrl, x.mountPoint, '/mcp/sse'),
59
+ endpoint: joinURL(info.appUrl, x.mountPoint, '/mcp'),
48
60
  protected: !checkPublicAccess(securityConfig),
49
61
  version: x.meta.version,
50
62
  logo: joinURL(baseUrl, `/logo-bundle/${x.meta.did}?v=${info.version}`),
@@ -60,10 +72,7 @@ module.exports = {
60
72
  });
61
73
 
62
74
  // Serve Service MCP server
63
-
64
- // to support multiple simultaneous connections we have a lookup object from sessionId to transport
65
- const transports = {};
66
- server.get(joinURL(WELLKNOWN_SERVICE_PATH_PREFIX, '/mcp/sse'), async (req, res) => {
75
+ server.get(joinURL(WELLKNOWN_SERVICE_PATH_PREFIX, '/mcp'), (req, res) => {
67
76
  if (!req.user) {
68
77
  res.status(401).json({ error: 'Unauthorized' });
69
78
  return;
@@ -72,29 +81,54 @@ module.exports = {
72
81
  // Set required headers for SSE
73
82
  res.header('X-Accel-Buffering', 'no');
74
83
 
75
- const transport = new SSEServerTransport(joinURL(WELLKNOWN_SERVICE_PATH_PREFIX, '/mcp/messages'), res);
76
- transport.authContext = Object.assign({ user: req.user || {} }, { blockletDid: req.getBlockletDid() });
77
- const { sessionId } = transport;
78
- transports[sessionId] = transport;
79
- logger.debug('Client connected', sessionId);
80
- res.on('close', () => {
81
- logger.debug('Client Disconnected', sessionId);
82
- delete transports[sessionId];
83
- });
84
- await mcpServer.connect(transport);
84
+ res.writeHead(405).end(
85
+ JSON.stringify({
86
+ jsonrpc: '2.0',
87
+ error: {
88
+ code: -32000,
89
+ message: 'Method not allowed.',
90
+ },
91
+ id: null,
92
+ })
93
+ );
94
+ });
95
+
96
+ server.delete(joinURL(WELLKNOWN_SERVICE_PATH_PREFIX, '/mcp'), (req, res) => {
97
+ res.writeHead(405).end(
98
+ JSON.stringify({
99
+ jsonrpc: '2.0',
100
+ error: {
101
+ code: -32000,
102
+ message: 'Method not allowed.',
103
+ },
104
+ id: null,
105
+ })
106
+ );
85
107
  });
86
108
 
87
- server.post(joinURL(WELLKNOWN_SERVICE_PATH_PREFIX, '/mcp/messages'), async (req, res) => {
88
- const { sessionId } = req.query;
89
- logger.debug('Client Message', { sessionId, body: req.body });
90
- let transport = transports[sessionId];
91
- if (!transport) {
92
- transport = new SSEServerTransport(joinURL(WELLKNOWN_SERVICE_PATH_PREFIX, '/mcp/messages'), res);
109
+ server.post(joinURL(WELLKNOWN_SERVICE_PATH_PREFIX, '/mcp'), async (req, res) => {
110
+ if (!req.user) {
111
+ res.status(401).json({ error: 'Unauthorized' });
112
+ return;
93
113
  }
94
114
 
95
- // Send the body to the transport since we have already parsed it
96
- transport.authContext = Object.assign({ user: req.user || {} }, { blockletDid: req.getBlockletDid() });
97
- await transport.handlePostMessage(req, res, req.body);
115
+ try {
116
+ logger.debug('received MCP request', { request: req.body });
117
+ req.auth = { extra: { user: req.user, blockletDid: req.getBlockletDid() } };
118
+ await transport.handleRequest(req, res, req.body);
119
+ } catch (error) {
120
+ logger.error('failed to handle MCP request', { request: req.body, error });
121
+ if (!res.headersSent) {
122
+ res.status(500).json({
123
+ jsonrpc: '2.0',
124
+ error: {
125
+ code: -32603,
126
+ message: 'Internal server error',
127
+ },
128
+ id: null,
129
+ });
130
+ }
131
+ }
98
132
  });
99
133
  },
100
134
  };
@@ -141,9 +141,9 @@ module.exports = {
141
141
  callback(null, { origin: false });
142
142
  }
143
143
  });
144
- app.options(`${prefix}/login`, ensureBlocklet(), ensureCors);
144
+ app.options(`${prefix}/login`, ensureBlocklet({ useCache: true }), ensureCors);
145
145
  // NOTE: 保留 /login 路由,该功能不是针对于某一个实体来操作的,需要更明确表达意图
146
- app.post(`${prefix}/login`, ensureBlocklet(), ensureCors, async (req, res) => {
146
+ app.post(`${prefix}/login`, ensureBlocklet({ useCache: true }), ensureCors, async (req, res) => {
147
147
  const { blocklet } = req;
148
148
  const loginUserSession = req.body;
149
149
 
@@ -342,7 +342,7 @@ module.exports = {
342
342
  }
343
343
  });
344
344
 
345
- app.get(`${prefix}/myself`, ensureBlocklet(), checkUser, async (req, res) => {
345
+ app.get(`${prefix}/myself`, ensureBlocklet({ useCache: true }), checkUser, async (req, res) => {
346
346
  const { blocklet } = req;
347
347
  const { page, pageSize, status } = req.query;
348
348
  const teamDid = blocklet.appPid;
@@ -377,8 +377,8 @@ module.exports = {
377
377
  * 1. 用户在未登录状态下,查询当前设备符合快捷登录的会话,实现快速登录
378
378
  * 2. 用户在登录状态下,查询当前设备可以使用快捷登录切换的账号
379
379
  */
380
- app.options(prefix, ensureBlocklet(), ensureCors);
381
- app.get(`${prefix}`, ensureBlocklet(), ensureCors, async (req, res) => {
380
+ app.options(prefix, ensureBlocklet({ useCache: true }), ensureCors);
381
+ app.get(`${prefix}`, ensureBlocklet({ useCache: true }), ensureCors, async (req, res) => {
382
382
  const { blocklet } = req;
383
383
  const { appPid } = blocklet;
384
384
  const teamDid = appPid;
@@ -958,7 +958,7 @@ module.exports = {
958
958
  });
959
959
 
960
960
  // public api
961
- server.get(`${prefixApi}/privacy/config`, ensureBlocklet(), async (req, res) => {
961
+ server.get(`${prefixApi}/privacy/config`, ensureBlocklet({ useCache: true }), async (req, res) => {
962
962
  const { error, value } = privacyConfigInputSchema.validate({
963
963
  userDid: req.query?.did,
964
964
  });
@@ -977,7 +977,7 @@ module.exports = {
977
977
  res.json(user?.extra?.privacy || {});
978
978
  });
979
979
 
980
- server.post(`${prefixApi}/privacy/config`, checkUser, ensureBlocklet(), async (req, res) => {
980
+ server.post(`${prefixApi}/privacy/config`, checkUser, ensureBlocklet({ useCache: true }), async (req, res) => {
981
981
  const { value, error } = privacyConfigSetSchema.validate(req.body);
982
982
  if (error) {
983
983
  res.status(400).send({ error: error.details[0].message });
@@ -3,8 +3,11 @@ const { joinURL } = require('ufo');
3
3
  const { getBlockletLanguages } = require('@blocklet/env/lib/util');
4
4
  const pick = require('lodash/pick');
5
5
  const omit = require('lodash/omit');
6
+ const omitBy = require('lodash/omitBy');
6
7
  const merge = require('lodash/merge');
7
8
  const isEqual = require('lodash/isEqual');
9
+ const isUndefined = require('lodash/isUndefined');
10
+
8
11
  const { verify, decode } = require('@arcblock/jwt');
9
12
  const {
10
13
  WELLKNOWN_SERVICE_PATH_PREFIX,
@@ -17,7 +20,7 @@ const { signResponse } = require('@blocklet/meta/lib/security');
17
20
  const getRequestIP = require('@abtnode/util/lib/get-request-ip');
18
21
  const { getDeviceData } = require('@abtnode/util/lib/device');
19
22
  const isUrl = require('is-url');
20
- const { LRUCache } = require('lru-cache');
23
+ const SingleFlightLRUCache = require('@abtnode/util/lib/single-flight-lru-cache');
21
24
  const createTranslator = require('@abtnode/util/lib/translate');
22
25
  const getOrigin = require('@abtnode/util/lib/get-origin');
23
26
 
@@ -45,26 +48,21 @@ const translations = {
45
48
 
46
49
  const t = createTranslator({ translations });
47
50
 
48
- const sessionRBACCache = new LRUCache({ max: 3000, ttl: 1000 * 30 });
49
- const unReadCountCache = new LRUCache({ max: 3000, ttl: 1000 * 5 });
51
+ const unReadCountCache = new SingleFlightLRUCache({ max: 10 * 10000, ttl: 1000 * 60 });
52
+ const signSessionResponseCache = new SingleFlightLRUCache({ max: 10000, ttl: 1000 * 60 });
50
53
 
51
- const getUnreadNotificationCount = async ({ teamDid, receiver }, node) => {
54
+ const getUnreadNotificationCount = ({ teamDid, receiver }, node) => {
52
55
  if (!node || !receiver || !teamDid) {
53
56
  return 0;
54
57
  }
55
58
 
56
59
  const cacheKey = `${teamDid}:${receiver}`;
57
- const cached = unReadCountCache.get(cacheKey);
58
- if (cached) {
59
- return cached;
60
- }
61
-
62
- const result = await node.getNotificationsUnreadCount({
63
- teamDid,
64
- receiver,
60
+ return unReadCountCache.autoCache(cacheKey, () => {
61
+ return node.getNotificationsUnreadCount({
62
+ teamDid,
63
+ receiver,
64
+ });
65
65
  });
66
- unReadCountCache.set(cacheKey, result);
67
- return result;
68
66
  };
69
67
 
70
68
  const getUpdateUserSessionData = ({ req }) => {
@@ -76,7 +74,7 @@ const getUpdateUserSessionData = ({ req }) => {
76
74
  if (!req.userSession.ua) {
77
75
  result.ua = req.get('user-agent');
78
76
  }
79
- const deviceData = getDeviceData({ req });
77
+ const deviceData = omitBy(getDeviceData({ req }), isUndefined);
80
78
  if (Object.keys(deviceData).length > 0 && !isEqual(req.userSession?.extra?.device, deviceData)) {
81
79
  result.extra = {
82
80
  ...req.userSession?.extra,
@@ -95,40 +93,30 @@ module.exports = {
95
93
  } = options;
96
94
  const createToken = createTokenFn(createSessionToken);
97
95
 
98
- // 10000 个副本,内存占用 30MB
99
96
  const handleSession = async (req, res) => {
100
97
  const teamDid = req.getBlockletDid();
101
98
  const { token } = req;
102
99
  const visitorId = req.get('x-blocklet-visitor-id');
103
100
  const { appPid = teamDid } = req.query;
104
- await req.ensureUser({ token, visitorId, appPid });
101
+
102
+ const blockletInfo = await req.getBlockletInfo();
103
+ await req.ensureUser({ token, visitorId, appPid, blockletInfo });
105
104
  if (!req.user) {
106
105
  res.json({ user: null });
107
106
  return;
108
107
  }
109
108
 
110
- const [blocklet, info, user] = await Promise.all([
111
- req.getBlocklet(),
112
- req.getBlockletInfo(),
109
+ const [blocklet, user] = await Promise.all([
110
+ req.getBlocklet({ useCache: true }),
113
111
  node.getUser({ teamDid, user: { did: req.user.did } }),
114
112
  ]);
115
113
 
116
114
  // FIXME: this code have performance issue
117
115
  if (req.user.role) {
118
- const rbacSessionKey = `rbac:${teamDid}:${req.user.role}`;
119
- const cached = sessionRBACCache.get(rbacSessionKey);
120
- if (cached) {
121
- user.role = req.user.role;
122
- user.permissions = cached.permissions;
123
- } else {
124
- const rbac = await node.getRBAC(teamDid);
125
- const permissions = await rbac.getScope(req.user.role);
126
- user.role = req.user.role;
127
- user.permissions = permissions;
128
- sessionRBACCache.set(rbacSessionKey, {
129
- permissions,
130
- });
131
- }
116
+ const rbac = await node.getRBAC(teamDid);
117
+ const permissions = await rbac.getScope(req.user.role);
118
+ user.role = req.user.role;
119
+ user.permissions = permissions;
132
120
  }
133
121
 
134
122
  if (user.avatar && user.avatar.startsWith(USER_AVATAR_URL_PREFIX)) {
@@ -157,7 +145,7 @@ module.exports = {
157
145
  extra: req.userSession.extra,
158
146
  ...updateUserSessionData,
159
147
  locale: req.blockletLocale,
160
- origin: await getOrigin({ req }),
148
+ origin: await getOrigin({ req, blockletInfo }),
161
149
  });
162
150
  if (user?.sourceAppPid) {
163
151
  node.syncUserSession({
@@ -185,7 +173,10 @@ module.exports = {
185
173
  walletOS: req.user.walletOS,
186
174
  };
187
175
 
188
- const result = signResponse(data, info.wallet);
176
+ const cacheKey = JSON.stringify(data);
177
+ const result = await signSessionResponseCache.autoCache(cacheKey, () => {
178
+ return signResponse(data, blockletInfo.wallet);
179
+ });
189
180
  res.json(result);
190
181
  };
191
182
 
@@ -108,12 +108,13 @@ function checkPermissions(context, policy) {
108
108
  }
109
109
 
110
110
  function wrapToolHandler(handler, policy) {
111
- return async (extra) => {
112
- const hasPermission = await checkPermissions(extra.authContext, policy);
111
+ return async (...input) => {
112
+ const extra = input[input.length - 1];
113
+ const hasPermission = await checkPermissions(extra.authInfo?.extra || {}, policy);
113
114
  if (!hasPermission) {
114
115
  throw new Error('Unauthorized');
115
116
  }
116
- return handler(extra);
117
+ return handler(...input);
117
118
  };
118
119
  }
119
120
 
@@ -127,11 +128,11 @@ function initMcpServer(node) {
127
128
  server,
128
129
  wrapToolHandler(
129
130
  async (extra) => {
130
- if (!extra?.authContext?.blockletDid) {
131
+ if (!extra?.authInfo?.extra?.blockletDid) {
131
132
  throw new Error('blockletDid is required');
132
133
  }
133
134
 
134
- const blocklet = await node.getBlocklet({ did: extra.authContext.blockletDid, useCache: true });
135
+ const blocklet = await node.getBlocklet({ did: extra.authInfo?.extra?.blockletDid, useCache: true });
135
136
  if (!blocklet) {
136
137
  throw new Error('blocklet not found');
137
138
  }
@@ -140,7 +141,7 @@ function initMcpServer(node) {
140
141
  },
141
142
  {
142
143
  allow: {
143
- roles: ['owner', 'admin'],
144
+ roles: ['owner', 'admin', 'member'],
144
145
  },
145
146
  }
146
147
  )
@@ -80,7 +80,7 @@ const init = ({ node, notificationService }) => {
80
80
  pushOnly: job.pushOnly,
81
81
  });
82
82
  } catch (error) {
83
- logger.error('Failed to send to app', { error });
83
+ logger.error('Failed to send to app', { notificationId: job.notification.id, error });
84
84
  }
85
85
  }
86
86
  );
@@ -104,7 +104,7 @@ const init = ({ node, notificationService }) => {
104
104
  pushOnly: job.pushOnly,
105
105
  });
106
106
  } catch (error) {
107
- logger.error('Failed to send to push', { error });
107
+ logger.error('Failed to send to push', { notificationId: job.notification.id, error });
108
108
  }
109
109
  });
110
110
 
@@ -176,7 +176,7 @@ const init = ({ node, notificationService }) => {
176
176
  pushOnly: input.pushOnly,
177
177
  });
178
178
  } catch (error) {
179
- logger.error('Failed to send to email', { error });
179
+ logger.error('Failed to send to email', { notificationId: job.notificationId, error });
180
180
  }
181
181
  }
182
182
  );
@@ -226,7 +226,7 @@ const init = ({ node, notificationService }) => {
226
226
  pushOnly: input.pushOnly,
227
227
  });
228
228
  } catch (error) {
229
- logger.error('Failed to send to webhook', { error });
229
+ logger.error('Failed to send to webhook', { url: job.url, notificationId: job.notification.id, error });
230
230
  }
231
231
  }
232
232
  );
@@ -301,6 +301,10 @@ const init = ({ node, notificationService }) => {
301
301
  fullName: userInfo.fullName,
302
302
  };
303
303
  // 这里可以根据 email 获取到需要发送的 userInfo 和 receivers
304
+ logger.info('Insert to email push queue', {
305
+ notificationId: notification.id,
306
+ receiver: receiverDid,
307
+ });
304
308
  emailPushQueue.push({
305
309
  job: {
306
310
  email,
@@ -358,6 +362,11 @@ const init = ({ node, notificationService }) => {
358
362
  if (webhookList.length > 0 && channels.includes(NOTIFICATION_SEND_CHANNEL.WEBHOOK)) {
359
363
  for (const webhook of webhookList) {
360
364
  const { url, type } = webhook;
365
+ logger.info('Insert to webhook push queue', {
366
+ notificationId: notification.id,
367
+ receiver: receiverDid,
368
+ url,
369
+ });
361
370
  webhookQueue.push({
362
371
  job: {
363
372
  url,
@@ -415,6 +424,10 @@ const init = ({ node, notificationService }) => {
415
424
  };
416
425
  const pushEnabled = get(userInfo, 'extra.notifications.push', true);
417
426
  if (pushEnabled && channels.includes(NOTIFICATION_SEND_CHANNEL.PUSH)) {
427
+ logger.info('Insert to push kit push queue', {
428
+ notificationId: notification.id,
429
+ receiver: receiverDid,
430
+ });
418
431
  pushKitPushQueue.push({
419
432
  notification,
420
433
  sender,
@@ -452,6 +465,10 @@ const init = ({ node, notificationService }) => {
452
465
 
453
466
  const walletEnabled = get(userInfo, 'extra.notifications.wallet', true);
454
467
  if (walletEnabled && channels.includes(NOTIFICATION_SEND_CHANNEL.WALLET)) {
468
+ logger.info('Insert to wallet push queue', {
469
+ notificationId: notification.id,
470
+ receiver: receiverDid,
471
+ });
455
472
  walletPushQueue.push({
456
473
  notification,
457
474
  sender,
@@ -534,6 +551,10 @@ const init = ({ node, notificationService }) => {
534
551
  if (!job.pushOnly) {
535
552
  // 如果添加失败,那么需要终止执行推送
536
553
  await insertToNotificationReceiver(nodeInfo, userInfo, teamDid, notification.id, channels);
554
+ logger.info('notification receiver created successfully', {
555
+ notificationId: notification.id,
556
+ receiver,
557
+ });
537
558
  // websocket 通知
538
559
  const receiverDid = getWalletDid(userInfo) || userInfo.did;
539
560
  try {
@@ -20,7 +20,7 @@ const createBlockletOAuthServerProvider = (node, options, blocklet, info) => {
20
20
  const createToken = createTokenFn(createSessionToken);
21
21
  // const hashToken = (token) => Hasher.SHA3.hash256(token);
22
22
  const generateCode = (length = 16) => crypto.randomBytes(length).toString('hex').toUpperCase();
23
- const generateTokens = async (client, userDid, scopes) => {
23
+ const generateTokens = async (client, userDid, scopes = ['profile:read']) => {
24
24
  const user = await node.getUser({
25
25
  teamDid: blocklet.appDid,
26
26
  user: { did: userDid },
@@ -1,4 +1,8 @@
1
- const { validateNotification, validateMessage } = require('@blocklet/sdk/lib/validators/notification');
1
+ const {
2
+ validateNotification,
3
+ validateMessage,
4
+ NOTIFICATION_TYPES,
5
+ } = require('@blocklet/sdk/lib/validators/notification');
2
6
  const { Joi } = require('@arcblock/validator');
3
7
  const {
4
8
  NODE_MODES,
@@ -157,10 +161,12 @@ const sendToUserDid = async ({ sender, receiver: rawDid, notification, options,
157
161
  notifications.map((_notification) => {
158
162
  // 如果类型不存在或者是 notification 类型是才进行保存数据库,其他类型只需要通知到用户即可
159
163
  // eg: type = 'passthrough', 'hi', 'connect', 'feed', 默认只需要通知 wallet
160
- const pushOnly = _notification.type && _notification.type.toLowerCase() !== 'notification';
164
+ const pushOnly = _notification.type && _notification.type.toLowerCase() !== NOTIFICATION_TYPES.NOTIFICATION;
161
165
 
162
166
  // 如果是 passthrough hi connect, 只需要通知 wallet
163
- const onlyWallet = ['passthrough', 'hi', 'connect'].includes(_notification.type?.toLowerCase());
167
+ const onlyWallet = [NOTIFICATION_TYPES.PASSTHROUGH, NOTIFICATION_TYPES.HI, NOTIFICATION_TYPES.CONNECT].includes(
168
+ _notification.type?.toLowerCase()
169
+ );
164
170
 
165
171
  return node.createNotification({
166
172
  teamDid,
@@ -440,10 +446,10 @@ const sendToMail = async ({ sender, receiver, notification, options, node, pushO
440
446
  throw new Error('Invalid notification: 1 message each time');
441
447
  }
442
448
 
443
- if (!notification.title && notification.type !== 'feed') {
449
+ if (!notification.title && ![NOTIFICATION_TYPES.FEED, NOTIFICATION_TYPES.PASSTHROUGH].includes(notification.type)) {
444
450
  throw new Error('Invalid notification: title empty');
445
451
  }
446
- if (!notification.body && notification.type !== 'feed') {
452
+ if (!notification.body && ![NOTIFICATION_TYPES.FEED, NOTIFICATION_TYPES.PASSTHROUGH].includes(notification.type)) {
447
453
  throw new Error('Invalid notification: body empty');
448
454
  }
449
455
 
@@ -514,10 +520,10 @@ const sendToPush = async ({ sender, receiver, notification, options, node, pushO
514
520
  if (Array.isArray(notification)) {
515
521
  throw new Error('Invalid notification: 1 message each time');
516
522
  }
517
- if (!notification.title && notification.type !== 'feed') {
523
+ if (!notification.title && ![NOTIFICATION_TYPES.FEED, NOTIFICATION_TYPES.PASSTHROUGH].includes(notification.type)) {
518
524
  throw new Error('Invalid notification: title empty');
519
525
  }
520
- if (!notification.body && notification.type !== 'feed') {
526
+ if (!notification.body && ![NOTIFICATION_TYPES.FEED, NOTIFICATION_TYPES.PASSTHROUGH].includes(notification.type)) {
521
527
  throw new Error('Invalid notification: body empty');
522
528
  }
523
529
 
@@ -5,6 +5,7 @@ const pathToRegExp = require('path-to-regexp');
5
5
  const { findComponentByIdV2, getMountPoints } = require('@blocklet/meta/lib/util');
6
6
  const { getDefaultServiceConfig } = require('@blocklet/meta/lib/service');
7
7
  const logger = require('@abtnode/logger')('@abtnode/blocklet-services:security');
8
+ const { authBySimpleAccessKey, isLoginToken, isAccessKey } = require('@abtnode/util/lib/auth-simple-access-key');
8
9
 
9
10
  const cache = require('../cache');
10
11
  const formatContext = require('./format-context');
@@ -157,11 +158,11 @@ module.exports = ({ node, req, options }) => {
157
158
  /**
158
159
  * set user info to req.user
159
160
  */
160
- req.ensureUser = async ({ token, visitorId, appPid } = {}) => {
161
+ req.ensureUser = async ({ token, visitorId, appPid, blockletInfo } = {}) => {
161
162
  try {
162
- if (token && typeof token === 'string' && token.split('.').length === 3) {
163
+ if (isLoginToken(token)) {
163
164
  const teamDid = req.getBlockletDid();
164
- const { secret } = await req.getBlockletInfo();
165
+ const { secret } = blockletInfo || (await req.getBlockletInfo());
165
166
  const opt = {
166
167
  checkFromDb: (decoded) => cache.sessionCacheDisabledUser.get(decoded?.did),
167
168
  teamDid,
@@ -191,6 +192,10 @@ module.exports = ({ node, req, options }) => {
191
192
  }
192
193
  }
193
194
  req.user = user;
195
+ } else if (isAccessKey(token)) {
196
+ const teamDid = req.getBlockletDid();
197
+ const user = await authBySimpleAccessKey(token, node, teamDid);
198
+ req.user = user;
194
199
  }
195
200
  } catch (error) {
196
201
  logger.error('Failed to ensureUser', {
@@ -1,3 +1,3 @@
1
- import{_ as dt}from"./vendor-mui-core-CfA4EdRA.js";import{a as f}from"./vendor-utils-BNHJB5U7.js";import{e as Q,g as R}from"./vendor-react-DEoibe3W.js";import{P as ft}from"./vendor-ux-did-connect-zBIy2ulO.js";import{b as ct}from"./vendor-mui-x-DSNWmGVo.js";var tt={exports:{}};(function(T,L){(function(l,c){T.exports=c()})(Q,function(){var l="week",c="year";return function(g,t,e){var s=t.prototype;s.week=function(i){if(i===void 0&&(i=null),i!==null)return this.add(7*(i-this.week()),"day");var o=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var n=e(this).startOf(c).add(1,c).date(o),d=e(this).endOf(l);if(n.isBefore(d))return 1}var m=e(this).startOf(c).date(o).startOf(l).subtract(1,"millisecond"),U=this.diff(m,l,!0);return U<0?e(this).startOf("week").week():Math.ceil(U)},s.weeks=function(i){return i===void 0&&(i=null),this.week(i)}}})})(tt);var lt=tt.exports;const mt=R(lt);var et={exports:{}};(function(T,L){(function(l,c){T.exports=c()})(Q,function(){var l={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},c=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,g=/\d/,t=/\d\d/,e=/\d\d?/,s=/\d*[^-_:/,()\s\d]+/,i={},o=function(r){return(r=+r)+(r>68?1900:2e3)},n=function(r){return function(a){this[r]=+a}},d=[/[+-]\d\d:?(\d\d)?|Z/,function(r){(this.zone||(this.zone={})).offset=function(a){if(!a||a==="Z")return 0;var h=a.match(/([+-]|\d\d)/g),u=60*h[1]+(+h[2]||0);return u===0?0:h[0]==="+"?-u:u}(r)}],m=function(r){var a=i[r];return a&&(a.indexOf?a:a.s.concat(a.f))},U=function(r,a){var h,u=i.meridiem;if(u){for(var D=1;D<=24;D+=1)if(r.indexOf(u(D,0,a))>-1){h=D>12;break}}else h=r===(a?"pm":"PM");return h},rt={A:[s,function(r){this.afternoon=U(r,!1)}],a:[s,function(r){this.afternoon=U(r,!0)}],Q:[g,function(r){this.month=3*(r-1)+1}],S:[g,function(r){this.milliseconds=100*+r}],SS:[t,function(r){this.milliseconds=10*+r}],SSS:[/\d{3}/,function(r){this.milliseconds=+r}],s:[e,n("seconds")],ss:[e,n("seconds")],m:[e,n("minutes")],mm:[e,n("minutes")],H:[e,n("hours")],h:[e,n("hours")],HH:[e,n("hours")],hh:[e,n("hours")],D:[e,n("day")],DD:[t,n("day")],Do:[s,function(r){var a=i.ordinal,h=r.match(/\d+/);if(this.day=h[0],a)for(var u=1;u<=31;u+=1)a(u).replace(/\[|\]/g,"")===r&&(this.day=u)}],w:[e,n("week")],ww:[t,n("week")],M:[e,n("month")],MM:[t,n("month")],MMM:[s,function(r){var a=m("months"),h=(m("monthsShort")||a.map(function(u){return u.slice(0,3)})).indexOf(r)+1;if(h<1)throw new Error;this.month=h%12||h}],MMMM:[s,function(r){var a=m("months").indexOf(r)+1;if(a<1)throw new Error;this.month=a%12||a}],Y:[/[+-]?\d+/,n("year")],YY:[t,function(r){this.year=o(r)}],YYYY:[/\d{4}/,n("year")],Z:d,ZZ:d};function nt(r){var a,h;a=r,h=i&&i.formats;for(var u=(r=a.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(b,k,p){var M=p&&p.toUpperCase();return k||h[p]||l[p]||h[M].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(x,j,z){return j||z.slice(1)})})).match(c),D=u.length,w=0;w<D;w+=1){var P=u[w],S=rt[P],Y=S&&S[0],O=S&&S[1];u[w]=O?{regex:Y,parser:O}:P.replace(/^\[|\]$/g,"")}return function(b){for(var k={},p=0,M=0;p<D;p+=1){var x=u[p];if(typeof x=="string")M+=x.length;else{var j=x.regex,z=x.parser,H=b.slice(M),A=j.exec(H)[0];z.call(k,A),b=b.replace(A,"")}}return function(C){var I=C.afternoon;if(I!==void 0){var y=C.hours;I?y<12&&(C.hours+=12):y===12&&(C.hours=0),delete C.afternoon}}(k),k}}return function(r,a,h){h.p.customParseFormat=!0,r&&r.parseTwoDigitYear&&(o=r.parseTwoDigitYear);var u=a.prototype,D=u.parse;u.parse=function(w){var P=w.date,S=w.utc,Y=w.args;this.$u=S;var O=Y[1];if(typeof O=="string"){var b=Y[2]===!0,k=Y[3]===!0,p=b||k,M=Y[2];k&&(M=Y[2]),i=this.$locale(),!b&&M&&(i=h.Ls[M]),this.$d=function(H,A,C,I){try{if(["x","X"].indexOf(A)>-1)return new Date((A==="X"?1e3:1)*H);var y=nt(A)(H),W=y.year,B=y.month,it=y.day,at=y.hours,ot=y.minutes,ht=y.seconds,ut=y.milliseconds,X=y.zone,q=y.week,$=new Date,N=it||(W||B?1:$.getDate()),Z=W||$.getFullYear(),F=0;W&&!B||(F=B>0?B-1:$.getMonth());var E,v=at||0,V=ot||0,J=ht||0,_=ut||0;return X?new Date(Date.UTC(Z,F,N,v,V,J,_+60*X.offset*1e3)):C?new Date(Date.UTC(Z,F,N,v,V,J,_)):(E=new Date(Z,F,N,v,V,J,_),q&&(E=I(E).week(q).toDate()),E)}catch{return new Date("")}}(P,O,S,h),this.init(),M&&M!==!0&&(this.$L=this.locale(M).$L),p&&P!=this.format(O)&&(this.$d=new Date("")),i={}}else if(O instanceof Array)for(var x=O.length,j=1;j<=x;j+=1){Y[1]=O[j-1];var z=h.apply(this,Y);if(z.isValid()){this.$d=z.$d,this.$L=z.$L,this.init();break}j===x&&(this.$d=new Date(""))}else D.call(this,w)}}})})(et);var yt=et.exports;const Mt=R(yt);var st={exports:{}};(function(T,L){(function(l,c){T.exports=c()})(Q,function(){return function(l,c,g){c.prototype.isBetween=function(t,e,s,i){var o=g(t),n=g(e),d=(i=i||"()")[0]==="(",m=i[1]===")";return(d?this.isAfter(o,s):!this.isBefore(o,s))&&(m?this.isBefore(n,s):!this.isAfter(n,s))||(d?this.isBefore(o,s):!this.isAfter(o,s))&&(m?this.isAfter(n,s):!this.isBefore(n,s))}}})})(st);var pt=st.exports;const Tt=R(pt);f.extend(Mt);f.extend(ft);f.extend(Tt);const gt=ct(["Your locale has not been found.","Either the locale key is not a supported one. Locales supported by dayjs are available here: https://github.com/iamkun/dayjs/tree/dev/src/locale","Or you forget to import the locale from 'dayjs/locale/{localeUsed}'","fallback on English locale"]),Dt={YY:"year",YYYY:{sectionType:"year",contentType:"digit",maxLength:4},M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMM:{sectionType:"month",contentType:"letter"},MMMM:{sectionType:"month",contentType:"letter"},D:{sectionType:"day",contentType:"digit",maxLength:2},DD:"day",Do:{sectionType:"day",contentType:"digit-with-letter"},d:{sectionType:"weekDay",contentType:"digit",maxLength:2},dd:{sectionType:"weekDay",contentType:"letter"},ddd:{sectionType:"weekDay",contentType:"letter"},dddd:{sectionType:"weekDay",contentType:"letter"},A:"meridiem",a:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},wt={year:"YYYY",month:"MMMM",monthShort:"MMM",dayOfMonth:"D",weekday:"dddd",weekdayShort:"dd",hours24h:"HH",hours12h:"hh",meridiem:"A",minutes:"mm",seconds:"ss",fullDate:"ll",fullDateWithWeekday:"dddd, LL",keyboardDate:"L",shortDate:"MMM D",normalDate:"D MMMM",normalDateWithWeekday:"ddd, MMM D",monthAndYear:"MMMM YYYY",monthAndDate:"MMMM D",fullTime:"LT",fullTime12h:"hh:mm A",fullTime24h:"HH:mm",fullDateTime:"lll",fullDateTime12h:"ll hh:mm A",fullDateTime24h:"ll HH:mm",keyboardDateTime:"L LT",keyboardDateTime12h:"L hh:mm A",keyboardDateTime24h:"L HH:mm"},G=["Missing UTC plugin","To be able to use UTC or timezones, you have to enable the `utc` plugin","Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-utc"].join(`
1
+ import{_ as dt}from"./vendor-mui-core-CQ38ohp2.js";import{a as f}from"./vendor-utils-BNHJB5U7.js";import{e as Q,g as R}from"./vendor-react-DEoibe3W.js";import{P as ft}from"./vendor-ux-did-connect-CsNUdA6Y.js";import{b as ct}from"./vendor-mui-x-B0hsmEJ3.js";var tt={exports:{}};(function(T,L){(function(l,c){T.exports=c()})(Q,function(){var l="week",c="year";return function(g,t,e){var s=t.prototype;s.week=function(i){if(i===void 0&&(i=null),i!==null)return this.add(7*(i-this.week()),"day");var o=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var n=e(this).startOf(c).add(1,c).date(o),d=e(this).endOf(l);if(n.isBefore(d))return 1}var m=e(this).startOf(c).date(o).startOf(l).subtract(1,"millisecond"),U=this.diff(m,l,!0);return U<0?e(this).startOf("week").week():Math.ceil(U)},s.weeks=function(i){return i===void 0&&(i=null),this.week(i)}}})})(tt);var lt=tt.exports;const mt=R(lt);var et={exports:{}};(function(T,L){(function(l,c){T.exports=c()})(Q,function(){var l={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},c=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,g=/\d/,t=/\d\d/,e=/\d\d?/,s=/\d*[^-_:/,()\s\d]+/,i={},o=function(r){return(r=+r)+(r>68?1900:2e3)},n=function(r){return function(a){this[r]=+a}},d=[/[+-]\d\d:?(\d\d)?|Z/,function(r){(this.zone||(this.zone={})).offset=function(a){if(!a||a==="Z")return 0;var h=a.match(/([+-]|\d\d)/g),u=60*h[1]+(+h[2]||0);return u===0?0:h[0]==="+"?-u:u}(r)}],m=function(r){var a=i[r];return a&&(a.indexOf?a:a.s.concat(a.f))},U=function(r,a){var h,u=i.meridiem;if(u){for(var D=1;D<=24;D+=1)if(r.indexOf(u(D,0,a))>-1){h=D>12;break}}else h=r===(a?"pm":"PM");return h},rt={A:[s,function(r){this.afternoon=U(r,!1)}],a:[s,function(r){this.afternoon=U(r,!0)}],Q:[g,function(r){this.month=3*(r-1)+1}],S:[g,function(r){this.milliseconds=100*+r}],SS:[t,function(r){this.milliseconds=10*+r}],SSS:[/\d{3}/,function(r){this.milliseconds=+r}],s:[e,n("seconds")],ss:[e,n("seconds")],m:[e,n("minutes")],mm:[e,n("minutes")],H:[e,n("hours")],h:[e,n("hours")],HH:[e,n("hours")],hh:[e,n("hours")],D:[e,n("day")],DD:[t,n("day")],Do:[s,function(r){var a=i.ordinal,h=r.match(/\d+/);if(this.day=h[0],a)for(var u=1;u<=31;u+=1)a(u).replace(/\[|\]/g,"")===r&&(this.day=u)}],w:[e,n("week")],ww:[t,n("week")],M:[e,n("month")],MM:[t,n("month")],MMM:[s,function(r){var a=m("months"),h=(m("monthsShort")||a.map(function(u){return u.slice(0,3)})).indexOf(r)+1;if(h<1)throw new Error;this.month=h%12||h}],MMMM:[s,function(r){var a=m("months").indexOf(r)+1;if(a<1)throw new Error;this.month=a%12||a}],Y:[/[+-]?\d+/,n("year")],YY:[t,function(r){this.year=o(r)}],YYYY:[/\d{4}/,n("year")],Z:d,ZZ:d};function nt(r){var a,h;a=r,h=i&&i.formats;for(var u=(r=a.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(b,k,p){var M=p&&p.toUpperCase();return k||h[p]||l[p]||h[M].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(x,j,z){return j||z.slice(1)})})).match(c),D=u.length,w=0;w<D;w+=1){var P=u[w],S=rt[P],Y=S&&S[0],O=S&&S[1];u[w]=O?{regex:Y,parser:O}:P.replace(/^\[|\]$/g,"")}return function(b){for(var k={},p=0,M=0;p<D;p+=1){var x=u[p];if(typeof x=="string")M+=x.length;else{var j=x.regex,z=x.parser,H=b.slice(M),A=j.exec(H)[0];z.call(k,A),b=b.replace(A,"")}}return function(C){var I=C.afternoon;if(I!==void 0){var y=C.hours;I?y<12&&(C.hours+=12):y===12&&(C.hours=0),delete C.afternoon}}(k),k}}return function(r,a,h){h.p.customParseFormat=!0,r&&r.parseTwoDigitYear&&(o=r.parseTwoDigitYear);var u=a.prototype,D=u.parse;u.parse=function(w){var P=w.date,S=w.utc,Y=w.args;this.$u=S;var O=Y[1];if(typeof O=="string"){var b=Y[2]===!0,k=Y[3]===!0,p=b||k,M=Y[2];k&&(M=Y[2]),i=this.$locale(),!b&&M&&(i=h.Ls[M]),this.$d=function(H,A,C,I){try{if(["x","X"].indexOf(A)>-1)return new Date((A==="X"?1e3:1)*H);var y=nt(A)(H),W=y.year,B=y.month,it=y.day,at=y.hours,ot=y.minutes,ht=y.seconds,ut=y.milliseconds,X=y.zone,q=y.week,$=new Date,N=it||(W||B?1:$.getDate()),Z=W||$.getFullYear(),F=0;W&&!B||(F=B>0?B-1:$.getMonth());var E,v=at||0,V=ot||0,J=ht||0,_=ut||0;return X?new Date(Date.UTC(Z,F,N,v,V,J,_+60*X.offset*1e3)):C?new Date(Date.UTC(Z,F,N,v,V,J,_)):(E=new Date(Z,F,N,v,V,J,_),q&&(E=I(E).week(q).toDate()),E)}catch{return new Date("")}}(P,O,S,h),this.init(),M&&M!==!0&&(this.$L=this.locale(M).$L),p&&P!=this.format(O)&&(this.$d=new Date("")),i={}}else if(O instanceof Array)for(var x=O.length,j=1;j<=x;j+=1){Y[1]=O[j-1];var z=h.apply(this,Y);if(z.isValid()){this.$d=z.$d,this.$L=z.$L,this.init();break}j===x&&(this.$d=new Date(""))}else D.call(this,w)}}})})(et);var yt=et.exports;const Mt=R(yt);var st={exports:{}};(function(T,L){(function(l,c){T.exports=c()})(Q,function(){return function(l,c,g){c.prototype.isBetween=function(t,e,s,i){var o=g(t),n=g(e),d=(i=i||"()")[0]==="(",m=i[1]===")";return(d?this.isAfter(o,s):!this.isBefore(o,s))&&(m?this.isBefore(n,s):!this.isAfter(n,s))||(d?this.isBefore(o,s):!this.isAfter(o,s))&&(m?this.isAfter(n,s):!this.isBefore(n,s))}}})})(st);var pt=st.exports;const Tt=R(pt);f.extend(Mt);f.extend(ft);f.extend(Tt);const gt=ct(["Your locale has not been found.","Either the locale key is not a supported one. Locales supported by dayjs are available here: https://github.com/iamkun/dayjs/tree/dev/src/locale","Or you forget to import the locale from 'dayjs/locale/{localeUsed}'","fallback on English locale"]),Dt={YY:"year",YYYY:{sectionType:"year",contentType:"digit",maxLength:4},M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMM:{sectionType:"month",contentType:"letter"},MMMM:{sectionType:"month",contentType:"letter"},D:{sectionType:"day",contentType:"digit",maxLength:2},DD:"day",Do:{sectionType:"day",contentType:"digit-with-letter"},d:{sectionType:"weekDay",contentType:"digit",maxLength:2},dd:{sectionType:"weekDay",contentType:"letter"},ddd:{sectionType:"weekDay",contentType:"letter"},dddd:{sectionType:"weekDay",contentType:"letter"},A:"meridiem",a:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},wt={year:"YYYY",month:"MMMM",monthShort:"MMM",dayOfMonth:"D",weekday:"dddd",weekdayShort:"dd",hours24h:"HH",hours12h:"hh",meridiem:"A",minutes:"mm",seconds:"ss",fullDate:"ll",fullDateWithWeekday:"dddd, LL",keyboardDate:"L",shortDate:"MMM D",normalDate:"D MMMM",normalDateWithWeekday:"ddd, MMM D",monthAndYear:"MMMM YYYY",monthAndDate:"MMMM D",fullTime:"LT",fullTime12h:"hh:mm A",fullTime24h:"HH:mm",fullDateTime:"lll",fullDateTime12h:"ll hh:mm A",fullDateTime24h:"ll HH:mm",keyboardDateTime:"L LT",keyboardDateTime12h:"L hh:mm A",keyboardDateTime24h:"L HH:mm"},G=["Missing UTC plugin","To be able to use UTC or timezones, you have to enable the `utc` plugin","Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-utc"].join(`
2
2
  `),K=["Missing timezone plugin","To be able to use timezones, you have to enable both the `utc` and the `timezone` plugin","Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-timezone"].join(`
3
3
  `),Yt=(T,L)=>L?(...l)=>T(...l).locale(L):T;class bt{constructor({locale:L,formats:l,instance:c}={}){var g;this.isMUIAdapter=!0,this.isTimezoneCompatible=!0,this.lib="dayjs",this.rawDayJsInstance=void 0,this.dayjs=void 0,this.locale=void 0,this.formats=void 0,this.escapedCharacters={start:"[",end:"]"},this.formatTokenMap=Dt,this.setLocaleToValue=t=>{const e=this.getCurrentLocaleCode();return e===t.locale()?t:t.locale(e)},this.hasUTCPlugin=()=>typeof f.utc<"u",this.hasTimezonePlugin=()=>typeof f.tz<"u",this.isSame=(t,e,s)=>{const i=this.setTimezone(e,this.getTimezone(t));return t.format(s)===i.format(s)},this.cleanTimezone=t=>{switch(t){case"default":return;case"system":return f.tz.guess();default:return t}},this.createSystemDate=t=>{if(this.rawDayJsInstance)return this.rawDayJsInstance(t);if(this.hasUTCPlugin()&&this.hasTimezonePlugin()){const e=f.tz.guess();return e!=="UTC"?f.tz(t,e):f(t)}return f(t)},this.createUTCDate=t=>{if(!this.hasUTCPlugin())throw new Error(G);return f.utc(t)},this.createTZDate=(t,e)=>{if(!this.hasUTCPlugin())throw new Error(G);if(!this.hasTimezonePlugin())throw new Error(K);const s=t!==void 0&&!t.endsWith("Z");return f(t).tz(this.cleanTimezone(e),s)},this.getLocaleFormats=()=>{const t=f.Ls,e=this.locale||"en";let s=t[e];return s===void 0&&(gt(),s=t.en),s.formats},this.adjustOffset=t=>{if(!this.hasTimezonePlugin())return t;const e=this.getTimezone(t);if(e!=="UTC"){var s,i;const o=t.tz(this.cleanTimezone(e),!0);if(((s=o.$offset)!=null?s:0)===((i=t.$offset)!=null?i:0))return t;t.$offset=o.$offset}return t},this.date=t=>t===null?null:this.dayjs(t),this.dateWithTimezone=(t,e)=>{if(t===null)return null;let s;return e==="UTC"?s=this.createUTCDate(t):e==="system"||e==="default"&&!this.hasTimezonePlugin()?s=this.createSystemDate(t):s=this.createTZDate(t,e),this.locale===void 0?s:s.locale(this.locale)},this.getTimezone=t=>{if(this.hasTimezonePlugin()){var e;const s=(e=t.$x)==null?void 0:e.$timezone;if(s)return s}return this.hasUTCPlugin()&&t.isUTC()?"UTC":"system"},this.setTimezone=(t,e)=>{if(this.getTimezone(t)===e)return t;if(e==="UTC"){if(!this.hasUTCPlugin())throw new Error(G);return t.utc()}if(e==="system")return t.local();if(!this.hasTimezonePlugin()){if(e==="default")return t;throw new Error(K)}return f.tz(t,this.cleanTimezone(e))},this.toJsDate=t=>t.toDate(),this.parseISO=t=>this.dayjs(t),this.toISO=t=>t.toISOString(),this.parse=(t,e)=>t===""?null:this.dayjs(t,e,this.locale,!0),this.getCurrentLocaleCode=()=>this.locale||"en",this.is12HourCycleInCurrentLocale=()=>/A|a/.test(this.getLocaleFormats().LT||""),this.expandFormat=t=>{const e=this.getLocaleFormats(),s=i=>i.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(o,n,d)=>n||d.slice(1));return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(i,o,n)=>{const d=n&&n.toUpperCase();return o||e[n]||s(e[d])})},this.getFormatHelperText=t=>this.expandFormat(t).replace(/a/gi,"(a|p)m").toLocaleLowerCase(),this.isNull=t=>t===null,this.isValid=t=>this.dayjs(t).isValid(),this.format=(t,e)=>this.formatByString(t,this.formats[e]),this.formatByString=(t,e)=>this.dayjs(t).format(e),this.formatNumber=t=>t,this.getDiff=(t,e,s)=>t.diff(e,s),this.isEqual=(t,e)=>t===null&&e===null?!0:this.dayjs(t).toDate().getTime()===this.dayjs(e).toDate().getTime(),this.isSameYear=(t,e)=>this.isSame(t,e,"YYYY"),this.isSameMonth=(t,e)=>this.isSame(t,e,"YYYY-MM"),this.isSameDay=(t,e)=>this.isSame(t,e,"YYYY-MM-DD"),this.isSameHour=(t,e)=>t.isSame(e,"hour"),this.isAfter=(t,e)=>t>e,this.isAfterYear=(t,e)=>this.hasUTCPlugin()?!this.isSameYear(t,e)&&t.utc()>e.utc():t.isAfter(e,"year"),this.isAfterDay=(t,e)=>this.hasUTCPlugin()?!this.isSameDay(t,e)&&t.utc()>e.utc():t.isAfter(e,"day"),this.isBefore=(t,e)=>t<e,this.isBeforeYear=(t,e)=>this.hasUTCPlugin()?!this.isSameYear(t,e)&&t.utc()<e.utc():t.isBefore(e,"year"),this.isBeforeDay=(t,e)=>this.hasUTCPlugin()?!this.isSameDay(t,e)&&t.utc()<e.utc():t.isBefore(e,"day"),this.isWithinRange=(t,[e,s])=>t>=e&&t<=s,this.startOfYear=t=>this.adjustOffset(t.startOf("year")),this.startOfMonth=t=>this.adjustOffset(t.startOf("month")),this.startOfWeek=t=>this.adjustOffset(t.startOf("week")),this.startOfDay=t=>this.adjustOffset(t.startOf("day")),this.endOfYear=t=>this.adjustOffset(t.endOf("year")),this.endOfMonth=t=>this.adjustOffset(t.endOf("month")),this.endOfWeek=t=>this.adjustOffset(t.endOf("week")),this.endOfDay=t=>this.adjustOffset(t.endOf("day")),this.addYears=(t,e)=>this.adjustOffset(e<0?t.subtract(Math.abs(e),"year"):t.add(e,"year")),this.addMonths=(t,e)=>this.adjustOffset(e<0?t.subtract(Math.abs(e),"month"):t.add(e,"month")),this.addWeeks=(t,e)=>this.adjustOffset(e<0?t.subtract(Math.abs(e),"week"):t.add(e,"week")),this.addDays=(t,e)=>this.adjustOffset(e<0?t.subtract(Math.abs(e),"day"):t.add(e,"day")),this.addHours=(t,e)=>this.adjustOffset(e<0?t.subtract(Math.abs(e),"hour"):t.add(e,"hour")),this.addMinutes=(t,e)=>this.adjustOffset(e<0?t.subtract(Math.abs(e),"minute"):t.add(e,"minute")),this.addSeconds=(t,e)=>this.adjustOffset(e<0?t.subtract(Math.abs(e),"second"):t.add(e,"second")),this.getYear=t=>t.year(),this.getMonth=t=>t.month(),this.getDate=t=>t.date(),this.getHours=t=>t.hour(),this.getMinutes=t=>t.minute(),this.getSeconds=t=>t.second(),this.getMilliseconds=t=>t.millisecond(),this.setYear=(t,e)=>this.adjustOffset(t.set("year",e)),this.setMonth=(t,e)=>this.adjustOffset(t.set("month",e)),this.setDate=(t,e)=>this.adjustOffset(t.set("date",e)),this.setHours=(t,e)=>this.adjustOffset(t.set("hour",e)),this.setMinutes=(t,e)=>this.adjustOffset(t.set("minute",e)),this.setSeconds=(t,e)=>this.adjustOffset(t.set("second",e)),this.setMilliseconds=(t,e)=>this.adjustOffset(t.set("millisecond",e)),this.getDaysInMonth=t=>t.daysInMonth(),this.getNextMonth=t=>this.addMonths(t,1),this.getPreviousMonth=t=>this.addMonths(t,-1),this.getMonthArray=t=>{const s=[t.startOf("year")];for(;s.length<12;){const i=s[s.length-1];s.push(this.addMonths(i,1))}return s},this.mergeDateAndTime=(t,e)=>t.hour(e.hour()).minute(e.minute()).second(e.second()),this.getWeekdays=()=>{const t=this.dayjs().startOf("week");return[0,1,2,3,4,5,6].map(e=>this.formatByString(this.addDays(t,e),"dd"))},this.getWeekArray=t=>{const e=this.setLocaleToValue(t),s=e.startOf("month").startOf("week"),i=e.endOf("month").endOf("week");let o=0,n=s;const d=[];for(;n<i;){const m=Math.floor(o/7);d[m]=d[m]||[],d[m].push(n),n=this.addDays(n,1),o+=1}return d},this.getWeekNumber=t=>t.week(),this.getYearRange=(t,e)=>{const s=t.startOf("year"),i=e.endOf("year"),o=[];let n=s;for(;n<i;)o.push(n),n=this.addYears(n,1);return o},this.getMeridiemText=t=>t==="am"?"AM":"PM",this.rawDayJsInstance=c,this.dayjs=Yt((g=this.rawDayJsInstance)!=null?g:f,L),this.locale=L,this.formats=dt({},wt,l),f.extend(mt)}}export{bt as A};
@@ -1 +1 @@
1
- import{a8 as e,j as t}from"./vendor-mui-core-CfA4EdRA.js";import{r as a}from"./vendor-ux-did-connect-zBIy2ulO.js";var r={},o=e;Object.defineProperty(r,"__esModule",{value:!0});var u=r.default=void 0,i=o(a()),p=t;u=r.default=(0,i.default)((0,p.jsx)("path",{d:"m7 10 5 5 5-5z"}),"ArrowDropDown");export{u as d};
1
+ import{a8 as e,j as t}from"./vendor-mui-core-CQ38ohp2.js";import{r as a}from"./vendor-ux-did-connect-CsNUdA6Y.js";var r={},o=e;Object.defineProperty(r,"__esModule",{value:!0});var u=r.default=void 0,i=o(a()),p=t;u=r.default=(0,i.default)((0,p.jsx)("path",{d:"m7 10 5 5 5-5z"}),"ArrowDropDown");export{u as d};
@@ -1 +1 @@
1
- import{a8 as r,j as t}from"./vendor-mui-core-CfA4EdRA.js";import{r as a}from"./vendor-ux-did-connect-zBIy2ulO.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,i=o(a()),l=t;u=e.default=(0,i.default)((0,l.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}),"CheckCircle");export{u as d};
1
+ import{a8 as r,j as t}from"./vendor-mui-core-CQ38ohp2.js";import{r as a}from"./vendor-ux-did-connect-CsNUdA6Y.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,i=o(a()),l=t;u=e.default=(0,i.default)((0,l.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}),"CheckCircle");export{u as d};
@@ -1 +1 @@
1
- import{a8 as r,j as t}from"./vendor-mui-core-CfA4EdRA.js";import{r as a}from"./vendor-ux-did-connect-zBIy2ulO.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,f=o(a()),i=t;u=e.default=(0,f.default)((0,i.jsx)("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft");export{u as d};
1
+ import{a8 as r,j as t}from"./vendor-mui-core-CQ38ohp2.js";import{r as a}from"./vendor-ux-did-connect-CsNUdA6Y.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,f=o(a()),i=t;u=e.default=(0,f.default)((0,i.jsx)("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft");export{u as d};
@@ -1 +1 @@
1
- import{a8 as r,j as t}from"./vendor-mui-core-CfA4EdRA.js";import{r as a}from"./vendor-ux-did-connect-zBIy2ulO.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,i=o(a()),v=t;u=e.default=(0,i.default)((0,v.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight");export{u as d};
1
+ import{a8 as r,j as t}from"./vendor-mui-core-CQ38ohp2.js";import{r as a}from"./vendor-ux-did-connect-CsNUdA6Y.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,i=o(a()),v=t;u=e.default=(0,i.default)((0,v.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight");export{u as d};