@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
package/README.md
CHANGED
|
@@ -1,5 +1,149 @@
|
|
|
1
1
|
# @nest-boot/auth
|
|
2
2
|
|
|
3
|
+
Authentication, authorization, built-in MikroORM entities, GraphQL resolvers and
|
|
4
|
+
connections are provided by one `AuthModule`. The former `@nest-boot/auth-graphql`
|
|
5
|
+
package has been merged here; remove its dependency and `AuthGraphQLModule` import.
|
|
6
|
+
|
|
7
|
+
The example's handwritten `Initial` migration creates roles and default
|
|
8
|
+
privileges; generated migrations create and evolve tables and RLS policies.
|
|
9
|
+
Apply the complete migration sequence to a fresh database.
|
|
10
|
+
|
|
11
|
+
## Member and Invitation rename
|
|
12
|
+
|
|
13
|
+
This is a breaking rename without compatibility aliases. Use `Member`,
|
|
14
|
+
`Invitation`, `MemberService`, `InvitationService`, and `CurrentMember`.
|
|
15
|
+
The inverse user collection is `User.members`. Workspace ownership remains the
|
|
16
|
+
`workspace` relation, and workspace-role configuration still lives under
|
|
17
|
+
`workspace`.
|
|
18
|
+
|
|
19
|
+
Update workspace permission subjects to `member:*` and `invitation:*`,
|
|
20
|
+
including custom ability builders, stored grants, and application policies.
|
|
21
|
+
The example database tables, foreign keys, indexes, policies, and grants use
|
|
22
|
+
`member` / `invitation` without legacy table names. The regenerated
|
|
23
|
+
`Initial → generated schema migrations` and snapshot target a fresh database only;
|
|
24
|
+
they are not an in-place migration for existing installations.
|
|
25
|
+
|
|
26
|
+
`InvitationService.getInvitationByUser(id, user)` and
|
|
27
|
+
`getInvitationByWorkspace(id, workspace)` retain explicit parent-scoped lookups.
|
|
28
|
+
Connection queries use `MemberConnection` / `InvitationConnection`.
|
|
29
|
+
Service checks, request RLS, transaction boundaries, and special execution
|
|
30
|
+
contexts are preserved.
|
|
31
|
+
|
|
32
|
+
## Built-in entities
|
|
33
|
+
|
|
34
|
+
Auth owns the concrete `User`, `Account`, `Session`, `Verification`,
|
|
35
|
+
`Workspace`, `Member`, `Invitation`, `UserApiKey` and `WorkspaceApiKey` entities, their GraphQL
|
|
36
|
+
metadata, relations, RLS policies, and connections. There are no public auth
|
|
37
|
+
`Base*` classes or `AuthModuleOptions.entities` overrides.
|
|
38
|
+
|
|
39
|
+
Register the exported `entities` array in both your runtime MikroORM configuration
|
|
40
|
+
and the configuration loaded by the migration CLI. The CLI does not initialize Nest:
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
import { entities as authEntities } from "@nest-boot/auth";
|
|
44
|
+
import { defineConfig } from "@mikro-orm/postgresql";
|
|
45
|
+
|
|
46
|
+
export default defineConfig({
|
|
47
|
+
entities: [...authEntities, "dist/**/*.entity.js"],
|
|
48
|
+
entitiesTs: [...authEntities, "src/**/*.entity.ts"],
|
|
49
|
+
// Connection and migration options...
|
|
50
|
+
});
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Use separate related business entities and additional field resolvers to extend
|
|
54
|
+
these models. Import the built-in classes directly for relation targets; do not
|
|
55
|
+
redeclare or register replacement auth entities. Role/permission catalogs, ability
|
|
56
|
+
builders, delivery callbacks, and provider settings remain configurable.
|
|
57
|
+
|
|
58
|
+
`Account.user` and `Session.user` are `Ref<User>` relations. Read the owner's ID
|
|
59
|
+
through `record.user.id`. The database column remains `user_id` with cascading
|
|
60
|
+
deletion. Better Auth continues to use `userId`; the adapter translates it.
|
|
61
|
+
|
|
62
|
+
## Service method naming
|
|
63
|
+
|
|
64
|
+
Service methods use explicit domain names without deprecated aliases:
|
|
65
|
+
|
|
66
|
+
- `UserService.setUserRoles` replaces roles, while `setUserPermissions` replaces
|
|
67
|
+
direct grants. `getEffectiveUserPermissions` and
|
|
68
|
+
`MemberService.getEffectiveMemberPermissions` include role-derived grants.
|
|
69
|
+
- `UserApiKeyService` and `WorkspaceApiKeyService` uses `createUserApiKey`, `updateUserApiKey`, `deleteUserApiKey`
|
|
70
|
+
and their workspace counterparts, matching its existing lookup names.
|
|
71
|
+
- `MemberService.getMemberByUser(workspace, user)` finds only active
|
|
72
|
+
memberships; `getMember(id)` reads a member in the request's selected workspace.
|
|
73
|
+
It replaces `getMemberById(workspace, memberId)` without an alias. The Service
|
|
74
|
+
requires a selected workspace, checks its read ability, and queries by both
|
|
75
|
+
member ID and workspace using the RLS-scoped manager.
|
|
76
|
+
- `SessionService.setSessionCookie` writes response cookies without changing the
|
|
77
|
+
current request's identity, abilities, or RLS scope.
|
|
78
|
+
- `AuthService.updateCurrentUser` and `deleteCurrentUser` are self-service flows;
|
|
79
|
+
`UserService.updateUser` and `deleteUser` still target a specified user.
|
|
80
|
+
`AuthService.getAccountInfo` reads provider account information server-side.
|
|
81
|
+
|
|
82
|
+
`update*` methods patch fields, `set*` methods replace a value or collection, and
|
|
83
|
+
domain operations such as `removeMember`, `revokeSession`, and `cancelInvitation`
|
|
84
|
+
keep their distinct meanings. These service API renames do not rename GraphQL
|
|
85
|
+
fields or the underlying Better Auth APIs.
|
|
86
|
+
|
|
87
|
+
## Connection query services
|
|
88
|
+
|
|
89
|
+
Connection-returning methods use `get<Entity>Connection` for an unscoped entity connection
|
|
90
|
+
and `get<Entity>ConnectionBy<Parent>` when a parent supplies the query scope.
|
|
91
|
+
For example, `getApiKeyConnectionByUser(user, args)` and
|
|
92
|
+
`getApiKeyConnectionByWorkspace(workspace, args)` take the parent first and
|
|
93
|
+
pagination arguments second. Collection queries use connections rather than separate
|
|
94
|
+
array or offset-based APIs. GraphQL field names, arguments, authorization, and
|
|
95
|
+
pagination behavior are unchanged.
|
|
96
|
+
|
|
97
|
+
Use `WorkspaceService.getWorkspaceConnectionByUser(user, args)` and
|
|
98
|
+
`MemberService.getMemberConnectionByWorkspace(workspace, args)` for workspace/member connections, and
|
|
99
|
+
`UserApiKeyService.getUserApiKeyConnection(user, args)` / `WorkspaceApiKeyService.getWorkspaceApiKeyConnection(workspace, args)`
|
|
100
|
+
for API-key connections. Services own authorization, query scopes and
|
|
101
|
+
`ConnectionManager` execution. User, session, workspace, member, API-key and
|
|
102
|
+
invitation connection reads retain the request's native RLS scope. API-key ownership and credential permission ceilings still apply.
|
|
103
|
+
|
|
104
|
+
Use the member and invitation connection services to query workspace children;
|
|
105
|
+
each service authorizes its own scope. API-key persistence callbacks are private;
|
|
106
|
+
transports call the service's connection methods directly.
|
|
107
|
+
|
|
108
|
+
## Invitation pagination
|
|
109
|
+
|
|
110
|
+
`MemberService.getMemberUser(member)`,
|
|
111
|
+
`InvitationService.getInvitationInviter(invitation)` and
|
|
112
|
+
`getInvitationWorkspace(invitation)` implement the corresponding GraphQL relation
|
|
113
|
+
fields. Users may read their own member-user association before selecting
|
|
114
|
+
a workspace. Other member-user access, including API keys, requires the selected
|
|
115
|
+
workspace and global user-scoped `user:read`. Invitation parent access allows either the recipient with user-scoped
|
|
116
|
+
invitation read permission or the selected workspace with workspace-scoped
|
|
117
|
+
invitation read permission. Reading another inviter's User additionally requires global user-read permission. They re-read parents and targets with injected
|
|
118
|
+
`this.em` and request RLS, never using a privileged reference's cached entity.
|
|
119
|
+
|
|
120
|
+
`InvitationService.getInvitation(id)` is the RLS-backed single-invitation lookup.
|
|
121
|
+
It accepts either user-scoped or workspace-scoped read permission before querying,
|
|
122
|
+
then checks recipient or selected-workspace ownership and instance-level ability.
|
|
123
|
+
Workspace API keys can use the workspace path without a user identity; failing
|
|
124
|
+
recipient authorization does not prevent independently authorized workspace access.
|
|
125
|
+
It uses the request manager without clearing its native session or disabling filters.
|
|
126
|
+
Applications must define recipient SELECT policies
|
|
127
|
+
in addition to their workspace policy if invitees may read before membership.
|
|
128
|
+
Recipient-specific lookup helpers and pagination retain their explicit authorization
|
|
129
|
+
while reading through the request manager. Acceptance and rejection use authorized
|
|
130
|
+
cross-identity contexts supplied by infrastructure; creation and cancellation retain request RLS.
|
|
131
|
+
|
|
132
|
+
`InvitationService.getInvitationConnectionByWorkspace(workspace, args)` and
|
|
133
|
+
`getInvitationConnectionByUser(user, args)` return Relay connections rather than arrays.
|
|
134
|
+
Pass connection arguments such as `{ first: 20, after: cursor }` and read
|
|
135
|
+
`edges`, `pageInfo`, and `totalCount` from the result.
|
|
136
|
+
|
|
137
|
+
The service calls `ConnectionManager` after authorization, using the request
|
|
138
|
+
ORM manager without disabling filters or native RLS. It enforces the selected workspace or
|
|
139
|
+
current recipient regardless of caller filters; recipient lists include only
|
|
140
|
+
unexpired pending invitations. Deleting a workspace cascades to its invitations.
|
|
141
|
+
|
|
142
|
+
`@nest-boot/graphql-connection` and `@mikro-orm/sql` are now peer dependencies.
|
|
143
|
+
`AuthModule` registers the built-in `InvitationConnection`; no application-owned
|
|
144
|
+
connection definition is required. Its GraphQL transport exposes these connections as
|
|
145
|
+
`Workspace.invitations` and `User.invitations` field resolvers.
|
|
146
|
+
|
|
3
147
|
## Authorization TODO
|
|
4
148
|
|
|
5
149
|
### Release blockers
|
|
@@ -25,7 +169,8 @@
|
|
|
25
169
|
- [x] Add module-level API-key defaults and grant limits, and prevent an
|
|
26
170
|
authenticating API key from delegating permissions it does not have.
|
|
27
171
|
- [x] Enforce user and workspace abilities inside authorization-sensitive
|
|
28
|
-
`UserService`, `WorkspaceService`,
|
|
172
|
+
`UserService`, `WorkspaceService`, `MemberService`,
|
|
173
|
+
`InvitationService`, and `UserApiKeyService` and `WorkspaceApiKeyService` operations, so
|
|
29
174
|
direct service injection cannot bypass Resolver or Controller metadata.
|
|
30
175
|
Authentication middleware primitives remain internal identity-resolution
|
|
31
176
|
paths rather than privileged business operations.
|
|
@@ -43,6 +188,397 @@
|
|
|
43
188
|
- [x] Support multiple requirements from the same authorization scope on one
|
|
44
189
|
handler. Repeated `@UserCan` and `@WorkspaceCan` declarations always use
|
|
45
190
|
`all` matching semantics.
|
|
46
|
-
- [x] Document permission catalogs, direct-permission validation,
|
|
191
|
+
- [x] Document permission catalogs, direct-permission validation, creator-role
|
|
47
192
|
invariants, API-key permission ceilings, and multi-requirement behavior
|
|
48
193
|
after the contracts above are finalized.
|
|
194
|
+
|
|
195
|
+
## User and session connections
|
|
196
|
+
|
|
197
|
+
`UserService.getUserConnection(args)`, `SessionService.getSessionConnectionByUser(user, args)` and `AccountService.getAccountConnectionByUser(user, args)` use the built-in connection definitions registered by `AuthModule`. Own browser-session reads do not require administrative permissions; foreign-user and delegated API-key session reads require `session:list`. Application RLS must grant the corresponding SELECT access. Account connections require the owning user session, reject API keys and exclude credential columns. `UserService.listUserAccounts` is removed without an alias.
|
|
198
|
+
|
|
199
|
+
`SessionService` owns `getSessionConnectionByUser`,
|
|
200
|
+
`getSessionImpersonator`, `revokeSession`, and `revokeUserSessions`;
|
|
201
|
+
these are no longer exposed by `UserService`. The GraphQL `User.sessions` field
|
|
202
|
+
delegates to `SessionService` even though its parent is a user. Safe reads use
|
|
203
|
+
the injected request manager and are not in the privileged operation allowlist.
|
|
204
|
+
Administrative revocation keeps its existing `session:revoke` checks and
|
|
205
|
+
infrastructure-owned authentication context, including impersonation-session
|
|
206
|
+
cleanup. `getCurrentAuthenticatedSession` and `listCurrentUserSessions` retain their credential-hydration
|
|
207
|
+
contexts; `listCurrentUserSessions` is not the safe GraphQL listing API.
|
|
208
|
+
|
|
209
|
+
Administrative single-session revocation is now `revokeSession(userOrId, id)`
|
|
210
|
+
(formerly `revokeUserSession`). Browser-session operations are named
|
|
211
|
+
`revokeCurrentUserSession(id)`, `revokeCurrentUserSessions()`, and
|
|
212
|
+
`revokeCurrentUserOtherSessions()`, replacing the former `revokeSession(id)`,
|
|
213
|
+
`revokeSessions()`, and `revokeOtherSessions()` methods without compatibility
|
|
214
|
+
aliases. GraphQL revocation operations now use the same names as these methods.
|
|
215
|
+
|
|
216
|
+
Request-bound authentication methods explicitly name the current user:
|
|
217
|
+
`verifyCurrentUserPassword`, `changeCurrentUserEmail`,
|
|
218
|
+
`changeCurrentUserPassword`, `setCurrentUserPassword`,
|
|
219
|
+
`listCurrentUserAccounts`, `linkCurrentUserAccount`, and
|
|
220
|
+
`unlinkCurrentUserAccount`. Their former names without `CurrentUser` are removed.
|
|
221
|
+
`getCurrentAuthenticatedSession()` replaces `getSession()` and still returns
|
|
222
|
+
the authenticated `{ user, session }` pair; `listCurrentUserSessions()` replaces
|
|
223
|
+
`listSessions()`. Both retain their infrastructure-owned authentication context.
|
|
224
|
+
Better Auth API names, configuration keys, and input properties are unchanged.
|
|
225
|
+
|
|
226
|
+
User bans and identity impersonation remain user-administration workflows in
|
|
227
|
+
`UserService`; `AuthService` still coordinates identity adoption and cookies.
|
|
228
|
+
`MemberService` owns member lookups, pagination, profile updates, roles,
|
|
229
|
+
permissions, adding/removing members, and leaving a workspace.
|
|
230
|
+
`InvitationService` owns invitation lookups, pagination, creation,
|
|
231
|
+
acceptance, rejection, and cancellation. Both are exported and injectable through
|
|
232
|
+
`AuthModule`; the old methods are removed from `WorkspaceService`, without aliases.
|
|
233
|
+
`WorkspaceService` retains workspace queries, lifecycle operations, full workspace
|
|
234
|
+
reads. Creating a workspace still
|
|
235
|
+
creates its owner in the same transaction; accepting an invitation still creates
|
|
236
|
+
its member in the invitation transaction. No service-to-service dependency or
|
|
237
|
+
new privileged context is introduced.
|
|
238
|
+
The internal email lookup context moves to `MemberService.getUserForMembership`;
|
|
239
|
+
acceptance/rejection contexts move to `InvitationService`. Ordinary
|
|
240
|
+
member/invitation reads and writes keep request RLS.
|
|
241
|
+
`AccessControlService` owns request authorization, while the internal
|
|
242
|
+
`UserDeletionService` coordinates atomic deletion across auth-owned entities.
|
|
243
|
+
The impersonator relation checks User profile authorization in SessionService;
|
|
244
|
+
permission to read a session alone does not reveal its impersonator's profile.
|
|
245
|
+
|
|
246
|
+
`AuthService.signInEntity` and `signInSocialEntity` return persisted application
|
|
247
|
+
users. When a session is issued, its identity, workspace membership, RLS context
|
|
248
|
+
and abilities replace the previous request identity before nested selection.
|
|
249
|
+
GraphQL registration uses `AuthService.signUpPayload` and returns only
|
|
250
|
+
`SignUpPayload { id, token }`, without user relations. A null token does not load
|
|
251
|
+
the registered entity or grant authentication. The original DTO-returning
|
|
252
|
+
AuthService methods remain available.
|
|
253
|
+
|
|
254
|
+
## Scoped management writes
|
|
255
|
+
|
|
256
|
+
Ordinary API-key update/delete, user update/delete and role/permission setters,
|
|
257
|
+
workspace update/delete, and member update/remove and role/permission setters
|
|
258
|
+
retain the request EntityManager's native RLS session. They also retain Service
|
|
259
|
+
ability checks, current-user/workspace ownership checks, permission ceilings,
|
|
260
|
+
and lifecycle invariants. Services may resolve the authenticated actor from
|
|
261
|
+
RequestContext; resolvers need only pass resource IDs and inputs. RLS is defense
|
|
262
|
+
in depth, not a substitute for these checks or for correctly configured policies.
|
|
263
|
+
|
|
264
|
+
Workspace deletion and member profile edits use the target's `delete` and
|
|
265
|
+
`update` abilities, respectively, rather than requiring the caller's creator
|
|
266
|
+
role. Editing the creator's shared contact fields follows the same rule;
|
|
267
|
+
disabling/removing a creator checks the same update/delete abilities as other members.
|
|
268
|
+
Any current member may leave, including the last creator; the workspace is retained.
|
|
269
|
+
Creator roles can be assigned or replaced through `setMemberRoles`, subject to
|
|
270
|
+
update ability and permission-grant checks. Multiple owners are allowed; no
|
|
271
|
+
dedicated ownership-transfer operation is provided. API-key update/delete checks both the entity
|
|
272
|
+
type and the loaded instance so conditional abilities remain enforced.
|
|
273
|
+
|
|
274
|
+
API-key writes use `updateUserApiKey(id, input)`,
|
|
275
|
+
`updateWorkspaceApiKey(id, input)`, `deleteUserApiKey(id)` and
|
|
276
|
+
`deleteWorkspaceApiKey(id)`. The stored owner determines authorization and
|
|
277
|
+
permission normalization. User and member management methods accept either an
|
|
278
|
+
ID or an entity; `updateWorkspace(id, input)` and `deleteWorkspace(id)`
|
|
279
|
+
also accept their existing entity arguments. Passing an ID does not require an
|
|
280
|
+
additional read-operation permission, but database SELECT policies still apply.
|
|
281
|
+
|
|
282
|
+
Apply the example's `Initial → generated schema migrations` before using
|
|
283
|
+
these write paths. Custom applications must supply equivalent grants and RLS
|
|
284
|
+
policies for their own data-isolation requirements. Default table privileges do not protect individual columns; Services exclude credential hashes and reject API-key ownership changes.
|
|
285
|
+
Workspace deletion permanently removes the selected workspace through the request's
|
|
286
|
+
RLS-scoped manager. Foreign keys cascade to members, invitations and workspace API
|
|
287
|
+
keys; users and personal credentials remain. There is no deletion-specific database
|
|
288
|
+
context or restore operation. Successful deletion clears the request's workspace
|
|
289
|
+
identity and ability. Deleted keys no longer retain usage timestamps; durable
|
|
290
|
+
deletion auditing belongs in a separate application audit log.
|
|
291
|
+
|
|
292
|
+
Database request contexts use `app.user.id` and `app.workspace.id`; the previous
|
|
293
|
+
`app.user` and `app.workspace` keys are no longer consumed by scope policies.
|
|
294
|
+
Application permissions are not passed to the database. Services enforce Ability
|
|
295
|
+
checks, custom permission names and API-key ceilings. RLS retains identity-based
|
|
296
|
+
ownership and workspace isolation, not permission-name
|
|
297
|
+
checks. Authenticated User reads/writes and Session reads must go through Services;
|
|
298
|
+
direct ORM/SQL access does not enforce those application authorization rules.
|
|
299
|
+
|
|
300
|
+
Permission identifiers use lowercase `resource:action` names. Catalog membership,
|
|
301
|
+
grant ceilings and API-key intersections use exact string equality; invalid
|
|
302
|
+
names are rejected rather than case-converted. Auth owns the mappings for
|
|
303
|
+
`user:*`, `session:*`, `workspace:*`, `member:*`, `invitation:*`, and API-key CRUD
|
|
304
|
+
permissions. Custom permission names only grant business abilities through
|
|
305
|
+
explicit permission-bound rules; they cannot redefine built-in auth operations.
|
|
306
|
+
|
|
307
|
+
Scoped user deletion authorizes the root DELETE with Service checks and RLS;
|
|
308
|
+
auth dependants are cleaned up atomically by database foreign-key cascades.
|
|
309
|
+
`UserApiKey` and `WorkspaceApiKey` have separate tables and required `user` or `workspace` foreign keys, respectively. Accounts, sessions (including impersonation sessions),
|
|
310
|
+
personal keys, memberships and sent invitations cascade from the deleted user.
|
|
311
|
+
Workspaces and workspace-owned keys survive, even if no owner remains.
|
|
312
|
+
Generate and apply these constraints; child deletes can be silently filtered by RLS.
|
|
313
|
+
Authentication bootstrap,
|
|
314
|
+
creation, invitation acceptance, impersonation and credential administration
|
|
315
|
+
retain their separate authorized privileged flows.
|
|
316
|
+
|
|
317
|
+
## Infrastructure-owned execution contexts
|
|
318
|
+
|
|
319
|
+
Every domain Service uses its injected `this.em`. Services do not fork managers,
|
|
320
|
+
clear RLS sessions, or call privileged execution helpers themselves. `AuthModule`
|
|
321
|
+
providers establish isolated contexts for an explicit allowlist: authentication
|
|
322
|
+
credential lookup, user/workspace creation, invitation acceptance/rejection,
|
|
323
|
+
impersonation, and credential/session administration. Service authorization and
|
|
324
|
+
lifecycle checks still run inside those contexts. Ordinary queries and management
|
|
325
|
+
writes retain request RLS; workspace deletion only adds its operation tag while
|
|
326
|
+
preserving the actor and workspace. Contexts cannot detach an active scoped
|
|
327
|
+
transaction, and never mutate the caller's manager.
|
|
328
|
+
|
|
329
|
+
The ID-only invitation identity lookup runs after acquiring the workspace lock,
|
|
330
|
+
using a fresh identity map and a savepoint on the same connection. It temporarily
|
|
331
|
+
uses the connection role to read committed identities, then restores the request
|
|
332
|
+
role; rollback restores it on failure. This works with a single-connection pool
|
|
333
|
+
and preserves the outer transaction's locks and RLS-protected writes.
|
|
334
|
+
|
|
335
|
+
Leaving a workspace clears the request's member, workspace, ability and workspace
|
|
336
|
+
RLS variables after removal commits. Call it outside externally owned transactions
|
|
337
|
+
so later operations cannot reuse the departed membership.
|
|
338
|
+
|
|
339
|
+
Inject Services through `AuthModule` for these special flows. Directly constructing
|
|
340
|
+
a Service uses exactly the supplied manager; it does not install those boundaries.
|
|
341
|
+
|
|
342
|
+
`AuthService.impersonateUser(id)` and `stopImpersonating()` coordinate session
|
|
343
|
+
creation/restoration, authenticate the resulting session, refresh request user,
|
|
344
|
+
workspace membership, abilities and RLS, then write browser cookies. GraphQL uses
|
|
345
|
+
these entry points so nested fields see the new identity in the same mutation.
|
|
346
|
+
Administrative user/session mutations resolve IDs inside their Services using
|
|
347
|
+
the action's permission, without requiring an additional user-read permission.
|
|
348
|
+
|
|
349
|
+
The baseline `Initial → generated schema migrations` also supplies API-key creation
|
|
350
|
+
and usage tracking through default INSERT/UPDATE privileges and request RLS.
|
|
351
|
+
Services exclude credential hashes from ordinary reads and restrict writable fields;
|
|
352
|
+
raw SQL is no longer protected by column-level grants.
|
|
353
|
+
|
|
354
|
+
## Workspace-visible member profiles
|
|
355
|
+
|
|
356
|
+
Built-in `Member` owns name/email, and `Workspace.members` / `User.members`
|
|
357
|
+
own the inverse collections. Raw ORM collections stay hidden from GraphQL;
|
|
358
|
+
connection field resolvers provide authorized pagination.
|
|
359
|
+
|
|
360
|
+
Every member requires a user and retains its own `name` and nullable `email`.
|
|
361
|
+
These are workspace-visible contact details, initialized from the user's profile
|
|
362
|
+
when membership is created. They are independent thereafter: member edits do not
|
|
363
|
+
change the user's name or login email, and user edits do not synchronize to members.
|
|
364
|
+
Authorized callers may update member name, email and status; roles and permissions
|
|
365
|
+
use dedicated setters. Clearing the member email with `null` does not affect login.
|
|
366
|
+
The example displays and filters member fields directly, with exact filters and
|
|
367
|
+
prefix searches such as `name:Alice*`, without joining private user profiles.
|
|
368
|
+
|
|
369
|
+
`Member.user` remains a private User relation, not a source of shared
|
|
370
|
+
contact details. Reading another user's profile requires global user-read
|
|
371
|
+
authorization in the Service; workspace roles alone do not grant it.
|
|
372
|
+
The same boundary applies to `Invitation.inviter`: access to an invitation
|
|
373
|
+
does not grant access to the inviter's private profile.
|
|
374
|
+
|
|
375
|
+
Service-account creation and its options/input exports remain removed without
|
|
376
|
+
aliases; there is no member type enum. The example now has a two-step fresh-database
|
|
377
|
+
baseline, `Initial → generated schema migrations`, which creates required member user
|
|
378
|
+
relations and independent name/email fields directly, without historical columns.
|
|
379
|
+
|
|
380
|
+
The generated baseline User SELECT policy allows authenticated database roles to
|
|
381
|
+
read User rows. Services enforce profile visibility through Ability, including
|
|
382
|
+
custom permission names and API-key ceilings. Anonymous reads remain denied.
|
|
383
|
+
Direct ORM/SQL reads do not enforce profile privacy; expose User data only through
|
|
384
|
+
authorized Services. User writes and Session reads likewise rely on Service
|
|
385
|
+
authorization, not permission names in database request variables.
|
|
386
|
+
|
|
387
|
+
This baseline replaces the previous migration history and is intended for empty
|
|
388
|
+
databases. Do not apply it on top of an existing schema or merely clear the migration
|
|
389
|
+
history table. Back up existing data and plan a separate data-preserving transition
|
|
390
|
+
before upgrading an existing database. Update custom entities, filters and GraphQL
|
|
391
|
+
documents together.
|
|
392
|
+
|
|
393
|
+
## Built-in GraphQL API
|
|
394
|
+
|
|
395
|
+
Configure `AuthModule` once alongside the application GraphQL module. All standard
|
|
396
|
+
resolvers, input types, payloads, and connections are exported from this package.
|
|
397
|
+
They reference built-in classes directly; no named-type registration, resolver
|
|
398
|
+
factories, or application connection definitions are required. Additional application
|
|
399
|
+
field resolvers may target these classes without replacing built-in fields.
|
|
400
|
+
|
|
401
|
+
## Native query migration
|
|
402
|
+
|
|
403
|
+
- Single-key queries move from root `userApiKey(id)` to `User.apiKey(id)` and from root `apiKey(id)` to `Workspace.apiKey(id)`. They resolve `UserApiKey` and `WorkspaceApiKey`, respectively, with nullable field results and pass their parent to `UserApiKeyService` and `WorkspaceApiKeyService`; mutation authorization is unchanged (see the operation naming migration below). Query through `currentUser { apiKey(id: ...) { id } }` or `currentWorkspace { apiKey(id: ...) { id } }`. Service authorization, ownership filters, permission ceilings and request RLS remain in effect.
|
|
404
|
+
- `users` uses `UserConnectionArgs` / `UserConnection` (first/after or last/before, query/filter/orderBy). `ListUsersInput` and `UserListType` are removed.
|
|
405
|
+
- `User.accounts` now returns `AccountConnection!` through `AccountService.getAccountConnectionByUser(user, args)`: use `currentUser { accounts(first: 20) { edges { node { id providerId scopes } } pageInfo { hasNextPage endCursor } } }`. The array shape and `UserService.listUserAccounts` are removed. Account inspection requires the owning browser session; API keys are rejected and credentials are excluded.
|
|
406
|
+
- Registration/sign-in payloads reference the built-in `User`, not `AuthUserType`. The entity-oriented AuthService methods establish the newly issued session and refresh RLS and abilities before resolving nested fields. Registration without a session does not authenticate the request; protected nested fields still require authentication.
|
|
407
|
+
- `authFetchAccessToken`, `authFetchAccountInfo` and `authRefreshToken` are removed, along with their account-selector input and provider credential result types. No deprecated aliases are retained. Read local account bindings through `User.accounts`; provider integrations can use `AuthService.getAccessToken()`, `refreshToken()` and `getAccountInfo()` server-side. These methods are not exposed by the default GraphQL module.
|
|
408
|
+
- Single API-key lookups return null for rows outside the owner/permission scope; mutation authorization is unchanged.
|
|
409
|
+
|
|
410
|
+
The example migration sequence `Initial → generated schema migrations` enables session/account SELECT policies and uses uniform default table privileges. Column-level database protection is intentionally removed. Apply migrations before deploying the new API. Session administrative reads are authorized by Services through Ability; no application permissions are passed to the database. Passwords, API-key hashes and OAuth/session tokens are excluded by Services from ordinary reads and never exposed as entity fields. Authentication bootstrap and special lifecycle operations retain dedicated privileged paths; ordinary management writes retain request RLS and Service authorization.
|
|
411
|
+
|
|
412
|
+
### Management mutations
|
|
413
|
+
|
|
414
|
+
Auth builds its own permission-to-ability mappings in `AuthAbilityFactory`;
|
|
415
|
+
`UserAbility` and `WorkspaceAbility` remain plain CASL containers. Optional
|
|
416
|
+
`buildAbility` callbacks receive restricted `AbilityRules`: use
|
|
417
|
+
`can(permission, action, subject, conditions?)` for permission-bound business
|
|
418
|
+
grants and `cannot(action, subject, conditions?)` for additional restrictions.
|
|
419
|
+
Both support field restrictions. Callbacks are synchronous and return nothing.
|
|
420
|
+
They cannot grant operations on built-in auth entities or `all`, access the raw
|
|
421
|
+
builder, or replace the resulting ability. Restrictions take precedence over
|
|
422
|
+
business grants. The frontend consumes the final serialized rules.
|
|
423
|
+
|
|
424
|
+
`api-key:read/create/update/delete` are now built-in permissions in both scopes.
|
|
425
|
+
User administrators and workspace owners inherit them; ordinary users and
|
|
426
|
+
workspace administrators require explicit role or direct grants. Existing
|
|
427
|
+
ownership checks and self-service operations remain enforced by Services.
|
|
428
|
+
|
|
429
|
+
The `userRoles` and `workspaceRoles` queries return `{ role, grantable }` objects;
|
|
430
|
+
`userPermissions` and `workspacePermissions` return `{ permission, grantable }`.
|
|
431
|
+
`userApiKeyPermissions` and `workspaceApiKeyPermissions` also return
|
|
432
|
+
`{ permission, grantable }` entries, constrained by the API-key allowlist and the
|
|
433
|
+
issuer's grant ceiling. Workspace keys cannot grant `invitation:create`.
|
|
434
|
+
|
|
435
|
+
Module permission catalogs and role maps extend built-in defaults. Same-name
|
|
436
|
+
role grants are merged; custom permissions are not automatically granted to
|
|
437
|
+
built-in roles. Empty additions preserve defaults. Entity `set*` mutations still
|
|
438
|
+
replace stored roles or direct permissions; API-key `allowedPermissions` remains
|
|
439
|
+
an explicit ceiling.
|
|
440
|
+
|
|
441
|
+
Role and permission values remain GraphQL enums. These catalogs retain all configured
|
|
442
|
+
options and mark the current principal's grant ceiling, including API-key restrictions.
|
|
443
|
+
They do not authorize changes to a particular target. Disable unavailable new grants
|
|
444
|
+
in the UI and validate complete replacement lists; mutation Services still enforce
|
|
445
|
+
target-specific abilities. `workspaceAssignableRoles` has been removed.
|
|
446
|
+
`UserService` and `MemberService` expose these same option shapes through
|
|
447
|
+
`listRoles()` and `listPermissions()`, using configured string values internally.
|
|
448
|
+
The previous `AuthRole { name, permissions }` catalog shape is no longer exposed.
|
|
449
|
+
|
|
450
|
+
`createUser`, `updateUser`, `setUserRoles`, `setUserPermissions`, `banUser`, and
|
|
451
|
+
`unbanUser` return operation-specific payloads containing only `id`. Refetch
|
|
452
|
+
authorized user fields separately after success instead of selecting self-only
|
|
453
|
+
relations on an administrative mutation result.
|
|
454
|
+
`acceptInvitation` returns `AcceptInvitationPayload { id, memberId, workspaceId }`,
|
|
455
|
+
without inviter/profile relations. Select that workspace in the next request
|
|
456
|
+
before querying membership details. Domain Services still return entities and
|
|
457
|
+
retain their authorization checks.
|
|
458
|
+
|
|
459
|
+
Resolvers pass resource IDs and inputs to Services, which enforce abilities,
|
|
460
|
+
resource ownership, current-workspace restrictions and lifecycle invariants
|
|
461
|
+
using request context as needed. Ordinary writes also retain database RLS;
|
|
462
|
+
removing actor arguments does not remove Service authorization.
|
|
463
|
+
|
|
464
|
+
`updateWorkspace(id: ID!, input: UpdateWorkspaceInput!)`,
|
|
465
|
+
and `deleteWorkspace(id: ID!)`
|
|
466
|
+
now require an explicit workspace ID, which must match the selected workspace.
|
|
467
|
+
User management mutation names and inputs are unchanged; see the naming migration below for workspace API keys.
|
|
468
|
+
API-key update/delete Service methods no longer take user/workspace arguments.
|
|
469
|
+
|
|
470
|
+
`createWorkspace` returns `CreateWorkspacePayload { id: ID! }` and
|
|
471
|
+
`deleteWorkspace` returns `DeleteWorkspacePayload { id: ID! }`, not `Workspace`.
|
|
472
|
+
These payloads expose no entity or relation fields. Creation does not change the
|
|
473
|
+
current request's workspace, abilities, or RLS context; select the returned ID
|
|
474
|
+
in a subsequent request to query the new workspace. Deletion returns only its ID
|
|
475
|
+
without querying relations of a now-hidden workspace. `updateWorkspace`, member
|
|
476
|
+
create/update/role/permission mutations, and invitation create/reject/cancel
|
|
477
|
+
mutations also return dedicated ID-only payloads. Query the affected resource
|
|
478
|
+
separately with the caller's read permissions.
|
|
479
|
+
Clients must remove selections such as `name` or `members` from
|
|
480
|
+
these mutation results and regenerate their GraphQL types.
|
|
481
|
+
|
|
482
|
+
`deleteUser` and `removeMember` likewise return `DeleteUserPayload` and
|
|
483
|
+
`RemoveMemberPayload`, each containing only `id: ID!`. `leaveWorkspace` returns
|
|
484
|
+
`LeaveWorkspacePayload { memberId: ID! }`, identifying the removed member, not
|
|
485
|
+
the workspace. Service return values and authorization are unchanged.
|
|
486
|
+
Remove entity-field selections from these mutation results. When evicting a
|
|
487
|
+
normalized client cache entry, use the original entity type (`User` or `Member`)
|
|
488
|
+
with the returned ID, not the payload's `__typename`.
|
|
489
|
+
|
|
490
|
+
### Authentication operation naming
|
|
491
|
+
|
|
492
|
+
Authentication operations no longer use the `auth` prefix. Current-user actions
|
|
493
|
+
explicitly include `CurrentUser`; administrative actions do not use an `admin`
|
|
494
|
+
prefix. Old operation names are removed, not retained as aliases.
|
|
495
|
+
|
|
496
|
+
| Previous operation | Current operation |
|
|
497
|
+
| --------------------------- | -------------------------------- |
|
|
498
|
+
| `authSocialProviders` | `socialProviders` |
|
|
499
|
+
| `authSignUp` | `signUp` |
|
|
500
|
+
| `authSignIn` | `signIn` |
|
|
501
|
+
| `authSignInSocial` | `signInSocial` |
|
|
502
|
+
| `authSignOut` | `signOut` |
|
|
503
|
+
| `authSendVerificationEmail` | `sendVerificationEmail` |
|
|
504
|
+
| `authRequestPasswordReset` | `requestPasswordReset` |
|
|
505
|
+
| `authResetPassword` | `resetPassword` |
|
|
506
|
+
| `authUpdateUser` | `updateCurrentUser` |
|
|
507
|
+
| `authDeleteUser` | `deleteCurrentUser` |
|
|
508
|
+
| `authChangeEmail` | `changeCurrentUserEmail` |
|
|
509
|
+
| `authChangePassword` | `changeCurrentUserPassword` |
|
|
510
|
+
| `authSetPassword` | `setCurrentUserPassword` |
|
|
511
|
+
| `authLinkSocialAccount` | `linkCurrentUserAccount` |
|
|
512
|
+
| `authUnlinkAccount` | `unlinkCurrentUserAccount` |
|
|
513
|
+
| `authRevokeSession` | `revokeCurrentUserSession` |
|
|
514
|
+
| `authRevokeSessions` | `revokeCurrentUserSessions` |
|
|
515
|
+
| `authRevokeOtherSessions` | `revokeCurrentUserOtherSessions` |
|
|
516
|
+
| `revokeUserSession` | `revokeSession` |
|
|
517
|
+
|
|
518
|
+
`revokeUserSessions(userId)` remains the administrative bulk operation.
|
|
519
|
+
Input/output type names, arguments, authorization, and behavior are unchanged
|
|
520
|
+
by this naming change. In particular, `AuthChangePasswordInput.revokeOtherSessions`
|
|
521
|
+
remains a password-change option. Update client documents and regenerate types.
|
|
522
|
+
|
|
523
|
+
### Target argument naming
|
|
524
|
+
|
|
525
|
+
GraphQL arguments identifying the operation's target use `id: ID!`:
|
|
526
|
+
`acceptInvitation(id)`, `rejectInvitation(id)`, `cancelInvitation(id)`,
|
|
527
|
+
`revokeCurrentUserSession(id)`, `unlinkCurrentUserAccount(id)`, and
|
|
528
|
+
`revokeSession(userId, id)`. The exported `UserIdInput` also uses `id`, not
|
|
529
|
+
`userId`. The old argument names are not retained as aliases. Service signatures
|
|
530
|
+
are unchanged, including the account-unlinking adapter's `accountId` property.
|
|
531
|
+
Related identifiers remain explicit: `revokeSession.userId` checks ownership,
|
|
532
|
+
`revokeUserSessions.userId` selects whose sessions to revoke.
|
|
533
|
+
Workspace owner roles use `setMemberRoles(id, input)` like other roles; multiple
|
|
534
|
+
owners are allowed, with ability and permission-grant checks enforced by the Service.
|
|
535
|
+
|
|
536
|
+
Apply `Initial → generated schema migrations` to the example database.
|
|
537
|
+
Custom applications need equivalent write policies and atomic user-dependent
|
|
538
|
+
cleanup, as described in the auth package's scoped management writes section.
|
|
539
|
+
|
|
540
|
+
User/session administration, invitation cancellation/rejection pass target IDs to Services instead of fetching targets in Resolvers.
|
|
541
|
+
Services enforce the operation's own permissions; a separate read-operation
|
|
542
|
+
permission is not required merely to invoke a mutation.
|
|
543
|
+
|
|
544
|
+
Impersonation mutations delegate to `AuthService.impersonateUser(id)` and
|
|
545
|
+
`stopImpersonating()`. They refresh request identity, abilities and native RLS
|
|
546
|
+
before nested fields resolve, in addition to updating browser cookies.
|
|
547
|
+
|
|
548
|
+
Domain Services use injected `this.em` throughout. `AuthModule` infrastructure
|
|
549
|
+
owns special authentication/lifecycle contexts; ordinary operations retain
|
|
550
|
+
Service checks and request RLS. The fresh-database
|
|
551
|
+
`Initial → generated schema migrations` includes grants for RLS-scoped API-key creation
|
|
552
|
+
and usage tracking.
|
|
553
|
+
|
|
554
|
+
## Operation naming migration
|
|
555
|
+
|
|
556
|
+
This is a breaking schema change; no deprecated aliases are retained:
|
|
557
|
+
|
|
558
|
+
| Removed name | Replacement |
|
|
559
|
+
| -------------------- | ----------------------- |
|
|
560
|
+
| `createApiKey` | `createWorkspaceApiKey` |
|
|
561
|
+
| `updateApiKey` | `updateWorkspaceApiKey` |
|
|
562
|
+
| `deleteApiKey` | `deleteWorkspaceApiKey` |
|
|
563
|
+
| `currentAuthSession` | `currentSession` |
|
|
564
|
+
| `removeWorkspace` | `deleteWorkspace` |
|
|
565
|
+
|
|
566
|
+
API-key entities, services, resolvers, connections, inputs, and creation results are split into `UserApiKey` and `WorkspaceApiKey` variants. Use `CreateUserApiKeyInput`, `UpdateUserApiKeyInput`, `CreateUserApiKeyResult`, and their `Workspace` counterparts. Permissions use separate `UserApiKeyPermission` and `WorkspaceApiKeyPermission` GraphQL enums; stored values stay unchanged.
|
|
567
|
+
|
|
568
|
+
API-key enums cover the full scope catalogs, independently of the current grant
|
|
569
|
+
allowlist, so existing keys remain readable after the allowlist is tightened.
|
|
570
|
+
Workspace keys cannot be granted `invitation:create`: invitations require a user
|
|
571
|
+
as sender. Use a personal API key for invitation creation.
|
|
572
|
+
|
|
573
|
+
Update operation documents, ability subject mappings, and generated client types together. The example preserves `Migration00000000000000_Initial` and regenerates the entity baseline with two tables. Recreate development databases before applying this baseline; existing databases require a separate data-preserving upgrade migration.
|
|
574
|
+
|
|
575
|
+
Authentication and successful-use tracking are internal infrastructure responsibilities. Credential lookup checks both tables and rejects ambiguous matches. `@CurrentApiKey()` returns the `ApiKey` union type, not an ORM entity class.
|
|
576
|
+
|
|
577
|
+
## Removed collection APIs
|
|
578
|
+
|
|
579
|
+
`UserService.listUsers`, `SessionService.listUserSessions`, and
|
|
580
|
+
`WorkspaceService.getFullWorkspace` have been removed without aliases, along with
|
|
581
|
+
`ListUsersOptions`, `ListUsersResult`, and `FullWorkspace`. Use
|
|
582
|
+
`getUserConnection`, `getSessionConnectionByUser`, and the member/invitation
|
|
583
|
+
connection methods instead. `listCurrentUserSessions` remains an internal
|
|
584
|
+
credential-hydration helper for session revocation, not a GraphQL listing API.
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Ability, type AbilityOptions, type AbilityTuple, type MongoQuery, type RawRuleFrom } from "@casl/ability";
|
|
2
|
+
/** CASL ability containing user-scoped authorization rules. */
|
|
2
3
|
export declare class UserAbility extends Ability<AbilityTuple, MongoQuery> {
|
|
4
|
+
/** Keeps user and workspace abilities nominally distinct. */
|
|
3
5
|
private readonly userAbilityBrand;
|
|
6
|
+
/** Creates a user ability with CASL's Mongo-style condition matching. */
|
|
4
7
|
constructor(rules?: RawRuleFrom<AbilityTuple, MongoQuery>[], options?: AbilityOptions<AbilityTuple, MongoQuery>);
|
|
5
8
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Ability, fieldPatternMatcher, mongoQueryMatcher, } from "@casl/ability";
|
|
2
|
+
/** CASL ability containing user-scoped authorization rules. */
|
|
2
3
|
export class UserAbility extends Ability {
|
|
4
|
+
/** Creates a user ability with CASL's Mongo-style condition matching. */
|
|
3
5
|
constructor(rules = [], options = {}) {
|
|
4
6
|
super(rules, {
|
|
5
7
|
conditionsMatcher: mongoQueryMatcher,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.ability.js","sourceRoot":"","sources":["../../src/abilities/user.ability.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAGP,mBAAmB,EAEnB,iBAAiB,GAElB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"user.ability.js","sourceRoot":"","sources":["../../src/abilities/user.ability.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAGP,mBAAmB,EAEnB,iBAAiB,GAElB,MAAM,eAAe,CAAC;AAEvB,+DAA+D;AAC/D,MAAM,OAAO,WAAY,SAAQ,OAAiC;IAIhE,yEAAyE;IACzE,YACE,QAAiD,EAAE,EACnD,UAAoD,EAAE;QAEtD,KAAK,CAAC,KAAK,EAAE;YACX,iBAAiB,EAAE,iBAAiB;YACpC,YAAY,EAAE,mBAAmB;YACjC,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Ability, type AbilityOptions, type AbilityTuple, type MongoQuery, type RawRuleFrom } from "@casl/ability";
|
|
2
|
+
/** CASL ability containing workspace-scoped authorization rules. */
|
|
2
3
|
export declare class WorkspaceAbility extends Ability<AbilityTuple, MongoQuery> {
|
|
4
|
+
/** Keeps workspace and user abilities nominally distinct. */
|
|
3
5
|
private readonly workspaceAbilityBrand;
|
|
6
|
+
/** Creates a workspace ability with CASL's Mongo-style condition matching. */
|
|
4
7
|
constructor(rules?: RawRuleFrom<AbilityTuple, MongoQuery>[], options?: AbilityOptions<AbilityTuple, MongoQuery>);
|
|
5
8
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Ability, fieldPatternMatcher, mongoQueryMatcher, } from "@casl/ability";
|
|
2
|
+
/** CASL ability containing workspace-scoped authorization rules. */
|
|
2
3
|
export class WorkspaceAbility extends Ability {
|
|
4
|
+
/** Creates a workspace ability with CASL's Mongo-style condition matching. */
|
|
3
5
|
constructor(rules = [], options = {}) {
|
|
4
6
|
super(rules, {
|
|
5
7
|
conditionsMatcher: mongoQueryMatcher,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.ability.js","sourceRoot":"","sources":["../../src/abilities/workspace.ability.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAGP,mBAAmB,EAEnB,iBAAiB,GAElB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"workspace.ability.js","sourceRoot":"","sources":["../../src/abilities/workspace.ability.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAGP,mBAAmB,EAEnB,iBAAiB,GAElB,MAAM,eAAe,CAAC;AAEvB,oEAAoE;AACpE,MAAM,OAAO,gBAAiB,SAAQ,OAAiC;IAIrE,8EAA8E;IAC9E,YACE,QAAiD,EAAE,EACnD,UAAoD,EAAE;QAEtD,KAAK,CAAC,KAAK,EAAE;YACX,iBAAiB,EAAE,iBAAiB;YACpC,YAAY,EAAE,mBAAmB;YACjC,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter-config.js","sourceRoot":"","sources":["../../../src/adapters/mikro-orm/adapter-config.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,2BAA2B,CACzC,SAA8C;IAE9C,OAAO;QACL,SAAS,EAAE,mBAAmB;QAC9B,WAAW,EAAE,kBAAkB;QAC/B,SAAS,EAAE,SAAS,IAAI,KAAK;QAC7B,mBAAmB,EAAE,IAAI;QACzB,cAAc,EAAE,IAAI;QACpB,gBAAgB,EAAE,IAAI;QACtB,aAAa,EAAE,IAAI;QACnB,YAAY,EAAE,IAAI;
|
|
1
|
+
{"version":3,"file":"adapter-config.js","sourceRoot":"","sources":["../../../src/adapters/mikro-orm/adapter-config.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,2BAA2B,CACzC,SAA8C;IAE9C,OAAO;QACL,SAAS,EAAE,mBAAmB;QAC9B,WAAW,EAAE,kBAAkB;QAC/B,SAAS,EAAE,SAAS,IAAI,KAAK;QAC7B,mBAAmB,EAAE,IAAI;QACzB,cAAc,EAAE,IAAI;QACpB,gBAAgB,EAAE,IAAI;QACtB,aAAa,EAAE,IAAI;QACnB,YAAY,EAAE,IAAI;QAClB,yEAAyE;QACzE,kBAAkB,EAAE,KAAK;QACzB,SAAS,EAAE,KAAK;KACR,CAAC;AACb,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { type EntityManager } from "@mikro-orm/core";
|
|
2
2
|
import type { AdapterFactoryCustomizeAdapterCreator } from "better-auth/adapters";
|
|
3
|
-
import
|
|
3
|
+
import { authEntityMap } from "../../entities/auth-entity-map.js";
|
|
4
4
|
export interface CreateCustomAdapterOptions {
|
|
5
|
+
/** Role applied to user entities when Better Auth omits one. */
|
|
5
6
|
defaultUserRole?: string;
|
|
6
7
|
em: EntityManager;
|
|
7
|
-
entities:
|
|
8
|
+
entities: typeof authEntityMap;
|
|
8
9
|
inTransaction?: boolean;
|
|
9
10
|
}
|
|
10
11
|
export declare function createMikroOrmCustomAdapter({ defaultUserRole, em, entities, inTransaction, }: CreateCustomAdapterOptions): AdapterFactoryCustomizeAdapterCreator;
|