@vendasta/social-posts 5.3.0 → 5.5.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.
@@ -421,6 +421,11 @@ var SocialPostDeletionStatus;
421
421
  SocialPostDeletionStatus[SocialPostDeletionStatus["FAILED"] = 1] = "FAILED";
422
422
  SocialPostDeletionStatus[SocialPostDeletionStatus["IN_PROGRESS"] = 2] = "IN_PROGRESS";
423
423
  })(SocialPostDeletionStatus || (SocialPostDeletionStatus = {}));
424
+ var PostLength;
425
+ (function (PostLength) {
426
+ PostLength[PostLength["SHORT_FORM"] = 0] = "SHORT_FORM";
427
+ PostLength[PostLength["LONG_FORM"] = 1] = "LONG_FORM";
428
+ })(PostLength || (PostLength = {}));
424
429
  var PostingStatus;
425
430
  (function (PostingStatus) {
426
431
  PostingStatus[PostingStatus["POSTING_IN_PROGRESS"] = 0] = "POSTING_IN_PROGRESS";
@@ -2123,9 +2128,6 @@ class PostData {
2123
2128
  if (proto.reach) {
2124
2129
  m.reach = parseInt(proto.reach, 10);
2125
2130
  }
2126
- if (proto.engagement) {
2127
- m.engagement = parseInt(proto.engagement, 10);
2128
- }
2129
2131
  if (proto.views) {
2130
2132
  m.views = parseInt(proto.views, 10);
2131
2133
  }
@@ -2443,6 +2445,55 @@ class SearchHashtagResponse {
2443
2445
  return toReturn;
2444
2446
  }
2445
2447
  }
2448
+ class SuggestMessageRequest {
2449
+ constructor(kwargs) {
2450
+ if (!kwargs) {
2451
+ return;
2452
+ }
2453
+ Object.assign(this, kwargs);
2454
+ }
2455
+ static fromProto(proto) {
2456
+ let m = new SuggestMessageRequest();
2457
+ m = Object.assign(m, proto);
2458
+ if (proto.length) {
2459
+ m.length = enumStringToValue(PostLength, proto.length);
2460
+ }
2461
+ return m;
2462
+ }
2463
+ toApiJson() {
2464
+ const toReturn = {};
2465
+ if (typeof this.prompt !== 'undefined') {
2466
+ toReturn['prompt'] = this.prompt;
2467
+ }
2468
+ if (typeof this.businessId !== 'undefined') {
2469
+ toReturn['businessId'] = this.businessId;
2470
+ }
2471
+ if (typeof this.length !== 'undefined') {
2472
+ toReturn['length'] = this.length;
2473
+ }
2474
+ return toReturn;
2475
+ }
2476
+ }
2477
+ class SuggestMessageResponse {
2478
+ constructor(kwargs) {
2479
+ if (!kwargs) {
2480
+ return;
2481
+ }
2482
+ Object.assign(this, kwargs);
2483
+ }
2484
+ static fromProto(proto) {
2485
+ let m = new SuggestMessageResponse();
2486
+ m = Object.assign(m, proto);
2487
+ return m;
2488
+ }
2489
+ toApiJson() {
2490
+ const toReturn = {};
2491
+ if (typeof this.message !== 'undefined') {
2492
+ toReturn['message'] = this.message;
2493
+ }
2494
+ return toReturn;
2495
+ }
2496
+ }
2446
2497
  class UpdatePostTemplateRequest {
2447
2498
  constructor(kwargs) {
2448
2499
  if (!kwargs) {
@@ -2574,6 +2625,11 @@ class SocialPostsApiService {
2574
2625
  return this.http.post(this._host + "/socialposts.v1.SocialPosts/GetScheduledPostCount", request.toApiJson(), this.apiOptions())
2575
2626
  .pipe(map(resp => GetScheduledPostCountResponse.fromProto(resp)));
2576
2627
  }
2628
+ suggestMessage(r) {
2629
+ const request = (r.toApiJson) ? r : new SuggestMessageRequest(r);
2630
+ return this.http.post(this._host + "/socialposts.v1.SocialPosts/SuggestMessage", request.toApiJson(), this.apiOptions())
2631
+ .pipe(map(resp => SuggestMessageResponse.fromProto(resp)));
2632
+ }
2577
2633
  }
2578
2634
  SocialPostsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: SocialPostsApiService, deps: [{ token: i1.HttpClient }, { token: HostService }], target: i0.ɵɵFactoryTarget.Injectable });
2579
2635
  SocialPostsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: SocialPostsApiService, providedIn: 'root' });
@@ -2611,6 +2667,10 @@ class SocialPostsService {
2611
2667
  const req = new GetScheduledPostCountRequest({ partnerId: partnerId, businessId: businessId, socialServiceIds: socialServiceIds });
2612
2668
  return this.socialPostsApiService.getScheduledPostCount(req);
2613
2669
  }
2670
+ suggestMessage(businessId, prompt, postLength) {
2671
+ const req = new SuggestMessageRequest({ businessId: businessId, prompt: prompt, length: postLength });
2672
+ return this.socialPostsApiService.suggestMessage(req);
2673
+ }
2614
2674
  }
2615
2675
  SocialPostsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: SocialPostsService, deps: [{ token: SocialPostsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
2616
2676
  SocialPostsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: SocialPostsService, providedIn: 'root' });
@@ -3123,13 +3183,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.10", ngImpo
3123
3183
 
3124
3184
  // *********************************
3125
3185
 
3126
- /*
3127
- * Public API Surface of social-posts
3128
- */
3129
-
3130
3186
  /**
3131
3187
  * Generated bundle index. Do not edit.
3132
3188
  */
3133
3189
 
3134
- export { DeleteMultilocationPostRequest, FieldMask, GetMultilocationPostRequest, HashTagsService, ListMultilocationPostsForBrandRequest, Location, MultilocationPost, MultilocationPostApiService, MultilocationPostsService, PixabayImageService, PostPerformanceApiService, PostPerformanceService, PostTemplatesService, PostingStatus, RemoveReason, SocialPostsService, TenorGifsService };
3190
+ export { DeleteMultilocationPostRequest, FieldMask, GetMultilocationPostRequest, HashTagsService, ListMultilocationPostsForBrandRequest, Location, MultilocationPost, MultilocationPostApiService, MultilocationPostsService, PixabayImageService, PostLength, PostPerformanceApiService, PostPerformanceService, PostTemplatesService, PostingStatus, RemoveReason, SocialPostsService, TenorGifsService };
3135
3191
  //# sourceMappingURL=vendasta-social-posts.mjs.map