-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAPI.proto
137 lines (117 loc) · 2.76 KB
/
API.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
// Instruction transfer API description
// Used to generate python gRPC classes
syntax = "proto3";
import "google/protobuf/timestamp.proto";
// Important line for Java compatibility
// Will get "Not implemented" without it
package virtual_assistant;
// Empty message as rpc requires to have input
message AllInstructioinsRequest {}
message Timestamp
{
google.protobuf.Timestamp timestamp = 1;
}
// Instruction Thumbnail metadata and image as byte array
message InstructionThumbnail
{
string id = 1;
string name = 2;
int32 size = 3;
string description = 4;
bytes image = 5;
Timestamp last_modified = 6;
int32 step_count = 7;
/* more metadata */
}
// Array of instruction thumbnails
message AllInstructioinsResponse
{
repeated InstructionThumbnail thumbnails = 1;
}
message InstructionRequest
{
string id = 1;
}
// Array of Steps
message InstructionResponse
{
int32 status = 1;
repeated Step steps = 2;
}
// 3D Pose and scale
message Transform
{
message Vector3
{
float x = 1;
float y = 2;
float z = 3;
}
Vector3 position = 1;
Vector3 orientation = 2;
float scale = 3;
}
message Media
{
enum MediaType
{
TEXT = 0;
IMAGE = 1;
AUDIO = 2;
VIDEO = 3;
MODEL = 4;
}
MediaType type = 1;
string url = 2;
string description = 3;
}
// Kind of object is determined by enum MediaType
message Asset
{
string name = 1;
Media media = 2;
Transform transform = 3;
bool hidden = 4;
}
// One step might containt multiple Assets
message Step
{
string name = 1;
string description = 2;
string preview_url = 3;
repeated Asset assets = 4;
}
// Chunks for big files requests
message Chunk
{
bytes buffer = 1;
}
// Status to indicate if data was received or not
message Status
{
int32 status = 1;
}
message MediaRequest
{
string id = 1;
}
service VirtualAssistant
{
// Request thumbnails to all available instructions
rpc GetAllInstructions(AllInstructioinsRequest) returns (AllInstructioinsResponse) {}
// Request instruction by id
rpc GetInstruction(InstructionRequest) returns (InstructionResponse) {}
// Request media folder in zip format
rpc DownloadMedia(MediaRequest) returns (stream Chunk) {}
// Check when the object was modified last time
rpc LastModified(InstructionRequest) returns (Timestamp) {}
}
service WebEditor
{
// Download Instruction from server to web-editor
rpc DownloadInstruction(InstructionRequest) returns (stream Chunk) {}
// Upload instruction(s) from web-editor to server
rpc UploadInstructions(stream Chunk) returns (Status) {}
// Check when the object was modified last time
rpc LastModified(InstructionRequest) returns (Timestamp) {}
}