@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
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
import { Args, ID, Mutation, Parent, Query, ResolveField, Resolver, } from "@nest-boot/graphql";
|
|
14
|
+
import { CurrentWorkspace } from "../decorators/current-workspace.decorator.js";
|
|
15
|
+
import { Member } from "../entities/member.entity.js";
|
|
16
|
+
import { User } from "../entities/user.entity.js";
|
|
17
|
+
import { Workspace } from "../entities/workspace.entity.js";
|
|
18
|
+
import { AddMemberInput } from "../inputs/add-member.input.js";
|
|
19
|
+
import { SetMemberPermissionsInput } from "../inputs/set-member-permissions.input.js";
|
|
20
|
+
import { SetMemberRolesInput } from "../inputs/set-member-roles.input.js";
|
|
21
|
+
import { UpdateMemberInput } from "../inputs/update-member.input.js";
|
|
22
|
+
import { AddMemberPayload } from "../objects/add-member-payload.object.js";
|
|
23
|
+
import { RemoveMemberPayload } from "../objects/remove-member-payload.object.js";
|
|
24
|
+
import { SetMemberPermissionsPayload } from "../objects/set-member-permissions-payload.object.js";
|
|
25
|
+
import { SetMemberRolesPayload } from "../objects/set-member-roles-payload.object.js";
|
|
26
|
+
import { UpdateMemberPayload } from "../objects/update-member-payload.object.js";
|
|
27
|
+
import { WorkspacePermissionOption } from "../objects/workspace-permission-option.object.js";
|
|
28
|
+
import { WorkspaceRoleOption } from "../objects/workspace-role-option.object.js";
|
|
29
|
+
import { MemberService } from "../services/member.service.js";
|
|
30
|
+
/** GraphQL resolver for workspace members. */
|
|
31
|
+
let MemberResolver = class MemberResolver {
|
|
32
|
+
memberService;
|
|
33
|
+
/**
|
|
34
|
+
* Creates the workspace member resolver.
|
|
35
|
+
*
|
|
36
|
+
*/
|
|
37
|
+
constructor(
|
|
38
|
+
/** Auth-owned workspace role and permission operations. */
|
|
39
|
+
memberService) {
|
|
40
|
+
this.memberService = memberService;
|
|
41
|
+
}
|
|
42
|
+
/** Resolves the user associated with a workspace member. */
|
|
43
|
+
async user(member) {
|
|
44
|
+
return await this.memberService.getMemberUser(member);
|
|
45
|
+
}
|
|
46
|
+
/** Lists configured workspace roles with the current principal's grant availability. */
|
|
47
|
+
workspaceRoles() {
|
|
48
|
+
return this.memberService.listRoles();
|
|
49
|
+
}
|
|
50
|
+
/** Lists configured workspace permissions with the current principal's grant availability. */
|
|
51
|
+
workspacePermissions() {
|
|
52
|
+
return this.memberService.listPermissions();
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Returns the workspace member selected for the current request.
|
|
56
|
+
*
|
|
57
|
+
* @returns Current workspace member, or null when no member was resolved.
|
|
58
|
+
*/
|
|
59
|
+
currentMember() {
|
|
60
|
+
return this.memberService.getCurrentMember();
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Returns a workspace member by ID.
|
|
64
|
+
*
|
|
65
|
+
* @param id - Workspace member ID.
|
|
66
|
+
* @returns Matching workspace member, or null when not found.
|
|
67
|
+
*/
|
|
68
|
+
async member(id) {
|
|
69
|
+
return await this.memberService.getMember(id);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Adds an existing user to the workspace by email.
|
|
73
|
+
*
|
|
74
|
+
* @param workspace - Current workspace.
|
|
75
|
+
* @param input - Input for adding a member.
|
|
76
|
+
* @returns Newly created member identifier.
|
|
77
|
+
*/
|
|
78
|
+
async addMember(workspace, input) {
|
|
79
|
+
const member = await this.memberService.addMemberByEmail(workspace, input.email);
|
|
80
|
+
return { id: member.id };
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Updates workspace member details.
|
|
84
|
+
*
|
|
85
|
+
* @param id - ID of the workspace member to update.
|
|
86
|
+
* @param input - Member update input.
|
|
87
|
+
* @returns Updated member identifier.
|
|
88
|
+
*/
|
|
89
|
+
async updateMember(id, input) {
|
|
90
|
+
const member = await this.memberService.updateMember(id, input);
|
|
91
|
+
return member ? { id: member.id } : null;
|
|
92
|
+
}
|
|
93
|
+
/** Replaces roles assigned to a workspace member. */
|
|
94
|
+
async setMemberRoles(id, input) {
|
|
95
|
+
const member = await this.memberService.setMemberRoles(id, input.roles);
|
|
96
|
+
return { id: member.id };
|
|
97
|
+
}
|
|
98
|
+
/** Replaces direct permissions assigned to a workspace member. */
|
|
99
|
+
async setMemberPermissions(id, input) {
|
|
100
|
+
const member = await this.memberService.setMemberPermissions(id, input.permissions);
|
|
101
|
+
return { id: member.id };
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Removes a workspace member.
|
|
105
|
+
*
|
|
106
|
+
* @param id - ID of the workspace member to remove.
|
|
107
|
+
* @returns Identifier of the removed workspace member.
|
|
108
|
+
*/
|
|
109
|
+
async removeMember(id) {
|
|
110
|
+
const member = await this.memberService.removeMember(id);
|
|
111
|
+
return { id: member.id };
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
__decorate([
|
|
115
|
+
ResolveField(() => User, { nullable: true }),
|
|
116
|
+
__param(0, Parent()),
|
|
117
|
+
__metadata("design:type", Function),
|
|
118
|
+
__metadata("design:paramtypes", [Member]),
|
|
119
|
+
__metadata("design:returntype", Promise)
|
|
120
|
+
], MemberResolver.prototype, "user", null);
|
|
121
|
+
__decorate([
|
|
122
|
+
Query(() => [WorkspaceRoleOption]),
|
|
123
|
+
__metadata("design:type", Function),
|
|
124
|
+
__metadata("design:paramtypes", []),
|
|
125
|
+
__metadata("design:returntype", Array)
|
|
126
|
+
], MemberResolver.prototype, "workspaceRoles", null);
|
|
127
|
+
__decorate([
|
|
128
|
+
Query(() => [WorkspacePermissionOption]),
|
|
129
|
+
__metadata("design:type", Function),
|
|
130
|
+
__metadata("design:paramtypes", []),
|
|
131
|
+
__metadata("design:returntype", Array)
|
|
132
|
+
], MemberResolver.prototype, "workspacePermissions", null);
|
|
133
|
+
__decorate([
|
|
134
|
+
Query(() => Member, { nullable: true }),
|
|
135
|
+
__metadata("design:type", Function),
|
|
136
|
+
__metadata("design:paramtypes", []),
|
|
137
|
+
__metadata("design:returntype", Object)
|
|
138
|
+
], MemberResolver.prototype, "currentMember", null);
|
|
139
|
+
__decorate([
|
|
140
|
+
Query(() => Member, { nullable: true }),
|
|
141
|
+
__param(0, Args("id", { type: () => ID })),
|
|
142
|
+
__metadata("design:type", Function),
|
|
143
|
+
__metadata("design:paramtypes", [String]),
|
|
144
|
+
__metadata("design:returntype", Promise)
|
|
145
|
+
], MemberResolver.prototype, "member", null);
|
|
146
|
+
__decorate([
|
|
147
|
+
Mutation(() => AddMemberPayload),
|
|
148
|
+
__param(0, CurrentWorkspace()),
|
|
149
|
+
__param(1, Args("input")),
|
|
150
|
+
__metadata("design:type", Function),
|
|
151
|
+
__metadata("design:paramtypes", [Workspace,
|
|
152
|
+
AddMemberInput]),
|
|
153
|
+
__metadata("design:returntype", Promise)
|
|
154
|
+
], MemberResolver.prototype, "addMember", null);
|
|
155
|
+
__decorate([
|
|
156
|
+
Mutation(() => UpdateMemberPayload, { nullable: true }),
|
|
157
|
+
__param(0, Args("id", { type: () => ID })),
|
|
158
|
+
__param(1, Args("input")),
|
|
159
|
+
__metadata("design:type", Function),
|
|
160
|
+
__metadata("design:paramtypes", [String, UpdateMemberInput]),
|
|
161
|
+
__metadata("design:returntype", Promise)
|
|
162
|
+
], MemberResolver.prototype, "updateMember", null);
|
|
163
|
+
__decorate([
|
|
164
|
+
Mutation(() => SetMemberRolesPayload),
|
|
165
|
+
__param(0, Args("id", { type: () => ID })),
|
|
166
|
+
__param(1, Args("input")),
|
|
167
|
+
__metadata("design:type", Function),
|
|
168
|
+
__metadata("design:paramtypes", [String, SetMemberRolesInput]),
|
|
169
|
+
__metadata("design:returntype", Promise)
|
|
170
|
+
], MemberResolver.prototype, "setMemberRoles", null);
|
|
171
|
+
__decorate([
|
|
172
|
+
Mutation(() => SetMemberPermissionsPayload),
|
|
173
|
+
__param(0, Args("id", { type: () => ID })),
|
|
174
|
+
__param(1, Args("input")),
|
|
175
|
+
__metadata("design:type", Function),
|
|
176
|
+
__metadata("design:paramtypes", [String, SetMemberPermissionsInput]),
|
|
177
|
+
__metadata("design:returntype", Promise)
|
|
178
|
+
], MemberResolver.prototype, "setMemberPermissions", null);
|
|
179
|
+
__decorate([
|
|
180
|
+
Mutation(() => RemoveMemberPayload),
|
|
181
|
+
__param(0, Args("id", { type: () => ID })),
|
|
182
|
+
__metadata("design:type", Function),
|
|
183
|
+
__metadata("design:paramtypes", [String]),
|
|
184
|
+
__metadata("design:returntype", Promise)
|
|
185
|
+
], MemberResolver.prototype, "removeMember", null);
|
|
186
|
+
MemberResolver = __decorate([
|
|
187
|
+
Resolver(() => Member),
|
|
188
|
+
__metadata("design:paramtypes", [MemberService])
|
|
189
|
+
], MemberResolver);
|
|
190
|
+
export { MemberResolver };
|
|
191
|
+
//# sourceMappingURL=member.resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"member.resolver.js","sourceRoot":"","sources":["../../src/resolvers/member.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EACL,IAAI,EACJ,EAAE,EACF,QAAQ,EACR,MAAM,EACN,KAAK,EACL,YAAY,EACZ,QAAQ,GACT,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,yBAAyB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EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;IAC9B,WAAA,IAAI,CAAC,OAAO,CAAC,CAAA;;6CAAQ,mBAAmB;;oDAI1C;AAIK;IADL,QAAQ,CAAC,GAAG,EAAE,CAAC,2BAA2B,CAAC;IAEzC,WAAA,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;IAC9B,WAAA,IAAI,CAAC,OAAO,CAAC,CAAA;;6CAAQ,yBAAyB;;0DAOhD;AASK;IADL,QAAQ,CAAC,GAAG,EAAE,CAAC,mBAAmB,CAAC;IAEjC,WAAA,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;;;;kDAIhC;AAzHU,cAAc;IAD1B,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;qCAQK,aAAa;GAP5B,cAAc,CA0H1B"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Session } from "../entities/session.entity.js";
|
|
2
|
+
import { User } from "../entities/user.entity.js";
|
|
3
|
+
import { AuthService } from "../services/auth.service.js";
|
|
4
|
+
import { SessionService } from "../services/session.service.js";
|
|
5
|
+
/** GraphQL transport for session inspection, revocation and impersonation. */
|
|
6
|
+
export declare class SessionResolver {
|
|
7
|
+
private readonly sessionService;
|
|
8
|
+
private readonly authService;
|
|
9
|
+
/** Creates the session-management resolver. */
|
|
10
|
+
constructor(sessionService: SessionService, authService: AuthService);
|
|
11
|
+
/** Returns the session represented by the current request. */
|
|
12
|
+
currentSession(currentSession: Session | null): Session | null;
|
|
13
|
+
/** Whether the parent session is making the current request. */
|
|
14
|
+
current(session: Session, currentSession: Session | null): boolean;
|
|
15
|
+
/** Administrator that started the parent impersonation session. */
|
|
16
|
+
impersonatedById(session: Session): string | null;
|
|
17
|
+
/** Resolves the administrator after Service-level profile authorization. */
|
|
18
|
+
impersonatedBy(session: Session): Promise<User | null>;
|
|
19
|
+
/** Revokes one active session owned by the authenticated user. */
|
|
20
|
+
revokeCurrentUserSession(id: string): Promise<boolean>;
|
|
21
|
+
/** Revokes every active session except the current session. */
|
|
22
|
+
revokeCurrentUserOtherSessions(): Promise<boolean>;
|
|
23
|
+
/** Revokes every active session owned by the authenticated user. */
|
|
24
|
+
revokeCurrentUserSessions(): Promise<boolean>;
|
|
25
|
+
/** Revokes one user session by its public ID. */
|
|
26
|
+
revokeSession(userId: string, id: string): Promise<boolean>;
|
|
27
|
+
/** Revokes all sessions belonging to a user. */
|
|
28
|
+
revokeUserSessions(userId: string): Promise<boolean>;
|
|
29
|
+
/** Starts a browser session that acts as another user. */
|
|
30
|
+
impersonateUser(id: string): Promise<User>;
|
|
31
|
+
/** Restores the administrator session that started impersonation. */
|
|
32
|
+
stopImpersonating(): Promise<User | null>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
import { Args, ID, Mutation, Parent, Query, ResolveField, Resolver, } from "@nest-boot/graphql";
|
|
14
|
+
import { CurrentSession } from "../decorators/current-session.decorator.js";
|
|
15
|
+
import { Session } from "../entities/session.entity.js";
|
|
16
|
+
import { User } from "../entities/user.entity.js";
|
|
17
|
+
import { AuthService } from "../services/auth.service.js";
|
|
18
|
+
import { SessionService } from "../services/session.service.js";
|
|
19
|
+
/** GraphQL transport for session inspection, revocation and impersonation. */
|
|
20
|
+
let SessionResolver = class SessionResolver {
|
|
21
|
+
sessionService;
|
|
22
|
+
authService;
|
|
23
|
+
/** Creates the session-management resolver. */
|
|
24
|
+
constructor(sessionService, authService) {
|
|
25
|
+
this.sessionService = sessionService;
|
|
26
|
+
this.authService = authService;
|
|
27
|
+
}
|
|
28
|
+
/** Returns the session represented by the current request. */
|
|
29
|
+
currentSession(currentSession) {
|
|
30
|
+
return currentSession;
|
|
31
|
+
}
|
|
32
|
+
/** Whether the parent session is making the current request. */
|
|
33
|
+
current(session, currentSession) {
|
|
34
|
+
return session.id === currentSession?.id;
|
|
35
|
+
}
|
|
36
|
+
/** Administrator that started the parent impersonation session. */
|
|
37
|
+
impersonatedById(session) {
|
|
38
|
+
return session.impersonatedBy ? String(session.impersonatedBy.id) : null;
|
|
39
|
+
}
|
|
40
|
+
/** Resolves the administrator after Service-level profile authorization. */
|
|
41
|
+
async impersonatedBy(session) {
|
|
42
|
+
return await this.sessionService.getSessionImpersonator(session);
|
|
43
|
+
}
|
|
44
|
+
/** Revokes one active session owned by the authenticated user. */
|
|
45
|
+
async revokeCurrentUserSession(id) {
|
|
46
|
+
return await this.sessionService.revokeCurrentUserSession(id);
|
|
47
|
+
}
|
|
48
|
+
/** Revokes every active session except the current session. */
|
|
49
|
+
async revokeCurrentUserOtherSessions() {
|
|
50
|
+
return await this.sessionService.revokeCurrentUserOtherSessions();
|
|
51
|
+
}
|
|
52
|
+
/** Revokes every active session owned by the authenticated user. */
|
|
53
|
+
async revokeCurrentUserSessions() {
|
|
54
|
+
return await this.sessionService.revokeCurrentUserSessions();
|
|
55
|
+
}
|
|
56
|
+
/** Revokes one user session by its public ID. */
|
|
57
|
+
async revokeSession(userId, id) {
|
|
58
|
+
return await this.sessionService.revokeSession(userId, id);
|
|
59
|
+
}
|
|
60
|
+
/** Revokes all sessions belonging to a user. */
|
|
61
|
+
async revokeUserSessions(userId) {
|
|
62
|
+
await this.sessionService.revokeUserSessions(userId);
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
/** Starts a browser session that acts as another user. */
|
|
66
|
+
async impersonateUser(id) {
|
|
67
|
+
return await this.authService.impersonateUser(id);
|
|
68
|
+
}
|
|
69
|
+
/** Restores the administrator session that started impersonation. */
|
|
70
|
+
async stopImpersonating() {
|
|
71
|
+
return await this.authService.stopImpersonating();
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
__decorate([
|
|
75
|
+
Query(() => Session, { nullable: true }),
|
|
76
|
+
__param(0, CurrentSession()),
|
|
77
|
+
__metadata("design:type", Function),
|
|
78
|
+
__metadata("design:paramtypes", [Object]),
|
|
79
|
+
__metadata("design:returntype", Object)
|
|
80
|
+
], SessionResolver.prototype, "currentSession", null);
|
|
81
|
+
__decorate([
|
|
82
|
+
ResolveField(() => Boolean),
|
|
83
|
+
__param(0, Parent()),
|
|
84
|
+
__param(1, CurrentSession()),
|
|
85
|
+
__metadata("design:type", Function),
|
|
86
|
+
__metadata("design:paramtypes", [Session, Object]),
|
|
87
|
+
__metadata("design:returntype", Boolean)
|
|
88
|
+
], SessionResolver.prototype, "current", null);
|
|
89
|
+
__decorate([
|
|
90
|
+
ResolveField(() => ID, { nullable: true }),
|
|
91
|
+
__param(0, Parent()),
|
|
92
|
+
__metadata("design:type", Function),
|
|
93
|
+
__metadata("design:paramtypes", [Session]),
|
|
94
|
+
__metadata("design:returntype", Object)
|
|
95
|
+
], SessionResolver.prototype, "impersonatedById", null);
|
|
96
|
+
__decorate([
|
|
97
|
+
ResolveField(() => User, { nullable: true }),
|
|
98
|
+
__param(0, Parent()),
|
|
99
|
+
__metadata("design:type", Function),
|
|
100
|
+
__metadata("design:paramtypes", [Session]),
|
|
101
|
+
__metadata("design:returntype", Promise)
|
|
102
|
+
], SessionResolver.prototype, "impersonatedBy", null);
|
|
103
|
+
__decorate([
|
|
104
|
+
Mutation(() => Boolean),
|
|
105
|
+
__param(0, Args("id", { type: () => ID })),
|
|
106
|
+
__metadata("design:type", Function),
|
|
107
|
+
__metadata("design:paramtypes", [String]),
|
|
108
|
+
__metadata("design:returntype", Promise)
|
|
109
|
+
], SessionResolver.prototype, "revokeCurrentUserSession", null);
|
|
110
|
+
__decorate([
|
|
111
|
+
Mutation(() => Boolean),
|
|
112
|
+
__metadata("design:type", Function),
|
|
113
|
+
__metadata("design:paramtypes", []),
|
|
114
|
+
__metadata("design:returntype", Promise)
|
|
115
|
+
], SessionResolver.prototype, "revokeCurrentUserOtherSessions", null);
|
|
116
|
+
__decorate([
|
|
117
|
+
Mutation(() => Boolean),
|
|
118
|
+
__metadata("design:type", Function),
|
|
119
|
+
__metadata("design:paramtypes", []),
|
|
120
|
+
__metadata("design:returntype", Promise)
|
|
121
|
+
], SessionResolver.prototype, "revokeCurrentUserSessions", null);
|
|
122
|
+
__decorate([
|
|
123
|
+
Mutation(() => Boolean),
|
|
124
|
+
__param(0, Args("userId", { type: () => ID })),
|
|
125
|
+
__param(1, Args("id", { type: () => ID })),
|
|
126
|
+
__metadata("design:type", Function),
|
|
127
|
+
__metadata("design:paramtypes", [String, String]),
|
|
128
|
+
__metadata("design:returntype", Promise)
|
|
129
|
+
], SessionResolver.prototype, "revokeSession", null);
|
|
130
|
+
__decorate([
|
|
131
|
+
Mutation(() => Boolean),
|
|
132
|
+
__param(0, Args("userId", { type: () => ID })),
|
|
133
|
+
__metadata("design:type", Function),
|
|
134
|
+
__metadata("design:paramtypes", [String]),
|
|
135
|
+
__metadata("design:returntype", Promise)
|
|
136
|
+
], SessionResolver.prototype, "revokeUserSessions", null);
|
|
137
|
+
__decorate([
|
|
138
|
+
Mutation(() => User),
|
|
139
|
+
__param(0, Args("id", { type: () => ID })),
|
|
140
|
+
__metadata("design:type", Function),
|
|
141
|
+
__metadata("design:paramtypes", [String]),
|
|
142
|
+
__metadata("design:returntype", Promise)
|
|
143
|
+
], SessionResolver.prototype, "impersonateUser", null);
|
|
144
|
+
__decorate([
|
|
145
|
+
Mutation(() => User, { nullable: true }),
|
|
146
|
+
__metadata("design:type", Function),
|
|
147
|
+
__metadata("design:paramtypes", []),
|
|
148
|
+
__metadata("design:returntype", Promise)
|
|
149
|
+
], SessionResolver.prototype, "stopImpersonating", null);
|
|
150
|
+
SessionResolver = __decorate([
|
|
151
|
+
Resolver(() => Session),
|
|
152
|
+
__metadata("design:paramtypes", [SessionService,
|
|
153
|
+
AuthService])
|
|
154
|
+
], SessionResolver);
|
|
155
|
+
export { SessionResolver };
|
|
156
|
+
//# sourceMappingURL=session.resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.resolver.js","sourceRoot":"","sources":["../../src/resolvers/session.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EACL,IAAI,EACJ,EAAE,EACF,QAAQ,EACR,MAAM,EACN,KAAK,EACL,YAAY,EACZ,QAAQ,GACT,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEhE,8EAA8E;AAEvE,IAAM,eAAe,GAArB,MAAM,eAAe;IAGP;IACA;IAHnB,+CAA+C;IAC/C,YACmB,cAA8B,EAC9B,WAAwB;QADxB,mBAAc,GAAd,cAAc,CAAgB;QAC9B,gBAAW,GAAX,WAAW,CAAa;IACxC,CAAC;IAEJ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AE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;IAClC,WAAA,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;;;;oDAGhC;AAIK;IADL,QAAQ,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC;IAErB,WAAA,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;;;;yDAIpC;AAIK;IADL,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;IAElB,WAAA,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;;;;sDAGhC;AAIK;IADL,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;;;wDAGxC;AAtFU,eAAe;IAD3B,QAAQ,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC;qCAIa,cAAc;QACjB,WAAW;GAJhC,eAAe,CAuF3B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { User } from "../entities/user.entity.js";
|
|
2
|
+
import { UserApiKey } from "../entities/user-api-key.entity.js";
|
|
3
|
+
import { CreateUserApiKeyInput } from "../inputs/create-user-api-key.input.js";
|
|
4
|
+
import { UpdateUserApiKeyInput } from "../inputs/update-user-api-key.input.js";
|
|
5
|
+
import { CreateUserApiKeyResult } from "../objects/create-user-api-key-result.object.js";
|
|
6
|
+
import { UserApiKeyPermissionOption } from "../objects/user-api-key-permission-option.object.js";
|
|
7
|
+
import { UserApiKeyService } from "../services/user-api-key.service.js";
|
|
8
|
+
/** GraphQL mutations for user-owned API keys. */
|
|
9
|
+
export declare class UserApiKeyResolver {
|
|
10
|
+
/** User API-key domain service. */
|
|
11
|
+
readonly apiKeyService: UserApiKeyService;
|
|
12
|
+
/** Creates the user API-key resolver. */
|
|
13
|
+
constructor(
|
|
14
|
+
/** User API-key domain service. */
|
|
15
|
+
apiKeyService: UserApiKeyService);
|
|
16
|
+
/** Lists permission choices for keys owned by the current user. */
|
|
17
|
+
userApiKeyPermissions(user: User): UserApiKeyPermissionOption[];
|
|
18
|
+
/** Creates a credential and returns its plaintext once. */
|
|
19
|
+
createUserApiKey(input: CreateUserApiKeyInput, user: User): Promise<CreateUserApiKeyResult>;
|
|
20
|
+
/** Updates a credential owned by the current user. */
|
|
21
|
+
updateUserApiKey(id: string, input: UpdateUserApiKeyInput): Promise<UserApiKey>;
|
|
22
|
+
/** Deletes a credential owned by the current user. */
|
|
23
|
+
deleteUserApiKey(id: string): Promise<UserApiKey>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
import { Args, ID, Mutation, Query, Resolver } from "@nest-boot/graphql";
|
|
14
|
+
import { CurrentUser } from "../decorators/current-user.decorator.js";
|
|
15
|
+
import { User } from "../entities/user.entity.js";
|
|
16
|
+
import { UserApiKey } from "../entities/user-api-key.entity.js";
|
|
17
|
+
import { CreateUserApiKeyInput } from "../inputs/create-user-api-key.input.js";
|
|
18
|
+
import { UpdateUserApiKeyInput } from "../inputs/update-user-api-key.input.js";
|
|
19
|
+
import { CreateUserApiKeyResult } from "../objects/create-user-api-key-result.object.js";
|
|
20
|
+
import { UserApiKeyPermissionOption } from "../objects/user-api-key-permission-option.object.js";
|
|
21
|
+
import { UserApiKeyService } from "../services/user-api-key.service.js";
|
|
22
|
+
/** GraphQL mutations for user-owned API keys. */
|
|
23
|
+
let UserApiKeyResolver = class UserApiKeyResolver {
|
|
24
|
+
apiKeyService;
|
|
25
|
+
/** Creates the user API-key resolver. */
|
|
26
|
+
constructor(
|
|
27
|
+
/** User API-key domain service. */
|
|
28
|
+
apiKeyService) {
|
|
29
|
+
this.apiKeyService = apiKeyService;
|
|
30
|
+
}
|
|
31
|
+
/** Lists permission choices for keys owned by the current user. */
|
|
32
|
+
userApiKeyPermissions(user) {
|
|
33
|
+
return this.apiKeyService.getUserApiKeyPermissions(user);
|
|
34
|
+
}
|
|
35
|
+
/** Creates a credential and returns its plaintext once. */
|
|
36
|
+
async createUserApiKey(input, user) {
|
|
37
|
+
return await this.apiKeyService.createUserApiKey(user, input);
|
|
38
|
+
}
|
|
39
|
+
/** Updates a credential owned by the current user. */
|
|
40
|
+
async updateUserApiKey(id, input) {
|
|
41
|
+
return await this.apiKeyService.updateUserApiKey(id, input);
|
|
42
|
+
}
|
|
43
|
+
/** Deletes a credential owned by the current user. */
|
|
44
|
+
async deleteUserApiKey(id) {
|
|
45
|
+
return await this.apiKeyService.deleteUserApiKey(id);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
__decorate([
|
|
49
|
+
Query(() => [UserApiKeyPermissionOption]),
|
|
50
|
+
__param(0, CurrentUser()),
|
|
51
|
+
__metadata("design:type", Function),
|
|
52
|
+
__metadata("design:paramtypes", [User]),
|
|
53
|
+
__metadata("design:returntype", Array)
|
|
54
|
+
], UserApiKeyResolver.prototype, "userApiKeyPermissions", null);
|
|
55
|
+
__decorate([
|
|
56
|
+
Mutation(() => CreateUserApiKeyResult),
|
|
57
|
+
__param(0, Args("input")),
|
|
58
|
+
__param(1, CurrentUser()),
|
|
59
|
+
__metadata("design:type", Function),
|
|
60
|
+
__metadata("design:paramtypes", [CreateUserApiKeyInput,
|
|
61
|
+
User]),
|
|
62
|
+
__metadata("design:returntype", Promise)
|
|
63
|
+
], UserApiKeyResolver.prototype, "createUserApiKey", null);
|
|
64
|
+
__decorate([
|
|
65
|
+
Mutation(() => UserApiKey),
|
|
66
|
+
__param(0, Args("id", { type: () => ID })),
|
|
67
|
+
__param(1, Args("input")),
|
|
68
|
+
__metadata("design:type", Function),
|
|
69
|
+
__metadata("design:paramtypes", [String, UpdateUserApiKeyInput]),
|
|
70
|
+
__metadata("design:returntype", Promise)
|
|
71
|
+
], UserApiKeyResolver.prototype, "updateUserApiKey", null);
|
|
72
|
+
__decorate([
|
|
73
|
+
Mutation(() => UserApiKey),
|
|
74
|
+
__param(0, Args("id", { type: () => ID })),
|
|
75
|
+
__metadata("design:type", Function),
|
|
76
|
+
__metadata("design:paramtypes", [String]),
|
|
77
|
+
__metadata("design:returntype", Promise)
|
|
78
|
+
], UserApiKeyResolver.prototype, "deleteUserApiKey", null);
|
|
79
|
+
UserApiKeyResolver = __decorate([
|
|
80
|
+
Resolver(() => UserApiKey),
|
|
81
|
+
__metadata("design:paramtypes", [UserApiKeyService])
|
|
82
|
+
], UserApiKeyResolver);
|
|
83
|
+
export { UserApiKeyResolver };
|
|
84
|
+
//# sourceMappingURL=user-api-key.resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-api-key.resolver.js","sourceRoot":"","sources":["../../src/resolvers/user-api-key.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,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KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,0BAA0B,CAAC,CAAC;IAEvC,WAAA,WAAW,EAAE,CAAA;;qCAAO,IAAI;;+DAG1B;AAIK;IADL,QAAQ,CAAC,GAAG,EAAE,CAAC,sBAAsB,CAAC;IAEpC,WAAA,IAAI,CAAC,OAAO,CAAC,CAAA;IACb,WAAA,WAAW,EAAE,CAAA;;qCADQ,qBAAqB;QACtB,IAAI;;0DAG1B;AAIK;IADL,QAAQ,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC;IAExB,WAAA,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;IAC9B,WAAA,IAAI,CAAC,OAAO,CAAC,CAAA;;6CAAQ,qBAAqB;;0DAG5C;AAIK;IADL,QAAQ,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC;IAExB,WAAA,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;;;;0DAGhC;AAvCU,kBAAkB;IAD9B,QAAQ,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC;qCAKC,iBAAiB;GAJhC,kBAAkB,CAwC9B"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { ConnectionArgsInterface } from "@nest-boot/graphql-connection";
|
|
2
|
+
import { type Account } from "../entities/account.entity.js";
|
|
3
|
+
import { type Invitation } from "../entities/invitation.entity.js";
|
|
4
|
+
import { type Session } from "../entities/session.entity.js";
|
|
5
|
+
import { User } from "../entities/user.entity.js";
|
|
6
|
+
import { UserApiKey } from "../entities/user-api-key.entity.js";
|
|
7
|
+
import { type Workspace } from "../entities/workspace.entity.js";
|
|
8
|
+
import { BanUserInput } from "../inputs/ban-user.input.js";
|
|
9
|
+
import { CreateUserInput } from "../inputs/create-user.input.js";
|
|
10
|
+
import { SetUserPasswordInput } from "../inputs/set-user-password.input.js";
|
|
11
|
+
import { SetUserPermissionsInput } from "../inputs/set-user-permissions.input.js";
|
|
12
|
+
import { SetUserRolesInput } from "../inputs/set-user-roles.input.js";
|
|
13
|
+
import { UpdateUserInput } from "../inputs/update-user.input.js";
|
|
14
|
+
import { BanUserPayload } from "../objects/ban-user-payload.object.js";
|
|
15
|
+
import { CreateUserPayload } from "../objects/create-user-payload.object.js";
|
|
16
|
+
import { DeleteUserPayload } from "../objects/delete-user-payload.object.js";
|
|
17
|
+
import { SetUserPermissionsPayload } from "../objects/set-user-permissions-payload.object.js";
|
|
18
|
+
import { SetUserRolesPayload } from "../objects/set-user-roles-payload.object.js";
|
|
19
|
+
import { UnbanUserPayload } from "../objects/unban-user-payload.object.js";
|
|
20
|
+
import { UpdateUserPayload } from "../objects/update-user-payload.object.js";
|
|
21
|
+
import { UserPermissionOption } from "../objects/user-permission-option.object.js";
|
|
22
|
+
import { UserRoleOption } from "../objects/user-role-option.object.js";
|
|
23
|
+
import { AccountService } from "../services/account.service.js";
|
|
24
|
+
import { InvitationService } from "../services/invitation.service.js";
|
|
25
|
+
import { SessionService } from "../services/session.service.js";
|
|
26
|
+
import { UserService } from "../services/user.service.js";
|
|
27
|
+
import { UserApiKeyService } from "../services/user-api-key.service.js";
|
|
28
|
+
import { WorkspaceService } from "../services/workspace.service.js";
|
|
29
|
+
/** GraphQL transport for user administration. */
|
|
30
|
+
export declare class UserResolver {
|
|
31
|
+
private readonly userService;
|
|
32
|
+
private readonly workspaceService;
|
|
33
|
+
private readonly apiKeyService;
|
|
34
|
+
private readonly sessionService;
|
|
35
|
+
private readonly invitationService;
|
|
36
|
+
private readonly accountService;
|
|
37
|
+
/** Creates the user-management GraphQL resolver. */
|
|
38
|
+
constructor(userService: UserService, workspaceService: WorkspaceService, apiKeyService: UserApiKeyService, sessionService: SessionService, invitationService: InvitationService, accountService: AccountService);
|
|
39
|
+
/** Lists active sessions belonging to the parent user after service authorization. */
|
|
40
|
+
sessions(user: User, args: ConnectionArgsInterface<Session>): Promise<import("@nest-boot/graphql-connection").ConnectionInterface<Session>>;
|
|
41
|
+
/** Paginates the parent's linked accounts after service authorization. */
|
|
42
|
+
accounts(user: User, args: ConnectionArgsInterface<Account>): Promise<import("@nest-boot/graphql-connection").ConnectionInterface<Account>>;
|
|
43
|
+
/** Paginates workspaces joined by the parent user. */
|
|
44
|
+
workspaces(user: User, args: ConnectionArgsInterface<Workspace>): Promise<import("@nest-boot/graphql-connection").ConnectionInterface<Workspace>>;
|
|
45
|
+
/** Returns an accessible API key owned by the parent user. */
|
|
46
|
+
apiKey(user: User, id: string): Promise<UserApiKey | null>;
|
|
47
|
+
/** Paginates API keys owned by the parent user. */
|
|
48
|
+
apiKeys(user: User, args: ConnectionArgsInterface<UserApiKey>): Promise<import("@nest-boot/graphql-connection").ConnectionInterface<UserApiKey>>;
|
|
49
|
+
/** Paginates pending invitations addressed to the parent user. */
|
|
50
|
+
invitations(user: User, args: ConnectionArgsInterface<Invitation>): Promise<import("@nest-boot/graphql-connection").ConnectionInterface<Invitation>>;
|
|
51
|
+
/** Lists configured user roles with the current principal's grant availability. */
|
|
52
|
+
userRoles(): UserRoleOption[];
|
|
53
|
+
/** Lists configured user permissions with the current principal's grant availability. */
|
|
54
|
+
userPermissions(): UserPermissionOption[];
|
|
55
|
+
/** Paginates users using the application's connection definition. */
|
|
56
|
+
users(args: ConnectionArgsInterface<User>): Promise<import("@nest-boot/graphql-connection").ConnectionInterface<User>>;
|
|
57
|
+
/** Returns a user by identifier. */
|
|
58
|
+
user(id: string): Promise<User | null>;
|
|
59
|
+
/** Creates a credential user. */
|
|
60
|
+
createUser(input: CreateUserInput): Promise<CreateUserPayload>;
|
|
61
|
+
/** Updates mutable user profile fields. */
|
|
62
|
+
updateUser(id: string, input: UpdateUserInput): Promise<UpdateUserPayload>;
|
|
63
|
+
/** Replaces the direct permissions assigned to a user. */
|
|
64
|
+
setUserPermissions(id: string, input: SetUserPermissionsInput): Promise<SetUserPermissionsPayload>;
|
|
65
|
+
/** Replaces the application roles assigned to a user. */
|
|
66
|
+
setUserRoles(id: string, input: SetUserRolesInput): Promise<SetUserRolesPayload>;
|
|
67
|
+
/** Bans a user and revokes their sessions. */
|
|
68
|
+
banUser(id: string, input?: BanUserInput): Promise<BanUserPayload>;
|
|
69
|
+
/** Removes an active user ban. */
|
|
70
|
+
unbanUser(id: string): Promise<UnbanUserPayload>;
|
|
71
|
+
/** Replaces a user's credential password. */
|
|
72
|
+
setUserPassword(id: string, input: SetUserPasswordInput): Promise<boolean>;
|
|
73
|
+
/** Permanently deletes a user and returns only the deleted user's ID. */
|
|
74
|
+
deleteUser(id: string): Promise<DeleteUserPayload>;
|
|
75
|
+
}
|