@8wave/ai-elements 0.73.0 → 0.75.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 (220) hide show
  1. package/README.md +62 -15
  2. package/dist/_chunks/{PkStreamingMarkdown-orhL2kzD.js → PkStreamingMarkdown-rIdQh5_D.js} +20 -20
  3. package/dist/_chunks/PkStreamingMarkdown-rIdQh5_D.js.map +1 -0
  4. package/dist/_chunks/{PkToolShowArtifact-D-dU41VG.js → PkToolShowArtifact-CeLgwZBA.js} +6 -6
  5. package/dist/_chunks/{PkToolShowArtifact-D-dU41VG.js.map → PkToolShowArtifact-CeLgwZBA.js.map} +1 -1
  6. package/dist/_chunks/{PkToolShowCalendarEvent-B33fWbkk.js → PkToolShowCalendarEvent-cQpAAE3a.js} +10 -10
  7. package/dist/_chunks/{PkToolShowCalendarEvent-B33fWbkk.js.map → PkToolShowCalendarEvent-cQpAAE3a.js.map} +1 -1
  8. package/dist/_chunks/{PkToolShowComparison-CcKHsr36.js → PkToolShowComparison-Cu-zT8-Z.js} +6 -6
  9. package/dist/_chunks/{PkToolShowComparison-CcKHsr36.js.map → PkToolShowComparison-Cu-zT8-Z.js.map} +1 -1
  10. package/dist/_chunks/PkToolShowContactForm-CqoSVvjG.js +1658 -0
  11. package/dist/_chunks/PkToolShowContactForm-CqoSVvjG.js.map +1 -0
  12. package/dist/_chunks/{PkToolShowEmail-BOivL2p_.js → PkToolShowEmail-oLGym0R9.js} +10 -10
  13. package/dist/_chunks/{PkToolShowEmail-BOivL2p_.js.map → PkToolShowEmail-oLGym0R9.js.map} +1 -1
  14. package/dist/_chunks/{PkToolShowImageGallery-Dy0vFEU-.js → PkToolShowImageGallery-CDXSL1Mg.js} +2 -2
  15. package/dist/_chunks/{PkToolShowImageGallery-Dy0vFEU-.js.map → PkToolShowImageGallery-CDXSL1Mg.js.map} +1 -1
  16. package/dist/_chunks/{PkToolShowLocation-US6u26ra.js → PkToolShowLocation-BtRUdoEw.js} +7 -7
  17. package/dist/_chunks/{PkToolShowLocation-US6u26ra.js.map → PkToolShowLocation-BtRUdoEw.js.map} +1 -1
  18. package/dist/_chunks/{PkToolShowMessage-Cjslxq94.js → PkToolShowMessage-tJQGRhce.js} +9 -9
  19. package/dist/_chunks/{PkToolShowMessage-Cjslxq94.js.map → PkToolShowMessage-tJQGRhce.js.map} +1 -1
  20. package/dist/_chunks/{PkToolShowMultipleChoice-BEwiJCLu.js → PkToolShowMultipleChoice-CtVvdyDg.js} +3 -3
  21. package/dist/_chunks/{PkToolShowMultipleChoice-BEwiJCLu.js.map → PkToolShowMultipleChoice-CtVvdyDg.js.map} +1 -1
  22. package/dist/_chunks/{PkToolShowProductList-D3Qe8yQM.js → PkToolShowProductList-D_k6CDdb.js} +2 -2
  23. package/dist/_chunks/{PkToolShowProductList-D3Qe8yQM.js.map → PkToolShowProductList-D_k6CDdb.js.map} +1 -1
  24. package/dist/_chunks/{PkToolShowQrCode-B64sdI0N.js → PkToolShowQrCode-S1j_T8wQ.js} +6 -6
  25. package/dist/_chunks/{PkToolShowQrCode-B64sdI0N.js.map → PkToolShowQrCode-S1j_T8wQ.js.map} +1 -1
  26. package/dist/_chunks/{PkToolShowSources-B2rf94fU.js → PkToolShowSources-CroItMtG.js} +6 -5
  27. package/dist/_chunks/PkToolShowSources-CroItMtG.js.map +1 -0
  28. package/dist/_chunks/{PkToolShowSuggestedReply-BGWA08C7.js → PkToolShowSuggestedReply-BRa5Lpti.js} +2 -2
  29. package/dist/_chunks/{PkToolShowSuggestedReply-BGWA08C7.js.map → PkToolShowSuggestedReply-BRa5Lpti.js.map} +1 -1
  30. package/dist/_chunks/{PkToolShowWeather-ClMzD04y.js → PkToolShowWeather-CUpCJ8Nj.js} +3 -3
  31. package/dist/_chunks/{PkToolShowWeather-ClMzD04y.js.map → PkToolShowWeather-CUpCJ8Nj.js.map} +1 -1
  32. package/dist/_chunks/{PkToolShowWebPages-BCqywwEK.js → PkToolShowWebPages-f-dHyxfD.js} +2 -2
  33. package/dist/_chunks/{PkToolShowWebPages-BCqywwEK.js.map → PkToolShowWebPages-f-dHyxfD.js.map} +1 -1
  34. package/dist/_chunks/{VvCheckbox.es-kmMsWlkU.js → VvCheckbox.es-BF8Mdg0O.js} +2 -2
  35. package/dist/_chunks/{VvCheckbox.es-kmMsWlkU.js.map → VvCheckbox.es-BF8Mdg0O.js.map} +1 -1
  36. package/dist/_chunks/{VvCheckboxGroup.es-BRRmuO9h.js → VvCheckboxGroup.es-BJc8MmJ3.js} +109 -109
  37. package/dist/_chunks/{VvCheckboxGroup.es-BRRmuO9h.js.map → VvCheckboxGroup.es-BJc8MmJ3.js.map} +1 -1
  38. package/dist/_chunks/{VvCombobox.es-pTM53Z4B.js → VvCombobox.es-ILRHqAye.js} +256 -256
  39. package/dist/_chunks/{VvCombobox.es-pTM53Z4B.js.map → VvCombobox.es-ILRHqAye.js.map} +1 -1
  40. package/dist/_chunks/{VvInputText.es-DO39OSWk.js → VvInputText.es-CDnMeO26.js} +190 -190
  41. package/dist/_chunks/{VvInputText.es-DO39OSWk.js.map → VvInputText.es-CDnMeO26.js.map} +1 -1
  42. package/dist/_chunks/{VvRadio.es-BpQAJbon.js → VvRadio.es-C2p5vvAx.js} +2 -2
  43. package/dist/_chunks/{VvRadio.es-BpQAJbon.js.map → VvRadio.es-C2p5vvAx.js.map} +1 -1
  44. package/dist/_chunks/{VvRadioGroup.es-BSBrmx9w.js → VvRadioGroup.es-6GlWuDjY.js} +10 -10
  45. package/dist/_chunks/{VvRadioGroup.es-BSBrmx9w.js.map → VvRadioGroup.es-6GlWuDjY.js.map} +1 -1
  46. package/dist/_chunks/{VvSelect.es-DALpUK5j.js → VvSelect.es-i4lO9onq.js} +6 -6
  47. package/dist/_chunks/{VvSelect.es-DALpUK5j.js.map → VvSelect.es-i4lO9onq.js.map} +1 -1
  48. package/dist/_chunks/{VvTextarea.es-C9dwYLOG.js → VvTextarea.es-CGpiCS4S.js} +248 -248
  49. package/dist/_chunks/{VvTextarea.es-C9dwYLOG.js.map → VvTextarea.es-CGpiCS4S.js.map} +1 -1
  50. package/dist/_chunks/{dist-DtF6poRc.js → dist-BTnzL-m0.js} +131 -119
  51. package/dist/_chunks/dist-BTnzL-m0.js.map +1 -0
  52. package/dist/_chunks/{index.es-Z3Hu-QIb.js → index.es-CUjDCkXD.js} +2428 -1558
  53. package/dist/_chunks/{index.es-Z3Hu-QIb.js.map → index.es-CUjDCkXD.js.map} +1 -1
  54. package/dist/_chunks/{schemas-Bp3a8tYV.js → schemas-aPiXCaCc.js} +1309 -945
  55. package/dist/_chunks/schemas-aPiXCaCc.js.map +1 -0
  56. package/dist/ai-elements.es.js +4746 -3352
  57. package/dist/ai-elements.es.js.map +1 -1
  58. package/dist-vue/PkChatbot.js +1 -1
  59. package/dist-vue/PkChatbotFeedbackForm.js +1 -1
  60. package/dist-vue/PkChatbotFilePreview.js +1 -1
  61. package/dist-vue/PkChatbotInput.js +1 -1
  62. package/dist-vue/PkChatbotMessages.js +1 -1
  63. package/dist-vue/PkChatbotViewChat.js +1 -1
  64. package/dist-vue/PkChatbotViewConversations.js +1 -1
  65. package/dist-vue/PkChatbotViewProfile.js +1 -1
  66. package/dist-vue/_chunks/{Media-Bic_vfSX.js → Media-CXQSoKqt.js} +3 -3
  67. package/dist-vue/_chunks/{Media-Bic_vfSX.js.map → Media-CXQSoKqt.js.map} +1 -1
  68. package/dist-vue/_chunks/PkChatbot-DAzGc7al.js +190 -0
  69. package/dist-vue/_chunks/{PkChatbot-D5_ytfqS.js.map → PkChatbot-DAzGc7al.js.map} +1 -1
  70. package/dist-vue/_chunks/{PkChatbotFeedbackForm-CUnS-WyR.js → PkChatbotFeedbackForm-DvUzirPP.js} +3 -3
  71. package/dist-vue/_chunks/{PkChatbotFeedbackForm-CUnS-WyR.js.map → PkChatbotFeedbackForm-DvUzirPP.js.map} +1 -1
  72. package/dist-vue/_chunks/{PkChatbotFilePreview-JSpi3pmN.js → PkChatbotFilePreview-DHzuGtz5.js} +2 -2
  73. package/dist-vue/_chunks/{PkChatbotFilePreview-JSpi3pmN.js.map → PkChatbotFilePreview-DHzuGtz5.js.map} +1 -1
  74. package/dist-vue/_chunks/{PkChatbotInput-ODPhsqZt.js → PkChatbotInput-C5QSmt21.js} +3 -3
  75. package/dist-vue/_chunks/{PkChatbotInput-ODPhsqZt.js.map → PkChatbotInput-C5QSmt21.js.map} +1 -1
  76. package/dist-vue/_chunks/{PkChatbotMessages-CMLqkhmb.js → PkChatbotMessages-dsjB0-26.js} +16 -16
  77. package/dist-vue/_chunks/PkChatbotMessages-dsjB0-26.js.map +1 -0
  78. package/dist-vue/_chunks/{PkChatbotViewChat-wLCypxNG.js → PkChatbotViewChat-CjoezIyz.js} +9 -9
  79. package/dist-vue/_chunks/{PkChatbotViewChat-wLCypxNG.js.map → PkChatbotViewChat-CjoezIyz.js.map} +1 -1
  80. package/dist-vue/_chunks/PkChatbotViewConversations-DSQu6vY1.js +163 -0
  81. package/dist-vue/_chunks/PkChatbotViewConversations-DSQu6vY1.js.map +1 -0
  82. package/dist-vue/_chunks/{PkChatbotViewProfile-CXmmVXrD.js → PkChatbotViewProfile-BJJiaG9H.js} +2 -2
  83. package/dist-vue/_chunks/{PkChatbotViewProfile-CXmmVXrD.js.map → PkChatbotViewProfile-BJJiaG9H.js.map} +1 -1
  84. package/dist-vue/_chunks/{PkRelativeTime-jP41qAJ5.js → PkRelativeTime-WZ2aPcp_.js} +1 -1
  85. package/dist-vue/_chunks/{PkRelativeTime-jP41qAJ5.js.map → PkRelativeTime-WZ2aPcp_.js.map} +1 -1
  86. package/dist-vue/_chunks/{PkStreamingMarkdown-CtiMH6FD.js → PkStreamingMarkdown-BAhC3uGK.js} +20 -20
  87. package/dist-vue/_chunks/PkStreamingMarkdown-BAhC3uGK.js.map +1 -0
  88. package/dist-vue/_chunks/{PkToolShowArtifact-C2DgB_1z.js → PkToolShowArtifact-RzrDPcEQ.js} +2 -2
  89. package/dist-vue/_chunks/{PkToolShowArtifact-C2DgB_1z.js.map → PkToolShowArtifact-RzrDPcEQ.js.map} +1 -1
  90. package/dist-vue/_chunks/{PkToolShowContactForm-BzzbXuhh.js → PkToolShowContactForm-r_GgO-ZX.js} +4 -4
  91. package/dist-vue/_chunks/{PkToolShowContactForm-BzzbXuhh.js.map → PkToolShowContactForm-r_GgO-ZX.js.map} +1 -1
  92. package/dist-vue/_chunks/{PkToolShowImageGallery-DQXrJYop.js → PkToolShowImageGallery-B7Bt6ZGv.js} +2 -2
  93. package/dist-vue/_chunks/{PkToolShowImageGallery-DQXrJYop.js.map → PkToolShowImageGallery-B7Bt6ZGv.js.map} +1 -1
  94. package/dist-vue/_chunks/{PkToolShowLocation-McDIqI8y.js → PkToolShowLocation-DteWf0Cs.js} +1 -1
  95. package/dist-vue/_chunks/{PkToolShowLocation-McDIqI8y.js.map → PkToolShowLocation-DteWf0Cs.js.map} +1 -1
  96. package/dist-vue/_chunks/{PkToolShowMultipleChoice-DW3m6VbJ.js → PkToolShowMultipleChoice-DZXfWtQp.js} +1 -1
  97. package/dist-vue/_chunks/{PkToolShowMultipleChoice-DW3m6VbJ.js.map → PkToolShowMultipleChoice-DZXfWtQp.js.map} +1 -1
  98. package/dist-vue/_chunks/{PkToolShowProductList-BDSJs7bn.js → PkToolShowProductList-CtqWK0x4.js} +2 -2
  99. package/dist-vue/_chunks/{PkToolShowProductList-BDSJs7bn.js.map → PkToolShowProductList-CtqWK0x4.js.map} +1 -1
  100. package/dist-vue/_chunks/{PkToolShowSources-D5cBZxwQ.js → PkToolShowSources-DK2DCvU3.js} +6 -5
  101. package/dist-vue/_chunks/PkToolShowSources-DK2DCvU3.js.map +1 -0
  102. package/dist-vue/_chunks/{PkToolShowSuggestedReply-Dm3BTWYg.js → PkToolShowSuggestedReply-30m9yWDL.js} +1 -1
  103. package/dist-vue/_chunks/{PkToolShowSuggestedReply-Dm3BTWYg.js.map → PkToolShowSuggestedReply-30m9yWDL.js.map} +1 -1
  104. package/dist-vue/_chunks/{PkToolShowWebPages-DnYVhLVU.js → PkToolShowWebPages-DZIdrdWs.js} +2 -2
  105. package/dist-vue/_chunks/{PkToolShowWebPages-DnYVhLVU.js.map → PkToolShowWebPages-DZIdrdWs.js.map} +1 -1
  106. package/dist-vue/_chunks/{PkUrl-CH4pWBR8.js → PkUrl-CGbSBfuP.js} +1 -1
  107. package/dist-vue/_chunks/{PkUrl-CH4pWBR8.js.map → PkUrl-CGbSBfuP.js.map} +1 -1
  108. package/dist-vue/_chunks/{ZodError-Ca0wCsGp.js → ZodError-C_est8SY.js} +2 -2
  109. package/dist-vue/_chunks/{ZodError-Ca0wCsGp.js.map → ZodError-C_est8SY.js.map} +1 -1
  110. package/dist-vue/_chunks/{createChatbotApiClient-2ynLWELM.js → createChatbotApiClient-f86KwRcq.js} +141 -119
  111. package/dist-vue/_chunks/createChatbotApiClient-f86KwRcq.js.map +1 -0
  112. package/dist-vue/_chunks/{dist-Bs6dYy7x.js → dist-21vPGg1O.js} +3 -3
  113. package/dist-vue/_chunks/{dist-Bs6dYy7x.js.map → dist-21vPGg1O.js.map} +1 -1
  114. package/dist-vue/_chunks/{dist-Bb1zRSg4.js → dist-BGXTbYew2.js} +4 -4
  115. package/dist-vue/_chunks/dist-BGXTbYew2.js.map +1 -0
  116. package/dist-vue/_chunks/{dist-BrlD3co0.js → dist-BL9cumqH.js} +2 -2
  117. package/dist-vue/_chunks/{dist-BrlD3co0.js.map → dist-BL9cumqH.js.map} +1 -1
  118. package/dist-vue/_chunks/{dist-B9Pw4_a5.js → dist-BU-VgsYM.js} +3 -3
  119. package/dist-vue/_chunks/{dist-B9Pw4_a5.js.map → dist-BU-VgsYM.js.map} +1 -1
  120. package/dist-vue/_chunks/{dist-D-tjAaHK.js → dist-BU5m1pTR.js} +3 -3
  121. package/dist-vue/_chunks/{dist-D-tjAaHK.js.map → dist-BU5m1pTR.js.map} +1 -1
  122. package/dist-vue/_chunks/{dist-Dn0cKZ5Q.js → dist-BbP2I_Or.js} +2 -2
  123. package/dist-vue/_chunks/{dist-Dn0cKZ5Q.js.map → dist-BbP2I_Or.js.map} +1 -1
  124. package/dist-vue/_chunks/{dist-Cvsv0YEw.js → dist-BvmTki6w.js} +3 -3
  125. package/dist-vue/_chunks/{dist-Cvsv0YEw.js.map → dist-BvmTki6w.js.map} +1 -1
  126. package/dist-vue/_chunks/{dist-QzbLuLIV.js → dist-C3dPzENq.js} +3 -3
  127. package/dist-vue/_chunks/{dist-QzbLuLIV.js.map → dist-C3dPzENq.js.map} +1 -1
  128. package/dist-vue/_chunks/{dist-BMWOJZqC.js → dist-C6AWJq9a.js} +2 -2
  129. package/dist-vue/_chunks/{dist-BMWOJZqC.js.map → dist-C6AWJq9a.js.map} +1 -1
  130. package/dist-vue/_chunks/{dist-BQCdUoYc.js → dist-CGNGkvWf.js} +4 -4
  131. package/dist-vue/_chunks/{dist-BQCdUoYc.js.map → dist-CGNGkvWf.js.map} +1 -1
  132. package/dist-vue/_chunks/{dist-JOgG1zY3.js → dist-CIN_Avbm.js} +1 -1
  133. package/dist-vue/_chunks/{dist-JOgG1zY3.js.map → dist-CIN_Avbm.js.map} +1 -1
  134. package/dist-vue/_chunks/{dist-NKG-Bt-Q.js → dist-CePpgudw.js} +3 -3
  135. package/dist-vue/_chunks/{dist-NKG-Bt-Q.js.map → dist-CePpgudw.js.map} +1 -1
  136. package/dist-vue/_chunks/{dist-C13mHkC-.js → dist-CtMo7ig_.js} +2 -2
  137. package/dist-vue/_chunks/{dist-C13mHkC-.js.map → dist-CtMo7ig_.js.map} +1 -1
  138. package/dist-vue/_chunks/{dist-DucfoJQX.js → dist-CwG072cD.js} +3 -3
  139. package/dist-vue/_chunks/{dist-DucfoJQX.js.map → dist-CwG072cD.js.map} +1 -1
  140. package/dist-vue/_chunks/{dist-_4yQQX_L.js → dist-DFvVVU0-.js} +2 -2
  141. package/dist-vue/_chunks/{dist-_4yQQX_L.js.map → dist-DFvVVU0-.js.map} +1 -1
  142. package/dist-vue/_chunks/{dist-C_tRbeXQ.js → dist-DGz57kzK.js} +2 -2
  143. package/dist-vue/_chunks/{dist-C_tRbeXQ.js.map → dist-DGz57kzK.js.map} +1 -1
  144. package/dist-vue/_chunks/{dist-C2tC3pDh.js → dist-DT30Xa-D.js} +2 -2
  145. package/dist-vue/_chunks/{dist-C2tC3pDh.js.map → dist-DT30Xa-D.js.map} +1 -1
  146. package/dist-vue/_chunks/{dist-DNn7FqmI.js → dist-DoRhRpjL.js} +2 -2
  147. package/dist-vue/_chunks/{dist-DNn7FqmI.js.map → dist-DoRhRpjL.js.map} +1 -1
  148. package/dist-vue/_chunks/{dist-CQmgfFIN.js → dist-GnhLE5-A.js} +4 -4
  149. package/dist-vue/_chunks/{dist-CQmgfFIN.js.map → dist-GnhLE5-A.js.map} +1 -1
  150. package/dist-vue/_chunks/{dist-1ToEz3Zq.js → dist-QzWOn2Kx.js} +3 -3
  151. package/dist-vue/_chunks/{dist-1ToEz3Zq.js.map → dist-QzWOn2Kx.js.map} +1 -1
  152. package/dist-vue/_chunks/{dist-e9UFeG14.js → dist-uYEYs0EJ.js} +2 -2
  153. package/dist-vue/_chunks/{dist-e9UFeG14.js.map → dist-uYEYs0EJ.js.map} +1 -1
  154. package/dist-vue/_chunks/{dist-BpT8aqtS.js → dist-ukeBjdwq.js} +4 -4
  155. package/dist-vue/_chunks/{dist-BpT8aqtS.js.map → dist-ukeBjdwq.js.map} +1 -1
  156. package/dist-vue/_chunks/{dist-BHTSdHeX.js → dist-wLB8N32T.js} +3 -3
  157. package/dist-vue/_chunks/{dist-BHTSdHeX.js.map → dist-wLB8N32T.js.map} +1 -1
  158. package/dist-vue/_chunks/{index.es-BnOT0fHY.js → index.es-_14zrNZB.js} +4 -4
  159. package/dist-vue/_chunks/{index.es-BnOT0fHY.js.map → index.es-_14zrNZB.js.map} +1 -1
  160. package/dist-vue/_chunks/{schemas-sa2dDEGb.js → schemas-Clx4oKCB.js} +1309 -945
  161. package/dist-vue/_chunks/schemas-Clx4oKCB.js.map +1 -0
  162. package/dist-vue/_chunks/{useChatbotStore-Im8Xjwte.js → useChatbotStore-CJlkoNn7.js} +756 -679
  163. package/dist-vue/_chunks/useChatbotStore-CJlkoNn7.js.map +1 -0
  164. package/dist-vue/_chunks/{useLightbox-BiZUwsmB.js → useLightbox-1sB7fmFb.js} +1 -1
  165. package/dist-vue/_chunks/{useLightbox-BiZUwsmB.js.map → useLightbox-1sB7fmFb.js.map} +1 -1
  166. package/dist-vue/_chunks/{utils-DO7emdsn.js → utils-BegUBK7s.js} +1 -1
  167. package/dist-vue/_chunks/{utils-DO7emdsn.js.map → utils-BegUBK7s.js.map} +1 -1
  168. package/dist-vue/api.js +1 -1
  169. package/dist-vue/apps/web-component/src/composables/useChatbotAgent.d.ts +9 -7
  170. package/dist-vue/apps/web-component/src/composables/useChatbotAuth.d.ts +8 -8
  171. package/dist-vue/apps/web-component/src/lib.d.ts +29 -0
  172. package/dist-vue/apps/web-component/src/main.d.ts +0 -0
  173. package/dist-vue/apps/web-component/src/modules/applicationInsights.d.ts +38 -0
  174. package/dist-vue/composables.js +3 -3
  175. package/dist-vue/index.js +3680 -3664
  176. package/dist-vue/index.js.map +1 -1
  177. package/dist-vue/locales.js +56 -20
  178. package/dist-vue/packages/auth/src/add-member-to-organization.d.ts +5 -0
  179. package/dist-vue/packages/auth/src/anonymous-reauth-plugin.d.ts +11 -0
  180. package/dist-vue/packages/auth/src/external-auth-plugin.d.ts +2 -0
  181. package/dist-vue/packages/auth/src/index.d.ts +3477 -8
  182. package/dist-vue/packages/auth/src/media-helpers.d.ts +13 -0
  183. package/dist-vue/packages/auth/src/organization-auto-join.d.ts +1 -0
  184. package/dist-vue/packages/components/src/PkEditorMarkdown.d.ts +1 -1
  185. package/dist-vue/packages/components/src/PkEditorPrompt.d.ts +2 -0
  186. package/dist-vue/packages/components/src/PkEditorRepeater.d.ts +2 -2
  187. package/dist-vue/packages/components/src/PkEditorWyswyg.d.ts +1 -1
  188. package/dist-vue/packages/components/src/PkFieldset.d.ts +3 -3
  189. package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +6 -3
  190. package/dist-vue/packages/components/src/chat/PkEditorChannels.d.ts +16 -0
  191. package/dist-vue/packages/components/src/composables/index.d.ts +3 -0
  192. package/dist-vue/packages/components/src/composables/useChatbotError.d.ts +11 -11
  193. package/dist-vue/packages/composable/src/chatbot/api/createChatbotApiClient.d.ts +2 -0
  194. package/dist-vue/packages/composable/src/constants.d.ts +5 -0
  195. package/dist-vue/packages/composable/src/useDialog.d.ts +3 -3
  196. package/dist-vue/packages/composable/src/useSettingsStore.d.ts +4 -5
  197. package/dist-vue/packages/models/src/schema/Agent.d.ts +37 -27
  198. package/dist-vue/packages/models/src/schema/Chat.d.ts +6 -0
  199. package/dist-vue/packages/models/src/schema/Document.d.ts +2 -0
  200. package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +8 -6
  201. package/dist-vue/packages/models/src/schema/SubAgent.d.ts +13 -11
  202. package/dist-vue/style.css +1 -1
  203. package/package.json +3 -3
  204. package/dist/_chunks/PkStreamingMarkdown-orhL2kzD.js.map +0 -1
  205. package/dist/_chunks/PkToolShowContactForm-SmOSbCsp.js +0 -1103
  206. package/dist/_chunks/PkToolShowContactForm-SmOSbCsp.js.map +0 -1
  207. package/dist/_chunks/PkToolShowSources-B2rf94fU.js.map +0 -1
  208. package/dist/_chunks/dist-DtF6poRc.js.map +0 -1
  209. package/dist/_chunks/schemas-Bp3a8tYV.js.map +0 -1
  210. package/dist-vue/_chunks/PkChatbot-D5_ytfqS.js +0 -190
  211. package/dist-vue/_chunks/PkChatbotMessages-CMLqkhmb.js.map +0 -1
  212. package/dist-vue/_chunks/PkChatbotViewConversations-B5qBiqo4.js +0 -40
  213. package/dist-vue/_chunks/PkChatbotViewConversations-B5qBiqo4.js.map +0 -1
  214. package/dist-vue/_chunks/PkStreamingMarkdown-CtiMH6FD.js.map +0 -1
  215. package/dist-vue/_chunks/PkToolShowSources-D5cBZxwQ.js.map +0 -1
  216. package/dist-vue/_chunks/createChatbotApiClient-2ynLWELM.js.map +0 -1
  217. package/dist-vue/_chunks/dist-Bb1zRSg4.js.map +0 -1
  218. package/dist-vue/_chunks/schemas-sa2dDEGb.js.map +0 -1
  219. package/dist-vue/_chunks/useChatbotStore-Im8Xjwte.js.map +0 -1
  220. package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +0 -6
@@ -1,9 +1,3478 @@
1
- export type Session = {
2
- session: Record<string, unknown> & {
3
- organizationRole?: string | null
4
- activeOrganizationId?: string | undefined
5
- }
6
- user: Record<string, unknown> & {
7
- role: string
8
- }
1
+ import { BetterAuthOptions, BetterAuthPlugin, DBAdapter, OAuth2Tokens, HookEndpointContext, MiddlewareInputContext, MiddlewareOptions, GenericEndpointContext, StrictEndpoint, $strip, RawError, User, LiteralString, Auth } from 'better-auth';
2
+ import { Media, StoragePolicy } from '../../models/src';
3
+ import { BearerOptions, SessionWithImpersonatedBy, UserWithRole, AdminOptions, AnonymousOptions, DefaultOrganizationPlugin, Organization, Member, Invitation, Subset, AuthorizeResponse, OpenAPIModelSchema, Path, OpenAPIOptions } from 'better-auth/plugins';
4
+ import { ZodObject, ZodCoercedString, ZodUnion, ZodString, ZodArray, ZodOptional, ZodRecord, ZodAny, ZodEnum, ZodNumber, ZodBoolean, ZodIntersection, ZodXor } from 'zod';
5
+ export interface MediaServiceDependency {
6
+ confirmUpload(media: Media, options: {
7
+ isPublic: boolean;
8
+ }): Promise<Media>;
9
+ uploadBuffer(buffer: Buffer, mimeType: string, options: {
10
+ isPublic: boolean;
11
+ }): Promise<string>;
12
+ getPublicUrl(storedFileName: string): string;
9
13
  }
14
+ export declare function setMediaService(service: MediaServiceDependency): void;
15
+ export declare const config: {
16
+ session: {
17
+ expiresIn: number;
18
+ updateAge: number;
19
+ additionalFields: {
20
+ activeOrganizationId: {
21
+ type: "string";
22
+ };
23
+ impersonatedBy: {
24
+ type: "string";
25
+ };
26
+ organizationRole: {
27
+ type: "string";
28
+ };
29
+ };
30
+ };
31
+ user: {
32
+ additionalFields: {
33
+ media: {
34
+ type: "json";
35
+ required: false;
36
+ };
37
+ };
38
+ };
39
+ account: {
40
+ accountLinking: {
41
+ enabled: true;
42
+ trustedProviders: ("microsoft" | "google")[];
43
+ };
44
+ };
45
+ advanced: {
46
+ database: {
47
+ generateId: false;
48
+ };
49
+ defaultCookieAttributes: {
50
+ secure: true;
51
+ httpOnly: true;
52
+ sameSite: "none";
53
+ };
54
+ };
55
+ trustedOrigins: (_request: Request | undefined) => Promise<string[]>;
56
+ database: (options: BetterAuthOptions) => DBAdapter<BetterAuthOptions>;
57
+ baseURL: string | undefined;
58
+ basePath: string;
59
+ emailAndPassword: {
60
+ enabled: true;
61
+ requireEmailVerification: true;
62
+ minPasswordLength: number;
63
+ maxPasswordLength: number;
64
+ sendResetPassword: (options: Parameters<NonNullable<NonNullable<BetterAuthOptions["emailAndPassword"]>["sendResetPassword"]>>[0]) => Promise<void>;
65
+ };
66
+ emailVerification: {
67
+ sendOnSignIn: true;
68
+ sendOnSignUp: true;
69
+ autoSignInAfterVerification: true;
70
+ sendVerificationEmail: (options: Parameters<NonNullable<NonNullable<BetterAuthOptions["emailVerification"]>["sendVerificationEmail"]>>[0]) => Promise<void>;
71
+ expiresIn: number;
72
+ };
73
+ socialProviders: {
74
+ microsoft: {
75
+ tenantId: string;
76
+ clientId: string;
77
+ clientSecret: string;
78
+ getUserInfo: (token: OAuth2Tokens) => Promise<{
79
+ user: {
80
+ id: any;
81
+ email: any;
82
+ name: any;
83
+ image: string | undefined;
84
+ emailVerified: true;
85
+ };
86
+ data: any;
87
+ }>;
88
+ } | undefined;
89
+ google: {
90
+ clientId: string;
91
+ clientSecret: string;
92
+ } | undefined;
93
+ };
94
+ databaseHooks: {
95
+ user: {
96
+ create: {
97
+ before: (user: {
98
+ id: string;
99
+ createdAt: Date;
100
+ updatedAt: Date;
101
+ email: string;
102
+ emailVerified: boolean;
103
+ name: string;
104
+ image?: string | null | undefined;
105
+ } & Record<string, unknown>) => Promise<{
106
+ data: {
107
+ id: string;
108
+ createdAt: Date;
109
+ updatedAt: Date;
110
+ email: string;
111
+ emailVerified: boolean;
112
+ name: string;
113
+ image?: string | null | undefined;
114
+ } & Record<string, unknown>;
115
+ }>;
116
+ after: (user: {
117
+ id: string;
118
+ createdAt: Date;
119
+ updatedAt: Date;
120
+ email: string;
121
+ emailVerified: boolean;
122
+ name: string;
123
+ image?: string | null | undefined;
124
+ } & Record<string, unknown>) => Promise<void>;
125
+ };
126
+ update: {
127
+ before: (user: Partial<{
128
+ id: string;
129
+ createdAt: Date;
130
+ updatedAt: Date;
131
+ email: string;
132
+ emailVerified: boolean;
133
+ name: string;
134
+ image?: string | null | undefined;
135
+ }> & Record<string, unknown>) => Promise<{
136
+ data: Partial<{
137
+ id: string;
138
+ createdAt: Date;
139
+ updatedAt: Date;
140
+ email: string;
141
+ emailVerified: boolean;
142
+ name: string;
143
+ image?: string | null | undefined;
144
+ }> & Record<string, unknown>;
145
+ }>;
146
+ after: (user: {
147
+ id: string;
148
+ createdAt: Date;
149
+ updatedAt: Date;
150
+ email: string;
151
+ emailVerified: boolean;
152
+ name: string;
153
+ image?: string | null | undefined;
154
+ } & Record<string, unknown>) => Promise<void>;
155
+ };
156
+ };
157
+ account: {
158
+ create: {
159
+ after: (account: {
160
+ id: string;
161
+ createdAt: Date;
162
+ updatedAt: Date;
163
+ providerId: string;
164
+ accountId: string;
165
+ userId: string;
166
+ accessToken?: string | null | undefined;
167
+ refreshToken?: string | null | undefined;
168
+ idToken?: string | null | undefined;
169
+ accessTokenExpiresAt?: Date | null | undefined;
170
+ refreshTokenExpiresAt?: Date | null | undefined;
171
+ scope?: string | null | undefined;
172
+ password?: string | null | undefined;
173
+ }) => Promise<void>;
174
+ };
175
+ };
176
+ session: {
177
+ create: {
178
+ before: (session: {
179
+ id: string;
180
+ createdAt: Date;
181
+ updatedAt: Date;
182
+ userId: string;
183
+ expiresAt: Date;
184
+ token: string;
185
+ ipAddress?: string | null | undefined;
186
+ userAgent?: string | null | undefined;
187
+ } & Record<string, unknown>) => Promise<{
188
+ data: {
189
+ activeOrganizationId: string | null;
190
+ organizationRole: string | null;
191
+ id: string;
192
+ createdAt: Date;
193
+ updatedAt: Date;
194
+ userId: string;
195
+ expiresAt: Date;
196
+ token: string;
197
+ ipAddress?: string | null | undefined;
198
+ userAgent?: string | null | undefined;
199
+ };
200
+ }>;
201
+ };
202
+ update: {
203
+ after: (session: {
204
+ id: string;
205
+ createdAt: Date;
206
+ updatedAt: Date;
207
+ userId: string;
208
+ expiresAt: Date;
209
+ token: string;
210
+ ipAddress?: string | null | undefined;
211
+ userAgent?: string | null | undefined;
212
+ } & Record<string, unknown>) => Promise<void>;
213
+ };
214
+ };
215
+ };
216
+ plugins: [{
217
+ id: "bearer";
218
+ version: string;
219
+ hooks: {
220
+ before: {
221
+ matcher(context: HookEndpointContext): boolean;
222
+ handler: (inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
223
+ context: {
224
+ headers: Headers;
225
+ };
226
+ } | undefined>;
227
+ }[];
228
+ after: {
229
+ matcher(context: HookEndpointContext): true;
230
+ handler: (inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<void>;
231
+ }[];
232
+ };
233
+ options: BearerOptions | undefined;
234
+ }, {
235
+ id: "admin";
236
+ version: string;
237
+ init(): {
238
+ options: {
239
+ databaseHooks: {
240
+ user: {
241
+ create: {
242
+ before(user: {
243
+ id: string;
244
+ createdAt: Date;
245
+ updatedAt: Date;
246
+ email: string;
247
+ emailVerified: boolean;
248
+ name: string;
249
+ image?: string | null | undefined;
250
+ } & Record<string, unknown>): Promise<{
251
+ data: {
252
+ id: string;
253
+ createdAt: Date;
254
+ updatedAt: Date;
255
+ email: string;
256
+ emailVerified: boolean;
257
+ name: string;
258
+ image?: string | null | undefined;
259
+ role: string;
260
+ };
261
+ }>;
262
+ };
263
+ };
264
+ session: {
265
+ create: {
266
+ before(session: {
267
+ id: string;
268
+ createdAt: Date;
269
+ updatedAt: Date;
270
+ userId: string;
271
+ expiresAt: Date;
272
+ token: string;
273
+ ipAddress?: string | null | undefined;
274
+ userAgent?: string | null | undefined;
275
+ } & Record<string, unknown>, ctx: GenericEndpointContext | null): Promise<void>;
276
+ };
277
+ };
278
+ };
279
+ };
280
+ };
281
+ hooks: {
282
+ after: {
283
+ matcher(context: HookEndpointContext): boolean;
284
+ handler: (inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise< SessionWithImpersonatedBy[] | undefined>;
285
+ }[];
286
+ };
287
+ endpoints: {
288
+ setRole: StrictEndpoint<"/admin/set-role", {
289
+ method: "POST";
290
+ body: ZodObject<{
291
+ userId: ZodCoercedString<unknown>;
292
+ role: ZodUnion<readonly [ ZodString, ZodArray<ZodString>]>;
293
+ }, $strip>;
294
+ requireHeaders: true;
295
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
296
+ session: {
297
+ user: UserWithRole;
298
+ session: {
299
+ id: string;
300
+ createdAt: Date;
301
+ updatedAt: Date;
302
+ userId: string;
303
+ expiresAt: Date;
304
+ token: string;
305
+ ipAddress?: string | null | undefined;
306
+ userAgent?: string | null | undefined;
307
+ };
308
+ };
309
+ }>)[];
310
+ metadata: {
311
+ openapi: {
312
+ operationId: string;
313
+ summary: string;
314
+ description: string;
315
+ responses: {
316
+ 200: {
317
+ description: string;
318
+ content: {
319
+ "application/json": {
320
+ schema: {
321
+ type: "object";
322
+ properties: {
323
+ user: {
324
+ $ref: string;
325
+ };
326
+ };
327
+ };
328
+ };
329
+ };
330
+ };
331
+ };
332
+ };
333
+ $Infer: {
334
+ body: {
335
+ userId: string;
336
+ role: "user" | "admin" | ("user" | "admin")[];
337
+ };
338
+ };
339
+ };
340
+ }, {
341
+ user: UserWithRole;
342
+ }>;
343
+ getUser: StrictEndpoint<"/admin/get-user", {
344
+ method: "GET";
345
+ query: ZodObject<{
346
+ id: ZodString;
347
+ }, $strip>;
348
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
349
+ session: {
350
+ user: UserWithRole;
351
+ session: {
352
+ id: string;
353
+ createdAt: Date;
354
+ updatedAt: Date;
355
+ userId: string;
356
+ expiresAt: Date;
357
+ token: string;
358
+ ipAddress?: string | null | undefined;
359
+ userAgent?: string | null | undefined;
360
+ };
361
+ };
362
+ }>)[];
363
+ metadata: {
364
+ openapi: {
365
+ operationId: string;
366
+ summary: string;
367
+ description: string;
368
+ responses: {
369
+ 200: {
370
+ description: string;
371
+ content: {
372
+ "application/json": {
373
+ schema: {
374
+ type: "object";
375
+ properties: {
376
+ user: {
377
+ $ref: string;
378
+ };
379
+ };
380
+ };
381
+ };
382
+ };
383
+ };
384
+ };
385
+ };
386
+ };
387
+ }, UserWithRole>;
388
+ createUser: StrictEndpoint<"/admin/create-user", {
389
+ method: "POST";
390
+ body: ZodObject<{
391
+ email: ZodString;
392
+ password: ZodOptional<ZodString>;
393
+ name: ZodString;
394
+ role: ZodOptional<ZodUnion<readonly [ ZodString, ZodArray<ZodString>]>>;
395
+ data: ZodOptional<ZodRecord<ZodString, ZodAny>>;
396
+ }, $strip>;
397
+ metadata: {
398
+ openapi: {
399
+ operationId: string;
400
+ summary: string;
401
+ description: string;
402
+ responses: {
403
+ 200: {
404
+ description: string;
405
+ content: {
406
+ "application/json": {
407
+ schema: {
408
+ type: "object";
409
+ properties: {
410
+ user: {
411
+ $ref: string;
412
+ };
413
+ };
414
+ };
415
+ };
416
+ };
417
+ };
418
+ };
419
+ };
420
+ $Infer: {
421
+ body: {
422
+ email: string;
423
+ password?: string | undefined;
424
+ name: string;
425
+ role?: "user" | "admin" | ("user" | "admin")[] | undefined;
426
+ data?: Record<string, any> | undefined;
427
+ };
428
+ };
429
+ };
430
+ }, {
431
+ user: UserWithRole;
432
+ }>;
433
+ adminUpdateUser: StrictEndpoint<"/admin/update-user", {
434
+ method: "POST";
435
+ body: ZodObject<{
436
+ userId: ZodCoercedString<unknown>;
437
+ data: ZodRecord<ZodAny, ZodAny>;
438
+ }, $strip>;
439
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
440
+ session: {
441
+ user: UserWithRole;
442
+ session: {
443
+ id: string;
444
+ createdAt: Date;
445
+ updatedAt: Date;
446
+ userId: string;
447
+ expiresAt: Date;
448
+ token: string;
449
+ ipAddress?: string | null | undefined;
450
+ userAgent?: string | null | undefined;
451
+ };
452
+ };
453
+ }>)[];
454
+ metadata: {
455
+ openapi: {
456
+ operationId: string;
457
+ summary: string;
458
+ description: string;
459
+ responses: {
460
+ 200: {
461
+ description: string;
462
+ content: {
463
+ "application/json": {
464
+ schema: {
465
+ type: "object";
466
+ properties: {
467
+ user: {
468
+ $ref: string;
469
+ };
470
+ };
471
+ };
472
+ };
473
+ };
474
+ };
475
+ };
476
+ };
477
+ };
478
+ }, UserWithRole>;
479
+ listUsers: StrictEndpoint<"/admin/list-users", {
480
+ method: "GET";
481
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
482
+ session: {
483
+ user: UserWithRole;
484
+ session: {
485
+ id: string;
486
+ createdAt: Date;
487
+ updatedAt: Date;
488
+ userId: string;
489
+ expiresAt: Date;
490
+ token: string;
491
+ ipAddress?: string | null | undefined;
492
+ userAgent?: string | null | undefined;
493
+ };
494
+ };
495
+ }>)[];
496
+ query: ZodObject<{
497
+ searchValue: ZodOptional<ZodString>;
498
+ searchField: ZodOptional<ZodEnum<{
499
+ email: "email";
500
+ name: "name";
501
+ }>>;
502
+ searchOperator: ZodOptional<ZodEnum<{
503
+ contains: "contains";
504
+ starts_with: "starts_with";
505
+ ends_with: "ends_with";
506
+ }>>;
507
+ limit: ZodOptional<ZodUnion<[ ZodString, ZodNumber]>>;
508
+ offset: ZodOptional<ZodUnion<[ ZodString, ZodNumber]>>;
509
+ sortBy: ZodOptional<ZodString>;
510
+ sortDirection: ZodOptional<ZodEnum<{
511
+ asc: "asc";
512
+ desc: "desc";
513
+ }>>;
514
+ filterField: ZodOptional<ZodString>;
515
+ filterValue: ZodOptional<ZodUnion<[ ZodUnion<[ ZodUnion<[ ZodUnion<[ ZodString, ZodNumber]>, ZodBoolean]>, ZodArray<ZodString>]>, ZodArray<ZodNumber>]>>;
516
+ filterOperator: ZodOptional<ZodEnum<{
517
+ eq: "eq";
518
+ ne: "ne";
519
+ gt: "gt";
520
+ gte: "gte";
521
+ lt: "lt";
522
+ lte: "lte";
523
+ in: "in";
524
+ not_in: "not_in";
525
+ contains: "contains";
526
+ starts_with: "starts_with";
527
+ ends_with: "ends_with";
528
+ }>>;
529
+ }, $strip>;
530
+ metadata: {
531
+ openapi: {
532
+ operationId: string;
533
+ summary: string;
534
+ description: string;
535
+ responses: {
536
+ 200: {
537
+ description: string;
538
+ content: {
539
+ "application/json": {
540
+ schema: {
541
+ type: "object";
542
+ properties: {
543
+ users: {
544
+ type: string;
545
+ items: {
546
+ $ref: string;
547
+ };
548
+ };
549
+ total: {
550
+ type: string;
551
+ };
552
+ limit: {
553
+ type: string;
554
+ };
555
+ offset: {
556
+ type: string;
557
+ };
558
+ };
559
+ required: string[];
560
+ };
561
+ };
562
+ };
563
+ };
564
+ };
565
+ };
566
+ };
567
+ }, {
568
+ users: UserWithRole[];
569
+ total: number;
570
+ }>;
571
+ listUserSessions: StrictEndpoint<"/admin/list-user-sessions", {
572
+ method: "POST";
573
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
574
+ session: {
575
+ user: UserWithRole;
576
+ session: {
577
+ id: string;
578
+ createdAt: Date;
579
+ updatedAt: Date;
580
+ userId: string;
581
+ expiresAt: Date;
582
+ token: string;
583
+ ipAddress?: string | null | undefined;
584
+ userAgent?: string | null | undefined;
585
+ };
586
+ };
587
+ }>)[];
588
+ body: ZodObject<{
589
+ userId: ZodCoercedString<unknown>;
590
+ }, $strip>;
591
+ metadata: {
592
+ openapi: {
593
+ operationId: string;
594
+ summary: string;
595
+ description: string;
596
+ responses: {
597
+ 200: {
598
+ description: string;
599
+ content: {
600
+ "application/json": {
601
+ schema: {
602
+ type: "object";
603
+ properties: {
604
+ sessions: {
605
+ type: string;
606
+ items: {
607
+ $ref: string;
608
+ };
609
+ };
610
+ };
611
+ };
612
+ };
613
+ };
614
+ };
615
+ };
616
+ };
617
+ };
618
+ }, {
619
+ sessions: SessionWithImpersonatedBy[];
620
+ }>;
621
+ unbanUser: StrictEndpoint<"/admin/unban-user", {
622
+ method: "POST";
623
+ body: ZodObject<{
624
+ userId: ZodCoercedString<unknown>;
625
+ }, $strip>;
626
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
627
+ session: {
628
+ user: UserWithRole;
629
+ session: {
630
+ id: string;
631
+ createdAt: Date;
632
+ updatedAt: Date;
633
+ userId: string;
634
+ expiresAt: Date;
635
+ token: string;
636
+ ipAddress?: string | null | undefined;
637
+ userAgent?: string | null | undefined;
638
+ };
639
+ };
640
+ }>)[];
641
+ metadata: {
642
+ openapi: {
643
+ operationId: string;
644
+ summary: string;
645
+ description: string;
646
+ responses: {
647
+ 200: {
648
+ description: string;
649
+ content: {
650
+ "application/json": {
651
+ schema: {
652
+ type: "object";
653
+ properties: {
654
+ user: {
655
+ $ref: string;
656
+ };
657
+ };
658
+ };
659
+ };
660
+ };
661
+ };
662
+ };
663
+ };
664
+ };
665
+ }, {
666
+ user: UserWithRole;
667
+ }>;
668
+ banUser: StrictEndpoint<"/admin/ban-user", {
669
+ method: "POST";
670
+ body: ZodObject<{
671
+ userId: ZodCoercedString<unknown>;
672
+ banReason: ZodOptional<ZodString>;
673
+ banExpiresIn: ZodOptional<ZodNumber>;
674
+ }, $strip>;
675
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
676
+ session: {
677
+ user: UserWithRole;
678
+ session: {
679
+ id: string;
680
+ createdAt: Date;
681
+ updatedAt: Date;
682
+ userId: string;
683
+ expiresAt: Date;
684
+ token: string;
685
+ ipAddress?: string | null | undefined;
686
+ userAgent?: string | null | undefined;
687
+ };
688
+ };
689
+ }>)[];
690
+ metadata: {
691
+ openapi: {
692
+ operationId: string;
693
+ summary: string;
694
+ description: string;
695
+ responses: {
696
+ 200: {
697
+ description: string;
698
+ content: {
699
+ "application/json": {
700
+ schema: {
701
+ type: "object";
702
+ properties: {
703
+ user: {
704
+ $ref: string;
705
+ };
706
+ };
707
+ };
708
+ };
709
+ };
710
+ };
711
+ };
712
+ };
713
+ };
714
+ }, {
715
+ user: UserWithRole;
716
+ }>;
717
+ impersonateUser: StrictEndpoint<"/admin/impersonate-user", {
718
+ method: "POST";
719
+ body: ZodObject<{
720
+ userId: ZodCoercedString<unknown>;
721
+ }, $strip>;
722
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
723
+ session: {
724
+ user: UserWithRole;
725
+ session: {
726
+ id: string;
727
+ createdAt: Date;
728
+ updatedAt: Date;
729
+ userId: string;
730
+ expiresAt: Date;
731
+ token: string;
732
+ ipAddress?: string | null | undefined;
733
+ userAgent?: string | null | undefined;
734
+ };
735
+ };
736
+ }>)[];
737
+ metadata: {
738
+ openapi: {
739
+ operationId: string;
740
+ summary: string;
741
+ description: string;
742
+ responses: {
743
+ 200: {
744
+ description: string;
745
+ content: {
746
+ "application/json": {
747
+ schema: {
748
+ type: "object";
749
+ properties: {
750
+ session: {
751
+ $ref: string;
752
+ };
753
+ user: {
754
+ $ref: string;
755
+ };
756
+ };
757
+ };
758
+ };
759
+ };
760
+ };
761
+ };
762
+ };
763
+ };
764
+ }, {
765
+ session: {
766
+ id: string;
767
+ createdAt: Date;
768
+ updatedAt: Date;
769
+ userId: string;
770
+ expiresAt: Date;
771
+ token: string;
772
+ ipAddress?: string | null | undefined;
773
+ userAgent?: string | null | undefined;
774
+ };
775
+ user: UserWithRole;
776
+ }>;
777
+ stopImpersonating: StrictEndpoint<"/admin/stop-impersonating", {
778
+ method: "POST";
779
+ requireHeaders: true;
780
+ }, {
781
+ session: {
782
+ id: string;
783
+ createdAt: Date;
784
+ updatedAt: Date;
785
+ userId: string;
786
+ expiresAt: Date;
787
+ token: string;
788
+ ipAddress?: string | null | undefined;
789
+ userAgent?: string | null | undefined;
790
+ } & Record<string, any>;
791
+ user: {
792
+ id: string;
793
+ createdAt: Date;
794
+ updatedAt: Date;
795
+ email: string;
796
+ emailVerified: boolean;
797
+ name: string;
798
+ image?: string | null | undefined;
799
+ } & Record<string, any>;
800
+ }>;
801
+ revokeUserSession: StrictEndpoint<"/admin/revoke-user-session", {
802
+ method: "POST";
803
+ body: ZodObject<{
804
+ sessionToken: ZodString;
805
+ }, $strip>;
806
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
807
+ session: {
808
+ user: UserWithRole;
809
+ session: {
810
+ id: string;
811
+ createdAt: Date;
812
+ updatedAt: Date;
813
+ userId: string;
814
+ expiresAt: Date;
815
+ token: string;
816
+ ipAddress?: string | null | undefined;
817
+ userAgent?: string | null | undefined;
818
+ };
819
+ };
820
+ }>)[];
821
+ metadata: {
822
+ openapi: {
823
+ operationId: string;
824
+ summary: string;
825
+ description: string;
826
+ responses: {
827
+ 200: {
828
+ description: string;
829
+ content: {
830
+ "application/json": {
831
+ schema: {
832
+ type: "object";
833
+ properties: {
834
+ success: {
835
+ type: string;
836
+ };
837
+ };
838
+ };
839
+ };
840
+ };
841
+ };
842
+ };
843
+ };
844
+ };
845
+ }, {
846
+ success: boolean;
847
+ }>;
848
+ revokeUserSessions: StrictEndpoint<"/admin/revoke-user-sessions", {
849
+ method: "POST";
850
+ body: ZodObject<{
851
+ userId: ZodCoercedString<unknown>;
852
+ }, $strip>;
853
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
854
+ session: {
855
+ user: UserWithRole;
856
+ session: {
857
+ id: string;
858
+ createdAt: Date;
859
+ updatedAt: Date;
860
+ userId: string;
861
+ expiresAt: Date;
862
+ token: string;
863
+ ipAddress?: string | null | undefined;
864
+ userAgent?: string | null | undefined;
865
+ };
866
+ };
867
+ }>)[];
868
+ metadata: {
869
+ openapi: {
870
+ operationId: string;
871
+ summary: string;
872
+ description: string;
873
+ responses: {
874
+ 200: {
875
+ description: string;
876
+ content: {
877
+ "application/json": {
878
+ schema: {
879
+ type: "object";
880
+ properties: {
881
+ success: {
882
+ type: string;
883
+ };
884
+ };
885
+ };
886
+ };
887
+ };
888
+ };
889
+ };
890
+ };
891
+ };
892
+ }, {
893
+ success: boolean;
894
+ }>;
895
+ removeUser: StrictEndpoint<"/admin/remove-user", {
896
+ method: "POST";
897
+ body: ZodObject<{
898
+ userId: ZodCoercedString<unknown>;
899
+ }, $strip>;
900
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
901
+ session: {
902
+ user: UserWithRole;
903
+ session: {
904
+ id: string;
905
+ createdAt: Date;
906
+ updatedAt: Date;
907
+ userId: string;
908
+ expiresAt: Date;
909
+ token: string;
910
+ ipAddress?: string | null | undefined;
911
+ userAgent?: string | null | undefined;
912
+ };
913
+ };
914
+ }>)[];
915
+ metadata: {
916
+ openapi: {
917
+ operationId: string;
918
+ summary: string;
919
+ description: string;
920
+ responses: {
921
+ 200: {
922
+ description: string;
923
+ content: {
924
+ "application/json": {
925
+ schema: {
926
+ type: "object";
927
+ properties: {
928
+ success: {
929
+ type: string;
930
+ };
931
+ };
932
+ };
933
+ };
934
+ };
935
+ };
936
+ };
937
+ };
938
+ };
939
+ }, {
940
+ success: boolean;
941
+ }>;
942
+ setUserPassword: StrictEndpoint<"/admin/set-user-password", {
943
+ method: "POST";
944
+ body: ZodObject<{
945
+ newPassword: ZodString;
946
+ userId: ZodCoercedString<unknown>;
947
+ }, $strip>;
948
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
949
+ session: {
950
+ user: UserWithRole;
951
+ session: {
952
+ id: string;
953
+ createdAt: Date;
954
+ updatedAt: Date;
955
+ userId: string;
956
+ expiresAt: Date;
957
+ token: string;
958
+ ipAddress?: string | null | undefined;
959
+ userAgent?: string | null | undefined;
960
+ };
961
+ };
962
+ }>)[];
963
+ metadata: {
964
+ openapi: {
965
+ operationId: string;
966
+ summary: string;
967
+ description: string;
968
+ responses: {
969
+ 200: {
970
+ description: string;
971
+ content: {
972
+ "application/json": {
973
+ schema: {
974
+ type: "object";
975
+ properties: {
976
+ status: {
977
+ type: string;
978
+ };
979
+ };
980
+ };
981
+ };
982
+ };
983
+ };
984
+ };
985
+ };
986
+ };
987
+ }, {
988
+ status: boolean;
989
+ }>;
990
+ userHasPermission: StrictEndpoint<"/admin/has-permission", {
991
+ method: "POST";
992
+ body: ZodIntersection<ZodObject<{
993
+ userId: ZodOptional<ZodCoercedString<unknown>>;
994
+ role: ZodOptional<ZodString>;
995
+ }, $strip>, ZodXor<readonly [ ZodObject<{
996
+ permission: ZodRecord<ZodString, ZodArray<ZodString>>;
997
+ }, $strip>, ZodObject<{
998
+ permissions: ZodRecord<ZodString, ZodArray<ZodString>>;
999
+ }, $strip>]>>;
1000
+ metadata: {
1001
+ openapi: {
1002
+ description: string;
1003
+ requestBody: {
1004
+ content: {
1005
+ "application/json": {
1006
+ schema: {
1007
+ type: "object";
1008
+ properties: {
1009
+ permissions: {
1010
+ type: string;
1011
+ description: string;
1012
+ };
1013
+ };
1014
+ required: string[];
1015
+ };
1016
+ };
1017
+ };
1018
+ };
1019
+ responses: {
1020
+ "200": {
1021
+ description: string;
1022
+ content: {
1023
+ "application/json": {
1024
+ schema: {
1025
+ type: "object";
1026
+ properties: {
1027
+ error: {
1028
+ type: string;
1029
+ };
1030
+ success: {
1031
+ type: string;
1032
+ };
1033
+ };
1034
+ required: string[];
1035
+ };
1036
+ };
1037
+ };
1038
+ };
1039
+ };
1040
+ };
1041
+ $Infer: {
1042
+ body: {
1043
+ permissions: {
1044
+ readonly user?: ("update" | "delete" | "create" | "set-role" | "list" | "ban" | "impersonate" | "impersonate-admins" | "set-password" | "get")[] | undefined;
1045
+ readonly session?: ("delete" | "list" | "revoke")[] | undefined;
1046
+ };
1047
+ } & {
1048
+ userId?: string | undefined;
1049
+ role?: "user" | "admin" | undefined;
1050
+ };
1051
+ };
1052
+ };
1053
+ }, {
1054
+ error: null;
1055
+ success: boolean;
1056
+ }>;
1057
+ };
1058
+ $ERROR_CODES: {
1059
+ USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: RawError<"USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL">;
1060
+ FAILED_TO_CREATE_USER: RawError<"FAILED_TO_CREATE_USER">;
1061
+ USER_ALREADY_EXISTS: RawError<"USER_ALREADY_EXISTS">;
1062
+ YOU_CANNOT_BAN_YOURSELF: RawError<"YOU_CANNOT_BAN_YOURSELF">;
1063
+ YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE: RawError<"YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE">;
1064
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS: RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS">;
1065
+ YOU_ARE_NOT_ALLOWED_TO_LIST_USERS: RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS">;
1066
+ YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS: RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS">;
1067
+ YOU_ARE_NOT_ALLOWED_TO_BAN_USERS: RawError<"YOU_ARE_NOT_ALLOWED_TO_BAN_USERS">;
1068
+ YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS: RawError<"YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS">;
1069
+ YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS: RawError<"YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS">;
1070
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS: RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS">;
1071
+ YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD: RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD">;
1072
+ BANNED_USER: RawError<"BANNED_USER">;
1073
+ YOU_ARE_NOT_ALLOWED_TO_GET_USER: RawError<"YOU_ARE_NOT_ALLOWED_TO_GET_USER">;
1074
+ NO_DATA_TO_UPDATE: RawError<"NO_DATA_TO_UPDATE">;
1075
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS: RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS">;
1076
+ YOU_CANNOT_REMOVE_YOURSELF: RawError<"YOU_CANNOT_REMOVE_YOURSELF">;
1077
+ YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE">;
1078
+ YOU_CANNOT_IMPERSONATE_ADMINS: RawError<"YOU_CANNOT_IMPERSONATE_ADMINS">;
1079
+ INVALID_ROLE_TYPE: RawError<"INVALID_ROLE_TYPE">;
1080
+ };
1081
+ schema: {
1082
+ user: {
1083
+ fields: {
1084
+ role: {
1085
+ type: "string";
1086
+ required: false;
1087
+ input: false;
1088
+ };
1089
+ banned: {
1090
+ type: "boolean";
1091
+ defaultValue: false;
1092
+ required: false;
1093
+ input: false;
1094
+ };
1095
+ banReason: {
1096
+ type: "string";
1097
+ required: false;
1098
+ input: false;
1099
+ };
1100
+ banExpires: {
1101
+ type: "date";
1102
+ required: false;
1103
+ input: false;
1104
+ };
1105
+ };
1106
+ };
1107
+ session: {
1108
+ fields: {
1109
+ impersonatedBy: {
1110
+ type: "string";
1111
+ required: false;
1112
+ };
1113
+ };
1114
+ };
1115
+ };
1116
+ options: NoInfer< AdminOptions>;
1117
+ }, {
1118
+ id: "anonymous";
1119
+ version: string;
1120
+ endpoints: {
1121
+ signInAnonymous: StrictEndpoint<"/sign-in/anonymous", {
1122
+ method: "POST";
1123
+ metadata: {
1124
+ openapi: {
1125
+ description: string;
1126
+ responses: {
1127
+ 200: {
1128
+ description: string;
1129
+ content: {
1130
+ "application/json": {
1131
+ schema: {
1132
+ type: "object";
1133
+ properties: {
1134
+ user: {
1135
+ $ref: string;
1136
+ };
1137
+ session: {
1138
+ $ref: string;
1139
+ };
1140
+ };
1141
+ };
1142
+ };
1143
+ };
1144
+ };
1145
+ };
1146
+ };
1147
+ };
1148
+ }, {
1149
+ token: string;
1150
+ user: Record<string, any> & {
1151
+ id: string;
1152
+ createdAt: Date;
1153
+ updatedAt: Date;
1154
+ email: string;
1155
+ emailVerified: boolean;
1156
+ name: string;
1157
+ image?: string | null | undefined;
1158
+ };
1159
+ }>;
1160
+ deleteAnonymousUser: StrictEndpoint<"/delete-anonymous-user", {
1161
+ method: "POST";
1162
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
1163
+ session: {
1164
+ session: Record<string, any> & {
1165
+ id: string;
1166
+ createdAt: Date;
1167
+ updatedAt: Date;
1168
+ userId: string;
1169
+ expiresAt: Date;
1170
+ token: string;
1171
+ ipAddress?: string | null | undefined;
1172
+ userAgent?: string | null | undefined;
1173
+ };
1174
+ user: Record<string, any> & {
1175
+ id: string;
1176
+ createdAt: Date;
1177
+ updatedAt: Date;
1178
+ email: string;
1179
+ emailVerified: boolean;
1180
+ name: string;
1181
+ image?: string | null | undefined;
1182
+ };
1183
+ };
1184
+ }>)[];
1185
+ metadata: {
1186
+ openapi: {
1187
+ description: string;
1188
+ responses: {
1189
+ 200: {
1190
+ description: string;
1191
+ content: {
1192
+ "application/json": {
1193
+ schema: {
1194
+ type: "object";
1195
+ properties: {
1196
+ success: {
1197
+ type: string;
1198
+ };
1199
+ };
1200
+ };
1201
+ };
1202
+ };
1203
+ };
1204
+ "400": {
1205
+ description: string;
1206
+ content: {
1207
+ "application/json": {
1208
+ schema: {
1209
+ type: "object";
1210
+ properties: {
1211
+ message: {
1212
+ type: string;
1213
+ };
1214
+ };
1215
+ };
1216
+ required: string[];
1217
+ };
1218
+ };
1219
+ };
1220
+ "500": {
1221
+ description: string;
1222
+ content: {
1223
+ "application/json": {
1224
+ schema: {
1225
+ type: "object";
1226
+ properties: {
1227
+ message: {
1228
+ type: string;
1229
+ };
1230
+ };
1231
+ required: string[];
1232
+ };
1233
+ };
1234
+ };
1235
+ };
1236
+ };
1237
+ };
1238
+ };
1239
+ }, {
1240
+ success: boolean;
1241
+ }>;
1242
+ };
1243
+ hooks: {
1244
+ after: {
1245
+ matcher(ctx: HookEndpointContext): boolean;
1246
+ handler: (inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<void>;
1247
+ }[];
1248
+ };
1249
+ options: AnonymousOptions | undefined;
1250
+ schema: {
1251
+ user: {
1252
+ fields: {
1253
+ isAnonymous: {
1254
+ type: "boolean";
1255
+ required: false;
1256
+ input: false;
1257
+ defaultValue: false;
1258
+ };
1259
+ };
1260
+ };
1261
+ };
1262
+ $ERROR_CODES: {
1263
+ FAILED_TO_CREATE_USER: RawError<"FAILED_TO_CREATE_USER">;
1264
+ INVALID_EMAIL_FORMAT: RawError<"INVALID_EMAIL_FORMAT">;
1265
+ COULD_NOT_CREATE_SESSION: RawError<"COULD_NOT_CREATE_SESSION">;
1266
+ ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY: RawError<"ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY">;
1267
+ FAILED_TO_DELETE_ANONYMOUS_USER: RawError<"FAILED_TO_DELETE_ANONYMOUS_USER">;
1268
+ USER_IS_NOT_ANONYMOUS: RawError<"USER_IS_NOT_ANONYMOUS">;
1269
+ DELETE_ANONYMOUS_USER_DISABLED: RawError<"DELETE_ANONYMOUS_USER_DISABLED">;
1270
+ };
1271
+ }, DefaultOrganizationPlugin<{
1272
+ allowUserToCreateOrganization: (user: {
1273
+ id: string;
1274
+ createdAt: Date;
1275
+ updatedAt: Date;
1276
+ email: string;
1277
+ emailVerified: boolean;
1278
+ name: string;
1279
+ image?: string | null | undefined;
1280
+ } & Record<string, any>) => boolean;
1281
+ organizationHooks: {
1282
+ beforeCreateOrganization: ({ organization, user }: {
1283
+ organization: {
1284
+ name?: string;
1285
+ slug?: string;
1286
+ logo?: string;
1287
+ metadata?: Record<string, any>;
1288
+ [key: string]: any;
1289
+ };
1290
+ user: User & Record<string, any>;
1291
+ }) => Promise<{
1292
+ data: {
1293
+ createdBy: string;
1294
+ updatedBy: string;
1295
+ media: {
1296
+ name: string;
1297
+ src: {
1298
+ type: string;
1299
+ name: string;
1300
+ mimeType: string;
1301
+ bytesCount: number;
1302
+ extension: string;
1303
+ metadata: Record<string, string>;
1304
+ tags: Record<string, string>;
1305
+ storageHandle: {
1306
+ type: "azure-blob";
1307
+ blobUri: string;
1308
+ containerName: string;
1309
+ pathRelativeToContainer: string;
1310
+ } | {
1311
+ type: "s3";
1312
+ bucket: string;
1313
+ key: string;
1314
+ region: string;
1315
+ };
1316
+ storagePolicy: StoragePolicy;
1317
+ storedFileName: string;
1318
+ signData?: string | undefined;
1319
+ };
1320
+ srcSet: {
1321
+ type: string;
1322
+ name: string;
1323
+ mimeType: string;
1324
+ bytesCount: number;
1325
+ extension: string;
1326
+ metadata: Record<string, string>;
1327
+ tags: Record<string, string>;
1328
+ storageHandle: {
1329
+ type: "azure-blob";
1330
+ blobUri: string;
1331
+ containerName: string;
1332
+ pathRelativeToContainer: string;
1333
+ } | {
1334
+ type: "s3";
1335
+ bucket: string;
1336
+ key: string;
1337
+ region: string;
1338
+ };
1339
+ storagePolicy: StoragePolicy;
1340
+ storedFileName: string;
1341
+ signData?: string | undefined;
1342
+ }[];
1343
+ rawOptions?: {
1344
+ type: import("models").MediaType.picture;
1345
+ width: number;
1346
+ height: number;
1347
+ blurhash?: string | undefined;
1348
+ } | {
1349
+ type: import("models").MediaType.video;
1350
+ width: number;
1351
+ height: number;
1352
+ duration: number;
1353
+ } | {
1354
+ type: import("models").MediaType.audio;
1355
+ duration: number;
1356
+ } | {
1357
+ type: import("models").MediaType.office;
1358
+ } | {
1359
+ type: import("models").MediaType.archive;
1360
+ } | {
1361
+ type: import("models").MediaType.binary;
1362
+ } | {
1363
+ type: import("models").MediaType.executable;
1364
+ } | undefined;
1365
+ };
1366
+ name?: string;
1367
+ slug?: string;
1368
+ logo?: string;
1369
+ metadata?: Record<string, any>;
1370
+ };
1371
+ } | {
1372
+ data: {
1373
+ createdBy: string;
1374
+ updatedBy: string;
1375
+ name?: string;
1376
+ slug?: string;
1377
+ logo?: string;
1378
+ metadata?: Record<string, any>;
1379
+ };
1380
+ }>;
1381
+ afterCreateOrganization: ({ organization }: {
1382
+ organization: Organization & Record<string, any>;
1383
+ member: Member & Record<string, any>;
1384
+ user: User & Record<string, any>;
1385
+ }) => Promise<void>;
1386
+ beforeUpdateOrganization: ({ organization, user }: {
1387
+ organization: {
1388
+ name?: string;
1389
+ slug?: string;
1390
+ logo?: string;
1391
+ metadata?: Record<string, any>;
1392
+ [key: string]: any;
1393
+ };
1394
+ user: User & Record<string, any>;
1395
+ member: Member & Record<string, any>;
1396
+ }) => Promise<{
1397
+ data: {
1398
+ updatedBy: string;
1399
+ updatedAt: Date;
1400
+ media: {
1401
+ name: string;
1402
+ src: {
1403
+ type: string;
1404
+ name: string;
1405
+ mimeType: string;
1406
+ bytesCount: number;
1407
+ extension: string;
1408
+ metadata: Record<string, string>;
1409
+ tags: Record<string, string>;
1410
+ storageHandle: {
1411
+ type: "azure-blob";
1412
+ blobUri: string;
1413
+ containerName: string;
1414
+ pathRelativeToContainer: string;
1415
+ } | {
1416
+ type: "s3";
1417
+ bucket: string;
1418
+ key: string;
1419
+ region: string;
1420
+ };
1421
+ storagePolicy: StoragePolicy;
1422
+ storedFileName: string;
1423
+ signData?: string | undefined;
1424
+ };
1425
+ srcSet: {
1426
+ type: string;
1427
+ name: string;
1428
+ mimeType: string;
1429
+ bytesCount: number;
1430
+ extension: string;
1431
+ metadata: Record<string, string>;
1432
+ tags: Record<string, string>;
1433
+ storageHandle: {
1434
+ type: "azure-blob";
1435
+ blobUri: string;
1436
+ containerName: string;
1437
+ pathRelativeToContainer: string;
1438
+ } | {
1439
+ type: "s3";
1440
+ bucket: string;
1441
+ key: string;
1442
+ region: string;
1443
+ };
1444
+ storagePolicy: StoragePolicy;
1445
+ storedFileName: string;
1446
+ signData?: string | undefined;
1447
+ }[];
1448
+ rawOptions?: {
1449
+ type: import("models").MediaType.picture;
1450
+ width: number;
1451
+ height: number;
1452
+ blurhash?: string | undefined;
1453
+ } | {
1454
+ type: import("models").MediaType.video;
1455
+ width: number;
1456
+ height: number;
1457
+ duration: number;
1458
+ } | {
1459
+ type: import("models").MediaType.audio;
1460
+ duration: number;
1461
+ } | {
1462
+ type: import("models").MediaType.office;
1463
+ } | {
1464
+ type: import("models").MediaType.archive;
1465
+ } | {
1466
+ type: import("models").MediaType.binary;
1467
+ } | {
1468
+ type: import("models").MediaType.executable;
1469
+ } | undefined;
1470
+ };
1471
+ name?: string;
1472
+ slug?: string;
1473
+ logo?: string;
1474
+ metadata?: Record<string, any>;
1475
+ };
1476
+ } | {
1477
+ data: {
1478
+ updatedBy: string;
1479
+ updatedAt: Date;
1480
+ name?: string;
1481
+ slug?: string;
1482
+ logo?: string;
1483
+ metadata?: Record<string, any>;
1484
+ };
1485
+ }>;
1486
+ afterUpdateOrganization: ({ organization }: {
1487
+ organization: ( Organization & Record<string, any>) | null;
1488
+ user: User & Record<string, any>;
1489
+ member: Member & Record<string, any>;
1490
+ }) => Promise<void>;
1491
+ afterRemoveMember: ({ member }: {
1492
+ member: Member & Record<string, any>;
1493
+ user: User & Record<string, any>;
1494
+ organization: Organization & Record<string, any>;
1495
+ }) => Promise<void>;
1496
+ };
1497
+ sendInvitationEmail(data: {
1498
+ id: string;
1499
+ role: string;
1500
+ email: string;
1501
+ organization: Organization;
1502
+ invitation: Invitation;
1503
+ inviter: Member & {
1504
+ user: User;
1505
+ };
1506
+ }): Promise<void>;
1507
+ ac: {
1508
+ newRole<K extends "member" | "organization" | "invitation" | "team" | "ac">(statements: Subset<K, {
1509
+ readonly organization: readonly ["update", "delete"];
1510
+ readonly member: readonly ["create", "update", "delete"];
1511
+ readonly invitation: readonly ["create", "cancel"];
1512
+ readonly team: readonly ["create", "update", "delete"];
1513
+ readonly ac: readonly ["create", "read", "update", "delete"];
1514
+ }>): {
1515
+ authorize<K_1 extends K>(request: K_1 extends infer T extends K_2 ? { [key in T]?: Subset<K, {
1516
+ readonly organization: readonly ["update", "delete"];
1517
+ readonly member: readonly ["create", "update", "delete"];
1518
+ readonly invitation: readonly ["create", "cancel"];
1519
+ readonly team: readonly ["create", "update", "delete"];
1520
+ readonly ac: readonly ["create", "read", "update", "delete"];
1521
+ }>[key] | {
1522
+ actions: Subset<K, {
1523
+ readonly organization: readonly ["update", "delete"];
1524
+ readonly member: readonly ["create", "update", "delete"];
1525
+ readonly invitation: readonly ["create", "cancel"];
1526
+ readonly team: readonly ["create", "update", "delete"];
1527
+ readonly ac: readonly ["create", "read", "update", "delete"];
1528
+ }>[key];
1529
+ connector: "OR" | "AND";
1530
+ } | undefined; } : never, connector?: "OR" | "AND"): AuthorizeResponse;
1531
+ statements: Subset<K, {
1532
+ readonly organization: readonly ["update", "delete"];
1533
+ readonly member: readonly ["create", "update", "delete"];
1534
+ readonly invitation: readonly ["create", "cancel"];
1535
+ readonly team: readonly ["create", "update", "delete"];
1536
+ readonly ac: readonly ["create", "read", "update", "delete"];
1537
+ }>;
1538
+ };
1539
+ statements: {
1540
+ readonly organization: readonly ["update", "delete"];
1541
+ readonly member: readonly ["create", "update", "delete"];
1542
+ readonly invitation: readonly ["create", "cancel"];
1543
+ readonly team: readonly ["create", "update", "delete"];
1544
+ readonly ac: readonly ["create", "read", "update", "delete"];
1545
+ };
1546
+ };
1547
+ roles: {
1548
+ owner: {
1549
+ authorize<K_1 extends "member" | "organization" | "invitation" | "team" | "ac">(request: K_1 extends infer T extends K ? { [key in T]?: Subset<"member" | "organization" | "invitation" | "team" | "ac", {
1550
+ readonly organization: readonly ["update", "delete"];
1551
+ readonly member: readonly ["create", "update", "delete"];
1552
+ readonly invitation: readonly ["create", "cancel"];
1553
+ readonly team: readonly ["create", "update", "delete"];
1554
+ readonly ac: readonly ["create", "read", "update", "delete"];
1555
+ }>[key] | {
1556
+ actions: Subset<"member" | "organization" | "invitation" | "team" | "ac", {
1557
+ readonly organization: readonly ["update", "delete"];
1558
+ readonly member: readonly ["create", "update", "delete"];
1559
+ readonly invitation: readonly ["create", "cancel"];
1560
+ readonly team: readonly ["create", "update", "delete"];
1561
+ readonly ac: readonly ["create", "read", "update", "delete"];
1562
+ }>[key];
1563
+ connector: "OR" | "AND";
1564
+ } | undefined; } : never, connector?: "OR" | "AND"): AuthorizeResponse;
1565
+ statements: Subset<"member" | "organization" | "invitation" | "team" | "ac", {
1566
+ readonly organization: readonly ["update", "delete"];
1567
+ readonly member: readonly ["create", "update", "delete"];
1568
+ readonly invitation: readonly ["create", "cancel"];
1569
+ readonly team: readonly ["create", "update", "delete"];
1570
+ readonly ac: readonly ["create", "read", "update", "delete"];
1571
+ }>;
1572
+ };
1573
+ admin: {
1574
+ authorize<K_1 extends "member" | "organization" | "invitation" | "team" | "ac">(request: K_1 extends infer T extends K ? { [key in T]?: Subset<"member" | "organization" | "invitation" | "team" | "ac", {
1575
+ readonly organization: readonly ["update", "delete"];
1576
+ readonly member: readonly ["create", "update", "delete"];
1577
+ readonly invitation: readonly ["create", "cancel"];
1578
+ readonly team: readonly ["create", "update", "delete"];
1579
+ readonly ac: readonly ["create", "read", "update", "delete"];
1580
+ }>[key] | {
1581
+ actions: Subset<"member" | "organization" | "invitation" | "team" | "ac", {
1582
+ readonly organization: readonly ["update", "delete"];
1583
+ readonly member: readonly ["create", "update", "delete"];
1584
+ readonly invitation: readonly ["create", "cancel"];
1585
+ readonly team: readonly ["create", "update", "delete"];
1586
+ readonly ac: readonly ["create", "read", "update", "delete"];
1587
+ }>[key];
1588
+ connector: "OR" | "AND";
1589
+ } | undefined; } : never, connector?: "OR" | "AND"): AuthorizeResponse;
1590
+ statements: Subset<"member" | "organization" | "invitation" | "team" | "ac", {
1591
+ readonly organization: readonly ["update", "delete"];
1592
+ readonly member: readonly ["create", "update", "delete"];
1593
+ readonly invitation: readonly ["create", "cancel"];
1594
+ readonly team: readonly ["create", "update", "delete"];
1595
+ readonly ac: readonly ["create", "read", "update", "delete"];
1596
+ }>;
1597
+ };
1598
+ member: {
1599
+ authorize<K_1 extends "member" | "organization" | "invitation" | "team" | "ac">(request: K_1 extends infer T extends K ? { [key in T]?: Subset<"member" | "organization" | "invitation" | "team" | "ac", {
1600
+ readonly organization: readonly ["update", "delete"];
1601
+ readonly member: readonly ["create", "update", "delete"];
1602
+ readonly invitation: readonly ["create", "cancel"];
1603
+ readonly team: readonly ["create", "update", "delete"];
1604
+ readonly ac: readonly ["create", "read", "update", "delete"];
1605
+ }>[key] | {
1606
+ actions: Subset<"member" | "organization" | "invitation" | "team" | "ac", {
1607
+ readonly organization: readonly ["update", "delete"];
1608
+ readonly member: readonly ["create", "update", "delete"];
1609
+ readonly invitation: readonly ["create", "cancel"];
1610
+ readonly team: readonly ["create", "update", "delete"];
1611
+ readonly ac: readonly ["create", "read", "update", "delete"];
1612
+ }>[key];
1613
+ connector: "OR" | "AND";
1614
+ } | undefined; } : never, connector?: "OR" | "AND"): AuthorizeResponse;
1615
+ statements: Subset<"member" | "organization" | "invitation" | "team" | "ac", {
1616
+ readonly organization: readonly ["update", "delete"];
1617
+ readonly member: readonly ["create", "update", "delete"];
1618
+ readonly invitation: readonly ["create", "cancel"];
1619
+ readonly team: readonly ["create", "update", "delete"];
1620
+ readonly ac: readonly ["create", "read", "update", "delete"];
1621
+ }>;
1622
+ };
1623
+ user: {
1624
+ authorize<K_1 extends "member" | "organization" | "invitation" | "team" | "ac">(request: K_1 extends infer T extends K ? { [key in T]?: Subset<"member" | "organization" | "invitation" | "team" | "ac", {
1625
+ readonly organization: readonly ["update", "delete"];
1626
+ readonly member: readonly ["create", "update", "delete"];
1627
+ readonly invitation: readonly ["create", "cancel"];
1628
+ readonly team: readonly ["create", "update", "delete"];
1629
+ readonly ac: readonly ["create", "read", "update", "delete"];
1630
+ }>[key] | {
1631
+ actions: Subset<"member" | "organization" | "invitation" | "team" | "ac", {
1632
+ readonly organization: readonly ["update", "delete"];
1633
+ readonly member: readonly ["create", "update", "delete"];
1634
+ readonly invitation: readonly ["create", "cancel"];
1635
+ readonly team: readonly ["create", "update", "delete"];
1636
+ readonly ac: readonly ["create", "read", "update", "delete"];
1637
+ }>[key];
1638
+ connector: "OR" | "AND";
1639
+ } | undefined; } : never, connector?: "OR" | "AND"): AuthorizeResponse;
1640
+ statements: Subset<"member" | "organization" | "invitation" | "team" | "ac", {
1641
+ readonly organization: readonly ["update", "delete"];
1642
+ readonly member: readonly ["create", "update", "delete"];
1643
+ readonly invitation: readonly ["create", "cancel"];
1644
+ readonly team: readonly ["create", "update", "delete"];
1645
+ readonly ac: readonly ["create", "read", "update", "delete"];
1646
+ }>;
1647
+ };
1648
+ };
1649
+ schema: {
1650
+ organization: {
1651
+ additionalFields: {
1652
+ updatedAt: {
1653
+ type: "string";
1654
+ required: false;
1655
+ };
1656
+ createdBy: {
1657
+ type: "string";
1658
+ required: false;
1659
+ };
1660
+ updatedBy: {
1661
+ type: "string";
1662
+ required: false;
1663
+ };
1664
+ deleted: {
1665
+ type: "boolean";
1666
+ required: false;
1667
+ };
1668
+ deletedAt: {
1669
+ type: "string";
1670
+ required: false;
1671
+ };
1672
+ deletedBy: {
1673
+ type: "string";
1674
+ required: false;
1675
+ };
1676
+ media: {
1677
+ type: "json";
1678
+ required: false;
1679
+ };
1680
+ };
1681
+ };
1682
+ };
1683
+ }>, {
1684
+ id: "open-api";
1685
+ version: string;
1686
+ endpoints: {
1687
+ generateOpenAPISchema: StrictEndpoint<"/open-api/generate-schema", {
1688
+ method: "GET";
1689
+ }, {
1690
+ openapi: string;
1691
+ info: {
1692
+ title: string;
1693
+ description: string;
1694
+ version: string;
1695
+ };
1696
+ components: {
1697
+ securitySchemes: {
1698
+ apiKeyCookie: {
1699
+ type: string;
1700
+ in: string;
1701
+ name: string;
1702
+ description: string;
1703
+ };
1704
+ bearerAuth: {
1705
+ type: string;
1706
+ scheme: string;
1707
+ description: string;
1708
+ };
1709
+ };
1710
+ schemas: {
1711
+ [x: string]: OpenAPIModelSchema;
1712
+ };
1713
+ };
1714
+ security: {
1715
+ apiKeyCookie: never[];
1716
+ bearerAuth: never[];
1717
+ }[];
1718
+ servers: {
1719
+ url: string;
1720
+ }[];
1721
+ tags: {
1722
+ name: string;
1723
+ description: string;
1724
+ }[];
1725
+ paths: Record<string, Path>;
1726
+ }>;
1727
+ openAPIReference: StrictEndpoint< LiteralString | "/reference", {
1728
+ method: "GET";
1729
+ metadata: {
1730
+ readonly scope: "server";
1731
+ };
1732
+ }, Response>;
1733
+ };
1734
+ options: NoInfer< OpenAPIOptions>;
1735
+ }, BetterAuthPlugin, BetterAuthPlugin, BetterAuthPlugin];
1736
+ hooks: {
1737
+ after: (inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<void>;
1738
+ };
1739
+ };
1740
+ export declare const auth: Auth<{
1741
+ session: {
1742
+ expiresIn: number;
1743
+ updateAge: number;
1744
+ additionalFields: {
1745
+ activeOrganizationId: {
1746
+ type: "string";
1747
+ };
1748
+ impersonatedBy: {
1749
+ type: "string";
1750
+ };
1751
+ organizationRole: {
1752
+ type: "string";
1753
+ };
1754
+ };
1755
+ };
1756
+ user: {
1757
+ additionalFields: {
1758
+ media: {
1759
+ type: "json";
1760
+ required: false;
1761
+ };
1762
+ };
1763
+ };
1764
+ account: {
1765
+ accountLinking: {
1766
+ enabled: true;
1767
+ trustedProviders: ("microsoft" | "google")[];
1768
+ };
1769
+ };
1770
+ advanced: {
1771
+ database: {
1772
+ generateId: false;
1773
+ };
1774
+ defaultCookieAttributes: {
1775
+ secure: true;
1776
+ httpOnly: true;
1777
+ sameSite: "none";
1778
+ };
1779
+ };
1780
+ trustedOrigins: (_request: Request | undefined) => Promise<string[]>;
1781
+ database: (options: BetterAuthOptions) => DBAdapter<BetterAuthOptions>;
1782
+ baseURL: string | undefined;
1783
+ basePath: string;
1784
+ emailAndPassword: {
1785
+ enabled: true;
1786
+ requireEmailVerification: true;
1787
+ minPasswordLength: number;
1788
+ maxPasswordLength: number;
1789
+ sendResetPassword: (options: Parameters<NonNullable<NonNullable<BetterAuthOptions["emailAndPassword"]>["sendResetPassword"]>>[0]) => Promise<void>;
1790
+ };
1791
+ emailVerification: {
1792
+ sendOnSignIn: true;
1793
+ sendOnSignUp: true;
1794
+ autoSignInAfterVerification: true;
1795
+ sendVerificationEmail: (options: Parameters<NonNullable<NonNullable<BetterAuthOptions["emailVerification"]>["sendVerificationEmail"]>>[0]) => Promise<void>;
1796
+ expiresIn: number;
1797
+ };
1798
+ socialProviders: {
1799
+ microsoft: {
1800
+ tenantId: string;
1801
+ clientId: string;
1802
+ clientSecret: string;
1803
+ getUserInfo: (token: OAuth2Tokens) => Promise<{
1804
+ user: {
1805
+ id: any;
1806
+ email: any;
1807
+ name: any;
1808
+ image: string | undefined;
1809
+ emailVerified: true;
1810
+ };
1811
+ data: any;
1812
+ }>;
1813
+ } | undefined;
1814
+ google: {
1815
+ clientId: string;
1816
+ clientSecret: string;
1817
+ } | undefined;
1818
+ };
1819
+ databaseHooks: {
1820
+ user: {
1821
+ create: {
1822
+ before: (user: {
1823
+ id: string;
1824
+ createdAt: Date;
1825
+ updatedAt: Date;
1826
+ email: string;
1827
+ emailVerified: boolean;
1828
+ name: string;
1829
+ image?: string | null | undefined;
1830
+ } & Record<string, unknown>) => Promise<{
1831
+ data: {
1832
+ id: string;
1833
+ createdAt: Date;
1834
+ updatedAt: Date;
1835
+ email: string;
1836
+ emailVerified: boolean;
1837
+ name: string;
1838
+ image?: string | null | undefined;
1839
+ } & Record<string, unknown>;
1840
+ }>;
1841
+ after: (user: {
1842
+ id: string;
1843
+ createdAt: Date;
1844
+ updatedAt: Date;
1845
+ email: string;
1846
+ emailVerified: boolean;
1847
+ name: string;
1848
+ image?: string | null | undefined;
1849
+ } & Record<string, unknown>) => Promise<void>;
1850
+ };
1851
+ update: {
1852
+ before: (user: Partial<{
1853
+ id: string;
1854
+ createdAt: Date;
1855
+ updatedAt: Date;
1856
+ email: string;
1857
+ emailVerified: boolean;
1858
+ name: string;
1859
+ image?: string | null | undefined;
1860
+ }> & Record<string, unknown>) => Promise<{
1861
+ data: Partial<{
1862
+ id: string;
1863
+ createdAt: Date;
1864
+ updatedAt: Date;
1865
+ email: string;
1866
+ emailVerified: boolean;
1867
+ name: string;
1868
+ image?: string | null | undefined;
1869
+ }> & Record<string, unknown>;
1870
+ }>;
1871
+ after: (user: {
1872
+ id: string;
1873
+ createdAt: Date;
1874
+ updatedAt: Date;
1875
+ email: string;
1876
+ emailVerified: boolean;
1877
+ name: string;
1878
+ image?: string | null | undefined;
1879
+ } & Record<string, unknown>) => Promise<void>;
1880
+ };
1881
+ };
1882
+ account: {
1883
+ create: {
1884
+ after: (account: {
1885
+ id: string;
1886
+ createdAt: Date;
1887
+ updatedAt: Date;
1888
+ providerId: string;
1889
+ accountId: string;
1890
+ userId: string;
1891
+ accessToken?: string | null | undefined;
1892
+ refreshToken?: string | null | undefined;
1893
+ idToken?: string | null | undefined;
1894
+ accessTokenExpiresAt?: Date | null | undefined;
1895
+ refreshTokenExpiresAt?: Date | null | undefined;
1896
+ scope?: string | null | undefined;
1897
+ password?: string | null | undefined;
1898
+ }) => Promise<void>;
1899
+ };
1900
+ };
1901
+ session: {
1902
+ create: {
1903
+ before: (session: {
1904
+ id: string;
1905
+ createdAt: Date;
1906
+ updatedAt: Date;
1907
+ userId: string;
1908
+ expiresAt: Date;
1909
+ token: string;
1910
+ ipAddress?: string | null | undefined;
1911
+ userAgent?: string | null | undefined;
1912
+ } & Record<string, unknown>) => Promise<{
1913
+ data: {
1914
+ activeOrganizationId: string | null;
1915
+ organizationRole: string | null;
1916
+ id: string;
1917
+ createdAt: Date;
1918
+ updatedAt: Date;
1919
+ userId: string;
1920
+ expiresAt: Date;
1921
+ token: string;
1922
+ ipAddress?: string | null | undefined;
1923
+ userAgent?: string | null | undefined;
1924
+ };
1925
+ }>;
1926
+ };
1927
+ update: {
1928
+ after: (session: {
1929
+ id: string;
1930
+ createdAt: Date;
1931
+ updatedAt: Date;
1932
+ userId: string;
1933
+ expiresAt: Date;
1934
+ token: string;
1935
+ ipAddress?: string | null | undefined;
1936
+ userAgent?: string | null | undefined;
1937
+ } & Record<string, unknown>) => Promise<void>;
1938
+ };
1939
+ };
1940
+ };
1941
+ plugins: [{
1942
+ id: "bearer";
1943
+ version: string;
1944
+ hooks: {
1945
+ before: {
1946
+ matcher(context: HookEndpointContext): boolean;
1947
+ handler: (inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
1948
+ context: {
1949
+ headers: Headers;
1950
+ };
1951
+ } | undefined>;
1952
+ }[];
1953
+ after: {
1954
+ matcher(context: HookEndpointContext): true;
1955
+ handler: (inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<void>;
1956
+ }[];
1957
+ };
1958
+ options: BearerOptions | undefined;
1959
+ }, {
1960
+ id: "admin";
1961
+ version: string;
1962
+ init(): {
1963
+ options: {
1964
+ databaseHooks: {
1965
+ user: {
1966
+ create: {
1967
+ before(user: {
1968
+ id: string;
1969
+ createdAt: Date;
1970
+ updatedAt: Date;
1971
+ email: string;
1972
+ emailVerified: boolean;
1973
+ name: string;
1974
+ image?: string | null | undefined;
1975
+ } & Record<string, unknown>): Promise<{
1976
+ data: {
1977
+ id: string;
1978
+ createdAt: Date;
1979
+ updatedAt: Date;
1980
+ email: string;
1981
+ emailVerified: boolean;
1982
+ name: string;
1983
+ image?: string | null | undefined;
1984
+ role: string;
1985
+ };
1986
+ }>;
1987
+ };
1988
+ };
1989
+ session: {
1990
+ create: {
1991
+ before(session: {
1992
+ id: string;
1993
+ createdAt: Date;
1994
+ updatedAt: Date;
1995
+ userId: string;
1996
+ expiresAt: Date;
1997
+ token: string;
1998
+ ipAddress?: string | null | undefined;
1999
+ userAgent?: string | null | undefined;
2000
+ } & Record<string, unknown>, ctx: GenericEndpointContext | null): Promise<void>;
2001
+ };
2002
+ };
2003
+ };
2004
+ };
2005
+ };
2006
+ hooks: {
2007
+ after: {
2008
+ matcher(context: HookEndpointContext): boolean;
2009
+ handler: (inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise< SessionWithImpersonatedBy[] | undefined>;
2010
+ }[];
2011
+ };
2012
+ endpoints: {
2013
+ setRole: StrictEndpoint<"/admin/set-role", {
2014
+ method: "POST";
2015
+ body: ZodObject<{
2016
+ userId: ZodCoercedString<unknown>;
2017
+ role: ZodUnion<readonly [ ZodString, ZodArray<ZodString>]>;
2018
+ }, $strip>;
2019
+ requireHeaders: true;
2020
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
2021
+ session: {
2022
+ user: UserWithRole;
2023
+ session: {
2024
+ id: string;
2025
+ createdAt: Date;
2026
+ updatedAt: Date;
2027
+ userId: string;
2028
+ expiresAt: Date;
2029
+ token: string;
2030
+ ipAddress?: string | null | undefined;
2031
+ userAgent?: string | null | undefined;
2032
+ };
2033
+ };
2034
+ }>)[];
2035
+ metadata: {
2036
+ openapi: {
2037
+ operationId: string;
2038
+ summary: string;
2039
+ description: string;
2040
+ responses: {
2041
+ 200: {
2042
+ description: string;
2043
+ content: {
2044
+ "application/json": {
2045
+ schema: {
2046
+ type: "object";
2047
+ properties: {
2048
+ user: {
2049
+ $ref: string;
2050
+ };
2051
+ };
2052
+ };
2053
+ };
2054
+ };
2055
+ };
2056
+ };
2057
+ };
2058
+ $Infer: {
2059
+ body: {
2060
+ userId: string;
2061
+ role: "user" | "admin" | ("user" | "admin")[];
2062
+ };
2063
+ };
2064
+ };
2065
+ }, {
2066
+ user: UserWithRole;
2067
+ }>;
2068
+ getUser: StrictEndpoint<"/admin/get-user", {
2069
+ method: "GET";
2070
+ query: ZodObject<{
2071
+ id: ZodString;
2072
+ }, $strip>;
2073
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
2074
+ session: {
2075
+ user: UserWithRole;
2076
+ session: {
2077
+ id: string;
2078
+ createdAt: Date;
2079
+ updatedAt: Date;
2080
+ userId: string;
2081
+ expiresAt: Date;
2082
+ token: string;
2083
+ ipAddress?: string | null | undefined;
2084
+ userAgent?: string | null | undefined;
2085
+ };
2086
+ };
2087
+ }>)[];
2088
+ metadata: {
2089
+ openapi: {
2090
+ operationId: string;
2091
+ summary: string;
2092
+ description: string;
2093
+ responses: {
2094
+ 200: {
2095
+ description: string;
2096
+ content: {
2097
+ "application/json": {
2098
+ schema: {
2099
+ type: "object";
2100
+ properties: {
2101
+ user: {
2102
+ $ref: string;
2103
+ };
2104
+ };
2105
+ };
2106
+ };
2107
+ };
2108
+ };
2109
+ };
2110
+ };
2111
+ };
2112
+ }, UserWithRole>;
2113
+ createUser: StrictEndpoint<"/admin/create-user", {
2114
+ method: "POST";
2115
+ body: ZodObject<{
2116
+ email: ZodString;
2117
+ password: ZodOptional<ZodString>;
2118
+ name: ZodString;
2119
+ role: ZodOptional<ZodUnion<readonly [ ZodString, ZodArray<ZodString>]>>;
2120
+ data: ZodOptional<ZodRecord<ZodString, ZodAny>>;
2121
+ }, $strip>;
2122
+ metadata: {
2123
+ openapi: {
2124
+ operationId: string;
2125
+ summary: string;
2126
+ description: string;
2127
+ responses: {
2128
+ 200: {
2129
+ description: string;
2130
+ content: {
2131
+ "application/json": {
2132
+ schema: {
2133
+ type: "object";
2134
+ properties: {
2135
+ user: {
2136
+ $ref: string;
2137
+ };
2138
+ };
2139
+ };
2140
+ };
2141
+ };
2142
+ };
2143
+ };
2144
+ };
2145
+ $Infer: {
2146
+ body: {
2147
+ email: string;
2148
+ password?: string | undefined;
2149
+ name: string;
2150
+ role?: "user" | "admin" | ("user" | "admin")[] | undefined;
2151
+ data?: Record<string, any> | undefined;
2152
+ };
2153
+ };
2154
+ };
2155
+ }, {
2156
+ user: UserWithRole;
2157
+ }>;
2158
+ adminUpdateUser: StrictEndpoint<"/admin/update-user", {
2159
+ method: "POST";
2160
+ body: ZodObject<{
2161
+ userId: ZodCoercedString<unknown>;
2162
+ data: ZodRecord<ZodAny, ZodAny>;
2163
+ }, $strip>;
2164
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
2165
+ session: {
2166
+ user: UserWithRole;
2167
+ session: {
2168
+ id: string;
2169
+ createdAt: Date;
2170
+ updatedAt: Date;
2171
+ userId: string;
2172
+ expiresAt: Date;
2173
+ token: string;
2174
+ ipAddress?: string | null | undefined;
2175
+ userAgent?: string | null | undefined;
2176
+ };
2177
+ };
2178
+ }>)[];
2179
+ metadata: {
2180
+ openapi: {
2181
+ operationId: string;
2182
+ summary: string;
2183
+ description: string;
2184
+ responses: {
2185
+ 200: {
2186
+ description: string;
2187
+ content: {
2188
+ "application/json": {
2189
+ schema: {
2190
+ type: "object";
2191
+ properties: {
2192
+ user: {
2193
+ $ref: string;
2194
+ };
2195
+ };
2196
+ };
2197
+ };
2198
+ };
2199
+ };
2200
+ };
2201
+ };
2202
+ };
2203
+ }, UserWithRole>;
2204
+ listUsers: StrictEndpoint<"/admin/list-users", {
2205
+ method: "GET";
2206
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
2207
+ session: {
2208
+ user: UserWithRole;
2209
+ session: {
2210
+ id: string;
2211
+ createdAt: Date;
2212
+ updatedAt: Date;
2213
+ userId: string;
2214
+ expiresAt: Date;
2215
+ token: string;
2216
+ ipAddress?: string | null | undefined;
2217
+ userAgent?: string | null | undefined;
2218
+ };
2219
+ };
2220
+ }>)[];
2221
+ query: ZodObject<{
2222
+ searchValue: ZodOptional<ZodString>;
2223
+ searchField: ZodOptional<ZodEnum<{
2224
+ email: "email";
2225
+ name: "name";
2226
+ }>>;
2227
+ searchOperator: ZodOptional<ZodEnum<{
2228
+ contains: "contains";
2229
+ starts_with: "starts_with";
2230
+ ends_with: "ends_with";
2231
+ }>>;
2232
+ limit: ZodOptional<ZodUnion<[ ZodString, ZodNumber]>>;
2233
+ offset: ZodOptional<ZodUnion<[ ZodString, ZodNumber]>>;
2234
+ sortBy: ZodOptional<ZodString>;
2235
+ sortDirection: ZodOptional<ZodEnum<{
2236
+ asc: "asc";
2237
+ desc: "desc";
2238
+ }>>;
2239
+ filterField: ZodOptional<ZodString>;
2240
+ filterValue: ZodOptional<ZodUnion<[ ZodUnion<[ ZodUnion<[ ZodUnion<[ ZodString, ZodNumber]>, ZodBoolean]>, ZodArray<ZodString>]>, ZodArray<ZodNumber>]>>;
2241
+ filterOperator: ZodOptional<ZodEnum<{
2242
+ eq: "eq";
2243
+ ne: "ne";
2244
+ gt: "gt";
2245
+ gte: "gte";
2246
+ lt: "lt";
2247
+ lte: "lte";
2248
+ in: "in";
2249
+ not_in: "not_in";
2250
+ contains: "contains";
2251
+ starts_with: "starts_with";
2252
+ ends_with: "ends_with";
2253
+ }>>;
2254
+ }, $strip>;
2255
+ metadata: {
2256
+ openapi: {
2257
+ operationId: string;
2258
+ summary: string;
2259
+ description: string;
2260
+ responses: {
2261
+ 200: {
2262
+ description: string;
2263
+ content: {
2264
+ "application/json": {
2265
+ schema: {
2266
+ type: "object";
2267
+ properties: {
2268
+ users: {
2269
+ type: string;
2270
+ items: {
2271
+ $ref: string;
2272
+ };
2273
+ };
2274
+ total: {
2275
+ type: string;
2276
+ };
2277
+ limit: {
2278
+ type: string;
2279
+ };
2280
+ offset: {
2281
+ type: string;
2282
+ };
2283
+ };
2284
+ required: string[];
2285
+ };
2286
+ };
2287
+ };
2288
+ };
2289
+ };
2290
+ };
2291
+ };
2292
+ }, {
2293
+ users: UserWithRole[];
2294
+ total: number;
2295
+ }>;
2296
+ listUserSessions: StrictEndpoint<"/admin/list-user-sessions", {
2297
+ method: "POST";
2298
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
2299
+ session: {
2300
+ user: UserWithRole;
2301
+ session: {
2302
+ id: string;
2303
+ createdAt: Date;
2304
+ updatedAt: Date;
2305
+ userId: string;
2306
+ expiresAt: Date;
2307
+ token: string;
2308
+ ipAddress?: string | null | undefined;
2309
+ userAgent?: string | null | undefined;
2310
+ };
2311
+ };
2312
+ }>)[];
2313
+ body: ZodObject<{
2314
+ userId: ZodCoercedString<unknown>;
2315
+ }, $strip>;
2316
+ metadata: {
2317
+ openapi: {
2318
+ operationId: string;
2319
+ summary: string;
2320
+ description: string;
2321
+ responses: {
2322
+ 200: {
2323
+ description: string;
2324
+ content: {
2325
+ "application/json": {
2326
+ schema: {
2327
+ type: "object";
2328
+ properties: {
2329
+ sessions: {
2330
+ type: string;
2331
+ items: {
2332
+ $ref: string;
2333
+ };
2334
+ };
2335
+ };
2336
+ };
2337
+ };
2338
+ };
2339
+ };
2340
+ };
2341
+ };
2342
+ };
2343
+ }, {
2344
+ sessions: SessionWithImpersonatedBy[];
2345
+ }>;
2346
+ unbanUser: StrictEndpoint<"/admin/unban-user", {
2347
+ method: "POST";
2348
+ body: ZodObject<{
2349
+ userId: ZodCoercedString<unknown>;
2350
+ }, $strip>;
2351
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
2352
+ session: {
2353
+ user: UserWithRole;
2354
+ session: {
2355
+ id: string;
2356
+ createdAt: Date;
2357
+ updatedAt: Date;
2358
+ userId: string;
2359
+ expiresAt: Date;
2360
+ token: string;
2361
+ ipAddress?: string | null | undefined;
2362
+ userAgent?: string | null | undefined;
2363
+ };
2364
+ };
2365
+ }>)[];
2366
+ metadata: {
2367
+ openapi: {
2368
+ operationId: string;
2369
+ summary: string;
2370
+ description: string;
2371
+ responses: {
2372
+ 200: {
2373
+ description: string;
2374
+ content: {
2375
+ "application/json": {
2376
+ schema: {
2377
+ type: "object";
2378
+ properties: {
2379
+ user: {
2380
+ $ref: string;
2381
+ };
2382
+ };
2383
+ };
2384
+ };
2385
+ };
2386
+ };
2387
+ };
2388
+ };
2389
+ };
2390
+ }, {
2391
+ user: UserWithRole;
2392
+ }>;
2393
+ banUser: StrictEndpoint<"/admin/ban-user", {
2394
+ method: "POST";
2395
+ body: ZodObject<{
2396
+ userId: ZodCoercedString<unknown>;
2397
+ banReason: ZodOptional<ZodString>;
2398
+ banExpiresIn: ZodOptional<ZodNumber>;
2399
+ }, $strip>;
2400
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
2401
+ session: {
2402
+ user: UserWithRole;
2403
+ session: {
2404
+ id: string;
2405
+ createdAt: Date;
2406
+ updatedAt: Date;
2407
+ userId: string;
2408
+ expiresAt: Date;
2409
+ token: string;
2410
+ ipAddress?: string | null | undefined;
2411
+ userAgent?: string | null | undefined;
2412
+ };
2413
+ };
2414
+ }>)[];
2415
+ metadata: {
2416
+ openapi: {
2417
+ operationId: string;
2418
+ summary: string;
2419
+ description: string;
2420
+ responses: {
2421
+ 200: {
2422
+ description: string;
2423
+ content: {
2424
+ "application/json": {
2425
+ schema: {
2426
+ type: "object";
2427
+ properties: {
2428
+ user: {
2429
+ $ref: string;
2430
+ };
2431
+ };
2432
+ };
2433
+ };
2434
+ };
2435
+ };
2436
+ };
2437
+ };
2438
+ };
2439
+ }, {
2440
+ user: UserWithRole;
2441
+ }>;
2442
+ impersonateUser: StrictEndpoint<"/admin/impersonate-user", {
2443
+ method: "POST";
2444
+ body: ZodObject<{
2445
+ userId: ZodCoercedString<unknown>;
2446
+ }, $strip>;
2447
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
2448
+ session: {
2449
+ user: UserWithRole;
2450
+ session: {
2451
+ id: string;
2452
+ createdAt: Date;
2453
+ updatedAt: Date;
2454
+ userId: string;
2455
+ expiresAt: Date;
2456
+ token: string;
2457
+ ipAddress?: string | null | undefined;
2458
+ userAgent?: string | null | undefined;
2459
+ };
2460
+ };
2461
+ }>)[];
2462
+ metadata: {
2463
+ openapi: {
2464
+ operationId: string;
2465
+ summary: string;
2466
+ description: string;
2467
+ responses: {
2468
+ 200: {
2469
+ description: string;
2470
+ content: {
2471
+ "application/json": {
2472
+ schema: {
2473
+ type: "object";
2474
+ properties: {
2475
+ session: {
2476
+ $ref: string;
2477
+ };
2478
+ user: {
2479
+ $ref: string;
2480
+ };
2481
+ };
2482
+ };
2483
+ };
2484
+ };
2485
+ };
2486
+ };
2487
+ };
2488
+ };
2489
+ }, {
2490
+ session: {
2491
+ id: string;
2492
+ createdAt: Date;
2493
+ updatedAt: Date;
2494
+ userId: string;
2495
+ expiresAt: Date;
2496
+ token: string;
2497
+ ipAddress?: string | null | undefined;
2498
+ userAgent?: string | null | undefined;
2499
+ };
2500
+ user: UserWithRole;
2501
+ }>;
2502
+ stopImpersonating: StrictEndpoint<"/admin/stop-impersonating", {
2503
+ method: "POST";
2504
+ requireHeaders: true;
2505
+ }, {
2506
+ session: {
2507
+ id: string;
2508
+ createdAt: Date;
2509
+ updatedAt: Date;
2510
+ userId: string;
2511
+ expiresAt: Date;
2512
+ token: string;
2513
+ ipAddress?: string | null | undefined;
2514
+ userAgent?: string | null | undefined;
2515
+ } & Record<string, any>;
2516
+ user: {
2517
+ id: string;
2518
+ createdAt: Date;
2519
+ updatedAt: Date;
2520
+ email: string;
2521
+ emailVerified: boolean;
2522
+ name: string;
2523
+ image?: string | null | undefined;
2524
+ } & Record<string, any>;
2525
+ }>;
2526
+ revokeUserSession: StrictEndpoint<"/admin/revoke-user-session", {
2527
+ method: "POST";
2528
+ body: ZodObject<{
2529
+ sessionToken: ZodString;
2530
+ }, $strip>;
2531
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
2532
+ session: {
2533
+ user: UserWithRole;
2534
+ session: {
2535
+ id: string;
2536
+ createdAt: Date;
2537
+ updatedAt: Date;
2538
+ userId: string;
2539
+ expiresAt: Date;
2540
+ token: string;
2541
+ ipAddress?: string | null | undefined;
2542
+ userAgent?: string | null | undefined;
2543
+ };
2544
+ };
2545
+ }>)[];
2546
+ metadata: {
2547
+ openapi: {
2548
+ operationId: string;
2549
+ summary: string;
2550
+ description: string;
2551
+ responses: {
2552
+ 200: {
2553
+ description: string;
2554
+ content: {
2555
+ "application/json": {
2556
+ schema: {
2557
+ type: "object";
2558
+ properties: {
2559
+ success: {
2560
+ type: string;
2561
+ };
2562
+ };
2563
+ };
2564
+ };
2565
+ };
2566
+ };
2567
+ };
2568
+ };
2569
+ };
2570
+ }, {
2571
+ success: boolean;
2572
+ }>;
2573
+ revokeUserSessions: StrictEndpoint<"/admin/revoke-user-sessions", {
2574
+ method: "POST";
2575
+ body: ZodObject<{
2576
+ userId: ZodCoercedString<unknown>;
2577
+ }, $strip>;
2578
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
2579
+ session: {
2580
+ user: UserWithRole;
2581
+ session: {
2582
+ id: string;
2583
+ createdAt: Date;
2584
+ updatedAt: Date;
2585
+ userId: string;
2586
+ expiresAt: Date;
2587
+ token: string;
2588
+ ipAddress?: string | null | undefined;
2589
+ userAgent?: string | null | undefined;
2590
+ };
2591
+ };
2592
+ }>)[];
2593
+ metadata: {
2594
+ openapi: {
2595
+ operationId: string;
2596
+ summary: string;
2597
+ description: string;
2598
+ responses: {
2599
+ 200: {
2600
+ description: string;
2601
+ content: {
2602
+ "application/json": {
2603
+ schema: {
2604
+ type: "object";
2605
+ properties: {
2606
+ success: {
2607
+ type: string;
2608
+ };
2609
+ };
2610
+ };
2611
+ };
2612
+ };
2613
+ };
2614
+ };
2615
+ };
2616
+ };
2617
+ }, {
2618
+ success: boolean;
2619
+ }>;
2620
+ removeUser: StrictEndpoint<"/admin/remove-user", {
2621
+ method: "POST";
2622
+ body: ZodObject<{
2623
+ userId: ZodCoercedString<unknown>;
2624
+ }, $strip>;
2625
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
2626
+ session: {
2627
+ user: UserWithRole;
2628
+ session: {
2629
+ id: string;
2630
+ createdAt: Date;
2631
+ updatedAt: Date;
2632
+ userId: string;
2633
+ expiresAt: Date;
2634
+ token: string;
2635
+ ipAddress?: string | null | undefined;
2636
+ userAgent?: string | null | undefined;
2637
+ };
2638
+ };
2639
+ }>)[];
2640
+ metadata: {
2641
+ openapi: {
2642
+ operationId: string;
2643
+ summary: string;
2644
+ description: string;
2645
+ responses: {
2646
+ 200: {
2647
+ description: string;
2648
+ content: {
2649
+ "application/json": {
2650
+ schema: {
2651
+ type: "object";
2652
+ properties: {
2653
+ success: {
2654
+ type: string;
2655
+ };
2656
+ };
2657
+ };
2658
+ };
2659
+ };
2660
+ };
2661
+ };
2662
+ };
2663
+ };
2664
+ }, {
2665
+ success: boolean;
2666
+ }>;
2667
+ setUserPassword: StrictEndpoint<"/admin/set-user-password", {
2668
+ method: "POST";
2669
+ body: ZodObject<{
2670
+ newPassword: ZodString;
2671
+ userId: ZodCoercedString<unknown>;
2672
+ }, $strip>;
2673
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
2674
+ session: {
2675
+ user: UserWithRole;
2676
+ session: {
2677
+ id: string;
2678
+ createdAt: Date;
2679
+ updatedAt: Date;
2680
+ userId: string;
2681
+ expiresAt: Date;
2682
+ token: string;
2683
+ ipAddress?: string | null | undefined;
2684
+ userAgent?: string | null | undefined;
2685
+ };
2686
+ };
2687
+ }>)[];
2688
+ metadata: {
2689
+ openapi: {
2690
+ operationId: string;
2691
+ summary: string;
2692
+ description: string;
2693
+ responses: {
2694
+ 200: {
2695
+ description: string;
2696
+ content: {
2697
+ "application/json": {
2698
+ schema: {
2699
+ type: "object";
2700
+ properties: {
2701
+ status: {
2702
+ type: string;
2703
+ };
2704
+ };
2705
+ };
2706
+ };
2707
+ };
2708
+ };
2709
+ };
2710
+ };
2711
+ };
2712
+ }, {
2713
+ status: boolean;
2714
+ }>;
2715
+ userHasPermission: StrictEndpoint<"/admin/has-permission", {
2716
+ method: "POST";
2717
+ body: ZodIntersection<ZodObject<{
2718
+ userId: ZodOptional<ZodCoercedString<unknown>>;
2719
+ role: ZodOptional<ZodString>;
2720
+ }, $strip>, ZodXor<readonly [ ZodObject<{
2721
+ permission: ZodRecord<ZodString, ZodArray<ZodString>>;
2722
+ }, $strip>, ZodObject<{
2723
+ permissions: ZodRecord<ZodString, ZodArray<ZodString>>;
2724
+ }, $strip>]>>;
2725
+ metadata: {
2726
+ openapi: {
2727
+ description: string;
2728
+ requestBody: {
2729
+ content: {
2730
+ "application/json": {
2731
+ schema: {
2732
+ type: "object";
2733
+ properties: {
2734
+ permissions: {
2735
+ type: string;
2736
+ description: string;
2737
+ };
2738
+ };
2739
+ required: string[];
2740
+ };
2741
+ };
2742
+ };
2743
+ };
2744
+ responses: {
2745
+ "200": {
2746
+ description: string;
2747
+ content: {
2748
+ "application/json": {
2749
+ schema: {
2750
+ type: "object";
2751
+ properties: {
2752
+ error: {
2753
+ type: string;
2754
+ };
2755
+ success: {
2756
+ type: string;
2757
+ };
2758
+ };
2759
+ required: string[];
2760
+ };
2761
+ };
2762
+ };
2763
+ };
2764
+ };
2765
+ };
2766
+ $Infer: {
2767
+ body: {
2768
+ permissions: {
2769
+ readonly user?: ("update" | "delete" | "create" | "set-role" | "list" | "ban" | "impersonate" | "impersonate-admins" | "set-password" | "get")[] | undefined;
2770
+ readonly session?: ("delete" | "list" | "revoke")[] | undefined;
2771
+ };
2772
+ } & {
2773
+ userId?: string | undefined;
2774
+ role?: "user" | "admin" | undefined;
2775
+ };
2776
+ };
2777
+ };
2778
+ }, {
2779
+ error: null;
2780
+ success: boolean;
2781
+ }>;
2782
+ };
2783
+ $ERROR_CODES: {
2784
+ USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: RawError<"USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL">;
2785
+ FAILED_TO_CREATE_USER: RawError<"FAILED_TO_CREATE_USER">;
2786
+ USER_ALREADY_EXISTS: RawError<"USER_ALREADY_EXISTS">;
2787
+ YOU_CANNOT_BAN_YOURSELF: RawError<"YOU_CANNOT_BAN_YOURSELF">;
2788
+ YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE: RawError<"YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE">;
2789
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS: RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS">;
2790
+ YOU_ARE_NOT_ALLOWED_TO_LIST_USERS: RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS">;
2791
+ YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS: RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS">;
2792
+ YOU_ARE_NOT_ALLOWED_TO_BAN_USERS: RawError<"YOU_ARE_NOT_ALLOWED_TO_BAN_USERS">;
2793
+ YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS: RawError<"YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS">;
2794
+ YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS: RawError<"YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS">;
2795
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS: RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS">;
2796
+ YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD: RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD">;
2797
+ BANNED_USER: RawError<"BANNED_USER">;
2798
+ YOU_ARE_NOT_ALLOWED_TO_GET_USER: RawError<"YOU_ARE_NOT_ALLOWED_TO_GET_USER">;
2799
+ NO_DATA_TO_UPDATE: RawError<"NO_DATA_TO_UPDATE">;
2800
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS: RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS">;
2801
+ YOU_CANNOT_REMOVE_YOURSELF: RawError<"YOU_CANNOT_REMOVE_YOURSELF">;
2802
+ YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE">;
2803
+ YOU_CANNOT_IMPERSONATE_ADMINS: RawError<"YOU_CANNOT_IMPERSONATE_ADMINS">;
2804
+ INVALID_ROLE_TYPE: RawError<"INVALID_ROLE_TYPE">;
2805
+ };
2806
+ schema: {
2807
+ user: {
2808
+ fields: {
2809
+ role: {
2810
+ type: "string";
2811
+ required: false;
2812
+ input: false;
2813
+ };
2814
+ banned: {
2815
+ type: "boolean";
2816
+ defaultValue: false;
2817
+ required: false;
2818
+ input: false;
2819
+ };
2820
+ banReason: {
2821
+ type: "string";
2822
+ required: false;
2823
+ input: false;
2824
+ };
2825
+ banExpires: {
2826
+ type: "date";
2827
+ required: false;
2828
+ input: false;
2829
+ };
2830
+ };
2831
+ };
2832
+ session: {
2833
+ fields: {
2834
+ impersonatedBy: {
2835
+ type: "string";
2836
+ required: false;
2837
+ };
2838
+ };
2839
+ };
2840
+ };
2841
+ options: NoInfer< AdminOptions>;
2842
+ }, {
2843
+ id: "anonymous";
2844
+ version: string;
2845
+ endpoints: {
2846
+ signInAnonymous: StrictEndpoint<"/sign-in/anonymous", {
2847
+ method: "POST";
2848
+ metadata: {
2849
+ openapi: {
2850
+ description: string;
2851
+ responses: {
2852
+ 200: {
2853
+ description: string;
2854
+ content: {
2855
+ "application/json": {
2856
+ schema: {
2857
+ type: "object";
2858
+ properties: {
2859
+ user: {
2860
+ $ref: string;
2861
+ };
2862
+ session: {
2863
+ $ref: string;
2864
+ };
2865
+ };
2866
+ };
2867
+ };
2868
+ };
2869
+ };
2870
+ };
2871
+ };
2872
+ };
2873
+ }, {
2874
+ token: string;
2875
+ user: Record<string, any> & {
2876
+ id: string;
2877
+ createdAt: Date;
2878
+ updatedAt: Date;
2879
+ email: string;
2880
+ emailVerified: boolean;
2881
+ name: string;
2882
+ image?: string | null | undefined;
2883
+ };
2884
+ }>;
2885
+ deleteAnonymousUser: StrictEndpoint<"/delete-anonymous-user", {
2886
+ method: "POST";
2887
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
2888
+ session: {
2889
+ session: Record<string, any> & {
2890
+ id: string;
2891
+ createdAt: Date;
2892
+ updatedAt: Date;
2893
+ userId: string;
2894
+ expiresAt: Date;
2895
+ token: string;
2896
+ ipAddress?: string | null | undefined;
2897
+ userAgent?: string | null | undefined;
2898
+ };
2899
+ user: Record<string, any> & {
2900
+ id: string;
2901
+ createdAt: Date;
2902
+ updatedAt: Date;
2903
+ email: string;
2904
+ emailVerified: boolean;
2905
+ name: string;
2906
+ image?: string | null | undefined;
2907
+ };
2908
+ };
2909
+ }>)[];
2910
+ metadata: {
2911
+ openapi: {
2912
+ description: string;
2913
+ responses: {
2914
+ 200: {
2915
+ description: string;
2916
+ content: {
2917
+ "application/json": {
2918
+ schema: {
2919
+ type: "object";
2920
+ properties: {
2921
+ success: {
2922
+ type: string;
2923
+ };
2924
+ };
2925
+ };
2926
+ };
2927
+ };
2928
+ };
2929
+ "400": {
2930
+ description: string;
2931
+ content: {
2932
+ "application/json": {
2933
+ schema: {
2934
+ type: "object";
2935
+ properties: {
2936
+ message: {
2937
+ type: string;
2938
+ };
2939
+ };
2940
+ };
2941
+ required: string[];
2942
+ };
2943
+ };
2944
+ };
2945
+ "500": {
2946
+ description: string;
2947
+ content: {
2948
+ "application/json": {
2949
+ schema: {
2950
+ type: "object";
2951
+ properties: {
2952
+ message: {
2953
+ type: string;
2954
+ };
2955
+ };
2956
+ required: string[];
2957
+ };
2958
+ };
2959
+ };
2960
+ };
2961
+ };
2962
+ };
2963
+ };
2964
+ }, {
2965
+ success: boolean;
2966
+ }>;
2967
+ };
2968
+ hooks: {
2969
+ after: {
2970
+ matcher(ctx: HookEndpointContext): boolean;
2971
+ handler: (inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<void>;
2972
+ }[];
2973
+ };
2974
+ options: AnonymousOptions | undefined;
2975
+ schema: {
2976
+ user: {
2977
+ fields: {
2978
+ isAnonymous: {
2979
+ type: "boolean";
2980
+ required: false;
2981
+ input: false;
2982
+ defaultValue: false;
2983
+ };
2984
+ };
2985
+ };
2986
+ };
2987
+ $ERROR_CODES: {
2988
+ FAILED_TO_CREATE_USER: RawError<"FAILED_TO_CREATE_USER">;
2989
+ INVALID_EMAIL_FORMAT: RawError<"INVALID_EMAIL_FORMAT">;
2990
+ COULD_NOT_CREATE_SESSION: RawError<"COULD_NOT_CREATE_SESSION">;
2991
+ ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY: RawError<"ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY">;
2992
+ FAILED_TO_DELETE_ANONYMOUS_USER: RawError<"FAILED_TO_DELETE_ANONYMOUS_USER">;
2993
+ USER_IS_NOT_ANONYMOUS: RawError<"USER_IS_NOT_ANONYMOUS">;
2994
+ DELETE_ANONYMOUS_USER_DISABLED: RawError<"DELETE_ANONYMOUS_USER_DISABLED">;
2995
+ };
2996
+ }, DefaultOrganizationPlugin<{
2997
+ allowUserToCreateOrganization: (user: {
2998
+ id: string;
2999
+ createdAt: Date;
3000
+ updatedAt: Date;
3001
+ email: string;
3002
+ emailVerified: boolean;
3003
+ name: string;
3004
+ image?: string | null | undefined;
3005
+ } & Record<string, any>) => boolean;
3006
+ organizationHooks: {
3007
+ beforeCreateOrganization: ({ organization, user }: {
3008
+ organization: {
3009
+ name?: string;
3010
+ slug?: string;
3011
+ logo?: string;
3012
+ metadata?: Record<string, any>;
3013
+ [key: string]: any;
3014
+ };
3015
+ user: User & Record<string, any>;
3016
+ }) => Promise<{
3017
+ data: {
3018
+ createdBy: string;
3019
+ updatedBy: string;
3020
+ media: {
3021
+ name: string;
3022
+ src: {
3023
+ type: string;
3024
+ name: string;
3025
+ mimeType: string;
3026
+ bytesCount: number;
3027
+ extension: string;
3028
+ metadata: Record<string, string>;
3029
+ tags: Record<string, string>;
3030
+ storageHandle: {
3031
+ type: "azure-blob";
3032
+ blobUri: string;
3033
+ containerName: string;
3034
+ pathRelativeToContainer: string;
3035
+ } | {
3036
+ type: "s3";
3037
+ bucket: string;
3038
+ key: string;
3039
+ region: string;
3040
+ };
3041
+ storagePolicy: StoragePolicy;
3042
+ storedFileName: string;
3043
+ signData?: string | undefined;
3044
+ };
3045
+ srcSet: {
3046
+ type: string;
3047
+ name: string;
3048
+ mimeType: string;
3049
+ bytesCount: number;
3050
+ extension: string;
3051
+ metadata: Record<string, string>;
3052
+ tags: Record<string, string>;
3053
+ storageHandle: {
3054
+ type: "azure-blob";
3055
+ blobUri: string;
3056
+ containerName: string;
3057
+ pathRelativeToContainer: string;
3058
+ } | {
3059
+ type: "s3";
3060
+ bucket: string;
3061
+ key: string;
3062
+ region: string;
3063
+ };
3064
+ storagePolicy: StoragePolicy;
3065
+ storedFileName: string;
3066
+ signData?: string | undefined;
3067
+ }[];
3068
+ rawOptions?: {
3069
+ type: import("models").MediaType.picture;
3070
+ width: number;
3071
+ height: number;
3072
+ blurhash?: string | undefined;
3073
+ } | {
3074
+ type: import("models").MediaType.video;
3075
+ width: number;
3076
+ height: number;
3077
+ duration: number;
3078
+ } | {
3079
+ type: import("models").MediaType.audio;
3080
+ duration: number;
3081
+ } | {
3082
+ type: import("models").MediaType.office;
3083
+ } | {
3084
+ type: import("models").MediaType.archive;
3085
+ } | {
3086
+ type: import("models").MediaType.binary;
3087
+ } | {
3088
+ type: import("models").MediaType.executable;
3089
+ } | undefined;
3090
+ };
3091
+ name?: string;
3092
+ slug?: string;
3093
+ logo?: string;
3094
+ metadata?: Record<string, any>;
3095
+ };
3096
+ } | {
3097
+ data: {
3098
+ createdBy: string;
3099
+ updatedBy: string;
3100
+ name?: string;
3101
+ slug?: string;
3102
+ logo?: string;
3103
+ metadata?: Record<string, any>;
3104
+ };
3105
+ }>;
3106
+ afterCreateOrganization: ({ organization }: {
3107
+ organization: Organization & Record<string, any>;
3108
+ member: Member & Record<string, any>;
3109
+ user: User & Record<string, any>;
3110
+ }) => Promise<void>;
3111
+ beforeUpdateOrganization: ({ organization, user }: {
3112
+ organization: {
3113
+ name?: string;
3114
+ slug?: string;
3115
+ logo?: string;
3116
+ metadata?: Record<string, any>;
3117
+ [key: string]: any;
3118
+ };
3119
+ user: User & Record<string, any>;
3120
+ member: Member & Record<string, any>;
3121
+ }) => Promise<{
3122
+ data: {
3123
+ updatedBy: string;
3124
+ updatedAt: Date;
3125
+ media: {
3126
+ name: string;
3127
+ src: {
3128
+ type: string;
3129
+ name: string;
3130
+ mimeType: string;
3131
+ bytesCount: number;
3132
+ extension: string;
3133
+ metadata: Record<string, string>;
3134
+ tags: Record<string, string>;
3135
+ storageHandle: {
3136
+ type: "azure-blob";
3137
+ blobUri: string;
3138
+ containerName: string;
3139
+ pathRelativeToContainer: string;
3140
+ } | {
3141
+ type: "s3";
3142
+ bucket: string;
3143
+ key: string;
3144
+ region: string;
3145
+ };
3146
+ storagePolicy: StoragePolicy;
3147
+ storedFileName: string;
3148
+ signData?: string | undefined;
3149
+ };
3150
+ srcSet: {
3151
+ type: string;
3152
+ name: string;
3153
+ mimeType: string;
3154
+ bytesCount: number;
3155
+ extension: string;
3156
+ metadata: Record<string, string>;
3157
+ tags: Record<string, string>;
3158
+ storageHandle: {
3159
+ type: "azure-blob";
3160
+ blobUri: string;
3161
+ containerName: string;
3162
+ pathRelativeToContainer: string;
3163
+ } | {
3164
+ type: "s3";
3165
+ bucket: string;
3166
+ key: string;
3167
+ region: string;
3168
+ };
3169
+ storagePolicy: StoragePolicy;
3170
+ storedFileName: string;
3171
+ signData?: string | undefined;
3172
+ }[];
3173
+ rawOptions?: {
3174
+ type: import("models").MediaType.picture;
3175
+ width: number;
3176
+ height: number;
3177
+ blurhash?: string | undefined;
3178
+ } | {
3179
+ type: import("models").MediaType.video;
3180
+ width: number;
3181
+ height: number;
3182
+ duration: number;
3183
+ } | {
3184
+ type: import("models").MediaType.audio;
3185
+ duration: number;
3186
+ } | {
3187
+ type: import("models").MediaType.office;
3188
+ } | {
3189
+ type: import("models").MediaType.archive;
3190
+ } | {
3191
+ type: import("models").MediaType.binary;
3192
+ } | {
3193
+ type: import("models").MediaType.executable;
3194
+ } | undefined;
3195
+ };
3196
+ name?: string;
3197
+ slug?: string;
3198
+ logo?: string;
3199
+ metadata?: Record<string, any>;
3200
+ };
3201
+ } | {
3202
+ data: {
3203
+ updatedBy: string;
3204
+ updatedAt: Date;
3205
+ name?: string;
3206
+ slug?: string;
3207
+ logo?: string;
3208
+ metadata?: Record<string, any>;
3209
+ };
3210
+ }>;
3211
+ afterUpdateOrganization: ({ organization }: {
3212
+ organization: ( Organization & Record<string, any>) | null;
3213
+ user: User & Record<string, any>;
3214
+ member: Member & Record<string, any>;
3215
+ }) => Promise<void>;
3216
+ afterRemoveMember: ({ member }: {
3217
+ member: Member & Record<string, any>;
3218
+ user: User & Record<string, any>;
3219
+ organization: Organization & Record<string, any>;
3220
+ }) => Promise<void>;
3221
+ };
3222
+ sendInvitationEmail(data: {
3223
+ id: string;
3224
+ role: string;
3225
+ email: string;
3226
+ organization: Organization;
3227
+ invitation: Invitation;
3228
+ inviter: Member & {
3229
+ user: User;
3230
+ };
3231
+ }): Promise<void>;
3232
+ ac: {
3233
+ newRole<K extends "member" | "organization" | "invitation" | "team" | "ac">(statements: Subset<K, {
3234
+ readonly organization: readonly ["update", "delete"];
3235
+ readonly member: readonly ["create", "update", "delete"];
3236
+ readonly invitation: readonly ["create", "cancel"];
3237
+ readonly team: readonly ["create", "update", "delete"];
3238
+ readonly ac: readonly ["create", "read", "update", "delete"];
3239
+ }>): {
3240
+ authorize<K_1 extends K>(request: K_1 extends infer T extends K_2 ? { [key in T]?: Subset<K, {
3241
+ readonly organization: readonly ["update", "delete"];
3242
+ readonly member: readonly ["create", "update", "delete"];
3243
+ readonly invitation: readonly ["create", "cancel"];
3244
+ readonly team: readonly ["create", "update", "delete"];
3245
+ readonly ac: readonly ["create", "read", "update", "delete"];
3246
+ }>[key] | {
3247
+ actions: Subset<K, {
3248
+ readonly organization: readonly ["update", "delete"];
3249
+ readonly member: readonly ["create", "update", "delete"];
3250
+ readonly invitation: readonly ["create", "cancel"];
3251
+ readonly team: readonly ["create", "update", "delete"];
3252
+ readonly ac: readonly ["create", "read", "update", "delete"];
3253
+ }>[key];
3254
+ connector: "OR" | "AND";
3255
+ } | undefined; } : never, connector?: "OR" | "AND"): AuthorizeResponse;
3256
+ statements: Subset<K, {
3257
+ readonly organization: readonly ["update", "delete"];
3258
+ readonly member: readonly ["create", "update", "delete"];
3259
+ readonly invitation: readonly ["create", "cancel"];
3260
+ readonly team: readonly ["create", "update", "delete"];
3261
+ readonly ac: readonly ["create", "read", "update", "delete"];
3262
+ }>;
3263
+ };
3264
+ statements: {
3265
+ readonly organization: readonly ["update", "delete"];
3266
+ readonly member: readonly ["create", "update", "delete"];
3267
+ readonly invitation: readonly ["create", "cancel"];
3268
+ readonly team: readonly ["create", "update", "delete"];
3269
+ readonly ac: readonly ["create", "read", "update", "delete"];
3270
+ };
3271
+ };
3272
+ roles: {
3273
+ owner: {
3274
+ authorize<K_1 extends "member" | "organization" | "invitation" | "team" | "ac">(request: K_1 extends infer T extends K ? { [key in T]?: Subset<"member" | "organization" | "invitation" | "team" | "ac", {
3275
+ readonly organization: readonly ["update", "delete"];
3276
+ readonly member: readonly ["create", "update", "delete"];
3277
+ readonly invitation: readonly ["create", "cancel"];
3278
+ readonly team: readonly ["create", "update", "delete"];
3279
+ readonly ac: readonly ["create", "read", "update", "delete"];
3280
+ }>[key] | {
3281
+ actions: Subset<"member" | "organization" | "invitation" | "team" | "ac", {
3282
+ readonly organization: readonly ["update", "delete"];
3283
+ readonly member: readonly ["create", "update", "delete"];
3284
+ readonly invitation: readonly ["create", "cancel"];
3285
+ readonly team: readonly ["create", "update", "delete"];
3286
+ readonly ac: readonly ["create", "read", "update", "delete"];
3287
+ }>[key];
3288
+ connector: "OR" | "AND";
3289
+ } | undefined; } : never, connector?: "OR" | "AND"): AuthorizeResponse;
3290
+ statements: Subset<"member" | "organization" | "invitation" | "team" | "ac", {
3291
+ readonly organization: readonly ["update", "delete"];
3292
+ readonly member: readonly ["create", "update", "delete"];
3293
+ readonly invitation: readonly ["create", "cancel"];
3294
+ readonly team: readonly ["create", "update", "delete"];
3295
+ readonly ac: readonly ["create", "read", "update", "delete"];
3296
+ }>;
3297
+ };
3298
+ admin: {
3299
+ authorize<K_1 extends "member" | "organization" | "invitation" | "team" | "ac">(request: K_1 extends infer T extends K ? { [key in T]?: Subset<"member" | "organization" | "invitation" | "team" | "ac", {
3300
+ readonly organization: readonly ["update", "delete"];
3301
+ readonly member: readonly ["create", "update", "delete"];
3302
+ readonly invitation: readonly ["create", "cancel"];
3303
+ readonly team: readonly ["create", "update", "delete"];
3304
+ readonly ac: readonly ["create", "read", "update", "delete"];
3305
+ }>[key] | {
3306
+ actions: Subset<"member" | "organization" | "invitation" | "team" | "ac", {
3307
+ readonly organization: readonly ["update", "delete"];
3308
+ readonly member: readonly ["create", "update", "delete"];
3309
+ readonly invitation: readonly ["create", "cancel"];
3310
+ readonly team: readonly ["create", "update", "delete"];
3311
+ readonly ac: readonly ["create", "read", "update", "delete"];
3312
+ }>[key];
3313
+ connector: "OR" | "AND";
3314
+ } | undefined; } : never, connector?: "OR" | "AND"): AuthorizeResponse;
3315
+ statements: Subset<"member" | "organization" | "invitation" | "team" | "ac", {
3316
+ readonly organization: readonly ["update", "delete"];
3317
+ readonly member: readonly ["create", "update", "delete"];
3318
+ readonly invitation: readonly ["create", "cancel"];
3319
+ readonly team: readonly ["create", "update", "delete"];
3320
+ readonly ac: readonly ["create", "read", "update", "delete"];
3321
+ }>;
3322
+ };
3323
+ member: {
3324
+ authorize<K_1 extends "member" | "organization" | "invitation" | "team" | "ac">(request: K_1 extends infer T extends K ? { [key in T]?: Subset<"member" | "organization" | "invitation" | "team" | "ac", {
3325
+ readonly organization: readonly ["update", "delete"];
3326
+ readonly member: readonly ["create", "update", "delete"];
3327
+ readonly invitation: readonly ["create", "cancel"];
3328
+ readonly team: readonly ["create", "update", "delete"];
3329
+ readonly ac: readonly ["create", "read", "update", "delete"];
3330
+ }>[key] | {
3331
+ actions: Subset<"member" | "organization" | "invitation" | "team" | "ac", {
3332
+ readonly organization: readonly ["update", "delete"];
3333
+ readonly member: readonly ["create", "update", "delete"];
3334
+ readonly invitation: readonly ["create", "cancel"];
3335
+ readonly team: readonly ["create", "update", "delete"];
3336
+ readonly ac: readonly ["create", "read", "update", "delete"];
3337
+ }>[key];
3338
+ connector: "OR" | "AND";
3339
+ } | undefined; } : never, connector?: "OR" | "AND"): AuthorizeResponse;
3340
+ statements: Subset<"member" | "organization" | "invitation" | "team" | "ac", {
3341
+ readonly organization: readonly ["update", "delete"];
3342
+ readonly member: readonly ["create", "update", "delete"];
3343
+ readonly invitation: readonly ["create", "cancel"];
3344
+ readonly team: readonly ["create", "update", "delete"];
3345
+ readonly ac: readonly ["create", "read", "update", "delete"];
3346
+ }>;
3347
+ };
3348
+ user: {
3349
+ authorize<K_1 extends "member" | "organization" | "invitation" | "team" | "ac">(request: K_1 extends infer T extends K ? { [key in T]?: Subset<"member" | "organization" | "invitation" | "team" | "ac", {
3350
+ readonly organization: readonly ["update", "delete"];
3351
+ readonly member: readonly ["create", "update", "delete"];
3352
+ readonly invitation: readonly ["create", "cancel"];
3353
+ readonly team: readonly ["create", "update", "delete"];
3354
+ readonly ac: readonly ["create", "read", "update", "delete"];
3355
+ }>[key] | {
3356
+ actions: Subset<"member" | "organization" | "invitation" | "team" | "ac", {
3357
+ readonly organization: readonly ["update", "delete"];
3358
+ readonly member: readonly ["create", "update", "delete"];
3359
+ readonly invitation: readonly ["create", "cancel"];
3360
+ readonly team: readonly ["create", "update", "delete"];
3361
+ readonly ac: readonly ["create", "read", "update", "delete"];
3362
+ }>[key];
3363
+ connector: "OR" | "AND";
3364
+ } | undefined; } : never, connector?: "OR" | "AND"): AuthorizeResponse;
3365
+ statements: Subset<"member" | "organization" | "invitation" | "team" | "ac", {
3366
+ readonly organization: readonly ["update", "delete"];
3367
+ readonly member: readonly ["create", "update", "delete"];
3368
+ readonly invitation: readonly ["create", "cancel"];
3369
+ readonly team: readonly ["create", "update", "delete"];
3370
+ readonly ac: readonly ["create", "read", "update", "delete"];
3371
+ }>;
3372
+ };
3373
+ };
3374
+ schema: {
3375
+ organization: {
3376
+ additionalFields: {
3377
+ updatedAt: {
3378
+ type: "string";
3379
+ required: false;
3380
+ };
3381
+ createdBy: {
3382
+ type: "string";
3383
+ required: false;
3384
+ };
3385
+ updatedBy: {
3386
+ type: "string";
3387
+ required: false;
3388
+ };
3389
+ deleted: {
3390
+ type: "boolean";
3391
+ required: false;
3392
+ };
3393
+ deletedAt: {
3394
+ type: "string";
3395
+ required: false;
3396
+ };
3397
+ deletedBy: {
3398
+ type: "string";
3399
+ required: false;
3400
+ };
3401
+ media: {
3402
+ type: "json";
3403
+ required: false;
3404
+ };
3405
+ };
3406
+ };
3407
+ };
3408
+ }>, {
3409
+ id: "open-api";
3410
+ version: string;
3411
+ endpoints: {
3412
+ generateOpenAPISchema: StrictEndpoint<"/open-api/generate-schema", {
3413
+ method: "GET";
3414
+ }, {
3415
+ openapi: string;
3416
+ info: {
3417
+ title: string;
3418
+ description: string;
3419
+ version: string;
3420
+ };
3421
+ components: {
3422
+ securitySchemes: {
3423
+ apiKeyCookie: {
3424
+ type: string;
3425
+ in: string;
3426
+ name: string;
3427
+ description: string;
3428
+ };
3429
+ bearerAuth: {
3430
+ type: string;
3431
+ scheme: string;
3432
+ description: string;
3433
+ };
3434
+ };
3435
+ schemas: {
3436
+ [x: string]: OpenAPIModelSchema;
3437
+ };
3438
+ };
3439
+ security: {
3440
+ apiKeyCookie: never[];
3441
+ bearerAuth: never[];
3442
+ }[];
3443
+ servers: {
3444
+ url: string;
3445
+ }[];
3446
+ tags: {
3447
+ name: string;
3448
+ description: string;
3449
+ }[];
3450
+ paths: Record<string, Path>;
3451
+ }>;
3452
+ openAPIReference: StrictEndpoint< LiteralString | "/reference", {
3453
+ method: "GET";
3454
+ metadata: {
3455
+ readonly scope: "server";
3456
+ };
3457
+ }, Response>;
3458
+ };
3459
+ options: NoInfer< OpenAPIOptions>;
3460
+ }, BetterAuthPlugin, BetterAuthPlugin, BetterAuthPlugin];
3461
+ hooks: {
3462
+ after: (inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<void>;
3463
+ };
3464
+ }>;
3465
+ export type Session = {
3466
+ session: (typeof auth.$Infer.Session)['session'] & {
3467
+ activeOrganizationId?: string | null;
3468
+ organizationRole?: string | null;
3469
+ };
3470
+ user: (typeof auth.$Infer.Session)['user'] & {
3471
+ isAnonymous?: boolean | null;
3472
+ role?: string | null;
3473
+ };
3474
+ };
3475
+ export type User = Session['user'];
3476
+ export type Organization = (typeof auth)['$Infer'] extends {
3477
+ Organization: infer O;
3478
+ } ? O : never;