chore: update user setting definition

pull/4925/head
Johnny 3 months ago
parent 3b8bfe72ea
commit 8f51791da8

@ -403,15 +403,15 @@ message UserSetting {
}; };
// The name of the user setting. // The name of the user setting.
// Format: users/{user}/settings/{setting} // Format: users/{user}/settings/{setting}, {setting} is the key for the setting.
// For example, "users/123/settings/GENERAL" for general settings.
string name = 1 [(google.api.field_behavior) = IDENTIFIER]; string name = 1 [(google.api.field_behavior) = IDENTIFIER];
oneof value { oneof value {
GeneralSetting general_setting = 2; GeneralSetting general_setting = 2;
SessionsSetting sessions_setting = 3; SessionsSetting sessions_setting = 3;
AccessTokensSetting access_tokens_setting = 4; AccessTokensSetting access_tokens_setting = 4;
ShortcutsSetting shortcuts_setting = 5; WebhooksSetting webhooks_setting = 5;
WebhooksSetting webhooks_setting = 6;
} }
// Enumeration of user setting keys. // Enumeration of user setting keys.
@ -423,10 +423,8 @@ message UserSetting {
SESSIONS = 2; SESSIONS = 2;
// ACCESS_TOKENS is the key for access tokens. // ACCESS_TOKENS is the key for access tokens.
ACCESS_TOKENS = 3; ACCESS_TOKENS = 3;
// SHORTCUTS is the key for user shortcuts.
SHORTCUTS = 4;
// WEBHOOKS is the key for user webhooks. // WEBHOOKS is the key for user webhooks.
WEBHOOKS = 5; WEBHOOKS = 4;
} }
// General user settings configuration. // General user settings configuration.
@ -446,81 +444,19 @@ message UserSetting {
// User authentication sessions configuration. // User authentication sessions configuration.
message SessionsSetting { message SessionsSetting {
// List of active user sessions. // List of active user sessions.
repeated Session sessions = 1; repeated UserSession sessions = 1;
// User session information.
message Session {
// Unique session identifier.
string session_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// Timestamp when the session was created.
google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
// Timestamp when the session was last accessed.
// Used for sliding expiration calculation (last_accessed_time + 2 weeks).
google.protobuf.Timestamp last_accessed_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
// Client information associated with this session.
ClientInfo client_info = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
}
// Client information for a session.
message ClientInfo {
// User agent string of the client.
string user_agent = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// IP address of the client.
string ip_address = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
// Optional. Device type (e.g., "mobile", "desktop", "tablet").
string device_type = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
// Optional. Operating system (e.g., "iOS 17.0", "Windows 11").
string os = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
// Optional. Browser name and version (e.g., "Chrome 119.0").
string browser = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
}
} }
// User access tokens configuration. // User access tokens configuration.
message AccessTokensSetting { message AccessTokensSetting {
// List of user access tokens. // List of user access tokens.
repeated AccessToken access_tokens = 1; repeated UserAccessToken access_tokens = 1;
// User access token information.
message AccessToken {
// The access token is a JWT token.
// Including expiration time, issuer, etc.
string access_token = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// A description for the access token.
string description = 2 [(google.api.field_behavior) = OPTIONAL];
}
}
// User shortcuts configuration.
message ShortcutsSetting {
// List of user shortcuts.
repeated Shortcut shortcuts = 1;
// User shortcut definition.
message Shortcut {
// Unique identifier for the shortcut.
string id = 1 [(google.api.field_behavior) = REQUIRED];
// Display title for the shortcut.
string title = 2 [(google.api.field_behavior) = REQUIRED];
// Filter expression for the shortcut.
string filter = 3 [(google.api.field_behavior) = REQUIRED];
}
} }
// User webhooks configuration. // User webhooks configuration.
message WebhooksSetting { message WebhooksSetting {
// List of user webhooks. // List of user webhooks.
repeated Webhook webhooks = 1; repeated UserWebhook webhooks = 1;
// User webhook definition.
message Webhook {
// Unique identifier for the webhook.
string id = 1 [(google.api.field_behavior) = REQUIRED];
// Descriptive title for the webhook.
string title = 2 [(google.api.field_behavior) = REQUIRED];
// The webhook URL endpoint.
string url = 3 [(google.api.field_behavior) = REQUIRED];
}
} }
} }

@ -94,10 +94,8 @@ const (
UserSetting_SESSIONS UserSetting_Key = 2 UserSetting_SESSIONS UserSetting_Key = 2
// ACCESS_TOKENS is the key for access tokens. // ACCESS_TOKENS is the key for access tokens.
UserSetting_ACCESS_TOKENS UserSetting_Key = 3 UserSetting_ACCESS_TOKENS UserSetting_Key = 3
// SHORTCUTS is the key for user shortcuts.
UserSetting_SHORTCUTS UserSetting_Key = 4
// WEBHOOKS is the key for user webhooks. // WEBHOOKS is the key for user webhooks.
UserSetting_WEBHOOKS UserSetting_Key = 5 UserSetting_WEBHOOKS UserSetting_Key = 4
) )
// Enum value maps for UserSetting_Key. // Enum value maps for UserSetting_Key.
@ -107,16 +105,14 @@ var (
1: "GENERAL", 1: "GENERAL",
2: "SESSIONS", 2: "SESSIONS",
3: "ACCESS_TOKENS", 3: "ACCESS_TOKENS",
4: "SHORTCUTS", 4: "WEBHOOKS",
5: "WEBHOOKS",
} }
UserSetting_Key_value = map[string]int32{ UserSetting_Key_value = map[string]int32{
"KEY_UNSPECIFIED": 0, "KEY_UNSPECIFIED": 0,
"GENERAL": 1, "GENERAL": 1,
"SESSIONS": 2, "SESSIONS": 2,
"ACCESS_TOKENS": 3, "ACCESS_TOKENS": 3,
"SHORTCUTS": 4, "WEBHOOKS": 4,
"WEBHOOKS": 5,
} }
) )
@ -1080,14 +1076,14 @@ func (x *ListAllUserStatsResponse) GetStats() []*UserStats {
type UserSetting struct { type UserSetting struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
// The name of the user setting. // The name of the user setting.
// Format: users/{user}/settings/{setting} // Format: users/{user}/settings/{setting}, {setting} is the key for the setting.
// For example, "users/123/settings/GENERAL" for general settings.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Types that are valid to be assigned to Value: // Types that are valid to be assigned to Value:
// //
// *UserSetting_GeneralSetting_ // *UserSetting_GeneralSetting_
// *UserSetting_SessionsSetting_ // *UserSetting_SessionsSetting_
// *UserSetting_AccessTokensSetting_ // *UserSetting_AccessTokensSetting_
// *UserSetting_ShortcutsSetting_
// *UserSetting_WebhooksSetting_ // *UserSetting_WebhooksSetting_
Value isUserSetting_Value `protobuf_oneof:"value"` Value isUserSetting_Value `protobuf_oneof:"value"`
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
@ -1165,15 +1161,6 @@ func (x *UserSetting) GetAccessTokensSetting() *UserSetting_AccessTokensSetting
return nil return nil
} }
func (x *UserSetting) GetShortcutsSetting() *UserSetting_ShortcutsSetting {
if x != nil {
if x, ok := x.Value.(*UserSetting_ShortcutsSetting_); ok {
return x.ShortcutsSetting
}
}
return nil
}
func (x *UserSetting) GetWebhooksSetting() *UserSetting_WebhooksSetting { func (x *UserSetting) GetWebhooksSetting() *UserSetting_WebhooksSetting {
if x != nil { if x != nil {
if x, ok := x.Value.(*UserSetting_WebhooksSetting_); ok { if x, ok := x.Value.(*UserSetting_WebhooksSetting_); ok {
@ -1199,12 +1186,8 @@ type UserSetting_AccessTokensSetting_ struct {
AccessTokensSetting *UserSetting_AccessTokensSetting `protobuf:"bytes,4,opt,name=access_tokens_setting,json=accessTokensSetting,proto3,oneof"` AccessTokensSetting *UserSetting_AccessTokensSetting `protobuf:"bytes,4,opt,name=access_tokens_setting,json=accessTokensSetting,proto3,oneof"`
} }
type UserSetting_ShortcutsSetting_ struct {
ShortcutsSetting *UserSetting_ShortcutsSetting `protobuf:"bytes,5,opt,name=shortcuts_setting,json=shortcutsSetting,proto3,oneof"`
}
type UserSetting_WebhooksSetting_ struct { type UserSetting_WebhooksSetting_ struct {
WebhooksSetting *UserSetting_WebhooksSetting `protobuf:"bytes,6,opt,name=webhooks_setting,json=webhooksSetting,proto3,oneof"` WebhooksSetting *UserSetting_WebhooksSetting `protobuf:"bytes,5,opt,name=webhooks_setting,json=webhooksSetting,proto3,oneof"`
} }
func (*UserSetting_GeneralSetting_) isUserSetting_Value() {} func (*UserSetting_GeneralSetting_) isUserSetting_Value() {}
@ -1213,8 +1196,6 @@ func (*UserSetting_SessionsSetting_) isUserSetting_Value() {}
func (*UserSetting_AccessTokensSetting_) isUserSetting_Value() {} func (*UserSetting_AccessTokensSetting_) isUserSetting_Value() {}
func (*UserSetting_ShortcutsSetting_) isUserSetting_Value() {}
func (*UserSetting_WebhooksSetting_) isUserSetting_Value() {} func (*UserSetting_WebhooksSetting_) isUserSetting_Value() {}
type GetUserSettingRequest struct { type GetUserSettingRequest struct {
@ -2468,7 +2449,7 @@ func (x *UserSetting_GeneralSetting) GetTheme() string {
type UserSetting_SessionsSetting struct { type UserSetting_SessionsSetting struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
// List of active user sessions. // List of active user sessions.
Sessions []*UserSetting_SessionsSetting_Session `protobuf:"bytes,1,rep,name=sessions,proto3" json:"sessions,omitempty"` Sessions []*UserSession `protobuf:"bytes,1,rep,name=sessions,proto3" json:"sessions,omitempty"`
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
} }
@ -2503,7 +2484,7 @@ func (*UserSetting_SessionsSetting) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{14, 1} return file_api_v1_user_service_proto_rawDescGZIP(), []int{14, 1}
} }
func (x *UserSetting_SessionsSetting) GetSessions() []*UserSetting_SessionsSetting_Session { func (x *UserSetting_SessionsSetting) GetSessions() []*UserSession {
if x != nil { if x != nil {
return x.Sessions return x.Sessions
} }
@ -2514,7 +2495,7 @@ func (x *UserSetting_SessionsSetting) GetSessions() []*UserSetting_SessionsSetti
type UserSetting_AccessTokensSetting struct { type UserSetting_AccessTokensSetting struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
// List of user access tokens. // List of user access tokens.
AccessTokens []*UserSetting_AccessTokensSetting_AccessToken `protobuf:"bytes,1,rep,name=access_tokens,json=accessTokens,proto3" json:"access_tokens,omitempty"` AccessTokens []*UserAccessToken `protobuf:"bytes,1,rep,name=access_tokens,json=accessTokens,proto3" json:"access_tokens,omitempty"`
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
} }
@ -2549,71 +2530,25 @@ func (*UserSetting_AccessTokensSetting) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{14, 2} return file_api_v1_user_service_proto_rawDescGZIP(), []int{14, 2}
} }
func (x *UserSetting_AccessTokensSetting) GetAccessTokens() []*UserSetting_AccessTokensSetting_AccessToken { func (x *UserSetting_AccessTokensSetting) GetAccessTokens() []*UserAccessToken {
if x != nil { if x != nil {
return x.AccessTokens return x.AccessTokens
} }
return nil return nil
} }
// User shortcuts configuration.
type UserSetting_ShortcutsSetting struct {
state protoimpl.MessageState `protogen:"open.v1"`
// List of user shortcuts.
Shortcuts []*UserSetting_ShortcutsSetting_Shortcut `protobuf:"bytes,1,rep,name=shortcuts,proto3" json:"shortcuts,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *UserSetting_ShortcutsSetting) Reset() {
*x = UserSetting_ShortcutsSetting{}
mi := &file_api_v1_user_service_proto_msgTypes[39]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *UserSetting_ShortcutsSetting) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UserSetting_ShortcutsSetting) ProtoMessage() {}
func (x *UserSetting_ShortcutsSetting) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[39]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UserSetting_ShortcutsSetting.ProtoReflect.Descriptor instead.
func (*UserSetting_ShortcutsSetting) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{14, 3}
}
func (x *UserSetting_ShortcutsSetting) GetShortcuts() []*UserSetting_ShortcutsSetting_Shortcut {
if x != nil {
return x.Shortcuts
}
return nil
}
// User webhooks configuration. // User webhooks configuration.
type UserSetting_WebhooksSetting struct { type UserSetting_WebhooksSetting struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
// List of user webhooks. // List of user webhooks.
Webhooks []*UserSetting_WebhooksSetting_Webhook `protobuf:"bytes,1,rep,name=webhooks,proto3" json:"webhooks,omitempty"` Webhooks []*UserWebhook `protobuf:"bytes,1,rep,name=webhooks,proto3" json:"webhooks,omitempty"`
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
} }
func (x *UserSetting_WebhooksSetting) Reset() { func (x *UserSetting_WebhooksSetting) Reset() {
*x = UserSetting_WebhooksSetting{} *x = UserSetting_WebhooksSetting{}
mi := &file_api_v1_user_service_proto_msgTypes[40] mi := &file_api_v1_user_service_proto_msgTypes[39]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -2625,7 +2560,7 @@ func (x *UserSetting_WebhooksSetting) String() string {
func (*UserSetting_WebhooksSetting) ProtoMessage() {} func (*UserSetting_WebhooksSetting) ProtoMessage() {}
func (x *UserSetting_WebhooksSetting) ProtoReflect() protoreflect.Message { func (x *UserSetting_WebhooksSetting) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[40] mi := &file_api_v1_user_service_proto_msgTypes[39]
if x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -2638,356 +2573,16 @@ func (x *UserSetting_WebhooksSetting) ProtoReflect() protoreflect.Message {
// Deprecated: Use UserSetting_WebhooksSetting.ProtoReflect.Descriptor instead. // Deprecated: Use UserSetting_WebhooksSetting.ProtoReflect.Descriptor instead.
func (*UserSetting_WebhooksSetting) Descriptor() ([]byte, []int) { func (*UserSetting_WebhooksSetting) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{14, 4} return file_api_v1_user_service_proto_rawDescGZIP(), []int{14, 3}
} }
func (x *UserSetting_WebhooksSetting) GetWebhooks() []*UserSetting_WebhooksSetting_Webhook { func (x *UserSetting_WebhooksSetting) GetWebhooks() []*UserWebhook {
if x != nil { if x != nil {
return x.Webhooks return x.Webhooks
} }
return nil return nil
} }
// User session information.
type UserSetting_SessionsSetting_Session struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Unique session identifier.
SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
// Timestamp when the session was created.
CreateTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
// Timestamp when the session was last accessed.
// Used for sliding expiration calculation (last_accessed_time + 2 weeks).
LastAccessedTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=last_accessed_time,json=lastAccessedTime,proto3" json:"last_accessed_time,omitempty"`
// Client information associated with this session.
ClientInfo *UserSetting_SessionsSetting_ClientInfo `protobuf:"bytes,4,opt,name=client_info,json=clientInfo,proto3" json:"client_info,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *UserSetting_SessionsSetting_Session) Reset() {
*x = UserSetting_SessionsSetting_Session{}
mi := &file_api_v1_user_service_proto_msgTypes[41]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *UserSetting_SessionsSetting_Session) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UserSetting_SessionsSetting_Session) ProtoMessage() {}
func (x *UserSetting_SessionsSetting_Session) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[41]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UserSetting_SessionsSetting_Session.ProtoReflect.Descriptor instead.
func (*UserSetting_SessionsSetting_Session) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{14, 1, 0}
}
func (x *UserSetting_SessionsSetting_Session) GetSessionId() string {
if x != nil {
return x.SessionId
}
return ""
}
func (x *UserSetting_SessionsSetting_Session) GetCreateTime() *timestamppb.Timestamp {
if x != nil {
return x.CreateTime
}
return nil
}
func (x *UserSetting_SessionsSetting_Session) GetLastAccessedTime() *timestamppb.Timestamp {
if x != nil {
return x.LastAccessedTime
}
return nil
}
func (x *UserSetting_SessionsSetting_Session) GetClientInfo() *UserSetting_SessionsSetting_ClientInfo {
if x != nil {
return x.ClientInfo
}
return nil
}
// Client information for a session.
type UserSetting_SessionsSetting_ClientInfo struct {
state protoimpl.MessageState `protogen:"open.v1"`
// User agent string of the client.
UserAgent string `protobuf:"bytes,1,opt,name=user_agent,json=userAgent,proto3" json:"user_agent,omitempty"`
// IP address of the client.
IpAddress string `protobuf:"bytes,2,opt,name=ip_address,json=ipAddress,proto3" json:"ip_address,omitempty"`
// Optional. Device type (e.g., "mobile", "desktop", "tablet").
DeviceType string `protobuf:"bytes,3,opt,name=device_type,json=deviceType,proto3" json:"device_type,omitempty"`
// Optional. Operating system (e.g., "iOS 17.0", "Windows 11").
Os string `protobuf:"bytes,4,opt,name=os,proto3" json:"os,omitempty"`
// Optional. Browser name and version (e.g., "Chrome 119.0").
Browser string `protobuf:"bytes,5,opt,name=browser,proto3" json:"browser,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *UserSetting_SessionsSetting_ClientInfo) Reset() {
*x = UserSetting_SessionsSetting_ClientInfo{}
mi := &file_api_v1_user_service_proto_msgTypes[42]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *UserSetting_SessionsSetting_ClientInfo) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UserSetting_SessionsSetting_ClientInfo) ProtoMessage() {}
func (x *UserSetting_SessionsSetting_ClientInfo) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[42]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UserSetting_SessionsSetting_ClientInfo.ProtoReflect.Descriptor instead.
func (*UserSetting_SessionsSetting_ClientInfo) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{14, 1, 1}
}
func (x *UserSetting_SessionsSetting_ClientInfo) GetUserAgent() string {
if x != nil {
return x.UserAgent
}
return ""
}
func (x *UserSetting_SessionsSetting_ClientInfo) GetIpAddress() string {
if x != nil {
return x.IpAddress
}
return ""
}
func (x *UserSetting_SessionsSetting_ClientInfo) GetDeviceType() string {
if x != nil {
return x.DeviceType
}
return ""
}
func (x *UserSetting_SessionsSetting_ClientInfo) GetOs() string {
if x != nil {
return x.Os
}
return ""
}
func (x *UserSetting_SessionsSetting_ClientInfo) GetBrowser() string {
if x != nil {
return x.Browser
}
return ""
}
// User access token information.
type UserSetting_AccessTokensSetting_AccessToken struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The access token is a JWT token.
// Including expiration time, issuer, etc.
AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
// A description for the access token.
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *UserSetting_AccessTokensSetting_AccessToken) Reset() {
*x = UserSetting_AccessTokensSetting_AccessToken{}
mi := &file_api_v1_user_service_proto_msgTypes[43]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *UserSetting_AccessTokensSetting_AccessToken) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UserSetting_AccessTokensSetting_AccessToken) ProtoMessage() {}
func (x *UserSetting_AccessTokensSetting_AccessToken) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[43]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UserSetting_AccessTokensSetting_AccessToken.ProtoReflect.Descriptor instead.
func (*UserSetting_AccessTokensSetting_AccessToken) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{14, 2, 0}
}
func (x *UserSetting_AccessTokensSetting_AccessToken) GetAccessToken() string {
if x != nil {
return x.AccessToken
}
return ""
}
func (x *UserSetting_AccessTokensSetting_AccessToken) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
// User shortcut definition.
type UserSetting_ShortcutsSetting_Shortcut struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Unique identifier for the shortcut.
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// Display title for the shortcut.
Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
// Filter expression for the shortcut.
Filter string `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *UserSetting_ShortcutsSetting_Shortcut) Reset() {
*x = UserSetting_ShortcutsSetting_Shortcut{}
mi := &file_api_v1_user_service_proto_msgTypes[44]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *UserSetting_ShortcutsSetting_Shortcut) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UserSetting_ShortcutsSetting_Shortcut) ProtoMessage() {}
func (x *UserSetting_ShortcutsSetting_Shortcut) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[44]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UserSetting_ShortcutsSetting_Shortcut.ProtoReflect.Descriptor instead.
func (*UserSetting_ShortcutsSetting_Shortcut) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{14, 3, 0}
}
func (x *UserSetting_ShortcutsSetting_Shortcut) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *UserSetting_ShortcutsSetting_Shortcut) GetTitle() string {
if x != nil {
return x.Title
}
return ""
}
func (x *UserSetting_ShortcutsSetting_Shortcut) GetFilter() string {
if x != nil {
return x.Filter
}
return ""
}
// User webhook definition.
type UserSetting_WebhooksSetting_Webhook struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Unique identifier for the webhook.
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// Descriptive title for the webhook.
Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
// The webhook URL endpoint.
Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *UserSetting_WebhooksSetting_Webhook) Reset() {
*x = UserSetting_WebhooksSetting_Webhook{}
mi := &file_api_v1_user_service_proto_msgTypes[45]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *UserSetting_WebhooksSetting_Webhook) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UserSetting_WebhooksSetting_Webhook) ProtoMessage() {}
func (x *UserSetting_WebhooksSetting_Webhook) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[45]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UserSetting_WebhooksSetting_Webhook.ProtoReflect.Descriptor instead.
func (*UserSetting_WebhooksSetting_Webhook) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{14, 4, 0}
}
func (x *UserSetting_WebhooksSetting_Webhook) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *UserSetting_WebhooksSetting_Webhook) GetTitle() string {
if x != nil {
return x.Title
}
return ""
}
func (x *UserSetting_WebhooksSetting_Webhook) GetUrl() string {
if x != nil {
return x.Url
}
return ""
}
type UserSession_ClientInfo struct { type UserSession_ClientInfo struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
// User agent string of the client. // User agent string of the client.
@ -3006,7 +2601,7 @@ type UserSession_ClientInfo struct {
func (x *UserSession_ClientInfo) Reset() { func (x *UserSession_ClientInfo) Reset() {
*x = UserSession_ClientInfo{} *x = UserSession_ClientInfo{}
mi := &file_api_v1_user_service_proto_msgTypes[46] mi := &file_api_v1_user_service_proto_msgTypes[40]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -3018,7 +2613,7 @@ func (x *UserSession_ClientInfo) String() string {
func (*UserSession_ClientInfo) ProtoMessage() {} func (*UserSession_ClientInfo) ProtoMessage() {}
func (x *UserSession_ClientInfo) ProtoReflect() protoreflect.Message { func (x *UserSession_ClientInfo) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[46] mi := &file_api_v1_user_service_proto_msgTypes[40]
if x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -3165,65 +2760,32 @@ const file_api_v1_user_service_proto_rawDesc = "" +
"\x11memos.api.v1/UserR\x04name\"\x19\n" + "\x11memos.api.v1/UserR\x04name\"\x19\n" +
"\x17ListAllUserStatsRequest\"I\n" + "\x17ListAllUserStatsRequest\"I\n" +
"\x18ListAllUserStatsResponse\x12-\n" + "\x18ListAllUserStatsResponse\x12-\n" +
"\x05stats\x18\x01 \x03(\v2\x17.memos.api.v1.UserStatsR\x05stats\"\xd1\x0f\n" + "\x05stats\x18\x01 \x03(\v2\x17.memos.api.v1.UserStatsR\x05stats\"\xd9\a\n" +
"\vUserSetting\x12\x17\n" + "\vUserSetting\x12\x17\n" +
"\x04name\x18\x01 \x01(\tB\x03\xe0A\bR\x04name\x12S\n" + "\x04name\x18\x01 \x01(\tB\x03\xe0A\bR\x04name\x12S\n" +
"\x0fgeneral_setting\x18\x02 \x01(\v2(.memos.api.v1.UserSetting.GeneralSettingH\x00R\x0egeneralSetting\x12V\n" + "\x0fgeneral_setting\x18\x02 \x01(\v2(.memos.api.v1.UserSetting.GeneralSettingH\x00R\x0egeneralSetting\x12V\n" +
"\x10sessions_setting\x18\x03 \x01(\v2).memos.api.v1.UserSetting.SessionsSettingH\x00R\x0fsessionsSetting\x12c\n" + "\x10sessions_setting\x18\x03 \x01(\v2).memos.api.v1.UserSetting.SessionsSettingH\x00R\x0fsessionsSetting\x12c\n" +
"\x15access_tokens_setting\x18\x04 \x01(\v2-.memos.api.v1.UserSetting.AccessTokensSettingH\x00R\x13accessTokensSetting\x12Y\n" + "\x15access_tokens_setting\x18\x04 \x01(\v2-.memos.api.v1.UserSetting.AccessTokensSettingH\x00R\x13accessTokensSetting\x12V\n" +
"\x11shortcuts_setting\x18\x05 \x01(\v2*.memos.api.v1.UserSetting.ShortcutsSettingH\x00R\x10shortcutsSetting\x12V\n" + "\x10webhooks_setting\x18\x05 \x01(\v2).memos.api.v1.UserSetting.WebhooksSettingH\x00R\x0fwebhooksSetting\x1a\x9b\x01\n" +
"\x10webhooks_setting\x18\x06 \x01(\v2).memos.api.v1.UserSetting.WebhooksSettingH\x00R\x0fwebhooksSetting\x1a\x9b\x01\n" +
"\x0eGeneralSetting\x12\x1b\n" + "\x0eGeneralSetting\x12\x1b\n" +
"\x06locale\x18\x01 \x01(\tB\x03\xe0A\x01R\x06locale\x12#\n" + "\x06locale\x18\x01 \x01(\tB\x03\xe0A\x01R\x06locale\x12#\n" +
"\n" + "\n" +
"appearance\x18\x02 \x01(\tB\x03\xe0A\x01R\n" + "appearance\x18\x02 \x01(\tB\x03\xe0A\x01R\n" +
"appearance\x12,\n" + "appearance\x12,\n" +
"\x0fmemo_visibility\x18\x03 \x01(\tB\x03\xe0A\x01R\x0ememoVisibility\x12\x19\n" + "\x0fmemo_visibility\x18\x03 \x01(\tB\x03\xe0A\x01R\x0ememoVisibility\x12\x19\n" +
"\x05theme\x18\x04 \x01(\tB\x03\xe0A\x01R\x05theme\x1a\xae\x04\n" + "\x05theme\x18\x04 \x01(\tB\x03\xe0A\x01R\x05theme\x1aH\n" +
"\x0fSessionsSetting\x12M\n" + "\x0fSessionsSetting\x125\n" +
"\bsessions\x18\x01 \x03(\v21.memos.api.v1.UserSetting.SessionsSetting.SessionR\bsessions\x1a\x9a\x02\n" + "\bsessions\x18\x01 \x03(\v2\x19.memos.api.v1.UserSessionR\bsessions\x1aY\n" +
"\aSession\x12\"\n" + "\x13AccessTokensSetting\x12B\n" +
"\n" + "\raccess_tokens\x18\x01 \x03(\v2\x1d.memos.api.v1.UserAccessTokenR\faccessTokens\x1aH\n" +
"session_id\x18\x01 \x01(\tB\x03\xe0A\x03R\tsessionId\x12@\n" + "\x0fWebhooksSetting\x125\n" +
"\vcreate_time\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampB\x03\xe0A\x03R\n" + "\bwebhooks\x18\x01 \x03(\v2\x19.memos.api.v1.UserWebhookR\bwebhooks\"V\n" +
"createTime\x12M\n" +
"\x12last_accessed_time\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampB\x03\xe0A\x03R\x10lastAccessedTime\x12Z\n" +
"\vclient_info\x18\x04 \x01(\v24.memos.api.v1.UserSetting.SessionsSetting.ClientInfoB\x03\xe0A\x03R\n" +
"clientInfo\x1a\xae\x01\n" +
"\n" +
"ClientInfo\x12\"\n" +
"\n" +
"user_agent\x18\x01 \x01(\tB\x03\xe0A\x03R\tuserAgent\x12\"\n" +
"\n" +
"ip_address\x18\x02 \x01(\tB\x03\xe0A\x03R\tipAddress\x12$\n" +
"\vdevice_type\x18\x03 \x01(\tB\x03\xe0A\x03R\n" +
"deviceType\x12\x13\n" +
"\x02os\x18\x04 \x01(\tB\x03\xe0A\x03R\x02os\x12\x1d\n" +
"\abrowser\x18\x05 \x01(\tB\x03\xe0A\x03R\abrowser\x1a\xd3\x01\n" +
"\x13AccessTokensSetting\x12^\n" +
"\raccess_tokens\x18\x01 \x03(\v29.memos.api.v1.UserSetting.AccessTokensSetting.AccessTokenR\faccessTokens\x1a\\\n" +
"\vAccessToken\x12&\n" +
"\faccess_token\x18\x01 \x01(\tB\x03\xe0A\x03R\vaccessToken\x12%\n" +
"\vdescription\x18\x02 \x01(\tB\x03\xe0A\x01R\vdescription\x1a\xbe\x01\n" +
"\x10ShortcutsSetting\x12Q\n" +
"\tshortcuts\x18\x01 \x03(\v23.memos.api.v1.UserSetting.ShortcutsSetting.ShortcutR\tshortcuts\x1aW\n" +
"\bShortcut\x12\x13\n" +
"\x02id\x18\x01 \x01(\tB\x03\xe0A\x02R\x02id\x12\x19\n" +
"\x05title\x18\x02 \x01(\tB\x03\xe0A\x02R\x05title\x12\x1b\n" +
"\x06filter\x18\x03 \x01(\tB\x03\xe0A\x02R\x06filter\x1a\xb2\x01\n" +
"\x0fWebhooksSetting\x12M\n" +
"\bwebhooks\x18\x01 \x03(\v21.memos.api.v1.UserSetting.WebhooksSetting.WebhookR\bwebhooks\x1aP\n" +
"\aWebhook\x12\x13\n" +
"\x02id\x18\x01 \x01(\tB\x03\xe0A\x02R\x02id\x12\x19\n" +
"\x05title\x18\x02 \x01(\tB\x03\xe0A\x02R\x05title\x12\x15\n" +
"\x03url\x18\x03 \x01(\tB\x03\xe0A\x02R\x03url\"e\n" +
"\x03Key\x12\x13\n" + "\x03Key\x12\x13\n" +
"\x0fKEY_UNSPECIFIED\x10\x00\x12\v\n" + "\x0fKEY_UNSPECIFIED\x10\x00\x12\v\n" +
"\aGENERAL\x10\x01\x12\f\n" + "\aGENERAL\x10\x01\x12\f\n" +
"\bSESSIONS\x10\x02\x12\x11\n" + "\bSESSIONS\x10\x02\x12\x11\n" +
"\rACCESS_TOKENS\x10\x03\x12\r\n" + "\rACCESS_TOKENS\x10\x03\x12\f\n" +
"\tSHORTCUTS\x10\x04\x12\f\n" + "\bWEBHOOKS\x10\x04:Y\xeaAV\n" +
"\bWEBHOOKS\x10\x05:Y\xeaAV\n" +
"\x18memos.api.v1/UserSetting\x12\x1fusers/{user}/settings/{setting}*\fuserSettings2\vuserSettingB\a\n" + "\x18memos.api.v1/UserSetting\x12\x1fusers/{user}/settings/{setting}*\fuserSettings2\vuserSettingB\a\n" +
"\x05value\"M\n" + "\x05value\"M\n" +
"\x15GetUserSettingRequest\x124\n" + "\x15GetUserSettingRequest\x124\n" +
@ -3359,7 +2921,7 @@ func file_api_v1_user_service_proto_rawDescGZIP() []byte {
} }
var file_api_v1_user_service_proto_enumTypes = make([]protoimpl.EnumInfo, 2) var file_api_v1_user_service_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_api_v1_user_service_proto_msgTypes = make([]protoimpl.MessageInfo, 47) var file_api_v1_user_service_proto_msgTypes = make([]protoimpl.MessageInfo, 41)
var file_api_v1_user_service_proto_goTypes = []any{ var file_api_v1_user_service_proto_goTypes = []any{
(User_Role)(0), // 0: memos.api.v1.User.Role (User_Role)(0), // 0: memos.api.v1.User.Role
(UserSetting_Key)(0), // 1: memos.api.v1.UserSetting.Key (UserSetting_Key)(0), // 1: memos.api.v1.UserSetting.Key
@ -3402,111 +2964,100 @@ var file_api_v1_user_service_proto_goTypes = []any{
(*UserSetting_GeneralSetting)(nil), // 38: memos.api.v1.UserSetting.GeneralSetting (*UserSetting_GeneralSetting)(nil), // 38: memos.api.v1.UserSetting.GeneralSetting
(*UserSetting_SessionsSetting)(nil), // 39: memos.api.v1.UserSetting.SessionsSetting (*UserSetting_SessionsSetting)(nil), // 39: memos.api.v1.UserSetting.SessionsSetting
(*UserSetting_AccessTokensSetting)(nil), // 40: memos.api.v1.UserSetting.AccessTokensSetting (*UserSetting_AccessTokensSetting)(nil), // 40: memos.api.v1.UserSetting.AccessTokensSetting
(*UserSetting_ShortcutsSetting)(nil), // 41: memos.api.v1.UserSetting.ShortcutsSetting (*UserSetting_WebhooksSetting)(nil), // 41: memos.api.v1.UserSetting.WebhooksSetting
(*UserSetting_WebhooksSetting)(nil), // 42: memos.api.v1.UserSetting.WebhooksSetting (*UserSession_ClientInfo)(nil), // 42: memos.api.v1.UserSession.ClientInfo
(*UserSetting_SessionsSetting_Session)(nil), // 43: memos.api.v1.UserSetting.SessionsSetting.Session (State)(0), // 43: memos.api.v1.State
(*UserSetting_SessionsSetting_ClientInfo)(nil), // 44: memos.api.v1.UserSetting.SessionsSetting.ClientInfo (*timestamppb.Timestamp)(nil), // 44: google.protobuf.Timestamp
(*UserSetting_AccessTokensSetting_AccessToken)(nil), // 45: memos.api.v1.UserSetting.AccessTokensSetting.AccessToken (*fieldmaskpb.FieldMask)(nil), // 45: google.protobuf.FieldMask
(*UserSetting_ShortcutsSetting_Shortcut)(nil), // 46: memos.api.v1.UserSetting.ShortcutsSetting.Shortcut (*emptypb.Empty)(nil), // 46: google.protobuf.Empty
(*UserSetting_WebhooksSetting_Webhook)(nil), // 47: memos.api.v1.UserSetting.WebhooksSetting.Webhook (*httpbody.HttpBody)(nil), // 47: google.api.HttpBody
(*UserSession_ClientInfo)(nil), // 48: memos.api.v1.UserSession.ClientInfo
(State)(0), // 49: memos.api.v1.State
(*timestamppb.Timestamp)(nil), // 50: google.protobuf.Timestamp
(*fieldmaskpb.FieldMask)(nil), // 51: google.protobuf.FieldMask
(*emptypb.Empty)(nil), // 52: google.protobuf.Empty
(*httpbody.HttpBody)(nil), // 53: google.api.HttpBody
} }
var file_api_v1_user_service_proto_depIdxs = []int32{ var file_api_v1_user_service_proto_depIdxs = []int32{
0, // 0: memos.api.v1.User.role:type_name -> memos.api.v1.User.Role 0, // 0: memos.api.v1.User.role:type_name -> memos.api.v1.User.Role
49, // 1: memos.api.v1.User.state:type_name -> memos.api.v1.State 43, // 1: memos.api.v1.User.state:type_name -> memos.api.v1.State
50, // 2: memos.api.v1.User.create_time:type_name -> google.protobuf.Timestamp 44, // 2: memos.api.v1.User.create_time:type_name -> google.protobuf.Timestamp
50, // 3: memos.api.v1.User.update_time:type_name -> google.protobuf.Timestamp 44, // 3: memos.api.v1.User.update_time:type_name -> google.protobuf.Timestamp
2, // 4: memos.api.v1.ListUsersResponse.users:type_name -> memos.api.v1.User 2, // 4: memos.api.v1.ListUsersResponse.users:type_name -> memos.api.v1.User
51, // 5: memos.api.v1.GetUserRequest.read_mask:type_name -> google.protobuf.FieldMask 45, // 5: memos.api.v1.GetUserRequest.read_mask:type_name -> google.protobuf.FieldMask
2, // 6: memos.api.v1.CreateUserRequest.user:type_name -> memos.api.v1.User 2, // 6: memos.api.v1.CreateUserRequest.user:type_name -> memos.api.v1.User
2, // 7: memos.api.v1.UpdateUserRequest.user:type_name -> memos.api.v1.User 2, // 7: memos.api.v1.UpdateUserRequest.user:type_name -> memos.api.v1.User
51, // 8: memos.api.v1.UpdateUserRequest.update_mask:type_name -> google.protobuf.FieldMask 45, // 8: memos.api.v1.UpdateUserRequest.update_mask:type_name -> google.protobuf.FieldMask
2, // 9: memos.api.v1.SearchUsersResponse.users:type_name -> memos.api.v1.User 2, // 9: memos.api.v1.SearchUsersResponse.users:type_name -> memos.api.v1.User
50, // 10: memos.api.v1.UserStats.memo_display_timestamps:type_name -> google.protobuf.Timestamp 44, // 10: memos.api.v1.UserStats.memo_display_timestamps:type_name -> google.protobuf.Timestamp
37, // 11: memos.api.v1.UserStats.memo_type_stats:type_name -> memos.api.v1.UserStats.MemoTypeStats 37, // 11: memos.api.v1.UserStats.memo_type_stats:type_name -> memos.api.v1.UserStats.MemoTypeStats
36, // 12: memos.api.v1.UserStats.tag_count:type_name -> memos.api.v1.UserStats.TagCountEntry 36, // 12: memos.api.v1.UserStats.tag_count:type_name -> memos.api.v1.UserStats.TagCountEntry
12, // 13: memos.api.v1.ListAllUserStatsResponse.stats:type_name -> memos.api.v1.UserStats 12, // 13: memos.api.v1.ListAllUserStatsResponse.stats:type_name -> memos.api.v1.UserStats
38, // 14: memos.api.v1.UserSetting.general_setting:type_name -> memos.api.v1.UserSetting.GeneralSetting 38, // 14: memos.api.v1.UserSetting.general_setting:type_name -> memos.api.v1.UserSetting.GeneralSetting
39, // 15: memos.api.v1.UserSetting.sessions_setting:type_name -> memos.api.v1.UserSetting.SessionsSetting 39, // 15: memos.api.v1.UserSetting.sessions_setting:type_name -> memos.api.v1.UserSetting.SessionsSetting
40, // 16: memos.api.v1.UserSetting.access_tokens_setting:type_name -> memos.api.v1.UserSetting.AccessTokensSetting 40, // 16: memos.api.v1.UserSetting.access_tokens_setting:type_name -> memos.api.v1.UserSetting.AccessTokensSetting
41, // 17: memos.api.v1.UserSetting.shortcuts_setting:type_name -> memos.api.v1.UserSetting.ShortcutsSetting 41, // 17: memos.api.v1.UserSetting.webhooks_setting:type_name -> memos.api.v1.UserSetting.WebhooksSetting
42, // 18: memos.api.v1.UserSetting.webhooks_setting:type_name -> memos.api.v1.UserSetting.WebhooksSetting 16, // 18: memos.api.v1.UpdateUserSettingRequest.setting:type_name -> memos.api.v1.UserSetting
16, // 19: memos.api.v1.UpdateUserSettingRequest.setting:type_name -> memos.api.v1.UserSetting 45, // 19: memos.api.v1.UpdateUserSettingRequest.update_mask:type_name -> google.protobuf.FieldMask
51, // 20: memos.api.v1.UpdateUserSettingRequest.update_mask:type_name -> google.protobuf.FieldMask 16, // 20: memos.api.v1.ListUserSettingsResponse.settings:type_name -> memos.api.v1.UserSetting
16, // 21: memos.api.v1.ListUserSettingsResponse.settings:type_name -> memos.api.v1.UserSetting 44, // 21: memos.api.v1.UserAccessToken.issued_at:type_name -> google.protobuf.Timestamp
50, // 22: memos.api.v1.UserAccessToken.issued_at:type_name -> google.protobuf.Timestamp 44, // 22: memos.api.v1.UserAccessToken.expires_at:type_name -> google.protobuf.Timestamp
50, // 23: memos.api.v1.UserAccessToken.expires_at:type_name -> google.protobuf.Timestamp 21, // 23: memos.api.v1.ListUserAccessTokensResponse.access_tokens:type_name -> memos.api.v1.UserAccessToken
21, // 24: memos.api.v1.ListUserAccessTokensResponse.access_tokens:type_name -> memos.api.v1.UserAccessToken 21, // 24: memos.api.v1.CreateUserAccessTokenRequest.access_token:type_name -> memos.api.v1.UserAccessToken
21, // 25: memos.api.v1.CreateUserAccessTokenRequest.access_token:type_name -> memos.api.v1.UserAccessToken 44, // 25: memos.api.v1.UserSession.create_time:type_name -> google.protobuf.Timestamp
50, // 26: memos.api.v1.UserSession.create_time:type_name -> google.protobuf.Timestamp 44, // 26: memos.api.v1.UserSession.last_accessed_time:type_name -> google.protobuf.Timestamp
50, // 27: memos.api.v1.UserSession.last_accessed_time:type_name -> google.protobuf.Timestamp 42, // 27: memos.api.v1.UserSession.client_info:type_name -> memos.api.v1.UserSession.ClientInfo
48, // 28: memos.api.v1.UserSession.client_info:type_name -> memos.api.v1.UserSession.ClientInfo 26, // 28: memos.api.v1.ListUserSessionsResponse.sessions:type_name -> memos.api.v1.UserSession
26, // 29: memos.api.v1.ListUserSessionsResponse.sessions:type_name -> memos.api.v1.UserSession 44, // 29: memos.api.v1.UserWebhook.create_time:type_name -> google.protobuf.Timestamp
50, // 30: memos.api.v1.UserWebhook.create_time:type_name -> google.protobuf.Timestamp 44, // 30: memos.api.v1.UserWebhook.update_time:type_name -> google.protobuf.Timestamp
50, // 31: memos.api.v1.UserWebhook.update_time:type_name -> google.protobuf.Timestamp 30, // 31: memos.api.v1.ListUserWebhooksResponse.webhooks:type_name -> memos.api.v1.UserWebhook
30, // 32: memos.api.v1.ListUserWebhooksResponse.webhooks:type_name -> memos.api.v1.UserWebhook 30, // 32: memos.api.v1.CreateUserWebhookRequest.webhook:type_name -> memos.api.v1.UserWebhook
30, // 33: memos.api.v1.CreateUserWebhookRequest.webhook:type_name -> memos.api.v1.UserWebhook 30, // 33: memos.api.v1.UpdateUserWebhookRequest.webhook:type_name -> memos.api.v1.UserWebhook
30, // 34: memos.api.v1.UpdateUserWebhookRequest.webhook:type_name -> memos.api.v1.UserWebhook 45, // 34: memos.api.v1.UpdateUserWebhookRequest.update_mask:type_name -> google.protobuf.FieldMask
51, // 35: memos.api.v1.UpdateUserWebhookRequest.update_mask:type_name -> google.protobuf.FieldMask 26, // 35: memos.api.v1.UserSetting.SessionsSetting.sessions:type_name -> memos.api.v1.UserSession
43, // 36: memos.api.v1.UserSetting.SessionsSetting.sessions:type_name -> memos.api.v1.UserSetting.SessionsSetting.Session 21, // 36: memos.api.v1.UserSetting.AccessTokensSetting.access_tokens:type_name -> memos.api.v1.UserAccessToken
45, // 37: memos.api.v1.UserSetting.AccessTokensSetting.access_tokens:type_name -> memos.api.v1.UserSetting.AccessTokensSetting.AccessToken 30, // 37: memos.api.v1.UserSetting.WebhooksSetting.webhooks:type_name -> memos.api.v1.UserWebhook
46, // 38: memos.api.v1.UserSetting.ShortcutsSetting.shortcuts:type_name -> memos.api.v1.UserSetting.ShortcutsSetting.Shortcut 3, // 38: memos.api.v1.UserService.ListUsers:input_type -> memos.api.v1.ListUsersRequest
47, // 39: memos.api.v1.UserSetting.WebhooksSetting.webhooks:type_name -> memos.api.v1.UserSetting.WebhooksSetting.Webhook 5, // 39: memos.api.v1.UserService.GetUser:input_type -> memos.api.v1.GetUserRequest
50, // 40: memos.api.v1.UserSetting.SessionsSetting.Session.create_time:type_name -> google.protobuf.Timestamp 6, // 40: memos.api.v1.UserService.CreateUser:input_type -> memos.api.v1.CreateUserRequest
50, // 41: memos.api.v1.UserSetting.SessionsSetting.Session.last_accessed_time:type_name -> google.protobuf.Timestamp 7, // 41: memos.api.v1.UserService.UpdateUser:input_type -> memos.api.v1.UpdateUserRequest
44, // 42: memos.api.v1.UserSetting.SessionsSetting.Session.client_info:type_name -> memos.api.v1.UserSetting.SessionsSetting.ClientInfo 8, // 42: memos.api.v1.UserService.DeleteUser:input_type -> memos.api.v1.DeleteUserRequest
3, // 43: memos.api.v1.UserService.ListUsers:input_type -> memos.api.v1.ListUsersRequest 9, // 43: memos.api.v1.UserService.SearchUsers:input_type -> memos.api.v1.SearchUsersRequest
5, // 44: memos.api.v1.UserService.GetUser:input_type -> memos.api.v1.GetUserRequest 11, // 44: memos.api.v1.UserService.GetUserAvatar:input_type -> memos.api.v1.GetUserAvatarRequest
6, // 45: memos.api.v1.UserService.CreateUser:input_type -> memos.api.v1.CreateUserRequest 14, // 45: memos.api.v1.UserService.ListAllUserStats:input_type -> memos.api.v1.ListAllUserStatsRequest
7, // 46: memos.api.v1.UserService.UpdateUser:input_type -> memos.api.v1.UpdateUserRequest 13, // 46: memos.api.v1.UserService.GetUserStats:input_type -> memos.api.v1.GetUserStatsRequest
8, // 47: memos.api.v1.UserService.DeleteUser:input_type -> memos.api.v1.DeleteUserRequest 17, // 47: memos.api.v1.UserService.GetUserSetting:input_type -> memos.api.v1.GetUserSettingRequest
9, // 48: memos.api.v1.UserService.SearchUsers:input_type -> memos.api.v1.SearchUsersRequest 18, // 48: memos.api.v1.UserService.UpdateUserSetting:input_type -> memos.api.v1.UpdateUserSettingRequest
11, // 49: memos.api.v1.UserService.GetUserAvatar:input_type -> memos.api.v1.GetUserAvatarRequest 19, // 49: memos.api.v1.UserService.ListUserSettings:input_type -> memos.api.v1.ListUserSettingsRequest
14, // 50: memos.api.v1.UserService.ListAllUserStats:input_type -> memos.api.v1.ListAllUserStatsRequest 22, // 50: memos.api.v1.UserService.ListUserAccessTokens:input_type -> memos.api.v1.ListUserAccessTokensRequest
13, // 51: memos.api.v1.UserService.GetUserStats:input_type -> memos.api.v1.GetUserStatsRequest 24, // 51: memos.api.v1.UserService.CreateUserAccessToken:input_type -> memos.api.v1.CreateUserAccessTokenRequest
17, // 52: memos.api.v1.UserService.GetUserSetting:input_type -> memos.api.v1.GetUserSettingRequest 25, // 52: memos.api.v1.UserService.DeleteUserAccessToken:input_type -> memos.api.v1.DeleteUserAccessTokenRequest
18, // 53: memos.api.v1.UserService.UpdateUserSetting:input_type -> memos.api.v1.UpdateUserSettingRequest 27, // 53: memos.api.v1.UserService.ListUserSessions:input_type -> memos.api.v1.ListUserSessionsRequest
19, // 54: memos.api.v1.UserService.ListUserSettings:input_type -> memos.api.v1.ListUserSettingsRequest 29, // 54: memos.api.v1.UserService.RevokeUserSession:input_type -> memos.api.v1.RevokeUserSessionRequest
22, // 55: memos.api.v1.UserService.ListUserAccessTokens:input_type -> memos.api.v1.ListUserAccessTokensRequest 31, // 55: memos.api.v1.UserService.ListUserWebhooks:input_type -> memos.api.v1.ListUserWebhooksRequest
24, // 56: memos.api.v1.UserService.CreateUserAccessToken:input_type -> memos.api.v1.CreateUserAccessTokenRequest 33, // 56: memos.api.v1.UserService.CreateUserWebhook:input_type -> memos.api.v1.CreateUserWebhookRequest
25, // 57: memos.api.v1.UserService.DeleteUserAccessToken:input_type -> memos.api.v1.DeleteUserAccessTokenRequest 34, // 57: memos.api.v1.UserService.UpdateUserWebhook:input_type -> memos.api.v1.UpdateUserWebhookRequest
27, // 58: memos.api.v1.UserService.ListUserSessions:input_type -> memos.api.v1.ListUserSessionsRequest 35, // 58: memos.api.v1.UserService.DeleteUserWebhook:input_type -> memos.api.v1.DeleteUserWebhookRequest
29, // 59: memos.api.v1.UserService.RevokeUserSession:input_type -> memos.api.v1.RevokeUserSessionRequest 4, // 59: memos.api.v1.UserService.ListUsers:output_type -> memos.api.v1.ListUsersResponse
31, // 60: memos.api.v1.UserService.ListUserWebhooks:input_type -> memos.api.v1.ListUserWebhooksRequest 2, // 60: memos.api.v1.UserService.GetUser:output_type -> memos.api.v1.User
33, // 61: memos.api.v1.UserService.CreateUserWebhook:input_type -> memos.api.v1.CreateUserWebhookRequest 2, // 61: memos.api.v1.UserService.CreateUser:output_type -> memos.api.v1.User
34, // 62: memos.api.v1.UserService.UpdateUserWebhook:input_type -> memos.api.v1.UpdateUserWebhookRequest 2, // 62: memos.api.v1.UserService.UpdateUser:output_type -> memos.api.v1.User
35, // 63: memos.api.v1.UserService.DeleteUserWebhook:input_type -> memos.api.v1.DeleteUserWebhookRequest 46, // 63: memos.api.v1.UserService.DeleteUser:output_type -> google.protobuf.Empty
4, // 64: memos.api.v1.UserService.ListUsers:output_type -> memos.api.v1.ListUsersResponse 10, // 64: memos.api.v1.UserService.SearchUsers:output_type -> memos.api.v1.SearchUsersResponse
2, // 65: memos.api.v1.UserService.GetUser:output_type -> memos.api.v1.User 47, // 65: memos.api.v1.UserService.GetUserAvatar:output_type -> google.api.HttpBody
2, // 66: memos.api.v1.UserService.CreateUser:output_type -> memos.api.v1.User 15, // 66: memos.api.v1.UserService.ListAllUserStats:output_type -> memos.api.v1.ListAllUserStatsResponse
2, // 67: memos.api.v1.UserService.UpdateUser:output_type -> memos.api.v1.User 12, // 67: memos.api.v1.UserService.GetUserStats:output_type -> memos.api.v1.UserStats
52, // 68: memos.api.v1.UserService.DeleteUser:output_type -> google.protobuf.Empty 16, // 68: memos.api.v1.UserService.GetUserSetting:output_type -> memos.api.v1.UserSetting
10, // 69: memos.api.v1.UserService.SearchUsers:output_type -> memos.api.v1.SearchUsersResponse 16, // 69: memos.api.v1.UserService.UpdateUserSetting:output_type -> memos.api.v1.UserSetting
53, // 70: memos.api.v1.UserService.GetUserAvatar:output_type -> google.api.HttpBody 20, // 70: memos.api.v1.UserService.ListUserSettings:output_type -> memos.api.v1.ListUserSettingsResponse
15, // 71: memos.api.v1.UserService.ListAllUserStats:output_type -> memos.api.v1.ListAllUserStatsResponse 23, // 71: memos.api.v1.UserService.ListUserAccessTokens:output_type -> memos.api.v1.ListUserAccessTokensResponse
12, // 72: memos.api.v1.UserService.GetUserStats:output_type -> memos.api.v1.UserStats 21, // 72: memos.api.v1.UserService.CreateUserAccessToken:output_type -> memos.api.v1.UserAccessToken
16, // 73: memos.api.v1.UserService.GetUserSetting:output_type -> memos.api.v1.UserSetting 46, // 73: memos.api.v1.UserService.DeleteUserAccessToken:output_type -> google.protobuf.Empty
16, // 74: memos.api.v1.UserService.UpdateUserSetting:output_type -> memos.api.v1.UserSetting 28, // 74: memos.api.v1.UserService.ListUserSessions:output_type -> memos.api.v1.ListUserSessionsResponse
20, // 75: memos.api.v1.UserService.ListUserSettings:output_type -> memos.api.v1.ListUserSettingsResponse 46, // 75: memos.api.v1.UserService.RevokeUserSession:output_type -> google.protobuf.Empty
23, // 76: memos.api.v1.UserService.ListUserAccessTokens:output_type -> memos.api.v1.ListUserAccessTokensResponse 32, // 76: memos.api.v1.UserService.ListUserWebhooks:output_type -> memos.api.v1.ListUserWebhooksResponse
21, // 77: memos.api.v1.UserService.CreateUserAccessToken:output_type -> memos.api.v1.UserAccessToken 30, // 77: memos.api.v1.UserService.CreateUserWebhook:output_type -> memos.api.v1.UserWebhook
52, // 78: memos.api.v1.UserService.DeleteUserAccessToken:output_type -> google.protobuf.Empty 30, // 78: memos.api.v1.UserService.UpdateUserWebhook:output_type -> memos.api.v1.UserWebhook
28, // 79: memos.api.v1.UserService.ListUserSessions:output_type -> memos.api.v1.ListUserSessionsResponse 46, // 79: memos.api.v1.UserService.DeleteUserWebhook:output_type -> google.protobuf.Empty
52, // 80: memos.api.v1.UserService.RevokeUserSession:output_type -> google.protobuf.Empty 59, // [59:80] is the sub-list for method output_type
32, // 81: memos.api.v1.UserService.ListUserWebhooks:output_type -> memos.api.v1.ListUserWebhooksResponse 38, // [38:59] is the sub-list for method input_type
30, // 82: memos.api.v1.UserService.CreateUserWebhook:output_type -> memos.api.v1.UserWebhook 38, // [38:38] is the sub-list for extension type_name
30, // 83: memos.api.v1.UserService.UpdateUserWebhook:output_type -> memos.api.v1.UserWebhook 38, // [38:38] is the sub-list for extension extendee
52, // 84: memos.api.v1.UserService.DeleteUserWebhook:output_type -> google.protobuf.Empty 0, // [0:38] is the sub-list for field type_name
64, // [64:85] is the sub-list for method output_type
43, // [43:64] is the sub-list for method input_type
43, // [43:43] is the sub-list for extension type_name
43, // [43:43] is the sub-list for extension extendee
0, // [0:43] is the sub-list for field type_name
} }
func init() { file_api_v1_user_service_proto_init() } func init() { file_api_v1_user_service_proto_init() }
@ -3519,7 +3070,6 @@ func file_api_v1_user_service_proto_init() {
(*UserSetting_GeneralSetting_)(nil), (*UserSetting_GeneralSetting_)(nil),
(*UserSetting_SessionsSetting_)(nil), (*UserSetting_SessionsSetting_)(nil),
(*UserSetting_AccessTokensSetting_)(nil), (*UserSetting_AccessTokensSetting_)(nil),
(*UserSetting_ShortcutsSetting_)(nil),
(*UserSetting_WebhooksSetting_)(nil), (*UserSetting_WebhooksSetting_)(nil),
} }
type x struct{} type x struct{}
@ -3528,7 +3078,7 @@ func file_api_v1_user_service_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_api_v1_user_service_proto_rawDesc), len(file_api_v1_user_service_proto_rawDesc)), RawDescriptor: unsafe.Slice(unsafe.StringData(file_api_v1_user_service_proto_rawDesc), len(file_api_v1_user_service_proto_rawDesc)),
NumEnums: 2, NumEnums: 2,
NumMessages: 47, NumMessages: 41,
NumExtensions: 0, NumExtensions: 0,
NumServices: 1, NumServices: 1,
}, },

@ -2256,19 +2256,6 @@ paths:
$ref: '#/components/schemas/Status' $ref: '#/components/schemas/Status'
components: components:
schemas: schemas:
AccessTokensSetting_AccessToken:
type: object
properties:
accessToken:
readOnly: true
type: string
description: |-
The access token is a JWT token.
Including expiration time, issuer, etc.
description:
type: string
description: A description for the access token.
description: User access token information.
Activity: Activity:
type: object type: object
properties: properties:
@ -3344,55 +3331,6 @@ components:
type: integer type: integer
description: The total count of matching users. description: The total count of matching users.
format: int32 format: int32
SessionsSetting_ClientInfo:
type: object
properties:
userAgent:
readOnly: true
type: string
description: User agent string of the client.
ipAddress:
readOnly: true
type: string
description: IP address of the client.
deviceType:
readOnly: true
type: string
description: Optional. Device type (e.g., "mobile", "desktop", "tablet").
os:
readOnly: true
type: string
description: Optional. Operating system (e.g., "iOS 17.0", "Windows 11").
browser:
readOnly: true
type: string
description: Optional. Browser name and version (e.g., "Chrome 119.0").
description: Client information for a session.
SessionsSetting_Session:
type: object
properties:
sessionId:
readOnly: true
type: string
description: Unique session identifier.
createTime:
readOnly: true
type: string
description: Timestamp when the session was created.
format: date-time
lastAccessedTime:
readOnly: true
type: string
description: |-
Timestamp when the session was last accessed.
Used for sliding expiration calculation (last_accessed_time + 2 weeks).
format: date-time
clientInfo:
readOnly: true
allOf:
- $ref: '#/components/schemas/SessionsSetting_ClientInfo'
description: Client information associated with this session.
description: User session information.
SetMemoAttachmentsRequest: SetMemoAttachmentsRequest:
required: required:
- name - name
@ -3441,23 +3379,6 @@ components:
filter: filter:
type: string type: string
description: The filter expression for the shortcut. description: The filter expression for the shortcut.
ShortcutsSetting_Shortcut:
required:
- id
- title
- filter
type: object
properties:
id:
type: string
description: Unique identifier for the shortcut.
title:
type: string
description: Display title for the shortcut.
filter:
type: string
description: Filter expression for the shortcut.
description: User shortcut definition.
SpoilerNode: SpoilerNode:
type: object type: object
properties: properties:
@ -3738,15 +3659,14 @@ components:
type: string type: string
description: |- description: |-
The name of the user setting. The name of the user setting.
Format: users/{user}/settings/{setting} Format: users/{user}/settings/{setting}, {setting} is the key for the setting.
For example, "users/123/settings/GENERAL" for general settings.
generalSetting: generalSetting:
$ref: '#/components/schemas/UserSetting_GeneralSetting' $ref: '#/components/schemas/UserSetting_GeneralSetting'
sessionsSetting: sessionsSetting:
$ref: '#/components/schemas/UserSetting_SessionsSetting' $ref: '#/components/schemas/UserSetting_SessionsSetting'
accessTokensSetting: accessTokensSetting:
$ref: '#/components/schemas/UserSetting_AccessTokensSetting' $ref: '#/components/schemas/UserSetting_AccessTokensSetting'
shortcutsSetting:
$ref: '#/components/schemas/UserSetting_ShortcutsSetting'
webhooksSetting: webhooksSetting:
$ref: '#/components/schemas/UserSetting_WebhooksSetting' $ref: '#/components/schemas/UserSetting_WebhooksSetting'
description: User settings message description: User settings message
@ -3756,7 +3676,7 @@ components:
accessTokens: accessTokens:
type: array type: array
items: items:
$ref: '#/components/schemas/AccessTokensSetting_AccessToken' $ref: '#/components/schemas/UserAccessToken'
description: List of user access tokens. description: List of user access tokens.
description: User access tokens configuration. description: User access tokens configuration.
UserSetting_GeneralSetting: UserSetting_GeneralSetting:
@ -3784,25 +3704,16 @@ components:
sessions: sessions:
type: array type: array
items: items:
$ref: '#/components/schemas/SessionsSetting_Session' $ref: '#/components/schemas/UserSession'
description: List of active user sessions. description: List of active user sessions.
description: User authentication sessions configuration. description: User authentication sessions configuration.
UserSetting_ShortcutsSetting:
type: object
properties:
shortcuts:
type: array
items:
$ref: '#/components/schemas/ShortcutsSetting_Shortcut'
description: List of user shortcuts.
description: User shortcuts configuration.
UserSetting_WebhooksSetting: UserSetting_WebhooksSetting:
type: object type: object
properties: properties:
webhooks: webhooks:
type: array type: array
items: items:
$ref: '#/components/schemas/WebhooksSetting_Webhook' $ref: '#/components/schemas/UserWebhook'
description: List of user webhooks. description: List of user webhooks.
description: User webhooks configuration. description: User webhooks configuration.
UserStats: UserStats:
@ -3880,23 +3791,6 @@ components:
description: The last update time of the webhook. description: The last update time of the webhook.
format: date-time format: date-time
description: UserWebhook represents a webhook owned by a user. description: UserWebhook represents a webhook owned by a user.
WebhooksSetting_Webhook:
required:
- id
- title
- url
type: object
properties:
id:
type: string
description: Unique identifier for the webhook.
title:
type: string
description: Descriptive title for the webhook.
url:
type: string
description: The webhook URL endpoint.
description: User webhook definition.
WorkspaceProfile: WorkspaceProfile:
type: object type: object
properties: properties:

@ -1067,15 +1067,13 @@ func ExtractUserIDAndSettingKeyFromName(name string) (int32, string, error) {
// convertSettingKeyToStore converts API setting key to store enum. // convertSettingKeyToStore converts API setting key to store enum.
func convertSettingKeyToStore(key string) (storepb.UserSetting_Key, error) { func convertSettingKeyToStore(key string) (storepb.UserSetting_Key, error) {
switch key { switch key {
case "general": case v1pb.UserSetting_Key_name[int32(v1pb.UserSetting_GENERAL)]:
return storepb.UserSetting_GENERAL, nil return storepb.UserSetting_GENERAL, nil
case "sessions": case v1pb.UserSetting_Key_name[int32(v1pb.UserSetting_SESSIONS)]:
return storepb.UserSetting_SESSIONS, nil return storepb.UserSetting_SESSIONS, nil
case "access-tokens": case v1pb.UserSetting_Key_name[int32(v1pb.UserSetting_ACCESS_TOKENS)]:
return storepb.UserSetting_ACCESS_TOKENS, nil return storepb.UserSetting_ACCESS_TOKENS, nil
case "shortcuts": case v1pb.UserSetting_Key_name[int32(v1pb.UserSetting_WEBHOOKS)]:
return storepb.UserSetting_SHORTCUTS, nil
case "webhooks":
return storepb.UserSetting_WEBHOOKS, nil return storepb.UserSetting_WEBHOOKS, nil
default: default:
return storepb.UserSetting_KEY_UNSPECIFIED, errors.Errorf("unknown setting key: %s", key) return storepb.UserSetting_KEY_UNSPECIFIED, errors.Errorf("unknown setting key: %s", key)
@ -1086,15 +1084,15 @@ func convertSettingKeyToStore(key string) (storepb.UserSetting_Key, error) {
func convertSettingKeyFromStore(key storepb.UserSetting_Key) string { func convertSettingKeyFromStore(key storepb.UserSetting_Key) string {
switch key { switch key {
case storepb.UserSetting_GENERAL: case storepb.UserSetting_GENERAL:
return "general" return v1pb.UserSetting_Key_name[int32(v1pb.UserSetting_GENERAL)]
case storepb.UserSetting_SESSIONS: case storepb.UserSetting_SESSIONS:
return "sessions" return v1pb.UserSetting_Key_name[int32(v1pb.UserSetting_SESSIONS)]
case storepb.UserSetting_ACCESS_TOKENS: case storepb.UserSetting_ACCESS_TOKENS:
return "access-tokens" return v1pb.UserSetting_Key_name[int32(v1pb.UserSetting_ACCESS_TOKENS)]
case storepb.UserSetting_SHORTCUTS: case storepb.UserSetting_SHORTCUTS:
return "shortcuts" return "SHORTCUTS" // Not defined in API proto
case storepb.UserSetting_WEBHOOKS: case storepb.UserSetting_WEBHOOKS:
return "webhooks" return v1pb.UserSetting_Key_name[int32(v1pb.UserSetting_WEBHOOKS)]
default: default:
return "unknown" return "unknown"
} }
@ -1117,25 +1115,19 @@ func convertUserSettingFromStore(storeSetting *storepb.UserSetting, userID int32
case storepb.UserSetting_SESSIONS: case storepb.UserSetting_SESSIONS:
setting.Value = &v1pb.UserSetting_SessionsSetting_{ setting.Value = &v1pb.UserSetting_SessionsSetting_{
SessionsSetting: &v1pb.UserSetting_SessionsSetting{ SessionsSetting: &v1pb.UserSetting_SessionsSetting{
Sessions: []*v1pb.UserSetting_SessionsSetting_Session{}, Sessions: []*v1pb.UserSession{},
}, },
} }
case storepb.UserSetting_ACCESS_TOKENS: case storepb.UserSetting_ACCESS_TOKENS:
setting.Value = &v1pb.UserSetting_AccessTokensSetting_{ setting.Value = &v1pb.UserSetting_AccessTokensSetting_{
AccessTokensSetting: &v1pb.UserSetting_AccessTokensSetting{ AccessTokensSetting: &v1pb.UserSetting_AccessTokensSetting{
AccessTokens: []*v1pb.UserSetting_AccessTokensSetting_AccessToken{}, AccessTokens: []*v1pb.UserAccessToken{},
},
}
case storepb.UserSetting_SHORTCUTS:
setting.Value = &v1pb.UserSetting_ShortcutsSetting_{
ShortcutsSetting: &v1pb.UserSetting_ShortcutsSetting{
Shortcuts: []*v1pb.UserSetting_ShortcutsSetting_Shortcut{},
}, },
} }
case storepb.UserSetting_WEBHOOKS: case storepb.UserSetting_WEBHOOKS:
setting.Value = &v1pb.UserSetting_WebhooksSetting_{ setting.Value = &v1pb.UserSetting_WebhooksSetting_{
WebhooksSetting: &v1pb.UserSetting_WebhooksSetting{ WebhooksSetting: &v1pb.UserSetting_WebhooksSetting{
Webhooks: []*v1pb.UserSetting_WebhooksSetting_Webhook{}, Webhooks: []*v1pb.UserWebhook{},
}, },
} }
} }
@ -1165,13 +1157,14 @@ func convertUserSettingFromStore(storeSetting *storepb.UserSetting, userID int32
} }
case storepb.UserSetting_SESSIONS: case storepb.UserSetting_SESSIONS:
sessions := storeSetting.GetSessions() sessions := storeSetting.GetSessions()
apiSessions := make([]*v1pb.UserSetting_SessionsSetting_Session, 0, len(sessions.Sessions)) apiSessions := make([]*v1pb.UserSession, 0, len(sessions.Sessions))
for _, session := range sessions.Sessions { for _, session := range sessions.Sessions {
apiSession := &v1pb.UserSetting_SessionsSetting_Session{ apiSession := &v1pb.UserSession{
Name: fmt.Sprintf("users/%d/sessions/%s", userID, session.SessionId),
SessionId: session.SessionId, SessionId: session.SessionId,
CreateTime: session.CreateTime, CreateTime: session.CreateTime,
LastAccessedTime: session.LastAccessedTime, LastAccessedTime: session.LastAccessedTime,
ClientInfo: &v1pb.UserSetting_SessionsSetting_ClientInfo{ ClientInfo: &v1pb.UserSession_ClientInfo{
UserAgent: session.ClientInfo.UserAgent, UserAgent: session.ClientInfo.UserAgent,
IpAddress: session.ClientInfo.IpAddress, IpAddress: session.ClientInfo.IpAddress,
DeviceType: session.ClientInfo.DeviceType, DeviceType: session.ClientInfo.DeviceType,
@ -1188,9 +1181,10 @@ func convertUserSettingFromStore(storeSetting *storepb.UserSetting, userID int32
} }
case storepb.UserSetting_ACCESS_TOKENS: case storepb.UserSetting_ACCESS_TOKENS:
accessTokens := storeSetting.GetAccessTokens() accessTokens := storeSetting.GetAccessTokens()
apiTokens := make([]*v1pb.UserSetting_AccessTokensSetting_AccessToken, 0, len(accessTokens.AccessTokens)) apiTokens := make([]*v1pb.UserAccessToken, 0, len(accessTokens.AccessTokens))
for _, token := range accessTokens.AccessTokens { for _, token := range accessTokens.AccessTokens {
apiToken := &v1pb.UserSetting_AccessTokensSetting_AccessToken{ apiToken := &v1pb.UserAccessToken{
Name: fmt.Sprintf("users/%d/accessTokens/%s", userID, token.AccessToken),
AccessToken: token.AccessToken, AccessToken: token.AccessToken,
Description: token.Description, Description: token.Description,
} }
@ -1201,30 +1195,14 @@ func convertUserSettingFromStore(storeSetting *storepb.UserSetting, userID int32
AccessTokens: apiTokens, AccessTokens: apiTokens,
}, },
} }
case storepb.UserSetting_SHORTCUTS:
shortcuts := storeSetting.GetShortcuts()
apiShortcuts := make([]*v1pb.UserSetting_ShortcutsSetting_Shortcut, 0, len(shortcuts.Shortcuts))
for _, shortcut := range shortcuts.Shortcuts {
apiShortcut := &v1pb.UserSetting_ShortcutsSetting_Shortcut{
Id: shortcut.Id,
Title: shortcut.Title,
Filter: shortcut.Filter,
}
apiShortcuts = append(apiShortcuts, apiShortcut)
}
setting.Value = &v1pb.UserSetting_ShortcutsSetting_{
ShortcutsSetting: &v1pb.UserSetting_ShortcutsSetting{
Shortcuts: apiShortcuts,
},
}
case storepb.UserSetting_WEBHOOKS: case storepb.UserSetting_WEBHOOKS:
webhooks := storeSetting.GetWebhooks() webhooks := storeSetting.GetWebhooks()
apiWebhooks := make([]*v1pb.UserSetting_WebhooksSetting_Webhook, 0, len(webhooks.Webhooks)) apiWebhooks := make([]*v1pb.UserWebhook, 0, len(webhooks.Webhooks))
for _, webhook := range webhooks.Webhooks { for _, webhook := range webhooks.Webhooks {
apiWebhook := &v1pb.UserSetting_WebhooksSetting_Webhook{ apiWebhook := &v1pb.UserWebhook{
Id: webhook.Id, Name: fmt.Sprintf("users/%d/webhooks/%s", userID, webhook.Id),
Title: webhook.Title,
Url: webhook.Url, Url: webhook.Url,
DisplayName: webhook.Title,
} }
apiWebhooks = append(apiWebhooks, apiWebhook) apiWebhooks = append(apiWebhooks, apiWebhook)
} }
@ -1303,32 +1281,13 @@ func convertUserSettingToStore(apiSetting *v1pb.UserSetting, userID int32, key s
} else { } else {
return nil, errors.Errorf("access tokens setting is required") return nil, errors.Errorf("access tokens setting is required")
} }
case storepb.UserSetting_SHORTCUTS:
if shortcuts := apiSetting.GetShortcutsSetting(); shortcuts != nil {
storeShortcuts := make([]*storepb.ShortcutsUserSetting_Shortcut, 0, len(shortcuts.Shortcuts))
for _, shortcut := range shortcuts.Shortcuts {
storeShortcut := &storepb.ShortcutsUserSetting_Shortcut{
Id: shortcut.Id,
Title: shortcut.Title,
Filter: shortcut.Filter,
}
storeShortcuts = append(storeShortcuts, storeShortcut)
}
storeSetting.Value = &storepb.UserSetting_Shortcuts{
Shortcuts: &storepb.ShortcutsUserSetting{
Shortcuts: storeShortcuts,
},
}
} else {
return nil, errors.Errorf("shortcuts setting is required")
}
case storepb.UserSetting_WEBHOOKS: case storepb.UserSetting_WEBHOOKS:
if webhooks := apiSetting.GetWebhooksSetting(); webhooks != nil { if webhooks := apiSetting.GetWebhooksSetting(); webhooks != nil {
storeWebhooks := make([]*storepb.WebhooksUserSetting_Webhook, 0, len(webhooks.Webhooks)) storeWebhooks := make([]*storepb.WebhooksUserSetting_Webhook, 0, len(webhooks.Webhooks))
for _, webhook := range webhooks.Webhooks { for _, webhook := range webhooks.Webhooks {
storeWebhook := &storepb.WebhooksUserSetting_Webhook{ storeWebhook := &storepb.WebhooksUserSetting_Webhook{
Id: webhook.Id, Id: extractWebhookIDFromName(webhook.Name),
Title: webhook.Title, Title: webhook.DisplayName,
Url: webhook.Url, Url: webhook.Url,
} }
storeWebhooks = append(storeWebhooks, storeWebhook) storeWebhooks = append(storeWebhooks, storeWebhook)
@ -1347,3 +1306,13 @@ func convertUserSettingToStore(apiSetting *v1pb.UserSetting, userID int32, key s
return storeSetting, nil return storeSetting, nil
} }
// extractWebhookIDFromName extracts webhook ID from resource name.
// e.g., "users/123/webhooks/webhook-id" -> "webhook-id".
func extractWebhookIDFromName(name string) string {
parts := strings.Split(name, "/")
if len(parts) >= 4 && parts[0] == "users" && parts[2] == "webhooks" {
return parts[3]
}
return ""
}

@ -6,10 +6,10 @@ import { Shortcut } from "@/types/proto/api/v1/shortcut_service";
import { import {
User, User,
UserSetting, UserSetting,
UserSetting_Key,
UserSetting_GeneralSetting, UserSetting_GeneralSetting,
UserSetting_SessionsSetting, UserSetting_SessionsSetting,
UserSetting_AccessTokensSetting, UserSetting_AccessTokensSetting,
UserSetting_ShortcutsSetting,
UserSetting_WebhooksSetting, UserSetting_WebhooksSetting,
UserStats, UserStats,
} from "@/types/proto/api/v1/user_service"; } from "@/types/proto/api/v1/user_service";
@ -21,7 +21,6 @@ class LocalState {
userGeneralSetting?: UserSetting_GeneralSetting; userGeneralSetting?: UserSetting_GeneralSetting;
userSessionsSetting?: UserSetting_SessionsSetting; userSessionsSetting?: UserSetting_SessionsSetting;
userAccessTokensSetting?: UserSetting_AccessTokensSetting; userAccessTokensSetting?: UserSetting_AccessTokensSetting;
userShortcutsSetting?: UserSetting_ShortcutsSetting;
userWebhooksSetting?: UserSetting_WebhooksSetting; userWebhooksSetting?: UserSetting_WebhooksSetting;
shortcuts: Shortcut[] = []; shortcuts: Shortcut[] = [];
inboxes: Inbox[] = []; inboxes: Inbox[] = [];
@ -145,7 +144,7 @@ const userStore = (() => {
throw new Error("No current user"); throw new Error("No current user");
} }
const settingName = `${state.currentUser}/settings/general`; const settingName = `${state.currentUser}/settings/${UserSetting_Key.GENERAL}`;
const userSetting: UserSetting = { const userSetting: UserSetting = {
name: settingName, name: settingName,
generalSetting: generalSetting as UserSetting_GeneralSetting, generalSetting: generalSetting as UserSetting_GeneralSetting,
@ -166,7 +165,7 @@ const userStore = (() => {
throw new Error("No current user"); throw new Error("No current user");
} }
const settingName = `${state.currentUser}/settings/general`; const settingName = `${state.currentUser}/settings/${UserSetting_Key.GENERAL}`;
const userSetting = await userServiceClient.getUserSetting({ name: settingName }); const userSetting = await userServiceClient.getUserSetting({ name: settingName });
state.setPartial({ state.setPartial({
@ -187,24 +186,13 @@ const userStore = (() => {
const generalSetting = settings.find((s) => s.generalSetting)?.generalSetting; const generalSetting = settings.find((s) => s.generalSetting)?.generalSetting;
const sessionsSetting = settings.find((s) => s.sessionsSetting)?.sessionsSetting; const sessionsSetting = settings.find((s) => s.sessionsSetting)?.sessionsSetting;
const accessTokensSetting = settings.find((s) => s.accessTokensSetting)?.accessTokensSetting; const accessTokensSetting = settings.find((s) => s.accessTokensSetting)?.accessTokensSetting;
const shortcutsSetting = settings.find((s) => s.shortcutsSetting)?.shortcutsSetting;
const webhooksSetting = settings.find((s) => s.webhooksSetting)?.webhooksSetting; const webhooksSetting = settings.find((s) => s.webhooksSetting)?.webhooksSetting;
// Convert user setting shortcuts to proper Shortcut format
const shortcuts: Shortcut[] =
shortcutsSetting?.shortcuts.map((shortcut) => ({
name: `${state.currentUser}/shortcuts/${shortcut.id}`,
title: shortcut.title,
filter: shortcut.filter,
})) || [];
state.setPartial({ state.setPartial({
userGeneralSetting: generalSetting, userGeneralSetting: generalSetting,
userSessionsSetting: sessionsSetting, userSessionsSetting: sessionsSetting,
userAccessTokensSetting: accessTokensSetting, userAccessTokensSetting: accessTokensSetting,
userShortcutsSetting: shortcutsSetting,
userWebhooksSetting: webhooksSetting, userWebhooksSetting: webhooksSetting,
shortcuts,
}); });
}; };

@ -272,13 +272,13 @@ export interface ListAllUserStatsResponse {
export interface UserSetting { export interface UserSetting {
/** /**
* The name of the user setting. * The name of the user setting.
* Format: users/{user}/settings/{setting} * Format: users/{user}/settings/{setting}, {setting} is the key for the setting.
* For example, "users/123/settings/GENERAL" for general settings.
*/ */
name: string; name: string;
generalSetting?: UserSetting_GeneralSetting | undefined; generalSetting?: UserSetting_GeneralSetting | undefined;
sessionsSetting?: UserSetting_SessionsSetting | undefined; sessionsSetting?: UserSetting_SessionsSetting | undefined;
accessTokensSetting?: UserSetting_AccessTokensSetting | undefined; accessTokensSetting?: UserSetting_AccessTokensSetting | undefined;
shortcutsSetting?: UserSetting_ShortcutsSetting | undefined;
webhooksSetting?: UserSetting_WebhooksSetting | undefined; webhooksSetting?: UserSetting_WebhooksSetting | undefined;
} }
@ -291,8 +291,6 @@ export enum UserSetting_Key {
SESSIONS = "SESSIONS", SESSIONS = "SESSIONS",
/** ACCESS_TOKENS - ACCESS_TOKENS is the key for access tokens. */ /** ACCESS_TOKENS - ACCESS_TOKENS is the key for access tokens. */
ACCESS_TOKENS = "ACCESS_TOKENS", ACCESS_TOKENS = "ACCESS_TOKENS",
/** SHORTCUTS - SHORTCUTS is the key for user shortcuts. */
SHORTCUTS = "SHORTCUTS",
/** WEBHOOKS - WEBHOOKS is the key for user webhooks. */ /** WEBHOOKS - WEBHOOKS is the key for user webhooks. */
WEBHOOKS = "WEBHOOKS", WEBHOOKS = "WEBHOOKS",
UNRECOGNIZED = "UNRECOGNIZED", UNRECOGNIZED = "UNRECOGNIZED",
@ -313,9 +311,6 @@ export function userSetting_KeyFromJSON(object: any): UserSetting_Key {
case "ACCESS_TOKENS": case "ACCESS_TOKENS":
return UserSetting_Key.ACCESS_TOKENS; return UserSetting_Key.ACCESS_TOKENS;
case 4: case 4:
case "SHORTCUTS":
return UserSetting_Key.SHORTCUTS;
case 5:
case "WEBHOOKS": case "WEBHOOKS":
return UserSetting_Key.WEBHOOKS; return UserSetting_Key.WEBHOOKS;
case -1: case -1:
@ -335,10 +330,8 @@ export function userSetting_KeyToNumber(object: UserSetting_Key): number {
return 2; return 2;
case UserSetting_Key.ACCESS_TOKENS: case UserSetting_Key.ACCESS_TOKENS:
return 3; return 3;
case UserSetting_Key.SHORTCUTS:
return 4;
case UserSetting_Key.WEBHOOKS: case UserSetting_Key.WEBHOOKS:
return 5; return 4;
case UserSetting_Key.UNRECOGNIZED: case UserSetting_Key.UNRECOGNIZED:
default: default:
return -1; return -1;
@ -364,89 +357,19 @@ export interface UserSetting_GeneralSetting {
/** User authentication sessions configuration. */ /** User authentication sessions configuration. */
export interface UserSetting_SessionsSetting { export interface UserSetting_SessionsSetting {
/** List of active user sessions. */ /** List of active user sessions. */
sessions: UserSetting_SessionsSetting_Session[]; sessions: UserSession[];
}
/** User session information. */
export interface UserSetting_SessionsSetting_Session {
/** Unique session identifier. */
sessionId: string;
/** Timestamp when the session was created. */
createTime?:
| Date
| undefined;
/**
* Timestamp when the session was last accessed.
* Used for sliding expiration calculation (last_accessed_time + 2 weeks).
*/
lastAccessedTime?:
| Date
| undefined;
/** Client information associated with this session. */
clientInfo?: UserSetting_SessionsSetting_ClientInfo | undefined;
}
/** Client information for a session. */
export interface UserSetting_SessionsSetting_ClientInfo {
/** User agent string of the client. */
userAgent: string;
/** IP address of the client. */
ipAddress: string;
/** Optional. Device type (e.g., "mobile", "desktop", "tablet"). */
deviceType: string;
/** Optional. Operating system (e.g., "iOS 17.0", "Windows 11"). */
os: string;
/** Optional. Browser name and version (e.g., "Chrome 119.0"). */
browser: string;
} }
/** User access tokens configuration. */ /** User access tokens configuration. */
export interface UserSetting_AccessTokensSetting { export interface UserSetting_AccessTokensSetting {
/** List of user access tokens. */ /** List of user access tokens. */
accessTokens: UserSetting_AccessTokensSetting_AccessToken[]; accessTokens: UserAccessToken[];
}
/** User access token information. */
export interface UserSetting_AccessTokensSetting_AccessToken {
/**
* The access token is a JWT token.
* Including expiration time, issuer, etc.
*/
accessToken: string;
/** A description for the access token. */
description: string;
}
/** User shortcuts configuration. */
export interface UserSetting_ShortcutsSetting {
/** List of user shortcuts. */
shortcuts: UserSetting_ShortcutsSetting_Shortcut[];
}
/** User shortcut definition. */
export interface UserSetting_ShortcutsSetting_Shortcut {
/** Unique identifier for the shortcut. */
id: string;
/** Display title for the shortcut. */
title: string;
/** Filter expression for the shortcut. */
filter: string;
} }
/** User webhooks configuration. */ /** User webhooks configuration. */
export interface UserSetting_WebhooksSetting { export interface UserSetting_WebhooksSetting {
/** List of user webhooks. */ /** List of user webhooks. */
webhooks: UserSetting_WebhooksSetting_Webhook[]; webhooks: UserWebhook[];
}
/** User webhook definition. */
export interface UserSetting_WebhooksSetting_Webhook {
/** Unique identifier for the webhook. */
id: string;
/** Descriptive title for the webhook. */
title: string;
/** The webhook URL endpoint. */
url: string;
} }
export interface GetUserSettingRequest { export interface GetUserSettingRequest {
@ -1869,7 +1792,6 @@ function createBaseUserSetting(): UserSetting {
generalSetting: undefined, generalSetting: undefined,
sessionsSetting: undefined, sessionsSetting: undefined,
accessTokensSetting: undefined, accessTokensSetting: undefined,
shortcutsSetting: undefined,
webhooksSetting: undefined, webhooksSetting: undefined,
}; };
} }
@ -1888,11 +1810,8 @@ export const UserSetting: MessageFns<UserSetting> = {
if (message.accessTokensSetting !== undefined) { if (message.accessTokensSetting !== undefined) {
UserSetting_AccessTokensSetting.encode(message.accessTokensSetting, writer.uint32(34).fork()).join(); UserSetting_AccessTokensSetting.encode(message.accessTokensSetting, writer.uint32(34).fork()).join();
} }
if (message.shortcutsSetting !== undefined) {
UserSetting_ShortcutsSetting.encode(message.shortcutsSetting, writer.uint32(42).fork()).join();
}
if (message.webhooksSetting !== undefined) { if (message.webhooksSetting !== undefined) {
UserSetting_WebhooksSetting.encode(message.webhooksSetting, writer.uint32(50).fork()).join(); UserSetting_WebhooksSetting.encode(message.webhooksSetting, writer.uint32(42).fork()).join();
} }
return writer; return writer;
}, },
@ -1941,14 +1860,6 @@ export const UserSetting: MessageFns<UserSetting> = {
break; break;
} }
message.shortcutsSetting = UserSetting_ShortcutsSetting.decode(reader, reader.uint32());
continue;
}
case 6: {
if (tag !== 50) {
break;
}
message.webhooksSetting = UserSetting_WebhooksSetting.decode(reader, reader.uint32()); message.webhooksSetting = UserSetting_WebhooksSetting.decode(reader, reader.uint32());
continue; continue;
} }
@ -1976,9 +1887,6 @@ export const UserSetting: MessageFns<UserSetting> = {
message.accessTokensSetting = (object.accessTokensSetting !== undefined && object.accessTokensSetting !== null) message.accessTokensSetting = (object.accessTokensSetting !== undefined && object.accessTokensSetting !== null)
? UserSetting_AccessTokensSetting.fromPartial(object.accessTokensSetting) ? UserSetting_AccessTokensSetting.fromPartial(object.accessTokensSetting)
: undefined; : undefined;
message.shortcutsSetting = (object.shortcutsSetting !== undefined && object.shortcutsSetting !== null)
? UserSetting_ShortcutsSetting.fromPartial(object.shortcutsSetting)
: undefined;
message.webhooksSetting = (object.webhooksSetting !== undefined && object.webhooksSetting !== null) message.webhooksSetting = (object.webhooksSetting !== undefined && object.webhooksSetting !== null)
? UserSetting_WebhooksSetting.fromPartial(object.webhooksSetting) ? UserSetting_WebhooksSetting.fromPartial(object.webhooksSetting)
: undefined; : undefined;
@ -2075,7 +1983,7 @@ function createBaseUserSetting_SessionsSetting(): UserSetting_SessionsSetting {
export const UserSetting_SessionsSetting: MessageFns<UserSetting_SessionsSetting> = { export const UserSetting_SessionsSetting: MessageFns<UserSetting_SessionsSetting> = {
encode(message: UserSetting_SessionsSetting, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { encode(message: UserSetting_SessionsSetting, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
for (const v of message.sessions) { for (const v of message.sessions) {
UserSetting_SessionsSetting_Session.encode(v!, writer.uint32(10).fork()).join(); UserSession.encode(v!, writer.uint32(10).fork()).join();
} }
return writer; return writer;
}, },
@ -2092,7 +2000,7 @@ export const UserSetting_SessionsSetting: MessageFns<UserSetting_SessionsSetting
break; break;
} }
message.sessions.push(UserSetting_SessionsSetting_Session.decode(reader, reader.uint32())); message.sessions.push(UserSession.decode(reader, reader.uint32()));
continue; continue;
} }
} }
@ -2109,185 +2017,7 @@ export const UserSetting_SessionsSetting: MessageFns<UserSetting_SessionsSetting
}, },
fromPartial(object: DeepPartial<UserSetting_SessionsSetting>): UserSetting_SessionsSetting { fromPartial(object: DeepPartial<UserSetting_SessionsSetting>): UserSetting_SessionsSetting {
const message = createBaseUserSetting_SessionsSetting(); const message = createBaseUserSetting_SessionsSetting();
message.sessions = object.sessions?.map((e) => UserSetting_SessionsSetting_Session.fromPartial(e)) || []; message.sessions = object.sessions?.map((e) => UserSession.fromPartial(e)) || [];
return message;
},
};
function createBaseUserSetting_SessionsSetting_Session(): UserSetting_SessionsSetting_Session {
return { sessionId: "", createTime: undefined, lastAccessedTime: undefined, clientInfo: undefined };
}
export const UserSetting_SessionsSetting_Session: MessageFns<UserSetting_SessionsSetting_Session> = {
encode(message: UserSetting_SessionsSetting_Session, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.sessionId !== "") {
writer.uint32(10).string(message.sessionId);
}
if (message.createTime !== undefined) {
Timestamp.encode(toTimestamp(message.createTime), writer.uint32(18).fork()).join();
}
if (message.lastAccessedTime !== undefined) {
Timestamp.encode(toTimestamp(message.lastAccessedTime), writer.uint32(26).fork()).join();
}
if (message.clientInfo !== undefined) {
UserSetting_SessionsSetting_ClientInfo.encode(message.clientInfo, writer.uint32(34).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): UserSetting_SessionsSetting_Session {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseUserSetting_SessionsSetting_Session();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.sessionId = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.createTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.lastAccessedTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.clientInfo = UserSetting_SessionsSetting_ClientInfo.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<UserSetting_SessionsSetting_Session>): UserSetting_SessionsSetting_Session {
return UserSetting_SessionsSetting_Session.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<UserSetting_SessionsSetting_Session>): UserSetting_SessionsSetting_Session {
const message = createBaseUserSetting_SessionsSetting_Session();
message.sessionId = object.sessionId ?? "";
message.createTime = object.createTime ?? undefined;
message.lastAccessedTime = object.lastAccessedTime ?? undefined;
message.clientInfo = (object.clientInfo !== undefined && object.clientInfo !== null)
? UserSetting_SessionsSetting_ClientInfo.fromPartial(object.clientInfo)
: undefined;
return message;
},
};
function createBaseUserSetting_SessionsSetting_ClientInfo(): UserSetting_SessionsSetting_ClientInfo {
return { userAgent: "", ipAddress: "", deviceType: "", os: "", browser: "" };
}
export const UserSetting_SessionsSetting_ClientInfo: MessageFns<UserSetting_SessionsSetting_ClientInfo> = {
encode(message: UserSetting_SessionsSetting_ClientInfo, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.userAgent !== "") {
writer.uint32(10).string(message.userAgent);
}
if (message.ipAddress !== "") {
writer.uint32(18).string(message.ipAddress);
}
if (message.deviceType !== "") {
writer.uint32(26).string(message.deviceType);
}
if (message.os !== "") {
writer.uint32(34).string(message.os);
}
if (message.browser !== "") {
writer.uint32(42).string(message.browser);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): UserSetting_SessionsSetting_ClientInfo {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseUserSetting_SessionsSetting_ClientInfo();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.userAgent = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.ipAddress = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.deviceType = reader.string();
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.os = reader.string();
continue;
}
case 5: {
if (tag !== 42) {
break;
}
message.browser = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<UserSetting_SessionsSetting_ClientInfo>): UserSetting_SessionsSetting_ClientInfo {
return UserSetting_SessionsSetting_ClientInfo.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<UserSetting_SessionsSetting_ClientInfo>): UserSetting_SessionsSetting_ClientInfo {
const message = createBaseUserSetting_SessionsSetting_ClientInfo();
message.userAgent = object.userAgent ?? "";
message.ipAddress = object.ipAddress ?? "";
message.deviceType = object.deviceType ?? "";
message.os = object.os ?? "";
message.browser = object.browser ?? "";
return message; return message;
}, },
}; };
@ -2299,7 +2029,7 @@ function createBaseUserSetting_AccessTokensSetting(): UserSetting_AccessTokensSe
export const UserSetting_AccessTokensSetting: MessageFns<UserSetting_AccessTokensSetting> = { export const UserSetting_AccessTokensSetting: MessageFns<UserSetting_AccessTokensSetting> = {
encode(message: UserSetting_AccessTokensSetting, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { encode(message: UserSetting_AccessTokensSetting, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
for (const v of message.accessTokens) { for (const v of message.accessTokens) {
UserSetting_AccessTokensSetting_AccessToken.encode(v!, writer.uint32(10).fork()).join(); UserAccessToken.encode(v!, writer.uint32(10).fork()).join();
} }
return writer; return writer;
}, },
@ -2316,7 +2046,7 @@ export const UserSetting_AccessTokensSetting: MessageFns<UserSetting_AccessToken
break; break;
} }
message.accessTokens.push(UserSetting_AccessTokensSetting_AccessToken.decode(reader, reader.uint32())); message.accessTokens.push(UserAccessToken.decode(reader, reader.uint32()));
continue; continue;
} }
} }
@ -2333,187 +2063,7 @@ export const UserSetting_AccessTokensSetting: MessageFns<UserSetting_AccessToken
}, },
fromPartial(object: DeepPartial<UserSetting_AccessTokensSetting>): UserSetting_AccessTokensSetting { fromPartial(object: DeepPartial<UserSetting_AccessTokensSetting>): UserSetting_AccessTokensSetting {
const message = createBaseUserSetting_AccessTokensSetting(); const message = createBaseUserSetting_AccessTokensSetting();
message.accessTokens = message.accessTokens = object.accessTokens?.map((e) => UserAccessToken.fromPartial(e)) || [];
object.accessTokens?.map((e) => UserSetting_AccessTokensSetting_AccessToken.fromPartial(e)) || [];
return message;
},
};
function createBaseUserSetting_AccessTokensSetting_AccessToken(): UserSetting_AccessTokensSetting_AccessToken {
return { accessToken: "", description: "" };
}
export const UserSetting_AccessTokensSetting_AccessToken: MessageFns<UserSetting_AccessTokensSetting_AccessToken> = {
encode(
message: UserSetting_AccessTokensSetting_AccessToken,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.accessToken !== "") {
writer.uint32(10).string(message.accessToken);
}
if (message.description !== "") {
writer.uint32(18).string(message.description);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): UserSetting_AccessTokensSetting_AccessToken {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseUserSetting_AccessTokensSetting_AccessToken();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.accessToken = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.description = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<UserSetting_AccessTokensSetting_AccessToken>): UserSetting_AccessTokensSetting_AccessToken {
return UserSetting_AccessTokensSetting_AccessToken.fromPartial(base ?? {});
},
fromPartial(
object: DeepPartial<UserSetting_AccessTokensSetting_AccessToken>,
): UserSetting_AccessTokensSetting_AccessToken {
const message = createBaseUserSetting_AccessTokensSetting_AccessToken();
message.accessToken = object.accessToken ?? "";
message.description = object.description ?? "";
return message;
},
};
function createBaseUserSetting_ShortcutsSetting(): UserSetting_ShortcutsSetting {
return { shortcuts: [] };
}
export const UserSetting_ShortcutsSetting: MessageFns<UserSetting_ShortcutsSetting> = {
encode(message: UserSetting_ShortcutsSetting, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
for (const v of message.shortcuts) {
UserSetting_ShortcutsSetting_Shortcut.encode(v!, writer.uint32(10).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): UserSetting_ShortcutsSetting {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseUserSetting_ShortcutsSetting();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.shortcuts.push(UserSetting_ShortcutsSetting_Shortcut.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<UserSetting_ShortcutsSetting>): UserSetting_ShortcutsSetting {
return UserSetting_ShortcutsSetting.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<UserSetting_ShortcutsSetting>): UserSetting_ShortcutsSetting {
const message = createBaseUserSetting_ShortcutsSetting();
message.shortcuts = object.shortcuts?.map((e) => UserSetting_ShortcutsSetting_Shortcut.fromPartial(e)) || [];
return message;
},
};
function createBaseUserSetting_ShortcutsSetting_Shortcut(): UserSetting_ShortcutsSetting_Shortcut {
return { id: "", title: "", filter: "" };
}
export const UserSetting_ShortcutsSetting_Shortcut: MessageFns<UserSetting_ShortcutsSetting_Shortcut> = {
encode(message: UserSetting_ShortcutsSetting_Shortcut, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.id !== "") {
writer.uint32(10).string(message.id);
}
if (message.title !== "") {
writer.uint32(18).string(message.title);
}
if (message.filter !== "") {
writer.uint32(26).string(message.filter);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): UserSetting_ShortcutsSetting_Shortcut {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseUserSetting_ShortcutsSetting_Shortcut();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.id = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.title = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.filter = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<UserSetting_ShortcutsSetting_Shortcut>): UserSetting_ShortcutsSetting_Shortcut {
return UserSetting_ShortcutsSetting_Shortcut.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<UserSetting_ShortcutsSetting_Shortcut>): UserSetting_ShortcutsSetting_Shortcut {
const message = createBaseUserSetting_ShortcutsSetting_Shortcut();
message.id = object.id ?? "";
message.title = object.title ?? "";
message.filter = object.filter ?? "";
return message; return message;
}, },
}; };
@ -2525,7 +2075,7 @@ function createBaseUserSetting_WebhooksSetting(): UserSetting_WebhooksSetting {
export const UserSetting_WebhooksSetting: MessageFns<UserSetting_WebhooksSetting> = { export const UserSetting_WebhooksSetting: MessageFns<UserSetting_WebhooksSetting> = {
encode(message: UserSetting_WebhooksSetting, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { encode(message: UserSetting_WebhooksSetting, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
for (const v of message.webhooks) { for (const v of message.webhooks) {
UserSetting_WebhooksSetting_Webhook.encode(v!, writer.uint32(10).fork()).join(); UserWebhook.encode(v!, writer.uint32(10).fork()).join();
} }
return writer; return writer;
}, },
@ -2542,7 +2092,7 @@ export const UserSetting_WebhooksSetting: MessageFns<UserSetting_WebhooksSetting
break; break;
} }
message.webhooks.push(UserSetting_WebhooksSetting_Webhook.decode(reader, reader.uint32())); message.webhooks.push(UserWebhook.decode(reader, reader.uint32()));
continue; continue;
} }
} }
@ -2559,77 +2109,7 @@ export const UserSetting_WebhooksSetting: MessageFns<UserSetting_WebhooksSetting
}, },
fromPartial(object: DeepPartial<UserSetting_WebhooksSetting>): UserSetting_WebhooksSetting { fromPartial(object: DeepPartial<UserSetting_WebhooksSetting>): UserSetting_WebhooksSetting {
const message = createBaseUserSetting_WebhooksSetting(); const message = createBaseUserSetting_WebhooksSetting();
message.webhooks = object.webhooks?.map((e) => UserSetting_WebhooksSetting_Webhook.fromPartial(e)) || []; message.webhooks = object.webhooks?.map((e) => UserWebhook.fromPartial(e)) || [];
return message;
},
};
function createBaseUserSetting_WebhooksSetting_Webhook(): UserSetting_WebhooksSetting_Webhook {
return { id: "", title: "", url: "" };
}
export const UserSetting_WebhooksSetting_Webhook: MessageFns<UserSetting_WebhooksSetting_Webhook> = {
encode(message: UserSetting_WebhooksSetting_Webhook, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.id !== "") {
writer.uint32(10).string(message.id);
}
if (message.title !== "") {
writer.uint32(18).string(message.title);
}
if (message.url !== "") {
writer.uint32(26).string(message.url);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): UserSetting_WebhooksSetting_Webhook {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseUserSetting_WebhooksSetting_Webhook();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.id = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.title = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.url = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<UserSetting_WebhooksSetting_Webhook>): UserSetting_WebhooksSetting_Webhook {
return UserSetting_WebhooksSetting_Webhook.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<UserSetting_WebhooksSetting_Webhook>): UserSetting_WebhooksSetting_Webhook {
const message = createBaseUserSetting_WebhooksSetting_Webhook();
message.id = object.id ?? "";
message.title = object.title ?? "";
message.url = object.url ?? "";
return message; return message;
}, },
}; };

@ -35,7 +35,7 @@ export enum Edition {
EDITION_2024 = "EDITION_2024", EDITION_2024 = "EDITION_2024",
/** /**
* EDITION_1_TEST_ONLY - Placeholder editions for testing feature resolution. These should not be * EDITION_1_TEST_ONLY - Placeholder editions for testing feature resolution. These should not be
* used or relyed on outside of tests. * used or relied on outside of tests.
*/ */
EDITION_1_TEST_ONLY = "EDITION_1_TEST_ONLY", EDITION_1_TEST_ONLY = "EDITION_1_TEST_ONLY",
EDITION_2_TEST_ONLY = "EDITION_2_TEST_ONLY", EDITION_2_TEST_ONLY = "EDITION_2_TEST_ONLY",
@ -177,11 +177,19 @@ export interface FileDescriptorProto {
* The supported values are "proto2", "proto3", and "editions". * The supported values are "proto2", "proto3", and "editions".
* *
* If `edition` is present, this value must be "editions". * If `edition` is present, this value must be "editions".
* WARNING: This field should only be used by protobuf plugins or special
* cases like the proto compiler. Other uses are discouraged and
* developers should rely on the protoreflect APIs for their client language.
*/ */
syntax?: syntax?:
| string | string
| undefined; | undefined;
/** The edition of the proto file. */ /**
* The edition of the proto file.
* WARNING: This field should only be used by protobuf plugins or special
* cases like the proto compiler. Other uses are discouraged and
* developers should rely on the protoreflect APIs for their client language.
*/
edition?: Edition | undefined; edition?: Edition | undefined;
} }
@ -828,7 +836,12 @@ export interface FileOptions {
rubyPackage?: rubyPackage?:
| string | string
| undefined; | undefined;
/** Any features defined in the specific edition. */ /**
* Any features defined in the specific edition.
* WARNING: This field should only be used by protobuf plugins or special
* cases like the proto compiler. Other uses are discouraged and
* developers should rely on the protoreflect APIs for their client language.
*/
features?: features?:
| FeatureSet | FeatureSet
| undefined; | undefined;
@ -966,7 +979,12 @@ export interface MessageOptions {
deprecatedLegacyJsonFieldConflicts?: deprecatedLegacyJsonFieldConflicts?:
| boolean | boolean
| undefined; | undefined;
/** Any features defined in the specific edition. */ /**
* Any features defined in the specific edition.
* WARNING: This field should only be used by protobuf plugins or special
* cases like the proto compiler. Other uses are discouraged and
* developers should rely on the protoreflect APIs for their client language.
*/
features?: features?:
| FeatureSet | FeatureSet
| undefined; | undefined;
@ -976,12 +994,13 @@ export interface MessageOptions {
export interface FieldOptions { export interface FieldOptions {
/** /**
* NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead.
* The ctype option instructs the C++ code generator to use a different * The ctype option instructs the C++ code generator to use a different
* representation of the field than it normally would. See the specific * representation of the field than it normally would. See the specific
* options below. This option is only implemented to support use of * options below. This option is only implemented to support use of
* [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of * [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of
* type "bytes" in the open source release -- sorry, we'll try to include * type "bytes" in the open source release.
* other types in a future version! * TODO: make ctype actually deprecated.
*/ */
ctype?: ctype?:
| FieldOptions_CType | FieldOptions_CType
@ -1070,7 +1089,12 @@ export interface FieldOptions {
retention?: FieldOptions_OptionRetention | undefined; retention?: FieldOptions_OptionRetention | undefined;
targets: FieldOptions_OptionTargetType[]; targets: FieldOptions_OptionTargetType[];
editionDefaults: FieldOptions_EditionDefault[]; editionDefaults: FieldOptions_EditionDefault[];
/** Any features defined in the specific edition. */ /**
* Any features defined in the specific edition.
* WARNING: This field should only be used by protobuf plugins or special
* cases like the proto compiler. Other uses are discouraged and
* developers should rely on the protoreflect APIs for their client language.
*/
features?: FeatureSet | undefined; features?: FeatureSet | undefined;
featureSupport?: featureSupport?:
| FieldOptions_FeatureSupport | FieldOptions_FeatureSupport
@ -1169,11 +1193,7 @@ export function fieldOptions_JSTypeToNumber(object: FieldOptions_JSType): number
} }
} }
/** /** If set to RETENTION_SOURCE, the option will be omitted from the binary. */
* If set to RETENTION_SOURCE, the option will be omitted from the binary.
* Note: as of January 2023, support for this is in progress and does not yet
* have an effect (b/264593489).
*/
export enum FieldOptions_OptionRetention { export enum FieldOptions_OptionRetention {
RETENTION_UNKNOWN = "RETENTION_UNKNOWN", RETENTION_UNKNOWN = "RETENTION_UNKNOWN",
RETENTION_RUNTIME = "RETENTION_RUNTIME", RETENTION_RUNTIME = "RETENTION_RUNTIME",
@ -1216,8 +1236,7 @@ export function fieldOptions_OptionRetentionToNumber(object: FieldOptions_Option
/** /**
* This indicates the types of entities that the field may apply to when used * This indicates the types of entities that the field may apply to when used
* as an option. If it is unset, then the field may be freely used as an * as an option. If it is unset, then the field may be freely used as an
* option on any kind of entity. Note: as of January 2023, support for this is * option on any kind of entity.
* in progress and does not yet have an effect (b/264593489).
*/ */
export enum FieldOptions_OptionTargetType { export enum FieldOptions_OptionTargetType {
TARGET_TYPE_UNKNOWN = "TARGET_TYPE_UNKNOWN", TARGET_TYPE_UNKNOWN = "TARGET_TYPE_UNKNOWN",
@ -1341,7 +1360,12 @@ export interface FieldOptions_FeatureSupport {
} }
export interface OneofOptions { export interface OneofOptions {
/** Any features defined in the specific edition. */ /**
* Any features defined in the specific edition.
* WARNING: This field should only be used by protobuf plugins or special
* cases like the proto compiler. Other uses are discouraged and
* developers should rely on the protoreflect APIs for their client language.
*/
features?: features?:
| FeatureSet | FeatureSet
| undefined; | undefined;
@ -1379,7 +1403,12 @@ export interface EnumOptions {
deprecatedLegacyJsonFieldConflicts?: deprecatedLegacyJsonFieldConflicts?:
| boolean | boolean
| undefined; | undefined;
/** Any features defined in the specific edition. */ /**
* Any features defined in the specific edition.
* WARNING: This field should only be used by protobuf plugins or special
* cases like the proto compiler. Other uses are discouraged and
* developers should rely on the protoreflect APIs for their client language.
*/
features?: features?:
| FeatureSet | FeatureSet
| undefined; | undefined;
@ -1397,7 +1426,12 @@ export interface EnumValueOptions {
deprecated?: deprecated?:
| boolean | boolean
| undefined; | undefined;
/** Any features defined in the specific edition. */ /**
* Any features defined in the specific edition.
* WARNING: This field should only be used by protobuf plugins or special
* cases like the proto compiler. Other uses are discouraged and
* developers should rely on the protoreflect APIs for their client language.
*/
features?: features?:
| FeatureSet | FeatureSet
| undefined; | undefined;
@ -1418,7 +1452,12 @@ export interface EnumValueOptions {
} }
export interface ServiceOptions { export interface ServiceOptions {
/** Any features defined in the specific edition. */ /**
* Any features defined in the specific edition.
* WARNING: This field should only be used by protobuf plugins or special
* cases like the proto compiler. Other uses are discouraged and
* developers should rely on the protoreflect APIs for their client language.
*/
features?: features?:
| FeatureSet | FeatureSet
| undefined; | undefined;
@ -1446,7 +1485,12 @@ export interface MethodOptions {
idempotencyLevel?: idempotencyLevel?:
| MethodOptions_IdempotencyLevel | MethodOptions_IdempotencyLevel
| undefined; | undefined;
/** Any features defined in the specific edition. */ /**
* Any features defined in the specific edition.
* WARNING: This field should only be used by protobuf plugins or special
* cases like the proto compiler. Other uses are discouraged and
* developers should rely on the protoreflect APIs for their client language.
*/
features?: features?:
| FeatureSet | FeatureSet
| undefined; | undefined;
@ -1549,6 +1593,7 @@ export interface FeatureSet {
utf8Validation?: FeatureSet_Utf8Validation | undefined; utf8Validation?: FeatureSet_Utf8Validation | undefined;
messageEncoding?: FeatureSet_MessageEncoding | undefined; messageEncoding?: FeatureSet_MessageEncoding | undefined;
jsonFormat?: FeatureSet_JsonFormat | undefined; jsonFormat?: FeatureSet_JsonFormat | undefined;
enforceNamingStyle?: FeatureSet_EnforceNamingStyle | undefined;
} }
export enum FeatureSet_FieldPresence { export enum FeatureSet_FieldPresence {
@ -1791,6 +1836,45 @@ export function featureSet_JsonFormatToNumber(object: FeatureSet_JsonFormat): nu
} }
} }
export enum FeatureSet_EnforceNamingStyle {
ENFORCE_NAMING_STYLE_UNKNOWN = "ENFORCE_NAMING_STYLE_UNKNOWN",
STYLE2024 = "STYLE2024",
STYLE_LEGACY = "STYLE_LEGACY",
UNRECOGNIZED = "UNRECOGNIZED",
}
export function featureSet_EnforceNamingStyleFromJSON(object: any): FeatureSet_EnforceNamingStyle {
switch (object) {
case 0:
case "ENFORCE_NAMING_STYLE_UNKNOWN":
return FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN;
case 1:
case "STYLE2024":
return FeatureSet_EnforceNamingStyle.STYLE2024;
case 2:
case "STYLE_LEGACY":
return FeatureSet_EnforceNamingStyle.STYLE_LEGACY;
case -1:
case "UNRECOGNIZED":
default:
return FeatureSet_EnforceNamingStyle.UNRECOGNIZED;
}
}
export function featureSet_EnforceNamingStyleToNumber(object: FeatureSet_EnforceNamingStyle): number {
switch (object) {
case FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN:
return 0;
case FeatureSet_EnforceNamingStyle.STYLE2024:
return 1;
case FeatureSet_EnforceNamingStyle.STYLE_LEGACY:
return 2;
case FeatureSet_EnforceNamingStyle.UNRECOGNIZED:
default:
return -1;
}
}
/** /**
* A compiled specification for the defaults of a set of features. These * A compiled specification for the defaults of a set of features. These
* messages are generated from FeatureSet extensions and can be used to seed * messages are generated from FeatureSet extensions and can be used to seed
@ -4914,6 +4998,7 @@ function createBaseFeatureSet(): FeatureSet {
utf8Validation: FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN, utf8Validation: FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN,
messageEncoding: FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN, messageEncoding: FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN,
jsonFormat: FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN, jsonFormat: FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN,
enforceNamingStyle: FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN,
}; };
} }
@ -4948,6 +5033,12 @@ export const FeatureSet: MessageFns<FeatureSet> = {
if (message.jsonFormat !== undefined && message.jsonFormat !== FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN) { if (message.jsonFormat !== undefined && message.jsonFormat !== FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN) {
writer.uint32(48).int32(featureSet_JsonFormatToNumber(message.jsonFormat)); writer.uint32(48).int32(featureSet_JsonFormatToNumber(message.jsonFormat));
} }
if (
message.enforceNamingStyle !== undefined &&
message.enforceNamingStyle !== FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN
) {
writer.uint32(56).int32(featureSet_EnforceNamingStyleToNumber(message.enforceNamingStyle));
}
return writer; return writer;
}, },
@ -5006,6 +5097,14 @@ export const FeatureSet: MessageFns<FeatureSet> = {
message.jsonFormat = featureSet_JsonFormatFromJSON(reader.int32()); message.jsonFormat = featureSet_JsonFormatFromJSON(reader.int32());
continue; continue;
} }
case 7: {
if (tag !== 56) {
break;
}
message.enforceNamingStyle = featureSet_EnforceNamingStyleFromJSON(reader.int32());
continue;
}
} }
if ((tag & 7) === 4 || tag === 0) { if ((tag & 7) === 4 || tag === 0) {
break; break;
@ -5027,6 +5126,8 @@ export const FeatureSet: MessageFns<FeatureSet> = {
message.utf8Validation = object.utf8Validation ?? FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN; message.utf8Validation = object.utf8Validation ?? FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN;
message.messageEncoding = object.messageEncoding ?? FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN; message.messageEncoding = object.messageEncoding ?? FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN;
message.jsonFormat = object.jsonFormat ?? FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN; message.jsonFormat = object.jsonFormat ?? FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN;
message.enforceNamingStyle = object.enforceNamingStyle ??
FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN;
return message; return message;
}, },
}; };

Loading…
Cancel
Save