From 526d76fdbfa81d6b837a45df07bd86bcac77c7c9 Mon Sep 17 00:00:00 2001 From: Alexandr Burdiyan Date: Fri, 21 Jun 2024 17:11:25 +0200 Subject: [PATCH] move new apis in v2alpha --- .../genproto/accounts/v1alpha/accounts.pb.go | 369 +- .../accounts/v1alpha/accounts_grpc.pb.go | 90 +- .../genproto/accounts/v2alpha/accounts.pb.go | 390 ++ .../accounts/v2alpha/accounts_grpc.pb.go | 149 + .../documents/v1alpha/documents.pb.go | 2806 ++++-------- .../documents/v1alpha/documents_grpc.pb.go | 560 +-- .../genproto/documents/v2alpha/changes.pb.go | 451 ++ .../documents/v2alpha/changes_grpc.pb.go | 143 + .../genproto/documents/v2alpha/comments.pb.go | 586 +++ .../documents/v2alpha/comments_grpc.pb.go | 181 + .../documents/v2alpha/content_graph.pb.go | 410 ++ .../v2alpha/content_graph_grpc.pb.go | 103 + .../documents/v2alpha/documents.pb.go | 3746 +++++++++++++++++ .../documents/v2alpha/documents_grpc.pb.go | 1000 +++++ .../accounts/v1alpha/accounts_connect.ts | 31 +- .../accounts/v1alpha/accounts_pb.ts | 178 +- .../accounts/v2alpha/accounts_connect.ts | 44 + .../accounts/v2alpha/accounts_pb.ts | 180 + .../documents/v1alpha/documents_connect.ts | 167 +- .../documents/v1alpha/documents_pb.ts | 1134 +---- .../documents/v2alpha/changes_connect.ts | 43 + .../documents/v2alpha/changes_pb.ts | 232 + .../documents/v2alpha/comments_connect.ts | 52 + .../documents/v2alpha/comments_pb.ts | 312 ++ .../v2alpha/content_graph_connect.ts | 28 + .../documents/v2alpha/content_graph_pb.ts | 206 + .../documents/v2alpha/documents_connect.ts | 283 ++ .../documents/v2alpha/documents_pb.ts | 2174 ++++++++++ proto/accounts/v1alpha/accounts.proto | 54 +- proto/accounts/v1alpha/go.gensum | 4 +- proto/accounts/v1alpha/js.gensum | 4 +- proto/accounts/v2alpha/BUILD.plz | 9 + proto/accounts/v2alpha/accounts.proto | 42 + proto/accounts/v2alpha/go.gensum | 2 + proto/accounts/v2alpha/js.gensum | 2 + proto/documents/v1alpha/documents.proto | 337 +- proto/documents/v1alpha/go.gensum | 4 +- proto/documents/v1alpha/js.gensum | 4 +- proto/documents/v2alpha/BUILD.plz | 9 + proto/documents/v2alpha/changes.proto | 65 + proto/documents/v2alpha/comments.proto | 93 + proto/documents/v2alpha/content_graph.proto | 49 + proto/documents/v2alpha/documents.proto | 556 +++ proto/documents/v2alpha/go.gensum | 2 + proto/documents/v2alpha/js.gensum | 2 + 45 files changed, 13303 insertions(+), 3983 deletions(-) create mode 100644 backend/genproto/accounts/v2alpha/accounts.pb.go create mode 100644 backend/genproto/accounts/v2alpha/accounts_grpc.pb.go create mode 100644 backend/genproto/documents/v2alpha/changes.pb.go create mode 100644 backend/genproto/documents/v2alpha/changes_grpc.pb.go create mode 100644 backend/genproto/documents/v2alpha/comments.pb.go create mode 100644 backend/genproto/documents/v2alpha/comments_grpc.pb.go create mode 100644 backend/genproto/documents/v2alpha/content_graph.pb.go create mode 100644 backend/genproto/documents/v2alpha/content_graph_grpc.pb.go create mode 100644 backend/genproto/documents/v2alpha/documents.pb.go create mode 100644 backend/genproto/documents/v2alpha/documents_grpc.pb.go create mode 100644 frontend/packages/shared/src/client/.generated/accounts/v2alpha/accounts_connect.ts create mode 100644 frontend/packages/shared/src/client/.generated/accounts/v2alpha/accounts_pb.ts create mode 100644 frontend/packages/shared/src/client/.generated/documents/v2alpha/changes_connect.ts create mode 100644 frontend/packages/shared/src/client/.generated/documents/v2alpha/changes_pb.ts create mode 100644 frontend/packages/shared/src/client/.generated/documents/v2alpha/comments_connect.ts create mode 100644 frontend/packages/shared/src/client/.generated/documents/v2alpha/comments_pb.ts create mode 100644 frontend/packages/shared/src/client/.generated/documents/v2alpha/content_graph_connect.ts create mode 100644 frontend/packages/shared/src/client/.generated/documents/v2alpha/content_graph_pb.ts create mode 100644 frontend/packages/shared/src/client/.generated/documents/v2alpha/documents_connect.ts create mode 100644 frontend/packages/shared/src/client/.generated/documents/v2alpha/documents_pb.ts create mode 100644 proto/accounts/v2alpha/BUILD.plz create mode 100644 proto/accounts/v2alpha/accounts.proto create mode 100644 proto/accounts/v2alpha/go.gensum create mode 100644 proto/accounts/v2alpha/js.gensum create mode 100644 proto/documents/v2alpha/BUILD.plz create mode 100644 proto/documents/v2alpha/changes.proto create mode 100644 proto/documents/v2alpha/comments.proto create mode 100644 proto/documents/v2alpha/content_graph.proto create mode 100644 proto/documents/v2alpha/documents.proto create mode 100644 proto/documents/v2alpha/go.gensum create mode 100644 proto/documents/v2alpha/js.gensum diff --git a/backend/genproto/accounts/v1alpha/accounts.pb.go b/backend/genproto/accounts/v1alpha/accounts.pb.go index 66bf8a51a..ec83d9f4f 100644 --- a/backend/genproto/accounts/v1alpha/accounts.pb.go +++ b/backend/genproto/accounts/v1alpha/accounts.pb.go @@ -183,10 +183,14 @@ type Account struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Hypermedia Account ID. + // Hyper Media Account ID. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // If there is an unpublished draft for this account's profile document - HasProfileDraft bool `protobuf:"varint,5,opt,name=has_profile_draft,json=hasProfileDraft,proto3" json:"has_profile_draft,omitempty"` + // Profile information of this account. + Profile *Profile `protobuf:"bytes,2,opt,name=profile,proto3" json:"profile,omitempty"` + // List of known devices of this Account. + Devices map[string]*Device `protobuf:"bytes,3,rep,name=devices,proto3" json:"devices,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Defining if the account is trusted or not. + IsTrusted bool `protobuf:"varint,4,opt,name=is_trusted,json=isTrusted,proto3" json:"is_trusted,omitempty"` } func (x *Account) Reset() { @@ -228,9 +232,205 @@ func (x *Account) GetId() string { return "" } -func (x *Account) GetHasProfileDraft() bool { +func (x *Account) GetProfile() *Profile { if x != nil { - return x.HasProfileDraft + return x.Profile + } + return nil +} + +func (x *Account) GetDevices() map[string]*Device { + if x != nil { + return x.Devices + } + return nil +} + +func (x *Account) GetIsTrusted() bool { + if x != nil { + return x.IsTrusted + } + return false +} + +// Profile information of the user Account. +type Profile struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Optional. Alias is a user-defined handle for their profile. + // There's no enforcement on this being unique. + Alias string `protobuf:"bytes,1,opt,name=alias,proto3" json:"alias,omitempty"` + // Optional. Description of the user's profile. + Bio string `protobuf:"bytes,2,opt,name=bio,proto3" json:"bio,omitempty"` + // Optional. CID to the avatar image hosted on IPFS. + Avatar string `protobuf:"bytes,3,opt,name=avatar,proto3" json:"avatar,omitempty"` + // Optional. Hypermedia ID of the Account's root/entrypoint document. + RootDocument string `protobuf:"bytes,4,opt,name=root_document,json=rootDocument,proto3" json:"root_document,omitempty"` +} + +func (x *Profile) Reset() { + *x = Profile{} + if protoimpl.UnsafeEnabled { + mi := &file_accounts_v1alpha_accounts_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Profile) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Profile) ProtoMessage() {} + +func (x *Profile) ProtoReflect() protoreflect.Message { + mi := &file_accounts_v1alpha_accounts_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Profile.ProtoReflect.Descriptor instead. +func (*Profile) Descriptor() ([]byte, []int) { + return file_accounts_v1alpha_accounts_proto_rawDescGZIP(), []int{4} +} + +func (x *Profile) GetAlias() string { + if x != nil { + return x.Alias + } + return "" +} + +func (x *Profile) GetBio() string { + if x != nil { + return x.Bio + } + return "" +} + +func (x *Profile) GetAvatar() string { + if x != nil { + return x.Avatar + } + return "" +} + +func (x *Profile) GetRootDocument() string { + if x != nil { + return x.RootDocument + } + return "" +} + +type Device struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // CID-encoded Peer ID of this device. + DeviceId string `protobuf:"bytes,1,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"` +} + +func (x *Device) Reset() { + *x = Device{} + if protoimpl.UnsafeEnabled { + mi := &file_accounts_v1alpha_accounts_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Device) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Device) ProtoMessage() {} + +func (x *Device) ProtoReflect() protoreflect.Message { + mi := &file_accounts_v1alpha_accounts_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Device.ProtoReflect.Descriptor instead. +func (*Device) Descriptor() ([]byte, []int) { + return file_accounts_v1alpha_accounts_proto_rawDescGZIP(), []int{5} +} + +func (x *Device) GetDeviceId() string { + if x != nil { + return x.DeviceId + } + return "" +} + +type SetAccountTrustRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ID of the Account to trust/untrust. + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Whether to trust or not the account. + IsTrusted bool `protobuf:"varint,2,opt,name=is_trusted,json=isTrusted,proto3" json:"is_trusted,omitempty"` +} + +func (x *SetAccountTrustRequest) Reset() { + *x = SetAccountTrustRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_accounts_v1alpha_accounts_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetAccountTrustRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetAccountTrustRequest) ProtoMessage() {} + +func (x *SetAccountTrustRequest) ProtoReflect() protoreflect.Message { + mi := &file_accounts_v1alpha_accounts_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetAccountTrustRequest.ProtoReflect.Descriptor instead. +func (*SetAccountTrustRequest) Descriptor() ([]byte, []int) { + return file_accounts_v1alpha_accounts_proto_rawDescGZIP(), []int{6} +} + +func (x *SetAccountTrustRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *SetAccountTrustRequest) GetIsTrusted() bool { + if x != nil { + return x.IsTrusted } return false } @@ -257,29 +457,69 @@ var file_accounts_v1alpha_accounts_proto_rawDesc = []byte{ 0x6e, 0x74, 0x52, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x45, 0x0a, 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x2a, 0x0a, 0x11, 0x68, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x64, - 0x72, 0x61, 0x66, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x68, 0x61, 0x73, 0x50, - 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x32, 0xdb, 0x01, 0x0a, 0x08, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x5e, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2c, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, - 0x64, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, + 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xa0, 0x02, 0x0a, 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x3c, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x50, 0x72, + 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x49, + 0x0a, 0x07, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x2f, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x07, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, + 0x74, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, + 0x73, 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x1a, 0x5d, 0x0a, 0x0c, 0x44, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x37, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, + 0x73, 0x65, 0x65, 0x64, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x6e, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x69, 0x6f, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x62, 0x69, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, + 0x61, 0x74, 0x61, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, + 0x61, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x6f, 0x6f, 0x74, 0x5f, 0x64, 0x6f, 0x63, 0x75, 0x6d, + 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x6f, 0x6f, 0x74, 0x44, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x25, 0x0a, 0x06, 0x44, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x22, 0x47, + 0x0a, 0x16, 0x53, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x72, 0x75, 0x73, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x74, + 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, + 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x32, 0x9e, 0x03, 0x0a, 0x08, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x73, 0x12, 0x5e, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x12, 0x2c, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x47, + 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x22, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x57, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, + 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x22, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, + 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x1a, 0x22, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, + 0x73, 0x65, 0x65, 0x64, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x6f, 0x0a, + 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x2e, 0x2e, + 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, + 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x68, + 0x0a, 0x0f, 0x53, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x72, 0x75, 0x73, + 0x74, 0x12, 0x31, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x65, + 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x72, 0x75, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x6f, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, - 0x65, 0x65, 0x64, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, - 0x65, 0x65, 0x64, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x31, 0x5a, 0x2f, 0x73, 0x65, 0x65, - 0x64, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x3b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x31, 0x5a, 0x2f, 0x73, 0x65, 0x65, 0x64, + 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x3b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -294,24 +534,35 @@ func file_accounts_v1alpha_accounts_proto_rawDescGZIP() []byte { return file_accounts_v1alpha_accounts_proto_rawDescData } -var file_accounts_v1alpha_accounts_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_accounts_v1alpha_accounts_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_accounts_v1alpha_accounts_proto_goTypes = []interface{}{ - (*GetAccountRequest)(nil), // 0: com.seed.accounts.v1alpha.GetAccountRequest - (*ListAccountsRequest)(nil), // 1: com.seed.accounts.v1alpha.ListAccountsRequest - (*ListAccountsResponse)(nil), // 2: com.seed.accounts.v1alpha.ListAccountsResponse - (*Account)(nil), // 3: com.seed.accounts.v1alpha.Account + (*GetAccountRequest)(nil), // 0: com.seed.accounts.v1alpha.GetAccountRequest + (*ListAccountsRequest)(nil), // 1: com.seed.accounts.v1alpha.ListAccountsRequest + (*ListAccountsResponse)(nil), // 2: com.seed.accounts.v1alpha.ListAccountsResponse + (*Account)(nil), // 3: com.seed.accounts.v1alpha.Account + (*Profile)(nil), // 4: com.seed.accounts.v1alpha.Profile + (*Device)(nil), // 5: com.seed.accounts.v1alpha.Device + (*SetAccountTrustRequest)(nil), // 6: com.seed.accounts.v1alpha.SetAccountTrustRequest + nil, // 7: com.seed.accounts.v1alpha.Account.DevicesEntry } var file_accounts_v1alpha_accounts_proto_depIdxs = []int32{ 3, // 0: com.seed.accounts.v1alpha.ListAccountsResponse.accounts:type_name -> com.seed.accounts.v1alpha.Account - 0, // 1: com.seed.accounts.v1alpha.Accounts.GetAccount:input_type -> com.seed.accounts.v1alpha.GetAccountRequest - 1, // 2: com.seed.accounts.v1alpha.Accounts.ListAccounts:input_type -> com.seed.accounts.v1alpha.ListAccountsRequest - 3, // 3: com.seed.accounts.v1alpha.Accounts.GetAccount:output_type -> com.seed.accounts.v1alpha.Account - 2, // 4: com.seed.accounts.v1alpha.Accounts.ListAccounts:output_type -> com.seed.accounts.v1alpha.ListAccountsResponse - 3, // [3:5] is the sub-list for method output_type - 1, // [1:3] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 4, // 1: com.seed.accounts.v1alpha.Account.profile:type_name -> com.seed.accounts.v1alpha.Profile + 7, // 2: com.seed.accounts.v1alpha.Account.devices:type_name -> com.seed.accounts.v1alpha.Account.DevicesEntry + 5, // 3: com.seed.accounts.v1alpha.Account.DevicesEntry.value:type_name -> com.seed.accounts.v1alpha.Device + 0, // 4: com.seed.accounts.v1alpha.Accounts.GetAccount:input_type -> com.seed.accounts.v1alpha.GetAccountRequest + 4, // 5: com.seed.accounts.v1alpha.Accounts.UpdateProfile:input_type -> com.seed.accounts.v1alpha.Profile + 1, // 6: com.seed.accounts.v1alpha.Accounts.ListAccounts:input_type -> com.seed.accounts.v1alpha.ListAccountsRequest + 6, // 7: com.seed.accounts.v1alpha.Accounts.SetAccountTrust:input_type -> com.seed.accounts.v1alpha.SetAccountTrustRequest + 3, // 8: com.seed.accounts.v1alpha.Accounts.GetAccount:output_type -> com.seed.accounts.v1alpha.Account + 3, // 9: com.seed.accounts.v1alpha.Accounts.UpdateProfile:output_type -> com.seed.accounts.v1alpha.Account + 2, // 10: com.seed.accounts.v1alpha.Accounts.ListAccounts:output_type -> com.seed.accounts.v1alpha.ListAccountsResponse + 3, // 11: com.seed.accounts.v1alpha.Accounts.SetAccountTrust:output_type -> com.seed.accounts.v1alpha.Account + 8, // [8:12] is the sub-list for method output_type + 4, // [4:8] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_accounts_v1alpha_accounts_proto_init() } @@ -368,6 +619,42 @@ func file_accounts_v1alpha_accounts_proto_init() { return nil } } + file_accounts_v1alpha_accounts_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Profile); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_accounts_v1alpha_accounts_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Device); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_accounts_v1alpha_accounts_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetAccountTrustRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -375,7 +662,7 @@ func file_accounts_v1alpha_accounts_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_accounts_v1alpha_accounts_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 8, NumExtensions: 0, NumServices: 1, }, diff --git a/backend/genproto/accounts/v1alpha/accounts_grpc.pb.go b/backend/genproto/accounts/v1alpha/accounts_grpc.pb.go index 318bea3f5..77947d5eb 100644 --- a/backend/genproto/accounts/v1alpha/accounts_grpc.pb.go +++ b/backend/genproto/accounts/v1alpha/accounts_grpc.pb.go @@ -25,10 +25,19 @@ type AccountsClient interface { // Lookup an Account information across the already known accounts. // Can also be used to retrieve our own account. GetAccount(ctx context.Context, in *GetAccountRequest, opts ...grpc.CallOption) (*Account, error) - // List accounts known to the backend. New accounts can be discovered naturally by + // Updates profile information of our own Account. + // Doesn't support partial updates! + // Users should call GetAccount first, + // change the necessary fields in place, + // and then send the same Profile object back to UpdateProfile. + UpdateProfile(ctx context.Context, in *Profile, opts ...grpc.CallOption) (*Account, error) + // List accounts known to the backend (excluding our own account). New accounts can be discovered naturally by // interacting with the network, or users can ask to discover specific accounts using // the Networking API. ListAccounts(ctx context.Context, in *ListAccountsRequest, opts ...grpc.CallOption) (*ListAccountsResponse, error) + // Set or unset the trustness of an account. An account is untrusted by default except for our own. + // Returns the modified account. + SetAccountTrust(ctx context.Context, in *SetAccountTrustRequest, opts ...grpc.CallOption) (*Account, error) } type accountsClient struct { @@ -48,6 +57,15 @@ func (c *accountsClient) GetAccount(ctx context.Context, in *GetAccountRequest, return out, nil } +func (c *accountsClient) UpdateProfile(ctx context.Context, in *Profile, opts ...grpc.CallOption) (*Account, error) { + out := new(Account) + err := c.cc.Invoke(ctx, "/com.seed.accounts.v1alpha.Accounts/UpdateProfile", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *accountsClient) ListAccounts(ctx context.Context, in *ListAccountsRequest, opts ...grpc.CallOption) (*ListAccountsResponse, error) { out := new(ListAccountsResponse) err := c.cc.Invoke(ctx, "/com.seed.accounts.v1alpha.Accounts/ListAccounts", in, out, opts...) @@ -57,6 +75,15 @@ func (c *accountsClient) ListAccounts(ctx context.Context, in *ListAccountsReque return out, nil } +func (c *accountsClient) SetAccountTrust(ctx context.Context, in *SetAccountTrustRequest, opts ...grpc.CallOption) (*Account, error) { + out := new(Account) + err := c.cc.Invoke(ctx, "/com.seed.accounts.v1alpha.Accounts/SetAccountTrust", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // AccountsServer is the server API for Accounts service. // All implementations should embed UnimplementedAccountsServer // for forward compatibility @@ -64,10 +91,19 @@ type AccountsServer interface { // Lookup an Account information across the already known accounts. // Can also be used to retrieve our own account. GetAccount(context.Context, *GetAccountRequest) (*Account, error) - // List accounts known to the backend. New accounts can be discovered naturally by + // Updates profile information of our own Account. + // Doesn't support partial updates! + // Users should call GetAccount first, + // change the necessary fields in place, + // and then send the same Profile object back to UpdateProfile. + UpdateProfile(context.Context, *Profile) (*Account, error) + // List accounts known to the backend (excluding our own account). New accounts can be discovered naturally by // interacting with the network, or users can ask to discover specific accounts using // the Networking API. ListAccounts(context.Context, *ListAccountsRequest) (*ListAccountsResponse, error) + // Set or unset the trustness of an account. An account is untrusted by default except for our own. + // Returns the modified account. + SetAccountTrust(context.Context, *SetAccountTrustRequest) (*Account, error) } // UnimplementedAccountsServer should be embedded to have forward compatible implementations. @@ -77,9 +113,15 @@ type UnimplementedAccountsServer struct { func (UnimplementedAccountsServer) GetAccount(context.Context, *GetAccountRequest) (*Account, error) { return nil, status.Errorf(codes.Unimplemented, "method GetAccount not implemented") } +func (UnimplementedAccountsServer) UpdateProfile(context.Context, *Profile) (*Account, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateProfile not implemented") +} func (UnimplementedAccountsServer) ListAccounts(context.Context, *ListAccountsRequest) (*ListAccountsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListAccounts not implemented") } +func (UnimplementedAccountsServer) SetAccountTrust(context.Context, *SetAccountTrustRequest) (*Account, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetAccountTrust not implemented") +} // UnsafeAccountsServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to AccountsServer will @@ -110,6 +152,24 @@ func _Accounts_GetAccount_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _Accounts_UpdateProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Profile) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AccountsServer).UpdateProfile(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.accounts.v1alpha.Accounts/UpdateProfile", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AccountsServer).UpdateProfile(ctx, req.(*Profile)) + } + return interceptor(ctx, in, info, handler) +} + func _Accounts_ListAccounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListAccountsRequest) if err := dec(in); err != nil { @@ -128,6 +188,24 @@ func _Accounts_ListAccounts_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _Accounts_SetAccountTrust_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetAccountTrustRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AccountsServer).SetAccountTrust(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.accounts.v1alpha.Accounts/SetAccountTrust", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AccountsServer).SetAccountTrust(ctx, req.(*SetAccountTrustRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Accounts_ServiceDesc is the grpc.ServiceDesc for Accounts service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -139,10 +217,18 @@ var Accounts_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetAccount", Handler: _Accounts_GetAccount_Handler, }, + { + MethodName: "UpdateProfile", + Handler: _Accounts_UpdateProfile_Handler, + }, { MethodName: "ListAccounts", Handler: _Accounts_ListAccounts_Handler, }, + { + MethodName: "SetAccountTrust", + Handler: _Accounts_SetAccountTrust_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "accounts/v1alpha/accounts.proto", diff --git a/backend/genproto/accounts/v2alpha/accounts.pb.go b/backend/genproto/accounts/v2alpha/accounts.pb.go new file mode 100644 index 000000000..5178d4369 --- /dev/null +++ b/backend/genproto/accounts/v2alpha/accounts.pb.go @@ -0,0 +1,390 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v4.24.4 +// source: accounts/v2alpha/accounts.proto + +package accounts + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type GetAccountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ID of the Account to be looked up. If empty - our own account will be returned. + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *GetAccountRequest) Reset() { + *x = GetAccountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_accounts_v2alpha_accounts_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAccountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAccountRequest) ProtoMessage() {} + +func (x *GetAccountRequest) ProtoReflect() protoreflect.Message { + mi := &file_accounts_v2alpha_accounts_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAccountRequest.ProtoReflect.Descriptor instead. +func (*GetAccountRequest) Descriptor() ([]byte, []int) { + return file_accounts_v2alpha_accounts_proto_rawDescGZIP(), []int{0} +} + +func (x *GetAccountRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type ListAccountsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` +} + +func (x *ListAccountsRequest) Reset() { + *x = ListAccountsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_accounts_v2alpha_accounts_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListAccountsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAccountsRequest) ProtoMessage() {} + +func (x *ListAccountsRequest) ProtoReflect() protoreflect.Message { + mi := &file_accounts_v2alpha_accounts_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAccountsRequest.ProtoReflect.Descriptor instead. +func (*ListAccountsRequest) Descriptor() ([]byte, []int) { + return file_accounts_v2alpha_accounts_proto_rawDescGZIP(), []int{1} +} + +func (x *ListAccountsRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListAccountsRequest) GetPageToken() string { + if x != nil { + return x.PageToken + } + return "" +} + +type ListAccountsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Accounts []*Account `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"` + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` +} + +func (x *ListAccountsResponse) Reset() { + *x = ListAccountsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_accounts_v2alpha_accounts_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListAccountsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAccountsResponse) ProtoMessage() {} + +func (x *ListAccountsResponse) ProtoReflect() protoreflect.Message { + mi := &file_accounts_v2alpha_accounts_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAccountsResponse.ProtoReflect.Descriptor instead. +func (*ListAccountsResponse) Descriptor() ([]byte, []int) { + return file_accounts_v2alpha_accounts_proto_rawDescGZIP(), []int{2} +} + +func (x *ListAccountsResponse) GetAccounts() []*Account { + if x != nil { + return x.Accounts + } + return nil +} + +func (x *ListAccountsResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +type Account struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Hypermedia Account ID. + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // If there is an unpublished draft for this account's profile document + HasProfileDraft bool `protobuf:"varint,5,opt,name=has_profile_draft,json=hasProfileDraft,proto3" json:"has_profile_draft,omitempty"` +} + +func (x *Account) Reset() { + *x = Account{} + if protoimpl.UnsafeEnabled { + mi := &file_accounts_v2alpha_accounts_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Account) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Account) ProtoMessage() {} + +func (x *Account) ProtoReflect() protoreflect.Message { + mi := &file_accounts_v2alpha_accounts_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Account.ProtoReflect.Descriptor instead. +func (*Account) Descriptor() ([]byte, []int) { + return file_accounts_v2alpha_accounts_proto_rawDescGZIP(), []int{3} +} + +func (x *Account) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Account) GetHasProfileDraft() bool { + if x != nil { + return x.HasProfileDraft + } + return false +} + +var File_accounts_v2alpha_accounts_proto protoreflect.FileDescriptor + +var file_accounts_v2alpha_accounts_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x32, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x22, 0x23, 0x0a, 0x11, + 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, + 0x64, 0x22, 0x51, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, + 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, + 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x7e, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x08, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, + 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x52, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x26, 0x0a, 0x0f, + 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x45, 0x0a, 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x2a, 0x0a, 0x11, 0x68, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x64, + 0x72, 0x61, 0x66, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x68, 0x61, 0x73, 0x50, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x32, 0xdb, 0x01, 0x0a, 0x08, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x5e, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2c, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, + 0x64, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x6f, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, + 0x65, 0x65, 0x64, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, + 0x65, 0x65, 0x64, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x31, 0x5a, 0x2f, 0x73, 0x65, 0x65, + 0x64, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x32, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x3b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_accounts_v2alpha_accounts_proto_rawDescOnce sync.Once + file_accounts_v2alpha_accounts_proto_rawDescData = file_accounts_v2alpha_accounts_proto_rawDesc +) + +func file_accounts_v2alpha_accounts_proto_rawDescGZIP() []byte { + file_accounts_v2alpha_accounts_proto_rawDescOnce.Do(func() { + file_accounts_v2alpha_accounts_proto_rawDescData = protoimpl.X.CompressGZIP(file_accounts_v2alpha_accounts_proto_rawDescData) + }) + return file_accounts_v2alpha_accounts_proto_rawDescData +} + +var file_accounts_v2alpha_accounts_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_accounts_v2alpha_accounts_proto_goTypes = []interface{}{ + (*GetAccountRequest)(nil), // 0: com.seed.accounts.v2alpha.GetAccountRequest + (*ListAccountsRequest)(nil), // 1: com.seed.accounts.v2alpha.ListAccountsRequest + (*ListAccountsResponse)(nil), // 2: com.seed.accounts.v2alpha.ListAccountsResponse + (*Account)(nil), // 3: com.seed.accounts.v2alpha.Account +} +var file_accounts_v2alpha_accounts_proto_depIdxs = []int32{ + 3, // 0: com.seed.accounts.v2alpha.ListAccountsResponse.accounts:type_name -> com.seed.accounts.v2alpha.Account + 0, // 1: com.seed.accounts.v2alpha.Accounts.GetAccount:input_type -> com.seed.accounts.v2alpha.GetAccountRequest + 1, // 2: com.seed.accounts.v2alpha.Accounts.ListAccounts:input_type -> com.seed.accounts.v2alpha.ListAccountsRequest + 3, // 3: com.seed.accounts.v2alpha.Accounts.GetAccount:output_type -> com.seed.accounts.v2alpha.Account + 2, // 4: com.seed.accounts.v2alpha.Accounts.ListAccounts:output_type -> com.seed.accounts.v2alpha.ListAccountsResponse + 3, // [3:5] is the sub-list for method output_type + 1, // [1:3] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_accounts_v2alpha_accounts_proto_init() } +func file_accounts_v2alpha_accounts_proto_init() { + if File_accounts_v2alpha_accounts_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_accounts_v2alpha_accounts_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAccountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_accounts_v2alpha_accounts_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListAccountsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_accounts_v2alpha_accounts_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListAccountsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_accounts_v2alpha_accounts_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Account); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_accounts_v2alpha_accounts_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_accounts_v2alpha_accounts_proto_goTypes, + DependencyIndexes: file_accounts_v2alpha_accounts_proto_depIdxs, + MessageInfos: file_accounts_v2alpha_accounts_proto_msgTypes, + }.Build() + File_accounts_v2alpha_accounts_proto = out.File + file_accounts_v2alpha_accounts_proto_rawDesc = nil + file_accounts_v2alpha_accounts_proto_goTypes = nil + file_accounts_v2alpha_accounts_proto_depIdxs = nil +} diff --git a/backend/genproto/accounts/v2alpha/accounts_grpc.pb.go b/backend/genproto/accounts/v2alpha/accounts_grpc.pb.go new file mode 100644 index 000000000..2bba6e543 --- /dev/null +++ b/backend/genproto/accounts/v2alpha/accounts_grpc.pb.go @@ -0,0 +1,149 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v4.24.4 +// source: accounts/v2alpha/accounts.proto + +package accounts + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// AccountsClient is the client API for Accounts service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type AccountsClient interface { + // Lookup an Account information across the already known accounts. + // Can also be used to retrieve our own account. + GetAccount(ctx context.Context, in *GetAccountRequest, opts ...grpc.CallOption) (*Account, error) + // List accounts known to the backend. New accounts can be discovered naturally by + // interacting with the network, or users can ask to discover specific accounts using + // the Networking API. + ListAccounts(ctx context.Context, in *ListAccountsRequest, opts ...grpc.CallOption) (*ListAccountsResponse, error) +} + +type accountsClient struct { + cc grpc.ClientConnInterface +} + +func NewAccountsClient(cc grpc.ClientConnInterface) AccountsClient { + return &accountsClient{cc} +} + +func (c *accountsClient) GetAccount(ctx context.Context, in *GetAccountRequest, opts ...grpc.CallOption) (*Account, error) { + out := new(Account) + err := c.cc.Invoke(ctx, "/com.seed.accounts.v2alpha.Accounts/GetAccount", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *accountsClient) ListAccounts(ctx context.Context, in *ListAccountsRequest, opts ...grpc.CallOption) (*ListAccountsResponse, error) { + out := new(ListAccountsResponse) + err := c.cc.Invoke(ctx, "/com.seed.accounts.v2alpha.Accounts/ListAccounts", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AccountsServer is the server API for Accounts service. +// All implementations should embed UnimplementedAccountsServer +// for forward compatibility +type AccountsServer interface { + // Lookup an Account information across the already known accounts. + // Can also be used to retrieve our own account. + GetAccount(context.Context, *GetAccountRequest) (*Account, error) + // List accounts known to the backend. New accounts can be discovered naturally by + // interacting with the network, or users can ask to discover specific accounts using + // the Networking API. + ListAccounts(context.Context, *ListAccountsRequest) (*ListAccountsResponse, error) +} + +// UnimplementedAccountsServer should be embedded to have forward compatible implementations. +type UnimplementedAccountsServer struct { +} + +func (UnimplementedAccountsServer) GetAccount(context.Context, *GetAccountRequest) (*Account, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAccount not implemented") +} +func (UnimplementedAccountsServer) ListAccounts(context.Context, *ListAccountsRequest) (*ListAccountsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListAccounts not implemented") +} + +// UnsafeAccountsServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AccountsServer will +// result in compilation errors. +type UnsafeAccountsServer interface { + mustEmbedUnimplementedAccountsServer() +} + +func RegisterAccountsServer(s grpc.ServiceRegistrar, srv AccountsServer) { + s.RegisterService(&Accounts_ServiceDesc, srv) +} + +func _Accounts_GetAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAccountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AccountsServer).GetAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.accounts.v2alpha.Accounts/GetAccount", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AccountsServer).GetAccount(ctx, req.(*GetAccountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Accounts_ListAccounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListAccountsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AccountsServer).ListAccounts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.accounts.v2alpha.Accounts/ListAccounts", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AccountsServer).ListAccounts(ctx, req.(*ListAccountsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Accounts_ServiceDesc is the grpc.ServiceDesc for Accounts service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Accounts_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "com.seed.accounts.v2alpha.Accounts", + HandlerType: (*AccountsServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetAccount", + Handler: _Accounts_GetAccount_Handler, + }, + { + MethodName: "ListAccounts", + Handler: _Accounts_ListAccounts_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "accounts/v2alpha/accounts.proto", +} diff --git a/backend/genproto/documents/v1alpha/documents.pb.go b/backend/genproto/documents/v1alpha/documents.pb.go index e6a81e0a9..ff651a0ef 100644 --- a/backend/genproto/documents/v1alpha/documents.pb.go +++ b/backend/genproto/documents/v1alpha/documents.pb.go @@ -22,75 +22,19 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// Relationship between a document and an account -type RoleType int32 - -const ( - // No permissions. - RoleType_ROLE_UNSPECIFIED RoleType = 0 - // The role for an owner. All permissions are granted. - RoleType_OWNER RoleType = 1 - // Allowed to invite/remove writers+collaborators, edit content, and merge suggested changes - RoleType_EDITOR RoleType = 2 - // Allowed to change content - RoleType_WRITER RoleType = 3 - // Their comments and suggested changes will be distributed alongside the document - RoleType_COLLABORATOR RoleType = 4 -) - -// Enum value maps for RoleType. -var ( - RoleType_name = map[int32]string{ - 0: "ROLE_UNSPECIFIED", - 1: "OWNER", - 2: "EDITOR", - 3: "WRITER", - 4: "COLLABORATOR", - } - RoleType_value = map[string]int32{ - "ROLE_UNSPECIFIED": 0, - "OWNER": 1, - "EDITOR": 2, - "WRITER": 3, - "COLLABORATOR": 4, - } -) - -func (x RoleType) Enum() *RoleType { - p := new(RoleType) - *p = x - return p -} - -func (x RoleType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (RoleType) Descriptor() protoreflect.EnumDescriptor { - return file_documents_v1alpha_documents_proto_enumTypes[0].Descriptor() -} - -func (RoleType) Type() protoreflect.EnumType { - return &file_documents_v1alpha_documents_proto_enumTypes[0] -} - -func (x RoleType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use RoleType.Descriptor instead. -func (RoleType) EnumDescriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{0} -} - -// Request to create a new draft for an existing standalone branch +// Request to create a new draft. type CreateDraftRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Required. ID of the document branch that will be updated. - DocumentId string `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` + // Optional. Existing Document ID can be specified to update + // previously published document. A draft will be created + // with the content of the most recent known version. + ExistingDocumentId string `protobuf:"bytes,1,opt,name=existing_document_id,json=existingDocumentId,proto3" json:"existing_document_id,omitempty"` + // Optional. Version of the existing document to create draft from. + // If version is specified existing_document_id must also be specified. + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` } func (x *CreateDraftRequest) Reset() { @@ -125,195 +69,34 @@ func (*CreateDraftRequest) Descriptor() ([]byte, []int) { return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{0} } -func (x *CreateDraftRequest) GetDocumentId() string { - if x != nil { - return x.DocumentId - } - return "" -} - -// Request to create a draft for a new standalone branch, optionally based on an existing document. -type CreateBranchDraftRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Optional. Document which will be branched from. If not specified, a new document will be created. - DocumentId string `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` - // Optional. Version of the existing document to create draft from. - // If version is specified, document_id must also be specified. - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` -} - -func (x *CreateBranchDraftRequest) Reset() { - *x = CreateBranchDraftRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateBranchDraftRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateBranchDraftRequest) ProtoMessage() {} - -func (x *CreateBranchDraftRequest) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateBranchDraftRequest.ProtoReflect.Descriptor instead. -func (*CreateBranchDraftRequest) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{1} -} - -func (x *CreateBranchDraftRequest) GetDocumentId() string { +func (x *CreateDraftRequest) GetExistingDocumentId() string { if x != nil { - return x.DocumentId + return x.ExistingDocumentId } return "" } -func (x *CreateBranchDraftRequest) GetVersion() string { +func (x *CreateDraftRequest) GetVersion() string { if x != nil { return x.Version } return "" } -// Request to create a new branch which will be saved to the index of another document. -// If this path already exists in the parent, the index will be updated when the draft is published. -// If this path does not exist in the parent, the index will be created when the draft is published. -type CreateIndexDraftRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Required. ID of the parent document. - DocumentId string `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` - // Required. Path of the document to create a draft for. May include slashes to represent a deep index. - Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` -} - -func (x *CreateIndexDraftRequest) Reset() { - *x = CreateIndexDraftRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateIndexDraftRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateIndexDraftRequest) ProtoMessage() {} - -func (x *CreateIndexDraftRequest) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateIndexDraftRequest.ProtoReflect.Descriptor instead. -func (*CreateIndexDraftRequest) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{2} -} - -func (x *CreateIndexDraftRequest) GetDocumentId() string { - if x != nil { - return x.DocumentId - } - return "" -} - -func (x *CreateIndexDraftRequest) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -// Request to create a draft for a profile document. -type CreateProfileDraftRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Required. Account ID to create a profile draft for. - AccountId string `protobuf:"bytes,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` -} - -func (x *CreateProfileDraftRequest) Reset() { - *x = CreateProfileDraftRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateProfileDraftRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateProfileDraftRequest) ProtoMessage() {} - -func (x *CreateProfileDraftRequest) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateProfileDraftRequest.ProtoReflect.Descriptor instead. -func (*CreateProfileDraftRequest) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{3} -} - -func (x *CreateProfileDraftRequest) GetAccountId() string { - if x != nil { - return x.AccountId - } - return "" -} - // Request to delete an existing draft. type DeleteDraftRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Required. ID of the branch to delete. - BranchId string `protobuf:"bytes,1,opt,name=branch_id,json=branchId,proto3" json:"branch_id,omitempty"` + // ID of the document whose draft needs to be deleted. Only one + DocumentId string `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` } func (x *DeleteDraftRequest) Reset() { *x = DeleteDraftRequest{} if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[4] + mi := &file_documents_v1alpha_documents_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -326,7 +109,7 @@ func (x *DeleteDraftRequest) String() string { func (*DeleteDraftRequest) ProtoMessage() {} func (x *DeleteDraftRequest) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[4] + mi := &file_documents_v1alpha_documents_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -339,12 +122,12 @@ func (x *DeleteDraftRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteDraftRequest.ProtoReflect.Descriptor instead. func (*DeleteDraftRequest) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{4} + return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{1} } -func (x *DeleteDraftRequest) GetBranchId() string { +func (x *DeleteDraftRequest) GetDocumentId() string { if x != nil { - return x.BranchId + return x.DocumentId } return "" } @@ -355,14 +138,14 @@ type GetDraftRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Required. ID of the draft that was previously created. - DraftId string `protobuf:"bytes,1,opt,name=draft_id,json=draftId,proto3" json:"draft_id,omitempty"` + // ID of the document for which draft was previously created. + DocumentId string `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` } func (x *GetDraftRequest) Reset() { *x = GetDraftRequest{} if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[5] + mi := &file_documents_v1alpha_documents_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -375,7 +158,7 @@ func (x *GetDraftRequest) String() string { func (*GetDraftRequest) ProtoMessage() {} func (x *GetDraftRequest) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[5] + mi := &file_documents_v1alpha_documents_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -388,61 +171,12 @@ func (x *GetDraftRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetDraftRequest.ProtoReflect.Descriptor instead. func (*GetDraftRequest) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{5} -} - -func (x *GetDraftRequest) GetDraftId() string { - if x != nil { - return x.DraftId - } - return "" -} - -// Request the draft for an account's profile document -type GetProfileDraftRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Required. Account ID to get the profile draft for. - AccountId string `protobuf:"bytes,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` -} - -func (x *GetProfileDraftRequest) Reset() { - *x = GetProfileDraftRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetProfileDraftRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetProfileDraftRequest) ProtoMessage() {} - -func (x *GetProfileDraftRequest) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetProfileDraftRequest.ProtoReflect.Descriptor instead. -func (*GetProfileDraftRequest) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{6} + return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{2} } -func (x *GetProfileDraftRequest) GetAccountId() string { +func (x *GetDraftRequest) GetDocumentId() string { if x != nil { - return x.AccountId + return x.DocumentId } return "" } @@ -462,7 +196,7 @@ type UpdateDraftRequest struct { func (x *UpdateDraftRequest) Reset() { *x = UpdateDraftRequest{} if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[7] + mi := &file_documents_v1alpha_documents_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -475,7 +209,7 @@ func (x *UpdateDraftRequest) String() string { func (*UpdateDraftRequest) ProtoMessage() {} func (x *UpdateDraftRequest) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[7] + mi := &file_documents_v1alpha_documents_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -488,7 +222,7 @@ func (x *UpdateDraftRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateDraftRequest.ProtoReflect.Descriptor instead. func (*UpdateDraftRequest) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{7} + return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{3} } func (x *UpdateDraftRequest) GetDocumentId() string { @@ -520,7 +254,7 @@ type UpdateDraftResponse struct { func (x *UpdateDraftResponse) Reset() { *x = UpdateDraftResponse{} if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[8] + mi := &file_documents_v1alpha_documents_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -533,7 +267,7 @@ func (x *UpdateDraftResponse) String() string { func (*UpdateDraftResponse) ProtoMessage() {} func (x *UpdateDraftResponse) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[8] + mi := &file_documents_v1alpha_documents_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -546,7 +280,7 @@ func (x *UpdateDraftResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateDraftResponse.ProtoReflect.Descriptor instead. func (*UpdateDraftResponse) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{8} + return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{4} } func (x *UpdateDraftResponse) GetChangeId() string { @@ -571,19 +305,17 @@ type DocumentChange struct { // Types that are assignable to Op: // - // *DocumentChange_SetMetadata_ - // *DocumentChange_SetIndex_ + // *DocumentChange_SetTitle // *DocumentChange_MoveBlock_ // *DocumentChange_ReplaceBlock // *DocumentChange_DeleteBlock - // *DocumentChange_UpdateMember_ Op isDocumentChange_Op `protobuf_oneof:"op"` } func (x *DocumentChange) Reset() { *x = DocumentChange{} if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[9] + mi := &file_documents_v1alpha_documents_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -596,7 +328,7 @@ func (x *DocumentChange) String() string { func (*DocumentChange) ProtoMessage() {} func (x *DocumentChange) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[9] + mi := &file_documents_v1alpha_documents_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -609,7 +341,7 @@ func (x *DocumentChange) ProtoReflect() protoreflect.Message { // Deprecated: Use DocumentChange.ProtoReflect.Descriptor instead. func (*DocumentChange) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{9} + return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{5} } func (m *DocumentChange) GetOp() isDocumentChange_Op { @@ -619,18 +351,11 @@ func (m *DocumentChange) GetOp() isDocumentChange_Op { return nil } -func (x *DocumentChange) GetSetMetadata() *DocumentChange_SetMetadata { - if x, ok := x.GetOp().(*DocumentChange_SetMetadata_); ok { - return x.SetMetadata +func (x *DocumentChange) GetSetTitle() string { + if x, ok := x.GetOp().(*DocumentChange_SetTitle); ok { + return x.SetTitle } - return nil -} - -func (x *DocumentChange) GetSetIndex() *DocumentChange_SetIndex { - if x, ok := x.GetOp().(*DocumentChange_SetIndex_); ok { - return x.SetIndex - } - return nil + return "" } func (x *DocumentChange) GetMoveBlock() *DocumentChange_MoveBlock { @@ -654,25 +379,13 @@ func (x *DocumentChange) GetDeleteBlock() string { return "" } -func (x *DocumentChange) GetUpdateMember() *DocumentChange_UpdateMember { - if x, ok := x.GetOp().(*DocumentChange_UpdateMember_); ok { - return x.UpdateMember - } - return nil -} - type isDocumentChange_Op interface { isDocumentChange_Op() } -type DocumentChange_SetMetadata_ struct { - // New metadata to set on the document. - SetMetadata *DocumentChange_SetMetadata `protobuf:"bytes,1,opt,name=set_metadata,json=setMetadata,proto3,oneof"` -} - -type DocumentChange_SetIndex_ struct { - // New index to set on the document. - SetIndex *DocumentChange_SetIndex `protobuf:"bytes,2,opt,name=set_index,json=setIndex,proto3,oneof"` +type DocumentChange_SetTitle struct { + // New title to set on the document. + SetTitle string `protobuf:"bytes,1,opt,name=set_title,json=setTitle,proto3,oneof"` } type DocumentChange_MoveBlock_ struct { @@ -690,14 +403,7 @@ type DocumentChange_DeleteBlock struct { DeleteBlock string `protobuf:"bytes,5,opt,name=delete_block,json=deleteBlock,proto3,oneof"` } -type DocumentChange_UpdateMember_ struct { - // Update membership for an account on this document. - UpdateMember *DocumentChange_UpdateMember `protobuf:"bytes,6,opt,name=update_member,json=updateMember,proto3,oneof"` -} - -func (*DocumentChange_SetMetadata_) isDocumentChange_Op() {} - -func (*DocumentChange_SetIndex_) isDocumentChange_Op() {} +func (*DocumentChange_SetTitle) isDocumentChange_Op() {} func (*DocumentChange_MoveBlock_) isDocumentChange_Op() {} @@ -705,8 +411,6 @@ func (*DocumentChange_ReplaceBlock) isDocumentChange_Op() {} func (*DocumentChange_DeleteBlock) isDocumentChange_Op() {} -func (*DocumentChange_UpdateMember_) isDocumentChange_Op() {} - // Request to list stored drafts. type ListDraftsRequest struct { state protoimpl.MessageState @@ -722,7 +426,7 @@ type ListDraftsRequest struct { func (x *ListDraftsRequest) Reset() { *x = ListDraftsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[10] + mi := &file_documents_v1alpha_documents_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -735,7 +439,7 @@ func (x *ListDraftsRequest) String() string { func (*ListDraftsRequest) ProtoMessage() {} func (x *ListDraftsRequest) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[10] + mi := &file_documents_v1alpha_documents_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -748,7 +452,7 @@ func (x *ListDraftsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListDraftsRequest.ProtoReflect.Descriptor instead. func (*ListDraftsRequest) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{10} + return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{6} } func (x *ListDraftsRequest) GetPageSize() int32 { @@ -781,7 +485,7 @@ type ListDraftsResponse struct { func (x *ListDraftsResponse) Reset() { *x = ListDraftsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[11] + mi := &file_documents_v1alpha_documents_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -794,7 +498,7 @@ func (x *ListDraftsResponse) String() string { func (*ListDraftsResponse) ProtoMessage() {} func (x *ListDraftsResponse) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[11] + mi := &file_documents_v1alpha_documents_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -807,7 +511,7 @@ func (x *ListDraftsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListDraftsResponse.ProtoReflect.Descriptor instead. func (*ListDraftsResponse) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{11} + return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{7} } func (x *ListDraftsResponse) GetDocuments() []*Document { @@ -837,7 +541,7 @@ type ListDocumentDraftsRequest struct { func (x *ListDocumentDraftsRequest) Reset() { *x = ListDocumentDraftsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[12] + mi := &file_documents_v1alpha_documents_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -850,7 +554,7 @@ func (x *ListDocumentDraftsRequest) String() string { func (*ListDocumentDraftsRequest) ProtoMessage() {} func (x *ListDocumentDraftsRequest) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[12] + mi := &file_documents_v1alpha_documents_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -863,7 +567,7 @@ func (x *ListDocumentDraftsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListDocumentDraftsRequest.ProtoReflect.Descriptor instead. func (*ListDocumentDraftsRequest) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{12} + return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{8} } func (x *ListDocumentDraftsRequest) GetDocumentId() string { @@ -887,7 +591,7 @@ type ListDocumentDraftsResponse struct { func (x *ListDocumentDraftsResponse) Reset() { *x = ListDocumentDraftsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[13] + mi := &file_documents_v1alpha_documents_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -900,7 +604,7 @@ func (x *ListDocumentDraftsResponse) String() string { func (*ListDocumentDraftsResponse) ProtoMessage() {} func (x *ListDocumentDraftsResponse) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[13] + mi := &file_documents_v1alpha_documents_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -913,7 +617,7 @@ func (x *ListDocumentDraftsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListDocumentDraftsResponse.ProtoReflect.Descriptor instead. func (*ListDocumentDraftsResponse) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{13} + return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{9} } func (x *ListDocumentDraftsResponse) GetDrafts() []*Document { @@ -929,14 +633,14 @@ type PublishDraftRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // ID of the draft to be published. - DraftId string `protobuf:"bytes,1,opt,name=draft_id,json=draftId,proto3" json:"draft_id,omitempty"` + // ID of the document which current draft needs to be published. + DocumentId string `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` } func (x *PublishDraftRequest) Reset() { *x = PublishDraftRequest{} if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[14] + mi := &file_documents_v1alpha_documents_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -949,7 +653,7 @@ func (x *PublishDraftRequest) String() string { func (*PublishDraftRequest) ProtoMessage() {} func (x *PublishDraftRequest) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[14] + mi := &file_documents_v1alpha_documents_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -962,18 +666,18 @@ func (x *PublishDraftRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use PublishDraftRequest.ProtoReflect.Descriptor instead. func (*PublishDraftRequest) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{14} + return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{10} } -func (x *PublishDraftRequest) GetDraftId() string { +func (x *PublishDraftRequest) GetDocumentId() string { if x != nil { - return x.DraftId + return x.DocumentId } return "" } -// Request for getting a single document. -type GetDocumentRequest struct { +// Request for getting a single publication. +type GetPublicationRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -982,25 +686,28 @@ type GetDocumentRequest struct { DocumentId string `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` // Optional. Specific version of the published document. If empty, the latest one is returned. Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + // Optional. If true, only local publications will be found. False by default. + // Deprecated: use [Entities.DiscoverEntity] API explicitly instead. + LocalOnly bool `protobuf:"varint,3,opt,name=local_only,json=localOnly,proto3" json:"local_only,omitempty"` } -func (x *GetDocumentRequest) Reset() { - *x = GetDocumentRequest{} +func (x *GetPublicationRequest) Reset() { + *x = GetPublicationRequest{} if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[15] + mi := &file_documents_v1alpha_documents_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *GetDocumentRequest) String() string { +func (x *GetPublicationRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetDocumentRequest) ProtoMessage() {} +func (*GetPublicationRequest) ProtoMessage() {} -func (x *GetDocumentRequest) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[15] +func (x *GetPublicationRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v1alpha_documents_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1011,54 +718,61 @@ func (x *GetDocumentRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetDocumentRequest.ProtoReflect.Descriptor instead. -func (*GetDocumentRequest) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{15} +// Deprecated: Use GetPublicationRequest.ProtoReflect.Descriptor instead. +func (*GetPublicationRequest) Descriptor() ([]byte, []int) { + return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{11} } -func (x *GetDocumentRequest) GetDocumentId() string { +func (x *GetPublicationRequest) GetDocumentId() string { if x != nil { return x.DocumentId } return "" } -func (x *GetDocumentRequest) GetVersion() string { +func (x *GetPublicationRequest) GetVersion() string { if x != nil { return x.Version } return "" } -// Request for getting an account's profile document. -type GetProfileDocumentRequest struct { +func (x *GetPublicationRequest) GetLocalOnly() bool { + if x != nil { + return x.LocalOnly + } + return false +} + +// Request for getting a single publication. +type PushPublicationRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Required. ID of the account. - AccountId string `protobuf:"bytes,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` - // Optional. Specific version of the profile. If empty, the latest one is returned. - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + // Required. ID of the published document to be pushed. + DocumentId string `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` + // Required. URL of the gateway to push to. Multiaddress format accepted (comma separated). + Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` } -func (x *GetProfileDocumentRequest) Reset() { - *x = GetProfileDocumentRequest{} +func (x *PushPublicationRequest) Reset() { + *x = PushPublicationRequest{} if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[16] + mi := &file_documents_v1alpha_documents_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *GetProfileDocumentRequest) String() string { +func (x *PushPublicationRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetProfileDocumentRequest) ProtoMessage() {} +func (*PushPublicationRequest) ProtoMessage() {} -func (x *GetProfileDocumentRequest) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[16] +func (x *PushPublicationRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v1alpha_documents_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1069,54 +783,58 @@ func (x *GetProfileDocumentRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetProfileDocumentRequest.ProtoReflect.Descriptor instead. -func (*GetProfileDocumentRequest) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{16} +// Deprecated: Use PushPublicationRequest.ProtoReflect.Descriptor instead. +func (*PushPublicationRequest) Descriptor() ([]byte, []int) { + return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{12} } -func (x *GetProfileDocumentRequest) GetAccountId() string { +func (x *PushPublicationRequest) GetDocumentId() string { if x != nil { - return x.AccountId + return x.DocumentId } return "" } -func (x *GetProfileDocumentRequest) GetVersion() string { +func (x *PushPublicationRequest) GetUrl() string { if x != nil { - return x.Version + return x.Url } return "" } -// Used to request the document within the indexes of other documents -type GetDocumentIndexRequest struct { +// Request for listing publications. +type ListPublicationsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // the parent document ID - DocumentId string `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` - // the path of the document which will be retrieved. may include slashes to represent a deep index - Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` + // Optional. Number of results per page. Default is defined by the server. + PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + // Optional. Value from next_page_token obtains from a previous response. + PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + // Optional. When provided, the response will only contain + // publications *owned* (created) by trusted accounts of this node. + // By default, it returns all the publications (trusted_only = false) + TrustedOnly bool `protobuf:"varint,3,opt,name=trusted_only,json=trustedOnly,proto3" json:"trusted_only,omitempty"` } -func (x *GetDocumentIndexRequest) Reset() { - *x = GetDocumentIndexRequest{} +func (x *ListPublicationsRequest) Reset() { + *x = ListPublicationsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[17] + mi := &file_documents_v1alpha_documents_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *GetDocumentIndexRequest) String() string { +func (x *ListPublicationsRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetDocumentIndexRequest) ProtoMessage() {} +func (*ListPublicationsRequest) ProtoMessage() {} -func (x *GetDocumentIndexRequest) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[17] +func (x *ListPublicationsRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v1alpha_documents_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1127,57 +845,63 @@ func (x *GetDocumentIndexRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetDocumentIndexRequest.ProtoReflect.Descriptor instead. -func (*GetDocumentIndexRequest) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{17} +// Deprecated: Use ListPublicationsRequest.ProtoReflect.Descriptor instead. +func (*ListPublicationsRequest) Descriptor() ([]byte, []int) { + return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{13} } -func (x *GetDocumentIndexRequest) GetDocumentId() string { +func (x *ListPublicationsRequest) GetPageSize() int32 { if x != nil { - return x.DocumentId + return x.PageSize } - return "" + return 0 } -func (x *GetDocumentIndexRequest) GetPath() string { +func (x *ListPublicationsRequest) GetPageToken() string { if x != nil { - return x.Path + return x.PageToken } return "" } -type GetDocumentIndexResponse struct { +func (x *ListPublicationsRequest) GetTrustedOnly() bool { + if x != nil { + return x.TrustedOnly + } + return false +} + +// Response with list of publications. +type ListPublicationsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // id of the parent document - DocumentId string `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` - // version of the parent document - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - // path of the child document. may include slashes to represent a deep index - Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` - // the document at the given path - Document *Document `protobuf:"bytes,4,opt,name=document,proto3" json:"document,omitempty"` + // List of publications matching the request. + // Only most recent versions are returned. + // Content is omitted, only metadata is present. + Publications []*Publication `protobuf:"bytes,1,rep,name=publications,proto3" json:"publications,omitempty"` + // Token for the next page if there're more results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` } -func (x *GetDocumentIndexResponse) Reset() { - *x = GetDocumentIndexResponse{} +func (x *ListPublicationsResponse) Reset() { + *x = ListPublicationsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[18] + mi := &file_documents_v1alpha_documents_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *GetDocumentIndexResponse) String() string { +func (x *ListPublicationsResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetDocumentIndexResponse) ProtoMessage() {} +func (*ListPublicationsResponse) ProtoMessage() {} -func (x *GetDocumentIndexResponse) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[18] +func (x *ListPublicationsResponse) ProtoReflect() protoreflect.Message { + mi := &file_documents_v1alpha_documents_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1188,67 +912,56 @@ func (x *GetDocumentIndexResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetDocumentIndexResponse.ProtoReflect.Descriptor instead. -func (*GetDocumentIndexResponse) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{18} -} - -func (x *GetDocumentIndexResponse) GetDocumentId() string { - if x != nil { - return x.DocumentId - } - return "" +// Deprecated: Use ListPublicationsResponse.ProtoReflect.Descriptor instead. +func (*ListPublicationsResponse) Descriptor() ([]byte, []int) { + return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{14} } -func (x *GetDocumentIndexResponse) GetVersion() string { +func (x *ListPublicationsResponse) GetPublications() []*Publication { if x != nil { - return x.Version + return x.Publications } - return "" + return nil } -func (x *GetDocumentIndexResponse) GetPath() string { +func (x *ListPublicationsResponse) GetNextPageToken() string { if x != nil { - return x.Path + return x.NextPageToken } return "" } -func (x *GetDocumentIndexResponse) GetDocument() *Document { - if x != nil { - return x.Document - } - return nil -} - -type ChangeDocumentRequest struct { +// Request for listing publications owned by a given account. +type ListAccountPublicationsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Required. ID of the document to be updated. - DocumentId string `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` - // Required. Changes to be applied to the document. - Changes []*DocumentChange `protobuf:"bytes,2,rep,name=changes,proto3" json:"changes,omitempty"` + // Optional. Number of results per page. Default is defined by the server. + PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + // Optional. Value from next_page_token obtains from a previous response. + PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + // Required. Account ID to list publications for. + AccountId string `protobuf:"bytes,3,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` } -func (x *ChangeDocumentRequest) Reset() { - *x = ChangeDocumentRequest{} +func (x *ListAccountPublicationsRequest) Reset() { + *x = ListAccountPublicationsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[19] + mi := &file_documents_v1alpha_documents_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ChangeDocumentRequest) String() string { +func (x *ListAccountPublicationsRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ChangeDocumentRequest) ProtoMessage() {} +func (*ListAccountPublicationsRequest) ProtoMessage() {} -func (x *ChangeDocumentRequest) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[19] +func (x *ListAccountPublicationsRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v1alpha_documents_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1259,53 +972,61 @@ func (x *ChangeDocumentRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ChangeDocumentRequest.ProtoReflect.Descriptor instead. -func (*ChangeDocumentRequest) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{19} +// Deprecated: Use ListAccountPublicationsRequest.ProtoReflect.Descriptor instead. +func (*ListAccountPublicationsRequest) Descriptor() ([]byte, []int) { + return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{15} } -func (x *ChangeDocumentRequest) GetDocumentId() string { +func (x *ListAccountPublicationsRequest) GetPageSize() int32 { if x != nil { - return x.DocumentId + return x.PageSize + } + return 0 +} + +func (x *ListAccountPublicationsRequest) GetPageToken() string { + if x != nil { + return x.PageToken } return "" } -func (x *ChangeDocumentRequest) GetChanges() []*DocumentChange { +func (x *ListAccountPublicationsRequest) GetAccountId() string { if x != nil { - return x.Changes + return x.AccountId } - return nil + return "" } -type ChangeProfileDocumentRequest struct { +// Request for merging changes in a document. +type MergeChangesRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Required. Account ID to update the profile document for. - AccountId string `protobuf:"bytes,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` - // Required. Changes to be applied to the profile document. - Changes []*DocumentChange `protobuf:"bytes,2,rep,name=changes,proto3" json:"changes,omitempty"` + // Required. Document ID from which versions are going to be taken. + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Required. Versions to be merged. + Versions []string `protobuf:"bytes,2,rep,name=versions,proto3" json:"versions,omitempty"` } -func (x *ChangeProfileDocumentRequest) Reset() { - *x = ChangeProfileDocumentRequest{} +func (x *MergeChangesRequest) Reset() { + *x = MergeChangesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[20] + mi := &file_documents_v1alpha_documents_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ChangeProfileDocumentRequest) String() string { +func (x *MergeChangesRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ChangeProfileDocumentRequest) ProtoMessage() {} +func (*MergeChangesRequest) ProtoMessage() {} -func (x *ChangeProfileDocumentRequest) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[20] +func (x *MergeChangesRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v1alpha_documents_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1316,54 +1037,54 @@ func (x *ChangeProfileDocumentRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ChangeProfileDocumentRequest.ProtoReflect.Descriptor instead. -func (*ChangeProfileDocumentRequest) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{20} +// Deprecated: Use MergeChangesRequest.ProtoReflect.Descriptor instead. +func (*MergeChangesRequest) Descriptor() ([]byte, []int) { + return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{16} } -func (x *ChangeProfileDocumentRequest) GetAccountId() string { +func (x *MergeChangesRequest) GetId() string { if x != nil { - return x.AccountId + return x.Id } return "" } -func (x *ChangeProfileDocumentRequest) GetChanges() []*DocumentChange { +func (x *MergeChangesRequest) GetVersions() []string { if x != nil { - return x.Changes + return x.Versions } return nil } -// Request for getting a single document. -type PushDocumentRequest struct { +// Request for rebasing changes in a document. +type RebaseChangesRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Required. ID of the published document to be pushed. - DocumentId string `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` - // Required. URL of the gateway to push to. Multiaddress format accepted (comma separated). - Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` + // Required. Draft ID to be rebased. + BaseDraftId string `protobuf:"bytes,1,opt,name=base_draft_id,json=baseDraftId,proto3" json:"base_draft_id,omitempty"` + // Required. Versions to be applied applied on top of the base document. + Versions []string `protobuf:"bytes,3,rep,name=versions,proto3" json:"versions,omitempty"` } -func (x *PushDocumentRequest) Reset() { - *x = PushDocumentRequest{} +func (x *RebaseChangesRequest) Reset() { + *x = RebaseChangesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[21] + mi := &file_documents_v1alpha_documents_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *PushDocumentRequest) String() string { +func (x *RebaseChangesRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PushDocumentRequest) ProtoMessage() {} +func (*RebaseChangesRequest) ProtoMessage() {} -func (x *PushDocumentRequest) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[21] +func (x *RebaseChangesRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v1alpha_documents_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1374,54 +1095,57 @@ func (x *PushDocumentRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use PushDocumentRequest.ProtoReflect.Descriptor instead. -func (*PushDocumentRequest) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{21} +// Deprecated: Use RebaseChangesRequest.ProtoReflect.Descriptor instead. +func (*RebaseChangesRequest) Descriptor() ([]byte, []int) { + return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{17} } -func (x *PushDocumentRequest) GetDocumentId() string { +func (x *RebaseChangesRequest) GetBaseDraftId() string { if x != nil { - return x.DocumentId + return x.BaseDraftId } return "" } -func (x *PushDocumentRequest) GetUrl() string { +func (x *RebaseChangesRequest) GetVersions() []string { if x != nil { - return x.Url + return x.Versions } - return "" + return nil } -// Request for listing documents. -type ListDocumentsRequest struct { +// State of the document after publication. +// Deprecated: use the Document message instead, +// it has all the same fields. +type Publication struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Optional. Number of results per page. Default is defined by the server. - PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // Optional. Value from next_page_token obtains from a previous response. - PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + // Version points to the state of the publication at some point in time. + // Deprecated: use the version field of the Document message instead. + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + // Published document. + Document *Document `protobuf:"bytes,2,opt,name=document,proto3" json:"document,omitempty"` } -func (x *ListDocumentsRequest) Reset() { - *x = ListDocumentsRequest{} +func (x *Publication) Reset() { + *x = Publication{} if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[22] + mi := &file_documents_v1alpha_documents_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListDocumentsRequest) String() string { +func (x *Publication) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListDocumentsRequest) ProtoMessage() {} +func (*Publication) ProtoMessage() {} -func (x *ListDocumentsRequest) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[22] +func (x *Publication) ProtoReflect() protoreflect.Message { + mi := &file_documents_v1alpha_documents_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1432,56 +1156,72 @@ func (x *ListDocumentsRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListDocumentsRequest.ProtoReflect.Descriptor instead. -func (*ListDocumentsRequest) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{22} +// Deprecated: Use Publication.ProtoReflect.Descriptor instead. +func (*Publication) Descriptor() ([]byte, []int) { + return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{18} } -func (x *ListDocumentsRequest) GetPageSize() int32 { +func (x *Publication) GetVersion() string { if x != nil { - return x.PageSize + return x.Version } - return 0 + return "" } -func (x *ListDocumentsRequest) GetPageToken() string { +func (x *Publication) GetDocument() *Document { if x != nil { - return x.PageToken + return x.Document } - return "" + return nil } -// Response with list of documents. -type ListDocumentsResponse struct { +// Document represents metadata and content of a draft or publication. +type Document struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // List of documents matching the request. - // Only most recent versions are returned. - // Content is omitted, only metadata is present. - Documents []*Document `protobuf:"bytes,1,rep,name=documents,proto3" json:"documents,omitempty"` - // Token for the next page if there're more results. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` + // Permanent ID of the document. + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Title of the document. + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + // Output only. Author ID of the document. + Author string `protobuf:"bytes,4,opt,name=author,proto3" json:"author,omitempty"` + // Output only. Account IDs of all the editors of the document. + // Includes the original author as well. + Editors []string `protobuf:"bytes,11,rep,name=editors,proto3" json:"editors,omitempty"` + // This is WIP feature for block-aware API. It will supersede the `content` field. + Children []*BlockNode `protobuf:"bytes,9,rep,name=children,proto3" json:"children,omitempty"` + // Output only. Time when document was created. + CreateTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + // Output only. Time when document was updated. + UpdateTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` + // Output only. Time when this version was published. Not present in drafts. + PublishTime *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=publish_time,json=publishTime,proto3" json:"publish_time,omitempty"` + // Output only. Current version of the document. + Version string `protobuf:"bytes,12,opt,name=version,proto3" json:"version,omitempty"` + // Output only. Previous version of the document, + // unless this is the first version. + PreviousVersion string `protobuf:"bytes,13,opt,name=previous_version,json=previousVersion,proto3" json:"previous_version,omitempty"` } -func (x *ListDocumentsResponse) Reset() { - *x = ListDocumentsResponse{} +func (x *Document) Reset() { + *x = Document{} if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[23] + mi := &file_documents_v1alpha_documents_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListDocumentsResponse) String() string { +func (x *Document) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListDocumentsResponse) ProtoMessage() {} +func (*Document) ProtoMessage() {} -func (x *ListDocumentsResponse) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[23] +func (x *Document) ProtoReflect() protoreflect.Message { + mi := &file_documents_v1alpha_documents_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1492,590 +1232,54 @@ func (x *ListDocumentsResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListDocumentsResponse.ProtoReflect.Descriptor instead. -func (*ListDocumentsResponse) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{23} +// Deprecated: Use Document.ProtoReflect.Descriptor instead. +func (*Document) Descriptor() ([]byte, []int) { + return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{19} } -func (x *ListDocumentsResponse) GetDocuments() []*Document { +func (x *Document) GetId() string { if x != nil { - return x.Documents + return x.Id } - return nil + return "" } -func (x *ListDocumentsResponse) GetNextPageToken() string { +func (x *Document) GetTitle() string { if x != nil { - return x.NextPageToken + return x.Title } return "" } -type ListDocumentBranchesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Required. ID of the document to list branches for. - DocumentId string `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` -} - -func (x *ListDocumentBranchesRequest) Reset() { - *x = ListDocumentBranchesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) +func (x *Document) GetAuthor() string { + if x != nil { + return x.Author } + return "" } -func (x *ListDocumentBranchesRequest) String() string { - return protoimpl.X.MessageStringOf(x) +func (x *Document) GetEditors() []string { + if x != nil { + return x.Editors + } + return nil } -func (*ListDocumentBranchesRequest) ProtoMessage() {} - -func (x *ListDocumentBranchesRequest) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[24] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms +func (x *Document) GetChildren() []*BlockNode { + if x != nil { + return x.Children } - return mi.MessageOf(x) + return nil } -// Deprecated: Use ListDocumentBranchesRequest.ProtoReflect.Descriptor instead. -func (*ListDocumentBranchesRequest) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{24} +func (x *Document) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil } -func (x *ListDocumentBranchesRequest) GetDocumentId() string { - if x != nil { - return x.DocumentId - } - return "" -} - -type ListDocumentBranchesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // List of branches for the document. - Branches []*Branch `protobuf:"bytes,1,rep,name=branches,proto3" json:"branches,omitempty"` - // List of drafts for these branches. Includes a draft that will become a draft when published. - Drafts []*Draft `protobuf:"bytes,2,rep,name=drafts,proto3" json:"drafts,omitempty"` -} - -func (x *ListDocumentBranchesResponse) Reset() { - *x = ListDocumentBranchesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListDocumentBranchesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListDocumentBranchesResponse) ProtoMessage() {} - -func (x *ListDocumentBranchesResponse) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[25] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListDocumentBranchesResponse.ProtoReflect.Descriptor instead. -func (*ListDocumentBranchesResponse) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{25} -} - -func (x *ListDocumentBranchesResponse) GetBranches() []*Branch { - if x != nil { - return x.Branches - } - return nil -} - -func (x *ListDocumentBranchesResponse) GetDrafts() []*Draft { - if x != nil { - return x.Drafts - } - return nil -} - -type Branch struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // ID for use when deleting or publishing the branch - BranchId string `protobuf:"bytes,1,opt,name=branch_id,json=branchId,proto3" json:"branch_id,omitempty"` - // ID of the top-level doc which will be updated. For standalone branches this is the doc ID. - // for index branches this is the parent doc ID. - DocumentId string `protobuf:"bytes,2,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` - // the path of the document which is being updated. may include slashes to represent a deep index - Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` -} - -func (x *Branch) Reset() { - *x = Branch{} - if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Branch) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Branch) ProtoMessage() {} - -func (x *Branch) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[26] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Branch.ProtoReflect.Descriptor instead. -func (*Branch) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{26} -} - -func (x *Branch) GetBranchId() string { - if x != nil { - return x.BranchId - } - return "" -} - -func (x *Branch) GetDocumentId() string { - if x != nil { - return x.DocumentId - } - return "" -} - -func (x *Branch) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -// Request for listing documents owned by a given account. -type ListAccountDocumentsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Optional. Number of results per page. Default is defined by the server. - PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // Optional. Value from next_page_token obtains from a previous response. - PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - // Required. Account ID to list documents for. - AccountId string `protobuf:"bytes,3,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` -} - -func (x *ListAccountDocumentsRequest) Reset() { - *x = ListAccountDocumentsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListAccountDocumentsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAccountDocumentsRequest) ProtoMessage() {} - -func (x *ListAccountDocumentsRequest) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[27] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListAccountDocumentsRequest.ProtoReflect.Descriptor instead. -func (*ListAccountDocumentsRequest) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{27} -} - -func (x *ListAccountDocumentsRequest) GetPageSize() int32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *ListAccountDocumentsRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -func (x *ListAccountDocumentsRequest) GetAccountId() string { - if x != nil { - return x.AccountId - } - return "" -} - -// Request for merging changes in a document. -type MergeChangesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Required. Document ID from which versions are going to be taken. - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // Required. Versions to be merged. - Versions []string `protobuf:"bytes,2,rep,name=versions,proto3" json:"versions,omitempty"` -} - -func (x *MergeChangesRequest) Reset() { - *x = MergeChangesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MergeChangesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MergeChangesRequest) ProtoMessage() {} - -func (x *MergeChangesRequest) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[28] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MergeChangesRequest.ProtoReflect.Descriptor instead. -func (*MergeChangesRequest) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{28} -} - -func (x *MergeChangesRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *MergeChangesRequest) GetVersions() []string { - if x != nil { - return x.Versions - } - return nil -} - -// Request for rebasing changes in a document. -type RebaseChangesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Required. Draft ID to be rebased. - BaseDraftId string `protobuf:"bytes,1,opt,name=base_draft_id,json=baseDraftId,proto3" json:"base_draft_id,omitempty"` - // Required. Versions to be applied applied on top of the base document. - Versions []string `protobuf:"bytes,3,rep,name=versions,proto3" json:"versions,omitempty"` -} - -func (x *RebaseChangesRequest) Reset() { - *x = RebaseChangesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RebaseChangesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RebaseChangesRequest) ProtoMessage() {} - -func (x *RebaseChangesRequest) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[29] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RebaseChangesRequest.ProtoReflect.Descriptor instead. -func (*RebaseChangesRequest) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{29} -} - -func (x *RebaseChangesRequest) GetBaseDraftId() string { - if x != nil { - return x.BaseDraftId - } - return "" -} - -func (x *RebaseChangesRequest) GetVersions() []string { - if x != nil { - return x.Versions - } - return nil -} - -type Draft struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // to identify the draft - DraftId string `protobuf:"bytes,1,opt,name=draft_id,json=draftId,proto3" json:"draft_id,omitempty"` - // state of the draft - Document *Document `protobuf:"bytes,2,opt,name=document,proto3" json:"document,omitempty"` - // True if this is a profile draft - IsProfile bool `protobuf:"varint,3,opt,name=is_profile,json=isProfile,proto3" json:"is_profile,omitempty"` - // The top-level entity that this draft will update once published. An Account ID for profile drafts, otherwise Document ID. - EntityId string `protobuf:"bytes,4,opt,name=entity_id,json=entityId,proto3" json:"entity_id,omitempty"` - // Optional. The path where the draft will be updated once published - Path string `protobuf:"bytes,5,opt,name=path,proto3" json:"path,omitempty"` -} - -func (x *Draft) Reset() { - *x = Draft{} - if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[30] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Draft) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Draft) ProtoMessage() {} - -func (x *Draft) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[30] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Draft.ProtoReflect.Descriptor instead. -func (*Draft) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{30} -} - -func (x *Draft) GetDraftId() string { - if x != nil { - return x.DraftId - } - return "" -} - -func (x *Draft) GetDocument() *Document { - if x != nil { - return x.Document - } - return nil -} - -func (x *Draft) GetIsProfile() bool { - if x != nil { - return x.IsProfile - } - return false -} - -func (x *Draft) GetEntityId() string { - if x != nil { - return x.EntityId - } - return "" -} - -func (x *Draft) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -// Document represents metadata and content of a document. -type Document struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Permanent ID of the document. - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // Output only. Author ID of the document. - Author string `protobuf:"bytes,4,opt,name=author,proto3" json:"author,omitempty"` - // Metadata values for a document. - Metadata map[string]string `protobuf:"bytes,15,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Output only. Set to account ID if this is a profile document. - ProfileAccountId string `protobuf:"bytes,14,opt,name=profile_account_id,json=profileAccountId,proto3" json:"profile_account_id,omitempty"` - // Output only. Every account ID who has modified the document. - // Includes the original author as well. - Authors []string `protobuf:"bytes,11,rep,name=authors,proto3" json:"authors,omitempty"` - // Blocks content of the document. - Content []*BlockNode `protobuf:"bytes,9,rep,name=content,proto3" json:"content,omitempty"` - // The indexed children documents under this document. - // Keys are used as the path names (and slash "/" is not allowed in the key) - // Values will refer to other documents as exact versions such as "hm://DOC_ID?v=1" - // Values may refer to "latest" versions with "hm://DOC_ID" - Index map[string]string `protobuf:"bytes,16,rep,name=index,proto3" json:"index,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Output only. Time when document was created. - CreateTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // Output only. Time when document was updated. - UpdateTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` - // Output only. Time when this version was published. Not present in drafts. - PublishTime *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=publish_time,json=publishTime,proto3" json:"publish_time,omitempty"` - // Output only. Current version of the document. - Version string `protobuf:"bytes,12,opt,name=version,proto3" json:"version,omitempty"` - // Output only. Previous version of the document, - // Empty if this is the first version. - PreviousVersion string `protobuf:"bytes,13,opt,name=previous_version,json=previousVersion,proto3" json:"previous_version,omitempty"` -} - -func (x *Document) Reset() { - *x = Document{} - if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[31] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Document) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Document) ProtoMessage() {} - -func (x *Document) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[31] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Document.ProtoReflect.Descriptor instead. -func (*Document) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{31} -} - -func (x *Document) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Document) GetAuthor() string { - if x != nil { - return x.Author - } - return "" -} - -func (x *Document) GetMetadata() map[string]string { - if x != nil { - return x.Metadata - } - return nil -} - -func (x *Document) GetProfileAccountId() string { - if x != nil { - return x.ProfileAccountId - } - return "" -} - -func (x *Document) GetAuthors() []string { - if x != nil { - return x.Authors - } - return nil -} - -func (x *Document) GetContent() []*BlockNode { - if x != nil { - return x.Content - } - return nil -} - -func (x *Document) GetIndex() map[string]string { - if x != nil { - return x.Index - } - return nil -} - -func (x *Document) GetCreateTime() *timestamppb.Timestamp { - if x != nil { - return x.CreateTime - } - return nil -} - -func (x *Document) GetUpdateTime() *timestamppb.Timestamp { +func (x *Document) GetUpdateTime() *timestamppb.Timestamp { if x != nil { return x.UpdateTime } @@ -2118,7 +1322,7 @@ type BlockNode struct { func (x *BlockNode) Reset() { *x = BlockNode{} if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[32] + mi := &file_documents_v1alpha_documents_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2131,7 +1335,7 @@ func (x *BlockNode) String() string { func (*BlockNode) ProtoMessage() {} func (x *BlockNode) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[32] + mi := &file_documents_v1alpha_documents_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2144,7 +1348,7 @@ func (x *BlockNode) ProtoReflect() protoreflect.Message { // Deprecated: Use BlockNode.ProtoReflect.Descriptor instead. func (*BlockNode) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{32} + return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{20} } func (x *BlockNode) GetBlock() *Block { @@ -2188,7 +1392,7 @@ type Block struct { func (x *Block) Reset() { *x = Block{} if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[33] + mi := &file_documents_v1alpha_documents_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2201,7 +1405,7 @@ func (x *Block) String() string { func (*Block) ProtoMessage() {} func (x *Block) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[33] + mi := &file_documents_v1alpha_documents_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2214,7 +1418,7 @@ func (x *Block) ProtoReflect() protoreflect.Message { // Deprecated: Use Block.ProtoReflect.Descriptor instead. func (*Block) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{33} + return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{21} } func (x *Block) GetId() string { @@ -2297,7 +1501,7 @@ type Annotation struct { func (x *Annotation) Reset() { *x = Annotation{} if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[34] + mi := &file_documents_v1alpha_documents_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2310,7 +1514,7 @@ func (x *Annotation) String() string { func (*Annotation) ProtoMessage() {} func (x *Annotation) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[34] + mi := &file_documents_v1alpha_documents_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2323,7 +1527,7 @@ func (x *Annotation) ProtoReflect() protoreflect.Message { // Deprecated: Use Annotation.ProtoReflect.Descriptor instead. func (*Annotation) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{34} + return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{22} } func (x *Annotation) GetType() string { @@ -2380,7 +1584,7 @@ type DocumentChange_MoveBlock struct { func (x *DocumentChange_MoveBlock) Reset() { *x = DocumentChange_MoveBlock{} if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[35] + mi := &file_documents_v1alpha_documents_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2393,7 +1597,7 @@ func (x *DocumentChange_MoveBlock) String() string { func (*DocumentChange_MoveBlock) ProtoMessage() {} func (x *DocumentChange_MoveBlock) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[35] + mi := &file_documents_v1alpha_documents_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2406,7 +1610,7 @@ func (x *DocumentChange_MoveBlock) ProtoReflect() protoreflect.Message { // Deprecated: Use DocumentChange_MoveBlock.ProtoReflect.Descriptor instead. func (*DocumentChange_MoveBlock) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{9, 0} + return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{5, 0} } func (x *DocumentChange_MoveBlock) GetBlockId() string { @@ -2430,180 +1634,6 @@ func (x *DocumentChange_MoveBlock) GetLeftSibling() string { return "" } -// Operation to replace a metadata field with a new value -type DocumentChange_SetMetadata struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Metadata key to set. - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // Metadata value to set. - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *DocumentChange_SetMetadata) Reset() { - *x = DocumentChange_SetMetadata{} - if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[36] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DocumentChange_SetMetadata) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DocumentChange_SetMetadata) ProtoMessage() {} - -func (x *DocumentChange_SetMetadata) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[36] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DocumentChange_SetMetadata.ProtoReflect.Descriptor instead. -func (*DocumentChange_SetMetadata) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{9, 1} -} - -func (x *DocumentChange_SetMetadata) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *DocumentChange_SetMetadata) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -// Operation to replace an index field with a new value -type DocumentChange_SetIndex struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Index key to set. - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // Index value to set. - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *DocumentChange_SetIndex) Reset() { - *x = DocumentChange_SetIndex{} - if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[37] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DocumentChange_SetIndex) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DocumentChange_SetIndex) ProtoMessage() {} - -func (x *DocumentChange_SetIndex) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[37] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DocumentChange_SetIndex.ProtoReflect.Descriptor instead. -func (*DocumentChange_SetIndex) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{9, 2} -} - -func (x *DocumentChange_SetIndex) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *DocumentChange_SetIndex) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -// Operation to change membership -type DocumentChange_UpdateMember struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Account ID to update the role for. - AccountId string `protobuf:"bytes,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` - // New role to set for the account. - Role RoleType `protobuf:"varint,2,opt,name=role,proto3,enum=com.seed.documents.v1alpha.RoleType" json:"role,omitempty"` -} - -func (x *DocumentChange_UpdateMember) Reset() { - *x = DocumentChange_UpdateMember{} - if protoimpl.UnsafeEnabled { - mi := &file_documents_v1alpha_documents_proto_msgTypes[38] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DocumentChange_UpdateMember) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DocumentChange_UpdateMember) ProtoMessage() {} - -func (x *DocumentChange_UpdateMember) ProtoReflect() protoreflect.Message { - mi := &file_documents_v1alpha_documents_proto_msgTypes[38] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DocumentChange_UpdateMember.ProtoReflect.Descriptor instead. -func (*DocumentChange_UpdateMember) Descriptor() ([]byte, []int) { - return file_documents_v1alpha_documents_proto_rawDescGZIP(), []int{9, 3} -} - -func (x *DocumentChange_UpdateMember) GetAccountId() string { - if x != nil { - return x.AccountId - } - return "" -} - -func (x *DocumentChange_UpdateMember) GetRole() RoleType { - if x != nil { - return x.Role - } - return RoleType_ROLE_UNSPECIFIED -} - var File_documents_v1alpha_documents_proto protoreflect.FileDescriptor var file_documents_v1alpha_documents_proto_rawDesc = []byte{ @@ -2614,489 +1644,304 @@ var file_documents_v1alpha_documents_proto_rawDesc = []byte{ 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x35, 0x0a, + 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x60, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, - 0x6e, 0x74, 0x49, 0x64, 0x22, 0x55, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x72, - 0x61, 0x6e, 0x63, 0x68, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x65, 0x73, 0x74, 0x12, 0x30, 0x0a, 0x14, 0x65, 0x78, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, + 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x12, 0x65, 0x78, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x44, 0x6f, 0x63, 0x75, 0x6d, + 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, + 0x35, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x75, + 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x32, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x44, 0x72, 0x61, + 0x66, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x7b, 0x0a, 0x12, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, - 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x4e, 0x0a, 0x17, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, - 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63, - 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x3a, 0x0a, 0x19, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x44, 0x72, 0x61, 0x66, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x31, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, - 0x09, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x49, 0x64, 0x22, 0x2c, 0x0a, 0x0f, 0x47, 0x65, - 0x74, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, - 0x08, 0x64, 0x72, 0x61, 0x66, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x64, 0x72, 0x61, 0x66, 0x74, 0x49, 0x64, 0x22, 0x37, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x50, - 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, - 0x64, 0x22, 0x7b, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x6f, 0x63, 0x75, 0x6d, - 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, - 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x44, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, - 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x43, - 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x22, 0x83, - 0x01, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x68, 0x61, 0x6e, 0x67, - 0x65, 0x49, 0x64, 0x12, 0x4f, 0x0a, 0x10, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x64, - 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, - 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, - 0x65, 0x6e, 0x74, 0x52, 0x0f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x44, 0x6f, 0x63, 0x75, - 0x6d, 0x65, 0x6e, 0x74, 0x22, 0xa4, 0x06, 0x0a, 0x0e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, - 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x5b, 0x0a, 0x0c, 0x73, 0x65, 0x74, 0x5f, 0x6d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, - 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, - 0x65, 0x6e, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x12, 0x52, 0x0a, 0x09, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, - 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, - 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x2e, 0x53, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x48, 0x00, 0x52, 0x08, - 0x73, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x55, 0x0a, 0x0a, 0x6d, 0x6f, 0x76, 0x65, - 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x63, - 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, - 0x6e, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x4d, 0x6f, 0x76, 0x65, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x48, 0x00, 0x52, 0x09, 0x6d, 0x6f, 0x76, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, - 0x48, 0x0a, 0x0d, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, + 0x64, 0x12, 0x44, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, + 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, + 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x07, + 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x22, 0x83, 0x01, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x1b, 0x0a, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x64, 0x12, 0x4f, 0x0a, 0x10, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x00, 0x52, 0x0c, 0x72, 0x65, 0x70, - 0x6c, 0x61, 0x63, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x23, 0x0a, 0x0c, 0x64, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, - 0x00, 0x52, 0x0b, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x5e, - 0x0a, 0x0d, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, - 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, - 0x65, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x48, 0x00, - 0x52, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x1a, 0x61, - 0x0a, 0x09, 0x4d, 0x6f, 0x76, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x19, 0x0a, 0x08, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x21, - 0x0a, 0x0c, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x73, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6c, 0x65, 0x66, 0x74, 0x53, 0x69, 0x62, 0x6c, 0x69, 0x6e, - 0x67, 0x1a, 0x35, 0x0a, 0x0b, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x32, 0x0a, 0x08, 0x53, 0x65, 0x74, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x67, 0x0a, 0x0c, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x38, 0x0a, 0x04, 0x72, - 0x6f, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, + 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0f, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x64, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0xde, 0x02, + 0x0a, 0x0e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x12, 0x1d, 0x0a, 0x09, 0x73, 0x65, 0x74, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x73, 0x65, 0x74, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, + 0x55, 0x0a, 0x0a, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, + 0x4d, 0x6f, 0x76, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x00, 0x52, 0x09, 0x6d, 0x6f, 0x76, + 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x48, 0x0a, 0x0d, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, + 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, + 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x48, 0x00, 0x52, 0x0c, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x12, 0x23, 0x0a, 0x0c, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x1a, 0x61, 0x0a, 0x09, 0x4d, 0x6f, 0x76, 0x65, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x12, 0x19, 0x0a, 0x08, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x64, 0x12, 0x16, 0x0a, + 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, + 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x73, 0x69, + 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6c, 0x65, 0x66, + 0x74, 0x53, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x42, 0x04, 0x0a, 0x02, 0x6f, 0x70, 0x22, 0x4f, + 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x72, 0x61, 0x66, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, + 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, + 0x80, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x72, 0x61, 0x66, 0x74, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x09, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, - 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x42, 0x04, 0x0a, 0x02, 0x6f, 0x70, 0x22, 0x4f, 0x0a, 0x11, 0x4c, - 0x69, 0x73, 0x74, 0x44, 0x72, 0x61, 0x66, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, - 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x80, 0x01, 0x0a, - 0x12, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x72, 0x61, 0x66, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x09, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, - 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x09, 0x64, 0x6f, - 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, - 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, - 0x3c, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x44, - 0x72, 0x61, 0x66, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, - 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x5a, 0x0a, - 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x72, 0x61, - 0x66, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x64, - 0x72, 0x61, 0x66, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, - 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, - 0x74, 0x52, 0x06, 0x64, 0x72, 0x61, 0x66, 0x74, 0x73, 0x22, 0x30, 0x0a, 0x13, 0x50, 0x75, 0x62, - 0x6c, 0x69, 0x73, 0x68, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x19, 0x0a, 0x08, 0x64, 0x72, 0x61, 0x66, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x64, 0x72, 0x61, 0x66, 0x74, 0x49, 0x64, 0x22, 0x4f, 0x0a, 0x12, 0x47, - 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, - 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x54, 0x0a, 0x19, - 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, - 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x22, 0x4e, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, - 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, - 0x0b, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, - 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, - 0x74, 0x68, 0x22, 0xab, 0x01, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, - 0x6e, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x09, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, + 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x22, 0x3c, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x44, 0x72, 0x61, 0x66, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, - 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, - 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x40, - 0x0a, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, - 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, - 0x22, 0x7e, 0x0a, 0x15, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, - 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x6f, 0x63, - 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x44, 0x0a, 0x07, 0x63, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, - 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, - 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, - 0x22, 0x83, 0x01, 0x0a, 0x1c, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, - 0x6c, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, - 0x12, 0x44, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, - 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, - 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x07, 0x63, - 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x22, 0x48, 0x0a, 0x13, 0x50, 0x75, 0x73, 0x68, 0x44, 0x6f, - 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, - 0x0b, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x10, - 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, - 0x22, 0x52, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, - 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, - 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x83, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, - 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, - 0x0a, 0x09, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, - 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, - 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x09, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, - 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x3e, 0x0a, 0x1b, 0x4c, 0x69, - 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x6f, 0x63, - 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x99, 0x01, 0x0a, 0x1c, 0x4c, - 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, - 0x68, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x08, 0x62, - 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, - 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x63, - 0x68, 0x52, 0x08, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x06, 0x64, - 0x72, 0x61, 0x66, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, - 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x06, - 0x64, 0x72, 0x61, 0x66, 0x74, 0x73, 0x22, 0x5a, 0x0a, 0x06, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, - 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x49, 0x64, 0x12, 0x1f, 0x0a, - 0x0b, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, - 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, - 0x74, 0x68, 0x22, 0x78, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, - 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, - 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x41, 0x0a, 0x13, - 0x4d, 0x65, 0x72, 0x67, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, - 0x56, 0x0a, 0x14, 0x52, 0x65, 0x62, 0x61, 0x73, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x5f, - 0x64, 0x72, 0x61, 0x66, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x62, 0x61, 0x73, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xb4, 0x01, 0x0a, 0x05, 0x44, 0x72, 0x61, 0x66, - 0x74, 0x12, 0x19, 0x0a, 0x08, 0x64, 0x72, 0x61, 0x66, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x72, 0x61, 0x66, 0x74, 0x49, 0x64, 0x12, 0x40, 0x0a, 0x08, - 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, + 0x22, 0x5a, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x44, 0x72, 0x61, 0x66, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, + 0x0a, 0x06, 0x64, 0x72, 0x61, 0x66, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, - 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1d, - 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x1b, 0x0a, - 0x09, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, - 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0xc7, - 0x05, 0x0a, 0x08, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, - 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x12, 0x4e, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, - 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, - 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x12, 0x2c, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x61, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x10, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, - 0x64, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x73, 0x18, 0x0b, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x07, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x73, 0x12, 0x3f, 0x0a, 0x07, 0x63, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x63, - 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, - 0x6f, 0x64, 0x65, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x45, 0x0a, 0x05, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x63, 0x6f, - 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, - 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, - 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, - 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3d, 0x0a, - 0x0c, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, - 0x75, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x38, - 0x0a, 0x0a, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x87, 0x01, 0x0a, 0x09, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x37, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, - 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, - 0x41, 0x0a, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x25, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, - 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, - 0x65, 0x6e, 0x22, 0xc9, 0x02, 0x0a, 0x05, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x74, 0x65, 0x78, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x66, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x72, 0x65, 0x66, 0x12, 0x51, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, - 0x75, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x64, 0x72, 0x61, 0x66, 0x74, 0x73, 0x22, 0x36, 0x0a, 0x13, + 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x49, 0x64, 0x22, 0x71, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, + 0x0b, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x18, + 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x6f, 0x63, 0x61, + 0x6c, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6c, 0x6f, + 0x63, 0x61, 0x6c, 0x4f, 0x6e, 0x6c, 0x79, 0x22, 0x4b, 0x0a, 0x16, 0x50, 0x75, 0x73, 0x68, 0x50, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x75, 0x72, 0x6c, 0x22, 0x78, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, + 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x74, + 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0b, 0x74, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x22, 0x8f, + 0x01, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x0c, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x50, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, + 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x22, 0x7b, 0x0a, 0x1e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, + 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, + 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x41, 0x0a, + 0x13, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x22, 0x56, 0x0a, 0x14, 0x52, 0x65, 0x62, 0x61, 0x73, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x0d, 0x62, 0x61, 0x73, 0x65, + 0x5f, 0x64, 0x72, 0x61, 0x66, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x62, 0x61, 0x73, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x69, 0x0a, 0x0b, 0x50, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x40, 0x0a, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, + 0x65, 0x6e, 0x74, 0x22, 0xa3, 0x03, 0x0a, 0x08, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x18, + 0x0a, 0x07, 0x65, 0x64, 0x69, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x07, 0x65, 0x64, 0x69, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x41, 0x0a, 0x08, 0x63, 0x68, 0x69, 0x6c, + 0x64, 0x72, 0x65, 0x6e, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x41, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x61, - 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x48, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, - 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, - 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x1a, - 0x3d, 0x0a, 0x0f, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xf5, - 0x01, 0x0a, 0x0a, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x66, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x72, 0x65, 0x66, 0x12, 0x56, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, - 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, - 0x74, 0x61, 0x72, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, - 0x72, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x65, 0x6e, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, - 0x05, 0x52, 0x04, 0x65, 0x6e, 0x64, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x41, 0x74, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x2a, 0x55, 0x0a, 0x08, 0x52, 0x6f, 0x6c, 0x65, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, - 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x4f, 0x57, 0x4e, 0x45, - 0x52, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x45, 0x44, 0x49, 0x54, 0x4f, 0x52, 0x10, 0x02, 0x12, - 0x0a, 0x0a, 0x06, 0x57, 0x52, 0x49, 0x54, 0x45, 0x52, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x43, - 0x4f, 0x4c, 0x4c, 0x41, 0x42, 0x4f, 0x52, 0x41, 0x54, 0x4f, 0x52, 0x10, 0x04, 0x32, 0x99, 0x09, - 0x0a, 0x06, 0x44, 0x72, 0x61, 0x66, 0x74, 0x73, 0x12, 0x60, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, - 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, - 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x72, 0x61, 0x66, 0x74, 0x12, 0x6c, 0x0a, 0x11, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x44, 0x72, 0x61, 0x66, 0x74, 0x12, - 0x34, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, - 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, - 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x44, 0x72, 0x61, 0x66, 0x74, 0x12, 0x6a, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x44, 0x72, 0x61, 0x66, 0x74, 0x12, 0x33, 0x2e, 0x63, - 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x21, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x6f, 0x64, + 0x65, 0x52, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x12, 0x3b, 0x0a, 0x0b, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3d, 0x0a, 0x0c, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, + 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x29, + 0x0a, 0x10, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, + 0x75, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x87, 0x01, 0x0a, 0x09, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x37, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, + 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x12, 0x41, 0x0a, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, + 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, + 0x72, 0x65, 0x6e, 0x22, 0xc9, 0x02, 0x0a, 0x05, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x66, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x72, 0x65, 0x66, 0x12, 0x51, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x63, 0x6f, + 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x41, + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, + 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x48, 0x0a, 0x0b, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x26, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x41, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, + 0x1a, 0x3d, 0x0a, 0x0f, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, + 0xf5, 0x01, 0x0a, 0x0a, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x66, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x72, 0x65, 0x66, 0x12, 0x56, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, + 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x65, 0x6e, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x05, 0x52, 0x04, 0x65, 0x6e, 0x64, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x41, 0x74, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x32, 0xf0, 0x05, 0x0a, 0x06, 0x44, 0x72, 0x61, 0x66, + 0x74, 0x73, 0x12, 0x63, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x72, 0x61, 0x66, + 0x74, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x24, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, - 0x72, 0x61, 0x66, 0x74, 0x12, 0x6e, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, - 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x12, 0x35, 0x2e, 0x63, 0x6f, 0x6d, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x55, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, + 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x5d, + 0x0a, 0x08, 0x47, 0x65, 0x74, 0x44, 0x72, 0x61, 0x66, 0x74, 0x12, 0x2b, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, - 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x21, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, - 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, - 0x72, 0x61, 0x66, 0x74, 0x12, 0x55, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x72, - 0x61, 0x66, 0x74, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, - 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x5a, 0x0a, 0x08, 0x47, - 0x65, 0x74, 0x44, 0x72, 0x61, 0x66, 0x74, 0x12, 0x2b, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x72, 0x61, 0x66, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, - 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x44, 0x72, 0x61, 0x66, 0x74, 0x12, 0x68, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x50, 0x72, - 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x6d, - 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x66, 0x69, - 0x6c, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, - 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x72, 0x61, 0x66, - 0x74, 0x12, 0x6e, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, - 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2f, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x6b, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x72, 0x61, 0x66, 0x74, 0x73, 0x12, - 0x2d, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, - 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x44, 0x72, 0x61, 0x66, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, - 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x44, 0x72, 0x61, 0x66, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x83, - 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x44, - 0x72, 0x61, 0x66, 0x74, 0x73, 0x12, 0x35, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, - 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x44, - 0x72, 0x61, 0x66, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x63, + 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x6e, 0x0a, + 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, - 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x72, 0x61, 0x66, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, 0x0a, 0x0c, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x44, - 0x72, 0x61, 0x66, 0x74, 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, - 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, - 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x32, 0xa6, 0x08, 0x0a, 0x09, 0x44, 0x6f, - 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x63, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x44, 0x6f, - 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, - 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, - 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x71, 0x0a, 0x12, - 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, - 0x6e, 0x74, 0x12, 0x35, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, - 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, - 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, - 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, - 0x7d, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x12, 0x33, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, - 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x47, 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, + 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x63, + 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, + 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x72, 0x61, 0x66, 0x74, 0x73, 0x12, 0x2d, 0x2e, 0x63, 0x6f, + 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x72, 0x61, + 0x66, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x63, 0x6f, 0x6d, + 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x72, 0x61, 0x66, + 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x83, 0x01, 0x0a, 0x12, 0x4c, + 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x72, 0x61, 0x66, 0x74, + 0x73, 0x12, 0x35, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x72, 0x61, 0x66, 0x74, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, - 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x69, - 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, - 0x12, 0x31, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, - 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x77, 0x0a, 0x15, 0x43, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, - 0x6e, 0x74, 0x12, 0x38, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x44, 0x72, 0x61, 0x66, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x68, 0x0a, 0x0c, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x44, 0x72, 0x61, 0x66, 0x74, + 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x50, 0x75, + 0x62, 0x6c, 0x69, 0x73, 0x68, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x27, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x50, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0xe8, 0x03, 0x0a, 0x0c, 0x50, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x6c, 0x0a, 0x0e, 0x47, + 0x65, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x31, 0x2e, + 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x27, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x50, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x7d, 0x0a, 0x10, 0x4c, 0x69, 0x73, + 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x33, 0x2e, + 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x44, 0x6f, 0x63, - 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x63, - 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, - 0x6e, 0x74, 0x12, 0x74, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, + 0x4c, 0x69, 0x73, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5d, 0x0a, 0x0f, 0x50, 0x75, 0x73, 0x68, + 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x2e, 0x63, 0x6f, + 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x50, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x8b, 0x01, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x3a, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, - 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x89, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, - 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, - 0x73, 0x12, 0x37, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, - 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, - 0x68, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x63, 0x6f, 0x6d, - 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, - 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x0c, 0x50, 0x75, 0x73, 0x68, 0x44, 0x6f, 0x63, 0x75, - 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, - 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x82, 0x01, - 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x44, 0x6f, 0x63, - 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x37, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, - 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x44, - 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x31, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x34, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x32, 0xd7, 0x01, 0x0a, 0x05, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x12, 0x65, 0x0a, 0x0c, - 0x4d, 0x65, 0x72, 0x67, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x2f, 0x2e, 0x63, + 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xda, 0x01, 0x0a, 0x05, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x12, + 0x68, 0x0a, 0x0c, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, + 0x2f, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4d, 0x65, 0x72, + 0x67, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x27, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x50, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x67, 0x0a, 0x0d, 0x52, 0x65, 0x62, + 0x61, 0x73, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x6d, + 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x62, 0x61, 0x73, 0x65, 0x43, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x43, - 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, - 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, - 0x65, 0x6e, 0x74, 0x12, 0x67, 0x0a, 0x0d, 0x52, 0x65, 0x62, 0x61, 0x73, 0x65, 0x43, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x73, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, - 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x52, 0x65, 0x62, 0x61, 0x73, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, - 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x33, 0x5a, 0x31, - 0x73, 0x65, 0x65, 0x64, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x67, 0x65, 0x6e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x3b, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x42, 0x33, 0x5a, 0x31, 0x73, 0x65, 0x65, 0x64, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, + 0x6e, 0x64, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x64, 0x6f, 0x63, 0x75, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x3b, 0x64, 0x6f, + 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3111,134 +1956,86 @@ func file_documents_v1alpha_documents_proto_rawDescGZIP() []byte { return file_documents_v1alpha_documents_proto_rawDescData } -var file_documents_v1alpha_documents_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_documents_v1alpha_documents_proto_msgTypes = make([]protoimpl.MessageInfo, 43) +var file_documents_v1alpha_documents_proto_msgTypes = make([]protoimpl.MessageInfo, 26) var file_documents_v1alpha_documents_proto_goTypes = []interface{}{ - (RoleType)(0), // 0: com.seed.documents.v1alpha.RoleType - (*CreateDraftRequest)(nil), // 1: com.seed.documents.v1alpha.CreateDraftRequest - (*CreateBranchDraftRequest)(nil), // 2: com.seed.documents.v1alpha.CreateBranchDraftRequest - (*CreateIndexDraftRequest)(nil), // 3: com.seed.documents.v1alpha.CreateIndexDraftRequest - (*CreateProfileDraftRequest)(nil), // 4: com.seed.documents.v1alpha.CreateProfileDraftRequest - (*DeleteDraftRequest)(nil), // 5: com.seed.documents.v1alpha.DeleteDraftRequest - (*GetDraftRequest)(nil), // 6: com.seed.documents.v1alpha.GetDraftRequest - (*GetProfileDraftRequest)(nil), // 7: com.seed.documents.v1alpha.GetProfileDraftRequest - (*UpdateDraftRequest)(nil), // 8: com.seed.documents.v1alpha.UpdateDraftRequest - (*UpdateDraftResponse)(nil), // 9: com.seed.documents.v1alpha.UpdateDraftResponse - (*DocumentChange)(nil), // 10: com.seed.documents.v1alpha.DocumentChange - (*ListDraftsRequest)(nil), // 11: com.seed.documents.v1alpha.ListDraftsRequest - (*ListDraftsResponse)(nil), // 12: com.seed.documents.v1alpha.ListDraftsResponse - (*ListDocumentDraftsRequest)(nil), // 13: com.seed.documents.v1alpha.ListDocumentDraftsRequest - (*ListDocumentDraftsResponse)(nil), // 14: com.seed.documents.v1alpha.ListDocumentDraftsResponse - (*PublishDraftRequest)(nil), // 15: com.seed.documents.v1alpha.PublishDraftRequest - (*GetDocumentRequest)(nil), // 16: com.seed.documents.v1alpha.GetDocumentRequest - (*GetProfileDocumentRequest)(nil), // 17: com.seed.documents.v1alpha.GetProfileDocumentRequest - (*GetDocumentIndexRequest)(nil), // 18: com.seed.documents.v1alpha.GetDocumentIndexRequest - (*GetDocumentIndexResponse)(nil), // 19: com.seed.documents.v1alpha.GetDocumentIndexResponse - (*ChangeDocumentRequest)(nil), // 20: com.seed.documents.v1alpha.ChangeDocumentRequest - (*ChangeProfileDocumentRequest)(nil), // 21: com.seed.documents.v1alpha.ChangeProfileDocumentRequest - (*PushDocumentRequest)(nil), // 22: com.seed.documents.v1alpha.PushDocumentRequest - (*ListDocumentsRequest)(nil), // 23: com.seed.documents.v1alpha.ListDocumentsRequest - (*ListDocumentsResponse)(nil), // 24: com.seed.documents.v1alpha.ListDocumentsResponse - (*ListDocumentBranchesRequest)(nil), // 25: com.seed.documents.v1alpha.ListDocumentBranchesRequest - (*ListDocumentBranchesResponse)(nil), // 26: com.seed.documents.v1alpha.ListDocumentBranchesResponse - (*Branch)(nil), // 27: com.seed.documents.v1alpha.Branch - (*ListAccountDocumentsRequest)(nil), // 28: com.seed.documents.v1alpha.ListAccountDocumentsRequest - (*MergeChangesRequest)(nil), // 29: com.seed.documents.v1alpha.MergeChangesRequest - (*RebaseChangesRequest)(nil), // 30: com.seed.documents.v1alpha.RebaseChangesRequest - (*Draft)(nil), // 31: com.seed.documents.v1alpha.Draft - (*Document)(nil), // 32: com.seed.documents.v1alpha.Document - (*BlockNode)(nil), // 33: com.seed.documents.v1alpha.BlockNode - (*Block)(nil), // 34: com.seed.documents.v1alpha.Block - (*Annotation)(nil), // 35: com.seed.documents.v1alpha.Annotation - (*DocumentChange_MoveBlock)(nil), // 36: com.seed.documents.v1alpha.DocumentChange.MoveBlock - (*DocumentChange_SetMetadata)(nil), // 37: com.seed.documents.v1alpha.DocumentChange.SetMetadata - (*DocumentChange_SetIndex)(nil), // 38: com.seed.documents.v1alpha.DocumentChange.SetIndex - (*DocumentChange_UpdateMember)(nil), // 39: com.seed.documents.v1alpha.DocumentChange.UpdateMember - nil, // 40: com.seed.documents.v1alpha.Document.MetadataEntry - nil, // 41: com.seed.documents.v1alpha.Document.IndexEntry - nil, // 42: com.seed.documents.v1alpha.Block.AttributesEntry - nil, // 43: com.seed.documents.v1alpha.Annotation.AttributesEntry - (*timestamppb.Timestamp)(nil), // 44: google.protobuf.Timestamp - (*emptypb.Empty)(nil), // 45: google.protobuf.Empty + (*CreateDraftRequest)(nil), // 0: com.seed.documents.v1alpha.CreateDraftRequest + (*DeleteDraftRequest)(nil), // 1: com.seed.documents.v1alpha.DeleteDraftRequest + (*GetDraftRequest)(nil), // 2: com.seed.documents.v1alpha.GetDraftRequest + (*UpdateDraftRequest)(nil), // 3: com.seed.documents.v1alpha.UpdateDraftRequest + (*UpdateDraftResponse)(nil), // 4: com.seed.documents.v1alpha.UpdateDraftResponse + (*DocumentChange)(nil), // 5: com.seed.documents.v1alpha.DocumentChange + (*ListDraftsRequest)(nil), // 6: com.seed.documents.v1alpha.ListDraftsRequest + (*ListDraftsResponse)(nil), // 7: com.seed.documents.v1alpha.ListDraftsResponse + (*ListDocumentDraftsRequest)(nil), // 8: com.seed.documents.v1alpha.ListDocumentDraftsRequest + (*ListDocumentDraftsResponse)(nil), // 9: com.seed.documents.v1alpha.ListDocumentDraftsResponse + (*PublishDraftRequest)(nil), // 10: com.seed.documents.v1alpha.PublishDraftRequest + (*GetPublicationRequest)(nil), // 11: com.seed.documents.v1alpha.GetPublicationRequest + (*PushPublicationRequest)(nil), // 12: com.seed.documents.v1alpha.PushPublicationRequest + (*ListPublicationsRequest)(nil), // 13: com.seed.documents.v1alpha.ListPublicationsRequest + (*ListPublicationsResponse)(nil), // 14: com.seed.documents.v1alpha.ListPublicationsResponse + (*ListAccountPublicationsRequest)(nil), // 15: com.seed.documents.v1alpha.ListAccountPublicationsRequest + (*MergeChangesRequest)(nil), // 16: com.seed.documents.v1alpha.MergeChangesRequest + (*RebaseChangesRequest)(nil), // 17: com.seed.documents.v1alpha.RebaseChangesRequest + (*Publication)(nil), // 18: com.seed.documents.v1alpha.Publication + (*Document)(nil), // 19: com.seed.documents.v1alpha.Document + (*BlockNode)(nil), // 20: com.seed.documents.v1alpha.BlockNode + (*Block)(nil), // 21: com.seed.documents.v1alpha.Block + (*Annotation)(nil), // 22: com.seed.documents.v1alpha.Annotation + (*DocumentChange_MoveBlock)(nil), // 23: com.seed.documents.v1alpha.DocumentChange.MoveBlock + nil, // 24: com.seed.documents.v1alpha.Block.AttributesEntry + nil, // 25: com.seed.documents.v1alpha.Annotation.AttributesEntry + (*timestamppb.Timestamp)(nil), // 26: google.protobuf.Timestamp + (*emptypb.Empty)(nil), // 27: google.protobuf.Empty } var file_documents_v1alpha_documents_proto_depIdxs = []int32{ - 10, // 0: com.seed.documents.v1alpha.UpdateDraftRequest.changes:type_name -> com.seed.documents.v1alpha.DocumentChange - 32, // 1: com.seed.documents.v1alpha.UpdateDraftResponse.updated_document:type_name -> com.seed.documents.v1alpha.Document - 37, // 2: com.seed.documents.v1alpha.DocumentChange.set_metadata:type_name -> com.seed.documents.v1alpha.DocumentChange.SetMetadata - 38, // 3: com.seed.documents.v1alpha.DocumentChange.set_index:type_name -> com.seed.documents.v1alpha.DocumentChange.SetIndex - 36, // 4: com.seed.documents.v1alpha.DocumentChange.move_block:type_name -> com.seed.documents.v1alpha.DocumentChange.MoveBlock - 34, // 5: com.seed.documents.v1alpha.DocumentChange.replace_block:type_name -> com.seed.documents.v1alpha.Block - 39, // 6: com.seed.documents.v1alpha.DocumentChange.update_member:type_name -> com.seed.documents.v1alpha.DocumentChange.UpdateMember - 32, // 7: com.seed.documents.v1alpha.ListDraftsResponse.documents:type_name -> com.seed.documents.v1alpha.Document - 32, // 8: com.seed.documents.v1alpha.ListDocumentDraftsResponse.drafts:type_name -> com.seed.documents.v1alpha.Document - 32, // 9: com.seed.documents.v1alpha.GetDocumentIndexResponse.document:type_name -> com.seed.documents.v1alpha.Document - 10, // 10: com.seed.documents.v1alpha.ChangeDocumentRequest.changes:type_name -> com.seed.documents.v1alpha.DocumentChange - 10, // 11: com.seed.documents.v1alpha.ChangeProfileDocumentRequest.changes:type_name -> com.seed.documents.v1alpha.DocumentChange - 32, // 12: com.seed.documents.v1alpha.ListDocumentsResponse.documents:type_name -> com.seed.documents.v1alpha.Document - 27, // 13: com.seed.documents.v1alpha.ListDocumentBranchesResponse.branches:type_name -> com.seed.documents.v1alpha.Branch - 31, // 14: com.seed.documents.v1alpha.ListDocumentBranchesResponse.drafts:type_name -> com.seed.documents.v1alpha.Draft - 32, // 15: com.seed.documents.v1alpha.Draft.document:type_name -> com.seed.documents.v1alpha.Document - 40, // 16: com.seed.documents.v1alpha.Document.metadata:type_name -> com.seed.documents.v1alpha.Document.MetadataEntry - 33, // 17: com.seed.documents.v1alpha.Document.content:type_name -> com.seed.documents.v1alpha.BlockNode - 41, // 18: com.seed.documents.v1alpha.Document.index:type_name -> com.seed.documents.v1alpha.Document.IndexEntry - 44, // 19: com.seed.documents.v1alpha.Document.create_time:type_name -> google.protobuf.Timestamp - 44, // 20: com.seed.documents.v1alpha.Document.update_time:type_name -> google.protobuf.Timestamp - 44, // 21: com.seed.documents.v1alpha.Document.publish_time:type_name -> google.protobuf.Timestamp - 34, // 22: com.seed.documents.v1alpha.BlockNode.block:type_name -> com.seed.documents.v1alpha.Block - 33, // 23: com.seed.documents.v1alpha.BlockNode.children:type_name -> com.seed.documents.v1alpha.BlockNode - 42, // 24: com.seed.documents.v1alpha.Block.attributes:type_name -> com.seed.documents.v1alpha.Block.AttributesEntry - 35, // 25: com.seed.documents.v1alpha.Block.annotations:type_name -> com.seed.documents.v1alpha.Annotation - 43, // 26: com.seed.documents.v1alpha.Annotation.attributes:type_name -> com.seed.documents.v1alpha.Annotation.AttributesEntry - 0, // 27: com.seed.documents.v1alpha.DocumentChange.UpdateMember.role:type_name -> com.seed.documents.v1alpha.RoleType - 1, // 28: com.seed.documents.v1alpha.Drafts.CreateDraft:input_type -> com.seed.documents.v1alpha.CreateDraftRequest - 2, // 29: com.seed.documents.v1alpha.Drafts.CreateBranchDraft:input_type -> com.seed.documents.v1alpha.CreateBranchDraftRequest - 3, // 30: com.seed.documents.v1alpha.Drafts.CreateIndexDraft:input_type -> com.seed.documents.v1alpha.CreateIndexDraftRequest - 4, // 31: com.seed.documents.v1alpha.Drafts.CreateProfileDraft:input_type -> com.seed.documents.v1alpha.CreateProfileDraftRequest - 5, // 32: com.seed.documents.v1alpha.Drafts.DeleteDraft:input_type -> com.seed.documents.v1alpha.DeleteDraftRequest - 6, // 33: com.seed.documents.v1alpha.Drafts.GetDraft:input_type -> com.seed.documents.v1alpha.GetDraftRequest - 7, // 34: com.seed.documents.v1alpha.Drafts.GetProfileDraft:input_type -> com.seed.documents.v1alpha.GetProfileDraftRequest - 8, // 35: com.seed.documents.v1alpha.Drafts.UpdateDraft:input_type -> com.seed.documents.v1alpha.UpdateDraftRequest - 11, // 36: com.seed.documents.v1alpha.Drafts.ListDrafts:input_type -> com.seed.documents.v1alpha.ListDraftsRequest - 13, // 37: com.seed.documents.v1alpha.Drafts.ListDocumentDrafts:input_type -> com.seed.documents.v1alpha.ListDocumentDraftsRequest - 15, // 38: com.seed.documents.v1alpha.Drafts.PublishDraft:input_type -> com.seed.documents.v1alpha.PublishDraftRequest - 16, // 39: com.seed.documents.v1alpha.Documents.GetDocument:input_type -> com.seed.documents.v1alpha.GetDocumentRequest - 17, // 40: com.seed.documents.v1alpha.Documents.GetProfileDocument:input_type -> com.seed.documents.v1alpha.GetProfileDocumentRequest - 18, // 41: com.seed.documents.v1alpha.Documents.GetDocumentIndex:input_type -> com.seed.documents.v1alpha.GetDocumentIndexRequest - 20, // 42: com.seed.documents.v1alpha.Documents.ChangeDocument:input_type -> com.seed.documents.v1alpha.ChangeDocumentRequest - 21, // 43: com.seed.documents.v1alpha.Documents.ChangeProfileDocument:input_type -> com.seed.documents.v1alpha.ChangeProfileDocumentRequest - 23, // 44: com.seed.documents.v1alpha.Documents.ListDocuments:input_type -> com.seed.documents.v1alpha.ListDocumentsRequest - 25, // 45: com.seed.documents.v1alpha.Documents.ListDocumentBranches:input_type -> com.seed.documents.v1alpha.ListDocumentBranchesRequest - 22, // 46: com.seed.documents.v1alpha.Documents.PushDocument:input_type -> com.seed.documents.v1alpha.PushDocumentRequest - 28, // 47: com.seed.documents.v1alpha.Documents.ListAccountDocuments:input_type -> com.seed.documents.v1alpha.ListAccountDocumentsRequest - 29, // 48: com.seed.documents.v1alpha.Merge.MergeChanges:input_type -> com.seed.documents.v1alpha.MergeChangesRequest - 30, // 49: com.seed.documents.v1alpha.Merge.RebaseChanges:input_type -> com.seed.documents.v1alpha.RebaseChangesRequest - 31, // 50: com.seed.documents.v1alpha.Drafts.CreateDraft:output_type -> com.seed.documents.v1alpha.Draft - 31, // 51: com.seed.documents.v1alpha.Drafts.CreateBranchDraft:output_type -> com.seed.documents.v1alpha.Draft - 31, // 52: com.seed.documents.v1alpha.Drafts.CreateIndexDraft:output_type -> com.seed.documents.v1alpha.Draft - 31, // 53: com.seed.documents.v1alpha.Drafts.CreateProfileDraft:output_type -> com.seed.documents.v1alpha.Draft - 45, // 54: com.seed.documents.v1alpha.Drafts.DeleteDraft:output_type -> google.protobuf.Empty - 31, // 55: com.seed.documents.v1alpha.Drafts.GetDraft:output_type -> com.seed.documents.v1alpha.Draft - 31, // 56: com.seed.documents.v1alpha.Drafts.GetProfileDraft:output_type -> com.seed.documents.v1alpha.Draft - 9, // 57: com.seed.documents.v1alpha.Drafts.UpdateDraft:output_type -> com.seed.documents.v1alpha.UpdateDraftResponse - 12, // 58: com.seed.documents.v1alpha.Drafts.ListDrafts:output_type -> com.seed.documents.v1alpha.ListDraftsResponse - 14, // 59: com.seed.documents.v1alpha.Drafts.ListDocumentDrafts:output_type -> com.seed.documents.v1alpha.ListDocumentDraftsResponse - 27, // 60: com.seed.documents.v1alpha.Drafts.PublishDraft:output_type -> com.seed.documents.v1alpha.Branch - 32, // 61: com.seed.documents.v1alpha.Documents.GetDocument:output_type -> com.seed.documents.v1alpha.Document - 32, // 62: com.seed.documents.v1alpha.Documents.GetProfileDocument:output_type -> com.seed.documents.v1alpha.Document - 19, // 63: com.seed.documents.v1alpha.Documents.GetDocumentIndex:output_type -> com.seed.documents.v1alpha.GetDocumentIndexResponse - 32, // 64: com.seed.documents.v1alpha.Documents.ChangeDocument:output_type -> com.seed.documents.v1alpha.Document - 32, // 65: com.seed.documents.v1alpha.Documents.ChangeProfileDocument:output_type -> com.seed.documents.v1alpha.Document - 24, // 66: com.seed.documents.v1alpha.Documents.ListDocuments:output_type -> com.seed.documents.v1alpha.ListDocumentsResponse - 26, // 67: com.seed.documents.v1alpha.Documents.ListDocumentBranches:output_type -> com.seed.documents.v1alpha.ListDocumentBranchesResponse - 45, // 68: com.seed.documents.v1alpha.Documents.PushDocument:output_type -> google.protobuf.Empty - 24, // 69: com.seed.documents.v1alpha.Documents.ListAccountDocuments:output_type -> com.seed.documents.v1alpha.ListDocumentsResponse - 32, // 70: com.seed.documents.v1alpha.Merge.MergeChanges:output_type -> com.seed.documents.v1alpha.Document - 32, // 71: com.seed.documents.v1alpha.Merge.RebaseChanges:output_type -> com.seed.documents.v1alpha.Document - 50, // [50:72] is the sub-list for method output_type - 28, // [28:50] is the sub-list for method input_type - 28, // [28:28] is the sub-list for extension type_name - 28, // [28:28] is the sub-list for extension extendee - 0, // [0:28] is the sub-list for field type_name + 5, // 0: com.seed.documents.v1alpha.UpdateDraftRequest.changes:type_name -> com.seed.documents.v1alpha.DocumentChange + 19, // 1: com.seed.documents.v1alpha.UpdateDraftResponse.updated_document:type_name -> com.seed.documents.v1alpha.Document + 23, // 2: com.seed.documents.v1alpha.DocumentChange.move_block:type_name -> com.seed.documents.v1alpha.DocumentChange.MoveBlock + 21, // 3: com.seed.documents.v1alpha.DocumentChange.replace_block:type_name -> com.seed.documents.v1alpha.Block + 19, // 4: com.seed.documents.v1alpha.ListDraftsResponse.documents:type_name -> com.seed.documents.v1alpha.Document + 19, // 5: com.seed.documents.v1alpha.ListDocumentDraftsResponse.drafts:type_name -> com.seed.documents.v1alpha.Document + 18, // 6: com.seed.documents.v1alpha.ListPublicationsResponse.publications:type_name -> com.seed.documents.v1alpha.Publication + 19, // 7: com.seed.documents.v1alpha.Publication.document:type_name -> com.seed.documents.v1alpha.Document + 20, // 8: com.seed.documents.v1alpha.Document.children:type_name -> com.seed.documents.v1alpha.BlockNode + 26, // 9: com.seed.documents.v1alpha.Document.create_time:type_name -> google.protobuf.Timestamp + 26, // 10: com.seed.documents.v1alpha.Document.update_time:type_name -> google.protobuf.Timestamp + 26, // 11: com.seed.documents.v1alpha.Document.publish_time:type_name -> google.protobuf.Timestamp + 21, // 12: com.seed.documents.v1alpha.BlockNode.block:type_name -> com.seed.documents.v1alpha.Block + 20, // 13: com.seed.documents.v1alpha.BlockNode.children:type_name -> com.seed.documents.v1alpha.BlockNode + 24, // 14: com.seed.documents.v1alpha.Block.attributes:type_name -> com.seed.documents.v1alpha.Block.AttributesEntry + 22, // 15: com.seed.documents.v1alpha.Block.annotations:type_name -> com.seed.documents.v1alpha.Annotation + 25, // 16: com.seed.documents.v1alpha.Annotation.attributes:type_name -> com.seed.documents.v1alpha.Annotation.AttributesEntry + 0, // 17: com.seed.documents.v1alpha.Drafts.CreateDraft:input_type -> com.seed.documents.v1alpha.CreateDraftRequest + 1, // 18: com.seed.documents.v1alpha.Drafts.DeleteDraft:input_type -> com.seed.documents.v1alpha.DeleteDraftRequest + 2, // 19: com.seed.documents.v1alpha.Drafts.GetDraft:input_type -> com.seed.documents.v1alpha.GetDraftRequest + 3, // 20: com.seed.documents.v1alpha.Drafts.UpdateDraft:input_type -> com.seed.documents.v1alpha.UpdateDraftRequest + 6, // 21: com.seed.documents.v1alpha.Drafts.ListDrafts:input_type -> com.seed.documents.v1alpha.ListDraftsRequest + 8, // 22: com.seed.documents.v1alpha.Drafts.ListDocumentDrafts:input_type -> com.seed.documents.v1alpha.ListDocumentDraftsRequest + 10, // 23: com.seed.documents.v1alpha.Drafts.PublishDraft:input_type -> com.seed.documents.v1alpha.PublishDraftRequest + 11, // 24: com.seed.documents.v1alpha.Publications.GetPublication:input_type -> com.seed.documents.v1alpha.GetPublicationRequest + 13, // 25: com.seed.documents.v1alpha.Publications.ListPublications:input_type -> com.seed.documents.v1alpha.ListPublicationsRequest + 12, // 26: com.seed.documents.v1alpha.Publications.PushPublication:input_type -> com.seed.documents.v1alpha.PushPublicationRequest + 15, // 27: com.seed.documents.v1alpha.Publications.ListAccountPublications:input_type -> com.seed.documents.v1alpha.ListAccountPublicationsRequest + 16, // 28: com.seed.documents.v1alpha.Merge.MergeChanges:input_type -> com.seed.documents.v1alpha.MergeChangesRequest + 17, // 29: com.seed.documents.v1alpha.Merge.RebaseChanges:input_type -> com.seed.documents.v1alpha.RebaseChangesRequest + 19, // 30: com.seed.documents.v1alpha.Drafts.CreateDraft:output_type -> com.seed.documents.v1alpha.Document + 27, // 31: com.seed.documents.v1alpha.Drafts.DeleteDraft:output_type -> google.protobuf.Empty + 19, // 32: com.seed.documents.v1alpha.Drafts.GetDraft:output_type -> com.seed.documents.v1alpha.Document + 4, // 33: com.seed.documents.v1alpha.Drafts.UpdateDraft:output_type -> com.seed.documents.v1alpha.UpdateDraftResponse + 7, // 34: com.seed.documents.v1alpha.Drafts.ListDrafts:output_type -> com.seed.documents.v1alpha.ListDraftsResponse + 9, // 35: com.seed.documents.v1alpha.Drafts.ListDocumentDrafts:output_type -> com.seed.documents.v1alpha.ListDocumentDraftsResponse + 18, // 36: com.seed.documents.v1alpha.Drafts.PublishDraft:output_type -> com.seed.documents.v1alpha.Publication + 18, // 37: com.seed.documents.v1alpha.Publications.GetPublication:output_type -> com.seed.documents.v1alpha.Publication + 14, // 38: com.seed.documents.v1alpha.Publications.ListPublications:output_type -> com.seed.documents.v1alpha.ListPublicationsResponse + 27, // 39: com.seed.documents.v1alpha.Publications.PushPublication:output_type -> google.protobuf.Empty + 14, // 40: com.seed.documents.v1alpha.Publications.ListAccountPublications:output_type -> com.seed.documents.v1alpha.ListPublicationsResponse + 18, // 41: com.seed.documents.v1alpha.Merge.MergeChanges:output_type -> com.seed.documents.v1alpha.Publication + 19, // 42: com.seed.documents.v1alpha.Merge.RebaseChanges:output_type -> com.seed.documents.v1alpha.Document + 30, // [30:43] is the sub-list for method output_type + 17, // [17:30] is the sub-list for method input_type + 17, // [17:17] is the sub-list for extension type_name + 17, // [17:17] is the sub-list for extension extendee + 0, // [0:17] is the sub-list for field type_name } func init() { file_documents_v1alpha_documents_proto_init() } @@ -3260,7 +2057,7 @@ func file_documents_v1alpha_documents_proto_init() { } } file_documents_v1alpha_documents_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateBranchDraftRequest); i { + switch v := v.(*DeleteDraftRequest); i { case 0: return &v.state case 1: @@ -3272,7 +2069,7 @@ func file_documents_v1alpha_documents_proto_init() { } } file_documents_v1alpha_documents_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateIndexDraftRequest); i { + switch v := v.(*GetDraftRequest); i { case 0: return &v.state case 1: @@ -3284,7 +2081,7 @@ func file_documents_v1alpha_documents_proto_init() { } } file_documents_v1alpha_documents_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateProfileDraftRequest); i { + switch v := v.(*UpdateDraftRequest); i { case 0: return &v.state case 1: @@ -3296,7 +2093,7 @@ func file_documents_v1alpha_documents_proto_init() { } } file_documents_v1alpha_documents_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteDraftRequest); i { + switch v := v.(*UpdateDraftResponse); i { case 0: return &v.state case 1: @@ -3308,7 +2105,7 @@ func file_documents_v1alpha_documents_proto_init() { } } file_documents_v1alpha_documents_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDraftRequest); i { + switch v := v.(*DocumentChange); i { case 0: return &v.state case 1: @@ -3320,7 +2117,7 @@ func file_documents_v1alpha_documents_proto_init() { } } file_documents_v1alpha_documents_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetProfileDraftRequest); i { + switch v := v.(*ListDraftsRequest); i { case 0: return &v.state case 1: @@ -3332,7 +2129,7 @@ func file_documents_v1alpha_documents_proto_init() { } } file_documents_v1alpha_documents_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateDraftRequest); i { + switch v := v.(*ListDraftsResponse); i { case 0: return &v.state case 1: @@ -3344,7 +2141,7 @@ func file_documents_v1alpha_documents_proto_init() { } } file_documents_v1alpha_documents_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateDraftResponse); i { + switch v := v.(*ListDocumentDraftsRequest); i { case 0: return &v.state case 1: @@ -3356,7 +2153,7 @@ func file_documents_v1alpha_documents_proto_init() { } } file_documents_v1alpha_documents_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DocumentChange); i { + switch v := v.(*ListDocumentDraftsResponse); i { case 0: return &v.state case 1: @@ -3368,7 +2165,7 @@ func file_documents_v1alpha_documents_proto_init() { } } file_documents_v1alpha_documents_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListDraftsRequest); i { + switch v := v.(*PublishDraftRequest); i { case 0: return &v.state case 1: @@ -3380,7 +2177,7 @@ func file_documents_v1alpha_documents_proto_init() { } } file_documents_v1alpha_documents_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListDraftsResponse); i { + switch v := v.(*GetPublicationRequest); i { case 0: return &v.state case 1: @@ -3392,7 +2189,7 @@ func file_documents_v1alpha_documents_proto_init() { } } file_documents_v1alpha_documents_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListDocumentDraftsRequest); i { + switch v := v.(*PushPublicationRequest); i { case 0: return &v.state case 1: @@ -3404,7 +2201,7 @@ func file_documents_v1alpha_documents_proto_init() { } } file_documents_v1alpha_documents_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListDocumentDraftsResponse); i { + switch v := v.(*ListPublicationsRequest); i { case 0: return &v.state case 1: @@ -3416,7 +2213,7 @@ func file_documents_v1alpha_documents_proto_init() { } } file_documents_v1alpha_documents_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PublishDraftRequest); i { + switch v := v.(*ListPublicationsResponse); i { case 0: return &v.state case 1: @@ -3428,7 +2225,7 @@ func file_documents_v1alpha_documents_proto_init() { } } file_documents_v1alpha_documents_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDocumentRequest); i { + switch v := v.(*ListAccountPublicationsRequest); i { case 0: return &v.state case 1: @@ -3440,7 +2237,7 @@ func file_documents_v1alpha_documents_proto_init() { } } file_documents_v1alpha_documents_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetProfileDocumentRequest); i { + switch v := v.(*MergeChangesRequest); i { case 0: return &v.state case 1: @@ -3452,7 +2249,7 @@ func file_documents_v1alpha_documents_proto_init() { } } file_documents_v1alpha_documents_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDocumentIndexRequest); i { + switch v := v.(*RebaseChangesRequest); i { case 0: return &v.state case 1: @@ -3464,7 +2261,7 @@ func file_documents_v1alpha_documents_proto_init() { } } file_documents_v1alpha_documents_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDocumentIndexResponse); i { + switch v := v.(*Publication); i { case 0: return &v.state case 1: @@ -3476,150 +2273,6 @@ func file_documents_v1alpha_documents_proto_init() { } } file_documents_v1alpha_documents_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChangeDocumentRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_documents_v1alpha_documents_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChangeProfileDocumentRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_documents_v1alpha_documents_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PushDocumentRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_documents_v1alpha_documents_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListDocumentsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_documents_v1alpha_documents_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListDocumentsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_documents_v1alpha_documents_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListDocumentBranchesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_documents_v1alpha_documents_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListDocumentBranchesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_documents_v1alpha_documents_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Branch); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_documents_v1alpha_documents_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListAccountDocumentsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_documents_v1alpha_documents_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MergeChangesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_documents_v1alpha_documents_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RebaseChangesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_documents_v1alpha_documents_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Draft); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_documents_v1alpha_documents_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Document); i { case 0: return &v.state @@ -3631,7 +2284,7 @@ func file_documents_v1alpha_documents_proto_init() { return nil } } - file_documents_v1alpha_documents_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + file_documents_v1alpha_documents_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BlockNode); i { case 0: return &v.state @@ -3643,7 +2296,7 @@ func file_documents_v1alpha_documents_proto_init() { return nil } } - file_documents_v1alpha_documents_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + file_documents_v1alpha_documents_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Block); i { case 0: return &v.state @@ -3655,7 +2308,7 @@ func file_documents_v1alpha_documents_proto_init() { return nil } } - file_documents_v1alpha_documents_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + file_documents_v1alpha_documents_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Annotation); i { case 0: return &v.state @@ -3667,7 +2320,7 @@ func file_documents_v1alpha_documents_proto_init() { return nil } } - file_documents_v1alpha_documents_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + file_documents_v1alpha_documents_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DocumentChange_MoveBlock); i { case 0: return &v.state @@ -3679,64 +2332,25 @@ func file_documents_v1alpha_documents_proto_init() { return nil } } - file_documents_v1alpha_documents_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DocumentChange_SetMetadata); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_documents_v1alpha_documents_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DocumentChange_SetIndex); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_documents_v1alpha_documents_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DocumentChange_UpdateMember); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } } - file_documents_v1alpha_documents_proto_msgTypes[9].OneofWrappers = []interface{}{ - (*DocumentChange_SetMetadata_)(nil), - (*DocumentChange_SetIndex_)(nil), + file_documents_v1alpha_documents_proto_msgTypes[5].OneofWrappers = []interface{}{ + (*DocumentChange_SetTitle)(nil), (*DocumentChange_MoveBlock_)(nil), (*DocumentChange_ReplaceBlock)(nil), (*DocumentChange_DeleteBlock)(nil), - (*DocumentChange_UpdateMember_)(nil), } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_documents_v1alpha_documents_proto_rawDesc, - NumEnums: 1, - NumMessages: 43, + NumEnums: 0, + NumMessages: 26, NumExtensions: 0, NumServices: 3, }, GoTypes: file_documents_v1alpha_documents_proto_goTypes, DependencyIndexes: file_documents_v1alpha_documents_proto_depIdxs, - EnumInfos: file_documents_v1alpha_documents_proto_enumTypes, MessageInfos: file_documents_v1alpha_documents_proto_msgTypes, }.Build() File_documents_v1alpha_documents_proto = out.File diff --git a/backend/genproto/documents/v1alpha/documents_grpc.pb.go b/backend/genproto/documents/v1alpha/documents_grpc.pb.go index 1e91aa924..a1c40ea3a 100644 --- a/backend/genproto/documents/v1alpha/documents_grpc.pb.go +++ b/backend/genproto/documents/v1alpha/documents_grpc.pb.go @@ -23,28 +23,20 @@ const _ = grpc.SupportPackageIsVersion7 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type DraftsClient interface { - // Creates a new draft of an existing standalone branch - CreateDraft(ctx context.Context, in *CreateDraftRequest, opts ...grpc.CallOption) (*Draft, error) - // Creates a draft for a new branch. - CreateBranchDraft(ctx context.Context, in *CreateBranchDraftRequest, opts ...grpc.CallOption) (*Draft, error) - // Creates a draft for an index branch. Thows if a draft already exists for this index. - CreateIndexDraft(ctx context.Context, in *CreateIndexDraftRequest, opts ...grpc.CallOption) (*Draft, error) - // Create a draft for a profile document. Thows if a draft already exists for this profile. - CreateProfileDraft(ctx context.Context, in *CreateProfileDraftRequest, opts ...grpc.CallOption) (*Draft, error) + // Creates a new draft with a new permanent document ID. + CreateDraft(ctx context.Context, in *CreateDraftRequest, opts ...grpc.CallOption) (*Document, error) // Deletes a draft by its document ID. DeleteDraft(ctx context.Context, in *DeleteDraftRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // Gets a single draft if exists. - GetDraft(ctx context.Context, in *GetDraftRequest, opts ...grpc.CallOption) (*Draft, error) - // Gets a draft for a profile document. - GetProfileDraft(ctx context.Context, in *GetProfileDraftRequest, opts ...grpc.CallOption) (*Draft, error) + GetDraft(ctx context.Context, in *GetDraftRequest, opts ...grpc.CallOption) (*Document, error) // Updates a draft using granular update operations. UpdateDraft(ctx context.Context, in *UpdateDraftRequest, opts ...grpc.CallOption) (*UpdateDraftResponse, error) // List currently stored drafts. ListDrafts(ctx context.Context, in *ListDraftsRequest, opts ...grpc.CallOption) (*ListDraftsResponse, error) // Lists drafts for a given document. ListDocumentDrafts(ctx context.Context, in *ListDocumentDraftsRequest, opts ...grpc.CallOption) (*ListDocumentDraftsResponse, error) - // Publishes a draft. Returns the branch that was published. - PublishDraft(ctx context.Context, in *PublishDraftRequest, opts ...grpc.CallOption) (*Branch, error) + // Publishes a draft. I.e. draft will become a publication, and will no longer appear in drafts section. + PublishDraft(ctx context.Context, in *PublishDraftRequest, opts ...grpc.CallOption) (*Publication, error) } type draftsClient struct { @@ -55,8 +47,8 @@ func NewDraftsClient(cc grpc.ClientConnInterface) DraftsClient { return &draftsClient{cc} } -func (c *draftsClient) CreateDraft(ctx context.Context, in *CreateDraftRequest, opts ...grpc.CallOption) (*Draft, error) { - out := new(Draft) +func (c *draftsClient) CreateDraft(ctx context.Context, in *CreateDraftRequest, opts ...grpc.CallOption) (*Document, error) { + out := new(Document) err := c.cc.Invoke(ctx, "/com.seed.documents.v1alpha.Drafts/CreateDraft", in, out, opts...) if err != nil { return nil, err @@ -64,33 +56,6 @@ func (c *draftsClient) CreateDraft(ctx context.Context, in *CreateDraftRequest, return out, nil } -func (c *draftsClient) CreateBranchDraft(ctx context.Context, in *CreateBranchDraftRequest, opts ...grpc.CallOption) (*Draft, error) { - out := new(Draft) - err := c.cc.Invoke(ctx, "/com.seed.documents.v1alpha.Drafts/CreateBranchDraft", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *draftsClient) CreateIndexDraft(ctx context.Context, in *CreateIndexDraftRequest, opts ...grpc.CallOption) (*Draft, error) { - out := new(Draft) - err := c.cc.Invoke(ctx, "/com.seed.documents.v1alpha.Drafts/CreateIndexDraft", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *draftsClient) CreateProfileDraft(ctx context.Context, in *CreateProfileDraftRequest, opts ...grpc.CallOption) (*Draft, error) { - out := new(Draft) - err := c.cc.Invoke(ctx, "/com.seed.documents.v1alpha.Drafts/CreateProfileDraft", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *draftsClient) DeleteDraft(ctx context.Context, in *DeleteDraftRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) err := c.cc.Invoke(ctx, "/com.seed.documents.v1alpha.Drafts/DeleteDraft", in, out, opts...) @@ -100,8 +65,8 @@ func (c *draftsClient) DeleteDraft(ctx context.Context, in *DeleteDraftRequest, return out, nil } -func (c *draftsClient) GetDraft(ctx context.Context, in *GetDraftRequest, opts ...grpc.CallOption) (*Draft, error) { - out := new(Draft) +func (c *draftsClient) GetDraft(ctx context.Context, in *GetDraftRequest, opts ...grpc.CallOption) (*Document, error) { + out := new(Document) err := c.cc.Invoke(ctx, "/com.seed.documents.v1alpha.Drafts/GetDraft", in, out, opts...) if err != nil { return nil, err @@ -109,15 +74,6 @@ func (c *draftsClient) GetDraft(ctx context.Context, in *GetDraftRequest, opts . return out, nil } -func (c *draftsClient) GetProfileDraft(ctx context.Context, in *GetProfileDraftRequest, opts ...grpc.CallOption) (*Draft, error) { - out := new(Draft) - err := c.cc.Invoke(ctx, "/com.seed.documents.v1alpha.Drafts/GetProfileDraft", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *draftsClient) UpdateDraft(ctx context.Context, in *UpdateDraftRequest, opts ...grpc.CallOption) (*UpdateDraftResponse, error) { out := new(UpdateDraftResponse) err := c.cc.Invoke(ctx, "/com.seed.documents.v1alpha.Drafts/UpdateDraft", in, out, opts...) @@ -145,8 +101,8 @@ func (c *draftsClient) ListDocumentDrafts(ctx context.Context, in *ListDocumentD return out, nil } -func (c *draftsClient) PublishDraft(ctx context.Context, in *PublishDraftRequest, opts ...grpc.CallOption) (*Branch, error) { - out := new(Branch) +func (c *draftsClient) PublishDraft(ctx context.Context, in *PublishDraftRequest, opts ...grpc.CallOption) (*Publication, error) { + out := new(Publication) err := c.cc.Invoke(ctx, "/com.seed.documents.v1alpha.Drafts/PublishDraft", in, out, opts...) if err != nil { return nil, err @@ -158,55 +114,35 @@ func (c *draftsClient) PublishDraft(ctx context.Context, in *PublishDraftRequest // All implementations should embed UnimplementedDraftsServer // for forward compatibility type DraftsServer interface { - // Creates a new draft of an existing standalone branch - CreateDraft(context.Context, *CreateDraftRequest) (*Draft, error) - // Creates a draft for a new branch. - CreateBranchDraft(context.Context, *CreateBranchDraftRequest) (*Draft, error) - // Creates a draft for an index branch. Thows if a draft already exists for this index. - CreateIndexDraft(context.Context, *CreateIndexDraftRequest) (*Draft, error) - // Create a draft for a profile document. Thows if a draft already exists for this profile. - CreateProfileDraft(context.Context, *CreateProfileDraftRequest) (*Draft, error) + // Creates a new draft with a new permanent document ID. + CreateDraft(context.Context, *CreateDraftRequest) (*Document, error) // Deletes a draft by its document ID. DeleteDraft(context.Context, *DeleteDraftRequest) (*emptypb.Empty, error) // Gets a single draft if exists. - GetDraft(context.Context, *GetDraftRequest) (*Draft, error) - // Gets a draft for a profile document. - GetProfileDraft(context.Context, *GetProfileDraftRequest) (*Draft, error) + GetDraft(context.Context, *GetDraftRequest) (*Document, error) // Updates a draft using granular update operations. UpdateDraft(context.Context, *UpdateDraftRequest) (*UpdateDraftResponse, error) // List currently stored drafts. ListDrafts(context.Context, *ListDraftsRequest) (*ListDraftsResponse, error) // Lists drafts for a given document. ListDocumentDrafts(context.Context, *ListDocumentDraftsRequest) (*ListDocumentDraftsResponse, error) - // Publishes a draft. Returns the branch that was published. - PublishDraft(context.Context, *PublishDraftRequest) (*Branch, error) + // Publishes a draft. I.e. draft will become a publication, and will no longer appear in drafts section. + PublishDraft(context.Context, *PublishDraftRequest) (*Publication, error) } // UnimplementedDraftsServer should be embedded to have forward compatible implementations. type UnimplementedDraftsServer struct { } -func (UnimplementedDraftsServer) CreateDraft(context.Context, *CreateDraftRequest) (*Draft, error) { +func (UnimplementedDraftsServer) CreateDraft(context.Context, *CreateDraftRequest) (*Document, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateDraft not implemented") } -func (UnimplementedDraftsServer) CreateBranchDraft(context.Context, *CreateBranchDraftRequest) (*Draft, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateBranchDraft not implemented") -} -func (UnimplementedDraftsServer) CreateIndexDraft(context.Context, *CreateIndexDraftRequest) (*Draft, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateIndexDraft not implemented") -} -func (UnimplementedDraftsServer) CreateProfileDraft(context.Context, *CreateProfileDraftRequest) (*Draft, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateProfileDraft not implemented") -} func (UnimplementedDraftsServer) DeleteDraft(context.Context, *DeleteDraftRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteDraft not implemented") } -func (UnimplementedDraftsServer) GetDraft(context.Context, *GetDraftRequest) (*Draft, error) { +func (UnimplementedDraftsServer) GetDraft(context.Context, *GetDraftRequest) (*Document, error) { return nil, status.Errorf(codes.Unimplemented, "method GetDraft not implemented") } -func (UnimplementedDraftsServer) GetProfileDraft(context.Context, *GetProfileDraftRequest) (*Draft, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetProfileDraft not implemented") -} func (UnimplementedDraftsServer) UpdateDraft(context.Context, *UpdateDraftRequest) (*UpdateDraftResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateDraft not implemented") } @@ -216,7 +152,7 @@ func (UnimplementedDraftsServer) ListDrafts(context.Context, *ListDraftsRequest) func (UnimplementedDraftsServer) ListDocumentDrafts(context.Context, *ListDocumentDraftsRequest) (*ListDocumentDraftsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListDocumentDrafts not implemented") } -func (UnimplementedDraftsServer) PublishDraft(context.Context, *PublishDraftRequest) (*Branch, error) { +func (UnimplementedDraftsServer) PublishDraft(context.Context, *PublishDraftRequest) (*Publication, error) { return nil, status.Errorf(codes.Unimplemented, "method PublishDraft not implemented") } @@ -249,60 +185,6 @@ func _Drafts_CreateDraft_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } -func _Drafts_CreateBranchDraft_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateBranchDraftRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DraftsServer).CreateBranchDraft(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/com.seed.documents.v1alpha.Drafts/CreateBranchDraft", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DraftsServer).CreateBranchDraft(ctx, req.(*CreateBranchDraftRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Drafts_CreateIndexDraft_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateIndexDraftRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DraftsServer).CreateIndexDraft(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/com.seed.documents.v1alpha.Drafts/CreateIndexDraft", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DraftsServer).CreateIndexDraft(ctx, req.(*CreateIndexDraftRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Drafts_CreateProfileDraft_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateProfileDraftRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DraftsServer).CreateProfileDraft(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/com.seed.documents.v1alpha.Drafts/CreateProfileDraft", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DraftsServer).CreateProfileDraft(ctx, req.(*CreateProfileDraftRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Drafts_DeleteDraft_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteDraftRequest) if err := dec(in); err != nil { @@ -339,24 +221,6 @@ func _Drafts_GetDraft_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } -func _Drafts_GetProfileDraft_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetProfileDraftRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DraftsServer).GetProfileDraft(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/com.seed.documents.v1alpha.Drafts/GetProfileDraft", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DraftsServer).GetProfileDraft(ctx, req.(*GetProfileDraftRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Drafts_UpdateDraft_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UpdateDraftRequest) if err := dec(in); err != nil { @@ -440,18 +304,6 @@ var Drafts_ServiceDesc = grpc.ServiceDesc{ MethodName: "CreateDraft", Handler: _Drafts_CreateDraft_Handler, }, - { - MethodName: "CreateBranchDraft", - Handler: _Drafts_CreateBranchDraft_Handler, - }, - { - MethodName: "CreateIndexDraft", - Handler: _Drafts_CreateIndexDraft_Handler, - }, - { - MethodName: "CreateProfileDraft", - Handler: _Drafts_CreateProfileDraft_Handler, - }, { MethodName: "DeleteDraft", Handler: _Drafts_DeleteDraft_Handler, @@ -460,10 +312,6 @@ var Drafts_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetDraft", Handler: _Drafts_GetDraft_Handler, }, - { - MethodName: "GetProfileDraft", - Handler: _Drafts_GetProfileDraft_Handler, - }, { MethodName: "UpdateDraft", Handler: _Drafts_UpdateDraft_Handler, @@ -485,390 +333,200 @@ var Drafts_ServiceDesc = grpc.ServiceDesc{ Metadata: "documents/v1alpha/documents.proto", } -// DocumentsClient is the client API for Documents service. +// PublicationsClient is the client API for Publications service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type DocumentsClient interface { - // Gets a single document. - GetDocument(ctx context.Context, in *GetDocumentRequest, opts ...grpc.CallOption) (*Document, error) - // Gets an account's profile document. - GetProfileDocument(ctx context.Context, in *GetProfileDocumentRequest, opts ...grpc.CallOption) (*Document, error) - // Gets a document within the index(es) of other documents - GetDocumentIndex(ctx context.Context, in *GetDocumentIndexRequest, opts ...grpc.CallOption) (*GetDocumentIndexResponse, error) - // Immediately changes a document - ChangeDocument(ctx context.Context, in *ChangeDocumentRequest, opts ...grpc.CallOption) (*Document, error) - // Immediately changes an account's profile document - ChangeProfileDocument(ctx context.Context, in *ChangeProfileDocumentRequest, opts ...grpc.CallOption) (*Document, error) - // Lists all documents. Only the most recent versions show up. - ListDocuments(ctx context.Context, in *ListDocumentsRequest, opts ...grpc.CallOption) (*ListDocumentsResponse, error) - // Lists branches of a document. Includes standalone and index branches, and any drafts for these branches - ListDocumentBranches(ctx context.Context, in *ListDocumentBranchesRequest, opts ...grpc.CallOption) (*ListDocumentBranchesResponse, error) - // Push Local document to the gateway. - PushDocument(ctx context.Context, in *PushDocumentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Lists documents owned by a given account. - ListAccountDocuments(ctx context.Context, in *ListAccountDocumentsRequest, opts ...grpc.CallOption) (*ListDocumentsResponse, error) -} - -type documentsClient struct { +type PublicationsClient interface { + // Gets a single publication. + GetPublication(ctx context.Context, in *GetPublicationRequest, opts ...grpc.CallOption) (*Publication, error) + // Lists stored publications. Only the most recent versions show up. + ListPublications(ctx context.Context, in *ListPublicationsRequest, opts ...grpc.CallOption) (*ListPublicationsResponse, error) + // Push Local publication to the gateway. + PushPublication(ctx context.Context, in *PushPublicationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Lists publications owned by a given account. + ListAccountPublications(ctx context.Context, in *ListAccountPublicationsRequest, opts ...grpc.CallOption) (*ListPublicationsResponse, error) +} + +type publicationsClient struct { cc grpc.ClientConnInterface } -func NewDocumentsClient(cc grpc.ClientConnInterface) DocumentsClient { - return &documentsClient{cc} +func NewPublicationsClient(cc grpc.ClientConnInterface) PublicationsClient { + return &publicationsClient{cc} } -func (c *documentsClient) GetDocument(ctx context.Context, in *GetDocumentRequest, opts ...grpc.CallOption) (*Document, error) { - out := new(Document) - err := c.cc.Invoke(ctx, "/com.seed.documents.v1alpha.Documents/GetDocument", in, out, opts...) +func (c *publicationsClient) GetPublication(ctx context.Context, in *GetPublicationRequest, opts ...grpc.CallOption) (*Publication, error) { + out := new(Publication) + err := c.cc.Invoke(ctx, "/com.seed.documents.v1alpha.Publications/GetPublication", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *documentsClient) GetProfileDocument(ctx context.Context, in *GetProfileDocumentRequest, opts ...grpc.CallOption) (*Document, error) { - out := new(Document) - err := c.cc.Invoke(ctx, "/com.seed.documents.v1alpha.Documents/GetProfileDocument", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *documentsClient) GetDocumentIndex(ctx context.Context, in *GetDocumentIndexRequest, opts ...grpc.CallOption) (*GetDocumentIndexResponse, error) { - out := new(GetDocumentIndexResponse) - err := c.cc.Invoke(ctx, "/com.seed.documents.v1alpha.Documents/GetDocumentIndex", in, out, opts...) +func (c *publicationsClient) ListPublications(ctx context.Context, in *ListPublicationsRequest, opts ...grpc.CallOption) (*ListPublicationsResponse, error) { + out := new(ListPublicationsResponse) + err := c.cc.Invoke(ctx, "/com.seed.documents.v1alpha.Publications/ListPublications", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *documentsClient) ChangeDocument(ctx context.Context, in *ChangeDocumentRequest, opts ...grpc.CallOption) (*Document, error) { - out := new(Document) - err := c.cc.Invoke(ctx, "/com.seed.documents.v1alpha.Documents/ChangeDocument", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *documentsClient) ChangeProfileDocument(ctx context.Context, in *ChangeProfileDocumentRequest, opts ...grpc.CallOption) (*Document, error) { - out := new(Document) - err := c.cc.Invoke(ctx, "/com.seed.documents.v1alpha.Documents/ChangeProfileDocument", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *documentsClient) ListDocuments(ctx context.Context, in *ListDocumentsRequest, opts ...grpc.CallOption) (*ListDocumentsResponse, error) { - out := new(ListDocumentsResponse) - err := c.cc.Invoke(ctx, "/com.seed.documents.v1alpha.Documents/ListDocuments", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *documentsClient) ListDocumentBranches(ctx context.Context, in *ListDocumentBranchesRequest, opts ...grpc.CallOption) (*ListDocumentBranchesResponse, error) { - out := new(ListDocumentBranchesResponse) - err := c.cc.Invoke(ctx, "/com.seed.documents.v1alpha.Documents/ListDocumentBranches", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *documentsClient) PushDocument(ctx context.Context, in *PushDocumentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { +func (c *publicationsClient) PushPublication(ctx context.Context, in *PushPublicationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/com.seed.documents.v1alpha.Documents/PushDocument", in, out, opts...) + err := c.cc.Invoke(ctx, "/com.seed.documents.v1alpha.Publications/PushPublication", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *documentsClient) ListAccountDocuments(ctx context.Context, in *ListAccountDocumentsRequest, opts ...grpc.CallOption) (*ListDocumentsResponse, error) { - out := new(ListDocumentsResponse) - err := c.cc.Invoke(ctx, "/com.seed.documents.v1alpha.Documents/ListAccountDocuments", in, out, opts...) +func (c *publicationsClient) ListAccountPublications(ctx context.Context, in *ListAccountPublicationsRequest, opts ...grpc.CallOption) (*ListPublicationsResponse, error) { + out := new(ListPublicationsResponse) + err := c.cc.Invoke(ctx, "/com.seed.documents.v1alpha.Publications/ListAccountPublications", in, out, opts...) if err != nil { return nil, err } return out, nil } -// DocumentsServer is the server API for Documents service. -// All implementations should embed UnimplementedDocumentsServer +// PublicationsServer is the server API for Publications service. +// All implementations should embed UnimplementedPublicationsServer // for forward compatibility -type DocumentsServer interface { - // Gets a single document. - GetDocument(context.Context, *GetDocumentRequest) (*Document, error) - // Gets an account's profile document. - GetProfileDocument(context.Context, *GetProfileDocumentRequest) (*Document, error) - // Gets a document within the index(es) of other documents - GetDocumentIndex(context.Context, *GetDocumentIndexRequest) (*GetDocumentIndexResponse, error) - // Immediately changes a document - ChangeDocument(context.Context, *ChangeDocumentRequest) (*Document, error) - // Immediately changes an account's profile document - ChangeProfileDocument(context.Context, *ChangeProfileDocumentRequest) (*Document, error) - // Lists all documents. Only the most recent versions show up. - ListDocuments(context.Context, *ListDocumentsRequest) (*ListDocumentsResponse, error) - // Lists branches of a document. Includes standalone and index branches, and any drafts for these branches - ListDocumentBranches(context.Context, *ListDocumentBranchesRequest) (*ListDocumentBranchesResponse, error) - // Push Local document to the gateway. - PushDocument(context.Context, *PushDocumentRequest) (*emptypb.Empty, error) - // Lists documents owned by a given account. - ListAccountDocuments(context.Context, *ListAccountDocumentsRequest) (*ListDocumentsResponse, error) +type PublicationsServer interface { + // Gets a single publication. + GetPublication(context.Context, *GetPublicationRequest) (*Publication, error) + // Lists stored publications. Only the most recent versions show up. + ListPublications(context.Context, *ListPublicationsRequest) (*ListPublicationsResponse, error) + // Push Local publication to the gateway. + PushPublication(context.Context, *PushPublicationRequest) (*emptypb.Empty, error) + // Lists publications owned by a given account. + ListAccountPublications(context.Context, *ListAccountPublicationsRequest) (*ListPublicationsResponse, error) } -// UnimplementedDocumentsServer should be embedded to have forward compatible implementations. -type UnimplementedDocumentsServer struct { +// UnimplementedPublicationsServer should be embedded to have forward compatible implementations. +type UnimplementedPublicationsServer struct { } -func (UnimplementedDocumentsServer) GetDocument(context.Context, *GetDocumentRequest) (*Document, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetDocument not implemented") -} -func (UnimplementedDocumentsServer) GetProfileDocument(context.Context, *GetProfileDocumentRequest) (*Document, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetProfileDocument not implemented") -} -func (UnimplementedDocumentsServer) GetDocumentIndex(context.Context, *GetDocumentIndexRequest) (*GetDocumentIndexResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetDocumentIndex not implemented") -} -func (UnimplementedDocumentsServer) ChangeDocument(context.Context, *ChangeDocumentRequest) (*Document, error) { - return nil, status.Errorf(codes.Unimplemented, "method ChangeDocument not implemented") -} -func (UnimplementedDocumentsServer) ChangeProfileDocument(context.Context, *ChangeProfileDocumentRequest) (*Document, error) { - return nil, status.Errorf(codes.Unimplemented, "method ChangeProfileDocument not implemented") -} -func (UnimplementedDocumentsServer) ListDocuments(context.Context, *ListDocumentsRequest) (*ListDocumentsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListDocuments not implemented") +func (UnimplementedPublicationsServer) GetPublication(context.Context, *GetPublicationRequest) (*Publication, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPublication not implemented") } -func (UnimplementedDocumentsServer) ListDocumentBranches(context.Context, *ListDocumentBranchesRequest) (*ListDocumentBranchesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListDocumentBranches not implemented") +func (UnimplementedPublicationsServer) ListPublications(context.Context, *ListPublicationsRequest) (*ListPublicationsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListPublications not implemented") } -func (UnimplementedDocumentsServer) PushDocument(context.Context, *PushDocumentRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method PushDocument not implemented") +func (UnimplementedPublicationsServer) PushPublication(context.Context, *PushPublicationRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method PushPublication not implemented") } -func (UnimplementedDocumentsServer) ListAccountDocuments(context.Context, *ListAccountDocumentsRequest) (*ListDocumentsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListAccountDocuments not implemented") +func (UnimplementedPublicationsServer) ListAccountPublications(context.Context, *ListAccountPublicationsRequest) (*ListPublicationsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListAccountPublications not implemented") } -// UnsafeDocumentsServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to DocumentsServer will +// UnsafePublicationsServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to PublicationsServer will // result in compilation errors. -type UnsafeDocumentsServer interface { - mustEmbedUnimplementedDocumentsServer() -} - -func RegisterDocumentsServer(s grpc.ServiceRegistrar, srv DocumentsServer) { - s.RegisterService(&Documents_ServiceDesc, srv) -} - -func _Documents_GetDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetDocumentRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DocumentsServer).GetDocument(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/com.seed.documents.v1alpha.Documents/GetDocument", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DocumentsServer).GetDocument(ctx, req.(*GetDocumentRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Documents_GetProfileDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetProfileDocumentRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DocumentsServer).GetProfileDocument(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/com.seed.documents.v1alpha.Documents/GetProfileDocument", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DocumentsServer).GetProfileDocument(ctx, req.(*GetProfileDocumentRequest)) - } - return interceptor(ctx, in, info, handler) +type UnsafePublicationsServer interface { + mustEmbedUnimplementedPublicationsServer() } -func _Documents_GetDocumentIndex_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetDocumentIndexRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DocumentsServer).GetDocumentIndex(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/com.seed.documents.v1alpha.Documents/GetDocumentIndex", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DocumentsServer).GetDocumentIndex(ctx, req.(*GetDocumentIndexRequest)) - } - return interceptor(ctx, in, info, handler) +func RegisterPublicationsServer(s grpc.ServiceRegistrar, srv PublicationsServer) { + s.RegisterService(&Publications_ServiceDesc, srv) } -func _Documents_ChangeDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ChangeDocumentRequest) +func _Publications_GetPublication_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPublicationRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(DocumentsServer).ChangeDocument(ctx, in) + return srv.(PublicationsServer).GetPublication(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/com.seed.documents.v1alpha.Documents/ChangeDocument", + FullMethod: "/com.seed.documents.v1alpha.Publications/GetPublication", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DocumentsServer).ChangeDocument(ctx, req.(*ChangeDocumentRequest)) + return srv.(PublicationsServer).GetPublication(ctx, req.(*GetPublicationRequest)) } return interceptor(ctx, in, info, handler) } -func _Documents_ChangeProfileDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ChangeProfileDocumentRequest) +func _Publications_ListPublications_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListPublicationsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(DocumentsServer).ChangeProfileDocument(ctx, in) + return srv.(PublicationsServer).ListPublications(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/com.seed.documents.v1alpha.Documents/ChangeProfileDocument", + FullMethod: "/com.seed.documents.v1alpha.Publications/ListPublications", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DocumentsServer).ChangeProfileDocument(ctx, req.(*ChangeProfileDocumentRequest)) + return srv.(PublicationsServer).ListPublications(ctx, req.(*ListPublicationsRequest)) } return interceptor(ctx, in, info, handler) } -func _Documents_ListDocuments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListDocumentsRequest) +func _Publications_PushPublication_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PushPublicationRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(DocumentsServer).ListDocuments(ctx, in) + return srv.(PublicationsServer).PushPublication(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/com.seed.documents.v1alpha.Documents/ListDocuments", + FullMethod: "/com.seed.documents.v1alpha.Publications/PushPublication", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DocumentsServer).ListDocuments(ctx, req.(*ListDocumentsRequest)) + return srv.(PublicationsServer).PushPublication(ctx, req.(*PushPublicationRequest)) } return interceptor(ctx, in, info, handler) } -func _Documents_ListDocumentBranches_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListDocumentBranchesRequest) +func _Publications_ListAccountPublications_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListAccountPublicationsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(DocumentsServer).ListDocumentBranches(ctx, in) + return srv.(PublicationsServer).ListAccountPublications(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/com.seed.documents.v1alpha.Documents/ListDocumentBranches", + FullMethod: "/com.seed.documents.v1alpha.Publications/ListAccountPublications", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DocumentsServer).ListDocumentBranches(ctx, req.(*ListDocumentBranchesRequest)) + return srv.(PublicationsServer).ListAccountPublications(ctx, req.(*ListAccountPublicationsRequest)) } return interceptor(ctx, in, info, handler) } -func _Documents_PushDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PushDocumentRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DocumentsServer).PushDocument(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/com.seed.documents.v1alpha.Documents/PushDocument", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DocumentsServer).PushDocument(ctx, req.(*PushDocumentRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Documents_ListAccountDocuments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListAccountDocumentsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DocumentsServer).ListAccountDocuments(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/com.seed.documents.v1alpha.Documents/ListAccountDocuments", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DocumentsServer).ListAccountDocuments(ctx, req.(*ListAccountDocumentsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Documents_ServiceDesc is the grpc.ServiceDesc for Documents service. +// Publications_ServiceDesc is the grpc.ServiceDesc for Publications service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) -var Documents_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "com.seed.documents.v1alpha.Documents", - HandlerType: (*DocumentsServer)(nil), +var Publications_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "com.seed.documents.v1alpha.Publications", + HandlerType: (*PublicationsServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "GetDocument", - Handler: _Documents_GetDocument_Handler, - }, - { - MethodName: "GetProfileDocument", - Handler: _Documents_GetProfileDocument_Handler, - }, - { - MethodName: "GetDocumentIndex", - Handler: _Documents_GetDocumentIndex_Handler, - }, - { - MethodName: "ChangeDocument", - Handler: _Documents_ChangeDocument_Handler, - }, - { - MethodName: "ChangeProfileDocument", - Handler: _Documents_ChangeProfileDocument_Handler, + MethodName: "GetPublication", + Handler: _Publications_GetPublication_Handler, }, { - MethodName: "ListDocuments", - Handler: _Documents_ListDocuments_Handler, + MethodName: "ListPublications", + Handler: _Publications_ListPublications_Handler, }, { - MethodName: "ListDocumentBranches", - Handler: _Documents_ListDocumentBranches_Handler, + MethodName: "PushPublication", + Handler: _Publications_PushPublication_Handler, }, { - MethodName: "PushDocument", - Handler: _Documents_PushDocument_Handler, - }, - { - MethodName: "ListAccountDocuments", - Handler: _Documents_ListAccountDocuments_Handler, + MethodName: "ListAccountPublications", + Handler: _Publications_ListAccountPublications_Handler, }, }, Streams: []grpc.StreamDesc{}, @@ -880,7 +538,7 @@ var Documents_ServiceDesc = grpc.ServiceDesc{ // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type MergeClient interface { // Merge changes and publishes. - MergeChanges(ctx context.Context, in *MergeChangesRequest, opts ...grpc.CallOption) (*Document, error) + MergeChanges(ctx context.Context, in *MergeChangesRequest, opts ...grpc.CallOption) (*Publication, error) // Rebase changes RebaseChanges(ctx context.Context, in *RebaseChangesRequest, opts ...grpc.CallOption) (*Document, error) } @@ -893,8 +551,8 @@ func NewMergeClient(cc grpc.ClientConnInterface) MergeClient { return &mergeClient{cc} } -func (c *mergeClient) MergeChanges(ctx context.Context, in *MergeChangesRequest, opts ...grpc.CallOption) (*Document, error) { - out := new(Document) +func (c *mergeClient) MergeChanges(ctx context.Context, in *MergeChangesRequest, opts ...grpc.CallOption) (*Publication, error) { + out := new(Publication) err := c.cc.Invoke(ctx, "/com.seed.documents.v1alpha.Merge/MergeChanges", in, out, opts...) if err != nil { return nil, err @@ -916,7 +574,7 @@ func (c *mergeClient) RebaseChanges(ctx context.Context, in *RebaseChangesReques // for forward compatibility type MergeServer interface { // Merge changes and publishes. - MergeChanges(context.Context, *MergeChangesRequest) (*Document, error) + MergeChanges(context.Context, *MergeChangesRequest) (*Publication, error) // Rebase changes RebaseChanges(context.Context, *RebaseChangesRequest) (*Document, error) } @@ -925,7 +583,7 @@ type MergeServer interface { type UnimplementedMergeServer struct { } -func (UnimplementedMergeServer) MergeChanges(context.Context, *MergeChangesRequest) (*Document, error) { +func (UnimplementedMergeServer) MergeChanges(context.Context, *MergeChangesRequest) (*Publication, error) { return nil, status.Errorf(codes.Unimplemented, "method MergeChanges not implemented") } func (UnimplementedMergeServer) RebaseChanges(context.Context, *RebaseChangesRequest) (*Document, error) { diff --git a/backend/genproto/documents/v2alpha/changes.pb.go b/backend/genproto/documents/v2alpha/changes.pb.go new file mode 100644 index 000000000..90e87e762 --- /dev/null +++ b/backend/genproto/documents/v2alpha/changes.pb.go @@ -0,0 +1,451 @@ +// Deprecated. Use Entities API instead. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v4.24.4 +// source: documents/v2alpha/changes.proto + +package documents + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Request for getting change info. +type GetChangeInfoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ID of the Change. + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *GetChangeInfoRequest) Reset() { + *x = GetChangeInfoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_changes_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetChangeInfoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetChangeInfoRequest) ProtoMessage() {} + +func (x *GetChangeInfoRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_changes_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetChangeInfoRequest.ProtoReflect.Descriptor instead. +func (*GetChangeInfoRequest) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_changes_proto_rawDescGZIP(), []int{0} +} + +func (x *GetChangeInfoRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +// Request to list changes. +type ListChangesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. ID of the Seed object to list changes for. + DocumentId string `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` + // Optional. Number of results per page. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + // Optional. Token for the page to return. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` +} + +func (x *ListChangesRequest) Reset() { + *x = ListChangesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_changes_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListChangesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListChangesRequest) ProtoMessage() {} + +func (x *ListChangesRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_changes_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListChangesRequest.ProtoReflect.Descriptor instead. +func (*ListChangesRequest) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_changes_proto_rawDescGZIP(), []int{1} +} + +func (x *ListChangesRequest) GetDocumentId() string { + if x != nil { + return x.DocumentId + } + return "" +} + +func (x *ListChangesRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListChangesRequest) GetPageToken() string { + if x != nil { + return x.PageToken + } + return "" +} + +// Response with a list of changes. +type ListChangesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // List of changes matching the request. + Changes []*ChangeInfo `protobuf:"bytes,1,rep,name=changes,proto3" json:"changes,omitempty"` + // Token for the next page if there's any. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` +} + +func (x *ListChangesResponse) Reset() { + *x = ListChangesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_changes_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListChangesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListChangesResponse) ProtoMessage() {} + +func (x *ListChangesResponse) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_changes_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListChangesResponse.ProtoReflect.Descriptor instead. +func (*ListChangesResponse) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_changes_proto_rawDescGZIP(), []int{2} +} + +func (x *ListChangesResponse) GetChanges() []*ChangeInfo { + if x != nil { + return x.Changes + } + return nil +} + +func (x *ListChangesResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +// Metadata about a single Change. +type ChangeInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ID of the Change. + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Author of the Change. + Author string `protobuf:"bytes,2,opt,name=author,proto3" json:"author,omitempty"` + // Time when this change was recorded by the author. + CreateTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + // The document version ID corresponding to this changes. + // + // TODO(burdiyan): after the breaking change the change ID can be used directly as version. + Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` + // IDs of other Changes that are dependencies of this Change. + Deps []string `protobuf:"bytes,5,rep,name=deps,proto3" json:"deps,omitempty"` +} + +func (x *ChangeInfo) Reset() { + *x = ChangeInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_changes_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChangeInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangeInfo) ProtoMessage() {} + +func (x *ChangeInfo) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_changes_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChangeInfo.ProtoReflect.Descriptor instead. +func (*ChangeInfo) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_changes_proto_rawDescGZIP(), []int{3} +} + +func (x *ChangeInfo) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *ChangeInfo) GetAuthor() string { + if x != nil { + return x.Author + } + return "" +} + +func (x *ChangeInfo) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +func (x *ChangeInfo) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *ChangeInfo) GetDeps() []string { + if x != nil { + return x.Deps + } + return nil +} + +var File_documents_v2alpha_changes_proto protoreflect.FileDescriptor + +var file_documents_v2alpha_changes_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x32, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x1a, 0x1f, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x26, + 0x0a, 0x14, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x71, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, + 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1b, 0x0a, + 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, + 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x7f, 0x0a, 0x13, 0x4c, 0x69, 0x73, + 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x40, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, + 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x9f, 0x01, 0x0a, 0x0a, 0x43, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x70, 0x73, + 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x70, 0x73, 0x32, 0xe4, 0x01, 0x0a, + 0x07, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x69, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x43, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, + 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, + 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x63, 0x6f, + 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49, + 0x6e, 0x66, 0x6f, 0x12, 0x6e, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x73, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, + 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, + 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x42, 0x33, 0x5a, 0x31, 0x73, 0x65, 0x65, 0x64, 0x2f, 0x62, 0x61, 0x63, 0x6b, + 0x65, 0x6e, 0x64, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x64, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x3b, 0x64, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_documents_v2alpha_changes_proto_rawDescOnce sync.Once + file_documents_v2alpha_changes_proto_rawDescData = file_documents_v2alpha_changes_proto_rawDesc +) + +func file_documents_v2alpha_changes_proto_rawDescGZIP() []byte { + file_documents_v2alpha_changes_proto_rawDescOnce.Do(func() { + file_documents_v2alpha_changes_proto_rawDescData = protoimpl.X.CompressGZIP(file_documents_v2alpha_changes_proto_rawDescData) + }) + return file_documents_v2alpha_changes_proto_rawDescData +} + +var file_documents_v2alpha_changes_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_documents_v2alpha_changes_proto_goTypes = []interface{}{ + (*GetChangeInfoRequest)(nil), // 0: com.seed.documents.v2alpha.GetChangeInfoRequest + (*ListChangesRequest)(nil), // 1: com.seed.documents.v2alpha.ListChangesRequest + (*ListChangesResponse)(nil), // 2: com.seed.documents.v2alpha.ListChangesResponse + (*ChangeInfo)(nil), // 3: com.seed.documents.v2alpha.ChangeInfo + (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp +} +var file_documents_v2alpha_changes_proto_depIdxs = []int32{ + 3, // 0: com.seed.documents.v2alpha.ListChangesResponse.changes:type_name -> com.seed.documents.v2alpha.ChangeInfo + 4, // 1: com.seed.documents.v2alpha.ChangeInfo.create_time:type_name -> google.protobuf.Timestamp + 0, // 2: com.seed.documents.v2alpha.Changes.GetChangeInfo:input_type -> com.seed.documents.v2alpha.GetChangeInfoRequest + 1, // 3: com.seed.documents.v2alpha.Changes.ListChanges:input_type -> com.seed.documents.v2alpha.ListChangesRequest + 3, // 4: com.seed.documents.v2alpha.Changes.GetChangeInfo:output_type -> com.seed.documents.v2alpha.ChangeInfo + 2, // 5: com.seed.documents.v2alpha.Changes.ListChanges:output_type -> com.seed.documents.v2alpha.ListChangesResponse + 4, // [4:6] is the sub-list for method output_type + 2, // [2:4] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_documents_v2alpha_changes_proto_init() } +func file_documents_v2alpha_changes_proto_init() { + if File_documents_v2alpha_changes_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_documents_v2alpha_changes_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetChangeInfoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_changes_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListChangesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_changes_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListChangesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_changes_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChangeInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_documents_v2alpha_changes_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_documents_v2alpha_changes_proto_goTypes, + DependencyIndexes: file_documents_v2alpha_changes_proto_depIdxs, + MessageInfos: file_documents_v2alpha_changes_proto_msgTypes, + }.Build() + File_documents_v2alpha_changes_proto = out.File + file_documents_v2alpha_changes_proto_rawDesc = nil + file_documents_v2alpha_changes_proto_goTypes = nil + file_documents_v2alpha_changes_proto_depIdxs = nil +} diff --git a/backend/genproto/documents/v2alpha/changes_grpc.pb.go b/backend/genproto/documents/v2alpha/changes_grpc.pb.go new file mode 100644 index 000000000..5f75d353b --- /dev/null +++ b/backend/genproto/documents/v2alpha/changes_grpc.pb.go @@ -0,0 +1,143 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v4.24.4 +// source: documents/v2alpha/changes.proto + +package documents + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// ChangesClient is the client API for Changes service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ChangesClient interface { + // Returns information about a single change. + GetChangeInfo(ctx context.Context, in *GetChangeInfoRequest, opts ...grpc.CallOption) (*ChangeInfo, error) + // List changes of a given object. + ListChanges(ctx context.Context, in *ListChangesRequest, opts ...grpc.CallOption) (*ListChangesResponse, error) +} + +type changesClient struct { + cc grpc.ClientConnInterface +} + +func NewChangesClient(cc grpc.ClientConnInterface) ChangesClient { + return &changesClient{cc} +} + +func (c *changesClient) GetChangeInfo(ctx context.Context, in *GetChangeInfoRequest, opts ...grpc.CallOption) (*ChangeInfo, error) { + out := new(ChangeInfo) + err := c.cc.Invoke(ctx, "/com.seed.documents.v2alpha.Changes/GetChangeInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *changesClient) ListChanges(ctx context.Context, in *ListChangesRequest, opts ...grpc.CallOption) (*ListChangesResponse, error) { + out := new(ListChangesResponse) + err := c.cc.Invoke(ctx, "/com.seed.documents.v2alpha.Changes/ListChanges", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ChangesServer is the server API for Changes service. +// All implementations should embed UnimplementedChangesServer +// for forward compatibility +type ChangesServer interface { + // Returns information about a single change. + GetChangeInfo(context.Context, *GetChangeInfoRequest) (*ChangeInfo, error) + // List changes of a given object. + ListChanges(context.Context, *ListChangesRequest) (*ListChangesResponse, error) +} + +// UnimplementedChangesServer should be embedded to have forward compatible implementations. +type UnimplementedChangesServer struct { +} + +func (UnimplementedChangesServer) GetChangeInfo(context.Context, *GetChangeInfoRequest) (*ChangeInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetChangeInfo not implemented") +} +func (UnimplementedChangesServer) ListChanges(context.Context, *ListChangesRequest) (*ListChangesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListChanges not implemented") +} + +// UnsafeChangesServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ChangesServer will +// result in compilation errors. +type UnsafeChangesServer interface { + mustEmbedUnimplementedChangesServer() +} + +func RegisterChangesServer(s grpc.ServiceRegistrar, srv ChangesServer) { + s.RegisterService(&Changes_ServiceDesc, srv) +} + +func _Changes_GetChangeInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetChangeInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChangesServer).GetChangeInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.documents.v2alpha.Changes/GetChangeInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChangesServer).GetChangeInfo(ctx, req.(*GetChangeInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Changes_ListChanges_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListChangesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChangesServer).ListChanges(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.documents.v2alpha.Changes/ListChanges", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChangesServer).ListChanges(ctx, req.(*ListChangesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Changes_ServiceDesc is the grpc.ServiceDesc for Changes service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Changes_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "com.seed.documents.v2alpha.Changes", + HandlerType: (*ChangesServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetChangeInfo", + Handler: _Changes_GetChangeInfo_Handler, + }, + { + MethodName: "ListChanges", + Handler: _Changes_ListChanges_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "documents/v2alpha/changes.proto", +} diff --git a/backend/genproto/documents/v2alpha/comments.pb.go b/backend/genproto/documents/v2alpha/comments.pb.go new file mode 100644 index 000000000..a5d748b71 --- /dev/null +++ b/backend/genproto/documents/v2alpha/comments.pb.go @@ -0,0 +1,586 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v4.24.4 +// source: documents/v2alpha/comments.proto + +package documents + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Request to create a comment. +type CreateCommentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. The URI of the target hypermedia resource which is being commented. + // It's best to use versioned URIs to propagate better context and intent, + // even if the comments are eventually "overlaid" onto the newer versions of the resource. + Target string `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` + // Optional. If a comment is a reply to another comment, this must be the ID of the replied comment. + // The target of the reply and the replied comment must be the same + // (although version could differ if the reply is made reading a newer version of the document). + RepliedComment string `protobuf:"bytes,2,opt,name=replied_comment,json=repliedComment,proto3" json:"replied_comment,omitempty"` + // Required. Content of the comment. + Content []*BlockNode `protobuf:"bytes,3,rep,name=content,proto3" json:"content,omitempty"` +} + +func (x *CreateCommentRequest) Reset() { + *x = CreateCommentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_comments_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateCommentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateCommentRequest) ProtoMessage() {} + +func (x *CreateCommentRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_comments_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateCommentRequest.ProtoReflect.Descriptor instead. +func (*CreateCommentRequest) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_comments_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateCommentRequest) GetTarget() string { + if x != nil { + return x.Target + } + return "" +} + +func (x *CreateCommentRequest) GetRepliedComment() string { + if x != nil { + return x.RepliedComment + } + return "" +} + +func (x *CreateCommentRequest) GetContent() []*BlockNode { + if x != nil { + return x.Content + } + return nil +} + +// Request to get a comment. +type GetCommentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. ID of the comment to retrieve. + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *GetCommentRequest) Reset() { + *x = GetCommentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_comments_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetCommentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCommentRequest) ProtoMessage() {} + +func (x *GetCommentRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_comments_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetCommentRequest.ProtoReflect.Descriptor instead. +func (*GetCommentRequest) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_comments_proto_rawDescGZIP(), []int{1} +} + +func (x *GetCommentRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +// Request to list comments. +type ListCommentsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. The URI of the target resource for which comments should be listed. + Target string `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` + // Optional. The maximum number of comments to return. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + // Optional. The page token obtained from a previous request (if any). + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` +} + +func (x *ListCommentsRequest) Reset() { + *x = ListCommentsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_comments_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListCommentsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListCommentsRequest) ProtoMessage() {} + +func (x *ListCommentsRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_comments_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListCommentsRequest.ProtoReflect.Descriptor instead. +func (*ListCommentsRequest) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_comments_proto_rawDescGZIP(), []int{2} +} + +func (x *ListCommentsRequest) GetTarget() string { + if x != nil { + return x.Target + } + return "" +} + +func (x *ListCommentsRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListCommentsRequest) GetPageToken() string { + if x != nil { + return x.PageToken + } + return "" +} + +// Response with a list of comments. +type ListCommentsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // List of comments. + Comments []*Comment `protobuf:"bytes,1,rep,name=comments,proto3" json:"comments,omitempty"` + // Token to retrieve the next page of comments (if necessary). + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` +} + +func (x *ListCommentsResponse) Reset() { + *x = ListCommentsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_comments_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListCommentsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListCommentsResponse) ProtoMessage() {} + +func (x *ListCommentsResponse) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_comments_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListCommentsResponse.ProtoReflect.Descriptor instead. +func (*ListCommentsResponse) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_comments_proto_rawDescGZIP(), []int{3} +} + +func (x *ListCommentsResponse) GetComments() []*Comment { + if x != nil { + return x.Comments + } + return nil +} + +func (x *ListCommentsResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +// Comment is a unit of discussion. +// Comments are created targeting some hypermedia resource (ideally with a versioned link). +// Replies are created targeting the same resource, in addition to pointing to the comment they are replying to. +type Comment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ID of the current comment. + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // The URI of the target resource which the comment is attached to. + // This is normally a Hypermedia Document, but potentially can be anything. + // Reply comments should share the same target as the comment they are replying to, + // but could potentially point to a different version. + Target string `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"` + // The ID of the top-level non-reply comment of the conversation thread. + ThreadRoot string `protobuf:"bytes,3,opt,name=thread_root,json=threadRoot,proto3" json:"thread_root,omitempty"` + // The ID of the comment to which this comment is a reply. + // For initial comments this field is empty. + RepliedComment string `protobuf:"bytes,4,opt,name=replied_comment,json=repliedComment,proto3" json:"replied_comment,omitempty"` + // Account ID of the author of the comment. + Author string `protobuf:"bytes,5,opt,name=author,proto3" json:"author,omitempty"` + // Content of the comment. + Content []*BlockNode `protobuf:"bytes,6,rep,name=content,proto3" json:"content,omitempty"` + // Timestamp when the comment was created. + CreateTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` +} + +func (x *Comment) Reset() { + *x = Comment{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_comments_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Comment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Comment) ProtoMessage() {} + +func (x *Comment) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_comments_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Comment.ProtoReflect.Descriptor instead. +func (*Comment) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_comments_proto_rawDescGZIP(), []int{4} +} + +func (x *Comment) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Comment) GetTarget() string { + if x != nil { + return x.Target + } + return "" +} + +func (x *Comment) GetThreadRoot() string { + if x != nil { + return x.ThreadRoot + } + return "" +} + +func (x *Comment) GetRepliedComment() string { + if x != nil { + return x.RepliedComment + } + return "" +} + +func (x *Comment) GetAuthor() string { + if x != nil { + return x.Author + } + return "" +} + +func (x *Comment) GetContent() []*BlockNode { + if x != nil { + return x.Content + } + return nil +} + +func (x *Comment) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +var File_documents_v2alpha_comments_proto protoreflect.FileDescriptor + +var file_documents_v2alpha_comments_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x32, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x1a, 0x21, + 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x98, 0x01, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, + 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x5f, 0x63, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x65, + 0x70, 0x6c, 0x69, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x3f, 0x0a, 0x07, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, + 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x23, 0x0a, + 0x11, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x22, 0x69, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, + 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x7f, 0x0a, + 0x14, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, + 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x63, 0x6f, + 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, + 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x91, + 0x02, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x72, 0x6f, 0x6f, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x52, + 0x6f, 0x6f, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x5f, 0x63, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x65, + 0x70, 0x6c, 0x69, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, + 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x12, 0x3f, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, + 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, + 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x07, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, + 0x6d, 0x65, 0x32, 0xc7, 0x02, 0x0a, 0x08, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, + 0x66, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, + 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, + 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x60, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x43, 0x6f, + 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2d, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, + 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, + 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x71, 0x0a, 0x0c, 0x4c, 0x69, 0x73, + 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, + 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, + 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x6d, + 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, + 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x33, 0x5a, 0x31, + 0x73, 0x65, 0x65, 0x64, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x67, 0x65, 0x6e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, + 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x3b, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_documents_v2alpha_comments_proto_rawDescOnce sync.Once + file_documents_v2alpha_comments_proto_rawDescData = file_documents_v2alpha_comments_proto_rawDesc +) + +func file_documents_v2alpha_comments_proto_rawDescGZIP() []byte { + file_documents_v2alpha_comments_proto_rawDescOnce.Do(func() { + file_documents_v2alpha_comments_proto_rawDescData = protoimpl.X.CompressGZIP(file_documents_v2alpha_comments_proto_rawDescData) + }) + return file_documents_v2alpha_comments_proto_rawDescData +} + +var file_documents_v2alpha_comments_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_documents_v2alpha_comments_proto_goTypes = []interface{}{ + (*CreateCommentRequest)(nil), // 0: com.seed.documents.v2alpha.CreateCommentRequest + (*GetCommentRequest)(nil), // 1: com.seed.documents.v2alpha.GetCommentRequest + (*ListCommentsRequest)(nil), // 2: com.seed.documents.v2alpha.ListCommentsRequest + (*ListCommentsResponse)(nil), // 3: com.seed.documents.v2alpha.ListCommentsResponse + (*Comment)(nil), // 4: com.seed.documents.v2alpha.Comment + (*BlockNode)(nil), // 5: com.seed.documents.v2alpha.BlockNode + (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp +} +var file_documents_v2alpha_comments_proto_depIdxs = []int32{ + 5, // 0: com.seed.documents.v2alpha.CreateCommentRequest.content:type_name -> com.seed.documents.v2alpha.BlockNode + 4, // 1: com.seed.documents.v2alpha.ListCommentsResponse.comments:type_name -> com.seed.documents.v2alpha.Comment + 5, // 2: com.seed.documents.v2alpha.Comment.content:type_name -> com.seed.documents.v2alpha.BlockNode + 6, // 3: com.seed.documents.v2alpha.Comment.create_time:type_name -> google.protobuf.Timestamp + 0, // 4: com.seed.documents.v2alpha.Comments.CreateComment:input_type -> com.seed.documents.v2alpha.CreateCommentRequest + 1, // 5: com.seed.documents.v2alpha.Comments.GetComment:input_type -> com.seed.documents.v2alpha.GetCommentRequest + 2, // 6: com.seed.documents.v2alpha.Comments.ListComments:input_type -> com.seed.documents.v2alpha.ListCommentsRequest + 4, // 7: com.seed.documents.v2alpha.Comments.CreateComment:output_type -> com.seed.documents.v2alpha.Comment + 4, // 8: com.seed.documents.v2alpha.Comments.GetComment:output_type -> com.seed.documents.v2alpha.Comment + 3, // 9: com.seed.documents.v2alpha.Comments.ListComments:output_type -> com.seed.documents.v2alpha.ListCommentsResponse + 7, // [7:10] is the sub-list for method output_type + 4, // [4:7] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_documents_v2alpha_comments_proto_init() } +func file_documents_v2alpha_comments_proto_init() { + if File_documents_v2alpha_comments_proto != nil { + return + } + file_documents_v2alpha_documents_proto_init() + if !protoimpl.UnsafeEnabled { + file_documents_v2alpha_comments_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateCommentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_comments_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetCommentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_comments_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCommentsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_comments_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCommentsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_comments_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Comment); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_documents_v2alpha_comments_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_documents_v2alpha_comments_proto_goTypes, + DependencyIndexes: file_documents_v2alpha_comments_proto_depIdxs, + MessageInfos: file_documents_v2alpha_comments_proto_msgTypes, + }.Build() + File_documents_v2alpha_comments_proto = out.File + file_documents_v2alpha_comments_proto_rawDesc = nil + file_documents_v2alpha_comments_proto_goTypes = nil + file_documents_v2alpha_comments_proto_depIdxs = nil +} diff --git a/backend/genproto/documents/v2alpha/comments_grpc.pb.go b/backend/genproto/documents/v2alpha/comments_grpc.pb.go new file mode 100644 index 000000000..69a79585d --- /dev/null +++ b/backend/genproto/documents/v2alpha/comments_grpc.pb.go @@ -0,0 +1,181 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v4.24.4 +// source: documents/v2alpha/comments.proto + +package documents + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// CommentsClient is the client API for Comments service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type CommentsClient interface { + // Creates a new comment. + CreateComment(ctx context.Context, in *CreateCommentRequest, opts ...grpc.CallOption) (*Comment, error) + // Gets a single comment by ID. + GetComment(ctx context.Context, in *GetCommentRequest, opts ...grpc.CallOption) (*Comment, error) + // Lists comments for a given target. + ListComments(ctx context.Context, in *ListCommentsRequest, opts ...grpc.CallOption) (*ListCommentsResponse, error) +} + +type commentsClient struct { + cc grpc.ClientConnInterface +} + +func NewCommentsClient(cc grpc.ClientConnInterface) CommentsClient { + return &commentsClient{cc} +} + +func (c *commentsClient) CreateComment(ctx context.Context, in *CreateCommentRequest, opts ...grpc.CallOption) (*Comment, error) { + out := new(Comment) + err := c.cc.Invoke(ctx, "/com.seed.documents.v2alpha.Comments/CreateComment", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *commentsClient) GetComment(ctx context.Context, in *GetCommentRequest, opts ...grpc.CallOption) (*Comment, error) { + out := new(Comment) + err := c.cc.Invoke(ctx, "/com.seed.documents.v2alpha.Comments/GetComment", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *commentsClient) ListComments(ctx context.Context, in *ListCommentsRequest, opts ...grpc.CallOption) (*ListCommentsResponse, error) { + out := new(ListCommentsResponse) + err := c.cc.Invoke(ctx, "/com.seed.documents.v2alpha.Comments/ListComments", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// CommentsServer is the server API for Comments service. +// All implementations should embed UnimplementedCommentsServer +// for forward compatibility +type CommentsServer interface { + // Creates a new comment. + CreateComment(context.Context, *CreateCommentRequest) (*Comment, error) + // Gets a single comment by ID. + GetComment(context.Context, *GetCommentRequest) (*Comment, error) + // Lists comments for a given target. + ListComments(context.Context, *ListCommentsRequest) (*ListCommentsResponse, error) +} + +// UnimplementedCommentsServer should be embedded to have forward compatible implementations. +type UnimplementedCommentsServer struct { +} + +func (UnimplementedCommentsServer) CreateComment(context.Context, *CreateCommentRequest) (*Comment, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateComment not implemented") +} +func (UnimplementedCommentsServer) GetComment(context.Context, *GetCommentRequest) (*Comment, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetComment not implemented") +} +func (UnimplementedCommentsServer) ListComments(context.Context, *ListCommentsRequest) (*ListCommentsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListComments not implemented") +} + +// UnsafeCommentsServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to CommentsServer will +// result in compilation errors. +type UnsafeCommentsServer interface { + mustEmbedUnimplementedCommentsServer() +} + +func RegisterCommentsServer(s grpc.ServiceRegistrar, srv CommentsServer) { + s.RegisterService(&Comments_ServiceDesc, srv) +} + +func _Comments_CreateComment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateCommentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CommentsServer).CreateComment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.documents.v2alpha.Comments/CreateComment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CommentsServer).CreateComment(ctx, req.(*CreateCommentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Comments_GetComment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetCommentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CommentsServer).GetComment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.documents.v2alpha.Comments/GetComment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CommentsServer).GetComment(ctx, req.(*GetCommentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Comments_ListComments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListCommentsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CommentsServer).ListComments(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.documents.v2alpha.Comments/ListComments", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CommentsServer).ListComments(ctx, req.(*ListCommentsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Comments_ServiceDesc is the grpc.ServiceDesc for Comments service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Comments_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "com.seed.documents.v2alpha.Comments", + HandlerType: (*CommentsServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateComment", + Handler: _Comments_CreateComment_Handler, + }, + { + MethodName: "GetComment", + Handler: _Comments_GetComment_Handler, + }, + { + MethodName: "ListComments", + Handler: _Comments_ListComments_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "documents/v2alpha/comments.proto", +} diff --git a/backend/genproto/documents/v2alpha/content_graph.pb.go b/backend/genproto/documents/v2alpha/content_graph.pb.go new file mode 100644 index 000000000..f36e5112c --- /dev/null +++ b/backend/genproto/documents/v2alpha/content_graph.pb.go @@ -0,0 +1,410 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v4.24.4 +// source: documents/v2alpha/content_graph.proto + +package documents + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ListCitationsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. Document ID for which citations need to be retrieved. + DocumentId string `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` +} + +func (x *ListCitationsRequest) Reset() { + *x = ListCitationsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_content_graph_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListCitationsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListCitationsRequest) ProtoMessage() {} + +func (x *ListCitationsRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_content_graph_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListCitationsRequest.ProtoReflect.Descriptor instead. +func (*ListCitationsRequest) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_content_graph_proto_rawDescGZIP(), []int{0} +} + +func (x *ListCitationsRequest) GetDocumentId() string { + if x != nil { + return x.DocumentId + } + return "" +} + +// Response with citations. +type ListCitationsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // List of links that point to the requested document, recursively, according to the requested depth. + Links []*Link `protobuf:"bytes,1,rep,name=links,proto3" json:"links,omitempty"` +} + +func (x *ListCitationsResponse) Reset() { + *x = ListCitationsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_content_graph_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListCitationsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListCitationsResponse) ProtoMessage() {} + +func (x *ListCitationsResponse) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_content_graph_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListCitationsResponse.ProtoReflect.Descriptor instead. +func (*ListCitationsResponse) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_content_graph_proto_rawDescGZIP(), []int{1} +} + +func (x *ListCitationsResponse) GetLinks() []*Link { + if x != nil { + return x.Links + } + return nil +} + +// Description of a link inside a document. +type Link struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. Describes where link originates from. + Source *LinkNode `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"` + // Required. Describes where link points to. + // Here the block_id is optional, because the whole document can be linked. + Target *LinkNode `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"` + // Indicates whether the link targets the latest version of the document. + // Notice that the target link node might still have a version specified, + // which has to be treated as a frame of reference, i.e. "this version or newer" + // if is_latest is true. + IsLatest bool `protobuf:"varint,3,opt,name=is_latest,json=isLatest,proto3" json:"is_latest,omitempty"` +} + +func (x *Link) Reset() { + *x = Link{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_content_graph_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Link) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Link) ProtoMessage() {} + +func (x *Link) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_content_graph_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Link.ProtoReflect.Descriptor instead. +func (*Link) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_content_graph_proto_rawDescGZIP(), []int{2} +} + +func (x *Link) GetSource() *LinkNode { + if x != nil { + return x.Source + } + return nil +} + +func (x *Link) GetTarget() *LinkNode { + if x != nil { + return x.Target + } + return nil +} + +func (x *Link) GetIsLatest() bool { + if x != nil { + return x.IsLatest + } + return false +} + +// Describes "sides" of a Link. +type LinkNode struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ID of the document on one side of a Link. + DocumentId string `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` + // Version of the document. + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + // ID of the block inside the document. + BlockId string `protobuf:"bytes,3,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"` +} + +func (x *LinkNode) Reset() { + *x = LinkNode{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_content_graph_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinkNode) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinkNode) ProtoMessage() {} + +func (x *LinkNode) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_content_graph_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LinkNode.ProtoReflect.Descriptor instead. +func (*LinkNode) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_content_graph_proto_rawDescGZIP(), []int{3} +} + +func (x *LinkNode) GetDocumentId() string { + if x != nil { + return x.DocumentId + } + return "" +} + +func (x *LinkNode) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *LinkNode) GetBlockId() string { + if x != nil { + return x.BlockId + } + return "" +} + +var File_documents_v2alpha_content_graph_proto protoreflect.FileDescriptor + +var file_documents_v2alpha_content_graph_proto_rawDesc = []byte{ + 0x0a, 0x25, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x32, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x67, 0x72, 0x61, 0x70, + 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, + 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x22, 0x37, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x69, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x64, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x4f, 0x0a, 0x15, + 0x4c, 0x69, 0x73, 0x74, 0x43, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x05, 0x6c, 0x69, 0x6e, 0x6b, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, + 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x05, 0x6c, 0x69, 0x6e, 0x6b, 0x73, 0x22, 0x9f, 0x01, + 0x0a, 0x04, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x3c, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, + 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x06, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, + 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x22, + 0x60, 0x0a, 0x08, 0x4c, 0x69, 0x6e, 0x6b, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x64, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, + 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x49, + 0x64, 0x32, 0x84, 0x01, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x47, 0x72, 0x61, + 0x70, 0x68, 0x12, 0x74, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x69, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, + 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x33, 0x5a, 0x31, 0x73, 0x65, 0x65, 0x64, + 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x32, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x3b, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_documents_v2alpha_content_graph_proto_rawDescOnce sync.Once + file_documents_v2alpha_content_graph_proto_rawDescData = file_documents_v2alpha_content_graph_proto_rawDesc +) + +func file_documents_v2alpha_content_graph_proto_rawDescGZIP() []byte { + file_documents_v2alpha_content_graph_proto_rawDescOnce.Do(func() { + file_documents_v2alpha_content_graph_proto_rawDescData = protoimpl.X.CompressGZIP(file_documents_v2alpha_content_graph_proto_rawDescData) + }) + return file_documents_v2alpha_content_graph_proto_rawDescData +} + +var file_documents_v2alpha_content_graph_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_documents_v2alpha_content_graph_proto_goTypes = []interface{}{ + (*ListCitationsRequest)(nil), // 0: com.seed.documents.v2alpha.ListCitationsRequest + (*ListCitationsResponse)(nil), // 1: com.seed.documents.v2alpha.ListCitationsResponse + (*Link)(nil), // 2: com.seed.documents.v2alpha.Link + (*LinkNode)(nil), // 3: com.seed.documents.v2alpha.LinkNode +} +var file_documents_v2alpha_content_graph_proto_depIdxs = []int32{ + 2, // 0: com.seed.documents.v2alpha.ListCitationsResponse.links:type_name -> com.seed.documents.v2alpha.Link + 3, // 1: com.seed.documents.v2alpha.Link.source:type_name -> com.seed.documents.v2alpha.LinkNode + 3, // 2: com.seed.documents.v2alpha.Link.target:type_name -> com.seed.documents.v2alpha.LinkNode + 0, // 3: com.seed.documents.v2alpha.ContentGraph.ListCitations:input_type -> com.seed.documents.v2alpha.ListCitationsRequest + 1, // 4: com.seed.documents.v2alpha.ContentGraph.ListCitations:output_type -> com.seed.documents.v2alpha.ListCitationsResponse + 4, // [4:5] is the sub-list for method output_type + 3, // [3:4] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_documents_v2alpha_content_graph_proto_init() } +func file_documents_v2alpha_content_graph_proto_init() { + if File_documents_v2alpha_content_graph_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_documents_v2alpha_content_graph_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCitationsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_content_graph_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCitationsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_content_graph_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Link); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_content_graph_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinkNode); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_documents_v2alpha_content_graph_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_documents_v2alpha_content_graph_proto_goTypes, + DependencyIndexes: file_documents_v2alpha_content_graph_proto_depIdxs, + MessageInfos: file_documents_v2alpha_content_graph_proto_msgTypes, + }.Build() + File_documents_v2alpha_content_graph_proto = out.File + file_documents_v2alpha_content_graph_proto_rawDesc = nil + file_documents_v2alpha_content_graph_proto_goTypes = nil + file_documents_v2alpha_content_graph_proto_depIdxs = nil +} diff --git a/backend/genproto/documents/v2alpha/content_graph_grpc.pb.go b/backend/genproto/documents/v2alpha/content_graph_grpc.pb.go new file mode 100644 index 000000000..e73b12410 --- /dev/null +++ b/backend/genproto/documents/v2alpha/content_graph_grpc.pb.go @@ -0,0 +1,103 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v4.24.4 +// source: documents/v2alpha/content_graph.proto + +package documents + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// ContentGraphClient is the client API for ContentGraph service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ContentGraphClient interface { + ListCitations(ctx context.Context, in *ListCitationsRequest, opts ...grpc.CallOption) (*ListCitationsResponse, error) +} + +type contentGraphClient struct { + cc grpc.ClientConnInterface +} + +func NewContentGraphClient(cc grpc.ClientConnInterface) ContentGraphClient { + return &contentGraphClient{cc} +} + +func (c *contentGraphClient) ListCitations(ctx context.Context, in *ListCitationsRequest, opts ...grpc.CallOption) (*ListCitationsResponse, error) { + out := new(ListCitationsResponse) + err := c.cc.Invoke(ctx, "/com.seed.documents.v2alpha.ContentGraph/ListCitations", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ContentGraphServer is the server API for ContentGraph service. +// All implementations should embed UnimplementedContentGraphServer +// for forward compatibility +type ContentGraphServer interface { + ListCitations(context.Context, *ListCitationsRequest) (*ListCitationsResponse, error) +} + +// UnimplementedContentGraphServer should be embedded to have forward compatible implementations. +type UnimplementedContentGraphServer struct { +} + +func (UnimplementedContentGraphServer) ListCitations(context.Context, *ListCitationsRequest) (*ListCitationsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListCitations not implemented") +} + +// UnsafeContentGraphServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ContentGraphServer will +// result in compilation errors. +type UnsafeContentGraphServer interface { + mustEmbedUnimplementedContentGraphServer() +} + +func RegisterContentGraphServer(s grpc.ServiceRegistrar, srv ContentGraphServer) { + s.RegisterService(&ContentGraph_ServiceDesc, srv) +} + +func _ContentGraph_ListCitations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListCitationsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContentGraphServer).ListCitations(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.documents.v2alpha.ContentGraph/ListCitations", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContentGraphServer).ListCitations(ctx, req.(*ListCitationsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ContentGraph_ServiceDesc is the grpc.ServiceDesc for ContentGraph service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ContentGraph_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "com.seed.documents.v2alpha.ContentGraph", + HandlerType: (*ContentGraphServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListCitations", + Handler: _ContentGraph_ListCitations_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "documents/v2alpha/content_graph.proto", +} diff --git a/backend/genproto/documents/v2alpha/documents.pb.go b/backend/genproto/documents/v2alpha/documents.pb.go new file mode 100644 index 000000000..d1c59bfb0 --- /dev/null +++ b/backend/genproto/documents/v2alpha/documents.pb.go @@ -0,0 +1,3746 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v4.24.4 +// source: documents/v2alpha/documents.proto + +package documents + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Relationship between a document and an account +type RoleType int32 + +const ( + // No permissions. + RoleType_ROLE_UNSPECIFIED RoleType = 0 + // The role for an owner. All permissions are granted. + RoleType_OWNER RoleType = 1 + // Allowed to invite/remove writers+collaborators, edit content, and merge suggested changes + RoleType_EDITOR RoleType = 2 + // Allowed to change content + RoleType_WRITER RoleType = 3 + // Their comments and suggested changes will be distributed alongside the document + RoleType_COLLABORATOR RoleType = 4 +) + +// Enum value maps for RoleType. +var ( + RoleType_name = map[int32]string{ + 0: "ROLE_UNSPECIFIED", + 1: "OWNER", + 2: "EDITOR", + 3: "WRITER", + 4: "COLLABORATOR", + } + RoleType_value = map[string]int32{ + "ROLE_UNSPECIFIED": 0, + "OWNER": 1, + "EDITOR": 2, + "WRITER": 3, + "COLLABORATOR": 4, + } +) + +func (x RoleType) Enum() *RoleType { + p := new(RoleType) + *p = x + return p +} + +func (x RoleType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (RoleType) Descriptor() protoreflect.EnumDescriptor { + return file_documents_v2alpha_documents_proto_enumTypes[0].Descriptor() +} + +func (RoleType) Type() protoreflect.EnumType { + return &file_documents_v2alpha_documents_proto_enumTypes[0] +} + +func (x RoleType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use RoleType.Descriptor instead. +func (RoleType) EnumDescriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{0} +} + +// Request to create a new draft for an existing standalone branch +type CreateDraftRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. ID of the document branch that will be updated. + DocumentId string `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` +} + +func (x *CreateDraftRequest) Reset() { + *x = CreateDraftRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateDraftRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateDraftRequest) ProtoMessage() {} + +func (x *CreateDraftRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateDraftRequest.ProtoReflect.Descriptor instead. +func (*CreateDraftRequest) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateDraftRequest) GetDocumentId() string { + if x != nil { + return x.DocumentId + } + return "" +} + +// Request to create a draft for a new standalone branch, optionally based on an existing document. +type CreateBranchDraftRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Optional. Document which will be branched from. If not specified, a new document will be created. + DocumentId string `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` + // Optional. Version of the existing document to create draft from. + // If version is specified, document_id must also be specified. + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` +} + +func (x *CreateBranchDraftRequest) Reset() { + *x = CreateBranchDraftRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateBranchDraftRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateBranchDraftRequest) ProtoMessage() {} + +func (x *CreateBranchDraftRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateBranchDraftRequest.ProtoReflect.Descriptor instead. +func (*CreateBranchDraftRequest) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateBranchDraftRequest) GetDocumentId() string { + if x != nil { + return x.DocumentId + } + return "" +} + +func (x *CreateBranchDraftRequest) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +// Request to create a new branch which will be saved to the index of another document. +// If this path already exists in the parent, the index will be updated when the draft is published. +// If this path does not exist in the parent, the index will be created when the draft is published. +type CreateIndexDraftRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. ID of the parent document. + DocumentId string `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` + // Required. Path of the document to create a draft for. May include slashes to represent a deep index. + Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` +} + +func (x *CreateIndexDraftRequest) Reset() { + *x = CreateIndexDraftRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateIndexDraftRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateIndexDraftRequest) ProtoMessage() {} + +func (x *CreateIndexDraftRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateIndexDraftRequest.ProtoReflect.Descriptor instead. +func (*CreateIndexDraftRequest) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{2} +} + +func (x *CreateIndexDraftRequest) GetDocumentId() string { + if x != nil { + return x.DocumentId + } + return "" +} + +func (x *CreateIndexDraftRequest) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +// Request to create a draft for a profile document. +type CreateProfileDraftRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. Account ID to create a profile draft for. + AccountId string `protobuf:"bytes,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` +} + +func (x *CreateProfileDraftRequest) Reset() { + *x = CreateProfileDraftRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateProfileDraftRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateProfileDraftRequest) ProtoMessage() {} + +func (x *CreateProfileDraftRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateProfileDraftRequest.ProtoReflect.Descriptor instead. +func (*CreateProfileDraftRequest) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{3} +} + +func (x *CreateProfileDraftRequest) GetAccountId() string { + if x != nil { + return x.AccountId + } + return "" +} + +// Request to delete an existing draft. +type DeleteDraftRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. ID of the branch to delete. + BranchId string `protobuf:"bytes,1,opt,name=branch_id,json=branchId,proto3" json:"branch_id,omitempty"` +} + +func (x *DeleteDraftRequest) Reset() { + *x = DeleteDraftRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteDraftRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteDraftRequest) ProtoMessage() {} + +func (x *DeleteDraftRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteDraftRequest.ProtoReflect.Descriptor instead. +func (*DeleteDraftRequest) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{4} +} + +func (x *DeleteDraftRequest) GetBranchId() string { + if x != nil { + return x.BranchId + } + return "" +} + +// Request to get a single draft. +type GetDraftRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. ID of the draft that was previously created. + DraftId string `protobuf:"bytes,1,opt,name=draft_id,json=draftId,proto3" json:"draft_id,omitempty"` +} + +func (x *GetDraftRequest) Reset() { + *x = GetDraftRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetDraftRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetDraftRequest) ProtoMessage() {} + +func (x *GetDraftRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetDraftRequest.ProtoReflect.Descriptor instead. +func (*GetDraftRequest) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{5} +} + +func (x *GetDraftRequest) GetDraftId() string { + if x != nil { + return x.DraftId + } + return "" +} + +// Request the draft for an account's profile document +type GetProfileDraftRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. Account ID to get the profile draft for. + AccountId string `protobuf:"bytes,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` +} + +func (x *GetProfileDraftRequest) Reset() { + *x = GetProfileDraftRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetProfileDraftRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetProfileDraftRequest) ProtoMessage() {} + +func (x *GetProfileDraftRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetProfileDraftRequest.ProtoReflect.Descriptor instead. +func (*GetProfileDraftRequest) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{6} +} + +func (x *GetProfileDraftRequest) GetAccountId() string { + if x != nil { + return x.AccountId + } + return "" +} + +// Request to update an existing draft using granular operations. +type UpdateDraftRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ID of the document to be updated. + DocumentId string `protobuf:"bytes,3,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` + // List of document changes that must be applied to the existing document. + Changes []*DocumentChange `protobuf:"bytes,4,rep,name=changes,proto3" json:"changes,omitempty"` +} + +func (x *UpdateDraftRequest) Reset() { + *x = UpdateDraftRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateDraftRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateDraftRequest) ProtoMessage() {} + +func (x *UpdateDraftRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateDraftRequest.ProtoReflect.Descriptor instead. +func (*UpdateDraftRequest) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{7} +} + +func (x *UpdateDraftRequest) GetDocumentId() string { + if x != nil { + return x.DocumentId + } + return "" +} + +func (x *UpdateDraftRequest) GetChanges() []*DocumentChange { + if x != nil { + return x.Changes + } + return nil +} + +// Response after draft is updated. +type UpdateDraftResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The ID of the change representing the draft version after the update is processed. + ChangeId string `protobuf:"bytes,1,opt,name=change_id,json=changeId,proto3" json:"change_id,omitempty"` + // The state of the document after the update. + UpdatedDocument *Document `protobuf:"bytes,2,opt,name=updated_document,json=updatedDocument,proto3" json:"updated_document,omitempty"` +} + +func (x *UpdateDraftResponse) Reset() { + *x = UpdateDraftResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateDraftResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateDraftResponse) ProtoMessage() {} + +func (x *UpdateDraftResponse) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateDraftResponse.ProtoReflect.Descriptor instead. +func (*UpdateDraftResponse) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{8} +} + +func (x *UpdateDraftResponse) GetChangeId() string { + if x != nil { + return x.ChangeId + } + return "" +} + +func (x *UpdateDraftResponse) GetUpdatedDocument() *Document { + if x != nil { + return x.UpdatedDocument + } + return nil +} + +// Granular document change. +type DocumentChange struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Op: + // + // *DocumentChange_SetMetadata_ + // *DocumentChange_SetIndex_ + // *DocumentChange_MoveBlock_ + // *DocumentChange_ReplaceBlock + // *DocumentChange_DeleteBlock + // *DocumentChange_UpdateMember_ + Op isDocumentChange_Op `protobuf_oneof:"op"` +} + +func (x *DocumentChange) Reset() { + *x = DocumentChange{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DocumentChange) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DocumentChange) ProtoMessage() {} + +func (x *DocumentChange) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DocumentChange.ProtoReflect.Descriptor instead. +func (*DocumentChange) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{9} +} + +func (m *DocumentChange) GetOp() isDocumentChange_Op { + if m != nil { + return m.Op + } + return nil +} + +func (x *DocumentChange) GetSetMetadata() *DocumentChange_SetMetadata { + if x, ok := x.GetOp().(*DocumentChange_SetMetadata_); ok { + return x.SetMetadata + } + return nil +} + +func (x *DocumentChange) GetSetIndex() *DocumentChange_SetIndex { + if x, ok := x.GetOp().(*DocumentChange_SetIndex_); ok { + return x.SetIndex + } + return nil +} + +func (x *DocumentChange) GetMoveBlock() *DocumentChange_MoveBlock { + if x, ok := x.GetOp().(*DocumentChange_MoveBlock_); ok { + return x.MoveBlock + } + return nil +} + +func (x *DocumentChange) GetReplaceBlock() *Block { + if x, ok := x.GetOp().(*DocumentChange_ReplaceBlock); ok { + return x.ReplaceBlock + } + return nil +} + +func (x *DocumentChange) GetDeleteBlock() string { + if x, ok := x.GetOp().(*DocumentChange_DeleteBlock); ok { + return x.DeleteBlock + } + return "" +} + +func (x *DocumentChange) GetUpdateMember() *DocumentChange_UpdateMember { + if x, ok := x.GetOp().(*DocumentChange_UpdateMember_); ok { + return x.UpdateMember + } + return nil +} + +type isDocumentChange_Op interface { + isDocumentChange_Op() +} + +type DocumentChange_SetMetadata_ struct { + // New metadata to set on the document. + SetMetadata *DocumentChange_SetMetadata `protobuf:"bytes,1,opt,name=set_metadata,json=setMetadata,proto3,oneof"` +} + +type DocumentChange_SetIndex_ struct { + // New index to set on the document. + SetIndex *DocumentChange_SetIndex `protobuf:"bytes,2,opt,name=set_index,json=setIndex,proto3,oneof"` +} + +type DocumentChange_MoveBlock_ struct { + // Move operation that creates/moves a block within the document hierarchy. + MoveBlock *DocumentChange_MoveBlock `protobuf:"bytes,3,opt,name=move_block,json=moveBlock,proto3,oneof"` +} + +type DocumentChange_ReplaceBlock struct { + // New block state that replaces an existing block. + ReplaceBlock *Block `protobuf:"bytes,4,opt,name=replace_block,json=replaceBlock,proto3,oneof"` +} + +type DocumentChange_DeleteBlock struct { + // ID of a block to delete. + DeleteBlock string `protobuf:"bytes,5,opt,name=delete_block,json=deleteBlock,proto3,oneof"` +} + +type DocumentChange_UpdateMember_ struct { + // Update membership for an account on this document. + UpdateMember *DocumentChange_UpdateMember `protobuf:"bytes,6,opt,name=update_member,json=updateMember,proto3,oneof"` +} + +func (*DocumentChange_SetMetadata_) isDocumentChange_Op() {} + +func (*DocumentChange_SetIndex_) isDocumentChange_Op() {} + +func (*DocumentChange_MoveBlock_) isDocumentChange_Op() {} + +func (*DocumentChange_ReplaceBlock) isDocumentChange_Op() {} + +func (*DocumentChange_DeleteBlock) isDocumentChange_Op() {} + +func (*DocumentChange_UpdateMember_) isDocumentChange_Op() {} + +// Request to list stored drafts. +type ListDraftsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Optional. Number of results per page. + PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + // Optional. Token for the page to return. + PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` +} + +func (x *ListDraftsRequest) Reset() { + *x = ListDraftsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListDraftsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListDraftsRequest) ProtoMessage() {} + +func (x *ListDraftsRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListDraftsRequest.ProtoReflect.Descriptor instead. +func (*ListDraftsRequest) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{10} +} + +func (x *ListDraftsRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListDraftsRequest) GetPageToken() string { + if x != nil { + return x.PageToken + } + return "" +} + +// Response for listing drafts. +type ListDraftsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Drafts matching the list request. + // Content is omitted. + Documents []*Document `protobuf:"bytes,1,rep,name=documents,proto3" json:"documents,omitempty"` + // Token for the next page if there's any. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` +} + +func (x *ListDraftsResponse) Reset() { + *x = ListDraftsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListDraftsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListDraftsResponse) ProtoMessage() {} + +func (x *ListDraftsResponse) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListDraftsResponse.ProtoReflect.Descriptor instead. +func (*ListDraftsResponse) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{11} +} + +func (x *ListDraftsResponse) GetDocuments() []*Document { + if x != nil { + return x.Documents + } + return nil +} + +func (x *ListDraftsResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +// Request to list document drafts. +type ListDocumentDraftsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ID of the document to list drafts for. + DocumentId string `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` +} + +func (x *ListDocumentDraftsRequest) Reset() { + *x = ListDocumentDraftsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListDocumentDraftsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListDocumentDraftsRequest) ProtoMessage() {} + +func (x *ListDocumentDraftsRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListDocumentDraftsRequest.ProtoReflect.Descriptor instead. +func (*ListDocumentDraftsRequest) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{12} +} + +func (x *ListDocumentDraftsRequest) GetDocumentId() string { + if x != nil { + return x.DocumentId + } + return "" +} + +// Response with the list of drafts for a given document ID. +type ListDocumentDraftsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Drafts come without content, only metadata, + // similar to the rest of list responses. + Drafts []*Document `protobuf:"bytes,1,rep,name=drafts,proto3" json:"drafts,omitempty"` +} + +func (x *ListDocumentDraftsResponse) Reset() { + *x = ListDocumentDraftsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListDocumentDraftsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListDocumentDraftsResponse) ProtoMessage() {} + +func (x *ListDocumentDraftsResponse) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListDocumentDraftsResponse.ProtoReflect.Descriptor instead. +func (*ListDocumentDraftsResponse) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{13} +} + +func (x *ListDocumentDraftsResponse) GetDrafts() []*Document { + if x != nil { + return x.Drafts + } + return nil +} + +// Request to publish a draft. +type PublishDraftRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ID of the draft to be published. + DraftId string `protobuf:"bytes,1,opt,name=draft_id,json=draftId,proto3" json:"draft_id,omitempty"` +} + +func (x *PublishDraftRequest) Reset() { + *x = PublishDraftRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PublishDraftRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PublishDraftRequest) ProtoMessage() {} + +func (x *PublishDraftRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PublishDraftRequest.ProtoReflect.Descriptor instead. +func (*PublishDraftRequest) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{14} +} + +func (x *PublishDraftRequest) GetDraftId() string { + if x != nil { + return x.DraftId + } + return "" +} + +// Request for getting a single document. +type GetDocumentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. ID of the published document. + DocumentId string `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` + // Optional. Specific version of the published document. If empty, the latest one is returned. + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` +} + +func (x *GetDocumentRequest) Reset() { + *x = GetDocumentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetDocumentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetDocumentRequest) ProtoMessage() {} + +func (x *GetDocumentRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetDocumentRequest.ProtoReflect.Descriptor instead. +func (*GetDocumentRequest) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{15} +} + +func (x *GetDocumentRequest) GetDocumentId() string { + if x != nil { + return x.DocumentId + } + return "" +} + +func (x *GetDocumentRequest) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +// Request for getting an account's profile document. +type GetProfileDocumentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. ID of the account. + AccountId string `protobuf:"bytes,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` + // Optional. Specific version of the profile. If empty, the latest one is returned. + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` +} + +func (x *GetProfileDocumentRequest) Reset() { + *x = GetProfileDocumentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetProfileDocumentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetProfileDocumentRequest) ProtoMessage() {} + +func (x *GetProfileDocumentRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetProfileDocumentRequest.ProtoReflect.Descriptor instead. +func (*GetProfileDocumentRequest) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{16} +} + +func (x *GetProfileDocumentRequest) GetAccountId() string { + if x != nil { + return x.AccountId + } + return "" +} + +func (x *GetProfileDocumentRequest) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +// Used to request the document within the indexes of other documents +type GetDocumentIndexRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // the parent document ID + DocumentId string `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` + // the path of the document which will be retrieved. may include slashes to represent a deep index + Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` +} + +func (x *GetDocumentIndexRequest) Reset() { + *x = GetDocumentIndexRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetDocumentIndexRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetDocumentIndexRequest) ProtoMessage() {} + +func (x *GetDocumentIndexRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetDocumentIndexRequest.ProtoReflect.Descriptor instead. +func (*GetDocumentIndexRequest) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{17} +} + +func (x *GetDocumentIndexRequest) GetDocumentId() string { + if x != nil { + return x.DocumentId + } + return "" +} + +func (x *GetDocumentIndexRequest) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +type GetDocumentIndexResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // id of the parent document + DocumentId string `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` + // version of the parent document + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + // path of the child document. may include slashes to represent a deep index + Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` + // the document at the given path + Document *Document `protobuf:"bytes,4,opt,name=document,proto3" json:"document,omitempty"` +} + +func (x *GetDocumentIndexResponse) Reset() { + *x = GetDocumentIndexResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetDocumentIndexResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetDocumentIndexResponse) ProtoMessage() {} + +func (x *GetDocumentIndexResponse) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetDocumentIndexResponse.ProtoReflect.Descriptor instead. +func (*GetDocumentIndexResponse) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{18} +} + +func (x *GetDocumentIndexResponse) GetDocumentId() string { + if x != nil { + return x.DocumentId + } + return "" +} + +func (x *GetDocumentIndexResponse) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *GetDocumentIndexResponse) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *GetDocumentIndexResponse) GetDocument() *Document { + if x != nil { + return x.Document + } + return nil +} + +type ChangeDocumentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. ID of the document to be updated. + DocumentId string `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` + // Required. Changes to be applied to the document. + Changes []*DocumentChange `protobuf:"bytes,2,rep,name=changes,proto3" json:"changes,omitempty"` +} + +func (x *ChangeDocumentRequest) Reset() { + *x = ChangeDocumentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChangeDocumentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangeDocumentRequest) ProtoMessage() {} + +func (x *ChangeDocumentRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChangeDocumentRequest.ProtoReflect.Descriptor instead. +func (*ChangeDocumentRequest) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{19} +} + +func (x *ChangeDocumentRequest) GetDocumentId() string { + if x != nil { + return x.DocumentId + } + return "" +} + +func (x *ChangeDocumentRequest) GetChanges() []*DocumentChange { + if x != nil { + return x.Changes + } + return nil +} + +type ChangeProfileDocumentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. Account ID to update the profile document for. + AccountId string `protobuf:"bytes,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` + // Required. Changes to be applied to the profile document. + Changes []*DocumentChange `protobuf:"bytes,2,rep,name=changes,proto3" json:"changes,omitempty"` +} + +func (x *ChangeProfileDocumentRequest) Reset() { + *x = ChangeProfileDocumentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChangeProfileDocumentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangeProfileDocumentRequest) ProtoMessage() {} + +func (x *ChangeProfileDocumentRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChangeProfileDocumentRequest.ProtoReflect.Descriptor instead. +func (*ChangeProfileDocumentRequest) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{20} +} + +func (x *ChangeProfileDocumentRequest) GetAccountId() string { + if x != nil { + return x.AccountId + } + return "" +} + +func (x *ChangeProfileDocumentRequest) GetChanges() []*DocumentChange { + if x != nil { + return x.Changes + } + return nil +} + +// Request for getting a single document. +type PushDocumentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. ID of the published document to be pushed. + DocumentId string `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` + // Required. URL of the gateway to push to. Multiaddress format accepted (comma separated). + Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` +} + +func (x *PushDocumentRequest) Reset() { + *x = PushDocumentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PushDocumentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PushDocumentRequest) ProtoMessage() {} + +func (x *PushDocumentRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PushDocumentRequest.ProtoReflect.Descriptor instead. +func (*PushDocumentRequest) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{21} +} + +func (x *PushDocumentRequest) GetDocumentId() string { + if x != nil { + return x.DocumentId + } + return "" +} + +func (x *PushDocumentRequest) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +// Request for listing documents. +type ListDocumentsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Optional. Number of results per page. Default is defined by the server. + PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + // Optional. Value from next_page_token obtains from a previous response. + PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` +} + +func (x *ListDocumentsRequest) Reset() { + *x = ListDocumentsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListDocumentsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListDocumentsRequest) ProtoMessage() {} + +func (x *ListDocumentsRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListDocumentsRequest.ProtoReflect.Descriptor instead. +func (*ListDocumentsRequest) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{22} +} + +func (x *ListDocumentsRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListDocumentsRequest) GetPageToken() string { + if x != nil { + return x.PageToken + } + return "" +} + +// Response with list of documents. +type ListDocumentsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // List of documents matching the request. + // Only most recent versions are returned. + // Content is omitted, only metadata is present. + Documents []*Document `protobuf:"bytes,1,rep,name=documents,proto3" json:"documents,omitempty"` + // Token for the next page if there're more results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` +} + +func (x *ListDocumentsResponse) Reset() { + *x = ListDocumentsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListDocumentsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListDocumentsResponse) ProtoMessage() {} + +func (x *ListDocumentsResponse) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListDocumentsResponse.ProtoReflect.Descriptor instead. +func (*ListDocumentsResponse) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{23} +} + +func (x *ListDocumentsResponse) GetDocuments() []*Document { + if x != nil { + return x.Documents + } + return nil +} + +func (x *ListDocumentsResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +type ListDocumentBranchesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. ID of the document to list branches for. + DocumentId string `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` +} + +func (x *ListDocumentBranchesRequest) Reset() { + *x = ListDocumentBranchesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListDocumentBranchesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListDocumentBranchesRequest) ProtoMessage() {} + +func (x *ListDocumentBranchesRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListDocumentBranchesRequest.ProtoReflect.Descriptor instead. +func (*ListDocumentBranchesRequest) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{24} +} + +func (x *ListDocumentBranchesRequest) GetDocumentId() string { + if x != nil { + return x.DocumentId + } + return "" +} + +type ListDocumentBranchesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // List of branches for the document. + Branches []*Branch `protobuf:"bytes,1,rep,name=branches,proto3" json:"branches,omitempty"` + // List of drafts for these branches. Includes a draft that will become a draft when published. + Drafts []*Draft `protobuf:"bytes,2,rep,name=drafts,proto3" json:"drafts,omitempty"` +} + +func (x *ListDocumentBranchesResponse) Reset() { + *x = ListDocumentBranchesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListDocumentBranchesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListDocumentBranchesResponse) ProtoMessage() {} + +func (x *ListDocumentBranchesResponse) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListDocumentBranchesResponse.ProtoReflect.Descriptor instead. +func (*ListDocumentBranchesResponse) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{25} +} + +func (x *ListDocumentBranchesResponse) GetBranches() []*Branch { + if x != nil { + return x.Branches + } + return nil +} + +func (x *ListDocumentBranchesResponse) GetDrafts() []*Draft { + if x != nil { + return x.Drafts + } + return nil +} + +type Branch struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ID for use when deleting or publishing the branch + BranchId string `protobuf:"bytes,1,opt,name=branch_id,json=branchId,proto3" json:"branch_id,omitempty"` + // ID of the top-level doc which will be updated. For standalone branches this is the doc ID. + // for index branches this is the parent doc ID. + DocumentId string `protobuf:"bytes,2,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` + // the path of the document which is being updated. may include slashes to represent a deep index + Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` +} + +func (x *Branch) Reset() { + *x = Branch{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Branch) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Branch) ProtoMessage() {} + +func (x *Branch) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Branch.ProtoReflect.Descriptor instead. +func (*Branch) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{26} +} + +func (x *Branch) GetBranchId() string { + if x != nil { + return x.BranchId + } + return "" +} + +func (x *Branch) GetDocumentId() string { + if x != nil { + return x.DocumentId + } + return "" +} + +func (x *Branch) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +// Request for listing documents owned by a given account. +type ListAccountDocumentsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Optional. Number of results per page. Default is defined by the server. + PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + // Optional. Value from next_page_token obtains from a previous response. + PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + // Required. Account ID to list documents for. + AccountId string `protobuf:"bytes,3,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` +} + +func (x *ListAccountDocumentsRequest) Reset() { + *x = ListAccountDocumentsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListAccountDocumentsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAccountDocumentsRequest) ProtoMessage() {} + +func (x *ListAccountDocumentsRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAccountDocumentsRequest.ProtoReflect.Descriptor instead. +func (*ListAccountDocumentsRequest) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{27} +} + +func (x *ListAccountDocumentsRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListAccountDocumentsRequest) GetPageToken() string { + if x != nil { + return x.PageToken + } + return "" +} + +func (x *ListAccountDocumentsRequest) GetAccountId() string { + if x != nil { + return x.AccountId + } + return "" +} + +// Request for merging changes in a document. +type MergeChangesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. Document ID from which versions are going to be taken. + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Required. Versions to be merged. + Versions []string `protobuf:"bytes,2,rep,name=versions,proto3" json:"versions,omitempty"` +} + +func (x *MergeChangesRequest) Reset() { + *x = MergeChangesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MergeChangesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MergeChangesRequest) ProtoMessage() {} + +func (x *MergeChangesRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[28] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MergeChangesRequest.ProtoReflect.Descriptor instead. +func (*MergeChangesRequest) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{28} +} + +func (x *MergeChangesRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *MergeChangesRequest) GetVersions() []string { + if x != nil { + return x.Versions + } + return nil +} + +// Request for rebasing changes in a document. +type RebaseChangesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. Draft ID to be rebased. + BaseDraftId string `protobuf:"bytes,1,opt,name=base_draft_id,json=baseDraftId,proto3" json:"base_draft_id,omitempty"` + // Required. Versions to be applied applied on top of the base document. + Versions []string `protobuf:"bytes,3,rep,name=versions,proto3" json:"versions,omitempty"` +} + +func (x *RebaseChangesRequest) Reset() { + *x = RebaseChangesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RebaseChangesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RebaseChangesRequest) ProtoMessage() {} + +func (x *RebaseChangesRequest) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[29] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RebaseChangesRequest.ProtoReflect.Descriptor instead. +func (*RebaseChangesRequest) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{29} +} + +func (x *RebaseChangesRequest) GetBaseDraftId() string { + if x != nil { + return x.BaseDraftId + } + return "" +} + +func (x *RebaseChangesRequest) GetVersions() []string { + if x != nil { + return x.Versions + } + return nil +} + +type Draft struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // to identify the draft + DraftId string `protobuf:"bytes,1,opt,name=draft_id,json=draftId,proto3" json:"draft_id,omitempty"` + // state of the draft + Document *Document `protobuf:"bytes,2,opt,name=document,proto3" json:"document,omitempty"` + // True if this is a profile draft + IsProfile bool `protobuf:"varint,3,opt,name=is_profile,json=isProfile,proto3" json:"is_profile,omitempty"` + // The top-level entity that this draft will update once published. An Account ID for profile drafts, otherwise Document ID. + EntityId string `protobuf:"bytes,4,opt,name=entity_id,json=entityId,proto3" json:"entity_id,omitempty"` + // Optional. The path where the draft will be updated once published + Path string `protobuf:"bytes,5,opt,name=path,proto3" json:"path,omitempty"` +} + +func (x *Draft) Reset() { + *x = Draft{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Draft) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Draft) ProtoMessage() {} + +func (x *Draft) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[30] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Draft.ProtoReflect.Descriptor instead. +func (*Draft) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{30} +} + +func (x *Draft) GetDraftId() string { + if x != nil { + return x.DraftId + } + return "" +} + +func (x *Draft) GetDocument() *Document { + if x != nil { + return x.Document + } + return nil +} + +func (x *Draft) GetIsProfile() bool { + if x != nil { + return x.IsProfile + } + return false +} + +func (x *Draft) GetEntityId() string { + if x != nil { + return x.EntityId + } + return "" +} + +func (x *Draft) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +// Document represents metadata and content of a document. +type Document struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Permanent ID of the document. + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Output only. Author ID of the document. + Author string `protobuf:"bytes,4,opt,name=author,proto3" json:"author,omitempty"` + // Metadata values for a document. + Metadata map[string]string `protobuf:"bytes,15,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Output only. Set to account ID if this is a profile document. + ProfileAccountId string `protobuf:"bytes,14,opt,name=profile_account_id,json=profileAccountId,proto3" json:"profile_account_id,omitempty"` + // Output only. Every account ID who has modified the document. + // Includes the original author as well. + Authors []string `protobuf:"bytes,11,rep,name=authors,proto3" json:"authors,omitempty"` + // Blocks content of the document. + Content []*BlockNode `protobuf:"bytes,9,rep,name=content,proto3" json:"content,omitempty"` + // The indexed children documents under this document. + // Keys are used as the path names (and slash "/" is not allowed in the key) + // Values will refer to other documents as exact versions such as "hm://DOC_ID?v=1" + // Values may refer to "latest" versions with "hm://DOC_ID" + Index map[string]string `protobuf:"bytes,16,rep,name=index,proto3" json:"index,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Output only. Time when document was created. + CreateTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + // Output only. Time when document was updated. + UpdateTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` + // Output only. Time when this version was published. Not present in drafts. + PublishTime *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=publish_time,json=publishTime,proto3" json:"publish_time,omitempty"` + // Output only. Current version of the document. + Version string `protobuf:"bytes,12,opt,name=version,proto3" json:"version,omitempty"` + // Output only. Previous version of the document, + // Empty if this is the first version. + PreviousVersion string `protobuf:"bytes,13,opt,name=previous_version,json=previousVersion,proto3" json:"previous_version,omitempty"` +} + +func (x *Document) Reset() { + *x = Document{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Document) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Document) ProtoMessage() {} + +func (x *Document) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[31] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Document.ProtoReflect.Descriptor instead. +func (*Document) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{31} +} + +func (x *Document) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Document) GetAuthor() string { + if x != nil { + return x.Author + } + return "" +} + +func (x *Document) GetMetadata() map[string]string { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *Document) GetProfileAccountId() string { + if x != nil { + return x.ProfileAccountId + } + return "" +} + +func (x *Document) GetAuthors() []string { + if x != nil { + return x.Authors + } + return nil +} + +func (x *Document) GetContent() []*BlockNode { + if x != nil { + return x.Content + } + return nil +} + +func (x *Document) GetIndex() map[string]string { + if x != nil { + return x.Index + } + return nil +} + +func (x *Document) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +func (x *Document) GetUpdateTime() *timestamppb.Timestamp { + if x != nil { + return x.UpdateTime + } + return nil +} + +func (x *Document) GetPublishTime() *timestamppb.Timestamp { + if x != nil { + return x.PublishTime + } + return nil +} + +func (x *Document) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *Document) GetPreviousVersion() string { + if x != nil { + return x.PreviousVersion + } + return "" +} + +// Content block with children. +type BlockNode struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Content block. + Block *Block `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"` + // Child blocks. + Children []*BlockNode `protobuf:"bytes,2,rep,name=children,proto3" json:"children,omitempty"` +} + +func (x *BlockNode) Reset() { + *x = BlockNode{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BlockNode) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockNode) ProtoMessage() {} + +func (x *BlockNode) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[32] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockNode.ProtoReflect.Descriptor instead. +func (*BlockNode) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{32} +} + +func (x *BlockNode) GetBlock() *Block { + if x != nil { + return x.Block + } + return nil +} + +func (x *BlockNode) GetChildren() []*BlockNode { + if x != nil { + return x.Children + } + return nil +} + +// Content block. +type Block struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Block ID. Must be unique within the document. + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Type of the block. Specific to the renderer. + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + // Text of the content block. + Text string `protobuf:"bytes,3,opt,name=text,proto3" json:"text,omitempty"` + // Optional. The hyperlink to an external resource. + // Must be a valid URL. + Ref string `protobuf:"bytes,7,opt,name=ref,proto3" json:"ref,omitempty"` + // Arbitrary attributes of the block. + Attributes map[string]string `protobuf:"bytes,4,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Annotation "layers" of the block. + Annotations []*Annotation `protobuf:"bytes,5,rep,name=annotations,proto3" json:"annotations,omitempty"` + // Output only. Current revision of the block. It's the ID of the last Change that modified this block. + // Additional information about the Change can be obtained using the Changes service. + Revision string `protobuf:"bytes,6,opt,name=revision,proto3" json:"revision,omitempty"` +} + +func (x *Block) Reset() { + *x = Block{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Block) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Block) ProtoMessage() {} + +func (x *Block) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[33] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Block.ProtoReflect.Descriptor instead. +func (*Block) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{33} +} + +func (x *Block) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Block) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Block) GetText() string { + if x != nil { + return x.Text + } + return "" +} + +func (x *Block) GetRef() string { + if x != nil { + return x.Ref + } + return "" +} + +func (x *Block) GetAttributes() map[string]string { + if x != nil { + return x.Attributes + } + return nil +} + +func (x *Block) GetAnnotations() []*Annotation { + if x != nil { + return x.Annotations + } + return nil +} + +func (x *Block) GetRevision() string { + if x != nil { + return x.Revision + } + return "" +} + +// Conceptual annotation "layer" that is applied to arbitrary spans of block text. +// An "identity" of the layer should be derived deterministically based on its type +// attributes. Spans inside the same annotation can't overlap. +// +// Spans are stored inside the Annotation in a "columnar" format, +// i.e. StructureOfArrays instead of ArrayOfStructures. See: https://en.wikipedia.org/wiki/AoS_and_SoA. +// This is useful to reduce the number of allocations and offers more compact serialization, because +// protobuf is able to "pack" primitive repeated fields more efficiently. +type Annotation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Type of the annotation. + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + // Optional. A hyperlink to an external resource. + // Must be a valid URL. + Ref string `protobuf:"bytes,5,opt,name=ref,proto3" json:"ref,omitempty"` + // Arbitrary key-value attributes of the annotation. + Attributes map[string]string `protobuf:"bytes,2,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Start offsets of possibly disjoint spans of text for which this annotation is applied. + // Must be sorted and have the same number of items as `ends` list. + Starts []int32 `protobuf:"varint,3,rep,packed,name=starts,proto3" json:"starts,omitempty"` + // End offsets of possibly disjoint spans of text for which this annotation is applied. + // Must be sorted and have the same number of items as `starts` list. + Ends []int32 `protobuf:"varint,4,rep,packed,name=ends,proto3" json:"ends,omitempty"` +} + +func (x *Annotation) Reset() { + *x = Annotation{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Annotation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Annotation) ProtoMessage() {} + +func (x *Annotation) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[34] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Annotation.ProtoReflect.Descriptor instead. +func (*Annotation) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{34} +} + +func (x *Annotation) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Annotation) GetRef() string { + if x != nil { + return x.Ref + } + return "" +} + +func (x *Annotation) GetAttributes() map[string]string { + if x != nil { + return x.Attributes + } + return nil +} + +func (x *Annotation) GetStarts() []int32 { + if x != nil { + return x.Starts + } + return nil +} + +func (x *Annotation) GetEnds() []int32 { + if x != nil { + return x.Ends + } + return nil +} + +// Operation to move an existing block to a different place in the document. +// Move and Create operations are both expressed with this. +// Conceptually new blocks are moved out of nowhere into the document. +type DocumentChange_MoveBlock struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ID of the block to move. + BlockId string `protobuf:"bytes,1,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"` + // ID of the new parent for the block being moved. + Parent string `protobuf:"bytes,2,opt,name=parent,proto3" json:"parent,omitempty"` + // ID of the new left sibling for the block being moved. + LeftSibling string `protobuf:"bytes,3,opt,name=left_sibling,json=leftSibling,proto3" json:"left_sibling,omitempty"` +} + +func (x *DocumentChange_MoveBlock) Reset() { + *x = DocumentChange_MoveBlock{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DocumentChange_MoveBlock) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DocumentChange_MoveBlock) ProtoMessage() {} + +func (x *DocumentChange_MoveBlock) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[35] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DocumentChange_MoveBlock.ProtoReflect.Descriptor instead. +func (*DocumentChange_MoveBlock) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{9, 0} +} + +func (x *DocumentChange_MoveBlock) GetBlockId() string { + if x != nil { + return x.BlockId + } + return "" +} + +func (x *DocumentChange_MoveBlock) GetParent() string { + if x != nil { + return x.Parent + } + return "" +} + +func (x *DocumentChange_MoveBlock) GetLeftSibling() string { + if x != nil { + return x.LeftSibling + } + return "" +} + +// Operation to replace a metadata field with a new value +type DocumentChange_SetMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Metadata key to set. + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + // Metadata value to set. + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *DocumentChange_SetMetadata) Reset() { + *x = DocumentChange_SetMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DocumentChange_SetMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DocumentChange_SetMetadata) ProtoMessage() {} + +func (x *DocumentChange_SetMetadata) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[36] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DocumentChange_SetMetadata.ProtoReflect.Descriptor instead. +func (*DocumentChange_SetMetadata) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{9, 1} +} + +func (x *DocumentChange_SetMetadata) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *DocumentChange_SetMetadata) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +// Operation to replace an index field with a new value +type DocumentChange_SetIndex struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Index key to set. + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + // Index value to set. + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *DocumentChange_SetIndex) Reset() { + *x = DocumentChange_SetIndex{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DocumentChange_SetIndex) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DocumentChange_SetIndex) ProtoMessage() {} + +func (x *DocumentChange_SetIndex) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[37] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DocumentChange_SetIndex.ProtoReflect.Descriptor instead. +func (*DocumentChange_SetIndex) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{9, 2} +} + +func (x *DocumentChange_SetIndex) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *DocumentChange_SetIndex) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +// Operation to change membership +type DocumentChange_UpdateMember struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Account ID to update the role for. + AccountId string `protobuf:"bytes,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` + // New role to set for the account. + Role RoleType `protobuf:"varint,2,opt,name=role,proto3,enum=com.seed.documents.v2alpha.RoleType" json:"role,omitempty"` +} + +func (x *DocumentChange_UpdateMember) Reset() { + *x = DocumentChange_UpdateMember{} + if protoimpl.UnsafeEnabled { + mi := &file_documents_v2alpha_documents_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DocumentChange_UpdateMember) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DocumentChange_UpdateMember) ProtoMessage() {} + +func (x *DocumentChange_UpdateMember) ProtoReflect() protoreflect.Message { + mi := &file_documents_v2alpha_documents_proto_msgTypes[38] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DocumentChange_UpdateMember.ProtoReflect.Descriptor instead. +func (*DocumentChange_UpdateMember) Descriptor() ([]byte, []int) { + return file_documents_v2alpha_documents_proto_rawDescGZIP(), []int{9, 3} +} + +func (x *DocumentChange_UpdateMember) GetAccountId() string { + if x != nil { + return x.AccountId + } + return "" +} + +func (x *DocumentChange_UpdateMember) GetRole() RoleType { + if x != nil { + return x.Role + } + return RoleType_ROLE_UNSPECIFIED +} + +var File_documents_v2alpha_documents_proto protoreflect.FileDescriptor + +var file_documents_v2alpha_documents_proto_rawDesc = []byte{ + 0x0a, 0x21, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x32, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, + 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x1a, + 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x35, 0x0a, + 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x49, 0x64, 0x22, 0x55, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x72, + 0x61, 0x6e, 0x63, 0x68, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, + 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x4e, 0x0a, 0x17, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x3a, 0x0a, 0x19, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x44, 0x72, 0x61, 0x66, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x31, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, + 0x09, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x49, 0x64, 0x22, 0x2c, 0x0a, 0x0f, 0x47, 0x65, + 0x74, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, + 0x08, 0x64, 0x72, 0x61, 0x66, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x64, 0x72, 0x61, 0x66, 0x74, 0x49, 0x64, 0x22, 0x37, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x50, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, + 0x64, 0x22, 0x7b, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x6f, 0x63, 0x75, 0x6d, + 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, + 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x44, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, + 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, + 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x43, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x22, 0x83, + 0x01, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x49, 0x64, 0x12, 0x4f, 0x0a, 0x10, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x64, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, + 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, + 0x65, 0x6e, 0x74, 0x52, 0x0f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x44, 0x6f, 0x63, 0x75, + 0x6d, 0x65, 0x6e, 0x74, 0x22, 0xa4, 0x06, 0x0a, 0x0e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x5b, 0x0a, 0x0c, 0x73, 0x65, 0x74, 0x5f, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, + 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, + 0x65, 0x6e, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x12, 0x52, 0x0a, 0x09, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, + 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x2e, 0x53, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x48, 0x00, 0x52, 0x08, + 0x73, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x55, 0x0a, 0x0a, 0x6d, 0x6f, 0x76, 0x65, + 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x63, + 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x4d, 0x6f, 0x76, 0x65, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x48, 0x00, 0x52, 0x09, 0x6d, 0x6f, 0x76, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, + 0x48, 0x0a, 0x0d, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, + 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x00, 0x52, 0x0c, 0x72, 0x65, 0x70, + 0x6c, 0x61, 0x63, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x23, 0x0a, 0x0c, 0x64, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x00, 0x52, 0x0b, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x5e, + 0x0a, 0x0d, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, + 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x48, 0x00, + 0x52, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x1a, 0x61, + 0x0a, 0x09, 0x4d, 0x6f, 0x76, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x19, 0x0a, 0x08, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x21, + 0x0a, 0x0c, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x73, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6c, 0x65, 0x66, 0x74, 0x53, 0x69, 0x62, 0x6c, 0x69, 0x6e, + 0x67, 0x1a, 0x35, 0x0a, 0x0b, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x32, 0x0a, 0x08, 0x53, 0x65, 0x74, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x67, 0x0a, 0x0c, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x38, 0x0a, 0x04, 0x72, + 0x6f, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, + 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, + 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x42, 0x04, 0x0a, 0x02, 0x6f, 0x70, 0x22, 0x4f, 0x0a, 0x11, 0x4c, + 0x69, 0x73, 0x74, 0x44, 0x72, 0x61, 0x66, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, + 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x80, 0x01, 0x0a, + 0x12, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x72, 0x61, 0x66, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x09, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, + 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x09, 0x64, 0x6f, + 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, + 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, + 0x3c, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x44, + 0x72, 0x61, 0x66, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, + 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x5a, 0x0a, + 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x72, 0x61, + 0x66, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x64, + 0x72, 0x61, 0x66, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, + 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x52, 0x06, 0x64, 0x72, 0x61, 0x66, 0x74, 0x73, 0x22, 0x30, 0x0a, 0x13, 0x50, 0x75, 0x62, + 0x6c, 0x69, 0x73, 0x68, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x19, 0x0a, 0x08, 0x64, 0x72, 0x61, 0x66, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x64, 0x72, 0x61, 0x66, 0x74, 0x49, 0x64, 0x22, 0x4f, 0x0a, 0x12, 0x47, + 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x54, 0x0a, 0x19, + 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x22, 0x4e, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, + 0x0b, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, + 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, + 0x74, 0x68, 0x22, 0xab, 0x01, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x1f, 0x0a, 0x0b, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, + 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, + 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x40, + 0x0a, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, + 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x22, 0x7e, 0x0a, 0x15, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x44, 0x0a, 0x07, 0x63, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, + 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, + 0x22, 0x83, 0x01, 0x0a, 0x1c, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, + 0x12, 0x44, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x07, 0x63, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x22, 0x48, 0x0a, 0x13, 0x50, 0x75, 0x73, 0x68, 0x44, 0x6f, + 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, + 0x0b, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x10, + 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, + 0x22, 0x52, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, + 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, + 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x83, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, + 0x0a, 0x09, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x09, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, + 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x3e, 0x0a, 0x1b, 0x4c, 0x69, + 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x99, 0x01, 0x0a, 0x1c, 0x4c, + 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, + 0x68, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x08, 0x62, + 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, + 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x63, + 0x68, 0x52, 0x08, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x06, 0x64, + 0x72, 0x61, 0x66, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, + 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x06, + 0x64, 0x72, 0x61, 0x66, 0x74, 0x73, 0x22, 0x5a, 0x0a, 0x06, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, + 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x49, 0x64, 0x12, 0x1f, 0x0a, + 0x0b, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, + 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, + 0x74, 0x68, 0x22, 0x78, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, + 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, + 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x41, 0x0a, 0x13, + 0x4d, 0x65, 0x72, 0x67, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, + 0x56, 0x0a, 0x14, 0x52, 0x65, 0x62, 0x61, 0x73, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x5f, + 0x64, 0x72, 0x61, 0x66, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x62, 0x61, 0x73, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xb4, 0x01, 0x0a, 0x05, 0x44, 0x72, 0x61, 0x66, + 0x74, 0x12, 0x19, 0x0a, 0x08, 0x64, 0x72, 0x61, 0x66, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x72, 0x61, 0x66, 0x74, 0x49, 0x64, 0x12, 0x40, 0x0a, 0x08, + 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, + 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, + 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1d, + 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x1b, 0x0a, + 0x09, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, + 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0xc7, + 0x05, 0x0a, 0x08, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x12, 0x4e, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, + 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x12, 0x2c, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x10, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, + 0x64, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x73, 0x18, 0x0b, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x07, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x73, 0x12, 0x3f, 0x0a, 0x07, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x63, + 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, + 0x6f, 0x64, 0x65, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x45, 0x0a, 0x05, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x63, 0x6f, + 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, + 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3d, 0x0a, + 0x0c, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, + 0x75, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x38, + 0x0a, 0x0a, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x87, 0x01, 0x0a, 0x09, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x37, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, + 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, + 0x41, 0x0a, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x25, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, + 0x65, 0x6e, 0x22, 0xc9, 0x02, 0x0a, 0x05, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x74, 0x65, 0x78, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x66, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x72, 0x65, 0x66, 0x12, 0x51, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x63, 0x6f, 0x6d, + 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, + 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x41, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x61, + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x48, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, + 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x1a, + 0x3d, 0x0a, 0x0f, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xf5, + 0x01, 0x0a, 0x0a, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x66, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x72, 0x65, 0x66, 0x12, 0x56, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, + 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x65, 0x6e, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x05, 0x52, 0x04, 0x65, 0x6e, 0x64, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x41, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x2a, 0x55, 0x0a, 0x08, 0x52, 0x6f, 0x6c, 0x65, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, + 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x4f, 0x57, 0x4e, 0x45, + 0x52, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x45, 0x44, 0x49, 0x54, 0x4f, 0x52, 0x10, 0x02, 0x12, + 0x0a, 0x0a, 0x06, 0x57, 0x52, 0x49, 0x54, 0x45, 0x52, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x43, + 0x4f, 0x4c, 0x4c, 0x41, 0x42, 0x4f, 0x52, 0x41, 0x54, 0x4f, 0x52, 0x10, 0x04, 0x32, 0x99, 0x09, + 0x0a, 0x06, 0x44, 0x72, 0x61, 0x66, 0x74, 0x73, 0x12, 0x60, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, + 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, + 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x72, 0x61, 0x66, 0x74, 0x12, 0x6c, 0x0a, 0x11, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x44, 0x72, 0x61, 0x66, 0x74, 0x12, + 0x34, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, + 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x2e, 0x44, 0x72, 0x61, 0x66, 0x74, 0x12, 0x6a, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x44, 0x72, 0x61, 0x66, 0x74, 0x12, 0x33, 0x2e, 0x63, + 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x21, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, + 0x72, 0x61, 0x66, 0x74, 0x12, 0x6e, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, + 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x12, 0x35, 0x2e, 0x63, 0x6f, 0x6d, + 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, + 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, + 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x21, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, + 0x72, 0x61, 0x66, 0x74, 0x12, 0x55, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x72, + 0x61, 0x66, 0x74, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x5a, 0x0a, 0x08, 0x47, + 0x65, 0x74, 0x44, 0x72, 0x61, 0x66, 0x74, 0x12, 0x2b, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, + 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, + 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x2e, 0x44, 0x72, 0x61, 0x66, 0x74, 0x12, 0x68, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x50, 0x72, + 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x6d, + 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, + 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, + 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x72, 0x61, 0x66, + 0x74, 0x12, 0x6e, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, + 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x2f, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x6b, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x72, 0x61, 0x66, 0x74, 0x73, 0x12, + 0x2d, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x44, 0x72, 0x61, 0x66, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, + 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x44, 0x72, 0x61, 0x66, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x83, + 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x44, + 0x72, 0x61, 0x66, 0x74, 0x73, 0x12, 0x35, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, + 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x44, + 0x72, 0x61, 0x66, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x63, + 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, + 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x72, 0x61, 0x66, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, 0x0a, 0x0c, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x44, + 0x72, 0x61, 0x66, 0x74, 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, + 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, + 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x32, 0xa6, 0x08, 0x0a, 0x09, 0x44, 0x6f, + 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x63, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x44, 0x6f, + 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, + 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, + 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x71, 0x0a, 0x12, + 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x12, 0x35, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, + 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, + 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, + 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, + 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, + 0x7d, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x12, 0x33, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x2e, 0x47, 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, + 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x69, + 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x12, 0x31, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x77, 0x0a, 0x15, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x12, 0x38, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, + 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, + 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x44, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x63, + 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x12, 0x74, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, + 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x89, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, + 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, + 0x73, 0x12, 0x37, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, + 0x68, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x63, 0x6f, 0x6d, + 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, + 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, + 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x0c, 0x50, 0x75, 0x73, 0x68, 0x44, 0x6f, 0x63, 0x75, + 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, + 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x82, 0x01, + 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x44, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x37, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, + 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x44, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x31, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x32, 0xd7, 0x01, 0x0a, 0x05, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x12, 0x65, 0x0a, 0x0c, + 0x4d, 0x65, 0x72, 0x67, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x2f, 0x2e, 0x63, + 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x43, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, + 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, + 0x65, 0x6e, 0x74, 0x12, 0x67, 0x0a, 0x0d, 0x52, 0x65, 0x62, 0x61, 0x73, 0x65, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x73, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x2e, + 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x2e, 0x52, 0x65, 0x62, 0x61, 0x73, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x65, + 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x33, 0x5a, 0x31, + 0x73, 0x65, 0x65, 0x64, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x67, 0x65, 0x6e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, + 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x3b, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_documents_v2alpha_documents_proto_rawDescOnce sync.Once + file_documents_v2alpha_documents_proto_rawDescData = file_documents_v2alpha_documents_proto_rawDesc +) + +func file_documents_v2alpha_documents_proto_rawDescGZIP() []byte { + file_documents_v2alpha_documents_proto_rawDescOnce.Do(func() { + file_documents_v2alpha_documents_proto_rawDescData = protoimpl.X.CompressGZIP(file_documents_v2alpha_documents_proto_rawDescData) + }) + return file_documents_v2alpha_documents_proto_rawDescData +} + +var file_documents_v2alpha_documents_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_documents_v2alpha_documents_proto_msgTypes = make([]protoimpl.MessageInfo, 43) +var file_documents_v2alpha_documents_proto_goTypes = []interface{}{ + (RoleType)(0), // 0: com.seed.documents.v2alpha.RoleType + (*CreateDraftRequest)(nil), // 1: com.seed.documents.v2alpha.CreateDraftRequest + (*CreateBranchDraftRequest)(nil), // 2: com.seed.documents.v2alpha.CreateBranchDraftRequest + (*CreateIndexDraftRequest)(nil), // 3: com.seed.documents.v2alpha.CreateIndexDraftRequest + (*CreateProfileDraftRequest)(nil), // 4: com.seed.documents.v2alpha.CreateProfileDraftRequest + (*DeleteDraftRequest)(nil), // 5: com.seed.documents.v2alpha.DeleteDraftRequest + (*GetDraftRequest)(nil), // 6: com.seed.documents.v2alpha.GetDraftRequest + (*GetProfileDraftRequest)(nil), // 7: com.seed.documents.v2alpha.GetProfileDraftRequest + (*UpdateDraftRequest)(nil), // 8: com.seed.documents.v2alpha.UpdateDraftRequest + (*UpdateDraftResponse)(nil), // 9: com.seed.documents.v2alpha.UpdateDraftResponse + (*DocumentChange)(nil), // 10: com.seed.documents.v2alpha.DocumentChange + (*ListDraftsRequest)(nil), // 11: com.seed.documents.v2alpha.ListDraftsRequest + (*ListDraftsResponse)(nil), // 12: com.seed.documents.v2alpha.ListDraftsResponse + (*ListDocumentDraftsRequest)(nil), // 13: com.seed.documents.v2alpha.ListDocumentDraftsRequest + (*ListDocumentDraftsResponse)(nil), // 14: com.seed.documents.v2alpha.ListDocumentDraftsResponse + (*PublishDraftRequest)(nil), // 15: com.seed.documents.v2alpha.PublishDraftRequest + (*GetDocumentRequest)(nil), // 16: com.seed.documents.v2alpha.GetDocumentRequest + (*GetProfileDocumentRequest)(nil), // 17: com.seed.documents.v2alpha.GetProfileDocumentRequest + (*GetDocumentIndexRequest)(nil), // 18: com.seed.documents.v2alpha.GetDocumentIndexRequest + (*GetDocumentIndexResponse)(nil), // 19: com.seed.documents.v2alpha.GetDocumentIndexResponse + (*ChangeDocumentRequest)(nil), // 20: com.seed.documents.v2alpha.ChangeDocumentRequest + (*ChangeProfileDocumentRequest)(nil), // 21: com.seed.documents.v2alpha.ChangeProfileDocumentRequest + (*PushDocumentRequest)(nil), // 22: com.seed.documents.v2alpha.PushDocumentRequest + (*ListDocumentsRequest)(nil), // 23: com.seed.documents.v2alpha.ListDocumentsRequest + (*ListDocumentsResponse)(nil), // 24: com.seed.documents.v2alpha.ListDocumentsResponse + (*ListDocumentBranchesRequest)(nil), // 25: com.seed.documents.v2alpha.ListDocumentBranchesRequest + (*ListDocumentBranchesResponse)(nil), // 26: com.seed.documents.v2alpha.ListDocumentBranchesResponse + (*Branch)(nil), // 27: com.seed.documents.v2alpha.Branch + (*ListAccountDocumentsRequest)(nil), // 28: com.seed.documents.v2alpha.ListAccountDocumentsRequest + (*MergeChangesRequest)(nil), // 29: com.seed.documents.v2alpha.MergeChangesRequest + (*RebaseChangesRequest)(nil), // 30: com.seed.documents.v2alpha.RebaseChangesRequest + (*Draft)(nil), // 31: com.seed.documents.v2alpha.Draft + (*Document)(nil), // 32: com.seed.documents.v2alpha.Document + (*BlockNode)(nil), // 33: com.seed.documents.v2alpha.BlockNode + (*Block)(nil), // 34: com.seed.documents.v2alpha.Block + (*Annotation)(nil), // 35: com.seed.documents.v2alpha.Annotation + (*DocumentChange_MoveBlock)(nil), // 36: com.seed.documents.v2alpha.DocumentChange.MoveBlock + (*DocumentChange_SetMetadata)(nil), // 37: com.seed.documents.v2alpha.DocumentChange.SetMetadata + (*DocumentChange_SetIndex)(nil), // 38: com.seed.documents.v2alpha.DocumentChange.SetIndex + (*DocumentChange_UpdateMember)(nil), // 39: com.seed.documents.v2alpha.DocumentChange.UpdateMember + nil, // 40: com.seed.documents.v2alpha.Document.MetadataEntry + nil, // 41: com.seed.documents.v2alpha.Document.IndexEntry + nil, // 42: com.seed.documents.v2alpha.Block.AttributesEntry + nil, // 43: com.seed.documents.v2alpha.Annotation.AttributesEntry + (*timestamppb.Timestamp)(nil), // 44: google.protobuf.Timestamp + (*emptypb.Empty)(nil), // 45: google.protobuf.Empty +} +var file_documents_v2alpha_documents_proto_depIdxs = []int32{ + 10, // 0: com.seed.documents.v2alpha.UpdateDraftRequest.changes:type_name -> com.seed.documents.v2alpha.DocumentChange + 32, // 1: com.seed.documents.v2alpha.UpdateDraftResponse.updated_document:type_name -> com.seed.documents.v2alpha.Document + 37, // 2: com.seed.documents.v2alpha.DocumentChange.set_metadata:type_name -> com.seed.documents.v2alpha.DocumentChange.SetMetadata + 38, // 3: com.seed.documents.v2alpha.DocumentChange.set_index:type_name -> com.seed.documents.v2alpha.DocumentChange.SetIndex + 36, // 4: com.seed.documents.v2alpha.DocumentChange.move_block:type_name -> com.seed.documents.v2alpha.DocumentChange.MoveBlock + 34, // 5: com.seed.documents.v2alpha.DocumentChange.replace_block:type_name -> com.seed.documents.v2alpha.Block + 39, // 6: com.seed.documents.v2alpha.DocumentChange.update_member:type_name -> com.seed.documents.v2alpha.DocumentChange.UpdateMember + 32, // 7: com.seed.documents.v2alpha.ListDraftsResponse.documents:type_name -> com.seed.documents.v2alpha.Document + 32, // 8: com.seed.documents.v2alpha.ListDocumentDraftsResponse.drafts:type_name -> com.seed.documents.v2alpha.Document + 32, // 9: com.seed.documents.v2alpha.GetDocumentIndexResponse.document:type_name -> com.seed.documents.v2alpha.Document + 10, // 10: com.seed.documents.v2alpha.ChangeDocumentRequest.changes:type_name -> com.seed.documents.v2alpha.DocumentChange + 10, // 11: com.seed.documents.v2alpha.ChangeProfileDocumentRequest.changes:type_name -> com.seed.documents.v2alpha.DocumentChange + 32, // 12: com.seed.documents.v2alpha.ListDocumentsResponse.documents:type_name -> com.seed.documents.v2alpha.Document + 27, // 13: com.seed.documents.v2alpha.ListDocumentBranchesResponse.branches:type_name -> com.seed.documents.v2alpha.Branch + 31, // 14: com.seed.documents.v2alpha.ListDocumentBranchesResponse.drafts:type_name -> com.seed.documents.v2alpha.Draft + 32, // 15: com.seed.documents.v2alpha.Draft.document:type_name -> com.seed.documents.v2alpha.Document + 40, // 16: com.seed.documents.v2alpha.Document.metadata:type_name -> com.seed.documents.v2alpha.Document.MetadataEntry + 33, // 17: com.seed.documents.v2alpha.Document.content:type_name -> com.seed.documents.v2alpha.BlockNode + 41, // 18: com.seed.documents.v2alpha.Document.index:type_name -> com.seed.documents.v2alpha.Document.IndexEntry + 44, // 19: com.seed.documents.v2alpha.Document.create_time:type_name -> google.protobuf.Timestamp + 44, // 20: com.seed.documents.v2alpha.Document.update_time:type_name -> google.protobuf.Timestamp + 44, // 21: com.seed.documents.v2alpha.Document.publish_time:type_name -> google.protobuf.Timestamp + 34, // 22: com.seed.documents.v2alpha.BlockNode.block:type_name -> com.seed.documents.v2alpha.Block + 33, // 23: com.seed.documents.v2alpha.BlockNode.children:type_name -> com.seed.documents.v2alpha.BlockNode + 42, // 24: com.seed.documents.v2alpha.Block.attributes:type_name -> com.seed.documents.v2alpha.Block.AttributesEntry + 35, // 25: com.seed.documents.v2alpha.Block.annotations:type_name -> com.seed.documents.v2alpha.Annotation + 43, // 26: com.seed.documents.v2alpha.Annotation.attributes:type_name -> com.seed.documents.v2alpha.Annotation.AttributesEntry + 0, // 27: com.seed.documents.v2alpha.DocumentChange.UpdateMember.role:type_name -> com.seed.documents.v2alpha.RoleType + 1, // 28: com.seed.documents.v2alpha.Drafts.CreateDraft:input_type -> com.seed.documents.v2alpha.CreateDraftRequest + 2, // 29: com.seed.documents.v2alpha.Drafts.CreateBranchDraft:input_type -> com.seed.documents.v2alpha.CreateBranchDraftRequest + 3, // 30: com.seed.documents.v2alpha.Drafts.CreateIndexDraft:input_type -> com.seed.documents.v2alpha.CreateIndexDraftRequest + 4, // 31: com.seed.documents.v2alpha.Drafts.CreateProfileDraft:input_type -> com.seed.documents.v2alpha.CreateProfileDraftRequest + 5, // 32: com.seed.documents.v2alpha.Drafts.DeleteDraft:input_type -> com.seed.documents.v2alpha.DeleteDraftRequest + 6, // 33: com.seed.documents.v2alpha.Drafts.GetDraft:input_type -> com.seed.documents.v2alpha.GetDraftRequest + 7, // 34: com.seed.documents.v2alpha.Drafts.GetProfileDraft:input_type -> com.seed.documents.v2alpha.GetProfileDraftRequest + 8, // 35: com.seed.documents.v2alpha.Drafts.UpdateDraft:input_type -> com.seed.documents.v2alpha.UpdateDraftRequest + 11, // 36: com.seed.documents.v2alpha.Drafts.ListDrafts:input_type -> com.seed.documents.v2alpha.ListDraftsRequest + 13, // 37: com.seed.documents.v2alpha.Drafts.ListDocumentDrafts:input_type -> com.seed.documents.v2alpha.ListDocumentDraftsRequest + 15, // 38: com.seed.documents.v2alpha.Drafts.PublishDraft:input_type -> com.seed.documents.v2alpha.PublishDraftRequest + 16, // 39: com.seed.documents.v2alpha.Documents.GetDocument:input_type -> com.seed.documents.v2alpha.GetDocumentRequest + 17, // 40: com.seed.documents.v2alpha.Documents.GetProfileDocument:input_type -> com.seed.documents.v2alpha.GetProfileDocumentRequest + 18, // 41: com.seed.documents.v2alpha.Documents.GetDocumentIndex:input_type -> com.seed.documents.v2alpha.GetDocumentIndexRequest + 20, // 42: com.seed.documents.v2alpha.Documents.ChangeDocument:input_type -> com.seed.documents.v2alpha.ChangeDocumentRequest + 21, // 43: com.seed.documents.v2alpha.Documents.ChangeProfileDocument:input_type -> com.seed.documents.v2alpha.ChangeProfileDocumentRequest + 23, // 44: com.seed.documents.v2alpha.Documents.ListDocuments:input_type -> com.seed.documents.v2alpha.ListDocumentsRequest + 25, // 45: com.seed.documents.v2alpha.Documents.ListDocumentBranches:input_type -> com.seed.documents.v2alpha.ListDocumentBranchesRequest + 22, // 46: com.seed.documents.v2alpha.Documents.PushDocument:input_type -> com.seed.documents.v2alpha.PushDocumentRequest + 28, // 47: com.seed.documents.v2alpha.Documents.ListAccountDocuments:input_type -> com.seed.documents.v2alpha.ListAccountDocumentsRequest + 29, // 48: com.seed.documents.v2alpha.Merge.MergeChanges:input_type -> com.seed.documents.v2alpha.MergeChangesRequest + 30, // 49: com.seed.documents.v2alpha.Merge.RebaseChanges:input_type -> com.seed.documents.v2alpha.RebaseChangesRequest + 31, // 50: com.seed.documents.v2alpha.Drafts.CreateDraft:output_type -> com.seed.documents.v2alpha.Draft + 31, // 51: com.seed.documents.v2alpha.Drafts.CreateBranchDraft:output_type -> com.seed.documents.v2alpha.Draft + 31, // 52: com.seed.documents.v2alpha.Drafts.CreateIndexDraft:output_type -> com.seed.documents.v2alpha.Draft + 31, // 53: com.seed.documents.v2alpha.Drafts.CreateProfileDraft:output_type -> com.seed.documents.v2alpha.Draft + 45, // 54: com.seed.documents.v2alpha.Drafts.DeleteDraft:output_type -> google.protobuf.Empty + 31, // 55: com.seed.documents.v2alpha.Drafts.GetDraft:output_type -> com.seed.documents.v2alpha.Draft + 31, // 56: com.seed.documents.v2alpha.Drafts.GetProfileDraft:output_type -> com.seed.documents.v2alpha.Draft + 9, // 57: com.seed.documents.v2alpha.Drafts.UpdateDraft:output_type -> com.seed.documents.v2alpha.UpdateDraftResponse + 12, // 58: com.seed.documents.v2alpha.Drafts.ListDrafts:output_type -> com.seed.documents.v2alpha.ListDraftsResponse + 14, // 59: com.seed.documents.v2alpha.Drafts.ListDocumentDrafts:output_type -> com.seed.documents.v2alpha.ListDocumentDraftsResponse + 27, // 60: com.seed.documents.v2alpha.Drafts.PublishDraft:output_type -> com.seed.documents.v2alpha.Branch + 32, // 61: com.seed.documents.v2alpha.Documents.GetDocument:output_type -> com.seed.documents.v2alpha.Document + 32, // 62: com.seed.documents.v2alpha.Documents.GetProfileDocument:output_type -> com.seed.documents.v2alpha.Document + 19, // 63: com.seed.documents.v2alpha.Documents.GetDocumentIndex:output_type -> com.seed.documents.v2alpha.GetDocumentIndexResponse + 32, // 64: com.seed.documents.v2alpha.Documents.ChangeDocument:output_type -> com.seed.documents.v2alpha.Document + 32, // 65: com.seed.documents.v2alpha.Documents.ChangeProfileDocument:output_type -> com.seed.documents.v2alpha.Document + 24, // 66: com.seed.documents.v2alpha.Documents.ListDocuments:output_type -> com.seed.documents.v2alpha.ListDocumentsResponse + 26, // 67: com.seed.documents.v2alpha.Documents.ListDocumentBranches:output_type -> com.seed.documents.v2alpha.ListDocumentBranchesResponse + 45, // 68: com.seed.documents.v2alpha.Documents.PushDocument:output_type -> google.protobuf.Empty + 24, // 69: com.seed.documents.v2alpha.Documents.ListAccountDocuments:output_type -> com.seed.documents.v2alpha.ListDocumentsResponse + 32, // 70: com.seed.documents.v2alpha.Merge.MergeChanges:output_type -> com.seed.documents.v2alpha.Document + 32, // 71: com.seed.documents.v2alpha.Merge.RebaseChanges:output_type -> com.seed.documents.v2alpha.Document + 50, // [50:72] is the sub-list for method output_type + 28, // [28:50] is the sub-list for method input_type + 28, // [28:28] is the sub-list for extension type_name + 28, // [28:28] is the sub-list for extension extendee + 0, // [0:28] is the sub-list for field type_name +} + +func init() { file_documents_v2alpha_documents_proto_init() } +func file_documents_v2alpha_documents_proto_init() { + if File_documents_v2alpha_documents_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_documents_v2alpha_documents_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateDraftRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateBranchDraftRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateIndexDraftRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateProfileDraftRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteDraftRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetDraftRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetProfileDraftRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateDraftRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateDraftResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DocumentChange); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListDraftsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListDraftsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListDocumentDraftsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListDocumentDraftsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PublishDraftRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetDocumentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetProfileDocumentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetDocumentIndexRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetDocumentIndexResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChangeDocumentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChangeProfileDocumentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PushDocumentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListDocumentsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListDocumentsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListDocumentBranchesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListDocumentBranchesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Branch); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListAccountDocumentsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MergeChangesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RebaseChangesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Draft); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Document); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockNode); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Block); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Annotation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DocumentChange_MoveBlock); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DocumentChange_SetMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DocumentChange_SetIndex); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_documents_v2alpha_documents_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DocumentChange_UpdateMember); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_documents_v2alpha_documents_proto_msgTypes[9].OneofWrappers = []interface{}{ + (*DocumentChange_SetMetadata_)(nil), + (*DocumentChange_SetIndex_)(nil), + (*DocumentChange_MoveBlock_)(nil), + (*DocumentChange_ReplaceBlock)(nil), + (*DocumentChange_DeleteBlock)(nil), + (*DocumentChange_UpdateMember_)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_documents_v2alpha_documents_proto_rawDesc, + NumEnums: 1, + NumMessages: 43, + NumExtensions: 0, + NumServices: 3, + }, + GoTypes: file_documents_v2alpha_documents_proto_goTypes, + DependencyIndexes: file_documents_v2alpha_documents_proto_depIdxs, + EnumInfos: file_documents_v2alpha_documents_proto_enumTypes, + MessageInfos: file_documents_v2alpha_documents_proto_msgTypes, + }.Build() + File_documents_v2alpha_documents_proto = out.File + file_documents_v2alpha_documents_proto_rawDesc = nil + file_documents_v2alpha_documents_proto_goTypes = nil + file_documents_v2alpha_documents_proto_depIdxs = nil +} diff --git a/backend/genproto/documents/v2alpha/documents_grpc.pb.go b/backend/genproto/documents/v2alpha/documents_grpc.pb.go new file mode 100644 index 000000000..5b2779ee1 --- /dev/null +++ b/backend/genproto/documents/v2alpha/documents_grpc.pb.go @@ -0,0 +1,1000 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v4.24.4 +// source: documents/v2alpha/documents.proto + +package documents + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// DraftsClient is the client API for Drafts service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type DraftsClient interface { + // Creates a new draft of an existing standalone branch + CreateDraft(ctx context.Context, in *CreateDraftRequest, opts ...grpc.CallOption) (*Draft, error) + // Creates a draft for a new branch. + CreateBranchDraft(ctx context.Context, in *CreateBranchDraftRequest, opts ...grpc.CallOption) (*Draft, error) + // Creates a draft for an index branch. Thows if a draft already exists for this index. + CreateIndexDraft(ctx context.Context, in *CreateIndexDraftRequest, opts ...grpc.CallOption) (*Draft, error) + // Create a draft for a profile document. Thows if a draft already exists for this profile. + CreateProfileDraft(ctx context.Context, in *CreateProfileDraftRequest, opts ...grpc.CallOption) (*Draft, error) + // Deletes a draft by its document ID. + DeleteDraft(ctx context.Context, in *DeleteDraftRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Gets a single draft if exists. + GetDraft(ctx context.Context, in *GetDraftRequest, opts ...grpc.CallOption) (*Draft, error) + // Gets a draft for a profile document. + GetProfileDraft(ctx context.Context, in *GetProfileDraftRequest, opts ...grpc.CallOption) (*Draft, error) + // Updates a draft using granular update operations. + UpdateDraft(ctx context.Context, in *UpdateDraftRequest, opts ...grpc.CallOption) (*UpdateDraftResponse, error) + // List currently stored drafts. + ListDrafts(ctx context.Context, in *ListDraftsRequest, opts ...grpc.CallOption) (*ListDraftsResponse, error) + // Lists drafts for a given document. + ListDocumentDrafts(ctx context.Context, in *ListDocumentDraftsRequest, opts ...grpc.CallOption) (*ListDocumentDraftsResponse, error) + // Publishes a draft. Returns the branch that was published. + PublishDraft(ctx context.Context, in *PublishDraftRequest, opts ...grpc.CallOption) (*Branch, error) +} + +type draftsClient struct { + cc grpc.ClientConnInterface +} + +func NewDraftsClient(cc grpc.ClientConnInterface) DraftsClient { + return &draftsClient{cc} +} + +func (c *draftsClient) CreateDraft(ctx context.Context, in *CreateDraftRequest, opts ...grpc.CallOption) (*Draft, error) { + out := new(Draft) + err := c.cc.Invoke(ctx, "/com.seed.documents.v2alpha.Drafts/CreateDraft", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *draftsClient) CreateBranchDraft(ctx context.Context, in *CreateBranchDraftRequest, opts ...grpc.CallOption) (*Draft, error) { + out := new(Draft) + err := c.cc.Invoke(ctx, "/com.seed.documents.v2alpha.Drafts/CreateBranchDraft", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *draftsClient) CreateIndexDraft(ctx context.Context, in *CreateIndexDraftRequest, opts ...grpc.CallOption) (*Draft, error) { + out := new(Draft) + err := c.cc.Invoke(ctx, "/com.seed.documents.v2alpha.Drafts/CreateIndexDraft", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *draftsClient) CreateProfileDraft(ctx context.Context, in *CreateProfileDraftRequest, opts ...grpc.CallOption) (*Draft, error) { + out := new(Draft) + err := c.cc.Invoke(ctx, "/com.seed.documents.v2alpha.Drafts/CreateProfileDraft", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *draftsClient) DeleteDraft(ctx context.Context, in *DeleteDraftRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/com.seed.documents.v2alpha.Drafts/DeleteDraft", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *draftsClient) GetDraft(ctx context.Context, in *GetDraftRequest, opts ...grpc.CallOption) (*Draft, error) { + out := new(Draft) + err := c.cc.Invoke(ctx, "/com.seed.documents.v2alpha.Drafts/GetDraft", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *draftsClient) GetProfileDraft(ctx context.Context, in *GetProfileDraftRequest, opts ...grpc.CallOption) (*Draft, error) { + out := new(Draft) + err := c.cc.Invoke(ctx, "/com.seed.documents.v2alpha.Drafts/GetProfileDraft", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *draftsClient) UpdateDraft(ctx context.Context, in *UpdateDraftRequest, opts ...grpc.CallOption) (*UpdateDraftResponse, error) { + out := new(UpdateDraftResponse) + err := c.cc.Invoke(ctx, "/com.seed.documents.v2alpha.Drafts/UpdateDraft", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *draftsClient) ListDrafts(ctx context.Context, in *ListDraftsRequest, opts ...grpc.CallOption) (*ListDraftsResponse, error) { + out := new(ListDraftsResponse) + err := c.cc.Invoke(ctx, "/com.seed.documents.v2alpha.Drafts/ListDrafts", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *draftsClient) ListDocumentDrafts(ctx context.Context, in *ListDocumentDraftsRequest, opts ...grpc.CallOption) (*ListDocumentDraftsResponse, error) { + out := new(ListDocumentDraftsResponse) + err := c.cc.Invoke(ctx, "/com.seed.documents.v2alpha.Drafts/ListDocumentDrafts", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *draftsClient) PublishDraft(ctx context.Context, in *PublishDraftRequest, opts ...grpc.CallOption) (*Branch, error) { + out := new(Branch) + err := c.cc.Invoke(ctx, "/com.seed.documents.v2alpha.Drafts/PublishDraft", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// DraftsServer is the server API for Drafts service. +// All implementations should embed UnimplementedDraftsServer +// for forward compatibility +type DraftsServer interface { + // Creates a new draft of an existing standalone branch + CreateDraft(context.Context, *CreateDraftRequest) (*Draft, error) + // Creates a draft for a new branch. + CreateBranchDraft(context.Context, *CreateBranchDraftRequest) (*Draft, error) + // Creates a draft for an index branch. Thows if a draft already exists for this index. + CreateIndexDraft(context.Context, *CreateIndexDraftRequest) (*Draft, error) + // Create a draft for a profile document. Thows if a draft already exists for this profile. + CreateProfileDraft(context.Context, *CreateProfileDraftRequest) (*Draft, error) + // Deletes a draft by its document ID. + DeleteDraft(context.Context, *DeleteDraftRequest) (*emptypb.Empty, error) + // Gets a single draft if exists. + GetDraft(context.Context, *GetDraftRequest) (*Draft, error) + // Gets a draft for a profile document. + GetProfileDraft(context.Context, *GetProfileDraftRequest) (*Draft, error) + // Updates a draft using granular update operations. + UpdateDraft(context.Context, *UpdateDraftRequest) (*UpdateDraftResponse, error) + // List currently stored drafts. + ListDrafts(context.Context, *ListDraftsRequest) (*ListDraftsResponse, error) + // Lists drafts for a given document. + ListDocumentDrafts(context.Context, *ListDocumentDraftsRequest) (*ListDocumentDraftsResponse, error) + // Publishes a draft. Returns the branch that was published. + PublishDraft(context.Context, *PublishDraftRequest) (*Branch, error) +} + +// UnimplementedDraftsServer should be embedded to have forward compatible implementations. +type UnimplementedDraftsServer struct { +} + +func (UnimplementedDraftsServer) CreateDraft(context.Context, *CreateDraftRequest) (*Draft, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateDraft not implemented") +} +func (UnimplementedDraftsServer) CreateBranchDraft(context.Context, *CreateBranchDraftRequest) (*Draft, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateBranchDraft not implemented") +} +func (UnimplementedDraftsServer) CreateIndexDraft(context.Context, *CreateIndexDraftRequest) (*Draft, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateIndexDraft not implemented") +} +func (UnimplementedDraftsServer) CreateProfileDraft(context.Context, *CreateProfileDraftRequest) (*Draft, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateProfileDraft not implemented") +} +func (UnimplementedDraftsServer) DeleteDraft(context.Context, *DeleteDraftRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteDraft not implemented") +} +func (UnimplementedDraftsServer) GetDraft(context.Context, *GetDraftRequest) (*Draft, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetDraft not implemented") +} +func (UnimplementedDraftsServer) GetProfileDraft(context.Context, *GetProfileDraftRequest) (*Draft, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetProfileDraft not implemented") +} +func (UnimplementedDraftsServer) UpdateDraft(context.Context, *UpdateDraftRequest) (*UpdateDraftResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateDraft not implemented") +} +func (UnimplementedDraftsServer) ListDrafts(context.Context, *ListDraftsRequest) (*ListDraftsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListDrafts not implemented") +} +func (UnimplementedDraftsServer) ListDocumentDrafts(context.Context, *ListDocumentDraftsRequest) (*ListDocumentDraftsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListDocumentDrafts not implemented") +} +func (UnimplementedDraftsServer) PublishDraft(context.Context, *PublishDraftRequest) (*Branch, error) { + return nil, status.Errorf(codes.Unimplemented, "method PublishDraft not implemented") +} + +// UnsafeDraftsServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to DraftsServer will +// result in compilation errors. +type UnsafeDraftsServer interface { + mustEmbedUnimplementedDraftsServer() +} + +func RegisterDraftsServer(s grpc.ServiceRegistrar, srv DraftsServer) { + s.RegisterService(&Drafts_ServiceDesc, srv) +} + +func _Drafts_CreateDraft_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateDraftRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DraftsServer).CreateDraft(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.documents.v2alpha.Drafts/CreateDraft", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DraftsServer).CreateDraft(ctx, req.(*CreateDraftRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Drafts_CreateBranchDraft_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateBranchDraftRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DraftsServer).CreateBranchDraft(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.documents.v2alpha.Drafts/CreateBranchDraft", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DraftsServer).CreateBranchDraft(ctx, req.(*CreateBranchDraftRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Drafts_CreateIndexDraft_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateIndexDraftRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DraftsServer).CreateIndexDraft(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.documents.v2alpha.Drafts/CreateIndexDraft", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DraftsServer).CreateIndexDraft(ctx, req.(*CreateIndexDraftRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Drafts_CreateProfileDraft_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateProfileDraftRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DraftsServer).CreateProfileDraft(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.documents.v2alpha.Drafts/CreateProfileDraft", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DraftsServer).CreateProfileDraft(ctx, req.(*CreateProfileDraftRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Drafts_DeleteDraft_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteDraftRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DraftsServer).DeleteDraft(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.documents.v2alpha.Drafts/DeleteDraft", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DraftsServer).DeleteDraft(ctx, req.(*DeleteDraftRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Drafts_GetDraft_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetDraftRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DraftsServer).GetDraft(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.documents.v2alpha.Drafts/GetDraft", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DraftsServer).GetDraft(ctx, req.(*GetDraftRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Drafts_GetProfileDraft_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetProfileDraftRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DraftsServer).GetProfileDraft(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.documents.v2alpha.Drafts/GetProfileDraft", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DraftsServer).GetProfileDraft(ctx, req.(*GetProfileDraftRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Drafts_UpdateDraft_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateDraftRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DraftsServer).UpdateDraft(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.documents.v2alpha.Drafts/UpdateDraft", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DraftsServer).UpdateDraft(ctx, req.(*UpdateDraftRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Drafts_ListDrafts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListDraftsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DraftsServer).ListDrafts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.documents.v2alpha.Drafts/ListDrafts", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DraftsServer).ListDrafts(ctx, req.(*ListDraftsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Drafts_ListDocumentDrafts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListDocumentDraftsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DraftsServer).ListDocumentDrafts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.documents.v2alpha.Drafts/ListDocumentDrafts", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DraftsServer).ListDocumentDrafts(ctx, req.(*ListDocumentDraftsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Drafts_PublishDraft_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PublishDraftRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DraftsServer).PublishDraft(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.documents.v2alpha.Drafts/PublishDraft", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DraftsServer).PublishDraft(ctx, req.(*PublishDraftRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Drafts_ServiceDesc is the grpc.ServiceDesc for Drafts service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Drafts_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "com.seed.documents.v2alpha.Drafts", + HandlerType: (*DraftsServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateDraft", + Handler: _Drafts_CreateDraft_Handler, + }, + { + MethodName: "CreateBranchDraft", + Handler: _Drafts_CreateBranchDraft_Handler, + }, + { + MethodName: "CreateIndexDraft", + Handler: _Drafts_CreateIndexDraft_Handler, + }, + { + MethodName: "CreateProfileDraft", + Handler: _Drafts_CreateProfileDraft_Handler, + }, + { + MethodName: "DeleteDraft", + Handler: _Drafts_DeleteDraft_Handler, + }, + { + MethodName: "GetDraft", + Handler: _Drafts_GetDraft_Handler, + }, + { + MethodName: "GetProfileDraft", + Handler: _Drafts_GetProfileDraft_Handler, + }, + { + MethodName: "UpdateDraft", + Handler: _Drafts_UpdateDraft_Handler, + }, + { + MethodName: "ListDrafts", + Handler: _Drafts_ListDrafts_Handler, + }, + { + MethodName: "ListDocumentDrafts", + Handler: _Drafts_ListDocumentDrafts_Handler, + }, + { + MethodName: "PublishDraft", + Handler: _Drafts_PublishDraft_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "documents/v2alpha/documents.proto", +} + +// DocumentsClient is the client API for Documents service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type DocumentsClient interface { + // Gets a single document. + GetDocument(ctx context.Context, in *GetDocumentRequest, opts ...grpc.CallOption) (*Document, error) + // Gets an account's profile document. + GetProfileDocument(ctx context.Context, in *GetProfileDocumentRequest, opts ...grpc.CallOption) (*Document, error) + // Gets a document within the index(es) of other documents + GetDocumentIndex(ctx context.Context, in *GetDocumentIndexRequest, opts ...grpc.CallOption) (*GetDocumentIndexResponse, error) + // Immediately changes a document + ChangeDocument(ctx context.Context, in *ChangeDocumentRequest, opts ...grpc.CallOption) (*Document, error) + // Immediately changes an account's profile document + ChangeProfileDocument(ctx context.Context, in *ChangeProfileDocumentRequest, opts ...grpc.CallOption) (*Document, error) + // Lists all documents. Only the most recent versions show up. + ListDocuments(ctx context.Context, in *ListDocumentsRequest, opts ...grpc.CallOption) (*ListDocumentsResponse, error) + // Lists branches of a document. Includes standalone and index branches, and any drafts for these branches + ListDocumentBranches(ctx context.Context, in *ListDocumentBranchesRequest, opts ...grpc.CallOption) (*ListDocumentBranchesResponse, error) + // Push Local document to the gateway. + PushDocument(ctx context.Context, in *PushDocumentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Lists documents owned by a given account. + ListAccountDocuments(ctx context.Context, in *ListAccountDocumentsRequest, opts ...grpc.CallOption) (*ListDocumentsResponse, error) +} + +type documentsClient struct { + cc grpc.ClientConnInterface +} + +func NewDocumentsClient(cc grpc.ClientConnInterface) DocumentsClient { + return &documentsClient{cc} +} + +func (c *documentsClient) GetDocument(ctx context.Context, in *GetDocumentRequest, opts ...grpc.CallOption) (*Document, error) { + out := new(Document) + err := c.cc.Invoke(ctx, "/com.seed.documents.v2alpha.Documents/GetDocument", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *documentsClient) GetProfileDocument(ctx context.Context, in *GetProfileDocumentRequest, opts ...grpc.CallOption) (*Document, error) { + out := new(Document) + err := c.cc.Invoke(ctx, "/com.seed.documents.v2alpha.Documents/GetProfileDocument", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *documentsClient) GetDocumentIndex(ctx context.Context, in *GetDocumentIndexRequest, opts ...grpc.CallOption) (*GetDocumentIndexResponse, error) { + out := new(GetDocumentIndexResponse) + err := c.cc.Invoke(ctx, "/com.seed.documents.v2alpha.Documents/GetDocumentIndex", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *documentsClient) ChangeDocument(ctx context.Context, in *ChangeDocumentRequest, opts ...grpc.CallOption) (*Document, error) { + out := new(Document) + err := c.cc.Invoke(ctx, "/com.seed.documents.v2alpha.Documents/ChangeDocument", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *documentsClient) ChangeProfileDocument(ctx context.Context, in *ChangeProfileDocumentRequest, opts ...grpc.CallOption) (*Document, error) { + out := new(Document) + err := c.cc.Invoke(ctx, "/com.seed.documents.v2alpha.Documents/ChangeProfileDocument", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *documentsClient) ListDocuments(ctx context.Context, in *ListDocumentsRequest, opts ...grpc.CallOption) (*ListDocumentsResponse, error) { + out := new(ListDocumentsResponse) + err := c.cc.Invoke(ctx, "/com.seed.documents.v2alpha.Documents/ListDocuments", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *documentsClient) ListDocumentBranches(ctx context.Context, in *ListDocumentBranchesRequest, opts ...grpc.CallOption) (*ListDocumentBranchesResponse, error) { + out := new(ListDocumentBranchesResponse) + err := c.cc.Invoke(ctx, "/com.seed.documents.v2alpha.Documents/ListDocumentBranches", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *documentsClient) PushDocument(ctx context.Context, in *PushDocumentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/com.seed.documents.v2alpha.Documents/PushDocument", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *documentsClient) ListAccountDocuments(ctx context.Context, in *ListAccountDocumentsRequest, opts ...grpc.CallOption) (*ListDocumentsResponse, error) { + out := new(ListDocumentsResponse) + err := c.cc.Invoke(ctx, "/com.seed.documents.v2alpha.Documents/ListAccountDocuments", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// DocumentsServer is the server API for Documents service. +// All implementations should embed UnimplementedDocumentsServer +// for forward compatibility +type DocumentsServer interface { + // Gets a single document. + GetDocument(context.Context, *GetDocumentRequest) (*Document, error) + // Gets an account's profile document. + GetProfileDocument(context.Context, *GetProfileDocumentRequest) (*Document, error) + // Gets a document within the index(es) of other documents + GetDocumentIndex(context.Context, *GetDocumentIndexRequest) (*GetDocumentIndexResponse, error) + // Immediately changes a document + ChangeDocument(context.Context, *ChangeDocumentRequest) (*Document, error) + // Immediately changes an account's profile document + ChangeProfileDocument(context.Context, *ChangeProfileDocumentRequest) (*Document, error) + // Lists all documents. Only the most recent versions show up. + ListDocuments(context.Context, *ListDocumentsRequest) (*ListDocumentsResponse, error) + // Lists branches of a document. Includes standalone and index branches, and any drafts for these branches + ListDocumentBranches(context.Context, *ListDocumentBranchesRequest) (*ListDocumentBranchesResponse, error) + // Push Local document to the gateway. + PushDocument(context.Context, *PushDocumentRequest) (*emptypb.Empty, error) + // Lists documents owned by a given account. + ListAccountDocuments(context.Context, *ListAccountDocumentsRequest) (*ListDocumentsResponse, error) +} + +// UnimplementedDocumentsServer should be embedded to have forward compatible implementations. +type UnimplementedDocumentsServer struct { +} + +func (UnimplementedDocumentsServer) GetDocument(context.Context, *GetDocumentRequest) (*Document, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetDocument not implemented") +} +func (UnimplementedDocumentsServer) GetProfileDocument(context.Context, *GetProfileDocumentRequest) (*Document, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetProfileDocument not implemented") +} +func (UnimplementedDocumentsServer) GetDocumentIndex(context.Context, *GetDocumentIndexRequest) (*GetDocumentIndexResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetDocumentIndex not implemented") +} +func (UnimplementedDocumentsServer) ChangeDocument(context.Context, *ChangeDocumentRequest) (*Document, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChangeDocument not implemented") +} +func (UnimplementedDocumentsServer) ChangeProfileDocument(context.Context, *ChangeProfileDocumentRequest) (*Document, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChangeProfileDocument not implemented") +} +func (UnimplementedDocumentsServer) ListDocuments(context.Context, *ListDocumentsRequest) (*ListDocumentsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListDocuments not implemented") +} +func (UnimplementedDocumentsServer) ListDocumentBranches(context.Context, *ListDocumentBranchesRequest) (*ListDocumentBranchesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListDocumentBranches not implemented") +} +func (UnimplementedDocumentsServer) PushDocument(context.Context, *PushDocumentRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method PushDocument not implemented") +} +func (UnimplementedDocumentsServer) ListAccountDocuments(context.Context, *ListAccountDocumentsRequest) (*ListDocumentsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListAccountDocuments not implemented") +} + +// UnsafeDocumentsServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to DocumentsServer will +// result in compilation errors. +type UnsafeDocumentsServer interface { + mustEmbedUnimplementedDocumentsServer() +} + +func RegisterDocumentsServer(s grpc.ServiceRegistrar, srv DocumentsServer) { + s.RegisterService(&Documents_ServiceDesc, srv) +} + +func _Documents_GetDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetDocumentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DocumentsServer).GetDocument(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.documents.v2alpha.Documents/GetDocument", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DocumentsServer).GetDocument(ctx, req.(*GetDocumentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Documents_GetProfileDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetProfileDocumentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DocumentsServer).GetProfileDocument(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.documents.v2alpha.Documents/GetProfileDocument", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DocumentsServer).GetProfileDocument(ctx, req.(*GetProfileDocumentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Documents_GetDocumentIndex_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetDocumentIndexRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DocumentsServer).GetDocumentIndex(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.documents.v2alpha.Documents/GetDocumentIndex", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DocumentsServer).GetDocumentIndex(ctx, req.(*GetDocumentIndexRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Documents_ChangeDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ChangeDocumentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DocumentsServer).ChangeDocument(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.documents.v2alpha.Documents/ChangeDocument", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DocumentsServer).ChangeDocument(ctx, req.(*ChangeDocumentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Documents_ChangeProfileDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ChangeProfileDocumentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DocumentsServer).ChangeProfileDocument(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.documents.v2alpha.Documents/ChangeProfileDocument", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DocumentsServer).ChangeProfileDocument(ctx, req.(*ChangeProfileDocumentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Documents_ListDocuments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListDocumentsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DocumentsServer).ListDocuments(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.documents.v2alpha.Documents/ListDocuments", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DocumentsServer).ListDocuments(ctx, req.(*ListDocumentsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Documents_ListDocumentBranches_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListDocumentBranchesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DocumentsServer).ListDocumentBranches(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.documents.v2alpha.Documents/ListDocumentBranches", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DocumentsServer).ListDocumentBranches(ctx, req.(*ListDocumentBranchesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Documents_PushDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PushDocumentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DocumentsServer).PushDocument(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.documents.v2alpha.Documents/PushDocument", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DocumentsServer).PushDocument(ctx, req.(*PushDocumentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Documents_ListAccountDocuments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListAccountDocumentsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DocumentsServer).ListAccountDocuments(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.documents.v2alpha.Documents/ListAccountDocuments", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DocumentsServer).ListAccountDocuments(ctx, req.(*ListAccountDocumentsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Documents_ServiceDesc is the grpc.ServiceDesc for Documents service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Documents_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "com.seed.documents.v2alpha.Documents", + HandlerType: (*DocumentsServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetDocument", + Handler: _Documents_GetDocument_Handler, + }, + { + MethodName: "GetProfileDocument", + Handler: _Documents_GetProfileDocument_Handler, + }, + { + MethodName: "GetDocumentIndex", + Handler: _Documents_GetDocumentIndex_Handler, + }, + { + MethodName: "ChangeDocument", + Handler: _Documents_ChangeDocument_Handler, + }, + { + MethodName: "ChangeProfileDocument", + Handler: _Documents_ChangeProfileDocument_Handler, + }, + { + MethodName: "ListDocuments", + Handler: _Documents_ListDocuments_Handler, + }, + { + MethodName: "ListDocumentBranches", + Handler: _Documents_ListDocumentBranches_Handler, + }, + { + MethodName: "PushDocument", + Handler: _Documents_PushDocument_Handler, + }, + { + MethodName: "ListAccountDocuments", + Handler: _Documents_ListAccountDocuments_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "documents/v2alpha/documents.proto", +} + +// MergeClient is the client API for Merge service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MergeClient interface { + // Merge changes and publishes. + MergeChanges(ctx context.Context, in *MergeChangesRequest, opts ...grpc.CallOption) (*Document, error) + // Rebase changes + RebaseChanges(ctx context.Context, in *RebaseChangesRequest, opts ...grpc.CallOption) (*Document, error) +} + +type mergeClient struct { + cc grpc.ClientConnInterface +} + +func NewMergeClient(cc grpc.ClientConnInterface) MergeClient { + return &mergeClient{cc} +} + +func (c *mergeClient) MergeChanges(ctx context.Context, in *MergeChangesRequest, opts ...grpc.CallOption) (*Document, error) { + out := new(Document) + err := c.cc.Invoke(ctx, "/com.seed.documents.v2alpha.Merge/MergeChanges", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *mergeClient) RebaseChanges(ctx context.Context, in *RebaseChangesRequest, opts ...grpc.CallOption) (*Document, error) { + out := new(Document) + err := c.cc.Invoke(ctx, "/com.seed.documents.v2alpha.Merge/RebaseChanges", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MergeServer is the server API for Merge service. +// All implementations should embed UnimplementedMergeServer +// for forward compatibility +type MergeServer interface { + // Merge changes and publishes. + MergeChanges(context.Context, *MergeChangesRequest) (*Document, error) + // Rebase changes + RebaseChanges(context.Context, *RebaseChangesRequest) (*Document, error) +} + +// UnimplementedMergeServer should be embedded to have forward compatible implementations. +type UnimplementedMergeServer struct { +} + +func (UnimplementedMergeServer) MergeChanges(context.Context, *MergeChangesRequest) (*Document, error) { + return nil, status.Errorf(codes.Unimplemented, "method MergeChanges not implemented") +} +func (UnimplementedMergeServer) RebaseChanges(context.Context, *RebaseChangesRequest) (*Document, error) { + return nil, status.Errorf(codes.Unimplemented, "method RebaseChanges not implemented") +} + +// UnsafeMergeServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MergeServer will +// result in compilation errors. +type UnsafeMergeServer interface { + mustEmbedUnimplementedMergeServer() +} + +func RegisterMergeServer(s grpc.ServiceRegistrar, srv MergeServer) { + s.RegisterService(&Merge_ServiceDesc, srv) +} + +func _Merge_MergeChanges_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MergeChangesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MergeServer).MergeChanges(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.documents.v2alpha.Merge/MergeChanges", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MergeServer).MergeChanges(ctx, req.(*MergeChangesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Merge_RebaseChanges_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RebaseChangesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MergeServer).RebaseChanges(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.seed.documents.v2alpha.Merge/RebaseChanges", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MergeServer).RebaseChanges(ctx, req.(*RebaseChangesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Merge_ServiceDesc is the grpc.ServiceDesc for Merge service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Merge_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "com.seed.documents.v2alpha.Merge", + HandlerType: (*MergeServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "MergeChanges", + Handler: _Merge_MergeChanges_Handler, + }, + { + MethodName: "RebaseChanges", + Handler: _Merge_RebaseChanges_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "documents/v2alpha/documents.proto", +} diff --git a/frontend/packages/shared/src/client/.generated/accounts/v1alpha/accounts_connect.ts b/frontend/packages/shared/src/client/.generated/accounts/v1alpha/accounts_connect.ts index 213bd0eea..b59d33e8c 100644 --- a/frontend/packages/shared/src/client/.generated/accounts/v1alpha/accounts_connect.ts +++ b/frontend/packages/shared/src/client/.generated/accounts/v1alpha/accounts_connect.ts @@ -3,7 +3,7 @@ /* eslint-disable */ // @ts-nocheck -import { Account, GetAccountRequest, ListAccountsRequest, ListAccountsResponse } from "./accounts_pb"; +import { Account, GetAccountRequest, ListAccountsRequest, ListAccountsResponse, Profile, SetAccountTrustRequest } from "./accounts_pb"; import { MethodKind } from "@bufbuild/protobuf"; /** @@ -27,7 +27,22 @@ export const Accounts = { kind: MethodKind.Unary, }, /** - * List accounts known to the backend. New accounts can be discovered naturally by + * Updates profile information of our own Account. + * Doesn't support partial updates! + * Users should call GetAccount first, + * change the necessary fields in place, + * and then send the same Profile object back to UpdateProfile. + * + * @generated from rpc com.seed.accounts.v1alpha.Accounts.UpdateProfile + */ + updateProfile: { + name: "UpdateProfile", + I: Profile, + O: Account, + kind: MethodKind.Unary, + }, + /** + * List accounts known to the backend (excluding our own account). New accounts can be discovered naturally by * interacting with the network, or users can ask to discover specific accounts using * the Networking API. * @@ -39,6 +54,18 @@ export const Accounts = { O: ListAccountsResponse, kind: MethodKind.Unary, }, + /** + * Set or unset the trustness of an account. An account is untrusted by default except for our own. + * Returns the modified account. + * + * @generated from rpc com.seed.accounts.v1alpha.Accounts.SetAccountTrust + */ + setAccountTrust: { + name: "SetAccountTrust", + I: SetAccountTrustRequest, + O: Account, + kind: MethodKind.Unary, + }, } } as const; diff --git a/frontend/packages/shared/src/client/.generated/accounts/v1alpha/accounts_pb.ts b/frontend/packages/shared/src/client/.generated/accounts/v1alpha/accounts_pb.ts index baa0e09af..0388131e9 100644 --- a/frontend/packages/shared/src/client/.generated/accounts/v1alpha/accounts_pb.ts +++ b/frontend/packages/shared/src/client/.generated/accounts/v1alpha/accounts_pb.ts @@ -136,18 +136,32 @@ export class ListAccountsResponse extends Message { */ export class Account extends Message { /** - * Hypermedia Account ID. + * Hyper Media Account ID. * * @generated from field: string id = 1; */ id = ""; /** - * If there is an unpublished draft for this account's profile document + * Profile information of this account. * - * @generated from field: bool has_profile_draft = 5; + * @generated from field: com.seed.accounts.v1alpha.Profile profile = 2; */ - hasProfileDraft = false; + profile?: Profile; + + /** + * List of known devices of this Account. + * + * @generated from field: map devices = 3; + */ + devices: { [key: string]: Device } = {}; + + /** + * Defining if the account is trusted or not. + * + * @generated from field: bool is_trusted = 4; + */ + isTrusted = false; constructor(data?: PartialMessage) { super(); @@ -158,7 +172,9 @@ export class Account extends Message { static readonly typeName = "com.seed.accounts.v1alpha.Account"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 5, name: "has_profile_draft", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 2, name: "profile", kind: "message", T: Profile }, + { no: 3, name: "devices", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: Device} }, + { no: 4, name: "is_trusted", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): Account { @@ -178,3 +194,155 @@ export class Account extends Message { } } +/** + * Profile information of the user Account. + * + * @generated from message com.seed.accounts.v1alpha.Profile + */ +export class Profile extends Message { + /** + * Optional. Alias is a user-defined handle for their profile. + * There's no enforcement on this being unique. + * + * @generated from field: string alias = 1; + */ + alias = ""; + + /** + * Optional. Description of the user's profile. + * + * @generated from field: string bio = 2; + */ + bio = ""; + + /** + * Optional. CID to the avatar image hosted on IPFS. + * + * @generated from field: string avatar = 3; + */ + avatar = ""; + + /** + * Optional. Hypermedia ID of the Account's root/entrypoint document. + * + * @generated from field: string root_document = 4; + */ + rootDocument = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.accounts.v1alpha.Profile"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "alias", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "bio", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "avatar", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "root_document", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Profile { + return new Profile().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Profile { + return new Profile().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Profile { + return new Profile().fromJsonString(jsonString, options); + } + + static equals(a: Profile | PlainMessage | undefined, b: Profile | PlainMessage | undefined): boolean { + return proto3.util.equals(Profile, a, b); + } +} + +/** + * @generated from message com.seed.accounts.v1alpha.Device + */ +export class Device extends Message { + /** + * CID-encoded Peer ID of this device. + * + * @generated from field: string device_id = 1; + */ + deviceId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.accounts.v1alpha.Device"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "device_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Device { + return new Device().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Device { + return new Device().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Device { + return new Device().fromJsonString(jsonString, options); + } + + static equals(a: Device | PlainMessage | undefined, b: Device | PlainMessage | undefined): boolean { + return proto3.util.equals(Device, a, b); + } +} + +/** + * @generated from message com.seed.accounts.v1alpha.SetAccountTrustRequest + */ +export class SetAccountTrustRequest extends Message { + /** + * ID of the Account to trust/untrust. + * + * @generated from field: string id = 1; + */ + id = ""; + + /** + * Whether to trust or not the account. + * + * @generated from field: bool is_trusted = 2; + */ + isTrusted = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.accounts.v1alpha.SetAccountTrustRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "is_trusted", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SetAccountTrustRequest { + return new SetAccountTrustRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SetAccountTrustRequest { + return new SetAccountTrustRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SetAccountTrustRequest { + return new SetAccountTrustRequest().fromJsonString(jsonString, options); + } + + static equals(a: SetAccountTrustRequest | PlainMessage | undefined, b: SetAccountTrustRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(SetAccountTrustRequest, a, b); + } +} + diff --git a/frontend/packages/shared/src/client/.generated/accounts/v2alpha/accounts_connect.ts b/frontend/packages/shared/src/client/.generated/accounts/v2alpha/accounts_connect.ts new file mode 100644 index 000000000..8b577a4bd --- /dev/null +++ b/frontend/packages/shared/src/client/.generated/accounts/v2alpha/accounts_connect.ts @@ -0,0 +1,44 @@ +// @generated by protoc-gen-connect-es v1.1.3 with parameter "target=ts,import_extension=none" +// @generated from file accounts/v2alpha/accounts.proto (package com.seed.accounts.v2alpha, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { Account, GetAccountRequest, ListAccountsRequest, ListAccountsResponse } from "./accounts_pb"; +import { MethodKind } from "@bufbuild/protobuf"; + +/** + * Accounts API service. + * + * @generated from service com.seed.accounts.v2alpha.Accounts + */ +export const Accounts = { + typeName: "com.seed.accounts.v2alpha.Accounts", + methods: { + /** + * Lookup an Account information across the already known accounts. + * Can also be used to retrieve our own account. + * + * @generated from rpc com.seed.accounts.v2alpha.Accounts.GetAccount + */ + getAccount: { + name: "GetAccount", + I: GetAccountRequest, + O: Account, + kind: MethodKind.Unary, + }, + /** + * List accounts known to the backend. New accounts can be discovered naturally by + * interacting with the network, or users can ask to discover specific accounts using + * the Networking API. + * + * @generated from rpc com.seed.accounts.v2alpha.Accounts.ListAccounts + */ + listAccounts: { + name: "ListAccounts", + I: ListAccountsRequest, + O: ListAccountsResponse, + kind: MethodKind.Unary, + }, + } +} as const; + diff --git a/frontend/packages/shared/src/client/.generated/accounts/v2alpha/accounts_pb.ts b/frontend/packages/shared/src/client/.generated/accounts/v2alpha/accounts_pb.ts new file mode 100644 index 000000000..a6fb4b1f0 --- /dev/null +++ b/frontend/packages/shared/src/client/.generated/accounts/v2alpha/accounts_pb.ts @@ -0,0 +1,180 @@ +// @generated by protoc-gen-es v1.4.1 with parameter "target=ts,import_extension=none" +// @generated from file accounts/v2alpha/accounts.proto (package com.seed.accounts.v2alpha, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from message com.seed.accounts.v2alpha.GetAccountRequest + */ +export class GetAccountRequest extends Message { + /** + * ID of the Account to be looked up. If empty - our own account will be returned. + * + * @generated from field: string id = 1; + */ + id = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.accounts.v2alpha.GetAccountRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetAccountRequest { + return new GetAccountRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetAccountRequest { + return new GetAccountRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetAccountRequest { + return new GetAccountRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetAccountRequest | PlainMessage | undefined, b: GetAccountRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetAccountRequest, a, b); + } +} + +/** + * @generated from message com.seed.accounts.v2alpha.ListAccountsRequest + */ +export class ListAccountsRequest extends Message { + /** + * @generated from field: int32 page_size = 1; + */ + pageSize = 0; + + /** + * @generated from field: string page_token = 2; + */ + pageToken = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.accounts.v2alpha.ListAccountsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "page_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListAccountsRequest { + return new ListAccountsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListAccountsRequest { + return new ListAccountsRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListAccountsRequest { + return new ListAccountsRequest().fromJsonString(jsonString, options); + } + + static equals(a: ListAccountsRequest | PlainMessage | undefined, b: ListAccountsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ListAccountsRequest, a, b); + } +} + +/** + * @generated from message com.seed.accounts.v2alpha.ListAccountsResponse + */ +export class ListAccountsResponse extends Message { + /** + * @generated from field: repeated com.seed.accounts.v2alpha.Account accounts = 1; + */ + accounts: Account[] = []; + + /** + * @generated from field: string next_page_token = 2; + */ + nextPageToken = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.accounts.v2alpha.ListAccountsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "accounts", kind: "message", T: Account, repeated: true }, + { no: 2, name: "next_page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListAccountsResponse { + return new ListAccountsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListAccountsResponse { + return new ListAccountsResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListAccountsResponse { + return new ListAccountsResponse().fromJsonString(jsonString, options); + } + + static equals(a: ListAccountsResponse | PlainMessage | undefined, b: ListAccountsResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ListAccountsResponse, a, b); + } +} + +/** + * @generated from message com.seed.accounts.v2alpha.Account + */ +export class Account extends Message { + /** + * Hypermedia Account ID. + * + * @generated from field: string id = 1; + */ + id = ""; + + /** + * If there is an unpublished draft for this account's profile document + * + * @generated from field: bool has_profile_draft = 5; + */ + hasProfileDraft = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.accounts.v2alpha.Account"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "has_profile_draft", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Account { + return new Account().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Account { + return new Account().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Account { + return new Account().fromJsonString(jsonString, options); + } + + static equals(a: Account | PlainMessage | undefined, b: Account | PlainMessage | undefined): boolean { + return proto3.util.equals(Account, a, b); + } +} + diff --git a/frontend/packages/shared/src/client/.generated/documents/v1alpha/documents_connect.ts b/frontend/packages/shared/src/client/.generated/documents/v1alpha/documents_connect.ts index f15c10ce2..aef7e6401 100644 --- a/frontend/packages/shared/src/client/.generated/documents/v1alpha/documents_connect.ts +++ b/frontend/packages/shared/src/client/.generated/documents/v1alpha/documents_connect.ts @@ -3,7 +3,7 @@ /* eslint-disable */ // @ts-nocheck -import { Branch, ChangeDocumentRequest, ChangeProfileDocumentRequest, CreateBranchDraftRequest, CreateDraftRequest, CreateIndexDraftRequest, CreateProfileDraftRequest, DeleteDraftRequest, Document, Draft, GetDocumentIndexRequest, GetDocumentIndexResponse, GetDocumentRequest, GetDraftRequest, GetProfileDocumentRequest, GetProfileDraftRequest, ListAccountDocumentsRequest, ListDocumentBranchesRequest, ListDocumentBranchesResponse, ListDocumentDraftsRequest, ListDocumentDraftsResponse, ListDocumentsRequest, ListDocumentsResponse, ListDraftsRequest, ListDraftsResponse, MergeChangesRequest, PublishDraftRequest, PushDocumentRequest, RebaseChangesRequest, UpdateDraftRequest, UpdateDraftResponse } from "./documents_pb"; +import { CreateDraftRequest, DeleteDraftRequest, Document, GetDraftRequest, GetPublicationRequest, ListAccountPublicationsRequest, ListDocumentDraftsRequest, ListDocumentDraftsResponse, ListDraftsRequest, ListDraftsResponse, ListPublicationsRequest, ListPublicationsResponse, MergeChangesRequest, Publication, PublishDraftRequest, PushPublicationRequest, RebaseChangesRequest, UpdateDraftRequest, UpdateDraftResponse } from "./documents_pb"; import { Empty, MethodKind } from "@bufbuild/protobuf"; /** @@ -15,47 +15,14 @@ export const Drafts = { typeName: "com.seed.documents.v1alpha.Drafts", methods: { /** - * Creates a new draft of an existing standalone branch + * Creates a new draft with a new permanent document ID. * * @generated from rpc com.seed.documents.v1alpha.Drafts.CreateDraft */ createDraft: { name: "CreateDraft", I: CreateDraftRequest, - O: Draft, - kind: MethodKind.Unary, - }, - /** - * Creates a draft for a new branch. - * - * @generated from rpc com.seed.documents.v1alpha.Drafts.CreateBranchDraft - */ - createBranchDraft: { - name: "CreateBranchDraft", - I: CreateBranchDraftRequest, - O: Draft, - kind: MethodKind.Unary, - }, - /** - * Creates a draft for an index branch. Thows if a draft already exists for this index. - * - * @generated from rpc com.seed.documents.v1alpha.Drafts.CreateIndexDraft - */ - createIndexDraft: { - name: "CreateIndexDraft", - I: CreateIndexDraftRequest, - O: Draft, - kind: MethodKind.Unary, - }, - /** - * Create a draft for a profile document. Thows if a draft already exists for this profile. - * - * @generated from rpc com.seed.documents.v1alpha.Drafts.CreateProfileDraft - */ - createProfileDraft: { - name: "CreateProfileDraft", - I: CreateProfileDraftRequest, - O: Draft, + O: Document, kind: MethodKind.Unary, }, /** @@ -77,18 +44,7 @@ export const Drafts = { getDraft: { name: "GetDraft", I: GetDraftRequest, - O: Draft, - kind: MethodKind.Unary, - }, - /** - * Gets a draft for a profile document. - * - * @generated from rpc com.seed.documents.v1alpha.Drafts.GetProfileDraft - */ - getProfileDraft: { - name: "GetProfileDraft", - I: GetProfileDraftRequest, - O: Draft, + O: Document, kind: MethodKind.Unary, }, /** @@ -125,124 +81,69 @@ export const Drafts = { kind: MethodKind.Unary, }, /** - * Publishes a draft. Returns the branch that was published. + * Publishes a draft. I.e. draft will become a publication, and will no longer appear in drafts section. * * @generated from rpc com.seed.documents.v1alpha.Drafts.PublishDraft */ publishDraft: { name: "PublishDraft", I: PublishDraftRequest, - O: Branch, + O: Publication, kind: MethodKind.Unary, }, } } as const; /** - * Documents service provides access to documents. + * Publications service provides access to published documents. * - * @generated from service com.seed.documents.v1alpha.Documents + * @generated from service com.seed.documents.v1alpha.Publications */ -export const Documents = { - typeName: "com.seed.documents.v1alpha.Documents", +export const Publications = { + typeName: "com.seed.documents.v1alpha.Publications", methods: { /** - * Gets a single document. - * - * @generated from rpc com.seed.documents.v1alpha.Documents.GetDocument - */ - getDocument: { - name: "GetDocument", - I: GetDocumentRequest, - O: Document, - kind: MethodKind.Unary, - }, - /** - * Gets an account's profile document. - * - * @generated from rpc com.seed.documents.v1alpha.Documents.GetProfileDocument - */ - getProfileDocument: { - name: "GetProfileDocument", - I: GetProfileDocumentRequest, - O: Document, - kind: MethodKind.Unary, - }, - /** - * Gets a document within the index(es) of other documents - * - * @generated from rpc com.seed.documents.v1alpha.Documents.GetDocumentIndex - */ - getDocumentIndex: { - name: "GetDocumentIndex", - I: GetDocumentIndexRequest, - O: GetDocumentIndexResponse, - kind: MethodKind.Unary, - }, - /** - * Immediately changes a document + * Gets a single publication. * - * @generated from rpc com.seed.documents.v1alpha.Documents.ChangeDocument + * @generated from rpc com.seed.documents.v1alpha.Publications.GetPublication */ - changeDocument: { - name: "ChangeDocument", - I: ChangeDocumentRequest, - O: Document, - kind: MethodKind.Unary, - }, - /** - * Immediately changes an account's profile document - * - * @generated from rpc com.seed.documents.v1alpha.Documents.ChangeProfileDocument - */ - changeProfileDocument: { - name: "ChangeProfileDocument", - I: ChangeProfileDocumentRequest, - O: Document, + getPublication: { + name: "GetPublication", + I: GetPublicationRequest, + O: Publication, kind: MethodKind.Unary, }, /** - * Lists all documents. Only the most recent versions show up. + * Lists stored publications. Only the most recent versions show up. * - * @generated from rpc com.seed.documents.v1alpha.Documents.ListDocuments + * @generated from rpc com.seed.documents.v1alpha.Publications.ListPublications */ - listDocuments: { - name: "ListDocuments", - I: ListDocumentsRequest, - O: ListDocumentsResponse, + listPublications: { + name: "ListPublications", + I: ListPublicationsRequest, + O: ListPublicationsResponse, kind: MethodKind.Unary, }, /** - * Lists branches of a document. Includes standalone and index branches, and any drafts for these branches + * Push Local publication to the gateway. * - * @generated from rpc com.seed.documents.v1alpha.Documents.ListDocumentBranches + * @generated from rpc com.seed.documents.v1alpha.Publications.PushPublication */ - listDocumentBranches: { - name: "ListDocumentBranches", - I: ListDocumentBranchesRequest, - O: ListDocumentBranchesResponse, - kind: MethodKind.Unary, - }, - /** - * Push Local document to the gateway. - * - * @generated from rpc com.seed.documents.v1alpha.Documents.PushDocument - */ - pushDocument: { - name: "PushDocument", - I: PushDocumentRequest, + pushPublication: { + name: "PushPublication", + I: PushPublicationRequest, O: Empty, kind: MethodKind.Unary, }, /** - * Lists documents owned by a given account. + * Lists publications owned by a given account. * - * @generated from rpc com.seed.documents.v1alpha.Documents.ListAccountDocuments + * @generated from rpc com.seed.documents.v1alpha.Publications.ListAccountPublications */ - listAccountDocuments: { - name: "ListAccountDocuments", - I: ListAccountDocumentsRequest, - O: ListDocumentsResponse, + listAccountPublications: { + name: "ListAccountPublications", + I: ListAccountPublicationsRequest, + O: ListPublicationsResponse, kind: MethodKind.Unary, }, } @@ -264,7 +165,7 @@ export const Merge = { mergeChanges: { name: "MergeChanges", I: MergeChangesRequest, - O: Document, + O: Publication, kind: MethodKind.Unary, }, /** diff --git a/frontend/packages/shared/src/client/.generated/documents/v1alpha/documents_pb.ts b/frontend/packages/shared/src/client/.generated/documents/v1alpha/documents_pb.ts index ab2c26a4a..f27e688ef 100644 --- a/frontend/packages/shared/src/client/.generated/documents/v1alpha/documents_pb.ts +++ b/frontend/packages/shared/src/client/.generated/documents/v1alpha/documents_pb.ts @@ -7,67 +7,27 @@ import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialM import { Message, proto3, Timestamp } from "@bufbuild/protobuf"; /** - * Relationship between a document and an account + * Request to create a new draft. * - * @generated from enum com.seed.documents.v1alpha.RoleType + * @generated from message com.seed.documents.v1alpha.CreateDraftRequest */ -export enum RoleType { - /** - * No permissions. - * - * @generated from enum value: ROLE_UNSPECIFIED = 0; - */ - ROLE_UNSPECIFIED = 0, - - /** - * The role for an owner. All permissions are granted. - * - * @generated from enum value: OWNER = 1; - */ - OWNER = 1, - - /** - * Allowed to invite/remove writers+collaborators, edit content, and merge suggested changes - * - * @generated from enum value: EDITOR = 2; - */ - EDITOR = 2, - - /** - * Allowed to change content - * - * @generated from enum value: WRITER = 3; - */ - WRITER = 3, - +export class CreateDraftRequest extends Message { /** - * Their comments and suggested changes will be distributed alongside the document + * Optional. Existing Document ID can be specified to update + * previously published document. A draft will be created + * with the content of the most recent known version. * - * @generated from enum value: COLLABORATOR = 4; + * @generated from field: string existing_document_id = 1; */ - COLLABORATOR = 4, -} -// Retrieve enum metadata with: proto3.getEnumType(RoleType) -proto3.util.setEnumType(RoleType, "com.seed.documents.v1alpha.RoleType", [ - { no: 0, name: "ROLE_UNSPECIFIED" }, - { no: 1, name: "OWNER" }, - { no: 2, name: "EDITOR" }, - { no: 3, name: "WRITER" }, - { no: 4, name: "COLLABORATOR" }, -]); + existingDocumentId = ""; -/** - * Request to create a new draft for an existing standalone branch - * - * @generated from message com.seed.documents.v1alpha.CreateDraftRequest - */ -export class CreateDraftRequest extends Message { /** - * Required. ID of the document branch that will be updated. + * Optional. Version of the existing document to create draft from. + * If version is specified existing_document_id must also be specified. * - * @generated from field: string document_id = 1; + * @generated from field: string version = 2; */ - documentId = ""; + version = ""; constructor(data?: PartialMessage) { super(); @@ -77,7 +37,8 @@ export class CreateDraftRequest extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "com.seed.documents.v1alpha.CreateDraftRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 1, name: "existing_document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): CreateDraftRequest { @@ -97,148 +58,6 @@ export class CreateDraftRequest extends Message { } } -/** - * Request to create a draft for a new standalone branch, optionally based on an existing document. - * - * @generated from message com.seed.documents.v1alpha.CreateBranchDraftRequest - */ -export class CreateBranchDraftRequest extends Message { - /** - * Optional. Document which will be branched from. If not specified, a new document will be created. - * - * @generated from field: string document_id = 1; - */ - documentId = ""; - - /** - * Optional. Version of the existing document to create draft from. - * If version is specified, document_id must also be specified. - * - * @generated from field: string version = 2; - */ - version = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "com.seed.documents.v1alpha.CreateBranchDraftRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): CreateBranchDraftRequest { - return new CreateBranchDraftRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): CreateBranchDraftRequest { - return new CreateBranchDraftRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): CreateBranchDraftRequest { - return new CreateBranchDraftRequest().fromJsonString(jsonString, options); - } - - static equals(a: CreateBranchDraftRequest | PlainMessage | undefined, b: CreateBranchDraftRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(CreateBranchDraftRequest, a, b); - } -} - -/** - * Request to create a new branch which will be saved to the index of another document. - * If this path already exists in the parent, the index will be updated when the draft is published. - * If this path does not exist in the parent, the index will be created when the draft is published. - * - * @generated from message com.seed.documents.v1alpha.CreateIndexDraftRequest - */ -export class CreateIndexDraftRequest extends Message { - /** - * Required. ID of the parent document. - * - * @generated from field: string document_id = 1; - */ - documentId = ""; - - /** - * Required. Path of the document to create a draft for. May include slashes to represent a deep index. - * - * @generated from field: string path = 2; - */ - path = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "com.seed.documents.v1alpha.CreateIndexDraftRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "path", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): CreateIndexDraftRequest { - return new CreateIndexDraftRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): CreateIndexDraftRequest { - return new CreateIndexDraftRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): CreateIndexDraftRequest { - return new CreateIndexDraftRequest().fromJsonString(jsonString, options); - } - - static equals(a: CreateIndexDraftRequest | PlainMessage | undefined, b: CreateIndexDraftRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(CreateIndexDraftRequest, a, b); - } -} - -/** - * Request to create a draft for a profile document. - * - * @generated from message com.seed.documents.v1alpha.CreateProfileDraftRequest - */ -export class CreateProfileDraftRequest extends Message { - /** - * Required. Account ID to create a profile draft for. - * - * @generated from field: string account_id = 1; - */ - accountId = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "com.seed.documents.v1alpha.CreateProfileDraftRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "account_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): CreateProfileDraftRequest { - return new CreateProfileDraftRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): CreateProfileDraftRequest { - return new CreateProfileDraftRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): CreateProfileDraftRequest { - return new CreateProfileDraftRequest().fromJsonString(jsonString, options); - } - - static equals(a: CreateProfileDraftRequest | PlainMessage | undefined, b: CreateProfileDraftRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(CreateProfileDraftRequest, a, b); - } -} - /** * Request to delete an existing draft. * @@ -246,11 +65,11 @@ export class CreateProfileDraftRequest extends Message { /** - * Required. ID of the branch to delete. + * ID of the document whose draft needs to be deleted. Only one * - * @generated from field: string branch_id = 1; + * @generated from field: string document_id = 1; */ - branchId = ""; + documentId = ""; constructor(data?: PartialMessage) { super(); @@ -260,7 +79,7 @@ export class DeleteDraftRequest extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "com.seed.documents.v1alpha.DeleteDraftRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "branch_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 1, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): DeleteDraftRequest { @@ -287,11 +106,11 @@ export class DeleteDraftRequest extends Message { */ export class GetDraftRequest extends Message { /** - * Required. ID of the draft that was previously created. + * ID of the document for which draft was previously created. * - * @generated from field: string draft_id = 1; + * @generated from field: string document_id = 1; */ - draftId = ""; + documentId = ""; constructor(data?: PartialMessage) { super(); @@ -301,7 +120,7 @@ export class GetDraftRequest extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "com.seed.documents.v1alpha.GetDraftRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "draft_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 1, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): GetDraftRequest { @@ -321,47 +140,6 @@ export class GetDraftRequest extends Message { } } -/** - * Request the draft for an account's profile document - * - * @generated from message com.seed.documents.v1alpha.GetProfileDraftRequest - */ -export class GetProfileDraftRequest extends Message { - /** - * Required. Account ID to get the profile draft for. - * - * @generated from field: string account_id = 1; - */ - accountId = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "com.seed.documents.v1alpha.GetProfileDraftRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "account_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): GetProfileDraftRequest { - return new GetProfileDraftRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): GetProfileDraftRequest { - return new GetProfileDraftRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): GetProfileDraftRequest { - return new GetProfileDraftRequest().fromJsonString(jsonString, options); - } - - static equals(a: GetProfileDraftRequest | PlainMessage | undefined, b: GetProfileDraftRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(GetProfileDraftRequest, a, b); - } -} - /** * Request to update an existing draft using granular operations. * @@ -471,20 +249,12 @@ export class DocumentChange extends Message { */ op: { /** - * New metadata to set on the document. - * - * @generated from field: com.seed.documents.v1alpha.DocumentChange.SetMetadata set_metadata = 1; - */ - value: DocumentChange_SetMetadata; - case: "setMetadata"; - } | { - /** - * New index to set on the document. + * New title to set on the document. * - * @generated from field: com.seed.documents.v1alpha.DocumentChange.SetIndex set_index = 2; + * @generated from field: string set_title = 1; */ - value: DocumentChange_SetIndex; - case: "setIndex"; + value: string; + case: "setTitle"; } | { /** * Move operation that creates/moves a block within the document hierarchy. @@ -509,14 +279,6 @@ export class DocumentChange extends Message { */ value: string; case: "deleteBlock"; - } | { - /** - * Update membership for an account on this document. - * - * @generated from field: com.seed.documents.v1alpha.DocumentChange.UpdateMember update_member = 6; - */ - value: DocumentChange_UpdateMember; - case: "updateMember"; } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { @@ -527,12 +289,10 @@ export class DocumentChange extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "com.seed.documents.v1alpha.DocumentChange"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "set_metadata", kind: "message", T: DocumentChange_SetMetadata, oneof: "op" }, - { no: 2, name: "set_index", kind: "message", T: DocumentChange_SetIndex, oneof: "op" }, + { no: 1, name: "set_title", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "op" }, { no: 3, name: "move_block", kind: "message", T: DocumentChange_MoveBlock, oneof: "op" }, { no: 4, name: "replace_block", kind: "message", T: Block, oneof: "op" }, { no: 5, name: "delete_block", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "op" }, - { no: 6, name: "update_member", kind: "message", T: DocumentChange_UpdateMember, oneof: "op" }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): DocumentChange { @@ -611,166 +371,6 @@ export class DocumentChange_MoveBlock extends Message } } -/** - * Operation to replace a metadata field with a new value - * - * @generated from message com.seed.documents.v1alpha.DocumentChange.SetMetadata - */ -export class DocumentChange_SetMetadata extends Message { - /** - * Metadata key to set. - * - * @generated from field: string key = 1; - */ - key = ""; - - /** - * Metadata value to set. - * - * "ipfs://ABC" - Use CID as reference material - * "hm://DOC_ID" - Document ID as reference material - * other random data - * "https://example.com" - * DATE FORMAT - * - * @generated from field: string value = 2; - */ - value = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "com.seed.documents.v1alpha.DocumentChange.SetMetadata"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "value", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): DocumentChange_SetMetadata { - return new DocumentChange_SetMetadata().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): DocumentChange_SetMetadata { - return new DocumentChange_SetMetadata().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): DocumentChange_SetMetadata { - return new DocumentChange_SetMetadata().fromJsonString(jsonString, options); - } - - static equals(a: DocumentChange_SetMetadata | PlainMessage | undefined, b: DocumentChange_SetMetadata | PlainMessage | undefined): boolean { - return proto3.util.equals(DocumentChange_SetMetadata, a, b); - } -} - -/** - * Operation to replace an index field with a new value - * - * @generated from message com.seed.documents.v1alpha.DocumentChange.SetIndex - */ -export class DocumentChange_SetIndex extends Message { - /** - * Index key to set. - * - * @generated from field: string key = 1; - */ - key = ""; - - /** - * Index value to set. - * - * example values - * "DOC_ID" - * "@CHANGE_ID" - * "@CHANGE_ID.CHANGE_ID2" - * "#FRAGMENT" - * "a/ACCOUNT_ID" - * - * @generated from field: string value = 2; - */ - value = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "com.seed.documents.v1alpha.DocumentChange.SetIndex"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "value", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): DocumentChange_SetIndex { - return new DocumentChange_SetIndex().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): DocumentChange_SetIndex { - return new DocumentChange_SetIndex().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): DocumentChange_SetIndex { - return new DocumentChange_SetIndex().fromJsonString(jsonString, options); - } - - static equals(a: DocumentChange_SetIndex | PlainMessage | undefined, b: DocumentChange_SetIndex | PlainMessage | undefined): boolean { - return proto3.util.equals(DocumentChange_SetIndex, a, b); - } -} - -/** - * Operation to change membership - * - * @generated from message com.seed.documents.v1alpha.DocumentChange.UpdateMember - */ -export class DocumentChange_UpdateMember extends Message { - /** - * Account ID to update the role for. - * - * @generated from field: string account_id = 1; - */ - accountId = ""; - - /** - * New role to set for the account. - * - * @generated from field: com.seed.documents.v1alpha.RoleType role = 2; - */ - role = RoleType.ROLE_UNSPECIFIED; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "com.seed.documents.v1alpha.DocumentChange.UpdateMember"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "account_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "role", kind: "enum", T: proto3.getEnumType(RoleType) }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): DocumentChange_UpdateMember { - return new DocumentChange_UpdateMember().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): DocumentChange_UpdateMember { - return new DocumentChange_UpdateMember().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): DocumentChange_UpdateMember { - return new DocumentChange_UpdateMember().fromJsonString(jsonString, options); - } - - static equals(a: DocumentChange_UpdateMember | PlainMessage | undefined, b: DocumentChange_UpdateMember | PlainMessage | undefined): boolean { - return proto3.util.equals(DocumentChange_UpdateMember, a, b); - } -} - /** * Request to list stored drafts. * @@ -960,11 +560,11 @@ export class ListDocumentDraftsResponse extends Message { /** - * ID of the draft to be published. + * ID of the document which current draft needs to be published. * - * @generated from field: string draft_id = 1; + * @generated from field: string document_id = 1; */ - draftId = ""; + documentId = ""; constructor(data?: PartialMessage) { super(); @@ -974,7 +574,7 @@ export class PublishDraftRequest extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "com.seed.documents.v1alpha.PublishDraftRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "draft_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 1, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): PublishDraftRequest { @@ -995,11 +595,11 @@ export class PublishDraftRequest extends Message { } /** - * Request for getting a single document. + * Request for getting a single publication. * - * @generated from message com.seed.documents.v1alpha.GetDocumentRequest + * @generated from message com.seed.documents.v1alpha.GetPublicationRequest */ -export class GetDocumentRequest extends Message { +export class GetPublicationRequest extends Message { /** * Required. ID of the published document. * @@ -1014,296 +614,50 @@ export class GetDocumentRequest extends Message { */ version = ""; - constructor(data?: PartialMessage) { + /** + * Optional. If true, only local publications will be found. False by default. + * Deprecated: use [Entities.DiscoverEntity] API explicitly instead. + * + * @generated from field: bool local_only = 3; + */ + localOnly = false; + + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "com.seed.documents.v1alpha.GetDocumentRequest"; + static readonly typeName = "com.seed.documents.v1alpha.GetPublicationRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "local_only", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): GetDocumentRequest { - return new GetDocumentRequest().fromBinary(bytes, options); + static fromBinary(bytes: Uint8Array, options?: Partial): GetPublicationRequest { + return new GetPublicationRequest().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): GetDocumentRequest { - return new GetDocumentRequest().fromJson(jsonValue, options); + static fromJson(jsonValue: JsonValue, options?: Partial): GetPublicationRequest { + return new GetPublicationRequest().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): GetDocumentRequest { - return new GetDocumentRequest().fromJsonString(jsonString, options); + static fromJsonString(jsonString: string, options?: Partial): GetPublicationRequest { + return new GetPublicationRequest().fromJsonString(jsonString, options); } - static equals(a: GetDocumentRequest | PlainMessage | undefined, b: GetDocumentRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(GetDocumentRequest, a, b); + static equals(a: GetPublicationRequest | PlainMessage | undefined, b: GetPublicationRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetPublicationRequest, a, b); } } /** - * Request for getting an account's profile document. + * Request for getting a single publication. * - * @generated from message com.seed.documents.v1alpha.GetProfileDocumentRequest + * @generated from message com.seed.documents.v1alpha.PushPublicationRequest */ -export class GetProfileDocumentRequest extends Message { - /** - * Required. ID of the account. - * - * @generated from field: string account_id = 1; - */ - accountId = ""; - - /** - * Optional. Specific version of the profile. If empty, the latest one is returned. - * - * @generated from field: string version = 2; - */ - version = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "com.seed.documents.v1alpha.GetProfileDocumentRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "account_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): GetProfileDocumentRequest { - return new GetProfileDocumentRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): GetProfileDocumentRequest { - return new GetProfileDocumentRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): GetProfileDocumentRequest { - return new GetProfileDocumentRequest().fromJsonString(jsonString, options); - } - - static equals(a: GetProfileDocumentRequest | PlainMessage | undefined, b: GetProfileDocumentRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(GetProfileDocumentRequest, a, b); - } -} - -/** - * Used to request the document within the indexes of other documents - * - * @generated from message com.seed.documents.v1alpha.GetDocumentIndexRequest - */ -export class GetDocumentIndexRequest extends Message { - /** - * the parent document ID - * - * @generated from field: string document_id = 1; - */ - documentId = ""; - - /** - * the path of the document which will be retrieved. may include slashes to represent a deep index - * - * @generated from field: string path = 2; - */ - path = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "com.seed.documents.v1alpha.GetDocumentIndexRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "path", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): GetDocumentIndexRequest { - return new GetDocumentIndexRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): GetDocumentIndexRequest { - return new GetDocumentIndexRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): GetDocumentIndexRequest { - return new GetDocumentIndexRequest().fromJsonString(jsonString, options); - } - - static equals(a: GetDocumentIndexRequest | PlainMessage | undefined, b: GetDocumentIndexRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(GetDocumentIndexRequest, a, b); - } -} - -/** - * @generated from message com.seed.documents.v1alpha.GetDocumentIndexResponse - */ -export class GetDocumentIndexResponse extends Message { - /** - * id of the parent document - * - * @generated from field: string document_id = 1; - */ - documentId = ""; - - /** - * version of the parent document - * - * @generated from field: string version = 2; - */ - version = ""; - - /** - * path of the child document. may include slashes to represent a deep index - * - * @generated from field: string path = 3; - */ - path = ""; - - /** - * the document at the given path - * - * @generated from field: com.seed.documents.v1alpha.Document document = 4; - */ - document?: Document; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "com.seed.documents.v1alpha.GetDocumentIndexResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "path", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 4, name: "document", kind: "message", T: Document }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): GetDocumentIndexResponse { - return new GetDocumentIndexResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): GetDocumentIndexResponse { - return new GetDocumentIndexResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): GetDocumentIndexResponse { - return new GetDocumentIndexResponse().fromJsonString(jsonString, options); - } - - static equals(a: GetDocumentIndexResponse | PlainMessage | undefined, b: GetDocumentIndexResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(GetDocumentIndexResponse, a, b); - } -} - -/** - * @generated from message com.seed.documents.v1alpha.ChangeDocumentRequest - */ -export class ChangeDocumentRequest extends Message { - /** - * Required. ID of the document to be updated. - * - * @generated from field: string document_id = 1; - */ - documentId = ""; - - /** - * Required. Changes to be applied to the document. - * - * @generated from field: repeated com.seed.documents.v1alpha.DocumentChange changes = 2; - */ - changes: DocumentChange[] = []; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "com.seed.documents.v1alpha.ChangeDocumentRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "changes", kind: "message", T: DocumentChange, repeated: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ChangeDocumentRequest { - return new ChangeDocumentRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ChangeDocumentRequest { - return new ChangeDocumentRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ChangeDocumentRequest { - return new ChangeDocumentRequest().fromJsonString(jsonString, options); - } - - static equals(a: ChangeDocumentRequest | PlainMessage | undefined, b: ChangeDocumentRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(ChangeDocumentRequest, a, b); - } -} - -/** - * @generated from message com.seed.documents.v1alpha.ChangeProfileDocumentRequest - */ -export class ChangeProfileDocumentRequest extends Message { - /** - * Required. Account ID to update the profile document for. - * - * @generated from field: string account_id = 1; - */ - accountId = ""; - - /** - * Required. Changes to be applied to the profile document. - * - * @generated from field: repeated com.seed.documents.v1alpha.DocumentChange changes = 2; - */ - changes: DocumentChange[] = []; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "com.seed.documents.v1alpha.ChangeProfileDocumentRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "account_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "changes", kind: "message", T: DocumentChange, repeated: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ChangeProfileDocumentRequest { - return new ChangeProfileDocumentRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ChangeProfileDocumentRequest { - return new ChangeProfileDocumentRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ChangeProfileDocumentRequest { - return new ChangeProfileDocumentRequest().fromJsonString(jsonString, options); - } - - static equals(a: ChangeProfileDocumentRequest | PlainMessage | undefined, b: ChangeProfileDocumentRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(ChangeProfileDocumentRequest, a, b); - } -} - -/** - * Request for getting a single document. - * - * @generated from message com.seed.documents.v1alpha.PushDocumentRequest - */ -export class PushDocumentRequest extends Message { +export class PushPublicationRequest extends Message { /** * Required. ID of the published document to be pushed. * @@ -1318,41 +672,41 @@ export class PushDocumentRequest extends Message { */ url = ""; - constructor(data?: PartialMessage) { + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "com.seed.documents.v1alpha.PushDocumentRequest"; + static readonly typeName = "com.seed.documents.v1alpha.PushPublicationRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "url", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): PushDocumentRequest { - return new PushDocumentRequest().fromBinary(bytes, options); + static fromBinary(bytes: Uint8Array, options?: Partial): PushPublicationRequest { + return new PushPublicationRequest().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): PushDocumentRequest { - return new PushDocumentRequest().fromJson(jsonValue, options); + static fromJson(jsonValue: JsonValue, options?: Partial): PushPublicationRequest { + return new PushPublicationRequest().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): PushDocumentRequest { - return new PushDocumentRequest().fromJsonString(jsonString, options); + static fromJsonString(jsonString: string, options?: Partial): PushPublicationRequest { + return new PushPublicationRequest().fromJsonString(jsonString, options); } - static equals(a: PushDocumentRequest | PlainMessage | undefined, b: PushDocumentRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(PushDocumentRequest, a, b); + static equals(a: PushPublicationRequest | PlainMessage | undefined, b: PushPublicationRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(PushPublicationRequest, a, b); } } /** - * Request for listing documents. + * Request for listing publications. * - * @generated from message com.seed.documents.v1alpha.ListDocumentsRequest + * @generated from message com.seed.documents.v1alpha.ListPublicationsRequest */ -export class ListDocumentsRequest extends Message { +export class ListPublicationsRequest extends Message { /** * Optional. Number of results per page. Default is defined by the server. * @@ -1367,49 +721,59 @@ export class ListDocumentsRequest extends Message { */ pageToken = ""; - constructor(data?: PartialMessage) { + /** + * Optional. When provided, the response will only contain + * publications *owned* (created) by trusted accounts of this node. + * By default, it returns all the publications (trusted_only = false) + * + * @generated from field: bool trusted_only = 3; + */ + trustedOnly = false; + + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "com.seed.documents.v1alpha.ListDocumentsRequest"; + static readonly typeName = "com.seed.documents.v1alpha.ListPublicationsRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "page_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, { no: 2, name: "page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "trusted_only", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): ListDocumentsRequest { - return new ListDocumentsRequest().fromBinary(bytes, options); + static fromBinary(bytes: Uint8Array, options?: Partial): ListPublicationsRequest { + return new ListPublicationsRequest().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): ListDocumentsRequest { - return new ListDocumentsRequest().fromJson(jsonValue, options); + static fromJson(jsonValue: JsonValue, options?: Partial): ListPublicationsRequest { + return new ListPublicationsRequest().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): ListDocumentsRequest { - return new ListDocumentsRequest().fromJsonString(jsonString, options); + static fromJsonString(jsonString: string, options?: Partial): ListPublicationsRequest { + return new ListPublicationsRequest().fromJsonString(jsonString, options); } - static equals(a: ListDocumentsRequest | PlainMessage | undefined, b: ListDocumentsRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(ListDocumentsRequest, a, b); + static equals(a: ListPublicationsRequest | PlainMessage | undefined, b: ListPublicationsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ListPublicationsRequest, a, b); } } /** - * Response with list of documents. + * Response with list of publications. * - * @generated from message com.seed.documents.v1alpha.ListDocumentsResponse + * @generated from message com.seed.documents.v1alpha.ListPublicationsResponse */ -export class ListDocumentsResponse extends Message { +export class ListPublicationsResponse extends Message { /** - * List of documents matching the request. + * List of publications matching the request. * Only most recent versions are returned. * Content is omitted, only metadata is present. * - * @generated from field: repeated com.seed.documents.v1alpha.Document documents = 1; + * @generated from field: repeated com.seed.documents.v1alpha.Publication publications = 1; */ - documents: Document[] = []; + publications: Publication[] = []; /** * Token for the next page if there're more results. @@ -1418,183 +782,41 @@ export class ListDocumentsResponse extends Message { */ nextPageToken = ""; - constructor(data?: PartialMessage) { + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "com.seed.documents.v1alpha.ListDocumentsResponse"; + static readonly typeName = "com.seed.documents.v1alpha.ListPublicationsResponse"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "documents", kind: "message", T: Document, repeated: true }, + { no: 1, name: "publications", kind: "message", T: Publication, repeated: true }, { no: 2, name: "next_page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): ListDocumentsResponse { - return new ListDocumentsResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ListDocumentsResponse { - return new ListDocumentsResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ListDocumentsResponse { - return new ListDocumentsResponse().fromJsonString(jsonString, options); - } - - static equals(a: ListDocumentsResponse | PlainMessage | undefined, b: ListDocumentsResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(ListDocumentsResponse, a, b); - } -} - -/** - * @generated from message com.seed.documents.v1alpha.ListDocumentBranchesRequest - */ -export class ListDocumentBranchesRequest extends Message { - /** - * Required. ID of the document to list branches for. - * - * @generated from field: string document_id = 1; - */ - documentId = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "com.seed.documents.v1alpha.ListDocumentBranchesRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ListDocumentBranchesRequest { - return new ListDocumentBranchesRequest().fromBinary(bytes, options); + static fromBinary(bytes: Uint8Array, options?: Partial): ListPublicationsResponse { + return new ListPublicationsResponse().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): ListDocumentBranchesRequest { - return new ListDocumentBranchesRequest().fromJson(jsonValue, options); + static fromJson(jsonValue: JsonValue, options?: Partial): ListPublicationsResponse { + return new ListPublicationsResponse().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): ListDocumentBranchesRequest { - return new ListDocumentBranchesRequest().fromJsonString(jsonString, options); + static fromJsonString(jsonString: string, options?: Partial): ListPublicationsResponse { + return new ListPublicationsResponse().fromJsonString(jsonString, options); } - static equals(a: ListDocumentBranchesRequest | PlainMessage | undefined, b: ListDocumentBranchesRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(ListDocumentBranchesRequest, a, b); + static equals(a: ListPublicationsResponse | PlainMessage | undefined, b: ListPublicationsResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ListPublicationsResponse, a, b); } } /** - * @generated from message com.seed.documents.v1alpha.ListDocumentBranchesResponse - */ -export class ListDocumentBranchesResponse extends Message { - /** - * List of branches for the document. - * - * @generated from field: repeated com.seed.documents.v1alpha.Branch branches = 1; - */ - branches: Branch[] = []; - - /** - * List of drafts for these branches. Includes a draft that will become a draft when published. - * - * @generated from field: repeated com.seed.documents.v1alpha.Draft drafts = 2; - */ - drafts: Draft[] = []; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "com.seed.documents.v1alpha.ListDocumentBranchesResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "branches", kind: "message", T: Branch, repeated: true }, - { no: 2, name: "drafts", kind: "message", T: Draft, repeated: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ListDocumentBranchesResponse { - return new ListDocumentBranchesResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ListDocumentBranchesResponse { - return new ListDocumentBranchesResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ListDocumentBranchesResponse { - return new ListDocumentBranchesResponse().fromJsonString(jsonString, options); - } - - static equals(a: ListDocumentBranchesResponse | PlainMessage | undefined, b: ListDocumentBranchesResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(ListDocumentBranchesResponse, a, b); - } -} - -/** - * @generated from message com.seed.documents.v1alpha.Branch - */ -export class Branch extends Message { - /** - * ID for use when deleting or publishing the branch - * - * @generated from field: string branch_id = 1; - */ - branchId = ""; - - /** - * ID of the top-level doc which will be updated. For standalone branches this is the doc ID. - * for index branches this is the parent doc ID. - * - * @generated from field: string document_id = 2; - */ - documentId = ""; - - /** - * the path of the document which is being updated. may include slashes to represent a deep index - * - * @generated from field: string path = 3; - */ - path = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "com.seed.documents.v1alpha.Branch"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "branch_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "path", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): Branch { - return new Branch().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): Branch { - return new Branch().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): Branch { - return new Branch().fromJsonString(jsonString, options); - } - - static equals(a: Branch | PlainMessage | undefined, b: Branch | PlainMessage | undefined): boolean { - return proto3.util.equals(Branch, a, b); - } -} - -/** - * Request for listing documents owned by a given account. + * Request for listing publications owned by a given account. * - * @generated from message com.seed.documents.v1alpha.ListAccountDocumentsRequest + * @generated from message com.seed.documents.v1alpha.ListAccountPublicationsRequest */ -export class ListAccountDocumentsRequest extends Message { +export class ListAccountPublicationsRequest extends Message { /** * Optional. Number of results per page. Default is defined by the server. * @@ -1610,39 +832,39 @@ export class ListAccountDocumentsRequest extends Message) { + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "com.seed.documents.v1alpha.ListAccountDocumentsRequest"; + static readonly typeName = "com.seed.documents.v1alpha.ListAccountPublicationsRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "page_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, { no: 2, name: "page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 3, name: "account_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): ListAccountDocumentsRequest { - return new ListAccountDocumentsRequest().fromBinary(bytes, options); + static fromBinary(bytes: Uint8Array, options?: Partial): ListAccountPublicationsRequest { + return new ListAccountPublicationsRequest().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): ListAccountDocumentsRequest { - return new ListAccountDocumentsRequest().fromJson(jsonValue, options); + static fromJson(jsonValue: JsonValue, options?: Partial): ListAccountPublicationsRequest { + return new ListAccountPublicationsRequest().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): ListAccountDocumentsRequest { - return new ListAccountDocumentsRequest().fromJsonString(jsonString, options); + static fromJsonString(jsonString: string, options?: Partial): ListAccountPublicationsRequest { + return new ListAccountPublicationsRequest().fromJsonString(jsonString, options); } - static equals(a: ListAccountDocumentsRequest | PlainMessage | undefined, b: ListAccountDocumentsRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(ListAccountDocumentsRequest, a, b); + static equals(a: ListAccountPublicationsRequest | PlainMessage | undefined, b: ListAccountPublicationsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ListAccountPublicationsRequest, a, b); } } @@ -1745,78 +967,59 @@ export class RebaseChangesRequest extends Message { } /** - * @generated from message com.seed.documents.v1alpha.Draft + * State of the document after publication. + * Deprecated: use the Document message instead, + * it has all the same fields. + * + * @generated from message com.seed.documents.v1alpha.Publication */ -export class Draft extends Message { +export class Publication extends Message { /** - * to identify the draft + * Version points to the state of the publication at some point in time. + * Deprecated: use the version field of the Document message instead. * - * @generated from field: string draft_id = 1; + * @generated from field: string version = 1; */ - draftId = ""; + version = ""; /** - * state of the draft + * Published document. * * @generated from field: com.seed.documents.v1alpha.Document document = 2; */ document?: Document; - /** - * True if this is a profile draft - * - * @generated from field: bool is_profile = 3; - */ - isProfile = false; - - /** - * The top-level entity that this draft will update once published. An Account ID for profile drafts, otherwise Document ID. - * - * @generated from field: string entity_id = 4; - */ - entityId = ""; - - /** - * Optional. The path where the draft will be updated once published - * - * @generated from field: string path = 5; - */ - path = ""; - - constructor(data?: PartialMessage) { + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "com.seed.documents.v1alpha.Draft"; + static readonly typeName = "com.seed.documents.v1alpha.Publication"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "draft_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 1, name: "version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "document", kind: "message", T: Document }, - { no: 3, name: "is_profile", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 4, name: "entity_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 5, name: "path", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): Draft { - return new Draft().fromBinary(bytes, options); + static fromBinary(bytes: Uint8Array, options?: Partial): Publication { + return new Publication().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): Draft { - return new Draft().fromJson(jsonValue, options); + static fromJson(jsonValue: JsonValue, options?: Partial): Publication { + return new Publication().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): Draft { - return new Draft().fromJsonString(jsonString, options); + static fromJsonString(jsonString: string, options?: Partial): Publication { + return new Publication().fromJsonString(jsonString, options); } - static equals(a: Draft | PlainMessage | undefined, b: Draft | PlainMessage | undefined): boolean { - return proto3.util.equals(Draft, a, b); + static equals(a: Publication | PlainMessage | undefined, b: Publication | PlainMessage | undefined): boolean { + return proto3.util.equals(Publication, a, b); } } /** - * Document represents metadata and content of a document. + * Document represents metadata and content of a draft or publication. * * @generated from message com.seed.documents.v1alpha.Document */ @@ -1829,50 +1032,33 @@ export class Document extends Message { id = ""; /** - * Output only. Author ID of the document. - * - * @generated from field: string author = 4; - */ - author = ""; - - /** - * Metadata values for a document. + * Title of the document. * - * @generated from field: map metadata = 15; + * @generated from field: string title = 2; */ - metadata: { [key: string]: string } = {}; + title = ""; /** - * Output only. Set to account ID if this is a profile document. + * Output only. Author ID of the document. * - * @generated from field: string profile_account_id = 14; + * @generated from field: string author = 4; */ - profileAccountId = ""; + author = ""; /** - * Output only. Every account ID who has modified the document. + * Output only. Account IDs of all the editors of the document. * Includes the original author as well. * - * @generated from field: repeated string authors = 11; - */ - authors: string[] = []; - - /** - * Blocks content of the document. - * - * @generated from field: repeated com.seed.documents.v1alpha.BlockNode content = 9; + * @generated from field: repeated string editors = 11; */ - content: BlockNode[] = []; + editors: string[] = []; /** - * The indexed children documents under this document. - * Keys are used as the path names (and slash "/" is not allowed in the key) - * Values will refer to other documents as exact versions such as "hm://DOC_ID?v=1" - * Values may refer to "latest" versions with "hm://DOC_ID" + * This is WIP feature for block-aware API. It will supersede the `content` field. * - * @generated from field: map index = 16; + * @generated from field: repeated com.seed.documents.v1alpha.BlockNode children = 9; */ - index: { [key: string]: string } = {}; + children: BlockNode[] = []; /** * Output only. Time when document was created. @@ -1904,7 +1090,7 @@ export class Document extends Message { /** * Output only. Previous version of the document, - * Empty if this is the first version. + * unless this is the first version. * * @generated from field: string previous_version = 13; */ @@ -1919,12 +1105,10 @@ export class Document extends Message { static readonly typeName = "com.seed.documents.v1alpha.Document"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "title", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 4, name: "author", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 15, name: "metadata", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, - { no: 14, name: "profile_account_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 11, name: "authors", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, - { no: 9, name: "content", kind: "message", T: BlockNode, repeated: true }, - { no: 16, name: "index", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, + { no: 11, name: "editors", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 9, name: "children", kind: "message", T: BlockNode, repeated: true }, { no: 6, name: "create_time", kind: "message", T: Timestamp }, { no: 7, name: "update_time", kind: "message", T: Timestamp }, { no: 8, name: "publish_time", kind: "message", T: Timestamp }, diff --git a/frontend/packages/shared/src/client/.generated/documents/v2alpha/changes_connect.ts b/frontend/packages/shared/src/client/.generated/documents/v2alpha/changes_connect.ts new file mode 100644 index 000000000..334c0e443 --- /dev/null +++ b/frontend/packages/shared/src/client/.generated/documents/v2alpha/changes_connect.ts @@ -0,0 +1,43 @@ +// Deprecated. Use Entities API instead. + +// @generated by protoc-gen-connect-es v1.1.3 with parameter "target=ts,import_extension=none" +// @generated from file documents/v2alpha/changes.proto (package com.seed.documents.v2alpha, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { ChangeInfo, GetChangeInfoRequest, ListChangesRequest, ListChangesResponse } from "./changes_pb"; +import { MethodKind } from "@bufbuild/protobuf"; + +/** + * Changes service provides information about the atomic version controlled changes of Seed objects. + * + * @generated from service com.seed.documents.v2alpha.Changes + */ +export const Changes = { + typeName: "com.seed.documents.v2alpha.Changes", + methods: { + /** + * Returns information about a single change. + * + * @generated from rpc com.seed.documents.v2alpha.Changes.GetChangeInfo + */ + getChangeInfo: { + name: "GetChangeInfo", + I: GetChangeInfoRequest, + O: ChangeInfo, + kind: MethodKind.Unary, + }, + /** + * List changes of a given object. + * + * @generated from rpc com.seed.documents.v2alpha.Changes.ListChanges + */ + listChanges: { + name: "ListChanges", + I: ListChangesRequest, + O: ListChangesResponse, + kind: MethodKind.Unary, + }, + } +} as const; + diff --git a/frontend/packages/shared/src/client/.generated/documents/v2alpha/changes_pb.ts b/frontend/packages/shared/src/client/.generated/documents/v2alpha/changes_pb.ts new file mode 100644 index 000000000..843ef2fac --- /dev/null +++ b/frontend/packages/shared/src/client/.generated/documents/v2alpha/changes_pb.ts @@ -0,0 +1,232 @@ +// Deprecated. Use Entities API instead. + +// @generated by protoc-gen-es v1.4.1 with parameter "target=ts,import_extension=none" +// @generated from file documents/v2alpha/changes.proto (package com.seed.documents.v2alpha, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3, Timestamp } from "@bufbuild/protobuf"; + +/** + * Request for getting change info. + * + * @generated from message com.seed.documents.v2alpha.GetChangeInfoRequest + */ +export class GetChangeInfoRequest extends Message { + /** + * ID of the Change. + * + * @generated from field: string id = 1; + */ + id = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.GetChangeInfoRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetChangeInfoRequest { + return new GetChangeInfoRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetChangeInfoRequest { + return new GetChangeInfoRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetChangeInfoRequest { + return new GetChangeInfoRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetChangeInfoRequest | PlainMessage | undefined, b: GetChangeInfoRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetChangeInfoRequest, a, b); + } +} + +/** + * Request to list changes. + * + * @generated from message com.seed.documents.v2alpha.ListChangesRequest + */ +export class ListChangesRequest extends Message { + /** + * Required. ID of the Seed object to list changes for. + * + * @generated from field: string document_id = 1; + */ + documentId = ""; + + /** + * Optional. Number of results per page. + * + * @generated from field: int32 page_size = 2; + */ + pageSize = 0; + + /** + * Optional. Token for the page to return. + * + * @generated from field: string page_token = 3; + */ + pageToken = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.ListChangesRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "page_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 3, name: "page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListChangesRequest { + return new ListChangesRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListChangesRequest { + return new ListChangesRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListChangesRequest { + return new ListChangesRequest().fromJsonString(jsonString, options); + } + + static equals(a: ListChangesRequest | PlainMessage | undefined, b: ListChangesRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ListChangesRequest, a, b); + } +} + +/** + * Response with a list of changes. + * + * @generated from message com.seed.documents.v2alpha.ListChangesResponse + */ +export class ListChangesResponse extends Message { + /** + * List of changes matching the request. + * + * @generated from field: repeated com.seed.documents.v2alpha.ChangeInfo changes = 1; + */ + changes: ChangeInfo[] = []; + + /** + * Token for the next page if there's any. + * + * @generated from field: string next_page_token = 2; + */ + nextPageToken = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.ListChangesResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "changes", kind: "message", T: ChangeInfo, repeated: true }, + { no: 2, name: "next_page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListChangesResponse { + return new ListChangesResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListChangesResponse { + return new ListChangesResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListChangesResponse { + return new ListChangesResponse().fromJsonString(jsonString, options); + } + + static equals(a: ListChangesResponse | PlainMessage | undefined, b: ListChangesResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ListChangesResponse, a, b); + } +} + +/** + * Metadata about a single Change. + * + * @generated from message com.seed.documents.v2alpha.ChangeInfo + */ +export class ChangeInfo extends Message { + /** + * ID of the Change. + * + * @generated from field: string id = 1; + */ + id = ""; + + /** + * Author of the Change. + * + * @generated from field: string author = 2; + */ + author = ""; + + /** + * Time when this change was recorded by the author. + * + * @generated from field: google.protobuf.Timestamp create_time = 3; + */ + createTime?: Timestamp; + + /** + * The document version ID corresponding to this changes. + * + * TODO(burdiyan): after the breaking change the change ID can be used directly as version. + * + * @generated from field: string version = 4; + */ + version = ""; + + /** + * IDs of other Changes that are dependencies of this Change. + * + * @generated from field: repeated string deps = 5; + */ + deps: string[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.ChangeInfo"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "author", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "create_time", kind: "message", T: Timestamp }, + { no: 4, name: "version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "deps", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ChangeInfo { + return new ChangeInfo().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ChangeInfo { + return new ChangeInfo().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ChangeInfo { + return new ChangeInfo().fromJsonString(jsonString, options); + } + + static equals(a: ChangeInfo | PlainMessage | undefined, b: ChangeInfo | PlainMessage | undefined): boolean { + return proto3.util.equals(ChangeInfo, a, b); + } +} + diff --git a/frontend/packages/shared/src/client/.generated/documents/v2alpha/comments_connect.ts b/frontend/packages/shared/src/client/.generated/documents/v2alpha/comments_connect.ts new file mode 100644 index 000000000..b5f242b4e --- /dev/null +++ b/frontend/packages/shared/src/client/.generated/documents/v2alpha/comments_connect.ts @@ -0,0 +1,52 @@ +// @generated by protoc-gen-connect-es v1.1.3 with parameter "target=ts,import_extension=none" +// @generated from file documents/v2alpha/comments.proto (package com.seed.documents.v2alpha, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { Comment, CreateCommentRequest, GetCommentRequest, ListCommentsRequest, ListCommentsResponse } from "./comments_pb"; +import { MethodKind } from "@bufbuild/protobuf"; + +/** + * Comments service allows users to add comments to documents. + * + * @generated from service com.seed.documents.v2alpha.Comments + */ +export const Comments = { + typeName: "com.seed.documents.v2alpha.Comments", + methods: { + /** + * Creates a new comment. + * + * @generated from rpc com.seed.documents.v2alpha.Comments.CreateComment + */ + createComment: { + name: "CreateComment", + I: CreateCommentRequest, + O: Comment, + kind: MethodKind.Unary, + }, + /** + * Gets a single comment by ID. + * + * @generated from rpc com.seed.documents.v2alpha.Comments.GetComment + */ + getComment: { + name: "GetComment", + I: GetCommentRequest, + O: Comment, + kind: MethodKind.Unary, + }, + /** + * Lists comments for a given target. + * + * @generated from rpc com.seed.documents.v2alpha.Comments.ListComments + */ + listComments: { + name: "ListComments", + I: ListCommentsRequest, + O: ListCommentsResponse, + kind: MethodKind.Unary, + }, + } +} as const; + diff --git a/frontend/packages/shared/src/client/.generated/documents/v2alpha/comments_pb.ts b/frontend/packages/shared/src/client/.generated/documents/v2alpha/comments_pb.ts new file mode 100644 index 000000000..c8d9bfa38 --- /dev/null +++ b/frontend/packages/shared/src/client/.generated/documents/v2alpha/comments_pb.ts @@ -0,0 +1,312 @@ +// @generated by protoc-gen-es v1.4.1 with parameter "target=ts,import_extension=none" +// @generated from file documents/v2alpha/comments.proto (package com.seed.documents.v2alpha, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3, Timestamp } from "@bufbuild/protobuf"; +import { BlockNode } from "./documents_pb"; + +/** + * Request to create a comment. + * + * @generated from message com.seed.documents.v2alpha.CreateCommentRequest + */ +export class CreateCommentRequest extends Message { + /** + * Required. The URI of the target hypermedia resource which is being commented. + * It's best to use versioned URIs to propagate better context and intent, + * even if the comments are eventually "overlaid" onto the newer versions of the resource. + * + * @generated from field: string target = 1; + */ + target = ""; + + /** + * Optional. If a comment is a reply to another comment, this must be the ID of the replied comment. + * The target of the reply and the replied comment must be the same + * (although version could differ if the reply is made reading a newer version of the document). + * + * @generated from field: string replied_comment = 2; + */ + repliedComment = ""; + + /** + * Required. Content of the comment. + * + * @generated from field: repeated com.seed.documents.v2alpha.BlockNode content = 3; + */ + content: BlockNode[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.CreateCommentRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "target", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "replied_comment", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "content", kind: "message", T: BlockNode, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateCommentRequest { + return new CreateCommentRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateCommentRequest { + return new CreateCommentRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateCommentRequest { + return new CreateCommentRequest().fromJsonString(jsonString, options); + } + + static equals(a: CreateCommentRequest | PlainMessage | undefined, b: CreateCommentRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateCommentRequest, a, b); + } +} + +/** + * Request to get a comment. + * + * @generated from message com.seed.documents.v2alpha.GetCommentRequest + */ +export class GetCommentRequest extends Message { + /** + * Required. ID of the comment to retrieve. + * + * @generated from field: string id = 1; + */ + id = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.GetCommentRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetCommentRequest { + return new GetCommentRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetCommentRequest { + return new GetCommentRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetCommentRequest { + return new GetCommentRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetCommentRequest | PlainMessage | undefined, b: GetCommentRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetCommentRequest, a, b); + } +} + +/** + * Request to list comments. + * + * @generated from message com.seed.documents.v2alpha.ListCommentsRequest + */ +export class ListCommentsRequest extends Message { + /** + * Required. The URI of the target resource for which comments should be listed. + * + * @generated from field: string target = 1; + */ + target = ""; + + /** + * Optional. The maximum number of comments to return. + * + * @generated from field: int32 page_size = 2; + */ + pageSize = 0; + + /** + * Optional. The page token obtained from a previous request (if any). + * + * @generated from field: string page_token = 3; + */ + pageToken = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.ListCommentsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "target", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "page_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 3, name: "page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListCommentsRequest { + return new ListCommentsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListCommentsRequest { + return new ListCommentsRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListCommentsRequest { + return new ListCommentsRequest().fromJsonString(jsonString, options); + } + + static equals(a: ListCommentsRequest | PlainMessage | undefined, b: ListCommentsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ListCommentsRequest, a, b); + } +} + +/** + * Response with a list of comments. + * + * @generated from message com.seed.documents.v2alpha.ListCommentsResponse + */ +export class ListCommentsResponse extends Message { + /** + * List of comments. + * + * @generated from field: repeated com.seed.documents.v2alpha.Comment comments = 1; + */ + comments: Comment[] = []; + + /** + * Token to retrieve the next page of comments (if necessary). + * + * @generated from field: string next_page_token = 2; + */ + nextPageToken = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.ListCommentsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "comments", kind: "message", T: Comment, repeated: true }, + { no: 2, name: "next_page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListCommentsResponse { + return new ListCommentsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListCommentsResponse { + return new ListCommentsResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListCommentsResponse { + return new ListCommentsResponse().fromJsonString(jsonString, options); + } + + static equals(a: ListCommentsResponse | PlainMessage | undefined, b: ListCommentsResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ListCommentsResponse, a, b); + } +} + +/** + * Comment is a unit of discussion. + * Comments are created targeting some hypermedia resource (ideally with a versioned link). + * Replies are created targeting the same resource, in addition to pointing to the comment they are replying to. + * + * @generated from message com.seed.documents.v2alpha.Comment + */ +export class Comment extends Message { + /** + * ID of the current comment. + * + * @generated from field: string id = 1; + */ + id = ""; + + /** + * The URI of the target resource which the comment is attached to. + * This is normally a Hypermedia Document, but potentially can be anything. + * Reply comments should share the same target as the comment they are replying to, + * but could potentially point to a different version. + * + * @generated from field: string target = 2; + */ + target = ""; + + /** + * The ID of the top-level non-reply comment of the conversation thread. + * + * @generated from field: string thread_root = 3; + */ + threadRoot = ""; + + /** + * The ID of the comment to which this comment is a reply. + * For initial comments this field is empty. + * + * @generated from field: string replied_comment = 4; + */ + repliedComment = ""; + + /** + * Account ID of the author of the comment. + * + * @generated from field: string author = 5; + */ + author = ""; + + /** + * Content of the comment. + * + * @generated from field: repeated com.seed.documents.v2alpha.BlockNode content = 6; + */ + content: BlockNode[] = []; + + /** + * Timestamp when the comment was created. + * + * @generated from field: google.protobuf.Timestamp create_time = 7; + */ + createTime?: Timestamp; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.Comment"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "target", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "thread_root", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "replied_comment", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "author", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 6, name: "content", kind: "message", T: BlockNode, repeated: true }, + { no: 7, name: "create_time", kind: "message", T: Timestamp }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Comment { + return new Comment().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Comment { + return new Comment().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Comment { + return new Comment().fromJsonString(jsonString, options); + } + + static equals(a: Comment | PlainMessage | undefined, b: Comment | PlainMessage | undefined): boolean { + return proto3.util.equals(Comment, a, b); + } +} + diff --git a/frontend/packages/shared/src/client/.generated/documents/v2alpha/content_graph_connect.ts b/frontend/packages/shared/src/client/.generated/documents/v2alpha/content_graph_connect.ts new file mode 100644 index 000000000..8b780f18d --- /dev/null +++ b/frontend/packages/shared/src/client/.generated/documents/v2alpha/content_graph_connect.ts @@ -0,0 +1,28 @@ +// @generated by protoc-gen-connect-es v1.1.3 with parameter "target=ts,import_extension=none" +// @generated from file documents/v2alpha/content_graph.proto (package com.seed.documents.v2alpha, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { ListCitationsRequest, ListCitationsResponse } from "./content_graph_pb"; +import { MethodKind } from "@bufbuild/protobuf"; + +/** + * Content graph service provides access to citations (backlinks). + * + * @generated from service com.seed.documents.v2alpha.ContentGraph + */ +export const ContentGraph = { + typeName: "com.seed.documents.v2alpha.ContentGraph", + methods: { + /** + * @generated from rpc com.seed.documents.v2alpha.ContentGraph.ListCitations + */ + listCitations: { + name: "ListCitations", + I: ListCitationsRequest, + O: ListCitationsResponse, + kind: MethodKind.Unary, + }, + } +} as const; + diff --git a/frontend/packages/shared/src/client/.generated/documents/v2alpha/content_graph_pb.ts b/frontend/packages/shared/src/client/.generated/documents/v2alpha/content_graph_pb.ts new file mode 100644 index 000000000..af1f0aac5 --- /dev/null +++ b/frontend/packages/shared/src/client/.generated/documents/v2alpha/content_graph_pb.ts @@ -0,0 +1,206 @@ +// @generated by protoc-gen-es v1.4.1 with parameter "target=ts,import_extension=none" +// @generated from file documents/v2alpha/content_graph.proto (package com.seed.documents.v2alpha, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from message com.seed.documents.v2alpha.ListCitationsRequest + */ +export class ListCitationsRequest extends Message { + /** + * Required. Document ID for which citations need to be retrieved. + * + * @generated from field: string document_id = 1; + */ + documentId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.ListCitationsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListCitationsRequest { + return new ListCitationsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListCitationsRequest { + return new ListCitationsRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListCitationsRequest { + return new ListCitationsRequest().fromJsonString(jsonString, options); + } + + static equals(a: ListCitationsRequest | PlainMessage | undefined, b: ListCitationsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ListCitationsRequest, a, b); + } +} + +/** + * Response with citations. + * + * @generated from message com.seed.documents.v2alpha.ListCitationsResponse + */ +export class ListCitationsResponse extends Message { + /** + * List of links that point to the requested document, recursively, according to the requested depth. + * + * @generated from field: repeated com.seed.documents.v2alpha.Link links = 1; + */ + links: Link[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.ListCitationsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "links", kind: "message", T: Link, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListCitationsResponse { + return new ListCitationsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListCitationsResponse { + return new ListCitationsResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListCitationsResponse { + return new ListCitationsResponse().fromJsonString(jsonString, options); + } + + static equals(a: ListCitationsResponse | PlainMessage | undefined, b: ListCitationsResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ListCitationsResponse, a, b); + } +} + +/** + * Description of a link inside a document. + * + * @generated from message com.seed.documents.v2alpha.Link + */ +export class Link extends Message { + /** + * Required. Describes where link originates from. + * + * @generated from field: com.seed.documents.v2alpha.LinkNode source = 1; + */ + source?: LinkNode; + + /** + * Required. Describes where link points to. + * Here the block_id is optional, because the whole document can be linked. + * + * @generated from field: com.seed.documents.v2alpha.LinkNode target = 2; + */ + target?: LinkNode; + + /** + * Indicates whether the link targets the latest version of the document. + * Notice that the target link node might still have a version specified, + * which has to be treated as a frame of reference, i.e. "this version or newer" + * if is_latest is true. + * + * @generated from field: bool is_latest = 3; + */ + isLatest = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.Link"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "source", kind: "message", T: LinkNode }, + { no: 2, name: "target", kind: "message", T: LinkNode }, + { no: 3, name: "is_latest", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Link { + return new Link().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Link { + return new Link().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Link { + return new Link().fromJsonString(jsonString, options); + } + + static equals(a: Link | PlainMessage | undefined, b: Link | PlainMessage | undefined): boolean { + return proto3.util.equals(Link, a, b); + } +} + +/** + * Describes "sides" of a Link. + * + * @generated from message com.seed.documents.v2alpha.LinkNode + */ +export class LinkNode extends Message { + /** + * ID of the document on one side of a Link. + * + * @generated from field: string document_id = 1; + */ + documentId = ""; + + /** + * Version of the document. + * + * @generated from field: string version = 2; + */ + version = ""; + + /** + * ID of the block inside the document. + * + * @generated from field: string block_id = 3; + */ + blockId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.LinkNode"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "block_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): LinkNode { + return new LinkNode().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): LinkNode { + return new LinkNode().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): LinkNode { + return new LinkNode().fromJsonString(jsonString, options); + } + + static equals(a: LinkNode | PlainMessage | undefined, b: LinkNode | PlainMessage | undefined): boolean { + return proto3.util.equals(LinkNode, a, b); + } +} + diff --git a/frontend/packages/shared/src/client/.generated/documents/v2alpha/documents_connect.ts b/frontend/packages/shared/src/client/.generated/documents/v2alpha/documents_connect.ts new file mode 100644 index 000000000..6e87b5338 --- /dev/null +++ b/frontend/packages/shared/src/client/.generated/documents/v2alpha/documents_connect.ts @@ -0,0 +1,283 @@ +// @generated by protoc-gen-connect-es v1.1.3 with parameter "target=ts,import_extension=none" +// @generated from file documents/v2alpha/documents.proto (package com.seed.documents.v2alpha, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { Branch, ChangeDocumentRequest, ChangeProfileDocumentRequest, CreateBranchDraftRequest, CreateDraftRequest, CreateIndexDraftRequest, CreateProfileDraftRequest, DeleteDraftRequest, Document, Draft, GetDocumentIndexRequest, GetDocumentIndexResponse, GetDocumentRequest, GetDraftRequest, GetProfileDocumentRequest, GetProfileDraftRequest, ListAccountDocumentsRequest, ListDocumentBranchesRequest, ListDocumentBranchesResponse, ListDocumentDraftsRequest, ListDocumentDraftsResponse, ListDocumentsRequest, ListDocumentsResponse, ListDraftsRequest, ListDraftsResponse, MergeChangesRequest, PublishDraftRequest, PushDocumentRequest, RebaseChangesRequest, UpdateDraftRequest, UpdateDraftResponse } from "./documents_pb"; +import { Empty, MethodKind } from "@bufbuild/protobuf"; + +/** + * Drafts service exposes the functionality + * + * @generated from service com.seed.documents.v2alpha.Drafts + */ +export const Drafts = { + typeName: "com.seed.documents.v2alpha.Drafts", + methods: { + /** + * Creates a new draft of an existing standalone branch + * + * @generated from rpc com.seed.documents.v2alpha.Drafts.CreateDraft + */ + createDraft: { + name: "CreateDraft", + I: CreateDraftRequest, + O: Draft, + kind: MethodKind.Unary, + }, + /** + * Creates a draft for a new branch. + * + * @generated from rpc com.seed.documents.v2alpha.Drafts.CreateBranchDraft + */ + createBranchDraft: { + name: "CreateBranchDraft", + I: CreateBranchDraftRequest, + O: Draft, + kind: MethodKind.Unary, + }, + /** + * Creates a draft for an index branch. Thows if a draft already exists for this index. + * + * @generated from rpc com.seed.documents.v2alpha.Drafts.CreateIndexDraft + */ + createIndexDraft: { + name: "CreateIndexDraft", + I: CreateIndexDraftRequest, + O: Draft, + kind: MethodKind.Unary, + }, + /** + * Create a draft for a profile document. Thows if a draft already exists for this profile. + * + * @generated from rpc com.seed.documents.v2alpha.Drafts.CreateProfileDraft + */ + createProfileDraft: { + name: "CreateProfileDraft", + I: CreateProfileDraftRequest, + O: Draft, + kind: MethodKind.Unary, + }, + /** + * Deletes a draft by its document ID. + * + * @generated from rpc com.seed.documents.v2alpha.Drafts.DeleteDraft + */ + deleteDraft: { + name: "DeleteDraft", + I: DeleteDraftRequest, + O: Empty, + kind: MethodKind.Unary, + }, + /** + * Gets a single draft if exists. + * + * @generated from rpc com.seed.documents.v2alpha.Drafts.GetDraft + */ + getDraft: { + name: "GetDraft", + I: GetDraftRequest, + O: Draft, + kind: MethodKind.Unary, + }, + /** + * Gets a draft for a profile document. + * + * @generated from rpc com.seed.documents.v2alpha.Drafts.GetProfileDraft + */ + getProfileDraft: { + name: "GetProfileDraft", + I: GetProfileDraftRequest, + O: Draft, + kind: MethodKind.Unary, + }, + /** + * Updates a draft using granular update operations. + * + * @generated from rpc com.seed.documents.v2alpha.Drafts.UpdateDraft + */ + updateDraft: { + name: "UpdateDraft", + I: UpdateDraftRequest, + O: UpdateDraftResponse, + kind: MethodKind.Unary, + }, + /** + * List currently stored drafts. + * + * @generated from rpc com.seed.documents.v2alpha.Drafts.ListDrafts + */ + listDrafts: { + name: "ListDrafts", + I: ListDraftsRequest, + O: ListDraftsResponse, + kind: MethodKind.Unary, + }, + /** + * Lists drafts for a given document. + * + * @generated from rpc com.seed.documents.v2alpha.Drafts.ListDocumentDrafts + */ + listDocumentDrafts: { + name: "ListDocumentDrafts", + I: ListDocumentDraftsRequest, + O: ListDocumentDraftsResponse, + kind: MethodKind.Unary, + }, + /** + * Publishes a draft. Returns the branch that was published. + * + * @generated from rpc com.seed.documents.v2alpha.Drafts.PublishDraft + */ + publishDraft: { + name: "PublishDraft", + I: PublishDraftRequest, + O: Branch, + kind: MethodKind.Unary, + }, + } +} as const; + +/** + * Documents service provides access to documents. + * + * @generated from service com.seed.documents.v2alpha.Documents + */ +export const Documents = { + typeName: "com.seed.documents.v2alpha.Documents", + methods: { + /** + * Gets a single document. + * + * @generated from rpc com.seed.documents.v2alpha.Documents.GetDocument + */ + getDocument: { + name: "GetDocument", + I: GetDocumentRequest, + O: Document, + kind: MethodKind.Unary, + }, + /** + * Gets an account's profile document. + * + * @generated from rpc com.seed.documents.v2alpha.Documents.GetProfileDocument + */ + getProfileDocument: { + name: "GetProfileDocument", + I: GetProfileDocumentRequest, + O: Document, + kind: MethodKind.Unary, + }, + /** + * Gets a document within the index(es) of other documents + * + * @generated from rpc com.seed.documents.v2alpha.Documents.GetDocumentIndex + */ + getDocumentIndex: { + name: "GetDocumentIndex", + I: GetDocumentIndexRequest, + O: GetDocumentIndexResponse, + kind: MethodKind.Unary, + }, + /** + * Immediately changes a document + * + * @generated from rpc com.seed.documents.v2alpha.Documents.ChangeDocument + */ + changeDocument: { + name: "ChangeDocument", + I: ChangeDocumentRequest, + O: Document, + kind: MethodKind.Unary, + }, + /** + * Immediately changes an account's profile document + * + * @generated from rpc com.seed.documents.v2alpha.Documents.ChangeProfileDocument + */ + changeProfileDocument: { + name: "ChangeProfileDocument", + I: ChangeProfileDocumentRequest, + O: Document, + kind: MethodKind.Unary, + }, + /** + * Lists all documents. Only the most recent versions show up. + * + * @generated from rpc com.seed.documents.v2alpha.Documents.ListDocuments + */ + listDocuments: { + name: "ListDocuments", + I: ListDocumentsRequest, + O: ListDocumentsResponse, + kind: MethodKind.Unary, + }, + /** + * Lists branches of a document. Includes standalone and index branches, and any drafts for these branches + * + * @generated from rpc com.seed.documents.v2alpha.Documents.ListDocumentBranches + */ + listDocumentBranches: { + name: "ListDocumentBranches", + I: ListDocumentBranchesRequest, + O: ListDocumentBranchesResponse, + kind: MethodKind.Unary, + }, + /** + * Push Local document to the gateway. + * + * @generated from rpc com.seed.documents.v2alpha.Documents.PushDocument + */ + pushDocument: { + name: "PushDocument", + I: PushDocumentRequest, + O: Empty, + kind: MethodKind.Unary, + }, + /** + * Lists documents owned by a given account. + * + * @generated from rpc com.seed.documents.v2alpha.Documents.ListAccountDocuments + */ + listAccountDocuments: { + name: "ListAccountDocuments", + I: ListAccountDocumentsRequest, + O: ListDocumentsResponse, + kind: MethodKind.Unary, + }, + } +} as const; + +/** + * Merge service provides access to merge documents. + * + * @generated from service com.seed.documents.v2alpha.Merge + */ +export const Merge = { + typeName: "com.seed.documents.v2alpha.Merge", + methods: { + /** + * Merge changes and publishes. + * + * @generated from rpc com.seed.documents.v2alpha.Merge.MergeChanges + */ + mergeChanges: { + name: "MergeChanges", + I: MergeChangesRequest, + O: Document, + kind: MethodKind.Unary, + }, + /** + * Rebase changes + * + * @generated from rpc com.seed.documents.v2alpha.Merge.RebaseChanges + */ + rebaseChanges: { + name: "RebaseChanges", + I: RebaseChangesRequest, + O: Document, + kind: MethodKind.Unary, + }, + } +} as const; + diff --git a/frontend/packages/shared/src/client/.generated/documents/v2alpha/documents_pb.ts b/frontend/packages/shared/src/client/.generated/documents/v2alpha/documents_pb.ts new file mode 100644 index 000000000..092498d26 --- /dev/null +++ b/frontend/packages/shared/src/client/.generated/documents/v2alpha/documents_pb.ts @@ -0,0 +1,2174 @@ +// @generated by protoc-gen-es v1.4.1 with parameter "target=ts,import_extension=none" +// @generated from file documents/v2alpha/documents.proto (package com.seed.documents.v2alpha, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3, Timestamp } from "@bufbuild/protobuf"; + +/** + * Relationship between a document and an account + * + * @generated from enum com.seed.documents.v2alpha.RoleType + */ +export enum RoleType { + /** + * No permissions. + * + * @generated from enum value: ROLE_UNSPECIFIED = 0; + */ + ROLE_UNSPECIFIED = 0, + + /** + * The role for an owner. All permissions are granted. + * + * @generated from enum value: OWNER = 1; + */ + OWNER = 1, + + /** + * Allowed to invite/remove writers+collaborators, edit content, and merge suggested changes + * + * @generated from enum value: EDITOR = 2; + */ + EDITOR = 2, + + /** + * Allowed to change content + * + * @generated from enum value: WRITER = 3; + */ + WRITER = 3, + + /** + * Their comments and suggested changes will be distributed alongside the document + * + * @generated from enum value: COLLABORATOR = 4; + */ + COLLABORATOR = 4, +} +// Retrieve enum metadata with: proto3.getEnumType(RoleType) +proto3.util.setEnumType(RoleType, "com.seed.documents.v2alpha.RoleType", [ + { no: 0, name: "ROLE_UNSPECIFIED" }, + { no: 1, name: "OWNER" }, + { no: 2, name: "EDITOR" }, + { no: 3, name: "WRITER" }, + { no: 4, name: "COLLABORATOR" }, +]); + +/** + * Request to create a new draft for an existing standalone branch + * + * @generated from message com.seed.documents.v2alpha.CreateDraftRequest + */ +export class CreateDraftRequest extends Message { + /** + * Required. ID of the document branch that will be updated. + * + * @generated from field: string document_id = 1; + */ + documentId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.CreateDraftRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateDraftRequest { + return new CreateDraftRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateDraftRequest { + return new CreateDraftRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateDraftRequest { + return new CreateDraftRequest().fromJsonString(jsonString, options); + } + + static equals(a: CreateDraftRequest | PlainMessage | undefined, b: CreateDraftRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateDraftRequest, a, b); + } +} + +/** + * Request to create a draft for a new standalone branch, optionally based on an existing document. + * + * @generated from message com.seed.documents.v2alpha.CreateBranchDraftRequest + */ +export class CreateBranchDraftRequest extends Message { + /** + * Optional. Document which will be branched from. If not specified, a new document will be created. + * + * @generated from field: string document_id = 1; + */ + documentId = ""; + + /** + * Optional. Version of the existing document to create draft from. + * If version is specified, document_id must also be specified. + * + * @generated from field: string version = 2; + */ + version = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.CreateBranchDraftRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateBranchDraftRequest { + return new CreateBranchDraftRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateBranchDraftRequest { + return new CreateBranchDraftRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateBranchDraftRequest { + return new CreateBranchDraftRequest().fromJsonString(jsonString, options); + } + + static equals(a: CreateBranchDraftRequest | PlainMessage | undefined, b: CreateBranchDraftRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateBranchDraftRequest, a, b); + } +} + +/** + * Request to create a new branch which will be saved to the index of another document. + * If this path already exists in the parent, the index will be updated when the draft is published. + * If this path does not exist in the parent, the index will be created when the draft is published. + * + * @generated from message com.seed.documents.v2alpha.CreateIndexDraftRequest + */ +export class CreateIndexDraftRequest extends Message { + /** + * Required. ID of the parent document. + * + * @generated from field: string document_id = 1; + */ + documentId = ""; + + /** + * Required. Path of the document to create a draft for. May include slashes to represent a deep index. + * + * @generated from field: string path = 2; + */ + path = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.CreateIndexDraftRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "path", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateIndexDraftRequest { + return new CreateIndexDraftRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateIndexDraftRequest { + return new CreateIndexDraftRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateIndexDraftRequest { + return new CreateIndexDraftRequest().fromJsonString(jsonString, options); + } + + static equals(a: CreateIndexDraftRequest | PlainMessage | undefined, b: CreateIndexDraftRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateIndexDraftRequest, a, b); + } +} + +/** + * Request to create a draft for a profile document. + * + * @generated from message com.seed.documents.v2alpha.CreateProfileDraftRequest + */ +export class CreateProfileDraftRequest extends Message { + /** + * Required. Account ID to create a profile draft for. + * + * @generated from field: string account_id = 1; + */ + accountId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.CreateProfileDraftRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "account_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateProfileDraftRequest { + return new CreateProfileDraftRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateProfileDraftRequest { + return new CreateProfileDraftRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateProfileDraftRequest { + return new CreateProfileDraftRequest().fromJsonString(jsonString, options); + } + + static equals(a: CreateProfileDraftRequest | PlainMessage | undefined, b: CreateProfileDraftRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateProfileDraftRequest, a, b); + } +} + +/** + * Request to delete an existing draft. + * + * @generated from message com.seed.documents.v2alpha.DeleteDraftRequest + */ +export class DeleteDraftRequest extends Message { + /** + * Required. ID of the branch to delete. + * + * @generated from field: string branch_id = 1; + */ + branchId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.DeleteDraftRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "branch_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeleteDraftRequest { + return new DeleteDraftRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeleteDraftRequest { + return new DeleteDraftRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeleteDraftRequest { + return new DeleteDraftRequest().fromJsonString(jsonString, options); + } + + static equals(a: DeleteDraftRequest | PlainMessage | undefined, b: DeleteDraftRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(DeleteDraftRequest, a, b); + } +} + +/** + * Request to get a single draft. + * + * @generated from message com.seed.documents.v2alpha.GetDraftRequest + */ +export class GetDraftRequest extends Message { + /** + * Required. ID of the draft that was previously created. + * + * @generated from field: string draft_id = 1; + */ + draftId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.GetDraftRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "draft_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetDraftRequest { + return new GetDraftRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetDraftRequest { + return new GetDraftRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetDraftRequest { + return new GetDraftRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetDraftRequest | PlainMessage | undefined, b: GetDraftRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetDraftRequest, a, b); + } +} + +/** + * Request the draft for an account's profile document + * + * @generated from message com.seed.documents.v2alpha.GetProfileDraftRequest + */ +export class GetProfileDraftRequest extends Message { + /** + * Required. Account ID to get the profile draft for. + * + * @generated from field: string account_id = 1; + */ + accountId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.GetProfileDraftRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "account_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetProfileDraftRequest { + return new GetProfileDraftRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetProfileDraftRequest { + return new GetProfileDraftRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetProfileDraftRequest { + return new GetProfileDraftRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetProfileDraftRequest | PlainMessage | undefined, b: GetProfileDraftRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetProfileDraftRequest, a, b); + } +} + +/** + * Request to update an existing draft using granular operations. + * + * @generated from message com.seed.documents.v2alpha.UpdateDraftRequest + */ +export class UpdateDraftRequest extends Message { + /** + * ID of the document to be updated. + * + * @generated from field: string document_id = 3; + */ + documentId = ""; + + /** + * List of document changes that must be applied to the existing document. + * + * @generated from field: repeated com.seed.documents.v2alpha.DocumentChange changes = 4; + */ + changes: DocumentChange[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.UpdateDraftRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 3, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "changes", kind: "message", T: DocumentChange, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): UpdateDraftRequest { + return new UpdateDraftRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): UpdateDraftRequest { + return new UpdateDraftRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): UpdateDraftRequest { + return new UpdateDraftRequest().fromJsonString(jsonString, options); + } + + static equals(a: UpdateDraftRequest | PlainMessage | undefined, b: UpdateDraftRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(UpdateDraftRequest, a, b); + } +} + +/** + * Response after draft is updated. + * + * @generated from message com.seed.documents.v2alpha.UpdateDraftResponse + */ +export class UpdateDraftResponse extends Message { + /** + * The ID of the change representing the draft version after the update is processed. + * + * @generated from field: string change_id = 1; + */ + changeId = ""; + + /** + * The state of the document after the update. + * + * @generated from field: com.seed.documents.v2alpha.Document updated_document = 2; + */ + updatedDocument?: Document; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.UpdateDraftResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "change_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "updated_document", kind: "message", T: Document }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): UpdateDraftResponse { + return new UpdateDraftResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): UpdateDraftResponse { + return new UpdateDraftResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): UpdateDraftResponse { + return new UpdateDraftResponse().fromJsonString(jsonString, options); + } + + static equals(a: UpdateDraftResponse | PlainMessage | undefined, b: UpdateDraftResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(UpdateDraftResponse, a, b); + } +} + +/** + * Granular document change. + * + * @generated from message com.seed.documents.v2alpha.DocumentChange + */ +export class DocumentChange extends Message { + /** + * @generated from oneof com.seed.documents.v2alpha.DocumentChange.op + */ + op: { + /** + * New metadata to set on the document. + * + * @generated from field: com.seed.documents.v2alpha.DocumentChange.SetMetadata set_metadata = 1; + */ + value: DocumentChange_SetMetadata; + case: "setMetadata"; + } | { + /** + * New index to set on the document. + * + * @generated from field: com.seed.documents.v2alpha.DocumentChange.SetIndex set_index = 2; + */ + value: DocumentChange_SetIndex; + case: "setIndex"; + } | { + /** + * Move operation that creates/moves a block within the document hierarchy. + * + * @generated from field: com.seed.documents.v2alpha.DocumentChange.MoveBlock move_block = 3; + */ + value: DocumentChange_MoveBlock; + case: "moveBlock"; + } | { + /** + * New block state that replaces an existing block. + * + * @generated from field: com.seed.documents.v2alpha.Block replace_block = 4; + */ + value: Block; + case: "replaceBlock"; + } | { + /** + * ID of a block to delete. + * + * @generated from field: string delete_block = 5; + */ + value: string; + case: "deleteBlock"; + } | { + /** + * Update membership for an account on this document. + * + * @generated from field: com.seed.documents.v2alpha.DocumentChange.UpdateMember update_member = 6; + */ + value: DocumentChange_UpdateMember; + case: "updateMember"; + } | { case: undefined; value?: undefined } = { case: undefined }; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.DocumentChange"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "set_metadata", kind: "message", T: DocumentChange_SetMetadata, oneof: "op" }, + { no: 2, name: "set_index", kind: "message", T: DocumentChange_SetIndex, oneof: "op" }, + { no: 3, name: "move_block", kind: "message", T: DocumentChange_MoveBlock, oneof: "op" }, + { no: 4, name: "replace_block", kind: "message", T: Block, oneof: "op" }, + { no: 5, name: "delete_block", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "op" }, + { no: 6, name: "update_member", kind: "message", T: DocumentChange_UpdateMember, oneof: "op" }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DocumentChange { + return new DocumentChange().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DocumentChange { + return new DocumentChange().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DocumentChange { + return new DocumentChange().fromJsonString(jsonString, options); + } + + static equals(a: DocumentChange | PlainMessage | undefined, b: DocumentChange | PlainMessage | undefined): boolean { + return proto3.util.equals(DocumentChange, a, b); + } +} + +/** + * Operation to move an existing block to a different place in the document. + * Move and Create operations are both expressed with this. + * Conceptually new blocks are moved out of nowhere into the document. + * + * @generated from message com.seed.documents.v2alpha.DocumentChange.MoveBlock + */ +export class DocumentChange_MoveBlock extends Message { + /** + * ID of the block to move. + * + * @generated from field: string block_id = 1; + */ + blockId = ""; + + /** + * ID of the new parent for the block being moved. + * + * @generated from field: string parent = 2; + */ + parent = ""; + + /** + * ID of the new left sibling for the block being moved. + * + * @generated from field: string left_sibling = 3; + */ + leftSibling = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.DocumentChange.MoveBlock"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "block_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "parent", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "left_sibling", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DocumentChange_MoveBlock { + return new DocumentChange_MoveBlock().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DocumentChange_MoveBlock { + return new DocumentChange_MoveBlock().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DocumentChange_MoveBlock { + return new DocumentChange_MoveBlock().fromJsonString(jsonString, options); + } + + static equals(a: DocumentChange_MoveBlock | PlainMessage | undefined, b: DocumentChange_MoveBlock | PlainMessage | undefined): boolean { + return proto3.util.equals(DocumentChange_MoveBlock, a, b); + } +} + +/** + * Operation to replace a metadata field with a new value + * + * @generated from message com.seed.documents.v2alpha.DocumentChange.SetMetadata + */ +export class DocumentChange_SetMetadata extends Message { + /** + * Metadata key to set. + * + * @generated from field: string key = 1; + */ + key = ""; + + /** + * Metadata value to set. + * + * "ipfs://ABC" - Use CID as reference material + * "hm://DOC_ID" - Document ID as reference material + * other random data + * "https://example.com" + * DATE FORMAT + * + * @generated from field: string value = 2; + */ + value = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.DocumentChange.SetMetadata"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "value", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DocumentChange_SetMetadata { + return new DocumentChange_SetMetadata().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DocumentChange_SetMetadata { + return new DocumentChange_SetMetadata().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DocumentChange_SetMetadata { + return new DocumentChange_SetMetadata().fromJsonString(jsonString, options); + } + + static equals(a: DocumentChange_SetMetadata | PlainMessage | undefined, b: DocumentChange_SetMetadata | PlainMessage | undefined): boolean { + return proto3.util.equals(DocumentChange_SetMetadata, a, b); + } +} + +/** + * Operation to replace an index field with a new value + * + * @generated from message com.seed.documents.v2alpha.DocumentChange.SetIndex + */ +export class DocumentChange_SetIndex extends Message { + /** + * Index key to set. + * + * @generated from field: string key = 1; + */ + key = ""; + + /** + * Index value to set. + * + * example values + * "DOC_ID" + * "@CHANGE_ID" + * "@CHANGE_ID.CHANGE_ID2" + * "#FRAGMENT" + * "a/ACCOUNT_ID" + * + * @generated from field: string value = 2; + */ + value = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.DocumentChange.SetIndex"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "value", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DocumentChange_SetIndex { + return new DocumentChange_SetIndex().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DocumentChange_SetIndex { + return new DocumentChange_SetIndex().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DocumentChange_SetIndex { + return new DocumentChange_SetIndex().fromJsonString(jsonString, options); + } + + static equals(a: DocumentChange_SetIndex | PlainMessage | undefined, b: DocumentChange_SetIndex | PlainMessage | undefined): boolean { + return proto3.util.equals(DocumentChange_SetIndex, a, b); + } +} + +/** + * Operation to change membership + * + * @generated from message com.seed.documents.v2alpha.DocumentChange.UpdateMember + */ +export class DocumentChange_UpdateMember extends Message { + /** + * Account ID to update the role for. + * + * @generated from field: string account_id = 1; + */ + accountId = ""; + + /** + * New role to set for the account. + * + * @generated from field: com.seed.documents.v2alpha.RoleType role = 2; + */ + role = RoleType.ROLE_UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.DocumentChange.UpdateMember"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "account_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "role", kind: "enum", T: proto3.getEnumType(RoleType) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DocumentChange_UpdateMember { + return new DocumentChange_UpdateMember().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DocumentChange_UpdateMember { + return new DocumentChange_UpdateMember().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DocumentChange_UpdateMember { + return new DocumentChange_UpdateMember().fromJsonString(jsonString, options); + } + + static equals(a: DocumentChange_UpdateMember | PlainMessage | undefined, b: DocumentChange_UpdateMember | PlainMessage | undefined): boolean { + return proto3.util.equals(DocumentChange_UpdateMember, a, b); + } +} + +/** + * Request to list stored drafts. + * + * @generated from message com.seed.documents.v2alpha.ListDraftsRequest + */ +export class ListDraftsRequest extends Message { + /** + * Optional. Number of results per page. + * + * @generated from field: int32 page_size = 1; + */ + pageSize = 0; + + /** + * Optional. Token for the page to return. + * + * @generated from field: string page_token = 2; + */ + pageToken = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.ListDraftsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "page_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListDraftsRequest { + return new ListDraftsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListDraftsRequest { + return new ListDraftsRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListDraftsRequest { + return new ListDraftsRequest().fromJsonString(jsonString, options); + } + + static equals(a: ListDraftsRequest | PlainMessage | undefined, b: ListDraftsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ListDraftsRequest, a, b); + } +} + +/** + * Response for listing drafts. + * + * @generated from message com.seed.documents.v2alpha.ListDraftsResponse + */ +export class ListDraftsResponse extends Message { + /** + * Drafts matching the list request. + * Content is omitted. + * + * @generated from field: repeated com.seed.documents.v2alpha.Document documents = 1; + */ + documents: Document[] = []; + + /** + * Token for the next page if there's any. + * + * @generated from field: string next_page_token = 2; + */ + nextPageToken = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.ListDraftsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "documents", kind: "message", T: Document, repeated: true }, + { no: 2, name: "next_page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListDraftsResponse { + return new ListDraftsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListDraftsResponse { + return new ListDraftsResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListDraftsResponse { + return new ListDraftsResponse().fromJsonString(jsonString, options); + } + + static equals(a: ListDraftsResponse | PlainMessage | undefined, b: ListDraftsResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ListDraftsResponse, a, b); + } +} + +/** + * Request to list document drafts. + * + * @generated from message com.seed.documents.v2alpha.ListDocumentDraftsRequest + */ +export class ListDocumentDraftsRequest extends Message { + /** + * ID of the document to list drafts for. + * + * @generated from field: string document_id = 1; + */ + documentId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.ListDocumentDraftsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListDocumentDraftsRequest { + return new ListDocumentDraftsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListDocumentDraftsRequest { + return new ListDocumentDraftsRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListDocumentDraftsRequest { + return new ListDocumentDraftsRequest().fromJsonString(jsonString, options); + } + + static equals(a: ListDocumentDraftsRequest | PlainMessage | undefined, b: ListDocumentDraftsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ListDocumentDraftsRequest, a, b); + } +} + +/** + * Response with the list of drafts for a given document ID. + * + * @generated from message com.seed.documents.v2alpha.ListDocumentDraftsResponse + */ +export class ListDocumentDraftsResponse extends Message { + /** + * Drafts come without content, only metadata, + * similar to the rest of list responses. + * + * @generated from field: repeated com.seed.documents.v2alpha.Document drafts = 1; + */ + drafts: Document[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.ListDocumentDraftsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "drafts", kind: "message", T: Document, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListDocumentDraftsResponse { + return new ListDocumentDraftsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListDocumentDraftsResponse { + return new ListDocumentDraftsResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListDocumentDraftsResponse { + return new ListDocumentDraftsResponse().fromJsonString(jsonString, options); + } + + static equals(a: ListDocumentDraftsResponse | PlainMessage | undefined, b: ListDocumentDraftsResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ListDocumentDraftsResponse, a, b); + } +} + +/** + * Request to publish a draft. + * + * @generated from message com.seed.documents.v2alpha.PublishDraftRequest + */ +export class PublishDraftRequest extends Message { + /** + * ID of the draft to be published. + * + * @generated from field: string draft_id = 1; + */ + draftId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.PublishDraftRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "draft_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PublishDraftRequest { + return new PublishDraftRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PublishDraftRequest { + return new PublishDraftRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PublishDraftRequest { + return new PublishDraftRequest().fromJsonString(jsonString, options); + } + + static equals(a: PublishDraftRequest | PlainMessage | undefined, b: PublishDraftRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(PublishDraftRequest, a, b); + } +} + +/** + * Request for getting a single document. + * + * @generated from message com.seed.documents.v2alpha.GetDocumentRequest + */ +export class GetDocumentRequest extends Message { + /** + * Required. ID of the published document. + * + * @generated from field: string document_id = 1; + */ + documentId = ""; + + /** + * Optional. Specific version of the published document. If empty, the latest one is returned. + * + * @generated from field: string version = 2; + */ + version = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.GetDocumentRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetDocumentRequest { + return new GetDocumentRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetDocumentRequest { + return new GetDocumentRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetDocumentRequest { + return new GetDocumentRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetDocumentRequest | PlainMessage | undefined, b: GetDocumentRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetDocumentRequest, a, b); + } +} + +/** + * Request for getting an account's profile document. + * + * @generated from message com.seed.documents.v2alpha.GetProfileDocumentRequest + */ +export class GetProfileDocumentRequest extends Message { + /** + * Required. ID of the account. + * + * @generated from field: string account_id = 1; + */ + accountId = ""; + + /** + * Optional. Specific version of the profile. If empty, the latest one is returned. + * + * @generated from field: string version = 2; + */ + version = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.GetProfileDocumentRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "account_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetProfileDocumentRequest { + return new GetProfileDocumentRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetProfileDocumentRequest { + return new GetProfileDocumentRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetProfileDocumentRequest { + return new GetProfileDocumentRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetProfileDocumentRequest | PlainMessage | undefined, b: GetProfileDocumentRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetProfileDocumentRequest, a, b); + } +} + +/** + * Used to request the document within the indexes of other documents + * + * @generated from message com.seed.documents.v2alpha.GetDocumentIndexRequest + */ +export class GetDocumentIndexRequest extends Message { + /** + * the parent document ID + * + * @generated from field: string document_id = 1; + */ + documentId = ""; + + /** + * the path of the document which will be retrieved. may include slashes to represent a deep index + * + * @generated from field: string path = 2; + */ + path = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.GetDocumentIndexRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "path", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetDocumentIndexRequest { + return new GetDocumentIndexRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetDocumentIndexRequest { + return new GetDocumentIndexRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetDocumentIndexRequest { + return new GetDocumentIndexRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetDocumentIndexRequest | PlainMessage | undefined, b: GetDocumentIndexRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetDocumentIndexRequest, a, b); + } +} + +/** + * @generated from message com.seed.documents.v2alpha.GetDocumentIndexResponse + */ +export class GetDocumentIndexResponse extends Message { + /** + * id of the parent document + * + * @generated from field: string document_id = 1; + */ + documentId = ""; + + /** + * version of the parent document + * + * @generated from field: string version = 2; + */ + version = ""; + + /** + * path of the child document. may include slashes to represent a deep index + * + * @generated from field: string path = 3; + */ + path = ""; + + /** + * the document at the given path + * + * @generated from field: com.seed.documents.v2alpha.Document document = 4; + */ + document?: Document; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.GetDocumentIndexResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "path", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "document", kind: "message", T: Document }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetDocumentIndexResponse { + return new GetDocumentIndexResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetDocumentIndexResponse { + return new GetDocumentIndexResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetDocumentIndexResponse { + return new GetDocumentIndexResponse().fromJsonString(jsonString, options); + } + + static equals(a: GetDocumentIndexResponse | PlainMessage | undefined, b: GetDocumentIndexResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetDocumentIndexResponse, a, b); + } +} + +/** + * @generated from message com.seed.documents.v2alpha.ChangeDocumentRequest + */ +export class ChangeDocumentRequest extends Message { + /** + * Required. ID of the document to be updated. + * + * @generated from field: string document_id = 1; + */ + documentId = ""; + + /** + * Required. Changes to be applied to the document. + * + * @generated from field: repeated com.seed.documents.v2alpha.DocumentChange changes = 2; + */ + changes: DocumentChange[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.ChangeDocumentRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "changes", kind: "message", T: DocumentChange, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ChangeDocumentRequest { + return new ChangeDocumentRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ChangeDocumentRequest { + return new ChangeDocumentRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ChangeDocumentRequest { + return new ChangeDocumentRequest().fromJsonString(jsonString, options); + } + + static equals(a: ChangeDocumentRequest | PlainMessage | undefined, b: ChangeDocumentRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ChangeDocumentRequest, a, b); + } +} + +/** + * @generated from message com.seed.documents.v2alpha.ChangeProfileDocumentRequest + */ +export class ChangeProfileDocumentRequest extends Message { + /** + * Required. Account ID to update the profile document for. + * + * @generated from field: string account_id = 1; + */ + accountId = ""; + + /** + * Required. Changes to be applied to the profile document. + * + * @generated from field: repeated com.seed.documents.v2alpha.DocumentChange changes = 2; + */ + changes: DocumentChange[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.ChangeProfileDocumentRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "account_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "changes", kind: "message", T: DocumentChange, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ChangeProfileDocumentRequest { + return new ChangeProfileDocumentRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ChangeProfileDocumentRequest { + return new ChangeProfileDocumentRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ChangeProfileDocumentRequest { + return new ChangeProfileDocumentRequest().fromJsonString(jsonString, options); + } + + static equals(a: ChangeProfileDocumentRequest | PlainMessage | undefined, b: ChangeProfileDocumentRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ChangeProfileDocumentRequest, a, b); + } +} + +/** + * Request for getting a single document. + * + * @generated from message com.seed.documents.v2alpha.PushDocumentRequest + */ +export class PushDocumentRequest extends Message { + /** + * Required. ID of the published document to be pushed. + * + * @generated from field: string document_id = 1; + */ + documentId = ""; + + /** + * Required. URL of the gateway to push to. Multiaddress format accepted (comma separated). + * + * @generated from field: string url = 2; + */ + url = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.PushDocumentRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "url", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PushDocumentRequest { + return new PushDocumentRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PushDocumentRequest { + return new PushDocumentRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PushDocumentRequest { + return new PushDocumentRequest().fromJsonString(jsonString, options); + } + + static equals(a: PushDocumentRequest | PlainMessage | undefined, b: PushDocumentRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(PushDocumentRequest, a, b); + } +} + +/** + * Request for listing documents. + * + * @generated from message com.seed.documents.v2alpha.ListDocumentsRequest + */ +export class ListDocumentsRequest extends Message { + /** + * Optional. Number of results per page. Default is defined by the server. + * + * @generated from field: int32 page_size = 1; + */ + pageSize = 0; + + /** + * Optional. Value from next_page_token obtains from a previous response. + * + * @generated from field: string page_token = 2; + */ + pageToken = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.ListDocumentsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "page_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListDocumentsRequest { + return new ListDocumentsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListDocumentsRequest { + return new ListDocumentsRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListDocumentsRequest { + return new ListDocumentsRequest().fromJsonString(jsonString, options); + } + + static equals(a: ListDocumentsRequest | PlainMessage | undefined, b: ListDocumentsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ListDocumentsRequest, a, b); + } +} + +/** + * Response with list of documents. + * + * @generated from message com.seed.documents.v2alpha.ListDocumentsResponse + */ +export class ListDocumentsResponse extends Message { + /** + * List of documents matching the request. + * Only most recent versions are returned. + * Content is omitted, only metadata is present. + * + * @generated from field: repeated com.seed.documents.v2alpha.Document documents = 1; + */ + documents: Document[] = []; + + /** + * Token for the next page if there're more results. + * + * @generated from field: string next_page_token = 2; + */ + nextPageToken = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.ListDocumentsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "documents", kind: "message", T: Document, repeated: true }, + { no: 2, name: "next_page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListDocumentsResponse { + return new ListDocumentsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListDocumentsResponse { + return new ListDocumentsResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListDocumentsResponse { + return new ListDocumentsResponse().fromJsonString(jsonString, options); + } + + static equals(a: ListDocumentsResponse | PlainMessage | undefined, b: ListDocumentsResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ListDocumentsResponse, a, b); + } +} + +/** + * @generated from message com.seed.documents.v2alpha.ListDocumentBranchesRequest + */ +export class ListDocumentBranchesRequest extends Message { + /** + * Required. ID of the document to list branches for. + * + * @generated from field: string document_id = 1; + */ + documentId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.ListDocumentBranchesRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListDocumentBranchesRequest { + return new ListDocumentBranchesRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListDocumentBranchesRequest { + return new ListDocumentBranchesRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListDocumentBranchesRequest { + return new ListDocumentBranchesRequest().fromJsonString(jsonString, options); + } + + static equals(a: ListDocumentBranchesRequest | PlainMessage | undefined, b: ListDocumentBranchesRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ListDocumentBranchesRequest, a, b); + } +} + +/** + * @generated from message com.seed.documents.v2alpha.ListDocumentBranchesResponse + */ +export class ListDocumentBranchesResponse extends Message { + /** + * List of branches for the document. + * + * @generated from field: repeated com.seed.documents.v2alpha.Branch branches = 1; + */ + branches: Branch[] = []; + + /** + * List of drafts for these branches. Includes a draft that will become a draft when published. + * + * @generated from field: repeated com.seed.documents.v2alpha.Draft drafts = 2; + */ + drafts: Draft[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.ListDocumentBranchesResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "branches", kind: "message", T: Branch, repeated: true }, + { no: 2, name: "drafts", kind: "message", T: Draft, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListDocumentBranchesResponse { + return new ListDocumentBranchesResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListDocumentBranchesResponse { + return new ListDocumentBranchesResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListDocumentBranchesResponse { + return new ListDocumentBranchesResponse().fromJsonString(jsonString, options); + } + + static equals(a: ListDocumentBranchesResponse | PlainMessage | undefined, b: ListDocumentBranchesResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ListDocumentBranchesResponse, a, b); + } +} + +/** + * @generated from message com.seed.documents.v2alpha.Branch + */ +export class Branch extends Message { + /** + * ID for use when deleting or publishing the branch + * + * @generated from field: string branch_id = 1; + */ + branchId = ""; + + /** + * ID of the top-level doc which will be updated. For standalone branches this is the doc ID. + * for index branches this is the parent doc ID. + * + * @generated from field: string document_id = 2; + */ + documentId = ""; + + /** + * the path of the document which is being updated. may include slashes to represent a deep index + * + * @generated from field: string path = 3; + */ + path = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.Branch"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "branch_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "path", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Branch { + return new Branch().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Branch { + return new Branch().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Branch { + return new Branch().fromJsonString(jsonString, options); + } + + static equals(a: Branch | PlainMessage | undefined, b: Branch | PlainMessage | undefined): boolean { + return proto3.util.equals(Branch, a, b); + } +} + +/** + * Request for listing documents owned by a given account. + * + * @generated from message com.seed.documents.v2alpha.ListAccountDocumentsRequest + */ +export class ListAccountDocumentsRequest extends Message { + /** + * Optional. Number of results per page. Default is defined by the server. + * + * @generated from field: int32 page_size = 1; + */ + pageSize = 0; + + /** + * Optional. Value from next_page_token obtains from a previous response. + * + * @generated from field: string page_token = 2; + */ + pageToken = ""; + + /** + * Required. Account ID to list documents for. + * + * @generated from field: string account_id = 3; + */ + accountId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.ListAccountDocumentsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "page_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "account_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListAccountDocumentsRequest { + return new ListAccountDocumentsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListAccountDocumentsRequest { + return new ListAccountDocumentsRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListAccountDocumentsRequest { + return new ListAccountDocumentsRequest().fromJsonString(jsonString, options); + } + + static equals(a: ListAccountDocumentsRequest | PlainMessage | undefined, b: ListAccountDocumentsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ListAccountDocumentsRequest, a, b); + } +} + +/** + * Request for merging changes in a document. + * + * @generated from message com.seed.documents.v2alpha.MergeChangesRequest + */ +export class MergeChangesRequest extends Message { + /** + * Required. Document ID from which versions are going to be taken. + * + * @generated from field: string id = 1; + */ + id = ""; + + /** + * Required. Versions to be merged. + * + * @generated from field: repeated string versions = 2; + */ + versions: string[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.MergeChangesRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "versions", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): MergeChangesRequest { + return new MergeChangesRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): MergeChangesRequest { + return new MergeChangesRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): MergeChangesRequest { + return new MergeChangesRequest().fromJsonString(jsonString, options); + } + + static equals(a: MergeChangesRequest | PlainMessage | undefined, b: MergeChangesRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(MergeChangesRequest, a, b); + } +} + +/** + * Request for rebasing changes in a document. + * + * @generated from message com.seed.documents.v2alpha.RebaseChangesRequest + */ +export class RebaseChangesRequest extends Message { + /** + * Required. Draft ID to be rebased. + * + * @generated from field: string base_draft_id = 1; + */ + baseDraftId = ""; + + /** + * Required. Versions to be applied applied on top of the base document. + * + * @generated from field: repeated string versions = 3; + */ + versions: string[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.RebaseChangesRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "base_draft_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "versions", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RebaseChangesRequest { + return new RebaseChangesRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RebaseChangesRequest { + return new RebaseChangesRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RebaseChangesRequest { + return new RebaseChangesRequest().fromJsonString(jsonString, options); + } + + static equals(a: RebaseChangesRequest | PlainMessage | undefined, b: RebaseChangesRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(RebaseChangesRequest, a, b); + } +} + +/** + * @generated from message com.seed.documents.v2alpha.Draft + */ +export class Draft extends Message { + /** + * to identify the draft + * + * @generated from field: string draft_id = 1; + */ + draftId = ""; + + /** + * state of the draft + * + * @generated from field: com.seed.documents.v2alpha.Document document = 2; + */ + document?: Document; + + /** + * True if this is a profile draft + * + * @generated from field: bool is_profile = 3; + */ + isProfile = false; + + /** + * The top-level entity that this draft will update once published. An Account ID for profile drafts, otherwise Document ID. + * + * @generated from field: string entity_id = 4; + */ + entityId = ""; + + /** + * Optional. The path where the draft will be updated once published + * + * @generated from field: string path = 5; + */ + path = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.Draft"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "draft_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "document", kind: "message", T: Document }, + { no: 3, name: "is_profile", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 4, name: "entity_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "path", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Draft { + return new Draft().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Draft { + return new Draft().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Draft { + return new Draft().fromJsonString(jsonString, options); + } + + static equals(a: Draft | PlainMessage | undefined, b: Draft | PlainMessage | undefined): boolean { + return proto3.util.equals(Draft, a, b); + } +} + +/** + * Document represents metadata and content of a document. + * + * @generated from message com.seed.documents.v2alpha.Document + */ +export class Document extends Message { + /** + * Permanent ID of the document. + * + * @generated from field: string id = 1; + */ + id = ""; + + /** + * Output only. Author ID of the document. + * + * @generated from field: string author = 4; + */ + author = ""; + + /** + * Metadata values for a document. + * + * @generated from field: map metadata = 15; + */ + metadata: { [key: string]: string } = {}; + + /** + * Output only. Set to account ID if this is a profile document. + * + * @generated from field: string profile_account_id = 14; + */ + profileAccountId = ""; + + /** + * Output only. Every account ID who has modified the document. + * Includes the original author as well. + * + * @generated from field: repeated string authors = 11; + */ + authors: string[] = []; + + /** + * Blocks content of the document. + * + * @generated from field: repeated com.seed.documents.v2alpha.BlockNode content = 9; + */ + content: BlockNode[] = []; + + /** + * The indexed children documents under this document. + * Keys are used as the path names (and slash "/" is not allowed in the key) + * Values will refer to other documents as exact versions such as "hm://DOC_ID?v=1" + * Values may refer to "latest" versions with "hm://DOC_ID" + * + * @generated from field: map index = 16; + */ + index: { [key: string]: string } = {}; + + /** + * Output only. Time when document was created. + * + * @generated from field: google.protobuf.Timestamp create_time = 6; + */ + createTime?: Timestamp; + + /** + * Output only. Time when document was updated. + * + * @generated from field: google.protobuf.Timestamp update_time = 7; + */ + updateTime?: Timestamp; + + /** + * Output only. Time when this version was published. Not present in drafts. + * + * @generated from field: google.protobuf.Timestamp publish_time = 8; + */ + publishTime?: Timestamp; + + /** + * Output only. Current version of the document. + * + * @generated from field: string version = 12; + */ + version = ""; + + /** + * Output only. Previous version of the document, + * Empty if this is the first version. + * + * @generated from field: string previous_version = 13; + */ + previousVersion = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.Document"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "author", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 15, name: "metadata", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, + { no: 14, name: "profile_account_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 11, name: "authors", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 9, name: "content", kind: "message", T: BlockNode, repeated: true }, + { no: 16, name: "index", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, + { no: 6, name: "create_time", kind: "message", T: Timestamp }, + { no: 7, name: "update_time", kind: "message", T: Timestamp }, + { no: 8, name: "publish_time", kind: "message", T: Timestamp }, + { no: 12, name: "version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 13, name: "previous_version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Document { + return new Document().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Document { + return new Document().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Document { + return new Document().fromJsonString(jsonString, options); + } + + static equals(a: Document | PlainMessage | undefined, b: Document | PlainMessage | undefined): boolean { + return proto3.util.equals(Document, a, b); + } +} + +/** + * Content block with children. + * + * @generated from message com.seed.documents.v2alpha.BlockNode + */ +export class BlockNode extends Message { + /** + * Content block. + * + * @generated from field: com.seed.documents.v2alpha.Block block = 1; + */ + block?: Block; + + /** + * Child blocks. + * + * @generated from field: repeated com.seed.documents.v2alpha.BlockNode children = 2; + */ + children: BlockNode[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.BlockNode"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "block", kind: "message", T: Block }, + { no: 2, name: "children", kind: "message", T: BlockNode, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): BlockNode { + return new BlockNode().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): BlockNode { + return new BlockNode().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): BlockNode { + return new BlockNode().fromJsonString(jsonString, options); + } + + static equals(a: BlockNode | PlainMessage | undefined, b: BlockNode | PlainMessage | undefined): boolean { + return proto3.util.equals(BlockNode, a, b); + } +} + +/** + * Content block. + * + * @generated from message com.seed.documents.v2alpha.Block + */ +export class Block extends Message { + /** + * Block ID. Must be unique within the document. + * + * @generated from field: string id = 1; + */ + id = ""; + + /** + * Type of the block. Specific to the renderer. + * + * @generated from field: string type = 2; + */ + type = ""; + + /** + * Text of the content block. + * + * @generated from field: string text = 3; + */ + text = ""; + + /** + * Optional. The hyperlink to an external resource. + * Must be a valid URL. + * + * @generated from field: string ref = 7; + */ + ref = ""; + + /** + * Arbitrary attributes of the block. + * + * @generated from field: map attributes = 4; + */ + attributes: { [key: string]: string } = {}; + + /** + * Annotation "layers" of the block. + * + * @generated from field: repeated com.seed.documents.v2alpha.Annotation annotations = 5; + */ + annotations: Annotation[] = []; + + /** + * Output only. Current revision of the block. It's the ID of the last Change that modified this block. + * Additional information about the Change can be obtained using the Changes service. + * + * @generated from field: string revision = 6; + */ + revision = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.Block"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "type", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "text", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 7, name: "ref", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "attributes", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, + { no: 5, name: "annotations", kind: "message", T: Annotation, repeated: true }, + { no: 6, name: "revision", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Block { + return new Block().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Block { + return new Block().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Block { + return new Block().fromJsonString(jsonString, options); + } + + static equals(a: Block | PlainMessage | undefined, b: Block | PlainMessage | undefined): boolean { + return proto3.util.equals(Block, a, b); + } +} + +/** + * Conceptual annotation "layer" that is applied to arbitrary spans of block text. + * An "identity" of the layer should be derived deterministically based on its type + * attributes. Spans inside the same annotation can't overlap. + * + * Spans are stored inside the Annotation in a "columnar" format, + * i.e. StructureOfArrays instead of ArrayOfStructures. See: https://en.wikipedia.org/wiki/AoS_and_SoA. + * This is useful to reduce the number of allocations and offers more compact serialization, because + * protobuf is able to "pack" primitive repeated fields more efficiently. + * + * @generated from message com.seed.documents.v2alpha.Annotation + */ +export class Annotation extends Message { + /** + * Type of the annotation. + * + * @generated from field: string type = 1; + */ + type = ""; + + /** + * Optional. A hyperlink to an external resource. + * Must be a valid URL. + * + * @generated from field: string ref = 5; + */ + ref = ""; + + /** + * Arbitrary key-value attributes of the annotation. + * + * @generated from field: map attributes = 2; + */ + attributes: { [key: string]: string } = {}; + + /** + * Start offsets of possibly disjoint spans of text for which this annotation is applied. + * Must be sorted and have the same number of items as `ends` list. + * + * @generated from field: repeated int32 starts = 3; + */ + starts: number[] = []; + + /** + * End offsets of possibly disjoint spans of text for which this annotation is applied. + * Must be sorted and have the same number of items as `starts` list. + * + * @generated from field: repeated int32 ends = 4; + */ + ends: number[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "com.seed.documents.v2alpha.Annotation"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "type", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "ref", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "attributes", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, + { no: 3, name: "starts", kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true }, + { no: 4, name: "ends", kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Annotation { + return new Annotation().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Annotation { + return new Annotation().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Annotation { + return new Annotation().fromJsonString(jsonString, options); + } + + static equals(a: Annotation | PlainMessage | undefined, b: Annotation | PlainMessage | undefined): boolean { + return proto3.util.equals(Annotation, a, b); + } +} + diff --git a/proto/accounts/v1alpha/accounts.proto b/proto/accounts/v1alpha/accounts.proto index 6c13767b9..95fcece10 100644 --- a/proto/accounts/v1alpha/accounts.proto +++ b/proto/accounts/v1alpha/accounts.proto @@ -10,10 +10,21 @@ service Accounts { // Can also be used to retrieve our own account. rpc GetAccount(GetAccountRequest) returns (Account); - // List accounts known to the backend. New accounts can be discovered naturally by + // Updates profile information of our own Account. + // Doesn't support partial updates! + // Users should call GetAccount first, + // change the necessary fields in place, + // and then send the same Profile object back to UpdateProfile. + rpc UpdateProfile(Profile) returns (Account); + + // List accounts known to the backend (excluding our own account). New accounts can be discovered naturally by // interacting with the network, or users can ask to discover specific accounts using // the Networking API. rpc ListAccounts(ListAccountsRequest) returns (ListAccountsResponse); + + // Set or unset the trustness of an account. An account is untrusted by default except for our own. + // Returns the modified account. + rpc SetAccountTrust(SetAccountTrustRequest) returns (Account); } message GetAccountRequest { @@ -34,9 +45,44 @@ message ListAccountsResponse { } message Account { - // Hypermedia Account ID. + // Hyper Media Account ID. string id = 1; - // If there is an unpublished draft for this account's profile document - bool has_profile_draft = 5; + // Profile information of this account. + Profile profile = 2; + + // List of known devices of this Account. + map devices = 3; + + // Defining if the account is trusted or not. + bool is_trusted = 4; +} + +// Profile information of the user Account. +message Profile { + // Optional. Alias is a user-defined handle for their profile. + // There's no enforcement on this being unique. + string alias = 1; + + // Optional. Description of the user's profile. + string bio = 2; + + // Optional. CID to the avatar image hosted on IPFS. + string avatar = 3; + + // Optional. Hypermedia ID of the Account's root/entrypoint document. + string root_document = 4; +} + +message Device { + // CID-encoded Peer ID of this device. + string device_id = 1; } + +message SetAccountTrustRequest { + // ID of the Account to trust/untrust. + string id = 1; + + //Whether to trust or not the account. + bool is_trusted = 2; +} \ No newline at end of file diff --git a/proto/accounts/v1alpha/go.gensum b/proto/accounts/v1alpha/go.gensum index bf3a82977..5b9b42436 100644 --- a/proto/accounts/v1alpha/go.gensum +++ b/proto/accounts/v1alpha/go.gensum @@ -1,2 +1,2 @@ -srcs: 8740ce49201c7b8e34841cd2aeae09b6 -outs: 1040439bf0e8525bf0be2e1d5db18084 +srcs: daccd1f8df9052900983841d5812b8d3 +outs: 5811db25ced28000d8dbbc51d0dcf758 diff --git a/proto/accounts/v1alpha/js.gensum b/proto/accounts/v1alpha/js.gensum index 1ea93bd2c..f5c80e341 100644 --- a/proto/accounts/v1alpha/js.gensum +++ b/proto/accounts/v1alpha/js.gensum @@ -1,2 +1,2 @@ -srcs: 8740ce49201c7b8e34841cd2aeae09b6 -outs: 587a768793b45ab331a4fc66455dade4 +srcs: daccd1f8df9052900983841d5812b8d3 +outs: 26bfe89d00d5e412a9d8e987a5f03cc5 diff --git a/proto/accounts/v2alpha/BUILD.plz b/proto/accounts/v2alpha/BUILD.plz new file mode 100644 index 000000000..e36594c87 --- /dev/null +++ b/proto/accounts/v2alpha/BUILD.plz @@ -0,0 +1,9 @@ +subinclude("//build/rules/seed:defs") + +mtt_proto_codegen( + srcs = glob(["*.proto"]), + languages = [ + "go", + "js", + ], +) diff --git a/proto/accounts/v2alpha/accounts.proto b/proto/accounts/v2alpha/accounts.proto new file mode 100644 index 000000000..7edac66a9 --- /dev/null +++ b/proto/accounts/v2alpha/accounts.proto @@ -0,0 +1,42 @@ +syntax = "proto3"; + +package com.seed.accounts.v2alpha; + +option go_package = "seed/backend/genproto/accounts/v2alpha;accounts"; + +// Accounts API service. +service Accounts { + // Lookup an Account information across the already known accounts. + // Can also be used to retrieve our own account. + rpc GetAccount(GetAccountRequest) returns (Account); + + // List accounts known to the backend. New accounts can be discovered naturally by + // interacting with the network, or users can ask to discover specific accounts using + // the Networking API. + rpc ListAccounts(ListAccountsRequest) returns (ListAccountsResponse); +} + +message GetAccountRequest { + // ID of the Account to be looked up. If empty - our own account will be returned. + string id = 1; +} + +message ListAccountsRequest { + int32 page_size = 1; + + string page_token = 2; +} + +message ListAccountsResponse { + repeated Account accounts = 1; + + string next_page_token = 2; +} + +message Account { + // Hypermedia Account ID. + string id = 1; + + // If there is an unpublished draft for this account's profile document + bool has_profile_draft = 5; +} diff --git a/proto/accounts/v2alpha/go.gensum b/proto/accounts/v2alpha/go.gensum new file mode 100644 index 000000000..2a82c00f1 --- /dev/null +++ b/proto/accounts/v2alpha/go.gensum @@ -0,0 +1,2 @@ +srcs: 9e13368364a3def659e12852c5c1449a +outs: c12f309d9477ee0673706d15233f7526 diff --git a/proto/accounts/v2alpha/js.gensum b/proto/accounts/v2alpha/js.gensum new file mode 100644 index 000000000..1b266aa93 --- /dev/null +++ b/proto/accounts/v2alpha/js.gensum @@ -0,0 +1,2 @@ +srcs: 9e13368364a3def659e12852c5c1449a +outs: 8e87e4c9bbf107914d5718101e45c8d2 diff --git a/proto/documents/v1alpha/documents.proto b/proto/documents/v1alpha/documents.proto index b745e5db4..f86f4f801 100644 --- a/proto/documents/v1alpha/documents.proto +++ b/proto/documents/v1alpha/documents.proto @@ -11,26 +11,14 @@ option go_package = "seed/backend/genproto/documents/v1alpha;documents"; // Drafts service exposes the functionality service Drafts { - // Creates a new draft of an existing standalone branch - rpc CreateDraft(CreateDraftRequest) returns (Draft); - - // Creates a draft for a new branch. - rpc CreateBranchDraft(CreateBranchDraftRequest) returns (Draft); - - // Creates a draft for an index branch. Thows if a draft already exists for this index. - rpc CreateIndexDraft(CreateIndexDraftRequest) returns (Draft); - - // Create a draft for a profile document. Thows if a draft already exists for this profile. - rpc CreateProfileDraft(CreateProfileDraftRequest) returns (Draft); + // Creates a new draft with a new permanent document ID. + rpc CreateDraft(CreateDraftRequest) returns (Document); // Deletes a draft by its document ID. rpc DeleteDraft(DeleteDraftRequest) returns (google.protobuf.Empty); // Gets a single draft if exists. - rpc GetDraft(GetDraftRequest) returns (Draft); - - // Gets a draft for a profile document. - rpc GetProfileDraft(GetProfileDraftRequest) returns (Draft); + rpc GetDraft(GetDraftRequest) returns (Document); // Updates a draft using granular update operations. rpc UpdateDraft(UpdateDraftRequest) returns (UpdateDraftResponse); @@ -41,59 +29,32 @@ service Drafts { // Lists drafts for a given document. rpc ListDocumentDrafts(ListDocumentDraftsRequest) returns (ListDocumentDraftsResponse); - // Publishes a draft. Returns the branch that was published. - rpc PublishDraft(PublishDraftRequest) returns (Branch); + // Publishes a draft. I.e. draft will become a publication, and will no longer appear in drafts section. + rpc PublishDraft(PublishDraftRequest) returns (Publication); } -// Request to create a new draft for an existing standalone branch +// Request to create a new draft. message CreateDraftRequest { - // Required. ID of the document branch that will be updated. - string document_id = 1; -} - -// Request to create a draft for a new standalone branch, optionally based on an existing document. -message CreateBranchDraftRequest { - // Optional. Document which will be branched from. If not specified, a new document will be created. - string document_id = 1; + // Optional. Existing Document ID can be specified to update + // previously published document. A draft will be created + // with the content of the most recent known version. + string existing_document_id = 1; // Optional. Version of the existing document to create draft from. - // If version is specified, document_id must also be specified. + // If version is specified existing_document_id must also be specified. string version = 2; } -// Request to create a new branch which will be saved to the index of another document. -// If this path already exists in the parent, the index will be updated when the draft is published. -// If this path does not exist in the parent, the index will be created when the draft is published. -message CreateIndexDraftRequest { - // Required. ID of the parent document. - string document_id = 1; - - // Required. Path of the document to create a draft for. May include slashes to represent a deep index. - string path = 2; -} - -// Request to create a draft for a profile document. -message CreateProfileDraftRequest { - // Required. Account ID to create a profile draft for. - string account_id = 1; -} - // Request to delete an existing draft. message DeleteDraftRequest { - // Required. ID of the branch to delete. - string branch_id = 1; + // ID of the document whose draft needs to be deleted. Only one + string document_id = 1; } // Request to get a single draft. message GetDraftRequest { - // Required. ID of the draft that was previously created. - string draft_id = 1; -} - -// Request the draft for an account's profile document -message GetProfileDraftRequest { - // Required. Account ID to get the profile draft for. - string account_id = 1; + // ID of the document for which draft was previously created. + string document_id = 1; } // Request to update an existing draft using granular operations. @@ -114,24 +75,6 @@ message UpdateDraftResponse { Document updated_document = 2; } -// Relationship between a document and an account -enum RoleType { - // No permissions. - ROLE_UNSPECIFIED = 0; - - // The role for an owner. All permissions are granted. - OWNER = 1; - - // Allowed to invite/remove writers+collaborators, edit content, and merge suggested changes - EDITOR = 2; - - // Allowed to change content - WRITER = 3; - - // Their comments and suggested changes will be distributed alongside the document - COLLABORATOR = 4; -} - // Granular document change. message DocumentChange { // Operation to move an existing block to a different place in the document. @@ -148,62 +91,18 @@ message DocumentChange { string left_sibling = 3; } - // Operation to replace a metadata field with a new value - message SetMetadata { - // Metadata key to set. - string key = 1; - - // Metadata value to set. - string value = 2; - // "ipfs://ABC" - Use CID as reference material - // "hm://DOC_ID" - Document ID as reference material - // other random data - // "https://example.com" - // DATE FORMAT - } - - // Operation to replace an index field with a new value - message SetIndex { - // Index key to set. - string key = 1; - - // Index value to set. - string value = 2; - // example values - // "DOC_ID" - // "@CHANGE_ID" - // "@CHANGE_ID.CHANGE_ID2" - // "#FRAGMENT" - // "a/ACCOUNT_ID" - } - - // Operation to change membership - message UpdateMember { - // Account ID to update the role for. - string account_id = 1; - - // New role to set for the account. - RoleType role = 2; - } - oneof op { - // New metadata to set on the document. - SetMetadata set_metadata = 1; - - // New index to set on the document. - SetIndex set_index = 2; + // New title to set on the document. + string set_title = 1; // Move operation that creates/moves a block within the document hierarchy. MoveBlock move_block = 3; - + // New block state that replaces an existing block. Block replace_block = 4; - + // ID of a block to delete. string delete_block = 5; - - // Update membership for an account on this document. - UpdateMember update_member = 6; } } @@ -241,101 +140,42 @@ message ListDocumentDraftsResponse { // Request to publish a draft. message PublishDraftRequest { - // ID of the draft to be published. - string draft_id = 1; + // ID of the document which current draft needs to be published. + string document_id = 1; } -// === Documents Service === - -// Documents service provides access to documents. -service Documents { - // Gets a single document. - rpc GetDocument(GetDocumentRequest) returns (Document); +// === Publication Service === - // Gets an account's profile document. - rpc GetProfileDocument(GetProfileDocumentRequest) returns (Document); +// Publications service provides access to published documents. +service Publications { + // Gets a single publication. + rpc GetPublication(GetPublicationRequest) returns (Publication); - // Gets a document within the index(es) of other documents - rpc GetDocumentIndex(GetDocumentIndexRequest) returns (GetDocumentIndexResponse); + // Lists stored publications. Only the most recent versions show up. + rpc ListPublications(ListPublicationsRequest) returns (ListPublicationsResponse); - // Immediately changes a document - rpc ChangeDocument(ChangeDocumentRequest) returns (Document); + // Push Local publication to the gateway. + rpc PushPublication(PushPublicationRequest) returns (google.protobuf.Empty); - // Immediately changes an account's profile document - rpc ChangeProfileDocument(ChangeProfileDocumentRequest) returns (Document); - - // Lists all documents. Only the most recent versions show up. - rpc ListDocuments(ListDocumentsRequest) returns (ListDocumentsResponse); - - // Lists branches of a document. Includes standalone and index branches, and any drafts for these branches - rpc ListDocumentBranches(ListDocumentBranchesRequest) returns (ListDocumentBranchesResponse); - - // Push Local document to the gateway. - rpc PushDocument(PushDocumentRequest) returns (google.protobuf.Empty); - - // Lists documents owned by a given account. - rpc ListAccountDocuments(ListAccountDocumentsRequest) returns (ListDocumentsResponse); + // Lists publications owned by a given account. + rpc ListAccountPublications(ListAccountPublicationsRequest) returns (ListPublicationsResponse); } -// Request for getting a single document. -message GetDocumentRequest { +// Request for getting a single publication. +message GetPublicationRequest { // Required. ID of the published document. string document_id = 1; // Optional. Specific version of the published document. If empty, the latest one is returned. string version = 2; -} - -// Request for getting an account's profile document. -message GetProfileDocumentRequest { - // Required. ID of the account. - string account_id = 1; - - // Optional. Specific version of the profile. If empty, the latest one is returned. - string version = 2; -} - -// Used to request the document within the indexes of other documents -message GetDocumentIndexRequest { - // the parent document ID - string document_id = 1; - - // the path of the document which will be retrieved. may include slashes to represent a deep index - string path = 2; -} - -message GetDocumentIndexResponse { - // id of the parent document - string document_id = 1; - - // version of the parent document - string version = 2; - - // path of the child document. may include slashes to represent a deep index - string path = 3; - - // the document at the given path - Document document = 4; -} - -message ChangeDocumentRequest { - // Required. ID of the document to be updated. - string document_id = 1; - - // Required. Changes to be applied to the document. - repeated DocumentChange changes = 2; -} - -message ChangeProfileDocumentRequest { - // Required. Account ID to update the profile document for. - string account_id = 1; - // Required. Changes to be applied to the profile document. - repeated DocumentChange changes = 2; + // Optional. If true, only local publications will be found. False by default. + // Deprecated: use [Entities.DiscoverEntity] API explicitly instead. + bool local_only = 3; } -// Request for getting a single document. -message PushDocumentRequest { +// Request for getting a single publication. +message PushPublicationRequest { // Required. ID of the published document to be pushed. string document_id = 1; @@ -343,61 +183,40 @@ message PushDocumentRequest { string url = 2; } -// Request for listing documents. -message ListDocumentsRequest { +// Request for listing publications. +message ListPublicationsRequest { // Optional. Number of results per page. Default is defined by the server. int32 page_size = 1; // Optional. Value from next_page_token obtains from a previous response. string page_token = 2; + + // Optional. When provided, the response will only contain + // publications *owned* (created) by trusted accounts of this node. + // By default, it returns all the publications (trusted_only = false) + bool trusted_only = 3; } -// Response with list of documents. -message ListDocumentsResponse { - // List of documents matching the request. +// Response with list of publications. +message ListPublicationsResponse { + // List of publications matching the request. // Only most recent versions are returned. // Content is omitted, only metadata is present. - repeated Document documents = 1; + repeated Publication publications = 1; // Token for the next page if there're more results. string next_page_token = 2; } -message ListDocumentBranchesRequest { - // Required. ID of the document to list branches for. - string document_id = 1; -} - -message ListDocumentBranchesResponse { - // List of branches for the document. - repeated Branch branches = 1; - - // List of drafts for these branches. Includes a draft that will become a draft when published. - repeated Draft drafts = 2; -} - -message Branch { - // ID for use when deleting or publishing the branch - string branch_id = 1; - - // ID of the top-level doc which will be updated. For standalone branches this is the doc ID. - // for index branches this is the parent doc ID. - string document_id = 2; - - // the path of the document which is being updated. may include slashes to represent a deep index - string path = 3; - -} - -// Request for listing documents owned by a given account. -message ListAccountDocumentsRequest { +// Request for listing publications owned by a given account. +message ListAccountPublicationsRequest { // Optional. Number of results per page. Default is defined by the server. int32 page_size = 1; // Optional. Value from next_page_token obtains from a previous response. string page_token = 2; - // Required. Account ID to list documents for. + // Required. Account ID to list publications for. string account_id = 3; } @@ -407,7 +226,7 @@ message ListAccountDocumentsRequest { // Merge service provides access to merge documents. service Merge { // Merge changes and publishes. - rpc MergeChanges(MergeChangesRequest) returns (Document); + rpc MergeChanges(MergeChangesRequest) returns (Publication); // Rebase changes rpc RebaseChanges(RebaseChangesRequest) returns (Document); @@ -433,49 +252,35 @@ message RebaseChangesRequest { // === Types === -message Draft { - // to identify the draft - string draft_id = 1; +// State of the document after publication. +// Deprecated: use the Document message instead, +// it has all the same fields. +message Publication { + // Version points to the state of the publication at some point in time. + // Deprecated: use the version field of the Document message instead. + string version = 1; - // state of the draft + // Published document. Document document = 2; - - // True if this is a profile draft - bool is_profile = 3; - - // The top-level entity that this draft will update once published. An Account ID for profile drafts, otherwise Document ID. - string entity_id = 4; - - // Optional. The path where the draft will be updated once published - string path = 5; } -// Document represents metadata and content of a document. +// Document represents metadata and content of a draft or publication. message Document { // Permanent ID of the document. string id = 1; + // Title of the document. + string title = 2; + // Output only. Author ID of the document. string author = 4; - // Metadata values for a document. - map metadata = 15; - - // Output only. Set to account ID if this is a profile document. - string profile_account_id = 14; - - // Output only. Every account ID who has modified the document. + // Output only. Account IDs of all the editors of the document. // Includes the original author as well. - repeated string authors = 11; - - // Blocks content of the document. - repeated BlockNode content = 9; + repeated string editors = 11; - // The indexed children documents under this document. - // Keys are used as the path names (and slash "/" is not allowed in the key) - // Values will refer to other documents as exact versions such as "hm://DOC_ID?v=1" - // Values may refer to "latest" versions with "hm://DOC_ID" - map index = 16; + // This is WIP feature for block-aware API. It will supersede the `content` field. + repeated BlockNode children = 9; // Output only. Time when document was created. google.protobuf.Timestamp create_time = 6; @@ -490,7 +295,7 @@ message Document { string version = 12; // Output only. Previous version of the document, - // Empty if this is the first version. + // unless this is the first version. string previous_version = 13; } diff --git a/proto/documents/v1alpha/go.gensum b/proto/documents/v1alpha/go.gensum index d284eb635..1774dd7f1 100644 --- a/proto/documents/v1alpha/go.gensum +++ b/proto/documents/v1alpha/go.gensum @@ -1,2 +1,2 @@ -srcs: 9891b0fe73a4a5d7807796d5d5d51bc5 -outs: 6fd8b6b13fc0107e3977ff476a24ef22 +srcs: 9fd693fc4ba51c19fefc266ae72757c2 +outs: 23217020d715340822f256a4866120dc diff --git a/proto/documents/v1alpha/js.gensum b/proto/documents/v1alpha/js.gensum index eb590de63..7cf8de8b9 100644 --- a/proto/documents/v1alpha/js.gensum +++ b/proto/documents/v1alpha/js.gensum @@ -1,2 +1,2 @@ -srcs: 9891b0fe73a4a5d7807796d5d5d51bc5 -outs: 5ed48adb184263df2401b1bf71ea4e36 +srcs: 9fd693fc4ba51c19fefc266ae72757c2 +outs: 78787672576066611663d855f9d68548 diff --git a/proto/documents/v2alpha/BUILD.plz b/proto/documents/v2alpha/BUILD.plz new file mode 100644 index 000000000..e36594c87 --- /dev/null +++ b/proto/documents/v2alpha/BUILD.plz @@ -0,0 +1,9 @@ +subinclude("//build/rules/seed:defs") + +mtt_proto_codegen( + srcs = glob(["*.proto"]), + languages = [ + "go", + "js", + ], +) diff --git a/proto/documents/v2alpha/changes.proto b/proto/documents/v2alpha/changes.proto new file mode 100644 index 000000000..fac8620e8 --- /dev/null +++ b/proto/documents/v2alpha/changes.proto @@ -0,0 +1,65 @@ +// Deprecated. Use Entities API instead. + +syntax = "proto3"; + +package com.seed.documents.v2alpha; + +import "google/protobuf/timestamp.proto"; + +option go_package = "seed/backend/genproto/documents/v2alpha;documents"; + +// Changes service provides information about the atomic version controlled changes of Seed objects. +service Changes { + // Returns information about a single change. + rpc GetChangeInfo(GetChangeInfoRequest) returns (ChangeInfo); + + // List changes of a given object. + rpc ListChanges(ListChangesRequest) returns (ListChangesResponse); +} + +// Request for getting change info. +message GetChangeInfoRequest { + // ID of the Change. + string id = 1; +} + +// Request to list changes. +message ListChangesRequest { + // Required. ID of the Seed object to list changes for. + string document_id = 1; + + // Optional. Number of results per page. + int32 page_size = 2; + + // Optional. Token for the page to return. + string page_token = 3; +} + +// Response with a list of changes. +message ListChangesResponse { + // List of changes matching the request. + repeated ChangeInfo changes = 1; + + // Token for the next page if there's any. + string next_page_token = 2; +} + +// Metadata about a single Change. +message ChangeInfo { + // ID of the Change. + string id = 1; + + // Author of the Change. + string author = 2; + + // Time when this change was recorded by the author. + google.protobuf.Timestamp create_time = 3; + + // The document version ID corresponding to this changes. + // + // TODO(burdiyan): after the breaking change the change ID can be used directly as version. + string version = 4; + + // IDs of other Changes that are dependencies of this Change. + repeated string deps = 5; +} diff --git a/proto/documents/v2alpha/comments.proto b/proto/documents/v2alpha/comments.proto new file mode 100644 index 000000000..03f0638f9 --- /dev/null +++ b/proto/documents/v2alpha/comments.proto @@ -0,0 +1,93 @@ +syntax = "proto3"; + +package com.seed.documents.v2alpha; + +import "documents/v2alpha/documents.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "seed/backend/genproto/documents/v2alpha;documents"; + +// Comments service allows users to add comments to documents. +service Comments { + // Creates a new comment. + rpc CreateComment(CreateCommentRequest) returns (Comment); + + // Gets a single comment by ID. + rpc GetComment(GetCommentRequest) returns (Comment); + + // Lists comments for a given target. + rpc ListComments(ListCommentsRequest) returns (ListCommentsResponse); +} + +// Request to create a comment. +message CreateCommentRequest { + // Required. The URI of the target hypermedia resource which is being commented. + // It's best to use versioned URIs to propagate better context and intent, + // even if the comments are eventually "overlaid" onto the newer versions of the resource. + string target = 1; + + // Optional. If a comment is a reply to another comment, this must be the ID of the replied comment. + // The target of the reply and the replied comment must be the same + // (although version could differ if the reply is made reading a newer version of the document). + string replied_comment = 2; + + // Required. Content of the comment. + repeated BlockNode content = 3; +} + +// Request to get a comment. +message GetCommentRequest { + // Required. ID of the comment to retrieve. + string id = 1; +} + +// Request to list comments. +message ListCommentsRequest { + // Required. The URI of the target resource for which comments should be listed. + string target = 1; + + // Optional. The maximum number of comments to return. + int32 page_size = 2; + + // Optional. The page token obtained from a previous request (if any). + string page_token = 3; +} + +// Response with a list of comments. +message ListCommentsResponse { + // List of comments. + repeated Comment comments = 1; + + // Token to retrieve the next page of comments (if necessary). + string next_page_token = 2; +} + +// Comment is a unit of discussion. +// Comments are created targeting some hypermedia resource (ideally with a versioned link). +// Replies are created targeting the same resource, in addition to pointing to the comment they are replying to. +message Comment { + // ID of the current comment. + string id = 1; + + // The URI of the target resource which the comment is attached to. + // This is normally a Hypermedia Document, but potentially can be anything. + // Reply comments should share the same target as the comment they are replying to, + // but could potentially point to a different version. + string target = 2; + + // The ID of the top-level non-reply comment of the conversation thread. + string thread_root = 3; + + // The ID of the comment to which this comment is a reply. + // For initial comments this field is empty. + string replied_comment = 4; + + // Account ID of the author of the comment. + string author = 5; + + // Content of the comment. + repeated BlockNode content = 6; + + // Timestamp when the comment was created. + google.protobuf.Timestamp create_time = 7; +} diff --git a/proto/documents/v2alpha/content_graph.proto b/proto/documents/v2alpha/content_graph.proto new file mode 100644 index 000000000..9cb457e16 --- /dev/null +++ b/proto/documents/v2alpha/content_graph.proto @@ -0,0 +1,49 @@ +syntax = "proto3"; + +package com.seed.documents.v2alpha; + +option go_package = "seed/backend/genproto/documents/v2alpha;documents"; + +// Content graph service provides access to citations (backlinks). +service ContentGraph { + rpc ListCitations(ListCitationsRequest) returns (ListCitationsResponse); +} + +message ListCitationsRequest { + // Required. Document ID for which citations need to be retrieved. + string document_id = 1; +} + +// Response with citations. +message ListCitationsResponse { + // List of links that point to the requested document, recursively, according to the requested depth. + repeated Link links = 1; +} + +// Description of a link inside a document. +message Link { + // Required. Describes where link originates from. + LinkNode source = 1; + + // Required. Describes where link points to. + // Here the block_id is optional, because the whole document can be linked. + LinkNode target = 2; + + // Indicates whether the link targets the latest version of the document. + // Notice that the target link node might still have a version specified, + // which has to be treated as a frame of reference, i.e. "this version or newer" + // if is_latest is true. + bool is_latest = 3; +} + +// Describes "sides" of a Link. +message LinkNode { + // ID of the document on one side of a Link. + string document_id = 1; + + // Version of the document. + string version = 2; + + // ID of the block inside the document. + string block_id = 3; +} diff --git a/proto/documents/v2alpha/documents.proto b/proto/documents/v2alpha/documents.proto new file mode 100644 index 000000000..5cbb2b28f --- /dev/null +++ b/proto/documents/v2alpha/documents.proto @@ -0,0 +1,556 @@ +syntax = "proto3"; + +package com.seed.documents.v2alpha; + +import "google/protobuf/timestamp.proto"; +import "google/protobuf/empty.proto"; + +option go_package = "seed/backend/genproto/documents/v2alpha;documents"; + +// === Draft Service === + +// Drafts service exposes the functionality +service Drafts { + // Creates a new draft of an existing standalone branch + rpc CreateDraft(CreateDraftRequest) returns (Draft); + + // Creates a draft for a new branch. + rpc CreateBranchDraft(CreateBranchDraftRequest) returns (Draft); + + // Creates a draft for an index branch. Thows if a draft already exists for this index. + rpc CreateIndexDraft(CreateIndexDraftRequest) returns (Draft); + + // Create a draft for a profile document. Thows if a draft already exists for this profile. + rpc CreateProfileDraft(CreateProfileDraftRequest) returns (Draft); + + // Deletes a draft by its document ID. + rpc DeleteDraft(DeleteDraftRequest) returns (google.protobuf.Empty); + + // Gets a single draft if exists. + rpc GetDraft(GetDraftRequest) returns (Draft); + + // Gets a draft for a profile document. + rpc GetProfileDraft(GetProfileDraftRequest) returns (Draft); + + // Updates a draft using granular update operations. + rpc UpdateDraft(UpdateDraftRequest) returns (UpdateDraftResponse); + + // List currently stored drafts. + rpc ListDrafts(ListDraftsRequest) returns (ListDraftsResponse); + + // Lists drafts for a given document. + rpc ListDocumentDrafts(ListDocumentDraftsRequest) returns (ListDocumentDraftsResponse); + + // Publishes a draft. Returns the branch that was published. + rpc PublishDraft(PublishDraftRequest) returns (Branch); +} + +// Request to create a new draft for an existing standalone branch +message CreateDraftRequest { + // Required. ID of the document branch that will be updated. + string document_id = 1; +} + +// Request to create a draft for a new standalone branch, optionally based on an existing document. +message CreateBranchDraftRequest { + // Optional. Document which will be branched from. If not specified, a new document will be created. + string document_id = 1; + + // Optional. Version of the existing document to create draft from. + // If version is specified, document_id must also be specified. + string version = 2; +} + +// Request to create a new branch which will be saved to the index of another document. +// If this path already exists in the parent, the index will be updated when the draft is published. +// If this path does not exist in the parent, the index will be created when the draft is published. +message CreateIndexDraftRequest { + // Required. ID of the parent document. + string document_id = 1; + + // Required. Path of the document to create a draft for. May include slashes to represent a deep index. + string path = 2; +} + +// Request to create a draft for a profile document. +message CreateProfileDraftRequest { + // Required. Account ID to create a profile draft for. + string account_id = 1; +} + +// Request to delete an existing draft. +message DeleteDraftRequest { + // Required. ID of the branch to delete. + string branch_id = 1; +} + +// Request to get a single draft. +message GetDraftRequest { + // Required. ID of the draft that was previously created. + string draft_id = 1; +} + +// Request the draft for an account's profile document +message GetProfileDraftRequest { + // Required. Account ID to get the profile draft for. + string account_id = 1; +} + +// Request to update an existing draft using granular operations. +message UpdateDraftRequest { + // ID of the document to be updated. + string document_id = 3; + + // List of document changes that must be applied to the existing document. + repeated DocumentChange changes = 4; +} + +// Response after draft is updated. +message UpdateDraftResponse { + // The ID of the change representing the draft version after the update is processed. + string change_id = 1; + + // The state of the document after the update. + Document updated_document = 2; +} + +// Relationship between a document and an account +enum RoleType { + // No permissions. + ROLE_UNSPECIFIED = 0; + + // The role for an owner. All permissions are granted. + OWNER = 1; + + // Allowed to invite/remove writers+collaborators, edit content, and merge suggested changes + EDITOR = 2; + + // Allowed to change content + WRITER = 3; + + // Their comments and suggested changes will be distributed alongside the document + COLLABORATOR = 4; +} + +// Granular document change. +message DocumentChange { + // Operation to move an existing block to a different place in the document. + // Move and Create operations are both expressed with this. + // Conceptually new blocks are moved out of nowhere into the document. + message MoveBlock { + // ID of the block to move. + string block_id = 1; + + // ID of the new parent for the block being moved. + string parent = 2; + + // ID of the new left sibling for the block being moved. + string left_sibling = 3; + } + + // Operation to replace a metadata field with a new value + message SetMetadata { + // Metadata key to set. + string key = 1; + + // Metadata value to set. + string value = 2; + // "ipfs://ABC" - Use CID as reference material + // "hm://DOC_ID" - Document ID as reference material + // other random data + // "https://example.com" + // DATE FORMAT + } + + // Operation to replace an index field with a new value + message SetIndex { + // Index key to set. + string key = 1; + + // Index value to set. + string value = 2; + // example values + // "DOC_ID" + // "@CHANGE_ID" + // "@CHANGE_ID.CHANGE_ID2" + // "#FRAGMENT" + // "a/ACCOUNT_ID" + } + + // Operation to change membership + message UpdateMember { + // Account ID to update the role for. + string account_id = 1; + + // New role to set for the account. + RoleType role = 2; + } + + oneof op { + // New metadata to set on the document. + SetMetadata set_metadata = 1; + + // New index to set on the document. + SetIndex set_index = 2; + + // Move operation that creates/moves a block within the document hierarchy. + MoveBlock move_block = 3; + + // New block state that replaces an existing block. + Block replace_block = 4; + + // ID of a block to delete. + string delete_block = 5; + + // Update membership for an account on this document. + UpdateMember update_member = 6; + } +} + +// Request to list stored drafts. +message ListDraftsRequest { + // Optional. Number of results per page. + int32 page_size = 1; + + // Optional. Token for the page to return. + string page_token = 2; +} + +// Response for listing drafts. +message ListDraftsResponse { + // Drafts matching the list request. + // Content is omitted. + repeated Document documents = 1; + + // Token for the next page if there's any. + string next_page_token = 2; +} + +// Request to list document drafts. +message ListDocumentDraftsRequest { + // ID of the document to list drafts for. + string document_id = 1; +} + +// Response with the list of drafts for a given document ID. +message ListDocumentDraftsResponse { + // Drafts come without content, only metadata, + // similar to the rest of list responses. + repeated Document drafts = 1; +} + +// Request to publish a draft. +message PublishDraftRequest { + // ID of the draft to be published. + string draft_id = 1; +} + +// === Documents Service === + +// Documents service provides access to documents. +service Documents { + // Gets a single document. + rpc GetDocument(GetDocumentRequest) returns (Document); + + // Gets an account's profile document. + rpc GetProfileDocument(GetProfileDocumentRequest) returns (Document); + + // Gets a document within the index(es) of other documents + rpc GetDocumentIndex(GetDocumentIndexRequest) returns (GetDocumentIndexResponse); + + // Immediately changes a document + rpc ChangeDocument(ChangeDocumentRequest) returns (Document); + + // Immediately changes an account's profile document + rpc ChangeProfileDocument(ChangeProfileDocumentRequest) returns (Document); + + // Lists all documents. Only the most recent versions show up. + rpc ListDocuments(ListDocumentsRequest) returns (ListDocumentsResponse); + + // Lists branches of a document. Includes standalone and index branches, and any drafts for these branches + rpc ListDocumentBranches(ListDocumentBranchesRequest) returns (ListDocumentBranchesResponse); + + // Push Local document to the gateway. + rpc PushDocument(PushDocumentRequest) returns (google.protobuf.Empty); + + // Lists documents owned by a given account. + rpc ListAccountDocuments(ListAccountDocumentsRequest) returns (ListDocumentsResponse); +} + +// Request for getting a single document. +message GetDocumentRequest { + // Required. ID of the published document. + string document_id = 1; + + // Optional. Specific version of the published document. If empty, the latest one is returned. + string version = 2; +} + +// Request for getting an account's profile document. +message GetProfileDocumentRequest { + // Required. ID of the account. + string account_id = 1; + + // Optional. Specific version of the profile. If empty, the latest one is returned. + string version = 2; +} + +// Used to request the document within the indexes of other documents +message GetDocumentIndexRequest { + // the parent document ID + string document_id = 1; + + // the path of the document which will be retrieved. may include slashes to represent a deep index + string path = 2; +} + +message GetDocumentIndexResponse { + // id of the parent document + string document_id = 1; + + // version of the parent document + string version = 2; + + // path of the child document. may include slashes to represent a deep index + string path = 3; + + // the document at the given path + Document document = 4; +} + +message ChangeDocumentRequest { + // Required. ID of the document to be updated. + string document_id = 1; + + // Required. Changes to be applied to the document. + repeated DocumentChange changes = 2; +} + +message ChangeProfileDocumentRequest { + // Required. Account ID to update the profile document for. + string account_id = 1; + + // Required. Changes to be applied to the profile document. + repeated DocumentChange changes = 2; +} + +// Request for getting a single document. +message PushDocumentRequest { + // Required. ID of the published document to be pushed. + string document_id = 1; + + // Required. URL of the gateway to push to. Multiaddress format accepted (comma separated). + string url = 2; +} + +// Request for listing documents. +message ListDocumentsRequest { + // Optional. Number of results per page. Default is defined by the server. + int32 page_size = 1; + + // Optional. Value from next_page_token obtains from a previous response. + string page_token = 2; +} + +// Response with list of documents. +message ListDocumentsResponse { + // List of documents matching the request. + // Only most recent versions are returned. + // Content is omitted, only metadata is present. + repeated Document documents = 1; + + // Token for the next page if there're more results. + string next_page_token = 2; +} + +message ListDocumentBranchesRequest { + // Required. ID of the document to list branches for. + string document_id = 1; +} + +message ListDocumentBranchesResponse { + // List of branches for the document. + repeated Branch branches = 1; + + // List of drafts for these branches. Includes a draft that will become a draft when published. + repeated Draft drafts = 2; +} + +message Branch { + // ID for use when deleting or publishing the branch + string branch_id = 1; + + // ID of the top-level doc which will be updated. For standalone branches this is the doc ID. + // for index branches this is the parent doc ID. + string document_id = 2; + + // the path of the document which is being updated. may include slashes to represent a deep index + string path = 3; +} + +// Request for listing documents owned by a given account. +message ListAccountDocumentsRequest { + // Optional. Number of results per page. Default is defined by the server. + int32 page_size = 1; + + // Optional. Value from next_page_token obtains from a previous response. + string page_token = 2; + + // Required. Account ID to list documents for. + string account_id = 3; +} + +// === Merge Service === + +// Merge service provides access to merge documents. +service Merge { + // Merge changes and publishes. + rpc MergeChanges(MergeChangesRequest) returns (Document); + + // Rebase changes + rpc RebaseChanges(RebaseChangesRequest) returns (Document); +} + +// Request for merging changes in a document. +message MergeChangesRequest { + // Required. Document ID from which versions are going to be taken. + string id = 1; + + // Required. Versions to be merged. + repeated string versions = 2; +} + +// Request for rebasing changes in a document. +message RebaseChangesRequest { + // Required. Draft ID to be rebased. + string base_draft_id = 1; + + // Required. Versions to be applied applied on top of the base document. + repeated string versions = 3; +} + +// === Types === + +message Draft { + // to identify the draft + string draft_id = 1; + + // state of the draft + Document document = 2; + + // True if this is a profile draft + bool is_profile = 3; + + // The top-level entity that this draft will update once published. An Account ID for profile drafts, otherwise Document ID. + string entity_id = 4; + + // Optional. The path where the draft will be updated once published + string path = 5; +} + +// Document represents metadata and content of a document. +message Document { + // Permanent ID of the document. + string id = 1; + + // Output only. Author ID of the document. + string author = 4; + + // Metadata values for a document. + map metadata = 15; + + // Output only. Set to account ID if this is a profile document. + string profile_account_id = 14; + + // Output only. Every account ID who has modified the document. + // Includes the original author as well. + repeated string authors = 11; + + // Blocks content of the document. + repeated BlockNode content = 9; + + // The indexed children documents under this document. + // Keys are used as the path names (and slash "/" is not allowed in the key) + // Values will refer to other documents as exact versions such as "hm://DOC_ID?v=1" + // Values may refer to "latest" versions with "hm://DOC_ID" + map index = 16; + + // Output only. Time when document was created. + google.protobuf.Timestamp create_time = 6; + + // Output only. Time when document was updated. + google.protobuf.Timestamp update_time = 7; + + // Output only. Time when this version was published. Not present in drafts. + google.protobuf.Timestamp publish_time = 8; + + // Output only. Current version of the document. + string version = 12; + + // Output only. Previous version of the document, + // Empty if this is the first version. + string previous_version = 13; +} + +// Content block with children. +message BlockNode { + // Content block. + Block block = 1; + + // Child blocks. + repeated BlockNode children = 2; +} + +// Content block. +message Block { + // Block ID. Must be unique within the document. + string id = 1; + + // Type of the block. Specific to the renderer. + string type = 2; + + // Text of the content block. + string text = 3; + + // Optional. The hyperlink to an external resource. + // Must be a valid URL. + string ref = 7; + + // Arbitrary attributes of the block. + map attributes = 4; + + // Annotation "layers" of the block. + repeated Annotation annotations = 5; + + // Output only. Current revision of the block. It's the ID of the last Change that modified this block. + // Additional information about the Change can be obtained using the Changes service. + string revision = 6; +} + +// Conceptual annotation "layer" that is applied to arbitrary spans of block text. +// An "identity" of the layer should be derived deterministically based on its type +// attributes. Spans inside the same annotation can't overlap. +// +// Spans are stored inside the Annotation in a "columnar" format, +// i.e. StructureOfArrays instead of ArrayOfStructures. See: https://en.wikipedia.org/wiki/AoS_and_SoA. +// This is useful to reduce the number of allocations and offers more compact serialization, because +// protobuf is able to "pack" primitive repeated fields more efficiently. +message Annotation { + // Type of the annotation. + string type = 1; + + // Optional. A hyperlink to an external resource. + // Must be a valid URL. + string ref = 5; + + // Arbitrary key-value attributes of the annotation. + map attributes = 2; + + // Start offsets of possibly disjoint spans of text for which this annotation is applied. + // Must be sorted and have the same number of items as `ends` list. + repeated int32 starts = 3; + + // End offsets of possibly disjoint spans of text for which this annotation is applied. + // Must be sorted and have the same number of items as `starts` list. + repeated int32 ends = 4; +} diff --git a/proto/documents/v2alpha/go.gensum b/proto/documents/v2alpha/go.gensum new file mode 100644 index 000000000..c3dad7715 --- /dev/null +++ b/proto/documents/v2alpha/go.gensum @@ -0,0 +1,2 @@ +srcs: 36e3c2787760a489c37bd078bd1fe93f +outs: c54c9976fb4e4c82a165240ff8f9a745 diff --git a/proto/documents/v2alpha/js.gensum b/proto/documents/v2alpha/js.gensum new file mode 100644 index 000000000..a65c8a5a8 --- /dev/null +++ b/proto/documents/v2alpha/js.gensum @@ -0,0 +1,2 @@ +srcs: 36e3c2787760a489c37bd078bd1fe93f +outs: a1e46561f017d1a111cde85c1c05cfd9