@nest-boot/auth 8.0.3-beta.1 → 8.0.3-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/README.md +538 -2
- package/dist/abilities/user.ability.d.ts +3 -0
- package/dist/abilities/user.ability.js +2 -0
- package/dist/abilities/user.ability.js.map +1 -1
- package/dist/abilities/workspace.ability.d.ts +3 -0
- package/dist/abilities/workspace.ability.js +2 -0
- package/dist/abilities/workspace.ability.js.map +1 -1
- package/dist/adapters/mikro-orm/adapter-config.js +1 -0
- package/dist/adapters/mikro-orm/adapter-config.js.map +1 -1
- package/dist/adapters/mikro-orm/create-custom-adapter.d.ts +3 -2
- package/dist/adapters/mikro-orm/entity-metadata-resolver.d.ts +2 -2
- package/dist/adapters/mikro-orm/entity-metadata-resolver.js +22 -0
- package/dist/adapters/mikro-orm/entity-metadata-resolver.js.map +1 -1
- package/dist/adapters/mikro-orm/where-compiler.d.ts +24 -24
- package/dist/adapters/mikro-orm-adapter.d.ts +6 -2
- package/dist/adapters/mikro-orm-adapter.js +2 -1
- package/dist/adapters/mikro-orm-adapter.js.map +1 -1
- package/dist/api-key-usage.interceptor.d.ts +5 -2
- package/dist/api-key-usage.interceptor.js +10 -8
- package/dist/api-key-usage.interceptor.js.map +1 -1
- package/dist/auth-handler.middleware.d.ts +3 -0
- package/dist/auth-handler.middleware.js +3 -0
- package/dist/auth-handler.middleware.js.map +1 -1
- package/dist/auth-module-options.interface.d.ts +31 -338
- package/dist/auth.constants.d.ts +4 -0
- package/dist/auth.constants.js +4 -0
- package/dist/auth.constants.js.map +1 -1
- package/dist/auth.guard.d.ts +31 -9
- package/dist/auth.guard.js +49 -106
- package/dist/auth.guard.js.map +1 -1
- package/dist/auth.middleware.d.ts +20 -6
- package/dist/auth.middleware.js +119 -48
- package/dist/auth.middleware.js.map +1 -1
- package/dist/auth.module-definition.d.ts +1 -1
- package/dist/auth.module.d.ts +28 -5
- package/dist/auth.module.js +87 -64
- package/dist/auth.module.js.map +1 -1
- package/dist/connections/account.connection-definition.d.ts +9 -0
- package/dist/connections/account.connection-definition.js +38 -0
- package/dist/connections/account.connection-definition.js.map +1 -0
- package/dist/connections/index.d.ts +8 -0
- package/dist/connections/index.js +9 -0
- package/dist/connections/index.js.map +1 -0
- package/dist/connections/invitation.connection-definition.d.ts +9 -0
- package/dist/connections/invitation.connection-definition.js +40 -0
- package/dist/connections/invitation.connection-definition.js.map +1 -0
- package/dist/connections/member.connection-definition.d.ts +9 -0
- package/dist/connections/member.connection-definition.js +52 -0
- package/dist/connections/member.connection-definition.js.map +1 -0
- package/dist/connections/session.connection-definition.d.ts +9 -0
- package/dist/connections/session.connection-definition.js +32 -0
- package/dist/connections/session.connection-definition.js.map +1 -0
- package/dist/connections/user-api-key.connection-definition.d.ts +13 -0
- package/dist/connections/user-api-key.connection-definition.js +60 -0
- package/dist/connections/user-api-key.connection-definition.js.map +1 -0
- package/dist/connections/user.connection-definition.d.ts +9 -0
- package/dist/connections/user.connection-definition.js +46 -0
- package/dist/connections/user.connection-definition.js.map +1 -0
- package/dist/connections/workspace-api-key.connection-definition.d.ts +13 -0
- package/dist/connections/workspace-api-key.connection-definition.js +60 -0
- package/dist/connections/workspace-api-key.connection-definition.js.map +1 -0
- package/dist/connections/workspace.connection-definition.d.ts +13 -0
- package/dist/connections/workspace.connection-definition.js +43 -0
- package/dist/connections/workspace.connection-definition.js.map +1 -0
- package/dist/decorators/can.decorator.d.ts +8 -0
- package/dist/decorators/can.decorator.js +8 -0
- package/dist/decorators/can.decorator.js.map +1 -1
- package/dist/decorators/current-api-key.decorator.d.ts +1 -0
- package/dist/decorators/current-api-key.decorator.js +3 -3
- package/dist/decorators/current-api-key.decorator.js.map +1 -1
- package/dist/decorators/current-member.decorator.d.ts +2 -0
- package/dist/decorators/current-member.decorator.js +6 -0
- package/dist/decorators/current-member.decorator.js.map +1 -0
- package/dist/decorators/current-session.decorator.d.ts +1 -0
- package/dist/decorators/current-session.decorator.js +3 -2
- package/dist/decorators/current-session.decorator.js.map +1 -1
- package/dist/decorators/current-user.decorator.d.ts +1 -0
- package/dist/decorators/current-user.decorator.js +3 -2
- package/dist/decorators/current-user.decorator.js.map +1 -1
- package/dist/decorators/current-workspace.decorator.d.ts +1 -0
- package/dist/decorators/current-workspace.decorator.js +3 -2
- package/dist/decorators/current-workspace.decorator.js.map +1 -1
- package/dist/decorators/index.d.ts +1 -1
- package/dist/decorators/index.js +1 -1
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/public.decorator.d.ts +1 -0
- package/dist/decorators/public.decorator.js +1 -0
- package/dist/decorators/public.decorator.js.map +1 -1
- package/dist/decorators/user-can.decorator.d.ts +8 -0
- package/dist/decorators/user-can.decorator.js +8 -0
- package/dist/decorators/user-can.decorator.js.map +1 -1
- package/dist/decorators/workspace-can.decorator.d.ts +8 -0
- package/dist/decorators/workspace-can.decorator.js +8 -0
- package/dist/decorators/workspace-can.decorator.js.map +1 -1
- package/dist/entities/account.entity.d.ts +21 -3
- package/dist/entities/account.entity.js +67 -29
- package/dist/entities/account.entity.js.map +1 -1
- package/dist/entities/auth-entity-map.d.ts +21 -0
- package/dist/entities/auth-entity-map.js +22 -0
- package/dist/entities/auth-entity-map.js.map +1 -0
- package/dist/entities/index.d.ts +14 -3
- package/dist/entities/index.js +25 -3
- package/dist/entities/index.js.map +1 -1
- package/dist/entities/invitation.entity.d.ts +24 -0
- package/dist/entities/invitation.entity.js +117 -0
- package/dist/entities/invitation.entity.js.map +1 -0
- package/dist/entities/member.entity.d.ts +28 -0
- package/dist/entities/member.entity.js +126 -0
- package/dist/entities/member.entity.js.map +1 -0
- package/dist/entities/session.entity.d.ts +16 -6
- package/dist/entities/session.entity.js +57 -27
- package/dist/entities/session.entity.js.map +1 -1
- package/dist/entities/user-api-key.entity.d.ts +29 -0
- package/dist/entities/user-api-key.entity.js +147 -0
- package/dist/entities/user-api-key.entity.js.map +1 -0
- package/dist/entities/user.entity.d.ts +18 -2
- package/dist/entities/user.entity.js +104 -29
- package/dist/entities/user.entity.js.map +1 -1
- package/dist/entities/verification.entity.d.ts +8 -1
- package/dist/entities/verification.entity.js +27 -11
- package/dist/entities/verification.entity.js.map +1 -1
- package/dist/entities/workspace-api-key.entity.d.ts +29 -0
- package/dist/entities/workspace-api-key.entity.js +147 -0
- package/dist/entities/workspace-api-key.entity.js.map +1 -0
- package/dist/entities/workspace.entity.d.ts +10 -3
- package/dist/entities/workspace.entity.js +51 -20
- package/dist/entities/workspace.entity.js.map +1 -1
- package/dist/enums/index.d.ts +8 -0
- package/dist/enums/index.js +9 -0
- package/dist/enums/index.js.map +1 -0
- package/dist/enums/invitation-status.enum.d.ts +11 -0
- package/dist/enums/invitation-status.enum.js +17 -0
- package/dist/enums/invitation-status.enum.js.map +1 -0
- package/dist/enums/member-status.enum.d.ts +9 -0
- package/dist/enums/member-status.enum.js +15 -0
- package/dist/enums/member-status.enum.js.map +1 -0
- package/dist/enums/user-api-key-permission.enum.d.ts +4 -0
- package/dist/enums/user-api-key-permission.enum.js +11 -0
- package/dist/enums/user-api-key-permission.enum.js.map +1 -0
- package/dist/enums/user-permission.enum.d.ts +4 -0
- package/dist/enums/user-permission.enum.js +7 -0
- package/dist/enums/user-permission.enum.js.map +1 -0
- package/dist/enums/user-role.enum.d.ts +4 -0
- package/dist/enums/user-role.enum.js +6 -0
- package/dist/enums/user-role.enum.js.map +1 -0
- package/dist/enums/workspace-api-key-permission.enum.d.ts +4 -0
- package/dist/enums/workspace-api-key-permission.enum.js +11 -0
- package/dist/enums/workspace-api-key-permission.enum.js.map +1 -0
- package/dist/enums/workspace-permission.enum.d.ts +4 -0
- package/dist/enums/workspace-permission.enum.js +7 -0
- package/dist/enums/workspace-permission.enum.js.map +1 -0
- package/dist/enums/workspace-role.enum.d.ts +4 -0
- package/dist/enums/workspace-role.enum.js +9 -0
- package/dist/enums/workspace-role.enum.js.map +1 -0
- package/dist/index.d.ts +182 -12
- package/dist/index.js +181 -12
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/api-key-authentication.service.d.ts +14 -0
- package/dist/infrastructure/api-key-authentication.service.js +78 -0
- package/dist/infrastructure/api-key-authentication.service.js.map +1 -0
- package/dist/infrastructure/auth-ability.factory.d.ts +15 -0
- package/dist/infrastructure/auth-ability.factory.js +91 -0
- package/dist/infrastructure/auth-ability.factory.js.map +1 -0
- package/dist/infrastructure/auth-enum-registry.d.ts +8 -0
- package/dist/infrastructure/auth-enum-registry.js +48 -0
- package/dist/infrastructure/auth-enum-registry.js.map +1 -0
- package/dist/infrastructure/auth-service.providers.d.ts +3 -0
- package/dist/infrastructure/auth-service.providers.js +72 -0
- package/dist/infrastructure/auth-service.providers.js.map +1 -0
- package/dist/infrastructure/create-contextual-auth-service.d.ts +10 -0
- package/dist/infrastructure/create-contextual-auth-service.js +50 -0
- package/dist/infrastructure/create-contextual-auth-service.js.map +1 -0
- package/dist/infrastructure/request-identity.d.ts +34 -0
- package/dist/infrastructure/request-identity.js +174 -0
- package/dist/infrastructure/request-identity.js.map +1 -0
- package/dist/infrastructure/revoked-authentication.exception.d.ts +4 -0
- package/dist/infrastructure/revoked-authentication.exception.js +5 -0
- package/dist/infrastructure/revoked-authentication.exception.js.map +1 -0
- package/dist/inputs/add-member.input.d.ts +5 -0
- package/dist/inputs/add-member.input.js +26 -0
- package/dist/inputs/add-member.input.js.map +1 -0
- package/dist/inputs/auth-change-email.input.d.ts +7 -0
- package/dist/inputs/auth-change-email.input.js +33 -0
- package/dist/inputs/auth-change-email.input.js.map +1 -0
- package/dist/inputs/auth-change-password.input.d.ts +9 -0
- package/dist/inputs/auth-change-password.input.js +40 -0
- package/dist/inputs/auth-change-password.input.js.map +1 -0
- package/dist/inputs/auth-delete-user.input.d.ts +9 -0
- package/dist/inputs/auth-delete-user.input.js +40 -0
- package/dist/inputs/auth-delete-user.input.js.map +1 -0
- package/dist/inputs/auth-link-social-account.input.d.ts +13 -0
- package/dist/inputs/auth-link-social-account.input.js +54 -0
- package/dist/inputs/auth-link-social-account.input.js.map +1 -0
- package/dist/inputs/auth-request-password-reset.input.d.ts +7 -0
- package/dist/inputs/auth-request-password-reset.input.js +33 -0
- package/dist/inputs/auth-request-password-reset.input.js.map +1 -0
- package/dist/inputs/auth-reset-password.input.d.ts +7 -0
- package/dist/inputs/auth-reset-password.input.js +33 -0
- package/dist/inputs/auth-reset-password.input.js.map +1 -0
- package/dist/inputs/auth-send-verification-email.input.d.ts +7 -0
- package/dist/inputs/auth-send-verification-email.input.js +33 -0
- package/dist/inputs/auth-send-verification-email.input.js.map +1 -0
- package/dist/inputs/auth-sign-in-social.input.d.ts +17 -0
- package/dist/inputs/auth-sign-in-social.input.js +68 -0
- package/dist/inputs/auth-sign-in-social.input.js.map +1 -0
- package/dist/inputs/auth-sign-in.input.d.ts +11 -0
- package/dist/inputs/auth-sign-in.input.js +47 -0
- package/dist/inputs/auth-sign-in.input.js.map +1 -0
- package/dist/inputs/auth-sign-up.input.d.ts +15 -0
- package/dist/inputs/auth-sign-up.input.js +61 -0
- package/dist/inputs/auth-sign-up.input.js.map +1 -0
- package/dist/inputs/auth-update-user.input.d.ts +7 -0
- package/dist/inputs/auth-update-user.input.js +33 -0
- package/dist/inputs/auth-update-user.input.js.map +1 -0
- package/dist/inputs/ban-user.input.d.ts +7 -0
- package/dist/inputs/ban-user.input.js +33 -0
- package/dist/inputs/ban-user.input.js.map +1 -0
- package/dist/inputs/create-invitation.input.d.ts +10 -0
- package/dist/inputs/create-invitation.input.js +41 -0
- package/dist/inputs/create-invitation.input.js.map +1 -0
- package/dist/inputs/create-user-api-key.input.d.ts +14 -0
- package/dist/inputs/create-user-api-key.input.js +55 -0
- package/dist/inputs/create-user-api-key.input.js.map +1 -0
- package/dist/inputs/create-user.input.d.ts +15 -0
- package/dist/inputs/create-user.input.js +56 -0
- package/dist/inputs/create-user.input.js.map +1 -0
- package/dist/inputs/create-workspace-api-key.input.d.ts +14 -0
- package/dist/inputs/create-workspace-api-key.input.js +55 -0
- package/dist/inputs/create-workspace-api-key.input.js.map +1 -0
- package/dist/inputs/create-workspace.input.d.ts +7 -0
- package/dist/inputs/create-workspace.input.js +28 -0
- package/dist/inputs/create-workspace.input.js.map +1 -0
- package/dist/inputs/set-member-permissions.input.d.ts +6 -0
- package/dist/inputs/set-member-permissions.input.js +27 -0
- package/dist/inputs/set-member-permissions.input.js.map +1 -0
- package/dist/inputs/set-member-roles.input.d.ts +6 -0
- package/dist/inputs/set-member-roles.input.js +27 -0
- package/dist/inputs/set-member-roles.input.js.map +1 -0
- package/dist/inputs/set-user-password.input.d.ts +5 -0
- package/dist/inputs/set-user-password.input.js +26 -0
- package/dist/inputs/set-user-password.input.js.map +1 -0
- package/dist/inputs/set-user-permissions.input.d.ts +6 -0
- package/dist/inputs/set-user-permissions.input.js +27 -0
- package/dist/inputs/set-user-permissions.input.js.map +1 -0
- package/dist/inputs/set-user-roles.input.d.ts +6 -0
- package/dist/inputs/set-user-roles.input.js +27 -0
- package/dist/inputs/set-user-roles.input.js.map +1 -0
- package/dist/inputs/update-member.input.d.ts +10 -0
- package/dist/inputs/update-member.input.js +43 -0
- package/dist/inputs/update-member.input.js.map +1 -0
- package/dist/inputs/update-user-api-key.input.d.ts +14 -0
- package/dist/inputs/update-user-api-key.input.js +50 -0
- package/dist/inputs/update-user-api-key.input.js.map +1 -0
- package/dist/inputs/update-user.input.d.ts +11 -0
- package/dist/inputs/update-user.input.js +47 -0
- package/dist/inputs/update-user.input.js.map +1 -0
- package/dist/inputs/update-workspace-api-key.input.d.ts +14 -0
- package/dist/inputs/update-workspace-api-key.input.js +50 -0
- package/dist/inputs/update-workspace-api-key.input.js.map +1 -0
- package/dist/inputs/update-workspace.input.d.ts +7 -0
- package/dist/inputs/update-workspace.input.js +28 -0
- package/dist/inputs/update-workspace.input.js.map +1 -0
- package/dist/inputs/user-id.input.d.ts +5 -0
- package/dist/inputs/user-id.input.js +26 -0
- package/dist/inputs/user-id.input.js.map +1 -0
- package/dist/interfaces/ability-rules.interface.d.ts +8 -0
- package/dist/interfaces/ability-rules.interface.js +2 -0
- package/dist/interfaces/ability-rules.interface.js.map +1 -0
- package/dist/interfaces/accept-invitation-result.interface.d.ts +9 -0
- package/dist/interfaces/accept-invitation-result.interface.js +2 -0
- package/dist/interfaces/accept-invitation-result.interface.js.map +1 -0
- package/dist/interfaces/add-member-options.interface.d.ts +7 -0
- package/dist/interfaces/add-member-options.interface.js +2 -0
- package/dist/interfaces/add-member-options.interface.js.map +1 -0
- package/dist/interfaces/auth-access-token.interface.d.ts +11 -0
- package/dist/interfaces/auth-access-token.interface.js +2 -0
- package/dist/interfaces/auth-access-token.interface.js.map +1 -0
- package/dist/interfaces/auth-account-info.interface.d.ts +11 -0
- package/dist/interfaces/auth-account-info.interface.js +2 -0
- package/dist/interfaces/auth-account-info.interface.js.map +1 -0
- package/dist/interfaces/auth-account.interface.d.ts +19 -0
- package/dist/interfaces/auth-account.interface.js +2 -0
- package/dist/interfaces/auth-account.interface.js.map +1 -0
- package/dist/interfaces/auth-change-email-confirmation-data.interface.d.ts +12 -0
- package/dist/interfaces/auth-change-email-confirmation-data.interface.js +2 -0
- package/dist/interfaces/auth-change-email-confirmation-data.interface.js.map +1 -0
- package/dist/interfaces/auth-delete-account-verification-data.interface.d.ts +10 -0
- package/dist/interfaces/auth-delete-account-verification-data.interface.js +2 -0
- package/dist/interfaces/auth-delete-account-verification-data.interface.js.map +1 -0
- package/dist/interfaces/auth-email-verification-data.interface.d.ts +10 -0
- package/dist/interfaces/auth-email-verification-data.interface.js +2 -0
- package/dist/interfaces/auth-email-verification-data.interface.js.map +1 -0
- package/dist/interfaces/auth-invitation-email-data.interface.d.ts +18 -0
- package/dist/interfaces/auth-invitation-email-data.interface.js +2 -0
- package/dist/interfaces/auth-invitation-email-data.interface.js.map +1 -0
- package/dist/interfaces/auth-module-account-linking-options.interface.d.ts +18 -0
- package/dist/interfaces/auth-module-account-linking-options.interface.js +2 -0
- package/dist/interfaces/auth-module-account-linking-options.interface.js.map +1 -0
- package/dist/interfaces/auth-module-account-options.interface.d.ts +16 -0
- package/dist/interfaces/auth-module-account-options.interface.js +2 -0
- package/dist/interfaces/auth-module-account-options.interface.js.map +1 -0
- package/dist/interfaces/auth-module-api-key-options.interface.d.ts +15 -0
- package/dist/interfaces/auth-module-api-key-options.interface.js +2 -0
- package/dist/interfaces/auth-module-api-key-options.interface.js.map +1 -0
- package/dist/interfaces/auth-module-change-email-options.interface.d.ts +10 -0
- package/dist/interfaces/auth-module-change-email-options.interface.js +2 -0
- package/dist/interfaces/auth-module-change-email-options.interface.js.map +1 -0
- package/dist/interfaces/auth-module-delete-user-options.interface.d.ts +15 -0
- package/dist/interfaces/auth-module-delete-user-options.interface.js +2 -0
- package/dist/interfaces/auth-module-delete-user-options.interface.js.map +1 -0
- package/dist/interfaces/auth-module-email-and-password-options.interface.d.ts +34 -0
- package/dist/interfaces/auth-module-email-and-password-options.interface.js +2 -0
- package/dist/interfaces/auth-module-email-and-password-options.interface.js.map +1 -0
- package/dist/interfaces/auth-module-email-verification-options.interface.d.ts +19 -0
- package/dist/interfaces/auth-module-email-verification-options.interface.js +2 -0
- package/dist/interfaces/auth-module-email-verification-options.interface.js.map +1 -0
- package/dist/interfaces/auth-module-middleware-options.interface.d.ts +11 -0
- package/dist/interfaces/auth-module-middleware-options.interface.js +2 -0
- package/dist/interfaces/auth-module-middleware-options.interface.js.map +1 -0
- package/dist/interfaces/auth-module-oauth-provider.interface.d.ts +91 -0
- package/dist/interfaces/auth-module-oauth-provider.interface.js +2 -0
- package/dist/interfaces/auth-module-oauth-provider.interface.js.map +1 -0
- package/dist/interfaces/auth-module-password-options.interface.d.ts +10 -0
- package/dist/interfaces/auth-module-password-options.interface.js +2 -0
- package/dist/interfaces/auth-module-password-options.interface.js.map +1 -0
- package/dist/interfaces/auth-module-session-cookie-cache-options.interface.d.ts +14 -0
- package/dist/interfaces/auth-module-session-cookie-cache-options.interface.js +2 -0
- package/dist/interfaces/auth-module-session-cookie-cache-options.interface.js.map +1 -0
- package/dist/interfaces/auth-module-session-cookie-cache-refresh-options.interface.d.ts +5 -0
- package/dist/interfaces/auth-module-session-cookie-cache-refresh-options.interface.js +2 -0
- package/dist/interfaces/auth-module-session-cookie-cache-refresh-options.interface.js.map +1 -0
- package/dist/interfaces/auth-module-session-options.interface.d.ts +16 -0
- package/dist/interfaces/auth-module-session-options.interface.js +2 -0
- package/dist/interfaces/auth-module-session-options.interface.js.map +1 -0
- package/dist/interfaces/auth-module-social-provider.interface.d.ts +109 -0
- package/dist/interfaces/auth-module-social-provider.interface.js +2 -0
- package/dist/interfaces/auth-module-social-provider.interface.js.map +1 -0
- package/dist/interfaces/auth-module-user-options.interface.d.ts +22 -0
- package/dist/interfaces/auth-module-user-options.interface.js +2 -0
- package/dist/interfaces/auth-module-user-options.interface.js.map +1 -0
- package/dist/interfaces/auth-module-workspace-options.interface.d.ts +19 -0
- package/dist/interfaces/auth-module-workspace-options.interface.js +2 -0
- package/dist/interfaces/auth-module-workspace-options.interface.js.map +1 -0
- package/dist/interfaces/auth-oauth-basic-token-endpoint-auth.interface.d.ts +5 -0
- package/dist/interfaces/auth-oauth-basic-token-endpoint-auth.interface.js +2 -0
- package/dist/interfaces/auth-oauth-basic-token-endpoint-auth.interface.js.map +1 -0
- package/dist/interfaces/auth-oauth-client-assertion-context.interface.d.ts +9 -0
- package/dist/interfaces/auth-oauth-client-assertion-context.interface.js +2 -0
- package/dist/interfaces/auth-oauth-client-assertion-context.interface.js.map +1 -0
- package/dist/interfaces/auth-oauth-custom-token-endpoint-auth.interface.d.ts +8 -0
- package/dist/interfaces/auth-oauth-custom-token-endpoint-auth.interface.js +2 -0
- package/dist/interfaces/auth-oauth-custom-token-endpoint-auth.interface.js.map +1 -0
- package/dist/interfaces/auth-oauth-mapped-user.interface.d.ts +15 -0
- package/dist/interfaces/auth-oauth-mapped-user.interface.js +2 -0
- package/dist/interfaces/auth-oauth-mapped-user.interface.js.map +1 -0
- package/dist/interfaces/auth-oauth-no-token-endpoint-auth.interface.d.ts +5 -0
- package/dist/interfaces/auth-oauth-no-token-endpoint-auth.interface.js +2 -0
- package/dist/interfaces/auth-oauth-no-token-endpoint-auth.interface.js.map +1 -0
- package/dist/interfaces/auth-oauth-post-token-endpoint-auth.interface.d.ts +5 -0
- package/dist/interfaces/auth-oauth-post-token-endpoint-auth.interface.js +2 -0
- package/dist/interfaces/auth-oauth-post-token-endpoint-auth.interface.js.map +1 -0
- package/dist/interfaces/auth-oauth-private-key-jwt-token-endpoint-auth.interface.d.ts +9 -0
- package/dist/interfaces/auth-oauth-private-key-jwt-token-endpoint-auth.interface.js +2 -0
- package/dist/interfaces/auth-oauth-private-key-jwt-token-endpoint-auth.interface.js.map +1 -0
- package/dist/interfaces/auth-oauth-profile.interface.d.ts +9 -0
- package/dist/interfaces/auth-oauth-profile.interface.js +2 -0
- package/dist/interfaces/auth-oauth-profile.interface.js.map +1 -0
- package/dist/interfaces/auth-oauth-refresh-context.interface.d.ts +7 -0
- package/dist/interfaces/auth-oauth-refresh-context.interface.js +2 -0
- package/dist/interfaces/auth-oauth-refresh-context.interface.js.map +1 -0
- package/dist/interfaces/auth-oauth-token-request-client-options.interface.d.ts +7 -0
- package/dist/interfaces/auth-oauth-token-request-client-options.interface.js +2 -0
- package/dist/interfaces/auth-oauth-token-request-client-options.interface.js.map +1 -0
- package/dist/interfaces/auth-oauth-token-request-context.interface.d.ts +15 -0
- package/dist/interfaces/auth-oauth-token-request-context.interface.js +2 -0
- package/dist/interfaces/auth-oauth-token-request-context.interface.js.map +1 -0
- package/dist/interfaces/auth-oauth-tokens.interface.d.ts +19 -0
- package/dist/interfaces/auth-oauth-tokens.interface.js +2 -0
- package/dist/interfaces/auth-oauth-tokens.interface.js.map +1 -0
- package/dist/interfaces/auth-oauth-user-info.interface.d.ts +13 -0
- package/dist/interfaces/auth-oauth-user-info.interface.js +2 -0
- package/dist/interfaces/auth-oauth-user-info.interface.js.map +1 -0
- package/dist/interfaces/auth-provider-user-info.interface.d.ts +13 -0
- package/dist/interfaces/auth-provider-user-info.interface.js +2 -0
- package/dist/interfaces/auth-provider-user-info.interface.js.map +1 -0
- package/dist/interfaces/auth-refreshed-token.interface.d.ts +19 -0
- package/dist/interfaces/auth-refreshed-token.interface.js +2 -0
- package/dist/interfaces/auth-refreshed-token.interface.js.map +1 -0
- package/dist/interfaces/auth-reset-password-data.interface.d.ts +10 -0
- package/dist/interfaces/auth-reset-password-data.interface.js +2 -0
- package/dist/interfaces/auth-reset-password-data.interface.js.map +1 -0
- package/dist/interfaces/auth-social-provider-user-info.interface.d.ts +8 -0
- package/dist/interfaces/auth-social-provider-user-info.interface.js +2 -0
- package/dist/interfaces/auth-social-provider-user-info.interface.js.map +1 -0
- package/dist/interfaces/auth-social-provider.interface.d.ts +7 -0
- package/dist/interfaces/auth-social-provider.interface.js +2 -0
- package/dist/interfaces/auth-social-provider.interface.js.map +1 -0
- package/dist/interfaces/auth-user.interface.d.ts +19 -0
- package/dist/interfaces/auth-user.interface.js +2 -0
- package/dist/interfaces/auth-user.interface.js.map +1 -0
- package/dist/interfaces/authenticated-session.interface.d.ts +9 -0
- package/dist/interfaces/authenticated-session.interface.js +2 -0
- package/dist/interfaces/authenticated-session.interface.js.map +1 -0
- package/dist/interfaces/ban-user-options.interface.d.ts +7 -0
- package/dist/interfaces/ban-user-options.interface.js +2 -0
- package/dist/interfaces/ban-user-options.interface.js.map +1 -0
- package/dist/interfaces/can-options.interface.d.ts +2 -0
- package/dist/interfaces/change-auth-email-options.interface.d.ts +7 -0
- package/dist/interfaces/change-auth-email-options.interface.js +2 -0
- package/dist/interfaces/change-auth-email-options.interface.js.map +1 -0
- package/dist/interfaces/change-auth-password-options.interface.d.ts +9 -0
- package/dist/interfaces/change-auth-password-options.interface.js +2 -0
- package/dist/interfaces/change-auth-password-options.interface.js.map +1 -0
- package/dist/interfaces/change-auth-password-result.interface.d.ts +5 -0
- package/dist/interfaces/change-auth-password-result.interface.js +2 -0
- package/dist/interfaces/change-auth-password-result.interface.js.map +1 -0
- package/dist/interfaces/create-api-key-options.interface.d.ts +14 -0
- package/dist/interfaces/create-api-key-options.interface.js +2 -0
- package/dist/interfaces/create-api-key-options.interface.js.map +1 -0
- package/dist/interfaces/create-invitation-options.interface.d.ts +9 -0
- package/dist/interfaces/create-invitation-options.interface.js +2 -0
- package/dist/interfaces/create-invitation-options.interface.js.map +1 -0
- package/dist/interfaces/create-user-options.interface.d.ts +13 -0
- package/dist/interfaces/create-user-options.interface.js +2 -0
- package/dist/interfaces/create-user-options.interface.js.map +1 -0
- package/dist/interfaces/create-workspace-options.interface.d.ts +5 -0
- package/dist/interfaces/create-workspace-options.interface.js +2 -0
- package/dist/interfaces/create-workspace-options.interface.js.map +1 -0
- package/dist/interfaces/created-api-key.interface.d.ts +8 -0
- package/dist/interfaces/created-api-key.interface.js +2 -0
- package/dist/interfaces/created-api-key.interface.js.map +1 -0
- package/dist/interfaces/delete-auth-user-options.interface.d.ts +9 -0
- package/dist/interfaces/delete-auth-user-options.interface.js +2 -0
- package/dist/interfaces/delete-auth-user-options.interface.js.map +1 -0
- package/dist/interfaces/delete-auth-user-result.interface.d.ts +7 -0
- package/dist/interfaces/delete-auth-user-result.interface.js +2 -0
- package/dist/interfaces/delete-auth-user-result.interface.js.map +1 -0
- package/dist/interfaces/impersonation-options.interface.d.ts +7 -0
- package/dist/interfaces/impersonation-options.interface.js +2 -0
- package/dist/interfaces/impersonation-options.interface.js.map +1 -0
- package/dist/interfaces/link-auth-social-account-options.interface.d.ts +21 -0
- package/dist/interfaces/link-auth-social-account-options.interface.js +2 -0
- package/dist/interfaces/link-auth-social-account-options.interface.js.map +1 -0
- package/dist/interfaces/link-auth-social-account-result.interface.d.ts +7 -0
- package/dist/interfaces/link-auth-social-account-result.interface.js +2 -0
- package/dist/interfaces/link-auth-social-account-result.interface.js.map +1 -0
- package/dist/interfaces/request-identity-patch.interface.d.ts +13 -0
- package/dist/interfaces/request-identity-patch.interface.js +2 -0
- package/dist/interfaces/request-identity-patch.interface.js.map +1 -0
- package/dist/interfaces/request-password-reset-options.interface.d.ts +7 -0
- package/dist/interfaces/request-password-reset-options.interface.js +2 -0
- package/dist/interfaces/request-password-reset-options.interface.js.map +1 -0
- package/dist/interfaces/request-password-reset-result.interface.d.ts +7 -0
- package/dist/interfaces/request-password-reset-result.interface.js +2 -0
- package/dist/interfaces/request-password-reset-result.interface.js.map +1 -0
- package/dist/interfaces/request-permissions.interface.d.ts +7 -0
- package/dist/interfaces/request-permissions.interface.js +2 -0
- package/dist/interfaces/request-permissions.interface.js.map +1 -0
- package/dist/interfaces/reset-password-options.interface.d.ts +7 -0
- package/dist/interfaces/reset-password-options.interface.js +2 -0
- package/dist/interfaces/reset-password-options.interface.js.map +1 -0
- package/dist/interfaces/route-argument-metadata-value.interface.d.ts +4 -0
- package/dist/interfaces/scope-policy-options.interface.d.ts +6 -0
- package/dist/interfaces/send-verification-email-options.interface.d.ts +7 -0
- package/dist/interfaces/send-verification-email-options.interface.js +2 -0
- package/dist/interfaces/send-verification-email-options.interface.js.map +1 -0
- package/dist/interfaces/serialized-ability-rule.interface.d.ts +7 -0
- package/dist/interfaces/sign-in-entity-result.interface.d.ts +7 -0
- package/dist/interfaces/sign-in-entity-result.interface.js +2 -0
- package/dist/interfaces/sign-in-entity-result.interface.js.map +1 -0
- package/dist/interfaces/sign-in-options.interface.d.ts +11 -0
- package/dist/interfaces/sign-in-options.interface.js +2 -0
- package/dist/interfaces/sign-in-options.interface.js.map +1 -0
- package/dist/interfaces/sign-in-result.interface.d.ts +12 -0
- package/dist/interfaces/sign-in-result.interface.js +2 -0
- package/dist/interfaces/sign-in-result.interface.js.map +1 -0
- package/dist/interfaces/sign-in-social-entity-result.interface.d.ts +7 -0
- package/dist/interfaces/sign-in-social-entity-result.interface.js +2 -0
- package/dist/interfaces/sign-in-social-entity-result.interface.js.map +1 -0
- package/dist/interfaces/sign-in-social-options.interface.d.ts +23 -0
- package/dist/interfaces/sign-in-social-options.interface.js +2 -0
- package/dist/interfaces/sign-in-social-options.interface.js.map +1 -0
- package/dist/interfaces/sign-in-social-result.interface.d.ts +12 -0
- package/dist/interfaces/sign-in-social-result.interface.js +2 -0
- package/dist/interfaces/sign-in-social-result.interface.js.map +1 -0
- package/dist/interfaces/sign-up-options.interface.d.ts +15 -0
- package/dist/interfaces/sign-up-options.interface.js +2 -0
- package/dist/interfaces/sign-up-options.interface.js.map +1 -0
- package/dist/interfaces/sign-up-result.interface.d.ts +8 -0
- package/dist/interfaces/sign-up-result.interface.js +2 -0
- package/dist/interfaces/sign-up-result.interface.js.map +1 -0
- package/dist/interfaces/unlink-auth-account-options.interface.d.ts +5 -0
- package/dist/interfaces/unlink-auth-account-options.interface.js +2 -0
- package/dist/interfaces/unlink-auth-account-options.interface.js.map +1 -0
- package/dist/interfaces/update-api-key-options.interface.d.ts +14 -0
- package/dist/interfaces/update-api-key-options.interface.js +2 -0
- package/dist/interfaces/update-api-key-options.interface.js.map +1 -0
- package/dist/interfaces/update-auth-user-options.interface.d.ts +7 -0
- package/dist/interfaces/update-auth-user-options.interface.js +2 -0
- package/dist/interfaces/update-auth-user-options.interface.js.map +1 -0
- package/dist/interfaces/update-member-options.interface.d.ts +10 -0
- package/dist/interfaces/update-member-options.interface.js +2 -0
- package/dist/interfaces/update-member-options.interface.js.map +1 -0
- package/dist/interfaces/update-user-options.interface.d.ts +11 -0
- package/dist/interfaces/update-user-options.interface.js +2 -0
- package/dist/interfaces/update-user-options.interface.js.map +1 -0
- package/dist/interfaces/update-workspace-options.interface.d.ts +5 -0
- package/dist/interfaces/update-workspace-options.interface.js +2 -0
- package/dist/interfaces/update-workspace-options.interface.js.map +1 -0
- package/dist/interfaces/user-api-key-validation.interface.d.ts +11 -0
- package/dist/interfaces/user-api-key-validation.interface.js +2 -0
- package/dist/interfaces/user-api-key-validation.interface.js.map +1 -0
- package/dist/interfaces/user-can-metadata.interface.d.ts +3 -0
- package/dist/interfaces/user-has-permissions-options.interface.d.ts +5 -0
- package/dist/interfaces/user-has-permissions-options.interface.js +2 -0
- package/dist/interfaces/user-has-permissions-options.interface.js.map +1 -0
- package/dist/interfaces/workspace-api-key-validation.interface.d.ts +11 -0
- package/dist/interfaces/workspace-api-key-validation.interface.js +2 -0
- package/dist/interfaces/workspace-api-key-validation.interface.js.map +1 -0
- package/dist/interfaces/workspace-can-metadata.interface.d.ts +3 -0
- package/dist/interfaces/workspace-has-permissions-options.interface.d.ts +5 -0
- package/dist/interfaces/workspace-has-permissions-options.interface.js +2 -0
- package/dist/interfaces/workspace-has-permissions-options.interface.js.map +1 -0
- package/dist/objects/accept-invitation-payload.object.d.ts +9 -0
- package/dist/objects/accept-invitation-payload.object.js +36 -0
- package/dist/objects/accept-invitation-payload.object.js.map +1 -0
- package/dist/objects/add-member-payload.object.d.ts +5 -0
- package/dist/objects/add-member-payload.object.js +24 -0
- package/dist/objects/add-member-payload.object.js.map +1 -0
- package/dist/objects/auth-ability-rule.object.d.ts +15 -0
- package/dist/objects/auth-ability-rule.object.js +55 -0
- package/dist/objects/auth-ability-rule.object.js.map +1 -0
- package/dist/objects/auth-change-password-result.object.d.ts +5 -0
- package/dist/objects/auth-change-password-result.object.js +24 -0
- package/dist/objects/auth-change-password-result.object.js.map +1 -0
- package/dist/objects/auth-delete-user-result.object.d.ts +7 -0
- package/dist/objects/auth-delete-user-result.object.js +30 -0
- package/dist/objects/auth-delete-user-result.object.js.map +1 -0
- package/dist/objects/auth-link-social-account-result.object.d.ts +7 -0
- package/dist/objects/auth-link-social-account-result.object.js +30 -0
- package/dist/objects/auth-link-social-account-result.object.js.map +1 -0
- package/dist/objects/auth-request-password-reset-result.object.d.ts +7 -0
- package/dist/objects/auth-request-password-reset-result.object.js +30 -0
- package/dist/objects/auth-request-password-reset-result.object.js.map +1 -0
- package/dist/objects/auth-sign-in-result.object.d.ts +12 -0
- package/dist/objects/auth-sign-in-result.object.js +43 -0
- package/dist/objects/auth-sign-in-result.object.js.map +1 -0
- package/dist/objects/auth-sign-in-social-result.object.d.ts +12 -0
- package/dist/objects/auth-sign-in-social-result.object.js +43 -0
- package/dist/objects/auth-sign-in-social-result.object.js.map +1 -0
- package/dist/objects/auth-social-provider.object.d.ts +7 -0
- package/dist/objects/auth-social-provider.object.js +30 -0
- package/dist/objects/auth-social-provider.object.js.map +1 -0
- package/dist/objects/ban-user-payload.object.d.ts +5 -0
- package/dist/objects/ban-user-payload.object.js +24 -0
- package/dist/objects/ban-user-payload.object.js.map +1 -0
- package/dist/objects/cancel-invitation-payload.object.d.ts +5 -0
- package/dist/objects/cancel-invitation-payload.object.js +24 -0
- package/dist/objects/cancel-invitation-payload.object.js.map +1 -0
- package/dist/objects/create-invitation-payload.object.d.ts +5 -0
- package/dist/objects/create-invitation-payload.object.js +24 -0
- package/dist/objects/create-invitation-payload.object.js.map +1 -0
- package/dist/objects/create-user-api-key-result.object.d.ts +10 -0
- package/dist/objects/create-user-api-key-result.object.js +33 -0
- package/dist/objects/create-user-api-key-result.object.js.map +1 -0
- package/dist/objects/create-user-payload.object.d.ts +5 -0
- package/dist/objects/create-user-payload.object.js +24 -0
- package/dist/objects/create-user-payload.object.js.map +1 -0
- package/dist/objects/create-workspace-api-key-result.object.d.ts +10 -0
- package/dist/objects/create-workspace-api-key-result.object.js +33 -0
- package/dist/objects/create-workspace-api-key-result.object.js.map +1 -0
- package/dist/objects/create-workspace-payload.object.d.ts +5 -0
- package/dist/objects/create-workspace-payload.object.js +24 -0
- package/dist/objects/create-workspace-payload.object.js.map +1 -0
- package/dist/objects/delete-user-payload.object.d.ts +5 -0
- package/dist/objects/delete-user-payload.object.js +24 -0
- package/dist/objects/delete-user-payload.object.js.map +1 -0
- package/dist/objects/delete-workspace-payload.object.d.ts +5 -0
- package/dist/objects/delete-workspace-payload.object.js +24 -0
- package/dist/objects/delete-workspace-payload.object.js.map +1 -0
- package/dist/objects/leave-workspace-payload.object.d.ts +5 -0
- package/dist/objects/leave-workspace-payload.object.js +24 -0
- package/dist/objects/leave-workspace-payload.object.js.map +1 -0
- package/dist/objects/reject-invitation-payload.object.d.ts +5 -0
- package/dist/objects/reject-invitation-payload.object.js +24 -0
- package/dist/objects/reject-invitation-payload.object.js.map +1 -0
- package/dist/objects/remove-member-payload.object.d.ts +5 -0
- package/dist/objects/remove-member-payload.object.js +24 -0
- package/dist/objects/remove-member-payload.object.js.map +1 -0
- package/dist/objects/set-member-permissions-payload.object.d.ts +5 -0
- package/dist/objects/set-member-permissions-payload.object.js +24 -0
- package/dist/objects/set-member-permissions-payload.object.js.map +1 -0
- package/dist/objects/set-member-roles-payload.object.d.ts +5 -0
- package/dist/objects/set-member-roles-payload.object.js +24 -0
- package/dist/objects/set-member-roles-payload.object.js.map +1 -0
- package/dist/objects/set-user-permissions-payload.object.d.ts +5 -0
- package/dist/objects/set-user-permissions-payload.object.js +24 -0
- package/dist/objects/set-user-permissions-payload.object.js.map +1 -0
- package/dist/objects/set-user-roles-payload.object.d.ts +5 -0
- package/dist/objects/set-user-roles-payload.object.js +24 -0
- package/dist/objects/set-user-roles-payload.object.js.map +1 -0
- package/dist/objects/sign-up-payload.object.d.ts +7 -0
- package/dist/objects/sign-up-payload.object.js +30 -0
- package/dist/objects/sign-up-payload.object.js.map +1 -0
- package/dist/objects/unban-user-payload.object.d.ts +5 -0
- package/dist/objects/unban-user-payload.object.js +24 -0
- package/dist/objects/unban-user-payload.object.js.map +1 -0
- package/dist/objects/update-member-payload.object.d.ts +5 -0
- package/dist/objects/update-member-payload.object.js +24 -0
- package/dist/objects/update-member-payload.object.js.map +1 -0
- package/dist/objects/update-user-payload.object.d.ts +5 -0
- package/dist/objects/update-user-payload.object.js +24 -0
- package/dist/objects/update-user-payload.object.js.map +1 -0
- package/dist/objects/update-workspace-payload.object.d.ts +5 -0
- package/dist/objects/update-workspace-payload.object.js +24 -0
- package/dist/objects/update-workspace-payload.object.js.map +1 -0
- package/dist/objects/user-api-key-permission-option.object.d.ts +8 -0
- package/dist/objects/user-api-key-permission-option.object.js +31 -0
- package/dist/objects/user-api-key-permission-option.object.js.map +1 -0
- package/dist/objects/user-permission-option.object.d.ts +8 -0
- package/dist/objects/user-permission-option.object.js +31 -0
- package/dist/objects/user-permission-option.object.js.map +1 -0
- package/dist/objects/user-role-option.object.d.ts +8 -0
- package/dist/objects/user-role-option.object.js +31 -0
- package/dist/objects/user-role-option.object.js.map +1 -0
- package/dist/objects/workspace-api-key-permission-option.object.d.ts +8 -0
- package/dist/objects/workspace-api-key-permission-option.object.js +31 -0
- package/dist/objects/workspace-api-key-permission-option.object.js.map +1 -0
- package/dist/objects/workspace-permission-option.object.d.ts +8 -0
- package/dist/objects/workspace-permission-option.object.js +31 -0
- package/dist/objects/workspace-permission-option.object.js.map +1 -0
- package/dist/objects/workspace-role-option.object.d.ts +8 -0
- package/dist/objects/workspace-role-option.object.js +31 -0
- package/dist/objects/workspace-role-option.object.js.map +1 -0
- package/dist/permission.constants.d.ts +23 -0
- package/dist/permission.constants.js +23 -0
- package/dist/permission.constants.js.map +1 -1
- package/dist/policies/create-scope-policy.d.ts +1 -0
- package/dist/policies/create-scope-policy.js +2 -1
- package/dist/policies/create-scope-policy.js.map +1 -1
- package/dist/policies/user-scope.policy.d.ts +8 -0
- package/dist/policies/user-scope.policy.js +8 -0
- package/dist/policies/user-scope.policy.js.map +1 -1
- package/dist/policies/workspace-scope.policy.d.ts +8 -0
- package/dist/policies/workspace-scope.policy.js +8 -0
- package/dist/policies/workspace-scope.policy.js.map +1 -1
- package/dist/resolvers/auth.resolver.d.ts +67 -0
- package/dist/resolvers/auth.resolver.js +279 -0
- package/dist/resolvers/auth.resolver.js.map +1 -0
- package/dist/resolvers/invitation.resolver.d.ts +32 -0
- package/dist/resolvers/invitation.resolver.js +134 -0
- package/dist/resolvers/invitation.resolver.js.map +1 -0
- package/dist/resolvers/member.resolver.d.ts +73 -0
- package/dist/resolvers/member.resolver.js +191 -0
- package/dist/resolvers/member.resolver.js.map +1 -0
- package/dist/resolvers/session.resolver.d.ts +33 -0
- package/dist/resolvers/session.resolver.js +156 -0
- package/dist/resolvers/session.resolver.js.map +1 -0
- package/dist/resolvers/user-api-key.resolver.d.ts +24 -0
- package/dist/resolvers/user-api-key.resolver.js +84 -0
- package/dist/resolvers/user-api-key.resolver.js.map +1 -0
- package/dist/resolvers/user.resolver.d.ts +75 -0
- package/dist/resolvers/user.resolver.js +289 -0
- package/dist/resolvers/user.resolver.js.map +1 -0
- package/dist/resolvers/workspace-api-key.resolver.d.ts +24 -0
- package/dist/resolvers/workspace-api-key.resolver.js +84 -0
- package/dist/resolvers/workspace-api-key.resolver.js.map +1 -0
- package/dist/resolvers/workspace.resolver.d.ts +80 -0
- package/dist/resolvers/workspace.resolver.js +211 -0
- package/dist/resolvers/workspace.resolver.js.map +1 -0
- package/dist/services/access-control.service.d.ts +52 -0
- package/dist/services/access-control.service.js +201 -0
- package/dist/services/access-control.service.js.map +1 -0
- package/dist/services/account.service.d.ts +14 -0
- package/dist/services/account.service.js +43 -0
- package/dist/services/account.service.js.map +1 -0
- package/dist/services/auth.service.d.ts +101 -0
- package/dist/services/auth.service.js +333 -0
- package/dist/services/auth.service.js.map +1 -0
- package/dist/services/invitation.service.d.ts +58 -0
- package/dist/services/invitation.service.js +386 -0
- package/dist/services/invitation.service.js.map +1 -0
- package/dist/services/member.service.d.ts +75 -0
- package/dist/services/member.service.js +390 -0
- package/dist/services/member.service.js.map +1 -0
- package/dist/services/session.service.d.ts +58 -0
- package/dist/services/session.service.js +313 -0
- package/dist/services/session.service.js.map +1 -0
- package/dist/services/user-api-key.service.d.ts +48 -0
- package/dist/services/user-api-key.service.js +260 -0
- package/dist/services/user-api-key.service.js.map +1 -0
- package/dist/services/user-deletion.service.d.ts +15 -0
- package/dist/services/user-deletion.service.js +50 -0
- package/dist/services/user-deletion.service.js.map +1 -0
- package/dist/services/user.service.d.ts +81 -0
- package/dist/services/user.service.js +479 -0
- package/dist/services/user.service.js.map +1 -0
- package/dist/services/workspace-api-key.service.d.ts +49 -0
- package/dist/services/workspace-api-key.service.js +272 -0
- package/dist/services/workspace-api-key.service.js.map +1 -0
- package/dist/services/workspace.service.d.ts +40 -0
- package/dist/services/workspace.service.js +202 -0
- package/dist/services/workspace.service.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/api-key-validation.type.d.ts +4 -0
- package/dist/types/api-key-validation.type.js +2 -0
- package/dist/types/api-key-validation.type.js.map +1 -0
- package/dist/types/api-key.type.d.ts +4 -0
- package/dist/types/api-key.type.js +2 -0
- package/dist/types/api-key.type.js.map +1 -0
- package/dist/types/auth-account-selector.type.d.ts +12 -0
- package/dist/types/auth-account-selector.type.js +2 -0
- package/dist/types/auth-account-selector.type.js.map +1 -0
- package/dist/types/auth-invitation-email-inviter.type.d.ts +7 -0
- package/dist/types/auth-invitation-email-inviter.type.js +2 -0
- package/dist/types/auth-invitation-email-inviter.type.js.map +1 -0
- package/dist/types/auth-maybe-promise.type.d.ts +2 -0
- package/dist/types/auth-maybe-promise.type.js +2 -0
- package/dist/types/auth-maybe-promise.type.js.map +1 -0
- package/dist/types/auth-module-provider.type.d.ts +4 -0
- package/dist/types/auth-module-provider.type.js +2 -0
- package/dist/types/auth-module-provider.type.js.map +1 -0
- package/dist/types/auth-module-roles.type.d.ts +3 -1
- package/dist/types/auth-module-social-provider-id.type.d.ts +2 -0
- package/dist/types/auth-module-social-provider-id.type.js +2 -0
- package/dist/types/auth-module-social-provider-id.type.js.map +1 -0
- package/dist/types/auth-oauth-token-endpoint-auth.type.d.ts +7 -0
- package/dist/types/auth-oauth-token-endpoint-auth.type.js +2 -0
- package/dist/types/auth-oauth-token-endpoint-auth.type.js.map +1 -0
- package/dist/types/auth-send-invitation-email.type.d.ts +7 -0
- package/dist/types/auth-send-invitation-email.type.js +2 -0
- package/dist/types/auth-send-invitation-email.type.js.map +1 -0
- package/dist/types/auth-send-reset-password.type.d.ts +7 -0
- package/dist/types/auth-send-reset-password.type.js +2 -0
- package/dist/types/auth-send-reset-password.type.js.map +1 -0
- package/dist/types/auth-send-verification-email.type.d.ts +7 -0
- package/dist/types/auth-send-verification-email.type.js +2 -0
- package/dist/types/auth-send-verification-email.type.js.map +1 -0
- package/dist/types/build-user-ability-callback.type.d.ts +10 -4
- package/dist/types/build-workspace-ability-callback.type.d.ts +10 -4
- package/dist/types/can-subject-factory.type.d.ts +1 -0
- package/dist/types/can-subject.type.d.ts +1 -0
- package/dist/types/lowercase-identifier.type.d.ts +6 -0
- package/dist/types/lowercase-identifier.type.js +2 -0
- package/dist/types/lowercase-identifier.type.js.map +1 -0
- package/dist/types/permission-name.type.d.ts +3 -0
- package/dist/types/permission-name.type.js +2 -0
- package/dist/types/permission-name.type.js.map +1 -0
- package/dist/types/role-name.type.d.ts +3 -0
- package/dist/types/role-name.type.js +2 -0
- package/dist/types/role-name.type.js.map +1 -0
- package/dist/types/route-argument-metadata.type.d.ts +1 -0
- package/dist/user.constants.d.ts +8 -2
- package/dist/user.constants.js +24 -14
- package/dist/user.constants.js.map +1 -1
- package/dist/utils/api-key-credential.util.d.ts +4 -0
- package/dist/utils/api-key-credential.util.js +16 -0
- package/dist/utils/api-key-credential.util.js.map +1 -0
- package/dist/utils/api-key-permissions.util.d.ts +6 -0
- package/dist/utils/api-key-permissions.util.js +16 -0
- package/dist/utils/api-key-permissions.util.js.map +1 -0
- package/dist/utils/append-metadata.util.d.ts +1 -0
- package/dist/utils/append-metadata.util.js +1 -0
- package/dist/utils/append-metadata.util.js.map +1 -1
- package/dist/utils/apply-auth-response-cookies.util.d.ts +1 -0
- package/dist/utils/apply-auth-response-cookies.util.js +1 -0
- package/dist/utils/apply-auth-response-cookies.util.js.map +1 -1
- package/dist/utils/auth-role.util.d.ts +8 -2
- package/dist/utils/auth-role.util.js +22 -6
- package/dist/utils/auth-role.util.js.map +1 -1
- package/dist/utils/build-request-ability.util.d.ts +7 -0
- package/dist/utils/build-request-ability.util.js +25 -0
- package/dist/utils/build-request-ability.util.js.map +1 -0
- package/dist/utils/can.util.d.ts +1 -0
- package/dist/utils/can.util.js +1 -0
- package/dist/utils/can.util.js.map +1 -1
- package/dist/utils/create-email-verification-config.d.ts +1 -0
- package/dist/utils/create-email-verification-config.js +1 -0
- package/dist/utils/create-email-verification-config.js.map +1 -1
- package/dist/utils/create-generic-oauth-config.d.ts +1 -0
- package/dist/utils/create-generic-oauth-config.js +1 -0
- package/dist/utils/create-generic-oauth-config.js.map +1 -1
- package/dist/utils/create-permission-enum.util.d.ts +2 -0
- package/dist/utils/create-permission-enum.util.js +16 -0
- package/dist/utils/create-permission-enum.util.js.map +1 -0
- package/dist/utils/create-user-config.d.ts +2 -1
- package/dist/utils/create-user-config.js +1 -0
- package/dist/utils/create-user-config.js.map +1 -1
- package/dist/utils/estimate-entropy.d.ts +7 -0
- package/dist/utils/estimate-entropy.js +7 -0
- package/dist/utils/estimate-entropy.js.map +1 -1
- package/dist/utils/extend-ability.util.d.ts +4 -0
- package/dist/utils/extend-ability.util.js +62 -0
- package/dist/utils/extend-ability.util.js.map +1 -0
- package/dist/utils/extract-api-key.util.d.ts +1 -0
- package/dist/utils/extract-api-key.util.js +1 -0
- package/dist/utils/extract-api-key.util.js.map +1 -1
- package/dist/utils/get-current-api-key.util.d.ts +3 -0
- package/dist/utils/get-current-api-key.util.js +9 -0
- package/dist/utils/get-current-api-key.util.js.map +1 -0
- package/dist/utils/get-user-ability.util.d.ts +2 -1
- package/dist/utils/get-user-ability.util.js +5 -2
- package/dist/utils/get-user-ability.util.js.map +1 -1
- package/dist/utils/get-workspace-ability.util.d.ts +2 -1
- package/dist/utils/get-workspace-ability.util.js +5 -2
- package/dist/utils/get-workspace-ability.util.js.map +1 -1
- package/dist/utils/resolve-auth-catalog.util.d.ts +7 -0
- package/dist/utils/resolve-auth-catalog.util.js +34 -0
- package/dist/utils/resolve-auth-catalog.util.js.map +1 -0
- package/dist/utils/resolve-effective-permissions.util.d.ts +9 -0
- package/dist/utils/resolve-effective-permissions.util.js +18 -0
- package/dist/utils/resolve-effective-permissions.util.js.map +1 -0
- package/dist/utils/resolve-request-permissions.util.d.ts +6 -0
- package/dist/utils/resolve-request-permissions.util.js +44 -0
- package/dist/utils/resolve-request-permissions.util.js.map +1 -0
- package/dist/utils/run-auth-query.d.ts +4 -0
- package/dist/utils/run-auth-query.js +32 -2
- package/dist/utils/run-auth-query.js.map +1 -1
- package/dist/utils/serialize-ability-rules.util.d.ts +1 -0
- package/dist/utils/serialize-ability-rules.util.js +2 -1
- package/dist/utils/serialize-ability-rules.util.js.map +1 -1
- package/dist/utils/split-auth-providers.d.ts +2 -1
- package/dist/utils/split-auth-providers.js +1 -0
- package/dist/utils/split-auth-providers.js.map +1 -1
- package/dist/utils/user-can.util.d.ts +1 -0
- package/dist/utils/user-can.util.js +3 -12
- package/dist/utils/user-can.util.js.map +1 -1
- package/dist/utils/workspace-can.util.d.ts +1 -0
- package/dist/utils/workspace-can.util.js +4 -12
- package/dist/utils/workspace-can.util.js.map +1 -1
- package/dist/workspace.constants.d.ts +10 -3
- package/dist/workspace.constants.js +24 -13
- package/dist/workspace.constants.js.map +1 -1
- package/package.json +36 -13
- package/dist/access-control.service.d.ts +0 -18
- package/dist/access-control.service.js +0 -153
- package/dist/access-control.service.js.map +0 -1
- package/dist/api-key.service.d.ts +0 -75
- package/dist/api-key.service.js +0 -332
- package/dist/api-key.service.js.map +0 -1
- package/dist/auth.service.d.ts +0 -27
- package/dist/auth.service.js +0 -199
- package/dist/auth.service.js.map +0 -1
- package/dist/decorators/current-workspace-member.decorator.d.ts +0 -1
- package/dist/decorators/current-workspace-member.decorator.js +0 -5
- package/dist/decorators/current-workspace-member.decorator.js.map +0 -1
- package/dist/entities/api-key.entity.d.ts +0 -17
- package/dist/entities/api-key.entity.js +0 -92
- package/dist/entities/api-key.entity.js.map +0 -1
- package/dist/entities/resolve-auth-relation-target.d.ts +0 -3
- package/dist/entities/resolve-auth-relation-target.js +0 -30
- package/dist/entities/resolve-auth-relation-target.js.map +0 -1
- package/dist/entities/workspace-invitation.entity.d.ts +0 -14
- package/dist/entities/workspace-invitation.entity.js +0 -74
- package/dist/entities/workspace-invitation.entity.js.map +0 -1
- package/dist/entities/workspace-member.entity.d.ts +0 -16
- package/dist/entities/workspace-member.entity.js +0 -86
- package/dist/entities/workspace-member.entity.js.map +0 -1
- package/dist/interfaces/auth-role.interface.d.ts +0 -4
- package/dist/interfaces/auth-role.interface.js +0 -2
- package/dist/interfaces/auth-role.interface.js.map +0 -1
- package/dist/interfaces/auth-service.interface.d.ts +0 -160
- package/dist/interfaces/auth-service.interface.js +0 -2
- package/dist/interfaces/auth-service.interface.js.map +0 -1
- package/dist/interfaces/session-service.interface.d.ts +0 -5
- package/dist/interfaces/session-service.interface.js +0 -2
- package/dist/interfaces/session-service.interface.js.map +0 -1
- package/dist/interfaces/user-service.interface.d.ts +0 -44
- package/dist/interfaces/user-service.interface.js +0 -2
- package/dist/interfaces/user-service.interface.js.map +0 -1
- package/dist/interfaces/workspace-service.interface.d.ts +0 -37
- package/dist/interfaces/workspace-service.interface.js +0 -2
- package/dist/interfaces/workspace-service.interface.js.map +0 -1
- package/dist/session.service.d.ts +0 -18
- package/dist/session.service.js +0 -165
- package/dist/session.service.js.map +0 -1
- package/dist/user-deletion.service.d.ts +0 -19
- package/dist/user-deletion.service.js +0 -96
- package/dist/user-deletion.service.js.map +0 -1
- package/dist/user.service.d.ts +0 -54
- package/dist/user.service.js +0 -384
- package/dist/user.service.js.map +0 -1
- package/dist/workspace.service.d.ts +0 -59
- package/dist/workspace.service.js +0 -618
- package/dist/workspace.service.js.map +0 -1
package/dist/user.service.js
DELETED
|
@@ -1,384 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
-
};
|
|
13
|
-
import { randomBytes } from "node:crypto";
|
|
14
|
-
import { EntityManager, Reference, } from "@mikro-orm/core";
|
|
15
|
-
import { HashService } from "@nest-boot/hash";
|
|
16
|
-
import { BadRequestException, ConflictException, ForbiddenException, Inject, Injectable, } from "@nestjs/common";
|
|
17
|
-
import { AccessControlService } from "./access-control.service.js";
|
|
18
|
-
import { MODULE_OPTIONS_TOKEN } from "./auth.module-definition.js";
|
|
19
|
-
import { DEFAULT_USER_ADMIN_ROLES, DEFAULT_USER_PERMISSIONS, DEFAULT_USER_ROLE, DEFAULT_USER_ROLES, } from "./user.constants.js";
|
|
20
|
-
import { UserDeletionService, WorkspaceOwnershipConflictError, } from "./user-deletion.service.js";
|
|
21
|
-
import { listAuthPermissions, listAuthRoles, normalizeAuthPermissions, normalizeAuthRoles, resolveAuthPermissions, } from "./utils/auth-role.util.js";
|
|
22
|
-
import { runAuthQuery } from "./utils/run-auth-query.js";
|
|
23
|
-
const CREDENTIAL_ISSUER = "local:credential";
|
|
24
|
-
const CREDENTIAL_PROVIDER_ID = "credential";
|
|
25
|
-
const MUTABLE_USER_FIELDS = new Set([
|
|
26
|
-
"email",
|
|
27
|
-
"emailVerified",
|
|
28
|
-
"image",
|
|
29
|
-
"name",
|
|
30
|
-
]);
|
|
31
|
-
let UserService = class UserService {
|
|
32
|
-
em;
|
|
33
|
-
options;
|
|
34
|
-
hashService;
|
|
35
|
-
accessControlService;
|
|
36
|
-
userDeletionService;
|
|
37
|
-
constructor(em, options, hashService, accessControlService, userDeletionService) {
|
|
38
|
-
this.em = em;
|
|
39
|
-
this.options = options;
|
|
40
|
-
this.hashService = hashService;
|
|
41
|
-
this.accessControlService = accessControlService;
|
|
42
|
-
this.userDeletionService = userDeletionService;
|
|
43
|
-
}
|
|
44
|
-
async createUser(input) {
|
|
45
|
-
this.accessControlService.assertUserCan("create", this.userEntity);
|
|
46
|
-
if (input.roles !== undefined || input.permissions !== undefined) {
|
|
47
|
-
this.accessControlService.assertUserCan("set-role", this.userEntity);
|
|
48
|
-
}
|
|
49
|
-
this.assertPasswordLength(input.password);
|
|
50
|
-
const permissions = this.normalizePermissions(input.permissions ?? []);
|
|
51
|
-
const roles = this.normalizeRoles(input.roles ?? [this.defaultRole]);
|
|
52
|
-
this.accessControlService.assertCanGrantUserPermissions(resolveAuthPermissions(roles, permissions, this.roles));
|
|
53
|
-
const email = input.email.trim().toLowerCase();
|
|
54
|
-
const password = await this.hashPassword(input.password);
|
|
55
|
-
return await this.runUnrestricted(async (em) => await em.transactional(async (em) => {
|
|
56
|
-
const user = em.create(this.userEntity, {
|
|
57
|
-
...(input.data ?? {}),
|
|
58
|
-
email,
|
|
59
|
-
emailVerified: false,
|
|
60
|
-
name: input.name,
|
|
61
|
-
permissions,
|
|
62
|
-
roles,
|
|
63
|
-
});
|
|
64
|
-
em.persist(user);
|
|
65
|
-
await em.flush();
|
|
66
|
-
const userId = String(user.id);
|
|
67
|
-
const account = em.create(this.accountEntity, {
|
|
68
|
-
accountId: userId,
|
|
69
|
-
issuer: CREDENTIAL_ISSUER,
|
|
70
|
-
password,
|
|
71
|
-
providerId: CREDENTIAL_PROVIDER_ID,
|
|
72
|
-
userId,
|
|
73
|
-
});
|
|
74
|
-
em.persist(account);
|
|
75
|
-
await em.flush();
|
|
76
|
-
return user;
|
|
77
|
-
}));
|
|
78
|
-
}
|
|
79
|
-
async getUser(userId) {
|
|
80
|
-
this.accessControlService.assertUserCan("get", this.userEntity);
|
|
81
|
-
return await this.runUnrestricted(async (em) => await em.findOne(this.userEntity, { id: userId }, {
|
|
82
|
-
filters: false,
|
|
83
|
-
}));
|
|
84
|
-
}
|
|
85
|
-
async getUserByEmail(email) {
|
|
86
|
-
this.accessControlService.assertUserCan("get", this.userEntity);
|
|
87
|
-
return await this.runUnrestricted(async (em) => await em.findOne(this.userEntity, { email: email.trim().toLowerCase() }, { filters: false }));
|
|
88
|
-
}
|
|
89
|
-
async updateUser(user, input) {
|
|
90
|
-
this.accessControlService.assertUserCan("update", user);
|
|
91
|
-
const data = this.createUserUpdateData(input);
|
|
92
|
-
if (input.email !== undefined || input.emailVerified !== undefined) {
|
|
93
|
-
this.accessControlService.assertUserCan("set-email", user);
|
|
94
|
-
}
|
|
95
|
-
this.em.assign(user, data);
|
|
96
|
-
await this.runUnrestricted((em) => em.persist(user).flush());
|
|
97
|
-
return user;
|
|
98
|
-
}
|
|
99
|
-
async setUserPermissions(user, permissions) {
|
|
100
|
-
this.accessControlService.assertUserCan("set-role", user);
|
|
101
|
-
const normalized = this.normalizePermissions(permissions);
|
|
102
|
-
this.accessControlService.assertCanGrantUserPermissions(normalized);
|
|
103
|
-
user.permissions = normalized;
|
|
104
|
-
await this.runUnrestricted((em) => em.persist(user).flush());
|
|
105
|
-
return user;
|
|
106
|
-
}
|
|
107
|
-
async setRole(user, role) {
|
|
108
|
-
this.accessControlService.assertUserCan("set-role", user);
|
|
109
|
-
const roles = this.normalizeRoles(role);
|
|
110
|
-
this.accessControlService.assertCanGrantUserPermissions(resolveAuthPermissions(roles, [], this.roles));
|
|
111
|
-
user.roles = roles;
|
|
112
|
-
await this.runUnrestricted((em) => em.persist(user).flush());
|
|
113
|
-
return user;
|
|
114
|
-
}
|
|
115
|
-
listRoles() {
|
|
116
|
-
this.accessControlService.assertUserCan("set-role", this.userEntity);
|
|
117
|
-
return listAuthRoles(this.roles);
|
|
118
|
-
}
|
|
119
|
-
listPermissions() {
|
|
120
|
-
this.accessControlService.assertUserCan("set-role", this.userEntity);
|
|
121
|
-
return listAuthPermissions(this.permissions);
|
|
122
|
-
}
|
|
123
|
-
getUserPermissions(user) {
|
|
124
|
-
return resolveAuthPermissions(user.roles ?? [this.defaultRole], user.permissions ?? [], this.roles);
|
|
125
|
-
}
|
|
126
|
-
async listUsers(input = {}) {
|
|
127
|
-
this.accessControlService.assertUserCan("list", this.userEntity);
|
|
128
|
-
return await this.runUnrestricted(async (em) => {
|
|
129
|
-
const where = this.createUserFilter(input);
|
|
130
|
-
const [users, total] = await em.findAndCount(this.userEntity, where, {
|
|
131
|
-
filters: false,
|
|
132
|
-
limit: input.limit,
|
|
133
|
-
offset: input.offset,
|
|
134
|
-
orderBy: {
|
|
135
|
-
[input.sortBy ?? "createdAt"]: input.sortDirection ?? "asc",
|
|
136
|
-
},
|
|
137
|
-
});
|
|
138
|
-
return {
|
|
139
|
-
users,
|
|
140
|
-
total,
|
|
141
|
-
limit: input.limit ?? null,
|
|
142
|
-
offset: input.offset ?? null,
|
|
143
|
-
};
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
async listUserSessions(user) {
|
|
147
|
-
this.accessControlService.assertUserCan("list", this.sessionEntity);
|
|
148
|
-
return await this.runUnrestricted(async (em) => await em.find(this.sessionEntity, {
|
|
149
|
-
expiresAt: { $gt: new Date() },
|
|
150
|
-
userId: String(user.id),
|
|
151
|
-
}, { filters: false, orderBy: { createdAt: "desc" } }));
|
|
152
|
-
}
|
|
153
|
-
async banUser(user, input = {}) {
|
|
154
|
-
this.accessControlService.assertUserCan("ban", user);
|
|
155
|
-
const banExpiresAt = input.banExpiresIn === undefined
|
|
156
|
-
? null
|
|
157
|
-
: new Date(Date.now() + input.banExpiresIn * 1000);
|
|
158
|
-
if (input.banExpiresIn !== undefined &&
|
|
159
|
-
(!Number.isSafeInteger(input.banExpiresIn) ||
|
|
160
|
-
input.banExpiresIn <= 0 ||
|
|
161
|
-
Number.isNaN(banExpiresAt?.getTime()))) {
|
|
162
|
-
throw new BadRequestException("Ban duration must be a positive integer number of seconds");
|
|
163
|
-
}
|
|
164
|
-
user.banned = true;
|
|
165
|
-
user.banReason = input.banReason ?? null;
|
|
166
|
-
user.banExpiresAt = banExpiresAt;
|
|
167
|
-
await this.runUnrestricted(async (em) => {
|
|
168
|
-
await em.nativeDelete(this.sessionEntity, {
|
|
169
|
-
$or: [{ userId: String(user.id) }, { impersonatedBy: user }],
|
|
170
|
-
});
|
|
171
|
-
await em.persist(user).flush();
|
|
172
|
-
});
|
|
173
|
-
return user;
|
|
174
|
-
}
|
|
175
|
-
async unbanUser(user) {
|
|
176
|
-
this.accessControlService.assertUserCan("ban", user);
|
|
177
|
-
user.banned = false;
|
|
178
|
-
user.banReason = null;
|
|
179
|
-
user.banExpiresAt = null;
|
|
180
|
-
await this.runUnrestricted((em) => em.persist(user).flush());
|
|
181
|
-
return user;
|
|
182
|
-
}
|
|
183
|
-
async impersonateUser(administrator, user, input = {}) {
|
|
184
|
-
this.accessControlService.assertCurrentUser(administrator);
|
|
185
|
-
this.accessControlService.assertUserCan("impersonate", user);
|
|
186
|
-
if (this.isAdmin(user)) {
|
|
187
|
-
this.accessControlService.assertUserCan("impersonate-admins", user);
|
|
188
|
-
}
|
|
189
|
-
if (this.isActivelyBanned(user)) {
|
|
190
|
-
throw new ForbiddenException("Banned users cannot be impersonated");
|
|
191
|
-
}
|
|
192
|
-
const session = await this.runUnrestricted(async (em) => {
|
|
193
|
-
const session = this.createSession(em, user, {
|
|
194
|
-
...input,
|
|
195
|
-
impersonatedBy: administrator,
|
|
196
|
-
});
|
|
197
|
-
await em.persist(session).flush();
|
|
198
|
-
return session;
|
|
199
|
-
});
|
|
200
|
-
return { session, user };
|
|
201
|
-
}
|
|
202
|
-
async stopImpersonating(currentSession, input = {}) {
|
|
203
|
-
this.accessControlService.assertCurrentSession(currentSession);
|
|
204
|
-
const impersonatedByReference = currentSession.impersonatedBy;
|
|
205
|
-
if (!impersonatedByReference)
|
|
206
|
-
return null;
|
|
207
|
-
return await this.runUnrestricted(async (em) => {
|
|
208
|
-
const impersonatedBy = Reference.unwrapReference(impersonatedByReference);
|
|
209
|
-
const administrator = await em.findOne(this.userEntity, { id: String(impersonatedBy.id) }, { filters: false });
|
|
210
|
-
if (!administrator)
|
|
211
|
-
return null;
|
|
212
|
-
if (this.isActivelyBanned(administrator)) {
|
|
213
|
-
await em.remove(currentSession).flush();
|
|
214
|
-
throw new ForbiddenException("Banned administrators cannot restore their session");
|
|
215
|
-
}
|
|
216
|
-
const session = this.createSession(em, administrator, input);
|
|
217
|
-
em.remove(currentSession).persist(session);
|
|
218
|
-
await em.flush();
|
|
219
|
-
return { session, user: administrator };
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
async revokeUserSession(user, sessionId) {
|
|
223
|
-
this.accessControlService.assertUserCan("revoke", this.sessionEntity);
|
|
224
|
-
return await this.runUnrestricted(async (em) => {
|
|
225
|
-
const session = await em.findOne(this.sessionEntity, { id: sessionId, userId: String(user.id) }, { filters: false });
|
|
226
|
-
if (!session)
|
|
227
|
-
return false;
|
|
228
|
-
await em.remove(session).flush();
|
|
229
|
-
return true;
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
async revokeUserSessions(user) {
|
|
233
|
-
this.accessControlService.assertUserCan("revoke", this.sessionEntity);
|
|
234
|
-
return await this.runUnrestricted(async (em) => await em.nativeDelete(this.sessionEntity, {
|
|
235
|
-
$or: [{ userId: String(user.id) }, { impersonatedBy: user }],
|
|
236
|
-
}));
|
|
237
|
-
}
|
|
238
|
-
async removeUser(user) {
|
|
239
|
-
this.accessControlService.assertUserCan("delete", user);
|
|
240
|
-
try {
|
|
241
|
-
await this.userDeletionService.deleteUser(String(user.id));
|
|
242
|
-
}
|
|
243
|
-
catch (error) {
|
|
244
|
-
if (error instanceof WorkspaceOwnershipConflictError) {
|
|
245
|
-
throw new ConflictException(error.message);
|
|
246
|
-
}
|
|
247
|
-
throw error;
|
|
248
|
-
}
|
|
249
|
-
return user;
|
|
250
|
-
}
|
|
251
|
-
async setUserPassword(user, newPassword) {
|
|
252
|
-
this.accessControlService.assertUserCan("set-password", user);
|
|
253
|
-
this.assertPasswordLength(newPassword);
|
|
254
|
-
await this.runUnrestricted(async (em) => {
|
|
255
|
-
const password = await this.hashPassword(newPassword);
|
|
256
|
-
const account = await em.findOne(this.accountEntity, {
|
|
257
|
-
issuer: CREDENTIAL_ISSUER,
|
|
258
|
-
accountId: String(user.id),
|
|
259
|
-
providerId: CREDENTIAL_PROVIDER_ID,
|
|
260
|
-
userId: String(user.id),
|
|
261
|
-
}, { filters: false });
|
|
262
|
-
if (account) {
|
|
263
|
-
account.password = password;
|
|
264
|
-
}
|
|
265
|
-
else {
|
|
266
|
-
em.persist(em.create(this.accountEntity, {
|
|
267
|
-
accountId: String(user.id),
|
|
268
|
-
issuer: CREDENTIAL_ISSUER,
|
|
269
|
-
password,
|
|
270
|
-
providerId: CREDENTIAL_PROVIDER_ID,
|
|
271
|
-
userId: String(user.id),
|
|
272
|
-
}));
|
|
273
|
-
}
|
|
274
|
-
await em.flush();
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
hasPermission(user, input) {
|
|
278
|
-
const permissions = new Set(this.getUserPermissions(user));
|
|
279
|
-
return Object.entries(input.permissions).every(([subject, actions]) => actions.every((action) => permissions.has(`${subject}:${action}`)));
|
|
280
|
-
}
|
|
281
|
-
isAdmin(user) {
|
|
282
|
-
const adminRoles = new Set(this.options.user?.adminRoles ?? DEFAULT_USER_ADMIN_ROLES);
|
|
283
|
-
return (user.roles ?? [this.defaultRole]).some((role) => adminRoles.has(role));
|
|
284
|
-
}
|
|
285
|
-
normalizeRoles(role) {
|
|
286
|
-
return normalizeAuthRoles(role, this.roles);
|
|
287
|
-
}
|
|
288
|
-
normalizePermissions(permissions) {
|
|
289
|
-
return normalizeAuthPermissions(permissions, this.permissions, "User");
|
|
290
|
-
}
|
|
291
|
-
createUserUpdateData(input) {
|
|
292
|
-
const unsupportedFields = Object.keys(input).filter((field) => !MUTABLE_USER_FIELDS.has(field));
|
|
293
|
-
if (unsupportedFields.length > 0) {
|
|
294
|
-
throw new BadRequestException(`User update contains unsupported fields: ${unsupportedFields.join(", ")}`);
|
|
295
|
-
}
|
|
296
|
-
return {
|
|
297
|
-
...input,
|
|
298
|
-
...(input.email === undefined
|
|
299
|
-
? {}
|
|
300
|
-
: { email: input.email.trim().toLowerCase() }),
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
|
-
get roles() {
|
|
304
|
-
return this.options.user?.roles ?? DEFAULT_USER_ROLES;
|
|
305
|
-
}
|
|
306
|
-
get defaultRole() {
|
|
307
|
-
return this.options.user?.defaultRole ?? DEFAULT_USER_ROLE;
|
|
308
|
-
}
|
|
309
|
-
get permissions() {
|
|
310
|
-
return this.options.user?.permissions ?? DEFAULT_USER_PERMISSIONS;
|
|
311
|
-
}
|
|
312
|
-
createSession(em, user, input) {
|
|
313
|
-
const expiresIn = this.options.session?.expiresIn ?? 60 * 60 * 24 * 7;
|
|
314
|
-
return em.create(this.sessionEntity, {
|
|
315
|
-
expiresAt: new Date(Date.now() + expiresIn * 1000),
|
|
316
|
-
impersonatedBy: input.impersonatedBy ?? null,
|
|
317
|
-
ipAddress: input.ipAddress ?? null,
|
|
318
|
-
token: randomBytes(32).toString("base64url"),
|
|
319
|
-
userAgent: input.userAgent ?? null,
|
|
320
|
-
userId: String(user.id),
|
|
321
|
-
});
|
|
322
|
-
}
|
|
323
|
-
createUserFilter(input) {
|
|
324
|
-
const where = {};
|
|
325
|
-
if (input.searchValue) {
|
|
326
|
-
const operator = input.searchOperator ?? "contains";
|
|
327
|
-
const pattern = operator === "starts_with"
|
|
328
|
-
? `${input.searchValue}%`
|
|
329
|
-
: operator === "ends_with"
|
|
330
|
-
? `%${input.searchValue}`
|
|
331
|
-
: `%${input.searchValue}%`;
|
|
332
|
-
where[input.searchField ?? "email"] = { $like: pattern };
|
|
333
|
-
}
|
|
334
|
-
if (input.filterField && input.filterValue !== undefined) {
|
|
335
|
-
const operator = input.filterOperator ?? "eq";
|
|
336
|
-
where[input.filterField] =
|
|
337
|
-
operator === "eq"
|
|
338
|
-
? input.filterValue
|
|
339
|
-
: operator === "contains"
|
|
340
|
-
? { $like: `%${String(input.filterValue)}%` }
|
|
341
|
-
: { [`$${operator}`]: input.filterValue };
|
|
342
|
-
}
|
|
343
|
-
return where;
|
|
344
|
-
}
|
|
345
|
-
async hashPassword(password) {
|
|
346
|
-
return await (this.options.emailAndPassword?.password?.hash ??
|
|
347
|
-
((value) => this.hashService.hash(value)))(password);
|
|
348
|
-
}
|
|
349
|
-
assertPasswordLength(password) {
|
|
350
|
-
const minimum = this.options.emailAndPassword?.minPasswordLength ?? 8;
|
|
351
|
-
const maximum = this.options.emailAndPassword?.maxPasswordLength ?? 128;
|
|
352
|
-
if (password.length < minimum) {
|
|
353
|
-
throw new BadRequestException(`Password must contain at least ${String(minimum)} characters`);
|
|
354
|
-
}
|
|
355
|
-
if (password.length > maximum) {
|
|
356
|
-
throw new BadRequestException(`Password must contain at most ${String(maximum)} characters`);
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
isActivelyBanned(user) {
|
|
360
|
-
return (user.banned &&
|
|
361
|
-
(!user.banExpiresAt || user.banExpiresAt.getTime() > Date.now()));
|
|
362
|
-
}
|
|
363
|
-
async runUnrestricted(callback) {
|
|
364
|
-
return await runAuthQuery(this.em, callback);
|
|
365
|
-
}
|
|
366
|
-
get accountEntity() {
|
|
367
|
-
return this.options.entities.account;
|
|
368
|
-
}
|
|
369
|
-
get sessionEntity() {
|
|
370
|
-
return this.options.entities.session;
|
|
371
|
-
}
|
|
372
|
-
get userEntity() {
|
|
373
|
-
return this.options.entities.user;
|
|
374
|
-
}
|
|
375
|
-
};
|
|
376
|
-
UserService = __decorate([
|
|
377
|
-
Injectable(),
|
|
378
|
-
__param(1, Inject(MODULE_OPTIONS_TOKEN)),
|
|
379
|
-
__param(4, Inject(UserDeletionService)),
|
|
380
|
-
__metadata("design:paramtypes", [EntityManager, Object, HashService,
|
|
381
|
-
AccessControlService, Object])
|
|
382
|
-
], UserService);
|
|
383
|
-
export { UserService };
|
|
384
|
-
//# sourceMappingURL=user.service.js.map
|
package/dist/user.service.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user.service.js","sourceRoot":"","sources":["../src/user.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAEL,aAAa,EAEb,SAAS,GAEV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,MAAM,EACN,UAAU,GACX,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAenE,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,mBAAmB,EACnB,+BAA+B,GAChC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,wBAAwB,EACxB,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,MAAM,iBAAiB,GAAG,kBAAkB,CAAC;AAC7C,MAAM,sBAAsB,GAAG,YAAY,CAAC;AAC5C,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC;IAClC,OAAO;IACP,eAAe;IACf,OAAO;IACP,MAAM;CACP,CAAC,CAAC;AAII,IAAM,WAAW,GAAjB,MAAM,WAAW;IAQH;IAEA;IACA;IACA;IAEA;IARnB,YAEmB,EAAiB,EAEj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AU,EAAE;IAUR,WAAA,MAAM,CAAC,oBAAoB,CAAC,CAAA;IAI5B,WAAA,MAAM,CAAC,mBAAmB,CAAC,CAAA;qCALP,aAAa,UAGJ,WAAW;QACF,oBAAoB;GAZlD,WAAW,CAyfvB"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { EntityManager, type FilterQuery } from "@mikro-orm/core";
|
|
2
|
-
import { AccessControlService } from "./access-control.service.js";
|
|
3
|
-
import type { AuthModuleOptions } from "./auth-module-options.interface.js";
|
|
4
|
-
import type { BaseUser, BaseWorkspace, BaseWorkspaceInvitation, BaseWorkspaceMember } from "./entities/index.js";
|
|
5
|
-
import type { AuthRole } from "./interfaces/auth-role.interface.js";
|
|
6
|
-
import type { AcceptWorkspaceInvitationResult, AddWorkspaceMemberOptions, CreateWorkspaceInvitationOptions, CreateWorkspaceOptions, CreateWorkspaceServiceAccountOptions, FullWorkspace, UpdateWorkspaceMemberOptions, UpdateWorkspaceOptions, WorkspaceHasPermissionOptions } from "./interfaces/workspace-service.interface.js";
|
|
7
|
-
export declare class WorkspaceService<Workspace extends BaseWorkspace = BaseWorkspace, WorkspaceMember extends BaseWorkspaceMember = BaseWorkspaceMember, WorkspaceInvitation extends BaseWorkspaceInvitation = BaseWorkspaceInvitation, User extends BaseUser = BaseUser> {
|
|
8
|
-
protected readonly em: EntityManager;
|
|
9
|
-
private readonly authOptions;
|
|
10
|
-
private readonly accessControlService;
|
|
11
|
-
constructor(em: EntityManager, authOptions: AuthModuleOptions, accessControlService: AccessControlService);
|
|
12
|
-
findOne(where: FilterQuery<Workspace>): Promise<Workspace | null>;
|
|
13
|
-
listWorkspaces(user: User): Promise<Workspace[]>;
|
|
14
|
-
createWorkspace(user: User, input: CreateWorkspaceOptions): Promise<Workspace>;
|
|
15
|
-
getFullWorkspace(workspace: Workspace): Promise<FullWorkspace<Workspace, WorkspaceMember, WorkspaceInvitation>>;
|
|
16
|
-
updateWorkspace(workspace: Workspace, input: UpdateWorkspaceOptions): Promise<Workspace>;
|
|
17
|
-
deleteWorkspace(workspace: Workspace, currentWorkspaceMember: WorkspaceMember): Promise<Workspace>;
|
|
18
|
-
getMember(workspace: Workspace, user: User): Promise<WorkspaceMember | null>;
|
|
19
|
-
getMemberById(workspace: Workspace, memberId: string): Promise<WorkspaceMember | null>;
|
|
20
|
-
listMembers(workspace: Workspace): Promise<WorkspaceMember[]>;
|
|
21
|
-
addMember(workspace: Workspace, user: User, input?: AddWorkspaceMemberOptions): Promise<WorkspaceMember>;
|
|
22
|
-
addMemberByEmail(workspace: Workspace, email: string, input?: AddWorkspaceMemberOptions): Promise<WorkspaceMember>;
|
|
23
|
-
createServiceAccount(workspace: Workspace, input: CreateWorkspaceServiceAccountOptions): Promise<WorkspaceMember>;
|
|
24
|
-
updateMember(member: WorkspaceMember, input: UpdateWorkspaceMemberOptions): Promise<WorkspaceMember>;
|
|
25
|
-
updateMemberRole(member: WorkspaceMember, role: string | readonly string[]): Promise<WorkspaceMember>;
|
|
26
|
-
setMemberPermissions(member: WorkspaceMember, permissions: readonly string[]): Promise<WorkspaceMember>;
|
|
27
|
-
removeMember(member: WorkspaceMember): Promise<WorkspaceMember>;
|
|
28
|
-
leaveWorkspace(member: WorkspaceMember): Promise<WorkspaceMember>;
|
|
29
|
-
transferOwnership(workspace: Workspace, currentOwner: WorkspaceMember, nextOwner: WorkspaceMember): Promise<WorkspaceMember>;
|
|
30
|
-
createInvitation(workspace: Workspace, inviter: User, input: CreateWorkspaceInvitationOptions, request?: Request): Promise<WorkspaceInvitation>;
|
|
31
|
-
getUserInvitation(id: string, user: User): Promise<WorkspaceInvitation | null>;
|
|
32
|
-
getWorkspaceInvitation(id: string, workspace: Workspace): Promise<WorkspaceInvitation | null>;
|
|
33
|
-
listInvitations(workspace: Workspace): Promise<WorkspaceInvitation[]>;
|
|
34
|
-
listUserInvitations(user: User): Promise<WorkspaceInvitation[]>;
|
|
35
|
-
acceptInvitation(user: User, invitationId: string): Promise<AcceptWorkspaceInvitationResult<WorkspaceInvitation, WorkspaceMember> | null>;
|
|
36
|
-
cancelInvitation(invitation: WorkspaceInvitation): Promise<WorkspaceInvitation>;
|
|
37
|
-
rejectInvitation(user: User, invitation: WorkspaceInvitation): Promise<WorkspaceInvitation>;
|
|
38
|
-
hasPermission(member: WorkspaceMember, input: WorkspaceHasPermissionOptions): boolean;
|
|
39
|
-
listRoles(): AuthRole[];
|
|
40
|
-
listPermissions(): string[];
|
|
41
|
-
getMemberPermissions(member: WorkspaceMember): string[];
|
|
42
|
-
private lockActiveWorkspace;
|
|
43
|
-
private normalizeRoles;
|
|
44
|
-
private normalizeAssignableRoles;
|
|
45
|
-
private normalizeGrantedRoles;
|
|
46
|
-
private normalizePermissions;
|
|
47
|
-
private removeNonOwnerMember;
|
|
48
|
-
private get roles();
|
|
49
|
-
private get defaultRole();
|
|
50
|
-
private get creatorRole();
|
|
51
|
-
private get permissions();
|
|
52
|
-
private unwrapWorkspace;
|
|
53
|
-
private unwrapInvitationWorkspace;
|
|
54
|
-
private runUnrestricted;
|
|
55
|
-
private get workspaceEntity();
|
|
56
|
-
private get userEntity();
|
|
57
|
-
private get workspaceMemberEntity();
|
|
58
|
-
private get workspaceInvitationEntity();
|
|
59
|
-
}
|