This is an automated email from the ASF dual-hosted git repository. ocket8888 pushed a commit to branch 4.x in repository https://gitbox.apache.org/repos/asf/trafficcontrol-trafficops-types.git
commit 51c88a8f67098e074325edabe7131655daedae43 Author: ocket8888 <[email protected]> AuthorDate: Tue Jan 24 14:08:33 2023 -0700 Update Role structure for v4 --- src/user.ts | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/user.ts b/src/user.ts index 43fa2e4..0fa9972 100644 --- a/src/user.ts +++ b/src/user.ts @@ -203,19 +203,35 @@ export type CurrentUser = ResponseCurrentUser | RequestCurrentUser; * Represents a Role as Traffic Ops requires it in requests. */ export interface RequestRole { - capabilities: Array<string>; + /** + * This will be null in responses if it is null or undefined in the request. + */ + permissions?: Array<string> | null; description: string; name: string; - privLevel: number; } /** - * Represents a Role as Traffic Ops presents it in responses. + * Represents a Role in a response to a PUT request. + * + * Note that this should not be different from a `PostResponseRole` - but + * currently is (because it's missing `lastUpdated`). This bug is tracked by + * [apache/trafficcontrol#7248](https://github.com/apache/trafficcontrol/issues/7248). */ -export interface ResponseRole extends RequestRole { - readonly id: number; +export type PutResponseRole = RequestRole; + +/** + * Represents a Role as Traffic Ops presents it in responses to POST requests. + */ +export interface PostResponseRole extends PutResponseRole { + readonly lastUpdated: Date; } +/** + * Represents a Role as Traffic Ops presents it in responses. + */ +export type ResponseRole = PutResponseRole | PostResponseRole; + /** * A Role encapsulates the permissions to perform operations through the Traffic * Ops API.
