Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support user's console_preferences storage #6890

Merged
merged 5 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ lint:
- ttn/lorawan/v3/metadata.proto
- ttn/lorawan/v3/notification_service.proto
- ttn/lorawan/v3/rights.proto
- ttn/lorawan/v3/user.proto
FIELD_LOWER_SNAKE_CASE:
- ttn/lorawan/v3/applicationserver_integrations_alcsync.proto
FILE_LOWER_SNAKE_CASE:
Expand Down
75 changes: 75 additions & 0 deletions api/ttn/lorawan/v3/api.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<a name="top"></a>

Check warning on line 1 in api/ttn/lorawan/v3/api.md

View workflow job for this annotation

GitHub Actions / Check Mergeability

api/ttn/lorawan/v3/api.md has a conflict when merging TheThingsIndustries/lorawan-stack:v3.30.

# API Documentation

Expand Down Expand Up @@ -769,10 +769,15 @@
- [Message `UpdateUserRequest`](#ttn.lorawan.v3.UpdateUserRequest)
- [Message `User`](#ttn.lorawan.v3.User)
- [Message `User.AttributesEntry`](#ttn.lorawan.v3.User.AttributesEntry)
- [Message `UserConsolePreferences`](#ttn.lorawan.v3.UserConsolePreferences)
- [Message `UserConsolePreferences.DashboardLayouts`](#ttn.lorawan.v3.UserConsolePreferences.DashboardLayouts)
- [Message `UserConsolePreferences.SortBy`](#ttn.lorawan.v3.UserConsolePreferences.SortBy)
- [Message `UserSession`](#ttn.lorawan.v3.UserSession)
- [Message `UserSessionIdentifiers`](#ttn.lorawan.v3.UserSessionIdentifiers)
- [Message `UserSessions`](#ttn.lorawan.v3.UserSessions)
- [Message `Users`](#ttn.lorawan.v3.Users)
- [Enum `ConsoleTheme`](#ttn.lorawan.v3.ConsoleTheme)
- [Enum `DashboardLayout`](#ttn.lorawan.v3.DashboardLayout)
- [File `ttn/lorawan/v3/user_services.proto`](#ttn/lorawan/v3/user_services.proto)
- [Service `UserAccess`](#ttn.lorawan.v3.UserAccess)
- [Service `UserInvitationRegistry`](#ttn.lorawan.v3.UserInvitationRegistry)
Expand Down Expand Up @@ -10835,6 +10840,7 @@
| `temporary_password_created_at` | [`google.protobuf.Timestamp`](#google.protobuf.Timestamp) | | |
| `temporary_password_expires_at` | [`google.protobuf.Timestamp`](#google.protobuf.Timestamp) | | |
| `profile_picture` | [`Picture`](#ttn.lorawan.v3.Picture) | | A profile picture for the user. This information is public and can be seen by any authenticated user in the network. |
| `console_preferences` | [`UserConsolePreferences`](#ttn.lorawan.v3.UserConsolePreferences) | | Console preferences contains the user's preferences regarding the behavior of the Console. |

#### Field Rules

Expand All @@ -10858,6 +10864,55 @@
| `key` | [`string`](#string) | | |
| `value` | [`string`](#string) | | |

### <a name="ttn.lorawan.v3.UserConsolePreferences">Message `UserConsolePreferences`</a>

UserConsolePreferences is the message that defines the user preferences for the Console.

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `console_theme` | [`ConsoleTheme`](#ttn.lorawan.v3.ConsoleTheme) | | |
| `dashboard_layouts` | [`UserConsolePreferences.DashboardLayouts`](#ttn.lorawan.v3.UserConsolePreferences.DashboardLayouts) | | |
| `sort_by` | [`UserConsolePreferences.SortBy`](#ttn.lorawan.v3.UserConsolePreferences.SortBy) | | |

### <a name="ttn.lorawan.v3.UserConsolePreferences.DashboardLayouts">Message `UserConsolePreferences.DashboardLayouts`</a>

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `api_key` | [`DashboardLayout`](#ttn.lorawan.v3.DashboardLayout) | | |
| `application` | [`DashboardLayout`](#ttn.lorawan.v3.DashboardLayout) | | |
| `collaborator` | [`DashboardLayout`](#ttn.lorawan.v3.DashboardLayout) | | |
| `end_device` | [`DashboardLayout`](#ttn.lorawan.v3.DashboardLayout) | | |
| `gateway` | [`DashboardLayout`](#ttn.lorawan.v3.DashboardLayout) | | |
| `organization` | [`DashboardLayout`](#ttn.lorawan.v3.DashboardLayout) | | |
| `overview` | [`DashboardLayout`](#ttn.lorawan.v3.DashboardLayout) | | |
| `user` | [`DashboardLayout`](#ttn.lorawan.v3.DashboardLayout) | | |

### <a name="ttn.lorawan.v3.UserConsolePreferences.SortBy">Message `UserConsolePreferences.SortBy`</a>

SortBy defines the field to which the Console will sort the display of entities.

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `api_key` | [`string`](#string) | | |
| `application` | [`string`](#string) | | |
| `collaborator` | [`string`](#string) | | |
| `end_device` | [`string`](#string) | | |
| `gateway` | [`string`](#string) | | |
| `organization` | [`string`](#string) | | |
| `user` | [`string`](#string) | | |

#### Field Rules

| Field | Validations |
| ----- | ----------- |
| `api_key` | <p>`string.in`: `[ api_key_id -api_key_id name -name created_at -created_at expires_at -expires_at]`</p> |
| `application` | <p>`string.in`: `[ application_id -application_id name -name created_at -created_at]`</p> |
| `collaborator` | <p>`string.in`: `[ id -id rights -rights]`</p> |
| `end_device` | <p>`string.in`: `[ device_id -device_id join_eui -join_eui dev_eui -dev_eui name -name description -description created_at -created_at last_seen_at -last_seen_at]`</p> |
| `gateway` | <p>`string.in`: `[ gateway_id -gateway_id gateway_eui -gateway_eui name -name created_at -created_at]`</p> |
| `organization` | <p>`string.in`: `[ organization_id -organization_id name -name created_at -created_at]`</p> |
| `user` | <p>`string.in`: `[ user_id -user_id name -name primary_email_address -primary_email_address state -state admin -admin created_at -created_at]`</p> |

### <a name="ttn.lorawan.v3.UserSession">Message `UserSession`</a>

| Field | Type | Label | Description |
Expand Down Expand Up @@ -10902,6 +10957,26 @@
| ----- | ---- | ----- | ----------- |
| `users` | [`User`](#ttn.lorawan.v3.User) | repeated | |

### <a name="ttn.lorawan.v3.ConsoleTheme">Enum `ConsoleTheme`</a>

ConsoleTheme is the theme of the Console.

| Name | Number | Description |
| ---- | ------ | ----------- |
| `CONSOLE_THEME_SYSTEM` | 0 | The user prefers the system mode. |
| `CONSOLE_THEME_LIGHT` | 1 | The user prefers the light mode. |
| `CONSOLE_THEME_DARK` | 2 | The user prefers the dark mode. |

### <a name="ttn.lorawan.v3.DashboardLayout">Enum `DashboardLayout`</a>

DashboardLayout is a set of possible layout values to be used in the Console.

| Name | Number | Description |
| ---- | ------ | ----------- |
| `DASHBOARD_LAYOUT_TABLE` | 0 | |
| `DASHBOARD_LAYOUT_LIST` | 1 | |
| `DASHBOARD_LAYOUT_GRID` | 2 | |

## <a name="ttn/lorawan/v3/user_services.proto">File `ttn/lorawan/v3/user_services.proto`</a>

### <a name="ttn.lorawan.v3.UserAccess">Service `UserAccess`</a>
Expand Down
99 changes: 99 additions & 0 deletions api/ttn/lorawan/v3/api.swagger.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{

Check warning on line 1 in api/ttn/lorawan/v3/api.swagger.json

View workflow job for this annotation

GitHub Actions / Check Mergeability

api/ttn/lorawan/v3/api.swagger.json has a conflict when merging TheThingsIndustries/lorawan-stack:v3.30.
"swagger": "2.0",
"info": {
"title": "The Things Stack for LoRaWAN v3 API",
Expand Down Expand Up @@ -16565,6 +16565,62 @@
"UplinkMessageRxMetadataRelayMetadata": {
"type": "object"
},
"UserConsolePreferencesDashboardLayouts": {
"type": "object",
"properties": {
"api_key": {
"$ref": "#/definitions/v3DashboardLayout"
},
"application": {
"$ref": "#/definitions/v3DashboardLayout"
},
"collaborator": {
"$ref": "#/definitions/v3DashboardLayout"
},
"end_device": {
"$ref": "#/definitions/v3DashboardLayout"
},
"gateway": {
"$ref": "#/definitions/v3DashboardLayout"
},
"organization": {
"$ref": "#/definitions/v3DashboardLayout"
},
"overview": {
"$ref": "#/definitions/v3DashboardLayout"
},
"user": {
"$ref": "#/definitions/v3DashboardLayout"
}
}
},
"UserConsolePreferencesSortBy": {
"type": "object",
"properties": {
"api_key": {
"type": "string"
},
"application": {
"type": "string"
},
"collaborator": {
"type": "string"
},
"end_device": {
"type": "string"
},
"gateway": {
"type": "string"
},
"organization": {
"type": "string"
},
"user": {
"type": "string"
}
},
"description": "SortBy defines the field to which the Console will sort the display of entities."
},
"UserRegistrationAdminApproval": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -19859,6 +19915,16 @@
}
}
},
"v3ConsoleTheme": {
"type": "string",
"enum": [
"CONSOLE_THEME_SYSTEM",
"CONSOLE_THEME_LIGHT",
"CONSOLE_THEME_DARK"
],
"default": "CONSOLE_THEME_SYSTEM",
"description": "ConsoleTheme is the theme of the Console.\n\n - CONSOLE_THEME_SYSTEM: The user prefers the system mode.\n - CONSOLE_THEME_LIGHT: The user prefers the light mode.\n - CONSOLE_THEME_DARK: The user prefers the dark mode."
},
"v3ContactInfo": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -20015,6 +20081,16 @@
}
}
},
"v3DashboardLayout": {
"type": "string",
"enum": [
"DASHBOARD_LAYOUT_TABLE",
"DASHBOARD_LAYOUT_LIST",
"DASHBOARD_LAYOUT_GRID"
],
"default": "DASHBOARD_LAYOUT_TABLE",
"description": "DashboardLayout is a set of possible layout values to be used in the Console."
},
"v3DataRate": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -26092,6 +26168,10 @@
"profile_picture": {
"$ref": "#/definitions/v3Picture",
"description": "A profile picture for the user.\nThis information is public and can be seen by any authenticated user in the network."
},
"console_preferences": {
"$ref": "#/definitions/v3UserConsolePreferences",
"description": "Console preferences contains the user's preferences regarding the behavior of the Console."
}
},
"description": "User is the message that defines a user on the network."
Expand Down Expand Up @@ -26173,6 +26253,21 @@
}
}
},
"v3UserConsolePreferences": {
"type": "object",
"properties": {
"console_theme": {
"$ref": "#/definitions/v3ConsoleTheme"
},
"dashboard_layouts": {
"$ref": "#/definitions/UserConsolePreferencesDashboardLayouts"
},
"sort_by": {
"$ref": "#/definitions/UserConsolePreferencesSortBy"
}
},
"description": "UserConsolePreferences is the message that defines the user preferences for the Console."
},
"v3UserIdentifiers": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -26288,6 +26383,10 @@
"profile_picture": {
"$ref": "#/definitions/v3Picture",
"description": "A profile picture for the user.\nThis information is public and can be seen by any authenticated user in the network."
},
"console_preferences": {
"$ref": "#/definitions/v3UserConsolePreferences",
"description": "Console preferences contains the user's preferences regarding the behavior of the Console."
}
},
"description": "User is the message that defines a user on the network."
Expand Down
Loading
Loading