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/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/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/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/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/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 diff --git a/yarn.lock b/yarn.lock index f5ee3adde..64a308265 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6547,76 +6547,6 @@ __metadata: languageName: unknown linkType: soft -"@shm/editor@workspace:frontend/packages/editor": - version: 0.0.0-use.local - resolution: "@shm/editor@workspace:frontend/packages/editor" - dependencies: - "@emotion/cache": 11.11.0 - "@emotion/react": 11.11.1 - "@emotion/serialize": 1.1.2 - "@emotion/utils": 1.2.1 - "@mantine/core": 6.0.13 - "@mantine/hooks": 6.0.13 - "@radix-ui/colors": 0.1.9 - "@sentry/tracing": 7.49.0 - "@shm/prettier": "*" - "@shm/shared": "*" - "@shm/ui": "*" - "@tamagui/lucide-icons": 1.90.2 - "@tippyjs/react": 4.2.6 - "@tiptap/core": 2.0.3 - "@tiptap/extension-bold": 2.0.3 - "@tiptap/extension-code": 2.0.3 - "@tiptap/extension-collaboration": 2.0.3 - "@tiptap/extension-collaboration-cursor": 2.0.3 - "@tiptap/extension-dropcursor": 2.0.3 - "@tiptap/extension-gapcursor": 2.0.3 - "@tiptap/extension-hard-break": 2.0.3 - "@tiptap/extension-history": 2.0.3 - "@tiptap/extension-italic": 2.0.3 - "@tiptap/extension-strike": 2.0.3 - "@tiptap/extension-text": 2.0.3 - "@tiptap/extension-underline": 2.0.3 - "@tiptap/pm": 2.0.3 - "@tiptap/react": 2.0.3 - "@types/prosemirror-dev-tools": 3.0.3 - "@types/react": 18.2.21 - "@types/react-dom": 18.2.7 - happy-dom: 7.8.1 - hast-util-from-dom: 4.2.0 - highlight.js: 11.9.0 - jsdom: 22.1.0 - katex: ^0.16.9 - linkifyjs: 4.1.1 - lowlight: 3.1.0 - nanoid: 4.0.2 - nostr-tools: 1.16.0 - prettier: 3.0.2 - prosemirror-dev-tools: 4.0.0 - prosemirror-state: 1.4.3 - react: 18.2.0 - react-dom: 18.2.0 - react-error-boundary: 4.0.11 - react-icons: 4.9.0 - react-tweet: ^3.2.0 - rehype: 12.0.1 - rehype-parse: 8.0.4 - rehype-remark: 9.1.2 - rehype-stringify: 9.0.3 - remark-gfm: 3.0.1 - remark-parse: 10.0.1 - remark-rehype: 10.1.0 - remark-stringify: 10.0.2 - typescript: 5.5.1-rc - unified: 10.1.2 - use-prefers-color-scheme: 1.1.3 - vitest: 0.34.2 - y-prosemirror: 1.2.1 - y-protocols: 1.0.5 - yjs: 13.6.4 - languageName: unknown - linkType: soft - "@shm/prettier@*, @shm/prettier@workspace:frontend/packages/prettier-config": version: 0.0.0-use.local resolution: "@shm/prettier@workspace:frontend/packages/prettier-config"