@vendasta/social-posts 5.1.0 → 5.2.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.
@@ -5,7 +5,7 @@ import * as i1 from '@angular/common/http';
5
5
  import { HttpHeaders } from '@angular/common/http';
6
6
  import { map } from 'rxjs/operators';
7
7
 
8
- function enumStringToValue$7(enumRef, value) {
8
+ function enumStringToValue$8(enumRef, value) {
9
9
  if (typeof value === 'number') {
10
10
  return value;
11
11
  }
@@ -32,6 +32,45 @@ class FieldMask {
32
32
  }
33
33
  }
34
34
 
35
+ function enumStringToValue$7(enumRef, value) {
36
+ if (typeof value === 'number') {
37
+ return value;
38
+ }
39
+ return enumRef[value];
40
+ }
41
+ class Hashtag {
42
+ constructor(kwargs) {
43
+ if (!kwargs) {
44
+ return;
45
+ }
46
+ Object.assign(this, kwargs);
47
+ }
48
+ static fromProto(proto) {
49
+ let m = new Hashtag();
50
+ m = Object.assign(m, proto);
51
+ if (proto.usedCount) {
52
+ m.usedCount = parseInt(proto.usedCount, 10);
53
+ }
54
+ return m;
55
+ }
56
+ toApiJson() {
57
+ const toReturn = {};
58
+ if (typeof this.keyword !== 'undefined') {
59
+ toReturn['keyword'] = this.keyword;
60
+ }
61
+ if (typeof this.usedCount !== 'undefined') {
62
+ toReturn['usedCount'] = this.usedCount;
63
+ }
64
+ if (typeof this.businessId !== 'undefined') {
65
+ toReturn['businessId'] = this.businessId;
66
+ }
67
+ if (typeof this.partnerId !== 'undefined') {
68
+ toReturn['partnerId'] = this.partnerId;
69
+ }
70
+ return toReturn;
71
+ }
72
+ }
73
+
35
74
  function enumStringToValue$6(enumRef, value) {
36
75
  if (typeof value === 'number') {
37
76
  return value;
@@ -1098,6 +1137,32 @@ class DateRangeFilter {
1098
1137
  return toReturn;
1099
1138
  }
1100
1139
  }
1140
+ class DeleteHashtagsRequest {
1141
+ constructor(kwargs) {
1142
+ if (!kwargs) {
1143
+ return;
1144
+ }
1145
+ Object.assign(this, kwargs);
1146
+ }
1147
+ static fromProto(proto) {
1148
+ let m = new DeleteHashtagsRequest();
1149
+ m = Object.assign(m, proto);
1150
+ return m;
1151
+ }
1152
+ toApiJson() {
1153
+ const toReturn = {};
1154
+ if (typeof this.keyword !== 'undefined') {
1155
+ toReturn['keyword'] = this.keyword;
1156
+ }
1157
+ if (typeof this.businessId !== 'undefined') {
1158
+ toReturn['businessId'] = this.businessId;
1159
+ }
1160
+ if (typeof this.partnerId !== 'undefined') {
1161
+ toReturn['partnerId'] = this.partnerId;
1162
+ }
1163
+ return toReturn;
1164
+ }
1165
+ }
1101
1166
  class DeleteMultilocationPostRequest {
1102
1167
  constructor(kwargs) {
1103
1168
  if (!kwargs) {
@@ -1991,6 +2056,32 @@ class RemoveFromMultilocationPostRequest {
1991
2056
  return toReturn;
1992
2057
  }
1993
2058
  }
2059
+ class ReplaceHashtagsRequest {
2060
+ constructor(kwargs) {
2061
+ if (!kwargs) {
2062
+ return;
2063
+ }
2064
+ Object.assign(this, kwargs);
2065
+ }
2066
+ static fromProto(proto) {
2067
+ let m = new ReplaceHashtagsRequest();
2068
+ m = Object.assign(m, proto);
2069
+ return m;
2070
+ }
2071
+ toApiJson() {
2072
+ const toReturn = {};
2073
+ if (typeof this.keyword !== 'undefined') {
2074
+ toReturn['keyword'] = this.keyword;
2075
+ }
2076
+ if (typeof this.businessId !== 'undefined') {
2077
+ toReturn['businessId'] = this.businessId;
2078
+ }
2079
+ if (typeof this.partnerId !== 'undefined') {
2080
+ toReturn['partnerId'] = this.partnerId;
2081
+ }
2082
+ return toReturn;
2083
+ }
2084
+ }
1994
2085
  class SchedulePostRequest {
1995
2086
  constructor(kwargs) {
1996
2087
  if (!kwargs) {
@@ -2098,6 +2189,61 @@ class ScheduleToAllPagesResponse {
2098
2189
  return toReturn;
2099
2190
  }
2100
2191
  }
2192
+ class SearchHashtagRequest {
2193
+ constructor(kwargs) {
2194
+ if (!kwargs) {
2195
+ return;
2196
+ }
2197
+ Object.assign(this, kwargs);
2198
+ }
2199
+ static fromProto(proto) {
2200
+ let m = new SearchHashtagRequest();
2201
+ m = Object.assign(m, proto);
2202
+ if (proto.limit) {
2203
+ m.limit = parseInt(proto.limit, 10);
2204
+ }
2205
+ return m;
2206
+ }
2207
+ toApiJson() {
2208
+ const toReturn = {};
2209
+ if (typeof this.searchTerm !== 'undefined') {
2210
+ toReturn['searchTerm'] = this.searchTerm;
2211
+ }
2212
+ if (typeof this.limit !== 'undefined') {
2213
+ toReturn['limit'] = this.limit;
2214
+ }
2215
+ if (typeof this.businessId !== 'undefined') {
2216
+ toReturn['businessId'] = this.businessId;
2217
+ }
2218
+ if (typeof this.partnerId !== 'undefined') {
2219
+ toReturn['partnerId'] = this.partnerId;
2220
+ }
2221
+ return toReturn;
2222
+ }
2223
+ }
2224
+ class SearchHashtagResponse {
2225
+ constructor(kwargs) {
2226
+ if (!kwargs) {
2227
+ return;
2228
+ }
2229
+ Object.assign(this, kwargs);
2230
+ }
2231
+ static fromProto(proto) {
2232
+ let m = new SearchHashtagResponse();
2233
+ m = Object.assign(m, proto);
2234
+ if (proto.hashtags) {
2235
+ m.hashtags = proto.hashtags.map(Hashtag.fromProto);
2236
+ }
2237
+ return m;
2238
+ }
2239
+ toApiJson() {
2240
+ const toReturn = {};
2241
+ if (typeof this.hashtags !== 'undefined' && this.hashtags !== null) {
2242
+ toReturn['hashtags'] = 'toApiJson' in this.hashtags ? this.hashtags.toApiJson() : this.hashtags;
2243
+ }
2244
+ return toReturn;
2245
+ }
2246
+ }
2101
2247
  class UpdatePostTemplateRequest {
2102
2248
  constructor(kwargs) {
2103
2249
  if (!kwargs) {
@@ -2617,6 +2763,79 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
2617
2763
  args: [{ providedIn: 'root' }]
2618
2764
  }], ctorParameters: function () { return [{ type: PixabayImagesApiService }]; } });
2619
2765
 
2766
+ // *********************************
2767
+ class HashTagsApiService {
2768
+ constructor(http, hostService) {
2769
+ this.http = http;
2770
+ this.hostService = hostService;
2771
+ this._host = this.hostService.hostWithScheme;
2772
+ }
2773
+ apiOptions() {
2774
+ return {
2775
+ headers: new HttpHeaders({
2776
+ 'Content-Type': 'application/json'
2777
+ }),
2778
+ withCredentials: true
2779
+ };
2780
+ }
2781
+ replaceHashtags(r) {
2782
+ const request = (r.toApiJson) ? r : new ReplaceHashtagsRequest(r);
2783
+ return this.http.post(this._host + "/socialposts.v1.HashTags/ReplaceHashtags", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
2784
+ }
2785
+ deleteHashtags(r) {
2786
+ const request = (r.toApiJson) ? r : new DeleteHashtagsRequest(r);
2787
+ return this.http.post(this._host + "/socialposts.v1.HashTags/DeleteHashtags", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
2788
+ }
2789
+ searchHashtag(r) {
2790
+ const request = (r.toApiJson) ? r : new SearchHashtagRequest(r);
2791
+ return this.http.post(this._host + "/socialposts.v1.HashTags/SearchHashtag", request.toApiJson(), this.apiOptions())
2792
+ .pipe(map(resp => SearchHashtagResponse.fromProto(resp)));
2793
+ }
2794
+ }
2795
+ HashTagsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: HashTagsApiService, deps: [{ token: i1.HttpClient }, { token: HostService }], target: i0.ɵɵFactoryTarget.Injectable });
2796
+ HashTagsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: HashTagsApiService, providedIn: 'root' });
2797
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: HashTagsApiService, decorators: [{
2798
+ type: Injectable,
2799
+ args: [{ providedIn: 'root' }]
2800
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: HostService }]; } });
2801
+
2802
+ class HashTagsService {
2803
+ constructor(hashTagsApiService) {
2804
+ this.hashTagsApiService = hashTagsApiService;
2805
+ }
2806
+ replaceHashtags(keyword, businessId, partnerId) {
2807
+ const request = new ReplaceHashtagsRequest({
2808
+ keyword: keyword,
2809
+ businessId: businessId,
2810
+ partnerId: partnerId
2811
+ });
2812
+ return this.hashTagsApiService.replaceHashtags(request);
2813
+ }
2814
+ deleteHashtags(keyword, businessId, partnerId) {
2815
+ const request = new DeleteHashtagsRequest({
2816
+ keyword: keyword,
2817
+ businessId: businessId,
2818
+ partnerId: partnerId
2819
+ });
2820
+ return this.hashTagsApiService.deleteHashtags(request);
2821
+ }
2822
+ searchHashtag(searchTerm, businessId, limit, partnerId) {
2823
+ const request = new SearchHashtagRequest({
2824
+ searchTerm: searchTerm,
2825
+ businessId: businessId,
2826
+ limit: limit,
2827
+ partnerId: partnerId
2828
+ });
2829
+ return this.hashTagsApiService.searchHashtag(request);
2830
+ }
2831
+ }
2832
+ HashTagsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: HashTagsService, deps: [{ token: HashTagsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
2833
+ HashTagsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: HashTagsService, providedIn: 'root' });
2834
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: HashTagsService, decorators: [{
2835
+ type: Injectable,
2836
+ args: [{ providedIn: 'root' }]
2837
+ }], ctorParameters: function () { return [{ type: HashTagsApiService }]; } });
2838
+
2620
2839
  // *********************************
2621
2840
  class PartnerSocialPostsApiService {
2622
2841
  constructor(http, hostService) {
@@ -2660,5 +2879,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
2660
2879
  * Generated bundle index. Do not edit.
2661
2880
  */
2662
2881
 
2663
- export { DeleteMultilocationPostRequest, FieldMask, GetMultilocationPostRequest, ListMultilocationPostsForBrandRequest, Location, MultilocationPost, MultilocationPostApiService, MultilocationPostsService, PixabayImageService, PostTemplatesService, PostingStatus, RemoveReason, SocialPostsService, TenorGifsService };
2882
+ export { DeleteMultilocationPostRequest, FieldMask, GetMultilocationPostRequest, HashTagsService, ListMultilocationPostsForBrandRequest, Location, MultilocationPost, MultilocationPostApiService, MultilocationPostsService, PixabayImageService, PostTemplatesService, PostingStatus, RemoveReason, SocialPostsService, TenorGifsService };
2664
2883
  //# sourceMappingURL=vendasta-social-posts.mjs.map