@vendasta/conversation 0.9.0 → 0.13.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.
@@ -243,6 +243,42 @@
243
243
  }
244
244
  return enumRef[value];
245
245
  }
246
+ var Address = /** @class */ (function () {
247
+ function Address(kwargs) {
248
+ if (!kwargs) {
249
+ return;
250
+ }
251
+ Object.assign(this, kwargs);
252
+ }
253
+ Address.fromProto = function (proto) {
254
+ var m = new Address();
255
+ m = Object.assign(m, proto);
256
+ return m;
257
+ };
258
+ Address.prototype.toApiJson = function () {
259
+ var toReturn = {};
260
+ if (typeof this.firstLineAddress !== 'undefined') {
261
+ toReturn['firstLineAddress'] = this.firstLineAddress;
262
+ }
263
+ if (typeof this.secondLineAddress !== 'undefined') {
264
+ toReturn['secondLineAddress'] = this.secondLineAddress;
265
+ }
266
+ if (typeof this.city !== 'undefined') {
267
+ toReturn['city'] = this.city;
268
+ }
269
+ if (typeof this.state !== 'undefined') {
270
+ toReturn['state'] = this.state;
271
+ }
272
+ if (typeof this.country !== 'undefined') {
273
+ toReturn['country'] = this.country;
274
+ }
275
+ if (typeof this.zipCode !== 'undefined') {
276
+ toReturn['zipCode'] = this.zipCode;
277
+ }
278
+ return toReturn;
279
+ };
280
+ return Address;
281
+ }());
246
282
  var Participant = /** @class */ (function () {
247
283
  function Participant(kwargs) {
248
284
  if (!kwargs) {
@@ -271,6 +307,9 @@
271
307
  if (proto.participantType) {
272
308
  m.participantType = enumStringToValue$2(exports.ParticipantType, proto.participantType);
273
309
  }
310
+ if (proto.address) {
311
+ m.address = Address.fromProto(proto.address);
312
+ }
274
313
  return m;
275
314
  };
276
315
  Participant.prototype.toApiJson = function () {
@@ -317,6 +356,9 @@
317
356
  if (typeof this.phoneNumber !== 'undefined') {
318
357
  toReturn['phoneNumber'] = this.phoneNumber;
319
358
  }
359
+ if (typeof this.address !== 'undefined' && this.address !== null) {
360
+ toReturn['address'] = 'toApiJson' in this.address ? this.address.toApiJson() : this.address;
361
+ }
320
362
  return toReturn;
321
363
  };
322
364
  return Participant;
@@ -328,6 +370,84 @@
328
370
  }
329
371
  return enumRef[value];
330
372
  }
373
+ var AddMultiParticipantsRequest = /** @class */ (function () {
374
+ function AddMultiParticipantsRequest(kwargs) {
375
+ if (!kwargs) {
376
+ return;
377
+ }
378
+ Object.assign(this, kwargs);
379
+ }
380
+ AddMultiParticipantsRequest.fromProto = function (proto) {
381
+ var m = new AddMultiParticipantsRequest();
382
+ m = Object.assign(m, proto);
383
+ if (proto.participants) {
384
+ m.participants = proto.participants.map(Participant.fromProto);
385
+ }
386
+ return m;
387
+ };
388
+ AddMultiParticipantsRequest.prototype.toApiJson = function () {
389
+ var toReturn = {};
390
+ if (typeof this.conversationId !== 'undefined') {
391
+ toReturn['conversationId'] = this.conversationId;
392
+ }
393
+ if (typeof this.participants !== 'undefined' && this.participants !== null) {
394
+ toReturn['participants'] = 'toApiJson' in this.participants ? this.participants.toApiJson() : this.participants;
395
+ }
396
+ return toReturn;
397
+ };
398
+ return AddMultiParticipantsRequest;
399
+ }());
400
+ var AddMultiParticipantsResponse = /** @class */ (function () {
401
+ function AddMultiParticipantsResponse(kwargs) {
402
+ if (!kwargs) {
403
+ return;
404
+ }
405
+ Object.assign(this, kwargs);
406
+ }
407
+ AddMultiParticipantsResponse.fromProto = function (proto) {
408
+ var m = new AddMultiParticipantsResponse();
409
+ m = Object.assign(m, proto);
410
+ if (proto.participants) {
411
+ m.participants = proto.participants.map(Participant.fromProto);
412
+ }
413
+ return m;
414
+ };
415
+ AddMultiParticipantsResponse.prototype.toApiJson = function () {
416
+ var toReturn = {};
417
+ if (typeof this.participants !== 'undefined' && this.participants !== null) {
418
+ toReturn['participants'] = 'toApiJson' in this.participants ? this.participants.toApiJson() : this.participants;
419
+ }
420
+ return toReturn;
421
+ };
422
+ return AddMultiParticipantsResponse;
423
+ }());
424
+ var ConversationMessageCount = /** @class */ (function () {
425
+ function ConversationMessageCount(kwargs) {
426
+ if (!kwargs) {
427
+ return;
428
+ }
429
+ Object.assign(this, kwargs);
430
+ }
431
+ ConversationMessageCount.fromProto = function (proto) {
432
+ var m = new ConversationMessageCount();
433
+ m = Object.assign(m, proto);
434
+ if (proto.count) {
435
+ m.count = parseInt(proto.count, 10);
436
+ }
437
+ return m;
438
+ };
439
+ ConversationMessageCount.prototype.toApiJson = function () {
440
+ var toReturn = {};
441
+ if (typeof this.conversationId !== 'undefined') {
442
+ toReturn['conversationId'] = this.conversationId;
443
+ }
444
+ if (typeof this.count !== 'undefined') {
445
+ toReturn['count'] = this.count;
446
+ }
447
+ return toReturn;
448
+ };
449
+ return ConversationMessageCount;
450
+ }());
331
451
  var LookupConversationsResponseConversations = /** @class */ (function () {
332
452
  function LookupConversationsResponseConversations(kwargs) {
333
453
  if (!kwargs) {
@@ -358,6 +478,33 @@
358
478
  };
359
479
  return LookupConversationsResponseConversations;
360
480
  }());
481
+ var GetMultiConversationMessageCountResponseCountsEntry = /** @class */ (function () {
482
+ function GetMultiConversationMessageCountResponseCountsEntry(kwargs) {
483
+ if (!kwargs) {
484
+ return;
485
+ }
486
+ Object.assign(this, kwargs);
487
+ }
488
+ GetMultiConversationMessageCountResponseCountsEntry.fromProto = function (proto) {
489
+ var m = new GetMultiConversationMessageCountResponseCountsEntry();
490
+ m = Object.assign(m, proto);
491
+ if (proto.value) {
492
+ m.value = parseInt(proto.value, 10);
493
+ }
494
+ return m;
495
+ };
496
+ GetMultiConversationMessageCountResponseCountsEntry.prototype.toApiJson = function () {
497
+ var toReturn = {};
498
+ if (typeof this.key !== 'undefined') {
499
+ toReturn['key'] = this.key;
500
+ }
501
+ if (typeof this.value !== 'undefined') {
502
+ toReturn['value'] = this.value;
503
+ }
504
+ return toReturn;
505
+ };
506
+ return GetMultiConversationMessageCountResponseCountsEntry;
507
+ }());
361
508
  var CreateConversationRequest = /** @class */ (function () {
362
509
  function CreateConversationRequest(kwargs) {
363
510
  if (!kwargs) {
@@ -574,6 +721,42 @@
574
721
  };
575
722
  return GetMultiConversationDetailsResponseDetailedConversation;
576
723
  }());
724
+ var SearchConversationsResponseDetailedConversation = /** @class */ (function () {
725
+ function SearchConversationsResponseDetailedConversation(kwargs) {
726
+ if (!kwargs) {
727
+ return;
728
+ }
729
+ Object.assign(this, kwargs);
730
+ }
731
+ SearchConversationsResponseDetailedConversation.fromProto = function (proto) {
732
+ var m = new SearchConversationsResponseDetailedConversation();
733
+ m = Object.assign(m, proto);
734
+ if (proto.conversation) {
735
+ m.conversation = Conversation.fromProto(proto.conversation);
736
+ }
737
+ if (proto.latestMessage) {
738
+ m.latestMessage = Message.fromProto(proto.latestMessage);
739
+ }
740
+ if (proto.participants) {
741
+ m.participants = proto.participants.map(Participant.fromProto);
742
+ }
743
+ return m;
744
+ };
745
+ SearchConversationsResponseDetailedConversation.prototype.toApiJson = function () {
746
+ var toReturn = {};
747
+ if (typeof this.conversation !== 'undefined' && this.conversation !== null) {
748
+ toReturn['conversation'] = 'toApiJson' in this.conversation ? this.conversation.toApiJson() : this.conversation;
749
+ }
750
+ if (typeof this.latestMessage !== 'undefined' && this.latestMessage !== null) {
751
+ toReturn['latestMessage'] = 'toApiJson' in this.latestMessage ? this.latestMessage.toApiJson() : this.latestMessage;
752
+ }
753
+ if (typeof this.participants !== 'undefined' && this.participants !== null) {
754
+ toReturn['participants'] = 'toApiJson' in this.participants ? this.participants.toApiJson() : this.participants;
755
+ }
756
+ return toReturn;
757
+ };
758
+ return SearchConversationsResponseDetailedConversation;
759
+ }());
577
760
  var GetMessageRequest = /** @class */ (function () {
578
761
  function GetMessageRequest(kwargs) {
579
762
  if (!kwargs) {
@@ -640,6 +823,57 @@
640
823
  };
641
824
  return GetMultiConversationDetailsResponse;
642
825
  }());
826
+ var GetMultiConversationMessageCountRequest = /** @class */ (function () {
827
+ function GetMultiConversationMessageCountRequest(kwargs) {
828
+ if (!kwargs) {
829
+ return;
830
+ }
831
+ Object.assign(this, kwargs);
832
+ }
833
+ GetMultiConversationMessageCountRequest.fromProto = function (proto) {
834
+ var m = new GetMultiConversationMessageCountRequest();
835
+ m = Object.assign(m, proto);
836
+ return m;
837
+ };
838
+ GetMultiConversationMessageCountRequest.prototype.toApiJson = function () {
839
+ var toReturn = {};
840
+ if (typeof this.conversationIds !== 'undefined') {
841
+ toReturn['conversationIds'] = this.conversationIds;
842
+ }
843
+ return toReturn;
844
+ };
845
+ return GetMultiConversationMessageCountRequest;
846
+ }());
847
+ var GetMultiConversationMessageCountResponse = /** @class */ (function () {
848
+ function GetMultiConversationMessageCountResponse(kwargs) {
849
+ if (!kwargs) {
850
+ return;
851
+ }
852
+ Object.assign(this, kwargs);
853
+ }
854
+ GetMultiConversationMessageCountResponse.fromProto = function (proto) {
855
+ var m = new GetMultiConversationMessageCountResponse();
856
+ m = Object.assign(m, proto);
857
+ if (proto.messageCounts) {
858
+ m.messageCounts = proto.messageCounts.map(ConversationMessageCount.fromProto);
859
+ }
860
+ if (proto.counts) {
861
+ m.counts = Object.keys(proto.counts).reduce(function (obj, k) { obj[k] = parseInt(proto.counts[k], 10); return obj; }, {});
862
+ }
863
+ return m;
864
+ };
865
+ GetMultiConversationMessageCountResponse.prototype.toApiJson = function () {
866
+ var toReturn = {};
867
+ if (typeof this.messageCounts !== 'undefined' && this.messageCounts !== null) {
868
+ toReturn['messageCounts'] = 'toApiJson' in this.messageCounts ? this.messageCounts.toApiJson() : this.messageCounts;
869
+ }
870
+ if (typeof this.counts !== 'undefined' && this.counts !== null) {
871
+ toReturn['counts'] = 'toApiJson' in this.counts ? this.counts.toApiJson() : this.counts;
872
+ }
873
+ return toReturn;
874
+ };
875
+ return GetMultiConversationMessageCountResponse;
876
+ }());
643
877
  var GetMultiMessagesRequest = /** @class */ (function () {
644
878
  function GetMultiMessagesRequest(kwargs) {
645
879
  if (!kwargs) {
@@ -1087,6 +1321,75 @@
1087
1321
  };
1088
1322
  return ReceiveMessageRequest;
1089
1323
  }());
1324
+ var SearchConversationsRequest = /** @class */ (function () {
1325
+ function SearchConversationsRequest(kwargs) {
1326
+ if (!kwargs) {
1327
+ return;
1328
+ }
1329
+ Object.assign(this, kwargs);
1330
+ }
1331
+ SearchConversationsRequest.fromProto = function (proto) {
1332
+ var m = new SearchConversationsRequest();
1333
+ m = Object.assign(m, proto);
1334
+ if (proto.location) {
1335
+ m.location = enumStringToValue$3(exports.PlatformLocation, proto.location);
1336
+ }
1337
+ if (proto.pagingOptions) {
1338
+ m.pagingOptions = PagedRequestOptions.fromProto(proto.pagingOptions);
1339
+ }
1340
+ return m;
1341
+ };
1342
+ SearchConversationsRequest.prototype.toApiJson = function () {
1343
+ var toReturn = {};
1344
+ if (typeof this.partnerId !== 'undefined') {
1345
+ toReturn['partnerId'] = this.partnerId;
1346
+ }
1347
+ if (typeof this.accountGroupId !== 'undefined') {
1348
+ toReturn['accountGroupId'] = this.accountGroupId;
1349
+ }
1350
+ if (typeof this.location !== 'undefined') {
1351
+ toReturn['location'] = this.location;
1352
+ }
1353
+ if (typeof this.searchTerm !== 'undefined') {
1354
+ toReturn['searchTerm'] = this.searchTerm;
1355
+ }
1356
+ if (typeof this.pagingOptions !== 'undefined' && this.pagingOptions !== null) {
1357
+ toReturn['pagingOptions'] = 'toApiJson' in this.pagingOptions ? this.pagingOptions.toApiJson() : this.pagingOptions;
1358
+ }
1359
+ return toReturn;
1360
+ };
1361
+ return SearchConversationsRequest;
1362
+ }());
1363
+ var SearchConversationsResponse = /** @class */ (function () {
1364
+ function SearchConversationsResponse(kwargs) {
1365
+ if (!kwargs) {
1366
+ return;
1367
+ }
1368
+ Object.assign(this, kwargs);
1369
+ }
1370
+ SearchConversationsResponse.fromProto = function (proto) {
1371
+ var m = new SearchConversationsResponse();
1372
+ m = Object.assign(m, proto);
1373
+ if (proto.conversations) {
1374
+ m.conversations = proto.conversations.map(SearchConversationsResponseDetailedConversation.fromProto);
1375
+ }
1376
+ if (proto.pagingMetadata) {
1377
+ m.pagingMetadata = PagedResponseMetadata.fromProto(proto.pagingMetadata);
1378
+ }
1379
+ return m;
1380
+ };
1381
+ SearchConversationsResponse.prototype.toApiJson = function () {
1382
+ var toReturn = {};
1383
+ if (typeof this.conversations !== 'undefined' && this.conversations !== null) {
1384
+ toReturn['conversations'] = 'toApiJson' in this.conversations ? this.conversations.toApiJson() : this.conversations;
1385
+ }
1386
+ if (typeof this.pagingMetadata !== 'undefined' && this.pagingMetadata !== null) {
1387
+ toReturn['pagingMetadata'] = 'toApiJson' in this.pagingMetadata ? this.pagingMetadata.toApiJson() : this.pagingMetadata;
1388
+ }
1389
+ return toReturn;
1390
+ };
1391
+ return SearchConversationsResponse;
1392
+ }());
1090
1393
  var SendMessageRequest = /** @class */ (function () {
1091
1394
  function SendMessageRequest(kwargs) {
1092
1395
  if (!kwargs) {
@@ -1325,6 +1628,21 @@
1325
1628
  return this.http.post(this.hostService.hostWithScheme() + "/conversation.v1.ConversationService/GetMultiParticipants", request.toApiJson(), this.apiOptions())
1326
1629
  .pipe(operators.map(function (resp) { return GetMultiParticipantsResponse.fromProto(resp); }), operators.share());
1327
1630
  };
1631
+ ConversationApiService.prototype.searchConversations = function (r) {
1632
+ var request = (r.toApiJson) ? r : new SearchConversationsRequest(r);
1633
+ return this.http.post(this.hostService.hostWithScheme() + "/conversation.v1.ConversationService/SearchConversations", request.toApiJson(), this.apiOptions())
1634
+ .pipe(operators.map(function (resp) { return SearchConversationsResponse.fromProto(resp); }), operators.share());
1635
+ };
1636
+ ConversationApiService.prototype.getMultiConversationMessageCount = function (r) {
1637
+ var request = (r.toApiJson) ? r : new GetMultiConversationMessageCountRequest(r);
1638
+ return this.http.post(this.hostService.hostWithScheme() + "/conversation.v1.ConversationService/GetMultiConversationMessageCount", request.toApiJson(), this.apiOptions())
1639
+ .pipe(operators.map(function (resp) { return GetMultiConversationMessageCountResponse.fromProto(resp); }), operators.share());
1640
+ };
1641
+ ConversationApiService.prototype.addMultiParticipants = function (r) {
1642
+ var request = (r.toApiJson) ? r : new AddMultiParticipantsRequest(r);
1643
+ return this.http.post(this.hostService.hostWithScheme() + "/conversation.v1.ConversationService/AddMultiParticipants", request.toApiJson(), this.apiOptions())
1644
+ .pipe(operators.map(function (resp) { return AddMultiParticipantsResponse.fromProto(resp); }), operators.share());
1645
+ };
1328
1646
  return ConversationApiService;
1329
1647
  }());
1330
1648
  ConversationApiService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ConversationApiService_Factory() { return new ConversationApiService(i0.ɵɵinject(i1$1.HttpClient), i0.ɵɵinject(HostService)); }, token: ConversationApiService, providedIn: "root" });
@@ -1342,8 +1660,12 @@
1342
1660
  * Generated bundle index. Do not edit.
1343
1661
  */
1344
1662
 
1663
+ exports.AddMultiParticipantsRequest = AddMultiParticipantsRequest;
1664
+ exports.AddMultiParticipantsResponse = AddMultiParticipantsResponse;
1665
+ exports.Address = Address;
1345
1666
  exports.Conversation = Conversation;
1346
1667
  exports.ConversationApiService = ConversationApiService;
1668
+ exports.ConversationMessageCount = ConversationMessageCount;
1347
1669
  exports.CreateConversationRequest = CreateConversationRequest;
1348
1670
  exports.CreateConversationResponse = CreateConversationResponse;
1349
1671
  exports.CreateMultiMessagesRequest = CreateMultiMessagesRequest;
@@ -1353,6 +1675,9 @@
1353
1675
  exports.GetMultiConversationDetailsRequest = GetMultiConversationDetailsRequest;
1354
1676
  exports.GetMultiConversationDetailsResponse = GetMultiConversationDetailsResponse;
1355
1677
  exports.GetMultiConversationDetailsResponseDetailedConversation = GetMultiConversationDetailsResponseDetailedConversation;
1678
+ exports.GetMultiConversationMessageCountRequest = GetMultiConversationMessageCountRequest;
1679
+ exports.GetMultiConversationMessageCountResponse = GetMultiConversationMessageCountResponse;
1680
+ exports.GetMultiConversationMessageCountResponseCountsEntry = GetMultiConversationMessageCountResponseCountsEntry;
1356
1681
  exports.GetMultiMessagesRequest = GetMultiMessagesRequest;
1357
1682
  exports.GetMultiMessagesResponse = GetMultiMessagesResponse;
1358
1683
  exports.GetMultiParticipantsRequest = GetMultiParticipantsRequest;
@@ -1373,6 +1698,9 @@
1373
1698
  exports.ParticipantMessageStatus = ParticipantMessageStatus;
1374
1699
  exports.ReceiveMessageRequest = ReceiveMessageRequest;
1375
1700
  exports.ReceiveMessageRequestMetadataEntry = ReceiveMessageRequestMetadataEntry;
1701
+ exports.SearchConversationsRequest = SearchConversationsRequest;
1702
+ exports.SearchConversationsResponse = SearchConversationsResponse;
1703
+ exports.SearchConversationsResponseDetailedConversation = SearchConversationsResponseDetailedConversation;
1376
1704
  exports.SendMessageRequest = SendMessageRequest;
1377
1705
  exports.SendMessageResponse = SendMessageResponse;
1378
1706
  exports.UpdateMessageStatusRequest = UpdateMessageStatusRequest;