@vendasta/conversation 0.6.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.
@@ -33,6 +33,7 @@
33
33
  PlatformLocation[PlatformLocation["PLATFORM_LOCATION_VENDOR_CENTER"] = 3] = "PLATFORM_LOCATION_VENDOR_CENTER";
34
34
  PlatformLocation[PlatformLocation["PLATFORM_LOCATION_TASK_MANAGER"] = 4] = "PLATFORM_LOCATION_TASK_MANAGER";
35
35
  PlatformLocation[PlatformLocation["PLATFORM_LOCATION_PROPOSAL_BUILDER"] = 5] = "PLATFORM_LOCATION_PROPOSAL_BUILDER";
36
+ PlatformLocation[PlatformLocation["PLATFORM_LOCATION_SALES_CENTER"] = 6] = "PLATFORM_LOCATION_SALES_CENTER";
36
37
  })(exports.PlatformLocation || (exports.PlatformLocation = {}));
37
38
 
38
39
  // *********************************
@@ -43,6 +44,8 @@
43
44
  ParticipantType[ParticipantType["PARTICIPANT_TYPE_ACCOUNT_GROUP"] = 3] = "PARTICIPANT_TYPE_ACCOUNT_GROUP";
44
45
  ParticipantType[ParticipantType["PARTICIPANT_TYPE_PARTNER"] = 4] = "PARTICIPANT_TYPE_PARTNER";
45
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";
46
49
  })(exports.ParticipantType || (exports.ParticipantType = {}));
47
50
 
48
51
  // *********************************
@@ -325,6 +328,33 @@
325
328
  }
326
329
  return enumRef[value];
327
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
+ }());
328
358
  var LookupConversationsResponseConversations = /** @class */ (function () {
329
359
  function LookupConversationsResponseConversations(kwargs) {
330
360
  if (!kwargs) {
@@ -571,6 +601,42 @@
571
601
  };
572
602
  return GetMultiConversationDetailsResponseDetailedConversation;
573
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
+ }());
574
640
  var GetMessageRequest = /** @class */ (function () {
575
641
  function GetMessageRequest(kwargs) {
576
642
  if (!kwargs) {
@@ -637,6 +703,51 @@
637
703
  };
638
704
  return GetMultiConversationDetailsResponse;
639
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
+ }());
640
751
  var GetMultiMessagesRequest = /** @class */ (function () {
641
752
  function GetMultiMessagesRequest(kwargs) {
642
753
  if (!kwargs) {
@@ -824,6 +935,9 @@
824
935
  if (proto.channel) {
825
936
  m.channel = enumStringToValue$3(exports.ConversationChannel, proto.channel);
826
937
  }
938
+ if (proto.originLocation) {
939
+ m.originLocation = enumStringToValue$3(exports.PlatformLocation, proto.originLocation);
940
+ }
827
941
  return m;
828
942
  };
829
943
  LookupConversationsRequestLookupConversationsFilters.prototype.toApiJson = function () {
@@ -843,6 +957,12 @@
843
957
  if (typeof this.externalConversationId !== 'undefined') {
844
958
  toReturn['externalConversationId'] = this.externalConversationId;
845
959
  }
960
+ if (typeof this.originLocation !== 'undefined') {
961
+ toReturn['originLocation'] = this.originLocation;
962
+ }
963
+ if (typeof this.originLocationExternalId !== 'undefined') {
964
+ toReturn['originLocationExternalId'] = this.originLocationExternalId;
965
+ }
846
966
  return toReturn;
847
967
  };
848
968
  return LookupConversationsRequestLookupConversationsFilters;
@@ -1075,6 +1195,75 @@
1075
1195
  };
1076
1196
  return ReceiveMessageRequest;
1077
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
+ }());
1078
1267
  var SendMessageRequest = /** @class */ (function () {
1079
1268
  function SendMessageRequest(kwargs) {
1080
1269
  if (!kwargs) {
@@ -1313,6 +1502,16 @@
1313
1502
  return this.http.post(this.hostService.hostWithScheme() + "/conversation.v1.ConversationService/GetMultiParticipants", request.toApiJson(), this.apiOptions())
1314
1503
  .pipe(operators.map(function (resp) { return GetMultiParticipantsResponse.fromProto(resp); }), operators.share());
1315
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
+ };
1316
1515
  return ConversationApiService;
1317
1516
  }());
1318
1517
  ConversationApiService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ConversationApiService_Factory() { return new ConversationApiService(i0.ɵɵinject(i1$1.HttpClient), i0.ɵɵinject(HostService)); }, token: ConversationApiService, providedIn: "root" });
@@ -1332,6 +1531,7 @@
1332
1531
 
1333
1532
  exports.Conversation = Conversation;
1334
1533
  exports.ConversationApiService = ConversationApiService;
1534
+ exports.ConversationMessageCount = ConversationMessageCount;
1335
1535
  exports.CreateConversationRequest = CreateConversationRequest;
1336
1536
  exports.CreateConversationResponse = CreateConversationResponse;
1337
1537
  exports.CreateMultiMessagesRequest = CreateMultiMessagesRequest;
@@ -1341,6 +1541,8 @@
1341
1541
  exports.GetMultiConversationDetailsRequest = GetMultiConversationDetailsRequest;
1342
1542
  exports.GetMultiConversationDetailsResponse = GetMultiConversationDetailsResponse;
1343
1543
  exports.GetMultiConversationDetailsResponseDetailedConversation = GetMultiConversationDetailsResponseDetailedConversation;
1544
+ exports.GetMultiConversationMessageCountRequest = GetMultiConversationMessageCountRequest;
1545
+ exports.GetMultiConversationMessageCountResponse = GetMultiConversationMessageCountResponse;
1344
1546
  exports.GetMultiMessagesRequest = GetMultiMessagesRequest;
1345
1547
  exports.GetMultiMessagesResponse = GetMultiMessagesResponse;
1346
1548
  exports.GetMultiParticipantsRequest = GetMultiParticipantsRequest;
@@ -1361,6 +1563,9 @@
1361
1563
  exports.ParticipantMessageStatus = ParticipantMessageStatus;
1362
1564
  exports.ReceiveMessageRequest = ReceiveMessageRequest;
1363
1565
  exports.ReceiveMessageRequestMetadataEntry = ReceiveMessageRequestMetadataEntry;
1566
+ exports.SearchConversationsRequest = SearchConversationsRequest;
1567
+ exports.SearchConversationsResponse = SearchConversationsResponse;
1568
+ exports.SearchConversationsResponseDetailedConversation = SearchConversationsResponseDetailedConversation;
1364
1569
  exports.SendMessageRequest = SendMessageRequest;
1365
1570
  exports.SendMessageResponse = SendMessageResponse;
1366
1571
  exports.UpdateMessageStatusRequest = UpdateMessageStatusRequest;