@vendasta/conversation 0.23.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.
Files changed (27) hide show
  1. package/esm2020/lib/_internal/conversation.api.service.mjs +7 -2
  2. package/esm2020/lib/_internal/enums/common.enum.mjs +19 -0
  3. package/esm2020/lib/_internal/enums/conversation.enum.mjs +2 -1
  4. package/esm2020/lib/_internal/enums/index.mjs +3 -2
  5. package/esm2020/lib/_internal/enums/participant.enum.mjs +1 -13
  6. package/esm2020/lib/_internal/interfaces/api.interface.mjs +1 -1
  7. package/esm2020/lib/_internal/interfaces/conversation.interface.mjs +1 -1
  8. package/esm2020/lib/_internal/interfaces/index.mjs +1 -1
  9. package/esm2020/lib/_internal/objects/api.mjs +48 -2
  10. package/esm2020/lib/_internal/objects/conversation.mjs +59 -1
  11. package/esm2020/lib/_internal/objects/index.mjs +3 -3
  12. package/fesm2015/vendasta-conversation.mjs +130 -13
  13. package/fesm2015/vendasta-conversation.mjs.map +1 -1
  14. package/fesm2020/vendasta-conversation.mjs +130 -13
  15. package/fesm2020/vendasta-conversation.mjs.map +1 -1
  16. package/lib/_internal/conversation.api.service.d.ts +3 -2
  17. package/lib/_internal/enums/common.enum.d.ts +11 -0
  18. package/lib/_internal/enums/conversation.enum.d.ts +2 -1
  19. package/lib/_internal/enums/index.d.ts +2 -1
  20. package/lib/_internal/enums/participant.enum.d.ts +0 -11
  21. package/lib/_internal/interfaces/api.interface.d.ts +7 -1
  22. package/lib/_internal/interfaces/conversation.interface.d.ts +9 -0
  23. package/lib/_internal/interfaces/index.d.ts +2 -2
  24. package/lib/_internal/objects/api.d.ts +13 -1
  25. package/lib/_internal/objects/conversation.d.ts +15 -0
  26. package/lib/_internal/objects/index.d.ts +2 -2
  27. package/package.json +1 -1
@@ -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!.
@@ -39,6 +58,7 @@ var ConversationChannel;
39
58
  ConversationChannel[ConversationChannel["CONVERSATION_CHANNEL_SMS"] = 2] = "CONVERSATION_CHANNEL_SMS";
40
59
  ConversationChannel[ConversationChannel["CONVERSATION_CHANNEL_FACEBOOK"] = 3] = "CONVERSATION_CHANNEL_FACEBOOK";
41
60
  ConversationChannel[ConversationChannel["CONVERSATION_CHANNEL_GOOGLE_MESSAGES"] = 4] = "CONVERSATION_CHANNEL_GOOGLE_MESSAGES";
61
+ ConversationChannel[ConversationChannel["CONVERSATION_CHANNEL_OPENAI"] = 5] = "CONVERSATION_CHANNEL_OPENAI";
42
62
  })(ConversationChannel || (ConversationChannel = {}));
43
63
  var PlatformLocation;
44
64
  (function (PlatformLocation) {
@@ -57,18 +77,6 @@ var PlatformLocation;
57
77
  //
58
78
  // Enums.
59
79
  // *********************************
60
- var GlobalParticipantType;
61
- (function (GlobalParticipantType) {
62
- GlobalParticipantType[GlobalParticipantType["GLOBAL_PARTICIPANT_TYPE_UNDEFINED"] = 0] = "GLOBAL_PARTICIPANT_TYPE_UNDEFINED";
63
- GlobalParticipantType[GlobalParticipantType["GLOBAL_PARTICIPANT_TYPE_CUSTOMER"] = 1] = "GLOBAL_PARTICIPANT_TYPE_CUSTOMER";
64
- GlobalParticipantType[GlobalParticipantType["GLOBAL_PARTICIPANT_TYPE_IAM_USER"] = 2] = "GLOBAL_PARTICIPANT_TYPE_IAM_USER";
65
- GlobalParticipantType[GlobalParticipantType["GLOBAL_PARTICIPANT_TYPE_ACCOUNT_GROUP"] = 3] = "GLOBAL_PARTICIPANT_TYPE_ACCOUNT_GROUP";
66
- GlobalParticipantType[GlobalParticipantType["GLOBAL_PARTICIPANT_TYPE_PARTNER"] = 4] = "GLOBAL_PARTICIPANT_TYPE_PARTNER";
67
- GlobalParticipantType[GlobalParticipantType["GLOBAL_PARTICIPANT_TYPE_IAM_TEMPORARY_SUBJECT"] = 5] = "GLOBAL_PARTICIPANT_TYPE_IAM_TEMPORARY_SUBJECT";
68
- GlobalParticipantType[GlobalParticipantType["GLOBAL_PARTICIPANT_TYPE_DIGITAL_AGENT"] = 6] = "GLOBAL_PARTICIPANT_TYPE_DIGITAL_AGENT";
69
- GlobalParticipantType[GlobalParticipantType["GLOBAL_PARTICIPANT_TYPE_VENDOR"] = 7] = "GLOBAL_PARTICIPANT_TYPE_VENDOR";
70
- GlobalParticipantType[GlobalParticipantType["GLOBAL_PARTICIPANT_TYPE_OPENAI_BOT"] = 8] = "GLOBAL_PARTICIPANT_TYPE_OPENAI_BOT";
71
- })(GlobalParticipantType || (GlobalParticipantType = {}));
72
80
  var ParticipantType;
73
81
  (function (ParticipantType) {
74
82
  ParticipantType[ParticipantType["PARTICIPANT_TYPE_UNDEFINED"] = 0] = "PARTICIPANT_TYPE_UNDEFINED";
@@ -284,6 +292,38 @@ class Conversation {
284
292
  return toReturn;
285
293
  }
286
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
+ }
287
327
  class LastSeenByParticipant {
288
328
  constructor(kwargs) {
289
329
  if (!kwargs) {
@@ -310,6 +350,32 @@ class LastSeenByParticipant {
310
350
  return toReturn;
311
351
  }
312
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
+ }
313
379
 
314
380
  function enumStringToValue$2(enumRef, value) {
315
381
  if (typeof value === 'number') {
@@ -899,6 +965,52 @@ class GetMultiConversationDetailsResponseDetailedConversation {
899
965
  return toReturn;
900
966
  }
901
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
+ }
902
1014
  class GetMessageRequest {
903
1015
  constructor(kwargs) {
904
1016
  if (!kwargs) {
@@ -1788,6 +1900,11 @@ class ConversationApiService {
1788
1900
  return this.http.post(this._host + "/conversation.v1.ConversationService/LookupConversations", request.toApiJson(), this.apiOptions())
1789
1901
  .pipe(map(resp => LookupConversationsResponse.fromProto(resp)));
1790
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
+ }
1791
1908
  createConversation(r) {
1792
1909
  const request = (r.toApiJson) ? r : new CreateConversationRequest(r);
1793
1910
  return this.http.post(this._host + "/conversation.v1.ConversationService/CreateConversation", request.toApiJson(), this.apiOptions())
@@ -1859,5 +1976,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImpor
1859
1976
  * Generated bundle index. Do not edit.
1860
1977
  */
1861
1978
 
1862
- 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 };
1863
1980
  //# sourceMappingURL=vendasta-conversation.mjs.map