@vendasta/conversation 0.12.0 → 0.15.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/_generated/host.service.mjs +25 -0
- package/esm2020/lib/_internal/conversation.api.service.mjs +116 -0
- package/esm2020/lib/_internal/enums/api.enum.mjs +14 -0
- package/esm2020/lib/_internal/enums/conversation.enum.mjs +25 -0
- package/esm2020/lib/_internal/enums/index.mjs +11 -0
- package/esm2020/lib/_internal/enums/message.enum.mjs +21 -0
- package/esm2020/lib/_internal/enums/participant.enum.mjs +18 -0
- package/esm2020/lib/_internal/index.mjs +11 -0
- package/esm2020/lib/_internal/interfaces/api.interface.mjs +2 -0
- package/esm2020/lib/_internal/interfaces/conversation.interface.mjs +8 -0
- package/esm2020/lib/_internal/interfaces/index.mjs +2 -0
- package/esm2020/lib/_internal/interfaces/message.interface.mjs +8 -0
- package/esm2020/lib/_internal/interfaces/participant.interface.mjs +8 -0
- package/esm2020/lib/_internal/objects/api.mjs +1135 -0
- package/esm2020/lib/_internal/objects/conversation.mjs +73 -0
- package/esm2020/lib/_internal/objects/index.mjs +11 -0
- package/esm2020/lib/_internal/objects/message.mjs +105 -0
- package/esm2020/lib/_internal/objects/participant.mjs +129 -0
- package/esm2020/lib/index.mjs +3 -0
- package/esm2020/public_api.mjs +2 -0
- package/esm2020/vendasta-conversation.mjs +5 -0
- package/fesm2015/vendasta-conversation.mjs +1658 -0
- package/fesm2015/vendasta-conversation.mjs.map +1 -0
- package/{fesm2015/vendasta-conversation.js → fesm2020/vendasta-conversation.mjs} +138 -125
- package/fesm2020/vendasta-conversation.mjs.map +1 -0
- package/lib/_generated/host.service.d.ts +5 -9
- package/lib/_internal/conversation.api.service.d.ts +7 -2
- package/lib/_internal/interfaces/api.interface.d.ts +8 -2
- package/lib/_internal/interfaces/index.d.ts +1 -1
- package/lib/_internal/interfaces/participant.interface.d.ts +1 -0
- package/lib/_internal/objects/api.d.ts +18 -6
- package/lib/_internal/objects/index.d.ts +1 -1
- package/lib/_internal/objects/participant.d.ts +1 -0
- package/package.json +27 -16
- package/src/README.md +1 -0
- package/vendasta-conversation.d.ts +1 -1
- package/bundles/vendasta-conversation.umd.js +0 -1712
- package/bundles/vendasta-conversation.umd.js.map +0 -1
- package/bundles/vendasta-conversation.umd.min.js +0 -2
- package/bundles/vendasta-conversation.umd.min.js.map +0 -1
- package/esm2015/lib/_generated/host.service.js +0 -65
- package/esm2015/lib/_internal/conversation.api.service.js +0 -112
- package/esm2015/lib/_internal/enums/api.enum.js +0 -14
- package/esm2015/lib/_internal/enums/conversation.enum.js +0 -25
- package/esm2015/lib/_internal/enums/index.js +0 -11
- package/esm2015/lib/_internal/enums/message.enum.js +0 -21
- package/esm2015/lib/_internal/enums/participant.enum.js +0 -18
- package/esm2015/lib/_internal/index.js +0 -11
- package/esm2015/lib/_internal/interfaces/api.interface.js +0 -2
- package/esm2015/lib/_internal/interfaces/conversation.interface.js +0 -8
- package/esm2015/lib/_internal/interfaces/index.js +0 -2
- package/esm2015/lib/_internal/interfaces/message.interface.js +0 -8
- package/esm2015/lib/_internal/interfaces/participant.interface.js +0 -8
- package/esm2015/lib/_internal/objects/api.js +0 -1092
- package/esm2015/lib/_internal/objects/conversation.js +0 -73
- package/esm2015/lib/_internal/objects/index.js +0 -11
- package/esm2015/lib/_internal/objects/message.js +0 -105
- package/esm2015/lib/_internal/objects/participant.js +0 -126
- package/esm2015/lib/index.js +0 -3
- package/esm2015/public_api.js +0 -2
- package/esm2015/vendasta-conversation.js +0 -6
- package/fesm2015/vendasta-conversation.js.map +0 -1
- package/vendasta-conversation.metadata.json +0 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common/http';
|
|
4
|
+
import { HttpHeaders } from '@angular/common/http';
|
|
5
|
+
import { map } from 'rxjs/operators';
|
|
5
6
|
|
|
6
7
|
// *********************************
|
|
7
8
|
// Code generated by sdkgen
|
|
@@ -83,7 +84,7 @@ var MetadataIdentifier;
|
|
|
83
84
|
|
|
84
85
|
// *********************************
|
|
85
86
|
|
|
86
|
-
function enumStringToValue(enumRef, value) {
|
|
87
|
+
function enumStringToValue$3(enumRef, value) {
|
|
87
88
|
if (typeof value === 'number') {
|
|
88
89
|
return value;
|
|
89
90
|
}
|
|
@@ -100,7 +101,7 @@ class Message {
|
|
|
100
101
|
let m = new Message();
|
|
101
102
|
m = Object.assign(m, proto);
|
|
102
103
|
if (proto.type) {
|
|
103
|
-
m.type = enumStringToValue(MessageType, proto.type);
|
|
104
|
+
m.type = enumStringToValue$3(MessageType, proto.type);
|
|
104
105
|
}
|
|
105
106
|
if (proto.created) {
|
|
106
107
|
m.created = new Date(proto.created);
|
|
@@ -162,7 +163,7 @@ class ParticipantMessageStatus {
|
|
|
162
163
|
let m = new ParticipantMessageStatus();
|
|
163
164
|
m = Object.assign(m, proto);
|
|
164
165
|
if (proto.status) {
|
|
165
|
-
m.status = enumStringToValue(MessageStatus, proto.status);
|
|
166
|
+
m.status = enumStringToValue$3(MessageStatus, proto.status);
|
|
166
167
|
}
|
|
167
168
|
if (proto.updated) {
|
|
168
169
|
m.updated = new Date(proto.updated);
|
|
@@ -187,7 +188,7 @@ class ParticipantMessageStatus {
|
|
|
187
188
|
}
|
|
188
189
|
}
|
|
189
190
|
|
|
190
|
-
function enumStringToValue$
|
|
191
|
+
function enumStringToValue$2(enumRef, value) {
|
|
191
192
|
if (typeof value === 'number') {
|
|
192
193
|
return value;
|
|
193
194
|
}
|
|
@@ -204,7 +205,7 @@ class Conversation {
|
|
|
204
205
|
let m = new Conversation();
|
|
205
206
|
m = Object.assign(m, proto);
|
|
206
207
|
if (proto.channel) {
|
|
207
|
-
m.channel = enumStringToValue$
|
|
208
|
+
m.channel = enumStringToValue$2(ConversationChannel, proto.channel);
|
|
208
209
|
}
|
|
209
210
|
if (proto.created) {
|
|
210
211
|
m.created = new Date(proto.created);
|
|
@@ -219,7 +220,7 @@ class Conversation {
|
|
|
219
220
|
m.latestMsgSentTime = new Date(proto.latestMsgSentTime);
|
|
220
221
|
}
|
|
221
222
|
if (proto.originLocation) {
|
|
222
|
-
m.originLocation = enumStringToValue$
|
|
223
|
+
m.originLocation = enumStringToValue$2(PlatformLocation, proto.originLocation);
|
|
223
224
|
}
|
|
224
225
|
return m;
|
|
225
226
|
}
|
|
@@ -259,7 +260,7 @@ class Conversation {
|
|
|
259
260
|
}
|
|
260
261
|
}
|
|
261
262
|
|
|
262
|
-
function enumStringToValue$
|
|
263
|
+
function enumStringToValue$1(enumRef, value) {
|
|
263
264
|
if (typeof value === 'number') {
|
|
264
265
|
return value;
|
|
265
266
|
}
|
|
@@ -311,10 +312,10 @@ class Participant {
|
|
|
311
312
|
let m = new Participant();
|
|
312
313
|
m = Object.assign(m, proto);
|
|
313
314
|
if (proto.location) {
|
|
314
|
-
m.location = enumStringToValue$
|
|
315
|
+
m.location = enumStringToValue$1(PlatformLocation, proto.location);
|
|
315
316
|
}
|
|
316
317
|
if (proto.channel) {
|
|
317
|
-
m.channel = enumStringToValue$
|
|
318
|
+
m.channel = enumStringToValue$1(ConversationChannel, proto.channel);
|
|
318
319
|
}
|
|
319
320
|
if (proto.created) {
|
|
320
321
|
m.created = new Date(proto.created);
|
|
@@ -326,7 +327,7 @@ class Participant {
|
|
|
326
327
|
m.deleted = new Date(proto.deleted);
|
|
327
328
|
}
|
|
328
329
|
if (proto.participantType) {
|
|
329
|
-
m.participantType = enumStringToValue$
|
|
330
|
+
m.participantType = enumStringToValue$1(ParticipantType, proto.participantType);
|
|
330
331
|
}
|
|
331
332
|
if (proto.address) {
|
|
332
333
|
m.address = Address.fromProto(proto.address);
|
|
@@ -380,11 +381,14 @@ class Participant {
|
|
|
380
381
|
if (typeof this.address !== 'undefined' && this.address !== null) {
|
|
381
382
|
toReturn['address'] = 'toApiJson' in this.address ? this.address.toApiJson() : this.address;
|
|
382
383
|
}
|
|
384
|
+
if (typeof this.isSubjectParticipant !== 'undefined') {
|
|
385
|
+
toReturn['isSubjectParticipant'] = this.isSubjectParticipant;
|
|
386
|
+
}
|
|
383
387
|
return toReturn;
|
|
384
388
|
}
|
|
385
389
|
}
|
|
386
390
|
|
|
387
|
-
function enumStringToValue
|
|
391
|
+
function enumStringToValue(enumRef, value) {
|
|
388
392
|
if (typeof value === 'number') {
|
|
389
393
|
return value;
|
|
390
394
|
}
|
|
@@ -534,7 +538,7 @@ class CreateConversationRequest {
|
|
|
534
538
|
m.participants = proto.participants.map(Participant.fromProto);
|
|
535
539
|
}
|
|
536
540
|
if (proto.channel) {
|
|
537
|
-
m.channel = enumStringToValue
|
|
541
|
+
m.channel = enumStringToValue(ConversationChannel, proto.channel);
|
|
538
542
|
}
|
|
539
543
|
if (proto.created) {
|
|
540
544
|
m.created = new Date(proto.created);
|
|
@@ -543,7 +547,7 @@ class CreateConversationRequest {
|
|
|
543
547
|
m.updated = new Date(proto.updated);
|
|
544
548
|
}
|
|
545
549
|
if (proto.originLocation) {
|
|
546
|
-
m.originLocation = enumStringToValue
|
|
550
|
+
m.originLocation = enumStringToValue(PlatformLocation, proto.originLocation);
|
|
547
551
|
}
|
|
548
552
|
return m;
|
|
549
553
|
}
|
|
@@ -694,7 +698,7 @@ class DeleteMessageRequest {
|
|
|
694
698
|
return toReturn;
|
|
695
699
|
}
|
|
696
700
|
}
|
|
697
|
-
class
|
|
701
|
+
class SearchConversationsResponseDetailedConversation {
|
|
698
702
|
constructor(kwargs) {
|
|
699
703
|
if (!kwargs) {
|
|
700
704
|
return;
|
|
@@ -702,7 +706,7 @@ class GetMultiConversationDetailsResponseDetailedConversation {
|
|
|
702
706
|
Object.assign(this, kwargs);
|
|
703
707
|
}
|
|
704
708
|
static fromProto(proto) {
|
|
705
|
-
let m = new
|
|
709
|
+
let m = new SearchConversationsResponseDetailedConversation();
|
|
706
710
|
m = Object.assign(m, proto);
|
|
707
711
|
if (proto.conversation) {
|
|
708
712
|
m.conversation = Conversation.fromProto(proto.conversation);
|
|
@@ -729,7 +733,7 @@ class GetMultiConversationDetailsResponseDetailedConversation {
|
|
|
729
733
|
return toReturn;
|
|
730
734
|
}
|
|
731
735
|
}
|
|
732
|
-
class
|
|
736
|
+
class GetMultiConversationDetailsResponseDetailedConversation {
|
|
733
737
|
constructor(kwargs) {
|
|
734
738
|
if (!kwargs) {
|
|
735
739
|
return;
|
|
@@ -737,7 +741,7 @@ class SearchConversationsResponseDetailedConversation {
|
|
|
737
741
|
Object.assign(this, kwargs);
|
|
738
742
|
}
|
|
739
743
|
static fromProto(proto) {
|
|
740
|
-
let m = new
|
|
744
|
+
let m = new GetMultiConversationDetailsResponseDetailedConversation();
|
|
741
745
|
m = Object.assign(m, proto);
|
|
742
746
|
if (proto.conversation) {
|
|
743
747
|
m.conversation = Conversation.fromProto(proto.conversation);
|
|
@@ -1051,13 +1055,13 @@ class LookupConversationsRequestLookupConversationsFilters {
|
|
|
1051
1055
|
let m = new LookupConversationsRequestLookupConversationsFilters();
|
|
1052
1056
|
m = Object.assign(m, proto);
|
|
1053
1057
|
if (proto.location) {
|
|
1054
|
-
m.location = enumStringToValue
|
|
1058
|
+
m.location = enumStringToValue(PlatformLocation, proto.location);
|
|
1055
1059
|
}
|
|
1056
1060
|
if (proto.channel) {
|
|
1057
|
-
m.channel = enumStringToValue
|
|
1061
|
+
m.channel = enumStringToValue(ConversationChannel, proto.channel);
|
|
1058
1062
|
}
|
|
1059
1063
|
if (proto.originLocation) {
|
|
1060
|
-
m.originLocation = enumStringToValue
|
|
1064
|
+
m.originLocation = enumStringToValue(PlatformLocation, proto.originLocation);
|
|
1061
1065
|
}
|
|
1062
1066
|
return m;
|
|
1063
1067
|
}
|
|
@@ -1156,7 +1160,7 @@ class Metadata {
|
|
|
1156
1160
|
let m = new Metadata();
|
|
1157
1161
|
m = Object.assign(m, proto);
|
|
1158
1162
|
if (proto.identifier) {
|
|
1159
|
-
m.identifier = enumStringToValue
|
|
1163
|
+
m.identifier = enumStringToValue(MetadataIdentifier, proto.identifier);
|
|
1160
1164
|
}
|
|
1161
1165
|
if (proto.data) {
|
|
1162
1166
|
m.data = Object.keys(proto.data).reduce((obj, k) => { obj[k] = proto.data[k]; return obj; }, {});
|
|
@@ -1254,13 +1258,13 @@ class ReceiveMessageRequest {
|
|
|
1254
1258
|
let m = new ReceiveMessageRequest();
|
|
1255
1259
|
m = Object.assign(m, proto);
|
|
1256
1260
|
if (proto.channel) {
|
|
1257
|
-
m.channel = enumStringToValue
|
|
1261
|
+
m.channel = enumStringToValue(ConversationChannel, proto.channel);
|
|
1258
1262
|
}
|
|
1259
1263
|
if (proto.type) {
|
|
1260
|
-
m.type = enumStringToValue
|
|
1264
|
+
m.type = enumStringToValue(MessageType, proto.type);
|
|
1261
1265
|
}
|
|
1262
1266
|
if (proto.location) {
|
|
1263
|
-
m.location = enumStringToValue
|
|
1267
|
+
m.location = enumStringToValue(PlatformLocation, proto.location);
|
|
1264
1268
|
}
|
|
1265
1269
|
if (proto.metadata) {
|
|
1266
1270
|
m.metadata = Object.keys(proto.metadata).reduce((obj, k) => { obj[k] = proto.metadata[k]; return obj; }, {});
|
|
@@ -1319,7 +1323,7 @@ class SearchConversationsRequest {
|
|
|
1319
1323
|
let m = new SearchConversationsRequest();
|
|
1320
1324
|
m = Object.assign(m, proto);
|
|
1321
1325
|
if (proto.location) {
|
|
1322
|
-
m.location = enumStringToValue
|
|
1326
|
+
m.location = enumStringToValue(PlatformLocation, proto.location);
|
|
1323
1327
|
}
|
|
1324
1328
|
if (proto.pagingOptions) {
|
|
1325
1329
|
m.pagingOptions = PagedRequestOptions.fromProto(proto.pagingOptions);
|
|
@@ -1392,7 +1396,7 @@ class SendMessageRequest {
|
|
|
1392
1396
|
m.recipient = Participant.fromProto(proto.recipient);
|
|
1393
1397
|
}
|
|
1394
1398
|
if (proto.type) {
|
|
1395
|
-
m.type = enumStringToValue
|
|
1399
|
+
m.type = enumStringToValue(MessageType, proto.type);
|
|
1396
1400
|
}
|
|
1397
1401
|
if (proto.metadata) {
|
|
1398
1402
|
m.metadata = proto.metadata.map(Metadata.fromProto);
|
|
@@ -1442,6 +1446,49 @@ class SendMessageResponse {
|
|
|
1442
1446
|
return toReturn;
|
|
1443
1447
|
}
|
|
1444
1448
|
}
|
|
1449
|
+
class SetLastSeenRequest {
|
|
1450
|
+
constructor(kwargs) {
|
|
1451
|
+
if (!kwargs) {
|
|
1452
|
+
return;
|
|
1453
|
+
}
|
|
1454
|
+
Object.assign(this, kwargs);
|
|
1455
|
+
}
|
|
1456
|
+
static fromProto(proto) {
|
|
1457
|
+
let m = new SetLastSeenRequest();
|
|
1458
|
+
m = Object.assign(m, proto);
|
|
1459
|
+
return m;
|
|
1460
|
+
}
|
|
1461
|
+
toApiJson() {
|
|
1462
|
+
const toReturn = {};
|
|
1463
|
+
if (typeof this.conversationId !== 'undefined') {
|
|
1464
|
+
toReturn['conversationId'] = this.conversationId;
|
|
1465
|
+
}
|
|
1466
|
+
return toReturn;
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
class SetLastSeenResponse {
|
|
1470
|
+
constructor(kwargs) {
|
|
1471
|
+
if (!kwargs) {
|
|
1472
|
+
return;
|
|
1473
|
+
}
|
|
1474
|
+
Object.assign(this, kwargs);
|
|
1475
|
+
}
|
|
1476
|
+
static fromProto(proto) {
|
|
1477
|
+
let m = new SetLastSeenResponse();
|
|
1478
|
+
m = Object.assign(m, proto);
|
|
1479
|
+
if (proto.lastSeen) {
|
|
1480
|
+
m.lastSeen = new Date(proto.lastSeen);
|
|
1481
|
+
}
|
|
1482
|
+
return m;
|
|
1483
|
+
}
|
|
1484
|
+
toApiJson() {
|
|
1485
|
+
const toReturn = {};
|
|
1486
|
+
if (typeof this.lastSeen !== 'undefined' && this.lastSeen !== null) {
|
|
1487
|
+
toReturn['lastSeen'] = 'toApiJson' in this.lastSeen ? this.lastSeen.toApiJson() : this.lastSeen;
|
|
1488
|
+
}
|
|
1489
|
+
return toReturn;
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1445
1492
|
class UpdateMessageStatusRequest {
|
|
1446
1493
|
constructor(kwargs) {
|
|
1447
1494
|
if (!kwargs) {
|
|
@@ -1453,7 +1500,7 @@ class UpdateMessageStatusRequest {
|
|
|
1453
1500
|
let m = new UpdateMessageStatusRequest();
|
|
1454
1501
|
m = Object.assign(m, proto);
|
|
1455
1502
|
if (proto.status) {
|
|
1456
|
-
m.status = enumStringToValue
|
|
1503
|
+
m.status = enumStringToValue(MessageStatus, proto.status);
|
|
1457
1504
|
}
|
|
1458
1505
|
return m;
|
|
1459
1506
|
}
|
|
@@ -1474,72 +1521,35 @@ class UpdateMessageStatusRequest {
|
|
|
1474
1521
|
|
|
1475
1522
|
// *********************************
|
|
1476
1523
|
|
|
1524
|
+
const environment = (window ? window['environment'] : 'prod') ?? 'prod';
|
|
1525
|
+
const hostMap = {
|
|
1526
|
+
'local': 'conversation-api.vendasta-local.com',
|
|
1527
|
+
'test': '',
|
|
1528
|
+
'demo': 'conversation-demo.apigateway.co',
|
|
1529
|
+
'prod': 'conversation-prod.apigateway.co',
|
|
1530
|
+
'production': 'conversation-prod.apigateway.co',
|
|
1531
|
+
};
|
|
1477
1532
|
class HostService {
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
}
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
return this._host;
|
|
1484
|
-
}
|
|
1485
|
-
switch (this.environmentService.getEnvironment()) {
|
|
1486
|
-
case Environment.LOCAL:
|
|
1487
|
-
this._host = 'conversation-api.vendasta-local.com';
|
|
1488
|
-
break;
|
|
1489
|
-
case Environment.TEST:
|
|
1490
|
-
this._host = '';
|
|
1491
|
-
break;
|
|
1492
|
-
case Environment.DEMO:
|
|
1493
|
-
this._host = 'conversation-demo.apigateway.co';
|
|
1494
|
-
break;
|
|
1495
|
-
case Environment.PROD:
|
|
1496
|
-
this._host = 'conversation-prod.apigateway.co';
|
|
1497
|
-
break;
|
|
1498
|
-
}
|
|
1499
|
-
return this._host;
|
|
1500
|
-
}
|
|
1501
|
-
httpsHost() {
|
|
1502
|
-
if (this._httpsHost) {
|
|
1503
|
-
return this._httpsHost;
|
|
1504
|
-
}
|
|
1505
|
-
switch (this.environmentService.getEnvironment()) {
|
|
1506
|
-
case Environment.LOCAL:
|
|
1507
|
-
this._httpsHost = 'conversation.vendasta-local.com';
|
|
1508
|
-
break;
|
|
1509
|
-
case Environment.TEST:
|
|
1510
|
-
this._httpsHost = '';
|
|
1511
|
-
break;
|
|
1512
|
-
case Environment.DEMO:
|
|
1513
|
-
this._httpsHost = 'conversation-demo.apigateway.co';
|
|
1514
|
-
break;
|
|
1515
|
-
case Environment.PROD:
|
|
1516
|
-
this._httpsHost = 'conversation-prod.apigateway.co';
|
|
1517
|
-
break;
|
|
1518
|
-
}
|
|
1519
|
-
return this._httpsHost;
|
|
1520
|
-
}
|
|
1521
|
-
hostWithScheme() {
|
|
1522
|
-
const scheme = this.environmentService.getEnvironment() === Environment.LOCAL ? 'http://' : 'https://';
|
|
1523
|
-
return scheme + this.host();
|
|
1524
|
-
}
|
|
1525
|
-
httpsHostWithScheme() {
|
|
1526
|
-
const scheme = this.environmentService.getEnvironment() === Environment.LOCAL ? 'http://' : 'https://';
|
|
1527
|
-
return scheme + this.httpsHost();
|
|
1533
|
+
get host() {
|
|
1534
|
+
return hostMap[environment.toLowerCase()];
|
|
1535
|
+
}
|
|
1536
|
+
get hostWithScheme() {
|
|
1537
|
+
return 'https://' + this.host;
|
|
1528
1538
|
}
|
|
1529
1539
|
}
|
|
1530
|
-
HostService.ɵ
|
|
1531
|
-
HostService
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
];
|
|
1540
|
+
HostService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: HostService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1541
|
+
HostService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: HostService, providedIn: 'root' });
|
|
1542
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: HostService, decorators: [{
|
|
1543
|
+
type: Injectable,
|
|
1544
|
+
args: [{ providedIn: 'root' }]
|
|
1545
|
+
}] });
|
|
1537
1546
|
|
|
1538
1547
|
// *********************************
|
|
1539
1548
|
class ConversationApiService {
|
|
1540
1549
|
constructor(http, hostService) {
|
|
1541
1550
|
this.http = http;
|
|
1542
1551
|
this.hostService = hostService;
|
|
1552
|
+
this._host = this.hostService.hostWithScheme;
|
|
1543
1553
|
}
|
|
1544
1554
|
apiOptions() {
|
|
1545
1555
|
return {
|
|
@@ -1551,88 +1561,91 @@ class ConversationApiService {
|
|
|
1551
1561
|
}
|
|
1552
1562
|
sendMessage(r) {
|
|
1553
1563
|
const request = (r.toApiJson) ? r : new SendMessageRequest(r);
|
|
1554
|
-
return this.http.post(this.
|
|
1555
|
-
.pipe(map(resp => SendMessageResponse.fromProto(resp))
|
|
1564
|
+
return this.http.post(this._host + "/conversation.v1.ConversationService/SendMessage", request.toApiJson(), this.apiOptions())
|
|
1565
|
+
.pipe(map(resp => SendMessageResponse.fromProto(resp)));
|
|
1556
1566
|
}
|
|
1557
1567
|
getMessage(r) {
|
|
1558
1568
|
const request = (r.toApiJson) ? r : new GetMessageRequest(r);
|
|
1559
|
-
return this.http.post(this.
|
|
1560
|
-
.pipe(map(resp => Message.fromProto(resp))
|
|
1569
|
+
return this.http.post(this._host + "/conversation.v1.ConversationService/GetMessage", request.toApiJson(), this.apiOptions())
|
|
1570
|
+
.pipe(map(resp => Message.fromProto(resp)));
|
|
1561
1571
|
}
|
|
1562
1572
|
listMessages(r) {
|
|
1563
1573
|
const request = (r.toApiJson) ? r : new ListMessagesRequest(r);
|
|
1564
|
-
return this.http.post(this.
|
|
1565
|
-
.pipe(map(resp => ListMessagesResponse.fromProto(resp))
|
|
1574
|
+
return this.http.post(this._host + "/conversation.v1.ConversationService/ListMessages", request.toApiJson(), this.apiOptions())
|
|
1575
|
+
.pipe(map(resp => ListMessagesResponse.fromProto(resp)));
|
|
1566
1576
|
}
|
|
1567
1577
|
deleteMessage(r) {
|
|
1568
1578
|
const request = (r.toApiJson) ? r : new DeleteMessageRequest(r);
|
|
1569
|
-
return this.http.post(this.
|
|
1579
|
+
return this.http.post(this._host + "/conversation.v1.ConversationService/DeleteMessage", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
|
|
1570
1580
|
}
|
|
1571
1581
|
updateMessageStatus(r) {
|
|
1572
1582
|
const request = (r.toApiJson) ? r : new UpdateMessageStatusRequest(r);
|
|
1573
|
-
return this.http.post(this.
|
|
1583
|
+
return this.http.post(this._host + "/conversation.v1.ConversationService/UpdateMessageStatus", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
|
|
1574
1584
|
}
|
|
1575
1585
|
lookupConversations(r) {
|
|
1576
1586
|
const request = (r.toApiJson) ? r : new LookupConversationsRequest(r);
|
|
1577
|
-
return this.http.post(this.
|
|
1578
|
-
.pipe(map(resp => LookupConversationsResponse.fromProto(resp))
|
|
1587
|
+
return this.http.post(this._host + "/conversation.v1.ConversationService/LookupConversations", request.toApiJson(), this.apiOptions())
|
|
1588
|
+
.pipe(map(resp => LookupConversationsResponse.fromProto(resp)));
|
|
1579
1589
|
}
|
|
1580
1590
|
createConversation(r) {
|
|
1581
1591
|
const request = (r.toApiJson) ? r : new CreateConversationRequest(r);
|
|
1582
|
-
return this.http.post(this.
|
|
1583
|
-
.pipe(map(resp => CreateConversationResponse.fromProto(resp))
|
|
1592
|
+
return this.http.post(this._host + "/conversation.v1.ConversationService/CreateConversation", request.toApiJson(), this.apiOptions())
|
|
1593
|
+
.pipe(map(resp => CreateConversationResponse.fromProto(resp)));
|
|
1584
1594
|
}
|
|
1585
1595
|
deleteConversation(r) {
|
|
1586
1596
|
const request = (r.toApiJson) ? r : new DeleteConversationRequest(r);
|
|
1587
|
-
return this.http.post(this.
|
|
1597
|
+
return this.http.post(this._host + "/conversation.v1.ConversationService/DeleteConversation", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
|
|
1588
1598
|
}
|
|
1589
1599
|
receiveMessage(r) {
|
|
1590
1600
|
const request = (r.toApiJson) ? r : new ReceiveMessageRequest(r);
|
|
1591
|
-
return this.http.post(this.
|
|
1601
|
+
return this.http.post(this._host + "/conversation.v1.ConversationService/ReceiveMessage", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
|
|
1592
1602
|
}
|
|
1593
1603
|
getMultiMessages(r) {
|
|
1594
1604
|
const request = (r.toApiJson) ? r : new GetMultiMessagesRequest(r);
|
|
1595
|
-
return this.http.post(this.
|
|
1596
|
-
.pipe(map(resp => GetMultiMessagesResponse.fromProto(resp))
|
|
1605
|
+
return this.http.post(this._host + "/conversation.v1.ConversationService/GetMultiMessages", request.toApiJson(), this.apiOptions())
|
|
1606
|
+
.pipe(map(resp => GetMultiMessagesResponse.fromProto(resp)));
|
|
1597
1607
|
}
|
|
1598
1608
|
createMultiMessages(r) {
|
|
1599
1609
|
const request = (r.toApiJson) ? r : new CreateMultiMessagesRequest(r);
|
|
1600
|
-
return this.http.post(this.
|
|
1610
|
+
return this.http.post(this._host + "/conversation.v1.ConversationService/CreateMultiMessages", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
|
|
1601
1611
|
}
|
|
1602
1612
|
getMultiConversationDetails(r) {
|
|
1603
1613
|
const request = (r.toApiJson) ? r : new GetMultiConversationDetailsRequest(r);
|
|
1604
|
-
return this.http.post(this.
|
|
1605
|
-
.pipe(map(resp => GetMultiConversationDetailsResponse.fromProto(resp))
|
|
1614
|
+
return this.http.post(this._host + "/conversation.v1.ConversationService/GetMultiConversationDetails", request.toApiJson(), this.apiOptions())
|
|
1615
|
+
.pipe(map(resp => GetMultiConversationDetailsResponse.fromProto(resp)));
|
|
1606
1616
|
}
|
|
1607
1617
|
getMultiParticipants(r) {
|
|
1608
1618
|
const request = (r.toApiJson) ? r : new GetMultiParticipantsRequest(r);
|
|
1609
|
-
return this.http.post(this.
|
|
1610
|
-
.pipe(map(resp => GetMultiParticipantsResponse.fromProto(resp))
|
|
1619
|
+
return this.http.post(this._host + "/conversation.v1.ConversationService/GetMultiParticipants", request.toApiJson(), this.apiOptions())
|
|
1620
|
+
.pipe(map(resp => GetMultiParticipantsResponse.fromProto(resp)));
|
|
1611
1621
|
}
|
|
1612
1622
|
searchConversations(r) {
|
|
1613
1623
|
const request = (r.toApiJson) ? r : new SearchConversationsRequest(r);
|
|
1614
|
-
return this.http.post(this.
|
|
1615
|
-
.pipe(map(resp => SearchConversationsResponse.fromProto(resp))
|
|
1624
|
+
return this.http.post(this._host + "/conversation.v1.ConversationService/SearchConversations", request.toApiJson(), this.apiOptions())
|
|
1625
|
+
.pipe(map(resp => SearchConversationsResponse.fromProto(resp)));
|
|
1616
1626
|
}
|
|
1617
1627
|
getMultiConversationMessageCount(r) {
|
|
1618
1628
|
const request = (r.toApiJson) ? r : new GetMultiConversationMessageCountRequest(r);
|
|
1619
|
-
return this.http.post(this.
|
|
1620
|
-
.pipe(map(resp => GetMultiConversationMessageCountResponse.fromProto(resp))
|
|
1629
|
+
return this.http.post(this._host + "/conversation.v1.ConversationService/GetMultiConversationMessageCount", request.toApiJson(), this.apiOptions())
|
|
1630
|
+
.pipe(map(resp => GetMultiConversationMessageCountResponse.fromProto(resp)));
|
|
1621
1631
|
}
|
|
1622
1632
|
addMultiParticipants(r) {
|
|
1623
1633
|
const request = (r.toApiJson) ? r : new AddMultiParticipantsRequest(r);
|
|
1624
|
-
return this.http.post(this.
|
|
1625
|
-
.pipe(map(resp => AddMultiParticipantsResponse.fromProto(resp))
|
|
1634
|
+
return this.http.post(this._host + "/conversation.v1.ConversationService/AddMultiParticipants", request.toApiJson(), this.apiOptions())
|
|
1635
|
+
.pipe(map(resp => AddMultiParticipantsResponse.fromProto(resp)));
|
|
1636
|
+
}
|
|
1637
|
+
setLastSeen(r) {
|
|
1638
|
+
const request = (r.toApiJson) ? r : new SetLastSeenRequest(r);
|
|
1639
|
+
return this.http.post(this._host + "/conversation.v1.ConversationService/SetLastSeen", request.toApiJson(), this.apiOptions())
|
|
1640
|
+
.pipe(map(resp => SetLastSeenResponse.fromProto(resp)));
|
|
1626
1641
|
}
|
|
1627
1642
|
}
|
|
1628
|
-
ConversationApiService.ɵ
|
|
1629
|
-
ConversationApiService
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
{ type: HostService }
|
|
1635
|
-
];
|
|
1643
|
+
ConversationApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: ConversationApiService, deps: [{ token: i1.HttpClient }, { token: HostService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1644
|
+
ConversationApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: ConversationApiService, providedIn: 'root' });
|
|
1645
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: ConversationApiService, decorators: [{
|
|
1646
|
+
type: Injectable,
|
|
1647
|
+
args: [{ providedIn: 'root' }]
|
|
1648
|
+
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: HostService }]; } });
|
|
1636
1649
|
|
|
1637
1650
|
// *********************************
|
|
1638
1651
|
|
|
@@ -1640,5 +1653,5 @@ ConversationApiService.ctorParameters = () => [
|
|
|
1640
1653
|
* Generated bundle index. Do not edit.
|
|
1641
1654
|
*/
|
|
1642
1655
|
|
|
1643
|
-
export { AddMultiParticipantsRequest, AddMultiParticipantsResponse, Address, Conversation, ConversationApiService, ConversationChannel, ConversationMessageCount, CreateConversationRequest, CreateConversationResponse, CreateMultiMessagesRequest, DeleteConversationRequest, DeleteMessageRequest, GetMessageRequest, GetMultiConversationDetailsRequest, GetMultiConversationDetailsResponse, GetMultiConversationDetailsResponseDetailedConversation, GetMultiConversationMessageCountRequest, GetMultiConversationMessageCountResponse, GetMultiConversationMessageCountResponseCountsEntry, GetMultiMessagesRequest, GetMultiMessagesResponse, GetMultiParticipantsRequest, GetMultiParticipantsResponse, ListMessagesRequest, ListMessagesRequestListMessagesFilters, ListMessagesResponse, LookupConversationsRequest, LookupConversationsRequestLookupConversationsFilters, LookupConversationsResponse, LookupConversationsResponseConversations, Message, MessageStatus, MessageType, Metadata, MetadataDataEntry, MetadataIdentifier, PagedRequestOptions, PagedResponseMetadata, Participant, ParticipantMessageStatus, ParticipantType, PlatformLocation, ReceiveMessageRequest, ReceiveMessageRequestMetadataEntry, SearchConversationsRequest, SearchConversationsResponse, SearchConversationsResponseDetailedConversation, SendMessageRequest, SendMessageResponse,
|
|
1644
|
-
//# sourceMappingURL=vendasta-conversation.
|
|
1656
|
+
export { AddMultiParticipantsRequest, AddMultiParticipantsResponse, Address, Conversation, ConversationApiService, ConversationChannel, ConversationMessageCount, CreateConversationRequest, CreateConversationResponse, CreateMultiMessagesRequest, DeleteConversationRequest, DeleteMessageRequest, GetMessageRequest, GetMultiConversationDetailsRequest, GetMultiConversationDetailsResponse, GetMultiConversationDetailsResponseDetailedConversation, GetMultiConversationMessageCountRequest, GetMultiConversationMessageCountResponse, GetMultiConversationMessageCountResponseCountsEntry, GetMultiMessagesRequest, GetMultiMessagesResponse, GetMultiParticipantsRequest, GetMultiParticipantsResponse, ListMessagesRequest, ListMessagesRequestListMessagesFilters, ListMessagesResponse, LookupConversationsRequest, LookupConversationsRequestLookupConversationsFilters, LookupConversationsResponse, LookupConversationsResponseConversations, Message, MessageStatus, MessageType, Metadata, MetadataDataEntry, MetadataIdentifier, PagedRequestOptions, PagedResponseMetadata, Participant, ParticipantMessageStatus, ParticipantType, PlatformLocation, ReceiveMessageRequest, ReceiveMessageRequestMetadataEntry, SearchConversationsRequest, SearchConversationsResponse, SearchConversationsResponseDetailedConversation, SendMessageRequest, SendMessageResponse, SetLastSeenRequest, SetLastSeenResponse, UpdateMessageStatusRequest };
|
|
1657
|
+
//# sourceMappingURL=vendasta-conversation.mjs.map
|