@nest-boot/auth 8.0.3-beta.1 → 8.0.4-beta.0
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
|
@@ -1,618 +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, UniqueConstraintViolationException, } from "@mikro-orm/core";
|
|
14
|
-
import { BadRequestException, ConflictException, ForbiddenException, Inject, Injectable, NotFoundException, } from "@nestjs/common";
|
|
15
|
-
import { AccessControlService } from "./access-control.service.js";
|
|
16
|
-
import { MODULE_OPTIONS_TOKEN } from "./auth.module-definition.js";
|
|
17
|
-
import { listAuthPermissions, listAuthRoles, normalizeAuthPermissions, normalizeAuthRoles, resolveAuthPermissions, } from "./utils/auth-role.util.js";
|
|
18
|
-
import { runAuthQuery } from "./utils/run-auth-query.js";
|
|
19
|
-
import { DEFAULT_WORKSPACE_CREATOR_ROLE, DEFAULT_WORKSPACE_PERMISSIONS, DEFAULT_WORKSPACE_ROLE, DEFAULT_WORKSPACE_ROLES, } from "./workspace.constants.js";
|
|
20
|
-
let WorkspaceService = class WorkspaceService {
|
|
21
|
-
em;
|
|
22
|
-
authOptions;
|
|
23
|
-
accessControlService;
|
|
24
|
-
constructor(em, authOptions, accessControlService) {
|
|
25
|
-
this.em = em;
|
|
26
|
-
this.authOptions = authOptions;
|
|
27
|
-
this.accessControlService = accessControlService;
|
|
28
|
-
}
|
|
29
|
-
async findOne(where) {
|
|
30
|
-
this.accessControlService.assertUserCan("read", this.workspaceEntity);
|
|
31
|
-
return await this.em.findOne(this.workspaceEntity, where);
|
|
32
|
-
}
|
|
33
|
-
async listWorkspaces(user) {
|
|
34
|
-
this.accessControlService.assertCurrentUser(user);
|
|
35
|
-
this.accessControlService.assertUserCan("read", this.workspaceEntity);
|
|
36
|
-
return await this.runUnrestricted(async (em) => {
|
|
37
|
-
const memberships = await em.find(this.workspaceMemberEntity, { status: "ACTIVE", user }, { filters: false, populate: ["workspace"] });
|
|
38
|
-
return memberships
|
|
39
|
-
.map((membership) => this.unwrapWorkspace(membership))
|
|
40
|
-
.filter((workspace) => !workspace.deletedAt);
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
async createWorkspace(user, input) {
|
|
44
|
-
this.accessControlService.assertCurrentUser(user);
|
|
45
|
-
this.accessControlService.assertUserCan("create", this.workspaceEntity);
|
|
46
|
-
return await this.runUnrestricted(async (em) => await em.transactional(async (em) => {
|
|
47
|
-
const workspace = em.create(this.workspaceEntity, {
|
|
48
|
-
name: input.name,
|
|
49
|
-
});
|
|
50
|
-
const workspaceMember = em.create(this.workspaceMemberEntity, {
|
|
51
|
-
email: user.email,
|
|
52
|
-
name: user.name,
|
|
53
|
-
roles: [this.creatorRole],
|
|
54
|
-
status: "ACTIVE",
|
|
55
|
-
user: user.id,
|
|
56
|
-
workspace,
|
|
57
|
-
});
|
|
58
|
-
await em.persist(workspace).persist(workspaceMember).flush();
|
|
59
|
-
return workspace;
|
|
60
|
-
}));
|
|
61
|
-
}
|
|
62
|
-
async getFullWorkspace(workspace) {
|
|
63
|
-
this.accessControlService.assertCurrentWorkspace(workspace);
|
|
64
|
-
this.accessControlService.assertWorkspaceCan("read", workspace);
|
|
65
|
-
const [members, invitations] = await this.runUnrestricted(async (em) => await Promise.all([
|
|
66
|
-
em.find(this.workspaceMemberEntity, { workspace }, { filters: false }),
|
|
67
|
-
em.find(this.workspaceInvitationEntity, { workspace }, {
|
|
68
|
-
filters: false,
|
|
69
|
-
orderBy: { createdAt: "desc" },
|
|
70
|
-
}),
|
|
71
|
-
]));
|
|
72
|
-
return {
|
|
73
|
-
workspace,
|
|
74
|
-
members,
|
|
75
|
-
invitations,
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
async updateWorkspace(workspace, input) {
|
|
79
|
-
this.accessControlService.assertCurrentWorkspace(workspace);
|
|
80
|
-
this.accessControlService.assertWorkspaceCan("update", workspace);
|
|
81
|
-
this.em.assign(workspace, input);
|
|
82
|
-
await this.em.flush();
|
|
83
|
-
return workspace;
|
|
84
|
-
}
|
|
85
|
-
async deleteWorkspace(workspace, currentWorkspaceMember) {
|
|
86
|
-
this.accessControlService.assertCurrentWorkspace(workspace);
|
|
87
|
-
this.accessControlService.assertCurrentWorkspaceMember(currentWorkspaceMember);
|
|
88
|
-
this.accessControlService.assertWorkspaceCan("delete", workspace);
|
|
89
|
-
if (!currentWorkspaceMember.roles.includes(this.creatorRole) ||
|
|
90
|
-
this.unwrapWorkspace(currentWorkspaceMember).id !== workspace.id) {
|
|
91
|
-
throw new ForbiddenException("Only workspace owners can delete it");
|
|
92
|
-
}
|
|
93
|
-
return await this.runUnrestricted(async (em) => await em.transactional(async (em) => {
|
|
94
|
-
await this.lockActiveWorkspace(em, workspace);
|
|
95
|
-
await em.nativeUpdate(this.workspaceInvitationEntity, {
|
|
96
|
-
status: "pending",
|
|
97
|
-
workspace,
|
|
98
|
-
}, { status: "canceled" });
|
|
99
|
-
em.assign(workspace, { deletedAt: new Date() });
|
|
100
|
-
await em.persist(workspace).flush();
|
|
101
|
-
return workspace;
|
|
102
|
-
}));
|
|
103
|
-
}
|
|
104
|
-
async getMember(workspace, user) {
|
|
105
|
-
this.accessControlService.assertCurrentUser(user);
|
|
106
|
-
this.accessControlService.assertUserCan("read", this.workspaceEntity);
|
|
107
|
-
return await this.runUnrestricted(async (em) => await em.findOne(this.workspaceMemberEntity, { status: "ACTIVE", user, workspace }, { filters: false }));
|
|
108
|
-
}
|
|
109
|
-
async getMemberById(workspace, memberId) {
|
|
110
|
-
this.accessControlService.assertCurrentWorkspace(workspace);
|
|
111
|
-
this.accessControlService.assertWorkspaceCan("read", this.workspaceMemberEntity);
|
|
112
|
-
return await this.runUnrestricted(async (em) => await em.findOne(this.workspaceMemberEntity, { id: memberId, workspace }, { filters: false }));
|
|
113
|
-
}
|
|
114
|
-
async listMembers(workspace) {
|
|
115
|
-
this.accessControlService.assertCurrentWorkspace(workspace);
|
|
116
|
-
this.accessControlService.assertWorkspaceCan("read", this.workspaceMemberEntity);
|
|
117
|
-
return await this.runUnrestricted(async (em) => await em.find(this.workspaceMemberEntity, {
|
|
118
|
-
status: { $in: ["ACTIVE", "DISABLED"] },
|
|
119
|
-
workspace,
|
|
120
|
-
}, { filters: false, orderBy: { createdAt: "asc" } }));
|
|
121
|
-
}
|
|
122
|
-
async addMember(workspace, user, input = {}) {
|
|
123
|
-
this.accessControlService.assertCurrentWorkspace(workspace);
|
|
124
|
-
this.accessControlService.assertWorkspaceCan("create", this.workspaceMemberEntity);
|
|
125
|
-
const permissions = this.normalizePermissions(input.permissions ?? []);
|
|
126
|
-
this.accessControlService.assertCanGrantWorkspacePermissions(permissions);
|
|
127
|
-
const roles = this.normalizeGrantedRoles(input.roles ?? [this.defaultRole]);
|
|
128
|
-
return await this.runUnrestricted(async (em) => await em.transactional(async (em) => {
|
|
129
|
-
await this.lockActiveWorkspace(em, workspace);
|
|
130
|
-
const existing = await em.findOne(this.workspaceMemberEntity, { user, workspace }, { filters: false });
|
|
131
|
-
if (existing)
|
|
132
|
-
throw new ConflictException("User is already a member");
|
|
133
|
-
const member = em.create(this.workspaceMemberEntity, {
|
|
134
|
-
email: user.email,
|
|
135
|
-
name: user.name,
|
|
136
|
-
permissions,
|
|
137
|
-
roles,
|
|
138
|
-
status: "ACTIVE",
|
|
139
|
-
user,
|
|
140
|
-
workspace,
|
|
141
|
-
});
|
|
142
|
-
await em.persist(member).flush();
|
|
143
|
-
await em.nativeUpdate(this.workspaceInvitationEntity, {
|
|
144
|
-
email: user.email.trim().toLowerCase(),
|
|
145
|
-
status: "pending",
|
|
146
|
-
workspace,
|
|
147
|
-
}, { status: "canceled" });
|
|
148
|
-
return member;
|
|
149
|
-
}));
|
|
150
|
-
}
|
|
151
|
-
async addMemberByEmail(workspace, email, input = {}) {
|
|
152
|
-
this.accessControlService.assertCurrentWorkspace(workspace);
|
|
153
|
-
this.accessControlService.assertWorkspaceCan("create", this.workspaceMemberEntity);
|
|
154
|
-
const user = await this.runUnrestricted(async (em) => await em.findOne(this.userEntity, { email: email.trim().toLowerCase() }, { filters: false }));
|
|
155
|
-
if (!user)
|
|
156
|
-
throw new NotFoundException("User not found");
|
|
157
|
-
return await this.addMember(workspace, user, input);
|
|
158
|
-
}
|
|
159
|
-
async createServiceAccount(workspace, input) {
|
|
160
|
-
this.accessControlService.assertCurrentWorkspace(workspace);
|
|
161
|
-
this.accessControlService.assertWorkspaceCan("create", this.workspaceMemberEntity);
|
|
162
|
-
const permissions = this.normalizePermissions(input.permissions ?? []);
|
|
163
|
-
this.accessControlService.assertCanGrantWorkspacePermissions(permissions);
|
|
164
|
-
const roles = this.normalizeGrantedRoles(input.roles ?? [this.defaultRole]);
|
|
165
|
-
return await this.runUnrestricted(async (em) => await em.transactional(async (em) => {
|
|
166
|
-
await this.lockActiveWorkspace(em, workspace);
|
|
167
|
-
const member = em.create(this.workspaceMemberEntity, {
|
|
168
|
-
...(input.data ?? {}),
|
|
169
|
-
email: null,
|
|
170
|
-
name: input.name,
|
|
171
|
-
permissions,
|
|
172
|
-
roles,
|
|
173
|
-
status: "ACTIVE",
|
|
174
|
-
user: null,
|
|
175
|
-
workspace,
|
|
176
|
-
});
|
|
177
|
-
await em.persist(member).flush();
|
|
178
|
-
return member;
|
|
179
|
-
}));
|
|
180
|
-
}
|
|
181
|
-
async updateMember(member, input) {
|
|
182
|
-
const workspace = this.unwrapWorkspace(member);
|
|
183
|
-
this.accessControlService.assertCurrentWorkspace(workspace);
|
|
184
|
-
this.accessControlService.assertWorkspaceCan("update", member);
|
|
185
|
-
if ("roles" in input || "permissions" in input) {
|
|
186
|
-
throw new BadRequestException("Use updateMemberRole or setMemberPermissions to update authorization fields");
|
|
187
|
-
}
|
|
188
|
-
if (input.status === "DISABLED" &&
|
|
189
|
-
member.roles.includes(this.creatorRole)) {
|
|
190
|
-
throw new ForbiddenException("Workspace owners cannot be disabled");
|
|
191
|
-
}
|
|
192
|
-
const email = typeof input.email === "string"
|
|
193
|
-
? input.email.trim().toLowerCase()
|
|
194
|
-
: input.email;
|
|
195
|
-
return await this.runUnrestricted(async (em) => await em.transactional(async (em) => {
|
|
196
|
-
const lockedMember = await em.findOne(this.workspaceMemberEntity, { id: member.id, workspace }, {
|
|
197
|
-
filters: false,
|
|
198
|
-
lockMode: LockMode.PESSIMISTIC_WRITE,
|
|
199
|
-
refresh: true,
|
|
200
|
-
});
|
|
201
|
-
if (!lockedMember) {
|
|
202
|
-
throw new NotFoundException("Workspace member not found");
|
|
203
|
-
}
|
|
204
|
-
this.accessControlService.assertWorkspaceCan("update", lockedMember);
|
|
205
|
-
if (input.status === "DISABLED" &&
|
|
206
|
-
lockedMember.roles.includes(this.creatorRole)) {
|
|
207
|
-
throw new ForbiddenException("Workspace owners cannot be disabled");
|
|
208
|
-
}
|
|
209
|
-
if (email) {
|
|
210
|
-
const duplicate = await em.findOne(this.workspaceMemberEntity, {
|
|
211
|
-
email,
|
|
212
|
-
id: { $ne: lockedMember.id },
|
|
213
|
-
workspace,
|
|
214
|
-
}, { filters: false });
|
|
215
|
-
if (duplicate) {
|
|
216
|
-
throw new ConflictException("A workspace member already uses this email address");
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
em.assign(lockedMember, {
|
|
220
|
-
...(input.name !== undefined ? { name: input.name } : {}),
|
|
221
|
-
...(input.email !== undefined ? { email } : {}),
|
|
222
|
-
...(input.status !== undefined ? { status: input.status } : {}),
|
|
223
|
-
});
|
|
224
|
-
await em.flush();
|
|
225
|
-
return lockedMember;
|
|
226
|
-
}));
|
|
227
|
-
}
|
|
228
|
-
async updateMemberRole(member, role) {
|
|
229
|
-
const workspace = this.unwrapWorkspace(member);
|
|
230
|
-
this.accessControlService.assertCurrentWorkspace(workspace);
|
|
231
|
-
this.accessControlService.assertWorkspaceCan("update", member);
|
|
232
|
-
if (member.roles.includes(this.creatorRole)) {
|
|
233
|
-
throw new ForbiddenException("Workspace owner roles can only be changed by transferring ownership");
|
|
234
|
-
}
|
|
235
|
-
const roles = this.normalizeGrantedRoles(role);
|
|
236
|
-
return await this.runUnrestricted(async (em) => await em.transactional(async (em) => {
|
|
237
|
-
const lockedMember = await em.findOne(this.workspaceMemberEntity, { id: member.id, workspace }, { filters: false, lockMode: LockMode.PESSIMISTIC_WRITE });
|
|
238
|
-
if (!lockedMember) {
|
|
239
|
-
throw new NotFoundException("Workspace member not found");
|
|
240
|
-
}
|
|
241
|
-
if (lockedMember.roles.includes(this.creatorRole)) {
|
|
242
|
-
throw new ForbiddenException("Workspace owner roles can only be changed by transferring ownership");
|
|
243
|
-
}
|
|
244
|
-
lockedMember.roles = roles;
|
|
245
|
-
await em.flush();
|
|
246
|
-
return lockedMember;
|
|
247
|
-
}));
|
|
248
|
-
}
|
|
249
|
-
async setMemberPermissions(member, permissions) {
|
|
250
|
-
const workspace = this.unwrapWorkspace(member);
|
|
251
|
-
this.accessControlService.assertCurrentWorkspace(workspace);
|
|
252
|
-
this.accessControlService.assertWorkspaceCan("update", member);
|
|
253
|
-
const normalizedPermissions = this.normalizePermissions(permissions);
|
|
254
|
-
this.accessControlService.assertCanGrantWorkspacePermissions(normalizedPermissions);
|
|
255
|
-
return await this.runUnrestricted(async (em) => await em.transactional(async (em) => {
|
|
256
|
-
const lockedMember = await em.findOne(this.workspaceMemberEntity, { id: member.id, workspace }, {
|
|
257
|
-
filters: false,
|
|
258
|
-
lockMode: LockMode.PESSIMISTIC_WRITE,
|
|
259
|
-
refresh: true,
|
|
260
|
-
});
|
|
261
|
-
if (!lockedMember) {
|
|
262
|
-
throw new NotFoundException("Workspace member not found");
|
|
263
|
-
}
|
|
264
|
-
this.accessControlService.assertWorkspaceCan("update", lockedMember);
|
|
265
|
-
lockedMember.permissions = normalizedPermissions;
|
|
266
|
-
await em.flush();
|
|
267
|
-
return lockedMember;
|
|
268
|
-
}));
|
|
269
|
-
}
|
|
270
|
-
async removeMember(member) {
|
|
271
|
-
const workspace = this.unwrapWorkspace(member);
|
|
272
|
-
this.accessControlService.assertCurrentWorkspace(workspace);
|
|
273
|
-
this.accessControlService.assertWorkspaceCan("delete", member);
|
|
274
|
-
if (member.roles.includes(this.creatorRole)) {
|
|
275
|
-
throw new ForbiddenException("Workspace owners cannot be removed");
|
|
276
|
-
}
|
|
277
|
-
return await this.removeNonOwnerMember(workspace, member, "Workspace owners cannot be removed");
|
|
278
|
-
}
|
|
279
|
-
async leaveWorkspace(member) {
|
|
280
|
-
const workspace = this.unwrapWorkspace(member);
|
|
281
|
-
this.accessControlService.assertCurrentWorkspace(workspace);
|
|
282
|
-
this.accessControlService.assertCurrentWorkspaceMember(member);
|
|
283
|
-
if (member.roles.includes(this.creatorRole)) {
|
|
284
|
-
throw new ForbiddenException("Workspace owners cannot leave");
|
|
285
|
-
}
|
|
286
|
-
return await this.removeNonOwnerMember(workspace, member, "Workspace owners cannot leave");
|
|
287
|
-
}
|
|
288
|
-
async transferOwnership(workspace, currentOwner, nextOwner) {
|
|
289
|
-
this.accessControlService.assertCurrentWorkspace(workspace);
|
|
290
|
-
this.accessControlService.assertCurrentWorkspaceMember(currentOwner);
|
|
291
|
-
this.accessControlService.assertWorkspaceCan("update", workspace);
|
|
292
|
-
if (!currentOwner.roles.includes(this.creatorRole) ||
|
|
293
|
-
this.unwrapWorkspace(currentOwner).id !== workspace.id) {
|
|
294
|
-
throw new ForbiddenException("Only the current workspace owner can transfer ownership");
|
|
295
|
-
}
|
|
296
|
-
if (currentOwner.id === nextOwner.id ||
|
|
297
|
-
this.unwrapWorkspace(nextOwner).id !== workspace.id ||
|
|
298
|
-
nextOwner.status !== "ACTIVE" ||
|
|
299
|
-
!nextOwner.user) {
|
|
300
|
-
throw new BadRequestException("The next owner must be another active user member");
|
|
301
|
-
}
|
|
302
|
-
return await this.runUnrestricted(async (em) => await em.transactional(async (em) => {
|
|
303
|
-
const lockedCurrentOwner = await em.findOne(this.workspaceMemberEntity, { id: currentOwner.id, workspace }, { filters: false, lockMode: LockMode.PESSIMISTIC_WRITE });
|
|
304
|
-
if (!lockedCurrentOwner) {
|
|
305
|
-
throw new ForbiddenException("Workspace ownership has already changed");
|
|
306
|
-
}
|
|
307
|
-
const lockedNextOwner = await em.findOne(this.workspaceMemberEntity, { id: nextOwner.id, workspace }, { filters: false, lockMode: LockMode.PESSIMISTIC_WRITE });
|
|
308
|
-
if (!lockedCurrentOwner.roles.includes(this.creatorRole)) {
|
|
309
|
-
throw new ForbiddenException("Workspace ownership has already changed");
|
|
310
|
-
}
|
|
311
|
-
if (!lockedNextOwner ||
|
|
312
|
-
lockedNextOwner.status !== "ACTIVE" ||
|
|
313
|
-
!lockedNextOwner.user) {
|
|
314
|
-
throw new BadRequestException("The next owner must be another active user member");
|
|
315
|
-
}
|
|
316
|
-
lockedCurrentOwner.roles = [this.defaultRole];
|
|
317
|
-
lockedNextOwner.roles = [this.creatorRole];
|
|
318
|
-
await em.flush();
|
|
319
|
-
return lockedNextOwner;
|
|
320
|
-
}));
|
|
321
|
-
}
|
|
322
|
-
async createInvitation(workspace, inviter, input, request) {
|
|
323
|
-
this.accessControlService.assertCurrentWorkspace(workspace);
|
|
324
|
-
this.accessControlService.assertCurrentUser(inviter);
|
|
325
|
-
this.accessControlService.assertWorkspaceCan("create", this.workspaceInvitationEntity);
|
|
326
|
-
const email = input.email.trim().toLowerCase();
|
|
327
|
-
const roles = this.normalizeGrantedRoles(input.roles ?? [this.defaultRole]);
|
|
328
|
-
const expiresIn = input.expiresIn ?? 60 * 60 * 48;
|
|
329
|
-
if (!Number.isSafeInteger(expiresIn) || expiresIn <= 0) {
|
|
330
|
-
throw new BadRequestException("Workspace invitation lifetime must be a positive integer");
|
|
331
|
-
}
|
|
332
|
-
const now = new Date();
|
|
333
|
-
const sendInvitationEmail = this.authOptions.workspace?.sendInvitationEmail;
|
|
334
|
-
let transactionResult;
|
|
335
|
-
try {
|
|
336
|
-
transactionResult = await this.runUnrestricted(async (em) => await em.transactional(async (em) => {
|
|
337
|
-
await this.lockActiveWorkspace(em, workspace);
|
|
338
|
-
const [member, invitation, inviterMember] = await Promise.all([
|
|
339
|
-
em.findOne(this.workspaceMemberEntity, {
|
|
340
|
-
workspace,
|
|
341
|
-
$or: [{ email }, { user: { email } }],
|
|
342
|
-
}, { filters: false }),
|
|
343
|
-
em.findOne(this.workspaceInvitationEntity, {
|
|
344
|
-
email,
|
|
345
|
-
status: "pending",
|
|
346
|
-
workspace,
|
|
347
|
-
}, { filters: false }),
|
|
348
|
-
sendInvitationEmail
|
|
349
|
-
? em.findOne(this.workspaceMemberEntity, {
|
|
350
|
-
status: "ACTIVE",
|
|
351
|
-
user: inviter,
|
|
352
|
-
workspace,
|
|
353
|
-
}, { filters: false })
|
|
354
|
-
: Promise.resolve(null),
|
|
355
|
-
]);
|
|
356
|
-
if (member) {
|
|
357
|
-
throw new ConflictException("User is already a member");
|
|
358
|
-
}
|
|
359
|
-
if (invitation && invitation.expiresAt.getTime() > now.getTime()) {
|
|
360
|
-
throw new ConflictException("User is already invited to this workspace");
|
|
361
|
-
}
|
|
362
|
-
if (sendInvitationEmail && !inviterMember) {
|
|
363
|
-
throw new ForbiddenException("Invitation sender is not an active workspace member");
|
|
364
|
-
}
|
|
365
|
-
if (invitation) {
|
|
366
|
-
invitation.status = "canceled";
|
|
367
|
-
await em.flush();
|
|
368
|
-
}
|
|
369
|
-
const created = em.create(this.workspaceInvitationEntity, {
|
|
370
|
-
email,
|
|
371
|
-
expiresAt: new Date(now.getTime() + expiresIn * 1000),
|
|
372
|
-
inviter,
|
|
373
|
-
roles,
|
|
374
|
-
status: "pending",
|
|
375
|
-
workspace,
|
|
376
|
-
});
|
|
377
|
-
await em.persist(created).flush();
|
|
378
|
-
return { created, inviterMember };
|
|
379
|
-
}));
|
|
380
|
-
}
|
|
381
|
-
catch (error) {
|
|
382
|
-
if (error instanceof UniqueConstraintViolationException) {
|
|
383
|
-
throw new ConflictException("User is already invited to this workspace");
|
|
384
|
-
}
|
|
385
|
-
throw error;
|
|
386
|
-
}
|
|
387
|
-
const { created, inviterMember } = transactionResult;
|
|
388
|
-
if (sendInvitationEmail && inviterMember) {
|
|
389
|
-
const callbackInviter = Object.assign(Object.create(Object.getPrototypeOf(inviterMember)), inviterMember, { user: inviter });
|
|
390
|
-
try {
|
|
391
|
-
await sendInvitationEmail({
|
|
392
|
-
email,
|
|
393
|
-
id: created.id,
|
|
394
|
-
invitation: created,
|
|
395
|
-
inviter: callbackInviter,
|
|
396
|
-
roles: [...created.roles],
|
|
397
|
-
workspace,
|
|
398
|
-
}, request);
|
|
399
|
-
}
|
|
400
|
-
catch (error) {
|
|
401
|
-
await this.runUnrestricted(async (em) => await em.nativeUpdate(this.workspaceInvitationEntity, {
|
|
402
|
-
id: created.id,
|
|
403
|
-
status: "pending",
|
|
404
|
-
}, { status: "canceled" }));
|
|
405
|
-
throw error;
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
return created;
|
|
409
|
-
}
|
|
410
|
-
async getUserInvitation(id, user) {
|
|
411
|
-
this.accessControlService.assertCurrentUser(user);
|
|
412
|
-
return await this.runUnrestricted(async (em) => await em.findOne(this.workspaceInvitationEntity, {
|
|
413
|
-
id,
|
|
414
|
-
email: user.email.toLowerCase(),
|
|
415
|
-
}, { filters: false }));
|
|
416
|
-
}
|
|
417
|
-
async getWorkspaceInvitation(id, workspace) {
|
|
418
|
-
this.accessControlService.assertCurrentWorkspace(workspace);
|
|
419
|
-
this.accessControlService.assertWorkspaceCan("read", this.workspaceInvitationEntity);
|
|
420
|
-
return await this.runUnrestricted(async (em) => await em.findOne(this.workspaceInvitationEntity, { id, workspace }, { filters: false }));
|
|
421
|
-
}
|
|
422
|
-
async listInvitations(workspace) {
|
|
423
|
-
this.accessControlService.assertCurrentWorkspace(workspace);
|
|
424
|
-
this.accessControlService.assertWorkspaceCan("read", this.workspaceInvitationEntity);
|
|
425
|
-
return await this.runUnrestricted(async (em) => await em.find(this.workspaceInvitationEntity, { workspace }, { filters: false, orderBy: { createdAt: "desc" } }));
|
|
426
|
-
}
|
|
427
|
-
async listUserInvitations(user) {
|
|
428
|
-
this.accessControlService.assertCurrentUser(user);
|
|
429
|
-
const now = new Date();
|
|
430
|
-
return await this.runUnrestricted(async (em) => await em.find(this.workspaceInvitationEntity, {
|
|
431
|
-
email: user.email.toLowerCase(),
|
|
432
|
-
expiresAt: { $gt: now },
|
|
433
|
-
status: "pending",
|
|
434
|
-
workspace: { deletedAt: null },
|
|
435
|
-
}, { filters: false, orderBy: { createdAt: "desc" } }));
|
|
436
|
-
}
|
|
437
|
-
async acceptInvitation(user, invitationId) {
|
|
438
|
-
this.accessControlService.assertCurrentUser(user);
|
|
439
|
-
return await this.runUnrestricted(async (em) => await em.transactional(async (em) => {
|
|
440
|
-
const invitation = await em.findOne(this.workspaceInvitationEntity, { id: invitationId }, {
|
|
441
|
-
filters: false,
|
|
442
|
-
populate: ["workspace"],
|
|
443
|
-
});
|
|
444
|
-
if (!invitation)
|
|
445
|
-
return null;
|
|
446
|
-
if (invitation.email.toLowerCase() !== user.email.toLowerCase()) {
|
|
447
|
-
throw new ForbiddenException("Workspace invitation belongs to another email address");
|
|
448
|
-
}
|
|
449
|
-
const workspace = this.unwrapInvitationWorkspace(invitation);
|
|
450
|
-
await this.lockActiveWorkspace(em, workspace);
|
|
451
|
-
await em.refreshOrFail(invitation, {
|
|
452
|
-
filters: false,
|
|
453
|
-
lockMode: LockMode.PESSIMISTIC_WRITE,
|
|
454
|
-
populate: [],
|
|
455
|
-
});
|
|
456
|
-
if (invitation.status !== "pending") {
|
|
457
|
-
throw new BadRequestException("Workspace invitation is not pending");
|
|
458
|
-
}
|
|
459
|
-
if (invitation.expiresAt.getTime() <= Date.now()) {
|
|
460
|
-
throw new BadRequestException("Workspace invitation has expired");
|
|
461
|
-
}
|
|
462
|
-
if (invitation.email.toLowerCase() !== user.email.toLowerCase()) {
|
|
463
|
-
throw new ForbiddenException("Workspace invitation belongs to another email address");
|
|
464
|
-
}
|
|
465
|
-
const existing = await em.findOne(this.workspaceMemberEntity, { user, workspace }, { filters: false });
|
|
466
|
-
if (existing)
|
|
467
|
-
throw new ConflictException("User is already a member");
|
|
468
|
-
const member = em.create(this.workspaceMemberEntity, {
|
|
469
|
-
email: user.email,
|
|
470
|
-
name: user.name,
|
|
471
|
-
permissions: [],
|
|
472
|
-
roles: this.normalizeAssignableRoles(invitation.roles),
|
|
473
|
-
status: "ACTIVE",
|
|
474
|
-
user,
|
|
475
|
-
workspace,
|
|
476
|
-
});
|
|
477
|
-
invitation.status = "accepted";
|
|
478
|
-
await em.persist(member).flush();
|
|
479
|
-
return { invitation, member };
|
|
480
|
-
}));
|
|
481
|
-
}
|
|
482
|
-
async cancelInvitation(invitation) {
|
|
483
|
-
const workspace = this.unwrapInvitationWorkspace(invitation);
|
|
484
|
-
this.accessControlService.assertCurrentWorkspace(workspace);
|
|
485
|
-
this.accessControlService.assertWorkspaceCan("cancel", invitation);
|
|
486
|
-
if (invitation.status !== "pending") {
|
|
487
|
-
throw new BadRequestException("Workspace invitation is not pending");
|
|
488
|
-
}
|
|
489
|
-
const updated = await this.runUnrestricted(async (em) => await em.nativeUpdate(this.workspaceInvitationEntity, {
|
|
490
|
-
id: invitation.id,
|
|
491
|
-
status: "pending",
|
|
492
|
-
workspace,
|
|
493
|
-
}, { status: "canceled" }));
|
|
494
|
-
if (updated !== 1) {
|
|
495
|
-
throw new BadRequestException("Workspace invitation is not pending");
|
|
496
|
-
}
|
|
497
|
-
invitation.status = "canceled";
|
|
498
|
-
return invitation;
|
|
499
|
-
}
|
|
500
|
-
async rejectInvitation(user, invitation) {
|
|
501
|
-
this.accessControlService.assertCurrentUser(user);
|
|
502
|
-
if (invitation.status !== "pending") {
|
|
503
|
-
throw new BadRequestException("Workspace invitation is not pending");
|
|
504
|
-
}
|
|
505
|
-
if (invitation.email.toLowerCase() !== user.email.toLowerCase()) {
|
|
506
|
-
throw new ForbiddenException("Workspace invitation belongs to another email address");
|
|
507
|
-
}
|
|
508
|
-
const updated = await this.runUnrestricted(async (em) => await em.nativeUpdate(this.workspaceInvitationEntity, {
|
|
509
|
-
email: user.email.trim().toLowerCase(),
|
|
510
|
-
id: invitation.id,
|
|
511
|
-
status: "pending",
|
|
512
|
-
}, { status: "rejected" }));
|
|
513
|
-
if (updated !== 1) {
|
|
514
|
-
throw new BadRequestException("Workspace invitation is not pending");
|
|
515
|
-
}
|
|
516
|
-
invitation.status = "rejected";
|
|
517
|
-
return invitation;
|
|
518
|
-
}
|
|
519
|
-
hasPermission(member, input) {
|
|
520
|
-
const permissions = new Set(this.getMemberPermissions(member));
|
|
521
|
-
return Object.entries(input.permissions).every(([subject, actions]) => actions.every((action) => permissions.has(`${subject}:${action}`)));
|
|
522
|
-
}
|
|
523
|
-
listRoles() {
|
|
524
|
-
this.accessControlService.assertWorkspaceCan("read", this.workspaceMemberEntity);
|
|
525
|
-
return listAuthRoles(this.roles);
|
|
526
|
-
}
|
|
527
|
-
listPermissions() {
|
|
528
|
-
this.accessControlService.assertWorkspaceCan("read", this.workspaceMemberEntity);
|
|
529
|
-
return listAuthPermissions(this.permissions);
|
|
530
|
-
}
|
|
531
|
-
getMemberPermissions(member) {
|
|
532
|
-
return resolveAuthPermissions(member.roles ?? [this.defaultRole], member.permissions ?? [], this.roles);
|
|
533
|
-
}
|
|
534
|
-
async lockActiveWorkspace(em, workspace) {
|
|
535
|
-
await em.refreshOrFail(workspace, {
|
|
536
|
-
filters: false,
|
|
537
|
-
lockMode: LockMode.PESSIMISTIC_WRITE,
|
|
538
|
-
populate: [],
|
|
539
|
-
failHandler: () => new NotFoundException("Workspace not found"),
|
|
540
|
-
});
|
|
541
|
-
if (workspace.deletedAt) {
|
|
542
|
-
throw new BadRequestException("Workspace has been deleted");
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
normalizeRoles(role) {
|
|
546
|
-
return normalizeAuthRoles(role, this.roles);
|
|
547
|
-
}
|
|
548
|
-
normalizeAssignableRoles(role) {
|
|
549
|
-
const roles = this.normalizeRoles(role);
|
|
550
|
-
if (roles.includes(this.creatorRole)) {
|
|
551
|
-
throw new ForbiddenException("The owner role can only be assigned by transferring ownership");
|
|
552
|
-
}
|
|
553
|
-
return roles;
|
|
554
|
-
}
|
|
555
|
-
normalizeGrantedRoles(role) {
|
|
556
|
-
const roles = this.normalizeAssignableRoles(role);
|
|
557
|
-
this.accessControlService.assertCanGrantWorkspacePermissions(resolveAuthPermissions(roles, [], this.roles));
|
|
558
|
-
return roles;
|
|
559
|
-
}
|
|
560
|
-
normalizePermissions(permissions) {
|
|
561
|
-
return normalizeAuthPermissions(permissions, this.permissions, "Workspace member");
|
|
562
|
-
}
|
|
563
|
-
async removeNonOwnerMember(workspace, member, ownerMessage) {
|
|
564
|
-
return await this.runUnrestricted(async (em) => await em.transactional(async (em) => {
|
|
565
|
-
const lockedMember = await em.findOne(this.workspaceMemberEntity, { id: member.id, workspace }, { filters: false, lockMode: LockMode.PESSIMISTIC_WRITE });
|
|
566
|
-
if (!lockedMember) {
|
|
567
|
-
throw new NotFoundException("Workspace member not found");
|
|
568
|
-
}
|
|
569
|
-
if (lockedMember.roles.includes(this.creatorRole)) {
|
|
570
|
-
throw new ForbiddenException(ownerMessage);
|
|
571
|
-
}
|
|
572
|
-
await em.remove(lockedMember).flush();
|
|
573
|
-
return lockedMember;
|
|
574
|
-
}));
|
|
575
|
-
}
|
|
576
|
-
get roles() {
|
|
577
|
-
return this.authOptions.workspace?.roles ?? DEFAULT_WORKSPACE_ROLES;
|
|
578
|
-
}
|
|
579
|
-
get defaultRole() {
|
|
580
|
-
return this.authOptions.workspace?.defaultRole ?? DEFAULT_WORKSPACE_ROLE;
|
|
581
|
-
}
|
|
582
|
-
get creatorRole() {
|
|
583
|
-
return (this.authOptions.workspace?.creatorRole ?? DEFAULT_WORKSPACE_CREATOR_ROLE);
|
|
584
|
-
}
|
|
585
|
-
get permissions() {
|
|
586
|
-
return (this.authOptions.workspace?.permissions ?? DEFAULT_WORKSPACE_PERMISSIONS);
|
|
587
|
-
}
|
|
588
|
-
unwrapWorkspace(member) {
|
|
589
|
-
return Reference.unwrapReference(member.workspace);
|
|
590
|
-
}
|
|
591
|
-
unwrapInvitationWorkspace(invitation) {
|
|
592
|
-
return Reference.unwrapReference(invitation.workspace);
|
|
593
|
-
}
|
|
594
|
-
async runUnrestricted(callback) {
|
|
595
|
-
return await runAuthQuery(this.em, callback);
|
|
596
|
-
}
|
|
597
|
-
get workspaceEntity() {
|
|
598
|
-
return this.authOptions.entities.workspace;
|
|
599
|
-
}
|
|
600
|
-
get userEntity() {
|
|
601
|
-
return this.authOptions.entities.user;
|
|
602
|
-
}
|
|
603
|
-
get workspaceMemberEntity() {
|
|
604
|
-
return this.authOptions.entities
|
|
605
|
-
.workspaceMember;
|
|
606
|
-
}
|
|
607
|
-
get workspaceInvitationEntity() {
|
|
608
|
-
return this.authOptions.entities
|
|
609
|
-
.workspaceInvitation;
|
|
610
|
-
}
|
|
611
|
-
};
|
|
612
|
-
WorkspaceService = __decorate([
|
|
613
|
-
Injectable(),
|
|
614
|
-
__param(1, Inject(MODULE_OPTIONS_TOKEN)),
|
|
615
|
-
__metadata("design:paramtypes", [EntityManager, Object, AccessControlService])
|
|
616
|
-
], WorkspaceService);
|
|
617
|
-
export { WorkspaceService };
|
|
618
|
-
//# sourceMappingURL=workspace.service.js.map
|