@vendasta/conversation 0.36.0 → 0.38.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.
Files changed (37) hide show
  1. package/esm2020/lib/_internal/conversation.api.service.mjs +37 -3
  2. package/esm2020/lib/_internal/enums/common.enum.mjs +2 -1
  3. package/esm2020/lib/_internal/enums/conversation.enum.mjs +2 -1
  4. package/esm2020/lib/_internal/enums/index.mjs +2 -1
  5. package/esm2020/lib/_internal/enums/participant.enum.mjs +2 -1
  6. package/esm2020/lib/_internal/enums/widget.enum.mjs +13 -0
  7. package/esm2020/lib/_internal/interfaces/api.interface.mjs +1 -1
  8. package/esm2020/lib/_internal/interfaces/configuration.interface.mjs +1 -1
  9. package/esm2020/lib/_internal/interfaces/index.mjs +1 -1
  10. package/esm2020/lib/_internal/interfaces/message.interface.mjs +1 -1
  11. package/esm2020/lib/_internal/interfaces/widget.interface.mjs +8 -0
  12. package/esm2020/lib/_internal/objects/api.mjs +313 -1
  13. package/esm2020/lib/_internal/objects/configuration.mjs +7 -1
  14. package/esm2020/lib/_internal/objects/index.mjs +4 -3
  15. package/esm2020/lib/_internal/objects/message.mjs +39 -1
  16. package/esm2020/lib/_internal/objects/widget.mjs +58 -0
  17. package/fesm2015/vendasta-conversation.mjs +482 -20
  18. package/fesm2015/vendasta-conversation.mjs.map +1 -1
  19. package/fesm2020/vendasta-conversation.mjs +482 -20
  20. package/fesm2020/vendasta-conversation.mjs.map +1 -1
  21. package/lib/_internal/conversation.api.service.d.ts +9 -2
  22. package/lib/_internal/enums/common.enum.d.ts +2 -1
  23. package/lib/_internal/enums/conversation.enum.d.ts +2 -1
  24. package/lib/_internal/enums/index.d.ts +1 -0
  25. package/lib/_internal/enums/participant.enum.d.ts +2 -1
  26. package/lib/_internal/enums/widget.enum.d.ts +5 -0
  27. package/lib/_internal/interfaces/api.interface.d.ts +49 -0
  28. package/lib/_internal/interfaces/configuration.interface.d.ts +2 -0
  29. package/lib/_internal/interfaces/index.d.ts +3 -2
  30. package/lib/_internal/interfaces/message.interface.d.ts +6 -0
  31. package/lib/_internal/interfaces/widget.interface.d.ts +11 -0
  32. package/lib/_internal/objects/api.d.ts +88 -0
  33. package/lib/_internal/objects/configuration.d.ts +2 -0
  34. package/lib/_internal/objects/index.d.ts +3 -2
  35. package/lib/_internal/objects/message.d.ts +9 -0
  36. package/lib/_internal/objects/widget.d.ts +16 -0
  37. package/package.json +1 -1
@@ -43,6 +43,7 @@ var GlobalParticipantType;
43
43
  GlobalParticipantType[GlobalParticipantType["GLOBAL_PARTICIPANT_TYPE_DIGITAL_AGENT"] = 6] = "GLOBAL_PARTICIPANT_TYPE_DIGITAL_AGENT";
44
44
  GlobalParticipantType[GlobalParticipantType["GLOBAL_PARTICIPANT_TYPE_VENDOR"] = 7] = "GLOBAL_PARTICIPANT_TYPE_VENDOR";
45
45
  GlobalParticipantType[GlobalParticipantType["GLOBAL_PARTICIPANT_TYPE_OPENAI_BOT"] = 8] = "GLOBAL_PARTICIPANT_TYPE_OPENAI_BOT";
46
+ GlobalParticipantType[GlobalParticipantType["GLOBAL_PARTICIPANT_TYPE_ANONYMOUS"] = 9] = "GLOBAL_PARTICIPANT_TYPE_ANONYMOUS";
46
47
  })(GlobalParticipantType || (GlobalParticipantType = {}));
47
48
  var SortDirection;
48
49
  (function (SortDirection) {
@@ -66,6 +67,7 @@ var ConversationChannel;
66
67
  ConversationChannel[ConversationChannel["CONVERSATION_CHANNEL_OPENAI"] = 5] = "CONVERSATION_CHANNEL_OPENAI";
67
68
  ConversationChannel[ConversationChannel["CONVERSATION_CHANNEL_EMAIL"] = 6] = "CONVERSATION_CHANNEL_EMAIL";
68
69
  ConversationChannel[ConversationChannel["CONVERSATION_CHANNEL_GOOGLE_BUSINESS_COMMUNICATIONS"] = 7] = "CONVERSATION_CHANNEL_GOOGLE_BUSINESS_COMMUNICATIONS";
70
+ ConversationChannel[ConversationChannel["CONVERSATION_CHANNEL_WEB_CHAT"] = 8] = "CONVERSATION_CHANNEL_WEB_CHAT";
69
71
  })(ConversationChannel || (ConversationChannel = {}));
70
72
  var PlatformLocation;
71
73
  (function (PlatformLocation) {
@@ -95,6 +97,7 @@ var ParticipantType;
95
97
  ParticipantType[ParticipantType["PARTICIPANT_TYPE_DIGITAL_AGENT"] = 6] = "PARTICIPANT_TYPE_DIGITAL_AGENT";
96
98
  ParticipantType[ParticipantType["PARTICIPANT_TYPE_VENDOR"] = 7] = "PARTICIPANT_TYPE_VENDOR";
97
99
  ParticipantType[ParticipantType["PARTICIPANT_TYPE_OPENAI_BOT"] = 8] = "PARTICIPANT_TYPE_OPENAI_BOT";
100
+ ParticipantType[ParticipantType["PARTICIPANT_TYPE_ANONYMOUS"] = 9] = "PARTICIPANT_TYPE_ANONYMOUS";
98
101
  })(ParticipantType || (ParticipantType = {}));
99
102
 
100
103
  // *********************************
@@ -109,6 +112,19 @@ var ViewType;
109
112
  ViewType[ViewType["VIEW_TYPE_FOLLOWING"] = 1] = "VIEW_TYPE_FOLLOWING";
110
113
  })(ViewType || (ViewType = {}));
111
114
 
115
+ // *********************************
116
+ // Code generated by sdkgen
117
+ // DO NOT EDIT!.
118
+ //
119
+ // Enums.
120
+ // *********************************
121
+ var WidgetPosition;
122
+ (function (WidgetPosition) {
123
+ WidgetPosition[WidgetPosition["WIDGET_POSITION_UNSPECIFIED"] = 0] = "WIDGET_POSITION_UNSPECIFIED";
124
+ WidgetPosition[WidgetPosition["WIDGET_POSITION_RIGHT"] = 1] = "WIDGET_POSITION_RIGHT";
125
+ WidgetPosition[WidgetPosition["WIDGET_POSITION_LEFT"] = 2] = "WIDGET_POSITION_LEFT";
126
+ })(WidgetPosition || (WidgetPosition = {}));
127
+
112
128
  // *********************************
113
129
  // Code generated by sdkgen
114
130
  // DO NOT EDIT!.
@@ -135,7 +151,7 @@ var SetLastSeenRequestStatus;
135
151
  // Enums Index.
136
152
  // *********************************
137
153
 
138
- function enumStringToValue$7(enumRef, value) {
154
+ function enumStringToValue$8(enumRef, value) {
139
155
  if (typeof value === 'number') {
140
156
  return value;
141
157
  }
@@ -146,7 +162,7 @@ class Message {
146
162
  let m = new Message();
147
163
  m = Object.assign(m, proto);
148
164
  if (proto.type) {
149
- m.type = enumStringToValue$7(MessageType, proto.type);
165
+ m.type = enumStringToValue$8(MessageType, proto.type);
150
166
  }
151
167
  if (proto.created) {
152
168
  m.created = new Date(proto.created);
@@ -157,6 +173,9 @@ class Message {
157
173
  if (proto.deleted) {
158
174
  m.deleted = new Date(proto.deleted);
159
175
  }
176
+ if (proto.sendStatus) {
177
+ m.sendStatus = SendStatus.fromProto(proto.sendStatus);
178
+ }
160
179
  return m;
161
180
  }
162
181
  constructor(kwargs) {
@@ -200,6 +219,9 @@ class Message {
200
219
  if (typeof this.media !== 'undefined') {
201
220
  toReturn['media'] = this.media;
202
221
  }
222
+ if (typeof this.sendStatus !== 'undefined' && this.sendStatus !== null) {
223
+ toReturn['sendStatus'] = 'toApiJson' in this.sendStatus ? this.sendStatus.toApiJson() : this.sendStatus;
224
+ }
203
225
  return toReturn;
204
226
  }
205
227
  }
@@ -208,7 +230,7 @@ class ParticipantMessageStatus {
208
230
  let m = new ParticipantMessageStatus();
209
231
  m = Object.assign(m, proto);
210
232
  if (proto.status) {
211
- m.status = enumStringToValue$7(MessageStatus, proto.status);
233
+ m.status = enumStringToValue$8(MessageStatus, proto.status);
212
234
  }
213
235
  if (proto.updated) {
214
236
  m.updated = new Date(proto.updated);
@@ -238,8 +260,40 @@ class ParticipantMessageStatus {
238
260
  return toReturn;
239
261
  }
240
262
  }
263
+ class SendStatus {
264
+ static fromProto(proto) {
265
+ let m = new SendStatus();
266
+ m = Object.assign(m, proto);
267
+ if (proto.status) {
268
+ m.status = enumStringToValue$8(MessageStatus, proto.status);
269
+ }
270
+ if (proto.created) {
271
+ m.created = new Date(proto.created);
272
+ }
273
+ return m;
274
+ }
275
+ constructor(kwargs) {
276
+ if (!kwargs) {
277
+ return;
278
+ }
279
+ Object.assign(this, kwargs);
280
+ }
281
+ toApiJson() {
282
+ const toReturn = {};
283
+ if (typeof this.status !== 'undefined') {
284
+ toReturn['status'] = this.status;
285
+ }
286
+ if (typeof this.reason !== 'undefined') {
287
+ toReturn['reason'] = this.reason;
288
+ }
289
+ if (typeof this.created !== 'undefined' && this.created !== null) {
290
+ toReturn['created'] = 'toApiJson' in this.created ? this.created.toApiJson() : this.created;
291
+ }
292
+ return toReturn;
293
+ }
294
+ }
241
295
 
242
- function enumStringToValue$6(enumRef, value) {
296
+ function enumStringToValue$7(enumRef, value) {
243
297
  if (typeof value === 'number') {
244
298
  return value;
245
299
  }
@@ -250,7 +304,7 @@ class SubjectParticipant {
250
304
  let m = new SubjectParticipant();
251
305
  m = Object.assign(m, proto);
252
306
  if (proto.participantType) {
253
- m.participantType = enumStringToValue$6(GlobalParticipantType, proto.participantType);
307
+ m.participantType = enumStringToValue$7(GlobalParticipantType, proto.participantType);
254
308
  }
255
309
  return m;
256
310
  }
@@ -272,7 +326,7 @@ class SubjectParticipant {
272
326
  }
273
327
  }
274
328
 
275
- function enumStringToValue$5(enumRef, value) {
329
+ function enumStringToValue$6(enumRef, value) {
276
330
  if (typeof value === 'number') {
277
331
  return value;
278
332
  }
@@ -283,7 +337,7 @@ class Conversation {
283
337
  let m = new Conversation();
284
338
  m = Object.assign(m, proto);
285
339
  if (proto.channel) {
286
- m.channel = enumStringToValue$5(ConversationChannel, proto.channel);
340
+ m.channel = enumStringToValue$6(ConversationChannel, proto.channel);
287
341
  }
288
342
  if (proto.created) {
289
343
  m.created = new Date(proto.created);
@@ -298,7 +352,7 @@ class Conversation {
298
352
  m.latestMsgSentTime = new Date(proto.latestMsgSentTime);
299
353
  }
300
354
  if (proto.originLocation) {
301
- m.originLocation = enumStringToValue$5(PlatformLocation, proto.originLocation);
355
+ m.originLocation = enumStringToValue$6(PlatformLocation, proto.originLocation);
302
356
  }
303
357
  if (proto.lastSeenByParticipant) {
304
358
  m.lastSeenByParticipant = proto.lastSeenByParticipant.map(LastSeenByParticipant.fromProto);
@@ -360,7 +414,7 @@ class ConversationKey {
360
414
  m.subjectParticipants = proto.subjectParticipants.map(SubjectParticipant.fromProto);
361
415
  }
362
416
  if (proto.channel) {
363
- m.channel = enumStringToValue$5(ConversationChannel, proto.channel);
417
+ m.channel = enumStringToValue$6(ConversationChannel, proto.channel);
364
418
  }
365
419
  return m;
366
420
  }
@@ -411,7 +465,7 @@ class LastSeenByParticipant {
411
465
  }
412
466
  }
413
467
 
414
- function enumStringToValue$4(enumRef, value) {
468
+ function enumStringToValue$5(enumRef, value) {
415
469
  if (typeof value === 'number') {
416
470
  return value;
417
471
  }
@@ -457,10 +511,10 @@ class Participant {
457
511
  let m = new Participant();
458
512
  m = Object.assign(m, proto);
459
513
  if (proto.location) {
460
- m.location = enumStringToValue$4(PlatformLocation, proto.location);
514
+ m.location = enumStringToValue$5(PlatformLocation, proto.location);
461
515
  }
462
516
  if (proto.channel) {
463
- m.channel = enumStringToValue$4(ConversationChannel, proto.channel);
517
+ m.channel = enumStringToValue$5(ConversationChannel, proto.channel);
464
518
  }
465
519
  if (proto.created) {
466
520
  m.created = new Date(proto.created);
@@ -472,7 +526,7 @@ class Participant {
472
526
  m.deleted = new Date(proto.deleted);
473
527
  }
474
528
  if (proto.participantType) {
475
- m.participantType = enumStringToValue$4(ParticipantType, proto.participantType);
529
+ m.participantType = enumStringToValue$5(ParticipantType, proto.participantType);
476
530
  }
477
531
  if (proto.address) {
478
532
  m.address = Address.fromProto(proto.address);
@@ -549,13 +603,13 @@ class ParticipantKey {
549
603
  let m = new ParticipantKey();
550
604
  m = Object.assign(m, proto);
551
605
  if (proto.location) {
552
- m.location = enumStringToValue$4(PlatformLocation, proto.location);
606
+ m.location = enumStringToValue$5(PlatformLocation, proto.location);
553
607
  }
554
608
  if (proto.channels) {
555
- m.channels = proto.channels.map((v) => enumStringToValue$4(ConversationChannel, v));
609
+ m.channels = proto.channels.map((v) => enumStringToValue$5(ConversationChannel, v));
556
610
  }
557
611
  if (proto.participantType) {
558
- m.participantType = enumStringToValue$4(GlobalParticipantType, proto.participantType);
612
+ m.participantType = enumStringToValue$5(GlobalParticipantType, proto.participantType);
559
613
  }
560
614
  return m;
561
615
  }
@@ -589,7 +643,7 @@ class ParticipantKey {
589
643
  }
590
644
  }
591
645
 
592
- function enumStringToValue$3(enumRef, value) {
646
+ function enumStringToValue$4(enumRef, value) {
593
647
  if (typeof value === 'number') {
594
648
  return value;
595
649
  }
@@ -619,7 +673,7 @@ class Access {
619
673
  }
620
674
  }
621
675
 
622
- function enumStringToValue$2(enumRef, value) {
676
+ function enumStringToValue$3(enumRef, value) {
623
677
  if (typeof value === 'number') {
624
678
  return value;
625
679
  }
@@ -663,11 +717,17 @@ class Configuration {
663
717
  if (typeof this.showAvailabilityMessage !== 'undefined') {
664
718
  toReturn['showAvailabilityMessage'] = this.showAvailabilityMessage;
665
719
  }
720
+ if (typeof this.googleBusinessMessagesEnabled !== 'undefined') {
721
+ toReturn['googleBusinessMessagesEnabled'] = this.googleBusinessMessagesEnabled;
722
+ }
723
+ if (typeof this.smsEnabled !== 'undefined') {
724
+ toReturn['smsEnabled'] = this.smsEnabled;
725
+ }
666
726
  return toReturn;
667
727
  }
668
728
  }
669
729
 
670
- function enumStringToValue$1(enumRef, value) {
730
+ function enumStringToValue$2(enumRef, value) {
671
731
  if (typeof value === 'number') {
672
732
  return value;
673
733
  }
@@ -700,6 +760,63 @@ class View {
700
760
  }
701
761
  }
702
762
 
763
+ function enumStringToValue$1(enumRef, value) {
764
+ if (typeof value === 'number') {
765
+ return value;
766
+ }
767
+ return enumRef[value];
768
+ }
769
+ class Widget {
770
+ static fromProto(proto) {
771
+ let m = new Widget();
772
+ m = Object.assign(m, proto);
773
+ if (proto.position) {
774
+ m.position = enumStringToValue$1(WidgetPosition, proto.position);
775
+ }
776
+ if (proto.created) {
777
+ m.created = new Date(proto.created);
778
+ }
779
+ if (proto.updated) {
780
+ m.updated = new Date(proto.updated);
781
+ }
782
+ return m;
783
+ }
784
+ constructor(kwargs) {
785
+ if (!kwargs) {
786
+ return;
787
+ }
788
+ Object.assign(this, kwargs);
789
+ }
790
+ toApiJson() {
791
+ const toReturn = {};
792
+ if (typeof this.widgetId !== 'undefined') {
793
+ toReturn['widgetId'] = this.widgetId;
794
+ }
795
+ if (typeof this.name !== 'undefined') {
796
+ toReturn['name'] = this.name;
797
+ }
798
+ if (typeof this.namespace !== 'undefined') {
799
+ toReturn['namespace'] = this.namespace;
800
+ }
801
+ if (typeof this.color !== 'undefined') {
802
+ toReturn['color'] = this.color;
803
+ }
804
+ if (typeof this.allowedUrls !== 'undefined') {
805
+ toReturn['allowedUrls'] = this.allowedUrls;
806
+ }
807
+ if (typeof this.position !== 'undefined') {
808
+ toReturn['position'] = this.position;
809
+ }
810
+ if (typeof this.created !== 'undefined' && this.created !== null) {
811
+ toReturn['created'] = 'toApiJson' in this.created ? this.created.toApiJson() : this.created;
812
+ }
813
+ if (typeof this.updated !== 'undefined' && this.updated !== null) {
814
+ toReturn['updated'] = 'toApiJson' in this.updated ? this.updated.toApiJson() : this.updated;
815
+ }
816
+ return toReturn;
817
+ }
818
+ }
819
+
703
820
  function enumStringToValue(enumRef, value) {
704
821
  if (typeof value === 'number') {
705
822
  return value;
@@ -973,6 +1090,104 @@ class CreateMultiMessagesRequest {
973
1090
  return toReturn;
974
1091
  }
975
1092
  }
1093
+ class CreateWidgetConversationRequest {
1094
+ static fromProto(proto) {
1095
+ let m = new CreateWidgetConversationRequest();
1096
+ m = Object.assign(m, proto);
1097
+ return m;
1098
+ }
1099
+ constructor(kwargs) {
1100
+ if (!kwargs) {
1101
+ return;
1102
+ }
1103
+ Object.assign(this, kwargs);
1104
+ }
1105
+ toApiJson() {
1106
+ const toReturn = {};
1107
+ if (typeof this.widgetId !== 'undefined') {
1108
+ toReturn['widgetId'] = this.widgetId;
1109
+ }
1110
+ return toReturn;
1111
+ }
1112
+ }
1113
+ class CreateWidgetConversationResponse {
1114
+ static fromProto(proto) {
1115
+ let m = new CreateWidgetConversationResponse();
1116
+ m = Object.assign(m, proto);
1117
+ if (proto.conversation) {
1118
+ m.conversation = Conversation.fromProto(proto.conversation);
1119
+ }
1120
+ return m;
1121
+ }
1122
+ constructor(kwargs) {
1123
+ if (!kwargs) {
1124
+ return;
1125
+ }
1126
+ Object.assign(this, kwargs);
1127
+ }
1128
+ toApiJson() {
1129
+ const toReturn = {};
1130
+ if (typeof this.widgetParticipantToken !== 'undefined') {
1131
+ toReturn['widgetParticipantToken'] = this.widgetParticipantToken;
1132
+ }
1133
+ if (typeof this.conversation !== 'undefined' && this.conversation !== null) {
1134
+ toReturn['conversation'] = 'toApiJson' in this.conversation ? this.conversation.toApiJson() : this.conversation;
1135
+ }
1136
+ return toReturn;
1137
+ }
1138
+ }
1139
+ class CreateWidgetRequest {
1140
+ static fromProto(proto) {
1141
+ let m = new CreateWidgetRequest();
1142
+ m = Object.assign(m, proto);
1143
+ return m;
1144
+ }
1145
+ constructor(kwargs) {
1146
+ if (!kwargs) {
1147
+ return;
1148
+ }
1149
+ Object.assign(this, kwargs);
1150
+ }
1151
+ toApiJson() {
1152
+ const toReturn = {};
1153
+ if (typeof this.name !== 'undefined') {
1154
+ toReturn['name'] = this.name;
1155
+ }
1156
+ if (typeof this.namespace !== 'undefined') {
1157
+ toReturn['namespace'] = this.namespace;
1158
+ }
1159
+ if (typeof this.color !== 'undefined') {
1160
+ toReturn['color'] = this.color;
1161
+ }
1162
+ if (typeof this.allowedUrls !== 'undefined') {
1163
+ toReturn['allowedUrls'] = this.allowedUrls;
1164
+ }
1165
+ return toReturn;
1166
+ }
1167
+ }
1168
+ class CreateWidgetResponse {
1169
+ static fromProto(proto) {
1170
+ let m = new CreateWidgetResponse();
1171
+ m = Object.assign(m, proto);
1172
+ if (proto.widget) {
1173
+ m.widget = Widget.fromProto(proto.widget);
1174
+ }
1175
+ return m;
1176
+ }
1177
+ constructor(kwargs) {
1178
+ if (!kwargs) {
1179
+ return;
1180
+ }
1181
+ Object.assign(this, kwargs);
1182
+ }
1183
+ toApiJson() {
1184
+ const toReturn = {};
1185
+ if (typeof this.widget !== 'undefined' && this.widget !== null) {
1186
+ toReturn['widget'] = 'toApiJson' in this.widget ? this.widget.toApiJson() : this.widget;
1187
+ }
1188
+ return toReturn;
1189
+ }
1190
+ }
976
1191
  class MetadataDataEntry {
977
1192
  static fromProto(proto) {
978
1193
  let m = new MetadataDataEntry();
@@ -1036,6 +1251,26 @@ class DeleteMessageRequest {
1036
1251
  return toReturn;
1037
1252
  }
1038
1253
  }
1254
+ class DeleteWidgetRequest {
1255
+ static fromProto(proto) {
1256
+ let m = new DeleteWidgetRequest();
1257
+ m = Object.assign(m, proto);
1258
+ return m;
1259
+ }
1260
+ constructor(kwargs) {
1261
+ if (!kwargs) {
1262
+ return;
1263
+ }
1264
+ Object.assign(this, kwargs);
1265
+ }
1266
+ toApiJson() {
1267
+ const toReturn = {};
1268
+ if (typeof this.widgetId !== 'undefined') {
1269
+ toReturn['widgetId'] = this.widgetId;
1270
+ }
1271
+ return toReturn;
1272
+ }
1273
+ }
1039
1274
  class SearchConversationsResponseDetailedConversation {
1040
1275
  static fromProto(proto) {
1041
1276
  let m = new SearchConversationsResponseDetailedConversation();
@@ -1491,6 +1726,49 @@ class GetMultiParticipantsResponse {
1491
1726
  return toReturn;
1492
1727
  }
1493
1728
  }
1729
+ class GetMultiWidgetMessagesRequest {
1730
+ static fromProto(proto) {
1731
+ let m = new GetMultiWidgetMessagesRequest();
1732
+ m = Object.assign(m, proto);
1733
+ return m;
1734
+ }
1735
+ constructor(kwargs) {
1736
+ if (!kwargs) {
1737
+ return;
1738
+ }
1739
+ Object.assign(this, kwargs);
1740
+ }
1741
+ toApiJson() {
1742
+ const toReturn = {};
1743
+ if (typeof this.messageIds !== 'undefined') {
1744
+ toReturn['messageIds'] = this.messageIds;
1745
+ }
1746
+ return toReturn;
1747
+ }
1748
+ }
1749
+ class GetMultiWidgetMessagesResponse {
1750
+ static fromProto(proto) {
1751
+ let m = new GetMultiWidgetMessagesResponse();
1752
+ m = Object.assign(m, proto);
1753
+ if (proto.messages) {
1754
+ m.messages = proto.messages.map(Message.fromProto);
1755
+ }
1756
+ return m;
1757
+ }
1758
+ constructor(kwargs) {
1759
+ if (!kwargs) {
1760
+ return;
1761
+ }
1762
+ Object.assign(this, kwargs);
1763
+ }
1764
+ toApiJson() {
1765
+ const toReturn = {};
1766
+ if (typeof this.messages !== 'undefined' && this.messages !== null) {
1767
+ toReturn['messages'] = 'toApiJson' in this.messages ? this.messages.toApiJson() : this.messages;
1768
+ }
1769
+ return toReturn;
1770
+ }
1771
+ }
1494
1772
  class GetParticipantsByKeyRequest {
1495
1773
  static fromProto(proto) {
1496
1774
  let m = new GetParticipantsByKeyRequest();
@@ -1543,6 +1821,49 @@ class GetParticipantsByKeyResponse {
1543
1821
  return toReturn;
1544
1822
  }
1545
1823
  }
1824
+ class GetWidgetRequest {
1825
+ static fromProto(proto) {
1826
+ let m = new GetWidgetRequest();
1827
+ m = Object.assign(m, proto);
1828
+ return m;
1829
+ }
1830
+ constructor(kwargs) {
1831
+ if (!kwargs) {
1832
+ return;
1833
+ }
1834
+ Object.assign(this, kwargs);
1835
+ }
1836
+ toApiJson() {
1837
+ const toReturn = {};
1838
+ if (typeof this.widgetId !== 'undefined') {
1839
+ toReturn['widgetId'] = this.widgetId;
1840
+ }
1841
+ return toReturn;
1842
+ }
1843
+ }
1844
+ class GetWidgetResponse {
1845
+ static fromProto(proto) {
1846
+ let m = new GetWidgetResponse();
1847
+ m = Object.assign(m, proto);
1848
+ if (proto.widget) {
1849
+ m.widget = Widget.fromProto(proto.widget);
1850
+ }
1851
+ return m;
1852
+ }
1853
+ constructor(kwargs) {
1854
+ if (!kwargs) {
1855
+ return;
1856
+ }
1857
+ Object.assign(this, kwargs);
1858
+ }
1859
+ toApiJson() {
1860
+ const toReturn = {};
1861
+ if (typeof this.widget !== 'undefined' && this.widget !== null) {
1862
+ toReturn['widget'] = 'toApiJson' in this.widget ? this.widget.toApiJson() : this.widget;
1863
+ }
1864
+ return toReturn;
1865
+ }
1866
+ }
1546
1867
  class ListMessagesRequestListMessagesFilters {
1547
1868
  static fromProto(proto) {
1548
1869
  let m = new ListMessagesRequestListMessagesFilters();
@@ -1621,6 +1942,61 @@ class ListMessagesResponse {
1621
1942
  return toReturn;
1622
1943
  }
1623
1944
  }
1945
+ class ListWidgetsRequest {
1946
+ static fromProto(proto) {
1947
+ let m = new ListWidgetsRequest();
1948
+ m = Object.assign(m, proto);
1949
+ if (proto.pagingOptions) {
1950
+ m.pagingOptions = PagedRequestOptions.fromProto(proto.pagingOptions);
1951
+ }
1952
+ return m;
1953
+ }
1954
+ constructor(kwargs) {
1955
+ if (!kwargs) {
1956
+ return;
1957
+ }
1958
+ Object.assign(this, kwargs);
1959
+ }
1960
+ toApiJson() {
1961
+ const toReturn = {};
1962
+ if (typeof this.namespace !== 'undefined') {
1963
+ toReturn['namespace'] = this.namespace;
1964
+ }
1965
+ if (typeof this.pagingOptions !== 'undefined' && this.pagingOptions !== null) {
1966
+ toReturn['pagingOptions'] = 'toApiJson' in this.pagingOptions ? this.pagingOptions.toApiJson() : this.pagingOptions;
1967
+ }
1968
+ return toReturn;
1969
+ }
1970
+ }
1971
+ class ListWidgetsResponse {
1972
+ static fromProto(proto) {
1973
+ let m = new ListWidgetsResponse();
1974
+ m = Object.assign(m, proto);
1975
+ if (proto.widgets) {
1976
+ m.widgets = proto.widgets.map(Widget.fromProto);
1977
+ }
1978
+ if (proto.pagingMetadata) {
1979
+ m.pagingMetadata = PagedResponseMetadata.fromProto(proto.pagingMetadata);
1980
+ }
1981
+ return m;
1982
+ }
1983
+ constructor(kwargs) {
1984
+ if (!kwargs) {
1985
+ return;
1986
+ }
1987
+ Object.assign(this, kwargs);
1988
+ }
1989
+ toApiJson() {
1990
+ const toReturn = {};
1991
+ if (typeof this.widgets !== 'undefined' && this.widgets !== null) {
1992
+ toReturn['widgets'] = 'toApiJson' in this.widgets ? this.widgets.toApiJson() : this.widgets;
1993
+ }
1994
+ if (typeof this.pagingMetadata !== 'undefined' && this.pagingMetadata !== null) {
1995
+ toReturn['pagingMetadata'] = 'toApiJson' in this.pagingMetadata ? this.pagingMetadata.toApiJson() : this.pagingMetadata;
1996
+ }
1997
+ return toReturn;
1998
+ }
1999
+ }
1624
2000
  class LookupConversationsRequestLookupConversationsFilters {
1625
2001
  static fromProto(proto) {
1626
2002
  let m = new LookupConversationsRequestLookupConversationsFilters();
@@ -2183,6 +2559,58 @@ class UpdateMessageStatusRequest {
2183
2559
  return toReturn;
2184
2560
  }
2185
2561
  }
2562
+ class UpdateWidgetRequest {
2563
+ static fromProto(proto) {
2564
+ let m = new UpdateWidgetRequest();
2565
+ m = Object.assign(m, proto);
2566
+ return m;
2567
+ }
2568
+ constructor(kwargs) {
2569
+ if (!kwargs) {
2570
+ return;
2571
+ }
2572
+ Object.assign(this, kwargs);
2573
+ }
2574
+ toApiJson() {
2575
+ const toReturn = {};
2576
+ if (typeof this.widgetId !== 'undefined') {
2577
+ toReturn['widgetId'] = this.widgetId;
2578
+ }
2579
+ if (typeof this.name !== 'undefined') {
2580
+ toReturn['name'] = this.name;
2581
+ }
2582
+ if (typeof this.color !== 'undefined') {
2583
+ toReturn['color'] = this.color;
2584
+ }
2585
+ if (typeof this.allowedUrls !== 'undefined') {
2586
+ toReturn['allowedUrls'] = this.allowedUrls;
2587
+ }
2588
+ return toReturn;
2589
+ }
2590
+ }
2591
+ class UpdateWidgetResponse {
2592
+ static fromProto(proto) {
2593
+ let m = new UpdateWidgetResponse();
2594
+ m = Object.assign(m, proto);
2595
+ if (proto.widget) {
2596
+ m.widget = Widget.fromProto(proto.widget);
2597
+ }
2598
+ return m;
2599
+ }
2600
+ constructor(kwargs) {
2601
+ if (!kwargs) {
2602
+ return;
2603
+ }
2604
+ Object.assign(this, kwargs);
2605
+ }
2606
+ toApiJson() {
2607
+ const toReturn = {};
2608
+ if (typeof this.widget !== 'undefined' && this.widget !== null) {
2609
+ toReturn['widget'] = 'toApiJson' in this.widget ? this.widget.toApiJson() : this.widget;
2610
+ }
2611
+ return toReturn;
2612
+ }
2613
+ }
2186
2614
  class UpsertConfigurationRequest {
2187
2615
  static fromProto(proto) {
2188
2616
  let m = new UpsertConfigurationRequest();
@@ -2384,6 +2812,40 @@ class ConversationApiService {
2384
2812
  const request = (r.toApiJson) ? r : new RemoveConversationFromConversationViewRequest(r);
2385
2813
  return this.http.post(this._host + "/conversation.v1.ConversationService/RemoveConversationFromConversationView", request.toApiJson(), Object.assign(Object.assign({}, this.apiOptions()), { observe: 'response' }));
2386
2814
  }
2815
+ createWidgetConversation(r) {
2816
+ const request = (r.toApiJson) ? r : new CreateWidgetConversationRequest(r);
2817
+ return this.http.post(this._host + "/conversation.v1.ConversationService/CreateWidgetConversation", request.toApiJson(), this.apiOptions())
2818
+ .pipe(map(resp => CreateWidgetConversationResponse.fromProto(resp)));
2819
+ }
2820
+ getMultiWidgetMessages(r) {
2821
+ const request = (r.toApiJson) ? r : new GetMultiWidgetMessagesRequest(r);
2822
+ return this.http.post(this._host + "/conversation.v1.ConversationService/GetMultiWidgetMessages", request.toApiJson(), this.apiOptions())
2823
+ .pipe(map(resp => GetMultiWidgetMessagesResponse.fromProto(resp)));
2824
+ }
2825
+ createWidget(r) {
2826
+ const request = (r.toApiJson) ? r : new CreateWidgetRequest(r);
2827
+ return this.http.post(this._host + "/conversation.v1.ConversationService/CreateWidget", request.toApiJson(), this.apiOptions())
2828
+ .pipe(map(resp => CreateWidgetResponse.fromProto(resp)));
2829
+ }
2830
+ getWidget(r) {
2831
+ const request = (r.toApiJson) ? r : new GetWidgetRequest(r);
2832
+ return this.http.post(this._host + "/conversation.v1.ConversationService/GetWidget", request.toApiJson(), this.apiOptions())
2833
+ .pipe(map(resp => GetWidgetResponse.fromProto(resp)));
2834
+ }
2835
+ updateWidget(r) {
2836
+ const request = (r.toApiJson) ? r : new UpdateWidgetRequest(r);
2837
+ return this.http.post(this._host + "/conversation.v1.ConversationService/UpdateWidget", request.toApiJson(), this.apiOptions())
2838
+ .pipe(map(resp => UpdateWidgetResponse.fromProto(resp)));
2839
+ }
2840
+ deleteWidget(r) {
2841
+ const request = (r.toApiJson) ? r : new DeleteWidgetRequest(r);
2842
+ return this.http.post(this._host + "/conversation.v1.ConversationService/DeleteWidget", request.toApiJson(), Object.assign(Object.assign({}, this.apiOptions()), { observe: 'response' }));
2843
+ }
2844
+ listWidgets(r) {
2845
+ const request = (r.toApiJson) ? r : new ListWidgetsRequest(r);
2846
+ return this.http.post(this._host + "/conversation.v1.ConversationService/ListWidgets", request.toApiJson(), this.apiOptions())
2847
+ .pipe(map(resp => ListWidgetsResponse.fromProto(resp)));
2848
+ }
2387
2849
  }
2388
2850
  ConversationApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConversationApiService, deps: [{ token: i1.HttpClient }, { token: HostService }], target: i0.ɵɵFactoryTarget.Injectable });
2389
2851
  ConversationApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConversationApiService, providedIn: 'root' });
@@ -2446,5 +2908,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2446
2908
  * Generated bundle index. Do not edit.
2447
2909
  */
2448
2910
 
2449
- export { Access, AddConversationToConversationViewRequest, AddMultiParticipantsRequest, AddMultiParticipantsResponse, Address, Configuration, Conversation, ConversationApiService, ConversationChannel, ConversationKey, ConversationMessageCount, CreateConversationRequest, CreateConversationResponse, CreateMultiMessagesRequest, DeleteConversationRequest, DeleteMessageRequest, GetConfigurationRequest, GetConfigurationResponse, GetConversationByKeyRequest, GetConversationByKeyResponse, GetConversationViewsRequest, GetConversationViewsResponse, GetMessageRequest, GetMultiConfigurationRequest, GetMultiConfigurationResponse, GetMultiConversationDetailsRequest, GetMultiConversationDetailsResponse, GetMultiConversationDetailsResponseDetailedConversation, GetMultiConversationMessageCountRequest, GetMultiConversationMessageCountResponse, GetMultiConversationMessageCountResponseCountsEntry, GetMultiMessagesRequest, GetMultiMessagesResponse, GetMultiParticipantsRequest, GetMultiParticipantsResponse, GetParticipantsByKeyRequest, GetParticipantsByKeyResponse, GlobalParticipantType, InboxApiService, LastSeenByParticipant, ListMessagesRequest, ListMessagesRequestListMessagesFilters, ListMessagesResponse, 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, SetLastSeenRequest, SetLastSeenRequestStatus, SetLastSeenResponse, SortDirection, SubjectParticipant, UpdateMessageStatusRequest, UpsertConfigurationRequest, UpsertConfigurationResponse, View, ViewType };
2911
+ 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 };
2450
2912
  //# sourceMappingURL=vendasta-conversation.mjs.map