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
package/dist/api/auth.js
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Auth = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Класс с эндпоинтами авторизации
|
|
6
|
+
*/
|
|
7
|
+
class Auth {
|
|
8
|
+
constructor(client) {
|
|
9
|
+
this.client = client;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* POST auth/firebase
|
|
13
|
+
*
|
|
14
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
15
|
+
* @returns {@link IResponse}
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* const result = await client.endpoints.auth.firebase(...);
|
|
19
|
+
*/
|
|
20
|
+
async firebase(options) {
|
|
21
|
+
return await this.client.call({ path: `/auth/firebase`, method: 'POST', ...options });
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* POST auth/resend
|
|
25
|
+
*
|
|
26
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
27
|
+
* @returns {@link IRegisterResponse}
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* const result = await client.endpoints.auth.resend(...);
|
|
31
|
+
*/
|
|
32
|
+
async resend(data, options) {
|
|
33
|
+
return await this.client.call({ path: `/auth/resend`, method: 'POST', urlEncoded: data, ...options });
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* POST auth/restore
|
|
37
|
+
*
|
|
38
|
+
* Возможные коды ответа: {@link RestorePasswordResult}
|
|
39
|
+
* @returns {@link IRegisterResponse}
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* const result = await client.endpoints.auth.restore(...);
|
|
43
|
+
*/
|
|
44
|
+
async restore(data, options) {
|
|
45
|
+
return await this.client.call({ path: `/auth/restore`, method: 'POST', urlEncoded: data, ...options });
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* POST auth/restore/resend
|
|
49
|
+
*
|
|
50
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
51
|
+
* @returns {@link IRegisterResponse}
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* const result = await client.endpoints.auth.restoreResend(...);
|
|
55
|
+
*/
|
|
56
|
+
async restoreResend(data, options) {
|
|
57
|
+
return await this.client.call({ path: `/auth/restore/resend`, method: 'POST', urlEncoded: data, ...options });
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* POST auth/restore/verify
|
|
61
|
+
*
|
|
62
|
+
* Возможные коды ответа: {@link RestorePasswordVerifyResult}
|
|
63
|
+
* @returns {@link IResponse}
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* const result = await client.endpoints.auth.restoreVerify(...);
|
|
67
|
+
*/
|
|
68
|
+
async restoreVerify(data, options) {
|
|
69
|
+
return await this.client.call({ path: `/auth/restore/verify`, method: 'POST', urlEncoded: data, ...options });
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* POST auth/signIn
|
|
73
|
+
*
|
|
74
|
+
* Возможные коды ответа: {@link LoginResult}
|
|
75
|
+
* @returns {@link ILoginResponse}
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* const result = await client.endpoints.auth.signIn(...);
|
|
79
|
+
*/
|
|
80
|
+
async signIn(data, options) {
|
|
81
|
+
return await this.client.call({ path: `/auth/signIn`, method: 'POST', urlEncoded: data, ...options });
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* POST auth/google
|
|
85
|
+
*
|
|
86
|
+
* Возможные коды ответа: {@link LoginResult}
|
|
87
|
+
* @returns {@link ILoginResponse}
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* const result = await client.endpoints.auth.signInWithGoogle(...);
|
|
91
|
+
*/
|
|
92
|
+
async signInWithGoogle(data, options) {
|
|
93
|
+
return await this.client.call({ path: `/auth/google`, method: 'POST', urlEncoded: data, ...options });
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* POST auth/vk
|
|
97
|
+
*
|
|
98
|
+
* Возможные коды ответа: {@link LoginResult}
|
|
99
|
+
* @returns {@link ILoginResponse}
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* const result = await client.endpoints.auth.signInWithVk(...);
|
|
103
|
+
*/
|
|
104
|
+
async signInWithVk(data, options) {
|
|
105
|
+
return await this.client.call({ path: `/auth/vk`, method: 'POST', urlEncoded: data, ...options });
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* POST auth/signUp
|
|
109
|
+
*
|
|
110
|
+
* Возможные коды ответа: {@link RegisterResult}
|
|
111
|
+
* @returns {@link IRegisterResponse}
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* const result = await client.endpoints.auth.signUp(...);
|
|
115
|
+
*/
|
|
116
|
+
async signUp(data, options) {
|
|
117
|
+
return await this.client.call({ path: `/auth/signUp`, method: 'POST', urlEncoded: data, ...options });
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* POST auth/google
|
|
121
|
+
*
|
|
122
|
+
* Возможные коды ответа: {@link LoginResult}
|
|
123
|
+
* @returns {@link ILoginResponse}
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* const result = await client.endpoints.auth.signUpWithGoogle(...);
|
|
127
|
+
*/
|
|
128
|
+
async signUpWithGoogle(data, options) {
|
|
129
|
+
return await this.client.call({ path: `/auth/google`, method: 'POST', urlEncoded: data, ...options });
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* POST auth/vk
|
|
133
|
+
*
|
|
134
|
+
* Возможные коды ответа: {@link LoginResult}
|
|
135
|
+
* @returns {@link ILoginResponse}
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* const result = await client.endpoints.auth.signUpWithVk(...);
|
|
139
|
+
*/
|
|
140
|
+
async signUpWithVk(data, options) {
|
|
141
|
+
return await this.client.call({ path: `/auth/vk`, method: 'POST', urlEncoded: data, ...options });
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* POST auth/verify
|
|
145
|
+
*
|
|
146
|
+
* Возможные коды ответа: {@link RegisterVerifyResult}
|
|
147
|
+
* @returns {@link IRegisterResponse}
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* const result = await client.endpoints.auth.verify(...);
|
|
151
|
+
*/
|
|
152
|
+
async verify(data, options) {
|
|
153
|
+
return await this.client.call({ path: `/auth/verify`, method: 'POST', urlEncoded: data, ...options });
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
exports.Auth = Auth;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Anixart } from "../../client";
|
|
2
|
+
import { IBaseApiParams, IBookmarksExportRequest, IExportBookmarksResponse } from "../../types";
|
|
3
|
+
/**
|
|
4
|
+
* Класс с эндпоинтами экспорта
|
|
5
|
+
*/
|
|
6
|
+
export declare class Export {
|
|
7
|
+
private readonly client;
|
|
8
|
+
constructor(client: Anixart);
|
|
9
|
+
/**
|
|
10
|
+
* POST export/bookmarks
|
|
11
|
+
*
|
|
12
|
+
* Возможные коды ответа: {@link BookmarkExportResult}
|
|
13
|
+
* @returns {@link IExportBookmarksResponse}
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* const result = await client.endpoints.export.bookmarks(...);
|
|
17
|
+
*/
|
|
18
|
+
bookmarks(body: IBookmarksExportRequest, query?: Record<string, string | number | boolean | undefined>, options?: IBaseApiParams): Promise<IExportBookmarksResponse>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Export = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Класс с эндпоинтами экспорта
|
|
6
|
+
*/
|
|
7
|
+
class Export {
|
|
8
|
+
constructor(client) {
|
|
9
|
+
this.client = client;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* POST export/bookmarks
|
|
13
|
+
*
|
|
14
|
+
* Возможные коды ответа: {@link BookmarkExportResult}
|
|
15
|
+
* @returns {@link IExportBookmarksResponse}
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* const result = await client.endpoints.export.bookmarks(...);
|
|
19
|
+
*/
|
|
20
|
+
async bookmarks(body, query, options) {
|
|
21
|
+
return await this.client.call({ path: `/export/bookmarks`, method: 'POST', queryParams: query, json: body, ...options });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.Export = Export;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Anixart } from "../../client";
|
|
2
|
+
import { IBaseApiParams, IBookmarksImportRequest, IBookmarksImportStatusResponse, IResponse } from "../../types";
|
|
3
|
+
/**
|
|
4
|
+
* Класс с эндпоинтами импорта
|
|
5
|
+
*/
|
|
6
|
+
export declare class Import {
|
|
7
|
+
private readonly client;
|
|
8
|
+
constructor(client: Anixart);
|
|
9
|
+
/**
|
|
10
|
+
* POST import/bookmarks
|
|
11
|
+
*
|
|
12
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
13
|
+
* @returns {@link IResponse}
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* const result = await client.endpoints.import.bookmarks(...);
|
|
17
|
+
*/
|
|
18
|
+
bookmarks(body: IBookmarksImportRequest, options?: IBaseApiParams): Promise<IResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* POST import/status
|
|
21
|
+
*
|
|
22
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
23
|
+
* @returns {@link IBookmarksImportStatusResponse}
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* const result = await client.endpoints.import.status(...);
|
|
27
|
+
*/
|
|
28
|
+
status(options?: IBaseApiParams): Promise<IBookmarksImportStatusResponse>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Import = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Класс с эндпоинтами импорта
|
|
6
|
+
*/
|
|
7
|
+
class Import {
|
|
8
|
+
constructor(client) {
|
|
9
|
+
this.client = client;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* POST import/bookmarks
|
|
13
|
+
*
|
|
14
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
15
|
+
* @returns {@link IResponse}
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* const result = await client.endpoints.import.bookmarks(...);
|
|
19
|
+
*/
|
|
20
|
+
async bookmarks(body, options) {
|
|
21
|
+
return await this.client.call({ path: `/import/bookmarks`, method: 'POST', json: body, ...options });
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* POST import/status
|
|
25
|
+
*
|
|
26
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
27
|
+
* @returns {@link IBookmarksImportStatusResponse}
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* const result = await client.endpoints.import.status(...);
|
|
31
|
+
*/
|
|
32
|
+
async status(options) {
|
|
33
|
+
return await this.client.call({ path: `/import/status`, method: 'POST', ...options });
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.Import = Import;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./export"), exports);
|
|
18
|
+
__exportStar(require("./import"), exports);
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { Anixart } from "../../client";
|
|
2
|
+
import { IArticle, IArticleCreateRequest, IArticleCreateResponse, IArticleDeleteResponse, IArticleEditPinnedResponse, IArticleEventRequest, IArticleMuteResponse, IArticleResponse, IBaseApiParams, IPageableResponse, IProfile, IResponse } from "../../types";
|
|
3
|
+
/**
|
|
4
|
+
* Класс с эндпоинтами записей
|
|
5
|
+
*/
|
|
6
|
+
export declare class Article {
|
|
7
|
+
private readonly client;
|
|
8
|
+
constructor(client: Anixart);
|
|
9
|
+
/**
|
|
10
|
+
* GET article/{a_id}
|
|
11
|
+
*
|
|
12
|
+
* Возможные коды ответа: {@link ArticleResult}
|
|
13
|
+
* @returns {@link IArticleResponse}
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* const result = await client.endpoints.article.article(1, ...);
|
|
17
|
+
*/
|
|
18
|
+
article(articleId: number, options?: IBaseApiParams): Promise<IArticleResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* POST article/create/{c_id}
|
|
21
|
+
*
|
|
22
|
+
* Возможные коды ответа: {@link ArticleCreateEditResult}
|
|
23
|
+
* @returns {@link IArticleCreateResponse}
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* const result = await client.endpoints.article.create(1, ...);
|
|
27
|
+
*/
|
|
28
|
+
create(channelId: number, body: IArticleCreateRequest, options?: IBaseApiParams): Promise<IArticleCreateResponse>;
|
|
29
|
+
/**
|
|
30
|
+
* POST article/delete/{a_id}
|
|
31
|
+
*
|
|
32
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
33
|
+
* @returns {@link IArticleDeleteResponse}
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* const result = await client.endpoints.article.delete(1, ...);
|
|
37
|
+
*/
|
|
38
|
+
delete(articleId: number, options?: IBaseApiParams): Promise<IArticleDeleteResponse>;
|
|
39
|
+
/**
|
|
40
|
+
* POST article/edit/{a_id}
|
|
41
|
+
*
|
|
42
|
+
* Возможные коды ответа: {@link ArticleCreateEditResult}
|
|
43
|
+
* @returns {@link IArticleCreateResponse}
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* const result = await client.endpoints.article.edit(1, ...);
|
|
47
|
+
*/
|
|
48
|
+
edit(articleId: number, body: IArticleCreateRequest, options?: IBaseApiParams): Promise<IArticleCreateResponse>;
|
|
49
|
+
/**
|
|
50
|
+
* GET article/edit/pinned/{a_id}
|
|
51
|
+
*
|
|
52
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
53
|
+
* @returns {@link IArticleEditPinnedResponse}
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* const result = await client.endpoints.article.editIsPinned(1, ...);
|
|
57
|
+
*/
|
|
58
|
+
editIsPinned(articleId: number, query?: Record<string, string | number | boolean | undefined>, options?: IBaseApiParams): Promise<IArticleEditPinnedResponse>;
|
|
59
|
+
/**
|
|
60
|
+
* POST article/event
|
|
61
|
+
*
|
|
62
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
63
|
+
* @returns {@link IResponse}
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* const result = await client.endpoints.article.hits(...);
|
|
67
|
+
*/
|
|
68
|
+
hits(body: IArticleEventRequest, options?: IBaseApiParams): Promise<IResponse>;
|
|
69
|
+
/**
|
|
70
|
+
* GET article/mute/{a_id}
|
|
71
|
+
*
|
|
72
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
73
|
+
* @returns {@link IArticleMuteResponse}
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* const result = await client.endpoints.article.mute(1, ...);
|
|
77
|
+
*/
|
|
78
|
+
mute(articleId: number, options?: IBaseApiParams): Promise<IArticleMuteResponse>;
|
|
79
|
+
/**
|
|
80
|
+
* GET article/reposts/{a_id}/{page}
|
|
81
|
+
*
|
|
82
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
83
|
+
* @returns {@link IPageableResponse}
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* const result = await client.endpoints.article.reposts(1, 1, ...);
|
|
87
|
+
*/
|
|
88
|
+
reposts(articleId: number, page: number, query?: Record<string, string | number | boolean | undefined>, options?: IBaseApiParams): Promise<IPageableResponse<IArticle>>;
|
|
89
|
+
/**
|
|
90
|
+
* GET article/unmute/{a_id}
|
|
91
|
+
*
|
|
92
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
93
|
+
* @returns {@link IArticleMuteResponse}
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* const result = await client.endpoints.article.unmute(1, ...);
|
|
97
|
+
*/
|
|
98
|
+
unmute(articleId: number, options?: IBaseApiParams): Promise<IArticleMuteResponse>;
|
|
99
|
+
/**
|
|
100
|
+
* GET article/vote/{a_id}/{vote}
|
|
101
|
+
*
|
|
102
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
103
|
+
* @returns {@link IResponse}
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* const result = await client.endpoints.article.vote(1, 1, ...);
|
|
107
|
+
*/
|
|
108
|
+
vote(articleId: number, vote: number, options?: IBaseApiParams): Promise<IResponse>;
|
|
109
|
+
/**
|
|
110
|
+
* POST article/votes/{a_id}/{page}
|
|
111
|
+
*
|
|
112
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
113
|
+
* @returns {@link IPageableResponse}
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* const result = await client.endpoints.article.votes(1, 1, ...);
|
|
117
|
+
*/
|
|
118
|
+
votes(articleId: number, page: number, query?: Record<string, string | number | boolean | undefined>, options?: IBaseApiParams): Promise<IPageableResponse<IProfile>>;
|
|
119
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Article = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Класс с эндпоинтами записей
|
|
6
|
+
*/
|
|
7
|
+
class Article {
|
|
8
|
+
constructor(client) {
|
|
9
|
+
this.client = client;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* GET article/{a_id}
|
|
13
|
+
*
|
|
14
|
+
* Возможные коды ответа: {@link ArticleResult}
|
|
15
|
+
* @returns {@link IArticleResponse}
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* const result = await client.endpoints.article.article(1, ...);
|
|
19
|
+
*/
|
|
20
|
+
async article(articleId, options) {
|
|
21
|
+
return await this.client.call({ path: `/article/${articleId}`, ...options });
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* POST article/create/{c_id}
|
|
25
|
+
*
|
|
26
|
+
* Возможные коды ответа: {@link ArticleCreateEditResult}
|
|
27
|
+
* @returns {@link IArticleCreateResponse}
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* const result = await client.endpoints.article.create(1, ...);
|
|
31
|
+
*/
|
|
32
|
+
async create(channelId, body, options) {
|
|
33
|
+
return await this.client.call({ path: `/article/create/${channelId}`, method: 'POST', json: body, ...options });
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* POST article/delete/{a_id}
|
|
37
|
+
*
|
|
38
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
39
|
+
* @returns {@link IArticleDeleteResponse}
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* const result = await client.endpoints.article.delete(1, ...);
|
|
43
|
+
*/
|
|
44
|
+
async delete(articleId, options) {
|
|
45
|
+
return await this.client.call({ path: `/article/delete/${articleId}`, method: 'POST', ...options });
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* POST article/edit/{a_id}
|
|
49
|
+
*
|
|
50
|
+
* Возможные коды ответа: {@link ArticleCreateEditResult}
|
|
51
|
+
* @returns {@link IArticleCreateResponse}
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* const result = await client.endpoints.article.edit(1, ...);
|
|
55
|
+
*/
|
|
56
|
+
async edit(articleId, body, options) {
|
|
57
|
+
return await this.client.call({ path: `/article/edit/${articleId}`, method: 'POST', json: body, ...options });
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* GET article/edit/pinned/{a_id}
|
|
61
|
+
*
|
|
62
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
63
|
+
* @returns {@link IArticleEditPinnedResponse}
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* const result = await client.endpoints.article.editIsPinned(1, ...);
|
|
67
|
+
*/
|
|
68
|
+
async editIsPinned(articleId, query, options) {
|
|
69
|
+
return await this.client.call({ path: `/article/edit/pinned/${articleId}`, queryParams: query, ...options });
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* POST article/event
|
|
73
|
+
*
|
|
74
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
75
|
+
* @returns {@link IResponse}
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* const result = await client.endpoints.article.hits(...);
|
|
79
|
+
*/
|
|
80
|
+
async hits(body, options) {
|
|
81
|
+
return await this.client.call({ path: `/article/event`, method: 'POST', json: body, ...options });
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* GET article/mute/{a_id}
|
|
85
|
+
*
|
|
86
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
87
|
+
* @returns {@link IArticleMuteResponse}
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* const result = await client.endpoints.article.mute(1, ...);
|
|
91
|
+
*/
|
|
92
|
+
async mute(articleId, options) {
|
|
93
|
+
return await this.client.call({ path: `/article/mute/${articleId}`, ...options });
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* GET article/reposts/{a_id}/{page}
|
|
97
|
+
*
|
|
98
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
99
|
+
* @returns {@link IPageableResponse}
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* const result = await client.endpoints.article.reposts(1, 1, ...);
|
|
103
|
+
*/
|
|
104
|
+
async reposts(articleId, page, query, options) {
|
|
105
|
+
return await this.client.call({ path: `/article/reposts/${articleId}/${page}`, queryParams: query, ...options });
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* GET article/unmute/{a_id}
|
|
109
|
+
*
|
|
110
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
111
|
+
* @returns {@link IArticleMuteResponse}
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* const result = await client.endpoints.article.unmute(1, ...);
|
|
115
|
+
*/
|
|
116
|
+
async unmute(articleId, options) {
|
|
117
|
+
return await this.client.call({ path: `/article/unmute/${articleId}`, ...options });
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* GET article/vote/{a_id}/{vote}
|
|
121
|
+
*
|
|
122
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
123
|
+
* @returns {@link IResponse}
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* const result = await client.endpoints.article.vote(1, 1, ...);
|
|
127
|
+
*/
|
|
128
|
+
async vote(articleId, vote, options) {
|
|
129
|
+
return await this.client.call({ path: `/article/vote/${articleId}/${vote}`, ...options });
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* POST article/votes/{a_id}/{page}
|
|
133
|
+
*
|
|
134
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
135
|
+
* @returns {@link IPageableResponse}
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* const result = await client.endpoints.article.votes(1, 1, ...);
|
|
139
|
+
*/
|
|
140
|
+
async votes(articleId, page, query, options) {
|
|
141
|
+
return await this.client.call({ path: `/article/votes/${articleId}/${page}`, method: 'POST', queryParams: query, ...options });
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
exports.Article = Article;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { Anixart } from "../../client";
|
|
2
|
+
import { CommentDeleteResult, CommentEditResult, IArticleComment, IArticleCommentResponce, IBaseApiParams, IBaseCommentAddRequest, ICommentEditRequest, ICommentProcessRequest, IPageableResponse, IProfileShort, IResponse } from "../../types";
|
|
3
|
+
/**
|
|
4
|
+
* Класс с эндпоинтами комментариев к записям
|
|
5
|
+
*/
|
|
6
|
+
export declare class ArticleComment {
|
|
7
|
+
private readonly client;
|
|
8
|
+
constructor(client: Anixart);
|
|
9
|
+
/**
|
|
10
|
+
* POST article/comment/add/{articleId}
|
|
11
|
+
*
|
|
12
|
+
* Возможные коды ответа: {@link CommentAddResult}
|
|
13
|
+
* @returns {@link IArticleCommentResponce}
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* const result = await client.endpoints.articleComment.add(1, ...);
|
|
17
|
+
*/
|
|
18
|
+
add(articleId: number, body: IBaseCommentAddRequest, options?: IBaseApiParams): Promise<IArticleCommentResponce>;
|
|
19
|
+
/**
|
|
20
|
+
* GET article/comment/{articleId}
|
|
21
|
+
*
|
|
22
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
23
|
+
* @returns {@link IArticleComment}
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* const result = await client.endpoints.articleComment.comment(1, ...);
|
|
27
|
+
*/
|
|
28
|
+
comment(articleId: number, options?: IBaseApiParams): Promise<IArticleComment>;
|
|
29
|
+
/**
|
|
30
|
+
* GET article/comment/all/{a_id}/{page}
|
|
31
|
+
*
|
|
32
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
33
|
+
* @returns {@link IPageableResponse}
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* const result = await client.endpoints.articleComment.comments(1, 1, ...);
|
|
37
|
+
*/
|
|
38
|
+
comments(articleId: number, page: number, query?: Record<string, string | number | boolean | undefined>, options?: IBaseApiParams): Promise<IPageableResponse<IArticleComment>>;
|
|
39
|
+
/**
|
|
40
|
+
* GET article/comment/all/{a_id}/popular
|
|
41
|
+
*
|
|
42
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
43
|
+
* @returns {@link IPageableResponse}
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* const result = await client.endpoints.articleComment.commentsPopular(1, ...);
|
|
47
|
+
*/
|
|
48
|
+
commentsPopular(articleId: number, options?: IBaseApiParams): Promise<IPageableResponse<IArticleComment>>;
|
|
49
|
+
/**
|
|
50
|
+
* GET article/comment/delete/{commentId}
|
|
51
|
+
*
|
|
52
|
+
* Возможные коды ответа: {@link CommentDeleteResult}
|
|
53
|
+
* @returns {@link IResponse}
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* const result = await client.endpoints.articleComment.delete(1, ...);
|
|
57
|
+
*/
|
|
58
|
+
delete(commentId: number, options?: IBaseApiParams): Promise<IResponse<CommentDeleteResult>>;
|
|
59
|
+
/**
|
|
60
|
+
* POST article/comment/edit/{commentId}
|
|
61
|
+
*
|
|
62
|
+
* Возможные коды ответа: {@link CommentEditResult}
|
|
63
|
+
* @returns {@link IResponse}
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* const result = await client.endpoints.articleComment.edit(1, ...);
|
|
67
|
+
*/
|
|
68
|
+
edit(commentId: number, body: ICommentEditRequest, options?: IBaseApiParams): Promise<IResponse<CommentEditResult>>;
|
|
69
|
+
/**
|
|
70
|
+
* POST article/comment/process/{commentId}
|
|
71
|
+
*
|
|
72
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
73
|
+
* @returns {@link IResponse}
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* const result = await client.endpoints.articleComment.process(1, ...);
|
|
77
|
+
*/
|
|
78
|
+
process(commentId: number, body: ICommentProcessRequest, options?: IBaseApiParams): Promise<IResponse>;
|
|
79
|
+
/**
|
|
80
|
+
* GET article/comment/all/profile/{p_id}/{page}
|
|
81
|
+
*
|
|
82
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
83
|
+
* @returns {@link IPageableResponse}
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* const result = await client.endpoints.articleComment.profileComments(1, 1, ...);
|
|
87
|
+
*/
|
|
88
|
+
profileComments(profileId: number, page: number, query?: Record<string, string | number | boolean | undefined>, options?: IBaseApiParams): Promise<IPageableResponse<IArticleComment>>;
|
|
89
|
+
/**
|
|
90
|
+
* POST article/comment/replies/{commentId}/{page}
|
|
91
|
+
*
|
|
92
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
93
|
+
* @returns {@link IPageableResponse}
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* const result = await client.endpoints.articleComment.replies(1, 1, ...);
|
|
97
|
+
*/
|
|
98
|
+
replies(commentId: number, page: number, query?: Record<string, string | number | boolean | undefined>, options?: IBaseApiParams): Promise<IPageableResponse<IArticleComment>>;
|
|
99
|
+
/**
|
|
100
|
+
* GET article/comment/vote/{commentId}/{vote}
|
|
101
|
+
*
|
|
102
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
103
|
+
* @returns {@link IResponse}
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* const result = await client.endpoints.articleComment.vote(1, 1, ...);
|
|
107
|
+
*/
|
|
108
|
+
vote(commentId: number, vote: number, options?: IBaseApiParams): Promise<IResponse>;
|
|
109
|
+
/**
|
|
110
|
+
* POST article/comment/votes/{commentId}/{page}
|
|
111
|
+
*
|
|
112
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
113
|
+
* @returns {@link IPageableResponse}
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* const result = await client.endpoints.articleComment.votes(1, 1, ...);
|
|
117
|
+
*/
|
|
118
|
+
votes(commentId: number, page: number, query?: Record<string, string | number | boolean | undefined>, options?: IBaseApiParams): Promise<IPageableResponse<IProfileShort>>;
|
|
119
|
+
}
|