@vendasta/conversation 0.47.0 → 0.48.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.
@@ -152,7 +152,7 @@ var SetLastSeenRequestStatus;
152
152
  // Enums Index.
153
153
  // *********************************
154
154
 
155
- function enumStringToValue$9(enumRef, value) {
155
+ function enumStringToValue$a(enumRef, value) {
156
156
  if (typeof value === 'number') {
157
157
  return value;
158
158
  }
@@ -163,7 +163,7 @@ class SubjectParticipant {
163
163
  let m = new SubjectParticipant();
164
164
  m = Object.assign(m, proto);
165
165
  if (proto.participantType) {
166
- m.participantType = enumStringToValue$9(GlobalParticipantType, proto.participantType);
166
+ m.participantType = enumStringToValue$a(GlobalParticipantType, proto.participantType);
167
167
  }
168
168
  return m;
169
169
  }
@@ -185,7 +185,7 @@ class SubjectParticipant {
185
185
  }
186
186
  }
187
187
 
188
- function enumStringToValue$8(enumRef, value) {
188
+ function enumStringToValue$9(enumRef, value) {
189
189
  if (typeof value === 'number') {
190
190
  return value;
191
191
  }
@@ -196,7 +196,7 @@ class Conversation {
196
196
  let m = new Conversation();
197
197
  m = Object.assign(m, proto);
198
198
  if (proto.channel) {
199
- m.channel = enumStringToValue$8(ConversationChannel, proto.channel);
199
+ m.channel = enumStringToValue$9(ConversationChannel, proto.channel);
200
200
  }
201
201
  if (proto.created) {
202
202
  m.created = new Date(proto.created);
@@ -211,7 +211,7 @@ class Conversation {
211
211
  m.latestMsgSentTime = new Date(proto.latestMsgSentTime);
212
212
  }
213
213
  if (proto.originLocation) {
214
- m.originLocation = enumStringToValue$8(PlatformLocation, proto.originLocation);
214
+ m.originLocation = enumStringToValue$9(PlatformLocation, proto.originLocation);
215
215
  }
216
216
  if (proto.lastSeenByParticipant) {
217
217
  m.lastSeenByParticipant = proto.lastSeenByParticipant.map(LastSeenByParticipant.fromProto);
@@ -282,7 +282,7 @@ class ConversationKey {
282
282
  m.subjectParticipants = proto.subjectParticipants.map(SubjectParticipant.fromProto);
283
283
  }
284
284
  if (proto.channel) {
285
- m.channel = enumStringToValue$8(ConversationChannel, proto.channel);
285
+ m.channel = enumStringToValue$9(ConversationChannel, proto.channel);
286
286
  }
287
287
  return m;
288
288
  }
@@ -333,7 +333,7 @@ class LastSeenByParticipant {
333
333
  }
334
334
  }
335
335
 
336
- function enumStringToValue$7(enumRef, value) {
336
+ function enumStringToValue$8(enumRef, value) {
337
337
  if (typeof value === 'number') {
338
338
  return value;
339
339
  }
@@ -344,7 +344,7 @@ class Message {
344
344
  let m = new Message();
345
345
  m = Object.assign(m, proto);
346
346
  if (proto.type) {
347
- m.type = enumStringToValue$7(MessageType, proto.type);
347
+ m.type = enumStringToValue$8(MessageType, proto.type);
348
348
  }
349
349
  if (proto.created) {
350
350
  m.created = new Date(proto.created);
@@ -359,7 +359,7 @@ class Message {
359
359
  m.sendStatus = SendStatus.fromProto(proto.sendStatus);
360
360
  }
361
361
  if (proto.channel) {
362
- m.channel = enumStringToValue$7(ConversationChannel, proto.channel);
362
+ m.channel = enumStringToValue$8(ConversationChannel, proto.channel);
363
363
  }
364
364
  return m;
365
365
  }
@@ -418,7 +418,7 @@ class ParticipantMessageStatus {
418
418
  let m = new ParticipantMessageStatus();
419
419
  m = Object.assign(m, proto);
420
420
  if (proto.status) {
421
- m.status = enumStringToValue$7(MessageStatus, proto.status);
421
+ m.status = enumStringToValue$8(MessageStatus, proto.status);
422
422
  }
423
423
  if (proto.updated) {
424
424
  m.updated = new Date(proto.updated);
@@ -453,7 +453,7 @@ class SendStatus {
453
453
  let m = new SendStatus();
454
454
  m = Object.assign(m, proto);
455
455
  if (proto.status) {
456
- m.status = enumStringToValue$7(MessageStatus, proto.status);
456
+ m.status = enumStringToValue$8(MessageStatus, proto.status);
457
457
  }
458
458
  if (proto.created) {
459
459
  m.created = new Date(proto.created);
@@ -481,7 +481,7 @@ class SendStatus {
481
481
  }
482
482
  }
483
483
 
484
- function enumStringToValue$6(enumRef, value) {
484
+ function enumStringToValue$7(enumRef, value) {
485
485
  if (typeof value === 'number') {
486
486
  return value;
487
487
  }
@@ -527,10 +527,10 @@ class Participant {
527
527
  let m = new Participant();
528
528
  m = Object.assign(m, proto);
529
529
  if (proto.location) {
530
- m.location = enumStringToValue$6(PlatformLocation, proto.location);
530
+ m.location = enumStringToValue$7(PlatformLocation, proto.location);
531
531
  }
532
532
  if (proto.channel) {
533
- m.channel = enumStringToValue$6(ConversationChannel, proto.channel);
533
+ m.channel = enumStringToValue$7(ConversationChannel, proto.channel);
534
534
  }
535
535
  if (proto.created) {
536
536
  m.created = new Date(proto.created);
@@ -542,7 +542,7 @@ class Participant {
542
542
  m.deleted = new Date(proto.deleted);
543
543
  }
544
544
  if (proto.participantType) {
545
- m.participantType = enumStringToValue$6(ParticipantType, proto.participantType);
545
+ m.participantType = enumStringToValue$7(ParticipantType, proto.participantType);
546
546
  }
547
547
  if (proto.address) {
548
548
  m.address = Address.fromProto(proto.address);
@@ -619,13 +619,13 @@ class ParticipantKey {
619
619
  let m = new ParticipantKey();
620
620
  m = Object.assign(m, proto);
621
621
  if (proto.location) {
622
- m.location = enumStringToValue$6(PlatformLocation, proto.location);
622
+ m.location = enumStringToValue$7(PlatformLocation, proto.location);
623
623
  }
624
624
  if (proto.channels) {
625
- m.channels = proto.channels.map((v) => enumStringToValue$6(ConversationChannel, v));
625
+ m.channels = proto.channels.map((v) => enumStringToValue$7(ConversationChannel, v));
626
626
  }
627
627
  if (proto.participantType) {
628
- m.participantType = enumStringToValue$6(GlobalParticipantType, proto.participantType);
628
+ m.participantType = enumStringToValue$7(GlobalParticipantType, proto.participantType);
629
629
  }
630
630
  return m;
631
631
  }
@@ -659,7 +659,7 @@ class ParticipantKey {
659
659
  }
660
660
  }
661
661
 
662
- function enumStringToValue$5(enumRef, value) {
662
+ function enumStringToValue$6(enumRef, value) {
663
663
  if (typeof value === 'number') {
664
664
  return value;
665
665
  }
@@ -689,7 +689,7 @@ class Access {
689
689
  }
690
690
  }
691
691
 
692
- function enumStringToValue$4(enumRef, value) {
692
+ function enumStringToValue$5(enumRef, value) {
693
693
  if (typeof value === 'number') {
694
694
  return value;
695
695
  }
@@ -749,7 +749,7 @@ class Configuration {
749
749
  }
750
750
  }
751
751
 
752
- function enumStringToValue$3(enumRef, value) {
752
+ function enumStringToValue$4(enumRef, value) {
753
753
  if (typeof value === 'number') {
754
754
  return value;
755
755
  }
@@ -782,7 +782,7 @@ class View {
782
782
  }
783
783
  }
784
784
 
785
- function enumStringToValue$2(enumRef, value) {
785
+ function enumStringToValue$3(enumRef, value) {
786
786
  if (typeof value === 'number') {
787
787
  return value;
788
788
  }
@@ -793,7 +793,7 @@ class Widget {
793
793
  let m = new Widget();
794
794
  m = Object.assign(m, proto);
795
795
  if (proto.position) {
796
- m.position = enumStringToValue$2(WidgetPosition, proto.position);
796
+ m.position = enumStringToValue$3(WidgetPosition, proto.position);
797
797
  }
798
798
  if (proto.created) {
799
799
  m.created = new Date(proto.created);
@@ -845,7 +845,7 @@ class Widget {
845
845
  }
846
846
  }
847
847
 
848
- function enumStringToValue$1(enumRef, value) {
848
+ function enumStringToValue$2(enumRef, value) {
849
849
  if (typeof value === 'number') {
850
850
  return value;
851
851
  }
@@ -872,6 +872,39 @@ class FieldMask {
872
872
  }
873
873
  }
874
874
 
875
+ function enumStringToValue$1(enumRef, value) {
876
+ if (typeof value === 'number') {
877
+ return value;
878
+ }
879
+ return enumRef[value];
880
+ }
881
+ class MessageTemplate {
882
+ static fromProto(proto) {
883
+ let m = new MessageTemplate();
884
+ m = Object.assign(m, proto);
885
+ return m;
886
+ }
887
+ constructor(kwargs) {
888
+ if (!kwargs) {
889
+ return;
890
+ }
891
+ Object.assign(this, kwargs);
892
+ }
893
+ toApiJson() {
894
+ const toReturn = {};
895
+ if (typeof this.templateId !== 'undefined') {
896
+ toReturn['templateId'] = this.templateId;
897
+ }
898
+ if (typeof this.name !== 'undefined') {
899
+ toReturn['name'] = this.name;
900
+ }
901
+ if (typeof this.content !== 'undefined') {
902
+ toReturn['content'] = this.content;
903
+ }
904
+ return toReturn;
905
+ }
906
+ }
907
+
875
908
  function enumStringToValue(enumRef, value) {
876
909
  if (typeof value === 'number') {
877
910
  return value;
@@ -1309,6 +1342,26 @@ class DeleteMessageRequest {
1309
1342
  return toReturn;
1310
1343
  }
1311
1344
  }
1345
+ class DeleteMessageTemplateRequest {
1346
+ static fromProto(proto) {
1347
+ let m = new DeleteMessageTemplateRequest();
1348
+ m = Object.assign(m, proto);
1349
+ return m;
1350
+ }
1351
+ constructor(kwargs) {
1352
+ if (!kwargs) {
1353
+ return;
1354
+ }
1355
+ Object.assign(this, kwargs);
1356
+ }
1357
+ toApiJson() {
1358
+ const toReturn = {};
1359
+ if (typeof this.templateId !== 'undefined') {
1360
+ toReturn['templateId'] = this.templateId;
1361
+ }
1362
+ return toReturn;
1363
+ }
1364
+ }
1312
1365
  class DeleteWidgetRequest {
1313
1366
  static fromProto(proto) {
1314
1367
  let m = new DeleteWidgetRequest();
@@ -2040,6 +2093,64 @@ class GetWidgetResponse {
2040
2093
  return toReturn;
2041
2094
  }
2042
2095
  }
2096
+ class ListMessageTemplateRequest {
2097
+ static fromProto(proto) {
2098
+ let m = new ListMessageTemplateRequest();
2099
+ m = Object.assign(m, proto);
2100
+ if (proto.subjectParticipant) {
2101
+ m.subjectParticipant = SubjectParticipant.fromProto(proto.subjectParticipant);
2102
+ }
2103
+ if (proto.pagingOptions) {
2104
+ m.pagingOptions = PagedRequestOptions.fromProto(proto.pagingOptions);
2105
+ }
2106
+ return m;
2107
+ }
2108
+ constructor(kwargs) {
2109
+ if (!kwargs) {
2110
+ return;
2111
+ }
2112
+ Object.assign(this, kwargs);
2113
+ }
2114
+ toApiJson() {
2115
+ const toReturn = {};
2116
+ if (typeof this.subjectParticipant !== 'undefined' && this.subjectParticipant !== null) {
2117
+ toReturn['subjectParticipant'] = 'toApiJson' in this.subjectParticipant ? this.subjectParticipant.toApiJson() : this.subjectParticipant;
2118
+ }
2119
+ if (typeof this.pagingOptions !== 'undefined' && this.pagingOptions !== null) {
2120
+ toReturn['pagingOptions'] = 'toApiJson' in this.pagingOptions ? this.pagingOptions.toApiJson() : this.pagingOptions;
2121
+ }
2122
+ return toReturn;
2123
+ }
2124
+ }
2125
+ class ListMessageTemplateResponse {
2126
+ static fromProto(proto) {
2127
+ let m = new ListMessageTemplateResponse();
2128
+ m = Object.assign(m, proto);
2129
+ if (proto.templates) {
2130
+ m.templates = proto.templates.map(MessageTemplate.fromProto);
2131
+ }
2132
+ if (proto.pagingMetadata) {
2133
+ m.pagingMetadata = PagedResponseMetadata.fromProto(proto.pagingMetadata);
2134
+ }
2135
+ return m;
2136
+ }
2137
+ constructor(kwargs) {
2138
+ if (!kwargs) {
2139
+ return;
2140
+ }
2141
+ Object.assign(this, kwargs);
2142
+ }
2143
+ toApiJson() {
2144
+ const toReturn = {};
2145
+ if (typeof this.templates !== 'undefined' && this.templates !== null) {
2146
+ toReturn['templates'] = 'toApiJson' in this.templates ? this.templates.toApiJson() : this.templates;
2147
+ }
2148
+ if (typeof this.pagingMetadata !== 'undefined' && this.pagingMetadata !== null) {
2149
+ toReturn['pagingMetadata'] = 'toApiJson' in this.pagingMetadata ? this.pagingMetadata.toApiJson() : this.pagingMetadata;
2150
+ }
2151
+ return toReturn;
2152
+ }
2153
+ }
2043
2154
  class ListMessagesRequestListMessagesFilters {
2044
2155
  static fromProto(proto) {
2045
2156
  let m = new ListMessagesRequestListMessagesFilters();
@@ -3119,6 +3230,15 @@ class ConversationApiService {
3119
3230
  return this.http.post(this._host + "/conversation.v1.ConversationService/GetWidgetConfig", request.toApiJson(), this.apiOptions())
3120
3231
  .pipe(map(resp => GetWidgetConfigResponse.fromProto(resp)));
3121
3232
  }
3233
+ listMessageTemplate(r) {
3234
+ const request = (r.toApiJson) ? r : new ListMessageTemplateRequest(r);
3235
+ return this.http.post(this._host + "/conversation.v1.ConversationService/ListMessageTemplate", request.toApiJson(), this.apiOptions())
3236
+ .pipe(map(resp => ListMessageTemplateResponse.fromProto(resp)));
3237
+ }
3238
+ deleteMessageTemplate(r) {
3239
+ const request = (r.toApiJson) ? r : new DeleteMessageTemplateRequest(r);
3240
+ return this.http.post(this._host + "/conversation.v1.ConversationService/DeleteMessageTemplate", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
3241
+ }
3122
3242
  }
3123
3243
  ConversationApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ConversationApiService, deps: [{ token: i1.HttpClient }, { token: HostService }], target: i0.ɵɵFactoryTarget.Injectable });
3124
3244
  ConversationApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ConversationApiService, providedIn: 'root' });
@@ -3181,5 +3301,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
3181
3301
  * Generated bundle index. Do not edit.
3182
3302
  */
3183
3303
 
3184
- export { Access, AddConversationToConversationViewRequest, AddMultiParticipantsRequest, AddMultiParticipantsResponse, Address, Configuration, Conversation, ConversationApiService, ConversationChannel, ConversationKey, ConversationMessageCount, CreateConversationRequest, CreateConversationResponse, CreateMultiMessagesRequest, CreateWidgetConversationRequest, CreateWidgetConversationResponse, CreateWidgetRequest, CreateWidgetResponse, DeleteConversationRequest, DeleteMessageRequest, DeleteWidgetRequest, FieldMask, GetAvailableChannelsForConversationRequest, GetAvailableChannelsForConversationResponse, GetConfigurationRequest, GetConfigurationResponse, GetConversationByKeyRequest, GetConversationByKeyResponse, GetConversationViewsRequest, GetConversationViewsResponse, GetMessageRequest, GetMultiConfigurationRequest, GetMultiConfigurationResponse, GetMultiConversationDetailsRequest, GetMultiConversationDetailsResponse, GetMultiConversationDetailsResponseDetailedConversation, GetMultiConversationMessageCountRequest, GetMultiConversationMessageCountResponse, GetMultiConversationMessageCountResponseCountsEntry, GetMultiMessagesRequest, GetMultiMessagesResponse, GetMultiParticipantsRequest, GetMultiParticipantsResponse, GetMultiWidgetMessagesRequest, GetMultiWidgetMessagesResponse, GetParticipantsByKeyRequest, GetParticipantsByKeyResponse, GetWidgetConfigRequest, GetWidgetConfigResponse, GetWidgetConversationResponse, GetWidgetRequest, GetWidgetResponse, GlobalParticipantType, InboxApiService, LastSeenByParticipant, ListMessagesRequest, ListMessagesRequestListMessagesFilters, ListMessagesResponse, ListWidgetsRequest, ListWidgetsResponse, LookupConversationsRequest, LookupConversationsRequestLookupConversationsFilters, LookupConversationsResponse, LookupConversationsResponseConversations, Media, Message, MessageStatus, MessageType, Metadata, MetadataDataEntry, MetadataIdentifier, PagedRequestOptions, PagedResponseMetadata, Participant, ParticipantKey, ParticipantMessageStatus, ParticipantType, PlatformLocation, ReceiveMessageRequest, ReceiveMessageRequestMetadataEntry, RemoveConversationFromConversationViewRequest, SearchConversationsRequest, SearchConversationsResponse, SearchConversationsResponseDetailedConversation, SendMessageRequest, SendMessageResponse, SendStatus, SendWidgetMessageRequest, SendWidgetMessageResponse, SetLastSeenRequest, SetLastSeenRequestStatus, SetLastSeenResponse, SortDirection, SubjectParticipant, UpdateMessageStatusRequest, UpdateWidgetRequest, UpdateWidgetResponse, UpsertConfigurationRequest, UpsertConfigurationResponse, View, ViewType, Widget, WidgetPosition };
3304
+ export { Access, AddConversationToConversationViewRequest, AddMultiParticipantsRequest, AddMultiParticipantsResponse, Address, Configuration, Conversation, ConversationApiService, ConversationChannel, ConversationKey, ConversationMessageCount, CreateConversationRequest, CreateConversationResponse, CreateMultiMessagesRequest, CreateWidgetConversationRequest, CreateWidgetConversationResponse, CreateWidgetRequest, CreateWidgetResponse, DeleteConversationRequest, DeleteMessageRequest, DeleteMessageTemplateRequest, DeleteWidgetRequest, FieldMask, GetAvailableChannelsForConversationRequest, GetAvailableChannelsForConversationResponse, GetConfigurationRequest, GetConfigurationResponse, GetConversationByKeyRequest, GetConversationByKeyResponse, GetConversationViewsRequest, GetConversationViewsResponse, GetMessageRequest, GetMultiConfigurationRequest, GetMultiConfigurationResponse, GetMultiConversationDetailsRequest, GetMultiConversationDetailsResponse, GetMultiConversationDetailsResponseDetailedConversation, GetMultiConversationMessageCountRequest, GetMultiConversationMessageCountResponse, GetMultiConversationMessageCountResponseCountsEntry, GetMultiMessagesRequest, GetMultiMessagesResponse, GetMultiParticipantsRequest, GetMultiParticipantsResponse, GetMultiWidgetMessagesRequest, GetMultiWidgetMessagesResponse, GetParticipantsByKeyRequest, GetParticipantsByKeyResponse, GetWidgetConfigRequest, GetWidgetConfigResponse, GetWidgetConversationResponse, GetWidgetRequest, GetWidgetResponse, GlobalParticipantType, InboxApiService, LastSeenByParticipant, ListMessageTemplateRequest, ListMessageTemplateResponse, ListMessagesRequest, ListMessagesRequestListMessagesFilters, ListMessagesResponse, ListWidgetsRequest, ListWidgetsResponse, LookupConversationsRequest, LookupConversationsRequestLookupConversationsFilters, LookupConversationsResponse, LookupConversationsResponseConversations, Media, Message, MessageStatus, MessageTemplate, MessageType, Metadata, MetadataDataEntry, MetadataIdentifier, PagedRequestOptions, PagedResponseMetadata, Participant, ParticipantKey, ParticipantMessageStatus, ParticipantType, PlatformLocation, ReceiveMessageRequest, ReceiveMessageRequestMetadataEntry, RemoveConversationFromConversationViewRequest, SearchConversationsRequest, SearchConversationsResponse, SearchConversationsResponseDetailedConversation, SendMessageRequest, SendMessageResponse, SendStatus, SendWidgetMessageRequest, SendWidgetMessageResponse, SetLastSeenRequest, SetLastSeenRequestStatus, SetLastSeenResponse, SortDirection, SubjectParticipant, UpdateMessageStatusRequest, UpdateWidgetRequest, UpdateWidgetResponse, UpsertConfigurationRequest, UpsertConfigurationResponse, View, ViewType, Widget, WidgetPosition };
3185
3305
  //# sourceMappingURL=vendasta-conversation.mjs.map