@parra/parra-js-sdk 0.3.602 → 0.3.604

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.
@@ -963,6 +963,10 @@ export interface TagStub {
963
963
  title: string;
964
964
  slug?: string | null;
965
965
  }
966
+ export interface CommentSummary {
967
+ disabled: boolean;
968
+ comment_count: number;
969
+ }
966
970
  export interface ArticleStub {
967
971
  id: string;
968
972
  created_at: string;
@@ -986,6 +990,7 @@ export interface ArticleStub {
986
990
  reaction_options?: Array<ReactionOptionGroup>;
987
991
  reactions?: Array<ReactionSummary>;
988
992
  tags?: Array<TagStub>;
993
+ comments?: CommentSummary;
989
994
  }
990
995
  export interface Article {
991
996
  id: string;
@@ -1010,6 +1015,7 @@ export interface Article {
1010
1015
  reaction_options?: Array<ReactionOptionGroup>;
1011
1016
  reactions?: Array<ReactionSummary>;
1012
1017
  tags?: Array<TagStub>;
1018
+ comments?: CommentSummary;
1013
1019
  json_content?: ArticleContent | null;
1014
1020
  html_content?: string | null;
1015
1021
  text_content?: string | null;
@@ -1032,6 +1038,40 @@ export interface ArticleAuthor {
1032
1038
  slug?: string | null;
1033
1039
  bio?: string | null;
1034
1040
  }
1041
+ export interface CreateCommentRequestBody {
1042
+ body: string;
1043
+ }
1044
+ export interface TenantUserStub {
1045
+ id: string;
1046
+ tenant_id: string;
1047
+ name?: string | null;
1048
+ avatar?: ImageAssetStub | null;
1049
+ verified?: boolean | null;
1050
+ roles?: Array<TenantUserRoleStub> | null;
1051
+ }
1052
+ export interface Comment {
1053
+ id: string;
1054
+ created_at: string;
1055
+ updated_at: string;
1056
+ deleted_at?: string | null;
1057
+ body: string;
1058
+ user_id: string;
1059
+ feed_item_id?: string;
1060
+ user: TenantUserStub;
1061
+ reactions?: Array<ReactionSummary>;
1062
+ }
1063
+ export interface CreateReactionRequestBody {
1064
+ option_id: string;
1065
+ }
1066
+ export interface Reaction {
1067
+ id: string;
1068
+ created_at: string;
1069
+ updated_at: string;
1070
+ deleted_at?: string | null;
1071
+ option_id: string;
1072
+ user_id: string;
1073
+ user: TenantUserNameStub;
1074
+ }
1035
1075
  export interface AddTagRequestBody {
1036
1076
  tag_id: string;
1037
1077
  }
@@ -1057,6 +1097,7 @@ export interface AppArticleStub {
1057
1097
  reaction_options?: Array<ReactionOptionGroup>;
1058
1098
  reactions?: Array<ReactionSummary>;
1059
1099
  tags?: Array<TagStub>;
1100
+ comments?: CommentSummary;
1060
1101
  }
1061
1102
  export interface AppArticleCollectionResponse {
1062
1103
  page: number;
@@ -1065,10 +1106,6 @@ export interface AppArticleCollectionResponse {
1065
1106
  total_count: number;
1066
1107
  data: Array<AppArticleStub>;
1067
1108
  }
1068
- export interface CommentSummary {
1069
- disabled: boolean;
1070
- comment_count: number;
1071
- }
1072
1109
  export interface Cta {
1073
1110
  url: string;
1074
1111
  title: string;
@@ -1110,10 +1147,10 @@ export interface AppArticle {
1110
1147
  reaction_options?: Array<ReactionOptionGroup>;
1111
1148
  reactions?: Array<ReactionSummary>;
1112
1149
  tags?: Array<TagStub>;
1150
+ comments?: CommentSummary;
1113
1151
  json_content: ArticleContent;
1114
1152
  html_content: string;
1115
1153
  text_content: string;
1116
- comments?: CommentSummary;
1117
1154
  products?: Array<AppAffiliateProduct>;
1118
1155
  sponsors?: Array<AppSponsor>;
1119
1156
  }
@@ -1421,14 +1458,6 @@ export interface ConsumeEntitlementRequestBody {
1421
1458
  note?: string | null;
1422
1459
  metadata?: object | null;
1423
1460
  }
1424
- export interface TenantUserStub {
1425
- id: string;
1426
- tenant_id: string;
1427
- name?: string | null;
1428
- avatar?: ImageAssetStub | null;
1429
- verified?: boolean | null;
1430
- roles?: Array<TenantUserRoleStub> | null;
1431
- }
1432
1461
  export declare enum PurchaseType {
1433
1462
  consumable = "consumable",
1434
1463
  subscription = "subscription"
@@ -1782,18 +1811,6 @@ export interface CreateMessageRequestBody {
1782
1811
  export interface FlagMessageRequestBody {
1783
1812
  reason?: string | null;
1784
1813
  }
1785
- export interface CreateReactionRequestBody {
1786
- option_id: string;
1787
- }
1788
- export interface Reaction {
1789
- id: string;
1790
- created_at: string;
1791
- updated_at: string;
1792
- deleted_at?: string | null;
1793
- option_id: string;
1794
- user_id: string;
1795
- user: TenantUserNameStub;
1796
- }
1797
1814
  export declare enum ParraTemplateType {
1798
1815
  default = "default",
1799
1816
  revenueCat = "revenue-cat",
@@ -3845,20 +3862,6 @@ export interface AppVideoCollectionResponse {
3845
3862
  total_count: number;
3846
3863
  data: Array<AppVideo>;
3847
3864
  }
3848
- export interface CreateCommentRequestBody {
3849
- body: string;
3850
- }
3851
- export interface Comment {
3852
- id: string;
3853
- created_at: string;
3854
- updated_at: string;
3855
- deleted_at?: string | null;
3856
- body: string;
3857
- user_id: string;
3858
- feed_item_id?: string;
3859
- user: TenantUserStub;
3860
- reactions?: Array<ReactionSummary>;
3861
- }
3862
3865
  export interface CommentCollectionResponse {
3863
3866
  page: number;
3864
3867
  page_count: number;
@@ -6814,6 +6817,9 @@ declare class ParraAPI {
6814
6817
  deleteArticleById: (tenant_id: string, article_id: string, options?: Options) => Promise<Response>;
6815
6818
  addAuthorToArticle: (tenant_id: string, article_id: string, body: CreateArticleAuthorRequestBody, options?: Options) => Promise<ArticleAuthor>;
6816
6819
  removeAuthorFromArticle: (tenant_id: string, article_id: string, author_id: string, options?: Options) => Promise<Response>;
6820
+ addCommentToArticle: (tenant_id: string, article_id: string, body: CreateCommentRequestBody, options?: Options) => Promise<Comment>;
6821
+ addReactionToArticle: (tenant_id: string, article_id: string, body: CreateReactionRequestBody, options?: Options) => Promise<Reaction>;
6822
+ removeReactionFromArticle: (tenant_id: string, article_id: string, reaction_id: string, options?: Options) => Promise<Response>;
6817
6823
  addTagToArticle: (tenant_id: string, article_id: string, body: AddTagRequestBody, options?: Options) => Promise<TagStub>;
6818
6824
  removeTagFromArticle: (tenant_id: string, article_id: string, tag_id: string, options?: Options) => Promise<Response>;
6819
6825
  publishArticleById: (tenant_id: string, article_id: string, options?: Options) => Promise<Article>;
@@ -7043,6 +7049,7 @@ declare class ParraAPI {
7043
7049
  created_at?: string | null;
7044
7050
  }, options?: Options) => Promise<CommentCollectionResponse>;
7045
7051
  addReactionToVideo: (tenant_id: string, video_id: string, body: CreateReactionRequestBody, options?: Options) => Promise<Reaction>;
7052
+ removeReactionFromVideo: (tenant_id: string, video_id: string, reaction_id: string, options?: Options) => Promise<Response>;
7046
7053
  addCommentToFeedItem: (tenant_id: string, feed_item_id: string, body: CreateCommentRequestBody, options?: Options) => Promise<Comment>;
7047
7054
  paginateCommentsForFeedItem: (tenant_id: string, feed_item_id: string, query?: {
7048
7055
  limit?: number;
package/dist/ParraAPI.js CHANGED
@@ -897,6 +897,22 @@ var ParraAPI = /** @class */ (function () {
897
897
  if (options === void 0) { options = {}; }
898
898
  return _this.http.execute(__assign({ path: "".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/articles/").concat(article_id, "/authors/").concat(author_id), method: "delete" }, options));
899
899
  };
900
+ this.addCommentToArticle = function (tenant_id, article_id, body, options) {
901
+ if (options === void 0) { options = {}; }
902
+ return _this.http.execute(__assign({ path: "".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/articles/").concat(article_id, "/comments"), method: "post", body: JSON.stringify(body), headers: {
903
+ "content-type": "application/json",
904
+ } }, options));
905
+ };
906
+ this.addReactionToArticle = function (tenant_id, article_id, body, options) {
907
+ if (options === void 0) { options = {}; }
908
+ return _this.http.execute(__assign({ path: "".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/articles/").concat(article_id, "/reactions"), method: "post", body: JSON.stringify(body), headers: {
909
+ "content-type": "application/json",
910
+ } }, options));
911
+ };
912
+ this.removeReactionFromArticle = function (tenant_id, article_id, reaction_id, options) {
913
+ if (options === void 0) { options = {}; }
914
+ return _this.http.execute(__assign({ path: "".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/articles/").concat(article_id, "/reactions/").concat(reaction_id), method: "delete" }, options));
915
+ };
900
916
  this.addTagToArticle = function (tenant_id, article_id, body, options) {
901
917
  if (options === void 0) { options = {}; }
902
918
  return _this.http.execute(__assign({ path: "".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/articles/").concat(article_id, "/tags"), method: "post", body: JSON.stringify(body), headers: {
@@ -1675,6 +1691,10 @@ var ParraAPI = /** @class */ (function () {
1675
1691
  "content-type": "application/json",
1676
1692
  } }, options));
1677
1693
  };
1694
+ this.removeReactionFromVideo = function (tenant_id, video_id, reaction_id, options) {
1695
+ if (options === void 0) { options = {}; }
1696
+ return _this.http.execute(__assign({ path: "".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/videos/").concat(video_id, "/reactions/").concat(reaction_id), method: "delete" }, options));
1697
+ };
1678
1698
  this.addCommentToFeedItem = function (tenant_id, feed_item_id, body, options) {
1679
1699
  if (options === void 0) { options = {}; }
1680
1700
  return _this.http.execute(__assign({ path: "".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/feed/items/").concat(feed_item_id, "/comments"), method: "post", body: JSON.stringify(body), headers: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parra/parra-js-sdk",
3
- "version": "0.3.602",
3
+ "version": "0.3.604",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",