@vendasta/social-posts 5.6.1 → 5.8.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 (46) hide show
  1. package/esm2020/lib/_internal/enums/index.mjs +4 -3
  2. package/esm2020/lib/_internal/enums/linkedin-v2.enum.mjs +15 -0
  3. package/esm2020/lib/_internal/enums/social-post-v2.enum.mjs +16 -0
  4. package/esm2020/lib/_internal/enums/social-posts.enum.mjs +12 -6
  5. package/esm2020/lib/_internal/index.mjs +2 -1
  6. package/esm2020/lib/_internal/interfaces/api-v2.interface.mjs +2 -0
  7. package/esm2020/lib/_internal/interfaces/api.interface.mjs +1 -1
  8. package/esm2020/lib/_internal/interfaces/index.mjs +1 -1
  9. package/esm2020/lib/_internal/interfaces/linkedin-v2.interface.mjs +8 -0
  10. package/esm2020/lib/_internal/interfaces/social-post-v2.interface.mjs +8 -0
  11. package/esm2020/lib/_internal/linkedin.api.service.mjs +7 -3
  12. package/esm2020/lib/_internal/objects/api-v2.mjs +243 -0
  13. package/esm2020/lib/_internal/objects/api.mjs +10 -53
  14. package/esm2020/lib/_internal/objects/index.mjs +8 -6
  15. package/esm2020/lib/_internal/objects/linkedin-v2.mjs +34 -0
  16. package/esm2020/lib/_internal/objects/social-post-v2.mjs +264 -0
  17. package/esm2020/lib/_internal/social-posts-v2.api.service.mjs +46 -0
  18. package/esm2020/lib/index.mjs +2 -2
  19. package/esm2020/lib/social-posts.service.mjs +3 -3
  20. package/fesm2015/vendasta-social-posts.mjs +715 -195
  21. package/fesm2015/vendasta-social-posts.mjs.map +1 -1
  22. package/fesm2020/vendasta-social-posts.mjs +712 -192
  23. package/fesm2020/vendasta-social-posts.mjs.map +1 -1
  24. package/lib/_internal/enums/index.d.ts +3 -2
  25. package/lib/_internal/enums/{linkedin.enum.d.ts → linkedin-v2.enum.d.ts} +0 -0
  26. package/lib/_internal/enums/social-post-v2.enum.d.ts +8 -0
  27. package/lib/_internal/enums/social-posts.enum.d.ts +6 -1
  28. package/lib/_internal/index.d.ts +1 -0
  29. package/lib/_internal/interfaces/api-v2.interface.d.ts +40 -0
  30. package/lib/_internal/interfaces/api.interface.d.ts +4 -11
  31. package/lib/_internal/interfaces/index.d.ts +7 -5
  32. package/lib/_internal/interfaces/{linkedin.interface.d.ts → linkedin-v2.interface.d.ts} +0 -0
  33. package/lib/_internal/interfaces/social-post-v2.interface.d.ts +46 -0
  34. package/lib/_internal/linkedin.api.service.d.ts +4 -3
  35. package/lib/_internal/objects/api-v2.d.ts +69 -0
  36. package/lib/_internal/objects/api.d.ts +4 -17
  37. package/lib/_internal/objects/index.d.ts +7 -5
  38. package/lib/_internal/objects/{linkedin.d.ts → linkedin-v2.d.ts} +0 -0
  39. package/lib/_internal/objects/social-post-v2.d.ts +72 -0
  40. package/lib/_internal/social-posts-v2.api.service.d.ts +17 -0
  41. package/lib/index.d.ts +1 -1
  42. package/lib/social-posts.service.d.ts +2 -2
  43. package/package.json +1 -1
  44. package/esm2020/lib/_internal/enums/linkedin.enum.mjs +0 -15
  45. package/esm2020/lib/_internal/interfaces/linkedin.interface.mjs +0 -8
  46. package/esm2020/lib/_internal/objects/linkedin.mjs +0 -34
@@ -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$8(enumRef, value) {
8
+ function enumStringToValue$a(enumRef, value) {
9
9
  if (typeof value === 'number') {
10
10
  return value;
11
11
  }
@@ -32,7 +32,7 @@ class FieldMask {
32
32
  }
33
33
  }
34
34
 
35
- function enumStringToValue$7(enumRef, value) {
35
+ function enumStringToValue$9(enumRef, value) {
36
36
  if (typeof value === 'number') {
37
37
  return value;
38
38
  }
@@ -71,7 +71,7 @@ class Hashtag {
71
71
  }
72
72
  }
73
73
 
74
- function enumStringToValue$6(enumRef, value) {
74
+ function enumStringToValue$8(enumRef, value) {
75
75
  if (typeof value === 'number') {
76
76
  return value;
77
77
  }
@@ -198,21 +198,6 @@ var RemoveReason;
198
198
  RemoveReason[RemoveReason["REMOVE_REASON_DELETE"] = 1] = "REMOVE_REASON_DELETE";
199
199
  })(RemoveReason || (RemoveReason = {}));
200
200
 
201
- // *********************************
202
- // Code generated by sdkgen
203
- // DO NOT EDIT!.
204
- //
205
- // Enums.
206
- // *********************************
207
- var MediaType;
208
- (function (MediaType) {
209
- MediaType[MediaType["MEDIA_TYPE_INVALID"] = 0] = "MEDIA_TYPE_INVALID";
210
- MediaType[MediaType["MEDIA_TYPE_IMAGE"] = 1] = "MEDIA_TYPE_IMAGE";
211
- MediaType[MediaType["MEDIA_TYPE_VIDEO"] = 2] = "MEDIA_TYPE_VIDEO";
212
- MediaType[MediaType["MEDIA_TYPE_GIF"] = 3] = "MEDIA_TYPE_GIF";
213
- MediaType[MediaType["MEDIA_TYPE_CAROUSEL"] = 4] = "MEDIA_TYPE_CAROUSEL";
214
- })(MediaType || (MediaType = {}));
215
-
216
201
  // *********************************
217
202
  // Code generated by sdkgen
218
203
  // DO NOT EDIT!.
@@ -235,12 +220,12 @@ var SocialPostDeletionStatus;
235
220
  SocialPostDeletionStatus[SocialPostDeletionStatus["FAILED"] = 1] = "FAILED";
236
221
  SocialPostDeletionStatus[SocialPostDeletionStatus["IN_PROGRESS"] = 2] = "IN_PROGRESS";
237
222
  })(SocialPostDeletionStatus || (SocialPostDeletionStatus = {}));
238
- var PostLength;
239
- (function (PostLength) {
240
- PostLength[PostLength["SHORT_FORM"] = 0] = "SHORT_FORM";
241
- PostLength[PostLength["LONG_FORM"] = 1] = "LONG_FORM";
242
- })(PostLength || (PostLength = {}));
243
- var PostType;
223
+ var MessageLength;
224
+ (function (MessageLength) {
225
+ MessageLength[MessageLength["SHORT_FORM"] = 0] = "SHORT_FORM";
226
+ MessageLength[MessageLength["LONG_FORM"] = 1] = "LONG_FORM";
227
+ })(MessageLength || (MessageLength = {}));
228
+ var PostType$1;
244
229
  (function (PostType) {
245
230
  PostType[PostType["POST_TYPE_INVALID"] = 0] = "POST_TYPE_INVALID";
246
231
  PostType[PostType["POST_TYPE_IMAGE"] = 1] = "POST_TYPE_IMAGE";
@@ -248,7 +233,7 @@ var PostType;
248
233
  PostType[PostType["POST_TYPE_GIF"] = 3] = "POST_TYPE_GIF";
249
234
  PostType[PostType["POST_TYPE_REEL"] = 4] = "POST_TYPE_REEL";
250
235
  PostType[PostType["POST_TYPE_CAROUSEL"] = 5] = "POST_TYPE_CAROUSEL";
251
- })(PostType || (PostType = {}));
236
+ })(PostType$1 || (PostType$1 = {}));
252
237
  var PostingStatus;
253
238
  (function (PostingStatus) {
254
239
  PostingStatus[PostingStatus["POSTING_IN_PROGRESS"] = 0] = "POSTING_IN_PROGRESS";
@@ -265,43 +250,47 @@ var SocialPostService;
265
250
  SocialPostService[SocialPostService["UNKNOWN"] = 5] = "UNKNOWN";
266
251
  SocialPostService[SocialPostService["INSTAGRAM"] = 6] = "INSTAGRAM";
267
252
  })(SocialPostService || (SocialPostService = {}));
253
+ var TemplateType;
254
+ (function (TemplateType) {
255
+ TemplateType[TemplateType["TEMPLATE_UNSET"] = 0] = "TEMPLATE_UNSET";
256
+ TemplateType[TemplateType["TEMPLATE_CUSTOM"] = 1] = "TEMPLATE_CUSTOM";
257
+ TemplateType[TemplateType["TEMPLATE_SOCIAL_POST"] = 2] = "TEMPLATE_SOCIAL_POST";
258
+ })(TemplateType || (TemplateType = {}));
268
259
 
269
260
  // *********************************
261
+ // Code generated by sdkgen
262
+ // DO NOT EDIT!.
263
+ //
264
+ // Enums.
265
+ // *********************************
266
+ var PostType;
267
+ (function (PostType) {
268
+ PostType[PostType["POST_TYPE_INVALID"] = 0] = "POST_TYPE_INVALID";
269
+ PostType[PostType["POST_TYPE_IMAGE"] = 1] = "POST_TYPE_IMAGE";
270
+ PostType[PostType["POST_TYPE_VIDEO"] = 2] = "POST_TYPE_VIDEO";
271
+ PostType[PostType["POST_TYPE_GIF"] = 3] = "POST_TYPE_GIF";
272
+ PostType[PostType["POST_TYPE_MULTI_MEDIA"] = 4] = "POST_TYPE_MULTI_MEDIA";
273
+ PostType[PostType["POST_TYPE_TEXT"] = 5] = "POST_TYPE_TEXT";
274
+ })(PostType || (PostType = {}));
270
275
 
271
- function enumStringToValue$5(enumRef, value) {
272
- if (typeof value === 'number') {
273
- return value;
274
- }
275
- return enumRef[value];
276
- }
277
- class Media {
278
- constructor(kwargs) {
279
- if (!kwargs) {
280
- return;
281
- }
282
- Object.assign(this, kwargs);
283
- }
284
- static fromProto(proto) {
285
- let m = new Media();
286
- m = Object.assign(m, proto);
287
- if (proto.mediaType) {
288
- m.mediaType = enumStringToValue$5(MediaType, proto.mediaType);
289
- }
290
- return m;
291
- }
292
- toApiJson() {
293
- const toReturn = {};
294
- if (typeof this.url !== 'undefined') {
295
- toReturn['url'] = this.url;
296
- }
297
- if (typeof this.mediaType !== 'undefined') {
298
- toReturn['mediaType'] = this.mediaType;
299
- }
300
- return toReturn;
301
- }
302
- }
276
+ // *********************************
277
+ // Code generated by sdkgen
278
+ // DO NOT EDIT!.
279
+ //
280
+ // Enums.
281
+ // *********************************
282
+ var MediaType;
283
+ (function (MediaType) {
284
+ MediaType[MediaType["MEDIA_TYPE_INVALID"] = 0] = "MEDIA_TYPE_INVALID";
285
+ MediaType[MediaType["MEDIA_TYPE_IMAGE"] = 1] = "MEDIA_TYPE_IMAGE";
286
+ MediaType[MediaType["MEDIA_TYPE_VIDEO"] = 2] = "MEDIA_TYPE_VIDEO";
287
+ MediaType[MediaType["MEDIA_TYPE_GIF"] = 3] = "MEDIA_TYPE_GIF";
288
+ MediaType[MediaType["MEDIA_TYPE_CAROUSEL"] = 4] = "MEDIA_TYPE_CAROUSEL";
289
+ })(MediaType || (MediaType = {}));
303
290
 
304
- function enumStringToValue$4(enumRef, value) {
291
+ // *********************************
292
+
293
+ function enumStringToValue$7(enumRef, value) {
305
294
  if (typeof value === 'number') {
306
295
  return value;
307
296
  }
@@ -318,7 +307,7 @@ class CallToAction {
318
307
  let m = new CallToAction();
319
308
  m = Object.assign(m, proto);
320
309
  if (proto.actionType) {
321
- m.actionType = enumStringToValue$4(CallToActionCallToActionType, proto.actionType);
310
+ m.actionType = enumStringToValue$7(CallToActionCallToActionType, proto.actionType);
322
311
  }
323
312
  return m;
324
313
  }
@@ -472,7 +461,7 @@ class PostTemplate {
472
461
  m.metaData = proto.metaData.map(MetaData.fromProto);
473
462
  }
474
463
  if (proto.postType) {
475
- m.postType = enumStringToValue$4(PostType, proto.postType);
464
+ m.postType = enumStringToValue$7(PostType$1, proto.postType);
476
465
  }
477
466
  return m;
478
467
  }
@@ -564,7 +553,7 @@ class SchedulePostStatus {
564
553
  return toReturn;
565
554
  }
566
555
  }
567
- class SocialPost {
556
+ class SocialPost$1 {
568
557
  constructor(kwargs) {
569
558
  if (!kwargs) {
570
559
  return;
@@ -572,16 +561,16 @@ class SocialPost {
572
561
  Object.assign(this, kwargs);
573
562
  }
574
563
  static fromProto(proto) {
575
- let m = new SocialPost();
564
+ let m = new SocialPost$1();
576
565
  m = Object.assign(m, proto);
577
566
  if (proto.posted) {
578
567
  m.posted = new Date(proto.posted);
579
568
  }
580
569
  if (proto.deletionStatus) {
581
- m.deletionStatus = enumStringToValue$4(SocialPostDeletionStatus, proto.deletionStatus);
570
+ m.deletionStatus = enumStringToValue$7(SocialPostDeletionStatus, proto.deletionStatus);
582
571
  }
583
572
  if (proto.service) {
584
- m.service = enumStringToValue$4(SocialPostService, proto.service);
573
+ m.service = enumStringToValue$7(SocialPostService, proto.service);
585
574
  }
586
575
  if (proto.created) {
587
576
  m.created = new Date(proto.created);
@@ -590,7 +579,7 @@ class SocialPost {
590
579
  m.scheduled = new Date(proto.scheduled);
591
580
  }
592
581
  if (proto.status) {
593
- m.status = enumStringToValue$4(PostingStatus, proto.status);
582
+ m.status = enumStringToValue$7(PostingStatus, proto.status);
594
583
  }
595
584
  if (proto.event) {
596
585
  m.event = Event.fromProto(proto.event);
@@ -602,7 +591,7 @@ class SocialPost {
602
591
  m.error = Error.fromProto(proto.error);
603
592
  }
604
593
  if (proto.postType) {
605
- m.postType = enumStringToValue$4(PostType, proto.postType);
594
+ m.postType = enumStringToValue$7(PostType$1, proto.postType);
606
595
  }
607
596
  if (proto.mediaEntries) {
608
597
  m.mediaEntries = proto.mediaEntries.map(MediaEntry.fromProto);
@@ -734,7 +723,7 @@ class SocialPostData {
734
723
  }
735
724
  }
736
725
 
737
- function enumStringToValue$3(enumRef, value) {
726
+ function enumStringToValue$6(enumRef, value) {
738
727
  if (typeof value === 'number') {
739
728
  return value;
740
729
  }
@@ -872,7 +861,7 @@ class PixabayImage {
872
861
  }
873
862
  }
874
863
 
875
- function enumStringToValue$2(enumRef, value) {
864
+ function enumStringToValue$5(enumRef, value) {
876
865
  if (typeof value === 'number') {
877
866
  return value;
878
867
  }
@@ -999,7 +988,7 @@ class TwitterPostStats {
999
988
  }
1000
989
  }
1001
990
 
1002
- function enumStringToValue$1(enumRef, value) {
991
+ function enumStringToValue$4(enumRef, value) {
1003
992
  if (typeof value === 'number') {
1004
993
  return value;
1005
994
  }
@@ -1105,7 +1094,7 @@ class TenorMediaObject {
1105
1094
  }
1106
1095
  }
1107
1096
 
1108
- function enumStringToValue(enumRef, value) {
1097
+ function enumStringToValue$3(enumRef, value) {
1109
1098
  if (typeof value === 'number') {
1110
1099
  return value;
1111
1100
  }
@@ -1204,7 +1193,7 @@ class CreatePostTemplateRequest {
1204
1193
  m.metaData = proto.metaData.map(MetaData.fromProto);
1205
1194
  }
1206
1195
  if (proto.postType) {
1207
- m.postType = enumStringToValue(PostType, proto.postType);
1196
+ m.postType = enumStringToValue$3(PostType$1, proto.postType);
1208
1197
  }
1209
1198
  return m;
1210
1199
  }
@@ -1679,7 +1668,7 @@ class GetMultiSocialPostsResponse {
1679
1668
  let m = new GetMultiSocialPostsResponse();
1680
1669
  m = Object.assign(m, proto);
1681
1670
  if (proto.socialPosts) {
1682
- m.socialPosts = proto.socialPosts.map(SocialPost.fromProto);
1671
+ m.socialPosts = proto.socialPosts.map(SocialPost$1.fromProto);
1683
1672
  }
1684
1673
  return m;
1685
1674
  }
@@ -1924,7 +1913,7 @@ class ListMultilocationPostsForBrandResponse {
1924
1913
  m.multilocationPosts = proto.multilocationPosts.map(MultilocationPost.fromProto);
1925
1914
  }
1926
1915
  if (proto.failedSocialPosts) {
1927
- m.failedSocialPosts = proto.failedSocialPosts.map(SocialPost.fromProto);
1916
+ m.failedSocialPosts = proto.failedSocialPosts.map(SocialPost$1.fromProto);
1928
1917
  }
1929
1918
  return m;
1930
1919
  }
@@ -2128,7 +2117,7 @@ class ListSocialPostsResponse {
2128
2117
  let m = new ListSocialPostsResponse();
2129
2118
  m = Object.assign(m, proto);
2130
2119
  if (proto.socialPosts) {
2131
- m.socialPosts = proto.socialPosts.map(SocialPost.fromProto);
2120
+ m.socialPosts = proto.socialPosts.map(SocialPost$1.fromProto);
2132
2121
  }
2133
2122
  return m;
2134
2123
  }
@@ -2216,55 +2205,6 @@ class ListTenorGifsResponse {
2216
2205
  return toReturn;
2217
2206
  }
2218
2207
  }
2219
- class MediaUploadRequest {
2220
- constructor(kwargs) {
2221
- if (!kwargs) {
2222
- return;
2223
- }
2224
- Object.assign(this, kwargs);
2225
- }
2226
- static fromProto(proto) {
2227
- let m = new MediaUploadRequest();
2228
- m = Object.assign(m, proto);
2229
- if (proto.media) {
2230
- m.media = proto.media.map(Media.fromProto);
2231
- }
2232
- return m;
2233
- }
2234
- toApiJson() {
2235
- const toReturn = {};
2236
- if (typeof this.accessToken !== 'undefined') {
2237
- toReturn['accessToken'] = this.accessToken;
2238
- }
2239
- if (typeof this.owner !== 'undefined') {
2240
- toReturn['owner'] = this.owner;
2241
- }
2242
- if (typeof this.media !== 'undefined' && this.media !== null) {
2243
- toReturn['media'] = 'toApiJson' in this.media ? this.media.toApiJson() : this.media;
2244
- }
2245
- return toReturn;
2246
- }
2247
- }
2248
- class MediaUploadResponse {
2249
- constructor(kwargs) {
2250
- if (!kwargs) {
2251
- return;
2252
- }
2253
- Object.assign(this, kwargs);
2254
- }
2255
- static fromProto(proto) {
2256
- let m = new MediaUploadResponse();
2257
- m = Object.assign(m, proto);
2258
- return m;
2259
- }
2260
- toApiJson() {
2261
- const toReturn = {};
2262
- if (typeof this.uploadUrn !== 'undefined') {
2263
- toReturn['uploadUrn'] = this.uploadUrn;
2264
- }
2265
- return toReturn;
2266
- }
2267
- }
2268
2208
  class PartnerListScheduledPostsResponse {
2269
2209
  constructor(kwargs) {
2270
2210
  if (!kwargs) {
@@ -2276,7 +2216,7 @@ class PartnerListScheduledPostsResponse {
2276
2216
  let m = new PartnerListScheduledPostsResponse();
2277
2217
  m = Object.assign(m, proto);
2278
2218
  if (proto.socialPosts) {
2279
- m.socialPosts = proto.socialPosts.map(SocialPost.fromProto);
2219
+ m.socialPosts = proto.socialPosts.map(SocialPost$1.fromProto);
2280
2220
  }
2281
2221
  return m;
2282
2222
  }
@@ -2444,7 +2384,7 @@ class RemoveFromMultilocationPostRequest {
2444
2384
  let m = new RemoveFromMultilocationPostRequest();
2445
2385
  m = Object.assign(m, proto);
2446
2386
  if (proto.reason) {
2447
- m.reason = enumStringToValue(RemoveReason, proto.reason);
2387
+ m.reason = enumStringToValue$3(RemoveReason, proto.reason);
2448
2388
  }
2449
2389
  if (proto.locations) {
2450
2390
  m.locations = proto.locations.map(Location.fromProto);
@@ -2667,7 +2607,10 @@ class SuggestMessageRequest {
2667
2607
  let m = new SuggestMessageRequest();
2668
2608
  m = Object.assign(m, proto);
2669
2609
  if (proto.length) {
2670
- m.length = enumStringToValue(PostLength, proto.length);
2610
+ m.length = enumStringToValue$3(MessageLength, proto.length);
2611
+ }
2612
+ if (proto.type) {
2613
+ m.type = enumStringToValue$3(TemplateType, proto.type);
2671
2614
  }
2672
2615
  return m;
2673
2616
  }
@@ -2682,6 +2625,9 @@ class SuggestMessageRequest {
2682
2625
  if (typeof this.length !== 'undefined') {
2683
2626
  toReturn['length'] = this.length;
2684
2627
  }
2628
+ if (typeof this.type !== 'undefined') {
2629
+ toReturn['type'] = this.type;
2630
+ }
2685
2631
  return toReturn;
2686
2632
  }
2687
2633
  }
@@ -2725,7 +2671,7 @@ class UpdatePostTemplateRequest {
2725
2671
  m.metaData = proto.metaData.map(MetaData.fromProto);
2726
2672
  }
2727
2673
  if (proto.postType) {
2728
- m.postType = enumStringToValue(PostType, proto.postType);
2674
+ m.postType = enumStringToValue$3(PostType$1, proto.postType);
2729
2675
  }
2730
2676
  return m;
2731
2677
  }
@@ -2780,74 +2726,611 @@ class UpdatePostTemplateRequest {
2780
2726
  }
2781
2727
  }
2782
2728
 
2783
- // *********************************
2784
-
2785
- const environment = (window ? window['environment'] : 'prod') ?? 'prod';
2786
- const hostMap = {
2787
- 'local': 'social-post.vendasta-local.com',
2788
- 'test': '',
2789
- 'demo': 'social-posts-demo.apigateway.co',
2790
- 'prod': 'social-posts-prod.apigateway.co',
2791
- 'production': 'social-posts-prod.apigateway.co',
2792
- };
2793
- class HostService {
2794
- get host() {
2795
- return hostMap[environment.toLowerCase()];
2796
- }
2797
- get hostWithScheme() {
2798
- return 'https://' + this.host;
2729
+ function enumStringToValue$2(enumRef, value) {
2730
+ if (typeof value === 'number') {
2731
+ return value;
2799
2732
  }
2733
+ return enumRef[value];
2800
2734
  }
2801
- HostService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: HostService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2802
- HostService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: HostService, providedIn: 'root' });
2803
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: HostService, decorators: [{
2804
- type: Injectable,
2805
- args: [{ providedIn: 'root' }]
2806
- }] });
2807
-
2808
- // *********************************
2809
- class SocialPostsApiService {
2810
- constructor(http, hostService) {
2811
- this.http = http;
2812
- this.hostService = hostService;
2813
- this._host = this.hostService.hostWithScheme;
2735
+ class Link {
2736
+ constructor(kwargs) {
2737
+ if (!kwargs) {
2738
+ return;
2739
+ }
2740
+ Object.assign(this, kwargs);
2814
2741
  }
2815
- apiOptions() {
2816
- return {
2817
- headers: new HttpHeaders({
2818
- 'Content-Type': 'application/json'
2819
- }),
2820
- withCredentials: true
2821
- };
2742
+ static fromProto(proto) {
2743
+ let m = new Link();
2744
+ m = Object.assign(m, proto);
2745
+ return m;
2822
2746
  }
2823
- list(r) {
2824
- const request = (r.toApiJson) ? r : new ListSocialPostsRequest(r);
2825
- return this.http.post(this._host + "/socialposts.v1.SocialPosts/List", request.toApiJson(), this.apiOptions())
2826
- .pipe(map(resp => ListSocialPostsResponse.fromProto(resp)));
2747
+ toApiJson() {
2748
+ const toReturn = {};
2749
+ if (typeof this.name !== 'undefined') {
2750
+ toReturn['name'] = this.name;
2751
+ }
2752
+ if (typeof this.picture !== 'undefined') {
2753
+ toReturn['picture'] = this.picture;
2754
+ }
2755
+ if (typeof this.description !== 'undefined') {
2756
+ toReturn['description'] = this.description;
2757
+ }
2758
+ if (typeof this.title !== 'undefined') {
2759
+ toReturn['title'] = this.title;
2760
+ }
2761
+ if (typeof this.url !== 'undefined') {
2762
+ toReturn['url'] = this.url;
2763
+ }
2764
+ if (typeof this.shortcode !== 'undefined') {
2765
+ toReturn['shortcode'] = this.shortcode;
2766
+ }
2767
+ return toReturn;
2827
2768
  }
2828
- deleteSocialPost(r) {
2829
- const request = (r.toApiJson) ? r : new DeleteSocialPostRequest(r);
2830
- return this.http.post(this._host + "/socialposts.v1.SocialPosts/DeleteSocialPost", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
2769
+ }
2770
+ class Metadata {
2771
+ constructor(kwargs) {
2772
+ if (!kwargs) {
2773
+ return;
2774
+ }
2775
+ Object.assign(this, kwargs);
2831
2776
  }
2832
- scheduleToAllPages(r) {
2833
- const request = (r.toApiJson) ? r : new ScheduleToAllPagesRequest(r);
2834
- return this.http.post(this._host + "/socialposts.v1.SocialPosts/ScheduleToAllPages", request.toApiJson(), this.apiOptions())
2835
- .pipe(map(resp => ScheduleToAllPagesResponse.fromProto(resp)));
2777
+ static fromProto(proto) {
2778
+ let m = new Metadata();
2779
+ m = Object.assign(m, proto);
2780
+ return m;
2836
2781
  }
2837
- schedule(r) {
2838
- const request = (r.toApiJson) ? r : new SchedulePostRequest(r);
2839
- return this.http.post(this._host + "/socialposts.v1.SocialPosts/Schedule", request.toApiJson(), this.apiOptions())
2840
- .pipe(map(resp => SchedulePostResponse.fromProto(resp)));
2782
+ toApiJson() {
2783
+ const toReturn = {};
2784
+ if (typeof this.name !== 'undefined') {
2785
+ toReturn['name'] = this.name;
2786
+ }
2787
+ if (typeof this.value !== 'undefined') {
2788
+ toReturn['value'] = this.value;
2789
+ }
2790
+ return toReturn;
2841
2791
  }
2842
- getMultiSocialPosts(r) {
2843
- const request = (r.toApiJson) ? r : new GetMultiSocialPostsRequest(r);
2844
- return this.http.post(this._host + "/socialposts.v1.SocialPosts/GetMultiSocialPosts", request.toApiJson(), this.apiOptions())
2845
- .pipe(map(resp => GetMultiSocialPostsResponse.fromProto(resp)));
2792
+ }
2793
+ class PostAction {
2794
+ constructor(kwargs) {
2795
+ if (!kwargs) {
2796
+ return;
2797
+ }
2798
+ Object.assign(this, kwargs);
2846
2799
  }
2847
- getMultiSocialPostStats(r) {
2848
- const request = (r.toApiJson) ? r : new GetMultiSocialPostStatsRequest(r);
2849
- return this.http.post(this._host + "/socialposts.v1.SocialPosts/GetMultiSocialPostStats", request.toApiJson(), this.apiOptions())
2850
- .pipe(map(resp => GetMultiSocialPostStatsResponse.fromProto(resp)));
2800
+ static fromProto(proto) {
2801
+ let m = new PostAction();
2802
+ m = Object.assign(m, proto);
2803
+ return m;
2804
+ }
2805
+ toApiJson() {
2806
+ const toReturn = {};
2807
+ if (typeof this.type !== 'undefined') {
2808
+ toReturn['type'] = this.type;
2809
+ }
2810
+ if (typeof this.linkUrl !== 'undefined') {
2811
+ toReturn['linkUrl'] = this.linkUrl;
2812
+ }
2813
+ return toReturn;
2814
+ }
2815
+ }
2816
+ class PostContent {
2817
+ constructor(kwargs) {
2818
+ if (!kwargs) {
2819
+ return;
2820
+ }
2821
+ Object.assign(this, kwargs);
2822
+ }
2823
+ static fromProto(proto) {
2824
+ let m = new PostContent();
2825
+ m = Object.assign(m, proto);
2826
+ if (proto.media) {
2827
+ m.media = proto.media.map(PostMedia.fromProto);
2828
+ }
2829
+ if (proto.link) {
2830
+ m.link = proto.link.map(Link.fromProto);
2831
+ }
2832
+ return m;
2833
+ }
2834
+ toApiJson() {
2835
+ const toReturn = {};
2836
+ if (typeof this.postText !== 'undefined') {
2837
+ toReturn['postText'] = this.postText;
2838
+ }
2839
+ if (typeof this.media !== 'undefined' && this.media !== null) {
2840
+ toReturn['media'] = 'toApiJson' in this.media ? this.media.toApiJson() : this.media;
2841
+ }
2842
+ if (typeof this.link !== 'undefined' && this.link !== null) {
2843
+ toReturn['link'] = 'toApiJson' in this.link ? this.link.toApiJson() : this.link;
2844
+ }
2845
+ return toReturn;
2846
+ }
2847
+ }
2848
+ class PostCustomization {
2849
+ constructor(kwargs) {
2850
+ if (!kwargs) {
2851
+ return;
2852
+ }
2853
+ Object.assign(this, kwargs);
2854
+ }
2855
+ static fromProto(proto) {
2856
+ let m = new PostCustomization();
2857
+ m = Object.assign(m, proto);
2858
+ if (proto.event) {
2859
+ m.event = PostEvent.fromProto(proto.event);
2860
+ }
2861
+ if (proto.action) {
2862
+ m.action = PostAction.fromProto(proto.action);
2863
+ }
2864
+ return m;
2865
+ }
2866
+ toApiJson() {
2867
+ const toReturn = {};
2868
+ if (typeof this.event !== 'undefined' && this.event !== null) {
2869
+ toReturn['event'] = 'toApiJson' in this.event ? this.event.toApiJson() : this.event;
2870
+ }
2871
+ if (typeof this.action !== 'undefined' && this.action !== null) {
2872
+ toReturn['action'] = 'toApiJson' in this.action ? this.action.toApiJson() : this.action;
2873
+ }
2874
+ return toReturn;
2875
+ }
2876
+ }
2877
+ class PostEvent {
2878
+ constructor(kwargs) {
2879
+ if (!kwargs) {
2880
+ return;
2881
+ }
2882
+ Object.assign(this, kwargs);
2883
+ }
2884
+ static fromProto(proto) {
2885
+ let m = new PostEvent();
2886
+ m = Object.assign(m, proto);
2887
+ if (proto.start) {
2888
+ m.start = new Date(proto.start);
2889
+ }
2890
+ if (proto.end) {
2891
+ m.end = new Date(proto.end);
2892
+ }
2893
+ return m;
2894
+ }
2895
+ toApiJson() {
2896
+ const toReturn = {};
2897
+ if (typeof this.title !== 'undefined') {
2898
+ toReturn['title'] = this.title;
2899
+ }
2900
+ if (typeof this.start !== 'undefined' && this.start !== null) {
2901
+ toReturn['start'] = 'toApiJson' in this.start ? this.start.toApiJson() : this.start;
2902
+ }
2903
+ if (typeof this.end !== 'undefined' && this.end !== null) {
2904
+ toReturn['end'] = 'toApiJson' in this.end ? this.end.toApiJson() : this.end;
2905
+ }
2906
+ return toReturn;
2907
+ }
2908
+ }
2909
+ class PostMedia {
2910
+ constructor(kwargs) {
2911
+ if (!kwargs) {
2912
+ return;
2913
+ }
2914
+ Object.assign(this, kwargs);
2915
+ }
2916
+ static fromProto(proto) {
2917
+ let m = new PostMedia();
2918
+ m = Object.assign(m, proto);
2919
+ if (proto.metadata) {
2920
+ m.metadata = proto.metadata.map(Metadata.fromProto);
2921
+ }
2922
+ return m;
2923
+ }
2924
+ toApiJson() {
2925
+ const toReturn = {};
2926
+ if (typeof this.mediaId !== 'undefined') {
2927
+ toReturn['mediaId'] = this.mediaId;
2928
+ }
2929
+ if (typeof this.mediaUrl !== 'undefined') {
2930
+ toReturn['mediaUrl'] = this.mediaUrl;
2931
+ }
2932
+ if (typeof this.mediaType !== 'undefined') {
2933
+ toReturn['mediaType'] = this.mediaType;
2934
+ }
2935
+ if (typeof this.containerId !== 'undefined') {
2936
+ toReturn['containerId'] = this.containerId;
2937
+ }
2938
+ if (typeof this.metadata !== 'undefined' && this.metadata !== null) {
2939
+ toReturn['metadata'] = 'toApiJson' in this.metadata ? this.metadata.toApiJson() : this.metadata;
2940
+ }
2941
+ return toReturn;
2942
+ }
2943
+ }
2944
+ class SocialPost {
2945
+ constructor(kwargs) {
2946
+ if (!kwargs) {
2947
+ return;
2948
+ }
2949
+ Object.assign(this, kwargs);
2950
+ }
2951
+ static fromProto(proto) {
2952
+ let m = new SocialPost();
2953
+ m = Object.assign(m, proto);
2954
+ if (proto.postContent) {
2955
+ m.postContent = PostContent.fromProto(proto.postContent);
2956
+ }
2957
+ if (proto.scheduled) {
2958
+ m.scheduled = new Date(proto.scheduled);
2959
+ }
2960
+ if (proto.customization) {
2961
+ m.customization = PostCustomization.fromProto(proto.customization);
2962
+ }
2963
+ if (proto.postType) {
2964
+ m.postType = enumStringToValue$2(PostType$1, proto.postType);
2965
+ }
2966
+ return m;
2967
+ }
2968
+ toApiJson() {
2969
+ const toReturn = {};
2970
+ if (typeof this.businessId !== 'undefined') {
2971
+ toReturn['businessId'] = this.businessId;
2972
+ }
2973
+ if (typeof this.socialServiceId !== 'undefined') {
2974
+ toReturn['socialServiceId'] = this.socialServiceId;
2975
+ }
2976
+ if (typeof this.postContent !== 'undefined' && this.postContent !== null) {
2977
+ toReturn['postContent'] = 'toApiJson' in this.postContent ? this.postContent.toApiJson() : this.postContent;
2978
+ }
2979
+ if (typeof this.scheduled !== 'undefined' && this.scheduled !== null) {
2980
+ toReturn['scheduled'] = 'toApiJson' in this.scheduled ? this.scheduled.toApiJson() : this.scheduled;
2981
+ }
2982
+ if (typeof this.customization !== 'undefined' && this.customization !== null) {
2983
+ toReturn['customization'] = 'toApiJson' in this.customization ? this.customization.toApiJson() : this.customization;
2984
+ }
2985
+ if (typeof this.postType !== 'undefined') {
2986
+ toReturn['postType'] = this.postType;
2987
+ }
2988
+ return toReturn;
2989
+ }
2990
+ }
2991
+
2992
+ function enumStringToValue$1(enumRef, value) {
2993
+ if (typeof value === 'number') {
2994
+ return value;
2995
+ }
2996
+ return enumRef[value];
2997
+ }
2998
+ class Media {
2999
+ constructor(kwargs) {
3000
+ if (!kwargs) {
3001
+ return;
3002
+ }
3003
+ Object.assign(this, kwargs);
3004
+ }
3005
+ static fromProto(proto) {
3006
+ let m = new Media();
3007
+ m = Object.assign(m, proto);
3008
+ if (proto.mediaType) {
3009
+ m.mediaType = enumStringToValue$1(MediaType, proto.mediaType);
3010
+ }
3011
+ return m;
3012
+ }
3013
+ toApiJson() {
3014
+ const toReturn = {};
3015
+ if (typeof this.url !== 'undefined') {
3016
+ toReturn['url'] = this.url;
3017
+ }
3018
+ if (typeof this.mediaType !== 'undefined') {
3019
+ toReturn['mediaType'] = this.mediaType;
3020
+ }
3021
+ return toReturn;
3022
+ }
3023
+ }
3024
+
3025
+ function enumStringToValue(enumRef, value) {
3026
+ if (typeof value === 'number') {
3027
+ return value;
3028
+ }
3029
+ return enumRef[value];
3030
+ }
3031
+ class CreateImageRequest {
3032
+ constructor(kwargs) {
3033
+ if (!kwargs) {
3034
+ return;
3035
+ }
3036
+ Object.assign(this, kwargs);
3037
+ }
3038
+ static fromProto(proto) {
3039
+ let m = new CreateImageRequest();
3040
+ m = Object.assign(m, proto);
3041
+ return m;
3042
+ }
3043
+ toApiJson() {
3044
+ const toReturn = {};
3045
+ if (typeof this.businessId !== 'undefined') {
3046
+ toReturn['businessId'] = this.businessId;
3047
+ }
3048
+ if (typeof this.prompt !== 'undefined') {
3049
+ toReturn['prompt'] = this.prompt;
3050
+ }
3051
+ if (typeof this.imageAmount !== 'undefined') {
3052
+ toReturn['imageAmount'] = this.imageAmount;
3053
+ }
3054
+ if (typeof this.size !== 'undefined') {
3055
+ toReturn['size'] = this.size;
3056
+ }
3057
+ if (typeof this.responseFormat !== 'undefined') {
3058
+ toReturn['responseFormat'] = this.responseFormat;
3059
+ }
3060
+ return toReturn;
3061
+ }
3062
+ }
3063
+ class CreateImageResponse {
3064
+ constructor(kwargs) {
3065
+ if (!kwargs) {
3066
+ return;
3067
+ }
3068
+ Object.assign(this, kwargs);
3069
+ }
3070
+ static fromProto(proto) {
3071
+ let m = new CreateImageResponse();
3072
+ m = Object.assign(m, proto);
3073
+ if (proto.createdId) {
3074
+ m.createdId = parseInt(proto.createdId, 10);
3075
+ }
3076
+ if (proto.generatedImages) {
3077
+ m.generatedImages = proto.generatedImages.map(ImageCreated.fromProto);
3078
+ }
3079
+ return m;
3080
+ }
3081
+ toApiJson() {
3082
+ const toReturn = {};
3083
+ if (typeof this.createdId !== 'undefined') {
3084
+ toReturn['createdId'] = this.createdId;
3085
+ }
3086
+ if (typeof this.generatedImages !== 'undefined' && this.generatedImages !== null) {
3087
+ toReturn['generatedImages'] = 'toApiJson' in this.generatedImages ? this.generatedImages.toApiJson() : this.generatedImages;
3088
+ }
3089
+ return toReturn;
3090
+ }
3091
+ }
3092
+ class DeletePostRequest {
3093
+ constructor(kwargs) {
3094
+ if (!kwargs) {
3095
+ return;
3096
+ }
3097
+ Object.assign(this, kwargs);
3098
+ }
3099
+ static fromProto(proto) {
3100
+ let m = new DeletePostRequest();
3101
+ m = Object.assign(m, proto);
3102
+ return m;
3103
+ }
3104
+ toApiJson() {
3105
+ const toReturn = {};
3106
+ if (typeof this.accessToken !== 'undefined') {
3107
+ toReturn['accessToken'] = this.accessToken;
3108
+ }
3109
+ if (typeof this.postId !== 'undefined') {
3110
+ toReturn['postId'] = this.postId;
3111
+ }
3112
+ return toReturn;
3113
+ }
3114
+ }
3115
+ class ImageCreated {
3116
+ constructor(kwargs) {
3117
+ if (!kwargs) {
3118
+ return;
3119
+ }
3120
+ Object.assign(this, kwargs);
3121
+ }
3122
+ static fromProto(proto) {
3123
+ let m = new ImageCreated();
3124
+ m = Object.assign(m, proto);
3125
+ return m;
3126
+ }
3127
+ toApiJson() {
3128
+ const toReturn = {};
3129
+ if (typeof this.url !== 'undefined') {
3130
+ toReturn['url'] = this.url;
3131
+ }
3132
+ if (typeof this.b64Json !== 'undefined') {
3133
+ toReturn['b64Json'] = this.b64Json;
3134
+ }
3135
+ return toReturn;
3136
+ }
3137
+ }
3138
+ class MediaUploadRequest {
3139
+ constructor(kwargs) {
3140
+ if (!kwargs) {
3141
+ return;
3142
+ }
3143
+ Object.assign(this, kwargs);
3144
+ }
3145
+ static fromProto(proto) {
3146
+ let m = new MediaUploadRequest();
3147
+ m = Object.assign(m, proto);
3148
+ if (proto.media) {
3149
+ m.media = proto.media.map(Media.fromProto);
3150
+ }
3151
+ return m;
3152
+ }
3153
+ toApiJson() {
3154
+ const toReturn = {};
3155
+ if (typeof this.accessToken !== 'undefined') {
3156
+ toReturn['accessToken'] = this.accessToken;
3157
+ }
3158
+ if (typeof this.owner !== 'undefined') {
3159
+ toReturn['owner'] = this.owner;
3160
+ }
3161
+ if (typeof this.media !== 'undefined' && this.media !== null) {
3162
+ toReturn['media'] = 'toApiJson' in this.media ? this.media.toApiJson() : this.media;
3163
+ }
3164
+ return toReturn;
3165
+ }
3166
+ }
3167
+ class MediaUploadResponse {
3168
+ constructor(kwargs) {
3169
+ if (!kwargs) {
3170
+ return;
3171
+ }
3172
+ Object.assign(this, kwargs);
3173
+ }
3174
+ static fromProto(proto) {
3175
+ let m = new MediaUploadResponse();
3176
+ m = Object.assign(m, proto);
3177
+ return m;
3178
+ }
3179
+ toApiJson() {
3180
+ const toReturn = {};
3181
+ if (typeof this.uploadUrn !== 'undefined') {
3182
+ toReturn['uploadUrn'] = this.uploadUrn;
3183
+ }
3184
+ return toReturn;
3185
+ }
3186
+ }
3187
+ class SocialPostOutput {
3188
+ constructor(kwargs) {
3189
+ if (!kwargs) {
3190
+ return;
3191
+ }
3192
+ Object.assign(this, kwargs);
3193
+ }
3194
+ static fromProto(proto) {
3195
+ let m = new SocialPostOutput();
3196
+ m = Object.assign(m, proto);
3197
+ if (proto.socialPost) {
3198
+ m.socialPost = SocialPost.fromProto(proto.socialPost);
3199
+ }
3200
+ if (proto.metadata) {
3201
+ m.metadata = proto.metadata.map(Metadata.fromProto);
3202
+ }
3203
+ return m;
3204
+ }
3205
+ toApiJson() {
3206
+ const toReturn = {};
3207
+ if (typeof this.internalPostId !== 'undefined') {
3208
+ toReturn['internalPostId'] = this.internalPostId;
3209
+ }
3210
+ if (typeof this.socialPost !== 'undefined' && this.socialPost !== null) {
3211
+ toReturn['socialPost'] = 'toApiJson' in this.socialPost ? this.socialPost.toApiJson() : this.socialPost;
3212
+ }
3213
+ if (typeof this.metadata !== 'undefined' && this.metadata !== null) {
3214
+ toReturn['metadata'] = 'toApiJson' in this.metadata ? this.metadata.toApiJson() : this.metadata;
3215
+ }
3216
+ return toReturn;
3217
+ }
3218
+ }
3219
+ class SocialPostRequest {
3220
+ constructor(kwargs) {
3221
+ if (!kwargs) {
3222
+ return;
3223
+ }
3224
+ Object.assign(this, kwargs);
3225
+ }
3226
+ static fromProto(proto) {
3227
+ let m = new SocialPostRequest();
3228
+ m = Object.assign(m, proto);
3229
+ if (proto.socialPost) {
3230
+ m.socialPost = proto.socialPost.map(SocialPost.fromProto);
3231
+ }
3232
+ return m;
3233
+ }
3234
+ toApiJson() {
3235
+ const toReturn = {};
3236
+ if (typeof this.socialPost !== 'undefined' && this.socialPost !== null) {
3237
+ toReturn['socialPost'] = 'toApiJson' in this.socialPost ? this.socialPost.toApiJson() : this.socialPost;
3238
+ }
3239
+ return toReturn;
3240
+ }
3241
+ }
3242
+ class SocialPostResponse {
3243
+ constructor(kwargs) {
3244
+ if (!kwargs) {
3245
+ return;
3246
+ }
3247
+ Object.assign(this, kwargs);
3248
+ }
3249
+ static fromProto(proto) {
3250
+ let m = new SocialPostResponse();
3251
+ m = Object.assign(m, proto);
3252
+ if (proto.socialPost) {
3253
+ m.socialPost = proto.socialPost.map(SocialPostOutput.fromProto);
3254
+ }
3255
+ return m;
3256
+ }
3257
+ toApiJson() {
3258
+ const toReturn = {};
3259
+ if (typeof this.socialPost !== 'undefined' && this.socialPost !== null) {
3260
+ toReturn['socialPost'] = 'toApiJson' in this.socialPost ? this.socialPost.toApiJson() : this.socialPost;
3261
+ }
3262
+ return toReturn;
3263
+ }
3264
+ }
3265
+
3266
+ // *********************************
3267
+
3268
+ const environment = (window ? window['environment'] : 'prod') ?? 'prod';
3269
+ const hostMap = {
3270
+ 'local': 'social-post.vendasta-local.com',
3271
+ 'test': '',
3272
+ 'demo': 'social-posts-demo.apigateway.co',
3273
+ 'prod': 'social-posts-prod.apigateway.co',
3274
+ 'production': 'social-posts-prod.apigateway.co',
3275
+ };
3276
+ class HostService {
3277
+ get host() {
3278
+ return hostMap[environment.toLowerCase()];
3279
+ }
3280
+ get hostWithScheme() {
3281
+ return 'https://' + this.host;
3282
+ }
3283
+ }
3284
+ HostService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: HostService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3285
+ HostService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: HostService, providedIn: 'root' });
3286
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: HostService, decorators: [{
3287
+ type: Injectable,
3288
+ args: [{ providedIn: 'root' }]
3289
+ }] });
3290
+
3291
+ // *********************************
3292
+ class SocialPostsApiService {
3293
+ constructor(http, hostService) {
3294
+ this.http = http;
3295
+ this.hostService = hostService;
3296
+ this._host = this.hostService.hostWithScheme;
3297
+ }
3298
+ apiOptions() {
3299
+ return {
3300
+ headers: new HttpHeaders({
3301
+ 'Content-Type': 'application/json'
3302
+ }),
3303
+ withCredentials: true
3304
+ };
3305
+ }
3306
+ list(r) {
3307
+ const request = (r.toApiJson) ? r : new ListSocialPostsRequest(r);
3308
+ return this.http.post(this._host + "/socialposts.v1.SocialPosts/List", request.toApiJson(), this.apiOptions())
3309
+ .pipe(map(resp => ListSocialPostsResponse.fromProto(resp)));
3310
+ }
3311
+ deleteSocialPost(r) {
3312
+ const request = (r.toApiJson) ? r : new DeleteSocialPostRequest(r);
3313
+ return this.http.post(this._host + "/socialposts.v1.SocialPosts/DeleteSocialPost", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
3314
+ }
3315
+ scheduleToAllPages(r) {
3316
+ const request = (r.toApiJson) ? r : new ScheduleToAllPagesRequest(r);
3317
+ return this.http.post(this._host + "/socialposts.v1.SocialPosts/ScheduleToAllPages", request.toApiJson(), this.apiOptions())
3318
+ .pipe(map(resp => ScheduleToAllPagesResponse.fromProto(resp)));
3319
+ }
3320
+ schedule(r) {
3321
+ const request = (r.toApiJson) ? r : new SchedulePostRequest(r);
3322
+ return this.http.post(this._host + "/socialposts.v1.SocialPosts/Schedule", request.toApiJson(), this.apiOptions())
3323
+ .pipe(map(resp => SchedulePostResponse.fromProto(resp)));
3324
+ }
3325
+ getMultiSocialPosts(r) {
3326
+ const request = (r.toApiJson) ? r : new GetMultiSocialPostsRequest(r);
3327
+ return this.http.post(this._host + "/socialposts.v1.SocialPosts/GetMultiSocialPosts", request.toApiJson(), this.apiOptions())
3328
+ .pipe(map(resp => GetMultiSocialPostsResponse.fromProto(resp)));
3329
+ }
3330
+ getMultiSocialPostStats(r) {
3331
+ const request = (r.toApiJson) ? r : new GetMultiSocialPostStatsRequest(r);
3332
+ return this.http.post(this._host + "/socialposts.v1.SocialPosts/GetMultiSocialPostStats", request.toApiJson(), this.apiOptions())
3333
+ .pipe(map(resp => GetMultiSocialPostStatsResponse.fromProto(resp)));
2851
3334
  }
2852
3335
  getScheduledPostCount(r) {
2853
3336
  const request = (r.toApiJson) ? r : new GetScheduledPostCountRequest(r);
@@ -2896,8 +3379,8 @@ class SocialPostsService {
2896
3379
  const req = new GetScheduledPostCountRequest({ partnerId: partnerId, businessId: businessId, socialServiceIds: socialServiceIds });
2897
3380
  return this.socialPostsApiService.getScheduledPostCount(req);
2898
3381
  }
2899
- suggestMessage(businessId, prompt, postLength) {
2900
- const req = new SuggestMessageRequest({ businessId: businessId, prompt: prompt, length: postLength });
3382
+ suggestMessage(businessId, prompt, postLength, templateType) {
3383
+ const req = new SuggestMessageRequest({ businessId: businessId, prompt: prompt, length: postLength, type: templateType });
2901
3384
  return this.socialPostsApiService.suggestMessage(req);
2902
3385
  }
2903
3386
  }
@@ -3005,9 +3488,13 @@ class LinkedinApiService {
3005
3488
  withCredentials: true
3006
3489
  };
3007
3490
  }
3491
+ deletePost(r) {
3492
+ const request = (r.toApiJson) ? r : new DeletePostRequest(r);
3493
+ return this.http.post(this._host + "/socialposts.v2.Linkedin/DeletePost", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
3494
+ }
3008
3495
  uploadMedia(r) {
3009
3496
  const request = (r.toApiJson) ? r : new MediaUploadRequest(r);
3010
- return this.http.post(this._host + "/socialposts.v1.Linkedin/UploadMedia", request.toApiJson(), this.apiOptions())
3497
+ return this.http.post(this._host + "/socialposts.v2.Linkedin/UploadMedia", request.toApiJson(), this.apiOptions())
3011
3498
  .pipe(map(resp => MediaUploadResponse.fromProto(resp)));
3012
3499
  }
3013
3500
  }
@@ -3163,6 +3650,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.10", ngImpo
3163
3650
  args: [{ providedIn: 'root' }]
3164
3651
  }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: HostService }]; } });
3165
3652
 
3653
+ // *********************************
3654
+ class SocialPostsV2ApiService {
3655
+ constructor(http, hostService) {
3656
+ this.http = http;
3657
+ this.hostService = hostService;
3658
+ this._host = this.hostService.hostWithScheme;
3659
+ }
3660
+ apiOptions() {
3661
+ return {
3662
+ headers: new HttpHeaders({
3663
+ 'Content-Type': 'application/json'
3664
+ }),
3665
+ withCredentials: true
3666
+ };
3667
+ }
3668
+ scheduleSocialPosts(r) {
3669
+ const request = (r.toApiJson) ? r : new SocialPostRequest(r);
3670
+ return this.http.post(this._host + "/socialposts.v2.SocialPostsV2/ScheduleSocialPosts", request.toApiJson(), this.apiOptions())
3671
+ .pipe(map(resp => SocialPostResponse.fromProto(resp)));
3672
+ }
3673
+ createImages(r) {
3674
+ const request = (r.toApiJson) ? r : new CreateImageRequest(r);
3675
+ return this.http.post(this._host + "/socialposts.v2.SocialPostsV2/CreateImages", request.toApiJson(), this.apiOptions())
3676
+ .pipe(map(resp => CreateImageResponse.fromProto(resp)));
3677
+ }
3678
+ }
3679
+ SocialPostsV2ApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: SocialPostsV2ApiService, deps: [{ token: i1.HttpClient }, { token: HostService }], target: i0.ɵɵFactoryTarget.Injectable });
3680
+ SocialPostsV2ApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: SocialPostsV2ApiService, providedIn: 'root' });
3681
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: SocialPostsV2ApiService, decorators: [{
3682
+ type: Injectable,
3683
+ args: [{ providedIn: 'root' }]
3684
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: HostService }]; } });
3685
+
3166
3686
  // *********************************
3167
3687
  class TenorGifsApiService {
3168
3688
  constructor(http, hostService) {
@@ -3216,7 +3736,7 @@ class PostTemplatesService {
3216
3736
  previews: previews,
3217
3737
  options: options,
3218
3738
  videoUrl: videoUrl,
3219
- postType: postType || PostType.POST_TYPE_INVALID,
3739
+ postType: postType || PostType$1.POST_TYPE_INVALID,
3220
3740
  mediaEntries: mediaEntries,
3221
3741
  metaData: metadata,
3222
3742
  });
@@ -3235,7 +3755,7 @@ class PostTemplatesService {
3235
3755
  previews: previews,
3236
3756
  options: options,
3237
3757
  videoUrl: videoUrl,
3238
- postType: postType || PostType.POST_TYPE_INVALID,
3758
+ postType: postType || PostType$1.POST_TYPE_INVALID,
3239
3759
  mediaEntries: mediaEntries,
3240
3760
  metaData: metadata,
3241
3761
  });
@@ -3450,5 +3970,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.10", ngImpo
3450
3970
  * Generated bundle index. Do not edit.
3451
3971
  */
3452
3972
 
3453
- export { DeleteMultilocationPostRequest, FieldMask, GetMultilocationPostRequest, HashTagsService, ListMultilocationPostsForBrandRequest, Location, MultilocationPost, MultilocationPostApiService, MultilocationPostsService, PixabayImageService, PostLength, PostPerformanceApiService, PostPerformanceService, PostTemplatesService, PostingStatus, RemoveReason, SocialPostsService, TenorGifsService };
3973
+ export { DeleteMultilocationPostRequest, FieldMask, GetMultilocationPostRequest, HashTagsService, ListMultilocationPostsForBrandRequest, Location, MessageLength, MultilocationPost, MultilocationPostApiService, MultilocationPostsService, PixabayImageService, PostPerformanceApiService, PostPerformanceService, PostTemplatesService, PostingStatus, RemoveReason, SocialPostsService, TemplateType, TenorGifsService };
3454
3974
  //# sourceMappingURL=vendasta-social-posts.mjs.map