syntax = "proto3";

package node;

message Tree {
  Meta meta = 1;
  repeated Folder folder = 2;
  repeated File file = 3;
}

message Folder {
  uint64 created_timestamp = 1;
  uint64 updated_timestamp = 2;
  string path = 3;
  int32 index = 4;
  repeated string tag = 5;
  string sort_by = 6;
}

message File {
  uint64 created_timestamp = 1;
  uint64 updated_timestamp = 2;
  string path = 3;
  int32 index = 4;
  repeated string tag = 5;
  Block block = 6;
}

message Meta {
  string id = 1;
  uint64 created_timestamp = 2;
  uint64 updated_timestamp = 3;
  string encryptor_version = 4;
  uint64 update_version = 5;
  bytes write_key = 6;
}

message Grid {
  repeated GridRow row = 1;
}

enum GridType {
  UNDEFINED = 0;
  TEXTBLOCK = 1;
  INPUT = 2;
  PASSWORD = 3;
  TEXTAREA = 4;
  HIDDENBLOCK = 5;
}

message GridRow {
  string value = 1;
  GridType type = 2;
  string label = 3;
}

message Block {
  uint64 position = 1;
  uint64 size = 2;
  bytes key = 3;
}

message Transfer {
  repeated Folder folder = 1;
  repeated TransferFile file = 2;
}

message TransferFile {
  uint64 created_timestamp = 1;
  uint64 updated_timestamp = 2;
  string path = 3;
  int32 index = 4;
  repeated string tag = 5;
  bytes binary = 6;
}
