chore: add updated_at to codersdk users (#13928)

* chore: add updated_at to codersdk users
This commit is contained in:
Steven Masley
2024-07-17 17:59:42 -05:00
committed by GitHub
parent 3e1fae7d3d
commit 44924cd8d8
14 changed files with 71 additions and 2 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ USAGE:
OPTIONS:
-c, --column string-array (default: username,email,created_at,status)
Columns to display in table output. Available columns: id, username,
email, created at, status.
email, created at, updated at, status.
-o, --output string (default: table)
Output format. Available formats: table, json.
+2
View File
@@ -6,6 +6,7 @@
"name": "Test User",
"email": "testuser@coder.com",
"created_at": "[timestamp]",
"updated_at": "[timestamp]",
"last_seen_at": "[timestamp]",
"status": "active",
"login_type": "password",
@@ -27,6 +28,7 @@
"name": "",
"email": "testuser2@coder.com",
"created_at": "[timestamp]",
"updated_at": "[timestamp]",
"last_seen_at": "[timestamp]",
"status": "dormant",
"login_type": "password",
+12
View File
@@ -11134,6 +11134,10 @@ const docTemplate = `{
"theme_preference": {
"type": "string"
},
"updated_at": {
"type": "string",
"format": "date-time"
},
"username": {
"type": "string"
}
@@ -11949,6 +11953,10 @@ const docTemplate = `{
"theme_preference": {
"type": "string"
},
"updated_at": {
"type": "string",
"format": "date-time"
},
"username": {
"type": "string"
}
@@ -12518,6 +12526,10 @@ const docTemplate = `{
"theme_preference": {
"type": "string"
},
"updated_at": {
"type": "string",
"format": "date-time"
},
"username": {
"type": "string"
}
+12
View File
@@ -10040,6 +10040,10 @@
"theme_preference": {
"type": "string"
},
"updated_at": {
"type": "string",
"format": "date-time"
},
"username": {
"type": "string"
}
@@ -10832,6 +10836,10 @@
"theme_preference": {
"type": "string"
},
"updated_at": {
"type": "string",
"format": "date-time"
},
"username": {
"type": "string"
}
@@ -11353,6 +11361,10 @@
"theme_preference": {
"type": "string"
},
"updated_at": {
"type": "string",
"format": "date-time"
},
"username": {
"type": "string"
}
+1
View File
@@ -151,6 +151,7 @@ func ReducedUser(user database.User) codersdk.ReducedUser {
Email: user.Email,
Name: user.Name,
CreatedAt: user.CreatedAt,
UpdatedAt: user.UpdatedAt,
LastSeenAt: user.LastSeenAt,
Status: codersdk.UserStatus(user.Status),
LoginType: codersdk.LoginType(user.LoginType),
+1
View File
@@ -51,6 +51,7 @@ type ReducedUser struct {
Name string `json:"name"`
Email string `json:"email" validate:"required" table:"email" format:"email"`
CreatedAt time.Time `json:"created_at" validate:"required" table:"created at" format:"date-time"`
UpdatedAt time.Time `json:"updated_at" table:"updated at" format:"date-time"`
LastSeenAt time.Time `json:"last_seen_at" format:"date-time"`
Status UserStatus `json:"status" table:"status" enums:"active,suspended"`
+1
View File
@@ -74,6 +74,7 @@ curl -X GET http://coder-server:8080/api/v2/audit?limit=0 \
],
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
},
"user_agent": "string"
+13
View File
@@ -212,6 +212,7 @@ curl -X GET http://coder-server:8080/api/v2/groups/{group} \
"name": "string",
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
],
@@ -269,6 +270,7 @@ curl -X DELETE http://coder-server:8080/api/v2/groups/{group} \
"name": "string",
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
],
@@ -341,6 +343,7 @@ curl -X PATCH http://coder-server:8080/api/v2/groups/{group} \
"name": "string",
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
],
@@ -1071,6 +1074,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/groups
"name": "string",
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
],
@@ -1108,6 +1112,7 @@ Status Code **200**
| `»» name` | string | false | | |
| `»» status` | [codersdk.UserStatus](schemas.md#codersdkuserstatus) | false | | |
| `»» theme_preference` | string | false | | |
| `»» updated_at` | string(date-time) | false | | |
| `»» username` | string | true | | |
| `» name` | string | false | | |
| `» organization_id` | string(uuid) | false | | |
@@ -1183,6 +1188,7 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/groups
"name": "string",
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
],
@@ -1241,6 +1247,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/groups/
"name": "string",
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
],
@@ -1726,6 +1733,7 @@ curl -X PATCH http://coder-server:8080/api/v2/scim/v2/Users/{id} \
],
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
```
@@ -1782,6 +1790,7 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template}/acl \
],
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
]
@@ -1815,6 +1824,7 @@ Status Code **200**
| `»» organization_id` | string | false | | |
| `» status` | [codersdk.UserStatus](schemas.md#codersdkuserstatus) | false | | |
| `» theme_preference` | string | false | | |
| `» updated_at` | string(date-time) | false | | |
| `» username` | string | true | | |
#### Enumerated Values
@@ -1937,6 +1947,7 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template}/acl/available \
"name": "string",
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
],
@@ -1957,6 +1968,7 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template}/acl/available \
"name": "string",
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
]
@@ -1991,6 +2003,7 @@ Status Code **200**
| `»»» name` | string | false | | |
| `»»» status` | [codersdk.UserStatus](schemas.md#codersdkuserstatus) | false | | |
| `»»» theme_preference` | string | false | | |
| `»»» updated_at` | string(date-time) | false | | |
| `»»» username` | string | true | | |
| `»» name` | string | false | | |
| `»» organization_id` | string(uuid) | false | | |
+12
View File
@@ -239,6 +239,7 @@
"name": "string",
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
],
@@ -259,6 +260,7 @@
"name": "string",
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
]
@@ -583,6 +585,7 @@
],
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
},
"user_agent": "string"
@@ -663,6 +666,7 @@
],
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
},
"user_agent": "string"
@@ -2688,6 +2692,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
],
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
]
@@ -2739,6 +2744,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
"name": "string",
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
],
@@ -4043,6 +4049,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
"name": "string",
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
```
@@ -4060,6 +4067,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
| `name` | string | false | | |
| `status` | [codersdk.UserStatus](#codersdkuserstatus) | false | | |
| `theme_preference` | string | false | | |
| `updated_at` | string | false | | |
| `username` | string | true | | |
#### Enumerated Values
@@ -4935,6 +4943,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
],
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
```
@@ -4955,6 +4964,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
| `roles` | array of [codersdk.SlimRole](#codersdkslimrole) | false | | |
| `status` | [codersdk.UserStatus](#codersdkuserstatus) | false | | |
| `theme_preference` | string | false | | |
| `updated_at` | string | false | | |
| `username` | string | true | | |
#### Enumerated Values
@@ -5564,6 +5574,7 @@ If the schedule is empty, the user will be updated to use the default schedule.|
],
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
```
@@ -5583,6 +5594,7 @@ If the schedule is empty, the user will be updated to use the default schedule.|
| `roles` | array of [codersdk.SlimRole](#codersdkslimrole) | false | | |
| `status` | [codersdk.UserStatus](#codersdkuserstatus) | false | | |
| `theme_preference` | string | false | | |
| `updated_at` | string | false | | |
| `username` | string | true | | |
#### Enumerated Values
+9
View File
@@ -48,6 +48,7 @@ curl -X GET http://coder-server:8080/api/v2/users \
],
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
]
@@ -119,6 +120,7 @@ curl -X POST http://coder-server:8080/api/v2/users \
],
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
```
@@ -391,6 +393,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user} \
],
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
```
@@ -481,6 +484,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/appearance \
],
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
```
@@ -1142,6 +1146,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/profile \
],
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
```
@@ -1196,6 +1201,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/roles \
],
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
```
@@ -1260,6 +1266,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/roles \
],
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
```
@@ -1314,6 +1321,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/status/activate \
],
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
```
@@ -1368,6 +1376,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/status/suspend \
],
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
```
+1 -1
View File
@@ -21,7 +21,7 @@ coder users list [flags]
| Type | <code>string-array</code> |
| Default | <code>username,email,created_at,status</code> |
Columns to display in table output. Available columns: id, username, email, created at, status.
Columns to display in table output. Available columns: id, username, email, created at, updated at, status.
### -o, --output
+1
View File
@@ -1005,6 +1005,7 @@ export interface ReducedUser extends MinimalUser {
readonly name: string;
readonly email: string;
readonly created_at: string;
readonly updated_at: string;
readonly last_seen_at: string;
readonly status: UserStatus;
readonly login_type: LoginType;
@@ -30,6 +30,7 @@ describe("AccountPage", () => {
id: userId,
email: "user@coder.com",
created_at: new Date().toISOString(),
updated_at: new Date().toISOString(),
status: "active",
organization_ids: ["123"],
roles: [],
+4
View File
@@ -307,6 +307,7 @@ export const MockUser: TypesGen.User = {
username: "TestUser",
email: "test@coder.com",
created_at: "",
updated_at: "",
status: "active",
organization_ids: [MockOrganization.id],
roles: [MockOwnerRole],
@@ -322,6 +323,7 @@ export const MockUserAdmin: TypesGen.User = {
username: "TestUser",
email: "test@coder.com",
created_at: "",
updated_at: "",
status: "active",
organization_ids: [MockOrganization.id],
roles: [MockUserAdminRole],
@@ -337,6 +339,7 @@ export const MockUser2: TypesGen.User = {
username: "TestUser2",
email: "test2@coder.com",
created_at: "",
updated_at: "",
status: "active",
organization_ids: [MockOrganization.id],
roles: [],
@@ -352,6 +355,7 @@ export const SuspendedMockUser: TypesGen.User = {
username: "SuspendedMockUser",
email: "iamsuspendedsad!@coder.com",
created_at: "",
updated_at: "",
status: "suspended",
organization_ids: [MockOrganization.id],
roles: [],