@vendasta/conversation 0.19.0 → 0.21.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.
- package/esm2020/lib/_internal/enums/api.enum.mjs +6 -1
- package/esm2020/lib/_internal/enums/index.mjs +2 -2
- package/esm2020/lib/_internal/interfaces/annotations.interface.mjs +8 -0
- package/esm2020/lib/_internal/interfaces/api.interface.mjs +1 -1
- package/esm2020/lib/_internal/interfaces/conversation.interface.mjs +1 -1
- package/esm2020/lib/_internal/interfaces/index.mjs +1 -1
- package/esm2020/lib/_internal/interfaces/participant.interface.mjs +1 -1
- package/esm2020/lib/_internal/objects/annotations.mjs +30 -0
- package/esm2020/lib/_internal/objects/api.mjs +11 -5
- package/esm2020/lib/_internal/objects/conversation.mjs +33 -1
- package/esm2020/lib/_internal/objects/index.mjs +3 -2
- package/esm2020/lib/_internal/objects/participant.mjs +4 -1
- package/fesm2015/vendasta-conversation.mjs +94 -18
- package/fesm2015/vendasta-conversation.mjs.map +1 -1
- package/fesm2020/vendasta-conversation.mjs +94 -18
- package/fesm2020/vendasta-conversation.mjs.map +1 -1
- package/lib/_internal/enums/api.enum.d.ts +4 -0
- package/lib/_internal/enums/index.d.ts +1 -1
- package/lib/_internal/interfaces/annotations.interface.d.ts +4 -0
- package/lib/_internal/interfaces/api.interface.d.ts +2 -1
- package/lib/_internal/interfaces/conversation.interface.d.ts +5 -0
- package/lib/_internal/interfaces/index.d.ts +2 -1
- package/lib/_internal/interfaces/participant.interface.d.ts +1 -0
- package/lib/_internal/objects/annotations.d.ts +9 -0
- package/lib/_internal/objects/api.d.ts +2 -1
- package/lib/_internal/objects/conversation.d.ts +8 -0
- package/lib/_internal/objects/index.d.ts +2 -1
- package/lib/_internal/objects/participant.d.ts +1 -0
- package/package.json +1 -1
|
@@ -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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
363
|
+
m.location = enumStringToValue$2(PlatformLocation, proto.location);
|
|
327
364
|
}
|
|
328
365
|
if (proto.channel) {
|
|
329
|
-
m.channel = enumStringToValue$
|
|
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$
|
|
378
|
+
m.participantType = enumStringToValue$2(ParticipantType, proto.participantType);
|
|
342
379
|
}
|
|
343
380
|
if (proto.address) {
|
|
344
381
|
m.address = Address.fromProto(proto.address);
|
|
@@ -398,6 +435,9 @@ class Participant {
|
|
|
398
435
|
if (typeof this.isParticipantInternalInfoDeleted !== 'undefined') {
|
|
399
436
|
toReturn['isParticipantInternalInfoDeleted'] = this.isParticipantInternalInfoDeleted;
|
|
400
437
|
}
|
|
438
|
+
if (typeof this.profileImageUrl !== 'undefined') {
|
|
439
|
+
toReturn['profileImageUrl'] = this.profileImageUrl;
|
|
440
|
+
}
|
|
401
441
|
return toReturn;
|
|
402
442
|
}
|
|
403
443
|
}
|
|
@@ -412,13 +452,13 @@ class ParticipantKey {
|
|
|
412
452
|
let m = new ParticipantKey();
|
|
413
453
|
m = Object.assign(m, proto);
|
|
414
454
|
if (proto.location) {
|
|
415
|
-
m.location = enumStringToValue$
|
|
455
|
+
m.location = enumStringToValue$2(PlatformLocation, proto.location);
|
|
416
456
|
}
|
|
417
457
|
if (proto.channels) {
|
|
418
|
-
m.channels = proto.channels.map((v) => enumStringToValue$
|
|
458
|
+
m.channels = proto.channels.map((v) => enumStringToValue$2(ConversationChannel, v));
|
|
419
459
|
}
|
|
420
460
|
if (proto.participantType) {
|
|
421
|
-
m.participantType = enumStringToValue$
|
|
461
|
+
m.participantType = enumStringToValue$2(GlobalParticipantType, proto.participantType);
|
|
422
462
|
}
|
|
423
463
|
return m;
|
|
424
464
|
}
|
|
@@ -446,6 +486,36 @@ class ParticipantKey {
|
|
|
446
486
|
}
|
|
447
487
|
}
|
|
448
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
|
+
|
|
449
519
|
function enumStringToValue(enumRef, value) {
|
|
450
520
|
if (typeof value === 'number') {
|
|
451
521
|
return value;
|
|
@@ -1569,6 +1639,9 @@ class SetLastSeenRequest {
|
|
|
1569
1639
|
if (proto.participant) {
|
|
1570
1640
|
m.participant = Participant.fromProto(proto.participant);
|
|
1571
1641
|
}
|
|
1642
|
+
if (proto.status) {
|
|
1643
|
+
m.status = enumStringToValue(SetLastSeenRequestStatus, proto.status);
|
|
1644
|
+
}
|
|
1572
1645
|
return m;
|
|
1573
1646
|
}
|
|
1574
1647
|
toApiJson() {
|
|
@@ -1579,6 +1652,9 @@ class SetLastSeenRequest {
|
|
|
1579
1652
|
if (typeof this.participant !== 'undefined' && this.participant !== null) {
|
|
1580
1653
|
toReturn['participant'] = 'toApiJson' in this.participant ? this.participant.toApiJson() : this.participant;
|
|
1581
1654
|
}
|
|
1655
|
+
if (typeof this.status !== 'undefined') {
|
|
1656
|
+
toReturn['status'] = this.status;
|
|
1657
|
+
}
|
|
1582
1658
|
return toReturn;
|
|
1583
1659
|
}
|
|
1584
1660
|
}
|
|
@@ -1592,15 +1668,15 @@ class SetLastSeenResponse {
|
|
|
1592
1668
|
static fromProto(proto) {
|
|
1593
1669
|
let m = new SetLastSeenResponse();
|
|
1594
1670
|
m = Object.assign(m, proto);
|
|
1595
|
-
if (proto.
|
|
1596
|
-
m.
|
|
1671
|
+
if (proto.participant) {
|
|
1672
|
+
m.participant = Participant.fromProto(proto.participant);
|
|
1597
1673
|
}
|
|
1598
1674
|
return m;
|
|
1599
1675
|
}
|
|
1600
1676
|
toApiJson() {
|
|
1601
1677
|
const toReturn = {};
|
|
1602
|
-
if (typeof this.
|
|
1603
|
-
toReturn['
|
|
1678
|
+
if (typeof this.participant !== 'undefined' && this.participant !== null) {
|
|
1679
|
+
toReturn['participant'] = 'toApiJson' in this.participant ? this.participant.toApiJson() : this.participant;
|
|
1604
1680
|
}
|
|
1605
1681
|
return toReturn;
|
|
1606
1682
|
}
|
|
@@ -1774,5 +1850,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImpor
|
|
|
1774
1850
|
* Generated bundle index. Do not edit.
|
|
1775
1851
|
*/
|
|
1776
1852
|
|
|
1777
|
-
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 };
|
|
1853
|
+
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 };
|
|
1778
1854
|
//# sourceMappingURL=vendasta-conversation.mjs.map
|