@dcl/protocol 1.0.0-13143749736.commit-5fbeb3c → 1.0.0-13373633961.commit-e07ccb6

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.
@@ -52,6 +52,7 @@ export enum FriendshipStatus {
52
52
  REJECTED = 4,
53
53
  DELETED = 5,
54
54
  BLOCKED = 6,
55
+ NONE = 7,
55
56
  UNRECOGNIZED = -1,
56
57
  }
57
58
 
@@ -78,6 +79,9 @@ export function friendshipStatusFromJSON(object: any): FriendshipStatus {
78
79
  case 6:
79
80
  case "BLOCKED":
80
81
  return FriendshipStatus.BLOCKED;
82
+ case 7:
83
+ case "NONE":
84
+ return FriendshipStatus.NONE;
81
85
  case -1:
82
86
  case "UNRECOGNIZED":
83
87
  default:
@@ -101,6 +105,8 @@ export function friendshipStatusToJSON(object: FriendshipStatus): string {
101
105
  return "DELETED";
102
106
  case FriendshipStatus.BLOCKED:
103
107
  return "BLOCKED";
108
+ case FriendshipStatus.NONE:
109
+ return "NONE";
104
110
  case FriendshipStatus.UNRECOGNIZED:
105
111
  default:
106
112
  return "UNRECOGNIZED";
@@ -119,15 +125,23 @@ export interface User {
119
125
  address: string;
120
126
  }
121
127
 
128
+ export interface FriendProfile {
129
+ address: string;
130
+ name: string;
131
+ hasClaimedName: boolean;
132
+ profilePictureUrl: string;
133
+ }
134
+
122
135
  export interface Pagination {
123
136
  limit: number;
124
137
  offset: number;
125
138
  }
126
139
 
127
140
  export interface FriendshipRequestResponse {
128
- user: User | undefined;
141
+ friend: FriendProfile | undefined;
129
142
  createdAt: number;
130
143
  message?: string | undefined;
144
+ id: string;
131
145
  }
132
146
 
133
147
  export interface FriendshipRequests {
@@ -136,7 +150,6 @@ export interface FriendshipRequests {
136
150
 
137
151
  export interface GetFriendsPayload {
138
152
  pagination?: Pagination | undefined;
139
- status?: ConnectivityStatus | undefined;
140
153
  }
141
154
 
142
155
  export interface GetFriendshipRequestsPayload {
@@ -184,8 +197,8 @@ export interface PaginatedResponse {
184
197
  page: number;
185
198
  }
186
199
 
187
- export interface PaginatedUsersResponse {
188
- users: User[];
200
+ export interface PaginatedFriendsProfilesResponse {
201
+ friends: FriendProfile[];
189
202
  paginationData: PaginatedResponse | undefined;
190
203
  }
191
204
 
@@ -208,11 +221,13 @@ export interface UpsertFriendshipResponse {
208
221
  export interface UpsertFriendshipResponse_Accepted {
209
222
  id: string;
210
223
  createdAt: number;
224
+ friend: FriendProfile | undefined;
225
+ message?: string | undefined;
211
226
  }
212
227
 
213
228
  export interface FriendshipUpdate {
214
229
  update?:
215
- | { $case: "request"; request: FriendshipRequestResponse }
230
+ | { $case: "request"; request: FriendshipUpdate_RequestResponse }
216
231
  | { $case: "accept"; accept: FriendshipUpdate_AcceptResponse }
217
232
  | { $case: "reject"; reject: FriendshipUpdate_RejectResponse }
218
233
  | { $case: "delete"; delete: FriendshipUpdate_DeleteResponse }
@@ -220,6 +235,13 @@ export interface FriendshipUpdate {
220
235
  | undefined;
221
236
  }
222
237
 
238
+ export interface FriendshipUpdate_RequestResponse {
239
+ friend: FriendProfile | undefined;
240
+ createdAt: number;
241
+ message?: string | undefined;
242
+ id: string;
243
+ }
244
+
223
245
  export interface FriendshipUpdate_AcceptResponse {
224
246
  user: User | undefined;
225
247
  }
@@ -236,6 +258,11 @@ export interface FriendshipUpdate_CancelResponse {
236
258
  user: User | undefined;
237
259
  }
238
260
 
261
+ export interface FriendConnectivityUpdate {
262
+ friend: FriendProfile | undefined;
263
+ status: ConnectivityStatus;
264
+ }
265
+
239
266
  export interface GetFriendshipStatusPayload {
240
267
  user: User | undefined;
241
268
  }
@@ -396,6 +423,103 @@ export namespace User {
396
423
  }
397
424
  }
398
425
 
426
+ function createBaseFriendProfile(): FriendProfile {
427
+ return { address: "", name: "", hasClaimedName: false, profilePictureUrl: "" };
428
+ }
429
+
430
+ export namespace FriendProfile {
431
+ export function encode(message: FriendProfile, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
432
+ if (message.address !== "") {
433
+ writer.uint32(10).string(message.address);
434
+ }
435
+ if (message.name !== "") {
436
+ writer.uint32(18).string(message.name);
437
+ }
438
+ if (message.hasClaimedName === true) {
439
+ writer.uint32(24).bool(message.hasClaimedName);
440
+ }
441
+ if (message.profilePictureUrl !== "") {
442
+ writer.uint32(34).string(message.profilePictureUrl);
443
+ }
444
+ return writer;
445
+ }
446
+
447
+ export function decode(input: _m0.Reader | Uint8Array, length?: number): FriendProfile {
448
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
449
+ let end = length === undefined ? reader.len : reader.pos + length;
450
+ const message = createBaseFriendProfile();
451
+ while (reader.pos < end) {
452
+ const tag = reader.uint32();
453
+ switch (tag >>> 3) {
454
+ case 1:
455
+ if (tag !== 10) {
456
+ break;
457
+ }
458
+
459
+ message.address = reader.string();
460
+ continue;
461
+ case 2:
462
+ if (tag !== 18) {
463
+ break;
464
+ }
465
+
466
+ message.name = reader.string();
467
+ continue;
468
+ case 3:
469
+ if (tag !== 24) {
470
+ break;
471
+ }
472
+
473
+ message.hasClaimedName = reader.bool();
474
+ continue;
475
+ case 4:
476
+ if (tag !== 34) {
477
+ break;
478
+ }
479
+
480
+ message.profilePictureUrl = reader.string();
481
+ continue;
482
+ }
483
+ if ((tag & 7) === 4 || tag === 0) {
484
+ break;
485
+ }
486
+ reader.skipType(tag & 7);
487
+ }
488
+ return message;
489
+ }
490
+
491
+ export function fromJSON(object: any): FriendProfile {
492
+ return {
493
+ address: isSet(object.address) ? String(object.address) : "",
494
+ name: isSet(object.name) ? String(object.name) : "",
495
+ hasClaimedName: isSet(object.hasClaimedName) ? Boolean(object.hasClaimedName) : false,
496
+ profilePictureUrl: isSet(object.profilePictureUrl) ? String(object.profilePictureUrl) : "",
497
+ };
498
+ }
499
+
500
+ export function toJSON(message: FriendProfile): unknown {
501
+ const obj: any = {};
502
+ message.address !== undefined && (obj.address = message.address);
503
+ message.name !== undefined && (obj.name = message.name);
504
+ message.hasClaimedName !== undefined && (obj.hasClaimedName = message.hasClaimedName);
505
+ message.profilePictureUrl !== undefined && (obj.profilePictureUrl = message.profilePictureUrl);
506
+ return obj;
507
+ }
508
+
509
+ export function create<I extends Exact<DeepPartial<FriendProfile>, I>>(base?: I): FriendProfile {
510
+ return FriendProfile.fromPartial(base ?? {});
511
+ }
512
+
513
+ export function fromPartial<I extends Exact<DeepPartial<FriendProfile>, I>>(object: I): FriendProfile {
514
+ const message = createBaseFriendProfile();
515
+ message.address = object.address ?? "";
516
+ message.name = object.name ?? "";
517
+ message.hasClaimedName = object.hasClaimedName ?? false;
518
+ message.profilePictureUrl = object.profilePictureUrl ?? "";
519
+ return message;
520
+ }
521
+ }
522
+
399
523
  function createBasePagination(): Pagination {
400
524
  return { limit: 0, offset: 0 };
401
525
  }
@@ -468,13 +592,13 @@ export namespace Pagination {
468
592
  }
469
593
 
470
594
  function createBaseFriendshipRequestResponse(): FriendshipRequestResponse {
471
- return { user: undefined, createdAt: 0, message: undefined };
595
+ return { friend: undefined, createdAt: 0, message: undefined, id: "" };
472
596
  }
473
597
 
474
598
  export namespace FriendshipRequestResponse {
475
599
  export function encode(message: FriendshipRequestResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
476
- if (message.user !== undefined) {
477
- User.encode(message.user, writer.uint32(10).fork()).ldelim();
600
+ if (message.friend !== undefined) {
601
+ FriendProfile.encode(message.friend, writer.uint32(10).fork()).ldelim();
478
602
  }
479
603
  if (message.createdAt !== 0) {
480
604
  writer.uint32(16).int64(message.createdAt);
@@ -482,6 +606,9 @@ export namespace FriendshipRequestResponse {
482
606
  if (message.message !== undefined) {
483
607
  writer.uint32(26).string(message.message);
484
608
  }
609
+ if (message.id !== "") {
610
+ writer.uint32(34).string(message.id);
611
+ }
485
612
  return writer;
486
613
  }
487
614
 
@@ -497,7 +624,7 @@ export namespace FriendshipRequestResponse {
497
624
  break;
498
625
  }
499
626
 
500
- message.user = User.decode(reader, reader.uint32());
627
+ message.friend = FriendProfile.decode(reader, reader.uint32());
501
628
  continue;
502
629
  case 2:
503
630
  if (tag !== 16) {
@@ -513,6 +640,13 @@ export namespace FriendshipRequestResponse {
513
640
 
514
641
  message.message = reader.string();
515
642
  continue;
643
+ case 4:
644
+ if (tag !== 34) {
645
+ break;
646
+ }
647
+
648
+ message.id = reader.string();
649
+ continue;
516
650
  }
517
651
  if ((tag & 7) === 4 || tag === 0) {
518
652
  break;
@@ -524,17 +658,19 @@ export namespace FriendshipRequestResponse {
524
658
 
525
659
  export function fromJSON(object: any): FriendshipRequestResponse {
526
660
  return {
527
- user: isSet(object.user) ? User.fromJSON(object.user) : undefined,
661
+ friend: isSet(object.friend) ? FriendProfile.fromJSON(object.friend) : undefined,
528
662
  createdAt: isSet(object.createdAt) ? Number(object.createdAt) : 0,
529
663
  message: isSet(object.message) ? String(object.message) : undefined,
664
+ id: isSet(object.id) ? String(object.id) : "",
530
665
  };
531
666
  }
532
667
 
533
668
  export function toJSON(message: FriendshipRequestResponse): unknown {
534
669
  const obj: any = {};
535
- message.user !== undefined && (obj.user = message.user ? User.toJSON(message.user) : undefined);
670
+ message.friend !== undefined && (obj.friend = message.friend ? FriendProfile.toJSON(message.friend) : undefined);
536
671
  message.createdAt !== undefined && (obj.createdAt = Math.round(message.createdAt));
537
672
  message.message !== undefined && (obj.message = message.message);
673
+ message.id !== undefined && (obj.id = message.id);
538
674
  return obj;
539
675
  }
540
676
 
@@ -548,9 +684,12 @@ export namespace FriendshipRequestResponse {
548
684
  object: I,
549
685
  ): FriendshipRequestResponse {
550
686
  const message = createBaseFriendshipRequestResponse();
551
- message.user = (object.user !== undefined && object.user !== null) ? User.fromPartial(object.user) : undefined;
687
+ message.friend = (object.friend !== undefined && object.friend !== null)
688
+ ? FriendProfile.fromPartial(object.friend)
689
+ : undefined;
552
690
  message.createdAt = object.createdAt ?? 0;
553
691
  message.message = object.message ?? undefined;
692
+ message.id = object.id ?? "";
554
693
  return message;
555
694
  }
556
695
  }
@@ -620,7 +759,7 @@ export namespace FriendshipRequests {
620
759
  }
621
760
 
622
761
  function createBaseGetFriendsPayload(): GetFriendsPayload {
623
- return { pagination: undefined, status: undefined };
762
+ return { pagination: undefined };
624
763
  }
625
764
 
626
765
  export namespace GetFriendsPayload {
@@ -628,9 +767,6 @@ export namespace GetFriendsPayload {
628
767
  if (message.pagination !== undefined) {
629
768
  Pagination.encode(message.pagination, writer.uint32(10).fork()).ldelim();
630
769
  }
631
- if (message.status !== undefined) {
632
- writer.uint32(16).int32(message.status);
633
- }
634
770
  return writer;
635
771
  }
636
772
 
@@ -648,13 +784,6 @@ export namespace GetFriendsPayload {
648
784
 
649
785
  message.pagination = Pagination.decode(reader, reader.uint32());
650
786
  continue;
651
- case 2:
652
- if (tag !== 16) {
653
- break;
654
- }
655
-
656
- message.status = reader.int32() as any;
657
- continue;
658
787
  }
659
788
  if ((tag & 7) === 4 || tag === 0) {
660
789
  break;
@@ -665,18 +794,13 @@ export namespace GetFriendsPayload {
665
794
  }
666
795
 
667
796
  export function fromJSON(object: any): GetFriendsPayload {
668
- return {
669
- pagination: isSet(object.pagination) ? Pagination.fromJSON(object.pagination) : undefined,
670
- status: isSet(object.status) ? connectivityStatusFromJSON(object.status) : undefined,
671
- };
797
+ return { pagination: isSet(object.pagination) ? Pagination.fromJSON(object.pagination) : undefined };
672
798
  }
673
799
 
674
800
  export function toJSON(message: GetFriendsPayload): unknown {
675
801
  const obj: any = {};
676
802
  message.pagination !== undefined &&
677
803
  (obj.pagination = message.pagination ? Pagination.toJSON(message.pagination) : undefined);
678
- message.status !== undefined &&
679
- (obj.status = message.status !== undefined ? connectivityStatusToJSON(message.status) : undefined);
680
804
  return obj;
681
805
  }
682
806
 
@@ -689,7 +813,6 @@ export namespace GetFriendsPayload {
689
813
  message.pagination = (object.pagination !== undefined && object.pagination !== null)
690
814
  ? Pagination.fromPartial(object.pagination)
691
815
  : undefined;
692
- message.status = object.status ?? undefined;
693
816
  return message;
694
817
  }
695
818
  }
@@ -1409,14 +1532,17 @@ export namespace PaginatedResponse {
1409
1532
  }
1410
1533
  }
1411
1534
 
1412
- function createBasePaginatedUsersResponse(): PaginatedUsersResponse {
1413
- return { users: [], paginationData: undefined };
1535
+ function createBasePaginatedFriendsProfilesResponse(): PaginatedFriendsProfilesResponse {
1536
+ return { friends: [], paginationData: undefined };
1414
1537
  }
1415
1538
 
1416
- export namespace PaginatedUsersResponse {
1417
- export function encode(message: PaginatedUsersResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1418
- for (const v of message.users) {
1419
- User.encode(v!, writer.uint32(10).fork()).ldelim();
1539
+ export namespace PaginatedFriendsProfilesResponse {
1540
+ export function encode(
1541
+ message: PaginatedFriendsProfilesResponse,
1542
+ writer: _m0.Writer = _m0.Writer.create(),
1543
+ ): _m0.Writer {
1544
+ for (const v of message.friends) {
1545
+ FriendProfile.encode(v!, writer.uint32(10).fork()).ldelim();
1420
1546
  }
1421
1547
  if (message.paginationData !== undefined) {
1422
1548
  PaginatedResponse.encode(message.paginationData, writer.uint32(18).fork()).ldelim();
@@ -1424,10 +1550,10 @@ export namespace PaginatedUsersResponse {
1424
1550
  return writer;
1425
1551
  }
1426
1552
 
1427
- export function decode(input: _m0.Reader | Uint8Array, length?: number): PaginatedUsersResponse {
1553
+ export function decode(input: _m0.Reader | Uint8Array, length?: number): PaginatedFriendsProfilesResponse {
1428
1554
  const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1429
1555
  let end = length === undefined ? reader.len : reader.pos + length;
1430
- const message = createBasePaginatedUsersResponse();
1556
+ const message = createBasePaginatedFriendsProfilesResponse();
1431
1557
  while (reader.pos < end) {
1432
1558
  const tag = reader.uint32();
1433
1559
  switch (tag >>> 3) {
@@ -1436,7 +1562,7 @@ export namespace PaginatedUsersResponse {
1436
1562
  break;
1437
1563
  }
1438
1564
 
1439
- message.users.push(User.decode(reader, reader.uint32()));
1565
+ message.friends.push(FriendProfile.decode(reader, reader.uint32()));
1440
1566
  continue;
1441
1567
  case 2:
1442
1568
  if (tag !== 18) {
@@ -1454,34 +1580,36 @@ export namespace PaginatedUsersResponse {
1454
1580
  return message;
1455
1581
  }
1456
1582
 
1457
- export function fromJSON(object: any): PaginatedUsersResponse {
1583
+ export function fromJSON(object: any): PaginatedFriendsProfilesResponse {
1458
1584
  return {
1459
- users: Array.isArray(object?.users) ? object.users.map((e: any) => User.fromJSON(e)) : [],
1585
+ friends: Array.isArray(object?.friends) ? object.friends.map((e: any) => FriendProfile.fromJSON(e)) : [],
1460
1586
  paginationData: isSet(object.paginationData) ? PaginatedResponse.fromJSON(object.paginationData) : undefined,
1461
1587
  };
1462
1588
  }
1463
1589
 
1464
- export function toJSON(message: PaginatedUsersResponse): unknown {
1590
+ export function toJSON(message: PaginatedFriendsProfilesResponse): unknown {
1465
1591
  const obj: any = {};
1466
- if (message.users) {
1467
- obj.users = message.users.map((e) => e ? User.toJSON(e) : undefined);
1592
+ if (message.friends) {
1593
+ obj.friends = message.friends.map((e) => e ? FriendProfile.toJSON(e) : undefined);
1468
1594
  } else {
1469
- obj.users = [];
1595
+ obj.friends = [];
1470
1596
  }
1471
1597
  message.paginationData !== undefined &&
1472
1598
  (obj.paginationData = message.paginationData ? PaginatedResponse.toJSON(message.paginationData) : undefined);
1473
1599
  return obj;
1474
1600
  }
1475
1601
 
1476
- export function create<I extends Exact<DeepPartial<PaginatedUsersResponse>, I>>(base?: I): PaginatedUsersResponse {
1477
- return PaginatedUsersResponse.fromPartial(base ?? {});
1602
+ export function create<I extends Exact<DeepPartial<PaginatedFriendsProfilesResponse>, I>>(
1603
+ base?: I,
1604
+ ): PaginatedFriendsProfilesResponse {
1605
+ return PaginatedFriendsProfilesResponse.fromPartial(base ?? {});
1478
1606
  }
1479
1607
 
1480
- export function fromPartial<I extends Exact<DeepPartial<PaginatedUsersResponse>, I>>(
1608
+ export function fromPartial<I extends Exact<DeepPartial<PaginatedFriendsProfilesResponse>, I>>(
1481
1609
  object: I,
1482
- ): PaginatedUsersResponse {
1483
- const message = createBasePaginatedUsersResponse();
1484
- message.users = object.users?.map((e) => User.fromPartial(e)) || [];
1610
+ ): PaginatedFriendsProfilesResponse {
1611
+ const message = createBasePaginatedFriendsProfilesResponse();
1612
+ message.friends = object.friends?.map((e) => FriendProfile.fromPartial(e)) || [];
1485
1613
  message.paginationData = (object.paginationData !== undefined && object.paginationData !== null)
1486
1614
  ? PaginatedResponse.fromPartial(object.paginationData)
1487
1615
  : undefined;
@@ -1759,7 +1887,7 @@ export namespace UpsertFriendshipResponse {
1759
1887
  }
1760
1888
 
1761
1889
  function createBaseUpsertFriendshipResponse_Accepted(): UpsertFriendshipResponse_Accepted {
1762
- return { id: "", createdAt: 0 };
1890
+ return { id: "", createdAt: 0, friend: undefined, message: undefined };
1763
1891
  }
1764
1892
 
1765
1893
  export namespace UpsertFriendshipResponse_Accepted {
@@ -1773,6 +1901,12 @@ export namespace UpsertFriendshipResponse_Accepted {
1773
1901
  if (message.createdAt !== 0) {
1774
1902
  writer.uint32(16).int64(message.createdAt);
1775
1903
  }
1904
+ if (message.friend !== undefined) {
1905
+ FriendProfile.encode(message.friend, writer.uint32(26).fork()).ldelim();
1906
+ }
1907
+ if (message.message !== undefined) {
1908
+ writer.uint32(34).string(message.message);
1909
+ }
1776
1910
  return writer;
1777
1911
  }
1778
1912
 
@@ -1797,6 +1931,20 @@ export namespace UpsertFriendshipResponse_Accepted {
1797
1931
 
1798
1932
  message.createdAt = longToNumber(reader.int64() as Long);
1799
1933
  continue;
1934
+ case 3:
1935
+ if (tag !== 26) {
1936
+ break;
1937
+ }
1938
+
1939
+ message.friend = FriendProfile.decode(reader, reader.uint32());
1940
+ continue;
1941
+ case 4:
1942
+ if (tag !== 34) {
1943
+ break;
1944
+ }
1945
+
1946
+ message.message = reader.string();
1947
+ continue;
1800
1948
  }
1801
1949
  if ((tag & 7) === 4 || tag === 0) {
1802
1950
  break;
@@ -1810,6 +1958,8 @@ export namespace UpsertFriendshipResponse_Accepted {
1810
1958
  return {
1811
1959
  id: isSet(object.id) ? String(object.id) : "",
1812
1960
  createdAt: isSet(object.createdAt) ? Number(object.createdAt) : 0,
1961
+ friend: isSet(object.friend) ? FriendProfile.fromJSON(object.friend) : undefined,
1962
+ message: isSet(object.message) ? String(object.message) : undefined,
1813
1963
  };
1814
1964
  }
1815
1965
 
@@ -1817,6 +1967,8 @@ export namespace UpsertFriendshipResponse_Accepted {
1817
1967
  const obj: any = {};
1818
1968
  message.id !== undefined && (obj.id = message.id);
1819
1969
  message.createdAt !== undefined && (obj.createdAt = Math.round(message.createdAt));
1970
+ message.friend !== undefined && (obj.friend = message.friend ? FriendProfile.toJSON(message.friend) : undefined);
1971
+ message.message !== undefined && (obj.message = message.message);
1820
1972
  return obj;
1821
1973
  }
1822
1974
 
@@ -1832,6 +1984,10 @@ export namespace UpsertFriendshipResponse_Accepted {
1832
1984
  const message = createBaseUpsertFriendshipResponse_Accepted();
1833
1985
  message.id = object.id ?? "";
1834
1986
  message.createdAt = object.createdAt ?? 0;
1987
+ message.friend = (object.friend !== undefined && object.friend !== null)
1988
+ ? FriendProfile.fromPartial(object.friend)
1989
+ : undefined;
1990
+ message.message = object.message ?? undefined;
1835
1991
  return message;
1836
1992
  }
1837
1993
  }
@@ -1844,7 +2000,7 @@ export namespace FriendshipUpdate {
1844
2000
  export function encode(message: FriendshipUpdate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1845
2001
  switch (message.update?.$case) {
1846
2002
  case "request":
1847
- FriendshipRequestResponse.encode(message.update.request, writer.uint32(10).fork()).ldelim();
2003
+ FriendshipUpdate_RequestResponse.encode(message.update.request, writer.uint32(10).fork()).ldelim();
1848
2004
  break;
1849
2005
  case "accept":
1850
2006
  FriendshipUpdate_AcceptResponse.encode(message.update.accept, writer.uint32(18).fork()).ldelim();
@@ -1874,7 +2030,10 @@ export namespace FriendshipUpdate {
1874
2030
  break;
1875
2031
  }
1876
2032
 
1877
- message.update = { $case: "request", request: FriendshipRequestResponse.decode(reader, reader.uint32()) };
2033
+ message.update = {
2034
+ $case: "request",
2035
+ request: FriendshipUpdate_RequestResponse.decode(reader, reader.uint32()),
2036
+ };
1878
2037
  continue;
1879
2038
  case 2:
1880
2039
  if (tag !== 18) {
@@ -1916,7 +2075,7 @@ export namespace FriendshipUpdate {
1916
2075
  export function fromJSON(object: any): FriendshipUpdate {
1917
2076
  return {
1918
2077
  update: isSet(object.request)
1919
- ? { $case: "request", request: FriendshipRequestResponse.fromJSON(object.request) }
2078
+ ? { $case: "request", request: FriendshipUpdate_RequestResponse.fromJSON(object.request) }
1920
2079
  : isSet(object.accept)
1921
2080
  ? { $case: "accept", accept: FriendshipUpdate_AcceptResponse.fromJSON(object.accept) }
1922
2081
  : isSet(object.reject)
@@ -1932,7 +2091,9 @@ export namespace FriendshipUpdate {
1932
2091
  export function toJSON(message: FriendshipUpdate): unknown {
1933
2092
  const obj: any = {};
1934
2093
  message.update?.$case === "request" &&
1935
- (obj.request = message.update?.request ? FriendshipRequestResponse.toJSON(message.update?.request) : undefined);
2094
+ (obj.request = message.update?.request
2095
+ ? FriendshipUpdate_RequestResponse.toJSON(message.update?.request)
2096
+ : undefined);
1936
2097
  message.update?.$case === "accept" &&
1937
2098
  (obj.accept = message.update?.accept
1938
2099
  ? FriendshipUpdate_AcceptResponse.toJSON(message.update?.accept)
@@ -1959,7 +2120,10 @@ export namespace FriendshipUpdate {
1959
2120
  export function fromPartial<I extends Exact<DeepPartial<FriendshipUpdate>, I>>(object: I): FriendshipUpdate {
1960
2121
  const message = createBaseFriendshipUpdate();
1961
2122
  if (object.update?.$case === "request" && object.update?.request !== undefined && object.update?.request !== null) {
1962
- message.update = { $case: "request", request: FriendshipRequestResponse.fromPartial(object.update.request) };
2123
+ message.update = {
2124
+ $case: "request",
2125
+ request: FriendshipUpdate_RequestResponse.fromPartial(object.update.request),
2126
+ };
1963
2127
  }
1964
2128
  if (object.update?.$case === "accept" && object.update?.accept !== undefined && object.update?.accept !== null) {
1965
2129
  message.update = { $case: "accept", accept: FriendshipUpdate_AcceptResponse.fromPartial(object.update.accept) };
@@ -1977,6 +2141,112 @@ export namespace FriendshipUpdate {
1977
2141
  }
1978
2142
  }
1979
2143
 
2144
+ function createBaseFriendshipUpdate_RequestResponse(): FriendshipUpdate_RequestResponse {
2145
+ return { friend: undefined, createdAt: 0, message: undefined, id: "" };
2146
+ }
2147
+
2148
+ export namespace FriendshipUpdate_RequestResponse {
2149
+ export function encode(
2150
+ message: FriendshipUpdate_RequestResponse,
2151
+ writer: _m0.Writer = _m0.Writer.create(),
2152
+ ): _m0.Writer {
2153
+ if (message.friend !== undefined) {
2154
+ FriendProfile.encode(message.friend, writer.uint32(10).fork()).ldelim();
2155
+ }
2156
+ if (message.createdAt !== 0) {
2157
+ writer.uint32(16).int64(message.createdAt);
2158
+ }
2159
+ if (message.message !== undefined) {
2160
+ writer.uint32(26).string(message.message);
2161
+ }
2162
+ if (message.id !== "") {
2163
+ writer.uint32(34).string(message.id);
2164
+ }
2165
+ return writer;
2166
+ }
2167
+
2168
+ export function decode(input: _m0.Reader | Uint8Array, length?: number): FriendshipUpdate_RequestResponse {
2169
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
2170
+ let end = length === undefined ? reader.len : reader.pos + length;
2171
+ const message = createBaseFriendshipUpdate_RequestResponse();
2172
+ while (reader.pos < end) {
2173
+ const tag = reader.uint32();
2174
+ switch (tag >>> 3) {
2175
+ case 1:
2176
+ if (tag !== 10) {
2177
+ break;
2178
+ }
2179
+
2180
+ message.friend = FriendProfile.decode(reader, reader.uint32());
2181
+ continue;
2182
+ case 2:
2183
+ if (tag !== 16) {
2184
+ break;
2185
+ }
2186
+
2187
+ message.createdAt = longToNumber(reader.int64() as Long);
2188
+ continue;
2189
+ case 3:
2190
+ if (tag !== 26) {
2191
+ break;
2192
+ }
2193
+
2194
+ message.message = reader.string();
2195
+ continue;
2196
+ case 4:
2197
+ if (tag !== 34) {
2198
+ break;
2199
+ }
2200
+
2201
+ message.id = reader.string();
2202
+ continue;
2203
+ }
2204
+ if ((tag & 7) === 4 || tag === 0) {
2205
+ break;
2206
+ }
2207
+ reader.skipType(tag & 7);
2208
+ }
2209
+ return message;
2210
+ }
2211
+
2212
+ export function fromJSON(object: any): FriendshipUpdate_RequestResponse {
2213
+ return {
2214
+ friend: isSet(object.friend) ? FriendProfile.fromJSON(object.friend) : undefined,
2215
+ createdAt: isSet(object.createdAt) ? Number(object.createdAt) : 0,
2216
+ message: isSet(object.message) ? String(object.message) : undefined,
2217
+ id: isSet(object.id) ? String(object.id) : "",
2218
+ };
2219
+ }
2220
+
2221
+ export function toJSON(message: FriendshipUpdate_RequestResponse): unknown {
2222
+ const obj: any = {};
2223
+ message.friend !== undefined && (obj.friend = message.friend ? FriendProfile.toJSON(message.friend) : undefined);
2224
+ message.createdAt !== undefined && (obj.createdAt = Math.round(message.createdAt));
2225
+ message.message !== undefined && (obj.message = message.message);
2226
+ message.id !== undefined && (obj.id = message.id);
2227
+ return obj;
2228
+ }
2229
+
2230
+ export function create<I extends Exact<DeepPartial<FriendshipUpdate_RequestResponse>, I>>(
2231
+ base?: I,
2232
+ ): FriendshipUpdate_RequestResponse {
2233
+ return FriendshipUpdate_RequestResponse.fromPartial(base ?? {});
2234
+ }
2235
+
2236
+ export function fromPartial<I extends Exact<DeepPartial<FriendshipUpdate_RequestResponse>, I>>(
2237
+ object: I,
2238
+ ): FriendshipUpdate_RequestResponse {
2239
+ const message = createBaseFriendshipUpdate_RequestResponse();
2240
+ message.friend = (object.friend !== undefined && object.friend !== null)
2241
+ ? FriendProfile.fromPartial(object.friend)
2242
+ : undefined;
2243
+ message.createdAt = object.createdAt ?? 0;
2244
+ message.message = object.message ?? undefined;
2245
+ message.id = object.id ?? "";
2246
+ return message;
2247
+ }
2248
+ }
2249
+
1980
2250
  function createBaseFriendshipUpdate_AcceptResponse(): FriendshipUpdate_AcceptResponse {
1981
2251
  return { user: undefined };
1982
2252
  }
@@ -2229,6 +2499,83 @@ export namespace FriendshipUpdate_CancelResponse {
2229
2499
  }
2230
2500
  }
2231
2501
 
2502
+ function createBaseFriendConnectivityUpdate(): FriendConnectivityUpdate {
2503
+ return { friend: undefined, status: 0 };
2504
+ }
2505
+
2506
+ export namespace FriendConnectivityUpdate {
2507
+ export function encode(message: FriendConnectivityUpdate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2508
+ if (message.friend !== undefined) {
2509
+ FriendProfile.encode(message.friend, writer.uint32(10).fork()).ldelim();
2510
+ }
2511
+ if (message.status !== 0) {
2512
+ writer.uint32(16).int32(message.status);
2513
+ }
2514
+ return writer;
2515
+ }
2516
+
2517
+ export function decode(input: _m0.Reader | Uint8Array, length?: number): FriendConnectivityUpdate {
2518
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
2519
+ let end = length === undefined ? reader.len : reader.pos + length;
2520
+ const message = createBaseFriendConnectivityUpdate();
2521
+ while (reader.pos < end) {
2522
+ const tag = reader.uint32();
2523
+ switch (tag >>> 3) {
2524
+ case 1:
2525
+ if (tag !== 10) {
2526
+ break;
2527
+ }
2528
+
2529
+ message.friend = FriendProfile.decode(reader, reader.uint32());
2530
+ continue;
2531
+ case 2:
2532
+ if (tag !== 16) {
2533
+ break;
2534
+ }
2535
+
2536
+ message.status = reader.int32() as any;
2537
+ continue;
2538
+ }
2539
+ if ((tag & 7) === 4 || tag === 0) {
2540
+ break;
2541
+ }
2542
+ reader.skipType(tag & 7);
2543
+ }
2544
+ return message;
2545
+ }
2546
+
2547
+ export function fromJSON(object: any): FriendConnectivityUpdate {
2548
+ return {
2549
+ friend: isSet(object.friend) ? FriendProfile.fromJSON(object.friend) : undefined,
2550
+ status: isSet(object.status) ? connectivityStatusFromJSON(object.status) : 0,
2551
+ };
2552
+ }
2553
+
2554
+ export function toJSON(message: FriendConnectivityUpdate): unknown {
2555
+ const obj: any = {};
2556
+ message.friend !== undefined && (obj.friend = message.friend ? FriendProfile.toJSON(message.friend) : undefined);
2557
+ message.status !== undefined && (obj.status = connectivityStatusToJSON(message.status));
2558
+ return obj;
2559
+ }
2560
+
2561
+ export function create<I extends Exact<DeepPartial<FriendConnectivityUpdate>, I>>(
2562
+ base?: I,
2563
+ ): FriendConnectivityUpdate {
2564
+ return FriendConnectivityUpdate.fromPartial(base ?? {});
2565
+ }
2566
+
2567
+ export function fromPartial<I extends Exact<DeepPartial<FriendConnectivityUpdate>, I>>(
2568
+ object: I,
2569
+ ): FriendConnectivityUpdate {
2570
+ const message = createBaseFriendConnectivityUpdate();
2571
+ message.friend = (object.friend !== undefined && object.friend !== null)
2572
+ ? FriendProfile.fromPartial(object.friend)
2573
+ : undefined;
2574
+ message.status = object.status ?? 0;
2575
+ return message;
2576
+ }
2577
+ }
2578
+
2232
2579
  function createBaseGetFriendshipStatusPayload(): GetFriendshipStatusPayload {
2233
2580
  return { user: undefined };
2234
2581
  }
@@ -2490,7 +2837,7 @@ export const SocialServiceDefinition = {
2490
2837
  name: "GetFriends",
2491
2838
  requestType: GetFriendsPayload,
2492
2839
  requestStream: false,
2493
- responseType: PaginatedUsersResponse,
2840
+ responseType: PaginatedFriendsProfilesResponse,
2494
2841
  responseStream: false,
2495
2842
  options: {},
2496
2843
  },
@@ -2499,7 +2846,7 @@ export const SocialServiceDefinition = {
2499
2846
  name: "GetMutualFriends",
2500
2847
  requestType: GetMutualFriendsPayload,
2501
2848
  requestStream: false,
2502
- responseType: PaginatedUsersResponse,
2849
+ responseType: PaginatedFriendsProfilesResponse,
2503
2850
  responseStream: false,
2504
2851
  options: {},
2505
2852
  },
@@ -2539,6 +2886,7 @@ export const SocialServiceDefinition = {
2539
2886
  responseStream: true,
2540
2887
  options: {},
2541
2888
  },
2889
+ /** Get the friendship status between the authenticated user and the one in the parameter */
2542
2890
  getFriendshipStatus: {
2543
2891
  name: "GetFriendshipStatus",
2544
2892
  requestType: GetFriendshipStatusPayload,
@@ -2547,6 +2895,15 @@ export const SocialServiceDefinition = {
2547
2895
  responseStream: false,
2548
2896
  options: {},
2549
2897
  },
2898
+ /** Subscribe to connectivity updates of friends: ONLINE, OFFLINE, AWAY */
2899
+ subscribeToFriendConnectivityUpdates: {
2900
+ name: "SubscribeToFriendConnectivityUpdates",
2901
+ requestType: Empty,
2902
+ requestStream: false,
2903
+ responseType: FriendConnectivityUpdate,
2904
+ responseStream: true,
2905
+ options: {},
2906
+ },
2550
2907
  },
2551
2908
  } as const;
2552
2909