@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
|
@@ -7,96 +7,134 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
/* eslint-disable @nest-boot/graphql-field-config-from-types -- MikroORM Opt/Ref markers require explicit GraphQL metadata. */
|
|
11
|
+
import { BaseEntity, t } from "@mikro-orm/core";
|
|
11
12
|
import { Entity, Index, ManyToOne, PrimaryKey, Property, Unique, } from "@mikro-orm/decorators/legacy";
|
|
13
|
+
import { Field, HideField, ID, ObjectType } from "@nest-boot/graphql";
|
|
12
14
|
import { randomUUID } from "crypto";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
15
|
+
import { userScopePolicy } from "../policies/user-scope.policy.js";
|
|
16
|
+
import { User } from "./user.entity.js";
|
|
17
|
+
/** Built-in Account entity with authentication persistence and access policies. */
|
|
18
|
+
let Account = class Account extends BaseEntity {
|
|
19
|
+
/** Primary key (UUID v4, auto-generated). */
|
|
16
20
|
id = randomUUID();
|
|
21
|
+
/** Provider-scoped account identifier. */
|
|
17
22
|
accountId;
|
|
23
|
+
/** Stable issuer namespace used together with {@link accountId}. */
|
|
18
24
|
issuer;
|
|
25
|
+
/** Authentication provider identifier (e.g. `"google"`, `"credential"`). */
|
|
19
26
|
providerId;
|
|
20
|
-
|
|
27
|
+
/** User that owns this record. */
|
|
28
|
+
user;
|
|
29
|
+
/** OAuth access token, if available. */
|
|
21
30
|
accessToken;
|
|
31
|
+
/** OAuth refresh token, if available. */
|
|
22
32
|
refreshToken;
|
|
33
|
+
/** OpenID Connect ID token, if available. */
|
|
23
34
|
idToken;
|
|
35
|
+
/** Expiration timestamp of the access token. */
|
|
24
36
|
accessTokenExpiresAt;
|
|
37
|
+
/** Expiration timestamp of the refresh token. */
|
|
25
38
|
refreshTokenExpiresAt;
|
|
39
|
+
/** OAuth scopes granted to this account. */
|
|
26
40
|
scope;
|
|
41
|
+
/** Hashed password for credential-based accounts. */
|
|
27
42
|
password;
|
|
43
|
+
/** Timestamp when the account was created. */
|
|
28
44
|
createdAt = new Date();
|
|
45
|
+
/** Timestamp of the last update. */
|
|
29
46
|
updatedAt = new Date();
|
|
47
|
+
/** Granted OAuth scopes; credentials are intentionally not GraphQL fields. */
|
|
48
|
+
get scopes() {
|
|
49
|
+
return this.scope?.split(/[,\s]+/).filter(Boolean) ?? [];
|
|
50
|
+
}
|
|
30
51
|
};
|
|
31
52
|
__decorate([
|
|
32
53
|
PrimaryKey({ type: t.uuid }),
|
|
54
|
+
Field(() => ID),
|
|
33
55
|
__metadata("design:type", Object)
|
|
34
|
-
],
|
|
56
|
+
], Account.prototype, "id", void 0);
|
|
35
57
|
__decorate([
|
|
36
58
|
Property({ type: t.text }),
|
|
59
|
+
Field(() => ID),
|
|
37
60
|
__metadata("design:type", String)
|
|
38
|
-
],
|
|
61
|
+
], Account.prototype, "accountId", void 0);
|
|
39
62
|
__decorate([
|
|
40
63
|
Property({ type: t.text }),
|
|
64
|
+
Field(() => String),
|
|
41
65
|
__metadata("design:type", String)
|
|
42
|
-
],
|
|
66
|
+
], Account.prototype, "issuer", void 0);
|
|
43
67
|
__decorate([
|
|
44
68
|
Property({ type: t.text }),
|
|
69
|
+
Field(() => ID),
|
|
45
70
|
__metadata("design:type", String)
|
|
46
|
-
],
|
|
71
|
+
], Account.prototype, "providerId", void 0);
|
|
47
72
|
__decorate([
|
|
48
73
|
Index(),
|
|
49
|
-
ManyToOne({
|
|
50
|
-
entity: () => resolveAuthRelationTarget(BaseUser, "User"),
|
|
74
|
+
ManyToOne(() => User, {
|
|
51
75
|
fieldName: "user_id",
|
|
52
|
-
|
|
53
|
-
|
|
76
|
+
ref: true,
|
|
77
|
+
deleteRule: "cascade",
|
|
54
78
|
}),
|
|
55
|
-
|
|
56
|
-
|
|
79
|
+
HideField(),
|
|
80
|
+
__metadata("design:type", Object)
|
|
81
|
+
], Account.prototype, "user", void 0);
|
|
57
82
|
__decorate([
|
|
58
83
|
Property({ type: t.text, nullable: true }),
|
|
59
84
|
__metadata("design:type", Object)
|
|
60
|
-
],
|
|
85
|
+
], Account.prototype, "accessToken", void 0);
|
|
61
86
|
__decorate([
|
|
62
87
|
Property({ type: t.text, nullable: true }),
|
|
63
88
|
__metadata("design:type", Object)
|
|
64
|
-
],
|
|
89
|
+
], Account.prototype, "refreshToken", void 0);
|
|
65
90
|
__decorate([
|
|
66
91
|
Property({ type: t.text, nullable: true }),
|
|
67
92
|
__metadata("design:type", Object)
|
|
68
|
-
],
|
|
93
|
+
], Account.prototype, "idToken", void 0);
|
|
69
94
|
__decorate([
|
|
70
95
|
Property({ type: t.datetime, nullable: true }),
|
|
71
96
|
__metadata("design:type", Object)
|
|
72
|
-
],
|
|
97
|
+
], Account.prototype, "accessTokenExpiresAt", void 0);
|
|
73
98
|
__decorate([
|
|
74
99
|
Property({ type: t.datetime, nullable: true }),
|
|
75
100
|
__metadata("design:type", Object)
|
|
76
|
-
],
|
|
101
|
+
], Account.prototype, "refreshTokenExpiresAt", void 0);
|
|
77
102
|
__decorate([
|
|
78
103
|
Property({ type: t.text, nullable: true }),
|
|
79
104
|
__metadata("design:type", Object)
|
|
80
|
-
],
|
|
105
|
+
], Account.prototype, "scope", void 0);
|
|
81
106
|
__decorate([
|
|
82
107
|
Property({ type: t.text, nullable: true }),
|
|
83
108
|
__metadata("design:type", Object)
|
|
84
|
-
],
|
|
109
|
+
], Account.prototype, "password", void 0);
|
|
85
110
|
__decorate([
|
|
86
|
-
Property({
|
|
111
|
+
Property({
|
|
112
|
+
type: t.datetime,
|
|
113
|
+
defaultRaw: "now()",
|
|
114
|
+
}),
|
|
115
|
+
Field(() => Date),
|
|
87
116
|
__metadata("design:type", Object)
|
|
88
|
-
],
|
|
117
|
+
], Account.prototype, "createdAt", void 0);
|
|
89
118
|
__decorate([
|
|
90
119
|
Property({
|
|
91
120
|
type: t.datetime,
|
|
92
121
|
defaultRaw: "now()",
|
|
93
122
|
onUpdate: () => new Date(),
|
|
94
123
|
}),
|
|
124
|
+
Field(() => Date),
|
|
95
125
|
__metadata("design:type", Object)
|
|
96
|
-
],
|
|
97
|
-
|
|
98
|
-
|
|
126
|
+
], Account.prototype, "updatedAt", void 0);
|
|
127
|
+
__decorate([
|
|
128
|
+
Field(() => [String]),
|
|
129
|
+
__metadata("design:type", Array),
|
|
130
|
+
__metadata("design:paramtypes", [])
|
|
131
|
+
], Account.prototype, "scopes", null);
|
|
132
|
+
Account = __decorate([
|
|
133
|
+
Entity({
|
|
134
|
+
policies: [userScopePolicy({ property: "user", command: "select" })],
|
|
135
|
+
}),
|
|
136
|
+
ObjectType(),
|
|
99
137
|
Unique({ properties: ["issuer", "accountId"] })
|
|
100
|
-
],
|
|
101
|
-
export {
|
|
138
|
+
], Account);
|
|
139
|
+
export { Account };
|
|
102
140
|
//# sourceMappingURL=account.entity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.entity.js","sourceRoot":"","sources":["../../src/entities/account.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"account.entity.js","sourceRoot":"","sources":["../../src/entities/account.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,8HAA8H;AAC9H,OAAO,EAAE,UAAU,EAAsB,CAAC,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EACL,MAAM,EACN,KAAK,EACL,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,GACP,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,mFAAmF;AAM5E,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,UAAU;IACrC,6CAA6C;IAG7C,EAAE,GAAgB,UAAU,EAAE,CAAC;IAE/B,0CAA0C;IAG1C,SAAS,CAAU;IAEnB,oEAAoE;IAGpE,MAAM,CAAU;IAEhB,4EAA4E;IAG5E,UAAU,CAAU;IAEpB,kCAAkC;IAQlC,IAAI,CAAa;IAEjB,wCAAwC;IA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AAC,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;KACrE,CAAC;IACD,UAAU,EAAE;IACZ,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC,EAAE,CAAC;GACnC,OAAO,CAiFnB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Account } from "./account.entity.js";
|
|
2
|
+
import { Invitation } from "./invitation.entity.js";
|
|
3
|
+
import { Member } from "./member.entity.js";
|
|
4
|
+
import { Session } from "./session.entity.js";
|
|
5
|
+
import { User } from "./user.entity.js";
|
|
6
|
+
import { UserApiKey } from "./user-api-key.entity.js";
|
|
7
|
+
import { Verification } from "./verification.entity.js";
|
|
8
|
+
import { Workspace } from "./workspace.entity.js";
|
|
9
|
+
import { WorkspaceApiKey } from "./workspace-api-key.entity.js";
|
|
10
|
+
/** Internal Better Auth model-to-entity mapping. */
|
|
11
|
+
export declare const authEntityMap: {
|
|
12
|
+
user: typeof User;
|
|
13
|
+
account: typeof Account;
|
|
14
|
+
session: typeof Session;
|
|
15
|
+
verification: typeof Verification;
|
|
16
|
+
workspace: typeof Workspace;
|
|
17
|
+
member: typeof Member;
|
|
18
|
+
invitation: typeof Invitation;
|
|
19
|
+
userApiKey: typeof UserApiKey;
|
|
20
|
+
workspaceApiKey: typeof WorkspaceApiKey;
|
|
21
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Account } from "./account.entity.js";
|
|
2
|
+
import { Invitation } from "./invitation.entity.js";
|
|
3
|
+
import { Member } from "./member.entity.js";
|
|
4
|
+
import { Session } from "./session.entity.js";
|
|
5
|
+
import { User } from "./user.entity.js";
|
|
6
|
+
import { UserApiKey } from "./user-api-key.entity.js";
|
|
7
|
+
import { Verification } from "./verification.entity.js";
|
|
8
|
+
import { Workspace } from "./workspace.entity.js";
|
|
9
|
+
import { WorkspaceApiKey } from "./workspace-api-key.entity.js";
|
|
10
|
+
/** Internal Better Auth model-to-entity mapping. */
|
|
11
|
+
export const authEntityMap = {
|
|
12
|
+
user: User,
|
|
13
|
+
account: Account,
|
|
14
|
+
session: Session,
|
|
15
|
+
verification: Verification,
|
|
16
|
+
workspace: Workspace,
|
|
17
|
+
member: Member,
|
|
18
|
+
invitation: Invitation,
|
|
19
|
+
userApiKey: UserApiKey,
|
|
20
|
+
workspaceApiKey: WorkspaceApiKey,
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=auth-entity-map.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-entity-map.js","sourceRoot":"","sources":["../../src/entities/auth-entity-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,oDAAoD;AACpD,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,OAAO;IAChB,OAAO,EAAE,OAAO;IAChB,YAAY,EAAE,YAAY;IAC1B,SAAS,EAAE,SAAS;IACpB,MAAM,EAAE,MAAM;IACd,UAAU,EAAE,UAAU;IACtB,UAAU,EAAE,UAAU;IACtB,eAAe,EAAE,eAAe;CACjC,CAAC"}
|
package/dist/entities/index.d.ts
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
|
+
import { Account } from "./account.entity.js";
|
|
2
|
+
import { Invitation } from "./invitation.entity.js";
|
|
3
|
+
import { Member } from "./member.entity.js";
|
|
4
|
+
import { Session } from "./session.entity.js";
|
|
5
|
+
import { UserApiKey } from "./user-api-key.entity.js";
|
|
6
|
+
import { Verification } from "./verification.entity.js";
|
|
7
|
+
import { Workspace } from "./workspace.entity.js";
|
|
8
|
+
import { WorkspaceApiKey } from "./workspace-api-key.entity.js";
|
|
1
9
|
export * from "./account.entity.js";
|
|
2
|
-
export * from "./
|
|
10
|
+
export * from "./invitation.entity.js";
|
|
11
|
+
export * from "./member.entity.js";
|
|
3
12
|
export * from "./session.entity.js";
|
|
4
13
|
export * from "./user.entity.js";
|
|
14
|
+
export * from "./user-api-key.entity.js";
|
|
5
15
|
export * from "./verification.entity.js";
|
|
6
16
|
export * from "./workspace.entity.js";
|
|
7
|
-
export * from "./workspace-
|
|
8
|
-
|
|
17
|
+
export * from "./workspace-api-key.entity.js";
|
|
18
|
+
/** Built-in authentication entities for MikroORM runtime and migration discovery. */
|
|
19
|
+
export declare const entities: (typeof Workspace | typeof Member | typeof UserApiKey | typeof WorkspaceApiKey | typeof Invitation | typeof Session | typeof Account | typeof Verification)[];
|
package/dist/entities/index.js
CHANGED
|
@@ -1,9 +1,31 @@
|
|
|
1
|
+
import { Account } from "./account.entity.js";
|
|
2
|
+
import { Invitation } from "./invitation.entity.js";
|
|
3
|
+
import { Member } from "./member.entity.js";
|
|
4
|
+
import { Session } from "./session.entity.js";
|
|
5
|
+
import { User } from "./user.entity.js";
|
|
6
|
+
import { UserApiKey } from "./user-api-key.entity.js";
|
|
7
|
+
import { Verification } from "./verification.entity.js";
|
|
8
|
+
import { Workspace } from "./workspace.entity.js";
|
|
9
|
+
import { WorkspaceApiKey } from "./workspace-api-key.entity.js";
|
|
1
10
|
export * from "./account.entity.js";
|
|
2
|
-
export * from "./
|
|
11
|
+
export * from "./invitation.entity.js";
|
|
12
|
+
export * from "./member.entity.js";
|
|
3
13
|
export * from "./session.entity.js";
|
|
4
14
|
export * from "./user.entity.js";
|
|
15
|
+
export * from "./user-api-key.entity.js";
|
|
5
16
|
export * from "./verification.entity.js";
|
|
6
17
|
export * from "./workspace.entity.js";
|
|
7
|
-
export * from "./workspace-
|
|
8
|
-
|
|
18
|
+
export * from "./workspace-api-key.entity.js";
|
|
19
|
+
/** Built-in authentication entities for MikroORM runtime and migration discovery. */
|
|
20
|
+
export const entities = [
|
|
21
|
+
User,
|
|
22
|
+
Account,
|
|
23
|
+
Session,
|
|
24
|
+
Verification,
|
|
25
|
+
Workspace,
|
|
26
|
+
Member,
|
|
27
|
+
Invitation,
|
|
28
|
+
UserApiKey,
|
|
29
|
+
WorkspaceApiKey,
|
|
30
|
+
];
|
|
9
31
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAE9C,qFAAqF;AACrF,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI;IACJ,OAAO;IACP,OAAO;IACP,YAAY;IACZ,SAAS;IACT,MAAM;IACN,UAAU;IACV,UAAU;IACV,eAAe;CAChB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BaseEntity, type Opt, type Ref } from "@mikro-orm/core";
|
|
2
|
+
import { User } from "./user.entity.js";
|
|
3
|
+
import { Workspace } from "./workspace.entity.js";
|
|
4
|
+
/** Workspace-invitation states understood by the built-in auth services. */
|
|
5
|
+
export type AuthInvitationStatus = "accepted" | "canceled" | "pending" | "rejected";
|
|
6
|
+
/** Built-in Invitation entity with authentication persistence and access policies. */
|
|
7
|
+
export declare class Invitation extends BaseEntity {
|
|
8
|
+
/** Primary key (UUID v4, auto-generated). */
|
|
9
|
+
id: Opt<string>;
|
|
10
|
+
/** Email address allowed to accept the invitation. */
|
|
11
|
+
email: string;
|
|
12
|
+
/** Roles granted to the member after acceptance. */
|
|
13
|
+
roles: Opt<string[]>;
|
|
14
|
+
/** Invitation lifecycle status. */
|
|
15
|
+
status: Opt<AuthInvitationStatus>;
|
|
16
|
+
/** Time after which the invitation can no longer be accepted. */
|
|
17
|
+
expiresAt: Date;
|
|
18
|
+
/** Timestamp when the invitation was created. */
|
|
19
|
+
createdAt: Opt<Date>;
|
|
20
|
+
/** User that created the invitation. */
|
|
21
|
+
inviter: Ref<User>;
|
|
22
|
+
/** Workspace to which the recipient was invited. */
|
|
23
|
+
workspace: Ref<Workspace>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
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
|
+
/* eslint-disable @nest-boot/graphql-field-config-from-types -- MikroORM Opt/Ref markers require explicit GraphQL metadata. */
|
|
11
|
+
import { randomUUID } from "node:crypto";
|
|
12
|
+
import { BaseEntity, t } from "@mikro-orm/core";
|
|
13
|
+
import { Entity, Enum, Index, ManyToOne, PrimaryKey, Property, Unique, } from "@mikro-orm/decorators/legacy";
|
|
14
|
+
import { Field, ID, ObjectType } from "@nest-boot/graphql";
|
|
15
|
+
import { InvitationStatus } from "../enums/invitation-status.enum.js";
|
|
16
|
+
import { WorkspaceRole } from "../enums/workspace-role.enum.js";
|
|
17
|
+
import { workspaceScopePolicy } from "../policies/workspace-scope.policy.js";
|
|
18
|
+
import { User } from "./user.entity.js";
|
|
19
|
+
import { Workspace } from "./workspace.entity.js";
|
|
20
|
+
/** Built-in Invitation entity with authentication persistence and access policies. */
|
|
21
|
+
let Invitation = class Invitation extends BaseEntity {
|
|
22
|
+
/** Primary key (UUID v4, auto-generated). */
|
|
23
|
+
id = randomUUID();
|
|
24
|
+
/** Email address allowed to accept the invitation. */
|
|
25
|
+
email;
|
|
26
|
+
/** Roles granted to the member after acceptance. */
|
|
27
|
+
roles = ["member"];
|
|
28
|
+
/** Invitation lifecycle status. */
|
|
29
|
+
status = InvitationStatus.PENDING;
|
|
30
|
+
/** Time after which the invitation can no longer be accepted. */
|
|
31
|
+
expiresAt;
|
|
32
|
+
/** Timestamp when the invitation was created. */
|
|
33
|
+
createdAt = new Date();
|
|
34
|
+
/** User that created the invitation. */
|
|
35
|
+
inviter;
|
|
36
|
+
/** Workspace to which the recipient was invited. */
|
|
37
|
+
workspace;
|
|
38
|
+
};
|
|
39
|
+
__decorate([
|
|
40
|
+
PrimaryKey({ type: t.uuid }),
|
|
41
|
+
Field(() => ID),
|
|
42
|
+
__metadata("design:type", Object)
|
|
43
|
+
], Invitation.prototype, "id", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
Property({
|
|
46
|
+
type: t.string,
|
|
47
|
+
}),
|
|
48
|
+
Field(() => String),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], Invitation.prototype, "email", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
Property({ type: t.array, defaultRaw: "'{member}'" }),
|
|
53
|
+
Field(() => [WorkspaceRole]),
|
|
54
|
+
__metadata("design:type", Object)
|
|
55
|
+
], Invitation.prototype, "roles", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
Field(() => InvitationStatus),
|
|
58
|
+
Enum({
|
|
59
|
+
items: () => InvitationStatus,
|
|
60
|
+
default: InvitationStatus.PENDING,
|
|
61
|
+
}),
|
|
62
|
+
__metadata("design:type", Object)
|
|
63
|
+
], Invitation.prototype, "status", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
Property({
|
|
66
|
+
type: t.datetime,
|
|
67
|
+
}),
|
|
68
|
+
Field(() => Date),
|
|
69
|
+
__metadata("design:type", Date)
|
|
70
|
+
], Invitation.prototype, "expiresAt", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
Property({
|
|
73
|
+
type: t.datetime,
|
|
74
|
+
defaultRaw: "now()",
|
|
75
|
+
}),
|
|
76
|
+
Field(() => Date),
|
|
77
|
+
__metadata("design:type", Object)
|
|
78
|
+
], Invitation.prototype, "createdAt", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
ManyToOne(() => User, {
|
|
81
|
+
updateRule: "cascade",
|
|
82
|
+
deleteRule: "cascade",
|
|
83
|
+
}),
|
|
84
|
+
__metadata("design:type", Object)
|
|
85
|
+
], Invitation.prototype, "inviter", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
ManyToOne(() => Workspace, {
|
|
88
|
+
updateRule: "cascade",
|
|
89
|
+
deleteRule: "cascade",
|
|
90
|
+
}),
|
|
91
|
+
__metadata("design:type", Object)
|
|
92
|
+
], Invitation.prototype, "workspace", void 0);
|
|
93
|
+
Invitation = __decorate([
|
|
94
|
+
ObjectType(),
|
|
95
|
+
Entity({
|
|
96
|
+
policies: [
|
|
97
|
+
workspaceScopePolicy(),
|
|
98
|
+
{
|
|
99
|
+
name: "invitation_recipient_select_policy",
|
|
100
|
+
command: "select",
|
|
101
|
+
roles: ["authenticated"],
|
|
102
|
+
// Recipients need not be workspace members; this policy grants reads only, not writes.
|
|
103
|
+
using: ({ email }) => `"${email}" = (select lower("recipient"."email") from "user" as "recipient" where "recipient"."id" = nullif(current_setting('app.user.id', true), '')::bigint)`,
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
}),
|
|
107
|
+
Index({ properties: ["createdAt"] }),
|
|
108
|
+
Index({ properties: ["email"] }),
|
|
109
|
+
Index({ properties: ["status"] }),
|
|
110
|
+
Index({ properties: ["workspace"] }),
|
|
111
|
+
Unique({
|
|
112
|
+
properties: ["email", "workspace"],
|
|
113
|
+
where: { status: "pending" },
|
|
114
|
+
})
|
|
115
|
+
], Invitation);
|
|
116
|
+
export { Invitation };
|
|
117
|
+
//# sourceMappingURL=invitation.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invitation.entity.js","sourceRoot":"","sources":["../../src/entities/invitation.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,8HAA8H;AAC9H,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAsB,CAAC,EAA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AAE,UAAU,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAChC,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC;IACjC,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC;IACpC,MAAM,CAAC;QACN,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC;QAClC,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE;KAC7B,CAAC;GACW,UAAU,CAsDtB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { BaseEntity, type Opt, type Ref } from "@mikro-orm/core";
|
|
2
|
+
import { User } from "./user.entity.js";
|
|
3
|
+
import { Workspace } from "./workspace.entity.js";
|
|
4
|
+
/** Workspace-member states understood by the built-in authentication services. */
|
|
5
|
+
export type AuthMemberStatus = "ACTIVE" | "DISABLED";
|
|
6
|
+
/** Built-in Member entity with authentication persistence and access policies. */
|
|
7
|
+
export declare class Member extends BaseEntity {
|
|
8
|
+
/** Primary key (Sonyflake ID, auto-generated). */
|
|
9
|
+
id: Opt<string>;
|
|
10
|
+
/** Display name shared inside this workspace, independent of the user profile. */
|
|
11
|
+
name: string;
|
|
12
|
+
/** Non-unique contact email shared inside this workspace, independent of login identity. */
|
|
13
|
+
email?: Opt<string> | null;
|
|
14
|
+
/** Member roles used to resolve workspace permissions. */
|
|
15
|
+
roles: Opt<string[]>;
|
|
16
|
+
/** Member lifecycle status. */
|
|
17
|
+
status: Opt<AuthMemberStatus>;
|
|
18
|
+
/** Additional permissions granted inside the workspace. */
|
|
19
|
+
permissions: Opt<string[]>;
|
|
20
|
+
/** Timestamp when the membership was created. */
|
|
21
|
+
createdAt: Opt<Date>;
|
|
22
|
+
/** Timestamp of the last update. */
|
|
23
|
+
updatedAt: Opt<Date>;
|
|
24
|
+
/** User associated with this membership. */
|
|
25
|
+
user: Ref<User>;
|
|
26
|
+
/** Workspace that owns this member. */
|
|
27
|
+
workspace: Ref<Workspace>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
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
|
+
/* eslint-disable @nest-boot/graphql-field-config-from-types -- MikroORM Opt/Ref markers require explicit GraphQL metadata. */
|
|
11
|
+
import { BaseEntity, t } from "@mikro-orm/core";
|
|
12
|
+
import { Entity, Enum, Index, ManyToOne, PrimaryKey, Property, Unique, } from "@mikro-orm/decorators/legacy";
|
|
13
|
+
import { Field, ID, ObjectType } from "@nest-boot/graphql";
|
|
14
|
+
import { Sonyflake } from "sonyflake-js";
|
|
15
|
+
import { MemberStatus } from "../enums/member-status.enum.js";
|
|
16
|
+
import { WorkspacePermission } from "../enums/workspace-permission.enum.js";
|
|
17
|
+
import { WorkspaceRole } from "../enums/workspace-role.enum.js";
|
|
18
|
+
import { userScopePolicy } from "../policies/user-scope.policy.js";
|
|
19
|
+
import { workspaceScopePolicy } from "../policies/workspace-scope.policy.js";
|
|
20
|
+
import { User } from "./user.entity.js";
|
|
21
|
+
import { Workspace } from "./workspace.entity.js";
|
|
22
|
+
/** Built-in Member entity with authentication persistence and access policies. */
|
|
23
|
+
let Member = class Member extends BaseEntity {
|
|
24
|
+
/** Primary key (Sonyflake ID, auto-generated). */
|
|
25
|
+
id = Sonyflake.next().toString();
|
|
26
|
+
/** Display name shared inside this workspace, independent of the user profile. */
|
|
27
|
+
name;
|
|
28
|
+
/** Non-unique contact email shared inside this workspace, independent of login identity. */
|
|
29
|
+
email = null;
|
|
30
|
+
/** Member roles used to resolve workspace permissions. */
|
|
31
|
+
roles = ["member"];
|
|
32
|
+
/** Member lifecycle status. */
|
|
33
|
+
status = MemberStatus.ACTIVE;
|
|
34
|
+
/** Additional permissions granted inside the workspace. */
|
|
35
|
+
permissions = [];
|
|
36
|
+
/** Timestamp when the membership was created. */
|
|
37
|
+
createdAt = new Date();
|
|
38
|
+
/** Timestamp of the last update. */
|
|
39
|
+
updatedAt = new Date();
|
|
40
|
+
/** User associated with this membership. */
|
|
41
|
+
user;
|
|
42
|
+
/** Workspace that owns this member. */
|
|
43
|
+
workspace;
|
|
44
|
+
};
|
|
45
|
+
__decorate([
|
|
46
|
+
PrimaryKey({
|
|
47
|
+
type: t.bigint,
|
|
48
|
+
}),
|
|
49
|
+
Field(() => ID),
|
|
50
|
+
__metadata("design:type", Object)
|
|
51
|
+
], Member.prototype, "id", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
Property({ type: t.string }),
|
|
54
|
+
Field(() => String),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], Member.prototype, "name", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
Property({ type: t.string, nullable: true }),
|
|
59
|
+
Field(() => String, { nullable: true }),
|
|
60
|
+
__metadata("design:type", Object)
|
|
61
|
+
], Member.prototype, "email", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
Property({ type: t.array, defaultRaw: "'{member}'" }),
|
|
64
|
+
Field(() => [WorkspaceRole]),
|
|
65
|
+
__metadata("design:type", Object)
|
|
66
|
+
], Member.prototype, "roles", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
Field(() => MemberStatus),
|
|
69
|
+
Enum({
|
|
70
|
+
items: () => MemberStatus,
|
|
71
|
+
default: MemberStatus.ACTIVE,
|
|
72
|
+
}),
|
|
73
|
+
__metadata("design:type", Object)
|
|
74
|
+
], Member.prototype, "status", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
Property({ type: t.array, defaultRaw: "'{}'" }),
|
|
77
|
+
Field(() => [WorkspacePermission]),
|
|
78
|
+
__metadata("design:type", Object)
|
|
79
|
+
], Member.prototype, "permissions", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
Property({
|
|
82
|
+
type: t.datetime,
|
|
83
|
+
defaultRaw: "now()",
|
|
84
|
+
}),
|
|
85
|
+
Field(() => Date),
|
|
86
|
+
__metadata("design:type", Object)
|
|
87
|
+
], Member.prototype, "createdAt", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
Property({
|
|
90
|
+
type: t.datetime,
|
|
91
|
+
defaultRaw: "now()",
|
|
92
|
+
onUpdate: () => new Date(),
|
|
93
|
+
}),
|
|
94
|
+
Field(() => Date),
|
|
95
|
+
__metadata("design:type", Object)
|
|
96
|
+
], Member.prototype, "updatedAt", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
ManyToOne(() => User, {
|
|
99
|
+
updateRule: "cascade",
|
|
100
|
+
deleteRule: "cascade",
|
|
101
|
+
}),
|
|
102
|
+
__metadata("design:type", Object)
|
|
103
|
+
], Member.prototype, "user", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
ManyToOne(() => Workspace, {
|
|
106
|
+
updateRule: "cascade",
|
|
107
|
+
deleteRule: "cascade",
|
|
108
|
+
}),
|
|
109
|
+
__metadata("design:type", Object)
|
|
110
|
+
], Member.prototype, "workspace", void 0);
|
|
111
|
+
Member = __decorate([
|
|
112
|
+
ObjectType(),
|
|
113
|
+
Entity({
|
|
114
|
+
policies: [
|
|
115
|
+
// Allow users to read their own memberships across workspaces without granting writes.
|
|
116
|
+
userScopePolicy({ command: "select" }),
|
|
117
|
+
workspaceScopePolicy(),
|
|
118
|
+
],
|
|
119
|
+
}),
|
|
120
|
+
Unique({ properties: ["user", "workspace"] }),
|
|
121
|
+
Index({ properties: ["createdAt"] }),
|
|
122
|
+
Index({ properties: ["user"] }),
|
|
123
|
+
Index({ properties: ["workspace"] })
|
|
124
|
+
], Member);
|
|
125
|
+
export { Member };
|
|
126
|
+
//# sourceMappingURL=member.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"member.entity.js","sourceRoot":"","sources":["../../src/entities/member.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,8HAA8H;AAC9H,OAAO,EAAE,UAAU,EAAsB,CAAC,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EACL,MAAM,EACN,IAAI,EACJ,KAAK,EACL,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,GACP,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAKlD,kFAAkF;AAa3E,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,UAAU;IACpC,kDAAkD;IAKlD,EAAE,GAAgB,SAAS,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC;IAE9C,kFAAkF;IAGlF,IAAI,CAAU;IAEd,4FAA4F;IAG5F,KAAK,GAAwB,IAAI,CAAC;IAElC,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} from "@mikro-orm/core";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { User } from "./user.entity.js";
|
|
3
|
+
/** Built-in Session entity with authentication persistence and access policies. */
|
|
4
|
+
export declare class Session extends BaseEntity {
|
|
5
|
+
/** Primary key (UUID v4, auto-generated). */
|
|
4
6
|
id: Opt<string>;
|
|
7
|
+
/** Unique session token used for authentication. */
|
|
5
8
|
token: string;
|
|
6
|
-
|
|
9
|
+
/** User that owns this record. */
|
|
10
|
+
user: Ref<User>;
|
|
11
|
+
/** Timestamp when the session expires. */
|
|
7
12
|
expiresAt: Date;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
/** IP address of the client that created or last used this session. */
|
|
14
|
+
ipAddress?: string | null;
|
|
15
|
+
/** User-Agent header from the client that created or last used this session. */
|
|
16
|
+
userAgent?: string | null;
|
|
17
|
+
/** Administrator that created this impersonation session. */
|
|
18
|
+
impersonatedBy?: Ref<User> | null;
|
|
19
|
+
/** Timestamp when the session was created. */
|
|
11
20
|
createdAt: Opt<Date>;
|
|
21
|
+
/** Timestamp of the last update. */
|
|
12
22
|
updatedAt: Opt<Date>;
|
|
13
23
|
}
|