anixartjs 0.1.7 → 1.0.0
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 +617 -282
- package/README.md +404 -118
- package/dist/api/article/article.d.ts +422 -0
- package/dist/api/article/article.d.ts.map +1 -0
- package/dist/api/article/article.js +572 -0
- package/dist/api/article/article.js.map +1 -0
- package/dist/api/article/articleComment.d.ts +297 -0
- package/dist/api/article/articleComment.d.ts.map +1 -0
- package/dist/api/article/articleComment.js +398 -0
- package/dist/api/article/articleComment.js.map +1 -0
- package/dist/api/article/articleSuggestion.d.ts +212 -0
- package/dist/api/article/articleSuggestion.d.ts.map +1 -0
- package/dist/api/article/articleSuggestion.js +280 -0
- package/dist/api/article/articleSuggestion.js.map +1 -0
- package/dist/api/auth.d.ts +452 -65
- package/dist/api/auth.d.ts.map +1 -0
- package/dist/api/auth.js +652 -92
- package/dist/api/auth.js.map +1 -0
- package/dist/api/channel.d.ts +724 -44
- package/dist/api/channel.d.ts.map +1 -0
- package/dist/api/channel.js +970 -116
- package/dist/api/channel.js.map +1 -0
- package/dist/api/collection/collection.d.ts +143 -0
- package/dist/api/collection/collection.d.ts.map +1 -0
- package/dist/api/collection/collection.js +191 -0
- package/dist/api/collection/collection.js.map +1 -0
- package/dist/api/collection/collectionComment.d.ts +274 -0
- package/dist/api/collection/collectionComment.d.ts.map +1 -0
- package/dist/api/collection/collectionComment.js +368 -0
- package/dist/api/collection/collectionComment.js.map +1 -0
- package/dist/api/collection/collectionFavorite.d.ts +87 -0
- package/dist/api/collection/collectionFavorite.d.ts.map +1 -0
- package/dist/api/collection/collectionFavorite.js +114 -0
- package/dist/api/collection/collectionFavorite.js.map +1 -0
- package/dist/api/collection/collectionMy.d.ts +193 -0
- package/dist/api/collection/collectionMy.d.ts.map +1 -0
- package/dist/api/collection/collectionMy.js +266 -0
- package/dist/api/collection/collectionMy.js.map +1 -0
- package/dist/api/config.d.ts +83 -0
- package/dist/api/config.d.ts.map +1 -0
- package/dist/api/config.js +115 -0
- package/dist/api/config.js.map +1 -0
- package/dist/api/discover.d.ts +75 -46
- package/dist/api/discover.d.ts.map +1 -0
- package/dist/api/discover.js +104 -49
- package/dist/api/discover.js.map +1 -0
- package/dist/api/export.d.ts +41 -0
- package/dist/api/export.d.ts.map +1 -0
- package/dist/api/export.js +60 -0
- package/dist/api/export.js.map +1 -0
- package/dist/api/feed.d.ts +64 -20
- package/dist/api/feed.d.ts.map +1 -0
- package/dist/api/feed.js +85 -20
- package/dist/api/feed.js.map +1 -0
- package/dist/api/import.d.ts +65 -0
- package/dist/api/import.d.ts.map +1 -0
- package/dist/api/import.js +89 -0
- package/dist/api/import.js.map +1 -0
- package/dist/api/notification/notification.d.ts +284 -0
- package/dist/api/notification/notification.d.ts.map +1 -0
- package/dist/api/notification/notification.js +371 -0
- package/dist/api/notification/notification.js.map +1 -0
- package/dist/api/notification/notificationPreference.d.ts +188 -0
- package/dist/api/notification/notificationPreference.d.ts.map +1 -0
- package/dist/api/notification/notificationPreference.js +252 -0
- package/dist/api/notification/notificationPreference.js.map +1 -0
- package/dist/api/profile/profile.d.ts +99 -0
- package/dist/api/profile/profile.d.ts.map +1 -0
- package/dist/api/profile/profile.js +132 -0
- package/dist/api/profile/profile.js.map +1 -0
- package/dist/api/profile/profileBadge.d.ts +79 -0
- package/dist/api/profile/profileBadge.d.ts.map +1 -0
- package/dist/api/profile/profileBadge.js +103 -0
- package/dist/api/profile/profileBadge.js.map +1 -0
- package/dist/api/profile/profileBlockList.d.ts +85 -0
- package/dist/api/profile/profileBlockList.d.ts.map +1 -0
- package/dist/api/profile/profileBlockList.js +111 -0
- package/dist/api/profile/profileBlockList.js.map +1 -0
- package/dist/api/profile/profileDeletion.d.ts +81 -0
- package/dist/api/profile/profileDeletion.d.ts.map +1 -0
- package/dist/api/profile/profileDeletion.js +115 -0
- package/dist/api/profile/profileDeletion.js.map +1 -0
- package/dist/api/profile/profileFriend.d.ts +184 -0
- package/dist/api/profile/profileFriend.d.ts.map +1 -0
- package/dist/api/profile/profileFriend.js +244 -0
- package/dist/api/profile/profileFriend.js.map +1 -0
- package/dist/api/profile/profileHealth.d.ts +124 -0
- package/dist/api/profile/profileHealth.d.ts.map +1 -0
- package/dist/api/profile/profileHealth.js +168 -0
- package/dist/api/profile/profileHealth.js.map +1 -0
- package/dist/api/profile/profileList.d.ts +135 -0
- package/dist/api/profile/profileList.d.ts.map +1 -0
- package/dist/api/profile/profileList.js +174 -0
- package/dist/api/profile/profileList.js.map +1 -0
- package/dist/api/profile/profilePreference.d.ts +692 -0
- package/dist/api/profile/profilePreference.d.ts.map +1 -0
- package/dist/api/profile/profilePreference.js +1014 -0
- package/dist/api/profile/profilePreference.js.map +1 -0
- package/dist/api/profile/profileReleaseVote.d.ts +81 -0
- package/dist/api/profile/profileReleaseVote.d.ts.map +1 -0
- package/dist/api/profile/profileReleaseVote.js +108 -0
- package/dist/api/profile/profileReleaseVote.js.map +1 -0
- package/dist/api/profile/profileRoleList.d.ts +34 -0
- package/dist/api/profile/profileRoleList.d.ts.map +1 -0
- package/dist/api/profile/profileRoleList.js +44 -0
- package/dist/api/profile/profileRoleList.js.map +1 -0
- package/dist/api/release/episode.d.ts +254 -0
- package/dist/api/release/episode.d.ts.map +1 -0
- package/dist/api/release/episode.js +260 -0
- package/dist/api/release/episode.js.map +1 -0
- package/dist/api/release/favorite.d.ts +89 -0
- package/dist/api/release/favorite.d.ts.map +1 -0
- package/dist/api/release/favorite.js +117 -0
- package/dist/api/release/favorite.js.map +1 -0
- package/dist/api/release/filter.d.ts +44 -0
- package/dist/api/release/filter.d.ts.map +1 -0
- package/dist/api/release/filter.js +61 -0
- package/dist/api/release/filter.js.map +1 -0
- package/dist/api/release/history.d.ts +89 -0
- package/dist/api/release/history.d.ts.map +1 -0
- package/dist/api/release/history.js +113 -0
- package/dist/api/release/history.js.map +1 -0
- package/dist/api/release/related.d.ts +34 -0
- package/dist/api/release/related.d.ts.map +1 -0
- package/dist/api/release/related.js +46 -0
- package/dist/api/release/related.js.map +1 -0
- package/dist/api/release/release.d.ts +192 -0
- package/dist/api/release/release.d.ts.map +1 -0
- package/dist/api/release/release.js +259 -0
- package/dist/api/release/release.js.map +1 -0
- package/dist/api/release/releaseComment.d.ts +282 -0
- package/dist/api/release/releaseComment.d.ts.map +1 -0
- package/dist/api/release/releaseComment.js +376 -0
- package/dist/api/release/releaseComment.js.map +1 -0
- package/dist/api/release/releaseStreamingPlatform.d.ts +29 -0
- package/dist/api/release/releaseStreamingPlatform.d.ts.map +1 -0
- package/dist/api/release/releaseStreamingPlatform.js +38 -0
- package/dist/api/release/releaseStreamingPlatform.js.map +1 -0
- package/dist/api/release/releaseVideo.d.ts +125 -0
- package/dist/api/release/releaseVideo.d.ts.map +1 -0
- package/dist/api/release/releaseVideo.js +161 -0
- package/dist/api/release/releaseVideo.js.map +1 -0
- package/dist/api/release/releaseVideoAppeal.d.ts +93 -0
- package/dist/api/release/releaseVideoAppeal.d.ts.map +1 -0
- package/dist/api/release/releaseVideoAppeal.js +124 -0
- package/dist/api/release/releaseVideoAppeal.js.map +1 -0
- package/dist/api/release/releaseVideoFavorite.d.ts +86 -0
- package/dist/api/release/releaseVideoFavorite.d.ts.map +1 -0
- package/dist/api/release/releaseVideoFavorite.js +110 -0
- package/dist/api/release/releaseVideoFavorite.js.map +1 -0
- package/dist/api/release/schedule.d.ts +25 -0
- package/dist/api/release/schedule.d.ts.map +1 -0
- package/dist/api/release/schedule.js +34 -0
- package/dist/api/release/schedule.js.map +1 -0
- package/dist/api/report.d.ts +68 -0
- package/dist/api/report.d.ts.map +1 -0
- package/dist/api/report.js +91 -0
- package/dist/api/report.js.map +1 -0
- package/dist/api/search.d.ts +360 -216
- package/dist/api/search.d.ts.map +1 -0
- package/dist/api/search.js +482 -226
- package/dist/api/search.js.map +1 -0
- package/dist/api/type.d.ts +159 -0
- package/dist/api/type.d.ts.map +1 -0
- package/dist/api/type.js +207 -0
- package/dist/api/type.js.map +1 -0
- package/dist/core/anixartClient.d.ts +25 -0
- package/dist/core/anixartClient.d.ts.map +1 -0
- package/dist/core/anixartClient.js +35 -0
- package/dist/core/anixartClient.js.map +1 -0
- package/dist/core/endpoints.d.ts +87 -0
- package/dist/core/endpoints.d.ts.map +1 -0
- package/dist/core/endpoints.js +132 -0
- package/dist/core/endpoints.js.map +1 -0
- package/dist/core/errors/anixartError.d.ts +8 -0
- package/dist/core/errors/anixartError.d.ts.map +1 -0
- package/dist/core/errors/anixartError.js +19 -0
- package/dist/core/errors/anixartError.js.map +1 -0
- package/dist/core/errors/httpError.d.ts +6 -0
- package/dist/core/errors/httpError.d.ts.map +1 -0
- package/dist/core/errors/httpError.js +15 -0
- package/dist/core/errors/httpError.js.map +1 -0
- package/dist/core/http/httpClient.d.ts +15 -0
- package/dist/core/http/httpClient.d.ts.map +1 -0
- package/dist/core/http/httpClient.js +153 -0
- package/dist/core/http/httpClient.js.map +1 -0
- package/dist/core/http/httpTypes.d.ts +49 -0
- package/dist/core/http/httpTypes.d.ts.map +1 -0
- package/dist/core/http/httpTypes.js +3 -0
- package/dist/core/http/httpTypes.js.map +1 -0
- package/dist/index.d.ts +8 -4
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -0
- package/dist/models/article/enums.d.ts +51 -0
- package/dist/models/article/enums.d.ts.map +1 -0
- package/dist/models/article/enums.js +62 -0
- package/dist/models/article/enums.js.map +1 -0
- package/dist/models/article/types.d.ts +167 -0
- package/dist/models/article/types.d.ts.map +1 -0
- package/dist/{types/notification.js → models/article/types.js} +1 -0
- package/dist/models/article/types.js.map +1 -0
- package/dist/models/auth/enums.d.ts +139 -0
- package/dist/models/auth/enums.d.ts.map +1 -0
- package/dist/models/auth/enums.js +159 -0
- package/dist/models/auth/enums.js.map +1 -0
- package/dist/models/auth/types.d.ts +95 -0
- package/dist/models/auth/types.d.ts.map +1 -0
- package/dist/{types/request.js → models/auth/types.js} +1 -0
- package/dist/models/auth/types.js.map +1 -0
- package/dist/models/channel/enums.d.ts +63 -0
- package/dist/models/channel/enums.d.ts.map +1 -0
- package/dist/models/channel/enums.js +79 -0
- package/dist/models/channel/enums.js.map +1 -0
- package/dist/models/channel/types.d.ts +129 -0
- package/dist/models/channel/types.d.ts.map +1 -0
- package/dist/models/channel/types.js +3 -0
- package/dist/models/channel/types.js.map +1 -0
- package/dist/models/collection/enums.d.ts +39 -0
- package/dist/models/collection/enums.d.ts.map +1 -0
- package/dist/{types/collection.js → models/collection/enums.js} +6 -1
- package/dist/models/collection/enums.js.map +1 -0
- package/dist/models/collection/types.d.ts +54 -0
- package/dist/models/collection/types.d.ts.map +1 -0
- package/dist/models/collection/types.js +3 -0
- package/dist/models/collection/types.js.map +1 -0
- package/dist/models/common/enums.d.ts +29 -0
- package/dist/models/common/enums.d.ts.map +1 -0
- package/dist/{types/response.js → models/common/enums.js} +10 -9
- package/dist/models/common/enums.js.map +1 -0
- package/dist/models/common/types.d.ts +52 -0
- package/dist/models/common/types.d.ts.map +1 -0
- package/dist/models/common/types.js +3 -0
- package/dist/models/common/types.js.map +1 -0
- package/dist/models/config/types.d.ts +66 -0
- package/dist/models/config/types.d.ts.map +1 -0
- package/dist/models/config/types.js +3 -0
- package/dist/models/config/types.js.map +1 -0
- package/dist/models/index.d.ts +23 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +39 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models/notification/enums.d.ts +26 -0
- package/dist/models/notification/enums.d.ts.map +1 -0
- package/dist/models/notification/enums.js +32 -0
- package/dist/models/notification/enums.js.map +1 -0
- package/dist/models/notification/types.d.ts +66 -0
- package/dist/models/notification/types.d.ts.map +1 -0
- package/dist/models/notification/types.js +3 -0
- package/dist/models/notification/types.js.map +1 -0
- package/dist/models/preference/enums.d.ts +79 -0
- package/dist/models/preference/enums.d.ts.map +1 -0
- package/dist/models/preference/enums.js +99 -0
- package/dist/models/preference/enums.js.map +1 -0
- package/dist/models/preference/types.d.ts +61 -0
- package/dist/models/preference/types.d.ts.map +1 -0
- package/dist/models/preference/types.js +3 -0
- package/dist/models/preference/types.js.map +1 -0
- package/dist/models/profile/enums.d.ts +68 -0
- package/dist/models/profile/enums.d.ts.map +1 -0
- package/dist/models/profile/enums.js +83 -0
- package/dist/models/profile/enums.js.map +1 -0
- package/dist/models/profile/types.d.ts +263 -0
- package/dist/models/profile/types.d.ts.map +1 -0
- package/dist/models/profile/types.js +3 -0
- package/dist/models/profile/types.js.map +1 -0
- package/dist/models/release/enums.d.ts +57 -0
- package/dist/models/release/enums.d.ts.map +1 -0
- package/dist/models/release/enums.js +69 -0
- package/dist/models/release/enums.js.map +1 -0
- package/dist/models/release/types.d.ts +283 -0
- package/dist/models/release/types.d.ts.map +1 -0
- package/dist/models/release/types.js +3 -0
- package/dist/models/release/types.js.map +1 -0
- package/dist/models/report/enums.d.ts +17 -0
- package/dist/models/report/enums.d.ts.map +1 -0
- package/dist/models/report/enums.js +22 -0
- package/dist/models/report/enums.js.map +1 -0
- package/dist/models/report/types.d.ts +23 -0
- package/dist/models/report/types.d.ts.map +1 -0
- package/dist/models/report/types.js +4 -0
- package/dist/models/report/types.js.map +1 -0
- package/dist/models/search/types.d.ts +27 -0
- package/dist/models/search/types.d.ts.map +1 -0
- package/dist/models/search/types.js +3 -0
- package/dist/models/search/types.js.map +1 -0
- package/dist/utils/ArticleBuilder.d.ts +41 -12
- package/dist/utils/ArticleBuilder.d.ts.map +1 -0
- package/dist/utils/ArticleBuilder.js +130 -115
- package/dist/utils/ArticleBuilder.js.map +1 -0
- package/dist/utils/{LinkParser.d.ts → linkParser/anilibria.d.ts} +15 -85
- package/dist/utils/linkParser/anilibria.d.ts.map +1 -0
- package/dist/utils/linkParser/anilibria.js +42 -0
- package/dist/utils/linkParser/anilibria.js.map +1 -0
- package/dist/utils/linkParser/index.d.ts +9 -0
- package/dist/utils/linkParser/index.d.ts.map +1 -0
- package/dist/utils/linkParser/index.js +29 -0
- package/dist/utils/linkParser/index.js.map +1 -0
- package/dist/utils/linkParser/kodik.d.ts +50 -0
- package/dist/utils/linkParser/kodik.d.ts.map +1 -0
- package/dist/utils/linkParser/kodik.js +86 -0
- package/dist/utils/linkParser/kodik.js.map +1 -0
- package/dist/utils/linkParser/ok.d.ts +9 -0
- package/dist/utils/linkParser/ok.d.ts.map +1 -0
- package/dist/utils/linkParser/ok.js +62 -0
- package/dist/utils/linkParser/ok.js.map +1 -0
- package/dist/utils/linkParser/parseHlsMaster.d.ts +6 -0
- package/dist/utils/linkParser/parseHlsMaster.d.ts.map +1 -0
- package/dist/utils/linkParser/parseHlsMaster.js +57 -0
- package/dist/utils/linkParser/parseHlsMaster.js.map +1 -0
- package/dist/utils/linkParser/request.d.ts +7 -0
- package/dist/utils/linkParser/request.d.ts.map +1 -0
- package/dist/utils/linkParser/request.js +50 -0
- package/dist/utils/linkParser/request.js.map +1 -0
- package/dist/utils/linkParser/rutube.d.ts +8 -0
- package/dist/utils/linkParser/rutube.d.ts.map +1 -0
- package/dist/utils/linkParser/rutube.js +28 -0
- package/dist/utils/linkParser/rutube.js.map +1 -0
- package/dist/utils/linkParser/sibnet.d.ts +8 -0
- package/dist/utils/linkParser/sibnet.d.ts.map +1 -0
- package/dist/utils/linkParser/sibnet.js +26 -0
- package/dist/utils/linkParser/sibnet.js.map +1 -0
- package/dist/utils/linkParser/types.d.ts +12 -0
- package/dist/utils/linkParser/types.d.ts.map +1 -0
- package/dist/utils/linkParser/types.js +3 -0
- package/dist/utils/linkParser/types.js.map +1 -0
- package/dist/utils/linkParser/vk.d.ts +13 -0
- package/dist/utils/linkParser/vk.d.ts.map +1 -0
- package/dist/utils/linkParser/vk.js +58 -0
- package/dist/utils/linkParser/vk.js.map +1 -0
- package/package.json +5 -5
- package/dist/api/collection.d.ts +0 -27
- package/dist/api/collection.js +0 -62
- package/dist/api/index.d.ts +0 -10
- package/dist/api/index.js +0 -26
- package/dist/api/notification.d.ts +0 -17
- package/dist/api/notification.js +0 -42
- package/dist/api/profile.d.ts +0 -388
- package/dist/api/profile.js +0 -437
- package/dist/api/release.d.ts +0 -41
- package/dist/api/release.js +0 -104
- package/dist/api/settings.d.ts +0 -29
- package/dist/api/settings.js +0 -78
- package/dist/classes/Article.d.ts +0 -18
- package/dist/classes/Article.js +0 -44
- package/dist/classes/ArticleComment.d.ts +0 -15
- package/dist/classes/ArticleComment.js +0 -37
- package/dist/classes/BaseArticle.d.ts +0 -21
- package/dist/classes/BaseArticle.js +0 -23
- package/dist/classes/BaseComment.d.ts +0 -22
- package/dist/classes/BaseComment.js +0 -25
- package/dist/classes/BaseProfile.d.ts +0 -29
- package/dist/classes/BaseProfile.js +0 -50
- package/dist/classes/Channel.d.ts +0 -47
- package/dist/classes/Channel.js +0 -104
- package/dist/classes/Collection.d.ts +0 -29
- package/dist/classes/Collection.js +0 -58
- package/dist/classes/Dubber.d.ts +0 -19
- package/dist/classes/Dubber.js +0 -24
- package/dist/classes/Episode.d.ts +0 -20
- package/dist/classes/Episode.js +0 -30
- package/dist/classes/FullProfile.d.ts +0 -71
- package/dist/classes/FullProfile.js +0 -93
- package/dist/classes/Release.d.ts +0 -91
- package/dist/classes/Release.js +0 -154
- package/dist/classes/ReleaseComment.d.ts +0 -16
- package/dist/classes/ReleaseComment.js +0 -45
- package/dist/classes/Source.d.ts +0 -15
- package/dist/classes/Source.js +0 -20
- package/dist/classes/SuggestionArticle.d.ts +0 -14
- package/dist/classes/SuggestionArticle.js +0 -29
- package/dist/client.d.ts +0 -46
- package/dist/client.js +0 -149
- package/dist/endpoints.d.ts +0 -27
- package/dist/endpoints.js +0 -34
- package/dist/types/auth.d.ts +0 -64
- package/dist/types/auth.js +0 -47
- package/dist/types/channel.d.ts +0 -277
- package/dist/types/channel.js +0 -97
- package/dist/types/collection.d.ts +0 -84
- package/dist/types/index.d.ts +0 -12
- package/dist/types/index.js +0 -25
- package/dist/types/notification.d.ts +0 -36
- package/dist/types/profile.d.ts +0 -213
- package/dist/types/profile.js +0 -46
- package/dist/types/release.d.ts +0 -336
- package/dist/types/release.js +0 -39
- package/dist/types/request.d.ts +0 -36
- package/dist/types/response.d.ts +0 -77
- package/dist/types/settings.d.ts +0 -89
- package/dist/types/settings.js +0 -48
- package/dist/utils/LinkParser.js +0 -121
- package/dist/utils/Utils.d.ts +0 -3
- package/dist/utils/Utils.js +0 -11
package/dist/api/settings.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Settings = void 0;
|
|
4
|
-
class Settings {
|
|
5
|
-
constructor(client) {
|
|
6
|
-
this.client = client;
|
|
7
|
-
}
|
|
8
|
-
async getCurrentProfileSettings(options) {
|
|
9
|
-
return await this.client.call({ path: `/profile/preference/my`, ...options });
|
|
10
|
-
}
|
|
11
|
-
async getBadges(page, options) {
|
|
12
|
-
return await this.client.call({ path: `/profile/preference/badge/all/${page}`, ...options });
|
|
13
|
-
}
|
|
14
|
-
async editBadge(id, options) {
|
|
15
|
-
return await this.client.call({ path: `/profile/preference/badge/edit/${id}`, ...options });
|
|
16
|
-
}
|
|
17
|
-
async removeBadge(options) {
|
|
18
|
-
return await this.client.call({ path: `/profile/preference/badge/remove`, ...options });
|
|
19
|
-
}
|
|
20
|
-
async setStatus(status, options) {
|
|
21
|
-
return await this.client.call({ path: `/profile/preference/status/edit`, json: { status }, ...options });
|
|
22
|
-
}
|
|
23
|
-
async getSocial(options) {
|
|
24
|
-
return await this.client.call({ path: `/profile/preference/social`, ...options });
|
|
25
|
-
}
|
|
26
|
-
async setSocial(data, options) {
|
|
27
|
-
return await this.client.call({ path: `/profile/preference/social/edit`, json: { vkPage: data.vk_page, tgPage: data.tg_page, instPage: data.inst_page, ttPage: data.tt_page, discordPage: data.discord_page }, ...options });
|
|
28
|
-
}
|
|
29
|
-
async confirmChangeEmail(currentPassword, options) {
|
|
30
|
-
return await this.client.call({ path: `/profile/preference/email/change/confirm`, queryParams: { current: currentPassword }, ...options });
|
|
31
|
-
}
|
|
32
|
-
async changeEmail(data, options) {
|
|
33
|
-
return await this.client.call({ path: `/profile/preference/email/change`, queryParams: { current_password: data.password, current: data.oldEmail, new: data.newEmail }, ...options });
|
|
34
|
-
}
|
|
35
|
-
async changePassword(currentPassword, newPassword, options) {
|
|
36
|
-
return await this.client.call({ path: `/profile/preference/password/change`, queryParams: { current: currentPassword, new: newPassword }, ...options });
|
|
37
|
-
}
|
|
38
|
-
async getLoginInfo(options) {
|
|
39
|
-
return await this.client.call({ path: `/profile/preference/login/info`, ...options });
|
|
40
|
-
}
|
|
41
|
-
async getLoginHistory(id, page, options) {
|
|
42
|
-
return await this.client.call({ path: `/profile/login/history/all/${id}/${page}`, ...options });
|
|
43
|
-
}
|
|
44
|
-
async changeLogin(newLogin, options) {
|
|
45
|
-
return await this.client.call({ path: `/profile/preference/login/change`, queryParams: { login: newLogin }, ...options });
|
|
46
|
-
}
|
|
47
|
-
async setCommentNotification(options) {
|
|
48
|
-
return await this.client.call({ path: `/profile/preference/notification/comment/edit`, ...options });
|
|
49
|
-
}
|
|
50
|
-
async setCollectionCommentNotification(options) {
|
|
51
|
-
return await this.client.call({ path: `/profile/preference/notification/my/collection/comment/edit`, ...options });
|
|
52
|
-
}
|
|
53
|
-
async setReportProgressNotification(options) {
|
|
54
|
-
return await this.client.call({ path: `/profile/preference/notification/report/process/edit`, ...options });
|
|
55
|
-
}
|
|
56
|
-
async setRelatedReleaseNotification(options) {
|
|
57
|
-
return await this.client.call({ path: `/profile/preference/notification/related/release/edit`, ...options });
|
|
58
|
-
}
|
|
59
|
-
async setEpisodeNotification(options) {
|
|
60
|
-
return await this.client.call({ path: `/profile/preference/notification/episode/edit`, ...options });
|
|
61
|
-
}
|
|
62
|
-
async setStatusNotification(options) {
|
|
63
|
-
return await this.client.call({ path: `/profile/preference/notification/status/edit`, ...options });
|
|
64
|
-
}
|
|
65
|
-
async setPrivacyStats(state, options) {
|
|
66
|
-
return await this.client.call({ path: `/profile/preference/privacy/stats/edit`, json: { permission: state }, ...options });
|
|
67
|
-
}
|
|
68
|
-
async setPrivacyCounts(state, options) {
|
|
69
|
-
return await this.client.call({ path: `/profile/preference/privacy/counts/edit`, json: { permission: state }, ...options });
|
|
70
|
-
}
|
|
71
|
-
async setPrivacySocial(state, options) {
|
|
72
|
-
return await this.client.call({ path: `/profile/preference/privacy/social/edit`, json: { permission: state }, ...options });
|
|
73
|
-
}
|
|
74
|
-
async setPrivacyFriendRequests(state, options) {
|
|
75
|
-
return await this.client.call({ path: `/profile/preference/privacy/friendRequests/edit`, json: { permission: state }, ...options });
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
exports.Settings = Settings;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Channel } from "./Channel";
|
|
2
|
-
import { Anixart } from "../client";
|
|
3
|
-
import { IArticle, DefaultResult, IBaseCommentAddRequest, VoteType, ArticleDeleteResult } from "../types";
|
|
4
|
-
import { ArticleComment } from "./ArticleComment";
|
|
5
|
-
import { ArticleBuilder } from "../utils/ArticleBuilder";
|
|
6
|
-
import { BaseArticle } from "./BaseArticle";
|
|
7
|
-
export declare class Article extends BaseArticle {
|
|
8
|
-
readonly client: Anixart;
|
|
9
|
-
readonly repostArticle: Article | null;
|
|
10
|
-
readonly channel: Channel;
|
|
11
|
-
constructor(client: Anixart, articleResponce: IArticle, channel?: Channel);
|
|
12
|
-
private writeProperties;
|
|
13
|
-
getComments(page?: number, sort?: number): Promise<ArticleComment[]>;
|
|
14
|
-
addComment(data: IBaseCommentAddRequest): Promise<ArticleComment | null>;
|
|
15
|
-
setVote(type: VoteType): Promise<DefaultResult>;
|
|
16
|
-
edit(data: ArticleBuilder): Promise<Article>;
|
|
17
|
-
delete(): Promise<DefaultResult | ArticleDeleteResult>;
|
|
18
|
-
}
|
package/dist/classes/Article.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Article = void 0;
|
|
4
|
-
const Channel_1 = require("./Channel");
|
|
5
|
-
const types_1 = require("../types");
|
|
6
|
-
const ArticleComment_1 = require("./ArticleComment");
|
|
7
|
-
const BaseArticle_1 = require("./BaseArticle");
|
|
8
|
-
class Article extends BaseArticle_1.BaseArticle {
|
|
9
|
-
constructor(client, articleResponce, channel) {
|
|
10
|
-
super(client, articleResponce, channel);
|
|
11
|
-
this.client = client;
|
|
12
|
-
this.channel = channel !== null && channel !== void 0 ? channel : new Channel_1.Channel(this.client, articleResponce.channel);
|
|
13
|
-
this.repostArticle = articleResponce.repost_article
|
|
14
|
-
? new Article(client, articleResponce.repost_article, channel)
|
|
15
|
-
: null;
|
|
16
|
-
}
|
|
17
|
-
writeProperties(prop, value) {
|
|
18
|
-
this[prop] = value;
|
|
19
|
-
}
|
|
20
|
-
async getComments(page, sort) {
|
|
21
|
-
const request = await this.client.endpoints.channel.getComments(this.id, page !== null && page !== void 0 ? page : 0, sort !== null && sort !== void 0 ? sort : 2);
|
|
22
|
-
return request.content.map(comment => new ArticleComment_1.ArticleComment(this.client, comment));
|
|
23
|
-
}
|
|
24
|
-
async addComment(data) {
|
|
25
|
-
const request = await this.client.endpoints.channel.addArticleComment(this.id, data);
|
|
26
|
-
return request.code == types_1.DefaultResult.Ok && request.comment ? new ArticleComment_1.ArticleComment(this.client, request === null || request === void 0 ? void 0 : request.comment) : null;
|
|
27
|
-
}
|
|
28
|
-
async setVote(type) {
|
|
29
|
-
const request = await this.client.endpoints.channel.voteArticle(this.id, type);
|
|
30
|
-
if (request.code == types_1.DefaultResult.Ok) {
|
|
31
|
-
this.writeProperties("vote", type == this.vote ? 0 : type);
|
|
32
|
-
}
|
|
33
|
-
return request.code;
|
|
34
|
-
}
|
|
35
|
-
async edit(data) {
|
|
36
|
-
const request = await this.client.endpoints.channel.editArticle(this.id, data.returnBuildAricle());
|
|
37
|
-
return new Article(this.client, request.article, this.channel);
|
|
38
|
-
}
|
|
39
|
-
async delete() {
|
|
40
|
-
const request = await this.client.endpoints.channel.removeArticle(this.id);
|
|
41
|
-
return request.code;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.Article = Article;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Anixart } from "../client";
|
|
2
|
-
import { BaseComment } from "./BaseComment";
|
|
3
|
-
import { IArticleComment, DefaultResult, VoteType, CommentDeleteResult } from "../types";
|
|
4
|
-
import { Article } from "./Article";
|
|
5
|
-
import { BaseProfile } from "./BaseProfile";
|
|
6
|
-
export declare class ArticleComment extends BaseComment {
|
|
7
|
-
readonly client: Anixart;
|
|
8
|
-
readonly article: Article;
|
|
9
|
-
constructor(client: Anixart, comment: IArticleComment);
|
|
10
|
-
private writeProperties;
|
|
11
|
-
getVotes(page?: number, sort?: number): Promise<BaseProfile[]>;
|
|
12
|
-
getReplies(page?: number, sort?: number): Promise<ArticleComment[]>;
|
|
13
|
-
delete(): Promise<DefaultResult | CommentDeleteResult>;
|
|
14
|
-
setVote(type: VoteType): Promise<DefaultResult>;
|
|
15
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ArticleComment = void 0;
|
|
4
|
-
const BaseComment_1 = require("./BaseComment");
|
|
5
|
-
const types_1 = require("../types");
|
|
6
|
-
const Article_1 = require("./Article");
|
|
7
|
-
const BaseProfile_1 = require("./BaseProfile");
|
|
8
|
-
class ArticleComment extends BaseComment_1.BaseComment {
|
|
9
|
-
constructor(client, comment) {
|
|
10
|
-
super(client, comment);
|
|
11
|
-
this.client = client;
|
|
12
|
-
this.article = new Article_1.Article(client, comment.article);
|
|
13
|
-
}
|
|
14
|
-
writeProperties(prop, value) {
|
|
15
|
-
this[prop] = value;
|
|
16
|
-
}
|
|
17
|
-
async getVotes(page, sort) {
|
|
18
|
-
const request = await this.client.endpoints.channel.getVotes(this.id, page !== null && page !== void 0 ? page : 0, sort !== null && sort !== void 0 ? sort : 2);
|
|
19
|
-
return request.content.map(profile => new BaseProfile_1.BaseProfile(this.client, profile));
|
|
20
|
-
}
|
|
21
|
-
async getReplies(page, sort) {
|
|
22
|
-
const request = await this.client.endpoints.channel.getCommentReplies(this.id, page !== null && page !== void 0 ? page : 0, sort !== null && sort !== void 0 ? sort : 2);
|
|
23
|
-
return request.content.map(comment => new ArticleComment(this.client, comment));
|
|
24
|
-
}
|
|
25
|
-
async delete() {
|
|
26
|
-
const request = await this.client.endpoints.channel.removeArticleComment(this.id);
|
|
27
|
-
return request.code;
|
|
28
|
-
}
|
|
29
|
-
async setVote(type) {
|
|
30
|
-
const request = await this.client.endpoints.channel.voteCommentArticle(this.id, type);
|
|
31
|
-
if (request.code == types_1.DefaultResult.Ok) {
|
|
32
|
-
this.writeProperties("vote", type == this.vote ? 0 : type);
|
|
33
|
-
}
|
|
34
|
-
return request.code;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
exports.ArticleComment = ArticleComment;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Channel } from "./Channel";
|
|
2
|
-
import { Anixart } from "../client";
|
|
3
|
-
import { IArticle, IArticlePayloadBlock } from "../types";
|
|
4
|
-
import { FullProfile } from "./FullProfile";
|
|
5
|
-
export declare class BaseArticle {
|
|
6
|
-
readonly client: Anixart;
|
|
7
|
-
readonly id: number;
|
|
8
|
-
readonly payloadTime: Date;
|
|
9
|
-
readonly payloadBlocks: IArticlePayloadBlock[];
|
|
10
|
-
readonly vote: number;
|
|
11
|
-
readonly isDeleted: boolean;
|
|
12
|
-
readonly commentCount: number;
|
|
13
|
-
readonly repostCount: number;
|
|
14
|
-
readonly voteCount: number;
|
|
15
|
-
readonly creationDate: Date;
|
|
16
|
-
readonly lastUpdateDate: Date;
|
|
17
|
-
readonly underModerationReason: string | null;
|
|
18
|
-
readonly isUnderModeration: boolean;
|
|
19
|
-
readonly author: FullProfile | null;
|
|
20
|
-
constructor(client: Anixart, articleResponce: IArticle, channel?: Channel);
|
|
21
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BaseArticle = void 0;
|
|
4
|
-
const FullProfile_1 = require("./FullProfile");
|
|
5
|
-
class BaseArticle {
|
|
6
|
-
constructor(client, articleResponce, channel) {
|
|
7
|
-
this.client = client;
|
|
8
|
-
this.id = articleResponce.id;
|
|
9
|
-
this.payloadTime = new Date(articleResponce.payload.time);
|
|
10
|
-
this.author = articleResponce.author ? new FullProfile_1.FullProfile(this.client, articleResponce.author) : null;
|
|
11
|
-
this.payloadBlocks = articleResponce.payload.blocks;
|
|
12
|
-
this.vote = articleResponce.vote;
|
|
13
|
-
this.commentCount = articleResponce.comment_count;
|
|
14
|
-
this.repostCount = articleResponce.repost_count;
|
|
15
|
-
this.voteCount = articleResponce.vote_count;
|
|
16
|
-
this.creationDate = new Date(articleResponce.creation_date * 1000);
|
|
17
|
-
this.lastUpdateDate = new Date(articleResponce.last_update_date * 1000);
|
|
18
|
-
this.underModerationReason = articleResponce.under_moderation_reason;
|
|
19
|
-
this.isUnderModeration = articleResponce.is_under_moderation;
|
|
20
|
-
this.isDeleted = articleResponce.is_deleted;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
exports.BaseArticle = BaseArticle;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Anixart } from "../client";
|
|
2
|
-
import { IBaseComment } from "../types";
|
|
3
|
-
import { BaseProfile } from "./BaseProfile";
|
|
4
|
-
export declare class BaseComment {
|
|
5
|
-
protected readonly client: Anixart;
|
|
6
|
-
readonly id: number;
|
|
7
|
-
readonly profile: BaseProfile;
|
|
8
|
-
readonly message: string;
|
|
9
|
-
readonly timestamp: Date;
|
|
10
|
-
readonly type: number;
|
|
11
|
-
readonly vote: number;
|
|
12
|
-
readonly parentCommentId: number;
|
|
13
|
-
readonly voteCount: number;
|
|
14
|
-
readonly likesCount: number;
|
|
15
|
-
readonly isSpoiler: boolean;
|
|
16
|
-
readonly isEdited: boolean;
|
|
17
|
-
readonly isDeleted: boolean;
|
|
18
|
-
readonly isReply: boolean;
|
|
19
|
-
readonly replyCount: number;
|
|
20
|
-
readonly canLike: boolean;
|
|
21
|
-
constructor(client: Anixart, comment: IBaseComment);
|
|
22
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BaseComment = void 0;
|
|
4
|
-
const BaseProfile_1 = require("./BaseProfile");
|
|
5
|
-
class BaseComment {
|
|
6
|
-
constructor(client, comment) {
|
|
7
|
-
this.client = client;
|
|
8
|
-
this.id = comment.id;
|
|
9
|
-
this.profile = new BaseProfile_1.BaseProfile(this.client, comment.profile);
|
|
10
|
-
this.message = comment.message;
|
|
11
|
-
this.timestamp = new Date(comment.timestamp * 1000);
|
|
12
|
-
this.type = comment.type;
|
|
13
|
-
this.vote = comment.vote;
|
|
14
|
-
this.parentCommentId = comment.parent_comment_id;
|
|
15
|
-
this.voteCount = comment.vote_count;
|
|
16
|
-
this.likesCount = comment.likes_count;
|
|
17
|
-
this.isSpoiler = comment.is_spoiler;
|
|
18
|
-
this.isEdited = comment.is_edited;
|
|
19
|
-
this.isDeleted = comment.is_deleted;
|
|
20
|
-
this.isReply = comment.is_reply;
|
|
21
|
-
this.replyCount = comment.reply_count;
|
|
22
|
-
this.canLike = comment.can_like;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
exports.BaseComment = BaseComment;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Anixart } from "../client";
|
|
2
|
-
import { IFriendRequestResponse, IPageableResponse, IProfileShort, IRelease, IVoteRelease, RemoveFriendRequestResult } from "../types";
|
|
3
|
-
import { Collection } from "./Collection";
|
|
4
|
-
export declare class BaseProfile {
|
|
5
|
-
protected readonly client: Anixart;
|
|
6
|
-
readonly id: number;
|
|
7
|
-
readonly login: string;
|
|
8
|
-
readonly avatar: string;
|
|
9
|
-
readonly banExpires: Date;
|
|
10
|
-
readonly banReason: string;
|
|
11
|
-
readonly privilegeLevel: number;
|
|
12
|
-
readonly badgeId: number | null;
|
|
13
|
-
readonly badgeName: string | null;
|
|
14
|
-
readonly badgeType: number | null;
|
|
15
|
-
readonly badgeUrl: string | null;
|
|
16
|
-
readonly isBanned: boolean;
|
|
17
|
-
readonly isSponsor: boolean;
|
|
18
|
-
readonly isVerified: boolean;
|
|
19
|
-
readonly isOnline: boolean;
|
|
20
|
-
readonly friendStatus: number;
|
|
21
|
-
readonly friendCount: number;
|
|
22
|
-
constructor(client: Anixart, profile: IProfileShort);
|
|
23
|
-
getFriends(page?: number): Promise<BaseProfile[]>;
|
|
24
|
-
sendFriendRequest(): Promise<IFriendRequestResponse>;
|
|
25
|
-
removeFriendRequest(): Promise<IFriendRequestResponse<RemoveFriendRequestResult>>;
|
|
26
|
-
getVotedReleases(page?: number, sort?: number): Promise<IPageableResponse<IVoteRelease>>;
|
|
27
|
-
getUnvotedReleases(page?: number): Promise<IPageableResponse<IRelease>>;
|
|
28
|
-
getCollections(page?: number): Promise<Collection[]>;
|
|
29
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BaseProfile = void 0;
|
|
4
|
-
const Collection_1 = require("./Collection");
|
|
5
|
-
class BaseProfile {
|
|
6
|
-
constructor(client, profile) {
|
|
7
|
-
this.client = client;
|
|
8
|
-
this.id = profile.id;
|
|
9
|
-
this.login = profile.login;
|
|
10
|
-
this.avatar = profile.avatar;
|
|
11
|
-
this.banExpires = new Date(profile.ban_expires * 1000);
|
|
12
|
-
this.banReason = profile.ban_reason;
|
|
13
|
-
this.privilegeLevel = profile.privilege_level;
|
|
14
|
-
this.badgeId = profile.badge_id;
|
|
15
|
-
this.badgeName = profile.badge_name;
|
|
16
|
-
this.badgeType = profile.badge_type;
|
|
17
|
-
this.badgeUrl = profile.badge_url;
|
|
18
|
-
this.isBanned = profile.is_banned;
|
|
19
|
-
this.isSponsor = profile.is_sponsor;
|
|
20
|
-
this.isVerified = profile.is_verified;
|
|
21
|
-
this.isOnline = profile.is_online;
|
|
22
|
-
this.friendStatus = profile.friend_status;
|
|
23
|
-
this.friendCount = profile.friend_count;
|
|
24
|
-
}
|
|
25
|
-
async getFriends(page) {
|
|
26
|
-
const request = await this.client.endpoints.profile.getFriends({ id: this.id, page: page !== null && page !== void 0 ? page : 0 });
|
|
27
|
-
return request.content.map(profile => new BaseProfile(this.client, profile));
|
|
28
|
-
}
|
|
29
|
-
async sendFriendRequest() {
|
|
30
|
-
const request = await this.client.endpoints.profile.sendFriendRequest(this.id);
|
|
31
|
-
return request;
|
|
32
|
-
}
|
|
33
|
-
async removeFriendRequest() {
|
|
34
|
-
const request = await this.client.endpoints.profile.removeFriendRequest(this.id);
|
|
35
|
-
return request;
|
|
36
|
-
}
|
|
37
|
-
async getVotedReleases(page, sort) {
|
|
38
|
-
const request = await this.client.endpoints.profile.getVotedReleases(this.id, page !== null && page !== void 0 ? page : 0, sort !== null && sort !== void 0 ? sort : 1);
|
|
39
|
-
return request;
|
|
40
|
-
}
|
|
41
|
-
async getUnvotedReleases(page) {
|
|
42
|
-
const request = await this.client.endpoints.profile.getUnvotedReleases(page !== null && page !== void 0 ? page : "last");
|
|
43
|
-
return request;
|
|
44
|
-
}
|
|
45
|
-
async getCollections(page) {
|
|
46
|
-
const request = await this.client.endpoints.collection.getUserCollections(this.id, page !== null && page !== void 0 ? page : 0);
|
|
47
|
-
return request.content.map(x => new Collection_1.Collection(this.client, x));
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
exports.BaseProfile = BaseProfile;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Anixart } from "../client";
|
|
2
|
-
import { IChannel, IChannelBlockInfo, IChannelBlockManageRequest, IChannelCreateRequest, DefaultResult, ChannelSubscribeResult, ChannelUnsubscribeResult, ChannelBlockResult } from "../types";
|
|
3
|
-
import { ArticleBuilder } from "../utils/ArticleBuilder";
|
|
4
|
-
import { SuggestionArticle } from "./SuggestionArticle";
|
|
5
|
-
import { Article } from "./Article";
|
|
6
|
-
import { BaseProfile } from "./BaseProfile";
|
|
7
|
-
import { FullProfile } from "./FullProfile";
|
|
8
|
-
export declare class Channel {
|
|
9
|
-
private readonly client;
|
|
10
|
-
readonly id: number;
|
|
11
|
-
readonly title: string;
|
|
12
|
-
readonly description: string;
|
|
13
|
-
readonly channelAvatar: string;
|
|
14
|
-
readonly channelCover: string;
|
|
15
|
-
readonly clientPermission: number;
|
|
16
|
-
readonly articleCount: number;
|
|
17
|
-
readonly subscriberCount: number;
|
|
18
|
-
readonly creationDate: Date;
|
|
19
|
-
readonly lastUpdateDate: Date;
|
|
20
|
-
readonly isBlog: boolean;
|
|
21
|
-
readonly isCommentingEnabled: boolean;
|
|
22
|
-
readonly isArticleSuggestionEnabled: boolean;
|
|
23
|
-
readonly isVerified: boolean;
|
|
24
|
-
readonly isDeleted: boolean;
|
|
25
|
-
readonly blogProfileId: number;
|
|
26
|
-
readonly isSubscribed: boolean;
|
|
27
|
-
readonly isBlocked: boolean;
|
|
28
|
-
readonly blockReason: string;
|
|
29
|
-
readonly blockExpiredDate: Date;
|
|
30
|
-
readonly isPermBlocked: boolean;
|
|
31
|
-
readonly isAdministratorOrHigher: boolean;
|
|
32
|
-
constructor(client: Anixart, channelResponce: IChannel);
|
|
33
|
-
private writeProperties;
|
|
34
|
-
getArticles(page: number, date?: number): Promise<(Article | undefined)[]>;
|
|
35
|
-
getArticleById(id: number): Promise<Article | null>;
|
|
36
|
-
createArticle(data: ArticleBuilder): Promise<Article | null>;
|
|
37
|
-
subscribe(): Promise<DefaultResult | ChannelSubscribeResult>;
|
|
38
|
-
unsubscribe(): Promise<DefaultResult | ChannelUnsubscribeResult>;
|
|
39
|
-
setAvatar(file: Buffer): Promise<this>;
|
|
40
|
-
setCover(file: Buffer): Promise<this>;
|
|
41
|
-
getMediaToken(isSuggestionMode?: boolean, isEditMode?: boolean): Promise<string | null>;
|
|
42
|
-
edit(data: IChannelCreateRequest): Promise<Channel | null>;
|
|
43
|
-
getArticleSuggestions(page: number): Promise<(SuggestionArticle[] | null)>;
|
|
44
|
-
createArticleSuggestion(data: ArticleBuilder): Promise<SuggestionArticle | null>;
|
|
45
|
-
manageBlocklist(profile: BaseProfile | FullProfile | number, data: Omit<IChannelBlockManageRequest, "target_profile_id">): Promise<DefaultResult | ChannelBlockResult>;
|
|
46
|
-
getBlocklist(profile: BaseProfile | FullProfile | number): Promise<IChannelBlockInfo | null>;
|
|
47
|
-
}
|
package/dist/classes/Channel.js
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Channel = void 0;
|
|
4
|
-
const types_1 = require("../types");
|
|
5
|
-
const SuggestionArticle_1 = require("./SuggestionArticle");
|
|
6
|
-
const Article_1 = require("./Article");
|
|
7
|
-
class Channel {
|
|
8
|
-
constructor(client, channelResponce) {
|
|
9
|
-
this.client = client;
|
|
10
|
-
this.id = channelResponce.id;
|
|
11
|
-
this.title = channelResponce.title;
|
|
12
|
-
this.description = channelResponce.description;
|
|
13
|
-
this.channelAvatar = channelResponce.avatar;
|
|
14
|
-
this.channelCover = channelResponce.cover;
|
|
15
|
-
this.clientPermission = channelResponce.permission;
|
|
16
|
-
this.articleCount = channelResponce.article_count;
|
|
17
|
-
this.subscriberCount = channelResponce.subscriber_count;
|
|
18
|
-
this.creationDate = new Date(channelResponce.creation_date * 1000);
|
|
19
|
-
this.lastUpdateDate = new Date(channelResponce.last_update_date * 1000);
|
|
20
|
-
this.isBlog = channelResponce.is_blog;
|
|
21
|
-
this.isCommentingEnabled = channelResponce.is_commenting_enabled;
|
|
22
|
-
this.isArticleSuggestionEnabled = channelResponce.is_article_suggestion_enabled;
|
|
23
|
-
this.isVerified = channelResponce.is_verified;
|
|
24
|
-
this.isDeleted = channelResponce.is_deleted;
|
|
25
|
-
this.blogProfileId = channelResponce.blog_profile_id;
|
|
26
|
-
this.isSubscribed = channelResponce.is_subscribed;
|
|
27
|
-
this.isBlocked = channelResponce.is_blocked;
|
|
28
|
-
this.blockReason = channelResponce.block_reason;
|
|
29
|
-
this.blockExpiredDate = new Date(channelResponce.block_expire_date * 1000);
|
|
30
|
-
this.isPermBlocked = channelResponce.is_perm_blocked;
|
|
31
|
-
this.isAdministratorOrHigher = channelResponce.is_administrator_or_higher;
|
|
32
|
-
}
|
|
33
|
-
writeProperties(prop, value) {
|
|
34
|
-
this[prop] = value;
|
|
35
|
-
}
|
|
36
|
-
async getArticles(page, date) {
|
|
37
|
-
const request = await this.client.endpoints.channel.getArticles(this.id, page, date !== null && date !== void 0 ? date : 0);
|
|
38
|
-
return request.content.map(article => new Article_1.Article(this.client, article, this));
|
|
39
|
-
}
|
|
40
|
-
async getArticleById(id) {
|
|
41
|
-
const request = await this.client.endpoints.channel.getArticle(id);
|
|
42
|
-
return request.article ? new Article_1.Article(this.client, request.article) : null;
|
|
43
|
-
}
|
|
44
|
-
async createArticle(data) {
|
|
45
|
-
const request = await this.client.endpoints.channel.createArticle(this.id, data.returnBuildAricle());
|
|
46
|
-
return request.article ? new Article_1.Article(this.client, request.article) : null;
|
|
47
|
-
}
|
|
48
|
-
async subscribe() {
|
|
49
|
-
const request = await this.client.endpoints.channel.subscribe(this.id);
|
|
50
|
-
if (request.code == types_1.DefaultResult.Ok) {
|
|
51
|
-
this.writeProperties("isSubscribed", true);
|
|
52
|
-
}
|
|
53
|
-
return request.code;
|
|
54
|
-
}
|
|
55
|
-
async unsubscribe() {
|
|
56
|
-
const request = await this.client.endpoints.channel.unsubscribe(this.id);
|
|
57
|
-
if (request.code == types_1.DefaultResult.Ok) {
|
|
58
|
-
this.writeProperties("isSubscribed", false);
|
|
59
|
-
}
|
|
60
|
-
return request.code;
|
|
61
|
-
}
|
|
62
|
-
async setAvatar(file) {
|
|
63
|
-
const request = await this.client.endpoints.channel.uploadChannelAvatar(this.id, file);
|
|
64
|
-
if (request.code == types_1.DefaultResult.Ok) {
|
|
65
|
-
this.writeProperties("channelAvatar", request.url);
|
|
66
|
-
}
|
|
67
|
-
return this;
|
|
68
|
-
}
|
|
69
|
-
async setCover(file) {
|
|
70
|
-
const request = await this.client.endpoints.channel.uploadChannelCover(this.id, file);
|
|
71
|
-
if (request.code == types_1.DefaultResult.Ok) {
|
|
72
|
-
this.writeProperties("channelCover", request.url);
|
|
73
|
-
}
|
|
74
|
-
return this;
|
|
75
|
-
}
|
|
76
|
-
async getMediaToken(isSuggestionMode = false, isEditMode = false) {
|
|
77
|
-
const request = await this.client.endpoints.channel.getAvaliableEditor(this.id, isSuggestionMode, isEditMode);
|
|
78
|
-
return request.media_upload_token;
|
|
79
|
-
}
|
|
80
|
-
async edit(data) {
|
|
81
|
-
const request = await this.client.endpoints.channel.editChannel(this.id, data);
|
|
82
|
-
return (request === null || request === void 0 ? void 0 : request.channel) ? new Channel(this.client, request.channel) : null;
|
|
83
|
-
}
|
|
84
|
-
async getArticleSuggestions(page) {
|
|
85
|
-
const request = await this.client.endpoints.channel.getArticleSuggestions(this.id, page);
|
|
86
|
-
return request.content ? request.content.map(article => new SuggestionArticle_1.SuggestionArticle(this.client, article, this)) : null;
|
|
87
|
-
}
|
|
88
|
-
async createArticleSuggestion(data) {
|
|
89
|
-
const request = await this.client.endpoints.channel.createArticleSuggestion(this.id, data.returnBuildAricle());
|
|
90
|
-
return request.code == types_1.DefaultResult.Ok ? new SuggestionArticle_1.SuggestionArticle(this.client, request.article, this) : null;
|
|
91
|
-
}
|
|
92
|
-
async manageBlocklist(profile, data) {
|
|
93
|
-
const request = await this.client.endpoints.channel.manageChannelBlocklist(this.id, {
|
|
94
|
-
target_profile_id: typeof (profile) == "number" ? profile : profile.id,
|
|
95
|
-
...data
|
|
96
|
-
});
|
|
97
|
-
return request.code;
|
|
98
|
-
}
|
|
99
|
-
async getBlocklist(profile) {
|
|
100
|
-
const request = await this.client.endpoints.channel.getChannelBlockProfile(this.id, typeof (profile) == "number" ? profile : profile.id);
|
|
101
|
-
return request.channel_block;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
exports.Channel = Channel;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Anixart } from "../client";
|
|
2
|
-
import { ICollection, DefaultResult, FavoriteCollectionAddResult, FavoriteCollectionDeleteResult, ReleaseAddCollectionResult, CollectionDeleteResult } from "../types";
|
|
3
|
-
import { FullProfile } from "./FullProfile";
|
|
4
|
-
import { Release } from "./Release";
|
|
5
|
-
export declare class Collection {
|
|
6
|
-
private readonly client;
|
|
7
|
-
readonly localId: number;
|
|
8
|
-
readonly id: number;
|
|
9
|
-
readonly creator: FullProfile;
|
|
10
|
-
readonly title: string;
|
|
11
|
-
readonly description: string;
|
|
12
|
-
readonly image: string;
|
|
13
|
-
readonly creationDate: Date;
|
|
14
|
-
readonly lastUpdateDate: Date;
|
|
15
|
-
readonly commentCount: number;
|
|
16
|
-
readonly favoritesCount: number;
|
|
17
|
-
readonly isPrivate: boolean;
|
|
18
|
-
readonly isDeleted: boolean;
|
|
19
|
-
readonly isFavorite: boolean;
|
|
20
|
-
readonly releases: Release[];
|
|
21
|
-
constructor(client: Anixart, collectionResponce: ICollection);
|
|
22
|
-
private writeProperties;
|
|
23
|
-
getReleases(page: number): Promise<Array<Release>>;
|
|
24
|
-
addToFavorite(): Promise<DefaultResult | FavoriteCollectionAddResult>;
|
|
25
|
-
removeInFavorite(): Promise<DefaultResult | FavoriteCollectionDeleteResult>;
|
|
26
|
-
addRelease(id: number): Promise<DefaultResult | ReleaseAddCollectionResult>;
|
|
27
|
-
delete(): Promise<DefaultResult | CollectionDeleteResult>;
|
|
28
|
-
edit(title: string, description: string, releases: Release[], isPrivate: boolean): Promise<Collection | null>;
|
|
29
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Collection = void 0;
|
|
4
|
-
const types_1 = require("../types");
|
|
5
|
-
const FullProfile_1 = require("./FullProfile");
|
|
6
|
-
const Release_1 = require("./Release");
|
|
7
|
-
class Collection {
|
|
8
|
-
constructor(client, collectionResponce) {
|
|
9
|
-
this.client = client;
|
|
10
|
-
this.localId = collectionResponce["@id"];
|
|
11
|
-
this.id = collectionResponce.id;
|
|
12
|
-
this.creator = new FullProfile_1.FullProfile(this.client, collectionResponce.creator);
|
|
13
|
-
this.title = collectionResponce.title;
|
|
14
|
-
this.description = collectionResponce.description;
|
|
15
|
-
this.image = collectionResponce.image;
|
|
16
|
-
this.creationDate = new Date(collectionResponce.creation_date * 1000);
|
|
17
|
-
this.lastUpdateDate = new Date(collectionResponce.last_update_date * 1000);
|
|
18
|
-
this.commentCount = collectionResponce.comment_count;
|
|
19
|
-
this.favoritesCount = collectionResponce.favorites_count;
|
|
20
|
-
this.isPrivate = collectionResponce.is_private;
|
|
21
|
-
this.isDeleted = collectionResponce.is_deleted;
|
|
22
|
-
this.isFavorite = collectionResponce.is_favorite;
|
|
23
|
-
this.releases = collectionResponce.releases.map(r => new Release_1.Release(this.client, r));
|
|
24
|
-
}
|
|
25
|
-
writeProperties(prop, value) {
|
|
26
|
-
this[prop] = value;
|
|
27
|
-
}
|
|
28
|
-
async getReleases(page) {
|
|
29
|
-
const request = await this.client.endpoints.collection.getCollectionReleases(this.id, page);
|
|
30
|
-
return request.content.map(x => new Release_1.Release(this.client, x));
|
|
31
|
-
}
|
|
32
|
-
async addToFavorite() {
|
|
33
|
-
const request = await this.client.endpoints.collection.addCollectionFavorite(this.id);
|
|
34
|
-
return request.code;
|
|
35
|
-
}
|
|
36
|
-
async removeInFavorite() {
|
|
37
|
-
const request = await this.client.endpoints.collection.removeCollectionFavorite(this.id);
|
|
38
|
-
return request.code;
|
|
39
|
-
}
|
|
40
|
-
async addRelease(id) {
|
|
41
|
-
const request = await this.client.endpoints.collection.addReleaseToCollection(this.id, id);
|
|
42
|
-
return request.code;
|
|
43
|
-
}
|
|
44
|
-
async delete() {
|
|
45
|
-
const request = await this.client.endpoints.collection.deleteCollection(this.id);
|
|
46
|
-
return request.code;
|
|
47
|
-
}
|
|
48
|
-
async edit(title, description, releases, isPrivate) {
|
|
49
|
-
const request = await this.client.endpoints.collection.editCollection(this.id, {
|
|
50
|
-
title,
|
|
51
|
-
description,
|
|
52
|
-
releases: releases.map(x => x.id),
|
|
53
|
-
is_private: isPrivate
|
|
54
|
-
});
|
|
55
|
-
return request.code == types_1.DefaultResult.Ok ? new Collection(this.client, request.collection) : null;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
exports.Collection = Collection;
|
package/dist/classes/Dubber.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Release } from "./Release";
|
|
2
|
-
import { Anixart } from "../client";
|
|
3
|
-
import { IDubber } from "../types";
|
|
4
|
-
import { Source } from "./Source";
|
|
5
|
-
export declare class Dubber {
|
|
6
|
-
private readonly client;
|
|
7
|
-
readonly release: Release;
|
|
8
|
-
readonly localId: number;
|
|
9
|
-
readonly id: number;
|
|
10
|
-
readonly episodeCount: number;
|
|
11
|
-
readonly icon: string | null;
|
|
12
|
-
readonly name: string;
|
|
13
|
-
readonly isSub: boolean;
|
|
14
|
-
readonly pinned: boolean;
|
|
15
|
-
readonly viewCount: number;
|
|
16
|
-
readonly workers: string;
|
|
17
|
-
constructor(client: Anixart, dubberResponce: IDubber, release: Release);
|
|
18
|
-
getSources(): Promise<Source[]>;
|
|
19
|
-
}
|
package/dist/classes/Dubber.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Dubber = void 0;
|
|
4
|
-
const Source_1 = require("./Source");
|
|
5
|
-
class Dubber {
|
|
6
|
-
constructor(client, dubberResponce, release) {
|
|
7
|
-
this.client = client;
|
|
8
|
-
this.release = release;
|
|
9
|
-
this.localId = dubberResponce["@id"];
|
|
10
|
-
this.id = dubberResponce.id;
|
|
11
|
-
this.episodeCount = dubberResponce.episode_count;
|
|
12
|
-
this.icon = dubberResponce.icon;
|
|
13
|
-
this.name = dubberResponce.name;
|
|
14
|
-
this.isSub = dubberResponce.is_sub;
|
|
15
|
-
this.pinned = dubberResponce.pinned,
|
|
16
|
-
this.viewCount = dubberResponce.view_count;
|
|
17
|
-
this.workers = dubberResponce.workers;
|
|
18
|
-
}
|
|
19
|
-
async getSources() {
|
|
20
|
-
const request = await this.client.endpoints.release.getDubberSources(this.release.id, this.id);
|
|
21
|
-
return request.sources.map(source => new Source_1.Source(this.client, source, this));
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.Dubber = Dubber;
|