mirror of
https://github.com/anyproto/anytype-heart.git
synced 2025-06-10 01:51:07 +09:00
4790 lines
135 KiB
Protocol Buffer
4790 lines
135 KiB
Protocol Buffer
syntax = "proto3";
|
||
package anytype;
|
||
option go_package = "pb";
|
||
|
||
import "pkg/lib/pb/model/protos/models.proto";
|
||
import "pkg/lib/pb/model/protos/localstore.proto";
|
||
|
||
import "pb/protos/events.proto";
|
||
import "google/protobuf/struct.proto";
|
||
|
||
|
||
import "google/protobuf/descriptor.proto";
|
||
|
||
// To disable authorization in specific method use no_auth option inside Request of that method
|
||
extend google.protobuf.MessageOptions {
|
||
bool no_auth = 7777;
|
||
}
|
||
|
||
/*
|
||
* Rpc is a namespace, that agregates all of the service commands between client and middleware.
|
||
* Structure: Topic > Subtopic > Subsub... > Action > (Request, Response).
|
||
* Request – message from a client.
|
||
* Response – message from a middleware.
|
||
*/
|
||
message Rpc {
|
||
message App {
|
||
message GetVersion {
|
||
message Request {
|
||
}
|
||
message Response {
|
||
Error error = 1;
|
||
string version = 2;
|
||
string details = 3; // build date, branch and commit
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
VERSION_IS_EMPTY = 3;
|
||
|
||
NOT_FOUND = 101;
|
||
TIMEOUT = 102;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message SetDeviceState {
|
||
message Request {
|
||
DeviceState deviceState = 1;
|
||
|
||
enum DeviceState {
|
||
BACKGROUND = 0;
|
||
FOREGROUND = 1;
|
||
}
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
|
||
NODE_NOT_STARTED = 101;
|
||
}
|
||
}
|
||
|
||
}
|
||
}
|
||
|
||
|
||
message Shutdown {
|
||
message Request {
|
||
}
|
||
message Response {
|
||
Error error = 1;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
|
||
NODE_NOT_STARTED = 101;
|
||
}
|
||
}
|
||
|
||
}
|
||
}
|
||
}
|
||
|
||
message Wallet {
|
||
message Create {
|
||
/**
|
||
* Front-end-to-middleware request to create a new wallet
|
||
*/
|
||
message Request {
|
||
option (no_auth) = true;
|
||
string rootPath = 1; // Path to a wallet directory
|
||
}
|
||
|
||
/**
|
||
* Middleware-to-front-end response, that can contain mnemonic of a created account and a NULL error or an empty mnemonic and a non-NULL error
|
||
*/
|
||
message Response {
|
||
Error error = 1;
|
||
string mnemonic = 2; // Mnemonic of a new account (sequence of words, divided by spaces)
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0; // No error; mnemonic should be non-empty
|
||
UNKNOWN_ERROR = 1; // Any other errors
|
||
BAD_INPUT = 2; // Root path is wrong
|
||
|
||
FAILED_TO_CREATE_LOCAL_REPO = 101;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Recover {
|
||
/**
|
||
* Front end to middleware request-to-recover-a wallet with this mnemonic and a rootPath
|
||
*/
|
||
message Request {
|
||
option (no_auth) = true;
|
||
|
||
string rootPath = 1; // Path to a wallet directory
|
||
string mnemonic = 2; // Mnemonic of a wallet to recover
|
||
}
|
||
|
||
/**
|
||
* Middleware-to-front-end response, that can contain a NULL error or a non-NULL error
|
||
*/
|
||
message Response {
|
||
Error error = 1; // Error while trying to recover a wallet
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0; // No error; wallet successfully recovered
|
||
UNKNOWN_ERROR = 1; // Any other errors
|
||
BAD_INPUT = 2; // Root path or mnemonic is wrong
|
||
|
||
FAILED_TO_CREATE_LOCAL_REPO = 101;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Convert {
|
||
message Request {
|
||
string mnemonic = 1; // Mnemonic of a wallet to convert
|
||
string entropy = 2; // entropy of a wallet to convert
|
||
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1; // Error while trying to recover a wallet
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0; // No error; wallet successfully recovered
|
||
UNKNOWN_ERROR = 1; // Any other errors
|
||
BAD_INPUT = 2; // mnemonic is wrong
|
||
}
|
||
}
|
||
|
||
string entropy = 2;
|
||
string mnemonic = 3;
|
||
}
|
||
}
|
||
|
||
message CreateSession {
|
||
message Request {
|
||
option (no_auth) = true;
|
||
string mnemonic = 1;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
string token = 2;
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message CloseSession {
|
||
message Request {
|
||
string token = 1;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
|
||
}
|
||
|
||
message Account {
|
||
message Config {
|
||
bool enableDataview = 1;
|
||
bool enableDebug = 2;
|
||
bool enablePrereleaseChannel = 3;
|
||
bool enableSpaces = 4;
|
||
|
||
google.protobuf.Struct extra = 100;
|
||
}
|
||
|
||
message Create {
|
||
/**
|
||
* Front end to middleware request-to-create-an account
|
||
*/
|
||
message Request {
|
||
option (no_auth) = true;
|
||
|
||
string name = 1; // Account name
|
||
oneof avatar {
|
||
string avatarLocalPath = 2; // Path to an image, that will be used as an avatar of this account
|
||
}
|
||
string storePath = 3; // Path to local storage
|
||
|
||
|
||
string alphaInviteCode = 20;
|
||
}
|
||
|
||
/**
|
||
* Middleware-to-front-end response for an account creation request, that can contain a NULL error and created account or a non-NULL error and an empty account
|
||
*/
|
||
message Response {
|
||
Error error = 1; // Error while trying to create an account
|
||
anytype.model.Account account = 2; // A newly created account; In case of a failure, i.e. error is non-NULL, the account model should contain empty/default-value fields
|
||
Config config = 3; // deprecated, use account
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0; // No error; Account should be non-empty
|
||
UNKNOWN_ERROR = 1; // Any other errors
|
||
BAD_INPUT = 2; // Avatar or name is not correct
|
||
|
||
ACCOUNT_CREATED_BUT_FAILED_TO_START_NODE = 101;
|
||
ACCOUNT_CREATED_BUT_FAILED_TO_SET_NAME = 102;
|
||
ACCOUNT_CREATED_BUT_FAILED_TO_SET_AVATAR = 103;
|
||
FAILED_TO_STOP_RUNNING_NODE = 104;
|
||
FAILED_TO_WRITE_CONFIG = 105;
|
||
FAILED_TO_CREATE_LOCAL_REPO = 106;
|
||
|
||
BAD_INVITE_CODE = 900;
|
||
|
||
NET_ERROR = 901; // means general network error
|
||
NET_CONNECTION_REFUSED = 902; // means we wasn't able to connect to the cafe server
|
||
NET_OFFLINE = 903; // client can additionally support this error code to notify user that device is offline
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Recover {
|
||
/**
|
||
* Front end to middleware request-to-start-search of an accounts for a recovered mnemonic.
|
||
* Each of an account that would be found will come with an AccountAdd event
|
||
*/
|
||
message Request {
|
||
}
|
||
|
||
/**
|
||
* Middleware-to-front-end response to an account recover request, that can contain a NULL error and created account or a non-NULL error and an empty account
|
||
*/
|
||
message Response {
|
||
Error error = 1; // Error while trying to recover an account
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0; // No error;
|
||
UNKNOWN_ERROR = 1; // Any other errors
|
||
BAD_INPUT = 2;
|
||
|
||
NO_ACCOUNTS_FOUND = 101;
|
||
NEED_TO_RECOVER_WALLET_FIRST = 102;
|
||
FAILED_TO_CREATE_LOCAL_REPO = 103;
|
||
LOCAL_REPO_EXISTS_BUT_CORRUPTED = 104;
|
||
FAILED_TO_RUN_NODE = 105;
|
||
WALLET_RECOVER_NOT_PERFORMED = 106;
|
||
FAILED_TO_STOP_RUNNING_NODE = 107;
|
||
ANOTHER_ANYTYPE_PROCESS_IS_RUNNING = 108;
|
||
ACCOUNT_IS_DELETED = 109;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Delete {
|
||
message Request {
|
||
bool revert = 1;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1; // Error while trying to recover an account
|
||
anytype.model.Account.Status status = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0; // No error;
|
||
UNKNOWN_ERROR = 1; // Any other errors
|
||
BAD_INPUT = 2;
|
||
|
||
ACCOUNT_IS_ALREADY_DELETED = 101;
|
||
ACCOUNT_IS_ACTIVE = 102;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Select {
|
||
/**
|
||
* Front end to middleware request-to-launch-a specific account using account id and a root path
|
||
* User can select an account from those, that came with an AccountAdd events
|
||
*/
|
||
message Request {
|
||
option (no_auth) = true;
|
||
string id = 1; // Id of a selected account
|
||
string rootPath = 2; // Root path is optional, set if this is a first request
|
||
}
|
||
|
||
/**
|
||
* Middleware-to-front-end response for an account select request, that can contain a NULL error and selected account or a non-NULL error and an empty account
|
||
*/
|
||
message Response {
|
||
Error error = 1; // Error while trying to launch/select an account
|
||
anytype.model.Account account = 2; // Selected account
|
||
Config config = 3; // deprecated, use account
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0; // No error
|
||
UNKNOWN_ERROR = 1; // Any other errors
|
||
BAD_INPUT = 2; // Id or root path is wrong
|
||
|
||
FAILED_TO_CREATE_LOCAL_REPO = 101;
|
||
LOCAL_REPO_EXISTS_BUT_CORRUPTED = 102;
|
||
FAILED_TO_RUN_NODE = 103;
|
||
FAILED_TO_FIND_ACCOUNT_INFO = 104;
|
||
LOCAL_REPO_NOT_EXISTS_AND_MNEMONIC_NOT_SET = 105;
|
||
FAILED_TO_STOP_SEARCHER_NODE = 106;
|
||
FAILED_TO_RECOVER_PREDEFINED_BLOCKS = 107;
|
||
ANOTHER_ANYTYPE_PROCESS_IS_RUNNING = 108;
|
||
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Stop {
|
||
/**
|
||
* Front end to middleware request to stop currently running account node and optionally remove the locally stored data
|
||
*/
|
||
message Request {
|
||
bool removeData = 1;
|
||
}
|
||
|
||
/**
|
||
* Middleware-to-front-end response for an account stop request
|
||
*/
|
||
message Response {
|
||
Error error = 1; // Error while trying to launch/select an account
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0; // No error
|
||
UNKNOWN_ERROR = 1; // Any other errors
|
||
BAD_INPUT = 2; // Id or root path is wrong
|
||
|
||
ACCOUNT_IS_NOT_RUNNING = 101;
|
||
FAILED_TO_STOP_NODE = 102;
|
||
FAILED_TO_REMOVE_ACCOUNT_DATA = 103;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Move {
|
||
/**
|
||
* Front-end-to-middleware request to move a account to a new disk location
|
||
*/
|
||
message Request {
|
||
string newPath = 1;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
|
||
FAILED_TO_STOP_NODE = 101;
|
||
FAILED_TO_IDENTIFY_ACCOUNT_DIR = 102;
|
||
FAILED_TO_REMOVE_ACCOUNT_DATA = 103;
|
||
FAILED_TO_CREATE_LOCAL_REPO = 104;
|
||
FAILED_TO_WRITE_CONFIG = 105;
|
||
FAILED_TO_GET_CONFIG = 106;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message ConfigUpdate {
|
||
message Request {
|
||
string timeZone = 1;
|
||
string IPFSStorageAddr = 2;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
|
||
ACCOUNT_IS_NOT_RUNNING = 101;
|
||
FAILED_TO_WRITE_CONFIG = 102;
|
||
FAILED_TO_GET_CONFIG = 103;
|
||
}
|
||
}
|
||
}
|
||
|
||
enum Timezones {
|
||
GMT = 0;
|
||
ECT = 1;
|
||
EET = 2;
|
||
EAT = 3;
|
||
MET = 4;
|
||
NET = 5;
|
||
PLT = 6;
|
||
IST = 7;
|
||
BST = 8;
|
||
VST = 9;
|
||
CTT = 10;
|
||
JST = 11;
|
||
ACT = 12;
|
||
AET = 13;
|
||
SST = 14;
|
||
NST = 15;
|
||
MIT = 16;
|
||
HST = 17;
|
||
AST = 18;
|
||
PST = 19;
|
||
MST = 20;
|
||
CST = 21;
|
||
IET = 22;
|
||
PRT = 23;
|
||
CNT = 24;
|
||
BET = 25;
|
||
BRT = 26;
|
||
CAT = 27;
|
||
}
|
||
}
|
||
|
||
message GetConfig {
|
||
message Get {
|
||
message Request {
|
||
}
|
||
|
||
}
|
||
}
|
||
}
|
||
|
||
message Workspace {
|
||
message GetCurrent {
|
||
message Request {
|
||
}
|
||
message Response {
|
||
Error error = 1;
|
||
string workspaceId = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message GetAll {
|
||
message Request {
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
repeated string workspaceIds = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Create {
|
||
message Request {
|
||
string name = 1;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
string workspaceId = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Object {
|
||
message Add {
|
||
message Request {
|
||
string objectId = 1;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
string objectId = 2;
|
||
google.protobuf.Struct details = 3;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message ListAdd {
|
||
message Request {
|
||
repeated string objectIds = 1;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
repeated string objectIds = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message ListRemove {
|
||
message Request {
|
||
repeated string objectIds = 1;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
repeated string ids = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message SetIsHighlighted {
|
||
message Request {
|
||
string objectId = 1;
|
||
bool isHighlighted = 2;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Select {
|
||
message Request {
|
||
string workspaceId = 1;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Export {
|
||
message Request {
|
||
// the path where export files will place
|
||
string path = 1;
|
||
string workspaceId = 2;
|
||
}
|
||
message Response {
|
||
Error error = 1;
|
||
string path = 2;
|
||
ResponseEvent event = 3;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
}
|
||
|
||
message Object {
|
||
message Open {
|
||
message Request {
|
||
string contextId = 1; // id of the context blo1k
|
||
string objectId = 2;
|
||
string traceId = 3;
|
||
|
||
bool includeRelationsAsDependentObjects = 4; // some clients may set this option instead if having the single subscription to all relations
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
model.ObjectView objectView = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
|
||
NOT_FOUND = 3;
|
||
ANYTYPE_NEEDS_UPGRADE = 10; // failed to read unknown data format – need to upgrade anytype
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Close {
|
||
message Request {
|
||
string contextId = 1; // deprecated
|
||
string objectId = 2;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Show {
|
||
message Request {
|
||
string contextId = 1; // deprecated
|
||
string objectId = 2;
|
||
string traceId = 3;
|
||
|
||
bool includeRelationsAsDependentObjects = 4; // some clients may set this option instead if having the single subscription to all relations
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
model.ObjectView objectView = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
NOT_FOUND = 3;
|
||
ANYTYPE_NEEDS_UPGRADE = 10; // failed to read unknown data format – need to upgrade anytype
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Create {
|
||
message Request {
|
||
google.protobuf.Struct details = 1; // object details
|
||
repeated anytype.model.InternalFlag internalFlags = 2;
|
||
string templateId = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
string objectId = 3;
|
||
ResponseEvent event = 4;
|
||
google.protobuf.Struct details = 5;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message CreateBookmark {
|
||
message Request {
|
||
google.protobuf.Struct details = 1;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
string objectId = 2;
|
||
google.protobuf.Struct details = 3;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message CreateRelation {
|
||
message Request {
|
||
google.protobuf.Struct details = 1;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
string objectId = 2;
|
||
string key = 3;
|
||
google.protobuf.Struct details = 4;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message CreateRelationOption {
|
||
message Request {
|
||
google.protobuf.Struct details = 1;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
string objectId = 2;
|
||
google.protobuf.Struct details = 3;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message CreateSet {
|
||
message Request {
|
||
repeated string source = 1;
|
||
google.protobuf.Struct details = 2; // if omitted the name of page will be the same with object type
|
||
string templateId = 3; // optional template id for creating from template
|
||
repeated anytype.model.InternalFlag internalFlags = 4;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
string objectId = 3;
|
||
ResponseEvent event = 4;
|
||
google.protobuf.Struct details = 5;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
UNKNOWN_OBJECT_TYPE_URL = 3;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message CreateObjectType {
|
||
message Request {
|
||
google.protobuf.Struct details = 1;
|
||
repeated anytype.model.InternalFlag internalFlags = 2;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
google.protobuf.Struct details = 2;
|
||
string objectId = 3;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
UNKNOWN_OBJECT_TYPE_URL = 3;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message BookmarkFetch {
|
||
message Request {
|
||
string contextId = 1;
|
||
string url = 2;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message ToBookmark {
|
||
message Request {
|
||
string contextId = 1;
|
||
string url = 2;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
string objectId = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Duplicate {
|
||
message Request {
|
||
string contextId = 1;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
// created template id
|
||
string id = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message OpenBreadcrumbs {
|
||
message Request {
|
||
string contextId = 1; // deprecated
|
||
string traceId = 2;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
string objectId = 2;
|
||
ResponseEvent event = 3;
|
||
model.ObjectView objectView = 4;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message SetBreadcrumbs {
|
||
message Request {
|
||
string breadcrumbsId = 1;
|
||
repeated string ids = 2; // page ids
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
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;
|
||
}
|
||
|
||
message Response {
|
||
string link = 1;
|
||
Error error = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message AddWithObjectId {
|
||
message Request {
|
||
string objectId = 1;
|
||
string payload = 2;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Search {
|
||
message Request {
|
||
repeated anytype.model.Block.Content.Dataview.Filter filters = 1;
|
||
repeated anytype.model.Block.Content.Dataview.Sort sorts = 2;
|
||
string fullText = 3;
|
||
int32 offset = 4;
|
||
int32 limit = 5;
|
||
// additional filter by objectTypes
|
||
repeated string objectTypeFilter = 6; // deprecated, to be removed
|
||
// needed keys in details for return, when empty - will return all
|
||
repeated string keys = 7;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
repeated google.protobuf.Struct records = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Graph {
|
||
message Request {
|
||
repeated anytype.model.Block.Content.Dataview.Filter filters = 1;
|
||
int32 limit = 2;
|
||
// additional filter by objectTypes
|
||
repeated string objectTypeFilter = 3;
|
||
repeated string keys = 4;
|
||
}
|
||
|
||
message Edge {
|
||
enum Type {
|
||
Link = 0;
|
||
Relation = 1;
|
||
}
|
||
string source = 1;
|
||
string target = 2;
|
||
string name = 3;
|
||
Type type = 4;
|
||
string description = 5;
|
||
string iconImage = 6;
|
||
string iconEmoji = 7;
|
||
bool hidden = 8;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
repeated google.protobuf.Struct nodes = 2;
|
||
repeated Edge edges = 3;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message SearchSubscribe {
|
||
message Request {
|
||
// (optional) subscription identifier
|
||
// client can provide some string or middleware will generate it automatically
|
||
// if subId is already registered on middleware, the new query will replace previous subscription
|
||
string subId = 1;
|
||
// filters
|
||
repeated anytype.model.Block.Content.Dataview.Filter filters = 2;
|
||
// sorts
|
||
repeated anytype.model.Block.Content.Dataview.Sort sorts = 3;
|
||
// results limit
|
||
int64 limit = 5;
|
||
// initial offset; middleware will find afterId
|
||
int64 offset = 6;
|
||
// (required) needed keys in details for return, for object fields mw will return (and subscribe) objects as dependent
|
||
repeated string keys = 7;
|
||
|
||
// (optional) pagination: middleware will return results after given id
|
||
string afterId = 8;
|
||
// (optional) pagination: middleware will return results before given id
|
||
string beforeId = 9;
|
||
|
||
repeated string source = 10;
|
||
|
||
string ignoreWorkspace = 12;
|
||
// disable dependent subscription
|
||
bool noDepSubscription = 13;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
|
||
repeated google.protobuf.Struct records = 2;
|
||
repeated google.protobuf.Struct dependencies = 3;
|
||
|
||
string subId = 4;
|
||
|
||
Event.Object.Subscription.Counters counters = 5;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message GroupsSubscribe {
|
||
message Request {
|
||
string subId = 1;
|
||
string relationKey = 2;
|
||
repeated anytype.model.Block.Content.Dataview.Filter filters = 3;
|
||
repeated string source = 4;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
|
||
repeated anytype.model.Block.Content.Dataview.Group groups = 2;
|
||
|
||
string subId = 3;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message SubscribeIds {
|
||
message Request {
|
||
// (optional) subscription identifier
|
||
// client can provide some string or middleware will generate it automatically
|
||
// if subId is already registered on middleware, the new query will replace previous subscription
|
||
string subId = 1;
|
||
// ids for subscribe
|
||
repeated string ids = 2;
|
||
// sorts
|
||
// (required) needed keys in details for return, for object fields mw will return (and subscribe) objects as dependent
|
||
repeated string keys = 3;
|
||
|
||
string ignoreWorkspace = 11;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
|
||
repeated google.protobuf.Struct records = 2;
|
||
repeated google.protobuf.Struct dependencies = 3;
|
||
|
||
string subId = 4;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message SearchUnsubscribe {
|
||
message Request {
|
||
repeated string subIds = 1;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message SetLayout {
|
||
message Request {
|
||
string contextId = 1;
|
||
anytype.model.ObjectType.Layout layout = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message SetIsFavorite {
|
||
message Request {
|
||
string contextId = 1;
|
||
bool isFavorite = 2;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message SetIsArchived {
|
||
message Request {
|
||
string contextId = 1;
|
||
bool isArchived = 2;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message SetObjectType {
|
||
message Request {
|
||
string contextId = 1;
|
||
string objectTypeUrl = 3;
|
||
}
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
UNKNOWN_OBJECT_TYPE_URL = 3;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message SetInternalFlags {
|
||
message Request {
|
||
string contextId = 1;
|
||
repeated anytype.model.InternalFlag internalFlags = 7;
|
||
|
||
}
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
UNKNOWN_OBJECT_TYPE_URL = 3;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message SetDetails {
|
||
message Detail {
|
||
string key = 1;
|
||
google.protobuf.Value value = 2; // NUll - removes key
|
||
}
|
||
message Request {
|
||
string contextId = 1;
|
||
repeated Detail details = 2;
|
||
}
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message ToSet {
|
||
message Request {
|
||
string contextId = 1;
|
||
repeated string source = 2;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
string setId = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
// Available undo/redo operations
|
||
message UndoRedoCounter {
|
||
int32 undo = 1;
|
||
int32 redo = 2;
|
||
}
|
||
|
||
message Undo {
|
||
message Request {
|
||
string contextId = 1; // id of the context object
|
||
}
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
UndoRedoCounter counters = 3;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
CAN_NOT_MOVE = 3;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Redo {
|
||
message Request {
|
||
string contextId = 1; // id of the context object
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
UndoRedoCounter counters = 3;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
CAN_NOT_MOVE = 3;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message ListDuplicate {
|
||
message Request {
|
||
repeated string objectIds = 1;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
repeated string ids = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message ListDelete {
|
||
// Deletes the object, keys from the local store and unsubscribe from remote changes. Also offloads all orphan files
|
||
message Request {
|
||
repeated string objectIds = 1; // objects to remove
|
||
}
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message ListSetIsArchived {
|
||
message Request {
|
||
repeated string objectIds = 1;
|
||
bool isArchived = 2;
|
||
}
|
||
message Response {
|
||
Error error = 1;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message ListSetIsFavorite {
|
||
message Request {
|
||
repeated string objectIds = 1;
|
||
bool isFavorite = 2;
|
||
}
|
||
message Response {
|
||
Error error = 1;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message ApplyTemplate {
|
||
message Request {
|
||
string contextId = 1;
|
||
// id of template
|
||
string templateId = 2;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message ListExport {
|
||
message Request {
|
||
// the path where export files will place
|
||
string path = 1;
|
||
// ids of documents for export, when empty - will export all available docs
|
||
repeated string objectIds = 2;
|
||
// export format
|
||
Format format = 3;
|
||
// save as zip file
|
||
bool zip = 4;
|
||
// include all nested
|
||
bool includeNested = 5;
|
||
// include all files
|
||
bool includeFiles = 6;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
string path = 2;
|
||
int32 succeed = 4;
|
||
ResponseEvent event = 3;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
|
||
enum Format {
|
||
Markdown = 0;
|
||
Protobuf = 1;
|
||
JSON = 2;
|
||
DOT = 3;
|
||
SVG = 4;
|
||
GRAPH_JSON = 5;
|
||
}
|
||
}
|
||
|
||
message Import {
|
||
message Request {
|
||
oneof params {
|
||
NotionParams notionParams = 1;
|
||
BookmarksParams bookmarksParams = 2; //for internal use
|
||
MarkdownParams markdownParams = 3;
|
||
}
|
||
repeated Snapshot snapshots = 4; // optional, for external developers usage
|
||
bool updateExistingObjects = 5;
|
||
Type type = 6;
|
||
Mode mode = 7;
|
||
|
||
message NotionParams {
|
||
string apiKey = 1;
|
||
}
|
||
|
||
message MarkdownParams {
|
||
string path = 1;
|
||
}
|
||
|
||
message BookmarksParams {
|
||
string url = 1;
|
||
}
|
||
|
||
enum Mode {
|
||
ALL_OR_NOTHING = 0;
|
||
IGNORE_ERRORS = 1;
|
||
};
|
||
|
||
message Snapshot {
|
||
string id = 1;
|
||
anytype.model.SmartBlockSnapshotBase snapshot = 2;
|
||
};
|
||
enum Type {
|
||
Notion = 0;
|
||
Markdown = 1;
|
||
External = 2; // external developers use it
|
||
};
|
||
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
INTERNAL_ERROR = 1;
|
||
UNKNOWN_ERROR = 2;
|
||
BAD_INPUT = 3;
|
||
}
|
||
}
|
||
}
|
||
|
||
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 {}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
repeated ImportResponse response = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
INTERNAL_ERROR = 1;
|
||
UNKNOWN_ERROR = 2;
|
||
BAD_INPUT = 3;
|
||
}
|
||
}
|
||
|
||
}
|
||
message ImportResponse {
|
||
Type type = 1;
|
||
enum Type {
|
||
Notion = 0;
|
||
Markdown = 1;
|
||
};
|
||
}
|
||
}
|
||
}
|
||
|
||
message ObjectRelation {
|
||
message Add {
|
||
message Request {
|
||
string contextId = 1;
|
||
repeated string relationKeys = 2;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Delete {
|
||
message Request {
|
||
string contextId = 1;
|
||
repeated string relationKeys = 2;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 3;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message ListAvailable {
|
||
message Request {
|
||
string contextId = 1;
|
||
}
|
||
message Response {
|
||
Error error = 1;
|
||
repeated anytype.model.Relation relations = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message AddFeatured {
|
||
message Request {
|
||
string contextId = 1;
|
||
repeated string relations = 2;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message RemoveFeatured {
|
||
message Request {
|
||
string contextId = 1;
|
||
repeated string relations = 2;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message ObjectType {
|
||
message Relation {
|
||
message Add {
|
||
message Request {
|
||
string objectTypeUrl = 1;
|
||
repeated string relationKeys = 2;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
repeated anytype.model.Relation relations = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
UNKNOWN_OBJECT_TYPE_URL = 3;
|
||
READONLY_OBJECT_TYPE = 4;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message Remove {
|
||
message Request {
|
||
string objectTypeUrl = 1;
|
||
repeated string relationKeys = 2;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
UNKNOWN_OBJECT_TYPE_URL = 3;
|
||
READONLY_OBJECT_TYPE = 4;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message List {
|
||
message Request {
|
||
string objectTypeUrl = 1;
|
||
bool appendRelationsFromOtherTypes = 2; // add relations from other object types in the end
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
repeated anytype.model.RelationLink relations = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
UNKNOWN_OBJECT_TYPE_URL = 3;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Relation {
|
||
message ListRemoveOption {
|
||
message Request {
|
||
repeated string optionIds = 1;
|
||
bool checkInObjects = 2;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
OPTION_USED_BY_OBJECTS = 3;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Options {
|
||
message Request {
|
||
string relationKey = 1;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
model.RelationOptions options = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message History {
|
||
message Version {
|
||
string id = 1;
|
||
repeated string previousIds = 2;
|
||
string authorId = 3;
|
||
string authorName = 4;
|
||
int64 time = 5;
|
||
int64 groupId = 6;
|
||
}
|
||
|
||
// returns list of versions (changes)
|
||
message GetVersions {
|
||
message Request {
|
||
string objectId = 1;
|
||
// when indicated, results will include versions before given id
|
||
string lastVersionId = 2;
|
||
// desired count of versions
|
||
int32 limit = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
repeated Version versions = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
// returns blockShow event for given version
|
||
message ShowVersion {
|
||
message Request {
|
||
string objectId = 1;
|
||
string versionId = 2;
|
||
string traceId = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
model.ObjectView objectView = 2;
|
||
History.Version version = 3;
|
||
string traceId = 4;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message SetVersion {
|
||
message Request {
|
||
string objectId = 1;
|
||
string versionId = 2;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message File {
|
||
message Offload {
|
||
message Request {
|
||
string id = 1;
|
||
bool includeNotPinned = 2;
|
||
}
|
||
message Response {
|
||
Error error = 1;
|
||
uint64 bytesOffloaded = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
NODE_NOT_STARTED = 103;
|
||
FILE_NOT_YET_PINNED = 104;
|
||
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message ListOffload {
|
||
message Request {
|
||
repeated string onlyIds = 1; // empty means all
|
||
bool includeNotPinned = 2; // false mean not-yet-pinned files will be not
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
int32 filesOffloaded = 2;
|
||
uint64 bytesOffloaded = 3;
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
NODE_NOT_STARTED = 103;
|
||
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message Upload {
|
||
message Request {
|
||
string url = 1;
|
||
string localPath = 2;
|
||
anytype.model.Block.Content.File.Type type = 3;
|
||
bool disableEncryption = 4; // deprecated, has no affect
|
||
anytype.model.Block.Content.File.Style style = 5;
|
||
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
string hash = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message Download {
|
||
message Request {
|
||
string hash = 1;
|
||
string path = 2; // path to save file. Temp directory is used if empty
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
string localPath = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
NOT_FOUND = 3;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message Drop {
|
||
message Request {
|
||
string contextId = 1;
|
||
string dropTargetId = 2; // id of the simple block to insert considering position
|
||
anytype.model.Block.Position position = 3; // position relatively to the dropTargetId simple block
|
||
repeated string localFilePaths = 4;
|
||
}
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Navigation {
|
||
enum Context {
|
||
Navigation = 0;
|
||
MoveTo = 1; // do not show sets/archive
|
||
LinkTo = 2; // same for mention, do not show sets/archive
|
||
}
|
||
|
||
message ListObjects {
|
||
message Request {
|
||
Context context = 1;
|
||
string fullText = 2;
|
||
int32 limit = 3;
|
||
int32 offset = 4;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
repeated anytype.model.ObjectInfo objects = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
/*
|
||
* Get the info for page alongside with info for all inbound and outbound links from/to this page
|
||
*/
|
||
message GetObjectInfoWithLinks {
|
||
message Request {
|
||
string objectId = 1;
|
||
Context context = 2;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
anytype.model.ObjectInfoWithLinks object = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Template {
|
||
message CreateFromObject {
|
||
message Request {
|
||
// id of block for making them template
|
||
string contextId = 1;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
// created template id
|
||
string id = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message CreateFromObjectType {
|
||
message Request {
|
||
// id of desired object type
|
||
string objectType = 1;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
// created template id
|
||
string id = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message Clone {
|
||
message Request {
|
||
// id of template block for cloning
|
||
string contextId = 1;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
// created template id
|
||
string id = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message ExportAll {
|
||
message Request {
|
||
// the path where export files will place
|
||
string path = 1;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
string path = 2;
|
||
ResponseEvent event = 3;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message LinkPreview {
|
||
message Request {
|
||
string url = 1;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
anytype.model.LinkPreview linkPreview = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Unsplash {
|
||
message Search {
|
||
message Request {
|
||
string query = 1; // empty means random images
|
||
int32 limit = 2; // may be omitted if the request was cached previously with another limit
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
repeated Picture pictures = 2;
|
||
|
||
message Picture {
|
||
string id = 1;
|
||
string url = 2;
|
||
string artist = 3;
|
||
string artistUrl = 4;
|
||
}
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
|
||
RATE_LIMIT_EXCEEDED = 100;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Download {
|
||
message Request {
|
||
string pictureId = 1;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
string hash = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
|
||
RATE_LIMIT_EXCEEDED = 100;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
// Block commands
|
||
message Block {
|
||
message Replace {
|
||
message Request {
|
||
string contextId = 1;
|
||
string blockId = 2;
|
||
anytype.model.Block block = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
string blockId = 2;
|
||
ResponseEvent event = 3;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Split {
|
||
message Request {
|
||
string contextId = 1;
|
||
string blockId = 2;
|
||
anytype.model.Range range = 3;
|
||
anytype.model.Block.Content.Text.Style style = 4;
|
||
Mode mode = 5;
|
||
|
||
enum Mode {
|
||
// new block will be created under existing
|
||
BOTTOM = 0;
|
||
// new block will be created above existing
|
||
TOP = 1;
|
||
// new block will be created as the first children of existing
|
||
INNER = 2;
|
||
// new block will be created after header (not required for set at client side, will auto set for title block)
|
||
TITLE = 3;
|
||
}
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
string blockId = 2;
|
||
ResponseEvent event = 3;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Merge {
|
||
message Request {
|
||
string contextId = 1;
|
||
string firstBlockId = 2;
|
||
string secondBlockId = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Copy {
|
||
message Request {
|
||
string contextId = 1;
|
||
repeated anytype.model.Block blocks = 2;
|
||
anytype.model.Range selectedTextRange = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
string textSlot = 2;
|
||
string htmlSlot = 3;
|
||
repeated anytype.model.Block anySlot = 4;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Paste {
|
||
message Request {
|
||
string contextId = 1;
|
||
string focusedBlockId = 2;
|
||
anytype.model.Range selectedTextRange = 3;
|
||
repeated string selectedBlockIds = 4;
|
||
bool isPartOfBlock = 5;
|
||
|
||
string textSlot = 6;
|
||
string htmlSlot = 7;
|
||
repeated anytype.model.Block anySlot = 8;
|
||
repeated File fileSlot = 9;
|
||
|
||
message File {
|
||
string name = 1;
|
||
bytes data = 2;
|
||
string localPath = 3;
|
||
}
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
repeated string blockIds = 2;
|
||
int32 caretPosition = 3;
|
||
bool isSameBlockCaret = 4;
|
||
ResponseEvent event = 5;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Cut {
|
||
message Request {
|
||
string contextId = 1;
|
||
repeated anytype.model.Block blocks = 2;
|
||
anytype.model.Range selectedTextRange = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
string textSlot = 2;
|
||
string htmlSlot = 3;
|
||
repeated anytype.model.Block anySlot = 4;
|
||
ResponseEvent event = 5;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Upload {
|
||
message Request {
|
||
string contextId = 1;
|
||
string blockId = 2;
|
||
string filePath = 3;
|
||
string url = 4;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Download {
|
||
message Request {
|
||
string contextId = 1;
|
||
string blockId = 2;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
/*
|
||
* Create a Smart/Internal block. Request can contain a block with a content, or it can be an empty block with a specific block.content.
|
||
* **Example scenario**
|
||
* 1A. Create Page on a dashboard
|
||
* 1. Front -> MW: Rpc.Block.Create.Request(blockId:dashboard.id, position:bottom, block: emtpy block with page content and id = "")
|
||
* 2. Front -> MW: Rpc.Block.Close.Request(block: dashboard.id)
|
||
* 3. Front <- MW: Rpc.Block.Close.Response(err)
|
||
* 4. Front <- MW: Rpc.Block.Create.Response(page.id)
|
||
* 5. Front <- MW: Rpc.Block.Open.Response(err)
|
||
* 6. Front <- MW: Event.Block.Show(page)
|
||
* 1B. Create Page on a Page
|
||
* 1. Front -> MW: Rpc.Block.Create.Request(blockId:dashboard.id, position:bottom, block: emtpy block with page content and id = "")
|
||
* 2. Front <- MW: Rpc.Block.Create.Response(newPage.id)
|
||
* 3. Front <- MW: Event.Block.Show(newPage)
|
||
*/
|
||
message Create {
|
||
// common simple block command
|
||
message Request {
|
||
string contextId = 1; // id of the context object
|
||
string targetId = 2; // id of the closest block
|
||
anytype.model.Block block = 3;
|
||
anytype.model.Block.Position position = 4;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
string blockId = 2;
|
||
ResponseEvent event = 3;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message CreateWidget {
|
||
message Request {
|
||
string contextId = 1; // id of the context object
|
||
string targetId = 2; // id of the closest block
|
||
anytype.model.Block block = 3;
|
||
anytype.model.Block.Position position = 4;
|
||
anytype.model.Block.Content.Widget.Layout widgetLayout = 5;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
string blockId = 2;
|
||
ResponseEvent event = 3;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
/*
|
||
* Remove blocks from the childrenIds of its parents
|
||
*/
|
||
message ListDelete {
|
||
message Request {
|
||
string contextId = 1; // id of the context object
|
||
repeated string blockIds = 2; // targets to remove
|
||
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message SetFields {
|
||
message Request {
|
||
string contextId = 1;
|
||
string blockId = 2;
|
||
google.protobuf.Struct fields = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message ListSetAlign {
|
||
message Request {
|
||
string contextId = 1;
|
||
repeated string blockIds = 2; // when empty - align will be applied as layoutAlign
|
||
anytype.model.Block.Align align = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message ListSetVerticalAlign {
|
||
message Request {
|
||
string contextId = 1; // id of the context object
|
||
repeated string blockIds = 2;
|
||
anytype.model.Block.VerticalAlign verticalAlign = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message ListSetFields {
|
||
message Request {
|
||
string contextId = 1;
|
||
repeated BlockField blockFields = 2;
|
||
|
||
message BlockField {
|
||
string blockId = 1;
|
||
google.protobuf.Struct fields = 2;
|
||
}
|
||
}
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
/*
|
||
* Makes blocks copy by given ids and paste it to shown place
|
||
*/
|
||
message ListDuplicate {
|
||
message Request {
|
||
string contextId = 1; // id of the context object
|
||
string targetId = 2; // id of the closest block
|
||
repeated string blockIds = 3; // id of block for duplicate
|
||
anytype.model.Block.Position position = 4;
|
||
string targetContextId = 5;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
repeated string blockIds = 2;
|
||
ResponseEvent event = 3;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message ListUpdate {
|
||
message Request {
|
||
string contextId = 1;
|
||
repeated string blockIds = 2;
|
||
oneof field {
|
||
Text text = 3;
|
||
string backgroundColor = 4;
|
||
anytype.model.Block.Align align = 5;
|
||
google.protobuf.Struct fields = 6;
|
||
anytype.model.Block.Content.Div.Style divStyle = 7;
|
||
model.Block.Content.File.Style fileStyle = 8;
|
||
}
|
||
message Text {
|
||
oneof field {
|
||
anytype.model.Block.Content.Text.Style style = 1;
|
||
string color = 2;
|
||
anytype.model.Block.Content.Text.Mark mark = 3;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message ListConvertToObjects {
|
||
message Request {
|
||
string contextId = 1;
|
||
repeated string blockIds = 2;
|
||
string objectType = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
repeated string linkIds = 2;
|
||
ResponseEvent event = 3;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message ListMoveToExistingObject {
|
||
message Request {
|
||
string contextId = 1;
|
||
repeated string blockIds = 2;
|
||
string targetContextId = 3;
|
||
string dropTargetId = 4; // id of the simple block to insert considering position
|
||
anytype.model.Block.Position position = 5; // position relatively to the dropTargetId simple block
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message ListMoveToNewObject {
|
||
message Request {
|
||
string contextId = 1;
|
||
repeated string blockIds = 2;
|
||
google.protobuf.Struct details = 3; // new object details
|
||
string dropTargetId = 4; // id of the simple block to insert considering position
|
||
anytype.model.Block.Position position = 5; // position relatively to the dropTargetId simple block
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
string linkId = 2;
|
||
ResponseEvent event = 3;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message ListTurnInto {
|
||
message Request {
|
||
string contextId = 1;
|
||
repeated string blockIds = 2;
|
||
anytype.model.Block.Content.Text.Style style = 3;
|
||
}
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message ListSetBackgroundColor {
|
||
message Request {
|
||
string contextId = 1;
|
||
repeated string blockIds = 2;
|
||
string color = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Export {
|
||
message Request {
|
||
string contextId = 1;
|
||
repeated anytype.model.Block blocks = 2;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
string path = 2;
|
||
ResponseEvent event = 3;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message BlockLatex {
|
||
message SetText {
|
||
message Request {
|
||
string contextId = 1;
|
||
string blockId = 2;
|
||
string text = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message BlockText {
|
||
message SetText {
|
||
message Request {
|
||
string contextId = 1;
|
||
string blockId = 2;
|
||
string text = 3;
|
||
anytype.model.Block.Content.Text.Marks marks = 4;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message SetColor {
|
||
message Request {
|
||
string contextId = 1;
|
||
string blockId = 2;
|
||
string color = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message SetMarks {
|
||
/*
|
||
* Get marks list in the selected range in text block.
|
||
*/
|
||
message Get {
|
||
message Request {
|
||
string contextId = 1;
|
||
string blockId = 2;
|
||
anytype.model.Range range = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message SetStyle {
|
||
message Request {
|
||
string contextId = 1;
|
||
string blockId = 2;
|
||
anytype.model.Block.Content.Text.Style style = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message SetChecked {
|
||
message Request {
|
||
string contextId = 1;
|
||
string blockId = 2;
|
||
bool checked = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message SetIcon {
|
||
message Request {
|
||
string contextId = 1;
|
||
string blockId = 2;
|
||
string iconImage = 3; // in case both image and emoji are set, image has a priority to show
|
||
string iconEmoji = 5;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message ListSetStyle {
|
||
message Request {
|
||
string contextId = 1;
|
||
repeated string blockIds = 2;
|
||
anytype.model.Block.Content.Text.Style style = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message ListSetColor {
|
||
message Request {
|
||
string contextId = 1;
|
||
repeated string blockIds = 2;
|
||
string color = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message ListSetMark {
|
||
message Request {
|
||
string contextId = 1;
|
||
repeated string blockIds = 2;
|
||
anytype.model.Block.Content.Text.Mark mark = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message ListClearStyle {
|
||
message Request {
|
||
string contextId = 1;
|
||
repeated string blockIds = 2;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message ListClearContent {
|
||
message Request {
|
||
string contextId = 1;
|
||
repeated string blockIds = 2;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message BlockTable {
|
||
message Create {
|
||
message Request {
|
||
string contextId = 1; // id of the context object
|
||
string targetId = 2; // id of the closest block
|
||
anytype.model.Block.Position position = 3;
|
||
uint32 rows = 4;
|
||
uint32 columns = 5;
|
||
bool withHeaderRow = 6;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
string blockId = 2;
|
||
ResponseEvent event = 3;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message RowCreate {
|
||
message Request {
|
||
string contextId = 1; // id of the context object
|
||
string targetId = 2; // id of the closest row
|
||
anytype.model.Block.Position position = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message RowSetHeader {
|
||
message Request {
|
||
string contextId = 1; // id of the context object
|
||
string targetId = 2;
|
||
bool isHeader = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message RowListFill {
|
||
message Request {
|
||
string contextId = 1; // id of the context object
|
||
repeated string blockIds = 2;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message RowListClean {
|
||
message Request {
|
||
string contextId = 1; // id of the context object
|
||
repeated string blockIds = 2;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message ColumnListFill {
|
||
message Request {
|
||
string contextId = 1; // id of the context object
|
||
repeated string blockIds = 2;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message ColumnCreate {
|
||
message Request {
|
||
string contextId = 1; // id of the context object
|
||
string targetId = 2; // id of the closest column
|
||
anytype.model.Block.Position position = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message RowDelete {
|
||
message Request {
|
||
string contextId = 1; // id of the context object
|
||
string targetId = 2; // id of the closest row
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message ColumnDelete {
|
||
message Request {
|
||
string contextId = 1; // id of the context object
|
||
string targetId = 2; // id of the closest column
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message ColumnMove {
|
||
message Request {
|
||
string contextId = 1;
|
||
string targetId = 2;
|
||
string dropTargetId = 3;
|
||
anytype.model.Block.Position position = 4;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message RowDuplicate {
|
||
message Request {
|
||
string contextId = 1; // id of the context object
|
||
string targetId = 2;
|
||
string blockId = 3; // block to duplicate
|
||
anytype.model.Block.Position position = 4;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message ColumnDuplicate {
|
||
message Request {
|
||
string contextId = 1; // id of the context object
|
||
string targetId = 2;
|
||
string blockId = 3; // block to duplicate
|
||
anytype.model.Block.Position position = 4;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
string blockId = 2;
|
||
ResponseEvent event = 3;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Expand {
|
||
message Request {
|
||
string contextId = 1; // id of the context object
|
||
string targetId = 2;
|
||
uint32 columns = 3; // number of columns to append
|
||
uint32 rows = 4; // number of rows to append
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Sort {
|
||
message Request {
|
||
string contextId = 1; // id of the context object
|
||
string columnId = 2;
|
||
anytype.model.Block.Content.Dataview.Sort.Type type = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message BlockFile {
|
||
message SetName {
|
||
message Request {
|
||
string contextId = 1;
|
||
string blockId = 2;
|
||
string name = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message CreateAndUpload {
|
||
message Request {
|
||
string contextId = 1;
|
||
string targetId = 2;
|
||
anytype.model.Block.Position position = 3;
|
||
string url = 4;
|
||
string localPath = 5;
|
||
anytype.model.Block.Content.File.Type fileType = 6;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
string blockId = 2;
|
||
ResponseEvent event = 3;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message ListSetStyle {
|
||
message Request {
|
||
string contextId = 1;
|
||
repeated string blockIds = 2;
|
||
model.Block.Content.File.Style style = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message BlockImage {
|
||
message SetName {
|
||
message Request {
|
||
string contextId = 1;
|
||
string blockId = 2;
|
||
string name = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message SetWidth {
|
||
message Request {
|
||
string contextId = 1;
|
||
string blockId = 2;
|
||
int32 width = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message BlockVideo {
|
||
message SetName {
|
||
message Request {
|
||
string contextId = 1;
|
||
string blockId = 2;
|
||
string name = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message SetWidth {
|
||
message Request {
|
||
string contextId = 1;
|
||
string blockId = 2;
|
||
int32 width = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message BlockLink {
|
||
message CreateWithObject {
|
||
message Request {
|
||
string contextId = 1; // id of the context object
|
||
google.protobuf.Struct details = 3; // new object details
|
||
string templateId = 5; // optional template id for creating from template
|
||
repeated anytype.model.InternalFlag internalFlags = 7;
|
||
|
||
// link block params
|
||
string targetId = 2; // id of the closest simple block
|
||
anytype.model.Block.Position position = 4;
|
||
google.protobuf.Struct fields = 6; // link block fields
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
string blockId = 2;
|
||
string targetId = 3;
|
||
ResponseEvent event = 4;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message ListSetAppearance {
|
||
message Request {
|
||
string contextId = 1;
|
||
repeated string blockIds = 2;
|
||
anytype.model.Block.Content.Link.IconSize iconSize = 4;
|
||
anytype.model.Block.Content.Link.CardStyle cardStyle = 5;
|
||
anytype.model.Block.Content.Link.Description description = 6;
|
||
repeated string relations = 7;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message BlockRelation {
|
||
message SetKey {
|
||
message Request {
|
||
string contextId = 1;
|
||
string blockId = 2;
|
||
string key = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message Add {
|
||
message Request {
|
||
string contextId = 1;
|
||
string blockId = 2;
|
||
string relationKey = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message BlockBookmark {
|
||
message Fetch {
|
||
message Request {
|
||
string contextId = 1;
|
||
string blockId = 2;
|
||
string url = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message CreateAndFetch {
|
||
message Request {
|
||
string contextId = 1;
|
||
string targetId = 2;
|
||
anytype.model.Block.Position position = 3;
|
||
string url = 4;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
string blockId = 2;
|
||
ResponseEvent event = 3;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message BlockDiv {
|
||
message ListSetStyle {
|
||
message Request {
|
||
string contextId = 1;
|
||
repeated string blockIds = 2;
|
||
anytype.model.Block.Content.Div.Style style = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message BlockDataview {
|
||
message View {
|
||
message Create {
|
||
message Request {
|
||
string contextId = 1;
|
||
string blockId = 2; // id of dataview block to insert the new block
|
||
anytype.model.Block.Content.Dataview.View view = 4;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
string viewId = 3;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message Update {
|
||
message Request {
|
||
string contextId = 1;
|
||
string blockId = 2; // id of dataview block to update
|
||
string viewId = 3; // id of view to update
|
||
anytype.model.Block.Content.Dataview.View view = 4;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message Delete {
|
||
message Request {
|
||
string contextId = 1; // id of the context object
|
||
string blockId = 2; // id of the dataview
|
||
string viewId = 4; // id of the view to remove
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message SetPosition {
|
||
message Request {
|
||
string contextId = 1; // id of the context object
|
||
string blockId = 2; // id of the dataview
|
||
string viewId = 4; // id of the view to remove
|
||
uint32 position = 5; // index of view position (0 - means first)
|
||
}
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
// set the current active view (persisted only within a session)
|
||
message SetActive {
|
||
message Request {
|
||
string contextId = 1;
|
||
string blockId = 2; // id of dataview block
|
||
string viewId = 3; // id of active view
|
||
uint32 offset = 4;
|
||
uint32 limit = 5;
|
||
}
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message Relation {
|
||
message Add {
|
||
message Request {
|
||
string contextId = 1;
|
||
string blockId = 2; // id of dataview block to add relation
|
||
repeated string relationKeys = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Delete {
|
||
message Request {
|
||
string contextId = 1;
|
||
string blockId = 2; // id of dataview block to add relation
|
||
repeated string relationKeys = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 3;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message ListAvailable {
|
||
message Request {
|
||
string contextId = 1;
|
||
string blockId = 2;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
repeated anytype.model.Relation relations = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
NOT_A_DATAVIEW_BLOCK = 3;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message SetSource {
|
||
message Request {
|
||
string contextId = 1;
|
||
string blockId = 2;
|
||
repeated string source = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 4;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message GroupOrder {
|
||
message Update {
|
||
message Request {
|
||
string contextId = 1;
|
||
string blockId = 2;
|
||
anytype.model.Block.Content.Dataview.GroupOrder groupOrder = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
message ObjectOrder {
|
||
message Update {
|
||
message Request {
|
||
string contextId = 1;
|
||
string blockId = 2;
|
||
repeated anytype.model.Block.Content.Dataview.ObjectOrder objectOrders = 3;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
ResponseEvent event = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message CreateBookmark {
|
||
message Request {
|
||
string contextId = 1;
|
||
string blockId = 2;
|
||
string url = 3;
|
||
}
|
||
message Response {
|
||
Error error = 1;
|
||
string id = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Debug {
|
||
message logInfo {
|
||
string id = 1;
|
||
string head = 2;
|
||
bool headDownloaded = 3;
|
||
int32 totalRecords = 4;
|
||
int32 totalSize = 5;
|
||
int32 firstRecordTs = 6;
|
||
int32 firstRecordVer = 7;
|
||
int32 lastRecordTs = 8;
|
||
int32 lastRecordVer = 9;
|
||
int32 lastPullSecAgo = 10;
|
||
string upStatus = 11;
|
||
string downStatus = 12;
|
||
string error = 13;
|
||
}
|
||
|
||
message threadInfo {
|
||
string id = 1;
|
||
int32 logsWithDownloadedHead = 2;
|
||
int32 logsWithWholeTreeDownloaded = 3;
|
||
|
||
repeated logInfo logs = 4;
|
||
bool ownLogHasCafeReplicator = 5;
|
||
int32 cafeLastPullSecAgo = 6;
|
||
string cafeUpStatus = 7;
|
||
string cafeDownStatus = 8;
|
||
int32 totalRecords = 9;
|
||
int32 totalSize = 10;
|
||
string error = 11;
|
||
|
||
}
|
||
|
||
message Sync {
|
||
message Request {
|
||
int32 recordsTraverseLimit = 1; // 0 means no limit
|
||
bool skipEmptyLogs = 2; // do not set if you want the whole picture
|
||
bool tryToDownloadRemoteRecords = 3; // if try we will try to download remote records in case missing
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
repeated threadInfo threads = 2;
|
||
string deviceId = 3;
|
||
int32 totalThreads = 4;
|
||
int32 threadsWithoutReplInOwnLog = 5;
|
||
int32 threadsWithoutHeadDownloaded = 6;
|
||
int32 totalRecords = 7;
|
||
int32 totalSize = 8;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Thread {
|
||
message Request {
|
||
string threadId = 1;
|
||
bool skipEmptyLogs = 2; // do not set if you want the whole picture
|
||
bool tryToDownloadRemoteRecords = 3; // if try we will try to download remote records in case missing
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
threadInfo info = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Tree {
|
||
message Request {
|
||
string objectId = 1;
|
||
string path = 2;
|
||
bool unanonymized = 3; // set to true to disable mocking of the actual data inside changes
|
||
bool generateSvg = 4; // set to true to write both ZIP and SVG files
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
string filename = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message ExportLocalstore {
|
||
message Request {
|
||
// the path where export files will place
|
||
string path = 1;
|
||
// ids of documents for export, when empty - will export all available docs
|
||
repeated string docIds = 2;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
string path = 2;
|
||
ResponseEvent event = 3;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Ping {
|
||
message Request {
|
||
int32 index = 1;
|
||
int32 numberOfEventsToSend = 2;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
int32 index = 2;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Metrics {
|
||
message SetParameters {
|
||
message Request {
|
||
option (no_auth) = true;
|
||
string platform = 1;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Log {
|
||
message Send {
|
||
message Request {
|
||
string message = 1;
|
||
Level level = 2;
|
||
|
||
enum Level {
|
||
DEBUG = 0;
|
||
ERROR = 1;
|
||
FATAL = 2;
|
||
INFO = 3;
|
||
PANIC = 4;
|
||
WARNING = 5;
|
||
}
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
|
||
NOT_FOUND = 101;
|
||
TIMEOUT = 102;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Process {
|
||
message Cancel {
|
||
message Request {
|
||
string id = 1;
|
||
}
|
||
|
||
message Response {
|
||
Error error = 1;
|
||
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message GenericErrorResponse {
|
||
Error error = 1;
|
||
message Error {
|
||
Code code = 1;
|
||
string description = 2;
|
||
|
||
enum Code {
|
||
NULL = 0;
|
||
UNKNOWN_ERROR = 1;
|
||
BAD_INPUT = 2;
|
||
// ...
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
message Empty {
|
||
|
||
}
|
||
|
||
message StreamRequest {
|
||
string token = 1;
|
||
}
|