@vendasta/conversation 0.7.0 → 0.11.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.
@@ -44,6 +44,8 @@
44
44
  ParticipantType[ParticipantType["PARTICIPANT_TYPE_ACCOUNT_GROUP"] = 3] = "PARTICIPANT_TYPE_ACCOUNT_GROUP";
45
45
  ParticipantType[ParticipantType["PARTICIPANT_TYPE_PARTNER"] = 4] = "PARTICIPANT_TYPE_PARTNER";
46
46
  ParticipantType[ParticipantType["PARTICIPANT_TYPE_IAM_TEMPORARY_SUBJECT"] = 5] = "PARTICIPANT_TYPE_IAM_TEMPORARY_SUBJECT";
47
+ ParticipantType[ParticipantType["PARTICIPANT_TYPE_DIGITAL_AGENT"] = 6] = "PARTICIPANT_TYPE_DIGITAL_AGENT";
48
+ ParticipantType[ParticipantType["PARTICIPANT_TYPE_VENDOR"] = 7] = "PARTICIPANT_TYPE_VENDOR";
47
49
  })(exports.ParticipantType || (exports.ParticipantType = {}));
48
50
 
49
51
  // *********************************
@@ -326,6 +328,33 @@
326
328
  }
327
329
  return enumRef[value];
328
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
+ }());
329
358
  var LookupConversationsResponseConversations = /** @class */ (function () {
330
359
  function LookupConversationsResponseConversations(kwargs) {
331
360
  if (!kwargs) {
@@ -356,6 +385,33 @@
356
385
  };
357
386
  return LookupConversationsResponseConversations;
358
387
  }());
388
+ var GetMultiConversationMessageCountResponseCountsEntry = /** @class */ (function () {
389
+ function GetMultiConversationMessageCountResponseCountsEntry(kwargs) {
390
+ if (!kwargs) {
391
+ return;
392
+ }
393
+ Object.assign(this, kwargs);
394
+ }
395
+ GetMultiConversationMessageCountResponseCountsEntry.fromProto = function (proto) {
396
+ var m = new GetMultiConversationMessageCountResponseCountsEntry();
397
+ m = Object.assign(m, proto);
398
+ if (proto.value) {
399
+ m.value = parseInt(proto.value, 10);
400
+ }
401
+ return m;
402
+ };
403
+ GetMultiConversationMessageCountResponseCountsEntry.prototype.toApiJson = function () {
404
+ var toReturn = {};
405
+ if (typeof this.key !== 'undefined') {
406
+ toReturn['key'] = this.key;
407
+ }
408
+ if (typeof this.value !== 'undefined') {
409
+ toReturn['value'] = this.value;
410
+ }
411
+ return toReturn;
412
+ };
413
+ return GetMultiConversationMessageCountResponseCountsEntry;
414
+ }());
359
415
  var CreateConversationRequest = /** @class */ (function () {
360
416
  function CreateConversationRequest(kwargs) {
361
417
  if (!kwargs) {
@@ -536,6 +592,42 @@
536
592
  };
537
593
  return DeleteMessageRequest;
538
594
  }());
595
+ var SearchConversationsResponseDetailedConversation = /** @class */ (function () {
596
+ function SearchConversationsResponseDetailedConversation(kwargs) {
597
+ if (!kwargs) {
598
+ return;
599
+ }
600
+ Object.assign(this, kwargs);
601
+ }
602
+ SearchConversationsResponseDetailedConversation.fromProto = function (proto) {
603
+ var m = new SearchConversationsResponseDetailedConversation();
604
+ m = Object.assign(m, proto);
605
+ if (proto.conversation) {
606
+ m.conversation = Conversation.fromProto(proto.conversation);
607
+ }
608
+ if (proto.latestMessage) {
609
+ m.latestMessage = Message.fromProto(proto.latestMessage);
610
+ }
611
+ if (proto.participants) {
612
+ m.participants = proto.participants.map(Participant.fromProto);
613
+ }
614
+ return m;
615
+ };
616
+ SearchConversationsResponseDetailedConversation.prototype.toApiJson = function () {
617
+ var toReturn = {};
618
+ if (typeof this.conversation !== 'undefined' && this.conversation !== null) {
619
+ toReturn['conversation'] = 'toApiJson' in this.conversation ? this.conversation.toApiJson() : this.conversation;
620
+ }
621
+ if (typeof this.latestMessage !== 'undefined' && this.latestMessage !== null) {
622
+ toReturn['latestMessage'] = 'toApiJson' in this.latestMessage ? this.latestMessage.toApiJson() : this.latestMessage;
623
+ }
624
+ if (typeof this.participants !== 'undefined' && this.participants !== null) {
625
+ toReturn['participants'] = 'toApiJson' in this.participants ? this.participants.toApiJson() : this.participants;
626
+ }
627
+ return toReturn;
628
+ };
629
+ return SearchConversationsResponseDetailedConversation;
630
+ }());
539
631
  var GetMultiConversationDetailsResponseDetailedConversation = /** @class */ (function () {
540
632
  function GetMultiConversationDetailsResponseDetailedConversation(kwargs) {
541
633
  if (!kwargs) {
@@ -638,6 +730,57 @@
638
730
  };
639
731
  return GetMultiConversationDetailsResponse;
640
732
  }());
733
+ var GetMultiConversationMessageCountRequest = /** @class */ (function () {
734
+ function GetMultiConversationMessageCountRequest(kwargs) {
735
+ if (!kwargs) {
736
+ return;
737
+ }
738
+ Object.assign(this, kwargs);
739
+ }
740
+ GetMultiConversationMessageCountRequest.fromProto = function (proto) {
741
+ var m = new GetMultiConversationMessageCountRequest();
742
+ m = Object.assign(m, proto);
743
+ return m;
744
+ };
745
+ GetMultiConversationMessageCountRequest.prototype.toApiJson = function () {
746
+ var toReturn = {};
747
+ if (typeof this.conversationIds !== 'undefined') {
748
+ toReturn['conversationIds'] = this.conversationIds;
749
+ }
750
+ return toReturn;
751
+ };
752
+ return GetMultiConversationMessageCountRequest;
753
+ }());
754
+ var GetMultiConversationMessageCountResponse = /** @class */ (function () {
755
+ function GetMultiConversationMessageCountResponse(kwargs) {
756
+ if (!kwargs) {
757
+ return;
758
+ }
759
+ Object.assign(this, kwargs);
760
+ }
761
+ GetMultiConversationMessageCountResponse.fromProto = function (proto) {
762
+ var m = new GetMultiConversationMessageCountResponse();
763
+ m = Object.assign(m, proto);
764
+ if (proto.messageCounts) {
765
+ m.messageCounts = proto.messageCounts.map(ConversationMessageCount.fromProto);
766
+ }
767
+ if (proto.counts) {
768
+ m.counts = Object.keys(proto.counts).reduce(function (obj, k) { obj[k] = parseInt(proto.counts[k], 10); return obj; }, {});
769
+ }
770
+ return m;
771
+ };
772
+ GetMultiConversationMessageCountResponse.prototype.toApiJson = function () {
773
+ var toReturn = {};
774
+ if (typeof this.messageCounts !== 'undefined' && this.messageCounts !== null) {
775
+ toReturn['messageCounts'] = 'toApiJson' in this.messageCounts ? this.messageCounts.toApiJson() : this.messageCounts;
776
+ }
777
+ if (typeof this.counts !== 'undefined' && this.counts !== null) {
778
+ toReturn['counts'] = 'toApiJson' in this.counts ? this.counts.toApiJson() : this.counts;
779
+ }
780
+ return toReturn;
781
+ };
782
+ return GetMultiConversationMessageCountResponse;
783
+ }());
641
784
  var GetMultiMessagesRequest = /** @class */ (function () {
642
785
  function GetMultiMessagesRequest(kwargs) {
643
786
  if (!kwargs) {
@@ -1085,6 +1228,75 @@
1085
1228
  };
1086
1229
  return ReceiveMessageRequest;
1087
1230
  }());
1231
+ var SearchConversationsRequest = /** @class */ (function () {
1232
+ function SearchConversationsRequest(kwargs) {
1233
+ if (!kwargs) {
1234
+ return;
1235
+ }
1236
+ Object.assign(this, kwargs);
1237
+ }
1238
+ SearchConversationsRequest.fromProto = function (proto) {
1239
+ var m = new SearchConversationsRequest();
1240
+ m = Object.assign(m, proto);
1241
+ if (proto.location) {
1242
+ m.location = enumStringToValue$3(exports.PlatformLocation, proto.location);
1243
+ }
1244
+ if (proto.pagingOptions) {
1245
+ m.pagingOptions = PagedRequestOptions.fromProto(proto.pagingOptions);
1246
+ }
1247
+ return m;
1248
+ };
1249
+ SearchConversationsRequest.prototype.toApiJson = function () {
1250
+ var toReturn = {};
1251
+ if (typeof this.partnerId !== 'undefined') {
1252
+ toReturn['partnerId'] = this.partnerId;
1253
+ }
1254
+ if (typeof this.accountGroupId !== 'undefined') {
1255
+ toReturn['accountGroupId'] = this.accountGroupId;
1256
+ }
1257
+ if (typeof this.location !== 'undefined') {
1258
+ toReturn['location'] = this.location;
1259
+ }
1260
+ if (typeof this.searchTerm !== 'undefined') {
1261
+ toReturn['searchTerm'] = this.searchTerm;
1262
+ }
1263
+ if (typeof this.pagingOptions !== 'undefined' && this.pagingOptions !== null) {
1264
+ toReturn['pagingOptions'] = 'toApiJson' in this.pagingOptions ? this.pagingOptions.toApiJson() : this.pagingOptions;
1265
+ }
1266
+ return toReturn;
1267
+ };
1268
+ return SearchConversationsRequest;
1269
+ }());
1270
+ var SearchConversationsResponse = /** @class */ (function () {
1271
+ function SearchConversationsResponse(kwargs) {
1272
+ if (!kwargs) {
1273
+ return;
1274
+ }
1275
+ Object.assign(this, kwargs);
1276
+ }
1277
+ SearchConversationsResponse.fromProto = function (proto) {
1278
+ var m = new SearchConversationsResponse();
1279
+ m = Object.assign(m, proto);
1280
+ if (proto.conversations) {
1281
+ m.conversations = proto.conversations.map(SearchConversationsResponseDetailedConversation.fromProto);
1282
+ }
1283
+ if (proto.pagingMetadata) {
1284
+ m.pagingMetadata = PagedResponseMetadata.fromProto(proto.pagingMetadata);
1285
+ }
1286
+ return m;
1287
+ };
1288
+ SearchConversationsResponse.prototype.toApiJson = function () {
1289
+ var toReturn = {};
1290
+ if (typeof this.conversations !== 'undefined' && this.conversations !== null) {
1291
+ toReturn['conversations'] = 'toApiJson' in this.conversations ? this.conversations.toApiJson() : this.conversations;
1292
+ }
1293
+ if (typeof this.pagingMetadata !== 'undefined' && this.pagingMetadata !== null) {
1294
+ toReturn['pagingMetadata'] = 'toApiJson' in this.pagingMetadata ? this.pagingMetadata.toApiJson() : this.pagingMetadata;
1295
+ }
1296
+ return toReturn;
1297
+ };
1298
+ return SearchConversationsResponse;
1299
+ }());
1088
1300
  var SendMessageRequest = /** @class */ (function () {
1089
1301
  function SendMessageRequest(kwargs) {
1090
1302
  if (!kwargs) {
@@ -1323,6 +1535,16 @@
1323
1535
  return this.http.post(this.hostService.hostWithScheme() + "/conversation.v1.ConversationService/GetMultiParticipants", request.toApiJson(), this.apiOptions())
1324
1536
  .pipe(operators.map(function (resp) { return GetMultiParticipantsResponse.fromProto(resp); }), operators.share());
1325
1537
  };
1538
+ ConversationApiService.prototype.searchConversations = function (r) {
1539
+ var request = (r.toApiJson) ? r : new SearchConversationsRequest(r);
1540
+ return this.http.post(this.hostService.hostWithScheme() + "/conversation.v1.ConversationService/SearchConversations", request.toApiJson(), this.apiOptions())
1541
+ .pipe(operators.map(function (resp) { return SearchConversationsResponse.fromProto(resp); }), operators.share());
1542
+ };
1543
+ ConversationApiService.prototype.getMultiConversationMessageCount = function (r) {
1544
+ var request = (r.toApiJson) ? r : new GetMultiConversationMessageCountRequest(r);
1545
+ return this.http.post(this.hostService.hostWithScheme() + "/conversation.v1.ConversationService/GetMultiConversationMessageCount", request.toApiJson(), this.apiOptions())
1546
+ .pipe(operators.map(function (resp) { return GetMultiConversationMessageCountResponse.fromProto(resp); }), operators.share());
1547
+ };
1326
1548
  return ConversationApiService;
1327
1549
  }());
1328
1550
  ConversationApiService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ConversationApiService_Factory() { return new ConversationApiService(i0.ɵɵinject(i1$1.HttpClient), i0.ɵɵinject(HostService)); }, token: ConversationApiService, providedIn: "root" });
@@ -1342,6 +1564,7 @@
1342
1564
 
1343
1565
  exports.Conversation = Conversation;
1344
1566
  exports.ConversationApiService = ConversationApiService;
1567
+ exports.ConversationMessageCount = ConversationMessageCount;
1345
1568
  exports.CreateConversationRequest = CreateConversationRequest;
1346
1569
  exports.CreateConversationResponse = CreateConversationResponse;
1347
1570
  exports.CreateMultiMessagesRequest = CreateMultiMessagesRequest;
@@ -1351,6 +1574,9 @@
1351
1574
  exports.GetMultiConversationDetailsRequest = GetMultiConversationDetailsRequest;
1352
1575
  exports.GetMultiConversationDetailsResponse = GetMultiConversationDetailsResponse;
1353
1576
  exports.GetMultiConversationDetailsResponseDetailedConversation = GetMultiConversationDetailsResponseDetailedConversation;
1577
+ exports.GetMultiConversationMessageCountRequest = GetMultiConversationMessageCountRequest;
1578
+ exports.GetMultiConversationMessageCountResponse = GetMultiConversationMessageCountResponse;
1579
+ exports.GetMultiConversationMessageCountResponseCountsEntry = GetMultiConversationMessageCountResponseCountsEntry;
1354
1580
  exports.GetMultiMessagesRequest = GetMultiMessagesRequest;
1355
1581
  exports.GetMultiMessagesResponse = GetMultiMessagesResponse;
1356
1582
  exports.GetMultiParticipantsRequest = GetMultiParticipantsRequest;
@@ -1371,6 +1597,9 @@
1371
1597
  exports.ParticipantMessageStatus = ParticipantMessageStatus;
1372
1598
  exports.ReceiveMessageRequest = ReceiveMessageRequest;
1373
1599
  exports.ReceiveMessageRequestMetadataEntry = ReceiveMessageRequestMetadataEntry;
1600
+ exports.SearchConversationsRequest = SearchConversationsRequest;
1601
+ exports.SearchConversationsResponse = SearchConversationsResponse;
1602
+ exports.SearchConversationsResponseDetailedConversation = SearchConversationsResponseDetailedConversation;
1374
1603
  exports.SendMessageRequest = SendMessageRequest;
1375
1604
  exports.SendMessageResponse = SendMessageResponse;
1376
1605
  exports.UpdateMessageStatusRequest = UpdateMessageStatusRequest;