mirror of
https://github.com/anyproto/anytype-heart.git
synced 2025-06-09 17:44:59 +09:00
[GO-678-dep-licence] Merge branch 'master' into GO-678-dep-licence
This commit is contained in:
commit
fe97f79753
84 changed files with 2984 additions and 4869 deletions
11
.github/workflows/build.yml
vendored
11
.github/workflows/build.yml
vendored
|
@ -38,7 +38,10 @@ jobs:
|
|||
curl https://raw.githubusercontent.com/Homebrew/homebrew-core/31b24d65a7210ea0a5689d5ad00dd8d1bf5211db/Formula/protobuf.rb --output protobuf.rb
|
||||
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1 brew install ./protobuf.rb
|
||||
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1 brew install --ignore-dependencies swift-protobuf
|
||||
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1 brew install mingw-w64 jq FiloSottile/musl-cross/musl-cross
|
||||
HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1 brew install mingw-w64
|
||||
brew tap filosottile/musl-cross
|
||||
brew install filosottile/musl-cross/musl-cross -h
|
||||
brew install filosottile/musl-cross/musl-cross --with-aarch64
|
||||
npm i -g node-gyp
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
@ -72,9 +75,11 @@ jobs:
|
|||
run: |
|
||||
echo $FLAGS
|
||||
mkdir -p .release
|
||||
gox -ldflags="$FLAGS" -osarch="darwin/amd64 darwin/arm64 linux/amd64 linux/arm64" --tags="nographviz nowatchdog nosigar nomutexdeadlockdetector" -output="{{.OS}}-{{.Arch}}" github.com/anytypeio/go-anytype-middleware/cmd/grpcserver
|
||||
gox -cgo -ldflags="$FLAGS" -osarch="darwin/amd64 darwin/arm64" --tags="nographviz nowatchdog nosigar nomutexdeadlockdetector" -output="{{.OS}}-{{.Arch}}" github.com/anytypeio/go-anytype-middleware/cmd/grpcserver
|
||||
CC="x86_64-linux-musl-gcc" CXX="x86_64-linux-musl-g++" gox -cgo -osarch="linux/amd64" --tags="nographviz nowatchdog nosigar nomutexdeadlockdetector" -output="{{.OS}}-{{.Arch}}" github.com/anytypeio/go-anytype-middleware/cmd/grpcserver
|
||||
CC="aarch64-linux-musl-gcc" CXX="aarch64-linux-musl-g++" gox -cgo -osarch="linux/arm64" --tags="nographviz nowatchdog nosigar nomutexdeadlockdetector" -output="{{.OS}}-{{.Arch}}" github.com/anytypeio/go-anytype-middleware/cmd/grpcserver
|
||||
make protos-server
|
||||
CC="x86_64-w64-mingw32-gcc" CXX="x86_64-w64-mingw32-g++" gox -ldflags="$FLAGS" -osarch="windows/amd64" --tags="nographviz nowatchdog nosigar nomutexdeadlockdetector" -output="{{.OS}}-{{.Arch}}" github.com/anytypeio/go-anytype-middleware/cmd/grpcserver
|
||||
CC="x86_64-w64-mingw32-gcc" CXX="x86_64-w64-mingw32-g++" gox -cgo -ldflags="$FLAGS" -osarch="windows/amd64" --tags="nographviz nowatchdog nosigar nomutexdeadlockdetector" -output="{{.OS}}-{{.Arch}}" github.com/anytypeio/go-anytype-middleware/cmd/grpcserver
|
||||
ls -lha .
|
||||
- name: Make JS protos
|
||||
run: |
|
||||
|
|
103
change/state.go
103
change/state.go
|
@ -1,7 +1,6 @@
|
|||
package change
|
||||
|
||||
import (
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/state"
|
||||
|
@ -86,105 +85,3 @@ func BuildStateSimpleCRDT(root *state.State, t *Tree) (s *state.State, changesAp
|
|||
log.Infof("build state (crdt): changes: %d; dur: %v;", changesApplied, time.Since(st))
|
||||
return s, changesApplied, err
|
||||
}
|
||||
|
||||
// Full version found parallel branches and proposes to resolve conflicts
|
||||
func BuildState(root *state.State, t *Tree) (s *state.State, err error) {
|
||||
var (
|
||||
sc = NewStateCache()
|
||||
startId string
|
||||
applyRoot bool
|
||||
st = time.Now()
|
||||
count int
|
||||
)
|
||||
if startId = root.ChangeId(); startId == "" {
|
||||
startId = t.RootId()
|
||||
applyRoot = true
|
||||
}
|
||||
t.IterateBranching(startId, func(c *Change, branchLevel int) (isContinue bool) {
|
||||
if root.ChangeId() == c.Id {
|
||||
s = root
|
||||
if applyRoot {
|
||||
s = s.NewState()
|
||||
if err = s.ApplyChange(c.Change.Content...); err != nil {
|
||||
return false
|
||||
}
|
||||
s.SetLastModified(c.Timestamp, c.Account)
|
||||
s.AddFileKeys(c.FileKeys...)
|
||||
count++
|
||||
}
|
||||
sc.Set(c.Id, s, len(c.Next))
|
||||
return true
|
||||
}
|
||||
if len(c.PreviousIds) == 1 {
|
||||
ps := sc.Get(c.PreviousIds[0])
|
||||
s := ps.NewState()
|
||||
if err = s.ApplyChange(c.Change.Content...); err != nil {
|
||||
return false
|
||||
}
|
||||
s.SetLastModified(c.Timestamp, c.Account)
|
||||
s.AddFileKeys(c.FileKeys...)
|
||||
count++
|
||||
s.SetChangeId(c.Id)
|
||||
if branchLevel == 0 {
|
||||
if _, _, err = state.ApplyStateFastOne(s); err != nil {
|
||||
return false
|
||||
}
|
||||
sc.Set(c.Id, ps, len(c.Next))
|
||||
} else {
|
||||
sc.Set(c.Id, s, len(c.Next))
|
||||
}
|
||||
} else if len(c.PreviousIds) > 1 {
|
||||
toMerge := make([]*state.State, len(c.PreviousIds))
|
||||
sort.Strings(c.PreviousIds)
|
||||
for i, prevId := range c.PreviousIds {
|
||||
toMerge[i] = sc.Get(prevId)
|
||||
}
|
||||
ps := merge(t, toMerge...)
|
||||
s := ps.NewState()
|
||||
if err = s.ApplyChange(c.Change.Content...); err != nil {
|
||||
return false
|
||||
}
|
||||
s.SetLastModified(c.Timestamp, c.Account)
|
||||
s.AddFileKeys(c.FileKeys...)
|
||||
count++
|
||||
s.SetChangeId(c.Id)
|
||||
if branchLevel == 0 {
|
||||
if _, _, err = state.ApplyStateFastOne(s); err != nil {
|
||||
return false
|
||||
}
|
||||
sc.Set(c.Id, ps, len(c.Next))
|
||||
} else {
|
||||
sc.Set(c.Id, s, len(c.Next))
|
||||
}
|
||||
}
|
||||
return true
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(t.headIds) > 1 {
|
||||
toMerge := make([]*state.State, len(t.headIds))
|
||||
sort.Strings(t.headIds)
|
||||
for i, hid := range t.headIds {
|
||||
if s.ChangeId() == hid {
|
||||
toMerge[i] = s
|
||||
} else {
|
||||
toMerge[i] = sc.Get(hid)
|
||||
}
|
||||
}
|
||||
s = merge(t, toMerge...)
|
||||
}
|
||||
log.Infof("build state: changes: %d; dur: %v;", count, time.Since(st))
|
||||
return
|
||||
}
|
||||
|
||||
func merge(t *Tree, states ...*state.State) (s *state.State) {
|
||||
for _, st := range states {
|
||||
if s == nil {
|
||||
s = st
|
||||
} else {
|
||||
s = s.Merge(st)
|
||||
}
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
|
|
@ -25,212 +25,213 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
|||
func init() { proto.RegisterFile("pb/protos/service/service.proto", fileDescriptor_93a29dc403579097) }
|
||||
|
||||
var fileDescriptor_93a29dc403579097 = []byte{
|
||||
// 3279 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x9c, 0xdd, 0x6f, 0x1d, 0x47,
|
||||
0xf9, 0xc7, 0x7b, 0x6e, 0x7e, 0xfd, 0xb1, 0xa5, 0x05, 0xb6, 0x10, 0x4a, 0x68, 0x9d, 0x34, 0x6d,
|
||||
0xfc, 0x12, 0xc7, 0xc7, 0x6e, 0x02, 0x45, 0x70, 0x83, 0x4e, 0xec, 0x38, 0xb1, 0x1a, 0x27, 0xc1,
|
||||
0xc7,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|
||||
0x16, 0xae, 0x75, 0x5c, 0x6d, 0x40, 0x69, 0xac, 0xf7, 0x83, 0xa0, 0x73, 0x1c, 0xbc, 0x51, 0xeb,
|
||||
0x9c, 0x2e, 0x44, 0xc2, 0xcf, 0xf3, 0xf0, 0xfd, 0xae, 0x23, 0x98, 0x54, 0xec, 0x1b, 0x3e, 0x04,
|
||||
0xa2, 0x3e, 0x0f, 0xbe, 0xfc, 0x3c, 0xca, 0x32, 0x26, 0x76, 0x4b, 0x56, 0x17, 0xdc, 0xf6, 0x69,
|
||||
0x4d, 0xe3, 0xd6, 0xa6, 0xe2, 0x7e, 0xe0, 0x65, 0x20, 0xf0, 0x67, 0xc1, 0x9b, 0xad, 0xe5, 0x88,
|
||||
0xc5, 0x7c, 0xc9, 0xca, 0xd0, 0xe9, 0x05, 0x46, 0xa2, 0xc9, 0x3b, 0x10, 0x8e, 0xbd, 0xcb, 0xf3,
|
||||
0x25, 0x2b, 0x85, 0x3b, 0x36, 0x18, 0xfd, 0xb1, 0x35, 0x04, 0xb1, 0xb3, 0xe0, 0x6d, 0xb3, 0x41,
|
||||
0xa6, 0xac, 0x6a, 0x06, 0xcc, 0x06, 0x5d, 0x67, 0x40, 0x94, 0xce, 0xad, 0x21, 0x28, 0xa8, 0xa5,
|
||||
0x41, 0x08, 0x6a, 0x19, 0xaf, 0x94, 0xd8, 0xba, 0x33, 0x82, 0x41, 0x28, 0xad, 0x8d, 0x01, 0x24,
|
||||
0x48, 0xfd, 0x24, 0xf8, 0xca, 0x73, 0x5e, 0x9e, 0x55, 0x45, 0x14, 0x33, 0xe8, 0xec, 0x9b, 0xb6,
|
||||
0xb7, 0xb4, 0xe2, 0xfe, 0x5e, 0xed, 0xc3, 0x40, 0xe1, 0x2c, 0x08, 0x95, 0xf1, 0xc9, 0xc9, 0x4f,
|
||||
0x59, 0x2c, 0x26, 0x49, 0x82, 0x5b, 0x4e, 0x79, 0xb7, 0xc4, 0x78, 0x92, 0x24, 0x54, 0xcb, 0x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1f, 0x94, 0x51, 0x71, 0xea,
|
||||
0xee, 0xd4, 0xc6, 0xe4, 0xef, 0x54, 0x89, 0xe0, 0x1e, 0x98, 0xb2, 0xa8, 0x8c, 0x4f, 0xdd, 0x3d,
|
||||
0xd0, 0xda, 0xfc, 0x3d, 0xa0, 0x18, 0x08, 0x5c, 0x06, 0xdf, 0x30, 0x03, 0x4f, 0x17, 0x27, 0x55,
|
||||
0x5c, 0xa6, 0x27, 0x2c, 0xdc, 0xa4, 0xbd, 0x15, 0xa4, 0xa4, 0x6e, 0x0f, 0x83, 0x75, 0x86, 0x08,
|
||||
0x9a, 0xd2, 0x76, 0x90, 0x54, 0x28, 0x43, 0x94, 0x31, 0x0c, 0x82, 0xc8, 0x10, 0xdd, 0x24, 0xae,
|
||||
0xde, 0x83, 0x92, 0x2f, 0x8a, 0xaa, 0xa7, 0x7a, 0x08, 0xf2, 0x57, 0xaf, 0x0b, 0x83, 0xe6, 0xcb,
|
||||
0xe0, 0x9b, 0x66, 0x93, 0x3e, 0xcb, 0x2b, 0xa5, 0xba, 0x45, 0xb7, 0x93, 0x81, 0x11, 0x79, 0x9c,
|
||||
0x07, 0x07, 0xe5, 0x38, 0xf8, 0xaa, 0x54, 0x16, 0x7b, 0x4c, 0x44, 0x69, 0x56, 0x85, 0xab, 0xee,
|
||||
0x18, 0xd2, 0xae, 0xb4, 0xd6, 0x7a, 0x39, 0x3c, 0x85, 0xf6, 0x16, 0x45, 0x96, 0xc6, 0xdd, 0xa4,
|
||||
0x1b, 0x7c, 0x95, 0xd9, 0x3f, 0x85, 0x4c, 0x4c, 0x2f, 0xec, 0xaa, 0x1a, 0xed, 0xff, 0x38, 0xbe,
|
||||
0x28, 0xf0, 0xc2, 0xae, 0x4b, 0xa8, 0x11, 0x62, 0x61, 0x27, 0x50, 0x5c, 0x9f, 0x29, 0x13, 0x8f,
|
||||
0xa2, 0x0b, 0xbe, 0x20, 0x96, 0x04, 0x65, 0xf6, 0xd7, 0xc7, 0xc4, 0x40, 0x61, 0x11, 0x5c, 0x51,
|
||||
0x0a, 0x07, 0xb9, 0x60, 0x65, 0x1e, 0x65, 0xfb, 0x59, 0x34, 0xab, 0x42, 0x62, 0xde, 0xd8, 0x94,
|
||||
0xd2, 0xdb, 0x1a, 0x48, 0x3b, 0x9a, 0xf1, 0xa0, 0xda, 0x8f, 0x96, 0xbc, 0x4c, 0x05, 0xdd, 0x8c,
|
||||
0x1a, 0xe9, 0x6d, 0x46, 0x0b, 0x75, 0xaa, 0x4d, 0xca, 0xf8, 0x34, 0x5d, 0xb2, 0xc4, 0xa3, 0x26,
|
||||
0x91, 0x01, 0x6a, 0x06, 0x8a, 0xd5, 0xea, 0xb3, 0x84, 0x1e, 0x88, 0x4e, 0x35, 0x0b, 0xf1, 0xab,
|
||||
0x61, 0x14, 0xcf, 0xab, 0xc6, 0xde, 0x26, 0x74, 0xab, 0xa4, 0xbf, 0x9d, 0xd3, 0xad, 0xf5, 0x72,
|
||||
0x78, 0xd9, 0xa8, 0x8d, 0x76, 0x23, 0x6e, 0x51, 0x31, 0xdc, 0x0d, 0x39, 0x1e, 0x8a, 0x93, 0xca,
|
||||
0x6a, 0xb0, 0xf8, 0x95, 0x3b, 0x03, 0x66, 0x3c, 0x14, 0xc7, 0xdd, 0x38, 0x29, 0x8a, 0xec, 0xe2,
|
||||
0x98, 0xcd, 0x8b, 0x8c, 0xec, 0x46, 0x0b, 0xf1, 0x77, 0x23, 0x46, 0xf1, 0xd6, 0x7c, 0xcc, 0xeb,
|
||||
0x8d, 0xdf, 0xb9, 0x35, 0x37, 0x26, 0xff, 0xd6, 0x2c, 0x11, 0xbc, 0xc5, 0x4c, 0x92, 0xe4, 0x79,
|
||||
0x2a, 0x4e, 0xdb, 0xff, 0x73, 0x90, 0xb8, 0xb7, 0x18, 0x04, 0xf9, 0xb7, 0x98, 0x2e, 0xac, 0x2f,
|
||||
0xe8, 0x64, 0x8e, 0x17, 0x95, 0xec, 0xde, 0xc5, 0xa3, 0x34, 0x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||||
0xb1, 0xc5, 0x10, 0x13, 0x94, 0x62, 0x41, 0xf0, 0x87, 0xc1, 0xdb, 0xf5, 0xcc, 0x65, 0x39, 0xfc,
|
||||
0xb9, 0x8e, 0xfb, 0xcd, 0x5f, 0xb2, 0x09, 0xaf, 0xa8, 0x18, 0x53, 0x51, 0xb2, 0x68, 0x2e, 0x63,
|
||||
0xbf, 0xa5, 0x7e, 0x6f, 0xc0, 0x9d, 0xd1, 0xbd, 0xf7, 0xff, 0xf9, 0xc5, 0xca, 0xe8, 0xf3, 0x2f,
|
||||
0x56, 0x46, 0xff, 0xfe, 0x62, 0x65, 0xf4, 0xb7, 0x57, 0x2b, 0xaf, 0x7d, 0xfe, 0x6a, 0xe5, 0xb5,
|
||||
0x7f, 0xbd, 0x5a, 0x79, 0xed, 0xb3, 0xd7, 0xe1, 0x2f, 0xea, 0x9c, 0xfc, 0x5f, 0xf3, 0x77, 0x71,
|
||||
0xee, 0xfe, 0x37, 0x00, 0x00, 0xff, 0xff, 0xe8, 0xee, 0x93, 0x37, 0x75, 0x47, 0x00, 0x00,
|
||||
// 3292 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x9c, 0xdf, 0x6f, 0x1d, 0x47,
|
||||
0x15, 0xc7, 0x7b, 0x5f, 0x28, 0x6c, 0x69, 0x81, 0x2d, 0x84, 0x12, 0x5a, 0x27, 0x4d, 0x9b, 0xd8,
|
||||
0x8e, 0xe3, 0x6b, 0x37, 0x81, 0x16, 0x78, 0x41, 0x37, 0x76, 0x9c, 0x58, 0x8d, 0x93, 0xe0, 0xeb,
|
||||
0x24, 0x52, 0x25, 0x24, 0xd6, 0xbb, 0x93, 0xeb, 0xc5, 0x7b, 0x77, 0x96, 0xdd, 0xb9, 0xd7, 0x31,
|
||||
0x08, 0x04, 0x02, 0x81, 0x40, 0x08, 0x2a, 0xc1, 0x1b, 0xff, 0x10, 0x8f, 0x7d, 0xe4, 0x11, 0xb5,
|
||||
0xff, 0x08, 0xda, 0xdd, 0x33, 0xbf, 0xce, 0xce, 0x99, 0x5d, 0xf3, 0x54, 0xb8, 0xe7, 0x73, 0xce,
|
||||
0x77, 0x7e, 0xcf, 0x99, 0x99, 0x8d, 0x83, 0x2b, 0xc5, 0xf1, 0x56, 0x51, 0x72, 0xc1, 0xab, 0xad,
|
||||
0x8a, 0x95, 0xcb, 0x34, 0x66, 0xf2, 0xbf, 0xe3, 0xe6, 0xe7, 0xf0, 0xd5, 0x28, 0x3f, 0x17, 0xe7,
|
||||
0x05, 0xbb, 0xfc, 0x96, 0x26, 0x63, 0x3e, 0x9f, 0x47, 0x79, 0x52, 0xb5, 0xc8, 0xe5, 0x4b, 0xda,
|
||||
0xc2, 0x96, 0x2c, 0x17, 0xf0, 0xfb, 0xed, 0x4f, 0xff, 0x36, 0x0a, 0xde, 0xd8, 0xc9, 0x52, 0x96,
|
||||
0x8b, 0x1d, 0xf0, 0x08, 0x3f, 0x09, 0x5e, 0x9f, 0x14, 0xc5, 0x7d, 0x26, 0x9e, 0xb1, 0xb2, 0x4a,
|
||||
0x79, 0x1e, 0xbe, 0x37, 0x06, 0x81, 0xf1, 0x61, 0x11, 0x8f, 0x27, 0x45, 0x31, 0xd6, 0xc6, 0xf1,
|
||||
0x21, 0xfb, 0xc5, 0x82, 0x55, 0xe2, 0xf2, 0xfb, 0x7e, 0xa8, 0x2a, 0x78, 0x5e, 0xb1, 0xf0, 0x45,
|
||||
0xf0, 0x8d, 0x49, 0x51, 0x4c, 0x99, 0xd8, 0x65, 0x75, 0x05, 0xa6, 0x22, 0x12, 0x2c, 0x5c, 0xed,
|
||||
0xb8, 0xda, 0x80, 0xd2, 0x58, 0xeb, 0x07, 0x41, 0xe7, 0x28, 0x78, 0xad, 0xd6, 0x39, 0x59, 0x88,
|
||||
0x84, 0x9f, 0xe5, 0xe1, 0xbb, 0x5d, 0x47, 0x30, 0xa9, 0xd8, 0xd7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, 0x4e, 0x82, 0x17, 0xd4, 0x8e, 0x6c, 0x23, 0x9d, 0xa8,
|
||||
0x07, 0xf5, 0x82, 0xe2, 0x8e, 0x7a, 0x60, 0xae, 0x20, 0xd7, 0x7c, 0x88, 0x9e, 0xd0, 0xb2, 0xff,
|
||||
0x78, 0xfe, 0x22, 0x9d, 0x3d, 0x2d, 0x92, 0xba, 0x17, 0xd7, 0xdd, 0x1d, 0x64, 0x20, 0xc4, 0x84,
|
||||
0x26, 0x50, 0x50, 0xfb, 0x49, 0x10, 0xb4, 0xcb, 0xd7, 0xe3, 0x82, 0xe5, 0xe1, 0x55, 0xcb, 0x13,
|
||||
0xd6, 0xb5, 0xda, 0xa2, 0x62, 0xbf, 0xeb, 0x21, 0x74, 0xb3, 0xb4, 0xbf, 0x37, 0xbb, 0x5b, 0xe8,
|
||||
0xf4, 0x68, 0x4c, 0x44, 0xb3, 0x20, 0x04, 0x17, 0x74, 0x7a, 0xc2, 0xcf, 0xdc, 0x05, 0xad, 0x2d,
|
||||
0xfe, 0x82, 0x02, 0xa1, 0x33, 0x2a, 0x28, 0xa8, 0x2b, 0xa3, 0x92, 0xc5, 0xf0, 0x65, 0x54, 0x98,
|
||||
0x81, 0xc0, 0x3c, 0xf8, 0xa6, 0x19, 0xf8, 0x2e, 0xe7, 0xa7, 0xf3, 0xa8, 0x3c, 0x0d, 0x6f, 0xd2,
|
||||
0xce, 0x92, 0x51, 0x42, 0x1b, 0x83, 0x58, 0xbd, 0x68, 0x99, 0x82, 0x53, 0x86, 0x17, 0x2d, 0xcb,
|
||||
0x7f, 0xca, 0xa8, 0x45, 0xcb, 0x81, 0xe1, 0x4e, 0xbd, 0x5f, 0x46, 0xc5, 0x89, 0xbb, 0x53, 0x1b,
|
||||
0x93, 0xbf, 0x53, 0x25, 0x82, 0x7b, 0x60, 0xca, 0xa2, 0x32, 0x3e, 0x71, 0xf7, 0x40, 0x6b, 0xf3,
|
||||
0xf7, 0x80, 0x62, 0x20, 0x70, 0x19, 0x7c, 0xcb, 0x0c, 0x3c, 0x5d, 0x1c, 0x57, 0x71, 0x99, 0x1e,
|
||||
0xb3, 0x70, 0x83, 0xf6, 0x56, 0x90, 0x92, 0xba, 0x35, 0x0c, 0xd6, 0x19, 0x22, 0x68, 0x4a, 0xdb,
|
||||
0x7e, 0x52, 0xa1, 0x0c, 0x51, 0xc6, 0x30, 0x08, 0x22, 0x43, 0x74, 0x93, 0xb8, 0x7a, 0xf7, 0x4b,
|
||||
0xbe, 0x28, 0xaa, 0x9e, 0xea, 0x21, 0xc8, 0x5f, 0xbd, 0x2e, 0x0c, 0x9a, 0x2f, 0x83, 0x6f, 0x9b,
|
||||
0x4d, 0xfa, 0x34, 0xaf, 0x94, 0xea, 0x26, 0xdd, 0x4e, 0x06, 0x46, 0xe4, 0x71, 0x1e, 0x1c, 0x94,
|
||||
0xe3, 0xe0, 0xeb, 0x52, 0x59, 0xec, 0x32, 0x11, 0xa5, 0x59, 0x15, 0xde, 0x70, 0xc7, 0x90, 0x76,
|
||||
0xa5, 0xb5, 0xda, 0xcb, 0xe1, 0x29, 0xb4, 0xbb, 0x28, 0xb2, 0x34, 0xee, 0x26, 0xdd, 0xe0, 0xab,
|
||||
0xcc, 0xfe, 0x29, 0x64, 0x62, 0x7a, 0x61, 0x57, 0xd5, 0x68, 0xff, 0xc7, 0xd1, 0x79, 0x81, 0x17,
|
||||
0x76, 0x5d, 0x42, 0x8d, 0x10, 0x0b, 0x3b, 0x81, 0xe2, 0xfa, 0x4c, 0x99, 0x78, 0x18, 0x9d, 0xf3,
|
||||
0x05, 0xb1, 0x24, 0x28, 0xb3, 0xbf, 0x3e, 0x26, 0x06, 0x0a, 0x8b, 0xe0, 0x92, 0x52, 0xd8, 0xcf,
|
||||
0x05, 0x2b, 0xf3, 0x28, 0xdb, 0xcb, 0xa2, 0x59, 0x15, 0x12, 0xf3, 0xc6, 0xa6, 0x94, 0xde, 0xe6,
|
||||
0x40, 0xda, 0xd1, 0x8c, 0xfb, 0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, 0x59, 0x1a, 0xf1, 0x6b,
|
||||
0xc6, 0xf5, 0x1e, 0x4a, 0x9f, 0xca, 0xa4, 0x4d, 0xad, 0x18, 0x37, 0xdc, 0xae, 0x9d, 0x55, 0x63,
|
||||
0xb5, 0x97, 0xd3, 0xab, 0xf3, 0xdd, 0x8c, 0xc7, 0xa7, 0xb0, 0xcc, 0xd9, 0xb5, 0x6e, 0x2c, 0x78,
|
||||
0x9d, 0xbb, 0xe6, 0x43, 0xf4, 0x42, 0xd7, 0x18, 0x0e, 0x59, 0x91, 0x45, 0x31, 0x7e, 0x65, 0x6b,
|
||||
0x7d, 0xc0, 0x46, 0x2c, 0x74, 0x98, 0x41, 0xc5, 0x85, 0xd7, 0x3b, 0x57, 0x71, 0xd1, 0xe3, 0xdd,
|
||||
0x35, 0x1f, 0xa2, 0x97, 0xfa, 0xc6, 0x30, 0x2d, 0xb2, 0x54, 0xa0, 0xb1, 0xd1, 0x7a, 0x34, 0x16,
|
||||
0x62, 0x6c, 0xd8, 0x04, 0x0a, 0x79, 0xc0, 0xca, 0x19, 0x73, 0x86, 0x6c, 0x2c, 0xde, 0x90, 0x92,
|
||||
0x80, 0x90, 0x8f, 0x82, 0xaf, 0xb4, 0x75, 0xe7, 0xc5, 0x79, 0x78, 0xc5, 0x55, 0x2d, 0x5e, 0x9c,
|
||||
0xab, 0x80, 0x57, 0x69, 0x00, 0x15, 0xf1, 0x49, 0x54, 0x09, 0x77, 0x11, 0x1b, 0x8b, 0xb7, 0x88,
|
||||
0x92, 0xd0, 0xfb, 0x50, 0x5b, 0xc4, 0x85, 0x40, 0xfb, 0x10, 0x14, 0xc0, 0x78, 0x72, 0xb8, 0x42,
|
||||
0xda, 0xf5, 0xf4, 0x6a, 0x7b, 0x85, 0x89, 0xbd, 0x94, 0x65, 0x49, 0x85, 0xa6, 0x17, 0xb4, 0xbb,
|
||||
0xb4, 0x12, 0xd3, 0xab, 0x4b, 0xa1, 0xa1, 0x04, 0x17, 0x50, 0xae, 0xda, 0xa1, 0xbb, 0xa7, 0x6b,
|
||||
0x3e, 0x44, 0xe7, 0x25, 0x8d, 0xc1, 0xb8, 0x5e, 0x77, 0x95, 0xc7, 0x71, 0xbb, 0x7e, 0xa3, 0x0f,
|
||||
0x03, 0x85, 0xbf, 0x8c, 0x82, 0x77, 0x94, 0xc4, 0x01, 0x5f, 0xb2, 0x23, 0x7e, 0xef, 0x65, 0x5a,
|
||||
0x89, 0x34, 0x9f, 0xc1, 0xd6, 0x74, 0x87, 0x88, 0xe4, 0x82, 0x95, 0xfc, 0xf7, 0x2e, 0xe6, 0xa4,
|
||||
0x77, 0x48, 0x54, 0x96, 0x47, 0xec, 0xcc, 0xb9, 0x43, 0xe2, 0x88, 0x8a, 0x23, 0x76, 0x48, 0x1f,
|
||||
0xaf, 0x4f, 0xc3, 0x4a, 0x1c, 0xbe, 0x14, 0x3c, 0xe2, 0x32, 0x59, 0xa1, 0xa2, 0x61, 0x90, 0x38,
|
||||
0x17, 0x78, 0x1d, 0x74, 0xb2, 0xae, 0xf4, 0xf5, 0x20, 0x5d, 0x23, 0xe2, 0x74, 0x07, 0xea, 0xfa,
|
||||
0x00, 0xd2, 0x21, 0xa5, 0xdf, 0x88, 0x28, 0xa9, 0xee, 0x13, 0xd1, 0xfa, 0x00, 0xd2, 0x38, 0x59,
|
||||
0x9b, 0xd5, 0xba, 0x1b, 0xc5, 0xa7, 0xb3, 0x92, 0x2f, 0xf2, 0x64, 0x87, 0x67, 0xbc, 0x44, 0x27,
|
||||
0x6b, 0xab, 0xd4, 0x08, 0x25, 0x4e, 0xd6, 0x3d, 0x2e, 0x3a, 0x31, 0x30, 0x4b, 0x31, 0xc9, 0xd2,
|
||||
0x19, 0x3e, 0x9e, 0x58, 0x81, 0x1a, 0x80, 0x48, 0x0c, 0x9c, 0xa0, 0x63, 0x10, 0xb5, 0xc7, 0x17,
|
||||
0x91, 0xc6, 0x51, 0xd6, 0xea, 0x6d, 0xd1, 0x61, 0x2c, 0xb0, 0x77, 0x10, 0x39, 0x1c, 0x1c, 0xf5,
|
||||
0x3c, 0x5a, 0x94, 0xf9, 0x7e, 0x2e, 0x38, 0x59, 0x4f, 0x09, 0xf4, 0xd6, 0xd3, 0x00, 0x75, 0x36,
|
||||
0xd1, 0x98, 0x8f, 0xd8, 0xcb, 0xba, 0x34, 0xf5, 0x7f, 0x42, 0xc7, 0x92, 0x53, 0xff, 0x3e, 0x06,
|
||||
0x3b, 0x91, 0x4d, 0xb8, 0x38, 0x54, 0x19, 0x10, 0x69, 0x07, 0x8c, 0xc7, 0xdb, 0x1e, 0x26, 0x6b,
|
||||
0xfd, 0xa0, 0x5b, 0x67, 0x2a, 0xce, 0x33, 0xe6, 0xd3, 0x69, 0x80, 0x21, 0x3a, 0x12, 0xd4, 0x8f,
|
||||
0x08, 0x56, 0x7d, 0x4e, 0x58, 0x7c, 0xda, 0x79, 0x09, 0xb6, 0x0b, 0xda, 0x22, 0xc4, 0x23, 0x02,
|
||||
0x81, 0xba, 0xbb, 0x68, 0x3f, 0xe6, 0xb9, 0xaf, 0x8b, 0x6a, 0xfb, 0x90, 0x2e, 0x02, 0x4e, 0x9f,
|
||||
0xee, 0x94, 0x15, 0x46, 0x66, 0xdb, 0x4d, 0x1b, 0x44, 0x04, 0x13, 0x22, 0x4e, 0x77, 0x24, 0xac,
|
||||
0xef, 0x49, 0xb1, 0xe6, 0x41, 0xf7, 0xdb, 0xa8, 0x4e, 0x94, 0x03, 0xfa, 0xdb, 0x28, 0x8a, 0xa5,
|
||||
0x2b, 0xd9, 0x8e, 0x91, 0x9e, 0x28, 0xf6, 0x38, 0xb9, 0x35, 0x0c, 0xd6, 0x4f, 0xcf, 0x96, 0xe6,
|
||||
0x4e, 0xc6, 0xa2, 0xb2, 0x55, 0xdd, 0xf4, 0x04, 0xd2, 0x18, 0x71, 0x29, 0xe7, 0xc1, 0xd1, 0x12,
|
||||
0x66, 0x29, 0xef, 0xf0, 0x5c, 0xb0, 0x5c, 0xb8, 0x96, 0x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35, 0xc1, 0x93, 0x92, 0xc7, 0xac, 0xaa, 0x76, 0xea, 0xe9, 0x91, 0xa1, 0xaf, 0x09, 0xc0, 0x36,
|
||||
0x6e, 0x8d, 0xc4, 0xd7, 0x04, 0x1d, 0x08, 0x62, 0x3f, 0x08, 0x5e, 0x7d, 0xc8, 0x67, 0x53, 0x96,
|
||||
0x27, 0xe1, 0x3b, 0xf6, 0xfb, 0x3d, 0x9f, 0x8d, 0xeb, 0x9f, 0x55, 0xbc, 0x15, 0xca, 0xac, 0x1f,
|
||||
0x5b, 0x77, 0xd9, 0xf1, 0x62, 0x36, 0x3d, 0xcf, 0x63, 0xf4, 0xd8, 0xda, 0xfc, 0x3e, 0xae, 0x0d,
|
||||
0xc4, 0x63, 0xab, 0x05, 0xe8, 0xd7, 0xc6, 0xe6, 0xe7, 0xa3, 0x93, 0x92, 0x75, 0xde, 0xd9, 0x5b,
|
||||
0x87, 0xd6, 0x44, 0xbc, 0x36, 0x22, 0x04, 0x95, 0xf2, 0xa8, 0x64, 0xcc, 0x59, 0xca, 0xda, 0xe0,
|
||||
0x2d, 0x25, 0x00, 0x7a, 0xb3, 0x6d, 0x7e, 0x6e, 0x5f, 0x35, 0x1f, 0xf2, 0x38, 0xca, 0x2a, 0xc1,
|
||||
0x4b, 0x7c, 0x2f, 0xd4, 0xba, 0x62, 0x88, 0xd8, 0x6c, 0x49, 0x18, 0xd5, 0xe1, 0x49, 0x9a, 0xcf,
|
||||
0x9c, 0x75, 0xa8, 0x0d, 0xde, 0x3a, 0x00, 0xa0, 0x27, 0xe8, 0x01, 0x13, 0x65, 0x1a, 0x57, 0x53,
|
||||
0x26, 0x9e, 0x44, 0x65, 0x34, 0x67, 0x82, 0x95, 0xf8, 0x1f, 0x5d, 0x00, 0x32, 0xb6, 0x18, 0x62,
|
||||
0x82, 0x52, 0x2c, 0x08, 0xfe, 0x38, 0x78, 0xb3, 0x9e, 0xb9, 0x2c, 0x87, 0x3f, 0xea, 0x71, 0xaf,
|
||||
0xf9, 0x7b, 0x37, 0xe1, 0x25, 0x15, 0x63, 0x2a, 0x4a, 0x16, 0xcd, 0x65, 0xec, 0x37, 0xd4, 0xef,
|
||||
0x0d, 0xb8, 0x3d, 0xba, 0xfb, 0xee, 0xbf, 0x3f, 0x5f, 0x19, 0x7d, 0xf6, 0xf9, 0xca, 0xe8, 0xbf,
|
||||
0x9f, 0xaf, 0x8c, 0x3e, 0xfd, 0x62, 0xe5, 0x95, 0xcf, 0xbe, 0x58, 0x79, 0xe5, 0x3f, 0x5f, 0xac,
|
||||
0xbc, 0xf2, 0xc9, 0xab, 0xf0, 0x77, 0x77, 0x8e, 0xbf, 0xd4, 0xfc, 0xf5, 0x9c, 0x3b, 0xff, 0x0b,
|
||||
0x00, 0x00, 0xff, 0xff, 0xbb, 0x6c, 0x58, 0x63, 0x9b, 0x47, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
|
@ -307,12 +308,12 @@ type ClientCommandsHandler interface {
|
|||
ObjectSetBreadcrumbs(context.Context, *pb.RpcObjectSetBreadcrumbsRequest) *pb.RpcObjectSetBreadcrumbsResponse
|
||||
ObjectUndo(context.Context, *pb.RpcObjectUndoRequest) *pb.RpcObjectUndoResponse
|
||||
ObjectRedo(context.Context, *pb.RpcObjectRedoRequest) *pb.RpcObjectRedoResponse
|
||||
ObjectImportMarkdown(context.Context, *pb.RpcObjectImportMarkdownRequest) *pb.RpcObjectImportMarkdownResponse
|
||||
ObjectListExport(context.Context, *pb.RpcObjectListExportRequest) *pb.RpcObjectListExportResponse
|
||||
ObjectBookmarkFetch(context.Context, *pb.RpcObjectBookmarkFetchRequest) *pb.RpcObjectBookmarkFetchResponse
|
||||
ObjectToBookmark(context.Context, *pb.RpcObjectToBookmarkRequest) *pb.RpcObjectToBookmarkResponse
|
||||
ObjectImport(context.Context, *pb.RpcObjectImportRequest) *pb.RpcObjectImportResponse
|
||||
ObjectImportList(context.Context, *pb.RpcObjectImportListRequest) *pb.RpcObjectImportListResponse
|
||||
ObjectImportNotionValidateToken(context.Context, *pb.RpcObjectImportNotionValidateTokenRequest) *pb.RpcObjectImportNotionValidateTokenResponse
|
||||
// Relations
|
||||
// ***
|
||||
ObjectCreateRelation(context.Context, *pb.RpcObjectCreateRelationRequest) *pb.RpcObjectCreateRelationResponse
|
||||
|
@ -1550,26 +1551,6 @@ func ObjectRedo(b []byte) (resp []byte) {
|
|||
return resp
|
||||
}
|
||||
|
||||
func ObjectImportMarkdown(b []byte) (resp []byte) {
|
||||
defer func() {
|
||||
if PanicHandler != nil {
|
||||
if r := recover(); r != nil {
|
||||
resp, _ = (&pb.RpcObjectImportMarkdownResponse{Error: &pb.RpcObjectImportMarkdownResponseError{Code: pb.RpcObjectImportMarkdownResponseError_UNKNOWN_ERROR, Description: "panic recovered"}}).Marshal()
|
||||
PanicHandler(r)
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
in := new(pb.RpcObjectImportMarkdownRequest)
|
||||
if err := in.Unmarshal(b); err != nil {
|
||||
resp, _ = (&pb.RpcObjectImportMarkdownResponse{Error: &pb.RpcObjectImportMarkdownResponseError{Code: pb.RpcObjectImportMarkdownResponseError_BAD_INPUT, Description: err.Error()}}).Marshal()
|
||||
return resp
|
||||
}
|
||||
|
||||
resp, _ = clientCommandsHandler.ObjectImportMarkdown(context.Background(), in).Marshal()
|
||||
return resp
|
||||
}
|
||||
|
||||
func ObjectListExport(b []byte) (resp []byte) {
|
||||
defer func() {
|
||||
if PanicHandler != nil {
|
||||
|
@ -1670,6 +1651,26 @@ func ObjectImportList(b []byte) (resp []byte) {
|
|||
return resp
|
||||
}
|
||||
|
||||
func ObjectImportNotionValidateToken(b []byte) (resp []byte) {
|
||||
defer func() {
|
||||
if PanicHandler != nil {
|
||||
if r := recover(); r != nil {
|
||||
resp, _ = (&pb.RpcObjectImportNotionValidateTokenResponse{Error: &pb.RpcObjectImportNotionValidateTokenResponseError{Code: pb.RpcObjectImportNotionValidateTokenResponseError_UNKNOWN_ERROR, Description: "panic recovered"}}).Marshal()
|
||||
PanicHandler(r)
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
in := new(pb.RpcObjectImportNotionValidateTokenRequest)
|
||||
if err := in.Unmarshal(b); err != nil {
|
||||
resp, _ = (&pb.RpcObjectImportNotionValidateTokenResponse{Error: &pb.RpcObjectImportNotionValidateTokenResponseError{Code: pb.RpcObjectImportNotionValidateTokenResponseError_BAD_INPUT, Description: err.Error()}}).Marshal()
|
||||
return resp
|
||||
}
|
||||
|
||||
resp, _ = clientCommandsHandler.ObjectImportNotionValidateToken(context.Background(), in).Marshal()
|
||||
return resp
|
||||
}
|
||||
|
||||
func ObjectCreateRelation(b []byte) (resp []byte) {
|
||||
defer func() {
|
||||
if PanicHandler != nil {
|
||||
|
@ -3926,8 +3927,6 @@ func CommandAsync(cmd string, data []byte, callback func(data []byte)) {
|
|||
cd = ObjectUndo(data)
|
||||
case "ObjectRedo":
|
||||
cd = ObjectRedo(data)
|
||||
case "ObjectImportMarkdown":
|
||||
cd = ObjectImportMarkdown(data)
|
||||
case "ObjectListExport":
|
||||
cd = ObjectListExport(data)
|
||||
case "ObjectBookmarkFetch":
|
||||
|
@ -3938,6 +3937,8 @@ func CommandAsync(cmd string, data []byte, callback func(data []byte)) {
|
|||
cd = ObjectImport(data)
|
||||
case "ObjectImportList":
|
||||
cd = ObjectImportList(data)
|
||||
case "ObjectImportNotionValidateToken":
|
||||
cd = ObjectImportNotionValidateToken(data)
|
||||
case "ObjectCreateRelation":
|
||||
cd = ObjectCreateRelation(data)
|
||||
case "ObjectCreateRelationOption":
|
||||
|
|
|
@ -5,13 +5,10 @@ import (
|
|||
"github.com/anytypeio/go-anytype-middleware/app"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/cafe"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/cafe/pb"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/logging"
|
||||
)
|
||||
|
||||
const CName = "account"
|
||||
|
||||
var log = logging.Logger("anytype-account")
|
||||
|
||||
type Service interface {
|
||||
app.Component
|
||||
DeleteAccount(ctx context.Context, isReverted bool) (resp *pb.AccountDeleteResponse, err error)
|
||||
|
|
|
@ -280,34 +280,6 @@ func (mw *Middleware) BlockCut(cctx context.Context, req *pb.RpcBlockCutRequest)
|
|||
return response(pb.RpcBlockCutResponseError_NULL, textSlot, htmlSlot, anySlot, nil)
|
||||
}
|
||||
|
||||
func (mw *Middleware) ObjectImportMarkdown(cctx context.Context, req *pb.RpcObjectImportMarkdownRequest) *pb.RpcObjectImportMarkdownResponse {
|
||||
ctx := mw.newContext(cctx)
|
||||
response := func(code pb.RpcObjectImportMarkdownResponseErrorCode, rootLinkIds []string, err error) *pb.RpcObjectImportMarkdownResponse {
|
||||
m := &pb.RpcObjectImportMarkdownResponse{
|
||||
Error: &pb.RpcObjectImportMarkdownResponseError{Code: code},
|
||||
RootLinkIds: rootLinkIds,
|
||||
}
|
||||
if err != nil {
|
||||
m.Error.Description = err.Error()
|
||||
} else {
|
||||
m.Event = ctx.GetResponseEvent()
|
||||
}
|
||||
return m
|
||||
}
|
||||
|
||||
var rootLinkIds []string
|
||||
err := mw.doBlockService(func(bs *block.Service) (err error) {
|
||||
rootLinkIds, err = bs.ImportMarkdown(ctx, *req)
|
||||
return err
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return response(pb.RpcObjectImportMarkdownResponseError_UNKNOWN_ERROR, rootLinkIds, err)
|
||||
}
|
||||
|
||||
return response(pb.RpcObjectImportMarkdownResponseError_NULL, rootLinkIds, nil)
|
||||
}
|
||||
|
||||
func (mw *Middleware) BlockExport(cctx context.Context, req *pb.RpcBlockExportRequest) *pb.RpcBlockExportResponse {
|
||||
ctx := mw.newContext(cctx)
|
||||
response := func(code pb.RpcBlockExportResponseErrorCode, path string, err error) *pb.RpcBlockExportResponse {
|
||||
|
|
|
@ -4,12 +4,10 @@ import (
|
|||
"context"
|
||||
"sync"
|
||||
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/core"
|
||||
"github.com/gogo/protobuf/types"
|
||||
|
||||
"github.com/anytypeio/go-anytype-middleware/app"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/state"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/recordsbatcher"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/core"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/logging"
|
||||
"github.com/anytypeio/go-anytype-middleware/util/slice"
|
||||
)
|
||||
|
@ -31,11 +29,6 @@ type DocInfo struct {
|
|||
State *state.State
|
||||
}
|
||||
|
||||
type RelationOptionsInfo struct {
|
||||
RelationId string
|
||||
Options []*types.Struct
|
||||
}
|
||||
|
||||
type OnDocChangeCallback func(ctx context.Context, info DocInfo) error
|
||||
|
||||
type Service interface {
|
||||
|
|
|
@ -14,7 +14,6 @@ import (
|
|||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/clipboard"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/dataview"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/file"
|
||||
_import "github.com/anytypeio/go-anytype-middleware/core/block/editor/import"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/smartblock"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/state"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/stext"
|
||||
|
@ -289,48 +288,6 @@ func (s *Service) Export(req pb.RpcBlockExportRequest) (path string, err error)
|
|||
return path, err
|
||||
}
|
||||
|
||||
func (s *Service) ImportMarkdown(
|
||||
ctx *session.Context,
|
||||
req pb.RpcObjectImportMarkdownRequest,
|
||||
) (rootLinkIds []string, err error) {
|
||||
var rootLinks []*model.Block
|
||||
err = s.DoImport(req.ContextId, func(imp _import.Import) error {
|
||||
rootLinks, err = imp.ImportMarkdown(ctx, req)
|
||||
return err
|
||||
})
|
||||
if err != nil {
|
||||
return rootLinkIds, err
|
||||
}
|
||||
|
||||
if len(rootLinks) == 1 {
|
||||
err = s.SimplePaste(req.ContextId, rootLinks)
|
||||
|
||||
if err != nil {
|
||||
return rootLinkIds, err
|
||||
}
|
||||
} else {
|
||||
var objectID string
|
||||
_, objectID, err = s.CreateLinkToTheNewObject(ctx, &pb.RpcBlockLinkCreateWithObjectRequest{
|
||||
ContextId: req.ContextId,
|
||||
Details: &types.Struct{Fields: map[string]*types.Value{
|
||||
"name": pbtypes.String("Import from Notion"),
|
||||
"iconEmoji": pbtypes.String("📁"),
|
||||
}},
|
||||
})
|
||||
if err != nil {
|
||||
return rootLinkIds, err
|
||||
}
|
||||
|
||||
err = s.SimplePaste(objectID, rootLinks)
|
||||
}
|
||||
|
||||
for _, r := range rootLinks {
|
||||
rootLinkIds = append(rootLinkIds, r.Id)
|
||||
}
|
||||
|
||||
return rootLinkIds, err
|
||||
}
|
||||
|
||||
func (s *Service) SetTextText(ctx *session.Context, req pb.RpcBlockTextSetTextRequest) error {
|
||||
return s.DoText(req.ContextId, func(b stext.Text) error {
|
||||
return b.SetText(ctx, req)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package clipboard
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
|
@ -29,10 +28,8 @@ import (
|
|||
)
|
||||
|
||||
var (
|
||||
ErrAllSlotsEmpty = errors.New("all slots are empty")
|
||||
ErrTitlePasteRestricted = errors.New("paste to title restricted")
|
||||
ErrOutOfRange = errors.New("out of range")
|
||||
log = logging.Logger("anytype-clipboard")
|
||||
ErrAllSlotsEmpty = errors.New("all slots are empty")
|
||||
log = logging.Logger("anytype-clipboard")
|
||||
)
|
||||
|
||||
type Clipboard interface {
|
||||
|
@ -236,28 +233,6 @@ func (cb *clipboard) Cut(ctx *session.Context, req pb.RpcBlockCutRequest) (textS
|
|||
return textSlot, htmlSlot, anySlot, cb.Apply(s)
|
||||
}
|
||||
|
||||
func (cb *clipboard) getImages(blocks map[string]*model.Block) (images map[string][]byte, err error) {
|
||||
for _, b := range blocks {
|
||||
if file := b.GetFile(); file != nil {
|
||||
if file.Type == model.BlockContentFile_Image {
|
||||
fh, err := cb.anytype.FileByHash(context.TODO(), file.Hash)
|
||||
if err != nil {
|
||||
return images, err
|
||||
}
|
||||
|
||||
reader, err := fh.Reader()
|
||||
if err != nil {
|
||||
return images, err
|
||||
}
|
||||
|
||||
reader.Read(images[file.Hash])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return images, nil
|
||||
}
|
||||
|
||||
func (cb *clipboard) Export(req pb.RpcBlockExportRequest) (path string, err error) {
|
||||
s := cb.blocksToState(req.Blocks)
|
||||
htmlData := html.NewHTMLConverter(cb.anytype, s).Export()
|
||||
|
|
|
@ -5,7 +5,6 @@ import (
|
|||
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/basic"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/collection"
|
||||
_import "github.com/anytypeio/go-anytype-middleware/core/block/editor/import"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/smartblock"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/state"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/template"
|
||||
|
@ -22,7 +21,6 @@ import (
|
|||
type Dashboard struct {
|
||||
smartblock.SmartBlock
|
||||
basic.AllOperations
|
||||
_import.Import
|
||||
collection.Collection
|
||||
|
||||
DetailsModifier DetailsModifier
|
||||
|
@ -33,15 +31,12 @@ type Dashboard struct {
|
|||
func NewDashboard(
|
||||
detailsModifier DetailsModifier,
|
||||
objectStore objectstore.ObjectStore,
|
||||
importerCtrl _import.Services,
|
||||
objectCreator _import.ObjectCreator,
|
||||
anytype core.Service,
|
||||
) *Dashboard {
|
||||
sb := smartblock.New()
|
||||
return &Dashboard{
|
||||
SmartBlock: sb,
|
||||
AllOperations: basic.NewBasic(sb),
|
||||
Import: _import.NewImport(sb, importerCtrl, objectCreator, anytype),
|
||||
Collection: collection.NewCollection(sb),
|
||||
DetailsModifier: detailsModifier,
|
||||
objectStore: objectStore,
|
||||
|
|
|
@ -6,7 +6,6 @@ import (
|
|||
"github.com/anytypeio/go-anytype-middleware/app"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/bookmark"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/file"
|
||||
_import "github.com/anytypeio/go-anytype-middleware/core/block/editor/import"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/smartblock"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/source"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/event"
|
||||
|
@ -23,8 +22,6 @@ type ObjectFactory struct {
|
|||
bookmarkService bookmark.BookmarkService
|
||||
detailsModifier DetailsModifier
|
||||
fileBlockService file.BlockService
|
||||
importerCtrl _import.Services
|
||||
objectCreator _import.ObjectCreator
|
||||
objectStore objectstore.ObjectStore
|
||||
relationService relation2.Service
|
||||
sourceService source.Service
|
||||
|
@ -44,8 +41,6 @@ func (f *ObjectFactory) Init(a *app.App) (err error) {
|
|||
f.bookmarkService = app.MustComponent[bookmark.BookmarkService](a)
|
||||
f.detailsModifier = app.MustComponent[DetailsModifier](a)
|
||||
f.fileBlockService = app.MustComponent[file.BlockService](a)
|
||||
f.importerCtrl = app.MustComponent[_import.Services](a)
|
||||
f.objectCreator = app.MustComponent[_import.ObjectCreator](a)
|
||||
f.objectStore = app.MustComponent[objectstore.ObjectStore](a)
|
||||
f.relationService = app.MustComponent[relation2.Service](a)
|
||||
f.sourceService = app.MustComponent[source.Service](a)
|
||||
|
@ -85,8 +80,6 @@ func (f *ObjectFactory) New(sbType model.SmartBlockType) smartblock.SmartBlock {
|
|||
case model.SmartBlockType_Page, model.SmartBlockType_Date:
|
||||
return NewPage(
|
||||
f.objectStore,
|
||||
f.importerCtrl,
|
||||
f.objectCreator,
|
||||
f.anytype,
|
||||
f.fileBlockService,
|
||||
f.bookmarkBlockService,
|
||||
|
@ -102,8 +95,6 @@ func (f *ObjectFactory) New(sbType model.SmartBlockType) smartblock.SmartBlock {
|
|||
return NewDashboard(
|
||||
f.detailsModifier,
|
||||
f.objectStore,
|
||||
f.importerCtrl,
|
||||
f.objectCreator,
|
||||
f.anytype,
|
||||
)
|
||||
case model.SmartBlockType_Set:
|
||||
|
@ -164,8 +155,6 @@ func (f *ObjectFactory) New(sbType model.SmartBlockType) smartblock.SmartBlock {
|
|||
case model.SmartBlockType_Template:
|
||||
return NewTemplate(
|
||||
f.objectStore,
|
||||
f.importerCtrl,
|
||||
f.objectCreator,
|
||||
f.anytype,
|
||||
f.fileBlockService,
|
||||
f.bookmarkBlockService,
|
||||
|
@ -175,8 +164,6 @@ func (f *ObjectFactory) New(sbType model.SmartBlockType) smartblock.SmartBlock {
|
|||
case model.SmartBlockType_BundledTemplate:
|
||||
return NewTemplate(
|
||||
f.objectStore,
|
||||
f.importerCtrl,
|
||||
f.objectCreator,
|
||||
f.anytype,
|
||||
f.fileBlockService,
|
||||
f.bookmarkBlockService,
|
||||
|
|
|
@ -20,6 +20,7 @@ import (
|
|||
"github.com/anytypeio/go-anytype-middleware/core/block/simple/file"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/core"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/files"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/mill"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/pb/model"
|
||||
"github.com/anytypeio/go-anytype-middleware/util/uri"
|
||||
)
|
||||
|
@ -341,7 +342,7 @@ func (u *uploader) Upload(ctx context.Context) (result UploadResult) {
|
|||
|
||||
if u.fileType == model.BlockContentFile_Image {
|
||||
im, e := u.anytype.ImageAdd(ctx, opts...)
|
||||
if e == image.ErrFormat {
|
||||
if e == image.ErrFormat || e == mill.ErrWEBPNotSupported {
|
||||
log.Infof("can't add file '%s' as image: add as file", u.name)
|
||||
e = nil
|
||||
return u.SetType(model.BlockContentFile_File).Upload(ctx)
|
||||
|
|
|
@ -1,919 +0,0 @@
|
|||
package _import
|
||||
|
||||
import (
|
||||
"archive/zip"
|
||||
"bufio"
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/url"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/globalsign/mgo/bson"
|
||||
"github.com/gogo/protobuf/types"
|
||||
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/smartblock"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/state"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/import/markdown/anymark"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/process"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/session"
|
||||
"github.com/anytypeio/go-anytype-middleware/pb"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/bundle"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/core"
|
||||
coresb "github.com/anytypeio/go-anytype-middleware/pkg/lib/core/smartblock"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/logging"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/pb/model"
|
||||
"github.com/anytypeio/go-anytype-middleware/util/pbtypes"
|
||||
"github.com/anytypeio/go-anytype-middleware/util/slice"
|
||||
"github.com/anytypeio/go-anytype-middleware/util/uri"
|
||||
)
|
||||
|
||||
var (
|
||||
linkRegexp = regexp.MustCompile(`\[([\s\S]*?)\]\((.*?)\)`)
|
||||
filenameCleanRegexp = regexp.MustCompile(`[^\w_\s]+`)
|
||||
filenameDuplicateSpaceRegexp = regexp.MustCompile(`\s+`)
|
||||
emojiAproxRegexp = regexp.MustCompile(`[\x{2194}-\x{329F}\x{1F000}-\x{1FADF}]`)
|
||||
|
||||
log = logging.Logger("anytype-import")
|
||||
articleIcons = []string{"📓", "📕", "📗", "📘", "📙", "📖", "📔", "📒", "📝", "📄", "📑"}
|
||||
dbIcons = []string{"🗃", "🗂"}
|
||||
)
|
||||
|
||||
type Import interface {
|
||||
ImportMarkdown(ctx *session.Context, req pb.RpcObjectImportMarkdownRequest) (rootLinks []*model.Block, err error)
|
||||
}
|
||||
|
||||
func NewImport(
|
||||
sb smartblock.SmartBlock,
|
||||
ctrl Services,
|
||||
creator ObjectCreator,
|
||||
anytype core.Service,
|
||||
) Import {
|
||||
return &importImpl{
|
||||
SmartBlock: sb,
|
||||
ctrl: ctrl,
|
||||
creator: creator,
|
||||
anytype: anytype,
|
||||
}
|
||||
}
|
||||
|
||||
type importImpl struct {
|
||||
smartblock.SmartBlock
|
||||
ctrl Services
|
||||
creator ObjectCreator
|
||||
anytype core.Service
|
||||
}
|
||||
|
||||
type fileInfo struct {
|
||||
os.FileInfo
|
||||
io.ReadCloser
|
||||
hasInboundLinks bool
|
||||
pageID string
|
||||
isRootFile bool
|
||||
title string
|
||||
parsedBlocks []*model.Block
|
||||
}
|
||||
|
||||
type ObjectCreator interface {
|
||||
CreateSmartBlockFromState(ctx context.Context, sbType coresb.SmartBlockType, details *types.Struct, relationIds []string, createState *state.State) (id string, newDetails *types.Struct, err error)
|
||||
}
|
||||
|
||||
type Services interface {
|
||||
SetDetails(ctx *session.Context, req pb.RpcObjectSetDetailsRequest) (err error)
|
||||
SimplePaste(contextId string, anySlot []*model.Block) (err error)
|
||||
UploadBlockFileSync(ctx *session.Context, req pb.RpcBlockUploadRequest) error
|
||||
BookmarkFetchSync(ctx *session.Context, req pb.RpcBlockBookmarkFetchRequest) error
|
||||
ProcessAdd(p process.Process) (err error)
|
||||
}
|
||||
|
||||
func (imp *importImpl) ImportMarkdown(ctx *session.Context, req pb.RpcObjectImportMarkdownRequest) (rootLinks []*model.Block, err error) {
|
||||
progress := process.NewProgress(pb.ModelProcess_Import)
|
||||
defer progress.Finish()
|
||||
imp.ctrl.ProcessAdd(progress)
|
||||
progress.SetProgressMessage("read dir")
|
||||
s := imp.NewStateCtx(ctx)
|
||||
defer log.Debug("5. ImportMarkdown: all smartBlocks done")
|
||||
tempDir := imp.anytype.TempDir()
|
||||
|
||||
files, close, err := imp.DirWithMarkdownToBlocks(req.ImportPath)
|
||||
defer func() {
|
||||
if close != nil {
|
||||
_ = close()
|
||||
}
|
||||
}()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
filesCount := len(files)
|
||||
log.Debug("FILES COUNT:", filesCount)
|
||||
|
||||
progress.SetTotal(int64(filesCount) * 8) // 8 loops
|
||||
var pagesCreated int
|
||||
|
||||
progress.SetProgressMessage("process links (1)")
|
||||
for name, file := range files {
|
||||
select {
|
||||
case <-progress.Canceled():
|
||||
return nil, fmt.Errorf("canceled")
|
||||
default:
|
||||
}
|
||||
progress.AddDone(1)
|
||||
// index links in the root csv file
|
||||
if !file.isRootFile || !strings.EqualFold(filepath.Ext(name), ".csv") {
|
||||
continue
|
||||
}
|
||||
|
||||
ext := filepath.Ext(name)
|
||||
csvDir := strings.TrimSuffix(name, ext)
|
||||
|
||||
for targetName, targetFile := range files {
|
||||
fileExt := filepath.Ext(targetName)
|
||||
if filepath.Dir(targetName) == csvDir && strings.EqualFold(fileExt, ".md") {
|
||||
targetFile.hasInboundLinks = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
progress.SetProgressMessage("creating documents")
|
||||
for name, file := range files {
|
||||
select {
|
||||
case <-progress.Canceled():
|
||||
return nil, fmt.Errorf("canceled")
|
||||
default:
|
||||
}
|
||||
progress.AddDone(1)
|
||||
if !strings.EqualFold(filepath.Ext(name), ".md") {
|
||||
continue
|
||||
}
|
||||
|
||||
if !file.isRootFile && !file.hasInboundLinks {
|
||||
log.Errorf("skip non-root md files without inbound links %s", name)
|
||||
continue
|
||||
}
|
||||
|
||||
var objectID string
|
||||
objectID, _, err = imp.creator.CreateSmartBlockFromState(context.TODO(), coresb.SmartBlockTypePage, nil, nil, nil)
|
||||
if err != nil {
|
||||
log.Errorf("failed to create smartblock: %s", err.Error())
|
||||
continue
|
||||
}
|
||||
file.pageID = objectID
|
||||
pagesCreated++
|
||||
}
|
||||
|
||||
log.Debug("pages created:", pagesCreated)
|
||||
|
||||
progress.SetProgressMessage("set documents names")
|
||||
for name, file := range files {
|
||||
select {
|
||||
case <-progress.Canceled():
|
||||
return nil, fmt.Errorf("canceled")
|
||||
default:
|
||||
}
|
||||
progress.AddDone(1)
|
||||
var title string
|
||||
var emoji string
|
||||
|
||||
if file.pageID == "" {
|
||||
// file is not a page
|
||||
continue
|
||||
}
|
||||
|
||||
if len(file.parsedBlocks) > 0 {
|
||||
if text := file.parsedBlocks[0].GetText(); text != nil && text.Style == model.BlockContentText_Header1 {
|
||||
title = text.Text
|
||||
titleParts := strings.SplitN(title, " ", 2)
|
||||
|
||||
// only select the first rune to see if it looks like emoji
|
||||
if len(titleParts) == 2 && emojiAproxRegexp.MatchString(string([]rune(titleParts[0])[0:1])) {
|
||||
// first symbol is emoji - just use it all before the space
|
||||
emoji = titleParts[0]
|
||||
title = titleParts[1]
|
||||
}
|
||||
// remove title block
|
||||
file.parsedBlocks = file.parsedBlocks[1:]
|
||||
}
|
||||
}
|
||||
|
||||
if emoji == "" {
|
||||
emoji = slice.GetRandomString(articleIcons, name)
|
||||
}
|
||||
|
||||
if title == "" {
|
||||
title := strings.TrimSuffix(filepath.Base(name), filepath.Ext(name))
|
||||
titleParts := strings.Split(title, " ")
|
||||
title = strings.Join(titleParts[:len(titleParts)-1], " ")
|
||||
}
|
||||
|
||||
// FIELD-BLOCK
|
||||
fields := map[string]*types.Value{
|
||||
"name": pbtypes.String(title),
|
||||
"iconEmoji": pbtypes.String(emoji),
|
||||
}
|
||||
|
||||
file.title = title
|
||||
|
||||
var details = []*pb.RpcObjectSetDetailsDetail{}
|
||||
|
||||
for name, val := range fields {
|
||||
details = append(details, &pb.RpcObjectSetDetailsDetail{
|
||||
Key: name,
|
||||
Value: val,
|
||||
})
|
||||
}
|
||||
|
||||
err = imp.ctrl.SetDetails(nil, pb.RpcObjectSetDetailsRequest{
|
||||
ContextId: file.pageID,
|
||||
Details: details,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return rootLinks, err
|
||||
}
|
||||
}
|
||||
|
||||
log.Debug("1. ImportMarkdown: all smartBlocks created")
|
||||
progress.SetProgressMessage("process links (2)")
|
||||
for _, file := range files {
|
||||
select {
|
||||
case <-progress.Canceled():
|
||||
return nil, fmt.Errorf("canceled")
|
||||
default:
|
||||
}
|
||||
progress.AddDone(1)
|
||||
if file.pageID == "" {
|
||||
// file is not a page
|
||||
continue
|
||||
}
|
||||
|
||||
file.parsedBlocks = imp.processFieldBlockIfItIs(file.parsedBlocks, files)
|
||||
|
||||
for _, block := range file.parsedBlocks {
|
||||
if link := block.GetLink(); link != nil {
|
||||
target, err := url.PathUnescape(link.TargetBlockId)
|
||||
if err != nil {
|
||||
log.Warnf("err while url.PathUnescape: %s \n \t\t\t url: %s", err, link.TargetBlockId)
|
||||
target = link.TargetBlockId
|
||||
}
|
||||
|
||||
if files[target] != nil {
|
||||
link.TargetBlockId = files[target].pageID
|
||||
files[target].hasInboundLinks = true
|
||||
}
|
||||
|
||||
} else if text := block.GetText(); text != nil && text.Marks != nil && len(text.Marks.Marks) > 0 {
|
||||
for _, mark := range text.Marks.Marks {
|
||||
if mark.Type != model.BlockContentTextMark_Mention && mark.Type != model.BlockContentTextMark_Object {
|
||||
continue
|
||||
}
|
||||
|
||||
if targetFile, exists := files[mark.Param]; exists {
|
||||
mark.Param = targetFile.pageID
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
progress.SetProgressMessage("process csv")
|
||||
for name, file := range files {
|
||||
select {
|
||||
case <-progress.Canceled():
|
||||
return nil, fmt.Errorf("canceled")
|
||||
default:
|
||||
}
|
||||
progress.AddDone(1)
|
||||
// wrap root-level csv files with page
|
||||
if file.isRootFile && strings.EqualFold(filepath.Ext(name), ".csv") {
|
||||
// fixme: move initial details into CreateSmartBlock
|
||||
var objectID string
|
||||
objectID, _, err = imp.creator.CreateSmartBlockFromState(context.TODO(), coresb.SmartBlockTypePage, nil, nil, nil)
|
||||
if err != nil {
|
||||
log.Errorf("failed to create smartblock: %s", err.Error())
|
||||
continue
|
||||
}
|
||||
|
||||
fields := map[string]*types.Value{
|
||||
"name": pbtypes.String(imp.shortPathToName(name)),
|
||||
"iconEmoji": pbtypes.String(slice.GetRandomString(dbIcons, name)),
|
||||
}
|
||||
|
||||
var details = []*pb.RpcObjectSetDetailsDetail{}
|
||||
|
||||
for name, val := range fields {
|
||||
details = append(details, &pb.RpcObjectSetDetailsDetail{
|
||||
Key: name,
|
||||
Value: val,
|
||||
})
|
||||
}
|
||||
|
||||
err = imp.ctrl.SetDetails(nil, pb.RpcObjectSetDetailsRequest{
|
||||
ContextId: objectID,
|
||||
Details: details,
|
||||
})
|
||||
|
||||
file.pageID = objectID
|
||||
file.parsedBlocks = imp.convertCsvToLinks(name, files)
|
||||
}
|
||||
|
||||
if file.pageID == "" {
|
||||
// file is not a page
|
||||
continue
|
||||
}
|
||||
|
||||
var blocks = make([]*model.Block, 0, len(file.parsedBlocks))
|
||||
for i, b := range file.parsedBlocks {
|
||||
if f := b.GetFile(); f != nil && strings.EqualFold(filepath.Ext(f.Name), ".csv") {
|
||||
if csvFile, exists := files[f.Name]; exists {
|
||||
csvFile.hasInboundLinks = true
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
|
||||
csvInlineBlocks := imp.convertCsvToLinks(f.Name, files)
|
||||
blocks = append(blocks, csvInlineBlocks...)
|
||||
} else {
|
||||
blocks = append(blocks, file.parsedBlocks[i])
|
||||
}
|
||||
}
|
||||
|
||||
file.parsedBlocks = blocks
|
||||
}
|
||||
|
||||
log.Debug("2. ImportMarkdown: start to paste blocks")
|
||||
progress.SetProgressMessage("create content")
|
||||
for name, file := range files {
|
||||
select {
|
||||
case <-progress.Canceled():
|
||||
return nil, fmt.Errorf("canceled")
|
||||
default:
|
||||
}
|
||||
progress.AddDone(1)
|
||||
if file.pageID == "" {
|
||||
// file is not a page
|
||||
continue
|
||||
}
|
||||
|
||||
log.Debug(">>> start to paste to page:", name, file.pageID)
|
||||
if file.parsedBlocks == nil {
|
||||
log.Errorf("parsedBlocks is nil")
|
||||
}
|
||||
err = imp.ctrl.SimplePaste(file.pageID, file.parsedBlocks)
|
||||
if err != nil {
|
||||
return rootLinks, err
|
||||
}
|
||||
}
|
||||
|
||||
log.Debug("3. ImportMarkdown: all blocks pasted. Start to upload files & fetch bookmarks")
|
||||
progress.SetProgressMessage("upload files")
|
||||
for name, file := range files {
|
||||
select {
|
||||
case <-progress.Canceled():
|
||||
return nil, fmt.Errorf("canceled")
|
||||
default:
|
||||
}
|
||||
progress.AddDone(1)
|
||||
log.Debug(">>> current page:", name, " | linked: ", file.hasInboundLinks)
|
||||
if file.pageID == "" {
|
||||
continue
|
||||
}
|
||||
|
||||
for _, b := range file.parsedBlocks {
|
||||
if bm := b.GetBookmark(); bm != nil {
|
||||
err = imp.ctrl.BookmarkFetchSync(ctx, pb.RpcBlockBookmarkFetchRequest{
|
||||
ContextId: file.pageID,
|
||||
BlockId: b.Id,
|
||||
Url: bm.Url,
|
||||
})
|
||||
if err != nil {
|
||||
log.Errorf("failed to fetch bookmark %s: %s", bm.Url, err.Error())
|
||||
}
|
||||
} else if f := b.GetFile(); f != nil {
|
||||
filesCount = filesCount - 1
|
||||
log.Debug("page:", name, " | start to upload file :", f.Name)
|
||||
|
||||
if strings.HasPrefix(f.Name, "http://") || strings.HasPrefix(f.Name, "https://") {
|
||||
err = imp.ctrl.UploadBlockFileSync(ctx, pb.RpcBlockUploadRequest{
|
||||
ContextId: file.pageID,
|
||||
BlockId: b.Id,
|
||||
Url: f.Name,
|
||||
})
|
||||
if err != nil {
|
||||
return rootLinks, fmt.Errorf("can not import file from URL: %s", err)
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
baseName := filepath.Base(f.Name)
|
||||
tmpFile, err := os.Create(filepath.Join(tempDir, baseName))
|
||||
|
||||
shortPath := f.Name
|
||||
|
||||
w := bufio.NewWriter(tmpFile)
|
||||
targetFile, found := files[shortPath]
|
||||
if !found {
|
||||
log.Errorf("file %s not found", shortPath)
|
||||
continue
|
||||
}
|
||||
|
||||
_, err = w.ReadFrom(targetFile.ReadCloser)
|
||||
if err != nil {
|
||||
log.Errorf("failed to read file %s: %s", shortPath, err.Error())
|
||||
continue
|
||||
}
|
||||
|
||||
if err := w.Flush(); err != nil {
|
||||
log.Errorf("failed to flush file %s: %s", shortPath, err.Error())
|
||||
continue
|
||||
}
|
||||
|
||||
targetFile.Close()
|
||||
tmpFile.Close()
|
||||
|
||||
err = imp.ctrl.UploadBlockFileSync(ctx, pb.RpcBlockUploadRequest{
|
||||
ContextId: file.pageID,
|
||||
BlockId: b.Id,
|
||||
FilePath: tmpFile.Name(),
|
||||
Url: "",
|
||||
})
|
||||
os.Remove(tmpFile.Name())
|
||||
if err != nil {
|
||||
return rootLinks, fmt.Errorf("can not import file from temp file: %s", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
progress.SetProgressMessage("process links (3)")
|
||||
for _, file := range files {
|
||||
select {
|
||||
case <-progress.Canceled():
|
||||
return nil, fmt.Errorf("canceled")
|
||||
default:
|
||||
}
|
||||
progress.AddDone(1)
|
||||
if file.pageID == "" {
|
||||
// not a page
|
||||
continue
|
||||
}
|
||||
|
||||
if file.hasInboundLinks {
|
||||
continue
|
||||
}
|
||||
|
||||
rootLinks = append(rootLinks, &model.Block{
|
||||
Content: &model.BlockContentOfLink{
|
||||
Link: &model.BlockContentLink{
|
||||
TargetBlockId: file.pageID,
|
||||
Style: model.BlockContentLink_Page,
|
||||
Fields: nil,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
log.Debug("4. ImportMarkdown: everything done")
|
||||
|
||||
return rootLinks, imp.Apply(s)
|
||||
}
|
||||
|
||||
func (imp *importImpl) DirWithMarkdownToBlocks(importPath string) (files map[string]*fileInfo, fileClose func() error, err error) {
|
||||
log.Debug("1. DirWithMarkdownToBlocks: directory %s", importPath)
|
||||
|
||||
files = make(map[string]*fileInfo)
|
||||
fileClose = func() error {
|
||||
return nil
|
||||
}
|
||||
allFileShortPaths := []string{}
|
||||
|
||||
ext := filepath.Ext(importPath)
|
||||
if strings.EqualFold(ext, ".zip") {
|
||||
r, err := zip.OpenReader(importPath)
|
||||
if err != nil {
|
||||
return files, fileClose, fmt.Errorf("can not read zip while import: %s", err)
|
||||
}
|
||||
fileClose = r.Close
|
||||
|
||||
zipName := strings.TrimSuffix(importPath, ext)
|
||||
for _, f := range r.File {
|
||||
if strings.HasPrefix(f.Name, "__MACOSX/") {
|
||||
continue
|
||||
}
|
||||
shortPath := filepath.Clean(f.Name)
|
||||
// remove zip root folder if exists
|
||||
shortPath = strings.TrimPrefix(shortPath, zipName+"/")
|
||||
|
||||
allFileShortPaths = append(allFileShortPaths, shortPath)
|
||||
|
||||
rc, err := f.Open()
|
||||
if err != nil {
|
||||
return files, fileClose, fmt.Errorf("failed to open file from zip while import: %s", err)
|
||||
}
|
||||
|
||||
files[shortPath] = &fileInfo{
|
||||
FileInfo: f.FileInfo(),
|
||||
ReadCloser: rc,
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
err = filepath.Walk(importPath,
|
||||
func(path string, info os.FileInfo, err error) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if !info.IsDir() {
|
||||
shortPath, err := filepath.Rel(importPath+"/", path)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to get relative path: %s", err.Error())
|
||||
}
|
||||
|
||||
allFileShortPaths = append(allFileShortPaths, shortPath)
|
||||
f, err := os.Open(path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
files[shortPath] = &fileInfo{
|
||||
FileInfo: info,
|
||||
ReadCloser: f,
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
return files, fileClose, err
|
||||
}
|
||||
}
|
||||
|
||||
log.Debug("1. DirWithMarkdownToBlocks: Get allFileShortPaths:", allFileShortPaths)
|
||||
|
||||
for shortPath, file := range files {
|
||||
log.Debug(">>> Current file:", shortPath)
|
||||
if filepath.Base(shortPath) == shortPath {
|
||||
file.isRootFile = true
|
||||
}
|
||||
|
||||
if filepath.Ext(shortPath) == ".md" {
|
||||
b, err := ioutil.ReadAll(file)
|
||||
if err != nil {
|
||||
log.Errorf("failed to read file %s: %s", shortPath, err.Error())
|
||||
continue
|
||||
}
|
||||
|
||||
file.parsedBlocks, _, err = anymark.MarkdownToBlocks(b, filepath.Dir(shortPath), allFileShortPaths)
|
||||
if err != nil {
|
||||
log.Errorf("failed to read blocks %s: %s", shortPath, err.Error())
|
||||
}
|
||||
// md file no longer needed
|
||||
file.Close()
|
||||
|
||||
for i, block := range file.parsedBlocks {
|
||||
log.Debug("Block:", i)
|
||||
// file.parsedBlocks[i].Id = bson.NewObjectId().Hex()
|
||||
|
||||
txt := block.GetText()
|
||||
if txt != nil && txt.Marks != nil && len(txt.Marks.Marks) == 1 &&
|
||||
txt.Marks.Marks[0].Type == model.BlockContentTextMark_Link {
|
||||
|
||||
link := txt.Marks.Marks[0].Param
|
||||
|
||||
var wholeLineLink bool
|
||||
textRunes := []rune(txt.Text)
|
||||
var from, to = int(txt.Marks.Marks[0].Range.From), int(txt.Marks.Marks[0].Range.To)
|
||||
if from == 0 || (from < len(textRunes) && len(strings.TrimSpace(string(textRunes[0:from]))) == 0) {
|
||||
if to >= len(textRunes) || len(strings.TrimSpace(string(textRunes[to:]))) == 0 {
|
||||
wholeLineLink = true
|
||||
}
|
||||
}
|
||||
|
||||
ext := filepath.Ext(link)
|
||||
|
||||
// todo: bug with multiple markup links in arow when the first is external
|
||||
if file := files[link]; file != nil {
|
||||
if strings.EqualFold(ext, ".md") {
|
||||
// only convert if this is the only link in the row
|
||||
if wholeLineLink {
|
||||
imp.convertTextToPageLink(block)
|
||||
} else {
|
||||
imp.convertTextToPageMention(block)
|
||||
}
|
||||
} else {
|
||||
imp.convertTextToFile(block)
|
||||
}
|
||||
|
||||
if strings.EqualFold(ext, ".csv") {
|
||||
csvDir := strings.TrimSuffix(link, ext)
|
||||
for name, file := range files {
|
||||
// set hasInboundLinks for all CSV-origin md files
|
||||
fileExt := filepath.Ext(name)
|
||||
if filepath.Dir(name) == csvDir && strings.EqualFold(fileExt, ".md") {
|
||||
file.hasInboundLinks = true
|
||||
}
|
||||
}
|
||||
}
|
||||
file.hasInboundLinks = true
|
||||
} else if wholeLineLink {
|
||||
imp.convertTextToBookmark(block)
|
||||
} else {
|
||||
log.Debugf("")
|
||||
}
|
||||
|
||||
/*if block.GetFile() != nil {
|
||||
fileName, err := url.PathUnescape(block.GetFile().Name)
|
||||
if err != nil {
|
||||
log.Warnf("err while url.PathUnescape: %s \n \t\t\t url: %s", err, block.GetFile().Name)
|
||||
fileName = txt.Marks.Marks[0].Param
|
||||
}
|
||||
if !strings.HasPrefix(fileName, "http://") && !strings.HasPrefix(fileName, "https://") {
|
||||
// not a URL
|
||||
fileName = importPath + "/" + fileName
|
||||
}
|
||||
|
||||
block.GetFile().Name = fileName
|
||||
block.GetFile().Type = model.BlockContentFile_Image
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
ext := filepath.Ext(shortPath)
|
||||
dependentFilesDir := strings.TrimSuffix(shortPath, ext)
|
||||
var hasUnlinkedDependentMDFiles bool
|
||||
for targetName, targetFile := range files {
|
||||
fileExt := filepath.Ext(targetName)
|
||||
if filepath.Dir(targetName) == dependentFilesDir && strings.EqualFold(fileExt, ".md") {
|
||||
if !targetFile.hasInboundLinks {
|
||||
if !hasUnlinkedDependentMDFiles {
|
||||
// add Unsorted header
|
||||
file.parsedBlocks = append(file.parsedBlocks, &model.Block{
|
||||
Id: bson.NewObjectId().Hex(),
|
||||
Content: &model.BlockContentOfText{Text: &model.BlockContentText{
|
||||
Text: "Unsorted",
|
||||
Style: model.BlockContentText_Header3,
|
||||
}},
|
||||
})
|
||||
hasUnlinkedDependentMDFiles = true
|
||||
}
|
||||
|
||||
file.parsedBlocks = append(file.parsedBlocks, &model.Block{
|
||||
Id: bson.NewObjectId().Hex(),
|
||||
Content: &model.BlockContentOfLink{Link: &model.BlockContentLink{
|
||||
TargetBlockId: targetName,
|
||||
Style: model.BlockContentLink_Page,
|
||||
}},
|
||||
})
|
||||
|
||||
targetFile.hasInboundLinks = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
log.Debug("2. DirWithMarkdownToBlocks: MarkdownToBlocks completed")
|
||||
|
||||
return files, fileClose, err
|
||||
}
|
||||
|
||||
func (imp *importImpl) convertTextToPageLink(block *model.Block) {
|
||||
block.Content = &model.BlockContentOfLink{
|
||||
Link: &model.BlockContentLink{
|
||||
TargetBlockId: block.GetText().Marks.Marks[0].Param,
|
||||
Style: model.BlockContentLink_Page,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (imp *importImpl) convertTextToBookmark(block *model.Block) {
|
||||
if err := uri.ValidateURI(block.GetText().Marks.Marks[0].Param); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
block.Content = &model.BlockContentOfBookmark{
|
||||
Bookmark: &model.BlockContentBookmark{
|
||||
Url: block.GetText().Marks.Marks[0].Param,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (imp *importImpl) convertTextToPageMention(block *model.Block) {
|
||||
for _, mark := range block.GetText().Marks.Marks {
|
||||
if mark.Type != model.BlockContentTextMark_Link {
|
||||
continue
|
||||
}
|
||||
|
||||
mark.Param = mark.Param
|
||||
mark.Type = model.BlockContentTextMark_Mention
|
||||
}
|
||||
}
|
||||
|
||||
func (imp *importImpl) convertTextToFile(block *model.Block) {
|
||||
// "svg" excluded
|
||||
if block.GetText().Marks.Marks[0].Param == "" {
|
||||
return
|
||||
}
|
||||
|
||||
imageFormats := []string{"jpg", "jpeg", "png", "gif", "webp"}
|
||||
videoFormats := []string{"mp4", "m4v"}
|
||||
audioFormats := []string{"mp3", "ogg", "wav", "m4a", "flac"}
|
||||
pdfFormat := "pdf"
|
||||
|
||||
fileType := model.BlockContentFile_File
|
||||
fileExt := filepath.Ext(block.GetText().Marks.Marks[0].Param)
|
||||
if fileExt != "" {
|
||||
fileExt = fileExt[1:]
|
||||
for _, ext := range imageFormats {
|
||||
if strings.EqualFold(fileExt, ext) {
|
||||
fileType = model.BlockContentFile_Image
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
for _, ext := range videoFormats {
|
||||
if strings.EqualFold(fileExt, ext) {
|
||||
fileType = model.BlockContentFile_Video
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
for _, ext := range audioFormats {
|
||||
if strings.EqualFold(fileExt, ext) {
|
||||
fileType = model.BlockContentFile_Audio
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if strings.EqualFold(fileExt, pdfFormat) {
|
||||
fileType = model.BlockContentFile_PDF
|
||||
}
|
||||
}
|
||||
|
||||
block.Content = &model.BlockContentOfFile{
|
||||
File: &model.BlockContentFile{
|
||||
Name: block.GetText().Marks.Marks[0].Param,
|
||||
State: model.BlockContentFile_Empty,
|
||||
Type: fileType,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (imp *importImpl) convertCsvToLinks(csvFileName string, files map[string]*fileInfo) (blocks []*model.Block) {
|
||||
ext := filepath.Ext(csvFileName)
|
||||
csvDir := strings.TrimSuffix(csvFileName, ext)
|
||||
|
||||
blocks = append(blocks, &model.Block{
|
||||
Id: bson.NewObjectId().Hex(),
|
||||
Content: &model.BlockContentOfText{Text: &model.BlockContentText{
|
||||
Text: imp.shortPathToName(csvFileName),
|
||||
Style: model.BlockContentText_Header3,
|
||||
}},
|
||||
})
|
||||
|
||||
for name, file := range files {
|
||||
fileExt := filepath.Ext(name)
|
||||
if filepath.Dir(name) == csvDir && strings.EqualFold(fileExt, ".md") {
|
||||
file.hasInboundLinks = true
|
||||
fields := make(map[string]*types.Value)
|
||||
fields[bundle.RelationKeyName.String()] = &types.Value{
|
||||
Kind: &types.Value_StringValue{StringValue: file.title},
|
||||
}
|
||||
|
||||
blocks = append(blocks, &model.Block{
|
||||
Id: bson.NewObjectId().Hex(),
|
||||
Content: &model.BlockContentOfLink{
|
||||
Link: &model.BlockContentLink{
|
||||
TargetBlockId: file.pageID,
|
||||
Style: model.BlockContentLink_Page,
|
||||
Fields: &types.Struct{
|
||||
Fields: fields,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return blocks
|
||||
}
|
||||
|
||||
func (imp *importImpl) processFieldBlockIfItIs(blocks []*model.Block, files map[string]*fileInfo) (blocksOut []*model.Block) {
|
||||
if len(blocks) < 1 || blocks[0].GetText() == nil {
|
||||
return blocks
|
||||
}
|
||||
blocksOut = blocks
|
||||
|
||||
txt := blocks[0].GetText().Text
|
||||
if txt == "" ||
|
||||
(blocks[0].GetText().Marks != nil && len(blocks[0].GetText().Marks.Marks) > 0) {
|
||||
// fields can't have a markup
|
||||
return blocks
|
||||
}
|
||||
|
||||
potentialPairs := strings.Split(txt, "\n")
|
||||
|
||||
var text string
|
||||
var marks []*model.BlockContentTextMark
|
||||
for _, pair := range potentialPairs {
|
||||
if text != "" {
|
||||
text += "\n"
|
||||
}
|
||||
if len(pair) <= 3 || pair[len(pair)-3:] != ".md" {
|
||||
text += pair
|
||||
continue
|
||||
}
|
||||
|
||||
keyVal := strings.SplitN(pair, ":", 2)
|
||||
if len(keyVal) < 2 {
|
||||
text += pair
|
||||
continue
|
||||
}
|
||||
|
||||
potentialFileNames := strings.Split(keyVal[1], ",")
|
||||
text += keyVal[0] + ": "
|
||||
|
||||
for potentialFileNameIndex, potentialFileName := range potentialFileNames {
|
||||
potentialFileName, _ = url.PathUnescape(potentialFileName)
|
||||
potentialFileName = strings.ReplaceAll(potentialFileName, `"`, "")
|
||||
if potentialFileNameIndex != 0 {
|
||||
text += ", "
|
||||
}
|
||||
shortPath := ""
|
||||
id := imp.getIdFromPath(potentialFileName)
|
||||
for name := range files {
|
||||
if imp.getIdFromPath(name) == id {
|
||||
shortPath = name
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
file := files[shortPath]
|
||||
/*for name, anytypePageId := range nameToId {
|
||||
if imp.getIdFromPath(name) == id {
|
||||
targetId = anytypePageId
|
||||
}
|
||||
}*/
|
||||
|
||||
if file == nil || len(file.pageID) == 0 {
|
||||
text += potentialFileName
|
||||
log.Errorf("target file not found:", shortPath, potentialFileName)
|
||||
} else {
|
||||
log.Debug("target file found:", file.pageID, shortPath)
|
||||
file.hasInboundLinks = true
|
||||
if file.title == "" {
|
||||
// shouldn't be a case
|
||||
file.title = shortPath
|
||||
}
|
||||
|
||||
text += file.title
|
||||
marks = append(marks, &model.BlockContentTextMark{
|
||||
Range: &model.Range{int32(len(text) - len(file.title)), int32(len(text))},
|
||||
Type: model.BlockContentTextMark_Mention,
|
||||
Param: file.pageID,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(marks) > 0 {
|
||||
blockText := blocks[0].GetText()
|
||||
blockText.Text = text
|
||||
blockText.Marks = &model.BlockContentTextMarks{marks}
|
||||
}
|
||||
|
||||
return blocksOut
|
||||
}
|
||||
|
||||
func (imp *importImpl) getIdFromPath(path string) (id string) {
|
||||
a := strings.Split(path, " ")
|
||||
b := a[len(a)-1]
|
||||
if len(b) < 3 {
|
||||
return ""
|
||||
}
|
||||
return b[:len(b)-3]
|
||||
}
|
||||
|
||||
/*func (imp *importImpl) getShortPath(importPath string, ) (id string) {
|
||||
a := strings.Split(path, " ")
|
||||
b := a[len(a)-1]
|
||||
if len(b) < 3 {
|
||||
return ""
|
||||
}
|
||||
return b[:len(b)-3]
|
||||
}*/
|
||||
|
||||
func (imp *importImpl) shortPathToName(path string) (name string) {
|
||||
sArr := strings.Split(filepath.Base(path), " ")
|
||||
if len(sArr) == 0 {
|
||||
return path
|
||||
}
|
||||
|
||||
name = strings.Join(sArr[:len(sArr)-1], " ")
|
||||
return name
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
package _import
|
|
@ -7,7 +7,6 @@ import (
|
|||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/clipboard"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/dataview"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/file"
|
||||
_import "github.com/anytypeio/go-anytype-middleware/core/block/editor/import"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/smartblock"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/stext"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/table"
|
||||
|
@ -29,7 +28,6 @@ type Page struct {
|
|||
clipboard.Clipboard
|
||||
bookmark.Bookmark
|
||||
|
||||
_import.Import
|
||||
dataview.Dataview
|
||||
table.TableEditor
|
||||
|
||||
|
@ -38,8 +36,6 @@ type Page struct {
|
|||
|
||||
func NewPage(
|
||||
objectStore objectstore.ObjectStore,
|
||||
importerCtrl _import.Services,
|
||||
objectCreator _import.ObjectCreator,
|
||||
anytype core.Service,
|
||||
fileBlockService file.BlockService,
|
||||
bookmarkBlockService bookmark.BlockService,
|
||||
|
@ -72,12 +68,6 @@ func NewPage(
|
|||
bookmarkService,
|
||||
objectStore,
|
||||
),
|
||||
Import: _import.NewImport(
|
||||
sb,
|
||||
importerCtrl,
|
||||
objectCreator,
|
||||
anytype,
|
||||
),
|
||||
Dataview: dataview.NewDataview(
|
||||
sb,
|
||||
anytype,
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
package editor
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/basic"
|
||||
dataview "github.com/anytypeio/go-anytype-middleware/core/block/editor/dataview"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/smartblock"
|
||||
|
@ -18,8 +16,6 @@ import (
|
|||
"github.com/anytypeio/go-anytype-middleware/util/slice"
|
||||
)
|
||||
|
||||
var ErrAlreadyHasDataviewBlock = fmt.Errorf("already has the dataview block")
|
||||
|
||||
type Set struct {
|
||||
smartblock.SmartBlock
|
||||
basic.CommonOperations
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
package editor
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/smartblock"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/pb/model"
|
||||
)
|
||||
|
||||
func NewUninitialized(sbType model.SmartBlockType) smartblock.SmartBlock {
|
||||
switch sbType {
|
||||
case model.SmartBlockType_Page, model.SmartBlockType_Date:
|
||||
return &Page{}
|
||||
case model.SmartBlockType_Archive:
|
||||
return &Archive{}
|
||||
case model.SmartBlockType_Home:
|
||||
return &Dashboard{}
|
||||
case model.SmartBlockType_Set:
|
||||
return &Set{}
|
||||
case model.SmartBlockType_ProfilePage, model.SmartBlockType_AnytypeProfile:
|
||||
return &Profile{}
|
||||
case model.SmartBlockType_STObjectType,
|
||||
model.SmartBlockType_BundledObjectType:
|
||||
return &ObjectType{}
|
||||
case model.SmartBlockType_BundledRelation:
|
||||
return &Set{}
|
||||
case model.SmartBlockType_SubObject:
|
||||
return &SubObject{}
|
||||
case model.SmartBlockType_File:
|
||||
return &Files{}
|
||||
case model.SmartBlockType_MarketplaceType:
|
||||
return &MarketplaceType{}
|
||||
case model.SmartBlockType_MarketplaceRelation:
|
||||
return &MarketplaceRelation{}
|
||||
case model.SmartBlockType_MarketplaceTemplate:
|
||||
return &MarketplaceTemplate{}
|
||||
case model.SmartBlockType_Template:
|
||||
return &Template{}
|
||||
case model.SmartBlockType_BundledTemplate:
|
||||
return &Template{}
|
||||
case model.SmartBlockType_Breadcrumbs:
|
||||
return &Breadcrumbs{}
|
||||
case model.SmartBlockType_Workspace:
|
||||
return &Workspaces{}
|
||||
case model.SmartBlockType_AccountOld:
|
||||
return &ThreadDB{}
|
||||
case model.SmartBlockType_Widget:
|
||||
return &WidgetObject{}
|
||||
default:
|
||||
panic(fmt.Errorf("unexpected smartblock type: %v", sbType))
|
||||
}
|
||||
}
|
|
@ -43,8 +43,6 @@ type ApplyFlag int
|
|||
var (
|
||||
ErrSimpleBlockNotFound = errors.New("simple block not found")
|
||||
ErrCantInitExistingSmartblockWithNonEmptyState = errors.New("can't init existing smartblock with non-empty state")
|
||||
ErrRelationOptionNotFound = errors.New("relation option not found")
|
||||
ErrRelationNotFound = errors.New("relation not found")
|
||||
ErrIsDeleted = errors.New("smartblock is deleted")
|
||||
)
|
||||
|
||||
|
@ -1198,41 +1196,6 @@ func (sb *smartBlock) AddHook(f HookCallback, events ...Hook) {
|
|||
}
|
||||
}
|
||||
|
||||
func mergeAndSortRelations(objTypeRelations []*model.Relation, extraRelations []*model.Relation, aggregatedRelations []*model.Relation, details *types.Struct) []*model.Relation {
|
||||
var m = make(map[string]int, len(extraRelations))
|
||||
var rels = make([]*model.Relation, 0, len(objTypeRelations)+len(extraRelations))
|
||||
|
||||
for i, rel := range extraRelations {
|
||||
m[rel.Key] = i
|
||||
rels = append(rels, pbtypes.CopyRelation(rel))
|
||||
}
|
||||
|
||||
for _, rel := range objTypeRelations {
|
||||
if _, exists := m[rel.Key]; exists {
|
||||
continue
|
||||
}
|
||||
rels = append(rels, pbtypes.CopyRelation(rel))
|
||||
m[rel.Key] = len(rels) - 1
|
||||
}
|
||||
|
||||
for _, rel := range aggregatedRelations {
|
||||
if i, exists := m[rel.Key]; exists {
|
||||
// overwrite name that we've got from DS
|
||||
if rels[i].Name != rel.Name {
|
||||
rels[i].Name = rel.Name
|
||||
}
|
||||
continue
|
||||
}
|
||||
rels = append(rels, pbtypes.CopyRelation(rel))
|
||||
m[rel.Key] = len(rels) - 1
|
||||
}
|
||||
|
||||
if details == nil || details.Fields == nil {
|
||||
return rels
|
||||
}
|
||||
return rels
|
||||
}
|
||||
|
||||
func (sb *smartBlock) baseRelations() []*model.Relation {
|
||||
rels := []*model.Relation{bundle.MustGetRelation(bundle.RelationKeyId), bundle.MustGetRelation(bundle.RelationKeyLayout), bundle.MustGetRelation(bundle.RelationKeyIconEmoji), bundle.MustGetRelation(bundle.RelationKeyName)}
|
||||
for _, rel := range rels {
|
||||
|
|
|
@ -13,7 +13,6 @@ import (
|
|||
|
||||
var (
|
||||
maxChildrenThreshold = 40
|
||||
divSize = maxChildrenThreshold / 2
|
||||
)
|
||||
|
||||
func (s *State) Normalize(withLayouts bool) (err error) {
|
||||
|
|
|
@ -33,7 +33,6 @@ const (
|
|||
|
||||
HeaderLayoutID = "header"
|
||||
TitleBlockID = "title"
|
||||
DescriptionBlockID = "description"
|
||||
DataviewBlockID = "dataview"
|
||||
DataviewTemplatesBlockID = "templates"
|
||||
FeaturedRelationsID = "featuredRelations"
|
||||
|
@ -287,13 +286,6 @@ func (s *State) IsChild(parentId, childId string) bool {
|
|||
}
|
||||
}
|
||||
|
||||
func (s *State) PickOriginParentOf(id string) (res simple.Block) {
|
||||
if s.parent != nil {
|
||||
return s.parent.PickParentOf(id)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (s *State) getStringBuf() []string {
|
||||
if s.parent != nil {
|
||||
return s.parent.getStringBuf()
|
||||
|
|
|
@ -5,7 +5,6 @@ import (
|
|||
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/bookmark"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/file"
|
||||
_import "github.com/anytypeio/go-anytype-middleware/core/block/editor/import"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/smartblock"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/state"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/template"
|
||||
|
@ -23,8 +22,6 @@ type Template struct {
|
|||
|
||||
func NewTemplate(
|
||||
objectStore objectstore.ObjectStore,
|
||||
importerCtrl _import.Services,
|
||||
objectCreator _import.ObjectCreator,
|
||||
anytype core.Service,
|
||||
fileBlockService file.BlockService,
|
||||
bookmarkBlockService bookmark.BlockService,
|
||||
|
@ -33,8 +30,6 @@ func NewTemplate(
|
|||
) *Template {
|
||||
return &Template{Page: NewPage(
|
||||
objectStore,
|
||||
importerCtrl,
|
||||
objectCreator,
|
||||
anytype,
|
||||
fileBlockService,
|
||||
bookmarkBlockService,
|
||||
|
|
|
@ -44,20 +44,6 @@ var WithEmpty = StateTransformer(func(s *state.State) {
|
|||
|
||||
})
|
||||
|
||||
var WithObjectTypes = func(otypes []string) StateTransformer {
|
||||
return func(s *state.State) {
|
||||
if len(s.ObjectTypes()) == 0 {
|
||||
s.SetObjectTypes(otypes)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var WithForcedObjectTypes = func(otypes []string) StateTransformer {
|
||||
return func(s *state.State) {
|
||||
s.SetObjectTypes(otypes)
|
||||
}
|
||||
}
|
||||
|
||||
// WithNoObjectTypes is a special case used only for Archive
|
||||
var WithNoObjectTypes = func() StateTransformer {
|
||||
return func(s *state.State) {
|
||||
|
@ -292,26 +278,6 @@ var WithAddedFeaturedRelation = func(key bundle.RelationKey) StateTransformer {
|
|||
}
|
||||
}
|
||||
|
||||
var WithAddedFeaturedRelations = func(keys ...string) StateTransformer {
|
||||
return func(s *state.State) {
|
||||
currentVal := pbtypes.GetStringList(s.Details(), bundle.RelationKeyFeaturedRelations.String())
|
||||
|
||||
keys = slice.Filter(keys, func(key string) bool {
|
||||
if slice.FindPos(currentVal, key) > -1 {
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
})
|
||||
|
||||
if len(keys) > 0 {
|
||||
s.SetDetail(bundle.RelationKeyFeaturedRelations.String(), pbtypes.StringList(append(currentVal, keys...)))
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
var WithCreatorRemovedFromFeaturedRelations = StateTransformer(func(s *state.State) {
|
||||
fr := pbtypes.GetStringList(s.Details(), bundle.RelationKeyFeaturedRelations.String())
|
||||
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
package importer
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/gogo/protobuf/types"
|
||||
"go.uber.org/zap"
|
||||
|
||||
"github.com/anytypeio/go-anytype-middleware/app"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/import/converter"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/import/notion"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/import/syncer"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/import/web"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/object"
|
||||
|
@ -45,10 +46,10 @@ func (i *Import) Init(a *app.App) (err error) {
|
|||
i.converters[converter.Name()] = converter
|
||||
}
|
||||
factory := syncer.New(syncer.NewFileSyncer(i.s), syncer.NewBookmarkSyncer(i.s), syncer.NewIconSyncer(i.s))
|
||||
ou := NewObjectUpdater(i.s, core, factory)
|
||||
fs := a.MustComponent(filestore.CName).(filestore.FileStore)
|
||||
objCreator := a.MustComponent(object.CName).(objectCreator)
|
||||
relationCreator := NewRelationCreator(i.s, objCreator, fs, core)
|
||||
ou := NewObjectUpdater(i.s, core, factory, relationCreator)
|
||||
i.oc = NewCreator(i.s, objCreator, ou, factory, relationCreator)
|
||||
return nil
|
||||
}
|
||||
|
@ -106,7 +107,8 @@ func (s *Import) Name() string {
|
|||
}
|
||||
|
||||
// ListImports return all registered import types
|
||||
func (i *Import) ListImports(ctx *session.Context, req *pb.RpcObjectImportListRequest) ([]*pb.RpcObjectImportListImportResponse, error) {
|
||||
func (i *Import) ListImports(_ *session.Context,
|
||||
_ *pb.RpcObjectImportListRequest) ([]*pb.RpcObjectImportListImportResponse, error) {
|
||||
res := make([]*pb.RpcObjectImportListImportResponse, len(i.converters))
|
||||
var idx int
|
||||
for _, c := range i.converters {
|
||||
|
@ -116,6 +118,13 @@ func (i *Import) ListImports(ctx *session.Context, req *pb.RpcObjectImportListRe
|
|||
return res, nil
|
||||
}
|
||||
|
||||
// ValidateNotionToken return all registered import types
|
||||
func (i *Import) ValidateNotionToken(ctx context.Context,
|
||||
req *pb.RpcObjectImportNotionValidateTokenRequest) pb.RpcObjectImportNotionValidateTokenResponseErrorCode {
|
||||
tv := notion.NewTokenValidator()
|
||||
return tv.Validate(ctx, req.GetToken())
|
||||
}
|
||||
|
||||
func (i *Import) ImportWeb(ctx *session.Context, req *pb.RpcObjectImportRequest) (string, *types.Struct, error) {
|
||||
progress := process.NewProgress(pb.ModelProcess_Import)
|
||||
defer progress.Finish()
|
||||
|
|
|
@ -3,7 +3,6 @@ package client
|
|||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/logging"
|
||||
)
|
||||
|
||||
|
@ -13,7 +12,7 @@ type NotionErrorResponse struct {
|
|||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// and creates error based on NotionErrorResponse
|
||||
// TransformHTTPCodeToError creates error based on NotionErrorResponse
|
||||
func TransformHTTPCodeToError(response []byte) error {
|
||||
var notionErr NotionErrorResponse
|
||||
if err := json.Unmarshal(response, ¬ionErr); err != nil {
|
||||
|
|
94
core/block/import/notion/validator.go
Normal file
94
core/block/import/notion/validator.go
Normal file
|
@ -0,0 +1,94 @@
|
|||
package notion
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"go.uber.org/zap"
|
||||
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/import/notion/api/client"
|
||||
"github.com/anytypeio/go-anytype-middleware/pb"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/logging"
|
||||
)
|
||||
|
||||
var (
|
||||
ErrorInternal = errors.New("internal")
|
||||
ErrorUnauthorized = errors.New("unauthorized")
|
||||
)
|
||||
|
||||
var logger = logging.Logger("notion-ping")
|
||||
|
||||
const (
|
||||
endpoint = "/users?page_size=1"
|
||||
)
|
||||
|
||||
type Service struct {
|
||||
client *client.Client
|
||||
}
|
||||
|
||||
// NewPingService is a constructor for PingService
|
||||
func NewPingService(client *client.Client) *Service {
|
||||
return &Service{
|
||||
client: client,
|
||||
}
|
||||
}
|
||||
|
||||
// Ping is function to validate token, it calls users endpoint and checks given error,
|
||||
func (s *Service) Ping(ctx context.Context, apiKey string) error {
|
||||
req, err := s.client.PrepareRequest(ctx, apiKey, http.MethodGet, endpoint, &bytes.Buffer{})
|
||||
if err != nil {
|
||||
logger.With(zap.String("method", "PrepareRequest")).Error(err)
|
||||
return errors.Wrap(ErrorInternal, fmt.Sprintf("ping: %s", err.Error()))
|
||||
}
|
||||
res, err := s.client.HTTPClient.Do(req)
|
||||
if err != nil {
|
||||
logger.With(zap.String("method", "Do")).Error(err)
|
||||
return errors.Wrap(ErrorInternal, fmt.Sprintf("ping: %s", err.Error()))
|
||||
}
|
||||
defer res.Body.Close()
|
||||
|
||||
b, err := ioutil.ReadAll(res.Body)
|
||||
|
||||
if err != nil {
|
||||
logger.With(zap.String("method", "ioutil.ReadAll")).Error(err)
|
||||
return errors.Wrap(ErrorInternal, err.Error())
|
||||
}
|
||||
if res.StatusCode != http.StatusOK {
|
||||
if res.StatusCode == http.StatusUnauthorized {
|
||||
return ErrorUnauthorized
|
||||
}
|
||||
err = client.TransformHTTPCodeToError(b)
|
||||
if err != nil {
|
||||
return errors.Wrap(ErrorInternal, err.Error())
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type TokenValidator struct {
|
||||
ping *Service
|
||||
}
|
||||
|
||||
func NewTokenValidator() *TokenValidator {
|
||||
cl := client.NewClient()
|
||||
return &TokenValidator{
|
||||
ping: NewPingService(cl),
|
||||
}
|
||||
}
|
||||
|
||||
// Validate calls Notion API with given api key and check, if error is unauthorized
|
||||
func (v TokenValidator) Validate(ctx context.Context,
|
||||
apiKey string) pb.RpcObjectImportNotionValidateTokenResponseErrorCode {
|
||||
err := v.ping.Ping(ctx, apiKey)
|
||||
if errors.Is(err, ErrorInternal) {
|
||||
return pb.RpcObjectImportNotionValidateTokenResponseError_INTERNAL_ERROR
|
||||
}
|
||||
if errors.Is(err, ErrorUnauthorized) {
|
||||
return pb.RpcObjectImportNotionValidateTokenResponseError_UNAUTHORIZED
|
||||
}
|
||||
return pb.RpcObjectImportNotionValidateTokenResponseError_NULL
|
||||
}
|
64
core/block/import/notion/validator_test.go
Normal file
64
core/block/import/notion/validator_test.go
Normal file
|
@ -0,0 +1,64 @@
|
|||
package notion
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/import/notion/api/client"
|
||||
"github.com/anytypeio/go-anytype-middleware/pb"
|
||||
)
|
||||
|
||||
func Test_ValidateTokenNotValid(t *testing.T) {
|
||||
s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
w.WriteHeader(http.StatusUnauthorized)
|
||||
w.Write([]byte(`{"object":"error","status":401,"code":"unauthorized","message":"unauthorized"}`))
|
||||
}))
|
||||
|
||||
defer s.Close()
|
||||
c := client.NewClient()
|
||||
c.BasePath = s.URL
|
||||
|
||||
p := NewPingService(c)
|
||||
tv := NewTokenValidator()
|
||||
tv.ping = p
|
||||
|
||||
err := tv.Validate(context.TODO(), "123123")
|
||||
assert.Equal(t, err, pb.RpcObjectImportNotionValidateTokenResponseError_UNAUTHORIZED)
|
||||
}
|
||||
|
||||
func Test_ValidateTokenSuccess(t *testing.T) {
|
||||
s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {}))
|
||||
|
||||
defer s.Close()
|
||||
c := client.NewClient()
|
||||
c.BasePath = s.URL
|
||||
|
||||
p := NewPingService(c)
|
||||
tv := NewTokenValidator()
|
||||
tv.ping = p
|
||||
|
||||
err := tv.Validate(context.TODO(), "123123")
|
||||
assert.Equal(t, err, pb.RpcObjectImportNotionValidateTokenResponseError_NULL)
|
||||
}
|
||||
|
||||
func Test_ValidateTokenInternalError(t *testing.T) {
|
||||
s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
w.Write([]byte(`{"object":"error","status":400,"code":"invalid_json","message":"The request body could not be decoded as JSON"}`))
|
||||
}))
|
||||
|
||||
defer s.Close()
|
||||
c := client.NewClient()
|
||||
c.BasePath = s.URL
|
||||
|
||||
p := NewPingService(c)
|
||||
tv := NewTokenValidator()
|
||||
tv.ping = p
|
||||
|
||||
err := tv.Validate(context.TODO(), "123123")
|
||||
assert.Equal(t, err, pb.RpcObjectImportNotionValidateTokenResponseError_INTERNAL_ERROR)
|
||||
}
|
|
@ -9,7 +9,6 @@ import (
|
|||
"go.uber.org/zap"
|
||||
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block"
|
||||
editor "github.com/anytypeio/go-anytype-middleware/core/block/editor/smartblock"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/state"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/import/converter"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/import/syncer"
|
||||
|
@ -66,9 +65,16 @@ func (oc *ObjectCreator) Create(ctx *session.Context,
|
|||
var err error
|
||||
|
||||
if updateExisting {
|
||||
if details, err := oc.updater.Update(ctx, snapshot, pageID); err == nil {
|
||||
var (
|
||||
filesToDelete []string
|
||||
details *types.Struct
|
||||
)
|
||||
if details, filesToDelete, err = oc.updater.Update(ctx, snapshot, relations, pageID); err == nil {
|
||||
return details, nil
|
||||
}
|
||||
for _, hash := range filesToDelete {
|
||||
oc.deleteFile(hash)
|
||||
}
|
||||
log.Warn("failed to update existing object: %s", err)
|
||||
}
|
||||
|
||||
|
@ -113,7 +119,7 @@ func (oc *ObjectCreator) Create(ctx *session.Context,
|
|||
}
|
||||
|
||||
var oldRelationBlocksToNew map[string]*model.Block
|
||||
filesToDelete, oldRelationBlocksToNew, err = oc.relationCreator.Create(ctx, snapshot, relations, pageID)
|
||||
filesToDelete, oldRelationBlocksToNew, err = oc.relationCreator.CreateRelations(ctx, snapshot, pageID, relations)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("relation create '%s'", err)
|
||||
}
|
||||
|
@ -126,7 +132,7 @@ func (oc *ObjectCreator) Create(ctx *session.Context,
|
|||
}
|
||||
}
|
||||
|
||||
oc.replaceRelationBlock(ctx, st, oldRelationBlocksToNew, pageID)
|
||||
oc.relationCreator.ReplaceRelationBlock(ctx, oldRelationBlocksToNew, pageID)
|
||||
|
||||
st.Iterate(func(bl simple.Block) (isContinue bool) {
|
||||
s := oc.syncFactory.GetSyncer(bl)
|
||||
|
@ -199,36 +205,3 @@ func (oc *ObjectCreator) deleteFile(hash string) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (oc *ObjectCreator) replaceRelationBlock(ctx *session.Context,
|
||||
st *state.State,
|
||||
oldRelationBlocksToNew map[string]*model.Block,
|
||||
pageID string) {
|
||||
if err := st.Iterate(func(b simple.Block) (isContinue bool) {
|
||||
if b.Model().GetRelation() == nil {
|
||||
return true
|
||||
}
|
||||
bl, ok := oldRelationBlocksToNew[b.Model().GetId()]
|
||||
if !ok {
|
||||
return true
|
||||
}
|
||||
if sbErr := oc.service.Do(pageID, func(sb editor.SmartBlock) error {
|
||||
s := sb.NewStateCtx(ctx)
|
||||
simpleBlock := simple.New(bl)
|
||||
s.Add(simpleBlock)
|
||||
if err := s.InsertTo(b.Model().GetId(), model.Block_Replace, simpleBlock.Model().GetId()); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := sb.Apply(s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}); sbErr != nil {
|
||||
log.With(zap.String("object id", pageID)).Errorf("failed to replace relation block: %w", sbErr)
|
||||
}
|
||||
|
||||
return true
|
||||
}); err != nil {
|
||||
log.With(zap.String("object id", pageID)).Errorf("failed to replace relation block: %w", err)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,10 +4,12 @@ import (
|
|||
"fmt"
|
||||
|
||||
"github.com/gogo/protobuf/types"
|
||||
"go.uber.org/zap"
|
||||
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/basic"
|
||||
sb "github.com/anytypeio/go-anytype-middleware/core/block/editor/smartblock"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/import/converter"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/import/syncer"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/simple"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/session"
|
||||
|
@ -19,20 +21,28 @@ import (
|
|||
)
|
||||
|
||||
type ObjectUpdater struct {
|
||||
service *block.Service
|
||||
core core.Service
|
||||
syncFactory *syncer.Factory
|
||||
service *block.Service
|
||||
core core.Service
|
||||
syncFactory *syncer.Factory
|
||||
relationCreator RelationCreator
|
||||
}
|
||||
|
||||
func NewObjectUpdater(service *block.Service, core core.Service, syncFactory *syncer.Factory) Updater {
|
||||
func NewObjectUpdater(service *block.Service,
|
||||
core core.Service,
|
||||
syncFactory *syncer.Factory,
|
||||
relationCreator RelationCreator) Updater {
|
||||
return &ObjectUpdater{
|
||||
service: service,
|
||||
core: core,
|
||||
syncFactory: syncFactory,
|
||||
service: service,
|
||||
core: core,
|
||||
syncFactory: syncFactory,
|
||||
relationCreator: relationCreator,
|
||||
}
|
||||
}
|
||||
|
||||
func (ou *ObjectUpdater) Update(ctx *session.Context, snapshot *model.SmartBlockSnapshotBase, pageID string) (*types.Struct, error) {
|
||||
func (ou *ObjectUpdater) Update(ctx *session.Context,
|
||||
snapshot *model.SmartBlockSnapshotBase,
|
||||
relations []*converter.Relation,
|
||||
pageID string) (*types.Struct, []string, error) {
|
||||
if snapshot.Details != nil && snapshot.Details.Fields[bundle.RelationKeySource.String()] != nil {
|
||||
source := snapshot.Details.Fields[bundle.RelationKeySource.String()].GetStringValue()
|
||||
records, _, err := ou.core.ObjectStore().Query(nil, database.Query{
|
||||
|
@ -47,7 +57,8 @@ func (ou *ObjectUpdater) Update(ctx *session.Context, snapshot *model.SmartBlock
|
|||
})
|
||||
if err == nil {
|
||||
if len(records) > 0 {
|
||||
return records[0].Details, ou.update(ctx, snapshot, records, pageID)
|
||||
filesToDelete, err := ou.update(ctx, snapshot, records[0].Details, relations, pageID)
|
||||
return records[0].Details, filesToDelete, err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -65,61 +76,72 @@ func (ou *ObjectUpdater) Update(ctx *session.Context, snapshot *model.SmartBlock
|
|||
})
|
||||
if err == nil {
|
||||
if len(records) > 0 {
|
||||
return records[0].Details, ou.update(ctx, snapshot, records, pageID)
|
||||
filesToDelete, err := ou.update(ctx, snapshot, records[0].Details, relations, pageID)
|
||||
return records[0].Details, filesToDelete, err
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil, fmt.Errorf("no source or id details")
|
||||
return nil, nil, fmt.Errorf("no source or id details")
|
||||
}
|
||||
|
||||
func (ou *ObjectUpdater) update(ctx *session.Context,
|
||||
snapshot *model.SmartBlockSnapshotBase,
|
||||
records []database.Record,
|
||||
pageID string) error {
|
||||
details := records[0]
|
||||
details *types.Struct,
|
||||
relations []*converter.Relation,
|
||||
pageID string) ([]string, error) {
|
||||
simpleBlocks := make([]simple.Block, 0)
|
||||
id := details.Details.Fields[bundle.RelationKeyId.String()].GetStringValue()
|
||||
if details.Details != nil {
|
||||
allBlocksIds := make([]string, 0)
|
||||
if err := ou.service.Do(id, func(b sb.SmartBlock) error {
|
||||
s := b.NewStateCtx(ctx)
|
||||
if err := b.Iterate(func(b simple.Block) (isContinue bool) {
|
||||
if b.Model().GetLink() == nil && id != b.Model().Id {
|
||||
allBlocksIds = append(allBlocksIds, b.Model().Id)
|
||||
}
|
||||
return true
|
||||
}); err != nil {
|
||||
return err
|
||||
var (
|
||||
filesToDelete = make([]string, 0)
|
||||
oldRelationBlockToNew = make(map[string]*model.Block, 0)
|
||||
)
|
||||
id := details.Fields[bundle.RelationKeyId.String()].GetStringValue()
|
||||
allBlocksIds := make([]string, 0)
|
||||
if err := ou.service.Do(id, func(b sb.SmartBlock) error {
|
||||
s := b.NewStateCtx(ctx)
|
||||
if err := b.Iterate(func(b simple.Block) (isContinue bool) {
|
||||
if b.Model().GetLink() == nil && id != b.Model().Id {
|
||||
allBlocksIds = append(allBlocksIds, b.Model().Id)
|
||||
}
|
||||
for _, v := range allBlocksIds {
|
||||
s.Unlink(v)
|
||||
}
|
||||
for _, block := range snapshot.Blocks {
|
||||
if block.GetLink() != nil {
|
||||
// we don't add link to non-existing object,so checking existence of the object with TargetBlockId in Do
|
||||
if err := ou.service.Do(block.GetLink().TargetBlockId, func(b sb.SmartBlock) error {
|
||||
return nil
|
||||
}); err != nil {
|
||||
continue
|
||||
}
|
||||
}
|
||||
if block.Id != pageID {
|
||||
simpleBlocks = append(simpleBlocks, simple.New(block))
|
||||
}
|
||||
}
|
||||
if err := basic.NewBasic(b).PasteBlocks(s, "", model.Block_Bottom, simpleBlocks); err != nil {
|
||||
return err
|
||||
}
|
||||
return b.Apply(s)
|
||||
return true
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
for _, b := range simpleBlocks {
|
||||
s := ou.syncFactory.GetSyncer(b)
|
||||
if s != nil {
|
||||
s.Sync(ctx, id, b)
|
||||
for _, v := range allBlocksIds {
|
||||
s.Unlink(v)
|
||||
}
|
||||
for _, block := range snapshot.Blocks {
|
||||
if block.GetLink() != nil {
|
||||
// we don't add link to non-existing object,so checking existence of the object with TargetBlockId in Do
|
||||
if err := ou.service.Do(block.GetLink().TargetBlockId, func(b sb.SmartBlock) error {
|
||||
return nil
|
||||
}); err != nil {
|
||||
continue
|
||||
}
|
||||
}
|
||||
if block.Id != pageID {
|
||||
simpleBlocks = append(simpleBlocks, simple.New(block))
|
||||
}
|
||||
}
|
||||
if err := basic.NewBasic(b).PasteBlocks(s, "", model.Block_Bottom, simpleBlocks); err != nil {
|
||||
return err
|
||||
}
|
||||
return b.Apply(s)
|
||||
}); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var err error
|
||||
filesToDelete, oldRelationBlockToNew, err = ou.relationCreator.CreateRelations(ctx, snapshot, id, relations)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ou.relationCreator.ReplaceRelationBlock(ctx, oldRelationBlockToNew, id)
|
||||
for _, b := range simpleBlocks {
|
||||
s := ou.syncFactory.GetSyncer(b)
|
||||
if s != nil {
|
||||
if err := s.Sync(ctx, id, b); err != nil {
|
||||
log.With(zap.String("object id", pageID)).Errorf("failed to sync %s", err.Error())
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
return filesToDelete, nil
|
||||
}
|
||||
|
|
|
@ -5,13 +5,17 @@ import (
|
|||
|
||||
"github.com/globalsign/mgo/bson"
|
||||
"github.com/gogo/protobuf/types"
|
||||
"go.uber.org/zap"
|
||||
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block"
|
||||
editor "github.com/anytypeio/go-anytype-middleware/core/block/editor/smartblock"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/import/converter"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/simple"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/session"
|
||||
"github.com/anytypeio/go-anytype-middleware/pb"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/bundle"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/core"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/database"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/localstore/filestore"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/pb/model"
|
||||
"github.com/anytypeio/go-anytype-middleware/util/pbtypes"
|
||||
|
@ -46,9 +50,76 @@ func NewRelationCreator(service *block.Service,
|
|||
}
|
||||
}
|
||||
|
||||
func (rc *RelationService) CreateRelations(ctx *session.Context,
|
||||
snapshot *model.SmartBlockSnapshotBase,
|
||||
pageID string,
|
||||
relations []*converter.Relation) ([]string, map[string]*model.Block, error) {
|
||||
notExistedRelations := make([]*converter.Relation, 0)
|
||||
existedRelations := make(map[string]*converter.Relation, 0)
|
||||
for _, r := range relations {
|
||||
if strings.EqualFold(r.Name, bundle.RelationKeyName.String()) {
|
||||
continue
|
||||
}
|
||||
if rel, ok := rc.createdRelations[r.Name]; ok {
|
||||
var exist bool
|
||||
for _, v := range rel {
|
||||
if v.Format == r.Format {
|
||||
existedRelations[v.ID] = r
|
||||
exist = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if exist {
|
||||
continue
|
||||
}
|
||||
}
|
||||
records, _, err := rc.core.ObjectStore().Query(nil, database.Query{
|
||||
Filters: []*model.BlockContentDataviewFilter{
|
||||
{
|
||||
Condition: model.BlockContentDataviewFilter_Equal,
|
||||
RelationKey: bundle.RelationKeyName.String(),
|
||||
Value: pbtypes.String(r.Name),
|
||||
Format: r.Format,
|
||||
},
|
||||
},
|
||||
Limit: 1,
|
||||
})
|
||||
if err == nil && len(records) > 0 {
|
||||
id := pbtypes.GetString(records[0].Details, bundle.RelationKeyRelationKey.String())
|
||||
existedRelations[id] = r
|
||||
continue
|
||||
}
|
||||
notExistedRelations = append(notExistedRelations, r)
|
||||
}
|
||||
|
||||
filesToDelete, oldRelationBlockToNewUpdate, failedRelations, err := rc.update(ctx, snapshot, existedRelations, pageID)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
notExistedRelations = append(notExistedRelations, failedRelations...)
|
||||
createfilesToDelete, oldRelationBlockToNewCreate, err := rc.create(ctx, snapshot, notExistedRelations, pageID)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
filesToDelete = append(filesToDelete, createfilesToDelete...)
|
||||
totalNumberOfRelationBlocks := len(oldRelationBlockToNewCreate) + len(oldRelationBlockToNewUpdate)
|
||||
oldRelationBlockToNewTotal := make(map[string]*model.Block, totalNumberOfRelationBlocks)
|
||||
if len(oldRelationBlockToNewUpdate) == 0 {
|
||||
for k, b := range oldRelationBlockToNewUpdate {
|
||||
oldRelationBlockToNewTotal[k] = b
|
||||
}
|
||||
}
|
||||
if len(oldRelationBlockToNewCreate) == 0 {
|
||||
for k, b := range oldRelationBlockToNewCreate {
|
||||
oldRelationBlockToNewTotal[k] = b
|
||||
}
|
||||
}
|
||||
return filesToDelete, oldRelationBlockToNewTotal, nil
|
||||
}
|
||||
|
||||
// Create read relations link from snaphot and create according relations in anytype,
|
||||
// also set details for according relation in object for files it loads them in ipfs
|
||||
func (rc *RelationService) Create(ctx *session.Context,
|
||||
func (rc *RelationService) create(ctx *session.Context,
|
||||
snapshot *model.SmartBlockSnapshotBase,
|
||||
relations []*converter.Relation,
|
||||
pageID string) ([]string, map[string]*model.Block, error) {
|
||||
|
@ -62,30 +133,15 @@ func (rc *RelationService) Create(ctx *session.Context,
|
|||
)
|
||||
|
||||
for _, r := range relations {
|
||||
var (
|
||||
relationID string
|
||||
)
|
||||
if rel, ok := rc.createdRelations[r.Name]; ok {
|
||||
for _, v := range rel {
|
||||
if v.Format == r.Format {
|
||||
relationID = v.ID
|
||||
existedRelationsIDs = append(existedRelationsIDs, relationID)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if relationID == "" {
|
||||
detail := &types.Struct{
|
||||
Fields: map[string]*types.Value{
|
||||
bundle.RelationKeyName.String(): pbtypes.String(r.Name),
|
||||
bundle.RelationKeyRelationFormat.String(): pbtypes.Int64(int64(r.Format)),
|
||||
bundle.RelationKeyType.String(): pbtypes.String(bundle.TypeKeyRelation.URL()),
|
||||
bundle.RelationKeyLayout.String(): pbtypes.Float64(float64(model.ObjectType_relation)),
|
||||
},
|
||||
}
|
||||
createRequest = append(createRequest, detail)
|
||||
detail := &types.Struct{
|
||||
Fields: map[string]*types.Value{
|
||||
bundle.RelationKeyName.String(): pbtypes.String(r.Name),
|
||||
bundle.RelationKeyRelationFormat.String(): pbtypes.Int64(int64(r.Format)),
|
||||
bundle.RelationKeyType.String(): pbtypes.String(bundle.TypeKeyRelation.URL()),
|
||||
bundle.RelationKeyLayout.String(): pbtypes.Float64(float64(model.ObjectType_relation)),
|
||||
},
|
||||
}
|
||||
createRequest = append(createRequest, detail)
|
||||
}
|
||||
var objects []*types.Struct
|
||||
if _, objects, err = rc.objCreator.CreateSubObjectsInWorkspace(createRequest); err != nil {
|
||||
|
@ -159,6 +215,95 @@ func (rc *RelationService) Create(ctx *session.Context,
|
|||
return filesToDelete, oldRelationBlockToNew, nil
|
||||
}
|
||||
|
||||
func (rc *RelationService) update(ctx *session.Context,
|
||||
snapshot *model.SmartBlockSnapshotBase,
|
||||
relations map[string]*converter.Relation,
|
||||
pageID string) ([]string, map[string]*model.Block, []*converter.Relation, error) {
|
||||
var (
|
||||
err error
|
||||
filesToDelete = make([]string, 0)
|
||||
oldRelationBlockToNew = make(map[string]*model.Block, 0)
|
||||
failedRelations = make([]*converter.Relation, 0)
|
||||
)
|
||||
|
||||
// to get failed relations and fallback them to create function
|
||||
for key, r := range relations {
|
||||
if err = rc.service.AddExtraRelations(ctx, pageID, []string{key}); err != nil {
|
||||
log.Errorf("add extra relation %s", err)
|
||||
failedRelations = append(failedRelations, r)
|
||||
continue
|
||||
}
|
||||
if snapshot.Details != nil && snapshot.Details.Fields != nil {
|
||||
if snapshot.Details.Fields[r.Name].GetListValue() != nil {
|
||||
rc.handleListValue(ctx, snapshot, r, key)
|
||||
}
|
||||
if r.Format == model.RelationFormat_file {
|
||||
filesToDelete = append(filesToDelete, rc.handleFileRelation(ctx, snapshot, r.Name)...)
|
||||
}
|
||||
}
|
||||
setDetailsRequest := make([]*pb.RpcObjectSetDetailsDetail, 0)
|
||||
setDetailsRequest = append(setDetailsRequest, &pb.RpcObjectSetDetailsDetail{
|
||||
Key: key,
|
||||
Value: snapshot.Details.Fields[r.Name],
|
||||
})
|
||||
if r.BlockID != "" {
|
||||
original, new := rc.linkRelationsBlocks(snapshot, r.BlockID, key)
|
||||
if original != nil && new != nil {
|
||||
oldRelationBlockToNew[original.GetId()] = new
|
||||
}
|
||||
}
|
||||
err = rc.service.SetDetails(ctx, pb.RpcObjectSetDetailsRequest{
|
||||
ContextId: pageID,
|
||||
Details: setDetailsRequest,
|
||||
})
|
||||
if err != nil {
|
||||
log.Errorf("set details %s", err)
|
||||
failedRelations = append(failedRelations, r)
|
||||
}
|
||||
}
|
||||
|
||||
if ftd, err := rc.handleCoverRelation(ctx, snapshot, pageID); err != nil {
|
||||
log.Errorf("failed to upload cover image %s", err)
|
||||
} else {
|
||||
filesToDelete = append(filesToDelete, ftd...)
|
||||
}
|
||||
|
||||
return filesToDelete, oldRelationBlockToNew, failedRelations, nil
|
||||
|
||||
}
|
||||
|
||||
func (rc *RelationService) ReplaceRelationBlock(ctx *session.Context,
|
||||
oldRelationBlocksToNew map[string]*model.Block,
|
||||
pageID string) {
|
||||
if sbErr := rc.service.Do(pageID, func(sb editor.SmartBlock) error {
|
||||
s := sb.NewStateCtx(ctx)
|
||||
if err := s.Iterate(func(b simple.Block) (isContinue bool) {
|
||||
if b.Model().GetRelation() == nil {
|
||||
return true
|
||||
}
|
||||
bl, ok := oldRelationBlocksToNew[b.Model().GetId()]
|
||||
if !ok {
|
||||
return true
|
||||
}
|
||||
simpleBlock := simple.New(bl)
|
||||
s.Add(simpleBlock)
|
||||
if err := s.InsertTo(b.Model().GetId(), model.Block_Replace, simpleBlock.Model().GetId()); err != nil {
|
||||
log.With(zap.String("object id", pageID)).Errorf("failed to insert: %w", err)
|
||||
}
|
||||
return true
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := sb.Apply(s); err != nil {
|
||||
log.With(zap.String("object id", pageID)).Errorf("failed to apply state: %w", err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}); sbErr != nil {
|
||||
log.With(zap.String("object id", pageID)).Errorf("failed to replace relation block: %w", sbErr)
|
||||
}
|
||||
}
|
||||
|
||||
func (rc *RelationService) handleCoverRelation(ctx *session.Context,
|
||||
snapshot *model.SmartBlockSnapshotBase,
|
||||
pageID string) ([]string, error) {
|
||||
|
@ -181,11 +326,23 @@ func (rc *RelationService) handleListValue(ctx *session.Context,
|
|||
r *converter.Relation,
|
||||
relationID string) {
|
||||
var (
|
||||
optionsIds = make([]string, 0)
|
||||
id string
|
||||
err error
|
||||
optionIDs = make([]string, 0)
|
||||
id string
|
||||
err error
|
||||
existedOptions = make(map[string]string, 0)
|
||||
)
|
||||
options, err := rc.service.Anytype().ObjectStore().GetAggregatedOptions(relationID)
|
||||
if err != nil {
|
||||
log.Errorf("get relations options %s", err)
|
||||
}
|
||||
for _, ro := range options {
|
||||
existedOptions[ro.Text] = ro.Id
|
||||
}
|
||||
for _, tag := range r.SelectDict {
|
||||
if optionID, ok := existedOptions[tag.Text]; ok {
|
||||
optionIDs = append(optionIDs, optionID)
|
||||
continue
|
||||
}
|
||||
if id, _, err = rc.objCreator.CreateSubObjectInWorkspace(&types.Struct{
|
||||
Fields: map[string]*types.Value{
|
||||
bundle.RelationKeyName.String(): pbtypes.String(tag.Text),
|
||||
|
@ -197,9 +354,9 @@ func (rc *RelationService) handleListValue(ctx *session.Context,
|
|||
}, rc.core.PredefinedBlocks().Account); err != nil {
|
||||
log.Errorf("add extra relation %s", err)
|
||||
}
|
||||
optionsIds = append(optionsIds, id)
|
||||
optionIDs = append(optionIDs, id)
|
||||
}
|
||||
snapshot.Details.Fields[r.Name] = pbtypes.StringList(optionsIds)
|
||||
snapshot.Details.Fields[r.Name] = pbtypes.StringList(optionIDs)
|
||||
}
|
||||
|
||||
func (rc *RelationService) handleFileRelation(ctx *session.Context,
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package importer
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogo/protobuf/types"
|
||||
|
||||
"github.com/anytypeio/go-anytype-middleware/app"
|
||||
|
@ -9,7 +11,6 @@ import (
|
|||
"github.com/anytypeio/go-anytype-middleware/pb"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/core/smartblock"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/pb/model"
|
||||
|
||||
// import plugins
|
||||
_ "github.com/anytypeio/go-anytype-middleware/core/block/import/markdown"
|
||||
_ "github.com/anytypeio/go-anytype-middleware/core/block/import/notion"
|
||||
|
@ -22,6 +23,8 @@ type Importer interface {
|
|||
Import(ctx *session.Context, req *pb.RpcObjectImportRequest) error
|
||||
ListImports(ctx *session.Context, req *pb.RpcObjectImportListRequest) ([]*pb.RpcObjectImportListImportResponse, error)
|
||||
ImportWeb(ctx *session.Context, req *pb.RpcObjectImportRequest) (string, *types.Struct, error)
|
||||
//nolint: lll
|
||||
ValidateNotionToken(ctx context.Context, req *pb.RpcObjectImportNotionValidateTokenRequest) pb.RpcObjectImportNotionValidateTokenResponseErrorCode
|
||||
}
|
||||
|
||||
// Creator incapsulate logic with creation of given smartblocks
|
||||
|
@ -32,11 +35,14 @@ type Creator interface {
|
|||
|
||||
// Updater is interface for updating existing objects
|
||||
type Updater interface {
|
||||
Update(ctx *session.Context, cs *model.SmartBlockSnapshotBase, pageID string) (*types.Struct, error)
|
||||
//nolint: lll
|
||||
Update(ctx *session.Context, cs *model.SmartBlockSnapshotBase, relations []*converter.Relation, pageID string) (*types.Struct, []string, error)
|
||||
}
|
||||
|
||||
// RelationCreator incapsulates logic for creation of relations
|
||||
type RelationCreator interface {
|
||||
//nolint: lll
|
||||
Create(ctx *session.Context, snapshot *model.SmartBlockSnapshotBase, relations []*converter.Relation, pageID string) ([]string, map[string]*model.Block, error)
|
||||
ReplaceRelationBlock(ctx *session.Context, oldRelationBlocksToNew map[string]*model.Block, pageID string)
|
||||
//nolint: lll
|
||||
CreateRelations(ctx *session.Context, snapshot *model.SmartBlockSnapshotBase, pageID string, relations []*converter.Relation) ([]string, map[string]*model.Block, error)
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@ import (
|
|||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/collection"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/dataview"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/file"
|
||||
_import "github.com/anytypeio/go-anytype-middleware/core/block/editor/import"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/smartblock"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/state"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/stext"
|
||||
|
@ -66,18 +65,12 @@ const (
|
|||
|
||||
var (
|
||||
ErrBlockNotFound = errors.New("block not found")
|
||||
ErrBlockAlreadyOpen = errors.New("block already open")
|
||||
ErrUnexpectedBlockType = errors.New("unexpected block type")
|
||||
ErrUnknownObjectType = fmt.Errorf("unknown object type")
|
||||
)
|
||||
|
||||
var log = logging.Logger("anytype-mw-service")
|
||||
|
||||
var (
|
||||
blockCacheTTL = time.Minute
|
||||
blockCleanupTimeout = time.Second * 30
|
||||
)
|
||||
|
||||
var (
|
||||
// quick fix for limiting file upload goroutines
|
||||
uploadFilesLimiter = make(chan struct{}, 8)
|
||||
|
@ -1029,21 +1022,6 @@ func (s *Service) DoHistory(id string, apply func(b basic.IHistory) error) error
|
|||
return fmt.Errorf("undo operation not available for this block type: %T", sb)
|
||||
}
|
||||
|
||||
func (s *Service) DoImport(id string, apply func(b _import.Import) error) error {
|
||||
sb, release, err := s.PickBlock(context.WithValue(context.TODO(), metrics.CtxKeyRequest, "do_import"), id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer release()
|
||||
if bb, ok := sb.(_import.Import); ok {
|
||||
sb.Lock()
|
||||
defer sb.Unlock()
|
||||
return apply(bb)
|
||||
}
|
||||
|
||||
return fmt.Errorf("import operation not available for this block type: %T", sb)
|
||||
}
|
||||
|
||||
func (s *Service) DoDataview(id string, apply func(b dataview.Dataview) error) error {
|
||||
sb, release, err := s.PickBlock(context.WithValue(context.TODO(), metrics.CtxKeyRequest, "do_dataview"), id)
|
||||
if err != nil {
|
||||
|
|
|
@ -23,7 +23,6 @@ var (
|
|||
ErrRelationExists = fmt.Errorf("relation exists")
|
||||
ErrViewNotFound = errors.New("view not found")
|
||||
ErrRelationNotFound = fmt.Errorf("relation not found")
|
||||
ErrOptionNotExists = errors.New("option not exists")
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -310,15 +309,6 @@ func (s *Dataview) SetView(viewID string, view model.BlockContentDataviewView) e
|
|||
return nil
|
||||
}
|
||||
|
||||
func (l *Dataview) getActiveView() *model.BlockContentDataviewView {
|
||||
for i, view := range l.GetDataview().Views {
|
||||
if view.Id == l.content.ActiveView {
|
||||
return l.GetDataview().Views[i]
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (l *Dataview) FillSmartIds(ids []string) []string {
|
||||
for _, rl := range l.content.RelationLinks {
|
||||
ids = append(ids, addr.RelationKeyToIdPrefix+rl.Key)
|
||||
|
@ -505,13 +495,3 @@ func (s *Dataview) UpdateRelationOld(relationKey string, rel model.Relation) err
|
|||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (l *Dataview) relationsWithObjectFormat() []string {
|
||||
var relationsWithObjFormat []string
|
||||
for _, rel := range l.GetDataview().Relations {
|
||||
if rel.Format == model.RelationFormat_file || rel.Format == model.RelationFormat_object {
|
||||
relationsWithObjFormat = append(relationsWithObjFormat, rel.Key)
|
||||
}
|
||||
}
|
||||
return relationsWithObjFormat
|
||||
}
|
||||
|
|
|
@ -22,13 +22,6 @@ const (
|
|||
EdgeTypeLink
|
||||
)
|
||||
|
||||
type linkInfo struct {
|
||||
target string
|
||||
edgeType edgeType
|
||||
name string
|
||||
full string
|
||||
}
|
||||
|
||||
type Node struct {
|
||||
Id string `json:"id,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
|
|
|
@ -123,16 +123,6 @@ func (b *treeBuilder) writeChanges(logs []core.SmartblockLog) (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
func createFileWithDateInZip(zw *zip.Writer, name string, modified time.Time) (io.Writer, error) {
|
||||
header := &zip.FileHeader{
|
||||
Name: name,
|
||||
Method: zip.Deflate,
|
||||
Modified: modified,
|
||||
}
|
||||
|
||||
return zw.CreateHeader(header)
|
||||
}
|
||||
|
||||
func (b *treeBuilder) writeChange(id string) (nextIds []string) {
|
||||
if _, ok := b.changes[id]; ok {
|
||||
return
|
||||
|
|
|
@ -5,20 +5,17 @@ import (
|
|||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/anytypeio/go-anytype-middleware/core/relation"
|
||||
|
||||
"github.com/anytypeio/go-anytype-middleware/app"
|
||||
"github.com/anytypeio/go-anytype-middleware/change"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/state"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/template"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/relation"
|
||||
"github.com/anytypeio/go-anytype-middleware/pb"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/bundle"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/core"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/core/smartblock"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/database"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/localstore/objectstore"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/logging"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/pb/model"
|
||||
"github.com/anytypeio/go-anytype-middleware/util/pbtypes"
|
||||
"github.com/anytypeio/go-anytype-middleware/util/slice"
|
||||
|
@ -28,8 +25,6 @@ const CName = "history"
|
|||
|
||||
const versionGroupInterval = time.Minute * 5
|
||||
|
||||
var log = logging.Logger("anytype-mw-history")
|
||||
|
||||
func New() History {
|
||||
return new(history)
|
||||
}
|
||||
|
@ -211,7 +206,7 @@ func (h *history) buildTree(pageId, versionId string, includeLastId bool) (tree
|
|||
}
|
||||
|
||||
func (h *history) buildState(pageId, versionId string) (s *state.State, ver *pb.RpcHistoryVersion, err error) {
|
||||
tree, sbType, err := h.buildTree(pageId, versionId, true)
|
||||
tree, _, err := h.buildTree(pageId, versionId, true)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
@ -228,11 +223,6 @@ func (h *history) buildState(pageId, versionId string) (s *state.State, ver *pb.
|
|||
if _, _, err = state.ApplyStateFast(st); err != nil {
|
||||
return
|
||||
}
|
||||
switch sbType {
|
||||
case smartblock.SmartBlockTypePage, smartblock.SmartBlockTypeProfilePage, smartblock.SmartBlockTypeSet:
|
||||
// todo: set case not handled
|
||||
template.InitTemplate(s, template.WithTitle)
|
||||
}
|
||||
s.BlocksInit(s)
|
||||
if ch := tree.Get(versionId); ch != nil {
|
||||
profileId, profileName, e := h.getProfileInfo()
|
||||
|
|
|
@ -832,3 +832,27 @@ func (mw *Middleware) ObjectImportList(cctx context.Context, req *pb.RpcObjectIm
|
|||
}
|
||||
return response(res, pb.RpcObjectImportListResponseError_NULL, nil)
|
||||
}
|
||||
|
||||
func (mw *Middleware) ObjectImportNotionValidateToken(ctx context.Context,
|
||||
request *pb.RpcObjectImportNotionValidateTokenRequest) *pb.RpcObjectImportNotionValidateTokenResponse {
|
||||
//nolint: lll
|
||||
response := func(code pb.RpcObjectImportNotionValidateTokenResponseErrorCode) *pb.RpcObjectImportNotionValidateTokenResponse {
|
||||
err := &pb.RpcObjectImportNotionValidateTokenResponseError{Code: code}
|
||||
switch code {
|
||||
case pb.RpcObjectImportNotionValidateTokenResponseError_UNAUTHORIZED:
|
||||
err.Description = "Sorry, token not found. Please check Notion integrations."
|
||||
case pb.RpcObjectImportNotionValidateTokenResponseError_NULL:
|
||||
err.Description = ""
|
||||
default:
|
||||
err.Description = "Internal error"
|
||||
}
|
||||
return &pb.RpcObjectImportNotionValidateTokenResponse{Error: err}
|
||||
}
|
||||
|
||||
mw.m.RLock()
|
||||
defer mw.m.RUnlock()
|
||||
|
||||
importer := mw.app.MustComponent(importer.CName).(importer.Importer)
|
||||
errCode := importer.ValidateNotionToken(ctx, request)
|
||||
return response(errCode)
|
||||
}
|
||||
|
|
|
@ -5,14 +5,11 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/anytypeio/go-anytype-middleware/app"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/logging"
|
||||
"github.com/cheggaaa/mb"
|
||||
)
|
||||
|
||||
const CName = "recordsbatcher"
|
||||
|
||||
var log = logging.Logger("anytype-recordsbatcher")
|
||||
|
||||
type recordsBatcher struct {
|
||||
batcher *mb.MB
|
||||
packDelay time.Duration // delay for better packing of msgs
|
||||
|
|
|
@ -6,7 +6,6 @@ import (
|
|||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/globalsign/mgo/bson"
|
||||
"github.com/gogo/protobuf/types"
|
||||
"github.com/ipfs/go-datastore/query"
|
||||
|
||||
|
@ -24,11 +23,8 @@ import (
|
|||
|
||||
const CName = "relation"
|
||||
|
||||
const blockServiceCName = "blockService"
|
||||
|
||||
var (
|
||||
ErrNotFound = errors.New("relation not found")
|
||||
ErrExists = errors.New("relation with given key already exists")
|
||||
log = logging.Logger("anytype-relations")
|
||||
)
|
||||
|
||||
|
@ -302,34 +298,6 @@ func (s *service) fetchKey(key string, opts ...FetchOption) (relation *relationu
|
|||
return nil, ErrNotFound
|
||||
}
|
||||
|
||||
func (s *service) fetchOptionsByKey(key string) (relation *relationutils.Relation, err error) {
|
||||
q := database.Query{
|
||||
Filters: []*model.BlockContentDataviewFilter{
|
||||
{
|
||||
Condition: model.BlockContentDataviewFilter_Equal,
|
||||
RelationKey: bundle.RelationKeyRelationKey.String(),
|
||||
Value: pbtypes.String(key),
|
||||
},
|
||||
{
|
||||
Condition: model.BlockContentDataviewFilter_Equal,
|
||||
RelationKey: bundle.RelationKeyType.String(),
|
||||
Value: pbtypes.String(bundle.TypeKeyRelationOption.String()),
|
||||
},
|
||||
},
|
||||
}
|
||||
f, err := database.NewFilters(q, nil, nil)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
records, err := s.objectStore.QueryRaw(query.Query{
|
||||
Filters: []query.Filter{f},
|
||||
})
|
||||
for _, rec := range records {
|
||||
return relationutils.RelationFromStruct(rec.Details), nil
|
||||
}
|
||||
return nil, ErrNotFound
|
||||
}
|
||||
|
||||
func (s *service) ValidateFormat(key string, v *types.Value) error {
|
||||
r, err := s.FetchKey(key)
|
||||
if err != nil {
|
||||
|
@ -458,7 +426,3 @@ func (s *service) validateOptions(rel *relationutils.Relation, v []string) error
|
|||
// TODO:
|
||||
return nil
|
||||
}
|
||||
|
||||
func generateRelationKey() string {
|
||||
return bson.NewObjectId().Hex()
|
||||
}
|
||||
|
|
12
core/util.go
12
core/util.go
|
@ -2,21 +2,9 @@ package core
|
|||
|
||||
import (
|
||||
"math/rand"
|
||||
"path/filepath"
|
||||
"time"
|
||||
)
|
||||
|
||||
const ipfsUrlScheme = "ipfs://"
|
||||
|
||||
func init() {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
}
|
||||
|
||||
func ipfsFileURL(hash string, originalFileName string) string {
|
||||
url := ipfsUrlScheme + hash
|
||||
if originalFileName != "" {
|
||||
url += "/" + filepath.Base(originalFileName)
|
||||
}
|
||||
|
||||
return url
|
||||
}
|
||||
|
|
8
go.mod
8
go.mod
|
@ -23,9 +23,9 @@ require (
|
|||
github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8
|
||||
github.com/go-shiori/go-readability v0.0.0-20220215145315-dd6828d2f09b
|
||||
github.com/gobwas/glob v0.2.3
|
||||
github.com/goccy/go-graphviz v0.0.9
|
||||
github.com/goccy/go-graphviz v0.1.0
|
||||
github.com/gogo/protobuf v1.3.2
|
||||
github.com/gogo/status v1.1.0
|
||||
github.com/gogo/status v1.1.1
|
||||
github.com/golang-jwt/jwt/v4 v4.4.2
|
||||
github.com/golang/mock v1.6.0
|
||||
github.com/google/uuid v1.3.0
|
||||
|
@ -44,7 +44,6 @@ require (
|
|||
github.com/ipfs/go-datastore v0.6.0
|
||||
github.com/ipfs/go-ds-badger v0.3.1-0.20211203181443-9205b3779632
|
||||
github.com/ipfs/go-ipfs-blockstore v1.2.0
|
||||
github.com/ipfs/go-ipfs-files v0.2.0
|
||||
github.com/ipfs/go-ipld-cbor v0.0.6
|
||||
github.com/ipfs/go-ipld-format v0.4.0
|
||||
github.com/ipfs/go-ipns v0.3.0
|
||||
|
@ -52,7 +51,7 @@ require (
|
|||
github.com/ipfs/go-log/v2 v2.5.1
|
||||
github.com/ipfs/go-merkledag v0.8.1
|
||||
github.com/ipfs/go-path v0.3.0
|
||||
github.com/ipfs/go-unixfs v0.4.1
|
||||
github.com/ipfs/go-unixfs v0.4.2
|
||||
github.com/ipfs/interface-go-ipfs-core v0.8.1
|
||||
github.com/jsummers/gobmp v0.0.0-20151104160322-e2ba15ffa76e
|
||||
github.com/kelseyhightower/envconfig v1.4.0
|
||||
|
@ -192,6 +191,7 @@ require (
|
|||
github.com/ipfs/go-ipfs-provider v0.8.1 // indirect
|
||||
github.com/ipfs/go-ipfs-util v0.0.2 // indirect
|
||||
github.com/ipfs/go-ipld-legacy v0.1.1 // indirect
|
||||
github.com/ipfs/go-libipfs v0.1.0 // indirect
|
||||
github.com/ipfs/go-metrics-interface v0.0.1 // indirect
|
||||
github.com/ipfs/go-peertaskqueue v0.8.0 // indirect
|
||||
github.com/ipfs/go-verifcid v0.0.2 // indirect
|
||||
|
|
16
go.sum
16
go.sum
|
@ -385,8 +385,8 @@ github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8=
|
|||
github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
|
||||
github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo=
|
||||
github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM=
|
||||
github.com/goccy/go-graphviz v0.0.9 h1:s/FMMJ1Joj6La3S5ApO3Jk2cwM4LpXECC2muFx3IPQQ=
|
||||
github.com/goccy/go-graphviz v0.0.9/go.mod h1:wXVsXxmyMQU6TN3zGRttjNn3h+iCAS7xQFC6TlNvLhk=
|
||||
github.com/goccy/go-graphviz v0.1.0 h1:6OqQoQ5PeAiHYe/YcusyeulqBrOkUb16HQ4ctRdyVUU=
|
||||
github.com/goccy/go-graphviz v0.1.0/go.mod h1:wXVsXxmyMQU6TN3zGRttjNn3h+iCAS7xQFC6TlNvLhk=
|
||||
github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk=
|
||||
|
@ -402,8 +402,8 @@ github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXP
|
|||
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
|
||||
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
|
||||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||
github.com/gogo/status v1.1.0 h1:+eIkrewn5q6b30y+g/BJINVVdi2xH7je5MPJ3ZPK3JA=
|
||||
github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM=
|
||||
github.com/gogo/status v1.1.1 h1:DuHXlSFHNKqTQ+/ACf5Vs6r4X/dH2EgIzR9Vr+H65kg=
|
||||
github.com/gogo/status v1.1.1/go.mod h1:jpG3dM5QPcqu19Hg8lkUhBFBa3TcLs1DG7+2Jqci7oU=
|
||||
github.com/gogs/chardet v0.0.0-20191104214054-4b6791f73a28/go.mod h1:Pcatq5tYkCW2Q6yrR2VRHlbHpZ/R4/7qyL1TCF7vl14=
|
||||
github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f h1:3BSP1Tbs2djlpprl7wCLuiqMaUh5SJkkzI2gDs+FgLs=
|
||||
github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f/go.mod h1:Pcatq5tYkCW2Q6yrR2VRHlbHpZ/R4/7qyL1TCF7vl14=
|
||||
|
@ -672,8 +672,6 @@ github.com/ipfs/go-ipfs-exchange-offline v0.1.1/go.mod h1:vTiBRIbzSwDD0OWm+i3xeT
|
|||
github.com/ipfs/go-ipfs-exchange-offline v0.3.0 h1:c/Dg8GDPzixGd0MC8Jh6mjOwU57uYokgWRFidfvEkuA=
|
||||
github.com/ipfs/go-ipfs-exchange-offline v0.3.0/go.mod h1:MOdJ9DChbb5u37M1IcbrRB02e++Z7521fMxqCNRrz9s=
|
||||
github.com/ipfs/go-ipfs-files v0.0.3/go.mod h1:INEFm0LL2LWXBhNJ2PMIIb2w45hpXgPjNoE7yA8Y1d4=
|
||||
github.com/ipfs/go-ipfs-files v0.2.0 h1:z6MCYHQSZpDWpUSK59Kf0ajP1fi4gLCf6fIulVsp8A8=
|
||||
github.com/ipfs/go-ipfs-files v0.2.0/go.mod h1:vT7uaQfIsprKktzbTPLnIsd+NGw9ZbYwSq0g3N74u0M=
|
||||
github.com/ipfs/go-ipfs-posinfo v0.0.1 h1:Esoxj+1JgSjX0+ylc0hUmJCOv6V2vFoZiETLR6OtpRs=
|
||||
github.com/ipfs/go-ipfs-posinfo v0.0.1/go.mod h1:SwyeVP+jCwiDu0C313l/8jg6ZxM0qqtlt2a0vILTc1A=
|
||||
github.com/ipfs/go-ipfs-pq v0.0.1/go.mod h1:LWIqQpqfRG3fNc5XsnIhz/wQ2XXGyugQwls7BgUmUfY=
|
||||
|
@ -703,6 +701,8 @@ github.com/ipfs/go-ipld-legacy v0.1.1 h1:BvD8PEuqwBHLTKqlGFTHSwrwFOMkVESEvwIYwR2
|
|||
github.com/ipfs/go-ipld-legacy v0.1.1/go.mod h1:8AyKFCjgRPsQFf15ZQgDB8Din4DML/fOmKZkkFkrIEg=
|
||||
github.com/ipfs/go-ipns v0.3.0 h1:ai791nTgVo+zTuq2bLvEGmWP1M0A6kGTXUsgv/Yq67A=
|
||||
github.com/ipfs/go-ipns v0.3.0/go.mod h1:3cLT2rbvgPZGkHJoPO1YMJeh6LtkxopCkKFcio/wE24=
|
||||
github.com/ipfs/go-libipfs v0.1.0 h1:I6CrHHp4cIiqsWJPVU3QBH4BZrRWSljS2aAbA3Eg9AY=
|
||||
github.com/ipfs/go-libipfs v0.1.0/go.mod h1:qX0d9h+wu53PFtCTXxdXVBakd6ZCvGDdkZUKmdLMLx0=
|
||||
github.com/ipfs/go-log v0.0.1/go.mod h1:kL1d2/hzSpI0thNYjiKfjanbVNU+IIGA/WnNESY9leM=
|
||||
github.com/ipfs/go-log v1.0.2/go.mod h1:1MNjMxe0u6xvJZgeqbJ8vdo2TKaGwZ1a0Bpza+sr2Sk=
|
||||
github.com/ipfs/go-log v1.0.3/go.mod h1:OsLySYkwIbiSUR/yBTdv1qPtcE4FW3WPWk/ewz9Ru+A=
|
||||
|
@ -723,8 +723,8 @@ github.com/ipfs/go-peertaskqueue v0.7.0/go.mod h1:M/akTIE/z1jGNXMU7kFB4TeSEFvj68
|
|||
github.com/ipfs/go-peertaskqueue v0.8.0 h1:JyNO144tfu9bx6Hpo119zvbEL9iQ760FHOiJYsUjqaU=
|
||||
github.com/ipfs/go-peertaskqueue v0.8.0/go.mod h1:cz8hEnnARq4Du5TGqiWKgMr/BOSQ5XOgMOh1K5YYKKM=
|
||||
github.com/ipfs/go-unixfs v0.2.4/go.mod h1:SUdisfUjNoSDzzhGVxvCL9QO/nKdwXdr+gbMUdqcbYw=
|
||||
github.com/ipfs/go-unixfs v0.4.1 h1:nmJFKvF+khK03PIWyCxxydD/nkQX315NZDcgvRqMXf0=
|
||||
github.com/ipfs/go-unixfs v0.4.1/go.mod h1:2SUDFhUSzrcL408B1qpIkJJ5HznnyTzweViPXUAvkNg=
|
||||
github.com/ipfs/go-unixfs v0.4.2 h1:hdQlsHHK5tek9gC9mjGVua8xyTqC+eopGseCRcbCZNg=
|
||||
github.com/ipfs/go-unixfs v0.4.2/go.mod h1:L+x6JRlFE0PfyMqeoLYVOKLhn5IeZHvNT7ZI51Y9Qyc=
|
||||
github.com/ipfs/go-unixfsnode v1.1.2/go.mod h1:5dcE2x03pyjHk4JjamXmunTMzz+VUtqvPwZjIEkfV6s=
|
||||
github.com/ipfs/go-verifcid v0.0.1/go.mod h1:5Hrva5KBeIog4A+UpqlaIU+DEstipcJYQQZc0g37pY0=
|
||||
github.com/ipfs/go-verifcid v0.0.2 h1:XPnUv0XmdH+ZIhLGKg6U2vaPaRDXb9urMyNVCE7uvTs=
|
||||
|
|
3533
pb/commands.pb.go
3533
pb/commands.pb.go
File diff suppressed because it is too large
Load diff
|
@ -1088,31 +1088,6 @@ message Rpc {
|
|||
}
|
||||
}
|
||||
|
||||
message ImportMarkdown {
|
||||
message Request {
|
||||
string contextId = 1;
|
||||
string importPath = 2;
|
||||
}
|
||||
|
||||
message Response {
|
||||
Error error = 1;
|
||||
repeated string rootLinkIds = 2;
|
||||
ResponseEvent event = 3;
|
||||
|
||||
message Error {
|
||||
Code code = 1;
|
||||
string description = 2;
|
||||
|
||||
enum Code {
|
||||
NULL = 0;
|
||||
UNKNOWN_ERROR = 1;
|
||||
BAD_INPUT = 2;
|
||||
// ...
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
message ShareByLink {
|
||||
message Request {
|
||||
string objectId = 1;
|
||||
|
@ -1811,6 +1786,31 @@ message Rpc {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
message Notion {
|
||||
message ValidateToken {
|
||||
message Request {
|
||||
string token = 1;
|
||||
}
|
||||
|
||||
message Response {
|
||||
Error error = 1;
|
||||
|
||||
message Error {
|
||||
Code code = 1;
|
||||
string description = 2;
|
||||
|
||||
enum Code {
|
||||
NULL = 0;
|
||||
INTERNAL_ERROR = 1;
|
||||
UNAUTHORIZED = 2;
|
||||
UNKNOWN_ERROR = 3;
|
||||
BAD_INPUT = 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
message ImportList {
|
||||
message Request {}
|
||||
|
|
|
@ -77,12 +77,12 @@ service ClientCommands {
|
|||
rpc ObjectSetBreadcrumbs (anytype.Rpc.Object.SetBreadcrumbs.Request) returns (anytype.Rpc.Object.SetBreadcrumbs.Response);
|
||||
rpc ObjectUndo (anytype.Rpc.Object.Undo.Request) returns (anytype.Rpc.Object.Undo.Response);
|
||||
rpc ObjectRedo (anytype.Rpc.Object.Redo.Request) returns (anytype.Rpc.Object.Redo.Response);
|
||||
rpc ObjectImportMarkdown (anytype.Rpc.Object.ImportMarkdown.Request) returns (anytype.Rpc.Object.ImportMarkdown.Response);
|
||||
rpc ObjectListExport (anytype.Rpc.Object.ListExport.Request) returns (anytype.Rpc.Object.ListExport.Response);
|
||||
rpc ObjectBookmarkFetch (anytype.Rpc.Object.BookmarkFetch.Request) returns (anytype.Rpc.Object.BookmarkFetch.Response);
|
||||
rpc ObjectToBookmark (anytype.Rpc.Object.ToBookmark.Request) returns (anytype.Rpc.Object.ToBookmark.Response);
|
||||
rpc ObjectImport (anytype.Rpc.Object.Import.Request) returns (anytype.Rpc.Object.Import.Response);
|
||||
rpc ObjectImportList (anytype.Rpc.Object.ImportList.Request) returns (anytype.Rpc.Object.ImportList.Response);
|
||||
rpc ObjectImportNotionValidateToken (anytype.Rpc.Object.Import.Notion.ValidateToken.Request) returns (anytype.Rpc.Object.Import.Notion.ValidateToken.Response);
|
||||
|
||||
// Relations
|
||||
// ***
|
||||
|
|
|
@ -26,212 +26,213 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
|||
func init() { proto.RegisterFile("pb/protos/service/service.proto", fileDescriptor_93a29dc403579097) }
|
||||
|
||||
var fileDescriptor_93a29dc403579097 = []byte{
|
||||
// 3279 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x9c, 0xdd, 0x6f, 0x1d, 0x47,
|
||||
0xf9, 0xc7, 0x7b, 0x6e, 0x7e, 0xfd, 0xb1, 0xa5, 0x05, 0xb6, 0x10, 0x4a, 0x68, 0x9d, 0x34, 0x6d,
|
||||
0xfc, 0x12, 0xc7, 0xc7, 0x6e, 0x02, 0x45, 0x70, 0x83, 0x4e, 0xec, 0x38, 0xb1, 0x1a, 0x27, 0xc1,
|
||||
0xc7, 0x69, 0xa4, 0x4a, 0x48, 0xac, 0x77, 0x27, 0xc7, 0x8b, 0xf7, 0xec, 0x2c, 0xbb, 0x73, 0x8e,
|
||||
0x63, 0x10, 0x08, 0x04, 0x02, 0x81, 0x40, 0x20, 0x71, 0xc9, 0x3f, 0xc4, 0x65, 0x2f, 0xb9, 0x44,
|
||||
0xcd, 0x1d, 0x7f, 0x05, 0xda, 0xdd, 0x67, 0xde, 0x9e, 0x9d, 0x67, 0x76, 0xcd, 0x55, 0xe1, 0x3c,
|
||||
0x9f, 0xe7, 0xf9, 0xce, 0xfb, 0x3c, 0x33, 0xb3, 0x71, 0x70, 0xad, 0x38, 0xd9, 0x2e, 0x4a, 0x2e,
|
||||
0x78, 0xb5, 0x5d, 0xb1, 0x72, 0x99, 0xc6, 0x4c, 0xfe, 0x77, 0xdc, 0xfc, 0x1c, 0xbe, 0x1e, 0xe5,
|
||||
0x17, 0xe2, 0xa2, 0x60, 0x57, 0xdf, 0x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0x36, 0x18, 0xfd, 0xb1, 0x35, 0x04, 0xb1, 0xb3, 0xe0, 0x6d, 0xb3, 0x41,
|
||||
0xa6, 0xac, 0x6a, 0x06, 0xcc, 0x06, 0x5d, 0x67, 0x40, 0x94, 0xce, 0xad, 0x21, 0x28, 0xa8, 0xa5,
|
||||
0x41, 0x08, 0x6a, 0x19, 0xaf, 0x94, 0xd8, 0xba, 0x33, 0x82, 0x41, 0x28, 0xad, 0x8d, 0x01, 0x24,
|
||||
0x48, 0xfd, 0x24, 0xf8, 0xca, 0x73, 0x5e, 0x9e, 0x55, 0x45, 0x14, 0x33, 0xe8, 0xec, 0x9b, 0xb6,
|
||||
0xb7, 0xb4, 0xe2, 0xfe, 0x5e, 0xed, 0xc3, 0x40, 0xe1, 0x2c, 0x08, 0x95, 0xf1, 0xc9, 0xc9, 0x4f,
|
||||
0x59, 0x2c, 0x26, 0x49, 0x82, 0x5b, 0x4e, 0x79, 0xb7, 0xc4, 0x78, 0x92, 0x24, 0x54, 0xcb, 0xb9,
|
||||
0x51, 0x10, 0x3b, 0x0f, 0xae, 0x20, 0xb1, 0x47, 0x69, 0xd5, 0x08, 0x6e, 0xf9, 0xa3, 0x00, 0xa6,
|
||||
0x44, 0xc7, 0x43, 0x71, 0x10, 0xfe, 0xf5, 0x28, 0xf8, 0x96, 0x43, 0xf9, 0x88, 0xcd, 0xf9, 0x92,
|
||||
0x85, 0x3b, 0xfd, 0xd1, 0x5a, 0x52, 0xe9, 0x7f, 0x74, 0x09, 0x0f, 0x47, 0x57, 0x4e, 0x59, 0xc6,
|
||||
0x62, 0x41, 0x76, 0x65, 0x6b, 0xee, 0xed, 0x4a, 0x85, 0x19, 0xb3, 0x40, 0x1a, 0x1f, 0x30, 0xb1,
|
||||
0xbb, 0x28, 0x4b, 0x96, 0x0b, 0xb2, 0x2f, 0x35, 0xd2, 0xdb, 0x97, 0x16, 0xea, 0xa8, 0xcf, 0x03,
|
||||
0x26, 0x26, 0x59, 0x46, 0xd6, 0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0, 0x9b, 0x66, 0x93, 0x3e, 0xcb, 0x2b, 0xa5, 0xba, 0x45, 0xb7, 0x93, 0x81, 0x11, 0x79, 0x9c,
|
||||
0x07, 0x07, 0xe5, 0x38, 0xf8, 0xaa, 0x54, 0x16, 0x7b, 0x4c, 0x44, 0x69, 0x56, 0x85, 0xab, 0xee,
|
||||
0x18, 0xd2, 0xae, 0xb4, 0xd6, 0x7a, 0x39, 0x3c, 0x85, 0xf6, 0x16, 0x45, 0x96, 0xc6, 0xdd, 0xa4,
|
||||
0x1b, 0x7c, 0x95, 0xd9, 0x3f, 0x85, 0x4c, 0x4c, 0x2f, 0xec, 0xaa, 0x1a, 0xed, 0xff, 0x38, 0xbe,
|
||||
0x28, 0xf0, 0xc2, 0xae, 0x4b, 0xa8, 0x11, 0x62, 0x61, 0x27, 0x50, 0x5c, 0x9f, 0x29, 0x13, 0x8f,
|
||||
0xa2, 0x0b, 0xbe, 0x20, 0x96, 0x04, 0x65, 0xf6, 0xd7, 0xc7, 0xc4, 0x40, 0x61, 0x11, 0x5c, 0x51,
|
||||
0x0a, 0x07, 0xb9, 0x60, 0x65, 0x1e, 0x65, 0xfb, 0x59, 0x34, 0xab, 0x42, 0x62, 0xde, 0xd8, 0x94,
|
||||
0xd2, 0xdb, 0x1a, 0x48, 0x3b, 0x9a, 0xf1, 0xa0, 0xda, 0x8f, 0x96, 0xbc, 0x4c, 0x05, 0xdd, 0x8c,
|
||||
0x1a, 0xe9, 0x6d, 0x46, 0x0b, 0x75, 0xaa, 0x4d, 0xca, 0xf8, 0x34, 0x5d, 0xb2, 0xc4, 0xa3, 0x26,
|
||||
0x91, 0x01, 0x6a, 0x06, 0x8a, 0xd5, 0xea, 0xb3, 0x84, 0x1e, 0x88, 0x4e, 0x35, 0x0b, 0xf1, 0xab,
|
||||
0x61, 0x14, 0xcf, 0xab, 0xc6, 0xde, 0x26, 0x74, 0xab, 0xa4, 0xbf, 0x9d, 0xd3, 0xad, 0xf5, 0x72,
|
||||
0x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0x5b, 0xf5, 0x39, 0x65, 0xf1, 0x59, 0xe7, 0x8d, 0xd7, 0x2e, 0x68, 0x8b,
|
||||
0x10, 0xb7, 0xf5, 0x04, 0xea, 0xee, 0xa2, 0x83, 0x98, 0xe7, 0xbe, 0x2e, 0xaa, 0xed, 0x43, 0xba,
|
||||
0x08, 0x38, 0x7d, 0xba, 0x53, 0x56, 0x18, 0x99, 0x6d, 0x37, 0x6d, 0x12, 0x11, 0x4c, 0x88, 0x38,
|
||||
0xdd, 0x91, 0xb0, 0xbe, 0x27, 0xc5, 0x9a, 0x87, 0xdd, 0xaf, 0x9e, 0x3a, 0x51, 0x0e, 0xe9, 0xaf,
|
||||
0x9e, 0x28, 0x96, 0xae, 0x64, 0x3b, 0x46, 0x7a, 0xa2, 0xd8, 0xe3, 0xe4, 0xf6, 0x30, 0x58, 0x3f,
|
||||
0x2a, 0x5b, 0x9a, 0xbb, 0x19, 0x8b, 0xca, 0x56, 0x75, 0xcb, 0x13, 0x48, 0x63, 0xc4, 0xa5, 0x9c,
|
||||
0x07, 0x47, 0x4b, 0x98, 0xa5, 0xbc, 0xcb, 0x73, 0xc1, 0x72, 0xe1, 0x5a, 0xc2, 0xec, 0x60, 0x00,
|
||||
0xfa, 0x96, 0x30, 0xca, 0x01, 0x8d, 0xdb, 0xfd, 0x34, 0x63, 0x53, 0x26, 0x1e, 0x47, 0x73, 0xe6,
|
||||
0x1a, 0xb7, 0xcd, 0x55, 0x03, 0xd8, 0x7d, 0xe3, 0x16, 0x71, 0x68, 0xca, 0x1f, 0xcc, 0xa3, 0x99,
|
||||
0x52, 0x71, 0x78, 0x37, 0xf6, 0x8e, 0xcc, 0x7a, 0x3f, 0x88, 0x74, 0x3e, 0x4d, 0x13, 0xc6, 0x3d,
|
||||
0x3a, 0x8d, 0x7d, 0x88, 0x0e, 0x06, 0x51, 0xe6, 0x54, 0xd7, 0xb6, 0x3d, 0x8f, 0x4c, 0xf2, 0x04,
|
||||
0x4e, 0x61, 0x63, 0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, 0x00, 0xff, 0xff, 0xe8, 0xee, 0x93, 0x37, 0x75, 0x47, 0x00, 0x00,
|
||||
// 3292 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x9c, 0xdf, 0x6f, 0x1d, 0x47,
|
||||
0x15, 0xc7, 0x7b, 0x5f, 0x28, 0x6c, 0x69, 0x81, 0x2d, 0x84, 0x12, 0x5a, 0x27, 0x4d, 0x9b, 0xd8,
|
||||
0x8e, 0xe3, 0x6b, 0x37, 0x81, 0x16, 0x78, 0x41, 0x37, 0x76, 0x9c, 0x58, 0x8d, 0x93, 0xe0, 0xeb,
|
||||
0x24, 0x52, 0x25, 0x24, 0xd6, 0xbb, 0x93, 0xeb, 0xc5, 0x7b, 0x77, 0x96, 0xdd, 0xb9, 0xd7, 0x31,
|
||||
0x08, 0x04, 0x02, 0x81, 0x40, 0x08, 0x2a, 0xc1, 0x1b, 0xff, 0x10, 0x8f, 0x7d, 0xe4, 0x11, 0xb5,
|
||||
0xff, 0x08, 0xda, 0xdd, 0x33, 0xbf, 0xce, 0xce, 0x99, 0x5d, 0xf3, 0x54, 0xb8, 0xe7, 0x73, 0xce,
|
||||
0x77, 0x7e, 0xcf, 0x99, 0x99, 0x8d, 0x83, 0x2b, 0xc5, 0xf1, 0x56, 0x51, 0x72, 0xc1, 0xab, 0xad,
|
||||
0x8a, 0x95, 0xcb, 0x34, 0x66, 0xf2, 0xbf, 0xe3, 0xe6, 0xe7, 0xf0, 0xd5, 0x28, 0x3f, 0x17, 0xe7,
|
||||
0x05, 0xbb, 0xfc, 0x96, 0x26, 0x63, 0x3e, 0x9f, 0x47, 0x79, 0x52, 0xb5, 0xc8, 0xe5, 0x4b, 0xda,
|
||||
0xc2, 0x96, 0x2c, 0x17, 0xf0, 0xfb, 0xed, 0x4f, 0xff, 0x36, 0x0a, 0xde, 0xd8, 0xc9, 0x52, 0x96,
|
||||
0x8b, 0x1d, 0xf0, 0x08, 0x3f, 0x09, 0x5e, 0x9f, 0x14, 0xc5, 0x7d, 0x26, 0x9e, 0xb1, 0xb2, 0x4a,
|
||||
0x79, 0x1e, 0xbe, 0x37, 0x06, 0x81, 0xf1, 0x61, 0x11, 0x8f, 0x27, 0x45, 0x31, 0xd6, 0xc6, 0xf1,
|
||||
0x21, 0xfb, 0xc5, 0x82, 0x55, 0xe2, 0xf2, 0xfb, 0x7e, 0xa8, 0x2a, 0x78, 0x5e, 0xb1, 0xf0, 0x45,
|
||||
0xf0, 0x8d, 0x49, 0x51, 0x4c, 0x99, 0xd8, 0x65, 0x75, 0x05, 0xa6, 0x22, 0x12, 0x2c, 0x5c, 0xed,
|
||||
0xb8, 0xda, 0x80, 0xd2, 0x58, 0xeb, 0x07, 0x41, 0xe7, 0x28, 0x78, 0xad, 0xd6, 0x39, 0x59, 0x88,
|
||||
0x84, 0x9f, 0xe5, 0xe1, 0xbb, 0x5d, 0x47, 0x30, 0xa9, 0xd8, 0xd7, 0x7c, 0x08, 0x44, 0x7d, 0x1e,
|
||||
0x7c, 0xf5, 0x79, 0x94, 0x65, 0x4c, 0xec, 0x94, 0xac, 0x2e, 0xb8, 0xed, 0xd3, 0x9a, 0xc6, 0xad,
|
||||
0x4d, 0xc5, 0x7d, 0xcf, 0xcb, 0x40, 0xe0, 0x4f, 0x82, 0xd7, 0x5b, 0xcb, 0x21, 0x8b, 0xf9, 0x92,
|
||||
0x95, 0xa1, 0xd3, 0x0b, 0x8c, 0x44, 0x93, 0x77, 0x20, 0x1c, 0x7b, 0x87, 0xe7, 0x4b, 0x56, 0x0a,
|
||||
0x77, 0x6c, 0x30, 0xfa, 0x63, 0x6b, 0x08, 0x62, 0x67, 0xc1, 0x9b, 0x66, 0x83, 0x4c, 0x59, 0xd5,
|
||||
0x0c, 0x98, 0x75, 0xba, 0xce, 0x80, 0x28, 0x9d, 0x9b, 0x43, 0x50, 0x50, 0x4b, 0x83, 0x10, 0xd4,
|
||||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0xdc, 0x05, 0xad, 0x2d,
|
||||
0xfe, 0x82, 0x02, 0xa1, 0x33, 0x2a, 0x28, 0xa8, 0x2b, 0xa3, 0x92, 0xc5, 0xf0, 0x65, 0x54, 0x98,
|
||||
0x81, 0xc0, 0x3c, 0xf8, 0xa6, 0x19, 0xf8, 0x2e, 0xe7, 0xa7, 0xf3, 0xa8, 0x3c, 0x0d, 0x6f, 0xd2,
|
||||
0xce, 0x92, 0x51, 0x42, 0x1b, 0x83, 0x58, 0xbd, 0x68, 0x99, 0x82, 0x53, 0x86, 0x17, 0x2d, 0xcb,
|
||||
0x7f, 0xca, 0xa8, 0x45, 0xcb, 0x81, 0xe1, 0x4e, 0xbd, 0x5f, 0x46, 0xc5, 0x89, 0xbb, 0x53, 0x1b,
|
||||
0x93, 0xbf, 0x53, 0x25, 0x82, 0x7b, 0x60, 0xca, 0xa2, 0x32, 0x3e, 0x71, 0xf7, 0x40, 0x6b, 0xf3,
|
||||
0xf7, 0x80, 0x62, 0x20, 0x70, 0x19, 0x7c, 0xcb, 0x0c, 0x3c, 0x5d, 0x1c, 0x57, 0x71, 0x99, 0x1e,
|
||||
0xb3, 0x70, 0x83, 0xf6, 0x56, 0x90, 0x92, 0xba, 0x35, 0x0c, 0xd6, 0x19, 0x22, 0x68, 0x4a, 0xdb,
|
||||
0x7e, 0x52, 0xa1, 0x0c, 0x51, 0xc6, 0x30, 0x08, 0x22, 0x43, 0x74, 0x93, 0xb8, 0x7a, 0xf7, 0x4b,
|
||||
0xbe, 0x28, 0xaa, 0x9e, 0xea, 0x21, 0xc8, 0x5f, 0xbd, 0x2e, 0x0c, 0x9a, 0x2f, 0x83, 0x6f, 0x9b,
|
||||
0x4d, 0xfa, 0x34, 0xaf, 0x94, 0xea, 0x26, 0xdd, 0x4e, 0x06, 0x46, 0xe4, 0x71, 0x1e, 0x1c, 0x94,
|
||||
0xe3, 0xe0, 0xeb, 0x52, 0x59, 0xec, 0x32, 0x11, 0xa5, 0x59, 0x15, 0xde, 0x70, 0xc7, 0x90, 0x76,
|
||||
0xa5, 0xb5, 0xda, 0xcb, 0xe1, 0x29, 0xb4, 0xbb, 0x28, 0xb2, 0x34, 0xee, 0x26, 0xdd, 0xe0, 0xab,
|
||||
0xcc, 0xfe, 0x29, 0x64, 0x62, 0x7a, 0x61, 0x57, 0xd5, 0x68, 0xff, 0xc7, 0xd1, 0x79, 0x81, 0x17,
|
||||
0x76, 0x5d, 0x42, 0x8d, 0x10, 0x0b, 0x3b, 0x81, 0xe2, 0xfa, 0x4c, 0x99, 0x78, 0x18, 0x9d, 0xf3,
|
||||
0x05, 0xb1, 0x24, 0x28, 0xb3, 0xbf, 0x3e, 0x26, 0x06, 0x0a, 0x8b, 0xe0, 0x92, 0x52, 0xd8, 0xcf,
|
||||
0x05, 0x2b, 0xf3, 0x28, 0xdb, 0xcb, 0xa2, 0x59, 0x15, 0x12, 0xf3, 0xc6, 0xa6, 0x94, 0xde, 0xe6,
|
||||
0x40, 0xda, 0xd1, 0x8c, 0xfb, 0xd5, 0x5e, 0xb4, 0xe4, 0x65, 0x2a, 0xe8, 0x66, 0xd4, 0x48, 0x6f,
|
||||
0x33, 0x5a, 0xa8, 0x53, 0x6d, 0x52, 0xc6, 0x27, 0xe9, 0x92, 0x25, 0x1e, 0x35, 0x89, 0x0c, 0x50,
|
||||
0x33, 0x50, 0xac, 0x56, 0x9f, 0x25, 0xf4, 0x40, 0x74, 0xaa, 0x59, 0x88, 0x5f, 0x0d, 0xa3, 0x78,
|
||||
0x5e, 0x35, 0xf6, 0x36, 0xa1, 0xbb, 0x41, 0xfa, 0xdb, 0x39, 0xdd, 0x6a, 0x2f, 0x87, 0x97, 0x8d,
|
||||
0xda, 0x68, 0x37, 0xe2, 0x26, 0x15, 0xc3, 0xdd, 0x90, 0xe3, 0xa1, 0x38, 0xa9, 0xac, 0x06, 0x8b,
|
||||
0x5f, 0xb9, 0x33, 0x60, 0xc6, 0x43, 0x71, 0xdc, 0x8d, 0x93, 0xa2, 0x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
||||
0x62, 0x6c, 0xd8, 0x04, 0x0a, 0x79, 0xc0, 0xca, 0x19, 0x73, 0x86, 0x6c, 0x2c, 0xde, 0x90, 0x92,
|
||||
0x80, 0x90, 0x8f, 0x82, 0xaf, 0xb4, 0x75, 0xe7, 0xc5, 0x79, 0x78, 0xc5, 0x55, 0x2d, 0x5e, 0x9c,
|
||||
0xab, 0x80, 0x57, 0x69, 0x00, 0x15, 0xf1, 0x49, 0x54, 0x09, 0x77, 0x11, 0x1b, 0x8b, 0xb7, 0x88,
|
||||
0x92, 0xd0, 0xfb, 0x50, 0x5b, 0xc4, 0x85, 0x40, 0xfb, 0x10, 0x14, 0xc0, 0x78, 0x72, 0xb8, 0x42,
|
||||
0xda, 0xf5, 0xf4, 0x6a, 0x7b, 0x85, 0x89, 0xbd, 0x94, 0x65, 0x49, 0x85, 0xa6, 0x17, 0xb4, 0xbb,
|
||||
0xb4, 0x12, 0xd3, 0xab, 0x4b, 0xa1, 0xa1, 0x04, 0x17, 0x50, 0xae, 0xda, 0xa1, 0xbb, 0xa7, 0x6b,
|
||||
0x3e, 0x44, 0xe7, 0x25, 0x8d, 0xc1, 0xb8, 0x5e, 0x77, 0x95, 0xc7, 0x71, 0xbb, 0x7e, 0xa3, 0x0f,
|
||||
0x03, 0x85, 0xbf, 0x8c, 0x82, 0x77, 0x94, 0xc4, 0x01, 0x5f, 0xb2, 0x23, 0x7e, 0xef, 0x65, 0x5a,
|
||||
0x89, 0x34, 0x9f, 0xc1, 0xd6, 0x74, 0x87, 0x88, 0xe4, 0x82, 0x95, 0xfc, 0xf7, 0x2e, 0xe6, 0xa4,
|
||||
0x77, 0x48, 0x54, 0x96, 0x47, 0xec, 0xcc, 0xb9, 0x43, 0xe2, 0x88, 0x8a, 0x23, 0x76, 0x48, 0x1f,
|
||||
0xaf, 0x4f, 0xc3, 0x4a, 0x1c, 0xbe, 0x14, 0x3c, 0xe2, 0x32, 0x59, 0xa1, 0xa2, 0x61, 0x90, 0x38,
|
||||
0x17, 0x78, 0x1d, 0x74, 0xb2, 0xae, 0xf4, 0xf5, 0x20, 0x5d, 0x23, 0xe2, 0x74, 0x07, 0xea, 0xfa,
|
||||
0x00, 0xd2, 0x21, 0xa5, 0xdf, 0x88, 0x28, 0xa9, 0xee, 0x13, 0xd1, 0xfa, 0x00, 0xd2, 0x38, 0x59,
|
||||
0x9b, 0xd5, 0xba, 0x1b, 0xc5, 0xa7, 0xb3, 0x92, 0x2f, 0xf2, 0x64, 0x87, 0x67, 0xbc, 0x44, 0x27,
|
||||
0x6b, 0xab, 0xd4, 0x08, 0x25, 0x4e, 0xd6, 0x3d, 0x2e, 0x3a, 0x31, 0x30, 0x4b, 0x31, 0xc9, 0xd2,
|
||||
0x19, 0x3e, 0x9e, 0x58, 0x81, 0x1a, 0x80, 0x48, 0x0c, 0x9c, 0xa0, 0x63, 0x10, 0xb5, 0xc7, 0x17,
|
||||
0x91, 0xc6, 0x51, 0xd6, 0xea, 0x6d, 0xd1, 0x61, 0x2c, 0xb0, 0x77, 0x10, 0x39, 0x1c, 0x1c, 0xf5,
|
||||
0x3c, 0x5a, 0x94, 0xf9, 0x7e, 0x2e, 0x38, 0x59, 0x4f, 0x09, 0xf4, 0xd6, 0xd3, 0x00, 0x75, 0x36,
|
||||
0xd1, 0x98, 0x8f, 0xd8, 0xcb, 0xba, 0x34, 0xf5, 0x7f, 0x42, 0xc7, 0x92, 0x53, 0xff, 0x3e, 0x06,
|
||||
0x3b, 0x91, 0x4d, 0xb8, 0x38, 0x54, 0x19, 0x10, 0x69, 0x07, 0x8c, 0xc7, 0xdb, 0x1e, 0x26, 0x6b,
|
||||
0xfd, 0xa0, 0x5b, 0x67, 0x2a, 0xce, 0x33, 0xe6, 0xd3, 0x69, 0x80, 0x21, 0x3a, 0x12, 0xd4, 0x8f,
|
||||
0x08, 0x56, 0x7d, 0x4e, 0x58, 0x7c, 0xda, 0x79, 0x09, 0xb6, 0x0b, 0xda, 0x22, 0xc4, 0x23, 0x02,
|
||||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 0x04, 0x95, 0xf2, 0xa8, 0x64, 0xcc, 0x59, 0xca, 0xda, 0xe0,
|
||||
0x2d, 0x25, 0x00, 0x7a, 0xb3, 0x6d, 0x7e, 0x6e, 0x5f, 0x35, 0x1f, 0xf2, 0x38, 0xca, 0x2a, 0xc1,
|
||||
0x4b, 0x7c, 0x2f, 0xd4, 0xba, 0x62, 0x88, 0xd8, 0x6c, 0x49, 0x18, 0xd5, 0xe1, 0x49, 0x9a, 0xcf,
|
||||
0x9c, 0x75, 0xa8, 0x0d, 0xde, 0x3a, 0x00, 0xa0, 0x27, 0xe8, 0x01, 0x13, 0x65, 0x1a, 0x57, 0x53,
|
||||
0x26, 0x9e, 0x44, 0x65, 0x34, 0x67, 0x82, 0x95, 0xf8, 0x1f, 0x5d, 0x00, 0x32, 0xb6, 0x18, 0x62,
|
||||
0x82, 0x52, 0x2c, 0x08, 0xfe, 0x38, 0x78, 0xb3, 0x9e, 0xb9, 0x2c, 0x87, 0x3f, 0xea, 0x71, 0xaf,
|
||||
0xf9, 0x7b, 0x37, 0xe1, 0x25, 0x15, 0x63, 0x2a, 0x4a, 0x16, 0xcd, 0x65, 0xec, 0x37, 0xd4, 0xef,
|
||||
0x0d, 0xb8, 0x3d, 0xba, 0xfb, 0xee, 0xbf, 0x3f, 0x5f, 0x19, 0x7d, 0xf6, 0xf9, 0xca, 0xe8, 0xbf,
|
||||
0x9f, 0xaf, 0x8c, 0x3e, 0xfd, 0x62, 0xe5, 0x95, 0xcf, 0xbe, 0x58, 0x79, 0xe5, 0x3f, 0x5f, 0xac,
|
||||
0xbc, 0xf2, 0xc9, 0xab, 0xf0, 0x77, 0x77, 0x8e, 0xbf, 0xd4, 0xfc, 0xf5, 0x9c, 0x3b, 0xff, 0x0b,
|
||||
0x00, 0x00, 0xff, 0xff, 0xbb, 0x6c, 0x58, 0x63, 0x9b, 0x47, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
|
@ -313,12 +314,12 @@ type ClientCommandsClient interface {
|
|||
ObjectSetBreadcrumbs(ctx context.Context, in *pb.RpcObjectSetBreadcrumbsRequest, opts ...grpc.CallOption) (*pb.RpcObjectSetBreadcrumbsResponse, error)
|
||||
ObjectUndo(ctx context.Context, in *pb.RpcObjectUndoRequest, opts ...grpc.CallOption) (*pb.RpcObjectUndoResponse, error)
|
||||
ObjectRedo(ctx context.Context, in *pb.RpcObjectRedoRequest, opts ...grpc.CallOption) (*pb.RpcObjectRedoResponse, error)
|
||||
ObjectImportMarkdown(ctx context.Context, in *pb.RpcObjectImportMarkdownRequest, opts ...grpc.CallOption) (*pb.RpcObjectImportMarkdownResponse, error)
|
||||
ObjectListExport(ctx context.Context, in *pb.RpcObjectListExportRequest, opts ...grpc.CallOption) (*pb.RpcObjectListExportResponse, error)
|
||||
ObjectBookmarkFetch(ctx context.Context, in *pb.RpcObjectBookmarkFetchRequest, opts ...grpc.CallOption) (*pb.RpcObjectBookmarkFetchResponse, error)
|
||||
ObjectToBookmark(ctx context.Context, in *pb.RpcObjectToBookmarkRequest, opts ...grpc.CallOption) (*pb.RpcObjectToBookmarkResponse, error)
|
||||
ObjectImport(ctx context.Context, in *pb.RpcObjectImportRequest, opts ...grpc.CallOption) (*pb.RpcObjectImportResponse, error)
|
||||
ObjectImportList(ctx context.Context, in *pb.RpcObjectImportListRequest, opts ...grpc.CallOption) (*pb.RpcObjectImportListResponse, error)
|
||||
ObjectImportNotionValidateToken(ctx context.Context, in *pb.RpcObjectImportNotionValidateTokenRequest, opts ...grpc.CallOption) (*pb.RpcObjectImportNotionValidateTokenResponse, error)
|
||||
// Relations
|
||||
// ***
|
||||
ObjectCreateRelation(ctx context.Context, in *pb.RpcObjectCreateRelationRequest, opts ...grpc.CallOption) (*pb.RpcObjectCreateRelationResponse, error)
|
||||
|
@ -955,15 +956,6 @@ func (c *clientCommandsClient) ObjectRedo(ctx context.Context, in *pb.RpcObjectR
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *clientCommandsClient) ObjectImportMarkdown(ctx context.Context, in *pb.RpcObjectImportMarkdownRequest, opts ...grpc.CallOption) (*pb.RpcObjectImportMarkdownResponse, error) {
|
||||
out := new(pb.RpcObjectImportMarkdownResponse)
|
||||
err := c.cc.Invoke(ctx, "/anytype.ClientCommands/ObjectImportMarkdown", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *clientCommandsClient) ObjectListExport(ctx context.Context, in *pb.RpcObjectListExportRequest, opts ...grpc.CallOption) (*pb.RpcObjectListExportResponse, error) {
|
||||
out := new(pb.RpcObjectListExportResponse)
|
||||
err := c.cc.Invoke(ctx, "/anytype.ClientCommands/ObjectListExport", in, out, opts...)
|
||||
|
@ -1009,6 +1001,15 @@ func (c *clientCommandsClient) ObjectImportList(ctx context.Context, in *pb.RpcO
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *clientCommandsClient) ObjectImportNotionValidateToken(ctx context.Context, in *pb.RpcObjectImportNotionValidateTokenRequest, opts ...grpc.CallOption) (*pb.RpcObjectImportNotionValidateTokenResponse, error) {
|
||||
out := new(pb.RpcObjectImportNotionValidateTokenResponse)
|
||||
err := c.cc.Invoke(ctx, "/anytype.ClientCommands/ObjectImportNotionValidateToken", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *clientCommandsClient) ObjectCreateRelation(ctx context.Context, in *pb.RpcObjectCreateRelationRequest, opts ...grpc.CallOption) (*pb.RpcObjectCreateRelationResponse, error) {
|
||||
out := new(pb.RpcObjectCreateRelationResponse)
|
||||
err := c.cc.Invoke(ctx, "/anytype.ClientCommands/ObjectCreateRelation", in, out, opts...)
|
||||
|
@ -2073,12 +2074,12 @@ type ClientCommandsServer interface {
|
|||
ObjectSetBreadcrumbs(context.Context, *pb.RpcObjectSetBreadcrumbsRequest) *pb.RpcObjectSetBreadcrumbsResponse
|
||||
ObjectUndo(context.Context, *pb.RpcObjectUndoRequest) *pb.RpcObjectUndoResponse
|
||||
ObjectRedo(context.Context, *pb.RpcObjectRedoRequest) *pb.RpcObjectRedoResponse
|
||||
ObjectImportMarkdown(context.Context, *pb.RpcObjectImportMarkdownRequest) *pb.RpcObjectImportMarkdownResponse
|
||||
ObjectListExport(context.Context, *pb.RpcObjectListExportRequest) *pb.RpcObjectListExportResponse
|
||||
ObjectBookmarkFetch(context.Context, *pb.RpcObjectBookmarkFetchRequest) *pb.RpcObjectBookmarkFetchResponse
|
||||
ObjectToBookmark(context.Context, *pb.RpcObjectToBookmarkRequest) *pb.RpcObjectToBookmarkResponse
|
||||
ObjectImport(context.Context, *pb.RpcObjectImportRequest) *pb.RpcObjectImportResponse
|
||||
ObjectImportList(context.Context, *pb.RpcObjectImportListRequest) *pb.RpcObjectImportListResponse
|
||||
ObjectImportNotionValidateToken(context.Context, *pb.RpcObjectImportNotionValidateTokenRequest) *pb.RpcObjectImportNotionValidateTokenResponse
|
||||
// Relations
|
||||
// ***
|
||||
ObjectCreateRelation(context.Context, *pb.RpcObjectCreateRelationRequest) *pb.RpcObjectCreateRelationResponse
|
||||
|
@ -2381,9 +2382,6 @@ func (*UnimplementedClientCommandsServer) ObjectUndo(ctx context.Context, req *p
|
|||
func (*UnimplementedClientCommandsServer) ObjectRedo(ctx context.Context, req *pb.RpcObjectRedoRequest) *pb.RpcObjectRedoResponse {
|
||||
return nil
|
||||
}
|
||||
func (*UnimplementedClientCommandsServer) ObjectImportMarkdown(ctx context.Context, req *pb.RpcObjectImportMarkdownRequest) *pb.RpcObjectImportMarkdownResponse {
|
||||
return nil
|
||||
}
|
||||
func (*UnimplementedClientCommandsServer) ObjectListExport(ctx context.Context, req *pb.RpcObjectListExportRequest) *pb.RpcObjectListExportResponse {
|
||||
return nil
|
||||
}
|
||||
|
@ -2399,6 +2397,9 @@ func (*UnimplementedClientCommandsServer) ObjectImport(ctx context.Context, req
|
|||
func (*UnimplementedClientCommandsServer) ObjectImportList(ctx context.Context, req *pb.RpcObjectImportListRequest) *pb.RpcObjectImportListResponse {
|
||||
return nil
|
||||
}
|
||||
func (*UnimplementedClientCommandsServer) ObjectImportNotionValidateToken(ctx context.Context, req *pb.RpcObjectImportNotionValidateTokenRequest) *pb.RpcObjectImportNotionValidateTokenResponse {
|
||||
return nil
|
||||
}
|
||||
func (*UnimplementedClientCommandsServer) ObjectCreateRelation(ctx context.Context, req *pb.RpcObjectCreateRelationRequest) *pb.RpcObjectCreateRelationResponse {
|
||||
return nil
|
||||
}
|
||||
|
@ -3718,24 +3719,6 @@ func _ClientCommands_ObjectRedo_Handler(srv interface{}, ctx context.Context, de
|
|||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ClientCommands_ObjectImportMarkdown_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(pb.RpcObjectImportMarkdownRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ClientCommandsServer).ObjectImportMarkdown(ctx, in), nil
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/anytype.ClientCommands/ObjectImportMarkdown",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ClientCommandsServer).ObjectImportMarkdown(ctx, req.(*pb.RpcObjectImportMarkdownRequest)), nil
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ClientCommands_ObjectListExport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(pb.RpcObjectListExportRequest)
|
||||
if err := dec(in); err != nil {
|
||||
|
@ -3826,6 +3809,24 @@ func _ClientCommands_ObjectImportList_Handler(srv interface{}, ctx context.Conte
|
|||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ClientCommands_ObjectImportNotionValidateToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(pb.RpcObjectImportNotionValidateTokenRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ClientCommandsServer).ObjectImportNotionValidateToken(ctx, in), nil
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/anytype.ClientCommands/ObjectImportNotionValidateToken",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ClientCommandsServer).ObjectImportNotionValidateToken(ctx, req.(*pb.RpcObjectImportNotionValidateTokenRequest)), nil
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ClientCommands_ObjectCreateRelation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(pb.RpcObjectCreateRelationRequest)
|
||||
if err := dec(in); err != nil {
|
||||
|
@ -5998,10 +5999,6 @@ var _ClientCommands_serviceDesc = grpc.ServiceDesc{
|
|||
MethodName: "ObjectRedo",
|
||||
Handler: _ClientCommands_ObjectRedo_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ObjectImportMarkdown",
|
||||
Handler: _ClientCommands_ObjectImportMarkdown_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ObjectListExport",
|
||||
Handler: _ClientCommands_ObjectListExport_Handler,
|
||||
|
@ -6022,6 +6019,10 @@ var _ClientCommands_serviceDesc = grpc.ServiceDesc{
|
|||
MethodName: "ObjectImportList",
|
||||
Handler: _ClientCommands_ObjectImportList_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ObjectImportNotionValidateToken",
|
||||
Handler: _ClientCommands_ObjectImportNotionValidateToken_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ObjectCreateRelation",
|
||||
Handler: _ClientCommands_ObjectCreateRelation_Handler,
|
||||
|
|
|
@ -3,7 +3,6 @@ package core
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
@ -62,15 +61,11 @@ type Service interface {
|
|||
|
||||
FileByHash(ctx context.Context, hash string) (File, error)
|
||||
FileAdd(ctx context.Context, opts ...files.AddOption) (File, error)
|
||||
FileAddWithBytes(ctx context.Context, content []byte, filename string) (File, error) // deprecated
|
||||
FileAddWithReader(ctx context.Context, content io.ReadSeeker, filename string) (File, error) // deprecated
|
||||
FileGetKeys(hash string) (*files.FileKeys, error)
|
||||
FileStoreKeys(fileKeys ...files.FileKeys) error
|
||||
|
||||
ImageByHash(ctx context.Context, hash string) (Image, error)
|
||||
ImageAdd(ctx context.Context, opts ...files.AddOption) (Image, error)
|
||||
ImageAddWithBytes(ctx context.Context, content []byte, filename string) (Image, error) // deprecated
|
||||
ImageAddWithReader(ctx context.Context, content io.ReadSeeker, filename string) (Image, error) // deprecated
|
||||
|
||||
GetAllWorkspaces() ([]string, error)
|
||||
GetWorkspaceIdForObject(objectId string) (string, error)
|
||||
|
|
|
@ -4,7 +4,6 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"github.com/ipfs/go-cid"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/files"
|
||||
|
@ -165,11 +164,3 @@ func (a *Anytype) FileAdd(ctx context.Context, options ...files.AddOption) (File
|
|||
|
||||
return f, nil
|
||||
}
|
||||
|
||||
func (a *Anytype) FileAddWithReader(ctx context.Context, content io.ReadSeeker, filename string) (File, error) {
|
||||
return a.FileAdd(ctx, files.WithReader(content), files.WithName(filename))
|
||||
}
|
||||
|
||||
func (a *Anytype) FileAddWithBytes(ctx context.Context, content []byte, filename string) (File, error) {
|
||||
return a.FileAdd(ctx, files.WithBytes(content), files.WithName(filename))
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ package core
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/files"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/pb/storage"
|
||||
|
@ -87,11 +86,3 @@ func (a *Anytype) ImageAdd(ctx context.Context, options ...files.AddOption) (Ima
|
|||
|
||||
return img, nil
|
||||
}
|
||||
|
||||
func (a *Anytype) ImageAddWithBytes(ctx context.Context, content []byte, filename string) (Image, error) {
|
||||
return a.ImageAdd(ctx, files.WithBytes(content), files.WithName(filename))
|
||||
}
|
||||
|
||||
func (a *Anytype) ImageAddWithReader(ctx context.Context, content io.ReadSeeker, filename string) (Image, error) {
|
||||
return a.ImageAdd(ctx, files.WithReader(content), files.WithName(filename))
|
||||
}
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
package core
|
||||
|
||||
import (
|
||||
"io"
|
||||
)
|
||||
|
||||
func (a *Anytype) IpfsReaderAtPath(pth string) (io.ReadCloser, error) {
|
||||
return nil, nil
|
||||
}
|
|
@ -22,11 +22,6 @@ import (
|
|||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/vclock"
|
||||
)
|
||||
|
||||
const (
|
||||
snippetMinSize = 50
|
||||
snippetMaxSize = 300
|
||||
)
|
||||
|
||||
type ProfileThreadEncryptionKeys struct {
|
||||
ServiceKey []byte
|
||||
ReadKey []byte
|
||||
|
@ -77,12 +72,6 @@ type SmartBlockChange struct {
|
|||
Meta *SmartBlockMetaChange
|
||||
}
|
||||
|
||||
type SmartBlockVersion struct {
|
||||
State vclock.VClock
|
||||
Snapshot SmartBlockSnapshot
|
||||
Changes []SmartBlockChange
|
||||
}
|
||||
|
||||
type SmartBlock interface {
|
||||
ID() string
|
||||
Type() smartblock.SmartBlockType
|
||||
|
@ -116,24 +105,6 @@ func (block *smartBlock) Creator() (string, error) {
|
|||
return "", fmt.Errorf("to be implemented")
|
||||
}
|
||||
|
||||
func (block *smartBlock) GetLastDownloadedVersion() (*SmartBlockVersion, error) {
|
||||
snapshot, err := block.GetLastSnapshot()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &SmartBlockVersion{
|
||||
State: snapshot.State(),
|
||||
Snapshot: snapshot,
|
||||
Changes: []SmartBlockChange{},
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (block *smartBlock) PushChanges(changes []*SmartBlockChange) (state vclock.VClock, err error) {
|
||||
// todo: to be implemented
|
||||
return vclock.Undef, fmt.Errorf("to be implemented")
|
||||
}
|
||||
|
||||
func (block *smartBlock) GetThread() thread.Info {
|
||||
return block.thread
|
||||
}
|
||||
|
@ -330,13 +301,6 @@ func (block *smartBlock) SubscribeForRecords(ch chan SmartblockRecordEnvelope) (
|
|||
return cancel, nil
|
||||
}
|
||||
|
||||
func (block *smartBlock) SubscribeForChanges(since vclock.VClock, ch chan SmartBlockChange) (cancel func(), err error) {
|
||||
chCloseFn := func() { close(ch) }
|
||||
|
||||
// todo: to be implemented
|
||||
return chCloseFn, nil
|
||||
}
|
||||
|
||||
func (block *smartBlock) SubscribeClientEvents(events chan<- proto.Message) (cancelFunc func(), err error) {
|
||||
// todo: to be implemented
|
||||
return func() { close(events) }, nil
|
||||
|
|
|
@ -22,7 +22,6 @@ const (
|
|||
SmartBlockTypeProfilePage = SmartBlockType(model.SmartBlockType_ProfilePage)
|
||||
SmartBlockTypeHome = SmartBlockType(model.SmartBlockType_Home)
|
||||
SmartBlockTypeArchive = SmartBlockType(model.SmartBlockType_Archive)
|
||||
SmartBlockTypeDatabase = SmartBlockType(model.SmartBlockType_Database)
|
||||
SmartBlockTypeSet = SmartBlockType(model.SmartBlockType_Set)
|
||||
SmartBlockTypeObjectType = SmartBlockType(model.SmartBlockType_STObjectType)
|
||||
SmartBlockTypeFile = SmartBlockType(model.SmartBlockType_File)
|
||||
|
|
|
@ -11,26 +11,8 @@ import (
|
|||
)
|
||||
|
||||
var ErrRepoExists = fmt.Errorf("repo not empty, reinitializing would overwrite your account")
|
||||
var ErrRepoDoesNotExist = fmt.Errorf("repo does not exist, initialization is required")
|
||||
var ErrMigrationRequired = fmt.Errorf("repo needs migration")
|
||||
var ErrRepoCorrupted = fmt.Errorf("repo is corrupted")
|
||||
|
||||
func WalletListLocalAccounts(rootPath string) ([]string, error) {
|
||||
repos, err := ioutil.ReadDir(rootPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var accounts []string
|
||||
for _, f := range repos {
|
||||
if len(f.Name()) == 48 {
|
||||
accounts = append(accounts, f.Name())
|
||||
}
|
||||
}
|
||||
|
||||
return accounts, nil
|
||||
}
|
||||
|
||||
func WalletGenerateMnemonic(wordCount int) (string, error) {
|
||||
w, err := wallet.WalletFromWordCount(wordCount)
|
||||
if err != nil {
|
||||
|
|
|
@ -72,7 +72,6 @@ func New() *Service {
|
|||
return &Service{}
|
||||
}
|
||||
|
||||
var ErrMissingMetaLink = fmt.Errorf("meta link not in node")
|
||||
var ErrMissingContentLink = fmt.Errorf("content link not in node")
|
||||
|
||||
const MetaLinkName = "meta"
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package files
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
|
@ -29,36 +28,12 @@ func WithReader(r io.ReadSeeker) AddOption {
|
|||
}
|
||||
}
|
||||
|
||||
func WithBytes(b []byte) AddOption {
|
||||
return func(args *AddOptions) {
|
||||
args.Reader = bytes.NewReader(b)
|
||||
}
|
||||
}
|
||||
|
||||
func WithCid(cid string) AddOption {
|
||||
return func(args *AddOptions) {
|
||||
args.Use = cid
|
||||
}
|
||||
}
|
||||
|
||||
func WithMedia(media string) AddOption {
|
||||
return func(args *AddOptions) {
|
||||
args.Media = media
|
||||
}
|
||||
}
|
||||
|
||||
func WithName(name string) AddOption {
|
||||
return func(args *AddOptions) {
|
||||
args.Name = name
|
||||
}
|
||||
}
|
||||
|
||||
func WithPlaintext(plaintext bool) AddOption {
|
||||
return func(args *AddOptions) {
|
||||
args.Plaintext = plaintext
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Service) NormalizeOptions(ctx context.Context, opts *AddOptions) error {
|
||||
if opts.Use != "" {
|
||||
ref, err := ipfspath.ParsePath(opts.Use)
|
||||
|
|
|
@ -6,24 +6,19 @@ import (
|
|||
"github.com/anytypeio/go-anytype-middleware/metrics"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/ipfs/helpers/resolver"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/ipfs/go-merkledag"
|
||||
"github.com/libp2p/go-libp2p/core/host"
|
||||
"github.com/libp2p/go-libp2p/core/network"
|
||||
"github.com/libp2p/go-libp2p/core/peer"
|
||||
"github.com/libp2p/go-libp2p/p2p/net/swarm"
|
||||
ma "github.com/multiformats/go-multiaddr"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
gopath "path"
|
||||
"time"
|
||||
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/crypto/symmetric"
|
||||
files "github.com/ipfs/go-ipfs-files"
|
||||
ipld "github.com/ipfs/go-ipld-format"
|
||||
ipfspath "github.com/ipfs/go-path"
|
||||
uio "github.com/ipfs/go-unixfs/io"
|
||||
iface "github.com/ipfs/interface-go-ipfs-core"
|
||||
"github.com/ipfs/interface-go-ipfs-core/path"
|
||||
mh "github.com/multiformats/go-multihash"
|
||||
|
||||
|
@ -53,27 +48,6 @@ func DataAtPath(ctx context.Context, node ipfs.IPFS, pth string) (cid.Cid, symme
|
|||
return resolvedPath.Cid(), r, nil
|
||||
}
|
||||
|
||||
// DataAtCid return bytes under an ipfs path
|
||||
func DataAtCid(ctx context.Context, node ipfs.IPFS, cid cid.Cid) ([]byte, error) {
|
||||
f, err := node.GetFile(ctx, cid)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
var file files.File
|
||||
switch f := f.(type) {
|
||||
case files.File:
|
||||
file = f
|
||||
case files.Directory:
|
||||
return nil, iface.ErrIsDir
|
||||
default:
|
||||
return nil, iface.ErrNotSupported
|
||||
}
|
||||
|
||||
return ioutil.ReadAll(file)
|
||||
}
|
||||
|
||||
func LinksAtCid(ctx context.Context, dag ipld.DAGService, pathCid string) ([]*ipld.Link, error) {
|
||||
pathCidParsed, err := cid.Parse(pathCid)
|
||||
if err != nil {
|
||||
|
@ -132,26 +106,6 @@ func ResolvePath(ctx context.Context, dag ipld.DAGService, p path.Path) (path.Re
|
|||
return path.NewResolvedPath(ipath, node, root, gopath.Join(rest...)), nil
|
||||
}
|
||||
|
||||
// AddDataToDirectory adds reader bytes to a virtual dir
|
||||
func AddDataToDirectory(ctx context.Context, node ipfs.IPFS, dir uio.Directory, fname string, reader io.Reader) (*cid.Cid, error) {
|
||||
id, err := AddData(ctx, node, reader, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
n, err := node.Get(ctx, *id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = dir.AddChild(ctx, fname, n)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return id, nil
|
||||
}
|
||||
|
||||
// AddLinkToDirectory adds a link to a virtual dir
|
||||
func AddLinkToDirectory(ctx context.Context, dag ipld.DAGService, dir uio.Directory, fname string, pth string) error {
|
||||
id, err := cid.Decode(pth)
|
||||
|
@ -170,36 +124,11 @@ func AddLinkToDirectory(ctx context.Context, dag ipld.DAGService, dir uio.Direct
|
|||
return dir.AddChild(ctx, fname, nd)
|
||||
}
|
||||
|
||||
// AddData takes a reader and adds it, optionally pins it, optionally only hashes it
|
||||
func AddData(ctx context.Context, node ipfs.IPFS, reader io.Reader, pin bool) (*cid.Cid, error) {
|
||||
pth, err := node.AddFile(ctx, files.NewReaderFile(reader), nil)
|
||||
log.Debugf("AddData: %s", pth.Cid().String())
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if pin {
|
||||
/* err = api.Pin().Add(ctx, pth, options.Pin.Recursive(false))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}*/
|
||||
}
|
||||
id := pth.Cid()
|
||||
|
||||
return &id, nil
|
||||
}
|
||||
|
||||
// NodeAtLink returns the node behind an ipld link
|
||||
func NodeAtLink(ctx context.Context, dag ipld.DAGService, link *ipld.Link) (ipld.Node, error) {
|
||||
return link.GetNode(ctx, dag)
|
||||
}
|
||||
|
||||
// NodeAtCid returns the node behind a cid
|
||||
func NodeAtCid(ctx context.Context, dag ipld.DAGService, id cid.Cid) (ipld.Node, error) {
|
||||
return dag.Get(ctx, id)
|
||||
}
|
||||
|
||||
type Node struct {
|
||||
Links []Link
|
||||
Data string
|
||||
|
@ -210,24 +139,6 @@ type Link struct {
|
|||
Size uint64
|
||||
}
|
||||
|
||||
// ResolveLinkByNames resolves a link in a node from a list of valid names
|
||||
// Note: This exists for b/c w/ the "f" -> "meta" and "d" -> content migration
|
||||
func ResolveLinkByNames(nd ipld.Node, names []string) (*ipld.Link, error) {
|
||||
for _, n := range names {
|
||||
link, _, err := nd.ResolveLink([]string{n})
|
||||
if err != nil {
|
||||
if err == merkledag.ErrLinkNotFound {
|
||||
continue
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
if link != nil {
|
||||
return link, nil
|
||||
}
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func PermanentConnection(ctx context.Context, addr ma.Multiaddr, host host.Host, retryInterval time.Duration, grpcConnected func() bool) error {
|
||||
addrInfo, err := peer.AddrInfoFromP2pAddr(addr)
|
||||
if err != nil {
|
||||
|
|
|
@ -35,21 +35,14 @@ type ResolveOnce func(ctx context.Context, ds ipld.NodeGetter, nd ipld.Node, nam
|
|||
// Resolver provides path resolution to IPFS
|
||||
// It has a pointer to a DAGService, which is uses to resolve nodes.
|
||||
// TODO: now that this is more modular, try to unify this code with the
|
||||
// the resolvers in namesys
|
||||
//
|
||||
// the resolvers in namesys
|
||||
type Resolver struct {
|
||||
DAG ipld.NodeGetter
|
||||
|
||||
ResolveOnce ResolveOnce
|
||||
}
|
||||
|
||||
// NewBasicResolver constructs a new basic resolver.
|
||||
func NewBasicResolver(ds ipld.DAGService) *Resolver {
|
||||
return &Resolver{
|
||||
DAG: ds,
|
||||
ResolveOnce: ResolveSingle,
|
||||
}
|
||||
}
|
||||
|
||||
// ResolveToLastNode walks the given path and returns the cid of the last node
|
||||
// referenced by the path
|
||||
func (r *Resolver) ResolveToLastNode(ctx context.Context, fpath path.Path) (cid.Cid, []string, error) {
|
||||
|
|
|
@ -3,7 +3,6 @@ package ipfs
|
|||
import (
|
||||
"context"
|
||||
"github.com/anytypeio/go-anytype-middleware/app"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/logging"
|
||||
cid "github.com/ipfs/go-cid"
|
||||
blockstore "github.com/ipfs/go-ipfs-blockstore"
|
||||
ipld "github.com/ipfs/go-ipld-format"
|
||||
|
@ -15,8 +14,6 @@ import (
|
|||
|
||||
const CName = "ipfs"
|
||||
|
||||
var log = logging.Logger("anytype-core-ipfs")
|
||||
|
||||
const (
|
||||
IpfsPrivateNetworkKey = `/key/swarm/psk/1.0.0/
|
||||
/base16/
|
||||
|
|
|
@ -287,10 +287,6 @@ func (ln *liteNet) Close() (err error) {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (ln *liteNet) WaitBootstrapFinish() (success bool) {
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (i *liteNet) Session(ctx context.Context) ipld.NodeGetter {
|
||||
return i.Peer.Session(ctx)
|
||||
}
|
||||
|
|
|
@ -43,11 +43,6 @@ func ExtractVirtualSourceType(id string) (model.SmartBlockType, error) {
|
|||
return 0, fmt.Errorf("sb type '%s' not found", sbTypeName)
|
||||
}
|
||||
|
||||
// returns the
|
||||
func GetVirtualCollectionObjectId(collectionName, key string) string {
|
||||
return collectionName + SubObjectCollectionIdSeparator + key
|
||||
}
|
||||
|
||||
func ConvertBundledObjectIdToInstalledId(bundledId string) (string, error) {
|
||||
if strings.HasPrefix(bundledId, BundledRelationURLPrefix) {
|
||||
return RelationKeyToIdPrefix + strings.TrimPrefix(bundledId, BundledRelationURLPrefix), nil
|
||||
|
|
|
@ -288,11 +288,6 @@ type ObjectStore interface {
|
|||
GetThreadQueueState() (map[string]map[string]struct{}, map[string]map[string]struct{}, error)
|
||||
}
|
||||
|
||||
type relationOption struct {
|
||||
relationKey string
|
||||
optionId string
|
||||
}
|
||||
|
||||
type relationObjectType struct {
|
||||
relationKeys []string
|
||||
objectTypes []string
|
||||
|
@ -313,11 +308,6 @@ type filterSmartblockTypes struct {
|
|||
not bool
|
||||
}
|
||||
|
||||
type RelationWithObjectType struct {
|
||||
objectType string
|
||||
relation *model.Relation
|
||||
}
|
||||
|
||||
func (m *filterSmartblockTypes) Filter(e query.Entry) bool {
|
||||
keyParts := strings.Split(e.Key, "/")
|
||||
id := keyParts[len(keyParts)-1]
|
||||
|
@ -1938,27 +1928,6 @@ func (m *dsObjectStore) updateDetails(txn noctxds.Txn, id string, oldDetails *mo
|
|||
return nil
|
||||
}
|
||||
|
||||
func storeOptions(txn noctxds.Txn, options []*model.RelationOption) error {
|
||||
var err error
|
||||
for _, opt := range options {
|
||||
err = storeOption(txn, opt)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func storeOption(txn noctxds.Txn, option *model.RelationOption) error {
|
||||
b, err := proto.Marshal(option)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
optionKey := relationsOptionsBase.ChildString(option.Id)
|
||||
return txn.Put(optionKey, b)
|
||||
}
|
||||
|
||||
func (m *dsObjectStore) Prefix() string {
|
||||
return pagesPrefix
|
||||
}
|
||||
|
@ -2047,15 +2016,6 @@ func (m *dsObjectStore) listRelations(txn noctxds.Txn, limit int) ([]*model.Rela
|
|||
return rels, nil
|
||||
}
|
||||
|
||||
func isObjectBelongToType(txn noctxds.Txn, id, objType string) (bool, error) {
|
||||
objTypeCompact, err := objTypeCompactEncode(objType)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
return localstore.HasPrimaryKeyByIndexParts(txn, pagesPrefix, indexObjectTypeObject.Name, []string{objTypeCompact}, "", false, id)
|
||||
}
|
||||
|
||||
/* internal */
|
||||
// getObjectDetails returns empty(not nil) details when not found in the DS
|
||||
func getObjectDetails(txn noctxds.Txn, id string) (*model.ObjectDetails, error) {
|
||||
|
@ -2100,20 +2060,6 @@ func hasObjectId(txn noctxds.Txn, id string) (bool, error) {
|
|||
}
|
||||
}
|
||||
|
||||
// getSetRelations returns the list of relations last time indexed for the set's dataview
|
||||
func getSetRelations(txn noctxds.Txn, id string) ([]*model.Relation, error) {
|
||||
var relations model.Relations
|
||||
if val, err := txn.Get(setRelationsBase.ChildString(id)); err != nil {
|
||||
if err != ds.ErrNotFound {
|
||||
return nil, fmt.Errorf("failed to get relations: %w", err)
|
||||
}
|
||||
} else if err := proto.Unmarshal(val, &relations); err != nil {
|
||||
return nil, fmt.Errorf("failed to unmarshal relations: %w", err)
|
||||
}
|
||||
|
||||
return relations.GetRelations(), nil
|
||||
}
|
||||
|
||||
// getObjectRelations returns the list of relations last time indexed for the object
|
||||
func getObjectRelations(txn noctxds.Txn, id string) ([]*model.Relation, error) {
|
||||
var relations model.Relations
|
||||
|
@ -2128,28 +2074,6 @@ func getObjectRelations(txn noctxds.Txn, id string) ([]*model.Relation, error) {
|
|||
return relations.GetRelations(), nil
|
||||
}
|
||||
|
||||
func getOption(txn noctxds.Txn, optionId string) (*model.RelationOption, error) {
|
||||
var opt model.RelationOption
|
||||
if val, err := txn.Get(relationsOptionsBase.ChildString(optionId)); err != nil {
|
||||
log.Debugf("getOption %s: not found", optionId)
|
||||
if err != ds.ErrNotFound {
|
||||
return nil, fmt.Errorf("failed to get option from localstore: %w", err)
|
||||
}
|
||||
} else if err := proto.Unmarshal(val, &opt); err != nil {
|
||||
return nil, fmt.Errorf("failed to unmarshal option: %w", err)
|
||||
}
|
||||
|
||||
return &opt, nil
|
||||
}
|
||||
|
||||
func getObjectTypeFromDetails(det *types.Struct) ([]string, error) {
|
||||
if !pbtypes.HasField(det, bundle.RelationKeyType.String()) {
|
||||
return nil, fmt.Errorf("type not found in details")
|
||||
}
|
||||
|
||||
return pbtypes.GetStringList(det, bundle.RelationKeyType.String()), nil
|
||||
}
|
||||
|
||||
func (m *dsObjectStore) getObjectInfo(txn noctxds.Txn, id string) (*model.ObjectInfo, error) {
|
||||
sbt, err := smartblock.SmartBlockTypeFromID(id)
|
||||
if err != nil {
|
||||
|
|
|
@ -19,7 +19,6 @@ import (
|
|||
var (
|
||||
ErrDuplicateKey = fmt.Errorf("duplicate key")
|
||||
ErrNotFound = fmt.Errorf("not found")
|
||||
errTxnTooBig = fmt.Errorf("Txn is too big to fit into one request")
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -249,21 +248,6 @@ func AddIndexesWithTxn(store Indexable, txn ds.Txn, newVal interface{}, newValPr
|
|||
return nil
|
||||
}
|
||||
|
||||
func AddIndexes(store Indexable, ds ds.TxnDatastore, newVal interface{}, newValPrimary string) error {
|
||||
txn, err := ds.NewTransaction(false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer txn.Discard()
|
||||
|
||||
err = AddIndexesWithTxn(store, txn, newVal, newValPrimary)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return txn.Commit()
|
||||
}
|
||||
|
||||
func RemoveIndexes(store Indexable, ds ds.TxnDatastore, val interface{}, valPrimary string) error {
|
||||
txn, err := ds.NewTransaction(false)
|
||||
if err != nil {
|
||||
|
@ -333,22 +317,6 @@ func GetKeysByIndexParts(txn ds.Txn, prefix string, keyIndexName string, keyInde
|
|||
return GetKeys(txn, key.String(), limit)
|
||||
}
|
||||
|
||||
func QueryByIndexParts(txn ds.Txn, prefix string, keyIndexName string, keyIndexValue []string, separator string, hash bool, limit int) (query.Results, error) {
|
||||
key := getDsKeyByIndexParts(prefix, keyIndexName, keyIndexValue, separator, hash)
|
||||
|
||||
return txn.Query(query.Query{
|
||||
Prefix: key.String(),
|
||||
Limit: limit,
|
||||
KeysOnly: false,
|
||||
})
|
||||
}
|
||||
|
||||
func HasPrimaryKeyByIndexParts(txn ds.Txn, prefix string, keyIndexName string, keyIndexValue []string, separator string, hash bool, primaryIndex string) (exists bool, err error) {
|
||||
key := getDsKeyByIndexParts(prefix, keyIndexName, keyIndexValue, separator, hash).ChildString(primaryIndex)
|
||||
|
||||
return txn.Has(key)
|
||||
}
|
||||
|
||||
func CountAllKeysFromResults(results query.Results) (int, error) {
|
||||
var count int
|
||||
for {
|
||||
|
|
|
@ -103,22 +103,6 @@ func Logger(system string) *LWrapper {
|
|||
return &LWrapper{logger.SugaredLogger}
|
||||
}
|
||||
|
||||
func SetLoggingFilepath(logPath string) {
|
||||
cfg := defaultCfg
|
||||
|
||||
cfg.Format = logging.PlaintextOutput
|
||||
cfg.File = filepath.Join(logPath, "anytype.log")
|
||||
|
||||
logging.SetupLogging(cfg)
|
||||
}
|
||||
|
||||
func SetLoggingFormat(format logging.LogFormat) {
|
||||
cfg := getLoggingConfig()
|
||||
cfg.Format = format
|
||||
|
||||
logging.SetupLogging(cfg)
|
||||
}
|
||||
|
||||
func ApplyLevels(str string) {
|
||||
m.Lock()
|
||||
logLevelsStr = str
|
||||
|
|
|
@ -2,6 +2,7 @@ package mill
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"image"
|
||||
"image/color/palette"
|
||||
|
@ -12,11 +13,9 @@ import (
|
|||
"io"
|
||||
"strconv"
|
||||
|
||||
"github.com/chai2010/webp"
|
||||
"github.com/disintegration/imaging"
|
||||
"github.com/dsoprea/go-exif/v3"
|
||||
jpegstructure "github.com/dsoprea/go-jpeg-image-structure/v2"
|
||||
"golang.org/x/exp/slices"
|
||||
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/mill/ico"
|
||||
|
||||
|
@ -39,6 +38,8 @@ const (
|
|||
WEBP Format = "webp"
|
||||
)
|
||||
|
||||
var ErrWEBPNotSupported = errors.New("webp image format is not supported")
|
||||
|
||||
type ImageSize struct {
|
||||
Width int
|
||||
Height int
|
||||
|
@ -90,7 +91,21 @@ func (m *ImageResize) Mill(r io.ReadSeeker, name string) (*Result, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
var height int
|
||||
switch format {
|
||||
case JPEG:
|
||||
return m.resizeJPEG(&imgConfig, r)
|
||||
case ICO, PNG:
|
||||
return m.resizePNG(&imgConfig, r)
|
||||
case WEBP:
|
||||
return m.resizeWEBP(&imgConfig, r)
|
||||
case GIF:
|
||||
return m.resizeGIF(&imgConfig, r)
|
||||
}
|
||||
|
||||
return nil, fmt.Errorf("unknown format")
|
||||
}
|
||||
|
||||
func (m *ImageResize) resizeJPEG(imgConfig *image.Config, r io.ReadSeeker) (*Result, error) {
|
||||
width, err := strconv.Atoi(m.Opts.Width)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("invalid width: " + m.Opts.Width)
|
||||
|
@ -100,47 +115,46 @@ func (m *ImageResize) Mill(r io.ReadSeeker, name string) (*Result, error) {
|
|||
return nil, fmt.Errorf("invalid quality: " + m.Opts.Quality)
|
||||
}
|
||||
|
||||
var (
|
||||
img image.Image
|
||||
orientation int
|
||||
)
|
||||
var exifData []byte
|
||||
exifData, err = getExifData(r)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to get exif data %s", err.Error())
|
||||
}
|
||||
|
||||
if format == JPEG {
|
||||
var exifData []byte
|
||||
exifData, err = getExifData(r)
|
||||
_, err = r.Seek(0, io.SeekStart)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var orientation int
|
||||
var img image.Image
|
||||
|
||||
if exifData != nil {
|
||||
orientation, err = getJpegOrientation(exifData)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to get exif data %s", err.Error())
|
||||
return nil, fmt.Errorf("failed to get jpeg orientation: %s", err.Error())
|
||||
}
|
||||
|
||||
_, err = r.Seek(0, io.SeekStart)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if exifData != nil {
|
||||
orientation, err = getJpegOrientation(exifData)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to get jpeg orientation: %s", err.Error())
|
||||
}
|
||||
_, err = r.Seek(0, io.SeekStart)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
if orientation > 1 {
|
||||
img, err = jpeg.Decode(r)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
img = reverseOrientation(img, orientation)
|
||||
if err != nil {
|
||||
err = fmt.Errorf("failed to fix img orientation: %s", err.Error())
|
||||
return nil, err
|
||||
}
|
||||
imgConfig.Width, imgConfig.Height = img.Bounds().Max.X, img.Bounds().Max.Y
|
||||
}
|
||||
}
|
||||
|
||||
if orientation > 1 {
|
||||
img, err = jpeg.Decode(r)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
img = reverseOrientation(img, orientation)
|
||||
if err != nil {
|
||||
err = fmt.Errorf("failed to fix img orientation: %s", err.Error())
|
||||
return nil, err
|
||||
}
|
||||
imgConfig.Width, imgConfig.Height = img.Bounds().Max.X, img.Bounds().Max.Y
|
||||
}
|
||||
|
||||
var height int
|
||||
if imgConfig.Width <= width || width == 0 {
|
||||
// we will not do the upscale
|
||||
width, height = imgConfig.Width, imgConfig.Height
|
||||
|
@ -148,15 +162,11 @@ func (m *ImageResize) Mill(r io.ReadSeeker, name string) (*Result, error) {
|
|||
|
||||
if orientation <= 1 && width == imgConfig.Width {
|
||||
var r2 io.Reader
|
||||
if format == JPEG {
|
||||
r2, err = patchReaderRemoveExif(r)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
} else {
|
||||
r2 = r
|
||||
r2, err = patchReaderRemoveExif(r)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// here is an optimisation
|
||||
// here is an optimization
|
||||
// lets return the original picture in case it has not been resized or normalized
|
||||
return &Result{
|
||||
File: r2,
|
||||
|
@ -167,77 +177,125 @@ func (m *ImageResize) Mill(r io.ReadSeeker, name string) (*Result, error) {
|
|||
}, nil
|
||||
}
|
||||
|
||||
if slices.Contains([]Format{JPEG, PNG, ICO, WEBP}, format) {
|
||||
switch {
|
||||
case format == JPEG && img == nil:
|
||||
// we already have img decoded if we have orientation <= 1
|
||||
img, err = jpeg.Decode(r)
|
||||
case format == WEBP:
|
||||
img, err = webp.Decode(r)
|
||||
case format != JPEG:
|
||||
img, err = png.Decode(r)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
if img == nil {
|
||||
if img, err = jpeg.Decode(r); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
resized := imaging.Resize(img, width, 0, imaging.Lanczos)
|
||||
width, height = resized.Rect.Max.X, resized.Rect.Max.Y
|
||||
resized := imaging.Resize(img, width, 0, imaging.Lanczos)
|
||||
width, height = resized.Rect.Max.X, resized.Rect.Max.Y
|
||||
|
||||
buff := &bytes.Buffer{}
|
||||
switch format {
|
||||
case JPEG:
|
||||
err = jpeg.Encode(buff, resized, &jpeg.Options{Quality: quality})
|
||||
case WEBP:
|
||||
err = webp.Encode(buff, resized, &webp.Options{Quality: float32(quality)})
|
||||
default:
|
||||
err = png.Encode(buff, resized)
|
||||
}
|
||||
buff := &bytes.Buffer{}
|
||||
if jpeg.Encode(buff, resized, &jpeg.Options{Quality: quality}) != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &Result{
|
||||
File: buff,
|
||||
Meta: map[string]interface{}{
|
||||
"width": width,
|
||||
"height": height,
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (m *ImageResize) resizePNG(imgConfig *image.Config, r io.ReadSeeker) (*Result, error) {
|
||||
var height int
|
||||
width, err := strconv.Atoi(m.Opts.Width)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("invalid width: " + m.Opts.Width)
|
||||
}
|
||||
|
||||
if imgConfig.Width <= width || width == 0 {
|
||||
// we will not do the upscale
|
||||
width, height = imgConfig.Width, imgConfig.Height
|
||||
}
|
||||
|
||||
if width == imgConfig.Width {
|
||||
// here is an optimization
|
||||
// lets return the original picture in case it has not been resized or normalized
|
||||
return &Result{
|
||||
File: buff,
|
||||
File: r,
|
||||
Meta: map[string]interface{}{
|
||||
"width": width,
|
||||
"height": height,
|
||||
"width": imgConfig.Width,
|
||||
"height": imgConfig.Height,
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
if format == GIF {
|
||||
gifImg, err := gif.DecodeAll(r)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
rect := image.Rect(0, 0, imgConfig.Width, imgConfig.Height)
|
||||
rgba := image.NewRGBA(rect)
|
||||
for index, frame := range gifImg.Image {
|
||||
bounds := frame.Bounds()
|
||||
draw.Draw(rgba, bounds, frame, bounds.Min, draw.Over)
|
||||
gifImg.Image[index] = imageToPaletted(imaging.Resize(rgba, width, 0, imaging.Lanczos))
|
||||
}
|
||||
gifImg.Config.Width, gifImg.Config.Height = gifImg.Image[0].Bounds().Dx(), gifImg.Image[0].Bounds().Dy()
|
||||
img, err := png.Decode(r)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
buff := bytes.NewBuffer(make([]byte, 0))
|
||||
resized := imaging.Resize(img, width, 0, imaging.Lanczos)
|
||||
width, height = resized.Rect.Max.X, resized.Rect.Max.Y
|
||||
|
||||
if err = gif.EncodeAll(buff, gifImg); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
buff := &bytes.Buffer{}
|
||||
if png.Encode(buff, resized) != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &Result{
|
||||
File: buff,
|
||||
Meta: map[string]interface{}{
|
||||
"width": width,
|
||||
"height": height,
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (m *ImageResize) resizeGIF(imgConfig *image.Config, r io.ReadSeeker) (*Result, error) {
|
||||
width, err := strconv.Atoi(m.Opts.Width)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("invalid width: " + m.Opts.Width)
|
||||
}
|
||||
|
||||
if imgConfig.Width <= width || width == 0 {
|
||||
// we will not do the upscale
|
||||
width = imgConfig.Width
|
||||
}
|
||||
|
||||
if width == imgConfig.Width {
|
||||
// here is an optimization
|
||||
// lets return the original picture in case it has not been resized or normalized
|
||||
return &Result{
|
||||
File: buff,
|
||||
File: r,
|
||||
Meta: map[string]interface{}{
|
||||
"width": gifImg.Config.Width,
|
||||
"height": gifImg.Config.Height,
|
||||
"width": imgConfig.Width,
|
||||
"height": imgConfig.Height,
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
return nil, fmt.Errorf("unknown format")
|
||||
gifImg, err := gif.DecodeAll(r)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
rect := image.Rect(0, 0, imgConfig.Width, imgConfig.Height)
|
||||
rgba := image.NewRGBA(rect)
|
||||
|
||||
for index, frame := range gifImg.Image {
|
||||
bounds := frame.Bounds()
|
||||
draw.Draw(rgba, bounds, frame, bounds.Min, draw.Over)
|
||||
gifImg.Image[index] = imageToPaletted(imaging.Resize(rgba, width, 0, imaging.Lanczos))
|
||||
}
|
||||
gifImg.Config.Width, gifImg.Config.Height = gifImg.Image[0].Bounds().Dx(), gifImg.Image[0].Bounds().Dy()
|
||||
|
||||
buff := bytes.NewBuffer(make([]byte, 0))
|
||||
if gif.EncodeAll(buff, gifImg) != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &Result{
|
||||
File: buff,
|
||||
Meta: map[string]interface{}{
|
||||
"width": gifImg.Config.Width,
|
||||
"height": gifImg.Config.Height,
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
func getExifData(r io.ReadSeeker) (data []byte, err error) {
|
||||
|
|
12
pkg/lib/mill/image_resize_nowebp.go
Normal file
12
pkg/lib/mill/image_resize_nowebp.go
Normal file
|
@ -0,0 +1,12 @@
|
|||
//go:build !webpresize
|
||||
|
||||
package mill
|
||||
|
||||
import (
|
||||
"image"
|
||||
"io"
|
||||
)
|
||||
|
||||
func (m *ImageResize) resizeWEBP(imgConfig *image.Config, r io.ReadSeeker) (*Result, error) {
|
||||
return nil, ErrWEBPNotSupported
|
||||
}
|
66
pkg/lib/mill/image_resize_webp.go
Normal file
66
pkg/lib/mill/image_resize_webp.go
Normal file
|
@ -0,0 +1,66 @@
|
|||
//go:build webpresize
|
||||
// +build webpresize
|
||||
|
||||
package mill
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"image"
|
||||
"io"
|
||||
"strconv"
|
||||
|
||||
"github.com/chai2010/webp"
|
||||
"github.com/disintegration/imaging"
|
||||
)
|
||||
|
||||
func (m *ImageResize) resizeWEBP(imgConfig *image.Config, r io.ReadSeeker) (*Result, error) {
|
||||
var height int
|
||||
width, err := strconv.Atoi(m.Opts.Width)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("invalid width: " + m.Opts.Width)
|
||||
}
|
||||
|
||||
quality, err := strconv.Atoi(m.Opts.Quality)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("invalid quality: " + m.Opts.Quality)
|
||||
}
|
||||
|
||||
if imgConfig.Width <= width || width == 0 {
|
||||
// we will not do the upscale
|
||||
width, height = imgConfig.Width, imgConfig.Height
|
||||
}
|
||||
|
||||
if width == imgConfig.Width {
|
||||
// here is an optimization
|
||||
// lets return the original picture in case it has not been resized or normalized
|
||||
return &Result{
|
||||
File: r,
|
||||
Meta: map[string]interface{}{
|
||||
"width": imgConfig.Width,
|
||||
"height": imgConfig.Height,
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
img, err := webp.Decode(r)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
resized := imaging.Resize(img, width, 0, imaging.Lanczos)
|
||||
width, height = resized.Rect.Max.X, resized.Rect.Max.Y
|
||||
|
||||
buff := &bytes.Buffer{}
|
||||
if webp.Encode(buff, resized, &webp.Options{Quality: float32(quality)}) != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &Result{
|
||||
File: buff,
|
||||
Meta: map[string]interface{}{
|
||||
"width": width,
|
||||
"height": height,
|
||||
},
|
||||
}, nil
|
||||
}
|
|
@ -8,44 +8,18 @@ import (
|
|||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/pb/storage"
|
||||
)
|
||||
|
||||
// ErrFileValidationFailed indicates dag schema validation failed
|
||||
var ErrFileValidationFailed = fmt.Errorf("file failed schema validation")
|
||||
|
||||
// ErrEmptySchema indicates a schema is empty
|
||||
var ErrEmptySchema = fmt.Errorf("schema does not create any files")
|
||||
|
||||
// ErrLinkOrderNotSolvable
|
||||
var ErrLinkOrderNotSolvable = fmt.Errorf("link order is not solvable")
|
||||
|
||||
// ErrSchemaInvalidMill indicates a schema has an invalid mill entry
|
||||
var ErrSchemaInvalidMill = fmt.Errorf("schema contains an invalid mill")
|
||||
|
||||
// ErrMissingJsonSchema indicates json schema is missing
|
||||
var ErrMissingJsonSchema = fmt.Errorf("json mill requires a json schema")
|
||||
|
||||
// ErrBadJsonSchema indicates json schema is invalid
|
||||
var ErrBadJsonSchema = fmt.Errorf("json schema is not valid")
|
||||
|
||||
// FileTag indicates the link should "use" the input file as source
|
||||
const FileTag = ":file"
|
||||
|
||||
// SingleFileTag is a magic key indicating that a directory is actually a single file
|
||||
const SingleFileTag = ":single"
|
||||
|
||||
// ValidateMill is false if mill is not one of the built in tags
|
||||
func ValidateMill(mill string) bool {
|
||||
switch mill {
|
||||
case
|
||||
"/schema",
|
||||
"/blob",
|
||||
"/image/resize",
|
||||
"/image/exif",
|
||||
"/json":
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// LinkByName finds a link w/ one of the given names in the provided list
|
||||
func LinkByName(links []*ipld.Link, names []string) *ipld.Link {
|
||||
for _, l := range links {
|
||||
|
|
7
pkg/lib/mill/testdata/images.go
vendored
7
pkg/lib/mill/testdata/images.go
vendored
|
@ -44,11 +44,4 @@ var Images = []TestImage{
|
|||
Width: 300,
|
||||
Height: 187,
|
||||
},
|
||||
{
|
||||
Path: "testdata/image.webp",
|
||||
Format: "webp",
|
||||
HasExif: true,
|
||||
Width: 320,
|
||||
Height: 214,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -4,14 +4,11 @@ import (
|
|||
"fmt"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/bundle"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/database/filter"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/logging"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/pb/model"
|
||||
"github.com/anytypeio/go-anytype-middleware/util/pbtypes"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var log = logging.Logger("anytype-core-schema")
|
||||
|
||||
// Schema used to subset compatible objects by some common relations
|
||||
type Schema interface {
|
||||
Filters() filter.Filter
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
package structs
|
||||
|
||||
import "github.com/gogo/protobuf/types"
|
||||
|
||||
func String(s string) *types.Value {
|
||||
return &types.Value{Kind: &types.Value_StringValue{StringValue: s}}
|
||||
}
|
||||
|
||||
func Float64(i float64) *types.Value {
|
||||
return &types.Value{Kind: &types.Value_NumberValue{NumberValue: i}}
|
||||
}
|
||||
|
||||
func Bool(b bool) *types.Value {
|
||||
return &types.Value{Kind: &types.Value_BoolValue{BoolValue: b}}
|
||||
}
|
|
@ -16,9 +16,6 @@ import (
|
|||
|
||||
const nodeConnectionTimeout = time.Second * 15
|
||||
const ThreadInfoCollectionName = "threads"
|
||||
const MetaCollectionName = "meta"
|
||||
const CreatorCollectionName = "creator"
|
||||
const HighlightedCollectionName = "highlighted"
|
||||
|
||||
type ThreadDBInfo struct {
|
||||
ID db.InstanceID `json:"_id"`
|
||||
|
|
|
@ -7,7 +7,6 @@ import (
|
|||
const (
|
||||
DefaultPriority = iota
|
||||
HighPriority
|
||||
MaxPriority
|
||||
)
|
||||
|
||||
type Operation interface {
|
||||
|
|
|
@ -13,9 +13,6 @@ import (
|
|||
"github.com/textileio/go-threads/core/thread"
|
||||
)
|
||||
|
||||
var ErrFailedToPullThread = fmt.Errorf("failed to pull thread")
|
||||
var ErrFailedToProcessNewHead = fmt.Errorf("failed to process new page head")
|
||||
|
||||
func (s *service) pullThread(ctx context.Context, id thread.ID) (headsChanged bool, err error) {
|
||||
thrd, err := s.t.GetThread(context.Background(), id)
|
||||
if err != nil {
|
||||
|
|
|
@ -33,10 +33,6 @@ func NewTxnBatch(ds DatastoreTxnBatching) DatastoreTxnBatching {
|
|||
return &NoCloserDatastoreTxnBatching{ds}
|
||||
}
|
||||
|
||||
func NewTxnExtended(ds keytransform.TxnDatastoreExtended) keytransform.TxnDatastoreExtended {
|
||||
return &NoCloserDatastoreExtended{ds}
|
||||
}
|
||||
|
||||
func (ncd NoCloserDatastoreBatching) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -2,13 +2,10 @@ package util
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
textutil "github.com/anytypeio/go-anytype-middleware/util/text"
|
||||
"github.com/libp2p/go-libp2p/core/peer"
|
||||
"strings"
|
||||
"unicode"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/logging"
|
||||
"github.com/libp2p/go-libp2p/core/peer"
|
||||
ma "github.com/multiformats/go-multiaddr"
|
||||
"github.com/textileio/go-threads/core/thread"
|
||||
)
|
||||
|
@ -74,15 +71,6 @@ func MultiAddressHasReplicator(addrs []ma.Multiaddr, multiaddr ma.Multiaddr) boo
|
|||
return false
|
||||
}
|
||||
|
||||
func MultiAddressesContains(addrs []ma.Multiaddr, addr ma.Multiaddr) bool {
|
||||
for _, a := range addrs {
|
||||
if a.Equal(addr) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func MultiAddressesToStrings(addrs []ma.Multiaddr) []string {
|
||||
var s []string
|
||||
for _, addr := range addrs {
|
||||
|
@ -101,38 +89,6 @@ func ThreadIdsToStings(ids []thread.ID) []string {
|
|||
return s
|
||||
}
|
||||
|
||||
func TruncateText(text string, length int) string {
|
||||
var ellipsis = " …"
|
||||
if textutil.UTF16RuneCountString(text) <= length {
|
||||
return text
|
||||
}
|
||||
|
||||
var lastWordIndex, lastNonSpace, currentLen, endTextPos int
|
||||
for i, r := range text {
|
||||
currentLen++
|
||||
if unicode.IsSpace(r) {
|
||||
lastWordIndex = lastNonSpace
|
||||
} else if unicode.In(r, unicode.Han, unicode.Hangul, unicode.Hiragana, unicode.Katakana) {
|
||||
lastWordIndex = i
|
||||
} else {
|
||||
lastNonSpace = i + utf8.RuneLen(r)
|
||||
}
|
||||
|
||||
if currentLen > length {
|
||||
if lastWordIndex == 0 {
|
||||
endTextPos = i
|
||||
} else {
|
||||
endTextPos = lastWordIndex
|
||||
}
|
||||
out := text[0:endTextPos]
|
||||
|
||||
return out + ellipsis
|
||||
}
|
||||
}
|
||||
|
||||
return text
|
||||
}
|
||||
|
||||
// UniqueStrings returns the new slice without duplicates, while preserving the order.
|
||||
// The second and further occurrences are considered a duplicate
|
||||
func UniqueStrings(items []string) []string {
|
||||
|
|
|
@ -34,12 +34,6 @@ type VClock struct {
|
|||
|
||||
var Undef = VClock{}
|
||||
|
||||
// New returns a new vector clock
|
||||
// VClock is thread safe
|
||||
func New() VClock {
|
||||
return VClock{mutex: &sync.RWMutex{}, m: make(map[string]uint64)}
|
||||
}
|
||||
|
||||
func NewFromMap(m map[string]uint64) VClock {
|
||||
if m == nil {
|
||||
return Undef
|
||||
|
@ -51,8 +45,8 @@ func (vc VClock) IsNil() bool {
|
|||
return vc.m == nil
|
||||
}
|
||||
|
||||
//Merge takes the max of all clock values in other and updates the
|
||||
//values of the callee
|
||||
// Merge takes the max of all clock values in other and updates the
|
||||
// values of the callee
|
||||
func (vc VClock) Merge(other VClock) {
|
||||
if vc.IsNil() {
|
||||
// Undef is used only for indicating of non-set vclock
|
||||
|
@ -72,7 +66,7 @@ func (vc VClock) Merge(other VClock) {
|
|||
}
|
||||
}
|
||||
|
||||
//MarshalBinary returns an encoded vector clock
|
||||
// MarshalBinary returns an encoded vector clock
|
||||
func (vc VClock) MarshalBinary() ([]byte, error) {
|
||||
if vc.IsNil() {
|
||||
// vclock is Undef
|
||||
|
@ -90,16 +84,6 @@ func (vc VClock) MarshalBinary() ([]byte, error) {
|
|||
return b.Bytes(), nil
|
||||
}
|
||||
|
||||
//UnmarshalBinary decodes a vector clock
|
||||
func UnmarshalBinary(data []byte) (vc VClock, err error) {
|
||||
b := new(bytes.Buffer)
|
||||
b.Write(data)
|
||||
clock := New()
|
||||
dec := gob.NewDecoder(b)
|
||||
err = dec.Decode(&clock)
|
||||
return clock, err
|
||||
}
|
||||
|
||||
func (vc VClock) String() string {
|
||||
if vc.IsNil() {
|
||||
// vclock is Undef
|
||||
|
|
|
@ -21,24 +21,6 @@ type pubKey struct {
|
|||
crypto.PubKey
|
||||
}
|
||||
|
||||
func NewPubKey(t KeypairType, pk crypto.PubKey) (PubKey, error) {
|
||||
if t != KeypairTypeAccount && t != KeypairTypeDevice {
|
||||
return nil, fmt.Errorf("incorrect KeypairType")
|
||||
}
|
||||
|
||||
pubk := pubKey{
|
||||
keyType: t,
|
||||
PubKey: pk,
|
||||
}
|
||||
|
||||
_, err := getAddress(t, pk)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return pubk, nil
|
||||
}
|
||||
|
||||
func NewPubKeyFromAddress(t KeypairType, address string) (PubKey, error) {
|
||||
if t != KeypairTypeAccount && t != KeypairTypeDevice {
|
||||
return nil, fmt.Errorf("incorrect KeypairType")
|
||||
|
|
|
@ -6,8 +6,6 @@ import (
|
|||
"math/rand"
|
||||
"unicode"
|
||||
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/state"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/simple"
|
||||
"github.com/anytypeio/go-anytype-middleware/pb"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/bundle"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/pb/model"
|
||||
|
@ -15,17 +13,6 @@ import (
|
|||
"github.com/gogo/protobuf/types"
|
||||
)
|
||||
|
||||
func State(s *state.State) (res *state.State) {
|
||||
// blocks
|
||||
res = s.Copy()
|
||||
s.Iterate(func(b simple.Block) (isContinue bool) {
|
||||
b.Model().Content = Block(b.Model()).Content
|
||||
return true
|
||||
})
|
||||
s.SetDetails(Struct(s.Details()))
|
||||
return
|
||||
}
|
||||
|
||||
func Change(ch *pb.Change) (res *pb.Change) {
|
||||
resB, _ := ch.Marshal()
|
||||
res = &pb.Change{}
|
||||
|
|
|
@ -6,16 +6,6 @@ import (
|
|||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/pb/model"
|
||||
)
|
||||
|
||||
func AllBlocksToCode(blocks []*model.Block) (blocksOut []*model.Block) {
|
||||
for i, b := range blocks {
|
||||
if t := b.GetText(); t != nil {
|
||||
blocks[i].GetText().Style = model.BlockContentText_Code
|
||||
}
|
||||
}
|
||||
|
||||
return PreprocessBlocks(blocks)
|
||||
}
|
||||
|
||||
func PreprocessBlocks(blocks []*model.Block) (blocksOut []*model.Block) {
|
||||
|
||||
blocksOut = []*model.Block{}
|
||||
|
|
|
@ -21,7 +21,6 @@ import (
|
|||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/bundle"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/core/smartblock"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/localstore/addr"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/logging"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/pb/model"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/threads"
|
||||
"github.com/anytypeio/go-anytype-middleware/util/pbtypes"
|
||||
|
@ -32,8 +31,6 @@ const CName = "builtintemplate"
|
|||
//go:embed data/bundled_templates.zip
|
||||
var templatesZip []byte
|
||||
|
||||
var log = logging.Logger("anytype-mw-builtintemplate")
|
||||
|
||||
func New() BuiltinTemplate {
|
||||
return new(builtinTemplate)
|
||||
}
|
||||
|
|
|
@ -7,32 +7,11 @@ import (
|
|||
"github.com/logrusorgru/aurora"
|
||||
)
|
||||
|
||||
func Message(format string, args ...interface{}) {
|
||||
if len(format) > 0 {
|
||||
fmt.Println(aurora.Sprintf(aurora.BrightBlack("> "+format), args...))
|
||||
}
|
||||
}
|
||||
|
||||
func Success(format string, args ...interface{}) {
|
||||
fmt.Println(aurora.Sprintf(aurora.Green("> Success! %s"),
|
||||
aurora.Sprintf(aurora.BrightBlack(format), args...)))
|
||||
}
|
||||
|
||||
func Warn(format string, args ...interface{}) {
|
||||
fmt.Println(aurora.Sprintf(aurora.Magenta("> Warning! %s"),
|
||||
aurora.Sprintf(aurora.BrightBlack(format), args...)))
|
||||
}
|
||||
|
||||
func Error(format string, args ...interface{}) {
|
||||
fmt.Println(aurora.Sprintf(aurora.Yellow("> Error! %s"),
|
||||
aurora.Sprintf(aurora.BrightBlack(format), args...)))
|
||||
}
|
||||
|
||||
func End(format string, args ...interface{}) {
|
||||
Message(format, args...)
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
func Fatal(format string, args ...interface{}) {
|
||||
fmt.Println(aurora.Sprintf(aurora.Red("> Fatal! %s"),
|
||||
aurora.Sprintf(aurora.BrightBlack(format), args...)))
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
package util
|
||||
|
||||
const SubIdSeparator = ":"
|
|
@ -160,20 +160,6 @@ func RelationsDiff(rels1, rels2 []*model.Relation) (added []*model.Relation, upd
|
|||
return
|
||||
}
|
||||
|
||||
func RelationsEqual(rels1 []*model.Relation, rels2 []*model.Relation) (equal bool) {
|
||||
if len(rels1) != len(rels2) {
|
||||
return false
|
||||
}
|
||||
|
||||
for i := 0; i < len(rels2); i++ {
|
||||
if !RelationEqual(rels1[i], rels2[i]) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func RelationEqualOmitDictionary(rel1 *model.Relation, rel2 *model.Relation) (equal bool) {
|
||||
if rel1 == nil && rel2 != nil {
|
||||
return false
|
||||
|
@ -219,31 +205,6 @@ func RelationEqualOmitDictionary(rel1 *model.Relation, rel2 *model.Relation) (eq
|
|||
return true
|
||||
}
|
||||
|
||||
// RelationCompatible returns if provided relations are compatible in terms of underlying data format
|
||||
// e.g. it is ok if relation can have a different name and selectDict, while having the same key and format
|
||||
func RelationCompatible(rel1 *model.Relation, rel2 *model.Relation) (equal bool) {
|
||||
if rel1 == nil && rel2 != nil {
|
||||
return false
|
||||
}
|
||||
if rel2 == nil && rel1 != nil {
|
||||
return false
|
||||
}
|
||||
if rel2 == nil && rel1 == nil {
|
||||
return true
|
||||
}
|
||||
|
||||
if rel1.Key != rel2.Key {
|
||||
return false
|
||||
}
|
||||
if rel1.Format != rel2.Format {
|
||||
return false
|
||||
}
|
||||
|
||||
// todo: should we compare objectType here?
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func RelationEqual(rel1 *model.Relation, rel2 *model.Relation) (equal bool) {
|
||||
if !RelationEqualOmitDictionary(rel1, rel2) {
|
||||
return false
|
||||
|
@ -266,75 +227,6 @@ func RelationSelectDictEqual(dict1, dict2 []*model.RelationOption) bool {
|
|||
return true
|
||||
}
|
||||
|
||||
func RelationSelectDictDiff(dict1, dict2 []*model.RelationOption) (added []*model.RelationOption, updated []*model.RelationOption, removed []string) {
|
||||
for i := 0; i < len(dict2); i++ {
|
||||
if opt := GetOption(dict1, dict2[i].Id); opt == nil {
|
||||
added = append(added, dict2[i])
|
||||
continue
|
||||
} else {
|
||||
if !OptionEqual(opt, dict2[i]) {
|
||||
updated = append(updated, dict2[i])
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for i := 0; i < len(dict1); i++ {
|
||||
if r := GetOption(dict2, dict1[i].Id); r == nil {
|
||||
removed = append(removed, dict1[i].Id)
|
||||
continue
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func RelationSelectDictDiffOmitScope(dict1, dict2 []*model.RelationOption) (added []*model.RelationOption, updated []*model.RelationOption, removed []string) {
|
||||
for i := 0; i < len(dict2); i++ {
|
||||
if opt := GetOption(dict1, dict2[i].Id); opt == nil {
|
||||
added = append(added, dict2[i])
|
||||
continue
|
||||
} else {
|
||||
if !OptionEqualOmitScope(opt, dict2[i]) {
|
||||
updated = append(updated, dict2[i])
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for i := 0; i < len(dict1); i++ {
|
||||
if r := GetOption(dict2, dict1[i].Id); r == nil {
|
||||
removed = append(removed, dict1[i].Id)
|
||||
continue
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func OptionEqualOmitScope(opt1, opt2 *model.RelationOption) bool {
|
||||
if (opt1 == nil) && (opt2 != nil) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (opt1 != nil) && (opt2 == nil) {
|
||||
return false
|
||||
}
|
||||
|
||||
if opt1 == nil && opt2 == nil {
|
||||
return true
|
||||
}
|
||||
|
||||
if opt1.Id != opt2.Id {
|
||||
return false
|
||||
}
|
||||
if opt1.Text != opt2.Text {
|
||||
return false
|
||||
}
|
||||
if opt1.Color != opt2.Color {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func OptionEqual(opt1, opt2 *model.RelationOption) bool {
|
||||
if (opt1 == nil) && (opt2 != nil) {
|
||||
return false
|
||||
|
@ -496,18 +388,3 @@ func SortedRange(s *types.Struct, f func(k string, v *types.Value)) {
|
|||
f(k, s.Fields[k])
|
||||
}
|
||||
}
|
||||
|
||||
func RelationOptionsFilter(options []*model.RelationOption, f func(option *model.RelationOption) bool) []*model.RelationOption {
|
||||
if len(options) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
res := make([]*model.RelationOption, 0, len(options))
|
||||
for i := range options {
|
||||
if f(options[i]) {
|
||||
res = append(res, options[i])
|
||||
}
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
|
|
|
@ -29,23 +29,6 @@ func CopyBlock(in *model.Block) (out *model.Block) {
|
|||
return
|
||||
}
|
||||
|
||||
// CopyStructMap copies pb struct map, while reusing map values' pointers
|
||||
func CopyStructMap(in *types.Struct) (out *types.Struct) {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
if in.Fields == nil {
|
||||
return &types.Struct{}
|
||||
}
|
||||
|
||||
out = &types.Struct{Fields: make(map[string]*types.Value, len(in.Fields))}
|
||||
for k, v := range in.Fields {
|
||||
out.Fields[k] = v
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func CopyStruct(in *types.Struct) (out *types.Struct) {
|
||||
if in == nil {
|
||||
return nil
|
||||
|
@ -82,13 +65,6 @@ func CopyVal(in *types.Value) (out *types.Value) {
|
|||
return
|
||||
}
|
||||
|
||||
func CopyRelationLink(in *model.RelationLink) (out *model.RelationLink) {
|
||||
return &model.RelationLink{
|
||||
Key: in.Key,
|
||||
Format: in.Format,
|
||||
}
|
||||
}
|
||||
|
||||
func CopyRelation(in *model.Relation) (out *model.Relation) {
|
||||
if in == nil {
|
||||
return nil
|
||||
|
@ -154,28 +130,6 @@ func CopyRelations(in []*model.Relation) (out []*model.Relation) {
|
|||
return outWrapped.Relations
|
||||
}
|
||||
|
||||
func CopyOptions(in []*model.RelationOption) (out []*model.RelationOption) {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
for _, inO := range in {
|
||||
inCopy := *inO
|
||||
out = append(out, &inCopy)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func CopyRelationsToMap(in []*model.Relation) (out map[string]*model.Relation) {
|
||||
out = make(map[string]*model.Relation, len(in))
|
||||
rels := CopyRelations(in)
|
||||
for _, rel := range rels {
|
||||
out[rel.Key] = rel
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func CopyFilter(in *model.BlockContentDataviewFilter) (out *model.BlockContentDataviewFilter) {
|
||||
buf := bytesPool.Get().([]byte)
|
||||
size := in.Size()
|
||||
|
@ -189,28 +143,6 @@ func CopyFilter(in *model.BlockContentDataviewFilter) (out *model.BlockContentDa
|
|||
return
|
||||
}
|
||||
|
||||
func RelationsFilterKeys(in []*model.Relation, keys []string) (out []*model.Relation) {
|
||||
for i, inRel := range in {
|
||||
if slice.FindPos(keys, inRel.Key) >= 0 {
|
||||
out = append(out, in[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func StructNotNilKeys(st *types.Struct) (keys []string) {
|
||||
if st == nil || st.Fields == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
for k, v := range st.Fields {
|
||||
if v != nil {
|
||||
keys = append(keys, k)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func EventsToSliceChange(changes []*pb.EventBlockDataviewSliceChange) []slice.Change {
|
||||
sliceOpMap := map[pb.EventBlockDataviewSliceOperation]slice.DiffOperation{
|
||||
pb.EventBlockDataview_SliceOperationNone: slice.OperationNone,
|
||||
|
|
|
@ -238,39 +238,6 @@ func HasRelationLink(rels []*model.RelationLink, key string) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
func MergeRelations(rels1 []*model.Relation, rels2 []*model.Relation) []*model.Relation {
|
||||
if rels1 == nil {
|
||||
return rels2
|
||||
}
|
||||
if rels2 == nil {
|
||||
return rels1
|
||||
}
|
||||
|
||||
rels := make([]*model.Relation, 0, len(rels2)+len(rels1))
|
||||
for _, rel := range rels2 {
|
||||
rels = append(rels, rel)
|
||||
}
|
||||
|
||||
for _, rel := range rels1 {
|
||||
if HasRelation(rels, rel.Key) {
|
||||
continue
|
||||
}
|
||||
rels = append(rels, rel)
|
||||
}
|
||||
|
||||
return rels
|
||||
}
|
||||
|
||||
func GetObjectType(ots []*model.ObjectType, url string) *model.ObjectType {
|
||||
for i, ot := range ots {
|
||||
if ot.Url == url {
|
||||
return ots[i]
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func GetRelation(rels []*model.Relation, key string) *model.Relation {
|
||||
for i, rel := range rels {
|
||||
if rel.Key == key {
|
||||
|
@ -281,26 +248,6 @@ func GetRelation(rels []*model.Relation, key string) *model.Relation {
|
|||
return nil
|
||||
}
|
||||
|
||||
func GetOption(opts []*model.RelationOption, id string) *model.RelationOption {
|
||||
for i, opt := range opts {
|
||||
if opt.Id == id {
|
||||
return opts[i]
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func HasOption(opts []*model.RelationOption, id string) bool {
|
||||
for _, opt := range opts {
|
||||
if opt.Id == id {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func Get(st *types.Struct, keys ...string) *types.Value {
|
||||
for i, key := range keys {
|
||||
if st == nil || st.Fields == nil {
|
||||
|
@ -315,15 +262,6 @@ func Get(st *types.Struct, keys ...string) *types.Value {
|
|||
return nil
|
||||
}
|
||||
|
||||
func GetRelationKeys(rels []*model.Relation) []string {
|
||||
var keys []string
|
||||
for _, rel := range rels {
|
||||
keys = append(keys, rel.Key)
|
||||
}
|
||||
|
||||
return keys
|
||||
}
|
||||
|
||||
func GetRelationListKeys(rels []*model.RelationLink) []string {
|
||||
var keys []string
|
||||
for _, rel := range rels {
|
||||
|
@ -333,60 +271,6 @@ func GetRelationListKeys(rels []*model.RelationLink) []string {
|
|||
return keys
|
||||
}
|
||||
|
||||
func GetOptionIds(opts []*model.RelationOption) []string {
|
||||
var keys []string
|
||||
for _, opt := range opts {
|
||||
keys = append(keys, opt.Id)
|
||||
}
|
||||
|
||||
return keys
|
||||
}
|
||||
|
||||
func MergeRelationsDicts(rels1 []*model.Relation, rels2 []*model.Relation) []*model.Relation {
|
||||
rels := CopyRelations(rels1)
|
||||
for _, rel2 := range rels2 {
|
||||
var found bool
|
||||
|
||||
for i, rel := range rels {
|
||||
if rel.Key == rel2.Key {
|
||||
rel2Copy := CopyRelation(rel2)
|
||||
rels[i].SelectDict = rel2Copy.SelectDict
|
||||
rels[i].Name = rel2Copy.Name
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if !found {
|
||||
rels = append(rels, CopyRelation(rel2))
|
||||
}
|
||||
}
|
||||
return rels
|
||||
}
|
||||
|
||||
// MergeOptionsPreserveScope adds and updates options from opts2 into opts1 based on the ID
|
||||
// in case opts2 doesn't have id that opts1 have it doesn't remove the existing one
|
||||
// in case opts2 has the key that opts1 already have it updates everything except scope
|
||||
func MergeOptionsPreserveScope(opts1 []*model.RelationOption, opts2 []*model.RelationOption) []*model.RelationOption {
|
||||
opts := CopyOptions(opts1)
|
||||
for _, opt2 := range opts2 {
|
||||
var found bool
|
||||
for i, opt := range opts {
|
||||
if opt.Id == opt2.Id {
|
||||
opts[i].Text = opt2.Text
|
||||
opts[i].Color = opt2.Color
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
opt2Copy := *opt2
|
||||
opts = append(opts, &opt2Copy)
|
||||
}
|
||||
}
|
||||
return opts
|
||||
}
|
||||
|
||||
// StructToMap converts a types.Struct to a map from strings to Go types.
|
||||
// StructToMap panics if s is invalid.
|
||||
func StructToMap(s *types.Struct) map[string]interface{} {
|
||||
|
@ -400,59 +284,6 @@ func StructToMap(s *types.Struct) map[string]interface{} {
|
|||
return m
|
||||
}
|
||||
|
||||
func StructIsEmpty(s *types.Struct) bool {
|
||||
return s == nil || len(s.Fields) == 0
|
||||
}
|
||||
|
||||
func GetMapOfKeysAndValuesFromStruct(collection *types.Struct) map[string]*types.Value {
|
||||
keyMap := map[string]*types.Value{}
|
||||
if collection == nil {
|
||||
return keyMap
|
||||
}
|
||||
keyStack := []string{""}
|
||||
collStack := []*types.Struct{collection}
|
||||
|
||||
for len(collStack) != 0 {
|
||||
coll := collStack[len(collStack)-1]
|
||||
lastKey := keyStack[len(keyStack)-1]
|
||||
keyStack = keyStack[:len(keyStack)-1]
|
||||
collStack = collStack[:len(collStack)-1]
|
||||
for k, v := range coll.Fields {
|
||||
subColl, ok := v.Kind.(*types.Value_StructValue)
|
||||
updatedKey := lastKey
|
||||
if updatedKey != "" {
|
||||
updatedKey += "/"
|
||||
}
|
||||
updatedKey += k
|
||||
if !ok {
|
||||
keyMap[updatedKey] = v
|
||||
continue
|
||||
}
|
||||
collStack = append(collStack, subColl.StructValue)
|
||||
keyStack = append(keyStack, updatedKey)
|
||||
}
|
||||
}
|
||||
return keyMap
|
||||
}
|
||||
|
||||
func CompareKeyMaps(before map[string]*types.Value, after map[string]*types.Value) (keysSet []string, keysRemoved []string) {
|
||||
for k, afterValue := range after {
|
||||
beforeValue, exists := before[k]
|
||||
if exists && afterValue.Equal(beforeValue) {
|
||||
continue
|
||||
}
|
||||
keysSet = append(keysSet, k)
|
||||
}
|
||||
|
||||
for k := range before {
|
||||
if _, exists := after[k]; exists {
|
||||
continue
|
||||
}
|
||||
keysRemoved = append(keysRemoved, k)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func ValueToInterface(v *types.Value) interface{} {
|
||||
switch k := v.Kind.(type) {
|
||||
case *types.Value_NullValue:
|
||||
|
@ -476,18 +307,6 @@ func ValueToInterface(v *types.Value) interface{} {
|
|||
}
|
||||
}
|
||||
|
||||
func RelationFormatCanHaveListValue(format model.RelationFormat) bool {
|
||||
switch format {
|
||||
case model.RelationFormat_tag,
|
||||
model.RelationFormat_file,
|
||||
model.RelationFormat_object,
|
||||
model.RelationFormat_number:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
func RelationIdToKey(id string) (string, error) {
|
||||
if strings.HasPrefix(id, addr.RelationKeyToIdPrefix) {
|
||||
return strings.TrimPrefix(id, addr.RelationKeyToIdPrefix), nil
|
||||
|
@ -501,16 +320,6 @@ func RelationIdToKey(id string) (string, error) {
|
|||
return "", fmt.Errorf("incorrect id format")
|
||||
}
|
||||
|
||||
func Delete(st *types.Struct, key string) (ok bool) {
|
||||
if st != nil && st.Fields != nil {
|
||||
if _, ok := st.Fields[key]; ok {
|
||||
delete(st.Fields, key)
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type Getter interface {
|
||||
Get(key string) *types.Value
|
||||
}
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
package text
|
||||
|
||||
import (
|
||||
"crypto/md5"
|
||||
"fmt"
|
||||
"strings"
|
||||
"unicode"
|
||||
"unicode/utf16"
|
||||
)
|
||||
|
@ -54,9 +51,3 @@ func StrToUTF16(str string) []uint16 {
|
|||
func UTF16ToStr(b []uint16) string {
|
||||
return string(utf16.Decode(b))
|
||||
}
|
||||
|
||||
func SliceHash(keys []string) string {
|
||||
s := strings.Join(keys, "_")
|
||||
sum := md5.Sum([]byte(s))
|
||||
return fmt.Sprintf("%x", sum)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue