@vendasta/conversation 0.20.0 → 0.22.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.
@@ -92,10 +92,15 @@ var MetadataIdentifier;
92
92
  MetadataIdentifier[MetadataIdentifier["METADATA_IDENTIFIER_SENDER"] = 2] = "METADATA_IDENTIFIER_SENDER";
93
93
  MetadataIdentifier[MetadataIdentifier["METADATA_IDENTIFIER_CONVERSATION"] = 3] = "METADATA_IDENTIFIER_CONVERSATION";
94
94
  })(MetadataIdentifier || (MetadataIdentifier = {}));
95
+ var SetLastSeenRequestStatus;
96
+ (function (SetLastSeenRequestStatus) {
97
+ SetLastSeenRequestStatus[SetLastSeenRequestStatus["SET_LAST_SEEN_REQUEST_STATUS_READ"] = 0] = "SET_LAST_SEEN_REQUEST_STATUS_READ";
98
+ SetLastSeenRequestStatus[SetLastSeenRequestStatus["SET_LAST_SEEN_REQUEST_STATUS_UNREAD"] = 1] = "SET_LAST_SEEN_REQUEST_STATUS_UNREAD";
99
+ })(SetLastSeenRequestStatus || (SetLastSeenRequestStatus = {}));
95
100
 
96
101
  // *********************************
97
102
 
98
- function enumStringToValue$3(enumRef, value) {
103
+ function enumStringToValue$4(enumRef, value) {
99
104
  if (typeof value === 'number') {
100
105
  return value;
101
106
  }
@@ -112,7 +117,7 @@ class Message {
112
117
  let m = new Message();
113
118
  m = Object.assign(m, proto);
114
119
  if (proto.type) {
115
- m.type = enumStringToValue$3(MessageType, proto.type);
120
+ m.type = enumStringToValue$4(MessageType, proto.type);
116
121
  }
117
122
  if (proto.created) {
118
123
  m.created = new Date(proto.created);
@@ -174,7 +179,7 @@ class ParticipantMessageStatus {
174
179
  let m = new ParticipantMessageStatus();
175
180
  m = Object.assign(m, proto);
176
181
  if (proto.status) {
177
- m.status = enumStringToValue$3(MessageStatus, proto.status);
182
+ m.status = enumStringToValue$4(MessageStatus, proto.status);
178
183
  }
179
184
  if (proto.updated) {
180
185
  m.updated = new Date(proto.updated);
@@ -199,7 +204,7 @@ class ParticipantMessageStatus {
199
204
  }
200
205
  }
201
206
 
202
- function enumStringToValue$2(enumRef, value) {
207
+ function enumStringToValue$3(enumRef, value) {
203
208
  if (typeof value === 'number') {
204
209
  return value;
205
210
  }
@@ -216,7 +221,7 @@ class Conversation {
216
221
  let m = new Conversation();
217
222
  m = Object.assign(m, proto);
218
223
  if (proto.channel) {
219
- m.channel = enumStringToValue$2(ConversationChannel, proto.channel);
224
+ m.channel = enumStringToValue$3(ConversationChannel, proto.channel);
220
225
  }
221
226
  if (proto.created) {
222
227
  m.created = new Date(proto.created);
@@ -231,7 +236,10 @@ class Conversation {
231
236
  m.latestMsgSentTime = new Date(proto.latestMsgSentTime);
232
237
  }
233
238
  if (proto.originLocation) {
234
- m.originLocation = enumStringToValue$2(PlatformLocation, proto.originLocation);
239
+ m.originLocation = enumStringToValue$3(PlatformLocation, proto.originLocation);
240
+ }
241
+ if (proto.lastSeenByParticipant) {
242
+ m.lastSeenByParticipant = proto.lastSeenByParticipant.map(LastSeenByParticipant.fromProto);
235
243
  }
236
244
  return m;
237
245
  }
@@ -267,11 +275,40 @@ class Conversation {
267
275
  if (typeof this.originLocationExternalId !== 'undefined') {
268
276
  toReturn['originLocationExternalId'] = this.originLocationExternalId;
269
277
  }
278
+ if (typeof this.lastSeenByParticipant !== 'undefined' && this.lastSeenByParticipant !== null) {
279
+ toReturn['lastSeenByParticipant'] = 'toApiJson' in this.lastSeenByParticipant ? this.lastSeenByParticipant.toApiJson() : this.lastSeenByParticipant;
280
+ }
281
+ return toReturn;
282
+ }
283
+ }
284
+ class LastSeenByParticipant {
285
+ constructor(kwargs) {
286
+ if (!kwargs) {
287
+ return;
288
+ }
289
+ Object.assign(this, kwargs);
290
+ }
291
+ static fromProto(proto) {
292
+ let m = new LastSeenByParticipant();
293
+ m = Object.assign(m, proto);
294
+ if (proto.lastSeenTime) {
295
+ m.lastSeenTime = new Date(proto.lastSeenTime);
296
+ }
297
+ return m;
298
+ }
299
+ toApiJson() {
300
+ const toReturn = {};
301
+ if (typeof this.participantId !== 'undefined') {
302
+ toReturn['participantId'] = this.participantId;
303
+ }
304
+ if (typeof this.lastSeenTime !== 'undefined' && this.lastSeenTime !== null) {
305
+ toReturn['lastSeenTime'] = 'toApiJson' in this.lastSeenTime ? this.lastSeenTime.toApiJson() : this.lastSeenTime;
306
+ }
270
307
  return toReturn;
271
308
  }
272
309
  }
273
310
 
274
- function enumStringToValue$1(enumRef, value) {
311
+ function enumStringToValue$2(enumRef, value) {
275
312
  if (typeof value === 'number') {
276
313
  return value;
277
314
  }
@@ -323,10 +360,10 @@ class Participant {
323
360
  let m = new Participant();
324
361
  m = Object.assign(m, proto);
325
362
  if (proto.location) {
326
- m.location = enumStringToValue$1(PlatformLocation, proto.location);
363
+ m.location = enumStringToValue$2(PlatformLocation, proto.location);
327
364
  }
328
365
  if (proto.channel) {
329
- m.channel = enumStringToValue$1(ConversationChannel, proto.channel);
366
+ m.channel = enumStringToValue$2(ConversationChannel, proto.channel);
330
367
  }
331
368
  if (proto.created) {
332
369
  m.created = new Date(proto.created);
@@ -338,7 +375,7 @@ class Participant {
338
375
  m.deleted = new Date(proto.deleted);
339
376
  }
340
377
  if (proto.participantType) {
341
- m.participantType = enumStringToValue$1(ParticipantType, proto.participantType);
378
+ m.participantType = enumStringToValue$2(ParticipantType, proto.participantType);
342
379
  }
343
380
  if (proto.address) {
344
381
  m.address = Address.fromProto(proto.address);
@@ -415,13 +452,13 @@ class ParticipantKey {
415
452
  let m = new ParticipantKey();
416
453
  m = Object.assign(m, proto);
417
454
  if (proto.location) {
418
- m.location = enumStringToValue$1(PlatformLocation, proto.location);
455
+ m.location = enumStringToValue$2(PlatformLocation, proto.location);
419
456
  }
420
457
  if (proto.channels) {
421
- m.channels = proto.channels.map((v) => enumStringToValue$1(ConversationChannel, v));
458
+ m.channels = proto.channels.map((v) => enumStringToValue$2(ConversationChannel, v));
422
459
  }
423
460
  if (proto.participantType) {
424
- m.participantType = enumStringToValue$1(GlobalParticipantType, proto.participantType);
461
+ m.participantType = enumStringToValue$2(GlobalParticipantType, proto.participantType);
425
462
  }
426
463
  return m;
427
464
  }
@@ -449,6 +486,36 @@ class ParticipantKey {
449
486
  }
450
487
  }
451
488
 
489
+ function enumStringToValue$1(enumRef, value) {
490
+ if (typeof value === 'number') {
491
+ return value;
492
+ }
493
+ return enumRef[value];
494
+ }
495
+ class Access {
496
+ constructor(kwargs) {
497
+ if (!kwargs) {
498
+ return;
499
+ }
500
+ Object.assign(this, kwargs);
501
+ }
502
+ static fromProto(proto) {
503
+ let m = new Access();
504
+ m = Object.assign(m, proto);
505
+ return m;
506
+ }
507
+ toApiJson() {
508
+ const toReturn = {};
509
+ if (typeof this.scope !== 'undefined') {
510
+ toReturn['scope'] = this.scope;
511
+ }
512
+ if (typeof this.public !== 'undefined') {
513
+ toReturn['public'] = this.public;
514
+ }
515
+ return toReturn;
516
+ }
517
+ }
518
+
452
519
  function enumStringToValue(enumRef, value) {
453
520
  if (typeof value === 'number') {
454
521
  return value;
@@ -1514,6 +1581,9 @@ class SendMessageRequest {
1514
1581
  if (proto.metadata) {
1515
1582
  m.metadata = proto.metadata.map(Metadata.fromProto);
1516
1583
  }
1584
+ if (proto.originLocation) {
1585
+ m.originLocation = enumStringToValue(PlatformLocation, proto.originLocation);
1586
+ }
1517
1587
  return m;
1518
1588
  }
1519
1589
  toApiJson() {
@@ -1536,6 +1606,9 @@ class SendMessageRequest {
1536
1606
  if (typeof this.metadata !== 'undefined' && this.metadata !== null) {
1537
1607
  toReturn['metadata'] = 'toApiJson' in this.metadata ? this.metadata.toApiJson() : this.metadata;
1538
1608
  }
1609
+ if (typeof this.originLocation !== 'undefined') {
1610
+ toReturn['originLocation'] = this.originLocation;
1611
+ }
1539
1612
  return toReturn;
1540
1613
  }
1541
1614
  }
@@ -1572,6 +1645,9 @@ class SetLastSeenRequest {
1572
1645
  if (proto.participant) {
1573
1646
  m.participant = Participant.fromProto(proto.participant);
1574
1647
  }
1648
+ if (proto.status) {
1649
+ m.status = enumStringToValue(SetLastSeenRequestStatus, proto.status);
1650
+ }
1575
1651
  return m;
1576
1652
  }
1577
1653
  toApiJson() {
@@ -1582,6 +1658,9 @@ class SetLastSeenRequest {
1582
1658
  if (typeof this.participant !== 'undefined' && this.participant !== null) {
1583
1659
  toReturn['participant'] = 'toApiJson' in this.participant ? this.participant.toApiJson() : this.participant;
1584
1660
  }
1661
+ if (typeof this.status !== 'undefined') {
1662
+ toReturn['status'] = this.status;
1663
+ }
1585
1664
  return toReturn;
1586
1665
  }
1587
1666
  }
@@ -1595,15 +1674,15 @@ class SetLastSeenResponse {
1595
1674
  static fromProto(proto) {
1596
1675
  let m = new SetLastSeenResponse();
1597
1676
  m = Object.assign(m, proto);
1598
- if (proto.lastSeen) {
1599
- m.lastSeen = new Date(proto.lastSeen);
1677
+ if (proto.participant) {
1678
+ m.participant = Participant.fromProto(proto.participant);
1600
1679
  }
1601
1680
  return m;
1602
1681
  }
1603
1682
  toApiJson() {
1604
1683
  const toReturn = {};
1605
- if (typeof this.lastSeen !== 'undefined' && this.lastSeen !== null) {
1606
- toReturn['lastSeen'] = 'toApiJson' in this.lastSeen ? this.lastSeen.toApiJson() : this.lastSeen;
1684
+ if (typeof this.participant !== 'undefined' && this.participant !== null) {
1685
+ toReturn['participant'] = 'toApiJson' in this.participant ? this.participant.toApiJson() : this.participant;
1607
1686
  }
1608
1687
  return toReturn;
1609
1688
  }
@@ -1777,5 +1856,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImpor
1777
1856
  * Generated bundle index. Do not edit.
1778
1857
  */
1779
1858
 
1780
- export { AddMultiParticipantsRequest, AddMultiParticipantsResponse, Address, Conversation, ConversationApiService, ConversationChannel, ConversationMessageCount, CreateConversationRequest, CreateConversationResponse, CreateMultiMessagesRequest, DeleteConversationRequest, DeleteMessageRequest, GetMessageRequest, GetMultiConversationDetailsRequest, GetMultiConversationDetailsResponse, GetMultiConversationDetailsResponseDetailedConversation, GetMultiConversationMessageCountRequest, GetMultiConversationMessageCountResponse, GetMultiConversationMessageCountResponseCountsEntry, GetMultiMessagesRequest, GetMultiMessagesResponse, GetMultiParticipantsRequest, GetMultiParticipantsResponse, GetParticipantsByKeyRequest, GetParticipantsByKeyResponse, GlobalParticipantType, ListMessagesRequest, ListMessagesRequestListMessagesFilters, ListMessagesResponse, LookupConversationsRequest, LookupConversationsRequestLookupConversationsFilters, LookupConversationsResponse, LookupConversationsResponseConversations, Message, MessageStatus, MessageType, Metadata, MetadataDataEntry, MetadataIdentifier, PagedRequestOptions, PagedResponseMetadata, Participant, ParticipantKey, ParticipantMessageStatus, ParticipantType, PlatformLocation, ReceiveMessageRequest, ReceiveMessageRequestMetadataEntry, SearchConversationsRequest, SearchConversationsResponse, SearchConversationsResponseDetailedConversation, SendMessageRequest, SendMessageResponse, SetLastSeenRequest, SetLastSeenResponse, UpdateMessageStatusRequest };
1859
+ export { Access, AddMultiParticipantsRequest, AddMultiParticipantsResponse, Address, Conversation, ConversationApiService, ConversationChannel, ConversationMessageCount, CreateConversationRequest, CreateConversationResponse, CreateMultiMessagesRequest, DeleteConversationRequest, DeleteMessageRequest, GetMessageRequest, GetMultiConversationDetailsRequest, GetMultiConversationDetailsResponse, GetMultiConversationDetailsResponseDetailedConversation, GetMultiConversationMessageCountRequest, GetMultiConversationMessageCountResponse, GetMultiConversationMessageCountResponseCountsEntry, GetMultiMessagesRequest, GetMultiMessagesResponse, GetMultiParticipantsRequest, GetMultiParticipantsResponse, GetParticipantsByKeyRequest, GetParticipantsByKeyResponse, GlobalParticipantType, LastSeenByParticipant, ListMessagesRequest, ListMessagesRequestListMessagesFilters, ListMessagesResponse, LookupConversationsRequest, LookupConversationsRequestLookupConversationsFilters, LookupConversationsResponse, LookupConversationsResponseConversations, Message, MessageStatus, MessageType, Metadata, MetadataDataEntry, MetadataIdentifier, PagedRequestOptions, PagedResponseMetadata, Participant, ParticipantKey, ParticipantMessageStatus, ParticipantType, PlatformLocation, ReceiveMessageRequest, ReceiveMessageRequestMetadataEntry, SearchConversationsRequest, SearchConversationsResponse, SearchConversationsResponseDetailedConversation, SendMessageRequest, SendMessageResponse, SetLastSeenRequest, SetLastSeenRequestStatus, SetLastSeenResponse, UpdateMessageStatusRequest };
1781
1860
  //# sourceMappingURL=vendasta-conversation.mjs.map