Skip to main content

GetUsersDTO

Package: @nauth-toolkit/core Type: DTO (Request)

Input DTO for paginated user listing with advanced filtering and sorting.

import { GetUsersDTO } from '@nauth-toolkit/nestjs';

Properties

PropertyTypeRequiredDescription with validation inline
pagenumberNoPage number (1-indexed). Default: 1. Min: 1.
limitnumberNoRecords per page. Default: 10. Min: 1, Max: 100.
emailstringNoFilter by email address (partial match). Example: "john" matches "john@example.com", "johnny@test.com".
phonestringNoFilter by phone number (partial match). Example: "+1" matches "+14155552671", "+12025551234".
isEmailVerifiedbooleanNoFilter by email verification status.
isPhoneVerifiedbooleanNoFilter by phone verification status.
hasSocialAuthbooleanNoFilter by social auth presence.
isLockedbooleanNoFilter by account lock status.
mfaEnabledbooleanNoFilter by MFA enabled status.
createdAtDateFilterDTONoFilter by creation date with operator (gt, gte, lt, lte, eq).
updatedAtDateFilterDTONoFilter by update date with operator (gt, gte, lt, lte, eq).
sortBy'email' | 'createdAt' | 'updatedAt' | 'username' | 'phone'NoField to sort by. Default: createdAt.
sortOrder'ASC' | 'DESC'NoSort order. Default: DESC.

DateFilterDTO

PropertyTypeRequiredDescription
operator'gt' | 'gte' | 'lt' | 'lte' | 'eq'YesComparison operator for date filtering.
valueDateYesDate value to compare against.

Example

{
"page": 1,
"limit": 20,
"email": "john",
"isEmailVerified": true,
"hasSocialAuth": true,
"createdAt": {
"operator": "gte",
"value": "2024-01-01T00:00:00.000Z"
},
"sortBy": "createdAt",
"sortOrder": "DESC"
}

Used By