@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/session.service.js
DELETED
|
@@ -1,165 +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 { EntityManager } from "@mikro-orm/core";
|
|
14
|
-
import { cookies, headers, } from "@nest-boot/request-context";
|
|
15
|
-
import { Inject, Injectable } from "@nestjs/common";
|
|
16
|
-
import { makeSignature } from "better-auth/crypto";
|
|
17
|
-
import { AUTH_TOKEN } from "./auth.constants.js";
|
|
18
|
-
import { MODULE_OPTIONS_TOKEN } from "./auth.module-definition.js";
|
|
19
|
-
import { runAuthQuery } from "./utils/run-auth-query.js";
|
|
20
|
-
let SessionService = class SessionService {
|
|
21
|
-
em;
|
|
22
|
-
options;
|
|
23
|
-
constructor(auth, em, options) {
|
|
24
|
-
this.em = em;
|
|
25
|
-
this.options = options;
|
|
26
|
-
this.auth = auth;
|
|
27
|
-
}
|
|
28
|
-
auth;
|
|
29
|
-
async getSession() {
|
|
30
|
-
const requestHeaders = headers();
|
|
31
|
-
const candidates = [requestHeaders];
|
|
32
|
-
if (requestHeaders.has("cookie") && requestHeaders.has("authorization")) {
|
|
33
|
-
const cookieHeaders = new Headers(requestHeaders);
|
|
34
|
-
cookieHeaders.delete("authorization");
|
|
35
|
-
candidates.unshift(cookieHeaders);
|
|
36
|
-
}
|
|
37
|
-
for (const candidate of candidates) {
|
|
38
|
-
const session = await this.resolveSession(candidate);
|
|
39
|
-
if (session)
|
|
40
|
-
return session;
|
|
41
|
-
}
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
async resolveSession(requestHeaders) {
|
|
45
|
-
const data = await this.auth.api.getSession({ headers: requestHeaders });
|
|
46
|
-
if (!data)
|
|
47
|
-
return null;
|
|
48
|
-
const [user, session] = await this.runUnrestricted(async (em) => await Promise.all([
|
|
49
|
-
em.findOne(this.options.entities.user, { id: data.user.id }),
|
|
50
|
-
em.findOne(this.options.entities.session, {
|
|
51
|
-
token: data.session.token,
|
|
52
|
-
}),
|
|
53
|
-
]));
|
|
54
|
-
if (!user || !session)
|
|
55
|
-
return null;
|
|
56
|
-
if (user.banned &&
|
|
57
|
-
(!user.banExpiresAt || user.banExpiresAt.getTime() > Date.now())) {
|
|
58
|
-
return null;
|
|
59
|
-
}
|
|
60
|
-
return {
|
|
61
|
-
session: session,
|
|
62
|
-
user: user,
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
async listSessions() {
|
|
66
|
-
const data = await this.auth.api.listSessions({ headers: headers() });
|
|
67
|
-
if (data.length === 0)
|
|
68
|
-
return [];
|
|
69
|
-
const sessions = await this.runUnrestricted(async (em) => await em.find(this.options.entities.session, {
|
|
70
|
-
token: { $in: data.map(({ token }) => token) },
|
|
71
|
-
}));
|
|
72
|
-
const sessionsByToken = new Map(sessions.map((session) => [session.token, session]));
|
|
73
|
-
return data.flatMap(({ token }) => {
|
|
74
|
-
const session = sessionsByToken.get(token);
|
|
75
|
-
return session ? [session] : [];
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
async revokeSession(id) {
|
|
79
|
-
const session = (await this.listSessions()).find((candidate) => String(candidate.id) === id);
|
|
80
|
-
if (!session)
|
|
81
|
-
return false;
|
|
82
|
-
const result = await this.auth.api.revokeSession({
|
|
83
|
-
body: { token: session.token },
|
|
84
|
-
headers: headers(),
|
|
85
|
-
});
|
|
86
|
-
return result.status;
|
|
87
|
-
}
|
|
88
|
-
async revokeOtherSessions() {
|
|
89
|
-
const result = await this.auth.api.revokeOtherSessions({
|
|
90
|
-
headers: headers(),
|
|
91
|
-
});
|
|
92
|
-
return result.status;
|
|
93
|
-
}
|
|
94
|
-
async revokeSessions() {
|
|
95
|
-
const result = await this.auth.api.revokeSessions({ headers: headers() });
|
|
96
|
-
return result.status;
|
|
97
|
-
}
|
|
98
|
-
async setSession(sessionToken) {
|
|
99
|
-
const { authCookies, secret } = await this.auth.$context;
|
|
100
|
-
const cookieStore = cookies();
|
|
101
|
-
cookieStore.set(authCookies.sessionToken.name, await createSignedCookieValue(sessionToken, secret), createSessionCookieOptions(authCookies.sessionToken));
|
|
102
|
-
cookieStore.set(authCookies.dontRememberToken.name, await createSignedCookieValue("true", secret), createSessionCookieOptions(authCookies.dontRememberToken));
|
|
103
|
-
expireCookieAndChunks(cookieStore, authCookies.sessionData);
|
|
104
|
-
expireCookieAndChunks(cookieStore, authCookies.accountData);
|
|
105
|
-
}
|
|
106
|
-
async runUnrestricted(callback) {
|
|
107
|
-
return await runAuthQuery(this.em, callback);
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
SessionService = __decorate([
|
|
111
|
-
Injectable(),
|
|
112
|
-
__param(0, Inject(AUTH_TOKEN)),
|
|
113
|
-
__param(2, Inject(MODULE_OPTIONS_TOKEN)),
|
|
114
|
-
__metadata("design:paramtypes", [Object, EntityManager, Object])
|
|
115
|
-
], SessionService);
|
|
116
|
-
export { SessionService };
|
|
117
|
-
async function createSignedCookieValue(value, secret) {
|
|
118
|
-
const signature = await makeSignature(value, secret);
|
|
119
|
-
return `${value}.${signature}`;
|
|
120
|
-
}
|
|
121
|
-
function createSessionCookieOptions(cookie) {
|
|
122
|
-
const options = createCookieOptions(cookie);
|
|
123
|
-
delete options.maxAge;
|
|
124
|
-
return options;
|
|
125
|
-
}
|
|
126
|
-
function createExpiredCookieOptions(cookie) {
|
|
127
|
-
return {
|
|
128
|
-
...createCookieOptions(cookie),
|
|
129
|
-
expires: new Date(0),
|
|
130
|
-
maxAge: 0,
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
function expireCookieAndChunks(cookieStore, cookie) {
|
|
134
|
-
const options = createExpiredCookieOptions(cookie);
|
|
135
|
-
cookieStore.set(cookie.name, "", options);
|
|
136
|
-
for (const { name } of cookieStore.getAll()) {
|
|
137
|
-
if (isCookieChunk(name, cookie.name)) {
|
|
138
|
-
cookieStore.set(name, "", options);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
function isCookieChunk(name, cookieName) {
|
|
143
|
-
const prefix = `${cookieName}.`;
|
|
144
|
-
if (!name.startsWith(prefix))
|
|
145
|
-
return false;
|
|
146
|
-
const suffix = name.slice(prefix.length);
|
|
147
|
-
const index = Number(suffix);
|
|
148
|
-
return Number.isSafeInteger(index) && index >= 0 && String(index) === suffix;
|
|
149
|
-
}
|
|
150
|
-
function createCookieOptions(cookie) {
|
|
151
|
-
const { attributes } = cookie;
|
|
152
|
-
return {
|
|
153
|
-
domain: attributes.domain,
|
|
154
|
-
expires: attributes.expires,
|
|
155
|
-
httpOnly: attributes.httpOnly,
|
|
156
|
-
maxAge: attributes.maxAge,
|
|
157
|
-
partitioned: attributes.partitioned,
|
|
158
|
-
path: attributes.path,
|
|
159
|
-
sameSite: typeof attributes.sameSite === "string"
|
|
160
|
-
? attributes.sameSite.toLowerCase()
|
|
161
|
-
: attributes.sameSite,
|
|
162
|
-
secure: attributes.secure,
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
//# sourceMappingURL=session.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"session.service.js","sourceRoot":"","sources":["../src/session.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAEL,OAAO,EACP,OAAO,GACR,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,OAAO,EAAE,UAAU,EAAE,MAAM,qB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AC,MAAkB;IAC7C,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;IAC9B,OAAO;QACL,MAAM,EAAE,UAAU,CAAC,MAAM;QACzB,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,QAAQ,EAAE,UAAU,CAAC,QAAQ;QAC7B,MAAM,EAAE,UAAU,CAAC,MAAM;QACzB,WAAW,EAAE,UAAU,CAAC,WAAW;QACnC,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,QAAQ,EACN,OAAO,UAAU,CAAC,QAAQ,KAAK,QAAQ;YACrC,CAAC,CAAE,UAAU,CAAC,QAAQ,CAAC,WAAW,EAAgC;YAClE,CAAC,CAAC,UAAU,CAAC,QAAQ;QACzB,MAAM,EAAE,UAAU,CAAC,MAAM;KAC1B,CAAC;AACJ,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { EntityManager } from "@mikro-orm/core";
|
|
2
|
-
import type { AuthModuleOptions } from "./auth-module-options.interface.js";
|
|
3
|
-
import type { BaseUser } from "./entities/index.js";
|
|
4
|
-
export declare class WorkspaceOwnershipConflictError extends Error {
|
|
5
|
-
constructor();
|
|
6
|
-
}
|
|
7
|
-
export declare class UserDeletionService {
|
|
8
|
-
private readonly em;
|
|
9
|
-
private readonly options;
|
|
10
|
-
constructor(em: EntityManager, options: AuthModuleOptions);
|
|
11
|
-
deleteUser(userId: string, beforeDelete?: () => Promise<void>): Promise<BaseUser | null>;
|
|
12
|
-
private ownsActiveWorkspace;
|
|
13
|
-
private runUnrestricted;
|
|
14
|
-
private get accountEntity();
|
|
15
|
-
private get apiKeyEntity();
|
|
16
|
-
private get sessionEntity();
|
|
17
|
-
private get workspaceInvitationEntity();
|
|
18
|
-
private get workspaceMemberEntity();
|
|
19
|
-
}
|
|
@@ -1,96 +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 { EntityManager, LockMode, Reference, } from "@mikro-orm/core";
|
|
14
|
-
import { Inject, Injectable } from "@nestjs/common";
|
|
15
|
-
import { MODULE_OPTIONS_TOKEN } from "./auth.module-definition.js";
|
|
16
|
-
import { runAuthQuery } from "./utils/run-auth-query.js";
|
|
17
|
-
import { DEFAULT_WORKSPACE_CREATOR_ROLE } from "./workspace.constants.js";
|
|
18
|
-
export class WorkspaceOwnershipConflictError extends Error {
|
|
19
|
-
constructor() {
|
|
20
|
-
super("Transfer or delete owned workspaces before deleting the user");
|
|
21
|
-
this.name = WorkspaceOwnershipConflictError.name;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
let UserDeletionService = class UserDeletionService {
|
|
25
|
-
em;
|
|
26
|
-
options;
|
|
27
|
-
constructor(em, options) {
|
|
28
|
-
this.em = em;
|
|
29
|
-
this.options = options;
|
|
30
|
-
}
|
|
31
|
-
async deleteUser(userId, beforeDelete) {
|
|
32
|
-
return await this.runUnrestricted(async (em) => await em.transactional(async (em) => {
|
|
33
|
-
const user = await em.findOne(this.options.entities.user, { id: userId }, { filters: false, lockMode: LockMode.PESSIMISTIC_WRITE });
|
|
34
|
-
if (!user)
|
|
35
|
-
return null;
|
|
36
|
-
const memberships = await em.find(this.options.entities.workspaceMember, { user }, {
|
|
37
|
-
filters: false,
|
|
38
|
-
lockMode: LockMode.PESSIMISTIC_WRITE,
|
|
39
|
-
populate: ["workspace"],
|
|
40
|
-
});
|
|
41
|
-
if (this.ownsActiveWorkspace(memberships)) {
|
|
42
|
-
throw new WorkspaceOwnershipConflictError();
|
|
43
|
-
}
|
|
44
|
-
await beforeDelete?.();
|
|
45
|
-
await em.nativeDelete(this.sessionEntity, {
|
|
46
|
-
$or: [{ userId }, { impersonatedBy: user }],
|
|
47
|
-
});
|
|
48
|
-
await em.nativeDelete(this.accountEntity, {
|
|
49
|
-
userId,
|
|
50
|
-
});
|
|
51
|
-
await em.nativeDelete(this.apiKeyEntity, {
|
|
52
|
-
owner: user,
|
|
53
|
-
});
|
|
54
|
-
await em.nativeDelete(this.workspaceInvitationEntity, {
|
|
55
|
-
inviter: user,
|
|
56
|
-
});
|
|
57
|
-
await em.nativeDelete(this.workspaceMemberEntity, {
|
|
58
|
-
user,
|
|
59
|
-
});
|
|
60
|
-
await em.remove(user).flush();
|
|
61
|
-
return user;
|
|
62
|
-
}));
|
|
63
|
-
}
|
|
64
|
-
ownsActiveWorkspace(memberships) {
|
|
65
|
-
const creatorRole = this.options.workspace?.creatorRole ?? DEFAULT_WORKSPACE_CREATOR_ROLE;
|
|
66
|
-
return memberships.some((member) => {
|
|
67
|
-
const workspace = Reference.unwrapReference(member.workspace);
|
|
68
|
-
return member.roles.includes(creatorRole) && !workspace.deletedAt;
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
async runUnrestricted(callback) {
|
|
72
|
-
return await runAuthQuery(this.em, callback);
|
|
73
|
-
}
|
|
74
|
-
get accountEntity() {
|
|
75
|
-
return this.options.entities.account;
|
|
76
|
-
}
|
|
77
|
-
get apiKeyEntity() {
|
|
78
|
-
return this.options.entities.apiKey;
|
|
79
|
-
}
|
|
80
|
-
get sessionEntity() {
|
|
81
|
-
return this.options.entities.session;
|
|
82
|
-
}
|
|
83
|
-
get workspaceInvitationEntity() {
|
|
84
|
-
return this.options.entities.workspaceInvitation;
|
|
85
|
-
}
|
|
86
|
-
get workspaceMemberEntity() {
|
|
87
|
-
return this.options.entities.workspaceMember;
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
UserDeletionService = __decorate([
|
|
91
|
-
Injectable(),
|
|
92
|
-
__param(1, Inject(MODULE_OPTIONS_TOKEN)),
|
|
93
|
-
__metadata("design:paramtypes", [EntityManager, Object])
|
|
94
|
-
], UserDeletionService);
|
|
95
|
-
export { UserDeletionService };
|
|
96
|
-
//# sourceMappingURL=user-deletion.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user-deletion.service.js","sourceRoot":"","sources":["../src/user-deletion.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAEL,aAAa,EAEb,QAAQ,EACR,SAAS,GACV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAWnE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAG1E,MAAM,OAAO,+BAAgC,SAAQ,KAAK;IAExD;QACE,KAAK,CAAC,8DAA8D,CAAC,CAAC;QACtE,IAAI,CAAC,IAAI,GAAG,+BAA+B,CAAC,IAAI,CAAC;IACnD,CAAC;CACF;AAIM,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAGX;IAEA;IAHnB,YACmB,EAAiB,EAEjB,OAA0B;QAF1B,OAAE,GAAF,EAAE,CAAe;QAEjB,YAAO,GAAP,OAAO,CAAmB;IAC1C,CAAC;IAGJ,KAAK,CAAC,UAAU,CACd,MAAc,EACd,YAAkC;QAElC,OAAO,MAAM,IAAI,C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CACF,CAAA;AAjGY,mBAAmB;IAD/B,UAAU,EAAE;IAKR,WAAA,MAAM,CAAC,oBAAoB,CAAC,CAAA;qCADR,aAAa;GAHzB,mBAAmB,CAiG/B"}
|
package/dist/user.service.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { EntityManager } from "@mikro-orm/core";
|
|
2
|
-
import { HashService } from "@nest-boot/hash";
|
|
3
|
-
import { AccessControlService } from "./access-control.service.js";
|
|
4
|
-
import type { AuthModuleOptions } from "./auth-module-options.interface.js";
|
|
5
|
-
import type { BaseAccount, BaseSession, BaseUser } from "./entities/index.js";
|
|
6
|
-
import type { AuthRole } from "./interfaces/auth-role.interface.js";
|
|
7
|
-
import type { AuthenticatedSession } from "./interfaces/session-service.interface.js";
|
|
8
|
-
import type { BanUserOptions, CreateUserOptions, ImpersonationOptions, ListUsersOptions, ListUsersResult, UpdateUserOptions, UserHasPermissionOptions } from "./interfaces/user-service.interface.js";
|
|
9
|
-
export declare class UserService<User extends BaseUser = BaseUser, Account extends BaseAccount = BaseAccount, Session extends BaseSession = BaseSession> {
|
|
10
|
-
private readonly em;
|
|
11
|
-
private readonly options;
|
|
12
|
-
private readonly hashService;
|
|
13
|
-
private readonly accessControlService;
|
|
14
|
-
private readonly userDeletionService;
|
|
15
|
-
constructor(em: EntityManager, options: AuthModuleOptions, hashService: HashService, accessControlService: AccessControlService, userDeletionService: {
|
|
16
|
-
deleteUser(userId: string): Promise<BaseUser | null>;
|
|
17
|
-
});
|
|
18
|
-
createUser(input: CreateUserOptions): Promise<User>;
|
|
19
|
-
getUser(userId: string): Promise<User | null>;
|
|
20
|
-
getUserByEmail(email: string): Promise<User | null>;
|
|
21
|
-
updateUser(user: User, input: UpdateUserOptions): Promise<User>;
|
|
22
|
-
setUserPermissions(user: User, permissions: string[]): Promise<User>;
|
|
23
|
-
setRole(user: User, role: string | readonly string[]): Promise<User>;
|
|
24
|
-
listRoles(): AuthRole[];
|
|
25
|
-
listPermissions(): string[];
|
|
26
|
-
getUserPermissions(user: User): string[];
|
|
27
|
-
listUsers(input?: ListUsersOptions): Promise<ListUsersResult<User>>;
|
|
28
|
-
listUserSessions(user: User): Promise<Session[]>;
|
|
29
|
-
banUser(user: User, input?: BanUserOptions): Promise<User>;
|
|
30
|
-
unbanUser(user: User): Promise<User>;
|
|
31
|
-
impersonateUser(administrator: User, user: User, input?: ImpersonationOptions): Promise<AuthenticatedSession<User, Session>>;
|
|
32
|
-
stopImpersonating(currentSession: Session, input?: ImpersonationOptions): Promise<AuthenticatedSession<User, Session> | null>;
|
|
33
|
-
revokeUserSession(user: User, sessionId: string): Promise<boolean>;
|
|
34
|
-
revokeUserSessions(user: User): Promise<number>;
|
|
35
|
-
removeUser(user: User): Promise<User>;
|
|
36
|
-
setUserPassword(user: User, newPassword: string): Promise<void>;
|
|
37
|
-
hasPermission(user: User, input: UserHasPermissionOptions): boolean;
|
|
38
|
-
isAdmin(user: User): boolean;
|
|
39
|
-
private normalizeRoles;
|
|
40
|
-
private normalizePermissions;
|
|
41
|
-
private createUserUpdateData;
|
|
42
|
-
private get roles();
|
|
43
|
-
private get defaultRole();
|
|
44
|
-
private get permissions();
|
|
45
|
-
private createSession;
|
|
46
|
-
private createUserFilter;
|
|
47
|
-
private hashPassword;
|
|
48
|
-
private assertPasswordLength;
|
|
49
|
-
private isActivelyBanned;
|
|
50
|
-
private runUnrestricted;
|
|
51
|
-
private get accountEntity();
|
|
52
|
-
private get sessionEntity();
|
|
53
|
-
private get userEntity();
|
|
54
|
-
}
|