@contember/engine-tenant-api 2.0.0-alpha.9 → 2.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/development/index.cjs +18 -6
- package/dist/development/index.cjs.map +1 -1
- package/dist/development/index.js +20 -8
- package/dist/development/index.js.map +1 -1
- package/dist/development/src/TenantContainer.cjs +7 -1
- package/dist/development/src/TenantContainer.cjs.map +1 -1
- package/dist/development/src/TenantContainer.js +7 -1
- package/dist/development/src/TenantContainer.js.map +1 -1
- package/dist/development/src/bridges/system/IdentityFetcher.cjs.map +1 -1
- package/dist/development/src/bridges/system/IdentityFetcher.js.map +1 -1
- package/dist/development/src/exceptions.cjs.map +1 -1
- package/dist/development/src/exceptions.js.map +1 -1
- package/dist/development/src/migrations/2024-08-26-120000-passwordless.cjs +31 -0
- package/dist/development/src/migrations/2024-08-26-120000-passwordless.cjs.map +1 -0
- package/dist/development/src/migrations/2024-08-26-120000-passwordless.js +32 -0
- package/dist/development/src/migrations/2024-08-26-120000-passwordless.js.map +1 -0
- package/dist/development/src/migrations/runner.cjs +3 -1
- package/dist/development/src/migrations/runner.cjs.map +1 -1
- package/dist/development/src/migrations/runner.js +3 -1
- package/dist/development/src/migrations/runner.js.map +1 -1
- package/dist/development/src/migrations/snapshot.cjs +33 -5
- package/dist/development/src/migrations/snapshot.cjs.map +1 -1
- package/dist/development/src/migrations/snapshot.js +33 -5
- package/dist/development/src/migrations/snapshot.js.map +1 -1
- package/dist/development/src/migrations/tenantCredentials.cjs.map +1 -1
- package/dist/development/src/migrations/tenantCredentials.js.map +1 -1
- package/dist/development/src/model/authorization/AclSchemaAccessNodeFactory.cjs.map +1 -1
- package/dist/development/src/model/authorization/AclSchemaAccessNodeFactory.js.map +1 -1
- package/dist/development/src/model/authorization/DirectPermissionsAccessNode.cjs.map +1 -1
- package/dist/development/src/model/authorization/DirectPermissionsAccessNode.js.map +1 -1
- package/dist/development/src/model/authorization/Identity.cjs.map +1 -1
- package/dist/development/src/model/authorization/Identity.js.map +1 -1
- package/dist/development/src/model/authorization/IdentityFactory.cjs.map +1 -1
- package/dist/development/src/model/authorization/IdentityFactory.js.map +1 -1
- package/dist/development/src/model/authorization/IdentityScope.cjs.map +1 -1
- package/dist/development/src/model/authorization/IdentityScope.js.map +1 -1
- package/dist/development/src/model/authorization/MembershipMatcher.cjs.map +1 -1
- package/dist/development/src/model/authorization/MembershipMatcher.js.map +1 -1
- package/dist/development/src/model/authorization/PermissionActions.cjs +5 -0
- package/dist/development/src/model/authorization/PermissionActions.cjs.map +1 -1
- package/dist/development/src/model/authorization/PermissionActions.js +5 -0
- package/dist/development/src/model/authorization/PermissionActions.js.map +1 -1
- package/dist/development/src/model/authorization/PermissionContext.cjs.map +1 -1
- package/dist/development/src/model/authorization/PermissionContext.js.map +1 -1
- package/dist/development/src/model/authorization/PermissionContextFactory.cjs.map +1 -1
- package/dist/development/src/model/authorization/PermissionContextFactory.js.map +1 -1
- package/dist/development/src/model/authorization/PermissionsFactory.cjs +5 -0
- package/dist/development/src/model/authorization/PermissionsFactory.cjs.map +1 -1
- package/dist/development/src/model/authorization/PermissionsFactory.js +5 -0
- package/dist/development/src/model/authorization/PermissionsFactory.js.map +1 -1
- package/dist/development/src/model/authorization/ProjectScope.cjs.map +1 -1
- package/dist/development/src/model/authorization/ProjectScope.js.map +1 -1
- package/dist/development/src/model/authorization/ProjectScopeFactory.cjs.map +1 -1
- package/dist/development/src/model/authorization/ProjectScopeFactory.js.map +1 -1
- package/dist/development/src/model/commands/CommandBus.cjs.map +1 -1
- package/dist/development/src/model/commands/CommandBus.js.map +1 -1
- package/dist/development/src/model/commands/apiKey/ApiKeyHelper.cjs.map +1 -1
- package/dist/development/src/model/commands/apiKey/ApiKeyHelper.js.map +1 -1
- package/dist/development/src/model/commands/apiKey/CreateApiKeyCommand.cjs.map +1 -1
- package/dist/development/src/model/commands/apiKey/CreateApiKeyCommand.js.map +1 -1
- package/dist/development/src/model/commands/apiKey/DisableApiKeyCommand.cjs.map +1 -1
- package/dist/development/src/model/commands/apiKey/DisableApiKeyCommand.js.map +1 -1
- package/dist/development/src/model/commands/apiKey/DisableIdentityApiKeysCommand.cjs.map +1 -1
- package/dist/development/src/model/commands/apiKey/DisableIdentityApiKeysCommand.js.map +1 -1
- package/dist/development/src/model/commands/apiKey/DisableOneOffApiKeyCommand.cjs.map +1 -1
- package/dist/development/src/model/commands/apiKey/DisableOneOffApiKeyCommand.js.map +1 -1
- package/dist/development/src/model/commands/apiKey/ProlongApiKeyCommand.cjs.map +1 -1
- package/dist/development/src/model/commands/apiKey/ProlongApiKeyCommand.js.map +1 -1
- package/dist/development/src/model/commands/configuration/UpdateConfigurationCommand.cjs +20 -0
- package/dist/development/src/model/commands/configuration/UpdateConfigurationCommand.cjs.map +1 -0
- package/dist/development/src/model/commands/configuration/UpdateConfigurationCommand.js +20 -0
- package/dist/development/src/model/commands/configuration/UpdateConfigurationCommand.js.map +1 -0
- package/dist/development/src/model/commands/identity/CreateIdentityCommand.cjs.map +1 -1
- package/dist/development/src/model/commands/identity/CreateIdentityCommand.js.map +1 -1
- package/dist/development/src/model/commands/identity/PatchIdentityGlobalRoles.cjs.map +1 -1
- package/dist/development/src/model/commands/identity/PatchIdentityGlobalRoles.js.map +1 -1
- package/dist/development/src/model/commands/idp/CreateIdpCommand.cjs.map +1 -1
- package/dist/development/src/model/commands/idp/CreateIdpCommand.js.map +1 -1
- package/dist/development/src/model/commands/idp/DisableIdpCommand.cjs.map +1 -1
- package/dist/development/src/model/commands/idp/DisableIdpCommand.js.map +1 -1
- package/dist/development/src/model/commands/idp/EnableIdpCommand.cjs.map +1 -1
- package/dist/development/src/model/commands/idp/EnableIdpCommand.js.map +1 -1
- package/dist/development/src/model/commands/idp/UpdateIdpCommand.cjs.map +1 -1
- package/dist/development/src/model/commands/idp/UpdateIdpCommand.js.map +1 -1
- package/dist/development/src/model/commands/mailTemplate/AddMailTemplateCommand.cjs.map +1 -1
- package/dist/development/src/model/commands/mailTemplate/AddMailTemplateCommand.js.map +1 -1
- package/dist/development/src/model/commands/mailTemplate/RemoveMailTemplateCommand.cjs.map +1 -1
- package/dist/development/src/model/commands/mailTemplate/RemoveMailTemplateCommand.js.map +1 -1
- package/dist/development/src/model/commands/membership/AddProjectMemberCommand.cjs.map +1 -1
- package/dist/development/src/model/commands/membership/AddProjectMemberCommand.js.map +1 -1
- package/dist/development/src/model/commands/membership/CreateOrUpdateProjectMembershipCommand.cjs.map +1 -1
- package/dist/development/src/model/commands/membership/CreateOrUpdateProjectMembershipCommand.js.map +1 -1
- package/dist/development/src/model/commands/membership/RemoveProjectMemberCommand.cjs.map +1 -1
- package/dist/development/src/model/commands/membership/RemoveProjectMemberCommand.js.map +1 -1
- package/dist/development/src/model/commands/membership/RemoveProjectMembershipsCommand.cjs.map +1 -1
- package/dist/development/src/model/commands/membership/RemoveProjectMembershipsCommand.js.map +1 -1
- package/dist/development/src/model/commands/membership/UpdateProjectMemberCommand.cjs.map +1 -1
- package/dist/development/src/model/commands/membership/UpdateProjectMemberCommand.js.map +1 -1
- package/dist/development/src/model/commands/membership/variables/PatchProjectMembershipVariableValuesCommand.cjs.map +1 -1
- package/dist/development/src/model/commands/membership/variables/PatchProjectMembershipVariableValuesCommand.js.map +1 -1
- package/dist/development/src/model/commands/membership/variables/PatchProjectMembershipVariablesCommand.cjs.map +1 -1
- package/dist/development/src/model/commands/membership/variables/PatchProjectMembershipVariablesCommand.js.map +1 -1
- package/dist/development/src/model/commands/membership/variables/SetProjectMembershipVariableValuesCommand.cjs.map +1 -1
- package/dist/development/src/model/commands/membership/variables/SetProjectMembershipVariableValuesCommand.js.map +1 -1
- package/dist/development/src/model/commands/otp/ConfirmOtpCommand.cjs.map +1 -1
- package/dist/development/src/model/commands/otp/ConfirmOtpCommand.js.map +1 -1
- package/dist/development/src/model/commands/otp/DisableOtpCommand.cjs.map +1 -1
- package/dist/development/src/model/commands/otp/DisableOtpCommand.js.map +1 -1
- package/dist/development/src/model/commands/otp/PrepareOtpCommand.cjs.map +1 -1
- package/dist/development/src/model/commands/otp/PrepareOtpCommand.js.map +1 -1
- package/dist/development/src/model/commands/person/ChangePasswordCommand.cjs.map +1 -1
- package/dist/development/src/model/commands/person/ChangePasswordCommand.js.map +1 -1
- package/dist/development/src/model/commands/person/ChangeProfileCommand.cjs.map +1 -1
- package/dist/development/src/model/commands/person/ChangeProfileCommand.js.map +1 -1
- package/dist/development/src/model/commands/person/CreatePersonCommand.cjs +2 -1
- package/dist/development/src/model/commands/person/CreatePersonCommand.cjs.map +1 -1
- package/dist/development/src/model/commands/person/CreatePersonCommand.js +2 -1
- package/dist/development/src/model/commands/person/CreatePersonCommand.js.map +1 -1
- package/dist/development/src/model/commands/person/CreatePersonIdentityProviderIdentifierCommand.cjs.map +1 -1
- package/dist/development/src/model/commands/person/CreatePersonIdentityProviderIdentifierCommand.js.map +1 -1
- package/dist/development/src/model/commands/person/DisablePersonCommand.cjs.map +1 -1
- package/dist/development/src/model/commands/person/DisablePersonCommand.js.map +1 -1
- package/dist/development/src/model/commands/person/TogglePersonPasswordlessCommand.cjs +18 -0
- package/dist/development/src/model/commands/person/TogglePersonPasswordlessCommand.cjs.map +1 -0
- package/dist/development/src/model/commands/person/TogglePersonPasswordlessCommand.js +18 -0
- package/dist/development/src/model/commands/person/TogglePersonPasswordlessCommand.js.map +1 -0
- package/dist/development/src/model/commands/personToken/ActivateOtpCommand.cjs +20 -0
- package/dist/development/src/model/commands/personToken/ActivateOtpCommand.cjs.map +1 -0
- package/dist/development/src/model/commands/personToken/ActivateOtpCommand.js +20 -0
- package/dist/development/src/model/commands/personToken/ActivateOtpCommand.js.map +1 -0
- package/dist/development/src/model/commands/personToken/CreatePersonTokenCommand.cjs +33 -0
- package/dist/development/src/model/commands/personToken/CreatePersonTokenCommand.cjs.map +1 -0
- package/dist/development/src/model/commands/personToken/CreatePersonTokenCommand.js +33 -0
- package/dist/development/src/model/commands/personToken/CreatePersonTokenCommand.js.map +1 -0
- package/dist/development/src/model/commands/personToken/IncreaseOtpAttemptCommand.cjs +19 -0
- package/dist/development/src/model/commands/personToken/IncreaseOtpAttemptCommand.cjs.map +1 -0
- package/dist/development/src/model/commands/personToken/IncreaseOtpAttemptCommand.js +19 -0
- package/dist/development/src/model/commands/personToken/IncreaseOtpAttemptCommand.js.map +1 -0
- package/dist/development/src/model/commands/personToken/InvalidateTokenCommand.cjs +19 -0
- package/dist/development/src/model/commands/personToken/InvalidateTokenCommand.cjs.map +1 -0
- package/dist/development/src/model/commands/personToken/InvalidateTokenCommand.js +19 -0
- package/dist/development/src/model/commands/personToken/InvalidateTokenCommand.js.map +1 -0
- package/dist/development/src/model/commands/personToken/ResetPasswordCommand.cjs +28 -0
- package/dist/development/src/model/commands/personToken/ResetPasswordCommand.cjs.map +1 -0
- package/dist/development/src/model/commands/personToken/ResetPasswordCommand.js +28 -0
- package/dist/development/src/model/commands/personToken/ResetPasswordCommand.js.map +1 -0
- package/dist/development/src/model/commands/personToken/SavePersonTokenCommand.cjs +28 -0
- package/dist/development/src/model/commands/personToken/SavePersonTokenCommand.cjs.map +1 -0
- package/dist/development/src/model/commands/personToken/SavePersonTokenCommand.js +28 -0
- package/dist/development/src/model/commands/personToken/SavePersonTokenCommand.js.map +1 -0
- package/dist/development/src/model/commands/project/CreateProjectCommand.cjs.map +1 -1
- package/dist/development/src/model/commands/project/CreateProjectCommand.js.map +1 -1
- package/dist/development/src/model/commands/project/SetProjectSecretCommand.cjs.map +1 -1
- package/dist/development/src/model/commands/project/SetProjectSecretCommand.js.map +1 -1
- package/dist/development/src/model/commands/project/UpdateProjectCommand.cjs.map +1 -1
- package/dist/development/src/model/commands/project/UpdateProjectCommand.js.map +1 -1
- package/dist/development/src/model/consts/expirations.cjs +7 -0
- package/dist/development/src/model/consts/expirations.cjs.map +1 -0
- package/dist/development/src/model/consts/expirations.js +7 -0
- package/dist/development/src/model/consts/expirations.js.map +1 -0
- package/dist/development/src/model/dtos/Password.cjs.map +1 -1
- package/dist/development/src/model/dtos/Password.js.map +1 -1
- package/dist/development/src/model/mailing/UserMailer.cjs +10 -1
- package/dist/development/src/model/mailing/UserMailer.cjs.map +1 -1
- package/dist/development/src/model/mailing/UserMailer.js +10 -1
- package/dist/development/src/model/mailing/UserMailer.js.map +1 -1
- package/dist/development/src/model/mailing/templates/ExistingUserInvited.mustache.cjs.map +1 -1
- package/dist/development/src/model/mailing/templates/ExistingUserInvited.mustache.js.map +1 -1
- package/dist/development/src/model/mailing/templates/NewUserInvited.mustache.cjs.map +1 -1
- package/dist/development/src/model/mailing/templates/NewUserInvited.mustache.js.map +1 -1
- package/dist/development/src/model/mailing/templates/PasswordReset.mustache.cjs.map +1 -1
- package/dist/development/src/model/mailing/templates/PasswordReset.mustache.js.map +1 -1
- package/dist/development/src/model/mailing/templates/PasswordlessSignIn.mustache.cjs +17 -0
- package/dist/development/src/model/mailing/templates/PasswordlessSignIn.mustache.cjs.map +1 -0
- package/dist/development/src/model/mailing/templates/PasswordlessSignIn.mustache.js +18 -0
- package/dist/development/src/model/mailing/templates/PasswordlessSignIn.mustache.js.map +1 -0
- package/dist/development/src/model/mailing/type.cjs +9 -3
- package/dist/development/src/model/mailing/type.cjs.map +1 -1
- package/dist/development/src/model/mailing/type.js +9 -3
- package/dist/development/src/model/mailing/type.js.map +1 -1
- package/dist/development/src/model/queries/apiKey/ApiKeyQuery.cjs.map +1 -1
- package/dist/development/src/model/queries/apiKey/ApiKeyQuery.js.map +1 -1
- package/dist/development/src/model/queries/configuration/ConfigurationQuery.cjs +21 -0
- package/dist/development/src/model/queries/configuration/ConfigurationQuery.cjs.map +1 -0
- package/dist/development/src/model/queries/configuration/ConfigurationQuery.js +21 -0
- package/dist/development/src/model/queries/configuration/ConfigurationQuery.js.map +1 -0
- package/dist/development/src/model/queries/identity/IdentityQuery.cjs.map +1 -1
- package/dist/development/src/model/queries/identity/IdentityQuery.js.map +1 -1
- package/dist/development/src/model/queries/idp/IdentityProviderBySlugQuery.cjs.map +1 -1
- package/dist/development/src/model/queries/idp/IdentityProviderBySlugQuery.js.map +1 -1
- package/dist/development/src/model/queries/idp/IdentityProvidersQuery.cjs.map +1 -1
- package/dist/development/src/model/queries/idp/IdentityProvidersQuery.js.map +1 -1
- package/dist/development/src/model/queries/idp/helpers.cjs.map +1 -1
- package/dist/development/src/model/queries/idp/helpers.js.map +1 -1
- package/dist/development/src/model/queries/mailTemplate/MailTemplateListQuery.cjs.map +1 -1
- package/dist/development/src/model/queries/mailTemplate/MailTemplateListQuery.js.map +1 -1
- package/dist/development/src/model/queries/mailTemplate/MailTemplateQuery.cjs.map +1 -1
- package/dist/development/src/model/queries/mailTemplate/MailTemplateQuery.js.map +1 -1
- package/dist/development/src/model/queries/membership/ProjectMembersQuery.cjs.map +1 -1
- package/dist/development/src/model/queries/membership/ProjectMembersQuery.js.map +1 -1
- package/dist/development/src/model/queries/membership/ProjectMembershipByIdentityQuery.cjs.map +1 -1
- package/dist/development/src/model/queries/membership/ProjectMembershipByIdentityQuery.js.map +1 -1
- package/dist/development/src/model/queries/membership/ProjectRolesByIdentityQuery.cjs.map +1 -1
- package/dist/development/src/model/queries/membership/ProjectRolesByIdentityQuery.js.map +1 -1
- package/dist/development/src/model/queries/membership/ProjectSlugSpecification.cjs.map +1 -1
- package/dist/development/src/model/queries/membership/ProjectSlugSpecification.js.map +1 -1
- package/dist/development/src/model/queries/person/PersonByIdPQuery.cjs.map +1 -1
- package/dist/development/src/model/queries/person/PersonByIdPQuery.js.map +1 -1
- package/dist/development/src/model/queries/person/PersonByIdentityBatchQuery.cjs.map +1 -1
- package/dist/development/src/model/queries/person/PersonByIdentityBatchQuery.js.map +1 -1
- package/dist/development/src/model/queries/person/PersonQuery.cjs.map +1 -1
- package/dist/development/src/model/queries/person/PersonQuery.js.map +1 -1
- package/dist/development/src/model/queries/person/PersonQueryBuilderFactory.cjs +1 -1
- package/dist/development/src/model/queries/person/PersonQueryBuilderFactory.cjs.map +1 -1
- package/dist/development/src/model/queries/person/PersonQueryBuilderFactory.js +1 -1
- package/dist/development/src/model/queries/person/PersonQueryBuilderFactory.js.map +1 -1
- package/dist/development/src/model/queries/personToken/PersonTokenQuery.cjs +29 -0
- package/dist/development/src/model/queries/personToken/PersonTokenQuery.cjs.map +1 -0
- package/dist/development/src/model/queries/personToken/PersonTokenQuery.js +29 -0
- package/dist/development/src/model/queries/personToken/PersonTokenQuery.js.map +1 -0
- package/dist/development/src/model/queries/project/ProjectBySlugQuery.cjs.map +1 -1
- package/dist/development/src/model/queries/project/ProjectBySlugQuery.js.map +1 -1
- package/dist/development/src/model/queries/project/ProjectSecretsQuery.cjs.map +1 -1
- package/dist/development/src/model/queries/project/ProjectSecretsQuery.js.map +1 -1
- package/dist/development/src/model/queries/project/ProjectUpdateTimestampQuery.cjs.map +1 -1
- package/dist/development/src/model/queries/project/ProjectUpdateTimestampQuery.js.map +1 -1
- package/dist/development/src/model/queries/project/ProjectsByIdentityQuery.cjs.map +1 -1
- package/dist/development/src/model/queries/project/ProjectsByIdentityQuery.js.map +1 -1
- package/dist/development/src/model/queries/project/ProjectsQuery.cjs.map +1 -1
- package/dist/development/src/model/queries/project/ProjectsQuery.js.map +1 -1
- package/dist/development/src/model/service/ConfigurationManager.cjs +27 -0
- package/dist/development/src/model/service/ConfigurationManager.cjs.map +1 -0
- package/dist/development/src/model/service/ConfigurationManager.js +27 -0
- package/dist/development/src/model/service/ConfigurationManager.js.map +1 -0
- package/dist/development/src/model/service/EmailValidator.cjs.map +1 -1
- package/dist/development/src/model/service/EmailValidator.js.map +1 -1
- package/dist/development/src/model/service/IDPSignInManager.cjs +1 -1
- package/dist/development/src/model/service/IDPSignInManager.cjs.map +1 -1
- package/dist/development/src/model/service/IDPSignInManager.js +1 -1
- package/dist/development/src/model/service/IDPSignInManager.js.map +1 -1
- package/dist/development/src/model/service/InviteManager.cjs +7 -7
- package/dist/development/src/model/service/InviteManager.cjs.map +1 -1
- package/dist/development/src/model/service/InviteManager.js +6 -6
- package/dist/development/src/model/service/InviteManager.js.map +1 -1
- package/dist/development/src/model/service/MailTemplateManager.cjs.map +1 -1
- package/dist/development/src/model/service/MailTemplateManager.js.map +1 -1
- package/dist/development/src/model/service/MembershipValidator.cjs.map +1 -1
- package/dist/development/src/model/service/MembershipValidator.js.map +1 -1
- package/dist/development/src/model/service/OtpAuthenticator.cjs.map +1 -1
- package/dist/development/src/model/service/OtpAuthenticator.js.map +1 -1
- package/dist/development/src/model/service/OtpManager.cjs.map +1 -1
- package/dist/development/src/model/service/OtpManager.js.map +1 -1
- package/dist/development/src/model/service/PasswordChangeManager.cjs +1 -1
- package/dist/development/src/model/service/PasswordChangeManager.cjs.map +1 -1
- package/dist/development/src/model/service/PasswordChangeManager.js +1 -1
- package/dist/development/src/model/service/PasswordChangeManager.js.map +1 -1
- package/dist/development/src/model/service/PasswordResetManager.cjs +7 -15
- package/dist/development/src/model/service/PasswordResetManager.cjs.map +1 -1
- package/dist/development/src/model/service/PasswordResetManager.js +7 -15
- package/dist/development/src/model/service/PasswordResetManager.js.map +1 -1
- package/dist/development/src/model/service/PasswordlessSignInManager.cjs +135 -0
- package/dist/development/src/model/service/PasswordlessSignInManager.cjs.map +1 -0
- package/dist/development/src/model/service/PasswordlessSignInManager.js +135 -0
- package/dist/development/src/model/service/PasswordlessSignInManager.js.map +1 -0
- package/dist/development/src/model/service/PersonAccessManager.cjs.map +1 -1
- package/dist/development/src/model/service/PersonAccessManager.js.map +1 -1
- package/dist/development/src/model/service/PersonManager.cjs +7 -0
- package/dist/development/src/model/service/PersonManager.cjs.map +1 -1
- package/dist/development/src/model/service/PersonManager.js +7 -0
- package/dist/development/src/model/service/PersonManager.js.map +1 -1
- package/dist/development/src/model/service/ProjectManager.cjs +2 -2
- package/dist/development/src/model/service/ProjectManager.cjs.map +1 -1
- package/dist/development/src/model/service/ProjectManager.js +2 -2
- package/dist/development/src/model/service/ProjectManager.js.map +1 -1
- package/dist/development/src/model/service/ProjectMemberManager.cjs.map +1 -1
- package/dist/development/src/model/service/ProjectMemberManager.js.map +1 -1
- package/dist/development/src/model/service/RolesManager.cjs +1 -1
- package/dist/development/src/model/service/RolesManager.cjs.map +1 -1
- package/dist/development/src/model/service/RolesManager.js +1 -1
- package/dist/development/src/model/service/RolesManager.js.map +1 -1
- package/dist/development/src/model/service/SecretsManager.cjs.map +1 -1
- package/dist/development/src/model/service/SecretsManager.js.map +1 -1
- package/dist/development/src/model/service/SignInManager.cjs.map +1 -1
- package/dist/development/src/model/service/SignInManager.js.map +1 -1
- package/dist/development/src/model/service/SignUpManager.cjs +1 -1
- package/dist/development/src/model/service/SignUpManager.cjs.map +1 -1
- package/dist/development/src/model/service/SignUpManager.js +1 -1
- package/dist/development/src/model/service/SignUpManager.js.map +1 -1
- package/dist/development/src/model/service/apiKey/ApiKeyManager.cjs.map +1 -1
- package/dist/development/src/model/service/apiKey/ApiKeyManager.js.map +1 -1
- package/dist/development/src/model/service/apiKey/ApiKeyService.cjs.map +1 -1
- package/dist/development/src/model/service/apiKey/ApiKeyService.js.map +1 -1
- package/dist/development/src/model/service/helpers/getPreferredProject.cjs +13 -0
- package/dist/development/src/model/service/helpers/getPreferredProject.cjs.map +1 -0
- package/dist/development/src/model/service/helpers/getPreferredProject.js +13 -0
- package/dist/development/src/model/service/helpers/getPreferredProject.js.map +1 -0
- package/dist/development/src/model/service/idp/IDPHandlerRegistry.cjs.map +1 -1
- package/dist/development/src/model/service/idp/IDPHandlerRegistry.js.map +1 -1
- package/dist/development/src/model/service/idp/IDPManager.cjs.map +1 -1
- package/dist/development/src/model/service/idp/IDPManager.js.map +1 -1
- package/dist/development/src/model/service/idp/IDPResponseError.cjs.map +1 -1
- package/dist/development/src/model/service/idp/IDPResponseError.js.map +1 -1
- package/dist/development/src/model/service/idp/IDPValidationError.cjs.map +1 -1
- package/dist/development/src/model/service/idp/IDPValidationError.js.map +1 -1
- package/dist/development/src/model/service/idp/IdentityProviderNotFoundError.cjs.map +1 -1
- package/dist/development/src/model/service/idp/IdentityProviderNotFoundError.js.map +1 -1
- package/dist/development/src/model/service/idp/InvalidIDPConfigurationError.cjs.map +1 -1
- package/dist/development/src/model/service/idp/InvalidIDPConfigurationError.js.map +1 -1
- package/dist/development/src/model/service/idp/providers/AppleProvider.cjs +1 -1
- package/dist/development/src/model/service/idp/providers/AppleProvider.cjs.map +1 -1
- package/dist/development/src/model/service/idp/providers/AppleProvider.js +1 -1
- package/dist/development/src/model/service/idp/providers/AppleProvider.js.map +1 -1
- package/dist/development/src/model/service/idp/providers/FacebookProvider.cjs +1 -1
- package/dist/development/src/model/service/idp/providers/FacebookProvider.cjs.map +1 -1
- package/dist/development/src/model/service/idp/providers/FacebookProvider.js +1 -1
- package/dist/development/src/model/service/idp/providers/FacebookProvider.js.map +1 -1
- package/dist/development/src/model/service/idp/providers/OIDCHelpers.cjs +9 -5
- package/dist/development/src/model/service/idp/providers/OIDCHelpers.cjs.map +1 -1
- package/dist/development/src/model/service/idp/providers/OIDCHelpers.js +9 -5
- package/dist/development/src/model/service/idp/providers/OIDCHelpers.js.map +1 -1
- package/dist/development/src/model/service/idp/providers/OIDCProvider.cjs +9 -3
- package/dist/development/src/model/service/idp/providers/OIDCProvider.cjs.map +1 -1
- package/dist/development/src/model/service/idp/providers/OIDCProvider.js +9 -3
- package/dist/development/src/model/service/idp/providers/OIDCProvider.js.map +1 -1
- package/dist/development/src/model/service/idp/providers/OIDCTypes.cjs +6 -1
- package/dist/development/src/model/service/idp/providers/OIDCTypes.cjs.map +1 -1
- package/dist/development/src/model/service/idp/providers/OIDCTypes.js +6 -1
- package/dist/development/src/model/service/idp/providers/OIDCTypes.js.map +1 -1
- package/dist/development/src/model/service/idp/providers/helpers.cjs.map +1 -1
- package/dist/development/src/model/service/idp/providers/helpers.js.map +1 -1
- package/dist/development/src/model/service/membershipUtils.cjs.map +1 -1
- package/dist/development/src/model/service/membershipUtils.js.map +1 -1
- package/dist/development/src/model/type/ApiKey.cjs.map +1 -1
- package/dist/development/src/model/type/ApiKey.js.map +1 -1
- package/dist/development/src/model/utils/DatabaseContext.cjs.map +1 -1
- package/dist/development/src/model/utils/DatabaseContext.js.map +1 -1
- package/dist/development/src/model/utils/Response.cjs.map +1 -1
- package/dist/development/src/model/utils/Response.js.map +1 -1
- package/dist/development/src/model/utils/password.cjs.map +1 -1
- package/dist/development/src/model/utils/password.js.map +1 -1
- package/dist/development/src/model/utils/tokenUtils.cjs +39 -0
- package/dist/development/src/model/utils/tokenUtils.cjs.map +1 -1
- package/dist/development/src/model/utils/tokenUtils.js +40 -1
- package/dist/development/src/model/utils/tokenUtils.js.map +1 -1
- package/dist/development/src/resolvers/ResolverFactory.cjs +8 -1
- package/dist/development/src/resolvers/ResolverFactory.cjs.map +1 -1
- package/dist/development/src/resolvers/ResolverFactory.js +8 -1
- package/dist/development/src/resolvers/ResolverFactory.js.map +1 -1
- package/dist/development/src/resolvers/TenantResolverContextFactory.cjs.map +1 -1
- package/dist/development/src/resolvers/TenantResolverContextFactory.js.map +1 -1
- package/dist/development/src/resolvers/errorUtils.cjs.map +1 -1
- package/dist/development/src/resolvers/errorUtils.js.map +1 -1
- package/dist/development/src/resolvers/membershipUtils.cjs.map +1 -1
- package/dist/development/src/resolvers/membershipUtils.js.map +1 -1
- package/dist/development/src/resolvers/mutation/apiKey/CreateApiKeyMutationResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/mutation/apiKey/CreateApiKeyMutationResolver.js.map +1 -1
- package/dist/development/src/resolvers/mutation/apiKey/DisableApiKeyMutationResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/mutation/apiKey/DisableApiKeyMutationResolver.js.map +1 -1
- package/dist/development/src/resolvers/mutation/configuration/ConfigurationMutationResolver.cjs +41 -0
- package/dist/development/src/resolvers/mutation/configuration/ConfigurationMutationResolver.cjs.map +1 -0
- package/dist/development/src/resolvers/mutation/configuration/ConfigurationMutationResolver.js +41 -0
- package/dist/development/src/resolvers/mutation/configuration/ConfigurationMutationResolver.js.map +1 -0
- package/dist/development/src/resolvers/mutation/identity/GlobalRolesMutationResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/mutation/identity/GlobalRolesMutationResolver.js.map +1 -1
- package/dist/development/src/resolvers/mutation/idp/AddIDPMutationResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/mutation/idp/AddIDPMutationResolver.js.map +1 -1
- package/dist/development/src/resolvers/mutation/idp/DisableIDPMutationResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/mutation/idp/DisableIDPMutationResolver.js.map +1 -1
- package/dist/development/src/resolvers/mutation/idp/EnableIDPMutationResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/mutation/idp/EnableIDPMutationResolver.js.map +1 -1
- package/dist/development/src/resolvers/mutation/idp/UpdateIDPMutationResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/mutation/idp/UpdateIDPMutationResolver.js.map +1 -1
- package/dist/development/src/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.js.map +1 -1
- package/dist/development/src/resolvers/mutation/person/ChangePasswordMutationResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/mutation/person/ChangePasswordMutationResolver.js.map +1 -1
- package/dist/development/src/resolvers/mutation/person/ChangeProfileMutationResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/mutation/person/ChangeProfileMutationResolver.js.map +1 -1
- package/dist/development/src/resolvers/mutation/person/DisablePersonMutationResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/mutation/person/DisablePersonMutationResolver.js.map +1 -1
- package/dist/development/src/resolvers/mutation/person/IDPMutationResolver.cjs +4 -1
- package/dist/development/src/resolvers/mutation/person/IDPMutationResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/mutation/person/IDPMutationResolver.js +4 -1
- package/dist/development/src/resolvers/mutation/person/IDPMutationResolver.js.map +1 -1
- package/dist/development/src/resolvers/mutation/person/InviteMutationResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/mutation/person/InviteMutationResolver.js.map +1 -1
- package/dist/development/src/resolvers/mutation/person/OtpMutationResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/mutation/person/OtpMutationResolver.js.map +1 -1
- package/dist/development/src/resolvers/mutation/person/PasswordlessMutationResolver.cjs +83 -0
- package/dist/development/src/resolvers/mutation/person/PasswordlessMutationResolver.cjs.map +1 -0
- package/dist/development/src/resolvers/mutation/person/PasswordlessMutationResolver.js +83 -0
- package/dist/development/src/resolvers/mutation/person/PasswordlessMutationResolver.js.map +1 -0
- package/dist/development/src/resolvers/mutation/person/ResetPasswordMutationResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/mutation/person/ResetPasswordMutationResolver.js.map +1 -1
- package/dist/development/src/resolvers/mutation/person/SignInMutationResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/mutation/person/SignInMutationResolver.js.map +1 -1
- package/dist/development/src/resolvers/mutation/person/SignOutMutationResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/mutation/person/SignOutMutationResolver.js.map +1 -1
- package/dist/development/src/resolvers/mutation/person/SignUpMutationResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/mutation/person/SignUpMutationResolver.js.map +1 -1
- package/dist/development/src/resolvers/mutation/person/TogglePasswordlessMutationResolver.cjs +52 -0
- package/dist/development/src/resolvers/mutation/person/TogglePasswordlessMutationResolver.cjs.map +1 -0
- package/dist/development/src/resolvers/mutation/person/TogglePasswordlessMutationResolver.js +52 -0
- package/dist/development/src/resolvers/mutation/person/TogglePasswordlessMutationResolver.js.map +1 -0
- package/dist/development/src/resolvers/mutation/project/CreateProjectMutationResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/mutation/project/CreateProjectMutationResolver.js.map +1 -1
- package/dist/development/src/resolvers/mutation/project/SetProjectSecretMutationResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/mutation/project/SetProjectSecretMutationResolver.js.map +1 -1
- package/dist/development/src/resolvers/mutation/project/UpdateProjectMutationResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/mutation/project/UpdateProjectMutationResolver.js.map +1 -1
- package/dist/development/src/resolvers/mutation/projectMember/AddProjectMemberMutationResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/mutation/projectMember/AddProjectMemberMutationResolver.js.map +1 -1
- package/dist/development/src/resolvers/mutation/projectMember/RemoveProjectMemberMutationResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/mutation/projectMember/RemoveProjectMemberMutationResolver.js.map +1 -1
- package/dist/development/src/resolvers/mutation/projectMember/UpdateProjectMemberMutationResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/mutation/projectMember/UpdateProjectMemberMutationResolver.js.map +1 -1
- package/dist/development/src/resolvers/query/ConfigurationQueryResolver.cjs +34 -0
- package/dist/development/src/resolvers/query/ConfigurationQueryResolver.cjs.map +1 -0
- package/dist/development/src/resolvers/query/ConfigurationQueryResolver.js +34 -0
- package/dist/development/src/resolvers/query/ConfigurationQueryResolver.js.map +1 -0
- package/dist/development/src/resolvers/query/IDPQueryResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/query/IDPQueryResolver.js.map +1 -1
- package/dist/development/src/resolvers/query/MailTemplateQueryResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/query/MailTemplateQueryResolver.js.map +1 -1
- package/dist/development/src/resolvers/query/MeQueryResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/query/MeQueryResolver.js.map +1 -1
- package/dist/development/src/resolvers/query/PersonQueryResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/query/PersonQueryResolver.js.map +1 -1
- package/dist/development/src/resolvers/query/ProjectMembersQueryResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/query/ProjectMembersQueryResolver.js.map +1 -1
- package/dist/development/src/resolvers/query/ProjectQueryResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/query/ProjectQueryResolver.js.map +1 -1
- package/dist/development/src/resolvers/responseHelpers/PersonResponseFactory.cjs +1 -0
- package/dist/development/src/resolvers/responseHelpers/PersonResponseFactory.cjs.map +1 -1
- package/dist/development/src/resolvers/responseHelpers/PersonResponseFactory.js +1 -0
- package/dist/development/src/resolvers/responseHelpers/PersonResponseFactory.js.map +1 -1
- package/dist/development/src/resolvers/responseHelpers/SignInResponseFactory.cjs.map +1 -1
- package/dist/development/src/resolvers/responseHelpers/SignInResponseFactory.js.map +1 -1
- package/dist/development/src/resolvers/types/IdentityTypeResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/types/IdentityTypeResolver.js.map +1 -1
- package/dist/development/src/resolvers/types/ProjectTypeResolver.cjs.map +1 -1
- package/dist/development/src/resolvers/types/ProjectTypeResolver.js.map +1 -1
- package/dist/development/src/schema/tenant.graphql.cjs +162 -10
- package/dist/development/src/schema/tenant.graphql.cjs.map +1 -1
- package/dist/development/src/schema/tenant.graphql.js +162 -10
- package/dist/development/src/schema/tenant.graphql.js.map +1 -1
- package/dist/development/src/utils/Mailer.cjs.map +1 -1
- package/dist/development/src/utils/Mailer.js.map +1 -1
- package/dist/development/src/utils/TemplateRenderer.cjs.map +1 -1
- package/dist/development/src/utils/TemplateRenderer.js.map +1 -1
- package/dist/development/src/utils/array.cjs.map +1 -1
- package/dist/development/src/utils/array.js.map +1 -1
- package/dist/development/src/utils/batchQuery.cjs.map +1 -1
- package/dist/development/src/utils/batchQuery.js.map +1 -1
- package/dist/production/index.cjs +18 -6
- package/dist/production/index.cjs.map +1 -1
- package/dist/production/index.js +20 -8
- package/dist/production/index.js.map +1 -1
- package/dist/production/src/TenantContainer.cjs +7 -1
- package/dist/production/src/TenantContainer.cjs.map +1 -1
- package/dist/production/src/TenantContainer.js +7 -1
- package/dist/production/src/TenantContainer.js.map +1 -1
- package/dist/production/src/bridges/system/IdentityFetcher.cjs.map +1 -1
- package/dist/production/src/bridges/system/IdentityFetcher.js.map +1 -1
- package/dist/production/src/exceptions.cjs.map +1 -1
- package/dist/production/src/exceptions.js.map +1 -1
- package/dist/production/src/migrations/2024-08-26-120000-passwordless.cjs +31 -0
- package/dist/production/src/migrations/2024-08-26-120000-passwordless.cjs.map +1 -0
- package/dist/production/src/migrations/2024-08-26-120000-passwordless.js +32 -0
- package/dist/production/src/migrations/2024-08-26-120000-passwordless.js.map +1 -0
- package/dist/production/src/migrations/runner.cjs +3 -1
- package/dist/production/src/migrations/runner.cjs.map +1 -1
- package/dist/production/src/migrations/runner.js +3 -1
- package/dist/production/src/migrations/runner.js.map +1 -1
- package/dist/production/src/migrations/snapshot.cjs +33 -5
- package/dist/production/src/migrations/snapshot.cjs.map +1 -1
- package/dist/production/src/migrations/snapshot.js +33 -5
- package/dist/production/src/migrations/snapshot.js.map +1 -1
- package/dist/production/src/migrations/tenantCredentials.cjs.map +1 -1
- package/dist/production/src/migrations/tenantCredentials.js.map +1 -1
- package/dist/production/src/model/authorization/AclSchemaAccessNodeFactory.cjs.map +1 -1
- package/dist/production/src/model/authorization/AclSchemaAccessNodeFactory.js.map +1 -1
- package/dist/production/src/model/authorization/DirectPermissionsAccessNode.cjs.map +1 -1
- package/dist/production/src/model/authorization/DirectPermissionsAccessNode.js.map +1 -1
- package/dist/production/src/model/authorization/Identity.cjs.map +1 -1
- package/dist/production/src/model/authorization/Identity.js.map +1 -1
- package/dist/production/src/model/authorization/IdentityFactory.cjs.map +1 -1
- package/dist/production/src/model/authorization/IdentityFactory.js.map +1 -1
- package/dist/production/src/model/authorization/IdentityScope.cjs.map +1 -1
- package/dist/production/src/model/authorization/IdentityScope.js.map +1 -1
- package/dist/production/src/model/authorization/MembershipMatcher.cjs.map +1 -1
- package/dist/production/src/model/authorization/MembershipMatcher.js.map +1 -1
- package/dist/production/src/model/authorization/PermissionActions.cjs +5 -0
- package/dist/production/src/model/authorization/PermissionActions.cjs.map +1 -1
- package/dist/production/src/model/authorization/PermissionActions.js +5 -0
- package/dist/production/src/model/authorization/PermissionActions.js.map +1 -1
- package/dist/production/src/model/authorization/PermissionContext.cjs.map +1 -1
- package/dist/production/src/model/authorization/PermissionContext.js.map +1 -1
- package/dist/production/src/model/authorization/PermissionContextFactory.cjs.map +1 -1
- package/dist/production/src/model/authorization/PermissionContextFactory.js.map +1 -1
- package/dist/production/src/model/authorization/PermissionsFactory.cjs +5 -0
- package/dist/production/src/model/authorization/PermissionsFactory.cjs.map +1 -1
- package/dist/production/src/model/authorization/PermissionsFactory.js +5 -0
- package/dist/production/src/model/authorization/PermissionsFactory.js.map +1 -1
- package/dist/production/src/model/authorization/ProjectScope.cjs.map +1 -1
- package/dist/production/src/model/authorization/ProjectScope.js.map +1 -1
- package/dist/production/src/model/authorization/ProjectScopeFactory.cjs.map +1 -1
- package/dist/production/src/model/authorization/ProjectScopeFactory.js.map +1 -1
- package/dist/production/src/model/commands/CommandBus.cjs.map +1 -1
- package/dist/production/src/model/commands/CommandBus.js.map +1 -1
- package/dist/production/src/model/commands/apiKey/ApiKeyHelper.cjs.map +1 -1
- package/dist/production/src/model/commands/apiKey/ApiKeyHelper.js.map +1 -1
- package/dist/production/src/model/commands/apiKey/CreateApiKeyCommand.cjs.map +1 -1
- package/dist/production/src/model/commands/apiKey/CreateApiKeyCommand.js.map +1 -1
- package/dist/production/src/model/commands/apiKey/DisableApiKeyCommand.cjs.map +1 -1
- package/dist/production/src/model/commands/apiKey/DisableApiKeyCommand.js.map +1 -1
- package/dist/production/src/model/commands/apiKey/DisableIdentityApiKeysCommand.cjs.map +1 -1
- package/dist/production/src/model/commands/apiKey/DisableIdentityApiKeysCommand.js.map +1 -1
- package/dist/production/src/model/commands/apiKey/DisableOneOffApiKeyCommand.cjs.map +1 -1
- package/dist/production/src/model/commands/apiKey/DisableOneOffApiKeyCommand.js.map +1 -1
- package/dist/production/src/model/commands/apiKey/ProlongApiKeyCommand.cjs.map +1 -1
- package/dist/production/src/model/commands/apiKey/ProlongApiKeyCommand.js.map +1 -1
- package/dist/production/src/model/commands/configuration/UpdateConfigurationCommand.cjs +20 -0
- package/dist/production/src/model/commands/configuration/UpdateConfigurationCommand.cjs.map +1 -0
- package/dist/production/src/model/commands/configuration/UpdateConfigurationCommand.js +20 -0
- package/dist/production/src/model/commands/configuration/UpdateConfigurationCommand.js.map +1 -0
- package/dist/production/src/model/commands/identity/CreateIdentityCommand.cjs.map +1 -1
- package/dist/production/src/model/commands/identity/CreateIdentityCommand.js.map +1 -1
- package/dist/production/src/model/commands/identity/PatchIdentityGlobalRoles.cjs.map +1 -1
- package/dist/production/src/model/commands/identity/PatchIdentityGlobalRoles.js.map +1 -1
- package/dist/production/src/model/commands/idp/CreateIdpCommand.cjs.map +1 -1
- package/dist/production/src/model/commands/idp/CreateIdpCommand.js.map +1 -1
- package/dist/production/src/model/commands/idp/DisableIdpCommand.cjs.map +1 -1
- package/dist/production/src/model/commands/idp/DisableIdpCommand.js.map +1 -1
- package/dist/production/src/model/commands/idp/EnableIdpCommand.cjs.map +1 -1
- package/dist/production/src/model/commands/idp/EnableIdpCommand.js.map +1 -1
- package/dist/production/src/model/commands/idp/UpdateIdpCommand.cjs.map +1 -1
- package/dist/production/src/model/commands/idp/UpdateIdpCommand.js.map +1 -1
- package/dist/production/src/model/commands/mailTemplate/AddMailTemplateCommand.cjs.map +1 -1
- package/dist/production/src/model/commands/mailTemplate/AddMailTemplateCommand.js.map +1 -1
- package/dist/production/src/model/commands/mailTemplate/RemoveMailTemplateCommand.cjs.map +1 -1
- package/dist/production/src/model/commands/mailTemplate/RemoveMailTemplateCommand.js.map +1 -1
- package/dist/production/src/model/commands/membership/AddProjectMemberCommand.cjs.map +1 -1
- package/dist/production/src/model/commands/membership/AddProjectMemberCommand.js.map +1 -1
- package/dist/production/src/model/commands/membership/CreateOrUpdateProjectMembershipCommand.cjs.map +1 -1
- package/dist/production/src/model/commands/membership/CreateOrUpdateProjectMembershipCommand.js.map +1 -1
- package/dist/production/src/model/commands/membership/RemoveProjectMemberCommand.cjs.map +1 -1
- package/dist/production/src/model/commands/membership/RemoveProjectMemberCommand.js.map +1 -1
- package/dist/production/src/model/commands/membership/RemoveProjectMembershipsCommand.cjs.map +1 -1
- package/dist/production/src/model/commands/membership/RemoveProjectMembershipsCommand.js.map +1 -1
- package/dist/production/src/model/commands/membership/UpdateProjectMemberCommand.cjs.map +1 -1
- package/dist/production/src/model/commands/membership/UpdateProjectMemberCommand.js.map +1 -1
- package/dist/production/src/model/commands/membership/variables/PatchProjectMembershipVariableValuesCommand.cjs.map +1 -1
- package/dist/production/src/model/commands/membership/variables/PatchProjectMembershipVariableValuesCommand.js.map +1 -1
- package/dist/production/src/model/commands/membership/variables/PatchProjectMembershipVariablesCommand.cjs.map +1 -1
- package/dist/production/src/model/commands/membership/variables/PatchProjectMembershipVariablesCommand.js.map +1 -1
- package/dist/production/src/model/commands/membership/variables/SetProjectMembershipVariableValuesCommand.cjs.map +1 -1
- package/dist/production/src/model/commands/membership/variables/SetProjectMembershipVariableValuesCommand.js.map +1 -1
- package/dist/production/src/model/commands/otp/ConfirmOtpCommand.cjs.map +1 -1
- package/dist/production/src/model/commands/otp/ConfirmOtpCommand.js.map +1 -1
- package/dist/production/src/model/commands/otp/DisableOtpCommand.cjs.map +1 -1
- package/dist/production/src/model/commands/otp/DisableOtpCommand.js.map +1 -1
- package/dist/production/src/model/commands/otp/PrepareOtpCommand.cjs.map +1 -1
- package/dist/production/src/model/commands/otp/PrepareOtpCommand.js.map +1 -1
- package/dist/production/src/model/commands/person/ChangePasswordCommand.cjs.map +1 -1
- package/dist/production/src/model/commands/person/ChangePasswordCommand.js.map +1 -1
- package/dist/production/src/model/commands/person/ChangeProfileCommand.cjs.map +1 -1
- package/dist/production/src/model/commands/person/ChangeProfileCommand.js.map +1 -1
- package/dist/production/src/model/commands/person/CreatePersonCommand.cjs +2 -1
- package/dist/production/src/model/commands/person/CreatePersonCommand.cjs.map +1 -1
- package/dist/production/src/model/commands/person/CreatePersonCommand.js +2 -1
- package/dist/production/src/model/commands/person/CreatePersonCommand.js.map +1 -1
- package/dist/production/src/model/commands/person/CreatePersonIdentityProviderIdentifierCommand.cjs.map +1 -1
- package/dist/production/src/model/commands/person/CreatePersonIdentityProviderIdentifierCommand.js.map +1 -1
- package/dist/production/src/model/commands/person/DisablePersonCommand.cjs.map +1 -1
- package/dist/production/src/model/commands/person/DisablePersonCommand.js.map +1 -1
- package/dist/production/src/model/commands/person/TogglePersonPasswordlessCommand.cjs +18 -0
- package/dist/production/src/model/commands/person/TogglePersonPasswordlessCommand.cjs.map +1 -0
- package/dist/production/src/model/commands/person/TogglePersonPasswordlessCommand.js +18 -0
- package/dist/production/src/model/commands/person/TogglePersonPasswordlessCommand.js.map +1 -0
- package/dist/production/src/model/commands/personToken/ActivateOtpCommand.cjs +20 -0
- package/dist/production/src/model/commands/personToken/ActivateOtpCommand.cjs.map +1 -0
- package/dist/production/src/model/commands/personToken/ActivateOtpCommand.js +20 -0
- package/dist/production/src/model/commands/personToken/ActivateOtpCommand.js.map +1 -0
- package/dist/production/src/model/commands/personToken/CreatePersonTokenCommand.cjs +33 -0
- package/dist/production/src/model/commands/personToken/CreatePersonTokenCommand.cjs.map +1 -0
- package/dist/production/src/model/commands/personToken/CreatePersonTokenCommand.js +33 -0
- package/dist/production/src/model/commands/personToken/CreatePersonTokenCommand.js.map +1 -0
- package/dist/production/src/model/commands/personToken/IncreaseOtpAttemptCommand.cjs +19 -0
- package/dist/production/src/model/commands/personToken/IncreaseOtpAttemptCommand.cjs.map +1 -0
- package/dist/production/src/model/commands/personToken/IncreaseOtpAttemptCommand.js +19 -0
- package/dist/production/src/model/commands/personToken/IncreaseOtpAttemptCommand.js.map +1 -0
- package/dist/production/src/model/commands/personToken/InvalidateTokenCommand.cjs +19 -0
- package/dist/production/src/model/commands/personToken/InvalidateTokenCommand.cjs.map +1 -0
- package/dist/production/src/model/commands/personToken/InvalidateTokenCommand.js +19 -0
- package/dist/production/src/model/commands/personToken/InvalidateTokenCommand.js.map +1 -0
- package/dist/production/src/model/commands/personToken/ResetPasswordCommand.cjs +28 -0
- package/dist/production/src/model/commands/personToken/ResetPasswordCommand.cjs.map +1 -0
- package/dist/production/src/model/commands/personToken/ResetPasswordCommand.js +28 -0
- package/dist/production/src/model/commands/personToken/ResetPasswordCommand.js.map +1 -0
- package/dist/production/src/model/commands/personToken/SavePersonTokenCommand.cjs +28 -0
- package/dist/production/src/model/commands/personToken/SavePersonTokenCommand.cjs.map +1 -0
- package/dist/production/src/model/commands/personToken/SavePersonTokenCommand.js +28 -0
- package/dist/production/src/model/commands/personToken/SavePersonTokenCommand.js.map +1 -0
- package/dist/production/src/model/commands/project/CreateProjectCommand.cjs.map +1 -1
- package/dist/production/src/model/commands/project/CreateProjectCommand.js.map +1 -1
- package/dist/production/src/model/commands/project/SetProjectSecretCommand.cjs.map +1 -1
- package/dist/production/src/model/commands/project/SetProjectSecretCommand.js.map +1 -1
- package/dist/production/src/model/commands/project/UpdateProjectCommand.cjs.map +1 -1
- package/dist/production/src/model/commands/project/UpdateProjectCommand.js.map +1 -1
- package/dist/production/src/model/consts/expirations.cjs +7 -0
- package/dist/production/src/model/consts/expirations.cjs.map +1 -0
- package/dist/production/src/model/consts/expirations.js +7 -0
- package/dist/production/src/model/consts/expirations.js.map +1 -0
- package/dist/production/src/model/dtos/Password.cjs.map +1 -1
- package/dist/production/src/model/dtos/Password.js.map +1 -1
- package/dist/production/src/model/mailing/UserMailer.cjs +10 -1
- package/dist/production/src/model/mailing/UserMailer.cjs.map +1 -1
- package/dist/production/src/model/mailing/UserMailer.js +10 -1
- package/dist/production/src/model/mailing/UserMailer.js.map +1 -1
- package/dist/production/src/model/mailing/templates/ExistingUserInvited.mustache.cjs.map +1 -1
- package/dist/production/src/model/mailing/templates/ExistingUserInvited.mustache.js.map +1 -1
- package/dist/production/src/model/mailing/templates/NewUserInvited.mustache.cjs.map +1 -1
- package/dist/production/src/model/mailing/templates/NewUserInvited.mustache.js.map +1 -1
- package/dist/production/src/model/mailing/templates/PasswordReset.mustache.cjs.map +1 -1
- package/dist/production/src/model/mailing/templates/PasswordReset.mustache.js.map +1 -1
- package/dist/production/src/model/mailing/templates/PasswordlessSignIn.mustache.cjs +17 -0
- package/dist/production/src/model/mailing/templates/PasswordlessSignIn.mustache.cjs.map +1 -0
- package/dist/production/src/model/mailing/templates/PasswordlessSignIn.mustache.js +18 -0
- package/dist/production/src/model/mailing/templates/PasswordlessSignIn.mustache.js.map +1 -0
- package/dist/production/src/model/mailing/type.cjs +9 -3
- package/dist/production/src/model/mailing/type.cjs.map +1 -1
- package/dist/production/src/model/mailing/type.js +9 -3
- package/dist/production/src/model/mailing/type.js.map +1 -1
- package/dist/production/src/model/queries/apiKey/ApiKeyQuery.cjs.map +1 -1
- package/dist/production/src/model/queries/apiKey/ApiKeyQuery.js.map +1 -1
- package/dist/production/src/model/queries/configuration/ConfigurationQuery.cjs +21 -0
- package/dist/production/src/model/queries/configuration/ConfigurationQuery.cjs.map +1 -0
- package/dist/production/src/model/queries/configuration/ConfigurationQuery.js +21 -0
- package/dist/production/src/model/queries/configuration/ConfigurationQuery.js.map +1 -0
- package/dist/production/src/model/queries/identity/IdentityQuery.cjs.map +1 -1
- package/dist/production/src/model/queries/identity/IdentityQuery.js.map +1 -1
- package/dist/production/src/model/queries/idp/IdentityProviderBySlugQuery.cjs.map +1 -1
- package/dist/production/src/model/queries/idp/IdentityProviderBySlugQuery.js.map +1 -1
- package/dist/production/src/model/queries/idp/IdentityProvidersQuery.cjs.map +1 -1
- package/dist/production/src/model/queries/idp/IdentityProvidersQuery.js.map +1 -1
- package/dist/production/src/model/queries/idp/helpers.cjs.map +1 -1
- package/dist/production/src/model/queries/idp/helpers.js.map +1 -1
- package/dist/production/src/model/queries/mailTemplate/MailTemplateListQuery.cjs.map +1 -1
- package/dist/production/src/model/queries/mailTemplate/MailTemplateListQuery.js.map +1 -1
- package/dist/production/src/model/queries/mailTemplate/MailTemplateQuery.cjs.map +1 -1
- package/dist/production/src/model/queries/mailTemplate/MailTemplateQuery.js.map +1 -1
- package/dist/production/src/model/queries/membership/ProjectMembersQuery.cjs.map +1 -1
- package/dist/production/src/model/queries/membership/ProjectMembersQuery.js.map +1 -1
- package/dist/production/src/model/queries/membership/ProjectMembershipByIdentityQuery.cjs.map +1 -1
- package/dist/production/src/model/queries/membership/ProjectMembershipByIdentityQuery.js.map +1 -1
- package/dist/production/src/model/queries/membership/ProjectRolesByIdentityQuery.cjs.map +1 -1
- package/dist/production/src/model/queries/membership/ProjectRolesByIdentityQuery.js.map +1 -1
- package/dist/production/src/model/queries/membership/ProjectSlugSpecification.cjs.map +1 -1
- package/dist/production/src/model/queries/membership/ProjectSlugSpecification.js.map +1 -1
- package/dist/production/src/model/queries/person/PersonByIdPQuery.cjs.map +1 -1
- package/dist/production/src/model/queries/person/PersonByIdPQuery.js.map +1 -1
- package/dist/production/src/model/queries/person/PersonByIdentityBatchQuery.cjs.map +1 -1
- package/dist/production/src/model/queries/person/PersonByIdentityBatchQuery.js.map +1 -1
- package/dist/production/src/model/queries/person/PersonQuery.cjs.map +1 -1
- package/dist/production/src/model/queries/person/PersonQuery.js.map +1 -1
- package/dist/production/src/model/queries/person/PersonQueryBuilderFactory.cjs +1 -1
- package/dist/production/src/model/queries/person/PersonQueryBuilderFactory.cjs.map +1 -1
- package/dist/production/src/model/queries/person/PersonQueryBuilderFactory.js +1 -1
- package/dist/production/src/model/queries/person/PersonQueryBuilderFactory.js.map +1 -1
- package/dist/production/src/model/queries/personToken/PersonTokenQuery.cjs +29 -0
- package/dist/production/src/model/queries/personToken/PersonTokenQuery.cjs.map +1 -0
- package/dist/production/src/model/queries/personToken/PersonTokenQuery.js +29 -0
- package/dist/production/src/model/queries/personToken/PersonTokenQuery.js.map +1 -0
- package/dist/production/src/model/queries/project/ProjectBySlugQuery.cjs.map +1 -1
- package/dist/production/src/model/queries/project/ProjectBySlugQuery.js.map +1 -1
- package/dist/production/src/model/queries/project/ProjectSecretsQuery.cjs.map +1 -1
- package/dist/production/src/model/queries/project/ProjectSecretsQuery.js.map +1 -1
- package/dist/production/src/model/queries/project/ProjectUpdateTimestampQuery.cjs.map +1 -1
- package/dist/production/src/model/queries/project/ProjectUpdateTimestampQuery.js.map +1 -1
- package/dist/production/src/model/queries/project/ProjectsByIdentityQuery.cjs.map +1 -1
- package/dist/production/src/model/queries/project/ProjectsByIdentityQuery.js.map +1 -1
- package/dist/production/src/model/queries/project/ProjectsQuery.cjs.map +1 -1
- package/dist/production/src/model/queries/project/ProjectsQuery.js.map +1 -1
- package/dist/production/src/model/service/ConfigurationManager.cjs +27 -0
- package/dist/production/src/model/service/ConfigurationManager.cjs.map +1 -0
- package/dist/production/src/model/service/ConfigurationManager.js +27 -0
- package/dist/production/src/model/service/ConfigurationManager.js.map +1 -0
- package/dist/production/src/model/service/EmailValidator.cjs.map +1 -1
- package/dist/production/src/model/service/EmailValidator.js.map +1 -1
- package/dist/production/src/model/service/IDPSignInManager.cjs +1 -1
- package/dist/production/src/model/service/IDPSignInManager.cjs.map +1 -1
- package/dist/production/src/model/service/IDPSignInManager.js +1 -1
- package/dist/production/src/model/service/IDPSignInManager.js.map +1 -1
- package/dist/production/src/model/service/InviteManager.cjs +7 -7
- package/dist/production/src/model/service/InviteManager.cjs.map +1 -1
- package/dist/production/src/model/service/InviteManager.js +6 -6
- package/dist/production/src/model/service/InviteManager.js.map +1 -1
- package/dist/production/src/model/service/MailTemplateManager.cjs.map +1 -1
- package/dist/production/src/model/service/MailTemplateManager.js.map +1 -1
- package/dist/production/src/model/service/MembershipValidator.cjs.map +1 -1
- package/dist/production/src/model/service/MembershipValidator.js.map +1 -1
- package/dist/production/src/model/service/OtpAuthenticator.cjs.map +1 -1
- package/dist/production/src/model/service/OtpAuthenticator.js.map +1 -1
- package/dist/production/src/model/service/OtpManager.cjs.map +1 -1
- package/dist/production/src/model/service/OtpManager.js.map +1 -1
- package/dist/production/src/model/service/PasswordChangeManager.cjs +1 -1
- package/dist/production/src/model/service/PasswordChangeManager.cjs.map +1 -1
- package/dist/production/src/model/service/PasswordChangeManager.js +1 -1
- package/dist/production/src/model/service/PasswordChangeManager.js.map +1 -1
- package/dist/production/src/model/service/PasswordResetManager.cjs +7 -15
- package/dist/production/src/model/service/PasswordResetManager.cjs.map +1 -1
- package/dist/production/src/model/service/PasswordResetManager.js +7 -15
- package/dist/production/src/model/service/PasswordResetManager.js.map +1 -1
- package/dist/production/src/model/service/PasswordlessSignInManager.cjs +135 -0
- package/dist/production/src/model/service/PasswordlessSignInManager.cjs.map +1 -0
- package/dist/production/src/model/service/PasswordlessSignInManager.js +135 -0
- package/dist/production/src/model/service/PasswordlessSignInManager.js.map +1 -0
- package/dist/production/src/model/service/PersonAccessManager.cjs.map +1 -1
- package/dist/production/src/model/service/PersonAccessManager.js.map +1 -1
- package/dist/production/src/model/service/PersonManager.cjs +7 -0
- package/dist/production/src/model/service/PersonManager.cjs.map +1 -1
- package/dist/production/src/model/service/PersonManager.js +7 -0
- package/dist/production/src/model/service/PersonManager.js.map +1 -1
- package/dist/production/src/model/service/ProjectManager.cjs +2 -2
- package/dist/production/src/model/service/ProjectManager.cjs.map +1 -1
- package/dist/production/src/model/service/ProjectManager.js +2 -2
- package/dist/production/src/model/service/ProjectManager.js.map +1 -1
- package/dist/production/src/model/service/ProjectMemberManager.cjs.map +1 -1
- package/dist/production/src/model/service/ProjectMemberManager.js.map +1 -1
- package/dist/production/src/model/service/RolesManager.cjs +1 -1
- package/dist/production/src/model/service/RolesManager.cjs.map +1 -1
- package/dist/production/src/model/service/RolesManager.js +1 -1
- package/dist/production/src/model/service/RolesManager.js.map +1 -1
- package/dist/production/src/model/service/SecretsManager.cjs.map +1 -1
- package/dist/production/src/model/service/SecretsManager.js.map +1 -1
- package/dist/production/src/model/service/SignInManager.cjs.map +1 -1
- package/dist/production/src/model/service/SignInManager.js.map +1 -1
- package/dist/production/src/model/service/SignUpManager.cjs +1 -1
- package/dist/production/src/model/service/SignUpManager.cjs.map +1 -1
- package/dist/production/src/model/service/SignUpManager.js +1 -1
- package/dist/production/src/model/service/SignUpManager.js.map +1 -1
- package/dist/production/src/model/service/apiKey/ApiKeyManager.cjs.map +1 -1
- package/dist/production/src/model/service/apiKey/ApiKeyManager.js.map +1 -1
- package/dist/production/src/model/service/apiKey/ApiKeyService.cjs.map +1 -1
- package/dist/production/src/model/service/apiKey/ApiKeyService.js.map +1 -1
- package/dist/production/src/model/service/helpers/getPreferredProject.cjs +13 -0
- package/dist/production/src/model/service/helpers/getPreferredProject.cjs.map +1 -0
- package/dist/production/src/model/service/helpers/getPreferredProject.js +13 -0
- package/dist/production/src/model/service/helpers/getPreferredProject.js.map +1 -0
- package/dist/production/src/model/service/idp/IDPHandlerRegistry.cjs.map +1 -1
- package/dist/production/src/model/service/idp/IDPHandlerRegistry.js.map +1 -1
- package/dist/production/src/model/service/idp/IDPManager.cjs.map +1 -1
- package/dist/production/src/model/service/idp/IDPManager.js.map +1 -1
- package/dist/production/src/model/service/idp/IDPResponseError.cjs.map +1 -1
- package/dist/production/src/model/service/idp/IDPResponseError.js.map +1 -1
- package/dist/production/src/model/service/idp/IDPValidationError.cjs.map +1 -1
- package/dist/production/src/model/service/idp/IDPValidationError.js.map +1 -1
- package/dist/production/src/model/service/idp/IdentityProviderNotFoundError.cjs.map +1 -1
- package/dist/production/src/model/service/idp/IdentityProviderNotFoundError.js.map +1 -1
- package/dist/production/src/model/service/idp/InvalidIDPConfigurationError.cjs.map +1 -1
- package/dist/production/src/model/service/idp/InvalidIDPConfigurationError.js.map +1 -1
- package/dist/production/src/model/service/idp/providers/AppleProvider.cjs +1 -1
- package/dist/production/src/model/service/idp/providers/AppleProvider.cjs.map +1 -1
- package/dist/production/src/model/service/idp/providers/AppleProvider.js +1 -1
- package/dist/production/src/model/service/idp/providers/AppleProvider.js.map +1 -1
- package/dist/production/src/model/service/idp/providers/FacebookProvider.cjs +1 -1
- package/dist/production/src/model/service/idp/providers/FacebookProvider.cjs.map +1 -1
- package/dist/production/src/model/service/idp/providers/FacebookProvider.js +1 -1
- package/dist/production/src/model/service/idp/providers/FacebookProvider.js.map +1 -1
- package/dist/production/src/model/service/idp/providers/OIDCHelpers.cjs +9 -5
- package/dist/production/src/model/service/idp/providers/OIDCHelpers.cjs.map +1 -1
- package/dist/production/src/model/service/idp/providers/OIDCHelpers.js +9 -5
- package/dist/production/src/model/service/idp/providers/OIDCHelpers.js.map +1 -1
- package/dist/production/src/model/service/idp/providers/OIDCProvider.cjs +9 -3
- package/dist/production/src/model/service/idp/providers/OIDCProvider.cjs.map +1 -1
- package/dist/production/src/model/service/idp/providers/OIDCProvider.js +9 -3
- package/dist/production/src/model/service/idp/providers/OIDCProvider.js.map +1 -1
- package/dist/production/src/model/service/idp/providers/OIDCTypes.cjs +6 -1
- package/dist/production/src/model/service/idp/providers/OIDCTypes.cjs.map +1 -1
- package/dist/production/src/model/service/idp/providers/OIDCTypes.js +6 -1
- package/dist/production/src/model/service/idp/providers/OIDCTypes.js.map +1 -1
- package/dist/production/src/model/service/idp/providers/helpers.cjs.map +1 -1
- package/dist/production/src/model/service/idp/providers/helpers.js.map +1 -1
- package/dist/production/src/model/service/membershipUtils.cjs.map +1 -1
- package/dist/production/src/model/service/membershipUtils.js.map +1 -1
- package/dist/production/src/model/type/ApiKey.cjs.map +1 -1
- package/dist/production/src/model/type/ApiKey.js.map +1 -1
- package/dist/production/src/model/utils/DatabaseContext.cjs.map +1 -1
- package/dist/production/src/model/utils/DatabaseContext.js.map +1 -1
- package/dist/production/src/model/utils/Response.cjs.map +1 -1
- package/dist/production/src/model/utils/Response.js.map +1 -1
- package/dist/production/src/model/utils/password.cjs.map +1 -1
- package/dist/production/src/model/utils/password.js.map +1 -1
- package/dist/production/src/model/utils/tokenUtils.cjs +39 -0
- package/dist/production/src/model/utils/tokenUtils.cjs.map +1 -1
- package/dist/production/src/model/utils/tokenUtils.js +40 -1
- package/dist/production/src/model/utils/tokenUtils.js.map +1 -1
- package/dist/production/src/resolvers/ResolverFactory.cjs +8 -1
- package/dist/production/src/resolvers/ResolverFactory.cjs.map +1 -1
- package/dist/production/src/resolvers/ResolverFactory.js +8 -1
- package/dist/production/src/resolvers/ResolverFactory.js.map +1 -1
- package/dist/production/src/resolvers/TenantResolverContextFactory.cjs.map +1 -1
- package/dist/production/src/resolvers/TenantResolverContextFactory.js.map +1 -1
- package/dist/production/src/resolvers/errorUtils.cjs.map +1 -1
- package/dist/production/src/resolvers/errorUtils.js.map +1 -1
- package/dist/production/src/resolvers/membershipUtils.cjs.map +1 -1
- package/dist/production/src/resolvers/membershipUtils.js.map +1 -1
- package/dist/production/src/resolvers/mutation/apiKey/CreateApiKeyMutationResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/mutation/apiKey/CreateApiKeyMutationResolver.js.map +1 -1
- package/dist/production/src/resolvers/mutation/apiKey/DisableApiKeyMutationResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/mutation/apiKey/DisableApiKeyMutationResolver.js.map +1 -1
- package/dist/production/src/resolvers/mutation/configuration/ConfigurationMutationResolver.cjs +41 -0
- package/dist/production/src/resolvers/mutation/configuration/ConfigurationMutationResolver.cjs.map +1 -0
- package/dist/production/src/resolvers/mutation/configuration/ConfigurationMutationResolver.js +41 -0
- package/dist/production/src/resolvers/mutation/configuration/ConfigurationMutationResolver.js.map +1 -0
- package/dist/production/src/resolvers/mutation/identity/GlobalRolesMutationResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/mutation/identity/GlobalRolesMutationResolver.js.map +1 -1
- package/dist/production/src/resolvers/mutation/idp/AddIDPMutationResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/mutation/idp/AddIDPMutationResolver.js.map +1 -1
- package/dist/production/src/resolvers/mutation/idp/DisableIDPMutationResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/mutation/idp/DisableIDPMutationResolver.js.map +1 -1
- package/dist/production/src/resolvers/mutation/idp/EnableIDPMutationResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/mutation/idp/EnableIDPMutationResolver.js.map +1 -1
- package/dist/production/src/resolvers/mutation/idp/UpdateIDPMutationResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/mutation/idp/UpdateIDPMutationResolver.js.map +1 -1
- package/dist/production/src/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.js.map +1 -1
- package/dist/production/src/resolvers/mutation/person/ChangePasswordMutationResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/mutation/person/ChangePasswordMutationResolver.js.map +1 -1
- package/dist/production/src/resolvers/mutation/person/ChangeProfileMutationResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/mutation/person/ChangeProfileMutationResolver.js.map +1 -1
- package/dist/production/src/resolvers/mutation/person/DisablePersonMutationResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/mutation/person/DisablePersonMutationResolver.js.map +1 -1
- package/dist/production/src/resolvers/mutation/person/IDPMutationResolver.cjs +4 -1
- package/dist/production/src/resolvers/mutation/person/IDPMutationResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/mutation/person/IDPMutationResolver.js +4 -1
- package/dist/production/src/resolvers/mutation/person/IDPMutationResolver.js.map +1 -1
- package/dist/production/src/resolvers/mutation/person/InviteMutationResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/mutation/person/InviteMutationResolver.js.map +1 -1
- package/dist/production/src/resolvers/mutation/person/OtpMutationResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/mutation/person/OtpMutationResolver.js.map +1 -1
- package/dist/production/src/resolvers/mutation/person/PasswordlessMutationResolver.cjs +83 -0
- package/dist/production/src/resolvers/mutation/person/PasswordlessMutationResolver.cjs.map +1 -0
- package/dist/production/src/resolvers/mutation/person/PasswordlessMutationResolver.js +83 -0
- package/dist/production/src/resolvers/mutation/person/PasswordlessMutationResolver.js.map +1 -0
- package/dist/production/src/resolvers/mutation/person/ResetPasswordMutationResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/mutation/person/ResetPasswordMutationResolver.js.map +1 -1
- package/dist/production/src/resolvers/mutation/person/SignInMutationResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/mutation/person/SignInMutationResolver.js.map +1 -1
- package/dist/production/src/resolvers/mutation/person/SignOutMutationResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/mutation/person/SignOutMutationResolver.js.map +1 -1
- package/dist/production/src/resolvers/mutation/person/SignUpMutationResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/mutation/person/SignUpMutationResolver.js.map +1 -1
- package/dist/production/src/resolvers/mutation/person/TogglePasswordlessMutationResolver.cjs +52 -0
- package/dist/production/src/resolvers/mutation/person/TogglePasswordlessMutationResolver.cjs.map +1 -0
- package/dist/production/src/resolvers/mutation/person/TogglePasswordlessMutationResolver.js +52 -0
- package/dist/production/src/resolvers/mutation/person/TogglePasswordlessMutationResolver.js.map +1 -0
- package/dist/production/src/resolvers/mutation/project/CreateProjectMutationResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/mutation/project/CreateProjectMutationResolver.js.map +1 -1
- package/dist/production/src/resolvers/mutation/project/SetProjectSecretMutationResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/mutation/project/SetProjectSecretMutationResolver.js.map +1 -1
- package/dist/production/src/resolvers/mutation/project/UpdateProjectMutationResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/mutation/project/UpdateProjectMutationResolver.js.map +1 -1
- package/dist/production/src/resolvers/mutation/projectMember/AddProjectMemberMutationResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/mutation/projectMember/AddProjectMemberMutationResolver.js.map +1 -1
- package/dist/production/src/resolvers/mutation/projectMember/RemoveProjectMemberMutationResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/mutation/projectMember/RemoveProjectMemberMutationResolver.js.map +1 -1
- package/dist/production/src/resolvers/mutation/projectMember/UpdateProjectMemberMutationResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/mutation/projectMember/UpdateProjectMemberMutationResolver.js.map +1 -1
- package/dist/production/src/resolvers/query/ConfigurationQueryResolver.cjs +34 -0
- package/dist/production/src/resolvers/query/ConfigurationQueryResolver.cjs.map +1 -0
- package/dist/production/src/resolvers/query/ConfigurationQueryResolver.js +34 -0
- package/dist/production/src/resolvers/query/ConfigurationQueryResolver.js.map +1 -0
- package/dist/production/src/resolvers/query/IDPQueryResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/query/IDPQueryResolver.js.map +1 -1
- package/dist/production/src/resolvers/query/MailTemplateQueryResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/query/MailTemplateQueryResolver.js.map +1 -1
- package/dist/production/src/resolvers/query/MeQueryResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/query/MeQueryResolver.js.map +1 -1
- package/dist/production/src/resolvers/query/PersonQueryResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/query/PersonQueryResolver.js.map +1 -1
- package/dist/production/src/resolvers/query/ProjectMembersQueryResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/query/ProjectMembersQueryResolver.js.map +1 -1
- package/dist/production/src/resolvers/query/ProjectQueryResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/query/ProjectQueryResolver.js.map +1 -1
- package/dist/production/src/resolvers/responseHelpers/PersonResponseFactory.cjs +1 -0
- package/dist/production/src/resolvers/responseHelpers/PersonResponseFactory.cjs.map +1 -1
- package/dist/production/src/resolvers/responseHelpers/PersonResponseFactory.js +1 -0
- package/dist/production/src/resolvers/responseHelpers/PersonResponseFactory.js.map +1 -1
- package/dist/production/src/resolvers/responseHelpers/SignInResponseFactory.cjs.map +1 -1
- package/dist/production/src/resolvers/responseHelpers/SignInResponseFactory.js.map +1 -1
- package/dist/production/src/resolvers/types/IdentityTypeResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/types/IdentityTypeResolver.js.map +1 -1
- package/dist/production/src/resolvers/types/ProjectTypeResolver.cjs.map +1 -1
- package/dist/production/src/resolvers/types/ProjectTypeResolver.js.map +1 -1
- package/dist/production/src/schema/tenant.graphql.cjs +162 -10
- package/dist/production/src/schema/tenant.graphql.cjs.map +1 -1
- package/dist/production/src/schema/tenant.graphql.js +162 -10
- package/dist/production/src/schema/tenant.graphql.js.map +1 -1
- package/dist/production/src/utils/Mailer.cjs.map +1 -1
- package/dist/production/src/utils/Mailer.js.map +1 -1
- package/dist/production/src/utils/TemplateRenderer.cjs.map +1 -1
- package/dist/production/src/utils/TemplateRenderer.js.map +1 -1
- package/dist/production/src/utils/array.cjs.map +1 -1
- package/dist/production/src/utils/array.js.map +1 -1
- package/dist/production/src/utils/batchQuery.cjs.map +1 -1
- package/dist/production/src/utils/batchQuery.js.map +1 -1
- package/dist/tests/cases/integration/mocked/sql/{createPasswordResetSql.d.ts → createPersonTokenSql.d.ts} +3 -2
- package/dist/tests/cases/integration/mocked/sql/createPersonTokenSql.d.ts.map +1 -0
- package/dist/tests/cases/integration/mocked/sql/getPersonByEmailSql.d.ts.map +1 -1
- package/dist/tests/src/IdPMock.d.ts +2 -2
- package/dist/tests/src/IdPMock.d.ts.map +1 -1
- package/dist/tests/src/mailer.d.ts.map +1 -1
- package/dist/tests/tsconfig.tsbuildinfo +1 -1
- package/dist/types/TenantContainer.d.ts +18 -0
- package/dist/types/TenantContainer.d.ts.map +1 -1
- package/dist/types/migrations/2024-08-26-120000-passwordless.d.ts +3 -0
- package/dist/types/migrations/2024-08-26-120000-passwordless.d.ts.map +1 -0
- package/dist/types/migrations/runner.d.ts.map +1 -1
- package/dist/types/migrations/snapshot.d.ts.map +1 -1
- package/dist/types/model/authorization/PermissionActions.d.ts +25 -0
- package/dist/types/model/authorization/PermissionActions.d.ts.map +1 -1
- package/dist/types/model/authorization/PermissionsFactory.d.ts.map +1 -1
- package/dist/types/model/commands/configuration/UpdateConfigurationCommand.d.ts +8 -0
- package/dist/types/model/commands/configuration/UpdateConfigurationCommand.d.ts.map +1 -0
- package/dist/types/model/commands/configuration/index.d.ts +2 -0
- package/dist/types/model/commands/configuration/index.d.ts.map +1 -0
- package/dist/types/model/commands/index.d.ts +2 -2
- package/dist/types/model/commands/index.d.ts.map +1 -1
- package/dist/types/model/commands/person/CreatePersonCommand.d.ts.map +1 -1
- package/dist/types/model/commands/person/TogglePersonPasswordlessCommand.d.ts +8 -0
- package/dist/types/model/commands/person/TogglePersonPasswordlessCommand.d.ts.map +1 -0
- package/dist/types/model/commands/person/index.d.ts +1 -0
- package/dist/types/model/commands/person/index.d.ts.map +1 -1
- package/dist/types/model/commands/personToken/ActivateOtpCommand.d.ts +8 -0
- package/dist/types/model/commands/personToken/ActivateOtpCommand.d.ts.map +1 -0
- package/dist/types/model/commands/personToken/CreatePersonTokenCommand.d.ts +19 -0
- package/dist/types/model/commands/personToken/CreatePersonTokenCommand.d.ts.map +1 -0
- package/dist/types/model/commands/personToken/IncreaseOtpAttemptCommand.d.ts +7 -0
- package/dist/types/model/commands/personToken/IncreaseOtpAttemptCommand.d.ts.map +1 -0
- package/dist/types/model/commands/personToken/InvalidateTokenCommand.d.ts +7 -0
- package/dist/types/model/commands/personToken/InvalidateTokenCommand.d.ts.map +1 -0
- package/dist/types/model/commands/{passwordReset → personToken}/ResetPasswordCommand.d.ts +3 -2
- package/dist/types/model/commands/personToken/ResetPasswordCommand.d.ts.map +1 -0
- package/dist/types/model/commands/personToken/SavePersonTokenCommand.d.ts +19 -0
- package/dist/types/model/commands/personToken/SavePersonTokenCommand.d.ts.map +1 -0
- package/dist/types/model/commands/personToken/index.d.ts +7 -0
- package/dist/types/model/commands/personToken/index.d.ts.map +1 -0
- package/dist/types/model/consts/expirations.d.ts +3 -0
- package/dist/types/model/consts/expirations.d.ts.map +1 -0
- package/dist/types/model/mailing/UserMailer.d.ts +10 -0
- package/dist/types/model/mailing/UserMailer.d.ts.map +1 -1
- package/dist/types/model/mailing/templates/PasswordlessSignIn.mustache.d.ts +3 -0
- package/dist/types/model/mailing/templates/PasswordlessSignIn.mustache.d.ts.map +1 -0
- package/dist/types/model/mailing/type.d.ts +2 -1
- package/dist/types/model/mailing/type.d.ts.map +1 -1
- package/dist/types/model/queries/configuration/ConfigurationQuery.d.ts +6 -0
- package/dist/types/model/queries/configuration/ConfigurationQuery.d.ts.map +1 -0
- package/dist/types/model/queries/configuration/index.d.ts +2 -0
- package/dist/types/model/queries/configuration/index.d.ts.map +1 -0
- package/dist/types/model/queries/index.d.ts +1 -0
- package/dist/types/model/queries/index.d.ts.map +1 -1
- package/dist/types/model/queries/person/PersonQueryBuilderFactory.d.ts.map +1 -1
- package/dist/types/model/queries/person/types.d.ts +1 -0
- package/dist/types/model/queries/person/types.d.ts.map +1 -1
- package/dist/types/model/queries/personToken/PersonTokenQuery.d.ts +12 -0
- package/dist/types/model/queries/personToken/PersonTokenQuery.d.ts.map +1 -0
- package/dist/types/model/service/ConfigurationManager.d.ts +9 -0
- package/dist/types/model/service/ConfigurationManager.d.ts.map +1 -0
- package/dist/types/model/service/IDPSignInManager.d.ts +1 -0
- package/dist/types/model/service/IDPSignInManager.d.ts.map +1 -1
- package/dist/types/model/service/InviteManager.d.ts.map +1 -1
- package/dist/types/model/service/PasswordResetManager.d.ts +1 -1
- package/dist/types/model/service/PasswordResetManager.d.ts.map +1 -1
- package/dist/types/model/service/PasswordlessSignInManager.d.ts +54 -0
- package/dist/types/model/service/PasswordlessSignInManager.d.ts.map +1 -0
- package/dist/types/model/service/PersonManager.d.ts +1 -0
- package/dist/types/model/service/PersonManager.d.ts.map +1 -1
- package/dist/types/model/service/PersonTokenManager.d.ts +3 -0
- package/dist/types/model/service/PersonTokenManager.d.ts.map +1 -0
- package/dist/types/model/service/helpers/getPreferredProject.d.ts +3 -0
- package/dist/types/model/service/helpers/getPreferredProject.d.ts.map +1 -0
- package/dist/types/model/service/idp/IdentityProviderHandler.d.ts +3 -3
- package/dist/types/model/service/idp/IdentityProviderHandler.d.ts.map +1 -1
- package/dist/types/model/service/idp/providers/AppleProvider.d.ts +10 -2
- package/dist/types/model/service/idp/providers/AppleProvider.d.ts.map +1 -1
- package/dist/types/model/service/idp/providers/FacebookProvider.d.ts +10 -2
- package/dist/types/model/service/idp/providers/FacebookProvider.d.ts.map +1 -1
- package/dist/types/model/service/idp/providers/OIDCHelpers.d.ts +4 -4
- package/dist/types/model/service/idp/providers/OIDCHelpers.d.ts.map +1 -1
- package/dist/types/model/service/idp/providers/OIDCProvider.d.ts +6 -2
- package/dist/types/model/service/idp/providers/OIDCProvider.d.ts.map +1 -1
- package/dist/types/model/service/idp/providers/OIDCTypes.d.ts +21 -5
- package/dist/types/model/service/idp/providers/OIDCTypes.d.ts.map +1 -1
- package/dist/types/model/type/PersonToken.d.ts +16 -0
- package/dist/types/model/type/PersonToken.d.ts.map +1 -0
- package/dist/types/model/type/index.d.ts +1 -0
- package/dist/types/model/type/index.d.ts.map +1 -1
- package/dist/types/model/utils/tokenUtils.d.ts +8 -0
- package/dist/types/model/utils/tokenUtils.d.ts.map +1 -1
- package/dist/types/resolvers/ResolverFactory.d.ts +8 -0
- package/dist/types/resolvers/ResolverFactory.d.ts.map +1 -1
- package/dist/types/resolvers/mutation/configuration/ConfigurationMutationResolver.d.ts +9 -0
- package/dist/types/resolvers/mutation/configuration/ConfigurationMutationResolver.d.ts.map +1 -0
- package/dist/types/resolvers/mutation/person/IDPMutationResolver.d.ts.map +1 -1
- package/dist/types/resolvers/mutation/person/PasswordlessMutationResolver.d.ts +13 -0
- package/dist/types/resolvers/mutation/person/PasswordlessMutationResolver.d.ts.map +1 -0
- package/dist/types/resolvers/mutation/person/ResetPasswordMutationResolver.d.ts.map +1 -1
- package/dist/types/resolvers/mutation/person/TogglePasswordlessMutationResolver.d.ts +13 -0
- package/dist/types/resolvers/mutation/person/TogglePasswordlessMutationResolver.d.ts.map +1 -0
- package/dist/types/resolvers/query/ConfigurationQueryResolver.d.ts +9 -0
- package/dist/types/resolvers/query/ConfigurationQueryResolver.d.ts.map +1 -0
- package/dist/types/resolvers/responseHelpers/PersonResponseFactory.d.ts.map +1 -1
- package/dist/types/resolvers/types/ProjectTypeResolver.d.ts +3 -3
- package/dist/types/schema/index.d.ts +362 -38
- package/dist/types/schema/index.d.ts.map +1 -1
- package/dist/types/schema/tenant.graphql.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/types/utils/batchQuery.d.ts.map +1 -1
- package/{graphql-tenant.codegen.yml → graphql.codegen.yml} +1 -1
- package/package.json +23 -27
- package/src/TenantContainer.ts +18 -0
- package/src/migrations/2024-08-26-120000-passwordless.ts +31 -0
- package/src/migrations/runner.ts +2 -0
- package/src/migrations/snapshot-template-end.txt +3 -0
- package/src/migrations/snapshot.ts +33 -5
- package/src/model/authorization/PermissionActions.ts +7 -0
- package/src/model/authorization/PermissionsFactory.ts +5 -0
- package/src/model/commands/configuration/UpdateConfigurationCommand.ts +26 -0
- package/src/model/commands/configuration/index.ts +1 -0
- package/src/model/commands/index.ts +2 -2
- package/src/model/commands/person/CreatePersonCommand.ts +1 -0
- package/src/model/commands/person/TogglePersonPasswordlessCommand.ts +18 -0
- package/src/model/commands/person/index.ts +1 -0
- package/src/model/commands/personToken/ActivateOtpCommand.ts +24 -0
- package/src/model/commands/personToken/CreatePersonTokenCommand.ts +42 -0
- package/src/model/commands/personToken/IncreaseOtpAttemptCommand.ts +23 -0
- package/src/model/commands/personToken/InvalidateTokenCommand.ts +22 -0
- package/src/model/commands/personToken/ResetPasswordCommand.ts +28 -0
- package/src/model/commands/personToken/SavePersonTokenCommand.ts +42 -0
- package/src/model/commands/personToken/index.ts +6 -0
- package/src/model/consts/expirations.ts +2 -0
- package/src/model/mailing/UserMailer.ts +14 -0
- package/src/model/mailing/templates/PasswordlessSignIn.mustache.ts +15 -0
- package/src/model/mailing/type.ts +3 -0
- package/src/model/queries/configuration/ConfigurationQuery.ts +30 -0
- package/src/model/queries/configuration/index.ts +1 -0
- package/src/model/queries/index.ts +1 -0
- package/src/model/queries/person/PersonQueryBuilderFactory.ts +1 -0
- package/src/model/queries/person/types.ts +1 -0
- package/src/model/queries/personToken/PersonTokenQuery.ts +35 -0
- package/src/model/service/ConfigurationManager.ts +22 -0
- package/src/model/service/IDPSignInManager.ts +7 -6
- package/src/model/service/InviteManager.ts +5 -6
- package/src/model/service/OtpAuthenticator.ts +1 -1
- package/src/model/service/PasswordResetManager.ts +4 -10
- package/src/model/service/PasswordlessSignInManager.ts +190 -0
- package/src/model/service/PersonManager.ts +6 -0
- package/src/model/service/PersonTokenManager.ts +2 -0
- package/src/model/service/helpers/getPreferredProject.ts +11 -0
- package/src/model/service/idp/IdentityProviderHandler.ts +3 -3
- package/src/model/service/idp/providers/AppleProvider.ts +3 -3
- package/src/model/service/idp/providers/FacebookProvider.ts +3 -3
- package/src/model/service/idp/providers/OIDCHelpers.ts +11 -6
- package/src/model/service/idp/providers/OIDCProvider.ts +10 -4
- package/src/model/service/idp/providers/OIDCTypes.ts +5 -1
- package/src/model/type/PersonToken.ts +21 -0
- package/src/model/type/index.ts +1 -0
- package/src/model/utils/tokenUtils.ts +47 -0
- package/src/resolvers/ResolverFactory.ts +19 -0
- package/src/resolvers/mutation/configuration/ConfigurationMutationResolver.ts +29 -0
- package/src/resolvers/mutation/person/IDPMutationResolver.ts +4 -1
- package/src/resolvers/mutation/person/PasswordlessMutationResolver.ts +81 -0
- package/src/resolvers/mutation/person/ResetPasswordMutationResolver.ts +1 -10
- package/src/resolvers/mutation/person/TogglePasswordlessMutationResolver.ts +44 -0
- package/src/resolvers/query/ConfigurationQueryResolver.ts +21 -0
- package/src/resolvers/responseHelpers/PersonResponseFactory.ts +1 -0
- package/src/resolvers/types/ProjectTypeResolver.ts +3 -3
- package/src/schema/index.ts +362 -35
- package/src/schema/tenant.graphql.ts +162 -10
- package/tests/cases/integration/mocked/addProjectMemberMutation.test.ts +1 -1
- package/tests/cases/integration/mocked/changeMyPasswordMutation.test.ts +2 -2
- package/tests/cases/integration/mocked/changeMyProfileMutation.test.ts +2 -2
- package/tests/cases/integration/mocked/changePasswordMutation.test.ts +1 -1
- package/tests/cases/integration/mocked/changeProfileMutation.test.ts +2 -2
- package/tests/cases/integration/mocked/confirmOtpMutation.test.ts +1 -1
- package/tests/cases/integration/mocked/createApiKeyMutation.test.ts +1 -1
- package/tests/cases/integration/mocked/createSessionKeyMutation.test.ts +1 -1
- package/tests/cases/integration/mocked/disableApiKeyMutation.ts +1 -1
- package/tests/cases/integration/mocked/inviteMutations.test.ts +3 -3
- package/tests/cases/integration/mocked/listProjectMembersQuery.test.ts +1 -1
- package/tests/cases/integration/mocked/personByIdQuery.test.ts +1 -1
- package/tests/cases/integration/mocked/prepareOtpMutation.test.ts +3 -3
- package/tests/cases/integration/mocked/removeProjectMemberMutation.test.ts +1 -1
- package/tests/cases/integration/mocked/signInIdpMutation.test.ts +1 -1
- package/tests/cases/integration/mocked/signInMutation.test.ts +1 -1
- package/tests/cases/integration/mocked/signOutMutation.test.ts +1 -1
- package/tests/cases/integration/mocked/signUpMutation.test.ts +1 -1
- package/tests/cases/integration/mocked/sql/{createPasswordResetSql.ts → createPersonTokenSql.ts} +5 -3
- package/tests/cases/integration/mocked/sql/getPersonByEmailSql.ts +2 -1
- package/tests/cases/integration/mocked/sql/getPersonByIdSql.ts +1 -1
- package/tests/cases/integration/mocked/sql/getPersonByIdentity.ts +1 -1
- package/tests/cases/integration/mocked/sql/getPersonByIdpSql.ts +1 -1
- package/tests/cases/integration/mocked/updateProjectMemberMutation.test.ts +1 -1
- package/tests/cases/migrations/2020-06-08-134000-tenant-credentials.test.ts +5 -3
- package/tests/cases/unit/authorization/membershipAwareAccessNode.test.ts +9 -9
- package/tests/cases/unit/authorization/membershipMatcher.test.ts +10 -10
- package/tests/src/IdPMock.ts +2 -2
- package/tests/src/mailer.ts +3 -4
- package/tests/src/testGraphql.ts +2 -2
- package/dist/development/src/model/commands/passwordReset/CreatePasswordResetRequestCommand.cjs +0 -30
- package/dist/development/src/model/commands/passwordReset/CreatePasswordResetRequestCommand.cjs.map +0 -1
- package/dist/development/src/model/commands/passwordReset/CreatePasswordResetRequestCommand.js +0 -30
- package/dist/development/src/model/commands/passwordReset/CreatePasswordResetRequestCommand.js.map +0 -1
- package/dist/development/src/model/commands/passwordReset/ResetPasswordCommand.cjs +0 -38
- package/dist/development/src/model/commands/passwordReset/ResetPasswordCommand.cjs.map +0 -1
- package/dist/development/src/model/commands/passwordReset/ResetPasswordCommand.js +0 -38
- package/dist/development/src/model/commands/passwordReset/ResetPasswordCommand.js.map +0 -1
- package/dist/development/src/model/commands/passwordReset/SavePasswordResetRequestCommand.cjs +0 -24
- package/dist/development/src/model/commands/passwordReset/SavePasswordResetRequestCommand.cjs.map +0 -1
- package/dist/development/src/model/commands/passwordReset/SavePasswordResetRequestCommand.js +0 -24
- package/dist/development/src/model/commands/passwordReset/SavePasswordResetRequestCommand.js.map +0 -1
- package/dist/production/src/model/commands/passwordReset/CreatePasswordResetRequestCommand.cjs +0 -30
- package/dist/production/src/model/commands/passwordReset/CreatePasswordResetRequestCommand.cjs.map +0 -1
- package/dist/production/src/model/commands/passwordReset/CreatePasswordResetRequestCommand.js +0 -30
- package/dist/production/src/model/commands/passwordReset/CreatePasswordResetRequestCommand.js.map +0 -1
- package/dist/production/src/model/commands/passwordReset/ResetPasswordCommand.cjs +0 -38
- package/dist/production/src/model/commands/passwordReset/ResetPasswordCommand.cjs.map +0 -1
- package/dist/production/src/model/commands/passwordReset/ResetPasswordCommand.js +0 -38
- package/dist/production/src/model/commands/passwordReset/ResetPasswordCommand.js.map +0 -1
- package/dist/production/src/model/commands/passwordReset/SavePasswordResetRequestCommand.cjs +0 -24
- package/dist/production/src/model/commands/passwordReset/SavePasswordResetRequestCommand.cjs.map +0 -1
- package/dist/production/src/model/commands/passwordReset/SavePasswordResetRequestCommand.js +0 -24
- package/dist/production/src/model/commands/passwordReset/SavePasswordResetRequestCommand.js.map +0 -1
- package/dist/tests/cases/integration/mocked/sql/createPasswordResetSql.d.ts.map +0 -1
- package/dist/tests/src/testTenantDb.d.ts +0 -31
- package/dist/tests/src/testTenantDb.d.ts.map +0 -1
- package/dist/types/model/commands/passwordReset/CreatePasswordResetRequestCommand.d.ts +0 -12
- package/dist/types/model/commands/passwordReset/CreatePasswordResetRequestCommand.d.ts.map +0 -1
- package/dist/types/model/commands/passwordReset/ResetPasswordCommand.d.ts.map +0 -1
- package/dist/types/model/commands/passwordReset/SavePasswordResetRequestCommand.d.ts +0 -10
- package/dist/types/model/commands/passwordReset/SavePasswordResetRequestCommand.d.ts.map +0 -1
- package/dist/types/model/commands/passwordReset/index.d.ts +0 -4
- package/dist/types/model/commands/passwordReset/index.d.ts.map +0 -1
- package/src/model/commands/passwordReset/CreatePasswordResetRequestCommand.ts +0 -25
- package/src/model/commands/passwordReset/ResetPasswordCommand.ts +0 -57
- package/src/model/commands/passwordReset/SavePasswordResetRequestCommand.ts +0 -28
- package/src/model/commands/passwordReset/index.ts +0 -3
- package/tests/src/testTenantDb.ts +0 -202
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandBus.cjs","sources":["../../../../../../packages/engine-tenant-api/src/model/commands/CommandBus.ts"],"sourcesContent":["import { Command } from './Command'\nimport { Client, Connection } from '@contember/database'\nimport { Providers } from '../providers'\n\nexport class CommandBus<ConnectionType extends Connection.ConnectionLike = Connection.ConnectionLike> {\n\tconstructor(public readonly client: Client<ConnectionType>, private readonly providers: Providers) {}\n\n\tpublic async execute<T>(command: Command<T>): Promise<T> {\n\t\treturn await command.execute({ db: this.client, providers: this.providers, bus: this })\n\t}\n\n\tasync transaction<T>(\n\t\ttransactionScope: (wrapper: CommandBus<Connection.TransactionLike>) => Promise<T> | T,\n\t): Promise<T> {\n\t\treturn await this.client.transaction(client =>\n\t\t\ttransactionScope(new CommandBus<Connection.TransactionLike>(client, this.providers)),\n\t\t)\n\t}\n}\n"],"names":[],"mappings":";;AAIO,MAAM,WAAyF;AAAA,EACrG,YAA4B,QAAiD,WAAsB;AAAvE,SAAA,SAAA;AAAiD,SAAA,YAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"CommandBus.cjs","sources":["../../../../../../packages/engine-tenant-api/src/model/commands/CommandBus.ts"],"sourcesContent":["import { Command } from './Command'\nimport { Client, Connection } from '@contember/database'\nimport { Providers } from '../providers'\n\nexport class CommandBus<ConnectionType extends Connection.ConnectionLike = Connection.ConnectionLike> {\n\tconstructor(public readonly client: Client<ConnectionType>, private readonly providers: Providers) {}\n\n\tpublic async execute<T>(command: Command<T>): Promise<T> {\n\t\treturn await command.execute({ db: this.client, providers: this.providers, bus: this })\n\t}\n\n\tasync transaction<T>(\n\t\ttransactionScope: (wrapper: CommandBus<Connection.TransactionLike>) => Promise<T> | T,\n\t): Promise<T> {\n\t\treturn await this.client.transaction(client =>\n\t\t\ttransactionScope(new CommandBus<Connection.TransactionLike>(client, this.providers)),\n\t\t)\n\t}\n}\n"],"names":[],"mappings":";;AAIO,MAAM,WAAyF;AAAA,EACrG,YAA4B,QAAiD,WAAsB;AAAvE,SAAA,SAAA;AAAiD,SAAA,YAAA;AAAA,EAAA;AAAA,EAE7E,MAAa,QAAW,SAAiC;AACxD,WAAO,MAAM,QAAQ,QAAQ,EAAE,IAAI,KAAK,QAAQ,WAAW,KAAK,WAAW,KAAK,KAAA,CAAM;AAAA,EAAA;AAAA,EAGvF,MAAM,YACL,kBACa;AACN,WAAA,MAAM,KAAK,OAAO;AAAA,MAAY,YACpC,iBAAiB,IAAI,WAAuC,QAAQ,KAAK,SAAS,CAAC;AAAA,IACpF;AAAA,EAAA;AAEF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandBus.js","sources":["../../../../../../packages/engine-tenant-api/src/model/commands/CommandBus.ts"],"sourcesContent":["import { Command } from './Command'\nimport { Client, Connection } from '@contember/database'\nimport { Providers } from '../providers'\n\nexport class CommandBus<ConnectionType extends Connection.ConnectionLike = Connection.ConnectionLike> {\n\tconstructor(public readonly client: Client<ConnectionType>, private readonly providers: Providers) {}\n\n\tpublic async execute<T>(command: Command<T>): Promise<T> {\n\t\treturn await command.execute({ db: this.client, providers: this.providers, bus: this })\n\t}\n\n\tasync transaction<T>(\n\t\ttransactionScope: (wrapper: CommandBus<Connection.TransactionLike>) => Promise<T> | T,\n\t): Promise<T> {\n\t\treturn await this.client.transaction(client =>\n\t\t\ttransactionScope(new CommandBus<Connection.TransactionLike>(client, this.providers)),\n\t\t)\n\t}\n}\n"],"names":[],"mappings":"AAIO,MAAM,WAAyF;AAAA,EACrG,YAA4B,QAAiD,WAAsB;AAAvE,SAAA,SAAA;AAAiD,SAAA,YAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"CommandBus.js","sources":["../../../../../../packages/engine-tenant-api/src/model/commands/CommandBus.ts"],"sourcesContent":["import { Command } from './Command'\nimport { Client, Connection } from '@contember/database'\nimport { Providers } from '../providers'\n\nexport class CommandBus<ConnectionType extends Connection.ConnectionLike = Connection.ConnectionLike> {\n\tconstructor(public readonly client: Client<ConnectionType>, private readonly providers: Providers) {}\n\n\tpublic async execute<T>(command: Command<T>): Promise<T> {\n\t\treturn await command.execute({ db: this.client, providers: this.providers, bus: this })\n\t}\n\n\tasync transaction<T>(\n\t\ttransactionScope: (wrapper: CommandBus<Connection.TransactionLike>) => Promise<T> | T,\n\t): Promise<T> {\n\t\treturn await this.client.transaction(client =>\n\t\t\ttransactionScope(new CommandBus<Connection.TransactionLike>(client, this.providers)),\n\t\t)\n\t}\n}\n"],"names":[],"mappings":"AAIO,MAAM,WAAyF;AAAA,EACrG,YAA4B,QAAiD,WAAsB;AAAvE,SAAA,SAAA;AAAiD,SAAA,YAAA;AAAA,EAAA;AAAA,EAE7E,MAAa,QAAW,SAAiC;AACxD,WAAO,MAAM,QAAQ,QAAQ,EAAE,IAAI,KAAK,QAAQ,WAAW,KAAK,WAAW,KAAK,KAAA,CAAM;AAAA,EAAA;AAAA,EAGvF,MAAM,YACL,kBACa;AACN,WAAA,MAAM,KAAK,OAAO;AAAA,MAAY,YACpC,iBAAiB,IAAI,WAAuC,QAAQ,KAAK,SAAS,CAAC;AAAA,IACpF;AAAA,EAAA;AAEF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiKeyHelper.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/ApiKeyHelper.ts"],"sourcesContent":["import { ApiKey } from '../../type'\nimport { Providers } from '../../providers'\nimport { plusMinutes } from '../../utils/time'\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,MAAM;AAAA,MACb,KAAKA,OAAAA,OAAO,KAAK;AACT,eAAA;AAAA,MAER,KAAKA,OAAAA,OAAO,KAAK;AAChB,eAAOC,
|
|
1
|
+
{"version":3,"file":"ApiKeyHelper.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/ApiKeyHelper.ts"],"sourcesContent":["import { ApiKey } from '../../type'\nimport { Providers } from '../../providers'\nimport { plusMinutes } from '../../utils/time'\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,MAAM;AAAA,MACb,KAAKA,OAAAA,OAAO,KAAK;AACT,eAAA;AAAA,MAER,KAAKA,OAAAA,OAAO,KAAK;AAChB,eAAOC,KAAY,YAAA,UAAU,IAAI,GAAG,cAAc,kBAAkB;AAAA,MAErE,KAAKD,OAAAA,OAAO,KAAK;AACT,eAAA;AAAA,IAAA;AAAA,EACT;AAEF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiKeyHelper.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/ApiKeyHelper.ts"],"sourcesContent":["import { ApiKey } from '../../type'\nimport { Providers } from '../../providers'\nimport { plusMinutes } from '../../utils/time'\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,MAAM;AAAA,MACb,KAAK,OAAO,KAAK;AACT,eAAA;AAAA,MAER,KAAK,OAAO,KAAK;AAChB,eAAO,YAAY,UAAU,IAAI,GAAG,cAAc,kBAAkB;AAAA,MAErE,KAAK,OAAO,KAAK;AACT,eAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"ApiKeyHelper.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/ApiKeyHelper.ts"],"sourcesContent":["import { ApiKey } from '../../type'\nimport { Providers } from '../../providers'\nimport { plusMinutes } from '../../utils/time'\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,MAAM;AAAA,MACb,KAAK,OAAO,KAAK;AACT,eAAA;AAAA,MAER,KAAK,OAAO,KAAK;AAChB,eAAO,YAAY,UAAU,IAAI,GAAG,cAAc,kBAAkB;AAAA,MAErE,KAAK,OAAO,KAAK;AACT,eAAA;AAAA,IAAA;AAAA,EACT;AAEF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateApiKeyCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/CreateApiKeyCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { ApiKey } from '../../type'\nimport { ApiKeyHelper } from './ApiKeyHelper'\nimport { InsertBuilder } from '@contember/database'\nimport { computeTokenHash, generateToken, TokenHash } from '../../utils'\n\ninterface CreateSessionApiKeyArgs {\n\ttype: ApiKey.Type.SESSION\n\tidentityId: string\n\texpiration?: number\n\ttokenHash?: string\n}\n\ninterface CreatePermanentApiKeyArgs {\n\ttype: ApiKey.Type.PERMANENT\n\tidentityId: string\n\ttokenHash?: TokenHash\n\texpiration?: undefined\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 = undefined\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\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})\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":["generateToken","computeTokenHash","InsertBuilder","ApiKeyHelper"],"mappings":";;;;;;AAwBO,MAAM,oBAAkE;AAAA,EAC9E,YAAoB,MAAwB;AAAxB,SAAA,OAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"CreateApiKeyCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/CreateApiKeyCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { ApiKey } from '../../type'\nimport { ApiKeyHelper } from './ApiKeyHelper'\nimport { InsertBuilder } from '@contember/database'\nimport { computeTokenHash, generateToken, TokenHash } from '../../utils'\n\ninterface CreateSessionApiKeyArgs {\n\ttype: ApiKey.Type.SESSION\n\tidentityId: string\n\texpiration?: number\n\ttokenHash?: string\n}\n\ninterface CreatePermanentApiKeyArgs {\n\ttype: ApiKey.Type.PERMANENT\n\tidentityId: string\n\ttokenHash?: TokenHash\n\texpiration?: undefined\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 = undefined\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\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})\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":["generateToken","computeTokenHash","InsertBuilder","ApiKeyHelper"],"mappings":";;;;;;AAwBO,MAAM,oBAAkE;AAAA,EAC9E,YAAoB,MAAwB;AAAxB,SAAA,OAAA;AAAA,EAAA;AAAA,EAEpB,MAAM,QAAQ,EAAE,IAAI,aAA+D;AAC5E,UAAA,WAAW,UAAU,KAAK;AAChC,QAAI,QAAQ;AACR,QAAA,YAAY,KAAK,KAAK;AAC1B,QAAI,CAAC,WAAW;AACP,cAAA,MAAMA,yBAAc,SAAS;AACrC,kBAAYC,4BAAiB,KAAK;AAAA,IAAA;AAGnC,UAAMC,SAAAA,cAAc,OAAO,EACzB,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,IAAI;AAAA,IAAA,CAC1B,EACA,QAAQ,EAAE;AAEL,WAAA,IAAI,0BAA0B,UAAU,KAAK;AAAA,EAAA;AAEtD;AAEO,MAAM,0BAA0B;AAAA,EACtC,YAA4B,IAA4B,OAAgB;AAA5C,SAAA,KAAA;AAA4B,SAAA,QAAA;AAAA,EAAA;AAEzD;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateApiKeyCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/CreateApiKeyCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { ApiKey } from '../../type'\nimport { ApiKeyHelper } from './ApiKeyHelper'\nimport { InsertBuilder } from '@contember/database'\nimport { computeTokenHash, generateToken, TokenHash } from '../../utils'\n\ninterface CreateSessionApiKeyArgs {\n\ttype: ApiKey.Type.SESSION\n\tidentityId: string\n\texpiration?: number\n\ttokenHash?: string\n}\n\ninterface CreatePermanentApiKeyArgs {\n\ttype: ApiKey.Type.PERMANENT\n\tidentityId: string\n\ttokenHash?: TokenHash\n\texpiration?: undefined\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 = undefined\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\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})\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":";;;;AAwBO,MAAM,oBAAkE;AAAA,EAC9E,YAAoB,MAAwB;AAAxB,SAAA,OAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"CreateApiKeyCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/CreateApiKeyCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { ApiKey } from '../../type'\nimport { ApiKeyHelper } from './ApiKeyHelper'\nimport { InsertBuilder } from '@contember/database'\nimport { computeTokenHash, generateToken, TokenHash } from '../../utils'\n\ninterface CreateSessionApiKeyArgs {\n\ttype: ApiKey.Type.SESSION\n\tidentityId: string\n\texpiration?: number\n\ttokenHash?: string\n}\n\ninterface CreatePermanentApiKeyArgs {\n\ttype: ApiKey.Type.PERMANENT\n\tidentityId: string\n\ttokenHash?: TokenHash\n\texpiration?: undefined\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 = undefined\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\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})\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":";;;;AAwBO,MAAM,oBAAkE;AAAA,EAC9E,YAAoB,MAAwB;AAAxB,SAAA,OAAA;AAAA,EAAA;AAAA,EAEpB,MAAM,QAAQ,EAAE,IAAI,aAA+D;AAC5E,UAAA,WAAW,UAAU,KAAK;AAChC,QAAI,QAAQ;AACR,QAAA,YAAY,KAAK,KAAK;AAC1B,QAAI,CAAC,WAAW;AACP,cAAA,MAAM,cAAc,SAAS;AACrC,kBAAY,iBAAiB,KAAK;AAAA,IAAA;AAGnC,UAAMA,gBAAc,OAAO,EACzB,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,IAAI;AAAA,IAAA,CAC1B,EACA,QAAQ,EAAE;AAEL,WAAA,IAAI,0BAA0B,UAAU,KAAK;AAAA,EAAA;AAEtD;AAEO,MAAM,0BAA0B;AAAA,EACtC,YAA4B,IAA4B,OAAgB;AAA5C,SAAA,KAAA;AAA4B,SAAA,QAAA;AAAA,EAAA;AAEzD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisableApiKeyCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/DisableApiKeyCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { UpdateBuilder } from '@contember/database'\n\nexport class DisableApiKeyCommand implements Command<boolean> {\n\tconstructor(private readonly apiKeyId: string) {}\n\n\tasync execute({ db }: Command.Args): Promise<boolean> {\n\t\tconst qb = UpdateBuilder.create()\n\t\t\t.table('api_key')\n\t\t\t.where({\n\t\t\t\tid: this.apiKeyId,\n\t\t\t})\n\t\t\t.values({ disabled_at: new Date() })\n\n\t\treturn (await qb.execute(db)) > 0\n\t}\n}\n"],"names":["UpdateBuilder"],"mappings":";;;AAGO,MAAM,qBAAiD;AAAA,EAC7D,YAA6B,UAAkB;AAAlB,SAAA,WAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"DisableApiKeyCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/DisableApiKeyCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { UpdateBuilder } from '@contember/database'\n\nexport class DisableApiKeyCommand implements Command<boolean> {\n\tconstructor(private readonly apiKeyId: string) {}\n\n\tasync execute({ db }: Command.Args): Promise<boolean> {\n\t\tconst qb = UpdateBuilder.create()\n\t\t\t.table('api_key')\n\t\t\t.where({\n\t\t\t\tid: this.apiKeyId,\n\t\t\t})\n\t\t\t.values({ disabled_at: new Date() })\n\n\t\treturn (await qb.execute(db)) > 0\n\t}\n}\n"],"names":["UpdateBuilder"],"mappings":";;;AAGO,MAAM,qBAAiD;AAAA,EAC7D,YAA6B,UAAkB;AAAlB,SAAA,WAAA;AAAA,EAAA;AAAA,EAE7B,MAAM,QAAQ,EAAE,MAAsC;AACrD,UAAM,KAAKA,SAAAA,cAAc,OAAA,EACvB,MAAM,SAAS,EACf,MAAM;AAAA,MACN,IAAI,KAAK;AAAA,IACT,CAAA,EACA,OAAO,EAAE,aAAiB,oBAAA,QAAQ;AAEpC,WAAQ,MAAM,GAAG,QAAQ,EAAE,IAAK;AAAA,EAAA;AAElC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisableApiKeyCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/DisableApiKeyCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { UpdateBuilder } from '@contember/database'\n\nexport class DisableApiKeyCommand implements Command<boolean> {\n\tconstructor(private readonly apiKeyId: string) {}\n\n\tasync execute({ db }: Command.Args): Promise<boolean> {\n\t\tconst qb = UpdateBuilder.create()\n\t\t\t.table('api_key')\n\t\t\t.where({\n\t\t\t\tid: this.apiKeyId,\n\t\t\t})\n\t\t\t.values({ disabled_at: new Date() })\n\n\t\treturn (await qb.execute(db)) > 0\n\t}\n}\n"],"names":["UpdateBuilder"],"mappings":";AAGO,MAAM,qBAAiD;AAAA,EAC7D,YAA6B,UAAkB;AAAlB,SAAA,WAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"DisableApiKeyCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/DisableApiKeyCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { UpdateBuilder } from '@contember/database'\n\nexport class DisableApiKeyCommand implements Command<boolean> {\n\tconstructor(private readonly apiKeyId: string) {}\n\n\tasync execute({ db }: Command.Args): Promise<boolean> {\n\t\tconst qb = UpdateBuilder.create()\n\t\t\t.table('api_key')\n\t\t\t.where({\n\t\t\t\tid: this.apiKeyId,\n\t\t\t})\n\t\t\t.values({ disabled_at: new Date() })\n\n\t\treturn (await qb.execute(db)) > 0\n\t}\n}\n"],"names":["UpdateBuilder"],"mappings":";AAGO,MAAM,qBAAiD;AAAA,EAC7D,YAA6B,UAAkB;AAAlB,SAAA,WAAA;AAAA,EAAA;AAAA,EAE7B,MAAM,QAAQ,EAAE,MAAsC;AACrD,UAAM,KAAKA,gBAAc,OAAA,EACvB,MAAM,SAAS,EACf,MAAM;AAAA,MACN,IAAI,KAAK;AAAA,IACT,CAAA,EACA,OAAO,EAAE,aAAiB,oBAAA,QAAQ;AAEpC,WAAQ,MAAM,GAAG,QAAQ,EAAE,IAAK;AAAA,EAAA;AAElC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisableIdentityApiKeysCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/DisableIdentityApiKeysCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { UpdateBuilder } from '@contember/database'\n\nexport class DisableIdentityApiKeysCommand implements Command<void> {\n\tconstructor(private readonly identityId: string) {}\n\n\tasync execute({ db }: Command.Args): Promise<void> {\n\t\tconst qb = UpdateBuilder.create()\n\t\t\t.table('api_key')\n\t\t\t.where({\n\t\t\t\tidentity_id: this.identityId,\n\t\t\t})\n\t\t\t.values({ disabled_at: new Date() })\n\n\t\tawait qb.execute(db)\n\t}\n}\n"],"names":["UpdateBuilder"],"mappings":";;;AAGO,MAAM,8BAAuD;AAAA,EACnE,YAA6B,YAAoB;AAApB,SAAA,aAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"DisableIdentityApiKeysCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/DisableIdentityApiKeysCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { UpdateBuilder } from '@contember/database'\n\nexport class DisableIdentityApiKeysCommand implements Command<void> {\n\tconstructor(private readonly identityId: string) {}\n\n\tasync execute({ db }: Command.Args): Promise<void> {\n\t\tconst qb = UpdateBuilder.create()\n\t\t\t.table('api_key')\n\t\t\t.where({\n\t\t\t\tidentity_id: this.identityId,\n\t\t\t})\n\t\t\t.values({ disabled_at: new Date() })\n\n\t\tawait qb.execute(db)\n\t}\n}\n"],"names":["UpdateBuilder"],"mappings":";;;AAGO,MAAM,8BAAuD;AAAA,EACnE,YAA6B,YAAoB;AAApB,SAAA,aAAA;AAAA,EAAA;AAAA,EAE7B,MAAM,QAAQ,EAAE,MAAmC;AAClD,UAAM,KAAKA,SAAAA,cAAc,OAAA,EACvB,MAAM,SAAS,EACf,MAAM;AAAA,MACN,aAAa,KAAK;AAAA,IAClB,CAAA,EACA,OAAO,EAAE,aAAiB,oBAAA,QAAQ;AAE9B,UAAA,GAAG,QAAQ,EAAE;AAAA,EAAA;AAErB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisableIdentityApiKeysCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/DisableIdentityApiKeysCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { UpdateBuilder } from '@contember/database'\n\nexport class DisableIdentityApiKeysCommand implements Command<void> {\n\tconstructor(private readonly identityId: string) {}\n\n\tasync execute({ db }: Command.Args): Promise<void> {\n\t\tconst qb = UpdateBuilder.create()\n\t\t\t.table('api_key')\n\t\t\t.where({\n\t\t\t\tidentity_id: this.identityId,\n\t\t\t})\n\t\t\t.values({ disabled_at: new Date() })\n\n\t\tawait qb.execute(db)\n\t}\n}\n"],"names":["UpdateBuilder"],"mappings":";AAGO,MAAM,8BAAuD;AAAA,EACnE,YAA6B,YAAoB;AAApB,SAAA,aAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"DisableIdentityApiKeysCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/DisableIdentityApiKeysCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { UpdateBuilder } from '@contember/database'\n\nexport class DisableIdentityApiKeysCommand implements Command<void> {\n\tconstructor(private readonly identityId: string) {}\n\n\tasync execute({ db }: Command.Args): Promise<void> {\n\t\tconst qb = UpdateBuilder.create()\n\t\t\t.table('api_key')\n\t\t\t.where({\n\t\t\t\tidentity_id: this.identityId,\n\t\t\t})\n\t\t\t.values({ disabled_at: new Date() })\n\n\t\tawait qb.execute(db)\n\t}\n}\n"],"names":["UpdateBuilder"],"mappings":";AAGO,MAAM,8BAAuD;AAAA,EACnE,YAA6B,YAAoB;AAApB,SAAA,aAAA;AAAA,EAAA;AAAA,EAE7B,MAAM,QAAQ,EAAE,MAAmC;AAClD,UAAM,KAAKA,gBAAc,OAAA,EACvB,MAAM,SAAS,EACf,MAAM;AAAA,MACN,aAAa,KAAK;AAAA,IAClB,CAAA,EACA,OAAO,EAAE,aAAiB,oBAAA,QAAQ;AAE9B,UAAA,GAAG,QAAQ,EAAE;AAAA,EAAA;AAErB;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisableOneOffApiKeyCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/DisableOneOffApiKeyCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { ApiKey } from '../../type'\nimport { UpdateBuilder } from '@contember/database'\n\nexport class DisableOneOffApiKeyCommand implements Command<void> {\n\tconstructor(private readonly apiKeyId: string) {}\n\n\tasync execute({ db }: Command.Args): Promise<void> {\n\t\tconst qb = UpdateBuilder.create()\n\t\t\t.table('api_key')\n\t\t\t.where({\n\t\t\t\tid: this.apiKeyId,\n\t\t\t\ttype: ApiKey.Type.ONE_OFF,\n\t\t\t})\n\t\t\t.values({ disabled_at: new Date() })\n\n\t\tawait qb.execute(db)\n\t}\n}\n"],"names":["UpdateBuilder","ApiKey"],"mappings":";;;;AAIO,MAAM,2BAAoD;AAAA,EAChE,YAA6B,UAAkB;AAAlB,SAAA,WAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"DisableOneOffApiKeyCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/DisableOneOffApiKeyCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { ApiKey } from '../../type'\nimport { UpdateBuilder } from '@contember/database'\n\nexport class DisableOneOffApiKeyCommand implements Command<void> {\n\tconstructor(private readonly apiKeyId: string) {}\n\n\tasync execute({ db }: Command.Args): Promise<void> {\n\t\tconst qb = UpdateBuilder.create()\n\t\t\t.table('api_key')\n\t\t\t.where({\n\t\t\t\tid: this.apiKeyId,\n\t\t\t\ttype: ApiKey.Type.ONE_OFF,\n\t\t\t})\n\t\t\t.values({ disabled_at: new Date() })\n\n\t\tawait qb.execute(db)\n\t}\n}\n"],"names":["UpdateBuilder","ApiKey"],"mappings":";;;;AAIO,MAAM,2BAAoD;AAAA,EAChE,YAA6B,UAAkB;AAAlB,SAAA,WAAA;AAAA,EAAA;AAAA,EAE7B,MAAM,QAAQ,EAAE,MAAmC;AAClD,UAAM,KAAKA,SAAAA,cAAc,OAAA,EACvB,MAAM,SAAS,EACf,MAAM;AAAA,MACN,IAAI,KAAK;AAAA,MACT,MAAMC,cAAO,KAAK;AAAA,IAClB,CAAA,EACA,OAAO,EAAE,aAAiB,oBAAA,QAAQ;AAE9B,UAAA,GAAG,QAAQ,EAAE;AAAA,EAAA;AAErB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisableOneOffApiKeyCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/DisableOneOffApiKeyCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { ApiKey } from '../../type'\nimport { UpdateBuilder } from '@contember/database'\n\nexport class DisableOneOffApiKeyCommand implements Command<void> {\n\tconstructor(private readonly apiKeyId: string) {}\n\n\tasync execute({ db }: Command.Args): Promise<void> {\n\t\tconst qb = UpdateBuilder.create()\n\t\t\t.table('api_key')\n\t\t\t.where({\n\t\t\t\tid: this.apiKeyId,\n\t\t\t\ttype: ApiKey.Type.ONE_OFF,\n\t\t\t})\n\t\t\t.values({ disabled_at: new Date() })\n\n\t\tawait qb.execute(db)\n\t}\n}\n"],"names":["UpdateBuilder"],"mappings":";;AAIO,MAAM,2BAAoD;AAAA,EAChE,YAA6B,UAAkB;AAAlB,SAAA,WAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"DisableOneOffApiKeyCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/DisableOneOffApiKeyCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { ApiKey } from '../../type'\nimport { UpdateBuilder } from '@contember/database'\n\nexport class DisableOneOffApiKeyCommand implements Command<void> {\n\tconstructor(private readonly apiKeyId: string) {}\n\n\tasync execute({ db }: Command.Args): Promise<void> {\n\t\tconst qb = UpdateBuilder.create()\n\t\t\t.table('api_key')\n\t\t\t.where({\n\t\t\t\tid: this.apiKeyId,\n\t\t\t\ttype: ApiKey.Type.ONE_OFF,\n\t\t\t})\n\t\t\t.values({ disabled_at: new Date() })\n\n\t\tawait qb.execute(db)\n\t}\n}\n"],"names":["UpdateBuilder"],"mappings":";;AAIO,MAAM,2BAAoD;AAAA,EAChE,YAA6B,UAAkB;AAAlB,SAAA,WAAA;AAAA,EAAA;AAAA,EAE7B,MAAM,QAAQ,EAAE,MAAmC;AAClD,UAAM,KAAKA,gBAAc,OAAA,EACvB,MAAM,SAAS,EACf,MAAM;AAAA,MACN,IAAI,KAAK;AAAA,MACT,MAAM,OAAO,KAAK;AAAA,IAClB,CAAA,EACA,OAAO,EAAE,aAAiB,oBAAA,QAAQ;AAE9B,UAAA,GAAG,QAAQ,EAAE;AAAA,EAAA;AAErB;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProlongApiKeyCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/ProlongApiKeyCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { ApiKey } from '../../type'\nimport { ApiKeyHelper } from './ApiKeyHelper'\nimport { UpdateBuilder } from '@contember/database'\n\nconst PROLONG_THROTTLE_MS = 60_000\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) {}\n\n\tasync execute({ db, providers }: Command.Args): Promise<void> {\n\t\tconst newExpiration = ApiKeyHelper.getExpiration(providers, this.type, this.expiration)\n\t\tif (newExpiration === null) {\n\t\t\treturn\n\t\t}\n\n\t\tif (this.currentExpiration) {\n\t\t\tconst prolongMs = newExpiration.getTime() - this.currentExpiration.getTime()\n\t\t\tif (prolongMs > 0 && prolongMs < PROLONG_THROTTLE_MS) {\n\t\t\t\treturn\n\t\t\t}\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({\n\t\t\t\texpires_at: newExpiration,\n\t\t\t})\n\t\tawait qb.execute(db)\n\t}\n}\n"],"names":["ApiKeyHelper","UpdateBuilder"],"mappings":";;;;AAKA,MAAM,sBAAsB;AAErB,MAAM,qBAA8C;AAAA,EAC1D,YACkB,IACA,MACA,YACA,mBAChB;AAJgB,SAAA,KAAA;AACA,SAAA,OAAA;AACA,SAAA,aAAA;AACA,SAAA,oBAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"ProlongApiKeyCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/ProlongApiKeyCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { ApiKey } from '../../type'\nimport { ApiKeyHelper } from './ApiKeyHelper'\nimport { UpdateBuilder } from '@contember/database'\n\nconst PROLONG_THROTTLE_MS = 60_000\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) {}\n\n\tasync execute({ db, providers }: Command.Args): Promise<void> {\n\t\tconst newExpiration = ApiKeyHelper.getExpiration(providers, this.type, this.expiration)\n\t\tif (newExpiration === null) {\n\t\t\treturn\n\t\t}\n\n\t\tif (this.currentExpiration) {\n\t\t\tconst prolongMs = newExpiration.getTime() - this.currentExpiration.getTime()\n\t\t\tif (prolongMs > 0 && prolongMs < PROLONG_THROTTLE_MS) {\n\t\t\t\treturn\n\t\t\t}\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({\n\t\t\t\texpires_at: newExpiration,\n\t\t\t})\n\t\tawait qb.execute(db)\n\t}\n}\n"],"names":["ApiKeyHelper","UpdateBuilder"],"mappings":";;;;AAKA,MAAM,sBAAsB;AAErB,MAAM,qBAA8C;AAAA,EAC1D,YACkB,IACA,MACA,YACA,mBAChB;AAJgB,SAAA,KAAA;AACA,SAAA,OAAA;AACA,SAAA,aAAA;AACA,SAAA,oBAAA;AAAA,EAAA;AAAA,EAGlB,MAAM,QAAQ,EAAE,IAAI,aAA0C;AAC7D,UAAM,gBAAgBA,aAAa,aAAA,cAAc,WAAW,KAAK,MAAM,KAAK,UAAU;AACtF,QAAI,kBAAkB,MAAM;AAC3B;AAAA,IAAA;AAGD,QAAI,KAAK,mBAAmB;AAC3B,YAAM,YAAY,cAAc,QAAY,IAAA,KAAK,kBAAkB,QAAQ;AACvE,UAAA,YAAY,KAAK,YAAY,qBAAqB;AACrD;AAAA,MAAA;AAAA,IACD;AAGD,UAAM,KAAKC,SAAA,cAAc,OAAO,EAC9B,MAAM,SAAS,EACf,MAAM,EAAE,IAAI,KAAK,GAAI,CAAA,EACrB,OAAO;AAAA,MACP,YAAY;AAAA,IAAA,CACZ;AACI,UAAA,GAAG,QAAQ,EAAE;AAAA,EAAA;AAErB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProlongApiKeyCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/ProlongApiKeyCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { ApiKey } from '../../type'\nimport { ApiKeyHelper } from './ApiKeyHelper'\nimport { UpdateBuilder } from '@contember/database'\n\nconst PROLONG_THROTTLE_MS = 60_000\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) {}\n\n\tasync execute({ db, providers }: Command.Args): Promise<void> {\n\t\tconst newExpiration = ApiKeyHelper.getExpiration(providers, this.type, this.expiration)\n\t\tif (newExpiration === null) {\n\t\t\treturn\n\t\t}\n\n\t\tif (this.currentExpiration) {\n\t\t\tconst prolongMs = newExpiration.getTime() - this.currentExpiration.getTime()\n\t\t\tif (prolongMs > 0 && prolongMs < PROLONG_THROTTLE_MS) {\n\t\t\t\treturn\n\t\t\t}\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({\n\t\t\t\texpires_at: newExpiration,\n\t\t\t})\n\t\tawait qb.execute(db)\n\t}\n}\n"],"names":["UpdateBuilder"],"mappings":";;AAKA,MAAM,sBAAsB;AAErB,MAAM,qBAA8C;AAAA,EAC1D,YACkB,IACA,MACA,YACA,mBAChB;AAJgB,SAAA,KAAA;AACA,SAAA,OAAA;AACA,SAAA,aAAA;AACA,SAAA,oBAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"ProlongApiKeyCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/apiKey/ProlongApiKeyCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { ApiKey } from '../../type'\nimport { ApiKeyHelper } from './ApiKeyHelper'\nimport { UpdateBuilder } from '@contember/database'\n\nconst PROLONG_THROTTLE_MS = 60_000\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) {}\n\n\tasync execute({ db, providers }: Command.Args): Promise<void> {\n\t\tconst newExpiration = ApiKeyHelper.getExpiration(providers, this.type, this.expiration)\n\t\tif (newExpiration === null) {\n\t\t\treturn\n\t\t}\n\n\t\tif (this.currentExpiration) {\n\t\t\tconst prolongMs = newExpiration.getTime() - this.currentExpiration.getTime()\n\t\t\tif (prolongMs > 0 && prolongMs < PROLONG_THROTTLE_MS) {\n\t\t\t\treturn\n\t\t\t}\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({\n\t\t\t\texpires_at: newExpiration,\n\t\t\t})\n\t\tawait qb.execute(db)\n\t}\n}\n"],"names":["UpdateBuilder"],"mappings":";;AAKA,MAAM,sBAAsB;AAErB,MAAM,qBAA8C;AAAA,EAC1D,YACkB,IACA,MACA,YACA,mBAChB;AAJgB,SAAA,KAAA;AACA,SAAA,OAAA;AACA,SAAA,aAAA;AACA,SAAA,oBAAA;AAAA,EAAA;AAAA,EAGlB,MAAM,QAAQ,EAAE,IAAI,aAA0C;AAC7D,UAAM,gBAAgB,aAAa,cAAc,WAAW,KAAK,MAAM,KAAK,UAAU;AACtF,QAAI,kBAAkB,MAAM;AAC3B;AAAA,IAAA;AAGD,QAAI,KAAK,mBAAmB;AAC3B,YAAM,YAAY,cAAc,QAAY,IAAA,KAAK,kBAAkB,QAAQ;AACvE,UAAA,YAAY,KAAK,YAAY,qBAAqB;AACrD;AAAA,MAAA;AAAA,IACD;AAGD,UAAM,KAAKA,gBAAc,OAAO,EAC9B,MAAM,SAAS,EACf,MAAM,EAAE,IAAI,KAAK,GAAI,CAAA,EACrB,OAAO;AAAA,MACP,YAAY;AAAA,IAAA,CACZ;AACI,UAAA,GAAG,QAAQ,EAAE;AAAA,EAAA;AAErB;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const Database = require("@contember/database");
|
|
4
|
+
class UpdateConfigurationCommand {
|
|
5
|
+
constructor(configuration) {
|
|
6
|
+
this.configuration = configuration;
|
|
7
|
+
}
|
|
8
|
+
async execute({ db }) {
|
|
9
|
+
const result = await Database.UpdateBuilder.create().table("config").where({ id: "singleton" }).values({
|
|
10
|
+
passwordless_enabled: this.configuration.passwordless?.enabled,
|
|
11
|
+
passwordless_url: this.configuration.passwordless?.url,
|
|
12
|
+
passwordless_expiration_minutes: this.configuration.passwordless?.expirationMinutes
|
|
13
|
+
}).execute(db);
|
|
14
|
+
if (!result) {
|
|
15
|
+
throw new Error("Configuration not found");
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.UpdateConfigurationCommand = UpdateConfigurationCommand;
|
|
20
|
+
//# sourceMappingURL=UpdateConfigurationCommand.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UpdateConfigurationCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/configuration/UpdateConfigurationCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { ConfigInput } from '../../../schema'\nimport { UpdateBuilder } from '@contember/database'\n\nexport class UpdateConfigurationCommand implements Command<void> {\n\tconstructor(\n\t\tprivate readonly configuration: ConfigInput,\n\t) {\n\t}\n\n\tasync execute({ db }: Command.Args): Promise<void> {\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\tpasswordless_enabled: this.configuration.passwordless?.enabled,\n\t\t\t\tpasswordless_url: this.configuration.passwordless?.url,\n\t\t\t\tpasswordless_expiration_minutes: this.configuration.passwordless?.expirationMinutes,\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}\n"],"names":["UpdateBuilder"],"mappings":";;;AAIO,MAAM,2BAAoD;AAAA,EAChE,YACkB,eAChB;AADgB,SAAA,gBAAA;AAAA,EAAA;AAAA,EAIlB,MAAM,QAAQ,EAAE,MAAmC;AAClD,UAAM,SAAS,MAAMA,SAAAA,cAAc,OAAA,EACjC,MAAM,QAAQ,EACd,MAAM,EAAE,IAAI,YAAa,CAAA,EACzB,OAAO;AAAA,MACP,sBAAsB,KAAK,cAAc,cAAc;AAAA,MACvD,kBAAkB,KAAK,cAAc,cAAc;AAAA,MACnD,iCAAiC,KAAK,cAAc,cAAc;AAAA,IAAA,CAClE,EACA,QAAQ,EAAE;AACZ,QAAI,CAAC,QAAQ;AACN,YAAA,IAAI,MAAM,yBAAyB;AAAA,IAAA;AAAA,EAC1C;AAGF;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { UpdateBuilder as UpdateBuilder$1 } from "@contember/database";
|
|
2
|
+
class UpdateConfigurationCommand {
|
|
3
|
+
constructor(configuration) {
|
|
4
|
+
this.configuration = configuration;
|
|
5
|
+
}
|
|
6
|
+
async execute({ db }) {
|
|
7
|
+
const result = await UpdateBuilder$1.create().table("config").where({ id: "singleton" }).values({
|
|
8
|
+
passwordless_enabled: this.configuration.passwordless?.enabled,
|
|
9
|
+
passwordless_url: this.configuration.passwordless?.url,
|
|
10
|
+
passwordless_expiration_minutes: this.configuration.passwordless?.expirationMinutes
|
|
11
|
+
}).execute(db);
|
|
12
|
+
if (!result) {
|
|
13
|
+
throw new Error("Configuration not found");
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
UpdateConfigurationCommand
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=UpdateConfigurationCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UpdateConfigurationCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/configuration/UpdateConfigurationCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { ConfigInput } from '../../../schema'\nimport { UpdateBuilder } from '@contember/database'\n\nexport class UpdateConfigurationCommand implements Command<void> {\n\tconstructor(\n\t\tprivate readonly configuration: ConfigInput,\n\t) {\n\t}\n\n\tasync execute({ db }: Command.Args): Promise<void> {\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\tpasswordless_enabled: this.configuration.passwordless?.enabled,\n\t\t\t\tpasswordless_url: this.configuration.passwordless?.url,\n\t\t\t\tpasswordless_expiration_minutes: this.configuration.passwordless?.expirationMinutes,\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}\n"],"names":["UpdateBuilder"],"mappings":";AAIO,MAAM,2BAAoD;AAAA,EAChE,YACkB,eAChB;AADgB,SAAA,gBAAA;AAAA,EAAA;AAAA,EAIlB,MAAM,QAAQ,EAAE,MAAmC;AAClD,UAAM,SAAS,MAAMA,gBAAc,OAAA,EACjC,MAAM,QAAQ,EACd,MAAM,EAAE,IAAI,YAAa,CAAA,EACzB,OAAO;AAAA,MACP,sBAAsB,KAAK,cAAc,cAAc;AAAA,MACvD,kBAAkB,KAAK,cAAc,cAAc;AAAA,MACnD,iCAAiC,KAAK,cAAc,cAAc;AAAA,IAAA,CAClE,EACA,QAAQ,EAAE;AACZ,QAAI,CAAC,QAAQ;AACN,YAAA,IAAI,MAAM,yBAAyB;AAAA,IAAA;AAAA,EAC1C;AAGF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateIdentityCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/identity/CreateIdentityCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { InsertBuilder } from '@contember/database'\n\nexport class CreateIdentityCommand implements Command<string> {\n\tconstructor(private readonly roles: readonly string[], private readonly description?: string) {}\n\n\tpublic async execute({ db, providers }: Command.Args): Promise<string> {\n\t\tconst identityId = providers.uuid()\n\t\tawait InsertBuilder.create()\n\t\t\t.into('identity')\n\t\t\t.values({\n\t\t\t\tid: identityId,\n\t\t\t\tparent_id: null,\n\t\t\t\troles: JSON.stringify(this.roles),\n\t\t\t\tdescription: this.description || null,\n\t\t\t\tcreated_at: providers.now(),\n\t\t\t})\n\t\t\t.execute(db)\n\n\t\treturn identityId\n\t}\n}\n"],"names":["InsertBuilder"],"mappings":";;;AAGO,MAAM,sBAAiD;AAAA,EAC7D,YAA6B,OAA2C,aAAsB;AAAjE,SAAA,QAAA;AAA2C,SAAA,cAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"CreateIdentityCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/identity/CreateIdentityCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { InsertBuilder } from '@contember/database'\n\nexport class CreateIdentityCommand implements Command<string> {\n\tconstructor(private readonly roles: readonly string[], private readonly description?: string) {}\n\n\tpublic async execute({ db, providers }: Command.Args): Promise<string> {\n\t\tconst identityId = providers.uuid()\n\t\tawait InsertBuilder.create()\n\t\t\t.into('identity')\n\t\t\t.values({\n\t\t\t\tid: identityId,\n\t\t\t\tparent_id: null,\n\t\t\t\troles: JSON.stringify(this.roles),\n\t\t\t\tdescription: this.description || null,\n\t\t\t\tcreated_at: providers.now(),\n\t\t\t})\n\t\t\t.execute(db)\n\n\t\treturn identityId\n\t}\n}\n"],"names":["InsertBuilder"],"mappings":";;;AAGO,MAAM,sBAAiD;AAAA,EAC7D,YAA6B,OAA2C,aAAsB;AAAjE,SAAA,QAAA;AAA2C,SAAA,cAAA;AAAA,EAAA;AAAA,EAExE,MAAa,QAAQ,EAAE,IAAI,aAA4C;AAChE,UAAA,aAAa,UAAU,KAAK;AAClC,UAAMA,SAAAA,cAAc,OAAO,EACzB,KAAK,UAAU,EACf,OAAO;AAAA,MACP,IAAI;AAAA,MACJ,WAAW;AAAA,MACX,OAAO,KAAK,UAAU,KAAK,KAAK;AAAA,MAChC,aAAa,KAAK,eAAe;AAAA,MACjC,YAAY,UAAU,IAAI;AAAA,IAAA,CAC1B,EACA,QAAQ,EAAE;AAEL,WAAA;AAAA,EAAA;AAET;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateIdentityCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/identity/CreateIdentityCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { InsertBuilder } from '@contember/database'\n\nexport class CreateIdentityCommand implements Command<string> {\n\tconstructor(private readonly roles: readonly string[], private readonly description?: string) {}\n\n\tpublic async execute({ db, providers }: Command.Args): Promise<string> {\n\t\tconst identityId = providers.uuid()\n\t\tawait InsertBuilder.create()\n\t\t\t.into('identity')\n\t\t\t.values({\n\t\t\t\tid: identityId,\n\t\t\t\tparent_id: null,\n\t\t\t\troles: JSON.stringify(this.roles),\n\t\t\t\tdescription: this.description || null,\n\t\t\t\tcreated_at: providers.now(),\n\t\t\t})\n\t\t\t.execute(db)\n\n\t\treturn identityId\n\t}\n}\n"],"names":["InsertBuilder"],"mappings":";AAGO,MAAM,sBAAiD;AAAA,EAC7D,YAA6B,OAA2C,aAAsB;AAAjE,SAAA,QAAA;AAA2C,SAAA,cAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"CreateIdentityCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/identity/CreateIdentityCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { InsertBuilder } from '@contember/database'\n\nexport class CreateIdentityCommand implements Command<string> {\n\tconstructor(private readonly roles: readonly string[], private readonly description?: string) {}\n\n\tpublic async execute({ db, providers }: Command.Args): Promise<string> {\n\t\tconst identityId = providers.uuid()\n\t\tawait InsertBuilder.create()\n\t\t\t.into('identity')\n\t\t\t.values({\n\t\t\t\tid: identityId,\n\t\t\t\tparent_id: null,\n\t\t\t\troles: JSON.stringify(this.roles),\n\t\t\t\tdescription: this.description || null,\n\t\t\t\tcreated_at: providers.now(),\n\t\t\t})\n\t\t\t.execute(db)\n\n\t\treturn identityId\n\t}\n}\n"],"names":["InsertBuilder"],"mappings":";AAGO,MAAM,sBAAiD;AAAA,EAC7D,YAA6B,OAA2C,aAAsB;AAAjE,SAAA,QAAA;AAA2C,SAAA,cAAA;AAAA,EAAA;AAAA,EAExE,MAAa,QAAQ,EAAE,IAAI,aAA4C;AAChE,UAAA,aAAa,UAAU,KAAK;AAClC,UAAMA,gBAAc,OAAO,EACzB,KAAK,UAAU,EACf,OAAO;AAAA,MACP,IAAI;AAAA,MACJ,WAAW;AAAA,MACX,OAAO,KAAK,UAAU,KAAK,KAAK;AAAA,MAChC,aAAa,KAAK,eAAe;AAAA,MACjC,YAAY,UAAU,IAAI;AAAA,IAAA,CAC1B,EACA,QAAQ,EAAE;AAEL,WAAA;AAAA,EAAA;AAET;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PatchIdentityGlobalRoles.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/identity/PatchIdentityGlobalRoles.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { UpdateBuilder } from '@contember/database'\n\nexport class PatchIdentityGlobalRoles implements Command<boolean> {\n\tconstructor(\n\t\tprivate readonly id: string,\n\t\tprivate readonly add: readonly string[],\n\t\tprivate readonly remove: readonly string[],\n\t) {\n\t}\n\n\tpublic async execute({ db, providers }: Command.Args): Promise<boolean> {\n\t\tconst result = await UpdateBuilder.create()\n\t\t\t.table('identity')\n\t\t\t.where({\n\t\t\t\tid: this.id,\n\t\t\t})\n\t\t\t.values({\n\t\t\t\troles: it => it.raw(`(\n\t\t\t\t\t\tSELECT JSONB_AGG(DISTINCT out_role)\n\t\t\t\t\t\tFROM JSONB_ARRAY_ELEMENTS_TEXT(roles || ?::jsonb) t(out_role)\n\t\t\t\t\t\tWHERE NOT(out_role = ANY (?::text[]))\n\t\t\t\t\t)`, JSON.stringify(this.add), this.remove),\n\t\t\t})\n\t\t\t.execute(db)\n\t\treturn result > 0\n\t}\n}\n"],"names":["UpdateBuilder"],"mappings":";;;AAGO,MAAM,yBAAqD;AAAA,EACjE,YACkB,IACA,KACA,QAChB;AAHgB,SAAA,KAAA;AACA,SAAA,MAAA;AACA,SAAA,SAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"PatchIdentityGlobalRoles.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/identity/PatchIdentityGlobalRoles.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { UpdateBuilder } from '@contember/database'\n\nexport class PatchIdentityGlobalRoles implements Command<boolean> {\n\tconstructor(\n\t\tprivate readonly id: string,\n\t\tprivate readonly add: readonly string[],\n\t\tprivate readonly remove: readonly string[],\n\t) {\n\t}\n\n\tpublic async execute({ db, providers }: Command.Args): Promise<boolean> {\n\t\tconst result = await UpdateBuilder.create()\n\t\t\t.table('identity')\n\t\t\t.where({\n\t\t\t\tid: this.id,\n\t\t\t})\n\t\t\t.values({\n\t\t\t\troles: it => it.raw(`(\n\t\t\t\t\t\tSELECT JSONB_AGG(DISTINCT out_role)\n\t\t\t\t\t\tFROM JSONB_ARRAY_ELEMENTS_TEXT(roles || ?::jsonb) t(out_role)\n\t\t\t\t\t\tWHERE NOT(out_role = ANY (?::text[]))\n\t\t\t\t\t)`, JSON.stringify(this.add), this.remove),\n\t\t\t})\n\t\t\t.execute(db)\n\t\treturn result > 0\n\t}\n}\n"],"names":["UpdateBuilder"],"mappings":";;;AAGO,MAAM,yBAAqD;AAAA,EACjE,YACkB,IACA,KACA,QAChB;AAHgB,SAAA,KAAA;AACA,SAAA,MAAA;AACA,SAAA,SAAA;AAAA,EAAA;AAAA,EAIlB,MAAa,QAAQ,EAAE,IAAI,aAA6C;AACjE,UAAA,SAAS,MAAMA,uBAAc,SACjC,MAAM,UAAU,EAChB,MAAM;AAAA,MACN,IAAI,KAAK;AAAA,IACT,CAAA,EACA,OAAO;AAAA,MACP,OAAO,CAAM,OAAA,GAAG,IAAI;AAAA;AAAA;AAAA;AAAA,SAIf,KAAK,UAAU,KAAK,GAAG,GAAG,KAAK,MAAM;AAAA,IAAA,CAC1C,EACA,QAAQ,EAAE;AACZ,WAAO,SAAS;AAAA,EAAA;AAElB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PatchIdentityGlobalRoles.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/identity/PatchIdentityGlobalRoles.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { UpdateBuilder } from '@contember/database'\n\nexport class PatchIdentityGlobalRoles implements Command<boolean> {\n\tconstructor(\n\t\tprivate readonly id: string,\n\t\tprivate readonly add: readonly string[],\n\t\tprivate readonly remove: readonly string[],\n\t) {\n\t}\n\n\tpublic async execute({ db, providers }: Command.Args): Promise<boolean> {\n\t\tconst result = await UpdateBuilder.create()\n\t\t\t.table('identity')\n\t\t\t.where({\n\t\t\t\tid: this.id,\n\t\t\t})\n\t\t\t.values({\n\t\t\t\troles: it => it.raw(`(\n\t\t\t\t\t\tSELECT JSONB_AGG(DISTINCT out_role)\n\t\t\t\t\t\tFROM JSONB_ARRAY_ELEMENTS_TEXT(roles || ?::jsonb) t(out_role)\n\t\t\t\t\t\tWHERE NOT(out_role = ANY (?::text[]))\n\t\t\t\t\t)`, JSON.stringify(this.add), this.remove),\n\t\t\t})\n\t\t\t.execute(db)\n\t\treturn result > 0\n\t}\n}\n"],"names":["UpdateBuilder"],"mappings":";AAGO,MAAM,yBAAqD;AAAA,EACjE,YACkB,IACA,KACA,QAChB;AAHgB,SAAA,KAAA;AACA,SAAA,MAAA;AACA,SAAA,SAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"PatchIdentityGlobalRoles.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/identity/PatchIdentityGlobalRoles.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { UpdateBuilder } from '@contember/database'\n\nexport class PatchIdentityGlobalRoles implements Command<boolean> {\n\tconstructor(\n\t\tprivate readonly id: string,\n\t\tprivate readonly add: readonly string[],\n\t\tprivate readonly remove: readonly string[],\n\t) {\n\t}\n\n\tpublic async execute({ db, providers }: Command.Args): Promise<boolean> {\n\t\tconst result = await UpdateBuilder.create()\n\t\t\t.table('identity')\n\t\t\t.where({\n\t\t\t\tid: this.id,\n\t\t\t})\n\t\t\t.values({\n\t\t\t\troles: it => it.raw(`(\n\t\t\t\t\t\tSELECT JSONB_AGG(DISTINCT out_role)\n\t\t\t\t\t\tFROM JSONB_ARRAY_ELEMENTS_TEXT(roles || ?::jsonb) t(out_role)\n\t\t\t\t\t\tWHERE NOT(out_role = ANY (?::text[]))\n\t\t\t\t\t)`, JSON.stringify(this.add), this.remove),\n\t\t\t})\n\t\t\t.execute(db)\n\t\treturn result > 0\n\t}\n}\n"],"names":["UpdateBuilder"],"mappings":";AAGO,MAAM,yBAAqD;AAAA,EACjE,YACkB,IACA,KACA,QAChB;AAHgB,SAAA,KAAA;AACA,SAAA,MAAA;AACA,SAAA,SAAA;AAAA,EAAA;AAAA,EAIlB,MAAa,QAAQ,EAAE,IAAI,aAA6C;AACjE,UAAA,SAAS,MAAMA,gBAAc,SACjC,MAAM,UAAU,EAChB,MAAM;AAAA,MACN,IAAI,KAAK;AAAA,IACT,CAAA,EACA,OAAO;AAAA,MACP,OAAO,CAAM,OAAA,GAAG,IAAI;AAAA;AAAA;AAAA;AAAA,SAIf,KAAK,UAAU,KAAK,GAAG,GAAG,KAAK,MAAM;AAAA,IAAA,CAC1C,EACA,QAAQ,EAAE;AACZ,WAAO,SAAS;AAAA,EAAA;AAElB;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateIdpCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/idp/CreateIdpCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { InsertBuilder } from '@contember/database'\nimport { IdentityProviderData } from '../../type'\n\nexport class CreateIdpCommand implements Command<void> {\n\tconstructor(\n\t\tprivate data: IdentityProviderData,\n\t) {\n\t}\n\n\tasync execute({ db, providers }: Command.Args): Promise<void> {\n\t\tconst { configuration, options: { autoSignUp, exclusive, initReturnsConfig }, slug, type } = this.data\n\t\tawait InsertBuilder.create()\n\t\t\t.into('identity_provider')\n\t\t\t.values({\n\t\t\t\tid: providers.uuid(),\n\t\t\t\tconfiguration,\n\t\t\t\tslug,\n\t\t\t\ttype,\n\t\t\t\tauto_sign_up: autoSignUp,\n\t\t\t\texclusive,\n\t\t\t\tinit_returns_config: initReturnsConfig,\n\t\t\t})\n\t\t\t.execute(db)\n\t}\n}\n"],"names":["InsertBuilder"],"mappings":";;;AAIO,MAAM,iBAA0C;AAAA,EACtD,YACS,MACP;AADO,SAAA,OAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"CreateIdpCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/idp/CreateIdpCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { InsertBuilder } from '@contember/database'\nimport { IdentityProviderData } from '../../type'\n\nexport class CreateIdpCommand implements Command<void> {\n\tconstructor(\n\t\tprivate data: IdentityProviderData,\n\t) {\n\t}\n\n\tasync execute({ db, providers }: Command.Args): Promise<void> {\n\t\tconst { configuration, options: { autoSignUp, exclusive, initReturnsConfig }, slug, type } = this.data\n\t\tawait InsertBuilder.create()\n\t\t\t.into('identity_provider')\n\t\t\t.values({\n\t\t\t\tid: providers.uuid(),\n\t\t\t\tconfiguration,\n\t\t\t\tslug,\n\t\t\t\ttype,\n\t\t\t\tauto_sign_up: autoSignUp,\n\t\t\t\texclusive,\n\t\t\t\tinit_returns_config: initReturnsConfig,\n\t\t\t})\n\t\t\t.execute(db)\n\t}\n}\n"],"names":["InsertBuilder"],"mappings":";;;AAIO,MAAM,iBAA0C;AAAA,EACtD,YACS,MACP;AADO,SAAA,OAAA;AAAA,EAAA;AAAA,EAIT,MAAM,QAAQ,EAAE,IAAI,aAA0C;AACvD,UAAA,EAAE,eAAe,SAAS,EAAE,YAAY,WAAW,kBAAA,GAAqB,MAAM,KAAK,IAAI,KAAK;AAClG,UAAMA,SAAAA,cAAc,OAAO,EACzB,KAAK,mBAAmB,EACxB,OAAO;AAAA,MACP,IAAI,UAAU,KAAK;AAAA,MACnB;AAAA,MACA;AAAA,MACA;AAAA,MACA,cAAc;AAAA,MACd;AAAA,MACA,qBAAqB;AAAA,IAAA,CACrB,EACA,QAAQ,EAAE;AAAA,EAAA;AAEd;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateIdpCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/idp/CreateIdpCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { InsertBuilder } from '@contember/database'\nimport { IdentityProviderData } from '../../type'\n\nexport class CreateIdpCommand implements Command<void> {\n\tconstructor(\n\t\tprivate data: IdentityProviderData,\n\t) {\n\t}\n\n\tasync execute({ db, providers }: Command.Args): Promise<void> {\n\t\tconst { configuration, options: { autoSignUp, exclusive, initReturnsConfig }, slug, type } = this.data\n\t\tawait InsertBuilder.create()\n\t\t\t.into('identity_provider')\n\t\t\t.values({\n\t\t\t\tid: providers.uuid(),\n\t\t\t\tconfiguration,\n\t\t\t\tslug,\n\t\t\t\ttype,\n\t\t\t\tauto_sign_up: autoSignUp,\n\t\t\t\texclusive,\n\t\t\t\tinit_returns_config: initReturnsConfig,\n\t\t\t})\n\t\t\t.execute(db)\n\t}\n}\n"],"names":["InsertBuilder"],"mappings":";AAIO,MAAM,iBAA0C;AAAA,EACtD,YACS,MACP;AADO,SAAA,OAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"CreateIdpCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/idp/CreateIdpCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { InsertBuilder } from '@contember/database'\nimport { IdentityProviderData } from '../../type'\n\nexport class CreateIdpCommand implements Command<void> {\n\tconstructor(\n\t\tprivate data: IdentityProviderData,\n\t) {\n\t}\n\n\tasync execute({ db, providers }: Command.Args): Promise<void> {\n\t\tconst { configuration, options: { autoSignUp, exclusive, initReturnsConfig }, slug, type } = this.data\n\t\tawait InsertBuilder.create()\n\t\t\t.into('identity_provider')\n\t\t\t.values({\n\t\t\t\tid: providers.uuid(),\n\t\t\t\tconfiguration,\n\t\t\t\tslug,\n\t\t\t\ttype,\n\t\t\t\tauto_sign_up: autoSignUp,\n\t\t\t\texclusive,\n\t\t\t\tinit_returns_config: initReturnsConfig,\n\t\t\t})\n\t\t\t.execute(db)\n\t}\n}\n"],"names":["InsertBuilder"],"mappings":";AAIO,MAAM,iBAA0C;AAAA,EACtD,YACS,MACP;AADO,SAAA,OAAA;AAAA,EAAA;AAAA,EAIT,MAAM,QAAQ,EAAE,IAAI,aAA0C;AACvD,UAAA,EAAE,eAAe,SAAS,EAAE,YAAY,WAAW,kBAAA,GAAqB,MAAM,KAAK,IAAI,KAAK;AAClG,UAAMA,gBAAc,OAAO,EACzB,KAAK,mBAAmB,EACxB,OAAO;AAAA,MACP,IAAI,UAAU,KAAK;AAAA,MACnB;AAAA,MACA;AAAA,MACA;AAAA,MACA,cAAc;AAAA,MACd;AAAA,MACA,qBAAqB;AAAA,IAAA,CACrB,EACA,QAAQ,EAAE;AAAA,EAAA;AAEd;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisableIdpCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/idp/DisableIdpCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { UpdateBuilder } from '@contember/database'\n\nexport class DisableIdpCommand implements Command<void> {\n\tconstructor(\n\t\tprivate id: string,\n\t) {\n\t}\n\n\tasync execute({ db, providers }: Command.Args): Promise<void> {\n\t\tawait UpdateBuilder.create()\n\t\t\t.table('identity_provider')\n\t\t\t.values({\n\t\t\t\tdisabled_at: providers.now(),\n\t\t\t})\n\t\t\t.where({\n\t\t\t\tid: this.id,\n\t\t\t})\n\t\t\t.execute(db)\n\t}\n}\n"],"names":["UpdateBuilder"],"mappings":";;;AAGO,MAAM,kBAA2C;AAAA,EACvD,YACS,IACP;AADO,SAAA,KAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"DisableIdpCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/idp/DisableIdpCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { UpdateBuilder } from '@contember/database'\n\nexport class DisableIdpCommand implements Command<void> {\n\tconstructor(\n\t\tprivate id: string,\n\t) {\n\t}\n\n\tasync execute({ db, providers }: Command.Args): Promise<void> {\n\t\tawait UpdateBuilder.create()\n\t\t\t.table('identity_provider')\n\t\t\t.values({\n\t\t\t\tdisabled_at: providers.now(),\n\t\t\t})\n\t\t\t.where({\n\t\t\t\tid: this.id,\n\t\t\t})\n\t\t\t.execute(db)\n\t}\n}\n"],"names":["UpdateBuilder"],"mappings":";;;AAGO,MAAM,kBAA2C;AAAA,EACvD,YACS,IACP;AADO,SAAA,KAAA;AAAA,EAAA;AAAA,EAIT,MAAM,QAAQ,EAAE,IAAI,aAA0C;AAC7D,UAAMA,SAAAA,cAAc,OAAO,EACzB,MAAM,mBAAmB,EACzB,OAAO;AAAA,MACP,aAAa,UAAU,IAAI;AAAA,IAC3B,CAAA,EACA,MAAM;AAAA,MACN,IAAI,KAAK;AAAA,IAAA,CACT,EACA,QAAQ,EAAE;AAAA,EAAA;AAEd;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisableIdpCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/idp/DisableIdpCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { UpdateBuilder } from '@contember/database'\n\nexport class DisableIdpCommand implements Command<void> {\n\tconstructor(\n\t\tprivate id: string,\n\t) {\n\t}\n\n\tasync execute({ db, providers }: Command.Args): Promise<void> {\n\t\tawait UpdateBuilder.create()\n\t\t\t.table('identity_provider')\n\t\t\t.values({\n\t\t\t\tdisabled_at: providers.now(),\n\t\t\t})\n\t\t\t.where({\n\t\t\t\tid: this.id,\n\t\t\t})\n\t\t\t.execute(db)\n\t}\n}\n"],"names":["UpdateBuilder"],"mappings":";AAGO,MAAM,kBAA2C;AAAA,EACvD,YACS,IACP;AADO,SAAA,KAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"DisableIdpCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/idp/DisableIdpCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { UpdateBuilder } from '@contember/database'\n\nexport class DisableIdpCommand implements Command<void> {\n\tconstructor(\n\t\tprivate id: string,\n\t) {\n\t}\n\n\tasync execute({ db, providers }: Command.Args): Promise<void> {\n\t\tawait UpdateBuilder.create()\n\t\t\t.table('identity_provider')\n\t\t\t.values({\n\t\t\t\tdisabled_at: providers.now(),\n\t\t\t})\n\t\t\t.where({\n\t\t\t\tid: this.id,\n\t\t\t})\n\t\t\t.execute(db)\n\t}\n}\n"],"names":["UpdateBuilder"],"mappings":";AAGO,MAAM,kBAA2C;AAAA,EACvD,YACS,IACP;AADO,SAAA,KAAA;AAAA,EAAA;AAAA,EAIT,MAAM,QAAQ,EAAE,IAAI,aAA0C;AAC7D,UAAMA,gBAAc,OAAO,EACzB,MAAM,mBAAmB,EACzB,OAAO;AAAA,MACP,aAAa,UAAU,IAAI;AAAA,IAC3B,CAAA,EACA,MAAM;AAAA,MACN,IAAI,KAAK;AAAA,IAAA,CACT,EACA,QAAQ,EAAE;AAAA,EAAA;AAEd;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnableIdpCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/idp/EnableIdpCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { UpdateBuilder } from '@contember/database'\n\nexport class EnableIdpCommand implements Command<void> {\n\tconstructor(\n\t\tprivate id: string,\n\t) {\n\t}\n\n\tasync execute({ db, providers }: Command.Args): Promise<void> {\n\t\tawait UpdateBuilder.create()\n\t\t\t.table('identity_provider')\n\t\t\t.values({\n\t\t\t\tdisabled_at: null,\n\t\t\t})\n\t\t\t.where({\n\t\t\t\tid: this.id,\n\t\t\t})\n\t\t\t.execute(db)\n\t}\n}\n"],"names":["UpdateBuilder"],"mappings":";;;AAGO,MAAM,iBAA0C;AAAA,EACtD,YACS,IACP;AADO,SAAA,KAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"EnableIdpCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/idp/EnableIdpCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { UpdateBuilder } from '@contember/database'\n\nexport class EnableIdpCommand implements Command<void> {\n\tconstructor(\n\t\tprivate id: string,\n\t) {\n\t}\n\n\tasync execute({ db, providers }: Command.Args): Promise<void> {\n\t\tawait UpdateBuilder.create()\n\t\t\t.table('identity_provider')\n\t\t\t.values({\n\t\t\t\tdisabled_at: null,\n\t\t\t})\n\t\t\t.where({\n\t\t\t\tid: this.id,\n\t\t\t})\n\t\t\t.execute(db)\n\t}\n}\n"],"names":["UpdateBuilder"],"mappings":";;;AAGO,MAAM,iBAA0C;AAAA,EACtD,YACS,IACP;AADO,SAAA,KAAA;AAAA,EAAA;AAAA,EAIT,MAAM,QAAQ,EAAE,IAAI,aAA0C;AAC7D,UAAMA,SAAAA,cAAc,OAAO,EACzB,MAAM,mBAAmB,EACzB,OAAO;AAAA,MACP,aAAa;AAAA,IACb,CAAA,EACA,MAAM;AAAA,MACN,IAAI,KAAK;AAAA,IAAA,CACT,EACA,QAAQ,EAAE;AAAA,EAAA;AAEd;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnableIdpCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/idp/EnableIdpCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { UpdateBuilder } from '@contember/database'\n\nexport class EnableIdpCommand implements Command<void> {\n\tconstructor(\n\t\tprivate id: string,\n\t) {\n\t}\n\n\tasync execute({ db, providers }: Command.Args): Promise<void> {\n\t\tawait UpdateBuilder.create()\n\t\t\t.table('identity_provider')\n\t\t\t.values({\n\t\t\t\tdisabled_at: null,\n\t\t\t})\n\t\t\t.where({\n\t\t\t\tid: this.id,\n\t\t\t})\n\t\t\t.execute(db)\n\t}\n}\n"],"names":["UpdateBuilder"],"mappings":";AAGO,MAAM,iBAA0C;AAAA,EACtD,YACS,IACP;AADO,SAAA,KAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"EnableIdpCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/idp/EnableIdpCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { UpdateBuilder } from '@contember/database'\n\nexport class EnableIdpCommand implements Command<void> {\n\tconstructor(\n\t\tprivate id: string,\n\t) {\n\t}\n\n\tasync execute({ db, providers }: Command.Args): Promise<void> {\n\t\tawait UpdateBuilder.create()\n\t\t\t.table('identity_provider')\n\t\t\t.values({\n\t\t\t\tdisabled_at: null,\n\t\t\t})\n\t\t\t.where({\n\t\t\t\tid: this.id,\n\t\t\t})\n\t\t\t.execute(db)\n\t}\n}\n"],"names":["UpdateBuilder"],"mappings":";AAGO,MAAM,iBAA0C;AAAA,EACtD,YACS,IACP;AADO,SAAA,KAAA;AAAA,EAAA;AAAA,EAIT,MAAM,QAAQ,EAAE,IAAI,aAA0C;AAC7D,UAAMA,gBAAc,OAAO,EACzB,MAAM,mBAAmB,EACzB,OAAO;AAAA,MACP,aAAa;AAAA,IACb,CAAA,EACA,MAAM;AAAA,MACN,IAAI,KAAK;AAAA,IAAA,CACT,EACA,QAAQ,EAAE;AAAA,EAAA;AAEd;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateIdpCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/idp/UpdateIdpCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { UpdateBuilder } from '@contember/database'\nimport { IdentityProviderData } from '../../type'\n\nexport class UpdateIdpCommand implements Command<void> {\n\tconstructor(\n\t\tprivate id: string,\n\t\tprivate data: UpdateIdpData,\n\t) {\n\t}\n\n\tasync execute({ db }: Command.Args): Promise<void> {\n\t\tconst { configuration, options: { autoSignUp, exclusive, initReturnsConfig } = {} } = this.data\n\t\tawait UpdateBuilder.create()\n\t\t\t.table('identity_provider')\n\t\t\t.values({\n\t\t\t\tconfiguration,\n\t\t\t\tauto_sign_up: autoSignUp,\n\t\t\t\texclusive,\n\t\t\t\tinit_returns_config: initReturnsConfig,\n\t\t\t})\n\t\t\t.where({\n\t\t\t\tid: this.id,\n\t\t\t})\n\t\t\t.execute(db)\n\t}\n}\n\nexport type UpdateIdpData = {\n\toptions?: Partial<IdentityProviderData['options']>\n\tconfiguration?: IdentityProviderData['configuration']\n\ttype?: string\n}\n"],"names":["UpdateBuilder"],"mappings":";;;AAIO,MAAM,iBAA0C;AAAA,EACtD,YACS,IACA,MACP;AAFO,SAAA,KAAA;AACA,SAAA,OAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"UpdateIdpCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/idp/UpdateIdpCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { UpdateBuilder } from '@contember/database'\nimport { IdentityProviderData } from '../../type'\n\nexport class UpdateIdpCommand implements Command<void> {\n\tconstructor(\n\t\tprivate id: string,\n\t\tprivate data: UpdateIdpData,\n\t) {\n\t}\n\n\tasync execute({ db }: Command.Args): Promise<void> {\n\t\tconst { configuration, options: { autoSignUp, exclusive, initReturnsConfig } = {} } = this.data\n\t\tawait UpdateBuilder.create()\n\t\t\t.table('identity_provider')\n\t\t\t.values({\n\t\t\t\tconfiguration,\n\t\t\t\tauto_sign_up: autoSignUp,\n\t\t\t\texclusive,\n\t\t\t\tinit_returns_config: initReturnsConfig,\n\t\t\t})\n\t\t\t.where({\n\t\t\t\tid: this.id,\n\t\t\t})\n\t\t\t.execute(db)\n\t}\n}\n\nexport type UpdateIdpData = {\n\toptions?: Partial<IdentityProviderData['options']>\n\tconfiguration?: IdentityProviderData['configuration']\n\ttype?: string\n}\n"],"names":["UpdateBuilder"],"mappings":";;;AAIO,MAAM,iBAA0C;AAAA,EACtD,YACS,IACA,MACP;AAFO,SAAA,KAAA;AACA,SAAA,OAAA;AAAA,EAAA;AAAA,EAIT,MAAM,QAAQ,EAAE,MAAmC;AAC5C,UAAA,EAAE,eAAe,SAAS,EAAE,YAAY,WAAW,sBAAsB,CAAA,MAAO,KAAK;AAC3F,UAAMA,SAAAA,cAAc,OAAO,EACzB,MAAM,mBAAmB,EACzB,OAAO;AAAA,MACP;AAAA,MACA,cAAc;AAAA,MACd;AAAA,MACA,qBAAqB;AAAA,IACrB,CAAA,EACA,MAAM;AAAA,MACN,IAAI,KAAK;AAAA,IAAA,CACT,EACA,QAAQ,EAAE;AAAA,EAAA;AAEd;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateIdpCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/idp/UpdateIdpCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { UpdateBuilder } from '@contember/database'\nimport { IdentityProviderData } from '../../type'\n\nexport class UpdateIdpCommand implements Command<void> {\n\tconstructor(\n\t\tprivate id: string,\n\t\tprivate data: UpdateIdpData,\n\t) {\n\t}\n\n\tasync execute({ db }: Command.Args): Promise<void> {\n\t\tconst { configuration, options: { autoSignUp, exclusive, initReturnsConfig } = {} } = this.data\n\t\tawait UpdateBuilder.create()\n\t\t\t.table('identity_provider')\n\t\t\t.values({\n\t\t\t\tconfiguration,\n\t\t\t\tauto_sign_up: autoSignUp,\n\t\t\t\texclusive,\n\t\t\t\tinit_returns_config: initReturnsConfig,\n\t\t\t})\n\t\t\t.where({\n\t\t\t\tid: this.id,\n\t\t\t})\n\t\t\t.execute(db)\n\t}\n}\n\nexport type UpdateIdpData = {\n\toptions?: Partial<IdentityProviderData['options']>\n\tconfiguration?: IdentityProviderData['configuration']\n\ttype?: string\n}\n"],"names":["UpdateBuilder"],"mappings":";AAIO,MAAM,iBAA0C;AAAA,EACtD,YACS,IACA,MACP;AAFO,SAAA,KAAA;AACA,SAAA,OAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"UpdateIdpCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/idp/UpdateIdpCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { UpdateBuilder } from '@contember/database'\nimport { IdentityProviderData } from '../../type'\n\nexport class UpdateIdpCommand implements Command<void> {\n\tconstructor(\n\t\tprivate id: string,\n\t\tprivate data: UpdateIdpData,\n\t) {\n\t}\n\n\tasync execute({ db }: Command.Args): Promise<void> {\n\t\tconst { configuration, options: { autoSignUp, exclusive, initReturnsConfig } = {} } = this.data\n\t\tawait UpdateBuilder.create()\n\t\t\t.table('identity_provider')\n\t\t\t.values({\n\t\t\t\tconfiguration,\n\t\t\t\tauto_sign_up: autoSignUp,\n\t\t\t\texclusive,\n\t\t\t\tinit_returns_config: initReturnsConfig,\n\t\t\t})\n\t\t\t.where({\n\t\t\t\tid: this.id,\n\t\t\t})\n\t\t\t.execute(db)\n\t}\n}\n\nexport type UpdateIdpData = {\n\toptions?: Partial<IdentityProviderData['options']>\n\tconfiguration?: IdentityProviderData['configuration']\n\ttype?: string\n}\n"],"names":["UpdateBuilder"],"mappings":";AAIO,MAAM,iBAA0C;AAAA,EACtD,YACS,IACA,MACP;AAFO,SAAA,KAAA;AACA,SAAA,OAAA;AAAA,EAAA;AAAA,EAIT,MAAM,QAAQ,EAAE,MAAmC;AAC5C,UAAA,EAAE,eAAe,SAAS,EAAE,YAAY,WAAW,sBAAsB,CAAA,MAAO,KAAK;AAC3F,UAAMA,gBAAc,OAAO,EACzB,MAAM,mBAAmB,EACzB,OAAO;AAAA,MACP;AAAA,MACA,cAAc;AAAA,MACd;AAAA,MACA,qBAAqB;AAAA,IACrB,CAAA,EACA,MAAM;AAAA,MACN,IAAI,KAAK;AAAA,IAAA,CACT,EACA,QAAQ,EAAE;AAAA,EAAA;AAEd;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddMailTemplateCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/mailTemplate/AddMailTemplateCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { ConflictActionType, InsertBuilder } from '@contember/database'\nimport { MailTemplate } from '../../mailing'\n\nexport class AddMailTemplateCommand implements Command<void> {\n\tconstructor(private mailTemplate: MailTemplate) {}\n\n\tasync execute({ db, providers }: Command.Args): Promise<void> {\n\t\tawait InsertBuilder.create()\n\t\t\t.into('mail_template')\n\t\t\t.values({\n\t\t\t\tid: providers.uuid(),\n\t\t\t\tproject_id: this.mailTemplate.projectId,\n\t\t\t\tmail_type: this.mailTemplate.type,\n\t\t\t\tvariant: this.mailTemplate.variant,\n\t\t\t\tsubject: this.mailTemplate.subject,\n\t\t\t\tcontent: this.mailTemplate.content,\n\t\t\t\tuse_layout: this.mailTemplate.useLayout,\n\t\t\t\treply_to: this.mailTemplate.replyTo,\n\t\t\t})\n\t\t\t.onConflict(ConflictActionType.update, this.mailTemplate.projectId ? {\n\t\t\t\tcolumns: ['project_id', 'mail_type', 'variant'],\n\t\t\t\twhere: it => it.isNotNull('project_id'),\n\t\t\t} : {\n\t\t\t\tcolumns: ['mail_type', 'variant'],\n\t\t\t\twhere: it => it.isNull('project_id'),\n\t\t\t}, {\n\t\t\t\treply_to: expr => expr.select(['excluded', 'reply_to']),\n\t\t\t\tsubject: expr => expr.select(['excluded', 'subject']),\n\t\t\t\tcontent: expr => expr.select(['excluded', 'content']),\n\t\t\t\tuse_layout: expr => expr.select(['excluded', 'use_layout']),\n\t\t\t})\n\t\t\t.execute(db)\n\t}\n}\n"],"names":["InsertBuilder","ConflictActionType"],"mappings":";;;AAIO,MAAM,uBAAgD;AAAA,EAC5D,YAAoB,cAA4B;AAA5B,SAAA,eAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"AddMailTemplateCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/mailTemplate/AddMailTemplateCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { ConflictActionType, InsertBuilder } from '@contember/database'\nimport { MailTemplate } from '../../mailing'\n\nexport class AddMailTemplateCommand implements Command<void> {\n\tconstructor(private mailTemplate: MailTemplate) {}\n\n\tasync execute({ db, providers }: Command.Args): Promise<void> {\n\t\tawait InsertBuilder.create()\n\t\t\t.into('mail_template')\n\t\t\t.values({\n\t\t\t\tid: providers.uuid(),\n\t\t\t\tproject_id: this.mailTemplate.projectId,\n\t\t\t\tmail_type: this.mailTemplate.type,\n\t\t\t\tvariant: this.mailTemplate.variant,\n\t\t\t\tsubject: this.mailTemplate.subject,\n\t\t\t\tcontent: this.mailTemplate.content,\n\t\t\t\tuse_layout: this.mailTemplate.useLayout,\n\t\t\t\treply_to: this.mailTemplate.replyTo,\n\t\t\t})\n\t\t\t.onConflict(ConflictActionType.update, this.mailTemplate.projectId ? {\n\t\t\t\tcolumns: ['project_id', 'mail_type', 'variant'],\n\t\t\t\twhere: it => it.isNotNull('project_id'),\n\t\t\t} : {\n\t\t\t\tcolumns: ['mail_type', 'variant'],\n\t\t\t\twhere: it => it.isNull('project_id'),\n\t\t\t}, {\n\t\t\t\treply_to: expr => expr.select(['excluded', 'reply_to']),\n\t\t\t\tsubject: expr => expr.select(['excluded', 'subject']),\n\t\t\t\tcontent: expr => expr.select(['excluded', 'content']),\n\t\t\t\tuse_layout: expr => expr.select(['excluded', 'use_layout']),\n\t\t\t})\n\t\t\t.execute(db)\n\t}\n}\n"],"names":["InsertBuilder","ConflictActionType"],"mappings":";;;AAIO,MAAM,uBAAgD;AAAA,EAC5D,YAAoB,cAA4B;AAA5B,SAAA,eAAA;AAAA,EAAA;AAAA,EAEpB,MAAM,QAAQ,EAAE,IAAI,aAA0C;AAC7D,UAAMA,SAAAA,cAAc,OAAO,EACzB,KAAK,eAAe,EACpB,OAAO;AAAA,MACP,IAAI,UAAU,KAAK;AAAA,MACnB,YAAY,KAAK,aAAa;AAAA,MAC9B,WAAW,KAAK,aAAa;AAAA,MAC7B,SAAS,KAAK,aAAa;AAAA,MAC3B,SAAS,KAAK,aAAa;AAAA,MAC3B,SAAS,KAAK,aAAa;AAAA,MAC3B,YAAY,KAAK,aAAa;AAAA,MAC9B,UAAU,KAAK,aAAa;AAAA,IAAA,CAC5B,EACA,WAAWC,4BAAmB,QAAQ,KAAK,aAAa,YAAY;AAAA,MACpE,SAAS,CAAC,cAAc,aAAa,SAAS;AAAA,MAC9C,OAAO,CAAA,OAAM,GAAG,UAAU,YAAY;AAAA,IAAA,IACnC;AAAA,MACH,SAAS,CAAC,aAAa,SAAS;AAAA,MAChC,OAAO,CAAA,OAAM,GAAG,OAAO,YAAY;AAAA,IAAA,GACjC;AAAA,MACF,UAAU,CAAQ,SAAA,KAAK,OAAO,CAAC,YAAY,UAAU,CAAC;AAAA,MACtD,SAAS,CAAQ,SAAA,KAAK,OAAO,CAAC,YAAY,SAAS,CAAC;AAAA,MACpD,SAAS,CAAQ,SAAA,KAAK,OAAO,CAAC,YAAY,SAAS,CAAC;AAAA,MACpD,YAAY,CAAQ,SAAA,KAAK,OAAO,CAAC,YAAY,YAAY,CAAC;AAAA,IAAA,CAC1D,EACA,QAAQ,EAAE;AAAA,EAAA;AAEd;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddMailTemplateCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/mailTemplate/AddMailTemplateCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { ConflictActionType, InsertBuilder } from '@contember/database'\nimport { MailTemplate } from '../../mailing'\n\nexport class AddMailTemplateCommand implements Command<void> {\n\tconstructor(private mailTemplate: MailTemplate) {}\n\n\tasync execute({ db, providers }: Command.Args): Promise<void> {\n\t\tawait InsertBuilder.create()\n\t\t\t.into('mail_template')\n\t\t\t.values({\n\t\t\t\tid: providers.uuid(),\n\t\t\t\tproject_id: this.mailTemplate.projectId,\n\t\t\t\tmail_type: this.mailTemplate.type,\n\t\t\t\tvariant: this.mailTemplate.variant,\n\t\t\t\tsubject: this.mailTemplate.subject,\n\t\t\t\tcontent: this.mailTemplate.content,\n\t\t\t\tuse_layout: this.mailTemplate.useLayout,\n\t\t\t\treply_to: this.mailTemplate.replyTo,\n\t\t\t})\n\t\t\t.onConflict(ConflictActionType.update, this.mailTemplate.projectId ? {\n\t\t\t\tcolumns: ['project_id', 'mail_type', 'variant'],\n\t\t\t\twhere: it => it.isNotNull('project_id'),\n\t\t\t} : {\n\t\t\t\tcolumns: ['mail_type', 'variant'],\n\t\t\t\twhere: it => it.isNull('project_id'),\n\t\t\t}, {\n\t\t\t\treply_to: expr => expr.select(['excluded', 'reply_to']),\n\t\t\t\tsubject: expr => expr.select(['excluded', 'subject']),\n\t\t\t\tcontent: expr => expr.select(['excluded', 'content']),\n\t\t\t\tuse_layout: expr => expr.select(['excluded', 'use_layout']),\n\t\t\t})\n\t\t\t.execute(db)\n\t}\n}\n"],"names":["InsertBuilder"],"mappings":";AAIO,MAAM,uBAAgD;AAAA,EAC5D,YAAoB,cAA4B;AAA5B,SAAA,eAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"AddMailTemplateCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/mailTemplate/AddMailTemplateCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { ConflictActionType, InsertBuilder } from '@contember/database'\nimport { MailTemplate } from '../../mailing'\n\nexport class AddMailTemplateCommand implements Command<void> {\n\tconstructor(private mailTemplate: MailTemplate) {}\n\n\tasync execute({ db, providers }: Command.Args): Promise<void> {\n\t\tawait InsertBuilder.create()\n\t\t\t.into('mail_template')\n\t\t\t.values({\n\t\t\t\tid: providers.uuid(),\n\t\t\t\tproject_id: this.mailTemplate.projectId,\n\t\t\t\tmail_type: this.mailTemplate.type,\n\t\t\t\tvariant: this.mailTemplate.variant,\n\t\t\t\tsubject: this.mailTemplate.subject,\n\t\t\t\tcontent: this.mailTemplate.content,\n\t\t\t\tuse_layout: this.mailTemplate.useLayout,\n\t\t\t\treply_to: this.mailTemplate.replyTo,\n\t\t\t})\n\t\t\t.onConflict(ConflictActionType.update, this.mailTemplate.projectId ? {\n\t\t\t\tcolumns: ['project_id', 'mail_type', 'variant'],\n\t\t\t\twhere: it => it.isNotNull('project_id'),\n\t\t\t} : {\n\t\t\t\tcolumns: ['mail_type', 'variant'],\n\t\t\t\twhere: it => it.isNull('project_id'),\n\t\t\t}, {\n\t\t\t\treply_to: expr => expr.select(['excluded', 'reply_to']),\n\t\t\t\tsubject: expr => expr.select(['excluded', 'subject']),\n\t\t\t\tcontent: expr => expr.select(['excluded', 'content']),\n\t\t\t\tuse_layout: expr => expr.select(['excluded', 'use_layout']),\n\t\t\t})\n\t\t\t.execute(db)\n\t}\n}\n"],"names":["InsertBuilder"],"mappings":";AAIO,MAAM,uBAAgD;AAAA,EAC5D,YAAoB,cAA4B;AAA5B,SAAA,eAAA;AAAA,EAAA;AAAA,EAEpB,MAAM,QAAQ,EAAE,IAAI,aAA0C;AAC7D,UAAMA,gBAAc,OAAO,EACzB,KAAK,eAAe,EACpB,OAAO;AAAA,MACP,IAAI,UAAU,KAAK;AAAA,MACnB,YAAY,KAAK,aAAa;AAAA,MAC9B,WAAW,KAAK,aAAa;AAAA,MAC7B,SAAS,KAAK,aAAa;AAAA,MAC3B,SAAS,KAAK,aAAa;AAAA,MAC3B,SAAS,KAAK,aAAa;AAAA,MAC3B,YAAY,KAAK,aAAa;AAAA,MAC9B,UAAU,KAAK,aAAa;AAAA,IAAA,CAC5B,EACA,WAAW,mBAAmB,QAAQ,KAAK,aAAa,YAAY;AAAA,MACpE,SAAS,CAAC,cAAc,aAAa,SAAS;AAAA,MAC9C,OAAO,CAAA,OAAM,GAAG,UAAU,YAAY;AAAA,IAAA,IACnC;AAAA,MACH,SAAS,CAAC,aAAa,SAAS;AAAA,MAChC,OAAO,CAAA,OAAM,GAAG,OAAO,YAAY;AAAA,IAAA,GACjC;AAAA,MACF,UAAU,CAAQ,SAAA,KAAK,OAAO,CAAC,YAAY,UAAU,CAAC;AAAA,MACtD,SAAS,CAAQ,SAAA,KAAK,OAAO,CAAC,YAAY,SAAS,CAAC;AAAA,MACpD,SAAS,CAAQ,SAAA,KAAK,OAAO,CAAC,YAAY,SAAS,CAAC;AAAA,MACpD,YAAY,CAAQ,SAAA,KAAK,OAAO,CAAC,YAAY,YAAY,CAAC;AAAA,IAAA,CAC1D,EACA,QAAQ,EAAE;AAAA,EAAA;AAEd;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemoveMailTemplateCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/mailTemplate/RemoveMailTemplateCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { DeleteBuilder } from '@contember/database'\nimport { MailTemplateIdentifier } from '../../mailing'\n\nexport class RemoveMailTemplateCommand implements Command<boolean> {\n\tconstructor(private mailTemplateIdentifier: MailTemplateIdentifier) {}\n\n\tasync execute({ db, providers }: Command.Args): Promise<boolean> {\n\t\treturn (\n\t\t\t(await DeleteBuilder.create()\n\t\t\t\t.from('mail_template')\n\t\t\t\t.where({\n\t\t\t\t\tproject_id: this.mailTemplateIdentifier.projectId,\n\t\t\t\t\tmail_type: this.mailTemplateIdentifier.type,\n\t\t\t\t\tvariant: this.mailTemplateIdentifier.variant,\n\t\t\t\t})\n\t\t\t\t.execute(db)) > 0\n\t\t)\n\t}\n}\n"],"names":["DeleteBuilder"],"mappings":";;;AAIO,MAAM,0BAAsD;AAAA,EAClE,YAAoB,wBAAgD;AAAhD,SAAA,yBAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"RemoveMailTemplateCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/mailTemplate/RemoveMailTemplateCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { DeleteBuilder } from '@contember/database'\nimport { MailTemplateIdentifier } from '../../mailing'\n\nexport class RemoveMailTemplateCommand implements Command<boolean> {\n\tconstructor(private mailTemplateIdentifier: MailTemplateIdentifier) {}\n\n\tasync execute({ db, providers }: Command.Args): Promise<boolean> {\n\t\treturn (\n\t\t\t(await DeleteBuilder.create()\n\t\t\t\t.from('mail_template')\n\t\t\t\t.where({\n\t\t\t\t\tproject_id: this.mailTemplateIdentifier.projectId,\n\t\t\t\t\tmail_type: this.mailTemplateIdentifier.type,\n\t\t\t\t\tvariant: this.mailTemplateIdentifier.variant,\n\t\t\t\t})\n\t\t\t\t.execute(db)) > 0\n\t\t)\n\t}\n}\n"],"names":["DeleteBuilder"],"mappings":";;;AAIO,MAAM,0BAAsD;AAAA,EAClE,YAAoB,wBAAgD;AAAhD,SAAA,yBAAA;AAAA,EAAA;AAAA,EAEpB,MAAM,QAAQ,EAAE,IAAI,aAA6C;AAChE,WACE,MAAMA,SAAc,cAAA,OAAA,EACnB,KAAK,eAAe,EACpB,MAAM;AAAA,MACN,YAAY,KAAK,uBAAuB;AAAA,MACxC,WAAW,KAAK,uBAAuB;AAAA,MACvC,SAAS,KAAK,uBAAuB;AAAA,IAAA,CACrC,EACA,QAAQ,EAAE,IAAK;AAAA,EAAA;AAGpB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemoveMailTemplateCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/mailTemplate/RemoveMailTemplateCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { DeleteBuilder } from '@contember/database'\nimport { MailTemplateIdentifier } from '../../mailing'\n\nexport class RemoveMailTemplateCommand implements Command<boolean> {\n\tconstructor(private mailTemplateIdentifier: MailTemplateIdentifier) {}\n\n\tasync execute({ db, providers }: Command.Args): Promise<boolean> {\n\t\treturn (\n\t\t\t(await DeleteBuilder.create()\n\t\t\t\t.from('mail_template')\n\t\t\t\t.where({\n\t\t\t\t\tproject_id: this.mailTemplateIdentifier.projectId,\n\t\t\t\t\tmail_type: this.mailTemplateIdentifier.type,\n\t\t\t\t\tvariant: this.mailTemplateIdentifier.variant,\n\t\t\t\t})\n\t\t\t\t.execute(db)) > 0\n\t\t)\n\t}\n}\n"],"names":[],"mappings":";AAIO,MAAM,0BAAsD;AAAA,EAClE,YAAoB,wBAAgD;AAAhD,SAAA,yBAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"RemoveMailTemplateCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/mailTemplate/RemoveMailTemplateCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { DeleteBuilder } from '@contember/database'\nimport { MailTemplateIdentifier } from '../../mailing'\n\nexport class RemoveMailTemplateCommand implements Command<boolean> {\n\tconstructor(private mailTemplateIdentifier: MailTemplateIdentifier) {}\n\n\tasync execute({ db, providers }: Command.Args): Promise<boolean> {\n\t\treturn (\n\t\t\t(await DeleteBuilder.create()\n\t\t\t\t.from('mail_template')\n\t\t\t\t.where({\n\t\t\t\t\tproject_id: this.mailTemplateIdentifier.projectId,\n\t\t\t\t\tmail_type: this.mailTemplateIdentifier.type,\n\t\t\t\t\tvariant: this.mailTemplateIdentifier.variant,\n\t\t\t\t})\n\t\t\t\t.execute(db)) > 0\n\t\t)\n\t}\n}\n"],"names":[],"mappings":";AAIO,MAAM,0BAAsD;AAAA,EAClE,YAAoB,wBAAgD;AAAhD,SAAA,yBAAA;AAAA,EAAA;AAAA,EAEpB,MAAM,QAAQ,EAAE,IAAI,aAA6C;AAChE,WACE,MAAM,cAAc,OAAA,EACnB,KAAK,eAAe,EACpB,MAAM;AAAA,MACN,YAAY,KAAK,uBAAuB;AAAA,MACxC,WAAW,KAAK,uBAAuB;AAAA,MACvC,SAAS,KAAK,uBAAuB;AAAA,IAAA,CACrC,EACA,QAAQ,EAAE,IAAK;AAAA,EAAA;AAGpB;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddProjectMemberCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/membership/AddProjectMemberCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { CreateOrUpdateProjectMembershipCommand } from './CreateOrUpdateProjectMembershipCommand'\nimport { Response, ResponseError, ResponseOk } from '../../utils/Response'\nimport { SelectBuilder } from '@contember/database'\nimport { MembershipInput } from './types'\n\ntype CommandResponse = Response<null, AddProjectMemberCommandError>\n\nexport class AddProjectMemberCommand implements Command<CommandResponse> {\n\tconstructor(\n\t\tprivate readonly projectId: string,\n\t\tprivate readonly identityId: string,\n\t\tprivate readonly memberships: readonly MembershipInput[],\n\t) {}\n\n\tasync execute({ db, providers, bus }: Command.Args): Promise<CommandResponse> {\n\t\tconst result = await SelectBuilder.create()\n\t\t\t.select('id')\n\t\t\t.from('project_membership')\n\t\t\t.where({\n\t\t\t\tproject_id: this.projectId,\n\t\t\t\tidentity_id: this.identityId,\n\t\t\t})\n\t\t\t.getResult(db)\n\t\tif (result.length > 0) {\n\t\t\treturn new ResponseError(\n\t\t\t\t'ALREADY_MEMBER',\n\t\t\t\t`This identity is already a project member. Use updateProjectMember mutation to change memberships.`,\n\t\t\t)\n\t\t}\n\n\t\ttry {\n\t\t\tfor (const membership of this.memberships) {\n\t\t\t\tawait bus.execute(new CreateOrUpdateProjectMembershipCommand(this.projectId, this.identityId, membership))\n\t\t\t}\n\t\t\treturn new ResponseOk(null)\n\t\t} catch (e) {\n\t\t\tif (!(e instanceof Error)) {\n\t\t\t\tthrow e\n\t\t\t}\n\t\t\tswitch ((e as any).constraint) {\n\t\t\t\tcase 'project_membership_project':\n\t\t\t\t\treturn new ResponseError('PROJECT_NOT_FOUND', 'Project not found')\n\t\t\t\tcase 'project_membership_identity':\n\t\t\t\t\treturn new ResponseError('IDENTITY_NOT_FOUND', 'Identity not found')\n\t\t\t\tdefault:\n\t\t\t\t\tthrow e\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport type AddProjectMemberCommandError =\n\t| 'ALREADY_MEMBER'\n\t| 'PROJECT_NOT_FOUND'\n\t| 'IDENTITY_NOT_FOUND'\n"],"names":["SelectBuilder","ResponseError","CreateOrUpdateProjectMembershipCommand","ResponseOk"],"mappings":";;;;;AAQO,MAAM,wBAA4D;AAAA,EACxE,YACkB,WACA,YACA,aAChB;AAHgB,SAAA,YAAA;AACA,SAAA,aAAA;AACA,SAAA,cAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"AddProjectMemberCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/membership/AddProjectMemberCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { CreateOrUpdateProjectMembershipCommand } from './CreateOrUpdateProjectMembershipCommand'\nimport { Response, ResponseError, ResponseOk } from '../../utils/Response'\nimport { SelectBuilder } from '@contember/database'\nimport { MembershipInput } from './types'\n\ntype CommandResponse = Response<null, AddProjectMemberCommandError>\n\nexport class AddProjectMemberCommand implements Command<CommandResponse> {\n\tconstructor(\n\t\tprivate readonly projectId: string,\n\t\tprivate readonly identityId: string,\n\t\tprivate readonly memberships: readonly MembershipInput[],\n\t) {}\n\n\tasync execute({ db, providers, bus }: Command.Args): Promise<CommandResponse> {\n\t\tconst result = await SelectBuilder.create()\n\t\t\t.select('id')\n\t\t\t.from('project_membership')\n\t\t\t.where({\n\t\t\t\tproject_id: this.projectId,\n\t\t\t\tidentity_id: this.identityId,\n\t\t\t})\n\t\t\t.getResult(db)\n\t\tif (result.length > 0) {\n\t\t\treturn new ResponseError(\n\t\t\t\t'ALREADY_MEMBER',\n\t\t\t\t`This identity is already a project member. Use updateProjectMember mutation to change memberships.`,\n\t\t\t)\n\t\t}\n\n\t\ttry {\n\t\t\tfor (const membership of this.memberships) {\n\t\t\t\tawait bus.execute(new CreateOrUpdateProjectMembershipCommand(this.projectId, this.identityId, membership))\n\t\t\t}\n\t\t\treturn new ResponseOk(null)\n\t\t} catch (e) {\n\t\t\tif (!(e instanceof Error)) {\n\t\t\t\tthrow e\n\t\t\t}\n\t\t\tswitch ((e as any).constraint) {\n\t\t\t\tcase 'project_membership_project':\n\t\t\t\t\treturn new ResponseError('PROJECT_NOT_FOUND', 'Project not found')\n\t\t\t\tcase 'project_membership_identity':\n\t\t\t\t\treturn new ResponseError('IDENTITY_NOT_FOUND', 'Identity not found')\n\t\t\t\tdefault:\n\t\t\t\t\tthrow e\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport type AddProjectMemberCommandError =\n\t| 'ALREADY_MEMBER'\n\t| 'PROJECT_NOT_FOUND'\n\t| 'IDENTITY_NOT_FOUND'\n"],"names":["SelectBuilder","ResponseError","CreateOrUpdateProjectMembershipCommand","ResponseOk"],"mappings":";;;;;AAQO,MAAM,wBAA4D;AAAA,EACxE,YACkB,WACA,YACA,aAChB;AAHgB,SAAA,YAAA;AACA,SAAA,aAAA;AACA,SAAA,cAAA;AAAA,EAAA;AAAA,EAGlB,MAAM,QAAQ,EAAE,IAAI,WAAW,OAA+C;AACvE,UAAA,SAAS,MAAMA,uBAAc,SACjC,OAAO,IAAI,EACX,KAAK,oBAAoB,EACzB,MAAM;AAAA,MACN,YAAY,KAAK;AAAA,MACjB,aAAa,KAAK;AAAA,IAAA,CAClB,EACA,UAAU,EAAE;AACV,QAAA,OAAO,SAAS,GAAG;AACtB,aAAO,IAAIC,SAAA;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,IAAA;AAGG,QAAA;AACQ,iBAAA,cAAc,KAAK,aAAa;AACpC,cAAA,IAAI,QAAQ,IAAIC,8EAAuC,KAAK,WAAW,KAAK,YAAY,UAAU,CAAC;AAAA,MAAA;AAEnG,aAAA,IAAIC,oBAAW,IAAI;AAAA,aAClB,GAAG;AACP,UAAA,EAAE,aAAa,QAAQ;AACpB,cAAA;AAAA,MAAA;AAEP,cAAS,EAAU,YAAY;AAAA,QAC9B,KAAK;AACG,iBAAA,IAAIF,SAAAA,cAAc,qBAAqB,mBAAmB;AAAA,QAClE,KAAK;AACG,iBAAA,IAAIA,SAAAA,cAAc,sBAAsB,oBAAoB;AAAA,QACpE;AACO,gBAAA;AAAA,MAAA;AAAA,IACR;AAAA,EACD;AAEF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddProjectMemberCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/membership/AddProjectMemberCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { CreateOrUpdateProjectMembershipCommand } from './CreateOrUpdateProjectMembershipCommand'\nimport { Response, ResponseError, ResponseOk } from '../../utils/Response'\nimport { SelectBuilder } from '@contember/database'\nimport { MembershipInput } from './types'\n\ntype CommandResponse = Response<null, AddProjectMemberCommandError>\n\nexport class AddProjectMemberCommand implements Command<CommandResponse> {\n\tconstructor(\n\t\tprivate readonly projectId: string,\n\t\tprivate readonly identityId: string,\n\t\tprivate readonly memberships: readonly MembershipInput[],\n\t) {}\n\n\tasync execute({ db, providers, bus }: Command.Args): Promise<CommandResponse> {\n\t\tconst result = await SelectBuilder.create()\n\t\t\t.select('id')\n\t\t\t.from('project_membership')\n\t\t\t.where({\n\t\t\t\tproject_id: this.projectId,\n\t\t\t\tidentity_id: this.identityId,\n\t\t\t})\n\t\t\t.getResult(db)\n\t\tif (result.length > 0) {\n\t\t\treturn new ResponseError(\n\t\t\t\t'ALREADY_MEMBER',\n\t\t\t\t`This identity is already a project member. Use updateProjectMember mutation to change memberships.`,\n\t\t\t)\n\t\t}\n\n\t\ttry {\n\t\t\tfor (const membership of this.memberships) {\n\t\t\t\tawait bus.execute(new CreateOrUpdateProjectMembershipCommand(this.projectId, this.identityId, membership))\n\t\t\t}\n\t\t\treturn new ResponseOk(null)\n\t\t} catch (e) {\n\t\t\tif (!(e instanceof Error)) {\n\t\t\t\tthrow e\n\t\t\t}\n\t\t\tswitch ((e as any).constraint) {\n\t\t\t\tcase 'project_membership_project':\n\t\t\t\t\treturn new ResponseError('PROJECT_NOT_FOUND', 'Project not found')\n\t\t\t\tcase 'project_membership_identity':\n\t\t\t\t\treturn new ResponseError('IDENTITY_NOT_FOUND', 'Identity not found')\n\t\t\t\tdefault:\n\t\t\t\t\tthrow e\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport type AddProjectMemberCommandError =\n\t| 'ALREADY_MEMBER'\n\t| 'PROJECT_NOT_FOUND'\n\t| 'IDENTITY_NOT_FOUND'\n"],"names":[],"mappings":";;;AAQO,MAAM,wBAA4D;AAAA,EACxE,YACkB,WACA,YACA,aAChB;AAHgB,SAAA,YAAA;AACA,SAAA,aAAA;AACA,SAAA,cAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"AddProjectMemberCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/membership/AddProjectMemberCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { CreateOrUpdateProjectMembershipCommand } from './CreateOrUpdateProjectMembershipCommand'\nimport { Response, ResponseError, ResponseOk } from '../../utils/Response'\nimport { SelectBuilder } from '@contember/database'\nimport { MembershipInput } from './types'\n\ntype CommandResponse = Response<null, AddProjectMemberCommandError>\n\nexport class AddProjectMemberCommand implements Command<CommandResponse> {\n\tconstructor(\n\t\tprivate readonly projectId: string,\n\t\tprivate readonly identityId: string,\n\t\tprivate readonly memberships: readonly MembershipInput[],\n\t) {}\n\n\tasync execute({ db, providers, bus }: Command.Args): Promise<CommandResponse> {\n\t\tconst result = await SelectBuilder.create()\n\t\t\t.select('id')\n\t\t\t.from('project_membership')\n\t\t\t.where({\n\t\t\t\tproject_id: this.projectId,\n\t\t\t\tidentity_id: this.identityId,\n\t\t\t})\n\t\t\t.getResult(db)\n\t\tif (result.length > 0) {\n\t\t\treturn new ResponseError(\n\t\t\t\t'ALREADY_MEMBER',\n\t\t\t\t`This identity is already a project member. Use updateProjectMember mutation to change memberships.`,\n\t\t\t)\n\t\t}\n\n\t\ttry {\n\t\t\tfor (const membership of this.memberships) {\n\t\t\t\tawait bus.execute(new CreateOrUpdateProjectMembershipCommand(this.projectId, this.identityId, membership))\n\t\t\t}\n\t\t\treturn new ResponseOk(null)\n\t\t} catch (e) {\n\t\t\tif (!(e instanceof Error)) {\n\t\t\t\tthrow e\n\t\t\t}\n\t\t\tswitch ((e as any).constraint) {\n\t\t\t\tcase 'project_membership_project':\n\t\t\t\t\treturn new ResponseError('PROJECT_NOT_FOUND', 'Project not found')\n\t\t\t\tcase 'project_membership_identity':\n\t\t\t\t\treturn new ResponseError('IDENTITY_NOT_FOUND', 'Identity not found')\n\t\t\t\tdefault:\n\t\t\t\t\tthrow e\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport type AddProjectMemberCommandError =\n\t| 'ALREADY_MEMBER'\n\t| 'PROJECT_NOT_FOUND'\n\t| 'IDENTITY_NOT_FOUND'\n"],"names":[],"mappings":";;;AAQO,MAAM,wBAA4D;AAAA,EACxE,YACkB,WACA,YACA,aAChB;AAHgB,SAAA,YAAA;AACA,SAAA,aAAA;AACA,SAAA,cAAA;AAAA,EAAA;AAAA,EAGlB,MAAM,QAAQ,EAAE,IAAI,WAAW,OAA+C;AACvE,UAAA,SAAS,MAAM,cAAc,SACjC,OAAO,IAAI,EACX,KAAK,oBAAoB,EACzB,MAAM;AAAA,MACN,YAAY,KAAK;AAAA,MACjB,aAAa,KAAK;AAAA,IAAA,CAClB,EACA,UAAU,EAAE;AACV,QAAA,OAAO,SAAS,GAAG;AACtB,aAAO,IAAI;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,IAAA;AAGG,QAAA;AACQ,iBAAA,cAAc,KAAK,aAAa;AACpC,cAAA,IAAI,QAAQ,IAAI,uCAAuC,KAAK,WAAW,KAAK,YAAY,UAAU,CAAC;AAAA,MAAA;AAEnG,aAAA,IAAI,WAAW,IAAI;AAAA,aAClB,GAAG;AACP,UAAA,EAAE,aAAa,QAAQ;AACpB,cAAA;AAAA,MAAA;AAEP,cAAS,EAAU,YAAY;AAAA,QAC9B,KAAK;AACG,iBAAA,IAAI,cAAc,qBAAqB,mBAAmB;AAAA,QAClE,KAAK;AACG,iBAAA,IAAI,cAAc,sBAAsB,oBAAoB;AAAA,QACpE;AACO,gBAAA;AAAA,MAAA;AAAA,IACR;AAAA,EACD;AAEF;"}
|
package/dist/production/src/model/commands/membership/CreateOrUpdateProjectMembershipCommand.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateOrUpdateProjectMembershipCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/membership/CreateOrUpdateProjectMembershipCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { ConflictActionType, DeleteBuilder, InsertBuilder } from '@contember/database'\nimport { ImplementationException } from '../../../exceptions'\nimport { MembershipInput } from './types'\nimport { PatchProjectMembershipVariablesCommand } from './variables'\n\nexport class CreateOrUpdateProjectMembershipCommand implements Command<void> {\n\tconstructor(\n\t\tprivate readonly projectId: string,\n\t\tprivate readonly identityId: string,\n\t\tprivate readonly membership: MembershipInput,\n\t) {}\n\n\tasync execute({ db, bus, providers }: Command.Args): Promise<void> {\n\t\tconst result = await InsertBuilder.create()\n\t\t\t.into('project_membership')\n\t\t\t.values({\n\t\t\t\tid: providers.uuid(),\n\t\t\t\tproject_id: this.projectId,\n\t\t\t\tidentity_id: this.identityId,\n\t\t\t\trole: this.membership.role,\n\t\t\t})\n\t\t\t// intentionally using update instead of \"do nothing\" so I can use \"returning id\"\n\t\t\t.onConflict(ConflictActionType.update, ['project_id', 'identity_id', 'role'], {\n\t\t\t\trole: this.membership.role,\n\t\t\t})\n\t\t\t.returning('id')\n\t\t\t.execute(db)\n\t\tif (result.length !== 1) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\tconst membershipId = result[0].id as string\n\t\tconst variables = await bus.execute(\n\t\t\tnew PatchProjectMembershipVariablesCommand(membershipId, this.membership.variables),\n\t\t)\n\t\tif (Object.values(variables).find(it => it.length === 0)) {\n\t\t\t// todo soft-delete instead\n\t\t\tawait DeleteBuilder.create()\n\t\t\t\t.where({\n\t\t\t\t\tid: membershipId,\n\t\t\t\t})\n\t\t\t\t.from('project_membership')\n\t\t\t\t.execute(db)\n\t\t}\n\t}\n}\n"],"names":["InsertBuilder","ConflictActionType","ImplementationException","PatchProjectMembershipVariablesCommand","DeleteBuilder"],"mappings":";;;;;AAMO,MAAM,uCAAgE;AAAA,EAC5E,YACkB,WACA,YACA,YAChB;AAHgB,SAAA,YAAA;AACA,SAAA,aAAA;AACA,SAAA,aAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"CreateOrUpdateProjectMembershipCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/membership/CreateOrUpdateProjectMembershipCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { ConflictActionType, DeleteBuilder, InsertBuilder } from '@contember/database'\nimport { ImplementationException } from '../../../exceptions'\nimport { MembershipInput } from './types'\nimport { PatchProjectMembershipVariablesCommand } from './variables'\n\nexport class CreateOrUpdateProjectMembershipCommand implements Command<void> {\n\tconstructor(\n\t\tprivate readonly projectId: string,\n\t\tprivate readonly identityId: string,\n\t\tprivate readonly membership: MembershipInput,\n\t) {}\n\n\tasync execute({ db, bus, providers }: Command.Args): Promise<void> {\n\t\tconst result = await InsertBuilder.create()\n\t\t\t.into('project_membership')\n\t\t\t.values({\n\t\t\t\tid: providers.uuid(),\n\t\t\t\tproject_id: this.projectId,\n\t\t\t\tidentity_id: this.identityId,\n\t\t\t\trole: this.membership.role,\n\t\t\t})\n\t\t\t// intentionally using update instead of \"do nothing\" so I can use \"returning id\"\n\t\t\t.onConflict(ConflictActionType.update, ['project_id', 'identity_id', 'role'], {\n\t\t\t\trole: this.membership.role,\n\t\t\t})\n\t\t\t.returning('id')\n\t\t\t.execute(db)\n\t\tif (result.length !== 1) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\tconst membershipId = result[0].id as string\n\t\tconst variables = await bus.execute(\n\t\t\tnew PatchProjectMembershipVariablesCommand(membershipId, this.membership.variables),\n\t\t)\n\t\tif (Object.values(variables).find(it => it.length === 0)) {\n\t\t\t// todo soft-delete instead\n\t\t\tawait DeleteBuilder.create()\n\t\t\t\t.where({\n\t\t\t\t\tid: membershipId,\n\t\t\t\t})\n\t\t\t\t.from('project_membership')\n\t\t\t\t.execute(db)\n\t\t}\n\t}\n}\n"],"names":["InsertBuilder","ConflictActionType","ImplementationException","PatchProjectMembershipVariablesCommand","DeleteBuilder"],"mappings":";;;;;AAMO,MAAM,uCAAgE;AAAA,EAC5E,YACkB,WACA,YACA,YAChB;AAHgB,SAAA,YAAA;AACA,SAAA,aAAA;AACA,SAAA,aAAA;AAAA,EAAA;AAAA,EAGlB,MAAM,QAAQ,EAAE,IAAI,KAAK,aAA0C;AAC5D,UAAA,SAAS,MAAMA,uBAAc,SACjC,KAAK,oBAAoB,EACzB,OAAO;AAAA,MACP,IAAI,UAAU,KAAK;AAAA,MACnB,YAAY,KAAK;AAAA,MACjB,aAAa,KAAK;AAAA,MAClB,MAAM,KAAK,WAAW;AAAA,IAAA,CACtB,EAEA,WAAWC,4BAAmB,QAAQ,CAAC,cAAc,eAAe,MAAM,GAAG;AAAA,MAC7E,MAAM,KAAK,WAAW;AAAA,IACtB,CAAA,EACA,UAAU,IAAI,EACd,QAAQ,EAAE;AACR,QAAA,OAAO,WAAW,GAAG;AACxB,YAAM,IAAIC,WAAAA,wBAAwB;AAAA,IAAA;AAE7B,UAAA,eAAe,OAAO,CAAC,EAAE;AACzB,UAAA,YAAY,MAAM,IAAI;AAAA,MAC3B,IAAIC,8EAAuC,cAAc,KAAK,WAAW,SAAS;AAAA,IACnF;AACI,QAAA,OAAO,OAAO,SAAS,EAAE,KAAK,CAAM,OAAA,GAAG,WAAW,CAAC,GAAG;AAEnD,YAAAC,SAAA,cAAc,OAAO,EACzB,MAAM;AAAA,QACN,IAAI;AAAA,MACJ,CAAA,EACA,KAAK,oBAAoB,EACzB,QAAQ,EAAE;AAAA,IAAA;AAAA,EACb;AAEF;;"}
|
package/dist/production/src/model/commands/membership/CreateOrUpdateProjectMembershipCommand.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateOrUpdateProjectMembershipCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/membership/CreateOrUpdateProjectMembershipCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { ConflictActionType, DeleteBuilder, InsertBuilder } from '@contember/database'\nimport { ImplementationException } from '../../../exceptions'\nimport { MembershipInput } from './types'\nimport { PatchProjectMembershipVariablesCommand } from './variables'\n\nexport class CreateOrUpdateProjectMembershipCommand implements Command<void> {\n\tconstructor(\n\t\tprivate readonly projectId: string,\n\t\tprivate readonly identityId: string,\n\t\tprivate readonly membership: MembershipInput,\n\t) {}\n\n\tasync execute({ db, bus, providers }: Command.Args): Promise<void> {\n\t\tconst result = await InsertBuilder.create()\n\t\t\t.into('project_membership')\n\t\t\t.values({\n\t\t\t\tid: providers.uuid(),\n\t\t\t\tproject_id: this.projectId,\n\t\t\t\tidentity_id: this.identityId,\n\t\t\t\trole: this.membership.role,\n\t\t\t})\n\t\t\t// intentionally using update instead of \"do nothing\" so I can use \"returning id\"\n\t\t\t.onConflict(ConflictActionType.update, ['project_id', 'identity_id', 'role'], {\n\t\t\t\trole: this.membership.role,\n\t\t\t})\n\t\t\t.returning('id')\n\t\t\t.execute(db)\n\t\tif (result.length !== 1) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\tconst membershipId = result[0].id as string\n\t\tconst variables = await bus.execute(\n\t\t\tnew PatchProjectMembershipVariablesCommand(membershipId, this.membership.variables),\n\t\t)\n\t\tif (Object.values(variables).find(it => it.length === 0)) {\n\t\t\t// todo soft-delete instead\n\t\t\tawait DeleteBuilder.create()\n\t\t\t\t.where({\n\t\t\t\t\tid: membershipId,\n\t\t\t\t})\n\t\t\t\t.from('project_membership')\n\t\t\t\t.execute(db)\n\t\t}\n\t}\n}\n"],"names":["InsertBuilder"],"mappings":";;;AAMO,MAAM,uCAAgE;AAAA,EAC5E,YACkB,WACA,YACA,YAChB;AAHgB,SAAA,YAAA;AACA,SAAA,aAAA;AACA,SAAA,aAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"CreateOrUpdateProjectMembershipCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/membership/CreateOrUpdateProjectMembershipCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { ConflictActionType, DeleteBuilder, InsertBuilder } from '@contember/database'\nimport { ImplementationException } from '../../../exceptions'\nimport { MembershipInput } from './types'\nimport { PatchProjectMembershipVariablesCommand } from './variables'\n\nexport class CreateOrUpdateProjectMembershipCommand implements Command<void> {\n\tconstructor(\n\t\tprivate readonly projectId: string,\n\t\tprivate readonly identityId: string,\n\t\tprivate readonly membership: MembershipInput,\n\t) {}\n\n\tasync execute({ db, bus, providers }: Command.Args): Promise<void> {\n\t\tconst result = await InsertBuilder.create()\n\t\t\t.into('project_membership')\n\t\t\t.values({\n\t\t\t\tid: providers.uuid(),\n\t\t\t\tproject_id: this.projectId,\n\t\t\t\tidentity_id: this.identityId,\n\t\t\t\trole: this.membership.role,\n\t\t\t})\n\t\t\t// intentionally using update instead of \"do nothing\" so I can use \"returning id\"\n\t\t\t.onConflict(ConflictActionType.update, ['project_id', 'identity_id', 'role'], {\n\t\t\t\trole: this.membership.role,\n\t\t\t})\n\t\t\t.returning('id')\n\t\t\t.execute(db)\n\t\tif (result.length !== 1) {\n\t\t\tthrow new ImplementationException()\n\t\t}\n\t\tconst membershipId = result[0].id as string\n\t\tconst variables = await bus.execute(\n\t\t\tnew PatchProjectMembershipVariablesCommand(membershipId, this.membership.variables),\n\t\t)\n\t\tif (Object.values(variables).find(it => it.length === 0)) {\n\t\t\t// todo soft-delete instead\n\t\t\tawait DeleteBuilder.create()\n\t\t\t\t.where({\n\t\t\t\t\tid: membershipId,\n\t\t\t\t})\n\t\t\t\t.from('project_membership')\n\t\t\t\t.execute(db)\n\t\t}\n\t}\n}\n"],"names":["InsertBuilder"],"mappings":";;;AAMO,MAAM,uCAAgE;AAAA,EAC5E,YACkB,WACA,YACA,YAChB;AAHgB,SAAA,YAAA;AACA,SAAA,aAAA;AACA,SAAA,aAAA;AAAA,EAAA;AAAA,EAGlB,MAAM,QAAQ,EAAE,IAAI,KAAK,aAA0C;AAC5D,UAAA,SAAS,MAAMA,gBAAc,SACjC,KAAK,oBAAoB,EACzB,OAAO;AAAA,MACP,IAAI,UAAU,KAAK;AAAA,MACnB,YAAY,KAAK;AAAA,MACjB,aAAa,KAAK;AAAA,MAClB,MAAM,KAAK,WAAW;AAAA,IAAA,CACtB,EAEA,WAAW,mBAAmB,QAAQ,CAAC,cAAc,eAAe,MAAM,GAAG;AAAA,MAC7E,MAAM,KAAK,WAAW;AAAA,IACtB,CAAA,EACA,UAAU,IAAI,EACd,QAAQ,EAAE;AACR,QAAA,OAAO,WAAW,GAAG;AACxB,YAAM,IAAI,wBAAwB;AAAA,IAAA;AAE7B,UAAA,eAAe,OAAO,CAAC,EAAE;AACzB,UAAA,YAAY,MAAM,IAAI;AAAA,MAC3B,IAAI,uCAAuC,cAAc,KAAK,WAAW,SAAS;AAAA,IACnF;AACI,QAAA,OAAO,OAAO,SAAS,EAAE,KAAK,CAAM,OAAA,GAAG,WAAW,CAAC,GAAG;AAEnD,YAAA,cAAc,OAAO,EACzB,MAAM;AAAA,QACN,IAAI;AAAA,MACJ,CAAA,EACA,KAAK,oBAAoB,EACzB,QAAQ,EAAE;AAAA,IAAA;AAAA,EACb;AAEF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemoveProjectMemberCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/membership/RemoveProjectMemberCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { RemoveProjectMemberErrorCode } from '../../../schema'\nimport { DeleteBuilder } from '@contember/database'\nimport { Response, ResponseError, ResponseOk } from '../../utils/Response'\n\nexport class RemoveProjectMemberCommand implements Command<RemoveProjectMemberResponse> {\n\tconstructor(private readonly projectId: string, private readonly identityId: string) {}\n\n\tasync execute({ db, bus }: Command.Args): Promise<RemoveProjectMemberResponse> {\n\t\tconst memberWhere = {\n\t\t\tproject_id: this.projectId,\n\t\t\tidentity_id: this.identityId,\n\t\t}\n\t\tconst result = await DeleteBuilder.create() //\n\t\t\t.from('project_membership')\n\t\t\t.where(memberWhere)\n\t\t\t.execute(db)\n\n\t\tif (result === 0) {\n\t\t\treturn new ResponseError('NOT_MEMBER', 'Not a project member')\n\t\t}\n\t\treturn new ResponseOk(null)\n\t}\n}\n\nexport type RemoveProjectMemberResponse = Response<null, RemoveProjectMemberErrorCode>\n"],"names":["DeleteBuilder","ResponseError","ResponseOk"],"mappings":";;;;AAKO,MAAM,2BAA2E;AAAA,EACvF,YAA6B,WAAoC,YAAoB;AAAxD,SAAA,YAAA;AAAoC,SAAA,aAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"RemoveProjectMemberCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/membership/RemoveProjectMemberCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { RemoveProjectMemberErrorCode } from '../../../schema'\nimport { DeleteBuilder } from '@contember/database'\nimport { Response, ResponseError, ResponseOk } from '../../utils/Response'\n\nexport class RemoveProjectMemberCommand implements Command<RemoveProjectMemberResponse> {\n\tconstructor(private readonly projectId: string, private readonly identityId: string) {}\n\n\tasync execute({ db, bus }: Command.Args): Promise<RemoveProjectMemberResponse> {\n\t\tconst memberWhere = {\n\t\t\tproject_id: this.projectId,\n\t\t\tidentity_id: this.identityId,\n\t\t}\n\t\tconst result = await DeleteBuilder.create() //\n\t\t\t.from('project_membership')\n\t\t\t.where(memberWhere)\n\t\t\t.execute(db)\n\n\t\tif (result === 0) {\n\t\t\treturn new ResponseError('NOT_MEMBER', 'Not a project member')\n\t\t}\n\t\treturn new ResponseOk(null)\n\t}\n}\n\nexport type RemoveProjectMemberResponse = Response<null, RemoveProjectMemberErrorCode>\n"],"names":["DeleteBuilder","ResponseError","ResponseOk"],"mappings":";;;;AAKO,MAAM,2BAA2E;AAAA,EACvF,YAA6B,WAAoC,YAAoB;AAAxD,SAAA,YAAA;AAAoC,SAAA,aAAA;AAAA,EAAA;AAAA,EAEjE,MAAM,QAAQ,EAAE,IAAI,OAA2D;AAC9E,UAAM,cAAc;AAAA,MACnB,YAAY,KAAK;AAAA,MACjB,aAAa,KAAK;AAAA,IACnB;AACA,UAAM,SAAS,MAAMA,uBAAc,OACjC,EAAA,KAAK,oBAAoB,EACzB,MAAM,WAAW,EACjB,QAAQ,EAAE;AAEZ,QAAI,WAAW,GAAG;AACV,aAAA,IAAIC,SAAAA,cAAc,cAAc,sBAAsB;AAAA,IAAA;AAEvD,WAAA,IAAIC,oBAAW,IAAI;AAAA,EAAA;AAE5B;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemoveProjectMemberCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/membership/RemoveProjectMemberCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { RemoveProjectMemberErrorCode } from '../../../schema'\nimport { DeleteBuilder } from '@contember/database'\nimport { Response, ResponseError, ResponseOk } from '../../utils/Response'\n\nexport class RemoveProjectMemberCommand implements Command<RemoveProjectMemberResponse> {\n\tconstructor(private readonly projectId: string, private readonly identityId: string) {}\n\n\tasync execute({ db, bus }: Command.Args): Promise<RemoveProjectMemberResponse> {\n\t\tconst memberWhere = {\n\t\t\tproject_id: this.projectId,\n\t\t\tidentity_id: this.identityId,\n\t\t}\n\t\tconst result = await DeleteBuilder.create() //\n\t\t\t.from('project_membership')\n\t\t\t.where(memberWhere)\n\t\t\t.execute(db)\n\n\t\tif (result === 0) {\n\t\t\treturn new ResponseError('NOT_MEMBER', 'Not a project member')\n\t\t}\n\t\treturn new ResponseOk(null)\n\t}\n}\n\nexport type RemoveProjectMemberResponse = Response<null, RemoveProjectMemberErrorCode>\n"],"names":[],"mappings":";;AAKO,MAAM,2BAA2E;AAAA,EACvF,YAA6B,WAAoC,YAAoB;AAAxD,SAAA,YAAA;AAAoC,SAAA,aAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"RemoveProjectMemberCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/membership/RemoveProjectMemberCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { RemoveProjectMemberErrorCode } from '../../../schema'\nimport { DeleteBuilder } from '@contember/database'\nimport { Response, ResponseError, ResponseOk } from '../../utils/Response'\n\nexport class RemoveProjectMemberCommand implements Command<RemoveProjectMemberResponse> {\n\tconstructor(private readonly projectId: string, private readonly identityId: string) {}\n\n\tasync execute({ db, bus }: Command.Args): Promise<RemoveProjectMemberResponse> {\n\t\tconst memberWhere = {\n\t\t\tproject_id: this.projectId,\n\t\t\tidentity_id: this.identityId,\n\t\t}\n\t\tconst result = await DeleteBuilder.create() //\n\t\t\t.from('project_membership')\n\t\t\t.where(memberWhere)\n\t\t\t.execute(db)\n\n\t\tif (result === 0) {\n\t\t\treturn new ResponseError('NOT_MEMBER', 'Not a project member')\n\t\t}\n\t\treturn new ResponseOk(null)\n\t}\n}\n\nexport type RemoveProjectMemberResponse = Response<null, RemoveProjectMemberErrorCode>\n"],"names":[],"mappings":";;AAKO,MAAM,2BAA2E;AAAA,EACvF,YAA6B,WAAoC,YAAoB;AAAxD,SAAA,YAAA;AAAoC,SAAA,aAAA;AAAA,EAAA;AAAA,EAEjE,MAAM,QAAQ,EAAE,IAAI,OAA2D;AAC9E,UAAM,cAAc;AAAA,MACnB,YAAY,KAAK;AAAA,MACjB,aAAa,KAAK;AAAA,IACnB;AACA,UAAM,SAAS,MAAM,cAAc,OACjC,EAAA,KAAK,oBAAoB,EACzB,MAAM,WAAW,EACjB,QAAQ,EAAE;AAEZ,QAAI,WAAW,GAAG;AACV,aAAA,IAAI,cAAc,cAAc,sBAAsB;AAAA,IAAA;AAEvD,WAAA,IAAI,WAAW,IAAI;AAAA,EAAA;AAE5B;"}
|
package/dist/production/src/model/commands/membership/RemoveProjectMembershipsCommand.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemoveProjectMembershipsCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/membership/RemoveProjectMembershipsCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { DeleteBuilder } from '@contember/database'\n\nexport class RemoveProjectMembershipCommand implements Command<void> {\n\tconstructor(private readonly projectId: string, private readonly identityId: string, private readonly role: string) {}\n\n\tasync execute({ db, bus, providers }: Command.Args): Promise<void> {\n\t\tawait DeleteBuilder.create()\n\t\t\t.where({\n\t\t\t\tproject_id: this.projectId,\n\t\t\t\tidentity_id: this.identityId,\n\t\t\t\trole: this.role,\n\t\t\t})\n\t\t\t.from('project_membership')\n\t\t\t.execute(db)\n\t}\n}\n"],"names":["DeleteBuilder"],"mappings":";;;AAGO,MAAM,+BAAwD;AAAA,EACpE,YAA6B,WAAoC,YAAqC,MAAc;AAAvF,SAAA,YAAA;AAAoC,SAAA,aAAA;AAAqC,SAAA,OAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"RemoveProjectMembershipsCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/membership/RemoveProjectMembershipsCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { DeleteBuilder } from '@contember/database'\n\nexport class RemoveProjectMembershipCommand implements Command<void> {\n\tconstructor(private readonly projectId: string, private readonly identityId: string, private readonly role: string) {}\n\n\tasync execute({ db, bus, providers }: Command.Args): Promise<void> {\n\t\tawait DeleteBuilder.create()\n\t\t\t.where({\n\t\t\t\tproject_id: this.projectId,\n\t\t\t\tidentity_id: this.identityId,\n\t\t\t\trole: this.role,\n\t\t\t})\n\t\t\t.from('project_membership')\n\t\t\t.execute(db)\n\t}\n}\n"],"names":["DeleteBuilder"],"mappings":";;;AAGO,MAAM,+BAAwD;AAAA,EACpE,YAA6B,WAAoC,YAAqC,MAAc;AAAvF,SAAA,YAAA;AAAoC,SAAA,aAAA;AAAqC,SAAA,OAAA;AAAA,EAAA;AAAA,EAEtG,MAAM,QAAQ,EAAE,IAAI,KAAK,aAA0C;AAC5D,UAAAA,SAAA,cAAc,OAAO,EACzB,MAAM;AAAA,MACN,YAAY,KAAK;AAAA,MACjB,aAAa,KAAK;AAAA,MAClB,MAAM,KAAK;AAAA,IACX,CAAA,EACA,KAAK,oBAAoB,EACzB,QAAQ,EAAE;AAAA,EAAA;AAEd;;"}
|
package/dist/production/src/model/commands/membership/RemoveProjectMembershipsCommand.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemoveProjectMembershipsCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/membership/RemoveProjectMembershipsCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { DeleteBuilder } from '@contember/database'\n\nexport class RemoveProjectMembershipCommand implements Command<void> {\n\tconstructor(private readonly projectId: string, private readonly identityId: string, private readonly role: string) {}\n\n\tasync execute({ db, bus, providers }: Command.Args): Promise<void> {\n\t\tawait DeleteBuilder.create()\n\t\t\t.where({\n\t\t\t\tproject_id: this.projectId,\n\t\t\t\tidentity_id: this.identityId,\n\t\t\t\trole: this.role,\n\t\t\t})\n\t\t\t.from('project_membership')\n\t\t\t.execute(db)\n\t}\n}\n"],"names":[],"mappings":";AAGO,MAAM,+BAAwD;AAAA,EACpE,YAA6B,WAAoC,YAAqC,MAAc;AAAvF,SAAA,YAAA;AAAoC,SAAA,aAAA;AAAqC,SAAA,OAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"RemoveProjectMembershipsCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/membership/RemoveProjectMembershipsCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { DeleteBuilder } from '@contember/database'\n\nexport class RemoveProjectMembershipCommand implements Command<void> {\n\tconstructor(private readonly projectId: string, private readonly identityId: string, private readonly role: string) {}\n\n\tasync execute({ db, bus, providers }: Command.Args): Promise<void> {\n\t\tawait DeleteBuilder.create()\n\t\t\t.where({\n\t\t\t\tproject_id: this.projectId,\n\t\t\t\tidentity_id: this.identityId,\n\t\t\t\trole: this.role,\n\t\t\t})\n\t\t\t.from('project_membership')\n\t\t\t.execute(db)\n\t}\n}\n"],"names":[],"mappings":";AAGO,MAAM,+BAAwD;AAAA,EACpE,YAA6B,WAAoC,YAAqC,MAAc;AAAvF,SAAA,YAAA;AAAoC,SAAA,aAAA;AAAqC,SAAA,OAAA;AAAA,EAAA;AAAA,EAEtG,MAAM,QAAQ,EAAE,IAAI,KAAK,aAA0C;AAC5D,UAAA,cAAc,OAAO,EACzB,MAAM;AAAA,MACN,YAAY,KAAK;AAAA,MACjB,aAAa,KAAK;AAAA,MAClB,MAAM,KAAK;AAAA,IACX,CAAA,EACA,KAAK,oBAAoB,EACzB,QAAQ,EAAE;AAAA,EAAA;AAEd;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateProjectMemberCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/membership/UpdateProjectMemberCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { UpdateProjectMemberErrorCode } from '../../../schema'\nimport { CreateOrUpdateProjectMembershipCommand } from './CreateOrUpdateProjectMembershipCommand'\nimport { SelectBuilder } from '@contember/database'\nimport { MembershipUpdateInput } from './types'\nimport { RemoveProjectMembershipCommand } from './RemoveProjectMembershipsCommand'\nimport { Response, ResponseError, ResponseOk } from '../../utils/Response'\n\nexport class UpdateProjectMemberCommand implements Command<UpdateProjectMemberResponse> {\n\tconstructor(\n\t\tprivate readonly projectId: string,\n\t\tprivate readonly identityId: string,\n\t\tprivate readonly memberships: readonly MembershipUpdateInput[],\n\t) {}\n\n\tasync execute({ db, bus, providers }: Command.Args): Promise<UpdateProjectMemberResponse> {\n\t\tconst result = await SelectBuilder.create()\n\t\t\t.select('id')\n\t\t\t.from('project_membership')\n\t\t\t.where({\n\t\t\t\tproject_id: this.projectId,\n\t\t\t\tidentity_id: this.identityId,\n\t\t\t})\n\t\t\t.getResult(db)\n\t\tif (result.length === 0) {\n\t\t\treturn new ResponseError('NOT_MEMBER', 'Not a project member')\n\t\t}\n\n\t\ttry {\n\t\t\tfor (const membershipUpdate of this.memberships) {\n\t\t\t\tif (membershipUpdate.operation === 'remove') {\n\t\t\t\t\tawait bus.execute(new RemoveProjectMembershipCommand(this.projectId, this.identityId, membershipUpdate.role))\n\t\t\t\t} else {\n\t\t\t\t\tawait bus.execute(\n\t\t\t\t\t\tnew CreateOrUpdateProjectMembershipCommand(this.projectId, this.identityId, membershipUpdate),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn new ResponseOk(null)\n\t\t} catch (e) {\n\t\t\tif (!(e instanceof Error)) {\n\t\t\t\tthrow e\n\t\t\t}\n\t\t\tswitch ((e as any).constraint) {\n\t\t\t\tcase 'project_membership_project':\n\t\t\t\t\treturn new ResponseError('PROJECT_NOT_FOUND', 'Project not found')\n\t\t\t\tdefault:\n\t\t\t\t\tthrow e\n\t\t\t}\n\t\t}\n\t}\n}\nexport type UpdateProjectMemberResponse = Response<null, UpdateProjectMemberErrorCode>\n"],"names":["SelectBuilder","ResponseError","RemoveProjectMembershipCommand","CreateOrUpdateProjectMembershipCommand","ResponseOk"],"mappings":";;;;;;AAQO,MAAM,2BAA2E;AAAA,EACvF,YACkB,WACA,YACA,aAChB;AAHgB,SAAA,YAAA;AACA,SAAA,aAAA;AACA,SAAA,cAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"UpdateProjectMemberCommand.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/membership/UpdateProjectMemberCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { UpdateProjectMemberErrorCode } from '../../../schema'\nimport { CreateOrUpdateProjectMembershipCommand } from './CreateOrUpdateProjectMembershipCommand'\nimport { SelectBuilder } from '@contember/database'\nimport { MembershipUpdateInput } from './types'\nimport { RemoveProjectMembershipCommand } from './RemoveProjectMembershipsCommand'\nimport { Response, ResponseError, ResponseOk } from '../../utils/Response'\n\nexport class UpdateProjectMemberCommand implements Command<UpdateProjectMemberResponse> {\n\tconstructor(\n\t\tprivate readonly projectId: string,\n\t\tprivate readonly identityId: string,\n\t\tprivate readonly memberships: readonly MembershipUpdateInput[],\n\t) {}\n\n\tasync execute({ db, bus, providers }: Command.Args): Promise<UpdateProjectMemberResponse> {\n\t\tconst result = await SelectBuilder.create()\n\t\t\t.select('id')\n\t\t\t.from('project_membership')\n\t\t\t.where({\n\t\t\t\tproject_id: this.projectId,\n\t\t\t\tidentity_id: this.identityId,\n\t\t\t})\n\t\t\t.getResult(db)\n\t\tif (result.length === 0) {\n\t\t\treturn new ResponseError('NOT_MEMBER', 'Not a project member')\n\t\t}\n\n\t\ttry {\n\t\t\tfor (const membershipUpdate of this.memberships) {\n\t\t\t\tif (membershipUpdate.operation === 'remove') {\n\t\t\t\t\tawait bus.execute(new RemoveProjectMembershipCommand(this.projectId, this.identityId, membershipUpdate.role))\n\t\t\t\t} else {\n\t\t\t\t\tawait bus.execute(\n\t\t\t\t\t\tnew CreateOrUpdateProjectMembershipCommand(this.projectId, this.identityId, membershipUpdate),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn new ResponseOk(null)\n\t\t} catch (e) {\n\t\t\tif (!(e instanceof Error)) {\n\t\t\t\tthrow e\n\t\t\t}\n\t\t\tswitch ((e as any).constraint) {\n\t\t\t\tcase 'project_membership_project':\n\t\t\t\t\treturn new ResponseError('PROJECT_NOT_FOUND', 'Project not found')\n\t\t\t\tdefault:\n\t\t\t\t\tthrow e\n\t\t\t}\n\t\t}\n\t}\n}\nexport type UpdateProjectMemberResponse = Response<null, UpdateProjectMemberErrorCode>\n"],"names":["SelectBuilder","ResponseError","RemoveProjectMembershipCommand","CreateOrUpdateProjectMembershipCommand","ResponseOk"],"mappings":";;;;;;AAQO,MAAM,2BAA2E;AAAA,EACvF,YACkB,WACA,YACA,aAChB;AAHgB,SAAA,YAAA;AACA,SAAA,aAAA;AACA,SAAA,cAAA;AAAA,EAAA;AAAA,EAGlB,MAAM,QAAQ,EAAE,IAAI,KAAK,aAAiE;AACnF,UAAA,SAAS,MAAMA,uBAAc,SACjC,OAAO,IAAI,EACX,KAAK,oBAAoB,EACzB,MAAM;AAAA,MACN,YAAY,KAAK;AAAA,MACjB,aAAa,KAAK;AAAA,IAAA,CAClB,EACA,UAAU,EAAE;AACV,QAAA,OAAO,WAAW,GAAG;AACjB,aAAA,IAAIC,SAAAA,cAAc,cAAc,sBAAsB;AAAA,IAAA;AAG1D,QAAA;AACQ,iBAAA,oBAAoB,KAAK,aAAa;AAC5C,YAAA,iBAAiB,cAAc,UAAU;AACtC,gBAAA,IAAI,QAAQ,IAAIC,gCAAAA,+BAA+B,KAAK,WAAW,KAAK,YAAY,iBAAiB,IAAI,CAAC;AAAA,QAAA,OACtG;AACN,gBAAM,IAAI;AAAA,YACT,IAAIC,uCAAuC,uCAAA,KAAK,WAAW,KAAK,YAAY,gBAAgB;AAAA,UAC7F;AAAA,QAAA;AAAA,MACD;AAGM,aAAA,IAAIC,oBAAW,IAAI;AAAA,aAClB,GAAG;AACP,UAAA,EAAE,aAAa,QAAQ;AACpB,cAAA;AAAA,MAAA;AAEP,cAAS,EAAU,YAAY;AAAA,QAC9B,KAAK;AACG,iBAAA,IAAIH,SAAAA,cAAc,qBAAqB,mBAAmB;AAAA,QAClE;AACO,gBAAA;AAAA,MAAA;AAAA,IACR;AAAA,EACD;AAEF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateProjectMemberCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/membership/UpdateProjectMemberCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { UpdateProjectMemberErrorCode } from '../../../schema'\nimport { CreateOrUpdateProjectMembershipCommand } from './CreateOrUpdateProjectMembershipCommand'\nimport { SelectBuilder } from '@contember/database'\nimport { MembershipUpdateInput } from './types'\nimport { RemoveProjectMembershipCommand } from './RemoveProjectMembershipsCommand'\nimport { Response, ResponseError, ResponseOk } from '../../utils/Response'\n\nexport class UpdateProjectMemberCommand implements Command<UpdateProjectMemberResponse> {\n\tconstructor(\n\t\tprivate readonly projectId: string,\n\t\tprivate readonly identityId: string,\n\t\tprivate readonly memberships: readonly MembershipUpdateInput[],\n\t) {}\n\n\tasync execute({ db, bus, providers }: Command.Args): Promise<UpdateProjectMemberResponse> {\n\t\tconst result = await SelectBuilder.create()\n\t\t\t.select('id')\n\t\t\t.from('project_membership')\n\t\t\t.where({\n\t\t\t\tproject_id: this.projectId,\n\t\t\t\tidentity_id: this.identityId,\n\t\t\t})\n\t\t\t.getResult(db)\n\t\tif (result.length === 0) {\n\t\t\treturn new ResponseError('NOT_MEMBER', 'Not a project member')\n\t\t}\n\n\t\ttry {\n\t\t\tfor (const membershipUpdate of this.memberships) {\n\t\t\t\tif (membershipUpdate.operation === 'remove') {\n\t\t\t\t\tawait bus.execute(new RemoveProjectMembershipCommand(this.projectId, this.identityId, membershipUpdate.role))\n\t\t\t\t} else {\n\t\t\t\t\tawait bus.execute(\n\t\t\t\t\t\tnew CreateOrUpdateProjectMembershipCommand(this.projectId, this.identityId, membershipUpdate),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn new ResponseOk(null)\n\t\t} catch (e) {\n\t\t\tif (!(e instanceof Error)) {\n\t\t\t\tthrow e\n\t\t\t}\n\t\t\tswitch ((e as any).constraint) {\n\t\t\t\tcase 'project_membership_project':\n\t\t\t\t\treturn new ResponseError('PROJECT_NOT_FOUND', 'Project not found')\n\t\t\t\tdefault:\n\t\t\t\t\tthrow e\n\t\t\t}\n\t\t}\n\t}\n}\nexport type UpdateProjectMemberResponse = Response<null, UpdateProjectMemberErrorCode>\n"],"names":[],"mappings":";;;;AAQO,MAAM,2BAA2E;AAAA,EACvF,YACkB,WACA,YACA,aAChB;AAHgB,SAAA,YAAA;AACA,SAAA,aAAA;AACA,SAAA,cAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"UpdateProjectMemberCommand.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/commands/membership/UpdateProjectMemberCommand.ts"],"sourcesContent":["import { Command } from '../Command'\nimport { UpdateProjectMemberErrorCode } from '../../../schema'\nimport { CreateOrUpdateProjectMembershipCommand } from './CreateOrUpdateProjectMembershipCommand'\nimport { SelectBuilder } from '@contember/database'\nimport { MembershipUpdateInput } from './types'\nimport { RemoveProjectMembershipCommand } from './RemoveProjectMembershipsCommand'\nimport { Response, ResponseError, ResponseOk } from '../../utils/Response'\n\nexport class UpdateProjectMemberCommand implements Command<UpdateProjectMemberResponse> {\n\tconstructor(\n\t\tprivate readonly projectId: string,\n\t\tprivate readonly identityId: string,\n\t\tprivate readonly memberships: readonly MembershipUpdateInput[],\n\t) {}\n\n\tasync execute({ db, bus, providers }: Command.Args): Promise<UpdateProjectMemberResponse> {\n\t\tconst result = await SelectBuilder.create()\n\t\t\t.select('id')\n\t\t\t.from('project_membership')\n\t\t\t.where({\n\t\t\t\tproject_id: this.projectId,\n\t\t\t\tidentity_id: this.identityId,\n\t\t\t})\n\t\t\t.getResult(db)\n\t\tif (result.length === 0) {\n\t\t\treturn new ResponseError('NOT_MEMBER', 'Not a project member')\n\t\t}\n\n\t\ttry {\n\t\t\tfor (const membershipUpdate of this.memberships) {\n\t\t\t\tif (membershipUpdate.operation === 'remove') {\n\t\t\t\t\tawait bus.execute(new RemoveProjectMembershipCommand(this.projectId, this.identityId, membershipUpdate.role))\n\t\t\t\t} else {\n\t\t\t\t\tawait bus.execute(\n\t\t\t\t\t\tnew CreateOrUpdateProjectMembershipCommand(this.projectId, this.identityId, membershipUpdate),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn new ResponseOk(null)\n\t\t} catch (e) {\n\t\t\tif (!(e instanceof Error)) {\n\t\t\t\tthrow e\n\t\t\t}\n\t\t\tswitch ((e as any).constraint) {\n\t\t\t\tcase 'project_membership_project':\n\t\t\t\t\treturn new ResponseError('PROJECT_NOT_FOUND', 'Project not found')\n\t\t\t\tdefault:\n\t\t\t\t\tthrow e\n\t\t\t}\n\t\t}\n\t}\n}\nexport type UpdateProjectMemberResponse = Response<null, UpdateProjectMemberErrorCode>\n"],"names":[],"mappings":";;;;AAQO,MAAM,2BAA2E;AAAA,EACvF,YACkB,WACA,YACA,aAChB;AAHgB,SAAA,YAAA;AACA,SAAA,aAAA;AACA,SAAA,cAAA;AAAA,EAAA;AAAA,EAGlB,MAAM,QAAQ,EAAE,IAAI,KAAK,aAAiE;AACnF,UAAA,SAAS,MAAM,cAAc,SACjC,OAAO,IAAI,EACX,KAAK,oBAAoB,EACzB,MAAM;AAAA,MACN,YAAY,KAAK;AAAA,MACjB,aAAa,KAAK;AAAA,IAAA,CAClB,EACA,UAAU,EAAE;AACV,QAAA,OAAO,WAAW,GAAG;AACjB,aAAA,IAAI,cAAc,cAAc,sBAAsB;AAAA,IAAA;AAG1D,QAAA;AACQ,iBAAA,oBAAoB,KAAK,aAAa;AAC5C,YAAA,iBAAiB,cAAc,UAAU;AACtC,gBAAA,IAAI,QAAQ,IAAI,+BAA+B,KAAK,WAAW,KAAK,YAAY,iBAAiB,IAAI,CAAC;AAAA,QAAA,OACtG;AACN,gBAAM,IAAI;AAAA,YACT,IAAI,uCAAuC,KAAK,WAAW,KAAK,YAAY,gBAAgB;AAAA,UAC7F;AAAA,QAAA;AAAA,MACD;AAGM,aAAA,IAAI,WAAW,IAAI;AAAA,aAClB,GAAG;AACP,UAAA,EAAE,aAAa,QAAQ;AACpB,cAAA;AAAA,MAAA;AAEP,cAAS,EAAU,YAAY;AAAA,QAC9B,KAAK;AACG,iBAAA,IAAI,cAAc,qBAAqB,mBAAmB;AAAA,QAClE;AACO,gBAAA;AAAA,MAAA;AAAA,IACR;AAAA,EACD;AAEF;"}
|