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
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Endpoints = void 0;
|
|
4
|
+
const article_1 = require("../api/article/article");
|
|
5
|
+
const articleComment_1 = require("../api/article/articleComment");
|
|
6
|
+
const articleSuggestion_1 = require("../api/article/articleSuggestion");
|
|
7
|
+
const auth_1 = require("../api/auth");
|
|
8
|
+
const channel_1 = require("../api/channel");
|
|
9
|
+
const collection_1 = require("../api/collection/collection");
|
|
10
|
+
const collectionComment_1 = require("../api/collection/collectionComment");
|
|
11
|
+
const collectionFavorite_1 = require("../api/collection/collectionFavorite");
|
|
12
|
+
const collectionMy_1 = require("../api/collection/collectionMy");
|
|
13
|
+
const config_1 = require("../api/config");
|
|
14
|
+
const discover_1 = require("../api/discover");
|
|
15
|
+
const export_1 = require("../api/export");
|
|
16
|
+
const feed_1 = require("../api/feed");
|
|
17
|
+
const import_1 = require("../api/import");
|
|
18
|
+
const notification_1 = require("../api/notification/notification");
|
|
19
|
+
const notificationPreference_1 = require("../api/notification/notificationPreference");
|
|
20
|
+
const profile_1 = require("../api/profile/profile");
|
|
21
|
+
const profileBadge_1 = require("../api/profile/profileBadge");
|
|
22
|
+
const profileBlockList_1 = require("../api/profile/profileBlockList");
|
|
23
|
+
const profileDeletion_1 = require("../api/profile/profileDeletion");
|
|
24
|
+
const profileFriend_1 = require("../api/profile/profileFriend");
|
|
25
|
+
const profileHealth_1 = require("../api/profile/profileHealth");
|
|
26
|
+
const profileList_1 = require("../api/profile/profileList");
|
|
27
|
+
const profilePreference_1 = require("../api/profile/profilePreference");
|
|
28
|
+
const profileReleaseVote_1 = require("../api/profile/profileReleaseVote");
|
|
29
|
+
const profileRoleList_1 = require("../api/profile/profileRoleList");
|
|
30
|
+
const episode_1 = require("../api/release/episode");
|
|
31
|
+
const favorite_1 = require("../api/release/favorite");
|
|
32
|
+
const filter_1 = require("../api/release/filter");
|
|
33
|
+
const history_1 = require("../api/release/history");
|
|
34
|
+
const related_1 = require("../api/release/related");
|
|
35
|
+
const release_1 = require("../api/release/release");
|
|
36
|
+
const releaseComment_1 = require("../api/release/releaseComment");
|
|
37
|
+
const releaseStreamingPlatform_1 = require("../api/release/releaseStreamingPlatform");
|
|
38
|
+
const releaseVideo_1 = require("../api/release/releaseVideo");
|
|
39
|
+
const releaseVideoAppeal_1 = require("../api/release/releaseVideoAppeal");
|
|
40
|
+
const releaseVideoFavorite_1 = require("../api/release/releaseVideoFavorite");
|
|
41
|
+
const schedule_1 = require("../api/release/schedule");
|
|
42
|
+
const report_1 = require("../api/report");
|
|
43
|
+
const search_1 = require("../api/search");
|
|
44
|
+
const type_1 = require("../api/type");
|
|
45
|
+
class Endpoints {
|
|
46
|
+
article;
|
|
47
|
+
articleComment;
|
|
48
|
+
articleSuggestion;
|
|
49
|
+
auth;
|
|
50
|
+
channel;
|
|
51
|
+
collection;
|
|
52
|
+
collectionComment;
|
|
53
|
+
collectionFavorite;
|
|
54
|
+
collectionMy;
|
|
55
|
+
config;
|
|
56
|
+
discover;
|
|
57
|
+
export;
|
|
58
|
+
feed;
|
|
59
|
+
import;
|
|
60
|
+
notification;
|
|
61
|
+
notificationPreference;
|
|
62
|
+
profile;
|
|
63
|
+
profileBadge;
|
|
64
|
+
profileBlockList;
|
|
65
|
+
profileDeletion;
|
|
66
|
+
profileFriends;
|
|
67
|
+
profileHealth;
|
|
68
|
+
profileList;
|
|
69
|
+
profilePreference;
|
|
70
|
+
profileReleaseVote;
|
|
71
|
+
profileRoleList;
|
|
72
|
+
episode;
|
|
73
|
+
favorite;
|
|
74
|
+
filter;
|
|
75
|
+
history;
|
|
76
|
+
related;
|
|
77
|
+
release;
|
|
78
|
+
releaseComment;
|
|
79
|
+
releaseStreamingPlatform;
|
|
80
|
+
releaseVideo;
|
|
81
|
+
releaseVideoAppeal;
|
|
82
|
+
releaseVideoFavorite;
|
|
83
|
+
schedule;
|
|
84
|
+
report;
|
|
85
|
+
search;
|
|
86
|
+
type;
|
|
87
|
+
constructor(client) {
|
|
88
|
+
this.article = new article_1.Article(client);
|
|
89
|
+
this.articleComment = new articleComment_1.ArticleComment(client);
|
|
90
|
+
this.articleSuggestion = new articleSuggestion_1.ArticleSuggestion(client);
|
|
91
|
+
this.auth = new auth_1.Auth(client);
|
|
92
|
+
this.channel = new channel_1.Channel(client);
|
|
93
|
+
this.collection = new collection_1.Collection(client);
|
|
94
|
+
this.collectionComment = new collectionComment_1.CollectionComment(client);
|
|
95
|
+
this.collectionFavorite = new collectionFavorite_1.CollectionFavorite(client);
|
|
96
|
+
this.collectionMy = new collectionMy_1.CollectionMy(client);
|
|
97
|
+
this.config = new config_1.Config(client);
|
|
98
|
+
this.discover = new discover_1.Discover(client);
|
|
99
|
+
this.export = new export_1.Export(client);
|
|
100
|
+
this.feed = new feed_1.Feed(client);
|
|
101
|
+
this.import = new import_1.Import(client);
|
|
102
|
+
this.notification = new notification_1.Notification(client);
|
|
103
|
+
this.notificationPreference = new notificationPreference_1.NotificationPreference(client);
|
|
104
|
+
this.profile = new profile_1.Profile(client);
|
|
105
|
+
this.profileBadge = new profileBadge_1.ProfileBadge(client);
|
|
106
|
+
this.profileBlockList = new profileBlockList_1.ProfileBlockList(client);
|
|
107
|
+
this.profileDeletion = new profileDeletion_1.ProfileDeletion(client);
|
|
108
|
+
this.profileFriends = new profileFriend_1.ProfileFriends(client);
|
|
109
|
+
this.profileHealth = new profileHealth_1.ProfileHealth(client);
|
|
110
|
+
this.profileList = new profileList_1.ProfileList(client);
|
|
111
|
+
this.profilePreference = new profilePreference_1.ProfilePreference(client);
|
|
112
|
+
this.profileReleaseVote = new profileReleaseVote_1.ProfileReleaseVote(client);
|
|
113
|
+
this.profileRoleList = new profileRoleList_1.ProfileRoleList(client);
|
|
114
|
+
this.episode = new episode_1.Episode(client);
|
|
115
|
+
this.favorite = new favorite_1.Favorite(client);
|
|
116
|
+
this.filter = new filter_1.Filter(client);
|
|
117
|
+
this.history = new history_1.History(client);
|
|
118
|
+
this.related = new related_1.Related(client);
|
|
119
|
+
this.release = new release_1.Release(client);
|
|
120
|
+
this.releaseComment = new releaseComment_1.ReleaseComment(client);
|
|
121
|
+
this.releaseStreamingPlatform = new releaseStreamingPlatform_1.ReleaseStreamingPlatform(client);
|
|
122
|
+
this.releaseVideo = new releaseVideo_1.ReleaseVideo(client);
|
|
123
|
+
this.releaseVideoAppeal = new releaseVideoAppeal_1.ReleaseVideoAppeal(client);
|
|
124
|
+
this.releaseVideoFavorite = new releaseVideoFavorite_1.ReleaseVideoFavorite(client);
|
|
125
|
+
this.schedule = new schedule_1.Schedule(client);
|
|
126
|
+
this.report = new report_1.Report(client);
|
|
127
|
+
this.search = new search_1.Search(client);
|
|
128
|
+
this.type = new type_1.Type(client);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
exports.Endpoints = Endpoints;
|
|
132
|
+
//# sourceMappingURL=endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../../src/core/endpoints.ts"],"names":[],"mappings":";;;AAEA,oDAAiD;AACjD,kEAA+D;AAC/D,wEAAqE;AACrE,sCAAmC;AACnC,4CAAyC;AACzC,6DAA0D;AAC1D,2EAAwE;AACxE,6EAA0E;AAC1E,iEAA8D;AAC9D,0CAAuC;AACvC,8CAA2C;AAC3C,0CAAuC;AACvC,sCAAmC;AACnC,0CAAuC;AACvC,mEAAgE;AAChE,uFAAoF;AACpF,oDAAiD;AACjD,8DAA2D;AAC3D,sEAAmE;AACnE,oEAAiE;AACjE,gEAA8D;AAC9D,gEAA6D;AAC7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AM,CAAC,CAAC;QACrC,IAAI,CAAC,MAAM,GAAG,IAAI,eAAM,CAAC,MAAM,CAAC,CAAC;QACjC,IAAI,CAAC,MAAM,GAAG,IAAI,eAAM,CAAC,MAAM,CAAC,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,IAAI,WAAI,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;CACF;AAtFD,8BAsFC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare class AnixartError extends Error {
|
|
2
|
+
readonly path: string;
|
|
3
|
+
readonly code: number;
|
|
4
|
+
readonly codeName: string;
|
|
5
|
+
readonly data?: unknown | undefined;
|
|
6
|
+
constructor(message: string, path: string, code: number, codeName: string, data?: unknown | undefined);
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=anixartError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anixartError.d.ts","sourceRoot":"","sources":["../../../src/core/errors/anixartError.ts"],"names":[],"mappings":"AAAA,qBAAa,YAAa,SAAQ,KAAK;aAGf,IAAI,EAAE,MAAM;aACZ,IAAI,EAAE,MAAM;aACZ,QAAQ,EAAE,MAAM;aAChB,IAAI,CAAC,EAAE,OAAO;gBAJ9B,OAAO,EAAE,MAAM,EACC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,OAAO,YAAA;CAKrC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AnixartError = void 0;
|
|
4
|
+
class AnixartError extends Error {
|
|
5
|
+
path;
|
|
6
|
+
code;
|
|
7
|
+
codeName;
|
|
8
|
+
data;
|
|
9
|
+
constructor(message, path, code, codeName, data) {
|
|
10
|
+
super(message);
|
|
11
|
+
this.path = path;
|
|
12
|
+
this.code = code;
|
|
13
|
+
this.codeName = codeName;
|
|
14
|
+
this.data = data;
|
|
15
|
+
this.name = "AnixartError";
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.AnixartError = AnixartError;
|
|
19
|
+
//# sourceMappingURL=anixartError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anixartError.js","sourceRoot":"","sources":["../../../src/core/errors/anixartError.ts"],"names":[],"mappings":";;;AAAA,MAAa,YAAa,SAAQ,KAAK;IAGf;IACA;IACA;IACA;IALpB,YACI,OAAe,EACC,IAAY,EACZ,IAAY,EACZ,QAAgB,EAChB,IAAc;QAE9B,KAAK,CAAC,OAAO,CAAC,CAAC;QALC,SAAI,GAAJ,IAAI,CAAQ;QACZ,SAAI,GAAJ,IAAI,CAAQ;QACZ,aAAQ,GAAR,QAAQ,CAAQ;QAChB,SAAI,GAAJ,IAAI,CAAU;QAG9B,IAAI,CAAC,IAAI,GAAG,cAAc,CAAA;IAC9B,CAAC;CACJ;AAXD,oCAWC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"httpError.d.ts","sourceRoot":"","sources":["../../../src/core/errors/httpError.ts"],"names":[],"mappings":"AAAA,qBAAa,SAAU,SAAQ,KAAK;aAGZ,MAAM,EAAE,MAAM;aACd,QAAQ,CAAC,EAAE,OAAO;gBAFlC,OAAO,EAAE,MAAM,EACC,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,OAAO,YAAA;CAKzC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HttpError = void 0;
|
|
4
|
+
class HttpError extends Error {
|
|
5
|
+
status;
|
|
6
|
+
response;
|
|
7
|
+
constructor(message, status, response) {
|
|
8
|
+
super(message);
|
|
9
|
+
this.status = status;
|
|
10
|
+
this.response = response;
|
|
11
|
+
this.name = "HttpError";
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.HttpError = HttpError;
|
|
15
|
+
//# sourceMappingURL=httpError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"httpError.js","sourceRoot":"","sources":["../../../src/core/errors/httpError.ts"],"names":[],"mappings":";;;AAAA,MAAa,SAAU,SAAQ,KAAK;IAGZ;IACA;IAHpB,YACI,OAAe,EACC,MAAc,EACd,QAAkB;QAElC,KAAK,CAAC,OAAO,CAAC,CAAC;QAHC,WAAM,GAAN,MAAM,CAAQ;QACd,aAAQ,GAAR,QAAQ,CAAU;QAGlC,IAAI,CAAC,IAAI,GAAG,WAAW,CAAA;IAC3B,CAAC;CACJ;AATD,8BASC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { HttpRequest, HttpResponse } from "./httpTypes";
|
|
2
|
+
export declare class HttpClient {
|
|
3
|
+
private _baseUrl;
|
|
4
|
+
private readonly _userAgent;
|
|
5
|
+
private readonly _throwOnAnixartError;
|
|
6
|
+
private _token?;
|
|
7
|
+
constructor(_baseUrl: string, _userAgent: string, _throwOnAnixartError: boolean, _token?: string | undefined);
|
|
8
|
+
private hasResultCode;
|
|
9
|
+
setBaseUrl(baseUrl: string): void;
|
|
10
|
+
getBaseUrl(): string;
|
|
11
|
+
setToken(token: string | undefined): void;
|
|
12
|
+
private getResultCodeName;
|
|
13
|
+
request<T>(request: HttpRequest): Promise<HttpResponse<T>>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=httpClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"httpClient.d.ts","sourceRoot":"","sources":["../../../src/core/http/httpClient.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAI7D,qBAAa,UAAU;IAEnB,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IACrC,OAAO,CAAC,MAAM,CAAC;gBAHP,QAAQ,EAAE,MAAM,EACP,UAAU,EAAE,MAAM,EAClB,oBAAoB,EAAE,OAAO,EACtC,MAAM,CAAC,EAAE,MAAM,YAAA;IAGzB,OAAO,CAAC,aAAa;IASd,UAAU,CAAC,OAAO,EAAE,MAAM;IAG1B,UAAU,IAAI,MAAM;IAIpB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS;IAIzC,OAAO,CAAC,iBAAiB;IASnB,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;CAqKjE"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.HttpClient = void 0;
|
|
7
|
+
const anixartError_1 = require("../errors/anixartError");
|
|
8
|
+
const httpError_1 = require("../errors/httpError");
|
|
9
|
+
const enums_1 = require("../../models/common/enums");
|
|
10
|
+
const form_data_1 = __importDefault(require("form-data"));
|
|
11
|
+
class HttpClient {
|
|
12
|
+
_baseUrl;
|
|
13
|
+
_userAgent;
|
|
14
|
+
_throwOnAnixartError;
|
|
15
|
+
_token;
|
|
16
|
+
constructor(_baseUrl, _userAgent, _throwOnAnixartError, _token) {
|
|
17
|
+
this._baseUrl = _baseUrl;
|
|
18
|
+
this._userAgent = _userAgent;
|
|
19
|
+
this._throwOnAnixartError = _throwOnAnixartError;
|
|
20
|
+
this._token = _token;
|
|
21
|
+
}
|
|
22
|
+
hasResultCode(value) {
|
|
23
|
+
return (typeof value === "object" &&
|
|
24
|
+
value !== null &&
|
|
25
|
+
"code" in value &&
|
|
26
|
+
typeof value.code === "number");
|
|
27
|
+
}
|
|
28
|
+
setBaseUrl(baseUrl) {
|
|
29
|
+
this._baseUrl = baseUrl;
|
|
30
|
+
}
|
|
31
|
+
getBaseUrl() {
|
|
32
|
+
return this._baseUrl;
|
|
33
|
+
}
|
|
34
|
+
setToken(token) {
|
|
35
|
+
this._token = token;
|
|
36
|
+
}
|
|
37
|
+
getResultCodeName(code, resultEnum) {
|
|
38
|
+
return (enums_1.CommonResult[code] ?? resultEnum?.[code] ?? "Unknown");
|
|
39
|
+
}
|
|
40
|
+
async request(request) {
|
|
41
|
+
const url = new URL(request.path, request.customBaseUrl ?? this._baseUrl);
|
|
42
|
+
let body;
|
|
43
|
+
let responseData;
|
|
44
|
+
const headers = {
|
|
45
|
+
"User-Agent": this._userAgent,
|
|
46
|
+
};
|
|
47
|
+
if (request.apiVersion)
|
|
48
|
+
headers["API-Version"] = `v${request.apiVersion}`;
|
|
49
|
+
if (request.query) {
|
|
50
|
+
for (const [key, value] of Object.entries(request.query)) {
|
|
51
|
+
if (value === undefined || value === null)
|
|
52
|
+
continue;
|
|
53
|
+
url.searchParams.set(key, String(value));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (request.auth) {
|
|
57
|
+
switch (request.auth.type) {
|
|
58
|
+
case "Anixart":
|
|
59
|
+
if (request.auth.required && !this._token) {
|
|
60
|
+
throw new anixartError_1.AnixartError("Anixart token is required for this request", request.path, 401, "Unauthorized");
|
|
61
|
+
}
|
|
62
|
+
if (this._token) {
|
|
63
|
+
url.searchParams.set("token", this._token);
|
|
64
|
+
}
|
|
65
|
+
break;
|
|
66
|
+
case "Bearer":
|
|
67
|
+
headers["Authorization"] = `Bearer ${request.auth.token}`;
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
if (request.body) {
|
|
72
|
+
switch (request.body.type) {
|
|
73
|
+
case "JSON":
|
|
74
|
+
headers["Content-Type"] = "application/json";
|
|
75
|
+
body = JSON.stringify(request.body.data);
|
|
76
|
+
break;
|
|
77
|
+
case "URL-Encoded":
|
|
78
|
+
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
|
79
|
+
const searchParams = new URLSearchParams();
|
|
80
|
+
for (const [key, value] of Object.entries(request.body.data)) {
|
|
81
|
+
if (value === undefined || value === null)
|
|
82
|
+
continue;
|
|
83
|
+
searchParams.set(key, String(value));
|
|
84
|
+
}
|
|
85
|
+
body = searchParams;
|
|
86
|
+
break;
|
|
87
|
+
case "Image":
|
|
88
|
+
const formData = new form_data_1.default();
|
|
89
|
+
if (request.body.data.boundary)
|
|
90
|
+
formData.setBoundary(request.body.data.boundary);
|
|
91
|
+
formData.append(request.body.data.type, request.body.data.file, {
|
|
92
|
+
filename: request.body.data.name,
|
|
93
|
+
});
|
|
94
|
+
for (const [key, value] of Object.entries(request.body.data.fields ?? {})) {
|
|
95
|
+
formData.append(key, value);
|
|
96
|
+
}
|
|
97
|
+
headers["Content-Type"] =
|
|
98
|
+
`multipart/form-data; boundary=${formData.getBoundary()}`;
|
|
99
|
+
headers["Content-Length"] = String(formData.getLengthSync());
|
|
100
|
+
body = new Uint8Array(await formData.getBuffer());
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
const mergedHeaders = new Headers(headers);
|
|
105
|
+
new Headers(request.headers).forEach((value, name) => {
|
|
106
|
+
mergedHeaders.set(name, value);
|
|
107
|
+
});
|
|
108
|
+
const timeoutSignal = request.timeoutMs === undefined
|
|
109
|
+
? undefined
|
|
110
|
+
: AbortSignal.timeout(request.timeoutMs);
|
|
111
|
+
const signal = timeoutSignal
|
|
112
|
+
? request.signal
|
|
113
|
+
? AbortSignal.any([request.signal, timeoutSignal])
|
|
114
|
+
: timeoutSignal
|
|
115
|
+
: request.signal;
|
|
116
|
+
const response = await fetch(url, {
|
|
117
|
+
method: request.method,
|
|
118
|
+
headers: mergedHeaders,
|
|
119
|
+
body: body ?? null,
|
|
120
|
+
...(signal ? { signal } : {}),
|
|
121
|
+
});
|
|
122
|
+
responseData = await response.text();
|
|
123
|
+
if (String(responseData).trim() == "") {
|
|
124
|
+
throw new httpError_1.HttpError("Endpoint does not exists", response.status, responseData);
|
|
125
|
+
}
|
|
126
|
+
if (!response.ok) {
|
|
127
|
+
throw new httpError_1.HttpError(`HTTP ${response.status}: ${response.statusText}`, response.status, responseData);
|
|
128
|
+
}
|
|
129
|
+
try {
|
|
130
|
+
const result = JSON.parse(String(responseData));
|
|
131
|
+
const successCodes = request.successCodes ?? [0];
|
|
132
|
+
if (this.hasResultCode(result) &&
|
|
133
|
+
!successCodes.includes(result.code) &&
|
|
134
|
+
(request.throwOnAnixartError ?? this._throwOnAnixartError ?? true)) {
|
|
135
|
+
const codeName = this.getResultCodeName(result.code, request.resultEnum);
|
|
136
|
+
throw new anixartError_1.AnixartError(`Anixart API Error: ${codeName} (${result.code})`, request.path, result.code ?? null, codeName, result);
|
|
137
|
+
}
|
|
138
|
+
return {
|
|
139
|
+
status: response.status,
|
|
140
|
+
headers: response.headers,
|
|
141
|
+
data: result,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
catch (error) {
|
|
145
|
+
if (error instanceof SyntaxError) {
|
|
146
|
+
throw new httpError_1.HttpError("Failed to parse response as JSON", response.status, responseData);
|
|
147
|
+
}
|
|
148
|
+
throw error;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
exports.HttpClient = HttpClient;
|
|
153
|
+
//# sourceMappingURL=httpClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"httpClient.js","sourceRoot":"","sources":["../../../src/core/http/httpClient.ts"],"names":[],"mappings":";;;;;;AAAA,yDAAsD;AACtD,mDAAgD;AAEhD,qDAAyD;AACzD,0DAAiC;AAEjC,MAAa,UAAU;IAEX;IACS;IACA;IACT;IAJV,YACU,QAAgB,EACP,UAAkB,EAClB,oBAA6B,EACtC,MAAe;QAHf,aAAQ,GAAR,QAAQ,CAAQ;QACP,eAAU,GAAV,UAAU,CAAQ;QAClB,yBAAoB,GAApB,oBAAoB,CAAS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;QAED,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAM,CAAC;YACrD,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,IAAI,CAAC,CAAC,CAAC,CAAC;YAEjD,IACE,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC;gBAC1B,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;gBACnC,CAAC,OAAO,CAAC,mBAAmB,IAAI,IAAI,CAAC,oBAAoB,IAAI,IAAI,CAAC,EAClE,CAAC;gBACD,MAAM,QAAQ,GAAG,IAAI,CAAC,iBAAiB,CACrC,MAAM,CAAC,IAAI,EACX,OAAO,CAAC,UAAU,CACnB,CAAC;gBAEF,MAAM,IAAI,2BAAY,CACpB,sBAAsB,QAAQ,KAAK,MAAM,CAAC,IAAI,GAAG,EACjD,OAAO,CAAC,IAAI,EACZ,MAAM,CAAC,IAAI,IAAI,IAAI,EACnB,QAAQ,EACR,MAAM,CACP,CAAC;YACJ,CAAC;YAED,OAAO;gBACL,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,OAAO,EAAE,QAAQ,CAAC,OAAO;gBACzB,IAAI,EAAE,MAAM;aACb,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,WAAW,EAAE,CAAC;gBACjC,MAAM,IAAI,qBAAS,CACjB,kCAAkC,EAClC,QAAQ,CAAC,MAAM,EACf,YAAY,CACb,CAAC;YACJ,CAAC;YAED,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF;AA1MD,gCA0MC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export type HttpMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
|
|
2
|
+
export type HttpParameter = string | number | boolean | null | undefined;
|
|
3
|
+
export type HttpParameters = Record<string, HttpParameter>;
|
|
4
|
+
export type HttpBody<T = unknown> = {
|
|
5
|
+
type: "JSON";
|
|
6
|
+
data: T;
|
|
7
|
+
} | {
|
|
8
|
+
type: "URL-Encoded";
|
|
9
|
+
data: HttpParameters;
|
|
10
|
+
} | {
|
|
11
|
+
type: "Image";
|
|
12
|
+
data: {
|
|
13
|
+
name: string;
|
|
14
|
+
file: Buffer;
|
|
15
|
+
type: string;
|
|
16
|
+
boundary?: string;
|
|
17
|
+
fields?: Record<string, string>;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export type HttpAuthType = {
|
|
21
|
+
type: "Anixart";
|
|
22
|
+
required?: boolean;
|
|
23
|
+
} | {
|
|
24
|
+
type: "Bearer";
|
|
25
|
+
token: string;
|
|
26
|
+
};
|
|
27
|
+
export interface IRequestOptions {
|
|
28
|
+
timeoutMs?: number;
|
|
29
|
+
signal?: AbortSignal;
|
|
30
|
+
throwOnAnixartError?: boolean;
|
|
31
|
+
apiVersion?: number;
|
|
32
|
+
}
|
|
33
|
+
export interface HttpRequest<T = unknown> extends IRequestOptions {
|
|
34
|
+
method: HttpMethod;
|
|
35
|
+
path: string;
|
|
36
|
+
query?: HttpParameters;
|
|
37
|
+
body?: HttpBody<T>;
|
|
38
|
+
auth?: HttpAuthType;
|
|
39
|
+
customBaseUrl?: string;
|
|
40
|
+
successCodes?: number[];
|
|
41
|
+
resultEnum?: Record<number, string>;
|
|
42
|
+
headers?: HeadersInit;
|
|
43
|
+
}
|
|
44
|
+
export interface HttpResponse<T = unknown> {
|
|
45
|
+
status: number;
|
|
46
|
+
headers: Headers;
|
|
47
|
+
data: T;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=httpTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"httpTypes.d.ts","sourceRoot":"","sources":["../../../src/core/http/httpTypes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAClB,KAAK,GACL,MAAM,GACN,KAAK,GACL,QAAQ,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EnB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAExB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEpC,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB;AAED,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,OAAO;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,CAAC,CAAC;CACT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"httpTypes.js","sourceRoot":"","sources":["../../../src/core/http/httpTypes.ts"],"names":[],"mappings":""}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
export { Anixart, type IAnixartOptions } from "./
|
|
2
|
-
export
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
1
|
+
export { Anixart, type IAnixartOptions } from "./core/anixartClient";
|
|
2
|
+
export type { IRequestOptions } from "./core/http/httpTypes";
|
|
3
|
+
export * from "./utils/ArticleBuilder";
|
|
4
|
+
export * from "./utils/linkParser";
|
|
5
|
+
export * from "./models";
|
|
6
|
+
export * from "./core/errors/anixartError";
|
|
7
|
+
export * from "./core/errors/httpError";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACrE,YAAY,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -15,8 +15,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.Anixart = void 0;
|
|
18
|
-
var
|
|
19
|
-
Object.defineProperty(exports, "Anixart", { enumerable: true, get: function () { return
|
|
20
|
-
__exportStar(require("./utils/LinkParser"), exports);
|
|
18
|
+
var anixartClient_1 = require("./core/anixartClient");
|
|
19
|
+
Object.defineProperty(exports, "Anixart", { enumerable: true, get: function () { return anixartClient_1.Anixart; } });
|
|
21
20
|
__exportStar(require("./utils/ArticleBuilder"), exports);
|
|
22
|
-
__exportStar(require("./
|
|
21
|
+
__exportStar(require("./utils/linkParser"), exports);
|
|
22
|
+
__exportStar(require("./models"), exports);
|
|
23
|
+
__exportStar(require("./core/errors/anixartError"), exports);
|
|
24
|
+
__exportStar(require("./core/errors/httpError"), exports);
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,sDAAqE;AAA5D,wGAAA,OAAO,OAAA;AAEhB,yDAAuC;AACvC,qDAAmC;AACnC,2CAAyB;AACzB,6DAA2C;AAC3C,0DAAwC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export declare enum ArticleResult {
|
|
2
|
+
ArticleDeleted = 2
|
|
3
|
+
}
|
|
4
|
+
export declare enum ArticleCreateEditResult {
|
|
5
|
+
InvalidRepostArticle = 2,
|
|
6
|
+
InvalidPayload = 3,
|
|
7
|
+
InvalidTags = 4,
|
|
8
|
+
TemporarilyDisabled = 5,
|
|
9
|
+
ArticleLimitReached = 6,
|
|
10
|
+
ChannelNotFound = 7,
|
|
11
|
+
ChannelNotOwned = 8,
|
|
12
|
+
ChannelCreatorBanned = 9,
|
|
13
|
+
ChannelBlocked = 10,
|
|
14
|
+
ArticleNotFound = 11,
|
|
15
|
+
ArticleDeleted = 12,
|
|
16
|
+
BlogNotCreated = 13
|
|
17
|
+
}
|
|
18
|
+
export declare enum ArticleDeleteResult {
|
|
19
|
+
ArticleNotFound = 2,
|
|
20
|
+
ArticleNotOwned = 3,
|
|
21
|
+
ArticleDeleted = 4
|
|
22
|
+
}
|
|
23
|
+
export declare enum ArticleEditPinnedResult {
|
|
24
|
+
ChannelNotFound = 2,
|
|
25
|
+
ChannelNotOwned = 3,
|
|
26
|
+
ArticleNotFound = 4,
|
|
27
|
+
ArticleDeleted = 5
|
|
28
|
+
}
|
|
29
|
+
export declare enum ArticleMuteResult {
|
|
30
|
+
ArticleNotFound = 2,
|
|
31
|
+
ChannelNotFound = 3,
|
|
32
|
+
ChannelOwned = 4
|
|
33
|
+
}
|
|
34
|
+
export declare enum ArticleSuggestionDeleteResult {
|
|
35
|
+
ArticleSuggestionNotFound = 2,
|
|
36
|
+
ArticleSuggestionNotOwned = 3
|
|
37
|
+
}
|
|
38
|
+
export declare enum ArticleEventEntryPoint {
|
|
39
|
+
Unknown = "unknown",
|
|
40
|
+
Article = "article",
|
|
41
|
+
Channel = "channel",
|
|
42
|
+
Feed = "feed",
|
|
43
|
+
Latest = "latest",
|
|
44
|
+
Search = "search"
|
|
45
|
+
}
|
|
46
|
+
export declare enum ArticleEventType {
|
|
47
|
+
View = "view",
|
|
48
|
+
Open = "open",
|
|
49
|
+
Read = "read"
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=enums.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../../src/models/article/enums.ts"],"names":[],"mappings":"AAAA,oBAAY,aAAa;IACvB,cAAc,IAAI;CACnB;AAED,oBAAY,uBAAuB;IACjC,oBAAoB,IAAI;IACxB,cAAc,IAAI;IAClB,WAAW,IAAI;IACf,mBAAmB,IAAI;IACvB,mBAAmB,IAAI;IACvB,eAAe,IAAI;IACnB,eAAe,IAAI;IACnB,oBAAoB,IAAI;IACxB,cAAc,KAAK;IACnB,eAAe,KAAK;IACpB,cAAc,KAAK;IACnB,cAAc,KAAK;CACpB;AAED,oBAAY,mBAAmB;IAC7B,eAAe,IAAI;IACnB,eAAe,IAAI;IACnB,cAAc,IAAI;CACnB;AAED,oBAAY,uBAAuB;IACjC,eAAe,IAAI;IACnB,eAAe,IAAI;IACnB,eAAe,IAAI;IACnB,cAAc,IAAI;CACnB;AAED,oBAAY,iBAAiB;IAC3B,eAAe,IAAI;IACnB,eAAe,IAAI;IACnB,YAAY,IAAI;CACjB;AAED,oBAAY,6BAA6B;IACvC,yBAAyB,IAAI;IAC7B,yBAAyB,IAAI;CAC9B;AAED,oBAAY,sBAAsB;IAChC,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB;AAED,oBAAY,gBAAgB;IAC1B,IAAI,SAAS;IACb,IAAI,SAAS;IACb,IAAI,SAAS;CACd"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArticleEventType = exports.ArticleEventEntryPoint = exports.ArticleSuggestionDeleteResult = exports.ArticleMuteResult = exports.ArticleEditPinnedResult = exports.ArticleDeleteResult = exports.ArticleCreateEditResult = exports.ArticleResult = void 0;
|
|
4
|
+
var ArticleResult;
|
|
5
|
+
(function (ArticleResult) {
|
|
6
|
+
ArticleResult[ArticleResult["ArticleDeleted"] = 2] = "ArticleDeleted";
|
|
7
|
+
})(ArticleResult || (exports.ArticleResult = ArticleResult = {}));
|
|
8
|
+
var ArticleCreateEditResult;
|
|
9
|
+
(function (ArticleCreateEditResult) {
|
|
10
|
+
ArticleCreateEditResult[ArticleCreateEditResult["InvalidRepostArticle"] = 2] = "InvalidRepostArticle";
|
|
11
|
+
ArticleCreateEditResult[ArticleCreateEditResult["InvalidPayload"] = 3] = "InvalidPayload";
|
|
12
|
+
ArticleCreateEditResult[ArticleCreateEditResult["InvalidTags"] = 4] = "InvalidTags";
|
|
13
|
+
ArticleCreateEditResult[ArticleCreateEditResult["TemporarilyDisabled"] = 5] = "TemporarilyDisabled";
|
|
14
|
+
ArticleCreateEditResult[ArticleCreateEditResult["ArticleLimitReached"] = 6] = "ArticleLimitReached";
|
|
15
|
+
ArticleCreateEditResult[ArticleCreateEditResult["ChannelNotFound"] = 7] = "ChannelNotFound";
|
|
16
|
+
ArticleCreateEditResult[ArticleCreateEditResult["ChannelNotOwned"] = 8] = "ChannelNotOwned";
|
|
17
|
+
ArticleCreateEditResult[ArticleCreateEditResult["ChannelCreatorBanned"] = 9] = "ChannelCreatorBanned";
|
|
18
|
+
ArticleCreateEditResult[ArticleCreateEditResult["ChannelBlocked"] = 10] = "ChannelBlocked";
|
|
19
|
+
ArticleCreateEditResult[ArticleCreateEditResult["ArticleNotFound"] = 11] = "ArticleNotFound";
|
|
20
|
+
ArticleCreateEditResult[ArticleCreateEditResult["ArticleDeleted"] = 12] = "ArticleDeleted";
|
|
21
|
+
ArticleCreateEditResult[ArticleCreateEditResult["BlogNotCreated"] = 13] = "BlogNotCreated";
|
|
22
|
+
})(ArticleCreateEditResult || (exports.ArticleCreateEditResult = ArticleCreateEditResult = {}));
|
|
23
|
+
var ArticleDeleteResult;
|
|
24
|
+
(function (ArticleDeleteResult) {
|
|
25
|
+
ArticleDeleteResult[ArticleDeleteResult["ArticleNotFound"] = 2] = "ArticleNotFound";
|
|
26
|
+
ArticleDeleteResult[ArticleDeleteResult["ArticleNotOwned"] = 3] = "ArticleNotOwned";
|
|
27
|
+
ArticleDeleteResult[ArticleDeleteResult["ArticleDeleted"] = 4] = "ArticleDeleted";
|
|
28
|
+
})(ArticleDeleteResult || (exports.ArticleDeleteResult = ArticleDeleteResult = {}));
|
|
29
|
+
var ArticleEditPinnedResult;
|
|
30
|
+
(function (ArticleEditPinnedResult) {
|
|
31
|
+
ArticleEditPinnedResult[ArticleEditPinnedResult["ChannelNotFound"] = 2] = "ChannelNotFound";
|
|
32
|
+
ArticleEditPinnedResult[ArticleEditPinnedResult["ChannelNotOwned"] = 3] = "ChannelNotOwned";
|
|
33
|
+
ArticleEditPinnedResult[ArticleEditPinnedResult["ArticleNotFound"] = 4] = "ArticleNotFound";
|
|
34
|
+
ArticleEditPinnedResult[ArticleEditPinnedResult["ArticleDeleted"] = 5] = "ArticleDeleted";
|
|
35
|
+
})(ArticleEditPinnedResult || (exports.ArticleEditPinnedResult = ArticleEditPinnedResult = {}));
|
|
36
|
+
var ArticleMuteResult;
|
|
37
|
+
(function (ArticleMuteResult) {
|
|
38
|
+
ArticleMuteResult[ArticleMuteResult["ArticleNotFound"] = 2] = "ArticleNotFound";
|
|
39
|
+
ArticleMuteResult[ArticleMuteResult["ChannelNotFound"] = 3] = "ChannelNotFound";
|
|
40
|
+
ArticleMuteResult[ArticleMuteResult["ChannelOwned"] = 4] = "ChannelOwned";
|
|
41
|
+
})(ArticleMuteResult || (exports.ArticleMuteResult = ArticleMuteResult = {}));
|
|
42
|
+
var ArticleSuggestionDeleteResult;
|
|
43
|
+
(function (ArticleSuggestionDeleteResult) {
|
|
44
|
+
ArticleSuggestionDeleteResult[ArticleSuggestionDeleteResult["ArticleSuggestionNotFound"] = 2] = "ArticleSuggestionNotFound";
|
|
45
|
+
ArticleSuggestionDeleteResult[ArticleSuggestionDeleteResult["ArticleSuggestionNotOwned"] = 3] = "ArticleSuggestionNotOwned";
|
|
46
|
+
})(ArticleSuggestionDeleteResult || (exports.ArticleSuggestionDeleteResult = ArticleSuggestionDeleteResult = {}));
|
|
47
|
+
var ArticleEventEntryPoint;
|
|
48
|
+
(function (ArticleEventEntryPoint) {
|
|
49
|
+
ArticleEventEntryPoint["Unknown"] = "unknown";
|
|
50
|
+
ArticleEventEntryPoint["Article"] = "article";
|
|
51
|
+
ArticleEventEntryPoint["Channel"] = "channel";
|
|
52
|
+
ArticleEventEntryPoint["Feed"] = "feed";
|
|
53
|
+
ArticleEventEntryPoint["Latest"] = "latest";
|
|
54
|
+
ArticleEventEntryPoint["Search"] = "search";
|
|
55
|
+
})(ArticleEventEntryPoint || (exports.ArticleEventEntryPoint = ArticleEventEntryPoint = {}));
|
|
56
|
+
var ArticleEventType;
|
|
57
|
+
(function (ArticleEventType) {
|
|
58
|
+
ArticleEventType["View"] = "view";
|
|
59
|
+
ArticleEventType["Open"] = "open";
|
|
60
|
+
ArticleEventType["Read"] = "read";
|
|
61
|
+
})(ArticleEventType || (exports.ArticleEventType = ArticleEventType = {}));
|
|
62
|
+
//# sourceMappingURL=enums.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enums.js","sourceRoot":"","sources":["../../../src/models/article/enums.ts"],"names":[],"mappings":";;;AAAA,IAAY,aAEX;AAFD,WAAY,aAAa;IACvB,qEAAkB,CAAA;AACpB,CAAC,EAFW,aAAa,6BAAb,aAAa,QAExB;AAED,IAAY,uBAaX;AAbD,WAAY,uBAAuB;IACjC,qGAAwB,CAAA;IACxB,yFAAkB,CAAA;IAClB,mFAAe,CAAA;IACf,mGAAuB,CAAA;IACvB,mGAAuB,CAAA;IACvB,2FAAmB,CAAA;IACnB,2FAAmB,CAAA;IACnB,qGAAwB,CAAA;IACxB,0FAAmB,CAAA;IACnB,4FAAoB,CAAA;IACpB,0FAAmB,CAAA;IACnB,0FAAmB,CAAA;AACrB,CAAC,EAbW,uBAAuB,uCAAvB,uBAAuB,QAalC;AAED,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,mFAAmB,CAAA;IACnB,mFAAmB,CAAA;IACnB,iFAAkB,CAAA;AACpB,CAAC,EAJW,mBAAmB,mCAAnB,mBAAmB,QAI9B;AAED,IAAY,uBAKX;AALD,WAAY,uBAAuB;IACjC,2FAAmB,CAAA;IACnB,2FAAmB,CAAA;IACnB,2FAAmB,CAAA;IACnB,yFA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