-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove ambiguity between auth User and UA user (#782)
* fix: remove ambiguity between auth User and UA user closes #781 * fix(user): expose user resource and interfaces
- Loading branch information
Showing
10 changed files
with
109 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import {ReadServiceHealthApi, ReadServiceHealthResponse, ReadServiceStatusResponse} from '../ReadServiceCommon.js'; | ||
import ReadServiceResource from '../ReadServiceResource.js'; | ||
import { | ||
UAUserFilterParams, | ||
UAUsersFiltersModel, | ||
ListUAUsersFiltersParams, | ||
ListUAUsersReportsParams, | ||
UAUsersReportsModel, | ||
UAUserModel, | ||
} from './UAUsersInterfaces.js'; | ||
|
||
export default class UAUsers extends ReadServiceResource implements ReadServiceHealthApi { | ||
static baseUrl = '/rest/ua/v15/users'; | ||
|
||
/** | ||
* Get the data level filters that apply to a user. | ||
* | ||
* @param userId The unique identifier of a user. | ||
*/ | ||
listUserFilters(userId: string, params?: ListUAUsersFiltersParams) { | ||
return this.api.get<UAUsersFiltersModel>(this.buildPathWithOrg(`${UAUsers.baseUrl}/${userId}/filters`, params)); | ||
} | ||
|
||
/** | ||
* Set the filters that will be applied to a user query. | ||
* | ||
* @param userId The unique identifier of a user. | ||
*/ | ||
updateUserFilters(userId: string, filters: UAUserFilterParams[]) { | ||
return this.api.put<void>(this.buildPathWithOrg(`${UAUsers.baseUrl}/${userId}/filters`), filters); | ||
} | ||
|
||
/** | ||
* Get the reports that a user can access. | ||
* | ||
* @param userId The unique identifier of a user. | ||
*/ | ||
listUsersReports(userId: string, params?: ListUAUsersReportsParams) { | ||
return this.api.get<UAUsersReportsModel>(this.buildPathWithOrg(`${UAUsers.baseUrl}/${userId}/reports`, params)); | ||
} | ||
|
||
/** | ||
* Set which reports a user can access. | ||
* | ||
* @param userId The unique identifier of a user. | ||
*/ | ||
updateUsersReports(userId: string, reportsIDs: string[]) { | ||
return this.api.put<void>(this.buildPathWithOrg(`${UAUsers.baseUrl}/${userId}/reports`), reportsIDs); | ||
} | ||
|
||
/** | ||
* Get a user. | ||
* | ||
* @param userId The unique identifier of a user. | ||
*/ | ||
getUser(userId: string) { | ||
return this.api.get<UAUserModel>(this.buildPathWithOrg(`${UAUsers.baseUrl}/${userId}`)); | ||
} | ||
|
||
checkHealth() { | ||
return this.api.get<ReadServiceHealthResponse>(`${UAUsers.baseUrl}/monitoring/health`); | ||
} | ||
|
||
checkStatus() { | ||
return this.api.get<ReadServiceStatusResponse>(`${UAUsers.baseUrl}/status`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './UAUsers.js'; | ||
export * from './UAUsersInterfaces.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.