anixapi 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +339 -0
- package/README.md +165 -0
- package/dist/api/auth.d.ts +129 -0
- package/dist/api/auth.js +156 -0
- package/dist/api/bookmarks/export.d.ts +19 -0
- package/dist/api/bookmarks/export.js +24 -0
- package/dist/api/bookmarks/import.d.ts +29 -0
- package/dist/api/bookmarks/import.js +36 -0
- package/dist/api/bookmarks/index.d.ts +2 -0
- package/dist/api/bookmarks/index.js +18 -0
- package/dist/api/channel/article.d.ts +119 -0
- package/dist/api/channel/article.js +144 -0
- package/dist/api/channel/articleComment.d.ts +119 -0
- package/dist/api/channel/articleComment.js +144 -0
- package/dist/api/channel/articleSuggestion.d.ts +69 -0
- package/dist/api/channel/articleSuggestion.js +84 -0
- package/dist/api/channel/channel.d.ts +249 -0
- package/dist/api/channel/channel.js +300 -0
- package/dist/api/channel/index.d.ts +4 -0
- package/dist/api/channel/index.js +20 -0
- package/dist/api/collection/collection.d.ts +59 -0
- package/dist/api/collection/collection.js +72 -0
- package/dist/api/collection/collectionComment.d.ts +109 -0
- package/dist/api/collection/collectionComment.js +132 -0
- package/dist/api/collection/collectionFavorite.d.ts +39 -0
- package/dist/api/collection/collectionFavorite.js +48 -0
- package/dist/api/collection/collectionMy.d.ts +69 -0
- package/dist/api/collection/collectionMy.js +84 -0
- package/dist/api/collection/index.d.ts +4 -0
- package/dist/api/collection/index.js +20 -0
- package/dist/api/config.d.ts +29 -0
- package/dist/api/config.js +36 -0
- package/dist/api/discover.d.ts +59 -0
- package/dist/api/discover.js +72 -0
- package/dist/api/feed.d.ts +39 -0
- package/dist/api/feed.js +48 -0
- package/dist/api/index.d.ts +12 -0
- package/dist/api/index.js +28 -0
- package/dist/api/notification/index.d.ts +2 -0
- package/dist/api/notification/index.js +18 -0
- package/dist/api/notification/notification.d.ts +199 -0
- package/dist/api/notification/notification.js +240 -0
- package/dist/api/notification/notificationPreference.d.ts +159 -0
- package/dist/api/notification/notificationPreference.js +192 -0
- package/dist/api/profile/index.d.ts +10 -0
- package/dist/api/profile/index.js +26 -0
- package/dist/api/profile/profile.d.ts +65 -0
- package/dist/api/profile/profile.js +80 -0
- package/dist/api/profile/profileBadge.d.ts +39 -0
- package/dist/api/profile/profileBadge.js +48 -0
- package/dist/api/profile/profileBlockList.d.ts +39 -0
- package/dist/api/profile/profileBlockList.js +48 -0
- package/dist/api/profile/profileDeletion.d.ts +39 -0
- package/dist/api/profile/profileDeletion.js +48 -0
- package/dist/api/profile/profileFriend.d.ts +99 -0
- package/dist/api/profile/profileFriend.js +120 -0
- package/dist/api/profile/profileHealth.d.ts +59 -0
- package/dist/api/profile/profileHealth.js +72 -0
- package/dist/api/profile/profileList.d.ts +49 -0
- package/dist/api/profile/profileList.js +60 -0
- package/dist/api/profile/profilePreference.d.ts +239 -0
- package/dist/api/profile/profilePreference.js +288 -0
- package/dist/api/profile/profileReleaseVote.d.ts +39 -0
- package/dist/api/profile/profileReleaseVote.js +48 -0
- package/dist/api/profile/profileRoleList.d.ts +19 -0
- package/dist/api/profile/profileRoleList.js +24 -0
- package/dist/api/release/episode.d.ts +99 -0
- package/dist/api/release/episode.js +120 -0
- package/dist/api/release/favorite.d.ts +39 -0
- package/dist/api/release/favorite.js +48 -0
- package/dist/api/release/filter.d.ts +19 -0
- package/dist/api/release/filter.js +24 -0
- package/dist/api/release/history.d.ts +39 -0
- package/dist/api/release/history.js +48 -0
- package/dist/api/release/index.d.ts +13 -0
- package/dist/api/release/index.js +29 -0
- package/dist/api/release/related.d.ts +19 -0
- package/dist/api/release/related.js +24 -0
- package/dist/api/release/release.d.ts +79 -0
- package/dist/api/release/release.js +96 -0
- package/dist/api/release/releaseComment.d.ts +109 -0
- package/dist/api/release/releaseComment.js +132 -0
- package/dist/api/release/releaseStreamingPlatform.d.ts +19 -0
- package/dist/api/release/releaseStreamingPlatform.js +24 -0
- package/dist/api/release/releaseVideo.d.ts +59 -0
- package/dist/api/release/releaseVideo.js +72 -0
- package/dist/api/release/releaseVideoAppeal.d.ts +49 -0
- package/dist/api/release/releaseVideoAppeal.js +60 -0
- package/dist/api/release/releaseVideoFavorite.d.ts +39 -0
- package/dist/api/release/releaseVideoFavorite.js +48 -0
- package/dist/api/release/schedule.d.ts +19 -0
- package/dist/api/release/schedule.js +24 -0
- package/dist/api/release/type.d.ts +39 -0
- package/dist/api/release/type.js +48 -0
- package/dist/api/report.d.ts +189 -0
- package/dist/api/report.js +228 -0
- package/dist/api/search.d.ts +129 -0
- package/dist/api/search.js +156 -0
- package/dist/classes/Article.d.ts +18 -0
- package/dist/classes/Article.js +44 -0
- package/dist/classes/ArticleComment.d.ts +15 -0
- package/dist/classes/ArticleComment.js +37 -0
- package/dist/classes/BaseArticle.d.ts +21 -0
- package/dist/classes/BaseArticle.js +23 -0
- package/dist/classes/BaseComment.d.ts +22 -0
- package/dist/classes/BaseComment.js +25 -0
- package/dist/classes/BaseProfile.d.ts +29 -0
- package/dist/classes/BaseProfile.js +52 -0
- package/dist/classes/Channel.d.ts +47 -0
- package/dist/classes/Channel.js +108 -0
- package/dist/classes/Collection.d.ts +29 -0
- package/dist/classes/Collection.js +58 -0
- package/dist/classes/Dubber.d.ts +19 -0
- package/dist/classes/Dubber.js +24 -0
- package/dist/classes/Episode.d.ts +20 -0
- package/dist/classes/Episode.js +30 -0
- package/dist/classes/FullProfile.d.ts +70 -0
- package/dist/classes/FullProfile.js +92 -0
- package/dist/classes/Release.d.ts +91 -0
- package/dist/classes/Release.js +150 -0
- package/dist/classes/ReleaseComment.d.ts +16 -0
- package/dist/classes/ReleaseComment.js +45 -0
- package/dist/classes/Source.d.ts +15 -0
- package/dist/classes/Source.js +20 -0
- package/dist/classes/SuggestionArticle.d.ts +14 -0
- package/dist/classes/SuggestionArticle.js +30 -0
- package/dist/client.d.ts +49 -0
- package/dist/client.js +183 -0
- package/dist/endpoints.d.ts +63 -0
- package/dist/endpoints.js +67 -0
- package/dist/errors.d.ts +37 -0
- package/dist/errors.js +122 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +23 -0
- package/dist/types/auth.d.ts +127 -0
- package/dist/types/auth.js +47 -0
- package/dist/types/channel.d.ts +350 -0
- package/dist/types/channel.js +104 -0
- package/dist/types/collection.d.ts +105 -0
- package/dist/types/collection.js +44 -0
- package/dist/types/config.d.ts +41 -0
- package/dist/types/config.js +4 -0
- package/dist/types/index.d.ts +13 -0
- package/dist/types/index.js +26 -0
- package/dist/types/notification.d.ts +81 -0
- package/dist/types/notification.js +2 -0
- package/dist/types/profile.d.ts +339 -0
- package/dist/types/profile.js +46 -0
- package/dist/types/release.d.ts +467 -0
- package/dist/types/release.js +39 -0
- package/dist/types/request.d.ts +138 -0
- package/dist/types/request.js +2 -0
- package/dist/types/response.d.ts +104 -0
- package/dist/types/response.js +35 -0
- package/dist/types/settings.d.ts +119 -0
- package/dist/types/settings.js +48 -0
- package/dist/utils/ArticleBuilder.d.ts +38 -0
- package/dist/utils/ArticleBuilder.js +144 -0
- package/dist/utils/LinkParser.d.ts +253 -0
- package/dist/utils/LinkParser.js +253 -0
- package/dist/utils/Utils.d.ts +3 -0
- package/dist/utils/Utils.js +11 -0
- package/docs/DOCUMENTATION.md +290 -0
- package/package.json +55 -0
|
@@ -0,0 +1,108 @@
|
|
|
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.articles(this.id, page);
|
|
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.article.article(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.article.create(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.avatarUpload(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.coverUpload(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.editorAvailable(this.id, {
|
|
78
|
+
is_suggestion: isSuggestionMode,
|
|
79
|
+
is_edit_mode: isEditMode,
|
|
80
|
+
});
|
|
81
|
+
return request.media_upload_token;
|
|
82
|
+
}
|
|
83
|
+
async edit(data) {
|
|
84
|
+
const request = await this.client.endpoints.channel.edit(this.id, data);
|
|
85
|
+
return (request === null || request === void 0 ? void 0 : request.channel) ? new Channel(this.client, request.channel) : null;
|
|
86
|
+
}
|
|
87
|
+
async getArticleSuggestions(page) {
|
|
88
|
+
const request = await this.client.endpoints.articleSuggestion.articleSuggestions(page, { channel_id: this.id });
|
|
89
|
+
return request.content ? request.content.map(article => new SuggestionArticle_1.SuggestionArticle(this.client, article, this)) : null;
|
|
90
|
+
}
|
|
91
|
+
async createArticleSuggestion(data) {
|
|
92
|
+
const request = await this.client.endpoints.articleSuggestion.create(this.id, data.returnBuildAricle());
|
|
93
|
+
return request.code == types_1.DefaultResult.Ok ? new SuggestionArticle_1.SuggestionArticle(this.client, request.article, this) : null;
|
|
94
|
+
}
|
|
95
|
+
async manageBlocklist(profile, data) {
|
|
96
|
+
const request = await this.client.endpoints.channel.blockManage(this.id, {
|
|
97
|
+
target_profile_id: typeof (profile) == "number" ? profile : profile.id,
|
|
98
|
+
...data
|
|
99
|
+
});
|
|
100
|
+
return request.code;
|
|
101
|
+
}
|
|
102
|
+
async getBlocklist(profile) {
|
|
103
|
+
var _a;
|
|
104
|
+
const request = await this.client.endpoints.channel.block(this.id, typeof (profile) == "number" ? profile : profile.id);
|
|
105
|
+
return (_a = request.channel_block) !== null && _a !== void 0 ? _a : null;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
exports.Channel = Channel;
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
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.releases(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.collectionFavorite.add(this.id);
|
|
34
|
+
return request.code;
|
|
35
|
+
}
|
|
36
|
+
async removeInFavorite() {
|
|
37
|
+
const request = await this.client.endpoints.collectionFavorite.delete(this.id);
|
|
38
|
+
return request.code;
|
|
39
|
+
}
|
|
40
|
+
async addRelease(id) {
|
|
41
|
+
const request = await this.client.endpoints.collectionMy.releaseAdd(this.id, { release_id: id });
|
|
42
|
+
return request.code;
|
|
43
|
+
}
|
|
44
|
+
async delete() {
|
|
45
|
+
const request = await this.client.endpoints.collectionMy.delete(this.id);
|
|
46
|
+
return request.code;
|
|
47
|
+
}
|
|
48
|
+
async edit(title, description, releases, isPrivate) {
|
|
49
|
+
const request = await this.client.endpoints.collectionMy.edit(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 && request.collection ? new Collection(this.client, request.collection) : null;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.Collection = Collection;
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
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.episode.sources(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;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Anixart } from '../client';
|
|
2
|
+
import { IEpisode, IRelease, ISource, DefaultResult } from '../types';
|
|
3
|
+
import { Source } from './Source';
|
|
4
|
+
export declare class Episode {
|
|
5
|
+
private readonly client;
|
|
6
|
+
readonly source: Source;
|
|
7
|
+
readonly localId: number;
|
|
8
|
+
readonly position: number;
|
|
9
|
+
readonly release: IRelease | number;
|
|
10
|
+
readonly sourceRaw: ISource | number;
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly url: string;
|
|
13
|
+
readonly iframe: boolean;
|
|
14
|
+
readonly addedDate: Date;
|
|
15
|
+
readonly isFilter: boolean;
|
|
16
|
+
readonly isWatched: boolean;
|
|
17
|
+
constructor(client: Anixart, episode: IEpisode, source: Source);
|
|
18
|
+
setWatched(isWatched: boolean): Promise<DefaultResult>;
|
|
19
|
+
addToHistory(): Promise<DefaultResult>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Episode = void 0;
|
|
4
|
+
class Episode {
|
|
5
|
+
constructor(client, episode, source) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
this.source = source;
|
|
8
|
+
this.localId = episode["@id"];
|
|
9
|
+
this.position = episode.position;
|
|
10
|
+
this.release = episode.release;
|
|
11
|
+
this.sourceRaw = episode.source;
|
|
12
|
+
this.name = episode.name;
|
|
13
|
+
this.url = episode.url;
|
|
14
|
+
this.iframe = episode.iframe;
|
|
15
|
+
this.addedDate = new Date(episode.addedDate * 1000);
|
|
16
|
+
this.isFilter = episode.is_filter;
|
|
17
|
+
this.isWatched = episode.is_watched;
|
|
18
|
+
}
|
|
19
|
+
async setWatched(isWatched) {
|
|
20
|
+
const request = isWatched ?
|
|
21
|
+
await this.client.endpoints.episode.watch(this.source.dubber.release.id, this.source.id, this.position)
|
|
22
|
+
: await this.client.endpoints.episode.unwatch(this.source.dubber.release.id, this.source.id, this.position);
|
|
23
|
+
return request.code;
|
|
24
|
+
}
|
|
25
|
+
async addToHistory() {
|
|
26
|
+
const request = await this.client.endpoints.history.add(this.source.dubber.release.id, this.source.id, this.position);
|
|
27
|
+
return request.code;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.Episode = Episode;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Anixart } from "../client";
|
|
2
|
+
import { BaseProfile } from "./BaseProfile";
|
|
3
|
+
import { IPreferredType, IProfile, IRole, IVoteRelease, IWatchDynamics } from "../types";
|
|
4
|
+
import { Release } from "./Release";
|
|
5
|
+
export declare class FullProfile extends BaseProfile {
|
|
6
|
+
readonly client: Anixart;
|
|
7
|
+
readonly status: string;
|
|
8
|
+
readonly sponsorshipExpires: number;
|
|
9
|
+
readonly history: Release[];
|
|
10
|
+
readonly votes: IVoteRelease[];
|
|
11
|
+
readonly lastActivityTime: number;
|
|
12
|
+
readonly registerDate: number;
|
|
13
|
+
readonly vkPage: string;
|
|
14
|
+
readonly tgPage: string;
|
|
15
|
+
readonly instPage: string;
|
|
16
|
+
readonly ttPage: string;
|
|
17
|
+
readonly discordPage: string;
|
|
18
|
+
readonly watchingCount: number;
|
|
19
|
+
readonly planCount: number;
|
|
20
|
+
readonly completedCount: number;
|
|
21
|
+
readonly holdOnCount: number;
|
|
22
|
+
readonly droppedCount: number;
|
|
23
|
+
readonly favoriteCount: number;
|
|
24
|
+
readonly commentCount: number;
|
|
25
|
+
readonly collectionCount: number;
|
|
26
|
+
readonly videoCount: number;
|
|
27
|
+
readonly watchedEpisodeCount: number;
|
|
28
|
+
readonly watchedTime: number;
|
|
29
|
+
readonly isPrivate: boolean;
|
|
30
|
+
readonly isSponsorTransferred: boolean;
|
|
31
|
+
readonly isBookmarksTransferred: boolean;
|
|
32
|
+
readonly isVkBound: boolean;
|
|
33
|
+
readonly isGoogleBound: boolean;
|
|
34
|
+
readonly isReleaseTypeNotificationsEnabled: boolean;
|
|
35
|
+
readonly isEpisodeNotificationsEnabled: boolean;
|
|
36
|
+
readonly isFirstEpisodeNotificationEnabled: boolean;
|
|
37
|
+
readonly isRelatedReleaseNotificationsEnabled: boolean;
|
|
38
|
+
readonly isReportProcessNotificationsEnabled: boolean;
|
|
39
|
+
readonly isCommentNotificationsEnabled: boolean;
|
|
40
|
+
readonly isMyCollectionCommentNotificationsEnabled: boolean;
|
|
41
|
+
readonly watchDynamics: IWatchDynamics[];
|
|
42
|
+
readonly ratingScore: number;
|
|
43
|
+
readonly isPermBanned: boolean;
|
|
44
|
+
readonly isBlocked: boolean;
|
|
45
|
+
readonly isMeBlocked: boolean;
|
|
46
|
+
readonly isStatsHidden: boolean;
|
|
47
|
+
readonly isCountsHidden: boolean;
|
|
48
|
+
readonly isSocialHidden: boolean;
|
|
49
|
+
readonly isFriendRequestsDisallowed: boolean;
|
|
50
|
+
readonly roles: IRole[];
|
|
51
|
+
readonly preferred_genres: IPreferredType[];
|
|
52
|
+
readonly preferred_audiences: IPreferredType[];
|
|
53
|
+
readonly preferred_themes: IPreferredType[];
|
|
54
|
+
readonly theme_enabled: boolean;
|
|
55
|
+
readonly theme_gradient_start_color: string | null;
|
|
56
|
+
readonly theme_gradient_end_color: string | null;
|
|
57
|
+
readonly theme_gradient_angle: string | null;
|
|
58
|
+
readonly theme_icon_res_name: string | null;
|
|
59
|
+
readonly theme_icon_url: string | null;
|
|
60
|
+
readonly theme_icon_color: string | null;
|
|
61
|
+
readonly theme_icon_alpha: number;
|
|
62
|
+
readonly theme_icon_destiny: string | null;
|
|
63
|
+
readonly theme_icon_size: string | null;
|
|
64
|
+
readonly theme_animation_enabled: boolean;
|
|
65
|
+
readonly theme_animation_speed: string | null;
|
|
66
|
+
readonly theme_background_url: string | null;
|
|
67
|
+
readonly theme_background_mode: string | null;
|
|
68
|
+
readonly theme_background_alpha: number | null;
|
|
69
|
+
constructor(client: Anixart, profile: IProfile);
|
|
70
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FullProfile = void 0;
|
|
4
|
+
const BaseProfile_1 = require("./BaseProfile");
|
|
5
|
+
const Release_1 = require("./Release");
|
|
6
|
+
class FullProfile extends BaseProfile_1.BaseProfile {
|
|
7
|
+
constructor(client, profile) {
|
|
8
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
9
|
+
super(client, {
|
|
10
|
+
id: profile.id,
|
|
11
|
+
login: profile.login,
|
|
12
|
+
avatar: profile.avatar,
|
|
13
|
+
ban_expires: profile.ban_expires,
|
|
14
|
+
ban_reason: profile.ban_reason,
|
|
15
|
+
privilege_level: profile.privilege_level,
|
|
16
|
+
badge_id: (_b = (_a = profile === null || profile === void 0 ? void 0 : profile.badge) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : null,
|
|
17
|
+
badge_name: (_d = (_c = profile === null || profile === void 0 ? void 0 : profile.badge) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : null,
|
|
18
|
+
badge_type: (_f = (_e = profile === null || profile === void 0 ? void 0 : profile.badge) === null || _e === void 0 ? void 0 : _e.type) !== null && _f !== void 0 ? _f : null,
|
|
19
|
+
badge_url: (_h = (_g = profile === null || profile === void 0 ? void 0 : profile.badge) === null || _g === void 0 ? void 0 : _g.image_url) !== null && _h !== void 0 ? _h : null,
|
|
20
|
+
is_banned: profile.is_banned,
|
|
21
|
+
is_sponsor: profile.is_sponsor,
|
|
22
|
+
is_verified: profile.is_verified,
|
|
23
|
+
is_online: profile.is_online,
|
|
24
|
+
friend_count: profile.friend_count,
|
|
25
|
+
friend_status: profile.friend_status
|
|
26
|
+
});
|
|
27
|
+
this.client = client;
|
|
28
|
+
this.status = profile.status;
|
|
29
|
+
this.sponsorshipExpires = profile.sponsorshipExpires;
|
|
30
|
+
this.history = profile.history.map(release => new Release_1.Release(this.client, release));
|
|
31
|
+
this.votes = profile.votes;
|
|
32
|
+
this.lastActivityTime = profile.last_activity_time;
|
|
33
|
+
this.registerDate = profile.register_date;
|
|
34
|
+
this.vkPage = profile.vk_page;
|
|
35
|
+
this.tgPage = profile.tg_page;
|
|
36
|
+
this.instPage = profile.inst_page;
|
|
37
|
+
this.ttPage = profile.tt_page;
|
|
38
|
+
this.discordPage = profile.discord_page;
|
|
39
|
+
this.watchingCount = profile.watching_count;
|
|
40
|
+
this.planCount = profile.plan_count;
|
|
41
|
+
this.completedCount = profile.completed_count;
|
|
42
|
+
this.holdOnCount = profile.hold_on_count;
|
|
43
|
+
this.droppedCount = profile.dropped_count;
|
|
44
|
+
this.favoriteCount = profile.favorite_count;
|
|
45
|
+
this.commentCount = profile.comment_count;
|
|
46
|
+
this.collectionCount = profile.collection_count;
|
|
47
|
+
this.videoCount = profile.video_count;
|
|
48
|
+
this.watchedEpisodeCount = profile.watched_episode_count;
|
|
49
|
+
this.watchedTime = profile.watched_time;
|
|
50
|
+
this.isPrivate = profile.is_private;
|
|
51
|
+
this.isSponsorTransferred = profile.is_sponsor_transferred;
|
|
52
|
+
this.isBookmarksTransferred = profile.is_bookmarks_transferred;
|
|
53
|
+
this.isVkBound = profile.is_vk_bound;
|
|
54
|
+
this.isGoogleBound = profile.is_google_bound;
|
|
55
|
+
this.isReleaseTypeNotificationsEnabled = profile.is_release_type_notifications_enabled;
|
|
56
|
+
this.isEpisodeNotificationsEnabled = profile.is_episode_notifications_enabled;
|
|
57
|
+
this.isFirstEpisodeNotificationEnabled = profile.is_first_episode_notification_enabled;
|
|
58
|
+
this.isRelatedReleaseNotificationsEnabled = profile.is_related_release_notifications_enabled;
|
|
59
|
+
this.isReportProcessNotificationsEnabled = profile.is_report_process_notifications_enabled;
|
|
60
|
+
this.isCommentNotificationsEnabled = profile.is_comment_notifications_enabled;
|
|
61
|
+
this.isMyCollectionCommentNotificationsEnabled = profile.is_my_collection_comment_notifications_enabled;
|
|
62
|
+
this.watchDynamics = profile.watch_dynamics;
|
|
63
|
+
this.ratingScore = profile.rating_score;
|
|
64
|
+
this.isBlocked = profile.is_blocked;
|
|
65
|
+
this.isMeBlocked = profile.is_me_blocked;
|
|
66
|
+
this.isStatsHidden = profile.is_stats_hidden;
|
|
67
|
+
this.isCountsHidden = profile.is_counts_hidden;
|
|
68
|
+
this.isSocialHidden = profile.is_social_hidden;
|
|
69
|
+
this.isFriendRequestsDisallowed = profile.is_friend_requests_disallowed;
|
|
70
|
+
this.roles = profile.roles;
|
|
71
|
+
this.isPermBanned = profile.is_perm_banned;
|
|
72
|
+
this.preferred_genres = profile.preferred_genres;
|
|
73
|
+
this.preferred_audiences = profile.preferred_audiences;
|
|
74
|
+
this.preferred_themes = profile.preferred_themes;
|
|
75
|
+
this.theme_enabled = profile.theme_enabled;
|
|
76
|
+
this.theme_gradient_start_color = profile.theme_gradient_start_color;
|
|
77
|
+
this.theme_gradient_end_color = profile.theme_gradient_end_color;
|
|
78
|
+
this.theme_gradient_angle = profile.theme_gradient_angle;
|
|
79
|
+
this.theme_icon_res_name = profile.theme_icon_res_name;
|
|
80
|
+
this.theme_icon_url = profile.theme_icon_url;
|
|
81
|
+
this.theme_icon_color = profile.theme_icon_color;
|
|
82
|
+
this.theme_icon_alpha = profile.theme_icon_alpha;
|
|
83
|
+
this.theme_icon_destiny = profile.theme_icon_destiny;
|
|
84
|
+
this.theme_icon_size = profile.theme_icon_size;
|
|
85
|
+
this.theme_animation_enabled = profile.theme_animation_enabled;
|
|
86
|
+
this.theme_animation_speed = profile.theme_animation_speed;
|
|
87
|
+
this.theme_background_url = profile.theme_background_url;
|
|
88
|
+
this.theme_background_mode = profile.theme_background_mode;
|
|
89
|
+
this.theme_background_alpha = profile.theme_background_alpha;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
exports.FullProfile = FullProfile;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { Anixart } from "../client";
|
|
2
|
+
import { BookmarkType, IBaseCommentAddRequest, ICommentRelease, IEpisodeLastUpdate, IRelated, IRelease, IReleaseCategory, IReleaseStatus, IVideoBanners, DefaultResult, ReleaseAddCollectionResult, IEpisode } from "../types";
|
|
3
|
+
import { Collection } from "./Collection";
|
|
4
|
+
import { Dubber } from "./Dubber";
|
|
5
|
+
import { ReleaseComment } from "./ReleaseComment";
|
|
6
|
+
export declare class Release {
|
|
7
|
+
private readonly client;
|
|
8
|
+
readonly id: number;
|
|
9
|
+
readonly poster: string;
|
|
10
|
+
readonly image: string;
|
|
11
|
+
readonly year: string;
|
|
12
|
+
readonly genres: string;
|
|
13
|
+
readonly country: string;
|
|
14
|
+
readonly director: string;
|
|
15
|
+
readonly author: string;
|
|
16
|
+
readonly translators: string;
|
|
17
|
+
readonly studio: string;
|
|
18
|
+
readonly description: string;
|
|
19
|
+
readonly note: string | null;
|
|
20
|
+
readonly related: IRelated;
|
|
21
|
+
readonly category: IReleaseCategory;
|
|
22
|
+
readonly rating: number;
|
|
23
|
+
readonly grade: number;
|
|
24
|
+
readonly status: IReleaseStatus;
|
|
25
|
+
readonly duration: number;
|
|
26
|
+
readonly season: number;
|
|
27
|
+
readonly broadcast: number;
|
|
28
|
+
readonly screenshots: string[];
|
|
29
|
+
readonly comments: ICommentRelease[];
|
|
30
|
+
readonly titleOriginal: string;
|
|
31
|
+
readonly titleRu: string;
|
|
32
|
+
readonly titleAlt: string;
|
|
33
|
+
readonly episodesReleased: number;
|
|
34
|
+
readonly episodesTotal: number;
|
|
35
|
+
readonly releaseDate: string;
|
|
36
|
+
readonly vote1Count: number;
|
|
37
|
+
readonly vote2Count: number;
|
|
38
|
+
readonly vote3Count: number;
|
|
39
|
+
readonly vote4Count: number;
|
|
40
|
+
readonly vote5Count: number;
|
|
41
|
+
readonly voteCount: number;
|
|
42
|
+
readonly creationDate: Date;
|
|
43
|
+
readonly lastUpdateDate: Date;
|
|
44
|
+
readonly airedOnDate: number;
|
|
45
|
+
readonly favoritesCount: number;
|
|
46
|
+
readonly watchingCount: number;
|
|
47
|
+
readonly planCount: number;
|
|
48
|
+
readonly completedCount: number;
|
|
49
|
+
readonly holdOnCount: number;
|
|
50
|
+
readonly droppedCount: number;
|
|
51
|
+
readonly isAdult: boolean;
|
|
52
|
+
readonly isPlayDisabled: boolean;
|
|
53
|
+
readonly isTppDisabled: boolean;
|
|
54
|
+
readonly canVideoAppeal: boolean;
|
|
55
|
+
readonly canTorlookSearch: boolean;
|
|
56
|
+
readonly isDeleted: boolean;
|
|
57
|
+
readonly ageRating: number;
|
|
58
|
+
readonly yourVote: number;
|
|
59
|
+
readonly relatedCount: number;
|
|
60
|
+
readonly commentCount: number;
|
|
61
|
+
readonly commentsCount: number;
|
|
62
|
+
readonly collectionCount: number;
|
|
63
|
+
readonly profileListStatus: number;
|
|
64
|
+
readonly statusId: number;
|
|
65
|
+
readonly lastViewTimestamp: number;
|
|
66
|
+
readonly lastViewEpisode: IEpisode;
|
|
67
|
+
readonly isViewed: boolean;
|
|
68
|
+
readonly isFavorite: boolean;
|
|
69
|
+
readonly isViewBlocked: boolean;
|
|
70
|
+
readonly screenshotImages: string[];
|
|
71
|
+
readonly relatedReleases: Release[] | null;
|
|
72
|
+
readonly recommendedReleases: Release[];
|
|
73
|
+
readonly episodeLastUpdate: IEpisodeLastUpdate;
|
|
74
|
+
readonly commentPerDayCount: number;
|
|
75
|
+
readonly videoBanners: IVideoBanners[];
|
|
76
|
+
readonly profileReleaseTypeNotificationPreferenceCount: number;
|
|
77
|
+
readonly isReleaseTypeNotificationsEnabled: boolean;
|
|
78
|
+
constructor(client: Anixart, releaseResponse: IRelease);
|
|
79
|
+
private writeProperties;
|
|
80
|
+
getDubbers(): Promise<Dubber[]>;
|
|
81
|
+
removeFromHistory(): Promise<DefaultResult>;
|
|
82
|
+
setFavorite(favorite: boolean): Promise<DefaultResult>;
|
|
83
|
+
addToList(type: BookmarkType): Promise<DefaultResult>;
|
|
84
|
+
removeFromList(type?: BookmarkType): Promise<DefaultResult>;
|
|
85
|
+
getRelatedReleases(page?: number): Promise<Release[] | null>;
|
|
86
|
+
getComments(page?: number, sort?: number): Promise<ReleaseComment[] | null>;
|
|
87
|
+
addComment(data: IBaseCommentAddRequest): Promise<ReleaseComment | null>;
|
|
88
|
+
addVote(vote: 1 | 2 | 3 | 4 | 5): Promise<DefaultResult>;
|
|
89
|
+
getCollections(page: number, sort?: number): Promise<Collection[]>;
|
|
90
|
+
addToCollection(id: number): Promise<DefaultResult | ReleaseAddCollectionResult>;
|
|
91
|
+
}
|