@dxos/protocols 0.4.7 → 0.4.8-main.ac78619

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 (31) hide show
  1. package/dist/cjs/src/errors/encoding.js.map +1 -1
  2. package/dist/cjs/src/errors/helpers.js.map +1 -1
  3. package/dist/cjs/src/proto/gen/dxos/client/services.d.ts +38 -4
  4. package/dist/cjs/src/proto/gen/dxos/client/services.d.ts.map +1 -1
  5. package/dist/cjs/src/proto/gen/dxos/client/services.js +4 -0
  6. package/dist/cjs/src/proto/gen/dxos/client/services.js.map +1 -1
  7. package/dist/cjs/src/proto/gen/dxos/echo/metadata.d.ts +1 -0
  8. package/dist/cjs/src/proto/gen/dxos/echo/metadata.d.ts.map +1 -1
  9. package/dist/cjs/src/proto/gen/index.d.ts +1 -0
  10. package/dist/cjs/src/proto/gen/index.d.ts.map +1 -1
  11. package/dist/cjs/src/proto/gen/index.js +1 -1
  12. package/dist/cjs/src/proto/gen/index.js.map +1 -1
  13. package/dist/cjs/tsconfig.tsbuildinfo +1 -1
  14. package/dist/esm/src/errors/encoding.js.map +1 -1
  15. package/dist/esm/src/errors/helpers.js.map +1 -1
  16. package/dist/esm/src/proto/gen/dxos/client/services.d.ts +38 -4
  17. package/dist/esm/src/proto/gen/dxos/client/services.d.ts.map +1 -1
  18. package/dist/esm/src/proto/gen/dxos/client/services.js +4 -0
  19. package/dist/esm/src/proto/gen/dxos/client/services.js.map +1 -1
  20. package/dist/esm/src/proto/gen/dxos/echo/metadata.d.ts +1 -0
  21. package/dist/esm/src/proto/gen/dxos/echo/metadata.d.ts.map +1 -1
  22. package/dist/esm/src/proto/gen/index.d.ts +1 -0
  23. package/dist/esm/src/proto/gen/index.d.ts.map +1 -1
  24. package/dist/esm/src/proto/gen/index.js +1 -1
  25. package/dist/esm/src/proto/gen/index.js.map +1 -1
  26. package/package.json +5 -5
  27. package/src/proto/dxos/client/services.proto +26 -1
  28. package/src/proto/dxos/echo/metadata.proto +3 -0
  29. package/src/proto/gen/dxos/client/services.ts +38 -4
  30. package/src/proto/gen/dxos/echo/metadata.ts +1 -0
  31. package/src/proto/gen/index.ts +2 -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;AAuhB7C,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,46nGAA46nG,CAAC,CAAC,CAAC;AACr+nG,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;AAwhB7C,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,qnpGAAqnpG,CAAC,CAAC,CAAC;AAC9qpG,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.4.7",
3
+ "version": "0.4.8-main.ac78619",
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/codec-protobuf": "0.4.7",
37
- "@dxos/invariant": "0.4.7",
38
- "@dxos/keys": "0.4.7",
39
- "@dxos/timeframe": "0.4.7"
36
+ "@dxos/invariant": "0.4.8-main.ac78619",
37
+ "@dxos/timeframe": "0.4.8-main.ac78619",
38
+ "@dxos/codec-protobuf": "0.4.8-main.ac78619",
39
+ "@dxos/keys": "0.4.8-main.ac78619"
40
40
  },
41
41
  "devDependencies": {
42
42
  "glob": "~7.1.6"
@@ -351,6 +351,9 @@ message CreateEpochRequest {
351
351
 
352
352
  /// Init empty automerge document as the space root. Disables legacy ECHO snapshot creation.
353
353
  INIT_AUTOMERGE = 1;
354
+
355
+ /// Init new automerge root by clonning the current space root. History is pruned.
356
+ PRUNE_AUTOMERGE_ROOT_HISTORY = 2;
354
357
  }
355
358
 
356
359
  dxos.keys.PublicKey space_key = 1;
@@ -416,6 +419,7 @@ message Invitation {
416
419
  CANCELLED = 6;
417
420
  TIMEOUT = 7;
418
421
  ERROR = 8;
422
+ EXPIRED = 9;
419
423
  }
420
424
 
421
425
  /// Local identifier (random).
@@ -436,7 +440,7 @@ message Invitation {
436
440
  /// Local state.
437
441
  State state = 6;
438
442
 
439
- /// Timeout (ms).
443
+ /// Timeout for guest to complete invitation once connected (ms).
440
444
  optional int32 timeout = 7;
441
445
 
442
446
  /// Guest's identity.
@@ -450,6 +454,17 @@ message Invitation {
450
454
 
451
455
  /// Path or identifier to navigate to after successful authentication.
452
456
  optional string target = 11;
457
+
458
+ // TODO(nf): should these exist elsewhere since they only have meaning to the host?
459
+ /// Host should resume invitation on startup until timeout.
460
+ optional bool persistent = 12;
461
+
462
+ optional google.protobuf.Timestamp created = 13;
463
+
464
+ /// Number of seconds the host will honor the invitation. 0 means the invitation persists forever.
465
+ // TODO(nf): some feedback mechanism or GC for immortal invitations?
466
+ // TODO(nf): should the creator have a way to make an invitation last as long as the client? this was the previous behavior.
467
+ optional int32 lifetime = 14;
453
468
  }
454
469
 
455
470
  message AcceptInvitationRequest {
@@ -477,6 +492,8 @@ message QueryInvitationsResponse {
477
492
  enum Action {
478
493
  ADDED = 0;
479
494
  REMOVED = 1;
495
+ SAVED = 2;
496
+ LOAD_COMPLETE = 3;
480
497
  }
481
498
 
482
499
  enum Type {
@@ -487,6 +504,13 @@ message QueryInvitationsResponse {
487
504
  Action action = 1;
488
505
  Type type = 2;
489
506
  repeated Invitation invitations = 3;
507
+ // indicate to caller that invitations of this action/type were existing at time of initial response.
508
+ optional bool existing = 4;
509
+ }
510
+
511
+ // Informational, consumers must share invitations to receive CancellableInvitation
512
+ message LoadPersistentInvitationsResponse {
513
+ repeated Invitation invitations = 1;
490
514
  }
491
515
 
492
516
  service InvitationsService {
@@ -495,6 +519,7 @@ service InvitationsService {
495
519
  rpc Authenticate(AuthenticationRequest) returns (google.protobuf.Empty);
496
520
  rpc CancelInvitation(CancelInvitationRequest) returns (google.protobuf.Empty);
497
521
  rpc QueryInvitations(google.protobuf.Empty) returns (stream QueryInvitationsResponse);
522
+ rpc LoadPersistentInvitations(google.protobuf.Empty) returns (LoadPersistentInvitationsResponse);
498
523
  }
499
524
 
500
525
  //
@@ -6,6 +6,7 @@ syntax = "proto3";
6
6
 
7
7
  import "google/protobuf/timestamp.proto";
8
8
 
9
+ import "dxos/client/services.proto";
9
10
  import "dxos/echo/model/document.proto";
10
11
  import "dxos/echo/timeframe.proto";
11
12
  import "dxos/keys.proto";
@@ -29,6 +30,8 @@ message EchoMetadata {
29
30
 
30
31
  /// List of the data spaces.
31
32
  repeated SpaceMetadata spaces = 11;
33
+
34
+ repeated dxos.client.services.Invitation invitations = 12;
32
35
  }
33
36
 
34
37
  /// Per-space metadata. Frequent updates. Keep small.
@@ -802,7 +802,8 @@ export namespace CreateEpochRequest {
802
802
  */
803
803
  export enum Migration {
804
804
  NONE = 0,
805
- INIT_AUTOMERGE = 1
805
+ INIT_AUTOMERGE = 1,
806
+ PRUNE_AUTOMERGE_ROOT_HISTORY = 2
806
807
  }
807
808
  }
808
809
  /**
@@ -863,7 +864,7 @@ export interface Invitation {
863
864
  */
864
865
  state: Invitation.State;
865
866
  /**
866
- * Timeout (ms).
867
+ * Timeout for guest to complete invitation once connected (ms).
867
868
  *
868
869
  * Options:
869
870
  * - proto3_optional = true
@@ -897,6 +898,23 @@ export interface Invitation {
897
898
  * - proto3_optional = true
898
899
  */
899
900
  target?: string;
901
+ /**
902
+ * Host should resume invitation on startup until timeout.
903
+ *
904
+ * Options:
905
+ * - proto3_optional = true
906
+ */
907
+ persistent?: boolean;
908
+ /**
909
+ * Options:
910
+ * - proto3_optional = true
911
+ */
912
+ created?: ReturnType<(typeof substitutions)["google.protobuf.Timestamp"]["decode"]>;
913
+ /**
914
+ * Options:
915
+ * - proto3_optional = true
916
+ */
917
+ lifetime?: number;
900
918
  }
901
919
  export namespace Invitation {
902
920
  /**
@@ -937,7 +955,8 @@ export namespace Invitation {
937
955
  SUCCESS = 5,
938
956
  CANCELLED = 6,
939
957
  TIMEOUT = 7,
940
- ERROR = 8
958
+ ERROR = 8,
959
+ EXPIRED = 9
941
960
  }
942
961
  }
943
962
  /**
@@ -983,6 +1002,11 @@ export interface QueryInvitationsResponse {
983
1002
  action: QueryInvitationsResponse.Action;
984
1003
  type: QueryInvitationsResponse.Type;
985
1004
  invitations?: Invitation[];
1005
+ /**
1006
+ * Options:
1007
+ * - proto3_optional = true
1008
+ */
1009
+ existing?: boolean;
986
1010
  }
987
1011
  export namespace QueryInvitationsResponse {
988
1012
  /**
@@ -991,7 +1015,9 @@ export namespace QueryInvitationsResponse {
991
1015
  */
992
1016
  export enum Action {
993
1017
  ADDED = 0,
994
- REMOVED = 1
1018
+ REMOVED = 1,
1019
+ SAVED = 2,
1020
+ LOAD_COMPLETE = 3
995
1021
  }
996
1022
  /**
997
1023
  * Defined in:
@@ -1002,6 +1028,13 @@ export namespace QueryInvitationsResponse {
1002
1028
  ACCEPTED = 1
1003
1029
  }
1004
1030
  }
1031
+ /**
1032
+ * Defined in:
1033
+ * {@link file://./../../../dxos/client/services.proto}
1034
+ */
1035
+ export interface LoadPersistentInvitationsResponse {
1036
+ invitations?: Invitation[];
1037
+ }
1005
1038
  /**
1006
1039
  * Defined in:
1007
1040
  * {@link file://./../../../dxos/client/services.proto}
@@ -1012,6 +1045,7 @@ export interface InvitationsService {
1012
1045
  authenticate: (request: AuthenticationRequest, options?: RequestOptions) => Promise<void>;
1013
1046
  cancelInvitation: (request: CancelInvitationRequest, options?: RequestOptions) => Promise<void>;
1014
1047
  queryInvitations: (request: void, options?: RequestOptions) => Stream<QueryInvitationsResponse>;
1048
+ loadPersistentInvitations: (request: void, options?: RequestOptions) => Promise<LoadPersistentInvitationsResponse>;
1015
1049
  }
1016
1050
  /**
1017
1051
  * Defined in:
@@ -83,6 +83,7 @@ export interface EchoMetadata {
83
83
  * List of the data spaces.
84
84
  */
85
85
  spaces?: SpaceMetadata[];
86
+ invitations?: dxos_client_services.Invitation[];
86
87
  }
87
88
  /**
88
89
  * Per-space metadata. Frequent updates. Keep small.