anixartjs 0.0.8 → 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/notification.d.ts +1 -1
- package/dist/api/notification.js +3 -2
- package/dist/client.d.ts +7 -0
- package/dist/client.js +5 -1
- package/package.json +1 -1
|
@@ -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;
|
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
|
@@ -12,7 +12,8 @@ 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
14
|
const DEFAULT_BASE_URL = 'https://api-s.anixsekai.com';
|
|
15
|
-
const USER_AGENT = "AnixartApp/9.0 BETA
|
|
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;
|