@nest-boot/auth 8.0.3-beta.0 → 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/create-custom-adapter.js +13 -22
- package/dist/adapters/mikro-orm/create-custom-adapter.js.map +1 -1
- 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 +5 -3
- 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 +21 -6
- package/dist/auth.middleware.js +124 -36
- 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 +184 -12
- package/dist/index.js +183 -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 +14 -0
- package/dist/interfaces/scope-policy-options.interface.js +2 -0
- package/dist/interfaces/scope-policy-options.interface.js.map +1 -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 +4 -0
- package/dist/policies/create-scope-policy.js +38 -0
- package/dist/policies/create-scope-policy.js.map +1 -0
- package/dist/policies/index.d.ts +2 -0
- package/dist/policies/index.js +3 -0
- package/dist/policies/index.js.map +1 -0
- package/dist/policies/user-scope.policy.d.ts +11 -0
- package/dist/policies/user-scope.policy.js +13 -0
- package/dist/policies/user-scope.policy.js.map +1 -0
- package/dist/policies/workspace-scope.policy.d.ts +11 -0
- package/dist/policies/workspace-scope.policy.js +13 -0
- package/dist/policies/workspace-scope.policy.js.map +1 -0
- 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 +6 -0
- package/dist/utils/run-auth-query.js +51 -0
- package/dist/utils/run-auth-query.js.map +1 -0
- 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 +41 -19
- 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 -336
- 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 -171
- package/dist/session.service.js.map +0 -1
- package/dist/user-deletion.service.d.ts +0 -19
- package/dist/user-deletion.service.js +0 -103
- package/dist/user-deletion.service.js.map +0 -1
- package/dist/user.service.d.ts +0 -54
- package/dist/user.service.js +0 -386
- package/dist/user.service.js.map +0 -1
- package/dist/workspace.service.d.ts +0 -59
- package/dist/workspace.service.js +0 -611
- package/dist/workspace.service.js.map +0 -1
|
@@ -0,0 +1,386 @@
|
|
|
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, UniqueConstraintViolationException, } from "@mikro-orm/core";
|
|
14
|
+
import { ConnectionManager, } from "@nest-boot/graphql-connection";
|
|
15
|
+
import { RequestContext } from "@nest-boot/request-context";
|
|
16
|
+
import { BadRequestException, ConflictException, ForbiddenException, Inject, Injectable, NotFoundException, } from "@nestjs/common";
|
|
17
|
+
import { MODULE_OPTIONS_TOKEN } from "../auth.module-definition.js";
|
|
18
|
+
import { InvitationConnection } from "../connections/invitation.connection-definition.js";
|
|
19
|
+
import { Invitation } from "../entities/invitation.entity.js";
|
|
20
|
+
import { Member } from "../entities/member.entity.js";
|
|
21
|
+
import { User } from "../entities/user.entity.js";
|
|
22
|
+
import { Workspace } from "../entities/workspace.entity.js";
|
|
23
|
+
import { normalizeAuthRoles, resolveAuthPermissions, } from "../utils/auth-role.util.js";
|
|
24
|
+
import { resolveAuthCatalog } from "../utils/resolve-auth-catalog.util.js";
|
|
25
|
+
import { DEFAULT_WORKSPACE_ROLE } from "../workspace.constants.js";
|
|
26
|
+
import { AccessControlService } from "./access-control.service.js";
|
|
27
|
+
/** Workspace invitation queries and lifecycle operations. */
|
|
28
|
+
let InvitationService = class InvitationService {
|
|
29
|
+
em;
|
|
30
|
+
authOptions;
|
|
31
|
+
accessControlService;
|
|
32
|
+
/** Creates a workspace invitation domain service. */
|
|
33
|
+
constructor(
|
|
34
|
+
/** MikroORM entity manager used for workspace persistence. */
|
|
35
|
+
em, authOptions, accessControlService) {
|
|
36
|
+
this.em = em;
|
|
37
|
+
this.authOptions = authOptions;
|
|
38
|
+
this.accessControlService = accessControlService;
|
|
39
|
+
}
|
|
40
|
+
/** Creates a pending workspace invitation. */
|
|
41
|
+
async createInvitation(workspace, inviter, input, request) {
|
|
42
|
+
this.accessControlService.assertCurrentWorkspace(workspace);
|
|
43
|
+
this.accessControlService.assertCurrentUser(inviter);
|
|
44
|
+
this.accessControlService.assertWorkspaceCan("create", Invitation);
|
|
45
|
+
const email = input.email.trim().toLowerCase();
|
|
46
|
+
const roles = this.normalizeGrantedRoles(input.roles ?? [this.defaultRole]);
|
|
47
|
+
const expiresIn = input.expiresIn ?? 60 * 60 * 48;
|
|
48
|
+
if (!Number.isSafeInteger(expiresIn) || expiresIn <= 0) {
|
|
49
|
+
throw new BadRequestException("Workspace invitation lifetime must be a positive integer");
|
|
50
|
+
}
|
|
51
|
+
const sendInvitationEmail = this.authOptions.workspace?.sendInvitationEmail;
|
|
52
|
+
if (sendInvitationEmail && this.em.isInTransaction()) {
|
|
53
|
+
throw new BadRequestException("Create invitations with email delivery outside an active transaction");
|
|
54
|
+
}
|
|
55
|
+
let transactionResult;
|
|
56
|
+
try {
|
|
57
|
+
transactionResult = await this.em.transactional(async (em) => {
|
|
58
|
+
await this.lockWorkspace(em, workspace);
|
|
59
|
+
const now = new Date();
|
|
60
|
+
const userId = await this.getUserIdForInvitation(workspace, inviter, email);
|
|
61
|
+
const [member, invitation, inviterMember] = await Promise.all([
|
|
62
|
+
userId
|
|
63
|
+
? em.findOne(Member, { workspace, user: userId }, { filters: false })
|
|
64
|
+
: Promise.resolve(null),
|
|
65
|
+
em.findOne(Invitation, {
|
|
66
|
+
email,
|
|
67
|
+
status: "pending",
|
|
68
|
+
workspace,
|
|
69
|
+
}, { filters: false }),
|
|
70
|
+
sendInvitationEmail
|
|
71
|
+
? em.findOne(Member, {
|
|
72
|
+
status: "ACTIVE",
|
|
73
|
+
user: inviter,
|
|
74
|
+
workspace,
|
|
75
|
+
}, { filters: false })
|
|
76
|
+
: Promise.resolve(null),
|
|
77
|
+
]);
|
|
78
|
+
if (member) {
|
|
79
|
+
throw new ConflictException("User is already a member");
|
|
80
|
+
}
|
|
81
|
+
if (invitation && invitation.expiresAt.getTime() > now.getTime()) {
|
|
82
|
+
throw new ConflictException("User is already invited to this workspace");
|
|
83
|
+
}
|
|
84
|
+
if (sendInvitationEmail && !inviterMember) {
|
|
85
|
+
throw new ForbiddenException("Invitation sender is not an active workspace member");
|
|
86
|
+
}
|
|
87
|
+
if (invitation) {
|
|
88
|
+
invitation.status = "canceled";
|
|
89
|
+
await em.flush();
|
|
90
|
+
}
|
|
91
|
+
const created = em.create(Invitation, {
|
|
92
|
+
email,
|
|
93
|
+
expiresAt: new Date(now.getTime() + expiresIn * 1000),
|
|
94
|
+
inviter,
|
|
95
|
+
roles,
|
|
96
|
+
status: "pending",
|
|
97
|
+
workspace,
|
|
98
|
+
});
|
|
99
|
+
this.accessControlService.assertWorkspaceCan("create", created);
|
|
100
|
+
await em.persist(created).flush();
|
|
101
|
+
return { created, inviterMember };
|
|
102
|
+
}, { clear: true });
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
if (error instanceof UniqueConstraintViolationException) {
|
|
106
|
+
throw new ConflictException("User is already invited to this workspace");
|
|
107
|
+
}
|
|
108
|
+
throw error;
|
|
109
|
+
}
|
|
110
|
+
const { created, inviterMember } = transactionResult;
|
|
111
|
+
if (sendInvitationEmail && inviterMember) {
|
|
112
|
+
const callbackInviter = Object.assign(Object.create(Object.getPrototypeOf(inviterMember)), inviterMember, { user: inviter });
|
|
113
|
+
try {
|
|
114
|
+
await sendInvitationEmail({
|
|
115
|
+
email,
|
|
116
|
+
id: created.id,
|
|
117
|
+
invitation: created,
|
|
118
|
+
inviter: callbackInviter,
|
|
119
|
+
roles: [...created.roles],
|
|
120
|
+
workspace,
|
|
121
|
+
}, request);
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
await this.em.nativeUpdate(Invitation, {
|
|
125
|
+
id: created.id,
|
|
126
|
+
status: "pending",
|
|
127
|
+
}, { status: "canceled" });
|
|
128
|
+
throw error;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return created;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Resolves only the login identity needed for invitation membership checks.
|
|
135
|
+
* Infrastructure isolates this lookup; invitation writes retain request RLS.
|
|
136
|
+
* An unregistered email is a valid invitation recipient.
|
|
137
|
+
* @internal
|
|
138
|
+
*/
|
|
139
|
+
async getUserIdForInvitation(workspace, inviter, email) {
|
|
140
|
+
this.accessControlService.assertCurrentWorkspace(workspace);
|
|
141
|
+
this.accessControlService.assertCurrentUser(inviter);
|
|
142
|
+
this.accessControlService.assertWorkspaceCan("create", Invitation);
|
|
143
|
+
const user = await this.em.findOne(User, { email: email.trim().toLowerCase() }, { fields: ["id"], filters: false });
|
|
144
|
+
return user ? String(user.id) : null;
|
|
145
|
+
}
|
|
146
|
+
/** Finds an invitation after recipient or workspace authorization, preserving RLS. */
|
|
147
|
+
async getInvitation(id) {
|
|
148
|
+
if (!this.accessControlService.userCan("read", Invitation) &&
|
|
149
|
+
!this.accessControlService.workspaceCan("read", Invitation)) {
|
|
150
|
+
throw new ForbiddenException("Invitation read access denied");
|
|
151
|
+
}
|
|
152
|
+
const invitation = await this.em.findOne(Invitation, { id }, { refresh: true });
|
|
153
|
+
if (invitation)
|
|
154
|
+
this.assertInvitationReadAccess(invitation);
|
|
155
|
+
return invitation;
|
|
156
|
+
}
|
|
157
|
+
/** Resolves the inviter through an authorized invitation without bypassing RLS. */
|
|
158
|
+
async getInvitationInviter(invitation) {
|
|
159
|
+
const current = await this.getInvitationForRelation(invitation);
|
|
160
|
+
const actor = RequestContext.isActive() ? RequestContext.get(User) : null;
|
|
161
|
+
const self = actor?.id === current.inviter.id;
|
|
162
|
+
if (!self)
|
|
163
|
+
this.accessControlService.assertUserCan("read", User);
|
|
164
|
+
const user = await this.em.findOne(User, { id: current.inviter.id }, { refresh: true });
|
|
165
|
+
if (!user)
|
|
166
|
+
throw new NotFoundException("Invitation inviter not found");
|
|
167
|
+
if (!self)
|
|
168
|
+
this.accessControlService.assertUserCan("read", user);
|
|
169
|
+
return user;
|
|
170
|
+
}
|
|
171
|
+
/** Resolves the workspace through an authorized invitation without requiring membership. */
|
|
172
|
+
async getInvitationWorkspace(invitation) {
|
|
173
|
+
const current = await this.getInvitationForRelation(invitation);
|
|
174
|
+
const workspace = await this.em.findOne(Workspace, { id: current.workspace.id }, { refresh: true });
|
|
175
|
+
if (!workspace)
|
|
176
|
+
throw new NotFoundException("Invitation workspace not found");
|
|
177
|
+
return workspace;
|
|
178
|
+
}
|
|
179
|
+
async getInvitationForRelation(invitation) {
|
|
180
|
+
this.assertInvitationReadAccess(invitation);
|
|
181
|
+
// Re-read through this manager: a mutation may return entities/references
|
|
182
|
+
// hydrated by the isolated authentication context, or an older identity.
|
|
183
|
+
const current = await this.em.findOne(Invitation, { id: invitation.id }, { refresh: true });
|
|
184
|
+
if (!current)
|
|
185
|
+
throw new NotFoundException("Workspace invitation not found");
|
|
186
|
+
this.assertInvitationReadAccess(current);
|
|
187
|
+
return current;
|
|
188
|
+
}
|
|
189
|
+
assertInvitationReadAccess(invitation) {
|
|
190
|
+
const user = RequestContext.isActive() ? RequestContext.get(User) : null;
|
|
191
|
+
if (invitation.email.toLowerCase() === user?.email?.toLowerCase() &&
|
|
192
|
+
this.accessControlService.userCan("read", invitation)) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
this.accessControlService.assertCurrentWorkspace(this.unwrapInvitationWorkspace(invitation));
|
|
196
|
+
this.accessControlService.assertWorkspaceCan("read", invitation);
|
|
197
|
+
}
|
|
198
|
+
/** Finds an invitation when it is addressed to the supplied user. */
|
|
199
|
+
async getInvitationByUser(id, user) {
|
|
200
|
+
this.accessControlService.assertCurrentUser(user);
|
|
201
|
+
this.accessControlService.assertUserCan("read", Invitation);
|
|
202
|
+
const invitation = await this.em.findOne(Invitation, {
|
|
203
|
+
id,
|
|
204
|
+
email: user.email.toLowerCase(),
|
|
205
|
+
});
|
|
206
|
+
if (invitation)
|
|
207
|
+
this.accessControlService.assertUserCan("read", invitation);
|
|
208
|
+
return invitation;
|
|
209
|
+
}
|
|
210
|
+
/** Finds an invitation owned by the supplied workspace. */
|
|
211
|
+
async getInvitationByWorkspace(id, workspace) {
|
|
212
|
+
this.accessControlService.assertCurrentWorkspace(workspace);
|
|
213
|
+
this.accessControlService.assertWorkspaceCan("read", Invitation);
|
|
214
|
+
const invitation = await this.em.findOne(Invitation, {
|
|
215
|
+
id,
|
|
216
|
+
workspace,
|
|
217
|
+
});
|
|
218
|
+
if (invitation)
|
|
219
|
+
this.accessControlService.assertWorkspaceCan("read", invitation);
|
|
220
|
+
return invitation;
|
|
221
|
+
}
|
|
222
|
+
/** Paginates invitations for the selected workspace after authorization. */
|
|
223
|
+
async getInvitationConnectionByWorkspace(workspace, args) {
|
|
224
|
+
this.accessControlService.assertCurrentWorkspace(workspace);
|
|
225
|
+
this.accessControlService.assertWorkspaceCan("read", Invitation);
|
|
226
|
+
const connection = await new ConnectionManager(this.em).find(InvitationConnection, args, {
|
|
227
|
+
where: { workspace },
|
|
228
|
+
});
|
|
229
|
+
for (const { node } of connection.edges) {
|
|
230
|
+
this.accessControlService.assertWorkspaceCan("read", node);
|
|
231
|
+
}
|
|
232
|
+
return connection;
|
|
233
|
+
}
|
|
234
|
+
/** Paginates unexpired pending invitations addressed to the current user. */
|
|
235
|
+
async getInvitationConnectionByUser(user, args) {
|
|
236
|
+
this.accessControlService.assertCurrentUser(user);
|
|
237
|
+
this.accessControlService.assertUserCan("read", Invitation);
|
|
238
|
+
const now = new Date();
|
|
239
|
+
const connection = await new ConnectionManager(this.em).find(InvitationConnection, args, {
|
|
240
|
+
where: {
|
|
241
|
+
email: user.email.toLowerCase(),
|
|
242
|
+
expiresAt: { $gt: now },
|
|
243
|
+
status: "pending",
|
|
244
|
+
},
|
|
245
|
+
});
|
|
246
|
+
for (const { node } of connection.edges) {
|
|
247
|
+
this.accessControlService.assertUserCan("read", node);
|
|
248
|
+
}
|
|
249
|
+
return connection;
|
|
250
|
+
}
|
|
251
|
+
/** Accepts a pending invitation and creates an active membership. */
|
|
252
|
+
async acceptInvitation(user, invitationId) {
|
|
253
|
+
this.accessControlService.assertCurrentUser(user);
|
|
254
|
+
this.accessControlService.assertUserCan("update", Invitation);
|
|
255
|
+
return await this.em.transactional(async (em) => {
|
|
256
|
+
const invitation = await em.findOne(Invitation, { id: invitationId }, {
|
|
257
|
+
filters: false,
|
|
258
|
+
populate: ["workspace"],
|
|
259
|
+
});
|
|
260
|
+
if (!invitation)
|
|
261
|
+
return null;
|
|
262
|
+
if (invitation.email.toLowerCase() !== user.email.toLowerCase()) {
|
|
263
|
+
throw new ForbiddenException("Workspace invitation belongs to another email address");
|
|
264
|
+
}
|
|
265
|
+
// All membership/invitation creation takes the workspace lock first.
|
|
266
|
+
// Refresh the invitation only afterwards so direct addition and deletion
|
|
267
|
+
// cannot race acceptance or acquire these locks in the opposite order.
|
|
268
|
+
const workspace = this.unwrapInvitationWorkspace(invitation);
|
|
269
|
+
await this.lockWorkspace(em, workspace);
|
|
270
|
+
await em.refreshOrFail(invitation, {
|
|
271
|
+
filters: false,
|
|
272
|
+
lockMode: LockMode.PESSIMISTIC_WRITE,
|
|
273
|
+
populate: [],
|
|
274
|
+
});
|
|
275
|
+
this.accessControlService.assertUserCan("update", invitation);
|
|
276
|
+
if (invitation.status !== "pending") {
|
|
277
|
+
throw new BadRequestException("Workspace invitation is not pending");
|
|
278
|
+
}
|
|
279
|
+
if (invitation.expiresAt.getTime() <= Date.now()) {
|
|
280
|
+
throw new BadRequestException("Workspace invitation has expired");
|
|
281
|
+
}
|
|
282
|
+
if (invitation.email.toLowerCase() !== user.email.toLowerCase()) {
|
|
283
|
+
throw new ForbiddenException("Workspace invitation belongs to another email address");
|
|
284
|
+
}
|
|
285
|
+
const existing = await em.findOne(Member, { user, workspace }, { filters: false });
|
|
286
|
+
if (existing)
|
|
287
|
+
throw new ConflictException("User is already a member");
|
|
288
|
+
const member = em.create(Member, {
|
|
289
|
+
name: user.name,
|
|
290
|
+
email: user.email.trim().toLowerCase(),
|
|
291
|
+
permissions: [],
|
|
292
|
+
roles: this.normalizeRoles(invitation.roles),
|
|
293
|
+
status: "ACTIVE",
|
|
294
|
+
user,
|
|
295
|
+
workspace,
|
|
296
|
+
});
|
|
297
|
+
invitation.status = "accepted";
|
|
298
|
+
await em.persist(member).flush();
|
|
299
|
+
return { invitation, member };
|
|
300
|
+
}, { clear: true });
|
|
301
|
+
}
|
|
302
|
+
/** Cancels a pending invitation. */
|
|
303
|
+
async cancelInvitation(invitation) {
|
|
304
|
+
this.accessControlService.assertWorkspaceCan("cancel", Invitation);
|
|
305
|
+
invitation = await this.resolveInvitationForAction(invitation);
|
|
306
|
+
const workspace = this.unwrapInvitationWorkspace(invitation);
|
|
307
|
+
this.accessControlService.assertCurrentWorkspace(workspace);
|
|
308
|
+
this.accessControlService.assertWorkspaceCan("cancel", invitation);
|
|
309
|
+
if (invitation.status !== "pending") {
|
|
310
|
+
throw new BadRequestException("Workspace invitation is not pending");
|
|
311
|
+
}
|
|
312
|
+
const updated = await this.em.nativeUpdate(Invitation, {
|
|
313
|
+
id: invitation.id,
|
|
314
|
+
status: "pending",
|
|
315
|
+
workspace,
|
|
316
|
+
}, { status: "canceled" });
|
|
317
|
+
if (updated !== 1) {
|
|
318
|
+
throw new BadRequestException("Workspace invitation is not pending");
|
|
319
|
+
}
|
|
320
|
+
invitation.status = "canceled";
|
|
321
|
+
return invitation;
|
|
322
|
+
}
|
|
323
|
+
/** Rejects an invitation after verifying the invited user's email. */
|
|
324
|
+
async rejectInvitation(user, invitation) {
|
|
325
|
+
this.accessControlService.assertCurrentUser(user);
|
|
326
|
+
this.accessControlService.assertUserCan("update", Invitation);
|
|
327
|
+
invitation = await this.resolveInvitationForAction(invitation);
|
|
328
|
+
this.accessControlService.assertUserCan("update", invitation);
|
|
329
|
+
if (invitation.status !== "pending") {
|
|
330
|
+
throw new BadRequestException("Workspace invitation is not pending");
|
|
331
|
+
}
|
|
332
|
+
if (invitation.email.toLowerCase() !== user.email.toLowerCase()) {
|
|
333
|
+
throw new ForbiddenException("Workspace invitation belongs to another email address");
|
|
334
|
+
}
|
|
335
|
+
const updated = await this.em.nativeUpdate(Invitation, {
|
|
336
|
+
email: user.email.trim().toLowerCase(),
|
|
337
|
+
id: invitation.id,
|
|
338
|
+
status: "pending",
|
|
339
|
+
}, { status: "rejected" });
|
|
340
|
+
if (updated !== 1) {
|
|
341
|
+
throw new BadRequestException("Workspace invitation is not pending");
|
|
342
|
+
}
|
|
343
|
+
invitation.status = "rejected";
|
|
344
|
+
return invitation;
|
|
345
|
+
}
|
|
346
|
+
async resolveInvitationForAction(invitation) {
|
|
347
|
+
if (typeof invitation !== "string")
|
|
348
|
+
return invitation;
|
|
349
|
+
const entity = await this.em.findOne(Invitation, { id: invitation }, { populate: ["workspace"], refresh: true });
|
|
350
|
+
if (!entity)
|
|
351
|
+
throw new NotFoundException("Workspace invitation not found");
|
|
352
|
+
return entity;
|
|
353
|
+
}
|
|
354
|
+
async lockWorkspace(em, workspace) {
|
|
355
|
+
await em.refreshOrFail(workspace, {
|
|
356
|
+
filters: false,
|
|
357
|
+
lockMode: LockMode.PESSIMISTIC_WRITE,
|
|
358
|
+
populate: [],
|
|
359
|
+
failHandler: () => new NotFoundException("Workspace not found"),
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
normalizeRoles(role) {
|
|
363
|
+
return normalizeAuthRoles(role, this.roles);
|
|
364
|
+
}
|
|
365
|
+
normalizeGrantedRoles(role) {
|
|
366
|
+
const roles = this.normalizeRoles(role);
|
|
367
|
+
this.accessControlService.assertCanGrantWorkspacePermissions(resolveAuthPermissions(roles, [], this.roles));
|
|
368
|
+
return roles;
|
|
369
|
+
}
|
|
370
|
+
get roles() {
|
|
371
|
+
return resolveAuthCatalog(this.authOptions, "workspace").roles;
|
|
372
|
+
}
|
|
373
|
+
get defaultRole() {
|
|
374
|
+
return this.authOptions.workspace?.defaultRole ?? DEFAULT_WORKSPACE_ROLE;
|
|
375
|
+
}
|
|
376
|
+
unwrapInvitationWorkspace(invitation) {
|
|
377
|
+
return Reference.unwrapReference(invitation.workspace);
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
InvitationService = __decorate([
|
|
381
|
+
Injectable(),
|
|
382
|
+
__param(1, Inject(MODULE_OPTIONS_TOKEN)),
|
|
383
|
+
__metadata("design:paramtypes", [EntityManager, Object, AccessControlService])
|
|
384
|
+
], InvitationService);
|
|
385
|
+
export { InvitationService };
|
|
386
|
+
//# sourceMappingURL=invitation.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invitation.service.js","sourceRoot":"","sources":["../../src/services/invitation.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EACL,aAAa,EAEb,QAAQ,EACR,SAAS,EAET,kCAAkC,GACnC,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAGL,iBAAiB,GAClB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,MAAM,EACN,UAAU,EACV,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,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AAC,SAAS,EAAE,WAAW,IAAI,sBAAsB,CAAC;IAC3E,CAAC;IAEO,yBAAyB,CAAC,UAAsB;QACtD,OAAO,SAAS,CAAC,eAAe,CAC9B,UAAU,CAAC,SAAS,CACG,CAAC;IAC5B,CAAC;CACF,CAAA;AA1fY,iBAAiB;IAD7B,UAAU,EAAE;IAMR,WAAA,MAAM,CAAC,oBAAoB,CAAC,CAAA;qCADN,aAAa,UAGG,oBAAoB;GAPlD,iBAAiB,CA0f7B"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { EntityManager, type FilterQuery } from "@mikro-orm/core";
|
|
2
|
+
import { type ConnectionArgsInterface, type ConnectionInterface } from "@nest-boot/graphql-connection";
|
|
3
|
+
import type { AuthModuleOptions } from "../auth-module-options.interface.js";
|
|
4
|
+
import { Member } from "../entities/member.entity.js";
|
|
5
|
+
import { User } from "../entities/user.entity.js";
|
|
6
|
+
import { Workspace } from "../entities/workspace.entity.js";
|
|
7
|
+
import type { AddMemberOptions } from "../interfaces/add-member-options.interface.js";
|
|
8
|
+
import type { UpdateMemberOptions } from "../interfaces/update-member-options.interface.js";
|
|
9
|
+
import type { WorkspaceHasPermissionsOptions } from "../interfaces/workspace-has-permissions-options.interface.js";
|
|
10
|
+
import type { WorkspacePermissionOption } from "../objects/workspace-permission-option.object.js";
|
|
11
|
+
import type { WorkspaceRoleOption } from "../objects/workspace-role-option.object.js";
|
|
12
|
+
import { AccessControlService } from "./access-control.service.js";
|
|
13
|
+
/** Workspace membership queries, profile management, and authorization. */
|
|
14
|
+
export declare class MemberService {
|
|
15
|
+
/** MikroORM entity manager used for workspace persistence. */
|
|
16
|
+
protected readonly em: EntityManager;
|
|
17
|
+
private readonly authOptions;
|
|
18
|
+
private readonly accessControlService;
|
|
19
|
+
/** Creates a workspace member domain service. */
|
|
20
|
+
constructor(
|
|
21
|
+
/** MikroORM entity manager used for workspace persistence. */
|
|
22
|
+
em: EntityManager, authOptions: AuthModuleOptions, accessControlService: AccessControlService);
|
|
23
|
+
/** Returns the current member after membership and instance read checks. */
|
|
24
|
+
getCurrentMember(): Member | null;
|
|
25
|
+
/** Authorizes member pagination and scopes it to the selected workspace. */
|
|
26
|
+
getMemberListFilter(workspace: Workspace): FilterQuery<Member>;
|
|
27
|
+
/** Paginates members within the selected workspace and its RLS scope. */
|
|
28
|
+
getMemberConnectionByWorkspace(workspace: Workspace, args: ConnectionArgsInterface<Member>): Promise<ConnectionInterface<Member>>;
|
|
29
|
+
/** Finds the active membership linking a user and workspace. */
|
|
30
|
+
getMemberByUser(workspace: Workspace, user: User): Promise<Member | null>;
|
|
31
|
+
/** Finds a member by identifier within the request's selected workspace. */
|
|
32
|
+
getMember(id: string): Promise<Member | null>;
|
|
33
|
+
/** Resolves a member's user with workspace authorization and request RLS. */
|
|
34
|
+
getMemberUser(member: Member): Promise<User | null>;
|
|
35
|
+
/** Adds an existing user to a workspace. */
|
|
36
|
+
addMember(workspace: Workspace, user: User, input?: AddMemberOptions): Promise<Member>;
|
|
37
|
+
/** Adds an existing user to a workspace by normalized email address. */
|
|
38
|
+
addMemberByEmail(workspace: Workspace, email: string, input?: AddMemberOptions): Promise<Member>;
|
|
39
|
+
/**
|
|
40
|
+
* Looks up a user for explicitly authorized membership creation.
|
|
41
|
+
* Infrastructure isolates this lookup; membership writes retain request RLS.
|
|
42
|
+
* @internal
|
|
43
|
+
*/
|
|
44
|
+
getUserForMembership(workspace: Workspace, email: string): Promise<User>;
|
|
45
|
+
private resolveMemberForAction;
|
|
46
|
+
/** Updates workspace-visible member profile fields and active state. */
|
|
47
|
+
updateMember(member: Member | string, input: UpdateMemberOptions): Promise<Member>;
|
|
48
|
+
/** Replaces a workspace member's roles within the caller's permission scope. */
|
|
49
|
+
setMemberRoles(member: Member | string, roleNames: string | readonly string[]): Promise<Member>;
|
|
50
|
+
/** Replaces direct permissions assigned to a workspace member. */
|
|
51
|
+
setMemberPermissions(member: Member | string, permissions: readonly string[]): Promise<Member>;
|
|
52
|
+
private assertAuthorizationCanCommit;
|
|
53
|
+
private isCurrentMember;
|
|
54
|
+
/** Removes a member after checking delete ability; self-removal uses leaveWorkspace. */
|
|
55
|
+
removeMember(member: Member | string): Promise<Member>;
|
|
56
|
+
/** Lets the current member leave its workspace regardless of role. */
|
|
57
|
+
leaveWorkspace(member: Member): Promise<Member>;
|
|
58
|
+
/** Checks flattened `subject:action` values against member permissions. */
|
|
59
|
+
hasPermissions(member: Member, input: WorkspaceHasPermissionsOptions): boolean;
|
|
60
|
+
/** Lists all roles with grant availability; mutations still authorize their targets. */
|
|
61
|
+
listRoles(): WorkspaceRoleOption[];
|
|
62
|
+
/** Lists all direct-permission options without authorizing a particular member. */
|
|
63
|
+
listPermissions(): WorkspacePermissionOption[];
|
|
64
|
+
/** Resolves permissions inherited from roles plus direct member permissions. */
|
|
65
|
+
getEffectiveMemberPermissions(member: Member): string[];
|
|
66
|
+
private lockWorkspace;
|
|
67
|
+
private normalizeRoles;
|
|
68
|
+
private normalizeGrantedRoles;
|
|
69
|
+
private normalizePermissions;
|
|
70
|
+
private removeMemberRecord;
|
|
71
|
+
private get roles();
|
|
72
|
+
private get defaultRole();
|
|
73
|
+
private get permissions();
|
|
74
|
+
private unwrapWorkspace;
|
|
75
|
+
}
|