Class UserOperations
Methods
list
-
List one page of your organization's external users.
Parameters
- options: ListUsersOptions = {}
A search, the page, and a deadline.
Returns Promise<ExternalUserList>
The page of users, and how many match in all.
- options: ListUsersOptions = {}
get
-
Fetch one external user, by your own id for them.
Parameters
- externalId: string
Your id for the user.
- options: TimeoutOptions = {}
Per-call deadline.
Returns Promise<ExternalUser>
The user.
- externalId: string
create
-
Create an external user: one of your own users, known to Memco by your id for them.
The user has no sign-in of its own, and never holds
admin. It starts in no network: place it in a customer network with NetworkOperations.addMember, passing the created user's ExternalUser.id.Parameters
- externalId: string
Your id for the user, unique within your organization. It cannot be changed later.
- options: CreateUserOptions
The user's roles, name and email, and a deadline.
Returns Promise<ExternalUser>
The user as created.
- externalId: string
createOrGet
-
Create an external user, or return the one already holding its id.
Safe when two callers race to create one user: the loser is handed the winner's. The existing user is returned as it is; its roles, name and email are not compared with
optionsor changed.Parameters
- externalId: string
Your id for the user, unique within your organization.
- options: CreateUserOptions
The user's roles, name and email, and a deadline for each call made.
Returns Promise<ExternalUser>
The user as created, or as it already was.
- externalId: string
update
-
Change an external user's name, email or roles.
Parameters
- externalId: string
Your id for the user to change.
- options: UpdateUserOptions = {}
What to change, and a deadline. A field left out stays as it is; an empty name or email clears it.
Returns Promise<ExternalUser>
The user as it now is.
- externalId: string
delete
-
Delete an external user, and every API key it holds.
Parameters
- externalId: string
Your id for the user to delete.
- options: TimeoutOptions = {}
Per-call deadline.
Returns Promise<void>
- externalId: string
listKeys
-
List an external user's API keys, without their values.
Parameters
- externalId: string
Your id for the user whose keys to list.
- options: TimeoutOptions = {}
Per-call deadline.
Returns Promise<readonly ExternalUserKey[]>
The user's keys. A value is shown only once, when its key is created, so none is here.
- externalId: string
createKey
-
Create an API key acting as an external user.
The key's value is returned here and never again, so store it now.
Parameters
- externalId: string
Your id for the user the key acts as.
- options: CreateKeyOptions
The kind of key, its name and expiry, and a deadline.
Returns Promise<CreatedKey>
The key's description, and its value.
- externalId: string
deleteKey
-
Revoke one of an external user's API keys.
Parameters
- externalId: string
Your id for the user the key belongs to.
- options: DeleteKeyOptions
The key, and a deadline.
Returns Promise<void>
- externalId: string
External users and their API keys, reached as
client.users.Every method names a user by your own id for them, the
externalIdthey were created with.Example