@contember/react-client-tenant 2.0.0-alpha.9 → 2.0.0-beta.2

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 (401) hide show
  1. package/dist/development/index.cjs +24 -0
  2. package/dist/development/index.cjs.map +1 -1
  3. package/dist/development/index.js +24 -0
  4. package/dist/development/index.js.map +1 -1
  5. package/dist/development/src/components/IdentityProvider.cjs.map +1 -1
  6. package/dist/development/src/components/IdentityProvider.js.map +1 -1
  7. package/dist/development/src/components/IdentityState.cjs.map +1 -1
  8. package/dist/development/src/components/IdentityState.js.map +1 -1
  9. package/dist/development/src/components/forms/ChangeMyPasswordForm.cjs.map +1 -1
  10. package/dist/development/src/components/forms/ChangeMyPasswordForm.js.map +1 -1
  11. package/dist/development/src/components/forms/CreateApiKeyForm.cjs.map +1 -1
  12. package/dist/development/src/components/forms/CreateApiKeyForm.js.map +1 -1
  13. package/dist/development/src/components/forms/CreateSessionTokenForm.cjs.map +1 -1
  14. package/dist/development/src/components/forms/CreateSessionTokenForm.js.map +1 -1
  15. package/dist/development/src/components/forms/InviteForm.cjs.map +1 -1
  16. package/dist/development/src/components/forms/InviteForm.js.map +1 -1
  17. package/dist/development/src/components/forms/LoginForm.cjs +1 -1
  18. package/dist/development/src/components/forms/LoginForm.cjs.map +1 -1
  19. package/dist/development/src/components/forms/LoginForm.js +1 -1
  20. package/dist/development/src/components/forms/LoginForm.js.map +1 -1
  21. package/dist/development/src/components/forms/OtpConfirmForm.cjs.map +1 -1
  22. package/dist/development/src/components/forms/OtpConfirmForm.js.map +1 -1
  23. package/dist/development/src/components/forms/OtpPrepareForm.cjs.map +1 -1
  24. package/dist/development/src/components/forms/OtpPrepareForm.js.map +1 -1
  25. package/dist/development/src/components/forms/PasswordResetForm.cjs +2 -1
  26. package/dist/development/src/components/forms/PasswordResetForm.cjs.map +1 -1
  27. package/dist/development/src/components/forms/PasswordResetForm.js +2 -1
  28. package/dist/development/src/components/forms/PasswordResetForm.js.map +1 -1
  29. package/dist/development/src/components/forms/PasswordResetRequestForm.cjs.map +1 -1
  30. package/dist/development/src/components/forms/PasswordResetRequestForm.js.map +1 -1
  31. package/dist/development/src/components/forms/PasswordlessSignInForm.cjs +79 -0
  32. package/dist/development/src/components/forms/PasswordlessSignInForm.cjs.map +1 -0
  33. package/dist/development/src/components/forms/PasswordlessSignInForm.js +79 -0
  34. package/dist/development/src/components/forms/PasswordlessSignInForm.js.map +1 -0
  35. package/dist/development/src/components/forms/PasswordlessSignInInitForm.cjs +54 -0
  36. package/dist/development/src/components/forms/PasswordlessSignInInitForm.cjs.map +1 -0
  37. package/dist/development/src/components/forms/PasswordlessSignInInitForm.js +54 -0
  38. package/dist/development/src/components/forms/PasswordlessSignInInitForm.js.map +1 -0
  39. package/dist/development/src/components/forms/TenantForm.cjs.map +1 -1
  40. package/dist/development/src/components/forms/TenantForm.js.map +1 -1
  41. package/dist/development/src/components/forms/UpdateProjectMemberForm.cjs.map +1 -1
  42. package/dist/development/src/components/forms/UpdateProjectMemberForm.js.map +1 -1
  43. package/dist/development/src/components/idp/IDP.cjs.map +1 -1
  44. package/dist/development/src/components/idp/IDP.js.map +1 -1
  45. package/dist/development/src/components/idp/IDPInitTrigger.cjs.map +1 -1
  46. package/dist/development/src/components/idp/IDPInitTrigger.js.map +1 -1
  47. package/dist/development/src/components/idp/IDPState.cjs.map +1 -1
  48. package/dist/development/src/components/idp/IDPState.js.map +1 -1
  49. package/dist/development/src/components/triggers/DisableOtpTrigger.cjs.map +1 -1
  50. package/dist/development/src/components/triggers/DisableOtpTrigger.js.map +1 -1
  51. package/dist/development/src/components/triggers/LogoutTrigger.cjs.map +1 -1
  52. package/dist/development/src/components/triggers/LogoutTrigger.js.map +1 -1
  53. package/dist/development/src/components/triggers/RemoveProjectMemberTrigger.cjs.map +1 -1
  54. package/dist/development/src/components/triggers/RemoveProjectMemberTrigger.js.map +1 -1
  55. package/dist/development/src/components/triggers/TenantActionTrigger.cjs.map +1 -1
  56. package/dist/development/src/components/triggers/TenantActionTrigger.js.map +1 -1
  57. package/dist/development/src/consts.cjs +5 -0
  58. package/dist/development/src/consts.cjs.map +1 -0
  59. package/dist/development/src/consts.js +5 -0
  60. package/dist/development/src/consts.js.map +1 -0
  61. package/dist/development/src/contexts.cjs.map +1 -1
  62. package/dist/development/src/hooks/mutations/apiKey/useCreateSessionTokenMutation.cjs +1 -1
  63. package/dist/development/src/hooks/mutations/apiKey/useCreateSessionTokenMutation.cjs.map +1 -1
  64. package/dist/development/src/hooks/mutations/apiKey/useCreateSessionTokenMutation.js +1 -1
  65. package/dist/development/src/hooks/mutations/apiKey/useCreateSessionTokenMutation.js.map +1 -1
  66. package/dist/development/src/hooks/mutations/auth/useSignInMutation.cjs +1 -1
  67. package/dist/development/src/hooks/mutations/auth/useSignInMutation.cjs.map +1 -1
  68. package/dist/development/src/hooks/mutations/auth/useSignInMutation.js +1 -1
  69. package/dist/development/src/hooks/mutations/auth/useSignInMutation.js.map +1 -1
  70. package/dist/development/src/hooks/mutations/idp/useInitSignInIDPMutation.cjs +1 -1
  71. package/dist/development/src/hooks/mutations/idp/useInitSignInIDPMutation.cjs.map +1 -1
  72. package/dist/development/src/hooks/mutations/idp/useInitSignInIDPMutation.js +1 -1
  73. package/dist/development/src/hooks/mutations/idp/useInitSignInIDPMutation.js.map +1 -1
  74. package/dist/development/src/hooks/mutations/idp/useSignInIdpMutation.cjs +1 -1
  75. package/dist/development/src/hooks/mutations/idp/useSignInIdpMutation.cjs.map +1 -1
  76. package/dist/development/src/hooks/mutations/idp/useSignInIdpMutation.js +1 -1
  77. package/dist/development/src/hooks/mutations/idp/useSignInIdpMutation.js.map +1 -1
  78. package/dist/development/src/hooks/mutations/invite/useInviteMutation.cjs +1 -1
  79. package/dist/development/src/hooks/mutations/invite/useInviteMutation.cjs.map +1 -1
  80. package/dist/development/src/hooks/mutations/invite/useInviteMutation.js +1 -1
  81. package/dist/development/src/hooks/mutations/invite/useInviteMutation.js.map +1 -1
  82. package/dist/development/src/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.cjs.map +1 -1
  83. package/dist/development/src/hooks/mutations/passwordReset/useResetPasswordMutation.cjs.map +1 -1
  84. package/dist/development/src/hooks/mutations/passwordless/useActivatePasswordlessOtpMutation.cjs +31 -0
  85. package/dist/development/src/hooks/mutations/passwordless/useActivatePasswordlessOtpMutation.cjs.map +1 -0
  86. package/dist/development/src/hooks/mutations/passwordless/useActivatePasswordlessOtpMutation.js +14 -0
  87. package/dist/development/src/hooks/mutations/passwordless/useActivatePasswordlessOtpMutation.js.map +1 -0
  88. package/dist/development/src/hooks/mutations/passwordless/useDisableMyPasswordlessMutation.cjs +28 -0
  89. package/dist/development/src/hooks/mutations/passwordless/useDisableMyPasswordlessMutation.cjs.map +1 -0
  90. package/dist/development/src/hooks/mutations/passwordless/useDisableMyPasswordlessMutation.js +11 -0
  91. package/dist/development/src/hooks/mutations/passwordless/useDisableMyPasswordlessMutation.js.map +1 -0
  92. package/dist/development/src/hooks/mutations/passwordless/useEnableMyPasswordlessMutation.cjs +28 -0
  93. package/dist/development/src/hooks/mutations/passwordless/useEnableMyPasswordlessMutation.cjs.map +1 -0
  94. package/dist/development/src/hooks/mutations/passwordless/useEnableMyPasswordlessMutation.js +11 -0
  95. package/dist/development/src/hooks/mutations/passwordless/useEnableMyPasswordlessMutation.js.map +1 -0
  96. package/dist/development/src/hooks/mutations/passwordless/useInitSignInPasswordlessMutation.cjs +32 -0
  97. package/dist/development/src/hooks/mutations/passwordless/useInitSignInPasswordlessMutation.cjs.map +1 -0
  98. package/dist/development/src/hooks/mutations/passwordless/useInitSignInPasswordlessMutation.js +15 -0
  99. package/dist/development/src/hooks/mutations/passwordless/useInitSignInPasswordlessMutation.js.map +1 -0
  100. package/dist/development/src/hooks/mutations/passwordless/useSignInPasswordlessMutation.cjs +32 -0
  101. package/dist/development/src/hooks/mutations/passwordless/useSignInPasswordlessMutation.cjs.map +1 -0
  102. package/dist/development/src/hooks/mutations/passwordless/useSignInPasswordlessMutation.js +15 -0
  103. package/dist/development/src/hooks/mutations/passwordless/useSignInPasswordlessMutation.js.map +1 -0
  104. package/dist/development/src/hooks/mutations/profile/useChangeMyProfile.cjs +29 -0
  105. package/dist/development/src/hooks/mutations/profile/useChangeMyProfile.cjs.map +1 -0
  106. package/dist/development/src/hooks/mutations/profile/useChangeMyProfile.js +12 -0
  107. package/dist/development/src/hooks/mutations/profile/useChangeMyProfile.js.map +1 -0
  108. package/dist/development/src/hooks/mutations/profile/useChangeProfile.cjs +29 -0
  109. package/dist/development/src/hooks/mutations/profile/useChangeProfile.cjs.map +1 -0
  110. package/dist/development/src/hooks/mutations/profile/useChangeProfile.js +12 -0
  111. package/dist/development/src/hooks/mutations/profile/useChangeProfile.js.map +1 -0
  112. package/dist/development/src/hooks/queries/useMeQuery.cjs +1 -1
  113. package/dist/development/src/hooks/queries/useMeQuery.cjs.map +1 -1
  114. package/dist/development/src/hooks/queries/useMeQuery.js +1 -1
  115. package/dist/development/src/hooks/queries/useMeQuery.js.map +1 -1
  116. package/dist/development/src/hooks/queries/useProjectMembersQuery.cjs +1 -1
  117. package/dist/development/src/hooks/queries/useProjectMembersQuery.cjs.map +1 -1
  118. package/dist/development/src/hooks/queries/useProjectMembersQuery.js +1 -1
  119. package/dist/development/src/hooks/queries/useProjectMembersQuery.js.map +1 -1
  120. package/dist/development/src/hooks/queries/useProjectMembershipsQuery.cjs.map +1 -1
  121. package/dist/development/src/hooks/queries/useProjectMembershipsQuery.js.map +1 -1
  122. package/dist/development/src/hooks/queries/useProjectRolesDefinitionQuery.cjs.map +1 -1
  123. package/dist/development/src/hooks/queries/useProjectRolesDefinitionQuery.js.map +1 -1
  124. package/dist/development/src/hooks/useFetchIdentity.cjs +2 -2
  125. package/dist/development/src/hooks/useFetchIdentity.cjs.map +1 -1
  126. package/dist/development/src/hooks/useFetchIdentity.js +3 -3
  127. package/dist/development/src/hooks/useFetchIdentity.js.map +1 -1
  128. package/dist/development/src/hooks/useLogout.cjs.map +1 -1
  129. package/dist/development/src/hooks/useLogout.js.map +1 -1
  130. package/dist/development/src/hooks/usePasswordlessOtpActivator.cjs +53 -0
  131. package/dist/development/src/hooks/usePasswordlessOtpActivator.cjs.map +1 -0
  132. package/dist/development/src/hooks/usePasswordlessOtpActivator.js +53 -0
  133. package/dist/development/src/hooks/usePasswordlessOtpActivator.js.map +1 -0
  134. package/dist/development/src/hooks/useTenantApi.cjs.map +1 -1
  135. package/dist/development/src/hooks/useTenantApi.js.map +1 -1
  136. package/dist/development/src/hooks/useTenantMutation.cjs.map +1 -1
  137. package/dist/development/src/hooks/useTenantMutation.js.map +1 -1
  138. package/dist/development/src/hooks/useTenantQueryLoader.cjs.map +1 -1
  139. package/dist/development/src/hooks/useTenantQueryLoader.js.map +1 -1
  140. package/dist/development/src/internal/hooks/useHandleIDPResponse.cjs +1 -1
  141. package/dist/development/src/internal/hooks/useHandleIDPResponse.cjs.map +1 -1
  142. package/dist/development/src/internal/hooks/useHandleIDPResponse.js +1 -1
  143. package/dist/development/src/internal/hooks/useHandleIDPResponse.js.map +1 -1
  144. package/dist/development/src/internal/hooks/useIDPAutoInit.cjs.map +1 -1
  145. package/dist/development/src/internal/hooks/useIDPAutoInit.js.map +1 -1
  146. package/dist/development/src/internal/hooks/useIDPStateStore.cjs.map +1 -1
  147. package/dist/development/src/internal/hooks/useIDPStateStore.js.map +1 -1
  148. package/dist/development/src/internal/hooks/useInitIDPRedirect.cjs.map +1 -1
  149. package/dist/development/src/internal/hooks/useInitIDPRedirect.js.map +1 -1
  150. package/dist/development/src/internal/hooks/useLogoutInternal.cjs.map +1 -1
  151. package/dist/development/src/internal/hooks/useLogoutInternal.js.map +1 -1
  152. package/dist/development/src/internal/hooks/useRedirectToBacklink.cjs.map +1 -1
  153. package/dist/development/src/internal/hooks/useRedirectToBacklink.js.map +1 -1
  154. package/dist/development/src/internal/utils/hashing.cjs +8 -0
  155. package/dist/development/src/internal/utils/hashing.cjs.map +1 -0
  156. package/dist/development/src/internal/utils/hashing.js +8 -0
  157. package/dist/development/src/internal/utils/hashing.js.map +1 -0
  158. package/dist/development/src/internal/utils/randomInt.cjs +29 -0
  159. package/dist/development/src/internal/utils/randomInt.cjs.map +1 -0
  160. package/dist/development/src/internal/utils/randomInt.js +29 -0
  161. package/dist/development/src/internal/utils/randomInt.js.map +1 -0
  162. package/dist/production/index.cjs +24 -0
  163. package/dist/production/index.cjs.map +1 -1
  164. package/dist/production/index.js +24 -0
  165. package/dist/production/index.js.map +1 -1
  166. package/dist/production/src/components/IdentityProvider.cjs.map +1 -1
  167. package/dist/production/src/components/IdentityProvider.js.map +1 -1
  168. package/dist/production/src/components/IdentityState.cjs.map +1 -1
  169. package/dist/production/src/components/IdentityState.js.map +1 -1
  170. package/dist/production/src/components/forms/ChangeMyPasswordForm.cjs.map +1 -1
  171. package/dist/production/src/components/forms/ChangeMyPasswordForm.js.map +1 -1
  172. package/dist/production/src/components/forms/CreateApiKeyForm.cjs.map +1 -1
  173. package/dist/production/src/components/forms/CreateApiKeyForm.js.map +1 -1
  174. package/dist/production/src/components/forms/CreateSessionTokenForm.cjs.map +1 -1
  175. package/dist/production/src/components/forms/CreateSessionTokenForm.js.map +1 -1
  176. package/dist/production/src/components/forms/InviteForm.cjs.map +1 -1
  177. package/dist/production/src/components/forms/InviteForm.js.map +1 -1
  178. package/dist/production/src/components/forms/LoginForm.cjs +1 -1
  179. package/dist/production/src/components/forms/LoginForm.cjs.map +1 -1
  180. package/dist/production/src/components/forms/LoginForm.js +1 -1
  181. package/dist/production/src/components/forms/LoginForm.js.map +1 -1
  182. package/dist/production/src/components/forms/OtpConfirmForm.cjs.map +1 -1
  183. package/dist/production/src/components/forms/OtpConfirmForm.js.map +1 -1
  184. package/dist/production/src/components/forms/OtpPrepareForm.cjs.map +1 -1
  185. package/dist/production/src/components/forms/OtpPrepareForm.js.map +1 -1
  186. package/dist/production/src/components/forms/PasswordResetForm.cjs +2 -1
  187. package/dist/production/src/components/forms/PasswordResetForm.cjs.map +1 -1
  188. package/dist/production/src/components/forms/PasswordResetForm.js +2 -1
  189. package/dist/production/src/components/forms/PasswordResetForm.js.map +1 -1
  190. package/dist/production/src/components/forms/PasswordResetRequestForm.cjs.map +1 -1
  191. package/dist/production/src/components/forms/PasswordResetRequestForm.js.map +1 -1
  192. package/dist/production/src/components/forms/PasswordlessSignInForm.cjs +71 -0
  193. package/dist/production/src/components/forms/PasswordlessSignInForm.cjs.map +1 -0
  194. package/dist/production/src/components/forms/PasswordlessSignInForm.js +71 -0
  195. package/dist/production/src/components/forms/PasswordlessSignInForm.js.map +1 -0
  196. package/dist/production/src/components/forms/PasswordlessSignInInitForm.cjs +46 -0
  197. package/dist/production/src/components/forms/PasswordlessSignInInitForm.cjs.map +1 -0
  198. package/dist/production/src/components/forms/PasswordlessSignInInitForm.js +46 -0
  199. package/dist/production/src/components/forms/PasswordlessSignInInitForm.js.map +1 -0
  200. package/dist/production/src/components/forms/TenantForm.cjs.map +1 -1
  201. package/dist/production/src/components/forms/TenantForm.js.map +1 -1
  202. package/dist/production/src/components/forms/UpdateProjectMemberForm.cjs.map +1 -1
  203. package/dist/production/src/components/forms/UpdateProjectMemberForm.js.map +1 -1
  204. package/dist/production/src/components/idp/IDP.cjs.map +1 -1
  205. package/dist/production/src/components/idp/IDP.js.map +1 -1
  206. package/dist/production/src/components/idp/IDPInitTrigger.cjs.map +1 -1
  207. package/dist/production/src/components/idp/IDPInitTrigger.js.map +1 -1
  208. package/dist/production/src/components/idp/IDPState.cjs.map +1 -1
  209. package/dist/production/src/components/idp/IDPState.js.map +1 -1
  210. package/dist/production/src/components/triggers/DisableOtpTrigger.cjs.map +1 -1
  211. package/dist/production/src/components/triggers/DisableOtpTrigger.js.map +1 -1
  212. package/dist/production/src/components/triggers/LogoutTrigger.cjs.map +1 -1
  213. package/dist/production/src/components/triggers/LogoutTrigger.js.map +1 -1
  214. package/dist/production/src/components/triggers/RemoveProjectMemberTrigger.cjs.map +1 -1
  215. package/dist/production/src/components/triggers/RemoveProjectMemberTrigger.js.map +1 -1
  216. package/dist/production/src/components/triggers/TenantActionTrigger.cjs.map +1 -1
  217. package/dist/production/src/components/triggers/TenantActionTrigger.js.map +1 -1
  218. package/dist/production/src/consts.cjs +5 -0
  219. package/dist/production/src/consts.cjs.map +1 -0
  220. package/dist/production/src/consts.js +5 -0
  221. package/dist/production/src/consts.js.map +1 -0
  222. package/dist/production/src/contexts.cjs.map +1 -1
  223. package/dist/production/src/hooks/mutations/apiKey/useCreateSessionTokenMutation.cjs +1 -1
  224. package/dist/production/src/hooks/mutations/apiKey/useCreateSessionTokenMutation.cjs.map +1 -1
  225. package/dist/production/src/hooks/mutations/apiKey/useCreateSessionTokenMutation.js +1 -1
  226. package/dist/production/src/hooks/mutations/apiKey/useCreateSessionTokenMutation.js.map +1 -1
  227. package/dist/production/src/hooks/mutations/auth/useSignInMutation.cjs +1 -1
  228. package/dist/production/src/hooks/mutations/auth/useSignInMutation.cjs.map +1 -1
  229. package/dist/production/src/hooks/mutations/auth/useSignInMutation.js +1 -1
  230. package/dist/production/src/hooks/mutations/auth/useSignInMutation.js.map +1 -1
  231. package/dist/production/src/hooks/mutations/idp/useInitSignInIDPMutation.cjs +1 -1
  232. package/dist/production/src/hooks/mutations/idp/useInitSignInIDPMutation.cjs.map +1 -1
  233. package/dist/production/src/hooks/mutations/idp/useInitSignInIDPMutation.js +1 -1
  234. package/dist/production/src/hooks/mutations/idp/useInitSignInIDPMutation.js.map +1 -1
  235. package/dist/production/src/hooks/mutations/idp/useSignInIdpMutation.cjs +1 -1
  236. package/dist/production/src/hooks/mutations/idp/useSignInIdpMutation.cjs.map +1 -1
  237. package/dist/production/src/hooks/mutations/idp/useSignInIdpMutation.js +1 -1
  238. package/dist/production/src/hooks/mutations/idp/useSignInIdpMutation.js.map +1 -1
  239. package/dist/production/src/hooks/mutations/invite/useInviteMutation.cjs +1 -1
  240. package/dist/production/src/hooks/mutations/invite/useInviteMutation.cjs.map +1 -1
  241. package/dist/production/src/hooks/mutations/invite/useInviteMutation.js +1 -1
  242. package/dist/production/src/hooks/mutations/invite/useInviteMutation.js.map +1 -1
  243. package/dist/production/src/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.cjs.map +1 -1
  244. package/dist/production/src/hooks/mutations/passwordReset/useResetPasswordMutation.cjs.map +1 -1
  245. package/dist/production/src/hooks/mutations/passwordless/useActivatePasswordlessOtpMutation.cjs +31 -0
  246. package/dist/production/src/hooks/mutations/passwordless/useActivatePasswordlessOtpMutation.cjs.map +1 -0
  247. package/dist/production/src/hooks/mutations/passwordless/useActivatePasswordlessOtpMutation.js +14 -0
  248. package/dist/production/src/hooks/mutations/passwordless/useActivatePasswordlessOtpMutation.js.map +1 -0
  249. package/dist/production/src/hooks/mutations/passwordless/useDisableMyPasswordlessMutation.cjs +28 -0
  250. package/dist/production/src/hooks/mutations/passwordless/useDisableMyPasswordlessMutation.cjs.map +1 -0
  251. package/dist/production/src/hooks/mutations/passwordless/useDisableMyPasswordlessMutation.js +11 -0
  252. package/dist/production/src/hooks/mutations/passwordless/useDisableMyPasswordlessMutation.js.map +1 -0
  253. package/dist/production/src/hooks/mutations/passwordless/useEnableMyPasswordlessMutation.cjs +28 -0
  254. package/dist/production/src/hooks/mutations/passwordless/useEnableMyPasswordlessMutation.cjs.map +1 -0
  255. package/dist/production/src/hooks/mutations/passwordless/useEnableMyPasswordlessMutation.js +11 -0
  256. package/dist/production/src/hooks/mutations/passwordless/useEnableMyPasswordlessMutation.js.map +1 -0
  257. package/dist/production/src/hooks/mutations/passwordless/useInitSignInPasswordlessMutation.cjs +32 -0
  258. package/dist/production/src/hooks/mutations/passwordless/useInitSignInPasswordlessMutation.cjs.map +1 -0
  259. package/dist/production/src/hooks/mutations/passwordless/useInitSignInPasswordlessMutation.js +15 -0
  260. package/dist/production/src/hooks/mutations/passwordless/useInitSignInPasswordlessMutation.js.map +1 -0
  261. package/dist/production/src/hooks/mutations/passwordless/useSignInPasswordlessMutation.cjs +32 -0
  262. package/dist/production/src/hooks/mutations/passwordless/useSignInPasswordlessMutation.cjs.map +1 -0
  263. package/dist/production/src/hooks/mutations/passwordless/useSignInPasswordlessMutation.js +15 -0
  264. package/dist/production/src/hooks/mutations/passwordless/useSignInPasswordlessMutation.js.map +1 -0
  265. package/dist/production/src/hooks/mutations/profile/useChangeMyProfile.cjs +29 -0
  266. package/dist/production/src/hooks/mutations/profile/useChangeMyProfile.cjs.map +1 -0
  267. package/dist/production/src/hooks/mutations/profile/useChangeMyProfile.js +12 -0
  268. package/dist/production/src/hooks/mutations/profile/useChangeMyProfile.js.map +1 -0
  269. package/dist/production/src/hooks/mutations/profile/useChangeProfile.cjs +29 -0
  270. package/dist/production/src/hooks/mutations/profile/useChangeProfile.cjs.map +1 -0
  271. package/dist/production/src/hooks/mutations/profile/useChangeProfile.js +12 -0
  272. package/dist/production/src/hooks/mutations/profile/useChangeProfile.js.map +1 -0
  273. package/dist/production/src/hooks/queries/useMeQuery.cjs +1 -1
  274. package/dist/production/src/hooks/queries/useMeQuery.cjs.map +1 -1
  275. package/dist/production/src/hooks/queries/useMeQuery.js +1 -1
  276. package/dist/production/src/hooks/queries/useMeQuery.js.map +1 -1
  277. package/dist/production/src/hooks/queries/useProjectMembersQuery.cjs +1 -1
  278. package/dist/production/src/hooks/queries/useProjectMembersQuery.cjs.map +1 -1
  279. package/dist/production/src/hooks/queries/useProjectMembersQuery.js +1 -1
  280. package/dist/production/src/hooks/queries/useProjectMembersQuery.js.map +1 -1
  281. package/dist/production/src/hooks/queries/useProjectMembershipsQuery.cjs.map +1 -1
  282. package/dist/production/src/hooks/queries/useProjectMembershipsQuery.js.map +1 -1
  283. package/dist/production/src/hooks/queries/useProjectRolesDefinitionQuery.cjs.map +1 -1
  284. package/dist/production/src/hooks/queries/useProjectRolesDefinitionQuery.js.map +1 -1
  285. package/dist/production/src/hooks/useFetchIdentity.cjs +2 -2
  286. package/dist/production/src/hooks/useFetchIdentity.cjs.map +1 -1
  287. package/dist/production/src/hooks/useFetchIdentity.js +3 -3
  288. package/dist/production/src/hooks/useFetchIdentity.js.map +1 -1
  289. package/dist/production/src/hooks/useLogout.cjs.map +1 -1
  290. package/dist/production/src/hooks/useLogout.js.map +1 -1
  291. package/dist/production/src/hooks/usePasswordlessOtpActivator.cjs +53 -0
  292. package/dist/production/src/hooks/usePasswordlessOtpActivator.cjs.map +1 -0
  293. package/dist/production/src/hooks/usePasswordlessOtpActivator.js +53 -0
  294. package/dist/production/src/hooks/usePasswordlessOtpActivator.js.map +1 -0
  295. package/dist/production/src/hooks/useTenantApi.cjs.map +1 -1
  296. package/dist/production/src/hooks/useTenantApi.js.map +1 -1
  297. package/dist/production/src/hooks/useTenantMutation.cjs.map +1 -1
  298. package/dist/production/src/hooks/useTenantMutation.js.map +1 -1
  299. package/dist/production/src/hooks/useTenantQueryLoader.cjs.map +1 -1
  300. package/dist/production/src/hooks/useTenantQueryLoader.js.map +1 -1
  301. package/dist/production/src/internal/hooks/useHandleIDPResponse.cjs +1 -1
  302. package/dist/production/src/internal/hooks/useHandleIDPResponse.cjs.map +1 -1
  303. package/dist/production/src/internal/hooks/useHandleIDPResponse.js +1 -1
  304. package/dist/production/src/internal/hooks/useHandleIDPResponse.js.map +1 -1
  305. package/dist/production/src/internal/hooks/useIDPAutoInit.cjs.map +1 -1
  306. package/dist/production/src/internal/hooks/useIDPAutoInit.js.map +1 -1
  307. package/dist/production/src/internal/hooks/useIDPStateStore.cjs.map +1 -1
  308. package/dist/production/src/internal/hooks/useIDPStateStore.js.map +1 -1
  309. package/dist/production/src/internal/hooks/useInitIDPRedirect.cjs.map +1 -1
  310. package/dist/production/src/internal/hooks/useInitIDPRedirect.js.map +1 -1
  311. package/dist/production/src/internal/hooks/useLogoutInternal.cjs.map +1 -1
  312. package/dist/production/src/internal/hooks/useLogoutInternal.js.map +1 -1
  313. package/dist/production/src/internal/hooks/useRedirectToBacklink.cjs.map +1 -1
  314. package/dist/production/src/internal/hooks/useRedirectToBacklink.js.map +1 -1
  315. package/dist/production/src/internal/utils/hashing.cjs +8 -0
  316. package/dist/production/src/internal/utils/hashing.cjs.map +1 -0
  317. package/dist/production/src/internal/utils/hashing.js +8 -0
  318. package/dist/production/src/internal/utils/hashing.js.map +1 -0
  319. package/dist/production/src/internal/utils/randomInt.cjs +29 -0
  320. package/dist/production/src/internal/utils/randomInt.cjs.map +1 -0
  321. package/dist/production/src/internal/utils/randomInt.js +29 -0
  322. package/dist/production/src/internal/utils/randomInt.js.map +1 -0
  323. package/dist/types/components/forms/PasswordlessSignInForm.d.ts +22 -0
  324. package/dist/types/components/forms/PasswordlessSignInForm.d.ts.map +1 -0
  325. package/dist/types/components/forms/PasswordlessSignInInitForm.d.ts +20 -0
  326. package/dist/types/components/forms/PasswordlessSignInInitForm.d.ts.map +1 -0
  327. package/dist/types/components/forms/index.d.ts +2 -0
  328. package/dist/types/components/forms/index.d.ts.map +1 -1
  329. package/dist/types/consts.d.ts +2 -0
  330. package/dist/types/consts.d.ts.map +1 -0
  331. package/dist/types/hooks/index.d.ts +1 -0
  332. package/dist/types/hooks/index.d.ts.map +1 -1
  333. package/dist/types/hooks/mutations/apiKey/useCreateSessionTokenMutation.d.ts +0 -6
  334. package/dist/types/hooks/mutations/apiKey/useCreateSessionTokenMutation.d.ts.map +1 -1
  335. package/dist/types/hooks/mutations/auth/useSignInMutation.d.ts +0 -6
  336. package/dist/types/hooks/mutations/auth/useSignInMutation.d.ts.map +1 -1
  337. package/dist/types/hooks/mutations/idp/useSignInIdpMutation.d.ts +6 -6
  338. package/dist/types/hooks/mutations/idp/useSignInIdpMutation.d.ts.map +1 -1
  339. package/dist/types/hooks/mutations/index.d.ts +2 -0
  340. package/dist/types/hooks/mutations/index.d.ts.map +1 -1
  341. package/dist/types/hooks/mutations/invite/useInviteMutation.d.ts +0 -6
  342. package/dist/types/hooks/mutations/invite/useInviteMutation.d.ts.map +1 -1
  343. package/dist/types/hooks/mutations/passwordless/index.d.ts +6 -0
  344. package/dist/types/hooks/mutations/passwordless/index.d.ts.map +1 -0
  345. package/dist/types/hooks/mutations/passwordless/useActivatePasswordlessOtpMutation.d.ts +8 -0
  346. package/dist/types/hooks/mutations/passwordless/useActivatePasswordlessOtpMutation.d.ts.map +1 -0
  347. package/dist/types/hooks/mutations/passwordless/useDisableMyPasswordlessMutation.d.ts +3 -0
  348. package/dist/types/hooks/mutations/passwordless/useDisableMyPasswordlessMutation.d.ts.map +1 -0
  349. package/dist/types/hooks/mutations/passwordless/useEnableMyPasswordlessMutation.d.ts +3 -0
  350. package/dist/types/hooks/mutations/passwordless/useEnableMyPasswordlessMutation.d.ts.map +1 -0
  351. package/dist/types/hooks/mutations/passwordless/useInitSignInPasswordlessMutation.d.ts +19 -0
  352. package/dist/types/hooks/mutations/passwordless/useInitSignInPasswordlessMutation.d.ts.map +1 -0
  353. package/dist/types/hooks/mutations/passwordless/useSignInPasswordlessMutation.d.ts +34 -0
  354. package/dist/types/hooks/mutations/passwordless/useSignInPasswordlessMutation.d.ts.map +1 -0
  355. package/dist/types/hooks/mutations/profile/index.d.ts +3 -0
  356. package/dist/types/hooks/mutations/profile/index.d.ts.map +1 -0
  357. package/dist/types/hooks/mutations/profile/useChangeMyProfile.d.ts +21 -0
  358. package/dist/types/hooks/mutations/profile/useChangeMyProfile.d.ts.map +1 -0
  359. package/dist/types/hooks/mutations/profile/useChangeProfile.d.ts +23 -0
  360. package/dist/types/hooks/mutations/profile/useChangeProfile.d.ts.map +1 -0
  361. package/dist/types/hooks/usePasswordlessOtpActivator.d.ts +19 -0
  362. package/dist/types/hooks/usePasswordlessOtpActivator.d.ts.map +1 -0
  363. package/dist/types/hooks/useTenantMutation.d.ts.map +1 -1
  364. package/dist/types/internal/utils/hashing.d.ts +2 -0
  365. package/dist/types/internal/utils/hashing.d.ts.map +1 -0
  366. package/dist/types/internal/utils/randomInt.d.ts +3 -0
  367. package/dist/types/internal/utils/randomInt.d.ts.map +1 -0
  368. package/dist/types/tsconfig.tsbuildinfo +1 -1
  369. package/dist/types/types/Identity.d.ts +1 -0
  370. package/dist/types/types/Identity.d.ts.map +1 -1
  371. package/package.json +8 -7
  372. package/src/components/forms/LoginForm.tsx +1 -1
  373. package/src/components/forms/PasswordResetForm.tsx +1 -0
  374. package/src/components/forms/PasswordlessSignInForm.tsx +102 -0
  375. package/src/components/forms/PasswordlessSignInInitForm.tsx +68 -0
  376. package/src/components/forms/index.ts +2 -0
  377. package/src/consts.ts +1 -0
  378. package/src/hooks/index.ts +1 -0
  379. package/src/hooks/mutations/apiKey/useCreateSessionTokenMutation.tsx +1 -1
  380. package/src/hooks/mutations/auth/useSignInMutation.ts +1 -1
  381. package/src/hooks/mutations/idp/useInitSignInIDPMutation.ts +1 -1
  382. package/src/hooks/mutations/idp/useSignInIdpMutation.ts +1 -1
  383. package/src/hooks/mutations/index.ts +2 -0
  384. package/src/hooks/mutations/invite/useInviteMutation.tsx +1 -1
  385. package/src/hooks/mutations/passwordless/index.ts +5 -0
  386. package/src/hooks/mutations/passwordless/useActivatePasswordlessOtpMutation.ts +19 -0
  387. package/src/hooks/mutations/passwordless/useDisableMyPasswordlessMutation.ts +14 -0
  388. package/src/hooks/mutations/passwordless/useEnableMyPasswordlessMutation.ts +14 -0
  389. package/src/hooks/mutations/passwordless/useInitSignInPasswordlessMutation.ts +22 -0
  390. package/src/hooks/mutations/passwordless/useSignInPasswordlessMutation.ts +24 -0
  391. package/src/hooks/mutations/profile/index.ts +2 -0
  392. package/src/hooks/mutations/profile/useChangeMyProfile.ts +13 -0
  393. package/src/hooks/mutations/profile/useChangeProfile.ts +13 -0
  394. package/src/hooks/queries/useMeQuery.ts +1 -1
  395. package/src/hooks/queries/useProjectMembersQuery.ts +1 -1
  396. package/src/hooks/useFetchIdentity.ts +3 -3
  397. package/src/hooks/usePasswordlessOtpActivator.ts +66 -0
  398. package/src/internal/hooks/useHandleIDPResponse.ts +1 -1
  399. package/src/internal/utils/hashing.ts +4 -0
  400. package/src/internal/utils/randomInt.ts +30 -0
  401. package/src/types/Identity.ts +1 -0
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const TenantApi = require("@contember/graphql-client-tenant");
4
+ const useTenantApi = require("../../useTenantApi.cjs");
5
+ const useTenantMutation = require("../../useTenantMutation.cjs");
6
+ function _interopNamespaceDefault(e) {
7
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
8
+ if (e) {
9
+ for (const k in e) {
10
+ if (k !== "default") {
11
+ const d = Object.getOwnPropertyDescriptor(e, k);
12
+ Object.defineProperty(n, k, d.get ? d : {
13
+ enumerable: true,
14
+ get: () => e[k]
15
+ });
16
+ }
17
+ }
18
+ }
19
+ n.default = e;
20
+ return Object.freeze(n);
21
+ }
22
+ const TenantApi__namespace = /* @__PURE__ */ _interopNamespaceDefault(TenantApi);
23
+ const InitSignInPasswordlessMutationResult = TenantApi__namespace.initSignInPasswordlessResult$$;
24
+ const InitSignInPasswordlessMutation = TenantApi__namespace.mutation$.initSignInPasswordless(
25
+ TenantApi__namespace.initSignInPasswordlessResponse$$.error(TenantApi__namespace.initSignInPasswordlessError$$).result(InitSignInPasswordlessMutationResult),
26
+ (options) => options.alias("mutation")
27
+ );
28
+ const useInitSignInPasswordlessMutation = useTenantMutation.createTenantMutation(InitSignInPasswordlessMutation, {
29
+ apiToken: useTenantApi.LoginToken
30
+ });
31
+ exports.useInitSignInPasswordlessMutation = useInitSignInPasswordlessMutation;
32
+ //# sourceMappingURL=useInitSignInPasswordlessMutation.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useInitSignInPasswordlessMutation.cjs","sources":["../../../../../../../packages/react-client-tenant/src/hooks/mutations/passwordless/useInitSignInPasswordlessMutation.ts"],"sourcesContent":["import * as TenantApi from '@contember/graphql-client-tenant'\nimport { LoginToken } from '../../useTenantApi'\nimport { createTenantMutation } from '../../useTenantMutation'\nimport { ModelType } from 'graphql-ts-client-api'\n\nconst InitSignInPasswordlessMutationResult = TenantApi.initSignInPasswordlessResult$$\nexport type InitSignInPasswordlessMutationResult = ModelType<typeof InitSignInPasswordlessMutationResult>\nconst InitSignInPasswordlessMutation = TenantApi\n\t.mutation$\n\t.initSignInPasswordless(\n\t\tTenantApi\n\t\t\t.initSignInPasswordlessResponse$$\n\t\t\t.error(TenantApi.initSignInPasswordlessError$$)\n\t\t\t.result(InitSignInPasswordlessMutationResult),\n\t\toptions => options.alias('mutation'),\n\t)\n\nexport const useInitSignInPasswordlessMutation = createTenantMutation(InitSignInPasswordlessMutation, {\n\tapiToken: LoginToken,\n})\n\nexport type InitSignInPasswordlessMutationVariables = Parameters<ReturnType<typeof useInitSignInPasswordlessMutation>>[0]\n"],"names":["TenantApi","createTenantMutation","LoginToken"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM,uCAAuCA,qBAAU;AAEvD,MAAM,iCAAiCA,qBACrC,UACA;AAAA,EACAA,qBACE,iCACA,MAAMA,qBAAU,6BAA6B,EAC7C,OAAO,oCAAoC;AAAA,EAC7C,CAAA,YAAW,QAAQ,MAAM,UAAU;AACpC;AAEY,MAAA,oCAAoCC,uCAAqB,gCAAgC;AAAA,EACrG,UAAUC,aAAAA;AACX,CAAC;;"}
@@ -0,0 +1,15 @@
1
+ import * as TenantApi from "@contember/graphql-client-tenant";
2
+ import { LoginToken } from "../../useTenantApi.js";
3
+ import { createTenantMutation } from "../../useTenantMutation.js";
4
+ const InitSignInPasswordlessMutationResult = TenantApi.initSignInPasswordlessResult$$;
5
+ const InitSignInPasswordlessMutation = TenantApi.mutation$.initSignInPasswordless(
6
+ TenantApi.initSignInPasswordlessResponse$$.error(TenantApi.initSignInPasswordlessError$$).result(InitSignInPasswordlessMutationResult),
7
+ (options) => options.alias("mutation")
8
+ );
9
+ const useInitSignInPasswordlessMutation = createTenantMutation(InitSignInPasswordlessMutation, {
10
+ apiToken: LoginToken
11
+ });
12
+ export {
13
+ useInitSignInPasswordlessMutation
14
+ };
15
+ //# sourceMappingURL=useInitSignInPasswordlessMutation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useInitSignInPasswordlessMutation.js","sources":["../../../../../../../packages/react-client-tenant/src/hooks/mutations/passwordless/useInitSignInPasswordlessMutation.ts"],"sourcesContent":["import * as TenantApi from '@contember/graphql-client-tenant'\nimport { LoginToken } from '../../useTenantApi'\nimport { createTenantMutation } from '../../useTenantMutation'\nimport { ModelType } from 'graphql-ts-client-api'\n\nconst InitSignInPasswordlessMutationResult = TenantApi.initSignInPasswordlessResult$$\nexport type InitSignInPasswordlessMutationResult = ModelType<typeof InitSignInPasswordlessMutationResult>\nconst InitSignInPasswordlessMutation = TenantApi\n\t.mutation$\n\t.initSignInPasswordless(\n\t\tTenantApi\n\t\t\t.initSignInPasswordlessResponse$$\n\t\t\t.error(TenantApi.initSignInPasswordlessError$$)\n\t\t\t.result(InitSignInPasswordlessMutationResult),\n\t\toptions => options.alias('mutation'),\n\t)\n\nexport const useInitSignInPasswordlessMutation = createTenantMutation(InitSignInPasswordlessMutation, {\n\tapiToken: LoginToken,\n})\n\nexport type InitSignInPasswordlessMutationVariables = Parameters<ReturnType<typeof useInitSignInPasswordlessMutation>>[0]\n"],"names":[],"mappings":";;;AAKA,MAAM,uCAAuC,UAAU;AAEvD,MAAM,iCAAiC,UACrC,UACA;AAAA,EACA,UACE,iCACA,MAAM,UAAU,6BAA6B,EAC7C,OAAO,oCAAoC;AAAA,EAC7C,CAAA,YAAW,QAAQ,MAAM,UAAU;AACpC;AAEY,MAAA,oCAAoC,qBAAqB,gCAAgC;AAAA,EACrG,UAAU;AACX,CAAC;"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const TenantApi = require("@contember/graphql-client-tenant");
4
+ const useTenantApi = require("../../useTenantApi.cjs");
5
+ const useTenantMutation = require("../../useTenantMutation.cjs");
6
+ function _interopNamespaceDefault(e) {
7
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
8
+ if (e) {
9
+ for (const k in e) {
10
+ if (k !== "default") {
11
+ const d = Object.getOwnPropertyDescriptor(e, k);
12
+ Object.defineProperty(n, k, d.get ? d : {
13
+ enumerable: true,
14
+ get: () => e[k]
15
+ });
16
+ }
17
+ }
18
+ }
19
+ n.default = e;
20
+ return Object.freeze(n);
21
+ }
22
+ const TenantApi__namespace = /* @__PURE__ */ _interopNamespaceDefault(TenantApi);
23
+ const signInResultFragment = TenantApi__namespace.signInPasswordlessResult$$.person(TenantApi__namespace.person$.id.email.name);
24
+ const SignInPasswordlessMutation = TenantApi__namespace.mutation$.signInPasswordless(
25
+ TenantApi__namespace.signInPasswordlessResponse$$.error(TenantApi__namespace.signInPasswordlessError$$).result(signInResultFragment),
26
+ (options) => options.alias("mutation")
27
+ );
28
+ const useSignInPasswordlessMutation = useTenantMutation.createTenantMutation(SignInPasswordlessMutation, {
29
+ apiToken: useTenantApi.LoginToken
30
+ });
31
+ exports.useSignInPasswordlessMutation = useSignInPasswordlessMutation;
32
+ //# sourceMappingURL=useSignInPasswordlessMutation.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSignInPasswordlessMutation.cjs","sources":["../../../../../../../packages/react-client-tenant/src/hooks/mutations/passwordless/useSignInPasswordlessMutation.ts"],"sourcesContent":["import * as TenantApi from '@contember/graphql-client-tenant'\nimport { LoginToken } from '../../useTenantApi'\nimport { createTenantMutation } from '../../useTenantMutation'\nimport { ModelType } from 'graphql-ts-client-api'\n\nconst signInResultFragment = TenantApi.signInPasswordlessResult$$.person(TenantApi.person$.id.email.name)\n\nexport type SignInPasswordlessMutationResult = ModelType<typeof signInResultFragment>\n\nconst SignInPasswordlessMutation = TenantApi\n\t.mutation$\n\t.signInPasswordless(\n\t\tTenantApi\n\t\t\t.signInPasswordlessResponse$$\n\t\t\t.error(TenantApi.signInPasswordlessError$$)\n\t\t\t.result(signInResultFragment),\n\t\toptions => options.alias('mutation'),\n\t)\n\nexport const useSignInPasswordlessMutation = createTenantMutation(SignInPasswordlessMutation, {\n\tapiToken: LoginToken,\n})\n\nexport type SignInPasswordlessMutationVariables = Parameters<ReturnType<typeof useSignInPasswordlessMutation>>[0]\n"],"names":["TenantApi","createTenantMutation","LoginToken"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM,uBAAuBA,qBAAU,2BAA2B,OAAOA,qBAAU,QAAQ,GAAG,MAAM,IAAI;AAIxG,MAAM,6BAA6BA,qBACjC,UACA;AAAA,EACAA,qBACE,6BACA,MAAMA,qBAAU,yBAAyB,EACzC,OAAO,oBAAoB;AAAA,EAC7B,CAAA,YAAW,QAAQ,MAAM,UAAU;AACpC;AAEY,MAAA,gCAAgCC,uCAAqB,4BAA4B;AAAA,EAC7F,UAAUC,aAAAA;AACX,CAAC;;"}
@@ -0,0 +1,15 @@
1
+ import * as TenantApi from "@contember/graphql-client-tenant";
2
+ import { LoginToken } from "../../useTenantApi.js";
3
+ import { createTenantMutation } from "../../useTenantMutation.js";
4
+ const signInResultFragment = TenantApi.signInPasswordlessResult$$.person(TenantApi.person$.id.email.name);
5
+ const SignInPasswordlessMutation = TenantApi.mutation$.signInPasswordless(
6
+ TenantApi.signInPasswordlessResponse$$.error(TenantApi.signInPasswordlessError$$).result(signInResultFragment),
7
+ (options) => options.alias("mutation")
8
+ );
9
+ const useSignInPasswordlessMutation = createTenantMutation(SignInPasswordlessMutation, {
10
+ apiToken: LoginToken
11
+ });
12
+ export {
13
+ useSignInPasswordlessMutation
14
+ };
15
+ //# sourceMappingURL=useSignInPasswordlessMutation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSignInPasswordlessMutation.js","sources":["../../../../../../../packages/react-client-tenant/src/hooks/mutations/passwordless/useSignInPasswordlessMutation.ts"],"sourcesContent":["import * as TenantApi from '@contember/graphql-client-tenant'\nimport { LoginToken } from '../../useTenantApi'\nimport { createTenantMutation } from '../../useTenantMutation'\nimport { ModelType } from 'graphql-ts-client-api'\n\nconst signInResultFragment = TenantApi.signInPasswordlessResult$$.person(TenantApi.person$.id.email.name)\n\nexport type SignInPasswordlessMutationResult = ModelType<typeof signInResultFragment>\n\nconst SignInPasswordlessMutation = TenantApi\n\t.mutation$\n\t.signInPasswordless(\n\t\tTenantApi\n\t\t\t.signInPasswordlessResponse$$\n\t\t\t.error(TenantApi.signInPasswordlessError$$)\n\t\t\t.result(signInResultFragment),\n\t\toptions => options.alias('mutation'),\n\t)\n\nexport const useSignInPasswordlessMutation = createTenantMutation(SignInPasswordlessMutation, {\n\tapiToken: LoginToken,\n})\n\nexport type SignInPasswordlessMutationVariables = Parameters<ReturnType<typeof useSignInPasswordlessMutation>>[0]\n"],"names":[],"mappings":";;;AAKA,MAAM,uBAAuB,UAAU,2BAA2B,OAAO,UAAU,QAAQ,GAAG,MAAM,IAAI;AAIxG,MAAM,6BAA6B,UACjC,UACA;AAAA,EACA,UACE,6BACA,MAAM,UAAU,yBAAyB,EACzC,OAAO,oBAAoB;AAAA,EAC7B,CAAA,YAAW,QAAQ,MAAM,UAAU;AACpC;AAEY,MAAA,gCAAgC,qBAAqB,4BAA4B;AAAA,EAC7F,UAAU;AACX,CAAC;"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const TenantApi = require("@contember/graphql-client-tenant");
4
+ const useTenantMutation = require("../../useTenantMutation.cjs");
5
+ function _interopNamespaceDefault(e) {
6
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
7
+ if (e) {
8
+ for (const k in e) {
9
+ if (k !== "default") {
10
+ const d = Object.getOwnPropertyDescriptor(e, k);
11
+ Object.defineProperty(n, k, d.get ? d : {
12
+ enumerable: true,
13
+ get: () => e[k]
14
+ });
15
+ }
16
+ }
17
+ }
18
+ n.default = e;
19
+ return Object.freeze(n);
20
+ }
21
+ const TenantApi__namespace = /* @__PURE__ */ _interopNamespaceDefault(TenantApi);
22
+ const changeMyProfile = TenantApi__namespace.mutation$.changeMyProfile(
23
+ TenantApi__namespace.changeMyProfileResponse$$.error(TenantApi__namespace.changeMyProfileError$$),
24
+ (options) => options.alias("mutation")
25
+ );
26
+ const useChangeMyProfileMutation = useTenantMutation.createTenantMutation(changeMyProfile);
27
+ exports.changeMyProfile = changeMyProfile;
28
+ exports.useChangeMyProfileMutation = useChangeMyProfileMutation;
29
+ //# sourceMappingURL=useChangeMyProfile.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useChangeMyProfile.cjs","sources":["../../../../../../../packages/react-client-tenant/src/hooks/mutations/profile/useChangeMyProfile.ts"],"sourcesContent":["import * as TenantApi from '@contember/graphql-client-tenant'\nimport { createTenantMutation } from '../../useTenantMutation'\n\nexport const changeMyProfile = TenantApi.mutation$\n\t.changeMyProfile(\n\t\tTenantApi\n\t\t .changeMyProfileResponse$$\n\t\t .error(TenantApi.changeMyProfileError$$),\n\t\toptions => options.alias('mutation'),\n\t)\n\nexport const useChangeMyProfileMutation = createTenantMutation(changeMyProfile)\nexport type ChangeMyProfileMutationVariables = Parameters<ReturnType<typeof useChangeMyProfileMutation>>[0]\n"],"names":["TenantApi","createTenantMutation"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAGa,MAAA,kBAAkBA,qBAAU,UACvC;AAAA,EACAA,qBACG,0BACA,MAAMA,qBAAU,sBAAsB;AAAA,EACzC,CAAA,YAAW,QAAQ,MAAM,UAAU;AACpC;AAEY,MAAA,6BAA6BC,uCAAqB,eAAe;;;"}
@@ -0,0 +1,12 @@
1
+ import * as TenantApi from "@contember/graphql-client-tenant";
2
+ import { createTenantMutation } from "../../useTenantMutation.js";
3
+ const changeMyProfile = TenantApi.mutation$.changeMyProfile(
4
+ TenantApi.changeMyProfileResponse$$.error(TenantApi.changeMyProfileError$$),
5
+ (options) => options.alias("mutation")
6
+ );
7
+ const useChangeMyProfileMutation = createTenantMutation(changeMyProfile);
8
+ export {
9
+ changeMyProfile,
10
+ useChangeMyProfileMutation
11
+ };
12
+ //# sourceMappingURL=useChangeMyProfile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useChangeMyProfile.js","sources":["../../../../../../../packages/react-client-tenant/src/hooks/mutations/profile/useChangeMyProfile.ts"],"sourcesContent":["import * as TenantApi from '@contember/graphql-client-tenant'\nimport { createTenantMutation } from '../../useTenantMutation'\n\nexport const changeMyProfile = TenantApi.mutation$\n\t.changeMyProfile(\n\t\tTenantApi\n\t\t .changeMyProfileResponse$$\n\t\t .error(TenantApi.changeMyProfileError$$),\n\t\toptions => options.alias('mutation'),\n\t)\n\nexport const useChangeMyProfileMutation = createTenantMutation(changeMyProfile)\nexport type ChangeMyProfileMutationVariables = Parameters<ReturnType<typeof useChangeMyProfileMutation>>[0]\n"],"names":[],"mappings":";;AAGa,MAAA,kBAAkB,UAAU,UACvC;AAAA,EACA,UACG,0BACA,MAAM,UAAU,sBAAsB;AAAA,EACzC,CAAA,YAAW,QAAQ,MAAM,UAAU;AACpC;AAEY,MAAA,6BAA6B,qBAAqB,eAAe;"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const TenantApi = require("@contember/graphql-client-tenant");
4
+ const useTenantMutation = require("../../useTenantMutation.cjs");
5
+ function _interopNamespaceDefault(e) {
6
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
7
+ if (e) {
8
+ for (const k in e) {
9
+ if (k !== "default") {
10
+ const d = Object.getOwnPropertyDescriptor(e, k);
11
+ Object.defineProperty(n, k, d.get ? d : {
12
+ enumerable: true,
13
+ get: () => e[k]
14
+ });
15
+ }
16
+ }
17
+ }
18
+ n.default = e;
19
+ return Object.freeze(n);
20
+ }
21
+ const TenantApi__namespace = /* @__PURE__ */ _interopNamespaceDefault(TenantApi);
22
+ const changeProfile = TenantApi__namespace.mutation$.changeProfile(
23
+ TenantApi__namespace.changeProfileResponse$$.error(TenantApi__namespace.changeProfileError$$),
24
+ (options) => options.alias("mutation")
25
+ );
26
+ const useChangeProfileMutation = useTenantMutation.createTenantMutation(changeProfile);
27
+ exports.changeProfile = changeProfile;
28
+ exports.useChangeProfileMutation = useChangeProfileMutation;
29
+ //# sourceMappingURL=useChangeProfile.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useChangeProfile.cjs","sources":["../../../../../../../packages/react-client-tenant/src/hooks/mutations/profile/useChangeProfile.ts"],"sourcesContent":["import * as TenantApi from '@contember/graphql-client-tenant'\nimport { createTenantMutation } from '../../useTenantMutation'\n\nexport const changeProfile = TenantApi.mutation$\n\t.changeProfile(\n\t\tTenantApi\n\t\t .changeProfileResponse$$\n\t\t .error(TenantApi.changeProfileError$$),\n\t\toptions => options.alias('mutation'),\n\t)\n\nexport const useChangeProfileMutation = createTenantMutation(changeProfile)\nexport type ChangeProfileMutationVariables = Parameters<ReturnType<typeof useChangeProfileMutation>>[0]\n"],"names":["TenantApi","createTenantMutation"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAGa,MAAA,gBAAgBA,qBAAU,UACrC;AAAA,EACAA,qBACG,wBACA,MAAMA,qBAAU,oBAAoB;AAAA,EACvC,CAAA,YAAW,QAAQ,MAAM,UAAU;AACpC;AAEY,MAAA,2BAA2BC,uCAAqB,aAAa;;;"}
@@ -0,0 +1,12 @@
1
+ import * as TenantApi from "@contember/graphql-client-tenant";
2
+ import { createTenantMutation } from "../../useTenantMutation.js";
3
+ const changeProfile = TenantApi.mutation$.changeProfile(
4
+ TenantApi.changeProfileResponse$$.error(TenantApi.changeProfileError$$),
5
+ (options) => options.alias("mutation")
6
+ );
7
+ const useChangeProfileMutation = createTenantMutation(changeProfile);
8
+ export {
9
+ changeProfile,
10
+ useChangeProfileMutation
11
+ };
12
+ //# sourceMappingURL=useChangeProfile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useChangeProfile.js","sources":["../../../../../../../packages/react-client-tenant/src/hooks/mutations/profile/useChangeProfile.ts"],"sourcesContent":["import * as TenantApi from '@contember/graphql-client-tenant'\nimport { createTenantMutation } from '../../useTenantMutation'\n\nexport const changeProfile = TenantApi.mutation$\n\t.changeProfile(\n\t\tTenantApi\n\t\t .changeProfileResponse$$\n\t\t .error(TenantApi.changeProfileError$$),\n\t\toptions => options.alias('mutation'),\n\t)\n\nexport const useChangeProfileMutation = createTenantMutation(changeProfile)\nexport type ChangeProfileMutationVariables = Parameters<ReturnType<typeof useChangeProfileMutation>>[0]\n"],"names":[],"mappings":";;AAGa,MAAA,gBAAgB,UAAU,UACrC;AAAA,EACA,UACG,wBACA,MAAM,UAAU,oBAAoB;AAAA,EACvC,CAAA,YAAW,QAAQ,MAAM,UAAU;AACpC;AAEY,MAAA,2BAA2B,qBAAqB,aAAa;"}
@@ -20,7 +20,7 @@ function _interopNamespaceDefault(e) {
20
20
  return Object.freeze(n);
21
21
  }
22
22
  const TenantApi__namespace = /* @__PURE__ */ _interopNamespaceDefault(TenantApi);
23
- const identityFragment = TenantApi__namespace.identity$$.person(TenantApi__namespace.person$$).projects(
23
+ const identityFragment = TenantApi__namespace.identity$$.person(TenantApi__namespace.person$.id.email.name.otpEnabled).projects(
24
24
  TenantApi__namespace.identityProjectRelation$.project(TenantApi__namespace.project$$).memberships(TenantApi__namespace.membership$$.variables(TenantApi__namespace.variableEntry$$))
25
25
  ).permissions(TenantApi__namespace.identityGlobalPermissions$$);
26
26
  const useMeQuery = (options = {}) => {
@@ -1 +1 @@
1
- {"version":3,"file":"useMeQuery.cjs","sources":["../../../../../../packages/react-client-tenant/src/hooks/queries/useMeQuery.ts"],"sourcesContent":["import * as TenantApi from '@contember/graphql-client-tenant'\nimport { ModelType } from 'graphql-ts-client-api'\nimport { TenantApiOptions, useTenantApi } from '../useTenantApi'\nimport { useCallback } from 'react'\n\nconst identityFragment = TenantApi\n\t.identity$$\n\t.person(TenantApi.person$$)\n\t.projects(TenantApi\n\t\t.identityProjectRelation$\n\t\t.project(TenantApi.project$$)\n\t\t.memberships(TenantApi.membership$$.variables(TenantApi.variableEntry$$)),\n\t)\n\t.permissions(TenantApi.identityGlobalPermissions$$)\n\nexport type MeQueryData = ModelType<typeof identityFragment>\n\nexport const useMeQuery = (options: TenantApiOptions = {}) => {\n\tconst executor = useTenantApi(options)\n\treturn useCallback(async ({}: {}): Promise<MeQueryData> => {\n\t\treturn (await executor(TenantApi.query$.me(identityFragment))).me\n\t}, [executor])\n}\n"],"names":["TenantApi","useTenantApi","useCallback"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM,mBAAmBA,qBACvB,WACA,OAAOA,qBAAU,QAAQ,EACzB;AAAA,EAASA,qBACR,yBACA,QAAQA,qBAAU,SAAS,EAC3B,YAAYA,qBAAU,aAAa,UAAUA,qBAAU,eAAe,CAAC;AACzE,EACC,YAAYA,qBAAU,2BAA2B;AAI5C,MAAM,aAAa,CAAC,UAA4B,OAAO;AACvD,QAAA,WAAWC,0BAAa,OAAO;AAC9B,SAAAC,MAAAA,YAAY,OAAO,OAAiC;AAC1D,YAAQ,MAAM,SAASF,qBAAU,OAAO,GAAG,gBAAgB,CAAC,GAAG;AAAA,EAAA,GAC7D,CAAC,QAAQ,CAAC;AACd;;"}
1
+ {"version":3,"file":"useMeQuery.cjs","sources":["../../../../../../packages/react-client-tenant/src/hooks/queries/useMeQuery.ts"],"sourcesContent":["import * as TenantApi from '@contember/graphql-client-tenant'\nimport { ModelType } from 'graphql-ts-client-api'\nimport { TenantApiOptions, useTenantApi } from '../useTenantApi'\nimport { useCallback } from 'react'\n\nconst identityFragment = TenantApi\n\t.identity$$\n\t.person(TenantApi.person$.id.email.name.otpEnabled)\n\t.projects(TenantApi\n\t\t.identityProjectRelation$\n\t\t.project(TenantApi.project$$)\n\t\t.memberships(TenantApi.membership$$.variables(TenantApi.variableEntry$$)),\n\t)\n\t.permissions(TenantApi.identityGlobalPermissions$$)\n\nexport type MeQueryData = ModelType<typeof identityFragment>\n\nexport const useMeQuery = (options: TenantApiOptions = {}) => {\n\tconst executor = useTenantApi(options)\n\treturn useCallback(async ({}: {}): Promise<MeQueryData> => {\n\t\treturn (await executor(TenantApi.query$.me(identityFragment))).me\n\t}, [executor])\n}\n"],"names":["TenantApi","useTenantApi","useCallback"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM,mBAAmBA,qBACvB,WACA,OAAOA,qBAAU,QAAQ,GAAG,MAAM,KAAK,UAAU,EACjD;AAAA,EAASA,qBACR,yBACA,QAAQA,qBAAU,SAAS,EAC3B,YAAYA,qBAAU,aAAa,UAAUA,qBAAU,eAAe,CAAC;AACzE,EACC,YAAYA,qBAAU,2BAA2B;AAI5C,MAAM,aAAa,CAAC,UAA4B,OAAO;AACvD,QAAA,WAAWC,0BAAa,OAAO;AAC9B,SAAAC,MAAAA,YAAY,OAAO,OAAiC;AAC1D,YAAQ,MAAM,SAASF,qBAAU,OAAO,GAAG,gBAAgB,CAAC,GAAG;AAAA,EAAA,GAC7D,CAAC,QAAQ,CAAC;AACd;;"}
@@ -1,7 +1,7 @@
1
1
  import * as TenantApi from "@contember/graphql-client-tenant";
2
2
  import { useTenantApi } from "../useTenantApi.js";
3
3
  import { useCallback } from "react";
4
- const identityFragment = TenantApi.identity$$.person(TenantApi.person$$).projects(
4
+ const identityFragment = TenantApi.identity$$.person(TenantApi.person$.id.email.name.otpEnabled).projects(
5
5
  TenantApi.identityProjectRelation$.project(TenantApi.project$$).memberships(TenantApi.membership$$.variables(TenantApi.variableEntry$$))
6
6
  ).permissions(TenantApi.identityGlobalPermissions$$);
7
7
  const useMeQuery = (options = {}) => {
@@ -1 +1 @@
1
- {"version":3,"file":"useMeQuery.js","sources":["../../../../../../packages/react-client-tenant/src/hooks/queries/useMeQuery.ts"],"sourcesContent":["import * as TenantApi from '@contember/graphql-client-tenant'\nimport { ModelType } from 'graphql-ts-client-api'\nimport { TenantApiOptions, useTenantApi } from '../useTenantApi'\nimport { useCallback } from 'react'\n\nconst identityFragment = TenantApi\n\t.identity$$\n\t.person(TenantApi.person$$)\n\t.projects(TenantApi\n\t\t.identityProjectRelation$\n\t\t.project(TenantApi.project$$)\n\t\t.memberships(TenantApi.membership$$.variables(TenantApi.variableEntry$$)),\n\t)\n\t.permissions(TenantApi.identityGlobalPermissions$$)\n\nexport type MeQueryData = ModelType<typeof identityFragment>\n\nexport const useMeQuery = (options: TenantApiOptions = {}) => {\n\tconst executor = useTenantApi(options)\n\treturn useCallback(async ({}: {}): Promise<MeQueryData> => {\n\t\treturn (await executor(TenantApi.query$.me(identityFragment))).me\n\t}, [executor])\n}\n"],"names":[],"mappings":";;;AAKA,MAAM,mBAAmB,UACvB,WACA,OAAO,UAAU,QAAQ,EACzB;AAAA,EAAS,UACR,yBACA,QAAQ,UAAU,SAAS,EAC3B,YAAY,UAAU,aAAa,UAAU,UAAU,eAAe,CAAC;AACzE,EACC,YAAY,UAAU,2BAA2B;AAI5C,MAAM,aAAa,CAAC,UAA4B,OAAO;AACvD,QAAA,WAAW,aAAa,OAAO;AAC9B,SAAA,YAAY,OAAO,OAAiC;AAC1D,YAAQ,MAAM,SAAS,UAAU,OAAO,GAAG,gBAAgB,CAAC,GAAG;AAAA,EAAA,GAC7D,CAAC,QAAQ,CAAC;AACd;"}
1
+ {"version":3,"file":"useMeQuery.js","sources":["../../../../../../packages/react-client-tenant/src/hooks/queries/useMeQuery.ts"],"sourcesContent":["import * as TenantApi from '@contember/graphql-client-tenant'\nimport { ModelType } from 'graphql-ts-client-api'\nimport { TenantApiOptions, useTenantApi } from '../useTenantApi'\nimport { useCallback } from 'react'\n\nconst identityFragment = TenantApi\n\t.identity$$\n\t.person(TenantApi.person$.id.email.name.otpEnabled)\n\t.projects(TenantApi\n\t\t.identityProjectRelation$\n\t\t.project(TenantApi.project$$)\n\t\t.memberships(TenantApi.membership$$.variables(TenantApi.variableEntry$$)),\n\t)\n\t.permissions(TenantApi.identityGlobalPermissions$$)\n\nexport type MeQueryData = ModelType<typeof identityFragment>\n\nexport const useMeQuery = (options: TenantApiOptions = {}) => {\n\tconst executor = useTenantApi(options)\n\treturn useCallback(async ({}: {}): Promise<MeQueryData> => {\n\t\treturn (await executor(TenantApi.query$.me(identityFragment))).me\n\t}, [executor])\n}\n"],"names":[],"mappings":";;;AAKA,MAAM,mBAAmB,UACvB,WACA,OAAO,UAAU,QAAQ,GAAG,MAAM,KAAK,UAAU,EACjD;AAAA,EAAS,UACR,yBACA,QAAQ,UAAU,SAAS,EAC3B,YAAY,UAAU,aAAa,UAAU,UAAU,eAAe,CAAC;AACzE,EACC,YAAY,UAAU,2BAA2B;AAI5C,MAAM,aAAa,CAAC,UAA4B,OAAO;AACvD,QAAA,WAAW,aAAa,OAAO;AAC9B,SAAA,YAAY,OAAO,OAAiC;AAC1D,YAAQ,MAAM,SAAS,UAAU,OAAO,GAAG,gBAAgB,CAAC,GAAG;AAAA,EAAA,GAC7D,CAAC,QAAQ,CAAC;AACd;"}
@@ -22,7 +22,7 @@ function _interopNamespaceDefault(e) {
22
22
  }
23
23
  const TenantApi__namespace = /* @__PURE__ */ _interopNamespaceDefault(TenantApi);
24
24
  const projectIdentityRelationFragment = TenantApi__namespace.projectIdentityRelation$.identity(
25
- TenantApi__namespace.identity$$.person(TenantApi__namespace.person$$).apiKey(TenantApi__namespace.apiKey$$)
25
+ TenantApi__namespace.identity$$.person(TenantApi__namespace.person$.id.email.name.otpEnabled).apiKey(TenantApi__namespace.apiKey$$)
26
26
  ).memberships(TenantApi__namespace.membership$$.variables(TenantApi__namespace.variableEntry$$));
27
27
  const useProjectMembersQuery = ({ headers, apiToken } = {}) => {
28
28
  const executor = useTenantApi.useTenantApi({
@@ -1 +1 @@
1
- {"version":3,"file":"useProjectMembersQuery.cjs","sources":["../../../../../../packages/react-client-tenant/src/hooks/queries/useProjectMembersQuery.ts"],"sourcesContent":["import * as TenantApi from '@contember/graphql-client-tenant'\nimport { ModelType, ParameterRef } from 'graphql-ts-client-api'\nimport { TenantApiOptions, useTenantApi } from '../useTenantApi'\nimport { useCallback } from 'react'\n\nconst projectIdentityRelationFragment = TenantApi\n\t.projectIdentityRelation$\n\t.identity(TenantApi.identity$$\n\t\t.person(TenantApi.person$$)\n\t\t.apiKey(TenantApi.apiKey$$)\n\t\t,\n\t)\n\t.memberships(TenantApi.membership$$.variables(TenantApi.variableEntry$$))\n\nexport type ProjectMembersQueryResult = readonly ModelType<typeof projectIdentityRelationFragment>[]\n\nexport type ProjectMembersQueryVariables =\n\t& {\n\t\tprojectSlug: string\n\t}\n\t& TenantApi.ProjectMembersInput\n\n\nexport const useProjectMembersQuery = ({ headers, apiToken }: TenantApiOptions = {}) => {\n\tconst executor = useTenantApi({\n\t\theaders,\n\t\tapiToken,\n\t})\n\treturn useCallback(async ({ projectSlug, ...membersInput }: ProjectMembersQueryVariables): Promise<ProjectMembersQueryResult> => {\n\t\tconst result = await executor(TenantApi.query$.projectBySlug({\n\t\t\tslug: ParameterRef.of('projectSlug'),\n\t\t}, TenantApi.project$.members({\n\t\t\tinput: ParameterRef.of('membersInput'),\n\t\t}, projectIdentityRelationFragment)), {\n\t\t\tvariables: {\n\t\t\t\tprojectSlug,\n\t\t\t\tmembersInput,\n\t\t\t},\n\t\t})\n\n\t\treturn result.projectBySlug?.members ?? []\n\t}, [executor])\n}\n"],"names":["TenantApi","useTenantApi","useCallback","ParameterRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM,kCAAkCA,qBACtC,yBACA;AAAA,EAASA,qBAAU,WAClB,OAAOA,qBAAU,QAAQ,EACzB,OAAOA,qBAAU,QAAQ;AAE3B,EACC,YAAYA,qBAAU,aAAa,UAAUA,qBAAU,eAAe,CAAC;AAWlE,MAAM,yBAAyB,CAAC,EAAE,SAAS,SAAS,IAAsB,CAAA,MAAO;AACvF,QAAM,WAAWC,aAAAA,aAAa;AAAA,IAC7B;AAAA,IACA;AAAA,EAAA,CACA;AACD,SAAOC,kBAAY,OAAO,EAAE,aAAa,GAAG,mBAAqF;AAChI,UAAM,SAAS,MAAM,SAASF,qBAAU,OAAO,cAAc;AAAA,MAC5D,MAAMG,mBAAAA,aAAa,GAAG,aAAa;AAAA,IAAA,GACjCH,qBAAU,SAAS,QAAQ;AAAA,MAC7B,OAAOG,mBAAAA,aAAa,GAAG,cAAc;AAAA,IAAA,GACnC,+BAA+B,CAAC,GAAG;AAAA,MACrC,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,IAAA,CACA;AAEM,WAAA,OAAO,eAAe,WAAW;EAAC,GACvC,CAAC,QAAQ,CAAC;AACd;;"}
1
+ {"version":3,"file":"useProjectMembersQuery.cjs","sources":["../../../../../../packages/react-client-tenant/src/hooks/queries/useProjectMembersQuery.ts"],"sourcesContent":["import * as TenantApi from '@contember/graphql-client-tenant'\nimport { ModelType, ParameterRef } from 'graphql-ts-client-api'\nimport { TenantApiOptions, useTenantApi } from '../useTenantApi'\nimport { useCallback } from 'react'\n\nconst projectIdentityRelationFragment = TenantApi\n\t.projectIdentityRelation$\n\t.identity(TenantApi.identity$$\n\t\t.person(TenantApi.person$.id.email.name.otpEnabled)\n\t\t.apiKey(TenantApi.apiKey$$)\n\t\t,\n\t)\n\t.memberships(TenantApi.membership$$.variables(TenantApi.variableEntry$$))\n\nexport type ProjectMembersQueryResult = readonly ModelType<typeof projectIdentityRelationFragment>[]\n\nexport type ProjectMembersQueryVariables =\n\t& {\n\t\tprojectSlug: string\n\t}\n\t& TenantApi.ProjectMembersInput\n\n\nexport const useProjectMembersQuery = ({ headers, apiToken }: TenantApiOptions = {}) => {\n\tconst executor = useTenantApi({\n\t\theaders,\n\t\tapiToken,\n\t})\n\treturn useCallback(async ({ projectSlug, ...membersInput }: ProjectMembersQueryVariables): Promise<ProjectMembersQueryResult> => {\n\t\tconst result = await executor(TenantApi.query$.projectBySlug({\n\t\t\tslug: ParameterRef.of('projectSlug'),\n\t\t}, TenantApi.project$.members({\n\t\t\tinput: ParameterRef.of('membersInput'),\n\t\t}, projectIdentityRelationFragment)), {\n\t\t\tvariables: {\n\t\t\t\tprojectSlug,\n\t\t\t\tmembersInput,\n\t\t\t},\n\t\t})\n\n\t\treturn result.projectBySlug?.members ?? []\n\t}, [executor])\n}\n"],"names":["TenantApi","useTenantApi","useCallback","ParameterRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM,kCAAkCA,qBACtC,yBACA;AAAA,EAASA,qBAAU,WAClB,OAAOA,qBAAU,QAAQ,GAAG,MAAM,KAAK,UAAU,EACjD,OAAOA,qBAAU,QAAQ;AAE3B,EACC,YAAYA,qBAAU,aAAa,UAAUA,qBAAU,eAAe,CAAC;AAWlE,MAAM,yBAAyB,CAAC,EAAE,SAAS,SAAS,IAAsB,CAAA,MAAO;AACvF,QAAM,WAAWC,aAAAA,aAAa;AAAA,IAC7B;AAAA,IACA;AAAA,EAAA,CACA;AACD,SAAOC,kBAAY,OAAO,EAAE,aAAa,GAAG,mBAAqF;AAChI,UAAM,SAAS,MAAM,SAASF,qBAAU,OAAO,cAAc;AAAA,MAC5D,MAAMG,mBAAAA,aAAa,GAAG,aAAa;AAAA,IAAA,GACjCH,qBAAU,SAAS,QAAQ;AAAA,MAC7B,OAAOG,mBAAAA,aAAa,GAAG,cAAc;AAAA,IAAA,GACnC,+BAA+B,CAAC,GAAG;AAAA,MACrC,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MAAA;AAAA,IACD,CACA;AAEM,WAAA,OAAO,eAAe,WAAW,CAAC;AAAA,EAAA,GACvC,CAAC,QAAQ,CAAC;AACd;;"}
@@ -3,7 +3,7 @@ import { ParameterRef } from "graphql-ts-client-api";
3
3
  import { useTenantApi } from "../useTenantApi.js";
4
4
  import { useCallback } from "react";
5
5
  const projectIdentityRelationFragment = TenantApi.projectIdentityRelation$.identity(
6
- TenantApi.identity$$.person(TenantApi.person$$).apiKey(TenantApi.apiKey$$)
6
+ TenantApi.identity$$.person(TenantApi.person$.id.email.name.otpEnabled).apiKey(TenantApi.apiKey$$)
7
7
  ).memberships(TenantApi.membership$$.variables(TenantApi.variableEntry$$));
8
8
  const useProjectMembersQuery = ({ headers, apiToken } = {}) => {
9
9
  const executor = useTenantApi({
@@ -1 +1 @@
1
- {"version":3,"file":"useProjectMembersQuery.js","sources":["../../../../../../packages/react-client-tenant/src/hooks/queries/useProjectMembersQuery.ts"],"sourcesContent":["import * as TenantApi from '@contember/graphql-client-tenant'\nimport { ModelType, ParameterRef } from 'graphql-ts-client-api'\nimport { TenantApiOptions, useTenantApi } from '../useTenantApi'\nimport { useCallback } from 'react'\n\nconst projectIdentityRelationFragment = TenantApi\n\t.projectIdentityRelation$\n\t.identity(TenantApi.identity$$\n\t\t.person(TenantApi.person$$)\n\t\t.apiKey(TenantApi.apiKey$$)\n\t\t,\n\t)\n\t.memberships(TenantApi.membership$$.variables(TenantApi.variableEntry$$))\n\nexport type ProjectMembersQueryResult = readonly ModelType<typeof projectIdentityRelationFragment>[]\n\nexport type ProjectMembersQueryVariables =\n\t& {\n\t\tprojectSlug: string\n\t}\n\t& TenantApi.ProjectMembersInput\n\n\nexport const useProjectMembersQuery = ({ headers, apiToken }: TenantApiOptions = {}) => {\n\tconst executor = useTenantApi({\n\t\theaders,\n\t\tapiToken,\n\t})\n\treturn useCallback(async ({ projectSlug, ...membersInput }: ProjectMembersQueryVariables): Promise<ProjectMembersQueryResult> => {\n\t\tconst result = await executor(TenantApi.query$.projectBySlug({\n\t\t\tslug: ParameterRef.of('projectSlug'),\n\t\t}, TenantApi.project$.members({\n\t\t\tinput: ParameterRef.of('membersInput'),\n\t\t}, projectIdentityRelationFragment)), {\n\t\t\tvariables: {\n\t\t\t\tprojectSlug,\n\t\t\t\tmembersInput,\n\t\t\t},\n\t\t})\n\n\t\treturn result.projectBySlug?.members ?? []\n\t}, [executor])\n}\n"],"names":[],"mappings":";;;;AAKA,MAAM,kCAAkC,UACtC,yBACA;AAAA,EAAS,UAAU,WAClB,OAAO,UAAU,QAAQ,EACzB,OAAO,UAAU,QAAQ;AAE3B,EACC,YAAY,UAAU,aAAa,UAAU,UAAU,eAAe,CAAC;AAWlE,MAAM,yBAAyB,CAAC,EAAE,SAAS,SAAS,IAAsB,CAAA,MAAO;AACvF,QAAM,WAAW,aAAa;AAAA,IAC7B;AAAA,IACA;AAAA,EAAA,CACA;AACD,SAAO,YAAY,OAAO,EAAE,aAAa,GAAG,mBAAqF;AAChI,UAAM,SAAS,MAAM,SAAS,UAAU,OAAO,cAAc;AAAA,MAC5D,MAAM,aAAa,GAAG,aAAa;AAAA,IAAA,GACjC,UAAU,SAAS,QAAQ;AAAA,MAC7B,OAAO,aAAa,GAAG,cAAc;AAAA,IAAA,GACnC,+BAA+B,CAAC,GAAG;AAAA,MACrC,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,IAAA,CACA;AAEM,WAAA,OAAO,eAAe,WAAW;EAAC,GACvC,CAAC,QAAQ,CAAC;AACd;"}
1
+ {"version":3,"file":"useProjectMembersQuery.js","sources":["../../../../../../packages/react-client-tenant/src/hooks/queries/useProjectMembersQuery.ts"],"sourcesContent":["import * as TenantApi from '@contember/graphql-client-tenant'\nimport { ModelType, ParameterRef } from 'graphql-ts-client-api'\nimport { TenantApiOptions, useTenantApi } from '../useTenantApi'\nimport { useCallback } from 'react'\n\nconst projectIdentityRelationFragment = TenantApi\n\t.projectIdentityRelation$\n\t.identity(TenantApi.identity$$\n\t\t.person(TenantApi.person$.id.email.name.otpEnabled)\n\t\t.apiKey(TenantApi.apiKey$$)\n\t\t,\n\t)\n\t.memberships(TenantApi.membership$$.variables(TenantApi.variableEntry$$))\n\nexport type ProjectMembersQueryResult = readonly ModelType<typeof projectIdentityRelationFragment>[]\n\nexport type ProjectMembersQueryVariables =\n\t& {\n\t\tprojectSlug: string\n\t}\n\t& TenantApi.ProjectMembersInput\n\n\nexport const useProjectMembersQuery = ({ headers, apiToken }: TenantApiOptions = {}) => {\n\tconst executor = useTenantApi({\n\t\theaders,\n\t\tapiToken,\n\t})\n\treturn useCallback(async ({ projectSlug, ...membersInput }: ProjectMembersQueryVariables): Promise<ProjectMembersQueryResult> => {\n\t\tconst result = await executor(TenantApi.query$.projectBySlug({\n\t\t\tslug: ParameterRef.of('projectSlug'),\n\t\t}, TenantApi.project$.members({\n\t\t\tinput: ParameterRef.of('membersInput'),\n\t\t}, projectIdentityRelationFragment)), {\n\t\t\tvariables: {\n\t\t\t\tprojectSlug,\n\t\t\t\tmembersInput,\n\t\t\t},\n\t\t})\n\n\t\treturn result.projectBySlug?.members ?? []\n\t}, [executor])\n}\n"],"names":[],"mappings":";;;;AAKA,MAAM,kCAAkC,UACtC,yBACA;AAAA,EAAS,UAAU,WAClB,OAAO,UAAU,QAAQ,GAAG,MAAM,KAAK,UAAU,EACjD,OAAO,UAAU,QAAQ;AAE3B,EACC,YAAY,UAAU,aAAa,UAAU,UAAU,eAAe,CAAC;AAWlE,MAAM,yBAAyB,CAAC,EAAE,SAAS,SAAS,IAAsB,CAAA,MAAO;AACvF,QAAM,WAAW,aAAa;AAAA,IAC7B;AAAA,IACA;AAAA,EAAA,CACA;AACD,SAAO,YAAY,OAAO,EAAE,aAAa,GAAG,mBAAqF;AAChI,UAAM,SAAS,MAAM,SAAS,UAAU,OAAO,cAAc;AAAA,MAC5D,MAAM,aAAa,GAAG,aAAa;AAAA,IAAA,GACjC,UAAU,SAAS,QAAQ;AAAA,MAC7B,OAAO,aAAa,GAAG,cAAc;AAAA,IAAA,GACnC,+BAA+B,CAAC,GAAG;AAAA,MACrC,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MAAA;AAAA,IACD,CACA;AAEM,WAAA,OAAO,eAAe,WAAW,CAAC;AAAA,EAAA,GACvC,CAAC,QAAQ,CAAC;AACd;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useProjectMembershipsQuery.cjs","sources":["../../../../../../packages/react-client-tenant/src/hooks/queries/useProjectMembershipsQuery.ts"],"sourcesContent":["import * as TenantApi from '@contember/graphql-client-tenant'\nimport { ModelType, ParameterRef } from 'graphql-ts-client-api'\nimport { TenantApiOptions, useTenantApi } from '../useTenantApi'\nimport { useCallback } from 'react'\n\nconst projectMembershipsFragment = TenantApi.membership$$.variables(TenantApi.variableEntry$$)\n\nexport type ProjectMembershipsQueryResult = readonly ModelType<typeof projectMembershipsFragment>[]\n\nexport type ProjectMembershipsQueryVariables = {\n\tprojectSlug: string\n\tidentityId: string\n}\n\n\nexport const useProjectMembershipsQuery = (options: TenantApiOptions = {}) => {\n\tconst executor = useTenantApi(options)\n\treturn useCallback(async (input: ProjectMembershipsQueryVariables): Promise<ProjectMembershipsQueryResult> => {\n\t\tconst result = await executor(TenantApi.query$.projectMemberships(TenantApi.membership$$.variables(TenantApi.variableEntry$$)), {\n\t\t\tvariables: input,\n\t\t})\n\n\t\treturn result.projectMemberships ?? []\n\t}, [executor])\n}\n"],"names":["TenantApi","useTenantApi","useCallback"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAKmCA,qBAAU,aAAa,UAAUA,qBAAU,eAAe;AAUtF,MAAM,6BAA6B,CAAC,UAA4B,OAAO;AACvE,QAAA,WAAWC,0BAAa,OAAO;AAC9B,SAAAC,MAAAA,YAAY,OAAO,UAAoF;AAC7G,UAAM,SAAS,MAAM,SAASF,qBAAU,OAAO,mBAAmBA,qBAAU,aAAa,UAAUA,qBAAU,eAAe,CAAC,GAAG;AAAA,MAC/H,WAAW;AAAA,IAAA,CACX;AAEM,WAAA,OAAO,sBAAsB;EAAC,GACnC,CAAC,QAAQ,CAAC;AACd;;"}
1
+ {"version":3,"file":"useProjectMembershipsQuery.cjs","sources":["../../../../../../packages/react-client-tenant/src/hooks/queries/useProjectMembershipsQuery.ts"],"sourcesContent":["import * as TenantApi from '@contember/graphql-client-tenant'\nimport { ModelType, ParameterRef } from 'graphql-ts-client-api'\nimport { TenantApiOptions, useTenantApi } from '../useTenantApi'\nimport { useCallback } from 'react'\n\nconst projectMembershipsFragment = TenantApi.membership$$.variables(TenantApi.variableEntry$$)\n\nexport type ProjectMembershipsQueryResult = readonly ModelType<typeof projectMembershipsFragment>[]\n\nexport type ProjectMembershipsQueryVariables = {\n\tprojectSlug: string\n\tidentityId: string\n}\n\n\nexport const useProjectMembershipsQuery = (options: TenantApiOptions = {}) => {\n\tconst executor = useTenantApi(options)\n\treturn useCallback(async (input: ProjectMembershipsQueryVariables): Promise<ProjectMembershipsQueryResult> => {\n\t\tconst result = await executor(TenantApi.query$.projectMemberships(TenantApi.membership$$.variables(TenantApi.variableEntry$$)), {\n\t\t\tvariables: input,\n\t\t})\n\n\t\treturn result.projectMemberships ?? []\n\t}, [executor])\n}\n"],"names":["TenantApi","useTenantApi","useCallback"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAKmCA,qBAAU,aAAa,UAAUA,qBAAU,eAAe;AAUtF,MAAM,6BAA6B,CAAC,UAA4B,OAAO;AACvE,QAAA,WAAWC,0BAAa,OAAO;AAC9B,SAAAC,MAAAA,YAAY,OAAO,UAAoF;AAC7G,UAAM,SAAS,MAAM,SAASF,qBAAU,OAAO,mBAAmBA,qBAAU,aAAa,UAAUA,qBAAU,eAAe,CAAC,GAAG;AAAA,MAC/H,WAAW;AAAA,IAAA,CACX;AAEM,WAAA,OAAO,sBAAsB,CAAC;AAAA,EAAA,GACnC,CAAC,QAAQ,CAAC;AACd;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useProjectMembershipsQuery.js","sources":["../../../../../../packages/react-client-tenant/src/hooks/queries/useProjectMembershipsQuery.ts"],"sourcesContent":["import * as TenantApi from '@contember/graphql-client-tenant'\nimport { ModelType, ParameterRef } from 'graphql-ts-client-api'\nimport { TenantApiOptions, useTenantApi } from '../useTenantApi'\nimport { useCallback } from 'react'\n\nconst projectMembershipsFragment = TenantApi.membership$$.variables(TenantApi.variableEntry$$)\n\nexport type ProjectMembershipsQueryResult = readonly ModelType<typeof projectMembershipsFragment>[]\n\nexport type ProjectMembershipsQueryVariables = {\n\tprojectSlug: string\n\tidentityId: string\n}\n\n\nexport const useProjectMembershipsQuery = (options: TenantApiOptions = {}) => {\n\tconst executor = useTenantApi(options)\n\treturn useCallback(async (input: ProjectMembershipsQueryVariables): Promise<ProjectMembershipsQueryResult> => {\n\t\tconst result = await executor(TenantApi.query$.projectMemberships(TenantApi.membership$$.variables(TenantApi.variableEntry$$)), {\n\t\t\tvariables: input,\n\t\t})\n\n\t\treturn result.projectMemberships ?? []\n\t}, [executor])\n}\n"],"names":[],"mappings":";;;AAKmC,UAAU,aAAa,UAAU,UAAU,eAAe;AAUtF,MAAM,6BAA6B,CAAC,UAA4B,OAAO;AACvE,QAAA,WAAW,aAAa,OAAO;AAC9B,SAAA,YAAY,OAAO,UAAoF;AAC7G,UAAM,SAAS,MAAM,SAAS,UAAU,OAAO,mBAAmB,UAAU,aAAa,UAAU,UAAU,eAAe,CAAC,GAAG;AAAA,MAC/H,WAAW;AAAA,IAAA,CACX;AAEM,WAAA,OAAO,sBAAsB;EAAC,GACnC,CAAC,QAAQ,CAAC;AACd;"}
1
+ {"version":3,"file":"useProjectMembershipsQuery.js","sources":["../../../../../../packages/react-client-tenant/src/hooks/queries/useProjectMembershipsQuery.ts"],"sourcesContent":["import * as TenantApi from '@contember/graphql-client-tenant'\nimport { ModelType, ParameterRef } from 'graphql-ts-client-api'\nimport { TenantApiOptions, useTenantApi } from '../useTenantApi'\nimport { useCallback } from 'react'\n\nconst projectMembershipsFragment = TenantApi.membership$$.variables(TenantApi.variableEntry$$)\n\nexport type ProjectMembershipsQueryResult = readonly ModelType<typeof projectMembershipsFragment>[]\n\nexport type ProjectMembershipsQueryVariables = {\n\tprojectSlug: string\n\tidentityId: string\n}\n\n\nexport const useProjectMembershipsQuery = (options: TenantApiOptions = {}) => {\n\tconst executor = useTenantApi(options)\n\treturn useCallback(async (input: ProjectMembershipsQueryVariables): Promise<ProjectMembershipsQueryResult> => {\n\t\tconst result = await executor(TenantApi.query$.projectMemberships(TenantApi.membership$$.variables(TenantApi.variableEntry$$)), {\n\t\t\tvariables: input,\n\t\t})\n\n\t\treturn result.projectMemberships ?? []\n\t}, [executor])\n}\n"],"names":[],"mappings":";;;AAKmC,UAAU,aAAa,UAAU,UAAU,eAAe;AAUtF,MAAM,6BAA6B,CAAC,UAA4B,OAAO;AACvE,QAAA,WAAW,aAAa,OAAO;AAC9B,SAAA,YAAY,OAAO,UAAoF;AAC7G,UAAM,SAAS,MAAM,SAAS,UAAU,OAAO,mBAAmB,UAAU,aAAa,UAAU,UAAU,eAAe,CAAC,GAAG;AAAA,MAC/H,WAAW;AAAA,IAAA,CACX;AAEM,WAAA,OAAO,sBAAsB,CAAC;AAAA,EAAA,GACnC,CAAC,QAAQ,CAAC;AACd;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useProjectRolesDefinitionQuery.cjs","sources":["../../../../../../packages/react-client-tenant/src/hooks/queries/useProjectRolesDefinitionQuery.ts"],"sourcesContent":["import * as TenantApi from '@contember/graphql-client-tenant'\nimport { ModelType } from 'graphql-ts-client-api'\nimport { TenantApiOptions, useTenantApi } from '../useTenantApi'\nimport { useCallback } from 'react'\n\nconst projectRolesDefinitionFragment = TenantApi.roleDefinition$$\n\t.variables(\n\t\tTenantApi.roleVariableDefinition$$\n\t\t\t.on(TenantApi.roleConditionVariableDefinition$$)\n\t\t\t.on(TenantApi.roleEntityVariableDefinition$$)\n\t\t\t.on(TenantApi.rolePredefinedVariableDefinition$$)\n\t\t,\n\t)\n\nexport type ProjectRoleDefinition = ModelType<typeof projectRolesDefinitionFragment>\nexport type ProjectRolesDefinitionQueryResult = readonly ProjectRoleDefinition[]\n\nconst projectRolesDefinitionQuery = TenantApi.query$\n\t.projectBySlug(\n\t\tTenantApi\n\t\t\t.project$\n\t\t\t.roles(projectRolesDefinitionFragment),\n\t)\n\nexport interface ProjectRolesDefinitionQueryVariables {\n\tslug: string\n}\n\nexport const useProjectRolesDefinitionQuery = ({ headers, apiToken }: TenantApiOptions = {}) => {\n\tconst executor = useTenantApi()\n\treturn useCallback(async (variables: ProjectRolesDefinitionQueryVariables): Promise<ProjectRolesDefinitionQueryResult> => {\n\t\treturn (await executor(projectRolesDefinitionQuery, { headers, apiToken, variables })).projectBySlug?.roles ?? []\n\t}, [apiToken, executor, headers])\n}\n"],"names":["TenantApi","useTenantApi","useCallback"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM,iCAAiCA,qBAAU,iBAC/C;AAAA,EACAA,qBAAU,yBACR,GAAGA,qBAAU,iCAAiC,EAC9C,GAAGA,qBAAU,8BAA8B,EAC3C,GAAGA,qBAAU,kCAAkC;AAElD;AAKD,MAAM,8BAA8BA,qBAAU,OAC5C;AAAA,EACAA,qBACE,SACA,MAAM,8BAA8B;AACvC;AAMM,MAAM,iCAAiC,CAAC,EAAE,SAAS,SAAS,IAAsB,CAAA,MAAO;AAC/F,QAAM,WAAWC,aAAAA;AACV,SAAAC,MAAAA,YAAY,OAAO,cAAgG;AACjH,YAAA,MAAM,SAAS,6BAA6B,EAAE,SAAS,UAAU,WAAW,GAAG,eAAe,SAAS,CAAA;AAAA,EAC7G,GAAA,CAAC,UAAU,UAAU,OAAO,CAAC;AACjC;;"}
1
+ {"version":3,"file":"useProjectRolesDefinitionQuery.cjs","sources":["../../../../../../packages/react-client-tenant/src/hooks/queries/useProjectRolesDefinitionQuery.ts"],"sourcesContent":["import * as TenantApi from '@contember/graphql-client-tenant'\nimport { ModelType } from 'graphql-ts-client-api'\nimport { TenantApiOptions, useTenantApi } from '../useTenantApi'\nimport { useCallback } from 'react'\n\nconst projectRolesDefinitionFragment = TenantApi.roleDefinition$$\n\t.variables(\n\t\tTenantApi.roleVariableDefinition$$\n\t\t\t.on(TenantApi.roleConditionVariableDefinition$$)\n\t\t\t.on(TenantApi.roleEntityVariableDefinition$$)\n\t\t\t.on(TenantApi.rolePredefinedVariableDefinition$$)\n\t\t,\n\t)\n\nexport type ProjectRoleDefinition = ModelType<typeof projectRolesDefinitionFragment>\nexport type ProjectRolesDefinitionQueryResult = readonly ProjectRoleDefinition[]\n\nconst projectRolesDefinitionQuery = TenantApi.query$\n\t.projectBySlug(\n\t\tTenantApi\n\t\t\t.project$\n\t\t\t.roles(projectRolesDefinitionFragment),\n\t)\n\nexport interface ProjectRolesDefinitionQueryVariables {\n\tslug: string\n}\n\nexport const useProjectRolesDefinitionQuery = ({ headers, apiToken }: TenantApiOptions = {}) => {\n\tconst executor = useTenantApi()\n\treturn useCallback(async (variables: ProjectRolesDefinitionQueryVariables): Promise<ProjectRolesDefinitionQueryResult> => {\n\t\treturn (await executor(projectRolesDefinitionQuery, { headers, apiToken, variables })).projectBySlug?.roles ?? []\n\t}, [apiToken, executor, headers])\n}\n"],"names":["TenantApi","useTenantApi","useCallback"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM,iCAAiCA,qBAAU,iBAC/C;AAAA,EACAA,qBAAU,yBACR,GAAGA,qBAAU,iCAAiC,EAC9C,GAAGA,qBAAU,8BAA8B,EAC3C,GAAGA,qBAAU,kCAAkC;AAElD;AAKD,MAAM,8BAA8BA,qBAAU,OAC5C;AAAA,EACAA,qBACE,SACA,MAAM,8BAA8B;AACvC;AAMM,MAAM,iCAAiC,CAAC,EAAE,SAAS,SAAS,IAAsB,CAAA,MAAO;AAC/F,QAAM,WAAWC,aAAAA,aAAa;AACvB,SAAAC,MAAAA,YAAY,OAAO,cAAgG;AACjH,YAAA,MAAM,SAAS,6BAA6B,EAAE,SAAS,UAAU,WAAW,GAAG,eAAe,SAAS,CAAC;AAAA,EAC9G,GAAA,CAAC,UAAU,UAAU,OAAO,CAAC;AACjC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useProjectRolesDefinitionQuery.js","sources":["../../../../../../packages/react-client-tenant/src/hooks/queries/useProjectRolesDefinitionQuery.ts"],"sourcesContent":["import * as TenantApi from '@contember/graphql-client-tenant'\nimport { ModelType } from 'graphql-ts-client-api'\nimport { TenantApiOptions, useTenantApi } from '../useTenantApi'\nimport { useCallback } from 'react'\n\nconst projectRolesDefinitionFragment = TenantApi.roleDefinition$$\n\t.variables(\n\t\tTenantApi.roleVariableDefinition$$\n\t\t\t.on(TenantApi.roleConditionVariableDefinition$$)\n\t\t\t.on(TenantApi.roleEntityVariableDefinition$$)\n\t\t\t.on(TenantApi.rolePredefinedVariableDefinition$$)\n\t\t,\n\t)\n\nexport type ProjectRoleDefinition = ModelType<typeof projectRolesDefinitionFragment>\nexport type ProjectRolesDefinitionQueryResult = readonly ProjectRoleDefinition[]\n\nconst projectRolesDefinitionQuery = TenantApi.query$\n\t.projectBySlug(\n\t\tTenantApi\n\t\t\t.project$\n\t\t\t.roles(projectRolesDefinitionFragment),\n\t)\n\nexport interface ProjectRolesDefinitionQueryVariables {\n\tslug: string\n}\n\nexport const useProjectRolesDefinitionQuery = ({ headers, apiToken }: TenantApiOptions = {}) => {\n\tconst executor = useTenantApi()\n\treturn useCallback(async (variables: ProjectRolesDefinitionQueryVariables): Promise<ProjectRolesDefinitionQueryResult> => {\n\t\treturn (await executor(projectRolesDefinitionQuery, { headers, apiToken, variables })).projectBySlug?.roles ?? []\n\t}, [apiToken, executor, headers])\n}\n"],"names":[],"mappings":";;;AAKA,MAAM,iCAAiC,UAAU,iBAC/C;AAAA,EACA,UAAU,yBACR,GAAG,UAAU,iCAAiC,EAC9C,GAAG,UAAU,8BAA8B,EAC3C,GAAG,UAAU,kCAAkC;AAElD;AAKD,MAAM,8BAA8B,UAAU,OAC5C;AAAA,EACA,UACE,SACA,MAAM,8BAA8B;AACvC;AAMM,MAAM,iCAAiC,CAAC,EAAE,SAAS,SAAS,IAAsB,CAAA,MAAO;AAC/F,QAAM,WAAW;AACV,SAAA,YAAY,OAAO,cAAgG;AACjH,YAAA,MAAM,SAAS,6BAA6B,EAAE,SAAS,UAAU,WAAW,GAAG,eAAe,SAAS,CAAA;AAAA,EAC7G,GAAA,CAAC,UAAU,UAAU,OAAO,CAAC;AACjC;"}
1
+ {"version":3,"file":"useProjectRolesDefinitionQuery.js","sources":["../../../../../../packages/react-client-tenant/src/hooks/queries/useProjectRolesDefinitionQuery.ts"],"sourcesContent":["import * as TenantApi from '@contember/graphql-client-tenant'\nimport { ModelType } from 'graphql-ts-client-api'\nimport { TenantApiOptions, useTenantApi } from '../useTenantApi'\nimport { useCallback } from 'react'\n\nconst projectRolesDefinitionFragment = TenantApi.roleDefinition$$\n\t.variables(\n\t\tTenantApi.roleVariableDefinition$$\n\t\t\t.on(TenantApi.roleConditionVariableDefinition$$)\n\t\t\t.on(TenantApi.roleEntityVariableDefinition$$)\n\t\t\t.on(TenantApi.rolePredefinedVariableDefinition$$)\n\t\t,\n\t)\n\nexport type ProjectRoleDefinition = ModelType<typeof projectRolesDefinitionFragment>\nexport type ProjectRolesDefinitionQueryResult = readonly ProjectRoleDefinition[]\n\nconst projectRolesDefinitionQuery = TenantApi.query$\n\t.projectBySlug(\n\t\tTenantApi\n\t\t\t.project$\n\t\t\t.roles(projectRolesDefinitionFragment),\n\t)\n\nexport interface ProjectRolesDefinitionQueryVariables {\n\tslug: string\n}\n\nexport const useProjectRolesDefinitionQuery = ({ headers, apiToken }: TenantApiOptions = {}) => {\n\tconst executor = useTenantApi()\n\treturn useCallback(async (variables: ProjectRolesDefinitionQueryVariables): Promise<ProjectRolesDefinitionQueryResult> => {\n\t\treturn (await executor(projectRolesDefinitionQuery, { headers, apiToken, variables })).projectBySlug?.roles ?? []\n\t}, [apiToken, executor, headers])\n}\n"],"names":[],"mappings":";;;AAKA,MAAM,iCAAiC,UAAU,iBAC/C;AAAA,EACA,UAAU,yBACR,GAAG,UAAU,iCAAiC,EAC9C,GAAG,UAAU,8BAA8B,EAC3C,GAAG,UAAU,kCAAkC;AAElD;AAKD,MAAM,8BAA8B,UAAU,OAC5C;AAAA,EACA,UACE,SACA,MAAM,8BAA8B;AACvC;AAMM,MAAM,iCAAiC,CAAC,EAAE,SAAS,SAAS,IAAsB,CAAA,MAAO;AAC/F,QAAM,WAAW,aAAa;AACvB,SAAA,YAAY,OAAO,cAAgG;AACjH,YAAA,MAAM,SAAS,6BAA6B,EAAE,SAAS,UAAU,WAAW,GAAG,eAAe,SAAS,CAAC;AAAA,EAC9G,GAAA,CAAC,UAAU,UAAU,OAAO,CAAC;AACjC;"}
@@ -21,6 +21,7 @@ const useFetchIdentity = () => {
21
21
  state: "success",
22
22
  identity: {
23
23
  id: response.id,
24
+ roles: response.roles ?? [],
24
25
  person: person ?? void 0,
25
26
  projects: projects.map((it) => ({
26
27
  name: it.project.name,
@@ -32,9 +33,8 @@ const useFetchIdentity = () => {
32
33
  });
33
34
  } catch (e) {
34
35
  console.error(e);
35
- if (typeof e === "object" && e !== null && "status" in e && e.status === 401) {
36
+ if (e instanceof reactClient.GraphQlClientError && e.response?.status === 401) {
36
37
  logout({ noRedirect: true });
37
- setIdentityState({ state: "cleared", identity: void 0 });
38
38
  } else {
39
39
  setIdentityState({ state: "failed", identity: void 0 });
40
40
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useFetchIdentity.cjs","sources":["../../../../../packages/react-client-tenant/src/hooks/useFetchIdentity.ts"],"sourcesContent":["import { useCallback, useMemo, useState } from 'react'\nimport { Identity, IdentityMethods, IdentityStateValue } from '../types'\nimport { useSessionToken } from '@contember/react-client'\nimport { useLogoutInternal } from '../internal/hooks/useLogoutInternal'\nimport { useMeQuery } from './queries'\n\nexport const useFetchIdentity = (): [{ state: IdentityStateValue; identity: Identity | undefined }, IdentityMethods] => {\n\tconst sessionToken = useSessionToken()\n\tconst fetchMe = useMeQuery()\n\n\tconst [identityState, setIdentityState] = useState<ReturnType<typeof useFetchIdentity>[0]>({ state: sessionToken ? 'loading' : 'none', identity: undefined })\n\n\tconst clearIdentity = useCallback(() => setIdentityState({ state: 'cleared', identity: undefined }), [])\n\tconst logout = useLogoutInternal(clearIdentity)\n\n\tconst fetch = useCallback(async () => {\n\t\tsetIdentityState({ state: 'loading', identity: undefined })\n\t\ttry {\n\t\t\tconst response = await fetchMe({})\n\t\t\tconst person = response.person\n\t\t\tconst projects = response.projects\n\t\t\tconst permissions = response.permissions ?? { canCreateProject: false }\n\n\t\t\tsetIdentityState({\n\t\t\t\tstate: 'success',\n\t\t\t\tidentity: {\n\t\t\t\t\tid: response.id,\n\t\t\t\t\tperson: person ?? undefined,\n\t\t\t\t\tprojects: projects.map(it => ({\n\t\t\t\t\t\tname: it.project.name,\n\t\t\t\t\t\tslug: it.project.slug,\n\t\t\t\t\t\troles: it.memberships.map(it => it.role),\n\t\t\t\t\t})),\n\t\t\t\t\tpermissions,\n\t\t\t\t},\n\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t\tif (typeof e === 'object' && e !== null && 'status' in e && (e as { status?: unknown }).status === 401) {\n\t\t\t\tlogout({ noRedirect: true })\n\t\t\t\tsetIdentityState({ state: 'cleared', identity: undefined })\n\t\t\t} else {\n\t\t\t\tsetIdentityState({ state: 'failed', identity: undefined })\n\t\t\t}\n\t\t}\n\t}, [fetchMe, logout])\n\n\treturn [\n\t\tidentityState,\n\t\tuseMemo((): IdentityMethods => ({\n\t\t\tclearIdentity,\n\t\t\trefreshIdentity: fetch,\n\t\t}), [clearIdentity, fetch]),\n\t]\n}\n"],"names":["useSessionToken","useMeQuery","useState","useCallback","useLogoutInternal","it","useMemo"],"mappings":";;;;;;AAMO,MAAM,mBAAmB,MAAwF;AACvH,QAAM,eAAeA,YAAAA;AACrB,QAAM,UAAUC,WAAAA;AAEhB,QAAM,CAAC,eAAe,gBAAgB,IAAIC,MAAAA,SAAiD,EAAE,OAAO,eAAe,YAAY,QAAQ,UAAU,OAAW,CAAA;AAE5J,QAAM,gBAAgBC,MAAAA,YAAY,MAAM,iBAAiB,EAAE,OAAO,WAAW,UAAU,QAAW,GAAG,CAAE,CAAA;AACjG,QAAA,SAASC,oCAAkB,aAAa;AAExC,QAAA,QAAQD,MAAAA,YAAY,YAAY;AACrC,qBAAiB,EAAE,OAAO,WAAW,UAAU,QAAW;AACtD,QAAA;AACH,YAAM,WAAW,MAAM,QAAQ,CAAA,CAAE;AACjC,YAAM,SAAS,SAAS;AACxB,YAAM,WAAW,SAAS;AAC1B,YAAM,cAAc,SAAS,eAAe,EAAE,kBAAkB,MAAM;AAErD,uBAAA;AAAA,QAChB,OAAO;AAAA,QACP,UAAU;AAAA,UACT,IAAI,SAAS;AAAA,UACb,QAAQ,UAAU;AAAA,UAClB,UAAU,SAAS,IAAI,CAAO,QAAA;AAAA,YAC7B,MAAM,GAAG,QAAQ;AAAA,YACjB,MAAM,GAAG,QAAQ;AAAA,YACjB,OAAO,GAAG,YAAY,IAAI,CAAAE,QAAMA,IAAG,IAAI;AAAA,UAAA,EACtC;AAAA,UACF;AAAA,QACD;AAAA,MAAA,CACA;AAAA,aACO,GAAG;AACX,cAAQ,MAAM,CAAC;AACX,UAAA,OAAO,MAAM,YAAY,MAAM,QAAQ,YAAY,KAAM,EAA2B,WAAW,KAAK;AAChG,eAAA,EAAE,YAAY,KAAA,CAAM;AAC3B,yBAAiB,EAAE,OAAO,WAAW,UAAU,QAAW;AAAA,MAAA,OACpD;AACN,yBAAiB,EAAE,OAAO,UAAU,UAAU,QAAW;AAAA,MAC1D;AAAA,IACD;AAAA,EAAA,GACE,CAAC,SAAS,MAAM,CAAC;AAEb,SAAA;AAAA,IACN;AAAA,IACAC,MAAAA,QAAQ,OAAwB;AAAA,MAC/B;AAAA,MACA,iBAAiB;AAAA,IAAA,IACd,CAAC,eAAe,KAAK,CAAC;AAAA,EAAA;AAE5B;;"}
1
+ {"version":3,"file":"useFetchIdentity.cjs","sources":["../../../../../packages/react-client-tenant/src/hooks/useFetchIdentity.ts"],"sourcesContent":["import { useCallback, useMemo, useState } from 'react'\nimport { Identity, IdentityMethods, IdentityStateValue } from '../types'\nimport { GraphQlClientError, useSessionToken } from '@contember/react-client'\nimport { useLogoutInternal } from '../internal/hooks/useLogoutInternal'\nimport { useMeQuery } from './queries'\n\nexport const useFetchIdentity = (): [{ state: IdentityStateValue; identity: Identity | undefined }, IdentityMethods] => {\n\tconst sessionToken = useSessionToken()\n\tconst fetchMe = useMeQuery()\n\n\tconst [identityState, setIdentityState] = useState<ReturnType<typeof useFetchIdentity>[0]>({ state: sessionToken ? 'loading' : 'none', identity: undefined })\n\n\tconst clearIdentity = useCallback(() => setIdentityState({ state: 'cleared', identity: undefined }), [])\n\tconst logout = useLogoutInternal(clearIdentity)\n\n\tconst fetch = useCallback(async () => {\n\t\tsetIdentityState({ state: 'loading', identity: undefined })\n\t\ttry {\n\t\t\tconst response = await fetchMe({})\n\t\t\tconst person = response.person\n\t\t\tconst projects = response.projects\n\t\t\tconst permissions = response.permissions ?? { canCreateProject: false }\n\n\t\t\tsetIdentityState({\n\t\t\t\tstate: 'success',\n\t\t\t\tidentity: {\n\t\t\t\t\tid: response.id,\n\t\t\t\t\troles: response.roles ?? [],\n\t\t\t\t\tperson: person ?? undefined,\n\t\t\t\t\tprojects: projects.map(it => ({\n\t\t\t\t\t\tname: it.project.name,\n\t\t\t\t\t\tslug: it.project.slug,\n\t\t\t\t\t\troles: it.memberships.map(it => it.role),\n\t\t\t\t\t})),\n\t\t\t\t\tpermissions,\n\t\t\t\t},\n\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t\tif (e instanceof GraphQlClientError && e.response?.status === 401) {\n\t\t\t\tlogout({ noRedirect: true })\n\t\t\t} else {\n\t\t\t\tsetIdentityState({ state: 'failed', identity: undefined })\n\t\t\t}\n\t\t}\n\t}, [fetchMe, logout])\n\n\treturn [\n\t\tidentityState,\n\t\tuseMemo((): IdentityMethods => ({\n\t\t\tclearIdentity,\n\t\t\trefreshIdentity: fetch,\n\t\t}), [clearIdentity, fetch]),\n\t]\n}\n"],"names":["useSessionToken","useMeQuery","useState","useCallback","useLogoutInternal","it","GraphQlClientError","useMemo"],"mappings":";;;;;;AAMO,MAAM,mBAAmB,MAAwF;AACvH,QAAM,eAAeA,YAAAA,gBAAgB;AACrC,QAAM,UAAUC,WAAAA,WAAW;AAE3B,QAAM,CAAC,eAAe,gBAAgB,IAAIC,MAAiD,SAAA,EAAE,OAAO,eAAe,YAAY,QAAQ,UAAU,OAAA,CAAW;AAE5J,QAAM,gBAAgBC,MAAAA,YAAY,MAAM,iBAAiB,EAAE,OAAO,WAAW,UAAU,OAAW,CAAA,GAAG,CAAA,CAAE;AACjG,QAAA,SAASC,oCAAkB,aAAa;AAExC,QAAA,QAAQD,MAAAA,YAAY,YAAY;AACrC,qBAAiB,EAAE,OAAO,WAAW,UAAU,QAAW;AACtD,QAAA;AACH,YAAM,WAAW,MAAM,QAAQ,EAAE;AACjC,YAAM,SAAS,SAAS;AACxB,YAAM,WAAW,SAAS;AAC1B,YAAM,cAAc,SAAS,eAAe,EAAE,kBAAkB,MAAM;AAErD,uBAAA;AAAA,QAChB,OAAO;AAAA,QACP,UAAU;AAAA,UACT,IAAI,SAAS;AAAA,UACb,OAAO,SAAS,SAAS,CAAC;AAAA,UAC1B,QAAQ,UAAU;AAAA,UAClB,UAAU,SAAS,IAAI,CAAO,QAAA;AAAA,YAC7B,MAAM,GAAG,QAAQ;AAAA,YACjB,MAAM,GAAG,QAAQ;AAAA,YACjB,OAAO,GAAG,YAAY,IAAI,CAAAE,QAAMA,IAAG,IAAI;AAAA,UAAA,EACtC;AAAA,UACF;AAAA,QAAA;AAAA,MACD,CACA;AAAA,aACO,GAAG;AACX,cAAQ,MAAM,CAAC;AACf,UAAI,aAAaC,YAAAA,sBAAsB,EAAE,UAAU,WAAW,KAAK;AAC3D,eAAA,EAAE,YAAY,MAAM;AAAA,MAAA,OACrB;AACN,yBAAiB,EAAE,OAAO,UAAU,UAAU,QAAW;AAAA,MAAA;AAAA,IAC1D;AAAA,EACD,GACE,CAAC,SAAS,MAAM,CAAC;AAEb,SAAA;AAAA,IACN;AAAA,IACAC,MAAAA,QAAQ,OAAwB;AAAA,MAC/B;AAAA,MACA,iBAAiB;AAAA,IAAA,IACd,CAAC,eAAe,KAAK,CAAC;AAAA,EAC3B;AACD;;"}
@@ -1,5 +1,5 @@
1
1
  import { useState, useCallback, useMemo } from "react";
2
- import { useSessionToken } from "@contember/react-client";
2
+ import { useSessionToken, GraphQlClientError } from "@contember/react-client";
3
3
  import { useLogoutInternal } from "../internal/hooks/useLogoutInternal.js";
4
4
  import { useMeQuery } from "./queries/useMeQuery.js";
5
5
  const useFetchIdentity = () => {
@@ -19,6 +19,7 @@ const useFetchIdentity = () => {
19
19
  state: "success",
20
20
  identity: {
21
21
  id: response.id,
22
+ roles: response.roles ?? [],
22
23
  person: person ?? void 0,
23
24
  projects: projects.map((it) => ({
24
25
  name: it.project.name,
@@ -30,9 +31,8 @@ const useFetchIdentity = () => {
30
31
  });
31
32
  } catch (e) {
32
33
  console.error(e);
33
- if (typeof e === "object" && e !== null && "status" in e && e.status === 401) {
34
+ if (e instanceof GraphQlClientError && e.response?.status === 401) {
34
35
  logout({ noRedirect: true });
35
- setIdentityState({ state: "cleared", identity: void 0 });
36
36
  } else {
37
37
  setIdentityState({ state: "failed", identity: void 0 });
38
38
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useFetchIdentity.js","sources":["../../../../../packages/react-client-tenant/src/hooks/useFetchIdentity.ts"],"sourcesContent":["import { useCallback, useMemo, useState } from 'react'\nimport { Identity, IdentityMethods, IdentityStateValue } from '../types'\nimport { useSessionToken } from '@contember/react-client'\nimport { useLogoutInternal } from '../internal/hooks/useLogoutInternal'\nimport { useMeQuery } from './queries'\n\nexport const useFetchIdentity = (): [{ state: IdentityStateValue; identity: Identity | undefined }, IdentityMethods] => {\n\tconst sessionToken = useSessionToken()\n\tconst fetchMe = useMeQuery()\n\n\tconst [identityState, setIdentityState] = useState<ReturnType<typeof useFetchIdentity>[0]>({ state: sessionToken ? 'loading' : 'none', identity: undefined })\n\n\tconst clearIdentity = useCallback(() => setIdentityState({ state: 'cleared', identity: undefined }), [])\n\tconst logout = useLogoutInternal(clearIdentity)\n\n\tconst fetch = useCallback(async () => {\n\t\tsetIdentityState({ state: 'loading', identity: undefined })\n\t\ttry {\n\t\t\tconst response = await fetchMe({})\n\t\t\tconst person = response.person\n\t\t\tconst projects = response.projects\n\t\t\tconst permissions = response.permissions ?? { canCreateProject: false }\n\n\t\t\tsetIdentityState({\n\t\t\t\tstate: 'success',\n\t\t\t\tidentity: {\n\t\t\t\t\tid: response.id,\n\t\t\t\t\tperson: person ?? undefined,\n\t\t\t\t\tprojects: projects.map(it => ({\n\t\t\t\t\t\tname: it.project.name,\n\t\t\t\t\t\tslug: it.project.slug,\n\t\t\t\t\t\troles: it.memberships.map(it => it.role),\n\t\t\t\t\t})),\n\t\t\t\t\tpermissions,\n\t\t\t\t},\n\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t\tif (typeof e === 'object' && e !== null && 'status' in e && (e as { status?: unknown }).status === 401) {\n\t\t\t\tlogout({ noRedirect: true })\n\t\t\t\tsetIdentityState({ state: 'cleared', identity: undefined })\n\t\t\t} else {\n\t\t\t\tsetIdentityState({ state: 'failed', identity: undefined })\n\t\t\t}\n\t\t}\n\t}, [fetchMe, logout])\n\n\treturn [\n\t\tidentityState,\n\t\tuseMemo((): IdentityMethods => ({\n\t\t\tclearIdentity,\n\t\t\trefreshIdentity: fetch,\n\t\t}), [clearIdentity, fetch]),\n\t]\n}\n"],"names":["it"],"mappings":";;;;AAMO,MAAM,mBAAmB,MAAwF;AACvH,QAAM,eAAe;AACrB,QAAM,UAAU;AAEhB,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAiD,EAAE,OAAO,eAAe,YAAY,QAAQ,UAAU,OAAW,CAAA;AAE5J,QAAM,gBAAgB,YAAY,MAAM,iBAAiB,EAAE,OAAO,WAAW,UAAU,QAAW,GAAG,CAAE,CAAA;AACjG,QAAA,SAAS,kBAAkB,aAAa;AAExC,QAAA,QAAQ,YAAY,YAAY;AACrC,qBAAiB,EAAE,OAAO,WAAW,UAAU,QAAW;AACtD,QAAA;AACH,YAAM,WAAW,MAAM,QAAQ,CAAA,CAAE;AACjC,YAAM,SAAS,SAAS;AACxB,YAAM,WAAW,SAAS;AAC1B,YAAM,cAAc,SAAS,eAAe,EAAE,kBAAkB,MAAM;AAErD,uBAAA;AAAA,QAChB,OAAO;AAAA,QACP,UAAU;AAAA,UACT,IAAI,SAAS;AAAA,UACb,QAAQ,UAAU;AAAA,UAClB,UAAU,SAAS,IAAI,CAAO,QAAA;AAAA,YAC7B,MAAM,GAAG,QAAQ;AAAA,YACjB,MAAM,GAAG,QAAQ;AAAA,YACjB,OAAO,GAAG,YAAY,IAAI,CAAAA,QAAMA,IAAG,IAAI;AAAA,UAAA,EACtC;AAAA,UACF;AAAA,QACD;AAAA,MAAA,CACA;AAAA,aACO,GAAG;AACX,cAAQ,MAAM,CAAC;AACX,UAAA,OAAO,MAAM,YAAY,MAAM,QAAQ,YAAY,KAAM,EAA2B,WAAW,KAAK;AAChG,eAAA,EAAE,YAAY,KAAA,CAAM;AAC3B,yBAAiB,EAAE,OAAO,WAAW,UAAU,QAAW;AAAA,MAAA,OACpD;AACN,yBAAiB,EAAE,OAAO,UAAU,UAAU,QAAW;AAAA,MAC1D;AAAA,IACD;AAAA,EAAA,GACE,CAAC,SAAS,MAAM,CAAC;AAEb,SAAA;AAAA,IACN;AAAA,IACA,QAAQ,OAAwB;AAAA,MAC/B;AAAA,MACA,iBAAiB;AAAA,IAAA,IACd,CAAC,eAAe,KAAK,CAAC;AAAA,EAAA;AAE5B;"}
1
+ {"version":3,"file":"useFetchIdentity.js","sources":["../../../../../packages/react-client-tenant/src/hooks/useFetchIdentity.ts"],"sourcesContent":["import { useCallback, useMemo, useState } from 'react'\nimport { Identity, IdentityMethods, IdentityStateValue } from '../types'\nimport { GraphQlClientError, useSessionToken } from '@contember/react-client'\nimport { useLogoutInternal } from '../internal/hooks/useLogoutInternal'\nimport { useMeQuery } from './queries'\n\nexport const useFetchIdentity = (): [{ state: IdentityStateValue; identity: Identity | undefined }, IdentityMethods] => {\n\tconst sessionToken = useSessionToken()\n\tconst fetchMe = useMeQuery()\n\n\tconst [identityState, setIdentityState] = useState<ReturnType<typeof useFetchIdentity>[0]>({ state: sessionToken ? 'loading' : 'none', identity: undefined })\n\n\tconst clearIdentity = useCallback(() => setIdentityState({ state: 'cleared', identity: undefined }), [])\n\tconst logout = useLogoutInternal(clearIdentity)\n\n\tconst fetch = useCallback(async () => {\n\t\tsetIdentityState({ state: 'loading', identity: undefined })\n\t\ttry {\n\t\t\tconst response = await fetchMe({})\n\t\t\tconst person = response.person\n\t\t\tconst projects = response.projects\n\t\t\tconst permissions = response.permissions ?? { canCreateProject: false }\n\n\t\t\tsetIdentityState({\n\t\t\t\tstate: 'success',\n\t\t\t\tidentity: {\n\t\t\t\t\tid: response.id,\n\t\t\t\t\troles: response.roles ?? [],\n\t\t\t\t\tperson: person ?? undefined,\n\t\t\t\t\tprojects: projects.map(it => ({\n\t\t\t\t\t\tname: it.project.name,\n\t\t\t\t\t\tslug: it.project.slug,\n\t\t\t\t\t\troles: it.memberships.map(it => it.role),\n\t\t\t\t\t})),\n\t\t\t\t\tpermissions,\n\t\t\t\t},\n\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t\tif (e instanceof GraphQlClientError && e.response?.status === 401) {\n\t\t\t\tlogout({ noRedirect: true })\n\t\t\t} else {\n\t\t\t\tsetIdentityState({ state: 'failed', identity: undefined })\n\t\t\t}\n\t\t}\n\t}, [fetchMe, logout])\n\n\treturn [\n\t\tidentityState,\n\t\tuseMemo((): IdentityMethods => ({\n\t\t\tclearIdentity,\n\t\t\trefreshIdentity: fetch,\n\t\t}), [clearIdentity, fetch]),\n\t]\n}\n"],"names":["it"],"mappings":";;;;AAMO,MAAM,mBAAmB,MAAwF;AACvH,QAAM,eAAe,gBAAgB;AACrC,QAAM,UAAU,WAAW;AAE3B,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAiD,EAAE,OAAO,eAAe,YAAY,QAAQ,UAAU,OAAA,CAAW;AAE5J,QAAM,gBAAgB,YAAY,MAAM,iBAAiB,EAAE,OAAO,WAAW,UAAU,OAAW,CAAA,GAAG,CAAA,CAAE;AACjG,QAAA,SAAS,kBAAkB,aAAa;AAExC,QAAA,QAAQ,YAAY,YAAY;AACrC,qBAAiB,EAAE,OAAO,WAAW,UAAU,QAAW;AACtD,QAAA;AACH,YAAM,WAAW,MAAM,QAAQ,EAAE;AACjC,YAAM,SAAS,SAAS;AACxB,YAAM,WAAW,SAAS;AAC1B,YAAM,cAAc,SAAS,eAAe,EAAE,kBAAkB,MAAM;AAErD,uBAAA;AAAA,QAChB,OAAO;AAAA,QACP,UAAU;AAAA,UACT,IAAI,SAAS;AAAA,UACb,OAAO,SAAS,SAAS,CAAC;AAAA,UAC1B,QAAQ,UAAU;AAAA,UAClB,UAAU,SAAS,IAAI,CAAO,QAAA;AAAA,YAC7B,MAAM,GAAG,QAAQ;AAAA,YACjB,MAAM,GAAG,QAAQ;AAAA,YACjB,OAAO,GAAG,YAAY,IAAI,CAAAA,QAAMA,IAAG,IAAI;AAAA,UAAA,EACtC;AAAA,UACF;AAAA,QAAA;AAAA,MACD,CACA;AAAA,aACO,GAAG;AACX,cAAQ,MAAM,CAAC;AACf,UAAI,aAAa,sBAAsB,EAAE,UAAU,WAAW,KAAK;AAC3D,eAAA,EAAE,YAAY,MAAM;AAAA,MAAA,OACrB;AACN,yBAAiB,EAAE,OAAO,UAAU,UAAU,QAAW;AAAA,MAAA;AAAA,IAC1D;AAAA,EACD,GACE,CAAC,SAAS,MAAM,CAAC;AAEb,SAAA;AAAA,IACN;AAAA,IACA,QAAQ,OAAwB;AAAA,MAC/B;AAAA,MACA,iBAAiB;AAAA,IAAA,IACd,CAAC,eAAe,KAAK,CAAC;AAAA,EAC3B;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useLogout.cjs","sources":["../../../../../packages/react-client-tenant/src/hooks/useLogout.ts"],"sourcesContent":["import { useIdentityMethods } from '../contexts'\nimport { useLogoutInternal } from '../internal/hooks/useLogoutInternal'\n\nexport const useLogout = () => {\n\tconst { clearIdentity } = useIdentityMethods()\n\treturn useLogoutInternal(clearIdentity)\n}\n"],"names":["useIdentityMethods","useLogoutInternal"],"mappings":";;;;AAGO,MAAM,YAAY,MAAM;AACxB,QAAA,EAAE,kBAAkBA,SAAAA;AAC1B,SAAOC,kBAAAA,kBAAkB,aAAa;AACvC;;"}
1
+ {"version":3,"file":"useLogout.cjs","sources":["../../../../../packages/react-client-tenant/src/hooks/useLogout.ts"],"sourcesContent":["import { useIdentityMethods } from '../contexts'\nimport { useLogoutInternal } from '../internal/hooks/useLogoutInternal'\n\nexport const useLogout = () => {\n\tconst { clearIdentity } = useIdentityMethods()\n\treturn useLogoutInternal(clearIdentity)\n}\n"],"names":["useIdentityMethods","useLogoutInternal"],"mappings":";;;;AAGO,MAAM,YAAY,MAAM;AACxB,QAAA,EAAE,cAAc,IAAIA,4BAAmB;AAC7C,SAAOC,kBAAAA,kBAAkB,aAAa;AACvC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useLogout.js","sources":["../../../../../packages/react-client-tenant/src/hooks/useLogout.ts"],"sourcesContent":["import { useIdentityMethods } from '../contexts'\nimport { useLogoutInternal } from '../internal/hooks/useLogoutInternal'\n\nexport const useLogout = () => {\n\tconst { clearIdentity } = useIdentityMethods()\n\treturn useLogoutInternal(clearIdentity)\n}\n"],"names":[],"mappings":";;AAGO,MAAM,YAAY,MAAM;AACxB,QAAA,EAAE,kBAAkB;AAC1B,SAAO,kBAAkB,aAAa;AACvC;"}
1
+ {"version":3,"file":"useLogout.js","sources":["../../../../../packages/react-client-tenant/src/hooks/useLogout.ts"],"sourcesContent":["import { useIdentityMethods } from '../contexts'\nimport { useLogoutInternal } from '../internal/hooks/useLogoutInternal'\n\nexport const useLogout = () => {\n\tconst { clearIdentity } = useIdentityMethods()\n\treturn useLogoutInternal(clearIdentity)\n}\n"],"names":[],"mappings":";;AAGO,MAAM,YAAY,MAAM;AACxB,QAAA,EAAE,cAAc,IAAI,mBAAmB;AAC7C,SAAO,kBAAkB,aAAa;AACvC;"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const React = require("react");
4
+ const consts = require("../consts.cjs");
5
+ const randomInt = require("../internal/utils/randomInt.cjs");
6
+ const hashing = require("../internal/utils/hashing.cjs");
7
+ const useActivatePasswordlessOtpMutation = require("./mutations/passwordless/useActivatePasswordlessOtpMutation.cjs");
8
+ const usePasswordlessParams = () => {
9
+ const localStorageValue = localStorage.getItem(consts.PASSWORDLESS_REQUEST_STORAGE_KEY) ?? null;
10
+ const urlParams = new URLSearchParams(window.location.search);
11
+ const requestId = urlParams.get("request_id");
12
+ const token = urlParams.get("token");
13
+ return { localStorageRequestId: localStorageValue, urlRequestId: requestId, urlToken: token };
14
+ };
15
+ const usePasswordlessOtpActivator = ({ otpLength = 6, otpChars = "0123456789ABCDEF" } = {}) => {
16
+ const { localStorageRequestId, urlRequestId, urlToken } = usePasswordlessParams();
17
+ const activateOtp = useActivatePasswordlessOtpMutation.useActivatePasswordlessOtpMutation();
18
+ const [state, setState] = React.useState(() => {
19
+ if (urlRequestId && urlToken) {
20
+ if (localStorageRequestId !== urlRequestId) {
21
+ return { type: "otp_activating" };
22
+ } else {
23
+ return { type: "can_proceed_to_login" };
24
+ }
25
+ }
26
+ return { type: "empty" };
27
+ });
28
+ React.useEffect(() => {
29
+ (async () => {
30
+ if (state.type === "otp_activating") {
31
+ const otpCode = randomInt.randomString(otpLength, otpChars);
32
+ try {
33
+ const result = await activateOtp({
34
+ requestId: urlRequestId,
35
+ token: urlToken,
36
+ otpHash: await hashing.calculateHash("SHA-256", otpCode)
37
+ });
38
+ if (!result.ok) {
39
+ setState({ type: "otp_activation_failed", error: result.error });
40
+ } else {
41
+ setState({ type: "otp_activated", otp: otpCode });
42
+ }
43
+ } catch (e) {
44
+ console.error(e);
45
+ setState({ type: "otp_activation_failed", error: "UNKNOWN_ERROR" });
46
+ }
47
+ }
48
+ })();
49
+ }, [activateOtp, localStorageRequestId, otpChars, otpLength, state.type, urlRequestId, urlToken]);
50
+ return state;
51
+ };
52
+ exports.usePasswordlessOtpActivator = usePasswordlessOtpActivator;
53
+ //# sourceMappingURL=usePasswordlessOtpActivator.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePasswordlessOtpActivator.cjs","sources":["../../../../../packages/react-client-tenant/src/hooks/usePasswordlessOtpActivator.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\nimport { PASSWORDLESS_REQUEST_STORAGE_KEY } from '../consts'\nimport { useActivatePasswordlessOtpMutation } from './mutations'\nimport { randomString } from '../internal/utils/randomInt'\nimport { calculateHash } from '../internal/utils/hashing'\nimport { ActivatePasswordlessOtpErrorCode } from '@contember/graphql-client-tenant'\n\nconst usePasswordlessParams = (): {localStorageRequestId: string | null; urlRequestId: string | null; urlToken: string | null} => {\n\tconst localStorageValue = localStorage.getItem(PASSWORDLESS_REQUEST_STORAGE_KEY) ?? null\n\tconst urlParams = new URLSearchParams(window.location.search)\n\tconst requestId = urlParams.get('request_id')\n\tconst token = urlParams.get('token')\n\n\treturn { localStorageRequestId: localStorageValue, urlRequestId: requestId, urlToken: token }\n}\n\nexport type PasswordlessResponseHandlerState =\n\t| { type: 'empty' }\n\t| { type: 'otp_activating' }\n\t| { type: 'otp_activated'; otp: string }\n\t| { type: 'otp_activation_failed'; error: ActivatePasswordlessOtpErrorCode | 'UNKNOWN_ERROR'}\n\t| { type: 'can_proceed_to_login' }\n\nexport const usePasswordlessOtpActivator = ({ otpLength = 6, otpChars = '0123456789ABCDEF' }: {\n\totpLength?: number\n\totpChars?: string\n} = {}) => {\n\tconst { localStorageRequestId, urlRequestId, urlToken } = usePasswordlessParams()\n\tconst activateOtp = useActivatePasswordlessOtpMutation()\n\n\tconst [state, setState] = useState<PasswordlessResponseHandlerState>(() => {\n\t\tif (urlRequestId && urlToken) {\n\t\t\tif (localStorageRequestId !== urlRequestId) {\n\t\t\t\treturn { type: 'otp_activating' }\n\t\t\t} else {\n\t\t\t\treturn { type: 'can_proceed_to_login' }\n\t\t\t}\n\t\t}\n\t\treturn { type: 'empty' }\n\t})\n\n\tuseEffect(() => {\n\t\t(async () => {\n\t\t\tif (state.type === 'otp_activating') {\n\t\t\t\tconst otpCode = randomString(otpLength, otpChars)\n\t\t\t\ttry {\n\t\t\t\t\tconst result = await activateOtp({\n\t\t\t\t\t\trequestId: urlRequestId!,\n\t\t\t\t\t\ttoken: urlToken!,\n\t\t\t\t\t\totpHash: await calculateHash('SHA-256', otpCode),\n\t\t\t\t\t})\n\t\t\t\t\tif (!result.ok) {\n\t\t\t\t\t\tsetState({ type: 'otp_activation_failed', error: result.error })\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetState({ type: 'otp_activated', otp: otpCode })\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {\n\t\t\t\t\tconsole.error(e)\n\t\t\t\t\tsetState({ type: 'otp_activation_failed', error: 'UNKNOWN_ERROR' })\n\t\t\t\t}\n\t\t\t}\n\t\t})()\n\t}, [activateOtp, localStorageRequestId, otpChars, otpLength, state.type, urlRequestId, urlToken])\n\n\treturn state\n}\n"],"names":["PASSWORDLESS_REQUEST_STORAGE_KEY","useActivatePasswordlessOtpMutation","useState","useEffect","randomString","calculateHash"],"mappings":";;;;;;;AAOA,MAAM,wBAAwB,MAAoG;AACjI,QAAM,oBAAoB,aAAa,QAAQA,OAAAA,gCAAgC,KAAK;AACpF,QAAM,YAAY,IAAI,gBAAgB,OAAO,SAAS,MAAM;AACtD,QAAA,YAAY,UAAU,IAAI,YAAY;AACtC,QAAA,QAAQ,UAAU,IAAI,OAAO;AAEnC,SAAO,EAAE,uBAAuB,mBAAmB,cAAc,WAAW,UAAU,MAAM;AAC7F;AASa,MAAA,8BAA8B,CAAC,EAAE,YAAY,GAAG,WAAW,mBAGpE,IAAA,OAAO;AACV,QAAM,EAAE,uBAAuB,cAAc,SAAA,IAAa,sBAAsB;AAChF,QAAM,cAAcC,mCAAAA,mCAAmC;AAEvD,QAAM,CAAC,OAAO,QAAQ,IAAIC,eAA2C,MAAM;AAC1E,QAAI,gBAAgB,UAAU;AAC7B,UAAI,0BAA0B,cAAc;AACpC,eAAA,EAAE,MAAM,iBAAiB;AAAA,MAAA,OAC1B;AACC,eAAA,EAAE,MAAM,uBAAuB;AAAA,MAAA;AAAA,IACvC;AAEM,WAAA,EAAE,MAAM,QAAQ;AAAA,EAAA,CACvB;AAEDC,QAAAA,UAAU,MAAM;AACf,KAAC,YAAY;AACR,UAAA,MAAM,SAAS,kBAAkB;AAC9B,cAAA,UAAUC,UAAAA,aAAa,WAAW,QAAQ;AAC5C,YAAA;AACG,gBAAA,SAAS,MAAM,YAAY;AAAA,YAChC,WAAW;AAAA,YACX,OAAO;AAAA,YACP,SAAS,MAAMC,sBAAc,WAAW,OAAO;AAAA,UAAA,CAC/C;AACG,cAAA,CAAC,OAAO,IAAI;AACf,qBAAS,EAAE,MAAM,yBAAyB,OAAO,OAAO,OAAO;AAAA,UAAA,OACzD;AACN,qBAAS,EAAE,MAAM,iBAAiB,KAAK,SAAS;AAAA,UAAA;AAAA,iBAEzC,GAAG;AACX,kBAAQ,MAAM,CAAC;AACf,mBAAS,EAAE,MAAM,yBAAyB,OAAO,iBAAiB;AAAA,QAAA;AAAA,MACnE;AAAA,IACD,GACE;AAAA,EAAA,GACD,CAAC,aAAa,uBAAuB,UAAU,WAAW,MAAM,MAAM,cAAc,QAAQ,CAAC;AAEzF,SAAA;AACR;;"}
@@ -0,0 +1,53 @@
1
+ import { useState, useEffect } from "react";
2
+ import { PASSWORDLESS_REQUEST_STORAGE_KEY } from "../consts.js";
3
+ import { randomString } from "../internal/utils/randomInt.js";
4
+ import { calculateHash } from "../internal/utils/hashing.js";
5
+ import { useActivatePasswordlessOtpMutation } from "./mutations/passwordless/useActivatePasswordlessOtpMutation.js";
6
+ const usePasswordlessParams = () => {
7
+ const localStorageValue = localStorage.getItem(PASSWORDLESS_REQUEST_STORAGE_KEY) ?? null;
8
+ const urlParams = new URLSearchParams(window.location.search);
9
+ const requestId = urlParams.get("request_id");
10
+ const token = urlParams.get("token");
11
+ return { localStorageRequestId: localStorageValue, urlRequestId: requestId, urlToken: token };
12
+ };
13
+ const usePasswordlessOtpActivator = ({ otpLength = 6, otpChars = "0123456789ABCDEF" } = {}) => {
14
+ const { localStorageRequestId, urlRequestId, urlToken } = usePasswordlessParams();
15
+ const activateOtp = useActivatePasswordlessOtpMutation();
16
+ const [state, setState] = useState(() => {
17
+ if (urlRequestId && urlToken) {
18
+ if (localStorageRequestId !== urlRequestId) {
19
+ return { type: "otp_activating" };
20
+ } else {
21
+ return { type: "can_proceed_to_login" };
22
+ }
23
+ }
24
+ return { type: "empty" };
25
+ });
26
+ useEffect(() => {
27
+ (async () => {
28
+ if (state.type === "otp_activating") {
29
+ const otpCode = randomString(otpLength, otpChars);
30
+ try {
31
+ const result = await activateOtp({
32
+ requestId: urlRequestId,
33
+ token: urlToken,
34
+ otpHash: await calculateHash("SHA-256", otpCode)
35
+ });
36
+ if (!result.ok) {
37
+ setState({ type: "otp_activation_failed", error: result.error });
38
+ } else {
39
+ setState({ type: "otp_activated", otp: otpCode });
40
+ }
41
+ } catch (e) {
42
+ console.error(e);
43
+ setState({ type: "otp_activation_failed", error: "UNKNOWN_ERROR" });
44
+ }
45
+ }
46
+ })();
47
+ }, [activateOtp, localStorageRequestId, otpChars, otpLength, state.type, urlRequestId, urlToken]);
48
+ return state;
49
+ };
50
+ export {
51
+ usePasswordlessOtpActivator
52
+ };
53
+ //# sourceMappingURL=usePasswordlessOtpActivator.js.map