@vendasta/conversation 0.9.0 → 0.10.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.
@@ -328,6 +328,33 @@
328
328
  }
329
329
  return enumRef[value];
330
330
  }
331
+ var ConversationMessageCount = /** @class */ (function () {
332
+ function ConversationMessageCount(kwargs) {
333
+ if (!kwargs) {
334
+ return;
335
+ }
336
+ Object.assign(this, kwargs);
337
+ }
338
+ ConversationMessageCount.fromProto = function (proto) {
339
+ var m = new ConversationMessageCount();
340
+ m = Object.assign(m, proto);
341
+ if (proto.count) {
342
+ m.count = parseInt(proto.count, 10);
343
+ }
344
+ return m;
345
+ };
346
+ ConversationMessageCount.prototype.toApiJson = function () {
347
+ var toReturn = {};
348
+ if (typeof this.conversationId !== 'undefined') {
349
+ toReturn['conversationId'] = this.conversationId;
350
+ }
351
+ if (typeof this.count !== 'undefined') {
352
+ toReturn['count'] = this.count;
353
+ }
354
+ return toReturn;
355
+ };
356
+ return ConversationMessageCount;
357
+ }());
331
358
  var LookupConversationsResponseConversations = /** @class */ (function () {
332
359
  function LookupConversationsResponseConversations(kwargs) {
333
360
  if (!kwargs) {
@@ -574,6 +601,42 @@
574
601
  };
575
602
  return GetMultiConversationDetailsResponseDetailedConversation;
576
603
  }());
604
+ var SearchConversationsResponseDetailedConversation = /** @class */ (function () {
605
+ function SearchConversationsResponseDetailedConversation(kwargs) {
606
+ if (!kwargs) {
607
+ return;
608
+ }
609
+ Object.assign(this, kwargs);
610
+ }
611
+ SearchConversationsResponseDetailedConversation.fromProto = function (proto) {
612
+ var m = new SearchConversationsResponseDetailedConversation();
613
+ m = Object.assign(m, proto);
614
+ if (proto.conversation) {
615
+ m.conversation = Conversation.fromProto(proto.conversation);
616
+ }
617
+ if (proto.latestMessage) {
618
+ m.latestMessage = Message.fromProto(proto.latestMessage);
619
+ }
620
+ if (proto.participants) {
621
+ m.participants = proto.participants.map(Participant.fromProto);
622
+ }
623
+ return m;
624
+ };
625
+ SearchConversationsResponseDetailedConversation.prototype.toApiJson = function () {
626
+ var toReturn = {};
627
+ if (typeof this.conversation !== 'undefined' && this.conversation !== null) {
628
+ toReturn['conversation'] = 'toApiJson' in this.conversation ? this.conversation.toApiJson() : this.conversation;
629
+ }
630
+ if (typeof this.latestMessage !== 'undefined' && this.latestMessage !== null) {
631
+ toReturn['latestMessage'] = 'toApiJson' in this.latestMessage ? this.latestMessage.toApiJson() : this.latestMessage;
632
+ }
633
+ if (typeof this.participants !== 'undefined' && this.participants !== null) {
634
+ toReturn['participants'] = 'toApiJson' in this.participants ? this.participants.toApiJson() : this.participants;
635
+ }
636
+ return toReturn;
637
+ };
638
+ return SearchConversationsResponseDetailedConversation;
639
+ }());
577
640
  var GetMessageRequest = /** @class */ (function () {
578
641
  function GetMessageRequest(kwargs) {
579
642
  if (!kwargs) {
@@ -640,6 +703,51 @@
640
703
  };
641
704
  return GetMultiConversationDetailsResponse;
642
705
  }());
706
+ var GetMultiConversationMessageCountRequest = /** @class */ (function () {
707
+ function GetMultiConversationMessageCountRequest(kwargs) {
708
+ if (!kwargs) {
709
+ return;
710
+ }
711
+ Object.assign(this, kwargs);
712
+ }
713
+ GetMultiConversationMessageCountRequest.fromProto = function (proto) {
714
+ var m = new GetMultiConversationMessageCountRequest();
715
+ m = Object.assign(m, proto);
716
+ return m;
717
+ };
718
+ GetMultiConversationMessageCountRequest.prototype.toApiJson = function () {
719
+ var toReturn = {};
720
+ if (typeof this.conversationIds !== 'undefined') {
721
+ toReturn['conversationIds'] = this.conversationIds;
722
+ }
723
+ return toReturn;
724
+ };
725
+ return GetMultiConversationMessageCountRequest;
726
+ }());
727
+ var GetMultiConversationMessageCountResponse = /** @class */ (function () {
728
+ function GetMultiConversationMessageCountResponse(kwargs) {
729
+ if (!kwargs) {
730
+ return;
731
+ }
732
+ Object.assign(this, kwargs);
733
+ }
734
+ GetMultiConversationMessageCountResponse.fromProto = function (proto) {
735
+ var m = new GetMultiConversationMessageCountResponse();
736
+ m = Object.assign(m, proto);
737
+ if (proto.messageCounts) {
738
+ m.messageCounts = proto.messageCounts.map(ConversationMessageCount.fromProto);
739
+ }
740
+ return m;
741
+ };
742
+ GetMultiConversationMessageCountResponse.prototype.toApiJson = function () {
743
+ var toReturn = {};
744
+ if (typeof this.messageCounts !== 'undefined' && this.messageCounts !== null) {
745
+ toReturn['messageCounts'] = 'toApiJson' in this.messageCounts ? this.messageCounts.toApiJson() : this.messageCounts;
746
+ }
747
+ return toReturn;
748
+ };
749
+ return GetMultiConversationMessageCountResponse;
750
+ }());
643
751
  var GetMultiMessagesRequest = /** @class */ (function () {
644
752
  function GetMultiMessagesRequest(kwargs) {
645
753
  if (!kwargs) {
@@ -1087,6 +1195,75 @@
1087
1195
  };
1088
1196
  return ReceiveMessageRequest;
1089
1197
  }());
1198
+ var SearchConversationsRequest = /** @class */ (function () {
1199
+ function SearchConversationsRequest(kwargs) {
1200
+ if (!kwargs) {
1201
+ return;
1202
+ }
1203
+ Object.assign(this, kwargs);
1204
+ }
1205
+ SearchConversationsRequest.fromProto = function (proto) {
1206
+ var m = new SearchConversationsRequest();
1207
+ m = Object.assign(m, proto);
1208
+ if (proto.location) {
1209
+ m.location = enumStringToValue$3(exports.PlatformLocation, proto.location);
1210
+ }
1211
+ if (proto.pagingOptions) {
1212
+ m.pagingOptions = PagedRequestOptions.fromProto(proto.pagingOptions);
1213
+ }
1214
+ return m;
1215
+ };
1216
+ SearchConversationsRequest.prototype.toApiJson = function () {
1217
+ var toReturn = {};
1218
+ if (typeof this.partnerId !== 'undefined') {
1219
+ toReturn['partnerId'] = this.partnerId;
1220
+ }
1221
+ if (typeof this.accountGroupId !== 'undefined') {
1222
+ toReturn['accountGroupId'] = this.accountGroupId;
1223
+ }
1224
+ if (typeof this.location !== 'undefined') {
1225
+ toReturn['location'] = this.location;
1226
+ }
1227
+ if (typeof this.searchTerm !== 'undefined') {
1228
+ toReturn['searchTerm'] = this.searchTerm;
1229
+ }
1230
+ if (typeof this.pagingOptions !== 'undefined' && this.pagingOptions !== null) {
1231
+ toReturn['pagingOptions'] = 'toApiJson' in this.pagingOptions ? this.pagingOptions.toApiJson() : this.pagingOptions;
1232
+ }
1233
+ return toReturn;
1234
+ };
1235
+ return SearchConversationsRequest;
1236
+ }());
1237
+ var SearchConversationsResponse = /** @class */ (function () {
1238
+ function SearchConversationsResponse(kwargs) {
1239
+ if (!kwargs) {
1240
+ return;
1241
+ }
1242
+ Object.assign(this, kwargs);
1243
+ }
1244
+ SearchConversationsResponse.fromProto = function (proto) {
1245
+ var m = new SearchConversationsResponse();
1246
+ m = Object.assign(m, proto);
1247
+ if (proto.conversations) {
1248
+ m.conversations = proto.conversations.map(SearchConversationsResponseDetailedConversation.fromProto);
1249
+ }
1250
+ if (proto.pagingMetadata) {
1251
+ m.pagingMetadata = PagedResponseMetadata.fromProto(proto.pagingMetadata);
1252
+ }
1253
+ return m;
1254
+ };
1255
+ SearchConversationsResponse.prototype.toApiJson = function () {
1256
+ var toReturn = {};
1257
+ if (typeof this.conversations !== 'undefined' && this.conversations !== null) {
1258
+ toReturn['conversations'] = 'toApiJson' in this.conversations ? this.conversations.toApiJson() : this.conversations;
1259
+ }
1260
+ if (typeof this.pagingMetadata !== 'undefined' && this.pagingMetadata !== null) {
1261
+ toReturn['pagingMetadata'] = 'toApiJson' in this.pagingMetadata ? this.pagingMetadata.toApiJson() : this.pagingMetadata;
1262
+ }
1263
+ return toReturn;
1264
+ };
1265
+ return SearchConversationsResponse;
1266
+ }());
1090
1267
  var SendMessageRequest = /** @class */ (function () {
1091
1268
  function SendMessageRequest(kwargs) {
1092
1269
  if (!kwargs) {
@@ -1325,6 +1502,16 @@
1325
1502
  return this.http.post(this.hostService.hostWithScheme() + "/conversation.v1.ConversationService/GetMultiParticipants", request.toApiJson(), this.apiOptions())
1326
1503
  .pipe(operators.map(function (resp) { return GetMultiParticipantsResponse.fromProto(resp); }), operators.share());
1327
1504
  };
1505
+ ConversationApiService.prototype.searchConversations = function (r) {
1506
+ var request = (r.toApiJson) ? r : new SearchConversationsRequest(r);
1507
+ return this.http.post(this.hostService.hostWithScheme() + "/conversation.v1.ConversationService/SearchConversations", request.toApiJson(), this.apiOptions())
1508
+ .pipe(operators.map(function (resp) { return SearchConversationsResponse.fromProto(resp); }), operators.share());
1509
+ };
1510
+ ConversationApiService.prototype.getMultiConversationMessageCount = function (r) {
1511
+ var request = (r.toApiJson) ? r : new GetMultiConversationMessageCountRequest(r);
1512
+ return this.http.post(this.hostService.hostWithScheme() + "/conversation.v1.ConversationService/GetMultiConversationMessageCount", request.toApiJson(), this.apiOptions())
1513
+ .pipe(operators.map(function (resp) { return GetMultiConversationMessageCountResponse.fromProto(resp); }), operators.share());
1514
+ };
1328
1515
  return ConversationApiService;
1329
1516
  }());
1330
1517
  ConversationApiService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ConversationApiService_Factory() { return new ConversationApiService(i0.ɵɵinject(i1$1.HttpClient), i0.ɵɵinject(HostService)); }, token: ConversationApiService, providedIn: "root" });
@@ -1344,6 +1531,7 @@
1344
1531
 
1345
1532
  exports.Conversation = Conversation;
1346
1533
  exports.ConversationApiService = ConversationApiService;
1534
+ exports.ConversationMessageCount = ConversationMessageCount;
1347
1535
  exports.CreateConversationRequest = CreateConversationRequest;
1348
1536
  exports.CreateConversationResponse = CreateConversationResponse;
1349
1537
  exports.CreateMultiMessagesRequest = CreateMultiMessagesRequest;
@@ -1353,6 +1541,8 @@
1353
1541
  exports.GetMultiConversationDetailsRequest = GetMultiConversationDetailsRequest;
1354
1542
  exports.GetMultiConversationDetailsResponse = GetMultiConversationDetailsResponse;
1355
1543
  exports.GetMultiConversationDetailsResponseDetailedConversation = GetMultiConversationDetailsResponseDetailedConversation;
1544
+ exports.GetMultiConversationMessageCountRequest = GetMultiConversationMessageCountRequest;
1545
+ exports.GetMultiConversationMessageCountResponse = GetMultiConversationMessageCountResponse;
1356
1546
  exports.GetMultiMessagesRequest = GetMultiMessagesRequest;
1357
1547
  exports.GetMultiMessagesResponse = GetMultiMessagesResponse;
1358
1548
  exports.GetMultiParticipantsRequest = GetMultiParticipantsRequest;
@@ -1373,6 +1563,9 @@
1373
1563
  exports.ParticipantMessageStatus = ParticipantMessageStatus;
1374
1564
  exports.ReceiveMessageRequest = ReceiveMessageRequest;
1375
1565
  exports.ReceiveMessageRequestMetadataEntry = ReceiveMessageRequestMetadataEntry;
1566
+ exports.SearchConversationsRequest = SearchConversationsRequest;
1567
+ exports.SearchConversationsResponse = SearchConversationsResponse;
1568
+ exports.SearchConversationsResponseDetailedConversation = SearchConversationsResponseDetailedConversation;
1376
1569
  exports.SendMessageRequest = SendMessageRequest;
1377
1570
  exports.SendMessageResponse = SendMessageResponse;
1378
1571
  exports.UpdateMessageStatusRequest = UpdateMessageStatusRequest;