anixapi 0.2.1
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/LICENSE +339 -0
- package/README.md +165 -0
- package/dist/api/auth.d.ts +129 -0
- package/dist/api/auth.js +156 -0
- package/dist/api/bookmarks/export.d.ts +19 -0
- package/dist/api/bookmarks/export.js +24 -0
- package/dist/api/bookmarks/import.d.ts +29 -0
- package/dist/api/bookmarks/import.js +36 -0
- package/dist/api/bookmarks/index.d.ts +2 -0
- package/dist/api/bookmarks/index.js +18 -0
- package/dist/api/channel/article.d.ts +119 -0
- package/dist/api/channel/article.js +144 -0
- package/dist/api/channel/articleComment.d.ts +119 -0
- package/dist/api/channel/articleComment.js +144 -0
- package/dist/api/channel/articleSuggestion.d.ts +69 -0
- package/dist/api/channel/articleSuggestion.js +84 -0
- package/dist/api/channel/channel.d.ts +249 -0
- package/dist/api/channel/channel.js +300 -0
- package/dist/api/channel/index.d.ts +4 -0
- package/dist/api/channel/index.js +20 -0
- package/dist/api/collection/collection.d.ts +59 -0
- package/dist/api/collection/collection.js +72 -0
- package/dist/api/collection/collectionComment.d.ts +109 -0
- package/dist/api/collection/collectionComment.js +132 -0
- package/dist/api/collection/collectionFavorite.d.ts +39 -0
- package/dist/api/collection/collectionFavorite.js +48 -0
- package/dist/api/collection/collectionMy.d.ts +69 -0
- package/dist/api/collection/collectionMy.js +84 -0
- package/dist/api/collection/index.d.ts +4 -0
- package/dist/api/collection/index.js +20 -0
- package/dist/api/config.d.ts +29 -0
- package/dist/api/config.js +36 -0
- package/dist/api/discover.d.ts +59 -0
- package/dist/api/discover.js +72 -0
- package/dist/api/feed.d.ts +39 -0
- package/dist/api/feed.js +48 -0
- package/dist/api/index.d.ts +12 -0
- package/dist/api/index.js +28 -0
- package/dist/api/notification/index.d.ts +2 -0
- package/dist/api/notification/index.js +18 -0
- package/dist/api/notification/notification.d.ts +199 -0
- package/dist/api/notification/notification.js +240 -0
- package/dist/api/notification/notificationPreference.d.ts +159 -0
- package/dist/api/notification/notificationPreference.js +192 -0
- package/dist/api/profile/index.d.ts +10 -0
- package/dist/api/profile/index.js +26 -0
- package/dist/api/profile/profile.d.ts +65 -0
- package/dist/api/profile/profile.js +80 -0
- package/dist/api/profile/profileBadge.d.ts +39 -0
- package/dist/api/profile/profileBadge.js +48 -0
- package/dist/api/profile/profileBlockList.d.ts +39 -0
- package/dist/api/profile/profileBlockList.js +48 -0
- package/dist/api/profile/profileDeletion.d.ts +39 -0
- package/dist/api/profile/profileDeletion.js +48 -0
- package/dist/api/profile/profileFriend.d.ts +99 -0
- package/dist/api/profile/profileFriend.js +120 -0
- package/dist/api/profile/profileHealth.d.ts +59 -0
- package/dist/api/profile/profileHealth.js +72 -0
- package/dist/api/profile/profileList.d.ts +49 -0
- package/dist/api/profile/profileList.js +60 -0
- package/dist/api/profile/profilePreference.d.ts +239 -0
- package/dist/api/profile/profilePreference.js +288 -0
- package/dist/api/profile/profileReleaseVote.d.ts +39 -0
- package/dist/api/profile/profileReleaseVote.js +48 -0
- package/dist/api/profile/profileRoleList.d.ts +19 -0
- package/dist/api/profile/profileRoleList.js +24 -0
- package/dist/api/release/episode.d.ts +99 -0
- package/dist/api/release/episode.js +120 -0
- package/dist/api/release/favorite.d.ts +39 -0
- package/dist/api/release/favorite.js +48 -0
- package/dist/api/release/filter.d.ts +19 -0
- package/dist/api/release/filter.js +24 -0
- package/dist/api/release/history.d.ts +39 -0
- package/dist/api/release/history.js +48 -0
- package/dist/api/release/index.d.ts +13 -0
- package/dist/api/release/index.js +29 -0
- package/dist/api/release/related.d.ts +19 -0
- package/dist/api/release/related.js +24 -0
- package/dist/api/release/release.d.ts +79 -0
- package/dist/api/release/release.js +96 -0
- package/dist/api/release/releaseComment.d.ts +109 -0
- package/dist/api/release/releaseComment.js +132 -0
- package/dist/api/release/releaseStreamingPlatform.d.ts +19 -0
- package/dist/api/release/releaseStreamingPlatform.js +24 -0
- package/dist/api/release/releaseVideo.d.ts +59 -0
- package/dist/api/release/releaseVideo.js +72 -0
- package/dist/api/release/releaseVideoAppeal.d.ts +49 -0
- package/dist/api/release/releaseVideoAppeal.js +60 -0
- package/dist/api/release/releaseVideoFavorite.d.ts +39 -0
- package/dist/api/release/releaseVideoFavorite.js +48 -0
- package/dist/api/release/schedule.d.ts +19 -0
- package/dist/api/release/schedule.js +24 -0
- package/dist/api/release/type.d.ts +39 -0
- package/dist/api/release/type.js +48 -0
- package/dist/api/report.d.ts +189 -0
- package/dist/api/report.js +228 -0
- package/dist/api/search.d.ts +129 -0
- package/dist/api/search.js +156 -0
- package/dist/classes/Article.d.ts +18 -0
- package/dist/classes/Article.js +44 -0
- package/dist/classes/ArticleComment.d.ts +15 -0
- package/dist/classes/ArticleComment.js +37 -0
- package/dist/classes/BaseArticle.d.ts +21 -0
- package/dist/classes/BaseArticle.js +23 -0
- package/dist/classes/BaseComment.d.ts +22 -0
- package/dist/classes/BaseComment.js +25 -0
- package/dist/classes/BaseProfile.d.ts +29 -0
- package/dist/classes/BaseProfile.js +52 -0
- package/dist/classes/Channel.d.ts +47 -0
- package/dist/classes/Channel.js +108 -0
- package/dist/classes/Collection.d.ts +29 -0
- package/dist/classes/Collection.js +58 -0
- package/dist/classes/Dubber.d.ts +19 -0
- package/dist/classes/Dubber.js +24 -0
- package/dist/classes/Episode.d.ts +20 -0
- package/dist/classes/Episode.js +30 -0
- package/dist/classes/FullProfile.d.ts +70 -0
- package/dist/classes/FullProfile.js +92 -0
- package/dist/classes/Release.d.ts +91 -0
- package/dist/classes/Release.js +150 -0
- package/dist/classes/ReleaseComment.d.ts +16 -0
- package/dist/classes/ReleaseComment.js +45 -0
- package/dist/classes/Source.d.ts +15 -0
- package/dist/classes/Source.js +20 -0
- package/dist/classes/SuggestionArticle.d.ts +14 -0
- package/dist/classes/SuggestionArticle.js +30 -0
- package/dist/client.d.ts +49 -0
- package/dist/client.js +183 -0
- package/dist/endpoints.d.ts +63 -0
- package/dist/endpoints.js +67 -0
- package/dist/errors.d.ts +37 -0
- package/dist/errors.js +122 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +23 -0
- package/dist/types/auth.d.ts +127 -0
- package/dist/types/auth.js +47 -0
- package/dist/types/channel.d.ts +350 -0
- package/dist/types/channel.js +104 -0
- package/dist/types/collection.d.ts +105 -0
- package/dist/types/collection.js +44 -0
- package/dist/types/config.d.ts +41 -0
- package/dist/types/config.js +4 -0
- package/dist/types/index.d.ts +13 -0
- package/dist/types/index.js +26 -0
- package/dist/types/notification.d.ts +81 -0
- package/dist/types/notification.js +2 -0
- package/dist/types/profile.d.ts +339 -0
- package/dist/types/profile.js +46 -0
- package/dist/types/release.d.ts +467 -0
- package/dist/types/release.js +39 -0
- package/dist/types/request.d.ts +138 -0
- package/dist/types/request.js +2 -0
- package/dist/types/response.d.ts +104 -0
- package/dist/types/response.js +35 -0
- package/dist/types/settings.d.ts +119 -0
- package/dist/types/settings.js +48 -0
- package/dist/utils/ArticleBuilder.d.ts +38 -0
- package/dist/utils/ArticleBuilder.js +144 -0
- package/dist/utils/LinkParser.d.ts +253 -0
- package/dist/utils/LinkParser.js +253 -0
- package/dist/utils/Utils.d.ts +3 -0
- package/dist/utils/Utils.js +11 -0
- package/docs/DOCUMENTATION.md +290 -0
- package/package.json +55 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArticleComment = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Класс с эндпоинтами комментариев к записям
|
|
6
|
+
*/
|
|
7
|
+
class ArticleComment {
|
|
8
|
+
constructor(client) {
|
|
9
|
+
this.client = client;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* POST article/comment/add/{articleId}
|
|
13
|
+
*
|
|
14
|
+
* Возможные коды ответа: {@link CommentAddResult}
|
|
15
|
+
* @returns {@link IArticleCommentResponce}
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* const result = await client.endpoints.articleComment.add(1, ...);
|
|
19
|
+
*/
|
|
20
|
+
async add(articleId, body, options) {
|
|
21
|
+
return await this.client.call({ path: `/article/comment/add/${articleId}`, method: 'POST', json: body, ...options });
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* GET article/comment/{articleId}
|
|
25
|
+
*
|
|
26
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
27
|
+
* @returns {@link IArticleComment}
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* const result = await client.endpoints.articleComment.comment(1, ...);
|
|
31
|
+
*/
|
|
32
|
+
async comment(articleId, options) {
|
|
33
|
+
return await this.client.call({ path: `/article/comment/${articleId}`, ...options });
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* GET article/comment/all/{a_id}/{page}
|
|
37
|
+
*
|
|
38
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
39
|
+
* @returns {@link IPageableResponse}
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* const result = await client.endpoints.articleComment.comments(1, 1, ...);
|
|
43
|
+
*/
|
|
44
|
+
async comments(articleId, page, query, options) {
|
|
45
|
+
return await this.client.call({ path: `/article/comment/all/${articleId}/${page}`, queryParams: query, ...options });
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* GET article/comment/all/{a_id}/popular
|
|
49
|
+
*
|
|
50
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
51
|
+
* @returns {@link IPageableResponse}
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* const result = await client.endpoints.articleComment.commentsPopular(1, ...);
|
|
55
|
+
*/
|
|
56
|
+
async commentsPopular(articleId, options) {
|
|
57
|
+
return await this.client.call({ path: `/article/comment/all/${articleId}/popular`, ...options });
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* GET article/comment/delete/{commentId}
|
|
61
|
+
*
|
|
62
|
+
* Возможные коды ответа: {@link CommentDeleteResult}
|
|
63
|
+
* @returns {@link IResponse}
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* const result = await client.endpoints.articleComment.delete(1, ...);
|
|
67
|
+
*/
|
|
68
|
+
async delete(commentId, options) {
|
|
69
|
+
return await this.client.call({ path: `/article/comment/delete/${commentId}`, ...options });
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* POST article/comment/edit/{commentId}
|
|
73
|
+
*
|
|
74
|
+
* Возможные коды ответа: {@link CommentEditResult}
|
|
75
|
+
* @returns {@link IResponse}
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* const result = await client.endpoints.articleComment.edit(1, ...);
|
|
79
|
+
*/
|
|
80
|
+
async edit(commentId, body, options) {
|
|
81
|
+
return await this.client.call({ path: `/article/comment/edit/${commentId}`, method: 'POST', json: body, ...options });
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* POST article/comment/process/{commentId}
|
|
85
|
+
*
|
|
86
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
87
|
+
* @returns {@link IResponse}
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* const result = await client.endpoints.articleComment.process(1, ...);
|
|
91
|
+
*/
|
|
92
|
+
async process(commentId, body, options) {
|
|
93
|
+
return await this.client.call({ path: `/article/comment/process/${commentId}`, method: 'POST', json: body, ...options });
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* GET article/comment/all/profile/{p_id}/{page}
|
|
97
|
+
*
|
|
98
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
99
|
+
* @returns {@link IPageableResponse}
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* const result = await client.endpoints.articleComment.profileComments(1, 1, ...);
|
|
103
|
+
*/
|
|
104
|
+
async profileComments(profileId, page, query, options) {
|
|
105
|
+
return await this.client.call({ path: `/article/comment/all/profile/${profileId}/${page}`, queryParams: query, ...options });
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* POST article/comment/replies/{commentId}/{page}
|
|
109
|
+
*
|
|
110
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
111
|
+
* @returns {@link IPageableResponse}
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* const result = await client.endpoints.articleComment.replies(1, 1, ...);
|
|
115
|
+
*/
|
|
116
|
+
async replies(commentId, page, query, options) {
|
|
117
|
+
return await this.client.call({ path: `/article/comment/replies/${commentId}/${page}`, method: 'POST', queryParams: query, ...options });
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* GET article/comment/vote/{commentId}/{vote}
|
|
121
|
+
*
|
|
122
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
123
|
+
* @returns {@link IResponse}
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* const result = await client.endpoints.articleComment.vote(1, 1, ...);
|
|
127
|
+
*/
|
|
128
|
+
async vote(commentId, vote, options) {
|
|
129
|
+
return await this.client.call({ path: `/article/comment/vote/${commentId}/${vote}`, ...options });
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* POST article/comment/votes/{commentId}/{page}
|
|
133
|
+
*
|
|
134
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
135
|
+
* @returns {@link IPageableResponse}
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* const result = await client.endpoints.articleComment.votes(1, 1, ...);
|
|
139
|
+
*/
|
|
140
|
+
async votes(commentId, page, query, options) {
|
|
141
|
+
return await this.client.call({ path: `/article/comment/votes/${commentId}/${page}`, method: 'POST', queryParams: query, ...options });
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
exports.ArticleComment = ArticleComment;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Anixart } from "../../client";
|
|
2
|
+
import { IArticle, IArticleCreateResponse, IArticleResponse, IArticleSuggestionCreateRequest, IArticleSuggestionDeleteResponse, IArticleSuggestionsFilterRequest, IBaseApiParams, IPageableResponse } from "../../types";
|
|
3
|
+
/**
|
|
4
|
+
* Класс с эндпоинтами предложений записей
|
|
5
|
+
*/
|
|
6
|
+
export declare class ArticleSuggestion {
|
|
7
|
+
private readonly client;
|
|
8
|
+
constructor(client: Anixart);
|
|
9
|
+
/**
|
|
10
|
+
* GET article/suggestion/{a_id}
|
|
11
|
+
*
|
|
12
|
+
* Возможные коды ответа: {@link ArticleResult}
|
|
13
|
+
* @returns {@link IArticleResponse}
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* const result = await client.endpoints.articleSuggestion.articleSuggestion(1, ...);
|
|
17
|
+
*/
|
|
18
|
+
articleSuggestion(articleSuggestionId: number, options?: IBaseApiParams): Promise<IArticleResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* POST article/suggestion/all/{page}
|
|
21
|
+
*
|
|
22
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
23
|
+
* @returns {@link IPageableResponse}
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* const result = await client.endpoints.articleSuggestion.articleSuggestions(1, ...);
|
|
27
|
+
*/
|
|
28
|
+
articleSuggestions(page: number, body: IArticleSuggestionsFilterRequest, options?: IBaseApiParams): Promise<IPageableResponse<IArticle>>;
|
|
29
|
+
/**
|
|
30
|
+
* POST article/suggestion/create/{b_id}
|
|
31
|
+
*
|
|
32
|
+
* Возможные коды ответа: {@link ArticleCreateEditResult}
|
|
33
|
+
* @returns {@link IArticleCreateResponse}
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* const result = await client.endpoints.articleSuggestion.create(1, ...);
|
|
37
|
+
*/
|
|
38
|
+
create(channelId: number, body: IArticleSuggestionCreateRequest, options?: IBaseApiParams): Promise<IArticleCreateResponse>;
|
|
39
|
+
/**
|
|
40
|
+
* POST article/suggestion/delete/{a_id}
|
|
41
|
+
*
|
|
42
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
43
|
+
* @returns {@link IArticleSuggestionDeleteResponse}
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* const result = await client.endpoints.articleSuggestion.delete(1, ...);
|
|
47
|
+
*/
|
|
48
|
+
delete(articleSuggestionId: number, options?: IBaseApiParams): Promise<IArticleSuggestionDeleteResponse>;
|
|
49
|
+
/**
|
|
50
|
+
* POST article/suggestion/edit/{a_id}
|
|
51
|
+
*
|
|
52
|
+
* Возможные коды ответа: {@link ArticleCreateEditResult}
|
|
53
|
+
* @returns {@link IArticleCreateResponse}
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* const result = await client.endpoints.articleSuggestion.edit(1, ...);
|
|
57
|
+
*/
|
|
58
|
+
edit(articleSuggestionId: number, body: IArticleSuggestionCreateRequest, options?: IBaseApiParams): Promise<IArticleCreateResponse>;
|
|
59
|
+
/**
|
|
60
|
+
* POST article/suggestion/publish/{a_id}
|
|
61
|
+
*
|
|
62
|
+
* Возможные коды ответа: {@link ArticleCreateEditResult}
|
|
63
|
+
* @returns {@link IArticleCreateResponse}
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* const result = await client.endpoints.articleSuggestion.publish(1, ...);
|
|
67
|
+
*/
|
|
68
|
+
publish(articleSuggestionId: number, query?: Record<string, string | number | boolean | undefined>, options?: IBaseApiParams): Promise<IArticleCreateResponse>;
|
|
69
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArticleSuggestion = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Класс с эндпоинтами предложений записей
|
|
6
|
+
*/
|
|
7
|
+
class ArticleSuggestion {
|
|
8
|
+
constructor(client) {
|
|
9
|
+
this.client = client;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* GET article/suggestion/{a_id}
|
|
13
|
+
*
|
|
14
|
+
* Возможные коды ответа: {@link ArticleResult}
|
|
15
|
+
* @returns {@link IArticleResponse}
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* const result = await client.endpoints.articleSuggestion.articleSuggestion(1, ...);
|
|
19
|
+
*/
|
|
20
|
+
async articleSuggestion(articleSuggestionId, options) {
|
|
21
|
+
return await this.client.call({ path: `/article/suggestion/${articleSuggestionId}`, ...options });
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* POST article/suggestion/all/{page}
|
|
25
|
+
*
|
|
26
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
27
|
+
* @returns {@link IPageableResponse}
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* const result = await client.endpoints.articleSuggestion.articleSuggestions(1, ...);
|
|
31
|
+
*/
|
|
32
|
+
async articleSuggestions(page, body, options) {
|
|
33
|
+
return await this.client.call({ path: `/article/suggestion/all/${page}`, method: 'POST', json: body, ...options });
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* POST article/suggestion/create/{b_id}
|
|
37
|
+
*
|
|
38
|
+
* Возможные коды ответа: {@link ArticleCreateEditResult}
|
|
39
|
+
* @returns {@link IArticleCreateResponse}
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* const result = await client.endpoints.articleSuggestion.create(1, ...);
|
|
43
|
+
*/
|
|
44
|
+
async create(channelId, body, options) {
|
|
45
|
+
return await this.client.call({ path: `/article/suggestion/create/${channelId}`, method: 'POST', json: body, ...options });
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* POST article/suggestion/delete/{a_id}
|
|
49
|
+
*
|
|
50
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
51
|
+
* @returns {@link IArticleSuggestionDeleteResponse}
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* const result = await client.endpoints.articleSuggestion.delete(1, ...);
|
|
55
|
+
*/
|
|
56
|
+
async delete(articleSuggestionId, options) {
|
|
57
|
+
return await this.client.call({ path: `/article/suggestion/delete/${articleSuggestionId}`, method: 'POST', ...options });
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* POST article/suggestion/edit/{a_id}
|
|
61
|
+
*
|
|
62
|
+
* Возможные коды ответа: {@link ArticleCreateEditResult}
|
|
63
|
+
* @returns {@link IArticleCreateResponse}
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* const result = await client.endpoints.articleSuggestion.edit(1, ...);
|
|
67
|
+
*/
|
|
68
|
+
async edit(articleSuggestionId, body, options) {
|
|
69
|
+
return await this.client.call({ path: `/article/suggestion/edit/${articleSuggestionId}`, method: 'POST', json: body, ...options });
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* POST article/suggestion/publish/{a_id}
|
|
73
|
+
*
|
|
74
|
+
* Возможные коды ответа: {@link ArticleCreateEditResult}
|
|
75
|
+
* @returns {@link IArticleCreateResponse}
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* const result = await client.endpoints.articleSuggestion.publish(1, ...);
|
|
79
|
+
*/
|
|
80
|
+
async publish(articleSuggestionId, query, options) {
|
|
81
|
+
return await this.client.call({ path: `/article/suggestion/publish/${articleSuggestionId}`, method: 'POST', queryParams: query, ...options });
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.ArticleSuggestion = ArticleSuggestion;
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { Anixart } from "../../client";
|
|
2
|
+
import { IArticle, IArticleMuteResponse, IBaseApiParams, IChannel, IChannelBlockInfoResponse, IChannelBlockManageRequest, IChannelCreateRequest, IChannelMediaTokenResponse, IChannelPermissionManageRequest, IChannelPermissionManageResponse, IChannelPermissionsFilterRequest, IChannelProfile, IChannelResponse, IChannelSubscribeResponse, IChannelUnsubscribeResponse, IChannelUploadCoverAvatarResponse, IChannelsFilterRequest, IPageableResponse, ISubscriptionCountResponse } from "../../types";
|
|
3
|
+
/**
|
|
4
|
+
* Класс с эндпоинтами каналов
|
|
5
|
+
*/
|
|
6
|
+
export declare class Channel {
|
|
7
|
+
private readonly client;
|
|
8
|
+
constructor(client: Anixart);
|
|
9
|
+
/**
|
|
10
|
+
* POST channel/{c_id}/article/all/{page}
|
|
11
|
+
*
|
|
12
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
13
|
+
* @returns {@link IPageableResponse}
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* const result = await client.endpoints.channel.articles(1, 1, ...);
|
|
17
|
+
*/
|
|
18
|
+
articles(channelId: number, page: number, options?: IBaseApiParams): Promise<IPageableResponse<IArticle>>;
|
|
19
|
+
/**
|
|
20
|
+
* POST channel/avatar/upload/{c_id}
|
|
21
|
+
*
|
|
22
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
23
|
+
* @returns {@link IChannelUploadCoverAvatarResponse}
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* const result = await client.endpoints.channel.avatarUpload(1, ...);
|
|
27
|
+
*/
|
|
28
|
+
avatarUpload(channelId: number, image?: Buffer, name?: string, options?: IBaseApiParams): Promise<IChannelUploadCoverAvatarResponse>;
|
|
29
|
+
/**
|
|
30
|
+
* GET channel/{c_id}/block/{p_id}
|
|
31
|
+
*
|
|
32
|
+
* Возможные коды ответа: {@link ChannelBlockResult}
|
|
33
|
+
* @returns {@link IChannelBlockInfoResponse}
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* const result = await client.endpoints.channel.block(1, 1, ...);
|
|
37
|
+
*/
|
|
38
|
+
block(channelId: number, profileId: number, options?: IBaseApiParams): Promise<IChannelBlockInfoResponse>;
|
|
39
|
+
/**
|
|
40
|
+
* POST channel/{c_id}/block/manage
|
|
41
|
+
*
|
|
42
|
+
* Возможные коды ответа: {@link ChannelBlockResult}
|
|
43
|
+
* @returns {@link IChannelBlockInfoResponse}
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* const result = await client.endpoints.channel.blockManage(1, ...);
|
|
47
|
+
*/
|
|
48
|
+
blockManage(channelId: number, body: IChannelBlockManageRequest, options?: IBaseApiParams): Promise<IChannelBlockInfoResponse>;
|
|
49
|
+
/**
|
|
50
|
+
* GET channel/{c_id}/block/all/{page}
|
|
51
|
+
*
|
|
52
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
53
|
+
* @returns {@link IPageableResponse}
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* const result = await client.endpoints.channel.blocks(1, 1, ...);
|
|
57
|
+
*/
|
|
58
|
+
blocks(channelId: number, page: number, options?: IBaseApiParams): Promise<IPageableResponse<IChannelProfile>>;
|
|
59
|
+
/**
|
|
60
|
+
* GET channel/blog/{p_id}
|
|
61
|
+
*
|
|
62
|
+
* Возможные коды ответа: {@link ChannelResult}
|
|
63
|
+
* @returns {@link IChannelResponse}
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* const result = await client.endpoints.channel.blog(1, ...);
|
|
67
|
+
*/
|
|
68
|
+
blog(profileId: number, options?: IBaseApiParams): Promise<IChannelResponse>;
|
|
69
|
+
/**
|
|
70
|
+
* GET channel/{c_id}
|
|
71
|
+
*
|
|
72
|
+
* Возможные коды ответа: {@link ChannelResult}
|
|
73
|
+
* @returns {@link IChannelResponse}
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* const result = await client.endpoints.channel.channel(1, ...);
|
|
77
|
+
*/
|
|
78
|
+
channel(channelId: number, options?: IBaseApiParams): Promise<IChannelResponse>;
|
|
79
|
+
/**
|
|
80
|
+
* POST channel/all/{page}
|
|
81
|
+
*
|
|
82
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
83
|
+
* @returns {@link IPageableResponse}
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* const result = await client.endpoints.channel.channels(1, ...);
|
|
87
|
+
*/
|
|
88
|
+
channels(page: number, body: IChannelsFilterRequest, options?: IBaseApiParams): Promise<IPageableResponse<IChannel>>;
|
|
89
|
+
/**
|
|
90
|
+
* POST channel/cover/delete/{c_id}
|
|
91
|
+
*
|
|
92
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
93
|
+
* @returns {@link IChannelUploadCoverAvatarResponse}
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* const result = await client.endpoints.channel.coverDelete(1, ...);
|
|
97
|
+
*/
|
|
98
|
+
coverDelete(channelId: number, options?: IBaseApiParams): Promise<IChannelUploadCoverAvatarResponse>;
|
|
99
|
+
/**
|
|
100
|
+
* POST channel/cover/upload/{c_id}
|
|
101
|
+
*
|
|
102
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
103
|
+
* @returns {@link IChannelUploadCoverAvatarResponse}
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* const result = await client.endpoints.channel.coverUpload(1, ...);
|
|
107
|
+
*/
|
|
108
|
+
coverUpload(channelId: number, image?: Buffer, name?: string, options?: IBaseApiParams): Promise<IChannelUploadCoverAvatarResponse>;
|
|
109
|
+
/**
|
|
110
|
+
* POST channel/create
|
|
111
|
+
*
|
|
112
|
+
* Возможные коды ответа: {@link ChannelCreateEditResult}
|
|
113
|
+
* @returns {@link IChannelResponse}
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* const result = await client.endpoints.channel.create(...);
|
|
117
|
+
*/
|
|
118
|
+
create(body: IChannelCreateRequest, options?: IBaseApiParams): Promise<IChannelResponse>;
|
|
119
|
+
/**
|
|
120
|
+
* POST channel/blog/create
|
|
121
|
+
*
|
|
122
|
+
* Возможные коды ответа: {@link BlogCreateResult}
|
|
123
|
+
* @returns {@link IChannelResponse}
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* const result = await client.endpoints.channel.createBlog(...);
|
|
127
|
+
*/
|
|
128
|
+
createBlog(options?: IBaseApiParams): Promise<IChannelResponse>;
|
|
129
|
+
/**
|
|
130
|
+
* POST channel/edit/{c_id}
|
|
131
|
+
*
|
|
132
|
+
* Возможные коды ответа: {@link ChannelCreateEditResult}
|
|
133
|
+
* @returns {@link IChannelResponse}
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* const result = await client.endpoints.channel.edit(1, ...);
|
|
137
|
+
*/
|
|
138
|
+
edit(channelId: number, body: IChannelCreateRequest, options?: IBaseApiParams): Promise<IChannelResponse>;
|
|
139
|
+
/**
|
|
140
|
+
* GET channel/{c_id}/editor/available
|
|
141
|
+
*
|
|
142
|
+
* Возможные коды ответа: {@link EditorAvaliableResult}
|
|
143
|
+
* @returns {@link IChannelMediaTokenResponse}
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* const result = await client.endpoints.channel.editorAvailable(1, ...);
|
|
147
|
+
*/
|
|
148
|
+
editorAvailable(channelId: number, query?: Record<string, string | number | boolean | undefined>, options?: IBaseApiParams): Promise<IChannelMediaTokenResponse>;
|
|
149
|
+
/**
|
|
150
|
+
* POST channel/mute/{c_id}
|
|
151
|
+
*
|
|
152
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
153
|
+
* @returns {@link IArticleMuteResponse}
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* const result = await client.endpoints.channel.mute(1, ...);
|
|
157
|
+
*/
|
|
158
|
+
mute(channelId: number, options?: IBaseApiParams): Promise<IArticleMuteResponse>;
|
|
159
|
+
/**
|
|
160
|
+
* GET channel/mute/all/{page}
|
|
161
|
+
*
|
|
162
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
163
|
+
* @returns {@link IPageableResponse}
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* const result = await client.endpoints.channel.mutes(1, ...);
|
|
167
|
+
*/
|
|
168
|
+
mutes(page: number, options?: IBaseApiParams): Promise<IPageableResponse<IChannel>>;
|
|
169
|
+
/**
|
|
170
|
+
* POST channel/{c_id}/permission/manage
|
|
171
|
+
*
|
|
172
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
173
|
+
* @returns {@link IChannelPermissionManageResponse}
|
|
174
|
+
*
|
|
175
|
+
* @example
|
|
176
|
+
* const result = await client.endpoints.channel.permissionManage(1, ...);
|
|
177
|
+
*/
|
|
178
|
+
permissionManage(channelId: number, body: IChannelPermissionManageRequest, options?: IBaseApiParams): Promise<IChannelPermissionManageResponse>;
|
|
179
|
+
/**
|
|
180
|
+
* POST channel/{c_id}/permission/all/{page}
|
|
181
|
+
*
|
|
182
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
183
|
+
* @returns {@link IPageableResponse}
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* const result = await client.endpoints.channel.permissions(1, 1, ...);
|
|
187
|
+
*/
|
|
188
|
+
permissions(channelId: number, page: number, body: IChannelPermissionsFilterRequest, options?: IBaseApiParams): Promise<IPageableResponse<IChannelProfile>>;
|
|
189
|
+
/**
|
|
190
|
+
* GET channel/recommendations/{page}
|
|
191
|
+
*
|
|
192
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
193
|
+
* @returns {@link IPageableResponse}
|
|
194
|
+
*
|
|
195
|
+
* @example
|
|
196
|
+
* const result = await client.endpoints.channel.recommendations(1, ...);
|
|
197
|
+
*/
|
|
198
|
+
recommendations(page: number, query?: Record<string, string | number | boolean | undefined>, options?: IBaseApiParams): Promise<IPageableResponse<IChannel>>;
|
|
199
|
+
/**
|
|
200
|
+
* POST channel/subscribe/{c_id}
|
|
201
|
+
*
|
|
202
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
203
|
+
* @returns {@link IChannelSubscribeResponse}
|
|
204
|
+
*
|
|
205
|
+
* @example
|
|
206
|
+
* const result = await client.endpoints.channel.subscribe(1, ...);
|
|
207
|
+
*/
|
|
208
|
+
subscribe(channelId: number, options?: IBaseApiParams): Promise<IChannelSubscribeResponse>;
|
|
209
|
+
/**
|
|
210
|
+
* GET channel/subscription/count
|
|
211
|
+
*
|
|
212
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
213
|
+
* @returns {@link ISubscriptionCountResponse}
|
|
214
|
+
*
|
|
215
|
+
* @example
|
|
216
|
+
* const result = await client.endpoints.channel.subscriptionCount(...);
|
|
217
|
+
*/
|
|
218
|
+
subscriptionCount(options?: IBaseApiParams): Promise<ISubscriptionCountResponse>;
|
|
219
|
+
/**
|
|
220
|
+
* GET channel/subscription/all/{page}
|
|
221
|
+
*
|
|
222
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
223
|
+
* @returns {@link IPageableResponse}
|
|
224
|
+
*
|
|
225
|
+
* @example
|
|
226
|
+
* const result = await client.endpoints.channel.subscriptions(1, ...);
|
|
227
|
+
*/
|
|
228
|
+
subscriptions(page: number, query?: Record<string, string | number | boolean | undefined>, options?: IBaseApiParams): Promise<IPageableResponse<IChannel>>;
|
|
229
|
+
/**
|
|
230
|
+
* POST channel/unmute/{c_id}
|
|
231
|
+
*
|
|
232
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
233
|
+
* @returns {@link IArticleMuteResponse}
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* const result = await client.endpoints.channel.unmute(1, ...);
|
|
237
|
+
*/
|
|
238
|
+
unmute(channelId: number, options?: IBaseApiParams): Promise<IArticleMuteResponse>;
|
|
239
|
+
/**
|
|
240
|
+
* POST channel/unsubscribe/{c_id}
|
|
241
|
+
*
|
|
242
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
243
|
+
* @returns {@link IChannelUnsubscribeResponse}
|
|
244
|
+
*
|
|
245
|
+
* @example
|
|
246
|
+
* const result = await client.endpoints.channel.unsubscribe(1, ...);
|
|
247
|
+
*/
|
|
248
|
+
unsubscribe(channelId: number, options?: IBaseApiParams): Promise<IChannelUnsubscribeResponse>;
|
|
249
|
+
}
|