@workos-inc/widgets 1.0.1 → 1.1.1

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 (460) hide show
  1. package/README.md +65 -0
  2. package/dist/cjs/api/api-provider.d.ts +26 -0
  3. package/dist/cjs/api/api-provider.d.ts.map +1 -0
  4. package/dist/cjs/api/api-provider.js +123 -0
  5. package/dist/cjs/api/api-provider.js.map +1 -0
  6. package/dist/cjs/api/constants.d.ts +2 -0
  7. package/dist/cjs/api/constants.d.ts.map +1 -0
  8. package/dist/cjs/api/constants.js +5 -0
  9. package/dist/cjs/api/constants.js.map +1 -0
  10. package/dist/cjs/api/endpoint.d.ts +957 -0
  11. package/dist/cjs/api/endpoint.d.ts.map +1 -0
  12. package/dist/cjs/api/endpoint.js +856 -0
  13. package/dist/cjs/api/endpoint.js.map +1 -0
  14. package/dist/cjs/api/errors.d.ts +33 -0
  15. package/dist/cjs/api/errors.d.ts.map +1 -0
  16. package/dist/cjs/api/errors.js +40 -0
  17. package/dist/cjs/api/errors.js.map +1 -0
  18. package/dist/cjs/api/index.d.ts +3 -0
  19. package/dist/cjs/api/index.d.ts.map +1 -0
  20. package/dist/cjs/api/index.js +19 -0
  21. package/dist/cjs/api/index.js.map +1 -0
  22. package/dist/cjs/api/utils.d.ts +10 -0
  23. package/dist/cjs/api/utils.d.ts.map +1 -0
  24. package/dist/cjs/api/utils.js +42 -0
  25. package/dist/cjs/api/utils.js.map +1 -0
  26. package/dist/cjs/api/widgets-api-client.d.ts +21 -0
  27. package/dist/cjs/api/widgets-api-client.d.ts.map +1 -0
  28. package/dist/cjs/api/widgets-api-client.js +61 -0
  29. package/dist/cjs/api/widgets-api-client.js.map +1 -0
  30. package/dist/cjs/card-list.d.ts +6 -0
  31. package/dist/cjs/card-list.d.ts.map +1 -0
  32. package/dist/cjs/card-list.js +13 -0
  33. package/dist/cjs/card-list.js.map +1 -0
  34. package/dist/cjs/index.d.ts +3 -0
  35. package/dist/cjs/index.d.ts.map +1 -1
  36. package/dist/cjs/index.js +7 -1
  37. package/dist/cjs/index.js.map +1 -1
  38. package/dist/cjs/lib/add-mfa-dialog.d.ts +9 -0
  39. package/dist/cjs/lib/add-mfa-dialog.d.ts.map +1 -0
  40. package/dist/cjs/lib/add-mfa-dialog.js +135 -0
  41. package/dist/cjs/lib/add-mfa-dialog.js.map +1 -0
  42. package/dist/cjs/lib/api/user.d.ts +13 -57
  43. package/dist/cjs/lib/api/user.d.ts.map +1 -1
  44. package/dist/cjs/lib/api/user.js +44 -314
  45. package/dist/cjs/lib/api/user.js.map +1 -1
  46. package/dist/cjs/lib/change-password-dialog.d.ts +8 -0
  47. package/dist/cjs/lib/change-password-dialog.d.ts.map +1 -0
  48. package/dist/cjs/lib/change-password-dialog.js +97 -0
  49. package/dist/cjs/lib/change-password-dialog.js.map +1 -0
  50. package/dist/cjs/lib/copy-button.d.ts +8 -0
  51. package/dist/cjs/lib/copy-button.d.ts.map +1 -0
  52. package/dist/cjs/lib/copy-button.js +63 -0
  53. package/dist/cjs/lib/copy-button.js.map +1 -0
  54. package/dist/cjs/lib/delete-user-dialog.d.ts +2 -2
  55. package/dist/cjs/lib/delete-user-dialog.d.ts.map +1 -1
  56. package/dist/cjs/lib/delete-user-dialog.js +1 -1
  57. package/dist/cjs/lib/delete-user-dialog.js.map +1 -1
  58. package/dist/cjs/lib/edit-user-profile-dialog.d.ts +10 -0
  59. package/dist/cjs/lib/edit-user-profile-dialog.d.ts.map +1 -0
  60. package/dist/cjs/lib/edit-user-profile-dialog.js +85 -0
  61. package/dist/cjs/lib/edit-user-profile-dialog.js.map +1 -0
  62. package/dist/cjs/lib/edit-user-role-dialog.d.ts +12 -0
  63. package/dist/cjs/lib/edit-user-role-dialog.d.ts.map +1 -0
  64. package/dist/cjs/lib/{edit-user-details-dialog.js → edit-user-role-dialog.js} +11 -7
  65. package/dist/cjs/lib/edit-user-role-dialog.js.map +1 -0
  66. package/dist/cjs/lib/elements.d.ts +1 -0
  67. package/dist/cjs/lib/elements.d.ts.map +1 -1
  68. package/dist/cjs/lib/elements.js +10 -4
  69. package/dist/cjs/lib/elements.js.map +1 -1
  70. package/dist/cjs/lib/elevated-access.d.ts +8 -0
  71. package/dist/cjs/lib/elevated-access.d.ts.map +1 -0
  72. package/dist/cjs/lib/elevated-access.js +130 -0
  73. package/dist/cjs/lib/elevated-access.js.map +1 -0
  74. package/dist/cjs/lib/generic-error.d.ts +4 -0
  75. package/dist/cjs/lib/generic-error.d.ts.map +1 -0
  76. package/dist/cjs/lib/generic-error.js +57 -0
  77. package/dist/cjs/lib/generic-error.js.map +1 -0
  78. package/dist/cjs/lib/icon-panel.d.ts +3 -0
  79. package/dist/cjs/lib/icon-panel.d.ts.map +1 -0
  80. package/dist/cjs/lib/icon-panel.js +16 -0
  81. package/dist/cjs/lib/icon-panel.js.map +1 -0
  82. package/dist/cjs/lib/icons.d.ts +3 -0
  83. package/dist/cjs/lib/icons.d.ts.map +1 -0
  84. package/dist/cjs/lib/icons.js +8 -0
  85. package/dist/cjs/lib/icons.js.map +1 -0
  86. package/dist/cjs/lib/invite-user-dialog.d.ts.map +1 -1
  87. package/dist/cjs/lib/invite-user-dialog.js +7 -5
  88. package/dist/cjs/lib/invite-user-dialog.js.map +1 -1
  89. package/dist/cjs/lib/logout-all-sessions-dialog.d.ts +9 -0
  90. package/dist/cjs/lib/logout-all-sessions-dialog.d.ts.map +1 -0
  91. package/dist/cjs/lib/logout-all-sessions-dialog.js +52 -0
  92. package/dist/cjs/lib/logout-all-sessions-dialog.js.map +1 -0
  93. package/dist/cjs/lib/logout-dialog.d.ts +10 -0
  94. package/dist/cjs/lib/logout-dialog.d.ts.map +1 -0
  95. package/dist/cjs/lib/logout-dialog.js +58 -0
  96. package/dist/cjs/lib/logout-dialog.js.map +1 -0
  97. package/dist/cjs/lib/marker.d.ts +14 -0
  98. package/dist/cjs/lib/marker.d.ts.map +1 -0
  99. package/dist/cjs/lib/marker.js +38 -0
  100. package/dist/cjs/lib/marker.js.map +1 -0
  101. package/dist/cjs/lib/oauth-icons.d.ts +4 -0
  102. package/dist/cjs/lib/oauth-icons.d.ts.map +1 -0
  103. package/dist/cjs/lib/oauth-icons.js +67 -0
  104. package/dist/cjs/lib/oauth-icons.js.map +1 -0
  105. package/dist/cjs/lib/organization-switcher.d.ts +24 -0
  106. package/dist/cjs/lib/organization-switcher.d.ts.map +1 -0
  107. package/dist/cjs/lib/organization-switcher.js +35 -0
  108. package/dist/cjs/lib/organization-switcher.js.map +1 -0
  109. package/dist/cjs/lib/otp-input.d.ts +20 -0
  110. package/dist/cjs/lib/otp-input.d.ts.map +1 -0
  111. package/dist/cjs/lib/otp-input.js +174 -0
  112. package/dist/cjs/lib/otp-input.js.map +1 -0
  113. package/dist/cjs/lib/resend-invite-dialog.d.ts +2 -2
  114. package/dist/cjs/lib/resend-invite-dialog.d.ts.map +1 -1
  115. package/dist/cjs/lib/resend-invite-dialog.js +1 -1
  116. package/dist/cjs/lib/resend-invite-dialog.js.map +1 -1
  117. package/dist/cjs/lib/reset-mfa-dialog.d.ts +9 -0
  118. package/dist/cjs/lib/reset-mfa-dialog.d.ts.map +1 -0
  119. package/dist/cjs/lib/reset-mfa-dialog.js +60 -0
  120. package/dist/cjs/lib/reset-mfa-dialog.js.map +1 -0
  121. package/dist/cjs/lib/revoke-invite-dialog.d.ts +2 -2
  122. package/dist/cjs/lib/revoke-invite-dialog.d.ts.map +1 -1
  123. package/dist/cjs/lib/revoke-invite-dialog.js +1 -1
  124. package/dist/cjs/lib/revoke-invite-dialog.js.map +1 -1
  125. package/dist/cjs/lib/save-button.d.ts +11 -0
  126. package/dist/cjs/lib/save-button.d.ts.map +1 -0
  127. package/dist/cjs/lib/save-button.js +47 -0
  128. package/dist/cjs/lib/save-button.js.map +1 -0
  129. package/dist/cjs/lib/set-password-dialog.d.ts +8 -0
  130. package/dist/cjs/lib/set-password-dialog.d.ts.map +1 -0
  131. package/dist/cjs/lib/set-password-dialog.js +80 -0
  132. package/dist/cjs/lib/set-password-dialog.js.map +1 -0
  133. package/dist/cjs/lib/use-dialog-close.d.ts +2 -0
  134. package/dist/cjs/lib/use-dialog-close.d.ts.map +1 -0
  135. package/dist/cjs/lib/use-dialog-close.js +43 -0
  136. package/dist/cjs/lib/use-dialog-close.js.map +1 -0
  137. package/dist/cjs/lib/use-security-settings.d.ts +11 -0
  138. package/dist/cjs/lib/use-security-settings.d.ts.map +1 -0
  139. package/dist/cjs/lib/use-security-settings.js +39 -0
  140. package/dist/cjs/lib/use-security-settings.js.map +1 -0
  141. package/dist/cjs/lib/user-actions-dropdown.d.ts +2 -2
  142. package/dist/cjs/lib/user-actions-dropdown.d.ts.map +1 -1
  143. package/dist/cjs/lib/user-actions-dropdown.js +8 -4
  144. package/dist/cjs/lib/user-actions-dropdown.js.map +1 -1
  145. package/dist/cjs/lib/user-profile.d.ts +11 -0
  146. package/dist/cjs/lib/user-profile.d.ts.map +1 -0
  147. package/dist/cjs/lib/user-profile.js +36 -0
  148. package/dist/cjs/lib/user-profile.js.map +1 -0
  149. package/dist/cjs/lib/user-security.d.ts +11 -0
  150. package/dist/cjs/lib/user-security.d.ts.map +1 -0
  151. package/dist/cjs/lib/user-security.js +64 -0
  152. package/dist/cjs/lib/user-security.js.map +1 -0
  153. package/dist/cjs/lib/user-sessions.d.ts +12 -0
  154. package/dist/cjs/lib/user-sessions.d.ts.map +1 -0
  155. package/dist/cjs/lib/user-sessions.js +72 -0
  156. package/dist/cjs/lib/user-sessions.js.map +1 -0
  157. package/dist/cjs/lib/users-filter.d.ts +2 -2
  158. package/dist/cjs/lib/users-filter.d.ts.map +1 -1
  159. package/dist/cjs/lib/users-filter.js.map +1 -1
  160. package/dist/cjs/lib/users-management-context.d.ts +0 -9
  161. package/dist/cjs/lib/users-management-context.d.ts.map +1 -1
  162. package/dist/cjs/lib/users-management-context.js +13 -26
  163. package/dist/cjs/lib/users-management-context.js.map +1 -1
  164. package/dist/cjs/lib/users-management-state.d.ts +3 -3
  165. package/dist/cjs/lib/users-management-state.d.ts.map +1 -1
  166. package/dist/cjs/lib/users-management-state.js.map +1 -1
  167. package/dist/cjs/lib/users-management.d.ts +3 -4
  168. package/dist/cjs/lib/users-management.d.ts.map +1 -1
  169. package/dist/cjs/lib/users-management.js +8 -26
  170. package/dist/cjs/lib/users-management.js.map +1 -1
  171. package/dist/cjs/lib/utils.d.ts +10 -2
  172. package/dist/cjs/lib/utils.d.ts.map +1 -1
  173. package/dist/cjs/lib/utils.js +18 -0
  174. package/dist/cjs/lib/utils.js.map +1 -1
  175. package/dist/cjs/organization-switcher.client.d.ts +8 -0
  176. package/dist/cjs/organization-switcher.client.d.ts.map +1 -0
  177. package/dist/cjs/organization-switcher.client.js +37 -0
  178. package/dist/cjs/organization-switcher.client.js.map +1 -0
  179. package/dist/cjs/user-profile.client.d.ts +7 -0
  180. package/dist/cjs/user-profile.client.d.ts.map +1 -0
  181. package/dist/cjs/user-profile.client.js +31 -0
  182. package/dist/cjs/user-profile.client.js.map +1 -0
  183. package/dist/cjs/user-security.client.d.ts +7 -0
  184. package/dist/cjs/user-security.client.d.ts.map +1 -0
  185. package/dist/cjs/user-security.client.js +27 -0
  186. package/dist/cjs/user-security.client.js.map +1 -0
  187. package/dist/cjs/user-sessions.client.d.ts +12 -0
  188. package/dist/cjs/user-sessions.client.d.ts.map +1 -0
  189. package/dist/cjs/user-sessions.client.js +48 -0
  190. package/dist/cjs/user-sessions.client.js.map +1 -0
  191. package/dist/cjs/users-management.client.d.ts +2 -1
  192. package/dist/cjs/users-management.client.d.ts.map +1 -1
  193. package/dist/cjs/users-management.client.js +12 -43
  194. package/dist/cjs/users-management.client.js.map +1 -1
  195. package/dist/esm/api/api-provider.d.ts +26 -0
  196. package/dist/esm/api/api-provider.d.ts.map +1 -0
  197. package/dist/esm/api/api-provider.js +94 -0
  198. package/dist/esm/api/api-provider.js.map +1 -0
  199. package/dist/esm/api/constants.d.ts +2 -0
  200. package/dist/esm/api/constants.d.ts.map +1 -0
  201. package/dist/esm/api/constants.js +2 -0
  202. package/dist/esm/api/constants.js.map +1 -0
  203. package/dist/esm/api/endpoint.d.ts +957 -0
  204. package/dist/esm/api/endpoint.d.ts.map +1 -0
  205. package/dist/esm/api/endpoint.js +774 -0
  206. package/dist/esm/api/endpoint.js.map +1 -0
  207. package/dist/esm/api/errors.d.ts +33 -0
  208. package/dist/esm/api/errors.d.ts.map +1 -0
  209. package/dist/esm/api/errors.js +34 -0
  210. package/dist/esm/api/errors.js.map +1 -0
  211. package/dist/esm/api/index.d.ts +3 -0
  212. package/dist/esm/api/index.d.ts.map +1 -0
  213. package/dist/esm/api/index.js +3 -0
  214. package/dist/esm/api/index.js.map +1 -0
  215. package/dist/esm/api/utils.d.ts +10 -0
  216. package/dist/esm/api/utils.d.ts.map +1 -0
  217. package/dist/esm/api/utils.js +36 -0
  218. package/dist/esm/api/utils.js.map +1 -0
  219. package/dist/esm/api/widgets-api-client.d.ts +21 -0
  220. package/dist/esm/api/widgets-api-client.d.ts.map +1 -0
  221. package/dist/esm/api/widgets-api-client.js +56 -0
  222. package/dist/esm/api/widgets-api-client.js.map +1 -0
  223. package/dist/esm/card-list.d.ts +6 -0
  224. package/dist/esm/card-list.d.ts.map +1 -0
  225. package/dist/esm/card-list.js +9 -0
  226. package/dist/esm/card-list.js.map +1 -0
  227. package/dist/esm/index.d.ts +3 -0
  228. package/dist/esm/index.d.ts.map +1 -1
  229. package/dist/esm/index.js +3 -0
  230. package/dist/esm/index.js.map +1 -1
  231. package/dist/esm/lib/add-mfa-dialog.d.ts +9 -0
  232. package/dist/esm/lib/add-mfa-dialog.d.ts.map +1 -0
  233. package/dist/esm/lib/add-mfa-dialog.js +109 -0
  234. package/dist/esm/lib/add-mfa-dialog.js.map +1 -0
  235. package/dist/esm/lib/api/user.d.ts +13 -57
  236. package/dist/esm/lib/api/user.d.ts.map +1 -1
  237. package/dist/esm/lib/api/user.js +44 -313
  238. package/dist/esm/lib/api/user.js.map +1 -1
  239. package/dist/esm/lib/change-password-dialog.d.ts +8 -0
  240. package/dist/esm/lib/change-password-dialog.d.ts.map +1 -0
  241. package/dist/esm/lib/change-password-dialog.js +71 -0
  242. package/dist/esm/lib/change-password-dialog.js.map +1 -0
  243. package/dist/esm/lib/copy-button.d.ts +8 -0
  244. package/dist/esm/lib/copy-button.d.ts.map +1 -0
  245. package/dist/esm/lib/copy-button.js +37 -0
  246. package/dist/esm/lib/copy-button.js.map +1 -0
  247. package/dist/esm/lib/delete-user-dialog.d.ts +2 -2
  248. package/dist/esm/lib/delete-user-dialog.d.ts.map +1 -1
  249. package/dist/esm/lib/delete-user-dialog.js +1 -1
  250. package/dist/esm/lib/delete-user-dialog.js.map +1 -1
  251. package/dist/esm/lib/edit-user-profile-dialog.d.ts +10 -0
  252. package/dist/esm/lib/edit-user-profile-dialog.d.ts.map +1 -0
  253. package/dist/esm/lib/edit-user-profile-dialog.js +59 -0
  254. package/dist/esm/lib/edit-user-profile-dialog.js.map +1 -0
  255. package/dist/esm/lib/edit-user-role-dialog.d.ts +12 -0
  256. package/dist/esm/lib/edit-user-role-dialog.d.ts.map +1 -0
  257. package/dist/esm/lib/{edit-user-details-dialog.js → edit-user-role-dialog.js} +10 -6
  258. package/dist/esm/lib/edit-user-role-dialog.js.map +1 -0
  259. package/dist/esm/lib/elements.d.ts +1 -0
  260. package/dist/esm/lib/elements.d.ts.map +1 -1
  261. package/dist/esm/lib/elements.js +9 -3
  262. package/dist/esm/lib/elements.js.map +1 -1
  263. package/dist/esm/lib/elevated-access.d.ts +8 -0
  264. package/dist/esm/lib/elevated-access.d.ts.map +1 -0
  265. package/dist/esm/lib/elevated-access.js +104 -0
  266. package/dist/esm/lib/elevated-access.js.map +1 -0
  267. package/dist/esm/lib/generic-error.d.ts +4 -0
  268. package/dist/esm/lib/generic-error.d.ts.map +1 -0
  269. package/dist/esm/lib/generic-error.js +31 -0
  270. package/dist/esm/lib/generic-error.js.map +1 -0
  271. package/dist/esm/lib/icon-panel.d.ts +3 -0
  272. package/dist/esm/lib/icon-panel.d.ts.map +1 -0
  273. package/dist/esm/lib/icon-panel.js +13 -0
  274. package/dist/esm/lib/icon-panel.js.map +1 -0
  275. package/dist/esm/lib/icons.d.ts +3 -0
  276. package/dist/esm/lib/icons.d.ts.map +1 -0
  277. package/dist/esm/lib/icons.js +5 -0
  278. package/dist/esm/lib/icons.js.map +1 -0
  279. package/dist/esm/lib/invite-user-dialog.d.ts.map +1 -1
  280. package/dist/esm/lib/invite-user-dialog.js +7 -5
  281. package/dist/esm/lib/invite-user-dialog.js.map +1 -1
  282. package/dist/esm/lib/logout-all-sessions-dialog.d.ts +9 -0
  283. package/dist/esm/lib/logout-all-sessions-dialog.d.ts.map +1 -0
  284. package/dist/esm/lib/logout-all-sessions-dialog.js +26 -0
  285. package/dist/esm/lib/logout-all-sessions-dialog.js.map +1 -0
  286. package/dist/esm/lib/logout-dialog.d.ts +10 -0
  287. package/dist/esm/lib/logout-dialog.d.ts.map +1 -0
  288. package/dist/esm/lib/logout-dialog.js +32 -0
  289. package/dist/esm/lib/logout-dialog.js.map +1 -0
  290. package/dist/esm/lib/marker.d.ts +14 -0
  291. package/dist/esm/lib/marker.d.ts.map +1 -0
  292. package/dist/esm/lib/marker.js +9 -0
  293. package/dist/esm/lib/marker.js.map +1 -0
  294. package/dist/esm/lib/oauth-icons.d.ts +4 -0
  295. package/dist/esm/lib/oauth-icons.d.ts.map +1 -0
  296. package/dist/esm/lib/oauth-icons.js +39 -0
  297. package/dist/esm/lib/oauth-icons.js.map +1 -0
  298. package/dist/esm/lib/organization-switcher.d.ts +24 -0
  299. package/dist/esm/lib/organization-switcher.d.ts.map +1 -0
  300. package/dist/esm/lib/organization-switcher.js +29 -0
  301. package/dist/esm/lib/organization-switcher.js.map +1 -0
  302. package/dist/esm/lib/otp-input.d.ts +20 -0
  303. package/dist/esm/lib/otp-input.d.ts.map +1 -0
  304. package/dist/esm/lib/otp-input.js +148 -0
  305. package/dist/esm/lib/otp-input.js.map +1 -0
  306. package/dist/esm/lib/resend-invite-dialog.d.ts +2 -2
  307. package/dist/esm/lib/resend-invite-dialog.d.ts.map +1 -1
  308. package/dist/esm/lib/resend-invite-dialog.js +1 -1
  309. package/dist/esm/lib/resend-invite-dialog.js.map +1 -1
  310. package/dist/esm/lib/reset-mfa-dialog.d.ts +9 -0
  311. package/dist/esm/lib/reset-mfa-dialog.d.ts.map +1 -0
  312. package/dist/esm/lib/reset-mfa-dialog.js +34 -0
  313. package/dist/esm/lib/reset-mfa-dialog.js.map +1 -0
  314. package/dist/esm/lib/revoke-invite-dialog.d.ts +2 -2
  315. package/dist/esm/lib/revoke-invite-dialog.d.ts.map +1 -1
  316. package/dist/esm/lib/revoke-invite-dialog.js +1 -1
  317. package/dist/esm/lib/revoke-invite-dialog.js.map +1 -1
  318. package/dist/esm/lib/save-button.d.ts +11 -0
  319. package/dist/esm/lib/save-button.d.ts.map +1 -0
  320. package/dist/esm/lib/save-button.js +44 -0
  321. package/dist/esm/lib/save-button.js.map +1 -0
  322. package/dist/esm/lib/set-password-dialog.d.ts +8 -0
  323. package/dist/esm/lib/set-password-dialog.d.ts.map +1 -0
  324. package/dist/esm/lib/set-password-dialog.js +54 -0
  325. package/dist/esm/lib/set-password-dialog.js.map +1 -0
  326. package/dist/esm/lib/use-dialog-close.d.ts +2 -0
  327. package/dist/esm/lib/use-dialog-close.d.ts.map +1 -0
  328. package/dist/esm/lib/use-dialog-close.js +17 -0
  329. package/dist/esm/lib/use-dialog-close.js.map +1 -0
  330. package/dist/esm/lib/use-security-settings.d.ts +11 -0
  331. package/dist/esm/lib/use-security-settings.d.ts.map +1 -0
  332. package/dist/esm/lib/use-security-settings.js +36 -0
  333. package/dist/esm/lib/use-security-settings.js.map +1 -0
  334. package/dist/esm/lib/user-actions-dropdown.d.ts +2 -2
  335. package/dist/esm/lib/user-actions-dropdown.d.ts.map +1 -1
  336. package/dist/esm/lib/user-actions-dropdown.js +8 -4
  337. package/dist/esm/lib/user-actions-dropdown.js.map +1 -1
  338. package/dist/esm/lib/user-profile.d.ts +11 -0
  339. package/dist/esm/lib/user-profile.d.ts.map +1 -0
  340. package/dist/esm/lib/user-profile.js +27 -0
  341. package/dist/esm/lib/user-profile.js.map +1 -0
  342. package/dist/esm/lib/user-security.d.ts +11 -0
  343. package/dist/esm/lib/user-security.d.ts.map +1 -0
  344. package/dist/esm/lib/user-security.js +32 -0
  345. package/dist/esm/lib/user-security.js.map +1 -0
  346. package/dist/esm/lib/user-sessions.d.ts +12 -0
  347. package/dist/esm/lib/user-sessions.d.ts.map +1 -0
  348. package/dist/esm/lib/user-sessions.js +40 -0
  349. package/dist/esm/lib/user-sessions.js.map +1 -0
  350. package/dist/esm/lib/users-filter.d.ts +2 -2
  351. package/dist/esm/lib/users-filter.d.ts.map +1 -1
  352. package/dist/esm/lib/users-filter.js.map +1 -1
  353. package/dist/esm/lib/users-management-context.d.ts +0 -9
  354. package/dist/esm/lib/users-management-context.d.ts.map +1 -1
  355. package/dist/esm/lib/users-management-context.js +13 -25
  356. package/dist/esm/lib/users-management-context.js.map +1 -1
  357. package/dist/esm/lib/users-management-state.d.ts +3 -3
  358. package/dist/esm/lib/users-management-state.d.ts.map +1 -1
  359. package/dist/esm/lib/users-management-state.js.map +1 -1
  360. package/dist/esm/lib/users-management.d.ts +3 -4
  361. package/dist/esm/lib/users-management.d.ts.map +1 -1
  362. package/dist/esm/lib/users-management.js +9 -27
  363. package/dist/esm/lib/users-management.js.map +1 -1
  364. package/dist/esm/lib/users-search.d.ts +1 -1
  365. package/dist/esm/lib/users-search.d.ts.map +1 -1
  366. package/dist/esm/lib/utils.d.ts +10 -2
  367. package/dist/esm/lib/utils.d.ts.map +1 -1
  368. package/dist/esm/lib/utils.js +16 -0
  369. package/dist/esm/lib/utils.js.map +1 -1
  370. package/dist/esm/organization-switcher.client.d.ts +8 -0
  371. package/dist/esm/organization-switcher.client.d.ts.map +1 -0
  372. package/dist/esm/organization-switcher.client.js +33 -0
  373. package/dist/esm/organization-switcher.client.js.map +1 -0
  374. package/dist/esm/user-profile.client.d.ts +7 -0
  375. package/dist/esm/user-profile.client.d.ts.map +1 -0
  376. package/dist/esm/user-profile.client.js +27 -0
  377. package/dist/esm/user-profile.client.js.map +1 -0
  378. package/dist/esm/user-security.client.d.ts +7 -0
  379. package/dist/esm/user-security.client.d.ts.map +1 -0
  380. package/dist/esm/user-security.client.js +23 -0
  381. package/dist/esm/user-security.client.js.map +1 -0
  382. package/dist/esm/user-sessions.client.d.ts +12 -0
  383. package/dist/esm/user-sessions.client.d.ts.map +1 -0
  384. package/dist/esm/user-sessions.client.js +44 -0
  385. package/dist/esm/user-sessions.client.js.map +1 -0
  386. package/dist/esm/users-management.client.d.ts +2 -1
  387. package/dist/esm/users-management.client.d.ts.map +1 -1
  388. package/dist/esm/users-management.client.js +12 -20
  389. package/dist/esm/users-management.client.js.map +1 -1
  390. package/dist/tsconfig.cjs.tsbuildinfo +1 -1
  391. package/dist/tsconfig.esm.tsbuildinfo +1 -1
  392. package/package.json +18 -4
  393. package/src/api/api-provider.tsx +141 -0
  394. package/src/api/constants.ts +1 -0
  395. package/src/api/endpoint.ts +3057 -0
  396. package/src/api/errors.ts +48 -0
  397. package/src/api/index.ts +2 -0
  398. package/src/api/utils.ts +42 -0
  399. package/src/api/widgets-api-client.ts +86 -0
  400. package/src/card-list.tsx +26 -0
  401. package/src/index.ts +3 -0
  402. package/src/lib/add-mfa-dialog.tsx +379 -0
  403. package/src/lib/api/user.ts +54 -458
  404. package/src/lib/card-list.css +3 -0
  405. package/src/lib/change-password-dialog.tsx +290 -0
  406. package/src/lib/copy-button.tsx +53 -0
  407. package/src/lib/delete-user-dialog.tsx +9 -6
  408. package/src/lib/edit-user-profile-dialog.tsx +181 -0
  409. package/src/lib/{edit-user-details-dialog.tsx → edit-user-role-dialog.tsx} +12 -9
  410. package/src/lib/elements.tsx +34 -1
  411. package/src/lib/elevated-access.tsx +261 -0
  412. package/src/lib/generic-error.tsx +70 -0
  413. package/src/lib/icon-panel.tsx +26 -0
  414. package/src/lib/icons.tsx +21 -0
  415. package/src/lib/invite-user-dialog.tsx +15 -10
  416. package/src/lib/logout-all-sessions-dialog.tsx +82 -0
  417. package/src/lib/logout-dialog.tsx +85 -0
  418. package/src/lib/marker.css +81 -0
  419. package/src/lib/marker.tsx +39 -0
  420. package/src/lib/oauth-icons.tsx +138 -0
  421. package/src/lib/organization-switcher.tsx +156 -0
  422. package/src/lib/otp-input.tsx +276 -0
  423. package/src/lib/resend-invite-dialog.tsx +9 -6
  424. package/src/lib/reset-mfa-dialog.tsx +104 -0
  425. package/src/lib/revoke-invite-dialog.tsx +9 -6
  426. package/src/lib/save-button.css +60 -0
  427. package/src/lib/save-button.tsx +113 -0
  428. package/src/lib/set-password-dialog.tsx +204 -0
  429. package/src/lib/use-dialog-close.tsx +19 -0
  430. package/src/lib/use-security-settings.tsx +49 -0
  431. package/src/lib/user-actions-dropdown.tsx +10 -6
  432. package/src/lib/user-profile.tsx +247 -0
  433. package/src/lib/user-security.tsx +187 -0
  434. package/src/lib/user-sessions.tsx +204 -0
  435. package/src/lib/users-filter.tsx +2 -2
  436. package/src/lib/users-management-context.tsx +21 -36
  437. package/src/lib/users-management-state.ts +3 -3
  438. package/src/lib/users-management.tsx +21 -77
  439. package/src/lib/utils.ts +30 -2
  440. package/src/organization-switcher.client.tsx +77 -0
  441. package/src/styles.css +44 -0
  442. package/src/user-profile.client.tsx +51 -0
  443. package/src/user-security.client.tsx +51 -0
  444. package/src/user-sessions.client.tsx +96 -0
  445. package/src/users-management.client.tsx +28 -39
  446. package/dist/cjs/lib/api/role.d.ts +0 -9
  447. package/dist/cjs/lib/api/role.d.ts.map +0 -1
  448. package/dist/cjs/lib/api/role.js +0 -115
  449. package/dist/cjs/lib/api/role.js.map +0 -1
  450. package/dist/cjs/lib/edit-user-details-dialog.d.ts +0 -12
  451. package/dist/cjs/lib/edit-user-details-dialog.d.ts.map +0 -1
  452. package/dist/cjs/lib/edit-user-details-dialog.js.map +0 -1
  453. package/dist/esm/lib/api/role.d.ts +0 -9
  454. package/dist/esm/lib/api/role.d.ts.map +0 -1
  455. package/dist/esm/lib/api/role.js +0 -110
  456. package/dist/esm/lib/api/role.js.map +0 -1
  457. package/dist/esm/lib/edit-user-details-dialog.d.ts +0 -12
  458. package/dist/esm/lib/edit-user-details-dialog.d.ts.map +0 -1
  459. package/dist/esm/lib/edit-user-details-dialog.js.map +0 -1
  460. package/src/lib/api/role.ts +0 -147
@@ -0,0 +1,3057 @@
1
+ /**
2
+ * Generated by orval v7.5.0 🍺
3
+ * Do not edit manually.
4
+ * WorkOS Widgets
5
+ * WorkOS Widgets API
6
+ * OpenAPI spec version: 1.0
7
+ */
8
+ import { useMutation, useQuery } from "@tanstack/react-query";
9
+ import type {
10
+ DataTag,
11
+ DefinedInitialDataOptions,
12
+ DefinedUseQueryResult,
13
+ MutationFunction,
14
+ QueryFunction,
15
+ QueryKey,
16
+ UndefinedInitialDataOptions,
17
+ UseMutationOptions,
18
+ UseMutationResult,
19
+ UseQueryOptions,
20
+ UseQueryResult,
21
+ } from "@tanstack/react-query";
22
+ import { useCallback } from "react";
23
+ import { useWidgetsApiClient } from "./widgets-api-client";
24
+ import type { ErrorType, BodyType } from "./widgets-api-client";
25
+ import { useWidgetsApiQueryOptions } from "./widgets-api-client";
26
+
27
+ export const MemberStatus = {
28
+ Active: "Active",
29
+ Invited: "Invited",
30
+ InviteExpired: "InviteExpired",
31
+ InviteRevoked: "InviteRevoked",
32
+ NoInvite: "NoInvite",
33
+ } as const;
34
+ export type MemberStatus = (typeof MemberStatus)[keyof typeof MemberStatus];
35
+
36
+ export const MemberActionsItem = {
37
+ "edit-role": "edit-role",
38
+ "resend-invite": "resend-invite",
39
+ "revoke-invite": "revoke-invite",
40
+ "revoke-membership": "revoke-membership",
41
+ } as const;
42
+ export type MemberActions =
43
+ (typeof MemberActionsItem)[keyof typeof MemberActionsItem][];
44
+
45
+ export type MemberRolesItem = {
46
+ name: string;
47
+ slug: string;
48
+ };
49
+
50
+ export interface Member {
51
+ id: string;
52
+ email: string;
53
+ emailVerified: boolean;
54
+ /** @nullable */
55
+ profilePictureUrl?: string | null;
56
+ /** @nullable */
57
+ firstName?: string | null;
58
+ /** @nullable */
59
+ lastName?: string | null;
60
+ createdAt: string;
61
+ /** @nullable */
62
+ lastActivityAt?: string | null;
63
+ status: MemberStatus;
64
+ actions: MemberActions;
65
+ /** @nullable */
66
+ isLoggedInUser?: boolean | null;
67
+ /** @nullable */
68
+ roles?: MemberRolesItem[] | null;
69
+ }
70
+
71
+ export interface ListMetadata {
72
+ /** @nullable */
73
+ before?: string | null;
74
+ /** @nullable */
75
+ after?: string | null;
76
+ }
77
+
78
+ export interface MemberRole {
79
+ name: string;
80
+ slug: string;
81
+ default: boolean;
82
+ }
83
+
84
+ export interface OrganizationInfo {
85
+ id: string;
86
+ name: string;
87
+ current: boolean;
88
+ /** @nullable */
89
+ favicon?: string | null;
90
+ }
91
+
92
+ export interface OrganizationsResponse {
93
+ data: OrganizationInfo[];
94
+ }
95
+
96
+ export interface OAuthProfile {
97
+ id: string;
98
+ /** @nullable */
99
+ email?: string | null;
100
+ /** @nullable */
101
+ firstName?: string | null;
102
+ /** @nullable */
103
+ lastName?: string | null;
104
+ /** @nullable */
105
+ profilePictureUrl?: string | null;
106
+ /** @nullable */
107
+ lastLoginAt?: string | null;
108
+ }
109
+
110
+ /**
111
+ * @nullable
112
+ */
113
+ export type MeOauthProfiles = {
114
+ AppleOAuth?: OAuthProfile;
115
+ GithubOAuth?: OAuthProfile;
116
+ GoogleOAuth?: OAuthProfile;
117
+ MicrosoftOAuth?: OAuthProfile;
118
+ } | null;
119
+
120
+ export interface Me {
121
+ id: string;
122
+ email: string;
123
+ /** @nullable */
124
+ firstName?: string | null;
125
+ /** @nullable */
126
+ lastName?: string | null;
127
+ /** @nullable */
128
+ profilePictureUrl?: string | null;
129
+ /** @nullable */
130
+ oauthProfiles?: MeOauthProfiles;
131
+ }
132
+
133
+ export type CreateTotpFactorResponseAuthenticationFactorAllOfObject =
134
+ (typeof CreateTotpFactorResponseAuthenticationFactorAllOfObject)[keyof typeof CreateTotpFactorResponseAuthenticationFactorAllOfObject];
135
+
136
+ export const CreateTotpFactorResponseAuthenticationFactorAllOfObject = {
137
+ authentication_factor: "authentication_factor",
138
+ } as const;
139
+
140
+ export type CreateTotpFactorResponseAuthenticationFactorAllOfType =
141
+ (typeof CreateTotpFactorResponseAuthenticationFactorAllOfType)[keyof typeof CreateTotpFactorResponseAuthenticationFactorAllOfType];
142
+
143
+ export const CreateTotpFactorResponseAuthenticationFactorAllOfType = {
144
+ generic_otp: "generic_otp",
145
+ sms: "sms",
146
+ totp: "totp",
147
+ webauthn: "webauthn",
148
+ } as const;
149
+
150
+ /**
151
+ * @nullable
152
+ */
153
+ export type CreateTotpFactorResponseAuthenticationFactorAllOfSms = {
154
+ phone_number: string;
155
+ } | null;
156
+
157
+ /**
158
+ * @nullable
159
+ */
160
+ export type CreateTotpFactorResponseAuthenticationFactorAllOfTotpAnyOf = {
161
+ issuer: string;
162
+ user: string;
163
+ secret: string;
164
+ qr_code: string;
165
+ uri: string;
166
+ } | null;
167
+
168
+ /**
169
+ * @nullable
170
+ */
171
+ export type CreateTotpFactorResponseAuthenticationFactorAllOfTotpAnyOfTwo = {
172
+ issuer: string;
173
+ user: string;
174
+ } | null;
175
+
176
+ export type CreateTotpFactorResponseAuthenticationFactorAllOfTotp =
177
+ | CreateTotpFactorResponseAuthenticationFactorAllOfTotpAnyOf
178
+ | CreateTotpFactorResponseAuthenticationFactorAllOfTotpAnyOfTwo;
179
+
180
+ export type CreateTotpFactorResponseAuthenticationFactorAllOf = {
181
+ object: CreateTotpFactorResponseAuthenticationFactorAllOfObject;
182
+ id: string;
183
+ type: CreateTotpFactorResponseAuthenticationFactorAllOfType;
184
+ /** @nullable */
185
+ user_id?: string | null;
186
+ /** @nullable */
187
+ sms?: CreateTotpFactorResponseAuthenticationFactorAllOfSms;
188
+ totp?: CreateTotpFactorResponseAuthenticationFactorAllOfTotp;
189
+ };
190
+
191
+ export type CreateTotpFactorResponseAuthenticationFactorAllOfEight = {
192
+ created_at: string;
193
+ updated_at: string;
194
+ };
195
+
196
+ export type CreateTotpFactorResponseAuthenticationFactor =
197
+ CreateTotpFactorResponseAuthenticationFactorAllOf &
198
+ CreateTotpFactorResponseAuthenticationFactorAllOfEight &
199
+ Required<
200
+ Pick<
201
+ CreateTotpFactorResponseAuthenticationFactorAllOf &
202
+ CreateTotpFactorResponseAuthenticationFactorAllOfEight,
203
+ "object" | "id" | "type" | "created_at" | "updated_at"
204
+ >
205
+ >;
206
+
207
+ export type CreateTotpFactorResponseAuthenticationChallengeAllOfObject =
208
+ (typeof CreateTotpFactorResponseAuthenticationChallengeAllOfObject)[keyof typeof CreateTotpFactorResponseAuthenticationChallengeAllOfObject];
209
+
210
+ export const CreateTotpFactorResponseAuthenticationChallengeAllOfObject = {
211
+ authentication_challenge: "authentication_challenge",
212
+ } as const;
213
+
214
+ export type CreateTotpFactorResponseAuthenticationChallengeAllOf = {
215
+ object: CreateTotpFactorResponseAuthenticationChallengeAllOfObject;
216
+ id: string;
217
+ /** @nullable */
218
+ expires_at?: string | null;
219
+ /** @nullable */
220
+ code?: string | null;
221
+ authentication_factor_id: string;
222
+ };
223
+
224
+ export type CreateTotpFactorResponseAuthenticationChallengeAllOfThree = {
225
+ created_at: string;
226
+ updated_at: string;
227
+ };
228
+
229
+ export type CreateTotpFactorResponseAuthenticationChallenge =
230
+ CreateTotpFactorResponseAuthenticationChallengeAllOf &
231
+ CreateTotpFactorResponseAuthenticationChallengeAllOfThree &
232
+ Required<
233
+ Pick<
234
+ CreateTotpFactorResponseAuthenticationChallengeAllOf &
235
+ CreateTotpFactorResponseAuthenticationChallengeAllOfThree,
236
+ | "object"
237
+ | "id"
238
+ | "authentication_factor_id"
239
+ | "created_at"
240
+ | "updated_at"
241
+ >
242
+ >;
243
+
244
+ export interface CreateTotpFactorResponse {
245
+ authenticationFactor: CreateTotpFactorResponseAuthenticationFactor;
246
+ authenticationChallenge: CreateTotpFactorResponseAuthenticationChallenge;
247
+ }
248
+
249
+ export interface VerifyTotpFactorRequest {
250
+ code: string;
251
+ authenticationChallengeId: string;
252
+ }
253
+
254
+ export interface MfaVerificationMethod {
255
+ isSetUp: boolean;
256
+ /** @nullable */
257
+ lastUsed?: string | null;
258
+ }
259
+
260
+ export interface PasswordVerificationMethod {
261
+ isSetUp: boolean;
262
+ /** @nullable */
263
+ lastUsed?: string | null;
264
+ isCurrentSession: boolean;
265
+ }
266
+
267
+ export type PasskeyVerificationMethodPassKeysItem = {
268
+ id: string;
269
+ };
270
+
271
+ export interface PasskeyVerificationMethod {
272
+ isSetUp: boolean;
273
+ /** @nullable */
274
+ lastUsed?: string | null;
275
+ isCurrentSession: boolean;
276
+ passKeys: PasskeyVerificationMethodPassKeysItem[];
277
+ }
278
+
279
+ export type AuthenticationInformationResponseDataVerificationMethods = {
280
+ Mfa?: MfaVerificationMethod;
281
+ Password?: PasswordVerificationMethod;
282
+ Passkey?: PasskeyVerificationMethod;
283
+ };
284
+
285
+ export type AuthenticationInformationResponseDataPasswordSettings = {
286
+ isPasswordNumberRequired: boolean;
287
+ isPasswordPwnedRequired: boolean;
288
+ isPasswordSymbolRequired: boolean;
289
+ isPasswordUppercaseRequired: boolean;
290
+ passwordMinimumLength: number;
291
+ passwordMinimumStrength: number;
292
+ };
293
+
294
+ export type AuthenticationInformationResponseData = {
295
+ verificationMethods: AuthenticationInformationResponseDataVerificationMethods;
296
+ passwordSettings: AuthenticationInformationResponseDataPasswordSettings;
297
+ };
298
+
299
+ export interface AuthenticationInformationResponse {
300
+ data: AuthenticationInformationResponseData;
301
+ }
302
+
303
+ export interface CreatePasswordRequest {
304
+ password: string;
305
+ }
306
+
307
+ export interface UpdatePasswordRequest {
308
+ newPassword: string;
309
+ currentPassword: string;
310
+ }
311
+
312
+ export interface RevokeAllSessionsRequest {
313
+ currentSessionId: string;
314
+ }
315
+
316
+ export type ActiveSessionState = {
317
+ tag: string;
318
+ /** @nullable */
319
+ expiresAt?: string | null;
320
+ };
321
+
322
+ /**
323
+ * @nullable
324
+ */
325
+ export type ActiveSessionCurrentLocation = {
326
+ cityName: string;
327
+ countryISOCode: string;
328
+ } | null;
329
+
330
+ export interface ActiveSession {
331
+ id: string;
332
+ userlandUserId: string;
333
+ /** @nullable */
334
+ ipAddress?: string | null;
335
+ /** @nullable */
336
+ userAgent?: string | null;
337
+ /** @nullable */
338
+ organizationId?: string | null;
339
+ state: ActiveSessionState;
340
+ /** @nullable */
341
+ currentLocation?: ActiveSessionCurrentLocation;
342
+ usedSsoAuth: boolean;
343
+ usedPasswordAuth: boolean;
344
+ usedPasskeyAuth: boolean;
345
+ usedAppleOauth: boolean;
346
+ usedBitbucketOauth: boolean;
347
+ usedGithubOauth: boolean;
348
+ usedGitLabOauth: boolean;
349
+ usedGoogleOauth: boolean;
350
+ usedLinkedInOauth: boolean;
351
+ usedImpersonation: boolean;
352
+ usedMicrosoftOauth: boolean;
353
+ usedSlackOauth: boolean;
354
+ usedXeroOauth: boolean;
355
+ usedMagicAuth: boolean;
356
+ /** @nullable */
357
+ impersonatorUserId?: string | null;
358
+ /** @nullable */
359
+ impersonatorEmail?: string | null;
360
+ /** @nullable */
361
+ impersonationReason?: string | null;
362
+ /** @nullable */
363
+ lastActivityAt?: string | null;
364
+ createdAt: string;
365
+ updatedAt: string;
366
+ }
367
+
368
+ export interface ActiveSessionsResponse {
369
+ data: ActiveSession[];
370
+ }
371
+
372
+ export type SendVerificationResponseType =
373
+ (typeof SendVerificationResponseType)[keyof typeof SendVerificationResponseType];
374
+
375
+ export const SendVerificationResponseType = {
376
+ EmailVerification: "EmailVerification",
377
+ } as const;
378
+
379
+ export interface SendVerificationResponse {
380
+ authenticationChallenge: string;
381
+ type: SendVerificationResponseType;
382
+ }
383
+
384
+ export interface VerifyRequest {
385
+ code: string;
386
+ authenticationChallengeId: string;
387
+ }
388
+
389
+ export interface VerifyResponse {
390
+ elevatedAccessToken: string;
391
+ expiresAt: string;
392
+ }
393
+
394
+ export type RegisterPasskeyResponseOptions = { [key: string]: unknown };
395
+
396
+ export interface RegisterPasskeyResponse {
397
+ challengeId: string;
398
+ options: RegisterPasskeyResponseOptions;
399
+ }
400
+
401
+ export type VerifyPasskeyRequestResponse = { [key: string]: unknown };
402
+
403
+ export interface VerifyPasskeyRequest {
404
+ challengeId: string;
405
+ response: VerifyPasskeyRequestResponse;
406
+ }
407
+
408
+ export type MembersParams = {
409
+ search?: string;
410
+ limit?: string;
411
+ before?: string;
412
+ after?: string;
413
+ role?: string;
414
+ };
415
+
416
+ export type Members200 = {
417
+ data: Member[];
418
+ listMetadata: ListMetadata;
419
+ };
420
+
421
+ export type Members403 = {
422
+ message: string;
423
+ };
424
+
425
+ export type Members404 = {
426
+ message: string;
427
+ };
428
+
429
+ export type Roles403 = {
430
+ message: string;
431
+ };
432
+
433
+ export type Roles404 = {
434
+ message: string;
435
+ };
436
+
437
+ export type InviteMemberInput = {
438
+ email: string;
439
+ /** @nullable */
440
+ firstName?: string | null;
441
+ /** @nullable */
442
+ lastName?: string | null;
443
+ roles: string[];
444
+ };
445
+
446
+ export type InviteMember201 = {
447
+ success: boolean;
448
+ };
449
+
450
+ export type InviteMember400 = {
451
+ message: string;
452
+ };
453
+
454
+ export type InviteMember403 = {
455
+ message: string;
456
+ };
457
+
458
+ export type InviteMember404 = {
459
+ message: string;
460
+ };
461
+
462
+ export type ResendInvite201 = {
463
+ /** @nullable */
464
+ id?: string | null;
465
+ success: boolean;
466
+ };
467
+
468
+ export type ResendInvite400 = {
469
+ message: string;
470
+ };
471
+
472
+ export type ResendInvite403 = {
473
+ message: string;
474
+ };
475
+
476
+ export type ResendInvite404 = {
477
+ message: string;
478
+ };
479
+
480
+ export type RevokeInvite200 = {
481
+ id: string;
482
+ success: boolean;
483
+ };
484
+
485
+ export type RevokeInvite400 = {
486
+ message: string;
487
+ };
488
+
489
+ export type RevokeInvite403 = {
490
+ message: string;
491
+ };
492
+
493
+ export type RevokeInvite404 = {
494
+ message: string;
495
+ };
496
+
497
+ export type RemoveMember200 = {
498
+ id: string;
499
+ success: boolean;
500
+ };
501
+
502
+ export type RemoveMember400 = {
503
+ message: string;
504
+ };
505
+
506
+ export type RemoveMember403 = {
507
+ message: string;
508
+ };
509
+
510
+ export type RemoveMember404 = {
511
+ message: string;
512
+ };
513
+
514
+ export type UpdateMemberInput = {
515
+ roles: string[];
516
+ };
517
+
518
+ export type UpdateMember200 = {
519
+ id: string;
520
+ success: boolean;
521
+ };
522
+
523
+ export type UpdateMember400 = {
524
+ message: string;
525
+ };
526
+
527
+ export type UpdateMember403 = {
528
+ message: string;
529
+ };
530
+
531
+ export type UpdateMember404 = {
532
+ message: string;
533
+ };
534
+
535
+ export type Organizations403 = {
536
+ message: string;
537
+ };
538
+
539
+ export type Organizations404 = {
540
+ message: string;
541
+ };
542
+
543
+ export type Me403 = {
544
+ message: string;
545
+ };
546
+
547
+ export type UpdateMeInput = {
548
+ firstName?: string;
549
+ lastName?: string;
550
+ };
551
+
552
+ export type UpdateMe400 = {
553
+ message: string;
554
+ };
555
+
556
+ export type UpdateMe403 = {
557
+ message: string;
558
+ };
559
+
560
+ export type CreateTotpFactor400 = {
561
+ message: string;
562
+ };
563
+
564
+ export type CreateTotpFactor403 = {
565
+ message: string;
566
+ };
567
+
568
+ export type VerifyTotpFactor200 = {
569
+ success: boolean;
570
+ };
571
+
572
+ export type VerifyTotpFactor400 = {
573
+ message: string;
574
+ };
575
+
576
+ export type VerifyTotpFactor403 = {
577
+ message: string;
578
+ };
579
+
580
+ export type DeleteTotpFactors200 = {
581
+ success: boolean;
582
+ };
583
+
584
+ export type DeleteTotpFactors400 = {
585
+ message: string;
586
+ };
587
+
588
+ export type DeleteTotpFactors403 = {
589
+ message: string;
590
+ };
591
+
592
+ export type AuthenticationInformation403 = {
593
+ message: string;
594
+ };
595
+
596
+ export type CreatePassword201 = {
597
+ success: boolean;
598
+ };
599
+
600
+ export type CreatePassword400 = {
601
+ message: string;
602
+ };
603
+
604
+ export type CreatePassword403 = {
605
+ message: string;
606
+ };
607
+
608
+ export type UpdatePassword201 = {
609
+ success: boolean;
610
+ };
611
+
612
+ export type UpdatePassword400 = {
613
+ message: string;
614
+ };
615
+
616
+ export type UpdatePassword403 = {
617
+ message: string;
618
+ };
619
+
620
+ export type RevokeAllSessions200 = {
621
+ success: boolean;
622
+ };
623
+
624
+ export type RevokeAllSessions400 = {
625
+ message: string;
626
+ };
627
+
628
+ export type RevokeAllSessions403 = {
629
+ message: string;
630
+ };
631
+
632
+ export type RevokeSession200 = {
633
+ success: boolean;
634
+ };
635
+
636
+ export type RevokeSession400 = {
637
+ message: string;
638
+ };
639
+
640
+ export type RevokeSession403 = {
641
+ message: string;
642
+ };
643
+
644
+ export type Sessions403 = {
645
+ message: string;
646
+ };
647
+
648
+ export type SendVerification400 = {
649
+ message: string;
650
+ };
651
+
652
+ export type SendVerification403 = {
653
+ message: string;
654
+ };
655
+
656
+ export type Verify400 = {
657
+ message: string;
658
+ };
659
+
660
+ export type Verify403 = {
661
+ message: string;
662
+ };
663
+
664
+ export type RegisterPasskey400 = {
665
+ message: string;
666
+ };
667
+
668
+ export type RegisterPasskey403 = {
669
+ message: string;
670
+ };
671
+
672
+ export type VerifyPasskey200 = {
673
+ success: boolean;
674
+ };
675
+
676
+ export type VerifyPasskey400 = {
677
+ message: string;
678
+ };
679
+
680
+ export type VerifyPasskey403 = {
681
+ message: string;
682
+ };
683
+
684
+ export type DeletePasskey200 = {
685
+ success: boolean;
686
+ };
687
+
688
+ export type DeletePasskey400 = {
689
+ message: string;
690
+ };
691
+
692
+ export type DeletePasskey403 = {
693
+ message: string;
694
+ };
695
+
696
+ export const useMembersHook = () => {
697
+ const members = useWidgetsApiClient<Members200>();
698
+
699
+ return useCallback(
700
+ (params?: MembersParams, signal?: AbortSignal) => {
701
+ return members({
702
+ url: `/_widgets/UserManagement/members`,
703
+ method: "GET",
704
+ params,
705
+ signal,
706
+ });
707
+ },
708
+ [members],
709
+ );
710
+ };
711
+
712
+ export const getMembersQueryKey = (params?: MembersParams) => {
713
+ return [
714
+ `/_widgets/UserManagement/members`,
715
+ ...(params ? [params] : []),
716
+ ] as const;
717
+ };
718
+
719
+ export const useMembersQueryOptions = <
720
+ TData = Awaited<ReturnType<ReturnType<typeof useMembersHook>>>,
721
+ TError = ErrorType<Members403 | Members404>,
722
+ >(
723
+ params?: MembersParams,
724
+ options?: {
725
+ query?: Partial<
726
+ UseQueryOptions<
727
+ Awaited<ReturnType<ReturnType<typeof useMembersHook>>>,
728
+ TError,
729
+ TData
730
+ >
731
+ >;
732
+ },
733
+ ) => {
734
+ const { query: queryOptions } = options ?? {};
735
+
736
+ const queryKey = queryOptions?.queryKey ?? getMembersQueryKey(params);
737
+
738
+ const members = useMembersHook();
739
+
740
+ const queryFn: QueryFunction<
741
+ Awaited<ReturnType<ReturnType<typeof useMembersHook>>>
742
+ > = ({ signal }) => members(params, signal);
743
+
744
+ const customOptions = useWidgetsApiQueryOptions({
745
+ ...queryOptions,
746
+ queryKey,
747
+ queryFn,
748
+ });
749
+
750
+ return customOptions as UseQueryOptions<
751
+ Awaited<ReturnType<ReturnType<typeof useMembersHook>>>,
752
+ TError,
753
+ TData
754
+ > & { queryKey: DataTag<QueryKey, TData> };
755
+ };
756
+
757
+ export type MembersQueryResult = NonNullable<
758
+ Awaited<ReturnType<ReturnType<typeof useMembersHook>>>
759
+ >;
760
+ export type MembersQueryError = ErrorType<Members403 | Members404>;
761
+
762
+ export function useMembers<
763
+ TData = Awaited<ReturnType<ReturnType<typeof useMembersHook>>>,
764
+ TError = ErrorType<Members403 | Members404>,
765
+ >(
766
+ params: undefined | MembersParams,
767
+ options: {
768
+ query: Partial<
769
+ UseQueryOptions<
770
+ Awaited<ReturnType<ReturnType<typeof useMembersHook>>>,
771
+ TError,
772
+ TData
773
+ >
774
+ > &
775
+ Pick<
776
+ DefinedInitialDataOptions<
777
+ Awaited<ReturnType<ReturnType<typeof useMembersHook>>>,
778
+ TError,
779
+ Awaited<ReturnType<ReturnType<typeof useMembersHook>>>
780
+ >,
781
+ "initialData"
782
+ >;
783
+ },
784
+ ): DefinedUseQueryResult<TData, TError> & {
785
+ queryKey: DataTag<QueryKey, TData>;
786
+ };
787
+ export function useMembers<
788
+ TData = Awaited<ReturnType<ReturnType<typeof useMembersHook>>>,
789
+ TError = ErrorType<Members403 | Members404>,
790
+ >(
791
+ params?: MembersParams,
792
+ options?: {
793
+ query?: Partial<
794
+ UseQueryOptions<
795
+ Awaited<ReturnType<ReturnType<typeof useMembersHook>>>,
796
+ TError,
797
+ TData
798
+ >
799
+ > &
800
+ Pick<
801
+ UndefinedInitialDataOptions<
802
+ Awaited<ReturnType<ReturnType<typeof useMembersHook>>>,
803
+ TError,
804
+ Awaited<ReturnType<ReturnType<typeof useMembersHook>>>
805
+ >,
806
+ "initialData"
807
+ >;
808
+ },
809
+ ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
810
+ export function useMembers<
811
+ TData = Awaited<ReturnType<ReturnType<typeof useMembersHook>>>,
812
+ TError = ErrorType<Members403 | Members404>,
813
+ >(
814
+ params?: MembersParams,
815
+ options?: {
816
+ query?: Partial<
817
+ UseQueryOptions<
818
+ Awaited<ReturnType<ReturnType<typeof useMembersHook>>>,
819
+ TError,
820
+ TData
821
+ >
822
+ >;
823
+ },
824
+ ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
825
+
826
+ export function useMembers<
827
+ TData = Awaited<ReturnType<ReturnType<typeof useMembersHook>>>,
828
+ TError = ErrorType<Members403 | Members404>,
829
+ >(
830
+ params?: MembersParams,
831
+ options?: {
832
+ query?: Partial<
833
+ UseQueryOptions<
834
+ Awaited<ReturnType<ReturnType<typeof useMembersHook>>>,
835
+ TError,
836
+ TData
837
+ >
838
+ >;
839
+ },
840
+ ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
841
+ const queryOptions = useMembersQueryOptions(params, options);
842
+
843
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
844
+ queryKey: DataTag<QueryKey, TData>;
845
+ };
846
+
847
+ query.queryKey = queryOptions.queryKey;
848
+
849
+ return query;
850
+ }
851
+
852
+ export const useRolesHook = () => {
853
+ const roles = useWidgetsApiClient<MemberRole[]>();
854
+
855
+ return useCallback(
856
+ (signal?: AbortSignal) => {
857
+ return roles({
858
+ url: `/_widgets/UserManagement/roles`,
859
+ method: "GET",
860
+ signal,
861
+ });
862
+ },
863
+ [roles],
864
+ );
865
+ };
866
+
867
+ export const getRolesQueryKey = () => {
868
+ return [`/_widgets/UserManagement/roles`] as const;
869
+ };
870
+
871
+ export const useRolesQueryOptions = <
872
+ TData = Awaited<ReturnType<ReturnType<typeof useRolesHook>>>,
873
+ TError = ErrorType<Roles403 | Roles404>,
874
+ >(options?: {
875
+ query?: Partial<
876
+ UseQueryOptions<
877
+ Awaited<ReturnType<ReturnType<typeof useRolesHook>>>,
878
+ TError,
879
+ TData
880
+ >
881
+ >;
882
+ }) => {
883
+ const { query: queryOptions } = options ?? {};
884
+
885
+ const queryKey = queryOptions?.queryKey ?? getRolesQueryKey();
886
+
887
+ const roles = useRolesHook();
888
+
889
+ const queryFn: QueryFunction<
890
+ Awaited<ReturnType<ReturnType<typeof useRolesHook>>>
891
+ > = ({ signal }) => roles(signal);
892
+
893
+ const customOptions = useWidgetsApiQueryOptions({
894
+ ...queryOptions,
895
+ queryKey,
896
+ queryFn,
897
+ });
898
+
899
+ return customOptions as UseQueryOptions<
900
+ Awaited<ReturnType<ReturnType<typeof useRolesHook>>>,
901
+ TError,
902
+ TData
903
+ > & { queryKey: DataTag<QueryKey, TData> };
904
+ };
905
+
906
+ export type RolesQueryResult = NonNullable<
907
+ Awaited<ReturnType<ReturnType<typeof useRolesHook>>>
908
+ >;
909
+ export type RolesQueryError = ErrorType<Roles403 | Roles404>;
910
+
911
+ export function useRoles<
912
+ TData = Awaited<ReturnType<ReturnType<typeof useRolesHook>>>,
913
+ TError = ErrorType<Roles403 | Roles404>,
914
+ >(options: {
915
+ query: Partial<
916
+ UseQueryOptions<
917
+ Awaited<ReturnType<ReturnType<typeof useRolesHook>>>,
918
+ TError,
919
+ TData
920
+ >
921
+ > &
922
+ Pick<
923
+ DefinedInitialDataOptions<
924
+ Awaited<ReturnType<ReturnType<typeof useRolesHook>>>,
925
+ TError,
926
+ Awaited<ReturnType<ReturnType<typeof useRolesHook>>>
927
+ >,
928
+ "initialData"
929
+ >;
930
+ }): DefinedUseQueryResult<TData, TError> & {
931
+ queryKey: DataTag<QueryKey, TData>;
932
+ };
933
+ export function useRoles<
934
+ TData = Awaited<ReturnType<ReturnType<typeof useRolesHook>>>,
935
+ TError = ErrorType<Roles403 | Roles404>,
936
+ >(options?: {
937
+ query?: Partial<
938
+ UseQueryOptions<
939
+ Awaited<ReturnType<ReturnType<typeof useRolesHook>>>,
940
+ TError,
941
+ TData
942
+ >
943
+ > &
944
+ Pick<
945
+ UndefinedInitialDataOptions<
946
+ Awaited<ReturnType<ReturnType<typeof useRolesHook>>>,
947
+ TError,
948
+ Awaited<ReturnType<ReturnType<typeof useRolesHook>>>
949
+ >,
950
+ "initialData"
951
+ >;
952
+ }): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
953
+ export function useRoles<
954
+ TData = Awaited<ReturnType<ReturnType<typeof useRolesHook>>>,
955
+ TError = ErrorType<Roles403 | Roles404>,
956
+ >(options?: {
957
+ query?: Partial<
958
+ UseQueryOptions<
959
+ Awaited<ReturnType<ReturnType<typeof useRolesHook>>>,
960
+ TError,
961
+ TData
962
+ >
963
+ >;
964
+ }): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
965
+
966
+ export function useRoles<
967
+ TData = Awaited<ReturnType<ReturnType<typeof useRolesHook>>>,
968
+ TError = ErrorType<Roles403 | Roles404>,
969
+ >(options?: {
970
+ query?: Partial<
971
+ UseQueryOptions<
972
+ Awaited<ReturnType<ReturnType<typeof useRolesHook>>>,
973
+ TError,
974
+ TData
975
+ >
976
+ >;
977
+ }): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
978
+ const queryOptions = useRolesQueryOptions(options);
979
+
980
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
981
+ queryKey: DataTag<QueryKey, TData>;
982
+ };
983
+
984
+ query.queryKey = queryOptions.queryKey;
985
+
986
+ return query;
987
+ }
988
+
989
+ export const useInviteMemberHook = () => {
990
+ const inviteMember = useWidgetsApiClient<InviteMember201>();
991
+
992
+ return useCallback(
993
+ (inviteMemberInput: BodyType<InviteMemberInput>, signal?: AbortSignal) => {
994
+ return inviteMember({
995
+ url: `/_widgets/UserManagement/invite-user`,
996
+ method: "POST",
997
+ headers: { "Content-Type": "application/json" },
998
+ data: inviteMemberInput,
999
+ signal,
1000
+ });
1001
+ },
1002
+ [inviteMember],
1003
+ );
1004
+ };
1005
+
1006
+ export const useInviteMemberMutationOptions = <
1007
+ TError = ErrorType<InviteMember400 | InviteMember403 | InviteMember404>,
1008
+ TContext = unknown,
1009
+ >(options?: {
1010
+ mutation?: UseMutationOptions<
1011
+ Awaited<ReturnType<ReturnType<typeof useInviteMemberHook>>>,
1012
+ TError,
1013
+ { data: BodyType<InviteMemberInput> },
1014
+ TContext
1015
+ >;
1016
+ }): UseMutationOptions<
1017
+ Awaited<ReturnType<ReturnType<typeof useInviteMemberHook>>>,
1018
+ TError,
1019
+ { data: BodyType<InviteMemberInput> },
1020
+ TContext
1021
+ > => {
1022
+ const mutationKey = ["inviteMember"];
1023
+ const { mutation: mutationOptions } = options
1024
+ ? options.mutation &&
1025
+ "mutationKey" in options.mutation &&
1026
+ options.mutation.mutationKey
1027
+ ? options
1028
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
1029
+ : { mutation: { mutationKey } };
1030
+
1031
+ const inviteMember = useInviteMemberHook();
1032
+
1033
+ const mutationFn: MutationFunction<
1034
+ Awaited<ReturnType<ReturnType<typeof useInviteMemberHook>>>,
1035
+ { data: BodyType<InviteMemberInput> }
1036
+ > = (props) => {
1037
+ const { data } = props ?? {};
1038
+
1039
+ return inviteMember(data);
1040
+ };
1041
+
1042
+ return { mutationFn, ...mutationOptions };
1043
+ };
1044
+
1045
+ export type InviteMemberMutationResult = NonNullable<
1046
+ Awaited<ReturnType<ReturnType<typeof useInviteMemberHook>>>
1047
+ >;
1048
+ export type InviteMemberMutationBody = BodyType<InviteMemberInput>;
1049
+ export type InviteMemberMutationError = ErrorType<
1050
+ InviteMember400 | InviteMember403 | InviteMember404
1051
+ >;
1052
+
1053
+ export const useInviteMember = <
1054
+ TError = ErrorType<InviteMember400 | InviteMember403 | InviteMember404>,
1055
+ TContext = unknown,
1056
+ >(options?: {
1057
+ mutation?: UseMutationOptions<
1058
+ Awaited<ReturnType<ReturnType<typeof useInviteMemberHook>>>,
1059
+ TError,
1060
+ { data: BodyType<InviteMemberInput> },
1061
+ TContext
1062
+ >;
1063
+ }): UseMutationResult<
1064
+ Awaited<ReturnType<ReturnType<typeof useInviteMemberHook>>>,
1065
+ TError,
1066
+ { data: BodyType<InviteMemberInput> },
1067
+ TContext
1068
+ > => {
1069
+ const mutationOptions = useInviteMemberMutationOptions(options);
1070
+
1071
+ return useMutation(mutationOptions);
1072
+ };
1073
+
1074
+ export const useResendInviteHook = () => {
1075
+ const resendInvite = useWidgetsApiClient<ResendInvite201>();
1076
+
1077
+ return useCallback(
1078
+ (userId: string, signal?: AbortSignal) => {
1079
+ return resendInvite({
1080
+ url: `/_widgets/UserManagement/invites/${userId}/resend`,
1081
+ method: "POST",
1082
+ signal,
1083
+ });
1084
+ },
1085
+ [resendInvite],
1086
+ );
1087
+ };
1088
+
1089
+ export const useResendInviteMutationOptions = <
1090
+ TError = ErrorType<ResendInvite400 | ResendInvite403 | ResendInvite404>,
1091
+ TContext = unknown,
1092
+ >(options?: {
1093
+ mutation?: UseMutationOptions<
1094
+ Awaited<ReturnType<ReturnType<typeof useResendInviteHook>>>,
1095
+ TError,
1096
+ { userId: string },
1097
+ TContext
1098
+ >;
1099
+ }): UseMutationOptions<
1100
+ Awaited<ReturnType<ReturnType<typeof useResendInviteHook>>>,
1101
+ TError,
1102
+ { userId: string },
1103
+ TContext
1104
+ > => {
1105
+ const mutationKey = ["resendInvite"];
1106
+ const { mutation: mutationOptions } = options
1107
+ ? options.mutation &&
1108
+ "mutationKey" in options.mutation &&
1109
+ options.mutation.mutationKey
1110
+ ? options
1111
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
1112
+ : { mutation: { mutationKey } };
1113
+
1114
+ const resendInvite = useResendInviteHook();
1115
+
1116
+ const mutationFn: MutationFunction<
1117
+ Awaited<ReturnType<ReturnType<typeof useResendInviteHook>>>,
1118
+ { userId: string }
1119
+ > = (props) => {
1120
+ const { userId } = props ?? {};
1121
+
1122
+ return resendInvite(userId);
1123
+ };
1124
+
1125
+ return { mutationFn, ...mutationOptions };
1126
+ };
1127
+
1128
+ export type ResendInviteMutationResult = NonNullable<
1129
+ Awaited<ReturnType<ReturnType<typeof useResendInviteHook>>>
1130
+ >;
1131
+
1132
+ export type ResendInviteMutationError = ErrorType<
1133
+ ResendInvite400 | ResendInvite403 | ResendInvite404
1134
+ >;
1135
+
1136
+ export const useResendInvite = <
1137
+ TError = ErrorType<ResendInvite400 | ResendInvite403 | ResendInvite404>,
1138
+ TContext = unknown,
1139
+ >(options?: {
1140
+ mutation?: UseMutationOptions<
1141
+ Awaited<ReturnType<ReturnType<typeof useResendInviteHook>>>,
1142
+ TError,
1143
+ { userId: string },
1144
+ TContext
1145
+ >;
1146
+ }): UseMutationResult<
1147
+ Awaited<ReturnType<ReturnType<typeof useResendInviteHook>>>,
1148
+ TError,
1149
+ { userId: string },
1150
+ TContext
1151
+ > => {
1152
+ const mutationOptions = useResendInviteMutationOptions(options);
1153
+
1154
+ return useMutation(mutationOptions);
1155
+ };
1156
+
1157
+ export const useRevokeInviteHook = () => {
1158
+ const revokeInvite = useWidgetsApiClient<RevokeInvite200>();
1159
+
1160
+ return useCallback(
1161
+ (userId: string) => {
1162
+ return revokeInvite({
1163
+ url: `/_widgets/UserManagement/invites/${userId}`,
1164
+ method: "DELETE",
1165
+ });
1166
+ },
1167
+ [revokeInvite],
1168
+ );
1169
+ };
1170
+
1171
+ export const useRevokeInviteMutationOptions = <
1172
+ TError = ErrorType<RevokeInvite400 | RevokeInvite403 | RevokeInvite404>,
1173
+ TContext = unknown,
1174
+ >(options?: {
1175
+ mutation?: UseMutationOptions<
1176
+ Awaited<ReturnType<ReturnType<typeof useRevokeInviteHook>>>,
1177
+ TError,
1178
+ { userId: string },
1179
+ TContext
1180
+ >;
1181
+ }): UseMutationOptions<
1182
+ Awaited<ReturnType<ReturnType<typeof useRevokeInviteHook>>>,
1183
+ TError,
1184
+ { userId: string },
1185
+ TContext
1186
+ > => {
1187
+ const mutationKey = ["revokeInvite"];
1188
+ const { mutation: mutationOptions } = options
1189
+ ? options.mutation &&
1190
+ "mutationKey" in options.mutation &&
1191
+ options.mutation.mutationKey
1192
+ ? options
1193
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
1194
+ : { mutation: { mutationKey } };
1195
+
1196
+ const revokeInvite = useRevokeInviteHook();
1197
+
1198
+ const mutationFn: MutationFunction<
1199
+ Awaited<ReturnType<ReturnType<typeof useRevokeInviteHook>>>,
1200
+ { userId: string }
1201
+ > = (props) => {
1202
+ const { userId } = props ?? {};
1203
+
1204
+ return revokeInvite(userId);
1205
+ };
1206
+
1207
+ return { mutationFn, ...mutationOptions };
1208
+ };
1209
+
1210
+ export type RevokeInviteMutationResult = NonNullable<
1211
+ Awaited<ReturnType<ReturnType<typeof useRevokeInviteHook>>>
1212
+ >;
1213
+
1214
+ export type RevokeInviteMutationError = ErrorType<
1215
+ RevokeInvite400 | RevokeInvite403 | RevokeInvite404
1216
+ >;
1217
+
1218
+ export const useRevokeInvite = <
1219
+ TError = ErrorType<RevokeInvite400 | RevokeInvite403 | RevokeInvite404>,
1220
+ TContext = unknown,
1221
+ >(options?: {
1222
+ mutation?: UseMutationOptions<
1223
+ Awaited<ReturnType<ReturnType<typeof useRevokeInviteHook>>>,
1224
+ TError,
1225
+ { userId: string },
1226
+ TContext
1227
+ >;
1228
+ }): UseMutationResult<
1229
+ Awaited<ReturnType<ReturnType<typeof useRevokeInviteHook>>>,
1230
+ TError,
1231
+ { userId: string },
1232
+ TContext
1233
+ > => {
1234
+ const mutationOptions = useRevokeInviteMutationOptions(options);
1235
+
1236
+ return useMutation(mutationOptions);
1237
+ };
1238
+
1239
+ export const useRemoveMemberHook = () => {
1240
+ const removeMember = useWidgetsApiClient<RemoveMember200>();
1241
+
1242
+ return useCallback(
1243
+ (userId: string) => {
1244
+ return removeMember({
1245
+ url: `/_widgets/UserManagement/members/${userId}`,
1246
+ method: "DELETE",
1247
+ });
1248
+ },
1249
+ [removeMember],
1250
+ );
1251
+ };
1252
+
1253
+ export const useRemoveMemberMutationOptions = <
1254
+ TError = ErrorType<RemoveMember400 | RemoveMember403 | RemoveMember404>,
1255
+ TContext = unknown,
1256
+ >(options?: {
1257
+ mutation?: UseMutationOptions<
1258
+ Awaited<ReturnType<ReturnType<typeof useRemoveMemberHook>>>,
1259
+ TError,
1260
+ { userId: string },
1261
+ TContext
1262
+ >;
1263
+ }): UseMutationOptions<
1264
+ Awaited<ReturnType<ReturnType<typeof useRemoveMemberHook>>>,
1265
+ TError,
1266
+ { userId: string },
1267
+ TContext
1268
+ > => {
1269
+ const mutationKey = ["removeMember"];
1270
+ const { mutation: mutationOptions } = options
1271
+ ? options.mutation &&
1272
+ "mutationKey" in options.mutation &&
1273
+ options.mutation.mutationKey
1274
+ ? options
1275
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
1276
+ : { mutation: { mutationKey } };
1277
+
1278
+ const removeMember = useRemoveMemberHook();
1279
+
1280
+ const mutationFn: MutationFunction<
1281
+ Awaited<ReturnType<ReturnType<typeof useRemoveMemberHook>>>,
1282
+ { userId: string }
1283
+ > = (props) => {
1284
+ const { userId } = props ?? {};
1285
+
1286
+ return removeMember(userId);
1287
+ };
1288
+
1289
+ return { mutationFn, ...mutationOptions };
1290
+ };
1291
+
1292
+ export type RemoveMemberMutationResult = NonNullable<
1293
+ Awaited<ReturnType<ReturnType<typeof useRemoveMemberHook>>>
1294
+ >;
1295
+
1296
+ export type RemoveMemberMutationError = ErrorType<
1297
+ RemoveMember400 | RemoveMember403 | RemoveMember404
1298
+ >;
1299
+
1300
+ export const useRemoveMember = <
1301
+ TError = ErrorType<RemoveMember400 | RemoveMember403 | RemoveMember404>,
1302
+ TContext = unknown,
1303
+ >(options?: {
1304
+ mutation?: UseMutationOptions<
1305
+ Awaited<ReturnType<ReturnType<typeof useRemoveMemberHook>>>,
1306
+ TError,
1307
+ { userId: string },
1308
+ TContext
1309
+ >;
1310
+ }): UseMutationResult<
1311
+ Awaited<ReturnType<ReturnType<typeof useRemoveMemberHook>>>,
1312
+ TError,
1313
+ { userId: string },
1314
+ TContext
1315
+ > => {
1316
+ const mutationOptions = useRemoveMemberMutationOptions(options);
1317
+
1318
+ return useMutation(mutationOptions);
1319
+ };
1320
+
1321
+ export const useUpdateMemberHook = () => {
1322
+ const updateMember = useWidgetsApiClient<UpdateMember200>();
1323
+
1324
+ return useCallback(
1325
+ (
1326
+ userId: string,
1327
+ updateMemberInput: BodyType<UpdateMemberInput>,
1328
+ signal?: AbortSignal,
1329
+ ) => {
1330
+ return updateMember({
1331
+ url: `/_widgets/UserManagement/members/${userId}`,
1332
+ method: "POST",
1333
+ headers: { "Content-Type": "application/json" },
1334
+ data: updateMemberInput,
1335
+ signal,
1336
+ });
1337
+ },
1338
+ [updateMember],
1339
+ );
1340
+ };
1341
+
1342
+ export const useUpdateMemberMutationOptions = <
1343
+ TError = ErrorType<UpdateMember400 | UpdateMember403 | UpdateMember404>,
1344
+ TContext = unknown,
1345
+ >(options?: {
1346
+ mutation?: UseMutationOptions<
1347
+ Awaited<ReturnType<ReturnType<typeof useUpdateMemberHook>>>,
1348
+ TError,
1349
+ { userId: string; data: BodyType<UpdateMemberInput> },
1350
+ TContext
1351
+ >;
1352
+ }): UseMutationOptions<
1353
+ Awaited<ReturnType<ReturnType<typeof useUpdateMemberHook>>>,
1354
+ TError,
1355
+ { userId: string; data: BodyType<UpdateMemberInput> },
1356
+ TContext
1357
+ > => {
1358
+ const mutationKey = ["updateMember"];
1359
+ const { mutation: mutationOptions } = options
1360
+ ? options.mutation &&
1361
+ "mutationKey" in options.mutation &&
1362
+ options.mutation.mutationKey
1363
+ ? options
1364
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
1365
+ : { mutation: { mutationKey } };
1366
+
1367
+ const updateMember = useUpdateMemberHook();
1368
+
1369
+ const mutationFn: MutationFunction<
1370
+ Awaited<ReturnType<ReturnType<typeof useUpdateMemberHook>>>,
1371
+ { userId: string; data: BodyType<UpdateMemberInput> }
1372
+ > = (props) => {
1373
+ const { userId, data } = props ?? {};
1374
+
1375
+ return updateMember(userId, data);
1376
+ };
1377
+
1378
+ return { mutationFn, ...mutationOptions };
1379
+ };
1380
+
1381
+ export type UpdateMemberMutationResult = NonNullable<
1382
+ Awaited<ReturnType<ReturnType<typeof useUpdateMemberHook>>>
1383
+ >;
1384
+ export type UpdateMemberMutationBody = BodyType<UpdateMemberInput>;
1385
+ export type UpdateMemberMutationError = ErrorType<
1386
+ UpdateMember400 | UpdateMember403 | UpdateMember404
1387
+ >;
1388
+
1389
+ export const useUpdateMember = <
1390
+ TError = ErrorType<UpdateMember400 | UpdateMember403 | UpdateMember404>,
1391
+ TContext = unknown,
1392
+ >(options?: {
1393
+ mutation?: UseMutationOptions<
1394
+ Awaited<ReturnType<ReturnType<typeof useUpdateMemberHook>>>,
1395
+ TError,
1396
+ { userId: string; data: BodyType<UpdateMemberInput> },
1397
+ TContext
1398
+ >;
1399
+ }): UseMutationResult<
1400
+ Awaited<ReturnType<ReturnType<typeof useUpdateMemberHook>>>,
1401
+ TError,
1402
+ { userId: string; data: BodyType<UpdateMemberInput> },
1403
+ TContext
1404
+ > => {
1405
+ const mutationOptions = useUpdateMemberMutationOptions(options);
1406
+
1407
+ return useMutation(mutationOptions);
1408
+ };
1409
+
1410
+ export const useOrganizationsHook = () => {
1411
+ const organizations = useWidgetsApiClient<OrganizationsResponse>();
1412
+
1413
+ return useCallback(
1414
+ (signal?: AbortSignal) => {
1415
+ return organizations({
1416
+ url: `/_widgets/UserManagement/organizations`,
1417
+ method: "GET",
1418
+ signal,
1419
+ });
1420
+ },
1421
+ [organizations],
1422
+ );
1423
+ };
1424
+
1425
+ export const getOrganizationsQueryKey = () => {
1426
+ return [`/_widgets/UserManagement/organizations`] as const;
1427
+ };
1428
+
1429
+ export const useOrganizationsQueryOptions = <
1430
+ TData = Awaited<ReturnType<ReturnType<typeof useOrganizationsHook>>>,
1431
+ TError = ErrorType<Organizations403 | Organizations404>,
1432
+ >(options?: {
1433
+ query?: Partial<
1434
+ UseQueryOptions<
1435
+ Awaited<ReturnType<ReturnType<typeof useOrganizationsHook>>>,
1436
+ TError,
1437
+ TData
1438
+ >
1439
+ >;
1440
+ }) => {
1441
+ const { query: queryOptions } = options ?? {};
1442
+
1443
+ const queryKey = queryOptions?.queryKey ?? getOrganizationsQueryKey();
1444
+
1445
+ const organizations = useOrganizationsHook();
1446
+
1447
+ const queryFn: QueryFunction<
1448
+ Awaited<ReturnType<ReturnType<typeof useOrganizationsHook>>>
1449
+ > = ({ signal }) => organizations(signal);
1450
+
1451
+ const customOptions = useWidgetsApiQueryOptions({
1452
+ ...queryOptions,
1453
+ queryKey,
1454
+ queryFn,
1455
+ });
1456
+
1457
+ return customOptions as UseQueryOptions<
1458
+ Awaited<ReturnType<ReturnType<typeof useOrganizationsHook>>>,
1459
+ TError,
1460
+ TData
1461
+ > & { queryKey: DataTag<QueryKey, TData> };
1462
+ };
1463
+
1464
+ export type OrganizationsQueryResult = NonNullable<
1465
+ Awaited<ReturnType<ReturnType<typeof useOrganizationsHook>>>
1466
+ >;
1467
+ export type OrganizationsQueryError = ErrorType<
1468
+ Organizations403 | Organizations404
1469
+ >;
1470
+
1471
+ export function useOrganizations<
1472
+ TData = Awaited<ReturnType<ReturnType<typeof useOrganizationsHook>>>,
1473
+ TError = ErrorType<Organizations403 | Organizations404>,
1474
+ >(options: {
1475
+ query: Partial<
1476
+ UseQueryOptions<
1477
+ Awaited<ReturnType<ReturnType<typeof useOrganizationsHook>>>,
1478
+ TError,
1479
+ TData
1480
+ >
1481
+ > &
1482
+ Pick<
1483
+ DefinedInitialDataOptions<
1484
+ Awaited<ReturnType<ReturnType<typeof useOrganizationsHook>>>,
1485
+ TError,
1486
+ Awaited<ReturnType<ReturnType<typeof useOrganizationsHook>>>
1487
+ >,
1488
+ "initialData"
1489
+ >;
1490
+ }): DefinedUseQueryResult<TData, TError> & {
1491
+ queryKey: DataTag<QueryKey, TData>;
1492
+ };
1493
+ export function useOrganizations<
1494
+ TData = Awaited<ReturnType<ReturnType<typeof useOrganizationsHook>>>,
1495
+ TError = ErrorType<Organizations403 | Organizations404>,
1496
+ >(options?: {
1497
+ query?: Partial<
1498
+ UseQueryOptions<
1499
+ Awaited<ReturnType<ReturnType<typeof useOrganizationsHook>>>,
1500
+ TError,
1501
+ TData
1502
+ >
1503
+ > &
1504
+ Pick<
1505
+ UndefinedInitialDataOptions<
1506
+ Awaited<ReturnType<ReturnType<typeof useOrganizationsHook>>>,
1507
+ TError,
1508
+ Awaited<ReturnType<ReturnType<typeof useOrganizationsHook>>>
1509
+ >,
1510
+ "initialData"
1511
+ >;
1512
+ }): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
1513
+ export function useOrganizations<
1514
+ TData = Awaited<ReturnType<ReturnType<typeof useOrganizationsHook>>>,
1515
+ TError = ErrorType<Organizations403 | Organizations404>,
1516
+ >(options?: {
1517
+ query?: Partial<
1518
+ UseQueryOptions<
1519
+ Awaited<ReturnType<ReturnType<typeof useOrganizationsHook>>>,
1520
+ TError,
1521
+ TData
1522
+ >
1523
+ >;
1524
+ }): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
1525
+
1526
+ export function useOrganizations<
1527
+ TData = Awaited<ReturnType<ReturnType<typeof useOrganizationsHook>>>,
1528
+ TError = ErrorType<Organizations403 | Organizations404>,
1529
+ >(options?: {
1530
+ query?: Partial<
1531
+ UseQueryOptions<
1532
+ Awaited<ReturnType<ReturnType<typeof useOrganizationsHook>>>,
1533
+ TError,
1534
+ TData
1535
+ >
1536
+ >;
1537
+ }): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
1538
+ const queryOptions = useOrganizationsQueryOptions(options);
1539
+
1540
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
1541
+ queryKey: DataTag<QueryKey, TData>;
1542
+ };
1543
+
1544
+ query.queryKey = queryOptions.queryKey;
1545
+
1546
+ return query;
1547
+ }
1548
+
1549
+ export const useMeHook = () => {
1550
+ const me = useWidgetsApiClient<Me>();
1551
+
1552
+ return useCallback(
1553
+ (signal?: AbortSignal) => {
1554
+ return me({ url: `/_widgets/UserProfile/me`, method: "GET", signal });
1555
+ },
1556
+ [me],
1557
+ );
1558
+ };
1559
+
1560
+ export const getMeQueryKey = () => {
1561
+ return [`/_widgets/UserProfile/me`] as const;
1562
+ };
1563
+
1564
+ export const useMeQueryOptions = <
1565
+ TData = Awaited<ReturnType<ReturnType<typeof useMeHook>>>,
1566
+ TError = ErrorType<Me403>,
1567
+ >(options?: {
1568
+ query?: Partial<
1569
+ UseQueryOptions<
1570
+ Awaited<ReturnType<ReturnType<typeof useMeHook>>>,
1571
+ TError,
1572
+ TData
1573
+ >
1574
+ >;
1575
+ }) => {
1576
+ const { query: queryOptions } = options ?? {};
1577
+
1578
+ const queryKey = queryOptions?.queryKey ?? getMeQueryKey();
1579
+
1580
+ const me = useMeHook();
1581
+
1582
+ const queryFn: QueryFunction<
1583
+ Awaited<ReturnType<ReturnType<typeof useMeHook>>>
1584
+ > = ({ signal }) => me(signal);
1585
+
1586
+ const customOptions = useWidgetsApiQueryOptions({
1587
+ ...queryOptions,
1588
+ queryKey,
1589
+ queryFn,
1590
+ });
1591
+
1592
+ return customOptions as UseQueryOptions<
1593
+ Awaited<ReturnType<ReturnType<typeof useMeHook>>>,
1594
+ TError,
1595
+ TData
1596
+ > & { queryKey: DataTag<QueryKey, TData> };
1597
+ };
1598
+
1599
+ export type MeQueryResult = NonNullable<
1600
+ Awaited<ReturnType<ReturnType<typeof useMeHook>>>
1601
+ >;
1602
+ export type MeQueryError = ErrorType<Me403>;
1603
+
1604
+ export function useMe<
1605
+ TData = Awaited<ReturnType<ReturnType<typeof useMeHook>>>,
1606
+ TError = ErrorType<Me403>,
1607
+ >(options: {
1608
+ query: Partial<
1609
+ UseQueryOptions<
1610
+ Awaited<ReturnType<ReturnType<typeof useMeHook>>>,
1611
+ TError,
1612
+ TData
1613
+ >
1614
+ > &
1615
+ Pick<
1616
+ DefinedInitialDataOptions<
1617
+ Awaited<ReturnType<ReturnType<typeof useMeHook>>>,
1618
+ TError,
1619
+ Awaited<ReturnType<ReturnType<typeof useMeHook>>>
1620
+ >,
1621
+ "initialData"
1622
+ >;
1623
+ }): DefinedUseQueryResult<TData, TError> & {
1624
+ queryKey: DataTag<QueryKey, TData>;
1625
+ };
1626
+ export function useMe<
1627
+ TData = Awaited<ReturnType<ReturnType<typeof useMeHook>>>,
1628
+ TError = ErrorType<Me403>,
1629
+ >(options?: {
1630
+ query?: Partial<
1631
+ UseQueryOptions<
1632
+ Awaited<ReturnType<ReturnType<typeof useMeHook>>>,
1633
+ TError,
1634
+ TData
1635
+ >
1636
+ > &
1637
+ Pick<
1638
+ UndefinedInitialDataOptions<
1639
+ Awaited<ReturnType<ReturnType<typeof useMeHook>>>,
1640
+ TError,
1641
+ Awaited<ReturnType<ReturnType<typeof useMeHook>>>
1642
+ >,
1643
+ "initialData"
1644
+ >;
1645
+ }): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
1646
+ export function useMe<
1647
+ TData = Awaited<ReturnType<ReturnType<typeof useMeHook>>>,
1648
+ TError = ErrorType<Me403>,
1649
+ >(options?: {
1650
+ query?: Partial<
1651
+ UseQueryOptions<
1652
+ Awaited<ReturnType<ReturnType<typeof useMeHook>>>,
1653
+ TError,
1654
+ TData
1655
+ >
1656
+ >;
1657
+ }): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
1658
+
1659
+ export function useMe<
1660
+ TData = Awaited<ReturnType<ReturnType<typeof useMeHook>>>,
1661
+ TError = ErrorType<Me403>,
1662
+ >(options?: {
1663
+ query?: Partial<
1664
+ UseQueryOptions<
1665
+ Awaited<ReturnType<ReturnType<typeof useMeHook>>>,
1666
+ TError,
1667
+ TData
1668
+ >
1669
+ >;
1670
+ }): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
1671
+ const queryOptions = useMeQueryOptions(options);
1672
+
1673
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
1674
+ queryKey: DataTag<QueryKey, TData>;
1675
+ };
1676
+
1677
+ query.queryKey = queryOptions.queryKey;
1678
+
1679
+ return query;
1680
+ }
1681
+
1682
+ export const useUpdateMeHook = () => {
1683
+ const updateMe = useWidgetsApiClient<Me>();
1684
+
1685
+ return useCallback(
1686
+ (updateMeInput: BodyType<UpdateMeInput>, signal?: AbortSignal) => {
1687
+ return updateMe({
1688
+ url: `/_widgets/UserProfile/me`,
1689
+ method: "POST",
1690
+ headers: { "Content-Type": "application/json" },
1691
+ data: updateMeInput,
1692
+ signal,
1693
+ });
1694
+ },
1695
+ [updateMe],
1696
+ );
1697
+ };
1698
+
1699
+ export const useUpdateMeMutationOptions = <
1700
+ TError = ErrorType<UpdateMe400 | UpdateMe403>,
1701
+ TContext = unknown,
1702
+ >(options?: {
1703
+ mutation?: UseMutationOptions<
1704
+ Awaited<ReturnType<ReturnType<typeof useUpdateMeHook>>>,
1705
+ TError,
1706
+ { data: BodyType<UpdateMeInput> },
1707
+ TContext
1708
+ >;
1709
+ }): UseMutationOptions<
1710
+ Awaited<ReturnType<ReturnType<typeof useUpdateMeHook>>>,
1711
+ TError,
1712
+ { data: BodyType<UpdateMeInput> },
1713
+ TContext
1714
+ > => {
1715
+ const mutationKey = ["updateMe"];
1716
+ const { mutation: mutationOptions } = options
1717
+ ? options.mutation &&
1718
+ "mutationKey" in options.mutation &&
1719
+ options.mutation.mutationKey
1720
+ ? options
1721
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
1722
+ : { mutation: { mutationKey } };
1723
+
1724
+ const updateMe = useUpdateMeHook();
1725
+
1726
+ const mutationFn: MutationFunction<
1727
+ Awaited<ReturnType<ReturnType<typeof useUpdateMeHook>>>,
1728
+ { data: BodyType<UpdateMeInput> }
1729
+ > = (props) => {
1730
+ const { data } = props ?? {};
1731
+
1732
+ return updateMe(data);
1733
+ };
1734
+
1735
+ return { mutationFn, ...mutationOptions };
1736
+ };
1737
+
1738
+ export type UpdateMeMutationResult = NonNullable<
1739
+ Awaited<ReturnType<ReturnType<typeof useUpdateMeHook>>>
1740
+ >;
1741
+ export type UpdateMeMutationBody = BodyType<UpdateMeInput>;
1742
+ export type UpdateMeMutationError = ErrorType<UpdateMe400 | UpdateMe403>;
1743
+
1744
+ export const useUpdateMe = <
1745
+ TError = ErrorType<UpdateMe400 | UpdateMe403>,
1746
+ TContext = unknown,
1747
+ >(options?: {
1748
+ mutation?: UseMutationOptions<
1749
+ Awaited<ReturnType<ReturnType<typeof useUpdateMeHook>>>,
1750
+ TError,
1751
+ { data: BodyType<UpdateMeInput> },
1752
+ TContext
1753
+ >;
1754
+ }): UseMutationResult<
1755
+ Awaited<ReturnType<ReturnType<typeof useUpdateMeHook>>>,
1756
+ TError,
1757
+ { data: BodyType<UpdateMeInput> },
1758
+ TContext
1759
+ > => {
1760
+ const mutationOptions = useUpdateMeMutationOptions(options);
1761
+
1762
+ return useMutation(mutationOptions);
1763
+ };
1764
+
1765
+ export const useCreateTotpFactorHook = () => {
1766
+ const createTotpFactor = useWidgetsApiClient<CreateTotpFactorResponse>();
1767
+
1768
+ return useCallback(
1769
+ (signal?: AbortSignal) => {
1770
+ return createTotpFactor({
1771
+ url: `/_widgets/UserProfile/create-totp-factor`,
1772
+ method: "POST",
1773
+ signal,
1774
+ });
1775
+ },
1776
+ [createTotpFactor],
1777
+ );
1778
+ };
1779
+
1780
+ export const useCreateTotpFactorMutationOptions = <
1781
+ TError = ErrorType<CreateTotpFactor400 | CreateTotpFactor403>,
1782
+ TContext = unknown,
1783
+ >(options?: {
1784
+ mutation?: UseMutationOptions<
1785
+ Awaited<ReturnType<ReturnType<typeof useCreateTotpFactorHook>>>,
1786
+ TError,
1787
+ void,
1788
+ TContext
1789
+ >;
1790
+ }): UseMutationOptions<
1791
+ Awaited<ReturnType<ReturnType<typeof useCreateTotpFactorHook>>>,
1792
+ TError,
1793
+ void,
1794
+ TContext
1795
+ > => {
1796
+ const mutationKey = ["createTotpFactor"];
1797
+ const { mutation: mutationOptions } = options
1798
+ ? options.mutation &&
1799
+ "mutationKey" in options.mutation &&
1800
+ options.mutation.mutationKey
1801
+ ? options
1802
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
1803
+ : { mutation: { mutationKey } };
1804
+
1805
+ const createTotpFactor = useCreateTotpFactorHook();
1806
+
1807
+ const mutationFn: MutationFunction<
1808
+ Awaited<ReturnType<ReturnType<typeof useCreateTotpFactorHook>>>,
1809
+ void
1810
+ > = () => {
1811
+ return createTotpFactor();
1812
+ };
1813
+
1814
+ return { mutationFn, ...mutationOptions };
1815
+ };
1816
+
1817
+ export type CreateTotpFactorMutationResult = NonNullable<
1818
+ Awaited<ReturnType<ReturnType<typeof useCreateTotpFactorHook>>>
1819
+ >;
1820
+
1821
+ export type CreateTotpFactorMutationError = ErrorType<
1822
+ CreateTotpFactor400 | CreateTotpFactor403
1823
+ >;
1824
+
1825
+ export const useCreateTotpFactor = <
1826
+ TError = ErrorType<CreateTotpFactor400 | CreateTotpFactor403>,
1827
+ TContext = unknown,
1828
+ >(options?: {
1829
+ mutation?: UseMutationOptions<
1830
+ Awaited<ReturnType<ReturnType<typeof useCreateTotpFactorHook>>>,
1831
+ TError,
1832
+ void,
1833
+ TContext
1834
+ >;
1835
+ }): UseMutationResult<
1836
+ Awaited<ReturnType<ReturnType<typeof useCreateTotpFactorHook>>>,
1837
+ TError,
1838
+ void,
1839
+ TContext
1840
+ > => {
1841
+ const mutationOptions = useCreateTotpFactorMutationOptions(options);
1842
+
1843
+ return useMutation(mutationOptions);
1844
+ };
1845
+
1846
+ export const useVerifyTotpFactorHook = () => {
1847
+ const verifyTotpFactor = useWidgetsApiClient<VerifyTotpFactor200>();
1848
+
1849
+ return useCallback(
1850
+ (
1851
+ verifyTotpFactorRequest: BodyType<VerifyTotpFactorRequest>,
1852
+ signal?: AbortSignal,
1853
+ ) => {
1854
+ return verifyTotpFactor({
1855
+ url: `/_widgets/UserProfile/verify-totp-factor`,
1856
+ method: "POST",
1857
+ headers: { "Content-Type": "application/json" },
1858
+ data: verifyTotpFactorRequest,
1859
+ signal,
1860
+ });
1861
+ },
1862
+ [verifyTotpFactor],
1863
+ );
1864
+ };
1865
+
1866
+ export const useVerifyTotpFactorMutationOptions = <
1867
+ TError = ErrorType<VerifyTotpFactor400 | VerifyTotpFactor403>,
1868
+ TContext = unknown,
1869
+ >(options?: {
1870
+ mutation?: UseMutationOptions<
1871
+ Awaited<ReturnType<ReturnType<typeof useVerifyTotpFactorHook>>>,
1872
+ TError,
1873
+ { data: BodyType<VerifyTotpFactorRequest> },
1874
+ TContext
1875
+ >;
1876
+ }): UseMutationOptions<
1877
+ Awaited<ReturnType<ReturnType<typeof useVerifyTotpFactorHook>>>,
1878
+ TError,
1879
+ { data: BodyType<VerifyTotpFactorRequest> },
1880
+ TContext
1881
+ > => {
1882
+ const mutationKey = ["verifyTotpFactor"];
1883
+ const { mutation: mutationOptions } = options
1884
+ ? options.mutation &&
1885
+ "mutationKey" in options.mutation &&
1886
+ options.mutation.mutationKey
1887
+ ? options
1888
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
1889
+ : { mutation: { mutationKey } };
1890
+
1891
+ const verifyTotpFactor = useVerifyTotpFactorHook();
1892
+
1893
+ const mutationFn: MutationFunction<
1894
+ Awaited<ReturnType<ReturnType<typeof useVerifyTotpFactorHook>>>,
1895
+ { data: BodyType<VerifyTotpFactorRequest> }
1896
+ > = (props) => {
1897
+ const { data } = props ?? {};
1898
+
1899
+ return verifyTotpFactor(data);
1900
+ };
1901
+
1902
+ return { mutationFn, ...mutationOptions };
1903
+ };
1904
+
1905
+ export type VerifyTotpFactorMutationResult = NonNullable<
1906
+ Awaited<ReturnType<ReturnType<typeof useVerifyTotpFactorHook>>>
1907
+ >;
1908
+ export type VerifyTotpFactorMutationBody = BodyType<VerifyTotpFactorRequest>;
1909
+ export type VerifyTotpFactorMutationError = ErrorType<
1910
+ VerifyTotpFactor400 | VerifyTotpFactor403
1911
+ >;
1912
+
1913
+ export const useVerifyTotpFactor = <
1914
+ TError = ErrorType<VerifyTotpFactor400 | VerifyTotpFactor403>,
1915
+ TContext = unknown,
1916
+ >(options?: {
1917
+ mutation?: UseMutationOptions<
1918
+ Awaited<ReturnType<ReturnType<typeof useVerifyTotpFactorHook>>>,
1919
+ TError,
1920
+ { data: BodyType<VerifyTotpFactorRequest> },
1921
+ TContext
1922
+ >;
1923
+ }): UseMutationResult<
1924
+ Awaited<ReturnType<ReturnType<typeof useVerifyTotpFactorHook>>>,
1925
+ TError,
1926
+ { data: BodyType<VerifyTotpFactorRequest> },
1927
+ TContext
1928
+ > => {
1929
+ const mutationOptions = useVerifyTotpFactorMutationOptions(options);
1930
+
1931
+ return useMutation(mutationOptions);
1932
+ };
1933
+
1934
+ export const useDeleteTotpFactorsHook = () => {
1935
+ const deleteTotpFactors = useWidgetsApiClient<DeleteTotpFactors200>();
1936
+
1937
+ return useCallback(() => {
1938
+ return deleteTotpFactors({
1939
+ url: `/_widgets/UserProfile/totp-factors`,
1940
+ method: "DELETE",
1941
+ });
1942
+ }, [deleteTotpFactors]);
1943
+ };
1944
+
1945
+ export const useDeleteTotpFactorsMutationOptions = <
1946
+ TError = ErrorType<DeleteTotpFactors400 | DeleteTotpFactors403>,
1947
+ TContext = unknown,
1948
+ >(options?: {
1949
+ mutation?: UseMutationOptions<
1950
+ Awaited<ReturnType<ReturnType<typeof useDeleteTotpFactorsHook>>>,
1951
+ TError,
1952
+ void,
1953
+ TContext
1954
+ >;
1955
+ }): UseMutationOptions<
1956
+ Awaited<ReturnType<ReturnType<typeof useDeleteTotpFactorsHook>>>,
1957
+ TError,
1958
+ void,
1959
+ TContext
1960
+ > => {
1961
+ const mutationKey = ["deleteTotpFactors"];
1962
+ const { mutation: mutationOptions } = options
1963
+ ? options.mutation &&
1964
+ "mutationKey" in options.mutation &&
1965
+ options.mutation.mutationKey
1966
+ ? options
1967
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
1968
+ : { mutation: { mutationKey } };
1969
+
1970
+ const deleteTotpFactors = useDeleteTotpFactorsHook();
1971
+
1972
+ const mutationFn: MutationFunction<
1973
+ Awaited<ReturnType<ReturnType<typeof useDeleteTotpFactorsHook>>>,
1974
+ void
1975
+ > = () => {
1976
+ return deleteTotpFactors();
1977
+ };
1978
+
1979
+ return { mutationFn, ...mutationOptions };
1980
+ };
1981
+
1982
+ export type DeleteTotpFactorsMutationResult = NonNullable<
1983
+ Awaited<ReturnType<ReturnType<typeof useDeleteTotpFactorsHook>>>
1984
+ >;
1985
+
1986
+ export type DeleteTotpFactorsMutationError = ErrorType<
1987
+ DeleteTotpFactors400 | DeleteTotpFactors403
1988
+ >;
1989
+
1990
+ export const useDeleteTotpFactors = <
1991
+ TError = ErrorType<DeleteTotpFactors400 | DeleteTotpFactors403>,
1992
+ TContext = unknown,
1993
+ >(options?: {
1994
+ mutation?: UseMutationOptions<
1995
+ Awaited<ReturnType<ReturnType<typeof useDeleteTotpFactorsHook>>>,
1996
+ TError,
1997
+ void,
1998
+ TContext
1999
+ >;
2000
+ }): UseMutationResult<
2001
+ Awaited<ReturnType<ReturnType<typeof useDeleteTotpFactorsHook>>>,
2002
+ TError,
2003
+ void,
2004
+ TContext
2005
+ > => {
2006
+ const mutationOptions = useDeleteTotpFactorsMutationOptions(options);
2007
+
2008
+ return useMutation(mutationOptions);
2009
+ };
2010
+
2011
+ export const useAuthenticationInformationHook = () => {
2012
+ const authenticationInformation =
2013
+ useWidgetsApiClient<AuthenticationInformationResponse>();
2014
+
2015
+ return useCallback(
2016
+ (signal?: AbortSignal) => {
2017
+ return authenticationInformation({
2018
+ url: `/_widgets/UserProfile/authentication-information`,
2019
+ method: "GET",
2020
+ signal,
2021
+ });
2022
+ },
2023
+ [authenticationInformation],
2024
+ );
2025
+ };
2026
+
2027
+ export const getAuthenticationInformationQueryKey = () => {
2028
+ return [`/_widgets/UserProfile/authentication-information`] as const;
2029
+ };
2030
+
2031
+ export const useAuthenticationInformationQueryOptions = <
2032
+ TData = Awaited<
2033
+ ReturnType<ReturnType<typeof useAuthenticationInformationHook>>
2034
+ >,
2035
+ TError = ErrorType<AuthenticationInformation403>,
2036
+ >(options?: {
2037
+ query?: Partial<
2038
+ UseQueryOptions<
2039
+ Awaited<ReturnType<ReturnType<typeof useAuthenticationInformationHook>>>,
2040
+ TError,
2041
+ TData
2042
+ >
2043
+ >;
2044
+ }) => {
2045
+ const { query: queryOptions } = options ?? {};
2046
+
2047
+ const queryKey =
2048
+ queryOptions?.queryKey ?? getAuthenticationInformationQueryKey();
2049
+
2050
+ const authenticationInformation = useAuthenticationInformationHook();
2051
+
2052
+ const queryFn: QueryFunction<
2053
+ Awaited<ReturnType<ReturnType<typeof useAuthenticationInformationHook>>>
2054
+ > = ({ signal }) => authenticationInformation(signal);
2055
+
2056
+ const customOptions = useWidgetsApiQueryOptions({
2057
+ ...queryOptions,
2058
+ queryKey,
2059
+ queryFn,
2060
+ });
2061
+
2062
+ return customOptions as UseQueryOptions<
2063
+ Awaited<ReturnType<ReturnType<typeof useAuthenticationInformationHook>>>,
2064
+ TError,
2065
+ TData
2066
+ > & { queryKey: DataTag<QueryKey, TData> };
2067
+ };
2068
+
2069
+ export type AuthenticationInformationQueryResult = NonNullable<
2070
+ Awaited<ReturnType<ReturnType<typeof useAuthenticationInformationHook>>>
2071
+ >;
2072
+ export type AuthenticationInformationQueryError =
2073
+ ErrorType<AuthenticationInformation403>;
2074
+
2075
+ export function useAuthenticationInformation<
2076
+ TData = Awaited<
2077
+ ReturnType<ReturnType<typeof useAuthenticationInformationHook>>
2078
+ >,
2079
+ TError = ErrorType<AuthenticationInformation403>,
2080
+ >(options: {
2081
+ query: Partial<
2082
+ UseQueryOptions<
2083
+ Awaited<ReturnType<ReturnType<typeof useAuthenticationInformationHook>>>,
2084
+ TError,
2085
+ TData
2086
+ >
2087
+ > &
2088
+ Pick<
2089
+ DefinedInitialDataOptions<
2090
+ Awaited<
2091
+ ReturnType<ReturnType<typeof useAuthenticationInformationHook>>
2092
+ >,
2093
+ TError,
2094
+ Awaited<ReturnType<ReturnType<typeof useAuthenticationInformationHook>>>
2095
+ >,
2096
+ "initialData"
2097
+ >;
2098
+ }): DefinedUseQueryResult<TData, TError> & {
2099
+ queryKey: DataTag<QueryKey, TData>;
2100
+ };
2101
+ export function useAuthenticationInformation<
2102
+ TData = Awaited<
2103
+ ReturnType<ReturnType<typeof useAuthenticationInformationHook>>
2104
+ >,
2105
+ TError = ErrorType<AuthenticationInformation403>,
2106
+ >(options?: {
2107
+ query?: Partial<
2108
+ UseQueryOptions<
2109
+ Awaited<ReturnType<ReturnType<typeof useAuthenticationInformationHook>>>,
2110
+ TError,
2111
+ TData
2112
+ >
2113
+ > &
2114
+ Pick<
2115
+ UndefinedInitialDataOptions<
2116
+ Awaited<
2117
+ ReturnType<ReturnType<typeof useAuthenticationInformationHook>>
2118
+ >,
2119
+ TError,
2120
+ Awaited<ReturnType<ReturnType<typeof useAuthenticationInformationHook>>>
2121
+ >,
2122
+ "initialData"
2123
+ >;
2124
+ }): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
2125
+ export function useAuthenticationInformation<
2126
+ TData = Awaited<
2127
+ ReturnType<ReturnType<typeof useAuthenticationInformationHook>>
2128
+ >,
2129
+ TError = ErrorType<AuthenticationInformation403>,
2130
+ >(options?: {
2131
+ query?: Partial<
2132
+ UseQueryOptions<
2133
+ Awaited<ReturnType<ReturnType<typeof useAuthenticationInformationHook>>>,
2134
+ TError,
2135
+ TData
2136
+ >
2137
+ >;
2138
+ }): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
2139
+
2140
+ export function useAuthenticationInformation<
2141
+ TData = Awaited<
2142
+ ReturnType<ReturnType<typeof useAuthenticationInformationHook>>
2143
+ >,
2144
+ TError = ErrorType<AuthenticationInformation403>,
2145
+ >(options?: {
2146
+ query?: Partial<
2147
+ UseQueryOptions<
2148
+ Awaited<ReturnType<ReturnType<typeof useAuthenticationInformationHook>>>,
2149
+ TError,
2150
+ TData
2151
+ >
2152
+ >;
2153
+ }): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
2154
+ const queryOptions = useAuthenticationInformationQueryOptions(options);
2155
+
2156
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
2157
+ queryKey: DataTag<QueryKey, TData>;
2158
+ };
2159
+
2160
+ query.queryKey = queryOptions.queryKey;
2161
+
2162
+ return query;
2163
+ }
2164
+
2165
+ export const useCreatePasswordHook = () => {
2166
+ const createPassword = useWidgetsApiClient<CreatePassword201>();
2167
+
2168
+ return useCallback(
2169
+ (
2170
+ createPasswordRequest: BodyType<CreatePasswordRequest>,
2171
+ signal?: AbortSignal,
2172
+ ) => {
2173
+ return createPassword({
2174
+ url: `/_widgets/UserProfile/create-password`,
2175
+ method: "POST",
2176
+ headers: { "Content-Type": "application/json" },
2177
+ data: createPasswordRequest,
2178
+ signal,
2179
+ });
2180
+ },
2181
+ [createPassword],
2182
+ );
2183
+ };
2184
+
2185
+ export const useCreatePasswordMutationOptions = <
2186
+ TError = ErrorType<CreatePassword400 | CreatePassword403>,
2187
+ TContext = unknown,
2188
+ >(options?: {
2189
+ mutation?: UseMutationOptions<
2190
+ Awaited<ReturnType<ReturnType<typeof useCreatePasswordHook>>>,
2191
+ TError,
2192
+ { data: BodyType<CreatePasswordRequest> },
2193
+ TContext
2194
+ >;
2195
+ }): UseMutationOptions<
2196
+ Awaited<ReturnType<ReturnType<typeof useCreatePasswordHook>>>,
2197
+ TError,
2198
+ { data: BodyType<CreatePasswordRequest> },
2199
+ TContext
2200
+ > => {
2201
+ const mutationKey = ["createPassword"];
2202
+ const { mutation: mutationOptions } = options
2203
+ ? options.mutation &&
2204
+ "mutationKey" in options.mutation &&
2205
+ options.mutation.mutationKey
2206
+ ? options
2207
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
2208
+ : { mutation: { mutationKey } };
2209
+
2210
+ const createPassword = useCreatePasswordHook();
2211
+
2212
+ const mutationFn: MutationFunction<
2213
+ Awaited<ReturnType<ReturnType<typeof useCreatePasswordHook>>>,
2214
+ { data: BodyType<CreatePasswordRequest> }
2215
+ > = (props) => {
2216
+ const { data } = props ?? {};
2217
+
2218
+ return createPassword(data);
2219
+ };
2220
+
2221
+ return { mutationFn, ...mutationOptions };
2222
+ };
2223
+
2224
+ export type CreatePasswordMutationResult = NonNullable<
2225
+ Awaited<ReturnType<ReturnType<typeof useCreatePasswordHook>>>
2226
+ >;
2227
+ export type CreatePasswordMutationBody = BodyType<CreatePasswordRequest>;
2228
+ export type CreatePasswordMutationError = ErrorType<
2229
+ CreatePassword400 | CreatePassword403
2230
+ >;
2231
+
2232
+ export const useCreatePassword = <
2233
+ TError = ErrorType<CreatePassword400 | CreatePassword403>,
2234
+ TContext = unknown,
2235
+ >(options?: {
2236
+ mutation?: UseMutationOptions<
2237
+ Awaited<ReturnType<ReturnType<typeof useCreatePasswordHook>>>,
2238
+ TError,
2239
+ { data: BodyType<CreatePasswordRequest> },
2240
+ TContext
2241
+ >;
2242
+ }): UseMutationResult<
2243
+ Awaited<ReturnType<ReturnType<typeof useCreatePasswordHook>>>,
2244
+ TError,
2245
+ { data: BodyType<CreatePasswordRequest> },
2246
+ TContext
2247
+ > => {
2248
+ const mutationOptions = useCreatePasswordMutationOptions(options);
2249
+
2250
+ return useMutation(mutationOptions);
2251
+ };
2252
+
2253
+ export const useUpdatePasswordHook = () => {
2254
+ const updatePassword = useWidgetsApiClient<UpdatePassword201>();
2255
+
2256
+ return useCallback(
2257
+ (
2258
+ updatePasswordRequest: BodyType<UpdatePasswordRequest>,
2259
+ signal?: AbortSignal,
2260
+ ) => {
2261
+ return updatePassword({
2262
+ url: `/_widgets/UserProfile/update-password`,
2263
+ method: "POST",
2264
+ headers: { "Content-Type": "application/json" },
2265
+ data: updatePasswordRequest,
2266
+ signal,
2267
+ });
2268
+ },
2269
+ [updatePassword],
2270
+ );
2271
+ };
2272
+
2273
+ export const useUpdatePasswordMutationOptions = <
2274
+ TError = ErrorType<UpdatePassword400 | UpdatePassword403>,
2275
+ TContext = unknown,
2276
+ >(options?: {
2277
+ mutation?: UseMutationOptions<
2278
+ Awaited<ReturnType<ReturnType<typeof useUpdatePasswordHook>>>,
2279
+ TError,
2280
+ { data: BodyType<UpdatePasswordRequest> },
2281
+ TContext
2282
+ >;
2283
+ }): UseMutationOptions<
2284
+ Awaited<ReturnType<ReturnType<typeof useUpdatePasswordHook>>>,
2285
+ TError,
2286
+ { data: BodyType<UpdatePasswordRequest> },
2287
+ TContext
2288
+ > => {
2289
+ const mutationKey = ["updatePassword"];
2290
+ const { mutation: mutationOptions } = options
2291
+ ? options.mutation &&
2292
+ "mutationKey" in options.mutation &&
2293
+ options.mutation.mutationKey
2294
+ ? options
2295
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
2296
+ : { mutation: { mutationKey } };
2297
+
2298
+ const updatePassword = useUpdatePasswordHook();
2299
+
2300
+ const mutationFn: MutationFunction<
2301
+ Awaited<ReturnType<ReturnType<typeof useUpdatePasswordHook>>>,
2302
+ { data: BodyType<UpdatePasswordRequest> }
2303
+ > = (props) => {
2304
+ const { data } = props ?? {};
2305
+
2306
+ return updatePassword(data);
2307
+ };
2308
+
2309
+ return { mutationFn, ...mutationOptions };
2310
+ };
2311
+
2312
+ export type UpdatePasswordMutationResult = NonNullable<
2313
+ Awaited<ReturnType<ReturnType<typeof useUpdatePasswordHook>>>
2314
+ >;
2315
+ export type UpdatePasswordMutationBody = BodyType<UpdatePasswordRequest>;
2316
+ export type UpdatePasswordMutationError = ErrorType<
2317
+ UpdatePassword400 | UpdatePassword403
2318
+ >;
2319
+
2320
+ export const useUpdatePassword = <
2321
+ TError = ErrorType<UpdatePassword400 | UpdatePassword403>,
2322
+ TContext = unknown,
2323
+ >(options?: {
2324
+ mutation?: UseMutationOptions<
2325
+ Awaited<ReturnType<ReturnType<typeof useUpdatePasswordHook>>>,
2326
+ TError,
2327
+ { data: BodyType<UpdatePasswordRequest> },
2328
+ TContext
2329
+ >;
2330
+ }): UseMutationResult<
2331
+ Awaited<ReturnType<ReturnType<typeof useUpdatePasswordHook>>>,
2332
+ TError,
2333
+ { data: BodyType<UpdatePasswordRequest> },
2334
+ TContext
2335
+ > => {
2336
+ const mutationOptions = useUpdatePasswordMutationOptions(options);
2337
+
2338
+ return useMutation(mutationOptions);
2339
+ };
2340
+
2341
+ export const useRevokeAllSessionsHook = () => {
2342
+ const revokeAllSessions = useWidgetsApiClient<RevokeAllSessions200>();
2343
+
2344
+ return useCallback(
2345
+ (revokeAllSessionsRequest: BodyType<RevokeAllSessionsRequest>) => {
2346
+ return revokeAllSessions({
2347
+ url: `/_widgets/UserProfile/sessions/revoke-all`,
2348
+ method: "DELETE",
2349
+ headers: { "Content-Type": "application/json" },
2350
+ data: revokeAllSessionsRequest,
2351
+ });
2352
+ },
2353
+ [revokeAllSessions],
2354
+ );
2355
+ };
2356
+
2357
+ export const useRevokeAllSessionsMutationOptions = <
2358
+ TError = ErrorType<RevokeAllSessions400 | RevokeAllSessions403>,
2359
+ TContext = unknown,
2360
+ >(options?: {
2361
+ mutation?: UseMutationOptions<
2362
+ Awaited<ReturnType<ReturnType<typeof useRevokeAllSessionsHook>>>,
2363
+ TError,
2364
+ { data: BodyType<RevokeAllSessionsRequest> },
2365
+ TContext
2366
+ >;
2367
+ }): UseMutationOptions<
2368
+ Awaited<ReturnType<ReturnType<typeof useRevokeAllSessionsHook>>>,
2369
+ TError,
2370
+ { data: BodyType<RevokeAllSessionsRequest> },
2371
+ TContext
2372
+ > => {
2373
+ const mutationKey = ["revokeAllSessions"];
2374
+ const { mutation: mutationOptions } = options
2375
+ ? options.mutation &&
2376
+ "mutationKey" in options.mutation &&
2377
+ options.mutation.mutationKey
2378
+ ? options
2379
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
2380
+ : { mutation: { mutationKey } };
2381
+
2382
+ const revokeAllSessions = useRevokeAllSessionsHook();
2383
+
2384
+ const mutationFn: MutationFunction<
2385
+ Awaited<ReturnType<ReturnType<typeof useRevokeAllSessionsHook>>>,
2386
+ { data: BodyType<RevokeAllSessionsRequest> }
2387
+ > = (props) => {
2388
+ const { data } = props ?? {};
2389
+
2390
+ return revokeAllSessions(data);
2391
+ };
2392
+
2393
+ return { mutationFn, ...mutationOptions };
2394
+ };
2395
+
2396
+ export type RevokeAllSessionsMutationResult = NonNullable<
2397
+ Awaited<ReturnType<ReturnType<typeof useRevokeAllSessionsHook>>>
2398
+ >;
2399
+ export type RevokeAllSessionsMutationBody = BodyType<RevokeAllSessionsRequest>;
2400
+ export type RevokeAllSessionsMutationError = ErrorType<
2401
+ RevokeAllSessions400 | RevokeAllSessions403
2402
+ >;
2403
+
2404
+ export const useRevokeAllSessions = <
2405
+ TError = ErrorType<RevokeAllSessions400 | RevokeAllSessions403>,
2406
+ TContext = unknown,
2407
+ >(options?: {
2408
+ mutation?: UseMutationOptions<
2409
+ Awaited<ReturnType<ReturnType<typeof useRevokeAllSessionsHook>>>,
2410
+ TError,
2411
+ { data: BodyType<RevokeAllSessionsRequest> },
2412
+ TContext
2413
+ >;
2414
+ }): UseMutationResult<
2415
+ Awaited<ReturnType<ReturnType<typeof useRevokeAllSessionsHook>>>,
2416
+ TError,
2417
+ { data: BodyType<RevokeAllSessionsRequest> },
2418
+ TContext
2419
+ > => {
2420
+ const mutationOptions = useRevokeAllSessionsMutationOptions(options);
2421
+
2422
+ return useMutation(mutationOptions);
2423
+ };
2424
+
2425
+ export const useRevokeSessionHook = () => {
2426
+ const revokeSession = useWidgetsApiClient<RevokeSession200>();
2427
+
2428
+ return useCallback(
2429
+ (sessionId: string) => {
2430
+ return revokeSession({
2431
+ url: `/_widgets/UserProfile/sessions/revoke/${sessionId}`,
2432
+ method: "DELETE",
2433
+ });
2434
+ },
2435
+ [revokeSession],
2436
+ );
2437
+ };
2438
+
2439
+ export const useRevokeSessionMutationOptions = <
2440
+ TError = ErrorType<RevokeSession400 | RevokeSession403>,
2441
+ TContext = unknown,
2442
+ >(options?: {
2443
+ mutation?: UseMutationOptions<
2444
+ Awaited<ReturnType<ReturnType<typeof useRevokeSessionHook>>>,
2445
+ TError,
2446
+ { sessionId: string },
2447
+ TContext
2448
+ >;
2449
+ }): UseMutationOptions<
2450
+ Awaited<ReturnType<ReturnType<typeof useRevokeSessionHook>>>,
2451
+ TError,
2452
+ { sessionId: string },
2453
+ TContext
2454
+ > => {
2455
+ const mutationKey = ["revokeSession"];
2456
+ const { mutation: mutationOptions } = options
2457
+ ? options.mutation &&
2458
+ "mutationKey" in options.mutation &&
2459
+ options.mutation.mutationKey
2460
+ ? options
2461
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
2462
+ : { mutation: { mutationKey } };
2463
+
2464
+ const revokeSession = useRevokeSessionHook();
2465
+
2466
+ const mutationFn: MutationFunction<
2467
+ Awaited<ReturnType<ReturnType<typeof useRevokeSessionHook>>>,
2468
+ { sessionId: string }
2469
+ > = (props) => {
2470
+ const { sessionId } = props ?? {};
2471
+
2472
+ return revokeSession(sessionId);
2473
+ };
2474
+
2475
+ return { mutationFn, ...mutationOptions };
2476
+ };
2477
+
2478
+ export type RevokeSessionMutationResult = NonNullable<
2479
+ Awaited<ReturnType<ReturnType<typeof useRevokeSessionHook>>>
2480
+ >;
2481
+
2482
+ export type RevokeSessionMutationError = ErrorType<
2483
+ RevokeSession400 | RevokeSession403
2484
+ >;
2485
+
2486
+ export const useRevokeSession = <
2487
+ TError = ErrorType<RevokeSession400 | RevokeSession403>,
2488
+ TContext = unknown,
2489
+ >(options?: {
2490
+ mutation?: UseMutationOptions<
2491
+ Awaited<ReturnType<ReturnType<typeof useRevokeSessionHook>>>,
2492
+ TError,
2493
+ { sessionId: string },
2494
+ TContext
2495
+ >;
2496
+ }): UseMutationResult<
2497
+ Awaited<ReturnType<ReturnType<typeof useRevokeSessionHook>>>,
2498
+ TError,
2499
+ { sessionId: string },
2500
+ TContext
2501
+ > => {
2502
+ const mutationOptions = useRevokeSessionMutationOptions(options);
2503
+
2504
+ return useMutation(mutationOptions);
2505
+ };
2506
+
2507
+ export const useSessionsHook = () => {
2508
+ const sessions = useWidgetsApiClient<ActiveSessionsResponse>();
2509
+
2510
+ return useCallback(
2511
+ (signal?: AbortSignal) => {
2512
+ return sessions({
2513
+ url: `/_widgets/UserProfile/sessions`,
2514
+ method: "GET",
2515
+ signal,
2516
+ });
2517
+ },
2518
+ [sessions],
2519
+ );
2520
+ };
2521
+
2522
+ export const getSessionsQueryKey = () => {
2523
+ return [`/_widgets/UserProfile/sessions`] as const;
2524
+ };
2525
+
2526
+ export const useSessionsQueryOptions = <
2527
+ TData = Awaited<ReturnType<ReturnType<typeof useSessionsHook>>>,
2528
+ TError = ErrorType<Sessions403>,
2529
+ >(options?: {
2530
+ query?: Partial<
2531
+ UseQueryOptions<
2532
+ Awaited<ReturnType<ReturnType<typeof useSessionsHook>>>,
2533
+ TError,
2534
+ TData
2535
+ >
2536
+ >;
2537
+ }) => {
2538
+ const { query: queryOptions } = options ?? {};
2539
+
2540
+ const queryKey = queryOptions?.queryKey ?? getSessionsQueryKey();
2541
+
2542
+ const sessions = useSessionsHook();
2543
+
2544
+ const queryFn: QueryFunction<
2545
+ Awaited<ReturnType<ReturnType<typeof useSessionsHook>>>
2546
+ > = ({ signal }) => sessions(signal);
2547
+
2548
+ const customOptions = useWidgetsApiQueryOptions({
2549
+ ...queryOptions,
2550
+ queryKey,
2551
+ queryFn,
2552
+ });
2553
+
2554
+ return customOptions as UseQueryOptions<
2555
+ Awaited<ReturnType<ReturnType<typeof useSessionsHook>>>,
2556
+ TError,
2557
+ TData
2558
+ > & { queryKey: DataTag<QueryKey, TData> };
2559
+ };
2560
+
2561
+ export type SessionsQueryResult = NonNullable<
2562
+ Awaited<ReturnType<ReturnType<typeof useSessionsHook>>>
2563
+ >;
2564
+ export type SessionsQueryError = ErrorType<Sessions403>;
2565
+
2566
+ export function useSessions<
2567
+ TData = Awaited<ReturnType<ReturnType<typeof useSessionsHook>>>,
2568
+ TError = ErrorType<Sessions403>,
2569
+ >(options: {
2570
+ query: Partial<
2571
+ UseQueryOptions<
2572
+ Awaited<ReturnType<ReturnType<typeof useSessionsHook>>>,
2573
+ TError,
2574
+ TData
2575
+ >
2576
+ > &
2577
+ Pick<
2578
+ DefinedInitialDataOptions<
2579
+ Awaited<ReturnType<ReturnType<typeof useSessionsHook>>>,
2580
+ TError,
2581
+ Awaited<ReturnType<ReturnType<typeof useSessionsHook>>>
2582
+ >,
2583
+ "initialData"
2584
+ >;
2585
+ }): DefinedUseQueryResult<TData, TError> & {
2586
+ queryKey: DataTag<QueryKey, TData>;
2587
+ };
2588
+ export function useSessions<
2589
+ TData = Awaited<ReturnType<ReturnType<typeof useSessionsHook>>>,
2590
+ TError = ErrorType<Sessions403>,
2591
+ >(options?: {
2592
+ query?: Partial<
2593
+ UseQueryOptions<
2594
+ Awaited<ReturnType<ReturnType<typeof useSessionsHook>>>,
2595
+ TError,
2596
+ TData
2597
+ >
2598
+ > &
2599
+ Pick<
2600
+ UndefinedInitialDataOptions<
2601
+ Awaited<ReturnType<ReturnType<typeof useSessionsHook>>>,
2602
+ TError,
2603
+ Awaited<ReturnType<ReturnType<typeof useSessionsHook>>>
2604
+ >,
2605
+ "initialData"
2606
+ >;
2607
+ }): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
2608
+ export function useSessions<
2609
+ TData = Awaited<ReturnType<ReturnType<typeof useSessionsHook>>>,
2610
+ TError = ErrorType<Sessions403>,
2611
+ >(options?: {
2612
+ query?: Partial<
2613
+ UseQueryOptions<
2614
+ Awaited<ReturnType<ReturnType<typeof useSessionsHook>>>,
2615
+ TError,
2616
+ TData
2617
+ >
2618
+ >;
2619
+ }): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
2620
+
2621
+ export function useSessions<
2622
+ TData = Awaited<ReturnType<ReturnType<typeof useSessionsHook>>>,
2623
+ TError = ErrorType<Sessions403>,
2624
+ >(options?: {
2625
+ query?: Partial<
2626
+ UseQueryOptions<
2627
+ Awaited<ReturnType<ReturnType<typeof useSessionsHook>>>,
2628
+ TError,
2629
+ TData
2630
+ >
2631
+ >;
2632
+ }): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
2633
+ const queryOptions = useSessionsQueryOptions(options);
2634
+
2635
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
2636
+ queryKey: DataTag<QueryKey, TData>;
2637
+ };
2638
+
2639
+ query.queryKey = queryOptions.queryKey;
2640
+
2641
+ return query;
2642
+ }
2643
+
2644
+ export const useSendVerificationHook = () => {
2645
+ const sendVerification = useWidgetsApiClient<SendVerificationResponse>();
2646
+
2647
+ return useCallback(
2648
+ (signal?: AbortSignal) => {
2649
+ return sendVerification({
2650
+ url: `/_widgets/UserProfile/send-verification`,
2651
+ method: "POST",
2652
+ signal,
2653
+ });
2654
+ },
2655
+ [sendVerification],
2656
+ );
2657
+ };
2658
+
2659
+ export const useSendVerificationMutationOptions = <
2660
+ TError = ErrorType<SendVerification400 | SendVerification403>,
2661
+ TContext = unknown,
2662
+ >(options?: {
2663
+ mutation?: UseMutationOptions<
2664
+ Awaited<ReturnType<ReturnType<typeof useSendVerificationHook>>>,
2665
+ TError,
2666
+ void,
2667
+ TContext
2668
+ >;
2669
+ }): UseMutationOptions<
2670
+ Awaited<ReturnType<ReturnType<typeof useSendVerificationHook>>>,
2671
+ TError,
2672
+ void,
2673
+ TContext
2674
+ > => {
2675
+ const mutationKey = ["sendVerification"];
2676
+ const { mutation: mutationOptions } = options
2677
+ ? options.mutation &&
2678
+ "mutationKey" in options.mutation &&
2679
+ options.mutation.mutationKey
2680
+ ? options
2681
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
2682
+ : { mutation: { mutationKey } };
2683
+
2684
+ const sendVerification = useSendVerificationHook();
2685
+
2686
+ const mutationFn: MutationFunction<
2687
+ Awaited<ReturnType<ReturnType<typeof useSendVerificationHook>>>,
2688
+ void
2689
+ > = () => {
2690
+ return sendVerification();
2691
+ };
2692
+
2693
+ return { mutationFn, ...mutationOptions };
2694
+ };
2695
+
2696
+ export type SendVerificationMutationResult = NonNullable<
2697
+ Awaited<ReturnType<ReturnType<typeof useSendVerificationHook>>>
2698
+ >;
2699
+
2700
+ export type SendVerificationMutationError = ErrorType<
2701
+ SendVerification400 | SendVerification403
2702
+ >;
2703
+
2704
+ export const useSendVerification = <
2705
+ TError = ErrorType<SendVerification400 | SendVerification403>,
2706
+ TContext = unknown,
2707
+ >(options?: {
2708
+ mutation?: UseMutationOptions<
2709
+ Awaited<ReturnType<ReturnType<typeof useSendVerificationHook>>>,
2710
+ TError,
2711
+ void,
2712
+ TContext
2713
+ >;
2714
+ }): UseMutationResult<
2715
+ Awaited<ReturnType<ReturnType<typeof useSendVerificationHook>>>,
2716
+ TError,
2717
+ void,
2718
+ TContext
2719
+ > => {
2720
+ const mutationOptions = useSendVerificationMutationOptions(options);
2721
+
2722
+ return useMutation(mutationOptions);
2723
+ };
2724
+
2725
+ export const useVerifyHook = () => {
2726
+ const verify = useWidgetsApiClient<VerifyResponse>();
2727
+
2728
+ return useCallback(
2729
+ (verifyRequest: BodyType<VerifyRequest>, signal?: AbortSignal) => {
2730
+ return verify({
2731
+ url: `/_widgets/UserProfile/verify`,
2732
+ method: "POST",
2733
+ headers: { "Content-Type": "application/json" },
2734
+ data: verifyRequest,
2735
+ signal,
2736
+ });
2737
+ },
2738
+ [verify],
2739
+ );
2740
+ };
2741
+
2742
+ export const useVerifyMutationOptions = <
2743
+ TError = ErrorType<Verify400 | Verify403>,
2744
+ TContext = unknown,
2745
+ >(options?: {
2746
+ mutation?: UseMutationOptions<
2747
+ Awaited<ReturnType<ReturnType<typeof useVerifyHook>>>,
2748
+ TError,
2749
+ { data: BodyType<VerifyRequest> },
2750
+ TContext
2751
+ >;
2752
+ }): UseMutationOptions<
2753
+ Awaited<ReturnType<ReturnType<typeof useVerifyHook>>>,
2754
+ TError,
2755
+ { data: BodyType<VerifyRequest> },
2756
+ TContext
2757
+ > => {
2758
+ const mutationKey = ["verify"];
2759
+ const { mutation: mutationOptions } = options
2760
+ ? options.mutation &&
2761
+ "mutationKey" in options.mutation &&
2762
+ options.mutation.mutationKey
2763
+ ? options
2764
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
2765
+ : { mutation: { mutationKey } };
2766
+
2767
+ const verify = useVerifyHook();
2768
+
2769
+ const mutationFn: MutationFunction<
2770
+ Awaited<ReturnType<ReturnType<typeof useVerifyHook>>>,
2771
+ { data: BodyType<VerifyRequest> }
2772
+ > = (props) => {
2773
+ const { data } = props ?? {};
2774
+
2775
+ return verify(data);
2776
+ };
2777
+
2778
+ return { mutationFn, ...mutationOptions };
2779
+ };
2780
+
2781
+ export type VerifyMutationResult = NonNullable<
2782
+ Awaited<ReturnType<ReturnType<typeof useVerifyHook>>>
2783
+ >;
2784
+ export type VerifyMutationBody = BodyType<VerifyRequest>;
2785
+ export type VerifyMutationError = ErrorType<Verify400 | Verify403>;
2786
+
2787
+ export const useVerify = <
2788
+ TError = ErrorType<Verify400 | Verify403>,
2789
+ TContext = unknown,
2790
+ >(options?: {
2791
+ mutation?: UseMutationOptions<
2792
+ Awaited<ReturnType<ReturnType<typeof useVerifyHook>>>,
2793
+ TError,
2794
+ { data: BodyType<VerifyRequest> },
2795
+ TContext
2796
+ >;
2797
+ }): UseMutationResult<
2798
+ Awaited<ReturnType<ReturnType<typeof useVerifyHook>>>,
2799
+ TError,
2800
+ { data: BodyType<VerifyRequest> },
2801
+ TContext
2802
+ > => {
2803
+ const mutationOptions = useVerifyMutationOptions(options);
2804
+
2805
+ return useMutation(mutationOptions);
2806
+ };
2807
+
2808
+ export const useRegisterPasskeyHook = () => {
2809
+ const registerPasskey = useWidgetsApiClient<RegisterPasskeyResponse>();
2810
+
2811
+ return useCallback(
2812
+ (signal?: AbortSignal) => {
2813
+ return registerPasskey({
2814
+ url: `/_widgets/UserProfile/passkeys`,
2815
+ method: "POST",
2816
+ signal,
2817
+ });
2818
+ },
2819
+ [registerPasskey],
2820
+ );
2821
+ };
2822
+
2823
+ export const useRegisterPasskeyMutationOptions = <
2824
+ TError = ErrorType<RegisterPasskey400 | RegisterPasskey403>,
2825
+ TContext = unknown,
2826
+ >(options?: {
2827
+ mutation?: UseMutationOptions<
2828
+ Awaited<ReturnType<ReturnType<typeof useRegisterPasskeyHook>>>,
2829
+ TError,
2830
+ void,
2831
+ TContext
2832
+ >;
2833
+ }): UseMutationOptions<
2834
+ Awaited<ReturnType<ReturnType<typeof useRegisterPasskeyHook>>>,
2835
+ TError,
2836
+ void,
2837
+ TContext
2838
+ > => {
2839
+ const mutationKey = ["registerPasskey"];
2840
+ const { mutation: mutationOptions } = options
2841
+ ? options.mutation &&
2842
+ "mutationKey" in options.mutation &&
2843
+ options.mutation.mutationKey
2844
+ ? options
2845
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
2846
+ : { mutation: { mutationKey } };
2847
+
2848
+ const registerPasskey = useRegisterPasskeyHook();
2849
+
2850
+ const mutationFn: MutationFunction<
2851
+ Awaited<ReturnType<ReturnType<typeof useRegisterPasskeyHook>>>,
2852
+ void
2853
+ > = () => {
2854
+ return registerPasskey();
2855
+ };
2856
+
2857
+ return { mutationFn, ...mutationOptions };
2858
+ };
2859
+
2860
+ export type RegisterPasskeyMutationResult = NonNullable<
2861
+ Awaited<ReturnType<ReturnType<typeof useRegisterPasskeyHook>>>
2862
+ >;
2863
+
2864
+ export type RegisterPasskeyMutationError = ErrorType<
2865
+ RegisterPasskey400 | RegisterPasskey403
2866
+ >;
2867
+
2868
+ export const useRegisterPasskey = <
2869
+ TError = ErrorType<RegisterPasskey400 | RegisterPasskey403>,
2870
+ TContext = unknown,
2871
+ >(options?: {
2872
+ mutation?: UseMutationOptions<
2873
+ Awaited<ReturnType<ReturnType<typeof useRegisterPasskeyHook>>>,
2874
+ TError,
2875
+ void,
2876
+ TContext
2877
+ >;
2878
+ }): UseMutationResult<
2879
+ Awaited<ReturnType<ReturnType<typeof useRegisterPasskeyHook>>>,
2880
+ TError,
2881
+ void,
2882
+ TContext
2883
+ > => {
2884
+ const mutationOptions = useRegisterPasskeyMutationOptions(options);
2885
+
2886
+ return useMutation(mutationOptions);
2887
+ };
2888
+
2889
+ export const useVerifyPasskeyHook = () => {
2890
+ const verifyPasskey = useWidgetsApiClient<VerifyPasskey200>();
2891
+
2892
+ return useCallback(
2893
+ (
2894
+ verifyPasskeyRequest: BodyType<VerifyPasskeyRequest>,
2895
+ signal?: AbortSignal,
2896
+ ) => {
2897
+ return verifyPasskey({
2898
+ url: `/_widgets/UserProfile/passkeys/verify`,
2899
+ method: "POST",
2900
+ headers: { "Content-Type": "application/json" },
2901
+ data: verifyPasskeyRequest,
2902
+ signal,
2903
+ });
2904
+ },
2905
+ [verifyPasskey],
2906
+ );
2907
+ };
2908
+
2909
+ export const useVerifyPasskeyMutationOptions = <
2910
+ TError = ErrorType<VerifyPasskey400 | VerifyPasskey403>,
2911
+ TContext = unknown,
2912
+ >(options?: {
2913
+ mutation?: UseMutationOptions<
2914
+ Awaited<ReturnType<ReturnType<typeof useVerifyPasskeyHook>>>,
2915
+ TError,
2916
+ { data: BodyType<VerifyPasskeyRequest> },
2917
+ TContext
2918
+ >;
2919
+ }): UseMutationOptions<
2920
+ Awaited<ReturnType<ReturnType<typeof useVerifyPasskeyHook>>>,
2921
+ TError,
2922
+ { data: BodyType<VerifyPasskeyRequest> },
2923
+ TContext
2924
+ > => {
2925
+ const mutationKey = ["verifyPasskey"];
2926
+ const { mutation: mutationOptions } = options
2927
+ ? options.mutation &&
2928
+ "mutationKey" in options.mutation &&
2929
+ options.mutation.mutationKey
2930
+ ? options
2931
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
2932
+ : { mutation: { mutationKey } };
2933
+
2934
+ const verifyPasskey = useVerifyPasskeyHook();
2935
+
2936
+ const mutationFn: MutationFunction<
2937
+ Awaited<ReturnType<ReturnType<typeof useVerifyPasskeyHook>>>,
2938
+ { data: BodyType<VerifyPasskeyRequest> }
2939
+ > = (props) => {
2940
+ const { data } = props ?? {};
2941
+
2942
+ return verifyPasskey(data);
2943
+ };
2944
+
2945
+ return { mutationFn, ...mutationOptions };
2946
+ };
2947
+
2948
+ export type VerifyPasskeyMutationResult = NonNullable<
2949
+ Awaited<ReturnType<ReturnType<typeof useVerifyPasskeyHook>>>
2950
+ >;
2951
+ export type VerifyPasskeyMutationBody = BodyType<VerifyPasskeyRequest>;
2952
+ export type VerifyPasskeyMutationError = ErrorType<
2953
+ VerifyPasskey400 | VerifyPasskey403
2954
+ >;
2955
+
2956
+ export const useVerifyPasskey = <
2957
+ TError = ErrorType<VerifyPasskey400 | VerifyPasskey403>,
2958
+ TContext = unknown,
2959
+ >(options?: {
2960
+ mutation?: UseMutationOptions<
2961
+ Awaited<ReturnType<ReturnType<typeof useVerifyPasskeyHook>>>,
2962
+ TError,
2963
+ { data: BodyType<VerifyPasskeyRequest> },
2964
+ TContext
2965
+ >;
2966
+ }): UseMutationResult<
2967
+ Awaited<ReturnType<ReturnType<typeof useVerifyPasskeyHook>>>,
2968
+ TError,
2969
+ { data: BodyType<VerifyPasskeyRequest> },
2970
+ TContext
2971
+ > => {
2972
+ const mutationOptions = useVerifyPasskeyMutationOptions(options);
2973
+
2974
+ return useMutation(mutationOptions);
2975
+ };
2976
+
2977
+ export const useDeletePasskeyHook = () => {
2978
+ const deletePasskey = useWidgetsApiClient<DeletePasskey200>();
2979
+
2980
+ return useCallback(
2981
+ (passkeyId: string) => {
2982
+ return deletePasskey({
2983
+ url: `/_widgets/UserProfile/passkeys/${passkeyId}`,
2984
+ method: "DELETE",
2985
+ });
2986
+ },
2987
+ [deletePasskey],
2988
+ );
2989
+ };
2990
+
2991
+ export const useDeletePasskeyMutationOptions = <
2992
+ TError = ErrorType<DeletePasskey400 | DeletePasskey403>,
2993
+ TContext = unknown,
2994
+ >(options?: {
2995
+ mutation?: UseMutationOptions<
2996
+ Awaited<ReturnType<ReturnType<typeof useDeletePasskeyHook>>>,
2997
+ TError,
2998
+ { passkeyId: string },
2999
+ TContext
3000
+ >;
3001
+ }): UseMutationOptions<
3002
+ Awaited<ReturnType<ReturnType<typeof useDeletePasskeyHook>>>,
3003
+ TError,
3004
+ { passkeyId: string },
3005
+ TContext
3006
+ > => {
3007
+ const mutationKey = ["deletePasskey"];
3008
+ const { mutation: mutationOptions } = options
3009
+ ? options.mutation &&
3010
+ "mutationKey" in options.mutation &&
3011
+ options.mutation.mutationKey
3012
+ ? options
3013
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
3014
+ : { mutation: { mutationKey } };
3015
+
3016
+ const deletePasskey = useDeletePasskeyHook();
3017
+
3018
+ const mutationFn: MutationFunction<
3019
+ Awaited<ReturnType<ReturnType<typeof useDeletePasskeyHook>>>,
3020
+ { passkeyId: string }
3021
+ > = (props) => {
3022
+ const { passkeyId } = props ?? {};
3023
+
3024
+ return deletePasskey(passkeyId);
3025
+ };
3026
+
3027
+ return { mutationFn, ...mutationOptions };
3028
+ };
3029
+
3030
+ export type DeletePasskeyMutationResult = NonNullable<
3031
+ Awaited<ReturnType<ReturnType<typeof useDeletePasskeyHook>>>
3032
+ >;
3033
+
3034
+ export type DeletePasskeyMutationError = ErrorType<
3035
+ DeletePasskey400 | DeletePasskey403
3036
+ >;
3037
+
3038
+ export const useDeletePasskey = <
3039
+ TError = ErrorType<DeletePasskey400 | DeletePasskey403>,
3040
+ TContext = unknown,
3041
+ >(options?: {
3042
+ mutation?: UseMutationOptions<
3043
+ Awaited<ReturnType<ReturnType<typeof useDeletePasskeyHook>>>,
3044
+ TError,
3045
+ { passkeyId: string },
3046
+ TContext
3047
+ >;
3048
+ }): UseMutationResult<
3049
+ Awaited<ReturnType<ReturnType<typeof useDeletePasskeyHook>>>,
3050
+ TError,
3051
+ { passkeyId: string },
3052
+ TContext
3053
+ > => {
3054
+ const mutationOptions = useDeletePasskeyMutationOptions(options);
3055
+
3056
+ return useMutation(mutationOptions);
3057
+ };