Skip to content

Commit

Permalink
feat: create change filters definitions (#276)
Browse files Browse the repository at this point in the history
* feat: create change filters definitions

* add rpcs, response and request

* typo fix

* rename message

* tidyup

* update tags type
  • Loading branch information
getinnocuous authored Oct 28, 2024
1 parent 6eccb37 commit 905dc0c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
20 changes: 20 additions & 0 deletions changes.proto
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ service ChangesService {
// Gets the full diff of everything that changed as part of this "change".
// This includes all items and also edges between them
rpc GetDiff(GetDiffRequest) returns (GetDiffResponse);

// List all the available repos, authors and statuses that can be used to populate the dropdown filters
rpc PopulateChangeFilters(PopulateChangeFiltersRequest) returns (PopulateChangeFiltersResponse);
}

message GetChangeTimelineRequest {
Expand Down Expand Up @@ -266,13 +269,30 @@ message GetAppSummariesResponse {

message ListHomeChangesRequest {
PaginationRequest pagination = 1;
ChangeFiltersRequest filters = 2;
}

message ChangeFiltersRequest {
repeated string repos = 1;
map<string, string> tags = 2;
repeated Risk.Severity risks = 3;
repeated string authors = 4;
repeated ChangeStatus statuses = 5;
SortOrder sortOrder = 6;
}

message ListHomeChangesResponse {
repeated ChangeSummary changes = 1;
PaginationResponse pagination = 2;
}

message PopulateChangeFiltersRequest {}
message PopulateChangeFiltersResponse {
repeated string repos = 1;
repeated string authors = 2;
repeated ChangeStatus statuses = 3;
}

message ListHomeAppsRequest {}
message ListHomeAppsResponse {
repeated AppSummary apps = 1;
Expand Down
7 changes: 7 additions & 0 deletions util.proto
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,11 @@ message PaginationResponse {
// The total number of pages available. based on the totalItems and pageSize.
// If there are no results this will be zero.
int32 totalPages = 4;
}

enum SortOrder {
ALPHABETICAL_ASCENDING = 0; // A-Z
ALPHABETICAL_DESCENDING = 1; // Z-A
DATE_ASCENDING = 2; // Oldest first
DATE_DESCENDING = 3; // Newest first
}

0 comments on commit 905dc0c

Please sign in to comment.