Přeskočit na hlavní obsah

Module: client/userManagementClient

Functions​

createUser​

▸ createUser(data, roleTitle, token): Promise<Submission>

Create a new user.

Parameters​

NameTypeDescription
dataObjectUser's login data.
data.idstringId of the new user.
data.passwordstringPassword of the new user.
roleTitleUserRoleTitleRole to assign to the user.
tokenstringJWT token for formio.

Returns​

Promise<Submission>

Representing the user.

Defined in​

src/web-app/src/client/userManagementClient.ts:625


deleteAssignee​

▸ deleteAssignee(userSubmissionId, token): Promise<void>

Delete user with the role UserRoleTitles.ASSIGNEE from the user management system.

Parameters​

NameTypeDescription
userSubmissionIdstringId of the user submission to delete.
tokenstringJWT token for formio.

Returns​

Promise<void>

Throws

If the returned http status is not OK.

Throws

When a network error is encountered or CORS is misconfigured on the server-side.

Defined in​

src/web-app/src/client/userManagementClient.ts:126


deleteUser​

▸ deleteUser(userSubmissionId, userRoleTitle, token): Promise<void>

Delete any user.

Parameters​

NameTypeDescription
userSubmissionIdstringId of the user submission to delete.
userRoleTitleUserRoleTitleRole of the user to delete.
tokenstringJWT token for formio.

Returns​

Promise<void>

Defined in​

src/web-app/src/client/userManagementClient.ts:345


getCurrentUser​

▸ getCurrentUser(token): Promise<User>

Get current user.

Parameters​

NameTypeDescription
tokenstringJWT token of the user.

Returns​

Promise<User>

Current user.

Throws

If the returned http status is not OK.

Throws

If the response is not valid json or when a network error is encountered or CORS is misconfigured on the server-side.

Defined in​

src/web-app/src/client/userManagementClient.ts:607


loadAssignee​

▸ loadAssignee(userSubmissionId, token): Promise<User | null>

Load user with the role UserRoleTitles.ASSIGNEE based on user ID.

Parameters​

NameTypeDescription
userSubmissionIdstringId of the submission that represents the user.
tokenstringJWT token for formio.

Returns​

Promise<User | null>

User or null if the user does not exist.

Throws

If the returned http status is not OK (and not 404).

Throws

If the response is not valid json or when a network error is encountered or CORS is misconfigured on the server-side.

Defined in​

src/web-app/src/client/userManagementClient.ts:94


loadAssignees​

▸ loadAssignees(root0): Promise<{ data: User[] ; totalCount: number }>

Load users from the user management system with the role UserRoleTitles.ASSIGNEE.

Parameters​

NameTypeDescription
root0ObjectOptions.
root0.filters?{ comparedValue: string ; fieldPath: string ; operation: "contains" }[]Filters to apply.
root0.paginationObjectPagination settings.
root0.pagination.limitnumber-
root0.pagination.offsetnumber-
root0.sort?ObjectSorting configuration.
root0.sort.fieldstring-
root0.sort.order"asc" | "desc"-
root0.tokenstringJWT token for formio.

Returns​

Promise<{ data: User[] ; totalCount: number }>

List of all assignees.

Throws

If the returned http status is not OK.

Throws

If the response is not valid json or when a network error is encountered or CORS is misconfigured on the server-side.

Throws

If the Content-Range header is invalid or unknown.

Defined in​

src/web-app/src/client/userManagementClient.ts:30


loadAssigners​

▸ loadAssigners(root0): Promise<{ data: User & { mainUserRoleTitle: UserRoleTitle }[] ; totalCount: number }>

Load employees with role UserRoleTitles.ASSIGNER.

Parameters​

NameTypeDescription
root0ObjectOptions.
root0.filters?{ comparedValue: string ; fieldPath: string ; operation: "contains" }[]Filters to apply.
root0.paginationObjectPagination settings.
root0.pagination.limitnumber-
root0.pagination.offsetnumber-
root0.sort?ObjectSorting configuration.
root0.sort.fieldstring-
root0.sort.order"asc" | "desc"-
root0.tokenstringJWT token for formio.

Returns​

Promise<{ data: User & { mainUserRoleTitle: UserRoleTitle }[] ; totalCount: number }>

Defined in​

src/web-app/src/client/userManagementClient.ts:248


loadFormManager​

▸ loadFormManager(root0): Promise<{ data: User & { mainUserRoleTitle: UserRoleTitle }[] ; totalCount: number }>

Load employees with role UserRoleTitles.FORM_MANAGER.

Parameters​

NameTypeDescription
root0ObjectOptions.
root0.filters?{ comparedValue: string ; fieldPath: string ; operation: "contains" }[]Filters to apply.
root0.paginationObjectPagination settings.
root0.pagination.limitnumber-
root0.pagination.offsetnumber-
root0.sort?ObjectSorting configuration.
root0.sort.fieldstring-
root0.sort.order"asc" | "desc"-
root0.tokenstringJWT token for formio.

Returns​

Promise<{ data: User & { mainUserRoleTitle: UserRoleTitle }[] ; totalCount: number }>

Throws

If the Content-Range header is invalid or unknown.

Defined in​

src/web-app/src/client/userManagementClient.ts:169


loadRoles​

▸ loadRoles(token): Promise<Role[]>

Load all roles from the user management system.

Parameters​

NameTypeDescription
tokenstringJWT token for formio.

Returns​

Promise<Role[]>

List of all roles.

Throws

If the returned http status is not OK.

Throws

If the response is not valid json or when a network error is encountered or CORS is misconfigured on the server-side.

Defined in​

src/web-app/src/client/userManagementClient.ts:147


loginAdmin​

▸ loginAdmin(email, password): Promise<string>

Logs in the admin account and returns the token.

Parameters​

NameTypeDescription
emailstringEmail of the admin account.
passwordstringPassword of the admin account.

Returns​

Promise<string>

JWT token with admin privileges.

Throws

If the returned http status is not OK.

Throws

When a network error is encountered or CORS is misconfigured on the server-side.

Defined in​

src/web-app/src/client/userManagementClient.ts:399


loginUser​

▸ loginUser(id, password): Promise<{ token: string ; user: User }>

Log in as a user.

Parameters​

NameTypeDescription
idstringId of the user.
passwordstringPassword of the user.

Returns​

Promise<{ token: string ; user: User }>

User and JWT token.

Throws

If the returned http status is not OK.

Throws

When a network error is encountered or CORS is misconfigured on the server-side.

Defined in​

src/web-app/src/client/userManagementClient.ts:459


refreshToken​

▸ refreshToken(currentToken): Promise<string>

Refreshes the token of a user.

Parameters​

NameTypeDescription
currentTokenstringCurrent JWT token of the user.

Returns​

Promise<string>

New JWT token.

Throws

If the returned http status is not OK.

Throws

When a network error is encountered or CORS is misconfigured on the server-side.

Defined in​

src/web-app/src/client/userManagementClient.ts:433


updateUser​

▸ updateUser(submissionId, data, roleTitle, token): Promise<void>

Update any user's account.

Parameters​

NameTypeDescription
submissionIdstringId of the submission to update.
dataObjectNew data to update the submission with.
data.idstringId of the user.
data.passwordstringNew password of the user.
roleTitleUserRoleTitleTitle of the role of the user.
tokenstringJWT token for formio.

Returns​

Promise<void>

Updated submission.

Throws

If the returned http status is not OK.

Throws

If the response is not valid json or when a network error is encountered or CORS is misconfigured on the server-side.

Defined in​

src/web-app/src/client/userManagementClient.ts:506