IUserModuleService
The main service interface for the user module.
Methods
validateInviteToken
This method validates an invite token.
Parameters
token
stringRequiredReturns
The associated invite's details.
refreshInviteTokens
Parameters
inviteIds
string[]RequiredReturns
retrieve
This method retrieves a user by its ID.
Example
A simple example that retrieves a {type name} by its ID:
To specify relations that should be retrieved:
Parameters
id
stringRequiredconfig
FindConfig<UserDTO>The configurations determining how the user is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a user.
config
FindConfig<UserDTO>select
or relations
, accept the
attributes or relations associated with a user.Returns
The retrieved user.
list
This method retrieves a paginated list of users based on optional filters and configuration.
Example
To retrieve a list of {type name} using their IDs:
To specify relations that should be retrieved within the {type name}:
By default, only the first {default limit}
records are retrieved. You can control pagination by specifying the skip
and take
properties of the config
parameter:
Parameters
filters
FilterableUserPropsThe filters to apply on the retrieved user.
filters
FilterableUserPropsconfig
FindConfig<UserDTO>The configurations determining how the user is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a user.
config
FindConfig<UserDTO>select
or relations
, accept the
attributes or relations associated with a user.Returns
The list of users.
listAndCount
This method retrieves a paginated list of user along with the total count of available users satisfying the provided filters.
Example
To retrieve a list of {type name} using their IDs:
To specify relations that should be retrieved within the {type name}:
By default, only the first {default limit}
records are retrieved. You can control pagination by specifying the skip
and take
properties of the config
parameter:
Parameters
filters
FilterableUserPropsThe filters to apply on the retrieved user.
filters
FilterableUserPropsconfig
FindConfig<UserDTO>The configurations determining how the user is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a user.
config
FindConfig<UserDTO>select
or relations
, accept the
attributes or relations associated with a user.Returns
The list of users along with their total count.
create
**create**(data, sharedContext?): Promise<[UserDTO](types.UserTypes.UserDTO.mdx)[]>
This method creates users.
Example
Parameters
The users to be created.
Returns
The created users.
**create**(data, sharedContext?): Promise<[UserDTO](types.UserTypes.UserDTO.mdx)>
This method creates a user.
Example
Parameters
The user to be created.
Returns
The created user.
update
**update**(data, sharedContext?): Promise<[UserDTO](types.UserTypes.UserDTO.mdx)[]>
This method updates existing users.
Example
Parameters
The attributes to update in each user.
Returns
The updated users.
**update**(data, sharedContext?): Promise<[UserDTO](types.UserTypes.UserDTO.mdx)>
This method updates an existing user.
Example
Parameters
The attributes to update in the user.
Returns
The updated user.
delete
This method deletes users by their IDs.
Example
Parameters
ids
string[]RequiredReturns
Promise
Promise<void>RequiredsoftDelete
Type Parameters
TReturnableLinkableKeys
stringRequiredParameters
userIds
string[]Requiredconfig
SoftDeleteReturn<TReturnableLinkableKeys>
config
SoftDeleteReturn<TReturnableLinkableKeys>Returns
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>Required
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>Requiredrestore
Type Parameters
TReturnableLinkableKeys
stringRequiredParameters
userIds
string[]Requiredconfig
RestoreReturn<TReturnableLinkableKeys>
config
RestoreReturn<TReturnableLinkableKeys>Returns
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>Required
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>RequiredretrieveInvite
Parameters
id
stringRequiredconfig
FindConfig<InviteDTO>
config
FindConfig<InviteDTO>Returns
listInvites
Parameters
filters
FilterableUserProps
filters
FilterableUserPropsconfig
FindConfig<InviteDTO>
config
FindConfig<InviteDTO>Returns
listAndCountInvites
Parameters
filters
FilterableUserProps
filters
FilterableUserPropsconfig
FindConfig<InviteDTO>
config
FindConfig<InviteDTO>Returns
createInvites
**createInvites**(data, sharedContext?): Promise<[InviteDTO](types.UserTypes.InviteDTO.mdx)[]>
Parameters
Returns
**createInvites**(data, sharedContext?): Promise<[InviteDTO](types.UserTypes.InviteDTO.mdx)>
Parameters
Returns
updateInvites
**updateInvites**(data, sharedContext?): Promise<[InviteDTO](types.UserTypes.InviteDTO.mdx)[]>
Parameters
Returns
**updateInvites**(data, sharedContext?): Promise<[InviteDTO](types.UserTypes.InviteDTO.mdx)>
Parameters
Returns
deleteInvites
Parameters
ids
string[]RequiredReturns
Promise
Promise<void>RequiredsoftDeleteInvites
Type Parameters
TReturnableLinkableKeys
stringRequiredParameters
inviteIds
string[]Requiredconfig
SoftDeleteReturn<TReturnableLinkableKeys>
config
SoftDeleteReturn<TReturnableLinkableKeys>Returns
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>Required
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>RequiredrestoreInvites
Type Parameters
TReturnableLinkableKeys
stringRequiredParameters
inviteIds
string[]Requiredconfig
RestoreReturn<TReturnableLinkableKeys>
config
RestoreReturn<TReturnableLinkableKeys>Returns
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>Required
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>Required