update `protos` (#535)

* update `protos`

* c

* f
This commit is contained in:
Felicio Mununga 2024-03-18 21:30:38 +09:00 committed by GitHub
parent 148a953a7d
commit 02abf3417b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
25 changed files with 5242 additions and 117 deletions

View File

@ -0,0 +1,5 @@
---
'@status-im/js': minor
---
update `protos`

View File

@ -506,7 +506,7 @@ export class Chat {
payload: { payload: {
case: 'image', case: 'image',
value: { value: {
type: image.type, format: image.format,
payload: image.payload, payload: image.payload,
}, },
}, },

View File

@ -1,6 +1,7 @@
syntax = "proto3"; syntax = "proto3";
import "enums.proto"; import "enums.proto";
import "profile-showcase.proto";
// ChatIdentity represents the user defined identity associated with their public chat key // ChatIdentity represents the user defined identity associated with their public chat key
message ChatIdentity { message ChatIdentity {
@ -29,6 +30,8 @@ message ChatIdentity {
// 0 - unknown // 0 - unknown
// 1 - no messages // 1 - no messages
uint32 first_message_timestamp = 9; uint32 first_message_timestamp = 9;
ProfileShowcase profile_showcase = 10;
} }
// ProfileImage represents data associated with a user's profile image // ProfileImage represents data associated with a user's profile image
@ -41,8 +44,8 @@ message IdentityImage {
// source_type signals the image payload source // source_type signals the image payload source
SourceType source_type = 2; SourceType source_type = 2;
// image_type signals the image type and method of parsing the payload // image_format signals the image format and method of parsing the payload
ImageType image_type = 3; ImageFormat image_format = 3;
// encryption_keys is a list of encrypted keys that can be used to decrypted an encrypted payload // encryption_keys is a list of encrypted keys that can be used to decrypted an encrypted payload
repeated bytes encryption_keys = 4; repeated bytes encryption_keys = 4;

View File

@ -12,7 +12,8 @@ import type {
PlainMessage, PlainMessage,
} from '@bufbuild/protobuf' } from '@bufbuild/protobuf'
import { Message, proto3, protoInt64 } from '@bufbuild/protobuf' import { Message, proto3, protoInt64 } from '@bufbuild/protobuf'
import { ImageType } from './enums_pb.js' import { ProfileShowcase } from './profile-showcase_pb.js'
import { ImageFormat } from './enums_pb.js'
/** /**
* ChatIdentity represents the user defined identity associated with their public chat key * ChatIdentity represents the user defined identity associated with their public chat key
@ -79,6 +80,11 @@ export class ChatIdentity extends Message<ChatIdentity> {
*/ */
firstMessageTimestamp = 0 firstMessageTimestamp = 0
/**
* @generated from field: ProfileShowcase profile_showcase = 10;
*/
profileShowcase?: ProfileShowcase
constructor(data?: PartialMessage<ChatIdentity>) { constructor(data?: PartialMessage<ChatIdentity>) {
super() super()
proto3.util.initPartial(data, this) proto3.util.initPartial(data, this)
@ -123,6 +129,7 @@ export class ChatIdentity extends Message<ChatIdentity> {
kind: 'scalar', kind: 'scalar',
T: 13 /* ScalarType.UINT32 */, T: 13 /* ScalarType.UINT32 */,
}, },
{ no: 10, name: 'profile_showcase', kind: 'message', T: ProfileShowcase },
]) ])
static fromBinary( static fromBinary(
@ -176,11 +183,11 @@ export class IdentityImage extends Message<IdentityImage> {
sourceType = IdentityImage_SourceType.UNKNOWN_SOURCE_TYPE sourceType = IdentityImage_SourceType.UNKNOWN_SOURCE_TYPE
/** /**
* image_type signals the image type and method of parsing the payload * image_format signals the image format and method of parsing the payload
* *
* @generated from field: ImageType image_type = 3; * @generated from field: ImageFormat image_format = 3;
*/ */
imageType = ImageType.UNKNOWN_IMAGE_TYPE imageFormat = ImageFormat.UNKNOWN_IMAGE_FORMAT
/** /**
* encryption_keys is a list of encrypted keys that can be used to decrypted an encrypted payload * encryption_keys is a list of encrypted keys that can be used to decrypted an encrypted payload
@ -213,9 +220,9 @@ export class IdentityImage extends Message<IdentityImage> {
}, },
{ {
no: 3, no: 3,
name: 'image_type', name: 'image_format',
kind: 'enum', kind: 'enum',
T: proto3.getEnumType(ImageType), T: proto3.getEnumType(ImageFormat),
}, },
{ {
no: 4, no: 4,

View File

@ -1,6 +1,8 @@
syntax = "proto3"; syntax = "proto3";
import "enums.proto"; import "enums.proto";
import "contact.proto";
import "shard.proto";
message StickerMessage { message StickerMessage {
string hash = 1; string hash = 1;
@ -9,7 +11,11 @@ message StickerMessage {
message ImageMessage { message ImageMessage {
bytes payload = 1; bytes payload = 1;
ImageType type = 2; ImageFormat format = 2;
string album_id = 3;
uint32 width = 4;
uint32 height = 5;
uint32 album_images_count = 6;
} }
message AudioMessage { message AudioMessage {
@ -32,10 +38,14 @@ message EditMessage {
string message_id = 4; string message_id = 4;
// Grant for community edit messages // Grant for community edit messages
bytes grant = 5; bytes grant = 5 [deprecated = true];
// The type of message (public/one-to-one/private-group-chat) // The type of message (public/one-to-one/private-group-chat)
MessageType message_type = 6; MessageType message_type = 6;
ChatMessage.ContentType content_type = 7;
repeated UnfurledLink unfurled_links = 8;
UnfurledStatusLinks unfurled_status_links = 9;
} }
message DeleteMessage { message DeleteMessage {
@ -45,18 +55,138 @@ message DeleteMessage {
string message_id = 3; string message_id = 3;
// Grant for community delete messages // Grant for community delete messages
bytes grant = 4; bytes grant = 4 [deprecated = true];
// The type of message (public/one-to-one/private-group-chat) // The type of message (public/one-to-one/private-group-chat)
MessageType message_type = 5; MessageType message_type = 5;
string deleted_by = 6;
} }
message SyncDeleteForMeMessage {
uint64 clock = 1;
string message_id = 2;
}
message DiscordMessage {
string id = 1;
string type = 2;
string timestamp = 3;
string timestampEdited = 4;
string content = 5;
DiscordMessageAuthor author = 6;
DiscordMessageReference reference = 7;
repeated DiscordMessageAttachment attachments = 8;
}
message DiscordMessageAuthor {
string id = 1;
string name = 2;
string discriminator = 3;
string nickname = 4;
string avatarUrl = 5;
bytes avatarImagePayload = 6;
string localUrl = 7;
}
message DiscordMessageReference {
string messageId = 1;
string channelId = 2;
string guildId = 3;
}
message DiscordMessageAttachment {
string id = 1;
string messageId = 2;
string url = 3;
string fileName = 4;
uint64 fileSizeBytes = 5;
string contentType = 6;
bytes payload = 7;
string localUrl = 8;
}
message BridgeMessage {
string bridgeName = 1;
string userName = 2;
string userAvatar = 3;
string userID = 4;
string content = 5;
string messageID = 6;
string parentMessageID = 7;
}
message UnfurledLinkThumbnail {
bytes payload = 1;
uint32 width = 2;
uint32 height = 3;
}
message UnfurledLink {
// A valid URL which uniquely identifies this link.
string url = 1;
// Website's title.
string title = 2;
// Description is sometimes available, but can be empty. Most mainstream
// websites provide this information.
string description = 3;
bytes thumbnail_payload = 4;
uint32 thumbnail_width = 5;
uint32 thumbnail_height = 6;
LinkType type = 7;
bytes favicon_payload = 8;
enum LinkType {
LINK = 0;
IMAGE = 1;
}
}
message UnfurledStatusContactLink {
bytes public_key = 1;
string display_name = 2;
string description = 3;
UnfurledLinkThumbnail icon = 4;
}
message UnfurledStatusCommunityLink {
bytes community_id = 1;
string display_name = 2;
string description = 3;
uint32 members_count = 4;
string color = 5;
UnfurledLinkThumbnail icon = 7;
UnfurledLinkThumbnail banner = 8;
}
message UnfurledStatusChannelLink {
string channel_uuid = 1;
string emoji = 2;
string display_name = 3;
string description = 4;
string color = 5;
UnfurledStatusCommunityLink community = 6;
}
message UnfurledStatusLink {
string url = 1;
oneof payload {
UnfurledStatusContactLink contact = 2;
UnfurledStatusCommunityLink community = 3;
UnfurledStatusChannelLink channel = 4;
}
}
// Create a wrapper around repeated property for proper unmarshalling
message UnfurledStatusLinks {
repeated UnfurledStatusLink unfurled_status_links = 1;
}
message ChatMessage { message ChatMessage {
// Lamport timestamp of the chat message // Lamport timestamp of the chat message
uint64 clock = 1; uint64 clock = 1;
// Unix timestamps in milliseconds, currently not used as we use whisper as more reliable, but here // Unix timestamps in milliseconds, currently not used as we use whisper as
// so that we don't rely on it // more reliable, but here so that we don't rely on it
uint64 timestamp = 2; uint64 timestamp = 2;
// Text of the message // Text of the message
string text = 3; string text = 3;
@ -67,7 +197,8 @@ message ChatMessage {
// Chat id, this field is symmetric for public-chats and private group chats, // Chat id, this field is symmetric for public-chats and private group chats,
// but asymmetric in case of one-to-ones, as the sender will use the chat-id // but asymmetric in case of one-to-ones, as the sender will use the chat-id
// of the received, while the receiver will use the chat-id of the sender. // of the received, while the receiver will use the chat-id of the sender.
// Probably should be the concatenation of sender-pk & receiver-pk in alphabetical order // Probably should be the concatenation of sender-pk & receiver-pk in
// alphabetical order
string chat_id = 6; string chat_id = 6;
// The type of message (public/one-to-one/private-group-chat) // The type of message (public/one-to-one/private-group-chat)
@ -80,14 +211,24 @@ message ChatMessage {
ImageMessage image = 10; ImageMessage image = 10;
AudioMessage audio = 11; AudioMessage audio = 11;
bytes community = 12; bytes community = 12;
DiscordMessage discord_message = 99;
BridgeMessage bridge_message = 100;
} }
// Grant for community chat messages // Grant for community chat messages
bytes grant = 13; bytes grant = 13 [deprecated = true];
// Message author's display name, introduced in version 1 // Message author's display name, introduced in version 1
string display_name = 14; string display_name = 14;
ContactRequestPropagatedState contact_request_propagated_state = 15;
repeated UnfurledLink unfurled_links = 16;
Shard shard = 17;
UnfurledStatusLinks unfurled_status_links = 18;
enum ContentType { enum ContentType {
UNKNOWN_CONTENT_TYPE = 0; UNKNOWN_CONTENT_TYPE = 0;
TEXT_PLAIN = 1; TEXT_PLAIN = 1;
@ -102,5 +243,17 @@ message ChatMessage {
COMMUNITY = 9; COMMUNITY = 9;
// Only local // Only local
SYSTEM_MESSAGE_GAP = 10; SYSTEM_MESSAGE_GAP = 10;
CONTACT_REQUEST = 11;
DISCORD_MESSAGE = 12;
IDENTITY_VERIFICATION = 13;
// Only local
SYSTEM_MESSAGE_PINNED_MESSAGE = 14;
// Only local
SYSTEM_MESSAGE_MUTUAL_EVENT_SENT = 15;
// Only local
SYSTEM_MESSAGE_MUTUAL_EVENT_ACCEPTED = 16;
// Only local
SYSTEM_MESSAGE_MUTUAL_EVENT_REMOVED = 17;
BRIDGE_MESSAGE = 18;
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,8 @@
syntax = "proto3"; syntax = "proto3";
import "chat-identity.proto"; import "chat-identity.proto";
import "url.proto"; import "enums.proto";
import "shard.proto";
message Grant { message Grant {
bytes community_id = 1; bytes community_id = 1;
@ -12,20 +13,41 @@ message Grant {
message CommunityMember { message CommunityMember {
enum Roles { enum Roles {
UNKNOWN_ROLE = 0; reserved 2, 3;
ROLE_ALL = 1; reserved "ROLE_MANAGE_USERS", "ROLE_MODERATE_CONTENT";
ROLE_MANAGE_USERS = 2; ROLE_NONE = 0;
ROLE_MODERATE_CONTENT = 3; ROLE_OWNER = 1;
ROLE_ADMIN = 4;
ROLE_TOKEN_MASTER = 5;
}
enum ChannelRole {
// We make POSTER the first role to be the default one.
// This is for backwards compatibility. Older protobufs won't have this field and will default to 0.
CHANNEL_ROLE_POSTER = 0;
CHANNEL_ROLE_VIEWER = 1;
} }
repeated Roles roles = 1; repeated Roles roles = 1;
repeated RevealedAccount revealed_accounts = 2 [deprecated = true];
uint64 last_update_clock = 3;
ChannelRole channel_role = 4;
}
message CommunityTokenMetadata {
map<uint64, string> contract_addresses = 1;
string description = 2;
string image = 3;
CommunityTokenType tokenType = 4;
string symbol = 5;
string name = 6;
uint32 decimals = 7;
} }
message CommunityPermissions { message CommunityPermissions {
enum Access { enum Access {
UNKNOWN_ACCESS = 0; UNKNOWN_ACCESS = 0;
NO_MEMBERSHIP = 1; AUTO_ACCEPT = 1;
INVITATION_ONLY = 2; INVITATION_ONLY = 2 [deprecated = true];
ON_REQUEST = 3; MANUAL_ACCEPT = 3;
} }
bool ens_only = 1; bool ens_only = 1;
@ -34,20 +56,63 @@ message CommunityPermissions {
Access access = 3; Access access = 3;
} }
message TokenCriteria {
map<uint64, string> contract_addresses = 1;
CommunityTokenType type = 2;
string symbol = 3;
string name = 4;
string amount = 5 [deprecated = true];
repeated uint64 token_ids = 6;
string ens_pattern = 7;
uint64 decimals = 8;
string amountInWei = 9;
}
message CommunityTokenPermission {
enum Type {
UNKNOWN_TOKEN_PERMISSION = 0;
BECOME_ADMIN = 1;
BECOME_MEMBER = 2;
CAN_VIEW_CHANNEL = 3;
CAN_VIEW_AND_POST_CHANNEL = 4;
BECOME_TOKEN_MASTER = 5;
BECOME_TOKEN_OWNER = 6;
}
string id = 1;
Type type = 2;
repeated TokenCriteria token_criteria = 3;
repeated string chat_ids = 4;
bool is_private = 5;
}
message CommunityDescription { message CommunityDescription {
uint64 clock = 1; uint64 clock = 1;
map<string,CommunityMember> members = 2; map<string,CommunityMember> members = 2;
CommunityPermissions permissions = 3; CommunityPermissions permissions = 3;
ChatIdentity identity = 5; ChatIdentity identity = 5;
map<string,CommunityChat> chats = 6; map<string,CommunityChat> chats = 6;
repeated string ban_list = 7; repeated string ban_list = 7 [deprecated = true];
map<string,CommunityCategory> categories = 8; map<string,CommunityCategory> categories = 8;
uint64 archive_magnetlink_clock = 9; uint64 archive_magnetlink_clock = 9;
CommunityAdminSettings admin_settings = 10; CommunityAdminSettings admin_settings = 10;
string intro_message = 11; string intro_message = 11;
string outro_message = 12; string outro_message = 12;
bool encrypted = 13; bool encrypted = 13 [deprecated=true];
repeated string tags = 14; repeated string tags = 14;
map<string, CommunityTokenPermission> token_permissions = 15;
repeated CommunityTokenMetadata community_tokens_metadata = 16;
uint64 active_members_count = 17;
string ID = 18;
map<string,CommunityBanInfo>banned_members = 19;
// key is hash ratchet key_id + seq_no
map<string, bytes> privateData = 100;
}
message CommunityBanInfo {
bool delete_all_messages = 1;
} }
message CommunityAdminSettings { message CommunityAdminSettings {
@ -60,6 +125,7 @@ message CommunityChat {
ChatIdentity identity = 3; ChatIdentity identity = 3;
string category_id = 4; string category_id = 4;
int32 position = 5; int32 position = 5;
bool viewers_can_post_reactions = 6;
} }
message CommunityCategory { message CommunityCategory {
@ -68,11 +134,11 @@ message CommunityCategory {
int32 position = 3; int32 position = 3;
} }
message CommunityInvitation { message RevealedAccount {
bytes community_description = 1; string address = 1;
bytes grant = 2; bytes signature = 2;
string chat_id = 3; repeated uint64 chain_ids = 3;
bytes public_key = 4; bool isAirdropAddress = 4;
} }
message CommunityRequestToJoin { message CommunityRequestToJoin {
@ -81,6 +147,13 @@ message CommunityRequestToJoin {
string chat_id = 3; string chat_id = 3;
bytes community_id = 4; bytes community_id = 4;
string display_name = 5; string display_name = 5;
repeated RevealedAccount revealed_accounts = 6;
}
message CommunityEditSharedAddresses {
uint64 clock = 1;
bytes community_id = 2;
repeated RevealedAccount revealed_accounts = 3;
} }
message CommunityCancelRequestToJoin { message CommunityCancelRequestToJoin {
@ -91,6 +164,11 @@ message CommunityCancelRequestToJoin {
string display_name = 5; string display_name = 5;
} }
message CommunityUserKicked {
uint64 clock = 1;
bytes community_id = 2;
}
message CommunityRequestToJoinResponse { message CommunityRequestToJoinResponse {
uint64 clock = 1; uint64 clock = 1;
CommunityDescription community = 2; CommunityDescription community = 2;
@ -98,6 +176,8 @@ message CommunityRequestToJoinResponse {
bytes grant = 4; bytes grant = 4;
bytes community_id = 5; bytes community_id = 5;
string magnet_uri = 6; string magnet_uri = 6;
bytes protected_topic_private_key = 7;
Shard shard = 8;
} }
message CommunityRequestToLeave { message CommunityRequestToLeave {
@ -144,3 +224,32 @@ message WakuMessageArchiveIndexMetadata {
message WakuMessageArchiveIndex { message WakuMessageArchiveIndex {
map<string, WakuMessageArchiveIndexMetadata> archives = 1; map<string, WakuMessageArchiveIndexMetadata> archives = 1;
} }
message CommunityPublicStorenodesInfo {
// Signature of the payload field
bytes signature = 1;
// Marshaled CommunityStorenodes
bytes payload = 2;
}
message CommunityStorenodes {
uint64 clock = 1;
bytes community_id = 2;
repeated Storenode storenodes = 3;
uint64 chain_id = 4;
}
message Storenode {
bytes community_id = 1;
string storenode_id = 2;
string name = 3;
string address = 4;
string fleet = 5;
uint32 version = 6;
bool removed = 7;
int64 deleted_at = 8;
}
message CommunityReevaluatePermissionsRequest {
bytes community_id = 1;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,28 @@
syntax = "proto3";
message ContactRequestPropagatedState {
uint64 local_clock = 1;
uint64 local_state = 2;
uint64 remote_clock = 3;
uint64 remote_state = 4;
}
message ContactUpdate {
uint64 clock = 1;
string ens_name = 2;
string profile_image = 3;
string display_name = 4;
uint64 contact_request_clock = 5;
ContactRequestPropagatedState contact_request_propagated_state = 6;
string public_key = 7;
}
message AcceptContactRequest {
string id = 1;
uint64 clock = 2;
}
message RetractContactRequest {
string id = 1;
uint64 clock = 2;
}

View File

@ -0,0 +1,325 @@
// @generated by protoc-gen-es v1.4.2 with parameter "target=ts"
// @generated from file contact.proto (syntax proto3)
/* eslint-disable */
// @ts-nocheck
import type {
BinaryReadOptions,
FieldList,
JsonReadOptions,
JsonValue,
PartialMessage,
PlainMessage,
} from '@bufbuild/protobuf'
import { Message, proto3, protoInt64 } from '@bufbuild/protobuf'
/**
* @generated from message ContactRequestPropagatedState
*/
export class ContactRequestPropagatedState extends Message<ContactRequestPropagatedState> {
/**
* @generated from field: uint64 local_clock = 1;
*/
localClock = protoInt64.zero
/**
* @generated from field: uint64 local_state = 2;
*/
localState = protoInt64.zero
/**
* @generated from field: uint64 remote_clock = 3;
*/
remoteClock = protoInt64.zero
/**
* @generated from field: uint64 remote_state = 4;
*/
remoteState = protoInt64.zero
constructor(data?: PartialMessage<ContactRequestPropagatedState>) {
super()
proto3.util.initPartial(data, this)
}
static readonly runtime: typeof proto3 = proto3
static readonly typeName = 'ContactRequestPropagatedState'
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{
no: 1,
name: 'local_clock',
kind: 'scalar',
T: 4 /* ScalarType.UINT64 */,
},
{
no: 2,
name: 'local_state',
kind: 'scalar',
T: 4 /* ScalarType.UINT64 */,
},
{
no: 3,
name: 'remote_clock',
kind: 'scalar',
T: 4 /* ScalarType.UINT64 */,
},
{
no: 4,
name: 'remote_state',
kind: 'scalar',
T: 4 /* ScalarType.UINT64 */,
},
])
static fromBinary(
bytes: Uint8Array,
options?: Partial<BinaryReadOptions>
): ContactRequestPropagatedState {
return new ContactRequestPropagatedState().fromBinary(bytes, options)
}
static fromJson(
jsonValue: JsonValue,
options?: Partial<JsonReadOptions>
): ContactRequestPropagatedState {
return new ContactRequestPropagatedState().fromJson(jsonValue, options)
}
static fromJsonString(
jsonString: string,
options?: Partial<JsonReadOptions>
): ContactRequestPropagatedState {
return new ContactRequestPropagatedState().fromJsonString(
jsonString,
options
)
}
static equals(
a:
| ContactRequestPropagatedState
| PlainMessage<ContactRequestPropagatedState>
| undefined,
b:
| ContactRequestPropagatedState
| PlainMessage<ContactRequestPropagatedState>
| undefined
): boolean {
return proto3.util.equals(ContactRequestPropagatedState, a, b)
}
}
/**
* @generated from message ContactUpdate
*/
export class ContactUpdate extends Message<ContactUpdate> {
/**
* @generated from field: uint64 clock = 1;
*/
clock = protoInt64.zero
/**
* @generated from field: string ens_name = 2;
*/
ensName = ''
/**
* @generated from field: string profile_image = 3;
*/
profileImage = ''
/**
* @generated from field: string display_name = 4;
*/
displayName = ''
/**
* @generated from field: uint64 contact_request_clock = 5;
*/
contactRequestClock = protoInt64.zero
/**
* @generated from field: ContactRequestPropagatedState contact_request_propagated_state = 6;
*/
contactRequestPropagatedState?: ContactRequestPropagatedState
/**
* @generated from field: string public_key = 7;
*/
publicKey = ''
constructor(data?: PartialMessage<ContactUpdate>) {
super()
proto3.util.initPartial(data, this)
}
static readonly runtime: typeof proto3 = proto3
static readonly typeName = 'ContactUpdate'
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: 'clock', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ },
{ no: 2, name: 'ens_name', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
{
no: 3,
name: 'profile_image',
kind: 'scalar',
T: 9 /* ScalarType.STRING */,
},
{
no: 4,
name: 'display_name',
kind: 'scalar',
T: 9 /* ScalarType.STRING */,
},
{
no: 5,
name: 'contact_request_clock',
kind: 'scalar',
T: 4 /* ScalarType.UINT64 */,
},
{
no: 6,
name: 'contact_request_propagated_state',
kind: 'message',
T: ContactRequestPropagatedState,
},
{ no: 7, name: 'public_key', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
])
static fromBinary(
bytes: Uint8Array,
options?: Partial<BinaryReadOptions>
): ContactUpdate {
return new ContactUpdate().fromBinary(bytes, options)
}
static fromJson(
jsonValue: JsonValue,
options?: Partial<JsonReadOptions>
): ContactUpdate {
return new ContactUpdate().fromJson(jsonValue, options)
}
static fromJsonString(
jsonString: string,
options?: Partial<JsonReadOptions>
): ContactUpdate {
return new ContactUpdate().fromJsonString(jsonString, options)
}
static equals(
a: ContactUpdate | PlainMessage<ContactUpdate> | undefined,
b: ContactUpdate | PlainMessage<ContactUpdate> | undefined
): boolean {
return proto3.util.equals(ContactUpdate, a, b)
}
}
/**
* @generated from message AcceptContactRequest
*/
export class AcceptContactRequest extends Message<AcceptContactRequest> {
/**
* @generated from field: string id = 1;
*/
id = ''
/**
* @generated from field: uint64 clock = 2;
*/
clock = protoInt64.zero
constructor(data?: PartialMessage<AcceptContactRequest>) {
super()
proto3.util.initPartial(data, this)
}
static readonly runtime: typeof proto3 = proto3
static readonly typeName = 'AcceptContactRequest'
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: 'id', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
{ no: 2, name: 'clock', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ },
])
static fromBinary(
bytes: Uint8Array,
options?: Partial<BinaryReadOptions>
): AcceptContactRequest {
return new AcceptContactRequest().fromBinary(bytes, options)
}
static fromJson(
jsonValue: JsonValue,
options?: Partial<JsonReadOptions>
): AcceptContactRequest {
return new AcceptContactRequest().fromJson(jsonValue, options)
}
static fromJsonString(
jsonString: string,
options?: Partial<JsonReadOptions>
): AcceptContactRequest {
return new AcceptContactRequest().fromJsonString(jsonString, options)
}
static equals(
a: AcceptContactRequest | PlainMessage<AcceptContactRequest> | undefined,
b: AcceptContactRequest | PlainMessage<AcceptContactRequest> | undefined
): boolean {
return proto3.util.equals(AcceptContactRequest, a, b)
}
}
/**
* @generated from message RetractContactRequest
*/
export class RetractContactRequest extends Message<RetractContactRequest> {
/**
* @generated from field: string id = 1;
*/
id = ''
/**
* @generated from field: uint64 clock = 2;
*/
clock = protoInt64.zero
constructor(data?: PartialMessage<RetractContactRequest>) {
super()
proto3.util.initPartial(data, this)
}
static readonly runtime: typeof proto3 = proto3
static readonly typeName = 'RetractContactRequest'
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: 'id', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
{ no: 2, name: 'clock', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ },
])
static fromBinary(
bytes: Uint8Array,
options?: Partial<BinaryReadOptions>
): RetractContactRequest {
return new RetractContactRequest().fromBinary(bytes, options)
}
static fromJson(
jsonValue: JsonValue,
options?: Partial<JsonReadOptions>
): RetractContactRequest {
return new RetractContactRequest().fromJson(jsonValue, options)
}
static fromJsonString(
jsonString: string,
options?: Partial<JsonReadOptions>
): RetractContactRequest {
return new RetractContactRequest().fromJsonString(jsonString, options)
}
static equals(
a: RetractContactRequest | PlainMessage<RetractContactRequest> | undefined,
b: RetractContactRequest | PlainMessage<RetractContactRequest> | undefined
): boolean {
return proto3.util.equals(RetractContactRequest, a, b)
}
}

View File

@ -33,5 +33,5 @@ message EmojiReaction {
bool retracted = 6; bool retracted = 6;
// Grant for organisation chat messages // Grant for organisation chat messages
bytes grant = 7; bytes grant = 7 [deprecated = true];
} }

View File

@ -64,7 +64,8 @@ export class EmojiReaction extends Message<EmojiReaction> {
/** /**
* Grant for organisation chat messages * Grant for organisation chat messages
* *
* @generated from field: bytes grant = 7; * @generated from field: bytes grant = 7 [deprecated = true];
* @deprecated
*/ */
grant = new Uint8Array(0) grant = new Uint8Array(0)

View File

@ -12,8 +12,8 @@ enum MessageType {
SYSTEM_MESSAGE_GAP = 6; SYSTEM_MESSAGE_GAP = 6;
} }
enum ImageType { enum ImageFormat {
UNKNOWN_IMAGE_TYPE = 0; UNKNOWN_IMAGE_FORMAT = 0;
// Raster image files is payload data that can be read as a raster image // Raster image files is payload data that can be read as a raster image
PNG = 1; PNG = 1;
@ -21,3 +21,10 @@ enum ImageType {
WEBP = 3; WEBP = 3;
GIF = 4; GIF = 4;
} }
enum CommunityTokenType {
UNKNOWN_TOKEN_TYPE = 0;
ERC20 = 1;
ERC721 = 2;
ENS = 3;
}

View File

@ -60,13 +60,13 @@ proto3.util.setEnumType(MessageType, 'MessageType', [
]) ])
/** /**
* @generated from enum ImageType * @generated from enum ImageFormat
*/ */
export enum ImageType { export enum ImageFormat {
/** /**
* @generated from enum value: UNKNOWN_IMAGE_TYPE = 0; * @generated from enum value: UNKNOWN_IMAGE_FORMAT = 0;
*/ */
UNKNOWN_IMAGE_TYPE = 0, UNKNOWN_IMAGE_FORMAT = 0,
/** /**
* Raster image files is payload data that can be read as a raster image * Raster image files is payload data that can be read as a raster image
@ -90,11 +90,43 @@ export enum ImageType {
*/ */
GIF = 4, GIF = 4,
} }
// Retrieve enum metadata with: proto3.getEnumType(ImageType) // Retrieve enum metadata with: proto3.getEnumType(ImageFormat)
proto3.util.setEnumType(ImageType, 'ImageType', [ proto3.util.setEnumType(ImageFormat, 'ImageFormat', [
{ no: 0, name: 'UNKNOWN_IMAGE_TYPE' }, { no: 0, name: 'UNKNOWN_IMAGE_FORMAT' },
{ no: 1, name: 'PNG' }, { no: 1, name: 'PNG' },
{ no: 2, name: 'JPEG' }, { no: 2, name: 'JPEG' },
{ no: 3, name: 'WEBP' }, { no: 3, name: 'WEBP' },
{ no: 4, name: 'GIF' }, { no: 4, name: 'GIF' },
]) ])
/**
* @generated from enum CommunityTokenType
*/
export enum CommunityTokenType {
/**
* @generated from enum value: UNKNOWN_TOKEN_TYPE = 0;
*/
UNKNOWN_TOKEN_TYPE = 0,
/**
* @generated from enum value: ERC20 = 1;
*/
ERC20 = 1,
/**
* @generated from enum value: ERC721 = 2;
*/
ERC721 = 2,
/**
* @generated from enum value: ENS = 3;
*/
ENS = 3,
}
// Retrieve enum metadata with: proto3.getEnumType(CommunityTokenType)
proto3.util.setEnumType(CommunityTokenType, 'CommunityTokenType', [
{ no: 0, name: 'UNKNOWN_TOKEN_TYPE' },
{ no: 1, name: 'ERC20' },
{ no: 2, name: 'ERC721' },
{ no: 3, name: 'ENS' },
])

View File

@ -12,6 +12,10 @@ message MembershipUpdateEvent {
string name = 3; string name = 3;
// The type of the event // The type of the event
EventType type = 4; EventType type = 4;
// Color of the chat for the CHAT_CREATED/COLOR_CHANGED event types
string color = 5;
// Chat image
bytes image = 6;
enum EventType { enum EventType {
UNKNOWN = 0; UNKNOWN = 0;
@ -22,6 +26,8 @@ message MembershipUpdateEvent {
MEMBER_REMOVED = 5; MEMBER_REMOVED = 5;
ADMINS_ADDED = 6; ADMINS_ADDED = 6;
ADMIN_REMOVED = 7; ADMIN_REMOVED = 7;
COLOR_CHANGED = 8;
IMAGE_CHANGED = 9;
} }
} }

View File

@ -47,6 +47,20 @@ export class MembershipUpdateEvent extends Message<MembershipUpdateEvent> {
*/ */
type = MembershipUpdateEvent_EventType.UNKNOWN type = MembershipUpdateEvent_EventType.UNKNOWN
/**
* Color of the chat for the CHAT_CREATED/COLOR_CHANGED event types
*
* @generated from field: string color = 5;
*/
color = ''
/**
* Chat image
*
* @generated from field: bytes image = 6;
*/
image = new Uint8Array(0)
constructor(data?: PartialMessage<MembershipUpdateEvent>) { constructor(data?: PartialMessage<MembershipUpdateEvent>) {
super() super()
proto3.util.initPartial(data, this) proto3.util.initPartial(data, this)
@ -70,6 +84,8 @@ export class MembershipUpdateEvent extends Message<MembershipUpdateEvent> {
kind: 'enum', kind: 'enum',
T: proto3.getEnumType(MembershipUpdateEvent_EventType), T: proto3.getEnumType(MembershipUpdateEvent_EventType),
}, },
{ no: 5, name: 'color', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
{ no: 6, name: 'image', kind: 'scalar', T: 12 /* ScalarType.BYTES */ },
]) ])
static fromBinary( static fromBinary(
@ -144,6 +160,16 @@ export enum MembershipUpdateEvent_EventType {
* @generated from enum value: ADMIN_REMOVED = 7; * @generated from enum value: ADMIN_REMOVED = 7;
*/ */
ADMIN_REMOVED = 7, ADMIN_REMOVED = 7,
/**
* @generated from enum value: COLOR_CHANGED = 8;
*/
COLOR_CHANGED = 8,
/**
* @generated from enum value: IMAGE_CHANGED = 9;
*/
IMAGE_CHANGED = 9,
} }
// Retrieve enum metadata with: proto3.getEnumType(MembershipUpdateEvent_EventType) // Retrieve enum metadata with: proto3.getEnumType(MembershipUpdateEvent_EventType)
proto3.util.setEnumType( proto3.util.setEnumType(
@ -158,6 +184,8 @@ proto3.util.setEnumType(
{ no: 5, name: 'MEMBER_REMOVED' }, { no: 5, name: 'MEMBER_REMOVED' },
{ no: 6, name: 'ADMINS_ADDED' }, { no: 6, name: 'ADMINS_ADDED' },
{ no: 7, name: 'ADMIN_REMOVED' }, { no: 7, name: 'ADMIN_REMOVED' },
{ no: 8, name: 'COLOR_CHANGED' },
{ no: 9, name: 'IMAGE_CHANGED' },
] ]
) )

View File

@ -0,0 +1,130 @@
syntax = "proto3";
// Profile showcase for a contact
message ProfileShowcaseCommunity {
string community_id = 1;
uint32 order = 2;
bytes grant = 3;
}
message ProfileShowcaseAccount {
string address = 1;
string name = 2;
string color_id = 3;
string emoji = 4;
uint32 order = 5;
}
message ProfileShowcaseCollectible {
string uid = 1 [deprecated = true];
uint32 order = 2;
string contract_address = 3;
string community_id = 4 [deprecated = true];
uint64 chain_id = 5;
string token_id = 6;
string account_address = 7 [deprecated = true];
}
message ProfileShowcaseVerifiedToken {
string symbol = 1;
uint32 order = 2;
}
message ProfileShowcaseUnverifiedToken {
string contract_address = 1;
uint32 order = 2;
uint64 chain_id = 3;
string community_id = 4 [deprecated = true];
}
message ProfileShowcaseSocialLink {
string url = 1;
uint32 order = 2;
string text = 3;
}
message ProfileShowcaseEntries {
repeated ProfileShowcaseCommunity communities = 1;
repeated ProfileShowcaseAccount accounts = 2;
repeated ProfileShowcaseCollectible collectibles = 3;
repeated ProfileShowcaseVerifiedToken verified_tokens = 4;
repeated ProfileShowcaseUnverifiedToken unverified_tokens = 5;
repeated ProfileShowcaseSocialLink social_links = 6;
}
message ProfileShowcaseEntriesEncrypted {
bytes encrypted_entries = 1;
repeated bytes encryption_keys = 2;
}
message ProfileShowcase {
ProfileShowcaseEntries for_everyone = 1;
ProfileShowcaseEntriesEncrypted for_contacts = 2;
ProfileShowcaseEntriesEncrypted for_id_verified_contacts = 3;
}
// Profile showcase preferences
enum ProfileShowcaseVisibility {
PROFILE_SHOWCASE_VISIBILITY_NO_ONE = 0;
PROFILE_SHOWCASE_VISIBILITY_IDVERIFIED_CONTACTS = 1;
PROFILE_SHOWCASE_VISIBILITY_CONTACTS = 2;
PROFILE_SHOWCASE_VISIBILITY_EVERYONE = 3;
}
message ProfileShowcaseCommunityPreference {
string community_id = 1;
ProfileShowcaseVisibility showcase_visibility = 2;
uint32 order = 3;
}
message ProfileShowcaseAccountPreference {
string address = 1;
string name = 2 [deprecated = true];
string color_id = 3 [deprecated = true];
string emoji = 4 [deprecated = true];
ProfileShowcaseVisibility showcase_visibility = 5;
uint32 order = 6;
}
message ProfileShowcaseCollectiblePreference {
string contract_address = 1;
uint64 chain_id = 2;
string token_id = 3;
string community_id = 4 [deprecated = true];
string account_address = 5 [deprecated = true];
ProfileShowcaseVisibility showcase_visibility = 6;
uint32 order = 7;
}
message ProfileShowcaseVerifiedTokenPreference {
string symbol = 1;
ProfileShowcaseVisibility showcase_visibility = 2;
uint32 order = 3;
}
message ProfileShowcaseUnverifiedTokenPreference {
string contract_address = 1;
uint64 chain_id = 2;
string community_id = 3 [deprecated = true];
ProfileShowcaseVisibility showcase_visibility = 4;
uint32 order = 5;
}
message ProfileShowcaseSocialLinkPreference {
string url = 1;
string text = 2;
uint32 order = 3;
ProfileShowcaseVisibility showcase_visibility = 4;
}
message SyncProfileShowcasePreferences {
uint64 clock = 1;
repeated ProfileShowcaseCommunityPreference communities = 2;
repeated ProfileShowcaseAccountPreference accounts = 3;
repeated ProfileShowcaseCollectiblePreference collectibles = 4;
repeated ProfileShowcaseVerifiedTokenPreference verified_tokens = 5;
repeated ProfileShowcaseUnverifiedTokenPreference unverified_tokens = 6;
repeated ProfileShowcaseSocialLinkPreference social_links = 7;
}

File diff suppressed because it is too large Load Diff

View File

@ -53,21 +53,32 @@ message X3DHHeader {
// Hash Ratchet Header // Hash Ratchet Header
message HRHeader { message HRHeader {
// community key ID // deprecated group key ID
uint32 key_id = 1; uint32 deprecated_key_id = 1;
// Community message number for this key_id // group message number for this key_id
uint32 seq_no = 2; uint32 seq_no = 2;
// Community ID // group ID
bytes group_id = 3; bytes group_id = 3;
// group key ID
bytes key_id = 4;
HRKeys keys = 5;
}
message RekeyGroup {
uint64 timestamp = 2;
map<uint32, bytes> keys = 4;
} }
message HRKeys { message HRKeys {
repeated HRKey keys = 1; repeated HRKey keys = 1;
RekeyGroup rekey_group = 2;
} }
message HRKey { message HRKey {
uint32 key_id = 1; uint32 deprecated_key_id = 1;
bytes key = 2; bytes key = 2;
uint64 timestamp = 3;
} }
// Direct message value // Direct message value

View File

@ -423,26 +423,38 @@ export class X3DHHeader extends Message<X3DHHeader> {
*/ */
export class HRHeader extends Message<HRHeader> { export class HRHeader extends Message<HRHeader> {
/** /**
* community key ID * deprecated group key ID
* *
* @generated from field: uint32 key_id = 1; * @generated from field: uint32 deprecated_key_id = 1;
*/ */
keyId = 0 deprecatedKeyId = 0
/** /**
* Community message number for this key_id * group message number for this key_id
* *
* @generated from field: uint32 seq_no = 2; * @generated from field: uint32 seq_no = 2;
*/ */
seqNo = 0 seqNo = 0
/** /**
* Community ID * group ID
* *
* @generated from field: bytes group_id = 3; * @generated from field: bytes group_id = 3;
*/ */
groupId = new Uint8Array(0) groupId = new Uint8Array(0)
/**
* group key ID
*
* @generated from field: bytes key_id = 4;
*/
keyId = new Uint8Array(0)
/**
* @generated from field: HRKeys keys = 5;
*/
keys?: HRKeys
constructor(data?: PartialMessage<HRHeader>) { constructor(data?: PartialMessage<HRHeader>) {
super() super()
proto3.util.initPartial(data, this) proto3.util.initPartial(data, this)
@ -451,9 +463,16 @@ export class HRHeader extends Message<HRHeader> {
static readonly runtime: typeof proto3 = proto3 static readonly runtime: typeof proto3 = proto3
static readonly typeName = 'HRHeader' static readonly typeName = 'HRHeader'
static readonly fields: FieldList = proto3.util.newFieldList(() => [ static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: 'key_id', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ }, {
no: 1,
name: 'deprecated_key_id',
kind: 'scalar',
T: 13 /* ScalarType.UINT32 */,
},
{ no: 2, name: 'seq_no', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ }, { no: 2, name: 'seq_no', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ },
{ no: 3, name: 'group_id', kind: 'scalar', T: 12 /* ScalarType.BYTES */ }, { no: 3, name: 'group_id', kind: 'scalar', T: 12 /* ScalarType.BYTES */ },
{ no: 4, name: 'key_id', kind: 'scalar', T: 12 /* ScalarType.BYTES */ },
{ no: 5, name: 'keys', kind: 'message', T: HRKeys },
]) ])
static fromBinary( static fromBinary(
@ -485,6 +504,67 @@ export class HRHeader extends Message<HRHeader> {
} }
} }
/**
* @generated from message RekeyGroup
*/
export class RekeyGroup extends Message<RekeyGroup> {
/**
* @generated from field: uint64 timestamp = 2;
*/
timestamp = protoInt64.zero
/**
* @generated from field: map<uint32, bytes> keys = 4;
*/
keys: { [key: number]: Uint8Array } = {}
constructor(data?: PartialMessage<RekeyGroup>) {
super()
proto3.util.initPartial(data, this)
}
static readonly runtime: typeof proto3 = proto3
static readonly typeName = 'RekeyGroup'
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 2, name: 'timestamp', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ },
{
no: 4,
name: 'keys',
kind: 'map',
K: 13 /* ScalarType.UINT32 */,
V: { kind: 'scalar', T: 12 /* ScalarType.BYTES */ },
},
])
static fromBinary(
bytes: Uint8Array,
options?: Partial<BinaryReadOptions>
): RekeyGroup {
return new RekeyGroup().fromBinary(bytes, options)
}
static fromJson(
jsonValue: JsonValue,
options?: Partial<JsonReadOptions>
): RekeyGroup {
return new RekeyGroup().fromJson(jsonValue, options)
}
static fromJsonString(
jsonString: string,
options?: Partial<JsonReadOptions>
): RekeyGroup {
return new RekeyGroup().fromJsonString(jsonString, options)
}
static equals(
a: RekeyGroup | PlainMessage<RekeyGroup> | undefined,
b: RekeyGroup | PlainMessage<RekeyGroup> | undefined
): boolean {
return proto3.util.equals(RekeyGroup, a, b)
}
}
/** /**
* @generated from message HRKeys * @generated from message HRKeys
*/ */
@ -494,6 +574,11 @@ export class HRKeys extends Message<HRKeys> {
*/ */
keys: HRKey[] = [] keys: HRKey[] = []
/**
* @generated from field: RekeyGroup rekey_group = 2;
*/
rekeyGroup?: RekeyGroup
constructor(data?: PartialMessage<HRKeys>) { constructor(data?: PartialMessage<HRKeys>) {
super() super()
proto3.util.initPartial(data, this) proto3.util.initPartial(data, this)
@ -503,6 +588,7 @@ export class HRKeys extends Message<HRKeys> {
static readonly typeName = 'HRKeys' static readonly typeName = 'HRKeys'
static readonly fields: FieldList = proto3.util.newFieldList(() => [ static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: 'keys', kind: 'message', T: HRKey, repeated: true }, { no: 1, name: 'keys', kind: 'message', T: HRKey, repeated: true },
{ no: 2, name: 'rekey_group', kind: 'message', T: RekeyGroup },
]) ])
static fromBinary( static fromBinary(
@ -539,15 +625,20 @@ export class HRKeys extends Message<HRKeys> {
*/ */
export class HRKey extends Message<HRKey> { export class HRKey extends Message<HRKey> {
/** /**
* @generated from field: uint32 key_id = 1; * @generated from field: uint32 deprecated_key_id = 1;
*/ */
keyId = 0 deprecatedKeyId = 0
/** /**
* @generated from field: bytes key = 2; * @generated from field: bytes key = 2;
*/ */
key = new Uint8Array(0) key = new Uint8Array(0)
/**
* @generated from field: uint64 timestamp = 3;
*/
timestamp = protoInt64.zero
constructor(data?: PartialMessage<HRKey>) { constructor(data?: PartialMessage<HRKey>) {
super() super()
proto3.util.initPartial(data, this) proto3.util.initPartial(data, this)
@ -556,8 +647,14 @@ export class HRKey extends Message<HRKey> {
static readonly runtime: typeof proto3 = proto3 static readonly runtime: typeof proto3 = proto3
static readonly typeName = 'HRKey' static readonly typeName = 'HRKey'
static readonly fields: FieldList = proto3.util.newFieldList(() => [ static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: 'key_id', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ }, {
no: 1,
name: 'deprecated_key_id',
kind: 'scalar',
T: 13 /* ScalarType.UINT32 */,
},
{ no: 2, name: 'key', kind: 'scalar', T: 12 /* ScalarType.BYTES */ }, { no: 2, name: 'key', kind: 'scalar', T: 12 /* ScalarType.BYTES */ },
{ no: 3, name: 'timestamp', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ },
]) ])
static fromBinary( static fromBinary(

View File

@ -1,7 +1,6 @@
syntax = "proto3"; syntax = "proto3";
import "chat-identity.proto"; import "chat-identity.proto";
import "url.proto";
message PushNotificationRegistration { message PushNotificationRegistration {
enum TokenType { enum TokenType {
@ -23,6 +22,7 @@ message PushNotificationRegistration {
string apn_topic = 12; string apn_topic = 12;
bool block_mentions = 13; bool block_mentions = 13;
repeated bytes allowed_mentions_chat_list = 14; repeated bytes allowed_mentions_chat_list = 14;
repeated bytes muted_chat_list = 15;
} }
message PushNotificationRegistrationResponse { message PushNotificationRegistrationResponse {

View File

@ -88,6 +88,11 @@ export class PushNotificationRegistration extends Message<PushNotificationRegist
*/ */
allowedMentionsChatList: Uint8Array[] = [] allowedMentionsChatList: Uint8Array[] = []
/**
* @generated from field: repeated bytes muted_chat_list = 15;
*/
mutedChatList: Uint8Array[] = []
constructor(data?: PartialMessage<PushNotificationRegistration>) { constructor(data?: PartialMessage<PushNotificationRegistration>) {
super() super()
proto3.util.initPartial(data, this) proto3.util.initPartial(data, this)
@ -158,6 +163,13 @@ export class PushNotificationRegistration extends Message<PushNotificationRegist
T: 12 /* ScalarType.BYTES */, T: 12 /* ScalarType.BYTES */,
repeated: true, repeated: true,
}, },
{
no: 15,
name: 'muted_chat_list',
kind: 'scalar',
T: 12 /* ScalarType.BYTES */,
repeated: true,
},
]) ])
static fromBinary( static fromBinary(

View File

@ -0,0 +1,24 @@
syntax = "proto3";
message Shard {
int32 cluster = 1;
int32 index = 2;
}
message PublicShardInfo {
// clock
uint64 clock = 1;
// community ID
bytes community_id = 2;
// shard information
Shard shard = 3;
// if chainID > 0, the signer must be verified through the community contract
uint64 chainId = 4;
}
message CommunityPublicShardInfo {
// Signature of the payload field
bytes signature = 1;
// Marshaled PublicShardInfo
bytes payload = 2;
}

View File

@ -0,0 +1,214 @@
// @generated by protoc-gen-es v1.4.2 with parameter "target=ts"
// @generated from file shard.proto (syntax proto3)
/* eslint-disable */
// @ts-nocheck
import type {
BinaryReadOptions,
FieldList,
JsonReadOptions,
JsonValue,
PartialMessage,
PlainMessage,
} from '@bufbuild/protobuf'
import { Message, proto3, protoInt64 } from '@bufbuild/protobuf'
/**
* @generated from message Shard
*/
export class Shard extends Message<Shard> {
/**
* @generated from field: int32 cluster = 1;
*/
cluster = 0
/**
* @generated from field: int32 index = 2;
*/
index = 0
constructor(data?: PartialMessage<Shard>) {
super()
proto3.util.initPartial(data, this)
}
static readonly runtime: typeof proto3 = proto3
static readonly typeName = 'Shard'
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: 'cluster', kind: 'scalar', T: 5 /* ScalarType.INT32 */ },
{ no: 2, name: 'index', kind: 'scalar', T: 5 /* ScalarType.INT32 */ },
])
static fromBinary(
bytes: Uint8Array,
options?: Partial<BinaryReadOptions>
): Shard {
return new Shard().fromBinary(bytes, options)
}
static fromJson(
jsonValue: JsonValue,
options?: Partial<JsonReadOptions>
): Shard {
return new Shard().fromJson(jsonValue, options)
}
static fromJsonString(
jsonString: string,
options?: Partial<JsonReadOptions>
): Shard {
return new Shard().fromJsonString(jsonString, options)
}
static equals(
a: Shard | PlainMessage<Shard> | undefined,
b: Shard | PlainMessage<Shard> | undefined
): boolean {
return proto3.util.equals(Shard, a, b)
}
}
/**
* @generated from message PublicShardInfo
*/
export class PublicShardInfo extends Message<PublicShardInfo> {
/**
* clock
*
* @generated from field: uint64 clock = 1;
*/
clock = protoInt64.zero
/**
* community ID
*
* @generated from field: bytes community_id = 2;
*/
communityId = new Uint8Array(0)
/**
* shard information
*
* @generated from field: Shard shard = 3;
*/
shard?: Shard
/**
* if chainID > 0, the signer must be verified through the community contract
*
* @generated from field: uint64 chainId = 4;
*/
chainId = protoInt64.zero
constructor(data?: PartialMessage<PublicShardInfo>) {
super()
proto3.util.initPartial(data, this)
}
static readonly runtime: typeof proto3 = proto3
static readonly typeName = 'PublicShardInfo'
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: 'clock', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ },
{
no: 2,
name: 'community_id',
kind: 'scalar',
T: 12 /* ScalarType.BYTES */,
},
{ no: 3, name: 'shard', kind: 'message', T: Shard },
{ no: 4, name: 'chainId', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ },
])
static fromBinary(
bytes: Uint8Array,
options?: Partial<BinaryReadOptions>
): PublicShardInfo {
return new PublicShardInfo().fromBinary(bytes, options)
}
static fromJson(
jsonValue: JsonValue,
options?: Partial<JsonReadOptions>
): PublicShardInfo {
return new PublicShardInfo().fromJson(jsonValue, options)
}
static fromJsonString(
jsonString: string,
options?: Partial<JsonReadOptions>
): PublicShardInfo {
return new PublicShardInfo().fromJsonString(jsonString, options)
}
static equals(
a: PublicShardInfo | PlainMessage<PublicShardInfo> | undefined,
b: PublicShardInfo | PlainMessage<PublicShardInfo> | undefined
): boolean {
return proto3.util.equals(PublicShardInfo, a, b)
}
}
/**
* @generated from message CommunityPublicShardInfo
*/
export class CommunityPublicShardInfo extends Message<CommunityPublicShardInfo> {
/**
* Signature of the payload field
*
* @generated from field: bytes signature = 1;
*/
signature = new Uint8Array(0)
/**
* Marshaled PublicShardInfo
*
* @generated from field: bytes payload = 2;
*/
payload = new Uint8Array(0)
constructor(data?: PartialMessage<CommunityPublicShardInfo>) {
super()
proto3.util.initPartial(data, this)
}
static readonly runtime: typeof proto3 = proto3
static readonly typeName = 'CommunityPublicShardInfo'
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: 'signature', kind: 'scalar', T: 12 /* ScalarType.BYTES */ },
{ no: 2, name: 'payload', kind: 'scalar', T: 12 /* ScalarType.BYTES */ },
])
static fromBinary(
bytes: Uint8Array,
options?: Partial<BinaryReadOptions>
): CommunityPublicShardInfo {
return new CommunityPublicShardInfo().fromBinary(bytes, options)
}
static fromJson(
jsonValue: JsonValue,
options?: Partial<JsonReadOptions>
): CommunityPublicShardInfo {
return new CommunityPublicShardInfo().fromJson(jsonValue, options)
}
static fromJsonString(
jsonString: string,
options?: Partial<JsonReadOptions>
): CommunityPublicShardInfo {
return new CommunityPublicShardInfo().fromJsonString(jsonString, options)
}
static equals(
a:
| CommunityPublicShardInfo
| PlainMessage<CommunityPublicShardInfo>
| undefined,
b:
| CommunityPublicShardInfo
| PlainMessage<CommunityPublicShardInfo>
| undefined
): boolean {
return proto3.util.equals(CommunityPublicShardInfo, a, b)
}
}

View File

@ -2,7 +2,7 @@ import {
AudioMessage_AudioType, AudioMessage_AudioType,
ChatMessage_ContentType, ChatMessage_ContentType,
} from '../protos/chat-message_pb' } from '../protos/chat-message_pb'
import { ImageType, MessageType } from '../protos/enums_pb' import { ImageFormat, MessageType } from '../protos/enums_pb'
import type { import type {
AudioMessage, AudioMessage,
@ -24,7 +24,7 @@ export function validateMessage(message: ChatMessage): boolean {
// fixme? // fixme?
const payload = message.payload.value as ImageMessage const payload = message.payload.value as ImageMessage
if (payload.type === ImageType.UNKNOWN_IMAGE_TYPE) { if (payload.format === ImageFormat.UNKNOWN_IMAGE_FORMAT) {
return false return false
} }