1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-09 17:44:59 +09:00

add field to export

This commit is contained in:
Roman Khafizianov 2023-04-25 18:17:59 +02:00 committed by Mikhail Iudin
parent 71df5a648e
commit 7c9e5f49df
No known key found for this signature in database
GPG key ID: FAAAA8BAABDFF1C0
4 changed files with 78 additions and 24 deletions

View file

@ -453,6 +453,7 @@ func (e *export) createProfileFile(wr writer) error {
Avatar: localProfile.IconImage,
Address: localProfile.AccountAddr,
ProfileId: e.a.ProfileID(), // save profile id to restore user profile during import
AnalyticsId: pr.AccountAddr,
}
data, err := profile.Marshal()
if err != nil {

View file

@ -10650,7 +10650,6 @@ Deletes the object, keys from the local store and unsubscribe from remote change
| error | [Rpc.Object.ListExport.Response.Error](#anytype.Rpc.Object.ListExport.Response.Error) | | |
| path | [string](#string) | | |
| succeed | [int32](#int32) | | |
| failed | [int32](#int32) | | |
| event | [ResponseEvent](#anytype.ResponseEvent) | | |
@ -19438,6 +19437,7 @@ Precondition: user A and user B opened the same block
| avatar | [string](#string) | | |
| address | [string](#string) | | |
| profileId | [string](#string) | | |
| analyticsId | [string](#string) | | |

View file

@ -15,4 +15,5 @@ message Profile {
string avatar = 2;
string address = 4;
string profileId = 6;
string analyticsId = 7;
}

View file

@ -76,10 +76,11 @@ func (m *SnapshotWithType) GetSnapshot() *ChangeSnapshot {
}
type Profile struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Avatar string `protobuf:"bytes,2,opt,name=avatar,proto3" json:"avatar,omitempty"`
Address string `protobuf:"bytes,4,opt,name=address,proto3" json:"address,omitempty"`
ProfileId string `protobuf:"bytes,6,opt,name=profileId,proto3" json:"profileId,omitempty"`
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Avatar string `protobuf:"bytes,2,opt,name=avatar,proto3" json:"avatar,omitempty"`
Address string `protobuf:"bytes,4,opt,name=address,proto3" json:"address,omitempty"`
ProfileId string `protobuf:"bytes,6,opt,name=profileId,proto3" json:"profileId,omitempty"`
AnalyticsId string `protobuf:"bytes,7,opt,name=analyticsId,proto3" json:"analyticsId,omitempty"`
}
func (m *Profile) Reset() { *m = Profile{} }
@ -143,6 +144,13 @@ func (m *Profile) GetProfileId() string {
return ""
}
func (m *Profile) GetAnalyticsId() string {
if m != nil {
return m.AnalyticsId
}
return ""
}
func init() {
proto.RegisterType((*SnapshotWithType)(nil), "anytype.SnapshotWithType")
proto.RegisterType((*Profile)(nil), "anytype.Profile")
@ -151,25 +159,26 @@ func init() {
func init() { proto.RegisterFile("pb/protos/snapshot.proto", fileDescriptor_022f1596c727bff6) }
var fileDescriptor_022f1596c727bff6 = []byte{
// 277 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x44, 0x90, 0xc1, 0x4a, 0xc3, 0x30,
0x1c, 0xc6, 0x9b, 0x31, 0x5a, 0x1b, 0x41, 0x24, 0x07, 0x0d, 0x63, 0x86, 0x31, 0x3c, 0xec, 0xd4,
0xc0, 0xd4, 0x17, 0x98, 0x27, 0x6f, 0xd2, 0x09, 0x82, 0xb7, 0x64, 0x8d, 0x6b, 0x59, 0xdb, 0x84,
0x24, 0x08, 0x3d, 0xf9, 0x0a, 0x3e, 0x96, 0xc7, 0x1d, 0x3d, 0x4a, 0xfb, 0x22, 0x63, 0x69, 0xba,
0xdd, 0xfe, 0x5f, 0xbe, 0xef, 0xff, 0xfb, 0xc2, 0x1f, 0x62, 0xc5, 0xa9, 0xd2, 0xd2, 0x4a, 0x43,
0x4d, 0xcd, 0x94, 0xc9, 0xa5, 0x4d, 0x9c, 0x46, 0x11, 0xab, 0x1b, 0xdb, 0x28, 0x31, 0xb9, 0x57,
0xbb, 0x2d, 0x2d, 0x0b, 0x4e, 0x15, 0xa7, 0x95, 0xcc, 0x44, 0x39, 0x2c, 0x38, 0x61, 0xfa, 0xf8,
0xe4, 0xf6, 0x0c, 0xda, 0xe4, 0xac, 0xde, 0x0a, 0x6f, 0xcc, 0xbf, 0xe1, 0xf5, 0xda, 0x93, 0xdf,
0x0b, 0x9b, 0xbf, 0x35, 0x4a, 0xa0, 0x27, 0x18, 0x1a, 0x7e, 0x9c, 0x30, 0x98, 0x81, 0xc5, 0xd5,
0xf2, 0x2e, 0xf1, 0x65, 0x89, 0x63, 0x26, 0xeb, 0x8a, 0x69, 0xbb, 0x2a, 0xe5, 0x66, 0x77, 0x0c,
0xa5, 0x3e, 0x8c, 0x1e, 0xe1, 0xc5, 0xf0, 0x49, 0x3c, 0x9a, 0x81, 0xc5, 0xe5, 0x12, 0x9f, 0x16,
0x9f, 0x5d, 0x69, 0x32, 0x54, 0xa5, 0xa7, 0xe4, 0xbc, 0x82, 0xd1, 0xab, 0x96, 0x9f, 0x45, 0x29,
0x10, 0x82, 0xe3, 0x9a, 0x55, 0x7d, 0x6b, 0x9c, 0xba, 0x19, 0xdd, 0xc0, 0x90, 0x7d, 0x31, 0xcb,
0xb4, 0x43, 0xc6, 0xa9, 0x57, 0x08, 0xc3, 0x88, 0x65, 0x99, 0x16, 0xc6, 0xe0, 0xb1, 0x33, 0x06,
0x89, 0xa6, 0x30, 0x56, 0x3d, 0xf0, 0x25, 0xc3, 0xa1, 0xf3, 0xce, 0x0f, 0xab, 0xe9, 0x6f, 0x4b,
0xc0, 0xbe, 0x25, 0xe0, 0xbf, 0x25, 0xe0, 0xa7, 0x23, 0xc1, 0xbe, 0x23, 0xc1, 0x5f, 0x47, 0x82,
0x8f, 0x91, 0xe2, 0x3c, 0x74, 0x47, 0x79, 0x38, 0x04, 0x00, 0x00, 0xff, 0xff, 0x79, 0x62, 0xab,
0xa6, 0x78, 0x01, 0x00, 0x00,
// 296 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x90, 0xb1, 0x6a, 0xf3, 0x30,
0x14, 0x85, 0xa3, 0x10, 0xec,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, 0xe4, 0x12, 0x3b,
0xf0, 0x06, 0x06, 0x2a, 0xcb, 0xf4, 0xa2, 0x5e, 0x11, 0x8a, 0x5d, 0x48, 0x92, 0x4a, 0x68, 0x4d,
0x27, 0xd6, 0x18, 0x24, 0x99, 0x63, 0x4f, 0x75, 0xc0, 0x4d, 0x42, 0x1d, 0xeb, 0x9d, 0x17, 0xc4,
0xc7, 0x53, 0x28, 0x21, 0xaf, 0x4d, 0x16, 0xeb, 0x4d, 0x42, 0x5d, 0xeb, 0xff, 0x5d, 0xad, 0xe7,
0x5f, 0x0d, 0x43, 0x87, 0x86, 0xa1, 0x9f, 0x86, 0xa1, 0xcf, 0x96, 0x8d, 0x0e, 0x2d, 0x1b, 0x7d,
0xb7, 0x6c, 0xf4, 0x32, 0x56, 0x9c, 0x3b, 0xf6, 0xdf, 0x6e, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff,
0x98, 0xcd, 0x07, 0x13, 0x9b, 0x01, 0x00, 0x00,
}
func (m *SnapshotWithType) Marshal() (dAtA []byte, err error) {
@ -232,6 +241,13 @@ func (m *Profile) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
if len(m.AnalyticsId) > 0 {
i -= len(m.AnalyticsId)
copy(dAtA[i:], m.AnalyticsId)
i = encodeVarintSnapshot(dAtA, i, uint64(len(m.AnalyticsId)))
i--
dAtA[i] = 0x3a
}
if len(m.ProfileId) > 0 {
i -= len(m.ProfileId)
copy(dAtA[i:], m.ProfileId)
@ -312,6 +328,10 @@ func (m *Profile) Size() (n int) {
if l > 0 {
n += 1 + l + sovSnapshot(uint64(l))
}
l = len(m.AnalyticsId)
if l > 0 {
n += 1 + l + sovSnapshot(uint64(l))
}
return n
}
@ -583,6 +603,38 @@ func (m *Profile) Unmarshal(dAtA []byte) error {
}
m.ProfileId = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 7:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field AnalyticsId", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSnapshot
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthSnapshot
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthSnapshot
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.AnalyticsId = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipSnapshot(dAtA[iNdEx:])