anixapi 0.2.1 → 0.3.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/README.md +50 -81
- package/dist/api/auth.d.ts +63 -13
- package/dist/api/auth.js +68 -8
- package/dist/api/channel/channel.d.ts +11 -1
- package/dist/api/channel/channel.js +12 -0
- package/dist/api/config.d.ts +11 -1
- package/dist/api/config.js +12 -0
- package/dist/api/profile/profilePreference.d.ts +75 -25
- package/dist/api/profile/profilePreference.js +85 -25
- package/dist/api/release/type.d.ts +31 -1
- package/dist/api/release/type.js +36 -0
- package/dist/classes/Dubber.d.ts +1 -0
- package/dist/classes/Dubber.js +1 -0
- package/dist/classes/FullProfile.d.ts +2 -0
- package/dist/classes/FullProfile.js +3 -1
- package/dist/client.js +1 -1
- package/dist/types/auth.d.ts +92 -0
- package/dist/types/auth.js +45 -1
- package/dist/types/channel.d.ts +19 -0
- package/dist/types/config.d.ts +15 -1
- package/dist/types/config.js +2 -1
- package/dist/types/profile.d.ts +4 -0
- package/dist/types/release.d.ts +2 -0
- package/dist/types/settings.d.ts +98 -12
- package/dist/types/settings.js +50 -4
- package/dist/utils/LinkParser.js +5 -7
- package/docs/DOCUMENTATION.md +19 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
> **Дисклеймер.** Проект создан в **ознакомительных и исследовательских целях**. Автор **не поддерживает и осуждает** использование библиотеки для авторегистрации, спам-ботов, накрутки, обхода ограничений сервиса и любого злоупотребления API Anixart. Вы используете библиотеку **на свой страх и риск** и несёте ответственность за соблюдение правил Anixart и применимого законодательства.
|
|
3
3
|
|
|
4
4
|
> [!CAUTION]
|
|
5
|
-
> **Миграция с [theDesConnet/AnixartJS](https://github.com/theDesConnet/AnixartJS).** Плавного перехода на AnixApi **не будет**. Изменились структура `src/api`, имена эндпоинтов, типы, обработка ошибок (`AnixApiError`) и покрытие API 9.0
|
|
5
|
+
> **Миграция с [theDesConnet/AnixartJS](https://github.com/theDesConnet/AnixartJS).** Плавного перехода на AnixApi **не будет**. Изменились структура `src/api`, имена эндпоинтов, типы, обработка ошибок (`AnixApiError`) и покрытие API 9.0. При переносе с версии DesConnet закладывайте время на переписывание вызовов, импортов и проверку ответов. Подробности — в [документации](docs/DOCUMENTATION.md).
|
|
6
6
|
|
|
7
7
|
<h2 align="center">AnixApi</h2>
|
|
8
8
|
|
|
9
9
|
<p align="center">
|
|
10
10
|
TypeScript-обёртка над API Anixart 9.x для Node.js.<br>
|
|
11
|
-
|
|
11
|
+
286 эндпоинтов · OAuth (VK / Google / Telegram / Yandex) · типизация · доменные классы
|
|
12
12
|
</p>
|
|
13
13
|
|
|
14
14
|
<p align="center">
|
|
@@ -16,150 +16,119 @@
|
|
|
16
16
|
<a href="LICENSE">Лицензия GPL-2.0</a>
|
|
17
17
|
</p>
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
<p align="center">
|
|
20
|
+
<code>anixapi@0.3.1</code> · актуально под <strong>Anixart 9.0 BETA 21</strong> (build <code>26080522</code>)
|
|
21
|
+
</p>
|
|
21
22
|
|
|
23
|
+
---
|
|
22
24
|
|
|
23
25
|
## О проекте
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
**AnixApi** - неофициальная имплементация REST API приложения [Anixart](https://anixart.ru). Библиотека даёт типизированный доступ к эндпоинтам, высокоуровневые методы (`getReleaseById`, `getProfileById`, …) и классы-обёртки для статей, каналов, релизов и коллекций.
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
**AnixApi** — неофициальная имплементация REST API приложения [Anixart](https://anixart.ru). Библиотека даёт типизированный доступ к эндпоинтам, высокоуровневые методы (`getReleaseById`, `getProfileById`, …) и классы-обёртки для статей, каналов, релизов и коллекций.
|
|
30
28
|
|
|
31
29
|
### Форк и оригинал
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
|
|
35
31
|
Проект развивается на базе **[theDesConnet/AnixartJS](https://github.com/theDesConnet/AnixartJS)** (автор Roman U. / DesConnet, лицензия GPL-2.0).
|
|
36
32
|
|
|
33
|
+
| | |
|
|
34
|
+
|---|---|
|
|
37
35
|
| **Оригинальный репозиторий** | https://github.com/theDesConnet/AnixartJS |
|
|
38
|
-
|
|
39
36
|
| **Базовая архитектура API** | DesConnet |
|
|
40
|
-
|
|
41
|
-
| **Расширения** | полное покрытие API 9.0 beta 11, реструктуризация `src/api`, типы, `AnixApiError`, `typecheck` в сборке |
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
| **Расширения** | покрытие API 9.0 (до beta 21), реструктуризация `src/api`, типы, `AnixApiError`, OAuth-провайдеры, `typecheck` в сборке |
|
|
44
38
|
|
|
45
39
|
При публикации изменений обязательно сохраняйте указание на оригинальный проект и условия GPL-2.0.
|
|
46
40
|
|
|
47
|
-
|
|
48
|
-
|
|
49
41
|
---
|
|
50
42
|
|
|
51
|
-
|
|
52
|
-
|
|
53
43
|
## Быстрый старт
|
|
54
44
|
|
|
55
|
-
|
|
56
|
-
|
|
57
45
|
```bash
|
|
58
|
-
|
|
59
46
|
npm install anixapi
|
|
60
|
-
|
|
61
47
|
```
|
|
62
48
|
|
|
63
|
-
|
|
64
|
-
|
|
65
49
|
```javascript
|
|
66
|
-
|
|
67
50
|
const { Anixart, DefaultResult } = require("anixapi");
|
|
68
51
|
|
|
69
|
-
|
|
70
|
-
|
|
71
52
|
const client = new Anixart();
|
|
72
|
-
|
|
73
53
|
const code = await client.login("username", "password");
|
|
74
54
|
|
|
75
|
-
|
|
76
|
-
|
|
77
55
|
if (code === DefaultResult.Ok) {
|
|
78
|
-
|
|
79
56
|
const release = await client.endpoints.release.info(789, true);
|
|
80
|
-
|
|
81
57
|
console.log(release);
|
|
82
|
-
|
|
83
58
|
}
|
|
84
|
-
|
|
85
59
|
```
|
|
86
60
|
|
|
61
|
+
### OAuth (VK / Google / Telegram / Yandex)
|
|
87
62
|
|
|
63
|
+
```javascript
|
|
64
|
+
const { Anixart, DefaultResult, OAuthAuthResult } = require("anixapi");
|
|
88
65
|
|
|
89
|
-
|
|
66
|
+
const client = new Anixart();
|
|
90
67
|
|
|
68
|
+
// Вход: при code === 3 (NotRegistered) нужно signUpWith*
|
|
69
|
+
const res = await client.endpoints.auth.signInWithYandex({
|
|
70
|
+
yandexAccessToken: "...",
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
if (res.code === DefaultResult.Ok && res.profileToken) {
|
|
74
|
+
client.setToken(res.profileToken.token);
|
|
75
|
+
} else if (res.code === OAuthAuthResult.NotRegistered) {
|
|
76
|
+
await client.endpoints.auth.signUpWithYandex({
|
|
77
|
+
login: "newuser",
|
|
78
|
+
email: res.email || "user@example.com",
|
|
79
|
+
yandexAccessToken: "...",
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
```
|
|
91
83
|
|
|
84
|
+
| Провайдер | Sign-in | Поле токена |
|
|
85
|
+
|-----------|---------|-------------|
|
|
86
|
+
| VK | `signInWithVk` | `vkAccessToken` |
|
|
87
|
+
| Google | `signInWithGoogle` | `googleIdToken` |
|
|
88
|
+
| Telegram | `signInWithTelegram` | `telegramIdToken` |
|
|
89
|
+
| Yandex | `signInWithYandex` | `yandexAccessToken` |
|
|
92
90
|
|
|
93
|
-
|
|
91
|
+
Флаги доступности: `GET config/urls` → `vk_auth_available`, `google_auth_available`, `telegram_auth_available`, `yandex_auth_available`.
|
|
94
92
|
|
|
93
|
+
Подробные примеры, структура API и обработка ошибок — в **[документации](docs/DOCUMENTATION.md)**.
|
|
95
94
|
|
|
95
|
+
---
|
|
96
96
|
|
|
97
97
|
## Возможности
|
|
98
98
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
- **
|
|
102
|
-
|
|
103
|
-
-
|
|
104
|
-
|
|
105
|
-
- **Доменные классы** - `Article`, `Channel`, `Release`, `FullProfile`, `Collection`
|
|
106
|
-
|
|
107
|
-
- **Ошибки** - `AnixApiError`, `describeResultCode()`, опция `throwOnApiError`
|
|
108
|
-
|
|
109
|
-
|
|
99
|
+
- **286 эндпоинтов** — `client.endpoints.*` (Anixart 9.0 BETA 21)
|
|
100
|
+
- **OAuth** — VK, Google, Telegram, Yandex (sign-in / sign-up / bind / unbind)
|
|
101
|
+
- **TypeScript** — типы запросов, ответов и enum-кодов (`LoginResult`, `OAuthAuthResult`, …)
|
|
102
|
+
- **Доменные классы** — `Article`, `Channel`, `Release`, `FullProfile`, `Collection`
|
|
103
|
+
- **Ошибки** — `AnixApiError`, `describeResultCode()`, опция `throwOnApiError`
|
|
110
104
|
|
|
111
105
|
---
|
|
112
106
|
|
|
113
|
-
|
|
114
|
-
|
|
115
107
|
## TODO
|
|
116
108
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
- [x]
|
|
120
|
-
|
|
121
|
-
- [x] Типы / схемы / Swagger-документация
|
|
122
|
-
|
|
109
|
+
- [x] Все эндпоинты API (286, beta 21)
|
|
110
|
+
- [x] OAuth: VK / Google / Telegram / Yandex
|
|
111
|
+
- [x] Типы и документация
|
|
123
112
|
- [x] Классы для коллекций
|
|
124
|
-
|
|
125
113
|
- [ ] Возможность использовать библиотеку в браузере полностью
|
|
126
114
|
|
|
127
|
-
|
|
128
|
-
|
|
129
115
|
---
|
|
130
116
|
|
|
131
|
-
|
|
132
117
|
## Проекты на базе библиотеки
|
|
133
118
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
- [AniDesk](https://github.com/theDesConnet/AniDesk) - неофициальный десктоп-клиент Anixart
|
|
137
|
-
|
|
138
|
-
- [AnixApp](https://github.com/Maks1mio/anixapp) - неофициальное приложение Anixart для ПК
|
|
139
|
-
|
|
140
|
-
|
|
119
|
+
- [AniDesk](https://github.com/theDesConnet/AniDesk) — неофициальный десктоп-клиент Anixart
|
|
120
|
+
- [AnixApp](https://github.com/Maks1mio/anixapp) — неофициальное приложение Anixart для ПК
|
|
141
121
|
|
|
142
122
|
---
|
|
143
123
|
|
|
144
|
-
|
|
145
|
-
|
|
146
124
|
## Лицензия
|
|
147
125
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
Проект распространяется под **[GPL-2.0](LICENSE)** - как и [оригинальный AnixartJS](https://github.com/theDesConnet/AnixartJS).
|
|
151
|
-
|
|
152
|
-
|
|
126
|
+
Проект распространяется под **[GPL-2.0](LICENSE)** — как и [оригинальный AnixartJS](https://github.com/theDesConnet/AnixartJS).
|
|
153
127
|
|
|
154
128
|
---
|
|
155
129
|
|
|
156
|
-
|
|
157
|
-
|
|
158
130
|
## Связь
|
|
159
131
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
Вопросы и баги - через Issues в [репозитории AnixApi](https://github.com/Maks1mio/AnixApi).
|
|
132
|
+
Вопросы и баги — через Issues в [репозитории AnixApi](https://github.com/Maks1mio/anixapi).
|
|
163
133
|
|
|
164
134
|
Оригинальная библиотека: [theDesConnet/AnixartJS](https://github.com/theDesConnet/AnixartJS).
|
|
165
|
-
|
package/dist/api/auth.d.ts
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import { Anixart } from "../client";
|
|
2
|
-
import { IBaseApiParams, ILoginRequest, ILoginResponse, IOAuthGoogleSignInRequest, IOAuthGoogleSignUpRequest, IOAuthVkSignInRequest, IOAuthVkSignUpRequest, IRegisterResponse, IResendRequest, IResponse, IRestoreEmailRequest, IRestoreResendRequest, IRestoreVerifyRequest, ISignUpRequest, ISignUpVerifyRequest } from "../types";
|
|
2
|
+
import { IBaseApiParams, ICheckLoginRequest, ICheckLoginResponse, IGoogleAuthResponse, ILoginRequest, ILoginResponse, IOAuthGoogleSignInRequest, IOAuthGoogleSignUpRequest, IOAuthTelegramSignInRequest, IOAuthTelegramSignUpRequest, IOAuthVkSignInRequest, IOAuthVkSignUpRequest, IOAuthYandexSignInRequest, IOAuthYandexSignUpRequest, IRegisterResponse, IResendRequest, IResponse, IRestoreEmailRequest, IRestoreResendRequest, IRestoreVerifyRequest, ISignUpRequest, ISignUpVerifyRequest, ITelegramAuthResponse, IVkAuthResponse, IYandexAuthResponse } from "../types";
|
|
3
3
|
/**
|
|
4
4
|
* Класс с эндпоинтами авторизации
|
|
5
5
|
*/
|
|
6
6
|
export declare class Auth {
|
|
7
7
|
private readonly client;
|
|
8
8
|
constructor(client: Anixart);
|
|
9
|
+
/**
|
|
10
|
+
* POST auth/checkLogin
|
|
11
|
+
*
|
|
12
|
+
* Возможные коды ответа: {@link CheckLoginResult}
|
|
13
|
+
* @returns {@link ICheckLoginResponse}
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* const result = await client.endpoints.auth.checkLogin({ login: 'user' });
|
|
17
|
+
*/
|
|
18
|
+
checkLogin(data: ICheckLoginRequest, options?: IBaseApiParams): Promise<ICheckLoginResponse>;
|
|
9
19
|
/**
|
|
10
20
|
* POST auth/firebase
|
|
11
21
|
*
|
|
@@ -69,23 +79,43 @@ export declare class Auth {
|
|
|
69
79
|
/**
|
|
70
80
|
* POST auth/google
|
|
71
81
|
*
|
|
72
|
-
* Возможные коды ответа: {@link
|
|
73
|
-
* @returns {@link
|
|
82
|
+
* Возможные коды ответа: {@link GoogleAuthResult}
|
|
83
|
+
* @returns {@link IGoogleAuthResponse}
|
|
74
84
|
*
|
|
75
85
|
* @example
|
|
76
86
|
* const result = await client.endpoints.auth.signInWithGoogle(...);
|
|
77
87
|
*/
|
|
78
|
-
signInWithGoogle(data: IOAuthGoogleSignInRequest, options?: IBaseApiParams): Promise<
|
|
88
|
+
signInWithGoogle(data: IOAuthGoogleSignInRequest, options?: IBaseApiParams): Promise<IGoogleAuthResponse>;
|
|
89
|
+
/**
|
|
90
|
+
* POST auth/telegram
|
|
91
|
+
*
|
|
92
|
+
* Возможные коды ответа: {@link TelegramAuthResult}
|
|
93
|
+
* @returns {@link ITelegramAuthResponse}
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* const result = await client.endpoints.auth.signInWithTelegram(...);
|
|
97
|
+
*/
|
|
98
|
+
signInWithTelegram(data: IOAuthTelegramSignInRequest, options?: IBaseApiParams): Promise<ITelegramAuthResponse>;
|
|
79
99
|
/**
|
|
80
100
|
* POST auth/vk
|
|
81
101
|
*
|
|
82
|
-
* Возможные коды ответа: {@link
|
|
83
|
-
* @returns {@link
|
|
102
|
+
* Возможные коды ответа: {@link OAuthAuthResult}
|
|
103
|
+
* @returns {@link IVkAuthResponse}
|
|
84
104
|
*
|
|
85
105
|
* @example
|
|
86
106
|
* const result = await client.endpoints.auth.signInWithVk(...);
|
|
87
107
|
*/
|
|
88
|
-
signInWithVk(data: IOAuthVkSignInRequest, options?: IBaseApiParams): Promise<
|
|
108
|
+
signInWithVk(data: IOAuthVkSignInRequest, options?: IBaseApiParams): Promise<IVkAuthResponse>;
|
|
109
|
+
/**
|
|
110
|
+
* POST auth/yandex (с beta 21)
|
|
111
|
+
*
|
|
112
|
+
* Возможные коды ответа: {@link OAuthAuthResult}
|
|
113
|
+
* @returns {@link IYandexAuthResponse}
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* const result = await client.endpoints.auth.signInWithYandex({ yandexAccessToken });
|
|
117
|
+
*/
|
|
118
|
+
signInWithYandex(data: IOAuthYandexSignInRequest, options?: IBaseApiParams): Promise<IYandexAuthResponse>;
|
|
89
119
|
/**
|
|
90
120
|
* POST auth/signUp
|
|
91
121
|
*
|
|
@@ -99,23 +129,43 @@ export declare class Auth {
|
|
|
99
129
|
/**
|
|
100
130
|
* POST auth/google
|
|
101
131
|
*
|
|
102
|
-
* Возможные коды ответа: {@link
|
|
103
|
-
* @returns {@link
|
|
132
|
+
* Возможные коды ответа: {@link GoogleAuthResult}
|
|
133
|
+
* @returns {@link IGoogleAuthResponse}
|
|
104
134
|
*
|
|
105
135
|
* @example
|
|
106
136
|
* const result = await client.endpoints.auth.signUpWithGoogle(...);
|
|
107
137
|
*/
|
|
108
|
-
signUpWithGoogle(data: IOAuthGoogleSignUpRequest, options?: IBaseApiParams): Promise<
|
|
138
|
+
signUpWithGoogle(data: IOAuthGoogleSignUpRequest, options?: IBaseApiParams): Promise<IGoogleAuthResponse>;
|
|
139
|
+
/**
|
|
140
|
+
* POST auth/telegram
|
|
141
|
+
*
|
|
142
|
+
* Возможные коды ответа: {@link TelegramAuthResult}
|
|
143
|
+
* @returns {@link ITelegramAuthResponse}
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* const result = await client.endpoints.auth.signUpWithTelegram(...);
|
|
147
|
+
*/
|
|
148
|
+
signUpWithTelegram(data: IOAuthTelegramSignUpRequest, options?: IBaseApiParams): Promise<ITelegramAuthResponse>;
|
|
109
149
|
/**
|
|
110
150
|
* POST auth/vk
|
|
111
151
|
*
|
|
112
|
-
* Возможные коды ответа: {@link
|
|
113
|
-
* @returns {@link
|
|
152
|
+
* Возможные коды ответа: {@link OAuthAuthResult}
|
|
153
|
+
* @returns {@link IVkAuthResponse}
|
|
114
154
|
*
|
|
115
155
|
* @example
|
|
116
156
|
* const result = await client.endpoints.auth.signUpWithVk(...);
|
|
117
157
|
*/
|
|
118
|
-
signUpWithVk(data: IOAuthVkSignUpRequest, options?: IBaseApiParams): Promise<
|
|
158
|
+
signUpWithVk(data: IOAuthVkSignUpRequest, options?: IBaseApiParams): Promise<IVkAuthResponse>;
|
|
159
|
+
/**
|
|
160
|
+
* POST auth/yandex (с beta 21)
|
|
161
|
+
*
|
|
162
|
+
* Возможные коды ответа: {@link OAuthAuthResult}
|
|
163
|
+
* @returns {@link IYandexAuthResponse}
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* const result = await client.endpoints.auth.signUpWithYandex({ login, email, yandexAccessToken });
|
|
167
|
+
*/
|
|
168
|
+
signUpWithYandex(data: IOAuthYandexSignUpRequest, options?: IBaseApiParams): Promise<IYandexAuthResponse>;
|
|
119
169
|
/**
|
|
120
170
|
* POST auth/verify
|
|
121
171
|
*
|
package/dist/api/auth.js
CHANGED
|
@@ -8,6 +8,18 @@ class Auth {
|
|
|
8
8
|
constructor(client) {
|
|
9
9
|
this.client = client;
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* POST auth/checkLogin
|
|
13
|
+
*
|
|
14
|
+
* Возможные коды ответа: {@link CheckLoginResult}
|
|
15
|
+
* @returns {@link ICheckLoginResponse}
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* const result = await client.endpoints.auth.checkLogin({ login: 'user' });
|
|
19
|
+
*/
|
|
20
|
+
async checkLogin(data, options) {
|
|
21
|
+
return await this.client.call({ path: `/auth/checkLogin`, method: 'POST', urlEncoded: data, ...options });
|
|
22
|
+
}
|
|
11
23
|
/**
|
|
12
24
|
* POST auth/firebase
|
|
13
25
|
*
|
|
@@ -83,8 +95,8 @@ class Auth {
|
|
|
83
95
|
/**
|
|
84
96
|
* POST auth/google
|
|
85
97
|
*
|
|
86
|
-
* Возможные коды ответа: {@link
|
|
87
|
-
* @returns {@link
|
|
98
|
+
* Возможные коды ответа: {@link GoogleAuthResult}
|
|
99
|
+
* @returns {@link IGoogleAuthResponse}
|
|
88
100
|
*
|
|
89
101
|
* @example
|
|
90
102
|
* const result = await client.endpoints.auth.signInWithGoogle(...);
|
|
@@ -92,11 +104,23 @@ class Auth {
|
|
|
92
104
|
async signInWithGoogle(data, options) {
|
|
93
105
|
return await this.client.call({ path: `/auth/google`, method: 'POST', urlEncoded: data, ...options });
|
|
94
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* POST auth/telegram
|
|
109
|
+
*
|
|
110
|
+
* Возможные коды ответа: {@link TelegramAuthResult}
|
|
111
|
+
* @returns {@link ITelegramAuthResponse}
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* const result = await client.endpoints.auth.signInWithTelegram(...);
|
|
115
|
+
*/
|
|
116
|
+
async signInWithTelegram(data, options) {
|
|
117
|
+
return await this.client.call({ path: `/auth/telegram`, method: 'POST', urlEncoded: data, ...options });
|
|
118
|
+
}
|
|
95
119
|
/**
|
|
96
120
|
* POST auth/vk
|
|
97
121
|
*
|
|
98
|
-
* Возможные коды ответа: {@link
|
|
99
|
-
* @returns {@link
|
|
122
|
+
* Возможные коды ответа: {@link OAuthAuthResult}
|
|
123
|
+
* @returns {@link IVkAuthResponse}
|
|
100
124
|
*
|
|
101
125
|
* @example
|
|
102
126
|
* const result = await client.endpoints.auth.signInWithVk(...);
|
|
@@ -104,6 +128,18 @@ class Auth {
|
|
|
104
128
|
async signInWithVk(data, options) {
|
|
105
129
|
return await this.client.call({ path: `/auth/vk`, method: 'POST', urlEncoded: data, ...options });
|
|
106
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
* POST auth/yandex (с beta 21)
|
|
133
|
+
*
|
|
134
|
+
* Возможные коды ответа: {@link OAuthAuthResult}
|
|
135
|
+
* @returns {@link IYandexAuthResponse}
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* const result = await client.endpoints.auth.signInWithYandex({ yandexAccessToken });
|
|
139
|
+
*/
|
|
140
|
+
async signInWithYandex(data, options) {
|
|
141
|
+
return await this.client.call({ path: `/auth/yandex`, method: 'POST', urlEncoded: data, ...options });
|
|
142
|
+
}
|
|
107
143
|
/**
|
|
108
144
|
* POST auth/signUp
|
|
109
145
|
*
|
|
@@ -119,8 +155,8 @@ class Auth {
|
|
|
119
155
|
/**
|
|
120
156
|
* POST auth/google
|
|
121
157
|
*
|
|
122
|
-
* Возможные коды ответа: {@link
|
|
123
|
-
* @returns {@link
|
|
158
|
+
* Возможные коды ответа: {@link GoogleAuthResult}
|
|
159
|
+
* @returns {@link IGoogleAuthResponse}
|
|
124
160
|
*
|
|
125
161
|
* @example
|
|
126
162
|
* const result = await client.endpoints.auth.signUpWithGoogle(...);
|
|
@@ -128,11 +164,23 @@ class Auth {
|
|
|
128
164
|
async signUpWithGoogle(data, options) {
|
|
129
165
|
return await this.client.call({ path: `/auth/google`, method: 'POST', urlEncoded: data, ...options });
|
|
130
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* POST auth/telegram
|
|
169
|
+
*
|
|
170
|
+
* Возможные коды ответа: {@link TelegramAuthResult}
|
|
171
|
+
* @returns {@link ITelegramAuthResponse}
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* const result = await client.endpoints.auth.signUpWithTelegram(...);
|
|
175
|
+
*/
|
|
176
|
+
async signUpWithTelegram(data, options) {
|
|
177
|
+
return await this.client.call({ path: `/auth/telegram`, method: 'POST', urlEncoded: data, ...options });
|
|
178
|
+
}
|
|
131
179
|
/**
|
|
132
180
|
* POST auth/vk
|
|
133
181
|
*
|
|
134
|
-
* Возможные коды ответа: {@link
|
|
135
|
-
* @returns {@link
|
|
182
|
+
* Возможные коды ответа: {@link OAuthAuthResult}
|
|
183
|
+
* @returns {@link IVkAuthResponse}
|
|
136
184
|
*
|
|
137
185
|
* @example
|
|
138
186
|
* const result = await client.endpoints.auth.signUpWithVk(...);
|
|
@@ -140,6 +188,18 @@ class Auth {
|
|
|
140
188
|
async signUpWithVk(data, options) {
|
|
141
189
|
return await this.client.call({ path: `/auth/vk`, method: 'POST', urlEncoded: data, ...options });
|
|
142
190
|
}
|
|
191
|
+
/**
|
|
192
|
+
* POST auth/yandex (с beta 21)
|
|
193
|
+
*
|
|
194
|
+
* Возможные коды ответа: {@link OAuthAuthResult}
|
|
195
|
+
* @returns {@link IYandexAuthResponse}
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* const result = await client.endpoints.auth.signUpWithYandex({ login, email, yandexAccessToken });
|
|
199
|
+
*/
|
|
200
|
+
async signUpWithYandex(data, options) {
|
|
201
|
+
return await this.client.call({ path: `/auth/yandex`, method: 'POST', urlEncoded: data, ...options });
|
|
202
|
+
}
|
|
143
203
|
/**
|
|
144
204
|
* POST auth/verify
|
|
145
205
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Anixart } from "../../client";
|
|
2
|
-
import { IArticle, IArticleMuteResponse, IBaseApiParams, IChannel, IChannelBlockInfoResponse, IChannelBlockManageRequest, IChannelCreateRequest, IChannelMediaTokenResponse, IChannelPermissionManageRequest, IChannelPermissionManageResponse, IChannelPermissionsFilterRequest, IChannelProfile, IChannelResponse, IChannelSubscribeResponse, IChannelUnsubscribeResponse, IChannelUploadCoverAvatarResponse, IChannelsFilterRequest, IPageableResponse, ISubscriptionCountResponse } from "../../types";
|
|
2
|
+
import { IArticle, IArticleMuteResponse, IBaseApiParams, IChannel, IChannelBlockInfoResponse, IChannelBlockManageRequest, IChannelCreateRequest, IChannelMediaTokenResponse, IChannelPermissionManageRequest, IChannelPermissionManageResponse, IChannelPermissionsFilterRequest, IChannelProfile, IChannelResponse, IChannelSubscribeResponse, IChannelUnsubscribeResponse, IChannelUploadCoverAvatarResponse, IChannelsFilterRequest, IEditorChannelsResponse, IPageableResponse, ISubscriptionCountResponse } from "../../types";
|
|
3
3
|
/**
|
|
4
4
|
* Класс с эндпоинтами каналов
|
|
5
5
|
*/
|
|
@@ -146,6 +146,16 @@ export declare class Channel {
|
|
|
146
146
|
* const result = await client.endpoints.channel.editorAvailable(1, ...);
|
|
147
147
|
*/
|
|
148
148
|
editorAvailable(channelId: number, query?: Record<string, string | number | boolean | undefined>, options?: IBaseApiParams): Promise<IChannelMediaTokenResponse>;
|
|
149
|
+
/**
|
|
150
|
+
* GET channel/editor/available/all
|
|
151
|
+
*
|
|
152
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
153
|
+
* @returns {@link IEditorChannelsResponse}
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* const result = await client.endpoints.channel.editorAvailableAll(...);
|
|
157
|
+
*/
|
|
158
|
+
editorAvailableAll(options?: IBaseApiParams): Promise<IEditorChannelsResponse>;
|
|
149
159
|
/**
|
|
150
160
|
* POST channel/mute/{c_id}
|
|
151
161
|
*
|
|
@@ -176,6 +176,18 @@ class Channel {
|
|
|
176
176
|
async editorAvailable(channelId, query, options) {
|
|
177
177
|
return await this.client.call({ path: `/channel/${channelId}/editor/available`, queryParams: query, ...options });
|
|
178
178
|
}
|
|
179
|
+
/**
|
|
180
|
+
* GET channel/editor/available/all
|
|
181
|
+
*
|
|
182
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
183
|
+
* @returns {@link IEditorChannelsResponse}
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* const result = await client.endpoints.channel.editorAvailableAll(...);
|
|
187
|
+
*/
|
|
188
|
+
async editorAvailableAll(options) {
|
|
189
|
+
return await this.client.call({ path: `/channel/editor/available/all`, ...options });
|
|
190
|
+
}
|
|
179
191
|
/**
|
|
180
192
|
* POST channel/mute/{c_id}
|
|
181
193
|
*
|
package/dist/api/config.d.ts
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import { Anixart } from "../client";
|
|
2
|
-
import { IBaseApiParams, IConfigUrlsResponse, ITogglesResponse } from "../types";
|
|
2
|
+
import { IAnixPlayerConfigResponse, IBaseApiParams, IConfigUrlsResponse, ITogglesResponse } from "../types";
|
|
3
3
|
/**
|
|
4
4
|
* Класс с эндпоинтами конфигурации
|
|
5
5
|
*/
|
|
6
6
|
export declare class Config {
|
|
7
7
|
private readonly client;
|
|
8
8
|
constructor(client: Anixart);
|
|
9
|
+
/**
|
|
10
|
+
* GET config/anixplayer
|
|
11
|
+
*
|
|
12
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
13
|
+
* @returns {@link IAnixPlayerConfigResponse}
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* const result = await client.endpoints.config.anixplayer(...);
|
|
17
|
+
*/
|
|
18
|
+
anixplayer(query?: Record<string, string | number | boolean | undefined>, options?: IBaseApiParams): Promise<IAnixPlayerConfigResponse>;
|
|
9
19
|
/**
|
|
10
20
|
* GET config/toggles
|
|
11
21
|
*
|
package/dist/api/config.js
CHANGED
|
@@ -8,6 +8,18 @@ class Config {
|
|
|
8
8
|
constructor(client) {
|
|
9
9
|
this.client = client;
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* GET config/anixplayer
|
|
13
|
+
*
|
|
14
|
+
* Возможные коды ответа: {@link DefaultResult}
|
|
15
|
+
* @returns {@link IAnixPlayerConfigResponse}
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* const result = await client.endpoints.config.anixplayer(...);
|
|
19
|
+
*/
|
|
20
|
+
async anixplayer(query, options) {
|
|
21
|
+
return await this.client.call({ path: `/config/anixplayer`, queryParams: query, ...options });
|
|
22
|
+
}
|
|
11
23
|
/**
|
|
12
24
|
* GET config/toggles
|
|
13
25
|
*
|