anixartjs 0.0.6 → 0.0.8
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/collection.d.ts +4 -1
- package/dist/api/collection.js +9 -0
- 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.js +2 -2
- package/dist/types/channel.d.ts +2 -1
- package/dist/types/collection.d.ts +4 -0
- 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
|
}
|
package/dist/api/collection.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Anixart } from "../client";
|
|
2
|
-
import { IPageableResponse, IResponse, IBaseApiParams, ICollectionResponse, IRelease, ICollection, IReleaseInCollectionRequest, ICollectionCreateRequest } from "../types";
|
|
2
|
+
import { IPageableResponse, IResponse, IBaseApiParams, ICollectionResponse, IRelease, ICollection, IReleaseInCollectionRequest, ICollectionCreateRequest, ICollectionComment } from "../types";
|
|
3
3
|
/**
|
|
4
4
|
* Класс коллекции
|
|
5
5
|
*
|
|
@@ -27,4 +27,7 @@ export declare class Collection {
|
|
|
27
27
|
*/
|
|
28
28
|
addReleaseToCollection(collectionId: number, releaseId: number, options?: IBaseApiParams): Promise<IResponse>;
|
|
29
29
|
deleteCollection(id: number, options?: IBaseApiParams): Promise<IResponse>;
|
|
30
|
+
getComments(id: number, page: number, sort: number, options?: IBaseApiParams): Promise<IPageableResponse<ICollectionComment>>;
|
|
31
|
+
getComment(id: number, options?: IBaseApiParams): Promise<IResponse & ICollectionComment>;
|
|
32
|
+
getCommentReplies(id: number, page: number, sort: number, options?: IBaseApiParams): Promise<IPageableResponse<ICollectionComment>>;
|
|
30
33
|
}
|
package/dist/api/collection.js
CHANGED
|
@@ -53,5 +53,14 @@ class Collection {
|
|
|
53
53
|
async deleteCollection(id, options) {
|
|
54
54
|
return await this.client.call({ path: `/collectionMy/delete/${id}`, ...options });
|
|
55
55
|
}
|
|
56
|
+
async getComments(id, page, sort, options) {
|
|
57
|
+
return await this.client.call({ path: `/collection/comment/all/${id}/${page}`, queryParams: { sort }, ...options });
|
|
58
|
+
}
|
|
59
|
+
async getComment(id, options) {
|
|
60
|
+
return await this.client.call({ path: `/collection/comment/${id}`, ...options });
|
|
61
|
+
}
|
|
62
|
+
async getCommentReplies(id, page, sort, options) {
|
|
63
|
+
return await this.client.call({ path: `/collection/comment/replies/${id}/${page}`, queryParams: { sort }, method: "POST", ...options });
|
|
64
|
+
}
|
|
56
65
|
}
|
|
57
66
|
exports.Collection = Collection;
|
|
@@ -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.js
CHANGED
|
@@ -11,7 +11,7 @@ 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.
|
|
14
|
+
const DEFAULT_BASE_URL = 'https://api-s.anixsekai.com';
|
|
15
15
|
const USER_AGENT = "AnixartApp/9.0 BETA 3-25021818 (Android 9; SDK 28; x86_64; ROG ASUS AI2201_B; ru)";
|
|
16
16
|
/**
|
|
17
17
|
* Класс для работы с API Anixart
|
|
@@ -110,7 +110,7 @@ class Anixart {
|
|
|
110
110
|
formData.setBoundary(request.image.boundary);
|
|
111
111
|
}
|
|
112
112
|
headers['Content-Length'] = String(formData.getLengthSync());
|
|
113
|
-
requestInit.body = formData.getBuffer();
|
|
113
|
+
requestInit.body = new Uint8Array(formData.getBuffer());
|
|
114
114
|
requestInit.headers = formData.getHeaders(headers);
|
|
115
115
|
break;
|
|
116
116
|
}
|
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;
|
|
@@ -2,6 +2,7 @@ import { IProfile } from "./profile";
|
|
|
2
2
|
import { IRelease } from "./release";
|
|
3
3
|
import { IResponse } from "./response";
|
|
4
4
|
import { IBaseRequestPageable } from "./request";
|
|
5
|
+
import { BaseComment } from "../classes/BaseComment";
|
|
5
6
|
export interface ICollection {
|
|
6
7
|
'@id': number;
|
|
7
8
|
id: number;
|
|
@@ -36,3 +37,6 @@ export interface ICollectionCreateRequest {
|
|
|
36
37
|
releases: number[];
|
|
37
38
|
is_private: boolean;
|
|
38
39
|
}
|
|
40
|
+
export interface ICollectionComment extends BaseComment {
|
|
41
|
+
collection: ICollection;
|
|
42
|
+
}
|
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;
|