@contember/react-client-tenant 1.3.0-alpha.26 → 1.3.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (679) hide show
  1. package/dist/development/components/IdentityProvider.cjs +38 -0
  2. package/dist/development/components/IdentityProvider.cjs.map +1 -0
  3. package/dist/development/components/IdentityProvider.js +38 -0
  4. package/dist/development/components/IdentityProvider.js.map +1 -0
  5. package/dist/development/components/IdentityState.cjs +14 -0
  6. package/dist/development/components/IdentityState.cjs.map +1 -0
  7. package/dist/development/components/IdentityState.js +14 -0
  8. package/dist/development/components/IdentityState.js.map +1 -0
  9. package/dist/development/components/forms/ChangeMyPasswordForm.cjs +59 -0
  10. package/dist/development/components/forms/ChangeMyPasswordForm.cjs.map +1 -0
  11. package/dist/development/components/forms/ChangeMyPasswordForm.js +59 -0
  12. package/dist/development/components/forms/ChangeMyPasswordForm.js.map +1 -0
  13. package/dist/development/components/forms/CreateApiKeyForm.cjs +57 -0
  14. package/dist/development/components/forms/CreateApiKeyForm.cjs.map +1 -0
  15. package/dist/development/components/forms/CreateApiKeyForm.js +57 -0
  16. package/dist/development/components/forms/CreateApiKeyForm.js.map +1 -0
  17. package/dist/development/components/forms/CreateSessionTokenForm.cjs +50 -0
  18. package/dist/development/components/forms/CreateSessionTokenForm.cjs.map +1 -0
  19. package/dist/development/components/forms/CreateSessionTokenForm.js +50 -0
  20. package/dist/development/components/forms/CreateSessionTokenForm.js.map +1 -0
  21. package/dist/development/components/forms/InviteForm.cjs +62 -0
  22. package/dist/development/components/forms/InviteForm.cjs.map +1 -0
  23. package/dist/development/components/forms/InviteForm.js +62 -0
  24. package/dist/development/components/forms/InviteForm.js.map +1 -0
  25. package/dist/development/components/forms/LoginForm.cjs +85 -0
  26. package/dist/development/components/forms/LoginForm.cjs.map +1 -0
  27. package/dist/development/components/forms/LoginForm.js +85 -0
  28. package/dist/development/components/forms/LoginForm.js.map +1 -0
  29. package/dist/development/components/forms/OtpConfirmForm.cjs +49 -0
  30. package/dist/development/components/forms/OtpConfirmForm.cjs.map +1 -0
  31. package/dist/development/components/forms/OtpConfirmForm.js +49 -0
  32. package/dist/development/components/forms/OtpConfirmForm.js.map +1 -0
  33. package/dist/development/components/forms/OtpPrepareForm.cjs +36 -0
  34. package/dist/development/components/forms/OtpPrepareForm.cjs.map +1 -0
  35. package/dist/development/components/forms/OtpPrepareForm.js +36 -0
  36. package/dist/development/components/forms/OtpPrepareForm.js.map +1 -0
  37. package/dist/development/components/forms/PasswordResetForm.cjs +62 -0
  38. package/dist/development/components/forms/PasswordResetForm.cjs.map +1 -0
  39. package/dist/development/components/forms/PasswordResetForm.js +62 -0
  40. package/dist/development/components/forms/PasswordResetForm.js.map +1 -0
  41. package/dist/development/components/forms/PasswordResetRequestForm.cjs +49 -0
  42. package/dist/development/components/forms/PasswordResetRequestForm.cjs.map +1 -0
  43. package/dist/development/components/forms/PasswordResetRequestForm.js +49 -0
  44. package/dist/development/components/forms/PasswordResetRequestForm.js.map +1 -0
  45. package/dist/development/components/forms/TenantForm.cjs +91 -0
  46. package/dist/development/components/forms/TenantForm.cjs.map +1 -0
  47. package/dist/development/components/forms/TenantForm.js +91 -0
  48. package/dist/development/components/forms/TenantForm.js.map +1 -0
  49. package/dist/development/components/forms/UpdateProjectMemberForm.cjs +64 -0
  50. package/dist/development/components/forms/UpdateProjectMemberForm.cjs.map +1 -0
  51. package/dist/development/components/forms/UpdateProjectMemberForm.js +64 -0
  52. package/dist/development/components/forms/UpdateProjectMemberForm.js.map +1 -0
  53. package/dist/development/components/idp/IDP.cjs +56 -0
  54. package/dist/development/components/idp/IDP.cjs.map +1 -0
  55. package/dist/development/components/idp/IDP.js +56 -0
  56. package/dist/development/components/idp/IDP.js.map +1 -0
  57. package/dist/development/components/idp/IDPInitTrigger.cjs +16 -0
  58. package/dist/development/components/idp/IDPInitTrigger.cjs.map +1 -0
  59. package/dist/development/components/idp/IDPInitTrigger.js +16 -0
  60. package/dist/development/components/idp/IDPInitTrigger.js.map +1 -0
  61. package/dist/development/components/idp/IDPState.cjs +14 -0
  62. package/dist/development/components/idp/IDPState.cjs.map +1 -0
  63. package/dist/development/components/idp/IDPState.js +14 -0
  64. package/dist/development/components/idp/IDPState.js.map +1 -0
  65. package/dist/development/components/triggers/DisableOtpTrigger.cjs +32 -0
  66. package/dist/development/components/triggers/DisableOtpTrigger.cjs.map +1 -0
  67. package/dist/development/components/triggers/DisableOtpTrigger.js +32 -0
  68. package/dist/development/components/triggers/DisableOtpTrigger.js.map +1 -0
  69. package/dist/development/components/triggers/LogoutTrigger.cjs +16 -0
  70. package/dist/development/components/triggers/LogoutTrigger.cjs.map +1 -0
  71. package/dist/development/components/triggers/LogoutTrigger.js +16 -0
  72. package/dist/development/components/triggers/LogoutTrigger.js.map +1 -0
  73. package/dist/development/components/triggers/RemoveProjectMemberTrigger.cjs +17 -0
  74. package/dist/development/components/triggers/RemoveProjectMemberTrigger.cjs.map +1 -0
  75. package/dist/development/components/triggers/RemoveProjectMemberTrigger.js +17 -0
  76. package/dist/development/components/triggers/RemoveProjectMemberTrigger.js.map +1 -0
  77. package/dist/development/components/triggers/TenantActionTrigger.cjs +37 -0
  78. package/dist/development/components/triggers/TenantActionTrigger.cjs.map +1 -0
  79. package/dist/development/components/triggers/TenantActionTrigger.js +37 -0
  80. package/dist/development/components/triggers/TenantActionTrigger.js.map +1 -0
  81. package/dist/development/contexts.cjs +34 -0
  82. package/dist/development/contexts.cjs.map +1 -0
  83. package/dist/development/contexts.js +34 -0
  84. package/dist/development/contexts.js.map +1 -0
  85. package/dist/development/hooks/mutations/apiKey/useCreateApiKeyMutation.cjs +30 -0
  86. package/dist/development/hooks/mutations/apiKey/useCreateApiKeyMutation.cjs.map +1 -0
  87. package/dist/development/hooks/mutations/apiKey/useCreateApiKeyMutation.js +13 -0
  88. package/dist/development/hooks/mutations/apiKey/useCreateApiKeyMutation.js.map +1 -0
  89. package/dist/development/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.cjs +30 -0
  90. package/dist/development/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.cjs.map +1 -0
  91. package/dist/development/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.js +13 -0
  92. package/dist/development/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.js.map +1 -0
  93. package/dist/development/hooks/mutations/apiKey/useCreateSessionTokenMutation.cjs +30 -0
  94. package/dist/development/hooks/mutations/apiKey/useCreateSessionTokenMutation.cjs.map +1 -0
  95. package/dist/development/hooks/mutations/apiKey/useCreateSessionTokenMutation.js +13 -0
  96. package/dist/development/hooks/mutations/apiKey/useCreateSessionTokenMutation.js.map +1 -0
  97. package/dist/development/hooks/mutations/apiKey/useDisableApiKeyMutation.cjs +29 -0
  98. package/dist/development/hooks/mutations/apiKey/useDisableApiKeyMutation.cjs.map +1 -0
  99. package/dist/development/hooks/mutations/apiKey/useDisableApiKeyMutation.js +12 -0
  100. package/dist/development/hooks/mutations/apiKey/useDisableApiKeyMutation.js.map +1 -0
  101. package/dist/development/hooks/mutations/auth/useChangeMyPasswordMutation.cjs +29 -0
  102. package/dist/development/hooks/mutations/auth/useChangeMyPasswordMutation.cjs.map +1 -0
  103. package/dist/development/hooks/mutations/auth/useChangeMyPasswordMutation.js +12 -0
  104. package/dist/development/hooks/mutations/auth/useChangeMyPasswordMutation.js.map +1 -0
  105. package/dist/development/hooks/mutations/auth/useSignInMutation.cjs +33 -0
  106. package/dist/development/hooks/mutations/auth/useSignInMutation.cjs.map +1 -0
  107. package/dist/development/hooks/mutations/auth/useSignInMutation.js +16 -0
  108. package/dist/development/hooks/mutations/auth/useSignInMutation.js.map +1 -0
  109. package/dist/development/hooks/mutations/auth/useSignOutMutation.cjs +29 -0
  110. package/dist/development/hooks/mutations/auth/useSignOutMutation.cjs.map +1 -0
  111. package/dist/development/hooks/mutations/auth/useSignOutMutation.js +12 -0
  112. package/dist/development/hooks/mutations/auth/useSignOutMutation.js.map +1 -0
  113. package/dist/development/hooks/mutations/idp/useInitSignInIDPMutation.cjs +31 -0
  114. package/dist/development/hooks/mutations/idp/useInitSignInIDPMutation.cjs.map +1 -0
  115. package/dist/development/hooks/mutations/idp/useInitSignInIDPMutation.js +14 -0
  116. package/dist/development/hooks/mutations/idp/useInitSignInIDPMutation.js.map +1 -0
  117. package/dist/development/hooks/mutations/idp/useSignInIdpMutation.cjs +33 -0
  118. package/dist/development/hooks/mutations/idp/useSignInIdpMutation.cjs.map +1 -0
  119. package/dist/development/hooks/mutations/idp/useSignInIdpMutation.js +16 -0
  120. package/dist/development/hooks/mutations/idp/useSignInIdpMutation.js.map +1 -0
  121. package/dist/development/hooks/mutations/invite/useInviteMutation.cjs +30 -0
  122. package/dist/development/hooks/mutations/invite/useInviteMutation.cjs.map +1 -0
  123. package/dist/development/hooks/mutations/invite/useInviteMutation.js +13 -0
  124. package/dist/development/hooks/mutations/invite/useInviteMutation.js.map +1 -0
  125. package/dist/development/hooks/mutations/memberships/useAddProjectMemberMutation.cjs +29 -0
  126. package/dist/development/hooks/mutations/memberships/useAddProjectMemberMutation.cjs.map +1 -0
  127. package/dist/development/hooks/mutations/memberships/useAddProjectMemberMutation.js +12 -0
  128. package/dist/development/hooks/mutations/memberships/useAddProjectMemberMutation.js.map +1 -0
  129. package/dist/development/hooks/mutations/memberships/useRemoveProjectMemberMutation.cjs +29 -0
  130. package/dist/development/hooks/mutations/memberships/useRemoveProjectMemberMutation.cjs.map +1 -0
  131. package/dist/development/hooks/mutations/memberships/useRemoveProjectMemberMutation.js +12 -0
  132. package/dist/development/hooks/mutations/memberships/useRemoveProjectMemberMutation.js.map +1 -0
  133. package/dist/development/hooks/mutations/memberships/useUpdateProjectMemberMutation.cjs +29 -0
  134. package/dist/development/hooks/mutations/memberships/useUpdateProjectMemberMutation.cjs.map +1 -0
  135. package/dist/development/hooks/mutations/memberships/useUpdateProjectMemberMutation.js +12 -0
  136. package/dist/development/hooks/mutations/memberships/useUpdateProjectMemberMutation.js.map +1 -0
  137. package/dist/development/hooks/mutations/otp/useConfirmOtpMutation.cjs +29 -0
  138. package/dist/development/hooks/mutations/otp/useConfirmOtpMutation.cjs.map +1 -0
  139. package/dist/development/hooks/mutations/otp/useConfirmOtpMutation.js +12 -0
  140. package/dist/development/hooks/mutations/otp/useConfirmOtpMutation.js.map +1 -0
  141. package/dist/development/hooks/mutations/otp/useDisableOtpMutation.cjs +29 -0
  142. package/dist/development/hooks/mutations/otp/useDisableOtpMutation.cjs.map +1 -0
  143. package/dist/development/hooks/mutations/otp/useDisableOtpMutation.js +12 -0
  144. package/dist/development/hooks/mutations/otp/useDisableOtpMutation.js.map +1 -0
  145. package/dist/development/hooks/mutations/otp/usePrepareOtpMutation.cjs +30 -0
  146. package/dist/development/hooks/mutations/otp/usePrepareOtpMutation.cjs.map +1 -0
  147. package/dist/development/hooks/mutations/otp/usePrepareOtpMutation.js +13 -0
  148. package/dist/development/hooks/mutations/otp/usePrepareOtpMutation.js.map +1 -0
  149. package/dist/development/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.cjs +32 -0
  150. package/dist/development/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.cjs.map +1 -0
  151. package/dist/development/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.js +15 -0
  152. package/dist/development/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.js.map +1 -0
  153. package/dist/development/hooks/mutations/passwordReset/useResetPasswordMutation.cjs +32 -0
  154. package/dist/development/hooks/mutations/passwordReset/useResetPasswordMutation.cjs.map +1 -0
  155. package/dist/development/hooks/mutations/passwordReset/useResetPasswordMutation.js +15 -0
  156. package/dist/development/hooks/mutations/passwordReset/useResetPasswordMutation.js.map +1 -0
  157. package/dist/development/hooks/queries/useMeQuery.cjs +33 -0
  158. package/dist/development/hooks/queries/useMeQuery.cjs.map +1 -0
  159. package/dist/development/hooks/queries/useMeQuery.js +16 -0
  160. package/dist/development/hooks/queries/useMeQuery.js.map +1 -0
  161. package/dist/development/hooks/queries/useProjectMembersQuery.cjs +47 -0
  162. package/dist/development/hooks/queries/useProjectMembersQuery.cjs.map +1 -0
  163. package/dist/development/hooks/queries/useProjectMembersQuery.js +30 -0
  164. package/dist/development/hooks/queries/useProjectMembersQuery.js.map +1 -0
  165. package/dist/development/hooks/queries/useProjectMembershipsQuery.cjs +34 -0
  166. package/dist/development/hooks/queries/useProjectMembershipsQuery.cjs.map +1 -0
  167. package/dist/development/hooks/queries/useProjectMembershipsQuery.js +17 -0
  168. package/dist/development/hooks/queries/useProjectMembershipsQuery.js.map +1 -0
  169. package/dist/development/hooks/queries/useProjectRolesDefinitionQuery.cjs +36 -0
  170. package/dist/development/hooks/queries/useProjectRolesDefinitionQuery.cjs.map +1 -0
  171. package/dist/development/hooks/queries/useProjectRolesDefinitionQuery.js +19 -0
  172. package/dist/development/hooks/queries/useProjectRolesDefinitionQuery.js.map +1 -0
  173. package/dist/development/hooks/useFetchIdentity.cjs +52 -0
  174. package/dist/development/hooks/useFetchIdentity.cjs.map +1 -0
  175. package/dist/development/hooks/useFetchIdentity.js +52 -0
  176. package/dist/development/hooks/useFetchIdentity.js.map +1 -0
  177. package/dist/development/hooks/useLogout.cjs +10 -0
  178. package/dist/development/hooks/useLogout.cjs.map +1 -0
  179. package/dist/development/hooks/useLogout.js +10 -0
  180. package/dist/development/hooks/useLogout.js.map +1 -0
  181. package/dist/development/hooks/useTenantApi.cjs +11 -4
  182. package/dist/development/hooks/useTenantApi.cjs.map +1 -1
  183. package/dist/development/hooks/useTenantApi.js +12 -5
  184. package/dist/development/hooks/useTenantApi.js.map +1 -1
  185. package/dist/development/hooks/useTenantMutation.cjs +33 -0
  186. package/dist/development/hooks/useTenantMutation.cjs.map +1 -0
  187. package/dist/development/hooks/useTenantMutation.js +33 -0
  188. package/dist/development/hooks/useTenantMutation.js.map +1 -0
  189. package/dist/development/hooks/useTenantQueryLoader.cjs +36 -0
  190. package/dist/development/hooks/useTenantQueryLoader.cjs.map +1 -0
  191. package/dist/development/hooks/useTenantQueryLoader.js +36 -0
  192. package/dist/development/hooks/useTenantQueryLoader.js.map +1 -0
  193. package/dist/development/index.cjs +130 -0
  194. package/dist/development/index.cjs.map +1 -1
  195. package/dist/development/index.js +132 -2
  196. package/dist/development/index.js.map +1 -1
  197. package/dist/development/internal/hooks/useHandleIDPResponse.cjs +51 -0
  198. package/dist/development/internal/hooks/useHandleIDPResponse.cjs.map +1 -0
  199. package/dist/development/internal/hooks/useHandleIDPResponse.js +51 -0
  200. package/dist/development/internal/hooks/useHandleIDPResponse.js.map +1 -0
  201. package/dist/development/internal/hooks/useIDPAutoInit.cjs +19 -0
  202. package/dist/development/internal/hooks/useIDPAutoInit.cjs.map +1 -0
  203. package/dist/development/internal/hooks/useIDPAutoInit.js +19 -0
  204. package/dist/development/internal/hooks/useIDPAutoInit.js.map +1 -0
  205. package/dist/development/internal/hooks/useIDPStateStore.cjs +19 -0
  206. package/dist/development/internal/hooks/useIDPStateStore.cjs.map +1 -0
  207. package/dist/development/internal/hooks/useIDPStateStore.js +19 -0
  208. package/dist/development/internal/hooks/useIDPStateStore.js.map +1 -0
  209. package/dist/development/internal/hooks/useInitIDPRedirect.cjs +44 -0
  210. package/dist/development/internal/hooks/useInitIDPRedirect.cjs.map +1 -0
  211. package/dist/development/internal/hooks/useInitIDPRedirect.js +44 -0
  212. package/dist/development/internal/hooks/useInitIDPRedirect.js.map +1 -0
  213. package/dist/development/internal/hooks/useLogoutInternal.cjs +35 -0
  214. package/dist/development/internal/hooks/useLogoutInternal.cjs.map +1 -0
  215. package/dist/development/internal/hooks/useLogoutInternal.js +35 -0
  216. package/dist/development/internal/hooks/useLogoutInternal.js.map +1 -0
  217. package/dist/development/internal/hooks/useRedirectToBacklink.cjs +31 -0
  218. package/dist/development/internal/hooks/useRedirectToBacklink.cjs.map +1 -0
  219. package/dist/development/internal/hooks/useRedirectToBacklink.js +31 -0
  220. package/dist/development/internal/hooks/useRedirectToBacklink.js.map +1 -0
  221. package/dist/development/internal/utils/getBaseHref.cjs +8 -0
  222. package/dist/development/internal/utils/getBaseHref.cjs.map +1 -0
  223. package/dist/development/internal/utils/getBaseHref.js +8 -0
  224. package/dist/development/internal/utils/getBaseHref.js.map +1 -0
  225. package/dist/production/components/IdentityProvider.cjs +26 -0
  226. package/dist/production/components/IdentityProvider.cjs.map +1 -0
  227. package/dist/production/components/IdentityProvider.js +26 -0
  228. package/dist/production/components/IdentityProvider.js.map +1 -0
  229. package/dist/production/components/IdentityState.cjs +10 -0
  230. package/dist/production/components/IdentityState.cjs.map +1 -0
  231. package/dist/production/components/IdentityState.js +10 -0
  232. package/dist/production/components/IdentityState.js.map +1 -0
  233. package/dist/production/components/forms/ChangeMyPasswordForm.cjs +51 -0
  234. package/dist/production/components/forms/ChangeMyPasswordForm.cjs.map +1 -0
  235. package/dist/production/components/forms/ChangeMyPasswordForm.js +51 -0
  236. package/dist/production/components/forms/ChangeMyPasswordForm.js.map +1 -0
  237. package/dist/production/components/forms/CreateApiKeyForm.cjs +49 -0
  238. package/dist/production/components/forms/CreateApiKeyForm.cjs.map +1 -0
  239. package/dist/production/components/forms/CreateApiKeyForm.js +49 -0
  240. package/dist/production/components/forms/CreateApiKeyForm.js.map +1 -0
  241. package/dist/production/components/forms/CreateSessionTokenForm.cjs +42 -0
  242. package/dist/production/components/forms/CreateSessionTokenForm.cjs.map +1 -0
  243. package/dist/production/components/forms/CreateSessionTokenForm.js +42 -0
  244. package/dist/production/components/forms/CreateSessionTokenForm.js.map +1 -0
  245. package/dist/production/components/forms/InviteForm.cjs +54 -0
  246. package/dist/production/components/forms/InviteForm.cjs.map +1 -0
  247. package/dist/production/components/forms/InviteForm.js +54 -0
  248. package/dist/production/components/forms/InviteForm.js.map +1 -0
  249. package/dist/production/components/forms/LoginForm.cjs +77 -0
  250. package/dist/production/components/forms/LoginForm.cjs.map +1 -0
  251. package/dist/production/components/forms/LoginForm.js +77 -0
  252. package/dist/production/components/forms/LoginForm.js.map +1 -0
  253. package/dist/production/components/forms/OtpConfirmForm.cjs +41 -0
  254. package/dist/production/components/forms/OtpConfirmForm.cjs.map +1 -0
  255. package/dist/production/components/forms/OtpConfirmForm.js +41 -0
  256. package/dist/production/components/forms/OtpConfirmForm.js.map +1 -0
  257. package/dist/production/components/forms/OtpPrepareForm.cjs +28 -0
  258. package/dist/production/components/forms/OtpPrepareForm.cjs.map +1 -0
  259. package/dist/production/components/forms/OtpPrepareForm.js +28 -0
  260. package/dist/production/components/forms/OtpPrepareForm.js.map +1 -0
  261. package/dist/production/components/forms/PasswordResetForm.cjs +54 -0
  262. package/dist/production/components/forms/PasswordResetForm.cjs.map +1 -0
  263. package/dist/production/components/forms/PasswordResetForm.js +54 -0
  264. package/dist/production/components/forms/PasswordResetForm.js.map +1 -0
  265. package/dist/production/components/forms/PasswordResetRequestForm.cjs +41 -0
  266. package/dist/production/components/forms/PasswordResetRequestForm.cjs.map +1 -0
  267. package/dist/production/components/forms/PasswordResetRequestForm.js +41 -0
  268. package/dist/production/components/forms/PasswordResetRequestForm.js.map +1 -0
  269. package/dist/production/components/forms/TenantForm.cjs +83 -0
  270. package/dist/production/components/forms/TenantForm.cjs.map +1 -0
  271. package/dist/production/components/forms/TenantForm.js +83 -0
  272. package/dist/production/components/forms/TenantForm.js.map +1 -0
  273. package/dist/production/components/forms/UpdateProjectMemberForm.cjs +56 -0
  274. package/dist/production/components/forms/UpdateProjectMemberForm.cjs.map +1 -0
  275. package/dist/production/components/forms/UpdateProjectMemberForm.js +56 -0
  276. package/dist/production/components/forms/UpdateProjectMemberForm.js.map +1 -0
  277. package/dist/production/components/idp/IDP.cjs +48 -0
  278. package/dist/production/components/idp/IDP.cjs.map +1 -0
  279. package/dist/production/components/idp/IDP.js +48 -0
  280. package/dist/production/components/idp/IDP.js.map +1 -0
  281. package/dist/production/components/idp/IDPInitTrigger.cjs +12 -0
  282. package/dist/production/components/idp/IDPInitTrigger.cjs.map +1 -0
  283. package/dist/production/components/idp/IDPInitTrigger.js +12 -0
  284. package/dist/production/components/idp/IDPInitTrigger.js.map +1 -0
  285. package/dist/production/components/idp/IDPState.cjs +10 -0
  286. package/dist/production/components/idp/IDPState.cjs.map +1 -0
  287. package/dist/production/components/idp/IDPState.js +10 -0
  288. package/dist/production/components/idp/IDPState.js.map +1 -0
  289. package/dist/production/components/triggers/DisableOtpTrigger.cjs +24 -0
  290. package/dist/production/components/triggers/DisableOtpTrigger.cjs.map +1 -0
  291. package/dist/production/components/triggers/DisableOtpTrigger.js +24 -0
  292. package/dist/production/components/triggers/DisableOtpTrigger.js.map +1 -0
  293. package/dist/production/components/triggers/LogoutTrigger.cjs +12 -0
  294. package/dist/production/components/triggers/LogoutTrigger.cjs.map +1 -0
  295. package/dist/production/components/triggers/LogoutTrigger.js +12 -0
  296. package/dist/production/components/triggers/LogoutTrigger.js.map +1 -0
  297. package/dist/production/components/triggers/RemoveProjectMemberTrigger.cjs +13 -0
  298. package/dist/production/components/triggers/RemoveProjectMemberTrigger.cjs.map +1 -0
  299. package/dist/production/components/triggers/RemoveProjectMemberTrigger.js +13 -0
  300. package/dist/production/components/triggers/RemoveProjectMemberTrigger.js.map +1 -0
  301. package/dist/production/components/triggers/TenantActionTrigger.cjs +33 -0
  302. package/dist/production/components/triggers/TenantActionTrigger.cjs.map +1 -0
  303. package/dist/production/components/triggers/TenantActionTrigger.js +33 -0
  304. package/dist/production/components/triggers/TenantActionTrigger.js.map +1 -0
  305. package/dist/production/contexts.cjs +34 -0
  306. package/dist/production/contexts.cjs.map +1 -0
  307. package/dist/production/contexts.js +34 -0
  308. package/dist/production/contexts.js.map +1 -0
  309. package/dist/production/hooks/mutations/apiKey/useCreateApiKeyMutation.cjs +30 -0
  310. package/dist/production/hooks/mutations/apiKey/useCreateApiKeyMutation.cjs.map +1 -0
  311. package/dist/production/hooks/mutations/apiKey/useCreateApiKeyMutation.js +13 -0
  312. package/dist/production/hooks/mutations/apiKey/useCreateApiKeyMutation.js.map +1 -0
  313. package/dist/production/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.cjs +30 -0
  314. package/dist/production/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.cjs.map +1 -0
  315. package/dist/production/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.js +13 -0
  316. package/dist/production/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.js.map +1 -0
  317. package/dist/production/hooks/mutations/apiKey/useCreateSessionTokenMutation.cjs +30 -0
  318. package/dist/production/hooks/mutations/apiKey/useCreateSessionTokenMutation.cjs.map +1 -0
  319. package/dist/production/hooks/mutations/apiKey/useCreateSessionTokenMutation.js +13 -0
  320. package/dist/production/hooks/mutations/apiKey/useCreateSessionTokenMutation.js.map +1 -0
  321. package/dist/production/hooks/mutations/apiKey/useDisableApiKeyMutation.cjs +29 -0
  322. package/dist/production/hooks/mutations/apiKey/useDisableApiKeyMutation.cjs.map +1 -0
  323. package/dist/production/hooks/mutations/apiKey/useDisableApiKeyMutation.js +12 -0
  324. package/dist/production/hooks/mutations/apiKey/useDisableApiKeyMutation.js.map +1 -0
  325. package/dist/production/hooks/mutations/auth/useChangeMyPasswordMutation.cjs +29 -0
  326. package/dist/production/hooks/mutations/auth/useChangeMyPasswordMutation.cjs.map +1 -0
  327. package/dist/production/hooks/mutations/auth/useChangeMyPasswordMutation.js +12 -0
  328. package/dist/production/hooks/mutations/auth/useChangeMyPasswordMutation.js.map +1 -0
  329. package/dist/production/hooks/mutations/auth/useSignInMutation.cjs +33 -0
  330. package/dist/production/hooks/mutations/auth/useSignInMutation.cjs.map +1 -0
  331. package/dist/production/hooks/mutations/auth/useSignInMutation.js +16 -0
  332. package/dist/production/hooks/mutations/auth/useSignInMutation.js.map +1 -0
  333. package/dist/production/hooks/mutations/auth/useSignOutMutation.cjs +29 -0
  334. package/dist/production/hooks/mutations/auth/useSignOutMutation.cjs.map +1 -0
  335. package/dist/production/hooks/mutations/auth/useSignOutMutation.js +12 -0
  336. package/dist/production/hooks/mutations/auth/useSignOutMutation.js.map +1 -0
  337. package/dist/production/hooks/mutations/idp/useInitSignInIDPMutation.cjs +31 -0
  338. package/dist/production/hooks/mutations/idp/useInitSignInIDPMutation.cjs.map +1 -0
  339. package/dist/production/hooks/mutations/idp/useInitSignInIDPMutation.js +14 -0
  340. package/dist/production/hooks/mutations/idp/useInitSignInIDPMutation.js.map +1 -0
  341. package/dist/production/hooks/mutations/idp/useSignInIdpMutation.cjs +33 -0
  342. package/dist/production/hooks/mutations/idp/useSignInIdpMutation.cjs.map +1 -0
  343. package/dist/production/hooks/mutations/idp/useSignInIdpMutation.js +16 -0
  344. package/dist/production/hooks/mutations/idp/useSignInIdpMutation.js.map +1 -0
  345. package/dist/production/hooks/mutations/invite/useInviteMutation.cjs +30 -0
  346. package/dist/production/hooks/mutations/invite/useInviteMutation.cjs.map +1 -0
  347. package/dist/production/hooks/mutations/invite/useInviteMutation.js +13 -0
  348. package/dist/production/hooks/mutations/invite/useInviteMutation.js.map +1 -0
  349. package/dist/production/hooks/mutations/memberships/useAddProjectMemberMutation.cjs +29 -0
  350. package/dist/production/hooks/mutations/memberships/useAddProjectMemberMutation.cjs.map +1 -0
  351. package/dist/production/hooks/mutations/memberships/useAddProjectMemberMutation.js +12 -0
  352. package/dist/production/hooks/mutations/memberships/useAddProjectMemberMutation.js.map +1 -0
  353. package/dist/production/hooks/mutations/memberships/useRemoveProjectMemberMutation.cjs +29 -0
  354. package/dist/production/hooks/mutations/memberships/useRemoveProjectMemberMutation.cjs.map +1 -0
  355. package/dist/production/hooks/mutations/memberships/useRemoveProjectMemberMutation.js +12 -0
  356. package/dist/production/hooks/mutations/memberships/useRemoveProjectMemberMutation.js.map +1 -0
  357. package/dist/production/hooks/mutations/memberships/useUpdateProjectMemberMutation.cjs +29 -0
  358. package/dist/production/hooks/mutations/memberships/useUpdateProjectMemberMutation.cjs.map +1 -0
  359. package/dist/production/hooks/mutations/memberships/useUpdateProjectMemberMutation.js +12 -0
  360. package/dist/production/hooks/mutations/memberships/useUpdateProjectMemberMutation.js.map +1 -0
  361. package/dist/production/hooks/mutations/otp/useConfirmOtpMutation.cjs +29 -0
  362. package/dist/production/hooks/mutations/otp/useConfirmOtpMutation.cjs.map +1 -0
  363. package/dist/production/hooks/mutations/otp/useConfirmOtpMutation.js +12 -0
  364. package/dist/production/hooks/mutations/otp/useConfirmOtpMutation.js.map +1 -0
  365. package/dist/production/hooks/mutations/otp/useDisableOtpMutation.cjs +29 -0
  366. package/dist/production/hooks/mutations/otp/useDisableOtpMutation.cjs.map +1 -0
  367. package/dist/production/hooks/mutations/otp/useDisableOtpMutation.js +12 -0
  368. package/dist/production/hooks/mutations/otp/useDisableOtpMutation.js.map +1 -0
  369. package/dist/production/hooks/mutations/otp/usePrepareOtpMutation.cjs +30 -0
  370. package/dist/production/hooks/mutations/otp/usePrepareOtpMutation.cjs.map +1 -0
  371. package/dist/production/hooks/mutations/otp/usePrepareOtpMutation.js +13 -0
  372. package/dist/production/hooks/mutations/otp/usePrepareOtpMutation.js.map +1 -0
  373. package/dist/production/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.cjs +32 -0
  374. package/dist/production/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.cjs.map +1 -0
  375. package/dist/production/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.js +15 -0
  376. package/dist/production/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.js.map +1 -0
  377. package/dist/production/hooks/mutations/passwordReset/useResetPasswordMutation.cjs +32 -0
  378. package/dist/production/hooks/mutations/passwordReset/useResetPasswordMutation.cjs.map +1 -0
  379. package/dist/production/hooks/mutations/passwordReset/useResetPasswordMutation.js +15 -0
  380. package/dist/production/hooks/mutations/passwordReset/useResetPasswordMutation.js.map +1 -0
  381. package/dist/production/hooks/queries/useMeQuery.cjs +33 -0
  382. package/dist/production/hooks/queries/useMeQuery.cjs.map +1 -0
  383. package/dist/production/hooks/queries/useMeQuery.js +16 -0
  384. package/dist/production/hooks/queries/useMeQuery.js.map +1 -0
  385. package/dist/production/hooks/queries/useProjectMembersQuery.cjs +47 -0
  386. package/dist/production/hooks/queries/useProjectMembersQuery.cjs.map +1 -0
  387. package/dist/production/hooks/queries/useProjectMembersQuery.js +30 -0
  388. package/dist/production/hooks/queries/useProjectMembersQuery.js.map +1 -0
  389. package/dist/production/hooks/queries/useProjectMembershipsQuery.cjs +34 -0
  390. package/dist/production/hooks/queries/useProjectMembershipsQuery.cjs.map +1 -0
  391. package/dist/production/hooks/queries/useProjectMembershipsQuery.js +17 -0
  392. package/dist/production/hooks/queries/useProjectMembershipsQuery.js.map +1 -0
  393. package/dist/production/hooks/queries/useProjectRolesDefinitionQuery.cjs +36 -0
  394. package/dist/production/hooks/queries/useProjectRolesDefinitionQuery.cjs.map +1 -0
  395. package/dist/production/hooks/queries/useProjectRolesDefinitionQuery.js +19 -0
  396. package/dist/production/hooks/queries/useProjectRolesDefinitionQuery.js.map +1 -0
  397. package/dist/production/hooks/useFetchIdentity.cjs +52 -0
  398. package/dist/production/hooks/useFetchIdentity.cjs.map +1 -0
  399. package/dist/production/hooks/useFetchIdentity.js +52 -0
  400. package/dist/production/hooks/useFetchIdentity.js.map +1 -0
  401. package/dist/production/hooks/useLogout.cjs +10 -0
  402. package/dist/production/hooks/useLogout.cjs.map +1 -0
  403. package/dist/production/hooks/useLogout.js +10 -0
  404. package/dist/production/hooks/useLogout.js.map +1 -0
  405. package/dist/production/hooks/useTenantApi.cjs +11 -4
  406. package/dist/production/hooks/useTenantApi.cjs.map +1 -1
  407. package/dist/production/hooks/useTenantApi.js +12 -5
  408. package/dist/production/hooks/useTenantApi.js.map +1 -1
  409. package/dist/production/hooks/useTenantMutation.cjs +33 -0
  410. package/dist/production/hooks/useTenantMutation.cjs.map +1 -0
  411. package/dist/production/hooks/useTenantMutation.js +33 -0
  412. package/dist/production/hooks/useTenantMutation.js.map +1 -0
  413. package/dist/production/hooks/useTenantQueryLoader.cjs +36 -0
  414. package/dist/production/hooks/useTenantQueryLoader.cjs.map +1 -0
  415. package/dist/production/hooks/useTenantQueryLoader.js +36 -0
  416. package/dist/production/hooks/useTenantQueryLoader.js.map +1 -0
  417. package/dist/production/index.cjs +130 -0
  418. package/dist/production/index.cjs.map +1 -1
  419. package/dist/production/index.js +132 -2
  420. package/dist/production/index.js.map +1 -1
  421. package/dist/production/internal/hooks/useHandleIDPResponse.cjs +51 -0
  422. package/dist/production/internal/hooks/useHandleIDPResponse.cjs.map +1 -0
  423. package/dist/production/internal/hooks/useHandleIDPResponse.js +51 -0
  424. package/dist/production/internal/hooks/useHandleIDPResponse.js.map +1 -0
  425. package/dist/production/internal/hooks/useIDPAutoInit.cjs +19 -0
  426. package/dist/production/internal/hooks/useIDPAutoInit.cjs.map +1 -0
  427. package/dist/production/internal/hooks/useIDPAutoInit.js +19 -0
  428. package/dist/production/internal/hooks/useIDPAutoInit.js.map +1 -0
  429. package/dist/production/internal/hooks/useIDPStateStore.cjs +19 -0
  430. package/dist/production/internal/hooks/useIDPStateStore.cjs.map +1 -0
  431. package/dist/production/internal/hooks/useIDPStateStore.js +19 -0
  432. package/dist/production/internal/hooks/useIDPStateStore.js.map +1 -0
  433. package/dist/production/internal/hooks/useInitIDPRedirect.cjs +44 -0
  434. package/dist/production/internal/hooks/useInitIDPRedirect.cjs.map +1 -0
  435. package/dist/production/internal/hooks/useInitIDPRedirect.js +44 -0
  436. package/dist/production/internal/hooks/useInitIDPRedirect.js.map +1 -0
  437. package/dist/production/internal/hooks/useLogoutInternal.cjs +35 -0
  438. package/dist/production/internal/hooks/useLogoutInternal.cjs.map +1 -0
  439. package/dist/production/internal/hooks/useLogoutInternal.js +35 -0
  440. package/dist/production/internal/hooks/useLogoutInternal.js.map +1 -0
  441. package/dist/production/internal/hooks/useRedirectToBacklink.cjs +31 -0
  442. package/dist/production/internal/hooks/useRedirectToBacklink.cjs.map +1 -0
  443. package/dist/production/internal/hooks/useRedirectToBacklink.js +31 -0
  444. package/dist/production/internal/hooks/useRedirectToBacklink.js.map +1 -0
  445. package/dist/production/internal/utils/getBaseHref.cjs +8 -0
  446. package/dist/production/internal/utils/getBaseHref.cjs.map +1 -0
  447. package/dist/production/internal/utils/getBaseHref.js +8 -0
  448. package/dist/production/internal/utils/getBaseHref.js.map +1 -0
  449. package/dist/types/components/IdentityProvider.d.ts +6 -0
  450. package/dist/types/components/IdentityProvider.d.ts.map +1 -0
  451. package/dist/types/components/IdentityState.d.ts +8 -0
  452. package/dist/types/components/IdentityState.d.ts.map +1 -0
  453. package/dist/types/components/forms/ChangeMyPasswordForm.d.ts +19 -0
  454. package/dist/types/components/forms/ChangeMyPasswordForm.d.ts.map +1 -0
  455. package/dist/types/components/forms/CreateApiKeyForm.d.ts +23 -0
  456. package/dist/types/components/forms/CreateApiKeyForm.d.ts.map +1 -0
  457. package/dist/types/components/forms/CreateSessionTokenForm.d.ts +22 -0
  458. package/dist/types/components/forms/CreateSessionTokenForm.d.ts.map +1 -0
  459. package/dist/types/components/forms/InviteForm.d.ts +25 -0
  460. package/dist/types/components/forms/InviteForm.d.ts.map +1 -0
  461. package/dist/types/components/forms/LoginForm.d.ts +20 -0
  462. package/dist/types/components/forms/LoginForm.d.ts.map +1 -0
  463. package/dist/types/components/forms/OtpConfirmForm.d.ts +17 -0
  464. package/dist/types/components/forms/OtpConfirmForm.d.ts.map +1 -0
  465. package/dist/types/components/forms/OtpPrepareForm.d.ts +19 -0
  466. package/dist/types/components/forms/OtpPrepareForm.d.ts.map +1 -0
  467. package/dist/types/components/forms/PasswordResetForm.d.ts +20 -0
  468. package/dist/types/components/forms/PasswordResetForm.d.ts.map +1 -0
  469. package/dist/types/components/forms/PasswordResetRequestForm.d.ts +17 -0
  470. package/dist/types/components/forms/PasswordResetRequestForm.d.ts.map +1 -0
  471. package/dist/types/components/forms/TenantForm.d.ts +37 -0
  472. package/dist/types/components/forms/TenantForm.d.ts.map +1 -0
  473. package/dist/types/components/forms/UpdateProjectMemberForm.d.ts +19 -0
  474. package/dist/types/components/forms/UpdateProjectMemberForm.d.ts.map +1 -0
  475. package/dist/types/components/forms/index.d.ts +11 -0
  476. package/dist/types/components/forms/index.d.ts.map +1 -0
  477. package/dist/types/components/idp/IDP.d.ts +10 -0
  478. package/dist/types/components/idp/IDP.d.ts.map +1 -0
  479. package/dist/types/components/idp/IDPInitTrigger.d.ts +7 -0
  480. package/dist/types/components/idp/IDPInitTrigger.d.ts.map +1 -0
  481. package/dist/types/components/idp/IDPState.d.ts +8 -0
  482. package/dist/types/components/idp/IDPState.d.ts.map +1 -0
  483. package/dist/types/components/idp/index.d.ts +4 -0
  484. package/dist/types/components/idp/index.d.ts.map +1 -0
  485. package/dist/types/components/index.d.ts +6 -0
  486. package/dist/types/components/index.d.ts.map +1 -0
  487. package/dist/types/components/triggers/DisableOtpTrigger.d.ts +8 -0
  488. package/dist/types/components/triggers/DisableOtpTrigger.d.ts.map +1 -0
  489. package/dist/types/components/triggers/LogoutTrigger.d.ts +5 -0
  490. package/dist/types/components/triggers/LogoutTrigger.d.ts.map +1 -0
  491. package/dist/types/components/triggers/RemoveProjectMemberTrigger.d.ts +9 -0
  492. package/dist/types/components/triggers/RemoveProjectMemberTrigger.d.ts.map +1 -0
  493. package/dist/types/components/triggers/TenantActionTrigger.d.ts +22 -0
  494. package/dist/types/components/triggers/TenantActionTrigger.d.ts.map +1 -0
  495. package/dist/types/components/triggers/index.d.ts +4 -0
  496. package/dist/types/components/triggers/index.d.ts.map +1 -0
  497. package/dist/types/contexts.d.ts +20 -0
  498. package/dist/types/contexts.d.ts.map +1 -0
  499. package/dist/types/hooks/index.d.ts +6 -0
  500. package/dist/types/hooks/index.d.ts.map +1 -1
  501. package/dist/types/hooks/mutations/apiKey/index.d.ts +5 -0
  502. package/dist/types/hooks/mutations/apiKey/index.d.ts.map +1 -0
  503. package/dist/types/hooks/mutations/apiKey/useCreateApiKeyMutation.d.ts +83 -0
  504. package/dist/types/hooks/mutations/apiKey/useCreateApiKeyMutation.d.ts.map +1 -0
  505. package/dist/types/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.d.ts +73 -0
  506. package/dist/types/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.d.ts.map +1 -0
  507. package/dist/types/hooks/mutations/apiKey/useCreateSessionTokenMutation.d.ts +65 -0
  508. package/dist/types/hooks/mutations/apiKey/useCreateSessionTokenMutation.d.ts.map +1 -0
  509. package/dist/types/hooks/mutations/apiKey/useDisableApiKeyMutation.d.ts +21 -0
  510. package/dist/types/hooks/mutations/apiKey/useDisableApiKeyMutation.d.ts.map +1 -0
  511. package/dist/types/hooks/mutations/auth/index.d.ts +4 -0
  512. package/dist/types/hooks/mutations/auth/index.d.ts.map +1 -0
  513. package/dist/types/hooks/mutations/auth/useChangeMyPasswordMutation.d.ts +21 -0
  514. package/dist/types/hooks/mutations/auth/useChangeMyPasswordMutation.d.ts.map +1 -0
  515. package/dist/types/hooks/mutations/auth/useSignInMutation.d.ts +69 -0
  516. package/dist/types/hooks/mutations/auth/useSignInMutation.d.ts.map +1 -0
  517. package/dist/types/hooks/mutations/auth/useSignOutMutation.d.ts +21 -0
  518. package/dist/types/hooks/mutations/auth/useSignOutMutation.d.ts.map +1 -0
  519. package/dist/types/hooks/mutations/idp/index.d.ts +3 -0
  520. package/dist/types/hooks/mutations/idp/index.d.ts.map +1 -0
  521. package/dist/types/hooks/mutations/idp/useInitSignInIDPMutation.d.ts +17 -0
  522. package/dist/types/hooks/mutations/idp/useInitSignInIDPMutation.d.ts.map +1 -0
  523. package/dist/types/hooks/mutations/idp/useSignInIdpMutation.d.ts +76 -0
  524. package/dist/types/hooks/mutations/idp/useSignInIdpMutation.d.ts.map +1 -0
  525. package/dist/types/hooks/mutations/index.d.ts +8 -0
  526. package/dist/types/hooks/mutations/index.d.ts.map +1 -0
  527. package/dist/types/hooks/mutations/invite/index.d.ts +2 -0
  528. package/dist/types/hooks/mutations/invite/index.d.ts.map +1 -0
  529. package/dist/types/hooks/mutations/invite/useInviteMutation.d.ts +103 -0
  530. package/dist/types/hooks/mutations/invite/useInviteMutation.d.ts.map +1 -0
  531. package/dist/types/hooks/mutations/memberships/index.d.ts +4 -0
  532. package/dist/types/hooks/mutations/memberships/index.d.ts.map +1 -0
  533. package/dist/types/hooks/mutations/memberships/useAddProjectMemberMutation.d.ts +33 -0
  534. package/dist/types/hooks/mutations/memberships/useAddProjectMemberMutation.d.ts.map +1 -0
  535. package/dist/types/hooks/mutations/memberships/useRemoveProjectMemberMutation.d.ts +23 -0
  536. package/dist/types/hooks/mutations/memberships/useRemoveProjectMemberMutation.d.ts.map +1 -0
  537. package/dist/types/hooks/mutations/memberships/useUpdateProjectMemberMutation.d.ts +33 -0
  538. package/dist/types/hooks/mutations/memberships/useUpdateProjectMemberMutation.d.ts.map +1 -0
  539. package/dist/types/hooks/mutations/otp/index.d.ts +4 -0
  540. package/dist/types/hooks/mutations/otp/index.d.ts.map +1 -0
  541. package/dist/types/hooks/mutations/otp/useConfirmOtpMutation.d.ts +21 -0
  542. package/dist/types/hooks/mutations/otp/useConfirmOtpMutation.d.ts.map +1 -0
  543. package/dist/types/hooks/mutations/otp/useDisableOtpMutation.d.ts +17 -0
  544. package/dist/types/hooks/mutations/otp/useDisableOtpMutation.d.ts.map +1 -0
  545. package/dist/types/hooks/mutations/otp/usePrepareOtpMutation.d.ts +25 -0
  546. package/dist/types/hooks/mutations/otp/usePrepareOtpMutation.d.ts.map +1 -0
  547. package/dist/types/hooks/mutations/passwordReset/index.d.ts +3 -0
  548. package/dist/types/hooks/mutations/passwordReset/index.d.ts.map +1 -0
  549. package/dist/types/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.d.ts +23 -0
  550. package/dist/types/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.d.ts.map +1 -0
  551. package/dist/types/hooks/mutations/passwordReset/useResetPasswordMutation.d.ts +23 -0
  552. package/dist/types/hooks/mutations/passwordReset/useResetPasswordMutation.d.ts.map +1 -0
  553. package/dist/types/hooks/queries/index.d.ts +5 -0
  554. package/dist/types/hooks/queries/index.d.ts.map +1 -0
  555. package/dist/types/hooks/queries/useMeQuery.d.ts +52 -0
  556. package/dist/types/hooks/queries/useMeQuery.d.ts.map +1 -0
  557. package/dist/types/hooks/queries/useProjectMembersQuery.d.ts +43 -0
  558. package/dist/types/hooks/queries/useProjectMembersQuery.d.ts.map +1 -0
  559. package/dist/types/hooks/queries/useProjectMembershipsQuery.d.ts +20 -0
  560. package/dist/types/hooks/queries/useProjectMembershipsQuery.d.ts.map +1 -0
  561. package/dist/types/hooks/queries/useProjectRolesDefinitionQuery.d.ts +66 -0
  562. package/dist/types/hooks/queries/useProjectRolesDefinitionQuery.d.ts.map +1 -0
  563. package/dist/types/hooks/useFetchIdentity.d.ts +6 -0
  564. package/dist/types/hooks/useFetchIdentity.d.ts.map +1 -0
  565. package/dist/types/hooks/useLogout.d.ts +4 -0
  566. package/dist/types/hooks/useLogout.d.ts.map +1 -0
  567. package/dist/types/hooks/useTenantApi.d.ts +7 -2
  568. package/dist/types/hooks/useTenantApi.d.ts.map +1 -1
  569. package/dist/types/hooks/useTenantMutation.d.ts +25 -0
  570. package/dist/types/hooks/useTenantMutation.d.ts.map +1 -0
  571. package/dist/types/hooks/useTenantQueryLoader.d.ts +17 -0
  572. package/dist/types/hooks/useTenantQueryLoader.d.ts.map +1 -0
  573. package/dist/types/index.d.ts +3 -0
  574. package/dist/types/index.d.ts.map +1 -1
  575. package/dist/types/internal/hooks/useHandleIDPResponse.d.ts +10 -0
  576. package/dist/types/internal/hooks/useHandleIDPResponse.d.ts.map +1 -0
  577. package/dist/types/internal/hooks/useIDPAutoInit.d.ts +2 -0
  578. package/dist/types/internal/hooks/useIDPAutoInit.d.ts.map +1 -0
  579. package/dist/types/internal/hooks/useIDPStateStore.d.ts +9 -0
  580. package/dist/types/internal/hooks/useIDPStateStore.d.ts.map +1 -0
  581. package/dist/types/internal/hooks/useInitIDPRedirect.d.ts +15 -0
  582. package/dist/types/internal/hooks/useInitIDPRedirect.d.ts.map +1 -0
  583. package/dist/types/internal/hooks/useLogoutInternal.d.ts +4 -0
  584. package/dist/types/internal/hooks/useLogoutInternal.d.ts.map +1 -0
  585. package/dist/types/internal/hooks/useRedirectToBacklink.d.ts +4 -0
  586. package/dist/types/internal/hooks/useRedirectToBacklink.d.ts.map +1 -0
  587. package/dist/types/internal/utils/getBaseHref.d.ts +2 -0
  588. package/dist/types/internal/utils/getBaseHref.d.ts.map +1 -0
  589. package/dist/types/tsconfig.tsbuildinfo +1 -1
  590. package/dist/types/types/Identity.d.ts +19 -0
  591. package/dist/types/types/Identity.d.ts.map +1 -0
  592. package/dist/types/types/IdentityMethods.d.ts +5 -0
  593. package/dist/types/types/IdentityMethods.d.ts.map +1 -0
  594. package/dist/types/types/IdentityStateValue.d.ts +2 -0
  595. package/dist/types/types/IdentityStateValue.d.ts.map +1 -0
  596. package/dist/types/types/forms.d.ts +18 -0
  597. package/dist/types/types/forms.d.ts.map +1 -0
  598. package/dist/types/types/idp.d.ts +30 -0
  599. package/dist/types/types/idp.d.ts.map +1 -0
  600. package/dist/types/types/index.d.ts +6 -0
  601. package/dist/types/types/index.d.ts.map +1 -0
  602. package/package.json +6 -2
  603. package/src/components/IdentityProvider.tsx +39 -0
  604. package/src/components/IdentityState.tsx +14 -0
  605. package/src/components/forms/ChangeMyPasswordForm.tsx +75 -0
  606. package/src/components/forms/CreateApiKeyForm.tsx +72 -0
  607. package/src/components/forms/CreateSessionTokenForm.tsx +64 -0
  608. package/src/components/forms/InviteForm.tsx +79 -0
  609. package/src/components/forms/LoginForm.tsx +110 -0
  610. package/src/components/forms/OtpConfirmForm.tsx +61 -0
  611. package/src/components/forms/OtpPrepareForm.tsx +45 -0
  612. package/src/components/forms/PasswordResetForm.tsx +80 -0
  613. package/src/components/forms/PasswordResetRequestForm.tsx +64 -0
  614. package/src/components/forms/TenantForm.tsx +116 -0
  615. package/src/components/forms/UpdateProjectMemberForm.tsx +77 -0
  616. package/src/components/forms/index.ts +10 -0
  617. package/src/components/idp/IDP.tsx +65 -0
  618. package/src/components/idp/IDPInitTrigger.tsx +17 -0
  619. package/src/components/idp/IDPState.tsx +14 -0
  620. package/src/components/idp/index.ts +3 -0
  621. package/src/components/index.ts +5 -0
  622. package/src/components/triggers/DisableOtpTrigger.tsx +25 -0
  623. package/src/components/triggers/LogoutTrigger.tsx +10 -0
  624. package/src/components/triggers/RemoveProjectMemberTrigger.tsx +18 -0
  625. package/src/components/triggers/TenantActionTrigger.tsx +41 -0
  626. package/src/components/triggers/index.ts +3 -0
  627. package/src/contexts.ts +34 -0
  628. package/src/hooks/index.ts +6 -0
  629. package/src/hooks/mutations/apiKey/index.ts +4 -0
  630. package/src/hooks/mutations/apiKey/useCreateApiKeyMutation.tsx +19 -0
  631. package/src/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.tsx +19 -0
  632. package/src/hooks/mutations/apiKey/useCreateSessionTokenMutation.tsx +19 -0
  633. package/src/hooks/mutations/apiKey/useDisableApiKeyMutation.tsx +14 -0
  634. package/src/hooks/mutations/auth/index.ts +3 -0
  635. package/src/hooks/mutations/auth/useChangeMyPasswordMutation.ts +14 -0
  636. package/src/hooks/mutations/auth/useSignInMutation.ts +25 -0
  637. package/src/hooks/mutations/auth/useSignOutMutation.ts +12 -0
  638. package/src/hooks/mutations/idp/index.ts +2 -0
  639. package/src/hooks/mutations/idp/useInitSignInIDPMutation.ts +29 -0
  640. package/src/hooks/mutations/idp/useSignInIdpMutation.ts +35 -0
  641. package/src/hooks/mutations/index.ts +7 -0
  642. package/src/hooks/mutations/invite/index.ts +1 -0
  643. package/src/hooks/mutations/invite/useInviteMutation.tsx +20 -0
  644. package/src/hooks/mutations/memberships/index.ts +3 -0
  645. package/src/hooks/mutations/memberships/useAddProjectMemberMutation.ts +13 -0
  646. package/src/hooks/mutations/memberships/useRemoveProjectMemberMutation.ts +13 -0
  647. package/src/hooks/mutations/memberships/useUpdateProjectMemberMutation.ts +13 -0
  648. package/src/hooks/mutations/otp/index.ts +3 -0
  649. package/src/hooks/mutations/otp/useConfirmOtpMutation.ts +13 -0
  650. package/src/hooks/mutations/otp/useDisableOtpMutation.ts +10 -0
  651. package/src/hooks/mutations/otp/usePrepareOtpMutation.ts +16 -0
  652. package/src/hooks/mutations/passwordReset/index.ts +2 -0
  653. package/src/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.ts +17 -0
  654. package/src/hooks/mutations/passwordReset/useResetPasswordMutation.ts +17 -0
  655. package/src/hooks/queries/index.ts +4 -0
  656. package/src/hooks/queries/useMeQuery.ts +23 -0
  657. package/src/hooks/queries/useProjectMembersQuery.ts +43 -0
  658. package/src/hooks/queries/useProjectMembershipsQuery.ts +25 -0
  659. package/src/hooks/queries/useProjectRolesDefinitionQuery.ts +34 -0
  660. package/src/hooks/useFetchIdentity.ts +55 -0
  661. package/src/hooks/useLogout.ts +7 -0
  662. package/src/hooks/useTenantApi.ts +18 -6
  663. package/src/hooks/useTenantMutation.ts +45 -0
  664. package/src/hooks/useTenantQueryLoader.ts +49 -0
  665. package/src/index.ts +3 -0
  666. package/src/internal/hooks/useHandleIDPResponse.ts +64 -0
  667. package/src/internal/hooks/useIDPAutoInit.ts +18 -0
  668. package/src/internal/hooks/useIDPStateStore.ts +18 -0
  669. package/src/internal/hooks/useInitIDPRedirect.ts +48 -0
  670. package/src/internal/hooks/useLogoutInternal.ts +35 -0
  671. package/src/internal/hooks/useRedirectToBacklink.ts +42 -0
  672. package/src/internal/utils/getBaseHref.ts +4 -0
  673. package/src/tsconfig.json +1 -0
  674. package/src/types/Identity.ts +20 -0
  675. package/src/types/IdentityMethods.ts +4 -0
  676. package/src/types/IdentityStateValue.ts +6 -0
  677. package/src/types/forms.ts +26 -0
  678. package/src/types/idp.ts +25 -0
  679. package/src/types/index.ts +5 -0
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxDevRuntime = require("react/jsx-dev-runtime");
4
+ const reactClient = require("@contember/react-client");
5
+ const react = require("react");
6
+ const contexts = require("../contexts.cjs");
7
+ const useFetchIdentity = require("../hooks/useFetchIdentity.cjs");
8
+ const IdentityProvider = ({ children }) => {
9
+ const sessionToken = reactClient.useSessionToken();
10
+ const [{ identity, state }, methods] = useFetchIdentity.useFetchIdentity();
11
+ const { refreshIdentity, clearIdentity } = methods;
12
+ react.useEffect(() => {
13
+ if (sessionToken !== void 0) {
14
+ refreshIdentity();
15
+ }
16
+ }, [sessionToken, refreshIdentity]);
17
+ const hasIdentity = identity !== void 0;
18
+ react.useEffect(() => {
19
+ if (sessionToken === void 0 && hasIdentity) {
20
+ clearIdentity();
21
+ }
22
+ }, [sessionToken, clearIdentity, hasIdentity]);
23
+ return /* @__PURE__ */ jsxDevRuntime.jsxDEV(contexts.IdentityStateContext.Provider, { value: state, children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(contexts.IdentityContext.Provider, { value: identity, children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(contexts.IdentityMethodsContext.Provider, { value: methods, children }, void 0, false, {
24
+ fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/IdentityProvider.tsx",
25
+ lineNumber: 33,
26
+ columnNumber: 5
27
+ }, void 0) }, void 0, false, {
28
+ fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/IdentityProvider.tsx",
29
+ lineNumber: 32,
30
+ columnNumber: 4
31
+ }, void 0) }, void 0, false, {
32
+ fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/IdentityProvider.tsx",
33
+ lineNumber: 31,
34
+ columnNumber: 3
35
+ }, void 0);
36
+ };
37
+ exports.IdentityProvider = IdentityProvider;
38
+ //# sourceMappingURL=IdentityProvider.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IdentityProvider.cjs","sources":["../../../src/components/IdentityProvider.tsx"],"sourcesContent":["import { useSessionToken } from '@contember/react-client'\nimport { ReactNode, useEffect } from 'react'\nimport { useFetchIdentity } from '../hooks'\nimport { IdentityContext, IdentityMethodsContext, IdentityStateContext } from '../contexts'\n\n\nexport interface IdentityProviderProps {\n\tchildren: ReactNode\n}\n\nexport const IdentityProvider: React.FC<IdentityProviderProps> = ({ children }) => {\n\tconst sessionToken = useSessionToken()\n\tconst [{ identity, state }, methods] = useFetchIdentity()\n\n\tconst { refreshIdentity, clearIdentity } = methods\n\tuseEffect(() => {\n\t\tif (sessionToken !== undefined) {\n\t\t\trefreshIdentity()\n\t\t}\n\t}, [sessionToken, refreshIdentity])\n\n\n\tconst hasIdentity = identity !== undefined\n\tuseEffect(() => {\n\t\tif (sessionToken === undefined && hasIdentity) {\n\t\t\tclearIdentity()\n\t\t}\n\t}, [sessionToken, clearIdentity, hasIdentity])\n\n\treturn (\n\t\t<IdentityStateContext.Provider value={state}>\n\t\t\t<IdentityContext.Provider value={identity}>\n\t\t\t\t<IdentityMethodsContext.Provider value={methods}>\n\t\t\t\t\t\t{children}\n\t\t\t\t</IdentityMethodsContext.Provider>\n\t\t\t</IdentityContext.Provider>\n\t\t</IdentityStateContext.Provider>\n\t)\n}\n"],"names":["useSessionToken","useFetchIdentity","useEffect","IdentityStateContext","IdentityContext","jsxDEV","IdentityMethodsContext","this"],"mappings":";;;;;;;AAUO,MAAM,mBAAoD,CAAC,EAAE,eAAe;AAClF,QAAM,eAAeA,YAAAA;AACrB,QAAM,CAAC,EAAE,UAAU,MAAS,GAAA,OAAO,IAAIC,iBAAAA;AAEjC,QAAA,EAAE,iBAAiB,cAAkB,IAAA;AAC3CC,QAAAA,UAAU,MAAM;AACf,QAAI,iBAAiB,QAAW;AACf;IACjB;AAAA,EAAA,GACE,CAAC,cAAc,eAAe,CAAC;AAGlC,QAAM,cAAc,aAAa;AACjCA,QAAAA,UAAU,MAAM;AACX,QAAA,iBAAiB,UAAa,aAAa;AAChC;IACf;AAAA,EACE,GAAA,CAAC,cAAc,eAAe,WAAW,CAAC;AAE7C,8CACEC,SAAAA,qBAAqB,UAArB,EAA8B,OAAO,OACrC,+CAACC,yBAAgB,UAAhB,EAAyB,OAAO,UAChC,UAACC,8BAAAA,OAAAC,SAAA,uBAAuB,UAAvB,EAAgC,OAAO,SACrC,SADH,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAC,MAEA,EAHD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAIA,EALD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAMA,GAAAA,MAAA;AAEF;;"}
@@ -0,0 +1,38 @@
1
+ import { jsxDEV } from "react/jsx-dev-runtime";
2
+ import { useSessionToken } from "@contember/react-client";
3
+ import { useEffect } from "react";
4
+ import { IdentityStateContext, IdentityContext, IdentityMethodsContext } from "../contexts.js";
5
+ import { useFetchIdentity } from "../hooks/useFetchIdentity.js";
6
+ const IdentityProvider = ({ children }) => {
7
+ const sessionToken = useSessionToken();
8
+ const [{ identity, state }, methods] = useFetchIdentity();
9
+ const { refreshIdentity, clearIdentity } = methods;
10
+ useEffect(() => {
11
+ if (sessionToken !== void 0) {
12
+ refreshIdentity();
13
+ }
14
+ }, [sessionToken, refreshIdentity]);
15
+ const hasIdentity = identity !== void 0;
16
+ useEffect(() => {
17
+ if (sessionToken === void 0 && hasIdentity) {
18
+ clearIdentity();
19
+ }
20
+ }, [sessionToken, clearIdentity, hasIdentity]);
21
+ return /* @__PURE__ */ jsxDEV(IdentityStateContext.Provider, { value: state, children: /* @__PURE__ */ jsxDEV(IdentityContext.Provider, { value: identity, children: /* @__PURE__ */ jsxDEV(IdentityMethodsContext.Provider, { value: methods, children }, void 0, false, {
22
+ fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/IdentityProvider.tsx",
23
+ lineNumber: 33,
24
+ columnNumber: 5
25
+ }, void 0) }, void 0, false, {
26
+ fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/IdentityProvider.tsx",
27
+ lineNumber: 32,
28
+ columnNumber: 4
29
+ }, void 0) }, void 0, false, {
30
+ fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/IdentityProvider.tsx",
31
+ lineNumber: 31,
32
+ columnNumber: 3
33
+ }, void 0);
34
+ };
35
+ export {
36
+ IdentityProvider
37
+ };
38
+ //# sourceMappingURL=IdentityProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IdentityProvider.js","sources":["../../../src/components/IdentityProvider.tsx"],"sourcesContent":["import { useSessionToken } from '@contember/react-client'\nimport { ReactNode, useEffect } from 'react'\nimport { useFetchIdentity } from '../hooks'\nimport { IdentityContext, IdentityMethodsContext, IdentityStateContext } from '../contexts'\n\n\nexport interface IdentityProviderProps {\n\tchildren: ReactNode\n}\n\nexport const IdentityProvider: React.FC<IdentityProviderProps> = ({ children }) => {\n\tconst sessionToken = useSessionToken()\n\tconst [{ identity, state }, methods] = useFetchIdentity()\n\n\tconst { refreshIdentity, clearIdentity } = methods\n\tuseEffect(() => {\n\t\tif (sessionToken !== undefined) {\n\t\t\trefreshIdentity()\n\t\t}\n\t}, [sessionToken, refreshIdentity])\n\n\n\tconst hasIdentity = identity !== undefined\n\tuseEffect(() => {\n\t\tif (sessionToken === undefined && hasIdentity) {\n\t\t\tclearIdentity()\n\t\t}\n\t}, [sessionToken, clearIdentity, hasIdentity])\n\n\treturn (\n\t\t<IdentityStateContext.Provider value={state}>\n\t\t\t<IdentityContext.Provider value={identity}>\n\t\t\t\t<IdentityMethodsContext.Provider value={methods}>\n\t\t\t\t\t\t{children}\n\t\t\t\t</IdentityMethodsContext.Provider>\n\t\t\t</IdentityContext.Provider>\n\t\t</IdentityStateContext.Provider>\n\t)\n}\n"],"names":["this"],"mappings":";;;;;AAUO,MAAM,mBAAoD,CAAC,EAAE,eAAe;AAClF,QAAM,eAAe;AACrB,QAAM,CAAC,EAAE,UAAU,MAAS,GAAA,OAAO,IAAI;AAEjC,QAAA,EAAE,iBAAiB,cAAkB,IAAA;AAC3C,YAAU,MAAM;AACf,QAAI,iBAAiB,QAAW;AACf;IACjB;AAAA,EAAA,GACE,CAAC,cAAc,eAAe,CAAC;AAGlC,QAAM,cAAc,aAAa;AACjC,YAAU,MAAM;AACX,QAAA,iBAAiB,UAAa,aAAa;AAChC;IACf;AAAA,EACE,GAAA,CAAC,cAAc,eAAe,WAAW,CAAC;AAE7C,gCACE,qBAAqB,UAArB,EAA8B,OAAO,OACrC,iCAAC,gBAAgB,UAAhB,EAAyB,OAAO,UAChC,UAAC,uBAAA,uBAAuB,UAAvB,EAAgC,OAAO,SACrC,SADH,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAEA,EAHD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAIA,EALD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAMA,GAAAA,MAAA;AAEF;"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxDevRuntime = require("react/jsx-dev-runtime");
4
+ const contexts = require("../contexts.cjs");
5
+ const IdentityState = ({ state, children }) => {
6
+ const currentState = contexts.useIdentityState();
7
+ return state === currentState || Array.isArray(state) && state.includes(currentState) ? /* @__PURE__ */ jsxDevRuntime.jsxDEV(jsxDevRuntime.Fragment, { children }, void 0, false, {
8
+ fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/IdentityState.tsx",
9
+ lineNumber: 13,
10
+ columnNumber: 92
11
+ }, void 0) : null;
12
+ };
13
+ exports.IdentityState = IdentityState;
14
+ //# sourceMappingURL=IdentityState.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IdentityState.cjs","sources":["../../../src/components/IdentityState.tsx"],"sourcesContent":["import React, { ReactNode } from 'react'\nimport { IdentityStateValue } from '../types'\nimport { useIdentityState } from '../contexts'\n\nexport interface IdentityStateProps {\n\tstate: IdentityStateValue | IdentityStateValue[]\n\tchildren: ReactNode\n}\n\nexport const IdentityState = ({ state, children }: IdentityStateProps) => {\n\tconst currentState = useIdentityState()\n\n\treturn state === currentState || (Array.isArray(state) && state.includes(currentState)) ? <>{children}</> : null\n}\n"],"names":["useIdentityState","jsxDEV","Fragment","this"],"mappings":";;;;AASO,MAAM,gBAAgB,CAAC,EAAE,OAAO,eAAmC;AACzE,QAAM,eAAeA,SAAAA;AAEd,SAAA,UAAU,gBAAiB,MAAM,QAAQ,KAAK,KAAK,MAAM,SAAS,YAAY,IAAKC,8BAAA,OAAAC,wBAAA,EAAG,SAAH,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAC,MAAY,IAAM;AAC7G;;"}
@@ -0,0 +1,14 @@
1
+ import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
2
+ import { useIdentityState } from "../contexts.js";
3
+ const IdentityState = ({ state, children }) => {
4
+ const currentState = useIdentityState();
5
+ return state === currentState || Array.isArray(state) && state.includes(currentState) ? /* @__PURE__ */ jsxDEV(Fragment, { children }, void 0, false, {
6
+ fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/IdentityState.tsx",
7
+ lineNumber: 13,
8
+ columnNumber: 92
9
+ }, void 0) : null;
10
+ };
11
+ export {
12
+ IdentityState
13
+ };
14
+ //# sourceMappingURL=IdentityState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IdentityState.js","sources":["../../../src/components/IdentityState.tsx"],"sourcesContent":["import React, { ReactNode } from 'react'\nimport { IdentityStateValue } from '../types'\nimport { useIdentityState } from '../contexts'\n\nexport interface IdentityStateProps {\n\tstate: IdentityStateValue | IdentityStateValue[]\n\tchildren: ReactNode\n}\n\nexport const IdentityState = ({ state, children }: IdentityStateProps) => {\n\tconst currentState = useIdentityState()\n\n\treturn state === currentState || (Array.isArray(state) && state.includes(currentState)) ? <>{children}</> : null\n}\n"],"names":["this"],"mappings":";;AASO,MAAM,gBAAgB,CAAC,EAAE,OAAO,eAAmC;AACzE,QAAM,eAAe;AAEd,SAAA,UAAU,gBAAiB,MAAM,QAAQ,KAAK,KAAK,MAAM,SAAS,YAAY,IAAK,uBAAA,UAAA,EAAG,SAAH,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAAY,IAAM;AAC7G;"}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxDevRuntime = require("react/jsx-dev-runtime");
4
+ const TenantForm = require("./TenantForm.cjs");
5
+ const contexts = require("../../contexts.cjs");
6
+ const useChangeMyPasswordMutation = require("../../hooks/mutations/auth/useChangeMyPasswordMutation.cjs");
7
+ const useChangeMyPasswordForm = contexts.useForm;
8
+ const ChangeMyPasswordForm = ({ children, onSuccess }) => {
9
+ const changePassword = useChangeMyPasswordMutation.useChangeMyPasswordMutation();
10
+ return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
11
+ TenantForm.TenantForm,
12
+ {
13
+ onSuccess,
14
+ errorMapping: errorToField,
15
+ initialValues: {
16
+ currentPassword: "",
17
+ newPassword: "",
18
+ passwordConfirmation: ""
19
+ },
20
+ validate: ({ values }) => {
21
+ const errors = [];
22
+ if (!values.currentPassword) {
23
+ errors.push({ code: "FIELD_REQUIRED", field: "currentPassword" });
24
+ }
25
+ if (!values.newPassword) {
26
+ errors.push({ code: "FIELD_REQUIRED", field: "newPassword" });
27
+ } else if (values.newPassword.length < 6) {
28
+ errors.push({ code: "INVALID_VALUE", field: "newPassword" });
29
+ } else if (!values.passwordConfirmation) {
30
+ errors.push({ code: "FIELD_REQUIRED", field: "passwordConfirmation" });
31
+ } else if (values.newPassword !== values.passwordConfirmation) {
32
+ errors.push({ code: "PASSWORD_MISMATCH", field: "passwordConfirmation" });
33
+ }
34
+ return errors;
35
+ },
36
+ execute: async ({ values }) => {
37
+ return await changePassword(values);
38
+ },
39
+ children
40
+ },
41
+ void 0,
42
+ false,
43
+ {
44
+ fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/forms/ChangeMyPasswordForm.tsx",
45
+ lineNumber: 37,
46
+ columnNumber: 3
47
+ },
48
+ void 0
49
+ );
50
+ };
51
+ const errorToField = {
52
+ PASSWORD_MISMATCH: "passwordConfirmation",
53
+ TOO_WEAK: "newPassword",
54
+ NO_PASSWORD_SET: "currentPassword",
55
+ INVALID_PASSWORD: "currentPassword"
56
+ };
57
+ exports.ChangeMyPasswordForm = ChangeMyPasswordForm;
58
+ exports.useChangeMyPasswordForm = useChangeMyPasswordForm;
59
+ //# sourceMappingURL=ChangeMyPasswordForm.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChangeMyPasswordForm.cjs","sources":["../../../../src/components/forms/ChangeMyPasswordForm.tsx"],"sourcesContent":["import { ReactElement } from 'react'\nimport { ChangeMyPasswordErrorCode } from '@contember/graphql-client-tenant'\nimport { TenantForm } from './TenantForm'\nimport { FormContextValue, FormError, FormState } from '../../types'\nimport { useForm } from '../../contexts'\nimport { useChangeMyPasswordMutation } from '../../hooks'\n\nexport type ChangeMyPasswordFormValues = {\n\tcurrentPassword: string\n\tnewPassword: string\n\tpasswordConfirmation: string\n}\n\nexport type ChangeMyPasswordFormErrorCode =\n\t| ChangeMyPasswordErrorCode\n\t| 'FIELD_REQUIRED'\n\t| 'INVALID_VALUE'\n\t| 'PASSWORD_MISMATCH'\n\t| 'UNKNOWN_ERROR'\n\nexport type ChangeMyPasswordFormState = FormState\n\nexport type ChangeMyPasswordFormError = FormError<ChangeMyPasswordFormValues, ChangeMyPasswordFormErrorCode>\n\nexport type ChangeMyPasswordFormContextValue = FormContextValue<ChangeMyPasswordFormValues, ChangeMyPasswordFormErrorCode>\n\nexport interface ChangeMyPasswordFormProps {\n\tchildren: ReactElement\n\tonSuccess?: () => void\n}\n\nexport const useChangeMyPasswordForm = useForm as () => ChangeMyPasswordFormContextValue\n\nexport const ChangeMyPasswordForm = ({ children, onSuccess }: ChangeMyPasswordFormProps) => {\n\tconst changePassword = useChangeMyPasswordMutation()\n\treturn (\n\t\t<TenantForm<ChangeMyPasswordFormContextValue>\n\t\t\tonSuccess={onSuccess}\n\t\t\terrorMapping={errorToField}\n\t\t\tinitialValues={{\n\t\t\t\tcurrentPassword: '',\n\t\t\t\tnewPassword: '',\n\t\t\t\tpasswordConfirmation: '',\n\t\t\t}}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tconst errors: ChangeMyPasswordFormError[] = []\n\t\t\t\tif (!values.currentPassword) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'currentPassword' })\n\t\t\t\t}\n\t\t\t\tif (!values.newPassword) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'newPassword' })\n\t\t\t\t} else if (values.newPassword.length < 6) {\n\t\t\t\t\terrors.push({ code: 'INVALID_VALUE', field: 'newPassword' })\n\t\t\t\t} else if (!values.passwordConfirmation) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'passwordConfirmation' })\n\t\t\t\t} else if (values.newPassword !== values.passwordConfirmation) {\n\t\t\t\t\terrors.push({ code: 'PASSWORD_MISMATCH', field: 'passwordConfirmation' })\n\t\t\t\t}\n\t\t\t\treturn errors\n\t\t\t}}\n\t\t\texecute={async ({ values }) => {\n\t\t\t\treturn await changePassword(values)\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</TenantForm>\n\t)\n\n}\nconst errorToField: Partial<Record<ChangeMyPasswordFormErrorCode, keyof ChangeMyPasswordFormValues | undefined>> = {\n\tPASSWORD_MISMATCH: 'passwordConfirmation',\n\tTOO_WEAK: 'newPassword',\n\tNO_PASSWORD_SET: 'currentPassword',\n\tINVALID_PASSWORD: 'currentPassword',\n}\n"],"names":["useForm","useChangeMyPasswordMutation","jsxDEV","TenantForm","this"],"mappings":";;;;;;AA+BO,MAAM,0BAA0BA,SAAA;AAEhC,MAAM,uBAAuB,CAAC,EAAE,UAAU,gBAA2C;AAC3F,QAAM,iBAAiBC,4BAAAA;AAEtB,SAAAC,8BAAA;AAAA,IAACC,WAAA;AAAA,IAAA;AAAA,MACA;AAAA,MACA,cAAc;AAAA,MACd,eAAe;AAAA,QACd,iBAAiB;AAAA,QACjB,aAAa;AAAA,QACb,sBAAsB;AAAA,MACvB;AAAA,MACA,UAAU,CAAC,EAAE,aAAa;AACzB,cAAM,SAAsC,CAAA;AACxC,YAAA,CAAC,OAAO,iBAAiB;AAC5B,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,mBAAmB;AAAA,QACjE;AACI,YAAA,CAAC,OAAO,aAAa;AACxB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,eAAe;AAAA,QAClD,WAAA,OAAO,YAAY,SAAS,GAAG;AACzC,iBAAO,KAAK,EAAE,MAAM,iBAAiB,OAAO,eAAe;AAAA,QAAA,WACjD,CAAC,OAAO,sBAAsB;AACxC,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,wBAAwB;AAAA,QAC3D,WAAA,OAAO,gBAAgB,OAAO,sBAAsB;AAC9D,iBAAO,KAAK,EAAE,MAAM,qBAAqB,OAAO,wBAAwB;AAAA,QACzE;AACO,eAAA;AAAA,MACR;AAAA,MACA,SAAS,OAAO,EAAE,aAAa;AACvB,eAAA,MAAM,eAAe,MAAM;AAAA,MACnC;AAAA,MAEC;AAAA,IAAA;AAAA,IA5BF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAC;AAAAA,EAAA;AAgCF;AACA,MAAM,eAA6G;AAAA,EAClH,mBAAmB;AAAA,EACnB,UAAU;AAAA,EACV,iBAAiB;AAAA,EACjB,kBAAkB;AACnB;;;"}
@@ -0,0 +1,59 @@
1
+ import { jsxDEV } from "react/jsx-dev-runtime";
2
+ import { TenantForm } from "./TenantForm.js";
3
+ import { useForm } from "../../contexts.js";
4
+ import { useChangeMyPasswordMutation } from "../../hooks/mutations/auth/useChangeMyPasswordMutation.js";
5
+ const useChangeMyPasswordForm = useForm;
6
+ const ChangeMyPasswordForm = ({ children, onSuccess }) => {
7
+ const changePassword = useChangeMyPasswordMutation();
8
+ return /* @__PURE__ */ jsxDEV(
9
+ TenantForm,
10
+ {
11
+ onSuccess,
12
+ errorMapping: errorToField,
13
+ initialValues: {
14
+ currentPassword: "",
15
+ newPassword: "",
16
+ passwordConfirmation: ""
17
+ },
18
+ validate: ({ values }) => {
19
+ const errors = [];
20
+ if (!values.currentPassword) {
21
+ errors.push({ code: "FIELD_REQUIRED", field: "currentPassword" });
22
+ }
23
+ if (!values.newPassword) {
24
+ errors.push({ code: "FIELD_REQUIRED", field: "newPassword" });
25
+ } else if (values.newPassword.length < 6) {
26
+ errors.push({ code: "INVALID_VALUE", field: "newPassword" });
27
+ } else if (!values.passwordConfirmation) {
28
+ errors.push({ code: "FIELD_REQUIRED", field: "passwordConfirmation" });
29
+ } else if (values.newPassword !== values.passwordConfirmation) {
30
+ errors.push({ code: "PASSWORD_MISMATCH", field: "passwordConfirmation" });
31
+ }
32
+ return errors;
33
+ },
34
+ execute: async ({ values }) => {
35
+ return await changePassword(values);
36
+ },
37
+ children
38
+ },
39
+ void 0,
40
+ false,
41
+ {
42
+ fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/forms/ChangeMyPasswordForm.tsx",
43
+ lineNumber: 37,
44
+ columnNumber: 3
45
+ },
46
+ void 0
47
+ );
48
+ };
49
+ const errorToField = {
50
+ PASSWORD_MISMATCH: "passwordConfirmation",
51
+ TOO_WEAK: "newPassword",
52
+ NO_PASSWORD_SET: "currentPassword",
53
+ INVALID_PASSWORD: "currentPassword"
54
+ };
55
+ export {
56
+ ChangeMyPasswordForm,
57
+ useChangeMyPasswordForm
58
+ };
59
+ //# sourceMappingURL=ChangeMyPasswordForm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChangeMyPasswordForm.js","sources":["../../../../src/components/forms/ChangeMyPasswordForm.tsx"],"sourcesContent":["import { ReactElement } from 'react'\nimport { ChangeMyPasswordErrorCode } from '@contember/graphql-client-tenant'\nimport { TenantForm } from './TenantForm'\nimport { FormContextValue, FormError, FormState } from '../../types'\nimport { useForm } from '../../contexts'\nimport { useChangeMyPasswordMutation } from '../../hooks'\n\nexport type ChangeMyPasswordFormValues = {\n\tcurrentPassword: string\n\tnewPassword: string\n\tpasswordConfirmation: string\n}\n\nexport type ChangeMyPasswordFormErrorCode =\n\t| ChangeMyPasswordErrorCode\n\t| 'FIELD_REQUIRED'\n\t| 'INVALID_VALUE'\n\t| 'PASSWORD_MISMATCH'\n\t| 'UNKNOWN_ERROR'\n\nexport type ChangeMyPasswordFormState = FormState\n\nexport type ChangeMyPasswordFormError = FormError<ChangeMyPasswordFormValues, ChangeMyPasswordFormErrorCode>\n\nexport type ChangeMyPasswordFormContextValue = FormContextValue<ChangeMyPasswordFormValues, ChangeMyPasswordFormErrorCode>\n\nexport interface ChangeMyPasswordFormProps {\n\tchildren: ReactElement\n\tonSuccess?: () => void\n}\n\nexport const useChangeMyPasswordForm = useForm as () => ChangeMyPasswordFormContextValue\n\nexport const ChangeMyPasswordForm = ({ children, onSuccess }: ChangeMyPasswordFormProps) => {\n\tconst changePassword = useChangeMyPasswordMutation()\n\treturn (\n\t\t<TenantForm<ChangeMyPasswordFormContextValue>\n\t\t\tonSuccess={onSuccess}\n\t\t\terrorMapping={errorToField}\n\t\t\tinitialValues={{\n\t\t\t\tcurrentPassword: '',\n\t\t\t\tnewPassword: '',\n\t\t\t\tpasswordConfirmation: '',\n\t\t\t}}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tconst errors: ChangeMyPasswordFormError[] = []\n\t\t\t\tif (!values.currentPassword) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'currentPassword' })\n\t\t\t\t}\n\t\t\t\tif (!values.newPassword) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'newPassword' })\n\t\t\t\t} else if (values.newPassword.length < 6) {\n\t\t\t\t\terrors.push({ code: 'INVALID_VALUE', field: 'newPassword' })\n\t\t\t\t} else if (!values.passwordConfirmation) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'passwordConfirmation' })\n\t\t\t\t} else if (values.newPassword !== values.passwordConfirmation) {\n\t\t\t\t\terrors.push({ code: 'PASSWORD_MISMATCH', field: 'passwordConfirmation' })\n\t\t\t\t}\n\t\t\t\treturn errors\n\t\t\t}}\n\t\t\texecute={async ({ values }) => {\n\t\t\t\treturn await changePassword(values)\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</TenantForm>\n\t)\n\n}\nconst errorToField: Partial<Record<ChangeMyPasswordFormErrorCode, keyof ChangeMyPasswordFormValues | undefined>> = {\n\tPASSWORD_MISMATCH: 'passwordConfirmation',\n\tTOO_WEAK: 'newPassword',\n\tNO_PASSWORD_SET: 'currentPassword',\n\tINVALID_PASSWORD: 'currentPassword',\n}\n"],"names":["this"],"mappings":";;;;AA+BO,MAAM,0BAA0B;AAEhC,MAAM,uBAAuB,CAAC,EAAE,UAAU,gBAA2C;AAC3F,QAAM,iBAAiB;AAEtB,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACA;AAAA,MACA,cAAc;AAAA,MACd,eAAe;AAAA,QACd,iBAAiB;AAAA,QACjB,aAAa;AAAA,QACb,sBAAsB;AAAA,MACvB;AAAA,MACA,UAAU,CAAC,EAAE,aAAa;AACzB,cAAM,SAAsC,CAAA;AACxC,YAAA,CAAC,OAAO,iBAAiB;AAC5B,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,mBAAmB;AAAA,QACjE;AACI,YAAA,CAAC,OAAO,aAAa;AACxB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,eAAe;AAAA,QAClD,WAAA,OAAO,YAAY,SAAS,GAAG;AACzC,iBAAO,KAAK,EAAE,MAAM,iBAAiB,OAAO,eAAe;AAAA,QAAA,WACjD,CAAC,OAAO,sBAAsB;AACxC,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,wBAAwB;AAAA,QAC3D,WAAA,OAAO,gBAAgB,OAAO,sBAAsB;AAC9D,iBAAO,KAAK,EAAE,MAAM,qBAAqB,OAAO,wBAAwB;AAAA,QACzE;AACO,eAAA;AAAA,MACR;AAAA,MACA,SAAS,OAAO,EAAE,aAAa;AACvB,eAAA,MAAM,eAAe,MAAM;AAAA,MACnC;AAAA,MAEC;AAAA,IAAA;AAAA,IA5BF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAA;AAAAA,EAAA;AAgCF;AACA,MAAM,eAA6G;AAAA,EAClH,mBAAmB;AAAA,EACnB,UAAU;AAAA,EACV,iBAAiB;AAAA,EACjB,kBAAkB;AACnB;"}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxDevRuntime = require("react/jsx-dev-runtime");
4
+ const TenantForm = require("./TenantForm.cjs");
5
+ const contexts = require("../../contexts.cjs");
6
+ const useCreateApiKeyMutation = require("../../hooks/mutations/apiKey/useCreateApiKeyMutation.cjs");
7
+ const useCreateApiKeyForm = contexts.useForm;
8
+ const CreateApiKeyForm = ({ children, onSuccess, projectSlug, initialMemberships }) => {
9
+ const createApiKey = useCreateApiKeyMutation.useCreateApiKeyMutation();
10
+ return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
11
+ TenantForm.TenantForm,
12
+ {
13
+ onSuccess,
14
+ initialValues: {
15
+ description: "",
16
+ memberships: initialMemberships || []
17
+ },
18
+ validate: ({ values }) => {
19
+ const errors = [];
20
+ if (!values.description) {
21
+ errors.push({ code: "FIELD_REQUIRED", field: "description" });
22
+ }
23
+ if (values.memberships.length === 0) {
24
+ errors.push({ code: "FIELD_REQUIRED", field: "memberships" });
25
+ }
26
+ return errors;
27
+ },
28
+ execute: async ({ values }) => {
29
+ return await createApiKey({
30
+ description: values.description,
31
+ projectSlug,
32
+ memberships: values.memberships
33
+ });
34
+ },
35
+ errorMapping: errorToField,
36
+ children
37
+ },
38
+ void 0,
39
+ false,
40
+ {
41
+ fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/forms/CreateApiKeyForm.tsx",
42
+ lineNumber: 36,
43
+ columnNumber: 3
44
+ },
45
+ void 0
46
+ );
47
+ };
48
+ const errorToField = {
49
+ INVALID_MEMBERSHIP: "memberships",
50
+ PROJECT_NOT_FOUND: void 0,
51
+ ROLE_NOT_FOUND: "memberships",
52
+ VARIABLE_EMPTY: "memberships",
53
+ VARIABLE_NOT_FOUND: "memberships"
54
+ };
55
+ exports.CreateApiKeyForm = CreateApiKeyForm;
56
+ exports.useCreateApiKeyForm = useCreateApiKeyForm;
57
+ //# sourceMappingURL=CreateApiKeyForm.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CreateApiKeyForm.cjs","sources":["../../../../src/components/forms/CreateApiKeyForm.tsx"],"sourcesContent":["import { ReactElement } from 'react'\nimport { TenantForm } from './TenantForm'\nimport { FormContextValue, FormError, FormState } from '../../types'\nimport { useForm } from '../../contexts'\nimport { CreateApiKeyErrorCode, MembershipInput } from '@contember/graphql-client-tenant'\nimport { CreateApiKeyMutationResult, useCreateApiKeyMutation } from '../../hooks'\n\nexport type CreateApiKeyFormValues = {\n\tdescription: string\n\tmemberships: readonly MembershipInput[]\n}\n\nexport type CreateApiKeyFormErrorCode =\n\t| CreateApiKeyErrorCode\n\t| 'UNKNOWN_ERROR'\n\t| 'FIELD_REQUIRED'\n\nexport type CreateApiKeyFormState = FormState\n\nexport type CreateApiKeyFormError = FormError<CreateApiKeyFormValues, CreateApiKeyFormErrorCode>\n\nexport type CreateApiKeyFormContextValue = FormContextValue<CreateApiKeyFormValues, CreateApiKeyFormErrorCode>\n\nexport interface CreateApiKeyFormProps {\n\tchildren: ReactElement\n\tprojectSlug: string\n\tinitialMemberships?: readonly MembershipInput[]\n\tonSuccess?: (args: { result: CreateApiKeyMutationResult }) => void\n}\n\nexport const useCreateApiKeyForm = useForm as () => CreateApiKeyFormContextValue\n\nexport const CreateApiKeyForm = ({ children, onSuccess, projectSlug, initialMemberships }: CreateApiKeyFormProps) => {\n\tconst createApiKey = useCreateApiKeyMutation()\n\treturn (\n\t\t<TenantForm<CreateApiKeyFormContextValue, CreateApiKeyMutationResult>\n\t\t\tonSuccess={onSuccess}\n\t\t\tinitialValues={{\n\t\t\t\tdescription: '',\n\t\t\t\tmemberships: initialMemberships || [],\n\t\t\t}}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tconst errors: CreateApiKeyFormError[] = []\n\t\t\t\tif (!values.description) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'description' })\n\t\t\t\t}\n\t\t\t\tif (values.memberships.length === 0) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'memberships' })\n\t\t\t\t}\n\t\t\t\treturn errors\n\t\t\t}}\n\t\t\texecute={async ({ values }) => {\n\t\t\t\treturn await createApiKey({\n\t\t\t\t\tdescription: values.description,\n\t\t\t\t\tprojectSlug,\n\t\t\t\t\tmemberships: values.memberships,\n\t\t\t\t})\n\t\t\t}}\n\t\t\terrorMapping={errorToField}\n\t\t>\n\t\t\t{children}\n\t\t</TenantForm>\n\t)\n}\n\nconst errorToField: Record<CreateApiKeyErrorCode, keyof CreateApiKeyFormValues | undefined> = {\n\tINVALID_MEMBERSHIP: 'memberships',\n\tPROJECT_NOT_FOUND: undefined,\n\tROLE_NOT_FOUND: 'memberships',\n\tVARIABLE_EMPTY: 'memberships',\n\tVARIABLE_NOT_FOUND: 'memberships',\n}\n"],"names":["useForm","useCreateApiKeyMutation","jsxDEV","TenantForm","this"],"mappings":";;;;;;AA8BO,MAAM,sBAAsBA,SAAA;AAE5B,MAAM,mBAAmB,CAAC,EAAE,UAAU,WAAW,aAAa,yBAAgD;AACpH,QAAM,eAAeC,wBAAAA;AAEpB,SAAAC,8BAAA;AAAA,IAACC,WAAA;AAAA,IAAA;AAAA,MACA;AAAA,MACA,eAAe;AAAA,QACd,aAAa;AAAA,QACb,aAAa,sBAAsB,CAAC;AAAA,MACrC;AAAA,MACA,UAAU,CAAC,EAAE,aAAa;AACzB,cAAM,SAAkC,CAAA;AACpC,YAAA,CAAC,OAAO,aAAa;AACxB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,eAAe;AAAA,QAC7D;AACI,YAAA,OAAO,YAAY,WAAW,GAAG;AACpC,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,eAAe;AAAA,QAC7D;AACO,eAAA;AAAA,MACR;AAAA,MACA,SAAS,OAAO,EAAE,aAAa;AAC9B,eAAO,MAAM,aAAa;AAAA,UACzB,aAAa,OAAO;AAAA,UACpB;AAAA,UACA,aAAa,OAAO;AAAA,QAAA,CACpB;AAAA,MACF;AAAA,MACA,cAAc;AAAA,MAEb;AAAA,IAAA;AAAA,IAzBF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAC;AAAAA,EAAA;AA4BF;AAEA,MAAM,eAAwF;AAAA,EAC7F,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,oBAAoB;AACrB;;;"}
@@ -0,0 +1,57 @@
1
+ import { jsxDEV } from "react/jsx-dev-runtime";
2
+ import { TenantForm } from "./TenantForm.js";
3
+ import { useForm } from "../../contexts.js";
4
+ import { useCreateApiKeyMutation } from "../../hooks/mutations/apiKey/useCreateApiKeyMutation.js";
5
+ const useCreateApiKeyForm = useForm;
6
+ const CreateApiKeyForm = ({ children, onSuccess, projectSlug, initialMemberships }) => {
7
+ const createApiKey = useCreateApiKeyMutation();
8
+ return /* @__PURE__ */ jsxDEV(
9
+ TenantForm,
10
+ {
11
+ onSuccess,
12
+ initialValues: {
13
+ description: "",
14
+ memberships: initialMemberships || []
15
+ },
16
+ validate: ({ values }) => {
17
+ const errors = [];
18
+ if (!values.description) {
19
+ errors.push({ code: "FIELD_REQUIRED", field: "description" });
20
+ }
21
+ if (values.memberships.length === 0) {
22
+ errors.push({ code: "FIELD_REQUIRED", field: "memberships" });
23
+ }
24
+ return errors;
25
+ },
26
+ execute: async ({ values }) => {
27
+ return await createApiKey({
28
+ description: values.description,
29
+ projectSlug,
30
+ memberships: values.memberships
31
+ });
32
+ },
33
+ errorMapping: errorToField,
34
+ children
35
+ },
36
+ void 0,
37
+ false,
38
+ {
39
+ fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/forms/CreateApiKeyForm.tsx",
40
+ lineNumber: 36,
41
+ columnNumber: 3
42
+ },
43
+ void 0
44
+ );
45
+ };
46
+ const errorToField = {
47
+ INVALID_MEMBERSHIP: "memberships",
48
+ PROJECT_NOT_FOUND: void 0,
49
+ ROLE_NOT_FOUND: "memberships",
50
+ VARIABLE_EMPTY: "memberships",
51
+ VARIABLE_NOT_FOUND: "memberships"
52
+ };
53
+ export {
54
+ CreateApiKeyForm,
55
+ useCreateApiKeyForm
56
+ };
57
+ //# sourceMappingURL=CreateApiKeyForm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CreateApiKeyForm.js","sources":["../../../../src/components/forms/CreateApiKeyForm.tsx"],"sourcesContent":["import { ReactElement } from 'react'\nimport { TenantForm } from './TenantForm'\nimport { FormContextValue, FormError, FormState } from '../../types'\nimport { useForm } from '../../contexts'\nimport { CreateApiKeyErrorCode, MembershipInput } from '@contember/graphql-client-tenant'\nimport { CreateApiKeyMutationResult, useCreateApiKeyMutation } from '../../hooks'\n\nexport type CreateApiKeyFormValues = {\n\tdescription: string\n\tmemberships: readonly MembershipInput[]\n}\n\nexport type CreateApiKeyFormErrorCode =\n\t| CreateApiKeyErrorCode\n\t| 'UNKNOWN_ERROR'\n\t| 'FIELD_REQUIRED'\n\nexport type CreateApiKeyFormState = FormState\n\nexport type CreateApiKeyFormError = FormError<CreateApiKeyFormValues, CreateApiKeyFormErrorCode>\n\nexport type CreateApiKeyFormContextValue = FormContextValue<CreateApiKeyFormValues, CreateApiKeyFormErrorCode>\n\nexport interface CreateApiKeyFormProps {\n\tchildren: ReactElement\n\tprojectSlug: string\n\tinitialMemberships?: readonly MembershipInput[]\n\tonSuccess?: (args: { result: CreateApiKeyMutationResult }) => void\n}\n\nexport const useCreateApiKeyForm = useForm as () => CreateApiKeyFormContextValue\n\nexport const CreateApiKeyForm = ({ children, onSuccess, projectSlug, initialMemberships }: CreateApiKeyFormProps) => {\n\tconst createApiKey = useCreateApiKeyMutation()\n\treturn (\n\t\t<TenantForm<CreateApiKeyFormContextValue, CreateApiKeyMutationResult>\n\t\t\tonSuccess={onSuccess}\n\t\t\tinitialValues={{\n\t\t\t\tdescription: '',\n\t\t\t\tmemberships: initialMemberships || [],\n\t\t\t}}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tconst errors: CreateApiKeyFormError[] = []\n\t\t\t\tif (!values.description) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'description' })\n\t\t\t\t}\n\t\t\t\tif (values.memberships.length === 0) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'memberships' })\n\t\t\t\t}\n\t\t\t\treturn errors\n\t\t\t}}\n\t\t\texecute={async ({ values }) => {\n\t\t\t\treturn await createApiKey({\n\t\t\t\t\tdescription: values.description,\n\t\t\t\t\tprojectSlug,\n\t\t\t\t\tmemberships: values.memberships,\n\t\t\t\t})\n\t\t\t}}\n\t\t\terrorMapping={errorToField}\n\t\t>\n\t\t\t{children}\n\t\t</TenantForm>\n\t)\n}\n\nconst errorToField: Record<CreateApiKeyErrorCode, keyof CreateApiKeyFormValues | undefined> = {\n\tINVALID_MEMBERSHIP: 'memberships',\n\tPROJECT_NOT_FOUND: undefined,\n\tROLE_NOT_FOUND: 'memberships',\n\tVARIABLE_EMPTY: 'memberships',\n\tVARIABLE_NOT_FOUND: 'memberships',\n}\n"],"names":["this"],"mappings":";;;;AA8BO,MAAM,sBAAsB;AAE5B,MAAM,mBAAmB,CAAC,EAAE,UAAU,WAAW,aAAa,yBAAgD;AACpH,QAAM,eAAe;AAEpB,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACA;AAAA,MACA,eAAe;AAAA,QACd,aAAa;AAAA,QACb,aAAa,sBAAsB,CAAC;AAAA,MACrC;AAAA,MACA,UAAU,CAAC,EAAE,aAAa;AACzB,cAAM,SAAkC,CAAA;AACpC,YAAA,CAAC,OAAO,aAAa;AACxB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,eAAe;AAAA,QAC7D;AACI,YAAA,OAAO,YAAY,WAAW,GAAG;AACpC,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,eAAe;AAAA,QAC7D;AACO,eAAA;AAAA,MACR;AAAA,MACA,SAAS,OAAO,EAAE,aAAa;AAC9B,eAAO,MAAM,aAAa;AAAA,UACzB,aAAa,OAAO;AAAA,UACpB;AAAA,UACA,aAAa,OAAO;AAAA,QAAA,CACpB;AAAA,MACF;AAAA,MACA,cAAc;AAAA,MAEb;AAAA,IAAA;AAAA,IAzBF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAA;AAAAA,EAAA;AA4BF;AAEA,MAAM,eAAwF;AAAA,EAC7F,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,oBAAoB;AACrB;"}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxDevRuntime = require("react/jsx-dev-runtime");
4
+ const TenantForm = require("./TenantForm.cjs");
5
+ const contexts = require("../../contexts.cjs");
6
+ const useCreateSessionTokenMutation = require("../../hooks/mutations/apiKey/useCreateSessionTokenMutation.cjs");
7
+ const useCreateSessionTokenForm = contexts.useForm;
8
+ const CreateSessionTokenForm = ({ children, onSuccess, expiration, apiToken }) => {
9
+ const createSessionToken = useCreateSessionTokenMutation.useCreateSessionTokenMutation({ apiToken });
10
+ return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
11
+ TenantForm.TenantForm,
12
+ {
13
+ onSuccess,
14
+ initialValues: {
15
+ email: ""
16
+ },
17
+ validate: ({ values }) => {
18
+ const errors = [];
19
+ if (!values.email) {
20
+ errors.push({ code: "FIELD_REQUIRED", field: "email" });
21
+ }
22
+ return errors;
23
+ },
24
+ execute: async ({ values }) => {
25
+ return await createSessionToken({
26
+ email: values.email,
27
+ expiration
28
+ });
29
+ },
30
+ errorMapping: errorToField,
31
+ children
32
+ },
33
+ void 0,
34
+ false,
35
+ {
36
+ fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/forms/CreateSessionTokenForm.tsx",
37
+ lineNumber: 35,
38
+ columnNumber: 3
39
+ },
40
+ void 0
41
+ );
42
+ };
43
+ const errorToField = {
44
+ PERSON_DISABLED: "email",
45
+ UNKNOWN_EMAIL: "email",
46
+ UNKNOWN_PERSON_ID: "email"
47
+ };
48
+ exports.CreateSessionTokenForm = CreateSessionTokenForm;
49
+ exports.useCreateSessionTokenForm = useCreateSessionTokenForm;
50
+ //# sourceMappingURL=CreateSessionTokenForm.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CreateSessionTokenForm.cjs","sources":["../../../../src/components/forms/CreateSessionTokenForm.tsx"],"sourcesContent":["import { ReactElement } from 'react'\nimport { TenantForm } from './TenantForm'\nimport { FormContextValue, FormError, FormState } from '../../types'\nimport { useForm } from '../../contexts'\nimport { CreateSessionTokenErrorCode } from '@contember/graphql-client-tenant'\nimport { CreateSessionTokenMutationResult, useCreateSessionTokenMutation } from '../../hooks'\n\nexport type CreateSessionTokenFormValues = {\n\temail: string\n}\n\nexport type CreateSessionTokenFormErrorCode =\n\t| CreateSessionTokenErrorCode\n\t| 'UNKNOWN_ERROR'\n\t| 'FIELD_REQUIRED'\n\nexport type CreateSessionTokenFormState = FormState\n\nexport type CreateSessionTokenFormError = FormError<CreateSessionTokenFormValues, CreateSessionTokenFormErrorCode>\n\nexport type CreateSessionTokenFormContextValue = FormContextValue<CreateSessionTokenFormValues, CreateSessionTokenFormErrorCode>\n\nexport interface CreateSessionTokenFormProps {\n\tchildren: ReactElement\n\texpiration?: number\n\tapiToken?: string\n\tonSuccess?: (args: { result: CreateSessionTokenMutationResult }) => void\n}\n\nexport const useCreateSessionTokenForm = useForm as () => CreateSessionTokenFormContextValue\n\nexport const CreateSessionTokenForm = ({ children, onSuccess, expiration, apiToken }: CreateSessionTokenFormProps) => {\n\tconst createSessionToken = useCreateSessionTokenMutation({ apiToken })\n\treturn (\n\t\t<TenantForm<CreateSessionTokenFormContextValue, CreateSessionTokenMutationResult>\n\t\t\tonSuccess={onSuccess}\n\t\t\tinitialValues={{\n\t\t\t\temail: '',\n\t\t\t}}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tconst errors: CreateSessionTokenFormError[] = []\n\t\t\t\tif (!values.email) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'email' })\n\t\t\t\t}\n\t\t\t\treturn errors\n\t\t\t}}\n\t\t\texecute={async ({ values }) => {\n\t\t\t\treturn await createSessionToken({\n\t\t\t\t\temail: values.email,\n\t\t\t\t\texpiration,\n\t\t\t\t})\n\t\t\t}}\n\t\t\terrorMapping={errorToField}\n\t\t>\n\t\t\t{children}\n\t\t</TenantForm>\n\t)\n}\n\nconst errorToField: Record<CreateSessionTokenErrorCode, keyof CreateSessionTokenFormValues | undefined> = {\n\tPERSON_DISABLED: 'email',\n\tUNKNOWN_EMAIL: 'email',\n\tUNKNOWN_PERSON_ID: 'email',\n}\n"],"names":["useForm","useCreateSessionTokenMutation","jsxDEV","TenantForm","this"],"mappings":";;;;;;AA6BO,MAAM,4BAA4BA,SAAA;AAElC,MAAM,yBAAyB,CAAC,EAAE,UAAU,WAAW,YAAY,eAA4C;AACrH,QAAM,qBAAqBC,8BAAAA,8BAA8B,EAAE,SAAU,CAAA;AAEpE,SAAAC,8BAAA;AAAA,IAACC,WAAA;AAAA,IAAA;AAAA,MACA;AAAA,MACA,eAAe;AAAA,QACd,OAAO;AAAA,MACR;AAAA,MACA,UAAU,CAAC,EAAE,aAAa;AACzB,cAAM,SAAwC,CAAA;AAC1C,YAAA,CAAC,OAAO,OAAO;AAClB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,SAAS;AAAA,QACvD;AACO,eAAA;AAAA,MACR;AAAA,MACA,SAAS,OAAO,EAAE,aAAa;AAC9B,eAAO,MAAM,mBAAmB;AAAA,UAC/B,OAAO,OAAO;AAAA,UACd;AAAA,QAAA,CACA;AAAA,MACF;AAAA,MACA,cAAc;AAAA,MAEb;AAAA,IAAA;AAAA,IApBF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAC;AAAAA,EAAA;AAuBF;AAEA,MAAM,eAAoG;AAAA,EACzG,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,mBAAmB;AACpB;;;"}
@@ -0,0 +1,50 @@
1
+ import { jsxDEV } from "react/jsx-dev-runtime";
2
+ import { TenantForm } from "./TenantForm.js";
3
+ import { useForm } from "../../contexts.js";
4
+ import { useCreateSessionTokenMutation } from "../../hooks/mutations/apiKey/useCreateSessionTokenMutation.js";
5
+ const useCreateSessionTokenForm = useForm;
6
+ const CreateSessionTokenForm = ({ children, onSuccess, expiration, apiToken }) => {
7
+ const createSessionToken = useCreateSessionTokenMutation({ apiToken });
8
+ return /* @__PURE__ */ jsxDEV(
9
+ TenantForm,
10
+ {
11
+ onSuccess,
12
+ initialValues: {
13
+ email: ""
14
+ },
15
+ validate: ({ values }) => {
16
+ const errors = [];
17
+ if (!values.email) {
18
+ errors.push({ code: "FIELD_REQUIRED", field: "email" });
19
+ }
20
+ return errors;
21
+ },
22
+ execute: async ({ values }) => {
23
+ return await createSessionToken({
24
+ email: values.email,
25
+ expiration
26
+ });
27
+ },
28
+ errorMapping: errorToField,
29
+ children
30
+ },
31
+ void 0,
32
+ false,
33
+ {
34
+ fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/forms/CreateSessionTokenForm.tsx",
35
+ lineNumber: 35,
36
+ columnNumber: 3
37
+ },
38
+ void 0
39
+ );
40
+ };
41
+ const errorToField = {
42
+ PERSON_DISABLED: "email",
43
+ UNKNOWN_EMAIL: "email",
44
+ UNKNOWN_PERSON_ID: "email"
45
+ };
46
+ export {
47
+ CreateSessionTokenForm,
48
+ useCreateSessionTokenForm
49
+ };
50
+ //# sourceMappingURL=CreateSessionTokenForm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CreateSessionTokenForm.js","sources":["../../../../src/components/forms/CreateSessionTokenForm.tsx"],"sourcesContent":["import { ReactElement } from 'react'\nimport { TenantForm } from './TenantForm'\nimport { FormContextValue, FormError, FormState } from '../../types'\nimport { useForm } from '../../contexts'\nimport { CreateSessionTokenErrorCode } from '@contember/graphql-client-tenant'\nimport { CreateSessionTokenMutationResult, useCreateSessionTokenMutation } from '../../hooks'\n\nexport type CreateSessionTokenFormValues = {\n\temail: string\n}\n\nexport type CreateSessionTokenFormErrorCode =\n\t| CreateSessionTokenErrorCode\n\t| 'UNKNOWN_ERROR'\n\t| 'FIELD_REQUIRED'\n\nexport type CreateSessionTokenFormState = FormState\n\nexport type CreateSessionTokenFormError = FormError<CreateSessionTokenFormValues, CreateSessionTokenFormErrorCode>\n\nexport type CreateSessionTokenFormContextValue = FormContextValue<CreateSessionTokenFormValues, CreateSessionTokenFormErrorCode>\n\nexport interface CreateSessionTokenFormProps {\n\tchildren: ReactElement\n\texpiration?: number\n\tapiToken?: string\n\tonSuccess?: (args: { result: CreateSessionTokenMutationResult }) => void\n}\n\nexport const useCreateSessionTokenForm = useForm as () => CreateSessionTokenFormContextValue\n\nexport const CreateSessionTokenForm = ({ children, onSuccess, expiration, apiToken }: CreateSessionTokenFormProps) => {\n\tconst createSessionToken = useCreateSessionTokenMutation({ apiToken })\n\treturn (\n\t\t<TenantForm<CreateSessionTokenFormContextValue, CreateSessionTokenMutationResult>\n\t\t\tonSuccess={onSuccess}\n\t\t\tinitialValues={{\n\t\t\t\temail: '',\n\t\t\t}}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tconst errors: CreateSessionTokenFormError[] = []\n\t\t\t\tif (!values.email) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'email' })\n\t\t\t\t}\n\t\t\t\treturn errors\n\t\t\t}}\n\t\t\texecute={async ({ values }) => {\n\t\t\t\treturn await createSessionToken({\n\t\t\t\t\temail: values.email,\n\t\t\t\t\texpiration,\n\t\t\t\t})\n\t\t\t}}\n\t\t\terrorMapping={errorToField}\n\t\t>\n\t\t\t{children}\n\t\t</TenantForm>\n\t)\n}\n\nconst errorToField: Record<CreateSessionTokenErrorCode, keyof CreateSessionTokenFormValues | undefined> = {\n\tPERSON_DISABLED: 'email',\n\tUNKNOWN_EMAIL: 'email',\n\tUNKNOWN_PERSON_ID: 'email',\n}\n"],"names":["this"],"mappings":";;;;AA6BO,MAAM,4BAA4B;AAElC,MAAM,yBAAyB,CAAC,EAAE,UAAU,WAAW,YAAY,eAA4C;AACrH,QAAM,qBAAqB,8BAA8B,EAAE,SAAU,CAAA;AAEpE,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACA;AAAA,MACA,eAAe;AAAA,QACd,OAAO;AAAA,MACR;AAAA,MACA,UAAU,CAAC,EAAE,aAAa;AACzB,cAAM,SAAwC,CAAA;AAC1C,YAAA,CAAC,OAAO,OAAO;AAClB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,SAAS;AAAA,QACvD;AACO,eAAA;AAAA,MACR;AAAA,MACA,SAAS,OAAO,EAAE,aAAa;AAC9B,eAAO,MAAM,mBAAmB;AAAA,UAC/B,OAAO,OAAO;AAAA,UACd;AAAA,QAAA,CACA;AAAA,MACF;AAAA,MACA,cAAc;AAAA,MAEb;AAAA,IAAA;AAAA,IApBF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAA;AAAAA,EAAA;AAuBF;AAEA,MAAM,eAAoG;AAAA,EACzG,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,mBAAmB;AACpB;"}
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxDevRuntime = require("react/jsx-dev-runtime");
4
+ const TenantForm = require("./TenantForm.cjs");
5
+ const contexts = require("../../contexts.cjs");
6
+ const useInviteMutation = require("../../hooks/mutations/invite/useInviteMutation.cjs");
7
+ const useInviteForm = contexts.useForm;
8
+ const InviteForm = ({ children, onSuccess, projectSlug, initialMemberships, inviteOptions }) => {
9
+ const invite = useInviteMutation.useInviteMutation();
10
+ return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
11
+ TenantForm.TenantForm,
12
+ {
13
+ onSuccess,
14
+ initialValues: {
15
+ email: "",
16
+ name: "",
17
+ memberships: initialMemberships || []
18
+ },
19
+ validate: ({ values }) => {
20
+ const errors = [];
21
+ if (!values.email) {
22
+ errors.push({ code: "FIELD_REQUIRED", field: "email" });
23
+ }
24
+ if (values.memberships.length === 0) {
25
+ errors.push({ code: "FIELD_REQUIRED", field: "memberships" });
26
+ }
27
+ return errors;
28
+ },
29
+ execute: async ({ values }) => {
30
+ return await invite({
31
+ email: values.email,
32
+ name: values.name,
33
+ projectSlug,
34
+ options: inviteOptions,
35
+ memberships: values.memberships
36
+ });
37
+ },
38
+ errorMapping: errorToField,
39
+ children
40
+ },
41
+ void 0,
42
+ false,
43
+ {
44
+ fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/forms/InviteForm.tsx",
45
+ lineNumber: 38,
46
+ columnNumber: 3
47
+ },
48
+ void 0
49
+ );
50
+ };
51
+ const errorToField = {
52
+ ALREADY_MEMBER: "email",
53
+ INVALID_EMAIL_FORMAT: "email",
54
+ INVALID_MEMBERSHIP: "memberships",
55
+ PROJECT_NOT_FOUND: void 0,
56
+ ROLE_NOT_FOUND: "memberships",
57
+ VARIABLE_EMPTY: "memberships",
58
+ VARIABLE_NOT_FOUND: "memberships"
59
+ };
60
+ exports.InviteForm = InviteForm;
61
+ exports.useInviteForm = useInviteForm;
62
+ //# sourceMappingURL=InviteForm.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InviteForm.cjs","sources":["../../../../src/components/forms/InviteForm.tsx"],"sourcesContent":["import { ReactElement } from 'react'\nimport { TenantForm } from './TenantForm'\nimport { FormContextValue, FormError, FormState } from '../../types'\nimport { useForm } from '../../contexts'\nimport { InviteErrorCode, InviteOptions, MembershipInput } from '@contember/graphql-client-tenant'\nimport { InviteMutationResult, useInviteMutation } from '../../hooks'\n\nexport type InviteFormValues = {\n\temail: string\n\tname: string\n\tmemberships: readonly MembershipInput[]\n}\n\nexport type InviteFormErrorCode =\n\t| InviteErrorCode\n\t| 'UNKNOWN_ERROR'\n\t| 'FIELD_REQUIRED'\n\nexport type InviteFormState = FormState\n\nexport type InviteFormError = FormError<InviteFormValues, InviteFormErrorCode>\n\nexport type InviteFormContextValue = FormContextValue<InviteFormValues, InviteFormErrorCode>\n\nexport interface InviteFormProps {\n\tchildren: ReactElement\n\tprojectSlug: string\n\tinviteOptions?: InviteOptions\n\tinitialMemberships?: readonly MembershipInput[]\n\tonSuccess?: (args: { result: InviteMutationResult }) => void\n}\n\nexport const useInviteForm = useForm as () => InviteFormContextValue\n\nexport const InviteForm = ({ children, onSuccess, projectSlug, initialMemberships, inviteOptions }: InviteFormProps) => {\n\tconst invite = useInviteMutation()\n\treturn (\n\t\t<TenantForm<InviteFormContextValue, InviteMutationResult>\n\t\t\tonSuccess={onSuccess}\n\t\t\tinitialValues={{\n\t\t\t\temail: '',\n\t\t\t\tname: '',\n\t\t\t\tmemberships: initialMemberships || [],\n\t\t\t}}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tconst errors: InviteFormError[] = []\n\t\t\t\tif (!values.email) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'email' })\n\t\t\t\t}\n\t\t\t\tif (values.memberships.length === 0) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'memberships' })\n\t\t\t\t}\n\t\t\t\treturn errors\n\t\t\t}}\n\t\t\texecute={async ({ values }) => {\n\t\t\t\treturn await invite({\n\t\t\t\t\temail: values.email,\n\t\t\t\t\tname: values.name,\n\t\t\t\t\tprojectSlug,\n\t\t\t\t\toptions: inviteOptions,\n\t\t\t\t\tmemberships: values.memberships,\n\t\t\t\t})\n\t\t\t}}\n\t\t\terrorMapping={errorToField}\n\t\t>\n\t\t\t{children}\n\t\t</TenantForm>\n\t)\n}\n\nconst errorToField: Record<InviteErrorCode, keyof InviteFormValues | undefined> = {\n\tALREADY_MEMBER: 'email',\n\tINVALID_EMAIL_FORMAT: 'email',\n\tINVALID_MEMBERSHIP: 'memberships',\n\tPROJECT_NOT_FOUND: undefined,\n\tROLE_NOT_FOUND: 'memberships',\n\tVARIABLE_EMPTY: 'memberships',\n\tVARIABLE_NOT_FOUND: 'memberships',\n}\n"],"names":["useForm","useInviteMutation","jsxDEV","TenantForm","this"],"mappings":";;;;;;AAgCO,MAAM,gBAAgBA,SAAA;AAEhB,MAAA,aAAa,CAAC,EAAE,UAAU,WAAW,aAAa,oBAAoB,oBAAqC;AACvH,QAAM,SAASC,kBAAAA;AAEd,SAAAC,8BAAA;AAAA,IAACC,WAAA;AAAA,IAAA;AAAA,MACA;AAAA,MACA,eAAe;AAAA,QACd,OAAO;AAAA,QACP,MAAM;AAAA,QACN,aAAa,sBAAsB,CAAC;AAAA,MACrC;AAAA,MACA,UAAU,CAAC,EAAE,aAAa;AACzB,cAAM,SAA4B,CAAA;AAC9B,YAAA,CAAC,OAAO,OAAO;AAClB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,SAAS;AAAA,QACvD;AACI,YAAA,OAAO,YAAY,WAAW,GAAG;AACpC,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,eAAe;AAAA,QAC7D;AACO,eAAA;AAAA,MACR;AAAA,MACA,SAAS,OAAO,EAAE,aAAa;AAC9B,eAAO,MAAM,OAAO;AAAA,UACnB,OAAO,OAAO;AAAA,UACd,MAAM,OAAO;AAAA,UACb;AAAA,UACA,SAAS;AAAA,UACT,aAAa,OAAO;AAAA,QAAA,CACpB;AAAA,MACF;AAAA,MACA,cAAc;AAAA,MAEb;AAAA,IAAA;AAAA,IA5BF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAC;AAAAA,EAAA;AA+BF;AAEA,MAAM,eAA4E;AAAA,EACjF,gBAAgB;AAAA,EAChB,sBAAsB;AAAA,EACtB,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,oBAAoB;AACrB;;;"}