anixartjs 0.0.7 → 0.0.9
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/dist/api/channel.js +2 -2
- package/dist/api/notification.d.ts +1 -1
- package/dist/api/notification.js +3 -2
- package/dist/classes/BaseArticle.d.ts +1 -1
- package/dist/classes/FullProfile.d.ts +19 -1
- package/dist/classes/FullProfile.js +18 -0
- package/dist/client.d.ts +7 -0
- package/dist/client.js +7 -3
- package/dist/types/channel.d.ts +2 -1
- package/dist/types/profile.d.ts +23 -1
- package/package.json +1 -1
package/dist/api/channel.js
CHANGED
|
@@ -72,13 +72,13 @@ class Channel {
|
|
|
72
72
|
return await this.client.call({ path: `/article/comment/vote/${id}/${vote}`, ...options });
|
|
73
73
|
}
|
|
74
74
|
async uploadArticleImage(media_token, file, options) {
|
|
75
|
-
return await this.client.call({ path: `/content/upload`, method: "POST", image: { stream: file, name: Utils_1.Utils.generateTempFileName(), type: "file" }, bearer: media_token, customBaseUrl: "https://editor.
|
|
75
|
+
return await this.client.call({ path: `/content/upload`, method: "POST", image: { stream: file, name: Utils_1.Utils.generateTempFileName(), type: "file" }, bearer: media_token, customBaseUrl: "https://editor.anixsekai.com", ...options });
|
|
76
76
|
}
|
|
77
77
|
async uploadChannelAvatar(id, file, options) {
|
|
78
78
|
return await this.client.call({ path: `/channel/avatar/upload/${id}`, method: "POST", image: { stream: file, name: Utils_1.Utils.generateTempFileName(), type: "image" }, ...options });
|
|
79
79
|
}
|
|
80
80
|
async generateEmbedData(type, media_token, link, options) {
|
|
81
|
-
let request = await this.client.call({ path: `/embed/${type}`, customBaseUrl: "https://editor.
|
|
81
|
+
let request = await this.client.call({ path: `/embed/${type}`, customBaseUrl: "https://editor.anixsekai.com", bearer: media_token, queryParams: { url: link }, ...options });
|
|
82
82
|
request.url = link;
|
|
83
83
|
return request;
|
|
84
84
|
}
|
|
@@ -10,5 +10,5 @@ export declare class Notification {
|
|
|
10
10
|
getEpisodeNotificaions(page: number, options?: IBaseApiParams): Promise<IPageableResponse<any>>;
|
|
11
11
|
getReleaseCommentNotifications(page: number, options?: IBaseApiParams): Promise<IPageableResponse<any>>;
|
|
12
12
|
getCollectionCommentNotifications(page: number, options?: IBaseApiParams): Promise<IPageableResponse<any>>;
|
|
13
|
-
|
|
13
|
+
removeAllNotifications(options?: IBaseApiParams): Promise<IResponse>;
|
|
14
14
|
}
|
package/dist/api/notification.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Notification = void 0;
|
|
4
|
+
//TODO: Удаление конкретных уведомлений
|
|
4
5
|
class Notification {
|
|
5
6
|
constructor(client) {
|
|
6
7
|
this.client = client;
|
|
@@ -26,8 +27,8 @@ class Notification {
|
|
|
26
27
|
async getCollectionCommentNotifications(page, options) {
|
|
27
28
|
return await this.client.call({ path: `/notification/collectionComments/${page}`, ...options });
|
|
28
29
|
}
|
|
29
|
-
async
|
|
30
|
-
return await this.client.call({ path: `/notification/
|
|
30
|
+
async removeAllNotifications(options) {
|
|
31
|
+
return await this.client.call({ path: `/notification/delete/all`, ...options });
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
exports.Notification = Notification;
|
|
@@ -14,7 +14,7 @@ export declare class BaseArticle {
|
|
|
14
14
|
readonly voteCount: number;
|
|
15
15
|
readonly creationDate: Date;
|
|
16
16
|
readonly lastUpdateDate: Date;
|
|
17
|
-
readonly underModerationReason: string;
|
|
17
|
+
readonly underModerationReason: string | null;
|
|
18
18
|
readonly isUnderModeration: boolean;
|
|
19
19
|
readonly author: FullProfile | null;
|
|
20
20
|
constructor(client: Anixart, articleResponce: IArticle, channel?: Channel);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Anixart } from "../client";
|
|
2
2
|
import { BaseProfile } from "./BaseProfile";
|
|
3
|
-
import { IProfile, IRole, IVoteRelease, IWatchDynamics } from "../types";
|
|
3
|
+
import { IPreferredType, IProfile, IRole, IVoteRelease, IWatchDynamics } from "../types";
|
|
4
4
|
import { Release } from "./Release";
|
|
5
5
|
export declare class FullProfile extends BaseProfile {
|
|
6
6
|
readonly client: Anixart;
|
|
@@ -49,5 +49,23 @@ export declare class FullProfile extends BaseProfile {
|
|
|
49
49
|
readonly isSocialHidden: boolean;
|
|
50
50
|
readonly isFriendRequestsDisallowed: boolean;
|
|
51
51
|
readonly roles: IRole[];
|
|
52
|
+
readonly preferred_genres: IPreferredType[];
|
|
53
|
+
readonly preferred_audiences: IPreferredType[];
|
|
54
|
+
readonly preferred_themes: IPreferredType[];
|
|
55
|
+
readonly theme_enabled: boolean;
|
|
56
|
+
readonly theme_gradient_start_color: string | null;
|
|
57
|
+
readonly theme_gradient_end_color: string | null;
|
|
58
|
+
readonly theme_gradient_angle: string | null;
|
|
59
|
+
readonly theme_icon_res_name: string | null;
|
|
60
|
+
readonly theme_icon_url: string | null;
|
|
61
|
+
readonly theme_icon_color: string | null;
|
|
62
|
+
readonly theme_icon_alpha: number;
|
|
63
|
+
readonly theme_icon_destiny: string | null;
|
|
64
|
+
readonly theme_icon_size: string | null;
|
|
65
|
+
readonly theme_animation_enabled: boolean;
|
|
66
|
+
readonly theme_animation_speed: string | null;
|
|
67
|
+
readonly theme_background_url: string | null;
|
|
68
|
+
readonly theme_background_mode: string | null;
|
|
69
|
+
readonly theme_background_alpha: number | null;
|
|
52
70
|
constructor(client: Anixart, profile: IProfile);
|
|
53
71
|
}
|
|
@@ -70,6 +70,24 @@ class FullProfile extends BaseProfile_1.BaseProfile {
|
|
|
70
70
|
this.isFriendRequestsDisallowed = profile.is_friend_requests_disallowed;
|
|
71
71
|
this.roles = profile.roles;
|
|
72
72
|
this.isPermBanned = profile.is_perm_banned;
|
|
73
|
+
this.preferred_genres = profile.preferred_genres;
|
|
74
|
+
this.preferred_audiences = profile.preferred_audiences;
|
|
75
|
+
this.preferred_themes = profile.preferred_themes;
|
|
76
|
+
this.theme_enabled = profile.theme_enabled;
|
|
77
|
+
this.theme_gradient_start_color = profile.theme_gradient_start_color;
|
|
78
|
+
this.theme_gradient_end_color = profile.theme_gradient_end_color;
|
|
79
|
+
this.theme_gradient_angle = profile.theme_gradient_angle;
|
|
80
|
+
this.theme_icon_res_name = profile.theme_icon_res_name;
|
|
81
|
+
this.theme_icon_url = profile.theme_icon_url;
|
|
82
|
+
this.theme_icon_color = profile.theme_icon_color;
|
|
83
|
+
this.theme_icon_alpha = profile.theme_icon_alpha;
|
|
84
|
+
this.theme_icon_destiny = profile.theme_icon_destiny;
|
|
85
|
+
this.theme_icon_size = profile.theme_icon_size;
|
|
86
|
+
this.theme_animation_enabled = profile.theme_animation_enabled;
|
|
87
|
+
this.theme_animation_speed = profile.theme_animation_speed;
|
|
88
|
+
this.theme_background_url = profile.theme_background_url;
|
|
89
|
+
this.theme_background_mode = profile.theme_background_mode;
|
|
90
|
+
this.theme_background_alpha = profile.theme_background_alpha;
|
|
73
91
|
}
|
|
74
92
|
}
|
|
75
93
|
exports.FullProfile = FullProfile;
|
package/dist/client.d.ts
CHANGED
|
@@ -9,6 +9,12 @@ export interface IAnixartOptions {
|
|
|
9
9
|
baseUrl?: string | URL;
|
|
10
10
|
token?: string;
|
|
11
11
|
}
|
|
12
|
+
export interface IAnixartEndpointUrls {
|
|
13
|
+
[key: string]: {
|
|
14
|
+
api_url: string;
|
|
15
|
+
should_use_mirror_urls: boolean;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
12
18
|
/**
|
|
13
19
|
* Класс для работы с API Anixart
|
|
14
20
|
*/
|
|
@@ -17,6 +23,7 @@ export declare class Anixart {
|
|
|
17
23
|
token?: string | null;
|
|
18
24
|
readonly endpoints: Endpoints;
|
|
19
25
|
constructor(options: IAnixartOptions);
|
|
26
|
+
static getEndpointUrls(): Promise<IAnixartEndpointUrls>;
|
|
20
27
|
getChannelById(id: number): Promise<Channel | null>;
|
|
21
28
|
getProfileById(id: number): Promise<FullProfile>;
|
|
22
29
|
getLatestFeed(page: number): Promise<Article[]>;
|
package/dist/client.js
CHANGED
|
@@ -11,8 +11,9 @@ const FullProfile_1 = require("./classes/FullProfile");
|
|
|
11
11
|
const Release_1 = require("./classes/Release");
|
|
12
12
|
const form_data_1 = __importDefault(require("form-data"));
|
|
13
13
|
const Collection_1 = require("./classes/Collection");
|
|
14
|
-
const DEFAULT_BASE_URL = 'https://api.
|
|
15
|
-
const USER_AGENT = "AnixartApp/9.0 BETA
|
|
14
|
+
const DEFAULT_BASE_URL = 'https://api-s.anixsekai.com';
|
|
15
|
+
const USER_AGENT = "AnixartApp/9.0 BETA 7-25082901 (Android 9; SDK 28; x86_64; ROG ASUS AI2201_B; ru)";
|
|
16
|
+
const API_ENDPOINTS_URL = 'https://raw.githubusercontent.com/AnixHelper/pages/refs/heads/main/urls.json';
|
|
16
17
|
/**
|
|
17
18
|
* Класс для работы с API Anixart
|
|
18
19
|
*/
|
|
@@ -23,6 +24,9 @@ class Anixart {
|
|
|
23
24
|
this.baseUrl = (_a = options === null || options === void 0 ? void 0 : options.baseUrl) !== null && _a !== void 0 ? _a : DEFAULT_BASE_URL;
|
|
24
25
|
this.token = (_b = options === null || options === void 0 ? void 0 : options.token) !== null && _b !== void 0 ? _b : null;
|
|
25
26
|
}
|
|
27
|
+
static async getEndpointUrls() {
|
|
28
|
+
return await (await fetch(API_ENDPOINTS_URL)).json();
|
|
29
|
+
}
|
|
26
30
|
async getChannelById(id) {
|
|
27
31
|
const request = await this.endpoints.channel.info(id);
|
|
28
32
|
return request.channel ? new Channel_1.Channel(this, request.channel) : null;
|
|
@@ -110,7 +114,7 @@ class Anixart {
|
|
|
110
114
|
formData.setBoundary(request.image.boundary);
|
|
111
115
|
}
|
|
112
116
|
headers['Content-Length'] = String(formData.getLengthSync());
|
|
113
|
-
requestInit.body = formData.getBuffer();
|
|
117
|
+
requestInit.body = new Uint8Array(formData.getBuffer());
|
|
114
118
|
requestInit.headers = formData.getHeaders(headers);
|
|
115
119
|
break;
|
|
116
120
|
}
|
package/dist/types/channel.d.ts
CHANGED
|
@@ -142,8 +142,9 @@ export interface IArticle {
|
|
|
142
142
|
creation_date: number;
|
|
143
143
|
last_update_date: number;
|
|
144
144
|
is_deleted: boolean;
|
|
145
|
-
under_moderation_reason: string;
|
|
145
|
+
under_moderation_reason: string | null;
|
|
146
146
|
is_under_moderation: boolean;
|
|
147
|
+
contains_repost_article: boolean;
|
|
147
148
|
}
|
|
148
149
|
export interface IChannelBlockManageRequest {
|
|
149
150
|
target_profile_id: number;
|
package/dist/types/profile.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export interface IProfile {
|
|
|
44
44
|
discord_page: string;
|
|
45
45
|
ban_expires: number;
|
|
46
46
|
ban_reason: string;
|
|
47
|
-
ban_note:
|
|
47
|
+
ban_note: string | null;
|
|
48
48
|
privilege_level: number;
|
|
49
49
|
watching_count: number;
|
|
50
50
|
plan_count: number;
|
|
@@ -86,6 +86,28 @@ export interface IProfile {
|
|
|
86
86
|
is_online: boolean;
|
|
87
87
|
roles: IRole[];
|
|
88
88
|
badge: IBadge | null;
|
|
89
|
+
preferred_genres: IPreferredType[];
|
|
90
|
+
preferred_audiences: IPreferredType[];
|
|
91
|
+
preferred_themes: IPreferredType[];
|
|
92
|
+
theme_enabled: boolean;
|
|
93
|
+
theme_gradient_start_color: string | null;
|
|
94
|
+
theme_gradient_end_color: string | null;
|
|
95
|
+
theme_gradient_angle: string | null;
|
|
96
|
+
theme_icon_res_name: string | null;
|
|
97
|
+
theme_icon_url: string | null;
|
|
98
|
+
theme_icon_color: string | null;
|
|
99
|
+
theme_icon_alpha: number;
|
|
100
|
+
theme_icon_destiny: string | null;
|
|
101
|
+
theme_icon_size: string | null;
|
|
102
|
+
theme_animation_enabled: boolean;
|
|
103
|
+
theme_animation_speed: string | null;
|
|
104
|
+
theme_background_url: string | null;
|
|
105
|
+
theme_background_mode: string | null;
|
|
106
|
+
theme_background_alpha: number | null;
|
|
107
|
+
}
|
|
108
|
+
export interface IPreferredType {
|
|
109
|
+
name: string;
|
|
110
|
+
percentage: number;
|
|
89
111
|
}
|
|
90
112
|
export interface IWatchDynamics {
|
|
91
113
|
id: number;
|