@parra/parra-js-sdk 0.3.586 → 0.3.587

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.
@@ -923,13 +923,13 @@ export interface ArticleStub {
923
923
  tenant_id: string;
924
924
  title: string;
925
925
  short_title?: string;
926
- content_preview: string;
926
+ content_preview?: string | null;
927
927
  slug: string;
928
- header_image?: ImageAssetStub;
928
+ header_image?: ImageAssetStub | null;
929
929
  status: ArticleStatus;
930
- scheduled_at?: string;
931
- published_at?: string;
932
- last_updated_at: string;
930
+ scheduled_at?: string | null;
931
+ published_at?: string | null;
932
+ last_updated_at: string | null;
933
933
  authors: Array<CreatorUpdateSenderStub>;
934
934
  reaction_options?: Array<ReactionOptionGroup>;
935
935
  reactions?: Array<ReactionSummary>;
@@ -942,13 +942,13 @@ export interface Article {
942
942
  tenant_id: string;
943
943
  title: string;
944
944
  short_title?: string;
945
- content_preview: string;
945
+ content_preview?: string | null;
946
946
  slug: string;
947
- header_image?: ImageAssetStub;
947
+ header_image?: ImageAssetStub | null;
948
948
  status: ArticleStatus;
949
- scheduled_at?: string;
950
- published_at?: string;
951
- last_updated_at: string;
949
+ scheduled_at?: string | null;
950
+ published_at?: string | null;
951
+ last_updated_at: string | null;
952
952
  authors: Array<CreatorUpdateSenderStub>;
953
953
  reaction_options?: Array<ReactionOptionGroup>;
954
954
  reactions?: Array<ReactionSummary>;
@@ -961,6 +961,15 @@ export interface ArticleCollectionResponse {
961
961
  total_count: number;
962
962
  data: Array<ArticleStub>;
963
963
  }
964
+ export interface CreateArticleAuthorRequestBody {
965
+ creator_id: string;
966
+ }
967
+ export interface ArticleAuthor {
968
+ id: string;
969
+ name: string;
970
+ avatar?: ImageAssetStub | null;
971
+ verified: boolean;
972
+ }
964
973
  export interface ScheduleArticleRequestBody {
965
974
  schedule_at: string;
966
975
  }
@@ -973,8 +982,8 @@ export interface AppArticleStub {
973
982
  title: string;
974
983
  short_title?: string;
975
984
  slug: string;
976
- content_preview: string;
977
- header_image?: ImageAssetStub;
985
+ content_preview?: string | null;
986
+ header_image?: ImageAssetStub | null;
978
987
  published_at: string;
979
988
  last_updated_at: string;
980
989
  authors: Array<CreatorUpdateSenderStub>;
@@ -1023,8 +1032,8 @@ export interface AppArticle {
1023
1032
  title: string;
1024
1033
  short_title?: string;
1025
1034
  slug: string;
1026
- content_preview: string;
1027
- header_image?: ImageAssetStub;
1035
+ content_preview?: string | null;
1036
+ header_image?: ImageAssetStub | null;
1028
1037
  published_at: string;
1029
1038
  last_updated_at: string;
1030
1039
  authors: Array<CreatorUpdateSenderStub>;
@@ -6690,13 +6699,17 @@ declare class ParraAPI {
6690
6699
  getArticleById: (tenant_id: string, article_id: string, options?: Options) => Promise<Article>;
6691
6700
  updateArticleById: (tenant_id: string, article_id: string, body?: UpdateArticleRequestBody, options?: Options) => Promise<Article>;
6692
6701
  deleteArticleById: (tenant_id: string, article_id: string, options?: Options) => Promise<Response>;
6702
+ addAuthorToArticle: (tenant_id: string, article_id: string, body: CreateArticleAuthorRequestBody, options?: Options) => Promise<ArticleAuthor>;
6703
+ removeAuthorFromArticle: (tenant_id: string, article_id: string, author_id: string, options?: Options) => Promise<Response>;
6693
6704
  publishArticleById: (tenant_id: string, article_id: string, options?: Options) => Promise<Article>;
6694
6705
  scheduleArticleById: (tenant_id: string, article_id: string, body: ScheduleArticleRequestBody, options?: Options) => Promise<Article>;
6695
6706
  paginateAppArticles: (tenant_id: string, query?: {
6696
6707
  limit?: number;
6697
6708
  offset?: number;
6698
6709
  }, options?: Options) => Promise<AppArticleCollectionResponse>;
6699
- getAppArticleById: (tenant_id: string, article_id: string, options?: Options) => Promise<AppArticle>;
6710
+ getAppArticleById: (tenant_id: string, article_id: string, query?: {
6711
+ include?: string;
6712
+ }, options?: Options) => Promise<AppArticle>;
6700
6713
  createDesignSystem: (tenant_id: string, body: CreateDesignSystemRequestBody, options?: Options) => Promise<DesignSystem>;
6701
6714
  listDesignSystems: (tenant_id: string, options?: Options) => Promise<Array<DesignSystem>>;
6702
6715
  getDesignSystemJson: (tenant_id: string, design_system_id: string, options?: Options) => Promise<DesignSystem>;
package/dist/ParraAPI.js CHANGED
@@ -858,6 +858,16 @@ var ParraAPI = /** @class */ (function () {
858
858
  if (options === void 0) { options = {}; }
859
859
  return _this.http.execute(__assign({ path: "".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/articles/").concat(article_id), method: "delete" }, options));
860
860
  };
861
+ this.addAuthorToArticle = function (tenant_id, article_id, body, options) {
862
+ if (options === void 0) { options = {}; }
863
+ return _this.http.execute(__assign({ path: "".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/articles/").concat(article_id, "/authors"), method: "post", body: JSON.stringify(body), headers: {
864
+ "content-type": "application/json",
865
+ } }, options));
866
+ };
867
+ this.removeAuthorFromArticle = function (tenant_id, article_id, author_id, options) {
868
+ if (options === void 0) { options = {}; }
869
+ 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));
870
+ };
861
871
  this.publishArticleById = function (tenant_id, article_id, options) {
862
872
  if (options === void 0) { options = {}; }
863
873
  return _this.http.execute(__assign({ path: "".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/articles/").concat(article_id, "/publish"), method: "post" }, options));
@@ -872,9 +882,9 @@ var ParraAPI = /** @class */ (function () {
872
882
  if (options === void 0) { options = {}; }
873
883
  return _this.http.execute(__assign({ path: "".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/app/articles"), method: "get", query: query }, options));
874
884
  };
875
- this.getAppArticleById = function (tenant_id, article_id, options) {
885
+ this.getAppArticleById = function (tenant_id, article_id, query, options) {
876
886
  if (options === void 0) { options = {}; }
877
- return _this.http.execute(__assign({ path: "".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/app/articles/").concat(article_id), method: "get" }, options));
887
+ return _this.http.execute(__assign({ path: "".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/app/articles/").concat(article_id), method: "get", query: query }, options));
878
888
  };
879
889
  this.createDesignSystem = function (tenant_id, body, options) {
880
890
  if (options === void 0) { options = {}; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parra/parra-js-sdk",
3
- "version": "0.3.586",
3
+ "version": "0.3.587",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",