anixartjs 0.0.7 → 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.
@@ -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.anixart.tv", ...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.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.anixart.tv", bearer: media_token, queryParams: { url: link }, ...options });
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
  }
@@ -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.anixart.tv';
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
  }
@@ -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;
@@ -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: unknown;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anixartjs",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "Anixart API Wrapper for NodeJS",
5
5
  "type": "commonjs",
6
6
  "main": "dist/index.js",