diff --git a/core/block/editor/smartblock/smartblock.go b/core/block/editor/smartblock/smartblock.go index 3947b701e..c07354490 100644 --- a/core/block/editor/smartblock/smartblock.go +++ b/core/block/editor/smartblock/smartblock.go @@ -193,7 +193,6 @@ type smartBlock struct { sendEvent func(e *pb.Event) undo undo.History source source.Source - metaData *core.SmartBlockMeta lastDepDetails map[string]*pb.EventObjectDetailsSet restrictionsUpdater func() restrictions restriction.Restrictions diff --git a/core/file.go b/core/file.go index d6f56cbb9..a8b8767b8 100644 --- a/core/file.go +++ b/core/file.go @@ -9,7 +9,6 @@ import ( "github.com/anytypeio/go-anytype-middleware/core/block" "github.com/anytypeio/go-anytype-middleware/core/files" "github.com/anytypeio/go-anytype-middleware/pb" - "github.com/anytypeio/go-anytype-middleware/pkg/lib/core" ) func (mw *Middleware) FileDownload(cctx context.Context, req *pb.RpcFileDownloadRequest) *pb.RpcFileDownloadResponse { @@ -69,11 +68,6 @@ func (mw *Middleware) FileListOffload(cctx context.Context, req *pb.RpcFileListO return response(0, 0, pb.RpcFileListOffloadResponseError_NODE_NOT_STARTED, fmt.Errorf("anytype is nil")) } - at := mw.app.MustComponent(core.CName).(core.Service) - if !at.IsStarted() { - return response(0, 0, pb.RpcFileListOffloadResponseError_NODE_NOT_STARTED, fmt.Errorf("anytype node not started")) - } - fileService := app.MustComponent[*files.Service](mw.app) totalFilesOffloaded, totalBytesOffloaded, err := fileService.FileListOffload(req.OnlyIds, req.IncludeNotPinned) if err != nil { diff --git a/pkg/lib/core/files.go b/pkg/lib/core/files.go deleted file mode 100644 index 25dcb7672..000000000 --- a/pkg/lib/core/files.go +++ /dev/null @@ -1,2 +0,0 @@ -package core - diff --git a/pkg/lib/core/images.go b/pkg/lib/core/images.go deleted file mode 100644 index 25dcb7672..000000000 --- a/pkg/lib/core/images.go +++ /dev/null @@ -1,2 +0,0 @@ -package core - diff --git a/pkg/lib/core/payload.go b/pkg/lib/core/payload.go deleted file mode 100644 index bbf9e82f9..000000000 --- a/pkg/lib/core/payload.go +++ /dev/null @@ -1,61 +0,0 @@ -package core - -import ( - "github.com/gogo/protobuf/proto" - cbornode "github.com/ipfs/go-ipld-cbor" -) - -// increasing this version allows old clients that trying to read the newer version of payload to force user to upgrade -const payloadVersion = 1 - -type SmartblockLog struct { - ID string - Head string - HeadCounter int64 -} - -type SmartblockRecordEnvelope struct { - SmartblockRecord - AccountID string - LogID string -} - -type SmartblockRecordWithThreadID struct { - SmartblockRecordEnvelope - ThreadID string -} - -type ThreadRecordInfo struct { - LogId string - ThreadID string -} - -type SmartblockRecord struct { - ID string - PrevID string - Payload []byte -} - -type SignedPbPayload struct { - DeviceSig []byte // deprecated - AccSig []byte - AccAddr string - Data []byte - Ver uint16 -} - -func init() { - cbornode.RegisterCborType(SignedPbPayload{}) -} - -func (p *SignedPbPayload) Unmarshal(out proto.Message) error { - return proto.Unmarshal(p.Data, out) -} - -func (p *SmartblockRecord) Unmarshal(out proto.Message) error { - return proto.Unmarshal(p.Payload, out) -} - -func (p *SignedPbPayload) Verify() error { - return nil -} diff --git a/pkg/lib/core/smartblock.go b/pkg/lib/core/smartblock.go deleted file mode 100644 index dbc684851..000000000 --- a/pkg/lib/core/smartblock.go +++ /dev/null @@ -1,49 +0,0 @@ -package core - -import ( - "context" - - "github.com/gogo/protobuf/proto" - "github.com/gogo/protobuf/types" - cbornode "github.com/ipfs/go-ipld-cbor" - - "github.com/anytypeio/go-anytype-middleware/pkg/lib/core/smartblock" - "github.com/anytypeio/go-anytype-middleware/pkg/lib/pb/model" -) - -const ( - snippetMinSize = 50 - snippetMaxSize = 300 -) - -type ProfileThreadEncryptionKeys struct { - ServiceKey []byte - ReadKey []byte -} - -func init() { - cbornode.RegisterCborType(ProfileThreadEncryptionKeys{}) -} - -type SmartBlockMeta struct { - ObjectTypes []string - RelationLinks []*model.RelationLink - Details *types.Struct -} - -type SmartBlock interface { - ID() string - Type() smartblock.SmartBlockType - Creator() (string, error) - - GetLogs() ([]SmartblockLog, error) - GetRecord(ctx context.Context, recordID string) (*SmartblockRecordEnvelope, error) - PushRecord(payload proto.Marshaler) (id string, err error) - - SubscribeForRecords(ch chan SmartblockRecordEnvelope) (cancel func(), err error) - // SubscribeClientEvents provide a way to subscribe for the client-side events e.g. carriage position change - SubscribeClientEvents(event chan<- proto.Message) (cancelFunc func(), err error) - // PublishClientEvent gives a way to push the new client-side event e.g. carriage position change - // notice that you will also get this event in SubscribeForEvents - PublishClientEvent(event proto.Message) error -}