@vendasta/conversation 0.13.0 → 0.16.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 (63) hide show
  1. package/esm2020/lib/_generated/host.service.mjs +25 -0
  2. package/esm2020/lib/_internal/conversation.api.service.mjs +116 -0
  3. package/esm2020/lib/_internal/enums/api.enum.mjs +14 -0
  4. package/esm2020/lib/_internal/enums/conversation.enum.mjs +25 -0
  5. package/esm2020/lib/_internal/enums/index.mjs +11 -0
  6. package/esm2020/lib/_internal/enums/message.enum.mjs +21 -0
  7. package/esm2020/lib/_internal/enums/participant.enum.mjs +18 -0
  8. package/esm2020/lib/_internal/index.mjs +11 -0
  9. package/esm2020/lib/_internal/interfaces/api.interface.mjs +2 -0
  10. package/esm2020/lib/_internal/interfaces/conversation.interface.mjs +8 -0
  11. package/esm2020/lib/_internal/interfaces/index.mjs +2 -0
  12. package/esm2020/lib/_internal/interfaces/message.interface.mjs +8 -0
  13. package/esm2020/lib/_internal/interfaces/participant.interface.mjs +8 -0
  14. package/esm2020/lib/_internal/objects/api.mjs +1141 -0
  15. package/esm2020/lib/_internal/objects/conversation.mjs +73 -0
  16. package/esm2020/lib/_internal/objects/index.mjs +11 -0
  17. package/esm2020/lib/_internal/objects/message.mjs +105 -0
  18. package/esm2020/lib/_internal/objects/participant.mjs +129 -0
  19. package/esm2020/lib/index.mjs +3 -0
  20. package/esm2020/public_api.mjs +2 -0
  21. package/esm2020/vendasta-conversation.mjs +5 -0
  22. package/fesm2015/vendasta-conversation.mjs +1664 -0
  23. package/fesm2015/vendasta-conversation.mjs.map +1 -0
  24. package/{fesm2015/vendasta-conversation.js → fesm2020/vendasta-conversation.mjs} +144 -125
  25. package/fesm2020/vendasta-conversation.mjs.map +1 -0
  26. package/lib/_generated/host.service.d.ts +5 -9
  27. package/lib/_internal/conversation.api.service.d.ts +7 -2
  28. package/lib/_internal/interfaces/api.interface.d.ts +10 -2
  29. package/lib/_internal/interfaces/index.d.ts +1 -1
  30. package/lib/_internal/interfaces/participant.interface.d.ts +1 -0
  31. package/lib/_internal/objects/api.d.ts +20 -6
  32. package/lib/_internal/objects/index.d.ts +1 -1
  33. package/lib/_internal/objects/participant.d.ts +1 -0
  34. package/package.json +27 -16
  35. package/src/README.md +1 -0
  36. package/vendasta-conversation.d.ts +1 -1
  37. package/bundles/vendasta-conversation.umd.js +0 -1712
  38. package/bundles/vendasta-conversation.umd.js.map +0 -1
  39. package/bundles/vendasta-conversation.umd.min.js +0 -2
  40. package/bundles/vendasta-conversation.umd.min.js.map +0 -1
  41. package/esm2015/lib/_generated/host.service.js +0 -65
  42. package/esm2015/lib/_internal/conversation.api.service.js +0 -112
  43. package/esm2015/lib/_internal/enums/api.enum.js +0 -14
  44. package/esm2015/lib/_internal/enums/conversation.enum.js +0 -25
  45. package/esm2015/lib/_internal/enums/index.js +0 -11
  46. package/esm2015/lib/_internal/enums/message.enum.js +0 -21
  47. package/esm2015/lib/_internal/enums/participant.enum.js +0 -18
  48. package/esm2015/lib/_internal/index.js +0 -11
  49. package/esm2015/lib/_internal/interfaces/api.interface.js +0 -2
  50. package/esm2015/lib/_internal/interfaces/conversation.interface.js +0 -8
  51. package/esm2015/lib/_internal/interfaces/index.js +0 -2
  52. package/esm2015/lib/_internal/interfaces/message.interface.js +0 -8
  53. package/esm2015/lib/_internal/interfaces/participant.interface.js +0 -8
  54. package/esm2015/lib/_internal/objects/api.js +0 -1092
  55. package/esm2015/lib/_internal/objects/conversation.js +0 -73
  56. package/esm2015/lib/_internal/objects/index.js +0 -11
  57. package/esm2015/lib/_internal/objects/message.js +0 -105
  58. package/esm2015/lib/_internal/objects/participant.js +0 -126
  59. package/esm2015/lib/index.js +0 -3
  60. package/esm2015/public_api.js +0 -2
  61. package/esm2015/vendasta-conversation.js +0 -6
  62. package/fesm2015/vendasta-conversation.js.map +0 -1
  63. package/vendasta-conversation.metadata.json +0 -1
@@ -1,1712 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common/http'), require('@vendasta/core'), require('rxjs/operators')) :
3
- typeof define === 'function' && define.amd ? define('@vendasta/conversation', ['exports', '@angular/core', '@angular/common/http', '@vendasta/core', 'rxjs/operators'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.vendasta = global.vendasta || {}, global.vendasta.conversation = {}), global.ng.core, global.ng.common.http, global.i1, global.rxjs.operators));
5
- }(this, (function (exports, i0, i1$1, i1, operators) { 'use strict';
6
-
7
- // *********************************
8
- (function (MessageStatus) {
9
- MessageStatus[MessageStatus["MESSAGE_STATUS_NOT_READ"] = 0] = "MESSAGE_STATUS_NOT_READ";
10
- MessageStatus[MessageStatus["MESSAGE_STATUS_READ"] = 1] = "MESSAGE_STATUS_READ";
11
- MessageStatus[MessageStatus["MESSAGE_STATUS_SENT"] = 2] = "MESSAGE_STATUS_SENT";
12
- MessageStatus[MessageStatus["MESSAGE_STATUS_DELIVERED"] = 3] = "MESSAGE_STATUS_DELIVERED";
13
- MessageStatus[MessageStatus["MESSAGE_STATUS_FAILED"] = 4] = "MESSAGE_STATUS_FAILED";
14
- MessageStatus[MessageStatus["MESSAGE_STATUS_UNDELIVERED"] = 5] = "MESSAGE_STATUS_UNDELIVERED";
15
- })(exports.MessageStatus || (exports.MessageStatus = {}));
16
- (function (MessageType) {
17
- MessageType[MessageType["MESSAGE_TYPE_MESSAGE"] = 0] = "MESSAGE_TYPE_MESSAGE";
18
- MessageType[MessageType["MESSAGE_TYPE_MEDIA"] = 1] = "MESSAGE_TYPE_MEDIA";
19
- })(exports.MessageType || (exports.MessageType = {}));
20
-
21
- // *********************************
22
- (function (ConversationChannel) {
23
- ConversationChannel[ConversationChannel["CONVERSATION_CHANNEL_UNDEFINED"] = 0] = "CONVERSATION_CHANNEL_UNDEFINED";
24
- ConversationChannel[ConversationChannel["CONVERSATION_CHANNEL_INTERNAL"] = 1] = "CONVERSATION_CHANNEL_INTERNAL";
25
- ConversationChannel[ConversationChannel["CONVERSATION_CHANNEL_SMS"] = 2] = "CONVERSATION_CHANNEL_SMS";
26
- ConversationChannel[ConversationChannel["CONVERSATION_CHANNEL_FACEBOOK"] = 3] = "CONVERSATION_CHANNEL_FACEBOOK";
27
- ConversationChannel[ConversationChannel["CONVERSATION_CHANNEL_GOOGLE_MESSAGES"] = 4] = "CONVERSATION_CHANNEL_GOOGLE_MESSAGES";
28
- })(exports.ConversationChannel || (exports.ConversationChannel = {}));
29
- (function (PlatformLocation) {
30
- PlatformLocation[PlatformLocation["PLATFORM_LOCATION_UNDEFINED"] = 0] = "PLATFORM_LOCATION_UNDEFINED";
31
- PlatformLocation[PlatformLocation["PLATFORM_LOCATION_BUSINESS_APP"] = 1] = "PLATFORM_LOCATION_BUSINESS_APP";
32
- PlatformLocation[PlatformLocation["PLATFORM_LOCATION_PARTNER_CENTER"] = 2] = "PLATFORM_LOCATION_PARTNER_CENTER";
33
- PlatformLocation[PlatformLocation["PLATFORM_LOCATION_VENDOR_CENTER"] = 3] = "PLATFORM_LOCATION_VENDOR_CENTER";
34
- PlatformLocation[PlatformLocation["PLATFORM_LOCATION_TASK_MANAGER"] = 4] = "PLATFORM_LOCATION_TASK_MANAGER";
35
- PlatformLocation[PlatformLocation["PLATFORM_LOCATION_PROPOSAL_BUILDER"] = 5] = "PLATFORM_LOCATION_PROPOSAL_BUILDER";
36
- PlatformLocation[PlatformLocation["PLATFORM_LOCATION_SALES_CENTER"] = 6] = "PLATFORM_LOCATION_SALES_CENTER";
37
- })(exports.PlatformLocation || (exports.PlatformLocation = {}));
38
-
39
- // *********************************
40
- (function (ParticipantType) {
41
- ParticipantType[ParticipantType["PARTICIPANT_TYPE_UNDEFINED"] = 0] = "PARTICIPANT_TYPE_UNDEFINED";
42
- ParticipantType[ParticipantType["PARTICIPANT_TYPE_CUSTOMER"] = 1] = "PARTICIPANT_TYPE_CUSTOMER";
43
- ParticipantType[ParticipantType["PARTICIPANT_TYPE_IAM_USER"] = 2] = "PARTICIPANT_TYPE_IAM_USER";
44
- ParticipantType[ParticipantType["PARTICIPANT_TYPE_ACCOUNT_GROUP"] = 3] = "PARTICIPANT_TYPE_ACCOUNT_GROUP";
45
- ParticipantType[ParticipantType["PARTICIPANT_TYPE_PARTNER"] = 4] = "PARTICIPANT_TYPE_PARTNER";
46
- ParticipantType[ParticipantType["PARTICIPANT_TYPE_IAM_TEMPORARY_SUBJECT"] = 5] = "PARTICIPANT_TYPE_IAM_TEMPORARY_SUBJECT";
47
- ParticipantType[ParticipantType["PARTICIPANT_TYPE_DIGITAL_AGENT"] = 6] = "PARTICIPANT_TYPE_DIGITAL_AGENT";
48
- ParticipantType[ParticipantType["PARTICIPANT_TYPE_VENDOR"] = 7] = "PARTICIPANT_TYPE_VENDOR";
49
- })(exports.ParticipantType || (exports.ParticipantType = {}));
50
-
51
- // *********************************
52
- (function (MetadataIdentifier) {
53
- MetadataIdentifier[MetadataIdentifier["METADATA_IDENTIFIER_UNDEFINED"] = 0] = "METADATA_IDENTIFIER_UNDEFINED";
54
- MetadataIdentifier[MetadataIdentifier["METADATA_IDENTIFIER_RECIPIENT"] = 1] = "METADATA_IDENTIFIER_RECIPIENT";
55
- MetadataIdentifier[MetadataIdentifier["METADATA_IDENTIFIER_SENDER"] = 2] = "METADATA_IDENTIFIER_SENDER";
56
- MetadataIdentifier[MetadataIdentifier["METADATA_IDENTIFIER_CONVERSATION"] = 3] = "METADATA_IDENTIFIER_CONVERSATION";
57
- })(exports.MetadataIdentifier || (exports.MetadataIdentifier = {}));
58
-
59
- // *********************************
60
-
61
- function enumStringToValue(enumRef, value) {
62
- if (typeof value === 'number') {
63
- return value;
64
- }
65
- return enumRef[value];
66
- }
67
- var Message = /** @class */ (function () {
68
- function Message(kwargs) {
69
- if (!kwargs) {
70
- return;
71
- }
72
- Object.assign(this, kwargs);
73
- }
74
- Message.fromProto = function (proto) {
75
- var m = new Message();
76
- m = Object.assign(m, proto);
77
- if (proto.type) {
78
- m.type = enumStringToValue(exports.MessageType, proto.type);
79
- }
80
- if (proto.created) {
81
- m.created = new Date(proto.created);
82
- }
83
- if (proto.updated) {
84
- m.updated = new Date(proto.updated);
85
- }
86
- if (proto.deleted) {
87
- m.deleted = new Date(proto.deleted);
88
- }
89
- return m;
90
- };
91
- Message.prototype.toApiJson = function () {
92
- var toReturn = {};
93
- if (typeof this.messageId !== 'undefined') {
94
- toReturn['messageId'] = this.messageId;
95
- }
96
- if (typeof this.externalMessageId !== 'undefined') {
97
- toReturn['externalMessageId'] = this.externalMessageId;
98
- }
99
- if (typeof this.conversationId !== 'undefined') {
100
- toReturn['conversationId'] = this.conversationId;
101
- }
102
- if (typeof this.participantId !== 'undefined') {
103
- toReturn['participantId'] = this.participantId;
104
- }
105
- if (typeof this.type !== 'undefined') {
106
- toReturn['type'] = this.type;
107
- }
108
- if (typeof this.body !== 'undefined') {
109
- toReturn['body'] = this.body;
110
- }
111
- if (typeof this.error !== 'undefined') {
112
- toReturn['error'] = this.error;
113
- }
114
- if (typeof this.created !== 'undefined' && this.created !== null) {
115
- toReturn['created'] = 'toApiJson' in this.created ? this.created.toApiJson() : this.created;
116
- }
117
- if (typeof this.updated !== 'undefined' && this.updated !== null) {
118
- toReturn['updated'] = 'toApiJson' in this.updated ? this.updated.toApiJson() : this.updated;
119
- }
120
- if (typeof this.deleted !== 'undefined' && this.deleted !== null) {
121
- toReturn['deleted'] = 'toApiJson' in this.deleted ? this.deleted.toApiJson() : this.deleted;
122
- }
123
- if (typeof this.media !== 'undefined') {
124
- toReturn['media'] = this.media;
125
- }
126
- return toReturn;
127
- };
128
- return Message;
129
- }());
130
- var ParticipantMessageStatus = /** @class */ (function () {
131
- function ParticipantMessageStatus(kwargs) {
132
- if (!kwargs) {
133
- return;
134
- }
135
- Object.assign(this, kwargs);
136
- }
137
- ParticipantMessageStatus.fromProto = function (proto) {
138
- var m = new ParticipantMessageStatus();
139
- m = Object.assign(m, proto);
140
- if (proto.status) {
141
- m.status = enumStringToValue(exports.MessageStatus, proto.status);
142
- }
143
- if (proto.updated) {
144
- m.updated = new Date(proto.updated);
145
- }
146
- return m;
147
- };
148
- ParticipantMessageStatus.prototype.toApiJson = function () {
149
- var toReturn = {};
150
- if (typeof this.participantId !== 'undefined') {
151
- toReturn['participantId'] = this.participantId;
152
- }
153
- if (typeof this.messageId !== 'undefined') {
154
- toReturn['messageId'] = this.messageId;
155
- }
156
- if (typeof this.status !== 'undefined') {
157
- toReturn['status'] = this.status;
158
- }
159
- if (typeof this.updated !== 'undefined' && this.updated !== null) {
160
- toReturn['updated'] = 'toApiJson' in this.updated ? this.updated.toApiJson() : this.updated;
161
- }
162
- return toReturn;
163
- };
164
- return ParticipantMessageStatus;
165
- }());
166
-
167
- function enumStringToValue$1(enumRef, value) {
168
- if (typeof value === 'number') {
169
- return value;
170
- }
171
- return enumRef[value];
172
- }
173
- var Conversation = /** @class */ (function () {
174
- function Conversation(kwargs) {
175
- if (!kwargs) {
176
- return;
177
- }
178
- Object.assign(this, kwargs);
179
- }
180
- Conversation.fromProto = function (proto) {
181
- var m = new Conversation();
182
- m = Object.assign(m, proto);
183
- if (proto.channel) {
184
- m.channel = enumStringToValue$1(exports.ConversationChannel, proto.channel);
185
- }
186
- if (proto.created) {
187
- m.created = new Date(proto.created);
188
- }
189
- if (proto.updated) {
190
- m.updated = new Date(proto.updated);
191
- }
192
- if (proto.deleted) {
193
- m.deleted = new Date(proto.deleted);
194
- }
195
- if (proto.latestMsgSentTime) {
196
- m.latestMsgSentTime = new Date(proto.latestMsgSentTime);
197
- }
198
- if (proto.originLocation) {
199
- m.originLocation = enumStringToValue$1(exports.PlatformLocation, proto.originLocation);
200
- }
201
- return m;
202
- };
203
- Conversation.prototype.toApiJson = function () {
204
- var toReturn = {};
205
- if (typeof this.conversationId !== 'undefined') {
206
- toReturn['conversationId'] = this.conversationId;
207
- }
208
- if (typeof this.channel !== 'undefined') {
209
- toReturn['channel'] = this.channel;
210
- }
211
- if (typeof this.externalConversationId !== 'undefined') {
212
- toReturn['externalConversationId'] = this.externalConversationId;
213
- }
214
- if (typeof this.created !== 'undefined' && this.created !== null) {
215
- toReturn['created'] = 'toApiJson' in this.created ? this.created.toApiJson() : this.created;
216
- }
217
- if (typeof this.updated !== 'undefined' && this.updated !== null) {
218
- toReturn['updated'] = 'toApiJson' in this.updated ? this.updated.toApiJson() : this.updated;
219
- }
220
- if (typeof this.deleted !== 'undefined' && this.deleted !== null) {
221
- toReturn['deleted'] = 'toApiJson' in this.deleted ? this.deleted.toApiJson() : this.deleted;
222
- }
223
- if (typeof this.participantIds !== 'undefined') {
224
- toReturn['participantIds'] = this.participantIds;
225
- }
226
- if (typeof this.latestMsgSentTime !== 'undefined' && this.latestMsgSentTime !== null) {
227
- toReturn['latestMsgSentTime'] = 'toApiJson' in this.latestMsgSentTime ? this.latestMsgSentTime.toApiJson() : this.latestMsgSentTime;
228
- }
229
- if (typeof this.originLocation !== 'undefined') {
230
- toReturn['originLocation'] = this.originLocation;
231
- }
232
- if (typeof this.originLocationExternalId !== 'undefined') {
233
- toReturn['originLocationExternalId'] = this.originLocationExternalId;
234
- }
235
- return toReturn;
236
- };
237
- return Conversation;
238
- }());
239
-
240
- function enumStringToValue$2(enumRef, value) {
241
- if (typeof value === 'number') {
242
- return value;
243
- }
244
- return enumRef[value];
245
- }
246
- var Address = /** @class */ (function () {
247
- function Address(kwargs) {
248
- if (!kwargs) {
249
- return;
250
- }
251
- Object.assign(this, kwargs);
252
- }
253
- Address.fromProto = function (proto) {
254
- var m = new Address();
255
- m = Object.assign(m, proto);
256
- return m;
257
- };
258
- Address.prototype.toApiJson = function () {
259
- var toReturn = {};
260
- if (typeof this.firstLineAddress !== 'undefined') {
261
- toReturn['firstLineAddress'] = this.firstLineAddress;
262
- }
263
- if (typeof this.secondLineAddress !== 'undefined') {
264
- toReturn['secondLineAddress'] = this.secondLineAddress;
265
- }
266
- if (typeof this.city !== 'undefined') {
267
- toReturn['city'] = this.city;
268
- }
269
- if (typeof this.state !== 'undefined') {
270
- toReturn['state'] = this.state;
271
- }
272
- if (typeof this.country !== 'undefined') {
273
- toReturn['country'] = this.country;
274
- }
275
- if (typeof this.zipCode !== 'undefined') {
276
- toReturn['zipCode'] = this.zipCode;
277
- }
278
- return toReturn;
279
- };
280
- return Address;
281
- }());
282
- var Participant = /** @class */ (function () {
283
- function Participant(kwargs) {
284
- if (!kwargs) {
285
- return;
286
- }
287
- Object.assign(this, kwargs);
288
- }
289
- Participant.fromProto = function (proto) {
290
- var m = new Participant();
291
- m = Object.assign(m, proto);
292
- if (proto.location) {
293
- m.location = enumStringToValue$2(exports.PlatformLocation, proto.location);
294
- }
295
- if (proto.channel) {
296
- m.channel = enumStringToValue$2(exports.ConversationChannel, proto.channel);
297
- }
298
- if (proto.created) {
299
- m.created = new Date(proto.created);
300
- }
301
- if (proto.updated) {
302
- m.updated = new Date(proto.updated);
303
- }
304
- if (proto.deleted) {
305
- m.deleted = new Date(proto.deleted);
306
- }
307
- if (proto.participantType) {
308
- m.participantType = enumStringToValue$2(exports.ParticipantType, proto.participantType);
309
- }
310
- if (proto.address) {
311
- m.address = Address.fromProto(proto.address);
312
- }
313
- return m;
314
- };
315
- Participant.prototype.toApiJson = function () {
316
- var toReturn = {};
317
- if (typeof this.participantId !== 'undefined') {
318
- toReturn['participantId'] = this.participantId;
319
- }
320
- if (typeof this.internalParticipantId !== 'undefined') {
321
- toReturn['internalParticipantId'] = this.internalParticipantId;
322
- }
323
- if (typeof this.partnerId !== 'undefined') {
324
- toReturn['partnerId'] = this.partnerId;
325
- }
326
- if (typeof this.accountGroupId !== 'undefined') {
327
- toReturn['accountGroupId'] = this.accountGroupId;
328
- }
329
- if (typeof this.location !== 'undefined') {
330
- toReturn['location'] = this.location;
331
- }
332
- if (typeof this.channel !== 'undefined') {
333
- toReturn['channel'] = this.channel;
334
- }
335
- if (typeof this.externalParticipantId !== 'undefined') {
336
- toReturn['externalParticipantId'] = this.externalParticipantId;
337
- }
338
- if (typeof this.name !== 'undefined') {
339
- toReturn['name'] = this.name;
340
- }
341
- if (typeof this.created !== 'undefined' && this.created !== null) {
342
- toReturn['created'] = 'toApiJson' in this.created ? this.created.toApiJson() : this.created;
343
- }
344
- if (typeof this.updated !== 'undefined' && this.updated !== null) {
345
- toReturn['updated'] = 'toApiJson' in this.updated ? this.updated.toApiJson() : this.updated;
346
- }
347
- if (typeof this.deleted !== 'undefined' && this.deleted !== null) {
348
- toReturn['deleted'] = 'toApiJson' in this.deleted ? this.deleted.toApiJson() : this.deleted;
349
- }
350
- if (typeof this.participantType !== 'undefined') {
351
- toReturn['participantType'] = this.participantType;
352
- }
353
- if (typeof this.email !== 'undefined') {
354
- toReturn['email'] = this.email;
355
- }
356
- if (typeof this.phoneNumber !== 'undefined') {
357
- toReturn['phoneNumber'] = this.phoneNumber;
358
- }
359
- if (typeof this.address !== 'undefined' && this.address !== null) {
360
- toReturn['address'] = 'toApiJson' in this.address ? this.address.toApiJson() : this.address;
361
- }
362
- return toReturn;
363
- };
364
- return Participant;
365
- }());
366
-
367
- function enumStringToValue$3(enumRef, value) {
368
- if (typeof value === 'number') {
369
- return value;
370
- }
371
- return enumRef[value];
372
- }
373
- var AddMultiParticipantsRequest = /** @class */ (function () {
374
- function AddMultiParticipantsRequest(kwargs) {
375
- if (!kwargs) {
376
- return;
377
- }
378
- Object.assign(this, kwargs);
379
- }
380
- AddMultiParticipantsRequest.fromProto = function (proto) {
381
- var m = new AddMultiParticipantsRequest();
382
- m = Object.assign(m, proto);
383
- if (proto.participants) {
384
- m.participants = proto.participants.map(Participant.fromProto);
385
- }
386
- return m;
387
- };
388
- AddMultiParticipantsRequest.prototype.toApiJson = function () {
389
- var toReturn = {};
390
- if (typeof this.conversationId !== 'undefined') {
391
- toReturn['conversationId'] = this.conversationId;
392
- }
393
- if (typeof this.participants !== 'undefined' && this.participants !== null) {
394
- toReturn['participants'] = 'toApiJson' in this.participants ? this.participants.toApiJson() : this.participants;
395
- }
396
- return toReturn;
397
- };
398
- return AddMultiParticipantsRequest;
399
- }());
400
- var AddMultiParticipantsResponse = /** @class */ (function () {
401
- function AddMultiParticipantsResponse(kwargs) {
402
- if (!kwargs) {
403
- return;
404
- }
405
- Object.assign(this, kwargs);
406
- }
407
- AddMultiParticipantsResponse.fromProto = function (proto) {
408
- var m = new AddMultiParticipantsResponse();
409
- m = Object.assign(m, proto);
410
- if (proto.participants) {
411
- m.participants = proto.participants.map(Participant.fromProto);
412
- }
413
- return m;
414
- };
415
- AddMultiParticipantsResponse.prototype.toApiJson = function () {
416
- var toReturn = {};
417
- if (typeof this.participants !== 'undefined' && this.participants !== null) {
418
- toReturn['participants'] = 'toApiJson' in this.participants ? this.participants.toApiJson() : this.participants;
419
- }
420
- return toReturn;
421
- };
422
- return AddMultiParticipantsResponse;
423
- }());
424
- var ConversationMessageCount = /** @class */ (function () {
425
- function ConversationMessageCount(kwargs) {
426
- if (!kwargs) {
427
- return;
428
- }
429
- Object.assign(this, kwargs);
430
- }
431
- ConversationMessageCount.fromProto = function (proto) {
432
- var m = new ConversationMessageCount();
433
- m = Object.assign(m, proto);
434
- if (proto.count) {
435
- m.count = parseInt(proto.count, 10);
436
- }
437
- return m;
438
- };
439
- ConversationMessageCount.prototype.toApiJson = function () {
440
- var toReturn = {};
441
- if (typeof this.conversationId !== 'undefined') {
442
- toReturn['conversationId'] = this.conversationId;
443
- }
444
- if (typeof this.count !== 'undefined') {
445
- toReturn['count'] = this.count;
446
- }
447
- return toReturn;
448
- };
449
- return ConversationMessageCount;
450
- }());
451
- var LookupConversationsResponseConversations = /** @class */ (function () {
452
- function LookupConversationsResponseConversations(kwargs) {
453
- if (!kwargs) {
454
- return;
455
- }
456
- Object.assign(this, kwargs);
457
- }
458
- LookupConversationsResponseConversations.fromProto = function (proto) {
459
- var m = new LookupConversationsResponseConversations();
460
- m = Object.assign(m, proto);
461
- if (proto.conversation) {
462
- m.conversation = Conversation.fromProto(proto.conversation);
463
- }
464
- if (proto.participants) {
465
- m.participants = proto.participants.map(Participant.fromProto);
466
- }
467
- return m;
468
- };
469
- LookupConversationsResponseConversations.prototype.toApiJson = function () {
470
- var toReturn = {};
471
- if (typeof this.conversation !== 'undefined' && this.conversation !== null) {
472
- toReturn['conversation'] = 'toApiJson' in this.conversation ? this.conversation.toApiJson() : this.conversation;
473
- }
474
- if (typeof this.participants !== 'undefined' && this.participants !== null) {
475
- toReturn['participants'] = 'toApiJson' in this.participants ? this.participants.toApiJson() : this.participants;
476
- }
477
- return toReturn;
478
- };
479
- return LookupConversationsResponseConversations;
480
- }());
481
- var GetMultiConversationMessageCountResponseCountsEntry = /** @class */ (function () {
482
- function GetMultiConversationMessageCountResponseCountsEntry(kwargs) {
483
- if (!kwargs) {
484
- return;
485
- }
486
- Object.assign(this, kwargs);
487
- }
488
- GetMultiConversationMessageCountResponseCountsEntry.fromProto = function (proto) {
489
- var m = new GetMultiConversationMessageCountResponseCountsEntry();
490
- m = Object.assign(m, proto);
491
- if (proto.value) {
492
- m.value = parseInt(proto.value, 10);
493
- }
494
- return m;
495
- };
496
- GetMultiConversationMessageCountResponseCountsEntry.prototype.toApiJson = function () {
497
- var toReturn = {};
498
- if (typeof this.key !== 'undefined') {
499
- toReturn['key'] = this.key;
500
- }
501
- if (typeof this.value !== 'undefined') {
502
- toReturn['value'] = this.value;
503
- }
504
- return toReturn;
505
- };
506
- return GetMultiConversationMessageCountResponseCountsEntry;
507
- }());
508
- var CreateConversationRequest = /** @class */ (function () {
509
- function CreateConversationRequest(kwargs) {
510
- if (!kwargs) {
511
- return;
512
- }
513
- Object.assign(this, kwargs);
514
- }
515
- CreateConversationRequest.fromProto = function (proto) {
516
- var m = new CreateConversationRequest();
517
- m = Object.assign(m, proto);
518
- if (proto.participants) {
519
- m.participants = proto.participants.map(Participant.fromProto);
520
- }
521
- if (proto.channel) {
522
- m.channel = enumStringToValue$3(exports.ConversationChannel, proto.channel);
523
- }
524
- if (proto.created) {
525
- m.created = new Date(proto.created);
526
- }
527
- if (proto.updated) {
528
- m.updated = new Date(proto.updated);
529
- }
530
- if (proto.originLocation) {
531
- m.originLocation = enumStringToValue$3(exports.PlatformLocation, proto.originLocation);
532
- }
533
- return m;
534
- };
535
- CreateConversationRequest.prototype.toApiJson = function () {
536
- var toReturn = {};
537
- if (typeof this.participants !== 'undefined' && this.participants !== null) {
538
- toReturn['participants'] = 'toApiJson' in this.participants ? this.participants.toApiJson() : this.participants;
539
- }
540
- if (typeof this.channel !== 'undefined') {
541
- toReturn['channel'] = this.channel;
542
- }
543
- if (typeof this.externalConversationId !== 'undefined') {
544
- toReturn['externalConversationId'] = this.externalConversationId;
545
- }
546
- if (typeof this.created !== 'undefined' && this.created !== null) {
547
- toReturn['created'] = 'toApiJson' in this.created ? this.created.toApiJson() : this.created;
548
- }
549
- if (typeof this.updated !== 'undefined' && this.updated !== null) {
550
- toReturn['updated'] = 'toApiJson' in this.updated ? this.updated.toApiJson() : this.updated;
551
- }
552
- if (typeof this.originLocation !== 'undefined') {
553
- toReturn['originLocation'] = this.originLocation;
554
- }
555
- if (typeof this.originLocationExternalId !== 'undefined') {
556
- toReturn['originLocationExternalId'] = this.originLocationExternalId;
557
- }
558
- return toReturn;
559
- };
560
- return CreateConversationRequest;
561
- }());
562
- var CreateConversationResponse = /** @class */ (function () {
563
- function CreateConversationResponse(kwargs) {
564
- if (!kwargs) {
565
- return;
566
- }
567
- Object.assign(this, kwargs);
568
- }
569
- CreateConversationResponse.fromProto = function (proto) {
570
- var m = new CreateConversationResponse();
571
- m = Object.assign(m, proto);
572
- if (proto.conversation) {
573
- m.conversation = Conversation.fromProto(proto.conversation);
574
- }
575
- if (proto.participants) {
576
- m.participants = proto.participants.map(Participant.fromProto);
577
- }
578
- return m;
579
- };
580
- CreateConversationResponse.prototype.toApiJson = function () {
581
- var toReturn = {};
582
- if (typeof this.conversation !== 'undefined' && this.conversation !== null) {
583
- toReturn['conversation'] = 'toApiJson' in this.conversation ? this.conversation.toApiJson() : this.conversation;
584
- }
585
- if (typeof this.participants !== 'undefined' && this.participants !== null) {
586
- toReturn['participants'] = 'toApiJson' in this.participants ? this.participants.toApiJson() : this.participants;
587
- }
588
- return toReturn;
589
- };
590
- return CreateConversationResponse;
591
- }());
592
- var CreateMultiMessagesRequest = /** @class */ (function () {
593
- function CreateMultiMessagesRequest(kwargs) {
594
- if (!kwargs) {
595
- return;
596
- }
597
- Object.assign(this, kwargs);
598
- }
599
- CreateMultiMessagesRequest.fromProto = function (proto) {
600
- var m = new CreateMultiMessagesRequest();
601
- m = Object.assign(m, proto);
602
- if (proto.messages) {
603
- m.messages = proto.messages.map(Message.fromProto);
604
- }
605
- if (proto.lastSeen) {
606
- m.lastSeen = new Date(proto.lastSeen);
607
- }
608
- return m;
609
- };
610
- CreateMultiMessagesRequest.prototype.toApiJson = function () {
611
- var toReturn = {};
612
- if (typeof this.messages !== 'undefined' && this.messages !== null) {
613
- toReturn['messages'] = 'toApiJson' in this.messages ? this.messages.toApiJson() : this.messages;
614
- }
615
- if (typeof this.lastSeen !== 'undefined' && this.lastSeen !== null) {
616
- toReturn['lastSeen'] = 'toApiJson' in this.lastSeen ? this.lastSeen.toApiJson() : this.lastSeen;
617
- }
618
- return toReturn;
619
- };
620
- return CreateMultiMessagesRequest;
621
- }());
622
- var MetadataDataEntry = /** @class */ (function () {
623
- function MetadataDataEntry(kwargs) {
624
- if (!kwargs) {
625
- return;
626
- }
627
- Object.assign(this, kwargs);
628
- }
629
- MetadataDataEntry.fromProto = function (proto) {
630
- var m = new MetadataDataEntry();
631
- m = Object.assign(m, proto);
632
- return m;
633
- };
634
- MetadataDataEntry.prototype.toApiJson = function () {
635
- var toReturn = {};
636
- if (typeof this.key !== 'undefined') {
637
- toReturn['key'] = this.key;
638
- }
639
- if (typeof this.value !== 'undefined') {
640
- toReturn['value'] = this.value;
641
- }
642
- return toReturn;
643
- };
644
- return MetadataDataEntry;
645
- }());
646
- var DeleteConversationRequest = /** @class */ (function () {
647
- function DeleteConversationRequest(kwargs) {
648
- if (!kwargs) {
649
- return;
650
- }
651
- Object.assign(this, kwargs);
652
- }
653
- DeleteConversationRequest.fromProto = function (proto) {
654
- var m = new DeleteConversationRequest();
655
- m = Object.assign(m, proto);
656
- return m;
657
- };
658
- DeleteConversationRequest.prototype.toApiJson = function () {
659
- var toReturn = {};
660
- if (typeof this.conversationId !== 'undefined') {
661
- toReturn['conversationId'] = this.conversationId;
662
- }
663
- return toReturn;
664
- };
665
- return DeleteConversationRequest;
666
- }());
667
- var DeleteMessageRequest = /** @class */ (function () {
668
- function DeleteMessageRequest(kwargs) {
669
- if (!kwargs) {
670
- return;
671
- }
672
- Object.assign(this, kwargs);
673
- }
674
- DeleteMessageRequest.fromProto = function (proto) {
675
- var m = new DeleteMessageRequest();
676
- m = Object.assign(m, proto);
677
- return m;
678
- };
679
- DeleteMessageRequest.prototype.toApiJson = function () {
680
- var toReturn = {};
681
- if (typeof this.messageId !== 'undefined') {
682
- toReturn['messageId'] = this.messageId;
683
- }
684
- return toReturn;
685
- };
686
- return DeleteMessageRequest;
687
- }());
688
- var GetMultiConversationDetailsResponseDetailedConversation = /** @class */ (function () {
689
- function GetMultiConversationDetailsResponseDetailedConversation(kwargs) {
690
- if (!kwargs) {
691
- return;
692
- }
693
- Object.assign(this, kwargs);
694
- }
695
- GetMultiConversationDetailsResponseDetailedConversation.fromProto = function (proto) {
696
- var m = new GetMultiConversationDetailsResponseDetailedConversation();
697
- m = Object.assign(m, proto);
698
- if (proto.conversation) {
699
- m.conversation = Conversation.fromProto(proto.conversation);
700
- }
701
- if (proto.latestMessage) {
702
- m.latestMessage = Message.fromProto(proto.latestMessage);
703
- }
704
- if (proto.participants) {
705
- m.participants = proto.participants.map(Participant.fromProto);
706
- }
707
- return m;
708
- };
709
- GetMultiConversationDetailsResponseDetailedConversation.prototype.toApiJson = function () {
710
- var toReturn = {};
711
- if (typeof this.conversation !== 'undefined' && this.conversation !== null) {
712
- toReturn['conversation'] = 'toApiJson' in this.conversation ? this.conversation.toApiJson() : this.conversation;
713
- }
714
- if (typeof this.latestMessage !== 'undefined' && this.latestMessage !== null) {
715
- toReturn['latestMessage'] = 'toApiJson' in this.latestMessage ? this.latestMessage.toApiJson() : this.latestMessage;
716
- }
717
- if (typeof this.participants !== 'undefined' && this.participants !== null) {
718
- toReturn['participants'] = 'toApiJson' in this.participants ? this.participants.toApiJson() : this.participants;
719
- }
720
- return toReturn;
721
- };
722
- return GetMultiConversationDetailsResponseDetailedConversation;
723
- }());
724
- var SearchConversationsResponseDetailedConversation = /** @class */ (function () {
725
- function SearchConversationsResponseDetailedConversation(kwargs) {
726
- if (!kwargs) {
727
- return;
728
- }
729
- Object.assign(this, kwargs);
730
- }
731
- SearchConversationsResponseDetailedConversation.fromProto = function (proto) {
732
- var m = new SearchConversationsResponseDetailedConversation();
733
- m = Object.assign(m, proto);
734
- if (proto.conversation) {
735
- m.conversation = Conversation.fromProto(proto.conversation);
736
- }
737
- if (proto.latestMessage) {
738
- m.latestMessage = Message.fromProto(proto.latestMessage);
739
- }
740
- if (proto.participants) {
741
- m.participants = proto.participants.map(Participant.fromProto);
742
- }
743
- return m;
744
- };
745
- SearchConversationsResponseDetailedConversation.prototype.toApiJson = function () {
746
- var toReturn = {};
747
- if (typeof this.conversation !== 'undefined' && this.conversation !== null) {
748
- toReturn['conversation'] = 'toApiJson' in this.conversation ? this.conversation.toApiJson() : this.conversation;
749
- }
750
- if (typeof this.latestMessage !== 'undefined' && this.latestMessage !== null) {
751
- toReturn['latestMessage'] = 'toApiJson' in this.latestMessage ? this.latestMessage.toApiJson() : this.latestMessage;
752
- }
753
- if (typeof this.participants !== 'undefined' && this.participants !== null) {
754
- toReturn['participants'] = 'toApiJson' in this.participants ? this.participants.toApiJson() : this.participants;
755
- }
756
- return toReturn;
757
- };
758
- return SearchConversationsResponseDetailedConversation;
759
- }());
760
- var GetMessageRequest = /** @class */ (function () {
761
- function GetMessageRequest(kwargs) {
762
- if (!kwargs) {
763
- return;
764
- }
765
- Object.assign(this, kwargs);
766
- }
767
- GetMessageRequest.fromProto = function (proto) {
768
- var m = new GetMessageRequest();
769
- m = Object.assign(m, proto);
770
- return m;
771
- };
772
- GetMessageRequest.prototype.toApiJson = function () {
773
- var toReturn = {};
774
- if (typeof this.messageId !== 'undefined') {
775
- toReturn['messageId'] = this.messageId;
776
- }
777
- return toReturn;
778
- };
779
- return GetMessageRequest;
780
- }());
781
- var GetMultiConversationDetailsRequest = /** @class */ (function () {
782
- function GetMultiConversationDetailsRequest(kwargs) {
783
- if (!kwargs) {
784
- return;
785
- }
786
- Object.assign(this, kwargs);
787
- }
788
- GetMultiConversationDetailsRequest.fromProto = function (proto) {
789
- var m = new GetMultiConversationDetailsRequest();
790
- m = Object.assign(m, proto);
791
- return m;
792
- };
793
- GetMultiConversationDetailsRequest.prototype.toApiJson = function () {
794
- var toReturn = {};
795
- if (typeof this.conversationIds !== 'undefined') {
796
- toReturn['conversationIds'] = this.conversationIds;
797
- }
798
- return toReturn;
799
- };
800
- return GetMultiConversationDetailsRequest;
801
- }());
802
- var GetMultiConversationDetailsResponse = /** @class */ (function () {
803
- function GetMultiConversationDetailsResponse(kwargs) {
804
- if (!kwargs) {
805
- return;
806
- }
807
- Object.assign(this, kwargs);
808
- }
809
- GetMultiConversationDetailsResponse.fromProto = function (proto) {
810
- var m = new GetMultiConversationDetailsResponse();
811
- m = Object.assign(m, proto);
812
- if (proto.conversations) {
813
- m.conversations = proto.conversations.map(GetMultiConversationDetailsResponseDetailedConversation.fromProto);
814
- }
815
- return m;
816
- };
817
- GetMultiConversationDetailsResponse.prototype.toApiJson = function () {
818
- var toReturn = {};
819
- if (typeof this.conversations !== 'undefined' && this.conversations !== null) {
820
- toReturn['conversations'] = 'toApiJson' in this.conversations ? this.conversations.toApiJson() : this.conversations;
821
- }
822
- return toReturn;
823
- };
824
- return GetMultiConversationDetailsResponse;
825
- }());
826
- var GetMultiConversationMessageCountRequest = /** @class */ (function () {
827
- function GetMultiConversationMessageCountRequest(kwargs) {
828
- if (!kwargs) {
829
- return;
830
- }
831
- Object.assign(this, kwargs);
832
- }
833
- GetMultiConversationMessageCountRequest.fromProto = function (proto) {
834
- var m = new GetMultiConversationMessageCountRequest();
835
- m = Object.assign(m, proto);
836
- return m;
837
- };
838
- GetMultiConversationMessageCountRequest.prototype.toApiJson = function () {
839
- var toReturn = {};
840
- if (typeof this.conversationIds !== 'undefined') {
841
- toReturn['conversationIds'] = this.conversationIds;
842
- }
843
- return toReturn;
844
- };
845
- return GetMultiConversationMessageCountRequest;
846
- }());
847
- var GetMultiConversationMessageCountResponse = /** @class */ (function () {
848
- function GetMultiConversationMessageCountResponse(kwargs) {
849
- if (!kwargs) {
850
- return;
851
- }
852
- Object.assign(this, kwargs);
853
- }
854
- GetMultiConversationMessageCountResponse.fromProto = function (proto) {
855
- var m = new GetMultiConversationMessageCountResponse();
856
- m = Object.assign(m, proto);
857
- if (proto.messageCounts) {
858
- m.messageCounts = proto.messageCounts.map(ConversationMessageCount.fromProto);
859
- }
860
- if (proto.counts) {
861
- m.counts = Object.keys(proto.counts).reduce(function (obj, k) { obj[k] = parseInt(proto.counts[k], 10); return obj; }, {});
862
- }
863
- return m;
864
- };
865
- GetMultiConversationMessageCountResponse.prototype.toApiJson = function () {
866
- var toReturn = {};
867
- if (typeof this.messageCounts !== 'undefined' && this.messageCounts !== null) {
868
- toReturn['messageCounts'] = 'toApiJson' in this.messageCounts ? this.messageCounts.toApiJson() : this.messageCounts;
869
- }
870
- if (typeof this.counts !== 'undefined' && this.counts !== null) {
871
- toReturn['counts'] = 'toApiJson' in this.counts ? this.counts.toApiJson() : this.counts;
872
- }
873
- return toReturn;
874
- };
875
- return GetMultiConversationMessageCountResponse;
876
- }());
877
- var GetMultiMessagesRequest = /** @class */ (function () {
878
- function GetMultiMessagesRequest(kwargs) {
879
- if (!kwargs) {
880
- return;
881
- }
882
- Object.assign(this, kwargs);
883
- }
884
- GetMultiMessagesRequest.fromProto = function (proto) {
885
- var m = new GetMultiMessagesRequest();
886
- m = Object.assign(m, proto);
887
- return m;
888
- };
889
- GetMultiMessagesRequest.prototype.toApiJson = function () {
890
- var toReturn = {};
891
- if (typeof this.messageIds !== 'undefined') {
892
- toReturn['messageIds'] = this.messageIds;
893
- }
894
- return toReturn;
895
- };
896
- return GetMultiMessagesRequest;
897
- }());
898
- var GetMultiMessagesResponse = /** @class */ (function () {
899
- function GetMultiMessagesResponse(kwargs) {
900
- if (!kwargs) {
901
- return;
902
- }
903
- Object.assign(this, kwargs);
904
- }
905
- GetMultiMessagesResponse.fromProto = function (proto) {
906
- var m = new GetMultiMessagesResponse();
907
- m = Object.assign(m, proto);
908
- if (proto.messages) {
909
- m.messages = proto.messages.map(Message.fromProto);
910
- }
911
- return m;
912
- };
913
- GetMultiMessagesResponse.prototype.toApiJson = function () {
914
- var toReturn = {};
915
- if (typeof this.messages !== 'undefined' && this.messages !== null) {
916
- toReturn['messages'] = 'toApiJson' in this.messages ? this.messages.toApiJson() : this.messages;
917
- }
918
- return toReturn;
919
- };
920
- return GetMultiMessagesResponse;
921
- }());
922
- var GetMultiParticipantsRequest = /** @class */ (function () {
923
- function GetMultiParticipantsRequest(kwargs) {
924
- if (!kwargs) {
925
- return;
926
- }
927
- Object.assign(this, kwargs);
928
- }
929
- GetMultiParticipantsRequest.fromProto = function (proto) {
930
- var m = new GetMultiParticipantsRequest();
931
- m = Object.assign(m, proto);
932
- return m;
933
- };
934
- GetMultiParticipantsRequest.prototype.toApiJson = function () {
935
- var toReturn = {};
936
- if (typeof this.participantIds !== 'undefined') {
937
- toReturn['participantIds'] = this.participantIds;
938
- }
939
- return toReturn;
940
- };
941
- return GetMultiParticipantsRequest;
942
- }());
943
- var GetMultiParticipantsResponse = /** @class */ (function () {
944
- function GetMultiParticipantsResponse(kwargs) {
945
- if (!kwargs) {
946
- return;
947
- }
948
- Object.assign(this, kwargs);
949
- }
950
- GetMultiParticipantsResponse.fromProto = function (proto) {
951
- var m = new GetMultiParticipantsResponse();
952
- m = Object.assign(m, proto);
953
- if (proto.participants) {
954
- m.participants = proto.participants.map(Participant.fromProto);
955
- }
956
- return m;
957
- };
958
- GetMultiParticipantsResponse.prototype.toApiJson = function () {
959
- var toReturn = {};
960
- if (typeof this.participants !== 'undefined' && this.participants !== null) {
961
- toReturn['participants'] = 'toApiJson' in this.participants ? this.participants.toApiJson() : this.participants;
962
- }
963
- return toReturn;
964
- };
965
- return GetMultiParticipantsResponse;
966
- }());
967
- var ListMessagesRequestListMessagesFilters = /** @class */ (function () {
968
- function ListMessagesRequestListMessagesFilters(kwargs) {
969
- if (!kwargs) {
970
- return;
971
- }
972
- Object.assign(this, kwargs);
973
- }
974
- ListMessagesRequestListMessagesFilters.fromProto = function (proto) {
975
- var m = new ListMessagesRequestListMessagesFilters();
976
- m = Object.assign(m, proto);
977
- return m;
978
- };
979
- ListMessagesRequestListMessagesFilters.prototype.toApiJson = function () {
980
- var toReturn = {};
981
- if (typeof this.conversationId !== 'undefined') {
982
- toReturn['conversationId'] = this.conversationId;
983
- }
984
- return toReturn;
985
- };
986
- return ListMessagesRequestListMessagesFilters;
987
- }());
988
- var ListMessagesRequest = /** @class */ (function () {
989
- function ListMessagesRequest(kwargs) {
990
- if (!kwargs) {
991
- return;
992
- }
993
- Object.assign(this, kwargs);
994
- }
995
- ListMessagesRequest.fromProto = function (proto) {
996
- var m = new ListMessagesRequest();
997
- m = Object.assign(m, proto);
998
- if (proto.filters) {
999
- m.filters = ListMessagesRequestListMessagesFilters.fromProto(proto.filters);
1000
- }
1001
- if (proto.pagingOptions) {
1002
- m.pagingOptions = PagedRequestOptions.fromProto(proto.pagingOptions);
1003
- }
1004
- return m;
1005
- };
1006
- ListMessagesRequest.prototype.toApiJson = function () {
1007
- var toReturn = {};
1008
- if (typeof this.filters !== 'undefined' && this.filters !== null) {
1009
- toReturn['filters'] = 'toApiJson' in this.filters ? this.filters.toApiJson() : this.filters;
1010
- }
1011
- if (typeof this.pagingOptions !== 'undefined' && this.pagingOptions !== null) {
1012
- toReturn['pagingOptions'] = 'toApiJson' in this.pagingOptions ? this.pagingOptions.toApiJson() : this.pagingOptions;
1013
- }
1014
- return toReturn;
1015
- };
1016
- return ListMessagesRequest;
1017
- }());
1018
- var ListMessagesResponse = /** @class */ (function () {
1019
- function ListMessagesResponse(kwargs) {
1020
- if (!kwargs) {
1021
- return;
1022
- }
1023
- Object.assign(this, kwargs);
1024
- }
1025
- ListMessagesResponse.fromProto = function (proto) {
1026
- var m = new ListMessagesResponse();
1027
- m = Object.assign(m, proto);
1028
- if (proto.messages) {
1029
- m.messages = proto.messages.map(Message.fromProto);
1030
- }
1031
- if (proto.pagingMetadata) {
1032
- m.pagingMetadata = PagedResponseMetadata.fromProto(proto.pagingMetadata);
1033
- }
1034
- return m;
1035
- };
1036
- ListMessagesResponse.prototype.toApiJson = function () {
1037
- var toReturn = {};
1038
- if (typeof this.messages !== 'undefined' && this.messages !== null) {
1039
- toReturn['messages'] = 'toApiJson' in this.messages ? this.messages.toApiJson() : this.messages;
1040
- }
1041
- if (typeof this.pagingMetadata !== 'undefined' && this.pagingMetadata !== null) {
1042
- toReturn['pagingMetadata'] = 'toApiJson' in this.pagingMetadata ? this.pagingMetadata.toApiJson() : this.pagingMetadata;
1043
- }
1044
- return toReturn;
1045
- };
1046
- return ListMessagesResponse;
1047
- }());
1048
- var LookupConversationsRequestLookupConversationsFilters = /** @class */ (function () {
1049
- function LookupConversationsRequestLookupConversationsFilters(kwargs) {
1050
- if (!kwargs) {
1051
- return;
1052
- }
1053
- Object.assign(this, kwargs);
1054
- }
1055
- LookupConversationsRequestLookupConversationsFilters.fromProto = function (proto) {
1056
- var m = new LookupConversationsRequestLookupConversationsFilters();
1057
- m = Object.assign(m, proto);
1058
- if (proto.location) {
1059
- m.location = enumStringToValue$3(exports.PlatformLocation, proto.location);
1060
- }
1061
- if (proto.channel) {
1062
- m.channel = enumStringToValue$3(exports.ConversationChannel, proto.channel);
1063
- }
1064
- if (proto.originLocation) {
1065
- m.originLocation = enumStringToValue$3(exports.PlatformLocation, proto.originLocation);
1066
- }
1067
- return m;
1068
- };
1069
- LookupConversationsRequestLookupConversationsFilters.prototype.toApiJson = function () {
1070
- var toReturn = {};
1071
- if (typeof this.internalParticipantId !== 'undefined') {
1072
- toReturn['internalParticipantId'] = this.internalParticipantId;
1073
- }
1074
- if (typeof this.location !== 'undefined') {
1075
- toReturn['location'] = this.location;
1076
- }
1077
- if (typeof this.channel !== 'undefined') {
1078
- toReturn['channel'] = this.channel;
1079
- }
1080
- if (typeof this.accountGroupId !== 'undefined') {
1081
- toReturn['accountGroupId'] = this.accountGroupId;
1082
- }
1083
- if (typeof this.externalConversationId !== 'undefined') {
1084
- toReturn['externalConversationId'] = this.externalConversationId;
1085
- }
1086
- if (typeof this.originLocation !== 'undefined') {
1087
- toReturn['originLocation'] = this.originLocation;
1088
- }
1089
- if (typeof this.originLocationExternalId !== 'undefined') {
1090
- toReturn['originLocationExternalId'] = this.originLocationExternalId;
1091
- }
1092
- return toReturn;
1093
- };
1094
- return LookupConversationsRequestLookupConversationsFilters;
1095
- }());
1096
- var LookupConversationsRequest = /** @class */ (function () {
1097
- function LookupConversationsRequest(kwargs) {
1098
- if (!kwargs) {
1099
- return;
1100
- }
1101
- Object.assign(this, kwargs);
1102
- }
1103
- LookupConversationsRequest.fromProto = function (proto) {
1104
- var m = new LookupConversationsRequest();
1105
- m = Object.assign(m, proto);
1106
- if (proto.filters) {
1107
- m.filters = LookupConversationsRequestLookupConversationsFilters.fromProto(proto.filters);
1108
- }
1109
- if (proto.pagingOptions) {
1110
- m.pagingOptions = PagedRequestOptions.fromProto(proto.pagingOptions);
1111
- }
1112
- return m;
1113
- };
1114
- LookupConversationsRequest.prototype.toApiJson = function () {
1115
- var toReturn = {};
1116
- if (typeof this.filters !== 'undefined' && this.filters !== null) {
1117
- toReturn['filters'] = 'toApiJson' in this.filters ? this.filters.toApiJson() : this.filters;
1118
- }
1119
- if (typeof this.pagingOptions !== 'undefined' && this.pagingOptions !== null) {
1120
- toReturn['pagingOptions'] = 'toApiJson' in this.pagingOptions ? this.pagingOptions.toApiJson() : this.pagingOptions;
1121
- }
1122
- return toReturn;
1123
- };
1124
- return LookupConversationsRequest;
1125
- }());
1126
- var LookupConversationsResponse = /** @class */ (function () {
1127
- function LookupConversationsResponse(kwargs) {
1128
- if (!kwargs) {
1129
- return;
1130
- }
1131
- Object.assign(this, kwargs);
1132
- }
1133
- LookupConversationsResponse.fromProto = function (proto) {
1134
- var m = new LookupConversationsResponse();
1135
- m = Object.assign(m, proto);
1136
- if (proto.conversations) {
1137
- m.conversations = proto.conversations.map(LookupConversationsResponseConversations.fromProto);
1138
- }
1139
- if (proto.pagingMetadata) {
1140
- m.pagingMetadata = PagedResponseMetadata.fromProto(proto.pagingMetadata);
1141
- }
1142
- return m;
1143
- };
1144
- LookupConversationsResponse.prototype.toApiJson = function () {
1145
- var toReturn = {};
1146
- if (typeof this.conversations !== 'undefined' && this.conversations !== null) {
1147
- toReturn['conversations'] = 'toApiJson' in this.conversations ? this.conversations.toApiJson() : this.conversations;
1148
- }
1149
- if (typeof this.pagingMetadata !== 'undefined' && this.pagingMetadata !== null) {
1150
- toReturn['pagingMetadata'] = 'toApiJson' in this.pagingMetadata ? this.pagingMetadata.toApiJson() : this.pagingMetadata;
1151
- }
1152
- return toReturn;
1153
- };
1154
- return LookupConversationsResponse;
1155
- }());
1156
- var Metadata = /** @class */ (function () {
1157
- function Metadata(kwargs) {
1158
- if (!kwargs) {
1159
- return;
1160
- }
1161
- Object.assign(this, kwargs);
1162
- }
1163
- Metadata.fromProto = function (proto) {
1164
- var m = new Metadata();
1165
- m = Object.assign(m, proto);
1166
- if (proto.identifier) {
1167
- m.identifier = enumStringToValue$3(exports.MetadataIdentifier, proto.identifier);
1168
- }
1169
- if (proto.data) {
1170
- m.data = Object.keys(proto.data).reduce(function (obj, k) { obj[k] = proto.data[k]; return obj; }, {});
1171
- }
1172
- return m;
1173
- };
1174
- Metadata.prototype.toApiJson = function () {
1175
- var toReturn = {};
1176
- if (typeof this.identifier !== 'undefined') {
1177
- toReturn['identifier'] = this.identifier;
1178
- }
1179
- if (typeof this.data !== 'undefined' && this.data !== null) {
1180
- toReturn['data'] = 'toApiJson' in this.data ? this.data.toApiJson() : this.data;
1181
- }
1182
- return toReturn;
1183
- };
1184
- return Metadata;
1185
- }());
1186
- var ReceiveMessageRequestMetadataEntry = /** @class */ (function () {
1187
- function ReceiveMessageRequestMetadataEntry(kwargs) {
1188
- if (!kwargs) {
1189
- return;
1190
- }
1191
- Object.assign(this, kwargs);
1192
- }
1193
- ReceiveMessageRequestMetadataEntry.fromProto = function (proto) {
1194
- var m = new ReceiveMessageRequestMetadataEntry();
1195
- m = Object.assign(m, proto);
1196
- return m;
1197
- };
1198
- ReceiveMessageRequestMetadataEntry.prototype.toApiJson = function () {
1199
- var toReturn = {};
1200
- if (typeof this.key !== 'undefined') {
1201
- toReturn['key'] = this.key;
1202
- }
1203
- if (typeof this.value !== 'undefined') {
1204
- toReturn['value'] = this.value;
1205
- }
1206
- return toReturn;
1207
- };
1208
- return ReceiveMessageRequestMetadataEntry;
1209
- }());
1210
- var PagedRequestOptions = /** @class */ (function () {
1211
- function PagedRequestOptions(kwargs) {
1212
- if (!kwargs) {
1213
- return;
1214
- }
1215
- Object.assign(this, kwargs);
1216
- }
1217
- PagedRequestOptions.fromProto = function (proto) {
1218
- var m = new PagedRequestOptions();
1219
- m = Object.assign(m, proto);
1220
- return m;
1221
- };
1222
- PagedRequestOptions.prototype.toApiJson = function () {
1223
- var toReturn = {};
1224
- if (typeof this.cursor !== 'undefined') {
1225
- toReturn['cursor'] = this.cursor;
1226
- }
1227
- if (typeof this.pageSize !== 'undefined') {
1228
- toReturn['pageSize'] = this.pageSize;
1229
- }
1230
- return toReturn;
1231
- };
1232
- return PagedRequestOptions;
1233
- }());
1234
- var PagedResponseMetadata = /** @class */ (function () {
1235
- function PagedResponseMetadata(kwargs) {
1236
- if (!kwargs) {
1237
- return;
1238
- }
1239
- Object.assign(this, kwargs);
1240
- }
1241
- PagedResponseMetadata.fromProto = function (proto) {
1242
- var m = new PagedResponseMetadata();
1243
- m = Object.assign(m, proto);
1244
- return m;
1245
- };
1246
- PagedResponseMetadata.prototype.toApiJson = function () {
1247
- var toReturn = {};
1248
- if (typeof this.nextCursor !== 'undefined') {
1249
- toReturn['nextCursor'] = this.nextCursor;
1250
- }
1251
- if (typeof this.hasMore !== 'undefined') {
1252
- toReturn['hasMore'] = this.hasMore;
1253
- }
1254
- return toReturn;
1255
- };
1256
- return PagedResponseMetadata;
1257
- }());
1258
- var ReceiveMessageRequest = /** @class */ (function () {
1259
- function ReceiveMessageRequest(kwargs) {
1260
- if (!kwargs) {
1261
- return;
1262
- }
1263
- Object.assign(this, kwargs);
1264
- }
1265
- ReceiveMessageRequest.fromProto = function (proto) {
1266
- var m = new ReceiveMessageRequest();
1267
- m = Object.assign(m, proto);
1268
- if (proto.channel) {
1269
- m.channel = enumStringToValue$3(exports.ConversationChannel, proto.channel);
1270
- }
1271
- if (proto.type) {
1272
- m.type = enumStringToValue$3(exports.MessageType, proto.type);
1273
- }
1274
- if (proto.location) {
1275
- m.location = enumStringToValue$3(exports.PlatformLocation, proto.location);
1276
- }
1277
- if (proto.metadata) {
1278
- m.metadata = Object.keys(proto.metadata).reduce(function (obj, k) { obj[k] = proto.metadata[k]; return obj; }, {});
1279
- }
1280
- return m;
1281
- };
1282
- ReceiveMessageRequest.prototype.toApiJson = function () {
1283
- var toReturn = {};
1284
- if (typeof this.senderId !== 'undefined') {
1285
- toReturn['senderId'] = this.senderId;
1286
- }
1287
- if (typeof this.recipientId !== 'undefined') {
1288
- toReturn['recipientId'] = this.recipientId;
1289
- }
1290
- if (typeof this.conversationId !== 'undefined') {
1291
- toReturn['conversationId'] = this.conversationId;
1292
- }
1293
- if (typeof this.messageId !== 'undefined') {
1294
- toReturn['messageId'] = this.messageId;
1295
- }
1296
- if (typeof this.body !== 'undefined') {
1297
- toReturn['body'] = this.body;
1298
- }
1299
- if (typeof this.channel !== 'undefined') {
1300
- toReturn['channel'] = this.channel;
1301
- }
1302
- if (typeof this.type !== 'undefined') {
1303
- toReturn['type'] = this.type;
1304
- }
1305
- if (typeof this.location !== 'undefined') {
1306
- toReturn['location'] = this.location;
1307
- }
1308
- if (typeof this.partnerId !== 'undefined') {
1309
- toReturn['partnerId'] = this.partnerId;
1310
- }
1311
- if (typeof this.accountGroupId !== 'undefined') {
1312
- toReturn['accountGroupId'] = this.accountGroupId;
1313
- }
1314
- if (typeof this.metadata !== 'undefined' && this.metadata !== null) {
1315
- toReturn['metadata'] = 'toApiJson' in this.metadata ? this.metadata.toApiJson() : this.metadata;
1316
- }
1317
- if (typeof this.media !== 'undefined') {
1318
- toReturn['media'] = this.media;
1319
- }
1320
- return toReturn;
1321
- };
1322
- return ReceiveMessageRequest;
1323
- }());
1324
- var SearchConversationsRequest = /** @class */ (function () {
1325
- function SearchConversationsRequest(kwargs) {
1326
- if (!kwargs) {
1327
- return;
1328
- }
1329
- Object.assign(this, kwargs);
1330
- }
1331
- SearchConversationsRequest.fromProto = function (proto) {
1332
- var m = new SearchConversationsRequest();
1333
- m = Object.assign(m, proto);
1334
- if (proto.location) {
1335
- m.location = enumStringToValue$3(exports.PlatformLocation, proto.location);
1336
- }
1337
- if (proto.pagingOptions) {
1338
- m.pagingOptions = PagedRequestOptions.fromProto(proto.pagingOptions);
1339
- }
1340
- return m;
1341
- };
1342
- SearchConversationsRequest.prototype.toApiJson = function () {
1343
- var toReturn = {};
1344
- if (typeof this.partnerId !== 'undefined') {
1345
- toReturn['partnerId'] = this.partnerId;
1346
- }
1347
- if (typeof this.accountGroupId !== 'undefined') {
1348
- toReturn['accountGroupId'] = this.accountGroupId;
1349
- }
1350
- if (typeof this.location !== 'undefined') {
1351
- toReturn['location'] = this.location;
1352
- }
1353
- if (typeof this.searchTerm !== 'undefined') {
1354
- toReturn['searchTerm'] = this.searchTerm;
1355
- }
1356
- if (typeof this.pagingOptions !== 'undefined' && this.pagingOptions !== null) {
1357
- toReturn['pagingOptions'] = 'toApiJson' in this.pagingOptions ? this.pagingOptions.toApiJson() : this.pagingOptions;
1358
- }
1359
- return toReturn;
1360
- };
1361
- return SearchConversationsRequest;
1362
- }());
1363
- var SearchConversationsResponse = /** @class */ (function () {
1364
- function SearchConversationsResponse(kwargs) {
1365
- if (!kwargs) {
1366
- return;
1367
- }
1368
- Object.assign(this, kwargs);
1369
- }
1370
- SearchConversationsResponse.fromProto = function (proto) {
1371
- var m = new SearchConversationsResponse();
1372
- m = Object.assign(m, proto);
1373
- if (proto.conversations) {
1374
- m.conversations = proto.conversations.map(SearchConversationsResponseDetailedConversation.fromProto);
1375
- }
1376
- if (proto.pagingMetadata) {
1377
- m.pagingMetadata = PagedResponseMetadata.fromProto(proto.pagingMetadata);
1378
- }
1379
- return m;
1380
- };
1381
- SearchConversationsResponse.prototype.toApiJson = function () {
1382
- var toReturn = {};
1383
- if (typeof this.conversations !== 'undefined' && this.conversations !== null) {
1384
- toReturn['conversations'] = 'toApiJson' in this.conversations ? this.conversations.toApiJson() : this.conversations;
1385
- }
1386
- if (typeof this.pagingMetadata !== 'undefined' && this.pagingMetadata !== null) {
1387
- toReturn['pagingMetadata'] = 'toApiJson' in this.pagingMetadata ? this.pagingMetadata.toApiJson() : this.pagingMetadata;
1388
- }
1389
- return toReturn;
1390
- };
1391
- return SearchConversationsResponse;
1392
- }());
1393
- var SendMessageRequest = /** @class */ (function () {
1394
- function SendMessageRequest(kwargs) {
1395
- if (!kwargs) {
1396
- return;
1397
- }
1398
- Object.assign(this, kwargs);
1399
- }
1400
- SendMessageRequest.fromProto = function (proto) {
1401
- var m = new SendMessageRequest();
1402
- m = Object.assign(m, proto);
1403
- if (proto.sender) {
1404
- m.sender = Participant.fromProto(proto.sender);
1405
- }
1406
- if (proto.recipient) {
1407
- m.recipient = Participant.fromProto(proto.recipient);
1408
- }
1409
- if (proto.type) {
1410
- m.type = enumStringToValue$3(exports.MessageType, proto.type);
1411
- }
1412
- if (proto.metadata) {
1413
- m.metadata = proto.metadata.map(Metadata.fromProto);
1414
- }
1415
- return m;
1416
- };
1417
- SendMessageRequest.prototype.toApiJson = function () {
1418
- var toReturn = {};
1419
- if (typeof this.sender !== 'undefined' && this.sender !== null) {
1420
- toReturn['sender'] = 'toApiJson' in this.sender ? this.sender.toApiJson() : this.sender;
1421
- }
1422
- if (typeof this.recipient !== 'undefined' && this.recipient !== null) {
1423
- toReturn['recipient'] = 'toApiJson' in this.recipient ? this.recipient.toApiJson() : this.recipient;
1424
- }
1425
- if (typeof this.conversationId !== 'undefined') {
1426
- toReturn['conversationId'] = this.conversationId;
1427
- }
1428
- if (typeof this.type !== 'undefined') {
1429
- toReturn['type'] = this.type;
1430
- }
1431
- if (typeof this.body !== 'undefined') {
1432
- toReturn['body'] = this.body;
1433
- }
1434
- if (typeof this.metadata !== 'undefined' && this.metadata !== null) {
1435
- toReturn['metadata'] = 'toApiJson' in this.metadata ? this.metadata.toApiJson() : this.metadata;
1436
- }
1437
- return toReturn;
1438
- };
1439
- return SendMessageRequest;
1440
- }());
1441
- var SendMessageResponse = /** @class */ (function () {
1442
- function SendMessageResponse(kwargs) {
1443
- if (!kwargs) {
1444
- return;
1445
- }
1446
- Object.assign(this, kwargs);
1447
- }
1448
- SendMessageResponse.fromProto = function (proto) {
1449
- var m = new SendMessageResponse();
1450
- m = Object.assign(m, proto);
1451
- return m;
1452
- };
1453
- SendMessageResponse.prototype.toApiJson = function () {
1454
- var toReturn = {};
1455
- if (typeof this.workflowId !== 'undefined') {
1456
- toReturn['workflowId'] = this.workflowId;
1457
- }
1458
- return toReturn;
1459
- };
1460
- return SendMessageResponse;
1461
- }());
1462
- var UpdateMessageStatusRequest = /** @class */ (function () {
1463
- function UpdateMessageStatusRequest(kwargs) {
1464
- if (!kwargs) {
1465
- return;
1466
- }
1467
- Object.assign(this, kwargs);
1468
- }
1469
- UpdateMessageStatusRequest.fromProto = function (proto) {
1470
- var m = new UpdateMessageStatusRequest();
1471
- m = Object.assign(m, proto);
1472
- if (proto.status) {
1473
- m.status = enumStringToValue$3(exports.MessageStatus, proto.status);
1474
- }
1475
- return m;
1476
- };
1477
- UpdateMessageStatusRequest.prototype.toApiJson = function () {
1478
- var toReturn = {};
1479
- if (typeof this.messageId !== 'undefined') {
1480
- toReturn['messageId'] = this.messageId;
1481
- }
1482
- if (typeof this.participantId !== 'undefined') {
1483
- toReturn['participantId'] = this.participantId;
1484
- }
1485
- if (typeof this.status !== 'undefined') {
1486
- toReturn['status'] = this.status;
1487
- }
1488
- return toReturn;
1489
- };
1490
- return UpdateMessageStatusRequest;
1491
- }());
1492
-
1493
- // *********************************
1494
-
1495
- var HostService = /** @class */ (function () {
1496
- function HostService(environmentService) {
1497
- this.environmentService = environmentService;
1498
- }
1499
- HostService.prototype.host = function () {
1500
- if (this._host) {
1501
- return this._host;
1502
- }
1503
- switch (this.environmentService.getEnvironment()) {
1504
- case i1.Environment.LOCAL:
1505
- this._host = 'conversation-api.vendasta-local.com';
1506
- break;
1507
- case i1.Environment.TEST:
1508
- this._host = '';
1509
- break;
1510
- case i1.Environment.DEMO:
1511
- this._host = 'conversation-demo.apigateway.co';
1512
- break;
1513
- case i1.Environment.PROD:
1514
- this._host = 'conversation-prod.apigateway.co';
1515
- break;
1516
- }
1517
- return this._host;
1518
- };
1519
- HostService.prototype.httpsHost = function () {
1520
- if (this._httpsHost) {
1521
- return this._httpsHost;
1522
- }
1523
- switch (this.environmentService.getEnvironment()) {
1524
- case i1.Environment.LOCAL:
1525
- this._httpsHost = 'conversation.vendasta-local.com';
1526
- break;
1527
- case i1.Environment.TEST:
1528
- this._httpsHost = '';
1529
- break;
1530
- case i1.Environment.DEMO:
1531
- this._httpsHost = 'conversation-demo.apigateway.co';
1532
- break;
1533
- case i1.Environment.PROD:
1534
- this._httpsHost = 'conversation-prod.apigateway.co';
1535
- break;
1536
- }
1537
- return this._httpsHost;
1538
- };
1539
- HostService.prototype.hostWithScheme = function () {
1540
- var scheme = this.environmentService.getEnvironment() === i1.Environment.LOCAL ? 'http://' : 'https://';
1541
- return scheme + this.host();
1542
- };
1543
- HostService.prototype.httpsHostWithScheme = function () {
1544
- var scheme = this.environmentService.getEnvironment() === i1.Environment.LOCAL ? 'http://' : 'https://';
1545
- return scheme + this.httpsHost();
1546
- };
1547
- return HostService;
1548
- }());
1549
- HostService.ɵprov = i0.ɵɵdefineInjectable({ factory: function HostService_Factory() { return new HostService(i0.ɵɵinject(i1.EnvironmentService)); }, token: HostService, providedIn: "root" });
1550
- HostService.decorators = [
1551
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
1552
- ];
1553
- HostService.ctorParameters = function () { return [
1554
- { type: i1.EnvironmentService }
1555
- ]; };
1556
-
1557
- // *********************************
1558
- var ConversationApiService = /** @class */ (function () {
1559
- function ConversationApiService(http, hostService) {
1560
- this.http = http;
1561
- this.hostService = hostService;
1562
- }
1563
- ConversationApiService.prototype.apiOptions = function () {
1564
- return {
1565
- headers: new i1$1.HttpHeaders({
1566
- 'Content-Type': 'application/json'
1567
- }),
1568
- withCredentials: true
1569
- };
1570
- };
1571
- ConversationApiService.prototype.sendMessage = function (r) {
1572
- var request = (r.toApiJson) ? r : new SendMessageRequest(r);
1573
- return this.http.post(this.hostService.hostWithScheme() + "/conversation.v1.ConversationService/SendMessage", request.toApiJson(), this.apiOptions())
1574
- .pipe(operators.map(function (resp) { return SendMessageResponse.fromProto(resp); }), operators.share());
1575
- };
1576
- ConversationApiService.prototype.getMessage = function (r) {
1577
- var request = (r.toApiJson) ? r : new GetMessageRequest(r);
1578
- return this.http.post(this.hostService.hostWithScheme() + "/conversation.v1.ConversationService/GetMessage", request.toApiJson(), this.apiOptions())
1579
- .pipe(operators.map(function (resp) { return Message.fromProto(resp); }), operators.share());
1580
- };
1581
- ConversationApiService.prototype.listMessages = function (r) {
1582
- var request = (r.toApiJson) ? r : new ListMessagesRequest(r);
1583
- return this.http.post(this.hostService.hostWithScheme() + "/conversation.v1.ConversationService/ListMessages", request.toApiJson(), this.apiOptions())
1584
- .pipe(operators.map(function (resp) { return ListMessagesResponse.fromProto(resp); }), operators.share());
1585
- };
1586
- ConversationApiService.prototype.deleteMessage = function (r) {
1587
- var request = (r.toApiJson) ? r : new DeleteMessageRequest(r);
1588
- return this.http.post(this.hostService.hostWithScheme() + "/conversation.v1.ConversationService/DeleteMessage", request.toApiJson(), Object.assign(Object.assign({}, this.apiOptions()), { observe: 'response' }));
1589
- };
1590
- ConversationApiService.prototype.updateMessageStatus = function (r) {
1591
- var request = (r.toApiJson) ? r : new UpdateMessageStatusRequest(r);
1592
- return this.http.post(this.hostService.hostWithScheme() + "/conversation.v1.ConversationService/UpdateMessageStatus", request.toApiJson(), Object.assign(Object.assign({}, this.apiOptions()), { observe: 'response' }));
1593
- };
1594
- ConversationApiService.prototype.lookupConversations = function (r) {
1595
- var request = (r.toApiJson) ? r : new LookupConversationsRequest(r);
1596
- return this.http.post(this.hostService.hostWithScheme() + "/conversation.v1.ConversationService/LookupConversations", request.toApiJson(), this.apiOptions())
1597
- .pipe(operators.map(function (resp) { return LookupConversationsResponse.fromProto(resp); }), operators.share());
1598
- };
1599
- ConversationApiService.prototype.createConversation = function (r) {
1600
- var request = (r.toApiJson) ? r : new CreateConversationRequest(r);
1601
- return this.http.post(this.hostService.hostWithScheme() + "/conversation.v1.ConversationService/CreateConversation", request.toApiJson(), this.apiOptions())
1602
- .pipe(operators.map(function (resp) { return CreateConversationResponse.fromProto(resp); }), operators.share());
1603
- };
1604
- ConversationApiService.prototype.deleteConversation = function (r) {
1605
- var request = (r.toApiJson) ? r : new DeleteConversationRequest(r);
1606
- return this.http.post(this.hostService.hostWithScheme() + "/conversation.v1.ConversationService/DeleteConversation", request.toApiJson(), Object.assign(Object.assign({}, this.apiOptions()), { observe: 'response' }));
1607
- };
1608
- ConversationApiService.prototype.receiveMessage = function (r) {
1609
- var request = (r.toApiJson) ? r : new ReceiveMessageRequest(r);
1610
- return this.http.post(this.hostService.hostWithScheme() + "/conversation.v1.ConversationService/ReceiveMessage", request.toApiJson(), Object.assign(Object.assign({}, this.apiOptions()), { observe: 'response' }));
1611
- };
1612
- ConversationApiService.prototype.getMultiMessages = function (r) {
1613
- var request = (r.toApiJson) ? r : new GetMultiMessagesRequest(r);
1614
- return this.http.post(this.hostService.hostWithScheme() + "/conversation.v1.ConversationService/GetMultiMessages", request.toApiJson(), this.apiOptions())
1615
- .pipe(operators.map(function (resp) { return GetMultiMessagesResponse.fromProto(resp); }), operators.share());
1616
- };
1617
- ConversationApiService.prototype.createMultiMessages = function (r) {
1618
- var request = (r.toApiJson) ? r : new CreateMultiMessagesRequest(r);
1619
- return this.http.post(this.hostService.hostWithScheme() + "/conversation.v1.ConversationService/CreateMultiMessages", request.toApiJson(), Object.assign(Object.assign({}, this.apiOptions()), { observe: 'response' }));
1620
- };
1621
- ConversationApiService.prototype.getMultiConversationDetails = function (r) {
1622
- var request = (r.toApiJson) ? r : new GetMultiConversationDetailsRequest(r);
1623
- return this.http.post(this.hostService.hostWithScheme() + "/conversation.v1.ConversationService/GetMultiConversationDetails", request.toApiJson(), this.apiOptions())
1624
- .pipe(operators.map(function (resp) { return GetMultiConversationDetailsResponse.fromProto(resp); }), operators.share());
1625
- };
1626
- ConversationApiService.prototype.getMultiParticipants = function (r) {
1627
- var request = (r.toApiJson) ? r : new GetMultiParticipantsRequest(r);
1628
- return this.http.post(this.hostService.hostWithScheme() + "/conversation.v1.ConversationService/GetMultiParticipants", request.toApiJson(), this.apiOptions())
1629
- .pipe(operators.map(function (resp) { return GetMultiParticipantsResponse.fromProto(resp); }), operators.share());
1630
- };
1631
- ConversationApiService.prototype.searchConversations = function (r) {
1632
- var request = (r.toApiJson) ? r : new SearchConversationsRequest(r);
1633
- return this.http.post(this.hostService.hostWithScheme() + "/conversation.v1.ConversationService/SearchConversations", request.toApiJson(), this.apiOptions())
1634
- .pipe(operators.map(function (resp) { return SearchConversationsResponse.fromProto(resp); }), operators.share());
1635
- };
1636
- ConversationApiService.prototype.getMultiConversationMessageCount = function (r) {
1637
- var request = (r.toApiJson) ? r : new GetMultiConversationMessageCountRequest(r);
1638
- return this.http.post(this.hostService.hostWithScheme() + "/conversation.v1.ConversationService/GetMultiConversationMessageCount", request.toApiJson(), this.apiOptions())
1639
- .pipe(operators.map(function (resp) { return GetMultiConversationMessageCountResponse.fromProto(resp); }), operators.share());
1640
- };
1641
- ConversationApiService.prototype.addMultiParticipants = function (r) {
1642
- var request = (r.toApiJson) ? r : new AddMultiParticipantsRequest(r);
1643
- return this.http.post(this.hostService.hostWithScheme() + "/conversation.v1.ConversationService/AddMultiParticipants", request.toApiJson(), this.apiOptions())
1644
- .pipe(operators.map(function (resp) { return AddMultiParticipantsResponse.fromProto(resp); }), operators.share());
1645
- };
1646
- return ConversationApiService;
1647
- }());
1648
- ConversationApiService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ConversationApiService_Factory() { return new ConversationApiService(i0.ɵɵinject(i1$1.HttpClient), i0.ɵɵinject(HostService)); }, token: ConversationApiService, providedIn: "root" });
1649
- ConversationApiService.decorators = [
1650
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
1651
- ];
1652
- ConversationApiService.ctorParameters = function () { return [
1653
- { type: i1$1.HttpClient },
1654
- { type: HostService }
1655
- ]; };
1656
-
1657
- // *********************************
1658
-
1659
- /**
1660
- * Generated bundle index. Do not edit.
1661
- */
1662
-
1663
- exports.AddMultiParticipantsRequest = AddMultiParticipantsRequest;
1664
- exports.AddMultiParticipantsResponse = AddMultiParticipantsResponse;
1665
- exports.Address = Address;
1666
- exports.Conversation = Conversation;
1667
- exports.ConversationApiService = ConversationApiService;
1668
- exports.ConversationMessageCount = ConversationMessageCount;
1669
- exports.CreateConversationRequest = CreateConversationRequest;
1670
- exports.CreateConversationResponse = CreateConversationResponse;
1671
- exports.CreateMultiMessagesRequest = CreateMultiMessagesRequest;
1672
- exports.DeleteConversationRequest = DeleteConversationRequest;
1673
- exports.DeleteMessageRequest = DeleteMessageRequest;
1674
- exports.GetMessageRequest = GetMessageRequest;
1675
- exports.GetMultiConversationDetailsRequest = GetMultiConversationDetailsRequest;
1676
- exports.GetMultiConversationDetailsResponse = GetMultiConversationDetailsResponse;
1677
- exports.GetMultiConversationDetailsResponseDetailedConversation = GetMultiConversationDetailsResponseDetailedConversation;
1678
- exports.GetMultiConversationMessageCountRequest = GetMultiConversationMessageCountRequest;
1679
- exports.GetMultiConversationMessageCountResponse = GetMultiConversationMessageCountResponse;
1680
- exports.GetMultiConversationMessageCountResponseCountsEntry = GetMultiConversationMessageCountResponseCountsEntry;
1681
- exports.GetMultiMessagesRequest = GetMultiMessagesRequest;
1682
- exports.GetMultiMessagesResponse = GetMultiMessagesResponse;
1683
- exports.GetMultiParticipantsRequest = GetMultiParticipantsRequest;
1684
- exports.GetMultiParticipantsResponse = GetMultiParticipantsResponse;
1685
- exports.ListMessagesRequest = ListMessagesRequest;
1686
- exports.ListMessagesRequestListMessagesFilters = ListMessagesRequestListMessagesFilters;
1687
- exports.ListMessagesResponse = ListMessagesResponse;
1688
- exports.LookupConversationsRequest = LookupConversationsRequest;
1689
- exports.LookupConversationsRequestLookupConversationsFilters = LookupConversationsRequestLookupConversationsFilters;
1690
- exports.LookupConversationsResponse = LookupConversationsResponse;
1691
- exports.LookupConversationsResponseConversations = LookupConversationsResponseConversations;
1692
- exports.Message = Message;
1693
- exports.Metadata = Metadata;
1694
- exports.MetadataDataEntry = MetadataDataEntry;
1695
- exports.PagedRequestOptions = PagedRequestOptions;
1696
- exports.PagedResponseMetadata = PagedResponseMetadata;
1697
- exports.Participant = Participant;
1698
- exports.ParticipantMessageStatus = ParticipantMessageStatus;
1699
- exports.ReceiveMessageRequest = ReceiveMessageRequest;
1700
- exports.ReceiveMessageRequestMetadataEntry = ReceiveMessageRequestMetadataEntry;
1701
- exports.SearchConversationsRequest = SearchConversationsRequest;
1702
- exports.SearchConversationsResponse = SearchConversationsResponse;
1703
- exports.SearchConversationsResponseDetailedConversation = SearchConversationsResponseDetailedConversation;
1704
- exports.SendMessageRequest = SendMessageRequest;
1705
- exports.SendMessageResponse = SendMessageResponse;
1706
- exports.UpdateMessageStatusRequest = UpdateMessageStatusRequest;
1707
- exports.ɵa = HostService;
1708
-
1709
- Object.defineProperty(exports, '__esModule', { value: true });
1710
-
1711
- })));
1712
- //# sourceMappingURL=vendasta-conversation.umd.js.map