@contember/engine-tenant-api 2.0.0-alpha.32 → 2.0.0-alpha.35

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 (730) hide show
  1. package/dist/development/src/TenantContainer.cjs.map +1 -1
  2. package/dist/development/src/TenantContainer.js.map +1 -1
  3. package/dist/development/src/bridges/system/IdentityFetcher.cjs.map +1 -1
  4. package/dist/development/src/bridges/system/IdentityFetcher.js.map +1 -1
  5. package/dist/development/src/exceptions.cjs.map +1 -1
  6. package/dist/development/src/exceptions.js.map +1 -1
  7. package/dist/development/src/migrations/runner.cjs.map +1 -1
  8. package/dist/development/src/migrations/runner.js.map +1 -1
  9. package/dist/development/src/migrations/tenantCredentials.cjs.map +1 -1
  10. package/dist/development/src/migrations/tenantCredentials.js.map +1 -1
  11. package/dist/development/src/model/authorization/AclSchemaAccessNodeFactory.cjs.map +1 -1
  12. package/dist/development/src/model/authorization/AclSchemaAccessNodeFactory.js.map +1 -1
  13. package/dist/development/src/model/authorization/DirectPermissionsAccessNode.cjs.map +1 -1
  14. package/dist/development/src/model/authorization/DirectPermissionsAccessNode.js.map +1 -1
  15. package/dist/development/src/model/authorization/Identity.cjs.map +1 -1
  16. package/dist/development/src/model/authorization/Identity.js.map +1 -1
  17. package/dist/development/src/model/authorization/IdentityFactory.cjs.map +1 -1
  18. package/dist/development/src/model/authorization/IdentityFactory.js.map +1 -1
  19. package/dist/development/src/model/authorization/IdentityScope.cjs.map +1 -1
  20. package/dist/development/src/model/authorization/IdentityScope.js.map +1 -1
  21. package/dist/development/src/model/authorization/MembershipMatcher.cjs.map +1 -1
  22. package/dist/development/src/model/authorization/MembershipMatcher.js.map +1 -1
  23. package/dist/development/src/model/authorization/PermissionActions.cjs.map +1 -1
  24. package/dist/development/src/model/authorization/PermissionActions.js.map +1 -1
  25. package/dist/development/src/model/authorization/PermissionContext.cjs.map +1 -1
  26. package/dist/development/src/model/authorization/PermissionContext.js.map +1 -1
  27. package/dist/development/src/model/authorization/PermissionContextFactory.cjs.map +1 -1
  28. package/dist/development/src/model/authorization/PermissionContextFactory.js.map +1 -1
  29. package/dist/development/src/model/authorization/PermissionsFactory.cjs.map +1 -1
  30. package/dist/development/src/model/authorization/PermissionsFactory.js.map +1 -1
  31. package/dist/development/src/model/authorization/ProjectScope.cjs.map +1 -1
  32. package/dist/development/src/model/authorization/ProjectScope.js.map +1 -1
  33. package/dist/development/src/model/authorization/ProjectScopeFactory.cjs.map +1 -1
  34. package/dist/development/src/model/authorization/ProjectScopeFactory.js.map +1 -1
  35. package/dist/development/src/model/commands/CommandBus.cjs.map +1 -1
  36. package/dist/development/src/model/commands/CommandBus.js.map +1 -1
  37. package/dist/development/src/model/commands/apiKey/ApiKeyHelper.cjs.map +1 -1
  38. package/dist/development/src/model/commands/apiKey/ApiKeyHelper.js.map +1 -1
  39. package/dist/development/src/model/commands/apiKey/CreateApiKeyCommand.cjs.map +1 -1
  40. package/dist/development/src/model/commands/apiKey/CreateApiKeyCommand.js.map +1 -1
  41. package/dist/development/src/model/commands/apiKey/DisableApiKeyCommand.cjs.map +1 -1
  42. package/dist/development/src/model/commands/apiKey/DisableApiKeyCommand.js.map +1 -1
  43. package/dist/development/src/model/commands/apiKey/DisableIdentityApiKeysCommand.cjs.map +1 -1
  44. package/dist/development/src/model/commands/apiKey/DisableIdentityApiKeysCommand.js.map +1 -1
  45. package/dist/development/src/model/commands/apiKey/DisableOneOffApiKeyCommand.cjs.map +1 -1
  46. package/dist/development/src/model/commands/apiKey/DisableOneOffApiKeyCommand.js.map +1 -1
  47. package/dist/development/src/model/commands/apiKey/ProlongApiKeyCommand.cjs.map +1 -1
  48. package/dist/development/src/model/commands/apiKey/ProlongApiKeyCommand.js.map +1 -1
  49. package/dist/development/src/model/commands/configuration/UpdateConfigurationCommand.cjs.map +1 -1
  50. package/dist/development/src/model/commands/configuration/UpdateConfigurationCommand.js.map +1 -1
  51. package/dist/development/src/model/commands/identity/CreateIdentityCommand.cjs.map +1 -1
  52. package/dist/development/src/model/commands/identity/CreateIdentityCommand.js.map +1 -1
  53. package/dist/development/src/model/commands/identity/PatchIdentityGlobalRoles.cjs.map +1 -1
  54. package/dist/development/src/model/commands/identity/PatchIdentityGlobalRoles.js.map +1 -1
  55. package/dist/development/src/model/commands/idp/CreateIdpCommand.cjs.map +1 -1
  56. package/dist/development/src/model/commands/idp/CreateIdpCommand.js.map +1 -1
  57. package/dist/development/src/model/commands/idp/DisableIdpCommand.cjs.map +1 -1
  58. package/dist/development/src/model/commands/idp/DisableIdpCommand.js.map +1 -1
  59. package/dist/development/src/model/commands/idp/EnableIdpCommand.cjs.map +1 -1
  60. package/dist/development/src/model/commands/idp/EnableIdpCommand.js.map +1 -1
  61. package/dist/development/src/model/commands/idp/UpdateIdpCommand.cjs.map +1 -1
  62. package/dist/development/src/model/commands/idp/UpdateIdpCommand.js.map +1 -1
  63. package/dist/development/src/model/commands/mailTemplate/AddMailTemplateCommand.cjs.map +1 -1
  64. package/dist/development/src/model/commands/mailTemplate/AddMailTemplateCommand.js.map +1 -1
  65. package/dist/development/src/model/commands/mailTemplate/RemoveMailTemplateCommand.cjs.map +1 -1
  66. package/dist/development/src/model/commands/mailTemplate/RemoveMailTemplateCommand.js.map +1 -1
  67. package/dist/development/src/model/commands/membership/AddProjectMemberCommand.cjs.map +1 -1
  68. package/dist/development/src/model/commands/membership/AddProjectMemberCommand.js.map +1 -1
  69. package/dist/development/src/model/commands/membership/CreateOrUpdateProjectMembershipCommand.cjs.map +1 -1
  70. package/dist/development/src/model/commands/membership/CreateOrUpdateProjectMembershipCommand.js.map +1 -1
  71. package/dist/development/src/model/commands/membership/RemoveProjectMemberCommand.cjs.map +1 -1
  72. package/dist/development/src/model/commands/membership/RemoveProjectMemberCommand.js.map +1 -1
  73. package/dist/development/src/model/commands/membership/RemoveProjectMembershipsCommand.cjs.map +1 -1
  74. package/dist/development/src/model/commands/membership/RemoveProjectMembershipsCommand.js.map +1 -1
  75. package/dist/development/src/model/commands/membership/UpdateProjectMemberCommand.cjs.map +1 -1
  76. package/dist/development/src/model/commands/membership/UpdateProjectMemberCommand.js.map +1 -1
  77. package/dist/development/src/model/commands/membership/variables/PatchProjectMembershipVariableValuesCommand.cjs.map +1 -1
  78. package/dist/development/src/model/commands/membership/variables/PatchProjectMembershipVariableValuesCommand.js.map +1 -1
  79. package/dist/development/src/model/commands/membership/variables/PatchProjectMembershipVariablesCommand.cjs.map +1 -1
  80. package/dist/development/src/model/commands/membership/variables/PatchProjectMembershipVariablesCommand.js.map +1 -1
  81. package/dist/development/src/model/commands/membership/variables/SetProjectMembershipVariableValuesCommand.cjs.map +1 -1
  82. package/dist/development/src/model/commands/membership/variables/SetProjectMembershipVariableValuesCommand.js.map +1 -1
  83. package/dist/development/src/model/commands/otp/ConfirmOtpCommand.cjs.map +1 -1
  84. package/dist/development/src/model/commands/otp/ConfirmOtpCommand.js.map +1 -1
  85. package/dist/development/src/model/commands/otp/DisableOtpCommand.cjs.map +1 -1
  86. package/dist/development/src/model/commands/otp/DisableOtpCommand.js.map +1 -1
  87. package/dist/development/src/model/commands/otp/PrepareOtpCommand.cjs.map +1 -1
  88. package/dist/development/src/model/commands/otp/PrepareOtpCommand.js.map +1 -1
  89. package/dist/development/src/model/commands/person/ChangePasswordCommand.cjs.map +1 -1
  90. package/dist/development/src/model/commands/person/ChangePasswordCommand.js.map +1 -1
  91. package/dist/development/src/model/commands/person/ChangeProfileCommand.cjs.map +1 -1
  92. package/dist/development/src/model/commands/person/ChangeProfileCommand.js.map +1 -1
  93. package/dist/development/src/model/commands/person/CreatePersonCommand.cjs.map +1 -1
  94. package/dist/development/src/model/commands/person/CreatePersonCommand.js.map +1 -1
  95. package/dist/development/src/model/commands/person/CreatePersonIdentityProviderIdentifierCommand.cjs.map +1 -1
  96. package/dist/development/src/model/commands/person/CreatePersonIdentityProviderIdentifierCommand.js.map +1 -1
  97. package/dist/development/src/model/commands/person/DisablePersonCommand.cjs.map +1 -1
  98. package/dist/development/src/model/commands/person/DisablePersonCommand.js.map +1 -1
  99. package/dist/development/src/model/commands/person/TogglePersonPasswordlessCommand.cjs.map +1 -1
  100. package/dist/development/src/model/commands/person/TogglePersonPasswordlessCommand.js.map +1 -1
  101. package/dist/development/src/model/commands/personToken/ActivateOtpCommand.cjs.map +1 -1
  102. package/dist/development/src/model/commands/personToken/ActivateOtpCommand.js.map +1 -1
  103. package/dist/development/src/model/commands/personToken/CreatePersonTokenCommand.cjs.map +1 -1
  104. package/dist/development/src/model/commands/personToken/CreatePersonTokenCommand.js.map +1 -1
  105. package/dist/development/src/model/commands/personToken/IncreaseOtpAttemptCommand.cjs.map +1 -1
  106. package/dist/development/src/model/commands/personToken/IncreaseOtpAttemptCommand.js.map +1 -1
  107. package/dist/development/src/model/commands/personToken/InvalidateTokenCommand.cjs.map +1 -1
  108. package/dist/development/src/model/commands/personToken/InvalidateTokenCommand.js.map +1 -1
  109. package/dist/development/src/model/commands/personToken/ResetPasswordCommand.cjs.map +1 -1
  110. package/dist/development/src/model/commands/personToken/ResetPasswordCommand.js.map +1 -1
  111. package/dist/development/src/model/commands/personToken/SavePersonTokenCommand.cjs.map +1 -1
  112. package/dist/development/src/model/commands/personToken/SavePersonTokenCommand.js.map +1 -1
  113. package/dist/development/src/model/commands/project/CreateProjectCommand.cjs.map +1 -1
  114. package/dist/development/src/model/commands/project/CreateProjectCommand.js.map +1 -1
  115. package/dist/development/src/model/commands/project/SetProjectSecretCommand.cjs.map +1 -1
  116. package/dist/development/src/model/commands/project/SetProjectSecretCommand.js.map +1 -1
  117. package/dist/development/src/model/commands/project/UpdateProjectCommand.cjs.map +1 -1
  118. package/dist/development/src/model/commands/project/UpdateProjectCommand.js.map +1 -1
  119. package/dist/development/src/model/dtos/Password.cjs.map +1 -1
  120. package/dist/development/src/model/dtos/Password.js.map +1 -1
  121. package/dist/development/src/model/mailing/UserMailer.cjs.map +1 -1
  122. package/dist/development/src/model/mailing/UserMailer.js.map +1 -1
  123. package/dist/development/src/model/mailing/templates/ExistingUserInvited.mustache.cjs.map +1 -1
  124. package/dist/development/src/model/mailing/templates/ExistingUserInvited.mustache.js.map +1 -1
  125. package/dist/development/src/model/mailing/templates/NewUserInvited.mustache.cjs.map +1 -1
  126. package/dist/development/src/model/mailing/templates/NewUserInvited.mustache.js.map +1 -1
  127. package/dist/development/src/model/mailing/templates/PasswordReset.mustache.cjs.map +1 -1
  128. package/dist/development/src/model/mailing/templates/PasswordReset.mustache.js.map +1 -1
  129. package/dist/development/src/model/mailing/templates/PasswordlessSignIn.mustache.cjs.map +1 -1
  130. package/dist/development/src/model/mailing/templates/PasswordlessSignIn.mustache.js.map +1 -1
  131. package/dist/development/src/model/mailing/type.cjs.map +1 -1
  132. package/dist/development/src/model/mailing/type.js.map +1 -1
  133. package/dist/development/src/model/queries/apiKey/ApiKeyQuery.cjs.map +1 -1
  134. package/dist/development/src/model/queries/apiKey/ApiKeyQuery.js.map +1 -1
  135. package/dist/development/src/model/queries/configuration/ConfigurationQuery.cjs.map +1 -1
  136. package/dist/development/src/model/queries/configuration/ConfigurationQuery.js.map +1 -1
  137. package/dist/development/src/model/queries/identity/IdentityQuery.cjs.map +1 -1
  138. package/dist/development/src/model/queries/identity/IdentityQuery.js.map +1 -1
  139. package/dist/development/src/model/queries/idp/IdentityProviderBySlugQuery.cjs.map +1 -1
  140. package/dist/development/src/model/queries/idp/IdentityProviderBySlugQuery.js.map +1 -1
  141. package/dist/development/src/model/queries/idp/IdentityProvidersQuery.cjs.map +1 -1
  142. package/dist/development/src/model/queries/idp/IdentityProvidersQuery.js.map +1 -1
  143. package/dist/development/src/model/queries/idp/helpers.cjs.map +1 -1
  144. package/dist/development/src/model/queries/idp/helpers.js.map +1 -1
  145. package/dist/development/src/model/queries/mailTemplate/MailTemplateListQuery.cjs.map +1 -1
  146. package/dist/development/src/model/queries/mailTemplate/MailTemplateListQuery.js.map +1 -1
  147. package/dist/development/src/model/queries/mailTemplate/MailTemplateQuery.cjs.map +1 -1
  148. package/dist/development/src/model/queries/mailTemplate/MailTemplateQuery.js.map +1 -1
  149. package/dist/development/src/model/queries/membership/ProjectMembersQuery.cjs.map +1 -1
  150. package/dist/development/src/model/queries/membership/ProjectMembersQuery.js.map +1 -1
  151. package/dist/development/src/model/queries/membership/ProjectMembershipByIdentityQuery.cjs.map +1 -1
  152. package/dist/development/src/model/queries/membership/ProjectMembershipByIdentityQuery.js.map +1 -1
  153. package/dist/development/src/model/queries/membership/ProjectRolesByIdentityQuery.cjs.map +1 -1
  154. package/dist/development/src/model/queries/membership/ProjectRolesByIdentityQuery.js.map +1 -1
  155. package/dist/development/src/model/queries/membership/ProjectSlugSpecification.cjs.map +1 -1
  156. package/dist/development/src/model/queries/membership/ProjectSlugSpecification.js.map +1 -1
  157. package/dist/development/src/model/queries/person/PersonByIdPQuery.cjs.map +1 -1
  158. package/dist/development/src/model/queries/person/PersonByIdPQuery.js.map +1 -1
  159. package/dist/development/src/model/queries/person/PersonByIdentityBatchQuery.cjs.map +1 -1
  160. package/dist/development/src/model/queries/person/PersonByIdentityBatchQuery.js.map +1 -1
  161. package/dist/development/src/model/queries/person/PersonQuery.cjs.map +1 -1
  162. package/dist/development/src/model/queries/person/PersonQuery.js.map +1 -1
  163. package/dist/development/src/model/queries/person/PersonQueryBuilderFactory.cjs.map +1 -1
  164. package/dist/development/src/model/queries/person/PersonQueryBuilderFactory.js.map +1 -1
  165. package/dist/development/src/model/queries/personToken/PersonTokenQuery.cjs.map +1 -1
  166. package/dist/development/src/model/queries/personToken/PersonTokenQuery.js.map +1 -1
  167. package/dist/development/src/model/queries/project/ProjectBySlugQuery.cjs.map +1 -1
  168. package/dist/development/src/model/queries/project/ProjectBySlugQuery.js.map +1 -1
  169. package/dist/development/src/model/queries/project/ProjectSecretsQuery.cjs.map +1 -1
  170. package/dist/development/src/model/queries/project/ProjectSecretsQuery.js.map +1 -1
  171. package/dist/development/src/model/queries/project/ProjectUpdateTimestampQuery.cjs.map +1 -1
  172. package/dist/development/src/model/queries/project/ProjectUpdateTimestampQuery.js.map +1 -1
  173. package/dist/development/src/model/queries/project/ProjectsByIdentityQuery.cjs.map +1 -1
  174. package/dist/development/src/model/queries/project/ProjectsByIdentityQuery.js.map +1 -1
  175. package/dist/development/src/model/queries/project/ProjectsQuery.cjs.map +1 -1
  176. package/dist/development/src/model/queries/project/ProjectsQuery.js.map +1 -1
  177. package/dist/development/src/model/service/ConfigurationManager.cjs.map +1 -1
  178. package/dist/development/src/model/service/ConfigurationManager.js.map +1 -1
  179. package/dist/development/src/model/service/EmailValidator.cjs.map +1 -1
  180. package/dist/development/src/model/service/EmailValidator.js.map +1 -1
  181. package/dist/development/src/model/service/IDPSignInManager.cjs.map +1 -1
  182. package/dist/development/src/model/service/IDPSignInManager.js.map +1 -1
  183. package/dist/development/src/model/service/InviteManager.cjs.map +1 -1
  184. package/dist/development/src/model/service/InviteManager.js.map +1 -1
  185. package/dist/development/src/model/service/MailTemplateManager.cjs.map +1 -1
  186. package/dist/development/src/model/service/MailTemplateManager.js.map +1 -1
  187. package/dist/development/src/model/service/MembershipValidator.cjs.map +1 -1
  188. package/dist/development/src/model/service/MembershipValidator.js.map +1 -1
  189. package/dist/development/src/model/service/OtpAuthenticator.cjs.map +1 -1
  190. package/dist/development/src/model/service/OtpAuthenticator.js.map +1 -1
  191. package/dist/development/src/model/service/OtpManager.cjs.map +1 -1
  192. package/dist/development/src/model/service/OtpManager.js.map +1 -1
  193. package/dist/development/src/model/service/PasswordChangeManager.cjs.map +1 -1
  194. package/dist/development/src/model/service/PasswordChangeManager.js.map +1 -1
  195. package/dist/development/src/model/service/PasswordResetManager.cjs.map +1 -1
  196. package/dist/development/src/model/service/PasswordResetManager.js.map +1 -1
  197. package/dist/development/src/model/service/PasswordlessSignInManager.cjs.map +1 -1
  198. package/dist/development/src/model/service/PasswordlessSignInManager.js.map +1 -1
  199. package/dist/development/src/model/service/PersonAccessManager.cjs.map +1 -1
  200. package/dist/development/src/model/service/PersonAccessManager.js.map +1 -1
  201. package/dist/development/src/model/service/PersonManager.cjs.map +1 -1
  202. package/dist/development/src/model/service/PersonManager.js.map +1 -1
  203. package/dist/development/src/model/service/ProjectManager.cjs.map +1 -1
  204. package/dist/development/src/model/service/ProjectManager.js.map +1 -1
  205. package/dist/development/src/model/service/ProjectMemberManager.cjs.map +1 -1
  206. package/dist/development/src/model/service/ProjectMemberManager.js.map +1 -1
  207. package/dist/development/src/model/service/RolesManager.cjs.map +1 -1
  208. package/dist/development/src/model/service/RolesManager.js.map +1 -1
  209. package/dist/development/src/model/service/SecretsManager.cjs.map +1 -1
  210. package/dist/development/src/model/service/SecretsManager.js.map +1 -1
  211. package/dist/development/src/model/service/SignInManager.cjs.map +1 -1
  212. package/dist/development/src/model/service/SignInManager.js.map +1 -1
  213. package/dist/development/src/model/service/SignUpManager.cjs.map +1 -1
  214. package/dist/development/src/model/service/SignUpManager.js.map +1 -1
  215. package/dist/development/src/model/service/apiKey/ApiKeyManager.cjs.map +1 -1
  216. package/dist/development/src/model/service/apiKey/ApiKeyManager.js.map +1 -1
  217. package/dist/development/src/model/service/apiKey/ApiKeyService.cjs.map +1 -1
  218. package/dist/development/src/model/service/apiKey/ApiKeyService.js.map +1 -1
  219. package/dist/development/src/model/service/helpers/getPreferredProject.cjs.map +1 -1
  220. package/dist/development/src/model/service/helpers/getPreferredProject.js.map +1 -1
  221. package/dist/development/src/model/service/idp/IDPHandlerRegistry.cjs.map +1 -1
  222. package/dist/development/src/model/service/idp/IDPHandlerRegistry.js.map +1 -1
  223. package/dist/development/src/model/service/idp/IDPManager.cjs.map +1 -1
  224. package/dist/development/src/model/service/idp/IDPManager.js.map +1 -1
  225. package/dist/development/src/model/service/idp/IDPResponseError.cjs.map +1 -1
  226. package/dist/development/src/model/service/idp/IDPResponseError.js.map +1 -1
  227. package/dist/development/src/model/service/idp/IDPValidationError.cjs.map +1 -1
  228. package/dist/development/src/model/service/idp/IDPValidationError.js.map +1 -1
  229. package/dist/development/src/model/service/idp/IdentityProviderNotFoundError.cjs.map +1 -1
  230. package/dist/development/src/model/service/idp/IdentityProviderNotFoundError.js.map +1 -1
  231. package/dist/development/src/model/service/idp/InvalidIDPConfigurationError.cjs.map +1 -1
  232. package/dist/development/src/model/service/idp/InvalidIDPConfigurationError.js.map +1 -1
  233. package/dist/development/src/model/service/idp/providers/AppleProvider.cjs.map +1 -1
  234. package/dist/development/src/model/service/idp/providers/AppleProvider.js.map +1 -1
  235. package/dist/development/src/model/service/idp/providers/FacebookProvider.cjs.map +1 -1
  236. package/dist/development/src/model/service/idp/providers/FacebookProvider.js.map +1 -1
  237. package/dist/development/src/model/service/idp/providers/OIDCHelpers.cjs.map +1 -1
  238. package/dist/development/src/model/service/idp/providers/OIDCHelpers.js.map +1 -1
  239. package/dist/development/src/model/service/idp/providers/OIDCProvider.cjs.map +1 -1
  240. package/dist/development/src/model/service/idp/providers/OIDCProvider.js.map +1 -1
  241. package/dist/development/src/model/service/idp/providers/OIDCTypes.cjs.map +1 -1
  242. package/dist/development/src/model/service/idp/providers/OIDCTypes.js.map +1 -1
  243. package/dist/development/src/model/service/idp/providers/helpers.cjs.map +1 -1
  244. package/dist/development/src/model/service/idp/providers/helpers.js.map +1 -1
  245. package/dist/development/src/model/service/membershipUtils.cjs.map +1 -1
  246. package/dist/development/src/model/service/membershipUtils.js.map +1 -1
  247. package/dist/development/src/model/type/ApiKey.cjs.map +1 -1
  248. package/dist/development/src/model/type/ApiKey.js.map +1 -1
  249. package/dist/development/src/model/utils/DatabaseContext.cjs.map +1 -1
  250. package/dist/development/src/model/utils/DatabaseContext.js.map +1 -1
  251. package/dist/development/src/model/utils/Response.cjs.map +1 -1
  252. package/dist/development/src/model/utils/Response.js.map +1 -1
  253. package/dist/development/src/model/utils/password.cjs.map +1 -1
  254. package/dist/development/src/model/utils/password.js.map +1 -1
  255. package/dist/development/src/model/utils/tokenUtils.cjs.map +1 -1
  256. package/dist/development/src/model/utils/tokenUtils.js.map +1 -1
  257. package/dist/development/src/resolvers/ResolverFactory.cjs.map +1 -1
  258. package/dist/development/src/resolvers/ResolverFactory.js.map +1 -1
  259. package/dist/development/src/resolvers/TenantResolverContextFactory.cjs.map +1 -1
  260. package/dist/development/src/resolvers/TenantResolverContextFactory.js.map +1 -1
  261. package/dist/development/src/resolvers/errorUtils.cjs.map +1 -1
  262. package/dist/development/src/resolvers/errorUtils.js.map +1 -1
  263. package/dist/development/src/resolvers/membershipUtils.cjs.map +1 -1
  264. package/dist/development/src/resolvers/membershipUtils.js.map +1 -1
  265. package/dist/development/src/resolvers/mutation/apiKey/CreateApiKeyMutationResolver.cjs.map +1 -1
  266. package/dist/development/src/resolvers/mutation/apiKey/CreateApiKeyMutationResolver.js.map +1 -1
  267. package/dist/development/src/resolvers/mutation/apiKey/DisableApiKeyMutationResolver.cjs.map +1 -1
  268. package/dist/development/src/resolvers/mutation/apiKey/DisableApiKeyMutationResolver.js.map +1 -1
  269. package/dist/development/src/resolvers/mutation/configuration/ConfigurationMutationResolver.cjs.map +1 -1
  270. package/dist/development/src/resolvers/mutation/configuration/ConfigurationMutationResolver.js.map +1 -1
  271. package/dist/development/src/resolvers/mutation/identity/GlobalRolesMutationResolver.cjs.map +1 -1
  272. package/dist/development/src/resolvers/mutation/identity/GlobalRolesMutationResolver.js.map +1 -1
  273. package/dist/development/src/resolvers/mutation/idp/AddIDPMutationResolver.cjs.map +1 -1
  274. package/dist/development/src/resolvers/mutation/idp/AddIDPMutationResolver.js.map +1 -1
  275. package/dist/development/src/resolvers/mutation/idp/DisableIDPMutationResolver.cjs.map +1 -1
  276. package/dist/development/src/resolvers/mutation/idp/DisableIDPMutationResolver.js.map +1 -1
  277. package/dist/development/src/resolvers/mutation/idp/EnableIDPMutationResolver.cjs.map +1 -1
  278. package/dist/development/src/resolvers/mutation/idp/EnableIDPMutationResolver.js.map +1 -1
  279. package/dist/development/src/resolvers/mutation/idp/UpdateIDPMutationResolver.cjs.map +1 -1
  280. package/dist/development/src/resolvers/mutation/idp/UpdateIDPMutationResolver.js.map +1 -1
  281. package/dist/development/src/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.cjs.map +1 -1
  282. package/dist/development/src/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.js.map +1 -1
  283. package/dist/development/src/resolvers/mutation/person/ChangePasswordMutationResolver.cjs.map +1 -1
  284. package/dist/development/src/resolvers/mutation/person/ChangePasswordMutationResolver.js.map +1 -1
  285. package/dist/development/src/resolvers/mutation/person/ChangeProfileMutationResolver.cjs.map +1 -1
  286. package/dist/development/src/resolvers/mutation/person/ChangeProfileMutationResolver.js.map +1 -1
  287. package/dist/development/src/resolvers/mutation/person/DisablePersonMutationResolver.cjs.map +1 -1
  288. package/dist/development/src/resolvers/mutation/person/DisablePersonMutationResolver.js.map +1 -1
  289. package/dist/development/src/resolvers/mutation/person/IDPMutationResolver.cjs.map +1 -1
  290. package/dist/development/src/resolvers/mutation/person/IDPMutationResolver.js.map +1 -1
  291. package/dist/development/src/resolvers/mutation/person/InviteMutationResolver.cjs.map +1 -1
  292. package/dist/development/src/resolvers/mutation/person/InviteMutationResolver.js.map +1 -1
  293. package/dist/development/src/resolvers/mutation/person/OtpMutationResolver.cjs.map +1 -1
  294. package/dist/development/src/resolvers/mutation/person/OtpMutationResolver.js.map +1 -1
  295. package/dist/development/src/resolvers/mutation/person/PasswordlessMutationResolver.cjs.map +1 -1
  296. package/dist/development/src/resolvers/mutation/person/PasswordlessMutationResolver.js.map +1 -1
  297. package/dist/development/src/resolvers/mutation/person/ResetPasswordMutationResolver.cjs.map +1 -1
  298. package/dist/development/src/resolvers/mutation/person/ResetPasswordMutationResolver.js.map +1 -1
  299. package/dist/development/src/resolvers/mutation/person/SignInMutationResolver.cjs.map +1 -1
  300. package/dist/development/src/resolvers/mutation/person/SignInMutationResolver.js.map +1 -1
  301. package/dist/development/src/resolvers/mutation/person/SignOutMutationResolver.cjs.map +1 -1
  302. package/dist/development/src/resolvers/mutation/person/SignOutMutationResolver.js.map +1 -1
  303. package/dist/development/src/resolvers/mutation/person/SignUpMutationResolver.cjs.map +1 -1
  304. package/dist/development/src/resolvers/mutation/person/SignUpMutationResolver.js.map +1 -1
  305. package/dist/development/src/resolvers/mutation/person/TogglePasswordlessMutationResolver.cjs.map +1 -1
  306. package/dist/development/src/resolvers/mutation/person/TogglePasswordlessMutationResolver.js.map +1 -1
  307. package/dist/development/src/resolvers/mutation/project/CreateProjectMutationResolver.cjs.map +1 -1
  308. package/dist/development/src/resolvers/mutation/project/CreateProjectMutationResolver.js.map +1 -1
  309. package/dist/development/src/resolvers/mutation/project/SetProjectSecretMutationResolver.cjs.map +1 -1
  310. package/dist/development/src/resolvers/mutation/project/SetProjectSecretMutationResolver.js.map +1 -1
  311. package/dist/development/src/resolvers/mutation/project/UpdateProjectMutationResolver.cjs.map +1 -1
  312. package/dist/development/src/resolvers/mutation/project/UpdateProjectMutationResolver.js.map +1 -1
  313. package/dist/development/src/resolvers/mutation/projectMember/AddProjectMemberMutationResolver.cjs.map +1 -1
  314. package/dist/development/src/resolvers/mutation/projectMember/AddProjectMemberMutationResolver.js.map +1 -1
  315. package/dist/development/src/resolvers/mutation/projectMember/RemoveProjectMemberMutationResolver.cjs.map +1 -1
  316. package/dist/development/src/resolvers/mutation/projectMember/RemoveProjectMemberMutationResolver.js.map +1 -1
  317. package/dist/development/src/resolvers/mutation/projectMember/UpdateProjectMemberMutationResolver.cjs.map +1 -1
  318. package/dist/development/src/resolvers/mutation/projectMember/UpdateProjectMemberMutationResolver.js.map +1 -1
  319. package/dist/development/src/resolvers/query/ConfigurationQueryResolver.cjs.map +1 -1
  320. package/dist/development/src/resolvers/query/ConfigurationQueryResolver.js.map +1 -1
  321. package/dist/development/src/resolvers/query/IDPQueryResolver.cjs.map +1 -1
  322. package/dist/development/src/resolvers/query/IDPQueryResolver.js.map +1 -1
  323. package/dist/development/src/resolvers/query/MailTemplateQueryResolver.cjs.map +1 -1
  324. package/dist/development/src/resolvers/query/MailTemplateQueryResolver.js.map +1 -1
  325. package/dist/development/src/resolvers/query/MeQueryResolver.cjs.map +1 -1
  326. package/dist/development/src/resolvers/query/MeQueryResolver.js.map +1 -1
  327. package/dist/development/src/resolvers/query/PersonQueryResolver.cjs.map +1 -1
  328. package/dist/development/src/resolvers/query/PersonQueryResolver.js.map +1 -1
  329. package/dist/development/src/resolvers/query/ProjectMembersQueryResolver.cjs.map +1 -1
  330. package/dist/development/src/resolvers/query/ProjectMembersQueryResolver.js.map +1 -1
  331. package/dist/development/src/resolvers/query/ProjectQueryResolver.cjs.map +1 -1
  332. package/dist/development/src/resolvers/query/ProjectQueryResolver.js.map +1 -1
  333. package/dist/development/src/resolvers/responseHelpers/PersonResponseFactory.cjs.map +1 -1
  334. package/dist/development/src/resolvers/responseHelpers/PersonResponseFactory.js.map +1 -1
  335. package/dist/development/src/resolvers/responseHelpers/SignInResponseFactory.cjs.map +1 -1
  336. package/dist/development/src/resolvers/responseHelpers/SignInResponseFactory.js.map +1 -1
  337. package/dist/development/src/resolvers/types/IdentityTypeResolver.cjs.map +1 -1
  338. package/dist/development/src/resolvers/types/IdentityTypeResolver.js.map +1 -1
  339. package/dist/development/src/resolvers/types/ProjectTypeResolver.cjs.map +1 -1
  340. package/dist/development/src/resolvers/types/ProjectTypeResolver.js.map +1 -1
  341. package/dist/development/src/schema/tenant.graphql.cjs.map +1 -1
  342. package/dist/development/src/utils/Mailer.cjs.map +1 -1
  343. package/dist/development/src/utils/Mailer.js.map +1 -1
  344. package/dist/development/src/utils/TemplateRenderer.cjs.map +1 -1
  345. package/dist/development/src/utils/TemplateRenderer.js.map +1 -1
  346. package/dist/development/src/utils/array.cjs.map +1 -1
  347. package/dist/development/src/utils/array.js.map +1 -1
  348. package/dist/development/src/utils/batchQuery.cjs.map +1 -1
  349. package/dist/development/src/utils/batchQuery.js.map +1 -1
  350. package/dist/production/src/TenantContainer.cjs.map +1 -1
  351. package/dist/production/src/TenantContainer.js.map +1 -1
  352. package/dist/production/src/bridges/system/IdentityFetcher.cjs.map +1 -1
  353. package/dist/production/src/bridges/system/IdentityFetcher.js.map +1 -1
  354. package/dist/production/src/exceptions.cjs.map +1 -1
  355. package/dist/production/src/exceptions.js.map +1 -1
  356. package/dist/production/src/migrations/runner.cjs.map +1 -1
  357. package/dist/production/src/migrations/runner.js.map +1 -1
  358. package/dist/production/src/migrations/tenantCredentials.cjs.map +1 -1
  359. package/dist/production/src/migrations/tenantCredentials.js.map +1 -1
  360. package/dist/production/src/model/authorization/AclSchemaAccessNodeFactory.cjs.map +1 -1
  361. package/dist/production/src/model/authorization/AclSchemaAccessNodeFactory.js.map +1 -1
  362. package/dist/production/src/model/authorization/DirectPermissionsAccessNode.cjs.map +1 -1
  363. package/dist/production/src/model/authorization/DirectPermissionsAccessNode.js.map +1 -1
  364. package/dist/production/src/model/authorization/Identity.cjs.map +1 -1
  365. package/dist/production/src/model/authorization/Identity.js.map +1 -1
  366. package/dist/production/src/model/authorization/IdentityFactory.cjs.map +1 -1
  367. package/dist/production/src/model/authorization/IdentityFactory.js.map +1 -1
  368. package/dist/production/src/model/authorization/IdentityScope.cjs.map +1 -1
  369. package/dist/production/src/model/authorization/IdentityScope.js.map +1 -1
  370. package/dist/production/src/model/authorization/MembershipMatcher.cjs.map +1 -1
  371. package/dist/production/src/model/authorization/MembershipMatcher.js.map +1 -1
  372. package/dist/production/src/model/authorization/PermissionActions.cjs.map +1 -1
  373. package/dist/production/src/model/authorization/PermissionActions.js.map +1 -1
  374. package/dist/production/src/model/authorization/PermissionContext.cjs.map +1 -1
  375. package/dist/production/src/model/authorization/PermissionContext.js.map +1 -1
  376. package/dist/production/src/model/authorization/PermissionContextFactory.cjs.map +1 -1
  377. package/dist/production/src/model/authorization/PermissionContextFactory.js.map +1 -1
  378. package/dist/production/src/model/authorization/PermissionsFactory.cjs.map +1 -1
  379. package/dist/production/src/model/authorization/PermissionsFactory.js.map +1 -1
  380. package/dist/production/src/model/authorization/ProjectScope.cjs.map +1 -1
  381. package/dist/production/src/model/authorization/ProjectScope.js.map +1 -1
  382. package/dist/production/src/model/authorization/ProjectScopeFactory.cjs.map +1 -1
  383. package/dist/production/src/model/authorization/ProjectScopeFactory.js.map +1 -1
  384. package/dist/production/src/model/commands/CommandBus.cjs.map +1 -1
  385. package/dist/production/src/model/commands/CommandBus.js.map +1 -1
  386. package/dist/production/src/model/commands/apiKey/ApiKeyHelper.cjs.map +1 -1
  387. package/dist/production/src/model/commands/apiKey/ApiKeyHelper.js.map +1 -1
  388. package/dist/production/src/model/commands/apiKey/CreateApiKeyCommand.cjs.map +1 -1
  389. package/dist/production/src/model/commands/apiKey/CreateApiKeyCommand.js.map +1 -1
  390. package/dist/production/src/model/commands/apiKey/DisableApiKeyCommand.cjs.map +1 -1
  391. package/dist/production/src/model/commands/apiKey/DisableApiKeyCommand.js.map +1 -1
  392. package/dist/production/src/model/commands/apiKey/DisableIdentityApiKeysCommand.cjs.map +1 -1
  393. package/dist/production/src/model/commands/apiKey/DisableIdentityApiKeysCommand.js.map +1 -1
  394. package/dist/production/src/model/commands/apiKey/DisableOneOffApiKeyCommand.cjs.map +1 -1
  395. package/dist/production/src/model/commands/apiKey/DisableOneOffApiKeyCommand.js.map +1 -1
  396. package/dist/production/src/model/commands/apiKey/ProlongApiKeyCommand.cjs.map +1 -1
  397. package/dist/production/src/model/commands/apiKey/ProlongApiKeyCommand.js.map +1 -1
  398. package/dist/production/src/model/commands/configuration/UpdateConfigurationCommand.cjs.map +1 -1
  399. package/dist/production/src/model/commands/configuration/UpdateConfigurationCommand.js.map +1 -1
  400. package/dist/production/src/model/commands/identity/CreateIdentityCommand.cjs.map +1 -1
  401. package/dist/production/src/model/commands/identity/CreateIdentityCommand.js.map +1 -1
  402. package/dist/production/src/model/commands/identity/PatchIdentityGlobalRoles.cjs.map +1 -1
  403. package/dist/production/src/model/commands/identity/PatchIdentityGlobalRoles.js.map +1 -1
  404. package/dist/production/src/model/commands/idp/CreateIdpCommand.cjs.map +1 -1
  405. package/dist/production/src/model/commands/idp/CreateIdpCommand.js.map +1 -1
  406. package/dist/production/src/model/commands/idp/DisableIdpCommand.cjs.map +1 -1
  407. package/dist/production/src/model/commands/idp/DisableIdpCommand.js.map +1 -1
  408. package/dist/production/src/model/commands/idp/EnableIdpCommand.cjs.map +1 -1
  409. package/dist/production/src/model/commands/idp/EnableIdpCommand.js.map +1 -1
  410. package/dist/production/src/model/commands/idp/UpdateIdpCommand.cjs.map +1 -1
  411. package/dist/production/src/model/commands/idp/UpdateIdpCommand.js.map +1 -1
  412. package/dist/production/src/model/commands/mailTemplate/AddMailTemplateCommand.cjs.map +1 -1
  413. package/dist/production/src/model/commands/mailTemplate/AddMailTemplateCommand.js.map +1 -1
  414. package/dist/production/src/model/commands/mailTemplate/RemoveMailTemplateCommand.cjs.map +1 -1
  415. package/dist/production/src/model/commands/mailTemplate/RemoveMailTemplateCommand.js.map +1 -1
  416. package/dist/production/src/model/commands/membership/AddProjectMemberCommand.cjs.map +1 -1
  417. package/dist/production/src/model/commands/membership/AddProjectMemberCommand.js.map +1 -1
  418. package/dist/production/src/model/commands/membership/CreateOrUpdateProjectMembershipCommand.cjs.map +1 -1
  419. package/dist/production/src/model/commands/membership/CreateOrUpdateProjectMembershipCommand.js.map +1 -1
  420. package/dist/production/src/model/commands/membership/RemoveProjectMemberCommand.cjs.map +1 -1
  421. package/dist/production/src/model/commands/membership/RemoveProjectMemberCommand.js.map +1 -1
  422. package/dist/production/src/model/commands/membership/RemoveProjectMembershipsCommand.cjs.map +1 -1
  423. package/dist/production/src/model/commands/membership/RemoveProjectMembershipsCommand.js.map +1 -1
  424. package/dist/production/src/model/commands/membership/UpdateProjectMemberCommand.cjs.map +1 -1
  425. package/dist/production/src/model/commands/membership/UpdateProjectMemberCommand.js.map +1 -1
  426. package/dist/production/src/model/commands/membership/variables/PatchProjectMembershipVariableValuesCommand.cjs.map +1 -1
  427. package/dist/production/src/model/commands/membership/variables/PatchProjectMembershipVariableValuesCommand.js.map +1 -1
  428. package/dist/production/src/model/commands/membership/variables/PatchProjectMembershipVariablesCommand.cjs.map +1 -1
  429. package/dist/production/src/model/commands/membership/variables/PatchProjectMembershipVariablesCommand.js.map +1 -1
  430. package/dist/production/src/model/commands/membership/variables/SetProjectMembershipVariableValuesCommand.cjs.map +1 -1
  431. package/dist/production/src/model/commands/membership/variables/SetProjectMembershipVariableValuesCommand.js.map +1 -1
  432. package/dist/production/src/model/commands/otp/ConfirmOtpCommand.cjs.map +1 -1
  433. package/dist/production/src/model/commands/otp/ConfirmOtpCommand.js.map +1 -1
  434. package/dist/production/src/model/commands/otp/DisableOtpCommand.cjs.map +1 -1
  435. package/dist/production/src/model/commands/otp/DisableOtpCommand.js.map +1 -1
  436. package/dist/production/src/model/commands/otp/PrepareOtpCommand.cjs.map +1 -1
  437. package/dist/production/src/model/commands/otp/PrepareOtpCommand.js.map +1 -1
  438. package/dist/production/src/model/commands/person/ChangePasswordCommand.cjs.map +1 -1
  439. package/dist/production/src/model/commands/person/ChangePasswordCommand.js.map +1 -1
  440. package/dist/production/src/model/commands/person/ChangeProfileCommand.cjs.map +1 -1
  441. package/dist/production/src/model/commands/person/ChangeProfileCommand.js.map +1 -1
  442. package/dist/production/src/model/commands/person/CreatePersonCommand.cjs.map +1 -1
  443. package/dist/production/src/model/commands/person/CreatePersonCommand.js.map +1 -1
  444. package/dist/production/src/model/commands/person/CreatePersonIdentityProviderIdentifierCommand.cjs.map +1 -1
  445. package/dist/production/src/model/commands/person/CreatePersonIdentityProviderIdentifierCommand.js.map +1 -1
  446. package/dist/production/src/model/commands/person/DisablePersonCommand.cjs.map +1 -1
  447. package/dist/production/src/model/commands/person/DisablePersonCommand.js.map +1 -1
  448. package/dist/production/src/model/commands/person/TogglePersonPasswordlessCommand.cjs.map +1 -1
  449. package/dist/production/src/model/commands/person/TogglePersonPasswordlessCommand.js.map +1 -1
  450. package/dist/production/src/model/commands/personToken/ActivateOtpCommand.cjs.map +1 -1
  451. package/dist/production/src/model/commands/personToken/ActivateOtpCommand.js.map +1 -1
  452. package/dist/production/src/model/commands/personToken/CreatePersonTokenCommand.cjs.map +1 -1
  453. package/dist/production/src/model/commands/personToken/CreatePersonTokenCommand.js.map +1 -1
  454. package/dist/production/src/model/commands/personToken/IncreaseOtpAttemptCommand.cjs.map +1 -1
  455. package/dist/production/src/model/commands/personToken/IncreaseOtpAttemptCommand.js.map +1 -1
  456. package/dist/production/src/model/commands/personToken/InvalidateTokenCommand.cjs.map +1 -1
  457. package/dist/production/src/model/commands/personToken/InvalidateTokenCommand.js.map +1 -1
  458. package/dist/production/src/model/commands/personToken/ResetPasswordCommand.cjs.map +1 -1
  459. package/dist/production/src/model/commands/personToken/ResetPasswordCommand.js.map +1 -1
  460. package/dist/production/src/model/commands/personToken/SavePersonTokenCommand.cjs.map +1 -1
  461. package/dist/production/src/model/commands/personToken/SavePersonTokenCommand.js.map +1 -1
  462. package/dist/production/src/model/commands/project/CreateProjectCommand.cjs.map +1 -1
  463. package/dist/production/src/model/commands/project/CreateProjectCommand.js.map +1 -1
  464. package/dist/production/src/model/commands/project/SetProjectSecretCommand.cjs.map +1 -1
  465. package/dist/production/src/model/commands/project/SetProjectSecretCommand.js.map +1 -1
  466. package/dist/production/src/model/commands/project/UpdateProjectCommand.cjs.map +1 -1
  467. package/dist/production/src/model/commands/project/UpdateProjectCommand.js.map +1 -1
  468. package/dist/production/src/model/dtos/Password.cjs.map +1 -1
  469. package/dist/production/src/model/dtos/Password.js.map +1 -1
  470. package/dist/production/src/model/mailing/UserMailer.cjs.map +1 -1
  471. package/dist/production/src/model/mailing/UserMailer.js.map +1 -1
  472. package/dist/production/src/model/mailing/templates/ExistingUserInvited.mustache.cjs.map +1 -1
  473. package/dist/production/src/model/mailing/templates/ExistingUserInvited.mustache.js.map +1 -1
  474. package/dist/production/src/model/mailing/templates/NewUserInvited.mustache.cjs.map +1 -1
  475. package/dist/production/src/model/mailing/templates/NewUserInvited.mustache.js.map +1 -1
  476. package/dist/production/src/model/mailing/templates/PasswordReset.mustache.cjs.map +1 -1
  477. package/dist/production/src/model/mailing/templates/PasswordReset.mustache.js.map +1 -1
  478. package/dist/production/src/model/mailing/templates/PasswordlessSignIn.mustache.cjs.map +1 -1
  479. package/dist/production/src/model/mailing/templates/PasswordlessSignIn.mustache.js.map +1 -1
  480. package/dist/production/src/model/mailing/type.cjs.map +1 -1
  481. package/dist/production/src/model/mailing/type.js.map +1 -1
  482. package/dist/production/src/model/queries/apiKey/ApiKeyQuery.cjs.map +1 -1
  483. package/dist/production/src/model/queries/apiKey/ApiKeyQuery.js.map +1 -1
  484. package/dist/production/src/model/queries/configuration/ConfigurationQuery.cjs.map +1 -1
  485. package/dist/production/src/model/queries/configuration/ConfigurationQuery.js.map +1 -1
  486. package/dist/production/src/model/queries/identity/IdentityQuery.cjs.map +1 -1
  487. package/dist/production/src/model/queries/identity/IdentityQuery.js.map +1 -1
  488. package/dist/production/src/model/queries/idp/IdentityProviderBySlugQuery.cjs.map +1 -1
  489. package/dist/production/src/model/queries/idp/IdentityProviderBySlugQuery.js.map +1 -1
  490. package/dist/production/src/model/queries/idp/IdentityProvidersQuery.cjs.map +1 -1
  491. package/dist/production/src/model/queries/idp/IdentityProvidersQuery.js.map +1 -1
  492. package/dist/production/src/model/queries/idp/helpers.cjs.map +1 -1
  493. package/dist/production/src/model/queries/idp/helpers.js.map +1 -1
  494. package/dist/production/src/model/queries/mailTemplate/MailTemplateListQuery.cjs.map +1 -1
  495. package/dist/production/src/model/queries/mailTemplate/MailTemplateListQuery.js.map +1 -1
  496. package/dist/production/src/model/queries/mailTemplate/MailTemplateQuery.cjs.map +1 -1
  497. package/dist/production/src/model/queries/mailTemplate/MailTemplateQuery.js.map +1 -1
  498. package/dist/production/src/model/queries/membership/ProjectMembersQuery.cjs.map +1 -1
  499. package/dist/production/src/model/queries/membership/ProjectMembersQuery.js.map +1 -1
  500. package/dist/production/src/model/queries/membership/ProjectMembershipByIdentityQuery.cjs.map +1 -1
  501. package/dist/production/src/model/queries/membership/ProjectMembershipByIdentityQuery.js.map +1 -1
  502. package/dist/production/src/model/queries/membership/ProjectRolesByIdentityQuery.cjs.map +1 -1
  503. package/dist/production/src/model/queries/membership/ProjectRolesByIdentityQuery.js.map +1 -1
  504. package/dist/production/src/model/queries/membership/ProjectSlugSpecification.cjs.map +1 -1
  505. package/dist/production/src/model/queries/membership/ProjectSlugSpecification.js.map +1 -1
  506. package/dist/production/src/model/queries/person/PersonByIdPQuery.cjs.map +1 -1
  507. package/dist/production/src/model/queries/person/PersonByIdPQuery.js.map +1 -1
  508. package/dist/production/src/model/queries/person/PersonByIdentityBatchQuery.cjs.map +1 -1
  509. package/dist/production/src/model/queries/person/PersonByIdentityBatchQuery.js.map +1 -1
  510. package/dist/production/src/model/queries/person/PersonQuery.cjs.map +1 -1
  511. package/dist/production/src/model/queries/person/PersonQuery.js.map +1 -1
  512. package/dist/production/src/model/queries/person/PersonQueryBuilderFactory.cjs.map +1 -1
  513. package/dist/production/src/model/queries/person/PersonQueryBuilderFactory.js.map +1 -1
  514. package/dist/production/src/model/queries/personToken/PersonTokenQuery.cjs.map +1 -1
  515. package/dist/production/src/model/queries/personToken/PersonTokenQuery.js.map +1 -1
  516. package/dist/production/src/model/queries/project/ProjectBySlugQuery.cjs.map +1 -1
  517. package/dist/production/src/model/queries/project/ProjectBySlugQuery.js.map +1 -1
  518. package/dist/production/src/model/queries/project/ProjectSecretsQuery.cjs.map +1 -1
  519. package/dist/production/src/model/queries/project/ProjectSecretsQuery.js.map +1 -1
  520. package/dist/production/src/model/queries/project/ProjectUpdateTimestampQuery.cjs.map +1 -1
  521. package/dist/production/src/model/queries/project/ProjectUpdateTimestampQuery.js.map +1 -1
  522. package/dist/production/src/model/queries/project/ProjectsByIdentityQuery.cjs.map +1 -1
  523. package/dist/production/src/model/queries/project/ProjectsByIdentityQuery.js.map +1 -1
  524. package/dist/production/src/model/queries/project/ProjectsQuery.cjs.map +1 -1
  525. package/dist/production/src/model/queries/project/ProjectsQuery.js.map +1 -1
  526. package/dist/production/src/model/service/ConfigurationManager.cjs.map +1 -1
  527. package/dist/production/src/model/service/ConfigurationManager.js.map +1 -1
  528. package/dist/production/src/model/service/EmailValidator.cjs.map +1 -1
  529. package/dist/production/src/model/service/EmailValidator.js.map +1 -1
  530. package/dist/production/src/model/service/IDPSignInManager.cjs.map +1 -1
  531. package/dist/production/src/model/service/IDPSignInManager.js.map +1 -1
  532. package/dist/production/src/model/service/InviteManager.cjs.map +1 -1
  533. package/dist/production/src/model/service/InviteManager.js.map +1 -1
  534. package/dist/production/src/model/service/MailTemplateManager.cjs.map +1 -1
  535. package/dist/production/src/model/service/MailTemplateManager.js.map +1 -1
  536. package/dist/production/src/model/service/MembershipValidator.cjs.map +1 -1
  537. package/dist/production/src/model/service/MembershipValidator.js.map +1 -1
  538. package/dist/production/src/model/service/OtpAuthenticator.cjs.map +1 -1
  539. package/dist/production/src/model/service/OtpAuthenticator.js.map +1 -1
  540. package/dist/production/src/model/service/OtpManager.cjs.map +1 -1
  541. package/dist/production/src/model/service/OtpManager.js.map +1 -1
  542. package/dist/production/src/model/service/PasswordChangeManager.cjs.map +1 -1
  543. package/dist/production/src/model/service/PasswordChangeManager.js.map +1 -1
  544. package/dist/production/src/model/service/PasswordResetManager.cjs.map +1 -1
  545. package/dist/production/src/model/service/PasswordResetManager.js.map +1 -1
  546. package/dist/production/src/model/service/PasswordlessSignInManager.cjs.map +1 -1
  547. package/dist/production/src/model/service/PasswordlessSignInManager.js.map +1 -1
  548. package/dist/production/src/model/service/PersonAccessManager.cjs.map +1 -1
  549. package/dist/production/src/model/service/PersonAccessManager.js.map +1 -1
  550. package/dist/production/src/model/service/PersonManager.cjs.map +1 -1
  551. package/dist/production/src/model/service/PersonManager.js.map +1 -1
  552. package/dist/production/src/model/service/ProjectManager.cjs.map +1 -1
  553. package/dist/production/src/model/service/ProjectManager.js.map +1 -1
  554. package/dist/production/src/model/service/ProjectMemberManager.cjs.map +1 -1
  555. package/dist/production/src/model/service/ProjectMemberManager.js.map +1 -1
  556. package/dist/production/src/model/service/RolesManager.cjs.map +1 -1
  557. package/dist/production/src/model/service/RolesManager.js.map +1 -1
  558. package/dist/production/src/model/service/SecretsManager.cjs.map +1 -1
  559. package/dist/production/src/model/service/SecretsManager.js.map +1 -1
  560. package/dist/production/src/model/service/SignInManager.cjs.map +1 -1
  561. package/dist/production/src/model/service/SignInManager.js.map +1 -1
  562. package/dist/production/src/model/service/SignUpManager.cjs.map +1 -1
  563. package/dist/production/src/model/service/SignUpManager.js.map +1 -1
  564. package/dist/production/src/model/service/apiKey/ApiKeyManager.cjs.map +1 -1
  565. package/dist/production/src/model/service/apiKey/ApiKeyManager.js.map +1 -1
  566. package/dist/production/src/model/service/apiKey/ApiKeyService.cjs.map +1 -1
  567. package/dist/production/src/model/service/apiKey/ApiKeyService.js.map +1 -1
  568. package/dist/production/src/model/service/helpers/getPreferredProject.cjs.map +1 -1
  569. package/dist/production/src/model/service/helpers/getPreferredProject.js.map +1 -1
  570. package/dist/production/src/model/service/idp/IDPHandlerRegistry.cjs.map +1 -1
  571. package/dist/production/src/model/service/idp/IDPHandlerRegistry.js.map +1 -1
  572. package/dist/production/src/model/service/idp/IDPManager.cjs.map +1 -1
  573. package/dist/production/src/model/service/idp/IDPManager.js.map +1 -1
  574. package/dist/production/src/model/service/idp/IDPResponseError.cjs.map +1 -1
  575. package/dist/production/src/model/service/idp/IDPResponseError.js.map +1 -1
  576. package/dist/production/src/model/service/idp/IDPValidationError.cjs.map +1 -1
  577. package/dist/production/src/model/service/idp/IDPValidationError.js.map +1 -1
  578. package/dist/production/src/model/service/idp/IdentityProviderNotFoundError.cjs.map +1 -1
  579. package/dist/production/src/model/service/idp/IdentityProviderNotFoundError.js.map +1 -1
  580. package/dist/production/src/model/service/idp/InvalidIDPConfigurationError.cjs.map +1 -1
  581. package/dist/production/src/model/service/idp/InvalidIDPConfigurationError.js.map +1 -1
  582. package/dist/production/src/model/service/idp/providers/AppleProvider.cjs.map +1 -1
  583. package/dist/production/src/model/service/idp/providers/AppleProvider.js.map +1 -1
  584. package/dist/production/src/model/service/idp/providers/FacebookProvider.cjs.map +1 -1
  585. package/dist/production/src/model/service/idp/providers/FacebookProvider.js.map +1 -1
  586. package/dist/production/src/model/service/idp/providers/OIDCHelpers.cjs.map +1 -1
  587. package/dist/production/src/model/service/idp/providers/OIDCHelpers.js.map +1 -1
  588. package/dist/production/src/model/service/idp/providers/OIDCProvider.cjs.map +1 -1
  589. package/dist/production/src/model/service/idp/providers/OIDCProvider.js.map +1 -1
  590. package/dist/production/src/model/service/idp/providers/OIDCTypes.cjs.map +1 -1
  591. package/dist/production/src/model/service/idp/providers/OIDCTypes.js.map +1 -1
  592. package/dist/production/src/model/service/idp/providers/helpers.cjs.map +1 -1
  593. package/dist/production/src/model/service/idp/providers/helpers.js.map +1 -1
  594. package/dist/production/src/model/service/membershipUtils.cjs.map +1 -1
  595. package/dist/production/src/model/service/membershipUtils.js.map +1 -1
  596. package/dist/production/src/model/type/ApiKey.cjs.map +1 -1
  597. package/dist/production/src/model/type/ApiKey.js.map +1 -1
  598. package/dist/production/src/model/utils/DatabaseContext.cjs.map +1 -1
  599. package/dist/production/src/model/utils/DatabaseContext.js.map +1 -1
  600. package/dist/production/src/model/utils/Response.cjs.map +1 -1
  601. package/dist/production/src/model/utils/Response.js.map +1 -1
  602. package/dist/production/src/model/utils/password.cjs.map +1 -1
  603. package/dist/production/src/model/utils/password.js.map +1 -1
  604. package/dist/production/src/model/utils/tokenUtils.cjs.map +1 -1
  605. package/dist/production/src/model/utils/tokenUtils.js.map +1 -1
  606. package/dist/production/src/resolvers/ResolverFactory.cjs.map +1 -1
  607. package/dist/production/src/resolvers/ResolverFactory.js.map +1 -1
  608. package/dist/production/src/resolvers/TenantResolverContextFactory.cjs.map +1 -1
  609. package/dist/production/src/resolvers/TenantResolverContextFactory.js.map +1 -1
  610. package/dist/production/src/resolvers/errorUtils.cjs.map +1 -1
  611. package/dist/production/src/resolvers/errorUtils.js.map +1 -1
  612. package/dist/production/src/resolvers/membershipUtils.cjs.map +1 -1
  613. package/dist/production/src/resolvers/membershipUtils.js.map +1 -1
  614. package/dist/production/src/resolvers/mutation/apiKey/CreateApiKeyMutationResolver.cjs.map +1 -1
  615. package/dist/production/src/resolvers/mutation/apiKey/CreateApiKeyMutationResolver.js.map +1 -1
  616. package/dist/production/src/resolvers/mutation/apiKey/DisableApiKeyMutationResolver.cjs.map +1 -1
  617. package/dist/production/src/resolvers/mutation/apiKey/DisableApiKeyMutationResolver.js.map +1 -1
  618. package/dist/production/src/resolvers/mutation/configuration/ConfigurationMutationResolver.cjs.map +1 -1
  619. package/dist/production/src/resolvers/mutation/configuration/ConfigurationMutationResolver.js.map +1 -1
  620. package/dist/production/src/resolvers/mutation/identity/GlobalRolesMutationResolver.cjs.map +1 -1
  621. package/dist/production/src/resolvers/mutation/identity/GlobalRolesMutationResolver.js.map +1 -1
  622. package/dist/production/src/resolvers/mutation/idp/AddIDPMutationResolver.cjs.map +1 -1
  623. package/dist/production/src/resolvers/mutation/idp/AddIDPMutationResolver.js.map +1 -1
  624. package/dist/production/src/resolvers/mutation/idp/DisableIDPMutationResolver.cjs.map +1 -1
  625. package/dist/production/src/resolvers/mutation/idp/DisableIDPMutationResolver.js.map +1 -1
  626. package/dist/production/src/resolvers/mutation/idp/EnableIDPMutationResolver.cjs.map +1 -1
  627. package/dist/production/src/resolvers/mutation/idp/EnableIDPMutationResolver.js.map +1 -1
  628. package/dist/production/src/resolvers/mutation/idp/UpdateIDPMutationResolver.cjs.map +1 -1
  629. package/dist/production/src/resolvers/mutation/idp/UpdateIDPMutationResolver.js.map +1 -1
  630. package/dist/production/src/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.cjs.map +1 -1
  631. package/dist/production/src/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.js.map +1 -1
  632. package/dist/production/src/resolvers/mutation/person/ChangePasswordMutationResolver.cjs.map +1 -1
  633. package/dist/production/src/resolvers/mutation/person/ChangePasswordMutationResolver.js.map +1 -1
  634. package/dist/production/src/resolvers/mutation/person/ChangeProfileMutationResolver.cjs.map +1 -1
  635. package/dist/production/src/resolvers/mutation/person/ChangeProfileMutationResolver.js.map +1 -1
  636. package/dist/production/src/resolvers/mutation/person/DisablePersonMutationResolver.cjs.map +1 -1
  637. package/dist/production/src/resolvers/mutation/person/DisablePersonMutationResolver.js.map +1 -1
  638. package/dist/production/src/resolvers/mutation/person/IDPMutationResolver.cjs.map +1 -1
  639. package/dist/production/src/resolvers/mutation/person/IDPMutationResolver.js.map +1 -1
  640. package/dist/production/src/resolvers/mutation/person/InviteMutationResolver.cjs.map +1 -1
  641. package/dist/production/src/resolvers/mutation/person/InviteMutationResolver.js.map +1 -1
  642. package/dist/production/src/resolvers/mutation/person/OtpMutationResolver.cjs.map +1 -1
  643. package/dist/production/src/resolvers/mutation/person/OtpMutationResolver.js.map +1 -1
  644. package/dist/production/src/resolvers/mutation/person/PasswordlessMutationResolver.cjs.map +1 -1
  645. package/dist/production/src/resolvers/mutation/person/PasswordlessMutationResolver.js.map +1 -1
  646. package/dist/production/src/resolvers/mutation/person/ResetPasswordMutationResolver.cjs.map +1 -1
  647. package/dist/production/src/resolvers/mutation/person/ResetPasswordMutationResolver.js.map +1 -1
  648. package/dist/production/src/resolvers/mutation/person/SignInMutationResolver.cjs.map +1 -1
  649. package/dist/production/src/resolvers/mutation/person/SignInMutationResolver.js.map +1 -1
  650. package/dist/production/src/resolvers/mutation/person/SignOutMutationResolver.cjs.map +1 -1
  651. package/dist/production/src/resolvers/mutation/person/SignOutMutationResolver.js.map +1 -1
  652. package/dist/production/src/resolvers/mutation/person/SignUpMutationResolver.cjs.map +1 -1
  653. package/dist/production/src/resolvers/mutation/person/SignUpMutationResolver.js.map +1 -1
  654. package/dist/production/src/resolvers/mutation/person/TogglePasswordlessMutationResolver.cjs.map +1 -1
  655. package/dist/production/src/resolvers/mutation/person/TogglePasswordlessMutationResolver.js.map +1 -1
  656. package/dist/production/src/resolvers/mutation/project/CreateProjectMutationResolver.cjs.map +1 -1
  657. package/dist/production/src/resolvers/mutation/project/CreateProjectMutationResolver.js.map +1 -1
  658. package/dist/production/src/resolvers/mutation/project/SetProjectSecretMutationResolver.cjs.map +1 -1
  659. package/dist/production/src/resolvers/mutation/project/SetProjectSecretMutationResolver.js.map +1 -1
  660. package/dist/production/src/resolvers/mutation/project/UpdateProjectMutationResolver.cjs.map +1 -1
  661. package/dist/production/src/resolvers/mutation/project/UpdateProjectMutationResolver.js.map +1 -1
  662. package/dist/production/src/resolvers/mutation/projectMember/AddProjectMemberMutationResolver.cjs.map +1 -1
  663. package/dist/production/src/resolvers/mutation/projectMember/AddProjectMemberMutationResolver.js.map +1 -1
  664. package/dist/production/src/resolvers/mutation/projectMember/RemoveProjectMemberMutationResolver.cjs.map +1 -1
  665. package/dist/production/src/resolvers/mutation/projectMember/RemoveProjectMemberMutationResolver.js.map +1 -1
  666. package/dist/production/src/resolvers/mutation/projectMember/UpdateProjectMemberMutationResolver.cjs.map +1 -1
  667. package/dist/production/src/resolvers/mutation/projectMember/UpdateProjectMemberMutationResolver.js.map +1 -1
  668. package/dist/production/src/resolvers/query/ConfigurationQueryResolver.cjs.map +1 -1
  669. package/dist/production/src/resolvers/query/ConfigurationQueryResolver.js.map +1 -1
  670. package/dist/production/src/resolvers/query/IDPQueryResolver.cjs.map +1 -1
  671. package/dist/production/src/resolvers/query/IDPQueryResolver.js.map +1 -1
  672. package/dist/production/src/resolvers/query/MailTemplateQueryResolver.cjs.map +1 -1
  673. package/dist/production/src/resolvers/query/MailTemplateQueryResolver.js.map +1 -1
  674. package/dist/production/src/resolvers/query/MeQueryResolver.cjs.map +1 -1
  675. package/dist/production/src/resolvers/query/MeQueryResolver.js.map +1 -1
  676. package/dist/production/src/resolvers/query/PersonQueryResolver.cjs.map +1 -1
  677. package/dist/production/src/resolvers/query/PersonQueryResolver.js.map +1 -1
  678. package/dist/production/src/resolvers/query/ProjectMembersQueryResolver.cjs.map +1 -1
  679. package/dist/production/src/resolvers/query/ProjectMembersQueryResolver.js.map +1 -1
  680. package/dist/production/src/resolvers/query/ProjectQueryResolver.cjs.map +1 -1
  681. package/dist/production/src/resolvers/query/ProjectQueryResolver.js.map +1 -1
  682. package/dist/production/src/resolvers/responseHelpers/PersonResponseFactory.cjs.map +1 -1
  683. package/dist/production/src/resolvers/responseHelpers/PersonResponseFactory.js.map +1 -1
  684. package/dist/production/src/resolvers/responseHelpers/SignInResponseFactory.cjs.map +1 -1
  685. package/dist/production/src/resolvers/responseHelpers/SignInResponseFactory.js.map +1 -1
  686. package/dist/production/src/resolvers/types/IdentityTypeResolver.cjs.map +1 -1
  687. package/dist/production/src/resolvers/types/IdentityTypeResolver.js.map +1 -1
  688. package/dist/production/src/resolvers/types/ProjectTypeResolver.cjs.map +1 -1
  689. package/dist/production/src/resolvers/types/ProjectTypeResolver.js.map +1 -1
  690. package/dist/production/src/schema/tenant.graphql.cjs.map +1 -1
  691. package/dist/production/src/utils/Mailer.cjs.map +1 -1
  692. package/dist/production/src/utils/Mailer.js.map +1 -1
  693. package/dist/production/src/utils/TemplateRenderer.cjs.map +1 -1
  694. package/dist/production/src/utils/TemplateRenderer.js.map +1 -1
  695. package/dist/production/src/utils/array.cjs.map +1 -1
  696. package/dist/production/src/utils/array.js.map +1 -1
  697. package/dist/production/src/utils/batchQuery.cjs.map +1 -1
  698. package/dist/production/src/utils/batchQuery.js.map +1 -1
  699. package/dist/tests/src/mailer.d.ts.map +1 -1
  700. package/dist/tests/tsconfig.tsbuildinfo +1 -1
  701. package/dist/types/tsconfig.tsbuildinfo +1 -1
  702. package/package.json +13 -13
  703. package/src/model/service/OtpAuthenticator.ts +1 -1
  704. package/tests/cases/integration/mocked/addProjectMemberMutation.test.ts +1 -1
  705. package/tests/cases/integration/mocked/changeMyPasswordMutation.test.ts +2 -2
  706. package/tests/cases/integration/mocked/changeMyProfileMutation.test.ts +2 -2
  707. package/tests/cases/integration/mocked/changePasswordMutation.test.ts +1 -1
  708. package/tests/cases/integration/mocked/changeProfileMutation.test.ts +2 -2
  709. package/tests/cases/integration/mocked/confirmOtpMutation.test.ts +1 -1
  710. package/tests/cases/integration/mocked/createApiKeyMutation.test.ts +1 -1
  711. package/tests/cases/integration/mocked/createSessionKeyMutation.test.ts +1 -1
  712. package/tests/cases/integration/mocked/disableApiKeyMutation.ts +1 -1
  713. package/tests/cases/integration/mocked/inviteMutations.test.ts +1 -1
  714. package/tests/cases/integration/mocked/listProjectMembersQuery.test.ts +1 -1
  715. package/tests/cases/integration/mocked/personByIdQuery.test.ts +1 -1
  716. package/tests/cases/integration/mocked/prepareOtpMutation.test.ts +3 -3
  717. package/tests/cases/integration/mocked/removeProjectMemberMutation.test.ts +1 -1
  718. package/tests/cases/integration/mocked/signInIdpMutation.test.ts +1 -1
  719. package/tests/cases/integration/mocked/signInMutation.test.ts +1 -1
  720. package/tests/cases/integration/mocked/signOutMutation.test.ts +1 -1
  721. package/tests/cases/integration/mocked/signUpMutation.test.ts +1 -1
  722. package/tests/cases/integration/mocked/updateProjectMemberMutation.test.ts +1 -1
  723. package/tests/cases/migrations/2020-06-08-134000-tenant-credentials.test.ts +5 -3
  724. package/tests/cases/unit/authorization/membershipAwareAccessNode.test.ts +9 -9
  725. package/tests/cases/unit/authorization/membershipMatcher.test.ts +10 -10
  726. package/tests/src/mailer.ts +3 -4
  727. package/tests/src/testGraphql.ts +2 -2
  728. package/dist/tests/src/testTenantDb.d.ts +0 -31
  729. package/dist/tests/src/testTenantDb.d.ts.map +0 -1
  730. package/tests/src/testTenantDb.ts +0 -202
@@ -1 +1 @@
1
- {"version":3,"file":"CreateApiKeyMutationResolver.js","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/apiKey/CreateApiKeyMutationResolver.ts"],"sourcesContent":["import {\n\tCreateApiKeyErrorCode,\n\tCreateApiKeyResponse,\n\tMutationCreateApiKeyArgs, MutationCreateGlobalApiKeyArgs,\n\tMutationResolvers,\n} from '../../../schema'\nimport { GraphQLResolveInfo } from 'graphql'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { ApiKeyManager, isTokenHash, MembershipValidator, PermissionActions, ProjectManager } from '../../../model'\nimport { createMembershipValidationErrorResult } from '../../membershipUtils'\nimport { createProjectNotFoundResponse } from '../../errorUtils'\nimport { UserInputError } from '@contember/graphql-utils'\n\nexport class CreateApiKeyMutationResolver implements MutationResolvers {\n\tconstructor(\n\t\tprivate readonly apiKeyManager: ApiKeyManager,\n\t\tprivate readonly projectManager: ProjectManager,\n\t\tprivate readonly membershipValidator: MembershipValidator,\n\t) {}\n\n\tasync createApiKey(\n\t\tparent: any,\n\t\t{ projectSlug, memberships, description, tokenHash }: MutationCreateApiKeyArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<CreateApiKeyResponse> {\n\t\tconst project = await this.projectManager.getProjectBySlug(context.db, projectSlug)\n\t\tawait context.requireAccess({\n\t\t\tscope: await context.permissionContext.createProjectScope(project),\n\t\t\taction: PermissionActions.API_KEY_CREATE,\n\t\t\tmessage: 'You are not allowed to create an API key for this project',\n\t\t})\n\t\tif (!project) {\n\t\t\treturn createProjectNotFoundResponse('PROJECT_NOT_FOUND', projectSlug)\n\t\t}\n\t\tif (typeof tokenHash === 'string' && !isTokenHash(tokenHash)) {\n\t\t\tthrow new UserInputError('Invalid format of tokenHash. Must be hex-encoded sha256.')\n\t\t}\n\t\tconst validationResult = await this.membershipValidator.validate(project.slug, memberships)\n\t\tif (validationResult.length > 0) {\n\t\t\tconst errors = createMembershipValidationErrorResult(validationResult)\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\terrors: errors,\n\t\t\t\terror: errors[0],\n\t\t\t}\n\t\t}\n\n\t\tconst result = await this.apiKeyManager.createProjectPermanentApiKey(context.db, project.id, memberships, description, tokenHash ?? undefined)\n\n\t\treturn {\n\t\t\tok: true,\n\t\t\terrors: [],\n\t\t\tresult: {\n\t\t\t\tapiKey: result.result.toApiKeyWithToken(),\n\t\t\t},\n\t\t}\n\t}\n\n\tasync createGlobalApiKey(\n\t\tparent: any,\n\t\t{ roles, description, tokenHash }: MutationCreateGlobalApiKeyArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<CreateApiKeyResponse> {\n\t\troles ??= []\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.API_KEY_CREATE_GLOBAL(roles),\n\t\t\tmessage: 'You are not allowed to create a global API key',\n\t\t})\n\t\tif (typeof tokenHash === 'string' && !isTokenHash(tokenHash)) {\n\t\t\tthrow new UserInputError('Invalid format of tokenHash. Must be hex-encoded sha256.')\n\t\t}\n\t\tconst result = await this.apiKeyManager.createGlobalPermanentApiKey(context.db, description, roles, tokenHash ?? undefined)\n\t\treturn {\n\t\t\tok: true,\n\t\t\terrors: [],\n\t\t\tresult: {\n\t\t\t\tapiKey: result.result.toApiKeyWithToken(),\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAaO,MAAM,6BAA0D;AAAA,EACtE,YACkB,eACA,gBACA,qBAChB;AAHgB,SAAA,gBAAA;AACA,SAAA,iBAAA;AACA,SAAA,sBAAA;AAAA,EACf;AAAA,EAEH,MAAM,aACL,QACA,EAAE,aAAa,aAAa,aAAa,UAAA,GACzC,SACA,MACgC;AAChC,UAAM,UAAU,MAAM,KAAK,eAAe,iBAAiB,QAAQ,IAAI,WAAW;AAClF,UAAM,QAAQ,cAAc;AAAA,MAC3B,OAAO,MAAM,QAAQ,kBAAkB,mBAAmB,OAAO;AAAA,MACjE,QAAQ,kBAAkB;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACD,QAAI,CAAC,SAAS;AACN,aAAA,8BAA8B,qBAAqB,WAAW;AAAA,IACtE;AACA,QAAI,OAAO,cAAc,YAAY,CAAC,YAAY,SAAS,GAAG;AACvD,YAAA,IAAI,eAAe,0DAA0D;AAAA,IACpF;AACA,UAAM,mBAAmB,MAAM,KAAK,oBAAoB,SAAS,QAAQ,MAAM,WAAW;AACtF,QAAA,iBAAiB,SAAS,GAAG;AAC1B,YAAA,SAAS,sCAAsC,gBAAgB;AAC9D,aAAA;AAAA,QACN,IAAI;AAAA,QACJ;AAAA,QACA,OAAO,OAAO,CAAC;AAAA,MAAA;AAAA,IAEjB;AAEA,UAAM,SAAS,MAAM,KAAK,cAAc,6BAA6B,QAAQ,IAAI,QAAQ,IAAI,aAAa,aAAa,aAAa,MAAS;AAEtI,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ,CAAC;AAAA,MACT,QAAQ;AAAA,QACP,QAAQ,OAAO,OAAO,kBAAkB;AAAA,MACzC;AAAA,IAAA;AAAA,EAEF;AAAA,EAEA,MAAM,mBACL,QACA,EAAE,OAAO,aAAa,UACtB,GAAA,SACA,MACgC;AAChC,cAAA,QAAU,CAAA;AACV,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQ,kBAAkB,sBAAsB,KAAK;AAAA,MACrD,SAAS;AAAA,IAAA,CACT;AACD,QAAI,OAAO,cAAc,YAAY,CAAC,YAAY,SAAS,GAAG;AACvD,YAAA,IAAI,eAAe,0DAA0D;AAAA,IACpF;AACM,UAAA,SAAS,MAAM,KAAK,cAAc,4BAA4B,QAAQ,IAAI,aAAa,OAAO,aAAa,MAAS;AACnH,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ,CAAC;AAAA,MACT,QAAQ;AAAA,QACP,QAAQ,OAAO,OAAO,kBAAkB;AAAA,MACzC;AAAA,IAAA;AAAA,EAEF;AACD;"}
1
+ {"version":3,"file":"CreateApiKeyMutationResolver.js","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/apiKey/CreateApiKeyMutationResolver.ts"],"sourcesContent":["import {\n\tCreateApiKeyErrorCode,\n\tCreateApiKeyResponse,\n\tMutationCreateApiKeyArgs, MutationCreateGlobalApiKeyArgs,\n\tMutationResolvers,\n} from '../../../schema'\nimport { GraphQLResolveInfo } from 'graphql'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { ApiKeyManager, isTokenHash, MembershipValidator, PermissionActions, ProjectManager } from '../../../model'\nimport { createMembershipValidationErrorResult } from '../../membershipUtils'\nimport { createProjectNotFoundResponse } from '../../errorUtils'\nimport { UserInputError } from '@contember/graphql-utils'\n\nexport class CreateApiKeyMutationResolver implements MutationResolvers {\n\tconstructor(\n\t\tprivate readonly apiKeyManager: ApiKeyManager,\n\t\tprivate readonly projectManager: ProjectManager,\n\t\tprivate readonly membershipValidator: MembershipValidator,\n\t) {}\n\n\tasync createApiKey(\n\t\tparent: any,\n\t\t{ projectSlug, memberships, description, tokenHash }: MutationCreateApiKeyArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<CreateApiKeyResponse> {\n\t\tconst project = await this.projectManager.getProjectBySlug(context.db, projectSlug)\n\t\tawait context.requireAccess({\n\t\t\tscope: await context.permissionContext.createProjectScope(project),\n\t\t\taction: PermissionActions.API_KEY_CREATE,\n\t\t\tmessage: 'You are not allowed to create an API key for this project',\n\t\t})\n\t\tif (!project) {\n\t\t\treturn createProjectNotFoundResponse('PROJECT_NOT_FOUND', projectSlug)\n\t\t}\n\t\tif (typeof tokenHash === 'string' && !isTokenHash(tokenHash)) {\n\t\t\tthrow new UserInputError('Invalid format of tokenHash. Must be hex-encoded sha256.')\n\t\t}\n\t\tconst validationResult = await this.membershipValidator.validate(project.slug, memberships)\n\t\tif (validationResult.length > 0) {\n\t\t\tconst errors = createMembershipValidationErrorResult(validationResult)\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\terrors: errors,\n\t\t\t\terror: errors[0],\n\t\t\t}\n\t\t}\n\n\t\tconst result = await this.apiKeyManager.createProjectPermanentApiKey(context.db, project.id, memberships, description, tokenHash ?? undefined)\n\n\t\treturn {\n\t\t\tok: true,\n\t\t\terrors: [],\n\t\t\tresult: {\n\t\t\t\tapiKey: result.result.toApiKeyWithToken(),\n\t\t\t},\n\t\t}\n\t}\n\n\tasync createGlobalApiKey(\n\t\tparent: any,\n\t\t{ roles, description, tokenHash }: MutationCreateGlobalApiKeyArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<CreateApiKeyResponse> {\n\t\troles ??= []\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.API_KEY_CREATE_GLOBAL(roles),\n\t\t\tmessage: 'You are not allowed to create a global API key',\n\t\t})\n\t\tif (typeof tokenHash === 'string' && !isTokenHash(tokenHash)) {\n\t\t\tthrow new UserInputError('Invalid format of tokenHash. Must be hex-encoded sha256.')\n\t\t}\n\t\tconst result = await this.apiKeyManager.createGlobalPermanentApiKey(context.db, description, roles, tokenHash ?? undefined)\n\t\treturn {\n\t\t\tok: true,\n\t\t\terrors: [],\n\t\t\tresult: {\n\t\t\t\tapiKey: result.result.toApiKeyWithToken(),\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAaO,MAAM,6BAA0D;AAAA,EACtE,YACkB,eACA,gBACA,qBAChB;AAHgB,SAAA,gBAAA;AACA,SAAA,iBAAA;AACA,SAAA,sBAAA;AAAA,EAAA;AAAA,EAGlB,MAAM,aACL,QACA,EAAE,aAAa,aAAa,aAAa,UAAA,GACzC,SACA,MACgC;AAChC,UAAM,UAAU,MAAM,KAAK,eAAe,iBAAiB,QAAQ,IAAI,WAAW;AAClF,UAAM,QAAQ,cAAc;AAAA,MAC3B,OAAO,MAAM,QAAQ,kBAAkB,mBAAmB,OAAO;AAAA,MACjE,QAAQ,kBAAkB;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACD,QAAI,CAAC,SAAS;AACN,aAAA,8BAA8B,qBAAqB,WAAW;AAAA,IAAA;AAEtE,QAAI,OAAO,cAAc,YAAY,CAAC,YAAY,SAAS,GAAG;AACvD,YAAA,IAAI,eAAe,0DAA0D;AAAA,IAAA;AAEpF,UAAM,mBAAmB,MAAM,KAAK,oBAAoB,SAAS,QAAQ,MAAM,WAAW;AACtF,QAAA,iBAAiB,SAAS,GAAG;AAC1B,YAAA,SAAS,sCAAsC,gBAAgB;AAC9D,aAAA;AAAA,QACN,IAAI;AAAA,QACJ;AAAA,QACA,OAAO,OAAO,CAAC;AAAA,MAChB;AAAA,IAAA;AAGD,UAAM,SAAS,MAAM,KAAK,cAAc,6BAA6B,QAAQ,IAAI,QAAQ,IAAI,aAAa,aAAa,aAAa,MAAS;AAEtI,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ,CAAC;AAAA,MACT,QAAQ;AAAA,QACP,QAAQ,OAAO,OAAO,kBAAkB;AAAA,MAAA;AAAA,IAE1C;AAAA,EAAA;AAAA,EAGD,MAAM,mBACL,QACA,EAAE,OAAO,aAAa,UACtB,GAAA,SACA,MACgC;AAChC,cAAA,QAAU;AACV,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQ,kBAAkB,sBAAsB,KAAK;AAAA,MACrD,SAAS;AAAA,IAAA,CACT;AACD,QAAI,OAAO,cAAc,YAAY,CAAC,YAAY,SAAS,GAAG;AACvD,YAAA,IAAI,eAAe,0DAA0D;AAAA,IAAA;AAE9E,UAAA,SAAS,MAAM,KAAK,cAAc,4BAA4B,QAAQ,IAAI,aAAa,OAAO,aAAa,MAAS;AACnH,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ,CAAC;AAAA,MACT,QAAQ;AAAA,QACP,QAAQ,OAAO,OAAO,kBAAkB;AAAA,MAAA;AAAA,IAE1C;AAAA,EAAA;AAEF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"DisableApiKeyMutationResolver.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/apiKey/DisableApiKeyMutationResolver.ts"],"sourcesContent":["import {\n\tDisableApiKeyErrorCode,\n\tDisableApiKeyResponse,\n\tMutationDisableApiKeyArgs,\n\tMutationResolvers,\n} from '../../../schema'\nimport { GraphQLResolveInfo } from 'graphql'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { PermissionActions, ApiKeyManager } from '../../../model'\nimport { createErrorResponse } from '../../errorUtils'\n\nexport class DisableApiKeyMutationResolver implements MutationResolvers {\n\tconstructor(private readonly apiKeyManager: ApiKeyManager) {}\n\n\tasync disableApiKey(\n\t\tparent: any,\n\t\t{ id }: MutationDisableApiKeyArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<DisableApiKeyResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.API_KEY_DISABLE,\n\t\t\tmessage: 'You are not allowed to disable api key',\n\t\t})\n\n\t\tconst result = await this.apiKeyManager.disableApiKey(context.db, id)\n\n\t\tif (!result) {\n\t\t\treturn createErrorResponse('KEY_NOT_FOUND', 'API key not found')\n\t\t}\n\n\t\treturn {\n\t\t\tok: true,\n\t\t\terrors: [],\n\t\t}\n\t}\n}\n"],"names":["PermissionActions","createErrorResponse"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAWO,MAAM,8BAA2D;AAAA,EACvE,YAA6B,eAA8B;AAA9B,SAAA,gBAAA;AAAA,EAA+B;AAAA,EAE5D,MAAM,cACL,QACA,EAAE,GAAG,GACL,SACA,MACiC;AACjC,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQA,kBAAkB,kBAAA;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AAED,UAAM,SAAS,MAAM,KAAK,cAAc,cAAc,QAAQ,IAAI,EAAE;AAEpE,QAAI,CAAC,QAAQ;AACL,aAAAC,WAAA,oBAAoB,iBAAiB,mBAAmB;AAAA,IAChE;AAEO,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ,CAAC;AAAA,IAAA;AAAA,EAEX;AACD;;"}
1
+ {"version":3,"file":"DisableApiKeyMutationResolver.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/apiKey/DisableApiKeyMutationResolver.ts"],"sourcesContent":["import {\n\tDisableApiKeyErrorCode,\n\tDisableApiKeyResponse,\n\tMutationDisableApiKeyArgs,\n\tMutationResolvers,\n} from '../../../schema'\nimport { GraphQLResolveInfo } from 'graphql'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { PermissionActions, ApiKeyManager } from '../../../model'\nimport { createErrorResponse } from '../../errorUtils'\n\nexport class DisableApiKeyMutationResolver implements MutationResolvers {\n\tconstructor(private readonly apiKeyManager: ApiKeyManager) {}\n\n\tasync disableApiKey(\n\t\tparent: any,\n\t\t{ id }: MutationDisableApiKeyArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<DisableApiKeyResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.API_KEY_DISABLE,\n\t\t\tmessage: 'You are not allowed to disable api key',\n\t\t})\n\n\t\tconst result = await this.apiKeyManager.disableApiKey(context.db, id)\n\n\t\tif (!result) {\n\t\t\treturn createErrorResponse('KEY_NOT_FOUND', 'API key not found')\n\t\t}\n\n\t\treturn {\n\t\t\tok: true,\n\t\t\terrors: [],\n\t\t}\n\t}\n}\n"],"names":["PermissionActions","createErrorResponse"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAWO,MAAM,8BAA2D;AAAA,EACvE,YAA6B,eAA8B;AAA9B,SAAA,gBAAA;AAAA,EAAA;AAAA,EAE7B,MAAM,cACL,QACA,EAAE,GAAG,GACL,SACA,MACiC;AACjC,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQA,kBAAkB,kBAAA;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AAED,UAAM,SAAS,MAAM,KAAK,cAAc,cAAc,QAAQ,IAAI,EAAE;AAEpE,QAAI,CAAC,QAAQ;AACL,aAAAC,WAAA,oBAAoB,iBAAiB,mBAAmB;AAAA,IAAA;AAGzD,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ,CAAA;AAAA,IACT;AAAA,EAAA;AAEF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"DisableApiKeyMutationResolver.js","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/apiKey/DisableApiKeyMutationResolver.ts"],"sourcesContent":["import {\n\tDisableApiKeyErrorCode,\n\tDisableApiKeyResponse,\n\tMutationDisableApiKeyArgs,\n\tMutationResolvers,\n} from '../../../schema'\nimport { GraphQLResolveInfo } from 'graphql'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { PermissionActions, ApiKeyManager } from '../../../model'\nimport { createErrorResponse } from '../../errorUtils'\n\nexport class DisableApiKeyMutationResolver implements MutationResolvers {\n\tconstructor(private readonly apiKeyManager: ApiKeyManager) {}\n\n\tasync disableApiKey(\n\t\tparent: any,\n\t\t{ id }: MutationDisableApiKeyArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<DisableApiKeyResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.API_KEY_DISABLE,\n\t\t\tmessage: 'You are not allowed to disable api key',\n\t\t})\n\n\t\tconst result = await this.apiKeyManager.disableApiKey(context.db, id)\n\n\t\tif (!result) {\n\t\t\treturn createErrorResponse('KEY_NOT_FOUND', 'API key not found')\n\t\t}\n\n\t\treturn {\n\t\t\tok: true,\n\t\t\terrors: [],\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAWO,MAAM,8BAA2D;AAAA,EACvE,YAA6B,eAA8B;AAA9B,SAAA,gBAAA;AAAA,EAA+B;AAAA,EAE5D,MAAM,cACL,QACA,EAAE,GAAG,GACL,SACA,MACiC;AACjC,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQ,kBAAkB;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AAED,UAAM,SAAS,MAAM,KAAK,cAAc,cAAc,QAAQ,IAAI,EAAE;AAEpE,QAAI,CAAC,QAAQ;AACL,aAAA,oBAAoB,iBAAiB,mBAAmB;AAAA,IAChE;AAEO,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ,CAAC;AAAA,IAAA;AAAA,EAEX;AACD;"}
1
+ {"version":3,"file":"DisableApiKeyMutationResolver.js","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/apiKey/DisableApiKeyMutationResolver.ts"],"sourcesContent":["import {\n\tDisableApiKeyErrorCode,\n\tDisableApiKeyResponse,\n\tMutationDisableApiKeyArgs,\n\tMutationResolvers,\n} from '../../../schema'\nimport { GraphQLResolveInfo } from 'graphql'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { PermissionActions, ApiKeyManager } from '../../../model'\nimport { createErrorResponse } from '../../errorUtils'\n\nexport class DisableApiKeyMutationResolver implements MutationResolvers {\n\tconstructor(private readonly apiKeyManager: ApiKeyManager) {}\n\n\tasync disableApiKey(\n\t\tparent: any,\n\t\t{ id }: MutationDisableApiKeyArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<DisableApiKeyResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.API_KEY_DISABLE,\n\t\t\tmessage: 'You are not allowed to disable api key',\n\t\t})\n\n\t\tconst result = await this.apiKeyManager.disableApiKey(context.db, id)\n\n\t\tif (!result) {\n\t\t\treturn createErrorResponse('KEY_NOT_FOUND', 'API key not found')\n\t\t}\n\n\t\treturn {\n\t\t\tok: true,\n\t\t\terrors: [],\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAWO,MAAM,8BAA2D;AAAA,EACvE,YAA6B,eAA8B;AAA9B,SAAA,gBAAA;AAAA,EAAA;AAAA,EAE7B,MAAM,cACL,QACA,EAAE,GAAG,GACL,SACA,MACiC;AACjC,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQ,kBAAkB;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AAED,UAAM,SAAS,MAAM,KAAK,cAAc,cAAc,QAAQ,IAAI,EAAE;AAEpE,QAAI,CAAC,QAAQ;AACL,aAAA,oBAAoB,iBAAiB,mBAAmB;AAAA,IAAA;AAGzD,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ,CAAA;AAAA,IACT;AAAA,EAAA;AAEF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigurationMutationResolver.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/configuration/ConfigurationMutationResolver.ts"],"sourcesContent":["import { ConfigureResponse, MutationConfigureArgs, MutationResolvers } from '../../../schema'\nimport { ConfigurationManager } from '../../../model/service/ConfigurationManager'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { PermissionActions } from '../../../model'\nimport { createErrorResponse } from '../../errorUtils'\n\nexport class ConfigurationMutationResolver implements Pick<MutationResolvers, 'configure'> {\n\tconstructor(\n\t\tprivate readonly configurationManager: ConfigurationManager,\n\t) {\n\t}\n\n\tasync configure(parent: any, { config }: MutationConfigureArgs, context: TenantResolverContext): Promise<ConfigureResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.CONFIGURE,\n\t\t\tmessage: 'You are not allowed to configure',\n\t\t})\n\n\t\tconst result = await this.configurationManager.updateConfiguration(context.db, config)\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn {\n\t\t\tok: true,\n\t\t}\n\t}\n}\n"],"names":["PermissionActions","createErrorResponse"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAMO,MAAM,8BAA8E;AAAA,EAC1F,YACkB,sBAChB;AADgB,SAAA,uBAAA;AAAA,EAElB;AAAA,EAEA,MAAM,UAAU,QAAa,EAAE,OAAA,GAAiC,SAA4D;AAC3H,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQA,kBAAkB,kBAAA;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AAED,UAAM,SAAS,MAAM,KAAK,qBAAqB,oBAAoB,QAAQ,IAAI,MAAM;AAEjF,QAAA,CAAC,OAAO,IAAI;AACf,aAAOC,WAAoB,oBAAA,OAAO,OAAO,OAAO,YAAY;AAAA,IAC7D;AAEO,WAAA;AAAA,MACN,IAAI;AAAA,IAAA;AAAA,EAEN;AACD;;"}
1
+ {"version":3,"file":"ConfigurationMutationResolver.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/configuration/ConfigurationMutationResolver.ts"],"sourcesContent":["import { ConfigureResponse, MutationConfigureArgs, MutationResolvers } from '../../../schema'\nimport { ConfigurationManager } from '../../../model/service/ConfigurationManager'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { PermissionActions } from '../../../model'\nimport { createErrorResponse } from '../../errorUtils'\n\nexport class ConfigurationMutationResolver implements Pick<MutationResolvers, 'configure'> {\n\tconstructor(\n\t\tprivate readonly configurationManager: ConfigurationManager,\n\t) {\n\t}\n\n\tasync configure(parent: any, { config }: MutationConfigureArgs, context: TenantResolverContext): Promise<ConfigureResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.CONFIGURE,\n\t\t\tmessage: 'You are not allowed to configure',\n\t\t})\n\n\t\tconst result = await this.configurationManager.updateConfiguration(context.db, config)\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn {\n\t\t\tok: true,\n\t\t}\n\t}\n}\n"],"names":["PermissionActions","createErrorResponse"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAMO,MAAM,8BAA8E;AAAA,EAC1F,YACkB,sBAChB;AADgB,SAAA,uBAAA;AAAA,EAAA;AAAA,EAIlB,MAAM,UAAU,QAAa,EAAE,OAAA,GAAiC,SAA4D;AAC3H,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQA,kBAAkB,kBAAA;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AAED,UAAM,SAAS,MAAM,KAAK,qBAAqB,oBAAoB,QAAQ,IAAI,MAAM;AAEjF,QAAA,CAAC,OAAO,IAAI;AACf,aAAOC,WAAoB,oBAAA,OAAO,OAAO,OAAO,YAAY;AAAA,IAAA;AAGtD,WAAA;AAAA,MACN,IAAI;AAAA,IACL;AAAA,EAAA;AAEF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigurationMutationResolver.js","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/configuration/ConfigurationMutationResolver.ts"],"sourcesContent":["import { ConfigureResponse, MutationConfigureArgs, MutationResolvers } from '../../../schema'\nimport { ConfigurationManager } from '../../../model/service/ConfigurationManager'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { PermissionActions } from '../../../model'\nimport { createErrorResponse } from '../../errorUtils'\n\nexport class ConfigurationMutationResolver implements Pick<MutationResolvers, 'configure'> {\n\tconstructor(\n\t\tprivate readonly configurationManager: ConfigurationManager,\n\t) {\n\t}\n\n\tasync configure(parent: any, { config }: MutationConfigureArgs, context: TenantResolverContext): Promise<ConfigureResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.CONFIGURE,\n\t\t\tmessage: 'You are not allowed to configure',\n\t\t})\n\n\t\tconst result = await this.configurationManager.updateConfiguration(context.db, config)\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn {\n\t\t\tok: true,\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAMO,MAAM,8BAA8E;AAAA,EAC1F,YACkB,sBAChB;AADgB,SAAA,uBAAA;AAAA,EAElB;AAAA,EAEA,MAAM,UAAU,QAAa,EAAE,OAAA,GAAiC,SAA4D;AAC3H,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQ,kBAAkB;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AAED,UAAM,SAAS,MAAM,KAAK,qBAAqB,oBAAoB,QAAQ,IAAI,MAAM;AAEjF,QAAA,CAAC,OAAO,IAAI;AACf,aAAO,oBAAoB,OAAO,OAAO,OAAO,YAAY;AAAA,IAC7D;AAEO,WAAA;AAAA,MACN,IAAI;AAAA,IAAA;AAAA,EAEN;AACD;"}
1
+ {"version":3,"file":"ConfigurationMutationResolver.js","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/configuration/ConfigurationMutationResolver.ts"],"sourcesContent":["import { ConfigureResponse, MutationConfigureArgs, MutationResolvers } from '../../../schema'\nimport { ConfigurationManager } from '../../../model/service/ConfigurationManager'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { PermissionActions } from '../../../model'\nimport { createErrorResponse } from '../../errorUtils'\n\nexport class ConfigurationMutationResolver implements Pick<MutationResolvers, 'configure'> {\n\tconstructor(\n\t\tprivate readonly configurationManager: ConfigurationManager,\n\t) {\n\t}\n\n\tasync configure(parent: any, { config }: MutationConfigureArgs, context: TenantResolverContext): Promise<ConfigureResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.CONFIGURE,\n\t\t\tmessage: 'You are not allowed to configure',\n\t\t})\n\n\t\tconst result = await this.configurationManager.updateConfiguration(context.db, config)\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn {\n\t\t\tok: true,\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAMO,MAAM,8BAA8E;AAAA,EAC1F,YACkB,sBAChB;AADgB,SAAA,uBAAA;AAAA,EAAA;AAAA,EAIlB,MAAM,UAAU,QAAa,EAAE,OAAA,GAAiC,SAA4D;AAC3H,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQ,kBAAkB;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AAED,UAAM,SAAS,MAAM,KAAK,qBAAqB,oBAAoB,QAAQ,IAAI,MAAM;AAEjF,QAAA,CAAC,OAAO,IAAI;AACf,aAAO,oBAAoB,OAAO,OAAO,OAAO,YAAY;AAAA,IAAA;AAGtD,WAAA;AAAA,MACN,IAAI;AAAA,IACL;AAAA,EAAA;AAEF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"GlobalRolesMutationResolver.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/identity/GlobalRolesMutationResolver.ts"],"sourcesContent":["import {\n\tAddGlobalIdentityRolesResponse,\n\tMutationAddGlobalIdentityRolesArgs,\n\tMutationRemoveGlobalIdentityRolesArgs,\n\tMutationResolvers,\n\tRemoveGlobalIdentityRolesResponse,\n} from '../../../schema'\nimport { GraphQLResolveInfo } from 'graphql'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { PermissionActions } from '../../../model'\nimport { createErrorResponse } from '../../errorUtils'\nimport { RolesManager } from '../../../model'\n\nexport class IdentityGlobalRolesMutationResolver implements MutationResolvers {\n\tconstructor(\n\t\tprivate readonly rolesManager: RolesManager,\n\t) {\n\t}\n\n\tasync addGlobalIdentityRoles(\n\t\tparent: any,\n\t\t{ roles, identityId }: MutationAddGlobalIdentityRolesArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<AddGlobalIdentityRolesResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.IDENTITY_ADD_GLOBAL_ROLES(roles),\n\t\t\tmessage: 'You are not allowed to add global roles',\n\t\t})\n\n\t\tconst result = await this.rolesManager.addGlobalRoles(context.db, identityId, roles)\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn {\n\t\t\tok: true,\n\t\t\tresult: {\n\t\t\t\tidentity: { id: identityId, projects: [] },\n\t\t\t},\n\t\t}\n\t}\n\n\tasync removeGlobalIdentityRoles(\n\t\tparent: any,\n\t\t{ roles, identityId }: MutationRemoveGlobalIdentityRolesArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<RemoveGlobalIdentityRolesResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.IDENTITY_REMOVE_GLOBAL_ROLES(roles),\n\t\t\tmessage: 'You are not allowed to remove global roles',\n\t\t})\n\n\t\tconst result = await this.rolesManager.removeGlobalRoles(context.db, identityId, roles)\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn {\n\t\t\tok: true,\n\t\t\tresult: {\n\t\t\t\tidentity: { id: identityId, projects: [] },\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":["PermissionActions","createErrorResponse"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAaO,MAAM,oCAAiE;AAAA,EAC7E,YACkB,cAChB;AADgB,SAAA,eAAA;AAAA,EAElB;AAAA,EAEA,MAAM,uBACL,QACA,EAAE,OAAO,WAAW,GACpB,SACA,MAC0C;AAC1C,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQA,kBAAAA,kBAAkB,0BAA0B,KAAK;AAAA,MACzD,SAAS;AAAA,IAAA,CACT;AAEK,UAAA,SAAS,MAAM,KAAK,aAAa,eAAe,QAAQ,IAAI,YAAY,KAAK;AAE/E,QAAA,CAAC,OAAO,IAAI;AACf,aAAOC,WAAoB,oBAAA,OAAO,OAAO,OAAO,YAAY;AAAA,IAC7D;AAEO,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ;AAAA,QACP,UAAU,EAAE,IAAI,YAAY,UAAU,CAAA,EAAG;AAAA,MAC1C;AAAA,IAAA;AAAA,EAEF;AAAA,EAEA,MAAM,0BACL,QACA,EAAE,OAAO,WAAW,GACpB,SACA,MAC6C;AAC7C,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQD,kBAAAA,kBAAkB,6BAA6B,KAAK;AAAA,MAC5D,SAAS;AAAA,IAAA,CACT;AAEK,UAAA,SAAS,MAAM,KAAK,aAAa,kBAAkB,QAAQ,IAAI,YAAY,KAAK;AAElF,QAAA,CAAC,OAAO,IAAI;AACf,aAAOC,WAAoB,oBAAA,OAAO,OAAO,OAAO,YAAY;AAAA,IAC7D;AAEO,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ;AAAA,QACP,UAAU,EAAE,IAAI,YAAY,UAAU,CAAA,EAAG;AAAA,MAC1C;AAAA,IAAA;AAAA,EAEF;AACD;;"}
1
+ {"version":3,"file":"GlobalRolesMutationResolver.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/identity/GlobalRolesMutationResolver.ts"],"sourcesContent":["import {\n\tAddGlobalIdentityRolesResponse,\n\tMutationAddGlobalIdentityRolesArgs,\n\tMutationRemoveGlobalIdentityRolesArgs,\n\tMutationResolvers,\n\tRemoveGlobalIdentityRolesResponse,\n} from '../../../schema'\nimport { GraphQLResolveInfo } from 'graphql'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { PermissionActions } from '../../../model'\nimport { createErrorResponse } from '../../errorUtils'\nimport { RolesManager } from '../../../model'\n\nexport class IdentityGlobalRolesMutationResolver implements MutationResolvers {\n\tconstructor(\n\t\tprivate readonly rolesManager: RolesManager,\n\t) {\n\t}\n\n\tasync addGlobalIdentityRoles(\n\t\tparent: any,\n\t\t{ roles, identityId }: MutationAddGlobalIdentityRolesArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<AddGlobalIdentityRolesResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.IDENTITY_ADD_GLOBAL_ROLES(roles),\n\t\t\tmessage: 'You are not allowed to add global roles',\n\t\t})\n\n\t\tconst result = await this.rolesManager.addGlobalRoles(context.db, identityId, roles)\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn {\n\t\t\tok: true,\n\t\t\tresult: {\n\t\t\t\tidentity: { id: identityId, projects: [] },\n\t\t\t},\n\t\t}\n\t}\n\n\tasync removeGlobalIdentityRoles(\n\t\tparent: any,\n\t\t{ roles, identityId }: MutationRemoveGlobalIdentityRolesArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<RemoveGlobalIdentityRolesResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.IDENTITY_REMOVE_GLOBAL_ROLES(roles),\n\t\t\tmessage: 'You are not allowed to remove global roles',\n\t\t})\n\n\t\tconst result = await this.rolesManager.removeGlobalRoles(context.db, identityId, roles)\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn {\n\t\t\tok: true,\n\t\t\tresult: {\n\t\t\t\tidentity: { id: identityId, projects: [] },\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":["PermissionActions","createErrorResponse"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAaO,MAAM,oCAAiE;AAAA,EAC7E,YACkB,cAChB;AADgB,SAAA,eAAA;AAAA,EAAA;AAAA,EAIlB,MAAM,uBACL,QACA,EAAE,OAAO,WAAW,GACpB,SACA,MAC0C;AAC1C,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQA,kBAAAA,kBAAkB,0BAA0B,KAAK;AAAA,MACzD,SAAS;AAAA,IAAA,CACT;AAEK,UAAA,SAAS,MAAM,KAAK,aAAa,eAAe,QAAQ,IAAI,YAAY,KAAK;AAE/E,QAAA,CAAC,OAAO,IAAI;AACf,aAAOC,WAAoB,oBAAA,OAAO,OAAO,OAAO,YAAY;AAAA,IAAA;AAGtD,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ;AAAA,QACP,UAAU,EAAE,IAAI,YAAY,UAAU,CAAG,EAAA;AAAA,MAAA;AAAA,IAE3C;AAAA,EAAA;AAAA,EAGD,MAAM,0BACL,QACA,EAAE,OAAO,WAAW,GACpB,SACA,MAC6C;AAC7C,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQD,kBAAAA,kBAAkB,6BAA6B,KAAK;AAAA,MAC5D,SAAS;AAAA,IAAA,CACT;AAEK,UAAA,SAAS,MAAM,KAAK,aAAa,kBAAkB,QAAQ,IAAI,YAAY,KAAK;AAElF,QAAA,CAAC,OAAO,IAAI;AACf,aAAOC,WAAoB,oBAAA,OAAO,OAAO,OAAO,YAAY;AAAA,IAAA;AAGtD,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ;AAAA,QACP,UAAU,EAAE,IAAI,YAAY,UAAU,CAAG,EAAA;AAAA,MAAA;AAAA,IAE3C;AAAA,EAAA;AAEF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"GlobalRolesMutationResolver.js","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/identity/GlobalRolesMutationResolver.ts"],"sourcesContent":["import {\n\tAddGlobalIdentityRolesResponse,\n\tMutationAddGlobalIdentityRolesArgs,\n\tMutationRemoveGlobalIdentityRolesArgs,\n\tMutationResolvers,\n\tRemoveGlobalIdentityRolesResponse,\n} from '../../../schema'\nimport { GraphQLResolveInfo } from 'graphql'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { PermissionActions } from '../../../model'\nimport { createErrorResponse } from '../../errorUtils'\nimport { RolesManager } from '../../../model'\n\nexport class IdentityGlobalRolesMutationResolver implements MutationResolvers {\n\tconstructor(\n\t\tprivate readonly rolesManager: RolesManager,\n\t) {\n\t}\n\n\tasync addGlobalIdentityRoles(\n\t\tparent: any,\n\t\t{ roles, identityId }: MutationAddGlobalIdentityRolesArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<AddGlobalIdentityRolesResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.IDENTITY_ADD_GLOBAL_ROLES(roles),\n\t\t\tmessage: 'You are not allowed to add global roles',\n\t\t})\n\n\t\tconst result = await this.rolesManager.addGlobalRoles(context.db, identityId, roles)\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn {\n\t\t\tok: true,\n\t\t\tresult: {\n\t\t\t\tidentity: { id: identityId, projects: [] },\n\t\t\t},\n\t\t}\n\t}\n\n\tasync removeGlobalIdentityRoles(\n\t\tparent: any,\n\t\t{ roles, identityId }: MutationRemoveGlobalIdentityRolesArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<RemoveGlobalIdentityRolesResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.IDENTITY_REMOVE_GLOBAL_ROLES(roles),\n\t\t\tmessage: 'You are not allowed to remove global roles',\n\t\t})\n\n\t\tconst result = await this.rolesManager.removeGlobalRoles(context.db, identityId, roles)\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn {\n\t\t\tok: true,\n\t\t\tresult: {\n\t\t\t\tidentity: { id: identityId, projects: [] },\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAaO,MAAM,oCAAiE;AAAA,EAC7E,YACkB,cAChB;AADgB,SAAA,eAAA;AAAA,EAElB;AAAA,EAEA,MAAM,uBACL,QACA,EAAE,OAAO,WAAW,GACpB,SACA,MAC0C;AAC1C,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQ,kBAAkB,0BAA0B,KAAK;AAAA,MACzD,SAAS;AAAA,IAAA,CACT;AAEK,UAAA,SAAS,MAAM,KAAK,aAAa,eAAe,QAAQ,IAAI,YAAY,KAAK;AAE/E,QAAA,CAAC,OAAO,IAAI;AACf,aAAO,oBAAoB,OAAO,OAAO,OAAO,YAAY;AAAA,IAC7D;AAEO,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ;AAAA,QACP,UAAU,EAAE,IAAI,YAAY,UAAU,CAAA,EAAG;AAAA,MAC1C;AAAA,IAAA;AAAA,EAEF;AAAA,EAEA,MAAM,0BACL,QACA,EAAE,OAAO,WAAW,GACpB,SACA,MAC6C;AAC7C,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQ,kBAAkB,6BAA6B,KAAK;AAAA,MAC5D,SAAS;AAAA,IAAA,CACT;AAEK,UAAA,SAAS,MAAM,KAAK,aAAa,kBAAkB,QAAQ,IAAI,YAAY,KAAK;AAElF,QAAA,CAAC,OAAO,IAAI;AACf,aAAO,oBAAoB,OAAO,OAAO,OAAO,YAAY;AAAA,IAC7D;AAEO,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ;AAAA,QACP,UAAU,EAAE,IAAI,YAAY,UAAU,CAAA,EAAG;AAAA,MAC1C;AAAA,IAAA;AAAA,EAEF;AACD;"}
1
+ {"version":3,"file":"GlobalRolesMutationResolver.js","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/identity/GlobalRolesMutationResolver.ts"],"sourcesContent":["import {\n\tAddGlobalIdentityRolesResponse,\n\tMutationAddGlobalIdentityRolesArgs,\n\tMutationRemoveGlobalIdentityRolesArgs,\n\tMutationResolvers,\n\tRemoveGlobalIdentityRolesResponse,\n} from '../../../schema'\nimport { GraphQLResolveInfo } from 'graphql'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { PermissionActions } from '../../../model'\nimport { createErrorResponse } from '../../errorUtils'\nimport { RolesManager } from '../../../model'\n\nexport class IdentityGlobalRolesMutationResolver implements MutationResolvers {\n\tconstructor(\n\t\tprivate readonly rolesManager: RolesManager,\n\t) {\n\t}\n\n\tasync addGlobalIdentityRoles(\n\t\tparent: any,\n\t\t{ roles, identityId }: MutationAddGlobalIdentityRolesArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<AddGlobalIdentityRolesResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.IDENTITY_ADD_GLOBAL_ROLES(roles),\n\t\t\tmessage: 'You are not allowed to add global roles',\n\t\t})\n\n\t\tconst result = await this.rolesManager.addGlobalRoles(context.db, identityId, roles)\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn {\n\t\t\tok: true,\n\t\t\tresult: {\n\t\t\t\tidentity: { id: identityId, projects: [] },\n\t\t\t},\n\t\t}\n\t}\n\n\tasync removeGlobalIdentityRoles(\n\t\tparent: any,\n\t\t{ roles, identityId }: MutationRemoveGlobalIdentityRolesArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<RemoveGlobalIdentityRolesResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.IDENTITY_REMOVE_GLOBAL_ROLES(roles),\n\t\t\tmessage: 'You are not allowed to remove global roles',\n\t\t})\n\n\t\tconst result = await this.rolesManager.removeGlobalRoles(context.db, identityId, roles)\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn {\n\t\t\tok: true,\n\t\t\tresult: {\n\t\t\t\tidentity: { id: identityId, projects: [] },\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAaO,MAAM,oCAAiE;AAAA,EAC7E,YACkB,cAChB;AADgB,SAAA,eAAA;AAAA,EAAA;AAAA,EAIlB,MAAM,uBACL,QACA,EAAE,OAAO,WAAW,GACpB,SACA,MAC0C;AAC1C,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQ,kBAAkB,0BAA0B,KAAK;AAAA,MACzD,SAAS;AAAA,IAAA,CACT;AAEK,UAAA,SAAS,MAAM,KAAK,aAAa,eAAe,QAAQ,IAAI,YAAY,KAAK;AAE/E,QAAA,CAAC,OAAO,IAAI;AACf,aAAO,oBAAoB,OAAO,OAAO,OAAO,YAAY;AAAA,IAAA;AAGtD,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ;AAAA,QACP,UAAU,EAAE,IAAI,YAAY,UAAU,CAAG,EAAA;AAAA,MAAA;AAAA,IAE3C;AAAA,EAAA;AAAA,EAGD,MAAM,0BACL,QACA,EAAE,OAAO,WAAW,GACpB,SACA,MAC6C;AAC7C,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQ,kBAAkB,6BAA6B,KAAK;AAAA,MAC5D,SAAS;AAAA,IAAA,CACT;AAEK,UAAA,SAAS,MAAM,KAAK,aAAa,kBAAkB,QAAQ,IAAI,YAAY,KAAK;AAElF,QAAA,CAAC,OAAO,IAAI;AACf,aAAO,oBAAoB,OAAO,OAAO,OAAO,YAAY;AAAA,IAAA;AAGtD,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ;AAAA,QACP,UAAU,EAAE,IAAI,YAAY,UAAU,CAAG,EAAA;AAAA,MAAA;AAAA,IAE3C;AAAA,EAAA;AAEF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AddIDPMutationResolver.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/idp/AddIDPMutationResolver.ts"],"sourcesContent":["import { AddIdpResponse, MutationAddIdpArgs, MutationResolvers } from '../../../schema'\nimport { PermissionActions } from '../../../model'\nimport { IDPManager } from '../../../model/service/idp/IDPManager'\nimport { createErrorResponse } from '../../errorUtils'\nimport { TenantResolverContext } from '../../TenantResolverContext'\n\nexport class AddIDPMutationResolver implements MutationResolvers {\n\tconstructor(private readonly idpManager: IDPManager) {\n\t}\n\n\tasync addIDP(parent: unknown, args: MutationAddIdpArgs, context: TenantResolverContext): Promise<AddIdpResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.IDP_ADD,\n\t\t\tmessage: 'You are not allowed to add IDP',\n\t\t})\n\t\tconst result = await this.idpManager.addIDP(context.db, {\n\t\t\tconfiguration: args.configuration,\n\t\t\tslug: args.identityProvider,\n\t\t\ttype: args.type,\n\t\t\toptions: {\n\t\t\t\tautoSignUp: args.options?.autoSignUp ?? false,\n\t\t\t\texclusive: args.options?.exclusive ?? false,\n\t\t\t\tinitReturnsConfig: args.options?.initReturnsConfig ?? false,\n\t\t\t},\n\t\t})\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true }\n\t}\n}\n"],"names":["PermissionActions","createErrorResponse"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAMO,MAAM,uBAAoD;AAAA,EAChE,YAA6B,YAAwB;AAAxB,SAAA,aAAA;AAAA,EAC7B;AAAA,EAEA,MAAM,OAAO,QAAiB,MAA0B,SAAyD;AAChH,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQA,kBAAkB,kBAAA;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACD,UAAM,SAAS,MAAM,KAAK,WAAW,OAAO,QAAQ,IAAI;AAAA,MACvD,eAAe,KAAK;AAAA,MACpB,MAAM,KAAK;AAAA,MACX,MAAM,KAAK;AAAA,MACX,SAAS;AAAA,QACR,YAAY,KAAK,SAAS,cAAc;AAAA,QACxC,WAAW,KAAK,SAAS,aAAa;AAAA,QACtC,mBAAmB,KAAK,SAAS,qBAAqB;AAAA,MACvD;AAAA,IAAA,CACA;AACG,QAAA,CAAC,OAAO,IAAI;AACf,aAAOC,WAAoB,oBAAA,OAAO,OAAO,OAAO,YAAY;AAAA,IAC7D;AAEO,WAAA,EAAE,IAAI;EACd;AACD;;"}
1
+ {"version":3,"file":"AddIDPMutationResolver.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/idp/AddIDPMutationResolver.ts"],"sourcesContent":["import { AddIdpResponse, MutationAddIdpArgs, MutationResolvers } from '../../../schema'\nimport { PermissionActions } from '../../../model'\nimport { IDPManager } from '../../../model/service/idp/IDPManager'\nimport { createErrorResponse } from '../../errorUtils'\nimport { TenantResolverContext } from '../../TenantResolverContext'\n\nexport class AddIDPMutationResolver implements MutationResolvers {\n\tconstructor(private readonly idpManager: IDPManager) {\n\t}\n\n\tasync addIDP(parent: unknown, args: MutationAddIdpArgs, context: TenantResolverContext): Promise<AddIdpResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.IDP_ADD,\n\t\t\tmessage: 'You are not allowed to add IDP',\n\t\t})\n\t\tconst result = await this.idpManager.addIDP(context.db, {\n\t\t\tconfiguration: args.configuration,\n\t\t\tslug: args.identityProvider,\n\t\t\ttype: args.type,\n\t\t\toptions: {\n\t\t\t\tautoSignUp: args.options?.autoSignUp ?? false,\n\t\t\t\texclusive: args.options?.exclusive ?? false,\n\t\t\t\tinitReturnsConfig: args.options?.initReturnsConfig ?? false,\n\t\t\t},\n\t\t})\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true }\n\t}\n}\n"],"names":["PermissionActions","createErrorResponse"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAMO,MAAM,uBAAoD;AAAA,EAChE,YAA6B,YAAwB;AAAxB,SAAA,aAAA;AAAA,EAAA;AAAA,EAG7B,MAAM,OAAO,QAAiB,MAA0B,SAAyD;AAChH,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQA,kBAAkB,kBAAA;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACD,UAAM,SAAS,MAAM,KAAK,WAAW,OAAO,QAAQ,IAAI;AAAA,MACvD,eAAe,KAAK;AAAA,MACpB,MAAM,KAAK;AAAA,MACX,MAAM,KAAK;AAAA,MACX,SAAS;AAAA,QACR,YAAY,KAAK,SAAS,cAAc;AAAA,QACxC,WAAW,KAAK,SAAS,aAAa;AAAA,QACtC,mBAAmB,KAAK,SAAS,qBAAqB;AAAA,MAAA;AAAA,IACvD,CACA;AACG,QAAA,CAAC,OAAO,IAAI;AACf,aAAOC,WAAoB,oBAAA,OAAO,OAAO,OAAO,YAAY;AAAA,IAAA;AAGtD,WAAA,EAAE,IAAI,KAAK;AAAA,EAAA;AAEpB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AddIDPMutationResolver.js","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/idp/AddIDPMutationResolver.ts"],"sourcesContent":["import { AddIdpResponse, MutationAddIdpArgs, MutationResolvers } from '../../../schema'\nimport { PermissionActions } from '../../../model'\nimport { IDPManager } from '../../../model/service/idp/IDPManager'\nimport { createErrorResponse } from '../../errorUtils'\nimport { TenantResolverContext } from '../../TenantResolverContext'\n\nexport class AddIDPMutationResolver implements MutationResolvers {\n\tconstructor(private readonly idpManager: IDPManager) {\n\t}\n\n\tasync addIDP(parent: unknown, args: MutationAddIdpArgs, context: TenantResolverContext): Promise<AddIdpResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.IDP_ADD,\n\t\t\tmessage: 'You are not allowed to add IDP',\n\t\t})\n\t\tconst result = await this.idpManager.addIDP(context.db, {\n\t\t\tconfiguration: args.configuration,\n\t\t\tslug: args.identityProvider,\n\t\t\ttype: args.type,\n\t\t\toptions: {\n\t\t\t\tautoSignUp: args.options?.autoSignUp ?? false,\n\t\t\t\texclusive: args.options?.exclusive ?? false,\n\t\t\t\tinitReturnsConfig: args.options?.initReturnsConfig ?? false,\n\t\t\t},\n\t\t})\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true }\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAMO,MAAM,uBAAoD;AAAA,EAChE,YAA6B,YAAwB;AAAxB,SAAA,aAAA;AAAA,EAC7B;AAAA,EAEA,MAAM,OAAO,QAAiB,MAA0B,SAAyD;AAChH,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQ,kBAAkB;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACD,UAAM,SAAS,MAAM,KAAK,WAAW,OAAO,QAAQ,IAAI;AAAA,MACvD,eAAe,KAAK;AAAA,MACpB,MAAM,KAAK;AAAA,MACX,MAAM,KAAK;AAAA,MACX,SAAS;AAAA,QACR,YAAY,KAAK,SAAS,cAAc;AAAA,QACxC,WAAW,KAAK,SAAS,aAAa;AAAA,QACtC,mBAAmB,KAAK,SAAS,qBAAqB;AAAA,MACvD;AAAA,IAAA,CACA;AACG,QAAA,CAAC,OAAO,IAAI;AACf,aAAO,oBAAoB,OAAO,OAAO,OAAO,YAAY;AAAA,IAC7D;AAEO,WAAA,EAAE,IAAI;EACd;AACD;"}
1
+ {"version":3,"file":"AddIDPMutationResolver.js","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/idp/AddIDPMutationResolver.ts"],"sourcesContent":["import { AddIdpResponse, MutationAddIdpArgs, MutationResolvers } from '../../../schema'\nimport { PermissionActions } from '../../../model'\nimport { IDPManager } from '../../../model/service/idp/IDPManager'\nimport { createErrorResponse } from '../../errorUtils'\nimport { TenantResolverContext } from '../../TenantResolverContext'\n\nexport class AddIDPMutationResolver implements MutationResolvers {\n\tconstructor(private readonly idpManager: IDPManager) {\n\t}\n\n\tasync addIDP(parent: unknown, args: MutationAddIdpArgs, context: TenantResolverContext): Promise<AddIdpResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.IDP_ADD,\n\t\t\tmessage: 'You are not allowed to add IDP',\n\t\t})\n\t\tconst result = await this.idpManager.addIDP(context.db, {\n\t\t\tconfiguration: args.configuration,\n\t\t\tslug: args.identityProvider,\n\t\t\ttype: args.type,\n\t\t\toptions: {\n\t\t\t\tautoSignUp: args.options?.autoSignUp ?? false,\n\t\t\t\texclusive: args.options?.exclusive ?? false,\n\t\t\t\tinitReturnsConfig: args.options?.initReturnsConfig ?? false,\n\t\t\t},\n\t\t})\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true }\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAMO,MAAM,uBAAoD;AAAA,EAChE,YAA6B,YAAwB;AAAxB,SAAA,aAAA;AAAA,EAAA;AAAA,EAG7B,MAAM,OAAO,QAAiB,MAA0B,SAAyD;AAChH,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQ,kBAAkB;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACD,UAAM,SAAS,MAAM,KAAK,WAAW,OAAO,QAAQ,IAAI;AAAA,MACvD,eAAe,KAAK;AAAA,MACpB,MAAM,KAAK;AAAA,MACX,MAAM,KAAK;AAAA,MACX,SAAS;AAAA,QACR,YAAY,KAAK,SAAS,cAAc;AAAA,QACxC,WAAW,KAAK,SAAS,aAAa;AAAA,QACtC,mBAAmB,KAAK,SAAS,qBAAqB;AAAA,MAAA;AAAA,IACvD,CACA;AACG,QAAA,CAAC,OAAO,IAAI;AACf,aAAO,oBAAoB,OAAO,OAAO,OAAO,YAAY;AAAA,IAAA;AAGtD,WAAA,EAAE,IAAI,KAAK;AAAA,EAAA;AAEpB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"DisableIDPMutationResolver.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/idp/DisableIDPMutationResolver.ts"],"sourcesContent":["import { DisableIdpResponse, MutationDisableIdpArgs, MutationResolvers } from '../../../schema'\nimport { PermissionActions } from '../../../model'\nimport { IDPManager } from '../../../model/service/idp/IDPManager'\nimport { createErrorResponse } from '../../errorUtils'\nimport { TenantResolverContext } from '../../TenantResolverContext'\n\nexport class DisableIDPMutationResolver implements MutationResolvers {\n\tconstructor(private readonly idpManager: IDPManager) {\n\t}\n\n\tasync disableIDP(parent: any, args: MutationDisableIdpArgs, context: TenantResolverContext): Promise<DisableIdpResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.IDP_DISABLE,\n\t\t\tmessage: 'You are not allowed to disable IDP',\n\t\t})\n\t\tconst result = await this.idpManager.disableIDP(context.db, args.identityProvider)\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true }\n\t}\n}\n"],"names":["PermissionActions","createErrorResponse"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAMO,MAAM,2BAAwD;AAAA,EACpE,YAA6B,YAAwB;AAAxB,SAAA,aAAA;AAAA,EAC7B;AAAA,EAEA,MAAM,WAAW,QAAa,MAA8B,SAA6D;AACxH,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQA,kBAAkB,kBAAA;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACK,UAAA,SAAS,MAAM,KAAK,WAAW,WAAW,QAAQ,IAAI,KAAK,gBAAgB;AAC7E,QAAA,CAAC,OAAO,IAAI;AACf,aAAOC,WAAoB,oBAAA,OAAO,OAAO,OAAO,YAAY;AAAA,IAC7D;AAEO,WAAA,EAAE,IAAI;EACd;AACD;;"}
1
+ {"version":3,"file":"DisableIDPMutationResolver.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/idp/DisableIDPMutationResolver.ts"],"sourcesContent":["import { DisableIdpResponse, MutationDisableIdpArgs, MutationResolvers } from '../../../schema'\nimport { PermissionActions } from '../../../model'\nimport { IDPManager } from '../../../model/service/idp/IDPManager'\nimport { createErrorResponse } from '../../errorUtils'\nimport { TenantResolverContext } from '../../TenantResolverContext'\n\nexport class DisableIDPMutationResolver implements MutationResolvers {\n\tconstructor(private readonly idpManager: IDPManager) {\n\t}\n\n\tasync disableIDP(parent: any, args: MutationDisableIdpArgs, context: TenantResolverContext): Promise<DisableIdpResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.IDP_DISABLE,\n\t\t\tmessage: 'You are not allowed to disable IDP',\n\t\t})\n\t\tconst result = await this.idpManager.disableIDP(context.db, args.identityProvider)\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true }\n\t}\n}\n"],"names":["PermissionActions","createErrorResponse"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAMO,MAAM,2BAAwD;AAAA,EACpE,YAA6B,YAAwB;AAAxB,SAAA,aAAA;AAAA,EAAA;AAAA,EAG7B,MAAM,WAAW,QAAa,MAA8B,SAA6D;AACxH,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQA,kBAAkB,kBAAA;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACK,UAAA,SAAS,MAAM,KAAK,WAAW,WAAW,QAAQ,IAAI,KAAK,gBAAgB;AAC7E,QAAA,CAAC,OAAO,IAAI;AACf,aAAOC,WAAoB,oBAAA,OAAO,OAAO,OAAO,YAAY;AAAA,IAAA;AAGtD,WAAA,EAAE,IAAI,KAAK;AAAA,EAAA;AAEpB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"DisableIDPMutationResolver.js","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/idp/DisableIDPMutationResolver.ts"],"sourcesContent":["import { DisableIdpResponse, MutationDisableIdpArgs, MutationResolvers } from '../../../schema'\nimport { PermissionActions } from '../../../model'\nimport { IDPManager } from '../../../model/service/idp/IDPManager'\nimport { createErrorResponse } from '../../errorUtils'\nimport { TenantResolverContext } from '../../TenantResolverContext'\n\nexport class DisableIDPMutationResolver implements MutationResolvers {\n\tconstructor(private readonly idpManager: IDPManager) {\n\t}\n\n\tasync disableIDP(parent: any, args: MutationDisableIdpArgs, context: TenantResolverContext): Promise<DisableIdpResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.IDP_DISABLE,\n\t\t\tmessage: 'You are not allowed to disable IDP',\n\t\t})\n\t\tconst result = await this.idpManager.disableIDP(context.db, args.identityProvider)\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true }\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAMO,MAAM,2BAAwD;AAAA,EACpE,YAA6B,YAAwB;AAAxB,SAAA,aAAA;AAAA,EAC7B;AAAA,EAEA,MAAM,WAAW,QAAa,MAA8B,SAA6D;AACxH,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQ,kBAAkB;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACK,UAAA,SAAS,MAAM,KAAK,WAAW,WAAW,QAAQ,IAAI,KAAK,gBAAgB;AAC7E,QAAA,CAAC,OAAO,IAAI;AACf,aAAO,oBAAoB,OAAO,OAAO,OAAO,YAAY;AAAA,IAC7D;AAEO,WAAA,EAAE,IAAI;EACd;AACD;"}
1
+ {"version":3,"file":"DisableIDPMutationResolver.js","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/idp/DisableIDPMutationResolver.ts"],"sourcesContent":["import { DisableIdpResponse, MutationDisableIdpArgs, MutationResolvers } from '../../../schema'\nimport { PermissionActions } from '../../../model'\nimport { IDPManager } from '../../../model/service/idp/IDPManager'\nimport { createErrorResponse } from '../../errorUtils'\nimport { TenantResolverContext } from '../../TenantResolverContext'\n\nexport class DisableIDPMutationResolver implements MutationResolvers {\n\tconstructor(private readonly idpManager: IDPManager) {\n\t}\n\n\tasync disableIDP(parent: any, args: MutationDisableIdpArgs, context: TenantResolverContext): Promise<DisableIdpResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.IDP_DISABLE,\n\t\t\tmessage: 'You are not allowed to disable IDP',\n\t\t})\n\t\tconst result = await this.idpManager.disableIDP(context.db, args.identityProvider)\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true }\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAMO,MAAM,2BAAwD;AAAA,EACpE,YAA6B,YAAwB;AAAxB,SAAA,aAAA;AAAA,EAAA;AAAA,EAG7B,MAAM,WAAW,QAAa,MAA8B,SAA6D;AACxH,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQ,kBAAkB;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACK,UAAA,SAAS,MAAM,KAAK,WAAW,WAAW,QAAQ,IAAI,KAAK,gBAAgB;AAC7E,QAAA,CAAC,OAAO,IAAI;AACf,aAAO,oBAAoB,OAAO,OAAO,OAAO,YAAY;AAAA,IAAA;AAGtD,WAAA,EAAE,IAAI,KAAK;AAAA,EAAA;AAEpB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EnableIDPMutationResolver.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/idp/EnableIDPMutationResolver.ts"],"sourcesContent":["import { EnableIdpResponse, MutationEnableIdpArgs, MutationResolvers } from '../../../schema'\nimport { GraphQLResolveInfo } from 'graphql'\nimport { PermissionActions } from '../../../model'\nimport { IDPManager } from '../../../model/service/idp/IDPManager'\nimport { createErrorResponse } from '../../errorUtils'\nimport { TenantResolverContext } from '../../TenantResolverContext'\n\nexport class EnableIDPMutationResolver implements MutationResolvers {\n\tconstructor(private readonly idpManager: IDPManager) {\n\t}\n\n\tasync enableIDP(parent: any, args: MutationEnableIdpArgs, context: TenantResolverContext): Promise<EnableIdpResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.IDP_ENABLE,\n\t\t\tmessage: 'You are not allowed to enable IDP',\n\t\t})\n\t\tconst result = await this.idpManager.enableIDP(context.db, args.identityProvider)\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true }\n\t}\n}\n"],"names":["PermissionActions","createErrorResponse"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAOO,MAAM,0BAAuD;AAAA,EACnE,YAA6B,YAAwB;AAAxB,SAAA,aAAA;AAAA,EAC7B;AAAA,EAEA,MAAM,UAAU,QAAa,MAA6B,SAA4D;AACrH,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQA,kBAAkB,kBAAA;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACK,UAAA,SAAS,MAAM,KAAK,WAAW,UAAU,QAAQ,IAAI,KAAK,gBAAgB;AAC5E,QAAA,CAAC,OAAO,IAAI;AACf,aAAOC,WAAoB,oBAAA,OAAO,OAAO,OAAO,YAAY;AAAA,IAC7D;AAEO,WAAA,EAAE,IAAI;EACd;AACD;;"}
1
+ {"version":3,"file":"EnableIDPMutationResolver.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/idp/EnableIDPMutationResolver.ts"],"sourcesContent":["import { EnableIdpResponse, MutationEnableIdpArgs, MutationResolvers } from '../../../schema'\nimport { GraphQLResolveInfo } from 'graphql'\nimport { PermissionActions } from '../../../model'\nimport { IDPManager } from '../../../model/service/idp/IDPManager'\nimport { createErrorResponse } from '../../errorUtils'\nimport { TenantResolverContext } from '../../TenantResolverContext'\n\nexport class EnableIDPMutationResolver implements MutationResolvers {\n\tconstructor(private readonly idpManager: IDPManager) {\n\t}\n\n\tasync enableIDP(parent: any, args: MutationEnableIdpArgs, context: TenantResolverContext): Promise<EnableIdpResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.IDP_ENABLE,\n\t\t\tmessage: 'You are not allowed to enable IDP',\n\t\t})\n\t\tconst result = await this.idpManager.enableIDP(context.db, args.identityProvider)\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true }\n\t}\n}\n"],"names":["PermissionActions","createErrorResponse"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAOO,MAAM,0BAAuD;AAAA,EACnE,YAA6B,YAAwB;AAAxB,SAAA,aAAA;AAAA,EAAA;AAAA,EAG7B,MAAM,UAAU,QAAa,MAA6B,SAA4D;AACrH,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQA,kBAAkB,kBAAA;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACK,UAAA,SAAS,MAAM,KAAK,WAAW,UAAU,QAAQ,IAAI,KAAK,gBAAgB;AAC5E,QAAA,CAAC,OAAO,IAAI;AACf,aAAOC,WAAoB,oBAAA,OAAO,OAAO,OAAO,YAAY;AAAA,IAAA;AAGtD,WAAA,EAAE,IAAI,KAAK;AAAA,EAAA;AAEpB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EnableIDPMutationResolver.js","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/idp/EnableIDPMutationResolver.ts"],"sourcesContent":["import { EnableIdpResponse, MutationEnableIdpArgs, MutationResolvers } from '../../../schema'\nimport { GraphQLResolveInfo } from 'graphql'\nimport { PermissionActions } from '../../../model'\nimport { IDPManager } from '../../../model/service/idp/IDPManager'\nimport { createErrorResponse } from '../../errorUtils'\nimport { TenantResolverContext } from '../../TenantResolverContext'\n\nexport class EnableIDPMutationResolver implements MutationResolvers {\n\tconstructor(private readonly idpManager: IDPManager) {\n\t}\n\n\tasync enableIDP(parent: any, args: MutationEnableIdpArgs, context: TenantResolverContext): Promise<EnableIdpResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.IDP_ENABLE,\n\t\t\tmessage: 'You are not allowed to enable IDP',\n\t\t})\n\t\tconst result = await this.idpManager.enableIDP(context.db, args.identityProvider)\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true }\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAOO,MAAM,0BAAuD;AAAA,EACnE,YAA6B,YAAwB;AAAxB,SAAA,aAAA;AAAA,EAC7B;AAAA,EAEA,MAAM,UAAU,QAAa,MAA6B,SAA4D;AACrH,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQ,kBAAkB;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACK,UAAA,SAAS,MAAM,KAAK,WAAW,UAAU,QAAQ,IAAI,KAAK,gBAAgB;AAC5E,QAAA,CAAC,OAAO,IAAI;AACf,aAAO,oBAAoB,OAAO,OAAO,OAAO,YAAY;AAAA,IAC7D;AAEO,WAAA,EAAE,IAAI;EACd;AACD;"}
1
+ {"version":3,"file":"EnableIDPMutationResolver.js","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/idp/EnableIDPMutationResolver.ts"],"sourcesContent":["import { EnableIdpResponse, MutationEnableIdpArgs, MutationResolvers } from '../../../schema'\nimport { GraphQLResolveInfo } from 'graphql'\nimport { PermissionActions } from '../../../model'\nimport { IDPManager } from '../../../model/service/idp/IDPManager'\nimport { createErrorResponse } from '../../errorUtils'\nimport { TenantResolverContext } from '../../TenantResolverContext'\n\nexport class EnableIDPMutationResolver implements MutationResolvers {\n\tconstructor(private readonly idpManager: IDPManager) {\n\t}\n\n\tasync enableIDP(parent: any, args: MutationEnableIdpArgs, context: TenantResolverContext): Promise<EnableIdpResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.IDP_ENABLE,\n\t\t\tmessage: 'You are not allowed to enable IDP',\n\t\t})\n\t\tconst result = await this.idpManager.enableIDP(context.db, args.identityProvider)\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true }\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAOO,MAAM,0BAAuD;AAAA,EACnE,YAA6B,YAAwB;AAAxB,SAAA,aAAA;AAAA,EAAA;AAAA,EAG7B,MAAM,UAAU,QAAa,MAA6B,SAA4D;AACrH,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQ,kBAAkB;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACK,UAAA,SAAS,MAAM,KAAK,WAAW,UAAU,QAAQ,IAAI,KAAK,gBAAgB;AAC5E,QAAA,CAAC,OAAO,IAAI;AACf,aAAO,oBAAoB,OAAO,OAAO,OAAO,YAAY;AAAA,IAAA;AAGtD,WAAA,EAAE,IAAI,KAAK;AAAA,EAAA;AAEpB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateIDPMutationResolver.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/idp/UpdateIDPMutationResolver.ts"],"sourcesContent":["import { MutationResolvers, MutationUpdateIdpArgs, UpdateIdpResponse } from '../../../schema'\nimport { PermissionActions } from '../../../model'\nimport { IDPManager } from '../../../model/service/idp/IDPManager'\nimport { createErrorResponse } from '../../errorUtils'\nimport { TenantResolverContext } from '../../TenantResolverContext'\n\nexport class UpdateIDPMutationResolver implements MutationResolvers {\n\tconstructor(private readonly idpManager: IDPManager) {\n\t}\n\n\tasync updateIDP(parent: any, args: MutationUpdateIdpArgs, context: TenantResolverContext): Promise<UpdateIdpResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.IDP_UPDATE,\n\t\t\tmessage: 'You are not allowed to update IDP',\n\t\t})\n\t\tconst result = await this.idpManager.updateIDP(context.db, args.identityProvider, {\n\t\t\tconfiguration: args.configuration,\n\t\t\ttype: args.type ?? undefined,\n\t\t\toptions: {\n\t\t\t\tautoSignUp: args.options?.autoSignUp ?? undefined,\n\t\t\t\texclusive: args.options?.exclusive ?? undefined,\n\t\t\t\tinitReturnsConfig: args.options?.initReturnsConfig ?? undefined,\n\t\t\t},\n\t\t}, args.mergeConfiguration ?? false)\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true }\n\t}\n}\n"],"names":["PermissionActions","createErrorResponse"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAMO,MAAM,0BAAuD;AAAA,EACnE,YAA6B,YAAwB;AAAxB,SAAA,aAAA;AAAA,EAC7B;AAAA,EAEA,MAAM,UAAU,QAAa,MAA6B,SAA4D;AACrH,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQA,kBAAkB,kBAAA;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACK,UAAA,SAAS,MAAM,KAAK,WAAW,UAAU,QAAQ,IAAI,KAAK,kBAAkB;AAAA,MACjF,eAAe,KAAK;AAAA,MACpB,MAAM,KAAK,QAAQ;AAAA,MACnB,SAAS;AAAA,QACR,YAAY,KAAK,SAAS,cAAc;AAAA,QACxC,WAAW,KAAK,SAAS,aAAa;AAAA,QACtC,mBAAmB,KAAK,SAAS,qBAAqB;AAAA,MACvD;AAAA,IAAA,GACE,KAAK,sBAAsB,KAAK;AAC/B,QAAA,CAAC,OAAO,IAAI;AACf,aAAOC,WAAoB,oBAAA,OAAO,OAAO,OAAO,YAAY;AAAA,IAC7D;AAEO,WAAA,EAAE,IAAI;EACd;AACD;;"}
1
+ {"version":3,"file":"UpdateIDPMutationResolver.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/idp/UpdateIDPMutationResolver.ts"],"sourcesContent":["import { MutationResolvers, MutationUpdateIdpArgs, UpdateIdpResponse } from '../../../schema'\nimport { PermissionActions } from '../../../model'\nimport { IDPManager } from '../../../model/service/idp/IDPManager'\nimport { createErrorResponse } from '../../errorUtils'\nimport { TenantResolverContext } from '../../TenantResolverContext'\n\nexport class UpdateIDPMutationResolver implements MutationResolvers {\n\tconstructor(private readonly idpManager: IDPManager) {\n\t}\n\n\tasync updateIDP(parent: any, args: MutationUpdateIdpArgs, context: TenantResolverContext): Promise<UpdateIdpResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.IDP_UPDATE,\n\t\t\tmessage: 'You are not allowed to update IDP',\n\t\t})\n\t\tconst result = await this.idpManager.updateIDP(context.db, args.identityProvider, {\n\t\t\tconfiguration: args.configuration,\n\t\t\ttype: args.type ?? undefined,\n\t\t\toptions: {\n\t\t\t\tautoSignUp: args.options?.autoSignUp ?? undefined,\n\t\t\t\texclusive: args.options?.exclusive ?? undefined,\n\t\t\t\tinitReturnsConfig: args.options?.initReturnsConfig ?? undefined,\n\t\t\t},\n\t\t}, args.mergeConfiguration ?? false)\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true }\n\t}\n}\n"],"names":["PermissionActions","createErrorResponse"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAMO,MAAM,0BAAuD;AAAA,EACnE,YAA6B,YAAwB;AAAxB,SAAA,aAAA;AAAA,EAAA;AAAA,EAG7B,MAAM,UAAU,QAAa,MAA6B,SAA4D;AACrH,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQA,kBAAkB,kBAAA;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACK,UAAA,SAAS,MAAM,KAAK,WAAW,UAAU,QAAQ,IAAI,KAAK,kBAAkB;AAAA,MACjF,eAAe,KAAK;AAAA,MACpB,MAAM,KAAK,QAAQ;AAAA,MACnB,SAAS;AAAA,QACR,YAAY,KAAK,SAAS,cAAc;AAAA,QACxC,WAAW,KAAK,SAAS,aAAa;AAAA,QACtC,mBAAmB,KAAK,SAAS,qBAAqB;AAAA,MAAA;AAAA,IACvD,GACE,KAAK,sBAAsB,KAAK;AAC/B,QAAA,CAAC,OAAO,IAAI;AACf,aAAOC,WAAoB,oBAAA,OAAO,OAAO,OAAO,YAAY;AAAA,IAAA;AAGtD,WAAA,EAAE,IAAI,KAAK;AAAA,EAAA;AAEpB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateIDPMutationResolver.js","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/idp/UpdateIDPMutationResolver.ts"],"sourcesContent":["import { MutationResolvers, MutationUpdateIdpArgs, UpdateIdpResponse } from '../../../schema'\nimport { PermissionActions } from '../../../model'\nimport { IDPManager } from '../../../model/service/idp/IDPManager'\nimport { createErrorResponse } from '../../errorUtils'\nimport { TenantResolverContext } from '../../TenantResolverContext'\n\nexport class UpdateIDPMutationResolver implements MutationResolvers {\n\tconstructor(private readonly idpManager: IDPManager) {\n\t}\n\n\tasync updateIDP(parent: any, args: MutationUpdateIdpArgs, context: TenantResolverContext): Promise<UpdateIdpResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.IDP_UPDATE,\n\t\t\tmessage: 'You are not allowed to update IDP',\n\t\t})\n\t\tconst result = await this.idpManager.updateIDP(context.db, args.identityProvider, {\n\t\t\tconfiguration: args.configuration,\n\t\t\ttype: args.type ?? undefined,\n\t\t\toptions: {\n\t\t\t\tautoSignUp: args.options?.autoSignUp ?? undefined,\n\t\t\t\texclusive: args.options?.exclusive ?? undefined,\n\t\t\t\tinitReturnsConfig: args.options?.initReturnsConfig ?? undefined,\n\t\t\t},\n\t\t}, args.mergeConfiguration ?? false)\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true }\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAMO,MAAM,0BAAuD;AAAA,EACnE,YAA6B,YAAwB;AAAxB,SAAA,aAAA;AAAA,EAC7B;AAAA,EAEA,MAAM,UAAU,QAAa,MAA6B,SAA4D;AACrH,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQ,kBAAkB;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACK,UAAA,SAAS,MAAM,KAAK,WAAW,UAAU,QAAQ,IAAI,KAAK,kBAAkB;AAAA,MACjF,eAAe,KAAK;AAAA,MACpB,MAAM,KAAK,QAAQ;AAAA,MACnB,SAAS;AAAA,QACR,YAAY,KAAK,SAAS,cAAc;AAAA,QACxC,WAAW,KAAK,SAAS,aAAa;AAAA,QACtC,mBAAmB,KAAK,SAAS,qBAAqB;AAAA,MACvD;AAAA,IAAA,GACE,KAAK,sBAAsB,KAAK;AAC/B,QAAA,CAAC,OAAO,IAAI;AACf,aAAO,oBAAoB,OAAO,OAAO,OAAO,YAAY;AAAA,IAC7D;AAEO,WAAA,EAAE,IAAI;EACd;AACD;"}
1
+ {"version":3,"file":"UpdateIDPMutationResolver.js","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/idp/UpdateIDPMutationResolver.ts"],"sourcesContent":["import { MutationResolvers, MutationUpdateIdpArgs, UpdateIdpResponse } from '../../../schema'\nimport { PermissionActions } from '../../../model'\nimport { IDPManager } from '../../../model/service/idp/IDPManager'\nimport { createErrorResponse } from '../../errorUtils'\nimport { TenantResolverContext } from '../../TenantResolverContext'\n\nexport class UpdateIDPMutationResolver implements MutationResolvers {\n\tconstructor(private readonly idpManager: IDPManager) {\n\t}\n\n\tasync updateIDP(parent: any, args: MutationUpdateIdpArgs, context: TenantResolverContext): Promise<UpdateIdpResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.IDP_UPDATE,\n\t\t\tmessage: 'You are not allowed to update IDP',\n\t\t})\n\t\tconst result = await this.idpManager.updateIDP(context.db, args.identityProvider, {\n\t\t\tconfiguration: args.configuration,\n\t\t\ttype: args.type ?? undefined,\n\t\t\toptions: {\n\t\t\t\tautoSignUp: args.options?.autoSignUp ?? undefined,\n\t\t\t\texclusive: args.options?.exclusive ?? undefined,\n\t\t\t\tinitReturnsConfig: args.options?.initReturnsConfig ?? undefined,\n\t\t\t},\n\t\t}, args.mergeConfiguration ?? false)\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true }\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAMO,MAAM,0BAAuD;AAAA,EACnE,YAA6B,YAAwB;AAAxB,SAAA,aAAA;AAAA,EAAA;AAAA,EAG7B,MAAM,UAAU,QAAa,MAA6B,SAA4D;AACrH,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQ,kBAAkB;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACK,UAAA,SAAS,MAAM,KAAK,WAAW,UAAU,QAAQ,IAAI,KAAK,kBAAkB;AAAA,MACjF,eAAe,KAAK;AAAA,MACpB,MAAM,KAAK,QAAQ;AAAA,MACnB,SAAS;AAAA,QACR,YAAY,KAAK,SAAS,cAAc;AAAA,QACxC,WAAW,KAAK,SAAS,aAAa;AAAA,QACtC,mBAAmB,KAAK,SAAS,qBAAqB;AAAA,MAAA;AAAA,IACvD,GACE,KAAK,sBAAsB,KAAK;AAC/B,QAAA,CAAC,OAAO,IAAI;AACf,aAAO,oBAAoB,OAAO,OAAO,OAAO,YAAY;AAAA,IAAA;AAGtD,WAAA,EAAE,IAAI,KAAK;AAAA,EAAA;AAEpB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"MailTemplateMutationResolver.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.ts"],"sourcesContent":["import {\n\tAddMailTemplateResponse,\n\tMutationAddProjectMailTemplateArgs,\n\tMutationRemoveProjectMailTemplateArgs,\n\tMutationResolvers,\n\tRemoveMailTemplateResponse,\n} from '../../../schema'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { MailTemplateManager, mailTypeFromSchemaToDb, PermissionActions, ProjectManager } from '../../../model'\nimport { createErrorResponse, createProjectNotFoundResponse } from '../../errorUtils'\nimport { validateEmail } from '../../../model/utils/email'\n\nexport class MailTemplateMutationResolver implements MutationResolvers {\n\tconstructor(\n\t\tprivate readonly projectManager: ProjectManager,\n\t\tprivate readonly mailTemplateManager: MailTemplateManager,\n\t) {}\n\n\tasync addMailTemplate(\n\t\tparent: any,\n\t\t{ template: { content, projectSlug, subject, type, useLayout, variant, replyTo } }: MutationAddProjectMailTemplateArgs,\n\t\tcontext: TenantResolverContext,\n\t): Promise<AddMailTemplateResponse> {\n\t\tconst project = projectSlug ? await this.projectManager.getProjectBySlug(context.db, projectSlug) : null\n\t\tawait context.requireAccess({\n\t\t\tscope: project ? await context.permissionContext.createProjectScope(project) : undefined,\n\t\t\taction: PermissionActions.MAIL_TEMPLATE_ADD,\n\t\t\tmessage: 'You are not allowed to add a mail template',\n\t\t})\n\t\tif (projectSlug && !project) {\n\t\t\treturn createProjectNotFoundResponse('PROJECT_NOT_FOUND', projectSlug)\n\t\t}\n\t\tif (replyTo && !validateEmail(replyTo)) {\n\t\t\treturn createErrorResponse('INVALID_REPLY_EMAIL_FORMAT', 'Reply-to email address is not in a valid format')\n\t\t}\n\n\t\tawait this.mailTemplateManager.addMailTemplate(context.db, {\n\t\t\tcontent,\n\t\t\tprojectId: project?.id ?? null,\n\t\t\tsubject,\n\t\t\tuseLayout: typeof useLayout === 'boolean' ? useLayout : true,\n\t\t\tvariant: variant || '',\n\t\t\ttype: mailTypeFromSchemaToDb(type),\n\t\t\treplyTo: replyTo?.trim() || null,\n\t\t})\n\n\t\treturn {\n\t\t\tok: true,\n\t\t\terrors: [],\n\t\t}\n\t}\n\n\tasync removeMailTemplate(\n\t\tparent: any,\n\t\t{ templateIdentifier: { projectSlug, type, variant } }: MutationRemoveProjectMailTemplateArgs,\n\t\tcontext: TenantResolverContext,\n\t): Promise<RemoveMailTemplateResponse> {\n\t\tconst project = projectSlug ? await this.projectManager.getProjectBySlug(context.db, projectSlug) : null\n\t\tawait context.requireAccess({\n\t\t\tscope: project ? await context.permissionContext.createProjectScope(project) : undefined,\n\t\t\taction: PermissionActions.MAIL_TEMPLATE_REMOVE,\n\t\t\tmessage: 'You are not allowed to remove a mail template',\n\t\t})\n\t\tif (projectSlug && !project) {\n\t\t\treturn createProjectNotFoundResponse('PROJECT_NOT_FOUND', projectSlug)\n\t\t}\n\n\t\tconst removed = await this.mailTemplateManager.removeMailTemplate(context.db, {\n\t\t\tprojectId: project?.id ?? null,\n\t\t\tvariant: variant || '',\n\t\t\ttype: mailTypeFromSchemaToDb(type),\n\t\t})\n\t\tif (!removed) {\n\t\t\treturn createErrorResponse('PROJECT_NOT_FOUND', 'Mail template not found')\n\t\t}\n\n\t\treturn {\n\t\t\tok: true,\n\t\t\terrors: [],\n\t\t}\n\t}\n}\n"],"names":["type","PermissionActions","createProjectNotFoundResponse","validateEmail","createErrorResponse","mailTypeFromSchemaToDb"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAYO,MAAM,6BAA0D;AAAA,EACtE,YACkB,gBACA,qBAChB;AAFgB,SAAA,iBAAA;AACA,SAAA,sBAAA;AAAA,EACf;AAAA,EAEH,MAAM,gBACL,QACA,EAAE,UAAU,EAAE,SAAS,aAAa,SAASA,MAAAA,QAAM,WAAW,SAAS,QAAQ,EAAA,GAC/E,SACmC;AAC7B,UAAA,UAAU,cAAc,MAAM,KAAK,eAAe,iBAAiB,QAAQ,IAAI,WAAW,IAAI;AACpG,UAAM,QAAQ,cAAc;AAAA,MAC3B,OAAO,UAAU,MAAM,QAAQ,kBAAkB,mBAAmB,OAAO,IAAI;AAAA,MAC/E,QAAQC,kBAAkB,kBAAA;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACG,QAAA,eAAe,CAAC,SAAS;AACrB,aAAAC,WAAA,8BAA8B,qBAAqB,WAAW;AAAA,IACtE;AACA,QAAI,WAAW,CAACC,oBAAc,OAAO,GAAG;AAChC,aAAAC,WAAA,oBAAoB,8BAA8B,iDAAiD;AAAA,IAC3G;AAEA,UAAM,KAAK,oBAAoB,gBAAgB,QAAQ,IAAI;AAAA,MAC1D;AAAA,MACA,WAAW,SAAS,MAAM;AAAA,MAC1B;AAAA,MACA,WAAW,OAAO,cAAc,YAAY,YAAY;AAAA,MACxD,SAAS,WAAW;AAAA,MACpB,MAAMC,4BAAuBL,MAAI;AAAA,MACjC,SAAS,SAAS,KAAA,KAAU;AAAA,IAAA,CAC5B;AAEM,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ,CAAC;AAAA,IAAA;AAAA,EAEX;AAAA,EAEA,MAAM,mBACL,QACA,EAAE,oBAAoB,EAAE,aAAA,MAAaA,QAAM,UAAU,GACrD,SACsC;AAChC,UAAA,UAAU,cAAc,MAAM,KAAK,eAAe,iBAAiB,QAAQ,IAAI,WAAW,IAAI;AACpG,UAAM,QAAQ,cAAc;AAAA,MAC3B,OAAO,UAAU,MAAM,QAAQ,kBAAkB,mBAAmB,OAAO,IAAI;AAAA,MAC/E,QAAQC,kBAAkB,kBAAA;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACG,QAAA,eAAe,CAAC,SAAS;AACrB,aAAAC,WAAA,8BAA8B,qBAAqB,WAAW;AAAA,IACtE;AAEA,UAAM,UAAU,MAAM,KAAK,oBAAoB,mBAAmB,QAAQ,IAAI;AAAA,MAC7E,WAAW,SAAS,MAAM;AAAA,MAC1B,SAAS,WAAW;AAAA,MACpB,MAAMG,4BAAuBL,MAAI;AAAA,IAAA,CACjC;AACD,QAAI,CAAC,SAAS;AACN,aAAAI,WAAA,oBAAoB,qBAAqB,yBAAyB;AAAA,IAC1E;AAEO,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ,CAAC;AAAA,IAAA;AAAA,EAEX;AACD;;"}
1
+ {"version":3,"file":"MailTemplateMutationResolver.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.ts"],"sourcesContent":["import {\n\tAddMailTemplateResponse,\n\tMutationAddProjectMailTemplateArgs,\n\tMutationRemoveProjectMailTemplateArgs,\n\tMutationResolvers,\n\tRemoveMailTemplateResponse,\n} from '../../../schema'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { MailTemplateManager, mailTypeFromSchemaToDb, PermissionActions, ProjectManager } from '../../../model'\nimport { createErrorResponse, createProjectNotFoundResponse } from '../../errorUtils'\nimport { validateEmail } from '../../../model/utils/email'\n\nexport class MailTemplateMutationResolver implements MutationResolvers {\n\tconstructor(\n\t\tprivate readonly projectManager: ProjectManager,\n\t\tprivate readonly mailTemplateManager: MailTemplateManager,\n\t) {}\n\n\tasync addMailTemplate(\n\t\tparent: any,\n\t\t{ template: { content, projectSlug, subject, type, useLayout, variant, replyTo } }: MutationAddProjectMailTemplateArgs,\n\t\tcontext: TenantResolverContext,\n\t): Promise<AddMailTemplateResponse> {\n\t\tconst project = projectSlug ? await this.projectManager.getProjectBySlug(context.db, projectSlug) : null\n\t\tawait context.requireAccess({\n\t\t\tscope: project ? await context.permissionContext.createProjectScope(project) : undefined,\n\t\t\taction: PermissionActions.MAIL_TEMPLATE_ADD,\n\t\t\tmessage: 'You are not allowed to add a mail template',\n\t\t})\n\t\tif (projectSlug && !project) {\n\t\t\treturn createProjectNotFoundResponse('PROJECT_NOT_FOUND', projectSlug)\n\t\t}\n\t\tif (replyTo && !validateEmail(replyTo)) {\n\t\t\treturn createErrorResponse('INVALID_REPLY_EMAIL_FORMAT', 'Reply-to email address is not in a valid format')\n\t\t}\n\n\t\tawait this.mailTemplateManager.addMailTemplate(context.db, {\n\t\t\tcontent,\n\t\t\tprojectId: project?.id ?? null,\n\t\t\tsubject,\n\t\t\tuseLayout: typeof useLayout === 'boolean' ? useLayout : true,\n\t\t\tvariant: variant || '',\n\t\t\ttype: mailTypeFromSchemaToDb(type),\n\t\t\treplyTo: replyTo?.trim() || null,\n\t\t})\n\n\t\treturn {\n\t\t\tok: true,\n\t\t\terrors: [],\n\t\t}\n\t}\n\n\tasync removeMailTemplate(\n\t\tparent: any,\n\t\t{ templateIdentifier: { projectSlug, type, variant } }: MutationRemoveProjectMailTemplateArgs,\n\t\tcontext: TenantResolverContext,\n\t): Promise<RemoveMailTemplateResponse> {\n\t\tconst project = projectSlug ? await this.projectManager.getProjectBySlug(context.db, projectSlug) : null\n\t\tawait context.requireAccess({\n\t\t\tscope: project ? await context.permissionContext.createProjectScope(project) : undefined,\n\t\t\taction: PermissionActions.MAIL_TEMPLATE_REMOVE,\n\t\t\tmessage: 'You are not allowed to remove a mail template',\n\t\t})\n\t\tif (projectSlug && !project) {\n\t\t\treturn createProjectNotFoundResponse('PROJECT_NOT_FOUND', projectSlug)\n\t\t}\n\n\t\tconst removed = await this.mailTemplateManager.removeMailTemplate(context.db, {\n\t\t\tprojectId: project?.id ?? null,\n\t\t\tvariant: variant || '',\n\t\t\ttype: mailTypeFromSchemaToDb(type),\n\t\t})\n\t\tif (!removed) {\n\t\t\treturn createErrorResponse('PROJECT_NOT_FOUND', 'Mail template not found')\n\t\t}\n\n\t\treturn {\n\t\t\tok: true,\n\t\t\terrors: [],\n\t\t}\n\t}\n}\n"],"names":["type","PermissionActions","createProjectNotFoundResponse","validateEmail","createErrorResponse","mailTypeFromSchemaToDb"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAYO,MAAM,6BAA0D;AAAA,EACtE,YACkB,gBACA,qBAChB;AAFgB,SAAA,iBAAA;AACA,SAAA,sBAAA;AAAA,EAAA;AAAA,EAGlB,MAAM,gBACL,QACA,EAAE,UAAU,EAAE,SAAS,aAAa,SAASA,MAAAA,QAAM,WAAW,SAAS,QAAQ,EAAA,GAC/E,SACmC;AAC7B,UAAA,UAAU,cAAc,MAAM,KAAK,eAAe,iBAAiB,QAAQ,IAAI,WAAW,IAAI;AACpG,UAAM,QAAQ,cAAc;AAAA,MAC3B,OAAO,UAAU,MAAM,QAAQ,kBAAkB,mBAAmB,OAAO,IAAI;AAAA,MAC/E,QAAQC,kBAAkB,kBAAA;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACG,QAAA,eAAe,CAAC,SAAS;AACrB,aAAAC,WAAA,8BAA8B,qBAAqB,WAAW;AAAA,IAAA;AAEtE,QAAI,WAAW,CAACC,oBAAc,OAAO,GAAG;AAChC,aAAAC,WAAA,oBAAoB,8BAA8B,iDAAiD;AAAA,IAAA;AAG3G,UAAM,KAAK,oBAAoB,gBAAgB,QAAQ,IAAI;AAAA,MAC1D;AAAA,MACA,WAAW,SAAS,MAAM;AAAA,MAC1B;AAAA,MACA,WAAW,OAAO,cAAc,YAAY,YAAY;AAAA,MACxD,SAAS,WAAW;AAAA,MACpB,MAAMC,4BAAuBL,MAAI;AAAA,MACjC,SAAS,SAAS,UAAU;AAAA,IAAA,CAC5B;AAEM,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ,CAAA;AAAA,IACT;AAAA,EAAA;AAAA,EAGD,MAAM,mBACL,QACA,EAAE,oBAAoB,EAAE,aAAA,MAAaA,QAAM,UAAU,GACrD,SACsC;AAChC,UAAA,UAAU,cAAc,MAAM,KAAK,eAAe,iBAAiB,QAAQ,IAAI,WAAW,IAAI;AACpG,UAAM,QAAQ,cAAc;AAAA,MAC3B,OAAO,UAAU,MAAM,QAAQ,kBAAkB,mBAAmB,OAAO,IAAI;AAAA,MAC/E,QAAQC,kBAAkB,kBAAA;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACG,QAAA,eAAe,CAAC,SAAS;AACrB,aAAAC,WAAA,8BAA8B,qBAAqB,WAAW;AAAA,IAAA;AAGtE,UAAM,UAAU,MAAM,KAAK,oBAAoB,mBAAmB,QAAQ,IAAI;AAAA,MAC7E,WAAW,SAAS,MAAM;AAAA,MAC1B,SAAS,WAAW;AAAA,MACpB,MAAMG,4BAAuBL,MAAI;AAAA,IAAA,CACjC;AACD,QAAI,CAAC,SAAS;AACN,aAAAI,WAAA,oBAAoB,qBAAqB,yBAAyB;AAAA,IAAA;AAGnE,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ,CAAA;AAAA,IACT;AAAA,EAAA;AAEF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"MailTemplateMutationResolver.js","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.ts"],"sourcesContent":["import {\n\tAddMailTemplateResponse,\n\tMutationAddProjectMailTemplateArgs,\n\tMutationRemoveProjectMailTemplateArgs,\n\tMutationResolvers,\n\tRemoveMailTemplateResponse,\n} from '../../../schema'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { MailTemplateManager, mailTypeFromSchemaToDb, PermissionActions, ProjectManager } from '../../../model'\nimport { createErrorResponse, createProjectNotFoundResponse } from '../../errorUtils'\nimport { validateEmail } from '../../../model/utils/email'\n\nexport class MailTemplateMutationResolver implements MutationResolvers {\n\tconstructor(\n\t\tprivate readonly projectManager: ProjectManager,\n\t\tprivate readonly mailTemplateManager: MailTemplateManager,\n\t) {}\n\n\tasync addMailTemplate(\n\t\tparent: any,\n\t\t{ template: { content, projectSlug, subject, type, useLayout, variant, replyTo } }: MutationAddProjectMailTemplateArgs,\n\t\tcontext: TenantResolverContext,\n\t): Promise<AddMailTemplateResponse> {\n\t\tconst project = projectSlug ? await this.projectManager.getProjectBySlug(context.db, projectSlug) : null\n\t\tawait context.requireAccess({\n\t\t\tscope: project ? await context.permissionContext.createProjectScope(project) : undefined,\n\t\t\taction: PermissionActions.MAIL_TEMPLATE_ADD,\n\t\t\tmessage: 'You are not allowed to add a mail template',\n\t\t})\n\t\tif (projectSlug && !project) {\n\t\t\treturn createProjectNotFoundResponse('PROJECT_NOT_FOUND', projectSlug)\n\t\t}\n\t\tif (replyTo && !validateEmail(replyTo)) {\n\t\t\treturn createErrorResponse('INVALID_REPLY_EMAIL_FORMAT', 'Reply-to email address is not in a valid format')\n\t\t}\n\n\t\tawait this.mailTemplateManager.addMailTemplate(context.db, {\n\t\t\tcontent,\n\t\t\tprojectId: project?.id ?? null,\n\t\t\tsubject,\n\t\t\tuseLayout: typeof useLayout === 'boolean' ? useLayout : true,\n\t\t\tvariant: variant || '',\n\t\t\ttype: mailTypeFromSchemaToDb(type),\n\t\t\treplyTo: replyTo?.trim() || null,\n\t\t})\n\n\t\treturn {\n\t\t\tok: true,\n\t\t\terrors: [],\n\t\t}\n\t}\n\n\tasync removeMailTemplate(\n\t\tparent: any,\n\t\t{ templateIdentifier: { projectSlug, type, variant } }: MutationRemoveProjectMailTemplateArgs,\n\t\tcontext: TenantResolverContext,\n\t): Promise<RemoveMailTemplateResponse> {\n\t\tconst project = projectSlug ? await this.projectManager.getProjectBySlug(context.db, projectSlug) : null\n\t\tawait context.requireAccess({\n\t\t\tscope: project ? await context.permissionContext.createProjectScope(project) : undefined,\n\t\t\taction: PermissionActions.MAIL_TEMPLATE_REMOVE,\n\t\t\tmessage: 'You are not allowed to remove a mail template',\n\t\t})\n\t\tif (projectSlug && !project) {\n\t\t\treturn createProjectNotFoundResponse('PROJECT_NOT_FOUND', projectSlug)\n\t\t}\n\n\t\tconst removed = await this.mailTemplateManager.removeMailTemplate(context.db, {\n\t\t\tprojectId: project?.id ?? null,\n\t\t\tvariant: variant || '',\n\t\t\ttype: mailTypeFromSchemaToDb(type),\n\t\t})\n\t\tif (!removed) {\n\t\t\treturn createErrorResponse('PROJECT_NOT_FOUND', 'Mail template not found')\n\t\t}\n\n\t\treturn {\n\t\t\tok: true,\n\t\t\terrors: [],\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAYO,MAAM,6BAA0D;AAAA,EACtE,YACkB,gBACA,qBAChB;AAFgB,SAAA,iBAAA;AACA,SAAA,sBAAA;AAAA,EACf;AAAA,EAEH,MAAM,gBACL,QACA,EAAE,UAAU,EAAE,SAAS,aAAa,SAAS,MAAM,WAAW,SAAS,QAAQ,EAAA,GAC/E,SACmC;AAC7B,UAAA,UAAU,cAAc,MAAM,KAAK,eAAe,iBAAiB,QAAQ,IAAI,WAAW,IAAI;AACpG,UAAM,QAAQ,cAAc;AAAA,MAC3B,OAAO,UAAU,MAAM,QAAQ,kBAAkB,mBAAmB,OAAO,IAAI;AAAA,MAC/E,QAAQ,kBAAkB;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACG,QAAA,eAAe,CAAC,SAAS;AACrB,aAAA,8BAA8B,qBAAqB,WAAW;AAAA,IACtE;AACA,QAAI,WAAW,CAAC,cAAc,OAAO,GAAG;AAChC,aAAA,oBAAoB,8BAA8B,iDAAiD;AAAA,IAC3G;AAEA,UAAM,KAAK,oBAAoB,gBAAgB,QAAQ,IAAI;AAAA,MAC1D;AAAA,MACA,WAAW,SAAS,MAAM;AAAA,MAC1B;AAAA,MACA,WAAW,OAAO,cAAc,YAAY,YAAY;AAAA,MACxD,SAAS,WAAW;AAAA,MACpB,MAAM,uBAAuB,IAAI;AAAA,MACjC,SAAS,SAAS,KAAA,KAAU;AAAA,IAAA,CAC5B;AAEM,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ,CAAC;AAAA,IAAA;AAAA,EAEX;AAAA,EAEA,MAAM,mBACL,QACA,EAAE,oBAAoB,EAAE,aAAa,MAAM,UAAU,GACrD,SACsC;AAChC,UAAA,UAAU,cAAc,MAAM,KAAK,eAAe,iBAAiB,QAAQ,IAAI,WAAW,IAAI;AACpG,UAAM,QAAQ,cAAc;AAAA,MAC3B,OAAO,UAAU,MAAM,QAAQ,kBAAkB,mBAAmB,OAAO,IAAI;AAAA,MAC/E,QAAQ,kBAAkB;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACG,QAAA,eAAe,CAAC,SAAS;AACrB,aAAA,8BAA8B,qBAAqB,WAAW;AAAA,IACtE;AAEA,UAAM,UAAU,MAAM,KAAK,oBAAoB,mBAAmB,QAAQ,IAAI;AAAA,MAC7E,WAAW,SAAS,MAAM;AAAA,MAC1B,SAAS,WAAW;AAAA,MACpB,MAAM,uBAAuB,IAAI;AAAA,IAAA,CACjC;AACD,QAAI,CAAC,SAAS;AACN,aAAA,oBAAoB,qBAAqB,yBAAyB;AAAA,IAC1E;AAEO,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ,CAAC;AAAA,IAAA;AAAA,EAEX;AACD;"}
1
+ {"version":3,"file":"MailTemplateMutationResolver.js","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.ts"],"sourcesContent":["import {\n\tAddMailTemplateResponse,\n\tMutationAddProjectMailTemplateArgs,\n\tMutationRemoveProjectMailTemplateArgs,\n\tMutationResolvers,\n\tRemoveMailTemplateResponse,\n} from '../../../schema'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { MailTemplateManager, mailTypeFromSchemaToDb, PermissionActions, ProjectManager } from '../../../model'\nimport { createErrorResponse, createProjectNotFoundResponse } from '../../errorUtils'\nimport { validateEmail } from '../../../model/utils/email'\n\nexport class MailTemplateMutationResolver implements MutationResolvers {\n\tconstructor(\n\t\tprivate readonly projectManager: ProjectManager,\n\t\tprivate readonly mailTemplateManager: MailTemplateManager,\n\t) {}\n\n\tasync addMailTemplate(\n\t\tparent: any,\n\t\t{ template: { content, projectSlug, subject, type, useLayout, variant, replyTo } }: MutationAddProjectMailTemplateArgs,\n\t\tcontext: TenantResolverContext,\n\t): Promise<AddMailTemplateResponse> {\n\t\tconst project = projectSlug ? await this.projectManager.getProjectBySlug(context.db, projectSlug) : null\n\t\tawait context.requireAccess({\n\t\t\tscope: project ? await context.permissionContext.createProjectScope(project) : undefined,\n\t\t\taction: PermissionActions.MAIL_TEMPLATE_ADD,\n\t\t\tmessage: 'You are not allowed to add a mail template',\n\t\t})\n\t\tif (projectSlug && !project) {\n\t\t\treturn createProjectNotFoundResponse('PROJECT_NOT_FOUND', projectSlug)\n\t\t}\n\t\tif (replyTo && !validateEmail(replyTo)) {\n\t\t\treturn createErrorResponse('INVALID_REPLY_EMAIL_FORMAT', 'Reply-to email address is not in a valid format')\n\t\t}\n\n\t\tawait this.mailTemplateManager.addMailTemplate(context.db, {\n\t\t\tcontent,\n\t\t\tprojectId: project?.id ?? null,\n\t\t\tsubject,\n\t\t\tuseLayout: typeof useLayout === 'boolean' ? useLayout : true,\n\t\t\tvariant: variant || '',\n\t\t\ttype: mailTypeFromSchemaToDb(type),\n\t\t\treplyTo: replyTo?.trim() || null,\n\t\t})\n\n\t\treturn {\n\t\t\tok: true,\n\t\t\terrors: [],\n\t\t}\n\t}\n\n\tasync removeMailTemplate(\n\t\tparent: any,\n\t\t{ templateIdentifier: { projectSlug, type, variant } }: MutationRemoveProjectMailTemplateArgs,\n\t\tcontext: TenantResolverContext,\n\t): Promise<RemoveMailTemplateResponse> {\n\t\tconst project = projectSlug ? await this.projectManager.getProjectBySlug(context.db, projectSlug) : null\n\t\tawait context.requireAccess({\n\t\t\tscope: project ? await context.permissionContext.createProjectScope(project) : undefined,\n\t\t\taction: PermissionActions.MAIL_TEMPLATE_REMOVE,\n\t\t\tmessage: 'You are not allowed to remove a mail template',\n\t\t})\n\t\tif (projectSlug && !project) {\n\t\t\treturn createProjectNotFoundResponse('PROJECT_NOT_FOUND', projectSlug)\n\t\t}\n\n\t\tconst removed = await this.mailTemplateManager.removeMailTemplate(context.db, {\n\t\t\tprojectId: project?.id ?? null,\n\t\t\tvariant: variant || '',\n\t\t\ttype: mailTypeFromSchemaToDb(type),\n\t\t})\n\t\tif (!removed) {\n\t\t\treturn createErrorResponse('PROJECT_NOT_FOUND', 'Mail template not found')\n\t\t}\n\n\t\treturn {\n\t\t\tok: true,\n\t\t\terrors: [],\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAYO,MAAM,6BAA0D;AAAA,EACtE,YACkB,gBACA,qBAChB;AAFgB,SAAA,iBAAA;AACA,SAAA,sBAAA;AAAA,EAAA;AAAA,EAGlB,MAAM,gBACL,QACA,EAAE,UAAU,EAAE,SAAS,aAAa,SAAS,MAAM,WAAW,SAAS,QAAQ,EAAA,GAC/E,SACmC;AAC7B,UAAA,UAAU,cAAc,MAAM,KAAK,eAAe,iBAAiB,QAAQ,IAAI,WAAW,IAAI;AACpG,UAAM,QAAQ,cAAc;AAAA,MAC3B,OAAO,UAAU,MAAM,QAAQ,kBAAkB,mBAAmB,OAAO,IAAI;AAAA,MAC/E,QAAQ,kBAAkB;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACG,QAAA,eAAe,CAAC,SAAS;AACrB,aAAA,8BAA8B,qBAAqB,WAAW;AAAA,IAAA;AAEtE,QAAI,WAAW,CAAC,cAAc,OAAO,GAAG;AAChC,aAAA,oBAAoB,8BAA8B,iDAAiD;AAAA,IAAA;AAG3G,UAAM,KAAK,oBAAoB,gBAAgB,QAAQ,IAAI;AAAA,MAC1D;AAAA,MACA,WAAW,SAAS,MAAM;AAAA,MAC1B;AAAA,MACA,WAAW,OAAO,cAAc,YAAY,YAAY;AAAA,MACxD,SAAS,WAAW;AAAA,MACpB,MAAM,uBAAuB,IAAI;AAAA,MACjC,SAAS,SAAS,UAAU;AAAA,IAAA,CAC5B;AAEM,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ,CAAA;AAAA,IACT;AAAA,EAAA;AAAA,EAGD,MAAM,mBACL,QACA,EAAE,oBAAoB,EAAE,aAAa,MAAM,UAAU,GACrD,SACsC;AAChC,UAAA,UAAU,cAAc,MAAM,KAAK,eAAe,iBAAiB,QAAQ,IAAI,WAAW,IAAI;AACpG,UAAM,QAAQ,cAAc;AAAA,MAC3B,OAAO,UAAU,MAAM,QAAQ,kBAAkB,mBAAmB,OAAO,IAAI;AAAA,MAC/E,QAAQ,kBAAkB;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACG,QAAA,eAAe,CAAC,SAAS;AACrB,aAAA,8BAA8B,qBAAqB,WAAW;AAAA,IAAA;AAGtE,UAAM,UAAU,MAAM,KAAK,oBAAoB,mBAAmB,QAAQ,IAAI;AAAA,MAC7E,WAAW,SAAS,MAAM;AAAA,MAC1B,SAAS,WAAW;AAAA,MACpB,MAAM,uBAAuB,IAAI;AAAA,IAAA,CACjC;AACD,QAAI,CAAC,SAAS;AACN,aAAA,oBAAoB,qBAAqB,yBAAyB;AAAA,IAAA;AAGnE,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ,CAAA;AAAA,IACT;AAAA,EAAA;AAEF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ChangePasswordMutationResolver.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/person/ChangePasswordMutationResolver.ts"],"sourcesContent":["import {\n\tChangeMyPasswordErrorCode,\n\tChangeMyPasswordResponse,\n\tChangePasswordErrorCode,\n\tChangePasswordResponse,\n\tMutationChangeMyPasswordArgs,\n\tMutationChangePasswordArgs,\n\tMutationResolvers,\n} from '../../../schema'\nimport { GraphQLResolveInfo } from 'graphql'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { IdentityScope, PasswordChangeManager, PermissionActions, PersonQuery } from '../../../model'\nimport { createErrorResponse } from '../../errorUtils'\n\nexport class ChangePasswordMutationResolver implements MutationResolvers {\n\tconstructor(\n\t\tprivate readonly passwordChangeManager: PasswordChangeManager,\n\t) {}\n\n\tasync changePassword(\n\t\tparent: unknown,\n\t\targs: MutationChangePasswordArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<ChangePasswordResponse> {\n\t\tconst person = await context.db.queryHandler.fetch(PersonQuery.byId(args.personId))\n\t\tif (!person) {\n\t\t\treturn createErrorResponse('PERSON_NOT_FOUND', 'Person not found')\n\t\t}\n\n\t\tawait context.requireAccess({\n\t\t\tscope: new IdentityScope(person.identity_id),\n\t\t\taction: PermissionActions.PERSON_CHANGE_PASSWORD(person.roles),\n\t\t\tmessage: 'You are not allowed to change password',\n\t\t})\n\t\tconst result = await this.passwordChangeManager.changePassword(context.db, args.personId, args.password)\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true, errors: [] }\n\t}\n\n\tasync changeMyPassword(\n\t\tparent: unknown,\n\t\targs: MutationChangeMyPasswordArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<ChangeMyPasswordResponse> {\n\t\tconst person = await context.db.queryHandler.fetch(PersonQuery.byIdentity(context.identity.id))\n\t\tif (!person) {\n\t\t\treturn createErrorResponse('NOT_A_PERSON', 'Only a person can change a password')\n\t\t}\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.PERSON_CHANGE_MY_PASSWORD,\n\t\t\tmessage: 'You are not allowed to change password',\n\t\t})\n\t\tconst result = await this.passwordChangeManager.changeMyPassword(context.db, person, args.currentPassword, args.newPassword)\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true }\n\t}\n}\n"],"names":["PersonQuery","createErrorResponse","IdentityScope","PermissionActions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAcO,MAAM,+BAA4D;AAAA,EACxE,YACkB,uBAChB;AADgB,SAAA,wBAAA;AAAA,EACf;AAAA,EAEH,MAAM,eACL,QACA,MACA,SACA,MACkC;AAC5B,UAAA,SAAS,MAAM,QAAQ,GAAG,aAAa,MAAMA,YAAAA,YAAY,KAAK,KAAK,QAAQ,CAAC;AAClF,QAAI,CAAC,QAAQ;AACL,aAAAC,WAAA,oBAAoB,oBAAoB,kBAAkB;AAAA,IAClE;AAEA,UAAM,QAAQ,cAAc;AAAA,MAC3B,OAAO,IAAIC,cAAAA,cAAc,OAAO,WAAW;AAAA,MAC3C,QAAQC,kBAAA,kBAAkB,uBAAuB,OAAO,KAAK;AAAA,MAC7D,SAAS;AAAA,IAAA,CACT;AACK,UAAA,SAAS,MAAM,KAAK,sBAAsB,eAAe,QAAQ,IAAI,KAAK,UAAU,KAAK,QAAQ;AAEnG,QAAA,CAAC,OAAO,IAAI;AACf,aAAOF,WAAoB,oBAAA,OAAO,OAAO,OAAO,YAAY;AAAA,IAC7D;AAEA,WAAO,EAAE,IAAI,MAAM,QAAQ,CAAG,EAAA;AAAA,EAC/B;AAAA,EAEA,MAAM,iBACL,QACA,MACA,SACA,MACoC;AAC9B,UAAA,SAAS,MAAM,QAAQ,GAAG,aAAa,MAAMD,YAAA,YAAY,WAAW,QAAQ,SAAS,EAAE,CAAC;AAC9F,QAAI,CAAC,QAAQ;AACL,aAAAC,WAAA,oBAAoB,gBAAgB,qCAAqC;AAAA,IACjF;AACA,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQE,kBAAkB,kBAAA;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACK,UAAA,SAAS,MAAM,KAAK,sBAAsB,iBAAiB,QAAQ,IAAI,QAAQ,KAAK,iBAAiB,KAAK,WAAW;AAEvH,QAAA,CAAC,OAAO,IAAI;AACf,aAAOF,WAAoB,oBAAA,OAAO,OAAO,OAAO,YAAY;AAAA,IAC7D;AAEO,WAAA,EAAE,IAAI;EACd;AACD;;"}
1
+ {"version":3,"file":"ChangePasswordMutationResolver.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/person/ChangePasswordMutationResolver.ts"],"sourcesContent":["import {\n\tChangeMyPasswordErrorCode,\n\tChangeMyPasswordResponse,\n\tChangePasswordErrorCode,\n\tChangePasswordResponse,\n\tMutationChangeMyPasswordArgs,\n\tMutationChangePasswordArgs,\n\tMutationResolvers,\n} from '../../../schema'\nimport { GraphQLResolveInfo } from 'graphql'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { IdentityScope, PasswordChangeManager, PermissionActions, PersonQuery } from '../../../model'\nimport { createErrorResponse } from '../../errorUtils'\n\nexport class ChangePasswordMutationResolver implements MutationResolvers {\n\tconstructor(\n\t\tprivate readonly passwordChangeManager: PasswordChangeManager,\n\t) {}\n\n\tasync changePassword(\n\t\tparent: unknown,\n\t\targs: MutationChangePasswordArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<ChangePasswordResponse> {\n\t\tconst person = await context.db.queryHandler.fetch(PersonQuery.byId(args.personId))\n\t\tif (!person) {\n\t\t\treturn createErrorResponse('PERSON_NOT_FOUND', 'Person not found')\n\t\t}\n\n\t\tawait context.requireAccess({\n\t\t\tscope: new IdentityScope(person.identity_id),\n\t\t\taction: PermissionActions.PERSON_CHANGE_PASSWORD(person.roles),\n\t\t\tmessage: 'You are not allowed to change password',\n\t\t})\n\t\tconst result = await this.passwordChangeManager.changePassword(context.db, args.personId, args.password)\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true, errors: [] }\n\t}\n\n\tasync changeMyPassword(\n\t\tparent: unknown,\n\t\targs: MutationChangeMyPasswordArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<ChangeMyPasswordResponse> {\n\t\tconst person = await context.db.queryHandler.fetch(PersonQuery.byIdentity(context.identity.id))\n\t\tif (!person) {\n\t\t\treturn createErrorResponse('NOT_A_PERSON', 'Only a person can change a password')\n\t\t}\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.PERSON_CHANGE_MY_PASSWORD,\n\t\t\tmessage: 'You are not allowed to change password',\n\t\t})\n\t\tconst result = await this.passwordChangeManager.changeMyPassword(context.db, person, args.currentPassword, args.newPassword)\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true }\n\t}\n}\n"],"names":["PersonQuery","createErrorResponse","IdentityScope","PermissionActions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAcO,MAAM,+BAA4D;AAAA,EACxE,YACkB,uBAChB;AADgB,SAAA,wBAAA;AAAA,EAAA;AAAA,EAGlB,MAAM,eACL,QACA,MACA,SACA,MACkC;AAC5B,UAAA,SAAS,MAAM,QAAQ,GAAG,aAAa,MAAMA,YAAAA,YAAY,KAAK,KAAK,QAAQ,CAAC;AAClF,QAAI,CAAC,QAAQ;AACL,aAAAC,WAAA,oBAAoB,oBAAoB,kBAAkB;AAAA,IAAA;AAGlE,UAAM,QAAQ,cAAc;AAAA,MAC3B,OAAO,IAAIC,cAAAA,cAAc,OAAO,WAAW;AAAA,MAC3C,QAAQC,kBAAA,kBAAkB,uBAAuB,OAAO,KAAK;AAAA,MAC7D,SAAS;AAAA,IAAA,CACT;AACK,UAAA,SAAS,MAAM,KAAK,sBAAsB,eAAe,QAAQ,IAAI,KAAK,UAAU,KAAK,QAAQ;AAEnG,QAAA,CAAC,OAAO,IAAI;AACf,aAAOF,WAAoB,oBAAA,OAAO,OAAO,OAAO,YAAY;AAAA,IAAA;AAG7D,WAAO,EAAE,IAAI,MAAM,QAAQ,CAAA,EAAG;AAAA,EAAA;AAAA,EAG/B,MAAM,iBACL,QACA,MACA,SACA,MACoC;AAC9B,UAAA,SAAS,MAAM,QAAQ,GAAG,aAAa,MAAMD,YAAA,YAAY,WAAW,QAAQ,SAAS,EAAE,CAAC;AAC9F,QAAI,CAAC,QAAQ;AACL,aAAAC,WAAA,oBAAoB,gBAAgB,qCAAqC;AAAA,IAAA;AAEjF,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQE,kBAAkB,kBAAA;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACK,UAAA,SAAS,MAAM,KAAK,sBAAsB,iBAAiB,QAAQ,IAAI,QAAQ,KAAK,iBAAiB,KAAK,WAAW;AAEvH,QAAA,CAAC,OAAO,IAAI;AACf,aAAOF,WAAoB,oBAAA,OAAO,OAAO,OAAO,YAAY;AAAA,IAAA;AAGtD,WAAA,EAAE,IAAI,KAAK;AAAA,EAAA;AAEpB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ChangePasswordMutationResolver.js","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/person/ChangePasswordMutationResolver.ts"],"sourcesContent":["import {\n\tChangeMyPasswordErrorCode,\n\tChangeMyPasswordResponse,\n\tChangePasswordErrorCode,\n\tChangePasswordResponse,\n\tMutationChangeMyPasswordArgs,\n\tMutationChangePasswordArgs,\n\tMutationResolvers,\n} from '../../../schema'\nimport { GraphQLResolveInfo } from 'graphql'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { IdentityScope, PasswordChangeManager, PermissionActions, PersonQuery } from '../../../model'\nimport { createErrorResponse } from '../../errorUtils'\n\nexport class ChangePasswordMutationResolver implements MutationResolvers {\n\tconstructor(\n\t\tprivate readonly passwordChangeManager: PasswordChangeManager,\n\t) {}\n\n\tasync changePassword(\n\t\tparent: unknown,\n\t\targs: MutationChangePasswordArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<ChangePasswordResponse> {\n\t\tconst person = await context.db.queryHandler.fetch(PersonQuery.byId(args.personId))\n\t\tif (!person) {\n\t\t\treturn createErrorResponse('PERSON_NOT_FOUND', 'Person not found')\n\t\t}\n\n\t\tawait context.requireAccess({\n\t\t\tscope: new IdentityScope(person.identity_id),\n\t\t\taction: PermissionActions.PERSON_CHANGE_PASSWORD(person.roles),\n\t\t\tmessage: 'You are not allowed to change password',\n\t\t})\n\t\tconst result = await this.passwordChangeManager.changePassword(context.db, args.personId, args.password)\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true, errors: [] }\n\t}\n\n\tasync changeMyPassword(\n\t\tparent: unknown,\n\t\targs: MutationChangeMyPasswordArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<ChangeMyPasswordResponse> {\n\t\tconst person = await context.db.queryHandler.fetch(PersonQuery.byIdentity(context.identity.id))\n\t\tif (!person) {\n\t\t\treturn createErrorResponse('NOT_A_PERSON', 'Only a person can change a password')\n\t\t}\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.PERSON_CHANGE_MY_PASSWORD,\n\t\t\tmessage: 'You are not allowed to change password',\n\t\t})\n\t\tconst result = await this.passwordChangeManager.changeMyPassword(context.db, person, args.currentPassword, args.newPassword)\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true }\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAcO,MAAM,+BAA4D;AAAA,EACxE,YACkB,uBAChB;AADgB,SAAA,wBAAA;AAAA,EACf;AAAA,EAEH,MAAM,eACL,QACA,MACA,SACA,MACkC;AAC5B,UAAA,SAAS,MAAM,QAAQ,GAAG,aAAa,MAAM,YAAY,KAAK,KAAK,QAAQ,CAAC;AAClF,QAAI,CAAC,QAAQ;AACL,aAAA,oBAAoB,oBAAoB,kBAAkB;AAAA,IAClE;AAEA,UAAM,QAAQ,cAAc;AAAA,MAC3B,OAAO,IAAI,cAAc,OAAO,WAAW;AAAA,MAC3C,QAAQ,kBAAkB,uBAAuB,OAAO,KAAK;AAAA,MAC7D,SAAS;AAAA,IAAA,CACT;AACK,UAAA,SAAS,MAAM,KAAK,sBAAsB,eAAe,QAAQ,IAAI,KAAK,UAAU,KAAK,QAAQ;AAEnG,QAAA,CAAC,OAAO,IAAI;AACf,aAAO,oBAAoB,OAAO,OAAO,OAAO,YAAY;AAAA,IAC7D;AAEA,WAAO,EAAE,IAAI,MAAM,QAAQ,CAAG,EAAA;AAAA,EAC/B;AAAA,EAEA,MAAM,iBACL,QACA,MACA,SACA,MACoC;AAC9B,UAAA,SAAS,MAAM,QAAQ,GAAG,aAAa,MAAM,YAAY,WAAW,QAAQ,SAAS,EAAE,CAAC;AAC9F,QAAI,CAAC,QAAQ;AACL,aAAA,oBAAoB,gBAAgB,qCAAqC;AAAA,IACjF;AACA,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQ,kBAAkB;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACK,UAAA,SAAS,MAAM,KAAK,sBAAsB,iBAAiB,QAAQ,IAAI,QAAQ,KAAK,iBAAiB,KAAK,WAAW;AAEvH,QAAA,CAAC,OAAO,IAAI;AACf,aAAO,oBAAoB,OAAO,OAAO,OAAO,YAAY;AAAA,IAC7D;AAEO,WAAA,EAAE,IAAI;EACd;AACD;"}
1
+ {"version":3,"file":"ChangePasswordMutationResolver.js","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/person/ChangePasswordMutationResolver.ts"],"sourcesContent":["import {\n\tChangeMyPasswordErrorCode,\n\tChangeMyPasswordResponse,\n\tChangePasswordErrorCode,\n\tChangePasswordResponse,\n\tMutationChangeMyPasswordArgs,\n\tMutationChangePasswordArgs,\n\tMutationResolvers,\n} from '../../../schema'\nimport { GraphQLResolveInfo } from 'graphql'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { IdentityScope, PasswordChangeManager, PermissionActions, PersonQuery } from '../../../model'\nimport { createErrorResponse } from '../../errorUtils'\n\nexport class ChangePasswordMutationResolver implements MutationResolvers {\n\tconstructor(\n\t\tprivate readonly passwordChangeManager: PasswordChangeManager,\n\t) {}\n\n\tasync changePassword(\n\t\tparent: unknown,\n\t\targs: MutationChangePasswordArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<ChangePasswordResponse> {\n\t\tconst person = await context.db.queryHandler.fetch(PersonQuery.byId(args.personId))\n\t\tif (!person) {\n\t\t\treturn createErrorResponse('PERSON_NOT_FOUND', 'Person not found')\n\t\t}\n\n\t\tawait context.requireAccess({\n\t\t\tscope: new IdentityScope(person.identity_id),\n\t\t\taction: PermissionActions.PERSON_CHANGE_PASSWORD(person.roles),\n\t\t\tmessage: 'You are not allowed to change password',\n\t\t})\n\t\tconst result = await this.passwordChangeManager.changePassword(context.db, args.personId, args.password)\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true, errors: [] }\n\t}\n\n\tasync changeMyPassword(\n\t\tparent: unknown,\n\t\targs: MutationChangeMyPasswordArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<ChangeMyPasswordResponse> {\n\t\tconst person = await context.db.queryHandler.fetch(PersonQuery.byIdentity(context.identity.id))\n\t\tif (!person) {\n\t\t\treturn createErrorResponse('NOT_A_PERSON', 'Only a person can change a password')\n\t\t}\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.PERSON_CHANGE_MY_PASSWORD,\n\t\t\tmessage: 'You are not allowed to change password',\n\t\t})\n\t\tconst result = await this.passwordChangeManager.changeMyPassword(context.db, person, args.currentPassword, args.newPassword)\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true }\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAcO,MAAM,+BAA4D;AAAA,EACxE,YACkB,uBAChB;AADgB,SAAA,wBAAA;AAAA,EAAA;AAAA,EAGlB,MAAM,eACL,QACA,MACA,SACA,MACkC;AAC5B,UAAA,SAAS,MAAM,QAAQ,GAAG,aAAa,MAAM,YAAY,KAAK,KAAK,QAAQ,CAAC;AAClF,QAAI,CAAC,QAAQ;AACL,aAAA,oBAAoB,oBAAoB,kBAAkB;AAAA,IAAA;AAGlE,UAAM,QAAQ,cAAc;AAAA,MAC3B,OAAO,IAAI,cAAc,OAAO,WAAW;AAAA,MAC3C,QAAQ,kBAAkB,uBAAuB,OAAO,KAAK;AAAA,MAC7D,SAAS;AAAA,IAAA,CACT;AACK,UAAA,SAAS,MAAM,KAAK,sBAAsB,eAAe,QAAQ,IAAI,KAAK,UAAU,KAAK,QAAQ;AAEnG,QAAA,CAAC,OAAO,IAAI;AACf,aAAO,oBAAoB,OAAO,OAAO,OAAO,YAAY;AAAA,IAAA;AAG7D,WAAO,EAAE,IAAI,MAAM,QAAQ,CAAA,EAAG;AAAA,EAAA;AAAA,EAG/B,MAAM,iBACL,QACA,MACA,SACA,MACoC;AAC9B,UAAA,SAAS,MAAM,QAAQ,GAAG,aAAa,MAAM,YAAY,WAAW,QAAQ,SAAS,EAAE,CAAC;AAC9F,QAAI,CAAC,QAAQ;AACL,aAAA,oBAAoB,gBAAgB,qCAAqC;AAAA,IAAA;AAEjF,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQ,kBAAkB;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACK,UAAA,SAAS,MAAM,KAAK,sBAAsB,iBAAiB,QAAQ,IAAI,QAAQ,KAAK,iBAAiB,KAAK,WAAW;AAEvH,QAAA,CAAC,OAAO,IAAI;AACf,aAAO,oBAAoB,OAAO,OAAO,OAAO,YAAY;AAAA,IAAA;AAGtD,WAAA,EAAE,IAAI,KAAK;AAAA,EAAA;AAEpB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ChangeProfileMutationResolver.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/person/ChangeProfileMutationResolver.ts"],"sourcesContent":["import {\n\tChangeMyProfileResponse,\n\tChangeProfileResponse,\n\tMutationChangeMyProfileArgs,\n\tMutationChangeProfileArgs,\n\tMutationResolvers,\n} from '../../../schema'\nimport { GraphQLResolveInfo } from 'graphql'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { IdentityScope, PermissionActions, PersonManager, PersonQuery } from '../../../model'\nimport { createErrorResponse } from '../../errorUtils'\n\nexport class ChangeProfileMutationResolver implements Pick<MutationResolvers, 'changeMyProfile' | 'changeProfile'> {\n\tconstructor(\n\t\tprivate readonly personManager: PersonManager,\n\t) { }\n\n\tasync changeProfile(\n\t\tparent: unknown,\n\t\targs: MutationChangeProfileArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<ChangeProfileResponse> {\n\t\tconst person = await context.db.queryHandler.fetch(PersonQuery.byId(args.personId))\n\t\tif (!person) {\n\t\t\treturn createErrorResponse('PERSON_NOT_FOUND', 'Person not found')\n\t\t}\n\t\tif (args.email === null) {\n\t\t\treturn createErrorResponse('INVALID_EMAIL_FORMAT', 'E-mail address cannot be null.')\n\t\t}\n\n\t\tawait context.requireAccess({\n\t\t\tscope: new IdentityScope(person.identity_id),\n\t\t\taction: PermissionActions.PERSON_CHANGE_PROFILE(person.roles),\n\t\t\tmessage: 'You are not allowed to change a profile',\n\t\t})\n\t\tconst result = await this.personManager.changeProfile(context.db, person, {\n\t\t\temail: args.email,\n\t\t\tname: args.name === '' ? null : args.name,\n\t\t})\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true }\n\t}\n\n\n\tasync changeMyProfile(\n\t\tparent: unknown,\n\t\targs: MutationChangeMyProfileArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<ChangeMyProfileResponse> {\n\t\tconst person = await context.db.queryHandler.fetch(PersonQuery.byIdentity(context.identity.id))\n\t\tif (!person) {\n\t\t\treturn createErrorResponse('NOT_A_PERSON', 'Only a person can change a profile.')\n\t\t}\n\t\tif (args.email === null) {\n\t\t\treturn createErrorResponse('INVALID_EMAIL_FORMAT', 'E-mail address cannot be null.')\n\t\t}\n\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.PERSON_CHANGE_MY_PROFILE,\n\t\t\tmessage: 'You are not allowed to change profile',\n\t\t})\n\n\t\tconst result = await this.personManager.changeProfile(context.db, person, {\n\t\t\temail: args.email,\n\t\t\tname: args.name === '' ? null : args.name,\n\t\t})\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true }\n\t}\n}\n"],"names":["PersonQuery","createErrorResponse","IdentityScope","PermissionActions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAYO,MAAM,8BAAsG;AAAA,EAClH,YACkB,eAChB;AADgB,SAAA,gBAAA;AAAA,EACd;AAAA,EAEJ,MAAM,cACL,QACA,MACA,SACA,MACiC;AAC3B,UAAA,SAAS,MAAM,QAAQ,GAAG,aAAa,MAAMA,YAAAA,YAAY,KAAK,KAAK,QAAQ,CAAC;AAClF,QAAI,CAAC,QAAQ;AACL,aAAAC,WAAA,oBAAoB,oBAAoB,kBAAkB;AAAA,IAClE;AACI,QAAA,KAAK,UAAU,MAAM;AACjB,aAAAA,WAAA,oBAAoB,wBAAwB,gCAAgC;AAAA,IACpF;AAEA,UAAM,QAAQ,cAAc;AAAA,MAC3B,OAAO,IAAIC,cAAAA,cAAc,OAAO,WAAW;AAAA,MAC3C,QAAQC,kBAAA,kBAAkB,sBAAsB,OAAO,KAAK;AAAA,MAC5D,SAAS;AAAA,IAAA,CACT;AACD,UAAM,SAAS,MAAM,KAAK,cAAc,cAAc,QAAQ,IAAI,QAAQ;AAAA,MACzE,OAAO,KAAK;AAAA,MACZ,MAAM,KAAK,SAAS,KAAK,OAAO,KAAK;AAAA,IAAA,CACrC;AAEG,QAAA,CAAC,OAAO,IAAI;AACf,aAAOF,WAAoB,oBAAA,OAAO,OAAO,OAAO,YAAY;AAAA,IAC7D;AAEO,WAAA,EAAE,IAAI;EACd;AAAA,EAGA,MAAM,gBACL,QACA,MACA,SACA,MACmC;AAC7B,UAAA,SAAS,MAAM,QAAQ,GAAG,aAAa,MAAMD,YAAA,YAAY,WAAW,QAAQ,SAAS,EAAE,CAAC;AAC9F,QAAI,CAAC,QAAQ;AACL,aAAAC,WAAA,oBAAoB,gBAAgB,qCAAqC;AAAA,IACjF;AACI,QAAA,KAAK,UAAU,MAAM;AACjB,aAAAA,WAAA,oBAAoB,wBAAwB,gCAAgC;AAAA,IACpF;AAEA,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQE,kBAAkB,kBAAA;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AAED,UAAM,SAAS,MAAM,KAAK,cAAc,cAAc,QAAQ,IAAI,QAAQ;AAAA,MACzE,OAAO,KAAK;AAAA,MACZ,MAAM,KAAK,SAAS,KAAK,OAAO,KAAK;AAAA,IAAA,CACrC;AAEG,QAAA,CAAC,OAAO,IAAI;AACf,aAAOF,WAAoB,oBAAA,OAAO,OAAO,OAAO,YAAY;AAAA,IAC7D;AAEO,WAAA,EAAE,IAAI;EACd;AACD;;"}
1
+ {"version":3,"file":"ChangeProfileMutationResolver.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/person/ChangeProfileMutationResolver.ts"],"sourcesContent":["import {\n\tChangeMyProfileResponse,\n\tChangeProfileResponse,\n\tMutationChangeMyProfileArgs,\n\tMutationChangeProfileArgs,\n\tMutationResolvers,\n} from '../../../schema'\nimport { GraphQLResolveInfo } from 'graphql'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { IdentityScope, PermissionActions, PersonManager, PersonQuery } from '../../../model'\nimport { createErrorResponse } from '../../errorUtils'\n\nexport class ChangeProfileMutationResolver implements Pick<MutationResolvers, 'changeMyProfile' | 'changeProfile'> {\n\tconstructor(\n\t\tprivate readonly personManager: PersonManager,\n\t) { }\n\n\tasync changeProfile(\n\t\tparent: unknown,\n\t\targs: MutationChangeProfileArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<ChangeProfileResponse> {\n\t\tconst person = await context.db.queryHandler.fetch(PersonQuery.byId(args.personId))\n\t\tif (!person) {\n\t\t\treturn createErrorResponse('PERSON_NOT_FOUND', 'Person not found')\n\t\t}\n\t\tif (args.email === null) {\n\t\t\treturn createErrorResponse('INVALID_EMAIL_FORMAT', 'E-mail address cannot be null.')\n\t\t}\n\n\t\tawait context.requireAccess({\n\t\t\tscope: new IdentityScope(person.identity_id),\n\t\t\taction: PermissionActions.PERSON_CHANGE_PROFILE(person.roles),\n\t\t\tmessage: 'You are not allowed to change a profile',\n\t\t})\n\t\tconst result = await this.personManager.changeProfile(context.db, person, {\n\t\t\temail: args.email,\n\t\t\tname: args.name === '' ? null : args.name,\n\t\t})\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true }\n\t}\n\n\n\tasync changeMyProfile(\n\t\tparent: unknown,\n\t\targs: MutationChangeMyProfileArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<ChangeMyProfileResponse> {\n\t\tconst person = await context.db.queryHandler.fetch(PersonQuery.byIdentity(context.identity.id))\n\t\tif (!person) {\n\t\t\treturn createErrorResponse('NOT_A_PERSON', 'Only a person can change a profile.')\n\t\t}\n\t\tif (args.email === null) {\n\t\t\treturn createErrorResponse('INVALID_EMAIL_FORMAT', 'E-mail address cannot be null.')\n\t\t}\n\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.PERSON_CHANGE_MY_PROFILE,\n\t\t\tmessage: 'You are not allowed to change profile',\n\t\t})\n\n\t\tconst result = await this.personManager.changeProfile(context.db, person, {\n\t\t\temail: args.email,\n\t\t\tname: args.name === '' ? null : args.name,\n\t\t})\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true }\n\t}\n}\n"],"names":["PersonQuery","createErrorResponse","IdentityScope","PermissionActions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAYO,MAAM,8BAAsG;AAAA,EAClH,YACkB,eAChB;AADgB,SAAA,gBAAA;AAAA,EAAA;AAAA,EAGlB,MAAM,cACL,QACA,MACA,SACA,MACiC;AAC3B,UAAA,SAAS,MAAM,QAAQ,GAAG,aAAa,MAAMA,YAAAA,YAAY,KAAK,KAAK,QAAQ,CAAC;AAClF,QAAI,CAAC,QAAQ;AACL,aAAAC,WAAA,oBAAoB,oBAAoB,kBAAkB;AAAA,IAAA;AAE9D,QAAA,KAAK,UAAU,MAAM;AACjB,aAAAA,WAAA,oBAAoB,wBAAwB,gCAAgC;AAAA,IAAA;AAGpF,UAAM,QAAQ,cAAc;AAAA,MAC3B,OAAO,IAAIC,cAAAA,cAAc,OAAO,WAAW;AAAA,MAC3C,QAAQC,kBAAA,kBAAkB,sBAAsB,OAAO,KAAK;AAAA,MAC5D,SAAS;AAAA,IAAA,CACT;AACD,UAAM,SAAS,MAAM,KAAK,cAAc,cAAc,QAAQ,IAAI,QAAQ;AAAA,MACzE,OAAO,KAAK;AAAA,MACZ,MAAM,KAAK,SAAS,KAAK,OAAO,KAAK;AAAA,IAAA,CACrC;AAEG,QAAA,CAAC,OAAO,IAAI;AACf,aAAOF,WAAoB,oBAAA,OAAO,OAAO,OAAO,YAAY;AAAA,IAAA;AAGtD,WAAA,EAAE,IAAI,KAAK;AAAA,EAAA;AAAA,EAInB,MAAM,gBACL,QACA,MACA,SACA,MACmC;AAC7B,UAAA,SAAS,MAAM,QAAQ,GAAG,aAAa,MAAMD,YAAA,YAAY,WAAW,QAAQ,SAAS,EAAE,CAAC;AAC9F,QAAI,CAAC,QAAQ;AACL,aAAAC,WAAA,oBAAoB,gBAAgB,qCAAqC;AAAA,IAAA;AAE7E,QAAA,KAAK,UAAU,MAAM;AACjB,aAAAA,WAAA,oBAAoB,wBAAwB,gCAAgC;AAAA,IAAA;AAGpF,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQE,kBAAkB,kBAAA;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AAED,UAAM,SAAS,MAAM,KAAK,cAAc,cAAc,QAAQ,IAAI,QAAQ;AAAA,MACzE,OAAO,KAAK;AAAA,MACZ,MAAM,KAAK,SAAS,KAAK,OAAO,KAAK;AAAA,IAAA,CACrC;AAEG,QAAA,CAAC,OAAO,IAAI;AACf,aAAOF,WAAoB,oBAAA,OAAO,OAAO,OAAO,YAAY;AAAA,IAAA;AAGtD,WAAA,EAAE,IAAI,KAAK;AAAA,EAAA;AAEpB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ChangeProfileMutationResolver.js","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/person/ChangeProfileMutationResolver.ts"],"sourcesContent":["import {\n\tChangeMyProfileResponse,\n\tChangeProfileResponse,\n\tMutationChangeMyProfileArgs,\n\tMutationChangeProfileArgs,\n\tMutationResolvers,\n} from '../../../schema'\nimport { GraphQLResolveInfo } from 'graphql'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { IdentityScope, PermissionActions, PersonManager, PersonQuery } from '../../../model'\nimport { createErrorResponse } from '../../errorUtils'\n\nexport class ChangeProfileMutationResolver implements Pick<MutationResolvers, 'changeMyProfile' | 'changeProfile'> {\n\tconstructor(\n\t\tprivate readonly personManager: PersonManager,\n\t) { }\n\n\tasync changeProfile(\n\t\tparent: unknown,\n\t\targs: MutationChangeProfileArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<ChangeProfileResponse> {\n\t\tconst person = await context.db.queryHandler.fetch(PersonQuery.byId(args.personId))\n\t\tif (!person) {\n\t\t\treturn createErrorResponse('PERSON_NOT_FOUND', 'Person not found')\n\t\t}\n\t\tif (args.email === null) {\n\t\t\treturn createErrorResponse('INVALID_EMAIL_FORMAT', 'E-mail address cannot be null.')\n\t\t}\n\n\t\tawait context.requireAccess({\n\t\t\tscope: new IdentityScope(person.identity_id),\n\t\t\taction: PermissionActions.PERSON_CHANGE_PROFILE(person.roles),\n\t\t\tmessage: 'You are not allowed to change a profile',\n\t\t})\n\t\tconst result = await this.personManager.changeProfile(context.db, person, {\n\t\t\temail: args.email,\n\t\t\tname: args.name === '' ? null : args.name,\n\t\t})\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true }\n\t}\n\n\n\tasync changeMyProfile(\n\t\tparent: unknown,\n\t\targs: MutationChangeMyProfileArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<ChangeMyProfileResponse> {\n\t\tconst person = await context.db.queryHandler.fetch(PersonQuery.byIdentity(context.identity.id))\n\t\tif (!person) {\n\t\t\treturn createErrorResponse('NOT_A_PERSON', 'Only a person can change a profile.')\n\t\t}\n\t\tif (args.email === null) {\n\t\t\treturn createErrorResponse('INVALID_EMAIL_FORMAT', 'E-mail address cannot be null.')\n\t\t}\n\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.PERSON_CHANGE_MY_PROFILE,\n\t\t\tmessage: 'You are not allowed to change profile',\n\t\t})\n\n\t\tconst result = await this.personManager.changeProfile(context.db, person, {\n\t\t\temail: args.email,\n\t\t\tname: args.name === '' ? null : args.name,\n\t\t})\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true }\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAYO,MAAM,8BAAsG;AAAA,EAClH,YACkB,eAChB;AADgB,SAAA,gBAAA;AAAA,EACd;AAAA,EAEJ,MAAM,cACL,QACA,MACA,SACA,MACiC;AAC3B,UAAA,SAAS,MAAM,QAAQ,GAAG,aAAa,MAAM,YAAY,KAAK,KAAK,QAAQ,CAAC;AAClF,QAAI,CAAC,QAAQ;AACL,aAAA,oBAAoB,oBAAoB,kBAAkB;AAAA,IAClE;AACI,QAAA,KAAK,UAAU,MAAM;AACjB,aAAA,oBAAoB,wBAAwB,gCAAgC;AAAA,IACpF;AAEA,UAAM,QAAQ,cAAc;AAAA,MAC3B,OAAO,IAAI,cAAc,OAAO,WAAW;AAAA,MAC3C,QAAQ,kBAAkB,sBAAsB,OAAO,KAAK;AAAA,MAC5D,SAAS;AAAA,IAAA,CACT;AACD,UAAM,SAAS,MAAM,KAAK,cAAc,cAAc,QAAQ,IAAI,QAAQ;AAAA,MACzE,OAAO,KAAK;AAAA,MACZ,MAAM,KAAK,SAAS,KAAK,OAAO,KAAK;AAAA,IAAA,CACrC;AAEG,QAAA,CAAC,OAAO,IAAI;AACf,aAAO,oBAAoB,OAAO,OAAO,OAAO,YAAY;AAAA,IAC7D;AAEO,WAAA,EAAE,IAAI;EACd;AAAA,EAGA,MAAM,gBACL,QACA,MACA,SACA,MACmC;AAC7B,UAAA,SAAS,MAAM,QAAQ,GAAG,aAAa,MAAM,YAAY,WAAW,QAAQ,SAAS,EAAE,CAAC;AAC9F,QAAI,CAAC,QAAQ;AACL,aAAA,oBAAoB,gBAAgB,qCAAqC;AAAA,IACjF;AACI,QAAA,KAAK,UAAU,MAAM;AACjB,aAAA,oBAAoB,wBAAwB,gCAAgC;AAAA,IACpF;AAEA,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQ,kBAAkB;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AAED,UAAM,SAAS,MAAM,KAAK,cAAc,cAAc,QAAQ,IAAI,QAAQ;AAAA,MACzE,OAAO,KAAK;AAAA,MACZ,MAAM,KAAK,SAAS,KAAK,OAAO,KAAK;AAAA,IAAA,CACrC;AAEG,QAAA,CAAC,OAAO,IAAI;AACf,aAAO,oBAAoB,OAAO,OAAO,OAAO,YAAY;AAAA,IAC7D;AAEO,WAAA,EAAE,IAAI;EACd;AACD;"}
1
+ {"version":3,"file":"ChangeProfileMutationResolver.js","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/person/ChangeProfileMutationResolver.ts"],"sourcesContent":["import {\n\tChangeMyProfileResponse,\n\tChangeProfileResponse,\n\tMutationChangeMyProfileArgs,\n\tMutationChangeProfileArgs,\n\tMutationResolvers,\n} from '../../../schema'\nimport { GraphQLResolveInfo } from 'graphql'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { IdentityScope, PermissionActions, PersonManager, PersonQuery } from '../../../model'\nimport { createErrorResponse } from '../../errorUtils'\n\nexport class ChangeProfileMutationResolver implements Pick<MutationResolvers, 'changeMyProfile' | 'changeProfile'> {\n\tconstructor(\n\t\tprivate readonly personManager: PersonManager,\n\t) { }\n\n\tasync changeProfile(\n\t\tparent: unknown,\n\t\targs: MutationChangeProfileArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<ChangeProfileResponse> {\n\t\tconst person = await context.db.queryHandler.fetch(PersonQuery.byId(args.personId))\n\t\tif (!person) {\n\t\t\treturn createErrorResponse('PERSON_NOT_FOUND', 'Person not found')\n\t\t}\n\t\tif (args.email === null) {\n\t\t\treturn createErrorResponse('INVALID_EMAIL_FORMAT', 'E-mail address cannot be null.')\n\t\t}\n\n\t\tawait context.requireAccess({\n\t\t\tscope: new IdentityScope(person.identity_id),\n\t\t\taction: PermissionActions.PERSON_CHANGE_PROFILE(person.roles),\n\t\t\tmessage: 'You are not allowed to change a profile',\n\t\t})\n\t\tconst result = await this.personManager.changeProfile(context.db, person, {\n\t\t\temail: args.email,\n\t\t\tname: args.name === '' ? null : args.name,\n\t\t})\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true }\n\t}\n\n\n\tasync changeMyProfile(\n\t\tparent: unknown,\n\t\targs: MutationChangeMyProfileArgs,\n\t\tcontext: TenantResolverContext,\n\t\tinfo: GraphQLResolveInfo,\n\t): Promise<ChangeMyProfileResponse> {\n\t\tconst person = await context.db.queryHandler.fetch(PersonQuery.byIdentity(context.identity.id))\n\t\tif (!person) {\n\t\t\treturn createErrorResponse('NOT_A_PERSON', 'Only a person can change a profile.')\n\t\t}\n\t\tif (args.email === null) {\n\t\t\treturn createErrorResponse('INVALID_EMAIL_FORMAT', 'E-mail address cannot be null.')\n\t\t}\n\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.PERSON_CHANGE_MY_PROFILE,\n\t\t\tmessage: 'You are not allowed to change profile',\n\t\t})\n\n\t\tconst result = await this.personManager.changeProfile(context.db, person, {\n\t\t\temail: args.email,\n\t\t\tname: args.name === '' ? null : args.name,\n\t\t})\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn { ok: true }\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAYO,MAAM,8BAAsG;AAAA,EAClH,YACkB,eAChB;AADgB,SAAA,gBAAA;AAAA,EAAA;AAAA,EAGlB,MAAM,cACL,QACA,MACA,SACA,MACiC;AAC3B,UAAA,SAAS,MAAM,QAAQ,GAAG,aAAa,MAAM,YAAY,KAAK,KAAK,QAAQ,CAAC;AAClF,QAAI,CAAC,QAAQ;AACL,aAAA,oBAAoB,oBAAoB,kBAAkB;AAAA,IAAA;AAE9D,QAAA,KAAK,UAAU,MAAM;AACjB,aAAA,oBAAoB,wBAAwB,gCAAgC;AAAA,IAAA;AAGpF,UAAM,QAAQ,cAAc;AAAA,MAC3B,OAAO,IAAI,cAAc,OAAO,WAAW;AAAA,MAC3C,QAAQ,kBAAkB,sBAAsB,OAAO,KAAK;AAAA,MAC5D,SAAS;AAAA,IAAA,CACT;AACD,UAAM,SAAS,MAAM,KAAK,cAAc,cAAc,QAAQ,IAAI,QAAQ;AAAA,MACzE,OAAO,KAAK;AAAA,MACZ,MAAM,KAAK,SAAS,KAAK,OAAO,KAAK;AAAA,IAAA,CACrC;AAEG,QAAA,CAAC,OAAO,IAAI;AACf,aAAO,oBAAoB,OAAO,OAAO,OAAO,YAAY;AAAA,IAAA;AAGtD,WAAA,EAAE,IAAI,KAAK;AAAA,EAAA;AAAA,EAInB,MAAM,gBACL,QACA,MACA,SACA,MACmC;AAC7B,UAAA,SAAS,MAAM,QAAQ,GAAG,aAAa,MAAM,YAAY,WAAW,QAAQ,SAAS,EAAE,CAAC;AAC9F,QAAI,CAAC,QAAQ;AACL,aAAA,oBAAoB,gBAAgB,qCAAqC;AAAA,IAAA;AAE7E,QAAA,KAAK,UAAU,MAAM;AACjB,aAAA,oBAAoB,wBAAwB,gCAAgC;AAAA,IAAA;AAGpF,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQ,kBAAkB;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AAED,UAAM,SAAS,MAAM,KAAK,cAAc,cAAc,QAAQ,IAAI,QAAQ;AAAA,MACzE,OAAO,KAAK;AAAA,MACZ,MAAM,KAAK,SAAS,KAAK,OAAO,KAAK;AAAA,IAAA,CACrC;AAEG,QAAA,CAAC,OAAO,IAAI;AACf,aAAO,oBAAoB,OAAO,OAAO,OAAO,YAAY;AAAA,IAAA;AAGtD,WAAA,EAAE,IAAI,KAAK;AAAA,EAAA;AAEpB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"DisablePersonMutationResolver.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/person/DisablePersonMutationResolver.ts"],"sourcesContent":["import {\n\tDisablePersonResponse,\n\tMutationDisablePersonArgs,\n\tMutationResolvers,\n} from '../../../schema'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { PermissionActions, PersonAccessManager } from '../../../model'\nimport { PersonManager } from '../../../model/service/PersonManager'\nimport { createErrorResponse } from '../../errorUtils'\n\nexport class DisablePersonMutationResolver implements MutationResolvers {\n\n\tconstructor(\n\t\tprivate readonly personAccessManager: PersonAccessManager,\n\t\tprivate readonly personManager: PersonManager,\n\t) {}\n\n\tasync disablePerson(\n\t\tparent: any, args: MutationDisablePersonArgs, context: TenantResolverContext,\n\t): Promise<DisablePersonResponse> {\n\t\tconst targetPerson = await this.personManager.findPersonById(context.db, args.personId)\n\n\t\tif (targetPerson === null) {\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\terror: {\n\t\t\t\t\tcode: 'PERSON_NOT_FOUND',\n\t\t\t\t\tdeveloperMessage: `Person <${args.personId}> was not found`,\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.PERSON_DISABLE(targetPerson.roles),\n\t\t\tmessage: 'You are not allowed to disable person account',\n\t\t})\n\n\t\tconst result = await this.personAccessManager.disablePerson(context.db, args.personId)\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn {\n\t\t\tok: true,\n\t\t}\n\t}\n}\n"],"names":["PermissionActions","createErrorResponse"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAUO,MAAM,8BAA2D;AAAA,EAEvE,YACkB,qBACA,eAChB;AAFgB,SAAA,sBAAA;AACA,SAAA,gBAAA;AAAA,EACf;AAAA,EAEH,MAAM,cACL,QAAa,MAAiC,SACb;AAC3B,UAAA,eAAe,MAAM,KAAK,cAAc,eAAe,QAAQ,IAAI,KAAK,QAAQ;AAEtF,QAAI,iBAAiB,MAAM;AACnB,aAAA;AAAA,QACN,IAAI;AAAA,QACJ,OAAO;AAAA,UACN,MAAM;AAAA,UACN,kBAAkB,WAAW,KAAK,QAAQ;AAAA,QAC3C;AAAA,MAAA;AAAA,IAEF;AAEA,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQA,kBAAA,kBAAkB,eAAe,aAAa,KAAK;AAAA,MAC3D,SAAS;AAAA,IAAA,CACT;AAEK,UAAA,SAAS,MAAM,KAAK,oBAAoB,cAAc,QAAQ,IAAI,KAAK,QAAQ;AAEjF,QAAA,CAAC,OAAO,IAAI;AACf,aAAOC,WAAoB,oBAAA,OAAO,OAAO,OAAO,YAAY;AAAA,IAC7D;AAEO,WAAA;AAAA,MACN,IAAI;AAAA,IAAA;AAAA,EAEN;AACD;;"}
1
+ {"version":3,"file":"DisablePersonMutationResolver.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/person/DisablePersonMutationResolver.ts"],"sourcesContent":["import {\n\tDisablePersonResponse,\n\tMutationDisablePersonArgs,\n\tMutationResolvers,\n} from '../../../schema'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { PermissionActions, PersonAccessManager } from '../../../model'\nimport { PersonManager } from '../../../model/service/PersonManager'\nimport { createErrorResponse } from '../../errorUtils'\n\nexport class DisablePersonMutationResolver implements MutationResolvers {\n\n\tconstructor(\n\t\tprivate readonly personAccessManager: PersonAccessManager,\n\t\tprivate readonly personManager: PersonManager,\n\t) {}\n\n\tasync disablePerson(\n\t\tparent: any, args: MutationDisablePersonArgs, context: TenantResolverContext,\n\t): Promise<DisablePersonResponse> {\n\t\tconst targetPerson = await this.personManager.findPersonById(context.db, args.personId)\n\n\t\tif (targetPerson === null) {\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\terror: {\n\t\t\t\t\tcode: 'PERSON_NOT_FOUND',\n\t\t\t\t\tdeveloperMessage: `Person <${args.personId}> was not found`,\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.PERSON_DISABLE(targetPerson.roles),\n\t\t\tmessage: 'You are not allowed to disable person account',\n\t\t})\n\n\t\tconst result = await this.personAccessManager.disablePerson(context.db, args.personId)\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn {\n\t\t\tok: true,\n\t\t}\n\t}\n}\n"],"names":["PermissionActions","createErrorResponse"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAUO,MAAM,8BAA2D;AAAA,EAEvE,YACkB,qBACA,eAChB;AAFgB,SAAA,sBAAA;AACA,SAAA,gBAAA;AAAA,EAAA;AAAA,EAGlB,MAAM,cACL,QAAa,MAAiC,SACb;AAC3B,UAAA,eAAe,MAAM,KAAK,cAAc,eAAe,QAAQ,IAAI,KAAK,QAAQ;AAEtF,QAAI,iBAAiB,MAAM;AACnB,aAAA;AAAA,QACN,IAAI;AAAA,QACJ,OAAO;AAAA,UACN,MAAM;AAAA,UACN,kBAAkB,WAAW,KAAK,QAAQ;AAAA,QAAA;AAAA,MAE5C;AAAA,IAAA;AAGD,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQA,kBAAA,kBAAkB,eAAe,aAAa,KAAK;AAAA,MAC3D,SAAS;AAAA,IAAA,CACT;AAEK,UAAA,SAAS,MAAM,KAAK,oBAAoB,cAAc,QAAQ,IAAI,KAAK,QAAQ;AAEjF,QAAA,CAAC,OAAO,IAAI;AACf,aAAOC,WAAoB,oBAAA,OAAO,OAAO,OAAO,YAAY;AAAA,IAAA;AAGtD,WAAA;AAAA,MACN,IAAI;AAAA,IACL;AAAA,EAAA;AAEF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"DisablePersonMutationResolver.js","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/person/DisablePersonMutationResolver.ts"],"sourcesContent":["import {\n\tDisablePersonResponse,\n\tMutationDisablePersonArgs,\n\tMutationResolvers,\n} from '../../../schema'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { PermissionActions, PersonAccessManager } from '../../../model'\nimport { PersonManager } from '../../../model/service/PersonManager'\nimport { createErrorResponse } from '../../errorUtils'\n\nexport class DisablePersonMutationResolver implements MutationResolvers {\n\n\tconstructor(\n\t\tprivate readonly personAccessManager: PersonAccessManager,\n\t\tprivate readonly personManager: PersonManager,\n\t) {}\n\n\tasync disablePerson(\n\t\tparent: any, args: MutationDisablePersonArgs, context: TenantResolverContext,\n\t): Promise<DisablePersonResponse> {\n\t\tconst targetPerson = await this.personManager.findPersonById(context.db, args.personId)\n\n\t\tif (targetPerson === null) {\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\terror: {\n\t\t\t\t\tcode: 'PERSON_NOT_FOUND',\n\t\t\t\t\tdeveloperMessage: `Person <${args.personId}> was not found`,\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.PERSON_DISABLE(targetPerson.roles),\n\t\t\tmessage: 'You are not allowed to disable person account',\n\t\t})\n\n\t\tconst result = await this.personAccessManager.disablePerson(context.db, args.personId)\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn {\n\t\t\tok: true,\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAUO,MAAM,8BAA2D;AAAA,EAEvE,YACkB,qBACA,eAChB;AAFgB,SAAA,sBAAA;AACA,SAAA,gBAAA;AAAA,EACf;AAAA,EAEH,MAAM,cACL,QAAa,MAAiC,SACb;AAC3B,UAAA,eAAe,MAAM,KAAK,cAAc,eAAe,QAAQ,IAAI,KAAK,QAAQ;AAEtF,QAAI,iBAAiB,MAAM;AACnB,aAAA;AAAA,QACN,IAAI;AAAA,QACJ,OAAO;AAAA,UACN,MAAM;AAAA,UACN,kBAAkB,WAAW,KAAK,QAAQ;AAAA,QAC3C;AAAA,MAAA;AAAA,IAEF;AAEA,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQ,kBAAkB,eAAe,aAAa,KAAK;AAAA,MAC3D,SAAS;AAAA,IAAA,CACT;AAEK,UAAA,SAAS,MAAM,KAAK,oBAAoB,cAAc,QAAQ,IAAI,KAAK,QAAQ;AAEjF,QAAA,CAAC,OAAO,IAAI;AACf,aAAO,oBAAoB,OAAO,OAAO,OAAO,YAAY;AAAA,IAC7D;AAEO,WAAA;AAAA,MACN,IAAI;AAAA,IAAA;AAAA,EAEN;AACD;"}
1
+ {"version":3,"file":"DisablePersonMutationResolver.js","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/person/DisablePersonMutationResolver.ts"],"sourcesContent":["import {\n\tDisablePersonResponse,\n\tMutationDisablePersonArgs,\n\tMutationResolvers,\n} from '../../../schema'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { PermissionActions, PersonAccessManager } from '../../../model'\nimport { PersonManager } from '../../../model/service/PersonManager'\nimport { createErrorResponse } from '../../errorUtils'\n\nexport class DisablePersonMutationResolver implements MutationResolvers {\n\n\tconstructor(\n\t\tprivate readonly personAccessManager: PersonAccessManager,\n\t\tprivate readonly personManager: PersonManager,\n\t) {}\n\n\tasync disablePerson(\n\t\tparent: any, args: MutationDisablePersonArgs, context: TenantResolverContext,\n\t): Promise<DisablePersonResponse> {\n\t\tconst targetPerson = await this.personManager.findPersonById(context.db, args.personId)\n\n\t\tif (targetPerson === null) {\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\terror: {\n\t\t\t\t\tcode: 'PERSON_NOT_FOUND',\n\t\t\t\t\tdeveloperMessage: `Person <${args.personId}> was not found`,\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.PERSON_DISABLE(targetPerson.roles),\n\t\t\tmessage: 'You are not allowed to disable person account',\n\t\t})\n\n\t\tconst result = await this.personAccessManager.disablePerson(context.db, args.personId)\n\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\n\t\treturn {\n\t\t\tok: true,\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAUO,MAAM,8BAA2D;AAAA,EAEvE,YACkB,qBACA,eAChB;AAFgB,SAAA,sBAAA;AACA,SAAA,gBAAA;AAAA,EAAA;AAAA,EAGlB,MAAM,cACL,QAAa,MAAiC,SACb;AAC3B,UAAA,eAAe,MAAM,KAAK,cAAc,eAAe,QAAQ,IAAI,KAAK,QAAQ;AAEtF,QAAI,iBAAiB,MAAM;AACnB,aAAA;AAAA,QACN,IAAI;AAAA,QACJ,OAAO;AAAA,UACN,MAAM;AAAA,UACN,kBAAkB,WAAW,KAAK,QAAQ;AAAA,QAAA;AAAA,MAE5C;AAAA,IAAA;AAGD,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQ,kBAAkB,eAAe,aAAa,KAAK;AAAA,MAC3D,SAAS;AAAA,IAAA,CACT;AAEK,UAAA,SAAS,MAAM,KAAK,oBAAoB,cAAc,QAAQ,IAAI,KAAK,QAAQ;AAEjF,QAAA,CAAC,OAAO,IAAI;AACf,aAAO,oBAAoB,OAAO,OAAO,OAAO,YAAY;AAAA,IAAA;AAGtD,WAAA;AAAA,MACN,IAAI;AAAA,IACL;AAAA,EAAA;AAEF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"IDPMutationResolver.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/person/IDPMutationResolver.ts"],"sourcesContent":["import {\n\tInitSignInIdpResponse,\n\tMutationInitSignInIdpArgs,\n\tMutationResolvers,\n\tMutationSignInIdpArgs,\n\tSignInIdpResponse,\n} from '../../../schema'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { IDPSignInManager, PermissionActions } from '../../../model'\nimport { createErrorResponse } from '../../errorUtils'\nimport { SignInResponseFactory } from '../../responseHelpers/SignInResponseFactory'\n\nexport class IDPMutationResolver implements MutationResolvers {\n\tconstructor(\n\t\tprivate readonly idpSignInManager: IDPSignInManager,\n\t\tprivate readonly signInResponseFactory: SignInResponseFactory,\n\t) {}\n\n\tasync initSignInIDP(\n\t\tparent: any,\n\t\targs: MutationInitSignInIdpArgs,\n\t\tcontext: TenantResolverContext,\n\t): Promise<InitSignInIdpResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.PERSON_CREATE_IDP_URL,\n\t\t\tmessage: 'You are not allowed to create a redirect URL for IDP',\n\t\t})\n\t\tconst result = await this.idpSignInManager.initSignInIDP(context.db, args.identityProvider, args.data ?? {\n\t\t\tredirectUrl: args.redirectUrl,\n\t\t})\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\t\treturn { ok: true, errors: [], result: result.result }\n\t}\n\n\tasync signInIDP(parent: any, args: MutationSignInIdpArgs, context: TenantResolverContext): Promise<SignInIdpResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.PERSON_SIGN_IN_IDP,\n\t\t\tmessage: 'You are not allowed to person IDP sign in',\n\t\t})\n\t\tconst signIn = await this.idpSignInManager.signInIDP(\n\t\t\tcontext.db,\n\t\t\targs.identityProvider,\n\t\t\targs.data ?? {\n\t\t\t\tsessionData: args.sessionData,\n\t\t\t\turl: args.idpResponse?.url,\n\t\t\t\tredirectUrl: args.redirectUrl,\n\t\t\t},\n\t\t\targs.expiration ?? undefined,\n\t\t)\n\t\tif (!signIn.ok) {\n\t\t\treturn createErrorResponse(signIn.error, signIn.errorMessage)\n\t\t}\n\t\treturn {\n\t\t\tok: true,\n\t\t\terrors: [],\n\t\t\tresult: {\n\t\t\t\t...await this.signInResponseFactory.createResponse(signIn.result, context),\n\t\t\t\tidpResponse: signIn.result.idpResponse,\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":["PermissionActions","createErrorResponse"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAYO,MAAM,oBAAiD;AAAA,EAC7D,YACkB,kBACA,uBAChB;AAFgB,SAAA,mBAAA;AACA,SAAA,wBAAA;AAAA,EACf;AAAA,EAEH,MAAM,cACL,QACA,MACA,SACiC;AACjC,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQA,kBAAkB,kBAAA;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACK,UAAA,SAAS,MAAM,KAAK,iBAAiB,cAAc,QAAQ,IAAI,KAAK,kBAAkB,KAAK,QAAQ;AAAA,MACxG,aAAa,KAAK;AAAA,IAAA,CAClB;AACG,QAAA,CAAC,OAAO,IAAI;AACf,aAAOC,WAAoB,oBAAA,OAAO,OAAO,OAAO,YAAY;AAAA,IAC7D;AACO,WAAA,EAAE,IAAI,MAAM,QAAQ,CAAI,GAAA,QAAQ,OAAO;EAC/C;AAAA,EAEA,MAAM,UAAU,QAAa,MAA6B,SAA4D;AACrH,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQD,kBAAkB,kBAAA;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACK,UAAA,SAAS,MAAM,KAAK,iBAAiB;AAAA,MAC1C,QAAQ;AAAA,MACR,KAAK;AAAA,MACL,KAAK,QAAQ;AAAA,QACZ,aAAa,KAAK;AAAA,QAClB,KAAK,KAAK,aAAa;AAAA,QACvB,aAAa,KAAK;AAAA,MACnB;AAAA,MACA,KAAK,cAAc;AAAA,IAAA;AAEhB,QAAA,CAAC,OAAO,IAAI;AACf,aAAOC,WAAoB,oBAAA,OAAO,OAAO,OAAO,YAAY;AAAA,IAC7D;AACO,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ,CAAC;AAAA,MACT,QAAQ;AAAA,QACP,GAAG,MAAM,KAAK,sBAAsB,eAAe,OAAO,QAAQ,OAAO;AAAA,QACzE,aAAa,OAAO,OAAO;AAAA,MAC5B;AAAA,IAAA;AAAA,EAEF;AACD;;"}
1
+ {"version":3,"file":"IDPMutationResolver.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/person/IDPMutationResolver.ts"],"sourcesContent":["import {\n\tInitSignInIdpResponse,\n\tMutationInitSignInIdpArgs,\n\tMutationResolvers,\n\tMutationSignInIdpArgs,\n\tSignInIdpResponse,\n} from '../../../schema'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { IDPSignInManager, PermissionActions } from '../../../model'\nimport { createErrorResponse } from '../../errorUtils'\nimport { SignInResponseFactory } from '../../responseHelpers/SignInResponseFactory'\n\nexport class IDPMutationResolver implements MutationResolvers {\n\tconstructor(\n\t\tprivate readonly idpSignInManager: IDPSignInManager,\n\t\tprivate readonly signInResponseFactory: SignInResponseFactory,\n\t) {}\n\n\tasync initSignInIDP(\n\t\tparent: any,\n\t\targs: MutationInitSignInIdpArgs,\n\t\tcontext: TenantResolverContext,\n\t): Promise<InitSignInIdpResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.PERSON_CREATE_IDP_URL,\n\t\t\tmessage: 'You are not allowed to create a redirect URL for IDP',\n\t\t})\n\t\tconst result = await this.idpSignInManager.initSignInIDP(context.db, args.identityProvider, args.data ?? {\n\t\t\tredirectUrl: args.redirectUrl,\n\t\t})\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\t\treturn { ok: true, errors: [], result: result.result }\n\t}\n\n\tasync signInIDP(parent: any, args: MutationSignInIdpArgs, context: TenantResolverContext): Promise<SignInIdpResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.PERSON_SIGN_IN_IDP,\n\t\t\tmessage: 'You are not allowed to person IDP sign in',\n\t\t})\n\t\tconst signIn = await this.idpSignInManager.signInIDP(\n\t\t\tcontext.db,\n\t\t\targs.identityProvider,\n\t\t\targs.data ?? {\n\t\t\t\tsessionData: args.sessionData,\n\t\t\t\turl: args.idpResponse?.url,\n\t\t\t\tredirectUrl: args.redirectUrl,\n\t\t\t},\n\t\t\targs.expiration ?? undefined,\n\t\t)\n\t\tif (!signIn.ok) {\n\t\t\treturn createErrorResponse(signIn.error, signIn.errorMessage)\n\t\t}\n\t\treturn {\n\t\t\tok: true,\n\t\t\terrors: [],\n\t\t\tresult: {\n\t\t\t\t...await this.signInResponseFactory.createResponse(signIn.result, context),\n\t\t\t\tidpResponse: signIn.result.idpResponse,\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":["PermissionActions","createErrorResponse"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAYO,MAAM,oBAAiD;AAAA,EAC7D,YACkB,kBACA,uBAChB;AAFgB,SAAA,mBAAA;AACA,SAAA,wBAAA;AAAA,EAAA;AAAA,EAGlB,MAAM,cACL,QACA,MACA,SACiC;AACjC,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQA,kBAAkB,kBAAA;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACK,UAAA,SAAS,MAAM,KAAK,iBAAiB,cAAc,QAAQ,IAAI,KAAK,kBAAkB,KAAK,QAAQ;AAAA,MACxG,aAAa,KAAK;AAAA,IAAA,CAClB;AACG,QAAA,CAAC,OAAO,IAAI;AACf,aAAOC,WAAoB,oBAAA,OAAO,OAAO,OAAO,YAAY;AAAA,IAAA;AAEtD,WAAA,EAAE,IAAI,MAAM,QAAQ,CAAA,GAAI,QAAQ,OAAO,OAAO;AAAA,EAAA;AAAA,EAGtD,MAAM,UAAU,QAAa,MAA6B,SAA4D;AACrH,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQD,kBAAkB,kBAAA;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACK,UAAA,SAAS,MAAM,KAAK,iBAAiB;AAAA,MAC1C,QAAQ;AAAA,MACR,KAAK;AAAA,MACL,KAAK,QAAQ;AAAA,QACZ,aAAa,KAAK;AAAA,QAClB,KAAK,KAAK,aAAa;AAAA,QACvB,aAAa,KAAK;AAAA,MACnB;AAAA,MACA,KAAK,cAAc;AAAA,IACpB;AACI,QAAA,CAAC,OAAO,IAAI;AACf,aAAOC,WAAoB,oBAAA,OAAO,OAAO,OAAO,YAAY;AAAA,IAAA;AAEtD,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ,CAAC;AAAA,MACT,QAAQ;AAAA,QACP,GAAG,MAAM,KAAK,sBAAsB,eAAe,OAAO,QAAQ,OAAO;AAAA,QACzE,aAAa,OAAO,OAAO;AAAA,MAAA;AAAA,IAE7B;AAAA,EAAA;AAEF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"IDPMutationResolver.js","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/person/IDPMutationResolver.ts"],"sourcesContent":["import {\n\tInitSignInIdpResponse,\n\tMutationInitSignInIdpArgs,\n\tMutationResolvers,\n\tMutationSignInIdpArgs,\n\tSignInIdpResponse,\n} from '../../../schema'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { IDPSignInManager, PermissionActions } from '../../../model'\nimport { createErrorResponse } from '../../errorUtils'\nimport { SignInResponseFactory } from '../../responseHelpers/SignInResponseFactory'\n\nexport class IDPMutationResolver implements MutationResolvers {\n\tconstructor(\n\t\tprivate readonly idpSignInManager: IDPSignInManager,\n\t\tprivate readonly signInResponseFactory: SignInResponseFactory,\n\t) {}\n\n\tasync initSignInIDP(\n\t\tparent: any,\n\t\targs: MutationInitSignInIdpArgs,\n\t\tcontext: TenantResolverContext,\n\t): Promise<InitSignInIdpResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.PERSON_CREATE_IDP_URL,\n\t\t\tmessage: 'You are not allowed to create a redirect URL for IDP',\n\t\t})\n\t\tconst result = await this.idpSignInManager.initSignInIDP(context.db, args.identityProvider, args.data ?? {\n\t\t\tredirectUrl: args.redirectUrl,\n\t\t})\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\t\treturn { ok: true, errors: [], result: result.result }\n\t}\n\n\tasync signInIDP(parent: any, args: MutationSignInIdpArgs, context: TenantResolverContext): Promise<SignInIdpResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.PERSON_SIGN_IN_IDP,\n\t\t\tmessage: 'You are not allowed to person IDP sign in',\n\t\t})\n\t\tconst signIn = await this.idpSignInManager.signInIDP(\n\t\t\tcontext.db,\n\t\t\targs.identityProvider,\n\t\t\targs.data ?? {\n\t\t\t\tsessionData: args.sessionData,\n\t\t\t\turl: args.idpResponse?.url,\n\t\t\t\tredirectUrl: args.redirectUrl,\n\t\t\t},\n\t\t\targs.expiration ?? undefined,\n\t\t)\n\t\tif (!signIn.ok) {\n\t\t\treturn createErrorResponse(signIn.error, signIn.errorMessage)\n\t\t}\n\t\treturn {\n\t\t\tok: true,\n\t\t\terrors: [],\n\t\t\tresult: {\n\t\t\t\t...await this.signInResponseFactory.createResponse(signIn.result, context),\n\t\t\t\tidpResponse: signIn.result.idpResponse,\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAYO,MAAM,oBAAiD;AAAA,EAC7D,YACkB,kBACA,uBAChB;AAFgB,SAAA,mBAAA;AACA,SAAA,wBAAA;AAAA,EACf;AAAA,EAEH,MAAM,cACL,QACA,MACA,SACiC;AACjC,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQ,kBAAkB;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACK,UAAA,SAAS,MAAM,KAAK,iBAAiB,cAAc,QAAQ,IAAI,KAAK,kBAAkB,KAAK,QAAQ;AAAA,MACxG,aAAa,KAAK;AAAA,IAAA,CAClB;AACG,QAAA,CAAC,OAAO,IAAI;AACf,aAAO,oBAAoB,OAAO,OAAO,OAAO,YAAY;AAAA,IAC7D;AACO,WAAA,EAAE,IAAI,MAAM,QAAQ,CAAI,GAAA,QAAQ,OAAO;EAC/C;AAAA,EAEA,MAAM,UAAU,QAAa,MAA6B,SAA4D;AACrH,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQ,kBAAkB;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACK,UAAA,SAAS,MAAM,KAAK,iBAAiB;AAAA,MAC1C,QAAQ;AAAA,MACR,KAAK;AAAA,MACL,KAAK,QAAQ;AAAA,QACZ,aAAa,KAAK;AAAA,QAClB,KAAK,KAAK,aAAa;AAAA,QACvB,aAAa,KAAK;AAAA,MACnB;AAAA,MACA,KAAK,cAAc;AAAA,IAAA;AAEhB,QAAA,CAAC,OAAO,IAAI;AACf,aAAO,oBAAoB,OAAO,OAAO,OAAO,YAAY;AAAA,IAC7D;AACO,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ,CAAC;AAAA,MACT,QAAQ;AAAA,QACP,GAAG,MAAM,KAAK,sBAAsB,eAAe,OAAO,QAAQ,OAAO;AAAA,QACzE,aAAa,OAAO,OAAO;AAAA,MAC5B;AAAA,IAAA;AAAA,EAEF;AACD;"}
1
+ {"version":3,"file":"IDPMutationResolver.js","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/person/IDPMutationResolver.ts"],"sourcesContent":["import {\n\tInitSignInIdpResponse,\n\tMutationInitSignInIdpArgs,\n\tMutationResolvers,\n\tMutationSignInIdpArgs,\n\tSignInIdpResponse,\n} from '../../../schema'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { IDPSignInManager, PermissionActions } from '../../../model'\nimport { createErrorResponse } from '../../errorUtils'\nimport { SignInResponseFactory } from '../../responseHelpers/SignInResponseFactory'\n\nexport class IDPMutationResolver implements MutationResolvers {\n\tconstructor(\n\t\tprivate readonly idpSignInManager: IDPSignInManager,\n\t\tprivate readonly signInResponseFactory: SignInResponseFactory,\n\t) {}\n\n\tasync initSignInIDP(\n\t\tparent: any,\n\t\targs: MutationInitSignInIdpArgs,\n\t\tcontext: TenantResolverContext,\n\t): Promise<InitSignInIdpResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.PERSON_CREATE_IDP_URL,\n\t\t\tmessage: 'You are not allowed to create a redirect URL for IDP',\n\t\t})\n\t\tconst result = await this.idpSignInManager.initSignInIDP(context.db, args.identityProvider, args.data ?? {\n\t\t\tredirectUrl: args.redirectUrl,\n\t\t})\n\t\tif (!result.ok) {\n\t\t\treturn createErrorResponse(result.error, result.errorMessage)\n\t\t}\n\t\treturn { ok: true, errors: [], result: result.result }\n\t}\n\n\tasync signInIDP(parent: any, args: MutationSignInIdpArgs, context: TenantResolverContext): Promise<SignInIdpResponse> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.PERSON_SIGN_IN_IDP,\n\t\t\tmessage: 'You are not allowed to person IDP sign in',\n\t\t})\n\t\tconst signIn = await this.idpSignInManager.signInIDP(\n\t\t\tcontext.db,\n\t\t\targs.identityProvider,\n\t\t\targs.data ?? {\n\t\t\t\tsessionData: args.sessionData,\n\t\t\t\turl: args.idpResponse?.url,\n\t\t\t\tredirectUrl: args.redirectUrl,\n\t\t\t},\n\t\t\targs.expiration ?? undefined,\n\t\t)\n\t\tif (!signIn.ok) {\n\t\t\treturn createErrorResponse(signIn.error, signIn.errorMessage)\n\t\t}\n\t\treturn {\n\t\t\tok: true,\n\t\t\terrors: [],\n\t\t\tresult: {\n\t\t\t\t...await this.signInResponseFactory.createResponse(signIn.result, context),\n\t\t\t\tidpResponse: signIn.result.idpResponse,\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAYO,MAAM,oBAAiD;AAAA,EAC7D,YACkB,kBACA,uBAChB;AAFgB,SAAA,mBAAA;AACA,SAAA,wBAAA;AAAA,EAAA;AAAA,EAGlB,MAAM,cACL,QACA,MACA,SACiC;AACjC,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQ,kBAAkB;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACK,UAAA,SAAS,MAAM,KAAK,iBAAiB,cAAc,QAAQ,IAAI,KAAK,kBAAkB,KAAK,QAAQ;AAAA,MACxG,aAAa,KAAK;AAAA,IAAA,CAClB;AACG,QAAA,CAAC,OAAO,IAAI;AACf,aAAO,oBAAoB,OAAO,OAAO,OAAO,YAAY;AAAA,IAAA;AAEtD,WAAA,EAAE,IAAI,MAAM,QAAQ,CAAA,GAAI,QAAQ,OAAO,OAAO;AAAA,EAAA;AAAA,EAGtD,MAAM,UAAU,QAAa,MAA6B,SAA4D;AACrH,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQ,kBAAkB;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACK,UAAA,SAAS,MAAM,KAAK,iBAAiB;AAAA,MAC1C,QAAQ;AAAA,MACR,KAAK;AAAA,MACL,KAAK,QAAQ;AAAA,QACZ,aAAa,KAAK;AAAA,QAClB,KAAK,KAAK,aAAa;AAAA,QACvB,aAAa,KAAK;AAAA,MACnB;AAAA,MACA,KAAK,cAAc;AAAA,IACpB;AACI,QAAA,CAAC,OAAO,IAAI;AACf,aAAO,oBAAoB,OAAO,OAAO,OAAO,YAAY;AAAA,IAAA;AAEtD,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ,CAAC;AAAA,MACT,QAAQ;AAAA,QACP,GAAG,MAAM,KAAK,sBAAsB,eAAe,OAAO,QAAQ,OAAO;AAAA,QACzE,aAAa,OAAO,OAAO;AAAA,MAAA;AAAA,IAE7B;AAAA,EAAA;AAEF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"InviteMutationResolver.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/person/InviteMutationResolver.ts"],"sourcesContent":["import { InviteErrorCode, InviteResponse, MutationInviteArgs, MutationResolvers, MutationUnmanagedInviteArgs } from '../../../schema'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport {\n\tDatabaseContext,\n\tInviteData,\n\tInviteManager,\n\tisTokenHash,\n\tMembershipValidator,\n\tPermissionActions,\n\tProjectManager,\n} from '../../../model'\nimport { createMembershipValidationErrorResult } from '../../membershipUtils'\nimport { createErrorResponse, createProjectNotFoundResponse } from '../../errorUtils'\nimport { UserInputError } from '@contember/graphql-utils'\nimport { PersonResponseFactory } from '../../responseHelpers/PersonResponseFactory'\n\nexport class InviteMutationResolver implements MutationResolvers {\n\tconstructor(\n\t\tprivate readonly inviteManager: InviteManager,\n\t\tprivate readonly projectManager: ProjectManager,\n\t\tprivate readonly membershipValidator: MembershipValidator,\n\t) {}\n\n\tasync invite(\n\t\tparent: any,\n\t\t{ projectSlug, email, name, memberships, options }: MutationInviteArgs,\n\t\tcontext: TenantResolverContext,\n\t): Promise<InviteResponse> {\n\t\tconst project = await this.projectManager.getProjectBySlug(context.db, projectSlug)\n\t\tawait context.requireAccess({\n\t\t\tscope: await context.permissionContext.createProjectScope(project),\n\t\t\taction: PermissionActions.PERSON_INVITE(memberships),\n\t\t\tmessage: 'You are not allowed to invite a person',\n\t\t})\n\t\tif (!project) {\n\t\t\treturn createProjectNotFoundResponse('PROJECT_NOT_FOUND', projectSlug)\n\t\t}\n\t\treturn this.doInvite(context.db, {\n\t\t\temail,\n\t\t\tproject,\n\t\t\tmemberships,\n\t\t\tname: name ?? undefined,\n\t\t\temailVariant: options?.mailVariant || '',\n\t\t\tmethod: options?.method ?? 'CREATE_PASSWORD',\n\t\t})\n\t}\n\n\tasync unmanagedInvite(\n\t\tparent: any,\n\t\t{ projectSlug, email, memberships, password, options }: MutationUnmanagedInviteArgs,\n\t\tcontext: TenantResolverContext,\n\t): Promise<InviteResponse> {\n\t\tconst project = await this.projectManager.getProjectBySlug(context.db, projectSlug)\n\t\tawait context.requireAccess({\n\t\t\tscope: await context.permissionContext.createProjectScope(project),\n\t\t\taction: PermissionActions.PERSON_INVITE_UNMANAGED(memberships),\n\t\t\tmessage: 'You are not allowed to unmanaged person invite',\n\t\t})\n\t\tif (!project) {\n\t\t\treturn createProjectNotFoundResponse('PROJECT_NOT_FOUND', projectSlug)\n\t\t}\n\t\tif (typeof options?.resetTokenHash === 'string' && !isTokenHash(options?.resetTokenHash)) {\n\t\t\tthrow new UserInputError('Invalid format of resetTokenHash. Must be hex-encoded sha256.')\n\t\t}\n\t\treturn this.doInvite(context.db, {\n\t\t\temail,\n\t\t\tproject,\n\t\t\tmemberships,\n\t\t\tnoEmail: true,\n\t\t\tpassword: password ?? options?.password ?? undefined,\n\t\t\tpasswordResetTokenHash: options?.resetTokenHash ?? undefined,\n\t\t})\n\t}\n\n\tprivate async doInvite(\n\t\tdbContext: DatabaseContext,\n\t\tinvite: InviteData,\n\t): Promise<InviteResponse> {\n\t\tconst validationResult = await this.membershipValidator.validate(invite.project.slug, invite.memberships)\n\t\tif (validationResult.length > 0) {\n\t\t\tconst errors = createMembershipValidationErrorResult(validationResult)\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\terrors: errors,\n\t\t\t\terror: errors[0],\n\t\t\t}\n\t\t}\n\t\tconst response = await this.inviteManager.invite(dbContext, invite)\n\n\t\tif (!response.ok) {\n\t\t\treturn createErrorResponse(response.error, response.errorMessage)\n\t\t}\n\t\tconst result = response.result\n\n\t\treturn {\n\t\t\tok: true,\n\t\t\terrors: [],\n\t\t\tresult: {\n\t\t\t\tperson: PersonResponseFactory.createPersonResponse(result.person),\n\t\t\t\tisNew: result.isNew,\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":["PermissionActions","createProjectNotFoundResponse","isTokenHash","UserInputError","createMembershipValidationErrorResult","createErrorResponse","PersonResponseFactory"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAgBO,MAAM,uBAAoD;AAAA,EAChE,YACkB,eACA,gBACA,qBAChB;AAHgB,SAAA,gBAAA;AACA,SAAA,iBAAA;AACA,SAAA,sBAAA;AAAA,EACf;AAAA,EAEH,MAAM,OACL,QACA,EAAE,aAAa,OAAO,MAAM,aAAa,QAAQ,GACjD,SAC0B;AAC1B,UAAM,UAAU,MAAM,KAAK,eAAe,iBAAiB,QAAQ,IAAI,WAAW;AAClF,UAAM,QAAQ,cAAc;AAAA,MAC3B,OAAO,MAAM,QAAQ,kBAAkB,mBAAmB,OAAO;AAAA,MACjE,QAAQA,kBAAAA,kBAAkB,cAAc,WAAW;AAAA,MACnD,SAAS;AAAA,IAAA,CACT;AACD,QAAI,CAAC,SAAS;AACN,aAAAC,WAAA,8BAA8B,qBAAqB,WAAW;AAAA,IACtE;AACO,WAAA,KAAK,SAAS,QAAQ,IAAI;AAAA,MAChC;AAAA,MACA;AAAA,MACA;AAAA,MACA,MAAM,QAAQ;AAAA,MACd,cAAc,SAAS,eAAe;AAAA,MACtC,QAAQ,SAAS,UAAU;AAAA,IAAA,CAC3B;AAAA,EACF;AAAA,EAEA,MAAM,gBACL,QACA,EAAE,aAAa,OAAO,aAAa,UAAU,QAAQ,GACrD,SAC0B;AAC1B,UAAM,UAAU,MAAM,KAAK,eAAe,iBAAiB,QAAQ,IAAI,WAAW;AAClF,UAAM,QAAQ,cAAc;AAAA,MAC3B,OAAO,MAAM,QAAQ,kBAAkB,mBAAmB,OAAO;AAAA,MACjE,QAAQD,kBAAAA,kBAAkB,wBAAwB,WAAW;AAAA,MAC7D,SAAS;AAAA,IAAA,CACT;AACD,QAAI,CAAC,SAAS;AACN,aAAAC,WAAA,8BAA8B,qBAAqB,WAAW;AAAA,IACtE;AACI,QAAA,OAAO,SAAS,mBAAmB,YAAY,CAACC,uBAAY,SAAS,cAAc,GAAG;AACnF,YAAA,IAAIC,aAAAA,eAAe,+DAA+D;AAAA,IACzF;AACO,WAAA,KAAK,SAAS,QAAQ,IAAI;AAAA,MAChC;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS;AAAA,MACT,UAAU,YAAY,SAAS,YAAY;AAAA,MAC3C,wBAAwB,SAAS,kBAAkB;AAAA,IAAA,CACnD;AAAA,EACF;AAAA,EAEA,MAAc,SACb,WACA,QAC0B;AACpB,UAAA,mBAAmB,MAAM,KAAK,oBAAoB,SAAS,OAAO,QAAQ,MAAM,OAAO,WAAW;AACpG,QAAA,iBAAiB,SAAS,GAAG;AAC1B,YAAA,SAASC,sDAAsC,gBAAgB;AAC9D,aAAA;AAAA,QACN,IAAI;AAAA,QACJ;AAAA,QACA,OAAO,OAAO,CAAC;AAAA,MAAA;AAAA,IAEjB;AACA,UAAM,WAAW,MAAM,KAAK,cAAc,OAAO,WAAW,MAAM;AAE9D,QAAA,CAAC,SAAS,IAAI;AACjB,aAAOC,WAAoB,oBAAA,SAAS,OAAO,SAAS,YAAY;AAAA,IACjE;AACA,UAAM,SAAS,SAAS;AAEjB,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ,CAAC;AAAA,MACT,QAAQ;AAAA,QACP,QAAQC,sBAAA,sBAAsB,qBAAqB,OAAO,MAAM;AAAA,QAChE,OAAO,OAAO;AAAA,MACf;AAAA,IAAA;AAAA,EAEF;AACD;;"}
1
+ {"version":3,"file":"InviteMutationResolver.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/person/InviteMutationResolver.ts"],"sourcesContent":["import { InviteErrorCode, InviteResponse, MutationInviteArgs, MutationResolvers, MutationUnmanagedInviteArgs } from '../../../schema'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport {\n\tDatabaseContext,\n\tInviteData,\n\tInviteManager,\n\tisTokenHash,\n\tMembershipValidator,\n\tPermissionActions,\n\tProjectManager,\n} from '../../../model'\nimport { createMembershipValidationErrorResult } from '../../membershipUtils'\nimport { createErrorResponse, createProjectNotFoundResponse } from '../../errorUtils'\nimport { UserInputError } from '@contember/graphql-utils'\nimport { PersonResponseFactory } from '../../responseHelpers/PersonResponseFactory'\n\nexport class InviteMutationResolver implements MutationResolvers {\n\tconstructor(\n\t\tprivate readonly inviteManager: InviteManager,\n\t\tprivate readonly projectManager: ProjectManager,\n\t\tprivate readonly membershipValidator: MembershipValidator,\n\t) {}\n\n\tasync invite(\n\t\tparent: any,\n\t\t{ projectSlug, email, name, memberships, options }: MutationInviteArgs,\n\t\tcontext: TenantResolverContext,\n\t): Promise<InviteResponse> {\n\t\tconst project = await this.projectManager.getProjectBySlug(context.db, projectSlug)\n\t\tawait context.requireAccess({\n\t\t\tscope: await context.permissionContext.createProjectScope(project),\n\t\t\taction: PermissionActions.PERSON_INVITE(memberships),\n\t\t\tmessage: 'You are not allowed to invite a person',\n\t\t})\n\t\tif (!project) {\n\t\t\treturn createProjectNotFoundResponse('PROJECT_NOT_FOUND', projectSlug)\n\t\t}\n\t\treturn this.doInvite(context.db, {\n\t\t\temail,\n\t\t\tproject,\n\t\t\tmemberships,\n\t\t\tname: name ?? undefined,\n\t\t\temailVariant: options?.mailVariant || '',\n\t\t\tmethod: options?.method ?? 'CREATE_PASSWORD',\n\t\t})\n\t}\n\n\tasync unmanagedInvite(\n\t\tparent: any,\n\t\t{ projectSlug, email, memberships, password, options }: MutationUnmanagedInviteArgs,\n\t\tcontext: TenantResolverContext,\n\t): Promise<InviteResponse> {\n\t\tconst project = await this.projectManager.getProjectBySlug(context.db, projectSlug)\n\t\tawait context.requireAccess({\n\t\t\tscope: await context.permissionContext.createProjectScope(project),\n\t\t\taction: PermissionActions.PERSON_INVITE_UNMANAGED(memberships),\n\t\t\tmessage: 'You are not allowed to unmanaged person invite',\n\t\t})\n\t\tif (!project) {\n\t\t\treturn createProjectNotFoundResponse('PROJECT_NOT_FOUND', projectSlug)\n\t\t}\n\t\tif (typeof options?.resetTokenHash === 'string' && !isTokenHash(options?.resetTokenHash)) {\n\t\t\tthrow new UserInputError('Invalid format of resetTokenHash. Must be hex-encoded sha256.')\n\t\t}\n\t\treturn this.doInvite(context.db, {\n\t\t\temail,\n\t\t\tproject,\n\t\t\tmemberships,\n\t\t\tnoEmail: true,\n\t\t\tpassword: password ?? options?.password ?? undefined,\n\t\t\tpasswordResetTokenHash: options?.resetTokenHash ?? undefined,\n\t\t})\n\t}\n\n\tprivate async doInvite(\n\t\tdbContext: DatabaseContext,\n\t\tinvite: InviteData,\n\t): Promise<InviteResponse> {\n\t\tconst validationResult = await this.membershipValidator.validate(invite.project.slug, invite.memberships)\n\t\tif (validationResult.length > 0) {\n\t\t\tconst errors = createMembershipValidationErrorResult(validationResult)\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\terrors: errors,\n\t\t\t\terror: errors[0],\n\t\t\t}\n\t\t}\n\t\tconst response = await this.inviteManager.invite(dbContext, invite)\n\n\t\tif (!response.ok) {\n\t\t\treturn createErrorResponse(response.error, response.errorMessage)\n\t\t}\n\t\tconst result = response.result\n\n\t\treturn {\n\t\t\tok: true,\n\t\t\terrors: [],\n\t\t\tresult: {\n\t\t\t\tperson: PersonResponseFactory.createPersonResponse(result.person),\n\t\t\t\tisNew: result.isNew,\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":["PermissionActions","createProjectNotFoundResponse","isTokenHash","UserInputError","createMembershipValidationErrorResult","createErrorResponse","PersonResponseFactory"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAgBO,MAAM,uBAAoD;AAAA,EAChE,YACkB,eACA,gBACA,qBAChB;AAHgB,SAAA,gBAAA;AACA,SAAA,iBAAA;AACA,SAAA,sBAAA;AAAA,EAAA;AAAA,EAGlB,MAAM,OACL,QACA,EAAE,aAAa,OAAO,MAAM,aAAa,QAAQ,GACjD,SAC0B;AAC1B,UAAM,UAAU,MAAM,KAAK,eAAe,iBAAiB,QAAQ,IAAI,WAAW;AAClF,UAAM,QAAQ,cAAc;AAAA,MAC3B,OAAO,MAAM,QAAQ,kBAAkB,mBAAmB,OAAO;AAAA,MACjE,QAAQA,kBAAAA,kBAAkB,cAAc,WAAW;AAAA,MACnD,SAAS;AAAA,IAAA,CACT;AACD,QAAI,CAAC,SAAS;AACN,aAAAC,WAAA,8BAA8B,qBAAqB,WAAW;AAAA,IAAA;AAE/D,WAAA,KAAK,SAAS,QAAQ,IAAI;AAAA,MAChC;AAAA,MACA;AAAA,MACA;AAAA,MACA,MAAM,QAAQ;AAAA,MACd,cAAc,SAAS,eAAe;AAAA,MACtC,QAAQ,SAAS,UAAU;AAAA,IAAA,CAC3B;AAAA,EAAA;AAAA,EAGF,MAAM,gBACL,QACA,EAAE,aAAa,OAAO,aAAa,UAAU,QAAQ,GACrD,SAC0B;AAC1B,UAAM,UAAU,MAAM,KAAK,eAAe,iBAAiB,QAAQ,IAAI,WAAW;AAClF,UAAM,QAAQ,cAAc;AAAA,MAC3B,OAAO,MAAM,QAAQ,kBAAkB,mBAAmB,OAAO;AAAA,MACjE,QAAQD,kBAAAA,kBAAkB,wBAAwB,WAAW;AAAA,MAC7D,SAAS;AAAA,IAAA,CACT;AACD,QAAI,CAAC,SAAS;AACN,aAAAC,WAAA,8BAA8B,qBAAqB,WAAW;AAAA,IAAA;AAElE,QAAA,OAAO,SAAS,mBAAmB,YAAY,CAACC,uBAAY,SAAS,cAAc,GAAG;AACnF,YAAA,IAAIC,4BAAe,+DAA+D;AAAA,IAAA;AAElF,WAAA,KAAK,SAAS,QAAQ,IAAI;AAAA,MAChC;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS;AAAA,MACT,UAAU,YAAY,SAAS,YAAY;AAAA,MAC3C,wBAAwB,SAAS,kBAAkB;AAAA,IAAA,CACnD;AAAA,EAAA;AAAA,EAGF,MAAc,SACb,WACA,QAC0B;AACpB,UAAA,mBAAmB,MAAM,KAAK,oBAAoB,SAAS,OAAO,QAAQ,MAAM,OAAO,WAAW;AACpG,QAAA,iBAAiB,SAAS,GAAG;AAC1B,YAAA,SAASC,sDAAsC,gBAAgB;AAC9D,aAAA;AAAA,QACN,IAAI;AAAA,QACJ;AAAA,QACA,OAAO,OAAO,CAAC;AAAA,MAChB;AAAA,IAAA;AAED,UAAM,WAAW,MAAM,KAAK,cAAc,OAAO,WAAW,MAAM;AAE9D,QAAA,CAAC,SAAS,IAAI;AACjB,aAAOC,WAAoB,oBAAA,SAAS,OAAO,SAAS,YAAY;AAAA,IAAA;AAEjE,UAAM,SAAS,SAAS;AAEjB,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ,CAAC;AAAA,MACT,QAAQ;AAAA,QACP,QAAQC,sBAAA,sBAAsB,qBAAqB,OAAO,MAAM;AAAA,QAChE,OAAO,OAAO;AAAA,MAAA;AAAA,IAEhB;AAAA,EAAA;AAEF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"InviteMutationResolver.js","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/person/InviteMutationResolver.ts"],"sourcesContent":["import { InviteErrorCode, InviteResponse, MutationInviteArgs, MutationResolvers, MutationUnmanagedInviteArgs } from '../../../schema'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport {\n\tDatabaseContext,\n\tInviteData,\n\tInviteManager,\n\tisTokenHash,\n\tMembershipValidator,\n\tPermissionActions,\n\tProjectManager,\n} from '../../../model'\nimport { createMembershipValidationErrorResult } from '../../membershipUtils'\nimport { createErrorResponse, createProjectNotFoundResponse } from '../../errorUtils'\nimport { UserInputError } from '@contember/graphql-utils'\nimport { PersonResponseFactory } from '../../responseHelpers/PersonResponseFactory'\n\nexport class InviteMutationResolver implements MutationResolvers {\n\tconstructor(\n\t\tprivate readonly inviteManager: InviteManager,\n\t\tprivate readonly projectManager: ProjectManager,\n\t\tprivate readonly membershipValidator: MembershipValidator,\n\t) {}\n\n\tasync invite(\n\t\tparent: any,\n\t\t{ projectSlug, email, name, memberships, options }: MutationInviteArgs,\n\t\tcontext: TenantResolverContext,\n\t): Promise<InviteResponse> {\n\t\tconst project = await this.projectManager.getProjectBySlug(context.db, projectSlug)\n\t\tawait context.requireAccess({\n\t\t\tscope: await context.permissionContext.createProjectScope(project),\n\t\t\taction: PermissionActions.PERSON_INVITE(memberships),\n\t\t\tmessage: 'You are not allowed to invite a person',\n\t\t})\n\t\tif (!project) {\n\t\t\treturn createProjectNotFoundResponse('PROJECT_NOT_FOUND', projectSlug)\n\t\t}\n\t\treturn this.doInvite(context.db, {\n\t\t\temail,\n\t\t\tproject,\n\t\t\tmemberships,\n\t\t\tname: name ?? undefined,\n\t\t\temailVariant: options?.mailVariant || '',\n\t\t\tmethod: options?.method ?? 'CREATE_PASSWORD',\n\t\t})\n\t}\n\n\tasync unmanagedInvite(\n\t\tparent: any,\n\t\t{ projectSlug, email, memberships, password, options }: MutationUnmanagedInviteArgs,\n\t\tcontext: TenantResolverContext,\n\t): Promise<InviteResponse> {\n\t\tconst project = await this.projectManager.getProjectBySlug(context.db, projectSlug)\n\t\tawait context.requireAccess({\n\t\t\tscope: await context.permissionContext.createProjectScope(project),\n\t\t\taction: PermissionActions.PERSON_INVITE_UNMANAGED(memberships),\n\t\t\tmessage: 'You are not allowed to unmanaged person invite',\n\t\t})\n\t\tif (!project) {\n\t\t\treturn createProjectNotFoundResponse('PROJECT_NOT_FOUND', projectSlug)\n\t\t}\n\t\tif (typeof options?.resetTokenHash === 'string' && !isTokenHash(options?.resetTokenHash)) {\n\t\t\tthrow new UserInputError('Invalid format of resetTokenHash. Must be hex-encoded sha256.')\n\t\t}\n\t\treturn this.doInvite(context.db, {\n\t\t\temail,\n\t\t\tproject,\n\t\t\tmemberships,\n\t\t\tnoEmail: true,\n\t\t\tpassword: password ?? options?.password ?? undefined,\n\t\t\tpasswordResetTokenHash: options?.resetTokenHash ?? undefined,\n\t\t})\n\t}\n\n\tprivate async doInvite(\n\t\tdbContext: DatabaseContext,\n\t\tinvite: InviteData,\n\t): Promise<InviteResponse> {\n\t\tconst validationResult = await this.membershipValidator.validate(invite.project.slug, invite.memberships)\n\t\tif (validationResult.length > 0) {\n\t\t\tconst errors = createMembershipValidationErrorResult(validationResult)\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\terrors: errors,\n\t\t\t\terror: errors[0],\n\t\t\t}\n\t\t}\n\t\tconst response = await this.inviteManager.invite(dbContext, invite)\n\n\t\tif (!response.ok) {\n\t\t\treturn createErrorResponse(response.error, response.errorMessage)\n\t\t}\n\t\tconst result = response.result\n\n\t\treturn {\n\t\t\tok: true,\n\t\t\terrors: [],\n\t\t\tresult: {\n\t\t\t\tperson: PersonResponseFactory.createPersonResponse(result.person),\n\t\t\t\tisNew: result.isNew,\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAgBO,MAAM,uBAAoD;AAAA,EAChE,YACkB,eACA,gBACA,qBAChB;AAHgB,SAAA,gBAAA;AACA,SAAA,iBAAA;AACA,SAAA,sBAAA;AAAA,EACf;AAAA,EAEH,MAAM,OACL,QACA,EAAE,aAAa,OAAO,MAAM,aAAa,QAAQ,GACjD,SAC0B;AAC1B,UAAM,UAAU,MAAM,KAAK,eAAe,iBAAiB,QAAQ,IAAI,WAAW;AAClF,UAAM,QAAQ,cAAc;AAAA,MAC3B,OAAO,MAAM,QAAQ,kBAAkB,mBAAmB,OAAO;AAAA,MACjE,QAAQ,kBAAkB,cAAc,WAAW;AAAA,MACnD,SAAS;AAAA,IAAA,CACT;AACD,QAAI,CAAC,SAAS;AACN,aAAA,8BAA8B,qBAAqB,WAAW;AAAA,IACtE;AACO,WAAA,KAAK,SAAS,QAAQ,IAAI;AAAA,MAChC;AAAA,MACA;AAAA,MACA;AAAA,MACA,MAAM,QAAQ;AAAA,MACd,cAAc,SAAS,eAAe;AAAA,MACtC,QAAQ,SAAS,UAAU;AAAA,IAAA,CAC3B;AAAA,EACF;AAAA,EAEA,MAAM,gBACL,QACA,EAAE,aAAa,OAAO,aAAa,UAAU,QAAQ,GACrD,SAC0B;AAC1B,UAAM,UAAU,MAAM,KAAK,eAAe,iBAAiB,QAAQ,IAAI,WAAW;AAClF,UAAM,QAAQ,cAAc;AAAA,MAC3B,OAAO,MAAM,QAAQ,kBAAkB,mBAAmB,OAAO;AAAA,MACjE,QAAQ,kBAAkB,wBAAwB,WAAW;AAAA,MAC7D,SAAS;AAAA,IAAA,CACT;AACD,QAAI,CAAC,SAAS;AACN,aAAA,8BAA8B,qBAAqB,WAAW;AAAA,IACtE;AACI,QAAA,OAAO,SAAS,mBAAmB,YAAY,CAAC,YAAY,SAAS,cAAc,GAAG;AACnF,YAAA,IAAI,eAAe,+DAA+D;AAAA,IACzF;AACO,WAAA,KAAK,SAAS,QAAQ,IAAI;AAAA,MAChC;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS;AAAA,MACT,UAAU,YAAY,SAAS,YAAY;AAAA,MAC3C,wBAAwB,SAAS,kBAAkB;AAAA,IAAA,CACnD;AAAA,EACF;AAAA,EAEA,MAAc,SACb,WACA,QAC0B;AACpB,UAAA,mBAAmB,MAAM,KAAK,oBAAoB,SAAS,OAAO,QAAQ,MAAM,OAAO,WAAW;AACpG,QAAA,iBAAiB,SAAS,GAAG;AAC1B,YAAA,SAAS,sCAAsC,gBAAgB;AAC9D,aAAA;AAAA,QACN,IAAI;AAAA,QACJ;AAAA,QACA,OAAO,OAAO,CAAC;AAAA,MAAA;AAAA,IAEjB;AACA,UAAM,WAAW,MAAM,KAAK,cAAc,OAAO,WAAW,MAAM;AAE9D,QAAA,CAAC,SAAS,IAAI;AACjB,aAAO,oBAAoB,SAAS,OAAO,SAAS,YAAY;AAAA,IACjE;AACA,UAAM,SAAS,SAAS;AAEjB,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ,CAAC;AAAA,MACT,QAAQ;AAAA,QACP,QAAQ,sBAAsB,qBAAqB,OAAO,MAAM;AAAA,QAChE,OAAO,OAAO;AAAA,MACf;AAAA,IAAA;AAAA,EAEF;AACD;"}
1
+ {"version":3,"file":"InviteMutationResolver.js","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/person/InviteMutationResolver.ts"],"sourcesContent":["import { InviteErrorCode, InviteResponse, MutationInviteArgs, MutationResolvers, MutationUnmanagedInviteArgs } from '../../../schema'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport {\n\tDatabaseContext,\n\tInviteData,\n\tInviteManager,\n\tisTokenHash,\n\tMembershipValidator,\n\tPermissionActions,\n\tProjectManager,\n} from '../../../model'\nimport { createMembershipValidationErrorResult } from '../../membershipUtils'\nimport { createErrorResponse, createProjectNotFoundResponse } from '../../errorUtils'\nimport { UserInputError } from '@contember/graphql-utils'\nimport { PersonResponseFactory } from '../../responseHelpers/PersonResponseFactory'\n\nexport class InviteMutationResolver implements MutationResolvers {\n\tconstructor(\n\t\tprivate readonly inviteManager: InviteManager,\n\t\tprivate readonly projectManager: ProjectManager,\n\t\tprivate readonly membershipValidator: MembershipValidator,\n\t) {}\n\n\tasync invite(\n\t\tparent: any,\n\t\t{ projectSlug, email, name, memberships, options }: MutationInviteArgs,\n\t\tcontext: TenantResolverContext,\n\t): Promise<InviteResponse> {\n\t\tconst project = await this.projectManager.getProjectBySlug(context.db, projectSlug)\n\t\tawait context.requireAccess({\n\t\t\tscope: await context.permissionContext.createProjectScope(project),\n\t\t\taction: PermissionActions.PERSON_INVITE(memberships),\n\t\t\tmessage: 'You are not allowed to invite a person',\n\t\t})\n\t\tif (!project) {\n\t\t\treturn createProjectNotFoundResponse('PROJECT_NOT_FOUND', projectSlug)\n\t\t}\n\t\treturn this.doInvite(context.db, {\n\t\t\temail,\n\t\t\tproject,\n\t\t\tmemberships,\n\t\t\tname: name ?? undefined,\n\t\t\temailVariant: options?.mailVariant || '',\n\t\t\tmethod: options?.method ?? 'CREATE_PASSWORD',\n\t\t})\n\t}\n\n\tasync unmanagedInvite(\n\t\tparent: any,\n\t\t{ projectSlug, email, memberships, password, options }: MutationUnmanagedInviteArgs,\n\t\tcontext: TenantResolverContext,\n\t): Promise<InviteResponse> {\n\t\tconst project = await this.projectManager.getProjectBySlug(context.db, projectSlug)\n\t\tawait context.requireAccess({\n\t\t\tscope: await context.permissionContext.createProjectScope(project),\n\t\t\taction: PermissionActions.PERSON_INVITE_UNMANAGED(memberships),\n\t\t\tmessage: 'You are not allowed to unmanaged person invite',\n\t\t})\n\t\tif (!project) {\n\t\t\treturn createProjectNotFoundResponse('PROJECT_NOT_FOUND', projectSlug)\n\t\t}\n\t\tif (typeof options?.resetTokenHash === 'string' && !isTokenHash(options?.resetTokenHash)) {\n\t\t\tthrow new UserInputError('Invalid format of resetTokenHash. Must be hex-encoded sha256.')\n\t\t}\n\t\treturn this.doInvite(context.db, {\n\t\t\temail,\n\t\t\tproject,\n\t\t\tmemberships,\n\t\t\tnoEmail: true,\n\t\t\tpassword: password ?? options?.password ?? undefined,\n\t\t\tpasswordResetTokenHash: options?.resetTokenHash ?? undefined,\n\t\t})\n\t}\n\n\tprivate async doInvite(\n\t\tdbContext: DatabaseContext,\n\t\tinvite: InviteData,\n\t): Promise<InviteResponse> {\n\t\tconst validationResult = await this.membershipValidator.validate(invite.project.slug, invite.memberships)\n\t\tif (validationResult.length > 0) {\n\t\t\tconst errors = createMembershipValidationErrorResult(validationResult)\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\terrors: errors,\n\t\t\t\terror: errors[0],\n\t\t\t}\n\t\t}\n\t\tconst response = await this.inviteManager.invite(dbContext, invite)\n\n\t\tif (!response.ok) {\n\t\t\treturn createErrorResponse(response.error, response.errorMessage)\n\t\t}\n\t\tconst result = response.result\n\n\t\treturn {\n\t\t\tok: true,\n\t\t\terrors: [],\n\t\t\tresult: {\n\t\t\t\tperson: PersonResponseFactory.createPersonResponse(result.person),\n\t\t\t\tisNew: result.isNew,\n\t\t\t},\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAgBO,MAAM,uBAAoD;AAAA,EAChE,YACkB,eACA,gBACA,qBAChB;AAHgB,SAAA,gBAAA;AACA,SAAA,iBAAA;AACA,SAAA,sBAAA;AAAA,EAAA;AAAA,EAGlB,MAAM,OACL,QACA,EAAE,aAAa,OAAO,MAAM,aAAa,QAAQ,GACjD,SAC0B;AAC1B,UAAM,UAAU,MAAM,KAAK,eAAe,iBAAiB,QAAQ,IAAI,WAAW;AAClF,UAAM,QAAQ,cAAc;AAAA,MAC3B,OAAO,MAAM,QAAQ,kBAAkB,mBAAmB,OAAO;AAAA,MACjE,QAAQ,kBAAkB,cAAc,WAAW;AAAA,MACnD,SAAS;AAAA,IAAA,CACT;AACD,QAAI,CAAC,SAAS;AACN,aAAA,8BAA8B,qBAAqB,WAAW;AAAA,IAAA;AAE/D,WAAA,KAAK,SAAS,QAAQ,IAAI;AAAA,MAChC;AAAA,MACA;AAAA,MACA;AAAA,MACA,MAAM,QAAQ;AAAA,MACd,cAAc,SAAS,eAAe;AAAA,MACtC,QAAQ,SAAS,UAAU;AAAA,IAAA,CAC3B;AAAA,EAAA;AAAA,EAGF,MAAM,gBACL,QACA,EAAE,aAAa,OAAO,aAAa,UAAU,QAAQ,GACrD,SAC0B;AAC1B,UAAM,UAAU,MAAM,KAAK,eAAe,iBAAiB,QAAQ,IAAI,WAAW;AAClF,UAAM,QAAQ,cAAc;AAAA,MAC3B,OAAO,MAAM,QAAQ,kBAAkB,mBAAmB,OAAO;AAAA,MACjE,QAAQ,kBAAkB,wBAAwB,WAAW;AAAA,MAC7D,SAAS;AAAA,IAAA,CACT;AACD,QAAI,CAAC,SAAS;AACN,aAAA,8BAA8B,qBAAqB,WAAW;AAAA,IAAA;AAElE,QAAA,OAAO,SAAS,mBAAmB,YAAY,CAAC,YAAY,SAAS,cAAc,GAAG;AACnF,YAAA,IAAI,eAAe,+DAA+D;AAAA,IAAA;AAElF,WAAA,KAAK,SAAS,QAAQ,IAAI;AAAA,MAChC;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS;AAAA,MACT,UAAU,YAAY,SAAS,YAAY;AAAA,MAC3C,wBAAwB,SAAS,kBAAkB;AAAA,IAAA,CACnD;AAAA,EAAA;AAAA,EAGF,MAAc,SACb,WACA,QAC0B;AACpB,UAAA,mBAAmB,MAAM,KAAK,oBAAoB,SAAS,OAAO,QAAQ,MAAM,OAAO,WAAW;AACpG,QAAA,iBAAiB,SAAS,GAAG;AAC1B,YAAA,SAAS,sCAAsC,gBAAgB;AAC9D,aAAA;AAAA,QACN,IAAI;AAAA,QACJ;AAAA,QACA,OAAO,OAAO,CAAC;AAAA,MAChB;AAAA,IAAA;AAED,UAAM,WAAW,MAAM,KAAK,cAAc,OAAO,WAAW,MAAM;AAE9D,QAAA,CAAC,SAAS,IAAI;AACjB,aAAO,oBAAoB,SAAS,OAAO,SAAS,YAAY;AAAA,IAAA;AAEjE,UAAM,SAAS,SAAS;AAEjB,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ,CAAC;AAAA,MACT,QAAQ;AAAA,QACP,QAAQ,sBAAsB,qBAAqB,OAAO,MAAM;AAAA,QAChE,OAAO,OAAO;AAAA,MAAA;AAAA,IAEhB;AAAA,EAAA;AAEF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"OtpMutationResolver.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/person/OtpMutationResolver.ts"],"sourcesContent":["import {\n\tConfirmOtpResponse,\n\tDisableOtpResponse,\n\tMutationConfirmOtpArgs,\n\tMutationPrepareOtpArgs,\n\tMutationResolvers,\n\tPrepareOtpResponse,\n} from '../../../schema'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { OtpManager, PermissionActions, PersonQuery, PersonRow } from '../../../model'\nimport { ImplementationException } from '../../../exceptions'\nimport { createErrorResponse } from '../../errorUtils'\n\nexport class OtpMutationResolver implements MutationResolvers {\n\tconstructor(private readonly otpManager: OtpManager) {}\n\n\tasync prepareOtp(parent: any, args: MutationPrepareOtpArgs, context: TenantResolverContext): Promise<PrepareOtpResponse> {\n\t\tconst person = await this.getPersonFromContext(context)\n\t\tconst otp = await this.otpManager.prepareOtp(context.db, person, args.label || 'Contember')\n\t\treturn {\n\t\t\tok: true,\n\t\t\tresult: {\n\t\t\t\totpUri: otp.uri,\n\t\t\t\totpSecret: otp.secret,\n\t\t\t},\n\t\t}\n\t}\n\n\tasync confirmOtp(parent: any, args: MutationConfirmOtpArgs, context: TenantResolverContext): Promise<ConfirmOtpResponse> {\n\t\tconst person = await this.getPersonFromContext(context)\n\t\tif (!person.otp_uri) {\n\t\t\treturn createErrorResponse(\n\t\t\t\t'NOT_PREPARED',\n\t\t\t\t`OTP setup was not initialized. Call prepareOtp first.`,\n\t\t\t)\n\t\t}\n\t\tif (!this.otpManager.verifyOtp(person, args.otpToken)) {\n\t\t\treturn createErrorResponse('INVALID_OTP_TOKEN', 'Provided token is not correct.')\n\t\t}\n\t\tawait this.otpManager.confirmOtp(context.db, person)\n\t\treturn {\n\t\t\tok: true,\n\t\t\terrors: [],\n\t\t}\n\t}\n\n\tasync disableOtp(parent: any, args: {}, context: TenantResolverContext): Promise<DisableOtpResponse> {\n\t\tconst person = await this.getPersonFromContext(context)\n\t\tif (!person.otp_uri) {\n\t\t\treturn createErrorResponse('OTP_NOT_ACTIVE', 'OTP is not active, you cannot disable it.')\n\t\t}\n\t\tawait this.otpManager.disableOtp(context.db, person)\n\t\treturn {\n\t\t\tok: true,\n\t\t\terrors: [],\n\t\t}\n\t}\n\n\tprivate async getPersonFromContext(context: TenantResolverContext): Promise<PersonRow> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.PERSON_SETUP_OTP,\n\t\t\tmessage: 'You are not allowed to setup a OTP',\n\t\t})\n\t\tconst person = await context.db.queryHandler.fetch(PersonQuery.byIdentity(context.identity.id))\n\t\tif (!person) {\n\t\t\tthrow new ImplementationException('Person should exists')\n\t\t}\n\n\t\treturn person\n\t}\n}\n"],"names":["createErrorResponse","PermissionActions","PersonQuery","ImplementationException"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAaO,MAAM,oBAAiD;AAAA,EAC7D,YAA6B,YAAwB;AAAxB,SAAA,aAAA;AAAA,EAAyB;AAAA,EAEtD,MAAM,WAAW,QAAa,MAA8B,SAA6D;AACxH,UAAM,SAAS,MAAM,KAAK,qBAAqB,OAAO;AAChD,UAAA,MAAM,MAAM,KAAK,WAAW,WAAW,QAAQ,IAAI,QAAQ,KAAK,SAAS,WAAW;AACnF,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ;AAAA,QACP,QAAQ,IAAI;AAAA,QACZ,WAAW,IAAI;AAAA,MAChB;AAAA,IAAA;AAAA,EAEF;AAAA,EAEA,MAAM,WAAW,QAAa,MAA8B,SAA6D;AACxH,UAAM,SAAS,MAAM,KAAK,qBAAqB,OAAO;AAClD,QAAA,CAAC,OAAO,SAAS;AACb,aAAAA,WAAA;AAAA,QACN;AAAA,QACA;AAAA,MAAA;AAAA,IAEF;AACA,QAAI,CAAC,KAAK,WAAW,UAAU,QAAQ,KAAK,QAAQ,GAAG;AAC/C,aAAAA,WAAA,oBAAoB,qBAAqB,gCAAgC;AAAA,IACjF;AACA,UAAM,KAAK,WAAW,WAAW,QAAQ,IAAI,MAAM;AAC5C,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ,CAAC;AAAA,IAAA;AAAA,EAEX;AAAA,EAEA,MAAM,WAAW,QAAa,MAAU,SAA6D;AACpG,UAAM,SAAS,MAAM,KAAK,qBAAqB,OAAO;AAClD,QAAA,CAAC,OAAO,SAAS;AACb,aAAAA,WAAA,oBAAoB,kBAAkB,2CAA2C;AAAA,IACzF;AACA,UAAM,KAAK,WAAW,WAAW,QAAQ,IAAI,MAAM;AAC5C,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ,CAAC;AAAA,IAAA;AAAA,EAEX;AAAA,EAEA,MAAc,qBAAqB,SAAoD;AACtF,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQC,kBAAkB,kBAAA;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACK,UAAA,SAAS,MAAM,QAAQ,GAAG,aAAa,MAAMC,YAAA,YAAY,WAAW,QAAQ,SAAS,EAAE,CAAC;AAC9F,QAAI,CAAC,QAAQ;AACN,YAAA,IAAIC,WAAAA,wBAAwB,sBAAsB;AAAA,IACzD;AAEO,WAAA;AAAA,EACR;AACD;;"}
1
+ {"version":3,"file":"OtpMutationResolver.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/resolvers/mutation/person/OtpMutationResolver.ts"],"sourcesContent":["import {\n\tConfirmOtpResponse,\n\tDisableOtpResponse,\n\tMutationConfirmOtpArgs,\n\tMutationPrepareOtpArgs,\n\tMutationResolvers,\n\tPrepareOtpResponse,\n} from '../../../schema'\nimport { TenantResolverContext } from '../../TenantResolverContext'\nimport { OtpManager, PermissionActions, PersonQuery, PersonRow } from '../../../model'\nimport { ImplementationException } from '../../../exceptions'\nimport { createErrorResponse } from '../../errorUtils'\n\nexport class OtpMutationResolver implements MutationResolvers {\n\tconstructor(private readonly otpManager: OtpManager) {}\n\n\tasync prepareOtp(parent: any, args: MutationPrepareOtpArgs, context: TenantResolverContext): Promise<PrepareOtpResponse> {\n\t\tconst person = await this.getPersonFromContext(context)\n\t\tconst otp = await this.otpManager.prepareOtp(context.db, person, args.label || 'Contember')\n\t\treturn {\n\t\t\tok: true,\n\t\t\tresult: {\n\t\t\t\totpUri: otp.uri,\n\t\t\t\totpSecret: otp.secret,\n\t\t\t},\n\t\t}\n\t}\n\n\tasync confirmOtp(parent: any, args: MutationConfirmOtpArgs, context: TenantResolverContext): Promise<ConfirmOtpResponse> {\n\t\tconst person = await this.getPersonFromContext(context)\n\t\tif (!person.otp_uri) {\n\t\t\treturn createErrorResponse(\n\t\t\t\t'NOT_PREPARED',\n\t\t\t\t`OTP setup was not initialized. Call prepareOtp first.`,\n\t\t\t)\n\t\t}\n\t\tif (!this.otpManager.verifyOtp(person, args.otpToken)) {\n\t\t\treturn createErrorResponse('INVALID_OTP_TOKEN', 'Provided token is not correct.')\n\t\t}\n\t\tawait this.otpManager.confirmOtp(context.db, person)\n\t\treturn {\n\t\t\tok: true,\n\t\t\terrors: [],\n\t\t}\n\t}\n\n\tasync disableOtp(parent: any, args: {}, context: TenantResolverContext): Promise<DisableOtpResponse> {\n\t\tconst person = await this.getPersonFromContext(context)\n\t\tif (!person.otp_uri) {\n\t\t\treturn createErrorResponse('OTP_NOT_ACTIVE', 'OTP is not active, you cannot disable it.')\n\t\t}\n\t\tawait this.otpManager.disableOtp(context.db, person)\n\t\treturn {\n\t\t\tok: true,\n\t\t\terrors: [],\n\t\t}\n\t}\n\n\tprivate async getPersonFromContext(context: TenantResolverContext): Promise<PersonRow> {\n\t\tawait context.requireAccess({\n\t\t\taction: PermissionActions.PERSON_SETUP_OTP,\n\t\t\tmessage: 'You are not allowed to setup a OTP',\n\t\t})\n\t\tconst person = await context.db.queryHandler.fetch(PersonQuery.byIdentity(context.identity.id))\n\t\tif (!person) {\n\t\t\tthrow new ImplementationException('Person should exists')\n\t\t}\n\n\t\treturn person\n\t}\n}\n"],"names":["createErrorResponse","PermissionActions","PersonQuery","ImplementationException"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAaO,MAAM,oBAAiD;AAAA,EAC7D,YAA6B,YAAwB;AAAxB,SAAA,aAAA;AAAA,EAAA;AAAA,EAE7B,MAAM,WAAW,QAAa,MAA8B,SAA6D;AACxH,UAAM,SAAS,MAAM,KAAK,qBAAqB,OAAO;AAChD,UAAA,MAAM,MAAM,KAAK,WAAW,WAAW,QAAQ,IAAI,QAAQ,KAAK,SAAS,WAAW;AACnF,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ;AAAA,QACP,QAAQ,IAAI;AAAA,QACZ,WAAW,IAAI;AAAA,MAAA;AAAA,IAEjB;AAAA,EAAA;AAAA,EAGD,MAAM,WAAW,QAAa,MAA8B,SAA6D;AACxH,UAAM,SAAS,MAAM,KAAK,qBAAqB,OAAO;AAClD,QAAA,CAAC,OAAO,SAAS;AACb,aAAAA,WAAA;AAAA,QACN;AAAA,QACA;AAAA,MACD;AAAA,IAAA;AAED,QAAI,CAAC,KAAK,WAAW,UAAU,QAAQ,KAAK,QAAQ,GAAG;AAC/C,aAAAA,WAAA,oBAAoB,qBAAqB,gCAAgC;AAAA,IAAA;AAEjF,UAAM,KAAK,WAAW,WAAW,QAAQ,IAAI,MAAM;AAC5C,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ,CAAA;AAAA,IACT;AAAA,EAAA;AAAA,EAGD,MAAM,WAAW,QAAa,MAAU,SAA6D;AACpG,UAAM,SAAS,MAAM,KAAK,qBAAqB,OAAO;AAClD,QAAA,CAAC,OAAO,SAAS;AACb,aAAAA,WAAA,oBAAoB,kBAAkB,2CAA2C;AAAA,IAAA;AAEzF,UAAM,KAAK,WAAW,WAAW,QAAQ,IAAI,MAAM;AAC5C,WAAA;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ,CAAA;AAAA,IACT;AAAA,EAAA;AAAA,EAGD,MAAc,qBAAqB,SAAoD;AACtF,UAAM,QAAQ,cAAc;AAAA,MAC3B,QAAQC,kBAAkB,kBAAA;AAAA,MAC1B,SAAS;AAAA,IAAA,CACT;AACK,UAAA,SAAS,MAAM,QAAQ,GAAG,aAAa,MAAMC,YAAA,YAAY,WAAW,QAAQ,SAAS,EAAE,CAAC;AAC9F,QAAI,CAAC,QAAQ;AACN,YAAA,IAAIC,mCAAwB,sBAAsB;AAAA,IAAA;AAGlD,WAAA;AAAA,EAAA;AAET;;"}