@dxos/protocols 2.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +5 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/proto/gen/dxos/bot.d.ts +109 -0
- package/dist/src/proto/gen/dxos/bot.d.ts.map +1 -0
- package/dist/src/proto/gen/dxos/bot.js +14 -0
- package/dist/src/proto/gen/dxos/bot.js.map +1 -0
- package/dist/src/proto/gen/dxos/client.d.ts +179 -0
- package/dist/src/proto/gen/dxos/client.d.ts.map +1 -0
- package/dist/src/proto/gen/dxos/client.js +11 -0
- package/dist/src/proto/gen/dxos/client.js.map +1 -0
- package/dist/src/proto/gen/dxos/config.d.ts +210 -0
- package/dist/src/proto/gen/dxos/config.d.ts.map +1 -0
- package/dist/src/proto/gen/dxos/config.js +29 -0
- package/dist/src/proto/gen/dxos/config.js.map +1 -0
- package/dist/src/proto/gen/dxos/credentials/auth.d.ts +11 -0
- package/dist/src/proto/gen/dxos/credentials/auth.d.ts.map +1 -0
- package/dist/src/proto/gen/dxos/credentials/auth.js +3 -0
- package/dist/src/proto/gen/dxos/credentials/auth.js.map +1 -0
- package/dist/src/proto/gen/dxos/credentials/greet.d.ts +39 -0
- package/dist/src/proto/gen/dxos/credentials/greet.d.ts.map +1 -0
- package/dist/src/proto/gen/dxos/credentials/greet.js +15 -0
- package/dist/src/proto/gen/dxos/credentials/greet.js.map +1 -0
- package/dist/src/proto/gen/dxos/credentials/identity.d.ts +10 -0
- package/dist/src/proto/gen/dxos/credentials/identity.d.ts.map +1 -0
- package/dist/src/proto/gen/dxos/credentials/identity.js +3 -0
- package/dist/src/proto/gen/dxos/credentials/identity.js.map +1 -0
- package/dist/src/proto/gen/dxos/credentials/party.d.ts +49 -0
- package/dist/src/proto/gen/dxos/credentials/party.d.ts.map +1 -0
- package/dist/src/proto/gen/dxos/credentials/party.js +15 -0
- package/dist/src/proto/gen/dxos/credentials/party.js.map +1 -0
- package/dist/src/proto/gen/dxos/credentials.d.ts +25 -0
- package/dist/src/proto/gen/dxos/credentials.d.ts.map +1 -0
- package/dist/src/proto/gen/dxos/credentials.js +3 -0
- package/dist/src/proto/gen/dxos/credentials.js.map +1 -0
- package/dist/src/proto/gen/dxos/devtools.d.ts +196 -0
- package/dist/src/proto/gen/dxos/devtools.d.ts.map +1 -0
- package/dist/src/proto/gen/dxos/devtools.js +3 -0
- package/dist/src/proto/gen/dxos/devtools.js.map +1 -0
- package/dist/src/proto/gen/dxos/echo/feed.d.ts +69 -0
- package/dist/src/proto/gen/dxos/echo/feed.d.ts.map +1 -0
- package/dist/src/proto/gen/dxos/echo/feed.js +13 -0
- package/dist/src/proto/gen/dxos/echo/feed.js.map +1 -0
- package/dist/src/proto/gen/dxos/echo/invitation.d.ts +20 -0
- package/dist/src/proto/gen/dxos/echo/invitation.d.ts.map +1 -0
- package/dist/src/proto/gen/dxos/echo/invitation.js +12 -0
- package/dist/src/proto/gen/dxos/echo/invitation.js.map +1 -0
- package/dist/src/proto/gen/dxos/echo/metadata.d.ts +19 -0
- package/dist/src/proto/gen/dxos/echo/metadata.d.ts.map +1 -0
- package/dist/src/proto/gen/dxos/echo/metadata.js +3 -0
- package/dist/src/proto/gen/dxos/echo/metadata.js.map +1 -0
- package/dist/src/proto/gen/dxos/echo/service.d.ts +47 -0
- package/dist/src/proto/gen/dxos/echo/service.d.ts.map +1 -0
- package/dist/src/proto/gen/dxos/echo/service.js +3 -0
- package/dist/src/proto/gen/dxos/echo/service.js.map +1 -0
- package/dist/src/proto/gen/dxos/echo/snapshot.d.ts +51 -0
- package/dist/src/proto/gen/dxos/echo/snapshot.d.ts.map +1 -0
- package/dist/src/proto/gen/dxos/echo/snapshot.js +3 -0
- package/dist/src/proto/gen/dxos/echo/snapshot.js.map +1 -0
- package/dist/src/proto/gen/dxos/halo/keys.d.ts +59 -0
- package/dist/src/proto/gen/dxos/halo/keys.d.ts.map +1 -0
- package/dist/src/proto/gen/dxos/halo/keys.js +13 -0
- package/dist/src/proto/gen/dxos/halo/keys.js.map +1 -0
- package/dist/src/proto/gen/dxos/rpc.d.ts +41 -0
- package/dist/src/proto/gen/dxos/rpc.d.ts.map +1 -0
- package/dist/src/proto/gen/dxos/rpc.js +12 -0
- package/dist/src/proto/gen/dxos/rpc.js.map +1 -0
- package/dist/src/proto/gen/google/protobuf.d.ts +277 -0
- package/dist/src/proto/gen/google/protobuf.d.ts.map +1 -0
- package/dist/src/proto/gen/google/protobuf.js +58 -0
- package/dist/src/proto/gen/google/protobuf.js.map +1 -0
- package/dist/src/proto/gen/index.d.ts +249 -0
- package/dist/src/proto/gen/index.d.ts.map +1 -0
- package/dist/src/proto/gen/index.js +7 -0
- package/dist/src/proto/gen/index.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +35 -0
- package/src/index.ts +3 -0
- package/src/proto/dxos/bot.proto +120 -0
- package/src/proto/dxos/client.proto +237 -0
- package/src/proto/dxos/config.proto +254 -0
- package/src/proto/dxos/devtools.proto +271 -0
- package/src/proto/dxos/echo/feed.proto +93 -0
- package/src/proto/dxos/echo/invitation.proto +29 -0
- package/src/proto/dxos/echo/metadata.proto +30 -0
- package/src/proto/dxos/echo/service.proto +64 -0
- package/src/proto/dxos/echo/snapshot.proto +88 -0
- package/src/proto/dxos/halo/auth.proto +20 -0
- package/src/proto/dxos/halo/greet.proto +125 -0
- package/src/proto/dxos/halo/identity.proto +24 -0
- package/src/proto/dxos/halo/keys.proto +88 -0
- package/src/proto/dxos/halo/party.proto +127 -0
- package/src/proto/dxos/halo/signed.proto +42 -0
- package/src/proto/dxos/rpc.proto +59 -0
- package/src/proto/gen/dxos/bot.ts +120 -0
- package/src/proto/gen/dxos/client.ts +190 -0
- package/src/proto/gen/dxos/config.ts +225 -0
- package/src/proto/gen/dxos/credentials/auth.ts +26 -0
- package/src/proto/gen/dxos/credentials/greet.ts +53 -0
- package/src/proto/gen/dxos/credentials/identity.ts +25 -0
- package/src/proto/gen/dxos/credentials/party.ts +63 -0
- package/src/proto/gen/dxos/credentials.ts +39 -0
- package/src/proto/gen/dxos/devtools.ts +206 -0
- package/src/proto/gen/dxos/echo/feed.ts +84 -0
- package/src/proto/gen/dxos/echo/invitation.ts +36 -0
- package/src/proto/gen/dxos/echo/metadata.ts +33 -0
- package/src/proto/gen/dxos/echo/service.ts +59 -0
- package/src/proto/gen/dxos/echo/snapshot.ts +66 -0
- package/src/proto/gen/dxos/halo/keys.ts +74 -0
- package/src/proto/gen/dxos/rpc.ts +56 -0
- package/src/proto/gen/google/protobuf.ts +293 -0
- package/src/proto/gen/index.ts +248 -0
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2021 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
syntax = "proto3";
|
|
6
|
+
|
|
7
|
+
package dxos.devtools;
|
|
8
|
+
|
|
9
|
+
import "google/protobuf/empty.proto";
|
|
10
|
+
import "google/protobuf/timestamp.proto";
|
|
11
|
+
import "./echo/feed.proto";
|
|
12
|
+
import "./echo/snapshot.proto";
|
|
13
|
+
import "./halo/keys.proto";
|
|
14
|
+
import "./halo/signed.proto";
|
|
15
|
+
import "./rpc.proto";
|
|
16
|
+
|
|
17
|
+
service DevtoolsHost {
|
|
18
|
+
//
|
|
19
|
+
// General
|
|
20
|
+
//
|
|
21
|
+
|
|
22
|
+
// Subscribe to server-to-client events.
|
|
23
|
+
rpc Events(google.protobuf.Empty) returns (stream Event);
|
|
24
|
+
|
|
25
|
+
// Get client config.
|
|
26
|
+
rpc GetConfig(google.protobuf.Empty) returns (GetConfigResponse);
|
|
27
|
+
|
|
28
|
+
rpc ResetStorage(ResetStorageRequest) returns (google.protobuf.Empty);
|
|
29
|
+
|
|
30
|
+
rpc EnableDebugLogging(EnableDebugLoggingRequest) returns (EnableDebugLoggingResponse);
|
|
31
|
+
|
|
32
|
+
rpc DisableDebugLogging(EnableDebugLoggingRequest) returns (EnableDebugLoggingResponse);
|
|
33
|
+
|
|
34
|
+
//
|
|
35
|
+
// HALO
|
|
36
|
+
//
|
|
37
|
+
|
|
38
|
+
rpc SubscribeToKeyringKeys(SubscribeToKeyringKeysRequest) returns (stream SubscribeToKeyringKeysResponse);
|
|
39
|
+
|
|
40
|
+
rpc SubscribeToCredentialMessages(SubscribeToCredentialMessagesRequest) returns (stream SubscribeToCredentialMessagesResponse);
|
|
41
|
+
|
|
42
|
+
//
|
|
43
|
+
// ECHO
|
|
44
|
+
//
|
|
45
|
+
|
|
46
|
+
rpc SubscribeToParties(SubscribeToPartiesRequest) returns (stream SubscribeToPartiesResponse);
|
|
47
|
+
|
|
48
|
+
rpc SubscribeToItems(SubscribeToItemsRequest) returns (stream SubscribeToItemsResponse);
|
|
49
|
+
|
|
50
|
+
rpc SubscribeToFeeds(SubscribeToFeedsRequest) returns (stream SubscribeToFeedsResponse);
|
|
51
|
+
|
|
52
|
+
rpc SubscribeToFeed(SubscribeToFeedRequest) returns (stream SubscribeToFeedResponse);
|
|
53
|
+
|
|
54
|
+
rpc GetPartySnapshot(GetPartySnapshotRequest) returns (GetPartySnapshotResponse);
|
|
55
|
+
rpc SavePartySnapshot(SavePartySnapshotRequest) returns (SavePartySnapshotResponse);
|
|
56
|
+
rpc ClearSnapshots(ClearSnapshotsRequest) returns (google.protobuf.Empty);
|
|
57
|
+
|
|
58
|
+
//
|
|
59
|
+
// MESH
|
|
60
|
+
//
|
|
61
|
+
|
|
62
|
+
rpc GetNetworkPeers(GetNetworkPeersRequest) returns (GetNetworkPeersResponse);
|
|
63
|
+
|
|
64
|
+
rpc SubscribeToNetworkTopics(google.protobuf.Empty) returns (stream SubscribeToNetworkTopicsResponse);
|
|
65
|
+
|
|
66
|
+
rpc SubscribeToSignalStatus(google.protobuf.Empty) returns (stream SubscribeToSignalStatusResponse);
|
|
67
|
+
|
|
68
|
+
rpc SubscribeToSignalTrace(google.protobuf.Empty) returns (stream SubscribeToSignalTraceResponse);
|
|
69
|
+
|
|
70
|
+
rpc SubscribeToSwarmInfo(SubscribeToSwarmInfoRequest) returns (stream SubscribeToSwarmInfoResponse);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
message Event {
|
|
74
|
+
oneof payload {
|
|
75
|
+
ReadyEvent ready = 1;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
message ReadyEvent {}
|
|
80
|
+
|
|
81
|
+
message GetConfigResponse {
|
|
82
|
+
// JSON-encoded configuration object.
|
|
83
|
+
string config = 1;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
message EnableDebugLoggingRequest {
|
|
87
|
+
string namespaces = 1;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
message EnableDebugLoggingResponse {
|
|
91
|
+
string enabledNamespaces = 1;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
message DisableDebugLoggingRequest {
|
|
95
|
+
string namespaces = 1;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
message DisableDebugLoggingResponse {
|
|
99
|
+
string enabledNamespaces = 1;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
message SubscribeToKeyringKeysRequest {}
|
|
103
|
+
|
|
104
|
+
message SubscribeToKeyringKeysResponse {
|
|
105
|
+
repeated KeyRecord keys = 1;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
message SubscribeToCredentialMessagesRequest {
|
|
109
|
+
PubKey partyKey = 1;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
message SubscribeToCredentialMessagesResponse {
|
|
113
|
+
repeated SignedMessage messages = 1;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
message ResetStorageRequest {}
|
|
117
|
+
|
|
118
|
+
message GetNetworkPeersRequest {
|
|
119
|
+
bytes topic = 1;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
message GetNetworkPeersResponse {
|
|
123
|
+
message PeerInfo {
|
|
124
|
+
PubKey id = 1;
|
|
125
|
+
|
|
126
|
+
// PeerState enum.
|
|
127
|
+
string state = 2;
|
|
128
|
+
|
|
129
|
+
repeated bytes connections = 3;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
repeated PeerInfo peers = 1;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
message SubscribeToPartiesRequest {}
|
|
136
|
+
|
|
137
|
+
message SubscribeToPartiesResponse {
|
|
138
|
+
message PartyInfo {
|
|
139
|
+
string key = 1;
|
|
140
|
+
bool isOpen = 2;
|
|
141
|
+
bool isActive = 3;
|
|
142
|
+
int32 feedKeys = 4;
|
|
143
|
+
map<string, string> properties = 5;
|
|
144
|
+
|
|
145
|
+
TimeframeVector timeframe = 10;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
repeated PartyInfo parties = 1;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
message SubscribeToItemsRequest {}
|
|
152
|
+
|
|
153
|
+
message SubscribeToItemsResponse {
|
|
154
|
+
// JSON-encoded payload.
|
|
155
|
+
string data = 1;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
message SubscribeToFeedsRequest {}
|
|
159
|
+
|
|
160
|
+
message SubscribeToFeedsResponse {
|
|
161
|
+
message Party {
|
|
162
|
+
PubKey key = 1;
|
|
163
|
+
repeated PubKey feeds = 2;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
repeated Party parties = 1;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
message SubscribeToFeedRequest {
|
|
170
|
+
PubKey partyKey = 1;
|
|
171
|
+
PubKey feedKey = 2;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
message SubscribeToFeedResponse {
|
|
175
|
+
message EchoFeedBlock {
|
|
176
|
+
bytes key = 1;
|
|
177
|
+
int32 seq = 2;
|
|
178
|
+
bool sync = 3;
|
|
179
|
+
string path = 4;
|
|
180
|
+
FeedMessage data = 5;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
repeated EchoFeedBlock blocks = 1;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
message GetPartySnapshotRequest {
|
|
187
|
+
required PubKey partyKey = 1;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
message GetPartySnapshotResponse {
|
|
191
|
+
PartySnapshot snapshot = 1;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
message SavePartySnapshotRequest {
|
|
195
|
+
required PubKey partyKey = 1;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
message SavePartySnapshotResponse {
|
|
199
|
+
PartySnapshot snapshot = 1;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
message ClearSnapshotsRequest {}
|
|
203
|
+
|
|
204
|
+
message SubscribeToNetworkTopicsResponse {
|
|
205
|
+
message Topic {
|
|
206
|
+
PubKey topic = 1;
|
|
207
|
+
string label = 2;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
repeated Topic topics = 1;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
message SubscribeToSignalStatusResponse {
|
|
214
|
+
message SignalServer {
|
|
215
|
+
string host = 1;
|
|
216
|
+
|
|
217
|
+
// SignalApi.State enum.
|
|
218
|
+
string state = 2;
|
|
219
|
+
|
|
220
|
+
string error = 3;
|
|
221
|
+
|
|
222
|
+
// Number of milliseconds before reconnection.
|
|
223
|
+
// TODO(dmaretskyi): Represent as absolute timestamp.
|
|
224
|
+
int32 reconnectIn = 4;
|
|
225
|
+
|
|
226
|
+
// TODO(dmaretskyi): Change to timestamp.
|
|
227
|
+
int32 connectionStarted = 5;
|
|
228
|
+
int32 lastStateChange = 6;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
repeated SignalServer servers = 1;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
message SubscribeToSignalTraceResponse {
|
|
235
|
+
// JSON-encoded events.
|
|
236
|
+
repeated string events = 1;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
message SubscribeToSwarmInfoRequest {}
|
|
240
|
+
|
|
241
|
+
message SubscribeToSwarmInfoResponse {
|
|
242
|
+
// TODO(yivlad): Move these types to @dxos/network-manager and import them from there.
|
|
243
|
+
message SwarmInfo {
|
|
244
|
+
PubKey id = 1;
|
|
245
|
+
PubKey topic = 2;
|
|
246
|
+
string label = 3;
|
|
247
|
+
bool isActive = 4;
|
|
248
|
+
message ConnectionInfo {
|
|
249
|
+
message Json {
|
|
250
|
+
string data = 1;
|
|
251
|
+
}
|
|
252
|
+
string state = 1;
|
|
253
|
+
PubKey sessionId = 2;
|
|
254
|
+
PubKey remotePeerId = 3;
|
|
255
|
+
string transport = 4;
|
|
256
|
+
repeated string protocolExtensions = 5;
|
|
257
|
+
repeated Json events = 6;
|
|
258
|
+
}
|
|
259
|
+
repeated ConnectionInfo connections = 5;
|
|
260
|
+
}
|
|
261
|
+
repeated SwarmInfo data = 1;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
message SetTracingOptionsRequest {
|
|
265
|
+
bool enable = 1;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
service TracingService {
|
|
269
|
+
rpc SetTracingOptions(SetTracingOptionsRequest) returns (google.protobuf.Empty);
|
|
270
|
+
rpc SubscribeToRpcTrace (google.protobuf.Empty) returns (stream RpcMessage);
|
|
271
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2020 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
syntax = "proto3";
|
|
6
|
+
|
|
7
|
+
// TODO(burdon): Move Item specific to echo.item?
|
|
8
|
+
package dxos.echo.feed;
|
|
9
|
+
|
|
10
|
+
import "google/protobuf/any.proto";
|
|
11
|
+
import "./snapshot.proto";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Outer message type decoded by Codec.
|
|
15
|
+
* This is what is written to the feeds.
|
|
16
|
+
*/
|
|
17
|
+
message FeedMessage {
|
|
18
|
+
CredentialsMessage halo = 1;
|
|
19
|
+
EchoEnvelope echo = 2;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* A container for dxos.credentials.Message
|
|
24
|
+
*/
|
|
25
|
+
message CredentialsMessage {
|
|
26
|
+
// TODO(marik-d): Use a protobuf type from credentials.
|
|
27
|
+
bytes data = 1;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Vector timestamp used to order messages.
|
|
32
|
+
*/
|
|
33
|
+
message TimeframeVector {
|
|
34
|
+
message Frame {
|
|
35
|
+
// TODO(marik-d): Compress using numeric feed indexes.
|
|
36
|
+
// TODO(burdon): Determine if admit DAG can be ordered. Requires party messages to be ordered (by lexical feed key).
|
|
37
|
+
bytes feedKey = 1;
|
|
38
|
+
int32 seq = 3;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
repeated Frame frames = 1;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Wrapper for all ECHO messages.
|
|
46
|
+
*/
|
|
47
|
+
message EchoEnvelope {
|
|
48
|
+
string itemId = 1;
|
|
49
|
+
TimeframeVector timeframe = 2;
|
|
50
|
+
|
|
51
|
+
// Create item.
|
|
52
|
+
ItemGenesis genesis = 10;
|
|
53
|
+
|
|
54
|
+
// Item system mutations.
|
|
55
|
+
ItemMutation itemMutation = 11;
|
|
56
|
+
|
|
57
|
+
// Model-specific mutations.
|
|
58
|
+
bytes mutation = 12;
|
|
59
|
+
|
|
60
|
+
/// Set the model to the provided snapshot.
|
|
61
|
+
ModelSnapshot snapshot = 13;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// TODO(burdon): Document (different from parent/child).?
|
|
65
|
+
// TODO(dmaretskyi): Refactor so that entity mutation message is oneof between item mutation and link mutation: items have parents, and links have from/to.
|
|
66
|
+
message LinkData {
|
|
67
|
+
string source = 1;
|
|
68
|
+
string target = 2;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Item creation.
|
|
73
|
+
*/
|
|
74
|
+
message ItemGenesis {
|
|
75
|
+
string itemType = 1;
|
|
76
|
+
string modelType = 2;
|
|
77
|
+
string modelVersion = 3;
|
|
78
|
+
LinkData link = 4;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Item mutation.
|
|
83
|
+
*/
|
|
84
|
+
message ItemMutation {
|
|
85
|
+
enum Action {
|
|
86
|
+
NOOP = 0;
|
|
87
|
+
DELETE = 1;
|
|
88
|
+
RESTORE = 2;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
string parentId = 1; // TODO(burdon): Define Action type?
|
|
92
|
+
Action action = 2;
|
|
93
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
syntax = "proto3";
|
|
6
|
+
|
|
7
|
+
package dxos.echo.invitation;
|
|
8
|
+
|
|
9
|
+
message InvitationDescriptor {
|
|
10
|
+
/**
|
|
11
|
+
* Defines an invitation type.
|
|
12
|
+
*/
|
|
13
|
+
enum Type {
|
|
14
|
+
/// Interactive invitation is when both peers are online at the same time.
|
|
15
|
+
INTERACTIVE = 1;
|
|
16
|
+
/// Offline is when only a single peer needs to be online at the time.
|
|
17
|
+
OFFLINE = 2;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
Type type = 1;
|
|
21
|
+
bytes swarmKey = 2;
|
|
22
|
+
bytes invitation = 3;
|
|
23
|
+
|
|
24
|
+
/// Only present if type == OFFLINE.
|
|
25
|
+
bytes identityKey = 4;
|
|
26
|
+
|
|
27
|
+
/// Must be stripped out when passing to another peer.
|
|
28
|
+
bytes secret = 5;
|
|
29
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2021 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
syntax = "proto3";
|
|
6
|
+
|
|
7
|
+
package dxos.echo.metadata;
|
|
8
|
+
|
|
9
|
+
import "google/protobuf/timestamp.proto";
|
|
10
|
+
import "../halo/keys.proto";
|
|
11
|
+
|
|
12
|
+
message EchoMetadata {
|
|
13
|
+
/**
|
|
14
|
+
* Version number that is inceremnted every time there's a breaking change to the storage schema.
|
|
15
|
+
*
|
|
16
|
+
* This is used to detect if the storage schema has changed since the last time the client was run.
|
|
17
|
+
* Loading data from a different version will might result in an error.
|
|
18
|
+
*/
|
|
19
|
+
int32 version = 1;
|
|
20
|
+
|
|
21
|
+
repeated PartyMetadata parties = 2;
|
|
22
|
+
|
|
23
|
+
google.protobuf.Timestamp created = 3;
|
|
24
|
+
google.protobuf.Timestamp updated = 4;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
message PartyMetadata {
|
|
28
|
+
PubKey key = 1;
|
|
29
|
+
repeated PubKey feedKeys = 2;
|
|
30
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2021 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
syntax = "proto3";
|
|
6
|
+
|
|
7
|
+
import "../halo/keys.proto";
|
|
8
|
+
import "feed.proto";
|
|
9
|
+
import "snapshot.proto";
|
|
10
|
+
|
|
11
|
+
package dxos.echo.service;
|
|
12
|
+
|
|
13
|
+
message SubscribeEntitySetRequest {
|
|
14
|
+
PubKey partyKey = 1;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
message SubscribeEntitySetResponse {
|
|
18
|
+
// TODO(dmaretskyi): This is wrong, the first one should use item snapshot, and deleted should be just list of ids.
|
|
19
|
+
repeated EchoEnvelope added = 1;
|
|
20
|
+
repeated EchoEnvelope deleted = 2;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
message SubscribeEntityStreamRequest {
|
|
24
|
+
PubKey partyKey = 1;
|
|
25
|
+
string itemId = 2;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
message SubscribeEntityStreamResponse {
|
|
29
|
+
message Mutation {
|
|
30
|
+
message Metadata {
|
|
31
|
+
PubKey feedKey = 1;
|
|
32
|
+
PubKey memberKey = 2;
|
|
33
|
+
int32 seq = 3;
|
|
34
|
+
TimeframeVector timeframe = 4;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
EchoEnvelope data = 1;
|
|
38
|
+
Metadata meta = 2;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
oneof kind {
|
|
42
|
+
// TODO(dmaretskyi): Move spanshot into EchoEnvelope?
|
|
43
|
+
ItemSnapshot snapshot = 1;
|
|
44
|
+
Mutation mutation = 2;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
message WriteRequest {
|
|
49
|
+
PubKey partyKey = 1;
|
|
50
|
+
EchoEnvelope mutation = 2;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
message MutationReceipt {
|
|
54
|
+
PubKey feedKey = 1;
|
|
55
|
+
int32 seq = 2;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
service DataService {
|
|
59
|
+
rpc SubscribeEntitySet(SubscribeEntitySetRequest) returns (stream SubscribeEntitySetResponse);
|
|
60
|
+
|
|
61
|
+
rpc SubscribeEntityStream(SubscribeEntityStreamRequest) returns (stream SubscribeEntityStreamResponse);
|
|
62
|
+
|
|
63
|
+
rpc Write(WriteRequest) returns (MutationReceipt);
|
|
64
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2020 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
syntax = "proto3";
|
|
6
|
+
|
|
7
|
+
package dxos.echo.snapshot;
|
|
8
|
+
|
|
9
|
+
import "feed.proto";
|
|
10
|
+
|
|
11
|
+
//
|
|
12
|
+
// Snapshots define full party state at a given point in time.
|
|
13
|
+
// They must have enough information to be able to recover the party state without reading the feed messages.
|
|
14
|
+
//
|
|
15
|
+
// Each snapshot is identified by a party key and a timeframe.
|
|
16
|
+
// The timeframe defines the set of feed messages that have already been processed.
|
|
17
|
+
// When loading from the snapshot, application would skip all of the feed messages up to (and including) the provided timeframe.
|
|
18
|
+
//
|
|
19
|
+
|
|
20
|
+
message PartySnapshot {
|
|
21
|
+
bytes partyKey = 1;
|
|
22
|
+
TimeframeVector timeframe = 2;
|
|
23
|
+
|
|
24
|
+
// Unix timestamp of the snapshot creation time. For information purposes only.
|
|
25
|
+
int32 timestamp = 3;
|
|
26
|
+
|
|
27
|
+
HaloStateSnapshot halo = 11;
|
|
28
|
+
// TODO(dmaretskyi): Rename to EchoSnapshot.
|
|
29
|
+
DatabaseSnapshot database = 12;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
message DatabaseSnapshot {
|
|
33
|
+
repeated ItemSnapshot items = 1;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// TODO(dmaretskyi): Rename to HaloSnapshot.
|
|
37
|
+
// For now we just store and replay a list of all halo messages as thier number is expected to be relatively low.
|
|
38
|
+
message HaloStateSnapshot {
|
|
39
|
+
repeated dxos.CredentialsMessage messages = 1;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
message ItemSnapshot {
|
|
43
|
+
string itemId = 1;
|
|
44
|
+
|
|
45
|
+
string itemType = 2;
|
|
46
|
+
string modelType = 3;
|
|
47
|
+
string modelVersion = 4;
|
|
48
|
+
|
|
49
|
+
string parentId = 5;
|
|
50
|
+
|
|
51
|
+
// TODO(burdon): = 10 (make room for other meta?)
|
|
52
|
+
ModelSnapshot model = 6;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Represents the reified state of a state machine.
|
|
57
|
+
* The snapshots make consist of a custom snapshot object and/or a list of mutations
|
|
58
|
+
* that are applied to the snapshot or the initial state.
|
|
59
|
+
*/
|
|
60
|
+
message ModelSnapshot {
|
|
61
|
+
/**
|
|
62
|
+
* Encoded model snapshot (defined by the model's codec).
|
|
63
|
+
* If undefined the state machine will be initialized with it's default state.
|
|
64
|
+
*/
|
|
65
|
+
optional bytes snapshot = 1;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Mutations to be applied on top of the snapshot, or on top of initial state if the snapshot is undefined.
|
|
69
|
+
*/
|
|
70
|
+
repeated ModelMutation mutations = 2;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
message ModelMutation {
|
|
74
|
+
// TODO(burdon): Remove required.
|
|
75
|
+
// Encoded model mutation, format is defined by model's codec.
|
|
76
|
+
required bytes mutation = 1;
|
|
77
|
+
required ModelMutationMeta meta = 2;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
message ModelMutationMeta {
|
|
81
|
+
// TODO(burdon): Remove required.
|
|
82
|
+
required bytes feedKey = 1;
|
|
83
|
+
required int32 seq = 2;
|
|
84
|
+
required bytes memberKey = 3;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2020 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
syntax = "proto3";
|
|
6
|
+
|
|
7
|
+
package dxos.credentials.auth;
|
|
8
|
+
|
|
9
|
+
import "keys.proto";
|
|
10
|
+
import "signed.proto";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The payload for a SignedMessage sent during handshake for replication authentication.
|
|
14
|
+
*/
|
|
15
|
+
message Auth {
|
|
16
|
+
PubKey partyKey = 1; // The publicKey of the target Party for these credentials.
|
|
17
|
+
PubKey deviceKey = 2; // The publicKey of the authenticating Device.
|
|
18
|
+
PubKey identityKey = 3; // The publicKey of the authenticating Identity.
|
|
19
|
+
PubKey feedKey = 4; // The publicKey of the authenticating Identity.
|
|
20
|
+
}
|