@dxos/protocols 0.3.11-main.ec7a2b3 → 0.3.11-main.ee2b64c

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.
Files changed (45) hide show
  1. package/dist/cjs/src/errors/base-errors.d.ts.map +1 -1
  2. package/dist/cjs/src/errors/base-errors.js.map +1 -1
  3. package/dist/cjs/src/errors/errors.d.ts +3 -0
  4. package/dist/cjs/src/errors/errors.d.ts.map +1 -1
  5. package/dist/cjs/src/errors/errors.js +8 -1
  6. package/dist/cjs/src/errors/errors.js.map +1 -1
  7. package/dist/cjs/src/proto/gen/dxos/client/services.d.ts +83 -1
  8. package/dist/cjs/src/proto/gen/dxos/client/services.d.ts.map +1 -1
  9. package/dist/cjs/src/proto/gen/dxos/client/services.js +14 -1
  10. package/dist/cjs/src/proto/gen/dxos/client/services.js.map +1 -1
  11. package/dist/cjs/src/proto/gen/dxos/devtools/host.d.ts +31 -31
  12. package/dist/cjs/src/proto/gen/dxos/devtools/host.d.ts.map +1 -1
  13. package/dist/cjs/src/proto/gen/google/protobuf.d.ts +4 -4
  14. package/dist/cjs/src/proto/gen/google/protobuf.d.ts.map +1 -1
  15. package/dist/cjs/src/proto/gen/index.d.ts +3 -0
  16. package/dist/cjs/src/proto/gen/index.d.ts.map +1 -1
  17. package/dist/cjs/src/proto/gen/index.js +1 -1
  18. package/dist/cjs/src/proto/gen/index.js.map +1 -1
  19. package/dist/cjs/tsconfig.tsbuildinfo +1 -1
  20. package/dist/esm/src/errors/base-errors.d.ts.map +1 -1
  21. package/dist/esm/src/errors/base-errors.js.map +1 -1
  22. package/dist/esm/src/errors/errors.d.ts +3 -0
  23. package/dist/esm/src/errors/errors.d.ts.map +1 -1
  24. package/dist/esm/src/errors/errors.js +6 -0
  25. package/dist/esm/src/errors/errors.js.map +1 -1
  26. package/dist/esm/src/proto/gen/dxos/client/services.d.ts +83 -1
  27. package/dist/esm/src/proto/gen/dxos/client/services.d.ts.map +1 -1
  28. package/dist/esm/src/proto/gen/dxos/client/services.js +13 -0
  29. package/dist/esm/src/proto/gen/dxos/client/services.js.map +1 -1
  30. package/dist/esm/src/proto/gen/dxos/devtools/host.d.ts +31 -31
  31. package/dist/esm/src/proto/gen/dxos/devtools/host.d.ts.map +1 -1
  32. package/dist/esm/src/proto/gen/google/protobuf.d.ts +4 -4
  33. package/dist/esm/src/proto/gen/google/protobuf.d.ts.map +1 -1
  34. package/dist/esm/src/proto/gen/index.d.ts +3 -0
  35. package/dist/esm/src/proto/gen/index.d.ts.map +1 -1
  36. package/dist/esm/src/proto/gen/index.js +1 -1
  37. package/dist/esm/src/proto/gen/index.js.map +1 -1
  38. package/package.json +5 -5
  39. package/src/errors/base-errors.ts +5 -1
  40. package/src/errors/errors.ts +8 -0
  41. package/src/proto/dxos/client/services.proto +33 -1
  42. package/src/proto/gen/dxos/client/services.ts +82 -1
  43. package/src/proto/gen/dxos/devtools/host.ts +31 -31
  44. package/src/proto/gen/google/protobuf.ts +4 -4
  45. 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;AAihB7C,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,s4jGAAs4jG,CAAC,CAAC,CAAC;AAC/7jG,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAkB,UAAU,EAAE,aAAa,CAAC,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.ec7a2b3",
3
+ "version": "0.3.11-main.ee2b64c",
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/invariant": "0.3.11-main.ec7a2b3",
37
- "@dxos/codec-protobuf": "0.3.11-main.ec7a2b3",
38
- "@dxos/timeframe": "0.3.11-main.ec7a2b3",
39
- "@dxos/keys": "0.3.11-main.ec7a2b3"
36
+ "@dxos/codec-protobuf": "0.3.11-main.ee2b64c",
37
+ "@dxos/keys": "0.3.11-main.ee2b64c",
38
+ "@dxos/invariant": "0.3.11-main.ee2b64c",
39
+ "@dxos/timeframe": "0.3.11-main.ee2b64c"
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(readonly code: string, message?: string, readonly context?: Record<string, any>) {
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).
@@ -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(halo.credentials.ProfileDocument) returns (Identity);
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 {
@@ -122,6 +122,66 @@ export interface GetDiagnosticsResponse {
122
122
  timestamp: ReturnType<(typeof substitutions)["google.protobuf.Timestamp"]["decode"]>;
123
123
  diagnostics: ReturnType<(typeof substitutions)["google.protobuf.Struct"]["decode"]>;
124
124
  }
125
+ /**
126
+ * Defined in:
127
+ * {@link file://./../../../dxos/client/services.proto}
128
+ */
129
+ export interface Platform {
130
+ type: Platform.PLATFORM_TYPE;
131
+ /**
132
+ * The User-Agent string from a browser
133
+ *
134
+ * Options:
135
+ * - proto3_optional = true
136
+ */
137
+ userAgent?: string;
138
+ /**
139
+ * e.g process.platform from node, e.g. 'darwin', 'linux', 'win32'
140
+ *
141
+ * Options:
142
+ * - proto3_optional = true
143
+ */
144
+ platform?: string;
145
+ /**
146
+ * the Node.JS arch string, e.g. 'arm64', 'x64'
147
+ *
148
+ * Options:
149
+ * - proto3_optional = true
150
+ */
151
+ arch?: string;
152
+ /**
153
+ * the node.js version string
154
+ *
155
+ * Options:
156
+ * - proto3_optional = true
157
+ */
158
+ runtime?: string;
159
+ /**
160
+ * the number of seconds the client has been up
161
+ *
162
+ * Options:
163
+ * - proto3_optional = true
164
+ */
165
+ uptime?: number;
166
+ /**
167
+ * e.g. NodeJS.MemoryUsage, subject to change
168
+ *
169
+ * Options:
170
+ * - proto3_optional = true
171
+ */
172
+ memory?: ReturnType<(typeof substitutions)["google.protobuf.Struct"]["decode"]>;
173
+ }
174
+ export namespace Platform {
175
+ /**
176
+ * Defined in:
177
+ * {@link file://./../../../dxos/client/services.proto}
178
+ */
179
+ export enum PLATFORM_TYPE {
180
+ BROWSER = 0,
181
+ SHARED_WORKER = 1,
182
+ NODE = 2
183
+ }
184
+ }
125
185
  /**
126
186
  * Defined in:
127
187
  * {@link file://./../../../dxos/client/services.proto}
@@ -147,6 +207,10 @@ export interface SystemService {
147
207
  * Reset the client.
148
208
  */
149
209
  reset: (request: void, options?: RequestOptions) => Promise<void>;
210
+ /**
211
+ * Get platform Information
212
+ */
213
+ getPlatform: (request: void, options?: RequestOptions) => Promise<Platform>;
150
214
  }
151
215
  /**
152
216
  * Defined in:
@@ -195,12 +259,28 @@ export interface SignPresentationRequest {
195
259
  */
196
260
  nonce?: Uint8Array;
197
261
  }
262
+ /**
263
+ * Defined in:
264
+ * {@link file://./../../../dxos/client/services.proto}
265
+ */
266
+ export interface CreateIdentityRequest {
267
+ /**
268
+ * Options:
269
+ * - proto3_optional = true
270
+ */
271
+ profile?: dxos_halo_credentials.ProfileDocument;
272
+ /**
273
+ * Options:
274
+ * - proto3_optional = true
275
+ */
276
+ useAutomerge?: boolean;
277
+ }
198
278
  /**
199
279
  * Defined in:
200
280
  * {@link file://./../../../dxos/client/services.proto}
201
281
  */
202
282
  export interface IdentityService {
203
- createIdentity: (request: dxos_halo_credentials.ProfileDocument, options?: RequestOptions) => Promise<Identity>;
283
+ createIdentity: (request: CreateIdentityRequest, options?: RequestOptions) => Promise<Identity>;
204
284
  recoverIdentity: (request: RecoverIdentityRequest, options?: RequestOptions) => Promise<Identity>;
205
285
  queryIdentity: (request: void, options?: RequestOptions) => Stream<QueryIdentityResponse>;
206
286
  updateProfile: (request: dxos_halo_credentials.ProfileDocument, options?: RequestOptions) => Promise<Identity>;
@@ -749,6 +829,7 @@ export enum ConnectionState {
749
829
  export interface NetworkStatus {
750
830
  swarm: ConnectionState;
751
831
  signaling?: NetworkStatus.Signal[];
832
+ connectionInfo?: dxos_devtools_swarm.SwarmInfo[];
752
833
  }
753
834
  export namespace NetworkStatus {
754
835
  /**
@@ -59,6 +59,37 @@ import * as dxos_value from "../value";
59
59
  import * as example_testing_data from "../../example/testing/data";
60
60
  import * as example_testing_rpc from "../../example/testing/rpc";
61
61
  import * as google_protobuf from "../../google/protobuf";
62
+ /**
63
+ * Defined in:
64
+ * {@link file://./../../../dxos/devtools/diagnostics.proto}
65
+ */
66
+ export interface Services {
67
+ spaces?: SpaceStats[];
68
+ }
69
+ /**
70
+ * Defined in:
71
+ * {@link file://./../../../dxos/devtools/diagnostics.proto}
72
+ */
73
+ export interface SpaceStats {
74
+ key: ReturnType<(typeof substitutions)["dxos.keys.PublicKey"]["decode"]>;
75
+ peers?: PeerStats[];
76
+ }
77
+ /**
78
+ * Defined in:
79
+ * {@link file://./../../../dxos/devtools/diagnostics.proto}
80
+ */
81
+ export interface PeerStats {
82
+ controlFeed: FeedStats;
83
+ dataFeed: FeedStats;
84
+ }
85
+ /**
86
+ * Defined in:
87
+ * {@link file://./../../../dxos/devtools/diagnostics.proto}
88
+ */
89
+ export interface FeedStats {
90
+ key: ReturnType<(typeof substitutions)["dxos.keys.PublicKey"]["decode"]>;
91
+ length: number;
92
+ }
62
93
  /**
63
94
  * Defined in:
64
95
  * {@link file://./../../../dxos/devtools/host.proto}
@@ -481,34 +512,3 @@ export interface SubscribeToSwarmInfoRequest {
481
512
  export interface SubscribeToSwarmInfoResponse {
482
513
  data?: dxos_devtools_swarm.SwarmInfo[];
483
514
  }
484
- /**
485
- * Defined in:
486
- * {@link file://./../../../dxos/devtools/diagnostics.proto}
487
- */
488
- export interface Services {
489
- spaces?: SpaceStats[];
490
- }
491
- /**
492
- * Defined in:
493
- * {@link file://./../../../dxos/devtools/diagnostics.proto}
494
- */
495
- export interface SpaceStats {
496
- key: ReturnType<(typeof substitutions)["dxos.keys.PublicKey"]["decode"]>;
497
- peers?: PeerStats[];
498
- }
499
- /**
500
- * Defined in:
501
- * {@link file://./../../../dxos/devtools/diagnostics.proto}
502
- */
503
- export interface PeerStats {
504
- controlFeed: FeedStats;
505
- dataFeed: FeedStats;
506
- }
507
- /**
508
- * Defined in:
509
- * {@link file://./../../../dxos/devtools/diagnostics.proto}
510
- */
511
- export interface FeedStats {
512
- key: ReturnType<(typeof substitutions)["dxos.keys.PublicKey"]["decode"]>;
513
- length: number;
514
- }
@@ -78,14 +78,14 @@ export enum NullValue {
78
78
  export interface ListValue {
79
79
  values?: Value[];
80
80
  }
81
- export interface Timestamp {
82
- seconds: string;
83
- nanos: number;
84
- }
85
81
  export interface Any {
86
82
  type_url: string;
87
83
  value: Uint8Array;
88
84
  }
85
+ export interface Timestamp {
86
+ seconds: string;
87
+ nanos: number;
88
+ }
89
89
  export interface FileDescriptorSet {
90
90
  file?: FileDescriptorProto[];
91
91
  }