@contember/engine-tenant-api 2.2.0-alpha.1 → 2.2.0-alpha.10

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 (2014) hide show
  1. package/CLAUDE.md +60 -7
  2. package/dist/development/index.cjs +69 -0
  3. package/dist/development/index.cjs.map +1 -1
  4. package/dist/development/index.js +71 -2
  5. package/dist/development/index.js.map +1 -1
  6. package/dist/development/src/TenantContainer.cjs +39 -10
  7. package/dist/development/src/TenantContainer.cjs.map +1 -1
  8. package/dist/development/src/TenantContainer.js +39 -10
  9. package/dist/development/src/TenantContainer.js.map +1 -1
  10. package/dist/development/src/bridges/system/IdentityFetcher.cjs +9 -7
  11. package/dist/development/src/bridges/system/IdentityFetcher.cjs.map +1 -1
  12. package/dist/development/src/bridges/system/IdentityFetcher.js +9 -7
  13. package/dist/development/src/bridges/system/IdentityFetcher.js.map +1 -1
  14. package/dist/development/src/migrations/2026-06-18-120000-idp-claim-mapping.cjs +10 -0
  15. package/dist/development/src/migrations/2026-06-18-120000-idp-claim-mapping.cjs.map +1 -0
  16. package/dist/development/src/migrations/2026-06-18-120000-idp-claim-mapping.js +11 -0
  17. package/dist/development/src/migrations/2026-06-18-120000-idp-claim-mapping.js.map +1 -0
  18. package/dist/development/src/migrations/2026-08-03-120000-person-enable-auth-log.cjs +9 -0
  19. package/dist/development/src/migrations/2026-08-03-120000-person-enable-auth-log.cjs.map +1 -0
  20. package/dist/development/src/migrations/2026-08-03-120000-person-enable-auth-log.js +10 -0
  21. package/dist/development/src/migrations/2026-08-03-120000-person-enable-auth-log.js.map +1 -0
  22. package/dist/development/src/migrations/2026-08-04-120000-config-panel.cjs +11 -0
  23. package/dist/development/src/migrations/2026-08-04-120000-config-panel.cjs.map +1 -0
  24. package/dist/development/src/migrations/2026-08-04-120000-config-panel.js +12 -0
  25. package/dist/development/src/migrations/2026-08-04-120000-config-panel.js.map +1 -0
  26. package/dist/development/src/migrations/2026-09-04-120000-idp-disable-local-authentication.cjs +18 -0
  27. package/dist/development/src/migrations/2026-09-04-120000-idp-disable-local-authentication.cjs.map +1 -0
  28. package/dist/development/src/migrations/2026-09-04-120000-idp-disable-local-authentication.js +19 -0
  29. package/dist/development/src/migrations/2026-09-04-120000-idp-disable-local-authentication.js.map +1 -0
  30. package/dist/development/src/migrations/2026-09-11-120000-custom-role.cjs +18 -0
  31. package/dist/development/src/migrations/2026-09-11-120000-custom-role.cjs.map +1 -0
  32. package/dist/development/src/migrations/2026-09-11-120000-custom-role.js +19 -0
  33. package/dist/development/src/migrations/2026-09-11-120000-custom-role.js.map +1 -0
  34. package/dist/development/src/migrations/runner.cjs +17 -5
  35. package/dist/development/src/migrations/runner.cjs.map +1 -1
  36. package/dist/development/src/migrations/runner.js +17 -5
  37. package/dist/development/src/migrations/runner.js.map +1 -1
  38. package/dist/development/src/migrations/snapshot.cjs +22 -2
  39. package/dist/development/src/migrations/snapshot.cjs.map +1 -1
  40. package/dist/development/src/migrations/snapshot.js +22 -2
  41. package/dist/development/src/migrations/snapshot.js.map +1 -1
  42. package/dist/development/src/model/authorization/CustomRoleAuthorizator.cjs +65 -0
  43. package/dist/development/src/model/authorization/CustomRoleAuthorizator.cjs.map +1 -0
  44. package/dist/development/src/model/authorization/CustomRoleAuthorizator.js +65 -0
  45. package/dist/development/src/model/authorization/CustomRoleAuthorizator.js.map +1 -0
  46. package/dist/development/src/model/authorization/CustomRolePermissions.cjs +404 -0
  47. package/dist/development/src/model/authorization/CustomRolePermissions.cjs.map +1 -0
  48. package/dist/development/src/model/authorization/CustomRolePermissions.js +387 -0
  49. package/dist/development/src/model/authorization/CustomRolePermissions.js.map +1 -0
  50. package/dist/development/src/model/authorization/PermissionActions.cjs +19 -16
  51. package/dist/development/src/model/authorization/PermissionActions.cjs.map +1 -1
  52. package/dist/development/src/model/authorization/PermissionActions.js +19 -16
  53. package/dist/development/src/model/authorization/PermissionActions.js.map +1 -1
  54. package/dist/development/src/model/authorization/PermissionContextFactory.cjs +20 -2
  55. package/dist/development/src/model/authorization/PermissionContextFactory.cjs.map +1 -1
  56. package/dist/development/src/model/authorization/PermissionContextFactory.js +20 -2
  57. package/dist/development/src/model/authorization/PermissionContextFactory.js.map +1 -1
  58. package/dist/development/src/model/authorization/PermissionsFactory.cjs +32 -24
  59. package/dist/development/src/model/authorization/PermissionsFactory.cjs.map +1 -1
  60. package/dist/development/src/model/authorization/PermissionsFactory.js +33 -25
  61. package/dist/development/src/model/authorization/PermissionsFactory.js.map +1 -1
  62. package/dist/development/src/model/authorization/Roles.cjs +8 -0
  63. package/dist/development/src/model/authorization/Roles.cjs.map +1 -1
  64. package/dist/development/src/model/authorization/Roles.js +8 -0
  65. package/dist/development/src/model/authorization/Roles.js.map +1 -1
  66. package/dist/development/src/model/authorization/TargetIdentityPermission.cjs +35 -0
  67. package/dist/development/src/model/authorization/TargetIdentityPermission.cjs.map +1 -0
  68. package/dist/development/src/model/authorization/TargetIdentityPermission.js +35 -0
  69. package/dist/development/src/model/authorization/TargetIdentityPermission.js.map +1 -0
  70. package/dist/development/src/model/commands/apiKey/ApiKeyHelper.cjs +19 -0
  71. package/dist/development/src/model/commands/apiKey/ApiKeyHelper.cjs.map +1 -1
  72. package/dist/development/src/model/commands/apiKey/ApiKeyHelper.js +19 -0
  73. package/dist/development/src/model/commands/apiKey/ApiKeyHelper.js.map +1 -1
  74. package/dist/development/src/model/commands/apiKey/CreateApiKeyCommand.cjs +4 -2
  75. package/dist/development/src/model/commands/apiKey/CreateApiKeyCommand.cjs.map +1 -1
  76. package/dist/development/src/model/commands/apiKey/CreateApiKeyCommand.js +5 -3
  77. package/dist/development/src/model/commands/apiKey/CreateApiKeyCommand.js.map +1 -1
  78. package/dist/development/src/model/commands/apiKey/ProlongApiKeyCommand.cjs +9 -10
  79. package/dist/development/src/model/commands/apiKey/ProlongApiKeyCommand.cjs.map +1 -1
  80. package/dist/development/src/model/commands/apiKey/ProlongApiKeyCommand.js +10 -11
  81. package/dist/development/src/model/commands/apiKey/ProlongApiKeyCommand.js.map +1 -1
  82. package/dist/development/src/model/commands/authLog/CreateAuthLogEntryCommand.cjs.map +1 -1
  83. package/dist/development/src/model/commands/authLog/CreateAuthLogEntryCommand.js.map +1 -1
  84. package/dist/development/src/model/commands/configuration/UpdateConfigurationCommand.cjs +5 -3
  85. package/dist/development/src/model/commands/configuration/UpdateConfigurationCommand.cjs.map +1 -1
  86. package/dist/development/src/model/commands/configuration/UpdateConfigurationCommand.js +5 -3
  87. package/dist/development/src/model/commands/configuration/UpdateConfigurationCommand.js.map +1 -1
  88. package/dist/development/src/model/commands/customRole/CreateCustomRoleCommand.cjs +23 -0
  89. package/dist/development/src/model/commands/customRole/CreateCustomRoleCommand.cjs.map +1 -0
  90. package/dist/development/src/model/commands/customRole/CreateCustomRoleCommand.js +23 -0
  91. package/dist/development/src/model/commands/customRole/CreateCustomRoleCommand.js.map +1 -0
  92. package/dist/development/src/model/commands/customRole/DeleteCustomRoleCommand.cjs +14 -0
  93. package/dist/development/src/model/commands/customRole/DeleteCustomRoleCommand.cjs.map +1 -0
  94. package/dist/development/src/model/commands/customRole/DeleteCustomRoleCommand.js +14 -0
  95. package/dist/development/src/model/commands/customRole/DeleteCustomRoleCommand.js.map +1 -0
  96. package/dist/development/src/model/commands/customRole/RemoveCustomRoleAssignmentsCommand.cjs +16 -0
  97. package/dist/development/src/model/commands/customRole/RemoveCustomRoleAssignmentsCommand.cjs.map +1 -0
  98. package/dist/development/src/model/commands/customRole/RemoveCustomRoleAssignmentsCommand.js +16 -0
  99. package/dist/development/src/model/commands/customRole/RemoveCustomRoleAssignmentsCommand.js.map +1 -0
  100. package/dist/development/src/model/commands/customRole/UpdateCustomRoleCommand.cjs +19 -0
  101. package/dist/development/src/model/commands/customRole/UpdateCustomRoleCommand.cjs.map +1 -0
  102. package/dist/development/src/model/commands/customRole/UpdateCustomRoleCommand.js +19 -0
  103. package/dist/development/src/model/commands/customRole/UpdateCustomRoleCommand.js.map +1 -0
  104. package/dist/development/src/model/commands/identity/PatchIdentityGlobalRoles.cjs +1 -1
  105. package/dist/development/src/model/commands/identity/PatchIdentityGlobalRoles.cjs.map +1 -1
  106. package/dist/development/src/model/commands/identity/PatchIdentityGlobalRoles.js +1 -1
  107. package/dist/development/src/model/commands/identity/PatchIdentityGlobalRoles.js.map +1 -1
  108. package/dist/development/src/model/commands/idp/ClaimIdpRevalidationCommand.cjs +3 -7
  109. package/dist/development/src/model/commands/idp/ClaimIdpRevalidationCommand.cjs.map +1 -1
  110. package/dist/development/src/model/commands/idp/ClaimIdpRevalidationCommand.js +3 -7
  111. package/dist/development/src/model/commands/idp/ClaimIdpRevalidationCommand.js.map +1 -1
  112. package/dist/development/src/model/commands/idp/CreateIdpCommand.cjs +8 -2
  113. package/dist/development/src/model/commands/idp/CreateIdpCommand.cjs.map +1 -1
  114. package/dist/development/src/model/commands/idp/CreateIdpCommand.js +8 -2
  115. package/dist/development/src/model/commands/idp/CreateIdpCommand.js.map +1 -1
  116. package/dist/development/src/model/commands/idp/CreateIdpSessionCommand.cjs +4 -1
  117. package/dist/development/src/model/commands/idp/CreateIdpSessionCommand.cjs.map +1 -1
  118. package/dist/development/src/model/commands/idp/CreateIdpSessionCommand.js +5 -2
  119. package/dist/development/src/model/commands/idp/CreateIdpSessionCommand.js.map +1 -1
  120. package/dist/development/src/model/commands/idp/UpdateIdpCommand.cjs +6 -2
  121. package/dist/development/src/model/commands/idp/UpdateIdpCommand.cjs.map +1 -1
  122. package/dist/development/src/model/commands/idp/UpdateIdpCommand.js +6 -2
  123. package/dist/development/src/model/commands/idp/UpdateIdpCommand.js.map +1 -1
  124. package/dist/development/src/model/commands/idp/UpdateIdpSessionCommand.cjs +2 -1
  125. package/dist/development/src/model/commands/idp/UpdateIdpSessionCommand.cjs.map +1 -1
  126. package/dist/development/src/model/commands/idp/UpdateIdpSessionCommand.js +3 -2
  127. package/dist/development/src/model/commands/idp/UpdateIdpSessionCommand.js.map +1 -1
  128. package/dist/development/src/model/commands/membership/{RemoveProjectMembershipsCommand.cjs → RemoveProjectMembershipCommand.cjs} +1 -1
  129. package/dist/development/src/model/commands/membership/RemoveProjectMembershipCommand.cjs.map +1 -0
  130. package/dist/development/src/model/commands/membership/{RemoveProjectMembershipsCommand.js → RemoveProjectMembershipCommand.js} +1 -1
  131. package/dist/development/src/model/commands/membership/RemoveProjectMembershipCommand.js.map +1 -0
  132. package/dist/development/src/model/commands/membership/UpdateProjectMemberCommand.cjs +2 -2
  133. package/dist/development/src/model/commands/membership/UpdateProjectMemberCommand.cjs.map +1 -1
  134. package/dist/development/src/model/commands/membership/UpdateProjectMemberCommand.js +1 -1
  135. package/dist/development/src/model/commands/membership/UpdateProjectMemberCommand.js.map +1 -1
  136. package/dist/development/src/model/commands/person/CreatePersonCommand.cjs +1 -0
  137. package/dist/development/src/model/commands/person/CreatePersonCommand.cjs.map +1 -1
  138. package/dist/development/src/model/commands/person/CreatePersonCommand.js +1 -0
  139. package/dist/development/src/model/commands/person/CreatePersonCommand.js.map +1 -1
  140. package/dist/development/src/model/commands/person/EnablePersonCommand.cjs +17 -0
  141. package/dist/development/src/model/commands/person/EnablePersonCommand.cjs.map +1 -0
  142. package/dist/development/src/model/commands/person/EnablePersonCommand.js +17 -0
  143. package/dist/development/src/model/commands/person/EnablePersonCommand.js.map +1 -0
  144. package/dist/development/src/model/commands/person/SetMfaGraceUntilCommand.cjs +3 -3
  145. package/dist/development/src/model/commands/person/SetMfaGraceUntilCommand.cjs.map +1 -1
  146. package/dist/development/src/model/commands/person/SetMfaGraceUntilCommand.js +4 -4
  147. package/dist/development/src/model/commands/person/SetMfaGraceUntilCommand.js.map +1 -1
  148. package/dist/development/src/model/commands/personToken/ResetPasswordCommand.cjs +2 -3
  149. package/dist/development/src/model/commands/personToken/ResetPasswordCommand.cjs.map +1 -1
  150. package/dist/development/src/model/commands/personToken/ResetPasswordCommand.js +2 -3
  151. package/dist/development/src/model/commands/personToken/ResetPasswordCommand.js.map +1 -1
  152. package/dist/development/src/model/commands/personToken/SaveEmailOtpTokenCommand.cjs +3 -3
  153. package/dist/development/src/model/commands/personToken/SaveEmailOtpTokenCommand.cjs.map +1 -1
  154. package/dist/development/src/model/commands/personToken/SaveEmailOtpTokenCommand.js +4 -4
  155. package/dist/development/src/model/commands/personToken/SaveEmailOtpTokenCommand.js.map +1 -1
  156. package/dist/development/src/model/commands/personToken/SavePersonTokenCommand.cjs +12 -6
  157. package/dist/development/src/model/commands/personToken/SavePersonTokenCommand.cjs.map +1 -1
  158. package/dist/development/src/model/commands/personToken/SavePersonTokenCommand.js +13 -7
  159. package/dist/development/src/model/commands/personToken/SavePersonTokenCommand.js.map +1 -1
  160. package/dist/development/src/model/commands/rateLimit/RecordRateLimitEventCommand.cjs +1 -2
  161. package/dist/development/src/model/commands/rateLimit/RecordRateLimitEventCommand.cjs.map +1 -1
  162. package/dist/development/src/model/commands/rateLimit/RecordRateLimitEventCommand.js +1 -2
  163. package/dist/development/src/model/commands/rateLimit/RecordRateLimitEventCommand.js.map +1 -1
  164. package/dist/development/src/model/mailing/UserMailer.cjs +2 -1
  165. package/dist/development/src/model/mailing/UserMailer.cjs.map +1 -1
  166. package/dist/development/src/model/mailing/UserMailer.js +2 -1
  167. package/dist/development/src/model/mailing/UserMailer.js.map +1 -1
  168. package/dist/development/src/model/queries/apiKey/ApiKeyQuery.cjs +8 -1
  169. package/dist/development/src/model/queries/apiKey/ApiKeyQuery.cjs.map +1 -1
  170. package/dist/development/src/model/queries/apiKey/ApiKeyQuery.js +9 -2
  171. package/dist/development/src/model/queries/apiKey/ApiKeyQuery.js.map +1 -1
  172. package/dist/development/src/model/queries/apiKey/ApiKeySessionsQuery.cjs +2 -3
  173. package/dist/development/src/model/queries/apiKey/ApiKeySessionsQuery.cjs.map +1 -1
  174. package/dist/development/src/model/queries/apiKey/ApiKeySessionsQuery.js +2 -3
  175. package/dist/development/src/model/queries/apiKey/ApiKeySessionsQuery.js.map +1 -1
  176. package/dist/development/src/model/queries/authLog/NextLoginAttemptQuery.cjs +12 -10
  177. package/dist/development/src/model/queries/authLog/NextLoginAttemptQuery.cjs.map +1 -1
  178. package/dist/development/src/model/queries/authLog/NextLoginAttemptQuery.js +12 -10
  179. package/dist/development/src/model/queries/authLog/NextLoginAttemptQuery.js.map +1 -1
  180. package/dist/development/src/model/queries/authLog/NextMailAttemptQuery.cjs +10 -8
  181. package/dist/development/src/model/queries/authLog/NextMailAttemptQuery.cjs.map +1 -1
  182. package/dist/development/src/model/queries/authLog/NextMailAttemptQuery.js +10 -8
  183. package/dist/development/src/model/queries/authLog/NextMailAttemptQuery.js.map +1 -1
  184. package/dist/development/src/model/queries/configuration/ConfigurationQuery.cjs +4 -0
  185. package/dist/development/src/model/queries/configuration/ConfigurationQuery.cjs.map +1 -1
  186. package/dist/development/src/model/queries/configuration/ConfigurationQuery.js +4 -0
  187. package/dist/development/src/model/queries/configuration/ConfigurationQuery.js.map +1 -1
  188. package/dist/development/src/model/queries/customRole/CustomRolesQuery.cjs +23 -0
  189. package/dist/development/src/model/queries/customRole/CustomRolesQuery.cjs.map +1 -0
  190. package/dist/development/src/model/queries/customRole/CustomRolesQuery.js +23 -0
  191. package/dist/development/src/model/queries/customRole/CustomRolesQuery.js.map +1 -0
  192. package/dist/development/src/model/queries/identity/IdentitiesHoldingRoleCountQuery.cjs +15 -0
  193. package/dist/development/src/model/queries/identity/IdentitiesHoldingRoleCountQuery.cjs.map +1 -0
  194. package/dist/development/src/model/queries/identity/IdentitiesHoldingRoleCountQuery.js +15 -0
  195. package/dist/development/src/model/queries/identity/IdentitiesHoldingRoleCountQuery.js.map +1 -0
  196. package/dist/development/src/model/queries/identity/IdentityQuery.cjs +7 -2
  197. package/dist/development/src/model/queries/identity/IdentityQuery.cjs.map +1 -1
  198. package/dist/development/src/model/queries/identity/IdentityQuery.js +7 -2
  199. package/dist/development/src/model/queries/identity/IdentityQuery.js.map +1 -1
  200. package/dist/development/src/model/queries/idp/LocalAuthDisablingIdpsQuery.cjs +21 -0
  201. package/dist/development/src/model/queries/idp/LocalAuthDisablingIdpsQuery.cjs.map +1 -0
  202. package/dist/development/src/model/queries/idp/LocalAuthDisablingIdpsQuery.js +21 -0
  203. package/dist/development/src/model/queries/idp/LocalAuthDisablingIdpsQuery.js.map +1 -0
  204. package/dist/development/src/model/queries/idp/PersonIdentityProvidersQuery.cjs +1 -1
  205. package/dist/development/src/model/queries/idp/PersonIdentityProvidersQuery.cjs.map +1 -1
  206. package/dist/development/src/model/queries/idp/PersonIdentityProvidersQuery.js +1 -1
  207. package/dist/development/src/model/queries/idp/PersonIdentityProvidersQuery.js.map +1 -1
  208. package/dist/development/src/model/queries/idp/helpers.cjs +3 -3
  209. package/dist/development/src/model/queries/idp/helpers.cjs.map +1 -1
  210. package/dist/development/src/model/queries/idp/helpers.js +3 -3
  211. package/dist/development/src/model/queries/idp/helpers.js.map +1 -1
  212. package/dist/development/src/model/queries/membership/IdentityHasProjectMembershipsQuery.cjs +15 -0
  213. package/dist/development/src/model/queries/membership/IdentityHasProjectMembershipsQuery.cjs.map +1 -0
  214. package/dist/development/src/model/queries/membership/IdentityHasProjectMembershipsQuery.js +15 -0
  215. package/dist/development/src/model/queries/membership/IdentityHasProjectMembershipsQuery.js.map +1 -0
  216. package/dist/development/src/model/queries/membership/ProjectMembersQuery.cjs +1 -1
  217. package/dist/development/src/model/queries/membership/ProjectMembersQuery.cjs.map +1 -1
  218. package/dist/development/src/model/queries/membership/ProjectMembersQuery.js +1 -1
  219. package/dist/development/src/model/queries/membership/ProjectMembersQuery.js.map +1 -1
  220. package/dist/development/src/model/queries/person/PersonQueryBuilderFactory.cjs +2 -2
  221. package/dist/development/src/model/queries/person/PersonQueryBuilderFactory.cjs.map +1 -1
  222. package/dist/development/src/model/queries/person/PersonQueryBuilderFactory.js +2 -2
  223. package/dist/development/src/model/queries/person/PersonQueryBuilderFactory.js.map +1 -1
  224. package/dist/development/src/model/queries/personToken/PersonTokenQuery.cjs +1 -1
  225. package/dist/development/src/model/queries/personToken/PersonTokenQuery.cjs.map +1 -1
  226. package/dist/development/src/model/queries/personToken/PersonTokenQuery.js +1 -1
  227. package/dist/development/src/model/queries/personToken/PersonTokenQuery.js.map +1 -1
  228. package/dist/development/src/model/queries/project/ProjectsByIdentityQuery.cjs +4 -1
  229. package/dist/development/src/model/queries/project/ProjectsByIdentityQuery.cjs.map +1 -1
  230. package/dist/development/src/model/queries/project/ProjectsByIdentityQuery.js +4 -1
  231. package/dist/development/src/model/queries/project/ProjectsByIdentityQuery.js.map +1 -1
  232. package/dist/development/src/model/queries/rateLimit/RateLimitCountQuery.cjs +3 -3
  233. package/dist/development/src/model/queries/rateLimit/RateLimitCountQuery.cjs.map +1 -1
  234. package/dist/development/src/model/queries/rateLimit/RateLimitCountQuery.js +3 -3
  235. package/dist/development/src/model/queries/rateLimit/RateLimitCountQuery.js.map +1 -1
  236. package/dist/development/src/model/service/AuthLogService.cjs +8 -2
  237. package/dist/development/src/model/service/AuthLogService.cjs.map +1 -1
  238. package/dist/development/src/model/service/AuthLogService.js +8 -2
  239. package/dist/development/src/model/service/AuthLogService.js.map +1 -1
  240. package/dist/development/src/model/service/AuthPolicyManager.cjs +2 -1
  241. package/dist/development/src/model/service/AuthPolicyManager.cjs.map +1 -1
  242. package/dist/development/src/model/service/AuthPolicyManager.js +2 -1
  243. package/dist/development/src/model/service/AuthPolicyManager.js.map +1 -1
  244. package/dist/development/src/model/service/AuthPolicyResolver.cjs +2 -1
  245. package/dist/development/src/model/service/AuthPolicyResolver.cjs.map +1 -1
  246. package/dist/development/src/model/service/AuthPolicyResolver.js +2 -1
  247. package/dist/development/src/model/service/AuthPolicyResolver.js.map +1 -1
  248. package/dist/development/src/model/service/CustomRoleManager.cjs +170 -0
  249. package/dist/development/src/model/service/CustomRoleManager.cjs.map +1 -0
  250. package/dist/development/src/model/service/CustomRoleManager.js +170 -0
  251. package/dist/development/src/model/service/CustomRoleManager.js.map +1 -0
  252. package/dist/development/src/model/service/EmailChangeManager.cjs +5 -4
  253. package/dist/development/src/model/service/EmailChangeManager.cjs.map +1 -1
  254. package/dist/development/src/model/service/EmailChangeManager.js +5 -4
  255. package/dist/development/src/model/service/EmailChangeManager.js.map +1 -1
  256. package/dist/development/src/model/service/EmailOtpManager.cjs +0 -1
  257. package/dist/development/src/model/service/EmailOtpManager.cjs.map +1 -1
  258. package/dist/development/src/model/service/EmailOtpManager.js +0 -1
  259. package/dist/development/src/model/service/EmailOtpManager.js.map +1 -1
  260. package/dist/development/src/model/service/EmailValidator.cjs +2 -1
  261. package/dist/development/src/model/service/EmailValidator.cjs.map +1 -1
  262. package/dist/development/src/model/service/EmailValidator.js +2 -1
  263. package/dist/development/src/model/service/EmailValidator.js.map +1 -1
  264. package/dist/development/src/model/service/EmailVerificationManager.cjs +5 -4
  265. package/dist/development/src/model/service/EmailVerificationManager.cjs.map +1 -1
  266. package/dist/development/src/model/service/EmailVerificationManager.js +5 -4
  267. package/dist/development/src/model/service/EmailVerificationManager.js.map +1 -1
  268. package/dist/development/src/model/service/GlobalRoleValidator.cjs +35 -0
  269. package/dist/development/src/model/service/GlobalRoleValidator.cjs.map +1 -0
  270. package/dist/development/src/model/service/GlobalRoleValidator.js +35 -0
  271. package/dist/development/src/model/service/GlobalRoleValidator.js.map +1 -0
  272. package/dist/development/src/model/service/IDPSignInManager.cjs +52 -16
  273. package/dist/development/src/model/service/IDPSignInManager.cjs.map +1 -1
  274. package/dist/development/src/model/service/IDPSignInManager.js +52 -16
  275. package/dist/development/src/model/service/IDPSignInManager.js.map +1 -1
  276. package/dist/development/src/model/service/InviteManager.cjs +2 -1
  277. package/dist/development/src/model/service/InviteManager.cjs.map +1 -1
  278. package/dist/development/src/model/service/InviteManager.js +2 -1
  279. package/dist/development/src/model/service/InviteManager.js.map +1 -1
  280. package/dist/development/src/model/service/PanelAccessResolver.cjs +32 -0
  281. package/dist/development/src/model/service/PanelAccessResolver.cjs.map +1 -0
  282. package/dist/development/src/model/service/PanelAccessResolver.js +32 -0
  283. package/dist/development/src/model/service/PanelAccessResolver.js.map +1 -0
  284. package/dist/development/src/model/service/PasswordChangeManager.cjs +2 -1
  285. package/dist/development/src/model/service/PasswordChangeManager.cjs.map +1 -1
  286. package/dist/development/src/model/service/PasswordChangeManager.js +2 -1
  287. package/dist/development/src/model/service/PasswordChangeManager.js.map +1 -1
  288. package/dist/development/src/model/service/PasswordResetManager.cjs +9 -3
  289. package/dist/development/src/model/service/PasswordResetManager.cjs.map +1 -1
  290. package/dist/development/src/model/service/PasswordResetManager.js +9 -3
  291. package/dist/development/src/model/service/PasswordResetManager.js.map +1 -1
  292. package/dist/development/src/model/service/PasswordlessSignInManager.cjs +24 -6
  293. package/dist/development/src/model/service/PasswordlessSignInManager.cjs.map +1 -1
  294. package/dist/development/src/model/service/PasswordlessSignInManager.js +24 -6
  295. package/dist/development/src/model/service/PasswordlessSignInManager.js.map +1 -1
  296. package/dist/development/src/model/service/PersonAccessManager.cjs +10 -2
  297. package/dist/development/src/model/service/PersonAccessManager.cjs.map +1 -1
  298. package/dist/development/src/model/service/PersonAccessManager.js +10 -2
  299. package/dist/development/src/model/service/PersonAccessManager.js.map +1 -1
  300. package/dist/development/src/model/service/PersonManager.cjs +2 -1
  301. package/dist/development/src/model/service/PersonManager.cjs.map +1 -1
  302. package/dist/development/src/model/service/PersonManager.js +2 -1
  303. package/dist/development/src/model/service/PersonManager.js.map +1 -1
  304. package/dist/development/src/model/service/ProjectMemberManager.cjs +2 -1
  305. package/dist/development/src/model/service/ProjectMemberManager.cjs.map +1 -1
  306. package/dist/development/src/model/service/ProjectMemberManager.js +2 -1
  307. package/dist/development/src/model/service/ProjectMemberManager.js.map +1 -1
  308. package/dist/development/src/model/service/RateLimiter.cjs +1 -2
  309. package/dist/development/src/model/service/RateLimiter.cjs.map +1 -1
  310. package/dist/development/src/model/service/RateLimiter.js +1 -2
  311. package/dist/development/src/model/service/RateLimiter.js.map +1 -1
  312. package/dist/development/src/model/service/RolesManager.cjs +17 -18
  313. package/dist/development/src/model/service/RolesManager.cjs.map +1 -1
  314. package/dist/development/src/model/service/RolesManager.js +18 -19
  315. package/dist/development/src/model/service/RolesManager.js.map +1 -1
  316. package/dist/development/src/model/service/SecretsManager.cjs +2 -1
  317. package/dist/development/src/model/service/SecretsManager.cjs.map +1 -1
  318. package/dist/development/src/model/service/SecretsManager.js +2 -1
  319. package/dist/development/src/model/service/SecretsManager.js.map +1 -1
  320. package/dist/development/src/model/service/SignInManager.cjs +9 -5
  321. package/dist/development/src/model/service/SignInManager.cjs.map +1 -1
  322. package/dist/development/src/model/service/SignInManager.js +9 -5
  323. package/dist/development/src/model/service/SignInManager.js.map +1 -1
  324. package/dist/development/src/model/service/SignOutManager.cjs +2 -1
  325. package/dist/development/src/model/service/SignOutManager.cjs.map +1 -1
  326. package/dist/development/src/model/service/SignOutManager.js +2 -1
  327. package/dist/development/src/model/service/SignOutManager.js.map +1 -1
  328. package/dist/development/src/model/service/SignUpManager.cjs +15 -7
  329. package/dist/development/src/model/service/SignUpManager.cjs.map +1 -1
  330. package/dist/development/src/model/service/SignUpManager.js +15 -7
  331. package/dist/development/src/model/service/SignUpManager.js.map +1 -1
  332. package/dist/development/src/model/service/apiKey/ApiKeyManager.cjs +56 -40
  333. package/dist/development/src/model/service/apiKey/ApiKeyManager.cjs.map +1 -1
  334. package/dist/development/src/model/service/apiKey/ApiKeyManager.js +57 -41
  335. package/dist/development/src/model/service/apiKey/ApiKeyManager.js.map +1 -1
  336. package/dist/development/src/model/service/apiKey/ApiKeyService.cjs.map +1 -1
  337. package/dist/development/src/model/service/apiKey/ApiKeyService.js.map +1 -1
  338. package/dist/development/src/model/service/apiKey/UnpersistedApiKeyManager.cjs +10 -1
  339. package/dist/development/src/model/service/apiKey/UnpersistedApiKeyManager.cjs.map +1 -1
  340. package/dist/development/src/model/service/apiKey/UnpersistedApiKeyManager.js +11 -2
  341. package/dist/development/src/model/service/apiKey/UnpersistedApiKeyManager.js.map +1 -1
  342. package/dist/development/src/model/service/idp/ClaimMapping.cjs +187 -0
  343. package/dist/development/src/model/service/idp/ClaimMapping.cjs.map +1 -0
  344. package/dist/development/src/model/service/idp/ClaimMapping.js +170 -0
  345. package/dist/development/src/model/service/idp/ClaimMapping.js.map +1 -0
  346. package/dist/development/src/model/service/idp/ClaimMappingEvaluator.cjs +155 -0
  347. package/dist/development/src/model/service/idp/ClaimMappingEvaluator.cjs.map +1 -0
  348. package/dist/development/src/model/service/idp/ClaimMappingEvaluator.js +155 -0
  349. package/dist/development/src/model/service/idp/ClaimMappingEvaluator.js.map +1 -0
  350. package/dist/development/src/model/service/idp/ClaimMappingValidation.cjs +83 -0
  351. package/dist/development/src/model/service/idp/ClaimMappingValidation.cjs.map +1 -0
  352. package/dist/development/src/model/service/idp/ClaimMappingValidation.js +83 -0
  353. package/dist/development/src/model/service/idp/ClaimMappingValidation.js.map +1 -0
  354. package/dist/development/src/model/service/idp/IDPClaimSyncService.cjs +261 -0
  355. package/dist/development/src/model/service/idp/IDPClaimSyncService.cjs.map +1 -0
  356. package/dist/development/src/model/service/idp/IDPClaimSyncService.js +261 -0
  357. package/dist/development/src/model/service/idp/IDPClaimSyncService.js.map +1 -0
  358. package/dist/development/src/model/service/idp/IDPManager.cjs +98 -21
  359. package/dist/development/src/model/service/idp/IDPManager.cjs.map +1 -1
  360. package/dist/development/src/model/service/idp/IDPManager.js +98 -21
  361. package/dist/development/src/model/service/idp/IDPManager.js.map +1 -1
  362. package/dist/development/src/model/service/idp/IdpSessionRevalidator.cjs +93 -28
  363. package/dist/development/src/model/service/idp/IdpSessionRevalidator.cjs.map +1 -1
  364. package/dist/development/src/model/service/idp/IdpSessionRevalidator.js +93 -28
  365. package/dist/development/src/model/service/idp/IdpSessionRevalidator.js.map +1 -1
  366. package/dist/development/src/model/service/idp/PersonIdentityProviderManager.cjs +8 -1
  367. package/dist/development/src/model/service/idp/PersonIdentityProviderManager.cjs.map +1 -1
  368. package/dist/development/src/model/service/idp/PersonIdentityProviderManager.js +8 -1
  369. package/dist/development/src/model/service/idp/PersonIdentityProviderManager.js.map +1 -1
  370. package/dist/development/src/model/service/idp/providers/OIDCHelpers.cjs +69 -33
  371. package/dist/development/src/model/service/idp/providers/OIDCHelpers.cjs.map +1 -1
  372. package/dist/development/src/model/service/idp/providers/OIDCHelpers.js +69 -33
  373. package/dist/development/src/model/service/idp/providers/OIDCHelpers.js.map +1 -1
  374. package/dist/development/src/model/service/idp/providers/OIDCProvider.cjs +4 -1
  375. package/dist/development/src/model/service/idp/providers/OIDCProvider.cjs.map +1 -1
  376. package/dist/development/src/model/service/idp/providers/OIDCProvider.js +4 -1
  377. package/dist/development/src/model/service/idp/providers/OIDCProvider.js.map +1 -1
  378. package/dist/development/src/model/utils/DatabaseContext.cjs +10 -3
  379. package/dist/development/src/model/utils/DatabaseContext.cjs.map +1 -1
  380. package/dist/development/src/model/utils/DatabaseContext.js +11 -4
  381. package/dist/development/src/model/utils/DatabaseContext.js.map +1 -1
  382. package/dist/development/src/model/utils/token.cjs +2 -2
  383. package/dist/development/src/model/utils/token.cjs.map +1 -1
  384. package/dist/development/src/model/utils/token.js +2 -2
  385. package/dist/development/src/model/utils/token.js.map +1 -1
  386. package/dist/development/src/resolvers/ResolverFactory.cjs +12 -3
  387. package/dist/development/src/resolvers/ResolverFactory.cjs.map +1 -1
  388. package/dist/development/src/resolvers/ResolverFactory.js +12 -3
  389. package/dist/development/src/resolvers/ResolverFactory.js.map +1 -1
  390. package/dist/development/src/resolvers/TenantResolverContextFactory.cjs +4 -4
  391. package/dist/development/src/resolvers/TenantResolverContextFactory.cjs.map +1 -1
  392. package/dist/development/src/resolvers/TenantResolverContextFactory.js +4 -4
  393. package/dist/development/src/resolvers/TenantResolverContextFactory.js.map +1 -1
  394. package/dist/development/src/resolvers/mutation/apiKey/CreateApiKeyMutationResolver.cjs +19 -9
  395. package/dist/development/src/resolvers/mutation/apiKey/CreateApiKeyMutationResolver.cjs.map +1 -1
  396. package/dist/development/src/resolvers/mutation/apiKey/CreateApiKeyMutationResolver.js +20 -10
  397. package/dist/development/src/resolvers/mutation/apiKey/CreateApiKeyMutationResolver.js.map +1 -1
  398. package/dist/development/src/resolvers/mutation/apiKey/DisableApiKeyMutationResolver.cjs +7 -5
  399. package/dist/development/src/resolvers/mutation/apiKey/DisableApiKeyMutationResolver.cjs.map +1 -1
  400. package/dist/development/src/resolvers/mutation/apiKey/DisableApiKeyMutationResolver.js +7 -5
  401. package/dist/development/src/resolvers/mutation/apiKey/DisableApiKeyMutationResolver.js.map +1 -1
  402. package/dist/development/src/resolvers/mutation/configuration/AuthPolicyMutationResolver.cjs +7 -5
  403. package/dist/development/src/resolvers/mutation/configuration/AuthPolicyMutationResolver.cjs.map +1 -1
  404. package/dist/development/src/resolvers/mutation/configuration/AuthPolicyMutationResolver.js +7 -5
  405. package/dist/development/src/resolvers/mutation/configuration/AuthPolicyMutationResolver.js.map +1 -1
  406. package/dist/development/src/resolvers/mutation/configuration/ConfigurationMutationResolver.cjs +7 -5
  407. package/dist/development/src/resolvers/mutation/configuration/ConfigurationMutationResolver.cjs.map +1 -1
  408. package/dist/development/src/resolvers/mutation/configuration/ConfigurationMutationResolver.js +7 -5
  409. package/dist/development/src/resolvers/mutation/configuration/ConfigurationMutationResolver.js.map +1 -1
  410. package/dist/development/src/resolvers/mutation/customRole/CustomRoleMutationResolver.cjs +124 -0
  411. package/dist/development/src/resolvers/mutation/customRole/CustomRoleMutationResolver.cjs.map +1 -0
  412. package/dist/development/src/resolvers/mutation/customRole/CustomRoleMutationResolver.js +124 -0
  413. package/dist/development/src/resolvers/mutation/customRole/CustomRoleMutationResolver.js.map +1 -0
  414. package/dist/development/src/resolvers/mutation/identity/GlobalRolesMutationResolver.cjs +35 -11
  415. package/dist/development/src/resolvers/mutation/identity/GlobalRolesMutationResolver.cjs.map +1 -1
  416. package/dist/development/src/resolvers/mutation/identity/GlobalRolesMutationResolver.js +35 -11
  417. package/dist/development/src/resolvers/mutation/identity/GlobalRolesMutationResolver.js.map +1 -1
  418. package/dist/development/src/resolvers/mutation/idp/AddIDPMutationResolver.cjs +10 -7
  419. package/dist/development/src/resolvers/mutation/idp/AddIDPMutationResolver.cjs.map +1 -1
  420. package/dist/development/src/resolvers/mutation/idp/AddIDPMutationResolver.js +10 -7
  421. package/dist/development/src/resolvers/mutation/idp/AddIDPMutationResolver.js.map +1 -1
  422. package/dist/development/src/resolvers/mutation/idp/DisableIDPMutationResolver.cjs +7 -5
  423. package/dist/development/src/resolvers/mutation/idp/DisableIDPMutationResolver.cjs.map +1 -1
  424. package/dist/development/src/resolvers/mutation/idp/DisableIDPMutationResolver.js +7 -5
  425. package/dist/development/src/resolvers/mutation/idp/DisableIDPMutationResolver.js.map +1 -1
  426. package/dist/development/src/resolvers/mutation/idp/DisconnectMyIdentityProviderMutationResolver.cjs +8 -6
  427. package/dist/development/src/resolvers/mutation/idp/DisconnectMyIdentityProviderMutationResolver.cjs.map +1 -1
  428. package/dist/development/src/resolvers/mutation/idp/DisconnectMyIdentityProviderMutationResolver.js +8 -6
  429. package/dist/development/src/resolvers/mutation/idp/DisconnectMyIdentityProviderMutationResolver.js.map +1 -1
  430. package/dist/development/src/resolvers/mutation/idp/EnableIDPMutationResolver.cjs +7 -5
  431. package/dist/development/src/resolvers/mutation/idp/EnableIDPMutationResolver.cjs.map +1 -1
  432. package/dist/development/src/resolvers/mutation/idp/EnableIDPMutationResolver.js +7 -5
  433. package/dist/development/src/resolvers/mutation/idp/EnableIDPMutationResolver.js.map +1 -1
  434. package/dist/development/src/resolvers/mutation/idp/UpdateIDPMutationResolver.cjs +10 -7
  435. package/dist/development/src/resolvers/mutation/idp/UpdateIDPMutationResolver.cjs.map +1 -1
  436. package/dist/development/src/resolvers/mutation/idp/UpdateIDPMutationResolver.js +10 -7
  437. package/dist/development/src/resolvers/mutation/idp/UpdateIDPMutationResolver.js.map +1 -1
  438. package/dist/development/src/resolvers/mutation/idp/audit.cjs +1 -0
  439. package/dist/development/src/resolvers/mutation/idp/audit.cjs.map +1 -1
  440. package/dist/development/src/resolvers/mutation/idp/audit.js +1 -0
  441. package/dist/development/src/resolvers/mutation/idp/audit.js.map +1 -1
  442. package/dist/development/src/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.cjs +38 -18
  443. package/dist/development/src/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.cjs.map +1 -1
  444. package/dist/development/src/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.js +38 -18
  445. package/dist/development/src/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.js.map +1 -1
  446. package/dist/development/src/resolvers/mutation/person/ChangePasswordMutationResolver.cjs +10 -8
  447. package/dist/development/src/resolvers/mutation/person/ChangePasswordMutationResolver.cjs.map +1 -1
  448. package/dist/development/src/resolvers/mutation/person/ChangePasswordMutationResolver.js +10 -8
  449. package/dist/development/src/resolvers/mutation/person/ChangePasswordMutationResolver.js.map +1 -1
  450. package/dist/development/src/resolvers/mutation/person/ChangeProfileMutationResolver.cjs +17 -11
  451. package/dist/development/src/resolvers/mutation/person/ChangeProfileMutationResolver.cjs.map +1 -1
  452. package/dist/development/src/resolvers/mutation/person/ChangeProfileMutationResolver.js +17 -11
  453. package/dist/development/src/resolvers/mutation/person/ChangeProfileMutationResolver.js.map +1 -1
  454. package/dist/development/src/resolvers/mutation/person/DisablePersonMutationResolver.cjs +10 -8
  455. package/dist/development/src/resolvers/mutation/person/DisablePersonMutationResolver.cjs.map +1 -1
  456. package/dist/development/src/resolvers/mutation/person/DisablePersonMutationResolver.js +10 -8
  457. package/dist/development/src/resolvers/mutation/person/DisablePersonMutationResolver.js.map +1 -1
  458. package/dist/development/src/resolvers/mutation/person/EmailOtpMutationResolver.cjs +10 -8
  459. package/dist/development/src/resolvers/mutation/person/EmailOtpMutationResolver.cjs.map +1 -1
  460. package/dist/development/src/resolvers/mutation/person/EmailOtpMutationResolver.js +10 -8
  461. package/dist/development/src/resolvers/mutation/person/EmailOtpMutationResolver.js.map +1 -1
  462. package/dist/development/src/resolvers/mutation/person/EmailVerificationMutationResolver.cjs +10 -8
  463. package/dist/development/src/resolvers/mutation/person/EmailVerificationMutationResolver.cjs.map +1 -1
  464. package/dist/development/src/resolvers/mutation/person/EmailVerificationMutationResolver.js +10 -8
  465. package/dist/development/src/resolvers/mutation/person/EmailVerificationMutationResolver.js.map +1 -1
  466. package/dist/development/src/resolvers/mutation/person/EnablePersonMutationResolver.cjs +61 -0
  467. package/dist/development/src/resolvers/mutation/person/EnablePersonMutationResolver.cjs.map +1 -0
  468. package/dist/development/src/resolvers/mutation/person/EnablePersonMutationResolver.js +61 -0
  469. package/dist/development/src/resolvers/mutation/person/EnablePersonMutationResolver.js.map +1 -0
  470. package/dist/development/src/resolvers/mutation/person/ForceSignOutMutationResolver.cjs +8 -6
  471. package/dist/development/src/resolvers/mutation/person/ForceSignOutMutationResolver.cjs.map +1 -1
  472. package/dist/development/src/resolvers/mutation/person/ForceSignOutMutationResolver.js +8 -6
  473. package/dist/development/src/resolvers/mutation/person/ForceSignOutMutationResolver.js.map +1 -1
  474. package/dist/development/src/resolvers/mutation/person/IDPMutationResolver.cjs +32 -5
  475. package/dist/development/src/resolvers/mutation/person/IDPMutationResolver.cjs.map +1 -1
  476. package/dist/development/src/resolvers/mutation/person/IDPMutationResolver.js +32 -5
  477. package/dist/development/src/resolvers/mutation/person/IDPMutationResolver.js.map +1 -1
  478. package/dist/development/src/resolvers/mutation/person/InviteMutationResolver.cjs +7 -5
  479. package/dist/development/src/resolvers/mutation/person/InviteMutationResolver.cjs.map +1 -1
  480. package/dist/development/src/resolvers/mutation/person/InviteMutationResolver.js +7 -5
  481. package/dist/development/src/resolvers/mutation/person/InviteMutationResolver.js.map +1 -1
  482. package/dist/development/src/resolvers/mutation/person/OtpMutationResolver.cjs +9 -7
  483. package/dist/development/src/resolvers/mutation/person/OtpMutationResolver.cjs.map +1 -1
  484. package/dist/development/src/resolvers/mutation/person/OtpMutationResolver.js +9 -7
  485. package/dist/development/src/resolvers/mutation/person/OtpMutationResolver.js.map +1 -1
  486. package/dist/development/src/resolvers/mutation/person/PasswordlessMutationResolver.cjs +12 -6
  487. package/dist/development/src/resolvers/mutation/person/PasswordlessMutationResolver.cjs.map +1 -1
  488. package/dist/development/src/resolvers/mutation/person/PasswordlessMutationResolver.js +12 -6
  489. package/dist/development/src/resolvers/mutation/person/PasswordlessMutationResolver.js.map +1 -1
  490. package/dist/development/src/resolvers/mutation/person/RegenerateBackupCodesMutationResolver.cjs +9 -7
  491. package/dist/development/src/resolvers/mutation/person/RegenerateBackupCodesMutationResolver.cjs.map +1 -1
  492. package/dist/development/src/resolvers/mutation/person/RegenerateBackupCodesMutationResolver.js +9 -7
  493. package/dist/development/src/resolvers/mutation/person/RegenerateBackupCodesMutationResolver.js.map +1 -1
  494. package/dist/development/src/resolvers/mutation/person/ResetPasswordMutationResolver.cjs +10 -8
  495. package/dist/development/src/resolvers/mutation/person/ResetPasswordMutationResolver.cjs.map +1 -1
  496. package/dist/development/src/resolvers/mutation/person/ResetPasswordMutationResolver.js +10 -8
  497. package/dist/development/src/resolvers/mutation/person/ResetPasswordMutationResolver.js.map +1 -1
  498. package/dist/development/src/resolvers/mutation/person/ResetPersonMfaMutationResolver.cjs +8 -6
  499. package/dist/development/src/resolvers/mutation/person/ResetPersonMfaMutationResolver.cjs.map +1 -1
  500. package/dist/development/src/resolvers/mutation/person/ResetPersonMfaMutationResolver.js +8 -6
  501. package/dist/development/src/resolvers/mutation/person/ResetPersonMfaMutationResolver.js.map +1 -1
  502. package/dist/development/src/resolvers/mutation/person/RevokeSessionMutationResolver.cjs +8 -6
  503. package/dist/development/src/resolvers/mutation/person/RevokeSessionMutationResolver.cjs.map +1 -1
  504. package/dist/development/src/resolvers/mutation/person/RevokeSessionMutationResolver.js +8 -6
  505. package/dist/development/src/resolvers/mutation/person/RevokeSessionMutationResolver.js.map +1 -1
  506. package/dist/development/src/resolvers/mutation/person/SignInMutationResolver.cjs +22 -14
  507. package/dist/development/src/resolvers/mutation/person/SignInMutationResolver.cjs.map +1 -1
  508. package/dist/development/src/resolvers/mutation/person/SignInMutationResolver.js +22 -14
  509. package/dist/development/src/resolvers/mutation/person/SignInMutationResolver.js.map +1 -1
  510. package/dist/development/src/resolvers/mutation/person/SignOutMutationResolver.cjs +7 -5
  511. package/dist/development/src/resolvers/mutation/person/SignOutMutationResolver.cjs.map +1 -1
  512. package/dist/development/src/resolvers/mutation/person/SignOutMutationResolver.js +7 -5
  513. package/dist/development/src/resolvers/mutation/person/SignOutMutationResolver.js.map +1 -1
  514. package/dist/development/src/resolvers/mutation/person/SignUpMutationResolver.cjs +10 -8
  515. package/dist/development/src/resolvers/mutation/person/SignUpMutationResolver.cjs.map +1 -1
  516. package/dist/development/src/resolvers/mutation/person/SignUpMutationResolver.js +10 -8
  517. package/dist/development/src/resolvers/mutation/person/SignUpMutationResolver.js.map +1 -1
  518. package/dist/development/src/resolvers/mutation/person/TogglePasswordlessMutationResolver.cjs +9 -7
  519. package/dist/development/src/resolvers/mutation/person/TogglePasswordlessMutationResolver.cjs.map +1 -1
  520. package/dist/development/src/resolvers/mutation/person/TogglePasswordlessMutationResolver.js +9 -7
  521. package/dist/development/src/resolvers/mutation/person/TogglePasswordlessMutationResolver.js.map +1 -1
  522. package/dist/development/src/resolvers/mutation/project/CreateProjectMutationResolver.cjs +7 -5
  523. package/dist/development/src/resolvers/mutation/project/CreateProjectMutationResolver.cjs.map +1 -1
  524. package/dist/development/src/resolvers/mutation/project/CreateProjectMutationResolver.js +7 -5
  525. package/dist/development/src/resolvers/mutation/project/CreateProjectMutationResolver.js.map +1 -1
  526. package/dist/development/src/resolvers/mutation/project/SetProjectSecretMutationResolver.cjs +7 -5
  527. package/dist/development/src/resolvers/mutation/project/SetProjectSecretMutationResolver.cjs.map +1 -1
  528. package/dist/development/src/resolvers/mutation/project/SetProjectSecretMutationResolver.js +7 -5
  529. package/dist/development/src/resolvers/mutation/project/SetProjectSecretMutationResolver.js.map +1 -1
  530. package/dist/development/src/resolvers/mutation/project/UpdateProjectMutationResolver.cjs +7 -5
  531. package/dist/development/src/resolvers/mutation/project/UpdateProjectMutationResolver.cjs.map +1 -1
  532. package/dist/development/src/resolvers/mutation/project/UpdateProjectMutationResolver.js +7 -5
  533. package/dist/development/src/resolvers/mutation/project/UpdateProjectMutationResolver.js.map +1 -1
  534. package/dist/development/src/resolvers/mutation/projectMember/AddProjectMemberMutationResolver.cjs +7 -5
  535. package/dist/development/src/resolvers/mutation/projectMember/AddProjectMemberMutationResolver.cjs.map +1 -1
  536. package/dist/development/src/resolvers/mutation/projectMember/AddProjectMemberMutationResolver.js +7 -5
  537. package/dist/development/src/resolvers/mutation/projectMember/AddProjectMemberMutationResolver.js.map +1 -1
  538. package/dist/development/src/resolvers/mutation/projectMember/RemoveProjectMemberMutationResolver.cjs +8 -6
  539. package/dist/development/src/resolvers/mutation/projectMember/RemoveProjectMemberMutationResolver.cjs.map +1 -1
  540. package/dist/development/src/resolvers/mutation/projectMember/RemoveProjectMemberMutationResolver.js +8 -6
  541. package/dist/development/src/resolvers/mutation/projectMember/RemoveProjectMemberMutationResolver.js.map +1 -1
  542. package/dist/development/src/resolvers/mutation/projectMember/UpdateProjectMemberMutationResolver.cjs +8 -6
  543. package/dist/development/src/resolvers/mutation/projectMember/UpdateProjectMemberMutationResolver.cjs.map +1 -1
  544. package/dist/development/src/resolvers/mutation/projectMember/UpdateProjectMemberMutationResolver.js +8 -6
  545. package/dist/development/src/resolvers/mutation/projectMember/UpdateProjectMemberMutationResolver.js.map +1 -1
  546. package/dist/development/src/resolvers/mutation/projectMember/audit.cjs +2 -1
  547. package/dist/development/src/resolvers/mutation/projectMember/audit.cjs.map +1 -1
  548. package/dist/development/src/resolvers/mutation/projectMember/audit.js +2 -1
  549. package/dist/development/src/resolvers/mutation/projectMember/audit.js.map +1 -1
  550. package/dist/development/src/resolvers/query/ApiKeyQueryResolver.cjs +8 -6
  551. package/dist/development/src/resolvers/query/ApiKeyQueryResolver.cjs.map +1 -1
  552. package/dist/development/src/resolvers/query/ApiKeyQueryResolver.js +8 -6
  553. package/dist/development/src/resolvers/query/ApiKeyQueryResolver.js.map +1 -1
  554. package/dist/development/src/resolvers/query/AuthLogQueryResolver.cjs +7 -5
  555. package/dist/development/src/resolvers/query/AuthLogQueryResolver.cjs.map +1 -1
  556. package/dist/development/src/resolvers/query/AuthLogQueryResolver.js +7 -5
  557. package/dist/development/src/resolvers/query/AuthLogQueryResolver.js.map +1 -1
  558. package/dist/development/src/resolvers/query/AuthPolicyQueryResolver.cjs +8 -6
  559. package/dist/development/src/resolvers/query/AuthPolicyQueryResolver.cjs.map +1 -1
  560. package/dist/development/src/resolvers/query/AuthPolicyQueryResolver.js +8 -6
  561. package/dist/development/src/resolvers/query/AuthPolicyQueryResolver.js.map +1 -1
  562. package/dist/development/src/resolvers/query/ConfigurationQueryResolver.cjs +8 -6
  563. package/dist/development/src/resolvers/query/ConfigurationQueryResolver.cjs.map +1 -1
  564. package/dist/development/src/resolvers/query/ConfigurationQueryResolver.js +8 -6
  565. package/dist/development/src/resolvers/query/ConfigurationQueryResolver.js.map +1 -1
  566. package/dist/development/src/resolvers/query/CustomRoleQueryResolver.cjs +55 -0
  567. package/dist/development/src/resolvers/query/CustomRoleQueryResolver.cjs.map +1 -0
  568. package/dist/development/src/resolvers/query/CustomRoleQueryResolver.js +55 -0
  569. package/dist/development/src/resolvers/query/CustomRoleQueryResolver.js.map +1 -0
  570. package/dist/development/src/resolvers/query/IDPQueryResolver.cjs +7 -5
  571. package/dist/development/src/resolvers/query/IDPQueryResolver.cjs.map +1 -1
  572. package/dist/development/src/resolvers/query/IDPQueryResolver.js +7 -5
  573. package/dist/development/src/resolvers/query/IDPQueryResolver.js.map +1 -1
  574. package/dist/development/src/resolvers/query/MailTemplateQueryResolver.cjs +21 -14
  575. package/dist/development/src/resolvers/query/MailTemplateQueryResolver.cjs.map +1 -1
  576. package/dist/development/src/resolvers/query/MailTemplateQueryResolver.js +21 -14
  577. package/dist/development/src/resolvers/query/MailTemplateQueryResolver.js.map +1 -1
  578. package/dist/development/src/resolvers/query/PersonQueryResolver.cjs +7 -5
  579. package/dist/development/src/resolvers/query/PersonQueryResolver.cjs.map +1 -1
  580. package/dist/development/src/resolvers/query/PersonQueryResolver.js +7 -5
  581. package/dist/development/src/resolvers/query/PersonQueryResolver.js.map +1 -1
  582. package/dist/development/src/resolvers/query/ProjectMembersQueryResolver.cjs +7 -5
  583. package/dist/development/src/resolvers/query/ProjectMembersQueryResolver.cjs.map +1 -1
  584. package/dist/development/src/resolvers/query/ProjectMembersQueryResolver.js +7 -5
  585. package/dist/development/src/resolvers/query/ProjectMembersQueryResolver.js.map +1 -1
  586. package/dist/development/src/resolvers/query/ProjectQueryResolver.cjs +10 -7
  587. package/dist/development/src/resolvers/query/ProjectQueryResolver.cjs.map +1 -1
  588. package/dist/development/src/resolvers/query/ProjectQueryResolver.js +10 -7
  589. package/dist/development/src/resolvers/query/ProjectQueryResolver.js.map +1 -1
  590. package/dist/development/src/resolvers/responseHelpers/ApiKeyResponseFactory.cjs +7 -5
  591. package/dist/development/src/resolvers/responseHelpers/ApiKeyResponseFactory.cjs.map +1 -1
  592. package/dist/development/src/resolvers/responseHelpers/ApiKeyResponseFactory.js +7 -5
  593. package/dist/development/src/resolvers/responseHelpers/ApiKeyResponseFactory.js.map +1 -1
  594. package/dist/development/src/resolvers/responseHelpers/PersonResponseFactory.cjs +5 -0
  595. package/dist/development/src/resolvers/responseHelpers/PersonResponseFactory.cjs.map +1 -1
  596. package/dist/development/src/resolvers/responseHelpers/PersonResponseFactory.js +5 -0
  597. package/dist/development/src/resolvers/responseHelpers/PersonResponseFactory.js.map +1 -1
  598. package/dist/development/src/resolvers/responseHelpers/ProjectResponseFactory.cjs +23 -0
  599. package/dist/development/src/resolvers/responseHelpers/ProjectResponseFactory.cjs.map +1 -0
  600. package/dist/development/src/resolvers/responseHelpers/ProjectResponseFactory.js +23 -0
  601. package/dist/development/src/resolvers/responseHelpers/ProjectResponseFactory.js.map +1 -0
  602. package/dist/development/src/resolvers/responseHelpers/SignInResponseFactory.cjs +8 -6
  603. package/dist/development/src/resolvers/responseHelpers/SignInResponseFactory.cjs.map +1 -1
  604. package/dist/development/src/resolvers/responseHelpers/SignInResponseFactory.js +8 -6
  605. package/dist/development/src/resolvers/responseHelpers/SignInResponseFactory.js.map +1 -1
  606. package/dist/development/src/resolvers/types/IdentityTypeResolver.cjs +50 -18
  607. package/dist/development/src/resolvers/types/IdentityTypeResolver.cjs.map +1 -1
  608. package/dist/development/src/resolvers/types/IdentityTypeResolver.js +50 -18
  609. package/dist/development/src/resolvers/types/IdentityTypeResolver.js.map +1 -1
  610. package/dist/development/src/resolvers/types/PersonTypeResolver.cjs +38 -8
  611. package/dist/development/src/resolvers/types/PersonTypeResolver.cjs.map +1 -1
  612. package/dist/development/src/resolvers/types/PersonTypeResolver.js +38 -8
  613. package/dist/development/src/resolvers/types/PersonTypeResolver.js.map +1 -1
  614. package/dist/development/src/resolvers/types/ProjectTypeResolver.cjs +31 -6
  615. package/dist/development/src/resolvers/types/ProjectTypeResolver.cjs.map +1 -1
  616. package/dist/development/src/resolvers/types/ProjectTypeResolver.js +31 -6
  617. package/dist/development/src/resolvers/types/ProjectTypeResolver.js.map +1 -1
  618. package/dist/development/src/schema/tenant.graphql.cjs +275 -15
  619. package/dist/development/src/schema/tenant.graphql.cjs.map +1 -1
  620. package/dist/development/src/schema/tenant.graphql.js +275 -15
  621. package/dist/development/src/schema/tenant.graphql.js.map +1 -1
  622. package/dist/production/index.cjs +69 -0
  623. package/dist/production/index.cjs.map +1 -1
  624. package/dist/production/index.js +71 -2
  625. package/dist/production/index.js.map +1 -1
  626. package/dist/production/src/TenantContainer.cjs +39 -10
  627. package/dist/production/src/TenantContainer.cjs.map +1 -1
  628. package/dist/production/src/TenantContainer.js +39 -10
  629. package/dist/production/src/TenantContainer.js.map +1 -1
  630. package/dist/production/src/bridges/system/IdentityFetcher.cjs +9 -7
  631. package/dist/production/src/bridges/system/IdentityFetcher.cjs.map +1 -1
  632. package/dist/production/src/bridges/system/IdentityFetcher.js +9 -7
  633. package/dist/production/src/bridges/system/IdentityFetcher.js.map +1 -1
  634. package/dist/production/src/migrations/2026-06-18-120000-idp-claim-mapping.cjs +10 -0
  635. package/dist/production/src/migrations/2026-06-18-120000-idp-claim-mapping.cjs.map +1 -0
  636. package/dist/production/src/migrations/2026-06-18-120000-idp-claim-mapping.js +11 -0
  637. package/dist/production/src/migrations/2026-06-18-120000-idp-claim-mapping.js.map +1 -0
  638. package/dist/production/src/migrations/2026-08-03-120000-person-enable-auth-log.cjs +9 -0
  639. package/dist/production/src/migrations/2026-08-03-120000-person-enable-auth-log.cjs.map +1 -0
  640. package/dist/production/src/migrations/2026-08-03-120000-person-enable-auth-log.js +10 -0
  641. package/dist/production/src/migrations/2026-08-03-120000-person-enable-auth-log.js.map +1 -0
  642. package/dist/production/src/migrations/2026-08-04-120000-config-panel.cjs +11 -0
  643. package/dist/production/src/migrations/2026-08-04-120000-config-panel.cjs.map +1 -0
  644. package/dist/production/src/migrations/2026-08-04-120000-config-panel.js +12 -0
  645. package/dist/production/src/migrations/2026-08-04-120000-config-panel.js.map +1 -0
  646. package/dist/production/src/migrations/2026-09-04-120000-idp-disable-local-authentication.cjs +18 -0
  647. package/dist/production/src/migrations/2026-09-04-120000-idp-disable-local-authentication.cjs.map +1 -0
  648. package/dist/production/src/migrations/2026-09-04-120000-idp-disable-local-authentication.js +19 -0
  649. package/dist/production/src/migrations/2026-09-04-120000-idp-disable-local-authentication.js.map +1 -0
  650. package/dist/production/src/migrations/2026-09-11-120000-custom-role.cjs +18 -0
  651. package/dist/production/src/migrations/2026-09-11-120000-custom-role.cjs.map +1 -0
  652. package/dist/production/src/migrations/2026-09-11-120000-custom-role.js +19 -0
  653. package/dist/production/src/migrations/2026-09-11-120000-custom-role.js.map +1 -0
  654. package/dist/production/src/migrations/runner.cjs +17 -5
  655. package/dist/production/src/migrations/runner.cjs.map +1 -1
  656. package/dist/production/src/migrations/runner.js +17 -5
  657. package/dist/production/src/migrations/runner.js.map +1 -1
  658. package/dist/production/src/migrations/snapshot.cjs +22 -2
  659. package/dist/production/src/migrations/snapshot.cjs.map +1 -1
  660. package/dist/production/src/migrations/snapshot.js +22 -2
  661. package/dist/production/src/migrations/snapshot.js.map +1 -1
  662. package/dist/production/src/model/authorization/CustomRoleAuthorizator.cjs +65 -0
  663. package/dist/production/src/model/authorization/CustomRoleAuthorizator.cjs.map +1 -0
  664. package/dist/production/src/model/authorization/CustomRoleAuthorizator.js +65 -0
  665. package/dist/production/src/model/authorization/CustomRoleAuthorizator.js.map +1 -0
  666. package/dist/production/src/model/authorization/CustomRolePermissions.cjs +404 -0
  667. package/dist/production/src/model/authorization/CustomRolePermissions.cjs.map +1 -0
  668. package/dist/production/src/model/authorization/CustomRolePermissions.js +387 -0
  669. package/dist/production/src/model/authorization/CustomRolePermissions.js.map +1 -0
  670. package/dist/production/src/model/authorization/PermissionActions.cjs +19 -16
  671. package/dist/production/src/model/authorization/PermissionActions.cjs.map +1 -1
  672. package/dist/production/src/model/authorization/PermissionActions.js +19 -16
  673. package/dist/production/src/model/authorization/PermissionActions.js.map +1 -1
  674. package/dist/production/src/model/authorization/PermissionContextFactory.cjs +20 -2
  675. package/dist/production/src/model/authorization/PermissionContextFactory.cjs.map +1 -1
  676. package/dist/production/src/model/authorization/PermissionContextFactory.js +20 -2
  677. package/dist/production/src/model/authorization/PermissionContextFactory.js.map +1 -1
  678. package/dist/production/src/model/authorization/PermissionsFactory.cjs +32 -24
  679. package/dist/production/src/model/authorization/PermissionsFactory.cjs.map +1 -1
  680. package/dist/production/src/model/authorization/PermissionsFactory.js +33 -25
  681. package/dist/production/src/model/authorization/PermissionsFactory.js.map +1 -1
  682. package/dist/production/src/model/authorization/Roles.cjs +8 -0
  683. package/dist/production/src/model/authorization/Roles.cjs.map +1 -1
  684. package/dist/production/src/model/authorization/Roles.js +8 -0
  685. package/dist/production/src/model/authorization/Roles.js.map +1 -1
  686. package/dist/production/src/model/authorization/TargetIdentityPermission.cjs +35 -0
  687. package/dist/production/src/model/authorization/TargetIdentityPermission.cjs.map +1 -0
  688. package/dist/production/src/model/authorization/TargetIdentityPermission.js +35 -0
  689. package/dist/production/src/model/authorization/TargetIdentityPermission.js.map +1 -0
  690. package/dist/production/src/model/commands/apiKey/ApiKeyHelper.cjs +19 -0
  691. package/dist/production/src/model/commands/apiKey/ApiKeyHelper.cjs.map +1 -1
  692. package/dist/production/src/model/commands/apiKey/ApiKeyHelper.js +19 -0
  693. package/dist/production/src/model/commands/apiKey/ApiKeyHelper.js.map +1 -1
  694. package/dist/production/src/model/commands/apiKey/CreateApiKeyCommand.cjs +4 -2
  695. package/dist/production/src/model/commands/apiKey/CreateApiKeyCommand.cjs.map +1 -1
  696. package/dist/production/src/model/commands/apiKey/CreateApiKeyCommand.js +5 -3
  697. package/dist/production/src/model/commands/apiKey/CreateApiKeyCommand.js.map +1 -1
  698. package/dist/production/src/model/commands/apiKey/ProlongApiKeyCommand.cjs +9 -10
  699. package/dist/production/src/model/commands/apiKey/ProlongApiKeyCommand.cjs.map +1 -1
  700. package/dist/production/src/model/commands/apiKey/ProlongApiKeyCommand.js +10 -11
  701. package/dist/production/src/model/commands/apiKey/ProlongApiKeyCommand.js.map +1 -1
  702. package/dist/production/src/model/commands/authLog/CreateAuthLogEntryCommand.cjs.map +1 -1
  703. package/dist/production/src/model/commands/authLog/CreateAuthLogEntryCommand.js.map +1 -1
  704. package/dist/production/src/model/commands/configuration/UpdateConfigurationCommand.cjs +5 -3
  705. package/dist/production/src/model/commands/configuration/UpdateConfigurationCommand.cjs.map +1 -1
  706. package/dist/production/src/model/commands/configuration/UpdateConfigurationCommand.js +5 -3
  707. package/dist/production/src/model/commands/configuration/UpdateConfigurationCommand.js.map +1 -1
  708. package/dist/production/src/model/commands/customRole/CreateCustomRoleCommand.cjs +23 -0
  709. package/dist/production/src/model/commands/customRole/CreateCustomRoleCommand.cjs.map +1 -0
  710. package/dist/production/src/model/commands/customRole/CreateCustomRoleCommand.js +23 -0
  711. package/dist/production/src/model/commands/customRole/CreateCustomRoleCommand.js.map +1 -0
  712. package/dist/production/src/model/commands/customRole/DeleteCustomRoleCommand.cjs +14 -0
  713. package/dist/production/src/model/commands/customRole/DeleteCustomRoleCommand.cjs.map +1 -0
  714. package/dist/production/src/model/commands/customRole/DeleteCustomRoleCommand.js +14 -0
  715. package/dist/production/src/model/commands/customRole/DeleteCustomRoleCommand.js.map +1 -0
  716. package/dist/production/src/model/commands/customRole/RemoveCustomRoleAssignmentsCommand.cjs +16 -0
  717. package/dist/production/src/model/commands/customRole/RemoveCustomRoleAssignmentsCommand.cjs.map +1 -0
  718. package/dist/production/src/model/commands/customRole/RemoveCustomRoleAssignmentsCommand.js +16 -0
  719. package/dist/production/src/model/commands/customRole/RemoveCustomRoleAssignmentsCommand.js.map +1 -0
  720. package/dist/production/src/model/commands/customRole/UpdateCustomRoleCommand.cjs +19 -0
  721. package/dist/production/src/model/commands/customRole/UpdateCustomRoleCommand.cjs.map +1 -0
  722. package/dist/production/src/model/commands/customRole/UpdateCustomRoleCommand.js +19 -0
  723. package/dist/production/src/model/commands/customRole/UpdateCustomRoleCommand.js.map +1 -0
  724. package/dist/production/src/model/commands/identity/PatchIdentityGlobalRoles.cjs +1 -1
  725. package/dist/production/src/model/commands/identity/PatchIdentityGlobalRoles.cjs.map +1 -1
  726. package/dist/production/src/model/commands/identity/PatchIdentityGlobalRoles.js +1 -1
  727. package/dist/production/src/model/commands/identity/PatchIdentityGlobalRoles.js.map +1 -1
  728. package/dist/production/src/model/commands/idp/ClaimIdpRevalidationCommand.cjs +3 -7
  729. package/dist/production/src/model/commands/idp/ClaimIdpRevalidationCommand.cjs.map +1 -1
  730. package/dist/production/src/model/commands/idp/ClaimIdpRevalidationCommand.js +3 -7
  731. package/dist/production/src/model/commands/idp/ClaimIdpRevalidationCommand.js.map +1 -1
  732. package/dist/production/src/model/commands/idp/CreateIdpCommand.cjs +8 -2
  733. package/dist/production/src/model/commands/idp/CreateIdpCommand.cjs.map +1 -1
  734. package/dist/production/src/model/commands/idp/CreateIdpCommand.js +8 -2
  735. package/dist/production/src/model/commands/idp/CreateIdpCommand.js.map +1 -1
  736. package/dist/production/src/model/commands/idp/CreateIdpSessionCommand.cjs +4 -1
  737. package/dist/production/src/model/commands/idp/CreateIdpSessionCommand.cjs.map +1 -1
  738. package/dist/production/src/model/commands/idp/CreateIdpSessionCommand.js +5 -2
  739. package/dist/production/src/model/commands/idp/CreateIdpSessionCommand.js.map +1 -1
  740. package/dist/production/src/model/commands/idp/UpdateIdpCommand.cjs +6 -2
  741. package/dist/production/src/model/commands/idp/UpdateIdpCommand.cjs.map +1 -1
  742. package/dist/production/src/model/commands/idp/UpdateIdpCommand.js +6 -2
  743. package/dist/production/src/model/commands/idp/UpdateIdpCommand.js.map +1 -1
  744. package/dist/production/src/model/commands/idp/UpdateIdpSessionCommand.cjs +2 -1
  745. package/dist/production/src/model/commands/idp/UpdateIdpSessionCommand.cjs.map +1 -1
  746. package/dist/production/src/model/commands/idp/UpdateIdpSessionCommand.js +3 -2
  747. package/dist/production/src/model/commands/idp/UpdateIdpSessionCommand.js.map +1 -1
  748. package/dist/production/src/model/commands/membership/{RemoveProjectMembershipsCommand.cjs → RemoveProjectMembershipCommand.cjs} +1 -1
  749. package/dist/production/src/model/commands/membership/RemoveProjectMembershipCommand.cjs.map +1 -0
  750. package/dist/production/src/model/commands/membership/{RemoveProjectMembershipsCommand.js → RemoveProjectMembershipCommand.js} +1 -1
  751. package/dist/production/src/model/commands/membership/RemoveProjectMembershipCommand.js.map +1 -0
  752. package/dist/production/src/model/commands/membership/UpdateProjectMemberCommand.cjs +2 -2
  753. package/dist/production/src/model/commands/membership/UpdateProjectMemberCommand.cjs.map +1 -1
  754. package/dist/production/src/model/commands/membership/UpdateProjectMemberCommand.js +1 -1
  755. package/dist/production/src/model/commands/membership/UpdateProjectMemberCommand.js.map +1 -1
  756. package/dist/production/src/model/commands/person/CreatePersonCommand.cjs +1 -0
  757. package/dist/production/src/model/commands/person/CreatePersonCommand.cjs.map +1 -1
  758. package/dist/production/src/model/commands/person/CreatePersonCommand.js +1 -0
  759. package/dist/production/src/model/commands/person/CreatePersonCommand.js.map +1 -1
  760. package/dist/production/src/model/commands/person/EnablePersonCommand.cjs +17 -0
  761. package/dist/production/src/model/commands/person/EnablePersonCommand.cjs.map +1 -0
  762. package/dist/production/src/model/commands/person/EnablePersonCommand.js +17 -0
  763. package/dist/production/src/model/commands/person/EnablePersonCommand.js.map +1 -0
  764. package/dist/production/src/model/commands/person/SetMfaGraceUntilCommand.cjs +3 -3
  765. package/dist/production/src/model/commands/person/SetMfaGraceUntilCommand.cjs.map +1 -1
  766. package/dist/production/src/model/commands/person/SetMfaGraceUntilCommand.js +4 -4
  767. package/dist/production/src/model/commands/person/SetMfaGraceUntilCommand.js.map +1 -1
  768. package/dist/production/src/model/commands/personToken/ResetPasswordCommand.cjs +2 -3
  769. package/dist/production/src/model/commands/personToken/ResetPasswordCommand.cjs.map +1 -1
  770. package/dist/production/src/model/commands/personToken/ResetPasswordCommand.js +2 -3
  771. package/dist/production/src/model/commands/personToken/ResetPasswordCommand.js.map +1 -1
  772. package/dist/production/src/model/commands/personToken/SaveEmailOtpTokenCommand.cjs +3 -3
  773. package/dist/production/src/model/commands/personToken/SaveEmailOtpTokenCommand.cjs.map +1 -1
  774. package/dist/production/src/model/commands/personToken/SaveEmailOtpTokenCommand.js +4 -4
  775. package/dist/production/src/model/commands/personToken/SaveEmailOtpTokenCommand.js.map +1 -1
  776. package/dist/production/src/model/commands/personToken/SavePersonTokenCommand.cjs +12 -6
  777. package/dist/production/src/model/commands/personToken/SavePersonTokenCommand.cjs.map +1 -1
  778. package/dist/production/src/model/commands/personToken/SavePersonTokenCommand.js +13 -7
  779. package/dist/production/src/model/commands/personToken/SavePersonTokenCommand.js.map +1 -1
  780. package/dist/production/src/model/commands/rateLimit/RecordRateLimitEventCommand.cjs +1 -2
  781. package/dist/production/src/model/commands/rateLimit/RecordRateLimitEventCommand.cjs.map +1 -1
  782. package/dist/production/src/model/commands/rateLimit/RecordRateLimitEventCommand.js +1 -2
  783. package/dist/production/src/model/commands/rateLimit/RecordRateLimitEventCommand.js.map +1 -1
  784. package/dist/production/src/model/mailing/UserMailer.cjs +2 -1
  785. package/dist/production/src/model/mailing/UserMailer.cjs.map +1 -1
  786. package/dist/production/src/model/mailing/UserMailer.js +2 -1
  787. package/dist/production/src/model/mailing/UserMailer.js.map +1 -1
  788. package/dist/production/src/model/queries/apiKey/ApiKeyQuery.cjs +8 -1
  789. package/dist/production/src/model/queries/apiKey/ApiKeyQuery.cjs.map +1 -1
  790. package/dist/production/src/model/queries/apiKey/ApiKeyQuery.js +9 -2
  791. package/dist/production/src/model/queries/apiKey/ApiKeyQuery.js.map +1 -1
  792. package/dist/production/src/model/queries/apiKey/ApiKeySessionsQuery.cjs +2 -3
  793. package/dist/production/src/model/queries/apiKey/ApiKeySessionsQuery.cjs.map +1 -1
  794. package/dist/production/src/model/queries/apiKey/ApiKeySessionsQuery.js +2 -3
  795. package/dist/production/src/model/queries/apiKey/ApiKeySessionsQuery.js.map +1 -1
  796. package/dist/production/src/model/queries/authLog/NextLoginAttemptQuery.cjs +12 -10
  797. package/dist/production/src/model/queries/authLog/NextLoginAttemptQuery.cjs.map +1 -1
  798. package/dist/production/src/model/queries/authLog/NextLoginAttemptQuery.js +12 -10
  799. package/dist/production/src/model/queries/authLog/NextLoginAttemptQuery.js.map +1 -1
  800. package/dist/production/src/model/queries/authLog/NextMailAttemptQuery.cjs +10 -8
  801. package/dist/production/src/model/queries/authLog/NextMailAttemptQuery.cjs.map +1 -1
  802. package/dist/production/src/model/queries/authLog/NextMailAttemptQuery.js +10 -8
  803. package/dist/production/src/model/queries/authLog/NextMailAttemptQuery.js.map +1 -1
  804. package/dist/production/src/model/queries/configuration/ConfigurationQuery.cjs +4 -0
  805. package/dist/production/src/model/queries/configuration/ConfigurationQuery.cjs.map +1 -1
  806. package/dist/production/src/model/queries/configuration/ConfigurationQuery.js +4 -0
  807. package/dist/production/src/model/queries/configuration/ConfigurationQuery.js.map +1 -1
  808. package/dist/production/src/model/queries/customRole/CustomRolesQuery.cjs +23 -0
  809. package/dist/production/src/model/queries/customRole/CustomRolesQuery.cjs.map +1 -0
  810. package/dist/production/src/model/queries/customRole/CustomRolesQuery.js +23 -0
  811. package/dist/production/src/model/queries/customRole/CustomRolesQuery.js.map +1 -0
  812. package/dist/production/src/model/queries/identity/IdentitiesHoldingRoleCountQuery.cjs +15 -0
  813. package/dist/production/src/model/queries/identity/IdentitiesHoldingRoleCountQuery.cjs.map +1 -0
  814. package/dist/production/src/model/queries/identity/IdentitiesHoldingRoleCountQuery.js +15 -0
  815. package/dist/production/src/model/queries/identity/IdentitiesHoldingRoleCountQuery.js.map +1 -0
  816. package/dist/production/src/model/queries/identity/IdentityQuery.cjs +7 -2
  817. package/dist/production/src/model/queries/identity/IdentityQuery.cjs.map +1 -1
  818. package/dist/production/src/model/queries/identity/IdentityQuery.js +7 -2
  819. package/dist/production/src/model/queries/identity/IdentityQuery.js.map +1 -1
  820. package/dist/production/src/model/queries/idp/LocalAuthDisablingIdpsQuery.cjs +21 -0
  821. package/dist/production/src/model/queries/idp/LocalAuthDisablingIdpsQuery.cjs.map +1 -0
  822. package/dist/production/src/model/queries/idp/LocalAuthDisablingIdpsQuery.js +21 -0
  823. package/dist/production/src/model/queries/idp/LocalAuthDisablingIdpsQuery.js.map +1 -0
  824. package/dist/production/src/model/queries/idp/PersonIdentityProvidersQuery.cjs +1 -1
  825. package/dist/production/src/model/queries/idp/PersonIdentityProvidersQuery.cjs.map +1 -1
  826. package/dist/production/src/model/queries/idp/PersonIdentityProvidersQuery.js +1 -1
  827. package/dist/production/src/model/queries/idp/PersonIdentityProvidersQuery.js.map +1 -1
  828. package/dist/production/src/model/queries/idp/helpers.cjs +3 -3
  829. package/dist/production/src/model/queries/idp/helpers.cjs.map +1 -1
  830. package/dist/production/src/model/queries/idp/helpers.js +3 -3
  831. package/dist/production/src/model/queries/idp/helpers.js.map +1 -1
  832. package/dist/production/src/model/queries/membership/IdentityHasProjectMembershipsQuery.cjs +15 -0
  833. package/dist/production/src/model/queries/membership/IdentityHasProjectMembershipsQuery.cjs.map +1 -0
  834. package/dist/production/src/model/queries/membership/IdentityHasProjectMembershipsQuery.js +15 -0
  835. package/dist/production/src/model/queries/membership/IdentityHasProjectMembershipsQuery.js.map +1 -0
  836. package/dist/production/src/model/queries/membership/ProjectMembersQuery.cjs +1 -1
  837. package/dist/production/src/model/queries/membership/ProjectMembersQuery.cjs.map +1 -1
  838. package/dist/production/src/model/queries/membership/ProjectMembersQuery.js +1 -1
  839. package/dist/production/src/model/queries/membership/ProjectMembersQuery.js.map +1 -1
  840. package/dist/production/src/model/queries/person/PersonQueryBuilderFactory.cjs +2 -2
  841. package/dist/production/src/model/queries/person/PersonQueryBuilderFactory.cjs.map +1 -1
  842. package/dist/production/src/model/queries/person/PersonQueryBuilderFactory.js +2 -2
  843. package/dist/production/src/model/queries/person/PersonQueryBuilderFactory.js.map +1 -1
  844. package/dist/production/src/model/queries/personToken/PersonTokenQuery.cjs +1 -1
  845. package/dist/production/src/model/queries/personToken/PersonTokenQuery.cjs.map +1 -1
  846. package/dist/production/src/model/queries/personToken/PersonTokenQuery.js +1 -1
  847. package/dist/production/src/model/queries/personToken/PersonTokenQuery.js.map +1 -1
  848. package/dist/production/src/model/queries/project/ProjectsByIdentityQuery.cjs +4 -1
  849. package/dist/production/src/model/queries/project/ProjectsByIdentityQuery.cjs.map +1 -1
  850. package/dist/production/src/model/queries/project/ProjectsByIdentityQuery.js +4 -1
  851. package/dist/production/src/model/queries/project/ProjectsByIdentityQuery.js.map +1 -1
  852. package/dist/production/src/model/queries/rateLimit/RateLimitCountQuery.cjs +3 -3
  853. package/dist/production/src/model/queries/rateLimit/RateLimitCountQuery.cjs.map +1 -1
  854. package/dist/production/src/model/queries/rateLimit/RateLimitCountQuery.js +3 -3
  855. package/dist/production/src/model/queries/rateLimit/RateLimitCountQuery.js.map +1 -1
  856. package/dist/production/src/model/service/AuthLogService.cjs +8 -2
  857. package/dist/production/src/model/service/AuthLogService.cjs.map +1 -1
  858. package/dist/production/src/model/service/AuthLogService.js +8 -2
  859. package/dist/production/src/model/service/AuthLogService.js.map +1 -1
  860. package/dist/production/src/model/service/AuthPolicyManager.cjs +2 -1
  861. package/dist/production/src/model/service/AuthPolicyManager.cjs.map +1 -1
  862. package/dist/production/src/model/service/AuthPolicyManager.js +2 -1
  863. package/dist/production/src/model/service/AuthPolicyManager.js.map +1 -1
  864. package/dist/production/src/model/service/AuthPolicyResolver.cjs +2 -1
  865. package/dist/production/src/model/service/AuthPolicyResolver.cjs.map +1 -1
  866. package/dist/production/src/model/service/AuthPolicyResolver.js +2 -1
  867. package/dist/production/src/model/service/AuthPolicyResolver.js.map +1 -1
  868. package/dist/production/src/model/service/CustomRoleManager.cjs +170 -0
  869. package/dist/production/src/model/service/CustomRoleManager.cjs.map +1 -0
  870. package/dist/production/src/model/service/CustomRoleManager.js +170 -0
  871. package/dist/production/src/model/service/CustomRoleManager.js.map +1 -0
  872. package/dist/production/src/model/service/EmailChangeManager.cjs +5 -4
  873. package/dist/production/src/model/service/EmailChangeManager.cjs.map +1 -1
  874. package/dist/production/src/model/service/EmailChangeManager.js +5 -4
  875. package/dist/production/src/model/service/EmailChangeManager.js.map +1 -1
  876. package/dist/production/src/model/service/EmailOtpManager.cjs +0 -1
  877. package/dist/production/src/model/service/EmailOtpManager.cjs.map +1 -1
  878. package/dist/production/src/model/service/EmailOtpManager.js +0 -1
  879. package/dist/production/src/model/service/EmailOtpManager.js.map +1 -1
  880. package/dist/production/src/model/service/EmailValidator.cjs +2 -1
  881. package/dist/production/src/model/service/EmailValidator.cjs.map +1 -1
  882. package/dist/production/src/model/service/EmailValidator.js +2 -1
  883. package/dist/production/src/model/service/EmailValidator.js.map +1 -1
  884. package/dist/production/src/model/service/EmailVerificationManager.cjs +5 -4
  885. package/dist/production/src/model/service/EmailVerificationManager.cjs.map +1 -1
  886. package/dist/production/src/model/service/EmailVerificationManager.js +5 -4
  887. package/dist/production/src/model/service/EmailVerificationManager.js.map +1 -1
  888. package/dist/production/src/model/service/GlobalRoleValidator.cjs +35 -0
  889. package/dist/production/src/model/service/GlobalRoleValidator.cjs.map +1 -0
  890. package/dist/production/src/model/service/GlobalRoleValidator.js +35 -0
  891. package/dist/production/src/model/service/GlobalRoleValidator.js.map +1 -0
  892. package/dist/production/src/model/service/IDPSignInManager.cjs +52 -16
  893. package/dist/production/src/model/service/IDPSignInManager.cjs.map +1 -1
  894. package/dist/production/src/model/service/IDPSignInManager.js +52 -16
  895. package/dist/production/src/model/service/IDPSignInManager.js.map +1 -1
  896. package/dist/production/src/model/service/InviteManager.cjs +2 -1
  897. package/dist/production/src/model/service/InviteManager.cjs.map +1 -1
  898. package/dist/production/src/model/service/InviteManager.js +2 -1
  899. package/dist/production/src/model/service/InviteManager.js.map +1 -1
  900. package/dist/production/src/model/service/PanelAccessResolver.cjs +32 -0
  901. package/dist/production/src/model/service/PanelAccessResolver.cjs.map +1 -0
  902. package/dist/production/src/model/service/PanelAccessResolver.js +32 -0
  903. package/dist/production/src/model/service/PanelAccessResolver.js.map +1 -0
  904. package/dist/production/src/model/service/PasswordChangeManager.cjs +2 -1
  905. package/dist/production/src/model/service/PasswordChangeManager.cjs.map +1 -1
  906. package/dist/production/src/model/service/PasswordChangeManager.js +2 -1
  907. package/dist/production/src/model/service/PasswordChangeManager.js.map +1 -1
  908. package/dist/production/src/model/service/PasswordResetManager.cjs +9 -3
  909. package/dist/production/src/model/service/PasswordResetManager.cjs.map +1 -1
  910. package/dist/production/src/model/service/PasswordResetManager.js +9 -3
  911. package/dist/production/src/model/service/PasswordResetManager.js.map +1 -1
  912. package/dist/production/src/model/service/PasswordlessSignInManager.cjs +24 -6
  913. package/dist/production/src/model/service/PasswordlessSignInManager.cjs.map +1 -1
  914. package/dist/production/src/model/service/PasswordlessSignInManager.js +24 -6
  915. package/dist/production/src/model/service/PasswordlessSignInManager.js.map +1 -1
  916. package/dist/production/src/model/service/PersonAccessManager.cjs +10 -2
  917. package/dist/production/src/model/service/PersonAccessManager.cjs.map +1 -1
  918. package/dist/production/src/model/service/PersonAccessManager.js +10 -2
  919. package/dist/production/src/model/service/PersonAccessManager.js.map +1 -1
  920. package/dist/production/src/model/service/PersonManager.cjs +2 -1
  921. package/dist/production/src/model/service/PersonManager.cjs.map +1 -1
  922. package/dist/production/src/model/service/PersonManager.js +2 -1
  923. package/dist/production/src/model/service/PersonManager.js.map +1 -1
  924. package/dist/production/src/model/service/ProjectMemberManager.cjs +2 -1
  925. package/dist/production/src/model/service/ProjectMemberManager.cjs.map +1 -1
  926. package/dist/production/src/model/service/ProjectMemberManager.js +2 -1
  927. package/dist/production/src/model/service/ProjectMemberManager.js.map +1 -1
  928. package/dist/production/src/model/service/RateLimiter.cjs +1 -2
  929. package/dist/production/src/model/service/RateLimiter.cjs.map +1 -1
  930. package/dist/production/src/model/service/RateLimiter.js +1 -2
  931. package/dist/production/src/model/service/RateLimiter.js.map +1 -1
  932. package/dist/production/src/model/service/RolesManager.cjs +17 -18
  933. package/dist/production/src/model/service/RolesManager.cjs.map +1 -1
  934. package/dist/production/src/model/service/RolesManager.js +18 -19
  935. package/dist/production/src/model/service/RolesManager.js.map +1 -1
  936. package/dist/production/src/model/service/SecretsManager.cjs +2 -1
  937. package/dist/production/src/model/service/SecretsManager.cjs.map +1 -1
  938. package/dist/production/src/model/service/SecretsManager.js +2 -1
  939. package/dist/production/src/model/service/SecretsManager.js.map +1 -1
  940. package/dist/production/src/model/service/SignInManager.cjs +9 -5
  941. package/dist/production/src/model/service/SignInManager.cjs.map +1 -1
  942. package/dist/production/src/model/service/SignInManager.js +9 -5
  943. package/dist/production/src/model/service/SignInManager.js.map +1 -1
  944. package/dist/production/src/model/service/SignOutManager.cjs +2 -1
  945. package/dist/production/src/model/service/SignOutManager.cjs.map +1 -1
  946. package/dist/production/src/model/service/SignOutManager.js +2 -1
  947. package/dist/production/src/model/service/SignOutManager.js.map +1 -1
  948. package/dist/production/src/model/service/SignUpManager.cjs +15 -7
  949. package/dist/production/src/model/service/SignUpManager.cjs.map +1 -1
  950. package/dist/production/src/model/service/SignUpManager.js +15 -7
  951. package/dist/production/src/model/service/SignUpManager.js.map +1 -1
  952. package/dist/production/src/model/service/apiKey/ApiKeyManager.cjs +56 -40
  953. package/dist/production/src/model/service/apiKey/ApiKeyManager.cjs.map +1 -1
  954. package/dist/production/src/model/service/apiKey/ApiKeyManager.js +57 -41
  955. package/dist/production/src/model/service/apiKey/ApiKeyManager.js.map +1 -1
  956. package/dist/production/src/model/service/apiKey/ApiKeyService.cjs.map +1 -1
  957. package/dist/production/src/model/service/apiKey/ApiKeyService.js.map +1 -1
  958. package/dist/production/src/model/service/apiKey/UnpersistedApiKeyManager.cjs +10 -1
  959. package/dist/production/src/model/service/apiKey/UnpersistedApiKeyManager.cjs.map +1 -1
  960. package/dist/production/src/model/service/apiKey/UnpersistedApiKeyManager.js +11 -2
  961. package/dist/production/src/model/service/apiKey/UnpersistedApiKeyManager.js.map +1 -1
  962. package/dist/production/src/model/service/idp/ClaimMapping.cjs +187 -0
  963. package/dist/production/src/model/service/idp/ClaimMapping.cjs.map +1 -0
  964. package/dist/production/src/model/service/idp/ClaimMapping.js +170 -0
  965. package/dist/production/src/model/service/idp/ClaimMapping.js.map +1 -0
  966. package/dist/production/src/model/service/idp/ClaimMappingEvaluator.cjs +155 -0
  967. package/dist/production/src/model/service/idp/ClaimMappingEvaluator.cjs.map +1 -0
  968. package/dist/production/src/model/service/idp/ClaimMappingEvaluator.js +155 -0
  969. package/dist/production/src/model/service/idp/ClaimMappingEvaluator.js.map +1 -0
  970. package/dist/production/src/model/service/idp/ClaimMappingValidation.cjs +83 -0
  971. package/dist/production/src/model/service/idp/ClaimMappingValidation.cjs.map +1 -0
  972. package/dist/production/src/model/service/idp/ClaimMappingValidation.js +83 -0
  973. package/dist/production/src/model/service/idp/ClaimMappingValidation.js.map +1 -0
  974. package/dist/production/src/model/service/idp/IDPClaimSyncService.cjs +261 -0
  975. package/dist/production/src/model/service/idp/IDPClaimSyncService.cjs.map +1 -0
  976. package/dist/production/src/model/service/idp/IDPClaimSyncService.js +261 -0
  977. package/dist/production/src/model/service/idp/IDPClaimSyncService.js.map +1 -0
  978. package/dist/production/src/model/service/idp/IDPManager.cjs +98 -21
  979. package/dist/production/src/model/service/idp/IDPManager.cjs.map +1 -1
  980. package/dist/production/src/model/service/idp/IDPManager.js +98 -21
  981. package/dist/production/src/model/service/idp/IDPManager.js.map +1 -1
  982. package/dist/production/src/model/service/idp/IdpSessionRevalidator.cjs +93 -28
  983. package/dist/production/src/model/service/idp/IdpSessionRevalidator.cjs.map +1 -1
  984. package/dist/production/src/model/service/idp/IdpSessionRevalidator.js +93 -28
  985. package/dist/production/src/model/service/idp/IdpSessionRevalidator.js.map +1 -1
  986. package/dist/production/src/model/service/idp/PersonIdentityProviderManager.cjs +8 -1
  987. package/dist/production/src/model/service/idp/PersonIdentityProviderManager.cjs.map +1 -1
  988. package/dist/production/src/model/service/idp/PersonIdentityProviderManager.js +8 -1
  989. package/dist/production/src/model/service/idp/PersonIdentityProviderManager.js.map +1 -1
  990. package/dist/production/src/model/service/idp/providers/OIDCHelpers.cjs +69 -33
  991. package/dist/production/src/model/service/idp/providers/OIDCHelpers.cjs.map +1 -1
  992. package/dist/production/src/model/service/idp/providers/OIDCHelpers.js +69 -33
  993. package/dist/production/src/model/service/idp/providers/OIDCHelpers.js.map +1 -1
  994. package/dist/production/src/model/service/idp/providers/OIDCProvider.cjs +4 -1
  995. package/dist/production/src/model/service/idp/providers/OIDCProvider.cjs.map +1 -1
  996. package/dist/production/src/model/service/idp/providers/OIDCProvider.js +4 -1
  997. package/dist/production/src/model/service/idp/providers/OIDCProvider.js.map +1 -1
  998. package/dist/production/src/model/utils/DatabaseContext.cjs +10 -3
  999. package/dist/production/src/model/utils/DatabaseContext.cjs.map +1 -1
  1000. package/dist/production/src/model/utils/DatabaseContext.js +11 -4
  1001. package/dist/production/src/model/utils/DatabaseContext.js.map +1 -1
  1002. package/dist/production/src/model/utils/token.cjs +2 -2
  1003. package/dist/production/src/model/utils/token.cjs.map +1 -1
  1004. package/dist/production/src/model/utils/token.js +2 -2
  1005. package/dist/production/src/model/utils/token.js.map +1 -1
  1006. package/dist/production/src/resolvers/ResolverFactory.cjs +12 -3
  1007. package/dist/production/src/resolvers/ResolverFactory.cjs.map +1 -1
  1008. package/dist/production/src/resolvers/ResolverFactory.js +12 -3
  1009. package/dist/production/src/resolvers/ResolverFactory.js.map +1 -1
  1010. package/dist/production/src/resolvers/TenantResolverContextFactory.cjs +4 -4
  1011. package/dist/production/src/resolvers/TenantResolverContextFactory.cjs.map +1 -1
  1012. package/dist/production/src/resolvers/TenantResolverContextFactory.js +4 -4
  1013. package/dist/production/src/resolvers/TenantResolverContextFactory.js.map +1 -1
  1014. package/dist/production/src/resolvers/mutation/apiKey/CreateApiKeyMutationResolver.cjs +19 -9
  1015. package/dist/production/src/resolvers/mutation/apiKey/CreateApiKeyMutationResolver.cjs.map +1 -1
  1016. package/dist/production/src/resolvers/mutation/apiKey/CreateApiKeyMutationResolver.js +20 -10
  1017. package/dist/production/src/resolvers/mutation/apiKey/CreateApiKeyMutationResolver.js.map +1 -1
  1018. package/dist/production/src/resolvers/mutation/apiKey/DisableApiKeyMutationResolver.cjs +7 -5
  1019. package/dist/production/src/resolvers/mutation/apiKey/DisableApiKeyMutationResolver.cjs.map +1 -1
  1020. package/dist/production/src/resolvers/mutation/apiKey/DisableApiKeyMutationResolver.js +7 -5
  1021. package/dist/production/src/resolvers/mutation/apiKey/DisableApiKeyMutationResolver.js.map +1 -1
  1022. package/dist/production/src/resolvers/mutation/configuration/AuthPolicyMutationResolver.cjs +7 -5
  1023. package/dist/production/src/resolvers/mutation/configuration/AuthPolicyMutationResolver.cjs.map +1 -1
  1024. package/dist/production/src/resolvers/mutation/configuration/AuthPolicyMutationResolver.js +7 -5
  1025. package/dist/production/src/resolvers/mutation/configuration/AuthPolicyMutationResolver.js.map +1 -1
  1026. package/dist/production/src/resolvers/mutation/configuration/ConfigurationMutationResolver.cjs +7 -5
  1027. package/dist/production/src/resolvers/mutation/configuration/ConfigurationMutationResolver.cjs.map +1 -1
  1028. package/dist/production/src/resolvers/mutation/configuration/ConfigurationMutationResolver.js +7 -5
  1029. package/dist/production/src/resolvers/mutation/configuration/ConfigurationMutationResolver.js.map +1 -1
  1030. package/dist/production/src/resolvers/mutation/customRole/CustomRoleMutationResolver.cjs +124 -0
  1031. package/dist/production/src/resolvers/mutation/customRole/CustomRoleMutationResolver.cjs.map +1 -0
  1032. package/dist/production/src/resolvers/mutation/customRole/CustomRoleMutationResolver.js +124 -0
  1033. package/dist/production/src/resolvers/mutation/customRole/CustomRoleMutationResolver.js.map +1 -0
  1034. package/dist/production/src/resolvers/mutation/identity/GlobalRolesMutationResolver.cjs +35 -11
  1035. package/dist/production/src/resolvers/mutation/identity/GlobalRolesMutationResolver.cjs.map +1 -1
  1036. package/dist/production/src/resolvers/mutation/identity/GlobalRolesMutationResolver.js +35 -11
  1037. package/dist/production/src/resolvers/mutation/identity/GlobalRolesMutationResolver.js.map +1 -1
  1038. package/dist/production/src/resolvers/mutation/idp/AddIDPMutationResolver.cjs +10 -7
  1039. package/dist/production/src/resolvers/mutation/idp/AddIDPMutationResolver.cjs.map +1 -1
  1040. package/dist/production/src/resolvers/mutation/idp/AddIDPMutationResolver.js +10 -7
  1041. package/dist/production/src/resolvers/mutation/idp/AddIDPMutationResolver.js.map +1 -1
  1042. package/dist/production/src/resolvers/mutation/idp/DisableIDPMutationResolver.cjs +7 -5
  1043. package/dist/production/src/resolvers/mutation/idp/DisableIDPMutationResolver.cjs.map +1 -1
  1044. package/dist/production/src/resolvers/mutation/idp/DisableIDPMutationResolver.js +7 -5
  1045. package/dist/production/src/resolvers/mutation/idp/DisableIDPMutationResolver.js.map +1 -1
  1046. package/dist/production/src/resolvers/mutation/idp/DisconnectMyIdentityProviderMutationResolver.cjs +8 -6
  1047. package/dist/production/src/resolvers/mutation/idp/DisconnectMyIdentityProviderMutationResolver.cjs.map +1 -1
  1048. package/dist/production/src/resolvers/mutation/idp/DisconnectMyIdentityProviderMutationResolver.js +8 -6
  1049. package/dist/production/src/resolvers/mutation/idp/DisconnectMyIdentityProviderMutationResolver.js.map +1 -1
  1050. package/dist/production/src/resolvers/mutation/idp/EnableIDPMutationResolver.cjs +7 -5
  1051. package/dist/production/src/resolvers/mutation/idp/EnableIDPMutationResolver.cjs.map +1 -1
  1052. package/dist/production/src/resolvers/mutation/idp/EnableIDPMutationResolver.js +7 -5
  1053. package/dist/production/src/resolvers/mutation/idp/EnableIDPMutationResolver.js.map +1 -1
  1054. package/dist/production/src/resolvers/mutation/idp/UpdateIDPMutationResolver.cjs +10 -7
  1055. package/dist/production/src/resolvers/mutation/idp/UpdateIDPMutationResolver.cjs.map +1 -1
  1056. package/dist/production/src/resolvers/mutation/idp/UpdateIDPMutationResolver.js +10 -7
  1057. package/dist/production/src/resolvers/mutation/idp/UpdateIDPMutationResolver.js.map +1 -1
  1058. package/dist/production/src/resolvers/mutation/idp/audit.cjs +1 -0
  1059. package/dist/production/src/resolvers/mutation/idp/audit.cjs.map +1 -1
  1060. package/dist/production/src/resolvers/mutation/idp/audit.js +1 -0
  1061. package/dist/production/src/resolvers/mutation/idp/audit.js.map +1 -1
  1062. package/dist/production/src/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.cjs +38 -18
  1063. package/dist/production/src/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.cjs.map +1 -1
  1064. package/dist/production/src/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.js +38 -18
  1065. package/dist/production/src/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.js.map +1 -1
  1066. package/dist/production/src/resolvers/mutation/person/ChangePasswordMutationResolver.cjs +10 -8
  1067. package/dist/production/src/resolvers/mutation/person/ChangePasswordMutationResolver.cjs.map +1 -1
  1068. package/dist/production/src/resolvers/mutation/person/ChangePasswordMutationResolver.js +10 -8
  1069. package/dist/production/src/resolvers/mutation/person/ChangePasswordMutationResolver.js.map +1 -1
  1070. package/dist/production/src/resolvers/mutation/person/ChangeProfileMutationResolver.cjs +17 -11
  1071. package/dist/production/src/resolvers/mutation/person/ChangeProfileMutationResolver.cjs.map +1 -1
  1072. package/dist/production/src/resolvers/mutation/person/ChangeProfileMutationResolver.js +17 -11
  1073. package/dist/production/src/resolvers/mutation/person/ChangeProfileMutationResolver.js.map +1 -1
  1074. package/dist/production/src/resolvers/mutation/person/DisablePersonMutationResolver.cjs +10 -8
  1075. package/dist/production/src/resolvers/mutation/person/DisablePersonMutationResolver.cjs.map +1 -1
  1076. package/dist/production/src/resolvers/mutation/person/DisablePersonMutationResolver.js +10 -8
  1077. package/dist/production/src/resolvers/mutation/person/DisablePersonMutationResolver.js.map +1 -1
  1078. package/dist/production/src/resolvers/mutation/person/EmailOtpMutationResolver.cjs +10 -8
  1079. package/dist/production/src/resolvers/mutation/person/EmailOtpMutationResolver.cjs.map +1 -1
  1080. package/dist/production/src/resolvers/mutation/person/EmailOtpMutationResolver.js +10 -8
  1081. package/dist/production/src/resolvers/mutation/person/EmailOtpMutationResolver.js.map +1 -1
  1082. package/dist/production/src/resolvers/mutation/person/EmailVerificationMutationResolver.cjs +10 -8
  1083. package/dist/production/src/resolvers/mutation/person/EmailVerificationMutationResolver.cjs.map +1 -1
  1084. package/dist/production/src/resolvers/mutation/person/EmailVerificationMutationResolver.js +10 -8
  1085. package/dist/production/src/resolvers/mutation/person/EmailVerificationMutationResolver.js.map +1 -1
  1086. package/dist/production/src/resolvers/mutation/person/EnablePersonMutationResolver.cjs +61 -0
  1087. package/dist/production/src/resolvers/mutation/person/EnablePersonMutationResolver.cjs.map +1 -0
  1088. package/dist/production/src/resolvers/mutation/person/EnablePersonMutationResolver.js +61 -0
  1089. package/dist/production/src/resolvers/mutation/person/EnablePersonMutationResolver.js.map +1 -0
  1090. package/dist/production/src/resolvers/mutation/person/ForceSignOutMutationResolver.cjs +8 -6
  1091. package/dist/production/src/resolvers/mutation/person/ForceSignOutMutationResolver.cjs.map +1 -1
  1092. package/dist/production/src/resolvers/mutation/person/ForceSignOutMutationResolver.js +8 -6
  1093. package/dist/production/src/resolvers/mutation/person/ForceSignOutMutationResolver.js.map +1 -1
  1094. package/dist/production/src/resolvers/mutation/person/IDPMutationResolver.cjs +32 -5
  1095. package/dist/production/src/resolvers/mutation/person/IDPMutationResolver.cjs.map +1 -1
  1096. package/dist/production/src/resolvers/mutation/person/IDPMutationResolver.js +32 -5
  1097. package/dist/production/src/resolvers/mutation/person/IDPMutationResolver.js.map +1 -1
  1098. package/dist/production/src/resolvers/mutation/person/InviteMutationResolver.cjs +7 -5
  1099. package/dist/production/src/resolvers/mutation/person/InviteMutationResolver.cjs.map +1 -1
  1100. package/dist/production/src/resolvers/mutation/person/InviteMutationResolver.js +7 -5
  1101. package/dist/production/src/resolvers/mutation/person/InviteMutationResolver.js.map +1 -1
  1102. package/dist/production/src/resolvers/mutation/person/OtpMutationResolver.cjs +9 -7
  1103. package/dist/production/src/resolvers/mutation/person/OtpMutationResolver.cjs.map +1 -1
  1104. package/dist/production/src/resolvers/mutation/person/OtpMutationResolver.js +9 -7
  1105. package/dist/production/src/resolvers/mutation/person/OtpMutationResolver.js.map +1 -1
  1106. package/dist/production/src/resolvers/mutation/person/PasswordlessMutationResolver.cjs +12 -6
  1107. package/dist/production/src/resolvers/mutation/person/PasswordlessMutationResolver.cjs.map +1 -1
  1108. package/dist/production/src/resolvers/mutation/person/PasswordlessMutationResolver.js +12 -6
  1109. package/dist/production/src/resolvers/mutation/person/PasswordlessMutationResolver.js.map +1 -1
  1110. package/dist/production/src/resolvers/mutation/person/RegenerateBackupCodesMutationResolver.cjs +9 -7
  1111. package/dist/production/src/resolvers/mutation/person/RegenerateBackupCodesMutationResolver.cjs.map +1 -1
  1112. package/dist/production/src/resolvers/mutation/person/RegenerateBackupCodesMutationResolver.js +9 -7
  1113. package/dist/production/src/resolvers/mutation/person/RegenerateBackupCodesMutationResolver.js.map +1 -1
  1114. package/dist/production/src/resolvers/mutation/person/ResetPasswordMutationResolver.cjs +10 -8
  1115. package/dist/production/src/resolvers/mutation/person/ResetPasswordMutationResolver.cjs.map +1 -1
  1116. package/dist/production/src/resolvers/mutation/person/ResetPasswordMutationResolver.js +10 -8
  1117. package/dist/production/src/resolvers/mutation/person/ResetPasswordMutationResolver.js.map +1 -1
  1118. package/dist/production/src/resolvers/mutation/person/ResetPersonMfaMutationResolver.cjs +8 -6
  1119. package/dist/production/src/resolvers/mutation/person/ResetPersonMfaMutationResolver.cjs.map +1 -1
  1120. package/dist/production/src/resolvers/mutation/person/ResetPersonMfaMutationResolver.js +8 -6
  1121. package/dist/production/src/resolvers/mutation/person/ResetPersonMfaMutationResolver.js.map +1 -1
  1122. package/dist/production/src/resolvers/mutation/person/RevokeSessionMutationResolver.cjs +8 -6
  1123. package/dist/production/src/resolvers/mutation/person/RevokeSessionMutationResolver.cjs.map +1 -1
  1124. package/dist/production/src/resolvers/mutation/person/RevokeSessionMutationResolver.js +8 -6
  1125. package/dist/production/src/resolvers/mutation/person/RevokeSessionMutationResolver.js.map +1 -1
  1126. package/dist/production/src/resolvers/mutation/person/SignInMutationResolver.cjs +22 -14
  1127. package/dist/production/src/resolvers/mutation/person/SignInMutationResolver.cjs.map +1 -1
  1128. package/dist/production/src/resolvers/mutation/person/SignInMutationResolver.js +22 -14
  1129. package/dist/production/src/resolvers/mutation/person/SignInMutationResolver.js.map +1 -1
  1130. package/dist/production/src/resolvers/mutation/person/SignOutMutationResolver.cjs +7 -5
  1131. package/dist/production/src/resolvers/mutation/person/SignOutMutationResolver.cjs.map +1 -1
  1132. package/dist/production/src/resolvers/mutation/person/SignOutMutationResolver.js +7 -5
  1133. package/dist/production/src/resolvers/mutation/person/SignOutMutationResolver.js.map +1 -1
  1134. package/dist/production/src/resolvers/mutation/person/SignUpMutationResolver.cjs +10 -8
  1135. package/dist/production/src/resolvers/mutation/person/SignUpMutationResolver.cjs.map +1 -1
  1136. package/dist/production/src/resolvers/mutation/person/SignUpMutationResolver.js +10 -8
  1137. package/dist/production/src/resolvers/mutation/person/SignUpMutationResolver.js.map +1 -1
  1138. package/dist/production/src/resolvers/mutation/person/TogglePasswordlessMutationResolver.cjs +9 -7
  1139. package/dist/production/src/resolvers/mutation/person/TogglePasswordlessMutationResolver.cjs.map +1 -1
  1140. package/dist/production/src/resolvers/mutation/person/TogglePasswordlessMutationResolver.js +9 -7
  1141. package/dist/production/src/resolvers/mutation/person/TogglePasswordlessMutationResolver.js.map +1 -1
  1142. package/dist/production/src/resolvers/mutation/project/CreateProjectMutationResolver.cjs +7 -5
  1143. package/dist/production/src/resolvers/mutation/project/CreateProjectMutationResolver.cjs.map +1 -1
  1144. package/dist/production/src/resolvers/mutation/project/CreateProjectMutationResolver.js +7 -5
  1145. package/dist/production/src/resolvers/mutation/project/CreateProjectMutationResolver.js.map +1 -1
  1146. package/dist/production/src/resolvers/mutation/project/SetProjectSecretMutationResolver.cjs +7 -5
  1147. package/dist/production/src/resolvers/mutation/project/SetProjectSecretMutationResolver.cjs.map +1 -1
  1148. package/dist/production/src/resolvers/mutation/project/SetProjectSecretMutationResolver.js +7 -5
  1149. package/dist/production/src/resolvers/mutation/project/SetProjectSecretMutationResolver.js.map +1 -1
  1150. package/dist/production/src/resolvers/mutation/project/UpdateProjectMutationResolver.cjs +7 -5
  1151. package/dist/production/src/resolvers/mutation/project/UpdateProjectMutationResolver.cjs.map +1 -1
  1152. package/dist/production/src/resolvers/mutation/project/UpdateProjectMutationResolver.js +7 -5
  1153. package/dist/production/src/resolvers/mutation/project/UpdateProjectMutationResolver.js.map +1 -1
  1154. package/dist/production/src/resolvers/mutation/projectMember/AddProjectMemberMutationResolver.cjs +7 -5
  1155. package/dist/production/src/resolvers/mutation/projectMember/AddProjectMemberMutationResolver.cjs.map +1 -1
  1156. package/dist/production/src/resolvers/mutation/projectMember/AddProjectMemberMutationResolver.js +7 -5
  1157. package/dist/production/src/resolvers/mutation/projectMember/AddProjectMemberMutationResolver.js.map +1 -1
  1158. package/dist/production/src/resolvers/mutation/projectMember/RemoveProjectMemberMutationResolver.cjs +8 -6
  1159. package/dist/production/src/resolvers/mutation/projectMember/RemoveProjectMemberMutationResolver.cjs.map +1 -1
  1160. package/dist/production/src/resolvers/mutation/projectMember/RemoveProjectMemberMutationResolver.js +8 -6
  1161. package/dist/production/src/resolvers/mutation/projectMember/RemoveProjectMemberMutationResolver.js.map +1 -1
  1162. package/dist/production/src/resolvers/mutation/projectMember/UpdateProjectMemberMutationResolver.cjs +8 -6
  1163. package/dist/production/src/resolvers/mutation/projectMember/UpdateProjectMemberMutationResolver.cjs.map +1 -1
  1164. package/dist/production/src/resolvers/mutation/projectMember/UpdateProjectMemberMutationResolver.js +8 -6
  1165. package/dist/production/src/resolvers/mutation/projectMember/UpdateProjectMemberMutationResolver.js.map +1 -1
  1166. package/dist/production/src/resolvers/mutation/projectMember/audit.cjs +2 -1
  1167. package/dist/production/src/resolvers/mutation/projectMember/audit.cjs.map +1 -1
  1168. package/dist/production/src/resolvers/mutation/projectMember/audit.js +2 -1
  1169. package/dist/production/src/resolvers/mutation/projectMember/audit.js.map +1 -1
  1170. package/dist/production/src/resolvers/query/ApiKeyQueryResolver.cjs +8 -6
  1171. package/dist/production/src/resolvers/query/ApiKeyQueryResolver.cjs.map +1 -1
  1172. package/dist/production/src/resolvers/query/ApiKeyQueryResolver.js +8 -6
  1173. package/dist/production/src/resolvers/query/ApiKeyQueryResolver.js.map +1 -1
  1174. package/dist/production/src/resolvers/query/AuthLogQueryResolver.cjs +7 -5
  1175. package/dist/production/src/resolvers/query/AuthLogQueryResolver.cjs.map +1 -1
  1176. package/dist/production/src/resolvers/query/AuthLogQueryResolver.js +7 -5
  1177. package/dist/production/src/resolvers/query/AuthLogQueryResolver.js.map +1 -1
  1178. package/dist/production/src/resolvers/query/AuthPolicyQueryResolver.cjs +8 -6
  1179. package/dist/production/src/resolvers/query/AuthPolicyQueryResolver.cjs.map +1 -1
  1180. package/dist/production/src/resolvers/query/AuthPolicyQueryResolver.js +8 -6
  1181. package/dist/production/src/resolvers/query/AuthPolicyQueryResolver.js.map +1 -1
  1182. package/dist/production/src/resolvers/query/ConfigurationQueryResolver.cjs +8 -6
  1183. package/dist/production/src/resolvers/query/ConfigurationQueryResolver.cjs.map +1 -1
  1184. package/dist/production/src/resolvers/query/ConfigurationQueryResolver.js +8 -6
  1185. package/dist/production/src/resolvers/query/ConfigurationQueryResolver.js.map +1 -1
  1186. package/dist/production/src/resolvers/query/CustomRoleQueryResolver.cjs +55 -0
  1187. package/dist/production/src/resolvers/query/CustomRoleQueryResolver.cjs.map +1 -0
  1188. package/dist/production/src/resolvers/query/CustomRoleQueryResolver.js +55 -0
  1189. package/dist/production/src/resolvers/query/CustomRoleQueryResolver.js.map +1 -0
  1190. package/dist/production/src/resolvers/query/IDPQueryResolver.cjs +7 -5
  1191. package/dist/production/src/resolvers/query/IDPQueryResolver.cjs.map +1 -1
  1192. package/dist/production/src/resolvers/query/IDPQueryResolver.js +7 -5
  1193. package/dist/production/src/resolvers/query/IDPQueryResolver.js.map +1 -1
  1194. package/dist/production/src/resolvers/query/MailTemplateQueryResolver.cjs +21 -14
  1195. package/dist/production/src/resolvers/query/MailTemplateQueryResolver.cjs.map +1 -1
  1196. package/dist/production/src/resolvers/query/MailTemplateQueryResolver.js +21 -14
  1197. package/dist/production/src/resolvers/query/MailTemplateQueryResolver.js.map +1 -1
  1198. package/dist/production/src/resolvers/query/PersonQueryResolver.cjs +7 -5
  1199. package/dist/production/src/resolvers/query/PersonQueryResolver.cjs.map +1 -1
  1200. package/dist/production/src/resolvers/query/PersonQueryResolver.js +7 -5
  1201. package/dist/production/src/resolvers/query/PersonQueryResolver.js.map +1 -1
  1202. package/dist/production/src/resolvers/query/ProjectMembersQueryResolver.cjs +7 -5
  1203. package/dist/production/src/resolvers/query/ProjectMembersQueryResolver.cjs.map +1 -1
  1204. package/dist/production/src/resolvers/query/ProjectMembersQueryResolver.js +7 -5
  1205. package/dist/production/src/resolvers/query/ProjectMembersQueryResolver.js.map +1 -1
  1206. package/dist/production/src/resolvers/query/ProjectQueryResolver.cjs +10 -7
  1207. package/dist/production/src/resolvers/query/ProjectQueryResolver.cjs.map +1 -1
  1208. package/dist/production/src/resolvers/query/ProjectQueryResolver.js +10 -7
  1209. package/dist/production/src/resolvers/query/ProjectQueryResolver.js.map +1 -1
  1210. package/dist/production/src/resolvers/responseHelpers/ApiKeyResponseFactory.cjs +7 -5
  1211. package/dist/production/src/resolvers/responseHelpers/ApiKeyResponseFactory.cjs.map +1 -1
  1212. package/dist/production/src/resolvers/responseHelpers/ApiKeyResponseFactory.js +7 -5
  1213. package/dist/production/src/resolvers/responseHelpers/ApiKeyResponseFactory.js.map +1 -1
  1214. package/dist/production/src/resolvers/responseHelpers/PersonResponseFactory.cjs +5 -0
  1215. package/dist/production/src/resolvers/responseHelpers/PersonResponseFactory.cjs.map +1 -1
  1216. package/dist/production/src/resolvers/responseHelpers/PersonResponseFactory.js +5 -0
  1217. package/dist/production/src/resolvers/responseHelpers/PersonResponseFactory.js.map +1 -1
  1218. package/dist/production/src/resolvers/responseHelpers/ProjectResponseFactory.cjs +23 -0
  1219. package/dist/production/src/resolvers/responseHelpers/ProjectResponseFactory.cjs.map +1 -0
  1220. package/dist/production/src/resolvers/responseHelpers/ProjectResponseFactory.js +23 -0
  1221. package/dist/production/src/resolvers/responseHelpers/ProjectResponseFactory.js.map +1 -0
  1222. package/dist/production/src/resolvers/responseHelpers/SignInResponseFactory.cjs +8 -6
  1223. package/dist/production/src/resolvers/responseHelpers/SignInResponseFactory.cjs.map +1 -1
  1224. package/dist/production/src/resolvers/responseHelpers/SignInResponseFactory.js +8 -6
  1225. package/dist/production/src/resolvers/responseHelpers/SignInResponseFactory.js.map +1 -1
  1226. package/dist/production/src/resolvers/types/IdentityTypeResolver.cjs +50 -18
  1227. package/dist/production/src/resolvers/types/IdentityTypeResolver.cjs.map +1 -1
  1228. package/dist/production/src/resolvers/types/IdentityTypeResolver.js +50 -18
  1229. package/dist/production/src/resolvers/types/IdentityTypeResolver.js.map +1 -1
  1230. package/dist/production/src/resolvers/types/PersonTypeResolver.cjs +38 -8
  1231. package/dist/production/src/resolvers/types/PersonTypeResolver.cjs.map +1 -1
  1232. package/dist/production/src/resolvers/types/PersonTypeResolver.js +38 -8
  1233. package/dist/production/src/resolvers/types/PersonTypeResolver.js.map +1 -1
  1234. package/dist/production/src/resolvers/types/ProjectTypeResolver.cjs +31 -6
  1235. package/dist/production/src/resolvers/types/ProjectTypeResolver.cjs.map +1 -1
  1236. package/dist/production/src/resolvers/types/ProjectTypeResolver.js +31 -6
  1237. package/dist/production/src/resolvers/types/ProjectTypeResolver.js.map +1 -1
  1238. package/dist/production/src/schema/tenant.graphql.cjs +275 -15
  1239. package/dist/production/src/schema/tenant.graphql.cjs.map +1 -1
  1240. package/dist/production/src/schema/tenant.graphql.js +275 -15
  1241. package/dist/production/src/schema/tenant.graphql.js.map +1 -1
  1242. package/dist/tests/cases/integration/database/dbClock.test.d.ts +2 -0
  1243. package/dist/tests/cases/integration/database/dbClock.test.d.ts.map +1 -0
  1244. package/dist/tests/cases/integration/mocked/configurationPanel.test.d.ts +2 -0
  1245. package/dist/tests/cases/integration/mocked/configurationPanel.test.d.ts.map +1 -0
  1246. package/dist/tests/cases/integration/mocked/customRoleCrud.test.d.ts +2 -0
  1247. package/dist/tests/cases/integration/mocked/customRoleCrud.test.d.ts.map +1 -0
  1248. package/dist/tests/cases/integration/mocked/disablePersonMutation.test.d.ts +2 -0
  1249. package/dist/tests/cases/integration/mocked/disablePersonMutation.test.d.ts.map +1 -0
  1250. package/dist/tests/cases/integration/mocked/enablePersonMutation.test.d.ts +2 -0
  1251. package/dist/tests/cases/integration/mocked/enablePersonMutation.test.d.ts.map +1 -0
  1252. package/dist/tests/cases/integration/mocked/gql/addProjectMember.d.ts.map +1 -1
  1253. package/dist/tests/cases/integration/mocked/gql/changeMyPassword.d.ts.map +1 -1
  1254. package/dist/tests/cases/integration/mocked/gql/changeMyProfile.d.ts.map +1 -1
  1255. package/dist/tests/cases/integration/mocked/gql/changePassword.d.ts.map +1 -1
  1256. package/dist/tests/cases/integration/mocked/gql/changeProfile.d.ts.map +1 -1
  1257. package/dist/tests/cases/integration/mocked/gql/confirmOtp.d.ts.map +1 -1
  1258. package/dist/tests/cases/integration/mocked/gql/createApiKey.d.ts.map +1 -1
  1259. package/dist/tests/cases/integration/mocked/gql/createResetPasswordRequest.d.ts.map +1 -1
  1260. package/dist/tests/cases/integration/mocked/gql/createSessionToken.d.ts.map +1 -1
  1261. package/dist/tests/cases/integration/mocked/gql/emailOtp.d.ts.map +1 -1
  1262. package/dist/tests/cases/integration/mocked/gql/emailVerification.d.ts.map +1 -1
  1263. package/dist/tests/cases/integration/mocked/gql/invite.d.ts.map +1 -1
  1264. package/dist/tests/cases/integration/mocked/gql/myIdentityProviders.d.ts.map +1 -1
  1265. package/dist/tests/cases/integration/mocked/gql/passwordless.d.ts +4 -1
  1266. package/dist/tests/cases/integration/mocked/gql/passwordless.d.ts.map +1 -1
  1267. package/dist/tests/cases/integration/mocked/gql/prepareOtp.d.ts.map +1 -1
  1268. package/dist/tests/cases/integration/mocked/gql/resetPassword.d.ts.map +1 -1
  1269. package/dist/tests/cases/integration/mocked/gql/signIn.d.ts.map +1 -1
  1270. package/dist/tests/cases/integration/mocked/gql/signInIdp.d.ts.map +1 -1
  1271. package/dist/tests/cases/integration/mocked/gql/signUp.d.ts.map +1 -1
  1272. package/dist/tests/cases/integration/mocked/gql/unmanagedInvite.d.ts.map +1 -1
  1273. package/dist/tests/cases/integration/mocked/gql/updateProjectMember.d.ts.map +1 -1
  1274. package/dist/tests/cases/integration/mocked/idpClaimMappingConfig.test.d.ts +2 -0
  1275. package/dist/tests/cases/integration/mocked/idpClaimMappingConfig.test.d.ts.map +1 -0
  1276. package/dist/tests/cases/integration/mocked/localAuthenticationDisabled.test.d.ts +2 -0
  1277. package/dist/tests/cases/integration/mocked/localAuthenticationDisabled.test.d.ts.map +1 -0
  1278. package/dist/tests/cases/integration/mocked/mailTemplateScope.test.d.ts +2 -0
  1279. package/dist/tests/cases/integration/mocked/mailTemplateScope.test.d.ts.map +1 -0
  1280. package/dist/tests/cases/integration/mocked/permissionsQuery.test.d.ts +2 -0
  1281. package/dist/tests/cases/integration/mocked/permissionsQuery.test.d.ts.map +1 -0
  1282. package/dist/tests/cases/integration/mocked/signInIdpClaimMapping.test.d.ts +2 -0
  1283. package/dist/tests/cases/integration/mocked/signInIdpClaimMapping.test.d.ts.map +1 -0
  1284. package/dist/tests/cases/integration/mocked/signInIdpClaimMappingFixes.test.d.ts +2 -0
  1285. package/dist/tests/cases/integration/mocked/signInIdpClaimMappingFixes.test.d.ts.map +1 -0
  1286. package/dist/tests/cases/integration/mocked/signInIdpClaimMappingSafety.test.d.ts +2 -0
  1287. package/dist/tests/cases/integration/mocked/signInIdpClaimMappingSafety.test.d.ts.map +1 -0
  1288. package/dist/tests/cases/integration/mocked/sql/authLogSql.d.ts.map +1 -1
  1289. package/dist/tests/cases/integration/mocked/sql/authPolicySql.d.ts.map +1 -1
  1290. package/dist/tests/cases/integration/mocked/sql/consumeBackupCodeSql.d.ts.map +1 -1
  1291. package/dist/tests/cases/integration/mocked/sql/createApiKeySql.d.ts.map +1 -1
  1292. package/dist/tests/cases/integration/mocked/sql/createIdentitySql.d.ts.map +1 -1
  1293. package/dist/tests/cases/integration/mocked/sql/createMembershipSql.d.ts.map +1 -1
  1294. package/dist/tests/cases/integration/mocked/sql/createMembershipVariableSql.d.ts.map +1 -1
  1295. package/dist/tests/cases/integration/mocked/sql/createPersonSql.d.ts.map +1 -1
  1296. package/dist/tests/cases/integration/mocked/sql/createPersonTokenSql.d.ts.map +1 -1
  1297. package/dist/tests/cases/integration/mocked/sql/createSessionKeySql.d.ts.map +1 -1
  1298. package/dist/tests/cases/integration/mocked/sql/disableApiKeySql.d.ts.map +1 -1
  1299. package/dist/tests/cases/integration/mocked/sql/disableOneOffKeySql.d.ts.map +1 -1
  1300. package/dist/tests/cases/integration/mocked/sql/emailOtpSql.d.ts.map +1 -1
  1301. package/dist/tests/cases/integration/mocked/sql/generateBackupCodesSql.d.ts.map +1 -1
  1302. package/dist/tests/cases/integration/mocked/sql/getApiKeySql.d.ts.map +1 -1
  1303. package/dist/tests/cases/integration/mocked/sql/getConfigSql.d.ts.map +1 -1
  1304. package/dist/tests/cases/integration/mocked/sql/getCustomRolesSql.d.ts +18 -0
  1305. package/dist/tests/cases/integration/mocked/sql/getCustomRolesSql.d.ts.map +1 -0
  1306. package/dist/tests/cases/integration/mocked/sql/getIdentityByIdSql.d.ts.map +1 -1
  1307. package/dist/tests/cases/integration/mocked/sql/getIdentityProjectMembershipPresenceSql.d.ts +3 -0
  1308. package/dist/tests/cases/integration/mocked/sql/getIdentityProjectMembershipPresenceSql.d.ts.map +1 -0
  1309. package/dist/tests/cases/integration/mocked/sql/getIdentityProjectsSql.d.ts.map +1 -1
  1310. package/dist/tests/cases/integration/mocked/sql/getIdpBySlugSql.d.ts.map +1 -1
  1311. package/dist/tests/cases/integration/mocked/sql/getIdpSessionByApiKeySql.d.ts.map +1 -1
  1312. package/dist/tests/cases/integration/mocked/sql/getMailTemplateSql.d.ts.map +1 -1
  1313. package/dist/tests/cases/integration/mocked/sql/getNextLoginAttemptSql.d.ts.map +1 -1
  1314. package/dist/tests/cases/integration/mocked/sql/getNextMailAttemptSql.d.ts +1 -1
  1315. package/dist/tests/cases/integration/mocked/sql/getNextMailAttemptSql.d.ts.map +1 -1
  1316. package/dist/tests/cases/integration/mocked/sql/getPersonByEmailSql.d.ts +1 -0
  1317. package/dist/tests/cases/integration/mocked/sql/getPersonByEmailSql.d.ts.map +1 -1
  1318. package/dist/tests/cases/integration/mocked/sql/getPersonByIdSql.d.ts.map +1 -1
  1319. package/dist/tests/cases/integration/mocked/sql/getPersonByIdentity.d.ts.map +1 -1
  1320. package/dist/tests/cases/integration/mocked/sql/getPersonByIdpSql.d.ts.map +1 -1
  1321. package/dist/tests/cases/integration/mocked/sql/getPersonsByIdentitySql.d.ts.map +1 -1
  1322. package/dist/tests/cases/integration/mocked/sql/getProjectBySlugSql.d.ts +1 -1
  1323. package/dist/tests/cases/integration/mocked/sql/getProjectBySlugSql.d.ts.map +1 -1
  1324. package/dist/tests/cases/integration/mocked/sql/getProjectMembershipSql.d.ts.map +1 -1
  1325. package/dist/tests/cases/integration/mocked/sql/listApiKeysSql.d.ts.map +1 -1
  1326. package/dist/tests/cases/integration/mocked/sql/listPersonsSql.d.ts +2 -0
  1327. package/dist/tests/cases/integration/mocked/sql/listPersonsSql.d.ts.map +1 -1
  1328. package/dist/tests/cases/integration/mocked/sql/listProjectSecretsSql.d.ts.map +1 -1
  1329. package/dist/tests/cases/integration/mocked/sql/listSessionsSql.d.ts +1 -1
  1330. package/dist/tests/cases/integration/mocked/sql/listSessionsSql.d.ts.map +1 -1
  1331. package/dist/tests/cases/integration/mocked/sql/localAuthDisablingIdpsSql.d.ts +10 -0
  1332. package/dist/tests/cases/integration/mocked/sql/localAuthDisablingIdpsSql.d.ts.map +1 -0
  1333. package/dist/tests/cases/integration/mocked/sql/loginHistorySql.d.ts.map +1 -1
  1334. package/dist/tests/cases/integration/mocked/sql/patchVariablesSql.d.ts.map +1 -1
  1335. package/dist/tests/cases/integration/mocked/sql/personIdentityProvidersSql.d.ts +1 -0
  1336. package/dist/tests/cases/integration/mocked/sql/personIdentityProvidersSql.d.ts.map +1 -1
  1337. package/dist/tests/cases/integration/mocked/sql/removeMembershipSql.d.ts +8 -0
  1338. package/dist/tests/cases/integration/mocked/sql/removeMembershipSql.d.ts.map +1 -0
  1339. package/dist/tests/cases/integration/mocked/sql/selectMembershipsSql.d.ts.map +1 -1
  1340. package/dist/tests/cases/integration/mocked/sql/setEmailOtpEnabledSql.d.ts.map +1 -1
  1341. package/dist/tests/cases/integration/mocked/sql/sqlTransaction.d.ts +6 -0
  1342. package/dist/tests/cases/integration/mocked/sql/sqlTransaction.d.ts.map +1 -1
  1343. package/dist/tests/cases/integration/mocked/sql/updatePesonNameSql.d.ts.map +1 -1
  1344. package/dist/tests/cases/integration/mocked/sql/updatePesonPasswordSql.d.ts.map +1 -1
  1345. package/dist/tests/cases/unit/apiKey/verifyAndProlongReplica.test.d.ts +2 -0
  1346. package/dist/tests/cases/unit/apiKey/verifyAndProlongReplica.test.d.ts.map +1 -0
  1347. package/dist/tests/cases/unit/customRoleAuthorizator.test.d.ts +2 -0
  1348. package/dist/tests/cases/unit/customRoleAuthorizator.test.d.ts.map +1 -0
  1349. package/dist/tests/cases/unit/customRolePermissions.test.d.ts +2 -0
  1350. package/dist/tests/cases/unit/customRolePermissions.test.d.ts.map +1 -0
  1351. package/dist/tests/cases/unit/databaseContextRetry.test.d.ts +2 -0
  1352. package/dist/tests/cases/unit/databaseContextRetry.test.d.ts.map +1 -0
  1353. package/dist/tests/cases/unit/idp/claimIdpRevalidation.test.d.ts +2 -0
  1354. package/dist/tests/cases/unit/idp/claimIdpRevalidation.test.d.ts.map +1 -0
  1355. package/dist/tests/cases/unit/idp/claimMappingEvaluator.test.d.ts +2 -0
  1356. package/dist/tests/cases/unit/idp/claimMappingEvaluator.test.d.ts.map +1 -0
  1357. package/dist/tests/cases/unit/idp/claimMappingValidation.test.d.ts +2 -0
  1358. package/dist/tests/cases/unit/idp/claimMappingValidation.test.d.ts.map +1 -0
  1359. package/dist/tests/cases/unit/idp/idpManagerConfigMerge.test.d.ts +2 -0
  1360. package/dist/tests/cases/unit/idp/idpManagerConfigMerge.test.d.ts.map +1 -0
  1361. package/dist/tests/cases/unit/idp/idpManagerUnknownConfigKeys.test.d.ts +2 -0
  1362. package/dist/tests/cases/unit/idp/idpManagerUnknownConfigKeys.test.d.ts.map +1 -0
  1363. package/dist/tests/cases/unit/idp/oidcClaims.test.d.ts +2 -0
  1364. package/dist/tests/cases/unit/idp/oidcClaims.test.d.ts.map +1 -0
  1365. package/dist/tests/cases/unit/panelAccessResolver.test.d.ts +2 -0
  1366. package/dist/tests/cases/unit/panelAccessResolver.test.d.ts.map +1 -0
  1367. package/dist/tests/cases/unit/savePersonTokenCommand.test.d.ts +2 -0
  1368. package/dist/tests/cases/unit/savePersonTokenCommand.test.d.ts.map +1 -0
  1369. package/dist/tests/cases/unit/updateConfigurationCommand.test.d.ts +2 -0
  1370. package/dist/tests/cases/unit/updateConfigurationCommand.test.d.ts.map +1 -0
  1371. package/dist/tests/src/IdPMock.d.ts.map +1 -1
  1372. package/dist/tests/src/dbUtils.d.ts.map +1 -1
  1373. package/dist/tests/src/tags.d.ts.map +1 -1
  1374. package/dist/tests/src/testGraphql.d.ts.map +1 -1
  1375. package/dist/tests/src/testTenant.d.ts +16 -4
  1376. package/dist/tests/src/testTenant.d.ts.map +1 -1
  1377. package/dist/tests/src/testUuid.d.ts.map +1 -1
  1378. package/dist/tests/tsconfig.tsbuildinfo +1 -1
  1379. package/dist/types/TenantContainer.d.ts +36 -13
  1380. package/dist/types/TenantContainer.d.ts.map +1 -1
  1381. package/dist/types/bridges/system/IdentityFetcher.d.ts +2 -2
  1382. package/dist/types/bridges/system/IdentityFetcher.d.ts.map +1 -1
  1383. package/dist/types/exceptions.d.ts.map +1 -1
  1384. package/dist/types/migrations/2026-06-18-120000-idp-claim-mapping.d.ts +3 -0
  1385. package/dist/types/migrations/2026-06-18-120000-idp-claim-mapping.d.ts.map +1 -0
  1386. package/dist/types/migrations/2026-08-03-120000-person-enable-auth-log.d.ts +3 -0
  1387. package/dist/types/migrations/2026-08-03-120000-person-enable-auth-log.d.ts.map +1 -0
  1388. package/dist/types/migrations/2026-08-04-120000-config-panel.d.ts +3 -0
  1389. package/dist/types/migrations/2026-08-04-120000-config-panel.d.ts.map +1 -0
  1390. package/dist/types/migrations/2026-09-04-120000-idp-disable-local-authentication.d.ts +3 -0
  1391. package/dist/types/migrations/2026-09-04-120000-idp-disable-local-authentication.d.ts.map +1 -0
  1392. package/dist/types/migrations/2026-09-11-120000-custom-role.d.ts +3 -0
  1393. package/dist/types/migrations/2026-09-11-120000-custom-role.d.ts.map +1 -0
  1394. package/dist/types/migrations/runner.d.ts.map +1 -1
  1395. package/dist/types/migrations/snapshot-factory.d.ts.map +1 -1
  1396. package/dist/types/migrations/snapshot.d.ts.map +1 -1
  1397. package/dist/types/migrations/tenantCredentials.d.ts.map +1 -1
  1398. package/dist/types/model/authorization/AclSchemaAccessNodeFactory.d.ts.map +1 -1
  1399. package/dist/types/model/authorization/CustomRoleAuthorizator.d.ts +29 -0
  1400. package/dist/types/model/authorization/CustomRoleAuthorizator.d.ts.map +1 -0
  1401. package/dist/types/model/authorization/CustomRolePermissions.d.ts +45 -0
  1402. package/dist/types/model/authorization/CustomRolePermissions.d.ts.map +1 -0
  1403. package/dist/types/model/authorization/DirectPermissionsAccessNode.d.ts.map +1 -1
  1404. package/dist/types/model/authorization/Identity.d.ts.map +1 -1
  1405. package/dist/types/model/authorization/IdentityFactory.d.ts.map +1 -1
  1406. package/dist/types/model/authorization/IdentityScope.d.ts.map +1 -1
  1407. package/dist/types/model/authorization/MembershipMatcher.d.ts.map +1 -1
  1408. package/dist/types/model/authorization/PermissionActions.d.ts +104 -37
  1409. package/dist/types/model/authorization/PermissionActions.d.ts.map +1 -1
  1410. package/dist/types/model/authorization/PermissionContext.d.ts.map +1 -1
  1411. package/dist/types/model/authorization/PermissionContextFactory.d.ts +13 -2
  1412. package/dist/types/model/authorization/PermissionContextFactory.d.ts.map +1 -1
  1413. package/dist/types/model/authorization/PermissionsFactory.d.ts.map +1 -1
  1414. package/dist/types/model/authorization/ProjectScope.d.ts.map +1 -1
  1415. package/dist/types/model/authorization/ProjectScopeFactory.d.ts.map +1 -1
  1416. package/dist/types/model/authorization/Roles.d.ts +8 -0
  1417. package/dist/types/model/authorization/Roles.d.ts.map +1 -1
  1418. package/dist/types/model/authorization/TargetIdentityPermission.d.ts +15 -0
  1419. package/dist/types/model/authorization/TargetIdentityPermission.d.ts.map +1 -0
  1420. package/dist/types/model/authorization/index.d.ts +3 -0
  1421. package/dist/types/model/authorization/index.d.ts.map +1 -1
  1422. package/dist/types/model/commands/CommandBus.d.ts.map +1 -1
  1423. package/dist/types/model/commands/apiKey/ApiKeyHelper.d.ts +15 -0
  1424. package/dist/types/model/commands/apiKey/ApiKeyHelper.d.ts.map +1 -1
  1425. package/dist/types/model/commands/apiKey/CreateApiKeyCommand.d.ts +5 -1
  1426. package/dist/types/model/commands/apiKey/CreateApiKeyCommand.d.ts.map +1 -1
  1427. package/dist/types/model/commands/apiKey/DisableApiKeyCommand.d.ts.map +1 -1
  1428. package/dist/types/model/commands/apiKey/DisableIdentityApiKeysCommand.d.ts.map +1 -1
  1429. package/dist/types/model/commands/apiKey/DisableOneOffApiKeyCommand.d.ts.map +1 -1
  1430. package/dist/types/model/commands/apiKey/ProlongApiKeyCommand.d.ts +6 -4
  1431. package/dist/types/model/commands/apiKey/ProlongApiKeyCommand.d.ts.map +1 -1
  1432. package/dist/types/model/commands/authLog/CreateAuthLogEntryCommand.d.ts +1 -0
  1433. package/dist/types/model/commands/authLog/CreateAuthLogEntryCommand.d.ts.map +1 -1
  1434. package/dist/types/model/commands/authPolicy/CreateAuthPolicyCommand.d.ts.map +1 -1
  1435. package/dist/types/model/commands/authPolicy/DeleteAuthPolicyCommand.d.ts.map +1 -1
  1436. package/dist/types/model/commands/authPolicy/UpdateAuthPolicyCommand.d.ts.map +1 -1
  1437. package/dist/types/model/commands/backupCode/ConsumeBackupCodeCommand.d.ts.map +1 -1
  1438. package/dist/types/model/commands/backupCode/CreateBackupCodeCommand.d.ts.map +1 -1
  1439. package/dist/types/model/commands/backupCode/DeleteBackupCodesCommand.d.ts.map +1 -1
  1440. package/dist/types/model/commands/configuration/UpdateConfigurationCommand.d.ts.map +1 -1
  1441. package/dist/types/model/commands/customRole/CreateCustomRoleCommand.d.ts +12 -0
  1442. package/dist/types/model/commands/customRole/CreateCustomRoleCommand.d.ts.map +1 -0
  1443. package/dist/types/model/commands/customRole/DeleteCustomRoleCommand.d.ts +13 -0
  1444. package/dist/types/model/commands/customRole/DeleteCustomRoleCommand.d.ts.map +1 -0
  1445. package/dist/types/model/commands/customRole/RemoveCustomRoleAssignmentsCommand.d.ts +8 -0
  1446. package/dist/types/model/commands/customRole/RemoveCustomRoleAssignmentsCommand.d.ts.map +1 -0
  1447. package/dist/types/model/commands/customRole/UpdateCustomRoleCommand.d.ts +16 -0
  1448. package/dist/types/model/commands/customRole/UpdateCustomRoleCommand.d.ts.map +1 -0
  1449. package/dist/types/model/commands/customRole/index.d.ts +5 -0
  1450. package/dist/types/model/commands/customRole/index.d.ts.map +1 -0
  1451. package/dist/types/model/commands/identity/CreateIdentityCommand.d.ts.map +1 -1
  1452. package/dist/types/model/commands/identity/PatchIdentityGlobalRoles.d.ts.map +1 -1
  1453. package/dist/types/model/commands/idp/ClaimIdpRevalidationCommand.d.ts.map +1 -1
  1454. package/dist/types/model/commands/idp/CreateIdpCommand.d.ts.map +1 -1
  1455. package/dist/types/model/commands/idp/CreateIdpSessionCommand.d.ts.map +1 -1
  1456. package/dist/types/model/commands/idp/DisableIdpCommand.d.ts.map +1 -1
  1457. package/dist/types/model/commands/idp/DisconnectPersonIdentityProviderCommand.d.ts.map +1 -1
  1458. package/dist/types/model/commands/idp/EnableIdpCommand.d.ts.map +1 -1
  1459. package/dist/types/model/commands/idp/UpdateIdpCommand.d.ts.map +1 -1
  1460. package/dist/types/model/commands/idp/UpdateIdpSessionCommand.d.ts.map +1 -1
  1461. package/dist/types/model/commands/index.d.ts +1 -0
  1462. package/dist/types/model/commands/index.d.ts.map +1 -1
  1463. package/dist/types/model/commands/mailTemplate/AddMailTemplateCommand.d.ts.map +1 -1
  1464. package/dist/types/model/commands/mailTemplate/RemoveMailTemplateCommand.d.ts.map +1 -1
  1465. package/dist/types/model/commands/membership/AddProjectMemberCommand.d.ts.map +1 -1
  1466. package/dist/types/model/commands/membership/CreateOrUpdateProjectMembershipCommand.d.ts.map +1 -1
  1467. package/dist/types/model/commands/membership/RemoveProjectMemberCommand.d.ts.map +1 -1
  1468. package/dist/types/model/commands/membership/{RemoveProjectMembershipsCommand.d.ts → RemoveProjectMembershipCommand.d.ts} +1 -1
  1469. package/dist/types/model/commands/membership/RemoveProjectMembershipCommand.d.ts.map +1 -0
  1470. package/dist/types/model/commands/membership/UpdateProjectMemberCommand.d.ts.map +1 -1
  1471. package/dist/types/model/commands/membership/index.d.ts +2 -1
  1472. package/dist/types/model/commands/membership/index.d.ts.map +1 -1
  1473. package/dist/types/model/commands/membership/variables/PatchProjectMembershipVariableValuesCommand.d.ts.map +1 -1
  1474. package/dist/types/model/commands/membership/variables/PatchProjectMembershipVariablesCommand.d.ts.map +1 -1
  1475. package/dist/types/model/commands/membership/variables/SetProjectMembershipVariableValuesCommand.d.ts.map +1 -1
  1476. package/dist/types/model/commands/membership/variables/index.d.ts +1 -0
  1477. package/dist/types/model/commands/membership/variables/index.d.ts.map +1 -1
  1478. package/dist/types/model/commands/otp/ConfirmOtpCommand.d.ts.map +1 -1
  1479. package/dist/types/model/commands/otp/DisableOtpCommand.d.ts.map +1 -1
  1480. package/dist/types/model/commands/otp/PrepareOtpCommand.d.ts.map +1 -1
  1481. package/dist/types/model/commands/otp/ReEncryptOtpSecretCommand.d.ts.map +1 -1
  1482. package/dist/types/model/commands/otp/SetEmailOtpEnabledCommand.d.ts.map +1 -1
  1483. package/dist/types/model/commands/person/ChangePasswordCommand.d.ts.map +1 -1
  1484. package/dist/types/model/commands/person/ChangeProfileCommand.d.ts.map +1 -1
  1485. package/dist/types/model/commands/person/CreatePersonCommand.d.ts.map +1 -1
  1486. package/dist/types/model/commands/person/CreatePersonIdentityProviderIdentifierCommand.d.ts.map +1 -1
  1487. package/dist/types/model/commands/person/DisablePersonCommand.d.ts.map +1 -1
  1488. package/dist/types/model/commands/person/EnablePersonCommand.d.ts +7 -0
  1489. package/dist/types/model/commands/person/EnablePersonCommand.d.ts.map +1 -0
  1490. package/dist/types/model/commands/person/MarkEmailVerifiedCommand.d.ts.map +1 -1
  1491. package/dist/types/model/commands/person/ResetPersonMfaCommand.d.ts.map +1 -1
  1492. package/dist/types/model/commands/person/SetMfaGraceUntilCommand.d.ts +8 -3
  1493. package/dist/types/model/commands/person/SetMfaGraceUntilCommand.d.ts.map +1 -1
  1494. package/dist/types/model/commands/person/TogglePersonPasswordlessCommand.d.ts.map +1 -1
  1495. package/dist/types/model/commands/personToken/ActivateOtpCommand.d.ts.map +1 -1
  1496. package/dist/types/model/commands/personToken/ClaimOtpAttemptCommand.d.ts.map +1 -1
  1497. package/dist/types/model/commands/personToken/CreatePersonTokenCommand.d.ts.map +1 -1
  1498. package/dist/types/model/commands/personToken/IncreaseOtpAttemptCommand.d.ts.map +1 -1
  1499. package/dist/types/model/commands/personToken/InvalidateEmailOtpTokensCommand.d.ts.map +1 -1
  1500. package/dist/types/model/commands/personToken/InvalidateTokenCommand.d.ts.map +1 -1
  1501. package/dist/types/model/commands/personToken/ResetPasswordCommand.d.ts +1 -1
  1502. package/dist/types/model/commands/personToken/ResetPasswordCommand.d.ts.map +1 -1
  1503. package/dist/types/model/commands/personToken/SaveEmailOtpTokenCommand.d.ts.map +1 -1
  1504. package/dist/types/model/commands/personToken/SavePersonTokenCommand.d.ts.map +1 -1
  1505. package/dist/types/model/commands/project/CreateProjectCommand.d.ts.map +1 -1
  1506. package/dist/types/model/commands/project/SetProjectSecretCommand.d.ts.map +1 -1
  1507. package/dist/types/model/commands/project/UpdateProjectCommand.d.ts.map +1 -1
  1508. package/dist/types/model/commands/rateLimit/RecordRateLimitEventCommand.d.ts.map +1 -1
  1509. package/dist/types/model/dtos/Password.d.ts.map +1 -1
  1510. package/dist/types/model/mailing/UserMailer.d.ts.map +1 -1
  1511. package/dist/types/model/mailing/templates/BackupCodesExhausted.mustache.d.ts.map +1 -1
  1512. package/dist/types/model/mailing/templates/EmailChangeNotify.mustache.d.ts.map +1 -1
  1513. package/dist/types/model/mailing/templates/EmailChangeVerify.mustache.d.ts.map +1 -1
  1514. package/dist/types/model/mailing/templates/EmailOtp.mustache.d.ts.map +1 -1
  1515. package/dist/types/model/mailing/templates/EmailVerification.mustache.d.ts.map +1 -1
  1516. package/dist/types/model/mailing/templates/ExistingUserInvited.mustache.d.ts.map +1 -1
  1517. package/dist/types/model/mailing/templates/ForcedSignOut.mustache.d.ts.map +1 -1
  1518. package/dist/types/model/mailing/templates/Layout.mustache.d.ts.map +1 -1
  1519. package/dist/types/model/mailing/templates/NewUserInvited.mustache.d.ts.map +1 -1
  1520. package/dist/types/model/mailing/templates/PasswordReset.mustache.d.ts.map +1 -1
  1521. package/dist/types/model/mailing/templates/PasswordlessSignIn.mustache.d.ts.map +1 -1
  1522. package/dist/types/model/mailing/templates/UnusualLogin.mustache.d.ts.map +1 -1
  1523. package/dist/types/model/mailing/type.d.ts.map +1 -1
  1524. package/dist/types/model/queries/apiKey/ApiKeyListQuery.d.ts.map +1 -1
  1525. package/dist/types/model/queries/apiKey/ApiKeyQuery.d.ts +4 -0
  1526. package/dist/types/model/queries/apiKey/ApiKeyQuery.d.ts.map +1 -1
  1527. package/dist/types/model/queries/apiKey/ApiKeySessionsQuery.d.ts +1 -4
  1528. package/dist/types/model/queries/apiKey/ApiKeySessionsQuery.d.ts.map +1 -1
  1529. package/dist/types/model/queries/authLog/AuthLogQuery.d.ts.map +1 -1
  1530. package/dist/types/model/queries/authLog/NextLoginAttemptQuery.d.ts +2 -2
  1531. package/dist/types/model/queries/authLog/NextLoginAttemptQuery.d.ts.map +1 -1
  1532. package/dist/types/model/queries/authLog/NextMailAttemptQuery.d.ts +2 -2
  1533. package/dist/types/model/queries/authLog/NextMailAttemptQuery.d.ts.map +1 -1
  1534. package/dist/types/model/queries/authPolicy/AuthPoliciesQuery.d.ts.map +1 -1
  1535. package/dist/types/model/queries/configuration/ConfigurationQuery.d.ts.map +1 -1
  1536. package/dist/types/model/queries/customRole/CustomRolesQuery.d.ts +12 -0
  1537. package/dist/types/model/queries/customRole/CustomRolesQuery.d.ts.map +1 -0
  1538. package/dist/types/model/queries/customRole/index.d.ts +2 -0
  1539. package/dist/types/model/queries/customRole/index.d.ts.map +1 -0
  1540. package/dist/types/model/queries/identity/IdentitiesHoldingRoleCountQuery.d.ts +8 -0
  1541. package/dist/types/model/queries/identity/IdentitiesHoldingRoleCountQuery.d.ts.map +1 -0
  1542. package/dist/types/model/queries/identity/IdentityQuery.d.ts +3 -2
  1543. package/dist/types/model/queries/identity/IdentityQuery.d.ts.map +1 -1
  1544. package/dist/types/model/queries/identity/index.d.ts +1 -0
  1545. package/dist/types/model/queries/identity/index.d.ts.map +1 -1
  1546. package/dist/types/model/queries/idp/IdentityProviderBySlugQuery.d.ts.map +1 -1
  1547. package/dist/types/model/queries/idp/IdentityProvidersQuery.d.ts.map +1 -1
  1548. package/dist/types/model/queries/idp/IdpSessionByApiKeyQuery.d.ts.map +1 -1
  1549. package/dist/types/model/queries/idp/IdpSessionsBySidQuery.d.ts.map +1 -1
  1550. package/dist/types/model/queries/idp/IdpSessionsBySubQuery.d.ts.map +1 -1
  1551. package/dist/types/model/queries/idp/LocalAuthDisablingIdpsQuery.d.ts +18 -0
  1552. package/dist/types/model/queries/idp/LocalAuthDisablingIdpsQuery.d.ts.map +1 -0
  1553. package/dist/types/model/queries/idp/PersonIdentityProvidersQuery.d.ts +1 -0
  1554. package/dist/types/model/queries/idp/PersonIdentityProvidersQuery.d.ts.map +1 -1
  1555. package/dist/types/model/queries/idp/helpers.d.ts +1 -1
  1556. package/dist/types/model/queries/idp/helpers.d.ts.map +1 -1
  1557. package/dist/types/model/queries/idp/index.d.ts +1 -0
  1558. package/dist/types/model/queries/idp/index.d.ts.map +1 -1
  1559. package/dist/types/model/queries/idp/types.d.ts +1 -0
  1560. package/dist/types/model/queries/idp/types.d.ts.map +1 -1
  1561. package/dist/types/model/queries/index.d.ts +1 -0
  1562. package/dist/types/model/queries/index.d.ts.map +1 -1
  1563. package/dist/types/model/queries/mailTemplate/MailTemplateListQuery.d.ts.map +1 -1
  1564. package/dist/types/model/queries/mailTemplate/MailTemplateQuery.d.ts.map +1 -1
  1565. package/dist/types/model/queries/membership/AllProjectRolesByIdentityQuery.d.ts.map +1 -1
  1566. package/dist/types/model/queries/membership/IdentityHasProjectMembershipsQuery.d.ts +7 -0
  1567. package/dist/types/model/queries/membership/IdentityHasProjectMembershipsQuery.d.ts.map +1 -0
  1568. package/dist/types/model/queries/membership/ProjectMembersQuery.d.ts.map +1 -1
  1569. package/dist/types/model/queries/membership/ProjectMembershipByIdentityQuery.d.ts.map +1 -1
  1570. package/dist/types/model/queries/membership/ProjectRolesByIdentityQuery.d.ts.map +1 -1
  1571. package/dist/types/model/queries/membership/ProjectSlugSpecification.d.ts.map +1 -1
  1572. package/dist/types/model/queries/membership/index.d.ts +1 -0
  1573. package/dist/types/model/queries/membership/index.d.ts.map +1 -1
  1574. package/dist/types/model/queries/person/PersonByIdPQuery.d.ts.map +1 -1
  1575. package/dist/types/model/queries/person/PersonByIdentityBatchQuery.d.ts.map +1 -1
  1576. package/dist/types/model/queries/person/PersonQuery.d.ts.map +1 -1
  1577. package/dist/types/model/queries/person/PersonQueryBuilderFactory.d.ts.map +1 -1
  1578. package/dist/types/model/queries/person/PersonsQuery.d.ts.map +1 -1
  1579. package/dist/types/model/queries/person/types.d.ts +3 -0
  1580. package/dist/types/model/queries/person/types.d.ts.map +1 -1
  1581. package/dist/types/model/queries/personToken/PersonTokenQuery.d.ts.map +1 -1
  1582. package/dist/types/model/queries/project/ProjectBySlugQuery.d.ts.map +1 -1
  1583. package/dist/types/model/queries/project/ProjectSecretKeysQuery.d.ts.map +1 -1
  1584. package/dist/types/model/queries/project/ProjectSecretsQuery.d.ts.map +1 -1
  1585. package/dist/types/model/queries/project/ProjectUpdateTimestampQuery.d.ts.map +1 -1
  1586. package/dist/types/model/queries/project/ProjectsByIdentityQuery.d.ts.map +1 -1
  1587. package/dist/types/model/queries/project/ProjectsQuery.d.ts.map +1 -1
  1588. package/dist/types/model/queries/rateLimit/RateLimitCountQuery.d.ts +2 -2
  1589. package/dist/types/model/queries/rateLimit/RateLimitCountQuery.d.ts.map +1 -1
  1590. package/dist/types/model/service/AuthLogService.d.ts.map +1 -1
  1591. package/dist/types/model/service/AuthPolicyManager.d.ts.map +1 -1
  1592. package/dist/types/model/service/AuthPolicyResolver.d.ts.map +1 -1
  1593. package/dist/types/model/service/BackupCodeManager.d.ts.map +1 -1
  1594. package/dist/types/model/service/ConfigurationManager.d.ts.map +1 -1
  1595. package/dist/types/model/service/CustomRoleManager.d.ts +46 -0
  1596. package/dist/types/model/service/CustomRoleManager.d.ts.map +1 -0
  1597. package/dist/types/model/service/EmailChangeManager.d.ts.map +1 -1
  1598. package/dist/types/model/service/EmailOtpManager.d.ts.map +1 -1
  1599. package/dist/types/model/service/EmailValidator.d.ts.map +1 -1
  1600. package/dist/types/model/service/EmailVerificationManager.d.ts.map +1 -1
  1601. package/dist/types/model/service/GlobalRoleValidator.d.ts +5 -0
  1602. package/dist/types/model/service/GlobalRoleValidator.d.ts.map +1 -0
  1603. package/dist/types/model/service/HibpChecker.d.ts.map +1 -1
  1604. package/dist/types/model/service/IDPSignInManager.d.ts +13 -1
  1605. package/dist/types/model/service/IDPSignInManager.d.ts.map +1 -1
  1606. package/dist/types/model/service/InviteManager.d.ts.map +1 -1
  1607. package/dist/types/model/service/LoginRiskAnalyzer.d.ts +1 -1
  1608. package/dist/types/model/service/LoginRiskAnalyzer.d.ts.map +1 -1
  1609. package/dist/types/model/service/MailTemplateManager.d.ts.map +1 -1
  1610. package/dist/types/model/service/MembershipValidator.d.ts.map +1 -1
  1611. package/dist/types/model/service/OtpAuthenticator.d.ts.map +1 -1
  1612. package/dist/types/model/service/OtpManager.d.ts.map +1 -1
  1613. package/dist/types/model/service/PanelAccessResolver.d.ts +19 -0
  1614. package/dist/types/model/service/PanelAccessResolver.d.ts.map +1 -0
  1615. package/dist/types/model/service/PasswordChangeManager.d.ts.map +1 -1
  1616. package/dist/types/model/service/PasswordResetManager.d.ts.map +1 -1
  1617. package/dist/types/model/service/PasswordStrengthValidator.d.ts.map +1 -1
  1618. package/dist/types/model/service/PasswordlessSignInManager.d.ts.map +1 -1
  1619. package/dist/types/model/service/PersonAccessManager.d.ts +5 -2
  1620. package/dist/types/model/service/PersonAccessManager.d.ts.map +1 -1
  1621. package/dist/types/model/service/PersonManager.d.ts.map +1 -1
  1622. package/dist/types/model/service/ProjectManager.d.ts.map +1 -1
  1623. package/dist/types/model/service/ProjectMemberManager.d.ts.map +1 -1
  1624. package/dist/types/model/service/RateLimiter.d.ts +1 -1
  1625. package/dist/types/model/service/RateLimiter.d.ts.map +1 -1
  1626. package/dist/types/model/service/RolesManager.d.ts +6 -1
  1627. package/dist/types/model/service/RolesManager.d.ts.map +1 -1
  1628. package/dist/types/model/service/SecretsManager.d.ts.map +1 -1
  1629. package/dist/types/model/service/SignInManager.d.ts.map +1 -1
  1630. package/dist/types/model/service/SignOutManager.d.ts.map +1 -1
  1631. package/dist/types/model/service/SignUpManager.d.ts +3 -1
  1632. package/dist/types/model/service/SignUpManager.d.ts.map +1 -1
  1633. package/dist/types/model/service/apiKey/ApiKeyManager.d.ts +4 -1
  1634. package/dist/types/model/service/apiKey/ApiKeyManager.d.ts.map +1 -1
  1635. package/dist/types/model/service/apiKey/ApiKeyService.d.ts +2 -2
  1636. package/dist/types/model/service/apiKey/ApiKeyService.d.ts.map +1 -1
  1637. package/dist/types/model/service/apiKey/UnpersistedApiKeyManager.d.ts +18 -0
  1638. package/dist/types/model/service/apiKey/UnpersistedApiKeyManager.d.ts.map +1 -1
  1639. package/dist/types/model/service/captcha/CaptchaValidator.d.ts.map +1 -1
  1640. package/dist/types/model/service/captcha/HCaptchaProvider.d.ts.map +1 -1
  1641. package/dist/types/model/service/captcha/RecaptchaV3Provider.d.ts.map +1 -1
  1642. package/dist/types/model/service/captcha/TurnstileProvider.d.ts.map +1 -1
  1643. package/dist/types/model/service/helpers/getPreferredProject.d.ts.map +1 -1
  1644. package/dist/types/model/service/helpers/isPasswordlessEnabled.d.ts.map +1 -1
  1645. package/dist/types/model/service/idp/BackchannelLogoutManager.d.ts.map +1 -1
  1646. package/dist/types/model/service/idp/ClaimMapping.d.ts +330 -0
  1647. package/dist/types/model/service/idp/ClaimMapping.d.ts.map +1 -0
  1648. package/dist/types/model/service/idp/ClaimMappingEvaluator.d.ts +30 -0
  1649. package/dist/types/model/service/idp/ClaimMappingEvaluator.d.ts.map +1 -0
  1650. package/dist/types/model/service/idp/ClaimMappingValidation.d.ts +55 -0
  1651. package/dist/types/model/service/idp/ClaimMappingValidation.d.ts.map +1 -0
  1652. package/dist/types/model/service/idp/IDPClaimSyncService.d.ts +113 -0
  1653. package/dist/types/model/service/idp/IDPClaimSyncService.d.ts.map +1 -0
  1654. package/dist/types/model/service/idp/IDPHandlerRegistry.d.ts.map +1 -1
  1655. package/dist/types/model/service/idp/IDPManager.d.ts +31 -1
  1656. package/dist/types/model/service/idp/IDPManager.d.ts.map +1 -1
  1657. package/dist/types/model/service/idp/IdentityProviderHandler.d.ts +7 -0
  1658. package/dist/types/model/service/idp/IdentityProviderHandler.d.ts.map +1 -1
  1659. package/dist/types/model/service/idp/IdpSessionRevalidator.d.ts +15 -1
  1660. package/dist/types/model/service/idp/IdpSessionRevalidator.d.ts.map +1 -1
  1661. package/dist/types/model/service/idp/PersonIdentityProviderManager.d.ts.map +1 -1
  1662. package/dist/types/model/service/idp/index.d.ts +4 -0
  1663. package/dist/types/model/service/idp/index.d.ts.map +1 -1
  1664. package/dist/types/model/service/idp/providers/AppleProvider.d.ts +2 -2
  1665. package/dist/types/model/service/idp/providers/AppleProvider.d.ts.map +1 -1
  1666. package/dist/types/model/service/idp/providers/FacebookProvider.d.ts +2 -2
  1667. package/dist/types/model/service/idp/providers/FacebookProvider.d.ts.map +1 -1
  1668. package/dist/types/model/service/idp/providers/OIDCHelpers.d.ts +13 -1
  1669. package/dist/types/model/service/idp/providers/OIDCHelpers.d.ts.map +1 -1
  1670. package/dist/types/model/service/idp/providers/OIDCProvider.d.ts +1 -1
  1671. package/dist/types/model/service/idp/providers/OIDCProvider.d.ts.map +1 -1
  1672. package/dist/types/model/service/idp/providers/OIDCTypes.d.ts +5 -5
  1673. package/dist/types/model/service/idp/providers/helpers.d.ts.map +1 -1
  1674. package/dist/types/model/service/index.d.ts +3 -0
  1675. package/dist/types/model/service/index.d.ts.map +1 -1
  1676. package/dist/types/model/service/membershipUtils.d.ts.map +1 -1
  1677. package/dist/types/model/type/AuthLog.d.ts +1 -1
  1678. package/dist/types/model/type/AuthLog.d.ts.map +1 -1
  1679. package/dist/types/model/type/Config.d.ts +2 -0
  1680. package/dist/types/model/type/Config.d.ts.map +1 -1
  1681. package/dist/types/model/type/CustomRole.d.ts +9 -0
  1682. package/dist/types/model/type/CustomRole.d.ts.map +1 -0
  1683. package/dist/types/model/type/IdentityProvider.d.ts +2 -0
  1684. package/dist/types/model/type/IdentityProvider.d.ts.map +1 -1
  1685. package/dist/types/model/type/PersonToken.d.ts +2 -0
  1686. package/dist/types/model/type/PersonToken.d.ts.map +1 -1
  1687. package/dist/types/model/type/RateLimit.d.ts +6 -6
  1688. package/dist/types/model/type/RateLimit.d.ts.map +1 -1
  1689. package/dist/types/model/type/index.d.ts +1 -0
  1690. package/dist/types/model/type/index.d.ts.map +1 -1
  1691. package/dist/types/model/utils/DatabaseContext.d.ts +15 -1
  1692. package/dist/types/model/utils/DatabaseContext.d.ts.map +1 -1
  1693. package/dist/types/model/utils/Response.d.ts.map +1 -1
  1694. package/dist/types/model/utils/email.d.ts.map +1 -1
  1695. package/dist/types/model/utils/hex.d.ts.map +1 -1
  1696. package/dist/types/model/utils/interval.d.ts.map +1 -1
  1697. package/dist/types/model/utils/time.d.ts.map +1 -1
  1698. package/dist/types/model/utils/token.d.ts +1 -2
  1699. package/dist/types/model/utils/token.d.ts.map +1 -1
  1700. package/dist/types/resolvers/ResolverFactory.d.ts +6 -0
  1701. package/dist/types/resolvers/ResolverFactory.d.ts.map +1 -1
  1702. package/dist/types/resolvers/TenantResolverContext.d.ts +1 -1
  1703. package/dist/types/resolvers/TenantResolverContext.d.ts.map +1 -1
  1704. package/dist/types/resolvers/TenantResolverContextFactory.d.ts +1 -1
  1705. package/dist/types/resolvers/TenantResolverContextFactory.d.ts.map +1 -1
  1706. package/dist/types/resolvers/errorUtils.d.ts.map +1 -1
  1707. package/dist/types/resolvers/membershipUtils.d.ts.map +1 -1
  1708. package/dist/types/resolvers/mutation/apiKey/CreateApiKeyMutationResolver.d.ts.map +1 -1
  1709. package/dist/types/resolvers/mutation/apiKey/DisableApiKeyMutationResolver.d.ts.map +1 -1
  1710. package/dist/types/resolvers/mutation/configuration/AuthPolicyMutationResolver.d.ts.map +1 -1
  1711. package/dist/types/resolvers/mutation/configuration/ConfigurationMutationResolver.d.ts.map +1 -1
  1712. package/dist/types/resolvers/mutation/customRole/CustomRoleMutationResolver.d.ts +16 -0
  1713. package/dist/types/resolvers/mutation/customRole/CustomRoleMutationResolver.d.ts.map +1 -0
  1714. package/dist/types/resolvers/mutation/identity/GlobalRolesMutationResolver.d.ts.map +1 -1
  1715. package/dist/types/resolvers/mutation/idp/AddIDPMutationResolver.d.ts.map +1 -1
  1716. package/dist/types/resolvers/mutation/idp/DisableIDPMutationResolver.d.ts.map +1 -1
  1717. package/dist/types/resolvers/mutation/idp/DisconnectMyIdentityProviderMutationResolver.d.ts.map +1 -1
  1718. package/dist/types/resolvers/mutation/idp/EnableIDPMutationResolver.d.ts.map +1 -1
  1719. package/dist/types/resolvers/mutation/idp/UpdateIDPMutationResolver.d.ts.map +1 -1
  1720. package/dist/types/resolvers/mutation/idp/audit.d.ts.map +1 -1
  1721. package/dist/types/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.d.ts +2 -0
  1722. package/dist/types/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.d.ts.map +1 -1
  1723. package/dist/types/resolvers/mutation/person/ChangePasswordMutationResolver.d.ts.map +1 -1
  1724. package/dist/types/resolvers/mutation/person/ChangeProfileMutationResolver.d.ts.map +1 -1
  1725. package/dist/types/resolvers/mutation/person/DisablePersonMutationResolver.d.ts +1 -1
  1726. package/dist/types/resolvers/mutation/person/DisablePersonMutationResolver.d.ts.map +1 -1
  1727. package/dist/types/resolvers/mutation/person/EmailOtpMutationResolver.d.ts.map +1 -1
  1728. package/dist/types/resolvers/mutation/person/EmailVerificationMutationResolver.d.ts.map +1 -1
  1729. package/dist/types/resolvers/mutation/person/EnablePersonMutationResolver.d.ts +11 -0
  1730. package/dist/types/resolvers/mutation/person/EnablePersonMutationResolver.d.ts.map +1 -0
  1731. package/dist/types/resolvers/mutation/person/ForceSignOutMutationResolver.d.ts.map +1 -1
  1732. package/dist/types/resolvers/mutation/person/IDPMutationResolver.d.ts.map +1 -1
  1733. package/dist/types/resolvers/mutation/person/InviteMutationResolver.d.ts.map +1 -1
  1734. package/dist/types/resolvers/mutation/person/OtpMutationResolver.d.ts.map +1 -1
  1735. package/dist/types/resolvers/mutation/person/PasswordlessMutationResolver.d.ts.map +1 -1
  1736. package/dist/types/resolvers/mutation/person/RegenerateBackupCodesMutationResolver.d.ts.map +1 -1
  1737. package/dist/types/resolvers/mutation/person/ResetPasswordMutationResolver.d.ts.map +1 -1
  1738. package/dist/types/resolvers/mutation/person/ResetPersonMfaMutationResolver.d.ts.map +1 -1
  1739. package/dist/types/resolvers/mutation/person/RevokeSessionMutationResolver.d.ts.map +1 -1
  1740. package/dist/types/resolvers/mutation/person/SignInMutationResolver.d.ts.map +1 -1
  1741. package/dist/types/resolvers/mutation/person/SignOutMutationResolver.d.ts.map +1 -1
  1742. package/dist/types/resolvers/mutation/person/SignUpMutationResolver.d.ts.map +1 -1
  1743. package/dist/types/resolvers/mutation/person/TogglePasswordlessMutationResolver.d.ts.map +1 -1
  1744. package/dist/types/resolvers/mutation/project/CreateProjectMutationResolver.d.ts.map +1 -1
  1745. package/dist/types/resolvers/mutation/project/SetProjectSecretMutationResolver.d.ts.map +1 -1
  1746. package/dist/types/resolvers/mutation/project/UpdateProjectMutationResolver.d.ts.map +1 -1
  1747. package/dist/types/resolvers/mutation/projectMember/AddProjectMemberMutationResolver.d.ts.map +1 -1
  1748. package/dist/types/resolvers/mutation/projectMember/RemoveProjectMemberMutationResolver.d.ts.map +1 -1
  1749. package/dist/types/resolvers/mutation/projectMember/UpdateProjectMemberMutationResolver.d.ts.map +1 -1
  1750. package/dist/types/resolvers/mutation/projectMember/audit.d.ts +1 -1
  1751. package/dist/types/resolvers/mutation/projectMember/audit.d.ts.map +1 -1
  1752. package/dist/types/resolvers/query/ApiKeyQueryResolver.d.ts.map +1 -1
  1753. package/dist/types/resolvers/query/AuthLogQueryResolver.d.ts.map +1 -1
  1754. package/dist/types/resolvers/query/AuthPolicyQueryResolver.d.ts.map +1 -1
  1755. package/dist/types/resolvers/query/ConfigurationQueryResolver.d.ts.map +1 -1
  1756. package/dist/types/resolvers/query/CustomRoleQueryResolver.d.ts +11 -0
  1757. package/dist/types/resolvers/query/CustomRoleQueryResolver.d.ts.map +1 -0
  1758. package/dist/types/resolvers/query/IDPQueryResolver.d.ts.map +1 -1
  1759. package/dist/types/resolvers/query/MailTemplateQueryResolver.d.ts +1 -0
  1760. package/dist/types/resolvers/query/MailTemplateQueryResolver.d.ts.map +1 -1
  1761. package/dist/types/resolvers/query/MeQueryResolver.d.ts.map +1 -1
  1762. package/dist/types/resolvers/query/PersonQueryResolver.d.ts.map +1 -1
  1763. package/dist/types/resolvers/query/ProjectMembersQueryResolver.d.ts.map +1 -1
  1764. package/dist/types/resolvers/query/ProjectQueryResolver.d.ts.map +1 -1
  1765. package/dist/types/resolvers/responseHelpers/ApiKeyResponseFactory.d.ts.map +1 -1
  1766. package/dist/types/resolvers/responseHelpers/PersonResponseFactory.d.ts.map +1 -1
  1767. package/dist/types/resolvers/responseHelpers/ProjectResponseFactory.d.ts +10 -0
  1768. package/dist/types/resolvers/responseHelpers/ProjectResponseFactory.d.ts.map +1 -0
  1769. package/dist/types/resolvers/responseHelpers/SignInResponseFactory.d.ts.map +1 -1
  1770. package/dist/types/resolvers/types/IdentityTypeResolver.d.ts.map +1 -1
  1771. package/dist/types/resolvers/types/PersonTypeResolver.d.ts +15 -1
  1772. package/dist/types/resolvers/types/PersonTypeResolver.d.ts.map +1 -1
  1773. package/dist/types/resolvers/types/ProjectTypeResolver.d.ts +15 -6
  1774. package/dist/types/resolvers/types/ProjectTypeResolver.d.ts.map +1 -1
  1775. package/dist/types/schema/index.d.ts +381 -21
  1776. package/dist/types/schema/index.d.ts.map +1 -1
  1777. package/dist/types/schema/tenant.graphql.d.ts.map +1 -1
  1778. package/dist/types/schema/types.d.ts +2 -2
  1779. package/dist/types/schema/types.d.ts.map +1 -1
  1780. package/dist/types/tsconfig.tsbuildinfo +1 -1
  1781. package/dist/types/utils/Mailer.d.ts.map +1 -1
  1782. package/dist/types/utils/TemplateRenderer.d.ts.map +1 -1
  1783. package/dist/types/utils/array.d.ts.map +1 -1
  1784. package/dist/types/utils/batchQuery.d.ts.map +1 -1
  1785. package/package.json +12 -12
  1786. package/readme.md +56 -0
  1787. package/src/TenantContainer.ts +46 -8
  1788. package/src/migrations/2026-06-18-120000-idp-claim-mapping.ts +15 -0
  1789. package/src/migrations/2026-08-03-120000-person-enable-auth-log.ts +12 -0
  1790. package/src/migrations/2026-08-04-120000-config-panel.ts +13 -0
  1791. package/src/migrations/2026-09-04-120000-idp-disable-local-authentication.ts +18 -0
  1792. package/src/migrations/2026-09-11-120000-custom-role.ts +19 -0
  1793. package/src/migrations/runner.ts +10 -0
  1794. package/src/migrations/snapshot.ts +22 -2
  1795. package/src/model/authorization/CustomRoleAuthorizator.ts +72 -0
  1796. package/src/model/authorization/CustomRolePermissions.ts +558 -0
  1797. package/src/model/authorization/PermissionActions.ts +74 -17
  1798. package/src/model/authorization/PermissionContextFactory.ts +39 -3
  1799. package/src/model/authorization/PermissionsFactory.ts +65 -31
  1800. package/src/model/authorization/Roles.ts +13 -0
  1801. package/src/model/authorization/TargetIdentityPermission.ts +37 -0
  1802. package/src/model/authorization/index.ts +3 -0
  1803. package/src/model/commands/apiKey/ApiKeyHelper.ts +23 -0
  1804. package/src/model/commands/apiKey/CreateApiKeyCommand.ts +12 -5
  1805. package/src/model/commands/apiKey/ProlongApiKeyCommand.ts +22 -14
  1806. package/src/model/commands/authLog/CreateAuthLogEntryCommand.ts +1 -0
  1807. package/src/model/commands/configuration/UpdateConfigurationCommand.ts +5 -4
  1808. package/src/model/commands/customRole/CreateCustomRoleCommand.ts +30 -0
  1809. package/src/model/commands/customRole/DeleteCustomRoleCommand.ts +20 -0
  1810. package/src/model/commands/customRole/RemoveCustomRoleAssignmentsCommand.ts +20 -0
  1811. package/src/model/commands/customRole/UpdateCustomRoleCommand.ts +30 -0
  1812. package/src/model/commands/customRole/index.ts +4 -0
  1813. package/src/model/commands/identity/PatchIdentityGlobalRoles.ts +1 -1
  1814. package/src/model/commands/idp/ClaimIdpRevalidationCommand.ts +8 -7
  1815. package/src/model/commands/idp/CreateIdpCommand.ts +7 -1
  1816. package/src/model/commands/idp/CreateIdpSessionCommand.ts +5 -2
  1817. package/src/model/commands/idp/UpdateIdpCommand.ts +5 -1
  1818. package/src/model/commands/idp/UpdateIdpSessionCommand.ts +3 -2
  1819. package/src/model/commands/index.ts +1 -0
  1820. package/src/model/commands/membership/UpdateProjectMemberCommand.ts +1 -1
  1821. package/src/model/commands/membership/index.ts +2 -1
  1822. package/src/model/commands/membership/variables/index.ts +1 -0
  1823. package/src/model/commands/person/CreatePersonCommand.ts +1 -0
  1824. package/src/model/commands/person/EnablePersonCommand.ts +18 -0
  1825. package/src/model/commands/person/SetMfaGraceUntilCommand.ts +9 -4
  1826. package/src/model/commands/personToken/ResetPasswordCommand.ts +2 -3
  1827. package/src/model/commands/personToken/SaveEmailOtpTokenCommand.ts +5 -4
  1828. package/src/model/commands/personToken/SavePersonTokenCommand.ts +13 -7
  1829. package/src/model/commands/rateLimit/RecordRateLimitEventCommand.ts +3 -1
  1830. package/src/model/queries/apiKey/ApiKeyQuery.ts +17 -1
  1831. package/src/model/queries/apiKey/ApiKeySessionsQuery.ts +2 -2
  1832. package/src/model/queries/authLog/NextLoginAttemptQuery.ts +14 -12
  1833. package/src/model/queries/authLog/NextMailAttemptQuery.ts +12 -10
  1834. package/src/model/queries/configuration/ConfigurationQuery.ts +4 -0
  1835. package/src/model/queries/customRole/CustomRolesQuery.ts +30 -0
  1836. package/src/model/queries/customRole/index.ts +1 -0
  1837. package/src/model/queries/identity/IdentitiesHoldingRoleCountQuery.ts +17 -0
  1838. package/src/model/queries/identity/IdentityQuery.ts +10 -4
  1839. package/src/model/queries/identity/index.ts +1 -0
  1840. package/src/model/queries/idp/LocalAuthDisablingIdpsQuery.ts +41 -0
  1841. package/src/model/queries/idp/PersonIdentityProvidersQuery.ts +2 -0
  1842. package/src/model/queries/idp/helpers.ts +3 -2
  1843. package/src/model/queries/idp/index.ts +1 -0
  1844. package/src/model/queries/idp/types.ts +1 -0
  1845. package/src/model/queries/index.ts +1 -0
  1846. package/src/model/queries/membership/IdentityHasProjectMembershipsQuery.ts +17 -0
  1847. package/src/model/queries/membership/ProjectMembersQuery.ts +1 -0
  1848. package/src/model/queries/membership/index.ts +1 -0
  1849. package/src/model/queries/person/PersonQueryBuilderFactory.ts +4 -0
  1850. package/src/model/queries/person/types.ts +3 -0
  1851. package/src/model/queries/personToken/PersonTokenQuery.ts +4 -0
  1852. package/src/model/queries/rateLimit/RateLimitCountQuery.ts +5 -2
  1853. package/src/model/service/AuthLogService.ts +18 -2
  1854. package/src/model/service/CustomRoleManager.ts +221 -0
  1855. package/src/model/service/EmailChangeManager.ts +3 -3
  1856. package/src/model/service/EmailOtpManager.ts +0 -1
  1857. package/src/model/service/EmailVerificationManager.ts +3 -3
  1858. package/src/model/service/GlobalRoleValidator.ts +30 -0
  1859. package/src/model/service/IDPSignInManager.ts +74 -14
  1860. package/src/model/service/PanelAccessResolver.ts +32 -0
  1861. package/src/model/service/PasswordResetManager.ts +11 -3
  1862. package/src/model/service/PasswordlessSignInManager.ts +26 -6
  1863. package/src/model/service/PersonAccessManager.ts +19 -3
  1864. package/src/model/service/RateLimiter.ts +2 -3
  1865. package/src/model/service/RolesManager.ts +28 -14
  1866. package/src/model/service/SignInManager.ts +16 -8
  1867. package/src/model/service/SignUpManager.ts +12 -4
  1868. package/src/model/service/apiKey/ApiKeyManager.ts +75 -53
  1869. package/src/model/service/apiKey/ApiKeyService.ts +2 -2
  1870. package/src/model/service/apiKey/UnpersistedApiKeyManager.ts +24 -0
  1871. package/src/model/service/idp/ClaimMapping.ts +283 -0
  1872. package/src/model/service/idp/ClaimMappingEvaluator.ts +226 -0
  1873. package/src/model/service/idp/ClaimMappingValidation.ts +158 -0
  1874. package/src/model/service/idp/IDPClaimSyncService.ts +401 -0
  1875. package/src/model/service/idp/IDPManager.ts +126 -21
  1876. package/src/model/service/idp/IdentityProviderHandler.ts +7 -0
  1877. package/src/model/service/idp/IdpSessionRevalidator.ts +130 -25
  1878. package/src/model/service/idp/PersonIdentityProviderManager.ts +8 -0
  1879. package/src/model/service/idp/index.ts +4 -0
  1880. package/src/model/service/idp/providers/OIDCHelpers.ts +161 -53
  1881. package/src/model/service/idp/providers/OIDCProvider.ts +4 -1
  1882. package/src/model/service/index.ts +3 -0
  1883. package/src/model/type/AuthLog.ts +4 -0
  1884. package/src/model/type/Config.ts +3 -0
  1885. package/src/model/type/CustomRole.ts +8 -0
  1886. package/src/model/type/IdentityProvider.ts +2 -0
  1887. package/src/model/type/PersonToken.ts +2 -0
  1888. package/src/model/type/index.ts +1 -0
  1889. package/src/model/utils/DatabaseContext.ts +30 -6
  1890. package/src/model/utils/token.ts +2 -3
  1891. package/src/resolvers/ResolverFactory.ts +17 -0
  1892. package/src/resolvers/TenantResolverContext.ts +1 -1
  1893. package/src/resolvers/TenantResolverContextFactory.ts +5 -5
  1894. package/src/resolvers/mutation/apiKey/CreateApiKeyMutationResolver.ts +13 -5
  1895. package/src/resolvers/mutation/customRole/CustomRoleMutationResolver.ts +125 -0
  1896. package/src/resolvers/mutation/identity/GlobalRolesMutationResolver.ts +30 -7
  1897. package/src/resolvers/mutation/idp/AddIDPMutationResolver.ts +1 -0
  1898. package/src/resolvers/mutation/idp/UpdateIDPMutationResolver.ts +1 -0
  1899. package/src/resolvers/mutation/idp/audit.ts +1 -0
  1900. package/src/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.ts +48 -14
  1901. package/src/resolvers/mutation/person/ChangePasswordMutationResolver.ts +2 -2
  1902. package/src/resolvers/mutation/person/ChangeProfileMutationResolver.ts +9 -3
  1903. package/src/resolvers/mutation/person/DisablePersonMutationResolver.ts +5 -5
  1904. package/src/resolvers/mutation/person/EmailVerificationMutationResolver.ts +1 -1
  1905. package/src/resolvers/mutation/person/EnablePersonMutationResolver.ts +50 -0
  1906. package/src/resolvers/mutation/person/ForceSignOutMutationResolver.ts +2 -2
  1907. package/src/resolvers/mutation/person/IDPMutationResolver.ts +31 -0
  1908. package/src/resolvers/mutation/person/PasswordlessMutationResolver.ts +7 -0
  1909. package/src/resolvers/mutation/person/ResetPasswordMutationResolver.ts +1 -1
  1910. package/src/resolvers/mutation/person/ResetPersonMfaMutationResolver.ts +2 -2
  1911. package/src/resolvers/mutation/person/SignInMutationResolver.ts +22 -9
  1912. package/src/resolvers/mutation/person/SignUpMutationResolver.ts +1 -1
  1913. package/src/resolvers/query/CustomRoleQueryResolver.ts +41 -0
  1914. package/src/resolvers/query/MailTemplateQueryResolver.ts +13 -8
  1915. package/src/resolvers/query/PersonQueryResolver.ts +3 -1
  1916. package/src/resolvers/query/ProjectQueryResolver.ts +3 -2
  1917. package/src/resolvers/responseHelpers/PersonResponseFactory.ts +5 -0
  1918. package/src/resolvers/responseHelpers/ProjectResponseFactory.ts +24 -0
  1919. package/src/resolvers/responseHelpers/SignInResponseFactory.ts +1 -1
  1920. package/src/resolvers/types/IdentityTypeResolver.ts +50 -14
  1921. package/src/resolvers/types/PersonTypeResolver.ts +45 -4
  1922. package/src/resolvers/types/ProjectTypeResolver.ts +33 -1
  1923. package/src/schema/index.ts +483 -15
  1924. package/src/schema/tenant.graphql.ts +275 -15
  1925. package/tests/cases/integration/database/dbClock.test.ts +171 -0
  1926. package/tests/cases/integration/mocked/antiAbuseSignUp.test.ts +2 -2
  1927. package/tests/cases/integration/mocked/changeMyProfileEmailVerificationMutation.test.ts +10 -11
  1928. package/tests/cases/integration/mocked/changePasswordMutation.test.ts +43 -0
  1929. package/tests/cases/integration/mocked/changeProfileMutation.test.ts +2 -0
  1930. package/tests/cases/integration/mocked/configurationPanel.test.ts +105 -0
  1931. package/tests/cases/integration/mocked/confirmEmailChangeMutation.test.ts +4 -2
  1932. package/tests/cases/integration/mocked/createSessionKeyMutation.test.ts +33 -0
  1933. package/tests/cases/integration/mocked/customRoleCrud.test.ts +442 -0
  1934. package/tests/cases/integration/mocked/disablePersonMutation.test.ts +92 -0
  1935. package/tests/cases/integration/mocked/enablePersonMutation.test.ts +137 -0
  1936. package/tests/cases/integration/mocked/forceSignOutPersonMutation.test.ts +3 -1
  1937. package/tests/cases/integration/mocked/globalIdentityRolesMutation.test.ts +169 -3
  1938. package/tests/cases/integration/mocked/gql/passwordless.ts +10 -0
  1939. package/tests/cases/integration/mocked/idpClaimMappingConfig.test.ts +332 -0
  1940. package/tests/cases/integration/mocked/listProjectMembersQuery.test.ts +8 -3
  1941. package/tests/cases/integration/mocked/localAuthenticationDisabled.test.ts +182 -0
  1942. package/tests/cases/integration/mocked/mailTemplateScope.test.ts +95 -0
  1943. package/tests/cases/integration/mocked/permissionsQuery.test.ts +153 -0
  1944. package/tests/cases/integration/mocked/personByIdQuery.test.ts +59 -1
  1945. package/tests/cases/integration/mocked/personIdentityProviders.test.ts +67 -0
  1946. package/tests/cases/integration/mocked/personsQuery.test.ts +38 -5
  1947. package/tests/cases/integration/mocked/requestEmailVerificationMutation.test.ts +15 -6
  1948. package/tests/cases/integration/mocked/resetPersonMfaMutation.test.ts +5 -3
  1949. package/tests/cases/integration/mocked/signInAnomalyDetection.test.ts +13 -2
  1950. package/tests/cases/integration/mocked/signInIdpClaimMapping.test.ts +1258 -0
  1951. package/tests/cases/integration/mocked/signInIdpClaimMappingFixes.test.ts +344 -0
  1952. package/tests/cases/integration/mocked/signInIdpClaimMappingSafety.test.ts +531 -0
  1953. package/tests/cases/integration/mocked/signInIdpMutation.test.ts +105 -1
  1954. package/tests/cases/integration/mocked/signInMfaEnforcement.test.ts +20 -5
  1955. package/tests/cases/integration/mocked/signInMutation.test.ts +14 -0
  1956. package/tests/cases/integration/mocked/signInPasswordlessMutation.test.ts +38 -1
  1957. package/tests/cases/integration/mocked/signUpMutation.test.ts +62 -3
  1958. package/tests/cases/integration/mocked/sql/createPersonTokenSql.ts +4 -3
  1959. package/tests/cases/integration/mocked/sql/createSessionKeySql.ts +2 -2
  1960. package/tests/cases/integration/mocked/sql/emailOtpSql.ts +10 -8
  1961. package/tests/cases/integration/mocked/sql/getApiKeySql.ts +2 -2
  1962. package/tests/cases/integration/mocked/sql/getConfigSql.ts +3 -0
  1963. package/tests/cases/integration/mocked/sql/getCustomRolesSql.ts +25 -0
  1964. package/tests/cases/integration/mocked/sql/getIdentityProjectMembershipPresenceSql.ts +11 -0
  1965. package/tests/cases/integration/mocked/sql/getIdpBySlugSql.ts +1 -1
  1966. package/tests/cases/integration/mocked/sql/getNextLoginAttemptSql.ts +15 -11
  1967. package/tests/cases/integration/mocked/sql/getNextMailAttemptSql.ts +12 -13
  1968. package/tests/cases/integration/mocked/sql/getPersonByEmailSql.ts +5 -2
  1969. package/tests/cases/integration/mocked/sql/getPersonByIdSql.ts +1 -1
  1970. package/tests/cases/integration/mocked/sql/getPersonByIdentity.ts +1 -1
  1971. package/tests/cases/integration/mocked/sql/getPersonByIdpSql.ts +1 -1
  1972. package/tests/cases/integration/mocked/sql/getPersonsByIdentitySql.ts +1 -1
  1973. package/tests/cases/integration/mocked/sql/getProjectBySlugSql.ts +1 -1
  1974. package/tests/cases/integration/mocked/sql/listPersonsSql.ts +5 -2
  1975. package/tests/cases/integration/mocked/sql/listSessionsSql.ts +3 -3
  1976. package/tests/cases/integration/mocked/sql/localAuthDisablingIdpsSql.ts +21 -0
  1977. package/tests/cases/integration/mocked/sql/personIdentityProvidersSql.ts +4 -2
  1978. package/tests/cases/integration/mocked/sql/removeMembershipSql.ts +14 -0
  1979. package/tests/cases/integration/mocked/sql/sqlTransaction.ts +28 -0
  1980. package/tests/cases/integration/mocked/trustForwardedClientInfo.test.ts +60 -3
  1981. package/tests/cases/integration/mocked/verifyEmailMutation.test.ts +9 -5
  1982. package/tests/cases/unit/apiKey/createSessionApiKeyPolicy.test.ts +9 -6
  1983. package/tests/cases/unit/apiKey/prolongApiKeyCommand.test.ts +29 -19
  1984. package/tests/cases/unit/apiKey/unpersistedApiKeyManager.test.ts +4 -5
  1985. package/tests/cases/unit/apiKey/verifyAndProlongIdle.test.ts +16 -6
  1986. package/tests/cases/unit/apiKey/verifyAndProlongReplica.test.ts +173 -0
  1987. package/tests/cases/unit/authLogBaselineWrite.test.ts +26 -3
  1988. package/tests/cases/unit/backupCodeManager.test.ts +1 -0
  1989. package/tests/cases/unit/customRoleAuthorizator.test.ts +149 -0
  1990. package/tests/cases/unit/customRolePermissions.test.ts +583 -0
  1991. package/tests/cases/unit/databaseContextRetry.test.ts +81 -0
  1992. package/tests/cases/unit/emailOtpManager.test.ts +10 -8
  1993. package/tests/cases/unit/idp/claimIdpRevalidation.test.ts +50 -0
  1994. package/tests/cases/unit/idp/claimMappingEvaluator.test.ts +554 -0
  1995. package/tests/cases/unit/idp/claimMappingValidation.test.ts +134 -0
  1996. package/tests/cases/unit/idp/idpManagerConfigMerge.test.ts +97 -0
  1997. package/tests/cases/unit/idp/idpManagerUnknownConfigKeys.test.ts +108 -0
  1998. package/tests/cases/unit/idp/idpSessionRevalidator.test.ts +261 -26
  1999. package/tests/cases/unit/idp/oidcClaims.test.ts +29 -0
  2000. package/tests/cases/unit/idp/oidcResponse.test.ts +54 -0
  2001. package/tests/cases/unit/idp/oidcRevalidate.test.ts +94 -2
  2002. package/tests/cases/unit/otpManager.test.ts +1 -0
  2003. package/tests/cases/unit/panelAccessResolver.test.ts +57 -0
  2004. package/tests/cases/unit/rateLimiter.test.ts +7 -7
  2005. package/tests/cases/unit/savePersonTokenCommand.test.ts +40 -0
  2006. package/tests/cases/unit/updateConfigurationCommand.test.ts +63 -0
  2007. package/tests/src/IdPMock.ts +6 -0
  2008. package/tests/src/testTenant.ts +60 -12
  2009. package/dist/development/src/model/commands/membership/RemoveProjectMembershipsCommand.cjs.map +0 -1
  2010. package/dist/development/src/model/commands/membership/RemoveProjectMembershipsCommand.js.map +0 -1
  2011. package/dist/production/src/model/commands/membership/RemoveProjectMembershipsCommand.cjs.map +0 -1
  2012. package/dist/production/src/model/commands/membership/RemoveProjectMembershipsCommand.js.map +0 -1
  2013. package/dist/types/model/commands/membership/RemoveProjectMembershipsCommand.d.ts.map +0 -1
  2014. /package/src/model/commands/membership/{RemoveProjectMembershipsCommand.ts → RemoveProjectMembershipCommand.ts} +0 -0
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ require("../queries/apiKey/ApiKeyQuery.cjs");
4
+ require("@contember/database");
5
+ require("../type/ApiKey.cjs");
6
+ const IdentityHasProjectMembershipsQuery = require("../queries/membership/IdentityHasProjectMembershipsQuery.cjs");
7
+ const IdentityQuery = require("../queries/identity/IdentityQuery.cjs");
8
+ require("./PermissionActions.cjs");
9
+ require("@contember/authorization");
10
+ const Roles = require("./Roles.cjs");
11
+ require("./CustomRolePermissions.cjs");
12
+ require("./PermissionContext.cjs");
13
+ require("@contember/schema");
14
+ const batchQuery = require("../../utils/batchQuery.cjs");
15
+ const projectMembershipPresenceLoader = batchQuery.batchLoader(
16
+ async (identityIds, db) => await db.queryHandler.fetch(new IdentityHasProjectMembershipsQuery.IdentityHasProjectMembershipsQuery(identityIds)),
17
+ (identityId, identitiesWithMemberships) => identitiesWithMemberships.has(identityId)
18
+ );
19
+ const targetIdentityLoader = batchQuery.batchLoader(
20
+ async (identityIds, db) => {
21
+ const identities = await db.queryHandler.fetch(new IdentityQuery.IdentityQuery(identityIds));
22
+ return Object.fromEntries(identities.map((identity) => [identity.id, identity]));
23
+ },
24
+ (identityId, identities) => identities[identityId]
25
+ );
26
+ const createTargetIdentityPermissionTarget = async (db, identity) => ({
27
+ id: identity.id,
28
+ globalRoles: identity.roles,
29
+ hasProjectMemberships: identity.roles.includes(Roles.TenantRole.SUPER_ADMIN) || identity.roles.includes(Roles.TenantRole.PROJECT_ADMIN) || await db.batchLoad(projectMembershipPresenceLoader, identity.id)
30
+ });
31
+ const createPersonPermissionTarget = async (db, person) => person === null ? null : await createTargetIdentityPermissionTarget(db, { id: person.identity_id, roles: person.roles });
32
+ exports.createPersonPermissionTarget = createPersonPermissionTarget;
33
+ exports.createTargetIdentityPermissionTarget = createTargetIdentityPermissionTarget;
34
+ exports.targetIdentityLoader = targetIdentityLoader;
35
+ //# sourceMappingURL=TargetIdentityPermission.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TargetIdentityPermission.cjs","sources":["../../../../../../packages/engine-tenant-api/src/model/authorization/TargetIdentityPermission.ts"],"sourcesContent":["import { DatabaseContext } from '../utils/index.js'\nimport { IdentityHasProjectMembershipsQuery, IdentityQuery, IdentityQueryResult } from '../queries/index.js'\nimport { TargetIdentityPermissionTarget } from './PermissionActions.js'\nimport { TenantRole } from './Roles.js'\nimport { batchLoader } from '../../utils/batchQuery.js'\n\nconst projectMembershipPresenceLoader = batchLoader<string, ReadonlySet<string>, boolean>(\n\tasync (identityIds, db) => await db.queryHandler.fetch(new IdentityHasProjectMembershipsQuery(identityIds)),\n\t(identityId, identitiesWithMemberships) => identitiesWithMemberships.has(identityId),\n)\n\n/** Batches the identity lookup that precedes a target-identity permission check. */\nexport const targetIdentityLoader = batchLoader<string, Record<string, IdentityQueryResult>, IdentityQueryResult | undefined>(\n\tasync (identityIds, db) => {\n\t\tconst identities = await db.queryHandler.fetch(new IdentityQuery(identityIds))\n\t\treturn Object.fromEntries(identities.map(identity => [identity.id, identity]))\n\t},\n\t(identityId, identities) => identities[identityId],\n)\n\nexport const createTargetIdentityPermissionTarget = async (\n\tdb: DatabaseContext,\n\tidentity: { readonly id: string; readonly roles: readonly string[] },\n): Promise<TargetIdentityPermissionTarget> => ({\n\tid: identity.id,\n\tglobalRoles: identity.roles,\n\thasProjectMemberships: identity.roles.includes(TenantRole.SUPER_ADMIN)\n\t\t|| identity.roles.includes(TenantRole.PROJECT_ADMIN)\n\t\t|| await db.batchLoad(projectMembershipPresenceLoader, identity.id),\n})\n\n/** Convenience for the common case where the caller already holds the target's person row. */\nexport const createPersonPermissionTarget = async (\n\tdb: DatabaseContext,\n\tperson: { readonly identity_id: string; readonly roles: readonly string[] } | null,\n): Promise<TargetIdentityPermissionTarget | null> =>\n\tperson === null ? null : await createTargetIdentityPermissionTarget(db, { id: person.identity_id, roles: person.roles })\n"],"names":["batchLoader","IdentityHasProjectMembershipsQuery","IdentityQuery","TenantRole"],"mappings":";;;;;;;;;;;;;;AAMA,MAAM,kCAAkCA,WAAAA;AAAAA,EACvC,OAAO,aAAa,OAAO,MAAM,GAAG,aAAa,MAAM,IAAIC,sEAAmC,WAAW,CAAC;AAAA,EAC1G,CAAC,YAAY,8BAA8B,0BAA0B,IAAI,UAAU;AACpF;AAGO,MAAM,uBAAuBD,WAAAA;AAAAA,EACnC,OAAO,aAAa,OAAO;AAC1B,UAAM,aAAa,MAAM,GAAG,aAAa,MAAM,IAAIE,cAAAA,cAAc,WAAW,CAAC;AAC7E,WAAO,OAAO,YAAY,WAAW,IAAI,CAAA,aAAY,CAAC,SAAS,IAAI,QAAQ,CAAC,CAAC;AAAA,EAC9E;AAAA,EACA,CAAC,YAAY,eAAe,WAAW,UAAU;AAClD;AAEO,MAAM,uCAAuC,OACnD,IACA,cAC8C;AAAA,EAC9C,IAAI,SAAS;AAAA,EACb,aAAa,SAAS;AAAA,EACtB,uBAAuB,SAAS,MAAM,SAASC,MAAAA,WAAW,WAAW,KACjE,SAAS,MAAM,SAASA,MAAAA,WAAW,aAAa,KAChD,MAAM,GAAG,UAAU,iCAAiC,SAAS,EAAE;AACpE;AAGO,MAAM,+BAA+B,OAC3C,IACA,WAEA,WAAW,OAAO,OAAO,MAAM,qCAAqC,IAAI,EAAE,IAAI,OAAO,aAAa,OAAO,OAAO,OAAO;;;;"}
@@ -0,0 +1,35 @@
1
+ import "../queries/apiKey/ApiKeyQuery.js";
2
+ import "@contember/database";
3
+ import "../type/ApiKey.js";
4
+ import { IdentityHasProjectMembershipsQuery } from "../queries/membership/IdentityHasProjectMembershipsQuery.js";
5
+ import { IdentityQuery } from "../queries/identity/IdentityQuery.js";
6
+ import "./PermissionActions.js";
7
+ import "@contember/authorization";
8
+ import { TenantRole } from "./Roles.js";
9
+ import "./CustomRolePermissions.js";
10
+ import "./PermissionContext.js";
11
+ import "@contember/schema";
12
+ import { batchLoader } from "../../utils/batchQuery.js";
13
+ const projectMembershipPresenceLoader = batchLoader(
14
+ async (identityIds, db) => await db.queryHandler.fetch(new IdentityHasProjectMembershipsQuery(identityIds)),
15
+ (identityId, identitiesWithMemberships) => identitiesWithMemberships.has(identityId)
16
+ );
17
+ const targetIdentityLoader = batchLoader(
18
+ async (identityIds, db) => {
19
+ const identities = await db.queryHandler.fetch(new IdentityQuery(identityIds));
20
+ return Object.fromEntries(identities.map((identity) => [identity.id, identity]));
21
+ },
22
+ (identityId, identities) => identities[identityId]
23
+ );
24
+ const createTargetIdentityPermissionTarget = async (db, identity) => ({
25
+ id: identity.id,
26
+ globalRoles: identity.roles,
27
+ hasProjectMemberships: identity.roles.includes(TenantRole.SUPER_ADMIN) || identity.roles.includes(TenantRole.PROJECT_ADMIN) || await db.batchLoad(projectMembershipPresenceLoader, identity.id)
28
+ });
29
+ const createPersonPermissionTarget = async (db, person) => person === null ? null : await createTargetIdentityPermissionTarget(db, { id: person.identity_id, roles: person.roles });
30
+ export {
31
+ createPersonPermissionTarget,
32
+ createTargetIdentityPermissionTarget,
33
+ targetIdentityLoader
34
+ };
35
+ //# sourceMappingURL=TargetIdentityPermission.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TargetIdentityPermission.js","sources":["../../../../../../packages/engine-tenant-api/src/model/authorization/TargetIdentityPermission.ts"],"sourcesContent":["import { DatabaseContext } from '../utils/index.js'\nimport { IdentityHasProjectMembershipsQuery, IdentityQuery, IdentityQueryResult } from '../queries/index.js'\nimport { TargetIdentityPermissionTarget } from './PermissionActions.js'\nimport { TenantRole } from './Roles.js'\nimport { batchLoader } from '../../utils/batchQuery.js'\n\nconst projectMembershipPresenceLoader = batchLoader<string, ReadonlySet<string>, boolean>(\n\tasync (identityIds, db) => await db.queryHandler.fetch(new IdentityHasProjectMembershipsQuery(identityIds)),\n\t(identityId, identitiesWithMemberships) => identitiesWithMemberships.has(identityId),\n)\n\n/** Batches the identity lookup that precedes a target-identity permission check. */\nexport const targetIdentityLoader = batchLoader<string, Record<string, IdentityQueryResult>, IdentityQueryResult | undefined>(\n\tasync (identityIds, db) => {\n\t\tconst identities = await db.queryHandler.fetch(new IdentityQuery(identityIds))\n\t\treturn Object.fromEntries(identities.map(identity => [identity.id, identity]))\n\t},\n\t(identityId, identities) => identities[identityId],\n)\n\nexport const createTargetIdentityPermissionTarget = async (\n\tdb: DatabaseContext,\n\tidentity: { readonly id: string; readonly roles: readonly string[] },\n): Promise<TargetIdentityPermissionTarget> => ({\n\tid: identity.id,\n\tglobalRoles: identity.roles,\n\thasProjectMemberships: identity.roles.includes(TenantRole.SUPER_ADMIN)\n\t\t|| identity.roles.includes(TenantRole.PROJECT_ADMIN)\n\t\t|| await db.batchLoad(projectMembershipPresenceLoader, identity.id),\n})\n\n/** Convenience for the common case where the caller already holds the target's person row. */\nexport const createPersonPermissionTarget = async (\n\tdb: DatabaseContext,\n\tperson: { readonly identity_id: string; readonly roles: readonly string[] } | null,\n): Promise<TargetIdentityPermissionTarget | null> =>\n\tperson === null ? null : await createTargetIdentityPermissionTarget(db, { id: person.identity_id, roles: person.roles })\n"],"names":[],"mappings":";;;;;;;;;;;;AAMA,MAAM,kCAAkC;AAAA,EACvC,OAAO,aAAa,OAAO,MAAM,GAAG,aAAa,MAAM,IAAI,mCAAmC,WAAW,CAAC;AAAA,EAC1G,CAAC,YAAY,8BAA8B,0BAA0B,IAAI,UAAU;AACpF;AAGO,MAAM,uBAAuB;AAAA,EACnC,OAAO,aAAa,OAAO;AAC1B,UAAM,aAAa,MAAM,GAAG,aAAa,MAAM,IAAI,cAAc,WAAW,CAAC;AAC7E,WAAO,OAAO,YAAY,WAAW,IAAI,CAAA,aAAY,CAAC,SAAS,IAAI,QAAQ,CAAC,CAAC;AAAA,EAC9E;AAAA,EACA,CAAC,YAAY,eAAe,WAAW,UAAU;AAClD;AAEO,MAAM,uCAAuC,OACnD,IACA,cAC8C;AAAA,EAC9C,IAAI,SAAS;AAAA,EACb,aAAa,SAAS;AAAA,EACtB,uBAAuB,SAAS,MAAM,SAAS,WAAW,WAAW,KACjE,SAAS,MAAM,SAAS,WAAW,aAAa,KAChD,MAAM,GAAG,UAAU,iCAAiC,SAAS,EAAE;AACpE;AAGO,MAAM,+BAA+B,OAC3C,IACA,WAEA,WAAW,OAAO,OAAO,MAAM,qCAAqC,IAAI,EAAE,IAAI,OAAO,aAAa,OAAO,OAAO,OAAO;"}
@@ -2,8 +2,14 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const ApiKey = require("../../type/ApiKey.cjs");
4
4
  const time = require("../../utils/time.cjs");
5
+ const Database = require("@contember/database");
5
6
  const DEFAULT_EXPIRATION = 30;
6
7
  class ApiKeyHelper {
8
+ /**
9
+ * App-clock expiry Date. Kept only for ProlongApiKeyCommand's significance
10
+ * throttle (a write-rate optimization, not an auth gate). The value actually
11
+ * stored / compared runs on the DB clock — see {@link getExpirationLiteral}.
12
+ */
7
13
  static getExpiration(providers, type, expiration) {
8
14
  switch (type) {
9
15
  case ApiKey.ApiKey.Type.PERMANENT:
@@ -14,6 +20,19 @@ class ApiKeyHelper {
14
20
  return null;
15
21
  }
16
22
  }
23
+ /** Lifetime of a session key in seconds (`expiration` minutes, default 30). */
24
+ static getSessionExpirationSeconds(expiration) {
25
+ return (expiration || DEFAULT_EXPIRATION) * 60;
26
+ }
27
+ /**
28
+ * DB-clock expiry expression for issuance: `now() + <lifetime>` evaluated on the
29
+ * database clock, so the expiry gate (ApiKeyByTokenQuery's `is_expired`) compares
30
+ * against the same clock and cannot be weakened by app/DB skew. NULL for
31
+ * non-session keys (they never expire). See engine-tenant-api/CLAUDE.md.
32
+ */
33
+ static getExpirationLiteral(type, expiration) {
34
+ return type === ApiKey.ApiKey.Type.SESSION ? new Database.Literal("now() + make_interval(secs => ?)", [ApiKeyHelper.getSessionExpirationSeconds(expiration)]) : null;
35
+ }
17
36
  }
18
37
  exports.ApiKeyHelper = ApiKeyHelper;
19
38
  //# sourceMappingURL=ApiKeyHelper.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ApiKeyHelper.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/ApiKeyHelper.ts"],"sourcesContent":["import { ApiKey } from '../../type/index.js'\nimport { Providers } from '../../providers.js'\nimport { plusMinutes } from '../../utils/time.js'\n\nconst DEFAULT_EXPIRATION = 30\nexport class ApiKeyHelper {\n\tpublic static getExpiration(providers: Providers, type: ApiKey.Type, expiration?: number | null): Date | null {\n\t\tswitch (type) {\n\t\t\tcase ApiKey.Type.PERMANENT:\n\t\t\t\treturn null\n\n\t\t\tcase ApiKey.Type.SESSION:\n\t\t\t\treturn plusMinutes(providers.now(), expiration || DEFAULT_EXPIRATION)\n\n\t\t\tcase ApiKey.Type.ONE_OFF:\n\t\t\t\treturn null\n\t\t}\n\t}\n}\n"],"names":["ApiKey","plusMinutes"],"mappings":";;;;AAIA,MAAM,qBAAqB;AACpB,MAAM,aAAa;AAAA,EACzB,OAAc,cAAc,WAAsB,MAAmB,YAAyC;AAC7G,YAAQ,MAAA;AAAA,MACP,KAAKA,OAAAA,OAAO,KAAK;AAChB,eAAO;AAAA,MAER,KAAKA,OAAAA,OAAO,KAAK;AAChB,eAAOC,KAAAA,YAAY,UAAU,IAAA,GAAO,cAAc,kBAAkB;AAAA,MAErE,KAAKD,OAAAA,OAAO,KAAK;AAChB,eAAO;AAAA,IAAA;AAAA,EAEV;AACD;;"}
1
+ {"version":3,"file":"ApiKeyHelper.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/ApiKeyHelper.ts"],"sourcesContent":["import { ApiKey } from '../../type/index.js'\nimport { Providers } from '../../providers.js'\nimport { plusMinutes } from '../../utils/time.js'\nimport { Literal } from '@contember/database'\n\nconst DEFAULT_EXPIRATION = 30\nexport class ApiKeyHelper {\n\t/**\n\t * App-clock expiry Date. Kept only for ProlongApiKeyCommand's significance\n\t * throttle (a write-rate optimization, not an auth gate). The value actually\n\t * stored / compared runs on the DB clock — see {@link getExpirationLiteral}.\n\t */\n\tpublic static getExpiration(providers: Providers, type: ApiKey.Type, expiration?: number | null): Date | null {\n\t\tswitch (type) {\n\t\t\tcase ApiKey.Type.PERMANENT:\n\t\t\t\treturn null\n\n\t\t\tcase ApiKey.Type.SESSION:\n\t\t\t\treturn plusMinutes(providers.now(), expiration || DEFAULT_EXPIRATION)\n\n\t\t\tcase ApiKey.Type.ONE_OFF:\n\t\t\t\treturn null\n\t\t}\n\t}\n\n\t/** Lifetime of a session key in seconds (`expiration` minutes, default 30). */\n\tpublic static getSessionExpirationSeconds(expiration?: number | null): number {\n\t\treturn (expiration || DEFAULT_EXPIRATION) * 60\n\t}\n\n\t/**\n\t * DB-clock expiry expression for issuance: `now() + <lifetime>` evaluated on the\n\t * database clock, so the expiry gate (ApiKeyByTokenQuery's `is_expired`) compares\n\t * against the same clock and cannot be weakened by app/DB skew. NULL for\n\t * non-session keys (they never expire). See engine-tenant-api/CLAUDE.md.\n\t */\n\tpublic static getExpirationLiteral(type: ApiKey.Type, expiration?: number | null): Literal | null {\n\t\treturn type === ApiKey.Type.SESSION\n\t\t\t? new Literal('now() + make_interval(secs => ?)', [ApiKeyHelper.getSessionExpirationSeconds(expiration)])\n\t\t\t: null\n\t}\n}\n"],"names":["ApiKey","plusMinutes","Literal"],"mappings":";;;;;AAKA,MAAM,qBAAqB;AACpB,MAAM,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMzB,OAAc,cAAc,WAAsB,MAAmB,YAAyC;AAC7G,YAAQ,MAAA;AAAA,MACP,KAAKA,OAAAA,OAAO,KAAK;AAChB,eAAO;AAAA,MAER,KAAKA,OAAAA,OAAO,KAAK;AAChB,eAAOC,KAAAA,YAAY,UAAU,IAAA,GAAO,cAAc,kBAAkB;AAAA,MAErE,KAAKD,OAAAA,OAAO,KAAK;AAChB,eAAO;AAAA,IAAA;AAAA,EAEV;AAAA;AAAA,EAGA,OAAc,4BAA4B,YAAoC;AAC7E,YAAQ,cAAc,sBAAsB;AAAA,EAC7C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,OAAc,qBAAqB,MAAmB,YAA4C;AACjG,WAAO,SAASA,OAAAA,OAAO,KAAK,UACzB,IAAIE,SAAAA,QAAQ,oCAAoC,CAAC,aAAa,4BAA4B,UAAU,CAAC,CAAC,IACtG;AAAA,EACJ;AACD;;"}
@@ -1,7 +1,13 @@
1
1
  import { ApiKey } from "../../type/ApiKey.js";
2
2
  import { plusMinutes } from "../../utils/time.js";
3
+ import { Literal } from "@contember/database";
3
4
  const DEFAULT_EXPIRATION = 30;
4
5
  class ApiKeyHelper {
6
+ /**
7
+ * App-clock expiry Date. Kept only for ProlongApiKeyCommand's significance
8
+ * throttle (a write-rate optimization, not an auth gate). The value actually
9
+ * stored / compared runs on the DB clock — see {@link getExpirationLiteral}.
10
+ */
5
11
  static getExpiration(providers, type, expiration) {
6
12
  switch (type) {
7
13
  case ApiKey.Type.PERMANENT:
@@ -12,6 +18,19 @@ class ApiKeyHelper {
12
18
  return null;
13
19
  }
14
20
  }
21
+ /** Lifetime of a session key in seconds (`expiration` minutes, default 30). */
22
+ static getSessionExpirationSeconds(expiration) {
23
+ return (expiration || DEFAULT_EXPIRATION) * 60;
24
+ }
25
+ /**
26
+ * DB-clock expiry expression for issuance: `now() + <lifetime>` evaluated on the
27
+ * database clock, so the expiry gate (ApiKeyByTokenQuery's `is_expired`) compares
28
+ * against the same clock and cannot be weakened by app/DB skew. NULL for
29
+ * non-session keys (they never expire). See engine-tenant-api/CLAUDE.md.
30
+ */
31
+ static getExpirationLiteral(type, expiration) {
32
+ return type === ApiKey.Type.SESSION ? new Literal("now() + make_interval(secs => ?)", [ApiKeyHelper.getSessionExpirationSeconds(expiration)]) : null;
33
+ }
15
34
  }
16
35
  export {
17
36
  ApiKeyHelper
@@ -1 +1 @@
1
- {"version":3,"file":"ApiKeyHelper.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/ApiKeyHelper.ts"],"sourcesContent":["import { ApiKey } from '../../type/index.js'\nimport { Providers } from '../../providers.js'\nimport { plusMinutes } from '../../utils/time.js'\n\nconst DEFAULT_EXPIRATION = 30\nexport class ApiKeyHelper {\n\tpublic static getExpiration(providers: Providers, type: ApiKey.Type, expiration?: number | null): Date | null {\n\t\tswitch (type) {\n\t\t\tcase ApiKey.Type.PERMANENT:\n\t\t\t\treturn null\n\n\t\t\tcase ApiKey.Type.SESSION:\n\t\t\t\treturn plusMinutes(providers.now(), expiration || DEFAULT_EXPIRATION)\n\n\t\t\tcase ApiKey.Type.ONE_OFF:\n\t\t\t\treturn null\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAIA,MAAM,qBAAqB;AACpB,MAAM,aAAa;AAAA,EACzB,OAAc,cAAc,WAAsB,MAAmB,YAAyC;AAC7G,YAAQ,MAAA;AAAA,MACP,KAAK,OAAO,KAAK;AAChB,eAAO;AAAA,MAER,KAAK,OAAO,KAAK;AAChB,eAAO,YAAY,UAAU,IAAA,GAAO,cAAc,kBAAkB;AAAA,MAErE,KAAK,OAAO,KAAK;AAChB,eAAO;AAAA,IAAA;AAAA,EAEV;AACD;"}
1
+ {"version":3,"file":"ApiKeyHelper.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/ApiKeyHelper.ts"],"sourcesContent":["import { ApiKey } from '../../type/index.js'\nimport { Providers } from '../../providers.js'\nimport { plusMinutes } from '../../utils/time.js'\nimport { Literal } from '@contember/database'\n\nconst DEFAULT_EXPIRATION = 30\nexport class ApiKeyHelper {\n\t/**\n\t * App-clock expiry Date. Kept only for ProlongApiKeyCommand's significance\n\t * throttle (a write-rate optimization, not an auth gate). The value actually\n\t * stored / compared runs on the DB clock — see {@link getExpirationLiteral}.\n\t */\n\tpublic static getExpiration(providers: Providers, type: ApiKey.Type, expiration?: number | null): Date | null {\n\t\tswitch (type) {\n\t\t\tcase ApiKey.Type.PERMANENT:\n\t\t\t\treturn null\n\n\t\t\tcase ApiKey.Type.SESSION:\n\t\t\t\treturn plusMinutes(providers.now(), expiration || DEFAULT_EXPIRATION)\n\n\t\t\tcase ApiKey.Type.ONE_OFF:\n\t\t\t\treturn null\n\t\t}\n\t}\n\n\t/** Lifetime of a session key in seconds (`expiration` minutes, default 30). */\n\tpublic static getSessionExpirationSeconds(expiration?: number | null): number {\n\t\treturn (expiration || DEFAULT_EXPIRATION) * 60\n\t}\n\n\t/**\n\t * DB-clock expiry expression for issuance: `now() + <lifetime>` evaluated on the\n\t * database clock, so the expiry gate (ApiKeyByTokenQuery's `is_expired`) compares\n\t * against the same clock and cannot be weakened by app/DB skew. NULL for\n\t * non-session keys (they never expire). See engine-tenant-api/CLAUDE.md.\n\t */\n\tpublic static getExpirationLiteral(type: ApiKey.Type, expiration?: number | null): Literal | null {\n\t\treturn type === ApiKey.Type.SESSION\n\t\t\t? new Literal('now() + make_interval(secs => ?)', [ApiKeyHelper.getSessionExpirationSeconds(expiration)])\n\t\t\t: null\n\t}\n}\n"],"names":[],"mappings":";;;AAKA,MAAM,qBAAqB;AACpB,MAAM,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMzB,OAAc,cAAc,WAAsB,MAAmB,YAAyC;AAC7G,YAAQ,MAAA;AAAA,MACP,KAAK,OAAO,KAAK;AAChB,eAAO;AAAA,MAER,KAAK,OAAO,KAAK;AAChB,eAAO,YAAY,UAAU,IAAA,GAAO,cAAc,kBAAkB;AAAA,MAErE,KAAK,OAAO,KAAK;AAChB,eAAO;AAAA,IAAA;AAAA,EAEV;AAAA;AAAA,EAGA,OAAc,4BAA4B,YAAoC;AAC7E,YAAQ,cAAc,sBAAsB;AAAA,EAC7C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,OAAc,qBAAqB,MAAmB,YAA4C;AACjG,WAAO,SAAS,OAAO,KAAK,UACzB,IAAI,QAAQ,oCAAoC,CAAC,aAAa,4BAA4B,UAAU,CAAC,CAAC,IACtG;AAAA,EACJ;AACD;"}
@@ -19,8 +19,9 @@ class CreateApiKeyCommand {
19
19
  const args = this.args;
20
20
  const sessionPolicy = args.type === ApiKey.ApiKey.Type.SESSION ? {
21
21
  issued_at: providers.now(),
22
+ // display/ordering only, never compared
22
23
  idle_timeout: args.idleTimeout ?? null,
23
- max_expires_at: args.maxExpiresAt ?? null
24
+ max_expires_at: args.maxExpirationSeconds != null ? new Database.Literal("now() + make_interval(secs => ?)", [args.maxExpirationSeconds]) : null
24
25
  } : { issued_at: null, idle_timeout: null, max_expires_at: null };
25
26
  await Database.InsertBuilder.create().into("api_key").values({
26
27
  id: apiKeyId,
@@ -28,7 +29,8 @@ class CreateApiKeyCommand {
28
29
  type: this.args.type,
29
30
  identity_id: this.args.identityId,
30
31
  disabled_at: null,
31
- expires_at: ApiKeyHelper.ApiKeyHelper.getExpiration(providers, this.args.type, this.args.expiration),
32
+ // expires_at on the DB clock so the verify gate compares like-for-like.
33
+ expires_at: ApiKeyHelper.ApiKeyHelper.getExpirationLiteral(this.args.type, this.args.expiration),
32
34
  expiration: this.args.expiration || null,
33
35
  created_at: providers.now(),
34
36
  created_ip: this.args.requestInfo?.ip || null,
@@ -1 +1 @@
1
- {"version":3,"file":"CreateApiKeyCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/CreateApiKeyCommand.ts"],"sourcesContent":["import { Command } from '../Command.js'\nimport { ApiKey } from '../../type/index.js'\nimport { ApiKeyHelper } from './ApiKeyHelper.js'\nimport { InsertBuilder } from '@contember/database'\nimport { computeTokenHash, generateToken, TokenHash } from '../../utils/index.js'\nimport { ApiKeyRequestInfo } from './ProlongApiKeyCommand.js'\n\ninterface CreateSessionApiKeyArgs {\n\ttype: ApiKey.Type.SESSION\n\tidentityId: string\n\texpiration?: number\n\ttokenHash?: string\n\trequestInfo?: ApiKeyRequestInfo\n\ttrustForwardedInfo?: boolean\n\t/**\n\t * A19 session-policy snapshot, fixed at sign-in. NULLs preserve today's\n\t * behavior (no idle timeout, no absolute cap on the sliding window).\n\t * `idleTimeout` is a Postgres interval literal (e.g. `'15 minutes'`).\n\t */\n\tidleTimeout?: string | null\n\tmaxExpiresAt?: Date | null\n}\n\ninterface CreatePermanentApiKeyArgs {\n\ttype: ApiKey.Type.PERMANENT\n\tidentityId: string\n\ttokenHash?: TokenHash\n\texpiration?: undefined\n\trequestInfo?: ApiKeyRequestInfo\n\ttrustForwardedInfo?: boolean\n}\n\nexport type CreateApiKeyArgs =\n\t| CreateSessionApiKeyArgs\n\t| CreatePermanentApiKeyArgs\n\nexport class CreateApiKeyCommand implements Command<CreateApiKeyCommandResult> {\n\tconstructor(private args: CreateApiKeyArgs) {}\n\n\tasync execute({ db, providers }: Command.Args): Promise<CreateApiKeyCommandResult> {\n\t\tconst apiKeyId = providers.uuid()\n\t\tlet token\n\t\tlet tokenHash = this.args.tokenHash\n\t\tif (!tokenHash) {\n\t\t\ttoken = await generateToken(providers)\n\t\t\ttokenHash = computeTokenHash(token)\n\t\t}\n\n\t\t// Session-policy snapshot (A19). Only session keys carry it; permanent/one-off\n\t\t// keys have no session policy → NULL (preserving today's behavior).\n\t\tconst args = this.args\n\t\tconst sessionPolicy = args.type === ApiKey.Type.SESSION\n\t\t\t? {\n\t\t\t\tissued_at: providers.now(),\n\t\t\t\tidle_timeout: args.idleTimeout ?? null,\n\t\t\t\tmax_expires_at: args.maxExpiresAt ?? null,\n\t\t\t}\n\t\t\t: { issued_at: null, idle_timeout: null, max_expires_at: null }\n\t\tawait InsertBuilder.create()\n\t\t\t.into('api_key')\n\t\t\t.values({\n\t\t\t\tid: apiKeyId,\n\t\t\t\ttoken_hash: tokenHash,\n\t\t\t\ttype: this.args.type,\n\t\t\t\tidentity_id: this.args.identityId,\n\t\t\t\tdisabled_at: null,\n\t\t\t\texpires_at: ApiKeyHelper.getExpiration(providers, this.args.type, this.args.expiration),\n\t\t\t\texpiration: this.args.expiration || null,\n\t\t\t\tcreated_at: providers.now(),\n\t\t\t\tcreated_ip: this.args.requestInfo?.ip || null,\n\t\t\t\tcreated_user_agent: this.args.requestInfo?.userAgent || null,\n\t\t\t\ttrust_forwarded_info: this.args.trustForwardedInfo ?? false,\n\t\t\t\tissued_at: sessionPolicy.issued_at,\n\t\t\t\tidle_timeout: sessionPolicy.idle_timeout,\n\t\t\t\tmax_expires_at: sessionPolicy.max_expires_at,\n\t\t\t})\n\t\t\t.execute(db)\n\n\t\treturn new CreateApiKeyCommandResult(apiKeyId, token)\n\t}\n}\n\nexport class CreateApiKeyCommandResult {\n\tconstructor(public readonly id: string, public readonly token?: string) {\n\t}\n}\n"],"names":["token","generateToken","computeTokenHash","ApiKey","InsertBuilder","ApiKeyHelper"],"mappings":";;;;;;AAoCO,MAAM,oBAAkE;AAAA,EAC9E,YAAoB,MAAwB;AAAxB,SAAA,OAAA;AAAA,EAAyB;AAAA,EAE7C,MAAM,QAAQ,EAAE,IAAI,aAA+D;AAClF,UAAM,WAAW,UAAU,KAAA;AAC3B,QAAIA;AACJ,QAAI,YAAY,KAAK,KAAK;AAC1B,QAAI,CAAC,WAAW;AACfA,gBAAQ,MAAMC,MAAAA,cAAc,SAAS;AACrC,kBAAYC,MAAAA,iBAAiBF,OAAK;AAAA,IACnC;AAIA,UAAM,OAAO,KAAK;AAClB,UAAM,gBAAgB,KAAK,SAASG,OAAAA,OAAO,KAAK,UAC7C;AAAA,MACD,WAAW,UAAU,IAAA;AAAA,MACrB,cAAc,KAAK,eAAe;AAAA,MAClC,gBAAgB,KAAK,gBAAgB;AAAA,IAAA,IAEpC,EAAE,WAAW,MAAM,cAAc,MAAM,gBAAgB,KAAA;AAC1D,UAAMC,SAAAA,cAAc,OAAA,EAClB,KAAK,SAAS,EACd,OAAO;AAAA,MACP,IAAI;AAAA,MACJ,YAAY;AAAA,MACZ,MAAM,KAAK,KAAK;AAAA,MAChB,aAAa,KAAK,KAAK;AAAA,MACvB,aAAa;AAAA,MACb,YAAYC,aAAAA,aAAa,cAAc,WAAW,KAAK,KAAK,MAAM,KAAK,KAAK,UAAU;AAAA,MACtF,YAAY,KAAK,KAAK,cAAc;AAAA,MACpC,YAAY,UAAU,IAAA;AAAA,MACtB,YAAY,KAAK,KAAK,aAAa,MAAM;AAAA,MACzC,oBAAoB,KAAK,KAAK,aAAa,aAAa;AAAA,MACxD,sBAAsB,KAAK,KAAK,sBAAsB;AAAA,MACtD,WAAW,cAAc;AAAA,MACzB,cAAc,cAAc;AAAA,MAC5B,gBAAgB,cAAc;AAAA,IAAA,CAC9B,EACA,QAAQ,EAAE;AAEZ,WAAO,IAAI,0BAA0B,UAAUL,OAAK;AAAA,EACrD;AACD;AAEO,MAAM,0BAA0B;AAAA,EACtC,YAA4B,IAA4BA,QAAgB;AAA5C,SAAA,KAAA;AAA4B,SAAA,QAAAA;AAAA,EACxD;AACD;;;"}
1
+ {"version":3,"file":"CreateApiKeyCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/CreateApiKeyCommand.ts"],"sourcesContent":["import { Command } from '../Command.js'\nimport { ApiKey } from '../../type/index.js'\nimport { ApiKeyHelper } from './ApiKeyHelper.js'\nimport { InsertBuilder, Literal } from '@contember/database'\nimport { computeTokenHash, generateToken, TokenHash } from '../../utils/index.js'\nimport { ApiKeyRequestInfo } from './ProlongApiKeyCommand.js'\n\ninterface CreateSessionApiKeyArgs {\n\ttype: ApiKey.Type.SESSION\n\tidentityId: string\n\texpiration?: number\n\ttokenHash?: string\n\trequestInfo?: ApiKeyRequestInfo\n\ttrustForwardedInfo?: boolean\n\t/**\n\t * A19 session-policy snapshot, fixed at sign-in. NULLs preserve today's\n\t * behavior (no idle timeout, no absolute cap on the sliding window).\n\t * `idleTimeout` is a Postgres interval literal (e.g. `'15 minutes'`).\n\t */\n\tidleTimeout?: string | null\n\t/**\n\t * Absolute lifetime cap in seconds (A19). Written as `now() + interval` on the DB\n\t * clock so the cap is compared against the same clock. NULL = uncapped.\n\t */\n\tmaxExpirationSeconds?: number | null\n}\n\ninterface CreatePermanentApiKeyArgs {\n\ttype: ApiKey.Type.PERMANENT\n\tidentityId: string\n\ttokenHash?: TokenHash\n\texpiration?: undefined\n\trequestInfo?: ApiKeyRequestInfo\n\ttrustForwardedInfo?: boolean\n}\n\nexport type CreateApiKeyArgs =\n\t| CreateSessionApiKeyArgs\n\t| CreatePermanentApiKeyArgs\n\nexport class CreateApiKeyCommand implements Command<CreateApiKeyCommandResult> {\n\tconstructor(private args: CreateApiKeyArgs) {}\n\n\tasync execute({ db, providers }: Command.Args): Promise<CreateApiKeyCommandResult> {\n\t\tconst apiKeyId = providers.uuid()\n\t\tlet token\n\t\tlet tokenHash = this.args.tokenHash\n\t\tif (!tokenHash) {\n\t\t\ttoken = await generateToken(providers)\n\t\t\ttokenHash = computeTokenHash(token)\n\t\t}\n\n\t\t// Session-policy snapshot (A19). Only session keys carry it; permanent/one-off\n\t\t// keys have no session policy → NULL (preserving today's behavior).\n\t\tconst args = this.args\n\t\tconst sessionPolicy = args.type === ApiKey.Type.SESSION\n\t\t\t? {\n\t\t\t\tissued_at: providers.now(), // display/ordering only, never compared\n\t\t\t\tidle_timeout: args.idleTimeout ?? null,\n\t\t\t\tmax_expires_at: args.maxExpirationSeconds != null\n\t\t\t\t\t? new Literal('now() + make_interval(secs => ?)', [args.maxExpirationSeconds])\n\t\t\t\t\t: null,\n\t\t\t}\n\t\t\t: { issued_at: null, idle_timeout: null, max_expires_at: null }\n\t\tawait InsertBuilder.create()\n\t\t\t.into('api_key')\n\t\t\t.values({\n\t\t\t\tid: apiKeyId,\n\t\t\t\ttoken_hash: tokenHash,\n\t\t\t\ttype: this.args.type,\n\t\t\t\tidentity_id: this.args.identityId,\n\t\t\t\tdisabled_at: null,\n\t\t\t\t// expires_at on the DB clock so the verify gate compares like-for-like.\n\t\t\t\texpires_at: ApiKeyHelper.getExpirationLiteral(this.args.type, this.args.expiration),\n\t\t\t\texpiration: this.args.expiration || null,\n\t\t\t\tcreated_at: providers.now(),\n\t\t\t\tcreated_ip: this.args.requestInfo?.ip || null,\n\t\t\t\tcreated_user_agent: this.args.requestInfo?.userAgent || null,\n\t\t\t\ttrust_forwarded_info: this.args.trustForwardedInfo ?? false,\n\t\t\t\tissued_at: sessionPolicy.issued_at,\n\t\t\t\tidle_timeout: sessionPolicy.idle_timeout,\n\t\t\t\tmax_expires_at: sessionPolicy.max_expires_at,\n\t\t\t})\n\t\t\t.execute(db)\n\n\t\treturn new CreateApiKeyCommandResult(apiKeyId, token)\n\t}\n}\n\nexport class CreateApiKeyCommandResult {\n\tconstructor(public readonly id: string, public readonly token?: string) {\n\t}\n}\n"],"names":["token","generateToken","computeTokenHash","ApiKey","Literal","InsertBuilder","ApiKeyHelper"],"mappings":";;;;;;AAwCO,MAAM,oBAAkE;AAAA,EAC9E,YAAoB,MAAwB;AAAxB,SAAA,OAAA;AAAA,EAAyB;AAAA,EAE7C,MAAM,QAAQ,EAAE,IAAI,aAA+D;AAClF,UAAM,WAAW,UAAU,KAAA;AAC3B,QAAIA;AACJ,QAAI,YAAY,KAAK,KAAK;AAC1B,QAAI,CAAC,WAAW;AACfA,gBAAQ,MAAMC,MAAAA,cAAc,SAAS;AACrC,kBAAYC,MAAAA,iBAAiBF,OAAK;AAAA,IACnC;AAIA,UAAM,OAAO,KAAK;AAClB,UAAM,gBAAgB,KAAK,SAASG,OAAAA,OAAO,KAAK,UAC7C;AAAA,MACD,WAAW,UAAU,IAAA;AAAA;AAAA,MACrB,cAAc,KAAK,eAAe;AAAA,MAClC,gBAAgB,KAAK,wBAAwB,OAC1C,IAAIC,iBAAQ,oCAAoC,CAAC,KAAK,oBAAoB,CAAC,IAC3E;AAAA,IAAA,IAEF,EAAE,WAAW,MAAM,cAAc,MAAM,gBAAgB,KAAA;AAC1D,UAAMC,SAAAA,cAAc,OAAA,EAClB,KAAK,SAAS,EACd,OAAO;AAAA,MACP,IAAI;AAAA,MACJ,YAAY;AAAA,MACZ,MAAM,KAAK,KAAK;AAAA,MAChB,aAAa,KAAK,KAAK;AAAA,MACvB,aAAa;AAAA;AAAA,MAEb,YAAYC,aAAAA,aAAa,qBAAqB,KAAK,KAAK,MAAM,KAAK,KAAK,UAAU;AAAA,MAClF,YAAY,KAAK,KAAK,cAAc;AAAA,MACpC,YAAY,UAAU,IAAA;AAAA,MACtB,YAAY,KAAK,KAAK,aAAa,MAAM;AAAA,MACzC,oBAAoB,KAAK,KAAK,aAAa,aAAa;AAAA,MACxD,sBAAsB,KAAK,KAAK,sBAAsB;AAAA,MACtD,WAAW,cAAc;AAAA,MACzB,cAAc,cAAc;AAAA,MAC5B,gBAAgB,cAAc;AAAA,IAAA,CAC9B,EACA,QAAQ,EAAE;AAEZ,WAAO,IAAI,0BAA0B,UAAUN,OAAK;AAAA,EACrD;AACD;AAEO,MAAM,0BAA0B;AAAA,EACtC,YAA4B,IAA4BA,QAAgB;AAA5C,SAAA,KAAA;AAA4B,SAAA,QAAAA;AAAA,EACxD;AACD;;;"}
@@ -1,6 +1,6 @@
1
1
  import { ApiKey } from "../../type/ApiKey.js";
2
2
  import { ApiKeyHelper } from "./ApiKeyHelper.js";
3
- import { InsertBuilder as InsertBuilder$1 } from "@contember/database";
3
+ import { Literal, InsertBuilder as InsertBuilder$1 } from "@contember/database";
4
4
  import { generateToken, computeTokenHash } from "../../utils/token.js";
5
5
  class CreateApiKeyCommand {
6
6
  constructor(args) {
@@ -17,8 +17,9 @@ class CreateApiKeyCommand {
17
17
  const args = this.args;
18
18
  const sessionPolicy = args.type === ApiKey.Type.SESSION ? {
19
19
  issued_at: providers.now(),
20
+ // display/ordering only, never compared
20
21
  idle_timeout: args.idleTimeout ?? null,
21
- max_expires_at: args.maxExpiresAt ?? null
22
+ max_expires_at: args.maxExpirationSeconds != null ? new Literal("now() + make_interval(secs => ?)", [args.maxExpirationSeconds]) : null
22
23
  } : { issued_at: null, idle_timeout: null, max_expires_at: null };
23
24
  await InsertBuilder$1.create().into("api_key").values({
24
25
  id: apiKeyId,
@@ -26,7 +27,8 @@ class CreateApiKeyCommand {
26
27
  type: this.args.type,
27
28
  identity_id: this.args.identityId,
28
29
  disabled_at: null,
29
- expires_at: ApiKeyHelper.getExpiration(providers, this.args.type, this.args.expiration),
30
+ // expires_at on the DB clock so the verify gate compares like-for-like.
31
+ expires_at: ApiKeyHelper.getExpirationLiteral(this.args.type, this.args.expiration),
30
32
  expiration: this.args.expiration || null,
31
33
  created_at: providers.now(),
32
34
  created_ip: this.args.requestInfo?.ip || null,
@@ -1 +1 @@
1
- {"version":3,"file":"CreateApiKeyCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/CreateApiKeyCommand.ts"],"sourcesContent":["import { Command } from '../Command.js'\nimport { ApiKey } from '../../type/index.js'\nimport { ApiKeyHelper } from './ApiKeyHelper.js'\nimport { InsertBuilder } from '@contember/database'\nimport { computeTokenHash, generateToken, TokenHash } from '../../utils/index.js'\nimport { ApiKeyRequestInfo } from './ProlongApiKeyCommand.js'\n\ninterface CreateSessionApiKeyArgs {\n\ttype: ApiKey.Type.SESSION\n\tidentityId: string\n\texpiration?: number\n\ttokenHash?: string\n\trequestInfo?: ApiKeyRequestInfo\n\ttrustForwardedInfo?: boolean\n\t/**\n\t * A19 session-policy snapshot, fixed at sign-in. NULLs preserve today's\n\t * behavior (no idle timeout, no absolute cap on the sliding window).\n\t * `idleTimeout` is a Postgres interval literal (e.g. `'15 minutes'`).\n\t */\n\tidleTimeout?: string | null\n\tmaxExpiresAt?: Date | null\n}\n\ninterface CreatePermanentApiKeyArgs {\n\ttype: ApiKey.Type.PERMANENT\n\tidentityId: string\n\ttokenHash?: TokenHash\n\texpiration?: undefined\n\trequestInfo?: ApiKeyRequestInfo\n\ttrustForwardedInfo?: boolean\n}\n\nexport type CreateApiKeyArgs =\n\t| CreateSessionApiKeyArgs\n\t| CreatePermanentApiKeyArgs\n\nexport class CreateApiKeyCommand implements Command<CreateApiKeyCommandResult> {\n\tconstructor(private args: CreateApiKeyArgs) {}\n\n\tasync execute({ db, providers }: Command.Args): Promise<CreateApiKeyCommandResult> {\n\t\tconst apiKeyId = providers.uuid()\n\t\tlet token\n\t\tlet tokenHash = this.args.tokenHash\n\t\tif (!tokenHash) {\n\t\t\ttoken = await generateToken(providers)\n\t\t\ttokenHash = computeTokenHash(token)\n\t\t}\n\n\t\t// Session-policy snapshot (A19). Only session keys carry it; permanent/one-off\n\t\t// keys have no session policy → NULL (preserving today's behavior).\n\t\tconst args = this.args\n\t\tconst sessionPolicy = args.type === ApiKey.Type.SESSION\n\t\t\t? {\n\t\t\t\tissued_at: providers.now(),\n\t\t\t\tidle_timeout: args.idleTimeout ?? null,\n\t\t\t\tmax_expires_at: args.maxExpiresAt ?? null,\n\t\t\t}\n\t\t\t: { issued_at: null, idle_timeout: null, max_expires_at: null }\n\t\tawait InsertBuilder.create()\n\t\t\t.into('api_key')\n\t\t\t.values({\n\t\t\t\tid: apiKeyId,\n\t\t\t\ttoken_hash: tokenHash,\n\t\t\t\ttype: this.args.type,\n\t\t\t\tidentity_id: this.args.identityId,\n\t\t\t\tdisabled_at: null,\n\t\t\t\texpires_at: ApiKeyHelper.getExpiration(providers, this.args.type, this.args.expiration),\n\t\t\t\texpiration: this.args.expiration || null,\n\t\t\t\tcreated_at: providers.now(),\n\t\t\t\tcreated_ip: this.args.requestInfo?.ip || null,\n\t\t\t\tcreated_user_agent: this.args.requestInfo?.userAgent || null,\n\t\t\t\ttrust_forwarded_info: this.args.trustForwardedInfo ?? false,\n\t\t\t\tissued_at: sessionPolicy.issued_at,\n\t\t\t\tidle_timeout: sessionPolicy.idle_timeout,\n\t\t\t\tmax_expires_at: sessionPolicy.max_expires_at,\n\t\t\t})\n\t\t\t.execute(db)\n\n\t\treturn new CreateApiKeyCommandResult(apiKeyId, token)\n\t}\n}\n\nexport class CreateApiKeyCommandResult {\n\tconstructor(public readonly id: string, public readonly token?: string) {\n\t}\n}\n"],"names":["InsertBuilder"],"mappings":";;;;AAoCO,MAAM,oBAAkE;AAAA,EAC9E,YAAoB,MAAwB;AAAxB,SAAA,OAAA;AAAA,EAAyB;AAAA,EAE7C,MAAM,QAAQ,EAAE,IAAI,aAA+D;AAClF,UAAM,WAAW,UAAU,KAAA;AAC3B,QAAI;AACJ,QAAI,YAAY,KAAK,KAAK;AAC1B,QAAI,CAAC,WAAW;AACf,cAAQ,MAAM,cAAc,SAAS;AACrC,kBAAY,iBAAiB,KAAK;AAAA,IACnC;AAIA,UAAM,OAAO,KAAK;AAClB,UAAM,gBAAgB,KAAK,SAAS,OAAO,KAAK,UAC7C;AAAA,MACD,WAAW,UAAU,IAAA;AAAA,MACrB,cAAc,KAAK,eAAe;AAAA,MAClC,gBAAgB,KAAK,gBAAgB;AAAA,IAAA,IAEpC,EAAE,WAAW,MAAM,cAAc,MAAM,gBAAgB,KAAA;AAC1D,UAAMA,gBAAc,OAAA,EAClB,KAAK,SAAS,EACd,OAAO;AAAA,MACP,IAAI;AAAA,MACJ,YAAY;AAAA,MACZ,MAAM,KAAK,KAAK;AAAA,MAChB,aAAa,KAAK,KAAK;AAAA,MACvB,aAAa;AAAA,MACb,YAAY,aAAa,cAAc,WAAW,KAAK,KAAK,MAAM,KAAK,KAAK,UAAU;AAAA,MACtF,YAAY,KAAK,KAAK,cAAc;AAAA,MACpC,YAAY,UAAU,IAAA;AAAA,MACtB,YAAY,KAAK,KAAK,aAAa,MAAM;AAAA,MACzC,oBAAoB,KAAK,KAAK,aAAa,aAAa;AAAA,MACxD,sBAAsB,KAAK,KAAK,sBAAsB;AAAA,MACtD,WAAW,cAAc;AAAA,MACzB,cAAc,cAAc;AAAA,MAC5B,gBAAgB,cAAc;AAAA,IAAA,CAC9B,EACA,QAAQ,EAAE;AAEZ,WAAO,IAAI,0BAA0B,UAAU,KAAK;AAAA,EACrD;AACD;AAEO,MAAM,0BAA0B;AAAA,EACtC,YAA4B,IAA4B,OAAgB;AAA5C,SAAA,KAAA;AAA4B,SAAA,QAAA;AAAA,EACxD;AACD;"}
1
+ {"version":3,"file":"CreateApiKeyCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/CreateApiKeyCommand.ts"],"sourcesContent":["import { Command } from '../Command.js'\nimport { ApiKey } from '../../type/index.js'\nimport { ApiKeyHelper } from './ApiKeyHelper.js'\nimport { InsertBuilder, Literal } from '@contember/database'\nimport { computeTokenHash, generateToken, TokenHash } from '../../utils/index.js'\nimport { ApiKeyRequestInfo } from './ProlongApiKeyCommand.js'\n\ninterface CreateSessionApiKeyArgs {\n\ttype: ApiKey.Type.SESSION\n\tidentityId: string\n\texpiration?: number\n\ttokenHash?: string\n\trequestInfo?: ApiKeyRequestInfo\n\ttrustForwardedInfo?: boolean\n\t/**\n\t * A19 session-policy snapshot, fixed at sign-in. NULLs preserve today's\n\t * behavior (no idle timeout, no absolute cap on the sliding window).\n\t * `idleTimeout` is a Postgres interval literal (e.g. `'15 minutes'`).\n\t */\n\tidleTimeout?: string | null\n\t/**\n\t * Absolute lifetime cap in seconds (A19). Written as `now() + interval` on the DB\n\t * clock so the cap is compared against the same clock. NULL = uncapped.\n\t */\n\tmaxExpirationSeconds?: number | null\n}\n\ninterface CreatePermanentApiKeyArgs {\n\ttype: ApiKey.Type.PERMANENT\n\tidentityId: string\n\ttokenHash?: TokenHash\n\texpiration?: undefined\n\trequestInfo?: ApiKeyRequestInfo\n\ttrustForwardedInfo?: boolean\n}\n\nexport type CreateApiKeyArgs =\n\t| CreateSessionApiKeyArgs\n\t| CreatePermanentApiKeyArgs\n\nexport class CreateApiKeyCommand implements Command<CreateApiKeyCommandResult> {\n\tconstructor(private args: CreateApiKeyArgs) {}\n\n\tasync execute({ db, providers }: Command.Args): Promise<CreateApiKeyCommandResult> {\n\t\tconst apiKeyId = providers.uuid()\n\t\tlet token\n\t\tlet tokenHash = this.args.tokenHash\n\t\tif (!tokenHash) {\n\t\t\ttoken = await generateToken(providers)\n\t\t\ttokenHash = computeTokenHash(token)\n\t\t}\n\n\t\t// Session-policy snapshot (A19). Only session keys carry it; permanent/one-off\n\t\t// keys have no session policy → NULL (preserving today's behavior).\n\t\tconst args = this.args\n\t\tconst sessionPolicy = args.type === ApiKey.Type.SESSION\n\t\t\t? {\n\t\t\t\tissued_at: providers.now(), // display/ordering only, never compared\n\t\t\t\tidle_timeout: args.idleTimeout ?? null,\n\t\t\t\tmax_expires_at: args.maxExpirationSeconds != null\n\t\t\t\t\t? new Literal('now() + make_interval(secs => ?)', [args.maxExpirationSeconds])\n\t\t\t\t\t: null,\n\t\t\t}\n\t\t\t: { issued_at: null, idle_timeout: null, max_expires_at: null }\n\t\tawait InsertBuilder.create()\n\t\t\t.into('api_key')\n\t\t\t.values({\n\t\t\t\tid: apiKeyId,\n\t\t\t\ttoken_hash: tokenHash,\n\t\t\t\ttype: this.args.type,\n\t\t\t\tidentity_id: this.args.identityId,\n\t\t\t\tdisabled_at: null,\n\t\t\t\t// expires_at on the DB clock so the verify gate compares like-for-like.\n\t\t\t\texpires_at: ApiKeyHelper.getExpirationLiteral(this.args.type, this.args.expiration),\n\t\t\t\texpiration: this.args.expiration || null,\n\t\t\t\tcreated_at: providers.now(),\n\t\t\t\tcreated_ip: this.args.requestInfo?.ip || null,\n\t\t\t\tcreated_user_agent: this.args.requestInfo?.userAgent || null,\n\t\t\t\ttrust_forwarded_info: this.args.trustForwardedInfo ?? false,\n\t\t\t\tissued_at: sessionPolicy.issued_at,\n\t\t\t\tidle_timeout: sessionPolicy.idle_timeout,\n\t\t\t\tmax_expires_at: sessionPolicy.max_expires_at,\n\t\t\t})\n\t\t\t.execute(db)\n\n\t\treturn new CreateApiKeyCommandResult(apiKeyId, token)\n\t}\n}\n\nexport class CreateApiKeyCommandResult {\n\tconstructor(public readonly id: string, public readonly token?: string) {\n\t}\n}\n"],"names":["InsertBuilder"],"mappings":";;;;AAwCO,MAAM,oBAAkE;AAAA,EAC9E,YAAoB,MAAwB;AAAxB,SAAA,OAAA;AAAA,EAAyB;AAAA,EAE7C,MAAM,QAAQ,EAAE,IAAI,aAA+D;AAClF,UAAM,WAAW,UAAU,KAAA;AAC3B,QAAI;AACJ,QAAI,YAAY,KAAK,KAAK;AAC1B,QAAI,CAAC,WAAW;AACf,cAAQ,MAAM,cAAc,SAAS;AACrC,kBAAY,iBAAiB,KAAK;AAAA,IACnC;AAIA,UAAM,OAAO,KAAK;AAClB,UAAM,gBAAgB,KAAK,SAAS,OAAO,KAAK,UAC7C;AAAA,MACD,WAAW,UAAU,IAAA;AAAA;AAAA,MACrB,cAAc,KAAK,eAAe;AAAA,MAClC,gBAAgB,KAAK,wBAAwB,OAC1C,IAAI,QAAQ,oCAAoC,CAAC,KAAK,oBAAoB,CAAC,IAC3E;AAAA,IAAA,IAEF,EAAE,WAAW,MAAM,cAAc,MAAM,gBAAgB,KAAA;AAC1D,UAAMA,gBAAc,OAAA,EAClB,KAAK,SAAS,EACd,OAAO;AAAA,MACP,IAAI;AAAA,MACJ,YAAY;AAAA,MACZ,MAAM,KAAK,KAAK;AAAA,MAChB,aAAa,KAAK,KAAK;AAAA,MACvB,aAAa;AAAA;AAAA,MAEb,YAAY,aAAa,qBAAqB,KAAK,KAAK,MAAM,KAAK,KAAK,UAAU;AAAA,MAClF,YAAY,KAAK,KAAK,cAAc;AAAA,MACpC,YAAY,UAAU,IAAA;AAAA,MACtB,YAAY,KAAK,KAAK,aAAa,MAAM;AAAA,MACzC,oBAAoB,KAAK,KAAK,aAAa,aAAa;AAAA,MACxD,sBAAsB,KAAK,KAAK,sBAAsB;AAAA,MACtD,WAAW,cAAc;AAAA,MACzB,cAAc,cAAc;AAAA,MAC5B,gBAAgB,cAAc;AAAA,IAAA,CAC9B,EACA,QAAQ,EAAE;AAEZ,WAAO,IAAI,0BAA0B,UAAU,KAAK;AAAA,EACrD;AACD;AAEO,MAAM,0BAA0B;AAAA,EACtC,YAA4B,IAA4B,OAAgB;AAA5C,SAAA,KAAA;AAA4B,SAAA,QAAA;AAAA,EACxD;AACD;"}
@@ -28,34 +28,33 @@ class ProlongApiKeyCommand {
28
28
  }
29
29
  const requestIp = this.requestInfo?.ip || null;
30
30
  const requestUserAgent = this.requestInfo?.userAgent || null;
31
- const updateTracking = this.shouldUpdateTracking(now, requestIp, requestUserAgent);
31
+ const updateTracking = this.shouldUpdateTracking(now);
32
32
  if (!updateExpiration && !updateTracking) {
33
33
  return;
34
34
  }
35
35
  const values = {};
36
36
  if (updateExpiration && newExpiration !== null) {
37
- values.expires_at = newExpiration;
37
+ values.expires_at = new Database.Literal('LEAST(now() + make_interval(secs => ?), "max_expires_at")', [
38
+ ApiKeyHelper.ApiKeyHelper.getSessionExpirationSeconds(this.expiration)
39
+ ]);
38
40
  }
39
41
  if (updateTracking) {
40
42
  values.last_ip = requestIp;
41
43
  values.last_user_agent = requestUserAgent;
42
- values.last_used_at = now;
44
+ values.last_used_at = new Database.Literal("now()");
43
45
  }
44
46
  const qb = Database.UpdateBuilder.create().table("api_key").where({ id: this.id }).values(values);
45
47
  await qb.execute(db);
46
48
  }
47
- shouldUpdateTracking(now, requestIp, requestUserAgent) {
49
+ shouldUpdateTracking(now) {
48
50
  if (!this.requestInfo) {
49
51
  return false;
50
52
  }
51
- const last = this.tracking;
52
- if (!last || last.lastUsedAt === null) {
53
+ const lastUsedAt = this.tracking?.lastUsedAt;
54
+ if (!lastUsedAt) {
53
55
  return true;
54
56
  }
55
- if (requestIp !== last.lastIp || requestUserAgent !== last.lastUserAgent) {
56
- return true;
57
- }
58
- return now.getTime() - last.lastUsedAt.getTime() >= PROLONG_THROTTLE_MS;
57
+ return now.getTime() - lastUsedAt.getTime() >= PROLONG_THROTTLE_MS;
59
58
  }
60
59
  }
61
60
  exports.PROLONG_THROTTLE_MS = PROLONG_THROTTLE_MS;
@@ -1 +1 @@
1
- {"version":3,"file":"ProlongApiKeyCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/ProlongApiKeyCommand.ts"],"sourcesContent":["import { Command } from '../Command.js'\nimport { ApiKey } from '../../type/index.js'\nimport { ApiKeyHelper } from './ApiKeyHelper.js'\nimport { QueryBuilder, UpdateBuilder } from '@contember/database'\n\n/**\n * Tracking writes (`last_used_at`) are throttled to at most once per this window, so\n * an idle check must add this slack to avoid prematurely expiring an active session\n * whose `last_used_at` is intentionally stale (see {@link ApiKeyManager.verifyAndProlong}).\n */\nexport const PROLONG_THROTTLE_MS = 60_000\n\nexport interface ApiKeyRequestInfo {\n\tip?: string\n\tuserAgent?: string\n}\n\nexport interface ApiKeyTrackingState {\n\tlastIp: string | null\n\tlastUserAgent: string | null\n\tlastUsedAt: Date | null\n}\n\nexport class ProlongApiKeyCommand implements Command<void> {\n\tconstructor(\n\t\tprivate readonly id: string,\n\t\tprivate readonly type: ApiKey.Type,\n\t\tprivate readonly expiration: number | null,\n\t\tprivate readonly currentExpiration: Date | null,\n\t\tprivate readonly requestInfo?: ApiKeyRequestInfo,\n\t\tprivate readonly tracking?: ApiKeyTrackingState,\n\t\tprivate readonly maxExpiresAt?: Date | null,\n\t) {}\n\n\tasync execute({ db, providers }: Command.Args): Promise<void> {\n\t\tlet newExpiration = ApiKeyHelper.getExpiration(providers, this.type, this.expiration)\n\t\t// A19: clamp the sliding window at the absolute cap snapshotted at sign-in.\n\t\t// NULL maxExpiresAt = today's uncapped sliding window.\n\t\tif (newExpiration !== null && this.maxExpiresAt && newExpiration.getTime() > this.maxExpiresAt.getTime()) {\n\t\t\tnewExpiration = this.maxExpiresAt\n\t\t}\n\t\tconst now = providers.now()\n\n\t\tlet updateExpiration = newExpiration !== null\n\t\tif (updateExpiration && this.currentExpiration && newExpiration !== null) {\n\t\t\tconst prolongMs = newExpiration.getTime() - this.currentExpiration.getTime()\n\t\t\tif (prolongMs > 0 && prolongMs < PROLONG_THROTTLE_MS) {\n\t\t\t\tupdateExpiration = false\n\t\t\t}\n\t\t}\n\n\t\tconst requestIp = this.requestInfo?.ip || null\n\t\tconst requestUserAgent = this.requestInfo?.userAgent || null\n\t\tconst updateTracking = this.shouldUpdateTracking(now, requestIp, requestUserAgent)\n\n\t\tif (!updateExpiration && !updateTracking) {\n\t\t\treturn\n\t\t}\n\n\t\tconst values: QueryBuilder.Values = {}\n\t\tif (updateExpiration && newExpiration !== null) {\n\t\t\tvalues.expires_at = newExpiration\n\t\t}\n\t\tif (updateTracking) {\n\t\t\tvalues.last_ip = requestIp\n\t\t\tvalues.last_user_agent = requestUserAgent\n\t\t\tvalues.last_used_at = now\n\t\t}\n\n\t\tconst qb = UpdateBuilder.create()\n\t\t\t.table('api_key')\n\t\t\t.where({ id: this.id })\n\t\t\t.values(values)\n\t\tawait qb.execute(db)\n\t}\n\n\tprivate shouldUpdateTracking(now: Date, requestIp: string | null, requestUserAgent: string | null): boolean {\n\t\tif (!this.requestInfo) {\n\t\t\treturn false\n\t\t}\n\t\tconst last = this.tracking\n\t\tif (!last || last.lastUsedAt === null) {\n\t\t\treturn true\n\t\t}\n\t\tif (requestIp !== last.lastIp || requestUserAgent !== last.lastUserAgent) {\n\t\t\treturn true\n\t\t}\n\t\treturn now.getTime() - last.lastUsedAt.getTime() >= PROLONG_THROTTLE_MS\n\t}\n}\n"],"names":["ApiKeyHelper","UpdateBuilder"],"mappings":";;;;AAUO,MAAM,sBAAsB;AAa5B,MAAM,qBAA8C;AAAA,EAC1D,YACkB,IACA,MACA,YACA,mBACA,aACA,UACA,cAChB;AAPgB,SAAA,KAAA;AACA,SAAA,OAAA;AACA,SAAA,aAAA;AACA,SAAA,oBAAA;AACA,SAAA,cAAA;AACA,SAAA,WAAA;AACA,SAAA,eAAA;AAAA,EACf;AAAA,EAEH,MAAM,QAAQ,EAAE,IAAI,aAA0C;AAC7D,QAAI,gBAAgBA,aAAAA,aAAa,cAAc,WAAW,KAAK,MAAM,KAAK,UAAU;AAGpF,QAAI,kBAAkB,QAAQ,KAAK,gBAAgB,cAAc,YAAY,KAAK,aAAa,WAAW;AACzG,sBAAgB,KAAK;AAAA,IACtB;AACA,UAAM,MAAM,UAAU,IAAA;AAEtB,QAAI,mBAAmB,kBAAkB;AACzC,QAAI,oBAAoB,KAAK,qBAAqB,kBAAkB,MAAM;AACzE,YAAM,YAAY,cAAc,QAAA,IAAY,KAAK,kBAAkB,QAAA;AACnE,UAAI,YAAY,KAAK,YAAY,qBAAqB;AACrD,2BAAmB;AAAA,MACpB;AAAA,IACD;AAEA,UAAM,YAAY,KAAK,aAAa,MAAM;AAC1C,UAAM,mBAAmB,KAAK,aAAa,aAAa;AACxD,UAAM,iBAAiB,KAAK,qBAAqB,KAAK,WAAW,gBAAgB;AAEjF,QAAI,CAAC,oBAAoB,CAAC,gBAAgB;AACzC;AAAA,IACD;AAEA,UAAM,SAA8B,CAAA;AACpC,QAAI,oBAAoB,kBAAkB,MAAM;AAC/C,aAAO,aAAa;AAAA,IACrB;AACA,QAAI,gBAAgB;AACnB,aAAO,UAAU;AACjB,aAAO,kBAAkB;AACzB,aAAO,eAAe;AAAA,IACvB;AAEA,UAAM,KAAKC,SAAAA,cAAc,OAAA,EACvB,MAAM,SAAS,EACf,MAAM,EAAE,IAAI,KAAK,GAAA,CAAI,EACrB,OAAO,MAAM;AACf,UAAM,GAAG,QAAQ,EAAE;AAAA,EACpB;AAAA,EAEQ,qBAAqB,KAAW,WAA0B,kBAA0C;AAC3G,QAAI,CAAC,KAAK,aAAa;AACtB,aAAO;AAAA,IACR;AACA,UAAM,OAAO,KAAK;AAClB,QAAI,CAAC,QAAQ,KAAK,eAAe,MAAM;AACtC,aAAO;AAAA,IACR;AACA,QAAI,cAAc,KAAK,UAAU,qBAAqB,KAAK,eAAe;AACzE,aAAO;AAAA,IACR;AACA,WAAO,IAAI,QAAA,IAAY,KAAK,WAAW,aAAa;AAAA,EACrD;AACD;;;"}
1
+ {"version":3,"file":"ProlongApiKeyCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/ProlongApiKeyCommand.ts"],"sourcesContent":["import { Command } from '../Command.js'\nimport { ApiKey } from '../../type/index.js'\nimport { ApiKeyHelper } from './ApiKeyHelper.js'\nimport { Literal, QueryBuilder, UpdateBuilder } from '@contember/database'\n\n/**\n * Tracking writes (`last_ip`, `last_user_agent`, `last_used_at`) are throttled to at most once per\n * this window, even when the IP or User-Agent changes: a key shared by several service replicas\n * alternates between their addresses, and writing every change makes its row a lock hotspot.\n * An idle check must add this slack to avoid prematurely expiring an active session whose\n * `last_used_at` is intentionally stale (see {@link ApiKeyManager.verifyAndProlong}).\n */\nexport const PROLONG_THROTTLE_MS = 60_000\n\nexport interface ApiKeyRequestInfo {\n\tip?: string\n\tuserAgent?: string\n}\n\nexport interface ApiKeyTrackingState {\n\tlastIp: string | null\n\tlastUserAgent: string | null\n\tlastUsedAt: Date | null\n}\n\nexport class ProlongApiKeyCommand implements Command<void> {\n\tconstructor(\n\t\tprivate readonly id: string,\n\t\tprivate readonly type: ApiKey.Type,\n\t\tprivate readonly expiration: number | null,\n\t\tprivate readonly currentExpiration: Date | null,\n\t\tprivate readonly requestInfo?: ApiKeyRequestInfo,\n\t\tprivate readonly tracking?: ApiKeyTrackingState,\n\t\tprivate readonly maxExpiresAt?: Date | null,\n\t) {}\n\n\tasync execute({ db, providers }: Command.Args): Promise<void> {\n\t\tlet newExpiration = ApiKeyHelper.getExpiration(providers, this.type, this.expiration)\n\t\t// A19: clamp the sliding window at the absolute cap snapshotted at sign-in.\n\t\t// NULL maxExpiresAt = today's uncapped sliding window.\n\t\tif (newExpiration !== null && this.maxExpiresAt && newExpiration.getTime() > this.maxExpiresAt.getTime()) {\n\t\t\tnewExpiration = this.maxExpiresAt\n\t\t}\n\t\tconst now = providers.now()\n\n\t\tlet updateExpiration = newExpiration !== null\n\t\tif (updateExpiration && this.currentExpiration && newExpiration !== null) {\n\t\t\tconst prolongMs = newExpiration.getTime() - this.currentExpiration.getTime()\n\t\t\tif (prolongMs > 0 && prolongMs < PROLONG_THROTTLE_MS) {\n\t\t\t\tupdateExpiration = false\n\t\t\t}\n\t\t}\n\n\t\tconst requestIp = this.requestInfo?.ip || null\n\t\tconst requestUserAgent = this.requestInfo?.userAgent || null\n\t\tconst updateTracking = this.shouldUpdateTracking(now)\n\n\t\tif (!updateExpiration && !updateTracking) {\n\t\t\treturn\n\t\t}\n\n\t\tconst values: QueryBuilder.Values = {}\n\t\tif (updateExpiration && newExpiration !== null) {\n\t\t\t// Write the sliding expiry on the DB clock and clamp to the stored\n\t\t\t// max_expires_at in SQL (LEAST ignores a NULL cap → uncapped window). The JS\n\t\t\t// throttle above only decides *whether* to write; the expiry gate itself is\n\t\t\t// computed on the DB clock. See engine-tenant-api/CLAUDE.md.\n\t\t\tvalues.expires_at = new Literal('LEAST(now() + make_interval(secs => ?), \"max_expires_at\")', [\n\t\t\t\tApiKeyHelper.getSessionExpirationSeconds(this.expiration),\n\t\t\t])\n\t\t}\n\t\tif (updateTracking) {\n\t\t\tvalues.last_ip = requestIp\n\t\t\tvalues.last_user_agent = requestUserAgent\n\t\t\t// last_used_at on the DB clock: it's compared against now() in the idle gate\n\t\t\t// (ApiKeyByTokenQuery's is_idle_expired), so it must be written on the same\n\t\t\t// clock. The app-clock `now` above only drives the write-rate throttle. See CLAUDE.md.\n\t\t\tvalues.last_used_at = new Literal('now()')\n\t\t}\n\n\t\tconst qb = UpdateBuilder.create()\n\t\t\t.table('api_key')\n\t\t\t.where({ id: this.id })\n\t\t\t.values(values)\n\t\tawait qb.execute(db)\n\t}\n\n\tprivate shouldUpdateTracking(now: Date): boolean {\n\t\tif (!this.requestInfo) {\n\t\t\treturn false\n\t\t}\n\t\tconst lastUsedAt = this.tracking?.lastUsedAt\n\t\tif (!lastUsedAt) {\n\t\t\treturn true\n\t\t}\n\t\treturn now.getTime() - lastUsedAt.getTime() >= PROLONG_THROTTLE_MS\n\t}\n}\n"],"names":["ApiKeyHelper","Literal","UpdateBuilder"],"mappings":";;;;AAYO,MAAM,sBAAsB;AAa5B,MAAM,qBAA8C;AAAA,EAC1D,YACkB,IACA,MACA,YACA,mBACA,aACA,UACA,cAChB;AAPgB,SAAA,KAAA;AACA,SAAA,OAAA;AACA,SAAA,aAAA;AACA,SAAA,oBAAA;AACA,SAAA,cAAA;AACA,SAAA,WAAA;AACA,SAAA,eAAA;AAAA,EACf;AAAA,EAEH,MAAM,QAAQ,EAAE,IAAI,aAA0C;AAC7D,QAAI,gBAAgBA,aAAAA,aAAa,cAAc,WAAW,KAAK,MAAM,KAAK,UAAU;AAGpF,QAAI,kBAAkB,QAAQ,KAAK,gBAAgB,cAAc,YAAY,KAAK,aAAa,WAAW;AACzG,sBAAgB,KAAK;AAAA,IACtB;AACA,UAAM,MAAM,UAAU,IAAA;AAEtB,QAAI,mBAAmB,kBAAkB;AACzC,QAAI,oBAAoB,KAAK,qBAAqB,kBAAkB,MAAM;AACzE,YAAM,YAAY,cAAc,QAAA,IAAY,KAAK,kBAAkB,QAAA;AACnE,UAAI,YAAY,KAAK,YAAY,qBAAqB;AACrD,2BAAmB;AAAA,MACpB;AAAA,IACD;AAEA,UAAM,YAAY,KAAK,aAAa,MAAM;AAC1C,UAAM,mBAAmB,KAAK,aAAa,aAAa;AACxD,UAAM,iBAAiB,KAAK,qBAAqB,GAAG;AAEpD,QAAI,CAAC,oBAAoB,CAAC,gBAAgB;AACzC;AAAA,IACD;AAEA,UAAM,SAA8B,CAAA;AACpC,QAAI,oBAAoB,kBAAkB,MAAM;AAK/C,aAAO,aAAa,IAAIC,SAAAA,QAAQ,6DAA6D;AAAA,QAC5FD,0BAAa,4BAA4B,KAAK,UAAU;AAAA,MAAA,CACxD;AAAA,IACF;AACA,QAAI,gBAAgB;AACnB,aAAO,UAAU;AACjB,aAAO,kBAAkB;AAIzB,aAAO,eAAe,IAAIC,SAAAA,QAAQ,OAAO;AAAA,IAC1C;AAEA,UAAM,KAAKC,SAAAA,cAAc,OAAA,EACvB,MAAM,SAAS,EACf,MAAM,EAAE,IAAI,KAAK,GAAA,CAAI,EACrB,OAAO,MAAM;AACf,UAAM,GAAG,QAAQ,EAAE;AAAA,EACpB;AAAA,EAEQ,qBAAqB,KAAoB;AAChD,QAAI,CAAC,KAAK,aAAa;AACtB,aAAO;AAAA,IACR;AACA,UAAM,aAAa,KAAK,UAAU;AAClC,QAAI,CAAC,YAAY;AAChB,aAAO;AAAA,IACR;AACA,WAAO,IAAI,QAAA,IAAY,WAAW,aAAa;AAAA,EAChD;AACD;;;"}
@@ -1,5 +1,5 @@
1
1
  import { ApiKeyHelper } from "./ApiKeyHelper.js";
2
- import { UpdateBuilder as UpdateBuilder$1 } from "@contember/database";
2
+ import { Literal, UpdateBuilder as UpdateBuilder$1 } from "@contember/database";
3
3
  const PROLONG_THROTTLE_MS = 6e4;
4
4
  class ProlongApiKeyCommand {
5
5
  constructor(id, type, expiration, currentExpiration, requestInfo, tracking, maxExpiresAt) {
@@ -26,34 +26,33 @@ class ProlongApiKeyCommand {
26
26
  }
27
27
  const requestIp = this.requestInfo?.ip || null;
28
28
  const requestUserAgent = this.requestInfo?.userAgent || null;
29
- const updateTracking = this.shouldUpdateTracking(now, requestIp, requestUserAgent);
29
+ const updateTracking = this.shouldUpdateTracking(now);
30
30
  if (!updateExpiration && !updateTracking) {
31
31
  return;
32
32
  }
33
33
  const values = {};
34
34
  if (updateExpiration && newExpiration !== null) {
35
- values.expires_at = newExpiration;
35
+ values.expires_at = new Literal('LEAST(now() + make_interval(secs => ?), "max_expires_at")', [
36
+ ApiKeyHelper.getSessionExpirationSeconds(this.expiration)
37
+ ]);
36
38
  }
37
39
  if (updateTracking) {
38
40
  values.last_ip = requestIp;
39
41
  values.last_user_agent = requestUserAgent;
40
- values.last_used_at = now;
42
+ values.last_used_at = new Literal("now()");
41
43
  }
42
44
  const qb = UpdateBuilder$1.create().table("api_key").where({ id: this.id }).values(values);
43
45
  await qb.execute(db);
44
46
  }
45
- shouldUpdateTracking(now, requestIp, requestUserAgent) {
47
+ shouldUpdateTracking(now) {
46
48
  if (!this.requestInfo) {
47
49
  return false;
48
50
  }
49
- const last = this.tracking;
50
- if (!last || last.lastUsedAt === null) {
51
+ const lastUsedAt = this.tracking?.lastUsedAt;
52
+ if (!lastUsedAt) {
51
53
  return true;
52
54
  }
53
- if (requestIp !== last.lastIp || requestUserAgent !== last.lastUserAgent) {
54
- return true;
55
- }
56
- return now.getTime() - last.lastUsedAt.getTime() >= PROLONG_THROTTLE_MS;
55
+ return now.getTime() - lastUsedAt.getTime() >= PROLONG_THROTTLE_MS;
57
56
  }
58
57
  }
59
58
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"ProlongApiKeyCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/ProlongApiKeyCommand.ts"],"sourcesContent":["import { Command } from '../Command.js'\nimport { ApiKey } from '../../type/index.js'\nimport { ApiKeyHelper } from './ApiKeyHelper.js'\nimport { QueryBuilder, UpdateBuilder } from '@contember/database'\n\n/**\n * Tracking writes (`last_used_at`) are throttled to at most once per this window, so\n * an idle check must add this slack to avoid prematurely expiring an active session\n * whose `last_used_at` is intentionally stale (see {@link ApiKeyManager.verifyAndProlong}).\n */\nexport const PROLONG_THROTTLE_MS = 60_000\n\nexport interface ApiKeyRequestInfo {\n\tip?: string\n\tuserAgent?: string\n}\n\nexport interface ApiKeyTrackingState {\n\tlastIp: string | null\n\tlastUserAgent: string | null\n\tlastUsedAt: Date | null\n}\n\nexport class ProlongApiKeyCommand implements Command<void> {\n\tconstructor(\n\t\tprivate readonly id: string,\n\t\tprivate readonly type: ApiKey.Type,\n\t\tprivate readonly expiration: number | null,\n\t\tprivate readonly currentExpiration: Date | null,\n\t\tprivate readonly requestInfo?: ApiKeyRequestInfo,\n\t\tprivate readonly tracking?: ApiKeyTrackingState,\n\t\tprivate readonly maxExpiresAt?: Date | null,\n\t) {}\n\n\tasync execute({ db, providers }: Command.Args): Promise<void> {\n\t\tlet newExpiration = ApiKeyHelper.getExpiration(providers, this.type, this.expiration)\n\t\t// A19: clamp the sliding window at the absolute cap snapshotted at sign-in.\n\t\t// NULL maxExpiresAt = today's uncapped sliding window.\n\t\tif (newExpiration !== null && this.maxExpiresAt && newExpiration.getTime() > this.maxExpiresAt.getTime()) {\n\t\t\tnewExpiration = this.maxExpiresAt\n\t\t}\n\t\tconst now = providers.now()\n\n\t\tlet updateExpiration = newExpiration !== null\n\t\tif (updateExpiration && this.currentExpiration && newExpiration !== null) {\n\t\t\tconst prolongMs = newExpiration.getTime() - this.currentExpiration.getTime()\n\t\t\tif (prolongMs > 0 && prolongMs < PROLONG_THROTTLE_MS) {\n\t\t\t\tupdateExpiration = false\n\t\t\t}\n\t\t}\n\n\t\tconst requestIp = this.requestInfo?.ip || null\n\t\tconst requestUserAgent = this.requestInfo?.userAgent || null\n\t\tconst updateTracking = this.shouldUpdateTracking(now, requestIp, requestUserAgent)\n\n\t\tif (!updateExpiration && !updateTracking) {\n\t\t\treturn\n\t\t}\n\n\t\tconst values: QueryBuilder.Values = {}\n\t\tif (updateExpiration && newExpiration !== null) {\n\t\t\tvalues.expires_at = newExpiration\n\t\t}\n\t\tif (updateTracking) {\n\t\t\tvalues.last_ip = requestIp\n\t\t\tvalues.last_user_agent = requestUserAgent\n\t\t\tvalues.last_used_at = now\n\t\t}\n\n\t\tconst qb = UpdateBuilder.create()\n\t\t\t.table('api_key')\n\t\t\t.where({ id: this.id })\n\t\t\t.values(values)\n\t\tawait qb.execute(db)\n\t}\n\n\tprivate shouldUpdateTracking(now: Date, requestIp: string | null, requestUserAgent: string | null): boolean {\n\t\tif (!this.requestInfo) {\n\t\t\treturn false\n\t\t}\n\t\tconst last = this.tracking\n\t\tif (!last || last.lastUsedAt === null) {\n\t\t\treturn true\n\t\t}\n\t\tif (requestIp !== last.lastIp || requestUserAgent !== last.lastUserAgent) {\n\t\t\treturn true\n\t\t}\n\t\treturn now.getTime() - last.lastUsedAt.getTime() >= PROLONG_THROTTLE_MS\n\t}\n}\n"],"names":["UpdateBuilder"],"mappings":";;AAUO,MAAM,sBAAsB;AAa5B,MAAM,qBAA8C;AAAA,EAC1D,YACkB,IACA,MACA,YACA,mBACA,aACA,UACA,cAChB;AAPgB,SAAA,KAAA;AACA,SAAA,OAAA;AACA,SAAA,aAAA;AACA,SAAA,oBAAA;AACA,SAAA,cAAA;AACA,SAAA,WAAA;AACA,SAAA,eAAA;AAAA,EACf;AAAA,EAEH,MAAM,QAAQ,EAAE,IAAI,aAA0C;AAC7D,QAAI,gBAAgB,aAAa,cAAc,WAAW,KAAK,MAAM,KAAK,UAAU;AAGpF,QAAI,kBAAkB,QAAQ,KAAK,gBAAgB,cAAc,YAAY,KAAK,aAAa,WAAW;AACzG,sBAAgB,KAAK;AAAA,IACtB;AACA,UAAM,MAAM,UAAU,IAAA;AAEtB,QAAI,mBAAmB,kBAAkB;AACzC,QAAI,oBAAoB,KAAK,qBAAqB,kBAAkB,MAAM;AACzE,YAAM,YAAY,cAAc,QAAA,IAAY,KAAK,kBAAkB,QAAA;AACnE,UAAI,YAAY,KAAK,YAAY,qBAAqB;AACrD,2BAAmB;AAAA,MACpB;AAAA,IACD;AAEA,UAAM,YAAY,KAAK,aAAa,MAAM;AAC1C,UAAM,mBAAmB,KAAK,aAAa,aAAa;AACxD,UAAM,iBAAiB,KAAK,qBAAqB,KAAK,WAAW,gBAAgB;AAEjF,QAAI,CAAC,oBAAoB,CAAC,gBAAgB;AACzC;AAAA,IACD;AAEA,UAAM,SAA8B,CAAA;AACpC,QAAI,oBAAoB,kBAAkB,MAAM;AAC/C,aAAO,aAAa;AAAA,IACrB;AACA,QAAI,gBAAgB;AACnB,aAAO,UAAU;AACjB,aAAO,kBAAkB;AACzB,aAAO,eAAe;AAAA,IACvB;AAEA,UAAM,KAAKA,gBAAc,OAAA,EACvB,MAAM,SAAS,EACf,MAAM,EAAE,IAAI,KAAK,GAAA,CAAI,EACrB,OAAO,MAAM;AACf,UAAM,GAAG,QAAQ,EAAE;AAAA,EACpB;AAAA,EAEQ,qBAAqB,KAAW,WAA0B,kBAA0C;AAC3G,QAAI,CAAC,KAAK,aAAa;AACtB,aAAO;AAAA,IACR;AACA,UAAM,OAAO,KAAK;AAClB,QAAI,CAAC,QAAQ,KAAK,eAAe,MAAM;AACtC,aAAO;AAAA,IACR;AACA,QAAI,cAAc,KAAK,UAAU,qBAAqB,KAAK,eAAe;AACzE,aAAO;AAAA,IACR;AACA,WAAO,IAAI,QAAA,IAAY,KAAK,WAAW,aAAa;AAAA,EACrD;AACD;"}
1
+ {"version":3,"file":"ProlongApiKeyCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/ProlongApiKeyCommand.ts"],"sourcesContent":["import { Command } from '../Command.js'\nimport { ApiKey } from '../../type/index.js'\nimport { ApiKeyHelper } from './ApiKeyHelper.js'\nimport { Literal, QueryBuilder, UpdateBuilder } from '@contember/database'\n\n/**\n * Tracking writes (`last_ip`, `last_user_agent`, `last_used_at`) are throttled to at most once per\n * this window, even when the IP or User-Agent changes: a key shared by several service replicas\n * alternates between their addresses, and writing every change makes its row a lock hotspot.\n * An idle check must add this slack to avoid prematurely expiring an active session whose\n * `last_used_at` is intentionally stale (see {@link ApiKeyManager.verifyAndProlong}).\n */\nexport const PROLONG_THROTTLE_MS = 60_000\n\nexport interface ApiKeyRequestInfo {\n\tip?: string\n\tuserAgent?: string\n}\n\nexport interface ApiKeyTrackingState {\n\tlastIp: string | null\n\tlastUserAgent: string | null\n\tlastUsedAt: Date | null\n}\n\nexport class ProlongApiKeyCommand implements Command<void> {\n\tconstructor(\n\t\tprivate readonly id: string,\n\t\tprivate readonly type: ApiKey.Type,\n\t\tprivate readonly expiration: number | null,\n\t\tprivate readonly currentExpiration: Date | null,\n\t\tprivate readonly requestInfo?: ApiKeyRequestInfo,\n\t\tprivate readonly tracking?: ApiKeyTrackingState,\n\t\tprivate readonly maxExpiresAt?: Date | null,\n\t) {}\n\n\tasync execute({ db, providers }: Command.Args): Promise<void> {\n\t\tlet newExpiration = ApiKeyHelper.getExpiration(providers, this.type, this.expiration)\n\t\t// A19: clamp the sliding window at the absolute cap snapshotted at sign-in.\n\t\t// NULL maxExpiresAt = today's uncapped sliding window.\n\t\tif (newExpiration !== null && this.maxExpiresAt && newExpiration.getTime() > this.maxExpiresAt.getTime()) {\n\t\t\tnewExpiration = this.maxExpiresAt\n\t\t}\n\t\tconst now = providers.now()\n\n\t\tlet updateExpiration = newExpiration !== null\n\t\tif (updateExpiration && this.currentExpiration && newExpiration !== null) {\n\t\t\tconst prolongMs = newExpiration.getTime() - this.currentExpiration.getTime()\n\t\t\tif (prolongMs > 0 && prolongMs < PROLONG_THROTTLE_MS) {\n\t\t\t\tupdateExpiration = false\n\t\t\t}\n\t\t}\n\n\t\tconst requestIp = this.requestInfo?.ip || null\n\t\tconst requestUserAgent = this.requestInfo?.userAgent || null\n\t\tconst updateTracking = this.shouldUpdateTracking(now)\n\n\t\tif (!updateExpiration && !updateTracking) {\n\t\t\treturn\n\t\t}\n\n\t\tconst values: QueryBuilder.Values = {}\n\t\tif (updateExpiration && newExpiration !== null) {\n\t\t\t// Write the sliding expiry on the DB clock and clamp to the stored\n\t\t\t// max_expires_at in SQL (LEAST ignores a NULL cap → uncapped window). The JS\n\t\t\t// throttle above only decides *whether* to write; the expiry gate itself is\n\t\t\t// computed on the DB clock. See engine-tenant-api/CLAUDE.md.\n\t\t\tvalues.expires_at = new Literal('LEAST(now() + make_interval(secs => ?), \"max_expires_at\")', [\n\t\t\t\tApiKeyHelper.getSessionExpirationSeconds(this.expiration),\n\t\t\t])\n\t\t}\n\t\tif (updateTracking) {\n\t\t\tvalues.last_ip = requestIp\n\t\t\tvalues.last_user_agent = requestUserAgent\n\t\t\t// last_used_at on the DB clock: it's compared against now() in the idle gate\n\t\t\t// (ApiKeyByTokenQuery's is_idle_expired), so it must be written on the same\n\t\t\t// clock. The app-clock `now` above only drives the write-rate throttle. See CLAUDE.md.\n\t\t\tvalues.last_used_at = new Literal('now()')\n\t\t}\n\n\t\tconst qb = UpdateBuilder.create()\n\t\t\t.table('api_key')\n\t\t\t.where({ id: this.id })\n\t\t\t.values(values)\n\t\tawait qb.execute(db)\n\t}\n\n\tprivate shouldUpdateTracking(now: Date): boolean {\n\t\tif (!this.requestInfo) {\n\t\t\treturn false\n\t\t}\n\t\tconst lastUsedAt = this.tracking?.lastUsedAt\n\t\tif (!lastUsedAt) {\n\t\t\treturn true\n\t\t}\n\t\treturn now.getTime() - lastUsedAt.getTime() >= PROLONG_THROTTLE_MS\n\t}\n}\n"],"names":["UpdateBuilder"],"mappings":";;AAYO,MAAM,sBAAsB;AAa5B,MAAM,qBAA8C;AAAA,EAC1D,YACkB,IACA,MACA,YACA,mBACA,aACA,UACA,cAChB;AAPgB,SAAA,KAAA;AACA,SAAA,OAAA;AACA,SAAA,aAAA;AACA,SAAA,oBAAA;AACA,SAAA,cAAA;AACA,SAAA,WAAA;AACA,SAAA,eAAA;AAAA,EACf;AAAA,EAEH,MAAM,QAAQ,EAAE,IAAI,aAA0C;AAC7D,QAAI,gBAAgB,aAAa,cAAc,WAAW,KAAK,MAAM,KAAK,UAAU;AAGpF,QAAI,kBAAkB,QAAQ,KAAK,gBAAgB,cAAc,YAAY,KAAK,aAAa,WAAW;AACzG,sBAAgB,KAAK;AAAA,IACtB;AACA,UAAM,MAAM,UAAU,IAAA;AAEtB,QAAI,mBAAmB,kBAAkB;AACzC,QAAI,oBAAoB,KAAK,qBAAqB,kBAAkB,MAAM;AACzE,YAAM,YAAY,cAAc,QAAA,IAAY,KAAK,kBAAkB,QAAA;AACnE,UAAI,YAAY,KAAK,YAAY,qBAAqB;AACrD,2BAAmB;AAAA,MACpB;AAAA,IACD;AAEA,UAAM,YAAY,KAAK,aAAa,MAAM;AAC1C,UAAM,mBAAmB,KAAK,aAAa,aAAa;AACxD,UAAM,iBAAiB,KAAK,qBAAqB,GAAG;AAEpD,QAAI,CAAC,oBAAoB,CAAC,gBAAgB;AACzC;AAAA,IACD;AAEA,UAAM,SAA8B,CAAA;AACpC,QAAI,oBAAoB,kBAAkB,MAAM;AAK/C,aAAO,aAAa,IAAI,QAAQ,6DAA6D;AAAA,QAC5F,aAAa,4BAA4B,KAAK,UAAU;AAAA,MAAA,CACxD;AAAA,IACF;AACA,QAAI,gBAAgB;AACnB,aAAO,UAAU;AACjB,aAAO,kBAAkB;AAIzB,aAAO,eAAe,IAAI,QAAQ,OAAO;AAAA,IAC1C;AAEA,UAAM,KAAKA,gBAAc,OAAA,EACvB,MAAM,SAAS,EACf,MAAM,EAAE,IAAI,KAAK,GAAA,CAAI,EACrB,OAAO,MAAM;AACf,UAAM,GAAG,QAAQ,EAAE;AAAA,EACpB;AAAA,EAEQ,qBAAqB,KAAoB;AAChD,QAAI,CAAC,KAAK,aAAa;AACtB,aAAO;AAAA,IACR;AACA,UAAM,aAAa,KAAK,UAAU;AAClC,QAAI,CAAC,YAAY;AAChB,aAAO;AAAA,IACR;AACA,WAAO,IAAI,QAAA,IAAY,WAAW,aAAa;AAAA,EAChD;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CreateAuthLogEntryCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/authLog/CreateAuthLogEntryCommand.ts"],"sourcesContent":["import { Command } from '../Command.js'\nimport { AuthActionType } from '../../type/AuthLog.js'\nimport { InsertBuilder } from '@contember/database'\nimport { JSONValue } from '@contember/schema'\n\nexport class CreateAuthLogEntryCommand implements Command<void> {\n\tconstructor(\n\t\tprivate readonly data: CreateAuthLogEntryCommand.Entry,\n\t) {\n\t}\n\n\tasync execute({ db, providers }: Command.Args): Promise<void> {\n\t\tawait InsertBuilder.create()\n\t\t\t.into('person_auth_log')\n\t\t\t.values({\n\t\t\t\tid: providers.uuid(),\n\t\t\t\tinvoked_by_id: this.data.invokedById,\n\t\t\t\tperson_id: this.data.personId,\n\t\t\t\tperson_input_identifier: this.data.personInputIdentifier,\n\t\t\t\tperson_token_id: this.data.personTokenId,\n\t\t\t\ttype: this.data.type,\n\t\t\t\tsuccess: this.data.success,\n\t\t\t\terror_code: this.data.errorCode,\n\t\t\t\terror_message: this.data.errorMessage,\n\t\t\t\tip_address: this.data.ipAddress,\n\t\t\t\tuser_agent: this.data.userAgent,\n\t\t\t\tidentity_provider_id: this.data.identityProviderId,\n\t\t\t\tmetadata: this.data.metadata ?? {},\n\t\t\t\ttarget_person_id: this.data.targetPersonId,\n\t\t\t\tevent_data: this.data.eventData,\n\t\t\t\tgeo_country: this.data.geoCountry,\n\t\t\t\tdevice_fingerprint: this.data.deviceFingerprint,\n\t\t\t})\n\t\t\t.execute(db)\n\t}\n}\n\nnamespace CreateAuthLogEntryCommand {\n\texport type Entry = {\n\t\ttype: AuthActionType\n\t\t/** The identity that initiated the action. Omit (→ NULL) when there is no acting identity, e.g. an IdP-initiated back-channel logout. */\n\t\tinvokedById?: string\n\t\tpersonInputIdentifier?: string\n\t\tpersonId?: string\n\t\tpersonTokenId?: string\n\t\tsuccess: boolean\n\t\terrorCode?: string\n\t\terrorMessage?: string\n\t\tipAddress?: string\n\t\tuserAgent?: string\n\t\tidentityProviderId?: string\n\t\tmetadata?: JSONValue\n\t\ttargetPersonId?: string\n\t\teventData?: JSONValue\n\t\t/** A03: country derived from the trusted reverse-proxy geo header, when present. */\n\t\tgeoCountry?: string\n\t\t/** A03: hash of the client user-agent (never the raw UA). */\n\t\tdeviceFingerprint?: string\n\t}\n}\n"],"names":["InsertBuilder"],"mappings":";;;AAKO,MAAM,0BAAmD;AAAA,EAC/D,YACkB,MAChB;AADgB,SAAA,OAAA;AAAA,EAElB;AAAA,EAEA,MAAM,QAAQ,EAAE,IAAI,aAA0C;AAC7D,UAAMA,SAAAA,cAAc,OAAA,EAClB,KAAK,iBAAiB,EACtB,OAAO;AAAA,MACP,IAAI,UAAU,KAAA;AAAA,MACd,eAAe,KAAK,KAAK;AAAA,MACzB,WAAW,KAAK,KAAK;AAAA,MACrB,yBAAyB,KAAK,KAAK;AAAA,MACnC,iBAAiB,KAAK,KAAK;AAAA,MAC3B,MAAM,KAAK,KAAK;AAAA,MAChB,SAAS,KAAK,KAAK;AAAA,MACnB,YAAY,KAAK,KAAK;AAAA,MACtB,eAAe,KAAK,KAAK;AAAA,MACzB,YAAY,KAAK,KAAK;AAAA,MACtB,YAAY,KAAK,KAAK;AAAA,MACtB,sBAAsB,KAAK,KAAK;AAAA,MAChC,UAAU,KAAK,KAAK,YAAY,CAAA;AAAA,MAChC,kBAAkB,KAAK,KAAK;AAAA,MAC5B,YAAY,KAAK,KAAK;AAAA,MACtB,aAAa,KAAK,KAAK;AAAA,MACvB,oBAAoB,KAAK,KAAK;AAAA,IAAA,CAC9B,EACA,QAAQ,EAAE;AAAA,EACb;AACD;;"}
1
+ {"version":3,"file":"CreateAuthLogEntryCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/authLog/CreateAuthLogEntryCommand.ts"],"sourcesContent":["import { Command } from '../Command.js'\nimport { AuthActionType } from '../../type/AuthLog.js'\nimport { InsertBuilder } from '@contember/database'\nimport { JSONValue } from '@contember/schema'\n\nexport class CreateAuthLogEntryCommand implements Command<void> {\n\tconstructor(\n\t\tprivate readonly data: CreateAuthLogEntryCommand.Entry,\n\t) {\n\t}\n\n\tasync execute({ db, providers }: Command.Args): Promise<void> {\n\t\tawait InsertBuilder.create()\n\t\t\t.into('person_auth_log')\n\t\t\t.values({\n\t\t\t\tid: providers.uuid(),\n\t\t\t\tinvoked_by_id: this.data.invokedById,\n\t\t\t\tperson_id: this.data.personId,\n\t\t\t\tperson_input_identifier: this.data.personInputIdentifier,\n\t\t\t\tperson_token_id: this.data.personTokenId,\n\t\t\t\ttype: this.data.type,\n\t\t\t\tsuccess: this.data.success,\n\t\t\t\terror_code: this.data.errorCode,\n\t\t\t\terror_message: this.data.errorMessage,\n\t\t\t\tip_address: this.data.ipAddress,\n\t\t\t\tuser_agent: this.data.userAgent,\n\t\t\t\tidentity_provider_id: this.data.identityProviderId,\n\t\t\t\tmetadata: this.data.metadata ?? {},\n\t\t\t\ttarget_person_id: this.data.targetPersonId,\n\t\t\t\tevent_data: this.data.eventData,\n\t\t\t\tgeo_country: this.data.geoCountry,\n\t\t\t\tdevice_fingerprint: this.data.deviceFingerprint,\n\t\t\t})\n\t\t\t.execute(db)\n\t}\n}\n\nnamespace CreateAuthLogEntryCommand {\n\texport type Entry = {\n\t\ttype: AuthActionType\n\t\t/** The identity that initiated the action. Omit (→ NULL) when there is no acting identity, e.g. an IdP-initiated back-channel logout. */\n\t\tinvokedById?: string\n\t\tpersonInputIdentifier?: string\n\t\tpersonId?: string\n\t\t/** A `person_token` id (password reset, e-mail verification, passwordless). FK-checked, so never an `api_key` id: put that in `eventData`. */\n\t\tpersonTokenId?: string\n\t\tsuccess: boolean\n\t\terrorCode?: string\n\t\terrorMessage?: string\n\t\tipAddress?: string\n\t\tuserAgent?: string\n\t\tidentityProviderId?: string\n\t\tmetadata?: JSONValue\n\t\ttargetPersonId?: string\n\t\teventData?: JSONValue\n\t\t/** A03: country derived from the trusted reverse-proxy geo header, when present. */\n\t\tgeoCountry?: string\n\t\t/** A03: hash of the client user-agent (never the raw UA). */\n\t\tdeviceFingerprint?: string\n\t}\n}\n"],"names":["InsertBuilder"],"mappings":";;;AAKO,MAAM,0BAAmD;AAAA,EAC/D,YACkB,MAChB;AADgB,SAAA,OAAA;AAAA,EAElB;AAAA,EAEA,MAAM,QAAQ,EAAE,IAAI,aAA0C;AAC7D,UAAMA,SAAAA,cAAc,OAAA,EAClB,KAAK,iBAAiB,EACtB,OAAO;AAAA,MACP,IAAI,UAAU,KAAA;AAAA,MACd,eAAe,KAAK,KAAK;AAAA,MACzB,WAAW,KAAK,KAAK;AAAA,MACrB,yBAAyB,KAAK,KAAK;AAAA,MACnC,iBAAiB,KAAK,KAAK;AAAA,MAC3B,MAAM,KAAK,KAAK;AAAA,MAChB,SAAS,KAAK,KAAK;AAAA,MACnB,YAAY,KAAK,KAAK;AAAA,MACtB,eAAe,KAAK,KAAK;AAAA,MACzB,YAAY,KAAK,KAAK;AAAA,MACtB,YAAY,KAAK,KAAK;AAAA,MACtB,sBAAsB,KAAK,KAAK;AAAA,MAChC,UAAU,KAAK,KAAK,YAAY,CAAA;AAAA,MAChC,kBAAkB,KAAK,KAAK;AAAA,MAC5B,YAAY,KAAK,KAAK;AAAA,MACtB,aAAa,KAAK,KAAK;AAAA,MACvB,oBAAoB,KAAK,KAAK;AAAA,IAAA,CAC9B,EACA,QAAQ,EAAE;AAAA,EACb;AACD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CreateAuthLogEntryCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/authLog/CreateAuthLogEntryCommand.ts"],"sourcesContent":["import { Command } from '../Command.js'\nimport { AuthActionType } from '../../type/AuthLog.js'\nimport { InsertBuilder } from '@contember/database'\nimport { JSONValue } from '@contember/schema'\n\nexport class CreateAuthLogEntryCommand implements Command<void> {\n\tconstructor(\n\t\tprivate readonly data: CreateAuthLogEntryCommand.Entry,\n\t) {\n\t}\n\n\tasync execute({ db, providers }: Command.Args): Promise<void> {\n\t\tawait InsertBuilder.create()\n\t\t\t.into('person_auth_log')\n\t\t\t.values({\n\t\t\t\tid: providers.uuid(),\n\t\t\t\tinvoked_by_id: this.data.invokedById,\n\t\t\t\tperson_id: this.data.personId,\n\t\t\t\tperson_input_identifier: this.data.personInputIdentifier,\n\t\t\t\tperson_token_id: this.data.personTokenId,\n\t\t\t\ttype: this.data.type,\n\t\t\t\tsuccess: this.data.success,\n\t\t\t\terror_code: this.data.errorCode,\n\t\t\t\terror_message: this.data.errorMessage,\n\t\t\t\tip_address: this.data.ipAddress,\n\t\t\t\tuser_agent: this.data.userAgent,\n\t\t\t\tidentity_provider_id: this.data.identityProviderId,\n\t\t\t\tmetadata: this.data.metadata ?? {},\n\t\t\t\ttarget_person_id: this.data.targetPersonId,\n\t\t\t\tevent_data: this.data.eventData,\n\t\t\t\tgeo_country: this.data.geoCountry,\n\t\t\t\tdevice_fingerprint: this.data.deviceFingerprint,\n\t\t\t})\n\t\t\t.execute(db)\n\t}\n}\n\nnamespace CreateAuthLogEntryCommand {\n\texport type Entry = {\n\t\ttype: AuthActionType\n\t\t/** The identity that initiated the action. Omit (→ NULL) when there is no acting identity, e.g. an IdP-initiated back-channel logout. */\n\t\tinvokedById?: string\n\t\tpersonInputIdentifier?: string\n\t\tpersonId?: string\n\t\tpersonTokenId?: string\n\t\tsuccess: boolean\n\t\terrorCode?: string\n\t\terrorMessage?: string\n\t\tipAddress?: string\n\t\tuserAgent?: string\n\t\tidentityProviderId?: string\n\t\tmetadata?: JSONValue\n\t\ttargetPersonId?: string\n\t\teventData?: JSONValue\n\t\t/** A03: country derived from the trusted reverse-proxy geo header, when present. */\n\t\tgeoCountry?: string\n\t\t/** A03: hash of the client user-agent (never the raw UA). */\n\t\tdeviceFingerprint?: string\n\t}\n}\n"],"names":["InsertBuilder"],"mappings":";AAKO,MAAM,0BAAmD;AAAA,EAC/D,YACkB,MAChB;AADgB,SAAA,OAAA;AAAA,EAElB;AAAA,EAEA,MAAM,QAAQ,EAAE,IAAI,aAA0C;AAC7D,UAAMA,gBAAc,OAAA,EAClB,KAAK,iBAAiB,EACtB,OAAO;AAAA,MACP,IAAI,UAAU,KAAA;AAAA,MACd,eAAe,KAAK,KAAK;AAAA,MACzB,WAAW,KAAK,KAAK;AAAA,MACrB,yBAAyB,KAAK,KAAK;AAAA,MACnC,iBAAiB,KAAK,KAAK;AAAA,MAC3B,MAAM,KAAK,KAAK;AAAA,MAChB,SAAS,KAAK,KAAK;AAAA,MACnB,YAAY,KAAK,KAAK;AAAA,MACtB,eAAe,KAAK,KAAK;AAAA,MACzB,YAAY,KAAK,KAAK;AAAA,MACtB,YAAY,KAAK,KAAK;AAAA,MACtB,sBAAsB,KAAK,KAAK;AAAA,MAChC,UAAU,KAAK,KAAK,YAAY,CAAA;AAAA,MAChC,kBAAkB,KAAK,KAAK;AAAA,MAC5B,YAAY,KAAK,KAAK;AAAA,MACtB,aAAa,KAAK,KAAK;AAAA,MACvB,oBAAoB,KAAK,KAAK;AAAA,IAAA,CAC9B,EACA,QAAQ,EAAE;AAAA,EACb;AACD;"}
1
+ {"version":3,"file":"CreateAuthLogEntryCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/authLog/CreateAuthLogEntryCommand.ts"],"sourcesContent":["import { Command } from '../Command.js'\nimport { AuthActionType } from '../../type/AuthLog.js'\nimport { InsertBuilder } from '@contember/database'\nimport { JSONValue } from '@contember/schema'\n\nexport class CreateAuthLogEntryCommand implements Command<void> {\n\tconstructor(\n\t\tprivate readonly data: CreateAuthLogEntryCommand.Entry,\n\t) {\n\t}\n\n\tasync execute({ db, providers }: Command.Args): Promise<void> {\n\t\tawait InsertBuilder.create()\n\t\t\t.into('person_auth_log')\n\t\t\t.values({\n\t\t\t\tid: providers.uuid(),\n\t\t\t\tinvoked_by_id: this.data.invokedById,\n\t\t\t\tperson_id: this.data.personId,\n\t\t\t\tperson_input_identifier: this.data.personInputIdentifier,\n\t\t\t\tperson_token_id: this.data.personTokenId,\n\t\t\t\ttype: this.data.type,\n\t\t\t\tsuccess: this.data.success,\n\t\t\t\terror_code: this.data.errorCode,\n\t\t\t\terror_message: this.data.errorMessage,\n\t\t\t\tip_address: this.data.ipAddress,\n\t\t\t\tuser_agent: this.data.userAgent,\n\t\t\t\tidentity_provider_id: this.data.identityProviderId,\n\t\t\t\tmetadata: this.data.metadata ?? {},\n\t\t\t\ttarget_person_id: this.data.targetPersonId,\n\t\t\t\tevent_data: this.data.eventData,\n\t\t\t\tgeo_country: this.data.geoCountry,\n\t\t\t\tdevice_fingerprint: this.data.deviceFingerprint,\n\t\t\t})\n\t\t\t.execute(db)\n\t}\n}\n\nnamespace CreateAuthLogEntryCommand {\n\texport type Entry = {\n\t\ttype: AuthActionType\n\t\t/** The identity that initiated the action. Omit (→ NULL) when there is no acting identity, e.g. an IdP-initiated back-channel logout. */\n\t\tinvokedById?: string\n\t\tpersonInputIdentifier?: string\n\t\tpersonId?: string\n\t\t/** A `person_token` id (password reset, e-mail verification, passwordless). FK-checked, so never an `api_key` id: put that in `eventData`. */\n\t\tpersonTokenId?: string\n\t\tsuccess: boolean\n\t\terrorCode?: string\n\t\terrorMessage?: string\n\t\tipAddress?: string\n\t\tuserAgent?: string\n\t\tidentityProviderId?: string\n\t\tmetadata?: JSONValue\n\t\ttargetPersonId?: string\n\t\teventData?: JSONValue\n\t\t/** A03: country derived from the trusted reverse-proxy geo header, when present. */\n\t\tgeoCountry?: string\n\t\t/** A03: hash of the client user-agent (never the raw UA). */\n\t\tdeviceFingerprint?: string\n\t}\n}\n"],"names":["InsertBuilder"],"mappings":";AAKO,MAAM,0BAAmD;AAAA,EAC/D,YACkB,MAChB;AADgB,SAAA,OAAA;AAAA,EAElB;AAAA,EAEA,MAAM,QAAQ,EAAE,IAAI,aAA0C;AAC7D,UAAMA,gBAAc,OAAA,EAClB,KAAK,iBAAiB,EACtB,OAAO;AAAA,MACP,IAAI,UAAU,KAAA;AAAA,MACd,eAAe,KAAK,KAAK;AAAA,MACzB,WAAW,KAAK,KAAK;AAAA,MACrB,yBAAyB,KAAK,KAAK;AAAA,MACnC,iBAAiB,KAAK,KAAK;AAAA,MAC3B,MAAM,KAAK,KAAK;AAAA,MAChB,SAAS,KAAK,KAAK;AAAA,MACnB,YAAY,KAAK,KAAK;AAAA,MACtB,eAAe,KAAK,KAAK;AAAA,MACzB,YAAY,KAAK,KAAK;AAAA,MACtB,YAAY,KAAK,KAAK;AAAA,MACtB,sBAAsB,KAAK,KAAK;AAAA,MAChC,UAAU,KAAK,KAAK,YAAY,CAAA;AAAA,MAChC,kBAAkB,KAAK,KAAK;AAAA,MAC5B,YAAY,KAAK,KAAK;AAAA,MACtB,aAAa,KAAK,KAAK;AAAA,MACvB,oBAAoB,KAAK,KAAK;AAAA,IAAA,CAC9B,EACA,QAAQ,EAAE;AAAA,EACb;AACD;"}
@@ -10,8 +10,8 @@ class UpdateConfigurationCommand {
10
10
  const rl = this.configuration.rateLimits;
11
11
  let captchaSecretCol;
12
12
  let captchaSecretVersionCol;
13
- if (captcha?.secret !== void 0) {
14
- if (captcha.secret === "" || captcha.secret === null) {
13
+ if (captcha?.secret !== void 0 && captcha.secret !== null) {
14
+ if (captcha.secret === "") {
15
15
  captchaSecretCol = null;
16
16
  captchaSecretVersionCol = null;
17
17
  } else {
@@ -66,7 +66,9 @@ class UpdateConfigurationCommand {
66
66
  rate_limit_email_otp_per_person_limit: rl?.emailOtpPerPerson?.limit ?? void 0,
67
67
  rate_limit_email_otp_per_person_window: rl?.emailOtpPerPerson?.window ?? void 0,
68
68
  rate_limit_email_verification_per_ip_limit: rl?.emailVerificationPerIp?.limit ?? void 0,
69
- rate_limit_email_verification_per_ip_window: rl?.emailVerificationPerIp?.window ?? void 0
69
+ rate_limit_email_verification_per_ip_window: rl?.emailVerificationPerIp?.window ?? void 0,
70
+ panel_global_roles: this.configuration.panel?.globalRoles ?? void 0,
71
+ panel_project_roles: this.configuration.panel?.projectRoles ?? void 0
70
72
  }
71
73
  ).execute(db);
72
74
  if (!result) {
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateConfigurationCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/configuration/UpdateConfigurationCommand.ts"],"sourcesContent":["import { Command } from '../Command.js'\nimport { ConfigInput } from '../../../schema/index.js'\nimport { UpdateBuilder } from '@contember/database'\nimport { ConfigRow } from '../../type/Config.js'\nimport { IPostgresInterval } from 'postgres-interval'\n\nexport class UpdateConfigurationCommand implements Command<void> {\n\tconstructor(\n\t\tprivate readonly configuration: ConfigInput,\n\t) {\n\t}\n\n\tasync execute({ db, providers }: Command.Args): Promise<void> {\n\t\tconst captcha = this.configuration.captcha\n\t\tconst rl = this.configuration.rateLimits\n\n\t\t// Encrypt captcha secret at rest. Empty string clears the value;\n\t\t// non-empty re-encrypts so we always rotate to the latest key version.\n\t\tlet captchaSecretCol: Buffer | null | undefined\n\t\tlet captchaSecretVersionCol: number | null | undefined\n\t\tif (captcha?.secret !== undefined) {\n\t\t\tif (captcha.secret === '' || captcha.secret === null) {\n\t\t\t\tcaptchaSecretCol = null\n\t\t\t\tcaptchaSecretVersionCol = null\n\t\t\t} else {\n\t\t\t\tconst encrypted = await providers.encrypt(Buffer.from(captcha.secret, 'utf8'))\n\t\t\t\tcaptchaSecretCol = encrypted.value\n\t\t\t\tcaptchaSecretVersionCol = encrypted.version\n\t\t\t}\n\t\t}\n\n\t\tconst result = await UpdateBuilder.create()\n\t\t\t.table('config')\n\t\t\t.where({ id: 'singleton' })\n\t\t\t.values(\n\t\t\t\t{\n\t\t\t\t\tpasswordless_enabled: this.configuration.passwordless?.enabled ?? undefined,\n\t\t\t\t\tsignup_require_email_verification: this.configuration.signup?.requireEmailVerification ?? undefined,\n\t\t\t\t\trequire_email_change_verification: this.configuration.emailChange?.requireVerification ?? undefined,\n\t\t\t\t\tpasswordless_url: this.configuration.passwordless?.url,\n\t\t\t\t\tpasswordless_expiration: this.configuration.passwordless?.expiration ?? undefined,\n\t\t\t\t\tpassword_min_length: this.configuration.password?.minLength ?? undefined,\n\t\t\t\t\tpassword_require_uppercase: this.configuration.password?.requireUppercase ?? undefined,\n\t\t\t\t\tpassword_require_lowercase: this.configuration.password?.requireLowercase ?? undefined,\n\t\t\t\t\tpassword_require_digit: this.configuration.password?.requireDigit ?? undefined,\n\t\t\t\t\tpassword_require_special: this.configuration.password?.requireSpecial ?? undefined,\n\t\t\t\t\tpassword_pattern: this.configuration.password?.pattern,\n\t\t\t\t\tpassword_check_blacklist: this.configuration.password?.checkBlacklist ?? undefined,\n\t\t\t\t\tpassword_check_hibp: this.configuration.password?.checkHibp ?? undefined,\n\t\t\t\t\tlogin_base_backoff: this.configuration.login?.baseBackoff ?? undefined,\n\t\t\t\t\tlogin_max_backoff: this.configuration.login?.maxBackoff ?? undefined,\n\t\t\t\t\tlogin_attempt_window: this.configuration.login?.attemptWindow ?? undefined,\n\t\t\t\t\tlogin_reveal_user_exits: this.configuration.login?.revealUserExists ?? undefined,\n\t\t\t\t\tlogin_reveal_login_method: this.configuration.login?.revealLoginMethod ?? undefined,\n\t\t\t\t\tlogin_default_token_expiration: this.configuration.login?.defaultTokenExpiration ?? undefined,\n\t\t\t\t\tlogin_max_token_expiration: this.configuration.login?.maxTokenExpiration,\n\t\t\t\t\tlogin_mfa_grace_duration: this.configuration.login?.mfaGraceDuration ?? undefined,\n\t\t\t\t\tlogin_anomaly_detection_enabled: this.configuration.login?.anomalyDetection?.enabled ?? undefined,\n\t\t\t\t\tlogin_anomaly_history_size: this.configuration.login?.anomalyDetection?.historySize ?? undefined,\n\t\t\t\t\tlogin_anomaly_email_threshold: this.configuration.login?.anomalyDetection?.emailThreshold ?? undefined,\n\t\t\t\t\tlogin_anomaly_step_up_threshold: this.configuration.login?.anomalyDetection?.stepUpThreshold ?? undefined,\n\t\t\t\t\tcaptcha_provider: captcha?.provider !== undefined ? captcha.provider : undefined,\n\t\t\t\t\tcaptcha_secret: captchaSecretCol,\n\t\t\t\t\tcaptcha_secret_version: captchaSecretVersionCol,\n\t\t\t\t\tcaptcha_threshold: captcha?.threshold !== undefined ? captcha.threshold : undefined,\n\t\t\t\t\tcaptcha_protect_sign_up: captcha?.protect?.signUp ?? undefined,\n\t\t\t\t\tcaptcha_protect_password_reset: captcha?.protect?.passwordReset ?? undefined,\n\t\t\t\t\tcaptcha_protect_passwordless_init: captcha?.protect?.passwordlessInit ?? undefined,\n\t\t\t\t\tcaptcha_protect_email_verification: captcha?.protect?.emailVerification ?? undefined,\n\t\t\t\t\trate_limit_sign_up_per_ip_limit: rl?.signUpPerIp?.limit ?? undefined,\n\t\t\t\t\trate_limit_sign_up_per_ip_window: rl?.signUpPerIp?.window ?? undefined,\n\t\t\t\t\trate_limit_login_per_ip_limit: rl?.loginPerIp?.limit ?? undefined,\n\t\t\t\t\trate_limit_login_per_ip_window: rl?.loginPerIp?.window ?? undefined,\n\t\t\t\t\trate_limit_password_reset_per_ip_limit: rl?.passwordResetPerIp?.limit ?? undefined,\n\t\t\t\t\trate_limit_password_reset_per_ip_window: rl?.passwordResetPerIp?.window ?? undefined,\n\t\t\t\t\trate_limit_passwordless_init_per_ip_limit: rl?.passwordlessInitPerIp?.limit ?? undefined,\n\t\t\t\t\trate_limit_passwordless_init_per_ip_window: rl?.passwordlessInitPerIp?.window ?? undefined,\n\t\t\t\t\trate_limit_email_otp_per_person_limit: rl?.emailOtpPerPerson?.limit ?? undefined,\n\t\t\t\t\trate_limit_email_otp_per_person_window: rl?.emailOtpPerPerson?.window ?? undefined,\n\t\t\t\t\trate_limit_email_verification_per_ip_limit: rl?.emailVerificationPerIp?.limit ?? undefined,\n\t\t\t\t\trate_limit_email_verification_per_ip_window: rl?.emailVerificationPerIp?.window ?? undefined,\n\t\t\t\t} satisfies {\n\t\t\t\t\t[K in keyof ConfigRow]: (IPostgresInterval extends ConfigRow[K] ? string : never) | Exclude<ConfigRow[K], IPostgresInterval> | undefined\n\t\t\t\t},\n\t\t\t)\n\t\t\t.execute(db)\n\t\tif (!result) {\n\t\t\tthrow new Error('Configuration not found')\n\t\t}\n\t}\n}\n"],"names":["UpdateBuilder"],"mappings":";;;AAMO,MAAM,2BAAoD;AAAA,EAChE,YACkB,eAChB;AADgB,SAAA,gBAAA;AAAA,EAElB;AAAA,EAEA,MAAM,QAAQ,EAAE,IAAI,aAA0C;AAC7D,UAAM,UAAU,KAAK,cAAc;AACnC,UAAM,KAAK,KAAK,cAAc;AAI9B,QAAI;AACJ,QAAI;AACJ,QAAI,SAAS,WAAW,QAAW;AAClC,UAAI,QAAQ,WAAW,MAAM,QAAQ,WAAW,MAAM;AACrD,2BAAmB;AACnB,kCAA0B;AAAA,MAC3B,OAAO;AACN,cAAM,YAAY,MAAM,UAAU,QAAQ,OAAO,KAAK,QAAQ,QAAQ,MAAM,CAAC;AAC7E,2BAAmB,UAAU;AAC7B,kCAA0B,UAAU;AAAA,MACrC;AAAA,IACD;AAEA,UAAM,SAAS,MAAMA,uBAAc,OAAA,EACjC,MAAM,QAAQ,EACd,MAAM,EAAE,IAAI,YAAA,CAAa,EACzB;AAAA,MACA;AAAA,QACC,sBAAsB,KAAK,cAAc,cAAc,WAAW;AAAA,QAClE,mCAAmC,KAAK,cAAc,QAAQ,4BAA4B;AAAA,QAC1F,mCAAmC,KAAK,cAAc,aAAa,uBAAuB;AAAA,QAC1F,kBAAkB,KAAK,cAAc,cAAc;AAAA,QACnD,yBAAyB,KAAK,cAAc,cAAc,cAAc;AAAA,QACxE,qBAAqB,KAAK,cAAc,UAAU,aAAa;AAAA,QAC/D,4BAA4B,KAAK,cAAc,UAAU,oBAAoB;AAAA,QAC7E,4BAA4B,KAAK,cAAc,UAAU,oBAAoB;AAAA,QAC7E,wBAAwB,KAAK,cAAc,UAAU,gBAAgB;AAAA,QACrE,0BAA0B,KAAK,cAAc,UAAU,kBAAkB;AAAA,QACzE,kBAAkB,KAAK,cAAc,UAAU;AAAA,QAC/C,0BAA0B,KAAK,cAAc,UAAU,kBAAkB;AAAA,QACzE,qBAAqB,KAAK,cAAc,UAAU,aAAa;AAAA,QAC/D,oBAAoB,KAAK,cAAc,OAAO,eAAe;AAAA,QAC7D,mBAAmB,KAAK,cAAc,OAAO,cAAc;AAAA,QAC3D,sBAAsB,KAAK,cAAc,OAAO,iBAAiB;AAAA,QACjE,yBAAyB,KAAK,cAAc,OAAO,oBAAoB;AAAA,QACvE,2BAA2B,KAAK,cAAc,OAAO,qBAAqB;AAAA,QAC1E,gCAAgC,KAAK,cAAc,OAAO,0BAA0B;AAAA,QACpF,4BAA4B,KAAK,cAAc,OAAO;AAAA,QACtD,0BAA0B,KAAK,cAAc,OAAO,oBAAoB;AAAA,QACxE,iCAAiC,KAAK,cAAc,OAAO,kBAAkB,WAAW;AAAA,QACxF,4BAA4B,KAAK,cAAc,OAAO,kBAAkB,eAAe;AAAA,QACvF,+BAA+B,KAAK,cAAc,OAAO,kBAAkB,kBAAkB;AAAA,QAC7F,iCAAiC,KAAK,cAAc,OAAO,kBAAkB,mBAAmB;AAAA,QAChG,kBAAkB,SAAS,aAAa,SAAY,QAAQ,WAAW;AAAA,QACvE,gBAAgB;AAAA,QAChB,wBAAwB;AAAA,QACxB,mBAAmB,SAAS,cAAc,SAAY,QAAQ,YAAY;AAAA,QAC1E,yBAAyB,SAAS,SAAS,UAAU;AAAA,QACrD,gCAAgC,SAAS,SAAS,iBAAiB;AAAA,QACnE,mCAAmC,SAAS,SAAS,oBAAoB;AAAA,QACzE,oCAAoC,SAAS,SAAS,qBAAqB;AAAA,QAC3E,iCAAiC,IAAI,aAAa,SAAS;AAAA,QAC3D,kCAAkC,IAAI,aAAa,UAAU;AAAA,QAC7D,+BAA+B,IAAI,YAAY,SAAS;AAAA,QACxD,gCAAgC,IAAI,YAAY,UAAU;AAAA,QAC1D,wCAAwC,IAAI,oBAAoB,SAAS;AAAA,QACzE,yCAAyC,IAAI,oBAAoB,UAAU;AAAA,QAC3E,2CAA2C,IAAI,uBAAuB,SAAS;AAAA,QAC/E,4CAA4C,IAAI,uBAAuB,UAAU;AAAA,QACjF,uCAAuC,IAAI,mBAAmB,SAAS;AAAA,QACvE,wCAAwC,IAAI,mBAAmB,UAAU;AAAA,QACzE,4CAA4C,IAAI,wBAAwB,SAAS;AAAA,QACjF,6CAA6C,IAAI,wBAAwB,UAAU;AAAA,MAAA;AAAA,IACpF,EAIA,QAAQ,EAAE;AACZ,QAAI,CAAC,QAAQ;AACZ,YAAM,IAAI,MAAM,yBAAyB;AAAA,IAC1C;AAAA,EACD;AACD;;"}
1
+ {"version":3,"file":"UpdateConfigurationCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/configuration/UpdateConfigurationCommand.ts"],"sourcesContent":["import { Command } from '../Command.js'\nimport { ConfigInput } from '../../../schema/index.js'\nimport { UpdateBuilder } from '@contember/database'\nimport { ConfigRow } from '../../type/Config.js'\nimport { IPostgresInterval } from 'postgres-interval'\n\nexport class UpdateConfigurationCommand implements Command<void> {\n\tconstructor(\n\t\tprivate readonly configuration: ConfigInput,\n\t) {\n\t}\n\n\tasync execute({ db, providers }: Command.Args): Promise<void> {\n\t\tconst captcha = this.configuration.captcha\n\t\tconst rl = this.configuration.rateLimits\n\n\t\t// Null and omission preserve the stored secret; only an empty string clears it.\n\t\tlet captchaSecretCol: Buffer | null | undefined\n\t\tlet captchaSecretVersionCol: number | null | undefined\n\t\tif (captcha?.secret !== undefined && captcha.secret !== null) {\n\t\t\tif (captcha.secret === '') {\n\t\t\t\tcaptchaSecretCol = null\n\t\t\t\tcaptchaSecretVersionCol = null\n\t\t\t} else {\n\t\t\t\tconst encrypted = await providers.encrypt(Buffer.from(captcha.secret, 'utf8'))\n\t\t\t\tcaptchaSecretCol = encrypted.value\n\t\t\t\tcaptchaSecretVersionCol = encrypted.version\n\t\t\t}\n\t\t}\n\n\t\tconst result = await UpdateBuilder.create()\n\t\t\t.table('config')\n\t\t\t.where({ id: 'singleton' })\n\t\t\t.values(\n\t\t\t\t{\n\t\t\t\t\tpasswordless_enabled: this.configuration.passwordless?.enabled ?? undefined,\n\t\t\t\t\tsignup_require_email_verification: this.configuration.signup?.requireEmailVerification ?? undefined,\n\t\t\t\t\trequire_email_change_verification: this.configuration.emailChange?.requireVerification ?? undefined,\n\t\t\t\t\tpasswordless_url: this.configuration.passwordless?.url,\n\t\t\t\t\tpasswordless_expiration: this.configuration.passwordless?.expiration ?? undefined,\n\t\t\t\t\tpassword_min_length: this.configuration.password?.minLength ?? undefined,\n\t\t\t\t\tpassword_require_uppercase: this.configuration.password?.requireUppercase ?? undefined,\n\t\t\t\t\tpassword_require_lowercase: this.configuration.password?.requireLowercase ?? undefined,\n\t\t\t\t\tpassword_require_digit: this.configuration.password?.requireDigit ?? undefined,\n\t\t\t\t\tpassword_require_special: this.configuration.password?.requireSpecial ?? undefined,\n\t\t\t\t\tpassword_pattern: this.configuration.password?.pattern,\n\t\t\t\t\tpassword_check_blacklist: this.configuration.password?.checkBlacklist ?? undefined,\n\t\t\t\t\tpassword_check_hibp: this.configuration.password?.checkHibp ?? undefined,\n\t\t\t\t\tlogin_base_backoff: this.configuration.login?.baseBackoff ?? undefined,\n\t\t\t\t\tlogin_max_backoff: this.configuration.login?.maxBackoff ?? undefined,\n\t\t\t\t\tlogin_attempt_window: this.configuration.login?.attemptWindow ?? undefined,\n\t\t\t\t\tlogin_reveal_user_exits: this.configuration.login?.revealUserExists ?? undefined,\n\t\t\t\t\tlogin_reveal_login_method: this.configuration.login?.revealLoginMethod ?? undefined,\n\t\t\t\t\tlogin_default_token_expiration: this.configuration.login?.defaultTokenExpiration ?? undefined,\n\t\t\t\t\tlogin_max_token_expiration: this.configuration.login?.maxTokenExpiration,\n\t\t\t\t\tlogin_mfa_grace_duration: this.configuration.login?.mfaGraceDuration ?? undefined,\n\t\t\t\t\tlogin_anomaly_detection_enabled: this.configuration.login?.anomalyDetection?.enabled ?? undefined,\n\t\t\t\t\tlogin_anomaly_history_size: this.configuration.login?.anomalyDetection?.historySize ?? undefined,\n\t\t\t\t\tlogin_anomaly_email_threshold: this.configuration.login?.anomalyDetection?.emailThreshold ?? undefined,\n\t\t\t\t\tlogin_anomaly_step_up_threshold: this.configuration.login?.anomalyDetection?.stepUpThreshold ?? undefined,\n\t\t\t\t\tcaptcha_provider: captcha?.provider !== undefined ? captcha.provider : undefined,\n\t\t\t\t\tcaptcha_secret: captchaSecretCol,\n\t\t\t\t\tcaptcha_secret_version: captchaSecretVersionCol,\n\t\t\t\t\tcaptcha_threshold: captcha?.threshold !== undefined ? captcha.threshold : undefined,\n\t\t\t\t\tcaptcha_protect_sign_up: captcha?.protect?.signUp ?? undefined,\n\t\t\t\t\tcaptcha_protect_password_reset: captcha?.protect?.passwordReset ?? undefined,\n\t\t\t\t\tcaptcha_protect_passwordless_init: captcha?.protect?.passwordlessInit ?? undefined,\n\t\t\t\t\tcaptcha_protect_email_verification: captcha?.protect?.emailVerification ?? undefined,\n\t\t\t\t\trate_limit_sign_up_per_ip_limit: rl?.signUpPerIp?.limit ?? undefined,\n\t\t\t\t\trate_limit_sign_up_per_ip_window: rl?.signUpPerIp?.window ?? undefined,\n\t\t\t\t\trate_limit_login_per_ip_limit: rl?.loginPerIp?.limit ?? undefined,\n\t\t\t\t\trate_limit_login_per_ip_window: rl?.loginPerIp?.window ?? undefined,\n\t\t\t\t\trate_limit_password_reset_per_ip_limit: rl?.passwordResetPerIp?.limit ?? undefined,\n\t\t\t\t\trate_limit_password_reset_per_ip_window: rl?.passwordResetPerIp?.window ?? undefined,\n\t\t\t\t\trate_limit_passwordless_init_per_ip_limit: rl?.passwordlessInitPerIp?.limit ?? undefined,\n\t\t\t\t\trate_limit_passwordless_init_per_ip_window: rl?.passwordlessInitPerIp?.window ?? undefined,\n\t\t\t\t\trate_limit_email_otp_per_person_limit: rl?.emailOtpPerPerson?.limit ?? undefined,\n\t\t\t\t\trate_limit_email_otp_per_person_window: rl?.emailOtpPerPerson?.window ?? undefined,\n\t\t\t\t\trate_limit_email_verification_per_ip_limit: rl?.emailVerificationPerIp?.limit ?? undefined,\n\t\t\t\t\trate_limit_email_verification_per_ip_window: rl?.emailVerificationPerIp?.window ?? undefined,\n\t\t\t\t\tpanel_global_roles: this.configuration.panel?.globalRoles ?? undefined,\n\t\t\t\t\tpanel_project_roles: this.configuration.panel?.projectRoles ?? undefined,\n\t\t\t\t} satisfies {\n\t\t\t\t\t[K in keyof ConfigRow]: (IPostgresInterval extends ConfigRow[K] ? string : never) | Exclude<ConfigRow[K], IPostgresInterval> | undefined\n\t\t\t\t},\n\t\t\t)\n\t\t\t.execute(db)\n\t\tif (!result) {\n\t\t\tthrow new Error('Configuration not found')\n\t\t}\n\t}\n}\n"],"names":["UpdateBuilder"],"mappings":";;;AAMO,MAAM,2BAAoD;AAAA,EAChE,YACkB,eAChB;AADgB,SAAA,gBAAA;AAAA,EAElB;AAAA,EAEA,MAAM,QAAQ,EAAE,IAAI,aAA0C;AAC7D,UAAM,UAAU,KAAK,cAAc;AACnC,UAAM,KAAK,KAAK,cAAc;AAG9B,QAAI;AACJ,QAAI;AACJ,QAAI,SAAS,WAAW,UAAa,QAAQ,WAAW,MAAM;AAC7D,UAAI,QAAQ,WAAW,IAAI;AAC1B,2BAAmB;AACnB,kCAA0B;AAAA,MAC3B,OAAO;AACN,cAAM,YAAY,MAAM,UAAU,QAAQ,OAAO,KAAK,QAAQ,QAAQ,MAAM,CAAC;AAC7E,2BAAmB,UAAU;AAC7B,kCAA0B,UAAU;AAAA,MACrC;AAAA,IACD;AAEA,UAAM,SAAS,MAAMA,uBAAc,OAAA,EACjC,MAAM,QAAQ,EACd,MAAM,EAAE,IAAI,YAAA,CAAa,EACzB;AAAA,MACA;AAAA,QACC,sBAAsB,KAAK,cAAc,cAAc,WAAW;AAAA,QAClE,mCAAmC,KAAK,cAAc,QAAQ,4BAA4B;AAAA,QAC1F,mCAAmC,KAAK,cAAc,aAAa,uBAAuB;AAAA,QAC1F,kBAAkB,KAAK,cAAc,cAAc;AAAA,QACnD,yBAAyB,KAAK,cAAc,cAAc,cAAc;AAAA,QACxE,qBAAqB,KAAK,cAAc,UAAU,aAAa;AAAA,QAC/D,4BAA4B,KAAK,cAAc,UAAU,oBAAoB;AAAA,QAC7E,4BAA4B,KAAK,cAAc,UAAU,oBAAoB;AAAA,QAC7E,wBAAwB,KAAK,cAAc,UAAU,gBAAgB;AAAA,QACrE,0BAA0B,KAAK,cAAc,UAAU,kBAAkB;AAAA,QACzE,kBAAkB,KAAK,cAAc,UAAU;AAAA,QAC/C,0BAA0B,KAAK,cAAc,UAAU,kBAAkB;AAAA,QACzE,qBAAqB,KAAK,cAAc,UAAU,aAAa;AAAA,QAC/D,oBAAoB,KAAK,cAAc,OAAO,eAAe;AAAA,QAC7D,mBAAmB,KAAK,cAAc,OAAO,cAAc;AAAA,QAC3D,sBAAsB,KAAK,cAAc,OAAO,iBAAiB;AAAA,QACjE,yBAAyB,KAAK,cAAc,OAAO,oBAAoB;AAAA,QACvE,2BAA2B,KAAK,cAAc,OAAO,qBAAqB;AAAA,QAC1E,gCAAgC,KAAK,cAAc,OAAO,0BAA0B;AAAA,QACpF,4BAA4B,KAAK,cAAc,OAAO;AAAA,QACtD,0BAA0B,KAAK,cAAc,OAAO,oBAAoB;AAAA,QACxE,iCAAiC,KAAK,cAAc,OAAO,kBAAkB,WAAW;AAAA,QACxF,4BAA4B,KAAK,cAAc,OAAO,kBAAkB,eAAe;AAAA,QACvF,+BAA+B,KAAK,cAAc,OAAO,kBAAkB,kBAAkB;AAAA,QAC7F,iCAAiC,KAAK,cAAc,OAAO,kBAAkB,mBAAmB;AAAA,QAChG,kBAAkB,SAAS,aAAa,SAAY,QAAQ,WAAW;AAAA,QACvE,gBAAgB;AAAA,QAChB,wBAAwB;AAAA,QACxB,mBAAmB,SAAS,cAAc,SAAY,QAAQ,YAAY;AAAA,QAC1E,yBAAyB,SAAS,SAAS,UAAU;AAAA,QACrD,gCAAgC,SAAS,SAAS,iBAAiB;AAAA,QACnE,mCAAmC,SAAS,SAAS,oBAAoB;AAAA,QACzE,oCAAoC,SAAS,SAAS,qBAAqB;AAAA,QAC3E,iCAAiC,IAAI,aAAa,SAAS;AAAA,QAC3D,kCAAkC,IAAI,aAAa,UAAU;AAAA,QAC7D,+BAA+B,IAAI,YAAY,SAAS;AAAA,QACxD,gCAAgC,IAAI,YAAY,UAAU;AAAA,QAC1D,wCAAwC,IAAI,oBAAoB,SAAS;AAAA,QACzE,yCAAyC,IAAI,oBAAoB,UAAU;AAAA,QAC3E,2CAA2C,IAAI,uBAAuB,SAAS;AAAA,QAC/E,4CAA4C,IAAI,uBAAuB,UAAU;AAAA,QACjF,uCAAuC,IAAI,mBAAmB,SAAS;AAAA,QACvE,wCAAwC,IAAI,mBAAmB,UAAU;AAAA,QACzE,4CAA4C,IAAI,wBAAwB,SAAS;AAAA,QACjF,6CAA6C,IAAI,wBAAwB,UAAU;AAAA,QACnF,oBAAoB,KAAK,cAAc,OAAO,eAAe;AAAA,QAC7D,qBAAqB,KAAK,cAAc,OAAO,gBAAgB;AAAA,MAAA;AAAA,IAChE,EAIA,QAAQ,EAAE;AACZ,QAAI,CAAC,QAAQ;AACZ,YAAM,IAAI,MAAM,yBAAyB;AAAA,IAC1C;AAAA,EACD;AACD;;"}
@@ -8,8 +8,8 @@ class UpdateConfigurationCommand {
8
8
  const rl = this.configuration.rateLimits;
9
9
  let captchaSecretCol;
10
10
  let captchaSecretVersionCol;
11
- if (captcha?.secret !== void 0) {
12
- if (captcha.secret === "" || captcha.secret === null) {
11
+ if (captcha?.secret !== void 0 && captcha.secret !== null) {
12
+ if (captcha.secret === "") {
13
13
  captchaSecretCol = null;
14
14
  captchaSecretVersionCol = null;
15
15
  } else {
@@ -64,7 +64,9 @@ class UpdateConfigurationCommand {
64
64
  rate_limit_email_otp_per_person_limit: rl?.emailOtpPerPerson?.limit ?? void 0,
65
65
  rate_limit_email_otp_per_person_window: rl?.emailOtpPerPerson?.window ?? void 0,
66
66
  rate_limit_email_verification_per_ip_limit: rl?.emailVerificationPerIp?.limit ?? void 0,
67
- rate_limit_email_verification_per_ip_window: rl?.emailVerificationPerIp?.window ?? void 0
67
+ rate_limit_email_verification_per_ip_window: rl?.emailVerificationPerIp?.window ?? void 0,
68
+ panel_global_roles: this.configuration.panel?.globalRoles ?? void 0,
69
+ panel_project_roles: this.configuration.panel?.projectRoles ?? void 0
68
70
  }
69
71
  ).execute(db);
70
72
  if (!result) {