@vendasta/conversation 0.38.0 → 0.39.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.
@@ -151,7 +151,7 @@ var SetLastSeenRequestStatus;
151
151
  // Enums Index.
152
152
  // *********************************
153
153
 
154
- function enumStringToValue$8(enumRef, value) {
154
+ function enumStringToValue$9(enumRef, value) {
155
155
  if (typeof value === 'number') {
156
156
  return value;
157
157
  }
@@ -162,7 +162,7 @@ class Message {
162
162
  let m = new Message();
163
163
  m = Object.assign(m, proto);
164
164
  if (proto.type) {
165
- m.type = enumStringToValue$8(MessageType, proto.type);
165
+ m.type = enumStringToValue$9(MessageType, proto.type);
166
166
  }
167
167
  if (proto.created) {
168
168
  m.created = new Date(proto.created);
@@ -230,7 +230,7 @@ class ParticipantMessageStatus {
230
230
  let m = new ParticipantMessageStatus();
231
231
  m = Object.assign(m, proto);
232
232
  if (proto.status) {
233
- m.status = enumStringToValue$8(MessageStatus, proto.status);
233
+ m.status = enumStringToValue$9(MessageStatus, proto.status);
234
234
  }
235
235
  if (proto.updated) {
236
236
  m.updated = new Date(proto.updated);
@@ -265,7 +265,7 @@ class SendStatus {
265
265
  let m = new SendStatus();
266
266
  m = Object.assign(m, proto);
267
267
  if (proto.status) {
268
- m.status = enumStringToValue$8(MessageStatus, proto.status);
268
+ m.status = enumStringToValue$9(MessageStatus, proto.status);
269
269
  }
270
270
  if (proto.created) {
271
271
  m.created = new Date(proto.created);
@@ -293,7 +293,7 @@ class SendStatus {
293
293
  }
294
294
  }
295
295
 
296
- function enumStringToValue$7(enumRef, value) {
296
+ function enumStringToValue$8(enumRef, value) {
297
297
  if (typeof value === 'number') {
298
298
  return value;
299
299
  }
@@ -304,7 +304,7 @@ class SubjectParticipant {
304
304
  let m = new SubjectParticipant();
305
305
  m = Object.assign(m, proto);
306
306
  if (proto.participantType) {
307
- m.participantType = enumStringToValue$7(GlobalParticipantType, proto.participantType);
307
+ m.participantType = enumStringToValue$8(GlobalParticipantType, proto.participantType);
308
308
  }
309
309
  return m;
310
310
  }
@@ -326,7 +326,7 @@ class SubjectParticipant {
326
326
  }
327
327
  }
328
328
 
329
- function enumStringToValue$6(enumRef, value) {
329
+ function enumStringToValue$7(enumRef, value) {
330
330
  if (typeof value === 'number') {
331
331
  return value;
332
332
  }
@@ -337,7 +337,7 @@ class Conversation {
337
337
  let m = new Conversation();
338
338
  m = Object.assign(m, proto);
339
339
  if (proto.channel) {
340
- m.channel = enumStringToValue$6(ConversationChannel, proto.channel);
340
+ m.channel = enumStringToValue$7(ConversationChannel, proto.channel);
341
341
  }
342
342
  if (proto.created) {
343
343
  m.created = new Date(proto.created);
@@ -352,7 +352,7 @@ class Conversation {
352
352
  m.latestMsgSentTime = new Date(proto.latestMsgSentTime);
353
353
  }
354
354
  if (proto.originLocation) {
355
- m.originLocation = enumStringToValue$6(PlatformLocation, proto.originLocation);
355
+ m.originLocation = enumStringToValue$7(PlatformLocation, proto.originLocation);
356
356
  }
357
357
  if (proto.lastSeenByParticipant) {
358
358
  m.lastSeenByParticipant = proto.lastSeenByParticipant.map(LastSeenByParticipant.fromProto);
@@ -414,7 +414,7 @@ class ConversationKey {
414
414
  m.subjectParticipants = proto.subjectParticipants.map(SubjectParticipant.fromProto);
415
415
  }
416
416
  if (proto.channel) {
417
- m.channel = enumStringToValue$6(ConversationChannel, proto.channel);
417
+ m.channel = enumStringToValue$7(ConversationChannel, proto.channel);
418
418
  }
419
419
  return m;
420
420
  }
@@ -465,7 +465,7 @@ class LastSeenByParticipant {
465
465
  }
466
466
  }
467
467
 
468
- function enumStringToValue$5(enumRef, value) {
468
+ function enumStringToValue$6(enumRef, value) {
469
469
  if (typeof value === 'number') {
470
470
  return value;
471
471
  }
@@ -511,10 +511,10 @@ class Participant {
511
511
  let m = new Participant();
512
512
  m = Object.assign(m, proto);
513
513
  if (proto.location) {
514
- m.location = enumStringToValue$5(PlatformLocation, proto.location);
514
+ m.location = enumStringToValue$6(PlatformLocation, proto.location);
515
515
  }
516
516
  if (proto.channel) {
517
- m.channel = enumStringToValue$5(ConversationChannel, proto.channel);
517
+ m.channel = enumStringToValue$6(ConversationChannel, proto.channel);
518
518
  }
519
519
  if (proto.created) {
520
520
  m.created = new Date(proto.created);
@@ -526,7 +526,7 @@ class Participant {
526
526
  m.deleted = new Date(proto.deleted);
527
527
  }
528
528
  if (proto.participantType) {
529
- m.participantType = enumStringToValue$5(ParticipantType, proto.participantType);
529
+ m.participantType = enumStringToValue$6(ParticipantType, proto.participantType);
530
530
  }
531
531
  if (proto.address) {
532
532
  m.address = Address.fromProto(proto.address);
@@ -603,13 +603,13 @@ class ParticipantKey {
603
603
  let m = new ParticipantKey();
604
604
  m = Object.assign(m, proto);
605
605
  if (proto.location) {
606
- m.location = enumStringToValue$5(PlatformLocation, proto.location);
606
+ m.location = enumStringToValue$6(PlatformLocation, proto.location);
607
607
  }
608
608
  if (proto.channels) {
609
- m.channels = proto.channels.map((v) => enumStringToValue$5(ConversationChannel, v));
609
+ m.channels = proto.channels.map((v) => enumStringToValue$6(ConversationChannel, v));
610
610
  }
611
611
  if (proto.participantType) {
612
- m.participantType = enumStringToValue$5(GlobalParticipantType, proto.participantType);
612
+ m.participantType = enumStringToValue$6(GlobalParticipantType, proto.participantType);
613
613
  }
614
614
  return m;
615
615
  }
@@ -643,7 +643,7 @@ class ParticipantKey {
643
643
  }
644
644
  }
645
645
 
646
- function enumStringToValue$4(enumRef, value) {
646
+ function enumStringToValue$5(enumRef, value) {
647
647
  if (typeof value === 'number') {
648
648
  return value;
649
649
  }
@@ -673,7 +673,7 @@ class Access {
673
673
  }
674
674
  }
675
675
 
676
- function enumStringToValue$3(enumRef, value) {
676
+ function enumStringToValue$4(enumRef, value) {
677
677
  if (typeof value === 'number') {
678
678
  return value;
679
679
  }
@@ -727,7 +727,7 @@ class Configuration {
727
727
  }
728
728
  }
729
729
 
730
- function enumStringToValue$2(enumRef, value) {
730
+ function enumStringToValue$3(enumRef, value) {
731
731
  if (typeof value === 'number') {
732
732
  return value;
733
733
  }
@@ -760,7 +760,7 @@ class View {
760
760
  }
761
761
  }
762
762
 
763
- function enumStringToValue$1(enumRef, value) {
763
+ function enumStringToValue$2(enumRef, value) {
764
764
  if (typeof value === 'number') {
765
765
  return value;
766
766
  }
@@ -771,7 +771,7 @@ class Widget {
771
771
  let m = new Widget();
772
772
  m = Object.assign(m, proto);
773
773
  if (proto.position) {
774
- m.position = enumStringToValue$1(WidgetPosition, proto.position);
774
+ m.position = enumStringToValue$2(WidgetPosition, proto.position);
775
775
  }
776
776
  if (proto.created) {
777
777
  m.created = new Date(proto.created);
@@ -813,6 +813,39 @@ class Widget {
813
813
  if (typeof this.updated !== 'undefined' && this.updated !== null) {
814
814
  toReturn['updated'] = 'toApiJson' in this.updated ? this.updated.toApiJson() : this.updated;
815
815
  }
816
+ if (typeof this.isEnabled !== 'undefined') {
817
+ toReturn['isEnabled'] = this.isEnabled;
818
+ }
819
+ if (typeof this.welcomeMessage !== 'undefined') {
820
+ toReturn['welcomeMessage'] = this.welcomeMessage;
821
+ }
822
+ return toReturn;
823
+ }
824
+ }
825
+
826
+ function enumStringToValue$1(enumRef, value) {
827
+ if (typeof value === 'number') {
828
+ return value;
829
+ }
830
+ return enumRef[value];
831
+ }
832
+ class FieldMask {
833
+ static fromProto(proto) {
834
+ let m = new FieldMask();
835
+ m = Object.assign(m, proto);
836
+ return m;
837
+ }
838
+ constructor(kwargs) {
839
+ if (!kwargs) {
840
+ return;
841
+ }
842
+ Object.assign(this, kwargs);
843
+ }
844
+ toApiJson() {
845
+ const toReturn = {};
846
+ if (typeof this.paths !== 'undefined') {
847
+ toReturn['paths'] = this.paths;
848
+ }
816
849
  return toReturn;
817
850
  }
818
851
  }
@@ -1821,6 +1854,29 @@ class GetParticipantsByKeyResponse {
1821
1854
  return toReturn;
1822
1855
  }
1823
1856
  }
1857
+ class GetWidgetConversationResponse {
1858
+ static fromProto(proto) {
1859
+ let m = new GetWidgetConversationResponse();
1860
+ m = Object.assign(m, proto);
1861
+ if (proto.conversation) {
1862
+ m.conversation = Conversation.fromProto(proto.conversation);
1863
+ }
1864
+ return m;
1865
+ }
1866
+ constructor(kwargs) {
1867
+ if (!kwargs) {
1868
+ return;
1869
+ }
1870
+ Object.assign(this, kwargs);
1871
+ }
1872
+ toApiJson() {
1873
+ const toReturn = {};
1874
+ if (typeof this.conversation !== 'undefined' && this.conversation !== null) {
1875
+ toReturn['conversation'] = 'toApiJson' in this.conversation ? this.conversation.toApiJson() : this.conversation;
1876
+ }
1877
+ return toReturn;
1878
+ }
1879
+ }
1824
1880
  class GetWidgetRequest {
1825
1881
  static fromProto(proto) {
1826
1882
  let m = new GetWidgetRequest();
@@ -2475,6 +2531,44 @@ class SendMessageResponse {
2475
2531
  return toReturn;
2476
2532
  }
2477
2533
  }
2534
+ class SendWidgetMessageRequest {
2535
+ static fromProto(proto) {
2536
+ let m = new SendWidgetMessageRequest();
2537
+ m = Object.assign(m, proto);
2538
+ if (proto.type) {
2539
+ m.type = enumStringToValue(MessageType, proto.type);
2540
+ }
2541
+ if (proto.metadata) {
2542
+ m.metadata = proto.metadata.map(Metadata.fromProto);
2543
+ }
2544
+ if (proto.location) {
2545
+ m.location = enumStringToValue(PlatformLocation, proto.location);
2546
+ }
2547
+ return m;
2548
+ }
2549
+ constructor(kwargs) {
2550
+ if (!kwargs) {
2551
+ return;
2552
+ }
2553
+ Object.assign(this, kwargs);
2554
+ }
2555
+ toApiJson() {
2556
+ const toReturn = {};
2557
+ if (typeof this.type !== 'undefined') {
2558
+ toReturn['type'] = this.type;
2559
+ }
2560
+ if (typeof this.body !== 'undefined') {
2561
+ toReturn['body'] = this.body;
2562
+ }
2563
+ if (typeof this.metadata !== 'undefined' && this.metadata !== null) {
2564
+ toReturn['metadata'] = 'toApiJson' in this.metadata ? this.metadata.toApiJson() : this.metadata;
2565
+ }
2566
+ if (typeof this.location !== 'undefined') {
2567
+ toReturn['location'] = this.location;
2568
+ }
2569
+ return toReturn;
2570
+ }
2571
+ }
2478
2572
  class SetLastSeenRequest {
2479
2573
  static fromProto(proto) {
2480
2574
  let m = new SetLastSeenRequest();
@@ -2563,6 +2657,9 @@ class UpdateWidgetRequest {
2563
2657
  static fromProto(proto) {
2564
2658
  let m = new UpdateWidgetRequest();
2565
2659
  m = Object.assign(m, proto);
2660
+ if (proto.fieldMask) {
2661
+ m.fieldMask = FieldMask.fromProto(proto.fieldMask);
2662
+ }
2566
2663
  return m;
2567
2664
  }
2568
2665
  constructor(kwargs) {
@@ -2585,6 +2682,15 @@ class UpdateWidgetRequest {
2585
2682
  if (typeof this.allowedUrls !== 'undefined') {
2586
2683
  toReturn['allowedUrls'] = this.allowedUrls;
2587
2684
  }
2685
+ if (typeof this.welcomeMessage !== 'undefined') {
2686
+ toReturn['welcomeMessage'] = this.welcomeMessage;
2687
+ }
2688
+ if (typeof this.isEnabled !== 'undefined') {
2689
+ toReturn['isEnabled'] = this.isEnabled;
2690
+ }
2691
+ if (typeof this.fieldMask !== 'undefined' && this.fieldMask !== null) {
2692
+ toReturn['fieldMask'] = 'toApiJson' in this.fieldMask ? this.fieldMask.toApiJson() : this.fieldMask;
2693
+ }
2588
2694
  return toReturn;
2589
2695
  }
2590
2696
  }
@@ -2821,6 +2927,14 @@ class ConversationApiService {
2821
2927
  return this.http.post(this._host + "/conversation.v1.ConversationService/GetMultiWidgetMessages", request.toApiJson(), this.apiOptions())
2822
2928
  .pipe(map(resp => GetMultiWidgetMessagesResponse.fromProto(resp)));
2823
2929
  }
2930
+ sendWidgetMessage(r) {
2931
+ const request = (r.toApiJson) ? r : new SendWidgetMessageRequest(r);
2932
+ return this.http.post(this._host + "/conversation.v1.ConversationService/SendWidgetMessage", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
2933
+ }
2934
+ getWidgetConversation() {
2935
+ return this.http.post(this._host + "/conversation.v1.ConversationService/GetWidgetConversation", {}, this.apiOptions())
2936
+ .pipe(map(resp => GetWidgetConversationResponse.fromProto(resp)));
2937
+ }
2824
2938
  createWidget(r) {
2825
2939
  const request = (r.toApiJson) ? r : new CreateWidgetRequest(r);
2826
2940
  return this.http.post(this._host + "/conversation.v1.ConversationService/CreateWidget", request.toApiJson(), this.apiOptions())
@@ -2907,5 +3021,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2907
3021
  * Generated bundle index. Do not edit.
2908
3022
  */
2909
3023
 
2910
- export { Access, AddConversationToConversationViewRequest, AddMultiParticipantsRequest, AddMultiParticipantsResponse, Address, Configuration, Conversation, ConversationApiService, ConversationChannel, ConversationKey, ConversationMessageCount, CreateConversationRequest, CreateConversationResponse, CreateMultiMessagesRequest, CreateWidgetConversationRequest, CreateWidgetConversationResponse, CreateWidgetRequest, CreateWidgetResponse, DeleteConversationRequest, DeleteMessageRequest, DeleteWidgetRequest, GetConfigurationRequest, GetConfigurationResponse, GetConversationByKeyRequest, GetConversationByKeyResponse, GetConversationViewsRequest, GetConversationViewsResponse, GetMessageRequest, GetMultiConfigurationRequest, GetMultiConfigurationResponse, GetMultiConversationDetailsRequest, GetMultiConversationDetailsResponse, GetMultiConversationDetailsResponseDetailedConversation, GetMultiConversationMessageCountRequest, GetMultiConversationMessageCountResponse, GetMultiConversationMessageCountResponseCountsEntry, GetMultiMessagesRequest, GetMultiMessagesResponse, GetMultiParticipantsRequest, GetMultiParticipantsResponse, GetMultiWidgetMessagesRequest, GetMultiWidgetMessagesResponse, GetParticipantsByKeyRequest, GetParticipantsByKeyResponse, GetWidgetRequest, GetWidgetResponse, GlobalParticipantType, InboxApiService, LastSeenByParticipant, ListMessagesRequest, ListMessagesRequestListMessagesFilters, ListMessagesResponse, ListWidgetsRequest, ListWidgetsResponse, LookupConversationsRequest, LookupConversationsRequestLookupConversationsFilters, LookupConversationsResponse, LookupConversationsResponseConversations, Media, Message, MessageStatus, MessageType, Metadata, MetadataDataEntry, MetadataIdentifier, PagedRequestOptions, PagedResponseMetadata, Participant, ParticipantKey, ParticipantMessageStatus, ParticipantType, PlatformLocation, ReceiveMessageRequest, ReceiveMessageRequestMetadataEntry, RemoveConversationFromConversationViewRequest, SearchConversationsRequest, SearchConversationsResponse, SearchConversationsResponseDetailedConversation, SendMessageRequest, SendMessageResponse, SendStatus, SetLastSeenRequest, SetLastSeenRequestStatus, SetLastSeenResponse, SortDirection, SubjectParticipant, UpdateMessageStatusRequest, UpdateWidgetRequest, UpdateWidgetResponse, UpsertConfigurationRequest, UpsertConfigurationResponse, View, ViewType, Widget, WidgetPosition };
3024
+ export { Access, AddConversationToConversationViewRequest, AddMultiParticipantsRequest, AddMultiParticipantsResponse, Address, Configuration, Conversation, ConversationApiService, ConversationChannel, ConversationKey, ConversationMessageCount, CreateConversationRequest, CreateConversationResponse, CreateMultiMessagesRequest, CreateWidgetConversationRequest, CreateWidgetConversationResponse, CreateWidgetRequest, CreateWidgetResponse, DeleteConversationRequest, DeleteMessageRequest, DeleteWidgetRequest, FieldMask, GetConfigurationRequest, GetConfigurationResponse, GetConversationByKeyRequest, GetConversationByKeyResponse, GetConversationViewsRequest, GetConversationViewsResponse, GetMessageRequest, GetMultiConfigurationRequest, GetMultiConfigurationResponse, GetMultiConversationDetailsRequest, GetMultiConversationDetailsResponse, GetMultiConversationDetailsResponseDetailedConversation, GetMultiConversationMessageCountRequest, GetMultiConversationMessageCountResponse, GetMultiConversationMessageCountResponseCountsEntry, GetMultiMessagesRequest, GetMultiMessagesResponse, GetMultiParticipantsRequest, GetMultiParticipantsResponse, GetMultiWidgetMessagesRequest, GetMultiWidgetMessagesResponse, GetParticipantsByKeyRequest, GetParticipantsByKeyResponse, GetWidgetConversationResponse, GetWidgetRequest, GetWidgetResponse, GlobalParticipantType, InboxApiService, LastSeenByParticipant, ListMessagesRequest, ListMessagesRequestListMessagesFilters, ListMessagesResponse, ListWidgetsRequest, ListWidgetsResponse, LookupConversationsRequest, LookupConversationsRequestLookupConversationsFilters, LookupConversationsResponse, LookupConversationsResponseConversations, Media, Message, MessageStatus, MessageType, Metadata, MetadataDataEntry, MetadataIdentifier, PagedRequestOptions, PagedResponseMetadata, Participant, ParticipantKey, ParticipantMessageStatus, ParticipantType, PlatformLocation, ReceiveMessageRequest, ReceiveMessageRequestMetadataEntry, RemoveConversationFromConversationViewRequest, SearchConversationsRequest, SearchConversationsResponse, SearchConversationsResponseDetailedConversation, SendMessageRequest, SendMessageResponse, SendStatus, SendWidgetMessageRequest, SetLastSeenRequest, SetLastSeenRequestStatus, SetLastSeenResponse, SortDirection, SubjectParticipant, UpdateMessageStatusRequest, UpdateWidgetRequest, UpdateWidgetResponse, UpsertConfigurationRequest, UpsertConfigurationResponse, View, ViewType, Widget, WidgetPosition };
2911
3025
  //# sourceMappingURL=vendasta-conversation.mjs.map