Skip to content

Commit

Permalink
Merge pull request #4 from RyoJerryYu/feat-migrate-to-v0.22.1
Browse files Browse the repository at this point in the history
feat: memos migrate to v0.22.1
  • Loading branch information
RyoJerryYu authored May 26, 2024
2 parents 8777888 + d3b4f49 commit 3e2d7de
Show file tree
Hide file tree
Showing 61 changed files with 25,624 additions and 160 deletions.
56 changes: 56 additions & 0 deletions api/memos-proto-v0.22.0/api/v1/activity_service.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
syntax = "proto3";

package memos.api.v1;

import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/protobuf/timestamp.proto";

option go_package = "gen/api/v1";

service ActivityService {
// GetActivity returns the activity with the given id.
rpc GetActivity(GetActivityRequest) returns (Activity) {
option (google.api.http) = {get: "/api/v1/activities/{id}"};
option (google.api.method_signature) = "id";
}
}

message Activity {
// The system-generated unique identifier for the activity.
int32 id = 1;
// The system-generated unique identifier for the user who created the activity.
int32 creator_id = 2;
// The type of the activity.
string type = 3;
// The level of the activity.
string level = 4;
// The create time of the activity.
google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
// The payload of the activity.
ActivityPayload payload = 6;
}

// ActivityMemoCommentPayload represents the payload of a memo comment activity.
message ActivityMemoCommentPayload {
// The memo id of comment.
int32 memo_id = 1;
// The memo id of related memo.
int32 related_memo_id = 2;
}

message ActivityVersionUpdatePayload {
// The updated version of memos.
string version = 1;
}

message ActivityPayload {
ActivityMemoCommentPayload memo_comment = 1;
ActivityVersionUpdatePayload version_update = 2;
}

message GetActivityRequest {
// The system-generated unique identifier for the activity.
int32 id = 1;
}
65 changes: 65 additions & 0 deletions api/memos-proto-v0.22.0/api/v1/auth_service.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
syntax = "proto3";

package memos.api.v1;

import "api/v1/user_service.proto";
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";

option go_package = "gen/api/v1";

service AuthService {
// GetAuthStatus returns the current auth status of the user.
rpc GetAuthStatus(GetAuthStatusRequest) returns (User) {
option (google.api.http) = {post: "/api/v1/auth/status"};
}
// SignIn signs in the user with the given username and password.
rpc SignIn(SignInRequest) returns (User) {
option (google.api.http) = {post: "/api/v1/auth/signin"};
}
// SignInWithSSO signs in the user with the given SSO code.
rpc SignInWithSSO(SignInWithSSORequest) returns (User) {
option (google.api.http) = {post: "/api/v1/auth/signin/sso"};
}
// SignUp signs up the user with the given username and password.
rpc SignUp(SignUpRequest) returns (User) {
option (google.api.http) = {post: "/api/v1/auth/signup"};
}
// SignOut signs out the user.
rpc SignOut(SignOutRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {post: "/api/v1/auth/signout"};
}
}

message GetAuthStatusRequest {}

message GetAuthStatusResponse {
User user = 1;
}

message SignInRequest {
// The username to sign in with.
string username = 1;
// The password to sign in with.
string password = 2;
// Whether the session should never expire.
bool never_expire = 3;
}

message SignInWithSSORequest {
// The ID of the SSO provider.
int32 idp_id = 1;
// The code to sign in with.
string code = 2;
// The redirect URI.
string redirect_uri = 3;
}

message SignUpRequest {
// The username to sign up with.
string username = 1;
// The password to sign up with.
string password = 2;
}

message SignOutRequest {}
17 changes: 17 additions & 0 deletions api/memos-proto-v0.22.0/api/v1/common.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
syntax = "proto3";

package memos.api.v1;

option go_package = "gen/api/v1";

enum RowStatus {
ROW_STATUS_UNSPECIFIED = 0;
ACTIVE = 1;
ARCHIVED = 2;
}

// Used internally for obfuscating the page token.
message PageToken {
int32 limit = 1;
int32 offset = 2;
}
114 changes: 114 additions & 0 deletions api/memos-proto-v0.22.0/api/v1/idp_service.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
syntax = "proto3";

package memos.api.v1;

import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";

option go_package = "gen/api/v1";

service IdentityProviderService {
// ListIdentityProviders lists identity providers.
rpc ListIdentityProviders(ListIdentityProvidersRequest) returns (ListIdentityProvidersResponse) {
option (google.api.http) = {get: "/api/v1/identityProviders"};
}
// GetIdentityProvider gets an identity provider.
rpc GetIdentityProvider(GetIdentityProviderRequest) returns (IdentityProvider) {
option (google.api.http) = {get: "/api/v1/{name=identityProviders/*}"};
option (google.api.method_signature) = "name";
}
// CreateIdentityProvider creates an identity provider.
rpc CreateIdentityProvider(CreateIdentityProviderRequest) returns (IdentityProvider) {
option (google.api.http) = {
post: "/api/v1/identityProviders",
body: "identity_provider"
};
}
// UpdateIdentityProvider updates an identity provider.
rpc UpdateIdentityProvider(UpdateIdentityProviderRequest) returns (IdentityProvider) {
option (google.api.http) = {
patch: "/api/v1/{identity_provider.name=identityProviders/*}"
body: "identity_provider"
};
option (google.api.method_signature) = "identity_provider,update_mask";
}
// DeleteIdentityProvider deletes an identity provider.
rpc DeleteIdentityProvider(DeleteIdentityProviderRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {delete: "/api/v1/{name=identityProviders/*}"};
option (google.api.method_signature) = "name";
}
}

message IdentityProvider {
// The name of the identityProvider.
// Format: identityProviders/{id}
string name = 1;

enum Type {
TYPE_UNSPECIFIED = 0;
OAUTH2 = 1;
}
Type type = 2;

string title = 3;

string identifier_filter = 4;

IdentityProviderConfig config = 5;
}

message IdentityProviderConfig {
oneof config {
OAuth2Config oauth2_config = 1;
}
}

message FieldMapping {
string identifier = 1;
string display_name = 2;
string email = 3;
}

message OAuth2Config {
string client_id = 1;
string client_secret = 2;
string auth_url = 3;
string token_url = 4;
string user_info_url = 5;
repeated string scopes = 6;
FieldMapping field_mapping = 7;
}

message ListIdentityProvidersRequest {}

message ListIdentityProvidersResponse {
repeated IdentityProvider identity_providers = 1;
}

message GetIdentityProviderRequest {
// The name of the identityProvider to get.
// Format: identityProviders/{id}
string name = 1;
}

message CreateIdentityProviderRequest {
// The identityProvider to create.
IdentityProvider identity_provider = 1;
}

message UpdateIdentityProviderRequest {
// The identityProvider to update.
IdentityProvider identity_provider = 1;

// The update mask applies to the resource. Only the top level fields of
// IdentityProvider are supported.
google.protobuf.FieldMask update_mask = 2;
}

message DeleteIdentityProviderRequest {
// The name of the identityProvider to delete.
// Format: identityProviders/{id}
string name = 1;
}
80 changes: 80 additions & 0 deletions api/memos-proto-v0.22.0/api/v1/inbox_service.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
syntax = "proto3";

package memos.api.v1;

import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";

option go_package = "gen/api/v1";

service InboxService {
// ListInboxes lists inboxes for a user.
rpc ListInboxes(ListInboxesRequest) returns (ListInboxesResponse) {
option (google.api.http) = {get: "/api/v1/inboxes"};
}
// UpdateInbox updates an inbox.
rpc UpdateInbox(UpdateInboxRequest) returns (Inbox) {
option (google.api.http) = {
patch: "/api/v1/{inbox.name=inboxes/*}"
body: "inbox"
};
option (google.api.method_signature) = "inbox,update_mask";
}
// DeleteInbox deletes an inbox.
rpc DeleteInbox(DeleteInboxRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {delete: "/api/v1/{name=inboxes/*}"};
option (google.api.method_signature) = "name";
}
}

message Inbox {
// The name of the inbox.
// Format: inboxes/{id}
string name = 1;
// Format: users/{id}
string sender = 2;
// Format: users/{id}
string receiver = 3;

enum Status {
STATUS_UNSPECIFIED = 0;
UNREAD = 1;
ARCHIVED = 2;
}
Status status = 4;

google.protobuf.Timestamp create_time = 5;

enum Type {
TYPE_UNSPECIFIED = 0;
MEMO_COMMENT = 1;
VERSION_UPDATE = 2;
}
Type type = 6;

optional int32 activity_id = 7;
}

message ListInboxesRequest {
// Format: users/{id}
string user = 1;
}

message ListInboxesResponse {
repeated Inbox inboxes = 1;
}

message UpdateInboxRequest {
Inbox inbox = 1;

google.protobuf.FieldMask update_mask = 2;
}

message DeleteInboxRequest {
// The name of the inbox to delete.
// Format: inboxes/{id}
string name = 1;
}
Loading

0 comments on commit 3e2d7de

Please sign in to comment.