mirror of
https://github.com/anyproto/anytype-heart.git
synced 2025-06-10 18:10:49 +09:00
GO-4140 integration with publishing-server, init
This commit is contained in:
parent
1d3fd66fd9
commit
c3655889f1
3 changed files with 53 additions and 3 deletions
|
@ -7,7 +7,7 @@ import (
|
|||
"github.com/anyproto/anytype-heart/pb"
|
||||
)
|
||||
|
||||
func (mw *Middleware) ObjectPublish(ctx context.Context, req *pb.RpcObjectPublishRequest) *pb.RpcObjectPublishResponse {
|
||||
func (mw *Middleware) PublishObject(ctx context.Context, req *pb.RpcObjectPublishRequest) *pb.RpcObjectPublishResponse {
|
||||
publishService := getService[publish.Service](mw)
|
||||
|
||||
res, err := publishService.Publish(ctx, req.SpaceId, req.ObjectId)
|
||||
|
@ -26,3 +26,19 @@ func (mw *Middleware) ObjectPublish(ctx context.Context, req *pb.RpcObjectPublis
|
|||
|
||||
return r
|
||||
}
|
||||
|
||||
func (mw *Middleware) UnpublishObject(ctx context.Context, req *pb.RpcObjectPublishRequest) *pb.RpcObjectPublishResponse {
|
||||
return r
|
||||
}
|
||||
|
||||
func (mw *Middleware) ListPublishings(ctx context.Context, req *pb.RpcObjectPublishRequest) *pb.RpcObjectPublishResponse {
|
||||
return r
|
||||
}
|
||||
|
||||
func (mw *Middleware) ResolvePublishUri(ctx context.Context, req *pb.RpcObjectPublishRequest) *pb.RpcObjectPublishResponse {
|
||||
return r
|
||||
}
|
||||
|
||||
func (mw *Middleware) GetPublishStatus(ctx context.Context, req *pb.RpcObjectPublishRequest) *pb.RpcObjectPublishResponse {
|
||||
return r
|
||||
}
|
||||
|
|
|
@ -1359,12 +1359,37 @@ message Rpc {
|
|||
}
|
||||
|
||||
}
|
||||
message Publishing {
|
||||
message Create {
|
||||
message Request {
|
||||
string spaceId = 1;
|
||||
string objectId = 2;
|
||||
string uri = 3
|
||||
}
|
||||
message Response {
|
||||
Error error = 1;
|
||||
|
||||
message Error {
|
||||
Code code = 1;
|
||||
string description = 2;
|
||||
enum Code {
|
||||
NULL = 0;
|
||||
UNKNOWN_ERROR = 1;
|
||||
BAD_INPUT = 2;
|
||||
NO_SUCH_OBJECT = 101;
|
||||
NO_SUCH_SPACE = 102;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
message Object {
|
||||
message Publish {
|
||||
message Request {
|
||||
string spaceId = 1;
|
||||
string objectId = 2;
|
||||
string uri = 3
|
||||
}
|
||||
message Response {
|
||||
Error error = 1;
|
||||
|
|
|
@ -66,12 +66,21 @@ service ClientCommands {
|
|||
rpc SpaceSetOrder (anytype.Rpc.Space.SetOrder.Request) returns (anytype.Rpc.Space.SetOrder.Response);
|
||||
rpc SpaceUnsetOrder (anytype.Rpc.Space.UnsetOrder.Request) returns (anytype.Rpc.Space.UnsetOrder.Response);
|
||||
|
||||
// Publish
|
||||
// ***
|
||||
// How client keeps track of publishings locally?
|
||||
rpc PublishObject (anytype.Rpc.Publish.Create.Request) returns (anytype.Rpc.Publish.Create.Response)
|
||||
rpc UnpublishObject (anytype.Rpc.Publish.Remove.Request) returns (anytype.Rpc.Publish.Remove.Response)
|
||||
rpc ListPublishing (anytype.Rpc.Publish.List.Request) returns (anytype.Rpc.Publish.List.Response)
|
||||
rpc ResolvePublishUri (anytype.Rpc.Publish.Resolve.Request) returns (anytype.Rpc.Publish.Resolve.Response)
|
||||
rpc GetPublishingStatus (anytype.Rpc.Publish.Status.Request) returns (anytype.Rpc.Publish.Status.Response)
|
||||
|
||||
// Object
|
||||
// ***
|
||||
rpc ObjectOpen (anytype.Rpc.Object.Open.Request) returns (anytype.Rpc.Object.Open.Response);
|
||||
rpc ObjectClose (anytype.Rpc.Object.Close.Request) returns (anytype.Rpc.Object.Close.Response);
|
||||
rpc ObjectShow (anytype.Rpc.Object.Show.Request) returns (anytype.Rpc.Object.Show.Response);
|
||||
rpc ObjectPublish (anytype.Rpc.Object.Publish.Request) returns (anytype.Rpc.Object.Publish.Response);
|
||||
|
||||
|
||||
// ObjectCreate just creates the new page, without adding the link to it from some other page
|
||||
rpc ObjectCreate (anytype.Rpc.Object.Create.Request) returns (anytype.Rpc.Object.Create.Response);
|
||||
|
@ -363,7 +372,7 @@ service ClientCommands {
|
|||
rpc NameServiceResolveName( anytype.Rpc.NameService.ResolveName.Request) returns (anytype.Rpc.NameService.ResolveName.Response);
|
||||
// 12D3KooWA8EXV3KjBxEU5EnsPfneLx84vMWAtTBQBeyooN82KSuS -> hello.any
|
||||
rpc NameServiceResolveAnyId( anytype.Rpc.NameService.ResolveAnyId.Request ) returns (anytype.Rpc.NameService.ResolveAnyId.Response);
|
||||
|
||||
|
||||
rpc BroadcastPayloadEvent (anytype.Rpc.Broadcast.PayloadEvent.Request) returns (anytype.Rpc.Broadcast.PayloadEvent.Response);
|
||||
|
||||
rpc DeviceSetName (anytype.Rpc.Device.SetName.Request) returns (anytype.Rpc.Device.SetName.Response);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue