directus-monorepo ( Readme | API )
directus-monorepo > UsersService
new UsersService(
options):UsersService
| Parameter | Type |
|---|---|
options |
AbstractServiceOptions |
accountability:
any
cache:
null|Keyv<any,Record<string,unknown> >
collection:
string
eventScope:
string
knex:
Knex<any,any[] >
schema:
SchemaOverview
acceptInvite(
token,password):Promise<void>
| Parameter | Type |
|---|---|
token |
string |
password |
string |
Promise< void >
privatecheckPasswordPolicy(passwords):Promise<void>
Check if the provided password matches the strictness as configured in directus_settings.auth_password_policy
| Parameter | Type |
|---|---|
passwords |
string[] |
Promise< void >
privatecheckRemainingActiveAdmin(excludeKeys):Promise<void>
Make sure there's at least one active admin user when updating user status
| Parameter | Type |
|---|---|
excludeKeys |
PrimaryKey[] |
Promise< void >
privatecheckRemainingAdminExistence(excludeKeys):Promise<void>
| Parameter | Type |
|---|---|
excludeKeys |
PrimaryKey[] |
Promise< void >
privatecheckUniqueEmails(emails,excludeKey?):Promise<void>
User email has to be unique case-insensitive. This is an additional check to make sure that the email is unique regardless of casing
| Parameter | Type |
|---|---|
emails |
string[] |
excludeKey? |
PrimaryKey |
Promise< void >
createMany(
data,opts?):Promise<PrimaryKey[] >
Create multiple new users
| Parameter | Type |
|---|---|
data |
Partial< Item >[] |
opts? |
MutationOptions |
Promise< PrimaryKey[] >
createMutationTracker(
initialCount=0):MutationTracker
| Parameter | Type | Default value |
|---|---|---|
initialCount |
number |
0 |
ItemsService.createMutationTracker
createOne(
data,opts?):Promise<PrimaryKey>
Create a new user
| Parameter | Type |
|---|---|
data |
Partial< Item > |
opts? |
MutationOptions |
Promise< PrimaryKey >
deleteByQuery(
query,opts?):Promise<PrimaryKey[] >
Delete multiple items by query
| Parameter | Type |
|---|---|
query |
Query |
opts? |
MutationOptions |
Promise< PrimaryKey[] >
deleteMany(
keys,opts?):Promise<PrimaryKey[] >
Delete multiple users by primary key
| Parameter | Type |
|---|---|
keys |
PrimaryKey[] |
opts? |
MutationOptions |
Promise< PrimaryKey[] >
deleteOne(
key,opts?):Promise<PrimaryKey>
Delete a single user by primary key
| Parameter | Type |
|---|---|
key |
PrimaryKey |
opts? |
MutationOptions |
Promise< PrimaryKey >
getKeysByQuery(
query):Promise<PrimaryKey[] >
| Parameter | Type |
|---|---|
query |
Query |
Promise< PrimaryKey[] >
privategetUserByEmail(Promise< {id:string;password:string;role:string;status:string;} >
Get basic information of user identified by email
| Parameter | Type |
|---|---|
email |
string |
Promise< {id: string; password: string; role: string; status: string;} >
privateinviteUrl(url):string
Create url for inviting users
| Parameter | Type |
|---|---|
email |
string |
url |
null | string |
string
inviteUser(
role,url,subject?):Promise<void>
| Parameter | Type |
|---|---|
email |
string | string[] |
role |
string |
url |
null | string |
subject? |
null | string |
Promise< void >
readByQuery(
query,opts?):Promise<Item[] >
Get items by query
| Parameter | Type |
|---|---|
query |
Query |
opts? |
QueryOptions |
Promise< Item[] >
readMany(
keys,query={},opts?):Promise<Item[] >
Get multiple items by primary keys
| Parameter | Type |
|---|---|
keys |
PrimaryKey[] |
query |
Query |
opts? |
QueryOptions |
Promise< Item[] >
readOne(
key,query={},opts?):Promise<Item>
Get single item by primary key
| Parameter | Type |
|---|---|
key |
PrimaryKey |
query |
Query |
opts? |
QueryOptions |
Promise< Item >
readSingleton(
query,opts?):Promise<Partial<Item> >
Read/treat collection as singleton
| Parameter | Type |
|---|---|
query |
Query |
opts? |
QueryOptions |
Promise< Partial< Item > >
requestPasswordReset(
url,subject?):Promise<void>
| Parameter | Type |
|---|---|
email |
string |
url |
null | string |
subject? |
null | string |
Promise< void >
resetPassword(
token,password):Promise<void>
| Parameter | Type |
|---|---|
token |
string |
password |
string |
Promise< void >
updateBatch(
data,opts={}):Promise<PrimaryKey[] >
Update multiple items in a single transaction
| Parameter | Type |
|---|---|
data |
Partial< Item >[] |
opts |
MutationOptions |
Promise< PrimaryKey[] >
updateByQuery(
query,data,opts?):Promise<PrimaryKey[] >
Update many users by query
| Parameter | Type |
|---|---|
query |
Query |
data |
Partial< Item > |
opts? |
MutationOptions |
Promise< PrimaryKey[] >
updateMany(
keys,data,opts?):Promise<PrimaryKey[] >
Update many users by primary key
| Parameter | Type |
|---|---|
keys |
PrimaryKey[] |
data |
Partial< Item > |
opts? |
MutationOptions |
Promise< PrimaryKey[] >
updateOne(
key,data,opts?):Promise<PrimaryKey>
Update a single user by primary key
| Parameter | Type |
|---|---|
key |
PrimaryKey |
data |
Partial< Item > |
opts? |
MutationOptions |
Promise< PrimaryKey >
upsertMany(
payloads,opts={}):Promise<PrimaryKey[] >
Upsert many items
| Parameter | Type |
|---|---|
payloads |
Partial< Item >[] |
opts |
MutationOptions |
Promise< PrimaryKey[] >
upsertOne(
payload,opts?):Promise<PrimaryKey>
Upsert a single item
| Parameter | Type |
|---|---|
payload |
Partial< Item > |
opts? |
MutationOptions |
Promise< PrimaryKey >
upsertSingleton(
data,opts?):Promise<PrimaryKey>
Upsert/treat collection as singleton
| Parameter | Type |
|---|---|
data |
Partial< Item > |
opts? |
MutationOptions |
Promise< PrimaryKey >
api/src/services/items.ts:1018
privatevalidateEmail(input):void
Validate array of emails. Intended to be used with create/update users
| Parameter | Type |
|---|---|
input |
string | string[] |
void
Generated using TypeDoc and typedoc-plugin-markdown