@vendasta/conversation 0.30.0 → 0.31.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.
@@ -127,6 +127,11 @@ var SetLastSeenRequestStatus;
127
127
  SetLastSeenRequestStatus[SetLastSeenRequestStatus["SET_LAST_SEEN_REQUEST_STATUS_UNREAD"] = 1] = "SET_LAST_SEEN_REQUEST_STATUS_UNREAD";
128
128
  })(SetLastSeenRequestStatus || (SetLastSeenRequestStatus = {}));
129
129
 
130
+ // *********************************
131
+ // Code generated by sdkgen
132
+ // DO NOT EDIT!.
133
+ //
134
+ // Enums Index.
130
135
  // *********************************
131
136
 
132
137
  function enumStringToValue$7(enumRef, value) {
@@ -664,19 +669,13 @@ function enumStringToValue$1(enumRef, value) {
664
669
  }
665
670
  return enumRef[value];
666
671
  }
667
- class ConversationView {
672
+ class View {
668
673
  static fromProto(proto) {
669
- let m = new ConversationView();
674
+ let m = new View();
670
675
  m = Object.assign(m, proto);
671
- if (proto.viewType) {
672
- m.viewType = enumStringToValue$1(ViewType, proto.viewType);
673
- }
674
676
  if (proto.created) {
675
677
  m.created = new Date(proto.created);
676
678
  }
677
- if (proto.updated) {
678
- m.updated = new Date(proto.updated);
679
- }
680
679
  return m;
681
680
  }
682
681
  constructor(kwargs) {
@@ -690,18 +689,9 @@ class ConversationView {
690
689
  if (typeof this.viewId !== 'undefined') {
691
690
  toReturn['viewId'] = this.viewId;
692
691
  }
693
- if (typeof this.participantId !== 'undefined') {
694
- toReturn['participantId'] = this.participantId;
695
- }
696
- if (typeof this.viewType !== 'undefined') {
697
- toReturn['viewType'] = this.viewType;
698
- }
699
692
  if (typeof this.created !== 'undefined' && this.created !== null) {
700
693
  toReturn['created'] = 'toApiJson' in this.created ? this.created.toApiJson() : this.created;
701
694
  }
702
- if (typeof this.updated !== 'undefined' && this.updated !== null) {
703
- toReturn['updated'] = 'toApiJson' in this.updated ? this.updated.toApiJson() : this.updated;
704
- }
705
695
  return toReturn;
706
696
  }
707
697
  }
@@ -732,6 +722,9 @@ class AddConversationToConversationViewRequest {
732
722
  if (typeof this.conversationId !== 'undefined') {
733
723
  toReturn['conversationId'] = this.conversationId;
734
724
  }
725
+ if (typeof this.participantId !== 'undefined') {
726
+ toReturn['participantId'] = this.participantId;
727
+ }
735
728
  return toReturn;
736
729
  }
737
730
  }
@@ -1201,6 +1194,49 @@ class GetConversationByKeyResponse {
1201
1194
  return toReturn;
1202
1195
  }
1203
1196
  }
1197
+ class GetConversationViewsRequest {
1198
+ static fromProto(proto) {
1199
+ let m = new GetConversationViewsRequest();
1200
+ m = Object.assign(m, proto);
1201
+ return m;
1202
+ }
1203
+ constructor(kwargs) {
1204
+ if (!kwargs) {
1205
+ return;
1206
+ }
1207
+ Object.assign(this, kwargs);
1208
+ }
1209
+ toApiJson() {
1210
+ const toReturn = {};
1211
+ if (typeof this.participantId !== 'undefined') {
1212
+ toReturn['participantId'] = this.participantId;
1213
+ }
1214
+ return toReturn;
1215
+ }
1216
+ }
1217
+ class GetConversationViewsResponse {
1218
+ static fromProto(proto) {
1219
+ let m = new GetConversationViewsResponse();
1220
+ m = Object.assign(m, proto);
1221
+ if (proto.views) {
1222
+ m.views = proto.views.map(View.fromProto);
1223
+ }
1224
+ return m;
1225
+ }
1226
+ constructor(kwargs) {
1227
+ if (!kwargs) {
1228
+ return;
1229
+ }
1230
+ Object.assign(this, kwargs);
1231
+ }
1232
+ toApiJson() {
1233
+ const toReturn = {};
1234
+ if (typeof this.views !== 'undefined' && this.views !== null) {
1235
+ toReturn['views'] = 'toApiJson' in this.views ? this.views.toApiJson() : this.views;
1236
+ }
1237
+ return toReturn;
1238
+ }
1239
+ }
1204
1240
  class GetMessageRequest {
1205
1241
  static fromProto(proto) {
1206
1242
  let m = new GetMessageRequest();
@@ -1575,49 +1611,6 @@ class ListMessagesResponse {
1575
1611
  return toReturn;
1576
1612
  }
1577
1613
  }
1578
- class ListParticipantConversationViewsRequest {
1579
- static fromProto(proto) {
1580
- let m = new ListParticipantConversationViewsRequest();
1581
- m = Object.assign(m, proto);
1582
- return m;
1583
- }
1584
- constructor(kwargs) {
1585
- if (!kwargs) {
1586
- return;
1587
- }
1588
- Object.assign(this, kwargs);
1589
- }
1590
- toApiJson() {
1591
- const toReturn = {};
1592
- if (typeof this.participantId !== 'undefined') {
1593
- toReturn['participantId'] = this.participantId;
1594
- }
1595
- return toReturn;
1596
- }
1597
- }
1598
- class ListParticipantConversationViewsResponse {
1599
- static fromProto(proto) {
1600
- let m = new ListParticipantConversationViewsResponse();
1601
- m = Object.assign(m, proto);
1602
- if (proto.conversationViews) {
1603
- m.conversationViews = proto.conversationViews.map(ConversationView.fromProto);
1604
- }
1605
- return m;
1606
- }
1607
- constructor(kwargs) {
1608
- if (!kwargs) {
1609
- return;
1610
- }
1611
- Object.assign(this, kwargs);
1612
- }
1613
- toApiJson() {
1614
- const toReturn = {};
1615
- if (typeof this.conversationViews !== 'undefined' && this.conversationViews !== null) {
1616
- toReturn['conversationViews'] = 'toApiJson' in this.conversationViews ? this.conversationViews.toApiJson() : this.conversationViews;
1617
- }
1618
- return toReturn;
1619
- }
1620
- }
1621
1614
  class LookupConversationsRequestLookupConversationsFilters {
1622
1615
  static fromProto(proto) {
1623
1616
  let m = new LookupConversationsRequestLookupConversationsFilters();
@@ -1892,6 +1885,32 @@ class ReceiveMessageRequest {
1892
1885
  return toReturn;
1893
1886
  }
1894
1887
  }
1888
+ class RemoveConversationFromConversationViewRequest {
1889
+ static fromProto(proto) {
1890
+ let m = new RemoveConversationFromConversationViewRequest();
1891
+ m = Object.assign(m, proto);
1892
+ return m;
1893
+ }
1894
+ constructor(kwargs) {
1895
+ if (!kwargs) {
1896
+ return;
1897
+ }
1898
+ Object.assign(this, kwargs);
1899
+ }
1900
+ toApiJson() {
1901
+ const toReturn = {};
1902
+ if (typeof this.viewId !== 'undefined') {
1903
+ toReturn['viewId'] = this.viewId;
1904
+ }
1905
+ if (typeof this.conversationId !== 'undefined') {
1906
+ toReturn['conversationId'] = this.conversationId;
1907
+ }
1908
+ if (typeof this.participantId !== 'undefined') {
1909
+ toReturn['participantId'] = this.participantId;
1910
+ }
1911
+ return toReturn;
1912
+ }
1913
+ }
1895
1914
  class SearchConversationsRequest {
1896
1915
  static fromProto(proto) {
1897
1916
  let m = new SearchConversationsRequest();
@@ -2163,6 +2182,11 @@ class UpsertConfigurationResponse {
2163
2182
  }
2164
2183
  }
2165
2184
 
2185
+ // *********************************
2186
+ // Code generated by sdkgen
2187
+ // DO NOT EDIT!.
2188
+ //
2189
+ // Objects Index.
2166
2190
  // *********************************
2167
2191
 
2168
2192
  const environment = (window ? window['environment'] : 'prod') ?? 'prod';
@@ -2181,13 +2205,18 @@ class HostService {
2181
2205
  return 'https://' + this.host;
2182
2206
  }
2183
2207
  }
2184
- HostService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: HostService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2185
- HostService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: HostService, providedIn: 'root' });
2186
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: HostService, decorators: [{
2208
+ HostService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: HostService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2209
+ HostService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: HostService, providedIn: 'root' });
2210
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: HostService, decorators: [{
2187
2211
  type: Injectable,
2188
2212
  args: [{ providedIn: 'root' }]
2189
2213
  }] });
2190
2214
 
2215
+ // *********************************
2216
+ // Code generated by sdkgen
2217
+ // DO NOT EDIT!.
2218
+ //
2219
+ // API Service.
2191
2220
  // *********************************
2192
2221
  class ConversationApiService {
2193
2222
  constructor(http, hostService) {
@@ -2293,23 +2322,32 @@ class ConversationApiService {
2293
2322
  return this.http.post(this._host + "/conversation.v1.ConversationService/GetParticipantsByKey", request.toApiJson(), this.apiOptions())
2294
2323
  .pipe(map(resp => GetParticipantsByKeyResponse.fromProto(resp)));
2295
2324
  }
2296
- listParticipantConversationViews(r) {
2297
- const request = (r.toApiJson) ? r : new ListParticipantConversationViewsRequest(r);
2298
- return this.http.post(this._host + "/conversation.v1.ConversationService/ListParticipantConversationViews", request.toApiJson(), this.apiOptions())
2299
- .pipe(map(resp => ListParticipantConversationViewsResponse.fromProto(resp)));
2325
+ getConversationViews(r) {
2326
+ const request = (r.toApiJson) ? r : new GetConversationViewsRequest(r);
2327
+ return this.http.post(this._host + "/conversation.v1.ConversationService/GetConversationViews", request.toApiJson(), this.apiOptions())
2328
+ .pipe(map(resp => GetConversationViewsResponse.fromProto(resp)));
2300
2329
  }
2301
2330
  addConversationToConversationView(r) {
2302
2331
  const request = (r.toApiJson) ? r : new AddConversationToConversationViewRequest(r);
2303
2332
  return this.http.post(this._host + "/conversation.v1.ConversationService/AddConversationToConversationView", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
2304
2333
  }
2334
+ removeConversationFromConversationView(r) {
2335
+ const request = (r.toApiJson) ? r : new RemoveConversationFromConversationViewRequest(r);
2336
+ return this.http.post(this._host + "/conversation.v1.ConversationService/RemoveConversationFromConversationView", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
2337
+ }
2305
2338
  }
2306
- ConversationApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConversationApiService, deps: [{ token: i1.HttpClient }, { token: HostService }], target: i0.ɵɵFactoryTarget.Injectable });
2307
- ConversationApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConversationApiService, providedIn: 'root' });
2308
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConversationApiService, decorators: [{
2339
+ ConversationApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConversationApiService, deps: [{ token: i1.HttpClient }, { token: HostService }], target: i0.ɵɵFactoryTarget.Injectable });
2340
+ ConversationApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConversationApiService, providedIn: 'root' });
2341
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConversationApiService, decorators: [{
2309
2342
  type: Injectable,
2310
2343
  args: [{ providedIn: 'root' }]
2311
2344
  }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: HostService }]; } });
2312
2345
 
2346
+ // *********************************
2347
+ // Code generated by sdkgen
2348
+ // DO NOT EDIT!.
2349
+ //
2350
+ // API Service.
2313
2351
  // *********************************
2314
2352
  class InboxApiService {
2315
2353
  constructor(http, hostService) {
@@ -2341,18 +2379,23 @@ class InboxApiService {
2341
2379
  .pipe(map(resp => UpsertConfigurationResponse.fromProto(resp)));
2342
2380
  }
2343
2381
  }
2344
- InboxApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: InboxApiService, deps: [{ token: i1.HttpClient }, { token: HostService }], target: i0.ɵɵFactoryTarget.Injectable });
2345
- InboxApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: InboxApiService, providedIn: 'root' });
2346
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: InboxApiService, decorators: [{
2382
+ InboxApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: InboxApiService, deps: [{ token: i1.HttpClient }, { token: HostService }], target: i0.ɵɵFactoryTarget.Injectable });
2383
+ InboxApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: InboxApiService, providedIn: 'root' });
2384
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: InboxApiService, decorators: [{
2347
2385
  type: Injectable,
2348
2386
  args: [{ providedIn: 'root' }]
2349
2387
  }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: HostService }]; } });
2350
2388
 
2351
2389
  // *********************************
2390
+ // Code generated by sdkgen
2391
+ // DO NOT EDIT!.
2392
+ //
2393
+ // Index.
2394
+ // *********************************
2352
2395
 
2353
2396
  /**
2354
2397
  * Generated bundle index. Do not edit.
2355
2398
  */
2356
2399
 
2357
- export { Access, AddConversationToConversationViewRequest, AddMultiParticipantsRequest, AddMultiParticipantsResponse, Address, Configuration, Conversation, ConversationApiService, ConversationChannel, ConversationKey, ConversationMessageCount, ConversationView, CreateConversationRequest, CreateConversationResponse, CreateMultiMessagesRequest, DeleteConversationRequest, DeleteMessageRequest, GetConfigurationRequest, GetConfigurationResponse, GetConversationByKeyRequest, GetConversationByKeyResponse, GetMessageRequest, GetMultiConfigurationRequest, GetMultiConfigurationResponse, GetMultiConversationDetailsRequest, GetMultiConversationDetailsResponse, GetMultiConversationDetailsResponseDetailedConversation, GetMultiConversationMessageCountRequest, GetMultiConversationMessageCountResponse, GetMultiConversationMessageCountResponseCountsEntry, GetMultiMessagesRequest, GetMultiMessagesResponse, GetMultiParticipantsRequest, GetMultiParticipantsResponse, GetParticipantsByKeyRequest, GetParticipantsByKeyResponse, GlobalParticipantType, InboxApiService, LastSeenByParticipant, ListMessagesRequest, ListMessagesRequestListMessagesFilters, ListMessagesResponse, ListParticipantConversationViewsRequest, ListParticipantConversationViewsResponse, 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, SortDirection, SubjectParticipant, UpdateMessageStatusRequest, UpsertConfigurationRequest, UpsertConfigurationResponse, ViewType };
2400
+ export { Access, AddConversationToConversationViewRequest, AddMultiParticipantsRequest, AddMultiParticipantsResponse, Address, Configuration, Conversation, ConversationApiService, ConversationChannel, ConversationKey, ConversationMessageCount, CreateConversationRequest, CreateConversationResponse, CreateMultiMessagesRequest, DeleteConversationRequest, DeleteMessageRequest, GetConfigurationRequest, GetConfigurationResponse, GetConversationByKeyRequest, GetConversationByKeyResponse, GetConversationViewsRequest, GetConversationViewsResponse, GetMessageRequest, GetMultiConfigurationRequest, GetMultiConfigurationResponse, GetMultiConversationDetailsRequest, GetMultiConversationDetailsResponse, GetMultiConversationDetailsResponseDetailedConversation, GetMultiConversationMessageCountRequest, GetMultiConversationMessageCountResponse, GetMultiConversationMessageCountResponseCountsEntry, GetMultiMessagesRequest, GetMultiMessagesResponse, GetMultiParticipantsRequest, GetMultiParticipantsResponse, GetParticipantsByKeyRequest, GetParticipantsByKeyResponse, GlobalParticipantType, InboxApiService, LastSeenByParticipant, ListMessagesRequest, ListMessagesRequestListMessagesFilters, ListMessagesResponse, LookupConversationsRequest, LookupConversationsRequestLookupConversationsFilters, LookupConversationsResponse, LookupConversationsResponseConversations, Message, MessageStatus, MessageType, Metadata, MetadataDataEntry, MetadataIdentifier, PagedRequestOptions, PagedResponseMetadata, Participant, ParticipantKey, ParticipantMessageStatus, ParticipantType, PlatformLocation, ReceiveMessageRequest, ReceiveMessageRequestMetadataEntry, RemoveConversationFromConversationViewRequest, SearchConversationsRequest, SearchConversationsResponse, SearchConversationsResponseDetailedConversation, SendMessageRequest, SendMessageResponse, SetLastSeenRequest, SetLastSeenRequestStatus, SetLastSeenResponse, SortDirection, SubjectParticipant, UpdateMessageStatusRequest, UpsertConfigurationRequest, UpsertConfigurationResponse, View, ViewType };
2358
2401
  //# sourceMappingURL=vendasta-conversation.mjs.map