@dxos/protocols 0.3.11-main.0b0bfb1 → 0.3.11-main.0e02eb0
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/cjs/src/errors/base-errors.d.ts.map +1 -1
- package/dist/cjs/src/errors/base-errors.js.map +1 -1
- package/dist/cjs/src/errors/errors.d.ts +3 -0
- package/dist/cjs/src/errors/errors.d.ts.map +1 -1
- package/dist/cjs/src/errors/errors.js +8 -1
- package/dist/cjs/src/errors/errors.js.map +1 -1
- package/dist/cjs/src/proto/gen/dxos/client/services.d.ts +83 -1
- package/dist/cjs/src/proto/gen/dxos/client/services.d.ts.map +1 -1
- package/dist/cjs/src/proto/gen/dxos/client/services.js +14 -1
- package/dist/cjs/src/proto/gen/dxos/client/services.js.map +1 -1
- package/dist/cjs/src/proto/gen/index.d.ts +3 -0
- package/dist/cjs/src/proto/gen/index.d.ts.map +1 -1
- package/dist/cjs/src/proto/gen/index.js +1 -1
- package/dist/cjs/src/proto/gen/index.js.map +1 -1
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/src/errors/base-errors.d.ts.map +1 -1
- package/dist/esm/src/errors/base-errors.js.map +1 -1
- package/dist/esm/src/errors/errors.d.ts +3 -0
- package/dist/esm/src/errors/errors.d.ts.map +1 -1
- package/dist/esm/src/errors/errors.js +6 -0
- package/dist/esm/src/errors/errors.js.map +1 -1
- package/dist/esm/src/proto/gen/dxos/client/services.d.ts +83 -1
- package/dist/esm/src/proto/gen/dxos/client/services.d.ts.map +1 -1
- package/dist/esm/src/proto/gen/dxos/client/services.js +13 -0
- package/dist/esm/src/proto/gen/dxos/client/services.js.map +1 -1
- package/dist/esm/src/proto/gen/index.d.ts +3 -0
- package/dist/esm/src/proto/gen/index.d.ts.map +1 -1
- package/dist/esm/src/proto/gen/index.js +1 -1
- package/dist/esm/src/proto/gen/index.js.map +1 -1
- package/package.json +5 -5
- package/src/errors/base-errors.ts +5 -1
- package/src/errors/errors.ts +8 -0
- package/src/proto/dxos/client/services.proto +33 -1
- package/src/proto/gen/dxos/client/services.ts +82 -1
- package/src/proto/gen/index.ts +4 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/proto/gen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AA6DhE,OAAO,aAAa,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/proto/gen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AA6DhE,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAohB7C,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,oimGAAoimG,CAAC,CAAC,CAAC;AAC7lmG,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAkB,UAAU,EAAE,aAAa,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/protocols",
|
|
3
|
-
"version": "0.3.11-main.
|
|
3
|
+
"version": "0.3.11-main.0e02eb0",
|
|
4
4
|
"description": "Protobuf definitions for DXOS protocols.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"src"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@dxos/
|
|
37
|
-
"@dxos/
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/
|
|
36
|
+
"@dxos/keys": "0.3.11-main.0e02eb0",
|
|
37
|
+
"@dxos/codec-protobuf": "0.3.11-main.0e02eb0",
|
|
38
|
+
"@dxos/timeframe": "0.3.11-main.0e02eb0",
|
|
39
|
+
"@dxos/invariant": "0.3.11-main.0e02eb0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"glob": "~7.1.6"
|
|
@@ -7,7 +7,11 @@
|
|
|
7
7
|
* Errors can optionally include a JSON context object.
|
|
8
8
|
*/
|
|
9
9
|
export class BaseError extends Error {
|
|
10
|
-
constructor(
|
|
10
|
+
constructor(
|
|
11
|
+
readonly code: string,
|
|
12
|
+
message?: string,
|
|
13
|
+
readonly context?: Record<string, any>,
|
|
14
|
+
) {
|
|
11
15
|
super(message ?? code);
|
|
12
16
|
this.name = code;
|
|
13
17
|
// NOTE: Restores prototype chain (https://stackoverflow.com/a/48342359).
|
package/src/errors/errors.ts
CHANGED
|
@@ -100,6 +100,14 @@ export class InvalidInvitationError extends DatabaseError {
|
|
|
100
100
|
|
|
101
101
|
registerErrorMessageContext('INVALID_INVITATION', InvalidInvitationError);
|
|
102
102
|
|
|
103
|
+
export class AlreadyJoinedError extends DatabaseError {
|
|
104
|
+
constructor(message?: string, context?: Record<string, any>) {
|
|
105
|
+
super('ALREADY_JOINED', message, context);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
registerErrorMessageContext('ALREADY_JOINED', AlreadyJoinedError);
|
|
110
|
+
|
|
103
111
|
export class ConnectionResetError extends BaseError {
|
|
104
112
|
constructor(message?: string, context?: any) {
|
|
105
113
|
super('CONNECTION_RESET', message, context);
|
|
@@ -19,6 +19,7 @@ import "dxos/mesh/signal.proto";
|
|
|
19
19
|
import "dxos/mesh/teleport/gossip.proto";
|
|
20
20
|
import "dxos/mesh/presence.proto";
|
|
21
21
|
import "dxos/value.proto";
|
|
22
|
+
import "dxos/devtools/swarm.proto";
|
|
22
23
|
|
|
23
24
|
// TODO(burdon): Reorganize packages (e.g., client.services, echo.database).
|
|
24
25
|
|
|
@@ -63,6 +64,28 @@ message GetDiagnosticsResponse {
|
|
|
63
64
|
google.protobuf.Struct diagnostics = 2;
|
|
64
65
|
}
|
|
65
66
|
|
|
67
|
+
message Platform {
|
|
68
|
+
enum PLATFORM_TYPE {
|
|
69
|
+
BROWSER = 0;
|
|
70
|
+
SHARED_WORKER = 1;
|
|
71
|
+
NODE = 2;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
PLATFORM_TYPE type = 1;
|
|
75
|
+
/// The User-Agent string from a browser
|
|
76
|
+
optional string user_agent = 2;
|
|
77
|
+
/// e.g process.platform from node, e.g. 'darwin', 'linux', 'win32'
|
|
78
|
+
optional string platform = 3;
|
|
79
|
+
/// the Node.JS arch string, e.g. 'arm64', 'x64'
|
|
80
|
+
optional string arch = 4;
|
|
81
|
+
/// the node.js version string
|
|
82
|
+
optional string runtime = 5;
|
|
83
|
+
// TODO(nf): uint64? :)
|
|
84
|
+
/// the number of seconds the client has been up
|
|
85
|
+
optional uint32 uptime = 6;
|
|
86
|
+
/// e.g. NodeJS.MemoryUsage, subject to change
|
|
87
|
+
optional google.protobuf.Struct memory = 7;
|
|
88
|
+
}
|
|
66
89
|
//
|
|
67
90
|
// System
|
|
68
91
|
//
|
|
@@ -82,6 +105,9 @@ service SystemService {
|
|
|
82
105
|
|
|
83
106
|
/// Reset the client.
|
|
84
107
|
rpc Reset(google.protobuf.Empty) returns (google.protobuf.Empty);
|
|
108
|
+
|
|
109
|
+
/// Get platform Information
|
|
110
|
+
rpc GetPlatform(google.protobuf.Empty) returns (Platform);
|
|
85
111
|
}
|
|
86
112
|
|
|
87
113
|
//
|
|
@@ -107,9 +133,14 @@ message SignPresentationRequest {
|
|
|
107
133
|
optional bytes nonce = 2;
|
|
108
134
|
}
|
|
109
135
|
|
|
136
|
+
message CreateIdentityRequest {
|
|
137
|
+
optional halo.credentials.ProfileDocument profile = 1;
|
|
138
|
+
optional bool use_automerge = 2;
|
|
139
|
+
}
|
|
140
|
+
|
|
110
141
|
// TODO(wittjosiah): Align pluralization with other services.
|
|
111
142
|
service IdentityService {
|
|
112
|
-
rpc CreateIdentity(
|
|
143
|
+
rpc CreateIdentity(CreateIdentityRequest) returns (Identity);
|
|
113
144
|
rpc RecoverIdentity(RecoverIdentityRequest) returns (Identity);
|
|
114
145
|
rpc QueryIdentity(google.protobuf.Empty) returns (stream QueryIdentityResponse);
|
|
115
146
|
rpc UpdateProfile(halo.credentials.ProfileDocument) returns (Identity);
|
|
@@ -471,6 +502,7 @@ message NetworkStatus {
|
|
|
471
502
|
|
|
472
503
|
ConnectionState swarm = 1;
|
|
473
504
|
repeated Signal signaling = 2;
|
|
505
|
+
repeated dxos.devtools.swarm.SwarmInfo connection_info = 3;
|
|
474
506
|
}
|
|
475
507
|
|
|
476
508
|
message UpdateConfigRequest {
|
|
@@ -297,6 +297,66 @@ export interface GetDiagnosticsResponse {
|
|
|
297
297
|
timestamp: ReturnType<(typeof substitutions)["google.protobuf.Timestamp"]["decode"]>;
|
|
298
298
|
diagnostics: ReturnType<(typeof substitutions)["google.protobuf.Struct"]["decode"]>;
|
|
299
299
|
}
|
|
300
|
+
/**
|
|
301
|
+
* Defined in:
|
|
302
|
+
* {@link file://./../../../dxos/client/services.proto}
|
|
303
|
+
*/
|
|
304
|
+
export interface Platform {
|
|
305
|
+
type: Platform.PLATFORM_TYPE;
|
|
306
|
+
/**
|
|
307
|
+
* The User-Agent string from a browser
|
|
308
|
+
*
|
|
309
|
+
* Options:
|
|
310
|
+
* - proto3_optional = true
|
|
311
|
+
*/
|
|
312
|
+
userAgent?: string;
|
|
313
|
+
/**
|
|
314
|
+
* e.g process.platform from node, e.g. 'darwin', 'linux', 'win32'
|
|
315
|
+
*
|
|
316
|
+
* Options:
|
|
317
|
+
* - proto3_optional = true
|
|
318
|
+
*/
|
|
319
|
+
platform?: string;
|
|
320
|
+
/**
|
|
321
|
+
* the Node.JS arch string, e.g. 'arm64', 'x64'
|
|
322
|
+
*
|
|
323
|
+
* Options:
|
|
324
|
+
* - proto3_optional = true
|
|
325
|
+
*/
|
|
326
|
+
arch?: string;
|
|
327
|
+
/**
|
|
328
|
+
* the node.js version string
|
|
329
|
+
*
|
|
330
|
+
* Options:
|
|
331
|
+
* - proto3_optional = true
|
|
332
|
+
*/
|
|
333
|
+
runtime?: string;
|
|
334
|
+
/**
|
|
335
|
+
* the number of seconds the client has been up
|
|
336
|
+
*
|
|
337
|
+
* Options:
|
|
338
|
+
* - proto3_optional = true
|
|
339
|
+
*/
|
|
340
|
+
uptime?: number;
|
|
341
|
+
/**
|
|
342
|
+
* e.g. NodeJS.MemoryUsage, subject to change
|
|
343
|
+
*
|
|
344
|
+
* Options:
|
|
345
|
+
* - proto3_optional = true
|
|
346
|
+
*/
|
|
347
|
+
memory?: ReturnType<(typeof substitutions)["google.protobuf.Struct"]["decode"]>;
|
|
348
|
+
}
|
|
349
|
+
export namespace Platform {
|
|
350
|
+
/**
|
|
351
|
+
* Defined in:
|
|
352
|
+
* {@link file://./../../../dxos/client/services.proto}
|
|
353
|
+
*/
|
|
354
|
+
export enum PLATFORM_TYPE {
|
|
355
|
+
BROWSER = 0,
|
|
356
|
+
SHARED_WORKER = 1,
|
|
357
|
+
NODE = 2
|
|
358
|
+
}
|
|
359
|
+
}
|
|
300
360
|
/**
|
|
301
361
|
* Defined in:
|
|
302
362
|
* {@link file://./../../../dxos/client/services.proto}
|
|
@@ -322,6 +382,10 @@ export interface SystemService {
|
|
|
322
382
|
* Reset the client.
|
|
323
383
|
*/
|
|
324
384
|
reset: (request: void, options?: RequestOptions) => Promise<void>;
|
|
385
|
+
/**
|
|
386
|
+
* Get platform Information
|
|
387
|
+
*/
|
|
388
|
+
getPlatform: (request: void, options?: RequestOptions) => Promise<Platform>;
|
|
325
389
|
}
|
|
326
390
|
/**
|
|
327
391
|
* Defined in:
|
|
@@ -370,12 +434,28 @@ export interface SignPresentationRequest {
|
|
|
370
434
|
*/
|
|
371
435
|
nonce?: Uint8Array;
|
|
372
436
|
}
|
|
437
|
+
/**
|
|
438
|
+
* Defined in:
|
|
439
|
+
* {@link file://./../../../dxos/client/services.proto}
|
|
440
|
+
*/
|
|
441
|
+
export interface CreateIdentityRequest {
|
|
442
|
+
/**
|
|
443
|
+
* Options:
|
|
444
|
+
* - proto3_optional = true
|
|
445
|
+
*/
|
|
446
|
+
profile?: dxos_halo_credentials.ProfileDocument;
|
|
447
|
+
/**
|
|
448
|
+
* Options:
|
|
449
|
+
* - proto3_optional = true
|
|
450
|
+
*/
|
|
451
|
+
useAutomerge?: boolean;
|
|
452
|
+
}
|
|
373
453
|
/**
|
|
374
454
|
* Defined in:
|
|
375
455
|
* {@link file://./../../../dxos/client/services.proto}
|
|
376
456
|
*/
|
|
377
457
|
export interface IdentityService {
|
|
378
|
-
createIdentity: (request:
|
|
458
|
+
createIdentity: (request: CreateIdentityRequest, options?: RequestOptions) => Promise<Identity>;
|
|
379
459
|
recoverIdentity: (request: RecoverIdentityRequest, options?: RequestOptions) => Promise<Identity>;
|
|
380
460
|
queryIdentity: (request: void, options?: RequestOptions) => Stream<QueryIdentityResponse>;
|
|
381
461
|
updateProfile: (request: dxos_halo_credentials.ProfileDocument, options?: RequestOptions) => Promise<Identity>;
|
|
@@ -924,6 +1004,7 @@ export enum ConnectionState {
|
|
|
924
1004
|
export interface NetworkStatus {
|
|
925
1005
|
swarm: ConnectionState;
|
|
926
1006
|
signaling?: NetworkStatus.Signal[];
|
|
1007
|
+
connectionInfo?: dxos_devtools_swarm.SwarmInfo[];
|
|
927
1008
|
}
|
|
928
1009
|
export namespace NetworkStatus {
|
|
929
1010
|
/**
|