@parra/parra-js-sdk 0.3.586 → 0.3.588
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.
- package/dist/ParraAPI.d.ts +50 -17
- package/dist/ParraAPI.js +12 -2
- package/package.json +1 -1
package/dist/ParraAPI.d.ts
CHANGED
@@ -864,14 +864,22 @@ export interface UpdateArticleRequestBody {
|
|
864
864
|
title?: string;
|
865
865
|
short_title?: string | null;
|
866
866
|
slug?: string;
|
867
|
-
|
867
|
+
json_content?: ArticleContent | null;
|
868
|
+
html_content?: string | null;
|
869
|
+
text_content?: string | null;
|
870
|
+
word_count?: number;
|
871
|
+
read_time?: number;
|
868
872
|
header_image_asset_id?: string | null;
|
869
873
|
}
|
870
874
|
export interface CreateArticleRequestBody {
|
871
875
|
title?: string;
|
872
876
|
short_title?: string | null;
|
873
877
|
slug?: string;
|
874
|
-
|
878
|
+
json_content?: ArticleContent | null;
|
879
|
+
html_content?: string | null;
|
880
|
+
text_content?: string | null;
|
881
|
+
word_count?: number;
|
882
|
+
read_time?: number;
|
875
883
|
header_image_asset_id?: string | null;
|
876
884
|
}
|
877
885
|
export declare enum ArticleStatus {
|
@@ -923,13 +931,15 @@ export interface ArticleStub {
|
|
923
931
|
tenant_id: string;
|
924
932
|
title: string;
|
925
933
|
short_title?: string;
|
926
|
-
content_preview
|
934
|
+
content_preview?: string | null;
|
935
|
+
word_count?: number | null;
|
936
|
+
read_time?: number | null;
|
927
937
|
slug: string;
|
928
|
-
header_image?: ImageAssetStub;
|
938
|
+
header_image?: ImageAssetStub | null;
|
929
939
|
status: ArticleStatus;
|
930
|
-
scheduled_at?: string;
|
931
|
-
published_at?: string;
|
932
|
-
last_updated_at: string;
|
940
|
+
scheduled_at?: string | null;
|
941
|
+
published_at?: string | null;
|
942
|
+
last_updated_at: string | null;
|
933
943
|
authors: Array<CreatorUpdateSenderStub>;
|
934
944
|
reaction_options?: Array<ReactionOptionGroup>;
|
935
945
|
reactions?: Array<ReactionSummary>;
|
@@ -942,17 +952,21 @@ export interface Article {
|
|
942
952
|
tenant_id: string;
|
943
953
|
title: string;
|
944
954
|
short_title?: string;
|
945
|
-
content_preview
|
955
|
+
content_preview?: string | null;
|
956
|
+
word_count?: number | null;
|
957
|
+
read_time?: number | null;
|
946
958
|
slug: string;
|
947
|
-
header_image?: ImageAssetStub;
|
959
|
+
header_image?: ImageAssetStub | null;
|
948
960
|
status: ArticleStatus;
|
949
|
-
scheduled_at?: string;
|
950
|
-
published_at?: string;
|
951
|
-
last_updated_at: string;
|
961
|
+
scheduled_at?: string | null;
|
962
|
+
published_at?: string | null;
|
963
|
+
last_updated_at: string | null;
|
952
964
|
authors: Array<CreatorUpdateSenderStub>;
|
953
965
|
reaction_options?: Array<ReactionOptionGroup>;
|
954
966
|
reactions?: Array<ReactionSummary>;
|
955
|
-
|
967
|
+
json_content?: ArticleContent | null;
|
968
|
+
html_content?: string | null;
|
969
|
+
text_content?: string | null;
|
956
970
|
}
|
957
971
|
export interface ArticleCollectionResponse {
|
958
972
|
page: number;
|
@@ -961,6 +975,15 @@ export interface ArticleCollectionResponse {
|
|
961
975
|
total_count: number;
|
962
976
|
data: Array<ArticleStub>;
|
963
977
|
}
|
978
|
+
export interface CreateArticleAuthorRequestBody {
|
979
|
+
creator_id: string;
|
980
|
+
}
|
981
|
+
export interface ArticleAuthor {
|
982
|
+
id: string;
|
983
|
+
name: string;
|
984
|
+
avatar?: ImageAssetStub | null;
|
985
|
+
verified: boolean;
|
986
|
+
}
|
964
987
|
export interface ScheduleArticleRequestBody {
|
965
988
|
schedule_at: string;
|
966
989
|
}
|
@@ -974,7 +997,9 @@ export interface AppArticleStub {
|
|
974
997
|
short_title?: string;
|
975
998
|
slug: string;
|
976
999
|
content_preview: string;
|
977
|
-
|
1000
|
+
word_count: number;
|
1001
|
+
read_time: number;
|
1002
|
+
header_image?: ImageAssetStub | null;
|
978
1003
|
published_at: string;
|
979
1004
|
last_updated_at: string;
|
980
1005
|
authors: Array<CreatorUpdateSenderStub>;
|
@@ -1024,13 +1049,17 @@ export interface AppArticle {
|
|
1024
1049
|
short_title?: string;
|
1025
1050
|
slug: string;
|
1026
1051
|
content_preview: string;
|
1027
|
-
|
1052
|
+
word_count: number;
|
1053
|
+
read_time: number;
|
1054
|
+
header_image?: ImageAssetStub | null;
|
1028
1055
|
published_at: string;
|
1029
1056
|
last_updated_at: string;
|
1030
1057
|
authors: Array<CreatorUpdateSenderStub>;
|
1031
1058
|
reaction_options?: Array<ReactionOptionGroup>;
|
1032
1059
|
reactions?: Array<ReactionSummary>;
|
1033
|
-
|
1060
|
+
json_content: ArticleContent;
|
1061
|
+
html_content: string;
|
1062
|
+
text_content: string;
|
1034
1063
|
comments?: CommentSummary;
|
1035
1064
|
products?: Array<AppAffiliateProduct>;
|
1036
1065
|
sponsors?: Array<AppSponsor>;
|
@@ -6690,13 +6719,17 @@ declare class ParraAPI {
|
|
6690
6719
|
getArticleById: (tenant_id: string, article_id: string, options?: Options) => Promise<Article>;
|
6691
6720
|
updateArticleById: (tenant_id: string, article_id: string, body?: UpdateArticleRequestBody, options?: Options) => Promise<Article>;
|
6692
6721
|
deleteArticleById: (tenant_id: string, article_id: string, options?: Options) => Promise<Response>;
|
6722
|
+
addAuthorToArticle: (tenant_id: string, article_id: string, body: CreateArticleAuthorRequestBody, options?: Options) => Promise<ArticleAuthor>;
|
6723
|
+
removeAuthorFromArticle: (tenant_id: string, article_id: string, author_id: string, options?: Options) => Promise<Response>;
|
6693
6724
|
publishArticleById: (tenant_id: string, article_id: string, options?: Options) => Promise<Article>;
|
6694
6725
|
scheduleArticleById: (tenant_id: string, article_id: string, body: ScheduleArticleRequestBody, options?: Options) => Promise<Article>;
|
6695
6726
|
paginateAppArticles: (tenant_id: string, query?: {
|
6696
6727
|
limit?: number;
|
6697
6728
|
offset?: number;
|
6698
6729
|
}, options?: Options) => Promise<AppArticleCollectionResponse>;
|
6699
|
-
getAppArticleById: (tenant_id: string, article_id: string,
|
6730
|
+
getAppArticleById: (tenant_id: string, article_id: string, query?: {
|
6731
|
+
include?: string;
|
6732
|
+
}, options?: Options) => Promise<AppArticle>;
|
6700
6733
|
createDesignSystem: (tenant_id: string, body: CreateDesignSystemRequestBody, options?: Options) => Promise<DesignSystem>;
|
6701
6734
|
listDesignSystems: (tenant_id: string, options?: Options) => Promise<Array<DesignSystem>>;
|
6702
6735
|
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 = {}; }
|