@vendasta/conversation 0.24.0 → 0.25.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.
@@ -26,6 +26,25 @@ var MessageType;
26
26
  MessageType[MessageType["MESSAGE_TYPE_SYSTEM"] = 2] = "MESSAGE_TYPE_SYSTEM";
27
27
  })(MessageType || (MessageType = {}));
28
28
 
29
+ // *********************************
30
+ // Code generated by sdkgen
31
+ // DO NOT EDIT!.
32
+ //
33
+ // Enums.
34
+ // *********************************
35
+ var GlobalParticipantType;
36
+ (function (GlobalParticipantType) {
37
+ GlobalParticipantType[GlobalParticipantType["GLOBAL_PARTICIPANT_TYPE_UNDEFINED"] = 0] = "GLOBAL_PARTICIPANT_TYPE_UNDEFINED";
38
+ GlobalParticipantType[GlobalParticipantType["GLOBAL_PARTICIPANT_TYPE_CUSTOMER"] = 1] = "GLOBAL_PARTICIPANT_TYPE_CUSTOMER";
39
+ GlobalParticipantType[GlobalParticipantType["GLOBAL_PARTICIPANT_TYPE_IAM_USER"] = 2] = "GLOBAL_PARTICIPANT_TYPE_IAM_USER";
40
+ GlobalParticipantType[GlobalParticipantType["GLOBAL_PARTICIPANT_TYPE_ACCOUNT_GROUP"] = 3] = "GLOBAL_PARTICIPANT_TYPE_ACCOUNT_GROUP";
41
+ GlobalParticipantType[GlobalParticipantType["GLOBAL_PARTICIPANT_TYPE_PARTNER"] = 4] = "GLOBAL_PARTICIPANT_TYPE_PARTNER";
42
+ GlobalParticipantType[GlobalParticipantType["GLOBAL_PARTICIPANT_TYPE_IAM_TEMPORARY_SUBJECT"] = 5] = "GLOBAL_PARTICIPANT_TYPE_IAM_TEMPORARY_SUBJECT";
43
+ GlobalParticipantType[GlobalParticipantType["GLOBAL_PARTICIPANT_TYPE_DIGITAL_AGENT"] = 6] = "GLOBAL_PARTICIPANT_TYPE_DIGITAL_AGENT";
44
+ GlobalParticipantType[GlobalParticipantType["GLOBAL_PARTICIPANT_TYPE_VENDOR"] = 7] = "GLOBAL_PARTICIPANT_TYPE_VENDOR";
45
+ GlobalParticipantType[GlobalParticipantType["GLOBAL_PARTICIPANT_TYPE_OPENAI_BOT"] = 8] = "GLOBAL_PARTICIPANT_TYPE_OPENAI_BOT";
46
+ })(GlobalParticipantType || (GlobalParticipantType = {}));
47
+
29
48
  // *********************************
30
49
  // Code generated by sdkgen
31
50
  // DO NOT EDIT!.
@@ -58,18 +77,6 @@ var PlatformLocation;
58
77
  //
59
78
  // Enums.
60
79
  // *********************************
61
- var GlobalParticipantType;
62
- (function (GlobalParticipantType) {
63
- GlobalParticipantType[GlobalParticipantType["GLOBAL_PARTICIPANT_TYPE_UNDEFINED"] = 0] = "GLOBAL_PARTICIPANT_TYPE_UNDEFINED";
64
- GlobalParticipantType[GlobalParticipantType["GLOBAL_PARTICIPANT_TYPE_CUSTOMER"] = 1] = "GLOBAL_PARTICIPANT_TYPE_CUSTOMER";
65
- GlobalParticipantType[GlobalParticipantType["GLOBAL_PARTICIPANT_TYPE_IAM_USER"] = 2] = "GLOBAL_PARTICIPANT_TYPE_IAM_USER";
66
- GlobalParticipantType[GlobalParticipantType["GLOBAL_PARTICIPANT_TYPE_ACCOUNT_GROUP"] = 3] = "GLOBAL_PARTICIPANT_TYPE_ACCOUNT_GROUP";
67
- GlobalParticipantType[GlobalParticipantType["GLOBAL_PARTICIPANT_TYPE_PARTNER"] = 4] = "GLOBAL_PARTICIPANT_TYPE_PARTNER";
68
- GlobalParticipantType[GlobalParticipantType["GLOBAL_PARTICIPANT_TYPE_IAM_TEMPORARY_SUBJECT"] = 5] = "GLOBAL_PARTICIPANT_TYPE_IAM_TEMPORARY_SUBJECT";
69
- GlobalParticipantType[GlobalParticipantType["GLOBAL_PARTICIPANT_TYPE_DIGITAL_AGENT"] = 6] = "GLOBAL_PARTICIPANT_TYPE_DIGITAL_AGENT";
70
- GlobalParticipantType[GlobalParticipantType["GLOBAL_PARTICIPANT_TYPE_VENDOR"] = 7] = "GLOBAL_PARTICIPANT_TYPE_VENDOR";
71
- GlobalParticipantType[GlobalParticipantType["GLOBAL_PARTICIPANT_TYPE_OPENAI_BOT"] = 8] = "GLOBAL_PARTICIPANT_TYPE_OPENAI_BOT";
72
- })(GlobalParticipantType || (GlobalParticipantType = {}));
73
80
  var ParticipantType;
74
81
  (function (ParticipantType) {
75
82
  ParticipantType[ParticipantType["PARTICIPANT_TYPE_UNDEFINED"] = 0] = "PARTICIPANT_TYPE_UNDEFINED";
@@ -285,6 +292,38 @@ class Conversation {
285
292
  return toReturn;
286
293
  }
287
294
  }
295
+ class ConversationKey {
296
+ constructor(kwargs) {
297
+ if (!kwargs) {
298
+ return;
299
+ }
300
+ Object.assign(this, kwargs);
301
+ }
302
+ static fromProto(proto) {
303
+ let m = new ConversationKey();
304
+ m = Object.assign(m, proto);
305
+ if (proto.subjectParticipants) {
306
+ m.subjectParticipants = proto.subjectParticipants.map(SubjectParticipant.fromProto);
307
+ }
308
+ if (proto.channel) {
309
+ m.channel = enumStringToValue$3(ConversationChannel, proto.channel);
310
+ }
311
+ return m;
312
+ }
313
+ toApiJson() {
314
+ const toReturn = {};
315
+ if (typeof this.subjectParticipants !== 'undefined' && this.subjectParticipants !== null) {
316
+ toReturn['subjectParticipants'] = 'toApiJson' in this.subjectParticipants ? this.subjectParticipants.toApiJson() : this.subjectParticipants;
317
+ }
318
+ if (typeof this.channel !== 'undefined') {
319
+ toReturn['channel'] = this.channel;
320
+ }
321
+ if (typeof this.originLocationExternalId !== 'undefined') {
322
+ toReturn['originLocationExternalId'] = this.originLocationExternalId;
323
+ }
324
+ return toReturn;
325
+ }
326
+ }
288
327
  class LastSeenByParticipant {
289
328
  constructor(kwargs) {
290
329
  if (!kwargs) {
@@ -311,6 +350,32 @@ class LastSeenByParticipant {
311
350
  return toReturn;
312
351
  }
313
352
  }
353
+ class SubjectParticipant {
354
+ constructor(kwargs) {
355
+ if (!kwargs) {
356
+ return;
357
+ }
358
+ Object.assign(this, kwargs);
359
+ }
360
+ static fromProto(proto) {
361
+ let m = new SubjectParticipant();
362
+ m = Object.assign(m, proto);
363
+ if (proto.participantType) {
364
+ m.participantType = enumStringToValue$3(GlobalParticipantType, proto.participantType);
365
+ }
366
+ return m;
367
+ }
368
+ toApiJson() {
369
+ const toReturn = {};
370
+ if (typeof this.participantType !== 'undefined') {
371
+ toReturn['participantType'] = this.participantType;
372
+ }
373
+ if (typeof this.internalParticipantId !== 'undefined') {
374
+ toReturn['internalParticipantId'] = this.internalParticipantId;
375
+ }
376
+ return toReturn;
377
+ }
378
+ }
314
379
 
315
380
  function enumStringToValue$2(enumRef, value) {
316
381
  if (typeof value === 'number') {
@@ -900,6 +965,52 @@ class GetMultiConversationDetailsResponseDetailedConversation {
900
965
  return toReturn;
901
966
  }
902
967
  }
968
+ class GetConversationByKeyRequest {
969
+ constructor(kwargs) {
970
+ if (!kwargs) {
971
+ return;
972
+ }
973
+ Object.assign(this, kwargs);
974
+ }
975
+ static fromProto(proto) {
976
+ let m = new GetConversationByKeyRequest();
977
+ m = Object.assign(m, proto);
978
+ if (proto.conversationKey) {
979
+ m.conversationKey = ConversationKey.fromProto(proto.conversationKey);
980
+ }
981
+ return m;
982
+ }
983
+ toApiJson() {
984
+ const toReturn = {};
985
+ if (typeof this.conversationKey !== 'undefined' && this.conversationKey !== null) {
986
+ toReturn['conversationKey'] = 'toApiJson' in this.conversationKey ? this.conversationKey.toApiJson() : this.conversationKey;
987
+ }
988
+ return toReturn;
989
+ }
990
+ }
991
+ class GetConversationByKeyResponse {
992
+ constructor(kwargs) {
993
+ if (!kwargs) {
994
+ return;
995
+ }
996
+ Object.assign(this, kwargs);
997
+ }
998
+ static fromProto(proto) {
999
+ let m = new GetConversationByKeyResponse();
1000
+ m = Object.assign(m, proto);
1001
+ if (proto.conversation) {
1002
+ m.conversation = Conversation.fromProto(proto.conversation);
1003
+ }
1004
+ return m;
1005
+ }
1006
+ toApiJson() {
1007
+ const toReturn = {};
1008
+ if (typeof this.conversation !== 'undefined' && this.conversation !== null) {
1009
+ toReturn['conversation'] = 'toApiJson' in this.conversation ? this.conversation.toApiJson() : this.conversation;
1010
+ }
1011
+ return toReturn;
1012
+ }
1013
+ }
903
1014
  class GetMessageRequest {
904
1015
  constructor(kwargs) {
905
1016
  if (!kwargs) {
@@ -1789,6 +1900,11 @@ class ConversationApiService {
1789
1900
  return this.http.post(this._host + "/conversation.v1.ConversationService/LookupConversations", request.toApiJson(), this.apiOptions())
1790
1901
  .pipe(map(resp => LookupConversationsResponse.fromProto(resp)));
1791
1902
  }
1903
+ getConversationByKey(r) {
1904
+ const request = (r.toApiJson) ? r : new GetConversationByKeyRequest(r);
1905
+ return this.http.post(this._host + "/conversation.v1.ConversationService/GetConversationByKey", request.toApiJson(), this.apiOptions())
1906
+ .pipe(map(resp => GetConversationByKeyResponse.fromProto(resp)));
1907
+ }
1792
1908
  createConversation(r) {
1793
1909
  const request = (r.toApiJson) ? r : new CreateConversationRequest(r);
1794
1910
  return this.http.post(this._host + "/conversation.v1.ConversationService/CreateConversation", request.toApiJson(), this.apiOptions())
@@ -1860,5 +1976,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImpor
1860
1976
  * Generated bundle index. Do not edit.
1861
1977
  */
1862
1978
 
1863
- export { Access, AddMultiParticipantsRequest, AddMultiParticipantsResponse, Address, Conversation, ConversationApiService, ConversationChannel, ConversationMessageCount, CreateConversationRequest, CreateConversationResponse, CreateMultiMessagesRequest, DeleteConversationRequest, DeleteMessageRequest, GetMessageRequest, GetMultiConversationDetailsRequest, GetMultiConversationDetailsResponse, GetMultiConversationDetailsResponseDetailedConversation, GetMultiConversationMessageCountRequest, GetMultiConversationMessageCountResponse, GetMultiConversationMessageCountResponseCountsEntry, GetMultiMessagesRequest, GetMultiMessagesResponse, GetMultiParticipantsRequest, GetMultiParticipantsResponse, GetParticipantsByKeyRequest, GetParticipantsByKeyResponse, GlobalParticipantType, LastSeenByParticipant, ListMessagesRequest, ListMessagesRequestListMessagesFilters, ListMessagesResponse, LookupConversationsRequest, LookupConversationsRequestLookupConversationsFilters, LookupConversationsResponse, LookupConversationsResponseConversations, Message, MessageStatus, MessageType, Metadata, MetadataDataEntry, MetadataIdentifier, PagedRequestOptions, PagedResponseMetadata, Participant, ParticipantKey, ParticipantMessageStatus, ParticipantType, PlatformLocation, ReceiveMessageRequest, ReceiveMessageRequestMetadataEntry, SearchConversationsRequest, SearchConversationsResponse, SearchConversationsResponseDetailedConversation, SendMessageRequest, SendMessageResponse, SetLastSeenRequest, SetLastSeenRequestStatus, SetLastSeenResponse, UpdateMessageStatusRequest };
1979
+ export { Access, AddMultiParticipantsRequest, AddMultiParticipantsResponse, Address, Conversation, ConversationApiService, ConversationChannel, ConversationKey, ConversationMessageCount, CreateConversationRequest, CreateConversationResponse, CreateMultiMessagesRequest, DeleteConversationRequest, DeleteMessageRequest, GetConversationByKeyRequest, GetConversationByKeyResponse, GetMessageRequest, GetMultiConversationDetailsRequest, GetMultiConversationDetailsResponse, GetMultiConversationDetailsResponseDetailedConversation, GetMultiConversationMessageCountRequest, GetMultiConversationMessageCountResponse, GetMultiConversationMessageCountResponseCountsEntry, GetMultiMessagesRequest, GetMultiMessagesResponse, GetMultiParticipantsRequest, GetMultiParticipantsResponse, GetParticipantsByKeyRequest, GetParticipantsByKeyResponse, GlobalParticipantType, LastSeenByParticipant, ListMessagesRequest, ListMessagesRequestListMessagesFilters, ListMessagesResponse, LookupConversationsRequest, LookupConversationsRequestLookupConversationsFilters, LookupConversationsResponse, LookupConversationsResponseConversations, Message, MessageStatus, MessageType, Metadata, MetadataDataEntry, MetadataIdentifier, PagedRequestOptions, PagedResponseMetadata, Participant, ParticipantKey, ParticipantMessageStatus, ParticipantType, PlatformLocation, ReceiveMessageRequest, ReceiveMessageRequestMetadataEntry, SearchConversationsRequest, SearchConversationsResponse, SearchConversationsResponseDetailedConversation, SendMessageRequest, SendMessageResponse, SetLastSeenRequest, SetLastSeenRequestStatus, SetLastSeenResponse, SubjectParticipant, UpdateMessageStatusRequest };
1864
1980
  //# sourceMappingURL=vendasta-conversation.mjs.map