@vendasta/conversation 0.20.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/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/fesm2015/vendasta-conversation.mjs +91 -18
- package/fesm2015/vendasta-conversation.mjs.map +1 -1
- package/fesm2020/vendasta-conversation.mjs +91 -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/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/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);
|
|
@@ -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$
|
|
455
|
+
m.location = enumStringToValue$2(PlatformLocation, proto.location);
|
|
419
456
|
}
|
|
420
457
|
if (proto.channels) {
|
|
421
|
-
m.channels = proto.channels.map((v) => enumStringToValue$
|
|
458
|
+
m.channels = proto.channels.map((v) => enumStringToValue$2(ConversationChannel, v));
|
|
422
459
|
}
|
|
423
460
|
if (proto.participantType) {
|
|
424
|
-
m.participantType = enumStringToValue$
|
|
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;
|
|
@@ -1572,6 +1639,9 @@ class SetLastSeenRequest {
|
|
|
1572
1639
|
if (proto.participant) {
|
|
1573
1640
|
m.participant = Participant.fromProto(proto.participant);
|
|
1574
1641
|
}
|
|
1642
|
+
if (proto.status) {
|
|
1643
|
+
m.status = enumStringToValue(SetLastSeenRequestStatus, proto.status);
|
|
1644
|
+
}
|
|
1575
1645
|
return m;
|
|
1576
1646
|
}
|
|
1577
1647
|
toApiJson() {
|
|
@@ -1582,6 +1652,9 @@ class SetLastSeenRequest {
|
|
|
1582
1652
|
if (typeof this.participant !== 'undefined' && this.participant !== null) {
|
|
1583
1653
|
toReturn['participant'] = 'toApiJson' in this.participant ? this.participant.toApiJson() : this.participant;
|
|
1584
1654
|
}
|
|
1655
|
+
if (typeof this.status !== 'undefined') {
|
|
1656
|
+
toReturn['status'] = this.status;
|
|
1657
|
+
}
|
|
1585
1658
|
return toReturn;
|
|
1586
1659
|
}
|
|
1587
1660
|
}
|
|
@@ -1595,15 +1668,15 @@ class SetLastSeenResponse {
|
|
|
1595
1668
|
static fromProto(proto) {
|
|
1596
1669
|
let m = new SetLastSeenResponse();
|
|
1597
1670
|
m = Object.assign(m, proto);
|
|
1598
|
-
if (proto.
|
|
1599
|
-
m.
|
|
1671
|
+
if (proto.participant) {
|
|
1672
|
+
m.participant = Participant.fromProto(proto.participant);
|
|
1600
1673
|
}
|
|
1601
1674
|
return m;
|
|
1602
1675
|
}
|
|
1603
1676
|
toApiJson() {
|
|
1604
1677
|
const toReturn = {};
|
|
1605
|
-
if (typeof this.
|
|
1606
|
-
toReturn['
|
|
1678
|
+
if (typeof this.participant !== 'undefined' && this.participant !== null) {
|
|
1679
|
+
toReturn['participant'] = 'toApiJson' in this.participant ? this.participant.toApiJson() : this.participant;
|
|
1607
1680
|
}
|
|
1608
1681
|
return toReturn;
|
|
1609
1682
|
}
|
|
@@ -1777,5 +1850,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImpor
|
|
|
1777
1850
|
* Generated bundle index. Do not edit.
|
|
1778
1851
|
*/
|
|
1779
1852
|
|
|
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 };
|
|
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 };
|
|
1781
1854
|
//# sourceMappingURL=vendasta-conversation.mjs.map
|